diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000000..b4f7967831a --- /dev/null +++ b/.clang-format @@ -0,0 +1,26 @@ +--- +BasedOnStyle: Google +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: 'true' +AlignConsecutiveDeclarations: 'true' +AlignOperands: 'true' +AllowAllParametersOfDeclarationOnNextLine: 'false' +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: 'false' +BinPackArguments: 'true' +BinPackParameters: 'true' +ColumnLimit: '1000' +IndentCaseLabels: 'true' +IndentPPDirectives: AfterHash +IndentWidth: '4' +MaxEmptyLinesToKeep: '1' +PointerAlignment: Right +SortIncludes: 'false' +SpaceBeforeAssignmentOperators: 'true' +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: 'false' +TabWidth: '4' +UseTab: Never + +... diff --git a/.editorconfig b/.editorconfig index 4cd051ce952..60827f04baf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,7 @@ root = true [*] indent_style = space -indent_size = 2 +indent_size = 4 # We recommend you to keep these unchanged charset = utf-8 @@ -16,12 +16,18 @@ insert_final_newline = true trim_trailing_whitespace = false indent_size = 4 +[{qmk,*.py}] +charset = utf-8 +max_line_length = 200 + # Make these match what we have in .gitattributes [*.mk] end_of_line = lf +indent_style = tab [Makefile] end_of_line = lf +indent_style = tab [*.sh] end_of_line = lf diff --git a/.github/ISSUE_TEMPLATE/blank.md b/.github/ISSUE_TEMPLATE/blank.md new file mode 100644 index 00000000000..50a32034d6e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/blank.md @@ -0,0 +1,5 @@ +--- +name: Blank issue +about: If you're 100% sure that you don't need one of the other issue templates, use this one instead. + +--- diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..3c35416e043 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve the QMK Firmware +--- + + + + + +## Describe the Bug + + + +## System Information + + - Keyboard: + - Revision (if applicable): + - Operating system: + - AVR GCC version: + + - ARM GCC version: + + - QMK Firmware version: + + - Any keyboard related software installed? + - [ ] AutoHotKey + - [ ] Karabiner + - [ ] Other: + +## Additional Context + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..01aeb26cec3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest a new feature or changes to existing features +--- + + + + + +## Feature Request Type + +- [ ] Core functionality +- [ ] Add-on hardware support (eg. audio, RGB, OLED screen, etc.) +- [ ] Alteration (enhancement/optimization) of existing feature(s) +- [ ] New behavior + +## Description + + diff --git a/.github/ISSUE_TEMPLATE/other_issues.md b/.github/ISSUE_TEMPLATE/other_issues.md new file mode 100644 index 00000000000..7c4891ac31d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other_issues.md @@ -0,0 +1,9 @@ +--- +name: Other issues +about: Anything else that doesn't fall into the above categories. +--- + + + + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..cbc018ea057 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,34 @@ + + + + + +## Description + + + +## Types of Changes + + +- [ ] Core +- [ ] Bugfix +- [ ] New feature +- [ ] Enhancement/optimization +- [ ] Keyboard (addition or update) +- [ ] Keymap/layout/userspace (addition or update) +- [ ] Documentation + +## Issues Fixed or Closed by This PR + +* + +## Checklist + + + +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. +- [ ] I have read the [**CONTRIBUTING** document](https://docs.qmk.fm/#/contributing). +- [ ] I have added tests to cover my changes. +- [ ] I have tested the changes and verified that they work and don't break anything (as well as I can manage). diff --git a/.gitignore b/.gitignore index 799fb54def9..140bf4aa7e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.history/ .dep *.o *.bin @@ -53,6 +54,7 @@ util/Win_Check_Output.txt .vscode/tasks.json .vscode/last.sql .vscode/temp.sql +.vscode/ipch/ .stfolder .tags @@ -68,3 +70,6 @@ util/Win_Check_Output.txt secrets.tar id_rsa_* /.vs + +# python things +__pycache__ diff --git a/.travis.yml b/.travis.yml index 7ff4060ab7c..52c8f50a868 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,30 +10,24 @@ branches: env: global: - secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM= -before_install: - - wget http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz || wget http://qmk.fm/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz + - MAKEFLAGS="-j3 --output-sync" +services: + - docker install: - - 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" - npm install -g moxygen -before_script: - - avr-gcc --version script: -- make test:all AUTOGEN=false -- bash util/travis_build.sh -- bash util/travis_docs.sh + - git rev-parse --short HEAD + - bash util/travis_test.sh + - bash util/travis_build.sh + - bash util/travis_docs.sh addons: apt: packages: - - dfu-programmer - pandoc - - gcc-arm-none-eabi - - binutils-arm-none-eabi - - libnewlib-arm-none-eabi - diffutils - dos2unix - doxygen -after_success: +after_success: bash util/travis_compiled_push.sh notifications: webhooks: diff --git a/Dockerfile b/Dockerfile index dfde33b5cca..17831c4ec30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,7 @@ -FROM debian:jessie -MAINTAINER Erik Dasque +FROM qmkfm/base_container -RUN apt-get update && apt-get install --no-install-recommends -y build-essential \ - gcc \ - unzip \ - wget \ - zip \ - gcc-avr \ - binutils-avr \ - avr-libc \ - dfu-programmer \ - dfu-util \ - gcc-arm-none-eabi \ - binutils-arm-none-eabi \ - libnewlib-arm-none-eabi \ - git \ - software-properties-common \ - avrdude \ - && rm -rf /var/lib/apt/lists/* +VOLUME /qmk_firmware +WORKDIR /qmk_firmware +COPY . . -ENV keyboard=ergodox -ENV subproject=ez -ENV keymap=default - -VOLUME /qmk -WORKDIR /qmk -CMD make clean ; make keyboard=${keyboard} subproject=${subproject} keymap=${keymap} +CMD make all:default diff --git a/Makefile b/Makefile index 45e47c00371..a6c3ee35b7a 100644 --- a/Makefile +++ b/Makefile @@ -112,23 +112,29 @@ $(eval $(call GET_KEYBOARDS)) # Only consider folders with makefiles, to prevent errors in case there are extra folders #KEYBOARDS += $(patsubst $(ROOD_DIR)/keyboards/%/rules.mk,%,$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk)) +.PHONY: list-keyboards list-keyboards: echo $(KEYBOARDS) - exit 0 define PRINT_KEYBOARD $(info $(PRINTING_KEYBOARD)) endef +.PHONY: generate-keyboards-file generate-keyboards-file: $(foreach PRINTING_KEYBOARD,$(KEYBOARDS),$(eval $(call PRINT_KEYBOARD))) - exit 0 +.PHONY: clean clean: - echo -n 'Deleting .build ... ' + echo -n 'Deleting .build/ ... ' rm -rf $(BUILD_DIR) - echo 'done' - exit 0 + echo 'done.' + +.PHONY: distclean +distclean: clean + echo -n 'Deleting *.bin and *.hex ... ' + rm -f *.bin *.hex + echo 'done.' #Compatibility with the old make variables, anything you specify directly on the command line # always overrides the detected folders @@ -528,11 +534,13 @@ endef %: # Check if we have the CMP tool installed cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; + # Ensure that python3 is installed. This check can be removed after python is used in more places. + if ! python3 --version 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi # Check if the submodules are dirty, and display a warning if they are ifndef SKIP_GIT - if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --init lib/chibios; fi - if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --init lib/chibios-contrib; fi - if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --init lib/ugfx; fi + if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 1 --init lib/chibios; fi + if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 1 --init lib/chibios-contrib; fi + if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --depth 1 --init lib/ugfx; fi git submodule status --recursive 2>/dev/null | \ while IFS= read -r x; do \ case "$$x" in \ @@ -548,9 +556,10 @@ endif # it has to be there to allow parallel execution of the submake # This always tries to compile everything, even if error occurs in the middle # But we return the error code at the end, to trigger travis failures - $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) + # The sort at this point is to remove duplicates + $(foreach COMMAND,$(sort $(COMMANDS)),$(RUN_COMMAND)) if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi; - $(foreach TEST,$(TESTS),$(RUN_TEST)) + $(foreach TEST,$(sort $(TESTS)),$(RUN_TEST)) if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi; # These no longer work because of the colon system @@ -576,6 +585,7 @@ lib/%: git submodule sync $? git submodule update --init $? +.PHONY: git-submodule git-submodule: git submodule sync --recursive git submodule update --init --recursive --progress diff --git a/Vagrantfile b/Vagrantfile index 9c414b2bcb9..dae4e0d53d9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,8 +2,13 @@ # vi: set ft=ruby : Vagrant.configure(2) do |config| - # VMware/Virtualbox 64 bit - config.vm.box = "phusion/ubuntu-14.04-amd64" + # define a name instead of just 'default' + config.vm.define "qmk_firmware" + + # VMware/Virtualbox ( and also Hyperv/Parallels) 64 bit + config.vm.box = "generic/debian9" + + config.vm.synced_folder '.', '/vagrant' # This section allows you to customize the Virtualbox VM # settings, ie showing the GUI or upping the memory @@ -15,13 +20,16 @@ Vagrant.configure(2) do |config| # your Teensy via the VM rather than your host OS #vb.customize ['modifyvm', :id, '--usb', 'on'] #vb.customize ['usbfilter', 'add', '0', - # '--target', :id, - # '--name', 'teensy', - # '--vendorid', '0x16c0', - # '--productid','0x0478' - # ] + # '--target', :id, + # '--name', 'teensy', + # '--vendorid', '0x16c0', + # '--productid','0x0478' + # ] # Customize the amount of memory on the VM: vb.memory = "512" + # Uncomment the below lines if you have time sync + # issues with make and incremental builds + #vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ] end # This section allows you to customize the VMware VM @@ -44,31 +52,41 @@ Vagrant.configure(2) do |config| end # Docker provider pulls from hub.docker.com respecting docker.image if - # config.vm.box is nil. Note that this bind-mounts from the current dir to + # config.vm.box is nil. In this case, we adhoc build util/vagrant/Dockerfile. + # Note that this bind-mounts from the current dir to # /vagrant in the guest, so unless your UID is 1000 to match vagrant in the # image, you'll need to: chmod -R a+rw . config.vm.provider "docker" do |docker, override| override.vm.box = nil - docker.image = "jesselang/debian-vagrant:jessie" + docker.build_dir = "util/vagrant" docker.has_ssh = true end - # This script ensures the required packages for AVR programming are installed - # It also ensures the system always gets the latest updates when powered on - # If this causes issues you can run a 'vagrant destroy' and then - # add a # before ,args: and run 'vagrant up' to get a working - # non-updated box and then attempt to troubleshoot or open a Github issue + # Unless we are running the docker container directly + # 1. run container detached on vm + # 2. attach on 'vagrant ssh' + ["virtualbox", "vmware_workstation", "vmware_fusion"].each do |type| + config.vm.provider type do |virt, override| + override.vm.provision "docker" do |d| + d.run "qmkfm/base_container", + cmd: "tail -f /dev/null", + args: "--privileged -v /dev:/dev -v '/vagrant:/vagrant'" + end - config.vm.provision "shell", run: "always", path: "./util/qmk_install.sh", args: "-update" + override.vm.provision "shell", inline: <<-SHELL + echo 'docker restart qmkfm-base_container && exec docker exec -it qmkfm-base_container /bin/bash -l' >> ~vagrant/.bashrc + SHELL + end + end config.vm.post_up_message = <<-EOT - Log into the VM using 'vagrant ssh'. QMK directory synchronized with host is - located at /vagrant - To compile the .hex files use make command inside this directory. + Log into the environment using 'vagrant ssh'. QMK directory synchronized with + host is located at /vagrant + To compile the .hex files use make command inside this directory, e.g. + cd /vagrant + make :default - QMK's make format recently changed to use folder locations and colons: - make project_folder:keymap[:target] Examples: make planck/rev4:default:dfu make planck:default diff --git a/bin/qmk b/bin/qmk new file mode 100755 index 00000000000..c34365bed43 --- /dev/null +++ b/bin/qmk @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 +"""CLI wrapper for running QMK commands. +""" +import os +import subprocess +import sys +from glob import glob +from time import strftime +from importlib import import_module +from importlib.util import find_spec + +# Add the QMK python libs to our path +script_dir = os.path.dirname(os.path.realpath(__file__)) +qmk_dir = os.path.abspath(os.path.join(script_dir, '..')) +python_lib_dir = os.path.abspath(os.path.join(qmk_dir, 'lib', 'python')) +sys.path.append(python_lib_dir) + +# Change to the root of our checkout +os.environ['ORIG_CWD'] = os.getcwd() +os.chdir(qmk_dir) + +# Make sure our modules have been setup +with open('requirements.txt', 'r') as fd: + for line in fd.readlines(): + line = line.strip().replace('<', '=').replace('>', '=') + + if line[0] == '#': + continue + + if '#' in line: + line = line.split('#')[0] + + module = line.split('=')[0] if '=' in line else line + if not find_spec(module): + print('Your QMK build environment is not fully setup!\n') + print('Please run `./util/qmk_install.sh` to setup QMK.') + exit(255) + +# Figure out our version +command = ['git', 'describe', '--abbrev=6', '--dirty', '--always', '--tags'] +result = subprocess.run(command, text=True, capture_output=True) + +if result.returncode == 0: + os.environ['QMK_VERSION'] = 'QMK ' + result.stdout.strip() +else: + os.environ['QMK_VERSION'] = 'QMK ' + strftime('%Y-%m-%d-%H:%M:%S') + +# Setup the CLI +import milc +milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}ψ{style_reset_all}' + +# If we were invoked as `qmk ` massage sys.argv into `qmk-`. +# This means we can't accept arguments to the qmk script itself. +script_name = os.path.basename(sys.argv[0]) +if script_name == 'qmk': + if len(sys.argv) == 1: + milc.cli.log.error('No subcommand specified!\n') + + if len(sys.argv) == 1 or sys.argv[1] in ['-h', '--help']: + milc.cli.echo('usage: qmk [...]') + milc.cli.echo('\nsubcommands:') + subcommands = glob(os.path.join(qmk_dir, 'bin', 'qmk-*')) + for subcommand in sorted(subcommands): + subcommand = os.path.basename(subcommand).split('-', 1)[1] + milc.cli.echo('\t%s', subcommand) + milc.cli.echo('\nqmk --help for more information') + exit(1) + + if sys.argv[1] in ['-V', '--version']: + milc.cli.echo(os.environ['QMK_VERSION']) + exit(0) + + sys.argv[0] = script_name = '-'.join((script_name, sys.argv[1])) + del sys.argv[1] + +# Look for which module to import +if script_name == 'qmk': + milc.cli.print_help() + exit(0) +elif not script_name.startswith('qmk-'): + milc.cli.log.error('Invalid symlink, must start with "qmk-": %s', script_name) +else: + subcommand = script_name.replace('-', '.').replace('_', '.').split('.') + subcommand.insert(1, 'cli') + subcommand = '.'.join(subcommand) + + try: + import_module(subcommand) + except ModuleNotFoundError as e: + if e.__class__.__name__ != subcommand: + raise + + milc.cli.log.error('Invalid subcommand! Could not import %s.', subcommand) + exit(1) + +if __name__ == '__main__': + milc.cli() diff --git a/bin/qmk-compile-json b/bin/qmk-compile-json new file mode 120000 index 00000000000..c92dce8a10d --- /dev/null +++ b/bin/qmk-compile-json @@ -0,0 +1 @@ +qmk \ No newline at end of file diff --git a/bin/qmk-doctor b/bin/qmk-doctor new file mode 120000 index 00000000000..c92dce8a10d --- /dev/null +++ b/bin/qmk-doctor @@ -0,0 +1 @@ +qmk \ No newline at end of file diff --git a/bin/qmk-hello b/bin/qmk-hello new file mode 120000 index 00000000000..c92dce8a10d --- /dev/null +++ b/bin/qmk-hello @@ -0,0 +1 @@ +qmk \ No newline at end of file diff --git a/bin/qmk-json-keymap b/bin/qmk-json-keymap new file mode 120000 index 00000000000..c92dce8a10d --- /dev/null +++ b/bin/qmk-json-keymap @@ -0,0 +1 @@ +qmk \ No newline at end of file diff --git a/bootloader.mk b/bootloader.mk index 4bcf183fb77..9d73063d0fc 100644 --- a/bootloader.mk +++ b/bootloader.mk @@ -76,6 +76,10 @@ ifeq ($(strip $(BOOTLOADER)), bootloadHID) OPT_DEFS += -DBOOTLOADER_BOOTLOADHID BOOTLOADER_SIZE = 4096 endif +ifeq ($(strip $(BOOTLOADER)), USBasp) + OPT_DEFS += -DBOOTLOADER_USBASP + BOOTLOADER_SIZE = 4096 +endif ifdef BOOTLOADER_SIZE OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE)) diff --git a/build_json.mk b/build_json.mk new file mode 100644 index 00000000000..8820a8f4a65 --- /dev/null +++ b/build_json.mk @@ -0,0 +1,27 @@ +# Look for a json keymap file +ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.json)","") + KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c + KEYMAP_JSON := $(MAIN_KEYMAP_PATH_5)/keymap.json + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5) +else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.json)","") + KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c + KEYMAP_JSON := $(MAIN_KEYMAP_PATH_4)/keymap.json + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4) +else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.json)","") + KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c + KEYMAP_JSON := $(MAIN_KEYMAP_PATH_3)/keymap.json + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3) +else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.json)","") + KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c + KEYMAP_JSON := $(MAIN_KEYMAP_PATH_2)/keymap.json + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2) +else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","") + KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c + KEYMAP_JSON := $(MAIN_KEYMAP_PATH_1)/keymap.json + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) +endif + +# Generate the keymap.c +ifneq ("$(KEYMAP_JSON)","") + _ = $(shell test -e $(KEYMAP_C) || bin/qmk-json-keymap $(KEYMAP_JSON) -o $(KEYMAP_C)) +endif diff --git a/build_keyboard.mk b/build_keyboard.mk index d225fe82160..b086420653f 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -16,6 +16,7 @@ include common.mk KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD)) TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP) KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE) +STM32_PATH := quantum/stm32 # Force expansion TARGET := $(TARGET) @@ -34,6 +35,10 @@ $(error MASTER does not have a valid value(left/right)) endif endif +ifdef SKIP_VERSION + OPT_DEFS += -DSKIP_VERSION +endif + # Determine which subfolders exist. KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD) KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1))) @@ -68,6 +73,7 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","") KEYBOARD_PATHS += $(KEYBOARD_PATH_1) endif + # Pull in rules.mk files from all our subfolders ifneq ("$(wildcard $(KEYBOARD_PATH_5)/rules.mk)","") include $(KEYBOARD_PATH_5)/rules.mk @@ -85,6 +91,69 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","") include $(KEYBOARD_PATH_1)/rules.mk endif + +MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP) +MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP) +MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP) +MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP) +MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP) + +# Check for keymap.json first, so we can regenerate keymap.c +include build_json.mk + +ifeq ("$(wildcard $(KEYMAP_PATH))", "") + # Look through the possible keymap folders until we find a matching keymap.c + ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_5)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_5)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5) + else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_4)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_4)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4) + else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_3)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_3)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3) + else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_2)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_2)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2) + else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_1)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_1)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) + else ifneq ($(LAYOUTS),) + # If we haven't found a keymap yet fall back to community layouts + include build_layout.mk + else + $(error Could not find keymap) + # this state should never be reached + endif +endif + +ifeq ($(strip $(CTPC)), yes) + CONVERT_TO_PROTON_C=yes +endif + +ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes) + TARGET := $(TARGET)_proton_c + include $(STM32_PATH)/proton_c.mk + OPT_DEFS += -DCONVERT_TO_PROTON_C +endif + +ifneq ($(FORCE_LAYOUT),) + TARGET := $(TARGET)_$(FORCE_LAYOUT) +endif + +include quantum/mcu_selection.mk + +ifdef MCU_FAMILY + OPT_DEFS += -DQMK_STM32 + KEYBOARD_PATHS += $(STM32_PATH) +endif + + # Find all the C source files to be compiled in subfolders. KEYBOARD_SRC := @@ -218,44 +287,28 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/config.h)","") CONFIG_H += $(KEYBOARD_PATH_1)/config.h endif +POST_CONFIG_H := +ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_config.h)","") + POST_CONFIG_H += $(KEYBOARD_PATH_1)/post_config.h +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_2)/post_config.h)","") + POST_CONFIG_H += $(KEYBOARD_PATH_2)/post_config.h +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_3)/post_config.h)","") + POST_CONFIG_H += $(KEYBOARD_PATH_3)/post_config.h +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_4)/post_config.h)","") + POST_CONFIG_H += $(KEYBOARD_PATH_4)/post_config.h +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_config.h)","") + POST_CONFIG_H += $(KEYBOARD_PATH_5)/post_config.h +endif + # Save the defines and includes here, so we don't include any keymap specific ones PROJECT_DEFS := $(OPT_DEFS) PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS) PROJECT_CONFIG := $(CONFIG_H) -MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP) -MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP) -MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP) -MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP) -MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP) - -ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_5)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_5)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5) -else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_4)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_4)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4) -else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_3)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_3)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3) -else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_2)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_2)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2) -else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_1)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_1)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) -else ifneq ($(LAYOUTS),) - include build_layout.mk -else - $(error Could not find keymap) - # this state should never be reached -endif - # Userspace setup and definitions ifeq ("$(USER_NAME)","") USER_NAME := $(KEYMAP) @@ -267,7 +320,6 @@ ifneq ("$(wildcard $(USER_PATH)/config.h)","") CONFIG_H += $(USER_PATH)/config.h endif - # Object files directory # To put object files in current directory, use a dot (.), do NOT make # this an empty or blank macro! @@ -277,7 +329,7 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") CONFIG_H += $(KEYMAP_PATH)/config.h endif -# # project specific files +# project specific files SRC += $(KEYBOARD_SRC) \ $(KEYMAP_C) \ $(QUANTUM_SRC) @@ -287,15 +339,17 @@ SRC += $(KEYBOARD_SRC) \ # Search Path VPATH += $(KEYMAP_PATH) +VPATH += $(USER_PATH) VPATH += $(KEYBOARD_PATHS) VPATH += $(COMMON_VPATH) -VPATH += $(USER_PATH) include common_features.mk include $(TMK_PATH)/protocol.mk include $(TMK_PATH)/common.mk include bootloader.mk +SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) +SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC)) SRC += $(TMK_COMMON_SRC) OPT_DEFS += $(TMK_COMMON_DEFS) EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS) @@ -324,6 +378,7 @@ ifeq ($(strip $(VISUALIZER_ENABLE)), yes) include $(VISUALIZER_PATH)/visualizer.mk endif +CONFIG_H += $(POST_CONFIG_H) ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H) OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT) @@ -342,5 +397,8 @@ $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) # Default target. all: build check-size build: elf cpfirmware +check-size: build +objs-size: build +include show_options.mk include $(TMK_PATH)/rules.mk diff --git a/build_layout.mk b/build_layout.mk index beb1cb66278..6e9f97dae21 100644 --- a/build_layout.mk +++ b/build_layout.mk @@ -15,4 +15,13 @@ define SEARCH_LAYOUTS $$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO))) endef +ifneq ($(FORCE_LAYOUT),) + ifneq (,$(findstring $(FORCE_LAYOUT),$(LAYOUTS))) + $(info Forcing layout: $(FORCE_LAYOUT)) + LAYOUTS := $(FORCE_LAYOUT) + else + $(error Forced layout does not exist) + endif +endif + $(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS))) \ No newline at end of file diff --git a/common.mk b/common.mk index 272d170e688..aea29a7a20e 100644 --- a/common.mk +++ b/common.mk @@ -21,5 +21,4 @@ COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras COMMON_VPATH += $(QUANTUM_PATH)/audio COMMON_VPATH += $(QUANTUM_PATH)/process_keycode COMMON_VPATH += $(QUANTUM_PATH)/api -COMMON_VPATH += $(QUANTUM_PATH)/split_common COMMON_VPATH += $(DRIVER_PATH) diff --git a/common_features.mk b/common_features.mk index f44dfc47de1..3296424a11e 100644 --- a/common_features.mk +++ b/common_features.mk @@ -103,7 +103,9 @@ ifeq ($(strip $(UNICODE_COMMON)), yes) endif ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h OPT_DEFS += -DRGBLIGHT_ENABLE + SRC += $(QUANTUM_DIR)/color.c SRC += $(QUANTUM_DIR)/rgblight.c CIE1931_CURVE = yes LED_BREATHING_TABLE = yes @@ -114,8 +116,28 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) endif endif +VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 WS2812 custom + +LED_MATRIX_ENABLE ?= no +ifneq ($(strip $(LED_MATRIX_ENABLE)), no) + ifeq ($(filter $(LED_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),) + $(error LED_MATRIX_ENABLE="$(LED_MATRIX_ENABLE)" is not a valid matrix type) + else + OPT_DEFS += -DLED_MATRIX_ENABLE -DBACKLIGHT_ENABLE -DBACKLIGHT_CUSTOM_DRIVER + SRC += $(QUANTUM_DIR)/led_matrix.c + SRC += $(QUANTUM_DIR)/led_matrix_drivers.c + endif +endif + +ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731) + OPT_DEFS += -DIS31FL3731 + COMMON_VPATH += $(DRIVER_PATH)/issi + SRC += is31fl3731-simple.c + QUANTUM_LIB_SRC += i2c_master.c +endif + RGB_MATRIX_ENABLE ?= no -VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 custom + ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),) $(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type) @@ -132,17 +154,37 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) endif ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731) - OPT_DEFS += -DIS31FL3731 + OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE COMMON_VPATH += $(DRIVER_PATH)/issi SRC += is31fl3731.c - SRC += i2c_master.c + QUANTUM_LIB_SRC += i2c_master.c endif ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733) - OPT_DEFS += -DIS31FL3733 + OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE COMMON_VPATH += $(DRIVER_PATH)/issi SRC += is31fl3733.c - SRC += i2c_master.c + QUANTUM_LIB_SRC += i2c_master.c +endif + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3737) + OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/issi + SRC += is31fl3737.c + QUANTUM_LIB_SRC += i2c_master.c +endif + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812) + OPT_DEFS += -DWS2812 + SRC += ws2812.c +endif + +ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes) + OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB +endif + +ifeq ($(strip $(RGB_MATRIX_CUSTOM_USER)), yes) + OPT_DEFS += -DRGB_MATRIX_CUSTOM_USER endif ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) @@ -191,7 +233,7 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) ifeq ($(strip $(VISUALIZER_ENABLE)), yes) CIE1931_CURVE = yes endif - ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes) + ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes) OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER endif endif @@ -213,6 +255,7 @@ endif ifeq ($(strip $(TERMINAL_ENABLE)), yes) SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c OPT_DEFS += -DTERMINAL_ENABLE + OPT_DEFS += -DUSER_PRINT endif ifeq ($(strip $(USB_HID_ENABLE)), yes) @@ -224,11 +267,33 @@ ifeq ($(strip $(ENCODER_ENABLE)), yes) OPT_DEFS += -DENCODER_ENABLE endif +ifeq ($(strip $(HAPTIC_ENABLE)), DRV2605L) + COMMON_VPATH += $(DRIVER_PATH)/haptic + SRC += haptic.c + SRC += DRV2605L.c + QUANTUM_LIB_SRC += i2c_master.c + OPT_DEFS += -DHAPTIC_ENABLE + OPT_DEFS += -DDRV2605L +endif + +ifeq ($(strip $(HAPTIC_ENABLE)), SOLENOID) + COMMON_VPATH += $(DRIVER_PATH)/haptic + SRC += haptic.c + SRC += solenoid.c + OPT_DEFS += -DHAPTIC_ENABLE + OPT_DEFS += -DSOLENOID_ENABLE +endif + ifeq ($(strip $(HD44780_ENABLE)), yes) SRC += drivers/avr/hd44780.c OPT_DEFS += -DHD44780_ENABLE endif +ifeq ($(strip $(VELOCIKEY_ENABLE)), yes) + OPT_DEFS += -DVELOCIKEY_ENABLE + SRC += $(QUANTUM_DIR)/velocikey.c +endif + ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes) OPT_DEFS += -DDYNAMIC_KEYMAP_ENABLE SRC += $(QUANTUM_DIR)/dynamic_keymap.c @@ -239,11 +304,14 @@ ifeq ($(strip $(LEADER_ENABLE)), yes) OPT_DEFS += -DLEADER_ENABLE endif +include $(DRIVER_PATH)/qwiic/qwiic.mk + QUANTUM_SRC:= \ $(QUANTUM_DIR)/quantum.c \ $(QUANTUM_DIR)/keymap_common.c \ $(QUANTUM_DIR)/keycode_config.c +# Include the standard or split matrix code if needed ifneq ($(strip $(CUSTOM_MATRIX)), yes) ifeq ($(strip $(SPLIT_KEYBOARD)), yes) QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c @@ -252,10 +320,41 @@ ifneq ($(strip $(CUSTOM_MATRIX)), yes) endif endif +DEBOUNCE_DIR:= $(QUANTUM_DIR)/debounce +# Debounce Modules. Set DEBOUNCE_TYPE=custom if including one manually. +DEBOUNCE_TYPE?= sym_g +ifneq ($(strip $(DEBOUNCE_TYPE)), custom) + QUANTUM_SRC += $(DEBOUNCE_DIR)/$(strip $(DEBOUNCE_TYPE)).c +endif + ifeq ($(strip $(SPLIT_KEYBOARD)), yes) + POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h OPT_DEFS += -DSPLIT_KEYBOARD - QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \ - $(QUANTUM_DIR)/split_common/split_util.c \ - $(QUANTUM_DIR)/split_common/i2c.c \ - $(QUANTUM_DIR)/split_common/serial.c + + # Include files used by all split keyboards + QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c + + # Determine which (if any) transport files are required + ifneq ($(strip $(SPLIT_TRANSPORT)), custom) + QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c + # Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called. + # Unused functions are pruned away, which is why we can add multiple drivers here without bloat. + QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/serial.c \ + i2c_master.c \ + i2c_slave.c + endif + COMMON_VPATH += $(QUANTUM_PATH)/split_common +endif + +ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) + OPT_DEFS += -DOLED_DRIVER_ENABLE + COMMON_VPATH += $(DRIVER_PATH)/oled + QUANTUM_LIB_SRC += i2c_master.c + SRC += oled_driver.c +endif + +SPACE_CADET_ENABLE ?= yes +ifeq ($(strip $(SPACE_CADET_ENABLE)), yes) + SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c + OPT_DEFS += -DSPACE_CADET_ENABLE endif diff --git a/docs/LANGS.md b/docs/LANGS.md new file mode 100644 index 00000000000..4b48f2d3d89 --- /dev/null +++ b/docs/LANGS.md @@ -0,0 +1,4 @@ +# Languages + +* [English](/) +* [Chinese](zh/) diff --git a/docs/_sidebar.md b/docs/_sidebar.md deleted file mode 100644 index 2c573801220..00000000000 --- a/docs/_sidebar.md +++ /dev/null @@ -1,97 +0,0 @@ -* [Complete Newbs Guide](newbs.md) - * [Getting Started](newbs_getting_started.md) - * [Building Your First Firmware](newbs_building_firmware.md) - * [Flashing Firmware](newbs_flashing.md) - * [Testing and Debugging](newbs_testing_debugging.md) - * [Best Practices](newbs_best_practices.md) - * [Learning Resources](newbs_learn_more_resources.md) - -* [QMK Basics](README.md) - * [QMK Introduction](getting_started_introduction.md) - * [Contributing to QMK](contributing.md) - * [How to Use Github](getting_started_github.md) - * [Getting Help](getting_started_getting_help.md) - -* [FAQ](faq.md) - * [General FAQ](faq_general.md) - * [Build/Compile QMK](faq_build.md) - * [Debugging/Troubleshooting QMK](faq_debug.md) - * [Keymap](faq_keymap.md) - -* Detailed Guides - * [Install Build Tools](getting_started_build_tools.md) - * [Vagrant Guide](getting_started_vagrant.md) - * [Build/Compile Instructions](getting_started_make_guide.md) - * [Flashing Firmware](flashing.md) - * [Customizing Functionality](custom_quantum_functions.md) - * [Keymap Overview](keymap.md) - -* [Hardware](hardware.md) - * [AVR Processors](hardware_avr.md) - * [Drivers](hardware_drivers.md) - -* Reference - * [Keyboard Guidelines](hardware_keyboard_guidelines.md) - * [Config Options](config_options.md) - * [Keycodes](keycodes.md) - * [Documentation Best Practices](documentation_best_practices.md) - * [Documentation Templates](documentation_templates.md) - * [Glossary](reference_glossary.md) - * [Unit Testing](unit_testing.md) - * [Useful Functions](ref_functions.md) - -* [Features](features.md) - * [Basic Keycodes](keycodes_basic.md) - * [Quantum Keycodes](quantum_keycodes.md) - * [Advanced Keycodes](feature_advanced_keycodes.md) - * [Audio](feature_audio.md) - * [Auto Shift](feature_auto_shift.md) - * [Backlight](feature_backlight.md) - * [Bluetooth](feature_bluetooth.md) - * [Bootmagic](feature_bootmagic.md) - * [Combos](feature_combo) - * [Command](feature_command.md) - * [Dynamic Macros](feature_dynamic_macros.md) - * [Encoders](feature_encoders.md) - * [Grave Escape](feature_grave_esc.md) - * [Key Lock](feature_key_lock.md) - * [Layouts](feature_layouts.md) - * [Leader Key](feature_leader_key.md) - * [Macros](feature_macros.md) - * [Mouse Keys](feature_mouse_keys.md) - * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) - * [Pointing Device](feature_pointing_device.md) - * [PS/2 Mouse](feature_ps2_mouse.md) - * [RGB Lighting](feature_rgblight.md) - * [RGB Matrix](feature_rgb_matrix.md) - * [Space Cadet Shift](feature_space_cadet_shift.md) - * [Space Cadet Shift Enter](feature_space_cadet_shift_enter.md) - * [Stenography](feature_stenography.md) - * [Swap Hands](feature_swap_hands.md) - * [Tap Dance](feature_tap_dance.md) - * [Terminal](feature_terminal.md) - * [Thermal Printer](feature_thermal_printer.md) - * [Unicode](feature_unicode.md) - * [Userspace](feature_userspace.md) - * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) - -* For Makers and Modders - * [Hand Wiring Guide](hand_wire.md) - * [ISP Flashing Guide](isp_flashing_guide.md) - * [ARM Debugging Guide](arm_debugging.md) - -* For a Deeper Understanding - * [How Keyboards Work](how_keyboards_work.md) - * [Understanding QMK](understanding_qmk.md) - -* Other Topics - * [Using Eclipse with QMK](eclipse.md) - -* QMK Internals (In Progress) - * [Defines](internals_defines.md) - * [Input Callback Reg](internals_input_callback_reg.md) - * [Midi Device](internals_midi_device.md) - * [Midi Device Setup Process](internals_midi_device_setup_process.md) - * [Midi Util](internals_midi_util.md) - * [Send Functions](internals_send_functions.md) - * [Sysex Tools](internals_sysex_tools.md) diff --git a/docs/_summary.md b/docs/_summary.md index 2c573801220..56184f44deb 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -3,11 +3,12 @@ * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) - * [Best Practices](newbs_best_practices.md) + * [Git Best Practices](newbs_best_practices.md) * [Learning Resources](newbs_learn_more_resources.md) * [QMK Basics](README.md) * [QMK Introduction](getting_started_introduction.md) + * [QMK CLI](cli.md) * [Contributing to QMK](contributing.md) * [How to Use Github](getting_started_github.md) * [Getting Help](getting_started_getting_help.md) @@ -34,14 +35,20 @@ * [Keyboard Guidelines](hardware_keyboard_guidelines.md) * [Config Options](config_options.md) * [Keycodes](keycodes.md) + * [Coding Conventions - C](coding_conventions_c.md) + * [Coding Conventions - Python](coding_conventions_python.md) * [Documentation Best Practices](documentation_best_practices.md) * [Documentation Templates](documentation_templates.md) * [Glossary](reference_glossary.md) * [Unit Testing](unit_testing.md) * [Useful Functions](ref_functions.md) + * [Configurator Support](reference_configurator_support.md) + * [info.json Format](reference_info_json.md) + * [Python Development](python_development.md) * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) + * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * [Quantum Keycodes](quantum_keycodes.md) * [Advanced Keycodes](feature_advanced_keycodes.md) * [Audio](feature_audio.md) @@ -49,23 +56,28 @@ * [Backlight](feature_backlight.md) * [Bluetooth](feature_bluetooth.md) * [Bootmagic](feature_bootmagic.md) - * [Combos](feature_combo) + * [Combos](feature_combo.md) * [Command](feature_command.md) + * [Debounce API](feature_debounce_type.md) * [Dynamic Macros](feature_dynamic_macros.md) * [Encoders](feature_encoders.md) * [Grave Escape](feature_grave_esc.md) + * [Haptic Feedback](feature_haptic_feedback.md) + * [HD44780 LCD Controller](feature_hd44780.md) * [Key Lock](feature_key_lock.md) * [Layouts](feature_layouts.md) * [Leader Key](feature_leader_key.md) + * [LED Matrix](feature_led_matrix.md) * [Macros](feature_macros.md) * [Mouse Keys](feature_mouse_keys.md) + * [OLED Driver](feature_oled_driver.md) * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) * [Pointing Device](feature_pointing_device.md) * [PS/2 Mouse](feature_ps2_mouse.md) * [RGB Lighting](feature_rgblight.md) * [RGB Matrix](feature_rgb_matrix.md) - * [Space Cadet Shift](feature_space_cadet_shift.md) - * [Space Cadet Shift Enter](feature_space_cadet_shift_enter.md) + * [Space Cadet](feature_space_cadet.md) + * [Split Keyboard](feature_split_keyboard.md) * [Stenography](feature_stenography.md) * [Swap Hands](feature_swap_hands.md) * [Tap Dance](feature_tap_dance.md) @@ -73,19 +85,24 @@ * [Thermal Printer](feature_thermal_printer.md) * [Unicode](feature_unicode.md) * [Userspace](feature_userspace.md) - * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) + * [Velocikey](feature_velocikey.md) * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) * [ISP Flashing Guide](isp_flashing_guide.md) * [ARM Debugging Guide](arm_debugging.md) + * [I2C Driver](i2c_driver.md) + * [GPIO Controls](internals_gpio_control.md) + * [Proton C Conversion](proton_c_conversion.md) * For a Deeper Understanding * [How Keyboards Work](how_keyboards_work.md) * [Understanding QMK](understanding_qmk.md) * Other Topics - * [Using Eclipse with QMK](eclipse.md) + * [Using Eclipse with QMK](other_eclipse.md) + * [Using VSCode with QMK](other_vscode.md) + * [Support](support.md) * QMK Internals (In Progress) * [Defines](internals_defines.md) diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 00000000000..0365f2c9c80 --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,31 @@ +# QMK CLI + +This page describes how to setup and use the QMK CLI. + +# Overview + +The QMK CLI makes building and working with QMK keyboards easier. We have provided a number of commands to help you work with QMK: + +* `qmk compile-json` + +# Setup + +Simply add the `qmk_firmware/bin` directory to your `PATH`. You can run the `qmk` commands from any directory. + +``` +export PATH=$PATH:$HOME/qmk_firmware/bin +``` + +You may want to add this to your `.profile`, `.bash_profile`, `.zsh_profile`, or other shell startup scripts. + +# Commands + +## `qmk compile-json` + +This command allows you to compile JSON files you have downloaded from . + +**Usage**: + +``` +qmk compile-json mine.json +``` diff --git a/docs/coding_conventions_c.md b/docs/coding_conventions_c.md new file mode 100644 index 00000000000..cbddedf8b0f --- /dev/null +++ b/docs/coding_conventions_c.md @@ -0,0 +1,58 @@ +# Coding Conventions (C) + +Most of our style is pretty easy to pick up on, but right now it's not entirely consistent. You should match the style of the code surrounding your change, but if that code is inconsistent or unclear use the following guidelines: + +* We indent using four (4) spaces (soft tabs) +* We use a modified One True Brace Style + * Opening Brace: At the end of the same line as the statement that opens the block + * Closing Brace: Lined up with the first character of the statement that opens the block + * Else If: Place the closing brace at the beginning of the line and the next opening brace at the end of the same line. + * Optional Braces: Always include optional braces. + * Good: if (condition) { return false; } + * Bad: if (condition) return false; +* We encourage use of C style comments: `/* */` + * Think of them as a story describing the feature + * Use them liberally to explain why particular decisions were made. + * Do not write obvious comments + * If you not sure if a comment is obvious, go ahead and include it. +* In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns. +* We use `#pragma once` at the start of header files rather than old-style include guards (`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`) +* We accept both forms of preprocessor if's: `#ifdef DEFINED` and `#if defined(DEFINED)` + * If you are not sure which to prefer use the `#if defined(DEFINED)` form. + * Do not change existing code from one style to the other, except when moving to a multiple condition `#if`. + * Do not put whitespace between `#` and `if`. + * When deciding how (or if) to indent directives keep these points in mind: + * Readability is more important than consistency. + * Follow the file's existing style. If the file is mixed follow the style that makes sense for the section you are modifying. + * When choosing to indent you can follow the indention level of the surrounding C code, or preprocessor directives can have their own indent level. Choose the style that best communicates the intent of your code. + +Here is an example for easy reference: + +```c +/* Enums for foo */ +enum foo_state { + FOO_BAR, + FOO_BAZ, +}; + +/* Returns a value */ +int foo(void) { + if (some_condition) { + return FOO_BAR; + } else { + return -1; + } +} +``` + +# Auto-formatting with clang-format + +[Clang-format](https://clang.llvm.org/docs/ClangFormat.html) is part of LLVM and can automatically format your code for you, because ain't nobody got time to do it manually. We supply a configuration file for it that applies most of the coding conventions listed above. It will only change whitespace and newlines, so you will still have to remember to include optional braces yourself. + +Use the [full LLVM installer](http://llvm.org/builds/) to get clang-format on Windows, or use `sudo apt install clang-format` on Ubuntu. + +If you run it from the command-line, pass `-style=file` as an option and it will automatically find the .clang-format configuration file in the QMK root directory. + +If you use VSCode, the standard C/C++ plugin supports clang-format, alternatively there is a [separate extension](https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.ClangFormat) for it. + +Some things (like LAYOUT macros) are destroyed by clang-format, so either don't run it on those files, or wrap the sensitive code in `// clang-format off` and `// clang-format on`. diff --git a/docs/coding_conventions_python.md b/docs/coding_conventions_python.md new file mode 100644 index 00000000000..c7743050e20 --- /dev/null +++ b/docs/coding_conventions_python.md @@ -0,0 +1,314 @@ +# Coding Conventions (Python) + +Most of our style follows PEP8 with some local modifications to make things less nit-picky. + +* We target Python 3.5 for compatability with all supported platforms. +* We indent using four (4) spaces (soft tabs) +* We encourage liberal use of comments + * Think of them as a story describing the feature + * Use them liberally to explain why particular decisions were made. + * Do not write obvious comments + * If you not sure if a comment is obvious, go ahead and include it. +* We require useful docstrings for all functions. +* In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns. +* Some of our practices conflict with the wider python community to make our codebase more approachable to non-pythonistas. + +# YAPF + +You can use [yapf](https://github.com/google/yapf) to style your code. We provide a config in [setup.cfg](setup.cfg). + +# Imports + +We don't have a hard and fast rule for when to use `import ...` vs `from ... import ...`. Understandability and maintainability is our ultimate goal. + +Generally we prefer to import specific function and class names from a module to keep code shorter and easier to understand. Sometimes this results in a name that is ambiguous, and in such cases we prefer to import the module instead. You should avoid using the "as" keyword when importing, unless you are importing a compatability module. + +Imports should be one line per module. We group import statements together using the standard python rules- system, 3rd party, local. + +Do not use `from foo import *`. Supply a list of objects you want to import instead, or import the whole module. + +## Import Examples + +Good: + +``` +from qmk import effects + +effects.echo() +``` + +Bad: + +``` +from qmk.effects import echo + +echo() # It's unclear where echo comes from +``` + +Good: + +``` +from qmk.keymap import compile_firmware + +compile_firmware() +``` + +OK, but the above is better: + +``` +import qmk.keymap + +qmk.keymap.compile_firmware() +``` + +# Statements + +One statement per line. + +Even when allowed (EG `if foo: bar`) we do not combine 2 statements onto a single line. + +# Naming + +`module_name`, `package_name`, `ClassName`, `method_name`, `ExceptionName`, `function_name`, `GLOBAL_CONSTANT_NAME`, `global_var_name`, `instance_var_name`, `function_parameter_name`, `local_var_name`. + +Function names, variable names, and filenames should be descriptive; eschew abbreviation. In particular, do not use abbreviations that are ambiguous or unfamiliar to readers outside your project, and do not abbreviate by deleting letters within a word. + +Always use a .py filename extension. Never use dashes. + +## Names to Avoid + +* single character names except for counters or iterators. You may use "e" as an exception identifier in try/except statements. +* dashes (-) in any package/module name +* __double_leading_and_trailing_underscore__ names (reserved by Python) + +# Docstrings + +To maintain consistency with our docstrings we've set out the following guidelines. + +* Use markdown formatting +* Always use triple-dquote docstrings with at least one linebreak: `"""\n"""` +* First line is a short (< 70 char) description of what the function does +* If you need more in your docstring leave a blank line between the description and the rest. +* Start indented lines at the same indent level as the opening triple-dquote +* Document all function arguments using the format described below +* If present, Args:, Returns:, and Raises: should be the last three things in the docstring, separated by a blank line each. + +## Simple docstring example + +``` +def my_awesome_function(): + """Return the number of seconds since 1970 Jan 1 00:00 UTC. + """ + return int(time.time()) +``` + +## Complex docstring example + +``` +def my_awesome_function(): + """Return the number of seconds since 1970 Jan 1 00:00 UTC. + + This function always returns an integer number of seconds. + """ + return int(time.time()) +``` + +## Function arguments docstring example + +``` +def my_awesome_function(start=None, offset=0): + """Return the number of seconds since 1970 Jan 1 00:00 UTC. + + This function always returns an integer number of seconds. + + + Args: + start + The time to start at instead of 1970 Jan 1 00:00 UTC + + offset + Return an answer that has this number of seconds subtracted first + + Returns: + An integer describing a number of seconds. + + Raises: + ValueError + When `start` or `offset` are not positive numbers + """ + if start < 0 or offset < 0: + raise ValueError('start and offset must be positive numbers.') + + if not start: + start = time.time() + + return int(start - offset) +``` + +# Exceptions + +Exceptions are used to handle exceptional situations. They should not be used for flow control. This is a break from the python norm of "ask for forgiveness." If you are catching an exception it should be to handle a situation that is unusual. + +If you use a catch-all exception for any reason you must log the exception and stacktrace using cli.log. + +Make your try/except blocks as short as possible. If you need a lot of try statements you may need to restructure your code. + +# Tuples + +When defining one-item tuples always include a trailing comma so that it is obvious you are using a tuple. Do not rely on implicit one-item tuple unpacking. Better still use a list which is unambiguous. + +This is particularly important when using the printf-style format strings that are commonly used. + +# Lists and Dictionaries + +We have configured YAPF to differentiate between sequence styles with a trailing comma. When a trailing comma is omitted YAPF will format the sequence as a single line. When a trailing comma is included YAPF will format the sequence with one item per line. + +You should generally prefer to keep short definition on a single line. Break out to multiple lines sooner rather than later to aid readability and maintainability. + +# Parentheses + +Avoid excessive parentheses, but do use parentheses to make code easier to understand. Do not use them in return statements unless you are explicitly returning a tuple, or it is part of a math expression. + +# Format Strings + +We generally prefer printf-style format strings. Example: + +``` +name = 'World' +print('Hello, %s!' % (name,)) +``` + +This style is used by the logging module, which we make use of extensively, and we have adopted it in other places for consistency. It is also more familiar to C programmers, who are a big part of our casual audience. + +Our included CLI module has support for using these without using the percent (%) operator. Look at `cli.echo()` and the various `cli.log` functions (EG, `cli.log.info()`) for more details. + +# Comprehensions & Generator Expressions + +We encourage the liberal use of comprehensions and generators, but do not let them get too complex. If you need complexity fall back to a for loop that is easier to understand. + +# Lambdas + +OK to use but probably should be avoided. With comprehensions and generators the need for lambdas is not as strong as it once was. + +# Conditional Expressions + +OK in variable assignment, but otherwise should be avoided. + +Conditional expressions are if statements that are in line with code. For example: + +``` +x = 1 if cond else 2 +``` + +It's generally not a good idea to use these as function arguments, sequence items, etc. It's too easy to overlook. + +# Default Argument Values + +Encouraged, but values must be immutable objects. + +When specifying default values in argument lists always be careful to specify objects that can't be modified in place. If you use a mutable object the changes you make will persist between calls, which is usually not what you want. Even if that is what you intend to do it is confusing for others and will hinder understanding. + +Bad: + +``` +def my_func(foo={}): + pass +``` + +Good: + +``` +def my_func(foo=None): + if not foo: + foo = {} +``` + +# Properties + +Always use properties instead of getter and setter functions. + +``` +class Foo(object): + def __init__(self): + self._bar = None + + @property + def bar(self): + return self._bar + + @bar.setter + def bar(self, bar): + self._bar = bar +``` + +# True/False Evaluations + +You should generally prefer the implicit True/False evaluation in if statements, rather than checking equivalency. + +Bad: + +``` +if foo == True: + pass + +if bar == False: + pass +``` + +Good: + +``` +if foo: + pass + +if not bar: + pass +``` + +# Decorators + +Use when appropriate. Try to avoid too much magic unless it helps with understanding. + +# Threading and Multiprocessing + +Should be avoided. If you need this you will have to make a strong case before we merge your code. + +# Power Features + +Python is an extremely flexible language and gives you many fancy features such as custom metaclasses, access to bytecode, on-the-fly compilation, dynamic inheritance, object reparenting, import hacks, reflection, modification of system internals, etc. + +Don't use these. + +Performance is not a critical concern for us, and code understandability is. We want our codebase to be approachable by someone who only has a day or two to play with it. These features generally come with a cost to easy understanding, and we would prefer to have code that can be readily understood over faster or more compact code. + +Note that some standard library modules use these techniques and it is ok to make use of those modules. But please keep readability and understandability in mind when using them. + +# Type Annotated Code + +For now we are not using any type annotation system, and would prefer that code remain unannotated. We may revisit this in the future. + +# Function length + +Prefer small and focused functions. + +We recognize that long functions are sometimes appropriate, so no hard limit is placed on function length. If a function exceeds about 40 lines, think about whether it can be broken up without harming the structure of the program. + +Even if your long function works perfectly now, someone modifying it in a few months may add new behavior. This could result in bugs that are hard to find. Keeping your functions short and simple makes it easier for other people to read and modify your code. + +You could find long and complicated functions when working with some code. Do not be intimidated by modifying existing code: if working with such a function proves to be difficult, you find that errors are hard to debug, or you want to use a piece of it in several different contexts, consider breaking up the function into smaller and more manageable pieces. + +# FIXMEs + +It is OK to leave FIXMEs in code. Why? Encouraging people to at least document parts of code that need to be thought out more (or that are confusing) is better than leaving this code undocumented. + +All FIXMEs should be formatted like: + +``` +FIXME(username): Revisit this code when the frob feature is done. +``` + +...where username is your GitHub username. + +# Unit Tests + +These are good. We should have some one day. diff --git a/docs/config_options.md b/docs/config_options.md index 19861c9d23c..01c0e3ee8ca 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -59,6 +59,8 @@ This is a C header file that is one of the first things included, and will persi * define is matrix has ghost (unlikely) * `#define DIODE_DIRECTION COL2ROW` * COL2ROW or ROW2COL - how your matrix is configured. COL2ROW means the black mark on your diode is facing to the rows, and between the switch and the rows. +* `#define DIRECT_PINS { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } }` + * pins mapped to rows and columns, from left to right. Defines a matrix where each switch is connected to a separate pin and ground. * `#define AUDIO_VOICES` * turns on the alternate audio voices (to cycle through) * `#define C4_AUDIO` @@ -68,31 +70,31 @@ This is a C header file that is one of the first things included, and will persi * `#define C6_AUDIO` * enables audio on pin C6 * `#define B5_AUDIO` - * enables audio on pin B5 (duophony is enables if one of B[5-7]_AUDIO is enabled along with one of C[4-6]_AUDIO) + * enables audio on pin B5 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO) * `#define B6_AUDIO` - * enables audio on pin B6 (duophony is enables if one of B[5-7]_AUDIO is enabled along with one of C[4-6]_AUDIO) + * enables audio on pin B6 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO) * `#define B7_AUDIO` - * enables audio on pin B7 (duophony is enables if one of B[5-7]_AUDIO is enabled along with one of C[4-6]_AUDIO) + * enables audio on pin B7 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO) * `#define BACKLIGHT_PIN B7` - * pin of the backlight - B5, B6, B7 use PWM, others use softPWM + * pin of the backlight - `B5`, `B6`, `B7` and `C6` (and `D4` on ATmega32A) use hardware PWM, others use software implementation * `#define BACKLIGHT_LEVELS 3` * number of levels your backlight will have (maximum 15 excluding off) * `#define BACKLIGHT_BREATHING` - * enables backlight breathing (only works with backlight pins B5, B6 and B7) + * enables backlight breathing * `#define BREATHING_PERIOD 6` * the length of one backlight "breath" in seconds -* `#define DEBOUNCING_DELAY 5` +* `#define DEBOUNCE 5` * the delay when reading the value of the pin (5 is default) * `#define LOCKING_SUPPORT_ENABLE` * mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap * `#define LOCKING_RESYNC_ENABLE` * tries to keep switch state consistent with keyboard LED state -* `#define IS_COMMAND() ( keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) )` +* `#define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)` * key combination that allows the use of magic commands (useful for debugging) * `#define USB_MAX_POWER_CONSUMPTION` * sets the maximum power (in mA) over USB for the device (default: 500) -* `#define SCL_CLOCK 100000L` - * sets the SCL_CLOCK speed for split keyboards. The default is `100000L` but some boards can be set to `400000L`. +* `#define F_SCL 100000L` + * sets the I2C clock rate speed for keyboards using I2C. The default is `400000L`, except for keyboards using `split_common`, where the default is `100000L`. ## Features That Can Be Disabled @@ -109,9 +111,9 @@ If you define these options you will disable the associated feature, which can s * `#define NO_ACTION_ONESHOT` * disable one-shot modifiers * `#define NO_ACTION_MACRO` - * disable all macro handling + * disable old style macro handling: MACRO() & action_get_macro * `#define NO_ACTION_FUNCTION` - * disable the action function (deprecated) + * disable calling of action_function() from the fn_actions array (deprecated) ## Features That Can Be Enabled @@ -126,22 +128,30 @@ If you define these options you will enable the associated feature, which may in * `#define TAPPING_TERM 200` * how long before a tap becomes a hold, if set above 500, a key tapped during the tapping term will turn it into a hold too +* `#define TAPPING_TERM_PER_KEY` + * enables handling for per key `TAPPING_TERM` settings * `#define RETRO_TAPPING` * tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release * See [Retro Tapping](feature_advanced_keycodes.md#retro-tapping) for details * `#define TAPPING_TOGGLE 2` * how many taps before triggering the toggle * `#define PERMISSIVE_HOLD` - * makes tap and hold keys work better for fast typers who don't want tapping term set above 500 + * makes tap and hold keys trigger the hold if another key is pressed before releasing, even if it hasn't hit the `TAPPING_TERM` * See [Permissive Hold](feature_advanced_keycodes.md#permissive-hold) for details * `#define IGNORE_MOD_TAP_INTERRUPT` - * makes it possible to do rolling combos (zx) with keys that convert to other keys on hold - * See [Mod tap interrupt](feature_advanced_keycodes.md#mod-tap-interrupt) for details + * makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the `TAPPING_TERM` for both keys. + * See [Mod tap interrupt](feature_advanced_keycodes.md#ignore-mod-tap-interrupt) for details * `#define TAPPING_FORCE_HOLD` * makes it possible to use a dual role key as modifier shortly after having been tapped - * See [Hold after tap](feature_advanced_keycodes.md#hold-after-tap) + * See [Hold after tap](feature_advanced_keycodes.md#tapping-force-hold) + * Breaks any Tap Toggle functionality (`TT` or the One Shot Tap Toggle) * `#define LEADER_TIMEOUT 300` * how long before the leader key times out + * If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. +* `#define LEADER_PER_KEY_TIMING` + * sets the timer for leader key chords to run on each key press rather than overall +* `#define LEADER_KEY_STRICT_KEY_PROCESSING` + * Disables keycode filtering for Mod-Tap and Layer-Tap keycodes. Eg, if you enable this, you would need to specify `MT(MOD_CTL, KC_A)` if you want to use `KC_A`. * `#define ONESHOT_TIMEOUT 300` * how long before oneshot times out * `#define ONESHOT_TAP_TOGGLE 2` @@ -159,15 +169,25 @@ If you define these options you will enable the associated feature, which may in * Set this to the number of combos that you're using in the [Combo](feature_combo.md) feature. * `#define COMBO_TERM 200` * how long for the Combo keys to be detected. Defaults to `TAPPING_TERM` if not defined. +* `#define TAP_CODE_DELAY 100` + * Sets the delay between `register_code` and `unregister_code`, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds. +* `#define TAP_HOLD_CAPS_DELAY 80` + * Sets the delay for Tap Hold keys (`LT`, `MT`) when using `KC_CAPSLOCK` keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher. ## RGB Light Configuration * `#define RGB_DI_PIN D7` - * pin the DI on the ws2812 is hooked-up to + * pin the DI on the WS2812 is hooked-up to * `#define RGBLIGHT_ANIMATIONS` * run RGB animations -* `#define RGBLED_NUM 15` +* `#define RGBLED_NUM 12` * number of LEDs +* `#define RGBLIGHT_SPLIT` + * Needed if both halves of the board have RGB LEDs wired directly to the RGB output pin on the controllers instead of passing the output of the left half to the input of the right half +* `#define RGBLED_SPLIT { 6, 6 }` + * number of LEDs connected that are directly wired to `RGB_DI_PIN` on each half of a split keyboard + * First value indicates number of LEDs for left half, second value is for the right half + * When RGBLED_SPLIT is defined, RGBLIGHT_SPLIT is implicitly defined. * `#define RGBLIGHT_HUE_STEP 12` * units to step when in/decreasing hue * `#define RGBLIGHT_SAT_STEP 25` @@ -189,12 +209,58 @@ If you define these options you will enable the associated feature, which may in Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk +* `SPLIT_TRANSPORT = custom` + * Allows replacing the standard split communication routines with a custom one. ARM based split keyboards must use this at present. + +### Setting Handedness + +One thing to remember, the side that the USB port is plugged into is always the master half. The side not plugged into USB is the slave. + +There are a few different ways to set handedness for split keyboards (listed in order of precedence): + +1. Set `SPLIT_HAND_PIN`: Reads a pin to determine handedness. If pin is high, it's the left side, if low, the half is determined to be the right side +2. Set `EE_HANDS` and flash `eeprom-lefthand.eep`/`eeprom-righthand.eep` to each half + * For boards with DFU bootloader you can use `:dfu-split-left`/`:dfu-split-right` to flash these EEPROM files + * For boards with Caterina bootloader (like stock Pro Micros), use `:avrdude-split-left`/`:avrdude-split-right` +3. Set `MASTER_RIGHT`: Half that is plugged into the USB port is determined to be the master and right half (inverse of the default) +4. Default: The side that is plugged into the USB port is the master half and is assumed to be the left half. The slave side is the right half + +#### Defines for handedness + * `#define SPLIT_HAND_PIN B7` - * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace 'B7' with the pin you are using. This is optional and you can still use the EEHANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. - + * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace `B7` with the pin you are using. This is optional, and if you leave `SPLIT_HAND_PIN` undefined, then you can still use the EE_HANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. + +* `#define EE_HANDS` (only works if `SPLIT_HAND_PIN` is not defined) + * Reads the handedness value stored in the EEPROM after `eeprom-lefthand.eep`/`eeprom-righthand.eep` has been flashed to their respective halves. + +* `#define MASTER_RIGHT` + * Master half is defined to be the right half. + +### Other Options + * `#define USE_I2C` * For using I2C instead of Serial (defaults to serial) +* `#define SOFT_SERIAL_PIN D0` + * When using serial, define this. `D0` or `D1`,`D2`,`D3`,`E6`. + +* `#define MATRIX_ROW_PINS_RIGHT { }` +* `#define MATRIX_COL_PINS_RIGHT { }` + * If you want to specify a different pinout for the right half than the left half, you can define `MATRIX_ROW_PINS_RIGHT`/`MATRIX_COL_PINS_RIGHT`. Currently, the size of `MATRIX_ROW_PINS` must be the same as `MATRIX_ROW_PINS_RIGHT` and likewise for the definition of columns. + +* `#define RGBLED_SPLIT { 6, 6 }` + * See [RGB Light Configuration](#rgb-light-configuration) + +* `#define SELECT_SOFT_SERIAL_SPEED ` (default speed is 1) + * Sets the protocol speed when using serial communication + * Speeds: + * 0: about 189kbps (Experimental only) + * 1: about 137kbps (default) + * 2: about 75kbps + * 3: about 39kbps + * 4: about 26kbps + * 5: about 20kbps + # The `rules.mk` File This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features. @@ -223,6 +289,7 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i * `halfkay` * `caterina` * `bootloadHID` + * `USBasp` ## Feature Options @@ -246,6 +313,8 @@ Use these to enable or disable building certain features. The more you have enab * Enable the audio subsystem. * `RGBLIGHT_ENABLE` * Enable keyboard underlight functionality +* `LEADER_ENABLE` + * Enable leader key chording * `MIDI_ENABLE` * MIDI controls * `UNICODE_ENABLE` @@ -256,7 +325,42 @@ Use these to enable or disable building certain features. The more you have enab * Current options are AdafruitEzKey, AdafruitBLE, RN42 * `SPLIT_KEYBOARD` * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common +* `CUSTOM_MATRIX` + * Allows replacing the standard matrix scanning routine with a custom one. +* `DEBOUNCE_TYPE` + * Allows replacing the standard key debouncing routine with an alternative or custom one. * `WAIT_FOR_USB` * Forces the keyboard to wait for a USB connection to be established before it starts up * `NO_USB_STARTUP_CHECK` * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master. +* `LINK_TIME_OPTIMIZATION_ENABLE` + = Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION` + +## USB Endpoint Limitations + +In order to provide services over USB, QMK has to use USB endpoints. +These are a finite resource: each microcontroller has only a certain number. +This limits what features can be enabled together. +If the available endpoints are exceeded, a build error is thrown. + +The following features can require separate endpoints: + +* `MOUSEKEY_ENABLE` +* `EXTRAKEY_ENABLE` +* `CONSOLE_ENABLE` +* `NKRO_ENABLE` +* `MIDI_ENABLE` +* `RAW_ENABLE` +* `VIRTSER_ENABLE` + +In order to improve utilisation of the endpoints, the HID features can be combined to use a single endpoint. +By default, `MOUSEKEY`, `EXTRAKEY`, and `NKRO` are combined into a single endpoint. + +The base keyboard functionality can also be combined into the endpoint, +by setting `KEYBOARD_SHARED_EP = yes`. +This frees up one more endpoint, +but it can prevent the keyboard working in some BIOSes, +as they do not implement Boot Keyboard protocol switching. + +Combining the mouse also breaks Boot Mouse compatibility. +The mouse can be uncombined by setting `MOUSE_SHARED_EP = no` if this functionality is required. diff --git a/docs/contributing.md b/docs/contributing.md index bcedcaf974e..761bc9959b5 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -54,42 +54,10 @@ Never made an open source contribution before? Wondering how contributions work # Coding Conventions -Most of our style is pretty easy to pick up on, but right now it's not entirely consistent. You should match the style of the code surrounding your change, but if that code is inconsistent or unclear use the following guidelines: - -* We indent using two spaces (soft tabs) -* We use a modified One True Brace Style - * Opening Brace: At the end of the same line as the statement that opens the block - * Closing Brace: Lined up with the first character of the statement that opens the block - * Else If: Place the closing brace at the beginning of the line and the next opening brace at the end of the same line. - * Optional Braces: Always include optional braces. - * Good: if (condition) { return false; } - * Bad: if (condition) return false; -* We encourage use of C style comments: `/* */` - * Think of them as a story describing the feature - * Use them liberally to explain why particular decisions were made. - * Do not write obvious comments - * If you not sure if a comment is obvious, go ahead and include it. -* In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns. -* We use `#pragma once` at the start of header files rather than old-style include guards (`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`) - -Here is an example for easy reference: +Most of our style is pretty easy to pick up on. If you are familiar with either C or Python you should not have too much trouble with our local styles. -```c -/* Enums for foo */ -enum foo_state { - FOO_BAR, - FOO_BAZ, -}; - -/* Returns a value */ -int foo(void) { - if (some_condition) { - return FOO_BAR; - } else { - return -1; - } -} -``` +* [Coding Conventions - C](coding_conventions_c.md) +* [Coding Conventions - Python](coding_conventions_python.md) # General Guidelines @@ -117,6 +85,20 @@ Documentation is one of the easiest ways to get started contributing to QMK. Fin You'll find all our documentation in the `qmk_firmware/docs` directory, or if you'd rather use a web based workflow you can click "Suggest An Edit" at the top of each page on http://docs.qmk.fm/. +When providing code examples in your documentation, try to observe naming conventions used elsewhere in the docs. For example, standardizing enums as `my_layers` or `my_keycodes` for consistency: + +```c +enum my_layers { + _FIRST_LAYER, + _SECOND_LAYER +}; + +enum my_keycodes { + FIRST_LAYER = SAFE_RANGE, + SECOND_LAYER +}; +``` + ## Keymaps Most first-time QMK contributors start with their personal keymaps. We try to keep keymap standards pretty casual (keymaps, after all, reflect the personality of their creators) but we do ask that you follow these guidelines to make it easier for others to discover and learn from your keymap. @@ -125,7 +107,7 @@ Most first-time QMK contributors start with their personal keymaps. We try to ke * All Keymap PR's are squashed, so if you care about how your commits are squashed you should do it yourself * Do not lump features in with keymap PR's. Submit the feature first and then a second PR for the keymap. * Do not include `Makefile`s in your keymap folder (they're no longer used) -* Update copyrights in file headers (look for `REPLACE_WITH_YOUR_NAME `) +* Update copyrights in file headers (look for `%YOUR_NAME%`) ## Keyboards @@ -138,7 +120,7 @@ We also ask that you follow these guidelines: * Do not lump core features in with new keyboards. Submit the feature first and then submit a separate PR for the keyboard. * Name `.c`/`.h` file after the immediate parent folder, eg `/keyboards///.[ch]` * Do not include `Makefile`s in your keyboard folder (they're no longer used) -* Update copyrights in file headers (look for `REPLACE_WITH_YOUR_NAME `) +* Update copyrights in file headers (look for `%YOUR_NAME%`) ## Quantum/TMK Core diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index 5b95450f267..7be82c650f7 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -90,7 +90,7 @@ keyrecord_t record { # LED Control -This allows you to control the 5 LED's defined as part of the USB Keyboard spec. It will be called when the state of one of those 5 LEDs changes. +QMK provides methods to read the 5 LEDs defined as part of the HID spec: * `USB_LED_NUM_LOCK` * `USB_LED_CAPS_LOCK` @@ -98,34 +98,47 @@ This allows you to control the 5 LED's defined as part of the USB Keyboard spec. * `USB_LED_COMPOSE` * `USB_LED_KANA` +These five constants correspond to the positional bits of the host LED state. +There are two ways to get the host LED state: + +* by implementing `led_set_user()` +* by calling `host_keyboard_leds()` + +## `led_set_user()` + +This function will be called when the state of one of those 5 LEDs changes. It receives the LED state as a parameter. +Use the `IS_LED_ON(usb_led, led_name)` and `IS_LED_OFF(usb_led, led_name)` macros to check the LED status. + +!> `host_keyboard_leds()` may already reflect a new value before `led_set_user()` is called. + ### Example `led_set_user()` Implementation ```c void led_set_user(uint8_t usb_led) { - if (usb_led & (1< For most people, the `keyboard_post_init_user` function is what you want to call. For instance, this is where you want to set up things for RGB Underglow. -# Matrix Initialization Code +## Keyboard Pre Initialization code -Before a keyboard can be used the hardware must be initialized. QMK handles initialization of the keyboard matrix itself, but if you have other hardware like LED's or i²c controllers you will need to set up that hardware before it can be used. +This runs very early during startup, even before the USB has been started. +Shortly after this, the matrix is initialized. -### Example `matrix_init_user()` Implementation +For most users, this shouldn't be used, as it's primarily for hardware oriented initialization. -This example, at the keyboard level, sets up B1, B2, and B3 as LED pins. +However, if you have hardware stuff that you need initialized, this is the best place for it (such as initializing LED pins). + +### Example `keyboard_pre_init_user()` Implementation + +This example, at the keyboard level, sets up B0, B1, B2, B3, and B4 as LED pins. ```c -void matrix_init_user(void) { - // Call the keymap level matrix init. +void keyboard_pre_init_user(void) { + // Call the keyboard pre init code. // Set our LED pins as output - DDRB |= (1<<1); - DDRB |= (1<<2); - DDRB |= (1<<3); + setPinOutput(B0); + setPinOutput(B1); + setPinOutput(B2); + setPinOutput(B3); + setPinOutput(B4); } ``` +### `keyboard_pre_init_*` Function Documentation + +* Keyboard/Revision: `void keyboard_pre_init_kb(void)` +* Keymap: `void keyboard_pre_init_user(void)` + +## Matrix Initialization Code + +This is called when the matrix is initialized, and after some of the hardware has been set up, but before many of the features have been initialized. + +This is useful for setting up stuff that you may need elsewhere, but isn't hardware related nor is dependant on where it's started. + + ### `matrix_init_*` Function Documentation * Keyboard/Revision: `void matrix_init_kb(void)` * Keymap: `void matrix_init_user(void)` + +## Keyboard Post Initialization code + +This is ran as the very last task in the keyboard initialization process. This is useful if you want to make changes to certain features, as they should be initialized by this point. + + +### Example `keyboard_post_init_user()` Implementation + +This example, running after everything else has initialized, sets up the rgb underglow configuration. + +```c +void keyboard_post_init_user(void) { + // Call the post init code. + rgblight_enable_noeeprom(); // enables Rgb, without saving settings + rgblight_sethsv_noeeprom(180, 255, 255); // sets the color to teal/cyan without saving + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); // sets mode to Fast breathing without saving +} +``` + +### `keyboard_post_init_*` Function Documentation + +* Keyboard/Revision: `void keyboard_post_init_kb(void)` +* Keymap: `void keyboard_post_init_user(void)` + # Matrix Scanning Code Whenever possible you should customize your keyboard by using `process_record_*()` and hooking into events that way, to ensure that your code does not have a negative performance impact on your keyboard. However, in rare cases it is necessary to hook into the matrix scanning. Be extremely careful with the performance of code in these functions, as it will be called at least 10 times per second. @@ -176,34 +260,30 @@ This example has been deliberately omitted. You should understand enough about Q This function gets called at every matrix scan, which is basically as often as the MCU can handle. Be careful what you put here, as it will get run a lot. -You should use this function if you need custom matrix scanning code. It can also be used for custom status output (such as LED's or a display) or other functionality that you want to trigger regularly even when the user isn't typing. +You should use this function if you need custom matrix scanning code. It can also be used for custom status output (such as LEDs or a display) or other functionality that you want to trigger regularly even when the user isn't typing. # Keyboard Idling/Wake Code If the board supports it, it can be "idled", by stopping a number of functions. A good example of this is RGB lights or backlights. This can save on power consumption, or may be better behavior for your keyboard. -This is controlled by two functions: `suspend_power_down_*` and `suspend_wakeup_init_*`, which are called when the system is board is idled and when it wakes up, respectively. +This is controlled by two functions: `suspend_power_down_*` and `suspend_wakeup_init_*`, which are called when the system board is idled and when it wakes up, respectively. ### Example suspend_power_down_user() and suspend_wakeup_init_user() Implementation -This example, at the keyboard level, sets up B1, B2, and B3 as LED pins. ```c -void suspend_power_down_user(void) -{ +void suspend_power_down_user(void) { rgb_matrix_set_suspend_state(true); } -void suspend_wakeup_init_user(void) -{ +void suspend_wakeup_init_user(void) { rgb_matrix_set_suspend_state(false); } - ``` -### `keyboard_init_*` Function Documentation +### Keyboard suspend/wake Function Documentation * Keyboard/Revision: `void suspend_power_down_kb(void)` and `void suspend_wakeup_init_user(void)` * Keymap: `void suspend_power_down_kb(void)` and `void suspend_wakeup_init_user(void)` @@ -240,9 +320,10 @@ uint32_t layer_state_set_user(uint32_t state) { ``` ### `layer_state_set_*` Function Documentation -* Keyboard/Revision: `void uint32_t layer_state_set_kb(uint32_t state)` +* Keyboard/Revision: `uint32_t layer_state_set_kb(uint32_t state)` * Keymap: `uint32_t layer_state_set_user(uint32_t state)` + The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status) @@ -256,13 +337,13 @@ Keep in mind that EEPROM has a limited number of writes. While this is very high * If you don't understand the example, then you may want to avoid using this feature, as it is rather complicated. -### Example Implementation +### Example Implementation This is an example of how to add settings, and read and write it. We're using the user keymap for the example here. This is a complex function, and has a lot going on. In fact, it uses a lot of the above functions to work! In your keymap.c file, add this to the top: -``` +```c typedef union { uint32_t raw; struct { @@ -275,11 +356,11 @@ user_config_t user_config; This sets up a 32 bit structure that we can store settings with in memory, and write to the EEPROM. Using this removes the need to define variables, since they're defined in this structure. Remember that `bool` (boolean) values use 1 bit, `uint8_t` uses 8 bits, `uint16_t` uses up 16 bits. You can mix and match, but changing the order can cause issues, as it will change the values that are read and written. -We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `matrix_init_user` and `process_record_user` to configure everything. +We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `keyboard_post_init_user` and `process_record_user` to configure everything. -Now, using the `matrix_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like: -``` -void matrix_init_user(void) { +Now, using the `keyboard_post_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like: +```c +void keyboard_post_init_user(void) { // Call the keymap level matrix init. // Read the user config from EEPROM @@ -295,7 +376,7 @@ void matrix_init_user(void) { ``` The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above. -``` +```c uint32_t layer_state_set_user(uint32_t state) { switch (biton32(state)) { case _RAISE: @@ -317,8 +398,8 @@ uint32_t layer_state_set_user(uint32_t state) { return state; } ``` -This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR` and `EPRM`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this: -``` +This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this: +```c bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { @@ -335,11 +416,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { PLAY_NOTE_ARRAY(tone_qwerty); } return true; // Let QMK send the enter press/release events - case EPRM: - if (record->event.pressed) { - eeconfig_init(); // resets the EEPROM to default - } - return false; case RGB_LYR: // This allows me to use underglow as layer indication, or as normal if (record->event.pressed) { user_config.rgb_layer_change ^= 1; // Toggles the status @@ -362,10 +438,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } ``` -And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. For example, if you want to set rgb layer indication by default, and save the default valued. +And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. To force an EEPROM reset, use the `EEP_RST` keycode or [Bootmagic](feature_bootmagic.md) functionallity. For example, if you want to set rgb layer indication by default, and save the default valued. -``` +```c void eeconfig_init_user(void) { // EEPROM is getting reset! + user_config.raw = 0; user_config.rgb_layer_change = true; // We want this enabled by default eeconfig_update_user(user_config.raw); // Write default value to EEPROM now @@ -384,3 +461,31 @@ And you're done. The RGB layer indication will only work if you want it to. And * Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)` The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM. + +# Custom Tapping Term + +By default, the tapping term is defined globally, and is not configurable by key. For most users, this is perfectly fine. But in come cases, dual function keys would be greatly improved by different timeouts than `LT` keys, or because some keys may be easier to hold than others. Instead of using custom key codes for each, this allows for per key configurable `TAPPING_TERM`. + +To enable this functionality, you need to add `#define TAPPING_TERM_PER_KEY` to your `config.h`, first. + + +## Example `get_tapping_term` Implementation + +To change the `TAPPING TERM` based on the keycode, you'd want to add something like the following to your `keymap.c` file: + +```c +uint16_t get_tapping_term(uint16_t keycode) { + switch (keycode) { + case SFT_T(KC_SPC): + return TAPPING_TERM + 1250; + case LT(1, KC_GRV): + return 130; + default: + return TAPPING_TERM; + } +} +``` + +### `get_tapping_term` Function Documentation + +Unlike many of the other functions here, there isn't a need (or even reason) to have a quantum or keyboard level function. Only a user level function is useful here, so no need to mark it as such. diff --git a/docs/faq_build.md b/docs/faq_build.md index 465a283aef2..bcf017a9b2a 100644 --- a/docs/faq_build.md +++ b/docs/faq_build.md @@ -15,7 +15,7 @@ or just: $ sudo make ::dfu -Note that running `make` with `sudo` is generally *not* a good idea, and you should use one of the former methods, if possible. +Note that running `make` with `sudo` is generally ***not*** a good idea, and you should use one of the former methods, if possible. ### Linux `udev` Rules On Linux, you'll need proper privileges to access the MCU. You can either use @@ -36,14 +36,27 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", MODE:="066 # tmk keyboard products https://github.com/tmk/tmk_keyboard SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666" ``` +**/etc/udev/rules.d/54-input-club-keyboard.rules:** + +``` +# Input Club keyboard bootloader +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", MODE:="0666" +``` + +### Serial device is not detected in bootloader mode on Linux +Make sure your kernel has appropriate support for your device. If your device uses USB ACM, such as +Pro Micro (Atmega32u4), make sure to include `CONFIG_USB_ACM=y`. Other devices may require `USB_SERIAL` and any of its sub options. ## Unknown Device for DFU Bootloader -If you're using Windows to flash your keyboard, and you are running into issues, check the Device Manager. If you see an "Unknown Device" when the keyboard is in "bootloader mode", then you may have a driver issue. +Issues encountered when flashing keyboards on Windows are most often due to having the wrong drivers installed for the bootloader. + +Re-running the installation script for MSYS2 may help (eg run `util/qmk_install.sh` from MSYS2/WSL) or reinstalling the QMK Toolbox may fix the issue. Alternatively, you can download and run the [`qmk_driver_installer`](https://github.com/qmk/qmk_driver_installer) package. -Re-running the installation script for MSYS2 may help (eg run `./util/qmk_install.sh` from MSYS2/WSL) or reinstalling the QMK Toolbox may fix the issue. +If that doesn't work, then you may need to grab the [Zadig Utility](https://zadig.akeo.ie/). Download this, and run it on the system. Then, you will need to reset your board into bootloader mode. After that, locate the device in question. If the device doesn't show up in the list (or nothing shows up in the list), you may need to enable the `List all devices` option in the `Options` menu. + +From here, you will need to know what type of controller the board is using. You may see it listed in the Device Manager as `ATmega32U4` device (which is an AVR board), or an `STM32` device (Which is an ARM board). For AVR boards, use `libusb-win32` for the driver. For ARM boards, use the `WinUSB` driver. Once the correct driver type has been selected, click on the `Replace Driver` button, unplug your board, plug it back in, and reset it again. -If that doesn't work, then you may need to grab the [Zadig Utility](https://zadig.akeo.ie/). Download this, find the device in question, and select the `WinUS(libusb-1.0)` option, and hit "Reinstall driver". Once you've done that, try flashing your board, again. ## WINAVR is Obsolete It is no longer recommended and may cause some problem. @@ -98,9 +111,9 @@ OPT_DEFS += -DBOOTLOADER_SIZE=2048 ``` ## `avr-gcc: internal compiler error: Abort trap: 6 (program cc1)` on MacOS -This is an issue with updating on brew, causing symlinks that avr-gcc depend on getting mangled. +This is an issue with updating on brew, causing symlinks that avr-gcc depend on getting mangled. -The solution is to remove and reinstall all affected modules. +The solution is to remove and reinstall all affected modules. ``` brew rm avr-gcc @@ -125,6 +138,14 @@ For now, you need to rollback avr-gcc to 7 in brew. ``` brew uninstall --force avr-gcc -brew install avr-gcc@7 -brew link avr-gcc@7 +brew install avr-gcc@8 +brew link --force avr-gcc@8 ``` + +### I just flashed my keyboard and it does nothing/keypresses don't register - it's also ARM (rev6 planck, clueboard 60, hs60v2, etc...) (Feb 2019) +Due to how EEPROM works on ARM based chips, saved settings may no longer be valid. This affects the default layers, and *may*, under certain circumstances we are still figuring out, make the keyboard unusable. Resetting the EEPROM will correct this. + +[Planck rev6 reset EEPROM](https://cdn.discordapp.com/attachments/473506116718952450/539284620861243409/planck_rev6_default.bin) can be used to force an eeprom reset. After flashing this image, flash your normal firmware again which should restore your keyboard to _normal_ working order. +[Preonic rev3 reset EEPROM](https://cdn.discordapp.com/attachments/473506116718952450/537849497313738762/preonic_rev3_default.bin) + +If bootmagic is enabled in any form, you should be able to do this too (see [Bootmagic docs](feature_bootmagic.md) and keyboard info for specifics on how to do this). diff --git a/docs/faq_debug.md b/docs/faq_debug.md index 7c1690d13f8..f6cc729b612 100644 --- a/docs/faq_debug.md +++ b/docs/faq_debug.md @@ -87,6 +87,7 @@ Size after: - EEPROM has around a 100000 write cycle. You shouldn't rewrite the firmware repeatedly and continually; that'll burn the EEPROM eventually. + ## NKRO Doesn't work First you have to compile firmware with this build option `NKRO_ENABLE` in **Makefile**. diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index 07d74d6cf3e..0a627469e75 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md @@ -11,8 +11,8 @@ Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_f There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JIS. North America primarily uses ANSI, Europe and Africa primarily use ISO, and Japan uses JIS. Regions not mentioned typically use either ANSI or ISO. The keycodes corresponding to these layouts are shown here: - -![Keyboard Layout Image](https://i.imgur.com/gvlNUpQ.png) + +![Keyboard Layout Image](https://i.imgur.com/5wsh5wM.png) ## Some Of My Keys Are Swapped Or Not Working @@ -151,13 +151,13 @@ This turns right modifier keys into arrow keys when the keys are tapped while st */ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty */ - [0] = KEYMAP( \ + [0] = LAYOUT( \ ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS,BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \ LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,FN0, ESC, \ FN4, LGUI,LALT, SPC, APP, FN2, FN1, FN3), - [1] = KEYMAP( \ + [1] = LAYOUT( \ GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ @@ -211,20 +211,3 @@ here real_mods lost state for 'physical left shift'. weak_mods is ORed with real_mods when keyboard report is sent. https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57 - -## Timer Functionality - -It's possible to start timers and read values for time-specific events - here's an example: - -```c -static uint16_t key_timer; -key_timer = timer_read(); - -if (timer_elapsed(key_timer) < 100) { - // do something if less than 100ms have passed -} else { - // do something if 100ms or more have passed -} -``` - -It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in. diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index f2e4909d861..f748ccd70c2 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -11,21 +11,21 @@ People often define custom names using `#define`. For example: #define ALT_TAB LALT(KC_TAB) ``` -This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping it more readable. +This will allow you to use `FN_CAPS` and `ALT_TAB` in your keymap, keeping it more readable. ## Caveats -Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored. +Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored. If you need to apply modifiers to your tapped keycode, [Tap Dance](https://github.com/qmk/qmk_firmware/blob/master/docs/feature_tap_dance.md#example-5-using-tap-dance-for-advanced-mod-tap-and-layer-tap-keys) can be used to accomplish this. Additionally, if at least one right-handed modifier is specified in a Mod Tap or Layer Tap, it will cause all modifiers specified to become right-handed, so it is not possible to mix and match the two. # Switching and Toggling Layers -These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. For a detailed explanation of layers, see [Keymap Overview](keymap.md#keymap-and-layers) +These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. For a detailed explanation of layers, see [Keymap Overview](keymap.md#keymap-and-layers). When using momentary layer switching with MO(), LM(), TT(), or LT(), make sure to leave the key on the above layers transparent or it may not work as intended. * `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).) * `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. -* `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers. +* `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers: `MOD_LCTL`, `MOD_LSFT`, `MOD_LALT`, `MOD_LGUI` (note the use of `MOD_` constants instead of `KC_`). These modifiers can be combined using bitwise OR, e.g. `LM(_RAISE, MOD_LCTL | MOD_LALT)`. * `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. Only supports layers 0-15. * `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys](#one-shot-keys) for details and additional functionality. * `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa @@ -60,22 +60,21 @@ Sometimes, you might want to switch between layers in a macro or as part of a ta These allow you to combine a modifier with a keycode. When pressed, the keydown event for the modifier, then `kc` will be sent. On release, the keyup event for `kc`, then the modifier will be sent. -|Key |Aliases |Description | -|----------|----------------------|----------------------------------------------------| -|`LCTL(kc)`| |Hold Left Control and press `kc` | -|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | -|`LALT(kc)`| |Hold Left Alt and press `kc` | -|`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | -|`RCTL(kc)`| |Hold Right Control and press `kc` | -|`RSFT(kc)`| |Hold Right Shift and press `kc` | -|`RALT(kc)`| |Hold Right Alt and press `kc` | -|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | -|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| -|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | -|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | -|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` | -|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | -|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | +|Key |Aliases |Description | +|----------|-------------------------------|----------------------------------------------------| +|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` | +|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | +|`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` | +|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | +|`RCTL(kc)`| |Hold Right Control and press `kc` | +|`RSFT(kc)`| |Hold Right Shift and press `kc` | +|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | +|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` | +|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` | +|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | +|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | +|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | +|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| You can also chain them, for example `LCTL(LALT(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress. @@ -93,7 +92,7 @@ The modifiers this keycode and `OSM()` accept are prefixed with `MOD_`, not `KC_ |`MOD_LGUI`|Left GUI (Windows/Command/Meta key) | |`MOD_RCTL`|Right Control | |`MOD_RSFT`|Right Shift | -|`MOD_RALT`|Right Alt | +|`MOD_RALT`|Right Alt (AltGr) | |`MOD_RGUI`|Right GUI (Windows/Command/Meta key) | |`MOD_HYPR`|Hyper (Left Control, Shift, Alt and GUI)| |`MOD_MEH` |Meh (Left Control, Shift, and Alt) | @@ -108,23 +107,23 @@ This key would activate Left Control and Left Shift when held, and send Escape w For convenience, QMK includes some Mod-Tap shortcuts to make common combinations more compact in your keymap: -|Key |Aliases |Description | -|------------|---------------------------------------|-------------------------------------------------------| -|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped | -|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped | -|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped | -|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped | -|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped | -|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped | -|`LGUI_T(kc)`|`LCMD_T(kc)`, `RWIN_T(kc)`, `GUI_T(kc)`|Left GUI when held, `kc` when tapped | -|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | -|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped | -|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped| -|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped | -|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped | -|`ALL_T(kc)` | |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)| -|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | -|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | +|Key |Aliases |Description | +|------------|-----------------------------------------------------------------|-------------------------------------------------------| +|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped | +|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped | +|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped | +|`LGUI_T(kc)`|`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped | +|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped | +|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped | +|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped | +|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | +|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | +|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped | +|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped | +|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped | +|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped| +|`HYPR_T(kc)`|`ALL_T(kc)` |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)| ## Caveats @@ -147,7 +146,7 @@ Additionally, hitting keys five times in a short period will lock that key. This You can control the behavior of one shot keys by defining these in `config.h`: ```c -#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */ +#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped once again. */ #define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ ``` @@ -162,8 +161,88 @@ For one shot mods, you need to call `set_oneshot_mods(MOD)` to set it, or `clear !> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. +## Callbacks -# Permissive Hold +When you'd like to perform custom logic when pressing a one shot key, there are several callbacks you can choose to implement. You could indicate changes in one shot keys by flashing an LED or making a sound, for example. + +There is a callback for `OSM(mod)`. It is called whenever the state of any one shot modifier key is changed: when it toggles on, but also when it is toggled off. You can use it like this: + +```c +void oneshot_mods_changed_user(uint8_t mods) { + if (mods & MOD_MASK_SHIFT) { + println("Oneshot mods SHIFT"); + } + if (mods & MOD_MASK_CTRL) { + println("Oneshot mods CTRL"); + } + if (mods & MOD_MASK_ALT) { + println("Oneshot mods ALT"); + } + if (mods & MOD_MASK_GUI) { + println("Oneshot mods GUI"); + } + if (!mods) { + println("Oneshot mods off"); + } +} +``` + +The `mods` argument contains the active mods after the change, so it reflects the current state. + +When you use One Shot Tap Toggle (by adding `#define ONESHOT_TAP_TOGGLE 2` in your `config.h` file), you may lock a modifier key by pressing it the specified amount of times. There's a callback for that, too: + +```c +void oneshot_locked_mods_changed_user(uint8_t mods) { + if (mods & MOD_MASK_SHIFT) { + println("Oneshot locked mods SHIFT"); + } + if (mods & MOD_MASK_CTRL) { + println("Oneshot locked mods CTRL"); + } + if (mods & MOD_MASK_ALT) { + println("Oneshot locked mods ALT"); + } + if (mods & MOD_MASK_GUI) { + println("Oneshot locked mods GUI"); + } + if (!mods) { + println("Oneshot locked mods off"); + } +} +``` + +Last, there is also a callback for the `OSL(layer)` one shot key: + +```c +void oneshot_layer_changed_user(uint8_t layer) { + if (layer == 1) { + println("Oneshot layer 1 on"); + } + if (!layer) { + println("Oneshot layer off"); + } +} +``` + +If any one shot layer is switched off, `layer` will be zero. When you're looking to do something on any layer change instead of one shot layer changes, `layer_state_set_user` is a better callback to use. + +If you are making your own keyboard, there are also `_kb` equivalent functions: + +```c +void oneshot_locked_mods_changed_kb(uint8_t mods); +void oneshot_mods_changed_kb(uint8_t mods); +void oneshot_layer_changed_kb(uint8_t layer); +``` + +As with any callback, be sure to call the `_user` variant to allow for further customizability. + +# Tap-Hold Configuration Options + +While Tap-Hold options are fantastic, they are not without their issues. We have tried to configure them with reasonal defaults, but that may still cause issues for some people. + +These options let you modify the behavior of the Tap-Hold keys. + +## Permissive Hold As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option: @@ -171,38 +250,64 @@ As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new #define PERMISSIVE_HOLD ``` -This makes it easier for fast typists to use dual-function keys. Without this, if you let go of a held key inside the tapping term, it won't register. +This makes tap and hold keys (like Mod Tap) work better for fast typist, or for high `TAPPING_TERM` settings. + +If you press a Mod Tap key, tap another key (press and release) and then release the Mod Tap key, all within the tapping term, it will output the "tapping" function for both keys. + +For Instance: + +- `SFT_T(KC_A)` Down +- `KC_X` Down +- `KC_X` Up +- `SFT_T(KC_A)` Up + +Normally, if you do all this within the `TAPPING_TERM` (default: 200ms) this will be registered as `ax` by the firmware and host system. With permissive hold enabled, this modifies how this is handled by considering the Mod Tap keys as a Mod if another key is tapped, and would registered as `X` (`SHIFT`+`x`). + +?> If you have `Ignore Mod Tap Interrupt` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. + +## Ignore Mod Tap Interrupt + +To enable this setting, add this to your `config.h`: + +```c +#define IGNORE_MOD_TAP_INTERRUPT +``` + +Similar to Permissive Hold, this alters how the firmware processes input for fast typist. If you press a Mod Tap key, press another key, release the Mod Tap key, and then release the normal key, it would normally output the "tapping" function for both keys. This may not be desirable for rolling combo keys. -Example: (Tapping Term = 200ms) +Setting `Ignore Mod Tap Interrupt` requires holding both keys for the `TAPPING_TERM` to trigger the hold function (the mod). -- SHFT_T(KC_A) Down -- KC_X Down -- KC_X Up -- SHFT_T(KC_A) Up +For Instance: -With defaults, if above is typed within tapping term, this will emit `ax`. With permissive hold, if above is typed within tapping term, this will emit `X` (so, Shift+X). +- `SFT_T(KC_A)` Down +- `KC_X` Down +- `SFT_T(KC_A)` Up +- `KC_X` Up -# Mod tap interrupt +Normally, this would send `X` (`SHIFT`+`x`). With `Ignore Mod Tap Interrupt` enabled, holding both keys are required for the `TAPPING_TERM` to register the hold action. A quick tap will output `ax` in this case, while a hold on both will still output `X` (`SHIFT`+`x`). -When a dual role key used for a modifier is quickly followed by another keys, it is interpreted as held even before the tapping term elapsed. This is a problem if a key is used for example inside a rolling combo because the second key will be pressed before the first key is released. -For example, when trying to type the rolling combo "zx" and z being configured to send Ctrl when hold, z rapidly followed by x actually sends Ctrl-x. That's bad. +?> __Note__: This only concerns modifiers and not layer switching keys. -You can disable this behavior by defining `IGNORE_MOD_TAP_INTERRUPT` in `config.h`. +?> If you have `Permissive Hold` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. -Note that this only concerns modifiers and not layer switching keys. +## Tapping Force Hold -# Hold after tap +To enable `tapping force hold`, add the following to your `config.h`: + +```c +#define TAPPING_FORCE_HOLD +``` -When the user holds a key after tap, this repeats the tapped key rather to hold a modifier key. This allows to use auto repeat for the tapped key. If you prefer to hold a modifier instead, define `TAPPING_FORCE_HOLD` in `config.h`. +When the user holds a key after tap, this repeats the tapped key rather to hold a modifier key. This allows to use auto repeat for the tapped key. Example: -- SHFT_T(KC_A) Down -- SHFT_T(KC_A) Up -- SHFT_T(KC_A) Down +- SFT_T(KC_A) Down +- SFT_T(KC_A) Up +- SFT_T(KC_A) Down - wait more than tapping term... -- SHFT_T(KC_A) Up +- SFT_T(KC_A) Up With default settings, `a` will be sent on the first release, then `a` will be sent on the second press allowing the computer to trigger its auto repeat function. @@ -210,8 +315,14 @@ With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allo !> `TAPPING_FORCE_HOLD` will break anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tapping Toggle). -# Retro Tapping +## Retro Tapping + +To enable `retro tapping`, add the following to your `config.h`: + +```c +#define RETRO_TAPPING +``` Holding and releasing a dual function key without pressing another key will result in nothing happening. With retro tapping enabled, releasing the key without pressing another will send the original keycode even if it is outside the tapping term. -For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`. +For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With this enabled, it will send `KC_SPACE` instead. diff --git a/docs/feature_audio.md b/docs/feature_audio.md index 82e0ed9503d..7511598bcfb 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -61,10 +61,19 @@ It's advised that you wrap all audio features in `#ifdef AUDIO_ENABLE` / `#endif The available keycodes for audio are: -* `AU_ON` - Turn audio mode on -* `AU_OFF` - Turn audio mode off -* `AU_TOG` - Toggle audio mode +* `AU_ON` - Turn Audio Feature on +* `AU_OFF` - Turn Audio Feature off +* `AU_TOG` - Toggle Audio Feature state +!> These keycodes turn all of the audio functionality on and off. Turning it off means that audio feedback, audio clicky, music mode, etc. are disabled, completely. + +## ARM Audio Volume + +For ARM devices, you can adjust the DAC sample values. If your board is too loud for you or your coworkers, you can set the max using `DAC_SAMPLE_MAX` in your `config.h`: + +```c +#define DAC_SAMPLE_MAX 65535U +``` ## Music Mode @@ -91,6 +100,16 @@ In music mode, the following keycodes work differently, and don't pass through: * `KC_UP` - speed-up playback * `KC_DOWN` - slow-down playback +The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, add something like this to your `config.h`: + + #define PITCH_STANDARD_A 432.0f + +You can completely disable Music Mode as well. This is useful, if you're pressed for space on your controller. To disable it, add this to your `config.h`: + + #define NO_MUSIC_MODE + +### Music Mask + By default, `MUSIC_MASK` is set to `keycode < 0xFF` which means keycodes less than `0xFF` are turned into notes, and don't output anything. You can change this by defining this in your `config.h` like this: #define MUSIC_MASK keycode != KC_NO @@ -111,13 +130,26 @@ For a more advanced way to control which keycodes should still be processed, you Things that return false are not part of the mask, and are always processed. -The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, add something like this to your `config.h`: +### Music Map - #define PITCH_STANDARD_A 432.0f +By default, the Music Mode uses the columns and row to determine the scale for the keys. For a board that uses a rectangular matrix that matches the keyboard layout, this is just fine. However, for boards that use a more complicated matrix (such as the Planck Rev6, or many split keyboards) this would result in a very skewed experience. -You can completely disable Music Mode as well. This is useful, if you're pressed for space on your controller. To disable it, add this to your `config.h`: +However, the Music Map option allows you to remap the scaling for the music mode, so it fits the layout, and is more natural. - #define NO_MUSIC_MODE +To enable this feature, add `#define MUSIC_MAP` to your `config.h` file, and then you will want to add a `uint8_t music_map` to your keyboard's `c` file, or your `keymap.c`. + +```c +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_4x12( + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 +); +``` + +You will want to use whichever `LAYOUT` macro that your keyboard uses here. This maps it to the correct key location. Start in the bottom left of the keyboard layout, and move to the right, and then upwards. Fill in all the entries until you have a complete matrix. + +You can look at the [Planck Keyboard](https://github.com/qmk/qmk_firmware/blob/e9ace1487887c1f8b4a7e8e6d87c322988bec9ce/keyboards/planck/planck.c#L24-L29) as an example of how to implement this. ## Audio Click @@ -143,15 +175,16 @@ You can configure the default, min and max frequencies, the stepping and built i | `AUDIO_CLICKY_FREQ_DEFAULT` | 440.0f | Sets the default/starting audio frequency for the clicky sounds. | | `AUDIO_CLICKY_FREQ_MIN` | 65.0f | Sets the lowest frequency (under 60f are a bit buggy). | | `AUDIO_CLICKY_FREQ_MAX` | 1500.0f | Sets the the highest frequency. Too high may result in coworkers attacking you. | -| `AUDIO_CLICKY_FREQ_FACTOR` | 1.18921f| Sets the stepping of UP/DOWN key codes. | +| `AUDIO_CLICKY_FREQ_FACTOR` | 1.18921f| Sets the stepping of UP/DOWN key codes. This is a multiplicative factor. The default steps the frequency up/down by a musical minor third. | | `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | Sets a factor of randomness for the clicks, Setting this to `0f` will make each click identical, and `1.0f` will make this sound much like the 90's computer screen scrolling/typing effect. | +| `AUDIO_CLICKY_DELAY_DURATION` | 1 | An integer note duration where 1 is 1/16th of the tempo, or a sixty-fourth note (see `quantum/audio/musical_notes.h` for implementation details). The main clicky effect will be delayed by this duration. Adjusting this to values around 6-12 will help compensate for loud switches. | ## MIDI Functionality -This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile. +This is still a WIP, but check out `quantum/process_keycode/process_midi.c` to see what's happening. Enable from the Makefile. ## Audio Keycodes diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 7bb7e03a89e..64c663076ba 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -30,7 +30,32 @@ You should then be able to use the keycodes below to change the backlight level. This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard. -Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software implementation will be used, and backlight breathing will not be available. Currently the supported pins are `B5`, `B6`, `B7`, and `C6`. +Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software PWM implementation triggered by hardware timer interrupts will be used. + +Hardware PWM is supported according to the following table: + +| Backlight Pin | Hardware timer | +|---------------|-------------------------| +|`B5` | Timer 1 | +|`B6` | Timer 1 | +|`B7` | Timer 1 | +|`C6` | Timer 3 | +|`D4` | Timer 1 (ATmega32A only)| +| other | Software PWM | + +The [audio feature](feature_audio.md) also uses hardware timers. Please refer to the following table to know what hardware timer the software PWM will use depending on the audio configuration: + +| Audio Pin(s) | Audio Timer | Software PWM Timer | +|--------------|-------------|--------------------| +| `C4` | Timer 3 | Timer 1 | +| `C5` | Timer 3 | Timer 1 | +| `C6` | Timer 3 | Timer 1 | +| `B5` | Timer 1 | Timer 3 | +| `B6` | Timer 1 | Timer 3 | +| `B7` | Timer 1 | Timer 3 | +| `Bx` & `Cx` | Timer 1 & 3 | None | + +When all timers are in use for [audio](feature_audio.md), the backlight software PWM will not use a hardware timer, but instead will be triggered during the matrix scan. In this case the backlight doesn't support breathing and might show lighting artifacts (for instance flickering), because the PWM computation might not be called with enough timing precision. ## Configuration @@ -39,9 +64,33 @@ To change the behaviour of the backlighting, `#define` these in your `config.h`: |Define |Default |Description | |---------------------|-------------|-------------------------------------------------------------------------------------------------------------| |`BACKLIGHT_PIN` |`B7` |The pin that controls the LEDs. Unless you are designing your own keyboard, you shouldn't need to change this| -|`BACKLIGHT_LEVELS` |`3` |The number of brightness levels (maximum 15 excluding off) | -|`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if hardware PWM is used | +|`BACKLIGHT_PINS` |*Not defined*|experimental: see below for more information | +|`BACKLIGHT_LEVELS` |`3` |The number of brightness levels (maximum 31 excluding off) | +|`BACKLIGHT_CAPS_LOCK`|*Not defined*|Enable Caps Lock indicator using backlight (for keyboards without dedicated LED) | +|`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if supported | |`BREATHING_PERIOD` |`6` |The length of one backlight "breath" in seconds | +|`BACKLIGHT_ON_STATE` |`0` |The state of the backlight pin when the backlight is "on" - `1` for high, `0` for low | + +## Backlight On State + +Most backlight circuits are driven by an N-channel MOSFET or NPN transistor. This means that to turn the transistor *on* and light the LEDs, you must drive the backlight pin, connected to the gate or base, *high*. +Sometimes, however, a P-channel MOSFET, or a PNP transistor is used. In this case, when the transistor is on, the pin is driven *low* instead. + +This functionality is configured at the keyboard level with the `BACKLIGHT_ON_STATE` define. + +## Multiple backlight pins + +Most keyboards have only one backlight pin which control all backlight LEDs (especially if the backlight is connected to an hardware PWM pin). +In software PWM, it is possible to define multiple backlight pins. All those pins will be turned on and off at the same time during the PWM duty cycle. +This feature allows to set for instance the Caps Lock LED (or any other controllable LED) brightness at the same level as the other LEDs of the backlight. This is useful if you have mapped LCTRL in place of Caps Lock and you need the Caps Lock LED to be part of the backlight instead of being activated when Caps Lock is on. + +To activate multiple backlight pins, you need to add something like this to your user `config.h`: + +~~~c +#define BACKLIGHT_LED_COUNT 2 +#undef BACKLIGHT_PIN +#define BACKLIGHT_PINS { F5, B2 } +~~~ ## Hardware PWM Implementation @@ -52,16 +101,28 @@ In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus th The breathing effect is achieved by registering an interrupt handler for `TIMER1_OVF_vect` that is called whenever the counter resets, roughly 244 times per second. In this handler, the value of an incrementing counter is mapped onto a precomputed brightness curve. To turn off breathing, the interrupt handler is simply disabled, and the brightness reset to the level stored in EEPROM. +## Software PWM Implementation + +When `BACKLIGHT_PIN` is not set to a hardware backlight pin, QMK will use a hardware timer configured to trigger software interrupts. This time will count up to `ICRx` (by default `0xFFFF`) before resetting to 0. +When resetting to 0, the CPU will fire an OVF (overflow) interrupt that will turn the LEDs on, starting the duty cycle. +The desired brightness is calculated and stored in the `OCRxx` register. When the counter reaches this value, the CPU will fire a Compare Output match interrupt, which will turn the LEDs off. +In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus the brightness, where `0x0000` is completely off and `0xFFFF` is completely on. + +The breathing effect is the same as in the hardware PWM implementation. + ## Backlight Functions -|Function |Description | -|----------|----------------------------------------------------------| -|`backlight_toggle()` |Turn the backlight on or off | -|`backlight_step()` |Cycle through backlight levels | -|`backlight_increase()` |Increase the backlight level | -|`backlight_decrease()` |Decrease the backlight level | -|`backlight_level(x)` |Sets the backlight level to specified level | -|`get_backlight_level()`|Return the current backlight level | +|Function |Description | +|----------|-----------------------------------------------------------| +|`backlight_toggle()` |Turn the backlight on or off | +|`backlight_enable()` |Turn the backlight on | +|`backlight_disable()` |Turn the backlight off | +|`backlight_step()` |Cycle through backlight levels | +|`backlight_increase()` |Increase the backlight level | +|`backlight_decrease()` |Decrease the backlight level | +|`backlight_level(x)` |Sets the backlight level to specified level | +|`get_backlight_level()` |Return the current backlight level | +|`is_backlight_enabled()`|Return whether the backlight is currently on | ### Backlight Breathing Functions diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index 504fb90f451..225189ccb76 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md @@ -127,7 +127,9 @@ Additionally, you may want to specify which key to use. This is especially usef By default, these are set to 0 and 0, which is usually the "ESC" key on a majority of keyboards. -And to trigger the bootloader, you hold this key down when plugging the keyboard in. Just the single key. +And to trigger the bootloader, you hold this key down when plugging the keyboard in. Just the single key. + +!> Using bootmagic lite will **always reset** the EEPROM, so you will lose any settings that have been saved. ## Advanced Bootmagic Lite @@ -138,7 +140,7 @@ To replace the function, all you need to do is add something like this to your c ```c void bootmagic_lite(void) { matrix_scan(); - wait_ms(DEBOUNCING_DELAY * 2); + wait_ms(DEBOUNCE * 2); matrix_scan(); if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { diff --git a/docs/feature_combo.md b/docs/feature_combo.md index 5bb73ef1067..9db7be5119e 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -19,7 +19,6 @@ combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)}; This will send "Escape" if you hit the A and B keys. !> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control. -!> You cannot reuse (share) keys in combos. Each key should only belong to a single combo. ## Examples @@ -29,7 +28,8 @@ If you want to add a list, then you'd use something like this: enum combos { AB_ESC, JK_TAB -} +}; + const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END}; const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; @@ -44,41 +44,34 @@ For a more complicated implementation, you can use the `process_combo_event` fun ```c enum combo_events { ZC_COPY, - ZV_PASTE - }; + XV_PASTE +}; const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END}; -const uint16_t PROGMEM paste_combo[] = {KC_Z, KC_V, COMBO_END}; +const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END}; combo_t key_combos[COMBO_COUNT] = { [ZC_COPY] = COMBO_ACTION(copy_combo), - [ZV_PASTE] = COMBO_ACTION(paste_combo), + [XV_PASTE] = COMBO_ACTION(paste_combo), }; void process_combo_event(uint8_t combo_index, bool pressed) { switch(combo_index) { case ZC_COPY: if (pressed) { - register_code(KC_LCTL); - register_code(KC_C); - unregister_code(KC_C); - unregister_code(KC_LCTL); + tap_code16(LCTL(KC_C)); } break; - - case ZV_PASTE: + case XV_PASTE: if (pressed) { - register_code(KC_LCTL); - register_code(KC_V); - unregister_code(KC_V); - unregister_code(KC_LCTL); + tap_code16(LCTL(KC_V)); } break; } } ``` -This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit Z and V. But you could change this to do stuff like change layers, play sounds, or change settings. +This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit X and V. But you could change this to do stuff like change layers, play sounds, or change settings. ## Additional Configuration @@ -87,3 +80,24 @@ If you're using long combos, or even longer combos, you may run into issues with In this case, you can add either `#define EXTRA_LONG_COMBOS` or `#define EXTRA_EXTRA_LONG_COMBOS` in your `config.h` file. You may also be able to enable action keys by defining `COMBO_ALLOW_ACTION_KEYS`. + +## Keycodes + +You can enable, disable and toggle the Combo feature on the fly. This is useful if you need to disable them temporarily, such as for a game. + +|Keycode |Description | +|----------|---------------------------------| +|`CMB_ON` |Turns on Combo feature | +|`CMB_OFF` |Turns off Combo feature | +|`CMB_TOG` |Toggles Combo feature on and off | + +## User callbacks + +In addition to the keycodes, there are a few functions that you can use to set the status, or check it: + +|Function |Description | +|-----------|--------------------------------------------------------------------| +| `combo_enable()` | Enables the combo feature | +| `combo_disable()` | Disables the combo feature, and clears the combo buffer | +| `combo_toggle()` | Toggles the state of the combo feature | +| `is_combo_enabled()` | Returns the status of the combo feature state (true or false) | diff --git a/docs/feature_command.md b/docs/feature_command.md index ca2ecce0dac..a4ce3f5aea0 100644 --- a/docs/feature_command.md +++ b/docs/feature_command.md @@ -16,35 +16,36 @@ To use Command, hold down the key combination defined by the `IS_COMMAND()` macr If you would like to change the key assignments for Command, `#define` these in your `config.h` at either the keyboard or keymap level. All keycode assignments here must omit the `KC_` prefix. -|Define |Default |Description | -|------------------------------------|--------------------------------------------------------------------------------------|------------------------------------------------| -|`IS_COMMAND()` |(keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))|The key combination to activate Command | -|`MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` |`true` |Set default layer with the Function row | -|`MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` |`true` |Set default layer with the number keys | -|`MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM`|`false` |Set default layer with `MAGIC_KEY_LAYER0..9` | -|`MAGIC_KEY_DEBUG` |`D` |Toggle debugging over serial | -|`MAGIC_KEY_DEBUG_MATRIX` |`X` |Toggle key matrix debugging | -|`MAGIC_KEY_DEBUG_KBD` |`K` |Toggle keyboard debugging | -|`MAGIC_KEY_DEBUG_MOUSE` |`M` |Toggle mouse debugging | -|`MAGIC_KEY_CONSOLE` |`C` |Enable the Command console | -|`MAGIC_KEY_VERSION` |`V` |Print the running QMK version to the console | -|`MAGIC_KEY_STATUS` |`S` |Print the current keyboard status to the console| -|`MAGIC_KEY_HELP1` |`H` |Print Command help to the console | -|`MAGIC_KEY_HELP2` |`SLASH` |Print Command help to the console (alternate) | -|`MAGIC_KEY_LAYER0` |`0` |Make layer 0 the default layer | -|`MAGIC_KEY_LAYER1` |`1` |Make layer 1 the default layer | -|`MAGIC_KEY_LAYER2` |`2` |Make layer 2 the default layer | -|`MAGIC_KEY_LAYER3` |`3` |Make layer 3 the default layer | -|`MAGIC_KEY_LAYER4` |`4` |Make layer 4 the default layer | -|`MAGIC_KEY_LAYER5` |`5` |Make layer 5 the default layer | -|`MAGIC_KEY_LAYER6` |`6` |Make layer 6 the default layer | -|`MAGIC_KEY_LAYER7` |`7` |Make layer 7 the default layer | -|`MAGIC_KEY_LAYER8` |`8` |Make layer 8 the default layer | -|`MAGIC_KEY_LAYER9` |`9` |Make layer 9 the default layer | -|`MAGIC_KEY_LAYER0_ALT1` |`ESC` |Make layer 0 the default layer (alternate) | -|`MAGIC_KEY_LAYER0_ALT2` |`GRAVE` |Make layer 0 the default layer (alternate) | -|`MAGIC_KEY_BOOTLOADER` |`PAUSE` |Enter the bootloader | -|`MAGIC_KEY_LOCK` |`CAPS` |Lock the keyboard so nothing can be typed | -|`MAGIC_KEY_EEPROM` |`E` |Clear the EEPROM | -|`MAGIC_KEY_NKRO` |`N` |Toggle N-Key Rollover (NKRO) | -|`MAGIC_KEY_SLEEP_LED` |`Z` |Toggle LED when computer is sleeping | +|Define |Default |Description | +|------------------------------------|--------------------------------|------------------------------------------------| +|`IS_COMMAND()` |`(get_mods() == MOD_MASK_SHIFT)`|The key combination to activate Command | +|`MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` |`true` |Set default layer with the Function row | +|`MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` |`true` |Set default layer with the number keys | +|`MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM`|`false` |Set default layer with `MAGIC_KEY_LAYER0..9` | +|`MAGIC_KEY_DEBUG` |`D` |Toggle debugging over serial | +|`MAGIC_KEY_DEBUG_MATRIX` |`X` |Toggle key matrix debugging | +|`MAGIC_KEY_DEBUG_KBD` |`K` |Toggle keyboard debugging | +|`MAGIC_KEY_DEBUG_MOUSE` |`M` |Toggle mouse debugging | +|`MAGIC_KEY_CONSOLE` |`C` |Enable the Command console | +|`MAGIC_KEY_VERSION` |`V` |Print the running QMK version to the console | +|`MAGIC_KEY_STATUS` |`S` |Print the current keyboard status to the console| +|`MAGIC_KEY_HELP` |`H` |Print Command help to the console | +|`MAGIC_KEY_HELP_ALT` |`SLASH` |Print Command help to the console (alternate) | +|`MAGIC_KEY_LAYER0` |`0` |Make layer 0 the default layer | +|`MAGIC_KEY_LAYER0_ALT` |`GRAVE` |Make layer 0 the default layer (alternate) | +|`MAGIC_KEY_LAYER1` |`1` |Make layer 1 the default layer | +|`MAGIC_KEY_LAYER2` |`2` |Make layer 2 the default layer | +|`MAGIC_KEY_LAYER3` |`3` |Make layer 3 the default layer | +|`MAGIC_KEY_LAYER4` |`4` |Make layer 4 the default layer | +|`MAGIC_KEY_LAYER5` |`5` |Make layer 5 the default layer | +|`MAGIC_KEY_LAYER6` |`6` |Make layer 6 the default layer | +|`MAGIC_KEY_LAYER7` |`7` |Make layer 7 the default layer | +|`MAGIC_KEY_LAYER8` |`8` |Make layer 8 the default layer | +|`MAGIC_KEY_LAYER9` |`9` |Make layer 9 the default layer | +|`MAGIC_KEY_BOOTLOADER` |`B` |Jump to bootloader | +|`MAGIC_KEY_BOOTLOADER_ALT` |`ESC` |Jump to bootloader (alternate) | +|`MAGIC_KEY_LOCK` |`CAPS` |Lock the keyboard so nothing can be typed | +|`MAGIC_KEY_EEPROM` |`E` |Print stored EEPROM config to the console | +|`MAGIC_KEY_EEPROM_CLEAR` |`BSPACE` |Clear the EEPROM | +|`MAGIC_KEY_NKRO` |`N` |Toggle N-Key Rollover (NKRO) | +|`MAGIC_KEY_SLEEP_LED` |`Z` |Toggle LED when computer is sleeping | diff --git a/docs/feature_debounce_type.md b/docs/feature_debounce_type.md new file mode 100644 index 00000000000..38eca3f37c8 --- /dev/null +++ b/docs/feature_debounce_type.md @@ -0,0 +1,42 @@ +# Debounce algorithm + +QMK supports multiple debounce algorithms through its debounce API. + +The logic for which debounce method called is below. It checks various defines that you have set in rules.mk + +``` +DEBOUNCE_DIR:= $(QUANTUM_DIR)/debounce +DEBOUNCE_TYPE?= sym_g +ifneq ($(strip $(DEBOUNCE_TYPE)), custom) + QUANTUM_SRC += $(DEBOUNCE_DIR)/$(strip $(DEBOUNCE_TYPE)).c +endif +``` + +# Debounce selection + +| DEBOUNCE_TYPE | Description | What else is needed | +| ------------- | --------------------------------------------------- | ----------------------------- | +| Not defined | Use the default algorithm, currently sym_g | Nothing | +| custom | Use your own debounce.c | ```SRC += debounce.c``` add your own debounce.c and implement necessary functions | +| anything_else | Use another algorithm from quantum/debounce/* | Nothing | + +**Regarding split keyboards**: +The debounce code is compatible with split keyboards. + +# Use your own debouncing code +* Set ```DEBOUNCE_TYPE = custom ```. +* Add ```SRC += debounce.c``` +* Add your own ```debounce.c```. Look at current implementations in ```quantum/debounce``` for examples. +* Debouncing occurs after every raw matrix scan. +* Use num_rows rather than MATRIX_ROWS, so that split keyboards are supported correctly. + +# Changing between included debouncing methods +You can either use your own code, by including your own debounce.c, or switch to another included one. +Included debounce methods are: +* eager_pr - debouncing per row. On any state change, response is immediate, followed by locking the row ```DEBOUNCE_DELAY``` milliseconds of no further input for that row. +For use in keyboards where refreshing ```NUM_KEYS``` 8-bit counters is computationally expensive / low scan rate, and fingers usually only hit one row at a time. This could be +appropriate for the ErgoDox models; the matrix is rotated 90°, and hence its "rows" are really columns, and each finger only hits a single "row" at a time in normal use. +* eager_pk - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE_DELAY``` milliseconds of no further input for that key +* sym_g - debouncing per keyboard. On any state change, a global timer is set. When ```DEBOUNCE_DELAY``` milliseconds of no changes has occured, all input changes are pushed. + + diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index e5c7ed30ae8..ef8b768e22a 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md @@ -6,14 +6,13 @@ Basic encoders are supported by adding this to your `rules.mk`: and this to your `config.h`: - #define NUMBER_OF_ENCODERS 1 #define ENCODERS_PAD_A { B12 } #define ENCODERS_PAD_B { B13 } Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.: #define ENCODERS_PAD_A { encoder1a, encoder2a } - #define ENCODERS_PAD_B { encoder1a, encoder2b } + #define ENCODERS_PAD_B { encoder1b, encoder2b } If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions. @@ -32,15 +31,19 @@ The callback functions can be inserted into your `.c`: or `keymap.c`: void encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - register_code(KC_PGDN); - unregister_code(KC_PGDN); - } else { - register_code(KC_PGUP); - unregister_code(KC_PGUP); - } + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_UP); + } else { + tap_code(KC_DOWN); + } + } } ## Hardware diff --git a/docs/feature_grave_esc.md b/docs/feature_grave_esc.md index c6fa1602210..f57c6042ca5 100644 --- a/docs/feature_grave_esc.md +++ b/docs/feature_grave_esc.md @@ -4,7 +4,11 @@ If you're using a 60% keyboard, or any other layout with no F-row, you will have ## Usage -Replace the `KC_GRAVE` key in your keymap (usually to the left of the `1` key) with `KC_GESC`. When pressed it will behave like `KC_ESC`, but with Shift or GUI held it will send `KC_GRAVE`. +Replace the `KC_GRAVE` key in your keymap (usually to the left of the `1` key) with `KC_GESC`. Most of the time this key will output `KC_ESC` when pressed. However, when Shift or GUI are held down it will output `KC_GRV` instead. + +## What Your OS Sees + +If Mary presses GESC on her keyboard, the OS will see an KC_ESC character. Now if Mary holds Shift down and presses GESC it will output `~`, or a shifted backtick. Now if she holds GUI/CMD/WIN, it will output a simple ` character. ## Keycodes @@ -12,6 +16,10 @@ Replace the `KC_GRAVE` key in your keymap (usually to the left of the `1` key) w |---------|-----------|------------------------------------------------------------------| |`KC_GESC`|`GRAVE_ESC`|Escape when pressed, ` when Shift or GUI are held| +### Caveats + +On macOS, Command+` is by default mapped to "Move focus to next window" so it will not output a backtick. Additionally, Terminal always recognises this shortcut to cycle between windows, even if the shortcut is changed in the Keyboard preferences. + ## Configuration There are several possible key combinations this will break, among them Control+Shift+Escape on Windows and Command+Option+Escape on macOS. To work around this, you can `#define` these options in your `config.h`: diff --git a/docs/feature_haptic_feedback.md b/docs/feature_haptic_feedback.md new file mode 100644 index 00000000000..85fd4396402 --- /dev/null +++ b/docs/feature_haptic_feedback.md @@ -0,0 +1,147 @@ +# Haptic Feedback + +## Haptic feedback rules.mk options + +The following options are currently available for haptic feedback in `rule.mk`: + +`HAPTIC_ENABLE += DRV2605L` + +`HAPTIC_ENABLE += SOLENOID` + +## Known Supported Hardware + +| Name | Description | +|--------------------|-------------------------------------------------| +| [LV061228B-L65-A](https://www.digikey.com/product-detail/en/jinlong-machinery-electronics-inc/LV061228B-L65-A/1670-1050-ND/7732325) | z-axis 2v LRA | +| [Mini Motor Disc](https://www.adafruit.com/product/1201) | small 2-5v ERM | + +## Haptic Keycodes + +Not all keycodes below will work depending on which haptic mechanism you have chosen. + +| Name | Description | +|-----------|-------------------------------------------------------| +|`HPT_ON` | Turn haptic feedback on | +|`HPT_OFF` | Turn haptic feedback on | +|`HPT_TOG` | Toggle haptic feedback on/off | +|`HPT_RST` | Reset haptic feedback config to default | +|`HPT_FBK` | Toggle feedback to occur on keypress, release or both | +|`HPT_BUZ` | Toggle solenoid buzz on/off | +|`HPT_MODI` | Go to next DRV2605L waveform | +|`HPT_MODD` | Go to previous DRV2605L waveform | +|`HPT_DWLI` | Increase Solenoid dwell time | +|`HPT_DWLD` | Decrease Solenoid dwell time | + +### Solenoids + +First you will need a build a circuit to drive the solenoid through a mosfet as most MCU will not be able to provide the current needed to drive the coil in the solenoid. + +[Wiring diagram provided by Adafruit](https://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf) + +Select a pin that has PWM for the signal pin + +``` +#define SOLENOID_PIN *pin* +``` + +Beware that some pins may be powered during bootloader (ie. A13 on the STM32F303 chip) and will result in the solenoid kept in the on state through the whole flashing process. This may overheat and damage the solenoid. If you find that the pin the solenoid is connected to is triggering the solenoid during bootloader/DFU, select another pin. + +### DRV2605L + +DRV2605L is controlled over i2c protocol, and has to be connected to the SDA and SCL pins, these varies depending on the MCU in use. + +#### Feedback motor setup + +This driver supports 2 different feedback motors. Set the following in your `config.h` based on which motor you have selected. + +##### ERM + +Eccentric Rotating Mass vibration motors (ERM) is motor with a off-set weight attached so when drive signal is attached, the off-set weight spins and causes a sinusoidal wave that translate into vibrations. + +``` +#define FB_ERM_LRA 0 +#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ + +/* Please refer to your datasheet for the optimal setting for your specific motor. */ +#define RATED_VOLTAGE 3 +#define V_PEAK 5 +``` +##### LRA + +Linear resonant actuators (LRA, also know as a linear vibrator) works different from a ERM. A LRA has a weight and magnet suspended by springs and a voice coil. When the drive signal is applied, the weight would be vibrate on a single axis (side to side or up and down). Since the weight is attached to a spring, there is a resonance effect at a specific frequency. This frequency is where the LRA will operate the most efficiently. Refer to the motor's datasheet for the recommanded range for this frequency. + +``` +#define FB_ERM_LRA 1 +#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ + +/* Please refer to your datasheet for the optimal setting for your specific motor. */ +#define RATED_VOLTAGE 2 +#define V_PEAK 2.8 +#define V_RMS 2.0 +#define V_PEAK 2.1 +#define F_LRA 205 /* resonance freq */ +``` + +#### DRV2605L waveform library + +DRV2605L comes with preloaded library of various waveform sequences that can be called and played. If writing a macro, these waveforms can be played using `DRV_pulse(*sequence name or number*)` + +List of waveform sequences from the datasheet: + +|seq# | Sequence name |seq# | Sequence name |seq# |Sequence name | +|-----|---------------------|-----|-----------------------------------|-----|--------------------------------------| +| 1 | strong_click | 43 | lg_dblclick_med_60 | 85 | transition_rampup_med_smooth2 | +| 2 | strong_click_60 | 44 | lg_dblsharp_tick | 86 | transition_rampup_short_smooth1 | +| 3 | strong_click_30 | 45 | lg_dblsharp_tick_80 | 87 | transition_rampup_short_smooth2 | +| 4 | sharp_click | 46 | lg_dblsharp_tick_60 | 88 | transition_rampup_long_sharp1 | +| 5 | sharp_click_60 | 47 | buzz | 89 | transition_rampup_long_sharp2 | +| 6 | sharp_click_30 | 48 | buzz_80 | 90 | transition_rampup_med_sharp1 | +| 7 | soft_bump | 49 | buzz_60 | 91 | transition_rampup_med_sharp2 | +| 8 | soft_bump_60 | 50 | buzz_40 | 92 | transition_rampup_short_sharp1 | +| 9 | soft_bump_30 | 51 | buzz_20 | 93 | transition_rampup_short_sharp2 | +| 10 | dbl_click | 52 | pulsing_strong | 94 | transition_rampdown_long_smooth1_50 | +| 11 | dbl_click_60 | 53 | pulsing_strong_80 | 95 | transition_rampdown_long_smooth2_50 | +| 12 | trp_click | 54 | pulsing_medium | 96 | transition_rampdown_med_smooth1_50 | +| 13 | soft_fuzz | 55 | pulsing_medium_80 | 97 | transition_rampdown_med_smooth2_50 | +| 14 | strong_buzz | 56 | pulsing_sharp | 98 | transition_rampdown_short_smooth1_50 | +| 15 | alert_750ms | 57 | pulsing_sharp_80 | 99 | transition_rampdown_short_smooth2_50 | +| 16 | alert_1000ms | 58 | transition_click | 100 | transition_rampdown_long_sharp1_50 | +| 17 | strong_click1 | 59 | transition_click_80 | 101 | transition_rampdown_long_sharp2_50 | +| 18 | strong_click2_80 | 60 | transition_click_60 | 102 | transition_rampdown_med_sharp1_50 | +| 19 | strong_click3_60 | 61 | transition_click_40 | 103 | transition_rampdown_med_sharp2_50 | +| 20 | strong_click4_30 | 62 | transition_click_20 | 104 | transition_rampdown_short_sharp1_50 | +| 21 | medium_click1 | 63 | transition_click_10 | 105 | transition_rampdown_short_sharp2_50 | +| 22 | medium_click2_80 | 64 | transition_hum | 106 | transition_rampup_long_smooth1_50 | +| 23 | medium_click3_60 | 65 | transition_hum_80 | 107 | transition_rampup_long_smooth2_50 | +| 24 | sharp_tick1 | 66 | transition_hum_60 | 108 | transition_rampup_med_smooth1_50 | +| 25 | sharp_tick2_80 | 67 | transition_hum_40 | 109 | transition_rampup_med_smooth2_50 | +| 26 | sharp_tick3_60 | 68 | transition_hum_20 | 110 | transition_rampup_short_smooth1_50 | +| 27 | sh_dblclick_str | 69 | transition_hum_10 | 111 | transition_rampup_short_smooth2_50 | +| 28 | sh_dblclick_str_80 | 70 | transition_rampdown_long_smooth1 | 112 | transition_rampup_long_sharp1_50 | +| 29 | sh_dblclick_str_60 | 71 | transition_rampdown_long_smooth2 | 113 | transition_rampup_long_sharp2_50 | +| 30 | sh_dblclick_str_30 | 72 | transition_rampdown_med_smooth1 | 114 | transition_rampup_med_sharp1_50 | +| 31 | sh_dblclick_med | 73 | transition_rampdown_med_smooth2 | 115 | transition_rampup_med_sharp2_50 | +| 32 | sh_dblclick_med_80 | 74 | transition_rampdown_short_smooth1 | 116 | transition_rampup_short_sharp1_50 | +| 33 | sh_dblclick_med_60 | 75 | transition_rampdown_short_smooth2 | 117 | transition_rampup_short_sharp2_50 | +| 34 | sh_dblsharp_tick | 76 | transition_rampdown_long_sharp1 | 118 | long_buzz_for_programmatic_stopping | +| 35 | sh_dblsharp_tick_80 | 77 | transition_rampdown_long_sharp2 | 119 | smooth_hum1_50 | +| 36 | sh_dblsharp_tick_60 | 78 | transition_rampdown_med_sharp1 | 120 | smooth_hum2_40 | +| 37 | lg_dblclick_str | 79 | transition_rampdown_med_sharp2 | 121 | smooth_hum3_30 | +| 38 | lg_dblclick_str_80 | 80 | transition_rampdown_short_sharp1 | 122 | smooth_hum4_20 | +| 39 | lg_dblclick_str_60 | 81 | transition_rampdown_short_sharp2 | 123 | smooth_hum5_10 | +| 40 | lg_dblclick_str_30 | 82 | transition_rampup_long_smooth1 | | | +| 41 | lg_dblclick_med | 83 | transition_rampup_long_smooth2 | | | +| 42 | lg_dblclick_med_80 | 84 | transition_rampup_med_smooth1 | | | +### Optional DRV2605L defines + +``` +#define DRV_GREETING *sequence name or number* +``` +If haptic feedback is enabled, the keyboard will vibrate to a specific sqeuence during startup. That can be selected using the following define: + +``` +#define DRV_MODE_DEFAULT *sequence name or number* +``` +This will set what sequence HPT_RST will set as the active mode. If not defined, mode will be set to 1 when HPT_RST is pressed. diff --git a/docs/feature_layouts.md b/docs/feature_layouts.md index 1ee8b5e35c6..b34fd442d5c 100644 --- a/docs/feature_layouts.md +++ b/docs/feature_layouts.md @@ -51,6 +51,35 @@ The folder name must be added to the keyboard's `rules.mk`: but the `LAYOUT_` variable must be defined in `.h` as well. +## Building a Keymap + +You should be able to build the keyboard keymap with a command in this format: + + make : + +### Conflicting layouts +When a keyboard supports multiple layout options, + + LAYOUTS = ortho_4x4 ortho_4x12 + +And a layout exists for both options, +``` +layouts/ ++ community/ +| + ortho_4x4/ +| | + / +| | | + ... +| + ortho_4x12/ +| | + / +| | | + ... +| + ... +``` + +The FORCE_LAYOUT argument can be used to specify which layout to build + + make : FORCE_LAYOUT=ortho_4x4 + make : FORCE_LAYOUT=ortho_4x12 + ## Tips for Making Layouts Keyboard-Agnostic ### Includes diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 92aebd463d6..82cf789017d 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -5,10 +5,11 @@ If you've ever used Vim, you know what a Leader key is. If not, you're about to That's what `KC_LEAD` does. Here's an example: 1. Pick a key on your keyboard you want to use as the Leader key. Assign it the keycode `KC_LEAD`. This key would be dedicated just for this -- it's a single action key, can't be used for anything else. -2. Include the line `#define LEADER_TIMEOUT 300` in your config.h. The 300 there is 300ms -- that's how long you have for the sequence of keys following the leader. You can tweak this value for comfort, of course. -3. Within your `matrix_scan_user` function, do something like this: +2. Include the line `#define LEADER_TIMEOUT 300` in your `config.h`. This sets the timeout for the `KC_LEAD` key. Specifically, when you press the `KC_LEAD` key, you only have a certain amount of time to complete the Leader Key sequence. The `300` here sets that to 300ms, and you can increase this value to give you more time to hit the sequence. But any keys pressed during this timeout are intercepted and not sent, so you may want to keep this value low. . + * By default, this timeout is how long after pressing `KC_LEAD` to complete your entire sequence. This may be very low for some people. So you may want to increase this timeout. Optionally, you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. This allows you to maintain a low value here, but still be able to use the longer sequences. To enable this option, add `#define LEADER_PER_KEY_TIMING` to your `config.h`. +3. Within your `matrix_scan_user` function, add something like this: -``` +```c LEADER_EXTERNS(); void matrix_scan_user(void) { @@ -44,6 +45,102 @@ Each of these accepts one or more keycodes as arguments. This is an important po To add support for Leader Key you simply need to add a single line to your keymap's `rules.mk`: -``` +```make LEADER_ENABLE = yes ``` + +## Per Key Timing on Leader keys + +Rather than relying on an incredibly high timeout for long leader key strings or those of us without 200wpm typing skills, we can enable per key timing to ensure that each key pressed provides us with more time to finish our stroke. This is incredibly helpful with leader key emulation of tap dance (read: multiple taps of the same key like C, C, C). + +In order to enable this, place this in your `config.h`: +```c +#define LEADER_PER_KEY_TIMING +``` + +After this, it's recommended that you lower your `LEADER_TIMEOUT` to something less that 300ms. + +```c +#define LEADER_TIMEOUT 250 +``` + +Now, something like this won't seem impossible to do without a 1000MS leader key timeout: + +```c +SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { + SEND_STRING("Per key timing is great!!!"); +} +``` + +## Strict Key Processing + +By default, the Leader Key feature will filter the keycode out of [`Mod-Tap`](feature_advanced_keycodes.md#mod-tap) and [`Layer Tap`](feature_advanced_keycodes.md#switching-and-toggling-layers) functions when checking for the Leader sequences. That means if you're using `LT(3, KC_A)`, it will pick this up as `KC_A` for the sequence, rather than `LT(3, KC_A)`, giving a more expected behavior for newer users. + +While, this may be fine for most, if you want to specify the whole keycode (eg, `LT(3, KC_A)` from the example above) in the sequence, you can enable this by added `#define LEADER_KEY_STRICT_KEY_PROCESSING` to your `config.h` file. This well then disable the filtering, and you'll need to specify the whole keycode. + +## Customization + +The Leader Key feature has some additional customization to how the Leader Key feature works. It has two functions that can be called at certain parts of the process. Namely `leader_start()` and `leader_end()`. + +The `leader_start()` function is called when you tap the `KC_LEAD` key, and the `leader_end()` function is called when either the leader sequence is completed, or the leader timeout is hit. + +You can add these functions to your code (`keymap.c` usually) to add feedback to the Leader sequences (such as beeping or playing music). + +```c +void leader_start(void) { + // sequence started +} + +void leader_end(void) { + // sequence ended (no success/failuer detection) +} +``` + +### Example + +This example will play the Mario "One Up" sound when you hit `KC_LEAD` to start the Leader Sequence, and will play "All Star" if it completes successfully or "Rick Roll" you if it fails. + +```c +bool did_leader_succeed; +#ifdef AUDIO_ENABLE +float leader_start[][2] = SONG(ONE_UP_SOUND ); +float leader_succeed[][2] = SONG(ALL_STAR); +float leader_fail[][2] = SONG(RICK_ROLL); +#endif +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + did_leader_succeed = leading = false; + + SEQ_ONE_KEY(KC_E) { + // Anything you can do in a macro. + SEND_STRING(SS_LCTRL(SS_LSFT("t"))); + did_leader_succeed = true; + } else + SEQ_TWO_KEYS(KC_E, KC_D) { + SEND_STRING(SS_LGUI("r")"cmd"SS_TAP(KC_ENTER)SS_LCTRL("c")); + did_leader_succeed = true; + } + leader_end(); + } +} + +void leader_start(void) { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_start); +#endif +} + +void leader_end(void) { + if (did_leader_succeed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_succeed); +#endif + } else { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_fail); +#endif + } +} +``` diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md new file mode 100644 index 00000000000..372407b90c2 --- /dev/null +++ b/docs/feature_led_matrix.md @@ -0,0 +1,90 @@ +# LED Matrix Lighting + +This feature allows you to use LED matrices driven by external drivers. It hooks into the backlight system so you can use the same keycodes as backlighting to control it. + +If you want to use RGB LED's you should use the [RGB Matrix Subsystem](feature_rgb_matrix.md) instead. + +## Driver configuration + +### IS31FL3731 + +There is basic support for addressable LED matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`: + + LED_MATRIX_ENABLE = IS31FL3731 + +You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`: + +| Variable | Description | Default | +|----------|-------------|---------| +| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages | 100 | +| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | +| `LED_DRIVER_COUNT` | (Required) How many LED driver IC's are present | | +| `LED_DRIVER_LED_COUNT` | (Required) How many LED lights are present across all drivers | | +| `LED_DRIVER_ADDR_1` | (Required) Address for the first LED driver | | +| `LED_DRIVER_ADDR_2` | (Optional) Address for the second LED driver | | +| `LED_DRIVER_ADDR_3` | (Optional) Address for the third LED driver | | +| `LED_DRIVER_ADDR_4` | (Optional) Address for the fourth LED driver | | + +Here is an example using 2 drivers. + + // This is a 7-bit address, that gets left-shifted and bit 0 + // set to 0 for write, 1 for read (as per I2C protocol) + // The address will vary depending on your wiring: + // 0b1110100 AD <-> GND + // 0b1110111 AD <-> VCC + // 0b1110101 AD <-> SCL + // 0b1110110 AD <-> SDA + #define LED_DRIVER_ADDR_1 0b1110100 + #define LED_DRIVER_ADDR_2 0b1110110 + + #define LED_DRIVER_COUNT 2 + #define LED_DRIVER_1_LED_COUNT 25 + #define LED_DRIVER_2_LED_COUNT 24 + #define LED_DRIVER_LED_COUNT LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL + +Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. + +Define these arrays listing all the LEDs in your `.c`: + + const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + /* Refer to IS31 manual for these locations + * driver + * | LED address + * | | */ + {0, C3_3}, + .... + } + +Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731-simple.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` ). + +## Keycodes + +All LED matrix keycodes are currently shared with the [backlight system](feature_backlight.md). + +## LED Matrix Effects + +Currently no LED matrix effects have been created. + +## Custom layer effects + +Custom layer effects can be done by defining this in your `.c`: + + void led_matrix_indicators_kb(void) { + led_matrix_set_index_value(index, value); + } + +A similar function works in the keymap as `led_matrix_indicators_user`. + +## Suspended state + +To use the suspend feature, add this to your `.c`: + + void suspend_power_down_kb(void) + { + led_matrix_set_suspend_state(true); + } + + void suspend_wakeup_init_kb(void) + { + led_matrix_set_suspend_state(false); + } diff --git a/docs/feature_macros.md b/docs/feature_macros.md index ba5d91882fb..d81c3c65597 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -12,24 +12,28 @@ Here is an example `keymap.c` for a two-key keyboard: ```c enum custom_keycodes { - MY_CUSTOM_MACRO = SAFE_RANGE + QMKBEST = SAFE_RANGE, }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case MY_CUSTOM_MACRO: - SEND_STRING("QMK is the best thing ever!"); // this is our macro! - return false; - } - } - return true; + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + + } + return true; }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { - {MY_CUSTOM_MACRO, KC_ESC} - } + [0] = { + {QMKBEST, KC_ESC} + } }; ``` @@ -37,7 +41,7 @@ What happens here is this: We first define a new custom keycode in the range not occupied by any other keycodes. Then we use the `process_record_user` function, which is called whenever a key is pressed or released, to check if our custom keycode has been activated. If yes, we send the string `"QMK is the best thing ever!"` to the computer via the `SEND_STRING` macro (this is a C preprocessor macro, not to be confused with QMK macros). -We return `false` to indicate to the caller that the key press we just processed need not be processed any further. +We return `true` to indicate to the caller that the key press we just processed should continue to be processed as normal (as we didn't replace or alter the functionality). Finally, we define the keymap so that the first button activates our macro and the second button is just an escape button. You might want to add more than one macro. @@ -45,28 +49,42 @@ You can do that by adding another keycode and adding another case to the switch ```c enum custom_keycodes { - MY_CUSTOM_MACRO = SAFE_RANGE, - MY_OTHER_MACRO + QMKBEST = SAFE_RANGE, + QMKURL, + MY_OTHER_MACRO }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case MY_CUSTOM_MACRO: - SEND_STRING("QMK is the best thing ever!"); - return false; - case MY_OTHER_MACRO: - SEND_STRING(SS_LCTRL("ac")); // selects all and copies - return false; - } - } - return true; + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + case MY_OTHER_MACRO: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("ac")); // selects all and copies + } + break; + } + return true; }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { - {MY_CUSTOM_MACRO, MY_OTHER_MACRO} - } + [0] = { + {MY_CUSTOM_MACRO, MY_OTHER_MACRO} + } }; ``` @@ -128,29 +146,122 @@ send_string(my_str); SEND_STRING(".."SS_TAP(X_END)); ``` -## The Old Way: `MACRO()` & `action_get_macro` -?> This is inherited from TMK, and hasn't been updated - it's recommend that you use `SEND_STRING` and `process_record_user` instead. +## Advanced Macro Functions + +There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro, if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple. + +### `record->event.pressed` + +This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is + +```c + if (record->event.pressed) { + // on keydown + } else { + // on keyup + } +``` + +### `register_code();` + +This sends the `` keydown event to the computer. Some examples would be `KC_ESC`, `KC_C`, `KC_4`, and even modifiers such as `KC_LSFT` and `KC_LGUI`. + +### `unregister_code();` + +Parallel to `register_code` function, this sends the `` keyup event to the computer. If you don't use this, the key will be held down until it's sent. + +### `tap_code();` + +This will send `register_code()` and then `unregister_code()`. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it). + +If you're having issues with taps (un)registering, you can add a delay between the register and unregister events by setting `#define TAP_CODE_DELAY 100` in your `config.h` file. The value is in milliseconds. + +### `register_code16();`, `unregister_code16();` and `tap_code16();` + +These functions work similar to their regular counterparts, but allow you to use modded keycodes (with Shift, Alt, Control, and/or GUI applied to them). + +Eg, you could use `register_code16(S(KC_5));` instead of registering the mod, then registering the keycode. + +### `clear_keyboard();` + +This will clear all mods and keys currently pressed. + +### `clear_mods();` + +This will clear all mods currently pressed. + +### `clear_keyboard_but_mods();` + +This will clear all keys besides the mods currently pressed. + +## Advanced Example: + +### Super ALT↯TAB + +This macro will register `KC_LALT` and tap `KC_TAB`, then wait for 1000ms. If the key is tapped again, it will send another `KC_TAB`; if there is no tap, `KC_LALT` will be unregistered, thus allowing you to cycle through windows. + +```c +bool is_alt_tab_active = false; # ADD this near the begining of keymap.c +uint16_t alt_tab_timer = 0; # we will be using them soon. + +enum custom_keycodes { # Make sure have the awesome keycode ready + ALT_TAB = SAFE_RANGE, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { # This will do most of the grunt work with the keycodes. + case ALT_TAB: + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + register_code(KC_LALT); + } + alt_tab_timer = timer_read(); + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + } + return true; +} + +void matrix_scan_user(void) { # The very important timer. + if (is_alt_tab_active) { + if (timer_elapsed(alt_tab_timer) > 1000) { + unregister_code(KC_LALT); + is_alt_tab_active = false; + } + } +} +``` + +--- + +## **(DEPRECATED)** The Old Way: `MACRO()` & `action_get_macro` + +!> This is inherited from TMK, and hasn't been updated - it's recommended that you use `SEND_STRING` and `process_record_user` instead. By default QMK assumes you don't have any macros. To define your macros you create an `action_get_macro()` function. For example: ```c const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch(id) { - case 0: - return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); - case 1: - return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); - } - } - return MACRO_NONE; + if (record->event.pressed) { + switch(id) { + case 0: + return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); + case 1: + return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); + } + } + return MACRO_NONE; }; ``` This defines two macros which will be run when the key they are assigned to is pressed. If instead you'd like them to run when the key is released you can change the if statement: - if (!record->event.pressed) { + if (!record->event.pressed) { ### Macro Commands @@ -165,25 +276,25 @@ A macro can include the following commands: ### Mapping a Macro to a Key -Use the `M()` function within your `KEYMAP()` to call a macro. For example, here is the keymap for a 2-key keyboard: +Use the `M()` function within your keymap to call a macro. For example, here is the keymap for a 2-key keyboard: ```c const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( - M(0), M(1) - ), + [0] = LAYOUT( + M(0), M(1) + ), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch(id) { - case 0: - return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); - case 1: - return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); - } - } - return MACRO_NONE; + if (record->event.pressed) { + switch(id) { + case 0: + return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); + case 1: + return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); + } + } + return MACRO_NONE; }; ``` @@ -198,68 +309,31 @@ If you have a bunch of macros you want to refer to from your keymap while keepin #define M_BYE M(1) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( - M_HI, M_BYE - ), + [0] = LAYOUT( + M_HI, M_BYE + ), }; ``` -## Advanced Macro Functions - -There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple. -### `record->event.pressed` - -This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is - -```c - if (record->event.pressed) { - // on keydown - } else { - // on keyup - } -``` - -### `register_code();` - -This sends the `` keydown event to the computer. Some examples would be `KC_ESC`, `KC_C`, `KC_4`, and even modifiers such as `KC_LSFT` and `KC_LGUI`. - -### `unregister_code();` - -Parallel to `register_code` function, this sends the `` keyup event to the computer. If you don't use this, the key will be held down until it's sent. - -### `tap_code();` - -This will send `register_code()` and then `unregister_code()`. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it). - -### `clear_keyboard();` - -This will clear all mods and keys currently pressed. - -### `clear_mods();` - -This will clear all mods currently pressed. - -### `clear_keyboard_but_mods();` - -This will clear all keys besides the mods currently pressed. +## Advanced Example: -## Advanced Example: Single-Key Copy/Paste +### Single-Key Copy/Paste This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V` when released. ```c const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: { - if (record->event.pressed) { - return MACRO( D(LCTL), T(C), U(LCTL), END ); - } else { - return MACRO( D(LCTL), T(V), U(LCTL), END ); - } - break; - } - } - return MACRO_NONE; + switch(id) { + case 0: { + if (record->event.pressed) { + return MACRO( D(LCTL), T(C), U(LCTL), END ); + } else { + return MACRO( D(LCTL), T(V), U(LCTL), END ); + } + break; + } + } + return MACRO_NONE; }; ``` diff --git a/docs/feature_mouse_keys.md b/docs/feature_mouse_keys.md index 673eafaef5e..363662f633b 100644 --- a/docs/feature_mouse_keys.md +++ b/docs/feature_mouse_keys.md @@ -1,81 +1,119 @@ -# Mousekeys +# Mouse keys +Mouse keys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer at different speeds, press 5 buttons and scroll in 8 directions. -Mousekeys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer around, click up to 5 buttons, and even scroll in all 4 directions. QMK uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys). +## Adding mouse keys to your keyboard -## Adding Mousekeys to a Keymap +To use mouse keys, you must at least enable mouse keys support and map mouse actions to keys on your keyboard. -There are two steps to adding Mousekeys support to your keyboard. You must enable support in the `rules.mk` file and you must map mouse actions to keys on your keyboard. +### Enabling mouse keys -### Adding Mousekeys Support in the `rules.mk` +To enable mouse keys, add the following line to your keymap’s `rules.mk`: -To add support for Mousekeys you simply need to add a single line to your keymap's `rules.mk`: - -``` +```c MOUSEKEY_ENABLE = yes ``` -You can see an example here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/keymaps/mouse_keys/rules.mk +### Mapping mouse actions -### Mapping Mouse Actions to Keyboard Keys +In your keymap you can use the following keycodes to map key presses to mouse actions: -You can use these keycodes within your keymap to map button presses to mouse actions: +|Key |Aliases |Description | +|----------------|---------|-----------------| +|`KC_MS_UP` |`KC_MS_U`|Move cursor up | +|`KC_MS_DOWN` |`KC_MS_D`|Move cursor down | +|`KC_MS_LEFT` |`KC_MS_L`|Move cursor left | +|`KC_MS_RIGHT` |`KC_MS_R`|Move cursor right| +|`KC_MS_BTN1` |`KC_BTN1`|Press button 1 | +|`KC_MS_BTN2` |`KC_BTN2`|Press button 2 | +|`KC_MS_BTN3` |`KC_BTN3`|Press button 3 | +|`KC_MS_BTN4` |`KC_BTN4`|Press button 4 | +|`KC_MS_BTN5` |`KC_BTN5`|Press button 5 | +|`KC_MS_WH_UP` |`KC_WH_U`|Move wheel up | +|`KC_MS_WH_DOWN` |`KC_WH_D`|Move wheel down | +|`KC_MS_WH_LEFT` |`KC_WH_L`|Move wheel left | +|`KC_MS_WH_RIGHT`|`KC_WH_R`|Move wheel right | +|`KC_MS_ACCEL0` |`KC_ACL0`|Set speed to 0 | +|`KC_MS_ACCEL1` |`KC_ACL1`|Set speed to 1 | +|`KC_MS_ACCEL2` |`KC_ACL2`|Set speed to 2 | -|Key |Aliases |Description | -|----------------|---------|---------------------------| -|`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up | -|`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down | -|`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left | -|`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right | -|`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 | -|`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 | -|`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 | -|`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 | -|`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 | -|`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up | -|`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down | -|`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left | -|`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right | -|`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0| -|`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1| -|`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2| +## Configuring mouse keys -You can see an example in the `_ML` here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/keymaps/mouse_keys/keymap.c#L46 +Mouse keys supports two different modes to move the cursor: -## Configuring the Behavior of Mousekeys +* **Accelerated (default):** Holding movement keys accelerates the cursor until it reaches its maximum speed. +* **Constant:** Holding movement keys moves the cursor at constant speeds. -The default speed for controlling the mouse with the keyboard is intentionally slow. You can adjust these parameters by adding these settings to your keymap's `config.h` file. All times are specified in milliseconds (ms). +The same principle applies to scrolling. -``` -#define MOUSEKEY_DELAY 300 -#define MOUSEKEY_INTERVAL 50 -#define MOUSEKEY_MAX_SPEED 10 -#define MOUSEKEY_TIME_TO_MAX 20 -#define MOUSEKEY_WHEEL_MAX_SPEED 8 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 -``` +Configuration options that are times, intervals or delays are given in milliseconds. Scroll speed is given as multiples of the default scroll step. For example, a scroll speed of 8 means that each scroll action covers 8 times the length of the default scroll step as defined by your operating system or application. + +### Accelerated mode +This is the default mode. You can adjust the cursor and scrolling acceleration using the following settings in your keymap’s `config.h` file: -### `MOUSEKEY_DELAY` +|Define |Default|Description | +|----------------------------|-------|---------------------------------------------------------| +|`MOUSEKEY_DELAY` |300 |Delay between pressing a movement key and cursor movement| +|`MOUSEKEY_INTERVAL` |50 |Time between cursor movements | +|`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops | +|`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached | +|`MOUSEKEY_WHEEL_MAX_SPEED` |8 |Maximum number of scroll steps per scroll action | +|`MOUSEKEY_WHEEL_TIME_TO_MAX`|40 |Time until maximum scroll speed is reached | -When one of the mouse movement buttons is pressed this setting is used to define the delay between that button press and the mouse cursor moving. Some people find that small movements are impossible if this setting is too low, while settings that are too high feel sluggish. +Tips: -### `MOUSEKEY_INTERVAL` +* Setting `MOUSEKEY_DELAY` too low makes the cursor unresponsive. Setting it too high makes small movements difficult. +* For smoother cursor movements, lower the value of `MOUSEKEY_INTERVAL`. If the refresh rate of your display is 60Hz, you could set it to `16` (1/60). As this raises the cursor speed significantly, you may want to lower `MOUSEKEY_MAX_SPEED`. +* Setting `MOUSEKEY_TIME_TO_MAX` or `MOUSEKEY_WHEEL_TIME_TO_MAX` to `0` will disable acceleration for the cursor or scrolling respectively. This way you can make one of them constant while keeping the other accelerated, which is not possible in constant speed mode. -When a movement key is held down this specifies how long to wait between each movement report. Lower settings will translate into an effectively higher mouse speed. +Cursor acceleration uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys). -### `MOUSEKEY_MAX_SPEED` +### Constant mode -As a movement key is held down the speed of the mouse cursor will increase until it reaches `MOUSEKEY_MAX_SPEED`. +In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `KC_ACL0`, `KC_ACL1` and `KC_ACL2` change the cursor and scroll speed to their respective setting. -### `MOUSEKEY_TIME_TO_MAX` +You can choose whether speed selection is momentary or tap-to-select: -How long you want to hold down a movement key for until `MOUSEKEY_MAX_SPEED` is reached. This controls how quickly your cursor will accelerate. +* **Momentary:** The chosen speed is only active while you hold the respective key. When the key is raised, mouse keys returns to the unmodified speed. +* **Tap-to-select:** The chosen speed is activated when you press the respective key and remains active even after the key has been raised. The default speed is that of `KC_ACL1`. There is no unmodified speed. -### `MOUSEKEY_WHEEL_MAX_SPEED` +The default speeds from slowest to fastest are as follows: -The top speed for scrolling movements. +* **Momentary:** `KC_ACL0` < `KC_ACL1` < *unmodified* < `KC_ACL2` +* **Tap-to-select:** `KC_ACL0` < `KC_ACL1` < `KC_ACL2` -### `MOUSEKEY_WHEEL_TIME_TO_MAX` +To use constant speed mode, you must at least define `MK_3_SPEED` in your keymap’s `config.h` file: + +```c +#define MK_3_SPEED +``` + +To enable momentary mode, also define `MK_MOMENTARY_ACCEL`: + +```c +#define MK_MOMENTARY_ACCEL +``` -How long you want to hold down a scroll key for until `MOUSEKEY_WHEEL_MAX_SPEED` is reached. This controls how quickly your scrolling will accelerate. +Use the following settings if you want to adjust cursor movement or scrolling: + +|Define |Default |Description | +|---------------------|-------------|-------------------------------------------| +|`MK_3_SPEED` |*Not defined*|Enable constant cursor speeds | +|`MK_MOMENTARY_ACCEL` |*Not defined*|Enable momentary speed selection | +|`MK_C_OFFSET_UNMOD` |16 |Cursor offset per movement (unmodified) | +|`MK_C_INTERVAL_UNMOD`|16 |Time between cursor movements (unmodified) | +|`MK_C_OFFSET_0` |1 |Cursor offset per movement (`KC_ACL0`) | +|`MK_C_INTERVAL_0` |32 |Time between cursor movements (`KC_ACL0`) | +|`MK_C_OFFSET_1` |4 |Cursor offset per movement (`KC_ACL1`) | +|`MK_C_INTERVAL_1` |16 |Time between cursor movements (`KC_ACL1`) | +|`MK_C_OFFSET_2` |32 |Cursor offset per movement (`KC_ACL2`) | +|`MK_C_INTERVAL_2` |16 |Time between cursor movements (`KC_ACL2`) | +|`MK_W_OFFSET_UNMOD` |1 |Scroll steps per scroll action (unmodified)| +|`MK_W_INTERVAL_UNMOD`|40 |Time between scroll steps (unmodified) | +|`MK_W_OFFSET_0` |1 |Scroll steps per scroll action (`KC_ACL0`) | +|`MK_W_INTERVAL_0` |360 |Time between scroll steps (`KC_ACL0`) | +|`MK_W_OFFSET_1` |1 |Scroll steps per scroll action (`KC_ACL1`) | +|`MK_W_INTERVAL_1` |120 |Time between scroll steps (`KC_ACL1`) | +|`MK_W_OFFSET_2` |1 |Scroll steps per scroll action (`KC_ACL2`) | +|`MK_W_INTERVAL_2` |20 |Time between scroll steps (`KC_ACL2`) | diff --git a/docs/feature_oled_driver.md b/docs/feature_oled_driver.md new file mode 100644 index 00000000000..503e4382885 --- /dev/null +++ b/docs/feature_oled_driver.md @@ -0,0 +1,289 @@ +# OLED Driver + +## OLED Supported Hardware + +OLED modules using SSD1306 or SH1106 driver ICs, communicating over I2C. +Tested combinations: + +| IC driver | Size | Keyboard Platform | Notes | +|-----------|--------|-------------------|--------------------------| +| SSD1306 | 128x32 | AVR | Primary support | +| SSD1306 | 128x64 | AVR | Verified working | +| SSD1306 | 128x32 | ARM | | +| SH1106 | 128x64 | AVR | No rotation or scrolling | + +Hardware configurations using ARM-based microcontrollers or different sizes of OLED modules may be compatible, but are untested. + +!> Warning: This OLED Driver currently uses the new i2c_master driver from split common code. If your split keyboard uses I2C to communicate between sides, this driver could cause an address conflict (serial is fine). Please contact your keyboard vendor and ask them to migrate to the latest split common code to fix this. In addition, the display timeout system to reduce OLED burn-in also uses split common to detect keypresses, so you will need to implement custom timeout logic for non-split common keyboards. + +## Usage + +To enable the OLED feature, there are three steps. First, when compiling your keyboard, you'll need to set `OLED_DRIVER_ENABLE=yes` in `rules.mk`, e.g.: + +``` +OLED_DRIVER_ENABLE = yes +``` + +This enables the feature and the `OLED_DRIVER_ENABLE` define. Then in your `keymap.c` file, you will need to implement the user task call, e.g: + +```C++ +#ifdef OLED_DRIVER_ENABLE +void oled_task_user(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (biton32(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("Default\n"), false); + break; + case _FN: + oled_write_P(PSTR("FN\n"), false); + break; + case _ADJ: + oled_write_P(PSTR("ADJ\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(led_usb_state & (1<Useful for 128x64 displays centered on a 132x64 SH1106 IC. | + + ## 128x64 & Custom sized OLED Displays + + The default display size for this feature is 128x32 and all necessary defines are precalculated with that in mind. We have added a define, `OLED_DISPLAY_128X64`, to switch all the values to be used in a 128x64 display, as well as added a custom define, `OLED_DISPLAY_CUSTOM`, that allows you to provide the necessary values to the driver. + +|Define |Default |Description | +|-----------------------|---------------|-----------------------------------------------------------------| +|`OLED_DISPLAY_128X64` |*Not defined* |Changes the display defines for use with 128x64 displays. | +|`OLED_DISPLAY_CUSTOM` |*Not defined* |Changes the display defines for use with custom displays.
Requires user to implement the below defines. | +|`OLED_DISPLAY_WIDTH` |`128` |The width of the OLED display. | +|`OLED_DISPLAY_HEIGHT` |`32` |The height of the OLED display. | +|`OLED_MATRIX_SIZE` |`512` |The local buffer size to allocate.
`(OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH)`. | +|`OLED_BLOCK_TYPE` |`uint16_t` |The unsigned integer type to use for dirty rendering. | +|`OLED_BLOCK_COUNT` |`16` |The number of blocks the display is divided into for dirty rendering.
`(sizeof(OLED_BLOCK_TYPE) * 8)`. | +|`OLED_BLOCK_SIZE` |`32` |The size of each block for dirty rendering
`(OLED_MATRIX_SIZE / OLED_BLOCK_COUNT)`. | +|`OLED_COM_PINS` |`COM_PINS_SEQ` |How the SSD1306 chip maps it's memory to display.
Options are `COM_PINS_SEQ`, `COM_PINS_ALT`, `COM_PINS_SEQ_LR`, & `COM_PINS_ALT_LR`. | +|`OLED_SOURCE_MAP` |`{ 0, ... N }` |Precalculated source array to use for mapping source buffer to target OLED memory in 90 degree rendering. | +|`OLED_TARGET_MAP` |`{ 24, ... N }`|Precalculated target array to use for mapping source buffer to target OLED memory in 90 degree rendering. | + + +### 90 Degree Rotation - Technical Mumbo Jumbo + +!> Rotation is unsupported on the SH1106. + +```C +// OLED Rotation enum values are flags +typedef enum { + OLED_ROTATION_0 = 0, + OLED_ROTATION_90 = 1, + OLED_ROTATION_180 = 2, + OLED_ROTATION_270 = 3, // OLED_ROTATION_90 | OLED_ROTATION_180 +} oled_rotation_t; +``` + + OLED displays driven by SSD1306 drivers only natively support in hard ware 0 degree and 180 degree rendering. This feature is done in software and not free. Using this feature will increase the time to calculate what data to send over i2c to the OLED. If you are strapped for cycles, this can cause keycodes to not register. In testing however, the rendering time on an `atmega32u4` board only went from 2ms to 5ms and keycodes not registering was only noticed once we hit 15ms. + + 90 Degree Rotated Rendering is achieved by using bitwise operations to rotate each 8 block of memory and uses two precalculated arrays to remap buffer memory to OLED memory. The memory map defines are precalculated for remap performance and are calculated based on the OLED Height, Width, and Block Size. For example, in the 128x32 implementation with a `uint8_t` block type, we have a 64 byte block size. This gives us eight 8 byte blocks that need to be rotated and rendered. The OLED renders horizontally two 8 byte blocks before moving down a page, e.g: + +| | | | | | | +|---|---|---|---|---|---| +| 0 | 1 | | | | | +| 2 | 3 | | | | | +| 4 | 5 | | | | | +| 6 | 7 | | | | | + +However the local buffer is stored as if it was Height x Width display instead of Width x Height, e.g: + +| | | | | | | +|---|---|---|---|---|---| +| 3 | 7 | | | | | +| 2 | 6 | | | | | +| 1 | 5 | | | | | +| 0 | 4 | | | | | + +So those precalculated arrays just index the memory offsets in the order in which each one iterates its data. + +## OLED API + +```C++ +// OLED Rotation enum values are flags +typedef enum { + OLED_ROTATION_0 = 0, + OLED_ROTATION_90 = 1, + OLED_ROTATION_180 = 2, + OLED_ROTATION_270 = 3, // OLED_ROTATION_90 | OLED_ROTATION_180 +} oled_rotation_t; + +// Initialize the OLED display, rotating the rendered output based on the define passed in. +// Returns true if the OLED was initialized successfully +bool oled_init(oled_rotation_t rotation); + +// Called at the start of oled_init, weak function overridable by the user +// rotation - the value passed into oled_init +// Return new oled_rotation_t if you want to override default rotation +oled_rotation_t oled_init_user(oled_rotation_t rotation); + +// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering +void oled_clear(void); + +// Renders the dirty chunks of the buffer to OLED display +void oled_render(void); + +// Moves cursor to character position indicated by column and line, wraps if out of bounds +// Max column denoted by 'oled_max_chars()' and max lines by 'oled_max_lines()' functions +void oled_set_cursor(uint8_t col, uint8_t line); + +// Advances the cursor to the next page, writing ' ' if true +// Wraps to the begining when out of bounds +void oled_advance_page(bool clearPageRemainder); + +// Moves the cursor forward 1 character length +// Advance page if there is not enough room for the next character +// Wraps to the begining when out of bounds +void oled_advance_char(void); + +// Writes a single character to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +// Main handler that writes character data to the display buffer +void oled_write_char(const char data, bool invert); + +// Writes a string to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +void oled_write(const char *data, bool invert); + +// Writes a string to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +// Advances the cursor to the next page, wiring ' ' to the remainder of the current page +void oled_write_ln(const char *data, bool invert); + +// Writes a PROGMEM string to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +// Remapped to call 'void oled_write(const char *data, bool invert);' on ARM +void oled_write_P(const char *data, bool invert); + +// Writes a PROGMEM string to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +// Advances the cursor to the next page, wiring ' ' to the remainder of the current page +// Remapped to call 'void oled_write_ln(const char *data, bool invert);' on ARM +void oled_write_ln_P(const char *data, bool invert); + +// Can be used to manually turn on the screen if it is off +// Returns true if the screen was on or turns on +bool oled_on(void); + +// Can be used to manually turn off the screen if it is on +// Returns true if the screen was off or turns off +bool oled_off(void); + +// Basically it's oled_render, but with timeout management and oled_task_user calling! +void oled_task(void); + +// Called at the start of oled_task, weak function overridable by the user +void oled_task_user(void); + +// Scrolls the entire display right +// Returns true if the screen was scrolling or starts scrolling +// NOTE: display contents cannot be changed while scrolling +bool oled_scroll_right(void); + +// Scrolls the entire display left +// Returns true if the screen was scrolling or starts scrolling +// NOTE: display contents cannot be changed while scrolling +bool oled_scroll_left(void); + +// Turns off display scrolling +// Returns true if the screen was not scrolling or stops scrolling +bool oled_scroll_off(void); + +// Returns the maximum number of characters that will fit on a line +uint8_t oled_max_chars(void); + +// Returns the maximum number of lines that will fit on the OLED +uint8_t oled_max_lines(void); +``` + +!> Scrolling and rotation are unsupported on the SH1106. + +## SSD1306.h driver conversion guide + +|Old API |Recommended New API | +|---------------------------|-----------------------------------| +|`struct CharacterMatrix` |*removed - delete all references* | +|`iota_gfx_init` |`oled_init` | +|`iota_gfx_on` |`oled_on` | +|`iota_gfx_off` |`oled_off` | +|`iota_gfx_flush` |`oled_render` | +|`iota_gfx_write_char` |`oled_write_char` | +|`iota_gfx_write` |`oled_write` | +|`iota_gfx_write_P` |`oled_write_P` | +|`iota_gfx_clear_screen` |`oled_clear` | +|`matrix_clear` |*removed - delete all references* | +|`matrix_write_char_inner` |`oled_write_char` | +|`matrix_write_char` |`oled_write_char` | +|`matrix_write` |`oled_write` | +|`matrix_write_ln` |`oled_write_ln` | +|`matrix_write_P` |`oled_write_P` | +|`matrix_write_ln_P` |`oled_write_ln_P` | +|`matrix_render` |`oled_render` | +|`iota_gfx_task` |`oled_task` | +|`iota_gfx_task_user` |`oled_task_user` | diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 809d034bdc1..916fcdce031 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -1,193 +1,403 @@ # RGB Matrix Lighting -## Driver configuration +This feature allows you to use RGB LED matrices driven by external drivers. It hooks into the RGBLIGHT system so you can use the same keycodes as RGBLIGHT to control it. + +If you want to use single color LED's you should use the [LED Matrix Subsystem](feature_led_matrix.md) instead. +## Driver configuration +--- ### IS31FL3731 There is basic support for addressable RGB matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`: - RGB_MATRIX_ENABLE = IS31FL3731 +```C +RGB_MATRIX_ENABLE = IS31FL3731 +``` Configure the hardware via your `config.h`: - // This is a 7-bit address, that gets left-shifted and bit 0 - // set to 0 for write, 1 for read (as per I2C protocol) - // The address will vary depending on your wiring: - // 0b1110100 AD <-> GND - // 0b1110111 AD <-> VCC - // 0b1110101 AD <-> SCL - // 0b1110110 AD <-> SDA - #define DRIVER_ADDR_1 0b1110100 - #define DRIVER_ADDR_2 0b1110110 - - #define DRIVER_COUNT 2 - #define DRIVER_1_LED_TOTAL 25 - #define DRIVER_2_LED_TOTAL 24 - #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL +```C +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 0b1110100 AD <-> GND +// 0b1110111 AD <-> VCC +// 0b1110101 AD <-> SCL +// 0b1110110 AD <-> SDA +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110110 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 25 +#define DRIVER_2_LED_TOTAL 24 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +``` + +!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`. Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. Define these arrays listing all the LEDs in your `.c`: - const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { - /* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - {0, C1_3, C2_3, C3_3}, - .... - } +```C +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C1_3, C2_3, C3_3}, + .... +} +``` Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0` or `1` right now). -### IS31FL3733 +--- +### IS31FL3733/IS31FL3737 + +!> For the IS31FL3737, replace all instances of `IS31FL3733` below with `IS31FL3737`. There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`: - RGB_MATRIX_ENABLE = IS31FL3733 +```C +RGB_MATRIX_ENABLE = IS31FL3733 +``` Configure the hardware via your `config.h`: - // This is a 7-bit address, that gets left-shifted and bit 0 - // set to 0 for write, 1 for read (as per I2C protocol) - // The address will vary depending on your wiring: - // 00 <-> GND - // 01 <-> SCL - // 10 <-> SDA - // 11 <-> VCC - // ADDR1 represents A1:A0 of the 7-bit address. - // ADDR2 represents A3:A2 of the 7-bit address. - // The result is: 0b101(ADDR2)(ADDR1) - #define DRIVER_ADDR_1 0b1010000 - #define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. - - #define DRIVER_COUNT 1 - #define DRIVER_1_LED_TOTAL 64 - #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL +```C +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 00 <-> GND +// 01 <-> SCL +// 10 <-> SDA +// 11 <-> VCC +// ADDR1 represents A1:A0 of the 7-bit address. +// ADDR2 represents A3:A2 of the 7-bit address. +// The result is: 0b101(ADDR2)(ADDR1) +#define DRIVER_ADDR_1 0b1010000 +#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 64 +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL +``` Currently only a single drivers is supported, but it would be trivial to support all 4 combinations. For now define `DRIVER_ADDR_2` as `DRIVER_ADDR_1` Define these arrays listing all the LEDs in your `.c`: - const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { - /* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - {0, B_1, A_1, C_1}, - .... - } +```C +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, B_1, A_1, C_1}, + .... +} +``` Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3733.pdf) and the header file `drivers/issi/is31fl3733.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0` right now). -From this point forward the configuration is the same for all the drivers. +--- - const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - /* {row | col << 4} - * | {x=0..224, y=0..64} - * | | modifier - * | | | */ - {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 1}, - .... - } +### WS2812 (AVR only) -The format for the matrix position used in this array is `{row | (col << 4)}`. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64. The easiest way to calculate these positions is: +There is basic support for addressable RGB matrix lighting with a WS2811/WS2812{a,b,c} addressable LED strand. To enable it, add this to your `rules.mk`: - x = 224 / ( NUMBER_OF_ROWS - 1 ) * ROW_POSITION - y = 64 / (NUMBER_OF_COLS - 1 ) * COL_POSITION +```C +RGB_MATRIX_ENABLE = WS2812 +``` -Where all variables are decimels/floats. +Configure the hardware via your `config.h`: -`modifier` is a boolean, whether or not a certain key is considered a modifier (used in some effects). +```C +// The pin connected to the data pin of the LEDs +#define RGB_DI_PIN D7 +// The number of LEDs connected +#define DRIVER_LED_TOTAL 70 +``` + +--- + +From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example: + +```C +const led_config_t g_led_config = { { + // Key Matrix to LED Index + { 5, NO_LED, NO_LED, 0 }, + { NO_LED, NO_LED, NO_LED, NO_LED }, + { 4, NO_LED, NO_LED, 1 }, + { 3, NO_LED, NO_LED, 2 } +}, { + // LED Index to Physical Position + { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 } +}, { + // LED Index to Flag + 1, 4, 4, 4, 4, 1 +} }; +``` + +The first part, `// Key Matrix to LED Index`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `// LED Index to Physical Position` represents the LED's physical `{ x, y }` position on the keyboard. The default expected range of values for `{ x, y }` is the inclusive range `{ 0..224, 0..64 }`. This default expected range is due to effects that calculate the center of the keyboard for their animations. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents `{ x, y }` coordinate `{ 0, 0 }` and the bottom right of your keyboard represents `{ 224, 64 }`. Using this as a basis, you can use the following formula to calculate the physical position: + +```C +x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION +y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION +``` + +Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. + +As mentioned earlier, the center of the keyboard by default is expected to be `{ 112, 32 }`, but this can be changed if you want to more accurately calculate the LED's physical `{ x, y }` positions. Keyboard designers can implement `#define RGB_MATRIX_CENTER { 112, 32 }` in their config.h file with the new center point of the keyboard, or where they want it to be allowing more possibilities for the `{ x, y }` values. Do note that the maximum value for x or y is 255, and the recommended maximum is 224 as this gives animations runoff room before they reset. + +`// LED Index to Flag` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type. + +## Flags + +|Define |Description | +|------------------------------------|-------------------------------------------| +|`#define HAS_FLAGS(bits, flags)` |Returns true if `bits` has all `flags` set.| +|`#define HAS_ANY_FLAGS(bits, flags)`|Returns true if `bits` has any `flags` set.| +|`#define LED_FLAG_NONE 0x00` |If this LED has no flags. | +|`#define LED_FLAG_ALL 0xFF` |If this LED has all flags. | +|`#define LED_FLAG_MODIFIER 0x01` |If the Key for this LED is a modifier. | +|`#define LED_FLAG_UNDERGLOW 0x02` |If the LED is for underglow. | +|`#define LED_FLAG_KEYLIGHT 0x04` |If the LED is for key backlight. | ## Keycodes All RGB keycodes are currently shared with the RGBLIGHT system: - * `RGB_TOG` - toggle - * `RGB_MOD` - cycle through modes - * `RGB_HUI` - increase hue - * `RGB_HUD` - decrease hue - * `RGB_SAI` - increase saturation - * `RGB_SAD` - decrease saturation - * `RGB_VAI` - increase value - * `RGB_VAD` - decrease value - * `RGB_SPI` - increase speed effect (no EEPROM support) - * `RGB_SPD` - decrease speed effect (no EEPROM support) - - - * `RGB_MODE_*` keycodes will generally work, but are not currently mapped to the correct effects for the RGB Matrix system +* `RGB_TOG` - toggle +* `RGB_MOD` - cycle through modes +* `RGB_HUI` - increase hue +* `RGB_HUD` - decrease hue +* `RGB_SAI` - increase saturation +* `RGB_SAD` - decrease saturation +* `RGB_VAI` - increase value +* `RGB_VAD` - decrease value +* `RGB_SPI` - increase speed effect (no EEPROM support) +* `RGB_SPD` - decrease speed effect (no EEPROM support) +* `RGB_MODE_*` keycodes will generally work, but are not currently mapped to the correct effects for the RGB Matrix system ## RGB Matrix Effects -These are the effects that are currently available: - - enum rgb_matrix_effects { - RGB_MATRIX_SOLID_COLOR = 1, - RGB_MATRIX_ALPHAS_MODS, - RGB_MATRIX_DUAL_BEACON, - RGB_MATRIX_GRADIENT_UP_DOWN, - RGB_MATRIX_RAINDROPS, - RGB_MATRIX_CYCLE_ALL, - RGB_MATRIX_CYCLE_LEFT_RIGHT, - RGB_MATRIX_CYCLE_UP_DOWN, - RGB_MATRIX_RAINBOW_BEACON, - RGB_MATRIX_RAINBOW_PINWHEELS, - RGB_MATRIX_RAINBOW_MOVING_CHEVRON, - RGB_MATRIX_JELLYBEAN_RAINDROPS, - RGB_MATRIX_DIGITAL_RAIN, - #ifdef RGB_MATRIX_KEYPRESSES - RGB_MATRIX_SOLID_REACTIVE, - RGB_MATRIX_SPLASH, - RGB_MATRIX_MULTISPLASH, - RGB_MATRIX_SOLID_SPLASH, - RGB_MATRIX_SOLID_MULTISPLASH, - #endif - RGB_MATRIX_EFFECT_MAX - }; - -## Custom layer effects - -Custom layer effects can be done by defining this in your `.c`: - - void rgb_matrix_indicators_kb(void) { - rgb_matrix_set_color(index, red, green, blue); - } - -A similar function works in the keymap as `rgb_matrix_indicators_user`. +All effects have been configured to support current configuration values (Hue, Saturation, Value, & Speed) unless otherwise noted below. These are the effects that are currently available: + +```C +enum rgb_matrix_effects { + RGB_MATRIX_NONE = 0, + RGB_MATRIX_SOLID_COLOR = 1, // Static single hue, no speed support + RGB_MATRIX_ALPHAS_MODS, // Static dual hue, speed is hue for secondary hue + RGB_MATRIX_GRADIENT_UP_DOWN, // Static gradient top to bottom, speed controls how much gradient changes + RGB_MATRIX_BREATHING, // Single hue brightness cycling animation + RGB_MATRIX_BAND_SAT, // Single hue band fading saturation scrolling left to right + RGB_MATRIX_BAND_VAL, // Single hue band fading brightness scrolling left to right + RGB_MATRIX_BAND_PINWHEEL_SAT, // Single hue 3 blade spinning pinwheel fades saturation + RGB_MATRIX_BAND_PINWHEEL_VAL, // Single hue 3 blade spinning pinwheel fades brightness + RGB_MATRIX_BAND_SPIRAL_SAT, // Single hue spinning spiral fades saturation + RGB_MATRIX_BAND_SPIRAL_VAL, // Single hue spinning spiral fades brightness + RGB_MATRIX_CYCLE_ALL, // Full keyboard solid hue cycling through full gradient + RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right + RGB_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom + RGB_MATRIX_CYCLE_OUT_IN, // Full gradient scrolling out to in + RGB_MATRIX_CYCLE_OUT_IN_DUAL, // Full dual gradients scrolling out to in + RGB_MATRIX_RAINBOW_MOVING_CHEVRON, // Full gradent Chevron shapped scrolling left to right + RGB_MATRIX_CYCLE_PINWHEEL, // Full gradient spinning pinwheel around center of keyboard + RGB_MATRIX_CYCLE_SPIRAL, // Full gradient spinning spiral around center of keyboard + RGB_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard + RGB_MATRIX_RAINBOW_BEACON, // Full tighter gradient spinning around center of keyboard + RGB_MATRIX_RAINBOW_PINWHEELS, // Full dual gradients spinning two halfs of keyboard + RGB_MATRIX_RAINDROPS, // Randomly changes a single key's hue + RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation +#if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM! + RGB_MATRIX_DIGITAL_RAIN, // That famous computer simulation +#endif +#if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) + RGB_MATRIX_SOLID_REACTIVE_SIMPLE, // Pulses keys hit to hue & value then fades value out + RGB_MATRIX_SOLID_REACTIVE, // Static single hue, pulses keys hit to shifted hue then fades to current hue + RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out + RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out + RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out + RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out + RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out + RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out + RGB_MATRIX_SPLASH, // Full gradient & value pulse away from a single key hit then fades value out + RGB_MATRIX_MULTISPLASH, // Full gradient & value pulse away from multiple key hits then fades value out + RGB_MATRIX_SOLID_SPLASH, // Hue & value pulse away from a single key hit then fades value out + RGB_MATRIX_SOLID_MULTISPLASH, // Hue & value pulse away from multiple key hits then fades value out +#endif + RGB_MATRIX_EFFECT_MAX +}; +``` + +You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`: + + +|Define |Description | +|-------------------------------------------------------|-----------------------------------------------| +|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` | +|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` | +|`#define DISABLE_RGB_MATRIX_BREATHING` |Disables `RGB_MATRIX_BREATHING` | +|`#define DISABLE_RGB_MATRIX_BAND_SAT` |Disables `RGB_MATRIX_BAND_SAT` | +|`#define DISABLE_RGB_MATRIX_BAND_VAL` |Disables `RGB_MATRIX_BAND_VAL` | +|`#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT` |Disables `RGB_MATRIX_BAND_PINWHEEL_SAT` | +|`#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL` |Disables `RGB_MATRIX_BAND_PINWHEEL_VAL` | +|`#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT` |Disables `RGB_MATRIX_BAND_SPIRAL_SAT` | +|`#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL` |Disables `RGB_MATRIX_BAND_SPIRAL_VAL` | +|`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` | +|`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` | +|`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` | +|`#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN` |Disables `RGB_MATRIX_CYCLE_OUT_IN` | +|`#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL` |Disables `RGB_MATRIX_CYCLE_OUT_IN_DUAL` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON` | +|`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` | +|`#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL` |Disables `RGB_MATRIX_CYCLE_PINWHEEL` | +|`#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL` |Disables `RGB_MATRIX_CYCLE_SPIRAL` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | +|`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | +|`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | +|`#define DISABLE_RGB_MATRIX_TYPING_HEATMAP` |Disables `RGB_MATRIX_TYPING_HEATMAP` | +|`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_WIDE` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_CROSS` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTICROSS`| +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_NEXUS` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS`| +|`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` | +|`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` | +|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` | +|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` | + + +## Custom RGB Matrix Effects + +By setting `RGB_MATRIX_CUSTOM_USER` (and/or `RGB_MATRIX_CUSTOM_KB`) in `rule.mk`, new effects can be defined directly from userspace, without having to edit any QMK core files. + +To declare new effects, create a new `rgb_matrix_user/kb.inc` that looks something like this: + +`rgb_matrix_user.inc` should go in the root of the keymap directory. +`rgb_matrix_kb.inc` should go in the root of the keyboard directory. + +```C +// !!! DO NOT ADD #pragma once !!! // + +// Step 1. +// Declare custom effects using the RGB_MATRIX_EFFECT macro +// (note the lack of semicolon after the macro!) +RGB_MATRIX_EFFECT(my_cool_effect) +RGB_MATRIX_EFFECT(my_cool_effect2) + +// Step 2. +// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +// e.g: A simple effect, self-contained within a single method +static bool my_cool_effect(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (uint8_t i = led_min; i < led_max; i++) { + rgb_matrix_set_color(i, 0xff, 0xff, 0x00); + } + return led_max < DRIVER_LED_TOTAL; +} + +// e.g: A more complex effect, relying on external methods and state, with +// dedicated init and run methods +static uint8_t some_global_state; +static void my_cool_effect2_complex_init(effect_params_t* params) { + some_global_state = 1; +} +static bool my_cool_effect2_complex_run(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (uint8_t i = led_min; i < led_max; i++) { + rgb_matrix_set_color(i, 0xff, some_global_state++, 0xff); + } + + return led_max < DRIVER_LED_TOTAL; +} +static bool my_cool_effect2(effect_params_t* params) { + if (params->init) my_cool_effect2_complex_init(params); + return my_cool_effect2_complex_run(params); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +``` + +For inspiration and examples, check out the built-in effects under `quantum/rgb_matrix_animation/` + + +## Colors + +These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. + +|RGB |HSV | +|-------------------|-------------------| +|`RGB_WHITE` |`HSV_WHITE` | +|`RGB_RED` |`HSV_RED` | +|`RGB_CORAL` |`HSV_CORAL` | +|`RGB_ORANGE` |`HSV_ORANGE` | +|`RGB_GOLDENROD` |`HSV_GOLDENROD` | +|`RGB_GOLD` |`HSV_GOLD` | +|`RGB_YELLOW` |`HSV_YELLOW` | +|`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | +|`RGB_GREEN` |`HSV_GREEN` | +|`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | +|`RGB_TURQUOISE` |`HSV_TURQUOISE` | +|`RGB_TEAL` |`HSV_TEAL` | +|`RGB_CYAN` |`HSV_CYAN` | +|`RGB_AZURE` |`HSV_AZURE` | +|`RGB_BLUE` |`HSV_BLUE` | +|`RGB_PURPLE` |`HSV_PURPLE` | +|`RGB_MAGENTA` |`HSV_MAGENTA` | +|`RGB_PINK` |`HSV_PINK` | + +These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list! + ## Additional `config.h` Options - #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) - #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) - #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects - #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended - #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1 - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 +```C +#define RGB_MATRIX_KEYPRESSES // reacts to keypresses +#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) +#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended +#define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) +#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 +``` ## EEPROM storage The EEPROM for it is currently shared with the RGBLIGHT system (it's generally assumed only one RGB would be used at a time), but could be configured to use its own 32bit address with: - #define EECONFIG_RGB_MATRIX (uint32_t *)16 +```C +#define EECONFIG_RGB_MATRIX (uint32_t *)28 +``` -Where `16` is an unused index from `eeconfig.h`. +Where `28` is an unused index from `eeconfig.h`. ## Suspended state To use the suspend feature, add this to your `.c`: - void suspend_power_down_kb(void) - { - rgb_matrix_set_suspend_state(true); - } - - void suspend_wakeup_init_kb(void) - { - rgb_matrix_set_suspend_state(false); - } +```C +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); +} + +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); +} +``` diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index a2820347deb..be4ddfa7295 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -23,10 +23,11 @@ RGBLIGHT_ENABLE = yes At minimum you must define the data pin your LED strip is connected to, and the number of LEDs in the strip, in your `config.h`. If your keyboard has onboard RGB LEDs, and you are simply creating a keymap, you usually won't need to modify these. -|Define |Description | -|------------|---------------------------------------------| -|`RGB_DI_PIN`|The pin connected to the data pin of the LEDs| -|`RGBLED_NUM`|The number of LEDs connected | +|Define |Description | +|---------------|---------------------------------------------------------------------------------------------------------| +|`RGB_DI_PIN` |The pin connected to the data pin of the LEDs | +|`RGBLED_NUM` |The number of LEDs connected | +|`RGBLED_SPLIT` |(Optional) For split keyboards, the number of LEDs connected on each half directly wired to `RGB_DI_PIN` | Then you should be able to use the keycodes below to change the RGB lighting to your liking. @@ -36,9 +37,9 @@ QMK uses [Hue, Saturation, and Value](https://en.wikipedia.org/wiki/HSL_and_HSV) HSV Color Wheel -Changing the **Hue** cycles around the circle. -Changing the **Saturation** moves between the inner and outer sections of the wheel, affecting the intensity of the color. -Changing the **Value** sets the overall brightness. +Changing the **Hue** cycles around the circle.
+Changing the **Saturation** moves between the inner and outer sections of the wheel, affecting the intensity of the color.
+Changing the **Value** sets the overall brightness.
## Keycodes @@ -63,8 +64,6 @@ Changing the **Value** sets the overall brightness. |`RGB_MODE_GRADIENT`|`RGB_M_G` |Static gradient animation mode | |`RGB_MODE_RGBTEST` |`RGB_M_T` |Red, Green, Blue test animation mode | -?> For backwards compatibility, `RGB_SMOD` is another alias of `RGB_MOD`. - ## Configuration Your RGB lighting can be configured by placing these `#define`s in your `config.h`: @@ -76,9 +75,9 @@ Your RGB lighting can be configured by placing these `#define`s in your `config. |`RGBLIGHT_VAL_STEP` |`17` |The number of steps to increment the brightness by | |`RGBLIGHT_LIMIT_VAL` |`255` |The maximum brightness level | |`RGBLIGHT_SLEEP` |*Not defined*|If defined, the RGB lighting will be switched off when the host goes to sleep| +|`RGBLIGHT_SPLIT` |*Not defined*|If defined, synchronization functionality for split keyboards is added| -## Animations - +## Effects and Animations Not only can this lighting be whatever color you want, if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a number of animation modes at your disposal: @@ -100,31 +99,59 @@ Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstrat Note: For versions older than 0.6.117, The mode numbers were written directly. In `quantum/rgblight.h` there is a contrast table between the old mode number and the current symbol. -The following options can be used to tweak the various animations: +### Effect and Animation Toggles + +Use these defines to add or remove animations from the firmware. When you are running low on flash space, it can be helpful to disable animations you are not using. + +|Define |Default |Description | +|------------------------------------|-------------|-------------------------------------------------------------------------------------| +|`RGBLIGHT_ANIMATIONS` |*Not defined*|Enable all additional animation modes. | +|`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|Enable alternating animation mode. | +|`RGBLIGHT_EFFECT_BREATHING` |*Not defined*|Enable breathing animation mode. | +|`RGBLIGHT_EFFECT_CHRISTMAS` |*Not defined*|Enable christmas animation mode. | +|`RGBLIGHT_EFFECT_KNIGHT` |*Not defined*|Enable knight animation mode. | +|`RGBLIGHT_EFFECT_RAINBOW_MOOD` |*Not defined*|Enable rainbow mood animation mode. | +|`RGBLIGHT_EFFECT_RAINBOW_SWIRL` |*Not defined*|Enable rainbow swirl animation mode. | +|`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|Enable RGB test animation mode. | +|`RGBLIGHT_EFFECT_SNAKE` |*Not defined*|Enable snake animation mode. | +|`RGBLIGHT_EFFECT_STATIC_GRADIENT` |*Not defined*|Enable static gradient mode. | + +### Effect and Animation Settings + +The following options are used to tweak the various animations: |Define |Default |Description | |------------------------------------|-------------|-------------------------------------------------------------------------------------| -|`RGBLIGHT_EFFECT_BREATHING` |*Not defined*|If defined, enable breathing animation mode. | -|`RGBLIGHT_EFFECT_RAINBOW_MOOD` |*Not defined*|If defined, enable rainbow mood animation mode. | -|`RGBLIGHT_EFFECT_RAINBOW_SWIRL` |*Not defined*|If defined, enable rainbow swirl animation mode. | -|`RGBLIGHT_EFFECT_SNAKE` |*Not defined*|If defined, enable snake animation mode. | -|`RGBLIGHT_EFFECT_KNIGHT` |*Not defined*|If defined, enable knight animation mode. | -|`RGBLIGHT_EFFECT_CHRISTMAS` |*Not defined*|If defined, enable christmas animation mode. | -|`RGBLIGHT_EFFECT_STATIC_GRADIENT` |*Not defined*|If defined, enable static gradient mode. | -|`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|If defined, enable RGB test animation mode. | -|`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|If defined, enable alternating animation mode. | -|`RGBLIGHT_ANIMATIONS` |*Not defined*|If defined, enables all additional animation modes | -|`RGBLIGHT_EFFECT_BREATHE_CENTER` |`1.85` |Used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 | +|`RGBLIGHT_EFFECT_BREATHE_CENTER` |*Not defined*|If defined, used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 | |`RGBLIGHT_EFFECT_BREATHE_MAX` |`255` |The maximum brightness for the breathing mode. Valid values are 1 to 255 | -|`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation | -|`RGBLIGHT_EFFECT_KNIGHT_LENGTH` |`3` |The number of LEDs to light up for the "Knight" animation | -|`RGBLIGHT_EFFECT_KNIGHT_OFFSET` |`0` |The number of LEDs to start the "Knight" animation from the start of the strip by | -|`RGBLIGHT_EFFECT_KNIGHT_LED_NUM` |`RGBLED_NUM` |The number of LEDs to have the "Knight" animation travel | |`RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL`|`1000` |How long to wait between light changes for the "Christmas" animation, in milliseconds| |`RGBLIGHT_EFFECT_CHRISTMAS_STEP` |`2` |The number of LEDs to group the red/green colors by for the "Christmas" animation | +|`RGBLIGHT_EFFECT_KNIGHT_LED_NUM` |`RGBLED_NUM` |The number of LEDs to have the "Knight" animation travel | +|`RGBLIGHT_EFFECT_KNIGHT_LENGTH` |`3` |The number of LEDs to light up for the "Knight" animation | +|`RGBLIGHT_EFFECT_KNIGHT_OFFSET` |`0` |The number of LEDs to start the "Knight" animation from the start of the strip by | +|`RGBLIGHT_RAINBOW_SWIRL_RANGE` |`255` |Range adjustment for the rainbow swirl effect to get different swirls | +|`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation | + +### Example Usage to Reduce Memory Footprint + 1. Remove `RGBLIGHT_ANIMATIONS` from `config.h`. + 1. Selectively add the animations you want to enable. The following would enable two animations and save about 4KiB: + +```diff + #undef RGBLED_NUM +-#define RGBLIGHT_ANIMATIONS ++#define RGBLIGHT_EFFECT_STATIC_GRADIENT ++#define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLED_NUM 12 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 +``` + +### Animation Speed You can also modify the speeds that the different modes animate at: +Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY). + ```c // How long (in milliseconds) to wait between animation steps for each of the "Solid color breathing" animations const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; @@ -142,28 +169,216 @@ const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31}; // These control which hues are selected for each of the "Static gradient" modes -const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; +const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64}; ``` ## Functions If you need to change your RGB lighting in code, for example in a macro to change the color whenever you switch layers, QMK provides a set of functions to assist you. See [`rgblight.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight.h) for the full list, but the most commonly used functions include: -|Function |Description | -|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -|`rgblight_enable()` |Turn LEDs on, based on their previous state | -|`rgblight_enable_noeeprom()` |Turn LEDs on, based on their previous state (not written to EEPROM) | -|`rgblight_disable()` |Turn LEDs off | -|`rgblight_disable_noeeprom()` |Turn LEDs off (not written to EEPROM) | -|`rgblight_mode(x)` |Set the mode, if RGB animations are enabled | -|`rgblight_mode_noeeprom(x)` |Set the mode, if RGB animations are enabled (not written to EEPROM) | -|`rgblight_setrgb(r, g, b)` |Set all LEDs to the given RGB value where `r`/`g`/`b` are between 0 and 255 (not written to EEPROM) | -|`rgblight_setrgb_at(r, g, b, led)` |Set a single LED to the given RGB value, where `r`/`g`/`b` are between 0 and 255 and `led` is between 0 and `RGBLED_NUM` (not written to EEPROM) | -|`rgblight_sethsv(h, s, v)` |Set all LEDs to the given HSV value where `h` is between 0 and 360 and `s`/`v` are between 0 and 255 | -|`rgblight_sethsv_noeeprom(h, s, v)`|Set all LEDs to the given HSV value where `h` is between 0 and 360 and `s`/`v` are between 0 and 255 (not written to EEPROM) | -|`rgblight_sethsv_at(h, s, v, led)` |Set a single LED to the given HSV value, where `h` is between 0 and 360, `s`/`v` are between 0 and 255, and `led` is between 0 and `RGBLED_NUM` (not written to EEPROM)| - -Additionally, [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h) defines several predefined shortcuts for various colors. Feel free to add to this list! +### Utility Functions +|Function |Description | +|--------------------------------------------|-------------------------------------------------------------------| +|`sethsv(hue, sat, val, ledbuf)` |Set ledbuf to the given HSV value | +|`sethsv_raw(hue, sat, val, ledbuf)` |Set ledbuf to the given HSV value without RGBLIGHT_LIMIT_VAL check | +|`setrgb(r, g, b, ledbuf)` |Set ledbuf to the given RGB value where `r`/`g`/`b` | + +### Low level Functions +|Function |Description | +|--------------------------------------------|-------------------------------------------| +|`rgblight_set()` |Flash out led buffers to LEDs | +|`rgblight_set_clipping_range(pos, num)` |Set clipping Range. see [Clipping Range](#clipping-range) | + +Example: +```c +sethsv(HSV_WHITE, (LED_TYPE *)&led[0]); // led 0 +sethsv(HSV_RED, (LED_TYPE *)&led[1]); // led 1 +sethsv(HSV_GREEN, (LED_TYPE *)&led[2]); // led 2 +rgblight_set(); // Utility functions do not call rgblight_set() automatically, so they need to be called explicitly. +``` + +### Effects and Animations Functions +#### effect range setting +|Function |Description | +|--------------------------------------------|------------------| +|`rgblight_set_effect_range(pos, num)` |Set Effects Range | + +#### direct operation +|Function |Description | +|--------------------------------------------|-------------| +|`rgblight_setrgb_at(r, g, b, index)` |Set a single LED to the given RGB value, where `r`/`g`/`b` are between 0 and 255 and `index` is between 0 and `RGBLED_NUM` (not written to EEPROM) | +|`rgblight_sethsv_at(h, s, v, index)` |Set a single LED to the given HSV value, where `h`/`s`/`v` are between 0 and 255, and `index` is between 0 and `RGBLED_NUM` (not written to EEPROM) | +|`rgblight_setrgb_range(r, g, b, start, end)`|Set a continuous range of LEDs to the given RGB value, where `r`/`g`/`b` are between 0 and 255 and `start`(included) and `stop`(excluded) are between 0 and `RGBLED_NUM` (not written to EEPROM)| +|`rgblight_sethsv_range(h, s, v, start, end)`|Set a continuous range of LEDs to the given HSV value, where `h`/`s`/`v` are between 0 and 255, and `start`(included) and `stop`(excluded) are between 0 and `RGBLED_NUM` (not written to EEPROM)| +|`rgblight_setrgb(r, g, b)` |Set effect range LEDs to the given RGB value where `r`/`g`/`b` are between 0 and 255 (not written to EEPROM) | +|`rgblight_setrgb_master(r, g, b)` |Set the LEDs on the master side to the given RGB value, where `r`/`g`/`b` are between 0 and 255 (not written to EEPROM) | +|`rgblight_setrgb_slave(r, g, b)` |Set the LEDs on the slave side to the given RGB value, where `r`/`g`/`b` are between 0 and 255 (not written to EEPROM) | +|`rgblight_sethsv_master(h, s, v)` |Set the LEDs on the master side to the given HSV value, where `h`/`s`/`v` are between 0 and 255 (not written to EEPROM) | +|`rgblight_sethsv_slave(h, s, v)` |Set the LEDs on the slave side to the given HSV value, where `h`/`s`/`v` are between 0 and 255 (not written to EEPROM) | + +Example: +```c +rgblight_sethsv(HSV_WHITE, 0); // led 0 +rgblight_sethsv(HSV_RED, 1); // led 1 +rgblight_sethsv(HSV_GREEN, 2); // led 2 +// The above functions automatically calls rgblight_set(), so there is no need to call it explicitly. +// Note that it is inefficient to call repeatedly. +``` + +#### effect mode change +|Function |Description | +|--------------------------------------------|-------------| +|`rgblight_mode(x)` |Set the mode, if RGB animations are enabled | +|`rgblight_mode_noeeprom(x)` |Set the mode, if RGB animations are enabled (not written to EEPROM) | +|`rgblight_step()` |Change the mode to the next RGB animation in the list of enabled RGB animations | +|`rgblight_step_noeeprom()` |Change the mode to the next RGB animation in the list of enabled RGB animations (not written to EEPROM) | +|`rgblight_step_reverse()` |Change the mode to the previous RGB animation in the list of enabled RGB animations | +|`rgblight_step_reverse_noeeprom()` |Change the mode to the previous RGB animation in the list of enabled RGB animations (not written to EEPROM) | + +#### effects mode disable/enable +|Function |Description | +|--------------------------------------------|-------------| +|`rgblight_toggle()` |Toggle effect range LEDs between on and off | +|`rgblight_toggle_noeeprom()` |Toggle effect range LEDs between on and off (not written to EEPROM) | +|`rgblight_enable()` |Turn effect range LEDs on, based on their previous state | +|`rgblight_enable_noeeprom()` |Turn effect range LEDs on, based on their previous state (not written to EEPROM) | +|`rgblight_disable()` |Turn effect range LEDs off | +|`rgblight_disable_noeeprom()` |Turn effect range LEDs off (not written to EEPROM) | + +#### hue, sat, val change +|Function |Description | +|--------------------------------------------|-------------| +|`rgblight_increase_hue()` |Increase the hue for effect range LEDs. This wraps around at maximum hue | +|`rgblight_increase_hue_noeeprom()` |Increase the hue for effect range LEDs. This wraps around at maximum hue (not written to EEPROM) | +|`rgblight_decrease_hue()` |Decrease the hue for effect range LEDs. This wraps around at minimum hue | +|`rgblight_decrease_hue_noeeprom()` |Decrease the hue for effect range LEDs. This wraps around at minimum hue (not written to EEPROM) | +|`rgblight_increase_sat()` |Increase the saturation for effect range LEDs. This wraps around at maximum saturation | +|`rgblight_increase_sat_noeeprom()` |Increase the saturation for effect range LEDs. This wraps around at maximum saturation (not written to EEPROM) | +|`rgblight_decrease_sat()` |Decrease the saturation for effect range LEDs. This wraps around at minimum saturation | +|`rgblight_decrease_sat_noeeprom()` |Decrease the saturation for effect range LEDs. This wraps around at minimum saturation (not written to EEPROM) | +|`rgblight_increase_val()` |Increase the value for effect range LEDs. This wraps around at maximum value | +|`rgblight_increase_val_noeeprom()` |Increase the value for effect range LEDs. This wraps around at maximum value (not written to EEPROM) | +|`rgblight_decrease_val()` |Decrease the value for effect range LEDs. This wraps around at minimum value | +|`rgblight_decrease_val_noeeprom()` |Decrease the value for effect range LEDs. This wraps around at minimum value (not written to EEPROM) | +|`rgblight_sethsv(h, s, v)` |Set effect range LEDs to the given HSV value where `h`/`s`/`v` are between 0 and 255 | +|`rgblight_sethsv_noeeprom(h, s, v)` |Set effect range LEDs to the given HSV value where `h`/`s`/`v` are between 0 and 255 (not written to EEPROM) | + +#### query +|Function |Description | +|-----------------------|-----------------| +|`rgblight_get_mode()` |Get current mode | +|`rgblight_get_hue()` |Get current hue | +|`rgblight_get_sat()` |Get current sat | +|`rgblight_get_val()` |Get current val | + +## Colors + +These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. + +|RGB |HSV | +|-------------------|-------------------| +|`RGB_WHITE` |`HSV_WHITE` | +|`RGB_RED` |`HSV_RED` | +|`RGB_CORAL` |`HSV_CORAL` | +|`RGB_ORANGE` |`HSV_ORANGE` | +|`RGB_GOLDENROD` |`HSV_GOLDENROD` | +|`RGB_GOLD` |`HSV_GOLD` | +|`RGB_YELLOW` |`HSV_YELLOW` | +|`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | +|`RGB_GREEN` |`HSV_GREEN` | +|`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | +|`RGB_TURQUOISE` |`HSV_TURQUOISE` | +|`RGB_TEAL` |`HSV_TEAL` | +|`RGB_CYAN` |`HSV_CYAN` | +|`RGB_AZURE` |`HSV_AZURE` | +|`RGB_BLUE` |`HSV_BLUE` | +|`RGB_PURPLE` |`HSV_PURPLE` | +|`RGB_MAGENTA` |`HSV_MAGENTA` | +|`RGB_PINK` |`HSV_PINK` | + +```c +rgblight_setrgb(RGB_ORANGE); +rgblight_sethsv_noeeprom(HSV_GREEN); +rgblight_setrgb_at(RGB_GOLD, 3); +rgblight_sethsv_range(HSV_WHITE, 0, 6); +``` + +These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list! + + +## Changing the order of the LEDs + +If you want to make the logical order of LEDs different from the electrical connection order, you can do this by defining the `RGBLIGHT_LED_MAP` macro in your `config.h`. + +Normally, the contents of the LED buffer are output to the LEDs in the same order. +simple dicrect + +By defining `RGBLIGHT_LED_MAP` as in the example below, you can specify the LED with addressing in reverse order of the electrical connection order. + +```c +// config.h + +#define RGBLED_NUM 4 +#define RGBLIGHT_LED_MAP { 3, 2, 1, 0 } + +``` +simple mapped + +For keyboards that use the RGB LEDs as a backlight for each key, you can also define it as in the example below. + +```c +// config.h + +#define RGBLED_NUM 30 + +/* RGB LED Conversion macro from physical array to electric array */ +#define LED_LAYOUT( \ + L00, L01, L02, L03, L04, L05, \ + L10, L11, L12, L13, L14, L15, \ + L20, L21, L22, L23, L24, L25, \ + L30, L31, L32, L33, L34, L35, \ + L40, L41, L42, L43, L44, L45 ) \ + { \ + L05, L04, L03, L02, L01, L00, \ + L10, L11, L12, L13, L14, L15, \ + L25, L24, L23, L22, L21, L20, \ + L30, L31, L32, L33, L34, L35, \ + L46, L45, L44, L43, L42, L41 \ + } + +/* RGB LED logical order map */ +/* Top->Bottom, Right->Left */ +#define RGBLIGHT_LED_MAP LED_LAYOUT( \ + 25, 20, 15, 10, 5, 0, \ + 26, 21, 16, 11, 6, 1, \ + 27, 22, 17, 12, 7, 2, \ + 28, 23, 18, 13, 8, 3, \ + 29, 24, 19, 14, 9, 4 ) + +``` +## Clipping Range + +Using the `rgblight_set_clipping_range()` function, you can prepare more buffers than the actual number of LEDs, and output some of the buffers to the LEDs. This is useful if you want the split keyboard to treat left and right LEDs as logically contiguous. + +You can set the Clipping Range by executing the following code. + +```c +// some soruce + rgblight_set_clipping_range(3, 4); +``` +clip direct + +In addition to setting the Clipping Range, you can use `RGBLIGHT_LED_MAP` together. + +```c +// config.h +#define RGBLED_NUM 8 +#define RGBLIGHT_LED_MAP { 7, 6, 5, 4, 3, 2, 1, 0 } + +// some soruce + rgblight_set_clipping_range(3, 4); +``` +clip mapped ## Hardware Modification diff --git a/docs/feature_space_cadet.md b/docs/feature_space_cadet.md new file mode 100644 index 00000000000..41a44627e3c --- /dev/null +++ b/docs/feature_space_cadet.md @@ -0,0 +1,60 @@ +# Space Cadet: The Future, Built In + +Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds, and now even cooler supporting Control and Alt as well! + +## Usage + +Firstly, in your keymap, do one of the following: +- Replace the Left Shift key with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close). +- Replace the Left Control key with `KC_LCPO` (Left Control, Parenthesis Open), and Right Control with `KC_RCPC` (Right Control, Parenthesis Close). +- Replace the Left Alt key with `KC_LAPO` (Left Alt, Parenthesis Open), and Right Alt with `KC_RAPC` (Right Alt, Parenthesis Close). +- Replace any Shift key in your keymap with `KC_SFTENT` (Right Shift, Enter). + +## Keycodes + +|Keycode |Description | +|-----------|-------------------------------------------| +|`KC_LSPO` |Left Shift when held, `(` when tapped | +|`KC_RSPC` |Right Shift when held, `)` when tapped | +|`KC_LCPO` |Left Control when held, `(` when tapped | +|`KC_RCPC` |Right Control when held, `)` when tapped | +|`KC_LAPO` |Left Alt when held, `(` when tapped | +|`KC_RAPC` |Right Alt when held, `)` when tapped | +|`KC_SFTENT`|Right Shift when held, Enter when tapped | + +## Caveats + +Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. See the [Command feature](feature_command.md) for info on how to change it, or make sure that Command is disabled in your `rules.mk` with: + +```make +COMMAND_ENABLE = no +``` + +## Configuration + +By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`. In addition, you can redefine the modifier to send on tap, or even send no modifier at all. The new configuration defines bundle all options up into a single define of 3 key codes in this order: the `Modifier` when held or when used with other keys, the `Tap Modifer` sent when tapped (no modifier if `KC_TRNS`), finally the `Keycode` sent when tapped. Now keep in mind, mods from other keys will still apply to the `Keycode` if say `KC_RSFT` is held while tapping `KC_LSPO` key with `KC_TRNS` as the `Tap Modifer`. + +|Define |Default |Description | +|----------------|-------------------------------|---------------------------------------------------------------------------------| +|`LSPO_KEYS` |`KC_LSFT, LSPO_MOD, LSPO_KEY` |Send `KC_LSFT` when held, the mod and key defined by `LSPO_MOD` and `LSPO_KEY`. | +|`RSPC_KEYS` |`KC_RSFT, RSPC_MOD, RSPC_KEY` |Send `KC_RSFT` when held, the mod and key defined by `RSPC_MOD` and `RSPC_KEY`. | +|`LCPO_KEYS` |`KC_LCTL, KC_LSFT, KC_9` |Send `KC_LCTL` when held, the mod `KC_LSFT` with the key `KC_9` when tapped. | +|`RCPC_KEYS` |`KC_RCTL, KC_RSFT, KC_0` |Send `KC_RCTL` when held, the mod `KC_RSFT` with the key `KC_0` when tapped. | +|`LAPO_KEYS` |`KC_LALT, KC_LSFT, KC_9` |Send `KC_LALT` when held, the mod `KC_LSFT` with the key `KC_9` when tapped. | +|`RAPC_KEYS` |`KC_RALT, KC_RSFT, KC_0` |Send `KC_RALT` when held, the mod `KC_RSFT` with the key `KC_0` when tapped. | +|`SFTENT_KEYS` |`KC_RSFT, KC_TRNS, SFTENT_KEY` |Send `KC_RSFT` when held, no mod with the key `SFTENT_KEY` when tapped. | +|`SPACE_CADET_MODIFIER_CARRYOVER` |*Not defined* |Store current modifiers before the hold mod is pressed and use them with the tap mod and keycode. Useful for when you frequently release a modifier before triggering Space Cadet. | + + +## Obsolete Configuration + +These defines are used in the above defines internally to support backwards compatibility, so you may continue to use them, however the above defines open up a larger range of flexibility than before. As an example, say you want to not send any modifier when you tap just `KC_LSPO`, with the old defines you had an all or nothing choice of using the `DISABLE_SPACE_CADET_MODIFIER` define. Now you can define that key as: `#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_9`. This tells the system to set Left Shift if held or used with other keys, then on tap send no modifier (transparent) with the `KC_9`. + +|Define |Default |Description | +|------------------------------|-------------|------------------------------------------------------------------| +|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped | +|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped | +|`LSPO_MOD` |`KC_LSFT` |The modifier to apply to `LSPO_KEY` | +|`RSPC_MOD` |`KC_RSFT` |The modifier to apply to `RSPC_KEY` | +|`SFTENT_KEY` |`KC_ENT` |The keycode to send when the Shift key is tapped | +|`DISABLE_SPACE_CADET_MODIFIER`|*Not defined*|If defined, prevent the Space Cadet from applying a modifier | diff --git a/docs/feature_space_cadet_shift.md b/docs/feature_space_cadet_shift.md deleted file mode 100644 index bec7cbd3d9f..00000000000 --- a/docs/feature_space_cadet_shift.md +++ /dev/null @@ -1,33 +0,0 @@ -# Space Cadet Shift: The Future, Built In - -Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds. - -## Usage - -Replace the Left Shift key in your keymap with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close). - -## Keycodes - -|Keycode |Description | -|---------|--------------------------------------| -|`KC_LSPO`|Left Shift when held, `(` when tapped | -|`KC_RSPC`|Right Shift when held, `)` when tapped| - -## Caveats - -Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. Make sure that Command is disabled in your `rules.mk` with: - -```make -COMMAND_ENABLE = no -``` - -## Configuration - -By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`. -You can also disable the rollover, allowing you to use the opposite Shift key to cancel the Space Cadet state in the event of an erroneous press, instead of emitting a pair of parentheses when the keys are released. - -|Define |Default |Description | -|------------------------------|-------------|------------------------------------------------------------| -|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped | -|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped | -|`DISABLE_SPACE_CADET_ROLLOVER`|*Not defined*|If defined, use the opposite Shift key to cancel Space Cadet| diff --git a/docs/feature_space_cadet_shift_enter.md b/docs/feature_space_cadet_shift_enter.md deleted file mode 100644 index 56a569b1392..00000000000 --- a/docs/feature_space_cadet_shift_enter.md +++ /dev/null @@ -1,31 +0,0 @@ -# Space Cadet Shift Enter - -Based on the [Space Cadet Shift](feature_space_cadet_shift.md) feature. Tap the Shift key on its own, and it behaves like Enter. When held, the Shift functions as normal. - -## Usage - -Replace any Shift key in your keymap with `KC_SFTENT` (Shift, Enter), and you're done. - -## Keycodes - -|Keycode |Description | -|-----------|----------------------------------------| -|`KC_SFTENT`|Right Shift when held, Enter when tapped| - -## Caveats - -As with Space Cadet Shift, this feature may conflict with Command, so it should be disabled in your `rules.mk` with: - -```make -COMMAND_ENABLE = no -``` - -This feature also uses the same timers as Space Cadet Shift, so using them in tandem may produce strange results. - -## Configuration - -By default Space Cadet assumes a US ANSI layout, but if you'd like to use a different key for Enter, you can redefine it in your `config.h`: - -|Define |Default |Description | -|------------|--------|------------------------------------------------| -|`SFTENT_KEY`|`KC_ENT`|The keycode to send when the Shift key is tapped| diff --git a/docs/feature_split_keyboard.md b/docs/feature_split_keyboard.md new file mode 100644 index 00000000000..95aceab2238 --- /dev/null +++ b/docs/feature_split_keyboard.md @@ -0,0 +1,185 @@ +# Split Keyboard + +Many keyboards in the QMK Firmware repo are "split" keyboards. They use two controllers—one plugging into USB, and the second connected by a serial or an I2C connection over a TRRS or similar cable. + +Split keyboards can have a lot of benefits, but there is some additional work needed to get them enabled. + +QMK Firmware has a generic implementation that is usable by any board, as well as numerous board specific implementations. + +For this, we will mostly be talking about the generic implementation used by the Let's Split and other keyboards. + +!> ARM is not yet supported for Split Keyboards. Progress is being made, but we are not quite there, yet. + + +## Hardware Configuration + +This assumes that you're using two Pro Micro-compatible controllers, and are using TRRS jacks to connect to two halves. + +### Required Hardware + +Apart from diodes and key switches for the keyboard matrix in each half, you will need 2x TRRS sockets and 1x TRRS cable. + +Alternatively, you can use any sort of cable and socket that has at least 3 wires. + +If you want to use I2C to communicate between halves, you will need a cable with at least 4 wires and 2x 4.7kΩ pull-up resistors. + +#### Considerations + +The most commonly used connection is a TRRS cable and jacks. These provide 4 wires, making them very useful for split keyboards, and are easy to find. + +However, since one of the wires carries VCC, this means that the boards are not hot pluggable. You should always disconnect the board from USB before unplugging and plugging in TRRS cables, or you can short the controller, or worse. + +Another option is to use phone cables (as in, old school RJ-11/RJ-14 cables). Make sure that you use one that actually supports 4 wires/lanes. + +However, USB cables, SATA cables, and even just 4 wires have been known to be used for communication between the controllers. + +!> Using USB cables for communication between the controllers works just fine, but the connector could be mistaken for a normal USB connection and potentially short out the keyboard, depending on how it's wired. For this reason, they are not recommended for connecting split keyboards. + +### Serial Wiring + +The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and D0 (aka PDO or pin 3) between the two Pro Micros. + +?> Note that the pin used here is actually set by `SOFT_SERIAL_PIN` below. + +![serial wiring](https://i.imgur.com/C3D1GAQ.png) + +### I2C Wiring + +The 4 wires of the TRRS cable need to connect GND, VCC, and SCL and SDA (aka PD0/pin 3 and PD1/pin 2, respectively) between the two Pro Micros. + +The pull-up resistors may be placed on either half. It is also possible to use 4 resistors and have the pull-ups in both halves, but this is unnecessary in simple use cases. + +![I2C wiring](https://i.imgur.com/Hbzhc6E.png) + +## Firmware Configuration + +To enable the split keyboard feature, add the following to your `rules.mk`: + +```make +SPLIT_KEYBOARD = yes +``` + +If you're using a custom transport (communication method), then you will also need to add: + +```make +SPLIT_TRANSPORT = custom +``` + +### Setting Handedness + +By default, the firmware does not know which side is which; it needs some help to determine that. There are several ways to do this, listed in order of precedence. + +#### Handedness by Pin + +You can configure the firmware to read a pin on the controller to determine handedness. To do this, add the following to your `config.h` file: + +```c +#define SPLIT_HAND_PIN B7 +``` + +This will read the specified pin. If it's high, then the controller assumes it is the left hand, and if it's low, it's assumed to be the right side. + +#### Handedness by EEPROM + +This method sets the keyboard's handedness by setting a flag in the persistent storage (`EEPROM`). This is checked when the controller first starts up, and determines what half the keyboard is, and how to orient the keyboard layout. + + +To enable this method, add the following to your `config.h` file: + +```c +#define EE_HANDS +``` + +However, you'll have to flash the EEPROM files for the correct hand to each controller. You can do this manually, or there are targets for avrdude and dfu to do this, while flashing the firmware: + +* `:avrdude-split-left` +* `:avrdude-split-right` +* `:dfu-split-left` +* `:dfu-split-right` + +This setting is not changed when re-initializing the EEPROM using the `EEP_RST` key, or using the `eeconfig_init()` function. However, if you reset the EEPROM outside of the firmware's built in options (such as flashing a file that overwrites the `EEPROM`, like how the [QMK Toolbox]()'s "Reset EEPROM" button works), you'll need to re-flash the controller with the `EEPROM` files. + +You can find the `EEPROM` files in the QMK firmware repo, [here](https://github.com/qmk/qmk_firmware/tree/master/quantum/split_common). + +#### Handedness by `#define` + +You can set the handedness at compile time. This is done by adding the following to your `config.h` file: + +```c +#define MASTER_RIGHT +``` + +or + +```c +#define MASTER_LEFT +``` + +If neither are defined, the handedness defaults to `MASTER_LEFT`. + + +### Communication Options + +Because not every split keyboard is identical, there are a number of additional options that can be configured in your `config.h` file. + +```c +#define USE_I2C +``` + +This enables I2C support for split keyboards. This isn't strictly for communication, but can be used for OLED or other I2C-based devices. + +```c +#define SOFT_SERIAL_PIN D0 +``` + +This sets the pin to be used for serial communication. If you're not using serial, you shouldn't need to define this. + +However, if you are using serial and I2C on the board, you will need to set this, and to something other than D0 and D1 (as these are used for I2C communication). + +```c +#define SELECT_SOFT_SERIAL_SPEED {#}` +``` + +If you're having issues with serial communication, you can change this value, as it controls the communication speed for serial. The default is 1, and the possible values are: + +* **`0`**: about 189kbps (Experimental only) +* **`1`**: about 137kbps (default) +* **`2`**: about 75kbps +* **`3`**: about 39kbps +* **`4`**: about 26kbps +* **`5`**: about 20kbps + +### Hardware Configuration Options + +There are some settings that you may need to configure, based on how the hardware is set up. + +```c +#define MATRIX_ROW_PINS_RIGHT { } +#define MATRIX_COL_PINS_RIGHT { } +``` + +This allows you to specify a different set of pins for the matrix on the right side. This is useful if you have a board with differently-shaped halves that requires a different configuration (such as Keebio's Quefrency). + + +```c +#define RGBLIGHT_SPLIT +``` + +This option enables synchronization of the RGB Light modes between the controllers of the split keyboard. This is for keyboards that have RGB LEDs that are directly wired to the controller (that is, they are not using the "extra data" option on the TRRS cable). + +```c +#define RGBLED_SPLIT { 6, 6 } +``` + +This sets how many LEDs are directly connected to each controller. The first number is the left side, and the second number is the right side. + +?> This setting implies that `RGBLIGHT_SPLIT` is enabled, and will forcibly enable it, if it's not. + + +## Additional Resources + +Nicinabox has a [very nice and detailed guide](https://github.com/nicinabox/lets-split-guide) for the Let's Split keyboard, that covers most everything you need to know, including troubleshooting information. + +However, the RGB Light section is out of date, as it was written long before the RGB Split code was added to QMK Firmware. Instead, wire each strip up directly to the controller. + + diff --git a/docs/feature_tap_dance.md b/docs/feature_tap_dance.md index b2b567f1d07..73e0471a012 100644 --- a/docs/feature_tap_dance.md +++ b/docs/feature_tap_dance.md @@ -1,22 +1,33 @@ # Tap Dance: A Single Key Can Do 3, 5, or 100 Different Things - - +## Introduction Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/qmk/qmk_firmware/pull/451). Here's how algernon describes the feature: With this feature one can specify keys that behave differently, based on the amount of times they have been tapped, and when interrupted, they get handled before the interrupter. -To make it clear how this is different from `ACTION_FUNCTION_TAP`, let's explore a certain setup! We want one key to send `Space` on single tap, but `Enter` on double-tap. +## Explanatory Comparison with `ACTION_FUNCTION_TAP` +`ACTION_FUNCTION_TAP` can offer similar functionality to Tap Dance, but it's worth noting some important differences. To do this, let's explore a certain setup! We want one key to send `Space` on single-tap, but `Enter` on double-tap. + +With `ACTION_FUNCTION_TAP`, it is quite a rain-dance to set this up, and has the problem that when the sequence is interrupted, the interrupting key will be sent first. Thus, `SPC a` will result in `a SPC` being sent, if `SPC` and `a` are both typed within `TAPPING_TERM`. With the Tap Dance feature, that'll come out correctly as `SPC a` (even if both `SPC` and `a` are typed within the `TAPPING_TERM`. + +To achieve this correct handling of interrupts, the implementation of Tap Dance hooks into two parts of the system: `process_record_quantum()`, and the matrix scan. These two parts are explained below, but for now the point to note is that we need the latter to be able to time out a tap sequence even when a key is not being pressed. That way, `SPC` alone will time out and register after `TAPPING_TERM` time. + +## How to Use Tap Dance +But enough of the generalities; lets look at how to actually use Tap Dance! -With `ACTION_FUNCTION_TAP`, it is quite a rain-dance to set this up, and has the problem that when the sequence is interrupted, the interrupting key will be sent first. Thus, `SPC a` will result in `a SPC` being sent, if they are typed within `TAPPING_TERM`. With the tap dance feature, that'll come out as `SPC a`, correctly. +First, you will need `TAP_DANCE_ENABLE=yes` in your `rules.mk`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. -The implementation hooks into two parts of the system, to achieve this: into `process_record_quantum()`, and the matrix scan. We need the latter to be able to time out a tap sequence even when a key is not being pressed, so `SPC` alone will time out and register after `TAPPING_TERM` time. +Optionally, you might want to set a custom `TAPPING_TERM` time by adding something like this in you `config.h`: + +``` +#define TAPPING_TERM 175 +``` -But lets start with how to use it, first! +The `TAPPING_TERM` time is the maximum time allowed between taps of your Tap Dance key, and is measured in milliseconds. For example, if you used the above `#define` statement and set up a Tap Dance key that sends `Space` on single-tap and `Enter` on double-tap, then this key will send `ENT` only if you tap this key twice in less than 175ms. If you tap the key, wait more than 175ms, and tap the key again you'll end up sending `SPC SPC` instead. -First, you will need `TAP_DANCE_ENABLE=yes` in your `rules.mk`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array. +Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()` - takes a number, which will later be used as an index into the `tap_dance_actions` array. -This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are five possible options: +After this, you'll want to use the `tap_dance_actions` array to specify what actions shall be taken when a tap-dance key is in action. Currently, there are five possible options: * `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. When the key is held, the appropriate keycode is registered: `kc1` when pressed and held, `kc2` when tapped once, then pressed and held. * `ACTION_TAP_DANCE_DUAL_ROLE(kc, layer)`: Sends the `kc` keycode when tapped once, or moves to `layer`. (this functions like the `TO` layer keycode). @@ -24,17 +35,22 @@ This array specifies what actions shall be taken when a tap-dance key is in acti * `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function when the dance action finishes (like the previous option), and the last function when the tap dance action resets. * `ACTION_TAP_DANCE_FN_ADVANCED_TIME(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn, tap_specific_tapping_term)`: This functions identically to the `ACTION_TAP_DANCE_FN_ADVANCED` function, but uses a custom tapping term for it, instead of the predefined `TAPPING_TERM`. -The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise. +The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise. !> Keep in mind that only [basic keycodes](keycodes_basic.md) are supported here. Custom keycodes are not supported. -And that's the bulk of it! +Similar to the first option, the second option is good for simple layer-switching cases. -And now, on to the explanation of how it works! +For more complicated cases, use the third or fourth options (examples of each are listed below). -The main entry point is `process_tap_dance()`, called from `process_record_quantum()`, which is run for every keypress, and our handler gets to run early. This function checks whether the key pressed is a tap-dance key. If it is not, and a tap-dance was in action, we handle that first, and enqueue the newly pressed key. If it is a tap-dance key, then we check if it is the same as the already active one (if there's one active, that is). If it is not, we fire off the old one first, then register the new one. If it was the same, we increment the counter and the timer. +Finally, the fifth option is particularly useful if your non-Tap-Dance keys start behaving weirdly after adding the code for your Tap Dance keys. The likely problem is that you changed the `TAPPING_TERM` time to make your Tap Dance keys easier for you to use, and that this has changed the way your other keys handle interrupts. -This means that you have `TAPPING_TERM` time to tap the key again, you do not have to input all the taps within that timeframe. This allows for longer tap counts, with minimal impact on responsiveness. +## Implementation Details +Well, that's the bulk of it! You should now be able to work through the examples below, and to develop your own Tap Dance functionality. But if you want a deeper understanding of what's going on behind the scenes, then read on for the explanation of how it all works! + +The main entry point is `process_tap_dance()`, called from `process_record_quantum()`, which is run for every keypress, and our handler gets to run early. This function checks whether the key pressed is a tap-dance key. If it is not, and a tap-dance was in action, we handle that first, and enqueue the newly pressed key. If it is a tap-dance key, then we check if it is the same as the already active one (if there's one active, that is). If it is not, we fire off the old one first, then register the new one. If it was the same, we increment the counter and reset the timer. + +This means that you have `TAPPING_TERM` time to tap the key again; you do not have to input all the taps within a single `TAPPING_TERM` timeframe. This allows for longer tap counts, with minimal impact on responsiveness. Our next stop is `matrix_scan_tap_dance()`. This handles the timeout of tap-dance keys. @@ -185,29 +201,11 @@ Below is a specific example: ## Setup -You will need a few things that can be used for 'Quad Function Tap-Dance'. The suggested setup is to create a user directory for yourself. This directory will contain rules.mk `.c` and `.h`. This directory should be called ``, and located in the top level `users` directory. There should already be a few examples to look at there. - -### In `/qmk_firmware/users//rules.mk` - -Put the following: -```c -TAP_DANCE_ENABLE = yes -SRC += your_name.c -``` - -Pretty simple. It is a nice way to keep some rules common on all your keymaps. - +You will need a few things that can be used for 'Quad Function Tap-Dance'. -### In `/qmk_firmware/users//.h` - -You will need a few things in this file: +You'll need to add these to the top of your `keymap.c` file, before your keymap. ```c -#pragma once - -#include "quantum.h" -#include "process_keycode/process_tap_dance.h" - typedef struct { bool is_press_action; int state; @@ -234,18 +232,12 @@ int cur_dance (qk_tap_dance_state_t *state); //for the x tap dance. Put it here so it can be used in any keymap void x_finished (qk_tap_dance_state_t *state, void *user_data); void x_reset (qk_tap_dance_state_t *state, void *user_data); -``` -### In `/qmk_firmware/users//.c` +``` -And then in your user's `.c` file you implement the functions above: +Now, at the bottom of your `keymap.c` file, you'll need to add the following: ```c -#include ".h" -#include "quantum.h" -#include "action.h" -#include "process_keycode/process_tap_dance.h" - /* Return an integer that corresponds to what kind of tap dance should be executed. * * How to figure out tap dance state: interrupted and pressed. @@ -335,4 +327,197 @@ qk_tap_dance_action_t tap_dance_actions[] = { }; ``` -And then simply use `TD(X_CTL)` anywhere in your keymap after including `.h`. +And then simply use `TD(X_CTL)` anywhere in your keymap. + +If you want to implement this in your userspace, then you may want to check out how [DanielGGordon](https://github.com/qmk/qmk_firmware/tree/master/users/gordon) has implemented this in their userspace. + +### Example 5: Using tap dance for advanced mod-tap and layer-tap keys + +Tap dance can be used to emulate `MT()` and `LT()` behavior when the tapped code is not a basic keycode. This is useful to send tapped keycodes that normally require `Shift`, such as parentheses or curly braces—or other modified keycodes, such as `Control + X`. + +Below your layers and custom keycodes, add the following: + +```c +// tapdance keycodes +enum td_keycodes { + ALT_LP // Our example key: `LALT` when held, `(` when tapped. Add additional keycodes for each tapdance. +}; + +// define a type containing as many tapdance states as you need +typedef enum { + SINGLE_TAP, + SINGLE_HOLD, + DOUBLE_SINGLE_TAP +} td_state_t; + +// create a global instance of the tapdance state type +static td_state_t td_state; + +// declare your tapdance functions: + +// function to determine the current tapdance state +int cur_dance (qk_tap_dance_state_t *state); + +// `finished` and `reset` functions for each tapdance keycode +void altlp_finished (qk_tap_dance_state_t *state, void *user_data); +void altlp_reset (qk_tap_dance_state_t *state, void *user_data); +``` + +Below your `LAYOUT`, define each of the tapdance functions: + +```c +// determine the tapdance state to return +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) { return SINGLE_TAP; } + else { return SINGLE_HOLD; } + } + if (state->count == 2) { return DOUBLE_SINGLE_TAP; } + else { return 3; } // any number higher than the maximum state value you return above +} + +// handle the possible states for each tapdance keycode you define: + +void altlp_finished (qk_tap_dance_state_t *state, void *user_data) { + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + register_code16(KC_LPRN); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here + break; + case DOUBLE_SINGLE_TAP: // allow nesting of 2 parens `((` within tapping term + tap_code16(KC_LPRN); + register_code16(KC_LPRN); + } +} + +void altlp_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (td_state) { + case SINGLE_TAP: + unregister_code16(KC_LPRN); + break; + case SINGLE_HOLD: + unregister_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_LPRN); + } +} + +// define `ACTION_TAP_DANCE_FN_ADVANCED()` for each tapdance keycode, passing in `finished` and `reset` functions +qk_tap_dance_action_t tap_dance_actions[] = { + [ALT_LP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altlp_finished, altlp_reset) +}; +``` + +Wrap each tapdance keycode in `TD()` when including it in your keymap, e.g. `TD(ALT_LP)`. + +### Example 6: Using tap dance for momentary-layer-switch and layer-toggle keys + +Tap Dance can be used to mimic MO(layer) and TG(layer) functionality. For this example, we will set up a key to function as `KC_QUOT` on single-tap, as `MO(_MY_LAYER)` on single-hold, and `TG(_MY_LAYER)` on double-tap. + +The first step is to include the following code towards the beginning of your `keymap.c`: + +``` +typedef struct { + bool is_press_action; + int state; +} tap; + +//Define a type for as many tap dance states as you need +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3 +}; + +enum { + QUOT_LAYR = 0 //Our custom tap dance key; add any other tap dance keys to this enum +}; + +//Declare the functions to be used with your tap dance key(s) + +//Function associated with all tap dances +int cur_dance (qk_tap_dance_state_t *state); + +//Functions associated with individual tap dances +void ql_finished (qk_tap_dance_state_t *state, void *user_data); +void ql_reset (qk_tap_dance_state_t *state, void *user_data); + +//Declare variable to track which layer is active +int active_layer; +``` + +The above code is similar to that used in previous examples. The one point to note is that you need to declare a variable to keep track of what layer is currently the active layer. We'll see why shortly. + +Towards the bottom of your `keymap.c`, include the following code: + +``` +//Update active_layer +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case 1: + active_layer = 1; + break; + case 2: + active_layer = 2; + break; + case 3: + active_layer = 3; + break; + default: + active_layer = 0; + break; + } + return state; +} + +//Determine the current tap dance state +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (!state->pressed) {return SINGLE_TAP;} + else return SINGLE_HOLD; + } else if (state->count == 2) {return DOUBLE_TAP;} + else return 8; +} + +//Initialize tap structure associated with example tap dance key +static tap ql_tap_state = { + .is_press_action = true, + .state = 0 +}; + +//Functions that control what our tap dance key does +void ql_finished (qk_tap_dance_state_t *state, void *user_data) { + ql_tap_state.state = cur_dance(state); + switch (ql_tap_state.state) { + case SINGLE_TAP: tap_code(KC_QUOT); break; + case SINGLE_HOLD: layer_on(_MY_LAYER); break; + case DOUBLE_TAP: + if (active_layer==_MY_LAYER) {layer_off(_MY_LAYER);} + else layer_on(_MY_LAYER); + } +} + +void ql_reset (qk_tap_dance_state_t *state, void *user_data) { + if (ql_tap_state.state==SINGLE_HOLD) {layer_off(_MY_LAYER);} + ql_tap_state.state = 0; +} + +//Associate our tap dance key with its functionality +qk_tap_dance_action_t tap_dance_actions[] = { + [QUOT_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, ql_finished, ql_reset, 275) +}; +``` + +The is where the real logic of our tap dance key gets worked out. Since `layer_state_set_user()` is called on any layer switch, we use it to update `active_layer`. Our example is assuming that your `keymap.c` includes 4 layers, so adjust the switch statement here to fit your actual number of layers. + +The use of `cur_dance()` and `ql_tap_state` mirrors the above examples. + +The `case:SINGLE_TAP` in `ql_finished` is similar to the above examples. The `case:SINGLE_HOLD` works in conjunction with `ql_reset()` to switch to `_MY_LAYER` while the tap dance key is held, and to switch away from `_MY_LAYER` when the key is released. This mirrors the use of `MO(_MY_LAYER)`. The `case:DOUBLE_TAP` works by checking whether `_MY_LAYER` is the active layer, and toggling it on or off accordingly. This mirrors the use of `TG(_MY_LAYER)`. + +`tap_dance_actions[]` works similar to the above examples. Note that I used `ACTION_TAP_DANCE_FN_ADVANCED_TIME()` instead of `ACTION_TAP_DANCE_FN_ADVANCED()`. This is because I like my `TAPPING_TERM` to be short (~175ms) for my non-tap-dance keys but find that this is too quick for me to reliably complete tap dance actions - thus the increased time of 275ms here. + +Finally, to get this tap dance key working, be sure to include `TD(QUOT_LAYR)` in your `keymaps[]`. diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index b1527b848ae..bd1f4fa5ae0 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -1,94 +1,197 @@ # Unicode Support -There are three Unicode keymap definition method available in QMK: +Unicode characters can be input straight from your keyboard! There are some limitations, however. -## UNICODE_ENABLE +QMK has three different methods for enabling Unicode input and defining keycodes: -Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in keymap file, where *n* is a 4 digit hexadecimal. +## Basic Unicode -## UNICODEMAP_ENABLE +This method supports Unicode code points up to `0x7FFF`. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji. -Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(n)` where *n* is the array index of the mapping table. +Add the following to your `rules.mk`: -And you may want to have an enum to make reference easier. So you'd want to add something like this to your keymap: +```make +UNICODE_ENABLE = yes +``` + +Then add `UC(c)` keycodes to your keymap, where _c_ is the code point (preferably in hexadecimal, up to 4 digits long). For example: `UC(0x45B)`, `UC(0x30C4)`. + +## Unicode Map + +This method supports all possible code points (up to `0x10FFFF`); however, you need to maintain a separate mapping table in your keymap file, which may contain at most 16384 entries. + +Add the following to your `rules.mk`: + +```make +UNICODEMAP_ENABLE = yes +``` + +Then add `X(i)` keycodes to your keymap, where _i_ is an array index into the mapping table: ```c -enum unicode_name { - BANG, // ‽ - IRONY, // ⸮ - SNEK // snke 🐍 +enum unicode_names { + BANG, + IRONY, + SNEK }; const uint32_t PROGMEM unicode_map[] = { - [BANG] = 0x0203D, // ‽ - [IRONY] = 0x02E2E, // ⸮ - [SNEK] = 0x1F40D // snke 🐍 -}: + [BANG] = 0x203D, // ‽ + [IRONY] = 0x2E2E, // ⸮ + [SNEK] = 0x1F40D, // 🐍 +}; ``` -Make sure that the order for both matches. +Then you can use `X(BANG)`, `X(SNEK)` etc. in your keymap. + +### Lower and Upper Case + +Characters often come in lower and upper case pairs, such as å and Å. To make inputting these characters easier, you can use `XP(i, j)` in your keymap, where _i_ and _j_ are the mapping table indices of the lower and upper case character, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the second (upper case) character will be inserted; otherwise, the first (lower case) version will appear. + +This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key by using `XP()`. This helps blend Unicode keys in with regular alphas. + +Due to keycode size constraints, _i_ and _j_ can each only refer to one of the first 128 characters in your `unicode_map`. In other words, 0 ≤ _i_ ≤ 127 and 0 ≤ _j_ ≤ 127. This is enough for most use cases, but if you'd like to customize the index calculation, you can override the [`unicodemap_index()`](https://github.com/qmk/qmk_firmware/blob/71f640d47ee12c862c798e1f56392853c7b1c1a8/quantum/process_keycode/process_unicodemap.c#L40) function. This also allows you to, say, check Ctrl instead of Shift/Caps. + +## UCIS -## UCIS_ENABLE +This method also supports all possible code points. As with the Unicode Map method, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you have to create a custom keycode or function that invokes this functionality. -Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to main a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence. +Add the following to your `rules.mk`: -For instance, you would need to have a table like this in your keymap: +```make +UCIS_ENABLE = yes +``` + +Then define a table like this in your keymap file: ```c -const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE -( - UCIS_SYM("poop", 0x1f4a9), - UCIS_SYM("rofl", 0x1f923), - UCIS_SYM("kiss", 0x1f619) +const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE( + UCIS_SYM("poop", 0x1F4A9), // 💩 + UCIS_SYM("rofl", 0x1F923), // 🤣 + UCIS_SYM("kiss", 0x1F619) // 😙 ); ``` -You run the function, and then type "rofl" and hit enter, it should backspace remove "rofl" and input the `0x1f923` unicode. +To use it, call `qk_ucis_start()`. Then, type the mnemonic for the character (such as "rofl"), and hit Space or Enter. QMK should erase the "rofl" text and insert the laughing emoji. ### Customization -There are several functions that you can add to your keymap to customize the functionality of this feature. +There are several functions that you can define in your keymap to customize the functionality of this feature. + +* `void qk_ucis_start_user(void)` – This runs when you call the "start" function, and can be used to provide feedback. By default, it types out a keyboard emoji. +* `void qk_ucis_success(uint8_t symbol_index)` – This runs when the input has matched something and has completed. By default, it doesn't do anything. +* `void qk_ucis_symbol_fallback (void)` – This runs when the input doesn't match anything. By default, it falls back to trying that input as a Unicode code. + +You can find the default implementations of these functions in [`process_ucis.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_ucis.c). + +## Input Modes + +Unicode input in QMK works by inputting a sequence of characters to the OS, sort of like a macro. Unfortunately, the way this is done differs for each platform. Specifically, each platform requires a different combination of keys to trigger Unicode input. Therefore, a corresponding input mode has to be set in QMK. + +The following input modes are available: + +* **`UC_OSX`**: macOS built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with Unicode Map). + + To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar. + By default, this mode uses the left Option key (`KC_LALT`) for Unicode input, but this can be changed by defining [`UNICODE_KEY_OSX`](#input-key-configuration) with another keycode. + + !> Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as Option + Left Arrow and Option + Right Arrow. + +* **`UC_LNX`**: Linux built-in IBus Unicode input. Supports code points up to `0x10FFFF` (all possible code points). + + Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else. + By default, this mode uses Ctrl+Shift+U (`LCTL(LSFT(KC_U))`) to start Unicode input, but this can be changed by defining [`UNICODE_KEY_LNX`](#input-key-configuration) with another keycode. This might be required for IBus versions ≥1.5.15, where Ctrl+Shift+U behavior is consolidated into Ctrl+Shift+E. + +* **`UC_WIN`**: _(not recommended)_ Windows built-in hex numpad Unicode input. Supports code points up to `0xFFFF`. + + To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Reboot afterwards. + This mode is not recommended because of reliability and compatibility issues; use the `UC_WINC` mode instead. -* `void qk_ucis_start_user(void)` - This runs when you run the "start" function, and can be used to provide feedback. By default, it types out a keyboard emoji. -* `void qk_ucis_success(uint8_t symbol_index)` - This runs when the unicode input has matched something, and has completed. Default doesn't do anything. -* `void qk_ucis_symbol_fallback (void)` - This runs if the input text doesn't match anything. The default function falls back to trying that input as a unicode code. +* **`UC_BSD`**: _(non implemented)_ Unicode input under BSD. Not implemented at this time. If you're a BSD user and want to help add support for it, please [open an issue on GitHub](https://github.com/qmk/qmk_firmware/issues). -The default code for these are: +* **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.9.0, supports code points up to `0x10FFFF` (all possible code points). + + To enable, install the [latest release](https://github.com/samhocevar/wincompose/releases/latest). Once installed, WinCompose will automatically run on startup. Works reliably under all version of Windows supported by the app. + By default, this mode uses right Alt (`KC_RALT`) as the Compose key, but this can be changed in the WinCompose settings and by defining [`UNICODE_KEY_WINC`](#input-key-configuration) with another keycode. + +### Switching Input Modes + +There are two ways to set the input mode for Unicode: by keycode or by function. Keep in mind that both methods write to persistent storage (EEPROM), and are loaded each time the keyboard starts. So once you've set it the first time, you don't need to set it again unless you want to change it, or you've reset the EEPROM settings. + +You can switch the input mode at any time by using one of the following keycodes. The easiest way is to add the ones you use to your keymap. + +|Keycode |Alias |Input Mode |Description | +|----------------------|---------|------------|--------------------------------------------------------------| +|`UNICODE_MODE_FORWARD`|`UC_MOD` |Next in list|[Cycle](#input-mode-cycling) through selected modes | +|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Prev in list|[Cycle](#input-mode-cycling) through selected modes in reverse| +|`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to macOS input | +|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input | +|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input | +|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented) | +|`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose | + +You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). Since the function only needs to be called once, it's recommended that you do it in `eeconfig_init_user()` (or a similar function). For example: ```c -void qk_ucis_start_user(void) { // outputs keyboard emoji - unicode_input_start(); - register_hex(0x2328); - unicode_input_finish(); +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_LNX); } +``` -void qk_ucis_success(uint8_t symbol_index) { -} +### Audio Feedback -void qk_ucis_symbol_fallback (void) { // falls back to manual unicode entry - for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) { - uint8_t code = qk_ucis_state.codes[i]; - register_code(code); - unregister_code(code); - wait_ms(UNICODE_TYPE_DELAY); - } -} +If you have the [Audio feature](feature_audio.md) enabled on the board, you can set melodies to be played when you press the above keys. That way you can have some audio feedback when switching input modes. + +For instance, you can add these definitions to your `config.h` file: + +```c +#define UNICODE_SONG_OSX COIN_SOUND +#define UNICODE_SONG_LNX UNICODE_LINUX +#define UNICODE_SONG_BSD MARIO_GAMEOVER +#define UNICODE_SONG_WIN UNICODE_WINDOWS +#define UNICODE_SONG_WINC UNICODE_WINDOWS ``` -## Unicode Input methods +### Additional Customization + +Because Unicode is a large and versatile feature, there are a number of options you can customize to make it work better on your system. + +#### Start and Finish Input Functions -Unicode input in QMK works by inputting a sequence of characters to the OS, -sort of like macro. Unfortunately, each OS has different ideas on how Unicode is input. +The functions for starting and finishing Unicode input on your platform can be overridden locally. Possible uses include customizing input mode behavior if you don't use the default keys, or adding extra visual/audio feedback to Unicode input. -This is the current list of Unicode input method in QMK: +* `void unicode_input_start(void)` – This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it presses Ctrl+Shift+U on Linux and holds the Option key on macOS. +* `void unicode_input_finish(void)` – This is called to exit Unicode input mode, for example by pressing Space or releasing the Option key. -* __UC_OSX__: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. -* __UC_OSX_RALT__: Same as UC_OSX, but sends the Right Alt key for unicode input -* __UC_LNX__: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. -* __UC_WIN__: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead. -* __UC_WINC__: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows. +You can find the default implementations of these functions in [`process_unicode_common.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode_common.c). + +#### Input Key Configuration + +You can customize the keys used to trigger Unicode input for macOS, Linux and WinCompose by adding corresponding defines to your `config.h`. The default values match the platforms' default settings, so you shouldn't need to change this unless Unicode input isn't working, or you want to use a different key (e.g. in order to free up left or right Alt). + +|Define |Type |Default |Example | +|------------------|----------|------------------|-------------------------------------------| +|`UNICODE_KEY_OSX` |`uint8_t` |`KC_LALT` |`#define UNICODE_KEY_OSX KC_RALT` | +|`UNICODE_KEY_LNX` |`uint16_t`|`LCTL(LSFT(KC_U))`|`#define UNICODE_KEY_LNX LCTL(LSFT(KC_E))`| +|`UNICODE_KEY_WINC`|`uint8_t` |`KC_RALT` |`#define UNICODE_KEY_WINC KC_RGUI` | + +#### Input Mode Cycling + +You can choose which input modes are available for cycling through. By default, this is disabled. If you want to enable it, limiting it to just the modes you use makes sense. Note that the values in the list are comma-delimited. + +```c +#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_WINC +``` + +You can cycle through the selected modes by using the `UC_MOD`/`UC_RMOD` keycodes, or by calling `cycle_unicode_input_mode(offset)` in your code (`offset` is how many modes to move forward by, so +1 corresponds to `UC_MOD`). + +By default, when the keyboard boots, it will initialize the input mode to the last one you used. You can disable this and make it start with the first mode in the list every time by adding the following to your `config.h`: + +```c +#define UNICODE_CYCLE_PERSIST false +``` -At some point, you need to call `set_unicode_input_mode(x)` to set the correct unicode method. This sets the method that is used to send the unicode, and stores it in EEPROM, so you only need to call this once. +!> Using `UNICODE_SELECTED_MODES` means you don't have to initially set the input mode in `matrix_init_user()` (or a similar function); the Unicode system will do that for you on startup. This has the added benefit of avoiding unnecessary writes to EEPROM. ## `send_unicode_hex_string` @@ -123,7 +226,7 @@ AutoHotkey inserts the Text right of `Send, ` when this combination is pressed. ### US International -If you enable the US International layout on the system, it will use punctuation to accent the characters. +If you enable the US International layout on the system, it will use punctuation to accent the characters. For instance, typing "`a" will result in à. diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md index 5a9fc287b3e..2f119c8bde5 100644 --- a/docs/feature_userspace.md +++ b/docs/feature_userspace.md @@ -110,7 +110,7 @@ QMK has a bunch of [functions](custom_quantum_functions.md) that have [`_quantum However, you can actually add support for keymap version, so that you can use it in both your userspace and your keymap! -For instance, lets looks at the `layer_state_set_user` function. Lets enable the [Tri Layer State](ref_functions.md#olkb-tri-layers) functionalitly to all of our boards, and then still have your `keymap.c` still able to use this functionality. +For instance, let's look at the `layer_state_set_user()` function. You can enable the [Tri Layer State](ref_functions.md#olkb-tri-layers) functionality on all of your boards, while also retaining the Tri Layer functionality in your `keymap.c` files. In your `` file, you'd want to add this: ```c @@ -201,27 +201,51 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case KC_MAKE: - if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP -#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) - ":dfu " -#elif defined(BOOTLOADER_HALFKAY) - ":teensy " -#elif defined(BOOTLOADER_CATERINA) - ":avrdude " -#endif - SS_TAP(X_ENTER)); - } - return false; - break; + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) { + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); clear_oneshot_mods(); + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP); + #ifndef FLASH_BOOTLOADER + if ( (temp_mod | temp_osm) & MOD_MASK_SHIFT ) + #endif + { // + #if defined(__arm__) // only run for ARM boards + SEND_STRING(":dfu-util"); + #elif defined(BOOTLOADER_DFU) // only run for DFU boards + SEND_STRING(":dfu"); + #elif defined(BOOTLOADER_HALFKAY) // only run for teensy boards + SEND_STRING(":teensy"); + #elif defined(BOOTLOADER_CATERINA) // only run for Pro Micros + SEND_STRING(":avrdude"); + #endif // bootloader options + } + if ( (temp_mod | temp_osm) & MOD_MASK_CTRL) { + SEND_STRING(" -j8 --output-sync"); + } + SEND_STRING(SS_TAP(X_ENTER)); + set_mods(temp_mod); + } + break; + } return process_record_keymap(keycode, record); } ``` +For boards that may not have a shift button (such as on a macro pad), we need a way to always include the bootloader option. To do that, add the following to the `rules.mk` in your userspace folder: + +```make +ifeq ($(strip $(FLASH_BOOTLOADER)), yes) + OPT_DEFS += -DFLASH_BOOTLOADER +endif +``` + This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make :`, making frequent compiling easier. And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time. -Additionally, this should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely (and will dump the HEX in the ".build" folder instead). +Also, holding `shift` will add the appropriate flashing command (`:dfu`, `:teensy`, `:avrdude`, `:dfu-util`) for a majority of keyboards. Holding `control` will add some commands that will speed up compiling time by processing multiple files at once. +And for the boards that lack a shift key, or that you want to always attempt the flashing part, you can add `FLASH_BOOTLOADER = yes` to the `rules.mk` of that keymap. +?> This should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely. And this doesn't support BootloadHID or mdloader. diff --git a/docs/feature_velocikey.md b/docs/feature_velocikey.md new file mode 100644 index 00000000000..5d98410735b --- /dev/null +++ b/docs/feature_velocikey.md @@ -0,0 +1,30 @@ +# Velocikey + +Velocikey is a feature that lets you control the speed of lighting effects (like the Rainbow Swirl effect) with the speed of your typing. The faster you type, the faster the lights will go! + +## Usage +For Velocikey to take effect, there are two steps. First, when compiling your keyboard, you'll need to set `VELOCIKEY_ENABLE=yes` in `rules.mk`, e.g.: + +``` +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +STENO_ENABLE = no +EXTRAKEY_ENABLE = yes +VELOCIKEY_ENABLE = yes +``` + +Then, while using your keyboard, you need to also turn it on with the VLK_TOG keycode, which toggles the feature on and off. + +The following light effects will all be controlled by Velocikey when it is enabled: + - RGB Breathing + - RGB Rainbow Mood + - RGB Rainbow Swirl + - RGB Snake + - RGB Knight + +Support for LED breathing effects is planned but not available yet. + + As long as Velocikey is enabled, it will control the speed regardless of any other speed setting that your RGB lights are currently on. + + ## Configuration + Velocikey doesn't currently support any configuration via keyboard settings. If you want to adjust something like the speed increase or decay rate, you would need to edit `velocikey.c` and adjust the values there to achieve the kinds of speeds that you like. diff --git a/docs/features.md b/docs/features.md index 537e1061cdd..f230c7c233c 100644 --- a/docs/features.md +++ b/docs/features.md @@ -7,19 +7,30 @@ QMK has a staggering number of features for building your keyboard. It can take * [Audio](feature_audio.md) - Connect a speaker to your keyboard for audio feedback, midi support, and music mode. * [Auto Shift](feature_auto_shift.md) - Tap for the normal key, hold slightly longer for its shifted state. * [Backlight](feature_backlight.md) - LED lighting support for your keyboard. +* [Bluetooth](feature_bluetooth.md) - BlueTooth support for your keyboard. * [Bootmagic](feature_bootmagic.md) - Adjust the behavior of your keyboard using hotkeys. +* [Combos](feature_combo.md) - Custom actions for multiple key holds. +* [Command](feature_command.md) - Runtime version of bootmagic (Formerly known as "Magic"). +* [Debounce API](feature_debounce_type.md) - Customization of debouncing algorithms, and the ability to add more/custom debouncing. * [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself. +* [Encoders](feature_encoders.md) - Rotary encoders! +* [Grave Escape](feature_grave_esc.md) - Lets you use a single key for Esc and Grave. +* [Haptic Feedback](feature_haptic_feedback.md) - Add haptic feedback drivers to your board. * [HD44780 LCD Display](feature_hd44780.md) - Support for LCD character displays using the HD44780 standard. * [Key Lock](feature_key_lock.md) - Lock a key in the "down" state. * [Layouts](feature_layouts.md) - Use one keymap with any keyboard that supports your layout. * [Leader Key](feature_leader_key.md) - Tap the leader key followed by a sequence to trigger custom behavior. +* [LED Matrix](feature_led_matrix.md) - LED Matrix single color lights for per key lighting (Single Color, not RGB). * [Macros](feature_macros.md) - Send multiple key presses when pressing only one physical key. * [Mouse keys](feature_mouse_keys.md) - Control your mouse pointer from your keyboard. +* [OLED Driver](feature_oled_driver.md) - Add OLED screens to your keyboard. +* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) - Sticky Keys, lets you hit a key rather than holding it. * [Pointing Device](feature_pointing_device.md) - Framework for connecting your custom pointing device to your keyboard. * [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard. * [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard. * [RGB Matrix](feature_rgb_matrix.md) - RGB Matrix lights for per key lighting. -* [Space Cadet](feature_space_cadet_shift.md) - Use your left/right shift keys to type parenthesis and brackets. +* [Space Cadet](feature_space_cadet.md) - Use your left/right shift keys to type parenthesis and brackets. +* [Split Keyboard](feature_split_keyboard.md) * [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use. * [Swap Hands](feature_swap_hands.md) - Mirror your keyboard for one handed usage. * [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want. @@ -27,3 +38,4 @@ QMK has a staggering number of features for building your keyboard. It can take * [Thermal Printer](feature_thermal_printer.md) - Connect a thermal printer to your keyboard to be able to toggle on a printed log of everything you type. * [Unicode](feature_unicode.md) - Unicode input support. * [Userspace](feature_userspace.md) - Share code between different keymaps and keyboards. +* [Velocikey](feature_velocikey.md) - Allows changes in RGB animation speed based on WPM/Typing speed. diff --git a/docs/flashing.md b/docs/flashing.md index 1edbe222536..833b9dd629f 100644 --- a/docs/flashing.md +++ b/docs/flashing.md @@ -49,9 +49,18 @@ To generate this bootloader, use the `bootloader` target, eg `make planck/rev4:d To generate a production-ready .hex file (containing the application and the bootloader), use the `production` target, eg `make planck/rev4:default:production`. +### DFU commands + +There are a number of DFU commands that you can use to flash firmware to a DFU device: + +* `:dfu` - This is the normal option and waits until a DFU device is available, and then flashes the firmware. This will check every 5 seconds, to see if a DFU device has appeared. +* `:dfu-ee` - This flashes an `eep` file instead of the normal hex. This is uncommon. +* `:dfu-split-left` - This flashes the normal firmware, just like the default option (`:dfu`). However, this also flashes the "Left Side" EEPROM file for split keyboards. _This is ideal for Elite C based split keyboards._ +* `:dfu-split-right` - This flashes the normal firmware, just like the default option (`:dfu`). However, this also flashes the "Right Side" EEPROM file for split keyboards. _This is ideal for Elite C based split keyboards._ + ## Caterina -Arduino boards and their clones use the [Caterina bootloader](https://github.com/arduino/Arduino/tree/master/hardware/arduino/avr/bootloaders/caterina) (any keyboard built with a Pro Micro, or clone), and uses the avr109 protocol to communicate through virtual serial. Bootloaders like [A-Star](https://www.pololu.com/docs/0J61/9) are based on Caterina. +Arduino boards and their clones use the [Caterina bootloader](https://github.com/arduino/ArduinoCore-avr/tree/master/bootloaders/caterina) (any keyboard built with a Pro Micro, or clone), and uses the avr109 protocol to communicate through virtual serial. Bootloaders like [A-Star](https://www.pololu.com/docs/0J61/9) are based on Caterina. To ensure compatibility with the Caterina bootloader, make sure this block is present your `rules.mk`: @@ -71,8 +80,8 @@ Flashing sequence: 1. Press the `RESET` keycode, or short RST to GND quickly (you only have 7 seconds to flash once it enters) 2. Wait for the OS to detect the device -4. Flash a .hex file -5. Wait for the device to reset automatically +3. Flash a .hex file +4. Wait for the device to reset automatically or @@ -84,6 +93,7 @@ or if you want to flash multiple boards, use the following command When you're done flashing boards, you'll need to hit Ctrl + C or whatever the correct keystroke is for your operating system to break the loop. + ## Halfkay Halfkay is a super-slim protocol developed by PJRC that uses HID, and come on all Teensys (namely the 2.0). @@ -106,5 +116,62 @@ Flashing sequence: 1. Press the `RESET` keycode, or short RST to GND quickly (you only have 7 seconds to flash once it enters) 2. Wait for the OS to detect the device -4. Flash a .hex file -5. Reset the device into application mode (may be done automatically) +3. Flash a .hex file +4. Reset the device into application mode (may be done automatically) + +## USBasploader + +USBasploader is a bootloader developed by matrixstorm. It is used in some non-USB AVR chips such as the ATmega328P, which run V-USB. + +To ensure compatibility with the USBasploader bootloader, make sure this block is present in your `rules.mk`: + + # Bootloader + # This definition is optional, and if your keyboard supports multiple bootloaders of + # different sizes, comment this out, and the correct address will be loaded + # automatically (+60). See bootloader.mk for all options. + BOOTLOADER = USBasp + +Compatible flashers: + +* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI) +* [avrdude](http://www.nongnu.org/avrdude/) with the `usbasp` programmer +* [AVRDUDESS](https://github.com/zkemble/AVRDUDESS) + +Flashing sequence: + +1. Press the `RESET` keycode, or keep the boot pin shorted to GND while quickly shorting RST to GND +2. Wait for the OS to detect the device +3. Flash a .hex file +4. Reset the device into application mode (may be done automatically) + +## STM32 + +All STM32 chips come preloaded with a factory bootloader that cannot be modified nor deleted. Some STM32 chips have bootloaders that do not come with USB programming (e.g. STM32F103) but the process is still the same. + +At the moment, no `BOOTLOADER` variable is needed on `rules.mk` for STM32. + +Compatible flashers: + +* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI) +* [dfu-util](https://github.com/Stefan-Schmidt/dfu-util) / `:dfu-util` (recommended command line) + +Flashing sequence: + +1. Enter the bootloader using any of the following methods: + * Tap the `RESET` keycode (may not work on STM32F042 devices) + * If a reset circuit is present, tap the RESET button + * Otherwise, you need to bridge BOOT0 to VCC (via BOOT0 button or bridge), short RESET to GND (via RESET button or bridge), and then let go of the BOOT0 bridge +2. Wait for the OS to detect the device +3. Flash a .bin file + * You will receive a warning about the DFU signature; Just ignore it +4. Reset the device into application mode (may be done automatically) + * If you are building from command line (e.g. `make planck/rev6:default:dfu-util`), make sure that `:leave` is passed to the `DFU_ARGS` variable inside your `rules.mk` (e.g. `DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave`) so that your device resets after flashing + +### STM32 Commands + +There are a number of DFU commands that you can use to flash firmware to a STM32 device: + +* `:dfu-util` - The default command for flashing to STM32 devices. +* `:dfu-util-wait` - This works like the default command, but it gives you a (configurable) 10 second timeout before it attempts to flash the firmware. You can use `TIME_DELAY=20` from the command line to change the timeout. + * Eg: `make ::dfu-util TIME_DELAY=5` +* `:st-link-cli` - This allows you to flash the firmware via ST-LINK's CLI utility, rather than dfu-util. diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index 587dece4a15..268cc94c380 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -4,7 +4,9 @@ This page describes setting up the build environment for QMK. These instructions -Note: If it is your first time here, Check out the "Complete Newbs guide" instead +**Note:** If this is your first time here, check out the [Complete Newbs Guide](newbs.md) page. + +Before continuing, double check that your submodules (third-party libraries) are up to date by running `make git-submodule`. ## Linux @@ -41,6 +43,10 @@ Debian / Ubuntu example: Fedora / Red Hat example: sudo dnf install gcc unzip wget zip dfu-util dfu-programmer avr-gcc avr-libc binutils-avr32-linux-gnu arm-none-eabi-gcc-cs arm-none-eabi-binutils-cs arm-none-eabi-newlib + +Arch / Manjaro example: + + pacman -S base-devel gcc unzip wget zip avr-gcc avr-binutils avr-libc dfu-util arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib git dfu-programmer dfu-util ## Nix @@ -56,13 +62,14 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands: brew tap osx-cross/avr brew tap PX4/homebrew-px4 brew update - brew install avr-gcc@7 + brew install avr-gcc@8 + brew link --force avr-gcc@8 brew install dfu-programmer brew install dfu-util brew install gcc-arm-none-eabi brew install avrdude -This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of `avr-gcc@7` can take over 20 minutes and exhibit high CPU usage. +This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of `avr-gcc@8` can take over 20 minutes and exhibit high CPU usage. ## Windows with msys2 (recommended) @@ -122,24 +129,27 @@ If you have trouble and want to ask for help, it is useful to generate a *Win_Ch ## Docker -If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap: - +If this is a bit complex for you, Docker might be the turnkey solution you need. After installing [Docker CE](https://docs.docker.com/install/#supported-platforms), run the following command from the `qmk_firmware` directory to build a keyboard/keymap: ```bash -# You'll run this every time you want to build a keymap -# modify the keymap and keyboard assignment to compile what you want -# defaults are ergodox/default - -docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware +util/docker_build.sh keyboard:keymap +# For example: util/docker_build.sh ergodox_ez:steno ``` +This will compile the desired keyboard/keymap and leave the resulting `.hex` or `.bin` file in the QMK directory for you to flash. If `:keymap` is omitted, the `default` keymap is used. Note that the parameter format is the same as when building with `make`. -On Windows Docker seems to have issues with the VOLUME tag in Dockerfile, and `$('pwd')` won't print a Windows compliant path; use full path instead, like this: - +You can also start the script without any parameters, in which case it will ask you to input the build parameters one by one, which you may find easier to use: ```bash -docker run -e keymap=default -e keyboard=ergodox_ez --rm -v D:/Users/Sacapuces/Documents/Repositories/qmk:/qmk:rw edasque/qmk_firmware +util/docker_build.sh +# Reads parameters as input (leave blank for defaults) +``` +There is also support for building _and_ flashing the keyboard straight from Docker by specifying the `target` as well: +```bash +util/docker_build.sh keyboard:keymap:target +# For example: util/docker_build.sh planck/rev6:default:dfu-util ``` +If you're on Linux, this should work out of the box. On Windows and macOS, it requires [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) to be running. This is tedious to set up, so it's not recommended; use [QMK Toolbox](https://github.com/qmk/qmk_toolbox) instead. -This will compile the targeted keyboard/keymap and leave it in your QMK directory for you to flash. +!> Docker for Windows requires [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) to be enabled. This means that it cannot work on versions of Windows which don't have Hyper-V, such as Windows 7, Windows 8 and **Windows 10 Home**. ## Vagrant If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [vagrant guide](getting_started_vagrant.md). diff --git a/docs/getting_started_introduction.md b/docs/getting_started_introduction.md index 3b6a488ed60..e183d77eeb5 100644 --- a/docs/getting_started_introduction.md +++ b/docs/getting_started_introduction.md @@ -12,11 +12,17 @@ Within the folder `users` is a directory for each user. This is a place for user ### Keyboard Project Structure -Within the folder `keyboards` and its subfolder `handwired` is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within it you'll find the following structure: +Within the folder `keyboards`, its subfolder `handwired` and its vendor and manufacture subdirectories e.g. `clueboard` is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard/2x1800`. Within it, you'll find the following structure: * `keymaps/`: Different keymaps that can be built * `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `rules.mk`. * `config.h`: The file that sets the default compile time options. Do not edit this file directly, instead use a keymap specific `config.h`. +* `info.json`: The file used for setting layout for QMK Configurator. See [Configurator Support](reference_configurator_support.md) for more information. +* `readme.md`: A brief overview of the keyboard. +* `.h`: This file is where the keyboard layout is defined against the keyboard's switch matrix. +* `.c`: This file is where you can find custom code for the keyboard. + +For more information on project structure, see [QMK Keyboard Guidelines](hardware_keyboard_guidelines.md). ### Keymap Structure diff --git a/docs/getting_started_make_guide.md b/docs/getting_started_make_guide.md index e515411901d..75eafd42ccc 100644 --- a/docs/getting_started_make_guide.md +++ b/docs/getting_started_make_guide.md @@ -93,19 +93,17 @@ This enables MIDI sending and receiving with your keyboard. To enter MIDI send m `UNICODE_ENABLE` -This allows you to send unicode symbols via `UC()` in your keymap. Only codes up to 0x7FFF are currently supported. +This allows you to send Unicode characters using `UC()` in your keymap. Code points up to `0x7FFF` are supported. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji. `UNICODEMAP_ENABLE` -This allows sending unicode symbols using `X()` in your keymap. Codes -up to 0xFFFFFFFF are supported, including emojis. You will need to maintain -a separate mapping table in your keymap file. +This allows you to send Unicode characters using `X()` in your keymap. You will need to maintain a mapping table in your keymap file. All possible code points (up to `0x10FFFF`) are supported. -Known limitations: -- Under Mac OS, only codes up to 0xFFFF are supported. -- Under Linux ibus, only codes up to 0xFFFFF are supported (but anything important is still under this limit for now). +`UCIS_ENABLE` -Characters out of range supported by the OS will be ignored. +This allows you to send Unicode characters by inputting a mnemonic corresponding to the character you want to send. You will need to maintain a mapping table in your keymap file. All possible code points (up to `0x10FFFF`) are supported. + +For further details, as well as limitations, see the [Unicode page](feature_unicode.md). `BLUETOOTH_ENABLE` @@ -117,7 +115,7 @@ This allows you output audio on the C6 pin (needs abstracting). See the [audio p `FAUXCLICKY_ENABLE` -Uses buzzer to emulate clicky switches. A cheap imitation of the Cherry blue switches. By default, uses the C6 pin, same as AUDIO_ENABLE. +Uses buzzer to emulate clicky switches. A cheap imitation of the Cherry blue switches. By default, uses the C6 pin, same as `AUDIO_ENABLE`. `VARIABLE_TRACE` @@ -137,6 +135,18 @@ This enables [key lock](feature_key_lock.md). This consumes an additional 260 by This enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common +`SPLIT_TRANSPORT` + +As there is no standard split communication driver for ARM-based split keyboards yet, `SPLIT_TRANSPORT = custom` must be used for these. It will prevent the standard split keyboard communication code (which is AVR-specific) from being included, allowing a custom implementation to be used. + +`CUSTOM_MATRIX` + +Lets you replace the default matrix scanning routine with your own code. You will need to provide your own implementations of matrix_init() and matrix_scan(). + +`DEBOUNCE_TYPE` + +Lets you replace the default key debouncing routine with an alternative one. If `custom` you will need to provide your own implementation. + ## Customizing Makefile Options on a Per-Keymap Basis If your keymap directory has a file called `rules.mk` any options you set in that file will take precedence over other `rules.mk` options for your particular keyboard. diff --git a/docs/getting_started_vagrant.md b/docs/getting_started_vagrant.md index 848a43a1f9c..b62524271c2 100644 --- a/docs/getting_started_vagrant.md +++ b/docs/getting_started_vagrant.md @@ -1,16 +1,20 @@ # Vagrant Quick Start -This project includes a Vagrantfile that will allow you to build a new firmware for your keyboard very easily without major changes to your primary operating system. This also ensures that when you clone the project and perform a build, you have the exact same environment as anyone else using the Vagrantfile to build. This makes it much easier for people to help you troubleshoot any issues you encounter. +This project includes a `Vagrantfile` that will allow you to build a new firmware for your keyboard very easily without major changes to your primary operating system. This also ensures that when you clone the project and perform a build, you have the exact same environment as anyone else using the Vagrantfile to build. This makes it much easier for people to help you troubleshoot any issues you encounter. ## Requirements -Using the `/Vagrantfile` in this repository requires you have [Vagrant](http://www.vagrantup.com/) as well as [VirtualBox](https://www.virtualbox.org/) (or [VMware Workstation](https://www.vmware.com/products/workstation) and [Vagrant VMware plugin](http://www.vagrantup.com/vmware) but the (paid) VMware plugin requires a licensed copy of VMware Workstation/Fusion). +Using the `Vagrantfile` in this repository requires you have [Vagrant](http://www.vagrantup.com/) as well as a supported provider installed: -*COMPATIBILITY NOTICE* Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12. **Alternately, you can try running the following command:** `vagrant plugin install vagrant-vbguest` +* [VirtualBox](https://www.virtualbox.org/) (Version at least 5.0.12) + * Sold as 'the most accessible platform to use Vagrant' +* [VMware Workstation](https://www.vmware.com/products/workstation) and [Vagrant VMware plugin](http://www.vagrantup.com/vmware) + * The (paid) VMware plugin requires a licensed copy of VMware Workstation/Fusion +* [Docker](https://www.docker.com/) -Other than having Vagrant and Virtualbox installed and possibly a restart of your computer afterwards, you can simple run a 'vagrant up' anywhere inside the folder where you checked out this project and it will start a Linux virtual machine that contains all the tools required to build this project. There is a post Vagrant startup hint that will get you off on the right foot, otherwise you can also reference the build documentation below. +Other than having Vagrant, a suitable provider installed and possibly a restart of your computer afterwards, you can simple run a 'vagrant up' anywhere inside the folder where you checked out this project and it will start an environment (either a virtual machine or container) that contains all the tools required to build this project. There is a post Vagrant startup hint that will get you off on the right foot, otherwise you can also reference the build documentation below. -# Flashing the Firmware +## Flashing the Firmware The "easy" way to flash the firmware is using a tool from your host OS: @@ -19,3 +23,35 @@ The "easy" way to flash the firmware is using a tool from your host OS: * [Atmel FLIP](http://www.atmel.com/tools/flip.aspx) If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version. + +## Vagrantfile Overview +The development environment is configured to run the QMK Docker image, `qmkfm/base_container`. This not only ensures predictability between systems, it also mirrors the CI environment. + +## FAQ + +### Why am I seeing issues under Virtualbox? +Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12. **Alternately, you can try running the following command:** + +```console +vagrant plugin install vagrant-vbguest +``` + +### How do I remove an existing environment? +Finished with your environment? From anywhere inside the folder where you checked out this project, Execute: + +```console +vagrant destory +``` + +### What if I want to use Docker directly? +Want to benefit from the Vagrant workflow without a virtual machine? The Vagrantfile is configured to bypass running a virtual machine, and run the container directly. Execute the following when bringing up the environment to force the use of Docker: +```console +vagrant up --provider=docker +``` + +### How do I access the virtual machine instead of the Docker container? +Execute the following to bypass the `vagrant` user booting directly to the official qmk builder image: + +```console +vagrant ssh -c 'sudo -i' +``` \ No newline at end of file diff --git a/docs/hand_wire.md b/docs/hand_wire.md index 1cbc16dfea8..25db9341b88 100644 --- a/docs/hand_wire.md +++ b/docs/hand_wire.md @@ -185,21 +185,30 @@ When you're done with the columns, start with the rows in the same process, from As you move along, be sure that the Teensy is staying in place - recutting and soldering the wires is a pain! +## Additional guides + +If you're more of a visual learner, or want some additional tips and something more to follow along, these two visual step by step guides may be helpful: + +- [BrownFox's step by step guide](https://deskthority.net/viewtopic.php?f=7&t=6050) +- [Cribbit's modern hand wiring guide](https://geekhack.org/index.php?topic=87689.0) + # Getting Some Basic Firmware Set Up From here, you should have a working keyboard once you program a firmware. Before we attach the Teensy permanently to the keyboard, let's quickly get some firmware loaded onto the Teensy so we can test each keyswitch. -To start out, download [the firmware](https://github.com/qmk/qmk_firmware/) - we'll be using my (Jack's) fork of TMK called QMK/Quantum. We'll be doing a lot from the Terminal/command prompt, so get that open, along with a decent text editor like [Sublime Text](http://www.sublimetext.com/). +To start out, download [the firmware](https://github.com/qmk/qmk_firmware/) - we'll be using my (Jack's) fork of TMK called QMK/Quantum. We'll be doing a lot from the Terminal/command prompt, so get that open, along with a decent text editor like [Sublime Text](http://www.sublimetext.com/) (paid) or [Visual Studio Code](https://code.visualstudio.com) (free). -The first thing we're going to do is create a new project using the script in the root directory of the firmware. In your terminal, run this command with `` replaced by the name of your project - it'll need to be different from any other project in the `keyboards/` folder: +The first thing we're going to do is create a new keyboard. In your terminal, run this command, which will ask you some questions and generate a basic keyboard project: ``` - util/new_project.sh +./util/new_keyboard.sh ``` You'll want to navigate to the `keyboards//` folder by typing, like the print-out from the script specifies: - cd keyboards/ +``` +cd keyboards/ +``` ### `config.h` @@ -209,7 +218,7 @@ Farther down are `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`. Change their definitio ### `.h` -The next file you'll want to look at is `.h`. You're going to want to rewrite the `KEYMAP` definition - the format and syntax here is extremely important, so pay attention to how things are setup. The first half of the definition are considered the arguments - this is the format that you'll be following in your keymap later on, so you'll want to have as many k*xy* variables here as you do keys. The second half is the part that the firmware actually looks at, and will contain gaps depending on how you wired your matrix. +The next file you'll want to look at is `.h`. You're going to want to rewrite the `LAYOUT` definition - the format and syntax here is extremely important, so pay attention to how things are setup. The first half of the definition are considered the arguments - this is the format that you'll be following in your keymap later on, so you'll want to have as many k*xy* variables here as you do keys. The second half is the part that the firmware actually looks at, and will contain gaps depending on how you wired your matrix. We'll dive into how this will work with the following example. Say we have a keyboard like this: @@ -231,10 +240,10 @@ This can be described by saying the top row is 3 1u keys, and the bottom row is └─────┴─────┘ ``` -The middle column is unused on the bottom row in this example. Our `KEYMAP` definition would look like this: +The middle column is unused on the bottom row in this example. Our `LAYOUT` definition would look like this: ``` - #define KEYMAP( \ + #define LAYOUT( \ k00, k01, k02, \ k10, k11, \ ) \ @@ -256,10 +265,10 @@ Let's say that instead, we wired our keyboard like this (a fair thing to do): └─────┴─────┘ ``` -This would require our `KEYMAP` definition to look like this: +This would require our `LAYOUT` definition to look like this: ``` - #define KEYMAP( \ + #define LAYOUT( \ k00, k01, k02, \ k10, k11, \ ) \ @@ -269,7 +278,7 @@ This would require our `KEYMAP` definition to look like this: } ``` -Notice how the `k11` and `KC_NO` switched places to represent the wiring, and the unused final column on the bottom row. Sometimes it'll make more sense to put a keyswitch on a particular column, but in the end, it won't matter, as long as all of them are accounted for. You can use this process to write out the `KEYMAP` for your entire keyboard - be sure to remember that your keyboard is actually backwards when looking at the underside of it. +Notice how the `k11` and `KC_NO` switched places to represent the wiring, and the unused final column on the bottom row. Sometimes it'll make more sense to put a keyswitch on a particular column, but in the end, it won't matter, as long as all of them are accounted for. You can use this process to write out the `LAYOUT` for your entire keyboard - be sure to remember that your keyboard is actually backwards when looking at the underside of it. ### `keymaps//default.c` @@ -291,7 +300,7 @@ This can be accomplished by using the following `keymaps` definition: ``` const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( /* Base */ + [0] = LAYOUT( /* Base */ KC_A, KC_1, KC_H, \ KC_TAB, KC_SPC \ ), @@ -300,7 +309,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { Note that the layout of the keycodes is similar to the physical layout of our keyboard - this make it much easier to see what's going on. A lot of the keycodes should be fairly obvious, but for a full list of them, check out [Keycodes](keycodes.md) - there are also a lot of aliases to condense your keymap file. -It's also important to use the `KEYMAP` function we defined earlier - this is what allows the firmware to associate our intended readable keymap with the actual wiring. +It's also important to use the `LAYOUT` function we defined earlier - this is what allows the firmware to associate our intended readable keymap with the actual wiring. ## Compiling Your Firmware @@ -319,7 +328,7 @@ Carefully flip your keyboard over, open up a new text document, and try typing - 2. Check the solder joints on the diode - if the diode is loose, part of your row may register, while the other may not. 3. Check the solder joints on the columns - if your column wiring is loose, part or all of the column may not work. 4. Check the solder joints on both sides of the wires going to/from the Teensy - the wires need to be fully soldered and connect to both sides. -5. Check the .h file for errors and incorrectly placed `KC_NO`s - if you're unsure where they should be, instead duplicate a k*xy* variable. +5. Check the `.h` file for errors and incorrectly placed `KC_NO`s - if you're unsure where they should be, instead duplicate a k*xy* variable. 6. Check to make sure you actually compiled the firmware and flashed the Teensy correctly. Unless you got error messages in the terminal, or a pop-up during flashing, you probably did everything correctly. If you've done all of these things, keep in mind that sometimes you might have had multiple things affecting the keyswitch, so it doesn't hurt to test the keyswitch by shorting it out at the end. @@ -328,4 +337,4 @@ If you've done all of these things, keep in mind that sometimes you might have h Now that you have a working board, it's time to get things in their permanent positions. I've often used liberal amounts of hot glue to secure and insulate things, so if that's your style, start spreading that stuff like butter. Otherwise, double-sided tape is always an elegant solution, and electrical tape is a distant second. Due to the nature of these builds, a lot of this part is up to you and how you planned (or didn't plan) things out. -There are a lot of possibilities inside the firmware - explore [docs.qmk.fm](http://docs.qmk.fm) for a full feature list, and dive into the different project (Planck, Clueboard, Ergodox EZ, etc) to see how people use all of them. You can always stop by [the OLKB subreddit for help!](http://reddit.com/r/olkb) +There are a lot of possibilities inside the firmware - explore [docs.qmk.fm](http://docs.qmk.fm) for a full feature list, and dive into the different keyboards (Planck, Clueboard, Ergodox EZ, etc) to see how people use all of them. You can always stop by [the OLKB subreddit for help!](http://reddit.com/r/olkb) diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md index 2c3652a02db..7c28ab6dbcc 100644 --- a/docs/hardware_avr.md +++ b/docs/hardware_avr.md @@ -6,14 +6,26 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_ ## Adding Your AVR Keyboard to QMK -QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script: - -```bash -$ util/new_project.sh my_awesome_keyboard -###################################################### -# /keyboards/my_awesome_keyboard project created. To start -# working on things, cd into keyboards/my_awesome_keyboard -###################################################### +QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started, run the `util/new_keyboard.sh` script: + +``` +$ ./util/new_keyboard.sh +Generating a new QMK keyboard directory + +Keyboard Name: mycoolkb +Keyboard Type [avr]: +Your Name [John Smith]: + +Copying base template files... done +Copying avr template files... done +Renaming keyboard files... done +Replacing %KEYBOARD% with mycoolkb... done +Replacing %YOUR_NAME% with John Smith... done + +Created a new keyboard called mycoolkb. + +To start working on things, cd into keyboards/mycoolkb, +or open the directory in your favourite text editor. ``` This will create all the files needed to support your new keyboard, and populate the settings with default values. Now you just need to customize it for your keyboard. @@ -87,12 +99,30 @@ Once you've defined the size of your matrix you need to define which pins on you The number of `MATRIX_ROW_PINS` entries must be the same as the number you assigned to `MATRIX_ROWS`, and likewise for `MATRIX_COL_PINS` and `MATRIX_COLS`. You do not have to specify `UNUSED_PINS`, but you can if you want to document what pins are open. -Finally, you can specify the direction your diodes point. This can be `COL2ROW`, `ROW2COL`, or `CUSTOM_MATRIX`. +Finally, you can specify the direction your diodes point. This can be `COL2ROW` or `ROW2COL`. ```c #define DIODE_DIRECTION COL2ROW ``` +#### Direct Pin Matrix +To configure a keyboard where each switch is connected to a separate pin and ground instead of sharing row and column pins, use `DIRECT_PINS`. The mapping defines the pins of each switch in rows and columns, from left to right. Must conform to the sizes within `MATRIX_ROWS` and `MATRIX_COLS`, use `NO_PIN` to fill in blank spaces. Overrides the behaviour of `DIODE_DIRECTION`, `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`. + +```c +// #define MATRIX_ROW_PINS { D0, D5 } +// #define MATRIX_COL_PINS { F1, F0, B0 } +#define DIRECT_PINS { \ + { F1, E6, B0, B2, B3 }, \ + { F5, F0, B1, B7, D2 }, \ + { F6, F7, C7, D5, D3 }, \ + { B5, C6, B6, NO_PIN, NO_PIN } \ +} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +//#define DIODE_DIRECTION +``` + ### Backlight Configuration By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md). diff --git a/docs/hardware_drivers.md b/docs/hardware_drivers.md index 4c1266f2241..023e92982cb 100644 --- a/docs/hardware_drivers.md +++ b/docs/hardware_drivers.md @@ -14,9 +14,9 @@ QMK is used on a lot of different hardware. While support for the most common MC Support for addressing pins on the ProMicro by their Arduino name rather than their AVR name. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process. -## SSD1306 (AVR Only) +## SSD1306 OLED Driver -Support for SSD1306 based OLED displays. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process. +Support for SSD1306 based OLED displays. For more information see the [OLED Driver Feature](feature_oled_driver.md) page. ## uGFX @@ -32,4 +32,4 @@ Support for up to 2 drivers. Each driver impliments 2 charlieplex matrices to in ## IS31FL3733 -Support for up to a single driver with room for expansion. Each driver can control 192 individual LEDs or 64 RGB LEDs. For more information on how to setup the driver see the [RGB Matrix](feature_rgb_matrix.md) page. \ No newline at end of file +Support for up to a single driver with room for expansion. Each driver can control 192 individual LEDs or 64 RGB LEDs. For more information on how to setup the driver see the [RGB Matrix](feature_rgb_matrix.md) page. diff --git a/docs/hardware_keyboard_guidelines.md b/docs/hardware_keyboard_guidelines.md index 67af78838a1..c8aec40e072 100644 --- a/docs/hardware_keyboard_guidelines.md +++ b/docs/hardware_keyboard_guidelines.md @@ -1,107 +1,120 @@ # QMK Keyboard Guidelines -We welcome all keyboard projects into QMK, but ask that you try to stick to a couple guidelines that help us keep things organised and consistent. +Since starting, QMK has grown by leaps and bounds thanks to people like you who contribute to creating and maintaining our community keyboards. As we've grown we've discovered some patterns that work well, and ask that you conform to them to make it easier for other people to benefit from your hard work. + ## Naming Your Keyboard/Project -All names should be lowercase alphanumeric, and separated by an underscore (`_`), but not begin with one. Your directory and your `.h` and `.c` files should have exactly the same name. All folders should follow the same format. `test`, `keyboard`, and `all` are reserved by make and are not a valid name for a keyboard. +All keyboard names are in lower case, consisting only of letters, numbers, and underscore (`_`). Names may not begin with an underscore. Forward slash (`/`) is used as a sub-folder separation character. -## `readme.md` +The names `test`, `keyboard`, and `all` are reserved for make commands and may not be used as a keyboard or subfolder name. -All projects need to have a `readme.md` file that explains what the keyboard is, who made it, where it is available, and links to more information. Please follow the [published template](documentation_templates.md#keyboard-readmemd-template). +Valid Examples: -## Image/Hardware Files +* `412_64` +* `chimera_ortho` +* `clueboard/66/rev3` +* `planck` +* `v60_type_r` -In an effort to keep the repo size down, we're no longer accepting images of any format in the repo, with few exceptions. Hosting them elsewhere (imgur) and linking them in the `readme.md` is the preferred method. +## Sub-folders -Any sort of hardware file (plate, case, pcb) can't be stored in qmk_firmware, but we have the [qmk.fm repo](https://github.com/qmk/qmk.fm) where such files (as well as in-depth info) can be stored and viewed on [qmk.fm](http://qmk.fm). Downloadable files are stored in `//` (name follows the same format as above) which are served at `http://qmk.fm//`, and pages are generated from `/_pages//` which are served at the same location (.md files are generated into .html files through Jekyll). Check out the `lets_split` directory for an example. +QMK uses sub-folders both for organization and to share code between revisions of the same keyboard. You can nest folders up to 4 levels deep: -## Keyboard Defaults + qmk_firmware/keyboards/top_folder/sub_1/sub_2/sub_3/sub_4 -Given the amount of functionality that QMK exposes it's very easy to confuse new users. When putting together the default firmware for your keyboard we recommend limiting your enabled features and options to the minimal set needed to support your hardware. Recommendations for specific features follow. +If a sub-folder has a `rules.mk` file it will be considered a compilable keyboard. It will be available in QMK Configurator and tested with `make all`. If you are using a folder to organize several keyboards from the same maker you should not have a `rules.mk` file. -### Bootmagic and Command +Example: -[Bootmagic](feature_bootmagic.md) and [Command](feature_command.md) are two related features that allow a user to control their keyboard in non-obvious ways. We recommend you think long and hard about if you're going to enable either feature, and how you will expose this functionality. Keep in mind that users who want this functionality can enable it in their personal keymaps without affecting all the novice users who may be using your keyboard as their first programmable board. +Clueboard uses sub-folders for both purposes, organization and keyboard revisions. -By far the most common problem new users encounter is accidentally triggering Bootmagic while they're plugging in their keyboard. They're holding the keyboard by the bottom, unknowingly pressing in alt and spacebar, and then they find that these keys have been swapped on them. We recommend leaving this feature disabled by default, but if you do turn it on consider setting `BOOTMAGIC_KEY_SALT` to a key that is hard to press while plugging your keyboard in. +* [`qmk_firmware`](https://github.com/qmk/qmk_firmware/tree/master) + * [`keyboards`](https://github.com/qmk/qmk_firmware/tree/master/keyboards) + * [`clueboard`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard) ← This is the organization folder, there's no `rules.mk` file + * [`60`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/60) ← This is a compilable keyboard, it has a `rules.mk` file + * [`66`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66) ← This is also compilable- it uses `DEFAULT_FOLDER` to specify `rev3` as the default revision + * [`rev1`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev1) ← compilable: `make clueboard/66/rev1` + * [`rev2`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev2) ← compilable: `make clueboard/66/rev2` + * [`rev3`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev3) ← compilable: `make clueboard/66/rev3` or `make clueboard/66` -If your keyboard does not have 2 shift keys you should provide a working default for `IS_COMMAND`, even when you have set `COMMAND_ENABLE = no`. This will give your users a default to conform to if they do enable Command. +## Keyboard Folder Structure -## Custom Keyboard Programming +Your keyboard should be located in `qmk_firmware/keyboards/` and the folder name should be your keyboard's name as described in the previous section. Inside this folder should be several files: -As documented on [Customizing Functionality](custom_quantum_functions.md) you can define custom functions for your keyboard. Please keep in mind that your users may want to customize that behavior as well, and make it possible for them to do that. If you are providing a custom function, for example `process_record_kb()`, make sure that your function calls the `_user()` version of the call too. You should also take into account the return value of the `_user()` version, and only run your custom code if the user returns `true`. +* `readme.md` +* `info.json` +* `config.h` +* `rules.mk` +* `.c` +* `.h` + +### `readme.md` + +All projects need to have a `readme.md` file that explains what the keyboard is, who made it and where it's available. If applicable, it should also contain links to more information, such as the maker's website. Please follow the [published template](documentation_templates.md#keyboard-readmemd-template). + +### `info.json` + +This file is used by the [QMK API](https://github.com/qmk/qmk_api). It contains the information [QMK Configurator](https://config.qmk.fm/) needs to display a representation of your keyboard. You can also set metadata here. For more information see the [reference page](reference_info_json.md). + +### `config.h` + +All projects need to have a `config.h` file that sets things like the matrix size, product name, USB VID/PID, description and other settings. In general, use this file to set essential information and defaults for your keyboard that will always work. -## Keyboard Metadata +### `rules.mk` -As QMK grows so does the ecosystem surrounding QMK. To make it easier for projects in that ecosystem to tie into QMK as we make changes we are developing a metadata system to expose information about keyboards in QMK. +The presence of this file means that the folder is a keyboard target and can be used in `make` commands. This is where you setup the build environment for your keyboard and configure the default set of features. -You can create `info.json` files at every level under `qmk_firmware/keyboards/` to specify this metadata. These files are combined, with more specific files overriding keys in less specific files. This means you do not need to duplicate your metadata information. For example, `qmk_firmware/keyboards/clueboard/info.json` specifies `manufacturer` and `maintainer`, while `qmk_firmware/keyboards/clueboard/66/info.json` specifies more specific information about Clueboard 66%. +### `` -### `info.json` Format +This is where you will write custom code for your keyboard. Typically you will write code to initialize and interface with the hardware in your keyboard. If your keyboard consists of only a key matrix with no LEDs, speakers, or other auxillary hardware this file can be blank. -The `info.json` file is a JSON formatted dictionary with the following keys available to be set. You do not have to set all of them, merely the keys that apply to your keyboard. +The following functions are typically defined in this file: -* `keyboard_name` - * A free-form text string describing the keyboard. - * Example: `Clueboard 66%` -* `url` - * A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard. -* `maintainer` - * GitHub username of the maintainer, or `qmk` for community maintained boards -* `width` - * Width of the board in Key Units -* `height` - * Height of the board in Key Units -* `layouts` - * Physical Layout representations. See the next section for more detail. +* `void matrix_init_kb(void)` +* `void matrix_scan_kb(void)` +* `bool process_record_kb(uint16_t keycode, keyrecord_t *record)` +* `void led_set_kb(uint8_t usb_led)` -#### Layout Format +### `` -Within our `info.json` file the `layouts` portion of the dictionary contains several nested dictionaries. The outer layer consists of QMK layout macros, for example `LAYOUT_ansi` or `LAYOUT_iso`. Within each layout macro are keys for `width`, `height`, and `key_count`, each of which should be self-explanatory. +This file is used to define the matrix for your keyboard. You should define at least one C macro which translates an array into a matrix representing the physical switch matrix for your keyboard. If it's possible to build your keyboard with multiple layouts you should define additional macros. -* `width` - * Optional: The width of the layout in Key Units -* `height` - * Optional: The height of the layout in Key Units -* `key_count` - * **Required**: The number of keys in this layout -* `layout` - * A list of Key Dictionaries describing the physical layout. See the next section for more details. +If you have only a single layout you should call this macro `LAYOUT`. -#### Key Dictionary Format +When defining multiple layouts you should have a base layout, named `LAYOUT_all`, that supports all possible switch positions on your matrix, even if that layout is impossible to build physically. This is the macro you should use in your `default` keymap. You should then have additional keymaps named `default_` that use your other layout macros. This will make it easier for people to use the layouts you define. -Each Key Dictionary in a layout describes the physical properties of a key. If you are familiar with the Raw Code for you will find many of the concepts the same. We re-use the same key names and layout choices wherever possible, but unlike keyboard-layout-editor each key is stateless, inheriting no properties from the keys that came before it. +Layout macro names are entirely lowercase, except for the word `LAYOUT` at the front. -All key positions and rotations are specified in relation to the top-left corner of the keyboard, and the top-left corner of each key. +As an example, if you have a 60% PCB that supports ANSI and ISO you might define the following layouts and keymaps: -* `X` - * **Required**: The absolute position of the key in the horizontal axis, in Key Units. -* `Y` - * **Required**: The absolute position of the key in the vertical axis, in Key Units. -* `W` - * The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1` -* `H` - * The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1` -* `R` - * How many degrees clockwise to rotate the key. -* `RX` - * The absolute position of the point to rotate the key around in the horizontal axis. Default: `x` -* `RY` - * The absolute position of the point to rotate the key around in the vertical axis. Default: `y` -* `KS` - * Key Shape: define a polygon by providing a list of points, in Key Units. - * **Important**: These are relative to the top-left of the key, not absolute. - * Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]` +| Layout Name | Keymap Name | Description | +|-------------|-------------|-------------| +| LAYOUT_all | default | A layout that supports both ISO and ANSI | +| LAYOUT_ansi | default_ansi | An ANSI layout | +| LAYOUT_iso | default_iso | An ISO layout | -### How is the Metadata Exposed? +## Image/Hardware Files + +In an effort to keep the repo size down we're no longer accepting binary files of any format, with few exceptions. Hosting them elsewhere (such as ) and linking them in the `readme.md` is preferred. + +Hardware files (such as plates, cases, pcb) can be contributed to the [qmk.fm repo](https://github.com/qmk/qmk.fm) and they will be made available on [qmk.fm](http://qmk.fm). Downloadable files are stored in `//` (name follows the same format as above) which are served at `http://qmk.fm//`, and pages are generated from `/_pages//` which are served at the same location (.md files are generated into .html files through Jekyll). Check out the `lets_split` folder for an example. + +## Keyboard Defaults + +Given the amount of functionality that QMK exposes it's very easy to confuse new users. When putting together the default firmware for your keyboard we recommend limiting your enabled features and options to the minimal set needed to support your hardware. Recommendations for specific features follow. + +### Bootmagic and Command + +[Bootmagic](feature_bootmagic.md) and [Command](feature_command.md) are two related features that allow a user to control their keyboard in non-obvious ways. We recommend you think long and hard about if you're going to enable either feature, and how you will expose this functionality. Keep in mind that users who want this functionality can enable it in their personal keymaps without affecting all the novice users who may be using your keyboard as their first programmable board. + +By far the most common problem new users encounter is accidentally triggering Bootmagic while they're plugging in their keyboard. They're holding the keyboard by the bottom, unknowingly pressing in alt and spacebar, and then they find that these keys have been swapped on them. We recommend leaving this feature disabled by default, but if you do turn it on consider setting `BOOTMAGIC_KEY_SALT` to a key that is hard to press while plugging your keyboard in. -This metadata is primarily used in two ways: +If your keyboard does not have 2 shift keys you should provide a working default for `IS_COMMAND`, even when you have set `COMMAND_ENABLE = no`. This will give your users a default to conform to if they do enable Command. -* To allow web-based configurators to dynamically generate UI -* To support the new `make keyboard:keymap:qmk` target, which bundles this metadata up with the firmware to allow QMK Toolbox to be smarter. +## Custom Keyboard Programming -Configurator authors can see the [QMK Compiler](https://docs.compile.qmk.fm/api_docs.html) docs for more information on using the JSON API. +As documented on [Customizing Functionality](custom_quantum_functions.md) you can define custom functions for your keyboard. Please keep in mind that your users may want to customize that behavior as well, and make it possible for them to do that. If you are providing a custom function, for example `process_record_kb()`, make sure that your function calls the `_user()` version of the call too. You should also take into account the return value of the `_user()` version, and only run your custom code if the user returns `true`. ## Non-Production/Handwired Projects diff --git a/docs/how_keyboards_work.md b/docs/how_keyboards_work.md index cc54e566a1f..5697a21872c 100644 --- a/docs/how_keyboards_work.md +++ b/docs/how_keyboards_work.md @@ -12,7 +12,7 @@ place: ``` text +------+ +-----+ +----------+ +----------+ +----+ | User |-------->| Key |------>| Firmware |----->| USB wire |---->| OS | -+------+ +-----+ +----------+ +----------+ |----+ ++------+ +-----+ +----------+ +----------+ +----+ ``` This scheme is a very simple view of what's going on, and more details follow @@ -63,10 +63,10 @@ You may wonder why a keyboard layout containing all of Unicode is not devised th ## How to (Maybe) Enter Unicode Characters -You can have the firmware send *sequences of keys* to use the [software Unicode Input Method](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input) of the target operating system, thus effectively entering characters independently of the layout defined in the OS. +You can have the firmware send *sequences of keys* to use the [software Unicode Input Method](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_input) of the target operating system, thus effectively entering characters independently of the layout defined in the OS. Yet, it does come with multiple disadvantages: - - Tied to a specific OS a a time (need recompilation when changing OS); + - Tied to a specific OS at a time (need recompilation when changing OS); - Within a given OS, does not work in all software; - Limited to a subset of Unicode on some systems. diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md new file mode 100644 index 00000000000..317307e1bf1 --- /dev/null +++ b/docs/i2c_driver.md @@ -0,0 +1,121 @@ +# I2C Master Driver + +The I2C Master drivers used in QMK have a set of common functions to allow portability between MCUs. + +## Available functions + +|Function |Description | +|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +|`void i2c_init(void);` |Initializes the I2C driver. This function should be called once before any transaction is initiated. | +|`uint8_t i2c_start(uint8_t address);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. | +|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. | +|`uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. | +|`uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. | +|`uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_receive` function but `regaddr` sets from where in the slave the data will be read. | +|`uint8_t i2c_stop(void);` |Ends an I2C transaction. | + +### Function Return + +All the above functions, except `void i2c_init(void);` return the following truth table: + +|Return Value |Description | +|---------------|---------------------------------------------------| +|0 |Operation executed successfully. | +|-1 |Operation failed. | +|-2 |Operation timed out. | + + +## AVR + +### Configuration + +The following defines can be used to configure the I2C master driver. + +|Variable |Description |Default| +|------------------|---------------------------------------------------|-------| +|`F_SCL` |Clock frequency in Hz |400KHz | +|`Prescaler` |Divides master clock to aid in I2C clock selection |1 | + +AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required. + +## ARM + +For ARM the Chibios I2C HAL driver is under the hood. +This section assumes an STM32 MCU. + +### Configuration + +The configuration for ARM MCUs can be quite complex as often there are multiple I2C drivers which can be assigned to a variety of ports. + +Firstly the `mcuconf.h` file must be setup to enable the necessary hardware drivers. + +|Variable |Description |Default| +|------------------------------|------------------------------------------------------------------------------------|-------| +|`#STM32_I2C_USE_XXX` |Enable/Disable the hardware driver XXX (each driver should be explicitly listed) |FALSE | +|`#STM32_I2C_BUSY_TIMEOUT` |Time in ms until the I2C command is aborted if no response is received |50 | +|`#STM32_I2C_XXX_IRQ_PRIORITY` |Interrupt priority for hardware driver XXX (THIS IS AN EXPERT SETTING) |10 | +|`#STM32_I2C_USE_DMA` |Enable/Disable the ability of the MCU to offload the data transfer to the DMA unit |TRUE | +|`#STM32_I2C_XXX_DMA_PRIORITY` |Priority of DMA unit for hardware driver XXX (THIS IS AN EXPERT SETTING) |1 | + +Secondly, in the `halconf.h` file, `#define HAL_USE_I2C` must be set to `TRUE`. This allows ChibiOS to load its I2C driver. + +Lastly, we need to assign the correct GPIO pins depending on the I2C hardware driver we want to use. + +By default the I2C1 hardware driver is assumed to be used. If another hardware driver is used, `#define I2C_DRIVER I2CDX` should be added to the `config.h` file with X being the number of hardware driver used. For example is I2C3 is enabled, the `config.h` file should contain `#define I2C_DRIVER I2CD3`. This aligns the QMK I2C driver with the Chibios I2C driver. + +STM32 MCUs allows a variety of pins to be configured as I2C pins depending on the hardware driver used. By default B6 and B7 are set to I2C. You can use these defines to set your i2c pins: + +| Variable | Description | Default | +|--------------------------|----------------------------------------------------------------------------------------------|---------| +| `I2C1_SCL_BANK` | The bank of pins (`GPIOA`, `GPIOB`, `GPIOC`) to use for SCL | `GPIOB` | +| `I2C1_SDA_BANK` | The bank of pins (`GPIOA`, `GPIOB`, `GPIOC`) to use for SDA | `GPIOB` | +| `I2C1_SCL` | The pin number for the SCL pin (0-9) | `6` | +| `I2C1_SDA` | The pin number for the SDA pin (0-9) | `7` | +| `I2C1_BANK` (deprecated) | The bank of pins (`GPIOA`, `GPIOB`, `GPIOC`), superceded by `I2C1_SCL_BANK`, `I2C1_SDA_BANK` | `GPIOB` | + +The ChibiOS I2C driver configuration depends on STM32 MCU: + + STM32F1xx, STM32F2xx, STM32F4xx, STM32L0xx and STM32L1xx use I2Cv1; + STM32F0xx, STM32F3xx, STM32F7xx and STM32L4xx use I2Cv2; + +#### I2Cv1 +STM32 MCUs allow for different clock and duty parameters when configuring I2Cv1. These can be modified using the following parameters, using as a reference: + +| Variable | Default | +|--------------------|------------------| +| `I2C1_OPMODE` | `OPMODE_I2C` | +| `I2C1_CLOCK_SPEED` | `100000` | +| `I2C1_DUTY_CYCLE` | `STD_DUTY_CYCLE` | + +#### I2Cv2 +STM32 MCUs allow for different timing parameters when configuring I2Cv2. These can be modified using the following parameters, using as a reference: + +| Variable | Default | +|-----------------------|---------| +| `I2C1_TIMINGR_PRESC` | `15U` | +| `I2C1_TIMINGR_SCLDEL` | `4U` | +| `I2C1_TIMINGR_SDADEL` | `2U` | +| `I2C1_TIMINGR_SCLH` | `15U` | +| `I2C1_TIMINGR_SCLL` | `21U` | + +STM32 MCUs allow for different "alternate function" modes when configuring GPIO pins. These are required to switch the pins used to I2Cv2 mode. See the respective datasheet for the appropriate values for your MCU. + +| Variable | Default | +|---------------------|---------| +| `I2C1_SCL_PAL_MODE` | `4` | +| `I2C1_SDA_PAL_MODE` | `4` | + +#### Other +You can also overload the `void i2c_init(void)` function, which has a weak attribute. If you do this the configuration variables above will not be used. Please consult the datasheet of your MCU for the available GPIO configurations. The following is an example initialization function: + +```C +void i2c_init(void) +{ + setPinInput(B6); // Try releasing special pins for a short time + setPinInput(B7); + wait_ms(10); // Wait for the release to happen + + palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); // Set B6 to I2C function + palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); // Set B7 to I2C function +} +``` diff --git a/docs/index.html b/docs/index.html index f0b1fae07e7..81904507288 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,7 +5,13 @@ QMK Firmware - + + + + + + + @@ -17,7 +23,7 @@ name: 'QMK Firmware', nameLink: 'https://qmk.fm/', repo: 'qmk/qmk_firmware', - loadSidebar: true, + loadSidebar: '_summary.md', auto2top: true, formatUpdated: '{YYYY}/{MM}/{DD} {HH}:{mm}', search: { @@ -25,7 +31,8 @@ placeholder: 'Search Documentation...', noData: 'We could not find any documents matching your search.', depth: 6 - } + }, + fallbackLanguages: ['zh'] } diff --git a/docs/internals_gpio_control.md b/docs/internals_gpio_control.md index 083e696648f..51a549f1c9b 100644 --- a/docs/internals_gpio_control.md +++ b/docs/internals_gpio_control.md @@ -1,6 +1,6 @@ # GPIO Control -QMK has a GPIO control abstraction layer which is micro-controller agnostic. This is done to allow easy access to pin control across different platforms. +QMK has a GPIO control abstraction layer which is microcontroller agnostic. This is done to allow easy access to pin control across different platforms. ## Functions @@ -17,7 +17,7 @@ The following functions can provide basic control of GPIOs and are found in `qua |`writePin(pin, level)`|Set pin level, assuming it is an output | |`readPin(pin)` |Returns the level of the pin | -## Advance settings +## Advanced Settings -Each micro-controller can have multiple advance settings regarding its GPIO. This abstraction layer does not limit the use of architecture specific functions. Advance users should consult the datasheet of there desired device and include any needed libraries. For AVR the standard avr/io.h library is used and for STM32 the Chibios [PAL library](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used. +Each microcontroller can have multiple advanced settings regarding its GPIO. This abstraction layer does not limit the use of architecture-specific functions. Advanced users should consult the datasheet of their desired device and include any needed libraries. For AVR, the standard avr/io.h library is used; for STM32, the ChibiOS [PAL library](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used. diff --git a/docs/isp_flashing_guide.md b/docs/isp_flashing_guide.md index 008f944cc3a..0f786c5141b 100644 --- a/docs/isp_flashing_guide.md +++ b/docs/isp_flashing_guide.md @@ -53,7 +53,7 @@ This is pretty straight-forward - we'll be connecting like-things to like-things The only difference between the .hex files below is which pin is connected to RESET. You can use them on other boards as well, as long as you're aware of the pins being used. If for some reason neither of these pins are available, [create an issue](https://github.com/qmk/qmk_firmware/issues/new), and we can generate one for you! * Teensy 2.0: [`util/teensy_2.0_ISP_B0.hex`](https://github.com/qmk/qmk_firmware/blob/master/util/teensy_2.0_ISP_B0.hex) (`B0`) -* Pro Micro: [`util/pro_micro_ISP_B6_10.hex`](https://github.com/qmk/qmk_firmware/blob/master/util/pro_mico_ISP_B6_10.hex) (`B6/10`) +* Pro Micro: [`util/pro_micro_ISP_B6_10.hex`](https://github.com/qmk/qmk_firmware/blob/master/util/pro_micro_ISP_B6_10.hex) (`B6/10`) **Flash your Teenys/Pro Micro with one of these and continue - you won't need the file after flashing your ISP device.** @@ -63,6 +63,7 @@ If you just want to get things back to normal, you can flash only a bootloader f * [`atmega32u4`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1_0_0.hex) - Most keyboards, Planck Rev 1-5, Preonic Rev 1-2 * [`at90usb1286`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_at90usb128x_1_0_1.hex) - Planck Light Rev 1 +* [`atmega32a`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32a_1_0_0.hex) - jj40 If you're not sure what your board uses, look in the `rules.mk` file for the keyboard in QMK. The `MCU =` line will have the value you need. It may differ between different versions of the board. @@ -113,6 +114,10 @@ Since our keyboard uses an `atmega32u4` (common), that is the chip we'll specify avrdude -c avrisp -P COM3 -p atmega32u4 -U flash:w:main.hex:i +If your board uses an `atmega32a` (e.g. on a jj40), the command is this (the extra code at the end sets the fuses correctly): + + avrdude -c avrisp -P COM3 -p atmega32 -U flash:w:main.hex:i -U hfuse:w:0xD0:m -U lfuse:w:0x0F:m + You should see a couple of progress bars, then you should see: avrdude: verifying ... diff --git a/docs/keycode.txt b/docs/keycode.txt deleted file mode 100644 index b2070f7117d..00000000000 --- a/docs/keycode.txt +++ /dev/null @@ -1,261 +0,0 @@ -Keycode Symbol Table -==================== -Keycodes are defined in `common/keycode.h`. -Range of 00-A4 and E0-E7 are identical with HID Usage: - -Virtual keycodes are defined out of above range to support special actions. - - -Keycode Symbol Short name Description --------------------------------------------------------------------------------- -KC_NO 00 Reserved (no event indicated) -KC_ROLL_OVER 01 Keyboard ErrorRollOver -KC_POST_FAIL 02 Keyboard POSTFail -KC_UNDEFINED 03 Keyboard ErrorUndefined -KC_A 04 Keyboard a and A -KC_B 05 Keyboard b and B -KC_C 06 Keyboard c and C -KC_D 07 Keyboard d and D -KC_E 08 Keyboard e and E -KC_F 09 Keyboard f and F -KC_G 0A Keyboard g and G -KC_H 0B Keyboard h and H -KC_I 0C Keyboard i and I -KC_J 0D Keyboard j and J -KC_K 0E Keyboard k and K -KC_L 0F Keyboard l and L -KC_M 10 Keyboard m and M -KC_N 11 Keyboard n and N -KC_O 12 Keyboard o and O -KC_P 13 Keyboard p and P -KC_Q 14 Keyboard q and Q -KC_R 15 Keyboard r and R -KC_S 16 Keyboard s and S -KC_T 17 Keyboard t and T -KC_U 18 Keyboard u and U -KC_V 19 Keyboard v and V -KC_W 1A Keyboard w and W -KC_X 1B Keyboard x and X -KC_Y 1C Keyboard y and Y -KC_Z 1D Keyboard z and Z -KC_1 1E Keyboard 1 and ! -KC_2 1F Keyboard 2 and @ -KC_3 20 Keyboard 3 and # -KC_4 21 Keyboard 4 and $ -KC_5 22 Keyboard 5 and % -KC_6 23 Keyboard 6 and ^ -KC_7 24 Keyboard 7 and & -KC_8 25 Keyboard 8 and * -KC_9 26 Keyboard 9 and ( -KC_0 27 Keyboard 0 and ) -KC_ENTER KC_ENT 28 Keyboard Return (ENTER) -KC_ESCAPE KC_ESC 29 Keyboard ESCAPE -KC_BSPACE KC_BSPC 2A Keyboard DELETE (Backspace) -KC_TAB 2B Keyboard Tab -KC_SPACE KC_SPC 2C Keyboard Spacebar -KC_MINUS KC_MINS 2D Keyboard - and (underscore) -KC_EQUAL KC_EQL 2E Keyboard = and + -KC_LBRACKET KC_LBRC 2F Keyboard [ and { -KC_RBRACKET KC_RBRC 30 Keyboard ] and } -KC_BSLASH KC_BSLS 31 Keyboard \ and | -KC_NONUS_HASH KC_NUHS 32 Keyboard Non-US # and ~ -KC_SCOLON KC_SCLN 33 Keyboard ; and : -KC_QUOTE KC_QUOT 34 Keyboard ‘ and “ -KC_GRAVE KC_GRV 35 Keyboard Grave Accent and Tilde -KC_COMMA KC_COMM 36 Keyboard , and < -KC_DOT 37 Keyboard . and > -KC_SLASH KC_SLSH 38 Keyboard / and ? -KC_CAPSLOCK KC_CAPS 39 Keyboard Caps Lock -KC_F1 3A Keyboard F1 -KC_F2 3B Keyboard F2 -KC_F3 3C Keyboard F3 -KC_F4 3D Keyboard F4 -KC_F5 3E Keyboard F5 -KC_F6 3F Keyboard F6 -KC_F7 40 Keyboard F7 -KC_F8 41 Keyboard F8 -KC_F9 42 Keyboard F9 -KC_F10 43 Keyboard F10 -KC_F11 44 Keyboard F11 -KC_F12 45 Keyboard F12 -KC_PSCREEN KC_PSCR 46 Keyboard PrintScreen -KC_SCROLLLOCK KC_SLCK 47 Keyboard Scroll Lock -KC_PAUSE KC_PAUS 48 Keyboard Pause -KC_INSERT KC_INS 49 Keyboard Insert -KC_HOME 4A Keyboard Home -KC_PGUP 4B Keyboard PageUp -KC_DELETE KC_DEL 4C Keyboard Delete Forward -KC_END 4D Keyboard End -KC_PGDOWN KC_PGDN 4E Keyboard PageDown -KC_RIGHT KC_RGHT 4F Keyboard RightArrow -KC_LEFT 50 Keyboard LeftArrow -KC_DOWN 51 Keyboard DownArrow -KC_UP 52 Keyboard UpArrow -KC_NUMLOCK KC_NLCK 53 Keypad Num Lock and Clear -KC_KP_SLASH KC_PSLS 54 Keypad / -KC_KP_ASTERISK KC_PAST 55 Keypad * -KC_KP_MINUS KC_PMNS 56 Keypad - -KC_KP_PLUS KC_PPLS 57 Keypad + -KC_KP_ENTER KC_PENT 58 Keypad ENTER -KC_KP_1 KC_P1 59 Keypad 1 and End -KC_KP_2 KC_P2 5A Keypad 2 and Down Arrow -KC_KP_3 KC_P3 5B Keypad 3 and PageDn -KC_KP_4 KC_P4 5C Keypad 4 and Left Arrow -KC_KP_5 KC_P5 5D Keypad 5 -KC_KP_6 KC_P6 5E Keypad 6 and Right Arrow -KC_KP_7 KC_P7 5F Keypad 7 and Home -KC_KP_8 KC_P8 60 Keypad 8 and Up Arrow -KC_KP_9 KC_P9 61 Keypad 9 and PageUp -KC_KP_0 KC_P0 62 Keypad 0 and Insert -KC_KP_DOT KC_PDOT 63 Keypad . and Delete -KC_NONUS_BSLASH KC_NUBS 64 Keyboard Non-US \ and | -KC_APPLICATION KC_APP 65 Keyboard Application -KC_POWER 66 Keyboard Power -KC_KP_EQUAL KC_PEQL 67 Keypad = -KC_F13 68 Keyboard F13 -KC_F14 69 Keyboard F14 -KC_F15 6A Keyboard F15 -KC_F16 6B Keyboard F16 -KC_F17 6C Keyboard F17 -KC_F18 6D Keyboard F18 -KC_F19 6E Keyboard F19 -KC_F20 6F Keyboard F20 -KC_F21 70 Keyboard F21 -KC_F22 71 Keyboard F22 -KC_F23 72 Keyboard F23 -KC_F24 73 Keyboard F24 -KC_EXECUTE 74 Keyboard Execute -KC_HELP 75 Keyboard Help -KC_MENU 76 Keyboard Menu -KC_SELECT 77 Keyboard Select -KC_STOP 78 Keyboard Stop -KC_AGAIN 79 Keyboard Again -KC_UNDO 7A Keyboard Undo -KC_CUT 7B Keyboard Cut -KC_COPY 7C Keyboard Copy -KC_PASTE 7D Keyboard Paste -KC_FIND 7E Keyboard Find -KC__MUTE 7F Keyboard Mute -KC__VOLUP 80 Keyboard Volume Up -KC__VOLDOWN 81 Keyboard Volume Down -KC_LOCKING_CAPS 82 Keyboard Locking Caps Lock -KC_LOCKING_NUM 83 Keyboard Locking Num Lock -KC_LOCKING_SCROLL 84 Keyboard Locking Scroll Lock -KC_KP_COMMA KC_PCMM 85 Keypad Comma -KC_KP_EQUAL_AS400 86 Keypad Equal Sign -KC_INT1 KC_RO 87 Keyboard International115 -KC_INT2 KC_KANA 88 Keyboard International216 -KC_INT3 KC_JYEN 89 Keyboard International317 -KC_INT4 KC_HENK 8A Keyboard International418 -KC_INT5 KC_MHEN 8B Keyboard International519 -KC_INT6 8C Keyboard International620 -KC_INT7 8D Keyboard International721 -KC_INT8 8E Keyboard International822 -KC_INT9 8F Keyboard International922 -KC_LANG1 90 Keyboard LANG125 -KC_LANG2 91 Keyboard LANG226 -KC_LANG3 92 Keyboard LANG330 -KC_LANG4 93 Keyboard LANG431 -KC_LANG5 94 Keyboard LANG532 -KC_LANG6 95 Keyboard LANG68 -KC_LANG7 96 Keyboard LANG78 -KC_LANG8 97 Keyboard LANG88 -KC_LANG9 98 Keyboard LANG98 -KC_ALT_ERASE 99 Keyboard Alternate Erase -KC_SYSREQ 9A Keyboard SysReq/Attention -KC_CANCEL 9B Keyboard Cancel -KC_CLEAR 9C Keyboard Clear -KC_PRIOR 9D Keyboard Prior -KC_RETURN 9E Keyboard Return -KC_SEPARATOR 9F Keyboard Separator -KC_OUT A0 Keyboard Out -KC_OPER A1 Keyboard Oper -KC_CLEAR_AGAIN A2 Keyboard Clear/Again -KC_CRSEL A3 Keyboard CrSel/Props -KC_EXSEL A4 Keyboard ExSel -/* Modifiers */ -KC_LCTRL KC_LCTL E0 Keyboard LeftControl -KC_LSHIFT KC_LSFT E1 Keyboard LeftShift -KC_LALT E2 Keyboard LeftAlt -KC_LGUI E3 Keyboard Left GUI(Windows/Apple/Meta key) -KC_RCTRL KC_RCTL E4 Keyboard RightControl -KC_RSHIFT KC_RSFT E5 Keyboard RightShift -KC_RALT E6 Keyboard RightAlt -KC_RGUI E7 Keyboard Right GUI(Windows/Apple/Meta key) - -/* - * Virtual keycodes - */ -/* System Control */ -KC_SYSTEM_POWER KC_PWR System Power Down -KC_SYSTEM_SLEEP KC_SLEP System Sleep -KC_SYSTEM_WAKE KC_WAKE System Wake -/* Consumer Page */ -KC_AUDIO_MUTE KC_MUTE -KC_AUDIO_VOL_UP KC_VOLU -KC_AUDIO_VOL_DOWN KC_VOLD -KC_MEDIA_NEXT_TRACK KC_MNXT -KC_MEDIA_PREV_TRACK KC_MPRV -KC_MEDIA_STOP KC_MSTP -KC_MEDIA_PLAY_PAUSE KC_MPLY -KC_MEDIA_SELECT KC_MSEL -KC_MAIL KC_MAIL -KC_CALCULATOR KC_CALC -KC_MY_COMPUTER KC_MYCM -KC_WWW_SEARCH KC_WSCH -KC_WWW_HOME KC_WHOM -KC_WWW_BACK KC_WBAK -KC_WWW_FORWARD KC_WFWD -KC_WWW_STOP KC_WSTP -KC_WWW_REFRESH KC_WREF -KC_WWW_FAVORITES KC_WFAV -/* Mousekey */ -KC_MS_UP KC_MS_U Mouse Cursor Up -KC_MS_DOWN KC_MS_D Mouse Cursor Down -KC_MS_LEFT KC_MS_L Mouse Cursor Left -KC_MS_RIGHT KC_MS_R Mouse Cursor Right -KC_MS_BTN1 KC_BTN1 Mouse Button 1 -KC_MS_BTN2 KC_BTN2 Mouse Button 2 -KC_MS_BTN3 KC_BTN3 Mouse Button 3 -KC_MS_BTN4 KC_BTN4 Mouse Button 4 -KC_MS_BTN5 KC_BTN5 Mouse Button 5 -KC_MS_WH_UP KC_WH_U Mouse Wheel Up -KC_MS_WH_DOWN KC_WH_D Mouse Wheel Down -KC_MS_WH_LEFT KC_WH_L Mouse Wheel Left -KC_MS_WH_RIGHT KC_WH_R Mouse Wheel Right -KC_MS_ACCEL0 KC_ACL0 Mouse Acceleration 0 -KC_MS_ACCEL1 KC_ACL1 Mouse Acceleration 1 -KC_MS_ACCEL2 KC_ACL2 Mouse Acceleration 2 -/* Fn key */ -KC_FN0 -KC_FN1 -KC_FN2 -KC_FN3 -KC_FN4 -KC_FN5 -KC_FN6 -KC_FN7 -KC_FN8 -KC_FN9 -KC_FN10 -KC_FN11 -KC_FN12 -KC_FN13 -KC_FN14 -KC_FN15 -KC_FN16 -KC_FN17 -KC_FN18 -KC_FN19 -KC_FN20 -KC_FN21 -KC_FN22 -KC_FN23 -KC_FN24 -KC_FN25 -KC_FN26 -KC_FN27 -KC_FN28 -KC_FN29 -KC_FN30 -KC_FN31 diff --git a/docs/keycodes.md b/docs/keycodes.md index 6676bb53c9f..bd4dd61a5b4 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -6,226 +6,234 @@ This is a reference only. Each group of keys links to the page documenting their ## [Basic Keycodes](keycodes_basic.md) -|Key |Aliases |Description | -|-----------------------|--------------------|-----------------------------------------------| -|`KC_NO` |`XXXXXXX` |Ignore this key (NOOP) | -|`KC_TRANSPARENT` |`KC_TRNS`, `_______`|Use the next lowest non-transparent key | -|`KC_A` | |`a` and `A` | -|`KC_B` | |`b` and `B` | -|`KC_C` | |`c` and `C` | -|`KC_D` | |`d` and `D` | -|`KC_E` | |`e` and `E` | -|`KC_F` | |`f` and `F` | -|`KC_G` | |`g` and `G` | -|`KC_H` | |`h` and `H` | -|`KC_I` | |`i` and `I` | -|`KC_J` | |`j` and `J` | -|`KC_K` | |`k` and `K` | -|`KC_L` | |`l` and `L` | -|`KC_M` | |`m` and `M` | -|`KC_N` | |`n` and `N` | -|`KC_O` | |`o` and `O` | -|`KC_P` | |`p` and `P` | -|`KC_Q` | |`q` and `Q` | -|`KC_R` | |`r` and `R` | -|`KC_S` | |`s` and `S` | -|`KC_T` | |`t` and `T` | -|`KC_U` | |`u` and `U` | -|`KC_V` | |`v` and `V` | -|`KC_W` | |`w` and `W` | -|`KC_X` | |`x` and `X` | -|`KC_Y` | |`y` and `Y` | -|`KC_Z` | |`z` and `Z` | -|`KC_1` | |`1` and `!` | -|`KC_2` | |`2` and `@` | -|`KC_3` | |`3` and `#` | -|`KC_4` | |`4` and `$` | -|`KC_5` | |`5` and `%` | -|`KC_6` | |`6` and `^` | -|`KC_7` | |`7` and `&` | -|`KC_8` | |`8` and `*` | -|`KC_9` | |`9` and `(` | -|`KC_0` | |`0` and `)` | -|`KC_ENTER` |`KC_ENT` |Return (Enter) | -|`KC_ESCAPE` |`KC_ESC` |Escape | -|`KC_BSPACE` |`KC_BSPC` |Delete (Backspace) | -|`KC_TAB` | |Tab | -|`KC_SPACE` |`KC_SPC` |Spacebar | -|`KC_MINUS` |`KC_MINS` |`-` and `_` | -|`KC_EQUAL` |`KC_EQL` |`=` and `+` | -|`KC_LBRACKET` |`KC_LBRC` |`[` and `{` | -|`KC_RBRACKET` |`KC_RBRC` |`]` and `}` | -|`KC_BSLASH` |`KC_BSLS` |`\` and | | -|`KC_NONUS_HASH` |`KC_NUHS` |Non-US `#` and `~` | -|`KC_SCOLON` |`KC_SCLN` |`;` and `:` | -|`KC_QUOTE` |`KC_QUOT` |`'` and `"` | -|`KC_GRAVE` |`KC_GRV`, `KC_ZKHK` |` and `~`, JIS Zenkaku/Hankaku| -|`KC_COMMA` |`KC_COMM` |`,` and `<` | -|`KC_DOT` | |`.` and `>` | -|`KC_SLASH` |`KC_SLSH` |`/` and `?` | -|`KC_CAPSLOCK` |`KC_CLCK`, `KC_CAPS`|Caps Lock | -|`KC_F1` | |F1 | -|`KC_F2` | |F2 | -|`KC_F3` | |F3 | -|`KC_F4` | |F4 | -|`KC_F5` | |F5 | -|`KC_F6` | |F6 | -|`KC_F7` | |F7 | -|`KC_F8` | |F8 | -|`KC_F9` | |F9 | -|`KC_F10` | |F10 | -|`KC_F11` | |F11 | -|`KC_F12` | |F12 | -|`KC_PSCREEN` |`KC_PSCR` |Print Screen | -|`KC_SCROLLLOCK` |`KC_SLCK` |Scroll Lock | -|`KC_PAUSE` |`KC_PAUS`, `KC_BRK` |Pause | -|`KC_INSERT` |`KC_INS` |Insert | -|`KC_HOME` | |Home | -|`KC_PGUP` | |Page Up | -|`KC_DELETE` |`KC_DEL` |Forward Delete | -|`KC_END` | |End | -|`KC_PGDOWN` |`KC_PGDN` |Page Down | -|`KC_RIGHT` |`KC_RGHT` |Right Arrow | -|`KC_LEFT` | |Left Arrow | -|`KC_DOWN` | |Down Arrow | -|`KC_UP` | |Up Arrow | -|`KC_NUMLOCK` |`KC_NLCK` |Keypad Num Lock and Clear | -|`KC_KP_SLASH` |`KC_PSLS` |Keypad `/` | -|`KC_KP_ASTERISK` |`KC_PAST` |Keypad `*` | -|`KC_KP_MINUS` |`KC_PMNS` |Keypad `-` | -|`KC_KP_PLUS` |`KC_PPLS` |Keypad `+` | -|`KC_KP_ENTER` |`KC_PENT` |Keypad Enter | -|`KC_KP_1` |`KC_P1` |Keypad `1` and End | -|`KC_KP_2` |`KC_P2` |Keypad `2` and Down Arrow | -|`KC_KP_3` |`KC_P3` |Keypad `3` and Page Down | -|`KC_KP_4` |`KC_P4` |Keypad `4` and Left Arrow | -|`KC_KP_5` |`KC_P5` |Keypad `5` | -|`KC_KP_6` |`KC_P6` |Keypad `6` and Right Arrow | -|`KC_KP_7` |`KC_P7` |Keypad `7` and Home | -|`KC_KP_8` |`KC_P8` |Keypad `8` and Up Arrow | -|`KC_KP_9` |`KC_P9` |Keypad `9` and Page Up | -|`KC_KP_0` |`KC_P0` |Keypad `0` and Insert | -|`KC_KP_DOT` |`KC_PDOT` |Keypad `.` and Delete | -|`KC_NONUS_BSLASH` |`KC_NUBS` |Non-US `\` and | | -|`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key) | -|`KC_POWER` | |System Power (macOS) | -|`KC_KP_EQUAL` |`KC_PEQL` |Keypad `=` | -|`KC_F13` | |F13 | -|`KC_F14` | |F14 | -|`KC_F15` | |F15 | -|`KC_F16` | |F16 | -|`KC_F17` | |F17 | -|`KC_F18` | |F18 | -|`KC_F19` | |F19 | -|`KC_F20` | |F20 | -|`KC_F21` | |F21 | -|`KC_F22` | |F22 | -|`KC_F23` | |F23 | -|`KC_F24` | |F24 | -|`KC_EXECUTE` |`KC_EXEC` |Execute | -|`KC_HELP` | |Help | -|`KC_MENU` | |Menu | -|`KC_SELECT` |`KC_SLCT` |Select | -|`KC_STOP` | |Stop | -|`KC_AGAIN` |`KC_AGIN` |Again | -|`KC_UNDO` | |Undo | -|`KC_CUT` | |Cut | -|`KC_COPY` | |Copy | -|`KC_PASTE` |`KC_PSTE` |Paste | -|`KC_FIND` | |Find | -|`KC__MUTE` | |Mute (macOS) | -|`KC__VOLUP` | |Volume Up (macOS) | -|`KC__VOLDOWN` | |Volume Down (macOS) | -|`KC_LOCKING_CAPS` |`KC_LCAP` |Locking Caps Lock | -|`KC_LOCKING_NUM` |`KC_LNUM` |Locking Num Lock | -|`KC_LOCKING_SCROLL` |`KC_LSCR` |Locking Scroll Lock | -|`KC_KP_COMMA` |`KC_PCMM` |Keypad `,` | -|`KC_KP_EQUAL_AS400` | |Keypad `=` on AS/400 keyboards | -|`KC_INT1` |`KC_RO` |JIS `\` and | | -|`KC_INT2` |`KC_KANA` |JIS Katakana/Hiragana | -|`KC_INT3` |`KC_JYEN` |JIS `¥` | -|`KC_INT4` |`KC_HENK` |JIS Henkan | -|`KC_INT5` |`KC_MHEN` |JIS Muhenkan | -|`KC_INT6` | |JIS Numpad `,` | -|`KC_INT7` | |International 7 | -|`KC_INT8` | |International 8 | -|`KC_INT9` | |International 9 | -|`KC_LANG1` |`KC_HAEN` |Hangul/English | -|`KC_LANG2` |`KC_HANJ` |Hanja | -|`KC_LANG3` | |JIS Katakana | -|`KC_LANG4` | |JIS Hiragana | -|`KC_LANG5` | |JIS Zenkaku/Hankaku | -|`KC_LANG6` | |Language 6 | -|`KC_LANG7` | |Language 7 | -|`KC_LANG8` | |Language 8 | -|`KC_LANG9` | |Language 9 | -|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase | -|`KC_SYSREQ` | |SysReq/Attention | -|`KC_CANCEL` | |Cancel | -|`KC_CLEAR` |`KC_CLR` |Clear | -|`KC_PRIOR` | |Prior | -|`KC_RETURN` | |Return | -|`KC_SEPARATOR` | |Separator | -|`KC_OUT` | |Out | -|`KC_OPER` | |Oper | -|`KC_CLEAR_AGAIN` | |Clear/Again | -|`KC_CRSEL` | |CrSel/Props | -|`KC_EXSEL` | |ExSel | -|`KC_LCTRL` |`KC_LCTL` |Left Control | -|`KC_LSHIFT` |`KC_LSFT` |Left Shift | -|`KC_LALT` | |Left Alt | -|`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | -|`KC_RCTRL` |`KC_RCTL` |Right Control | -|`KC_RSHIFT` |`KC_RSFT` |Right Shift | -|`KC_RALT` | |Right Alt | -|`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key) | -|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | -|`KC_SYSTEM_SLEEP` |`KC_SLEP` |System Sleep | -|`KC_SYSTEM_WAKE` |`KC_WAKE` |System Wake | -|`KC_AUDIO_MUTE` |`KC_MUTE` |Mute | -|`KC_AUDIO_VOL_UP` |`KC_VOLU` |Volume Up | -|`KC_AUDIO_VOL_DOWN` |`KC_VOLD` |Volume Down | -|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT` |Next Track (Windows) | -|`KC_MEDIA_PREV_TRACK` |`KC_MPRV` |Previous Track (Windows) | -|`KC_MEDIA_STOP` |`KC_MSTP` |Stop Track (Windows) | -|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY` |Play/Pause Track | -|`KC_MEDIA_SELECT` |`KC_MSEL` |Launch Media Player (Windows) | -|`KC_MEDIA_EJECT` |`KC_EJCT` |Eject (macOS) | -|`KC_MAIL` | |Launch Mail (Windows) | -|`KC_CALCULATOR` |`KC_CALC` |Launch Calculator (Windows) | -|`KC_MY_COMPUTER` |`KC_MYCM` |Launch My Computer (Windows) | -|`KC_WWW_SEARCH` |`KC_WSCH` |Browser Search (Windows) | -|`KC_WWW_HOME` |`KC_WHOM` |Browser Home (Windows) | -|`KC_WWW_BACK` |`KC_WBAK` |Browser Back (Windows) | -|`KC_WWW_FORWARD` |`KC_WFWD` |Browser Forward (Windows) | -|`KC_WWW_STOP` |`KC_WSTP` |Browser Stop (Windows) | -|`KC_WWW_REFRESH` |`KC_WREF` |Browser Refresh (Windows) | -|`KC_WWW_FAVORITES` |`KC_WFAV` |Browser Favorites (Windows) | -|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD` |Next Track (macOS) | -|`KC_MEDIA_REWIND` |`KC_MRWD` |Previous Track (macOS) | +|Key |Aliases |Description | +|-----------------------|------------------------------|-----------------------------------------------| +|`KC_NO` |`XXXXXXX` |Ignore this key (NOOP) | +|`KC_TRANSPARENT` |`KC_TRNS`, `_______` |Use the next lowest non-transparent key | +|`KC_A` | |`a` and `A` | +|`KC_B` | |`b` and `B` | +|`KC_C` | |`c` and `C` | +|`KC_D` | |`d` and `D` | +|`KC_E` | |`e` and `E` | +|`KC_F` | |`f` and `F` | +|`KC_G` | |`g` and `G` | +|`KC_H` | |`h` and `H` | +|`KC_I` | |`i` and `I` | +|`KC_J` | |`j` and `J` | +|`KC_K` | |`k` and `K` | +|`KC_L` | |`l` and `L` | +|`KC_M` | |`m` and `M` | +|`KC_N` | |`n` and `N` | +|`KC_O` | |`o` and `O` | +|`KC_P` | |`p` and `P` | +|`KC_Q` | |`q` and `Q` | +|`KC_R` | |`r` and `R` | +|`KC_S` | |`s` and `S` | +|`KC_T` | |`t` and `T` | +|`KC_U` | |`u` and `U` | +|`KC_V` | |`v` and `V` | +|`KC_W` | |`w` and `W` | +|`KC_X` | |`x` and `X` | +|`KC_Y` | |`y` and `Y` | +|`KC_Z` | |`z` and `Z` | +|`KC_1` | |`1` and `!` | +|`KC_2` | |`2` and `@` | +|`KC_3` | |`3` and `#` | +|`KC_4` | |`4` and `$` | +|`KC_5` | |`5` and `%` | +|`KC_6` | |`6` and `^` | +|`KC_7` | |`7` and `&` | +|`KC_8` | |`8` and `*` | +|`KC_9` | |`9` and `(` | +|`KC_0` | |`0` and `)` | +|`KC_ENTER` |`KC_ENT` |Return (Enter) | +|`KC_ESCAPE` |`KC_ESC` |Escape | +|`KC_BSPACE` |`KC_BSPC` |Delete (Backspace) | +|`KC_TAB` | |Tab | +|`KC_SPACE` |`KC_SPC` |Spacebar | +|`KC_MINUS` |`KC_MINS` |`-` and `_` | +|`KC_EQUAL` |`KC_EQL` |`=` and `+` | +|`KC_LBRACKET` |`KC_LBRC` |`[` and `{` | +|`KC_RBRACKET` |`KC_RBRC` |`]` and `}` | +|`KC_BSLASH` |`KC_BSLS` |`\` and | | +|`KC_NONUS_HASH` |`KC_NUHS` |Non-US `#` and `~` | +|`KC_SCOLON` |`KC_SCLN` |`;` and `:` | +|`KC_QUOTE` |`KC_QUOT` |`'` and `"` | +|`KC_GRAVE` |`KC_GRV`, `KC_ZKHK` |` and `~`, JIS Zenkaku/Hankaku| +|`KC_COMMA` |`KC_COMM` |`,` and `<` | +|`KC_DOT` | |`.` and `>` | +|`KC_SLASH` |`KC_SLSH` |`/` and `?` | +|`KC_CAPSLOCK` |`KC_CLCK`, `KC_CAPS` |Caps Lock | +|`KC_F1` | |F1 | +|`KC_F2` | |F2 | +|`KC_F3` | |F3 | +|`KC_F4` | |F4 | +|`KC_F5` | |F5 | +|`KC_F6` | |F6 | +|`KC_F7` | |F7 | +|`KC_F8` | |F8 | +|`KC_F9` | |F9 | +|`KC_F10` | |F10 | +|`KC_F11` | |F11 | +|`KC_F12` | |F12 | +|`KC_PSCREEN` |`KC_PSCR` |Print Screen | +|`KC_SCROLLLOCK` |`KC_SLCK`, `KC_BRMD` |Scroll Lock, Brightness Down (macOS) | +|`KC_PAUSE` |`KC_PAUS`, `KC_BRK`, `KC_BRMU`|Pause, Brightness Up (macOS) | +|`KC_INSERT` |`KC_INS` |Insert | +|`KC_HOME` | |Home | +|`KC_PGUP` | |Page Up | +|`KC_DELETE` |`KC_DEL` |Forward Delete | +|`KC_END` | |End | +|`KC_PGDOWN` |`KC_PGDN` |Page Down | +|`KC_RIGHT` |`KC_RGHT` |Right Arrow | +|`KC_LEFT` | |Left Arrow | +|`KC_DOWN` | |Down Arrow | +|`KC_UP` | |Up Arrow | +|`KC_NUMLOCK` |`KC_NLCK` |Keypad Num Lock and Clear | +|`KC_KP_SLASH` |`KC_PSLS` |Keypad `/` | +|`KC_KP_ASTERISK` |`KC_PAST` |Keypad `*` | +|`KC_KP_MINUS` |`KC_PMNS` |Keypad `-` | +|`KC_KP_PLUS` |`KC_PPLS` |Keypad `+` | +|`KC_KP_ENTER` |`KC_PENT` |Keypad Enter | +|`KC_KP_1` |`KC_P1` |Keypad `1` and End | +|`KC_KP_2` |`KC_P2` |Keypad `2` and Down Arrow | +|`KC_KP_3` |`KC_P3` |Keypad `3` and Page Down | +|`KC_KP_4` |`KC_P4` |Keypad `4` and Left Arrow | +|`KC_KP_5` |`KC_P5` |Keypad `5` | +|`KC_KP_6` |`KC_P6` |Keypad `6` and Right Arrow | +|`KC_KP_7` |`KC_P7` |Keypad `7` and Home | +|`KC_KP_8` |`KC_P8` |Keypad `8` and Up Arrow | +|`KC_KP_9` |`KC_P9` |Keypad `9` and Page Up | +|`KC_KP_0` |`KC_P0` |Keypad `0` and Insert | +|`KC_KP_DOT` |`KC_PDOT` |Keypad `.` and Delete | +|`KC_NONUS_BSLASH` |`KC_NUBS` |Non-US `\` and | | +|`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key) | +|`KC_POWER` | |System Power (macOS) | +|`KC_KP_EQUAL` |`KC_PEQL` |Keypad `=` | +|`KC_F13` | |F13 | +|`KC_F14` | |F14 | +|`KC_F15` | |F15 | +|`KC_F16` | |F16 | +|`KC_F17` | |F17 | +|`KC_F18` | |F18 | +|`KC_F19` | |F19 | +|`KC_F20` | |F20 | +|`KC_F21` | |F21 | +|`KC_F22` | |F22 | +|`KC_F23` | |F23 | +|`KC_F24` | |F24 | +|`KC_EXECUTE` |`KC_EXEC` |Execute | +|`KC_HELP` | |Help | +|`KC_MENU` | |Menu | +|`KC_SELECT` |`KC_SLCT` |Select | +|`KC_STOP` | |Stop | +|`KC_AGAIN` |`KC_AGIN` |Again | +|`KC_UNDO` | |Undo | +|`KC_CUT` | |Cut | +|`KC_COPY` | |Copy | +|`KC_PASTE` |`KC_PSTE` |Paste | +|`KC_FIND` | |Find | +|`KC__MUTE` | |Mute (macOS) | +|`KC__VOLUP` | |Volume Up (macOS) | +|`KC__VOLDOWN` | |Volume Down (macOS) | +|`KC_LOCKING_CAPS` |`KC_LCAP` |Locking Caps Lock | +|`KC_LOCKING_NUM` |`KC_LNUM` |Locking Num Lock | +|`KC_LOCKING_SCROLL` |`KC_LSCR` |Locking Scroll Lock | +|`KC_KP_COMMA` |`KC_PCMM` |Keypad `,` | +|`KC_KP_EQUAL_AS400` | |Keypad `=` on AS/400 keyboards | +|`KC_INT1` |`KC_RO` |JIS `\` and `_` | +|`KC_INT2` |`KC_KANA` |JIS Katakana/Hiragana | +|`KC_INT3` |`KC_JYEN` |JIS `¥` and | | +|`KC_INT4` |`KC_HENK` |JIS Henkan | +|`KC_INT5` |`KC_MHEN` |JIS Muhenkan | +|`KC_INT6` | |JIS Numpad `,` | +|`KC_INT7` | |International 7 | +|`KC_INT8` | |International 8 | +|`KC_INT9` | |International 9 | +|`KC_LANG1` |`KC_HAEN` |Hangul/English | +|`KC_LANG2` |`KC_HANJ` |Hanja | +|`KC_LANG3` | |JIS Katakana | +|`KC_LANG4` | |JIS Hiragana | +|`KC_LANG5` | |JIS Zenkaku/Hankaku | +|`KC_LANG6` | |Language 6 | +|`KC_LANG7` | |Language 7 | +|`KC_LANG8` | |Language 8 | +|`KC_LANG9` | |Language 9 | +|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase | +|`KC_SYSREQ` | |SysReq/Attention | +|`KC_CANCEL` | |Cancel | +|`KC_CLEAR` |`KC_CLR` |Clear | +|`KC_PRIOR` | |Prior | +|`KC_RETURN` | |Return | +|`KC_SEPARATOR` | |Separator | +|`KC_OUT` | |Out | +|`KC_OPER` | |Oper | +|`KC_CLEAR_AGAIN` | |Clear/Again | +|`KC_CRSEL` | |CrSel/Props | +|`KC_EXSEL` | |ExSel | +|`KC_LCTRL` |`KC_LCTL` |Left Control | +|`KC_LSHIFT` |`KC_LSFT` |Left Shift | +|`KC_LALT` | |Left Alt | +|`KC_LGUI` |`KC_LCMD`, `KC_LWIN` |Left GUI (Windows/Command/Meta key) | +|`KC_RCTRL` |`KC_RCTL` |Right Control | +|`KC_RSHIFT` |`KC_RSFT` |Right Shift | +|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) | +|`KC_RGUI` |`KC_RCMD`, `KC_RWIN` |Right GUI (Windows/Command/Meta key) | +|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | +|`KC_SYSTEM_SLEEP` |`KC_SLEP` |System Sleep | +|`KC_SYSTEM_WAKE` |`KC_WAKE` |System Wake | +|`KC_AUDIO_MUTE` |`KC_MUTE` |Mute | +|`KC_AUDIO_VOL_UP` |`KC_VOLU` |Volume Up | +|`KC_AUDIO_VOL_DOWN` |`KC_VOLD` |Volume Down | +|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT` |Next Track (Windows) | +|`KC_MEDIA_PREV_TRACK` |`KC_MPRV` |Previous Track (Windows) | +|`KC_MEDIA_STOP` |`KC_MSTP` |Stop Track (Windows) | +|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY` |Play/Pause Track | +|`KC_MEDIA_SELECT` |`KC_MSEL` |Launch Media Player (Windows) | +|`KC_MEDIA_EJECT` |`KC_EJCT` |Eject (macOS) | +|`KC_MAIL` | |Launch Mail (Windows) | +|`KC_CALCULATOR` |`KC_CALC` |Launch Calculator (Windows) | +|`KC_MY_COMPUTER` |`KC_MYCM` |Launch My Computer (Windows) | +|`KC_WWW_SEARCH` |`KC_WSCH` |Browser Search (Windows) | +|`KC_WWW_HOME` |`KC_WHOM` |Browser Home (Windows) | +|`KC_WWW_BACK` |`KC_WBAK` |Browser Back (Windows) | +|`KC_WWW_FORWARD` |`KC_WFWD` |Browser Forward (Windows) | +|`KC_WWW_STOP` |`KC_WSTP` |Browser Stop (Windows) | +|`KC_WWW_REFRESH` |`KC_WREF` |Browser Refresh (Windows) | +|`KC_WWW_FAVORITES` |`KC_WFAV` |Browser Favorites (Windows) | +|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD` |Next Track (macOS) | +|`KC_MEDIA_REWIND` |`KC_MRWD` |Previous Track (macOS) | +|`KC_BRIGHTNESS_UP` |`KC_BRIU` |Brightness Up | +|`KC_BRIGHTNESS_DOWN` |`KC_BRID` |Brightness Down | ## [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes) -|Key |Aliases |Description | -|-------------|-----------|---------------------------------------------------------------------| -|`RESET` | |Put the keyboard into DFU mode for flashing | -|`DEBUG` | |Toggle debug mode | -|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| -|`KC_LSPO` | |Left Shift when held, `(` when tapped | -|`KC_RSPC` | |Right Shift when held, `)` when tapped | -|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | -|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | -|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | -|`M(n)` | |Call macro `n` | -|`MACROTAP(n)`| |Macro-tap `n` idk FIXME | +|Key |Aliases |Description | +|---------------|-----------|---------------------------------------------------------------------| +|`RESET` | |Put the keyboard into DFU mode for flashing | +|`DEBUG` | |Toggle debug mode | +|`EEPROM_RESET` |`EEP_RST` |Resets EEPROM state by reinitializing it | +|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| +|`KC_LSPO` | |Left Shift when held, `(` when tapped | +|`KC_RSPC` | |Right Shift when held, `)` when tapped | +|`KC_LCPO` | |Left Control when held, `(` when tapped | +|`KC_RCPC` | |Right Control when held, `)` when tapped | +|`KC_LAPO` | |Left Alt when held, `(` when tapped | +|`KC_RAPC` | |Right Alt when held, `)` when tapped | +|`KC_SFTENT` | |Right Shift when held, Enter when tapped | +|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | +|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | +|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | +|`M(n)` | |Call macro `n` | +|`MACROTAP(n)` | |Macro-tap `n` idk FIXME | ## [Audio Keys](feature_audio.md) |Key |Aliases |Description | |----------------|---------|----------------------------------| -|`AU_ON` | |Audio mode on | -|`AU_OFF` | |Audio mode off | -|`AU_TOG` | |Toggles Audio mode | +|`AU_ON` | |Turns on Audio Feature | +|`AU_OFF` | |Turns off Audio Feature | +|`AU_TOG` | |Toggles Audio state | |`CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode | |`CLICKY_UP` |`CK_UP` |Increases frequency of the clicks | |`CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks | @@ -235,8 +243,6 @@ This is a reference only. Each group of keys links to the page documenting their |`MU_TOG` | |Toggles Music Mode | |`MU_MOD` | |Cycles through the music modes | - - ## [Backlighting](feature_backlight.md) |Key |Description | @@ -282,18 +288,18 @@ This is a reference only. Each group of keys links to the page documenting their |`OUT_USB` |USB only | |`OUT_BT` |Bluetooth only | - ## [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers) -|Key |Description | -|-----------------|---------------------------------------------------------------------| -|`DF(layer)` |Switches the default layer | -|`MO(layer)` |Momentarily activates layer, switches off when you let go | -|`LM(layer, mod)` |As `MO(layer)` but with `mod` active | -|`LT(layer, kc)` |Momentarily activates layer if held, sends kc if tapped | -|`TG(layer)` |Toggles the layer (enables it if no active, and vise versa) | -|`TO(layer)` |Activates layer and deactivates all other layers | -|`TT(layer)` |Momentarily activates layer if held, toggles it if tapped repeatedly | +|Key |Description | +|----------------|----------------------------------------------------------------------------------| +|`DF(layer)` |Set the base (default) layer | +|`MO(layer)` |Momentarily turn on `layer` when pressed (requires `KC_TRNS` on destination layer)| +|`OSL(layer)` |Momentarily activates `layer` until a key is pressed. See [One Shot Keys](https://docs.qmk.fm/#/feature_advanced_keycodes?id=one-shot-keys) for details. | +|`LM(layer, mod)`|Momentarily turn on `layer` (like MO) with `mod` active as well. Where `mod` is a mods_bit. Mods can be viewed [here](https://docs.qmk.fm/#/feature_advanced_keycodes?id=mod-tap). Example Implementation: `LM(LAYER_1, MOD_LALT)`| +|`LT(layer, kc)` |Turn on `layer` when held, `kc` when tapped | +|`TG(layer)` |Toggle `layer` on or off | +|`TO(layer)` |Turns on `layer` and turns off all other layers, except the default layer | +|`TT(layer)` |Normally acts like MO unless it's tapped multiple times, which toggles `layer` on | ## [Mouse Keys](feature_mouse_keys.md) @@ -318,44 +324,44 @@ This is a reference only. Each group of keys links to the page documenting their ## [Modifiers](feature_advanced_keycodes.md#modifier-keys) -|Key |Aliases |Description | -|----------|----------------------|----------------------------------------------------| -|`KC_HYPR` | |Hold Left Control, Shift, Alt and GUI | -|`KC_MEH` | |Hold Left Control, Shift and Alt | -|`LCTL(kc)`| |Hold Left Control and press `kc` | -|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | -|`LALT(kc)`| |Hold Left Alt and press `kc` | -|`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | -|`RCTL(kc)`| |Hold Right Control and press `kc` | -|`RSFT(kc)`| |Hold Right Shift and press `kc` | -|`RALT(kc)`| |Hold Right Alt and press `kc` | -|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | -|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| -|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | -|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | -|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` | -|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | -|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | +|Key |Aliases |Description | +|----------|-------------------------------|----------------------------------------------------| +|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` | +|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | +|`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` | +|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | +|`RCTL(kc)`| |Hold Right Control and press `kc` | +|`RSFT(kc)`| |Hold Right Shift and press `kc` | +|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | +|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` | +|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` | +|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | +|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | +|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | +|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| +|`KC_MEH` | |Left Control, Shift and Alt | +|`KC_HYPR` | |Left Control, Shift, Alt and GUI | ## [Mod-Tap Keys](feature_advanced_keycodes.md#mod-tap) -|Key |Aliases |Description | -|------------|---------------------------------------|-------------------------------------------------------| -|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped | -|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped | -|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped | -|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped | -|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped | -|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped | -|`LGUI_T(kc)`|`LCMD_T(kc)`, `RWIN_T(kc)`, `GUI_T(kc)`|Left GUI when held, `kc` when tapped | -|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | -|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped | -|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped| -|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped | -|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped | -|`ALL_T(kc)` | |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)| -|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | -|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | +|Key |Aliases |Description | +|-------------|-----------------------------------------------------------------|-------------------------------------------------------| +|`MT(mod, kc)`| |`mod` when held, `kc` when tapped | +|`LCTL_T(kc)` |`CTL_T(kc)` |Left Control when held, `kc` when tapped | +|`LSFT_T(kc)` |`SFT_T(kc)` |Left Shift when held, `kc` when tapped | +|`LALT_T(kc)` |`ALT_T(kc)` |Left Alt when held, `kc` when tapped | +|`LGUI_T(kc)` |`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped | +|`RCTL_T(kc)` | |Right Control when held, `kc` when tapped | +|`RSFT_T(kc)` | |Right Shift when held, `kc` when tapped | +|`RALT_T(kc)` |`ALGR_T(kc)` |Right Alt when held, `kc` when tapped | +|`RGUI_T(kc)` |`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | +|`SGUI_T(kc)` |`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | +|`LCAG_T(kc)` | |Left Control, Alt and GUI when held, `kc` when tapped | +|`RCAG_T(kc)` | |Right Control, Alt and GUI when held, `kc` when tapped | +|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped | +|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped| +|`HYPR_T(kc)` |`ALL_T(kc)` |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)| ## [RGB Lighting](feature_rgblight.md) @@ -429,18 +435,6 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_RIGHT_ANGLE_BRACKET`|`KC_RABK`, `KC_GT` |`>` | |`KC_QUESTION` |`KC_QUES` |`?` | -## [Switching and Toggling Layers](feature_advanced_keycodes.md#switching-and-toggling-layers) - -|Key |Description | -|----------------|----------------------------------------------------------------------------------| -|`LT(layer, kc)` |Turn on `layer` when held, `kc` when tapped | -|`TO(layer)` |Turn on `layer` when pressed | -|`MO(layer)` |Momentarily turn on `layer` when pressed (requires `KC_TRNS` on destination layer)| -|`DF(layer)` |Set the base (default) layer | -|`TG(layer)` |Toggle `layer` on or off | -|`TT(layer)` |Normally acts like MO unless it's tapped multiple times, which toggles `layer` on | -|`LM(layer, mod)`|Momentarily turn on `layer` (like MO) with `mod` active as well. | - ## [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) |Key |Description | @@ -448,7 +442,6 @@ This is a reference only. Each group of keys links to the page documenting their |`OSM(mod)` |Hold `mod` for one keypress | |`OSL(layer)`|Switch to `layer` for one keypress| - ## [Swap Hands](feature_swap_hands.md) |Key |Description | @@ -460,9 +453,18 @@ This is a reference only. Each group of keys links to the page documenting their |`SH_MOFF` |Momentarily turns off swap. | |`SH_TG` |Toggles swap on and off with every key press. | |`SH_TT` |Toggles with a tap; momentary when held. | + ## [Unicode Support](feature_unicode.md) -|Key |Aliases| | -|------------|-------|-------------------------------------------------| -|`UNICODE(n)`|`UC(n)`|Send Unicode character `n` | -|`X(n)` | |Send Unicode character `n` via a different method| +|Key |Aliases |Description | +|----------------------|---------|----------------------------------------------------------------| +|`UC(c)` | |Send Unicode code point `c` | +|`X(i)` | |Send Unicode code point at index `i` in `unicode_map` | +|`XP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on| +|`UNICODE_MODE_FORWARD`|`UC_MOD` |Cycle through selected input modes | +|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Cycle through selected input modes in reverse | +|`UNICODE_MODE_OSX` |`UC_M_OS`|Switch to macOS input | +|`UNICODE_MODE_LNX` |`UC_M_LN`|Switch to Linux input | +|`UNICODE_MODE_WIN` |`UC_M_WI`|Switch to Windows input | +|`UNICODE_MODE_BSD` |`UC_M_BS`|Switch to BSD input (not implemented) | +|`UNICODE_MODE_WINC` |`UC_M_WC`|Switch to Windows input using WinCompose | diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 82e94aa5e9c..6f21cabd2a6 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -97,14 +97,14 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07 ## Lock Keys -|Key |Aliases |Description | -|-------------------|--------------------|-------------------------| -|`KC_CAPSLOCK` |`KC_CLCK`, `KC_CAPS`|Caps Lock | -|`KC_SCROLLLOCK` |`KC_SLCK` |Scroll Lock | -|`KC_NUMLOCK` |`KC_NLCK` |Keypad Num Lock and Clear| -|`KC_LOCKING_CAPS` |`KC_LCAP` |Locking Caps Lock | -|`KC_LOCKING_NUM` |`KC_LNUM` |Locking Num Lock | -|`KC_LOCKING_SCROLL`|`KC_LSCR` |Locking Scroll Lock | +|Key |Aliases |Description | +|-------------------|--------------------|------------------------------------| +|`KC_CAPSLOCK` |`KC_CLCK`, `KC_CAPS`|Caps Lock | +|`KC_SCROLLLOCK` |`KC_SLCK`, `KC_BRMD`|Scroll Lock, Brightness Down (macOS)| +|`KC_NUMLOCK` |`KC_NLCK` |Keypad Num Lock and Clear | +|`KC_LOCKING_CAPS` |`KC_LCAP` |Locking Caps Lock | +|`KC_LOCKING_NUM` |`KC_LNUM` |Locking Num Lock | +|`KC_LOCKING_SCROLL`|`KC_LSCR` |Locking Scroll Lock | ## Modifiers @@ -116,16 +116,16 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07 |`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | |`KC_RCTRL` |`KC_RCTL` |Right Control | |`KC_RSHIFT`|`KC_RSFT` |Right Shift | -|`KC_RALT` | |Right Alt | +|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) | |`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)| ## International |Key |Aliases |Description | |----------|---------|-------------------------------| -|`KC_INT1` |`KC_RO` |JIS `\` and || +|`KC_INT1` |`KC_RO` |JIS `\` and `_` | |`KC_INT2` |`KC_KANA`|JIS Katakana/Hiragana | -|`KC_INT3` |`KC_JYEN`|JIS `¥` | +|`KC_INT3` |`KC_JYEN`|JIS `¥` and || |`KC_INT4` |`KC_HENK`|JIS Henkan | |`KC_INT5` |`KC_MHEN`|JIS Muhenkan | |`KC_INT6` | |JIS Numpad `,` | @@ -144,48 +144,48 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07 ## Commands -|Key |Aliases |Description | -|------------------|-------------------|------------------------------| -|`KC_PSCREEN` |`KC_PSCR` |Print Screen | -|`KC_PAUSE` |`KC_PAUS`, `KC_BRK`|Pause | -|`KC_INSERT` |`KC_INS` |Insert | -|`KC_HOME` | |Home | -|`KC_PGUP` | |Page Up | -|`KC_DELETE` |`KC_DEL` |Forward Delete | -|`KC_END` | |End | -|`KC_PGDOWN` |`KC_PGDN` |Page Down | -|`KC_RIGHT` |`KC_RGHT` |Right Arrow | -|`KC_LEFT` | |Left Arrow | -|`KC_DOWN` | |Down Arrow | -|`KC_UP` | |Up Arrow | -|`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key)| -|`KC_POWER` | |System Power (macOS/Linux) | -|`KC_EXECUTE` |`KC_EXEC` |Execute | -|`KC_HELP` | |Help | -|`KC_MENU` | |Menu | -|`KC_SELECT` |`KC_SLCT` |Select | -|`KC_STOP` | |Stop | -|`KC_AGAIN` |`KC_AGIN` |Again | -|`KC_UNDO` | |Undo | -|`KC_CUT` | |Cut | -|`KC_COPY` | |Copy | -|`KC_PASTE` |`KC_PSTE` |Paste | -|`KC_FIND` | |Find | -|`KC__MUTE` | |Mute (macOS) | -|`KC__VOLUP` | |Volume Up (macOS) | -|`KC__VOLDOWN` | |Volume Down (macOS) | -|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase | -|`KC_SYSREQ` | |SysReq/Attention | -|`KC_CANCEL` | |Cancel | -|`KC_CLEAR` |`KC_CLR` |Clear | -|`KC_PRIOR` | |Prior | -|`KC_RETURN` | |Return | -|`KC_SEPARATOR` | |Separator | -|`KC_OUT` | |Out | -|`KC_OPER` | |Oper | -|`KC_CLEAR_AGAIN` | |Clear/Again | -|`KC_CRSEL` | |CrSel/Props | -|`KC_EXSEL` | |ExSel | +|Key |Aliases |Description | +|------------------|------------------------------|------------------------------| +|`KC_PSCREEN` |`KC_PSCR` |Print Screen | +|`KC_PAUSE` |`KC_PAUS`, `KC_BRK`, `KC_BRMU`|Pause, Brightness Up (macOS) | +|`KC_INSERT` |`KC_INS` |Insert | +|`KC_HOME` | |Home | +|`KC_PGUP` | |Page Up | +|`KC_DELETE` |`KC_DEL` |Forward Delete | +|`KC_END` | |End | +|`KC_PGDOWN` |`KC_PGDN` |Page Down | +|`KC_RIGHT` |`KC_RGHT` |Right Arrow | +|`KC_LEFT` | |Left Arrow | +|`KC_DOWN` | |Down Arrow | +|`KC_UP` | |Up Arrow | +|`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key)| +|`KC_POWER` | |System Power (macOS/Linux) | +|`KC_EXECUTE` |`KC_EXEC` |Execute | +|`KC_HELP` | |Help | +|`KC_MENU` | |Menu | +|`KC_SELECT` |`KC_SLCT` |Select | +|`KC_STOP` | |Stop | +|`KC_AGAIN` |`KC_AGIN` |Again | +|`KC_UNDO` | |Undo | +|`KC_CUT` | |Cut | +|`KC_COPY` | |Copy | +|`KC_PASTE` |`KC_PSTE` |Paste | +|`KC_FIND` | |Find | +|`KC__MUTE` | |Mute (macOS) | +|`KC__VOLUP` | |Volume Up (macOS) | +|`KC__VOLDOWN` | |Volume Down (macOS) | +|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase | +|`KC_SYSREQ` | |SysReq/Attention | +|`KC_CANCEL` | |Cancel | +|`KC_CLEAR` |`KC_CLR` |Clear | +|`KC_PRIOR` | |Prior | +|`KC_RETURN` | |Return | +|`KC_SEPARATOR` | |Separator | +|`KC_OUT` | |Out | +|`KC_OPER` | |Oper | +|`KC_CLEAR_AGAIN` | |Clear/Again | +|`KC_CRSEL` | |CrSel/Props | +|`KC_EXSEL` | |ExSel | ## Media Keys @@ -219,6 +219,8 @@ Windows and macOS use different keycodes for "next track" and "previous track". |`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites (Windows) | |`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS) | |`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track (macOS) | +|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up | +|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down | ## Number Pad diff --git a/docs/keymap.md b/docs/keymap.md index 382a0e911ba..457dbf67e1c 100644 --- a/docs/keymap.md +++ b/docs/keymap.md @@ -1,6 +1,6 @@ # Keymap Overview -QMK keymaps are defined inside a C source file. The data structure is an array of arrays. The outer array is a list of layer arrays while the inner layer array is a list of keys. Most keyboards define a `KEYMAP()` macro to help you create this array of arrays. +QMK keymaps are defined inside a C source file. The data structure is an array of arrays. The outer array is a list of layer arrays while the inner layer array is a list of keys. Most keyboards define a `LAYOUT()` macro to help you create this array of arrays. ## Keymap and Layers @@ -119,7 +119,7 @@ The main part of this file is the `keymaps[]` definition. This is where you list const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -After this you'll find a list of KEYMAP() macros. A KEYMAP() is simply a list of keys to define a single layer. Typically you'll have one or more "base layers" (such as QWERTY, Dvorak, or Colemak) and then you'll layer on top of that one or more "function" layers. Due to the way layers are processed you can't overlay a "lower" layer on top of a "higher" layer. +After this you'll find a list of LAYOUT() macros. A LAYOUT() is simply a list of keys to define a single layer. Typically you'll have one or more "base layers" (such as QWERTY, Dvorak, or Colemak) and then you'll layer on top of that one or more "function" layers. Due to the way layers are processed you can't overlay a "lower" layer on top of a "higher" layer. `keymaps[][MATRIX_ROWS][MATRIX_COLS]` in QMK holds the 16 bit action code (sometimes referred as the quantum keycode) in it. For the keycode representing typical keys, its high byte is 0 and its low byte is the USB HID usage ID for keyboard. @@ -131,7 +131,7 @@ Here is an example of the Clueboard's base layer: /* Keymap _BL: Base Layer (Default Layer) */ - [_BL] = KEYMAP( + [_BL] = LAYOUT( F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ @@ -149,7 +149,7 @@ Some interesting things to note about this: Our function layer is, from a code point of view, no different from the base layer. Conceptually, however, you will build that layer as an overlay, not a replacement. For many people this distinction does not matter, but as you build more complicated layering setups it matters more and more. - [_FL] = KEYMAP( + [_FL] = LAYOUT( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, BL_STEP, \ _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, _______, \ _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \ @@ -161,62 +161,6 @@ Some interesting things to note: * We have used our `_______` definition to turn `KC_TRNS` into `_______`. This makes it easier to spot the keys that have changed on this layer. * While in this layer if you press one of the `_______` keys it will activate the key in the next lowest active layer. -### Custom Functions - -At the bottom of the file we've defined a single custom function. This function defines a key that sends `KC_ESC` when pressed without modifiers and `KC_GRAVE` when modifiers are held. There are a couple pieces that need to be in place for this to work, and we will go over both of them. - -#### `fn_actions[]` - -We define the `fn_actions[]` array to point to custom functions. `F(N)` in a keymap will call element N of that array. For the Clueboard's that looks like this: - - const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(0), // Calls action_function() - }; - -In this case we've instructed QMK to call the `ACTION_FUNCTION` callback, which we will define in the next section. - -> This `fn_actions[]` interface is mostly for backward compatibility. In QMK, you don't need to use `fn_actions[]`. You can directly use `ACTION_FUNCTION(N)` or any other action code value itself normally generated by the macro in `keymaps[][MATRIX_ROWS][MATRIX_COLS]`. N in `F(N)` can only be 0 to 31. Use of the action code directly in `keymaps` unlocks this limitation. - -You can get a full list of Action Functions in [action_code.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_code.h). - -#### `action_function()` - -To actually handle the keypress event we define an `action_function()`. This function will be called when the key is pressed, and then again when the key is released. We have to handle both situations within our code, as well as determining whether to send/release `KC_ESC` or `KC_GRAVE`. - - void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t mods_pressed; - - switch (id) { - case 0: - /* Handle the combined Grave/Esc key - */ - mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed - - if (record->event.pressed) { - /* The key is being pressed. - */ - if (mods_pressed) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - /* The key is being released. - */ - if (mods_pressed) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } - } - # Nitty Gritty Details This should have given you a basic overview for creating your own keymap. For more details see the following resources: diff --git a/docs/newbs.md b/docs/newbs.md index e687fd22794..904a5294551 100644 --- a/docs/newbs.md +++ b/docs/newbs.md @@ -6,13 +6,18 @@ Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built y ## Overview -There are 5 main sections to this guide: +There are 7 main sections to this guide: * [Getting Started](newbs_getting_started.md) -* [Building Your First Firmware](newbs_building_firmware.md) +* [Building Your First Firmware using the command line](newbs_building_firmware.md) +* [Building Your First Firmware using the online GUI](newbs_building_firmware_configurator.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) -* [Best Practices](newbs_best_practices.md) +* [Git Best Practices](newbs_best_practices.md) * [Learn More with these Resources](newbs_learn_more_resources.md) This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md). + +## Additional Resources + +* [Thomas Baart's QMK Basics Blog](https://thomasbaart.nl/category/mechanical-keyboards/firmware/qmk/qmk-basics/) – A user-created blog covering the basics of how to use QMK Firmware, as seen from a new user's perspective. diff --git a/docs/newbs_building_firmware_configurator.md b/docs/newbs_building_firmware_configurator.md new file mode 100644 index 00000000000..becceb6693e --- /dev/null +++ b/docs/newbs_building_firmware_configurator.md @@ -0,0 +1,105 @@ +# QMK Configurator + +The [QMK Configurator](https://config.qmk.fm) is an online graphical user interface that generates QMK Firmware hex files. + +?> **Please follow these steps in order.** + +Watch the [Video Tutorial](https://youtu.be/tx54jkRC9ZY) + +The QMK Configurator works best with Chrome/Firefox. + + +!> **Files from other tools such as KLE, or kbfirmware will not be compatible with QMK Configurator. Do not load them, do not import them. QMK Configurator is a DIFFERENT tool. ** + +## Selecting your keyboard + +Click the drop down box and select the keyboard you want to create a keymap for. + +?> If your keyboard has several versions, make sure you select the correct one.** + +I'll say that again because it's important + +!> **MAKE SURE YOU SELECT THE RIGHT VERSION!** + +If your keyboard has been advertised to be powered by QMK but is not in the list, chances are a developer hasn't gotten to it yet or we haven't had a chance to merge it in yet. File an issue at [qmk_firmware](https://github.com/qmk/qmk_firmware/issues) requesting to support that particular keyboard, if there is no active [Pull Request](https://github.com/qmk/qmk_firmware/pulls?q=is%3Aopen+is%3Apr+label%3Akeyboard) for it. There are also QMK powered keyboards that are in their manufacturer's own github accounts. Double check for that as well. + +## Selecting your keyboard layout + +Choose the layout that best represents the keymap you want to create. Some keyboards do not have enough layouts or correct layouts defined yet. They will be supported in the future. + +## Keymap Name + +Call this keymap what you want. + +?> If you are running into issues when compiling, it may be worth changing this name, as it may already exist in the QMK Firmware repo. + +## Creating Your Keymap + +Keycode Entry is accomplished in 3 ways. +1. Drag and dropping +2. Clicking on an empty spot on the layout and clicking the keycode you desire +3. Clicking on an empty spot on the layout, pressing the physical key on your keyboard. + +Hover your mouse over a key and a short blurb will tell you what that keycode does. For a more verbose description please see + +[Basic Keycode Reference](https://docs.qmk.fm/#/keycodes_basic) +[Advanced Keycode Reference](https://docs.qmk.fm/#/feature_advanced_keycodes) + +In the event that you can't find a layout that supports your keymap, for example three spots for spacebar, or two spots for backspace, or 2 spots for shift etc etc, Fill them ALL up. + +### Example: + +3 spots for spacebar: Fill them ALL with spacebar + +2 spots for backspace: Fill them BOTH with backspace + +2 spots for right shift: Fill them BOTH with right shift + +1 spot for left shift and 1 spot for iso support: Fill them both with left shift + +5 spots, but only 4 keys: Guess and check or ask someone who has done it before. + +## Saving Your Keymap for Future Edits + +When you're satisfied with your keymap or just want to work on it later, press the `Export Keymap` button. It will save your keymap as the name you chose above appended with .json. + +You can then load this .json file in the future by pressing the `Import Keymap` button. + +!> **CAUTION:** This is not the same type of .json file used for kbfirmware.com or any other tool. If you try to use this for those tools, or the .json from those tools with QMK Configurator, there is a chance your keyboard will **explode**. + +## Generating your firmware file + +Press the green `Compile` button. + +When the compilation is done, you will be able to press the green `Download Firmware` button. + +## Flashing Your Keyboard + +Please refer to [Flashing Firmware](newbs_flashing.md) + +## Troubleshooting + +#### My .json file is not working + +If the .json file was generated with QMK Configurator, congratulations you have stumbled upon a bug. File an issue at [qmk_configurator](https://github.com/qmk/qmk_configurator/issues) + +If not....how did you miss my big bold message at the top saying not to use other .json files? + +#### There are extra spaces in my layout? What do I do? + +If you're referring to having three spots for space bar, the best course of action is to just fill them all with space bar. The same can be done for backspace and shifts + +#### What is the keycode for....... + +Please see + +[Basic Keycode Reference](https://docs.qmk.fm/#/keycodes_basic) +[Advanced Keycode Reference](https://docs.qmk.fm/#/feature_advanced_keycodes) + +#### It won't compile + +Please double check the other layers of your keymap to make sure there are no random keys present. + +## Problems and Bugs + +We are always accepting customer requests and bug reports. Please file them at [qmk_configurator](https://github.com/qmk/qmk_configurator/issues) diff --git a/docs/newbs_flashing.md b/docs/newbs_flashing.md index 0b0ede37c4e..c8a30dba05b 100644 --- a/docs/newbs_flashing.md +++ b/docs/newbs_flashing.md @@ -86,7 +86,7 @@ If you know what bootloader that you're using, then when compiling the firmware, ### DFU -For the DFU bootloader, when you're ready to compile and flash your firmware, open up your terminal window and run the built command: +For the DFU bootloader, when you're ready to compile and flash your firmware, open up your terminal window and run the build command: make ::dfu @@ -127,13 +127,21 @@ Once it does this, you'll want to reset the controller. It should then show out >>> dfu-programmer atmega32u4 reset ``` -If you have any issues with this, you may need to this: +?> If you have any issues with this - such as `dfu-programmer: no device present` - please see the [Frequently Asked Build Questions](faq_build.md). + +#### DFU commands + +There are a number of DFU commands that you can use to flash firmware to a DFU device: + +* `:dfu` - This is the normal option and waits until a DFU device is available, and then flashes the firmware. This will check every 5 seconds, to see if a DFU device has appeared. +* `:dfu-ee` - This flashes an `eep` file instead of the normal hex. This is uncommon. +* `:dfu-split-left` - This flashes the normal firmware, just like the default option (`:dfu`). However, this also flashes the "Left Side" EEPROM file for split keyboards. _This is ideal for Elite C based split keyboards._ +* `:dfu-split-right` - This flashes the normal firmware, just like the default option (`:dfu`). However, this also flashes the "Right Side" EEPROM file for split keyboards. _This is ideal for Elite C based split keyboards._ - sudo make ::dfu ### Caterina -For Arduino boards and their close (such as the SparkFun ProMicro), when you're ready to compile and flash your firmware, open up your terminal window and run the built command: +For Arduino boards and their clones (such as the SparkFun ProMicro), when you're ready to compile and flash your firmware, open up your terminal window and run the build command: make ::avrdude @@ -199,15 +207,23 @@ If you have any issues with this, you may need to this: sudo make ::avrdude + +Additionally, if you want to flash multiple boards, use the following command: + + make ::avrdude-loop + +When you're done flashing boards, you'll need to hit Ctrl + C or whatever the correct keystroke is for your operating system to break the loop. + + ## HalfKay -For the PJRC devices (Teensy's), when you're ready to compile and flash your firmware, open up your terminal window and run the built command: +For the PJRC devices (Teensy's), when you're ready to compile and flash your firmware, open up your terminal window and run the build command: make ::teensy For example, if your keymap is named "xyverz" and you're building a keymap for an Ergodox or Ergodox EZ, you'll use this command: - make erdogox_ez:xyverz:teensy + make ergodox_ez:xyverz:teensy Once the firmware finishes compiling, it will output something like this: @@ -226,12 +242,61 @@ Waiting for Teensy device... ``` Found HalfKay Bootloader -Read "./.build/ergodox_ez_drashna.hex": 28532 bytes, 88.5% usage +Read "./.build/ergodox_ez_xyverz.hex": 28532 bytes, 88.5% usage Programming............................................................................................................................................................................ ................................................... Booting ``` +## STM32 (ARM) + +For a majority of ARM boards (including the Proton C, Planck Rev 6, and Preonic Rev 3), when you're ready to compile and flash your firmware, open up your terminal window and run the build command: + + make ::dfu-util + +For example, if your keymap is named "xyverz" and you're building a keymap for the Planck Revision 6 keyboard, you'll use this command and then reboot the keyboard to the bootloader (before it finishes compiling): + + make planck/rev6:xyverz:dfu-util + +Once the firmware finishes compiling, it will output something like this: + +``` +Linking: .build/planck_rev6_xyverz.elf [OK] +Creating binary load file for flashing: .build/planck_rev6_xyverz.bin [OK] +Creating load file for flashing: .build/planck_rev6_xyverz.hex [OK] + +Size after: + text data bss dec hex filename + 0 41820 0 41820 a35c .build/planck_rev6_xyverz.hex + +Copying planck_rev6_xyverz.bin to qmk_firmware folder [OK] +dfu-util 0.9 + +Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. +Copyright 2010-2016 Tormod Volden and Stefan Schmidt +This program is Free Software and has ABSOLUTELY NO WARRANTY +Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ + +Invalid DFU suffix signature +A valid DFU suffix will be required in a future dfu-util release!!! +Opening DFU capable USB device... +ID 0483:df11 +Run-time device DFU version 011a +Claiming USB DFU Interface... +Setting Alternate Setting #0 ... +Determining device status: state = dfuERROR, status = 10 +dfuERROR, clearing status +Determining device status: state = dfuIDLE, status = 0 +dfuIDLE, continuing +DFU mode device DFU version 011a +Device returned transfer size 2048 +DfuSe interface name: "Internal Flash " +Downloading to address = 0x08000000, size = 41824 +Download [=========================] 100% 41824 bytes +Download done. +File downloaded successfully +Transitioning to dfuMANIFEST state +``` ## Test It Out! diff --git a/docs/newbs_getting_started.md b/docs/newbs_getting_started.md index 2181542856b..ae4b799a9c5 100644 --- a/docs/newbs_getting_started.md +++ b/docs/newbs_getting_started.md @@ -1,99 +1,102 @@ # Introduction -Your computer keyboard has a processor inside of it, not unlike the one inside your computer. This processor runs software that is responsible for detecting button presses and sending reports about the state of the keyboard when they are pressed or released. QMK fills the role of that software, detecting button presses and passing that information on to the host computer. When you build your custom layout you are creating the equivalent of an .exe for your keyboard. +Your computer keyboard has a processor inside of it, not unlike the one inside your computer. This processor runs software that is responsible for detecting button presses and sending reports about the state of the keyboard when buttons are pressed or released. QMK fills the role of that software, detecting button presses and passing that information on to the host computer. When you build your custom keymap, you are creating the equivalent of an executable program for your keyboard. -QMK tries to put a lot of power into your hands by making easy things easy, and hard things possible. You don't have to know how to program to create powerful layouts, you only have to follow a few simple syntax rules. +QMK tries to put a lot of power into your hands by making easy things easy, and hard things possible. You don't have to know how to program to create powerful keymaps — you only have to follow a few simple syntax rules. # Getting Started -Before you can build keymaps you need to install some software and setup your build environment. This only has to be done one time no matter how many keyboards you want to compile firmware for. +Before you can build keymaps, you need to install some software and set up your build environment. This only has to be done once no matter how many keyboards you plan to compile firmware for. + +If you would prefer a more graphical user interface approach, please consider using the online [QMK Configurator](https://config.qmk.fm). Please refer to [Building Your First Firmware using the online GUI](newbs_building_firmware_configurator.md). + ## Download Software ### Text Editor -You'll need a program that can edit and save **plain text** files. If you are on Windows you can make due with Notepad, and on Linux you can use Gedit, both of which are simple but functional text editors. On macOS be careful with TextEdit.app, it will not save plain text files unless you make sure to select "Make Plain text" from the "Format" menu, or you can use another program such as Sublime Text. +You'll need a program that can edit and save **plain text** files. If you're on Windows you can make do with Notepad, and on Linux you can use gedit. Both of these are simple but functional text editors. On macOS, be careful with the default TextEdit app: it will not save plain text files unless you explicitly select _Make Plain Text_ from the _Format_ menu. + +You can also download and install a dedicated text editor like [Sublime Text](https://www.sublimetext.com/) or [VS Code](https://code.visualstudio.com/). This is probably the best way to go regardless of platform, as these programs are specifically made for editing code. ?> Not sure which text editor to use? Laurence Bradford wrote [a great introduction](https://learntocodewith.me/programming/basics/text-editors/) to the subject. ### QMK Toolbox -QMK Toolbox is an optional graphical Windows and macOS program that allows you to both program and debug your custom keyboard. You will likely prefer it to easily flash your keyboard and receive the debugging messages that your keyboard will print. +QMK Toolbox is an optional graphical program for Windows and macOS that allows you to both program and debug your custom keyboard. You will likely find it invaluable for easily flashing your keyboard and viewing debug messages that it prints. -Download the files from the links below: +[Download the latest release here.](https://github.com/qmk/qmk_toolbox/releases/latest) -For Windows: "qmk_toolbox.exe" or "qmk_toolbox_install.exe" (with installer) +* For Windows: `qmk_toolbox.exe` (portable) or `qmk_toolbox_install.exe` (installer) +* For macOS: `QMK.Toolbox.app.zip` (portable) or `QMK.Toolbox.pkg` (installer) -For Mac: "QMK.Toolbox.app.zip" or "QMK.Toolbox.pkg" (with installer) +## Set Up Your Environment -* [Newest Release](https://github.com/qmk/qmk_toolbox/releases/latest) -* [Source Code](https://github.com/qmk/qmk_toolbox/) +We've tried to make QMK as easy to set up as possible. You only have to prepare your Linux or Unix environment, then let QMK install the rest. -## Environment Setup - -We've tried to make QMK as easy to setup as possible. You only have to prepare your Linux or Unix environment and let QMK install the rest. - -?> If you haven't worked with the Linux/Unix command line before there are a few basic concepts and commands you should learn. These resources will teach you enough to work with QMK:
+?> If you haven't worked with the Linux/Unix command line before, there are a few basic concepts and commands you should learn. These resources will teach you enough to be able to work with QMK:
[Must Know Linux Commands](https://www.guru99.com/must-know-linux-commands.html)
[Some Basic Unix Commands](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html) ### Windows -You will need to install msys2 and git. +You will need to install MSYS2 and Git. -* Follow the installation instructions on the msys2 homepage: http://www.msys2.org -* Close any open msys2 terminals, and open a new terminal -* Install git by running this command: `pacman -S git` +* Follow the installation instructions on the [MSYS2 homepage](http://www.msys2.org). +* Close any open MSYS2 terminals and open a new MSYS2 MinGW 64-bit terminal. +* Install Git by running this command: `pacman -S git`. ### macOS -You will need to install homebrew. Follow the instructions on the homebrew homepage: https://brew.sh +You will need to install Homebrew. Follow the instructions on the [Homebrew homepage](https://brew.sh). -After homebrew is installed continue with "Download QMK", following step "Setup QMK" runs a script that will install other packages. +After Homebrew is installed, continue with _Set Up QMK_. In that step you will run a script that will install other packages. ### Linux -You will need to install git. It's extremely likely you already have it, but if not one of the following commands should install it: +You will need to install Git. It's very likely that you already have it, but if not, one of the following commands should install it: -* Debian/Ubuntu/Devuan: `apt-get install git` -* Fedora/Redhat/Centos: `yum install git` +* Debian / Ubuntu / Devuan: `apt-get install git` +* Fedora / Red Hat / CentOS: `yum install git` * Arch: `pacman -S git` -## Download QMK +?> Docker is also an option on all platforms. [Click here for details.](getting_started_build_tools.md#docker) -Once you have setup your Linux/Unix environment you are ready to download QMK. We will do this by using git to "clone" the QMK repository. Open a Terminal or MSYS2 Console window and leave it open for the remainder of this guide. Inside that window run these two commands: +## Set Up QMK - git clone https://github.com/qmk/qmk_firmware.git - cd qmk_firmware +Once you have set up your Linux/Unix environment, you are ready to download QMK. We will do this by using Git to "clone" the QMK repository. Open a Terminal or MSYS2 MinGW window and leave it open for the remainder of this guide. Inside that window run these two commands: -?> If you already know [how to use GitHub](getting_started_github.md) we recommend you create and clone your own fork instead. If you don't know what that means you can safely ignore this message. +```shell +git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git +cd qmk_firmware +``` -## Setup QMK +?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create and clone your own fork instead. If you don't know what that means, you can safely ignore this message. -QMK comes with a script to help you setup the rest of what you'll need. You should run it now by typing in this command: +QMK comes with a script to help you set up the rest of what you'll need. You should run it now by typing in this command: - ./util/qmk_install.sh + util/qmk_install.sh ## Test Your Build Environment -Now that your QMK build environment is setup you can build a firmware for your keyboard. Start by trying to build the default layout for your keyboard. You should be able to do that with a command in this format: +Now that your QMK build environment is set up, you can build a firmware for your keyboard. Start by trying to build the keyboard's default keymap. You should be able to do that with a command in this format: make :default -For example, to build a firmware for a Clueboard 66% use: +For example, to build a firmware for a Clueboard 66% you would use: make clueboard/66/rev3:default When it is done you should have a lot of output that ends similar to this: ``` -Linking: .build/clueboard_66_rev2_default.elf [OK] -Creating load file for flashing: .build/clueboard_66_rev2_default.hex [OK] -Copying clueboard_66_rev2_default.hex to qmk_firmware folder [OK] -Checking file size of clueboard_66_rev2_default.hex [OK] - * File size is fine - 25174/28672 +Linking: .build/clueboard_66_rev3_default.elf [OK] +Creating load file for flashing: .build/clueboard_66_rev3_default.hex [OK] +Copying clueboard_66_rev3_default.hex to qmk_firmware folder [OK] +Checking file size of clueboard_66_rev3_default.hex [OK] + * The firmware size is fine - 26356/28672 (2316 bytes free) ``` -## Creating Your Layout +# Creating Your Keymap -Now you are ready to create your own personal layout. Move on to [Building Your First Firmware](newbs_building_firmware.md) for that. +You are now ready to create your own personal keymap! Move on to [Building Your First Firmware](newbs_building_firmware.md) for that. diff --git a/docs/newbs_testing_debugging.md b/docs/newbs_testing_debugging.md index 1d8021dec8f..771846b4099 100644 --- a/docs/newbs_testing_debugging.md +++ b/docs/newbs_testing_debugging.md @@ -13,9 +13,27 @@ Note: These programs are not provided by or endorsed by QMK. * [Keyboard Tester](http://www.keyboardtester.com) (Web Based) * [Keyboard Checker](http://keyboardchecker.com) (Web Based) -## Debugging With QMK Toolbox +## Debugging -[QMK Toolbox](https://github.com/qmk/qmk_toolbox) will show messages from your keyboard if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, or use the [Command](feature_command.md) feature to enable debug mode. +Your keyboard will output debug information if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap. + +```c +void keyboard_post_init_user(void) { + // Customise these values to desired behaviour + debug_enable=true; + debug_matrix=true; + //debug_keyboard=true; + //debug_mouse=true; +} +``` + +### Debugging With QMK Toolbox + +For compatible platforms, [QMK Toolbox](https://github.com/qmk/qmk_toolbox) can be used to display debug messages from your keyboard. + +### Debugging With hid_listen + +Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_listen.html), provided by PJRC, can also be used to display debug messages. Prebuilt binaries for Windows,Linux,and MacOS are available. @@ -28,6 +46,54 @@ Sometimes it's useful to print debug messages from within your [custom code](cus After that you can use a few different print functions: * `print("string")`: Print a simple string. -* `sprintf("%s string", var)`: Print a formatted string +* `uprintf("%s string", var)`: Print a formatted string * `dprint("string")` Print a simple string, but only when debug mode is enabled * `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled + +## Debug Examples + +Below is a collection of real world debugging examples. For additional information, refer to [Debugging/Troubleshooting QMK](faq_debug.md). + +### Which matrix position is this keypress? + +When porting, or when attempting to diagnose pcb issues, it can be useful to know if a keypress is scanned correctly. To enable logging for this scenario, add the following code to your keymaps `keymap.c` + +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // If console is enabled, it will print the matrix position and status of each key pressed +#ifdef CONSOLE_ENABLE + uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); +#endif + return true; +} +``` + +Example output +```text +Waiting for device:....... +Listening: +KL: kc: 169, col: 0, row: 0, pressed: 1 +KL: kc: 169, col: 0, row: 0, pressed: 0 +KL: kc: 174, col: 1, row: 0, pressed: 1 +KL: kc: 174, col: 1, row: 0, pressed: 0 +KL: kc: 172, col: 2, row: 0, pressed: 1 +KL: kc: 172, col: 2, row: 0, pressed: 0 +``` + +### How long did it take to scan for a keypress? + +When testing performance issues, it can be useful to know the frequency at which the switch matrix is being scanned. To enable logging for this scenario, add the following code to your keymaps `config.h` + +```c +#define DEBUG_MATRIX_SCAN_RATE +``` + +Example output +```text + > matrix scan frequency: 315 + > matrix scan frequency: 313 + > matrix scan frequency: 316 + > matrix scan frequency: 316 + > matrix scan frequency: 316 + > matrix scan frequency: 316 +``` diff --git a/docs/eclipse.md b/docs/other_eclipse.md similarity index 100% rename from docs/eclipse.md rename to docs/other_eclipse.md diff --git a/docs/other_vscode.md b/docs/other_vscode.md new file mode 100644 index 00000000000..7427f758e5b --- /dev/null +++ b/docs/other_vscode.md @@ -0,0 +1,117 @@ +# Setting up Visual Studio Code for QMK Development + +[Visual Studio Code](https://code.visualstudio.com/) (VS Code) is an open-source code editor that supports many different programming languages. + +Using a full-featured editor such as VS Code provides many advantages over a plain text editor, such as: +* intelligent code completion +* convenient navigation in the code +* refactoring tools +* build automation (no need for the command-line) +* a graphical front end for GIT +* many other tools such as debugging, code formatting, showing call hierarchies etc. + +The purpose of this page is to document how to set up VS Code for developing QMK Firmware. + +This guide covers how to configure everything needed on Windows and Ubuntu 18.04 + +# Set up VS Code +Before starting, you will want to make sure that you have all of the build tools set up, and QMK Firmware cloned. Head to the the [Newbs Getting Started Guide](newbs_getting_started.md) to get things set up, if you haven't already. + +## Windows + +### Prerequisites + +* [Git for Windows](https://git-scm.com/download/win) (This link will prompt to save/run the installer) + + 1. Disable all of the options but `Git LFS (Large File Support)` and `Check daily for Git for Windows updates`. + 2. Set the default editor to `Use Visual Studio Code as Git's default editor` + 3. Select the `Use Git from Git Bash only` option, since that's the option that you should use here. + 4. For the `Choosing HTTPS transport backend`, either option should be fine. + 5. Select the `Checkout as-is, commit Unix-style line endings` option. QMK Firmware uses Unix style commits. + 6. For the extra options, leave the default options as is. + + This software is needed for Git support in VS Code. It may be possible to not include this, but it is much simpler to just use this. + +* [Git Credential Manager for Windows](https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases) (Optional) + + This software provides better support for Git by providing secure storage for git credentials, MFA and personal access token generation. + + This isn't strictly needed, but we would recommend it. + + +### Installing VS Code + +1. Head to [VS Code](https://code.visualstudio.com/) and download the installer +2. Run the installer + +This part is super simple. However, there is some configuration that we need to do to ensure things are configured correctly. + +### Configuring VS Code + +First, we need to set up IntelliSense. This isn't strictly required, but it will make your life a LOT easier. To do this, we need to create the `.vscode/c_cpp_properies.json` file in the QMK Firmware folder, You can do this all manually, but I've done most of the work already. + +Grab [this file](https://gist.github.com/drashna/48e2c49ce877be592a1650f91f8473e8) and save it. You may need to edit this file, if you didn't install MSYS2 to the default location, or are using WSL/LxSS. + +Once you have saved this file, you will need to reload VS Code, if it was already running. + +?> You should see an `extensions.json` and `settings.json` file in the `.vscode` folder, as well. + + +Now, we will set up the MSYS2 window to show up in VSCode as the integrated terminal. This has a number of advantages. Mostly, you can control+click on errors and jump to those files. This makes debugging much easier. It's also nice, in that you don't have to jump to another window. + +1. Click File > Preferences > > Settings +2. Click on the {} button, in the top right to open the `settings.json` file. +3. Set the file's content to: + + ```json + { + "terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe", + "terminal.integrated.env.windows": { + "MSYSTEM": "MINGW64", + "CHERE_INVOKING": "1" + }, + "terminal.integrated.shellArgs.windows": [ + "--login" + ], + "terminal.integrated.cursorStyle": "line" + } + ``` + + If there are settings here already, then just add everything between the first and last curly brackets. + +?> If you installed MSYS2 to a different folder, then you'll need to change the path for `terminal.integrated.shell.windows` to the correct path for your system. + +4. Hit Ctrl-` (grave) to bring up the terminal. + + This should start the terminal in the workspace's folder (so the `qmk_firmware` folder), and then you can compile your keyboard. + + +## Every other Operating System + +1. Head to [VS Code](https://code.visualstudio.com/) and download the installer +2. Run the installer +3. That's it + +No, really, that's it. The paths needed are already included when installing the packages, and it is much better about detecting the current workspace files and parsing them for IntelliSense. + +## Plugins + +There are a number of extensions that you may want to install: + +* [Git Extension Pack](https://marketplace.visualstudio.com/items?itemName=donjayamanne.git-extension-pack) - +This installs a bunch of Git related tools that may make using Git with QMK Firmware easier. +* [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) - _[Optional]_ - Helps to keep the code to the QMK Coding Conventions. +* [Bracket Pair Colorizer 2](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer-2) - _[Optional]_ - This color codes the brackets in your code, to make it easier to reference nested code. +* [Github Markdown Preview](https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview) - _[Optional]_ - Makes the markdown preview in VS Code more like GitHub's. +* [VS Live Share Extension Pack](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack) - _[Optional]_ - This extension allows somebody else to access your workspace (or you to access somebody else's workspace) and help out. This is great if you're having issues and need some help from somebody. +* [VIM Keymap](https://marketplace.visualstudio.com/items?itemName=GiuseppeCesarano.vim-keymap) - _[Optional]_ - For those that prefer VIM style keybindings. There are other options for this, too. +* [Travis CI Status](https://marketplace.visualstudio.com/items?itemName=felixrieseberg.vsc-travis-ci-status) - _[Optional]_ - This shows the current Travis CI status, if you have it set up. + +Restart once you've installed any extensions + +# Configure VS Code for QMK +1. Click File > Open Folder +2. Open the QMK Firmware folder that you cloned from GitHub. +3. Click File > Save Workspace As... + +And now you're ready to code QMK Firmware in VS Code diff --git a/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md b/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md index 50d291a2300..979eafbc80f 100644 --- a/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md +++ b/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md @@ -1,14 +1,24 @@ -Setting up your ARM based PCB is a little more involved than an Atmel MCU, but is easy enough. Start by using `util/new_project.sh ` to create a new project: +Setting up your ARM based PCB is a little more involved than an Atmel MCU, but is easy enough. Start by running `util/new_keyboard.sh`: ``` -$ util/new_project.sh simontester -###################################################### -# /keyboards/simontester project created. To start -# working on things, cd into keyboards/simontester -###################################################### -``` +$ ./util/new_keyboard.sh +Generating a new QMK keyboard directory + +Keyboard Name: mycoolkb +Keyboard Type [avr]: +Your Name [John Smith]: +Copying base template files... done +Copying avr template files... done +Renaming keyboard files... done +Replacing %KEYBOARD% with mycoolkb... done +Replacing %YOUR_NAME% with John Smith... done +Created a new keyboard called mycoolkb. + +To start working on things, cd into keyboards/mycoolkb, +or open the directory in your favourite text editor. +``` # END OF NEW ARM DOC, OLD ATMEL DOC FOLLOWS @@ -22,6 +32,8 @@ The `MATRIX_ROW_PINS` and `MATRIX_COL_PINS` are the pins your MCU uses on each r For the `DIODE_DIRECTION`, most hand-wiring guides will instruct you to wire the diodes in the `COL2ROW` position, but it's possible that they are in the other - people coming from EasyAVR often use `ROW2COL`. Nothing will function if this is incorrect. +To configure a keyboard where each switch is connected to a separate pin and ground instead of sharing row and column pins, use `DIRECT_PINS`. The mapping defines the pins of each switch in rows and columns, from left to right. Must conform to the sizes within `MATRIX_ROWS` and `MATRIX_COLS`, use `NO_PIN` to fill in blank spaces. Overrides the behaviour of `DIODE_DIRECTION`, `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`. + `BACKLIGHT_PIN` is the pin that your PWM-controlled backlight (if one exists) is hooked-up to. Currently only B5, B6, and B7 are supported. `BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap. @@ -54,10 +66,10 @@ This is where all of the custom logic for your keyboard goes - you may not need ## `/keyboards//.h` -Here is where you can (optionally) define your `KEYMAP` function to remap your matrix into a more readable format. With ortholinear boards, this isn't always necessary, but it can help to accommodate the dead spots on your matrix, where there are keys that take up more than one space (2u, staggering, 6.25u, etc). The example shows the difference between the physical keys, and the matrix design: +Here is where you can (optionally) define your `LAYOUT` function to remap your matrix into a more readable format. With ortholinear boards, this isn't always necessary, but it can help to accommodate the dead spots on your matrix, where there are keys that take up more than one space (2u, staggering, 6.25u, etc). The example shows the difference between the physical keys, and the matrix design: ``` -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, \ k10, k11 \ ) \ diff --git a/docs/proton_c_conversion.md b/docs/proton_c_conversion.md new file mode 100644 index 00000000000..be7d50a9f41 --- /dev/null +++ b/docs/proton_c_conversion.md @@ -0,0 +1,21 @@ +# Converting a board to use the Proton C + +If a board currently supported in QMK uses a Pro Micro (or compatible board) and you want to use the Proton C, you can generate the firmware by appending `CONVERT_TO_PROTON_C=yes` (or `CTPC=yes`) to your make argument, like this: + + make 40percentclub/mf68:default CTPC=yes + +You can add the same argument to your keymap's `rules.mk`, which will accomplish the same thing. + +This exposes the `CONVERT_TO_PROTON_C` flag that you can use in your code with `#ifdef`s, like this: + + #ifdef CONVERT_TO_PROTON_C + // Proton C code + #else + // Pro Micro code + #endif + +Before being able to compile, you may get some errors about `PORTB/DDRB`, etc not being defined, so you'll need to convert the keyboard's code to use the [GPIO Controls](internals_gpio_control.md) that will work for both ARM and AVR. This shouldn't affect the AVR builds at all. + +The Proton C only has one on-board LED (C13), and by default, the TXLED (D5) is mapped to it. If you want the RXLED (B0) mapped to it instead, add this like to your `config.h`: + + #define CONVERT_TO_PROTON_C_RXLED diff --git a/docs/python_development.md b/docs/python_development.md new file mode 100644 index 00000000000..b976a7c0e80 --- /dev/null +++ b/docs/python_development.md @@ -0,0 +1,45 @@ +# Python Development in QMK + +This document gives an overview of how QMK has structured its python code. You should read this before working on any of the python code. + +## Script directories + +There are two places scripts live in QMK: `qmk_firmware/bin` and `qmk_firmware/util`. You should use `bin` for any python scripts that utilize the `qmk` wrapper. Scripts that are standalone and not run very often live in `util`. + +We discourage putting anything into `bin` that does not utilize the `qmk` wrapper. If you think you have a good reason for doing so please talk to us about your use case. + +## Python Modules + +Most of the QMK python modules can be found in `qmk_firmware/lib/python`. This is the path that we append to `sys.path`. + +We have a module hierarchy under that path: + +* `qmk_firmware/lib/python` + * `milc.py` - The CLI library we use. Will be pulled out into its own module in the future. + * `qmk` - Code associated with QMK + * `cli` - Modules that will be imported for CLI commands. + * `errors.py` - Errors that can be raised within QMK apps + * `keymap.py` - Functions for working with keymaps + +## CLI Scripts + +We have a CLI wrapper that you should utilize for any user facing scripts. We think it's pretty easy to use and it gives you a lot of nice things for free. + +To use the wrapper simply place a module into `qmk_firmware/lib/python/qmk/cli`, and create a symlink to `bin/qmk` named after your module. Dashes in command names will be converted into dots so you can use hierarchy to manage commands. + +When `qmk` is run it checks to see how it was invoked. If it was invoked as `qmk` the module name is take from `sys.argv[1]`. If it was invoked as `qmk-` then everything after the first dash is taken as the module name. Dashes and underscores are converted to dots, and then `qmk.cli` is prepended before the module is imported. + +The module uses `@cli.entrypoint()` and `@cli.argument()` decorators to define an entrypoint, which is where execution starts. + +## Example CLI Script + +We have provided a QMK Hello World script you can use as an example. To run it simply run `qmk hello` or `qmk-hello`. The source code is listed below. + +``` +from milc import cli + +@cli.argument('-n', '--name', default='World', help='Name to greet.') +@cli.entrypoint('QMK Python Hello World.') +def main(cli): + cli.echo('Hello, %s!', cli.config.general.name) +``` diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md index 1d7fc0e1270..a2ba34c32dd 100644 --- a/docs/quantum_keycodes.md +++ b/docs/quantum_keycodes.md @@ -1,6 +1,6 @@ # Quantum Keycodes -Quantum keycodes allow for easier customisation of your keymap than the basic ones provide, without having to define custom actions. +Quantum keycodes allow for easier customization of your keymap than the basic ones provide, without having to define custom actions. All keycodes within quantum are numbers between `0x0000` and `0xFFFF`. Within your `keymap.c` it may look like you have functions and other special cases, but ultimately the C preprocessor will translate those into a single 4 byte integer. QMK has reserved `0x0000` through `0x00FF` for standard keycodes. These are keycodes such as `KC_A`, `KC_1`, and `KC_LCTL`, which are basic keys defined in the USB HID specification. @@ -8,15 +8,21 @@ On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are ## QMK Keycodes -|Key |Aliases |Description | -|-------------|-----------|---------------------------------------------------------------------| -|`RESET` | |Put the keyboard into DFU mode for flashing | -|`DEBUG` | |Toggle debug mode | -|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| -|`KC_LSPO` | |Left Shift when held, `(` when tapped | -|`KC_RSPC` | |Right Shift when held, `)` when tapped | -|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | -|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | -|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | -|`M(n)` | |Call macro `n` | -|`MACROTAP(n)`| |Macro-tap `n` idk FIXME | +|Key |Aliases |Description | +|---------------|-----------|---------------------------------------------------------------------| +|`RESET` | |Put the keyboard into DFU mode for flashing | +|`DEBUG` | |Toggle debug mode | +|`EEPROM_RESET` |`EEP_RST` |Resets EEPROM state by reinitializing it | +|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| +|`KC_LSPO` | |Left Shift when held, `(` when tapped | +|`KC_RSPC` | |Right Shift when held, `)` when tapped | +|`KC_LCPO` | |Left Control when held, `(` when tapped | +|`KC_RCPC` | |Right Control when held, `)` when tapped | +|`KC_LAPO` | |Left Alt when held, `(` when tapped | +|`KC_RAPC` | |Right Alt when held, `)` when tapped | +|`KC_SFTENT` | |Right Shift when held, Enter when tapped | +|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | +|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | +|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | +|`M(n)` | |Call macro `n` | +|`MACROTAP(n)` | |Macro-tap `n` idk FIXME | diff --git a/docs/ref_functions.md b/docs/ref_functions.md index 9b5be7a883f..174d9a95a6f 100644 --- a/docs/ref_functions.md +++ b/docs/ref_functions.md @@ -96,3 +96,24 @@ And to do so, add `reset_keyboard()` to your function or macro, and this will re If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so. To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. + +## Tap random key + +If you want to send a random character to the host computer, you can use the `tap_random_base64()` function. This [pseudorandomly](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) selects a number between 0 and 63, and then sends a key press based on that selection. (0–25 is `A`–`Z`, 26–51 is `a`–`z`, 52–61 is `0`–`9`, 62 is `+` and 63 is `/`). + +?> Needless to say, but this is _not_ a cryptographically secure method of generating random Base64 keys or passwords. + +## Software Timers + +It's possible to start timers and read values for time-specific events. Here's an example: + +```c +static uint16_t key_timer; +key_timer = timer_read(); + +if (timer_elapsed(key_timer) < 100) { + // do something if less than 100ms have passed +} else { + // do something if 100ms or more have passed +} +``` diff --git a/docs/reference_configurator_support.md b/docs/reference_configurator_support.md new file mode 100644 index 00000000000..784c6d9f75a --- /dev/null +++ b/docs/reference_configurator_support.md @@ -0,0 +1,195 @@ +# Supporting Your Keyboard in QMK Configurator + +This page covers how to properly support keyboards in the [QMK Configurator](https://config.qmk.fm/). + + +## How the Configurator Understands Keyboards + +To understand how the Configurator understands keyboards, first one must understand layout macros. For this exercise, we're going to imagine a 17-key numpad PCB, which we're going to call `numpad`. + +``` +┌───┬───┬───┬───┐ +│NLk│ / │ * │ - │ +├───┼───┼───┼───┤ +│7 │8 │9 │ + │ +├───┼───┼───┤ │ +│4 │5 │6 │ │ +├───┼───┼───┼───┤ +│1 │2 │3 │Ent│ +├───┴───┼───┤ │ +│0 │ . │ │ +└───────┴───┴───┘ +``` + +?> For more on layout macros, see [Understanding QMK: Matrix Scanning](understanding_qmk.md?id=matrix-scanning) and [Understanding QMK: Matrix to Physical Layout Map](understanding_qmk.md?id=matrix-to-physical-layout-map). + +The Configurator's API reads the keyboard's `.h` file from `qmk_firmware/keyboards//.h`. For our numpad, this file would be `qmk_firmware/keyboards/numpad/numpad.h`: + +```c +#pragma once + +#define LAYOUT( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k33, \ + k40, k42 \ + ) { \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, KC_NO }, \ + { k30, k31, k32, k33 }, \ + { k40, KC_NO, k42, KC_NO } \ +} +``` + +QMK uses `KC_NO` to designate places in the switch matrix where there is no switch. Sometimes, `XXX`, `___` or `____` are used as shorthand to make this section easier to read if it needs to be debugged. This is usually defined near the beginning of the `.h` file: + +```c +#pragma once + +#define XXX KC_NO + +#define LAYOUT( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k33, \ + k40, k42 \ + ) { \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, XXX }, \ + { k30, k31, k32, k33 }, \ + { k40, XXX, k42, XXX } \ +} +``` + +!> This usage differs from that of keymap macros, which almost always use `XXXXXXX` (seven capital X's) for `KC_NO` and `_______` (seven underscores) for `KC_TRNS`. + +!> To prevent user confusion, using `KC_NO` is preferred. + +The layout macro tells the Configurator that our keyboard has 17 keys, arranged in five rows of four columns each. Our switch positions are named `k`, counting from 0. The names themselves actually don't matter, as long as they match between the top section, which receives the keycodes from the keymap, and the bottom half which designates where each key is in the matrix. + +To display our keyboard in a way that resembles the physical keyboard, we need to build a JSON file that tells the Configurator how to tie the physical locations and sizes of our keys to our switch matrix. + +## Building the JSON file + +To build the JSON file, the easiest way is to build the layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/) ("KLE"), from which we'll feed the Raw Data into a QMK tool that converts this data into a JSON the Configurator will read and use. Since KLE opens by default with a numpad layout, we're just going to remove the Getting Started instructions, and use what's left. + +Once the layout is as desired, move to the Raw Data tab in KLE, and copy the contents: + +``` +["Num Lock","/","*","-"], +["7\nHome","8\n↑","9\nPgUp",{h:2},"+"], +["4\n←","5","6\n→"], +["1\nEnd","2\n↓","3\nPgDn",{h:2},"Enter"], +[{w:2},"0\nIns",".\nDel"] +``` + +To convert this data into our JSON, go to the [QMK KLE-JSON Converter](https://qmk.fm/converter/), paste the Raw Data into the Input field, and click the Convert button. After a moment, our JSON data will appear in the Output field. Copy the contents to a new text document, and name the document `info.json`, saving it in the same folder that contains `numpad.h`. + +Use the `keyboard_name` object to set the name of the keyboard. For instruction purposes, we will put each key's object on its own line. This is only to make the file more human-readable, and does not affect the Configurator's functionality. + +```json +{ + "keyboard_name": "Numpad", + "url": "", + "maintainer": "qmk", + "tags": { + "form_factor": "numpad" + }, + "width": 4, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Num Lock", "x":0, "y":0}, + {"label":"/", "x":1, "y":0}, + {"label":"*", "x":2, "y":0}, + {"label":"-", "x":3, "y":0}, + {"label":"7", "x":0, "y":1}, + {"label":"8", "x":1, "y":1}, + {"label":"9", "x":2, "y":1}, + {"label":"+", "x":3, "y":1, "h":2}, + {"label":"4", "x":0, "y":2}, + {"label":"5", "x":1, "y":2}, + {"label":"6", "x":2, "y":2}, + {"label":"1", "x":0, "y":3}, + {"label":"2", "x":1, "y":3}, + {"label":"3", "x":2, "y":3}, + {"label":"Enter", "x":3, "y":3, "h":2}, + {"label":"0", "x":0, "y":4, "w":2}, + {"label":".", "x":2, "y":4} + ] + } + } +} +``` + +The `layouts` object contains the data that represents the physical layout of the keyboard. It has an object `LAYOUT`, which needs to match the name of our layout macro from `numpad.h`. The `LAYOUT` object itself has an object named `layout`, which contains one JSON object for each physical key on our keyboard, formatted as follows: + +``` + ┌ The name of the key. Not displayed in the Configurator. + │ ┌ The key's X-axis location, in key units from the + │ │ keyboard's left edge. + │ │ ┌ The key's Y-axis location, in key units from + │ │ │ the keyboard's top (rear-facing) edge. + ↓ ↓ ↓ +{"label":"Num Lock", "x":0, "y":0}, +``` + +Some objects will also have `"w"` and `"h"` keys, which represent a key's width and height, respectively. + +?> For more on the `info.json` files, see [QMK Keyboard Guidelines: Keyboard Metadata](hardware_keyboard_guidelines.md?id=keyboard-metadata) + + +## How the Configurator Programs Keys + +The Configurator's API uses the layout macro and the JSON file we've given it to create a visual representation of the keyboard that has each visual object tied to a specific key, in sequence: + +key in layout macro | JSON object used +:---: | :---- +k00 | {"label":"Num Lock", "x":0, "y":0} +k01 | {"label":"/", "x":1, "y":0} +k02 | {"label":"*", "x":2, "y":0} +k03 | {"label":"-", "x":3, "y":0} +k10 | {"label":"7", "x":0, "y":1} +k11 | {"label":"8", "x":1, "y":1} +k12 | {"label":"9", "x":2, "y":1} +k13 | {"label":"+", "x":3, "y":1, "h":2} +k20 | {"label":"4", "x":0, "y":2} +k21 | {"label":"5", "x":1, "y":2} +k22 | {"label":"6", "x":2, "y":2} +k30 | {"label":"1", "x":0, "y":3} +k31 | {"label":"2", "x":1, "y":3} +k32 | {"label":"3", "x":2, "y":3} +k33 | {"label":"Enter", "x":3, "y":3, "h":2} +k40 | {"label":"0", "x":0, "y":4, "w":2} +k42 | {"label":".", "x":2, "y":4} + +When a user selects the top-left key in the Configurator, and assigns Num Lock to it, the Configurator builds a keymap file with `KC_NLCK` as the first key, and so on as the keymap is built. The `label` keys are not used; they are only for the user's reference in identifying specific keys when debugging the `info.json` file. + + +## Issues and Hazards + +Currently, the Configurator does not support key rotation or non-rectangular key shapes like ISO Enter. Additionally, keys that are vertically-offset from their "row" — the arrow keys on 1800-layouts like the [TKC1800](https://github.com/qmk/qmk_firmware/tree/4ac48a61a66206beaf2fdd5f2939d8bbedd0004c/keyboards/tkc1800/) being a prominent example — confuse the KLE-to-JSON Converter, if not adjusted for by the contributor of the `info.json` file. + +### Workarounds + +#### Non-rectangular keys + +For ISO Enter keys, QMK custom is to display it as a rectangular key, 1.25u wide and 2u high, aligned so its right edge is aligned with the right edge of the alphanumeric key block. + +![](https://i.imgur.com/JKngtTw.png) +*A 60% keyboard in standard ISO layout, as rendered by QMK Configurator.* + +#### Vertically-offset keys + +For vertically-offset keys, place them in KLE as if they were not offset, then edit the Y-values as needed in the converted JSON file + +![](https://i.imgur.com/fmDvDzR.png) +*An 1800-layout keyboard as rendered in Keyboard Layout Editor, without the vertical offset applied to the arrow keys.* + +![](https://i.imgur.com/8beYMBR.png) +*A Unix diff file, showing the changes needed to vertically-offset the arrow keys in our keyboard's JSON file.* diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md new file mode 100644 index 00000000000..badfabd9120 --- /dev/null +++ b/docs/reference_info_json.md @@ -0,0 +1,73 @@ +# `info.json` + +This file is used by the [QMK API](https://github.com/qmk/qmk_api). It contains the information [QMK Configurator](https://config.qmk.fm/) needs to display a representation of your keyboard. You can also set metadata here. + +You can create `info.json` files at every level under `qmk_firmware/keyboards/` to specify this metadata. These files are combined, with more specific files overriding keys in less specific files. This means you do not need to duplicate your metadata information. For example, `qmk_firmware/keyboards/clueboard/info.json` specifies `manufacturer` and `maintainer`, while `qmk_firmware/keyboards/clueboard/66/info.json` specifies more specific information about Clueboard 66%. + +## `info.json` Format + +The `info.json` file is a JSON formatted dictionary with the following keys available to be set. You do not have to set all of them, merely the keys that apply to your keyboard. + +* `keyboard_name` + * A free-form text string describing the keyboard. + * Example: `Clueboard 66%` +* `url` + * A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard. +* `maintainer` + * GitHub username of the maintainer, or `qmk` for community maintained boards +* `width` + * Width of the board in Key Units +* `height` + * Height of the board in Key Units +* `layouts` + * Physical Layout representations. See the next section for more detail. + +### Layout Format + +Within our `info.json` file the `layouts` portion of the dictionary contains several nested dictionaries. The outer layer consists of QMK layout macros, for example `LAYOUT_ansi` or `LAYOUT_iso`. Within each layout macro are keys for `width`, `height`, and `key_count`, each of which should be self-explanatory. + +* `width` + * Optional: The width of the layout in Key Units +* `height` + * Optional: The height of the layout in Key Units +* `key_count` + * **Required**: The number of keys in this layout +* `layout` + * A list of Key Dictionaries describing the physical layout. See the next section for more details. + +### Key Dictionary Format + +Each Key Dictionary in a layout describes the physical properties of a key. If you are familiar with the Raw Code for you will find many of the concepts the same. We re-use the same key names and layout choices wherever possible, but unlike keyboard-layout-editor each key is stateless, inheriting no properties from the keys that came before it. + +All key positions and rotations are specified in relation to the top-left corner of the keyboard, and the top-left corner of each key. + +* `x` + * **Required**: The absolute position of the key in the horizontal axis, in Key Units. +* `y` + * **Required**: The absolute position of the key in the vertical axis, in Key Units. +* `w` + * The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1` +* `h` + * The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1` +* `r` + * How many degrees clockwise to rotate the key. +* `rx` + * The absolute position of the point to rotate the key around in the horizontal axis. Default: `x` +* `ry` + * The absolute position of the point to rotate the key around in the vertical axis. Default: `y` +* `ks` + * Key Shape: define a polygon by providing a list of points, in Key Units. + * **Important**: These are relative to the top-left of the key, not absolute. + * Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]` +* `label` + * What to name this position in the matrix. + * This should usually be the same name as what is silkscreened on the PCB at this location. + +## How is the Metadata Exposed? + +This metadata is primarily used in two ways: + +* To allow web-based configurators to dynamically generate UI +* To support the new `make keyboard:keymap:qmk` target, which bundles this metadata up with the firmware to allow QMK Toolbox to be smarter. + +Configurator authors can see the [QMK Compiler](https://docs.api.qmk.fm/using-the-api) docs for more information on using the JSON API. diff --git a/docs/support.md b/docs/support.md new file mode 100644 index 00000000000..5c275b07e4b --- /dev/null +++ b/docs/support.md @@ -0,0 +1,43 @@ +# Support + +If you need help with something, the best place to get quick support is going to be on our [Discord Server](https://discord.gg/Uq7gcHh). There is usually somebody online, and there are a bunch of very helpful people there. + +Don't forget to read our [Code of Conduct](https://qmk.fm/coc/). + +## Help! I don't know where to start! + +If this is the case, then you should start with our [Newbs Guide](https://docs.qmk.fm/#/newbs). There is a lot of great info there, and that should cover everything you need to get started. + +If that's an issue, hop onto the [QMK Configurator](https://config.qmk.fm), as that will handle a majority of what you need there. + +## Help! I'm having issues flashing! + +First, head to the [Compiling/Flashing FAQ Page](https://docs.qmk.fm/#/faq_build). There is a good deal of info there, and you'll find a bunch of solutions to common issues there. + +## Help, I have an issue that isn't covered by the links above + +Okay, that's fine. Then please check the [open issues in our GitHub](https://github.com/qmk/qmk_firmware/issues) to see if somebody is experiencing the same thing (make sure it's not just similar, but actually the same). + +If you can't find anything, then please open a [new issue](https://github.com/qmk/qmk_firmware/issues/new)! + +## What if I found a bug? + +Then please open an [issue](https://github.com/qmk/qmk_firmware/issues/new), and if you know how to fix it, open up a Pull Request on GitHub with the fix. + +## But `git` and `GitHub` are intimidating! + +Don't worry, we have some pretty nice [Guidelines](https://docs.qmk.fm/#/newbs_best_practices) on how to start using `git` and GitHub to make things easier to develop. + +Additionally, you can find additional `git` and GitHub related links [here](https://docs.qmk.fm/#/newbs_learn_more_resources). + +## I have a Keyboard that I want to add support for + +Awesome! Open up a Pull Request for it. We'll review the code, and merge it! + +### What if I want to do brand it with `QMK`? + +That's amazing! We would love to assist you with that! + +In fact, we have a [whole page](https://qmk.fm/powered/) dedicated to adding QMK Branding to your page and keyboard. This covers pretty much everything you need (knowledge and images) to officially support QMK. + +If you have any questions about this, open an issue or head to [Discord](https://discord.gg/Uq7gcHh). diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md index 35596cc6924..a94c9c3191e 100644 --- a/docs/understanding_qmk.md +++ b/docs/understanding_qmk.md @@ -12,7 +12,7 @@ You can think of QMK as no different from any other computer program. It is star The reason for this is the different platforms that QMK supports. The most common platform is `lufa`, which runs on AVR processors such at the atmega32u4. We also support `chibios` and `vusb`. -We'll focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/tmk_core/protocol/lufa/lufa.c#L1019). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/tmk_core/protocol/lufa/lufa.c#L1060). This is [The Main Loop](#the-main-loop). +We'll focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/tmk_core/protocol/lufa/lufa.c#L1028). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/tmk_core/protocol/lufa/lufa.c#L1069). This is [The Main Loop](#the-main-loop). ## The Main Loop @@ -22,7 +22,7 @@ This section of code is called "The Main Loop" because it's responsible for loop keyboard_task(); ``` -This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/tmk_core/common/keyboard.c#L206), and it is responsible for detecting changes in the matrix and turning status LED's on and off. +This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/tmk_core/common/keyboard.c#L216), and it is responsible for detecting changes in the matrix and turning status LED's on and off. Within `keyboard_task()` you'll find code to handle: @@ -57,10 +57,10 @@ Matrix Scanning runs many times per second. The exact rate varies but typically Once we know the state of every switch on our keyboard we have to map that to a keycode. In QMK this is done by making use of C macros to allow us to separate the definition of the physical layout from the definition of keycodes. -At the keyboard level we define a C macro (typically named `KEYMAP()`) which maps our keyboard's matrix to physical keys. Sometimes the matrix does not have a switch in every location, and we can use this macro to pre-populate those with KC_NO, making the keymap definition easier to work with. Here's an example `KEYMAP()` macro for a numpad: +At the keyboard level we define a C macro (typically named `LAYOUT()`) which maps our keyboard's matrix to physical keys. Sometimes the matrix does not have a switch in every location, and we can use this macro to pre-populate those with KC_NO, making the keymap definition easier to work with. Here's an example `LAYOUT()` macro for a numpad: ```c -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ k20, k21, k22, \ @@ -75,17 +75,17 @@ At the keyboard level we define a C macro (typically named `KEYMAP()`) which map } ``` -Notice how the second block of our `KEYMAP()` macro matches the Matrix Scanning array above? This macro is what will map the matrix scanning array to keycodes. However, if you look at a 17 key numpad you'll notice that it has 3 places where the matrix could have a switch but doesn't, due to larger keys. We have populated those spaces with `KC_NO` so that our keymap definition doesn't have to. +Notice how the second block of our `LAYOUT()` macro matches the Matrix Scanning array above? This macro is what will map the matrix scanning array to keycodes. However, if you look at a 17 key numpad you'll notice that it has 3 places where the matrix could have a switch but doesn't, due to larger keys. We have populated those spaces with `KC_NO` so that our keymap definition doesn't have to. -You can also use this macro to handle unusual matrix layouts, for example the [Clueboard rev 2](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/keyboards/clueboard/66/rev2/rev2.h). Explaining that is outside the scope of this document. +You can also use this macro to handle unusual matrix layouts, for example the [Clueboard rev 2](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/66/rev2/rev2.h). Explaining that is outside the scope of this document. ##### Keycode Assignment -At the keymap level we make use of our `KEYMAP()` macro above to map keycodes to physical locations to matrix locations. It looks like this: +At the keymap level we make use of our `LAYOUT()` macro above to map keycodes to physical locations to matrix locations. It looks like this: ``` const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( +[0] = LAYOUT( KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ KC_P7, KC_P8, KC_P9, KC_PPLS, \ KC_P4, KC_P5, KC_P6, \ @@ -94,7 +94,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } ``` -Notice how all of these arguments match up with the first half of the `KEYMAP()` macro from the last section? This is how we take a keycode and map it to our Matrix Scan from earlier. +Notice how all of these arguments match up with the first half of the `LAYOUT()` macro from the last section? This is how we take a keycode and map it to our Matrix Scan from earlier. ##### State Change Detection @@ -130,31 +130,35 @@ Comparing against our keymap we can see that the pressed key is KC_NLCK. From he ##### Process Record -The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is listed below, using cluecard whenever we need to look at the keyboard/keymap level functions. Depending on options set in rule.mk or elsewhere, only a subset of the functions below will be included in final firmware. - -* [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/tmk_core/common/action.c#L172) - * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/quantum.c#L193) - * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/quantum.c#L213) - * [`void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/process_keycode/process_tap_dance.c#L115) - * [`bool process_key_lock(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/process_keycode/process_key_lock.c#L62) - * [`bool process_clicky(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/process_keycode/process_clicky.c#L44) - * [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/keyboards/clueboard/card/card.c#L20) - * [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/keyboards/clueboard/card/keymaps/default/keymap.c#L58) - * [`bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/fdd0f915271f79b104aa5d216566bcc3fd134e85/quantum/rgb_matrix.c#L139) - * [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_midi.c#L81) - * [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_audio.c#L19) - * [`bool process_steno(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_steno.c#L160) - * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_music.c#L114) - * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_tap_dance.c#L136) - * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_leader.c#L38) - * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_combo.c#L115) - * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_unicode.c#L22) - * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_ucis.c#L91) - * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_printer.c#L77) - * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_auto_shift.c#L94) - * [`bool process_unicode_map(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_unicodemap.c#L47) - * [`bool process_terminal(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_terminal.c#L264) - * [Identify and process quantum specific keycodes](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/quantum.c#L287) +The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is listed below, using cluecard whenever we need to look at the keyboard/keymap level functions. Depending on options set in `rules.mk` or elsewhere, only a subset of the functions below will be included in final firmware. + +* [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/tmk_core/common/action.c#L172) + * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L206) + * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L226) + * [`void velocikey_accelerate(void)`](https://github.com/qmk/qmk_firmware/blob/c1c5922aae7b60b7c7d13d3769350eed9dda17ab/quantum/velocikey.c#L27) + * [`void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_tap_dance.c#L119) + * [`bool process_key_lock(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_key_lock.c#L62) + * [`bool process_clicky(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_clicky.c#L79) + * [`bool process_haptic(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/2cee371bf125a6ec541dd7c5a809573facc7c456/drivers/haptic/haptic.c#L216) + * [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/card/card.c#L20) + * [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/card/keymaps/default/keymap.c#L58) + * [`bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/rgb_matrix.c#L139) + * [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_midi.c#L81) + * [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_audio.c#L19) + * [`bool process_steno(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_steno.c#L160) + * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_music.c#L114) + * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_tap_dance.c#L141) + * [`bool process_unicode_common(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_unicode_common.c#L169) + calls one of: + * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_unicode.c#L20) + * [`bool process_unicodemap(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_unicodemap.c#L46) + * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_ucis.c#L95) + * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_leader.c#L51) + * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_combo.c#L115) + * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_printer.c#L77) + * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_auto_shift.c#L94) + * [`bool process_terminal(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_terminal.c#L264) + * [Identify and process Quantum-specific keycodes](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L291) At any step during this chain of events a function (such as `process_record_kb()`) can `return false` to halt all further processing. diff --git a/docs/zh-cn/README.md b/docs/zh-cn/README.md new file mode 100644 index 00000000000..9eb4ea777ae --- /dev/null +++ b/docs/zh-cn/README.md @@ -0,0 +1,32 @@ +# QMK机械键盘固件 + +[![当前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) +[![开发状态](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) +[![异议](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh) +[![文档状态](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm) +[![GitHub贡献者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) +[![GitHub分支](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) + +## 什么是 QMK 固件? + +QMK (*Quantum Mechanical Keyboard*) 是一个社区维护的开源软件,包括 QMK 固件, QMK 工具箱, qmk.fm网站, 和这些文档。QMK 固件是一个基于[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)的键盘固件,它在爱特梅尔AVR微控制器实现一些有用的功能,确切地说, 是在 [OLKB product line](http://olkb.com), 在 [ErgoDox EZ](http://www.ergodox-ez.com) 键盘, 和 [Clueboard product line](http://clueboard.co/). 上。它被移植到使用ChibiOS的ARM芯片上. 它可以在飞线键盘或定制PCB键盘中发挥功能. + +## 如何得到它 + +如果你打算贡献布局, 键盘, 或者其他QMK特性, 一下是最简单的方法:[从Github获得repo分支](https://github.com/qmk/qmk_firmware#fork-destination-box), 并克隆你的repo到本地进行编辑,推送,然后从你的分支打开 [Pull Request](https://github.com/qmk/qmk_firmware/pulls). + +此外, 你也可以直接下载 ([zip](https://github.com/qmk/qmk_firmware/zipball/master), [tar](https://github.com/qmk/qmk_firmware/tarball/master)), 或者从git克隆 (`git@github.com:qmk/qmk_firmware.git`), 或 https (`https://github.com/qmk/qmk_firmware.git`). + +## 如何编译 + +在你能编译之前, 你需要[部署环境](getting_started_build_tools.md) 用于 AVR or/and ARM 开发。完成后, 你可以使用 `make` 命令来编译一个键盘和布局使用以下命令: + + make planck/rev4:default + +这将建立 `planck`的`rev4` 修订版本并使用 `default`布局。并非所有键盘都有修订版本 (也叫做子项目或文件夹),在此情况下,修订版本可以省略,如下: + + make preonic:default + +## 如何定制 + +QMK 有许多 [特性](features.md)来探索,也有很多 [参考文档](http://docs.qmk.fm) 供您发掘。你可以通过修改 [布局](keymap.md)和[键码](keycodes.md)来利用许多特性。 diff --git a/docs/zh-cn/_summary.md b/docs/zh-cn/_summary.md new file mode 100644 index 00000000000..b0d9f1c068a --- /dev/null +++ b/docs/zh-cn/_summary.md @@ -0,0 +1,106 @@ +* [完全菜鸟指南](newbs.md) + * [入门](newbs_getting_started.md) + * [构建你的第一个固件](newbs_building_firmware.md) + * [刷新固件](newbs_flashing.md) + * [测试和调试](newbs_testing_debugging.md) + * [Git最佳实践](newbs_best_practices.md) + * [学习资源](newbs_learn_more_resources.md) + +* [QMK基础](README.md) + * [QMK简介](getting_started_introduction.md) + * [向QMK贡献](contributing.md) + * [如何使用Github](getting_started_github.md) + * [获得帮助](getting_started_getting_help.md) + +* [问题解答](faq.md) + * [一般问题](faq_general.md) + * [构建/编译](faq_build.md) + * [调试/故障排除](faq_debug.md) + * [键盘映射](faq_keymap.md) + +* 详细指南 + * [安装构建工具](getting_started_build_tools.md) + * [vagrant指南](getting_started_vagrant.md) + * [构建/编译指令](getting_started_make_guide.md) + * [刷新固件](flashing.md) + * [定制功能](custom_quantum_functions.md) + * [映射概述](keymap.md) + +* [硬件](hardware.md) + * [AVR处理器](hardware_avr.md) + * [驱动](hardware_drivers.md) + +* 参考 + * [键盘指南](hardware_keyboard_guidelines.md) + * [配置选项](config_options.md) + * [键码](keycodes.md) + * [记录最佳实践](documentation_best_practices.md) + * [文档模板](documentation_templates.md) + * [术语表](reference_glossary.md) + * [单元测试](unit_testing.md) + * [有用的功能](ref_functions.md) + * [配置器支持](reference_configurator_support.md) + * [info.json 格式](reference_info_json.md) + +* [特性](features.md) + * [基本键码](keycodes_basic.md) + * [US ANSI控制码](keycodes_us_ansi_shifted.md) + * [量子键码](quantum_keycodes.md) + * [高级键码](feature_advanced_keycodes.md) + * [音频](feature_audio.md) + * [自动shift](feature_auto_shift.md) + * [背光](feature_backlight.md) + * [蓝牙](feature_bluetooth.md) + * [热改键](feature_bootmagic.md) + * [组合](feature_combo) + * [命令](feature_command.md) + * [动态宏指令](feature_dynamic_macros.md) + * [编码器](feature_encoders.md) + * [重音号Esc复合键](feature_grave_esc.md) + * [自锁键](feature_key_lock.md) + * [布局](feature_layouts.md) + * [前导键](feature_leader_key.md) + * [LED阵列](feature_led_matrix.md) + * [宏指令](feature_macros.md) + * [鼠标键](feature_mouse_keys.md) + * [一键功能](feature_advanced_keycodes.md#one-shot-keys) + * [指针设备](feature_pointing_device.md) + * [PS/2鼠标](feature_ps2_mouse.md) + * [RGB灯光](feature_rgblight.md) + * [RGB矩阵](feature_rgb_matrix.md) + * [空格候补换挡](feature_space_cadet_shift.md) + * [空格候补换挡回车](feature_space_cadet_shift_enter.md) + * [速录机](feature_stenography.md) + * [换手](feature_swap_hands.md) + * [多击键](feature_tap_dance.md) + * [终端](feature_terminal.md) + * [热敏打印机](feature_thermal_printer.md) + * [Unicode](feature_unicode.md) + * [用户空间](feature_userspace.md) + * [速度键](feature_velocikey.md) + +* 针对制造者和定制者 + * [手工连线指南](hand_wire.md) + * [ISP刷新指南](isp_flashing_guide.md) + * [ARM调试指南](arm_debugging.md) + * [I2C驱动](i2c_driver.md) + * [GPIO控制器](internals_gpio_control.md) + * [Proton C转换](proton_c_conversion.md) + +* 深入了解 + * [键盘如何工作](how_keyboards_work.md) + * [理解QMK](understanding_qmk.md) + +* 其他话题 + * [使用Eclipse开发QMK](other_eclipse.md) + * [使用VSCode开发QMK](other_vscode.md) + * [支持](support.md) + +* QMK 内构 (正在编写) + * [定义](internals_defines.md) + * [输入回调寄存器](internals_input_callback_reg.md) + * [Midi设备](internals_midi_device.md) + * [Midi设备设置过程](internals_midi_device_setup_process.md) + * [Midi工具库](internals_midi_util.md) + * [发送函数](internals_send_functions.md) + * [Sysex工具](internals_sysex_tools.md) diff --git a/docs/zh-cn/contributing.md b/docs/zh-cn/contributing.md new file mode 100644 index 00000000000..62b956b619f --- /dev/null +++ b/docs/zh-cn/contributing.md @@ -0,0 +1,205 @@ +# 如何做贡献 + +👍🎉 首先感谢各位百忙之中抽空阅读本文档,并为我们无私奉献。给您点赞啦! 🎉👍 + +第三方的帮助让Q酱成长了许多呢,Q酱也从你们那学到了不少新东西。Q酱希望每一个想帮助我的人都能很方便的做出有用的贡献。在这里我给摩拳擦掌的你们写了一点引导,让你们的代码在不对我做重大改动的情况下都能成功的被采纳哦。 + +* [项目概况](#项目概况) +* [代码规范](#代码规范) +* [一般教程](#一般教程) +* [行为守则对于我来说有何意义?](#行为守则对于我来说有何意义?) + +## 这文章巨长无比不想读啊! 我就想问个问题而已! + +您要是想问关于Q酱的问题的话可以在[OLKB Subreddit](https://reddit.com/r/olkb)或者是[Discord](https://discord.gg/Uq7gcHh)随意问。 + +请记住: + +* 维护Q酱的小可爱有的时候可能会有点忙,不能及时回答您的问题,耐心等等,他们都是很nice的人呀。 +* 维护Q酱的人都是很无私的善良的人。无论是贡献代码还是回答问题,都是义务的。有时见到他们努力回答各种问题,解决各种BUG,Q酱也是很心疼的。 +* 您可以看看下面的教程,可以让您的问题浅显易懂,更容易回答: + * https://opensource.com/life/16/10/how-ask-technical-questions + * http://www.catb.org/esr/faqs/smart-questions.html + +# 项目概况 + +Q酱很大一部分是用C语言组成的,不过有一小部分特性是C++的。怎么说呢,都是我的一部分,两个我都爱。Q酱一般是在键盘上的嵌入式处理器那里工作的,尤其与AVR([LUFA](http://www.fourwalledcubicle.com/LUFA.php))和ARM ([ChibiOS](http://www.chibios.com))两小哥哥搭配,干活不累,嘻嘻。如果您精通Arduino的话您会发现很多熟悉的概念,但也有点不爽,因为您以前的经验可能没法用来帮助Q酱。 + + + +# Q酱,我在哪能帮助你嘞? + +您要是有问题的话可以 [提出一个issue](https://github.com/qmk/qmk_firmware/issues) 或 [在Discord上交流一下](https://discord.gg/Uq7gcHh). + +# Q酱,我如何帮助你? + +您以前是否没为开源贡献过代码,而又想知道帮助Q酱是怎么一回事? 稍安勿躁,咱给您总结一下! + +0. 先注册一个 [GitHub](https://github.com) 账户。 +1. 做好一个你要贡献的布局,那就要 [找一个你想解决的问题](https://github.com/qmk/qmk_firmware/issues),或者 [找一个你想添加的特性](https://github.com/qmk/qmk_firmware/issues?q=is%3Aopen+is%3Aissue+label%3Afeature)。 +2. 把关联着问题的仓库分叉(fork)到你的仓库。这样你在`你的GitHub用户名/qmk_firmware`就有一个仓库备份啦。 +3. 使用 `git clone https://github.com/此处添GitHub用户名/此处添仓库名.git`这个命令把仓库同步到你的电脑中。 +4. 您要是想开发一个新特性的话可以先创建一个issue和Q酱的维护者讨论一下您要做什么。 +5. 使用`git checkout -b 此处写分支名字(别用汉字)`命令来创建一个分支(branch)用于开发。 +6. 对要解决的问题或要添加的特性进行适当的更改。 +7. 使用 `git add 把改变的文件的目录写这里` 可以添加改变的文件内容到git用于管理工程状态的索引(快照)里。 +8. 使用 `git commit -m "这里写修改的相关信息"` 来描述你做出了什么修改。 +9. 使用 `git push origin 此处写分支名字`来把你的更改同步到GitHub库里(反正不是打篮球那个库里)。 +10. 提交一个[QMK 固件的pull request](https://github.com/qmk/qmk_firmware/pull/new/master)。 +11. 给你的pull request拟一个标题,包括简短的描述和问题或错误代码。比如, 你可以起一个这样的"Added more log outputting to resolve #4352"(最好用英语,毕竟Q酱的中文也不是那么的溜,有可能会看不懂中文)。 +12. 在描述(description)里面写你做了哪些更改,你的代码里还存在什么问题, 或者你想问维护的小可爱们的问题。你的your pull request有点小问题无伤大雅(本来也没有完美的代码嘛), 维护的小可爱们会竭尽全力帮您改进的! +13. 维护人员审查代码可能需要一些时间。 +14. 维护人员会通知您要更改什么地方,然后您就按照建议改一改。 +15. 预祝您合并成功! + +# 代码规范 + +其实也没有什么特别严格的规范啦,但是俗话说的好:没有规矩,不成方圆。您可以看一下您的要改动的代码周围的画风,然后保持队形。如果你感觉周围都不知道是什么牛鬼蛇神的话就看看下面的建议: + +* 我们用肆(4)个空格来缩进(软件中也可以设置到Tab键) +* 我们使用改良的1TBS(允许单行样式) + * 左大括号: 在开放性语句块那行的末尾 + * 右大括号: 和开放性语句块第一个字母对齐 + * Else If: 将右大括号放在行的开头,下一个左大括号放在同一行的结尾 + * 可选大括号: 可选大括号是必选的 + * 应该这样: if (condition) { return false; } + * 不应该这样: if (condition) return false; +* 建议使用C语言风格的注释: `/* */` + * 把注释想象成一个描述特征的故事 + * 充分使用注释来描述你为何这样修改 + * 有些公认的东西就不要写到注释里面了 + * 如果你不知道注释是否多余,看下面 +* 一般不要主动换行,主动换行的话每行不要超过76列 +* 要把 `#pragma once` 放到头文件的开始哦,抛弃老土的(`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`)吧 +* 下面两种预处理命令都可以用: `#ifdef DEFINED` 还有 `#if defined(DEFINED)` + * 以上那句对处女座不是很友好哈,处女座的朋友们就别纠结了,直接 `#if defined(DEFINED)` 。 + * 还有就是选好一种风格就一直用,一直用一直爽,不要朝三暮四, 除非你要变化到多重条件的 `#if`。 + * `#` 和 `if`要挨在一起哦,再让本空格在中间冒充电灯泡本空格会生气的。 + * 以下是缩进规则: + * 首先考虑可读性,强迫症的朋友们总想要保持代码的高一致性,这样可不好。 + * 保证文件已有风格不变。如果代码本来就是杂糅风格,那就见机行事,让你的修改更有意义些。 + * 其实你也可以在缩进的时候看看周围其他代码,然后范水模山,预处理命令可以有自己的缩进风格。 + +可以参照下面: + +```c +/* foo 的 Enums*/ +enum foo_state { + FOO_BAR, + FOO_BAZ, +}; + +/* 有返回值的情况 */ +int foo(void) { + if (some_condition) { + return FOO_BAR; + } else { + return -1; + } +} +``` + +# Clang-format的自动格式化 +[Clang-format](https://clang.llvm.org/docs/ClangFormat.html) 是LLVM的一部分,可以帮你自动格式化代码。我们给你准备好了一个适用于以上规范的配置文件,会帮你调整缩进和换行,你只需要写好括号就好。有了它,你再也不用担心调整代码格式太耗时,没有时间陪伴自己(虚构)的另一半了。 + +使用[LLVM 完整安装](http://llvm.org/builds/)可以在Windows上安装clang-format, Ubuntu用户要用`sudo apt install clang-format`。 + +命令行的朋友们, 加上 `-style=file`选项就会自动在QMK的根目录寻找.clang-format配置文件了。 + +VSCode用户, 标准的 C/C++ 插件就支持clang-format, 或者可以用[独立扩展](https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.ClangFormat)也行。 + +有些东西(比如LAYOUT宏) 会被clang-format打乱,所以那些文件就别用clang-format了,这里就教您一个小窍门,在`// clang-format off` 和 `//clang-format on`之间装上会被搞乱的代码就好了。 + +# 一般教程 + +你可以给Q酱的不同部分添砖加瓦,但也要用不同的方法严谨检查。不论你修改哪里最好还是看看下边。 + +* 将PR(pull request)分成一个个的逻辑单元。 比如,不要一次将两个新特性PR出去。要添加的特性排好队,一个一个来。 +* 提交之前看一眼,`git diff --check`的空格一定要写对了 +* 确定你的代码能通过编译 + * 布局: 确定`make keyboard:your_new_keymap` 不返回错误 + * 键盘: 确定 `make keyboard:all` 不返回错误 + * 核心代码: 确定 `make all` 不返回错误 +* 提交的信息尽量明确。第一行写点简短介绍(每行不多于70个英文字母), 第二行空着,第三行和后面就要写些必要的细节了。最好用英文写,比如: + +``` +Adjust the fronzlebop for the kerpleplork + +The kerpleplork was intermittently failing with error code 23. The root cause was the fronzlebop setting, which causes the kerpleplork to activate every N iterations. + +Limited experimentation on the devices I have available shows that 7 is high enough to avoid confusing the kerpleplork, but I'd like to get some feedback from people with ARM devices to be sure. +``` + +## 文档 + +想帮助Q酱当然是先看文档最简单了。找到这个文档哪里错了然后改正它对于你来说超级简单! 我们也对有写文档能力的人求贤若渴,如果你是对的人[点这个](#Q酱,我在哪能帮助你嘞?)! + +文档呢,都静静的放在`qmk_firmware/docs` 目录里, 也或者您想为网页做贡献的话也是可以的哦。 + +在文档中附代码案例时, 先观察文档其他地方的命名规范。比如, 把enums的名字都改成像`my_layers`或者`my_keycodes`来防止名字不一致的enums被当作特务枪毙: + +```c +enum my_layers { + _FIRST_LAYER, + _SECOND_LAYER +}; + +enum my_keycodes { + FIRST_LAYER = SAFE_RANGE, + SECOND_LAYER +}; +``` + +## 布局 + +大多数QMK新手都从创建一个自己的布局开始。我们尽力保证布局规范宽松 (毕竟布局是个性的体现) 不过建议遵守以下准则,这样可以让别人更好理解你的代码 + +* 用 [模板](documentation_templates.md)写个`readme.md`。 +* 所有的布局PR都会被squash, 如果你想知道你的提交是怎么被squash的那你就自己来吧 +* 不要把新特性和布局一起PR。可以分别PR他们 +* 布局文件夹就不要放`Makefile`了,这个操作都过时啦 +* 更新文件头部的copyrights(看`%YOUR_NAME%`那) + +## 键盘 + +QMK的最终归宿是键盘。有些键盘是社区维护的,有一些是制作这些键盘的人维护的。`readme.md`会告诉你是谁维护了这个键盘,如果你对某个键盘有疑问,可以 [创建一个Issue](https://github.com/qmk/qmk_firmware/issues) 来问一问维护者。 + +我们建议你按下面的来操作: + +* 用[模板](documentation_templates.md)写`readme.md`。 +* 提交数量尽量合理,不然我们可就要把你的PR给squash了。 +* 不要把新特性和新键盘一起PR。可以分别PR他们 +* 用父文件夹的名字命名 `.c`/`.h`文件, 比如`/keyboards///.[ch]` +* 键盘文件夹就不要放`Makefile`了,这个操作都过时啦 +* 更新文件头部的copyrights(看`%YOUR_NAME%`那) + +## Quantum/TMK 核心 + +在您废寝忘食地开发Q酱新特性或者帮Q酱驱虫之前,一定要确保你的工作是有意义的。看看[了解QMK](understanding_qmk.md)你会对Q酱有更深的了解,这个文档将带你领略QMK的程序流程。现在你应该和维护团对谈谈来了解实现你想法的最佳方法了。一下渠道都可以: + +* [在Discord交流](https://discord.gg/Uq7gcHh) +* [建立一个Issue](https://github.com/qmk/qmk_firmware/issues/new) + +新特性和BUG的修复影响所有键盘。开发组也在翻修QMK。所以,在实施重大返修之前一定要讨论一下。如果你在没有事先与维护团队沟通的情况下提交了一个PR,而且你的选择与维护团队的计划方向不符,那你可能要面临大改了。 + +修复BUG或者开发新特性之前看看这个: + +* **默认不启用** - QMK运行的芯片多数内存有限,所以首要考虑的还应该是布局不要被破坏,于是特性默认是不启用的。你喜欢什么特性的话就打开它,如果你觉得有些特性应该默认开启或者你能帮助缩减代码,那就联系维护组吧。 +* **提交之前在本地编译** - 这个简直就是家喻户晓了,但是也确实需要编译啊! 我们的Travis系统会发现一切问题,但是自己编译一下可要比在线等快多了。 +* **注意版本和芯片平台** - 有那么几个键盘有支持不同配置甚至是不同芯片的版本。试着写一个能AVR和ARM两个平台运行的特性,或者在不支持的平台自动禁用。 +* **解释你的新特性** - 在`docs/`写个文档, 你可以创建新文档或者写到现有文档中。如果你不把它记录下来,其他人就无法从你的努力中获益。 + +也可以看看以下建议: + +* 提交数量尽量合理,不然我们可就要把你的PR给squash了。 +* 不要把新特性、布局和键盘一起PR。可以分别PR他们。 +* 给你的特性写[单元测试](unit_testing.md)。 +* 你编辑的文件风格要一致,如果风格不明确或者是混搭风的,你就要先看看[代码规范](#代码规范)确认情况。 + +## 重构 + +为了保持QMK脉络清晰,Q酱打算深入规划重构一下自己,然后让合作者进行修改。如果你有重构的思路或建议[创建一个issue](https://github.com/qmk/qmk_firmware/issues), Q酱很乐意讨论一下怎么改进一下。 + +# 行为守则对于我来说有何意义? + +我们的[行为守则](https://github.com/qmk/qmk_firmware/blob/master/CODE_OF_CONDUCT.md) 是说明您有责任尊重和礼貌地对待项目中的每个人,无论他们的身份如何。 如果你是我们行为准则所描述的不当行为的受害者,我们将站在你这边,并按照行为准则对施暴者进行适当谴责。 diff --git a/docs/zh-cn/custom_quantum_functions.md b/docs/zh-cn/custom_quantum_functions.md new file mode 100644 index 00000000000..42ceba9cac7 --- /dev/null +++ b/docs/zh-cn/custom_quantum_functions.md @@ -0,0 +1,490 @@ +# ζ̵Ĺ + +ںܶ˵ƻ̿ɲֻĵԷ㰴Ǹô򵥡϶ʵֱȼ򵥰ͺӵĹܡQMKעĹ, ǹ, ⣬ԶڲͬµΪ + +ҳٶκQMK֪ʶĶ[QMK](understanding_qmk.md)ڸIJⷢʲô + +## A Word on Core vs vs + +ǰqmk֯һνṹ + +* Core (`_quantum`) + * Keyboard/Revision (`_kb`) + * Keymap (`_user`) + +ÿһڶϼһ`_kb()` `_user()` ׺ ڼ/޶ʹ`_kb()`׺ڲֲʹ`_user()`׺ + +ڼ/޶㶨庯ʱ`_kb()`ִκδǰȵ`_user()`DZҪģȻֲ㺯ͲҪá + +# Զ + +ĿǰΪֹǸмΪ򴴽µļ롣ӴǶЩơ + +## һ¼ + +һöٳȫҲǸֲΨһֵQMKûֱֵСṩһ`SAFE_RANGE`ꡣöʱ`SAFE_RANGE`֤ȡΨһļֵ + + +öӡӵ`keymap.c`Ļڲ`FOO``BAR`ˡ + +```c +enum my_keycodes { + FOO = SAFE_RANGE, + BAR +}; +``` + +## ΪΪ + +㸲һѴڰΪʱΪ¼ʱҪ`process_record_kb()``process_record_user()`ڼʵ¼ǰQMKá`true`QMKķʽ롣ԺܷչĹܶ滻`false` QMKȻͼ̧ǰ¼ˡ + +ij»ͷʱᱻá + +### process_record_user()`ʾʵ + +¡Զһ`FOO`ļΪڰ»سʱ + +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case FOO: + if (record->event.pressed) { + // ʱЩʲô + } else { + // ͷʱЩʲô + } + return false; // ˼нһ + case KC_ENTER: + // »سʱ + if (record->event.pressed) { + PLAY_NOTE_ARRAY(tone_qwerty); + } + return true; // QMKس/ͷ¼ + default: + return true; // + } +} +``` + +### `process_record_*` ĵ + +* /޶: `bool process_record_kb(uint16_t keycode, keyrecord_t *record)` +* : `bool process_record_user(uint16_t keycode, keyrecord_t *record)` + +`keycode()`ڲ϶ģ`MO(1)`, `KC_L`, ȵȡ Ҫ `switch...case` Щ¼ + +`record`ʵʰϢ + +```c +keyrecord_t record { + keyevent_t event { + keypos_t key { + uint8_t col + uint8_t row + } + bool pressed + uint16_t time + } +} +``` + +# LED + +qmkṩ˶ȡHID淶5LEDķ: + +* `USB_LED_NUM_LOCK` +* `USB_LED_CAPS_LOCK` +* `USB_LED_SCROLL_LOCK` +* `USB_LED_COMPOSE` +* `USB_LED_KANA` + +ӦLED״̬λλ +ַԻLED״̬ + +* ִͨ `led_set_user()` +* ͨ `host_keyboard_leds()` + +## `led_set_user()` + +5LEDκһ״̬Ҫıʱ˺á˺ͨLED +ʹ`IS_LED_ON(usb_led, led_name)``IS_LED_OFF(usb_led, led_name)`LED״̬ + +!> `host_keyboard_leds()`ܻ`led_set_user()`ǰֵ + +### `led_set_user()`ʾʵ + +```c +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(B0); + } else { + writePinHigh(B0); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(B1); + } else { + writePinHigh(B1); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(B2); + } else { + writePinHigh(B2); + } + if (IS_LED_ON(usb_led, USB_LED_COMPOSE)) { + writePinLow(B3); + } else { + writePinHigh(B3); + } + if (IS_LED_ON(usb_led, USB_LED_KANA)) { + writePinLow(B4); + } else { + writePinHigh(B4); + } +} +``` + +### `led_set_*`ĵ + +* /޶: `void led_set_kb(uint8_t usb_led)` +* : `void led_set_user(uint8_t usb_led)` + +## `host_keyboard_leds()` + +᷵յLED״̬`led_set_*`֮ȡLED״̬ʱã[`matrix_scan_user()`](#ɨ). +Ϊ˱ݣ`IS_HOST_LED_ON(led_name)``IS_HOST_LED_OFF(led_name)` ֱ꣬ӵúͼ`host_keyboard_leds()` + +## LED״̬ + +һЩʵΪLED״̬ṩ˷ķ + +### Ergodox Boards + +Ergodoxʵṩ`ergodox_right_led_1`/`2`/`3_on`/`off()`ÿLED, Ҳ `ergodox_right_led_on`/`off(uint8_t led)` 򿪻رǡ + +⣬ʹ`ergodox_led_all_set(uint8_t n)`ָLEDȼÿLED`ergodox_right_led_1`/`2`/`3_set(uint8_t n)`ʹĻ`ergodox_right_led_set(uint8_t led, uint8_t n)` + +Ergodox boards ͬʱȼ`LED_BRIGHTNESS_LO`ȼ`LED_BRIGHTNESS_HI`(Ĭ). + +# ̳ʼ + +̳ʼм衣ǸȡҪʲô + +Ҫʼ˳г + +* `keyboard_pre_init_*` - ڴǰСЩҪǰеӲʼ +* `matrix_init_*` - ڹ̼м䱻áʱӲѳʼδʼ +* `keyboard_post_init_*` - ڹ̼󱻵á£ġƻ붼Է + +!> ڴ˵`keyboard_post_init_user`Ҫõĺ, ʱRGBƷ⡣ + +## Ԥʼ + +뼫УUSBʼǰС + +֮󲻾þͱʼˡ + +ڴû˵,òΪҪӲijʼ + +ӲʼĻٺò(ʼLEDһ). + +### `keyboard_pre_init_user()`ʾʵ + +ڼ̼趨 B0, B1, B2, B3, B4 LEDš + +```c +void keyboard_pre_init_user(void) { + // üԤʼ + + // LEDΪģʽ + setPinOutput(B0); + setPinOutput(B1); + setPinOutput(B2); + setPinOutput(B3); + setPinOutput(B4); +} +``` + +### `keyboard_pre_init_*` ĵ + +* /޶: `void keyboard_pre_init_kb(void)` +* : `void keyboard_pre_init_user(void)` + +## ʼ + +⽫ھʼʱãijЩӲúú󣬵һЩܱʼǰ + +طõĶʱãӲ޹أҲλá + + +### `matrix_init_*`ĵ + +* /޶: `void matrix_init_kb(void)` +* : `void matrix_init_user(void)` + + +## ̺ʼ + +Ǽ̳ʼеһijЩԣãΪʱӦöǽгʼ + + +### `keyboard_post_init_user()`ʾʵ + +ʾгʼɺУRGBơ + +```c +void keyboard_post_init_user(void) { + // úʼ + rgblight_enable_noeeprom(); // ʹRgb + rgblight_sethsv_noeeprom(180, 255, 255); // ɫõɫ(ɫ) + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); // ÿٺģʽ +} +``` + +### `keyboard_post_init_*` ĵ + +* /޶: `void keyboard_post_init_kb(void)` +* : `void keyboard_post_init_user(void)` + +# ɨ + +ܵĻҪ`process_record_*()`Զַ̣ʽӵ¼Уȷ벻Լ̲Ӱ졣Ȼڼ£бҪоɨ衣ЩҪرעܣΪÿٱ10Ρ + +### `matrix_scan_*`ʾʵ + +ӱʡˡhookһܼе֮ǰӦ㹻˽qmkڲṹԱûʾ±дҪ[һissue](https://github.com/qmk/qmk_firmware/issues/new)[Discordǽ](https://discord.gg/Uq7gcHh). + +### `matrix_scan_*` ĵ + +* /޶: `void matrix_scan_kb(void)` +* : `void matrix_scan_user(void)` + +úÿξɨʱãMCUͬдҪΪкܶΡ + +ԶɨʱõҲԶ״̬(LEDƻĻ)ûҲ붨еĹܡ + + +# / + +֧־ͿֹͨͣһƱﵽ""RGBƺͱǺܺõӡԽԼܺģҲ̷ζѡ + +: `suspend_power_down_*``suspend_wakeup_init_*`, ֱϵͳкͻʱá + + +### suspend_power_down_user()suspend_wakeup_init_user()ʾʵ + + +```c +void suspend_power_down_user(void) { + rgb_matrix_set_suspend_state(true); +} + +void suspend_wakeup_init_user(void) { + rgb_matrix_set_suspend_state(false); +} +``` + +### / ĵ + +* /޶: `void suspend_power_down_kb(void)` `void suspend_wakeup_init_user(void)` +* : `void suspend_power_down_kb(void)` `void suspend_wakeup_init_user(void)` + +# ı + +ÿıд롣ڲָʾԶ㴦á + +### `layer_state_set_*` ʾʵ + +ʹPlanckʾ [RGB](feature_rgblight.md)ʹ֮Ӧ + +```c +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _RAISE: + rgblight_setrgb (0x00, 0x00, 0xFF); + break; + case _LOWER: + rgblight_setrgb (0xFF, 0x00, 0x00); + break; + case _PLOVER: + rgblight_setrgb (0x00, 0xFF, 0x00); + break; + case _ADJUST: + rgblight_setrgb (0x7A, 0x00, 0xFF); + break; + default: // for any other layers, or the default layer + rgblight_setrgb (0x00, 0xFF, 0xFF); + break; + } + return state; +} +``` +### `layer_state_set_*` ĵ + +* /޶: `uint32_t layer_state_set_kb(uint32_t state)` +* : `uint32_t layer_state_set_user(uint32_t state)` + + +`״̬`ǻbitmask, [ָ](keymap.md#ֵIJ״̬) + + +# 籣 (EEPROM) + +óڵıڼСЩñصEEPROM粻ʧ ÿ`eeconfig_read_kb``eeconfig_read_user`ȡ`eeconfig_update_kb``eeconfig_update_user`д롣ϣܹлĹܺ(лRGBָʾ⣬`eeconfig_init_kb``eeconfig_init_user`EEPROMĬֵ + +ӵIJֿǣкܶ෽ͨEEPROM洢ͷݣҲûַǡȷġÿֻһ˫(ֽ)ռ䡣 + +סEEPROMдġдܸߣDzֻдEEPROMСдƵMCU̡ + +* ӣôϣʹԣΪ൱ӡ + +### ʾʵ + +ãҶдʹû֡һӵĺкܶҪʵϣʹ˺ܶ + + +keymap.cļУ´: +```c +typedef union { + uint32_t raw; + struct { + bool rgb_layer_change :1; + }; +} user_config_t; + +user_config_t user_config; +``` + +ϴ뽨һṹ壬ýṹԴ洢òдEEPROM㽫趨ΪڽṹȻ塣Ҫס`bool` ()ֵʹ1λ, `uint8_t`ʹ8λ, `uint16_t`ʹ16λԻϴʹã˳Ǵܻ鷳Ϊǻıддֵ + + `layer_state_set_*`ʹ`rgb_layer_change`ʹ`keyboard_post_init_user``process_record_user`һС + +Ҫʹ`keyboard_post_init_userҪ`eeconfig_read_user()`ոմĽṹ塣ȻʹṹIJеĹܡ +```c +void keyboard_post_init_user(void) { + // òּľʼ + + // EEPROMû + user_config.raw = eeconfig_read_user(); + + // ʹܣĬϲ + if (user_config.rgb_layer_change) { + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom_cyan(); + rgblight_mode_noeeprom(1); + } +} +``` +ϺڶEEPROMúʹøĬϲRGBɫ"raw"ֵǴ"union"Ľṹתġ + +```c +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _RAISE: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); } + break; + case _LOWER: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); } + break; + case _PLOVER: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); } + break; + case _ADJUST: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); } + break; + default: // Ĭϲ + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); } + break; + } + return state; +} +``` +ֵʹʱıRGBơֵ, Ϊ`process_record_user`һ¼`RGB_LYR`ҪȷʹRGB룬ʹʾرգ뽫Ϊ +```c + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case FOO: + if (record->event.pressed) { + // ʱʲô + } else { + // ͷʱʲô + } + return false; // ˼Ľһ + case KC_ENTER: + // ڰ»سʱ + if (record->event.pressed) { + PLAY_NOTE_ARRAY(tone_qwerty); + } + return true; // QMKس/ͷ¼ + case RGB_LYR: // underglowΪָʾʹá + if (record->event.pressed) { + user_config.rgb_layer_change ^= 1; // л״̬ + eeconfig_update_user(user_config.raw); // EEPROMд״̬ + if (user_config.rgb_layer_change) { // ״̬ʹ + layer_state_set(layer_state); // ô̸²ɫ + } + } + return false; break; + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // еRGB (see quantum_keycodes.h, L400 Բο) + if (record->event.pressed) { //ʧָܲʾıҪ + if (user_config.rgb_layer_change) { // ʹʱ + user_config.rgb_layer_change = false; // ʧܣȻ + eeconfig_update_user(user_config.raw); // EEPROMд + } + } + return true; break; + default: + return true; // + } +} +``` +Ҫ`eeconfig_init_user`ԵEEPROMʱָĬֵ, ԶǿEEPROM`EEP_RST`[Bootmagic](feature_bootmagic.md)磬ҪĬRGBָʾĬֵ + +```c +void eeconfig_init_user(void) { // EEPROM + user_config.raw = 0; + user_config.rgb_layer_change = true; // ҪĬʹ + eeconfig_update_user(user_config.raw); // EEPROMдĬֵ + + // use the non noeeprom versions, ҪEEPROMдЩֵ + rgblight_enable(); // ĬʹRGB + rgblight_sethsv_cyan(); // Ĭɫ + rgblight_mode(1); // Ĭó +} +``` + +ȻˡRGBָʾʱûһֱ棬¼̡ʹRGB룬ָʾʧܣˡ + +### 'EECONFIG' ĵ + +* /޶: `void eeconfig_init_kb(void)`, `uint32_t eeconfig_read_kb(void)``void eeconfig_update_kb(uint32_t val)` +* : `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)``void eeconfig_update_user(uint32_t val)` + +`val` дEEPROMֵ`eeconfig_read_*`EEPROMһ32λ(˫)ֵ + +# Զ-ٽֵ(TAPPING_TERM) +Ĭ,-ٽֵȫͳһģҲͨáڴû˵ܺáЩ£`LT`˵ʱ˫ܼ󣬿ΪЩļװסΪ˲ÿԶ룬ܿΪÿ`TAPPING_TERM` + +ʹܵĻ, Ҫ`config.h``#define TAPPING_TERM_PER_KEY` + + +## `get_tapping_term`ʾʵ + +Ҫ޸Ļڼ`TAPPING TERM`,Ҫ`keymap.c`ļ´: + +```c +uint16_t get_tapping_term(uint16_t keycode) { + switch (keycode) { + case SFT_T(KC_SPC): + return TAPPING_TERM + 1250; + case LT(1, KC_GRV): + return 130; + default: + return TAPPING_TERM; + } +} +``` + +### `get_tapping_term` ĵ + +ƪ,Ҫquantum߼̼ĺֻҪûɡ diff --git a/docs/zh-cn/faq.md b/docs/zh-cn/faq.md new file mode 100644 index 00000000000..3d0b65c6fd2 --- /dev/null +++ b/docs/zh-cn/faq.md @@ -0,0 +1,6 @@ +# 常见问题 + +* [一般问题](faq_general.md) +* [构建和编译QMK](faq_build.md) +* [QMK调试和故障排除](faq_debug.md) +* [布局问题](faq_keymap.md) diff --git a/docs/zh-cn/faq_build.md b/docs/zh-cn/faq_build.md new file mode 100644 index 00000000000..8fb449db304 --- /dev/null +++ b/docs/zh-cn/faq_build.md @@ -0,0 +1,150 @@ +# 关于构建的常见问题 + +本页所写是QMK构建的常见问题.如果你还没有进行过编译,就看一下[构建环境搭建](getting_started_build_tools.md) 和 [make的说明](getting_started_make_guide.md). + +## 如果您不能在Linux上编程 +您需要适当的权限才能操作设备。对于Linux用户, 请参阅下方有关`udev`规则的说明。如果您对`udev`有问题,解决方法是用`sudo`命令。如果您不熟悉此命令,使用`man sudo`查看其手册或[看这个网页](https://linux.die.net/man/8/sudo). + +在你的主控是ATMega32u4时,以下是使用`sudo`命令的样例: + + $ sudo dfu-programmer atmega32u4 erase --force + $ sudo dfu-programmer atmega32u4 flash your.hex + $ sudo dfu-programmer atmega32u4 reset + +或只用; + + $ sudo make ::dfu + +使用`sudo`运行`make`一般来说**不**推荐,如果可能,尽量使用前一种方法之一。 + +### Linux `udev` 规则 +在Linux上,您需要适当的权限才能访问MCU。你也可以在刷新固件时使用 `sudo`,或把这些文件放到`/etc/udev/rules.d/`。 + +**/etc/udev/rules.d/50-atmel-dfu.rules:** +``` +# Atmel ATMega32U4 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", MODE:="0666" +# Atmel USBKEY AT90USB1287 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", MODE:="0666" +# Atmel ATMega32U2 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", MODE:="0666" +``` + +**/etc/udev/rules.d/52-tmk-keyboard.rules:** +``` +# tmk键盘产品 https://github.com/tmk/tmk_keyboard +SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666" +``` +**/etc/udev/rules.d/54-input-club-keyboard.rules:** + +``` +# Input Club keyboard bootloader +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", MODE:="0666" +``` + +### 串行设备在Linux上检测不到bootloader模式 +确保您的内核对您的设备有相应的支持。 如果你的设备是 USB ACM, 比如Pro Micro (Atmega32u4),就要加上`CONFIG_USB_ACM=y`. 其他设备可能需要`USB_SERIAL` 及其任何子选项。 + +## DFU Bootloader的未知设备 + +如果您在使用Windows来刷新键盘的时候碰到了问题,检查设备管理器。如果在键盘处于 "bootloader模式"时你看到 "未知设备",说明你可能面临设备问题。 + +重新运行MSYS2上的安装脚本或许会凑效(比如在MSYS2/WSL运行 `./util/qmk_install.sh`) 或者重新安装QMK工具箱也可能会解决你的问题。 + +如果以上方法还是短针攻疽,那您可能需要使用[Zadig Utility](https://zadig.akeo.ie/)。下载此程序, 找到设备问题, 然后选择 `WinUSB`选项, 然后点击"Reinstall driver"。完成后再试试刷新你的键盘。倘若依然徒劳无功,那就尝试所有选项直到好用为止。 + +?> 事实上没有一个驱动的最佳选择,有些选项就是和某些系统相辅相成。但libUSB和WinUSB似乎也算是这里的最佳选择了。 +如果bootloader在设备列表中没有显示,你可能要使能 "List all devices"选项在选项菜单中`Options`,然后找到有问题的bootloader设备。(译者注:在win10中可能为 查看-显示隐藏的设备) + + +## WINAVR已淘汰 +不再推荐使用WINAVR,使用可能会导致问题 +详情请见[TMK Issue #99](https://github.com/tmk/tmk_keyboard/issues/99). + +## USB VID 和 PID +你可以在编辑`config.h`时使用任何你想用的ID值。实际上,使用任何可能未使用的ID都没有问题,除了有极低的与其他产品发生冲突的可能性。 + +大多数QMK主板使用`0xFEED`作为vendor ID。您应该查看其他键盘,以确保选择了唯一的Product ID。 + +也要看看这个。 +https://github.com/tmk/tmk_keyboard/issues/150 + +一也可以在下方链接购买一个唯一的VID:PID。不过个人使用似乎用不着这个。 +- http://www.obdev.at/products/vusb/license.html +- http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1 + +## Cortex: `cstddef: No such file or directory` +在Ubuntu 14.04上的GCC 4.8 会出现这种问题需要用这个PPA升级到4.9。 +https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded + +https://github.com/tmk/tmk_keyboard/issues/212 +https://github.com/tmk/tmk_keyboard/wiki/mbed-cortex-porting#compile-error-cstddef +https://developer.mbed.org/forum/mbed/topic/5205/ + +## `clock_prescale_set` and `clock_div_1` Not Available +你的工具链太旧了不支持MCU。比如WinAVR 20100110就不支持ATMega32u2. + +``` +Compiling C: ../../tmk_core/protocol/lufa/lufa.c +avr-gcc -c -mmcu=atmega32u2 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DVERSION=unknown -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_alps64/protocol/lufa/lufa.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_alps64_protocol_lufa_lufa.o.d ../../tmk_core/protocol/lufa/lufa.c -o obj_alps64/protocol/lufa/lufa.o +../../tmk_core/protocol/lufa/lufa.c: In function 'setup_mcu': +../../tmk_core/protocol/lufa/lufa.c:575: warning: implicit declaration of function 'clock_prescale_set' +../../tmk_core/protocol/lufa/lufa.c:575: error: 'clock_div_1' undeclared (first use in this function) +../../tmk_core/protocol/lufa/lufa.c:575: error: (Each undeclared identifier is reported only once +../../tmk_core/protocol/lufa/lufa.c:575: error: for each function it appears in.) +make: *** [obj_alps64/protocol/lufa/lufa.o] Error 1 +``` + + +## AVR的BOOTLOADER_SIZE +注意Teensy2.0++ bootloader的大小是2048字节。有些Makefile注释错了。 + +``` +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 2048 +# Atmel DFU loader 4096 (TMK Alt Controller) +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=2048 +``` + +## 在MacOS上 `avr-gcc: internal compiler error: Abort trap: 6 (program cc1)` +这是brew更新的问题,导致AVR GCC依赖的符号链接被损坏。 + +解决方案是移除并重新安装所有受影响的模块。 + +``` +brew rm avr-gcc +brew rm dfu-programmer +brew rm dfu-util +brew rm gcc-arm-none-eabi +brew rm avrdude +brew install avr-gcc +brew install dfu-programmer +brew install dfu-util +brew install gcc-arm-none-eabi +brew install avrdude +``` + +### avr-gcc 8.1 和 LUFA + +如果你把avr-gcc升级到7以上你可能会遇到关于LUFA的问题。比如: + +`lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h:380:5: error: 'const' attribute on function returning 'void'` + +那你就需要在brew中把avr-gcc回退到7。 + +``` +brew uninstall --force avr-gcc +brew install avr-gcc@8 +brew link --force avr-gcc@8 +``` + +### 我刷新了我的键盘但是键盘不工作/按键没有注册 - 而且还是ARM的 (rev6 planck, clueboard 60, hs60v2, etc...) (Feb 2019) +由于EEPROM在基于ARM的芯片上的工作原理,保存的设置可能不再有效。这会影响默认层,而且*或许*在某些情况下,会使键盘不好用,我们仍在调查这些情况。重置EEPROM将解决此问题。 + +[Planck rev6键盘重置EEPROM](https://cdn.discordapp.com/attachments/473506116718952450/539284620861243409/planck_rev6_default.bin) 是用于强制重置EEPROM的。刷入这个文件后,再次刷入正常固件,这会将键盘恢复到_正常_工作状态。 +[Preonic rev3键盘重置EEPROM](https://cdn.discordapp.com/attachments/473506116718952450/537849497313738762/preonic_rev3_default.bin) + +如果以任何形式启用了bootmagic, 那么您还需要(看[Bootmagic文档](feature_bootmagic.md) 以及键盘信息,以了解如何执行此操作的详细信息). diff --git a/docs/zh-cn/faq_debug.md b/docs/zh-cn/faq_debug.md new file mode 100644 index 00000000000..ca8b3fd25dc --- /dev/null +++ b/docs/zh-cn/faq_debug.md @@ -0,0 +1,233 @@ +# 调试的常见问题 + +本篇详细介绍了人们在键盘故障排除时的各种常见问题。 + +# 调试控制台 + +## `hid_listen` 无法识别设备 +当设备的调试控制台未就绪时,您将看到如下内容: + +``` +Waiting for device:......... +``` + +插入设备后,*hid_listen*找到该设备,您将收到以下消息: + +``` +Waiting for new device:......................... +Listening: +``` + +如果您无法获得这条“Listening:”消息,请尝试在[Makefile]中使用 `CONSOLE_ENABLE=yes` + +在Linux这样的操作系统上,你可能需要一些权限。 +- 使用`sudo hid_listen` + +## 控制台没有返回消息 +检查: +- *hid_listen* 找到了你的设备。看前面。 +- 输入**Magic**+d打开调试。详见[Magic Commands](https://github.com/tmk/tmk_keyboard#magic-commands)。 +- 设置`debug_enable=true` ,一般存在于**matrix.c**的`matrix_init()`中。 +- 尝试使用'print'函数而不要用调试输出。详见**common/print.h**。 +- 断开其他有控制台功能的设备。 详见[Issue #97](https://github.com/tmk/tmk_keyboard/issues/97)。 + +## Linux或UNIX这样的系统如何请求超级用户权限 +用'sudo'来执行*hid_listen*就有权限了。 +``` +$ sudo hid_listen +``` + +或者把一个文件放到规则文件夹来为TMK设备添加*udev规则*,不同系统的目录可能有所不同。 + +文件: /etc/udev/rules.d/52-tmk-keyboard.rules(在Ubuntu系统的情况下) +``` +# tmk keyboard products https://github.com/tmk/tmk_keyboard +SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666" +``` + +*** + +# 其他 +## 安全注意事项 + +你应该不想要把你的键盘变成"砖头"吧,就是变成没法重写固件的那种。 +下面讲解一些参数来告诉你什么风险很大(其实也不是很大)。 + +- 假如你键盘表面没有设计重置键"RESET", 那你要进入bootloader的话就要按PCB上的RESET了。 + 按PCB上的RESET要拧开键盘底部。 +- 如果 tmk_core / common 里面的文件丢失键盘可能失灵。 +- .hex太大可能不太好; `make dfu` 会删除块,检验大小(咦?好像反了...)。 + 一但出错,刷新键盘失败的话就困在DFU出不去了。 + - 所以, 要知道大小限制。 Planck键盘上.hex文件最大大小是 is 7000h (十进制是28672) + +``` +Linking: .build/planck_rev4_cbbrowne.elf [OK] +Creating load file for Flash: .build/planck_rev4_cbbrowne.hex [OK] + +Size after: + text data bss dec hex filename + 0 22396 0 22396 577c planck_rev4_cbbrowne.hex +``` + + - 上面那个文件大小是 22396/577ch,比28672/7000h小 + - 当你有一个合适的.hex文件时,你就要重试加载那个了 + - 您在键盘Makefile中的某些选项可能消耗额外内存;注意以下这几个 + BOOTMAGIC_ENABLE, MOUSEKEY_ENABLE, EXTRAKEY_ENABLE, CONSOLE_ENABLE, API_SYSEX_ENABLE +- DFU 工具/不/可以写入bootloader (unless you throw in extra fruit salad of options), + 所以还是有点危险的 +- EEPROM大概有100000次循环寿命。不要总是频繁重写固件;EEPROM会玩坏的。 +## 全键无冲不好用 +首先你要在**Makefile**用如下命令编译固件`NKRO_ENABLE`。 + +全键无冲还不好用的话试着用`Magic` **N** 命令(默认是`LShift+RShift+N`)。这个命令会在**全键无冲**和**六键无冲**之间临时切换。有些情况**全键无冲**不好用你就需要使用**六键无冲**模式,尤其是在BIOS中。 + +如果你的固件使用`BOOTMAGIC_ENABLE`编译的你要用`BootMagic` **N** 命令(默认`Space+N`)打开开关。这个设置保存在EEPROM中并保存在电源循环中。 + + +https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch + + +## 指点杆需要复位电路(PS/2 鼠标支持) +如果没有复位电路,由于硬件初始化不正确,您将得到不一致的结果。查看TPM754复位电路。 + +- http://geekhack.org/index.php?topic=50176.msg1127447#msg1127447 +- http://www.mikrocontroller.net/attachment/52583/tpm754.pdf + + +## 矩阵不可读16以上的列 +当列超过16时[matrix.h]的`read_cols()`中,用`1UL<<16`而不要用`1<<16`。 + +在C语言中`1` 是一个[int] 类型的[16 bit]值,在AVR中你不能左移大于15次。如果你使用`1<<16`的话会得到意外的零。你要用 [unsigned long]类型,比如`1UL`。 + +http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279 + + +## Bootloader跳转不好用 +在**Makefile**中正确配置**Makefile**大小。如果分区大小不正确,引导加载程序可能无法从**Magic command**和**Boot Magic**加载。 +``` +# bootloader字节数: +# Atmel DFU loader(ATmega32U4) 4096 +# Atmel DFU loader(AT90USB128) 8192 +# LUFA bootloader(ATmega32U4) 4096 +# Arduino Caterina(ATmega32U4) 4096 +# USBaspLoader(ATmega***) 2048 +# Teensy halfKay(ATmega32U4) 512 +# Teensy++ halfKay(AT90USB128) 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 +``` +AVR引导大小是通过**BOOTSZ**熔丝位来设置的。查阅你单片机的datasheet。 +记住,datasheet用的是**Word**(2字节)表示大小和地址,TMK用的是**Byte**。 + +AVR引导部分位于闪存的末尾,如下所示(Application是应用区,Bootloader是引导区)。 +``` +byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB1286) +0x0000 +---------------+ 0x00000 +---------------+ + | | | | + | | | | + | Application | | Application | + | | | | + = = = = + | | 32KB-4KB | | 128KB-8KB +0x6000 +---------------+ 0x1E000 +---------------+ + | Bootloader | 4KB | Bootloader | 8KB +0x7FFF +---------------+ 0x1FFFF +---------------+ + + +byte Teensy(ATMega32u4) byte Teensy++(AT90SUB1286) +0x0000 +---------------+ 0x00000 +---------------+ + | | | | + | | | | + | Application | | Application | + | | | | + = = = = + | | 32KB-512B | | 128KB-2KB +0x7E00 +---------------+ 0x1FC00 +---------------+ + | Bootloader | 512B | Bootloader | 2KB +0x7FFF +---------------+ 0x1FFFF +---------------+ +``` + +详情请见下方issue。 +https://github.com/tmk/tmk_keyboard/issues/179 + +如果你使用TeensyUSB, 有一个[已知bug](https://github.com/qmk/qmk_firmware/issues/164)硬件重置按钮阻止软件定义重置键工作。重新插拔键盘就好了。 + +## 特殊额外键不起作用(系统,音频控制键) +你要在`rules.mk`定义`EXTRAKEY_ENABLE`在QMK中使用它们。 + +``` +EXTRAKEY_ENABLE = yes # 音频控制和系统控制 +``` + +## 睡眠唤醒不好用 + +在Windows查看设备管理器中该键盘设备属性中电源管理选项卡中的`允许此设备唤醒计算机(O)`是否勾选。同时看一眼BIOS设置。 + +在主机睡眠时按下任何键都可以唤醒了。 + +## 使用Arduino? + +**注意Arduino的针脚名字和主控芯片的不一样。** 比如, Arduino的`D0`并不是`PD0`。自己用原理图捋一下电路。 + +- http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf +- http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf + +Arduino Leonardo和micro使用**ATMega32U4**,该芯片TMK可用,但Arduino的bootloader会导致问题。 + + +## 在USB AVR使用PF4-7针脚? +你要置位MCUCR寄存器JTD位来将PF4-7设置为GPIO。这些针脚默认是JTAG功能。 像ATMega*U* or AT90USB*这样的MCU会受影响。 + +如果是用Teensy的话就不需要了。Tennsy自带JTAGEN位未编程来失能该功能。 + +代码如下。 +``` + // F接口JTAG失能。在四个周期内写入两次JTD位。 + MCUCR |= (1< + +## QMKTMKʲô? + +TMK[Jun Wako](https://github.com/tmk)ƺִСQMKʼ[Jack Humbert](https://github.com/jackhumbert)ΪPlanck̴TMKֲ档һʱJackķֲͺTMKȥԶˣ2015꣬JackQMK + +Ӽ۵QMKTMKһЩ¹ܶɵġQMKչ˿õļ룬ʹ߼ܽһḻ `S()`, `LCTL()`, `MO()`ȫ[](keycodes.md). + +ӹ̵TMKԼάйٷֵ֧ļֻ̣кСһ֧֡άѴڷֲΪ̴ķֲ档Ĭֺ֧ٵļ룬ûͨ˷֡QMKͨйֺֿͼ̣ǻз׼PRͼı֤άͬʱQMKСҲڱҪʱ + +ַŵȱ㣬ҴʱTMKQMK֮ diff --git a/docs/zh-cn/faq_keymap.md b/docs/zh-cn/faq_keymap.md new file mode 100644 index 00000000000..ee8e3c06bfe --- /dev/null +++ b/docs/zh-cn/faq_keymap.md @@ -0,0 +1,212 @@ +# 布局常见问题 + +本页本页包含人们经常遇到的关于布局的问题。如果你觉得没什么问题,请先看[布局概览](keymap.md)。 + +## 我能用什么键码? +看[键码](keycodes.md)你可以找到你能用的键码索引。可以的话这些链接可以连接到更广泛的文档。 + +键码实际上定义在[common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h). + +## 默认的键码什么样? + +世界上有三种标准键盘设计,分别是:ANSI, ISO, and JIS. 主要是北美用ANSI(译者注:中国很多键盘使用这个), 欧洲和非洲主要使用ISO,日本使用JIS。未提及的区域通常使用ANSI或ISO。与这些设计对应的键代码如下所示: + + +![键盘设计图](https://i.imgur.com/5wsh5wM.png) + +## 我有一些键变成了其他功能或者不工作了 + +QMK有两个功能,Bootmagic和命令行,它允许您在运行中更改键盘的行为。该功能包括但不仅限于, 交换Ctrl/Caps,关闭界面,交换Alt/Gui,交换 Backspace/Backslash,禁用所有键,以及其他的行为改变。 + +快速解决方法是插入键盘时按住`Space`+`Backspace`。该操作将重置已保存设置,让这些键回复初始功能。这招不好用的话参阅下方: + +* [Bootmagic](feature_bootmagic.md) +* [命令](feature_command.md) + +## 菜单键不好用 + +现在大多数键盘 `KC_RGUI`和`KC_RCTL`中间的键子叫做`KC_APP`。这是因为在这个键子发明之前相关标准里就已经有键叫做`MENU(菜单)`了,所以微软叫他`APP(应用)`键。 + +## `KC_SYSREQ` 不工作 +使用抓屏的键码(`KC_PSCREEN`或`KC_PSCR`)而不用`KC_SYSREQ`。组合键'Alt + Print Screen'会被当作'System request'。 + +见[issue #168](https://github.com/tmk/tmk_keyboard/issues/168)和 +* http://en.wikipedia.org/wiki/Magic_SysRq_key +* http://en.wikipedia.org/wiki/System_request + +## 电源键不工作 + +这有点让人困惑,QMK有两个"Power(电源)"键码: `KC_POWER` 在键盘/小键盘的HID使用页面中,`KC_SYSTEM_POWER` (或者叫`KC_PWR`)在用户页。 + +前者只能被macOS识别,但是后者,即`KC_SLEP`和`KC_WAKE`三大主要操作系统全都支持,所以推荐使用这两个。Windows下这些键立即生效,macOS要长按直到弹出对话框。 + +## 自动大小写锁定 +可以解决'the'问题(正常应为The)。我经常在输入'The'时不慎输入了'the'或者'THe'。自动大小写锁定可以修正此类问题。详见下方链接。 +https://github.com/tmk/tmk_keyboard/issues/67 + +## 修改 键/层 卡住 +除非正确配置层切换,否则修改键或层可能会卡住。 +对于修改键和图层操作,必须把`KC_TRANS`放到目标层的相同位置,用于注销修改键或在释放事件时返回到上一层。 +* https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#31-momentary-switching +* http://geekhack.org/index.php?topic=57008.msg1492604#msg1492604 +* https://github.com/tmk/tmk_keyboard/issues/248 + + +## 机械自锁开关支持Mechanical Lock Switch Support + +本功能用于*机械自锁开关*比如[this Alps one](http://deskthority.net/wiki/Alps_SKCL_Lock)。你可以通过向`config.h`添加以下宏来使能该功能: + +``` +#define LOCKING_SUPPORT_ENABLE +#define LOCKING_RESYNC_ENABLE +``` + +在使能该功能后,要在键盘中使用`KC_LCAP`, `KC_LNUM` 和 `KC_LSCR`这三个键码。 + +远古机械键盘偶尔会有自锁机械开关,现在几乎没有了。***大多数情况下你不需要使用该功能,且要使用`KC_CAPS`, `KC_NLCK`和`KC_SLCK`这三个键码。*** + +## 输入ASCII之外的特殊字符比如Cédille 'Ç' +没有在所有系统中输入这个的通用方法。你要定义针对你的特定操作系统或布局的**宏**。 + +比如看这个**宏**代码的文章。 + +http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-120.html#p195620 + +在**Windows**上,可以用`AltGr`键或**Alt码**。 +* http://en.wikipedia.org/wiki/AltGr_key +* https://zh.wikipedia.org/wiki/Alt%E7%A0%81 + +在**Mac OS**定义`Option`键组合。 +* https://zh.wikipedia.org/wiki/Option%E9%94%AE#%E6%9B%BF%E4%BB%A3%E9%94%AE%E7%9B%98%E8%BE%93%E5%85%A5 + +在**Xorg**可以改用`compose`键。 +* http://en.wikipedia.org/wiki/Compose_key + +下方链接查看**Unicode**输入。 +* http://en.wikipedia.org/wiki/Unicode_input + +## macOS上的`Fn` + +不像大多数FN键,苹果上那个有自己的键码...呃,基本上算吧。 他取缔了基本6键无冲HID报告的第六个键码 -- 所以苹果键盘其实是5键无冲的。 + +技术上说QMK可以发送这个键。但是,这样做需要修改报告格式以添加FN键的状态。这还不是最糟糕的,你的键盘的VID和PID和真的苹果键盘不一样的话还不会被识别。 +QMK官方支持这个会被律师函的,所以就当我没说过。 + +详见[issue#2179](https://github.com/qmk/qmk_firmware/issues/2179)。 + + +## Mac OSX的媒体控制键 +#### KC_MNXT 和 KC_MPRV 在Mac上不好用 +使用 `KC_MFFD`(`KC_MEDIA_FAST_FORWARD`) 和 `KC_MRWD`(`KC_MEDIA_REWIND`),不要用 `KC_MNXT` 和 `KC_MPRV`. +详见 https://github.com/tmk/tmk_keyboard/issues/195 + + +## Mac OSX中支持那些键? +你可以从此源码中获知在OSX中支持哪些键码 + +`usb_2_adb_keymap` 阵列映射 键盘/小键盘 页用于ADB扫描码(OSX内部键码). + +https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/Cosmo_USB2ADB.c + +`IOHIDConsumer::dispatchConsumerEvent`会处理用户页面用法。 + +https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/IOHIDConsumer.cpp + + +## Mac OSX中的JIS键 +岛国特别键比如`無変換(Muhenkan)`, `変換(Henkan)`, `ひらがな(hiragana)`OSX是不是别的。You can use **Seil** to enable those keys, try following options. + +* 在电脑键盘上使能NFER键 +* 在电脑键盘上使能XFER键 +* 在电脑键盘上使能KATAKAN键 + +https://pqrs.org/osx/karabiner/seil.html + + +## RN-42蓝牙模块与Karabiner不能有效协同工作 +Karabiner - Mac OSX的改键软件 - 默认RN-42模块是不会被响应的。想要Karabiner和你的键盘协同工作你要使能此选项: +https://github.com/tekezo/Karabiner/issues/403#issuecomment-102559237 + +此问题详见下方链接。 +https://github.com/tmk/tmk_keyboard/issues/213 +https://github.com/tekezo/Karabiner/issues/403 + + +## Esc 和 ` 双功能键 + +请见[Grave Escape](feature_grave_esc.md)功能。 + +## 右侧双角色修改键(诸如Shift、Alt等有修改其他键作用的键)变箭头键 +右侧修改键单击时会变为箭头键,长按就还是修改键。在TMK中双角色键称之为**TAP**. +``` + +#include "keymap_common.h" + + +/* 用TMK双角色键功能实现右侧修改键改箭头键 + * + * https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#213-modifier-with-tap-keydual-role + * https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys + */ +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty */ + [0] = LAYOUT( \ + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS,BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ + LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \ + LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,FN0, ESC, \ + FN4, LGUI,LALT, SPC, APP, FN2, FN1, FN3), + [1] = LAYOUT( \ + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN5, TRNS, \ + TRNS,TRNS,TRNS, TRNS, TRNS,FN7, FN6, FN8), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_UP), + [1] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_DOWN), + [2] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_LEFT), + [3] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_RIGHT), + [4] = ACTION_LAYER_MOMENTARY(1), + [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_PGUP), + [6] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_PGDN), + [7] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_HOME), + [8] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_END), +}; + +``` + +双角色键说明: https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys + + +## Mac OSX的弹出键 +`KC_EJCT` 键码在OSX可以使用 https://github.com/tmk/tmk_keyboard/issues/250 +似乎Windows10会忽略该键码,Linux/Xorg可以识别该键码但默认不映射。 + +目前尚不清楚如何在真正的苹果键盘按出弹出键。HHKB使用`F20`用于弹出键(`Fn+f`),该功能在MAC模式有效但不保证与苹果弹出键码相符。 + + +## `action_util.c`中的 `weak_mods`和`real_mods`是什么 +___待改善___ + +real_mods 用于保存实际(物理)修改键的实际状态。 +weak_mods 用于保存虚拟或临时修改键,它将不会影响实际修改键。 + +以按下左侧Shift键然后输入ACTION_MODS_KEY(LSHIFT, KC_A)为例, + +在weak_mods时, +* (1) 按下不抬起左Shift: real_mods |= MOD_BIT(LSHIFT) +* (2) 按 ACTION_MODS_KEY(LSHIFT, KC_A): weak_mods |= MOD_BIT(LSHIFT) +* (3) 抬起 ACTION_MODS_KEY(LSHIFT, KC_A): weak_mods &= ~MOD_BIT(LSHIFT) +real_mods 还是保持在修改状态。 + +在没有weak_mods时, +* (1) 按下不抬起左Shift: real_mods |= MOD_BIT(LSHIFT) +* (2) 按 ACTION_MODS_KEY(LSHIFT, KC_A): real_mods |= MOD_BIT(LSHIFT) +* (3) 抬起 ACTION_MODS_KEY(LSHIFT, KC_A): real_mods &= ~MOD_BIT(LSHIFT) +此时real_mods失去‘实际左Shift’的状态。 + +weak_mods和real_mods现已全部加入键盘数据包发送豪华套餐。 +https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57 diff --git a/docs/zh-cn/getting_started_getting_help.md b/docs/zh-cn/getting_started_getting_help.md new file mode 100644 index 00000000000..cf770a77081 --- /dev/null +++ b/docs/zh-cn/getting_started_getting_help.md @@ -0,0 +1,15 @@ +# 获得帮助 + +有很多方法来获得关于QMK的帮助. + +## 实时聊天 + +你可以在我们的主要[Discord服务器](https://discord.gg/Uq7gcHh)找到QMK的开发者和用户。有很多讨论固件的不同频道, 工具箱(Toolbox), 硬件,配置工具(configurator). + +## OLKB Subreddit + +QMK的官方论坛是[/r/olkb](https://reddit.com/r/olkb) 在[reddit.com](https://reddit.com)上. + +## Github的Issue + +你可以在GitHub上 [提出issue](https://github.com/qmk/qmk_firmware/issues).当您的问题需要长期讨论或调试时,这尤其方便。 diff --git a/docs/zh-cn/getting_started_github.md b/docs/zh-cn/getting_started_github.md new file mode 100644 index 00000000000..0400eea6435 --- /dev/null +++ b/docs/zh-cn/getting_started_github.md @@ -0,0 +1,59 @@ +# 如何在QMK中使用Github + +Github can be a little tricky to those that aren't familiar with it - this guide will walk through each step of forking, cloning, and submitting a pull request with QMK. + +?> 本教程假设您已安装GitHub,并且您喜欢使用命令行工作。 + +首先 [Github上的QMK页面](https://github.com/qmk/qmk_firmware), 您能看到右上方有个按钮写着"Fork": + +![从Github上分叉](http://i.imgur.com/8Toomz4.jpg) + +如果你是某组织成员,你将需要选择分叉到哪个账户。一般情况下, 你是想要分叉到你的私人账户下。当你完成分叉 (有时需要等一会), 点击"Clone or Download" 按钮: + +!从Github下载](http://i.imgur.com/N1NYcSz.jpg) + +你要选择 "HTTPS", 然后选择链接复制: + +![HTTPS链接](http://i.imgur.com/eGO0ohO.jpg) + +然后,在命令行输入`git clone `,然后粘贴你的链接: + +``` +user@computer:~$ git clone https://github.com/whoeveryouare/qmk_firmware.git +Cloning into 'qmk_firmware'... +remote: Counting objects: 46625, done. +remote: Compressing objects: 100% (2/2), done. +remote: Total 46625 (delta 0), reused 0 (delta 0), pack-reused 46623 +Receiving objects: 100% (46625/46625), 84.47 MiB | 3.14 MiB/s, done. +Resolving deltas: 100% (29362/29362), done. +Checking out files: 100% (2799/2799), done. +``` + +现在你本地计算机有QMK的分叉了,你可以添加你的布局了, 为你的键盘编译并刷新固件吧。如果你觉得你的修改很不错, 你可以添加,提交,然后想你的分叉推出(pull)你的改变,像这样: + +``` +user@computer:~$ git add . +user@computer:~$ git commit -m "adding my keymap" +[master cccb1608] adding my keymap + 1 file changed, 1 insertion(+) + create mode 100644 keyboards/planck/keymaps/mine/keymap.c +user@computer:~$ git push +Counting objects: 1, done. +Delta compression using up to 4 threads. +Compressing objects: 100% (1/1), done. +Writing objects: 100% (1/1), 1.64 KiB | 0 bytes/s, done. +Total 1 (delta 1), reused 0 (delta 0) +remote: Resolving deltas: 100% (1/1), completed with 1 local objects. +To https://github.com/whoeveryouare/qmk_firmware.git + + 20043e64...7da94ac5 master -> master +``` + +现在你的改动已经在你Github上的分支中了 - 如果你回到这 (`https://github.com/你的GitHub账户名/qmk_firmware`) ,你可以点击下方所示按钮创建 "New Pull Request": + +![新的 Pull Request](http://i.imgur.com/DxMHpJ8.jpg) + +现在你可以看到你所做的一切 - 如果看起来不错, 就可以点击 "Create Pull Request"定稿了: + +![创建Pull Request](http://i.imgur.com/Ojydlaj.jpg) + +提交后,我们会开跟你说你的改动,要求您进行更改, 并最终接受您的更改!感谢您为QMK做的贡献 :) diff --git a/docs/zh-cn/getting_started_introduction.md b/docs/zh-cn/getting_started_introduction.md new file mode 100644 index 00000000000..dcd0b72a564 --- /dev/null +++ b/docs/zh-cn/getting_started_introduction.md @@ -0,0 +1,54 @@ +# 介绍 + +本页解释了使用QMK项目所需的基本信息。它假定您能熟练使用Unix shell,但您不熟悉C语言也不熟悉使用make编译。 + +## 基本QMK结构 + +QMK是[Jun Wako](https://github.com/tmk)的[tmk_keyboard](https://github.com/tmk/tmk_keyboard)工程的一个分叉。经过更改的TMK原始代码放在`tmk` 文件夹中。 QMK增加的新东西可以在 `quantum` 文件夹中找到。 键盘项目可以在 `handwired`(手动飞线) 和 `keyboard`(PCB键盘)这两个文件夹找到。 + +### 用户空间结构 + +在`users`文件夹里面的目录是每个用户的目录。这个文件夹里面放的是用户们在不同键盘都能用到的代码。详见[用户空间特性](feature_userspace.md) + +### 键盘项目结构 + +在`keyboards`文件夹和他的子文件夹`handwired`中就是各个键盘的项目了,比如`qmk_firmware/keyboards/clueboard`。内部结构与如下: + +* `keymaps/`: 可以构建的不同布局 +* `rules.mk`: 用来设置 "make" 命令默认选项的文件。别直接编辑这个文件,你应该使用具体某个布局的 `rules.mk`. +* `config.h`: 用于设置默认编译选项的文件。别直接编辑这个文件, 你应该使用具体某个布局的 `config.h`. + +### 布局结构 + +在各个布局的文件夹,你能找到以下文件。只有 `keymap.c` 是必要的, 如果其他文件找不到就会直接选择默认选项。 + +* `config.h`: 配置布局的选项 +* `keymap.c`: 布局的全部代码, 必要文件 +* `rules.mk`: 使能的QMK特性 +* `readme.md`:介绍你的布局,告诉别人怎么使用,附上功能说明。请将图片上传到imgur等图床(译者注:imgur可能已被墙,为了方便国人访问,建议使用国内可以直接访问的图床)。 + +# `config.h` 文件 + +有三个重要的`config.h` 位置: + +* 键盘 (`/keyboards//config.h`) +* 用户空间 (`/users//config.h`) +* 布局 (`/keyboards//keymaps//config.h`) + +构建系统按照上述顺序自动获取配置文件。如果要覆盖由上一个 `config.h` 所做的设置,您需要首先为要更改的设置包含一些样板代码。 + +``` +#pragma once +``` + +要覆盖上一个 `config.h` 所做的设置,你要先 `#undef` 然后再 `#define` 这个设置. + +样板代码和设置看起来像这样: + +``` +#pragma once + +// 像下面那样覆盖设置(MY_SETTING指的是你要覆盖的设置项)! +#undef MY_SETTING +#define MY_SETTING 4 +``` diff --git a/docs/zh-cn/newbs.md b/docs/zh-cn/newbs.md new file mode 100644 index 00000000000..8c36b0d24b0 --- /dev/null +++ b/docs/zh-cn/newbs.md @@ -0,0 +1,23 @@ +# QMK菜鸟教程 + +QMK是为你机械硬盘设计的的一个强大的开源固件。使用QMK可以很简单的让你的定制键盘变得强大。看完这篇文章,无论你是菜鸟还是大佬,都可以顺利的使用QMK来定制键盘。 + +你是否为不知道你的键盘能不能运行QMK而苦恼? 如果你的机械键盘是你自己做的,那么这把键盘一般可以运行QMK。我们提供了[一大堆自制键盘](http://qmk.fm/keyboards/), 所以即便你的键盘不能运行QMK你也很容易能找到满足你需求的键盘。 + +## 概览 + +这个教程有7个主要部分: + +* [新手上路](newbs_getting_started.md) +* [用命令行构建你的第一个固件](newbs_building_firmware.md) +* [用在线界面构建你的第一个固件](newbs_building_firmware_configurator.md) +* [刷新固件](newbs_flashing.md) +* [测试和调试](newbs_testing_debugging.md) +* [Git最佳实践](newbs_best_practices.md) +* [其他学习资源](newbs_learn_more_resources.md) + +这份教程旨在帮助没有固件构建经验的人,也是根据该目的做出选择和建议。这些程序有很多替代方法,大部分替代我们都支持。如果你对完成一个任务有疑问,可以[向我们寻求帮助](getting_started_getting_help.md). + +## 其他资源 + +* [Thomas Baart的 QMK基础博客](https://thomasbaart.nl/category/mechanical-keyboards/firmware/qmk/qmk-basics/) – 这是一个用户创建的博客,涵盖了为新手准备的使用QMK的基础知识。 diff --git a/docs/zh-cn/newbs_best_practices.md b/docs/zh-cn/newbs_best_practices.md new file mode 100644 index 00000000000..fa58dc75e87 --- /dev/null +++ b/docs/zh-cn/newbs_best_practices.md @@ -0,0 +1,163 @@ +# 最佳实践 + +## 或者说, "我应如何学会不再担心并开始爱上Git。" + +本文档旨在指导新手以最佳方式获得为QMK做出贡献的丝滑体验。我们将介绍为QMK做出贡献的过程,详细介绍使这项任务更容易的一些方法,然后我们将制造一些问题,来教你如何解决它们。 + +本文假设了一些内容: + +1. 一有个GitHub账户, 并[创建qmk_firmware仓库分叉](getting_started_github.md)到你的帐户. +2. 你已经[建立你的构建环境](newbs_getting_started.md?id=environment-setup). + + +## 你分叉的主分支: 一直在上传,但不要提交 + +十分推荐您在QMK开发过程中无论开发是否完成都要保持你的 `master` 分支更新,但是 ***一定不要*** 提交。相反,你应该在一个开发分叉中做出你所有修改并在开发时提交pull request。 + +减少合并冲突的可能性 — 两个或多个用户同时编辑文件的同一部分的实例 — 保持 `master` 分支最新,并创建一个新的分支来开始新的开发。 + +### 更新你的主分支 + +保持你的 `master` 更新, 推荐你添加QMK Firmware仓库作为Git的远程仓库,想这么做的话, 你可以打开你的Git命令行接口然后输入: + +``` +git remote add upstream https://github.com/qmk/qmk_firmware.git +``` + +运行 `git remote -v`, 来确定这个仓库已经添加,以下是回显: + +``` +$ git remote -v +origin https://github.com//qmk_firmware.git (fetch) +origin https://github.com//qmk_firmware.git (push) +upstream https://github.com/qmk/qmk_firmware.git (fetch) +upstream https://github.com/qmk/qmk_firmware.git (push) +``` + +现在添加已完成,你可以用`git fetch upstream`来检查仓库的更新. 这会检索branches 和 tags — 统称为"refs" — 从QMK仓库, 也就是 `upstream`。我们可以比较我们的分叉和QMK的 `origin` 数据的不同。 + +要更新你的分叉的主分支,请运行以下命令,在每行之后按Enter键: + +``` +git checkout master +git fetch upstream +git pull upstream master +git push origin master +``` + +这回切换到你的`master` 分支, 检索你QMK仓库的refs, 下载当前QMK `master` 分支到你的电脑, 并上传到你的分叉. + +### 做改动 + +你可以输入以下命令来创建一个新的分支来做改动: + +``` +git checkout -b dev_branch +git push --set-upstream origin dev_branch +``` + +这回建立一个叫做 `dev_branch`的新分支, 检查一下, 然后想你的分叉保存分支. 使用 `--set-upstream` 参数来告诉git使用你的分叉并且当每次你对你的分支用`git push` 或 `git pull`时要使用`dev_branch`。 它仅需要在第一次push的时候使用;然后你就可以很安全的用 `git push` 或 `git pull`, 并不需要其他参数了。 + +!> 使用 `git push`, 你可以用 `-u` 来代替 `--set-upstream` — `-u`是`--set-upstream`的简写。 + +您可以将您的分支命名为您想要的任何名称,但建议将其命名为与您要进行的更改相关的内容。 + +默认情况下 `git checkout -b` 在已经检出的分支上建立新的分支。您可以将新的分支建立在未检出的现有分支的基础上,方法是将现有分支的名称添加到命令: + +``` +git checkout -b dev_branch master +``` + +现在您已经有了一个开发分支,那么就打开您的文本编辑器并进行您需要做的任何更改。建议对您的分支进行许多小的提交;这样,任何引起问题的更改都可以在需要时更容易地跟踪和撤消。要进行更改,编辑并保存任何需要更新的文件,请将它们添加到Git的 *staging area* ,然后将它们提交到您的分支: + +``` +git add path/to/updated_file +git commit -m "My commit message." +``` + +` git add`添加已更改到Git的*临时区域*也就是Git的“加载区域”的文件。其中包含使用 `git commit` 命令 *提交* 的并已经保存到仓库的更改。建议您使用描述性的提交消息,这样您就可以一目了然地知道更改了什么。 + +!> 如果你修改了很多文件,但所有的文件都是同一个更改的一部分,你可以用 `git add .` 来添加当前目录中所有已更改的文件而不是单独添加每个文件. + +### 发布更改 + +最后一步是将更改推送到您的分叉。 输入 `git push`来推送. 现在Git将`dev_branch`的当前状态发布到您的分叉。 + + +## 解决合并冲突 + +有时,当您在某个分支中的工作需要很长时间才能完成时,其他人所做的更改与您在打开pull request时对该分支所做的更改相冲突。这称为*rebase* 即合并冲突,当多个人编辑同一文件的同一部分时会发生这种情况。 + +### 重新调整您的更改 + +*rebase*是Git的一种方法,它获取在某一点上应用的更改,撤销它们,然后将相同的更改应用到另一点。在合并冲突的情况下,您可以重新设置您的分支以获取在创建分支时和当前时间之间的那段时间所做的更改。 + +运行以下命令来开始: + +``` +git fetch upstream +git rev-list --left-right --count HEAD...upstream/master +``` + + 这里的`git rev-list` 命令返回当前分支和qmk的主分支之间不同的提交数。我们首先运行`git fetch`,以确保我们有代表upstream仓库的refs。 `git rev-list` 命令的回显有两个数字: + +``` +$ git rev-list --left-right --count HEAD...upstream/master +7 35 +``` + +第一个数字表示自创建以来当前分支的提交数, 第二个数字是自创建当前分支以来对 `upstream/master` 进行的提交数, 因此, 当前分支中未记录变动。 + +既然知道当前分支和upstream仓库的当前状态,我们可以开始一个rebase操作: + +``` +git rebase upstream/master +``` + +这就是让Git撤销当前分支上的提交,然后根据QMK的主分支重新应用它们。 + +``` +$ git rebase upstream/master +First, rewinding head to replay your work on top of it... +Applying: Commit #1 +Using index info to reconstruct a base tree... +M conflicting_file_1.txt +Falling back to patching base and 3-way merge... +Auto-merging conflicting_file_1.txt +CONFLICT (content): Merge conflict in conflicting_file_1.txt +error: Failed to merge in the changes. +hint: Use 'git am --show-current-patch' to see the failed patch +Patch failed at 0001 Commit #1 + +Resolve all conflicts manually, mark them as resolved with +"git add/rm ", then run "git rebase --continue". +You can instead skip this commit: run "git rebase --skip". +To abort and get back to the state before "git rebase", run "git rebase --abort". +``` + +这告诉我们有一个合并冲突,并给出带有冲突的文件的名称。在文本编辑器中打开冲突的文件,在该文件的某个位置,您会发现如下内容: + +``` +<<<<<<< HEAD +

For help with any issues, email us at support@webhost.us.

+======= +

Need help? Email support@webhost.us.

+>>>>>>> Commit #1 +``` + + `<<<<<<< HEAD`行标记合并冲突的开始, `>>>>>>> Commit #1` 行标记结束, 冲突选项被 `=======`分隔。`HEAD`那端的部分来自文件的qmk master版本,标记有commit消息的部分来自当前的分支持和提交。 + +因为Git跟踪 *对文件的更改* 而不是直接跟踪文件的内容,所以如果Git在提交之前找不到文件中的文本,它将不知道如何编辑该文件。重新编辑文件将解决冲突。进行更改,然后保存文件。 + +``` +

Need help? Email support@webhost.us.

+``` + +现在运行: + +``` +git add conflicting_file_1.txt +git rebase --continue +``` + +Git记录对冲突文件的更改,并继续应用来自我们的分支的提交,直到它到达末尾。 diff --git a/docs/zh-cn/newbs_building_firmware.md b/docs/zh-cn/newbs_building_firmware.md new file mode 100644 index 00000000000..31093f2543b --- /dev/null +++ b/docs/zh-cn/newbs_building_firmware.md @@ -0,0 +1,81 @@ +# 构建第一个固件 + +现在您已经建立了构建环境,就可以开始构建自定义固件了。对于本指南的这一部分,我们将在3个程序之间切换——文件管理器、文本编辑器和终端窗口。请保持所有3个程序打开,直到您完成并对键盘固件满意。 + +如果您在按照指南第一部分的操作之后关闭并重新打开了终端窗口,请不要忘记输入“cd qmk_firmware”,来使您的终端位于正确的目录。 + +## 导航到您的keymaps文件夹 + +首先导航到键盘的 `keymaps` 文件夹. + +?> 如果您使用的是MacOS或Windows,可以使用以下命令轻松地打开keymaps文件夹。 + +?> macOS: + + open keyboards//keymaps + +?> Windows: + + start .\\keyboards\\\\keymaps + +## 创建`default` 布局副本 + +打开`keymaps`文件夹后,您将需要创建`default`文件夹的副本。我们强烈建议您将文件夹命名为与Github用户名相同的名称,但您也可以使用任何您想使用的名称,只要它只包含小写字母、数字和下划线字符。 + +要自动执行此过程,您还可以选择运行`new_keymap.sh`脚本。 + +导航到`qmk_firmware/util` 目录然后输入以下命令: + +``` +./new_keymap.sh +``` + +例如,一个名字叫ymzcdg的用户要创建1up60hse的布局,他需要输入 + +``` +./new_keymap.sh 1upkeyboards/1up60hse ymzcdg +``` + +## 在你最钟爱的文本编辑器中打开`keymap.c` + +打开你的`keymap.c`. 在这个文件中,您可以找到控制键盘行为的结构。 在你的`keymap.c` 的顶部有一些让布局更易读的define和enum。在靠下的位置你会找到一行和下面这句很像的: + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +从这一行开始便是层列表。这行下面你会看到包括 `LAYOUT` 或 `KEYMAP`这两个词的几行, 从这些行开始就是层。在这一行下面是组成该特定层的键的列表。 + +!> 编辑您的keymap文件时,注意不要添加或删除任何逗号。如果这样做,您将阻止您的固件编译,并且您可能不容易找出多余的或缺少的逗号在哪里。 + +## 根据您的喜好自定义布局 + +如何完成这一步骤完全取决于您。改变一直困扰着你的问题,或者完全重做所有的事情。如果您不需要全部图层,可以删除图层,或者将图层总数增加到32个。查看以下文档,了解可以在此处定义的内容: + +* [键码](keycodes.md) +* [特性](features.md) +* [问题与解答](faq.md) + +?> 当你明白布局是怎么工作时,您也要让每次改变尽可能小。一次改变很大在调试时找出问题会十分困难。 + +## 构建你的固件 + +完成对布局的更改后,您就要构建固件了。为此,请返回终端窗口并运行build命令: + + make : + +例如,如果您的keymap名为“xyverz”,并且您正在为rev5 planck构建一个keymap,那么您将使用此命令: + + make planck/rev5:xyverz + +在编译过程中,你将看到屏幕上有很多输出,通知您正在编译哪些文件他应该以与下文类似的输出结束: + +``` +Linking: .build/planck_rev5_xyverz.elf [OK] +Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK] +Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK] +Checking file size of planck_rev5_xyverz.hex [OK] + * File size is fine - 18392/28672 +``` + +## 刷新你的固件 + +请移步 [Flashing Firmware](newbs_flashing.md) 来继续。 diff --git a/docs/zh-cn/newbs_flashing.md b/docs/zh-cn/newbs_flashing.md new file mode 100644 index 00000000000..05a9eb55eef --- /dev/null +++ b/docs/zh-cn/newbs_flashing.md @@ -0,0 +1,307 @@ +# 刷新你的键盘 + +现在您已经构建了一个自定义固件文件,那么您就需要刷新键盘了。 + +## 用QMK工具箱刷新键盘 + +刷新键盘的最简单方法是使用[QMK 工具箱](https://github.com/qmk/qmk_toolbox/releases). + +但是,QMK工具箱目前仅适用于Windows和MacOS。如果您使用的是Linux(或者只是希望从命令行刷新固件),则必须使用 [方法概述](newbs_flashing.md#flash-your-keyboard-from-the-command-line). + +### 将文件加载到QMK工具箱中 + +首先打开QMK工具箱应用程序。您将要在访达或资源管理器中找到固件文件。您的键盘固件可能是两种格式之一`.hex`或`.bin`。qmk会尝试将键盘的相应文件复制到“qmk_firmware”根目录中。 + +?> 如果您在Windows或MacOS上,可以使用以下命令轻松地在资源管理器或访达中打开当前固件文件夹。 + +?> Windows: + + start . + +?> macOS: + + open . + +固件文件始终遵循此命名格式: + + _.{bin,hex} + +例如,使用 `default` 布局的 `plank/rev5` 将使用以下名字: + + planck_rev5_default.hex + +找到固件文件后,将其拖到QMK工具箱中的“Local file”框中,或单击“Open”并导航到固件文件的存储位置。 + +### 将键盘置于DFU(Bootloader)模式 + +要刷新自定义固件,您必须将键盘置于特殊的刷新模式。在此模式下,您将无法键入或使用键盘。在写入固件时,不要拔下键盘插头或以其他方式中断刷新过程,这一点非常重要。 + +不同的键盘有不同的方式进入这种特殊模式。如果您的键盘当前运行的是QMK或TMK,而您没有得到特定的指示,请按顺序尝试以下操作: + +* 按住两个shift键并按 `Pause` +* 按住两个shift键并按 `B` +* 拔下键盘插头, 同时按住空格键和 `B` , 插上键盘然后等一会再放开按键 +* 按下PCB底部的 `RESET` 物理键 +* 找到PCB上标记有 `BOOT0` 或 `RESET`的金属点, 在插入PCB的同时短接它们 + +成功后,您将在QMK工具箱中看到类似以下内容的消息: + +``` +*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390 +*** DFU device connected +``` + +### 刷新你的键盘 + +单击QMK工具箱中的 `Flash` 按钮。您将看到类似以下内容的输出: + +``` +*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390 +*** DFU device connected +*** Attempting to flash, please don't remove device +>>> dfu-programmer atmega32u4 erase --force + Erasing flash... Success + Checking memory from 0x0 to 0x6FFF... Empty. +>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex + Checking memory from 0x0 to 0x55FF... Empty. + 0% 100% Programming 0x5600 bytes... + [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success + 0% 100% Reading 0x7000 bytes... + [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success + Validating... Success + 0x5600 bytes written into 0x7000 bytes memory (76.79%). +>>> dfu-programmer atmega32u4 reset + +*** DFU device disconnected +*** Clueboard - Clueboard 66% HotSwap connected -- 0xC1ED:0x2390 +``` + +## 使用命令行刷新键盘 + +首先,您需要知道您的键盘使用的是哪个bootloader。通常是以下四个常见的bootloader。Pro-Micro 和 clones 使用 CATERINA, Teensy 使用 Halfkay, OLKB 键盘使用 QMK-DFU, 其他的atmega32u4芯片使用DFU。 + +您可以在以下文章中了解更多关于bootloader[刷新指令和Bootloader信息](flashing.md)。 + +如果您知道正在使用的bootloader是哪种,那么在编译固件时,可以向“make”命令里添加一些额外参数,以自动执行刷新过程。 + +### DFU + +对于DFU引导加载程序,当您准备好编译和刷新固件时,打开终端窗口并运行构建命令: + + make ::dfu + +例如,如果您的布局名为“xyverz”,并且您正在为rev5 planck构建一个布局,那么您可以使用此命令: + + make planck/rev5:xyverz:dfu + +编译完成后,应输出以下内容: + +``` +Linking: .build/planck_rev5_xyverz.elf [OK] +Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK] +Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK] +Checking file size of planck_rev5_xyverz.hex + * File size is fine - 18574/28672 + ``` + +到了这个时候, 构建脚本将每隔5秒查找一次DFU。它将重复以下操作,直到找到设备或将其取消。 + + dfu-programmer: no device present. + Error: Bootloader not found. Trying again in 5s. + +一旦出现以上回显,您将需要重置控制器。然后,它应该显示与以下类似的输出: + +``` +*** Attempting to flash, please don't remove device +>>> dfu-programmer atmega32u4 erase --force + Erasing flash... Success + Checking memory from 0x0 to 0x6FFF... Empty. +>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex + Checking memory from 0x0 to 0x55FF... Empty. + 0% 100% Programming 0x5600 bytes... + [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success + 0% 100% Reading 0x7000 bytes... + [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success + Validating... Success + 0x5600 bytes written into 0x7000 bytes memory (76.79%). +>>> dfu-programmer atmega32u4 reset +``` + +如果您对此有任何问题,您可能需要这样做: + + sudo make ::dfu + +#### DFU命令 + +有许多DFU命令可用于将固件下载到DFU设备: + +* `:dfu` - 这是正常选项,等待DFU设备可用,然后刷新固件。这将每隔5秒检查一次,以查看是否出现了DFU设备。 +* `:dfu-ee` - 这将刷新一个`eep`文件,而不是普通的十六进制文件。这很不常见。 +* `:dfu-split-left` - 这将刷新正常固件,就像默认选项 (`:dfu`)一样. 但是,这也会刷新“左侧”EEPROM文件,用于分割键盘。 _这是基于Elite C的键盘的推荐选择。_ +* `:dfu-split-right` - 这将刷新正常固件,就像默认选项(`:dfu`). 但是,这也会刷新“右侧”EEPROM文件,用于分割键盘。 _这是基于Elite C的键盘的推荐选择。_ + + +### Caterina + +对于Arduino板以及其克隆版来说(比如SparkFun和ProMicro), 准备好编译和刷新固件后,打开终端窗口并运行构建命令: + + make ::avrdude + +比如, 你的布局叫"xyverz"你要创建一个rev2 Lets Split的布局,你要用以下命令: + + make lets_split/rev2:xyverz:avrdude + +固件完成编译后,它将输出类似以下的内容: + +``` +Linking: .build/lets_split_rev2_xyverz.elf [OK] +Creating load file for flashing: .build/lets_split_rev2_xyverz.hex [OK] +Checking file size of lets_split_rev2_xyverz.hex [OK] + * File size is fine - 27938/28672 +Detecting USB port, reset your controller now.............. +``` + +此时,复位,然后脚本将检测bootloader,然后刷新固件。输出应该像这样: + +``` +Detected controller on USB port at /dev/ttyS15 + +Connecting to programmer: . +Found programmer: Id = "CATERIN"; type = S + Software Version = 1.0; No Hardware Version given. +Programmer supports auto addr increment. +Programmer supports buffered memory access with buffersize=128 bytes. + +Programmer supports the following devices: + Device code: 0x44 + +avrdude.exe: AVR device initialized and ready to accept instructions + +Reading | ################################################## | 100% 0.00s + +avrdude.exe: Device signature = 0x1e9587 (probably m32u4) +avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed + To disable this feature, specify the -D option. +avrdude.exe: erasing chip +avrdude.exe: reading input file "./.build/lets_split_rev2_xyverz.hex" +avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex +avrdude.exe: writing flash (27938 bytes): + +Writing | ################################################## | 100% 2.40s + +avrdude.exe: 27938 bytes of flash written +avrdude.exe: verifying flash memory against ./.build/lets_split_rev2_xyverz.hex: +avrdude.exe: load data flash data from input file ./.build/lets_split_rev2_xyverz.hex: +avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex +avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex contains 27938 bytes +avrdude.exe: reading on-chip flash data: + +Reading | ################################################## | 100% 0.43s + +avrdude.exe: verifying ... +avrdude.exe: 27938 bytes of flash verified + +avrdude.exe: safemode: Fuses OK (E:CB, H:D8, L:FF) + +avrdude.exe done. Thank you. +``` +如果您对此有任何问题,您可能需要这样做: + + sudo make ::avrdude + + +此外,如果要刷新多个板,请使用以下命令: + + make ::avrdude-loop + +当你完成了刷新后,你需要按下ctrl+c或者其他正确的按键来让你的操作系统终止循环。 + + +## HalfKay + +对于PJRC设备(Teensy),当您准备好编译和刷新固件时,打开终端窗口并运行构建命令: + + make ::teensy + +比如, 如果你的布局叫做"xyverz"你想创建Ergodox or Ergodox EZ的布局,你要使用以下命令: + + make erdogox_ez:xyverz:teensy + +固件完成编译后,它将输出如下内容: + +``` +Linking: .build/ergodox_ez_xyverz.elf [OK] +Creating load file for flashing: .build/ergodox_ez_xyverz.hex [OK] +Checking file size of ergodox_ez_xyverz.hex [OK] + * File size is fine - 25584/32256 + Teensy Loader, Command Line, Version 2.1 +Read "./.build/ergodox_ez_xyverz.hex": 25584 bytes, 79.3% usage +Waiting for Teensy device... + (hint: press the reset button) + ``` + +此时,复位键盘。完成后,您将看到如下输出: + + ``` + Found HalfKay Bootloader +Read "./.build/ergodox_ez_xyverz.hex": 28532 bytes, 88.5% usage +Programming............................................................................................................................................................................ +................................................... +Booting +``` + +## STM32 (ARM) + +对于大多数ARM板(包括Proton C、Planck Rev 6和Preonic Rev 3),当您准备好编译和刷新固件时,打开终端窗口并运行构建命令: + + make ::dfu-util + +例如,如果您的keymap被命名为“xyverz”,并且您正在为Planck Revision 6键盘构建一个布局,那么您需要使用以下命令,然后将键盘重新启动到bootloader(在完成编译之前): + + make planck/rev6:xyverz:dfu-util + +固件完成编译后,它将输出如下内容: + +``` +Linking: .build/planck_rev6_xyverz.elf [OK] +Creating binary load file for flashing: .build/planck_rev6_xyverz.bin [OK] +Creating load file for flashing: .build/planck_rev6_xyverz.hex [OK] + +Size after: + text data bss dec hex filename + 0 41820 0 41820 a35c .build/planck_rev6_xyverz.hex + +Copying planck_rev6_xyverz.bin to qmk_firmware folder [OK] +dfu-util 0.9 + +Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. +Copyright 2010-2016 Tormod Volden and Stefan Schmidt +This program is Free Software and has ABSOLUTELY NO WARRANTY +Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ + +Invalid DFU suffix signature +A valid DFU suffix will be required in a future dfu-util release!!! +Opening DFU capable USB device... +ID 0483:df11 +Run-time device DFU version 011a +Claiming USB DFU Interface... +Setting Alternate Setting #0 ... +Determining device status: state = dfuERROR, status = 10 +dfuERROR, clearing status +Determining device status: state = dfuIDLE, status = 0 +dfuIDLE, continuing +DFU mode device DFU version 011a +Device returned transfer size 2048 +DfuSe interface name: "Internal Flash " +Downloading to address = 0x08000000, size = 41824 +Download [=========================] 100% 41824 bytes +Download done. +File downloaded successfully +Transitioning to dfuMANIFEST state +``` + +## 试一试吧! + +恭喜您! 您的自定义固件已经刷写到您的键盘 + +试一试,确保一切按你想的方式进行。我们写了[测试和调试](newbs_testing_debugging.md)来完善新手引导。 因此,请前往那里了解如何排除自定义功能的故障。 diff --git a/docs/zh-cn/newbs_getting_started.md b/docs/zh-cn/newbs_getting_started.md new file mode 100644 index 00000000000..4e7850201d1 --- /dev/null +++ b/docs/zh-cn/newbs_getting_started.md @@ -0,0 +1,102 @@ +# 介绍 + +你的电脑键盘里面包含一个处理器, 这个处理器和你电脑里面的不太一样。这个处理器负责运行一些特殊的软件,这些软件可以监测按钮按下并将按钮处于按下还是释放状态的数据发送出去。QMK就是这样一种软件,即监测按钮被按下并发送这样的信息到作为主机的计算机上。当你创建了你的布局, 你也就创建了你的键盘运行的的可执行程序。 + +QMK试图通过使简单的事情变得更简单,使使不可能成为可能来把大量的权力交给你。你不需要懂如何通过程序创建强大的布局——你只需要遵循简单的语法规则。 + +# 新手上路 + +在你能创建布局前,你要安装一些软件来建立你的开发环境。无论你想编译多少固件,这个操作都只需要进行一次。 + +如果您更喜欢图形化界面, 请考虑使用在线工具[QMK配置器](https://config.qmk.fm)。 请参考 [使用在线GUI构建您的第一个固件](newbs_building_firmware_configurator.md)。 + + +## 下载软件 + +### 文本编辑器 + +你需要一个可以编辑 **纯文本** 文件的程序。在Windows上你可以用Notepad, 在Linux上使用gedit,这两个都是简单又实用的文本编辑工具。 在macOS上, 请小心使用 “文本编辑” 这个默认软件: 如果你不明确的选择_格式_菜单中的 _制作纯文本_ 的话文本将不会被保存为纯文本。 + +你也可以下载并安装一个专用编辑器 [Sublime Text](https://www.sublimetext.com/) 或 [VS Code](https://code.visualstudio.com/)。 这大概是跨平台的最好方法了, 这些编辑器是专门为了编辑代码设计的。 + +?>搞不清用哪种编辑器? Laurence Bradford 写了篇关于编辑器选择的文章 [a great introduction](https://learntocodewith.me/programming/basics/text-editors/)。 + +### QMK 工具箱 + +QMK 工具箱 是一种可选的Windows和macOS下的图形化工具,它可以对你的定制键盘进行编程和调试。你可能会发现它就是你能简单的刷新你的键盘固件并查看调试信息的稀世珍宝。 + +[在这里下载最新发布版本](https://github.com/qmk/qmk_toolbox/releases/latest) + +* Windows用户: `qmk_toolbox.exe` (绿色版) 或 `qmk_toolbox_install.exe` (安装版) +* macOS用户: `QMK.Toolbox.app.zip` (绿色版) or `QMK.Toolbox.pkg` (安装版) + +## 建立你的环境 + +我们为了使QMK环境变得更容易建立已竭尽所能。你只需要准备Linux 或 Unix 环境, 然后让QMK安装剩余部分。 + +?> 如果你从未使用过Linux/Unix的命令行,有一些你需要学习的基础概念和命令,以下资料将教会您使用QMK环境的必要能力:
+[必会Linux命令](https://www.guru99.com/must-know-linux-commands.html)
+[一些基本的Unix命令](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html) + +### Windows + +你需要安装MSYS2和Git. + +* 按照以下安装说明进行操作[MSYS2 主页](http://www.msys2.org)。 +* 关闭所有打开的MSYS2终端并打开新的MSYS2 MinGW 64-bit终端。 +* 使用以下命令安装Git: `pacman -S git`。 + +### macOS + +你需要安装Homebrew。按照以下说明进行操作 [Homebrew 主页](https://brew.sh)。 + +在Homebrew安装完成后, 继续 _同步QMK工程_. 这一步你将会通过运行一个脚本安装其他包。 + +### Linux + +你将需要安装Git.你很有可能已经安装,但若你尚未安装,可以使用以下命令进行安装: + +* Debian / Ubuntu / Devuan: `apt-get install git` +* Fedora / Red Hat / CentOS: `yum install git` +* Arch: `pacman -S git` + +?> 无论你使用哪种平台,Docker都可以是你的选择[点这里进一步了解](getting_started_build_tools.md#docker) + +## 同步QMK工程 + +当你建立Linux/Unix环境后,你就已经可以下载QMK了.下载时我们可以用Git来 "clone" QMK仓库. 打开一个终端或MSYS2 MinGW 窗口,在阅读剩余的指南时请保持窗口打开。在窗口里面运行以下两句命令: + +```shell +git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git +cd qmk_firmware +``` + +?> 如果您已经知道[如何使用GitHub](getting_started_github.md), 我们推荐您创建您自己的分支并克隆。 如果您不知道这是什么, 您完全可以忽略这句无关紧要的话。 + +QMK附带一个脚本,可帮助您设置剩余的所需内容.您可以通过输入此命令来运行它: + + util/qmk_install.sh + +## 测试你的开发环境 + +现在你的QMK环境已经建立完毕, 你可以为你的键盘创建固件了。开始试着创建键盘的默认固件吧。 你需要使用以下格式的命令创建固件: + + make :default + +比如, 制作一个Clueboard 66%的固件,需要用: + + make clueboard/66/rev3:default + +当完成后你要看到一些回显,尾部如下: + +``` +Linking: .build/clueboard_66_rev3_default.elf [OK] +Creating load file for flashing: .build/clueboard_66_rev3_default.hex [OK] +Copying clueboard_66_rev3_default.hex to qmk_firmware folder [OK] +Checking file size of clueboard_66_rev3_default.hex [OK] + * The firmware size is fine - 26356/28672 (2316 bytes free) +``` + +# 创建你的布局 + +现在你可以创建属于你自己的布局了! 请移步 [构建你的第一个固件](newbs_building_firmware.md)来继续。 diff --git a/docs/zh-cn/newbs_learn_more_resources.md b/docs/zh-cn/newbs_learn_more_resources.md new file mode 100644 index 00000000000..ccb4fa326c4 --- /dev/null +++ b/docs/zh-cn/newbs_learn_more_resources.md @@ -0,0 +1,15 @@ +# 学习资源 + +这些资源旨在让QMK社区的新成员更了解新成员文档中提供的信息。 + +Git 资源: + +* [很好的通用教程](https://www.codecademy.com/learn/learn-git) +* [从例子中学习Git游戏](https://learngitbranching.js.org/) +* [了解有关GitHub的更多信息的Git资源](getting_started_github.md) +* [专门针对QMK的Git资源](contributing.md) + + +命令行资源: + +* [超棒的命令行通用教程](https://www.codecademy.com/learn/learn-the-command-line) diff --git a/docs/zh-cn/newbs_testing_debugging.md b/docs/zh-cn/newbs_testing_debugging.md new file mode 100644 index 00000000000..824f94b906f --- /dev/null +++ b/docs/zh-cn/newbs_testing_debugging.md @@ -0,0 +1,43 @@ +# 测试和调试 + +使用自定义固件刷新键盘后,您就可以测试它了。如果您幸运,一切都会完美运行,但如果没有,这份文件将帮助您找出问题所在。 + +## 测试 + +测试键盘通常非常简单。按下每一个键并确保它发送的是您期望的键。甚至有一些程序可以帮助您确保没有任何键失效。 + +注意:这些程序不是由QMK提供或认可的。 + +* [Switch Hitter](https://elitekeyboards.com/switchhitter.php) (仅Windows) +* [Keyboard Viewer](https://www.imore.com/how-use-keyboard-viewer-your-mac) (仅Mac) +* [Keyboard Tester](http://www.keyboardtester.com) (网页版) +* [Keyboard Checker](http://keyboardchecker.com) (网页版) + +## 使用QMK工具箱进行调试 + +[QMK工具箱](https://github.com/qmk/qmk_toolbox) 将会在你的`rules.mk`中有`CONSOLE_ENABLE = yes`的时候显示你键盘发来的消息。 默认情况下,输出极为有限,不过您可以打开调试模式来增加输出信息量。使用你键盘布局中的`DEBUG`键码,使用 [命令](feature_command.md) 特性来使能调试模式, 或者向你的布局中添加以下代码。 + +```c +void keyboard_post_init_user(void) { + // Customise these values to desired behaviour + debug_enable=true; + debug_matrix=true; + //debug_keyboard=true; + //debug_mouse=true; +} +``` + + + +## 发送您自己的调试消息 + +有时用[custom code](custom_quantum_functions.md)发送自定义调试信息很有用. 这么做很简单. 首先在你文件头部包含`print.h`: + + #include + +之后,您可以使用一些不同的打印功能: + +* `print("string")`: 打印简单字符串. +* `uprintf("%s string", var)`: 打印格式化字符串 +* `dprint("string")`: 仅在调试模式使能时打印简单字符串 +* `dprintf("%s string", var)`: 仅在调试模式使能时打印格式化字符串 diff --git a/docs/zh-cn/reference_glossary.md b/docs/zh-cn/reference_glossary.md new file mode 100644 index 00000000000..7b9adcc2a7c --- /dev/null +++ b/docs/zh-cn/reference_glossary.md @@ -0,0 +1,170 @@ +# QMK术语表 + +## ARM +多家公司生产的32位单片机系列,例如Atmel, Cypress, Kinetis, NXP, ST, 和 TI等公司。 + +## AVR +[Atmel](http://www.microchip.com/)公司的单片机系列。 AVR是TMK的初始支持平台。 + +## AZERTY +Français (法国)标准键盘布局。用键盘的前六个字母命名。 + +## Backlight(背光) +键盘上照明的通称。背光通常是一组LED灯,通过键帽或者按轴发光,但也不总是这样。 + +## Bluetooth(蓝牙) +一种短距离点对点无线协议。许多多无线键盘使用此协议。 + +## Bootloader(引导加载程序) +一种写到你单片机的保护区的特殊的程序,该程序可以使单片机升级自己的固件,通常是通过USB来升级。 + +## Bootmagic(热改键) +允许各种键盘行为动态变化的功能,如交换或禁用常用键。 + +## C +一种适用于系统代码的低级编程语言。大多数qmk代码是用C编写的。 + +## Colemak +一种流行的键盘布局。 + +## Compile(编译) +把人可读的代码转换成你的单片机可以运行的机器代码的过程。 + +## Dvorak +一个由August Dvorak博士在20世纪30年代创建的布局。Dvorak简化键盘(Dvorak Simplified Keyboard)的缩写。 + +## Dynamic Macro(动态宏) +一种记录在键盘上的宏,当键盘拔出或计算机重新启动时,宏将丢失。 + +* [动态宏文档](feature_dynamic_macros.md) + +## Eclipse +是一种受C语言开发者追捧的集成开发环境(IDE)。 + +* [Eclipse安装说明](eclipse.md) + +## Firmware(固件) +用来控制单片机的软件。 + +## FLIP +爱特梅尔(Atmel)提供的AVR器件刷写软件。我们一般推荐 [QMK刷写工具](https://github.com/qmk/qmk_flasher),但是对于一些高级用例,需要FLIP。 + +## git +命令行版本控制软件 + +## GitHub +负责大多数QMK项目的网站。它是Git、问题跟踪和其他帮助我们运行qmk的功能的集成平台。 + +## ISP(在系统编程) +在系统编程(In-system programming), 使用外部硬件和JTAG管脚对AVR芯片进行编程的一种方法。 + +## hid_listen +从键盘接收调试消息的接口。 您可以使用[QMK Flasher](https://github.com/qmk/qmk_flasher)或[PJRC's hid_listen](https://www.pjrc.com/teensy/hid_listen.html)查看这些消息 + +## Keycode(键码) +表示特定键的2字节数据。`0x00`-`0xFF`用于[基本键码](keycodes_basic.md)而`0x100`-`0xFFFF`用于[量子键码](quantum_keycodes.md). + +## Key Down +一个键按下尚未抬起时触发的事件。 + +## Key Up +一个键抬起时触发的事件。 + +## Keymap(键映射) +映射到物理键盘布局的一组键码,在按键和按键释放时进行处理。有时翻译为布局,意为软件上表示的布局,即映射。 + +## Layer(层) +为了让一个键实现多个功能的抽象结构。最高活动层有限。 + +## Leader Key(前导键、设置菜单键) +本功能允许您点击前导键,然后按顺序按1-3个键子来激活按键或其他量子功能。 + +* [前导键文档](feature_leader_key.md) + +## LED +发光二极管,键盘上最常用的指示灯装置。 + +## Make +用于编译所有源文件的软件包。可以使用`make`命令和其他参数来编译你的固件。 + +## Matrix(矩阵) +一种由列和行组成的接线模式,使单片机能够用较少的引脚检测按键。矩阵通常包含二极管,以达到全键无冲。 + +## Macro(宏) +本功能可以在敲击单个键后发送多个按键事件(hid报告)。 + +* [宏文档](feature_macros.md) + +## MCU(单片机、微控制单元) +微控制单元,键盘的处理器。 + +## Modifier(修改键、修饰键、功能键) +按住该键将会改变其他键的功能,修饰键包括 Ctrl, Alt, 和 Shift。 + +## Mousekeys(鼠标键) +本功能在您敲击键盘时会控制鼠标光标。 + +* [鼠标键文档](feature_mouse_keys.md) + +## N-Key Rollover (NKRO、全键无冲) +一种术语,适用于能够同时报告任意数量按键的键盘。 + +## Oneshot Modifier(粘滞键) +一种能让你的功能键一直保持按下,直到你按下其他键的功能。它叫做粘滞键或叫做粘连键,该功能由软件实现而非机械结构。 + +## ProMicro +一种低成本AVR开发板。这种板子很容易在购物网站找到(价格不到20RMB),但是据说刷写pro micro有点令人抓狂。 + +## Pull Request(拉请求、PR) +向QMK请求提交代码。我们鼓励所有用户提交你们自己的键盘的代码。 + +## QWERTY +标准英文键盘,通常也用于其他语言,例如中文。是用键盘前6个字母命名的。 + +## QWERTZ +标准Deutsche(德语)键盘布局。使用前6个字母明名。 + +## Rollover(允许翻转、无冲形式) +该术语表示在一个键已按下时按下另一个键。形式包括2KRO(双键无冲),6KRO(6键无冲),和NKRO(全键无冲),无冲表示可同时按下而不产生冲突的键的数量。 + +## Scancode(扫描码) +HID报告中的一个1字节的数字,表示一个键子。这些数字在下列文档中[HID Usage Tables](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf)该文档发布于[USB-IF](http://www.usb.org/)。 + +## Space Cadet键盘的shift键 +一种特使的shift设置,能让你通过敲击左或右shift一次或多次键入不同的括号。 + +* [Space Cadet键盘文档](feature_space_cadet.md) + +## Tap(敲击、单击) +按下并释放一个键。在某些情况下您需要区分键按下和键抬起,但是单击把两个事件都包括了。 + +## Tap Dance(多击键) +本功能允许向同一个键子分配多个键码,并根据按键次数区分。 + +* [多击键文档](feature_tap_dance.md) + +## Teensy +一种低成本AVR开发板,通常用于手工连线键盘。这个teensy是有点小贵但是halfkay bootloader会让它刷写十分简单,所以也很常用。 + +## Underlight(背光) +用于照亮电路板底面的LED的总称。这些LED通常从印刷电路板的底部向键盘所在的表面发光。 + +## Unicode +在较大的计算机世界中,Unicode是一组编码方案,用于表示任何语言中的字符。 与qmk相关的是,它意味着使用各种操作系统方案来发送Unicode代码点,而不是扫描码。 + +* [Unicode文档](feature_unicode.md) + +## Unit Testing(单元测试) +针对qmk的自动运行测试框架。单元测试帮助我们确信我们的更改不会破坏任何东西。 + +* [单元测试文档](unit_testing.md) + +## USB +通用串行总线,键盘最常见的有线接口。 + +## USB 主机 (或简易主机) +USB诸暨市你的电脑,或者你的键盘所插的任何设备。 + +# 并没有找到你想找到的术语? + +[建立一个issue](https://github.com/qmk/qmk_firmware/issues) ,想好你的问题,或许你所问的术语就会添加到这里。创建一个PR帮我们添加需要添加的术语当然坠吼了:) diff --git a/docs/zh/README.md b/docs/zh/README.md new file mode 100644 index 00000000000..bb9d1371f1e --- /dev/null +++ b/docs/zh/README.md @@ -0,0 +1,32 @@ +# QMK鍵盤固件 + +[![當前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) +[![築邦](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) +[![不和諧](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh) +[![文檔狀態](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm) +[![GitHub的貢獻者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) +[![GitHub的叉](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) + +## 什麼是QMK固件? + +QMK是一個由社群維護的開源鍵盤韌體,其中包含了QMK Toolbox、qmk.fm和其它文件。QMK韌體是以[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)為基礎,讓一些有用的功能在Atmel AVR控制器實現,使用於[OLKB](https://olkb.com)、[ergodox EZ](http://www.ergodox-ez.com),和[Clueboard](http://clueboard.co/)的產品中。它也被移植到使用ChibiOS的ARM晶片上。你也可以用它來讓你徒手佈線,或是客製的鍵盤PCB發揮功能。 + +## 如何得到QMK + +如果你打算貢獻鍵盤佈局,鍵盤或功能QMK,最容易做的事情是[叉通過Github上爬行](https://github.com/qmk/qmk_firmware#fork-destination-box),和克隆你爬在本地進行更改,推動他們,然後打開從你的叉子[拉請求](https://github.com/qmk/qmk_firmware/pulls)。 + +否則,您可以直接下載([拉鍊](https://github.com/qmk/qmk_firmware/zipball/master) [焦油](https://github.com/qmk/qmk_firmware/tarball/master)),或者通過GIT中克隆它(`git@github.com:qmk/qmk_firmware.git`)或HTTP(`https://github.com/qmk/qmk_firmware.git`)。 + +## 如何編譯 + +你可以編譯之前,你需要[安裝環境](getting_started_build_tools.md)用於AVR或/和ARM開發。一旦完成,你會使用`make`命令建立一個鍵盤並用以下符號鍵盤佈局 + + make planck/rev4:default + +這將建立`rev4` `planck`的修訂與`default`鍵盤映射。並非所有鍵盤有一個修訂版(也稱為子項目或文件夾),在這種情況下,它可以被省略: + + make preonic:default + +## 如何赶近 + +QMK有很多[特點](features.md)探索和很好的協議[參考文獻](http://docs.qmk.fm)挖通的。大部分功能通過修改[鍵盤映射(keymap.md),並改變[鍵碼](keycodes.md)冤大頭。 diff --git a/docs/zh/_summary.md b/docs/zh/_summary.md new file mode 100644 index 00000000000..c1676129296 --- /dev/null +++ b/docs/zh/_summary.md @@ -0,0 +1,99 @@ +* [完全指南菜鳥](zh/newbs.md) + * [入門](zh/newbs_getting_started.md) + * [構建第一個固件](zh/newbs_building_firmware.md) + * [刷新固件](zh/newbs_flashing.md) + * [測試和調試](zh/newbs_testing_debugging.md) + * [最佳實踐](zh/newbs_best_practices.md) + * [學習資源](zh/newbs_learn_more_resources.md) + +* [QMK基礎](zh/README.md) + * [QMK簡介](zh/getting_started_introduction.md) + * [特約QMK](zh/contributing.md) + * [如何使用Github上](zh/getting_started_github.md) + * [獲得幫助](zh/getting_started_getting_help.md) + +* [常問問題](zh/faq.md) + * [常問問題](zh/faq_general.md) + * [構建/編譯QMK](zh/faq_build.md) + * [調試/故障排除QMK](zh/faq_debug.md) + * [鍵盤佈局](zh/faq_keymap.md) + +* 詳細指南 + * [安裝編譯工具](zh/getting_started_build_tools.md) + * [流浪漢指南](zh/getting_started_vagrant.md) + * [構建/編譯器指令](zh/getting_started_make_guide.md) + * [刷新固件](zh/flashing.md) + * [定制功能](zh/custom_quantum_functions.md) + * [鍵盤映射概述](zh/keymap.md) + +* [硬件](zh/hardware.md) + * [AVR處理器](zh/hardware_avr.md) + * [司機](zh/hardware_drivers.md) + +* 參考 + * [Keyboard Guidelines](zh/hardware_keyboard_guidelines.md) + * [Config Options](zh/config_options.md) + * [Keycodes](zh/keycodes.md) + * [Documentation Best Practices](zh/documentation_best_practices.md) + * [Documentation Templates](zh/documentation_templates.md) + * [Glossary](zh/reference_glossary.md) + * [Unit Testing](zh/unit_testing.md) + * [Useful Functions](zh/ref_functions.md) + * [Configurator Support](zh/reference_configurator_support.md) + +* [特點](zh/features.md) + * [Basic Keycodes](zh/keycodes_basic.md) + * [Quantum Keycodes](zh/quantum_keycodes.md) + * [Advanced Keycodes](zh/feature_advanced_keycodes.md) + * [Audio](zh/feature_audio.md) + * [Auto Shift](zh/feature_auto_shift.md) + * [Backlight](zh/feature_backlight.md) + * [Bluetooth](zh/feature_bluetooth.md) + * [Bootmagic](zh/feature_bootmagic.md) + * [Combos](zh/feature_combo) + * [Command](zh/feature_command.md) + * [Dynamic Macros](zh/feature_dynamic_macros.md) + * [Encoders](zh/feature_encoders.md) + * [Grave Escape](zh/feature_grave_esc.md) + * [Key Lock](zh/feature_key_lock.md) + * [Layouts](zh/feature_layouts.md) + * [Leader Key](zh/feature_leader_key.md) + * [Macros](zh/feature_macros.md) + * [Mouse Keys](zh/feature_mouse_keys.md) + * [One Shot Keys](zh/feature_advanced_keycodes.md#one-shot-keys) + * [Pointing Device](zh/feature_pointing_device.md) + * [PS/2 Mouse](zh/feature_ps2_mouse.md) + * [RGB Lighting](zh/feature_rgblight.md) + * [RGB Matrix](zh/feature_rgb_matrix.md) + * [Space Cadet Shift](zh/feature_space_cadet_shift.md) + * [Space Cadet Shift Enter](zh/feature_space_cadet_shift_enter.md) + * [Stenography](zh/feature_stenography.md) + * [Swap Hands](zh/feature_swap_hands.md) + * [Tap Dance](zh/feature_tap_dance.md) + * [Terminal](zh/feature_terminal.md) + * [Thermal Printer](zh/feature_thermal_printer.md) + * [Unicode](zh/feature_unicode.md) + * [Userspace](zh/feature_userspace.md) + * [US ANSI Shifted Keys](zh/keycodes_us_ansi_shifted.md) + +* 對於製造商和遊戲模組 + * [Hand Wiring Guide](zh/hand_wire.md) + * [ISP Flashing Guide](zh/isp_flashing_guide.md) + * [ARM Debugging Guide](zh/arm_debugging.md) + * [I2C Driver](zh/i2c_driver.md) + +* 為了更深入的了解 + * [How Keyboards Work](zh/how_keyboards_work.md) + * [Understanding QMK](zh/understanding_qmk.md) + +* 其它主題 + * [Using Eclipse with QMK](zh/eclipse.md) + +* QMK內部(進行中) + * [Defines](zh/internals_defines.md) + * [Input Callback Reg](zh/internals_input_callback_reg.md) + * [Midi Device](zh/internals_midi_device.md) + * [Midi Device Setup Process](zh/internals_midi_device_setup_process.md) + * [Midi Util](zh/internals_midi_util.md) + * [Send Functions](zh/internals_send_functions.md) + * [Sysex Tools](zh/internals_sysex_tools.md) diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c index 2a7badd351f..cba5a1c679f 100644 --- a/drivers/arm/i2c_master.c +++ b/drivers/arm/i2c_master.c @@ -26,55 +26,82 @@ */ #include "i2c_master.h" +#include "quantum.h" #include #include static uint8_t i2c_address; -// This configures the I2C clock to 400Mhz assuming a 72Mhz clock -// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html static const I2CConfig i2cconfig = { - STM32_TIMINGR_PRESC(15U) | - STM32_TIMINGR_SCLDEL(4U) | STM32_TIMINGR_SDADEL(2U) | - STM32_TIMINGR_SCLH(15U) | STM32_TIMINGR_SCLL(21U), +#ifdef USE_I2CV1 + I2C1_OPMODE, + I2C1_CLOCK_SPEED, + I2C1_DUTY_CYCLE, +#else + STM32_TIMINGR_PRESC(I2C1_TIMINGR_PRESC) | + STM32_TIMINGR_SCLDEL(I2C1_TIMINGR_SCLDEL) | STM32_TIMINGR_SDADEL(I2C1_TIMINGR_SDADEL) | + STM32_TIMINGR_SCLH(I2C1_TIMINGR_SCLH) | STM32_TIMINGR_SCLL(I2C1_TIMINGR_SCLL), 0, 0 +#endif }; +static i2c_status_t chibios_to_qmk(const msg_t* status) { + switch (*status) { + case I2C_NO_ERROR: + return I2C_STATUS_SUCCESS; + case I2C_TIMEOUT: + return I2C_STATUS_TIMEOUT; + // I2C_BUS_ERROR, I2C_ARBITRATION_LOST, I2C_ACK_FAILURE, I2C_OVERRUN, I2C_PEC_ERROR, I2C_SMB_ALERT + default: + return I2C_STATUS_ERROR; + } +} + +__attribute__ ((weak)) void i2c_init(void) { - palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT); // Try releasing special pins for a short time + // Try releasing special pins for a short time + palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_INPUT); + palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_INPUT); + chThdSleepMilliseconds(10); - palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); - palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); +#ifdef USE_I2CV1 + palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); + palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); +#else + palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_ALTERNATE(I2C1_SCL_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN); + palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_ALTERNATE(I2C1_SDA_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN); +#endif //i2cInit(); //This is invoked by halInit() so no need to redo it. } -// This is usually not needed -uint8_t i2c_start(uint8_t address) +i2c_status_t i2c_start(uint8_t address) { i2c_address = address; i2cStart(&I2C_DRIVER, &i2cconfig); - return 0; + return I2C_STATUS_SUCCESS; } -uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) +i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) { i2c_address = address; i2cStart(&I2C_DRIVER, &i2cconfig); - return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); + return chibios_to_qmk(&status); } -uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) +i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_address = address; i2cStart(&I2C_DRIVER, &i2cconfig); - return i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); + msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); + return chibios_to_qmk(&status); } -uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) +i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { i2c_address = devaddr; i2cStart(&I2C_DRIVER, &i2cconfig); @@ -86,19 +113,19 @@ uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t l } complete_packet[0] = regaddr; - return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); + return chibios_to_qmk(&status); } -uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout) +i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_address = devaddr; i2cStart(&I2C_DRIVER, &i2cconfig); - return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout)); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), ®addr, 1, data, length, MS2ST(timeout)); + return chibios_to_qmk(&status); } -// This is usually not needed. It releases the driver to allow pins to become GPIO again. -uint8_t i2c_stop(uint16_t timeout) +void i2c_stop(void) { i2cStop(&I2C_DRIVER); - return 0; } diff --git a/drivers/arm/i2c_master.h b/drivers/arm/i2c_master.h index 591fa7f77d7..c8afa31e28d 100644 --- a/drivers/arm/i2c_master.h +++ b/drivers/arm/i2c_master.h @@ -22,18 +22,89 @@ * Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that * STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. */ +#pragma once #include "ch.h" #include + +#if defined(STM32F1XX) || defined(STM32F1xx) || defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32L0xx) || defined(STM32L1xx) + #define USE_I2CV1 +#endif + +#ifdef I2C1_BANK + #define I2C1_SCL_BANK I2C1_BANK + #define I2C1_SDA_BANK I2C1_BANK +#endif + +#ifndef I2C1_SCL_BANK + #define I2C1_SCL_BANK GPIOB +#endif + +#ifndef I2C1_SDA_BANK + #define I2C1_SDA_BANK GPIOB +#endif + +#ifndef I2C1_SCL + #define I2C1_SCL 6 +#endif +#ifndef I2C1_SDA + #define I2C1_SDA 7 +#endif + +#ifdef USE_I2CV1 + #ifndef I2C1_OPMODE + #define I2C1_OPMODE OPMODE_I2C + #endif + #ifndef I2C1_CLOCK_SPEED + #define I2C1_CLOCK_SPEED 100000 /* 400000 */ + #endif + #ifndef I2C1_DUTY_CYCLE + #define I2C1_DUTY_CYCLE STD_DUTY_CYCLE /* FAST_DUTY_CYCLE_2 */ + #endif +#else + // The default PAL alternate modes are used to signal that the pins are used for I2C + #ifndef I2C1_SCL_PAL_MODE + #define I2C1_SCL_PAL_MODE 4 + #endif + #ifndef I2C1_SDA_PAL_MODE + #define I2C1_SDA_PAL_MODE 4 + #endif + + // The default timing values below configures the I2C clock to 400khz assuming a 72Mhz clock + // For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html + #ifndef I2C1_TIMINGR_PRESC + #define I2C1_TIMINGR_PRESC 15U + #endif + #ifndef I2C1_TIMINGR_SCLDEL + #define I2C1_TIMINGR_SCLDEL 4U + #endif + #ifndef I2C1_TIMINGR_SDADEL + #define I2C1_TIMINGR_SDADEL 2U + #endif + #ifndef I2C1_TIMINGR_SCLH + #define I2C1_TIMINGR_SCLH 15U + #endif + #ifndef I2C1_TIMINGR_SCLL + #define I2C1_TIMINGR_SCLL 21U + #endif +#endif + #ifndef I2C_DRIVER #define I2C_DRIVER I2CD1 #endif +typedef int16_t i2c_status_t; + +#define I2C_STATUS_SUCCESS (0) +#define I2C_STATUS_ERROR (-1) +#define I2C_STATUS_TIMEOUT (-2) + void i2c_init(void); -uint8_t i2c_start(uint8_t address); -uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); -uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); -uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -uint8_t i2c_stop(uint16_t timeout); +i2c_status_t i2c_start(uint8_t address); +i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_transmit_receive(uint8_t address, uint8_t * tx_body, uint16_t tx_length, uint8_t * rx_body, uint16_t rx_length); +i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); +void i2c_stop(void); diff --git a/drivers/avr/apa102.c b/drivers/avr/apa102.c new file mode 100755 index 00000000000..55a0d577788 --- /dev/null +++ b/drivers/avr/apa102.c @@ -0,0 +1,101 @@ +/* +* APA102 lib V1.0a +* +* Controls APA102 RGB-LEDs +* Author: Mikkel (Duckle29 on github) +* +* Dec 22th, 2017 v1.0a Initial Version +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#include "apa102.h" +#include +#include +#include +#include "debug.h" + +// Setleds for standard RGB +void inline apa102_setleds(LED_TYPE *ledarray, uint16_t leds){ + apa102_setleds_pin(ledarray,leds, _BV(RGB_DI_PIN & 0xF), _BV(RGB_CLK_PIN & 0xF)); +} + +void static inline apa102_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask_DI, uint8_t pinmask_CLK){ + pinMode(RGB_DI_PIN, PinDirectionOutput); + pinMode(RGB_CLK_PIN, PinDirectionOutput); + + apa102_send_array((uint8_t*)ledarray,leds) +} + +void apa102_send_array(uint8_t *data, uint16_t leds){ // Data is struct of 3 bytes. RGB - leds is number of leds in data + apa102_start_frame(); + while(leds--){ + apa102_send_frame(0xFF000000 | (data->b << 16) | (data->g << 8) | data->r); + data++; + } + apa102_end_frame(leds); +} + +void apa102_send_frame(uint32_t frame){ + for(uint32_t i=0xFF; i>0;){ + apa102_send_byte(frame & i); + i = i << 8; + } +} + +void apa102_start_frame(){ + apa102_send_frame(0); +} + +void apa102_end_frame(uint16_t leds) +{ + // This function has been taken from: https://github.com/pololu/apa102-arduino/blob/master/APA102.h + // and adapted. The code is MIT licensed. I think thats compatible? + + // We need to send some more bytes to ensure that all the LEDs in the + // chain see their new color and start displaying it. + // + // The data stream seen by the last LED in the chain will be delayed by + // (count - 1) clock edges, because each LED before it inverts the clock + // line and delays the data by one clock edge. Therefore, to make sure + // the last LED actually receives the data we wrote, the number of extra + // edges we send at the end of the frame must be at least (count - 1). + // For the APA102C, that is sufficient. + // + // The SK9822 only updates after it sees 32 zero bits followed by one more + // rising edge. To avoid having the update time depend on the color of + // the last LED, we send a dummy 0xFF byte. (Unfortunately, this means + // that partial updates of the beginning of an LED strip are not possible; + // the LED after the last one you are trying to update will be black.) + // After that, to ensure that the last LED in the chain sees 32 zero bits + // and a rising edge, we need to send at least 65 + (count - 1) edges. It + // is sufficent and simpler to just send (5 + count/16) bytes of zeros. + // + // We are ignoring the specification for the end frame in the APA102/SK9822 + // datasheets because it does not actually ensure that all the LEDs will + // start displaying their new colors right away. + + apa102_send_byte(0xFF); + for (uint16_t i = 0; i < 5 + leds / 16; i++){ + apa102_send_byte(0); + } +} + +void apa102_send_byte(uint8_t byte){ + uint8_t i; + for (i = 0; i < 8; i++){ + digitalWrite(RGB_DI_PIN, !!(byte & (1 << (7-i))); + digitalWrite(RGB_CLK_PIN, PinLevelHigh); + } +} diff --git a/drivers/avr/apa102.h b/drivers/avr/apa102.h new file mode 100755 index 00000000000..5d852e06739 --- /dev/null +++ b/drivers/avr/apa102.h @@ -0,0 +1,46 @@ +/* + * light weight WS2812 lib include + * + * Version 2.3 - Nev 29th 2015 + * Author: Tim (cpldcpu@gmail.com) + * + * Please do not change this file! All configuration is handled in "ws2812_config.h" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include + +#include "color.h" + + +/* User Interface + * + * Input: + * ledarray: An array of GRB data describing the LED colors + * number_of_leds: The number of LEDs to write + * pinmask (optional): Bitmask describing the output bin. e.g. _BV(PB0) + * + * The functions will perform the following actions: + * - Set the data-out pin as output + * - Send out the LED data + * - Wait 50�s to reset the LEDs + */ + +void apa102_setleds (LED_TYPE *ledarray, uint16_t number_of_leds); +void apa102_setleds_pin (LED_TYPE *ledarray, uint16_t number_of_leds,uint8_t pinmask); +void apa102_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds); diff --git a/drivers/avr/i2c_master.c b/drivers/avr/i2c_master.c index a04e6570d76..0acc2464264 100755 --- a/drivers/avr/i2c_master.c +++ b/drivers/avr/i2c_master.c @@ -1,3 +1,18 @@ +/* Copyright (C) 2019 Elia Ritterbusch + + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ /* Library made by: g4lvanix * Github repository: https://github.com/g4lvanix/I2C-master-lib */ @@ -7,43 +22,56 @@ #include "i2c_master.h" #include "timer.h" +#include "wait.h" #ifndef F_SCL -#define F_SCL 400000UL // SCL frequency +# define F_SCL 400000UL // SCL frequency #endif #define Prescaler 1 -#define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16 ) / 2) +#define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16) / 2) -void i2c_init(void) -{ - TWSR = 0; /* no prescaler */ +void i2c_init(void) { + TWSR = 0; /* no prescaler */ TWBR = (uint8_t)TWBR_val; + + #ifdef __AVR_ATmega32A__ + // set pull-up resistors on I2C bus pins + PORTC |= 0b11; + + // enable TWI (two-wire interface) + TWCR |= (1 << TWEN); + + // enable TWI interrupt and slave address ACK + TWCR |= (1 << TWIE); + TWCR |= (1 << TWEA); + #endif } -i2c_status_t i2c_start(uint8_t address, uint16_t timeout) -{ +i2c_status_t i2c_start(uint8_t address, uint16_t timeout) { // reset TWI control register TWCR = 0; // transmit START condition - TWCR = (1<= timeout)) { return I2C_STATUS_TIMEOUT; } } // check if the start condition was successfully transmitted - if(((TW_STATUS & 0xF8) != TW_START) && ((TW_STATUS & 0xF8) != TW_REP_START)){ return I2C_STATUS_ERROR; } + if (((TW_STATUS & 0xF8) != TW_START) && ((TW_STATUS & 0xF8) != TW_REP_START)) { + return I2C_STATUS_ERROR; + } // load slave address into data register TWDR = address; // start transmission of address - TWCR = (1<= timeout)) { return I2C_STATUS_TIMEOUT; } @@ -51,38 +79,39 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout) // check if the device has acknowledged the READ / WRITE mode uint8_t twst = TW_STATUS & 0xF8; - if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return I2C_STATUS_ERROR; + if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) { + return I2C_STATUS_ERROR; + } return I2C_STATUS_SUCCESS; } -i2c_status_t i2c_write(uint8_t data, uint16_t timeout) -{ +i2c_status_t i2c_write(uint8_t data, uint16_t timeout) { // load data into data register TWDR = data; // start transmission of data - TWCR = (1<= timeout)) { return I2C_STATUS_TIMEOUT; } } - if( (TW_STATUS & 0xF8) != TW_MT_DATA_ACK ){ return I2C_STATUS_ERROR; } + if ((TW_STATUS & 0xF8) != TW_MT_DATA_ACK) { + return I2C_STATUS_ERROR; + } return I2C_STATUS_SUCCESS; } -int16_t i2c_read_ack(uint16_t timeout) -{ - +int16_t i2c_read_ack(uint16_t timeout) { // start TWI module and acknowledge data after reception - TWCR = (1<= timeout)) { return I2C_STATUS_TIMEOUT; } @@ -92,14 +121,12 @@ int16_t i2c_read_ack(uint16_t timeout) return TWDR; } -int16_t i2c_read_nack(uint16_t timeout) -{ - +int16_t i2c_read_nack(uint16_t timeout) { // start receiving without acknowledging reception - TWCR = (1<= timeout)) { return I2C_STATUS_TIMEOUT; } @@ -109,112 +136,89 @@ int16_t i2c_read_nack(uint16_t timeout) return TWDR; } -i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) -{ +i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(address | I2C_WRITE, timeout); - if (status) return status; - for (uint16_t i = 0; i < length; i++) { + for (uint16_t i = 0; i < length && status >= 0; i++) { status = i2c_write(data[i], timeout); - if (status) return status; } - status = i2c_stop(timeout); - if (status) return status; + i2c_stop(); - return I2C_STATUS_SUCCESS; + return status; } -i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) -{ +i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(address | I2C_READ, timeout); - if (status) return status; - for (uint16_t i = 0; i < (length-1); i++) { + for (uint16_t i = 0; i < (length - 1) && status >= 0; i++) { status = i2c_read_ack(timeout); if (status >= 0) { data[i] = status; - } else { - return status; } } - status = i2c_read_nack(timeout); - if (status >= 0 ) { - data[(length-1)] = status; - } else { - return status; + if (status >= 0) { + status = i2c_read_nack(timeout); + if (status >= 0) { + data[(length - 1)] = status; + } } - status = i2c_stop(timeout); - if (status) return status; + i2c_stop(); - return I2C_STATUS_SUCCESS; + return (status < 0) ? status : I2C_STATUS_SUCCESS; } -i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) -{ +i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(devaddr | 0x00, timeout); - if (status) return status; - - status = i2c_write(regaddr, timeout); - if (status) return status; + if (status >= 0) { + status = i2c_write(regaddr, timeout); - for (uint16_t i = 0; i < length; i++) { - status = i2c_write(data[i], timeout); - if (status) return status; + for (uint16_t i = 0; i < length && status >= 0; i++) { + status = i2c_write(data[i], timeout); + } } - status = i2c_stop(timeout); - if (status) return status; + i2c_stop(); - return I2C_STATUS_SUCCESS; + return status; } -i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) -{ +i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(devaddr, timeout); - if (status) return status; + if (status < 0) { + goto error; + } status = i2c_write(regaddr, timeout); - if (status) return status; + if (status < 0) { + goto error; + } status = i2c_start(devaddr | 0x01, timeout); - if (status) return status; - for (uint16_t i = 0; i < (length-1); i++) { + for (uint16_t i = 0; i < (length - 1) && status >= 0; i++) { status = i2c_read_ack(timeout); if (status >= 0) { data[i] = status; - } else { - return status; } } - status = i2c_read_nack(timeout); - if (status >= 0 ) { - data[(length-1)] = status; - } else { - return status; + if (status >= 0) { + status = i2c_read_nack(timeout); + if (status >= 0) { + data[(length - 1)] = status; + } } - status = i2c_stop(timeout); - if (status) return status; +error: + i2c_stop(); - return I2C_STATUS_SUCCESS; + return (status < 0) ? status : I2C_STATUS_SUCCESS; } -i2c_status_t i2c_stop(uint16_t timeout) -{ +void i2c_stop(void) { // transmit STOP condition - TWCR = (1<= timeout)) { - return I2C_STATUS_TIMEOUT; - } - } - - return I2C_STATUS_SUCCESS; -} \ No newline at end of file + TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO); +} diff --git a/drivers/avr/i2c_master.h b/drivers/avr/i2c_master.h index 89c64599c51..d68142430ae 100755 --- a/drivers/avr/i2c_master.h +++ b/drivers/avr/i2c_master.h @@ -1,3 +1,18 @@ +/* Copyright (C) 2019 Elia Ritterbusch + + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ /* Library made by: g4lvanix * Github repository: https://github.com/g4lvanix/I2C-master-lib */ @@ -22,10 +37,10 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout); i2c_status_t i2c_write(uint8_t data, uint16_t timeout); int16_t i2c_read_ack(uint16_t timeout); int16_t i2c_read_nack(uint16_t timeout); -i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_stop(uint16_t timeout); +void i2c_stop(void); -#endif // I2C_MASTER_H \ No newline at end of file +#endif // I2C_MASTER_H diff --git a/drivers/avr/i2c_slave.c b/drivers/avr/i2c_slave.c index 27696ca01ab..4958a0f8e5a 100755 --- a/drivers/avr/i2c_slave.c +++ b/drivers/avr/i2c_slave.c @@ -1,3 +1,18 @@ +/* Copyright (C) 2019 Elia Ritterbusch + + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ /* Library made by: g4lvanix * Github repository: https://github.com/g4lvanix/I2C-slave-lib */ @@ -9,23 +24,26 @@ #include "i2c_slave.h" -void i2c_init(uint8_t address){ +volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; + +static volatile uint8_t buffer_address; +static volatile bool slave_has_register_set = false; + +void i2c_slave_init(uint8_t address){ // load address into TWI address register - TWAR = (address << 1); + TWAR = address; // set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt TWCR = (1 << TWIE) | (1 << TWEA) | (1 << TWINT) | (1 << TWEN); } -void i2c_stop(void){ +void i2c_slave_stop(void){ // clear acknowledge and enable bits TWCR &= ~((1 << TWEA) | (1 << TWEN)); } ISR(TWI_vect){ uint8_t ack = 1; - // temporary stores the received data - //uint8_t data; - + switch(TW_STATUS){ case TW_SR_SLA_ACK: // The device is now a slave receiver @@ -38,13 +56,13 @@ ISR(TWI_vect){ if(!slave_has_register_set){ buffer_address = TWDR; - if (buffer_address >= RX_BUFFER_SIZE){ // address out of bounds dont ack - ack = 0; - buffer_address = 0; + if (buffer_address >= I2C_SLAVE_REG_COUNT) { // address out of bounds dont ack + ack = 0; + buffer_address = 0; } slave_has_register_set = true; // address has been receaved now fill in buffer } else { - rxbuffer[buffer_address] = TWDR; + i2c_slave_reg[buffer_address] = TWDR; buffer_address++; } break; @@ -52,7 +70,7 @@ ISR(TWI_vect){ case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: // This device is a slave transmitter and master has requested data - TWDR = txbuffer[buffer_address]; + TWDR = i2c_slave_reg[buffer_address]; buffer_address++; break; @@ -63,6 +81,6 @@ ISR(TWI_vect){ break; } - // Reset i2c state mahcine to be ready for next interrupt + // Reset i2c state machine to be ready for next interrupt TWCR |= (1 << TWIE) | (1 << TWINT) | (ack << TWEA) | (1 << TWEN); -} \ No newline at end of file +} diff --git a/drivers/avr/i2c_slave.h b/drivers/avr/i2c_slave.h index 1c3b9ecc003..2f4589e9c7b 100755 --- a/drivers/avr/i2c_slave.h +++ b/drivers/avr/i2c_slave.h @@ -1,3 +1,18 @@ +/* Copyright (C) 2019 Elia Ritterbusch + + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ /* Library made by: g4lvanix * Github repository: https://github.com/g4lvanix/I2C-slave-lib @@ -8,16 +23,11 @@ #ifndef I2C_SLAVE_H #define I2C_SLAVE_H -#define TX_BUFFER_SIZE 30 -#define RX_BUFFER_SIZE 30 +#define I2C_SLAVE_REG_COUNT 30 -volatile uint8_t buffer_address; -static volatile bool slave_has_register_set = false; -volatile uint8_t txbuffer[TX_BUFFER_SIZE]; -volatile uint8_t rxbuffer[RX_BUFFER_SIZE]; +extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; -void i2c_init(uint8_t address); -void i2c_stop(void); -ISR(TWI_vect); +void i2c_slave_init(uint8_t address); +void i2c_slave_stop(void); -#endif // I2C_SLAVE_H \ No newline at end of file +#endif // I2C_SLAVE_H diff --git a/drivers/avr/ws2812.c b/drivers/avr/ws2812.c index 59e032bf71c..7c3cb5174df 100644 --- a/drivers/avr/ws2812.c +++ b/drivers/avr/ws2812.c @@ -27,6 +27,12 @@ #include #include "debug.h" +#if !defined(LED_ARRAY) && defined(RGB_MATRIX_ENABLE) +// LED color buffer +LED_TYPE led[DRIVER_LED_TOTAL]; + #define LED_ARRAY led +#endif + #ifdef RGBW_BB_TWI // Port for the I2C @@ -128,11 +134,11 @@ unsigned char I2C_Write(unsigned char c) c <<= 1; } - + I2C_WriteBit(0); _delay_us(I2C_DELAY); _delay_us(I2C_DELAY); - + // _delay_us(I2C_DELAY); //return I2C_ReadBit(); return 0; @@ -141,6 +147,25 @@ unsigned char I2C_Write(unsigned char c) #endif +#ifdef RGB_MATRIX_ENABLE +// Set an led in the buffer to a color +void inline ws2812_setled(int i, uint8_t r, uint8_t g, uint8_t b) +{ + led[i].r = r; + led[i].g = g; + led[i].b = b; +} + +void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b) +{ + for (int i = 0; i < sizeof(led)/sizeof(led[0]); i++) { + led[i].r = r; + led[i].g = g; + led[i].b = b; + } +} +#endif + // Setleds for standard RGB void inline ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) { diff --git a/drivers/avr/ws2812.h b/drivers/avr/ws2812.h index 1f9299ffb53..95f540b1849 100644 --- a/drivers/avr/ws2812.h +++ b/drivers/avr/ws2812.h @@ -28,8 +28,7 @@ //#include "ws2812_config.h" //#include "i2cmaster.h" -#include "rgblight_types.h" - +#include "quantum/color.h" /* User Interface * @@ -43,6 +42,10 @@ * - Send out the LED data * - Wait 50�s to reset the LEDs */ +#ifdef RGB_MATRIX_ENABLE +void ws2812_setled (int index, uint8_t r, uint8_t g, uint8_t b); +void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b); +#endif void ws2812_setleds (LED_TYPE *ledarray, uint16_t number_of_leds); void ws2812_setleds_pin (LED_TYPE *ledarray, uint16_t number_of_leds,uint8_t pinmask); diff --git a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.c b/drivers/boards/GENERIC_STM32_F303XC/board.c similarity index 100% rename from keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.c rename to drivers/boards/GENERIC_STM32_F303XC/board.c diff --git a/drivers/boards/GENERIC_STM32_F303XC/board.h b/drivers/boards/GENERIC_STM32_F303XC/board.h new file mode 100644 index 00000000000..11120dfd746 --- /dev/null +++ b/drivers/boards/GENERIC_STM32_F303XC/board.h @@ -0,0 +1,1187 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for Generic STM32_F303 Board + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F303XC +#define BOARD_NAME "STM32_F303" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 8000000U +#endif + +// #define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F303xC + +/* + * IO pins assignments. + */ +#define GPIOA_PIN0 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_PIN13 13U +#define GPIOB_PIN14 14U +#define GPIOB_PIN15 15U + +#define GPIOC_PIN0 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_PIN6 6U +#define GPIOC_PIN7 7U +#define GPIOC_PIN8 8U +#define GPIOC_PIN9 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_PIN14 14U +#define GPIOC_PIN15 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_I2C2_SDA 0U +#define GPIOF_I2C2_SCL 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +#define GPIOG_PIN0 0U +#define GPIOG_PIN1 1U +#define GPIOG_PIN2 2U +#define GPIOG_PIN3 3U +#define GPIOG_PIN4 4U +#define GPIOG_PIN5 5U +#define GPIOG_PIN6 6U +#define GPIOG_PIN7 7U +#define GPIOG_PIN8 8U +#define GPIOG_PIN9 9U +#define GPIOG_PIN10 10U +#define GPIOG_PIN11 11U +#define GPIOG_PIN12 12U +#define GPIOG_PIN13 13U +#define GPIOG_PIN14 14U +#define GPIOG_PIN15 15U + +#define GPIOH_PIN0 0U +#define GPIOH_PIN1 1U +#define GPIOH_PIN2 2U +#define GPIOH_PIN3 3U +#define GPIOH_PIN4 4U +#define GPIOH_PIN5 5U +#define GPIOH_PIN6 6U +#define GPIOH_PIN7 7U +#define GPIOH_PIN8 8U +#define GPIOH_PIN9 9U +#define GPIOH_PIN10 10U +#define GPIOH_PIN11 11U +#define GPIOH_PIN12 12U +#define GPIOH_PIN13 13U +#define GPIOH_PIN14 14U +#define GPIOH_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_PIN6 PAL_LINE(GPIOF, 0U) +#define LINE_PIN7 PAL_LINE(GPIOF, 1U) + +#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) + + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - NC + * PA1 - NC + * PA2 - COL1 + * PA3 - COL2 + * PA4 - SPEAKER1 + * PA5 - SPEAKER2 + * PA6 - COL3 + * PA7 - COL8 + * PA8 - COL6 + * PA9 - COL7 + * PA10 - ROW5 + * PA11 - USB_DM (alternate 14). + * PA12 - USB_DP (alternate 14). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - ROW4 + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ + PIN_MODE_ALTERNATE(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ + PIN_AFIO_AF(GPIOA_PIN1, 1) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0) | \ + PIN_AFIO_AF(GPIOA_PIN5, 5) | \ + PIN_AFIO_AF(GPIOA_PIN6, 5) | \ + PIN_AFIO_AF(GPIOA_PIN7, 5)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (alternate 0). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). + * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - PIN13 (input pullup). + * PB14 - PIN14 (input pullup). + * PB15 - PIN15 (input pullup). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ + PIN_MODE_OUTPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_INPUT(GPIOB_PIN13) | \ + PIN_MODE_INPUT(GPIOB_PIN14) | \ + PIN_MODE_INPUT(GPIOB_PIN15)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ + PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN15)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_LOW(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_PIN13) | \ + PIN_ODR_HIGH(GPIOB_PIN14) | \ + PIN_ODR_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0) | \ + PIN_AFIO_AF(GPIOB_PIN6, 4) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0) | \ + PIN_AFIO_AF(GPIOB_PIN13, 0) | \ + PIN_AFIO_AF(GPIOB_PIN14, 0) | \ + PIN_AFIO_AF(GPIOB_PIN15, 0)) + +/* + * GPIOC setup: + * + * PC0 - PIN0 (input pullup). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - PIN6 (input pullup). + * PC7 - PIN7 (input pullup). + * PC8 - PIN8 (input pullup). + * PC9 - PIN9 (input pullup). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - PIN14 (input floating). + * PC15 - PIN15 (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_INPUT(GPIOC_PIN6) | \ + PIN_MODE_INPUT(GPIOC_PIN7) | \ + PIN_MODE_INPUT(GPIOC_PIN8) | \ + PIN_MODE_INPUT(GPIOC_PIN9) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_PIN14) | \ + PIN_MODE_INPUT(GPIOC_PIN15)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN15)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_HIGH(GPIOC_PIN6) | \ + PIN_ODR_HIGH(GPIOC_PIN7) | \ + PIN_ODR_HIGH(GPIOC_PIN8) | \ + PIN_ODR_HIGH(GPIOC_PIN9) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_PIN14) | \ + PIN_ODR_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0) | \ + PIN_AFIO_AF(GPIOC_PIN6, 0) | \ + PIN_AFIO_AF(GPIOC_PIN7, 0)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ + PIN_AFIO_AF(GPIOC_PIN9, 0) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0) | \ + PIN_AFIO_AF(GPIOC_PIN14, 0) | \ + PIN_AFIO_AF(GPIOC_PIN15, 0)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD11 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 L3GD20_CS (output pushpull maximum). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (output pushpull maximum). + * PE9 - PIN9 (output pushpull maximum). + * PE10 - PIN10 (output pushpull maximum). + * PE11 - PIN11 (output pushpull maximum). + * PE12 - PIN12 (output pushpull maximum). + * PE13 - PIN13 (output pushpull maximum). + * PE14 - PIN14 (output pushpull maximum). + * PE15 - PIN15 (output pushpull maximum). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) |\ + PIN_MODE_OUTPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) |\ + PIN_MODE_INPUT(GPIOE_PIN5) |\ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_OUTPUT(GPIOE_PIN8) | \ + PIN_MODE_OUTPUT(GPIOE_PIN9) | \ + PIN_MODE_OUTPUT(GPIOE_PIN10) | \ + PIN_MODE_OUTPUT(GPIOE_PIN11) | \ + PIN_MODE_OUTPUT(GPIOE_PIN12) | \ + PIN_MODE_OUTPUT(GPIOE_PIN13) | \ + PIN_MODE_OUTPUT(GPIOE_PIN14) | \ + PIN_MODE_OUTPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_LOW(GPIOE_PIN8) | \ + PIN_ODR_LOW(GPIOE_PIN9) | \ + PIN_ODR_LOW(GPIOE_PIN10) | \ + PIN_ODR_LOW(GPIOE_PIN11) | \ + PIN_ODR_LOW(GPIOE_PIN12) | \ + PIN_ODR_LOW(GPIOE_PIN13) | \ + PIN_ODR_LOW(GPIOE_PIN14) | \ + PIN_ODR_LOW(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0) |\ + PIN_AFIO_AF(GPIOE_PIN3, 0) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0) |\ + PIN_AFIO_AF(GPIOE_PIN5, 0) |\ + PIN_AFIO_AF(GPIOE_PIN6, 0) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0)) + +/* + * GPIOF setup: + * + * PF0 - I2C2_SDA (input floating). + * PF1 - I2C2_SCL (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ + PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ + PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ + PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ + PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ + PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ + PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0)) + +/* + * GPIOG setup: + * + * PG0 - PIN0 (input pullup). + * PG1 - PIN1 (input pullup). + * PG2 - PIN2 (input pullup). + * PG3 - PIN3 (input pullup). + * PG4 - PIN4 (input pullup). + * PG5 - PIN5 (input pullup). + * PG6 - PIN6 (input pullup). + * PG7 - PIN7 (input pullup). + * PG8 - PIN8 (input pullup). + * PG9 - PIN9 (input pullup). + * PG10 - PIN10 (input pullup). + * PG11 - PIN11 (input pullup). + * PG12 - PIN12 (input pullup). + * PG13 - PIN13 (input pullup). + * PG14 - PIN14 (input pullup). + * PG15 - PIN15 (input pullup). + */ +#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ + PIN_MODE_INPUT(GPIOG_PIN1) | \ + PIN_MODE_INPUT(GPIOG_PIN2) | \ + PIN_MODE_INPUT(GPIOG_PIN3) | \ + PIN_MODE_INPUT(GPIOG_PIN4) | \ + PIN_MODE_INPUT(GPIOG_PIN5) | \ + PIN_MODE_INPUT(GPIOG_PIN6) | \ + PIN_MODE_INPUT(GPIOG_PIN7) | \ + PIN_MODE_INPUT(GPIOG_PIN8) | \ + PIN_MODE_INPUT(GPIOG_PIN9) | \ + PIN_MODE_INPUT(GPIOG_PIN10) | \ + PIN_MODE_INPUT(GPIOG_PIN11) | \ + PIN_MODE_INPUT(GPIOG_PIN12) | \ + PIN_MODE_INPUT(GPIOG_PIN13) | \ + PIN_MODE_INPUT(GPIOG_PIN14) | \ + PIN_MODE_INPUT(GPIOG_PIN15)) +#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN15)) +#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN15)) +#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ + PIN_ODR_HIGH(GPIOG_PIN1) | \ + PIN_ODR_HIGH(GPIOG_PIN2) | \ + PIN_ODR_HIGH(GPIOG_PIN3) | \ + PIN_ODR_HIGH(GPIOG_PIN4) | \ + PIN_ODR_HIGH(GPIOG_PIN5) | \ + PIN_ODR_HIGH(GPIOG_PIN6) | \ + PIN_ODR_HIGH(GPIOG_PIN7) | \ + PIN_ODR_HIGH(GPIOG_PIN8) | \ + PIN_ODR_HIGH(GPIOG_PIN9) | \ + PIN_ODR_HIGH(GPIOG_PIN10) | \ + PIN_ODR_HIGH(GPIOG_PIN11) | \ + PIN_ODR_HIGH(GPIOG_PIN12) | \ + PIN_ODR_HIGH(GPIOG_PIN13) | \ + PIN_ODR_HIGH(GPIOG_PIN14) | \ + PIN_ODR_HIGH(GPIOG_PIN15)) +#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ + PIN_AFIO_AF(GPIOG_PIN1, 0) | \ + PIN_AFIO_AF(GPIOG_PIN2, 0) | \ + PIN_AFIO_AF(GPIOG_PIN3, 0) | \ + PIN_AFIO_AF(GPIOG_PIN4, 0) | \ + PIN_AFIO_AF(GPIOG_PIN5, 0) | \ + PIN_AFIO_AF(GPIOG_PIN6, 0) | \ + PIN_AFIO_AF(GPIOG_PIN7, 0)) +#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ + PIN_AFIO_AF(GPIOG_PIN9, 0) | \ + PIN_AFIO_AF(GPIOG_PIN10, 0) | \ + PIN_AFIO_AF(GPIOG_PIN11, 0) | \ + PIN_AFIO_AF(GPIOG_PIN12, 0) | \ + PIN_AFIO_AF(GPIOG_PIN13, 0) | \ + PIN_AFIO_AF(GPIOG_PIN14, 0) | \ + PIN_AFIO_AF(GPIOG_PIN15, 0)) + +/* + * GPIOH setup: + * + * PH0 - PIN0 (input pullup). + * PH1 - PIN1 (input pullup). + * PH2 - PIN2 (input pullup). + * PH3 - PIN3 (input pullup). + * PH4 - PIN4 (input pullup). + * PH5 - PIN5 (input pullup). + * PH6 - PIN6 (input pullup). + * PH7 - PIN7 (input pullup). + * PH8 - PIN8 (input pullup). + * PH9 - PIN9 (input pullup). + * PH10 - PIN10 (input pullup). + * PH11 - PIN11 (input pullup). + * PH12 - PIN12 (input pullup). + * PH13 - PIN13 (input pullup). + * PH14 - PIN14 (input pullup). + * PH15 - PIN15 (input pullup). + */ +#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ + PIN_MODE_INPUT(GPIOH_PIN1) | \ + PIN_MODE_INPUT(GPIOH_PIN2) | \ + PIN_MODE_INPUT(GPIOH_PIN3) | \ + PIN_MODE_INPUT(GPIOH_PIN4) | \ + PIN_MODE_INPUT(GPIOH_PIN5) | \ + PIN_MODE_INPUT(GPIOH_PIN6) | \ + PIN_MODE_INPUT(GPIOH_PIN7) | \ + PIN_MODE_INPUT(GPIOH_PIN8) | \ + PIN_MODE_INPUT(GPIOH_PIN9) | \ + PIN_MODE_INPUT(GPIOH_PIN10) | \ + PIN_MODE_INPUT(GPIOH_PIN11) | \ + PIN_MODE_INPUT(GPIOH_PIN12) | \ + PIN_MODE_INPUT(GPIOH_PIN13) | \ + PIN_MODE_INPUT(GPIOH_PIN14) | \ + PIN_MODE_INPUT(GPIOH_PIN15)) +#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) +#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN15)) +#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ + PIN_ODR_HIGH(GPIOH_PIN1) | \ + PIN_ODR_HIGH(GPIOH_PIN2) | \ + PIN_ODR_HIGH(GPIOH_PIN3) | \ + PIN_ODR_HIGH(GPIOH_PIN4) | \ + PIN_ODR_HIGH(GPIOH_PIN5) | \ + PIN_ODR_HIGH(GPIOH_PIN6) | \ + PIN_ODR_HIGH(GPIOH_PIN7) | \ + PIN_ODR_HIGH(GPIOH_PIN8) | \ + PIN_ODR_HIGH(GPIOH_PIN9) | \ + PIN_ODR_HIGH(GPIOH_PIN10) | \ + PIN_ODR_HIGH(GPIOH_PIN11) | \ + PIN_ODR_HIGH(GPIOH_PIN12) | \ + PIN_ODR_HIGH(GPIOH_PIN13) | \ + PIN_ODR_HIGH(GPIOH_PIN14) | \ + PIN_ODR_HIGH(GPIOH_PIN15)) +#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ + PIN_AFIO_AF(GPIOH_PIN1, 0) | \ + PIN_AFIO_AF(GPIOH_PIN2, 0) | \ + PIN_AFIO_AF(GPIOH_PIN3, 0) | \ + PIN_AFIO_AF(GPIOH_PIN4, 0) | \ + PIN_AFIO_AF(GPIOH_PIN5, 0) | \ + PIN_AFIO_AF(GPIOH_PIN6, 0) | \ + PIN_AFIO_AF(GPIOH_PIN7, 0)) +#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ + PIN_AFIO_AF(GPIOH_PIN9, 0) | \ + PIN_AFIO_AF(GPIOH_PIN10, 0) | \ + PIN_AFIO_AF(GPIOH_PIN11, 0) | \ + PIN_AFIO_AF(GPIOH_PIN12, 0) | \ + PIN_AFIO_AF(GPIOH_PIN13, 0) | \ + PIN_AFIO_AF(GPIOH_PIN14, 0) | \ + PIN_AFIO_AF(GPIOH_PIN15, 0)) + + +/* + * USB bus activation macro, required by the USB driver. + */ +// #define usb_lld_connect_bus(usbp) +#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) +// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) +/* + * USB bus de-activation macro, required by the USB driver. + */ +// #define usb_lld_disconnect_bus(usbp) +#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) +// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.mk b/drivers/boards/GENERIC_STM32_F303XC/board.mk similarity index 100% rename from keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.mk rename to drivers/boards/GENERIC_STM32_F303XC/board.mk diff --git a/keyboards/clueboard/60/bootloader_defs.h b/drivers/boards/GENERIC_STM32_F303XC/bootloader_defs.h similarity index 100% rename from keyboards/clueboard/60/bootloader_defs.h rename to drivers/boards/GENERIC_STM32_F303XC/bootloader_defs.h diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c new file mode 100644 index 00000000000..215e6be3e7c --- /dev/null +++ b/drivers/haptic/DRV2605L.c @@ -0,0 +1,129 @@ +/* Copyright 2018 ishtob + * Driver for DRV2605L written for QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "DRV2605L.h" +#include "print.h" +#include +#include +#include + + +uint8_t DRV2605L_transfer_buffer[2]; +uint8_t DRV2605L_tx_register[0]; +uint8_t DRV2605L_read_buffer[0]; +uint8_t DRV2605L_read_register; + + +void DRV_write(uint8_t drv_register, uint8_t settings) { + DRV2605L_transfer_buffer[0] = drv_register; + DRV2605L_transfer_buffer[1] = settings; + i2c_transmit(DRV2605L_BASE_ADDRESS << 1, DRV2605L_transfer_buffer, 2, 100); +} + +uint8_t DRV_read(uint8_t regaddress) { +#ifdef __AVR__ + i2c_readReg(DRV2605L_BASE_ADDRESS << 1, + regaddress, DRV2605L_read_buffer, 1, 100); + DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0]; +#else + DRV2605L_tx_register[0] = regaddress; + if (MSG_OK != i2c_transmit_receive(DRV2605L_BASE_ADDRESS << 1, + DRV2605L_tx_register, 1, + DRV2605L_read_buffer, 1 +)){ + printf("err reading reg \n"); + } + DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0]; +#endif +return DRV2605L_read_register; +} + +void DRV_init(void) +{ + i2c_init(); + /* 0x07 sets DRV2605 into calibration mode */ + DRV_write(DRV_MODE,0x07); + +// DRV_write(DRV_FEEDBACK_CTRL,0xB6); + + #if FB_ERM_LRA == 0 + /* ERM settings */ + DRV_write(DRV_RATED_VOLT, (RATED_VOLTAGE/21.33)*1000); + #if ERM_OPEN_LOOP == 0 + DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (((V_PEAK*(DRIVE_TIME+BLANKING_TIME+IDISS_TIME))/0.02133)/(DRIVE_TIME-0.0003))); + #elif ERM_OPEN_LOOP == 1 + DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (V_PEAK/0.02196)); + #endif + #elif FB_ERM_LRA == 1 + DRV_write(DRV_RATED_VOLT, ((V_RMS * sqrt(1 - ((4 * ((150+(SAMPLE_TIME*50))*0.000001)) + 0.0003)* F_LRA)/0.02071))); + #if LRA_OPEN_LOOP == 0 + DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, ((V_PEAK/sqrt(1-(F_LRA*0.0008))/0.02133))); + #elif LRA_OPEN_LOOP == 1 + DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (V_PEAK/0.02196)); + #endif + #endif + + DRVREG_FBR FB_SET; + FB_SET.Bits.ERM_LRA = FB_ERM_LRA; + FB_SET.Bits.BRAKE_FACTOR = FB_BRAKEFACTOR; + FB_SET.Bits.LOOP_GAIN =FB_LOOPGAIN; + FB_SET.Bits.BEMF_GAIN = 0; /* auto-calibration populates this field*/ + DRV_write(DRV_FEEDBACK_CTRL, (uint8_t) FB_SET.Byte); + DRVREG_CTRL1 C1_SET; + C1_SET.Bits.C1_DRIVE_TIME = DRIVE_TIME; + C1_SET.Bits.C1_AC_COUPLE = AC_COUPLE; + C1_SET.Bits.C1_STARTUP_BOOST = STARTUP_BOOST; + DRV_write(DRV_CTRL_1, (uint8_t) C1_SET.Byte); + DRVREG_CTRL2 C2_SET; + C2_SET.Bits.C2_BIDIR_INPUT = BIDIR_INPUT; + C2_SET.Bits.C2_BRAKE_STAB = BRAKE_STAB; + C2_SET.Bits.C2_SAMPLE_TIME = SAMPLE_TIME; + C2_SET.Bits.C2_BLANKING_TIME = BLANKING_TIME; + C2_SET.Bits.C2_IDISS_TIME = IDISS_TIME; + DRV_write(DRV_CTRL_2, (uint8_t) C2_SET.Byte); + DRVREG_CTRL3 C3_SET; + C3_SET.Bits.C3_LRA_OPEN_LOOP = LRA_OPEN_LOOP; + C3_SET.Bits.C3_N_PWM_ANALOG = N_PWM_ANALOG; + C3_SET.Bits.C3_LRA_DRIVE_MODE = LRA_DRIVE_MODE; + C3_SET.Bits.C3_DATA_FORMAT_RTO = DATA_FORMAT_RTO; + C3_SET.Bits.C3_SUPPLY_COMP_DIS = SUPPLY_COMP_DIS; + C3_SET.Bits.C3_ERM_OPEN_LOOP = ERM_OPEN_LOOP; + C3_SET.Bits.C3_NG_THRESH = NG_THRESH; + DRV_write(DRV_CTRL_3, (uint8_t) C3_SET.Byte); + DRVREG_CTRL4 C4_SET; + C4_SET.Bits.C4_ZC_DET_TIME = ZC_DET_TIME; + C4_SET.Bits.C4_AUTO_CAL_TIME = AUTO_CAL_TIME; + DRV_write(DRV_CTRL_4, (uint8_t) C4_SET.Byte); + DRV_write(DRV_LIB_SELECTION,LIB_SELECTION); + + DRV_write(DRV_GO, 0x01); + + /* 0x00 sets DRV2605 out of standby and to use internal trigger + * 0x01 sets DRV2605 out of standby and to use external trigger */ + DRV_write(DRV_MODE,0x00); + +//Play greeting sequence + DRV_write(DRV_GO, 0x00); + DRV_write(DRV_WAVEFORM_SEQ_1, DRV_GREETING); + DRV_write(DRV_GO, 0x01); +} + +void DRV_pulse(uint8_t sequence) +{ + DRV_write(DRV_GO, 0x00); + DRV_write(DRV_WAVEFORM_SEQ_1, sequence); + DRV_write(DRV_GO, 0x01); +} \ No newline at end of file diff --git a/drivers/haptic/DRV2605L.h b/drivers/haptic/DRV2605L.h new file mode 100644 index 00000000000..836e9cbcd28 --- /dev/null +++ b/drivers/haptic/DRV2605L.h @@ -0,0 +1,404 @@ +/* Copyright 2018 ishtob + * Driver for DRV2605L written for QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "i2c_master.h" + +/* Initialization settings + + * Feedback Control Settings */ +#ifndef FB_ERM_LRA +#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ +#endif +#ifndef FB_BRAKEFACTOR +#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#endif +#ifndef FB_LOOPGAIN +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ +#endif + +/* LRA specific settings */ +#if FB_ERM_LRA == 1 +#ifndef V_RMS +#define V_RMS 2.0 +#endif +#ifndef V_PEAK +#define V_PEAK 2.1 +#endif +#ifndef F_LRA +#define F_LRA 205 +#endif +#ifndef RATED_VOLTAGE +#define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */ +#endif +#endif + +#ifndef RATED_VOLTAGE +#define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */ +#endif +#ifndef V_PEAK +#define V_PEAK 2.8 +#endif + +/* Library Selection */ +#ifndef LIB_SELECTION +#if FB_ERM_LRA == 1 +#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ +#else +#define LIB_SELECTION 1 +#endif +#endif + +#ifndef DRV_GREETING +#define DRV_GREETING alert_750ms +#endif +#ifndef DRV_MODE_DEFAULT +#define DRV_MODE_DEFAULT strong_click1 +#endif + +/* Control 1 register settings */ +#ifndef DRIVE_TIME +#define DRIVE_TIME 25 +#endif +#ifndef AC_COUPLE +#define AC_COUPLE 0 +#endif +#ifndef STARTUP_BOOST +#define STARTUP_BOOST 1 +#endif + +/* Control 2 Settings */ +#ifndef BIDIR_INPUT +#define BIDIR_INPUT 1 +#endif +#ifndef BRAKE_STAB +#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ +#endif +#ifndef SAMPLE_TIME +#define SAMPLE_TIME 3 +#endif +#ifndef BLANKING_TIME +#define BLANKING_TIME 1 +#endif +#ifndef IDISS_TIME +#define IDISS_TIME 1 +#endif + +/* Control 3 settings */ +#ifndef NG_THRESH +#define NG_THRESH 2 +#endif +#ifndef ERM_OPEN_LOOP +#define ERM_OPEN_LOOP 1 +#endif +#ifndef SUPPLY_COMP_DIS +#define SUPPLY_COMP_DIS 0 +#endif +#ifndef DATA_FORMAT_RTO +#define DATA_FORMAT_RTO 0 +#endif +#ifndef LRA_DRIVE_MODE +#define LRA_DRIVE_MODE 0 +#endif +#ifndef N_PWM_ANALOG +#define N_PWM_ANALOG 0 +#endif +#ifndef LRA_OPEN_LOOP +#define LRA_OPEN_LOOP 0 +#endif + +/* Control 4 settings */ +#ifndef ZC_DET_TIME +#define ZC_DET_TIME 0 +#endif +#ifndef AUTO_CAL_TIME +#define AUTO_CAL_TIME 3 +#endif + +/* register defines -------------------------------------------------------- */ +#define DRV2605L_BASE_ADDRESS 0x5A /* DRV2605L Base address */ +#define DRV_STATUS 0x00 +#define DRV_MODE 0x01 +#define DRV_RTP_INPUT 0x02 +#define DRV_LIB_SELECTION 0x03 +#define DRV_WAVEFORM_SEQ_1 0x04 +#define DRV_WAVEFORM_SEQ_2 0x05 +#define DRV_WAVEFORM_SEQ_3 0x06 +#define DRV_WAVEFORM_SEQ_4 0x07 +#define DRV_WAVEFORM_SEQ_5 0x08 +#define DRV_WAVEFORM_SEQ_6 0x09 +#define DRV_WAVEFORM_SEQ_7 0x0A +#define DRV_WAVEFORM_SEQ_8 0x0B +#define DRV_GO 0x0C +#define DRV_OVERDRIVE_TIME_OFFSET 0x0D +#define DRV_SUSTAIN_TIME_OFFSET_P 0x0E +#define DRV_SUSTAIN_TIME_OFFSET_N 0x0F +#define DRV_BRAKE_TIME_OFFSET 0x10 +#define DRV_AUDIO_2_VIBE_CTRL 0x11 +#define DRV_AUDIO_2_VIBE_MIN_IN 0x12 +#define DRV_AUDIO_2_VIBE_MAX_IN 0x13 +#define DRV_AUDIO_2_VIBE_MIN_OUTDRV 0x14 +#define DRV_AUDIO_2_VIBE_MAX_OUTDRV 0x15 +#define DRV_RATED_VOLT 0x16 +#define DRV_OVERDRIVE_CLAMP_VOLT 0x17 +#define DRV_AUTO_CALIB_COMP_RESULT 0x18 +#define DRV_AUTO_CALIB_BEMF_RESULT 0x19 +#define DRV_FEEDBACK_CTRL 0x1A +#define DRV_CTRL_1 0x1B +#define DRV_CTRL_2 0x1C +#define DRV_CTRL_3 0x1D +#define DRV_CTRL_4 0x1E +#define DRV_CTRL_5 0x1F +#define DRV_OPEN_LOOP_PERIOD 0x20 +#define DRV_VBAT_VOLT_MONITOR 0x21 +#define DRV_LRA_RESONANCE_PERIOD 0x22 + +void DRV_init(void); +void DRV_write(const uint8_t drv_register, const uint8_t settings); +uint8_t DRV_read(const uint8_t regaddress); +void DRV_pulse(const uint8_t sequence); + +typedef enum DRV_EFFECT{ + clear_sequence = 0, + strong_click = 1, + strong_click_60 = 2, + strong_click_30 = 3, + sharp_click = 4, + sharp_click_60 = 5, + sharp_click_30 = 6, + soft_bump = 7, + soft_bump_60 = 8, + soft_bump_30 = 9, + dbl_click = 10, + dbl_click_60 = 11, + trp_click = 12, + soft_fuzz = 13, + strong_buzz = 14, + alert_750ms = 15, + alert_1000ms = 16, + strong_click1 = 17, + strong_click2_80 = 18, + strong_click3_60 = 19, + strong_click4_30 = 20, + medium_click1 = 21, + medium_click2_80 = 22, + medium_click3_60 = 23, + sharp_tick1 = 24, + sharp_tick2_80 = 25, + sharp_tick3_60 = 26, + sh_dblclick_str = 27, + sh_dblclick_str_80 = 28, + sh_dblclick_str_60 = 29, + sh_dblclick_str_30 = 30, + sh_dblclick_med = 31, + sh_dblclick_med_80 = 32, + sh_dblclick_med_60 = 33, + sh_dblsharp_tick = 34, + sh_dblsharp_tick_80 = 35, + sh_dblsharp_tick_60 = 36, + lg_dblclick_str = 37, + lg_dblclick_str_80 = 38, + lg_dblclick_str_60 = 39, + lg_dblclick_str_30 = 40, + lg_dblclick_med = 41, + lg_dblclick_med_80 = 42, + lg_dblclick_med_60 = 43, + lg_dblsharp_tick = 44, + lg_dblsharp_tick_80 = 45, + lg_dblsharp_tick_60 = 46, + buzz = 47, + buzz_80 = 48, + buzz_60 = 49, + buzz_40 = 50, + buzz_20 = 51, + pulsing_strong = 52, + pulsing_strong_80 = 53, + pulsing_medium = 54, + pulsing_medium_80 = 55, + pulsing_sharp = 56, + pulsing_sharp_80 = 57, + transition_click = 58, + transition_click_80 = 59, + transition_click_60 = 60, + transition_click_40 = 61, + transition_click_20 = 62, + transition_click_10 = 63, + transition_hum = 64, + transition_hum_80 = 65, + transition_hum_60 = 66, + transition_hum_40 = 67, + transition_hum_20 = 68, + transition_hum_10 = 69, + transition_rampdown_long_smooth1 = 70, + transition_rampdown_long_smooth2 = 71, + transition_rampdown_med_smooth1 = 72, + transition_rampdown_med_smooth2 = 73, + transition_rampdown_short_smooth1 = 74, + transition_rampdown_short_smooth2 = 75, + transition_rampdown_long_sharp1 = 76, + transition_rampdown_long_sharp2 = 77, + transition_rampdown_med_sharp1 = 78, + transition_rampdown_med_sharp2 = 79, + transition_rampdown_short_sharp1 = 80, + transition_rampdown_short_sharp2 = 81, + transition_rampup_long_smooth1 = 82, + transition_rampup_long_smooth2 = 83, + transition_rampup_med_smooth1 = 84, + transition_rampup_med_smooth2 = 85, + transition_rampup_short_smooth1 = 86, + transition_rampup_short_smooth2 = 87, + transition_rampup_long_sharp1 = 88, + transition_rampup_long_sharp2 = 89, + transition_rampup_med_sharp1 = 90, + transition_rampup_med_sharp2 = 91, + transition_rampup_short_sharp1 = 92, + transition_rampup_short_sharp2 = 93, + transition_rampdown_long_smooth1_50 = 94, + transition_rampdown_long_smooth2_50 = 95, + transition_rampdown_med_smooth1_50 = 96, + transition_rampdown_med_smooth2_50 = 97, + transition_rampdown_short_smooth1_50 = 98, + transition_rampdown_short_smooth2_50 = 99, + transition_rampdown_long_sharp1_50 = 100, + transition_rampdown_long_sharp2_50 = 101, + transition_rampdown_med_sharp1_50 = 102, + transition_rampdown_med_sharp2_50 = 103, + transition_rampdown_short_sharp1_50 = 104, + transition_rampdown_short_sharp2_50 = 105, + transition_rampup_long_smooth1_50 = 106, + transition_rampup_long_smooth2_50 = 107, + transition_rampup_med_smooth1_50 = 108, + transition_rampup_med_smooth2_50 = 109, + transition_rampup_short_smooth1_50 = 110, + transition_rampup_short_smooth2_50 = 111, + transition_rampup_long_sharp1_50 = 112, + transition_rampup_long_sharp2_50 = 113, + transition_rampup_med_sharp1_50 = 114, + transition_rampup_med_sharp2_50 = 115, + transition_rampup_short_sharp1_50 = 116, + transition_rampup_short_sharp2_50 = 117, + long_buzz_for_programmatic_stopping = 118, + smooth_hum1_50 = 119, + smooth_hum2_40 = 120, + smooth_hum3_30 = 121, + smooth_hum4_20 = 122, + smooth_hum5_10 = 123, + drv_effect_max = 124, +} DRV_EFFECT; + +/* Register bit array unions */ + +typedef union DRVREG_STATUS { /* register 0x00 */ + uint8_t Byte; + struct { + uint8_t OC_DETECT :1; /* set to 1 when overcurrent event is detected */ + uint8_t OVER_TEMP :1; /* set to 1 when device exceeds temp threshold */ + uint8_t FB_STS :1; /* set to 1 when feedback controller has timed out */ + /* auto-calibration routine and diagnostic result + * result | auto-calibation | diagnostic | + * 0 | passed | actuator func normal | + * 1 | failed | actuator func fault* | + * * actuator is not present or is shorted, timing out, or giving out–of-range back-EMF */ + uint8_t DIAG_RESULT :1; + uint8_t :1; + uint8_t DEVICE_ID :3; /* Device IDs 3: DRV2605 4: DRV2604 5: DRV2604L 6: DRV2605L */ + } Bits; +} DRVREG_STATUS; + +typedef union DRVREG_MODE { /* register 0x01 */ + uint8_t Byte; + struct { + uint8_t MODE :3; /* Mode setting */ + uint8_t :3; + uint8_t STANDBY :1; /* 0:standby 1:ready */ + } Bits; +} DRVREG_MODE; + +typedef union DRVREG_WAIT { + uint8_t Byte; + struct { + uint8_t WAIT_MODE :1; /* Set to 1 to interpret as wait for next 7 bits x10ms */ + uint8_t WAIT_TIME :7; + } Bits; +} DRVREG_WAIT; + +typedef union DRVREG_FBR{ /* register 0x1A */ + uint8_t Byte; + struct { + uint8_t BEMF_GAIN :2; + uint8_t LOOP_GAIN :2; + uint8_t BRAKE_FACTOR :3; + uint8_t ERM_LRA :1; + } Bits; +} DRVREG_FBR; + +typedef union DRVREG_CTRL1{ /* register 0x1B */ + uint8_t Byte; + struct { + uint8_t C1_DRIVE_TIME :5; + uint8_t C1_AC_COUPLE :1; + uint8_t :1; + uint8_t C1_STARTUP_BOOST :1; + } Bits; +} DRVREG_CTRL1; + +typedef union DRVREG_CTRL2{ /* register 0x1C */ + uint8_t Byte; + struct { + uint8_t C2_IDISS_TIME :2; + uint8_t C2_BLANKING_TIME :2; + uint8_t C2_SAMPLE_TIME :2; + uint8_t C2_BRAKE_STAB :1; + uint8_t C2_BIDIR_INPUT :1; + } Bits; +} DRVREG_CTRL2; + +typedef union DRVREG_CTRL3{ /* register 0x1D */ + uint8_t Byte; + struct { + uint8_t C3_LRA_OPEN_LOOP :1; + uint8_t C3_N_PWM_ANALOG :1; + uint8_t C3_LRA_DRIVE_MODE :1; + uint8_t C3_DATA_FORMAT_RTO :1; + uint8_t C3_SUPPLY_COMP_DIS :1; + uint8_t C3_ERM_OPEN_LOOP :1; + uint8_t C3_NG_THRESH :2; + } Bits; +} DRVREG_CTRL3; + +typedef union DRVREG_CTRL4{ /* register 0x1E */ + uint8_t Byte; + struct { + uint8_t C4_OTP_PROGRAM :1; + uint8_t :1; + uint8_t C4_OTP_STATUS :1; + uint8_t :1; + uint8_t C4_AUTO_CAL_TIME :2; + uint8_t C4_ZC_DET_TIME :2; + } Bits; +} DRVREG_CTRL4; + +typedef union DRVREG_CTRL5{ /* register 0x1F */ + uint8_t Byte; + struct { + uint8_t C5_IDISS_TIME :2; + uint8_t C5_BLANKING_TIME :2; + uint8_t C5_PLAYBACK_INTERVAL :1; + uint8_t C5_LRA_AUTO_OPEN_LOOP :1; + uint8_t C5_AUTO_OL_CNT :2; + } Bits; +} DRVREG_CTRL5; \ No newline at end of file diff --git a/drivers/haptic/haptic.c b/drivers/haptic/haptic.c new file mode 100644 index 00000000000..a94f05565c2 --- /dev/null +++ b/drivers/haptic/haptic.c @@ -0,0 +1,248 @@ +/* Copyright 2019 ishtob + * Driver for haptic feedback written for QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "haptic.h" +#include "eeconfig.h" +#include "progmem.h" +#include "debug.h" +#ifdef DRV2605L +#include "DRV2605L.h" +#endif +#ifdef SOLENOID_ENABLE +#include "solenoid.h" +#endif + +haptic_config_t haptic_config; + +void haptic_init(void) { + debug_enable = 1; //Debug is ON! + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + haptic_config.raw = eeconfig_read_haptic(); + if (haptic_config.mode < 1){ + haptic_config.mode = 1; + } + if (!haptic_config.mode){ + dprintf("No haptic config found in eeprom, setting default configs\n"); + haptic_reset(); + } + #ifdef SOLENOID_ENABLE + solenoid_setup(); + dprintf("Solenoid driver initialized\n"); + #endif + #ifdef DRV2605L + DRV_init(); + dprintf("DRV2605 driver initialized\n"); + #endif + eeconfig_debug_haptic(); +} + +void haptic_task(void) { + #ifdef SOLENOID_ENABLE + solenoid_check(); + #endif +} + +void eeconfig_debug_haptic(void) { + dprintf("haptic_config eprom\n"); + dprintf("haptic_config.enable = %d\n", haptic_config.enable); + dprintf("haptic_config.mode = %d\n", haptic_config.mode); +} + +void haptic_enable(void) { + haptic_config.enable = 1; + xprintf("haptic_config.enable = %u\n", haptic_config.enable); + eeconfig_update_haptic(haptic_config.raw); +} + +void haptic_disable(void) { + haptic_config.enable = 0; + xprintf("haptic_config.enable = %u\n", haptic_config.enable); + eeconfig_update_haptic(haptic_config.raw); +} + +void haptic_toggle(void) { +if (haptic_config.enable) { + haptic_disable(); + } else { + haptic_enable(); + } + eeconfig_update_haptic(haptic_config.raw); +} + +void haptic_feedback_toggle(void){ + haptic_config.feedback++; + if (haptic_config.feedback >= HAPTIC_FEEDBACK_MAX) + haptic_config.feedback = KEY_PRESS; + xprintf("haptic_config.feedback = %u\n", !haptic_config.feedback); + eeconfig_update_haptic(haptic_config.raw); +} + +void haptic_buzz_toggle(void) { + bool buzz_stat = !haptic_config.buzz; + haptic_config.buzz = buzz_stat; + haptic_set_buzz(buzz_stat); +} + +void haptic_mode_increase(void) { + uint8_t mode = haptic_config.mode + 1; + #ifdef DRV2605L + if (haptic_config.mode >= drv_effect_max) { + mode = 1; + } + #endif + haptic_set_mode(mode); +} + +void haptic_mode_decrease(void) { + uint8_t mode = haptic_config.mode -1; + #ifdef DRV2605L + if (haptic_config.mode < 1) { + mode = (drv_effect_max - 1); + } + #endif + haptic_set_mode(mode); +} + +void haptic_dwell_increase(void) { + uint8_t dwell = haptic_config.dwell + 1; + #ifdef SOLENOID_ENABLE + if (haptic_config.dwell >= SOLENOID_MAX_DWELL) { + dwell = 1; + } + solenoid_set_dwell(dwell); + #endif + haptic_set_dwell(dwell); +} + +void haptic_dwell_decrease(void) { + uint8_t dwell = haptic_config.dwell -1; + #ifdef SOLENOID_ENABLE + if (haptic_config.dwell < SOLENOID_MIN_DWELL) { + dwell = SOLENOID_MAX_DWELL; + } + solenoid_set_dwell(dwell); + #endif + haptic_set_dwell(dwell); +} + +void haptic_reset(void){ + haptic_config.enable = true; + uint8_t feedback = HAPTIC_FEEDBACK_DEFAULT; + haptic_config.feedback = feedback; + #ifdef DRV2605L + uint8_t mode = HAPTIC_MODE_DEFAULT; + haptic_config.mode = mode; + #endif + #ifdef SOLENOID_ENABLE + uint8_t dwell = SOLENOID_DEFAULT_DWELL; + haptic_config.dwell = dwell; + #endif + eeconfig_update_haptic(haptic_config.raw); + xprintf("haptic_config.feedback = %u\n", haptic_config.feedback); + xprintf("haptic_config.mode = %u\n", haptic_config.mode); +} + +void haptic_set_feedback(uint8_t feedback) { + haptic_config.feedback = feedback; + eeconfig_update_haptic(haptic_config.raw); + xprintf("haptic_config.feedback = %u\n", haptic_config.feedback); +} + +void haptic_set_mode(uint8_t mode) { + haptic_config.mode = mode; + eeconfig_update_haptic(haptic_config.raw); + xprintf("haptic_config.mode = %u\n", haptic_config.mode); +} + +void haptic_set_buzz(uint8_t buzz) { + haptic_config.buzz = buzz; + eeconfig_update_haptic(haptic_config.raw); + xprintf("haptic_config.buzz = %u\n", haptic_config.buzz); +} + +void haptic_set_dwell(uint8_t dwell) { + haptic_config.dwell = dwell; + eeconfig_update_haptic(haptic_config.raw); + xprintf("haptic_config.dwell = %u\n", haptic_config.dwell); +} + +uint8_t haptic_get_mode(void) { + if (!haptic_config.enable){ + return false; + } + return haptic_config.mode; +} + +uint8_t haptic_get_feedback(void) { + if (!haptic_config.enable){ + return false; + } + return haptic_config.feedback; +} + +uint8_t haptic_get_dwell(void) { + if (!haptic_config.enable){ + return false; + } + return haptic_config.dwell; +} + +void haptic_play(void) { + #ifdef DRV2605L + uint8_t play_eff = 0; + play_eff = haptic_config.mode; + DRV_pulse(play_eff); + #endif + #ifdef SOLENOID_ENABLE + solenoid_fire(); + #endif +} + +bool process_haptic(uint16_t keycode, keyrecord_t *record) { + if (keycode == HPT_ON && record->event.pressed) { haptic_enable(); } + if (keycode == HPT_OFF && record->event.pressed) { haptic_disable(); } + if (keycode == HPT_TOG && record->event.pressed) { haptic_toggle(); } + if (keycode == HPT_RST && record->event.pressed) { haptic_reset(); } + if (keycode == HPT_FBK && record->event.pressed) { haptic_feedback_toggle(); } + if (keycode == HPT_BUZ && record->event.pressed) { haptic_buzz_toggle(); } + if (keycode == HPT_MODI && record->event.pressed) { haptic_mode_increase(); } + if (keycode == HPT_MODD && record->event.pressed) { haptic_mode_decrease(); } + if (keycode == HPT_DWLI && record->event.pressed) { haptic_dwell_increase(); } + if (keycode == HPT_DWLD && record->event.pressed) { haptic_dwell_decrease(); } + if (haptic_config.enable) { + if ( record->event.pressed ) { + // keypress + if (haptic_config.feedback < 2) { + haptic_play(); + } + } else { + //keyrelease + if (haptic_config.feedback > 0) { + haptic_play(); + } + } + } + return true; +} + +void haptic_shutdown(void) { + #ifdef SOLENOID_ENABLE + solenoid_shutdown(); + #endif + +} diff --git a/drivers/haptic/haptic.h b/drivers/haptic/haptic.h new file mode 100644 index 00000000000..d39dc5c3b9d --- /dev/null +++ b/drivers/haptic/haptic.h @@ -0,0 +1,82 @@ +/* Copyright 2019 ishtob + * Driver for haptic feedback written for QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include +#include +#include "quantum.h" +#ifdef DRV2605L +#include "DRV2605L.h" +#endif + + +#ifndef HAPTIC_FEEDBACK_DEFAULT +#define HAPTIC_FEEDBACK_DEFAULT 0 +#endif +#ifndef HAPTIC_MODE_DEFAULT +#define HAPTIC_MODE_DEFAULT DRV_MODE_DEFAULT +#endif + +/* EEPROM config settings */ +typedef union { + uint32_t raw; + struct { + bool enable :1; + uint8_t feedback :2; + uint8_t mode :7; + bool buzz :1; + uint8_t dwell :7; + uint16_t reserved :16; + }; +} haptic_config_t; + +typedef enum HAPTIC_FEEDBACK{ + KEY_PRESS, + KEY_PRESS_RELEASE, + KEY_RELEASE, + HAPTIC_FEEDBACK_MAX, +} HAPTIC_FEEDBACK; + +bool process_haptic(uint16_t keycode, keyrecord_t *record); +void haptic_init(void); +void haptic_task(void); +void eeconfig_debug_haptic(void); +void haptic_enable(void); +void haptic_disable(void); +void haptic_toggle(void); +void haptic_feedback_toggle(void); +void haptic_mode_increase(void); +void haptic_mode_decrease(void); +void haptic_mode(uint8_t mode); +void haptic_reset(void); +void haptic_set_feedback(uint8_t feedback); +void haptic_set_mode(uint8_t mode); +void haptic_set_dwell(uint8_t dwell); +void haptic_set_buzz(uint8_t buzz); +void haptic_buzz_toggle(void); +uint8_t haptic_get_mode(void); +uint8_t haptic_get_feedback(void); +void haptic_dwell_increase(void); +void haptic_dwell_decrease(void); + +void haptic_play(void); +void haptic_shutdown(void); + + + + + diff --git a/drivers/haptic/solenoid.c b/drivers/haptic/solenoid.c new file mode 100644 index 00000000000..2d39dbc1794 --- /dev/null +++ b/drivers/haptic/solenoid.c @@ -0,0 +1,109 @@ +/* Copyright 2018 mtdjr - modified by ishtob + * Driver for solenoid written for QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include "solenoid.h" +#include "haptic.h" + +bool solenoid_on = false; +bool solenoid_buzzing = false; +uint16_t solenoid_start = 0; +uint8_t solenoid_dwell = SOLENOID_DEFAULT_DWELL; + +extern haptic_config_t haptic_config; + + +void solenoid_buzz_on(void) { + haptic_set_buzz(1); +} + +void solenoid_buzz_off(void) { + haptic_set_buzz(0); +} + +void solenoid_set_buzz(int buzz) { + haptic_set_buzz(buzz); +} + + +void solenoid_dwell_minus(uint8_t solenoid_dwell) { + if (solenoid_dwell > 0) solenoid_dwell--; +} + +void solenoid_dwell_plus(uint8_t solenoid_dwell) { + if (solenoid_dwell < SOLENOID_MAX_DWELL) solenoid_dwell++; +} + +void solenoid_set_dwell(uint8_t dwell) { + solenoid_dwell = dwell; +} + +void solenoid_stop(void) { + writePinLow(SOLENOID_PIN); + solenoid_on = false; + solenoid_buzzing = false; +} + +void solenoid_fire(void) { + if (!haptic_config.buzz && solenoid_on) return; + if (haptic_config.buzz && solenoid_buzzing) return; + + solenoid_on = true; + solenoid_buzzing = true; + solenoid_start = timer_read(); + writePinHigh(SOLENOID_PIN); +} + +void solenoid_check(void) { + uint16_t elapsed = 0; + + if (!solenoid_on) return; + + elapsed = timer_elapsed(solenoid_start); + + //Check if it's time to finish this solenoid click cycle + if (elapsed > solenoid_dwell) { + solenoid_stop(); + return; + } + + //Check whether to buzz the solenoid on and off + if (haptic_config.buzz) { + if (elapsed / SOLENOID_MIN_DWELL % 2 == 0){ + if (!solenoid_buzzing) { + solenoid_buzzing = true; + writePinHigh(SOLENOID_PIN); + } + } + else { + if (solenoid_buzzing) { + solenoid_buzzing = false; + writePinLow(SOLENOID_PIN); + } + } + } +} + +void solenoid_setup(void) { + setPinOutput(SOLENOID_PIN); + solenoid_fire(); +} + +void solenoid_shutdown(void) { + writePinLow(SOLENOID_PIN); + +} diff --git a/drivers/haptic/solenoid.h b/drivers/haptic/solenoid.h new file mode 100644 index 00000000000..a08f62a11ee --- /dev/null +++ b/drivers/haptic/solenoid.h @@ -0,0 +1,54 @@ +/* Copyright 2018 mtdjr - modified by ishtob + * Driver for solenoid written for QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#ifndef SOLENOID_DEFAULT_DWELL +#define SOLENOID_DEFAULT_DWELL 12 +#endif + +#ifndef SOLENOID_MAX_DWELL +#define SOLENOID_MAX_DWELL 100 +#endif + +#ifndef SOLENOID_MIN_DWELL +#define SOLENOID_MIN_DWELL 4 +#endif + +#ifndef SOLENOID_ACTIVE +#define SOLENOID_ACTIVE false +#endif + +#ifndef SOLENOID_PIN +#define SOLENOID_PIN F6 +#endif + +void solenoid_buzz_on(void); +void solenoid_buzz_off(void); +void solenoid_set_buzz(int buzz); + +void solenoid_dwell_minus(uint8_t solenoid_dwell); +void solenoid_dwell_plus(uint8_t solenoid_dwell); +void solenoid_set_dwell(uint8_t dwell); + +void solenoid_stop(void); +void solenoid_fire(void); + +void solenoid_check(void); + +void solenoid_setup(void); +void solenoid_shutdown(void); diff --git a/drivers/issi/is31fl3731-simple.c b/drivers/issi/is31fl3731-simple.c new file mode 100644 index 00000000000..a7faa9c38c0 --- /dev/null +++ b/drivers/issi/is31fl3731-simple.c @@ -0,0 +1,246 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2019 Clueboard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef __AVR__ +#include +#include +#include +#else +#include "wait.h" +#endif + +#include +#include +#include +#include "is31fl3731-simple.h" +#include "i2c_master.h" +#include "progmem.h" +#include "print.h" + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 0b1110100 AD <-> GND +// 0b1110111 AD <-> VCC +// 0b1110101 AD <-> SCL +// 0b1110110 AD <-> SDA +#define ISSI_ADDR_DEFAULT 0x74 + +#define ISSI_REG_CONFIG 0x00 +#define ISSI_REG_CONFIG_PICTUREMODE 0x00 +#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 +#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 + +#define ISSI_CONF_PICTUREMODE 0x00 +#define ISSI_CONF_AUTOFRAMEMODE 0x04 +#define ISSI_CONF_AUDIOMODE 0x08 + +#define ISSI_REG_PICTUREFRAME 0x01 + +#define ISSI_REG_SHUTDOWN 0x0A +#define ISSI_REG_AUDIOSYNC 0x06 + +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' + +#ifndef ISSI_TIMEOUT + #define ISSI_TIMEOUT 100 +#endif + +#ifndef ISSI_PERSISTENCE + #define ISSI_PERSISTENCE 0 +#endif + +// Transfer buffer for TWITransmitData() +uint8_t g_twi_transfer_buffer[20]; + +// These buffers match the IS31FL3731 PWM registers 0x24-0xB3. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's +// probably not worth the extra complexity. +uint8_t g_pwm_buffer[LED_DRIVER_COUNT][144]; +bool g_pwm_buffer_update_required = false; + +/* There's probably a better way to init this... */ +#if LED_DRIVER_COUNT == 1 + uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}}; +#elif LED_DRIVER_COUNT == 2 + uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}}; +#elif LED_DRIVER_COUNT == 3 + uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}}; +#elif LED_DRIVER_COUNT == 4 + uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}, {0}}; +#endif +bool g_led_control_registers_update_required = false; + +// This is the bit pattern in the LED control registers +// (for matrix A, add one to register for matrix B) +// +// reg - b7 b6 b5 b4 b3 b2 b1 b0 +// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01 +// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00 +// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00 +// 0x06 - - , - , - , - , - ,B02,B01,B00 +// 0x08 - - , - , - , - , - , - , - , - +// 0x0A - B17,B16,B15, - , - , - , - , - +// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09 +// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09 +// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09 + + +void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data) { + g_twi_transfer_buffer[0] = reg; + g_twi_transfer_buffer[1] = data; + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) { + break; + } + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + #endif +} + +void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { + // assumes bank is already selected + + // transmit PWM registers in 9 transfers of 16 bytes + // g_twi_transfer_buffer[] is 20 bytes + + // iterate over the pwm_buffer contents at 16 byte intervals + for (int i = 0; i < 144; i += 16) { + // set the first register, e.g. 0x24, 0x34, 0x44, etc. + g_twi_transfer_buffer[0] = 0x24 + i; + // copy the data from i to i+15 + // device will auto-increment register for data after the first byte + // thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer + for (int j = 0; j < 16; j++) { + g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; + } + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); + #endif + } +} + +void IS31FL3731_init(uint8_t addr) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, first enable software shutdown, + // then set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + // select "function register" bank + IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG); + + // enable software shutdown + IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00); + // this delay was copied from other drivers, might not be needed + wait_ms(10); + + // picture mode + IS31FL3731_write_register(addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE); + // display frame 0 + IS31FL3731_write_register(addr, ISSI_REG_PICTUREFRAME, 0x00); + // audio sync off + IS31FL3731_write_register(addr, ISSI_REG_AUDIOSYNC, 0x00); + + // select bank 0 + IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0); + + // turn off all LEDs in the LED control register + for (int i = 0x00; i <= 0x11; i++) { + IS31FL3731_write_register(addr, i, 0x00); + } + + // turn off all LEDs in the blink control register (not really needed) + for (int i = 0x12; i <= 0x23; i++) { + IS31FL3731_write_register(addr, i, 0x00); + } + + // set PWM on all LEDs to 0 + for (int i = 0x24; i <= 0xB3; i++) { + IS31FL3731_write_register(addr, i, 0x00); + } + + // select "function register" bank + IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG); + + // disable software shutdown + IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x01); + + // select bank 0 and leave it selected. + // most usage after initialization is just writing PWM buffers in bank 0 + // as there's not much point in double-buffering + IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0); + +} + +void IS31FL3731_set_value(int index, uint8_t value) { + if (index >= 0 && index < LED_DRIVER_LED_COUNT) { + is31_led led = g_is31_leds[index]; + + // Subtract 0x24 to get the second index of g_pwm_buffer + g_pwm_buffer[led.driver][led.v - 0x24] = value; + g_pwm_buffer_update_required = true; + } +} + +void IS31FL3731_set_value_all(uint8_t value) { + for (int i = 0; i < LED_DRIVER_LED_COUNT; i++) { + IS31FL3731_set_value(i, value); + } +} + +void IS31FL3731_set_led_control_register(uint8_t index, bool value) { + is31_led led = g_is31_leds[index]; + + uint8_t control_register = (led.v - 0x24) / 8; + uint8_t bit_value = (led.v - 0x24) % 8; + + if (value) { + g_led_control_registers[led.driver][control_register] |= (1 << bit_value); + } else { + g_led_control_registers[led.driver][control_register] &= ~(1 << bit_value); + } + + g_led_control_registers_update_required = true; +} + +void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index) { + if (g_pwm_buffer_update_required) { + IS31FL3731_write_pwm_buffer(addr, g_pwm_buffer[index]); + g_pwm_buffer_update_required = false; + } +} + +void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index) { + if (g_led_control_registers_update_required) { + for (int i=0; i<18; i++) { + IS31FL3731_write_register(addr, i, g_led_control_registers[index][i]); + } + } +} diff --git a/drivers/issi/is31fl3731-simple.h b/drivers/issi/is31fl3731-simple.h new file mode 100644 index 00000000000..dbe49828179 --- /dev/null +++ b/drivers/issi/is31fl3731-simple.h @@ -0,0 +1,210 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2019 Clueboard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#ifndef IS31FL3731_DRIVER_H +#define IS31FL3731_DRIVER_H + + +typedef struct is31_led { + uint8_t driver:2; + uint8_t v; +} __attribute__((packed)) is31_led; + +extern const is31_led g_is31_leds[LED_DRIVER_LED_COUNT]; + +void IS31FL3731_init(uint8_t addr); +void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data); +void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); + +void IS31FL3731_set_value(int index, uint8_t value); +void IS31FL3731_set_value_all(uint8_t value); + +void IS31FL3731_set_led_control_register(uint8_t index, bool value); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index); +void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index); + +#define C1_1 0x24 +#define C1_2 0x25 +#define C1_3 0x26 +#define C1_4 0x27 +#define C1_5 0x28 +#define C1_6 0x29 +#define C1_7 0x2A +#define C1_8 0x2B + +#define C1_9 0x2C +#define C1_10 0x2D +#define C1_11 0x2E +#define C1_12 0x2F +#define C1_13 0x30 +#define C1_14 0x31 +#define C1_15 0x32 +#define C1_16 0x33 + +#define C2_1 0x34 +#define C2_2 0x35 +#define C2_3 0x36 +#define C2_4 0x37 +#define C2_5 0x38 +#define C2_6 0x39 +#define C2_7 0x3A +#define C2_8 0x3B + +#define C2_9 0x3C +#define C2_10 0x3D +#define C2_11 0x3E +#define C2_12 0x3F +#define C2_13 0x40 +#define C2_14 0x41 +#define C2_15 0x42 +#define C2_16 0x43 + +#define C3_1 0x44 +#define C3_2 0x45 +#define C3_3 0x46 +#define C3_4 0x47 +#define C3_5 0x48 +#define C3_6 0x49 +#define C3_7 0x4A +#define C3_8 0x4B + +#define C3_9 0x4C +#define C3_10 0x4D +#define C3_11 0x4E +#define C3_12 0x4F +#define C3_13 0x50 +#define C3_14 0x51 +#define C3_15 0x52 +#define C3_16 0x53 + +#define C4_1 0x54 +#define C4_2 0x55 +#define C4_3 0x56 +#define C4_4 0x57 +#define C4_5 0x58 +#define C4_6 0x59 +#define C4_7 0x5A +#define C4_8 0x5B + +#define C4_9 0x5C +#define C4_10 0x5D +#define C4_11 0x5E +#define C4_12 0x5F +#define C4_13 0x60 +#define C4_14 0x61 +#define C4_15 0x62 +#define C4_16 0x63 + +#define C5_1 0x64 +#define C5_2 0x65 +#define C5_3 0x66 +#define C5_4 0x67 +#define C5_5 0x68 +#define C5_6 0x69 +#define C5_7 0x6A +#define C5_8 0x6B + +#define C5_9 0x6C +#define C5_10 0x6D +#define C5_11 0x6E +#define C5_12 0x6F +#define C5_13 0x70 +#define C5_14 0x71 +#define C5_15 0x72 +#define C5_16 0x73 + +#define C6_1 0x74 +#define C6_2 0x75 +#define C6_3 0x76 +#define C6_4 0x77 +#define C6_5 0x78 +#define C6_6 0x79 +#define C6_7 0x7A +#define C6_8 0x7B + +#define C6_9 0x7C +#define C6_10 0x7D +#define C6_11 0x7E +#define C6_12 0x7F +#define C6_13 0x80 +#define C6_14 0x81 +#define C6_15 0x82 +#define C6_16 0x83 + +#define C7_1 0x84 +#define C7_2 0x85 +#define C7_3 0x86 +#define C7_4 0x87 +#define C7_5 0x88 +#define C7_6 0x89 +#define C7_7 0x8A +#define C7_8 0x8B + +#define C7_9 0x8C +#define C7_10 0x8D +#define C7_11 0x8E +#define C7_12 0x8F +#define C7_13 0x90 +#define C7_14 0x91 +#define C7_15 0x92 +#define C7_16 0x93 + +#define C8_1 0x94 +#define C8_2 0x95 +#define C8_3 0x96 +#define C8_4 0x97 +#define C8_5 0x98 +#define C8_6 0x99 +#define C8_7 0x9A +#define C8_8 0x9B + +#define C8_9 0x9C +#define C8_10 0x9D +#define C8_11 0x9E +#define C8_12 0x9F +#define C8_13 0xA0 +#define C8_14 0xA1 +#define C8_15 0xA2 +#define C8_16 0xA3 + +#define C9_1 0xA4 +#define C9_2 0xA5 +#define C9_3 0xA6 +#define C9_4 0xA7 +#define C9_5 0xA8 +#define C9_6 0xA9 +#define C9_7 0xAA +#define C9_8 0xAB + +#define C9_9 0xAC +#define C9_10 0xAD +#define C9_11 0xAE +#define C9_12 0xAF +#define C9_13 0xB0 +#define C9_14 0xB1 +#define C9_15 0xB2 +#define C9_16 0xB3 + + +#endif // IS31FL3731_DRIVER_H diff --git a/drivers/issi/is31fl3731.c b/drivers/issi/is31fl3731.c index c9155f5a373..30c7dd0530c 100644 --- a/drivers/issi/is31fl3731.c +++ b/drivers/issi/is31fl3731.c @@ -71,10 +71,10 @@ uint8_t g_twi_transfer_buffer[20]; // buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's // probably not worth the extra complexity. uint8_t g_pwm_buffer[DRIVER_COUNT][144]; -bool g_pwm_buffer_update_required = false; +bool g_pwm_buffer_update_required[DRIVER_COUNT] = { false }; uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } }; -bool g_led_control_registers_update_required = false; +bool g_led_control_registers_update_required[DRIVER_COUNT] = { false }; // This is the bit pattern in the LED control registers // (for matrix A, add one to register for matrix B) @@ -204,7 +204,7 @@ void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) g_pwm_buffer[led.driver][led.r - 0x24] = red; g_pwm_buffer[led.driver][led.g - 0x24] = green; g_pwm_buffer[led.driver][led.b - 0x24] = blue; - g_pwm_buffer_update_required = true; + g_pwm_buffer_update_required[led.driver] = true; } } @@ -220,12 +220,12 @@ void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, b { is31_led led = g_is31_leds[index]; - uint8_t control_register_r = (led.r - 0x24) / 8; - uint8_t control_register_g = (led.g - 0x24) / 8; - uint8_t control_register_b = (led.b - 0x24) / 8; - uint8_t bit_r = (led.r - 0x24) % 8; - uint8_t bit_g = (led.g - 0x24) % 8; - uint8_t bit_b = (led.b - 0x24) % 8; + uint8_t control_register_r = (led.r - 0x24) / 8; + uint8_t control_register_g = (led.g - 0x24) / 8; + uint8_t control_register_b = (led.b - 0x24) / 8; + uint8_t bit_r = (led.r - 0x24) % 8; + uint8_t bit_g = (led.g - 0x24) % 8; + uint8_t bit_b = (led.b - 0x24) % 8; if ( red ) { g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); @@ -243,28 +243,26 @@ void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, b g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); } - g_led_control_registers_update_required = true; + g_led_control_registers_update_required[led.driver] = true; } -void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) +void IS31FL3731_update_pwm_buffers( uint8_t addr, uint8_t index ) { - if ( g_pwm_buffer_update_required ) + if ( g_pwm_buffer_update_required[index] ) { - IS31FL3731_write_pwm_buffer( addr1, g_pwm_buffer[0] ); - IS31FL3731_write_pwm_buffer( addr2, g_pwm_buffer[1] ); + IS31FL3731_write_pwm_buffer( addr, g_pwm_buffer[index] ); } - g_pwm_buffer_update_required = false; + g_pwm_buffer_update_required[index] = false; } -void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) +void IS31FL3731_update_led_control_registers( uint8_t addr, uint8_t index ) { - if ( g_led_control_registers_update_required ) + if ( g_led_control_registers_update_required[index] ) { for ( int i=0; i<18; i++ ) { - IS31FL3731_write_register(addr1, i, g_led_control_registers[0][i] ); - IS31FL3731_write_register(addr2, i, g_led_control_registers[1][i] ); + IS31FL3731_write_register( addr, i, g_led_control_registers[index][i] ); } } } diff --git a/drivers/issi/is31fl3731.h b/drivers/issi/is31fl3731.h index f354a12db2b..968638f86af 100644 --- a/drivers/issi/is31fl3731.h +++ b/drivers/issi/is31fl3731.h @@ -44,8 +44,8 @@ void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, b // (eg. from a timer interrupt). // Call this while idle (in between matrix scans). // If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); -void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); +void IS31FL3731_update_pwm_buffers( uint8_t addr, uint8_t index ); +void IS31FL3731_update_led_control_registers( uint8_t addr, uint8_t index ); #define C1_1 0x24 #define C1_2 0x25 diff --git a/drivers/issi/is31fl3733.c b/drivers/issi/is31fl3733.c index c198ec51746..aa247f4e8a2 100644 --- a/drivers/issi/is31fl3733.c +++ b/drivers/issi/is31fl3733.c @@ -24,10 +24,10 @@ #include "wait.h" #endif +#include "is31fl3733.h" #include #include "i2c_master.h" #include "progmem.h" -#include "rgb_matrix.h" // This is a 7-bit address, that gets left-shifted and bit 0 // set to 0 for write, 1 for read (as per I2C protocol) @@ -75,10 +75,10 @@ uint8_t g_twi_transfer_buffer[20]; // buffers and the transfers in IS31FL3733_write_pwm_buffer() but it's // probably not worth the extra complexity. uint8_t g_pwm_buffer[DRIVER_COUNT][192]; -bool g_pwm_buffer_update_required = false; +bool g_pwm_buffer_update_required[DRIVER_COUNT] = { false }; uint8_t g_led_control_registers[DRIVER_COUNT][24] = { { 0 }, { 0 } }; -bool g_led_control_registers_update_required = false; +bool g_led_control_registers_update_required[DRIVER_COUNT] = { false }; void IS31FL3733_write_register( uint8_t addr, uint8_t reg, uint8_t data ) { @@ -123,12 +123,13 @@ void IS31FL3733_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) } } -void IS31FL3733_init( uint8_t addr ) +void IS31FL3733_init( uint8_t addr, uint8_t sync) { // In order to avoid the LEDs being driven with garbage data // in the LED driver's PWM registers, shutdown is enabled last. // Set up the mode and other settings, clear the PWM registers, // then disable software shutdown. + // Sync is passed so set it according to the datasheet. // Unlock the command register. IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); @@ -161,7 +162,7 @@ void IS31FL3733_init( uint8_t addr ) // Set global current to maximum. IS31FL3733_write_register( addr, ISSI_REG_GLOBALCURRENT, 0xFF ); // Disable software shutdown. - IS31FL3733_write_register( addr, ISSI_REG_CONFIGURATION, 0x01 ); + IS31FL3733_write_register( addr, ISSI_REG_CONFIGURATION, (sync << 6) | 0x01 ); // Wait 10ms to ensure the device has woken up. #ifdef __AVR__ @@ -179,7 +180,7 @@ void IS31FL3733_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) g_pwm_buffer[led.driver][led.r] = red; g_pwm_buffer[led.driver][led.g] = green; g_pwm_buffer[led.driver][led.b] = blue; - g_pwm_buffer_update_required = true; + g_pwm_buffer_update_required[led.driver] = true; } } @@ -218,35 +219,34 @@ void IS31FL3733_set_led_control_register( uint8_t index, bool red, bool green, b g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); } - g_led_control_registers_update_required = true; + g_led_control_registers_update_required[led.driver] = true; } -void IS31FL3733_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) +void IS31FL3733_update_pwm_buffers( uint8_t addr, uint8_t index ) { - if ( g_pwm_buffer_update_required ) + if ( g_pwm_buffer_update_required[index] ) { // Firstly we need to unlock the command register and select PG1 - IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); - IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); - IS31FL3733_write_pwm_buffer( addr1, g_pwm_buffer[0] ); - //IS31FL3733_write_pwm_buffer( addr2, g_pwm_buffer[1] ); + IS31FL3733_write_pwm_buffer( addr, g_pwm_buffer[index] ); } - g_pwm_buffer_update_required = false; + g_pwm_buffer_update_required[index] = false; } -void IS31FL3733_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) +void IS31FL3733_update_led_control_registers( uint8_t addr, uint8_t index ) { - if ( g_led_control_registers_update_required ) + if ( g_led_control_registers_update_required[index] ) { // Firstly we need to unlock the command register and select PG0 - IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); - IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); for ( int i=0; i<24; i++ ) { - IS31FL3733_write_register(addr1, i, g_led_control_registers[0][i] ); - //IS31FL3733_write_register(addr2, i, g_led_control_registers[1][i] ); + IS31FL3733_write_register(addr, i, g_led_control_registers[index][i] ); } } + g_led_control_registers_update_required[index] = false; } diff --git a/drivers/issi/is31fl3733.h b/drivers/issi/is31fl3733.h index 3d23b188aac..e117b254600 100644 --- a/drivers/issi/is31fl3733.h +++ b/drivers/issi/is31fl3733.h @@ -32,7 +32,7 @@ typedef struct is31_led { extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; -void IS31FL3733_init( uint8_t addr ); +void IS31FL3733_init( uint8_t addr, uint8_t sync ); void IS31FL3733_write_register( uint8_t addr, uint8_t reg, uint8_t data ); void IS31FL3733_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); @@ -45,8 +45,8 @@ void IS31FL3733_set_led_control_register( uint8_t index, bool red, bool green, b // (eg. from a timer interrupt). // Call this while idle (in between matrix scans). // If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3733_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); -void IS31FL3733_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); +void IS31FL3733_update_pwm_buffers( uint8_t addr, uint8_t index ); +void IS31FL3733_update_led_control_registers( uint8_t addr, uint8_t index ); #define A_1 0x00 #define A_2 0x01 diff --git a/drivers/issi/is31fl3737.c b/drivers/issi/is31fl3737.c new file mode 100644 index 00000000000..6491049274b --- /dev/null +++ b/drivers/issi/is31fl3737.c @@ -0,0 +1,252 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef __AVR__ +#include +#include +#include +#else +#include "wait.h" +#endif + +#include +#include "i2c_master.h" +#include "progmem.h" +#include "rgb_matrix.h" + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 00 <-> GND +// 01 <-> SCL +// 10 <-> SDA +// 11 <-> VCC +// ADDR1 represents A1:A0 of the 7-bit address. +// ADDR2 represents A3:A2 of the 7-bit address. +// The result is: 0b101(ADDR2)(ADDR1) +#define ISSI_ADDR_DEFAULT 0x50 + +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE +#define ISSI_INTERRUPTMASKREGISTER 0xF0 +#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 + +#define ISSI_PAGE_LEDCONTROL 0x00 //PG0 +#define ISSI_PAGE_PWM 0x01 //PG1 +#define ISSI_PAGE_AUTOBREATH 0x02 //PG2 +#define ISSI_PAGE_FUNCTION 0x03 //PG3 + +#define ISSI_REG_CONFIGURATION 0x00 //PG3 +#define ISSI_REG_GLOBALCURRENT 0x01 //PG3 +#define ISSI_REG_RESET 0x11// PG3 +#define ISSI_REG_SWPULLUP 0x0F //PG3 +#define ISSI_REG_CSPULLUP 0x10 //PG3 + +#ifndef ISSI_TIMEOUT + #define ISSI_TIMEOUT 100 +#endif + +#ifndef ISSI_PERSISTENCE + #define ISSI_PERSISTENCE 0 +#endif + +// Transfer buffer for TWITransmitData() +uint8_t g_twi_transfer_buffer[20]; + +// These buffers match the IS31FL3737 PWM registers. +// The control buffers match the PG0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in IS31FL3737_write_pwm_buffer() but it's +// probably not worth the extra complexity. +uint8_t g_pwm_buffer[DRIVER_COUNT][192]; +bool g_pwm_buffer_update_required = false; + +uint8_t g_led_control_registers[DRIVER_COUNT][24] = { { 0 } }; +bool g_led_control_registers_update_required = false; + +void IS31FL3737_write_register( uint8_t addr, uint8_t reg, uint8_t data ) +{ + g_twi_transfer_buffer[0] = reg; + g_twi_transfer_buffer[1] = data; + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + #endif +} + +void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) +{ + // assumes PG1 is already selected + + // transmit PWM registers in 12 transfers of 16 bytes + // g_twi_transfer_buffer[] is 20 bytes + + // iterate over the pwm_buffer contents at 16 byte intervals + for ( int i = 0; i < 192; i += 16 ) { + g_twi_transfer_buffer[0] = i; + // copy the data from i to i+15 + // device will auto-increment register for data after the first byte + // thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer + for ( int j = 0; j < 16; j++ ) { + g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; + } + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); + #endif + } +} + +void IS31FL3737_init( uint8_t addr ) +{ + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + // Unlock the command register. + IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + + // Select PG0 + IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); + // Turn off all LEDs. + for ( int i = 0x00; i <= 0x17; i++ ) + { + IS31FL3737_write_register( addr, i, 0x00 ); + } + + // Unlock the command register. + IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + + // Select PG1 + IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); + // Set PWM on all LEDs to 0 + // No need to setup Breath registers to PWM as that is the default. + for ( int i = 0x00; i <= 0xBF; i++ ) + { + IS31FL3737_write_register( addr, i, 0x00 ); + } + + // Unlock the command register. + IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + + // Select PG3 + IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION ); + // Set global current to maximum. + IS31FL3737_write_register( addr, ISSI_REG_GLOBALCURRENT, 0xFF ); + // Disable software shutdown. + IS31FL3737_write_register( addr, ISSI_REG_CONFIGURATION, 0x01 ); + + // Wait 10ms to ensure the device has woken up. + #ifdef __AVR__ + _delay_ms( 10 ); + #else + wait_ms(10); + #endif +} + +void IS31FL3737_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ + if ( index >= 0 && index < DRIVER_LED_TOTAL ) { + is31_led led = g_is31_leds[index]; + + g_pwm_buffer[led.driver][led.r] = red; + g_pwm_buffer[led.driver][led.g] = green; + g_pwm_buffer[led.driver][led.b] = blue; + g_pwm_buffer_update_required = true; + } +} + +void IS31FL3737_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ + for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) + { + IS31FL3737_set_color( i, red, green, blue ); + } +} + +void IS31FL3737_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) +{ + is31_led led = g_is31_leds[index]; + + uint8_t control_register_r = led.r / 8; + uint8_t control_register_g = led.g / 8; + uint8_t control_register_b = led.b / 8; + uint8_t bit_r = led.r % 8; + uint8_t bit_g = led.g % 8; + uint8_t bit_b = led.b % 8; + + if ( red ) { + g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + } else { + g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + } + if ( green ) { + g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + } else { + g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + } + if ( blue ) { + g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + } else { + g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); + } + + g_led_control_registers_update_required = true; + +} + +void IS31FL3737_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_pwm_buffer_update_required ) + { + // Firstly we need to unlock the command register and select PG1 + IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); + + IS31FL3737_write_pwm_buffer( addr1, g_pwm_buffer[0] ); + //IS31FL3737_write_pwm_buffer( addr2, g_pwm_buffer[1] ); + } + g_pwm_buffer_update_required = false; +} + +void IS31FL3737_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_led_control_registers_update_required ) + { + // Firstly we need to unlock the command register and select PG0 + IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); + for ( int i=0; i<24; i++ ) + { + IS31FL3737_write_register(addr1, i, g_led_control_registers[0][i] ); + //IS31FL3737_write_register(addr2, i, g_led_control_registers[1][i] ); + } + } +} diff --git a/drivers/issi/is31fl3737.h b/drivers/issi/is31fl3737.h new file mode 100644 index 00000000000..69c4b9b538f --- /dev/null +++ b/drivers/issi/is31fl3737.h @@ -0,0 +1,207 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#ifndef IS31FL3737_DRIVER_H +#define IS31FL3737_DRIVER_H + +#include +#include + +typedef struct is31_led { + uint8_t driver:2; + uint8_t r; + uint8_t g; + uint8_t b; +} __attribute__((packed)) is31_led; + +extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; + +void IS31FL3737_init( uint8_t addr ); +void IS31FL3737_write_register( uint8_t addr, uint8_t reg, uint8_t data ); +void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); + +void IS31FL3737_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); +void IS31FL3737_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); + +void IS31FL3737_set_led_control_register( uint8_t index, bool red, bool green, bool blue ); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void IS31FL3737_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); +void IS31FL3737_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); + +#define A_1 0x00 +#define A_2 0x01 +#define A_3 0x02 +#define A_4 0x03 +#define A_5 0x04 +#define A_6 0x05 +#define A_7 0x08 +#define A_8 0x09 +#define A_9 0x0A +#define A_10 0x0B +#define A_11 0x0C +#define A_12 0x0D + +#define B_1 0x10 +#define B_2 0x11 +#define B_3 0x12 +#define B_4 0x13 +#define B_5 0x14 +#define B_6 0x15 +#define B_7 0x18 +#define B_8 0x19 +#define B_9 0x1A +#define B_10 0x1B +#define B_11 0x1C +#define B_12 0x1D + +#define C_1 0x20 +#define C_2 0x21 +#define C_3 0x22 +#define C_4 0x23 +#define C_5 0x24 +#define C_6 0x25 +#define C_7 0x28 +#define C_8 0x29 +#define C_9 0x2A +#define C_10 0x2B +#define C_11 0x2C +#define C_12 0x2D + +#define D_1 0x30 +#define D_2 0x31 +#define D_3 0x32 +#define D_4 0x33 +#define D_5 0x34 +#define D_6 0x35 +#define D_7 0x38 +#define D_8 0x39 +#define D_9 0x3A +#define D_10 0x3B +#define D_11 0x3C +#define D_12 0x3D + +#define E_1 0x40 +#define E_2 0x41 +#define E_3 0x42 +#define E_4 0x43 +#define E_5 0x44 +#define E_6 0x45 +#define E_7 0x48 +#define E_8 0x49 +#define E_9 0x4A +#define E_10 0x4B +#define E_11 0x4C +#define E_12 0x4D + +#define F_1 0x50 +#define F_2 0x51 +#define F_3 0x52 +#define F_4 0x53 +#define F_5 0x54 +#define F_6 0x55 +#define F_7 0x58 +#define F_8 0x59 +#define F_9 0x5A +#define F_10 0x5B +#define F_11 0x5C +#define F_12 0x5D + +#define G_1 0x60 +#define G_2 0x61 +#define G_3 0x62 +#define G_4 0x63 +#define G_5 0x64 +#define G_6 0x65 +#define G_7 0x68 +#define G_8 0x69 +#define G_9 0x6A +#define G_10 0x6B +#define G_11 0x6C +#define G_12 0x6D + +#define H_1 0x70 +#define H_2 0x71 +#define H_3 0x72 +#define H_4 0x73 +#define H_5 0x74 +#define H_6 0x75 +#define H_7 0x78 +#define H_8 0x79 +#define H_9 0x7A +#define H_10 0x7B +#define H_11 0x7C +#define H_12 0x7D + +#define I_1 0x80 +#define I_2 0x81 +#define I_3 0x82 +#define I_4 0x83 +#define I_5 0x84 +#define I_6 0x85 +#define I_7 0x88 +#define I_8 0x89 +#define I_9 0x8A +#define I_10 0x8B +#define I_11 0x8C +#define I_12 0x8D + +#define J_1 0x90 +#define J_2 0x91 +#define J_3 0x92 +#define J_4 0x93 +#define J_5 0x94 +#define J_6 0x95 +#define J_7 0x98 +#define J_8 0x99 +#define J_9 0x9A +#define J_10 0x9B +#define J_11 0x9C +#define J_12 0x9D + +#define K_1 0xA0 +#define K_2 0xA1 +#define K_3 0xA2 +#define K_4 0xA3 +#define K_5 0xA4 +#define K_6 0xA5 +#define K_7 0xA8 +#define K_8 0xA9 +#define K_9 0xAA +#define K_10 0xAB +#define K_11 0xAC +#define K_12 0xAD + +#define L_1 0xB0 +#define L_2 0xB1 +#define L_3 0xB2 +#define L_4 0xB3 +#define L_5 0xB4 +#define L_6 0xB5 +#define L_7 0xB8 +#define L_8 0xB9 +#define L_9 0xBA +#define L_10 0xBB +#define L_11 0xBC +#define L_12 0xBD + +#endif // IS31FL3737_DRIVER_H diff --git a/drivers/oled/glcdfont.c b/drivers/oled/glcdfont.c new file mode 100644 index 00000000000..8b969057e53 --- /dev/null +++ b/drivers/oled/glcdfont.c @@ -0,0 +1,240 @@ +#pragma once + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Helidox 8x6 font with QMK Firmware Logo +// Online editor: http://teripom.x0.com/ + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x40, 0x40, 0xF0, 0xF8, 0xF8, + 0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0x3F, + 0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8, + 0xF8, 0xF0, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, + 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, + 0x80, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, + 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, + 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xC0, 0xF0, 0xF8, 0xFC, 0x3E, + 0x1E, 0x06, 0x01, 0x00, 0x00, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x49, 0x49, 0xFF, 0xFF, 0xFF, + 0xFF, 0xE0, 0xDF, 0xBF, 0xBF, 0x00, + 0xBF, 0xBF, 0xDF, 0xE0, 0xFF, 0xFF, + 0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F, + 0x60, 0x60, 0xE0, 0xBF, 0x1F, 0x00, + 0x7F, 0x7F, 0x07, 0x1E, 0x38, 0x1E, + 0x07, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, + 0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, + 0x0C, 0x0C, 0x0C, 0x00, 0x7E, 0x7E, + 0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00, + 0x7F, 0x7E, 0x03, 0x03, 0x7E, 0x7E, + 0x03, 0x03, 0x7F, 0x7E, 0x00, 0x0F, + 0x3E, 0x70, 0x3C, 0x06, 0x3C, 0x70, + 0x3E, 0x0F, 0x00, 0x32, 0x7B, 0x49, + 0x49, 0x3F, 0x7E, 0x00, 0x7F, 0x7E, + 0x03, 0x03, 0x00, 0x1E, 0x3F, 0x69, + 0x69, 0x6F, 0x26, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x0F, 0x1F, 0x3F, 0x3C, + 0x78, 0x70, 0x60, 0x00, 0x00, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x07, 0x0F, 0x0F, + 0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x7E, + 0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F, + 0x0F, 0x07, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/drivers/oled/licenses.txt b/drivers/oled/licenses.txt new file mode 100644 index 00000000000..111603ebf3c --- /dev/null +++ b/drivers/oled/licenses.txt @@ -0,0 +1,45 @@ +The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. + + +This is the Linux-penguin again... + +Originally drewn by Larry Ewing (http://www.isc.tamu.edu/~lewing/) +(with the GIMP) the Linux Logo has been vectorized by me (Simon Budig, +http://www.home.unix-ag.org/simon/). + +This happened quite some time ago with Corel Draw 4. But luckily +meanwhile there are tools available to handle vector graphics with +Linux. Bernhard Herzog (bernhard@users.sourceforge.net) deserves kudos +for creating Sketch (http://sketch.sourceforge.net), a powerful free +tool for creating vector graphics. He converted the Corel Draw file to +the Sketch native format. Since I am unable to maintain the Corel Draw +file any longer, the Sketch version now is the "official" one. + +Anja Gerwinski (anja@gerwinski.de) has created an alternate version of +the penguin (penguin-variant.sk) with a thinner mouth line and slightly +altered gradients. It also features a nifty drop shadow. + +The third bird (penguin-flat.sk) is a version reduced to three colors +(black/white/yellow) for e.g. silk screen printing. I made this version +for a mug, available at the friendly folks at +http://www.kernelconcepts.de/ - they do good stuff, mail Petra +(pinguin@kernelconcepts.de) if you need something special or don't +understand the german :-) + +These drawings are copyrighted by Larry Ewing and Simon Budig +(penguin-variant.sk also by Anja Gerwinski), redistribution is free but +has to include this README/Copyright notice. + +The use of these drawings is free. However I am happy about a sample of +your mug/t-shirt/whatever with this penguin on it... + +Have fun + Simon Budig + + +Simon.Budig@unix-ag.org +http://www.home.unix-ag.org/simon/ + +Simon Budig +Am Hardtkoeppel 2 +D-61279 Graevenwiesbach diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c new file mode 100644 index 00000000000..2b3dd7ff2fc --- /dev/null +++ b/drivers/oled/oled_driver.c @@ -0,0 +1,565 @@ +/* +Copyright 2019 Ryan Caltabiano + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include "i2c_master.h" +#include "oled_driver.h" +#include OLED_FONT_H +#include "timer.h" +#include "print.h" + +#include + +#if defined(__AVR__) + #include + #include +#elif defined(ESP8266) + #include +#else // defined(ESP8266) + #define PROGMEM + #define memcpy_P(des, src, len) memcpy(des, src, len) +#endif // defined(__AVR__) + +// Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf +// for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf + +// Fundamental Commands +#define CONTRAST 0x81 +#define DISPLAY_ALL_ON 0xA5 +#define DISPLAY_ALL_ON_RESUME 0xA4 +#define NORMAL_DISPLAY 0xA6 +#define DISPLAY_ON 0xAF +#define DISPLAY_OFF 0xAE +#define NOP 0xE3 + +// Scrolling Commands +#define ACTIVATE_SCROLL 0x2F +#define DEACTIVATE_SCROLL 0x2E +#define SCROLL_RIGHT 0x26 +#define SCROLL_LEFT 0x27 +#define SCROLL_RIGHT_UP 0x29 +#define SCROLL_LEFT_UP 0x2A + +// Addressing Setting Commands +#define MEMORY_MODE 0x20 +#define COLUMN_ADDR 0x21 +#define PAGE_ADDR 0x22 +#define PAM_SETCOLUMN_LSB 0x00 +#define PAM_SETCOLUMN_MSB 0x10 +#define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7 + +// Hardware Configuration Commands +#define DISPLAY_START_LINE 0x40 +#define SEGMENT_REMAP 0xA0 +#define SEGMENT_REMAP_INV 0xA1 +#define MULTIPLEX_RATIO 0xA8 +#define COM_SCAN_INC 0xC0 +#define COM_SCAN_DEC 0xC8 +#define DISPLAY_OFFSET 0xD3 +#define COM_PINS 0xDA +#define COM_PINS_SEQ 0x02 +#define COM_PINS_ALT 0x12 +#define COM_PINS_SEQ_LR 0x22 +#define COM_PINS_ALT_LR 0x32 + +// Timing & Driving Commands +#define DISPLAY_CLOCK 0xD5 +#define PRE_CHARGE_PERIOD 0xD9 +#define VCOM_DETECT 0xDB + +// Charge Pump Commands +#define CHARGE_PUMP 0x8D + +// Misc defines +#define OLED_TIMEOUT 60000 +#define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) +#define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) + +// i2c defines +#define I2C_CMD 0x00 +#define I2C_DATA 0x40 +#if defined(__AVR__) + // already defined on ARM + #define I2C_TIMEOUT 100 + #define I2C_TRANSMIT_P(data) i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), I2C_TIMEOUT) +#else // defined(__AVR__) + #define I2C_TRANSMIT_P(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), I2C_TIMEOUT) +#endif // defined(__AVR__) +#define I2C_TRANSMIT(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), I2C_TIMEOUT) +#define I2C_WRITE_REG(mode, data, size) i2c_writeReg((OLED_DISPLAY_ADDRESS << 1), mode, data, size, I2C_TIMEOUT) + +#define HAS_FLAGS(bits, flags) ((bits & flags) == flags) + +// Display buffer's is the same as the OLED memory layout +// this is so we don't end up with rounding errors with +// parts of the display unusable or don't get cleared correctly +// and also allows for drawing & inverting +uint8_t oled_buffer[OLED_MATRIX_SIZE]; +uint8_t* oled_cursor; +OLED_BLOCK_TYPE oled_dirty = 0; +bool oled_initialized = false; +bool oled_active = false; +bool oled_scrolling = false; +uint8_t oled_rotation = 0; +uint8_t oled_rotation_width = 0; +#if !defined(OLED_DISABLE_TIMEOUT) + uint16_t oled_last_activity; +#endif + +// Internal variables to reduce math instructions + +#if defined(__AVR__) +// identical to i2c_transmit, but for PROGMEM since all initialization is in PROGMEM arrays currently +// probably should move this into i2c_master... +static i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) { + i2c_status_t status = i2c_start(address | I2C_WRITE, timeout); + + for (uint16_t i = 0; i < length && status >= 0; i++) { + status = i2c_write(pgm_read_byte((const char*)data++), timeout); + if (status) break; + } + + i2c_stop(); + + return status; +} +#endif + +// Flips the rendering bits for a character at the current cursor position +static void InvertCharacter(uint8_t *cursor) +{ + const uint8_t *end = cursor + OLED_FONT_WIDTH; + while (cursor < end) { + *cursor = ~(*cursor); + cursor++; + } +} + +bool oled_init(uint8_t rotation) { + oled_rotation = oled_init_user(rotation); + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + oled_rotation_width = OLED_DISPLAY_WIDTH; + } else { + oled_rotation_width = OLED_DISPLAY_HEIGHT; + } + i2c_init(); + + static const uint8_t PROGMEM display_setup1[] = { + I2C_CMD, + DISPLAY_OFF, + DISPLAY_CLOCK, 0x80, + MULTIPLEX_RATIO, OLED_DISPLAY_HEIGHT - 1, + DISPLAY_OFFSET, 0x00, + DISPLAY_START_LINE | 0x00, + CHARGE_PUMP, 0x14, +#if (OLED_IC != OLED_IC_SH1106) + // MEMORY_MODE is unsupported on SH1106 (Page Addressing only) + MEMORY_MODE, 0x00, // Horizontal addressing mode +#endif + }; + if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) { + print("oled_init cmd set 1 failed\n"); + return false; + } + + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) { + static const uint8_t PROGMEM display_normal[] = { + I2C_CMD, + SEGMENT_REMAP_INV, + COM_SCAN_DEC }; + if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) { + print("oled_init cmd normal rotation failed\n"); + return false; + } + } else { + static const uint8_t PROGMEM display_flipped[] = { + I2C_CMD, + SEGMENT_REMAP, + COM_SCAN_INC }; + if (I2C_TRANSMIT_P(display_flipped) != I2C_STATUS_SUCCESS) { + print("display_flipped failed\n"); + return false; + } + } + + static const uint8_t PROGMEM display_setup2[] = { + I2C_CMD, + COM_PINS, OLED_COM_PINS, + CONTRAST, 0x8F, + PRE_CHARGE_PERIOD, 0xF1, + VCOM_DETECT, 0x40, + DISPLAY_ALL_ON_RESUME, + NORMAL_DISPLAY, + DEACTIVATE_SCROLL, + DISPLAY_ON }; + if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) { + print("display_setup2 failed\n"); + return false; + } + + oled_clear(); + oled_initialized = true; + oled_active = true; + oled_scrolling = false; + return true; +} + +__attribute__((weak)) +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return rotation; +} + +void oled_clear(void) { + memset(oled_buffer, 0, sizeof(oled_buffer)); + oled_cursor = &oled_buffer[0]; + oled_dirty = -1; // -1 will be max value as long as display_dirty is unsigned type +} + +static void calc_bounds(uint8_t update_start, uint8_t* cmd_array) +{ + // Calculate commands to set memory addressing bounds. + uint8_t start_page = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH; + uint8_t start_column = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH; +#if (OLED_IC == OLED_IC_SH1106) + // Commands for Page Addressing Mode. Sets starting page and column; has no end bound. + // Column value must be split into high and low nybble and sent as two commands. + cmd_array[0] = PAM_PAGE_ADDR | start_page; + cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); + cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); + cmd_array[3] = NOP; + cmd_array[4] = NOP; + cmd_array[5] = NOP; +#else + // Commands for use in Horizontal Addressing mode. + cmd_array[1] = start_column; + cmd_array[4] = start_page; + cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) % OLED_DISPLAY_WIDTH + cmd_array[1]; + cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) / OLED_DISPLAY_WIDTH - 1; +#endif +} + +static void calc_bounds_90(uint8_t update_start, uint8_t* cmd_array) +{ + cmd_array[1] = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8; + cmd_array[4] = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT; + cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8 - 1 + cmd_array[1];; + cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) % OLED_DISPLAY_HEIGHT / 8; +} + +uint8_t crot(uint8_t a, int8_t n) +{ + const uint8_t mask = 0x7; + n &= mask; + return a << n | a >> (-n & mask); +} + +static void rotate_90(const uint8_t* src, uint8_t* dest) +{ + for (uint8_t i = 0, shift = 7; i < 8; ++i, --shift) { + uint8_t selector = (1 << i); + for (uint8_t j = 0; j < 8; ++j) { + dest[i] |= crot(src[j] & selector, shift - (int8_t)j); + } + } +} + +void oled_render(void) { + // Do we have work to do? + if (!oled_dirty || oled_scrolling) { + return; + } + + // Find first dirty block + uint8_t update_start = 0; + while (!(oled_dirty & (1 << update_start))) { ++update_start; } + + // Set column & page position + static uint8_t display_start[] = { + I2C_CMD, + COLUMN_ADDR, 0, OLED_DISPLAY_WIDTH - 1, + PAGE_ADDR, 0, OLED_DISPLAY_HEIGHT / 8 - 1 }; + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start + } else { + calc_bounds_90(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start + } + + // Send column & page position + if (I2C_TRANSMIT(display_start) != I2C_STATUS_SUCCESS) { + print("oled_render offset command failed\n"); + return; + } + + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + // Send render data chunk as is + if (I2C_WRITE_REG(I2C_DATA, &oled_buffer[OLED_BLOCK_SIZE * update_start], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) { + print("oled_render data failed\n"); + return; + } + } else { + // Rotate the render chunks + const static uint8_t source_map[] = OLED_SOURCE_MAP; + const static uint8_t target_map[] = OLED_TARGET_MAP; + + static uint8_t temp_buffer[OLED_BLOCK_SIZE]; + memset(temp_buffer, 0, sizeof(temp_buffer)); + for(uint8_t i = 0; i < sizeof(source_map); ++i) { + rotate_90(&oled_buffer[OLED_BLOCK_SIZE * update_start + source_map[i]], &temp_buffer[target_map[i]]); + } + + // Send render data chunk after rotating + if (I2C_WRITE_REG(I2C_DATA, &temp_buffer[0], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) { + print("oled_render90 data failed\n"); + return; + } + } + + // Turn on display if it is off + oled_on(); + + // Clear dirty flag + oled_dirty &= ~(1 << update_start); +} + +void oled_set_cursor(uint8_t col, uint8_t line) { + uint16_t index = line * oled_rotation_width + col * OLED_FONT_WIDTH; + + // Out of bounds? + if (index >= OLED_MATRIX_SIZE) { + index = 0; + } + + oled_cursor = &oled_buffer[index]; +} + +void oled_advance_page(bool clearPageRemainder) { + uint16_t index = oled_cursor - &oled_buffer[0]; + uint8_t remaining = oled_rotation_width - (index % oled_rotation_width); + + if (clearPageRemainder) { + // Remaining Char count + remaining = remaining / OLED_FONT_WIDTH; + + // Write empty character until next line + while (remaining--) + oled_write_char(' ', false); + } else { + // Next page index out of bounds? + if (index + remaining >= OLED_MATRIX_SIZE) { + index = 0; + remaining = 0; + } + + oled_cursor = &oled_buffer[index + remaining]; + } +} + +void oled_advance_char(void) { + uint16_t nextIndex = oled_cursor - &oled_buffer[0] + OLED_FONT_WIDTH; + uint8_t remainingSpace = oled_rotation_width - (nextIndex % oled_rotation_width); + + // Do we have enough space on the current line for the next character + if (remainingSpace < OLED_FONT_WIDTH) { + nextIndex += remainingSpace; + } + + // Did we go out of bounds + if (nextIndex >= OLED_MATRIX_SIZE) { + nextIndex = 0; + } + + // Update cursor position + oled_cursor = &oled_buffer[nextIndex]; +} + +// Main handler that writes character data to the display buffer +void oled_write_char(const char data, bool invert) { + // Advance to the next line if newline + if (data == '\n') { + // Old source wrote ' ' until end of line... + oled_advance_page(true); + return; + } + + if (data == '\r') { + oled_advance_page(false); + return; + } + + // copy the current render buffer to check for dirty after + static uint8_t oled_temp_buffer[OLED_FONT_WIDTH]; + memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH); + + // set the reder buffer data + uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index + if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) { + memset(oled_cursor, 0x00, OLED_FONT_WIDTH); + } else { + const uint8_t *glyph = &font[(cast_data - OLED_FONT_START) * OLED_FONT_WIDTH]; + memcpy_P(oled_cursor, glyph, OLED_FONT_WIDTH); + } + + // Invert if needed + if (invert) { + InvertCharacter(oled_cursor); + } + + // Dirty check + if (memcmp(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH)) { + uint16_t index = oled_cursor - &oled_buffer[0]; + oled_dirty |= (1 << (index / OLED_BLOCK_SIZE)); + // Edgecase check if the written data spans the 2 chunks + oled_dirty |= (1 << ((index + OLED_FONT_WIDTH) / OLED_BLOCK_SIZE)); + } + + // Finally move to the next char + oled_advance_char(); +} + +void oled_write(const char *data, bool invert) { + const char *end = data + strlen(data); + while (data < end) { + oled_write_char(*data, invert); + data++; + } +} + +void oled_write_ln(const char *data, bool invert) { + oled_write(data, invert); + oled_advance_page(true); +} + +#if defined(__AVR__) +void oled_write_P(const char *data, bool invert) { + uint8_t c = pgm_read_byte(data); + while (c != 0) { + oled_write_char(c, invert); + c = pgm_read_byte(++data); + } +} + +void oled_write_ln_P(const char *data, bool invert) { + oled_write_P(data, invert); + oled_advance_page(true); +} +#endif // defined(__AVR__) + +bool oled_on(void) { +#if !defined(OLED_DISABLE_TIMEOUT) + oled_last_activity = timer_read(); +#endif + + static const uint8_t PROGMEM display_on[] = { I2C_CMD, DISPLAY_ON }; + if (!oled_active) { + if (I2C_TRANSMIT_P(display_on) != I2C_STATUS_SUCCESS) { + print("oled_on cmd failed\n"); + return oled_active; + } + oled_active = true; + } + return oled_active; +} + +bool oled_off(void) { + static const uint8_t PROGMEM display_off[] = { I2C_CMD, DISPLAY_OFF }; + if (oled_active) { + if (I2C_TRANSMIT_P(display_off) != I2C_STATUS_SUCCESS) { + print("oled_off cmd failed\n"); + return oled_active; + } + oled_active = false; + } + return !oled_active; +} + +bool oled_scroll_right(void) { + // Dont enable scrolling if we need to update the display + // This prevents scrolling of bad data from starting the scroll too early after init + if (!oled_dirty && !oled_scrolling) { + static const uint8_t PROGMEM display_scroll_right[] = { + I2C_CMD, SCROLL_RIGHT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL }; + if (I2C_TRANSMIT_P(display_scroll_right) != I2C_STATUS_SUCCESS) { + print("oled_scroll_right cmd failed\n"); + return oled_scrolling; + } + oled_scrolling = true; + } + return oled_scrolling; +} + +bool oled_scroll_left(void) { + // Dont enable scrolling if we need to update the display + // This prevents scrolling of bad data from starting the scroll too early after init + if (!oled_dirty && !oled_scrolling) { + static const uint8_t PROGMEM display_scroll_left[] = { + I2C_CMD, SCROLL_LEFT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL }; + if (I2C_TRANSMIT_P(display_scroll_left) != I2C_STATUS_SUCCESS) { + print("oled_scroll_left cmd failed\n"); + return oled_scrolling; + } + oled_scrolling = true; + } + return oled_scrolling; +} + +bool oled_scroll_off(void) { + if (oled_scrolling) { + static const uint8_t PROGMEM display_scroll_off[] = { I2C_CMD, DEACTIVATE_SCROLL }; + if (I2C_TRANSMIT_P(display_scroll_off) != I2C_STATUS_SUCCESS) { + print("oled_scroll_off cmd failed\n"); + return oled_scrolling; + } + oled_scrolling = false; + } + return !oled_scrolling; +} + +uint8_t oled_max_chars(void) { + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + return OLED_DISPLAY_WIDTH / OLED_FONT_WIDTH; + } + return OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH; +} + +uint8_t oled_max_lines(void) { + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + return OLED_DISPLAY_HEIGHT / OLED_FONT_HEIGHT; + } + return OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT; +} + +void oled_task(void) { + if (!oled_initialized) { + return; + } + + oled_set_cursor(0, 0); + + oled_task_user(); + + // Smart render system, no need to check for dirty + oled_render(); + + // Display timeout check +#if !defined(OLED_DISABLE_TIMEOUT) + if (oled_active && timer_elapsed(oled_last_activity) > OLED_TIMEOUT) { + oled_off(); + } +#endif +} + +__attribute__((weak)) +void oled_task_user(void) { +} diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h new file mode 100644 index 00000000000..03dda2e64a5 --- /dev/null +++ b/drivers/oled/oled_driver.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 Ryan Caltabiano + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#include +#include + +// an enumeration of the chips this driver supports +#define OLED_IC_SSD1306 0 +#define OLED_IC_SH1106 1 + +#if defined(OLED_DISPLAY_CUSTOM) + // Expected user to implement the necessary defines +#elif defined(OLED_DISPLAY_128X64) + // Double height 128x64 +#ifndef OLED_DISPLAY_WIDTH + #define OLED_DISPLAY_WIDTH 128 +#endif +#ifndef OLED_DISPLAY_HEIGHT + #define OLED_DISPLAY_HEIGHT 64 +#endif +#ifndef OLED_MATRIX_SIZE + #define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 1024 (compile time mathed) +#endif +#ifndef OLED_BLOCK_TYPE + #define OLED_BLOCK_TYPE uint16_t +#endif +#ifndef OLED_BLOCK_COUNT + #define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 32 (compile time mathed) +#endif +#ifndef OLED_BLOCK_SIZE + #define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) +#endif +#ifndef OLED_COM_PINS + #define OLED_COM_PINS COM_PINS_ALT +#endif + + // For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays + // The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode +#ifndef OLED_SOURCE_MAP + #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 } +#endif +#ifndef OLED_TARGET_MAP + #define OLED_TARGET_MAP { 56, 48, 40, 32, 24, 16, 8, 0 } +#endif + // If OLED_BLOCK_TYPE is uint32_t, these tables would look like: + // #define OLED_SOURCE_MAP { 32, 40, 48, 56 } + // #define OLED_TARGET_MAP { 24, 16, 8, 0 } + // If OLED_BLOCK_TYPE is uint16_t, these tables would look like: + // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 } + // #define OLED_TARGET_MAP { 56, 48, 40, 32, 24, 16, 8, 0 } + // If OLED_BLOCK_TYPE is uint8_t, these tables would look like: + // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 } + // #define OLED_TARGET_MAP { 56, 120, 48, 112, 40, 104, 32, 96, 24, 88, 16, 80, 8, 72, 0, 64 } +#else // defined(OLED_DISPLAY_128X64) + // Default 128x32 +#ifndef OLED_DISPLAY_WIDTH + #define OLED_DISPLAY_WIDTH 128 +#endif +#ifndef OLED_DISPLAY_HEIGHT + #define OLED_DISPLAY_HEIGHT 32 +#endif +#ifndef OLED_MATRIX_SIZE + #define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 512 (compile time mathed) +#endif +#ifndef OLED_BLOCK_TYPE + #define OLED_BLOCK_TYPE uint16_t // Type to use for segmenting the oled display for smart rendering, use unsigned types only +#endif +#ifndef OLED_BLOCK_COUNT + #define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 16 (compile time mathed) +#endif +#ifndef OLED_BLOCK_SIZE + #define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) +#endif +#ifndef OLED_COM_PINS + #define OLED_COM_PINS COM_PINS_SEQ +#endif + + // For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays + // The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode +#ifndef OLED_SOURCE_MAP + #define OLED_SOURCE_MAP { 0, 8, 16, 24 } +#endif +#ifndef OLED_TARGET_MAP + #define OLED_TARGET_MAP { 24, 16, 8, 0 } +#endif + // If OLED_BLOCK_TYPE is uint8_t, these tables would look like: + // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 } + // #define OLED_TARGET_MAP { 48, 32, 16, 0, 56, 40, 24, 8 } +#endif // defined(OLED_DISPLAY_CUSTOM) + +#if !defined(OLED_IC) + #define OLED_IC OLED_IC_SSD1306 +#endif + +// the column address corresponding to the first column in the display hardware +#if !defined(OLED_COLUMN_OFFSET) + #define OLED_COLUMN_OFFSET 0 +#endif + +// Address to use for the i2c oled communication +#if !defined(OLED_DISPLAY_ADDRESS) + #define OLED_DISPLAY_ADDRESS 0x3C +#endif + +// Custom font file to use +#if !defined(OLED_FONT_H) + #define OLED_FONT_H "glcdfont.c" +#endif +// unsigned char value of the first character in the font file +#if !defined(OLED_FONT_START) + #define OLED_FONT_START 0 +#endif +// unsigned char value of the last character in the font file +#if !defined(OLED_FONT_END) + #define OLED_FONT_END 224 +#endif +// Font render width +#if !defined(OLED_FONT_WIDTH) + #define OLED_FONT_WIDTH 6 +#endif +// Font render height +#if !defined(OLED_FONT_HEIGHT) + #define OLED_FONT_HEIGHT 8 +#endif + +// OLED Rotation enum values are flags +typedef enum { + OLED_ROTATION_0 = 0, + OLED_ROTATION_90 = 1, + OLED_ROTATION_180 = 2, + OLED_ROTATION_270 = 3, // OLED_ROTATION_90 | OLED_ROTATION_180 +} oled_rotation_t; + +// Initialize the oled display, rotating the rendered output based on the define passed in. +// Returns true if the OLED was initialized successfully +bool oled_init(oled_rotation_t rotation); + +// Called at the start of oled_init, weak function overridable by the user +// rotation - the value passed into oled_init +// Return new oled_rotation_t if you want to override default rotation +oled_rotation_t oled_init_user(oled_rotation_t rotation); + +// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering +void oled_clear(void); + +// Renders the dirty chunks of the buffer to oled display +void oled_render(void); + +// Moves cursor to character position indicated by column and line, wraps if out of bounds +// Max column denoted by 'oled_max_chars()' and max lines by 'oled_max_lines()' functions +void oled_set_cursor(uint8_t col, uint8_t line); + +// Advances the cursor to the next page, writing ' ' if true +// Wraps to the begining when out of bounds +void oled_advance_page(bool clearPageRemainder); + +// Moves the cursor forward 1 character length +// Advance page if there is not enough room for the next character +// Wraps to the begining when out of bounds +void oled_advance_char(void); + +// Writes a single character to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +// Main handler that writes character data to the display buffer +void oled_write_char(const char data, bool invert); + +// Writes a string to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +void oled_write(const char *data, bool invert); + +// Writes a string to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +// Advances the cursor to the next page, wiring ' ' to the remainder of the current page +void oled_write_ln(const char *data, bool invert); + +#if defined(__AVR__) +// Writes a PROGMEM string to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +// Remapped to call 'void oled_write(const char *data, bool invert);' on ARM +void oled_write_P(const char *data, bool invert); + +// Writes a PROGMEM string to the buffer at current cursor position +// Advances the cursor while writing, inverts the pixels if true +// Advances the cursor to the next page, wiring ' ' to the remainder of the current page +// Remapped to call 'void oled_write_ln(const char *data, bool invert);' on ARM +void oled_write_ln_P(const char *data, bool invert); +#else + // Writes a string to the buffer at current cursor position + // Advances the cursor while writing, inverts the pixels if true + #define oled_write_P(data, invert) oled_write(data, invert) + + // Writes a string to the buffer at current cursor position + // Advances the cursor while writing, inverts the pixels if true + // Advances the cursor to the next page, wiring ' ' to the remainder of the current page + #define oled_write_ln_P(data, invert) oled_write(data, invert) +#endif // defined(__AVR__) + +// Can be used to manually turn on the screen if it is off +// Returns true if the screen was on or turns on +bool oled_on(void); + +// Can be used to manually turn off the screen if it is on +// Returns true if the screen was off or turns off +bool oled_off(void); + +// Basically it's oled_render, but with timeout management and oled_task_user calling! +void oled_task(void); + +// Called at the start of oled_task, weak function overridable by the user +void oled_task_user(void); + +// Scrolls the entire display right +// Returns true if the screen was scrolling or starts scrolling +// NOTE: display contents cannot be changed while scrolling +bool oled_scroll_right(void); + +// Scrolls the entire display left +// Returns true if the screen was scrolling or starts scrolling +// NOTE: display contents cannot be changed while scrolling +bool oled_scroll_left(void); + +// Turns off display scrolling +// Returns true if the screen was not scrolling or stops scrolling +bool oled_scroll_off(void); + +// Returns the maximum number of characters that will fit on a line +uint8_t oled_max_chars(void); + +// Returns the maximum number of lines that will fit on the oled +uint8_t oled_max_lines(void); diff --git a/drivers/qwiic/micro_oled.c b/drivers/qwiic/micro_oled.c new file mode 100644 index 00000000000..092dd551e38 --- /dev/null +++ b/drivers/qwiic/micro_oled.c @@ -0,0 +1,691 @@ +/* Jim Lindblom @ SparkFun Electronics + * October 26, 2014 + * https://github.com/sparkfun/Micro_OLED_Breakout/tree/master/Firmware/Arduino/libraries/SFE_MicroOLED + * + * Modified by: + * Emil Varughese @ Edwin Robotics Pvt. Ltd. + * July 27, 2015 + * https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/ + * + * This code was heavily based around the MicroView library, written by GeekAmmo + * (https://github.com/geekammo/MicroView-Arduino-Library). + * + * Adapted for QMK by: + * Jack Humbert + * October 11, 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "micro_oled.h" +#include +#include +#include "util/font5x7.h" +#include "util/font8x16.h" +#include "string.h" + +#define TOTALFONTS 2 +const unsigned char * fonts_pointer[]= { font5x7, font8x16 }; + +uint8_t foreColor,drawMode,fontWidth, fontHeight, fontType, fontStartChar, fontTotalChar, cursorX, cursorY; +uint16_t fontMapWidth; + +#define _BV(x) (1 << (x)) +#define swap(a, b) { uint8_t t = a; a = b; b = t; } + +uint8_t micro_oled_transfer_buffer[20]; +static uint8_t micro_oled_screen_current[LCDWIDTH*LCDWIDTH/8] = { 0 }; + +/* LCD Memory organised in 64 horizontal pixel and 6 rows of byte + B B .............B ----- + y y .............y \ + t t .............t \ + e e .............e \ + 0 1 .............63 \ + \ + D0 D0.............D0 \ + D1 D1.............D1 / ROW 0 + D2 D2.............D2 / + D3 D3.............D3 / + D4 D4.............D4 / + D5 D5.............D5 / + D6 D6.............D6 / + D7 D7.............D7 ---- + */ + +#if LCDWIDTH == 64 + #if LCDWIDTH == 48 +static uint8_t micro_oled_screen_buffer[] = { +// QMK Logo - generated at http://www.majer.ch/lcd/adf_bitmap.php +//64x48 image +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, +0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, +0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, +0xF8, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFE, +0xFE, 0xF8, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x8C, 0x8C, 0x8C, 0x8C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0x8C, 0x8C, 0x8C, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF8, 0xF1, 0xE3, 0xE7, 0xCF, +0xCF, 0xCF, 0xCF, 0x00, 0x00, 0xCF, 0xCF, 0xCF, 0xC7, 0xE7, +0xE3, 0xF1, 0xF8, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, +0x06, 0x06, 0x1F, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xF8, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0x7F, 0x7F, 0x1F, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, +0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, +0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00 +}; + #endif +#elif LCDWIDTH == 128 + #if LCDHEIGHT == 32 + static uint8_t micro_oled_screen_buffer[LCDWIDTH*LCDWIDTH/8] = { +//128x32 qmk image +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0xE0, 0xFC, 0xFC, 0xE0, 0xFC, 0xFC, +0xE0, 0xF0, 0xFC, 0xE0, 0xE0, 0xFC, 0xE0, 0xE0, 0xFC, 0xFC, +0xE0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xF0, 0x10, 0x10, 0x30, 0xE0, 0x00, 0x00, +0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, +0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, +0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, +0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, +0x80, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0xB2, 0xB2, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x03, 0xFF, 0xFF, 0xFF, 0x03, +0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x03, 0xFF, 0xFF, 0xFF, +0xFF, 0xB7, 0xB2, 0xB2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x1F, 0x02, 0x02, 0x03, 0x01, 0x00, 0x06, 0x1F, 0x10, +0x10, 0x10, 0x1F, 0x06, 0x00, 0x03, 0x1E, 0x18, 0x0F, 0x01, +0x0F, 0x18, 0x1E, 0x01, 0x00, 0x0F, 0x1F, 0x12, 0x02, 0x12, +0x13, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x0E, 0x1F, 0x12, +0x02, 0x12, 0x13, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x1F, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x48, 0x4D, 0x4D, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFE, 0xF8, 0xF9, 0xF3, 0xF3, 0xC0, 0x80, 0xF3, +0xF3, 0xF3, 0xF9, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, +0x4D, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0xC0, 0x00, 0x70, 0xC0, +0x00, 0x80, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0C, +0x04, 0x04, 0x04, 0x04, 0x1C, 0xF0, 0x00, 0x00, 0xFC, 0x0C, +0x38, 0xE0, 0x00, 0x00, 0xC0, 0x38, 0x0C, 0xFC, 0x00, 0x00, +0xFC, 0xFC, 0x60, 0x90, 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x3F, +0x3F, 0x07, 0x3F, 0x3F, 0x07, 0x0F, 0x3F, 0x07, 0x07, 0x3F, +0x07, 0x07, 0x3F, 0x3F, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +0x06, 0x04, 0x04, 0x07, 0x01, 0x00, 0x00, 0x13, 0x1E, 0x03, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x04, 0x04, +0x04, 0x04, 0x07, 0x0D, 0x08, 0x00, 0x07, 0x00, 0x00, 0x01, +0x07, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x07, +0x00, 0x01, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00 + }; + #elif LCDHEIGHT == 64 + static uint8_t micro_oled_screen_buffer[LCDWIDTH*LCDWIDTH/8] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, +0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, +0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xC0, 0xC0, 0xC0, 0xC0, 0xF8, 0xFC, 0xFC, 0xFE, 0xFE, 0xFF, +0x7F, 0x7E, 0xFE, 0xFF, 0xFF, 0xFE, 0xFE, 0x7F, 0x7F, 0xFE, +0xFE, 0xFF, 0xFF, 0xFE, 0x7E, 0x7F, 0xFF, 0xFE, 0xFE, 0xFC, +0xFC, 0xF8, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x88, 0x88, 0x88, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xDD, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFE, 0xF8, 0xF0, 0xF3, 0xF3, 0xE7, 0xE7, 0x00, +0x00, 0xE7, 0xE7, 0xF3, 0xF3, 0xF0, 0xF8, 0xFE, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x99, 0x99, 0x99, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x1F, 0x3F, +0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, +0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, +0x3F, 0x3F, 0x3F, 0x1F, 0x0F, 0x01, 0x01, 0x01, 0x01, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, +0x80, 0x03, 0x03, 0x00, 0x00, 0x01, 0x03, 0x00, 0x80, 0x01, +0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xFF, 0x11, 0x11, 0x11, 0x0E, 0x00, 0x70, +0x88, 0x04, 0x04, 0x04, 0xF8, 0x00, 0x00, 0x3C, 0xE0, 0xC0, +0x38, 0x1C, 0xE0, 0x80, 0x70, 0x0C, 0x00, 0xF8, 0xAC, 0x24, +0x24, 0x3C, 0x30, 0x00, 0x00, 0xFC, 0x0C, 0x04, 0x00, 0xF8, +0xAC, 0x24, 0x24, 0x2C, 0x30, 0x00, 0x70, 0xDC, 0x04, 0x04, +0x88, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, +0x8C, 0x04, 0x04, 0xF8, 0x00, 0x04, 0x3C, 0xE0, 0x80, 0xF0, +0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x83, 0x01, 0x01, +0x01, 0x81, 0xFE, 0x3C, 0x00, 0x00, 0xFF, 0x03, 0x0E, 0x70, +0xC0, 0xE0, 0x38, 0x06, 0x03, 0xFF, 0x00, 0x00, 0xFF, 0x18, +0x38, 0x66, 0xC3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, +0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, +0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +0x01, 0x01, 0x01, 0x01, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; +//TODO: generate bitmap of QMK logo here + #endif +#else +//catchall for custom screen szies + static uint8_t micro_oled_screen_buffer[LCDWIDTH*LCDWIDTH/8] = {0}; +#endif + + + +void micro_oled_init(void) { + i2c_init(); + i2c_start(I2C_ADDRESS_SA0_1); + + // Display Init sequence for 64x48 OLED module + send_command(DISPLAYOFF); // 0xAE + + send_command(SETDISPLAYCLOCKDIV); // 0xD5 + send_command(0x80); // the suggested ratio 0x80 + + send_command(SETMULTIPLEX); // 0xA8 + send_command(LCDHEIGHT - 1); + + send_command(SETDISPLAYOFFSET); // 0xD3 + send_command(0x00); // no offset + + send_command(SETSTARTLINE | 0x00); // line #0 + + send_command(CHARGEPUMP); // enable charge pump + send_command(0x14); + + send_command(NORMALDISPLAY); // 0xA6 + send_command(DISPLAYALLONRESUME); // 0xA4 + +//display at regular orientation + send_command(SEGREMAP | 0x1); + send_command(COMSCANDEC); + +//rotate display 180 +#ifdef micro_oled_rotate_180 + send_command(SEGREMAP); + send_command(COMSCANINC); +#endif + + send_command(MEMORYMODE); + send_command(0x10); + + send_command(SETCOMPINS); // 0xDA +if (LCDHEIGHT > 32) { + send_command(0x12); +} else { + send_command(0x02); +} + send_command(SETCONTRAST); // 0x81 + send_command(0x8F); + + send_command(SETPRECHARGE); // 0xd9 + send_command(0xF1); + + send_command(SETVCOMDESELECT); // 0xDB + send_command(0x40); + + send_command(DISPLAYON); //--turn on oled panel + clear_screen(); // Erase hardware memory inside the OLED controller to avoid random data in memory. + send_buffer(); +} + +void send_command(uint8_t command) { + micro_oled_transfer_buffer[0] = I2C_COMMAND; + micro_oled_transfer_buffer[1] = command; + i2c_transmit(I2C_ADDRESS_SA0_1 << 1, micro_oled_transfer_buffer, 2, 100); +} + +void send_data(uint8_t data) { + micro_oled_transfer_buffer[0] = I2C_DATA; + micro_oled_transfer_buffer[1] = data; + i2c_transmit(I2C_ADDRESS_SA0_1 << 1, micro_oled_transfer_buffer, 2, 100); +} + +/** \brief Set SSD1306 page address. + Send page address command and address to the SSD1306 OLED controller. +*/ +void set_page_address(uint8_t address) { + address = (0xB0 | address); + send_command(address); +} + +/** \brief Set SSD1306 column address. + Send column address command and address to the SSD1306 OLED controller. +*/ +void set_column_address(uint8_t address) { + send_command( ( 0x10 | (address >> 4) ) + ((128 - LCDWIDTH) >> 8) ); + send_command( 0x0F & address ); +} + +/** \brief Clear SSD1306's memory. + To clear GDRAM inside the LCD controller. +*/ +void clear_screen(void) { + for (int i=0;i<8; i++) { + set_page_address(i); + set_column_address(0); + for (int j=0; j<0x80; j++) { + send_data(0); + } + } +} + +/** \brief Clear SSD1306's memory. + To clear GDRAM inside the LCD controller. +*/ +void clear_buffer(void) { +//384 + memset(micro_oled_screen_buffer, 0, LCDWIDTH*LCDWIDTH/8); +} + +/** \brief Invert display. + The PIXEL_ON color of the display will turn to PIXEL_OFF and the PIXEL_OFF will turn to PIXEL_ON. +*/ +void invert_screen(bool invert) { + if (invert) { + send_command(INVERTDISPLAY); + } else { + send_command(NORMALDISPLAY); + } +} + +/** \brief Set contrast. + OLED contract value from 0 to 255. Note: Contrast level is not very obvious. +*/ +void set_contrast(uint8_t contrast) { + send_command(SETCONTRAST); // 0x81 + send_command(contrast); +} + +/** \brief Transfer display buffer. + Sends the updated buffer to the controller - the current status is checked before to save i2c exectution time +*/ +void send_buffer(void) { + uint8_t i, j; + + uint8_t page_addr = 0xFF; + for (i = 0; i < LCDHEIGHT/8; i++) { + uint8_t col_addr = 0xFF; + for (j = 0; j < LCDWIDTH; j++) { + if (micro_oled_screen_buffer[i*LCDWIDTH+j] != micro_oled_screen_current[i*LCDWIDTH+j]) { + if (page_addr != i) { + set_page_address(i); + } + if (col_addr != j) { + set_column_address(j); + } + send_data(micro_oled_screen_buffer[i*LCDWIDTH+j]); + micro_oled_screen_current[i*LCDWIDTH+j] = micro_oled_screen_buffer[i*LCDWIDTH+j]; + col_addr = j + 1; + } + } + } +} + +/** \brief Draw pixel with color and mode. + Draw color pixel in the screen buffer's x,y position with NORM or XOR draw mode. +*/ +void draw_pixel(uint8_t x, uint8_t y, uint8_t color, uint8_t mode) { + if ((x<0) || (x>=LCDWIDTH) || (y<0) || (y>=LCDHEIGHT)) + return; + + if (mode == XOR) { + if (color == PIXEL_ON) + micro_oled_screen_buffer[x + (y/8)*LCDWIDTH] ^= _BV((y%8)); + } else { + if (color == PIXEL_ON) + micro_oled_screen_buffer[x + (y/8)*LCDWIDTH] |= _BV((y%8)); + else + micro_oled_screen_buffer[x + (y/8)*LCDWIDTH] &= ~_BV((y%8)); + } +} + +/** \brief Draw line with color and mode. +Draw line using color and mode from x0,y0 to x1,y1 of the screen buffer. +*/ +void draw_line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, uint8_t mode) { + uint8_t steep = abs(y1 - y0) > abs(x1 - x0); + if (steep) { + swap(x0, y0); + swap(x1, y1); + } + + if (x0 > x1) { + swap(x0, x1); + swap(y0, y1); + } + + uint8_t dx, dy; + dx = x1 - x0; + dy = abs(y1 - y0); + + int8_t err = dx / 2; + int8_t ystep; + + if (y0 < y1) { + ystep = 1; + } else { + ystep = -1;} + + for (; x0=TOTALFONTS) || (font<0)) + return; + + uint8_t fontType = font; + uint8_t fontWidth = pgm_read_byte(fonts_pointer[fontType]+0); + uint8_t fontHeight = pgm_read_byte(fonts_pointer[fontType]+1); + uint8_t fontStartChar = pgm_read_byte(fonts_pointer[fontType]+2); + uint8_t fontTotalChar = pgm_read_byte(fonts_pointer[fontType]+3); + uint16_t fontMapWidth = (pgm_read_byte(fonts_pointer[fontType]+4)*100)+pgm_read_byte(fonts_pointer[fontType]+5); // two bytes values into integer 16 + + if ((c(fontStartChar+fontTotalChar-1))) // no bitmap for the required c + return; + + tempC=c-fontStartChar; + + // each row (in datasheet is call page) is 8 bits high, 16 bit high character will have 2 rows to be drawn + rowsToDraw=fontHeight/8; // 8 is LCD's page size, see SSD1306 datasheet + if (rowsToDraw<=1) rowsToDraw=1; + + // the following draw function can draw anywhere on the screen, but SLOW pixel by pixel draw + if (rowsToDraw==1) { + for (i=0;i>=1; + } + } + return; + } + + // font height over 8 bit + // take character "0" ASCII 48 as example + charPerBitmapRow = fontMapWidth/fontWidth; // 256/8 =32 char per row + charColPositionOnBitmap = tempC % charPerBitmapRow; // =16 + charRowPositionOnBitmap = (int)(tempC/charPerBitmapRow); // =1 + charBitmapStartPosition = (charRowPositionOnBitmap * fontMapWidth * (fontHeight/8)) + (charColPositionOnBitmap * fontWidth) ; + + // each row on LCD is 8 bit height (see datasheet for explanation) + for(row=0;row>=1; + } + } + } + +} + +void draw_string(uint8_t x, uint8_t y, char * string, uint8_t color, uint8_t mode, uint8_t font) { + + if ((font>=TOTALFONTS) || (font<0)) + return; + + uint8_t fontType = font; + uint8_t fontWidth = pgm_read_byte(fonts_pointer[fontType]+0); + + uint8_t cur_x = x; + for (int i = 0; i < strlen(string); i++) { + draw_char(cur_x, y, string[i], color, mode, font); + cur_x += fontWidth + 1; + } + +} diff --git a/drivers/qwiic/micro_oled.h b/drivers/qwiic/micro_oled.h new file mode 100644 index 00000000000..5d6a1029ed7 --- /dev/null +++ b/drivers/qwiic/micro_oled.h @@ -0,0 +1,134 @@ +/* Jim Lindblom @ SparkFun Electronics + * October 26, 2014 + * https://github.com/sparkfun/Micro_OLED_Breakout/tree/master/Firmware/Arduino/libraries/SFE_MicroOLED + * + * Modified by: + * Emil Varughese @ Edwin Robotics Pvt. Ltd. + * July 27, 2015 + * https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/ + * + * This code was heavily based around the MicroView library, written by GeekAmmo + * (https://github.com/geekammo/MicroView-Arduino-Library). + * + * Adapted for QMK by: + * Jack Humbert + * October 11, 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "qwiic.h" + +void micro_oled_init(void); + +void send_command(uint8_t command); +void send_data(uint8_t data); +void set_page_address(uint8_t address); +void set_column_address(uint8_t address); +void clear_screen(void); +void clear_buffer(void); +void send_buffer(void); +void draw_pixel(uint8_t x, uint8_t y, uint8_t color, uint8_t mode); +void draw_line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, uint8_t mode); +void draw_line_hori(uint8_t x, uint8_t y, uint8_t width, uint8_t color, uint8_t mode); +void draw_line_vert(uint8_t x, uint8_t y, uint8_t height, bool color, uint8_t mode); +void draw_rect(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode); +void draw_rect_soft(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode); +void draw_rect_filled(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode); +void draw_rect_filled_soft(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode); +void draw_char(uint8_t x, uint8_t y, uint8_t c, uint8_t color, uint8_t mode, uint8_t font); +void draw_string(uint8_t x, uint8_t y, char * string, uint8_t color, uint8_t mode, uint8_t font); + +#define I2C_ADDRESS_SA0_0 0b0111100 +#ifndef I2C_ADDRESS_SA0_1 +#define I2C_ADDRESS_SA0_1 0b0111101 +#endif +#define I2C_COMMAND 0x00 +#define I2C_DATA 0x40 +#define PIXEL_OFF 0 +#define PIXEL_ON 1 + +#ifndef LCDWIDTH +#define LCDWIDTH 64 +#endif +#ifndef LCDWIDTH +#define LCDHEIGHT 48 +#endif +#define FONTHEADERSIZE 6 + +#define NORM 0 +#define XOR 1 + +#define PAGE 0 +#define ALL 1 + +#define WIDGETSTYLE0 0 +#define WIDGETSTYLE1 1 +#define WIDGETSTYLE2 2 + +#define SETCONTRAST 0x81 +#define DISPLAYALLONRESUME 0xA4 +#define DISPLAYALLON 0xA5 +#define NORMALDISPLAY 0xA6 +#define INVERTDISPLAY 0xA7 +#define DISPLAYOFF 0xAE +#define DISPLAYON 0xAF +#define SETDISPLAYOFFSET 0xD3 +#define SETCOMPINS 0xDA +#define SETVCOMDESELECT 0xDB +#define SETDISPLAYCLOCKDIV 0xD5 +#define SETPRECHARGE 0xD9 +#define SETMULTIPLEX 0xA8 +#define SETLOWCOLUMN 0x00 +#define SETHIGHCOLUMN 0x10 +#define SETSTARTLINE 0x40 +#define MEMORYMODE 0x20 +#define COMSCANINC 0xC0 +#define COMSCANDEC 0xC8 +#define SEGREMAP 0xA0 +#define CHARGEPUMP 0x8D +#define EXTERNALVCC 0x01 +#define SWITCHCAPVCC 0x02 + +// Scroll +#define ACTIVATESCROLL 0x2F +#define DEACTIVATESCROLL 0x2E +#define SETVERTICALSCROLLAREA 0xA3 +#define RIGHTHORIZONTALSCROLL 0x26 +#define LEFT_HORIZONTALSCROLL 0x27 +#define VERTICALRIGHTHORIZONTALSCROLL 0x29 +#define VERTICALLEFTHORIZONTALSCROLL 0x2A + +typedef enum CMD { + CMD_CLEAR, //0 + CMD_INVERT, //1 + CMD_CONTRAST, //2 + CMD_DISPLAY, //3 + CMD_SETCURSOR, //4 + CMD_PIXEL, //5 + CMD_LINE, //6 + CMD_LINEH, //7 + CMD_LINEV, //8 + CMD_RECT, //9 + CMD_RECTFILL, //10 + CMD_CIRCLE, //11 + CMD_CIRCLEFILL, //12 + CMD_DRAWCHAR, //13 + CMD_DRAWBITMAP, //14 + CMD_GETLCDWIDTH, //15 + CMD_GETLCDHEIGHT, //16 + CMD_SETCOLOR, //17 + CMD_SETDRAWMODE //18 +} commCommand_t; \ No newline at end of file diff --git a/drivers/qwiic/qwiic.c b/drivers/qwiic/qwiic.c new file mode 100644 index 00000000000..9047919927e --- /dev/null +++ b/drivers/qwiic/qwiic.c @@ -0,0 +1,31 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "qwiic.h" + +void qwiic_init(void) { + #ifdef QWIIC_JOYSTIIC_ENABLE + joystiic_init(); + #endif + #ifdef QWIIC_MICRO_OLED_ENABLE + micro_oled_init(); + #endif +} + +void qwiic_task(void) { + #ifdef QWIIC_JOYSTIIC_ENABLE + joystiic_task(); + #endif +} diff --git a/drivers/qwiic/qwiic.h b/drivers/qwiic/qwiic.h new file mode 100644 index 00000000000..160fb28dfde --- /dev/null +++ b/drivers/qwiic/qwiic.h @@ -0,0 +1,28 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "i2c_master.h" + +#ifdef QWIIC_JOYSTIIC_ENABLE + #include "joystiic.h" +#endif +#ifdef QWIIC_MICRO_OLED_ENABLE + #include "micro_oled.h" +#endif + +void qwiic_init(void); +void qwiic_task(void); diff --git a/drivers/qwiic/qwiic.mk b/drivers/qwiic/qwiic.mk new file mode 100644 index 00000000000..b23c25657de --- /dev/null +++ b/drivers/qwiic/qwiic.mk @@ -0,0 +1,16 @@ +ifneq ($(strip $(QWIIC_ENABLE)),) + COMMON_VPATH += $(DRIVER_PATH)/qwiic + OPT_DEFS += -DQWIIC_ENABLE + SRC += qwiic.c + QUANTUM_LIB_SRC += i2c_master.c +endif + +ifneq ($(filter JOYSTIIC, $(QWIIC_ENABLE)),) + OPT_DEFS += -DQWIIC_JOYSTIIC_ENABLE + SRC += joystiic.c +endif + +ifneq ($(filter MICRO_OLED, $(QWIIC_ENABLE)),) + OPT_DEFS += -DQWIIC_MICRO_OLED_ENABLE + SRC += micro_oled.c +endif diff --git a/drivers/qwiic/util/font5x7.h b/drivers/qwiic/util/font5x7.h new file mode 100644 index 00000000000..0bad206b7c7 --- /dev/null +++ b/drivers/qwiic/util/font5x7.h @@ -0,0 +1,288 @@ +/****************************************************************************** +font5x7.h +Definition for small font + +This file was imported from the MicroView library, written by GeekAmmo +(https://github.com/geekammo/MicroView-Arduino-Library), and released under +the terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Modified by: +Emil Varughese @ Edwin Robotics Pvt. Ltd. +July 27, 2015 +https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/ + +******************************************************************************/ +#pragma once + +#include "progmem.h" + +// Standard ASCII 5x7 font +static const unsigned char font5x7[] PROGMEM = { + // first row defines - FONTWIDTH, FONTHEIGHT, ASCII START CHAR, TOTAL CHARACTERS, FONT MAP WIDTH HIGH, FONT MAP WIDTH LOW (2,56 meaning 256) + 5,8,0,255,12,75, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, + 0x00, 0x18, 0x3C, 0x18, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, + 0x00, 0x18, 0x24, 0x18, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, + 0x30, 0x48, 0x3A, 0x06, 0x0E, + 0x26, 0x29, 0x79, 0x29, 0x26, + 0x40, 0x7F, 0x05, 0x05, 0x07, + 0x40, 0x7F, 0x05, 0x25, 0x3F, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, + 0x14, 0x22, 0x7F, 0x22, 0x14, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, + 0x06, 0x09, 0x7F, 0x01, 0x7F, + 0x00, 0x66, 0x89, 0x95, 0x6A, + 0x60, 0x60, 0x60, 0x60, 0x60, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, + 0x08, 0x04, 0x7E, 0x04, 0x08, + 0x10, 0x20, 0x7E, 0x20, 0x10, + 0x08, 0x08, 0x2A, 0x1C, 0x08, + 0x08, 0x1C, 0x2A, 0x08, 0x08, + 0x1E, 0x10, 0x10, 0x10, 0x10, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, + 0x30, 0x38, 0x3E, 0x38, 0x30, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, + 0x23, 0x13, 0x08, 0x64, 0x62, + 0x36, 0x49, 0x56, 0x20, 0x50, + 0x00, 0x08, 0x07, 0x03, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, + 0x08, 0x08, 0x3E, 0x08, 0x08, + 0x00, 0x80, 0x70, 0x30, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, + 0x00, 0x00, 0x60, 0x60, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, + 0x3E, 0x51, 0x49, 0x45, 0x3E, + 0x00, 0x42, 0x7F, 0x40, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, + 0x21, 0x41, 0x49, 0x4D, 0x33, + 0x18, 0x14, 0x12, 0x7F, 0x10, + 0x27, 0x45, 0x45, 0x45, 0x39, + 0x3C, 0x4A, 0x49, 0x49, 0x31, + 0x41, 0x21, 0x11, 0x09, 0x07, + 0x36, 0x49, 0x49, 0x49, 0x36, + 0x46, 0x49, 0x49, 0x29, 0x1E, + 0x00, 0x00, 0x14, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, + 0x14, 0x14, 0x14, 0x14, 0x14, + 0x00, 0x41, 0x22, 0x14, 0x08, + 0x02, 0x01, 0x59, 0x09, 0x06, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, + 0x7C, 0x12, 0x11, 0x12, 0x7C, + 0x7F, 0x49, 0x49, 0x49, 0x36, + 0x3E, 0x41, 0x41, 0x41, 0x22, + 0x7F, 0x41, 0x41, 0x41, 0x3E, + 0x7F, 0x49, 0x49, 0x49, 0x41, + 0x7F, 0x09, 0x09, 0x09, 0x01, + 0x3E, 0x41, 0x41, 0x51, 0x73, + 0x7F, 0x08, 0x08, 0x08, 0x7F, + 0x00, 0x41, 0x7F, 0x41, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, + 0x7F, 0x08, 0x14, 0x22, 0x41, + 0x7F, 0x40, 0x40, 0x40, 0x40, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, + 0x7F, 0x04, 0x08, 0x10, 0x7F, + 0x3E, 0x41, 0x41, 0x41, 0x3E, + 0x7F, 0x09, 0x09, 0x09, 0x06, + 0x3E, 0x41, 0x51, 0x21, 0x5E, + 0x7F, 0x09, 0x19, 0x29, 0x46, + 0x26, 0x49, 0x49, 0x49, 0x32, + 0x03, 0x01, 0x7F, 0x01, 0x03, + 0x3F, 0x40, 0x40, 0x40, 0x3F, + 0x1F, 0x20, 0x40, 0x20, 0x1F, + 0x3F, 0x40, 0x38, 0x40, 0x3F, + 0x63, 0x14, 0x08, 0x14, 0x63, + 0x03, 0x04, 0x78, 0x04, 0x03, + 0x61, 0x59, 0x49, 0x4D, 0x43, + 0x00, 0x7F, 0x41, 0x41, 0x41, + 0x02, 0x04, 0x08, 0x10, 0x20, + 0x00, 0x41, 0x41, 0x41, 0x7F, + 0x04, 0x02, 0x01, 0x02, 0x04, + 0x40, 0x40, 0x40, 0x40, 0x40, + 0x00, 0x03, 0x07, 0x08, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, + 0x7F, 0x28, 0x44, 0x44, 0x38, + 0x38, 0x44, 0x44, 0x44, 0x28, + 0x38, 0x44, 0x44, 0x28, 0x7F, + 0x38, 0x54, 0x54, 0x54, 0x18, + 0x00, 0x08, 0x7E, 0x09, 0x02, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, + 0x7F, 0x08, 0x04, 0x04, 0x78, + 0x00, 0x44, 0x7D, 0x40, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, + 0x7C, 0x08, 0x04, 0x04, 0x78, + 0x38, 0x44, 0x44, 0x44, 0x38, + 0xFC, 0x18, 0x24, 0x24, 0x18, + 0x18, 0x24, 0x24, 0x18, 0xFC, + 0x7C, 0x08, 0x04, 0x04, 0x08, + 0x48, 0x54, 0x54, 0x54, 0x24, + 0x04, 0x04, 0x3F, 0x44, 0x24, + 0x3C, 0x40, 0x40, 0x20, 0x7C, + 0x1C, 0x20, 0x40, 0x20, 0x1C, + 0x3C, 0x40, 0x30, 0x40, 0x3C, + 0x44, 0x28, 0x10, 0x28, 0x44, + 0x4C, 0x90, 0x90, 0x90, 0x7C, + 0x44, 0x64, 0x54, 0x4C, 0x44, + 0x00, 0x08, 0x36, 0x41, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, + 0x3C, 0x26, 0x23, 0x26, 0x3C, + 0x1E, 0xA1, 0xA1, 0x61, 0x12, + 0x3A, 0x40, 0x40, 0x20, 0x7A, + 0x38, 0x54, 0x54, 0x55, 0x59, + 0x21, 0x55, 0x55, 0x79, 0x41, + 0x21, 0x54, 0x54, 0x78, 0x41, + 0x21, 0x55, 0x54, 0x78, 0x40, + 0x20, 0x54, 0x55, 0x79, 0x40, + 0x0C, 0x1E, 0x52, 0x72, 0x12, + 0x39, 0x55, 0x55, 0x55, 0x59, + 0x39, 0x54, 0x54, 0x54, 0x59, + 0x39, 0x55, 0x54, 0x54, 0x58, + 0x00, 0x00, 0x45, 0x7C, 0x41, + 0x00, 0x02, 0x45, 0x7D, 0x42, + 0x00, 0x01, 0x45, 0x7C, 0x40, + 0xF0, 0x29, 0x24, 0x29, 0xF0, + 0xF0, 0x28, 0x25, 0x28, 0xF0, + 0x7C, 0x54, 0x55, 0x45, 0x00, + 0x20, 0x54, 0x54, 0x7C, 0x54, + 0x7C, 0x0A, 0x09, 0x7F, 0x49, + 0x32, 0x49, 0x49, 0x49, 0x32, + 0x32, 0x48, 0x48, 0x48, 0x32, + 0x32, 0x4A, 0x48, 0x48, 0x30, + 0x3A, 0x41, 0x41, 0x21, 0x7A, + 0x3A, 0x42, 0x40, 0x20, 0x78, + 0x00, 0x9D, 0xA0, 0xA0, 0x7D, + 0x39, 0x44, 0x44, 0x44, 0x39, + 0x3D, 0x40, 0x40, 0x40, 0x3D, + 0x3C, 0x24, 0xFF, 0x24, 0x24, + 0x48, 0x7E, 0x49, 0x43, 0x66, + 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, + 0xFF, 0x09, 0x29, 0xF6, 0x20, + 0xC0, 0x88, 0x7E, 0x09, 0x03, + 0x20, 0x54, 0x54, 0x79, 0x41, + 0x00, 0x00, 0x44, 0x7D, 0x41, + 0x30, 0x48, 0x48, 0x4A, 0x32, + 0x38, 0x40, 0x40, 0x22, 0x7A, + 0x00, 0x7A, 0x0A, 0x0A, 0x72, + 0x7D, 0x0D, 0x19, 0x31, 0x7D, + 0x26, 0x29, 0x29, 0x2F, 0x28, + 0x26, 0x29, 0x29, 0x29, 0x26, + 0x30, 0x48, 0x4D, 0x40, 0x20, + 0x38, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x38, + 0x2F, 0x10, 0xC8, 0xAC, 0xBA, + 0x2F, 0x10, 0x28, 0x34, 0xFA, + 0x00, 0x00, 0x7B, 0x00, 0x00, + 0x08, 0x14, 0x2A, 0x14, 0x22, + 0x22, 0x14, 0x2A, 0x14, 0x08, + 0xAA, 0x00, 0x55, 0x00, 0xAA, + 0xAA, 0x55, 0xAA, 0x55, 0xAA, + 0x00, 0x00, 0x00, 0xFF, 0x00, + 0x10, 0x10, 0x10, 0xFF, 0x00, + 0x14, 0x14, 0x14, 0xFF, 0x00, + 0x10, 0x10, 0xFF, 0x00, 0xFF, + 0x10, 0x10, 0xF0, 0x10, 0xF0, + 0x14, 0x14, 0x14, 0xFC, 0x00, + 0x14, 0x14, 0xF7, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0xFF, + 0x14, 0x14, 0xF4, 0x04, 0xFC, + 0x14, 0x14, 0x17, 0x10, 0x1F, + 0x10, 0x10, 0x1F, 0x10, 0x1F, + 0x14, 0x14, 0x14, 0x1F, 0x00, + 0x10, 0x10, 0x10, 0xF0, 0x00, + 0x00, 0x00, 0x00, 0x1F, 0x10, + 0x10, 0x10, 0x10, 0x1F, 0x10, + 0x10, 0x10, 0x10, 0xF0, 0x10, + 0x00, 0x00, 0x00, 0xFF, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xFF, 0x10, + 0x00, 0x00, 0x00, 0xFF, 0x14, + 0x00, 0x00, 0xFF, 0x00, 0xFF, + 0x00, 0x00, 0x1F, 0x10, 0x17, + 0x00, 0x00, 0xFC, 0x04, 0xF4, + 0x14, 0x14, 0x17, 0x10, 0x17, + 0x14, 0x14, 0xF4, 0x04, 0xF4, + 0x00, 0x00, 0xFF, 0x00, 0xF7, + 0x14, 0x14, 0x14, 0x14, 0x14, + 0x14, 0x14, 0xF7, 0x00, 0xF7, + 0x14, 0x14, 0x14, 0x17, 0x14, + 0x10, 0x10, 0x1F, 0x10, 0x1F, + 0x14, 0x14, 0x14, 0xF4, 0x14, + 0x10, 0x10, 0xF0, 0x10, 0xF0, + 0x00, 0x00, 0x1F, 0x10, 0x1F, + 0x00, 0x00, 0x00, 0x1F, 0x14, + 0x00, 0x00, 0x00, 0xFC, 0x14, + 0x00, 0x00, 0xF0, 0x10, 0xF0, + 0x10, 0x10, 0xFF, 0x10, 0xFF, + 0x14, 0x14, 0x14, 0xFF, 0x14, + 0x10, 0x10, 0x10, 0x1F, 0x00, + 0x00, 0x00, 0x00, 0xF0, 0x10, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, + 0x38, 0x44, 0x44, 0x38, 0x44, + 0x7C, 0x2A, 0x2A, 0x3E, 0x14, + 0x7E, 0x02, 0x02, 0x06, 0x06, + 0x02, 0x7E, 0x02, 0x7E, 0x02, + 0x63, 0x55, 0x49, 0x41, 0x63, + 0x38, 0x44, 0x44, 0x3C, 0x04, + 0x40, 0x7E, 0x20, 0x1E, 0x20, + 0x06, 0x02, 0x7E, 0x02, 0x02, + 0x99, 0xA5, 0xE7, 0xA5, 0x99, + 0x1C, 0x2A, 0x49, 0x2A, 0x1C, + 0x4C, 0x72, 0x01, 0x72, 0x4C, + 0x30, 0x4A, 0x4D, 0x4D, 0x30, + 0x30, 0x48, 0x78, 0x48, 0x30, + 0xBC, 0x62, 0x5A, 0x46, 0x3D, + 0x3E, 0x49, 0x49, 0x49, 0x00, + 0x7E, 0x01, 0x01, 0x01, 0x7E, + 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, + 0x44, 0x44, 0x5F, 0x44, 0x44, + 0x40, 0x51, 0x4A, 0x44, 0x40, + 0x40, 0x44, 0x4A, 0x51, 0x40, + 0x00, 0x00, 0xFF, 0x01, 0x03, + 0xE0, 0x80, 0xFF, 0x00, 0x00, + 0x08, 0x08, 0x6B, 0x6B, 0x08, + 0x36, 0x12, 0x36, 0x24, 0x36, + 0x06, 0x0F, 0x09, 0x0F, 0x06, + 0x00, 0x00, 0x18, 0x18, 0x00, + 0x00, 0x00, 0x10, 0x10, 0x00, + 0x30, 0x40, 0xFF, 0x01, 0x01, + 0x00, 0x1F, 0x01, 0x01, 0x1E, + 0x00, 0x19, 0x1D, 0x17, 0x12, + 0x00, 0x3C, 0x3C, 0x3C, 0x3C, + 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/drivers/qwiic/util/font8x16.h b/drivers/qwiic/util/font8x16.h new file mode 100644 index 00000000000..c070e4ec8ca --- /dev/null +++ b/drivers/qwiic/util/font8x16.h @@ -0,0 +1,127 @@ +/****************************************************************************** +font8x16.h +Definition for medium font + +This file was imported from the MicroView library, written by GeekAmmo +(https://github.com/geekammo/MicroView-Arduino-Library), and released under +the terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Modified by: +Emil Varughese @ Edwin Robotics Pvt. Ltd. +July 27, 2015 +https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/ +******************************************************************************/ +#pragma once + +#include "progmem.h" + +static const unsigned char font8x16[] PROGMEM = { + // first row defines - FONTWIDTH, FONTHEIGHT, ASCII START CHAR, TOTAL CHARACTERS, FONT MAP WIDTH HIGH, FONT MAP WIDTH LOW (2,56 meaning 256) + 8,16,32,96,2,56, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xBE, 0x90, 0xD0, 0xBE, 0x90, 0x00, + 0x00, 0x1C, 0x62, 0xFF, 0xC2, 0x80, 0x00, 0x00, 0x0C, 0x12, 0x92, 0x4C, 0xB0, 0x88, 0x06, 0x00, + 0x80, 0x7C, 0x62, 0xB2, 0x1C, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xE0, 0x18, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x18, 0xE0, 0x00, 0x00, + 0x00, 0x24, 0x18, 0x7E, 0x18, 0x24, 0x00, 0x00, 0x80, 0x80, 0x80, 0xF0, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, 0x06, 0x00, 0x00, + 0xF8, 0x04, 0xC2, 0x32, 0x0C, 0xF8, 0x00, 0x00, 0x00, 0x04, 0x04, 0xFE, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x82, 0x42, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x02, 0x22, 0x22, 0x22, 0xDC, 0x00, 0x00, + 0xC0, 0xA0, 0x98, 0x84, 0xFE, 0x80, 0x80, 0x00, 0x00, 0x1E, 0x12, 0x12, 0x22, 0xC2, 0x00, 0x00, + 0xF8, 0x44, 0x22, 0x22, 0x22, 0xC0, 0x00, 0x00, 0x00, 0x02, 0x02, 0xC2, 0x32, 0x0A, 0x06, 0x00, + 0x00, 0x8C, 0x52, 0x22, 0x52, 0x8C, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x26, 0xF8, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, + 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x00, 0x00, 0x02, 0x82, 0x42, 0x22, 0x1C, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x04, 0x0F, 0x04, 0x03, 0x00, 0x00, 0x04, 0x02, 0x01, 0x03, 0x04, 0x04, 0x03, 0x00, + 0x03, 0x04, 0x04, 0x04, 0x05, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x06, 0x08, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10, 0x10, 0x08, 0x06, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x03, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x01, 0x02, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x04, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, + 0x04, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xF8, 0x04, 0x72, 0x8A, 0xFA, 0x84, 0x78, 0x00, 0x00, 0xC0, 0x38, 0x06, 0x38, 0xC0, 0x00, 0x00, + 0x00, 0xFE, 0x22, 0x22, 0x22, 0xDC, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, + 0xFE, 0x02, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, 0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, + 0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x22, 0xE2, 0x00, 0x00, + 0xFE, 0x20, 0x20, 0x20, 0x20, 0xFE, 0x00, 0x00, 0x00, 0x02, 0x02, 0xFE, 0x02, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x02, 0xFE, 0x00, 0x00, 0xFE, 0x40, 0xB0, 0x08, 0x04, 0x02, 0x00, 0x00, + 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x0C, 0x70, 0x80, 0x70, 0x0C, 0xFE, 0x00, + 0xFE, 0x0C, 0x30, 0xC0, 0x00, 0xFE, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, + 0xFE, 0x42, 0x42, 0x42, 0x22, 0x1C, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, + 0x00, 0xFE, 0x42, 0x42, 0xA2, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x42, 0x42, 0x80, 0x00, 0x00, + 0x02, 0x02, 0x02, 0xFE, 0x02, 0x02, 0x02, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, + 0x06, 0x38, 0xC0, 0x00, 0xC0, 0x38, 0x06, 0x00, 0x3E, 0xC0, 0xF0, 0x0E, 0xF0, 0xC0, 0x3E, 0x00, + 0x00, 0x06, 0x98, 0x60, 0x98, 0x06, 0x00, 0x00, 0x00, 0x06, 0x18, 0xE0, 0x18, 0x06, 0x00, 0x00, + 0x02, 0x02, 0xC2, 0x32, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x02, 0x02, 0x00, + 0x00, 0x06, 0x18, 0x60, 0x80, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00, + 0x40, 0x30, 0x0C, 0x0C, 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x00, + 0x00, 0x07, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x07, 0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00, + 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x03, 0x07, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0C, 0x12, 0x11, 0x10, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, + 0x00, 0x06, 0x01, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, + 0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, + 0x00, 0xE0, 0x10, 0x10, 0x10, 0xFE, 0x00, 0x00, 0x00, 0xE0, 0x90, 0x90, 0x90, 0xE0, 0x00, 0x00, + 0x00, 0x20, 0xFC, 0x22, 0x22, 0x22, 0x02, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, + 0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x10, 0x10, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x10, 0x10, 0xF2, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x80, 0x40, 0x20, 0x10, 0x00, 0x00, + 0x00, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x20, 0x10, 0xF0, 0x20, 0x10, 0xF0, 0x00, + 0x00, 0xF0, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xE0, 0x00, 0x00, + 0x00, 0xF0, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, + 0x00, 0xF0, 0x20, 0x10, 0x10, 0x70, 0x00, 0x00, 0x00, 0x60, 0x90, 0x90, 0x90, 0x20, 0x00, 0x00, + 0x00, 0x20, 0x20, 0xFC, 0x20, 0x20, 0x20, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x00, 0x70, 0x80, 0x00, 0x80, 0x70, 0x00, 0x00, 0xF0, 0x00, 0xC0, 0x30, 0xC0, 0x00, 0xF0, 0x00, + 0x00, 0x30, 0xC0, 0xC0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0xC0, 0x00, 0x80, 0x70, 0x00, 0x00, + 0x00, 0x10, 0x10, 0x90, 0x50, 0x30, 0x00, 0x00, 0x00, 0x80, 0x80, 0x7E, 0x02, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x7E, 0x80, 0x80, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, + 0x00, 0x07, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x24, 0x24, 0x22, 0x1F, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x3F, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x3F, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x00, 0x01, 0x06, 0x01, 0x00, + 0x00, 0x06, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x20, 0x20, 0x31, 0x0E, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x05, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/keyboards/1upkeyboards/1up60hse/1up60hse.h b/keyboards/1upkeyboards/1up60hse/1up60hse.h index d24bbaabf60..f1b4f5e43e9 100644 --- a/keyboards/1upkeyboards/1up60hse/1up60hse.h +++ b/keyboards/1upkeyboards/1up60hse/1up60hse.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef KB_H -#define KB_H +#pragma once #include "quantum.h" @@ -36,4 +35,3 @@ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \ { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, KC_NO, K4D } \ } -#endif diff --git a/keyboards/1upkeyboards/1up60hse/config.h b/keyboards/1upkeyboards/1up60hse/config.h index c3682de43ee..9ab969797ea 100644 --- a/keyboards/1upkeyboards/1up60hse/config.h +++ b/keyboards/1upkeyboards/1up60hse/config.h @@ -45,7 +45,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, E6, D1, D0, D2, D3, D5, D6, D7 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 @@ -59,10 +59,11 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_SLEEP #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -112,11 +113,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -221,4 +217,3 @@ along with this program. If not, see . #define LCD_E_PIN 1 //< pin for Enable line #endif */ - diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h b/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h index a3ed4f762a6..99a70056070 100644 --- a/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h @@ -1,4 +1,5 @@ /* Copyright 2018 MechMerlin + * Copyright 2018 Logan Huskins * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c index 556246a3b20..97bece94b32 100644 --- a/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c @@ -1,4 +1,5 @@ /* Copyright 2018 MechMerlin + * Copyright 2018 Logan Huskins * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,29 +17,66 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | GUI | Alt | Space | Alt | GUI | L1 | Ctrl | + * `-----------------------------------------------------------------------------------------' + */ [0] = LAYOUT_60_ansi( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(2), KC_RGUI, KC_RCTL), + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL + ), - [1] = LAYOUT_60_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + /* Function + * ,-----------------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | + * |-----------------------------------------------------------------------------------------+ + * | | | Up | | | | | | | |PrtSc|ScrLk|Pause| | + * |-----------------------------------------------------------------------------------------+ + * | |Left |Down |Right| | | | | | Ins |Home |PgUp | | + * |-----------------------------------------------------------------------------------------+ + * | |VolUp|VolDn|VolMu| | | | | | End |PgDn | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | L2 | | | + * `-----------------------------------------------------------------------------------------' + */ + [1] = LAYOUT_60_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS, + KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_TRNS, KC_TRNS + ), + /* RGB + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | Reset | + * |-----------------------------------------------------------------------------------------+ + * | BL Tog |BLInc|BLDec|BLStp| | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | RGB Tog |Mode |Hue I|Sat I|Val I|Spd I|Plain|Breat|Rnbow|Swirl| | | | + * |-----------------------------------------------------------------------------------------+ + * | |RMode|Hue D|Sat D|Val D|Spd D|Snake|Knigh|Xmas |Gradi| | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ [2] = LAYOUT_60_ansi( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_STEP, BL_DEC, BL_INC, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, RGB_MOD, RGB_TOG, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, + BL_TOGG, BL_INC, BL_DEC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), }; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md b/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md index a9afa5ea6d0..a7041f37b2a 100644 --- a/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md @@ -1,6 +1,4 @@ -# 1up60hse default keymap +# 1up60hse default keymap generated by QMK Configurator -This is the default keymap provided by [1upkeyboards](https://www.1upkeyboards.com). +This is the keymap used by [QMK Configurator](https://config.qmk.fm/#/1upkeyboards/1up60hse/LAYOUT_60_ansi) as default. -## Notes -- Software reset key is located on `Esc` on the third layer. diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/vosechu/config.h b/keyboards/1upkeyboards/1up60hse/keymaps/vosechu/config.h new file mode 100644 index 00000000000..65293382cf6 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/keymaps/vosechu/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Chuck "@vosechu" Lauer Vose + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/vosechu/keymap.c b/keyboards/1upkeyboards/1up60hse/keymaps/vosechu/keymap.c new file mode 100644 index 00000000000..d5b9f901a48 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/keymaps/vosechu/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2018 Chuck "@vosechu" Lauer Vose + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define SPACEFN LT(1, KC_SPC) +#define CTL_GRV CTL_T(KC_GRV) +#define ALT_TAB ALT_T(KC_TAB) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi( + KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS , KC_EQL , KC_BSPC , + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC , KC_RBRC , KC_BSLS , + KC_CAPS , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT , KC_ENT , + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT , + CTL_GRV , ALT_TAB , KC_LGUI , SPACEFN , KC_RALT , KC_RGUI , MO(1) , KC_RCTL + ), + + [1] = LAYOUT_60_ansi( + KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_DEL , + KC_TRNS , KC_TRNS , KC_UP , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_PSCR , KC_SLCK , KC_PAUS , KC_TRNS , + KC_TRNS , KC_LEFT , KC_DOWN , KC_RGHT , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_INS , KC_HOME , KC_PGUP , KC_TRNS , + KC_TRNS , KC_VOLU , KC_VOLD , KC_MUTE , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_END , KC_PGDN , KC_TRNS , + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , MO(2) , KC_TRNS , KC_TRNS + ), + + [2] = LAYOUT_60_ansi( + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , RESET , + BL_TOGG , BL_INC , BL_DEC , BL_STEP , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , + RGB_TOG , RGB_MOD , RGB_HUI , RGB_SAI , RGB_VAI , RGB_SPI , RGB_M_P , RGB_M_B , RGB_M_R , RGB_M_SW , KC_TRNS , KC_TRNS , KC_TRNS , + KC_TRNS , RGB_RMOD , RGB_HUD , RGB_SAD , RGB_VAD , RGB_SPD , RGB_M_SN , RGB_M_K , RGB_M_X , RGB_M_G , KC_TRNS , KC_TRNS , + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS + ) +}; diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/vosechu/readme.md b/keyboards/1upkeyboards/1up60hse/keymaps/vosechu/readme.md new file mode 100644 index 00000000000..97e9453b7c9 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/keymaps/vosechu/readme.md @@ -0,0 +1,6 @@ +# 1up60hse keymap made by vosechu + +Tweaks from default + +* Add in SpaceFN so arrows are reachable with just left hand (leaving right free for mousing). +* Also add tab/grv under the alt/ctrl keys to make those easier to reach. diff --git a/keyboards/1upkeyboards/1up60hse/rules.mk b/keyboards/1upkeyboards/1up60hse/rules.mk index f33e33fd9e4..550241948d4 100644 --- a/keyboards/1upkeyboards/1up60hse/rules.mk +++ b/keyboards/1upkeyboards/1up60hse/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -68,5 +67,6 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +EXTRAFLAGS += -flto LAYOUTS = 60_ansi diff --git a/keyboards/1upkeyboards/1up60hte/1up60hte.c b/keyboards/1upkeyboards/1up60hte/1up60hte.c new file mode 100644 index 00000000000..460e42a0e57 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hte/1up60hte.c @@ -0,0 +1,18 @@ +/* +Copyright 2019 Bubnick + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "1up60hte.h" diff --git a/keyboards/1upkeyboards/1up60hte/1up60hte.h b/keyboards/1upkeyboards/1up60hte/1up60hte.h new file mode 100644 index 00000000000..b6d3c8e0d15 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hte/1up60hte.h @@ -0,0 +1,49 @@ +/* +Copyright 2019 Bubnick + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + +#define LAYOUT_tsangan( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K413, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K401, K402, K406, K410, K411, K412 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413 } \ +} + +/* HHKB Variant */ +#define LAYOUT_60_hhkb( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K413, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K401, K402, K406, K410, K411 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO }, \ + { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413 } \ +} diff --git a/keyboards/1upkeyboards/1up60hte/config.h b/keyboards/1upkeyboards/1up60hte/config.h new file mode 100644 index 00000000000..bcf6329f765 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hte/config.h @@ -0,0 +1,65 @@ +/* +Copyright 2019 Bubnick + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 1upkeyboards +#define PRODUCT 1up60hte +#define DESCRIPTION A custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, E6, D0, D1, D2, D3, D5, D6, D7, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/1upkeyboards/1up60hte/info.json b/keyboards/1upkeyboards/1up60hte/info.json new file mode 100644 index 00000000000..86521d36bd3 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hte/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "1up60hte", + "url": "https://www.1upkeyboards.com/shop/controllers/1up-rgb-60-pcb-hte/", + "maintainer": "1upkeyboards", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_tsangan": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4}, {"label":"Meta", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Meta", "x":11, "y":4, "w":1.5}, {"label":"Alt", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Alt", "x":1.5, "y":4}, {"label":"Meta", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Meta", "x":11, "y":4, "w":1.5}, {"label":"Alt", "x":12.5, "y":4}] + } + } +} diff --git a/keyboards/1upkeyboards/1up60hte/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60hte/keymaps/default/keymap.c new file mode 100644 index 00000000000..359ac754063 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hte/keymaps/default/keymap.c @@ -0,0 +1,52 @@ +/* +Copyright 2019 Bubnick + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_tsangan( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL), + + [1] = LAYOUT_tsangan( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_CLR, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, KC_MPRV, KC_MNXT, RGB_VAD, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +void matrix_init_user(void) { + setPinOutput(B6); +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(B6); + } else { + writePinHigh(B6); + } +} diff --git a/keyboards/1upkeyboards/1up60hte/keymaps/hhkb/keymap.c b/keyboards/1upkeyboards/1up60hte/keymaps/hhkb/keymap.c new file mode 100644 index 00000000000..5312e3b6752 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hte/keymaps/hhkb/keymap.c @@ -0,0 +1,52 @@ +/* +Copyright 2019 Bubnick + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_tsangan( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_NO, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_NO), + + [1] = LAYOUT_tsangan( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_CLR, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, KC_MPRV, KC_MNXT, RGB_VAD, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +void matrix_init_user(void) { + setPinOutput(B6); +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(B6); + } else { + writePinHigh(B6); + } +} diff --git a/keyboards/1upkeyboards/1up60hte/readme.md b/keyboards/1upkeyboards/1up60hte/readme.md new file mode 100644 index 00000000000..93767c541f3 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hte/readme.md @@ -0,0 +1,18 @@ + +# 1up60hte (Hot Swap Tsangan Edition) + +![1up60hte](https://www.1upkeyboards.com/wp-content/uploads/2019/01/PCB-60-HS-TSA-both.jpg) + + +A 60% PCB with USB C, RGB underglow, backlighting, hotswappable switches, and a Tsangan layout. + +Keyboard Maintainer: [Bubnick](https://github.com/bubnick) +Hardware Supported: 1up60hte 60% PCB + +Hardware Availability: [1upkeyboards.com](https://www.1upkeyboards.com/shop/controllers/1up-rgb-60-pcb-hte/) + +Make example for this keyboard (after setting up your build environment): + + make 1upkeyboards/1up60hte:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/1upkeyboards/1up60hte/rules.mk b/keyboards/1upkeyboards/1up60hte/rules.mk new file mode 100644 index 00000000000..860a754a643 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hte/rules.mk @@ -0,0 +1,59 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +EXTRAFLAGS += -flto + +LAYOUTS = 60_hhkb diff --git a/keyboards/1upkeyboards/1up60rgb/1up60rgb.h b/keyboards/1upkeyboards/1up60rgb/1up60rgb.h index 6905fd22050..0f6818a6d86 100644 --- a/keyboards/1upkeyboards/1up60rgb/1up60rgb.h +++ b/keyboards/1upkeyboards/1up60rgb/1up60rgb.h @@ -1,5 +1,4 @@ -#ifndef KB_H -#define KB_H +#pragma once #include "quantum.h" @@ -77,5 +76,3 @@ K300, KC_NO,K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ KC_NO,K401, K403, K406, KC_NO,K411, K413, KC_NO \ ) - -#endif diff --git a/keyboards/1upkeyboards/1up60rgb/config.h b/keyboards/1upkeyboards/1up60rgb/config.h index ee49211b48f..6cf5b690458 100644 --- a/keyboards/1upkeyboards/1up60rgb/config.h +++ b/keyboards/1upkeyboards/1up60rgb/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -30,7 +29,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +37,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS @@ -51,5 +45,3 @@ #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #endif - -#endif diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c index cb372e15d73..435a631815b 100644 --- a/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "1up60rgb.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -18,15 +18,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - ; - - switch (id) { - - } - return MACRO_NONE; -} - void matrix_init_user(void) { } diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c index 42fcb6cf9bb..39edd00ff5e 100644 --- a/keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c @@ -18,15 +18,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - ; - - switch (id) { - - } - return MACRO_NONE; -} - void matrix_init_user(void) { } diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/mdyevimnav/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/mdyevimnav/keymap.c new file mode 100644 index 00000000000..bb0d10405cd --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/mdyevimnav/keymap.c @@ -0,0 +1,48 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* + * Layer 0 + * ,-----------------------------------------------------------------------------------------. + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bksp | + * |-----------------------------------------------------------------------------------------+ + * | Tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Esc | a | s | d | f | g | h | j | k | l | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | z | x | c | v | b | n | m | , | . | / | Shift | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | L1 | Alt | space | Alt | Sup | L1 | Ctrl | + * \-----------------------------------------------------------------------------------------/ + * + */ + LAYOUT_all( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, + KC_LSHIFT, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT, KC_RSHIFT, + KC_LCTL, MO(1), KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + +/* + * Layer 1 + * ,-----------------------------------------------------------------------------------------. + * | | f1 | f2 | f3 | f4 | f5 | f6 | f7 | f8 | f9 | f10 | f11 | f12 | Del | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | Ins | | Paus| | | Prnt | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | L | D | U | R | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | Hom | PDn | PUp | End | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | + * \-----------------------------------------------------------------------------------------/ + * + */ + LAYOUT_all( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PAUS, KC_TRNS, KC_TRNS, KC_PSCR, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c index c166cd0b18c..f4dd36d6dc5 100644 --- a/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c @@ -37,11 +37,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RAISE, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, RGB, KC_RCTL ), // raise layer to handle function & nav keys - [_raise] = LAYOUT_all + [_raise] = LAYOUT_all ( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_LSCR, KC_PAUSE, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, KC_TRNS, KC_TRNS, + KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_LSCR, KC_PAUSE, KC_TRNS, + KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c index 485010eef10..0b0b51d5957 100644 --- a/keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c @@ -18,15 +18,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - ; - - switch (id) { - - } - return MACRO_NONE; -} - void matrix_init_user(void) { } diff --git a/keyboards/1upkeyboards/1up60rgb/readme.md b/keyboards/1upkeyboards/1up60rgb/readme.md index de3ad98b738..ad733f6b5e5 100644 --- a/keyboards/1upkeyboards/1up60rgb/readme.md +++ b/keyboards/1upkeyboards/1up60rgb/readme.md @@ -1,4 +1,4 @@ -# 1upkeyboards 60% RGB +# 1up60rgb 60% RGB Firmware for custom keyboard PCB with 60% key layout. diff --git a/keyboards/1upkeyboards/1up60rgb/rules.mk b/keyboards/1upkeyboards/1up60rgb/rules.mk index 540e4ea96c2..8b1cf6667fa 100644 --- a/keyboards/1upkeyboards/1up60rgb/rules.mk +++ b/keyboards/1upkeyboards/1up60rgb/rules.mk @@ -44,15 +44,15 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -AUDIO_ENABLE ?= no -RGBLIGHT_ENABLE ?= yes +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift 60_hhkb diff --git a/keyboards/1upkeyboards/readme.md b/keyboards/1upkeyboards/readme.md index 4f075d82792..de8ae36acb6 100644 --- a/keyboards/1upkeyboards/readme.md +++ b/keyboards/1upkeyboards/readme.md @@ -1,5 +1,7 @@ # 1UP Keyboards +1UP Keyboards is an online mechanical keyboard retailer located in New York, USA. + Website: [1UP Keyboards](https://www.1upkeyboards.com/) Discord: [Server Invite](https://discordapp.com/invite/c6SYn8) YouTube: [skiwithpete](https://www.youtube.com/user/skiwithpete) \ No newline at end of file diff --git a/keyboards/1upkeyboards/super16/config.h b/keyboards/1upkeyboards/super16/config.h new file mode 100644 index 00000000000..a50821637e0 --- /dev/null +++ b/keyboards/1upkeyboards/super16/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x2010 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 1upkeyboards +#define PRODUCT super16 +#define DESCRIPTION A 4x4 custom macropad + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D1, D0, F4, F5 } +#define MATRIX_COL_PINS { D4, C6, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 16 // Add 12 if attaching the RGB LED ring + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ + /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS + /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +/* prevent stuck modifiers */ diff --git a/keyboards/1upkeyboards/super16/info.json b/keyboards/1upkeyboards/super16/info.json new file mode 100644 index 00000000000..10f81f4d08b --- /dev/null +++ b/keyboards/1upkeyboards/super16/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "super16", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}] + }, + "LAYOUT_numpad_4x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0, "h":2}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "h":2}, {"x":0, "y":3, "w":2}, {"x":2, "y":3}] + } + } +} diff --git a/keyboards/1upkeyboards/super16/keymaps/default/config.h b/keyboards/1upkeyboards/super16/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/1upkeyboards/super16/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/1upkeyboards/super16/keymaps/default/keymap.c b/keyboards/1upkeyboards/super16/keymaps/default/keymap.c new file mode 100644 index 00000000000..47889abae57 --- /dev/null +++ b/keyboards/1upkeyboards/super16/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_4x4( /* Base */ + RGB_TOG, KC_1, KC_U, KC_P, + RGB_MOD, KC_1, KC_U, KC_P, + RGB_TOG, KC_1, KC_U, KC_P, + RGB_MOD, KC_1, KC_U, KC_P + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/1upkeyboards/super16/keymaps/default/readme.md b/keyboards/1upkeyboards/super16/keymaps/default/readme.md new file mode 100644 index 00000000000..814f15c005a --- /dev/null +++ b/keyboards/1upkeyboards/super16/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for super16 diff --git a/keyboards/1upkeyboards/super16/readme.md b/keyboards/1upkeyboards/super16/readme.md new file mode 100644 index 00000000000..61b92ff85e9 --- /dev/null +++ b/keyboards/1upkeyboards/super16/readme.md @@ -0,0 +1,13 @@ +# Super 16 Macro Pad + +A 4x4 macropad with RGB underglow. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Super 16 Macropad +Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/keyboard-kits/super-16-macro-pad/) + +Make example for this keyboard (after setting up your build environment): + + make 1upkeyboards/super16:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/1upkeyboards/super16/rules.mk b/keyboards/1upkeyboards/super16/rules.mk new file mode 100644 index 00000000000..31042dfb811 --- /dev/null +++ b/keyboards/1upkeyboards/super16/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +#EXTRAFLAGS += -flto + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_4x4 numpad_4x4 diff --git a/keyboards/1upkeyboards/super16/super16.c b/keyboards/1upkeyboards/super16/super16.c new file mode 100644 index 00000000000..72e47f447b1 --- /dev/null +++ b/keyboards/1upkeyboards/super16/super16.c @@ -0,0 +1,43 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "super16.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/1upkeyboards/super16/super16.h b/keyboards/1upkeyboards/super16/super16.h new file mode 100644 index 00000000000..0595af8dcd6 --- /dev/null +++ b/keyboards/1upkeyboards/super16/super16.h @@ -0,0 +1,51 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 } \ +} + +#define LAYOUT_numpad_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, \ + K20, K21, K22, K23, \ + K31, K32 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, KC_NO }, \ + { K20, K21, K22, K23 }, \ + { KC_NO, K31, K32, KC_NO } \ +} diff --git a/keyboards/1upkeyboards/sweet16/config.h b/keyboards/1upkeyboards/sweet16/config.h index 20d99651da9..23b590c2c1c 100644 --- a/keyboards/1upkeyboards/sweet16/config.h +++ b/keyboards/1upkeyboards/sweet16/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -30,7 +29,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +37,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN B1 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS @@ -51,5 +45,3 @@ #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #endif - -#endif diff --git a/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c index 2ddf8acb410..4cc754dc164 100644 --- a/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "sweet16.h" +#include QMK_KEYBOARD_H enum custom_keycodes { UP_URL = SAFE_RANGE @@ -6,9 +6,9 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_ortho_4x4( - KC_7, KC_8, KC_9, KC_ASTR, - KC_4, KC_5, KC_6, KC_SLSH, - KC_1, KC_2, KC_3, KC_MINS, + KC_7, KC_8, KC_9, KC_ASTR, + KC_4, KC_5, KC_6, KC_SLSH, + KC_1, KC_2, KC_3, KC_MINS, KC_0, KC_ENT, KC_DOT, KC_EQL ) }; @@ -27,6 +27,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void led_set_user(uint8_t usb_led) { + #ifndef CONVERT_TO_PROTON_C /* Map RXLED to USB_LED_NUM_LOCK */ if (usb_led & (1 << USB_LED_NUM_LOCK)) { DDRB |= (1 << 0); PORTB &= ~(1 << 0); @@ -40,4 +41,5 @@ void led_set_user(uint8_t usb_led) { } else { DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); } + #endif } diff --git a/keyboards/1upkeyboards/sweet16/keymaps/sebas/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/sebas/keymap.c new file mode 100644 index 00000000000..a7e587426b3 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/sebas/keymap.c @@ -0,0 +1,23 @@ +#include QMK_KEYBOARD_H +#define ALT TG(_FUNC) + +enum layers { + _KEYP, + _FUNC +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_KEYP]=LAYOUT_ortho_4x4( + KC_P7, KC_P8, KC_P9, ALT, + KC_P4, KC_P5, KC_P6, KC_PAST, + KC_P1, KC_P2, KC_P3, KC_PMNS, + KC_P0, KC_PDOT, KC_PENT, KC_PPLS +), +[_FUNC]=LAYOUT_ortho_4x4( + KC_MPRV, KC_MPLY, KC_MNXT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, + KC_INS, KC_HOME, KC_PGUP, XXXXXXX, + KC_DEL, KC_END, KC_PGDN, XXXXXXX +) +}; diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c new file mode 100644 index 00000000000..caab5b343a0 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c @@ -0,0 +1,31 @@ +#include QMK_KEYBOARD_H +#include "switches.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ortho_4x4( + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO + ) +}; + +struct mechswitch switches[MATRIX_ROWS][MATRIX_COLS] = { + {CHERRY_MX_BLUE, CHERRY_MX_RED, CHERRY_MX_BLACK, CHERRY_MX_BROWN}, + {GATERON_BLUE, GATERON_RED, GATERON_BLACK, GATERON_BROWN}, + {KAILH_BLUE, KAILH_RED, KAILH_BLACK, KAILH_BROWN}, + {HAKO_CLEAR, HAKO_TRUE, HAKO_VIOLET, HAKO_ROYAL_TRUE} +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint8_t col = record->event.key.col; + uint8_t row = record->event.key.row; + + if (record->event.pressed) { + char name[MAX_SWITCH_NAME_LENGTH]; + switch_name(switches[row][col], name); + send_string(name); + SEND_STRING("\n"); + } + return false; +} diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/readme.md b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/readme.md new file mode 100644 index 00000000000..9edb4e18131 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/readme.md @@ -0,0 +1,5 @@ +# Sweet16 as a switch tester + +This keymap uses the Sweet16 as a switch tester. The functionality outputs the switch name of whatever key the user pressed. + +the `switches` two-dimensional (4x4) array contains the switches attached to the macropad. The switches supported are defined as macros in the `switches.h` header file. diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/rules.mk b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/rules.mk new file mode 100644 index 00000000000..c0f2d0182d6 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/rules.mk @@ -0,0 +1,12 @@ +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no + +SRC += switches.c diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.c b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.c new file mode 100644 index 00000000000..ae379954488 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.c @@ -0,0 +1,99 @@ +#include +#include +#include "switches.h" + +static const char *BRAND_NAMES[] = { + "Kailh", + "Kailh Low Profile Choc", + "Gateron", + "Cherry MX", + "Cherry ML", + "Outemu", + "Greetech", + "Varmilo", + "MOD", + "Hako" +}; + +static const char *COLOR_NAMES[] = { + "", + "White", + "Black", + "Blue", + "Red", + "Yellow", + "Brown", + "Green", + "Clear", + "Silver", + "Nature White", + "Grey", + "Jade", + "Navy", + "Burnt Orange", + "Pale Blue", + "Dark Yellow", + "Gold", + "Chocolate White", + "Burgundy", + "Purple", + "Light Green", + "True", + "Berry", + "Plum", + "Sage", + "Violet", + "L", + "M", + "H", + "SH" +}; + +static const char *VARIANT_NAMES[] = { + "", + "BOX", + "BOX Thick", + "BOX Heavy", + "Silent", + "Tactile", + "Linear", + "Speed", + "Speed Heavy", + "Speed Thick Click", + "Pro", + "Pro Heavy", + "Royal", + "Thick Click", + "Heavy" +}; + +const char *brand_name(struct mechswitch ms) { + return BRAND_NAMES[ms.brand - 1]; +} + +const char *variant_name(struct mechswitch ms) { + return VARIANT_NAMES[ms.variant]; +} + +const char *color_name(struct mechswitch ms) { + return COLOR_NAMES[ms.color]; +} + +void switch_name(struct mechswitch ms, char *buf) { + const char *v_name = variant_name(ms); + const char *c_name = color_name(ms); + + snprintf(buf, MAX_SWITCH_NAME_LENGTH, "%s", brand_name(ms)); + strncat(buf, " ", MAX_SWITCH_NAME_LENGTH - strlen(buf)); + if (strlen(v_name) > 0) { + strncat(buf, v_name, MAX_SWITCH_NAME_LENGTH - strlen(buf)); + strncat(buf, " ", MAX_SWITCH_NAME_LENGTH - strlen(buf)); + } + if (strlen(c_name) > 0) { + strncat(buf, c_name, MAX_SWITCH_NAME_LENGTH - strlen(buf)); + } +} + +int bitfieldtoi(struct mechswitch ms) { + return ((ms.brand << 9) | (ms.variant << 5) | ms.color); +} diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.h b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.h new file mode 100644 index 00000000000..6e58068bf5e --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.h @@ -0,0 +1,189 @@ +#pragma once + +struct mechswitch +{ + unsigned int brand: 4; + unsigned int variant: 4; + unsigned int color: 5; +}; + +#define MAX_SWITCH_NAME_LENGTH 256 + +#define BRAND_KAILH 1 +#define BRAND_KAILH_LOW 2 +#define BRAND_GATERON 3 +#define BRAND_CHERRY_MX 4 +#define BRAND_CHERRY_ML 5 +#define BRAND_OUTEMU 6 +#define BRAND_GREETECH 7 +#define BRAND_VARMILO 8 +#define BRAND_MOD 9 +#define BRAND_HAKO 10 + +#define COLOR_NO 0 +#define COLOR_WHITE 1 +#define COLOR_BLACK 2 +#define COLOR_BLUE 3 +#define COLOR_RED 4 +#define COLOR_YELLOW 5 +#define COLOR_BROWN 6 +#define COLOR_GREEN 7 +#define COLOR_CLEAR 8 +#define COLOR_SILVER 9 +#define COLOR_NATURE_WHITE 10 +#define COLOR_GREY 11 +#define COLOR_JADE 12 +#define COLOR_NAVY 13 +#define COLOR_BURNT_ORANGE 14 +#define COLOR_PALE_BLUE 15 +#define COLOR_DARK_YELLOW 16 +#define COLOR_GOLD 17 +#define COLOR_CHOCOLATE_WHITE 18 +#define COLOR_BURGUNDY 19 +#define COLOR_PURPLE 20 +#define COLOR_LIGHT_GREEN 21 +#define COLOR_TRUE 22 +#define COLOR_BERRY 23 +#define COLOR_PLUM 24 +#define COLOR_SAGE 25 +#define COLOR_VIOLET 26 +#define COLOR_L 27 +#define COLOR_M 28 +#define COLOR_H 29 +#define COLOR_SH 30 + +#define VARIANT_NO 0 +#define VARIANT_BOX 1 +#define VARIANT_BOX_THICK 2 +#define VARIANT_BOX_HEAVY 3 +#define VARIANT_SILENT 4 +#define VARIANT_TACTILE 5 +#define VARIANT_LINEAR 6 +#define VARIANT_SPEED 7 +#define VARIANT_SPEED_HEAVY 8 +#define VARIANT_SPEED_CLICK_THICK 9 +#define VARIANT_PRO 10 +#define VARIANT_PRO_HEAVY 11 +#define VARIANT_ROYAL 12 +#define VARIANT_CLICK_THICK 13 + +#define CHERRY_MX_BLUE {BRAND_CHERRY_MX, VARIANT_NO, COLOR_BLUE} +#define CHERRY_MX_RED {BRAND_CHERRY_MX, VARIANT_NO, COLOR_RED} +#define CHERRY_MX_BROWN {BRAND_CHERRY_MX, VARIANT_NO, COLOR_BROWN} +#define CHERRY_MX_BLACK {BRAND_CHERRY_MX, VARIANT_NO, COLOR_BLACK} +#define CHERRY_MX_GREEN {BRAND_CHERRY_MX, VARIANT_NO, COLOR_GREEN} +#define CHERRY_MX_CLEAR {BRAND_CHERRY_MX, VARIANT_NO, COLOR_CLEAR} +#define CHERRY_MX_WHITE {BRAND_CHERRY_MX, VARIANT_NO, COLOR_WHITE} +#define CHERRY_MX_SILVER {BRAND_CHERRY_MX, VARIANT_NO, COLOR_SILVER} +#define CHERRY_MX_NATURE_WHITE {BRAND_CHERRY_MX, VARIANT_NO, COLOR_NATURE_WHITE} +#define CHERRY_MX_SILENT_BLACK {BRAND_CHERRY_MX, VARIANT_SILENT, COLOR_BLACK} +#define CHERRY_MX_SILENT_RED {BRAND_CHERRY_MX, VARIANT_SILENT, COLOR_RED} +#define CHERRY_MX_TACTILE_BLACK {BRAND_CHERRY_MX, VARIANT_SILENT, COLOR_GREY} +#define CHERRY_MX_LINEAR_BLACK {BRAND_CHERRY_MX, VARIANT_LINEAR, COLOR_GREY} + +#define CHERRY_ML {BRAND_CHERRY_ML, VARIANT_NO, COLOR_NO} + +#define GATERON_BLUE {BRAND_GATERON, VARIANT_NO, COLOR_BLUE} +#define GATERON_BROWN {BRAND_GATERON, VARIANT_NO, COLOR_BROWN} +#define GATERON_BLACK {BRAND_GATERON, VARIANT_NO, COLOR_BLACK} +#define GATERON_RED {BRAND_GATERON, VARIANT_NO, COLOR_RED} +#define GATERON_CLEAR {BRAND_GATERON, VARIANT_NO, COLOR_CLEAR} +#define GATERON_GREEN {BRAND_GATERON, VARIANT_NO, COLOR_GREEN} +#define GATERON_YELLOW {BRAND_GATERON, VARIANT_NO, COLOR_YELLOW} + +#define GATERON_SILENT_CLEAR {BRAND_GATERON, VARIANT_SILENT, COLOR_CLEAR} +#define GATERON_SILENT_RED {BRAND_GATERON, VARIANT_SILENT, COLOR_RED} +#define GATERON_SILENT_YELLOW {BRAND_GATERON, VARIANT_SILENT, COLOR_YELLOW} +#define GATERON_SILENT_BLACK {BRAND_GATERON, VARIANT_SILENT, COLOR_BLACK} +#define GATERON_SILENT_BROWN {BRAND_GATERON, VARIANT_SILENT, COLOR_BROWN} + +#define GREETECH_BLUE {BRAND_GREETECH, VARIANT_NO, COLOR_BLUE} +#define GREETECH_BROWN {BRAND_GREETECH, VARIANT_NO, COLOR_BROWN} +#define GREETECH_BLACK {BRAND_GREETECH, VARIANT_NO, COLOR_BLACK} +#define GREETECH_RED {BRAND_GREETECH, VARIANT_NO, COLOR_RED} + +#define OUTEMU_BLUE {BRAND_OUTEMU, VARIANT_NO, COLOR_BLUE} +#define OUTEMU_BROWN {BRAND_OUTEMU, VARIANT_NO, COLOR_BROWN} +#define OUTEMU_BLACK {BRAND_OUTEMU, VARIANT_NO, COLOR_BLACK} +#define OUTEMU_RED {BRAND_OUTEMU, VARIANT_NO, COLOR_RED} + +#define KAILH_BLUE {BRAND_KAILH, VARIANT_NO, COLOR_BLUE} +#define KAILH_BROWN {BRAND_KAILH, VARIANT_NO, COLOR_BROWN} +#define KAILH_BLACK {BRAND_KAILH, VARIANT_NO, COLOR_BLACK} +#define KAILH_RED {BRAND_KAILH, VARIANT_NO, COLOR_RED} +#define KAILH_GREEN {BRAND_KAILH, VARIANT_NO, COLOR_GREEN} + +#define KAILH_BOX_WHITE {BRAND_KAILH, VARIANT_BOX, COLOR_WHITE} +#define KAILH_BOX_RED {BRAND_KAILH, VARIANT_BOX, COLOR_RED} +#define KAILH_BOX_BLACK {BRAND_KAILH, VARIANT_BOX, COLOR_BLACK} +#define KAILH_BOX_BROWN {BRAND_KAILH, VARIANT_BOX, COLOR_BROWN} +#define KAILH_BOX_ROYAL {BRAND_KAILH, VARIANT_BOX, COLOR_ROYAL} + +#define KAILH_BOX_THICK_JADE {BRAND_KAILH, VARIANT_BOX_THICK, COLOR_JADE} +#define KAILH_BOX_THICK_NAVY {BRAND_KAILH, VARIANT_BOX_THICK, COLOR_NAVY} +#define KAILH_BOX_HEAVY_BURNT_ORANGE {BRAND_KAILH, VARIANT_BOX_HEAVY, COLOR_BURNT_ORANGE} +#define KAILH_BOX_HEAVY_PALE_BLUE {BRAND_KAILH, VARIANT_BOX_HEAVY, COLOR_PALE_BLUE} +#define KAILH_BOX_HEAVY_DARK_YELLOW {BRAND_KAILH, VARIANT_BOX_HEAVY, COLOR_DARK_YELLOW} + +#define KAILH_SPEED_BRONZE {BRAND_KAILH, VARIANT_SPEED, COLOR_BRONZE} +#define KAILH_SPEED_COPPER {BRAND_KAILH, VARIANT_SPEED, COLOR_COPPER} +#define KAILH_SPEED_GOLD {BRAND_KAILH, VARIANT_SPEED, COLOR_GOLD} +#define KAILH_SPEED_SILVER {BRAND_KAILH, VARIANT_SPEED, COLOR_SILVER} + +#define KAILH_SPEED_HEAVY_BURNT_ORANGE {BRAND_KAILH, VARIANT_SPEED_HEAVY, COLOR_BURNT_ORANGE} +#define KAILH_SPEED_HEAVY_PALE_BLUE {BRAND_KAILH, VARIANT_SPEED_HEAVY, COLOR_PALE_BLUE} +#define KAILH_SPEED_HEAVY_DARK_YELLOW {BRAND_KAILH, VARIANT_SPEED_HEAVY, COLOR_DARK_YELLOW} + +#define KAILH_SPEED_THICK_CLICK_NAVY {BRAND_KAILH, VARIANT_SPEED_CLICK_THICK, COLOR_NAVY} + +#define KAILH_PRO_BURGUNDY {BRAND_KAILH, VARIANT_PRO, COLOR_BURGUNDY} +#define KAILH_PRO_PURPLE {BRAND_KAILH, VARIANT_PRO, COLOR_PURPLE} +#define KAILH_PRO_LIGHT_GREEN {BRAND_KAILH, VARIANT_PRO, COLOR_LIGHT_GREEN} + +#define KAILH_PRO_HEAVY_BERRY {BRAND_KAILH, VARIANT_PRO_HEAVY, COLOR_BERRY} +#define KAILH_PRO_HEAVY_PLUM {BRAND_KAILH, VARIANT_PRO_HEAVY, COLOR_PLUM} +#define KAILH_PRO_GEAVY_SAGE {BRAND_KAILH, VARIANT_PRO_HEAVY, COLOR_SAGE} + +#define KAILH_LOW_WHITE {BRAND_KAILH_LOW, VARIANT_NO, COLOR_WHITE} +#define KAILH_LOW_BROWN {BRAND_KAILH_LOW, VARIANT_NO, COLOR_BROWN} +#define KAILH_LOW_RED {BRAND_KAILH_LOW, VARIANT_NO, COLOR_RED} +#define KAILH_LOW_CHOCOLATE_WHITE {BRAND_KAILH_LOW, VARIANT_NO, COLOR_CHOCOLATE_WHITE} +#define KAILH_LOW_THICK_CLICK_NAVY {BRAND_KAILH_LOW, VARIANT_THICK_CLICK, COLOR_NAVY} +#define KAILH_LOW_THICK_CLICK_JADE {BRAND_KAILH_LOW, VARIANT_THICK_CLICK, COLOR_JADE} +#define KAILH_LOW_HEAVY_DARK_YELLOW {BRAND_KAILH_LOW, VARIANT_HEAVY, COLOR_DARK_YELLOW} +#define KAILH_LOW_HEAVY_BURNT_ORANGE {BRAND_KAILH_LOW, VARIANT_HEAVY, COLOR_BURNT_ORANGE} +#define KAILH_LOW_HEAVY_PALE_BLUE {BRAND_KAILH_LOW, VARIANT_HEAVY, COLOR_PALE_BLUE} + +#define HAKO_ROYAL_CLEAR {BRAND_HAKO, VARIANT_ROYAL, COLOR_CLEAR} +#define HAKO_ROYAL_TRUE {BRAND_HAKO, VARIANT_ROYAL, COLOR_TRUE} + +#define HAKO_CLEAR {BRAND_HAKO, VARIANT_NO, COLOR_CLEAR} +#define HAKO_TRUE {BRAND_HAKO, VARIANT_NO, COLOR_TRUE} +#define HAKO_VIOLET {BRAND_HAKO, VARIANT_NO, COLOR_VIOLET} + +#define MOD_L_TACTILE {BRAND_MOD, VARIANT_TACTILE, COLOR_L} +#define MOD_M_TACTILE {BRAND_MOD, VARIANT_TACTILE, COLOR_M} +#define MOD_H_TACTILE {BRAND_MOD, VARIANT_TACTILE, COLOR_H} +#define MOD_SH_TACTILE {BRAND_MOD, VARIANT_TACTILE, COLOR_SH} + +#define MOD_L_LINEAR {BRAND_MOD, VARIANT_LINEAR, COLOR_L} +#define MOD_M_LINEAR {BRAND_MOD, VARIANT_LINEAR, COLOR_M} +#define MOD_H_LINEAR {BRAND_MOD, VARIANT_LINEAR, COLOR_H} + +#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" +#define BYTE_TO_BINARY(byte) \ + (byte & 0x80 ? '1' : '0'), \ + (byte & 0x40 ? '1' : '0'), \ + (byte & 0x20 ? '1' : '0'), \ + (byte & 0x10 ? '1' : '0'), \ + (byte & 0x08 ? '1' : '0'), \ + (byte & 0x04 ? '1' : '0'), \ + (byte & 0x02 ? '1' : '0'), \ + (byte & 0x01 ? '1' : '0') + + +const char *brand_name(struct mechswitch ms); +const char *variant_name(struct mechswitch ms); +const char *color_name(struct mechswitch ms); +void switch_name(struct mechswitch ms, char *buf); +int bitfieldtoi(struct mechswitch ms); diff --git a/keyboards/1upkeyboards/sweet16/readme.md b/keyboards/1upkeyboards/sweet16/readme.md index 3b7b1d6f0b0..f096a5fc992 100644 --- a/keyboards/1upkeyboards/sweet16/readme.md +++ b/keyboards/1upkeyboards/sweet16/readme.md @@ -1,5 +1,4 @@ -Sweet16 -=== +# Sweet 16 Macropad A 4x4 numpad/macro pad sold by 1up Keyboards - designed by Bishop Keyboards diff --git a/keyboards/1upkeyboards/sweet16/rules.mk b/keyboards/1upkeyboards/sweet16/rules.mk index 212e74059e4..e3436dc3387 100644 --- a/keyboards/1upkeyboards/sweet16/rules.mk +++ b/keyboards/1upkeyboards/sweet16/rules.mk @@ -53,4 +53,5 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes \ No newline at end of file +RGBLIGHT_ENABLE = yes +EXTRAFLAGS += -flto diff --git a/keyboards/1upkeyboards/sweet16/sweet16.h b/keyboards/1upkeyboards/sweet16/sweet16.h index 879f51fae66..7320ccd9e07 100644 --- a/keyboards/1upkeyboards/sweet16/sweet16.h +++ b/keyboards/1upkeyboards/sweet16/sweet16.h @@ -1,5 +1,4 @@ -#ifndef KB_H -#define KB_H +#pragma once #include "quantum.h" @@ -29,4 +28,3 @@ { KC_NO, K31, K32, KC_NO } \ } -#endif diff --git a/keyboards/2_milk/2_milk.c b/keyboards/2_milk/2_milk.c new file mode 100644 index 00000000000..36d50e9c7cc --- /dev/null +++ b/keyboards/2_milk/2_milk.c @@ -0,0 +1,16 @@ +/* Copyright 2019 Sebastian Williams + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "2_milk.h" diff --git a/keyboards/2_milk/2_milk.h b/keyboards/2_milk/2_milk.h new file mode 100644 index 00000000000..8f294817f91 --- /dev/null +++ b/keyboards/2_milk/2_milk.h @@ -0,0 +1,26 @@ +/* Copyright 2019 Sebastian Williams + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, \ + K01 \ +) { \ + { K00 }, \ + { K01 } \ +} diff --git a/keyboards/2_milk/config.h b/keyboards/2_milk/config.h new file mode 100644 index 00000000000..9e7228b17e5 --- /dev/null +++ b/keyboards/2_milk/config.h @@ -0,0 +1,41 @@ +/* Copyright 2019 Sebastian Williams + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xB195 +#define DEVICE_VER 0x0001 +#define MANUFACTURER rionlion100 +#define PRODUCT 2% Milk +#define DESCRIPTION A milk themed 2% Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 1 + +/* Milk default pinout */ +#define DIRECT_PINS { \ + {D4}, \ + {C6} \ +} +#define UNUSED_PINS + +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN B6 +#define RGBLED_NUM 1 +#endif diff --git a/keyboards/2_milk/info.json b/keyboards/2_milk/info.json new file mode 100644 index 00000000000..0acf002f96e --- /dev/null +++ b/keyboards/2_milk/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "2% Milk", + "keyboard_folder": "2_milk", + "url": "", + "maintainer": "rionlion100", + "width": 1, + "height": 2, + "layouts": { + "LAYOUT": { + "key_count": 2, + "layout": [ {"x": 0, "y": 0 }, {"x": 0, "y": 1 }] + } + } +} + diff --git a/keyboards/2_milk/keymaps/binary/keymap.c b/keyboards/2_milk/keymaps/binary/keymap.c new file mode 100644 index 00000000000..c8df8e9ff02 --- /dev/null +++ b/keyboards/2_milk/keymaps/binary/keymap.c @@ -0,0 +1,8 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_P0, + KC_P1 + ) +}; diff --git a/keyboards/2_milk/keymaps/binary/readme.md b/keyboards/2_milk/keymaps/binary/readme.md new file mode 100644 index 00000000000..5ebcbd3e587 --- /dev/null +++ b/keyboards/2_milk/keymaps/binary/readme.md @@ -0,0 +1,2 @@ +# Binary keymap +0 and 1 that's it diff --git a/keyboards/2_milk/keymaps/copypasta/keymap.c b/keyboards/2_milk/keymaps/copypasta/keymap.c new file mode 100644 index 00000000000..b9b8005a0f0 --- /dev/null +++ b/keyboards/2_milk/keymaps/copypasta/keymap.c @@ -0,0 +1,9 @@ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + RCTL(KC_C), + RCTL(KC_V) + ) +}; diff --git a/keyboards/2_milk/keymaps/copypasta/readme.md b/keyboards/2_milk/keymaps/copypasta/readme.md new file mode 100644 index 00000000000..6c2f4e8fbf8 --- /dev/null +++ b/keyboards/2_milk/keymaps/copypasta/readme.md @@ -0,0 +1,2 @@ +# Copy/Paste Keymap +![Picture](https://i.imgur.com/7LMZZrL.png) diff --git a/keyboards/2_milk/keymaps/default/keymap.c b/keyboards/2_milk/keymaps/default/keymap.c new file mode 100644 index 00000000000..1f327eee9ab --- /dev/null +++ b/keyboards/2_milk/keymaps/default/keymap.c @@ -0,0 +1,8 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_Z, + KC_X + ) +}; diff --git a/keyboards/2_milk/keymaps/default/readme.md b/keyboards/2_milk/keymaps/default/readme.md new file mode 100644 index 00000000000..4482bce34a0 --- /dev/null +++ b/keyboards/2_milk/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# Default keymap for 2% Milk +![Picture](https://i.imgur.com/9PsZ6wa.png) diff --git a/keyboards/2_milk/keymaps/emoji/keymap.c b/keyboards/2_milk/keymaps/emoji/keymap.c new file mode 100644 index 00000000000..9b84df5c2c5 --- /dev/null +++ b/keyboards/2_milk/keymaps/emoji/keymap.c @@ -0,0 +1,31 @@ +#include QMK_KEYBOARD_H + +enum custom_keycodes { + DISSA, + SHRUG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + SHRUG, + DISSA + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SHRUG: + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } else { + } + break; + case DISSA: + if (record->event.pressed) { + send_unicode_hex_string("0CA0 005F 0CA0"); + } else { + } + break; + } + return true; +}; diff --git a/keyboards/2_milk/keymaps/emoji/readme.md b/keyboards/2_milk/keymaps/emoji/readme.md new file mode 100644 index 00000000000..980be7dd5c3 --- /dev/null +++ b/keyboards/2_milk/keymaps/emoji/readme.md @@ -0,0 +1,2 @@ +# Emoji Keymap +![Picture](https://i.imgur.com/1zEZ9Lq.png) diff --git a/keyboards/2_milk/keymaps/excessbread/keymap.c b/keyboards/2_milk/keymaps/excessbread/keymap.c new file mode 100644 index 00000000000..a01b47f271d --- /dev/null +++ b/keyboards/2_milk/keymaps/excessbread/keymap.c @@ -0,0 +1,8 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_LGUI, + KC_F11 + ) +}; diff --git a/keyboards/2_milk/keymaps/excessbread/readme.md b/keyboards/2_milk/keymaps/excessbread/readme.md new file mode 100644 index 00000000000..a6535e62cf7 --- /dev/null +++ b/keyboards/2_milk/keymaps/excessbread/readme.md @@ -0,0 +1,2 @@ +# ExcessBread's keymap +requested by excessbread diff --git a/keyboards/2_milk/keymaps/mouse/keymap.c b/keyboards/2_milk/keymaps/mouse/keymap.c new file mode 100644 index 00000000000..a8ba44fb46c --- /dev/null +++ b/keyboards/2_milk/keymaps/mouse/keymap.c @@ -0,0 +1,8 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_BTN1, + KC_BTN2 + ) +}; diff --git a/keyboards/2_milk/keymaps/mouse/readme.md b/keyboards/2_milk/keymaps/mouse/readme.md new file mode 100644 index 00000000000..8ecb99eddbb --- /dev/null +++ b/keyboards/2_milk/keymaps/mouse/readme.md @@ -0,0 +1,2 @@ +# left and right mouse buttons +requested by WanderingVagrant diff --git a/keyboards/2_milk/readme.md b/keyboards/2_milk/readme.md new file mode 100644 index 00000000000..ce0f216bba8 --- /dev/null +++ b/keyboards/2_milk/readme.md @@ -0,0 +1,19 @@ +# 2% Milk + +![2%Milk](https://i.imgur.com/Ud96uXn.png) + +A 2% Meme board themed around a milk carton + +Keyboard Maintainer: [Rionlion100](https://github.com/rionlion100) +Hardware Availability: [Open Source](https://github.com/Rionlion100/Spaceboards/tree/master/Keyboards/2%25%20Milk) + +Make example for this keyboard (after setting up your build environment): + + make 2_milk:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +### Credits ++ Case design by Soft ++ PCB by PyroL ++ Name by jetpacktuxedo diff --git a/keyboards/2_milk/rules.mk b/keyboards/2_milk/rules.mk new file mode 100644 index 00000000000..73f55f95385 --- /dev/null +++ b/keyboards/2_milk/rules.mk @@ -0,0 +1,34 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +F_USB = $(F_CPU) + +# Bootloader +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Custom backlighting code is used, so this should not be enabled +AUDIO_ENABLE = no # This can be enabled if a speaker is connected to the expansion port. Not compatible with RGBLIGHT below +RGBLIGHT_ENABLE = yes # This can be enabled if a ws2812 strip is connected to the expansion port. diff --git a/keyboards/30wer/30wer.c b/keyboards/30wer/30wer.c new file mode 100644 index 00000000000..a46c5431960 --- /dev/null +++ b/keyboards/30wer/30wer.c @@ -0,0 +1 @@ +#include "30wer.h" diff --git a/keyboards/30wer/30wer.h b/keyboards/30wer/30wer.h new file mode 100644 index 00000000000..e7bce82776b --- /dev/null +++ b/keyboards/30wer/30wer.h @@ -0,0 +1,14 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b } \ +} diff --git a/keyboards/30wer/config.h b/keyboards/30wer/config.h new file mode 100644 index 00000000000..cf1bd72e563 --- /dev/null +++ b/keyboards/30wer/config.h @@ -0,0 +1,26 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x1234 +#define PRODUCT_ID 0x5678 +#define DEVICE_VER 0x0000 +#define MANUFACTURER 8o7wer +#define PRODUCT 30wer +#define DESCRIPTION Gherkin style construction 30% staggered pcb kit + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 13 + +/* pcb default pin-out */ +#define MATRIX_ROW_PINS { E6, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, D1, D0, D4, C6, D7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS diff --git a/keyboards/30wer/info.json b/keyboards/30wer/info.json new file mode 100644 index 00000000000..0fbbeb47ddf --- /dev/null +++ b/keyboards/30wer/info.json @@ -0,0 +1,51 @@ +{ + "keyboard_name": "30wer", + "url": "", + "maintainer": "qmk", + "width": 13.25, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Tab", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"Bksp", "x":11, "y":0}, + {"label":"Delete", "x":12, "y":0, "w":1.25}, + {"label":"Ctrl", "x":0, "y":1, "w":1.25}, + {"label":"A", "x":1.25, "y":1}, + {"label":"S", "x":2.25, "y":1}, + {"label":"D", "x":3.25, "y":1}, + {"label":"F", "x":4.25, "y":1}, + {"label":"G", "x":5.25, "y":1}, + {"label":"H", "x":6.25, "y":1}, + {"label":"J", "x":7.25, "y":1}, + {"label":"K", "x":8.25, "y":1}, + {"label":"L", "x":9.25, "y":1}, + {"label":":", "x":10.25, "y":1}, + {"label":"\"", "x":11.25, "y":1}, + {"label":"Enter", "x":12.25, "y":1}, + {"label":"Shift", "x":0, "y":2, "w":1.75}, + {"label":"Z", "x":1.75, "y":2}, + {"label":"X", "x":2.75, "y":2}, + {"label":"C", "x":3.75, "y":2}, + {"label":"V", "x":4.75, "y":2}, + {"label":"B", "x":5.75, "y":2}, + {"label":"N", "x":6.75, "y":2}, + {"label":"M", "x":7.75, "y":2}, + {"label":"<", "x":8.75, "y":2}, + {"label":">", "x":9.75, "y":2}, + {"label":"?", "x":10.75, "y":2}, + {"label":"Space", "x":11.75, "y":2, "w":1.5} + ] + } + } +} diff --git a/keyboards/30wer/keymaps/default/keymap.c b/keyboards/30wer/keymaps/default/keymap.c new file mode 100644 index 00000000000..9e39a500a34 --- /dev/null +++ b/keyboards/30wer/keymaps/default/keymap.c @@ -0,0 +1,17 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[0] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT(1, KC_SPC) \ +), + +[1] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_UP, KC_DEL, \ + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, \ + KC_LALT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOWN, _______ \ +), + +}; diff --git a/keyboards/30wer/readme.md b/keyboards/30wer/readme.md new file mode 100644 index 00000000000..c9184f726ba --- /dev/null +++ b/keyboards/30wer/readme.md @@ -0,0 +1,16 @@ +30wer by 8o7wer +=== + +![30wer](https://i.imgur.com/ZYbRvY7.png) + +Keyboard Maintainer: [Filip Sund](https://github.com/FSund) +Hardware Supported: Pro Micro +Hardware Availability: Group buy + +More info in the [group by thread at Keebtalk](https://www.keebtalk.com/t/gb-30wer-by-8o7wer/3618/). + +Make example for this keyboard (after setting up your build environment): + + make 30wer:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/30wer/rules.mk b/keyboards/30wer/rules.mk new file mode 100644 index 00000000000..9d77ec54611 --- /dev/null +++ b/keyboards/30wer/rules.mk @@ -0,0 +1,60 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/40percentclub/25/25.c b/keyboards/40percentclub/25/25.c new file mode 100644 index 00000000000..54a42d263c8 --- /dev/null +++ b/keyboards/40percentclub/25/25.c @@ -0,0 +1,60 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "25.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, + {{4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}}, + {{4, 8}, {3, 8}, {2, 8}, {1, 8}, {0, 8}}, + {{4, 9}, {3, 9}, {2, 9}, {1, 9}, {0, 9}}, + + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}}, + {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}}, +}; +#endif diff --git a/keyboards/40percentclub/25/25.h b/keyboards/40percentclub/25/25.h new file mode 100644 index 00000000000..db9c48b524a --- /dev/null +++ b/keyboards/40percentclub/25/25.h @@ -0,0 +1,85 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#define ___ KC_NO + +#ifndef FLIP_HALF +#define LAYOUT_ortho_5x10( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ + L30, L31, L32, L33, L34, R30, R31, R32, R33, R34, \ + L40, L41, L42, L43, L44, R40, R41, R42, R43, R44 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { L30, L31, L32, L33, L34 }, \ + { L40, L41, L42, L43, L44 }, \ + { R04, R03, R02, R01, R00 }, \ + { R14, R13, R12, R11, R10 }, \ + { R24, R23, R22, R21, R20 }, \ + { R34, R33, R32, R31, R30 }, \ + { R44, R43, R42, R41, R40 } \ +} +#else +#define LAYOUT_ortho_5x10( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ + L30, L31, L32, L33, L34, R30, R31, R32, R33, R34, \ + L40, L41, L42, L43, L44, R40, R41, R42, R43, R44 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { L30, L31, L32, L33, L34 }, \ + { L40, L41, L42, L43, L44 }, \ + { R00, R01, R02, R03, R04 }, \ + { R10, R11, R12, R13, R14 }, \ + { R20, R21, R22, R23, R24 }, \ + { R30, R31, R32, R33, R34 }, \ + { R40, R41, R42, R43, R44 } \ +} +#endif + +#define LAYOUT_ortho_5x5( \ + L00, L01, L02, L03, L04, \ + L10, L11, L12, L13, L14, \ + L20, L21, L22, L23, L24, \ + L30, L31, L32, L33, L34, \ + L40, L41, L42, L43, L44 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { L30, L31, L32, L33, L34 }, \ + { L40, L41, L42, L43, L44 }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ } \ +} + +#define LAYOUT_macro LAYOUT_ortho_5x5 +#define LAYOUT_split LAYOUT_ortho_5x10 + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/40percentclub/25/config.h b/keyboards/40percentclub/25/config.h new file mode 100644 index 00000000000..c9c02b47e25 --- /dev/null +++ b/keyboards/40percentclub/25/config.h @@ -0,0 +1,227 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0F25 +#define MANUFACTURER di0ib +#define PRODUCT The 5x5 Keyboard +#define DESCRIPTION A split 50 key keyboard + +#define USE_SERIAL +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 5*2 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/40percentclub/25/info.json b/keyboards/40percentclub/25/info.json new file mode 100644 index 00000000000..abb77a0677c --- /dev/null +++ b/keyboards/40percentclub/25/info.json @@ -0,0 +1,29 @@ +{ + "keyboard_name": "foobar", + "url": "", + "maintainer": "qmk", + "width": 6, + "height": 2, + "layouts": { + "LAYOUT_macro": { + "key_count": 15, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, + {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4} + ] + }, + "LAYOUT_split": { + "key_count": 30, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, + {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4} + ] + } + } +} diff --git a/keyboards/40percentclub/25/keymaps/default/config.h b/keyboards/40percentclub/25/keymaps/default/config.h new file mode 100644 index 00000000000..6173b63272f --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/25/keymaps/default/keymap.c b/keyboards/40percentclub/25/keymaps/default/keymap.c new file mode 100644 index 00000000000..ccb54c82a1a --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/default/keymap.c @@ -0,0 +1,87 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,---------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + * |------+------+------+------+------+------+------+------+------+------| + * | Q | W | E | R | T | Y | U | I | O | P | + * |------+------+------+------+-------------+------+------+------+------| + * | A | S | D | F | G | H | J | K | L | Bksp | + * |------+------+------+------+------|------+------+------+------+------| + * | Z | X | C | V | B | N | M | , | . |Enter | + * |------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |Lower |Space | Shift| Left | Down | Up |Right | + * `---------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_split( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_BSPC, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_LSFT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,---------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | ` | / | _ | + | + * |------+------+------+------+------|------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | ~ | [ | ] | \ | + * |------+------+------+------+-------------+------+------+------+------| + * | Esc | | | | | | | ; | " | Del | + * |------+------+------+------+------|------+------+------+------+------| + * | Tab | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Home | PgDn | PgUp | End | + * `---------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_split( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_GRV, KC_SLSH, KC_UNDS, KC_PLUS, \ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TILD, KC_LBRC, KC_RBRC, KC_PIPE, \ + KC_ESC, _______, _______, _______, _______, _______, _______, KC_SCLN, KC_QUOT, KC_DEL, \ + KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/25/keymaps/default/readme.md b/keyboards/40percentclub/25/keymaps/default/readme.md new file mode 100644 index 00000000000..7558c42ec50 --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default split keymap for 25 diff --git a/keyboards/40percentclub/25/keymaps/macro/config.h b/keyboards/40percentclub/25/keymaps/macro/config.h new file mode 100644 index 00000000000..6173b63272f --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/macro/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/25/keymaps/macro/keymap.c b/keyboards/40percentclub/25/keymaps/macro/keymap.c new file mode 100644 index 00000000000..80d227710b8 --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/macro/keymap.c @@ -0,0 +1,42 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_macro( + KC_ESC, KC_1, KC_2, KC_3, KC_4, \ + KC_GRV, KC_Q, KC_W, KC_E, KC_R, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/25/keymaps/macro/readme.md b/keyboards/40percentclub/25/keymaps/macro/readme.md new file mode 100644 index 00000000000..6645f93dd88 --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default macro keymap for 25 diff --git a/keyboards/40percentclub/25/readme.md b/keyboards/40percentclub/25/readme.md new file mode 100644 index 00000000000..b1685b618dd --- /dev/null +++ b/keyboards/40percentclub/25/readme.md @@ -0,0 +1,18 @@ +# 25 + +![25](https://2.bp.blogspot.com/-lBK_ZlB3a9Q/WcAM0B_vwdI/AAAAAAACDgs/qnI9YB53pzck4Bw0v5QRvypDMs80CxWVQCLcBGAs/s640/IMG_0695.JPG) +=== + +Split 50 key keyboard - it is the largest keybad that fits within the 100mm x 100mm PCB size. Can be used together as a split keyboard or as a single 25 key macropad. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/25) + +Keyboard Maintainer: QMK Community +Hardware Supported: 25 PCB +Hardware Availability: [25 project on 40% Keyboards](http://www.40percent.club/2017/09/25.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/25:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/25/rules.mk b/keyboards/40percentclub/25/rules.mk new file mode 100644 index 00000000000..bfcdce7c995 --- /dev/null +++ b/keyboards/40percentclub/25/rules.mk @@ -0,0 +1,85 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes + +LAYOUTS = ortho_5x5 ortho_5x10 diff --git a/keyboards/4x4/4x4.c b/keyboards/40percentclub/4x4/4x4.c similarity index 100% rename from keyboards/4x4/4x4.c rename to keyboards/40percentclub/4x4/4x4.c diff --git a/keyboards/40percentclub/4x4/4x4.h b/keyboards/40percentclub/4x4/4x4.h new file mode 100644 index 00000000000..359cdc80a16 --- /dev/null +++ b/keyboards/40percentclub/4x4/4x4.h @@ -0,0 +1,71 @@ +#pragma once + +#include "quantum.h" +#define ___ KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) \ +{ \ + { K00, K01, K02, K03, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ +} +#define LAYOUT_ortho_4x8( \ + K00, K01, K02, K03, K04, K05, K06, K07, \ + K10, K11, K12, K13, K14, K15, K16, K17, \ + K20, K21, K22, K23, K24, K25, K26, K27, \ + K30, K31, K32, K33, K34, K35, K36, K37\ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, K35, K35, K37, ___, ___, ___, ___, ___, ___, ___, ___} \ +} +#define LAYOUT_ortho_4x12( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, ___, ___, ___, ___} \ +} + +#define LAYOUT_ortho_4x16( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \ +} + +#define LAYOUT_kc_ortho_4x12( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ +) \ +{ \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0a, KC_##K0b, ___, ___, ___, ___}, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1a, KC_##K1b, ___, ___, ___, ___}, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2a, KC_##K2b, ___, ___, ___, ___}, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3a, KC_##K3b, ___, ___, ___, ___} \ +} diff --git a/keyboards/40percentclub/4x4/config.h b/keyboards/40percentclub/4x4/config.h new file mode 100644 index 00000000000..09ec5a4ec90 --- /dev/null +++ b/keyboards/40percentclub/4x4/config.h @@ -0,0 +1,194 @@ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x4444 +#define MANUFACTURER di0ib +#define PRODUCT The 4x4 Keyboard +#define DESCRIPTION A modular compact keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B2, D1, D0, D4 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN C7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/4x4/keymaps/default/config.h b/keyboards/40percentclub/4x4/keymaps/default/config.h similarity index 100% rename from keyboards/4x4/keymaps/default/config.h rename to keyboards/40percentclub/4x4/keymaps/default/config.h diff --git a/keyboards/40percentclub/4x4/keymaps/default/keymap.c b/keyboards/40percentclub/4x4/keymaps/default/keymap.c new file mode 100644 index 00000000000..1f52b20667a --- /dev/null +++ b/keyboards/40percentclub/4x4/keymaps/default/keymap.c @@ -0,0 +1,104 @@ + +#include QMK_KEYBOARD_H + +#define PAD 0 +#define _QW 1 +#define NUM 2 +#define DIR 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Single 4x4 board only + * .-----------------------------------. + * | 7 | 8 | 9 | / | + * |--------+--------+--------+--------| + * | 4 | 5 | 6 | * | + * |--------+--------+--------+--------| + * | 1 | 2 | 3 | - | + * |--------+--------+--------+--------| + * | 0 | QWERTY | . | + | + * '-----------------------------------' + */ + + [PAD] = LAYOUT_ortho_4x4( + KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, + KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, + KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, + KC_KP_0, DF(_QW), KC_KP_DOT, KC_PPLS + ), + +/* QWERTY + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | / | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | * | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | - | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | + | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_4x16( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, + KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PPLS + ), + +/* NUMBERS + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | | + * | | | | | | | | | | |CTRLhold| | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | + * | | | | | | | ENTER | SHIFT | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [NUM] = LAYOUT_ortho_4x16( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, _______, + _______, KC_F11, KC_F12, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, _______, + _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* DIRECTIONS + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | P-Brk | | | | | | | RGUI | ALT | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | KEYPAD | | | | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [DIR] = LAYOUT_ortho_4x16( + RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, _______, + KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, _______, + _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, _______, + DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/4x4/readme.md b/keyboards/40percentclub/4x4/readme.md new file mode 100644 index 00000000000..077a2049be9 --- /dev/null +++ b/keyboards/40percentclub/4x4/readme.md @@ -0,0 +1,24 @@ +# 4x4 + +![4x4](https://2.bp.blogspot.com/-xRZOpwlTT4c/WlOwRIVAecI/AAAAAAACKo4/d75juHTX2W0Nrch7NigssMbagvl3I4w_ACEwYBhgL/s1600/e.jpg) +=== + +**Modular keypad/keyboard** +The basic unit is a 4x4 matrix with 16 keys. Up to 4 of these can be connected to each other side by side. +4x4, 4x8, 4x12 and 4x16 are possible. +There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. +**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/4x4) + +Keyboard Maintainer: QMK Community +Hardware Supported: 4x4 PCB +Hardware Availability: [4x4x4x4x4 project on 40% Keyboards](http://www.40percent.club/2018/01/4x4x4x4x4.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/4x4:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/4x4/rules.mk b/keyboards/40percentclub/4x4/rules.mk new file mode 100644 index 00000000000..4ab5e7431c9 --- /dev/null +++ b/keyboards/40percentclub/4x4/rules.mk @@ -0,0 +1,79 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 diff --git a/keyboards/5x5/5x5.c b/keyboards/40percentclub/5x5/5x5.c similarity index 100% rename from keyboards/5x5/5x5.c rename to keyboards/40percentclub/5x5/5x5.c diff --git a/keyboards/40percentclub/5x5/5x5.h b/keyboards/40percentclub/5x5/5x5.h new file mode 100644 index 00000000000..182e9e8190d --- /dev/null +++ b/keyboards/40percentclub/5x5/5x5.h @@ -0,0 +1,53 @@ +#pragma once + +#include "quantum.h" +#define ___ KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_ortho_5x5( \ + K00, K01, K02, K03, K04, \ + K10, K11, K12, K13, K14, \ + K20, K21, K22, K23, K24, \ + K30, K31, K32, K33, K34, \ + K40, K41, K42, K43, K44 \ +) \ +{ \ + { K00, K01, K02, K03, K04, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K40, K41, K42, K43, K44, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ +} + +#define LAYOUT_ortho_5x10( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, ___, ___, ___, ___, ___}, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, ___, ___, ___, ___, ___} \ +} + +#define LAYOUT_ortho_5x15( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e}, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e} \ +} diff --git a/keyboards/40percentclub/5x5/config.h b/keyboards/40percentclub/5x5/config.h new file mode 100644 index 00000000000..a9d294bc94c --- /dev/null +++ b/keyboards/40percentclub/5x5/config.h @@ -0,0 +1,203 @@ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x05B5 +#define MANUFACTURER di0ib +#define PRODUCT The 5x5 Keyboard +#define DESCRIPTION A 25 or 50 or 75 key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B2, D1, D0, D4, C6 } +#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/5x5/keymaps/default/config.h b/keyboards/40percentclub/5x5/keymaps/default/config.h similarity index 100% rename from keyboards/5x5/keymaps/default/config.h rename to keyboards/40percentclub/5x5/keymaps/default/config.h diff --git a/keyboards/40percentclub/5x5/keymaps/default/keymap.c b/keyboards/40percentclub/5x5/keymaps/default/keymap.c new file mode 100644 index 00000000000..56ddbb23f5b --- /dev/null +++ b/keyboards/40percentclub/5x5/keymaps/default/keymap.c @@ -0,0 +1,117 @@ + +#include QMK_KEYBOARD_H + +#define PAD 0 +#define _QW 1 +#define NUM 2 +#define DIR 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Single 5x5 board only + * .--------------------------------------------. + * | QWERTY | / | * | - | | + * |--------+--------+--------+--------+--------| + * | 7 | 8 | 9 | + | | + * |--------+--------+--------+--------+--------| + * | 4 | 5 | 6 | + | | + * |--------+--------+--------+--------+--------| + * | 1 | 2 | 3 | ENTER | | + * |--------+--------+--------+--------+--------| + * | 0 | 0 | . | ENTER | | + * '--------------------------------------------' + */ + + [PAD] = LAYOUT_ortho_5x5( + DF(_QW), KC_PSLS, KC_PAST, KC_PMNS, _______, + KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, _______, + KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, + KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, + KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PENT, _______ + ), + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_5x15( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, + KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT + ), + +/* NUMBERS + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | + * | | | | | | | | | | |CTRLhold| | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | ENTER | SHIFT | | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [NUM] = LAYOUT_ortho_5x15( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, + _______, KC_F11, KC_F12, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, + _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______ + ), + +/* DIRECTIONS + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | P-Brk | | | | | | | RGUI | ALT | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | KEYPAD | | | | | | | | | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [DIR] = LAYOUT_ortho_5x15( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, + KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, + _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, + DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/5x5/readme.md b/keyboards/40percentclub/5x5/readme.md new file mode 100644 index 00000000000..8f0d8e16677 --- /dev/null +++ b/keyboards/40percentclub/5x5/readme.md @@ -0,0 +1,24 @@ +# 5x5 + +![5x5](https://3.bp.blogspot.com/-bKOfUyMtdrE/WqGA_03kGZI/AAAAAAACPtY/DsHDTQS0IlMD3ie8HHlf1ATRUAwpZdcSgCLcBGAs/s1600/c.jpg) +=== + +**Modular Keypad/Keyboard** +The basic unit is a 5x5 matrix with 25 keys. Up to 3 of these can be connected to each other side by side. +5x5, 5x10, and 5x15 matrices are possible. +There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. +**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/5x5) + +Keyboard Maintainer: QMK Community +Hardware Supported: 5x5 PCB +Hardware Availability: [5x5 project on 40% Keyboards](http://www.40percent.club/2018/04/5x5.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/5x5:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/5x5/rules.mk b/keyboards/40percentclub/5x5/rules.mk new file mode 100644 index 00000000000..237de649770 --- /dev/null +++ b/keyboards/40percentclub/5x5/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15 diff --git a/keyboards/40percentclub/6lit/6lit.c b/keyboards/40percentclub/6lit/6lit.c new file mode 100644 index 00000000000..fd3ae7d0097 --- /dev/null +++ b/keyboards/40percentclub/6lit/6lit.c @@ -0,0 +1,53 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "6lit.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{2, 2}, {1, 2}, {0, 2}}, + {{2, 3}, {1, 3}, {0, 3}}, + {{0, 0}, {1, 0}, {2, 0}}, + {{0, 1}, {1, 1}, {2, 1}}, +}; +#endif diff --git a/keyboards/40percentclub/6lit/6lit.h b/keyboards/40percentclub/6lit/6lit.h new file mode 100644 index 00000000000..af01d44c2a1 --- /dev/null +++ b/keyboards/40percentclub/6lit/6lit.h @@ -0,0 +1,58 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#define ___ KC_NO + +#ifndef FLIP_HALF +#define LAYOUT_ortho_2x6( \ + L00, L01, L02, R00, R01, R02, \ + L10, L11, L12, R10, R11, R12 \ +) { \ + { L00, L01, L02 }, \ + { L10, L11, L12 }, \ + { R02, R01, R00 }, \ + { R12, R11, R10 }, \ +} +#else +#define LAYOUT_ortho_2x6( \ + L00, L01, L02, R00, R01, R02, \ + L10, L11, L12, R10, R11, R12 \ +) { \ + { L00, L01, L02 }, \ + { L10, L11, L12 }, \ + { R00, R01, R02 }, \ + { R10, R11, R12 }, \ +} +#endif + +#define LAYOUT_ortho_2x3( \ + L00, L01, L02, \ + L10, L11, L12 \ +) { \ + { L00, L01, L02 }, \ + { L10, L11, L12 }, \ + { ___, ___, ___ }, \ + { ___, ___, ___ }, \ +} + +#define LAYOUT_macro LAYOUT_ortho_2x3 +#define LAYOUT_split LAYOUT_ortho_2x6 + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/40percentclub/6lit/config.h b/keyboards/40percentclub/6lit/config.h new file mode 100644 index 00000000000..110362a6287 --- /dev/null +++ b/keyboards/40percentclub/6lit/config.h @@ -0,0 +1,228 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0F61 +#define MANUFACTURER di0ib +#define PRODUCT The 6lit Macropad +#define DESCRIPTION A split 12 key Macropad + +#define USE_SERIAL + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 2*2 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, E6 } +#define MATRIX_COL_PINS { F6, F7, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/40percentclub/6lit/info.json b/keyboards/40percentclub/6lit/info.json new file mode 100644 index 00000000000..ce1a7d6e16c --- /dev/null +++ b/keyboards/40percentclub/6lit/info.json @@ -0,0 +1,23 @@ +{ + "keyboard_name": "6lit", + "url": "", + "maintainer": "qmk", + "width": 6, + "height": 2, + "layouts": { + "LAYOUT_macro": { + "key_count": 6, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1} + ] + }, + "LAYOUT_split": { + "key_count": 12, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1} + ] + } + } +} diff --git a/keyboards/40percentclub/6lit/keymaps/default/config.h b/keyboards/40percentclub/6lit/keymaps/default/config.h new file mode 100644 index 00000000000..6173b63272f --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/6lit/keymaps/default/keymap.c b/keyboards/40percentclub/6lit/keymaps/default/keymap.c new file mode 100644 index 00000000000..6864c72f786 --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_split( /* Base */ + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, \ + KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/6lit/keymaps/default/readme.md b/keyboards/40percentclub/6lit/keymaps/default/readme.md new file mode 100644 index 00000000000..b3acc3f58a9 --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default split keymap for 6lit diff --git a/keyboards/40percentclub/6lit/keymaps/macro/config.h b/keyboards/40percentclub/6lit/keymaps/macro/config.h new file mode 100644 index 00000000000..6173b63272f --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/macro/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/6lit/keymaps/macro/keymap.c b/keyboards/40percentclub/6lit/keymaps/macro/keymap.c new file mode 100644 index 00000000000..6b10ac1330c --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/macro/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_macro( /* Base */ + KC_F19, KC_F20, KC_F21, \ + KC_F22, KC_F23, KC_F24 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/6lit/keymaps/macro/readme.md b/keyboards/40percentclub/6lit/keymaps/macro/readme.md new file mode 100644 index 00000000000..9f883b821c8 --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default single board macro keymap for 6lit diff --git a/keyboards/40percentclub/6lit/readme.md b/keyboards/40percentclub/6lit/readme.md new file mode 100644 index 00000000000..3d28df2d756 --- /dev/null +++ b/keyboards/40percentclub/6lit/readme.md @@ -0,0 +1,18 @@ +# 6lit + +![6lit](https://1.bp.blogspot.com/-Pa8RgYZ0hy8/Wbmr4bjuV0I/AAAAAAACDbI/WLKQMDlcDVAVf1lAIRMN51usR1XcCCVNgCLcBGAs/s1600/a.JPG) +=== + +6 key macropad that fits within the 100mm x 100mm PCB size. Can be used singly as a regular 6 key macropad as well. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/6lit) + +Keyboard Maintainer: QMK Community +Hardware Supported: 6lit PCB +Hardware Availability: [6lit project on 40% Keyboards](http://www.40percent.club/2017/09/6lit.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/6lit:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/6lit/rules.mk b/keyboards/40percentclub/6lit/rules.mk new file mode 100644 index 00000000000..3275651650c --- /dev/null +++ b/keyboards/40percentclub/6lit/rules.mk @@ -0,0 +1,83 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes diff --git a/keyboards/40percentclub/foobar/config.h b/keyboards/40percentclub/foobar/config.h new file mode 100644 index 00000000000..15af4ad5bd0 --- /dev/null +++ b/keyboards/40percentclub/foobar/config.h @@ -0,0 +1,228 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0F00 +#define MANUFACTURER di0ib +#define PRODUCT The foobar Keyboard +#define DESCRIPTION A split 30 key keyboard + +#define USE_SERIAL + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 3*2 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, E6, B4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/40percentclub/foobar/foobar.c b/keyboards/40percentclub/foobar/foobar.c new file mode 100644 index 00000000000..c032056a155 --- /dev/null +++ b/keyboards/40percentclub/foobar/foobar.c @@ -0,0 +1,55 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "foobar.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, + {{4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, + {{4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}}, +}; +#endif diff --git a/keyboards/40percentclub/foobar/foobar.h b/keyboards/40percentclub/foobar/foobar.h new file mode 100644 index 00000000000..8cf2e384ffd --- /dev/null +++ b/keyboards/40percentclub/foobar/foobar.h @@ -0,0 +1,67 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#define ___ KC_NO + +#ifndef FLIP_HALF +#define LAYOUT_ortho_3x10( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { R04, R03, R02, R01, R00 }, \ + { R14, R13, R12, R11, R10 }, \ + { R24, R23, R22, R21, R20 } \ +} +#else +#define LAYOUT_ortho_3x10( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { R00, R01, R02, R03, R04 }, \ + { R10, R11, R12, R13, R14 }, \ + { R20, R21, R22, R23, R24 } \ +} +#endif + +#define LAYOUT_ortho_3x5( \ + L00, L01, L02, L03, L04, \ + L10, L11, L12, L13, L14, \ + L20, L21, L22, L23, L24 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ } \ +} + +#define LAYOUT_macro LAYOUT_ortho_3x5 +#define LAYOUT_split LAYOUT_ortho_3x10 + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/40percentclub/foobar/info.json b/keyboards/40percentclub/foobar/info.json new file mode 100644 index 00000000000..6d722ae6ee8 --- /dev/null +++ b/keyboards/40percentclub/foobar/info.json @@ -0,0 +1,27 @@ +{ + "keyboard_name": "foobar", + "url": "", + "maintainer": "qmk", + "width": 10, + "height": 3, + "layouts": { + "LAYOUT_macro": { + "width": 5, + "height": 3, + "key_count": 15, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2} + ] + }, + "LAYOUT_split": { + "key_count": 30, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2} + ] + } + } +} diff --git a/keyboards/40percentclub/foobar/keymaps/default/config.h b/keyboards/40percentclub/foobar/keymaps/default/config.h new file mode 100644 index 00000000000..bedc27ba85e --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/default/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here + +#define PERMISSIVE_HOLD diff --git a/keyboards/40percentclub/foobar/keymaps/default/keymap.c b/keyboards/40percentclub/foobar/keymaps/default/keymap.c new file mode 100644 index 00000000000..1be4b38dd9d --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/default/keymap.c @@ -0,0 +1,91 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum foobar_layers { + QWERTY, + FN1, + FN2, + FN3, + FN4, + FN5 +}; + +#define FN1_SPC LT(FN1, KC_SPC) +#define FN2_BSC LT(FN2, KC_BSPC) +#define FN3_C LT(FN3, KC_C) +#define FN4_V LT(FN4, KC_V) +#define FN5_B LT(FN5, KC_B) +#define RALT_N RALT_T(KC_N) +#define LALT_X LALT_T(KC_X) +#define LCTL_Z LCTL_T(KC_Z) +#define RCTL_M RCTL_T(KC_M) +#define LSFT_ENT LSFT_T(KC_ENT) +#define RGUI_ESC RGUI_T(KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [QWERTY] = LAYOUT_split( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, RGUI_ESC, + LCTL_Z, LALT_X, FN3_C, FN4_V, FN2_BSC, FN1_SPC, FN5_B, RALT_N, RCTL_M, LSFT_ENT + ), + + [FN1] = LAYOUT_split( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______ + ), + + [FN2] = LAYOUT_split( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, KC_GRV, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [FN3] = LAYOUT_split( + _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TAB, _______, _______, _______, _______, KC_COMM, KC_DOT, KC_SLSH, KC_SCLN, KC_QUOT, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + [FN4] = LAYOUT_split( + _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_TAB, _______, _______, _______, _______, KC_LABK, KC_RABK, KC_QUES, KC_COLN, KC_DQUO, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [FN5] = LAYOUT_split( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/foobar/keymaps/default/readme.md b/keyboards/40percentclub/foobar/keymaps/default/readme.md new file mode 100644 index 00000000000..7113469e7ec --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default split keymap for foobar diff --git a/keyboards/40percentclub/foobar/keymaps/macro/config.h b/keyboards/40percentclub/foobar/keymaps/macro/config.h new file mode 100644 index 00000000000..6173b63272f --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/macro/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/foobar/keymaps/macro/keymap.c b/keyboards/40percentclub/foobar/keymaps/macro/keymap.c new file mode 100644 index 00000000000..1e7ec905fda --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/macro/keymap.c @@ -0,0 +1,40 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_macro( /* Base */ + KC_F13, KC_F14, KC_F15, KC_F16, KC_INT1, \ + KC_F17, KC_F18, KC_F19, KC_F20, KC_INT2, \ + KC_F21, KC_F22, KC_F23, KC_F14, KC_INT5 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/foobar/keymaps/macro/readme.md b/keyboards/40percentclub/foobar/keymaps/macro/readme.md new file mode 100644 index 00000000000..4cc59e7e5d3 --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default single board macro keymap for foobar diff --git a/keyboards/40percentclub/foobar/readme.md b/keyboards/40percentclub/foobar/readme.md new file mode 100644 index 00000000000..0acdf7252d2 --- /dev/null +++ b/keyboards/40percentclub/foobar/readme.md @@ -0,0 +1,18 @@ +# foobar + +![foobar](https://2.bp.blogspot.com/-rr8TK6xg2N0/WbwVL2O7EfI/AAAAAAACDc8/209wN69ju0wAFICYYPNLIEGQhat5-5MbwCLcBGAs/s640/a.JPG) +=== + +Split 30% keyboard that fits within the 100mm x 100mm PCB size. Can be used together as a split keyboard or as a single 15 key macropad. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/foobar) + +Keyboard Maintainer: QMK Community +Hardware Supported: foobar PCB +Hardware Availability: [foobar project on 40% Keyboards](http://www.40percent.club/2017/09/foobar-10.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/foobar:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/foobar/rules.mk b/keyboards/40percentclub/foobar/rules.mk new file mode 100644 index 00000000000..155a7daacb3 --- /dev/null +++ b/keyboards/40percentclub/foobar/rules.mk @@ -0,0 +1,85 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes + +LAYOUTS = ortho_3x10 diff --git a/keyboards/40percentclub/gherkin/config.h b/keyboards/40percentclub/gherkin/config.h new file mode 100644 index 00000000000..4dc794e347d --- /dev/null +++ b/keyboards/40percentclub/gherkin/config.h @@ -0,0 +1,46 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 40 Percent Club +#define PRODUCT Gherkin +#define DESCRIPTION A 30 key ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 6 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/gherkin/gherkin.c b/keyboards/40percentclub/gherkin/gherkin.c similarity index 100% rename from keyboards/gherkin/gherkin.c rename to keyboards/40percentclub/gherkin/gherkin.c diff --git a/keyboards/40percentclub/gherkin/gherkin.h b/keyboards/40percentclub/gherkin/gherkin.h new file mode 100644 index 00000000000..70bffee302a --- /dev/null +++ b/keyboards/40percentclub/gherkin/gherkin.h @@ -0,0 +1,15 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_3x10( \ + K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \ + K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \ + K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \ +) { \ + { K00, K01, K02, K03, K04, K05 }, \ + { K10, K11, K12, K13, K14, K15 }, \ + { K20, K21, K22, K23, K24, K25 }, \ + { K30, K31, K32, K33, K34, K35 }, \ + { K40, K41, K42, K43, K44, K45 } \ +} diff --git a/keyboards/gherkin/info.json b/keyboards/40percentclub/gherkin/info.json similarity index 100% rename from keyboards/gherkin/info.json rename to keyboards/40percentclub/gherkin/info.json diff --git a/keyboards/gherkin/keymaps/bbaserdem/README.md b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md similarity index 100% rename from keyboards/gherkin/keymaps/bbaserdem/README.md rename to keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h new file mode 100644 index 00000000000..5c9ca52d750 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h @@ -0,0 +1,9 @@ +#pragma once + +#define RGB_DI_PIN F6 +#define RGBLED_NUM 10 +#define RGBLIGHT_ANIMATIONS +#ifdef BACKLIGHT_LEVELS +#undef BACKLIGHT_LEVELS +#endif +#define BACKLIGHT_LEVELS 3 diff --git a/keyboards/gherkin/keymaps/bbaserdem/keymap.c b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c similarity index 100% rename from keyboards/gherkin/keymaps/bbaserdem/keymap.c rename to keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk new file mode 100644 index 00000000000..07a20a42172 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk @@ -0,0 +1,13 @@ +USER_NAME := bbaserdem-nouserspace + +STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +AUDIO_ENABLE = no # Enable audio output from keyboard + +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable RBG light strips +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c new file mode 100644 index 00000000000..ae6f1586271 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c @@ -0,0 +1,63 @@ +#include QMK_KEYBOARD_H + +#define FN1_Q LT(1, KC_Q) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_ortho_3x10( + FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC, + KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT + ), + + [1] = LAYOUT_ortho_3x10( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_INC, + _______, _______, _______, _______, _______, _______, RESET, _______, _______, BL_DEC + ), + +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h new file mode 100644 index 00000000000..6849bbdd2c9 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h @@ -0,0 +1,10 @@ +#pragma once + +#undef RGB_DI_PIN +#undef RGBLED_NUM +#define RGB_DI_PIN D2 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c new file mode 100644 index 00000000000..950b6e86b90 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c @@ -0,0 +1,145 @@ +#include QMK_KEYBOARD_H + +extern rgblight_config_t rgblight_config; +extern keymap_config_t keymap_config; + +#define _PS 0 // This is the Photoshop Layer +#define _AI 1 // This is the Illustrator Layer +#define _PR 2 // This is the Premier Layer +#define _XD 3 // This is the Experience Design Layer + +enum custom_keycodes { + PS = SAFE_RANGE, + AI, + PR, + MACRO_0, +}; + +#define PS TO(0) +#define AI TO(1) +#define PR TO(2) +#define XD TO(3) + +// Mix of Photoshop, Illustrator, Premiere, and Experience Design shortcuts. +#define SAVE LCTL(KC_S) +#define OPEN LCTL(KC_O) +#define COPY LCTL(KC_C) +#define PAST LCTL(KC_V) +#define CUNDO LCTL(LALT(KC_Z)) +#define INVERT LCTL(LSFT(KC_I)) +#define NLAYER LSFT(LCTL(KC_N)) +#define UNDO LCTL(KC_Z) +#define TRANS LCTL(KC_T) +#define ALIGNL LCTL(LSFT(KC_L)) +#define ALIGNC LCTL(LSFT(KC_C)) +#define ALIGNR LCTL(LSFT(KC_R)) +#define BRINGF LCTL(KC_RBRC) +#define BRINGB LCTL(KC_LBRC) + +// Illustrator layer shortcuts. +#define SHAPE LSFT(KC_M) +#define RULER LCTL(LALT(KC_R)) + +// Premiere layer shortcuts. +#define REDO LCTL(LSFT(KC_Z)) +#define EXPORT LCTL(KC_M) +#define IMPORT LCTL(KC_I) +#define PCOPY LCTL(KC_V) +#define PPASTE LCTL(LSFT(KC_V)) + +// Experience Design layer shortcuts. (can be used with others too.) +#define NEW LCTL(KC_N) +#define LOCK LCTL(KC_L) +#define SYMB LCTL(KC_K) +#define HIDE LCTL(KC_SCLN) +#define REPEAT LCTL(KC_R) +#define MASK LCTL(LSFT(KC_M)) +#define GROUP LCTL(KC_G) +#define UNGRP LCTL(LSFT(KC_G)) +#define VIEW LCTL(KC_TAB) +#define HORZ LSFT(KC_C) +#define VERT LSFT(KC_M) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Photoshop layer + [_PS] = LAYOUT_ortho_3x10( + SAVE, KC_W, KC_E, KC_T, KC_U, KC_I, KC_P, INVERT, CUNDO, NLAYER, + UNDO, KC_H, KC_L, TRANS, ALIGNL, ALIGNC, ALIGNR, BRINGB, BRINGF, OPEN, + KC_LSFT, COPY, PAST, KC_Z, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, AI + ), + + // Illustrator layer + [_AI] = LAYOUT_ortho_3x10( + _______, MACRO_0, RULER, _______, KC_G, _______, _______, KC_Q, KC_MINS, KC_PLUS, + _______, _______, _______, KC_E, _______, _______, _______, SHAPE, KC_O, OPEN, + _______, _______, _______, _______, _______, _______, _______, KC_M, KC_SLSH, PR + ), + + // Premiere layer + [_PR] = LAYOUT_ortho_3x10( + _______, KC_Q, KC_W, KC_I, KC_O, KC_P, IMPORT, EXPORT, KC_MINS, KC_EQL, + _______, REDO, KC_D, KC_F, KC_H, KC_M, KC_ENT, KC_LBRC, KC_RBRC, OPEN, + _______, PCOPY, PPASTE, KC_SPC, KC_Z, KC_C, KC_V, KC_LEFT, KC_RIGHT, XD + ), + + // Experience Design layer + [_XD] = LAYOUT_ortho_3x10( + _______, KC_E, KC_R, KC_T, KC_P, KC_A, KC_L, KC_V, KC_DEL, NEW, + _______, REDO, GROUP, UNGRP, VIEW, HORZ, VERT, KC_Z, KC_ENT, OPEN, + _______, KC_LCTL, COPY, PAST, SYMB, LOCK, MASK, HIDE, REPEAT, PS + ), + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +void matrix_init_user(void) { + rgblight_enable(); +} + +void matrix_scan_user(void) { + #ifdef RGBLIGHT_ENABLE + + static uint8_t old_layer = 255; + uint8_t new_layer = biton32(layer_state); + + // Color of the Icons. + if (old_layer != new_layer) { + switch (new_layer) { + case _PS: + // #31C5F0 + rgblight_setrgb(49, 197, 240); + break; + case _AI: + // #FF8011 + rgblight_setrgb(255, 128, 17); + break; + case _PR: + // #E788FF + rgblight_setrgb(231, 136, 255); + break; + case _XD: + // #FF2BC2 + rgblight_setrgb(255, 43, 194); + break; + } + old_layer = new_layer; + } + #endif +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case MACRO_0: + // Save for Web Macro. + SEND_STRING(SS_LSFT(SS_LALT(SS_LCTRL("s")))); + return false; + } + } + return true; +}; diff --git a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk new file mode 100644 index 00000000000..b359ca2874c --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = yes +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes diff --git a/keyboards/40percentclub/gherkin/keymaps/michel/config.h b/keyboards/40percentclub/gherkin/keymaps/michel/config.h new file mode 100644 index 00000000000..8696437a454 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/michel/config.h @@ -0,0 +1,13 @@ +#pragma once + +#undef RGB_DI_PIN +#undef RGBLED_NUM +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 10 + +/* Make layout upside down = USB port on left side */ +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS +#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } +#define MATRIX_COL_PINS { D0, D4, C6, D7, E6, B4 } diff --git a/keyboards/40percentclub/gherkin/keymaps/michel/keymap.c b/keyboards/40percentclub/gherkin/keymaps/michel/keymap.c new file mode 100644 index 00000000000..dc2c1333998 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/michel/keymap.c @@ -0,0 +1,8 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_3x10(KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(1, KC_ENT), LSFT_T(KC_Z), LALT_T(KC_X), LGUI_T(KC_C), KC_V, KC_BSPC, KC_SPC, RGUI_T(KC_B), LT(3, KC_N), LT(2, KC_M), KC_RSFT), + [1] = LAYOUT_ortho_3x10(KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT), + [2] = LAYOUT_ortho_3x10(KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_NO, KC_SCLN, KC_NO, KC_QUOT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_RSFT), + [3] = LAYOUT_ortho_3x10(KC_TAB, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) +}; diff --git a/keyboards/40percentclub/gherkin/keymaps/michel/rules.mk b/keyboards/40percentclub/gherkin/keymaps/michel/rules.mk new file mode 100644 index 00000000000..77b529c0e72 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/michel/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = no +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes diff --git a/keyboards/40percentclub/gherkin/keymaps/midi/config.h b/keyboards/40percentclub/gherkin/keymaps/midi/config.h new file mode 100644 index 00000000000..4a9607e5b4f --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/midi/config.h @@ -0,0 +1,24 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#undef TAPPING_TERM +#define TAPPING_TERM 190 + +#define MUSIC_MASK (keycode != KC_NO) +#define MIDI_ADVANCED diff --git a/keyboards/40percentclub/gherkin/keymaps/midi/keymap.c b/keyboards/40percentclub/gherkin/keymaps/midi/keymap.c new file mode 100644 index 00000000000..965652441a4 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/midi/keymap.c @@ -0,0 +1,115 @@ +#include QMK_KEYBOARD_H + +enum layer_number { + _IONIAN = 0, + _DORIAN, + _PHRYGIAN, + _LYDIAN, + _MIXOLYDIAN, + _AEOLIAN, + _LOCRIAN, + _MENU +}; + +enum custom_keycodes { + IONIAN = SAFE_RANGE, + DORIAN, + PHRYGIAN, + LYDIAN, + MIXOLYDIAN, + AEOLIAN, + LOCRIAN, +}; + +#define MENU MO(_MENU) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_IONIAN] = LAYOUT_ortho_3x10( + MI_C_1, MI_F_1, MI_B_1, MI_E_2, MI_A_2, MI_D_3, MI_G_3, MI_C_4, MI_OCTD, MI_OCTU, + MI_D_1, MI_G_1, MI_C_2, MI_F_2, MI_B_2, MI_E_3, MI_A_3, MI_D_4, MI_TRNSD, MI_TRNSU, + MI_E_1, MI_A_1, MI_D_2, MI_G_2, MI_C_3, MI_F_3, MI_B_3, MI_E_4, MI_SUS, MENU + ), + + [_DORIAN] = LAYOUT_ortho_3x10( + MI_C_1, MI_F_1, MI_As_1, MI_Ds_2, MI_A_2, MI_D_3, MI_G_3, MI_C_4, _______, _______, + MI_D_1, MI_G_1, MI_C_2, MI_F_2, MI_As_2, MI_Ds_3, MI_A_3, MI_D_4, _______, _______, + MI_Ds_1, MI_A_1, MI_D_2, MI_G_2, MI_C_3, MI_F_3, MI_As_3, MI_Ds_4, _______, _______ + ), + + [_PHRYGIAN] = LAYOUT_ortho_3x10( + MI_C_1, MI_F_1, MI_As_1, MI_Ds_2, MI_Gs_2, MI_Cs_3, MI_G_3, MI_C_4, _______, _______, + MI_Cs_1, MI_G_1, MI_C_2, MI_F_2, MI_As_2, MI_Ds_3, MI_Gs_3, MI_Cs_4, _______, _______, + MI_Ds_1, MI_Gs_1, MI_Cs_2, MI_G_2, MI_C_3, MI_F_3, MI_As_3, MI_Ds_4, _______, _______ + ), + + [_LYDIAN] = LAYOUT_ortho_3x10( + MI_C_1, MI_Fs_1, MI_B_1, MI_E_2, MI_A_2, MI_D_3, MI_G_3, MI_C_4, _______, _______, + MI_D_1, MI_G_1, MI_C_2, MI_Fs_2, MI_B_2, MI_E_3, MI_A_3, MI_D_4, _______, _______, + MI_E_1, MI_A_1, MI_D_2, MI_G_2, MI_C_3, MI_Fs_3, MI_B_3, MI_E_4, _______, _______ + ), + + [_MIXOLYDIAN] = LAYOUT_ortho_3x10( + MI_C_1, MI_F_1, MI_As_1, MI_E_2, MI_A_2, MI_D_3, MI_G_3, MI_C_4, _______, _______, + MI_D_1, MI_G_1, MI_C_2, MI_F_2, MI_As_2, MI_E_3, MI_A_3, MI_D_4, _______, _______, + MI_E_1, MI_A_1, MI_D_2, MI_G_2, MI_C_3, MI_F_3, MI_As_3, MI_E_4, _______, _______ + ), + + [_AEOLIAN] = LAYOUT_ortho_3x10( + MI_C_1, MI_F_1, MI_As_1, MI_Ds_2, MI_Gs_2, MI_D_3, MI_G_3, MI_C_4, _______, _______, + MI_D_1, MI_G_1, MI_C_2, MI_F_2, MI_As_2, MI_Ds_3, MI_Gs_3, MI_D_4, _______, _______, + MI_Ds_1, MI_Gs_1, MI_D_2, MI_G_2, MI_C_3, MI_F_3, MI_As_3, MI_Ds_4, _______, _______ + ), + + [_LOCRIAN] = LAYOUT_ortho_3x10( + MI_C_1, MI_F_1, MI_As_1, MI_Ds_2, MI_Gs_2, MI_Cs_3, MI_Fs_3, MI_C_4, _______, _______, + MI_Cs_1, MI_Fs_1, MI_C_2, MI_F_2, MI_As_2, MI_Ds_3, MI_Gs_3, MI_Cs_4, _______, _______, + MI_Ds_1, MI_Gs_1, MI_Cs_2, MI_Fs_2, MI_C_3, MI_F_3, MI_As_3, MI_Ds_4, _______, _______ + ), + + [_MENU] = LAYOUT_ortho_3x10( + IONIAN, LYDIAN, LOCRIAN, _______, _______, _______, _______, _______, _______, _______, + DORIAN, MIXOLYDIAN, _______, _______, _______, _______, _______, _______, _______, _______, + PHRYGIAN, AEOLIAN, _______, _______, _______, _______, _______, _______, RESET, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case IONIAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_IONIAN); + } + break; + case DORIAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_DORIAN); + } + break; + case PHRYGIAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_PHRYGIAN); + } + break; + case LYDIAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_LYDIAN); + } + break; + case MIXOLYDIAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_MIXOLYDIAN); + } + break; + case AEOLIAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_AEOLIAN); + } + break; + case LOCRIAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_LOCRIAN); + } + break; + } + return true; +} diff --git a/keyboards/40percentclub/gherkin/keymaps/midi/readme.md b/keyboards/40percentclub/gherkin/keymaps/midi/readme.md new file mode 100644 index 00000000000..f8fad08dc85 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/midi/readme.md @@ -0,0 +1,14 @@ +### Gherkin Midi +A gherkin midi layout that should cover most midi note playing needs. + +A 3x8 grid of notes written bottom left to right upwards as notes for the selected mode, with octave and transpose note controls at the top. Menu accesses other mode layouts, persisted to keyboard settings, and a reset for firmware programming. + +Modes are set by pressing Menu and their corresponding note from the C Ionian layout. That is, for Aeolian, press Menu and A 1. For Phrygian, press Menu and E 1. + +#### Keyboard Default Layout +![](https://i.imgur.com/VNc0GsI.jpg) + +Keyboard Editor Gist [link](https://gist.github.com/scottsheffield/c57859fe1a85d703f5387bf8ce41028c) + +#### Glamour Shot +![](https://i.imgur.com/B3Q4JoU.jpg) \ No newline at end of file diff --git a/keyboards/40percentclub/gherkin/keymaps/midi/rules.mk b/keyboards/40percentclub/gherkin/keymaps/midi/rules.mk new file mode 100644 index 00000000000..bfc6dbbd0db --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/midi/rules.mk @@ -0,0 +1,8 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no +MIDI_ENABLE = yes diff --git a/keyboards/40percentclub/gherkin/keymaps/mjt/config.h b/keyboards/40percentclub/gherkin/keymaps/mjt/config.h new file mode 100644 index 00000000000..9fe94bcd21e --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/mjt/config.h @@ -0,0 +1,7 @@ +#pragma once + +/* USB Device descriptor parameter */ +#undef MANUFACTURER +#undef DESCRIPTION +#define MANUFACTURER Some Guy +#define DESCRIPTION 30 percent disaster diff --git a/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c b/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c new file mode 100644 index 00000000000..2fd4c2a461e --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c @@ -0,0 +1,250 @@ +#include QMK_KEYBOARD_H +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +extern keymap_config_t keymap_config; + +//Tap Dance Declarations +enum { + TD_Z_LCTL = 0, + TD_X_LGUI = 1, + TD_C_LALT = 2, + TD_A_TAB = 3, + TD_Q_ESC = 4, +}; + +//Friendly Layer Names +enum gherkin_layers { + _QWERTY, + _SONGS, + _NUMBERS, + _SYMBOLS, + _PLOVER, + _ADJUST +}; + +// custom keycodes +enum gherkin_keycodes { + QWERTY = SAFE_RANGE, + NUMBERS, + SYMBOLS, + SONGS, + PLOVER, + BACKLIT, + MACSLEEP, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_ortho_3x10( + TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + TD(TD_A_TAB), LT(_SYMBOLS,KC_S), KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_ADJUST,KC_SPC), + TD(TD_Z_LCTL), TD(TD_X_LGUI), TD(TD_C_LALT), KC_V, KC_B, LT(_NUMBERS, KC_N), KC_M, KC_COMM, KC_DOT, SFT_T(KC_ENT) + ), + [_NUMBERS] = LAYOUT_ortho_3x10( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_HOME, KC_PGDN, KC_PGUP, KC_END , + KC_F7, KC_F8, KC_F9, KC_F10, LT(_ADJUST,KC_F11), _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), + [_SYMBOLS] = LAYOUT_ortho_3x10( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_GRV, _______, XXXXXXX, KC_LBRC, KC_RBRC, KC_BSLS, KC_MINS, KC_EQL , KC_SCLN, KC_QUOT, + KC_TILD, MO(_ADJUST), XXXXXXX, KC_LCBR, KC_RCBR, KC_PIPE, KC_UNDS, KC_PLUS, S(KC_SCLN), S(KC_QUOT) + ), + [_PLOVER] = LAYOUT_ortho_3x10( + KC_Q, KC_W, KC_E, KC_R, KC_1, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX + ), + [_ADJUST] = LAYOUT_ortho_3x10( + RESET, _______, _______, _______, _______, QWERTY, NUMBERS, SYMBOLS, PLOVER, SONGS, + MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, _______, _______, MACSLEEP, _______, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case NUMBERS: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistant_default_layer_set(1UL<<_NUMBERS); + } + return false; + break; + case SYMBOLS: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistant_default_layer_set(1UL<<_SYMBOLS); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_off(_NUMBERS); + layer_off(_SYMBOLS); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + return false; + break; + case MACSLEEP: + if (record->event.pressed) { + // ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_POWER); + register_code(KC_RSFT); + register_code(KC_RCTL); + register_code(KC_POWER); + unregister_code(KC_POWER); + unregister_code(KC_RCTL); + unregister_code(KC_RSFT); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user() +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + +void matrix_scan_user(void) { +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Esc, twice for Caps Lock + [TD_Z_LCTL] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_LCTL), + [TD_X_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_X, KC_LGUI), + [TD_C_LALT] = ACTION_TAP_DANCE_DOUBLE(KC_C, KC_LALT), + [TD_A_TAB] = ACTION_TAP_DANCE_DOUBLE(KC_A, KC_TAB), + [TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) +}; + +// don't know what this is doing... +/* +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} +*/ diff --git a/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk b/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk new file mode 100644 index 00000000000..3a35ae3b302 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk @@ -0,0 +1,2 @@ +AUDIO_ENABLE = yes # Audio output on port C6 +TAP_DANCE_ENABLE = yes diff --git a/keyboards/40percentclub/gherkin/keymaps/steno/config.h b/keyboards/40percentclub/gherkin/keymaps/steno/config.h new file mode 100644 index 00000000000..20a8f7844a9 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/steno/config.h @@ -0,0 +1,7 @@ +#pragma once + +#define NO_ACTION_LAYER +#define NO_ACTION_TAPPING +#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/gherkin/keymaps/steno/keymap.c b/keyboards/40percentclub/gherkin/keymaps/steno/keymap.c similarity index 100% rename from keyboards/gherkin/keymaps/steno/keymap.c rename to keyboards/40percentclub/gherkin/keymaps/steno/keymap.c diff --git a/keyboards/gherkin/keymaps/steno/readme.md b/keyboards/40percentclub/gherkin/keymaps/steno/readme.md similarity index 100% rename from keyboards/gherkin/keymaps/steno/readme.md rename to keyboards/40percentclub/gherkin/keymaps/steno/readme.md diff --git a/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk b/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk new file mode 100644 index 00000000000..a6e76f7cf94 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk @@ -0,0 +1,12 @@ +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no diff --git a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c new file mode 100644 index 00000000000..ca3da579a13 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c @@ -0,0 +1,56 @@ +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +#define ST_BOLT QK_STENO_BOLT +#define ST_GEM QK_STENO_GEMINI + +enum keyboard_layers { + _QWERTY, + _RAISE, + _LOWER, + _PLOVER, + _ADJUST +}; + +#define ADJ_Z LT(_ADJUST, KC_Z) +#define RS_BSPC LT(_RAISE, KC_BSPC) +#define LW_SPC LT(_LOWER, KC_SPC) +#define MO_ADJ MO(_ADJUST) +#define TG_PLV TG(_PLOVER) +#define OS_LCTL OSM(MOD_LCTL) +#define OS_LALT OSM(MOD_LALT) +#define OS_LGUI OSM(MOD_LGUI) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_ortho_3x10( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_RSFT, + ADJ_Z, KC_X, KC_C, KC_V, RS_BSPC, LW_SPC, KC_B, KC_N, KC_M, KC_ENT + ), + + [_RAISE] = LAYOUT_ortho_3x10( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_7, KC_9, KC_0, + KC_ESC, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC, _______, KC_QUOT, KC_SCLN, _______, + OS_LCTL, OS_LGUI, OS_LALT, KC_GRV, _______, KC_TAB, KC_BSLS, KC_COMM, KC_DOT, KC_SLSH + ), + + [_LOWER] = LAYOUT_ortho_3x10( + KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, + KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, + KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, OS_LALT, OS_LGUI, OS_LCTL, KC_CAPS + ), + + [_PLOVER] = LAYOUT_ortho_3x10( + STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + MO_ADJ, STN_NUM, STN_A, STN_O, STN_NUM, STN_E, STN_U, STN_NUM, STN_NUM, XXXXXXX + ), + + [_ADJUST] = LAYOUT_ortho_3x10( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ST_BOLT, ST_GEM, TG_PLV, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET + ), + +}; diff --git a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk new file mode 100644 index 00000000000..a64c606ae75 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk @@ -0,0 +1,2 @@ +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER diff --git a/keyboards/40percentclub/gherkin/readme.md b/keyboards/40percentclub/gherkin/readme.md new file mode 100644 index 00000000000..a6680d72057 --- /dev/null +++ b/keyboards/40percentclub/gherkin/readme.md @@ -0,0 +1,21 @@ +# Gherkin + +![Gherkin](https://4.bp.blogspot.com/-sQ18-lNZXOc/WCzlTde-4PI/AAAAAAAB_JQ/qQrehAMG6DMKf3i4oj4mkmLGOfTUvb3KgCLcB/s640/IMG_20161116_122926.jpg) +=== + +A 30 key keyboard. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gherkin) + +Keyboard Maintainer: QMK Community +Hardware Supported: Gherkin PCB +Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2016/11/gherkin.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/gherkin:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +First pass at adding support for the gherkin keyboard. Compiles but completely +untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/gherkin/rules.mk b/keyboards/40percentclub/gherkin/rules.mk new file mode 100644 index 00000000000..1e0b346417f --- /dev/null +++ b/keyboards/40percentclub/gherkin/rules.mk @@ -0,0 +1,74 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no + +LAYOUTS = ortho_3x10 diff --git a/keyboards/40percentclub/half_n_half/config.h b/keyboards/40percentclub/half_n_half/config.h new file mode 100644 index 00000000000..cd7515f0bac --- /dev/null +++ b/keyboards/40percentclub/half_n_half/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 Boy_314 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x4A1F +#define MANUFACTURER di0ib +#define PRODUCT half_n_half +#define DESCRIPTION A small split ortholinear custom keyboard with 2 thumb buttons + +/* key matrix size */ +#define MATRIX_ROWS 4*2 +#define MATRIX_COLS 7 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define USE_SERIAL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/40percentclub/half_n_half/half_n_half.c b/keyboards/40percentclub/half_n_half/half_n_half.c new file mode 100644 index 00000000000..c4e6a4ce079 --- /dev/null +++ b/keyboards/40percentclub/half_n_half/half_n_half.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Boy_314 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "half_n_half.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/40percentclub/half_n_half/half_n_half.h b/keyboards/40percentclub/half_n_half/half_n_half.h new file mode 100644 index 00000000000..bc330c9cb7b --- /dev/null +++ b/keyboards/40percentclub/half_n_half/half_n_half.h @@ -0,0 +1,48 @@ +/* Copyright 2019 Boy_314 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#define ___ KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L34, R32 \ +) { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { ___, ___, ___, ___, L34, ___, ___ }, \ +\ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { ___, ___, ___, ___, R32, ___, ___ } \ +} + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/40percentclub/half_n_half/info.json b/keyboards/40percentclub/half_n_half/info.json new file mode 100644 index 00000000000..e791e36c68a --- /dev/null +++ b/keyboards/40percentclub/half_n_half/info.json @@ -0,0 +1,62 @@ +{ + "keyboard_name": "half_n_half", + "url": "", + "maintainer": "qmk", + "width": 14, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 44, + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"L06", "x":6, "y":0}, + {"label":"R00", "x":7, "y":0}, + {"label":"R01", "x":8, "y":0}, + {"label":"R02", "x":9, "y":0}, + {"label":"R03", "x":10, "y":0}, + {"label":"R04", "x":11, "y":0}, + {"label":"R05", "x":12, "y":0}, + {"label":"R06", "x":13, "y":0}, + + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"L16", "x":6, "y":1}, + {"label":"R10", "x":7, "y":1}, + {"label":"R11", "x":8, "y":1}, + {"label":"R12", "x":9, "y":1}, + {"label":"R13", "x":10, "y":1}, + {"label":"R14", "x":11, "y":1}, + {"label":"R15", "x":12, "y":1}, + {"label":"R16", "x":13, "y":1}, + + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"L26", "x":6, "y":2}, + {"label":"R20", "x":7, "y":2}, + {"label":"R21", "x":8, "y":2}, + {"label":"R22", "x":9, "y":2}, + {"label":"R23", "x":10, "y":2}, + {"label":"R24", "x":11, "y":2}, + {"label":"R25", "x":12, "y":2}, + {"label":"R26", "x":13, "y":2}, + + {"label":"L34", "x":4, "y":3, "w":2}, + {"label":"R32", "x":8, "y":3, "w":2} + ] + } + } +} + \ No newline at end of file diff --git a/keyboards/40percentclub/half_n_half/keymaps/Boy_314/config.h b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/config.h new file mode 100644 index 00000000000..f73fd055cc2 --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/config.h @@ -0,0 +1,22 @@ +/* Copyright 2019 Boy_314 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 diff --git a/keyboards/40percentclub/half_n_half/keymaps/Boy_314/keymap.c b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/keymap.c new file mode 100644 index 00000000000..2eef3dc48b8 --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/keymap.c @@ -0,0 +1,173 @@ +/* Copyright 2019 Boy_314 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Tap Dance Declarations +enum { + TD_SWAP_LAYERS = 0 +}; + +enum layers { + _DVORAK, + _QWERTY, + _LOWER, + _RAISE, +}; + +enum halfnhalf_keycodes { + NEWTAB = SAFE_RANGE, + ALTF4, + CLSTAB, + PRVWIN, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* DVORAK + * ,-------------------------------------------------------------------------------------------------. + * |Tab |' |, |. |P |Y |Brght+|= |F |G |C |R |L |Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |CtlCps|A |O |E |U |I |Brght-|Ctrl+F|D |H |T |N |S |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |LShift|; |Q |J |K |X |LAlt |- |B |M |W |V |Z |RShift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |TD Swap Layer| |Space | + * `-------------' `-------------' + */ + [_DVORAK] = LAYOUT(/* Base Dvorak */ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_BRIU, KC_EQL, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + LCTL_T(KC_CAPS), KC_A, KC_O, KC_E, KC_U, KC_I, KC_BRID, LCTL(KC_F), KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, + KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LALT, KC_MINS, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, + TD(TD_SWAP_LAYERS), KC_SPC + ), + + /* QWERTY + * ,-------------------------------------------------------------------------------------------------. + * |Tab |Q |W |E |R |T |Brght+|' |Y |U |I |O |P |Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |CtlCps|A |S |D |F |G |Brght-|Ctrl+F|H |J |K |L |; |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |LShift|Z |X |C |V |B |LAlt |- |N |M |, |. |/ |RShift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |TD Swap Layer| |Space | + * `-------------' `-------------' + */ + [_QWERTY] = LAYOUT(/* Base Qwerty */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BRIU, KC_QUOT, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LCTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BRID, LCTL(KC_F), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_MINS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + TD(TD_SWAP_LAYERS), KC_SPC + ), + + /* LOWER + * ,-------------------------------------------------------------------------------------------------. + * |Esc |1 |2 |3 |4 |5 | | |6 |7 |8 |9 |0 |/ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Caps |F1 |F2 |F3 |F4 |F5 |F6 |Vol Up|Play |_ |+ |{ |} || | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |F7 |F8 |F9 |F10 |F11 |F12 |Vol Dn|Next |Home |PgDn |PgUp |End | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | + * `-------------' `-------------' + */ + [_LOWER] = LAYOUT(/* Numbers, Function Row, Media Control, Shifted Symbols, Dvorak Slash Key */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SLSH, + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_VOLU, KC_MPLY, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_MNXT, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, + KC_TRNS, KC_TRNS + ), + + /* RAISE + * ,-------------------------------------------------------------------------------------------------. + * |Reset | | |Up | | | |PRVWIN|CLSTAB| | | | |Del | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |` | |Left |Down |Right | | |NEWTAB|ALTF4 |- |= |[ |] |\ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |! |@ |# |$ |% | | |^ |& |* |( |) | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | + * `-------------' `-------------' + */ + [_RAISE] = LAYOUT(/* Arrows, Shifted Numbers, Symbols, Delete, Macros */ + RESET, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, PRVWIN, CLSTAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_GRV, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, NEWTAB, ALTF4, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, + KC_TRNS, KC_TRNS + ) +}; + +void tap_dance_choose_layer (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + layer_on(_LOWER); + break; + case 2: + layer_on(_RAISE); + break; + } +} + +void tap_dance_choose_layer_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + layer_off(_LOWER); + break; + case 2: + layer_off(_RAISE); + break; + case 3: + if (biton32(default_layer_state) == _DVORAK) { + set_single_persistent_default_layer(_QWERTY); + } + else if (biton32(default_layer_state) == _QWERTY) { + set_single_persistent_default_layer(_DVORAK); + } + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SWAP_LAYERS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_choose_layer, tap_dance_choose_layer_reset) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // Control + T + case NEWTAB: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("t")); + } + break; + // Alt + F4 + case ALTF4: + if (record->event.pressed) { + SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_F4)SS_UP(X_LALT)); + } + break; + // Control + W + case CLSTAB: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("w")); + } + break; + // Control + Shift + N + case PRVWIN: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL(SS_LSFT("n"))); + } + break; + } + return true; +} diff --git a/keyboards/40percentclub/half_n_half/keymaps/Boy_314/readme.md b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/readme.md new file mode 100644 index 00000000000..9eff08b5ea4 --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/readme.md @@ -0,0 +1,2 @@ +# Boy_314's keymap for half_n_half +# Currently only supports DVORAK. QWERTY Support is on the TODO list. \ No newline at end of file diff --git a/keyboards/40percentclub/half_n_half/keymaps/Boy_314/rules.mk b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/rules.mk new file mode 100644 index 00000000000..59c7ccf8275 --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/Boy_314/rules.mk @@ -0,0 +1,5 @@ +TAP_DANCE_ENABLE = yes # Enable Tap Dance +NKRO_ENABLE = yes # USB Nkey Rollover + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes \ No newline at end of file diff --git a/keyboards/40percentclub/half_n_half/keymaps/default/config.h b/keyboards/40percentclub/half_n_half/keymaps/default/config.h new file mode 100644 index 00000000000..c8e4334124e --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/half_n_half/keymaps/default/keymap.c b/keyboards/40percentclub/half_n_half/keymaps/default/keymap.c new file mode 100644 index 00000000000..2ab9a8c982f --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2019 Boy_314 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LCTL, KC_RCTL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LALT, KC_RALT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, KC_APP, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_SPC, KC_SPC + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/half_n_half/keymaps/default/readme.md b/keyboards/40percentclub/half_n_half/keymaps/default/readme.md new file mode 100644 index 00000000000..58a457f1bc8 --- /dev/null +++ b/keyboards/40percentclub/half_n_half/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for half_n_half \ No newline at end of file diff --git a/keyboards/40percentclub/half_n_half/readme.md b/keyboards/40percentclub/half_n_half/readme.md new file mode 100644 index 00000000000..689b6fe816e --- /dev/null +++ b/keyboards/40percentclub/half_n_half/readme.md @@ -0,0 +1,14 @@ +# half_n_half + +![half_n_half](https://2.bp.blogspot.com/-akouSRzGKQw/WutIH4qV0nI/AAAAAAACRqA/D1Gx3i1UWlccMCd0VS8td0ckWjCixrSuQCLcBGAs/s1600/b.jpg) + +A small split ortho board with two thumb keys + +Keyboard Maintainer: [Boy_314](https://github.com/boy-314) +Hardware Availability: http://www.40percent.club/2018/07/half-n-half.html + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/half_n_half:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/half_n_half/rules.mk b/keyboards/40percentclub/half_n_half/rules.mk new file mode 100644 index 00000000000..3b584f84502 --- /dev/null +++ b/keyboards/40percentclub/half_n_half/rules.mk @@ -0,0 +1,83 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes diff --git a/keyboards/40percentclub/i75/config.h b/keyboards/40percentclub/i75/config.h new file mode 100644 index 00000000000..f9b5d57ddf0 --- /dev/null +++ b/keyboards/40percentclub/i75/config.h @@ -0,0 +1,187 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0175 +#define MANUFACTURER di0ib +#define PRODUCT i75 +#define DESCRIPTION i75 15x5 ortholinear keyboard + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/40percentclub/i75/i75.c b/keyboards/40percentclub/i75/i75.c new file mode 100644 index 00000000000..7efe3b4549f --- /dev/null +++ b/keyboards/40percentclub/i75/i75.c @@ -0,0 +1,43 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "i75.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/40percentclub/i75/i75.h b/keyboards/40percentclub/i75/i75.h new file mode 100644 index 00000000000..a31c9f6e6ff --- /dev/null +++ b/keyboards/40percentclub/i75/i75.h @@ -0,0 +1,24 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_40percentclub_i75_promicro + #include "promicro.h" +#elif KEYBOARD_40percentclub_i75_teensy2 + #include "teensy2.h" +#endif diff --git a/keyboards/40percentclub/i75/info.json b/keyboards/40percentclub/i75/info.json new file mode 100644 index 00000000000..033bf02bcc5 --- /dev/null +++ b/keyboards/40percentclub/i75/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "i75", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x15": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}] + } + } +} diff --git a/keyboards/40percentclub/i75/keymaps/default/config.h b/keyboards/40percentclub/i75/keymaps/default/config.h new file mode 100644 index 00000000000..6173b63272f --- /dev/null +++ b/keyboards/40percentclub/i75/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/i75/keymaps/default/keymap.c b/keyboards/40percentclub/i75/keymaps/default/keymap.c new file mode 100644 index 00000000000..3054f8ebe5e --- /dev/null +++ b/keyboards/40percentclub/i75/keymaps/default/keymap.c @@ -0,0 +1,66 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_5x15( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/i75/keymaps/default/readme.md b/keyboards/40percentclub/i75/keymaps/default/readme.md new file mode 100644 index 00000000000..4d054181fb6 --- /dev/null +++ b/keyboards/40percentclub/i75/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for i75 diff --git a/keyboards/40percentclub/i75/promicro/config.h b/keyboards/40percentclub/i75/promicro/config.h new file mode 100644 index 00000000000..d4cd9977362 --- /dev/null +++ b/keyboards/40percentclub/i75/promicro/config.h @@ -0,0 +1,40 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B4, E6, D7, C6, D4, D0, D1, D2, D3 } +#define MATRIX_COL_PINS { B5, B6, B2, B3, B1, F7, F6, F5, F4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/40percentclub/i75/promicro/promicro.c b/keyboards/40percentclub/i75/promicro/promicro.c new file mode 100644 index 00000000000..28684e7144d --- /dev/null +++ b/keyboards/40percentclub/i75/promicro/promicro.c @@ -0,0 +1,16 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "i75.h" diff --git a/keyboards/40percentclub/i75/promicro/promicro.h b/keyboards/40percentclub/i75/promicro/promicro.h new file mode 100644 index 00000000000..29394855a68 --- /dev/null +++ b/keyboards/40percentclub/i75/promicro/promicro.h @@ -0,0 +1,47 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "i75.h" +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_5x15( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, \ + K33, K34, K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, K64, K65, \ + K66, K67, K68, K70, K71, K72, K73, K74, K75, K76, K77, K78, K80, K81, K82 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ + { K70, K71, K72, K73, K74, K75, K76, K77, K78 }, \ + { K80, K81, K82 } \ +} diff --git a/keyboards/40percentclub/i75/promicro/rules.mk b/keyboards/40percentclub/i75/promicro/rules.mk new file mode 100644 index 00000000000..dc6f1962373 --- /dev/null +++ b/keyboards/40percentclub/i75/promicro/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/40percentclub/i75/readme.md b/keyboards/40percentclub/i75/readme.md new file mode 100644 index 00000000000..9bdad68ada4 --- /dev/null +++ b/keyboards/40percentclub/i75/readme.md @@ -0,0 +1,28 @@ +# i75 + +![i75](https://1.bp.blogspot.com/-eRSwPnvgliI/WCYQ-aYihoI/AAAAAAAB_Bc/a7i1Envc1FYiEHeqvyHw80VxTAnafDsPgCLcB/s320/IMG_20161003_084555.jpg) +=== + +5x15 grid layout, multiple controllers supported +- Pro Micro +- PJRC Teensy 2.0 +- PJRC Teensy LC/3.2 (**NB: Not currently ported**) + +The matrix is a 9x9 grid. This uses all of the available pins on the Pro Micro. The other controllers have pins left over. The serial pins and pins connected to LEDs were avoided if possible. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/i75_ProMicro) + +Keyboard Maintainer: QMK Community +Hardware Supported: i75 PCB +Hardware Availability: [i75 project on 40% Keyboards](http://www.40percent.club/2016/11/i75.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/i75:default + +If you would like to use one of the alternative controllers: + + make 40percentclub/i75/promicro:default + make 40percentclub/i75/teensy2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/i75/rules.mk b/keyboards/40percentclub/i75/rules.mk new file mode 100644 index 00000000000..6f79143a18b --- /dev/null +++ b/keyboards/40percentclub/i75/rules.mk @@ -0,0 +1,23 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_5x15 +DEFAULT_FOLDER = 40percentclub/i75/promicro diff --git a/keyboards/40percentclub/i75/teensy2/config.h b/keyboards/40percentclub/i75/teensy2/config.h new file mode 100644 index 00000000000..bcf9b1b888b --- /dev/null +++ b/keyboards/40percentclub/i75/teensy2/config.h @@ -0,0 +1,40 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D2, D1, D0, B7, B3, B2, B1, B0 } +#define MATRIX_COL_PINS { C6, C7, D6, D7, B5, B6, F7, F6, F5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/40percentclub/i75/teensy2/rules.mk b/keyboards/40percentclub/i75/teensy2/rules.mk new file mode 100644 index 00000000000..3fb7c7e5a7e --- /dev/null +++ b/keyboards/40percentclub/i75/teensy2/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/40percentclub/i75/teensy2/teensy2.c b/keyboards/40percentclub/i75/teensy2/teensy2.c new file mode 100644 index 00000000000..28684e7144d --- /dev/null +++ b/keyboards/40percentclub/i75/teensy2/teensy2.c @@ -0,0 +1,16 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "i75.h" diff --git a/keyboards/40percentclub/i75/teensy2/teensy2.h b/keyboards/40percentclub/i75/teensy2/teensy2.h new file mode 100644 index 00000000000..29394855a68 --- /dev/null +++ b/keyboards/40percentclub/i75/teensy2/teensy2.h @@ -0,0 +1,47 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "i75.h" +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_5x15( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, \ + K33, K34, K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, K64, K65, \ + K66, K67, K68, K70, K71, K72, K73, K74, K75, K76, K77, K78, K80, K81, K82 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ + { K70, K71, K72, K73, K74, K75, K76, K77, K78 }, \ + { K80, K81, K82 } \ +} diff --git a/keyboards/40percentclub/luddite/config.h b/keyboards/40percentclub/luddite/config.h new file mode 100644 index 00000000000..36bda061439 --- /dev/null +++ b/keyboards/40percentclub/luddite/config.h @@ -0,0 +1,43 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x1001 +#define MANUFACTURER di0ib +#define PRODUCT Luddite +#define DESCRIPTION Luddite Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D3, D2, D1, D0, D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 4 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 // Number of LEDs +// #define RGBLIGHT_HUE_STEP 10 +// #define RGBLIGHT_SAT_STEP 17 +// #define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/40percentclub/luddite/info.json b/keyboards/40percentclub/luddite/info.json new file mode 100644 index 00000000000..e3c5fa9f9de --- /dev/null +++ b/keyboards/40percentclub/luddite/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "Luddite", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/40percentclub/luddite/keymaps/default/keymap.c b/keyboards/40percentclub/luddite/keymaps/default/keymap.c new file mode 100644 index 00000000000..fa3a83ba878 --- /dev/null +++ b/keyboards/40percentclub/luddite/keymaps/default/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT , KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL + ), + + [_FN1] = LAYOUT_60_ansi( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_GRV, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/40percentclub/luddite/keymaps/tzarc/config.h b/keyboards/40percentclub/luddite/keymaps/tzarc/config.h new file mode 100644 index 00000000000..f8feb798d42 --- /dev/null +++ b/keyboards/40percentclub/luddite/keymaps/tzarc/config.h @@ -0,0 +1,6 @@ +#undef RGBLED_NUM +#define RGBLED_NUM 16 + +#define QMK_ESC_OUTPUT F4 +#define QMK_ESC_INPUT D3 +#define QMK_LED B0 diff --git a/keyboards/40percentclub/luddite/keymaps/tzarc/keymap.c b/keyboards/40percentclub/luddite/keymaps/tzarc/keymap.c new file mode 100644 index 00000000000..dfa1c499c29 --- /dev/null +++ b/keyboards/40percentclub/luddite/keymaps/tzarc/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT , KC_SPC, KC_RALT, KC_APP, MO(_FN1), KC_RCTL + ), + + [_FN1] = LAYOUT_60_ansi( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_GRV, _______, _______, _______, _______, KC_RGUI, _______, _______ + ) +}; diff --git a/keyboards/40percentclub/luddite/keymaps/tzarc/rules.mk b/keyboards/40percentclub/luddite/keymaps/tzarc/rules.mk new file mode 100644 index 00000000000..0613ea8667c --- /dev/null +++ b/keyboards/40percentclub/luddite/keymaps/tzarc/rules.mk @@ -0,0 +1 @@ +BOOTLOADER = qmk-dfu diff --git a/keyboards/luddite/luddite.c b/keyboards/40percentclub/luddite/luddite.c similarity index 100% rename from keyboards/luddite/luddite.c rename to keyboards/40percentclub/luddite/luddite.c diff --git a/keyboards/40percentclub/luddite/luddite.h b/keyboards/40percentclub/luddite/luddite.h new file mode 100644 index 00000000000..5b8b95fea46 --- /dev/null +++ b/keyboards/40percentclub/luddite/luddite.h @@ -0,0 +1,20 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K10, K11, K12, K13, K14, K15, \ + K16, K17, K20, K21, K22, K23, K24, K25, K26, K27, K30, K31, K32, K33, \ + K34, K35, K36, K37, K40, K41, K42, K43, K44, K45, K46, K47, K50, \ + K51, K52, K53, K54, K55, K56, K57, K60, K61, K62, K63, K64, \ + K65, K66, K67, K70, K71, K72, K73, K74\ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67 }, \ + { K70, K71, K72, K73, K74 }, \ +} diff --git a/keyboards/40percentclub/luddite/readme.md b/keyboards/40percentclub/luddite/readme.md new file mode 100644 index 00000000000..928b6de8f3f --- /dev/null +++ b/keyboards/40percentclub/luddite/readme.md @@ -0,0 +1,21 @@ +# Luddite + +![Luddite](https://1.bp.blogspot.com/-GAAa-sMU_WU/W7uYLJJ8x1I/AAAAAAACS44/31n2z69BSboM4KT48YkNMJRYciC8LUMWgCLcBGAs/s640/a.jpg) +=== + +Luddite 60% keyboard with backlight and RGB underglow. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/luddite) + +Keyboard Maintainer: QMK Community +Hardware Supported: Luddite PCB +Hardware Availability: [Luddite project on 40% Keyboards](http://www.40percent.club/search/label/luddite) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/luddite:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +First pass at adding support for the luddite keyboard. Compiles but completely +untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/luddite/rules.mk b/keyboards/40percentclub/luddite/rules.mk new file mode 100644 index 00000000000..8dff21f9ab7 --- /dev/null +++ b/keyboards/40percentclub/luddite/rules.mk @@ -0,0 +1,74 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes + +LAYOUTS = 60_ansi diff --git a/keyboards/40percentclub/mf68/config.h b/keyboards/40percentclub/mf68/config.h new file mode 100644 index 00000000000..5bda9bb7864 --- /dev/null +++ b/keyboards/40percentclub/mf68/config.h @@ -0,0 +1,175 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x0510 +#define DEVICE_VER 0x0101 +#define MANUFACTURER di0ib +#define PRODUCT MF68 +#define DESCRIPTION Magicforce 68 with programmable PCB replacement + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } +#define MATRIX_COL_PINS { D3, D2, D1, D0, D4, C6, D7, E6, B4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/mf68/info.json b/keyboards/40percentclub/mf68/info.json similarity index 100% rename from keyboards/mf68/info.json rename to keyboards/40percentclub/mf68/info.json diff --git a/keyboards/40percentclub/mf68/keymaps/68keys/config.h b/keyboards/40percentclub/mf68/keymaps/68keys/config.h new file mode 100644 index 00000000000..a0a576b7bfa --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/68keys/config.h @@ -0,0 +1,15 @@ +#pragma once + +/* USB Device descriptor parameter */ +#undef VENDOR_ID +#undef PRODUCT_ID +#undef DEVICE_VER +#undef MANUFACTURER +#undef PRODUCT +#undef DESCRIPTION +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0068 +#define MANUFACTURER 68Keys.io +#define PRODUCT The 68Keys.io Keyboard +#define DESCRIPTION A 68 keys mechanical keyboard diff --git a/keyboards/40percentclub/mf68/keymaps/68keys/keymap.c b/keyboards/40percentclub/mf68/keymaps/68keys/keymap.c new file mode 100644 index 00000000000..3778ea21e79 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/68keys/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_68_ansi( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_ESC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + KC_CAPSLOCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/keyboards/40percentclub/mf68/keymaps/68keys/readme.md b/keyboards/40percentclub/mf68/keymaps/68keys/readme.md new file mode 100644 index 00000000000..4b7cdf12591 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/68keys/readme.md @@ -0,0 +1,23 @@ +# 68Keys.io + +Custom [68Keys.io](https://68keys.io) DIY keyboard. + +Keymap Maintainer: [sbstjn](https://sbstjn.com) +Hardware Supported: mf68 +Hardware Availability: [DIY Guide](https://68keys.io) + +Make example for this keyboard (after setting up your build environment): + +```bash +$ > cd qmk_firmware/ +$ > make 40percentclub/mf68:68keys +``` + +Example of flashing this keyboard: + +```bash +$ > cd qmk_firmware/ +$ > make 40percentclub/mf68:68keys:avrdude +``` + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/mf68/keymaps/68keys/rules.mk b/keyboards/40percentclub/mf68/keymaps/68keys/rules.mk new file mode 100644 index 00000000000..96ce13fe73f --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/68keys/rules.mk @@ -0,0 +1,5 @@ +BOOTLOADER = atmel-dfu + +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +BACKLIGHT_ENABLE = no diff --git a/keyboards/40percentclub/mf68/keymaps/default/keymap.c b/keyboards/40percentclub/mf68/keymaps/default/keymap.c new file mode 100644 index 00000000000..c91b9b908ab --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/default/keymap.c @@ -0,0 +1,31 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _FN1 1 +#define _FN2 2 + +#define FN2_GRV LT(_FN2, KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_68_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + FN2_GRV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [_FN1] = LAYOUT_68_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, KC_VOLU, KC_HOME, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, _______, KC_VOLD, KC_END, + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT + ), + [_FN2] = LAYOUT_68_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, KC_VOLU, KC_HOME, + _______, _______, _______, KC_UP, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, KC_VOLD, KC_END, + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, _______, _______, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT + ) +}; diff --git a/keyboards/40percentclub/mf68/keymaps/factory/keymap.c b/keyboards/40percentclub/mf68/keymaps/factory/keymap.c new file mode 100644 index 00000000000..12032350cd4 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/factory/keymap.c @@ -0,0 +1,59 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _FN1 1 +#define _FN2 2 +#define KC_ KC_TRNS +#define KC_X0 LT(_FN2, KC_CAPS) +#define KC_X1 MO(_FN1) +#define KC_X2 BL_STEP +#define KC_X3 BL_BRTG +#define KC_X4 BL_TOGG +#define KC_X5 BL_INC +#define KC_X6 BL_DEC + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, + /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ + TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, + /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ + X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , + /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ + LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , + /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ + LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT + /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ + ), + + [_FN1] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , ,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , UP , , , , , , ,PSCR,SLCK,PAUS, X2 , , ,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + X0 ,LEFT,DOWN,RGHT, , X6 , X5 , X4 , X3 , X2 ,HOME, , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , ,MPLY,MSTP,MPRV,MNXT,VOLD,VOLU,MUTE, ,END , , X5 , + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , X3 , X6 , X4 + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ), + + [_FN2] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , , , , , , 0 , 1 , 2 , 3 , , , MUTE, + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , MPRV,MPLY,MNXT + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ) +}; diff --git a/keyboards/40percentclub/mf68/keymaps/mf68_ble/config.h b/keyboards/40percentclub/mf68/keymaps/mf68_ble/config.h new file mode 100644 index 00000000000..7d96ab9e249 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/mf68_ble/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* Overrides for Feather 32u4 Bluefruit */ + +/* USB Device descriptor parameter */ +#undef DESCRIPTION +#define DESCRIPTION Magicforce 68 BLE + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS +#undef UNUSED_PINS +#define MATRIX_ROW_PINS { D1, D0, C6, D7, B5, B6, B7, D6 } +#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, F0, D2, D3 } +#define UNUSED_PINS {B5} diff --git a/keyboards/40percentclub/mf68/keymaps/mf68_ble/keymap.c b/keyboards/40percentclub/mf68/keymaps/mf68_ble/keymap.c new file mode 100644 index 00000000000..ae7e7297cb8 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/mf68_ble/keymap.c @@ -0,0 +1,53 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _FN1 1 +#define _FN2 2 +#define KC_ KC_TRNS +#define KC_X0 LT(_FN2, KC_GRV) +#define KC_X1 MO(_FN1) +#define KC_X2 BL_STEP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, + /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ + TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, + /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ + X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , + /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ + LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , + /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ + LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT + /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ + ), + + [_FN1] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , , UP , , , , , , , , , X2 , , VOLD,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + , ,LEFT,DOWN,RGHT, , , , , , , , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , , , , , , ,MUTE, , , , , MUTE, + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , MPRV,MPLY,MNXT + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ), + + [_FN2] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , , , , , , 0 , 1 , 2 , 3 , , , MUTE, + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , MPRV,MPLY,MNXT + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ) +}; diff --git a/keyboards/40percentclub/mf68/keymaps/mf68_ble/readme.md b/keyboards/40percentclub/mf68/keymaps/mf68_ble/readme.md new file mode 100644 index 00000000000..e590ae3e6db --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/mf68_ble/readme.md @@ -0,0 +1,29 @@ +# mf68_ble + +![mf68_ble](https://i.imgur.com/zuTyy7k.jpg) +=== + +Magicforce 68 with [replacement PCB](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) designed by [di0ib](https://github.com/di0ib). + +Keyboard Maintainer: QMK Community +Hardware Supported: [Feather 32u4 Bluefruit](https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/) +Please note: This is 32u4 and not M0 +Hardware Availability: [PCB files](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68/pcb) +[MF68 thicc case files](https://github.com/harshitgoel96/mf68-case-thicc) +Story +----- + +The story and the idea behind this mod is available on [my reddit post](https://www.reddit.com/r/MechanicalKeyboards/comments/7eiiht/guide_i_built_a_bluetooth_enabled_magicforce68_no/) + +Wiring +------ + +Below is how you wire the Feather to PCB + +![wire map](https://i.imgur.com/zYOjlTA.png) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/mf68:mf68_ble + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk b/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk new file mode 100644 index 00000000000..2509d0bf4eb --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk @@ -0,0 +1,66 @@ +# Overrides for Feather 32u4 Bluefruit +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 8000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BLUETOOTH = AdafruitBLE +BACKLIGHT_ENABLE = no diff --git a/keyboards/mf68/mf68.c b/keyboards/40percentclub/mf68/mf68.c similarity index 100% rename from keyboards/mf68/mf68.c rename to keyboards/40percentclub/mf68/mf68.c diff --git a/keyboards/40percentclub/mf68/mf68.h b/keyboards/40percentclub/mf68/mf68.h new file mode 100644 index 00000000000..a34f9cde8de --- /dev/null +++ b/keyboards/40percentclub/mf68/mf68.h @@ -0,0 +1,37 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_68_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ + K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ + K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ + K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ + { K70, K71, K72, K73, K74 } \ +} + +#define LAYOUT_kc( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ + K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ + K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ + K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ +) LAYOUT_68_ansi( \ + KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ + KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ + KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ + KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ + KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ + KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ + KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ + KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ +) diff --git a/keyboards/40percentclub/mf68/readme.md b/keyboards/40percentclub/mf68/readme.md new file mode 100644 index 00000000000..825c265f167 --- /dev/null +++ b/keyboards/40percentclub/mf68/readme.md @@ -0,0 +1,18 @@ +# mf68 + +![mf68](https://3.bp.blogspot.com/-0YCA3Hx2Rq0/WD3U3GWhyvI/AAAAAAAB_Uo/RWTeyCPblGcxDrDwT9WL9ck2ZRuR26DgACLcB/s640/IMG_20161129_063741.jpg) +=== + +Magicforce 68 with [replacement PCB](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) designed by [di0ib](https://github.com/di0ib). + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) + +Keyboard Maintainer: QMK Community +Hardware Supported: Pro Micro +Hardware Availability: [PCB files](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68/pcb) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/mf68:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/mf68/rules.mk b/keyboards/40percentclub/mf68/rules.mk new file mode 100644 index 00000000000..27642d8604f --- /dev/null +++ b/keyboards/40percentclub/mf68/rules.mk @@ -0,0 +1,79 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + +LAYOUTS = 68_ansi diff --git a/keyboards/40percentclub/nano/config.h b/keyboards/40percentclub/nano/config.h new file mode 100644 index 00000000000..5eb65c74ad8 --- /dev/null +++ b/keyboards/40percentclub/nano/config.h @@ -0,0 +1,59 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x0007 +#define DEVICE_VER 0x0001 +#define MANUFACTURER di0ib +#define PRODUCT Nano +#define DESCRIPTION 8 key microswitch board + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * NO_DIODE = switches are directly connected to AVR pins + * +*/ +// #define MATRIX_ROW_PINS { D0, D5 } +// #define MATRIX_COL_PINS { F1, F0, B0 } +#define DIRECT_PINS { \ + { F4, F5, F6, F7 }, \ + { D1, D0, D4, C6 }, \ +} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +//#define DIODE_DIRECTION CUSTOM_MATRIX + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 // Number of LEDs diff --git a/keyboards/nano/info.json b/keyboards/40percentclub/nano/info.json similarity index 100% rename from keyboards/nano/info.json rename to keyboards/40percentclub/nano/info.json diff --git a/keyboards/40percentclub/nano/keymaps/default/keymap.c b/keyboards/40percentclub/nano/keymaps/default/keymap.c new file mode 100644 index 00000000000..9ce282a28a1 --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/default/keymap.c @@ -0,0 +1,18 @@ +#include QMK_KEYBOARD_H + +#define _MAIN 0 +#define _FN 1 + +#define KC_X0 LT(_FN, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MAIN] = LAYOUT( + KC_VOLU, KC_MPLY, KC_MPRV, KC_PGUP, + KC_VOLD, KC_MUTE, KC_MNXT, KC_PGDN + ), + + [_FN] = LAYOUT( + KC_F, _______, RGB_HUI, _______, + RGB_TOG, RGB_MOD, RGB_HUD, _______ + ) +}; diff --git a/keyboards/ergodash/rev2/keymaps/default/rules.mk b/keyboards/40percentclub/nano/keymaps/default/rules.mk similarity index 100% rename from keyboards/ergodash/rev2/keymaps/default/rules.mk rename to keyboards/40percentclub/nano/keymaps/default/rules.mk diff --git a/keyboards/nano/keymaps/spooka/config.h b/keyboards/40percentclub/nano/keymaps/spooka/config.h similarity index 100% rename from keyboards/nano/keymaps/spooka/config.h rename to keyboards/40percentclub/nano/keymaps/spooka/config.h diff --git a/keyboards/40percentclub/nano/keymaps/spooka/keymap.c b/keyboards/40percentclub/nano/keymaps/spooka/keymap.c new file mode 100644 index 00000000000..7908794fe01 --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/spooka/keymap.c @@ -0,0 +1,10 @@ +#include QMK_KEYBOARD_H + +#define _MAIN 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MAIN] = LAYOUT( + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD + ) +}; diff --git a/keyboards/nano/keymaps/spooka/rules.mk b/keyboards/40percentclub/nano/keymaps/spooka/rules.mk similarity index 100% rename from keyboards/nano/keymaps/spooka/rules.mk rename to keyboards/40percentclub/nano/keymaps/spooka/rules.mk diff --git a/keyboards/nano/nano.c b/keyboards/40percentclub/nano/nano.c similarity index 100% rename from keyboards/nano/nano.c rename to keyboards/40percentclub/nano/nano.c diff --git a/keyboards/40percentclub/nano/nano.h b/keyboards/40percentclub/nano/nano.h new file mode 100644 index 00000000000..881309738bd --- /dev/null +++ b/keyboards/40percentclub/nano/nano.h @@ -0,0 +1,13 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_2x4( \ + k01, k02, k03, k04, \ + k05, k06, k07, k08 \ + ) { \ + { k01, k02, k03, k04 }, \ + { k05, k06, k07, k08 } \ +} + +#define LAYOUT LAYOUT_ortho_2x4 diff --git a/keyboards/40percentclub/nano/readme.md b/keyboards/40percentclub/nano/readme.md new file mode 100644 index 00000000000..2677e5b7b74 --- /dev/null +++ b/keyboards/40percentclub/nano/readme.md @@ -0,0 +1,16 @@ +# nano + +![nano](https://1.bp.blogspot.com/-goa_eXx1McA/WEhvoSdfDSI/AAAAAAAB_bM/XdstcXe_eKkQxuYcNI5cTySTVo3xZxaeQCEw/s640/IMG_20161207_101051.jpg) +=== + +A 2x4 mini switch pad built using 6mm x 6mm tactile switches and a Pro Micro. [More info here.](http://www.40percent.club/2016/12/nano-tmk.html) + +Keyboard Maintainer: QMK Community +Hardware Supported: Pro Micro ATmega32U4 +Hardware Availability: [PCB Files](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/nano/pcb) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/nano:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/nano/rules.mk b/keyboards/40percentclub/nano/rules.mk new file mode 100644 index 00000000000..e3c97e0d442 --- /dev/null +++ b/keyboards/40percentclub/nano/rules.mk @@ -0,0 +1,78 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/40percentclub/nein/config.h b/keyboards/40percentclub/nein/config.h new file mode 100644 index 00000000000..da1bc91dd12 --- /dev/null +++ b/keyboards/40percentclub/nein/config.h @@ -0,0 +1,239 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x9999 +#define MANUFACTURER di0ib +#define PRODUCT The nein Keyboard +#define DESCRIPTION 9 key macropad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 3 + +/* Keyboard Matrix Assignments */ +#define DIRECT_PINS { \ + { F4, F5, F6 }, \ + { F7, B1, B3 }, \ + { B2, B6, B5 } \ +} +#define UNUSED_PINS + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/40percentclub/nein/info.json b/keyboards/40percentclub/nein/info.json new file mode 100644 index 00000000000..aaadc718616 --- /dev/null +++ b/keyboards/40percentclub/nein/info.json @@ -0,0 +1,22 @@ +{ + "keyboard_name": "nein", + "url": "", + "maintainer": "qmk", + "width": 3, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2} + ] + } + } +} diff --git a/keyboards/40percentclub/nein/keymaps/default/keymap.c b/keyboards/40percentclub/nein/keymaps/default/keymap.c new file mode 100644 index 00000000000..674a8bb7fc4 --- /dev/null +++ b/keyboards/40percentclub/nein/keymaps/default/keymap.c @@ -0,0 +1,29 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_3x3( + KC_MUTE, KC_HOME, KC_MPLY, \ + MO(1), KC_UP, KC_END, \ + KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT_ortho_3x3( + RESET, _______, KC_STOP, \ + _______, _______, RGB_MOD, \ + KC_MPRV, _______, KC_MNXT \ + ), +}; diff --git a/keyboards/40percentclub/nein/nein.c b/keyboards/40percentclub/nein/nein.c new file mode 100644 index 00000000000..0b4d05d9412 --- /dev/null +++ b/keyboards/40percentclub/nein/nein.c @@ -0,0 +1,16 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "nein.h" diff --git a/keyboards/40percentclub/nein/nein.h b/keyboards/40percentclub/nein/nein.h new file mode 100644 index 00000000000..fd0118f75b4 --- /dev/null +++ b/keyboards/40percentclub/nein/nein.h @@ -0,0 +1,37 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_3x3( \ + k00, k01, k02, \ + k10, k11, k12, \ + k20, k21, k22 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 }, \ + { k20, k21, k22 } \ +} diff --git a/keyboards/40percentclub/nein/readme.md b/keyboards/40percentclub/nein/readme.md new file mode 100644 index 00000000000..49ce04f13bd --- /dev/null +++ b/keyboards/40percentclub/nein/readme.md @@ -0,0 +1,18 @@ +# nein + +![nein](https://2.bp.blogspot.com/-avYV4grcAPQ/XL9a67SxgKI/AAAAAAACVCE/GSGVYRThaEEDd14M3LG34gQTv5ZabRI0QCEwYBhgL/s640/a.jpg) +=== + +A 9 key macropad. + +Powered by a Pro Micro and can fit any of the various different sized variations of Pro Micro. + +Keyboard Maintainer: QMK Community +Hardware Supported: nein PCB +Hardware Availability: [nein project on 40% Keyboards](https://www.40percent.club/2019/04/nein.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/nein:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/nein/rules.mk b/keyboards/40percentclub/nein/rules.mk new file mode 100644 index 00000000000..1e3748287ce --- /dev/null +++ b/keyboards/40percentclub/nein/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/40percentclub/nori/config.h b/keyboards/40percentclub/nori/config.h new file mode 100644 index 00000000000..ecaa68ada0b --- /dev/null +++ b/keyboards/40percentclub/nori/config.h @@ -0,0 +1,216 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0444 +#define MANUFACTURER di0ib +#define PRODUCT The nori Keyboard +#define DESCRIPTION A modular compact keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D2, D1, D0 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, D4, C6, D7, E6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +//#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// enable RGB underglow +#define RGB_DI_PIN B4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 10 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/40percentclub/nori/info.json b/keyboards/40percentclub/nori/info.json new file mode 100644 index 00000000000..db0d6aaadb7 --- /dev/null +++ b/keyboards/40percentclub/nori/info.json @@ -0,0 +1,117 @@ +{ + "keyboard_name": "nori", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "key_count": 16, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 } ] + }, + "LAYOUT_ortho_4x8": { + "key_count": 32, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 4, "y": 0 }, + { "w": 1, "x": 5, "y": 0 }, + { "w": 1, "x": 6, "y": 0 }, + { "w": 1, "x": 7, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 4, "y": 1 }, + { "w": 1, "x": 5, "y": 1 }, + { "w": 1, "x": 6, "y": 1 }, + { "w": 1, "x": 7, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 4, "y": 2 }, + { "w": 1, "x": 5, "y": 2 }, + { "w": 1, "x": 6, "y": 2 }, + { "w": 1, "x": 7, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 }, + { "w": 1, "x": 4, "y": 3 }, + { "w": 1, "x": 5, "y": 3 }, + { "w": 1, "x": 6, "y": 3 }, + { "w": 1, "x": 7, "y": 3 } ] + }, + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 4, "y": 0 }, + { "w": 1, "x": 5, "y": 0 }, + { "w": 1, "x": 6, "y": 0 }, + { "w": 1, "x": 7, "y": 0 }, + { "w": 1, "x": 8, "y": 0 }, + { "w": 1, "x": 9, "y": 0 }, + { "w": 1, "x": 10, "y": 0 }, + { "w": 1, "x": 11, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 4, "y": 1 }, + { "w": 1, "x": 5, "y": 1 }, + { "w": 1, "x": 6, "y": 1 }, + { "w": 1, "x": 7, "y": 1 }, + { "w": 1, "x": 8, "y": 1 }, + { "w": 1, "x": 9, "y": 1 }, + { "w": 1, "x": 10, "y": 1 }, + { "w": 1, "x": 11, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 4, "y": 2 }, + { "w": 1, "x": 5, "y": 2 }, + { "w": 1, "x": 6, "y": 2 }, + { "w": 1, "x": 7, "y": 2 }, + { "w": 1, "x": 8, "y": 2 }, + { "w": 1, "x": 9, "y": 2 }, + { "w": 1, "x": 10, "y": 2 }, + { "w": 1, "x": 11, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 }, + { "w": 1, "x": 4, "y": 3 }, + { "w": 1, "x": 5, "y": 3 }, + { "w": 1, "x": 6, "y": 3 }, + { "w": 1, "x": 7, "y": 3 }, + { "w": 1, "x": 8, "y": 3 }, + { "w": 1, "x": 9, "y": 3 }, + { "w": 1, "x": 10, "y": 3 }, + { "w": 1, "x": 11, "y": 3 } ] + } + } +} diff --git a/keyboards/40percentclub/nori/keymaps/default/config.h b/keyboards/40percentclub/nori/keymaps/default/config.h new file mode 100644 index 00000000000..90831ff34e7 --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/default/config.h @@ -0,0 +1,23 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } diff --git a/keyboards/40percentclub/nori/keymaps/default/keymap.c b/keyboards/40percentclub/nori/keymaps/default/keymap.c new file mode 100644 index 00000000000..3c225a0d9c2 --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/default/keymap.c @@ -0,0 +1,159 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + } + return true; +} diff --git a/keyboards/40percentclub/nori/keymaps/default/readme.md b/keyboards/40percentclub/nori/keymaps/default/readme.md new file mode 100644 index 00000000000..4a55a35e4be --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap diff --git a/keyboards/40percentclub/nori/keymaps/macro/config.h b/keyboards/40percentclub/nori/keymaps/macro/config.h new file mode 100644 index 00000000000..03f34d3f517 --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/macro/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here +#undef RGBLED_NUM +#define RGBLED_NUM 4 diff --git a/keyboards/40percentclub/nori/keymaps/macro/keymap.c b/keyboards/40percentclub/nori/keymaps/macro/keymap.c new file mode 100644 index 00000000000..14dc0b678c9 --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/macro/keymap.c @@ -0,0 +1,41 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_4x4( /* Base */ + KC_INT1, KC_INT2, KC_INT3, KC_INT5, \ + KC_F13, KC_F14, KC_F15, KC_F16, \ + KC_F17, KC_F18, KC_F19, KC_F20, \ + KC_F21, KC_F22, KC_F23, KC_F24 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/nori/keymaps/macro/readme.md b/keyboards/40percentclub/nori/keymaps/macro/readme.md new file mode 100644 index 00000000000..de2324248ac --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default single board macro keymap for nori diff --git a/keyboards/40percentclub/nori/nori.c b/keyboards/40percentclub/nori/nori.c new file mode 100644 index 00000000000..9d27df7a5c9 --- /dev/null +++ b/keyboards/40percentclub/nori/nori.c @@ -0,0 +1,43 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "nori.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/40percentclub/nori/nori.h b/keyboards/40percentclub/nori/nori.h new file mode 100644 index 00000000000..802f0bfce6d --- /dev/null +++ b/keyboards/40percentclub/nori/nori.h @@ -0,0 +1,69 @@ +/* Copyright 2018 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#define ___ KC_NO + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) \ +{ \ + { K00, K01, K02, K03, ___, ___, ___, ___, ___, ___, ___, ___ }, \ + { K10, K11, K12, K13, ___, ___, ___, ___, ___, ___, ___, ___ }, \ + { K20, K21, K22, K23, ___, ___, ___, ___, ___, ___, ___, ___ }, \ + { K30, K31, K32, K33, ___, ___, ___, ___, ___, ___, ___, ___ } \ +} +#define LAYOUT_ortho_4x8( \ + K00, K01, K02, K03, K04, K05, K06, K07, \ + K10, K11, K12, K13, K14, K15, K16, K17, \ + K20, K21, K22, K23, K24, K25, K26, K27, \ + K30, K31, K32, K33, K34, K35, K36, K37\ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, ___, ___, ___, ___ }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, ___, ___, ___, ___ }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, ___, ___, ___, ___ }, \ + { K30, K31, K32, K33, K34, K35, K35, K37, ___, ___, ___, ___ } \ +} +#define LAYOUT_ortho_4x12( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b } \ +} + +#define LAYOUT_kc_ortho_4x12( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ +) \ +{ \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0a, KC_##K0b }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1a, KC_##K1b }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2a, KC_##K2b }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3a, KC_##K3b } \ +} diff --git a/keyboards/40percentclub/nori/readme.md b/keyboards/40percentclub/nori/readme.md new file mode 100644 index 00000000000..3dd8afff48b --- /dev/null +++ b/keyboards/40percentclub/nori/readme.md @@ -0,0 +1,18 @@ +# nori + +![nori](https://2.bp.blogspot.com/-UBFz3c1-8hM/W48N0ynt6TI/AAAAAAACSQg/MHLY-DchBBMiiHUeIPVt_4T6x-ntmdjgwCEwYBhgL/s640/a.jpg) +=== + +A 4x12 matrix using 3 modular 4x4 matrix boards and powered by a Pro Micro. + +this one is using a Pro Micro. The Pro Micro has less data pins available so only 3 boards can be connected instead of 4. There are 2 pins left over, I used one (B5) for a backlight circuit like on a Gherkin. The other data pin (B4) is left for possible use with a WS2812B strip. + +Keyboard Maintainer: QMK Community +Hardware Supported: nori PCB +Hardware Availability: [nori project on 40% Keyboards](https://www.40percent.club/2018/10/nori.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/nori:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/40percentclub/nori/rules.mk b/keyboards/40percentclub/nori/rules.mk new file mode 100644 index 00000000000..f52135379af --- /dev/null +++ b/keyboards/40percentclub/nori/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 diff --git a/keyboards/40percentclub/readme.md b/keyboards/40percentclub/readme.md new file mode 100644 index 00000000000..a8dd0e84f5f --- /dev/null +++ b/keyboards/40percentclub/readme.md @@ -0,0 +1,4 @@ +# 40% Keyboards + +Website: [40percent.club](http://www.40percent.club/) +The original TMK firmware: [repo](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/) diff --git a/keyboards/40percentclub/tomato/config.h b/keyboards/40percentclub/tomato/config.h new file mode 100644 index 00000000000..e131ce5c203 --- /dev/null +++ b/keyboards/40percentclub/tomato/config.h @@ -0,0 +1,40 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 40 Percent Club +#define PRODUCT Tomato +#define DESCRIPTION A 30 key ortholinear keyboard with RGB backlighting + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 6 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* eliminate lag on space cadet mods */ +#define PERMISSIVE_HOLD + +/* setup lighting */ +#define RGB_DI_PIN B5 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 30 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/tomato/info.json b/keyboards/40percentclub/tomato/info.json similarity index 100% rename from keyboards/tomato/info.json rename to keyboards/40percentclub/tomato/info.json diff --git a/keyboards/40percentclub/tomato/keymaps/default/keymap.c b/keyboards/40percentclub/tomato/keymaps/default/keymap.c new file mode 100644 index 00000000000..01a868d7e30 --- /dev/null +++ b/keyboards/40percentclub/tomato/keymaps/default/keymap.c @@ -0,0 +1,143 @@ +#include QMK_KEYBOARD_H + +#define SPC_F1 LT(1,KC_SPC) +#define BS_F2 LT(2,KC_BSPC) +#define C_F3 LT(3,KC_C) +#define V_F4 LT(4,KC_V) +#define B_F5 LT(5,KC_B) +#define Z_CTL MT(MOD_LCTL, KC_Z) +#define X_ALT MT(MOD_LALT, KC_X) +#define N_ALT MT(MOD_RALT, KC_N) +#define M_CTL MT(MOD_RCTL, KC_M) +#define ENT_SFT MT(MOD_RSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Level 0: Default Layer + * ,-------------------------------------------------------------------------------. + * | Q | W | E | R | T | Y | U | I | O | P | + * |-------------------------------------------------------------------------------| + * | A | S | D | F | G | H | J | K | L | ESC | + * |-------------------------------------------------------------------------------| + * | Z | X | C | V | BSPC | SPC | B | N | M | ENT | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P + , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC + , Z_CTL, X_ALT, C_F3, V_F4, BS_F2, SPC_F1, B_F5, N_ALT, M_CTL, ENT_SFT + ), + /* Level 1: Numbers Layer + * ,-------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + * |-------------------------------------------------------------------------------| + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | + * |-------------------------------------------------------------------------------| + * | | | | | DEL | | | | | | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 + , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + , _______,_______,_______,_______,KC_DEL, _______,_______,_______,_______,_______ + ), + /* Level 2: Symbols Layer + * ,-------------------------------------------------------------------------------. + * | ! | @ | # | $ | % | ^ | & | * | ( | ) | + * |-------------------------------------------------------------------------------| + * | F11 | F12 | | | | | | | | ` | + * |-------------------------------------------------------------------------------| + * | | | | | | | | | | | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN + , KC_F11, KC_F12,_______,_______,_______,_______,_______,_______,_______,KC_GRAVE + , _______,_______,_______,_______,_______,_______,_______,_______,_______,_______ + ), + /* Level 3: RGB Layer + * ,-------------------------------------------------------------------------------. + * | | | | | | - | = | [ | ] | \ | + * |-------------------------------------------------------------------------------| + * | Tab | | | | | , | . | / | ; | ' | + * |-------------------------------------------------------------------------------| + * | | | | | | | Left | Down | Up | Right | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( _______,_______,_______,_______,_______,KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS + , KC_TAB, _______,_______,_______,_______,KC_COMM,KC_DOT, KC_SLSH,KC_SCLN,KC_QUOT + , _______,_______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT + ), + /* Level 4: RGB Layer + * ,-------------------------------------------------------------------------------. + * | | | | | | _ | + | { | } | | | + * |-------------------------------------------------------------------------------| + * | Tab | | | | | < | > | ? | : | " | + * |-------------------------------------------------------------------------------| + * | | | | | | | Home | PgDn | PgUp | End | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( _______,_______,_______,_______,_______,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE + , KC_TAB, _______,_______,_______,_______,KC_LT, KC_GT, KC_QUES,KC_COLN,KC_DQUO + , _______,_______,_______,_______,_______,_______,KC_HOME,KC_PGUP,KC_PGDN,KC_END + ), + /* Level 5: RGB Layer + * ,-------------------------------------------------------------------------------. + * | Calc | Web | Mail |Explore| | | | | | | + * |-------------------------------------------------------------------------------| + * |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD|xxxxxxx|xxxxxxx|RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| + * |-------------------------------------------------------------------------------| + * | | | | | Flash | | | | | | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_CALC,KC_WSCH,KC_MAIL,KC_MYCM,_______,_______,_______,_______,_______,_______ + , RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,XXXXXXX,XXXXXXX,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD + , _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______ + ), +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/40percentclub/tomato/readme.md b/keyboards/40percentclub/tomato/readme.md new file mode 100644 index 00000000000..f93105ffdda --- /dev/null +++ b/keyboards/40percentclub/tomato/readme.md @@ -0,0 +1,22 @@ +# Tomato + +![Tomato](https://2.bp.blogspot.com/-k6lyvfZz2WA/WXYyr508D7I/AAAAAAACB8A/UCNP2WCfvWAT8UWsCDICMRXwip5tAZsOwCLcBGAs/s640/a.JPG) +=== + +A 30 key keyboard with programmable rgb backlighting. + +* [The fluff](http://www.40percent.club/2017/07/tomato-in-gherkin.html) +* [The meat](https://github.com/di0ib/Misc/tree/master/tomato) + +Keyboard Maintainer: QMK Community +Hardware Supported: Tomato PCB +Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2017/07/tomato-in-gherkin.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/tomato:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +First pass at adding support for the tomato keyboard. Completely +untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/tomato/rules.mk b/keyboards/40percentclub/tomato/rules.mk new file mode 100644 index 00000000000..844ff998277 --- /dev/null +++ b/keyboards/40percentclub/tomato/rules.mk @@ -0,0 +1,74 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes + +LAYOUTS = ortho_3x10 diff --git a/keyboards/tomato/tomato.c b/keyboards/40percentclub/tomato/tomato.c similarity index 100% rename from keyboards/tomato/tomato.c rename to keyboards/40percentclub/tomato/tomato.c diff --git a/keyboards/40percentclub/tomato/tomato.h b/keyboards/40percentclub/tomato/tomato.h new file mode 100644 index 00000000000..70bffee302a --- /dev/null +++ b/keyboards/40percentclub/tomato/tomato.h @@ -0,0 +1,15 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_3x10( \ + K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \ + K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \ + K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \ +) { \ + { K00, K01, K02, K03, K04, K05 }, \ + { K10, K11, K12, K13, K14, K15 }, \ + { K20, K21, K22, K23, K24, K25 }, \ + { K30, K31, K32, K33, K34, K35 }, \ + { K40, K41, K42, K43, K44, K45 } \ +} diff --git a/keyboards/ut47/LED_controls.ino b/keyboards/40percentclub/ut47/LED_controls.ino similarity index 100% rename from keyboards/ut47/LED_controls.ino rename to keyboards/40percentclub/ut47/LED_controls.ino diff --git a/keyboards/40percentclub/ut47/config.h b/keyboards/40percentclub/ut47/config.h new file mode 100644 index 00000000000..25ef4271fb8 --- /dev/null +++ b/keyboards/40percentclub/ut47/config.h @@ -0,0 +1,79 @@ +/* +Copyright 2018 Carlos Filoteo + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 40percent.club +#define PRODUCT ut47 +#define DESCRIPTION An awesome 40% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +#define MATRIX_ROW_PINS { D1, D0, D4, C6 } +#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* Enable GNAP matrix serial output */ +#define GNAP_ENABLE + +/* USART configuration */ +#ifdef __AVR_ATmega32U4__ +# define SERIAL_UART_BAUD 9600 +# define SERIAL_UART_DATA UDR1 +# define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) +# define SERIAL_UART_RXD_VECT USART1_RX_vect +# define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) +# define SERIAL_UART_INIT() do { \ + /* baud rate */ \ + UBRR1L = SERIAL_UART_UBRR; \ + /* baud rate */ \ + UBRR1H = SERIAL_UART_UBRR >> 8; \ + /* enable TX */ \ + UCSR1B = _BV(TXEN1); \ + /* 8-bit data */ \ + UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ + sei(); \ + } while(0) +# else +# error "USART configuration is needed." +#endif diff --git a/keyboards/ut47/info.json b/keyboards/40percentclub/ut47/info.json similarity index 100% rename from keyboards/ut47/info.json rename to keyboards/40percentclub/ut47/info.json diff --git a/keyboards/40percentclub/ut47/keymaps/default/config.h b/keyboards/40percentclub/ut47/keymaps/default/config.h new file mode 100644 index 00000000000..023c753c27a --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/ut47/keymaps/default/keymap.c b/keyboards/40percentclub/ut47/keymaps/default/keymap.c new file mode 100644 index 00000000000..0fa7838dfd7 --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/default/keymap.c @@ -0,0 +1,135 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#ifdef LED_ENABLE + #include "protocol/serial.h" +#endif + +#define LT3_TAB LT(3, KC_TAB) +#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) + +enum custom_keycodes { + LED_TOG = SAFE_RANGE, + LED_CHG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| + * |-------------------------------------------------------------------------+ + * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + /* FN Layer 1 + * ,-------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | - | = | [ | ] | \ | + * |-------------------------------------------------------------------------+ + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Right */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | _ | + | { | } | | | + * |-------------------------------------------------------------------------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Left */ + KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | |LEDtg|LEDch| | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | |MousL|MousD|MousU|MousR| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Tab */ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, LED_TOG, LED_CHG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R +), +}; + +//LED keymap functions + #ifdef LED_ENABLE +void led_chmode(void) { + serial_send(101); +} + +void led_toggle(void) { + serial_send(100); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case LED_TOG: + #ifdef LED_ENABLE + led_toggle(); + #endif + return false; + case LED_CHG: + #ifdef LED_ENABLE + led_chmode(); + #endif + return false; + } + } + return true; +}; +#endif diff --git a/keyboards/ut47/keymaps/default/readme.md b/keyboards/40percentclub/ut47/keymaps/default/readme.md similarity index 100% rename from keyboards/ut47/keymaps/default/readme.md rename to keyboards/40percentclub/ut47/keymaps/default/readme.md diff --git a/keyboards/40percentclub/ut47/keymaps/non-us/config.h b/keyboards/40percentclub/ut47/keymaps/non-us/config.h new file mode 100644 index 00000000000..f88ebf7e803 --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/non-us/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +// place overrides here diff --git a/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c b/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c new file mode 100644 index 00000000000..0c1c2e75999 --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c @@ -0,0 +1,135 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#ifdef LED_ENABLE + #include "protocol/serial.h" +#endif + +#define LT3_TAB LT(3, KC_TAB) +#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) + +enum custom_keycodes { + LED_TOG = SAFE_RANGE, + LED_CHG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| + * |-------------------------------------------------------------------------+ + * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + /* FN Layer 1 + * ,-------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | # | - | = | [ | ] | \ | + * |-------------------------------------------------------------------------+ + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Right */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, _______, _______, _______, _______, _______, KC_NUHS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_NUBS, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | _ | + | { | } | | | + * |-------------------------------------------------------------------------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Left */ + KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | |LEDtg|LEDch| | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | |MousL|MousD|MousU|MousR| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Tab */ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, LED_TOG, LED_CHG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R +), +}; + +//LED keymap functions + #ifdef LED_ENABLE +void led_chmode(void) { + serial_send(101); +} + +void led_toggle(void) { + serial_send(100); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case LED_TOG: + #ifdef LED_ENABLE + led_toggle(); + #endif + return false; + case LED_CHG: + #ifdef LED_ENABLE + led_chmode(); + #endif + return false; + } + } + return true; +}; +#endif diff --git a/keyboards/ut47/keymaps/non-us/readme.md b/keyboards/40percentclub/ut47/keymaps/non-us/readme.md similarity index 100% rename from keyboards/ut47/keymaps/non-us/readme.md rename to keyboards/40percentclub/ut47/keymaps/non-us/readme.md diff --git a/keyboards/ut47/keymaps/nordic/config.h b/keyboards/40percentclub/ut47/keymaps/nordic/config.h similarity index 100% rename from keyboards/ut47/keymaps/nordic/config.h rename to keyboards/40percentclub/ut47/keymaps/nordic/config.h diff --git a/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c b/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c new file mode 100644 index 00000000000..f3e297ec03d --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c @@ -0,0 +1,178 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#ifdef LED_ENABLE + #include "protocol/serial.h" + +#endif + +#include "keymap_norwegian.h" + +#define LT3_TAB LT(3, KC_TAB) +#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) +#define CTRADEL LALT(LCTL(KC_DEL)) +#define ALTTAB LALT(KC_TAB) + +enum custom_keycodes { + LED_TOG = SAFE_RANGE, + LED_CHG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer - L0 + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * |Tab/L3| A | S | D | F | G | H | J | K | L | ' |Ent/RS| + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | Up | L4 | + * |-------------------------------------------------------------------------+ + * | Ctrl| Gui | L4 | Alt | L2 | Space | L1 | Ctrl| Left| Down|Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Base - L0 */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_APOS, MT_RSFT_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, MO(4), + KC_LCTL, KC_LGUI, MO(4), KC_LALT, MO(2), KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + + /* FN Layer 1 + * ,-------------------------------------------------------------------------. + * | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | | + | = | * | / | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | - | _ | PgUp| | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | | Home| PgDn| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Right modifier - L1 */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, _______, NO_PLUS, NO_EQL, NO_ASTR, NO_SLSH, + _______, _______, _______, _______, _______, _______, _______, _______, NO_MINS, NO_UNDS, KC_PGUP, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | § | ! | " | # | ¤ | % | & | / | = | + | \ | Delete| + * |-------------------------------------------------------------------------+ + * | | | ? | { | [ | ( | ) | ] | } | F10 | F11 | F12 | + * |-------------------------------------------------------------------------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | PgUp| | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | | Home| PgDn| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Left modifier - L2 */ + NO_SECT, KC_EXCLAIM, NO_QUO2, KC_HASH, NO_BULT, KC_PERCENT, NO_AMPR, NO_SLSH, NO_EQL, NO_PLUS, NO_BSLS, KC_DELETE, + _______, _______, NO_QUES, NO_LCBR, NO_LBRC, NO_LPRN, NO_RPRN, NO_RBRC, NO_RCBR, KC_F10, KC_F11, KC_F12, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_PGUP, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), + + /* FN Layer 3 + * ,-------------------------------------------------------------------------. + * | Esc | Calc|Webhm| Comp|Webrf| | | | | |PrtSc|CtrAlDl| + * |-------------------------------------------------------------------------+ + * | | | | | | | |VolDn|VolUp| | | | + * |-------------------------------------------------------------------------+ + * | |LEDtg|LEDch| | |RESET| | Mute| |MouB1|MousU|MouB2| + * |-------------------------------------------------------------------------+ + * | | | | | | | | |MousL|MousD|MousR| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Hold Tab down - L3 */ + KC_ESC, KC_CALC, KC_WHOM, KC_MYCM, KC_WREF, _______, _______, _______, _______, _______, KC_PSCR, CTRADEL, + _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______, + _______, LED_TOG, LED_CHG, _______, _______, RESET, _______, KC_MUTE, _______, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R +), + + /* FN Layer 4 + * ,-------------------------------------------------------------------------. + * | | | @ | £ | $ | ~ | | ¨ | ´ | ` | Å | | + * |-------------------------------------------------------------------------+ + * | | | | € | | | | | ^ | Ø | Æ | | + * |-------------------------------------------------------------------------+ + * | | < | | | | | | µ | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | | L5 | | | | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Norsk - L4 */ + _______, _______, NO_AT, NO_PND, NO_DLR, NO_TILD, _______, NO_QUOT, NO_ACUT, NO_GRV, NO_AA, _______, + _______, _______, _______, NO_EURO, _______, _______, _______, _______, NO_CIRC, NO_OSLH, NO_AE, _______, + _______, NO_LESS, _______, _______, _______, _______, _______, NO_MU, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, TO(5), _______, _______, _______ +), + + /* GAMING Layer (toggle on and off) + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | F1 | F2 | F3 | F4 |Alt+Tab| + * |-------------------------------------------------------------------------+ + * | Tab | A | S | D | F | G | H | F5 | F6 | F7 | F8 | Enter| + * |-------------------------------------------------------------------------+ + * | Shift | 1 | 2 | 3 | 4 | 5 | 6 | F9 | F10 | F11 | Up |TOGGL| + * |-------------------------------------------------------------------------+ + * | Ctrl| Z | X | C | B | Space | M | V |Left |Down |Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* GAMING, toggled on and off - L5 */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_F1, KC_F2, KC_F3, KC_F4, ALTTAB, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_F5, KC_F6, KC_F7, KC_F8, KC_ENT, + KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_UP, TO(0), + KC_LCTL, KC_Z, KC_X, KC_C, KC_B, KC_SPC, KC_M, KC_V, KC_LEFT, KC_DOWN, KC_RGHT +), +}; + +//LED keymap functions + #ifdef LED_ENABLE +void led_chmode(void) { + serial_send(101); +} + +void led_toggle(void) { + serial_send(100); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case LED_TOG: + #ifdef LED_ENABLE + led_toggle(); + #endif + return false; + case LED_CHG: + #ifdef LED_ENABLE + led_chmode(); + #endif + return false; + } + } + return true; +}; +#endif diff --git a/keyboards/ut47/keymaps/nordic/readme.md b/keyboards/40percentclub/ut47/keymaps/nordic/readme.md similarity index 100% rename from keyboards/ut47/keymaps/nordic/readme.md rename to keyboards/40percentclub/ut47/keymaps/nordic/readme.md diff --git a/keyboards/40percentclub/ut47/keymaps/rgb/config.h b/keyboards/40percentclub/ut47/keymaps/rgb/config.h new file mode 100644 index 00000000000..791147b5bfd --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/rgb/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +// place overrides here +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN D3 // The pin the LED strip is connected to +#define RGBLED_NUM 7 // Number of LEDs in your strip diff --git a/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c b/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c new file mode 100644 index 00000000000..77fa5b4017f --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c @@ -0,0 +1,87 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#ifdef LED_ENABLE + #include "protocol/serial.h" +#endif + +#define LT3_TAB LT(3, KC_TAB) +#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) + +enum custom_keycodes { + LED_TOG = SAFE_RANGE, + LED_CHG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +LAYOUT( + KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_FN10, KC_FN11, KC_FN12, KC_FN13, KC_FN14, KC_FN15, KC_FN16, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_FN17, KC_FN18, KC_FN19, KC_FN20, KC_FN21, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +LAYOUT( /* Tab */ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R +), +}; + +//LED keymap functions + #ifdef LED_ENABLE +void led_chmode(void) { + serial_send(101); +} + +void led_toggle(void) { + serial_send(100); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case LED_TOG: + #ifdef LED_ENABLE + led_toggle(); + #endif + return false; + case LED_CHG: + #ifdef LED_ENABLE + led_chmode(); + #endif + return false; + } + } + return true; +}; +#endif diff --git a/keyboards/ut47/keymaps/rgb/readme.md b/keyboards/40percentclub/ut47/keymaps/rgb/readme.md similarity index 100% rename from keyboards/ut47/keymaps/rgb/readme.md rename to keyboards/40percentclub/ut47/keymaps/rgb/readme.md diff --git a/keyboards/dilly/keymaps/default/rules.mk b/keyboards/40percentclub/ut47/keymaps/rgb/rules.mk similarity index 100% rename from keyboards/dilly/keymaps/default/rules.mk rename to keyboards/40percentclub/ut47/keymaps/rgb/rules.mk diff --git a/keyboards/ut47/led.c b/keyboards/40percentclub/ut47/led.c similarity index 100% rename from keyboards/ut47/led.c rename to keyboards/40percentclub/ut47/led.c diff --git a/keyboards/ut47/matrix.c b/keyboards/40percentclub/ut47/matrix.c similarity index 100% rename from keyboards/ut47/matrix.c rename to keyboards/40percentclub/ut47/matrix.c diff --git a/keyboards/40percentclub/ut47/readme.md b/keyboards/40percentclub/ut47/readme.md new file mode 100644 index 00000000000..31be1d9f773 --- /dev/null +++ b/keyboards/40percentclub/ut47/readme.md @@ -0,0 +1,40 @@ +# ut47 + +![ut47](https://i.imgur.com/ZDKZQaj.jpg) +=== + +Somewhere between ortholinear and standard offset. Created to have all the same functions on a Planck in a keyboard but with a more conventional keyboard row stagger. + +Keyboard Maintainer: [filoxo](https://github.com/filoxo), [network_operations] +Hardware Supported: [PCB design](http://www.40percent.club/2016/10/gnap-20-plateless.html), Arduino Pro Micro +Hardware Availability: [How to order](http://www.40percent.club/2017/03/ordering-pcb.html) + +### Instructions + +To flash the UT47 without LEDs (single controller), run: + + make 40percentclub/ut47:default + +To enable the UT47 LEDs (dual controller), run this for the main controller: + + make 40percentclub/ut47:default LED_ENABLE=yes + +Or you can add `LED_ENABLE = yes` to *rules.mk* + +And then flash [LED_controls.ino](LED_controls.ino) to the second controller using [Arduino IDE](https://www.arduino.cc/en/Main/Software) or similar. NOTE: Arduino IDE will require importing additional libraries to compile. + +The reason this is an "opt-in" feature is to prevent sending serial communication over the pin, in case it ends up being used for something else (like RGB underglow). + +### Layout + +Go to the [default layout README](keymaps/default/readme.md) for more information. + +### Additional info + +Credit: Forked from [di0ib TMK version](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gnap) + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +### Build Guide + +[u/network_operations' build guide thread](https://www.reddit.com/r/MechanicalKeyboards/comments/7wqktu/gnap_the_cheap_40/) diff --git a/keyboards/40percentclub/ut47/rules.mk b/keyboards/40percentclub/ut47/rules.mk new file mode 100644 index 00000000000..7495f5edda1 --- /dev/null +++ b/keyboards/40percentclub/ut47/rules.mk @@ -0,0 +1,87 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC += matrix.c protocol/serial_uart.c + +ifeq ($(strip $(LED_ENABLE)), yes) + OPT_DEFS += -DLED_ENABLE + SRC += led.c +endif diff --git a/keyboards/ut47/ut47.c b/keyboards/40percentclub/ut47/ut47.c similarity index 100% rename from keyboards/ut47/ut47.c rename to keyboards/40percentclub/ut47/ut47.c diff --git a/keyboards/40percentclub/ut47/ut47.h b/keyboards/40percentclub/ut47/ut47.h new file mode 100644 index 00000000000..f6456fe911b --- /dev/null +++ b/keyboards/40percentclub/ut47/ut47.h @@ -0,0 +1,46 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ +) \ + { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b }, \ + { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b } \ + } + +#define LAYOUT_kc( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ +) \ + LAYOUT( \ + KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0a, KC_##K0b, \ + KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1a, KC_##K1b, \ + KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2a, KC_##K2b, \ + KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K37, KC_##K38, KC_##K39, KC_##K3a, KC_##K3b \ + ) + +#define LAYOUT_kc_ut47 LAYOUT_kc diff --git a/keyboards/4x4/4x4.h b/keyboards/4x4/4x4.h deleted file mode 100644 index ec75c3e2809..00000000000 --- a/keyboards/4x4/4x4.h +++ /dev/null @@ -1,62 +0,0 @@ - -#ifndef FOURX4_H -#define FOURX4_H - -#include "quantum.h" -#define ___ KC_NO - -// This a shortcut to help you visually see your layout. -// The first section contains all of the arguments -// The second converts the arguments into a two-dimensional array - -#define LAYOUT_ortho_4x4( \ - K00, K01, K02, K03, \ - K10, K11, K12, K13, \ - K20, K21, K22, K23, \ - K30, K31, K32, K33 \ -) \ -{ \ - { K00, K01, K02, K03, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ -} -#define LAYOUT_ortho_4x8( \ - K00, K01, K02, K03, K04, K05, K06, K07, \ - K10, K11, K12, K13, K14, K15, K16, K17, \ - K20, K21, K22, K23, K24, K25, K26, K27, \ - K30, K31, K32, K33, K34, K35, K36, K37\ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, K14, K15, K16, K17, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, K24, K25, K26, K27, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, K35, K35, K37, ___, ___, ___, ___, ___, ___, ___, ___} \ -} -#define LAYOUT_ortho_4x12( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, ___, ___, ___, ___} \ -} - -#define LAYOUT_ortho_4x16( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \ -} - -#endif diff --git a/keyboards/4x4/config.h b/keyboards/4x4/config.h deleted file mode 100644 index e66e9433a9d..00000000000 --- a/keyboards/4x4/config.h +++ /dev/null @@ -1,202 +0,0 @@ - - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x4444 -#define MANUFACTURER di0ib -#define PRODUCT The 4x4 Keyboard -#define DESCRIPTION A modular compact keyboard - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 16 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B2, D1, D0, D4 } -#define MATRIX_COL_PINS { C6, D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } -#define UNUSED_PINS - - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN C7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - diff --git a/keyboards/4x4/keymaps/default/keymap.c b/keyboards/4x4/keymaps/default/keymap.c deleted file mode 100644 index 144ec05c17f..00000000000 --- a/keyboards/4x4/keymaps/default/keymap.c +++ /dev/null @@ -1,124 +0,0 @@ - -#include QMK_KEYBOARD_H - -#define PAD 0 -#define _QW 1 -#define NUM 2 -#define DIR 3 - -// Readability keycodes -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Single 4x4 board only - * .-----------------------------------. - * | 7 | 8 | 9 | / | - * |--------+--------+--------+--------| - * | 4 | 5 | 6 | * | - * |--------+--------+--------+--------| - * | 1 | 2 | 3 | - | - * |--------+--------+--------+--------| - * | 0 | QWERTY | . | + | - * '-----------------------------------' - */ - - [PAD] = LAYOUT_ortho_4x4( - KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, - KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, - KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, - KC_KP_0, DF(_QW), KC_KP_DOT, KC_PPLS - ), - -/* QWERTY - * .-----------------------------------------------------------------------------------------------------------------------------------------------. - * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | / | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | * | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | - | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | + | - * '-----------------------------------------------------------------------------------------------------------------------------------------------' - */ - - [_QW] = LAYOUT_ortho_4x16( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, - KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PPLS - ), - -/* NUMBERS - * .-----------------------------------------------------------------------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | | - * | | | | | | | | | | |CTRLhold| | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | - * | | | | | | | ENTER | SHIFT | | | | | | | | | - * '-----------------------------------------------------------------------------------------------------------------------------------------------' - */ - - [NUM] = LAYOUT_ortho_4x16( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, _______, - _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, _______, - _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______, _______ - ), - -/* DIRECTIONS - * .-----------------------------------------------------------------------------------------------------------------------------------------------. - * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | P-Brk | | | | | | | RGUI | ALT | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | KEYPAD | | | | | | | | | | | | | | | | - * '-----------------------------------------------------------------------------------------------------------------------------------------------' - */ - - [DIR] = LAYOUT_ortho_4x16( - RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, _______, - KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, _______, - _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, _______, - DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - -}; - - -const uint16_t PROGMEM fn_actions[] = { - -}; - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - (void)event; - - switch (id) { - - } - return MACRO_NONE; -} - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/4x4/readme.md b/keyboards/4x4/readme.md deleted file mode 100644 index 3ca074fddd2..00000000000 --- a/keyboards/4x4/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# 4x4 - -![4x4](https://2.bp.blogspot.com/-xRZOpwlTT4c/WlOwRIVAecI/AAAAAAACKo4/d75juHTX2W0Nrch7NigssMbagvl3I4w_ACEwYBhgL/s1600/e.jpg) -=== - -**Modular keypad/keyboard** -The basic unit is a 4x4 matrix with 16 keys. Up to 4 of these can be connected to each other side by side. -4x4, 4x8, 4x12 and 4x16 are possible. -There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. -**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/4x4) - -Keyboard Maintainer: QMK Community -Hardware Supported: 4x4 PCB -Hardware Availability: [4x4x4x4x4 project on 40% Keyboards](http://www.40percent.club/2018/01/4x4x4x4x4.html) - -Make example for this keyboard (after setting up your build environment): - - make 4x4:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. -First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/4x4/rules.mk b/keyboards/4x4/rules.mk deleted file mode 100644 index b8b4bccc424..00000000000 --- a/keyboards/4x4/rules.mk +++ /dev/null @@ -1,74 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) - -LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 diff --git a/keyboards/5x5/5x5.h b/keyboards/5x5/5x5.h deleted file mode 100644 index 45fb80a4f75..00000000000 --- a/keyboards/5x5/5x5.h +++ /dev/null @@ -1,57 +0,0 @@ - -#ifndef FIVEX5_H -#define FIVEX5_H - -#include "quantum.h" -#define ___ KC_NO - -// This a shortcut to help you visually see your layout. -// The first section contains all of the arguments -// The second converts the arguments into a two-dimensional array - -#define LAYOUT_ortho_5x5( \ - K00, K01, K02, K03, K04, \ - K10, K11, K12, K13, K14, \ - K20, K21, K22, K23, K24, \ - K30, K31, K32, K33, K34, \ - K40, K41, K42, K43, K44 \ -) \ -{ \ - { K00, K01, K02, K03, K04, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, K14, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, K24, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K40, K41, K42, K43, K44, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ -} - -#define LAYOUT_ortho_5x10( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, \ - K40, K41, K42, K43, K44, K45, K46, K47, K48, K49 \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, ___, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, ___, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, ___, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, ___, ___, ___, ___, ___}, \ - { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, ___, ___, ___, ___, ___} \ -} - -#define LAYOUT_ortho_5x15( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, \ - K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e}, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e}, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e}, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \ - { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e} \ -} - -#endif diff --git a/keyboards/5x5/config.h b/keyboards/5x5/config.h deleted file mode 100644 index bc609934e3e..00000000000 --- a/keyboards/5x5/config.h +++ /dev/null @@ -1,208 +0,0 @@ - - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x05B5 -#define MANUFACTURER di0ib -#define PRODUCT The 5x5 Keyboard -#define DESCRIPTION A 25 or 50 or 75 key keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B2, D1, D0, D4, C6 } -#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - -// #define RGB_DI_PIN E2 -// #ifdef RGB_DI_PIN -// #define RGBLIGHT_ANIMATIONS -// #define RGBLED_NUM 16 -// #define RGBLIGHT_HUE_STEP 8 -// #define RGBLIGHT_SAT_STEP 8 -// #define RGBLIGHT_VAL_STEP 8 -// #endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ diff --git a/keyboards/5x5/keymaps/default/keymap.c b/keyboards/5x5/keymaps/default/keymap.c deleted file mode 100644 index a2c525d089c..00000000000 --- a/keyboards/5x5/keymaps/default/keymap.c +++ /dev/null @@ -1,139 +0,0 @@ - -#include QMK_KEYBOARD_H - -#define PAD 0 -#define _QW 1 -#define NUM 2 -#define DIR 3 - -// Readability keycodes -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Single 5x5 board only - * .--------------------------------------------. - * | QWERTY | / | * | - | | - * |--------+--------+--------+--------+--------| - * | 7 | 8 | 9 | + | | - * |--------+--------+--------+--------+--------| - * | 4 | 5 | 6 | + | | - * |--------+--------+--------+--------+--------| - * | 1 | 2 | 3 | ENTER | | - * |--------+--------+--------+--------+--------| - * | 0 | 0 | . | ENTER | | - * '--------------------------------------------' - */ - - [PAD] = LAYOUT_ortho_5x5( - DF(_QW), KC_PSLS, KC_PAST, KC_PMNS, _______, - KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, _______, - KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, - KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, - KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PENT, _______ - ), - -/* QWERTY - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ - - [_QW] = LAYOUT_ortho_5x15( - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, - KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT - ), - -/* NUMBERS - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | - * | | | | | | | | | | |CTRLhold| | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | ENTER | SHIFT | | | | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ - - [NUM] = LAYOUT_ortho_5x15( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, - _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, - _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______ - ), - -/* DIRECTIONS - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | P-Brk | | | | | | | RGUI | ALT | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | KEYPAD | | | | | | | | | | | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ - - [DIR] = LAYOUT_ortho_5x15( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, - KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, - _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, - DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/5x5/readme.md b/keyboards/5x5/readme.md deleted file mode 100644 index e25535968d2..00000000000 --- a/keyboards/5x5/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# 5x5 - -![5x5](https://3.bp.blogspot.com/-bKOfUyMtdrE/WqGA_03kGZI/AAAAAAACPtY/DsHDTQS0IlMD3ie8HHlf1ATRUAwpZdcSgCLcBGAs/s1600/c.jpg) -=== - -**Modular Keypad/Keyboard** -The basic unit is a 5x5 matrix with 25 keys. Up to 3 of these can be connected to each other side by side. -5x5, 5x10, and 5x15 matrices are possible. -There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. -**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/5x5) - -Keyboard Maintainer: QMK Community -Hardware Supported: 5x5 PCB -Hardware Availability: [5x5 project on 40% Keyboards](http://www.40percent.club/2018/04/5x5.html) - -Make example for this keyboard (after setting up your build environment): - - make 5x5:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. -First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/5x5/rules.mk b/keyboards/5x5/rules.mk deleted file mode 100644 index 24e0e020fda..00000000000 --- a/keyboards/5x5/rules.mk +++ /dev/null @@ -1,74 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard RGB underglow -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) - -LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15 diff --git a/keyboards/68keys/68keys.c b/keyboards/68keys/68keys.c deleted file mode 100644 index dcf04e6a3dd..00000000000 --- a/keyboards/68keys/68keys.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "68keys.h" - -void matrix_init_kb(void) -{ - matrix_init_user(); -} diff --git a/keyboards/68keys/68keys.h b/keyboards/68keys/68keys.h deleted file mode 100644 index e8a2c4aeedd..00000000000 --- a/keyboards/68keys/68keys.h +++ /dev/null @@ -1,20 +0,0 @@ -#include "quantum.h" - -#define LAYOUT_68_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74) \ - { \ - {K00, K01, K02, K03, K04, K05, K06, K07, K08}, \ - {K10, K11, K12, K13, K14, K15, K16, K17, K18}, \ - {K20, K21, K22, K23, K24, K25, K26, K27, K28}, \ - {K30, K31, K32, K33, K34, K35, K36, K37, K38}, \ - {K40, K41, K42, K43, K44, K45, K46, K47, K48}, \ - {K50, K51, K52, K53, K54, K55, K56, K57, K58}, \ - {K60, K61, K62, K63, K64, K65, K66, K67, K68}, \ - { \ - K70, K71, K72, K73, K74 \ - } \ - } diff --git a/keyboards/68keys/README.md b/keyboards/68keys/README.md deleted file mode 100644 index 082a47a7559..00000000000 --- a/keyboards/68keys/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# 68Keys.io - -Custom [68Keys.io](https://68keys.io) DIY keyboard. - -Keyboard Maintainer: [sbstjn](https://sbstjn.com) -Hardware Supported: Pro Micro -Hardware Availability: [DIY Guide](https://68keys.io) - -Make example for this keyboard (after setting up your build environment): - -```bash -$ > cd qmk_firmware/ -$ > make 68keys:default -``` - -Example of flashing this keyboard: - -```bash -$ > cd qmk_firmware/ -$ > make 68keys:default:avrdude -``` - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/68keys/config.h b/keyboards/68keys/config.h deleted file mode 100644 index 07c87563d3e..00000000000 --- a/keyboards/68keys/config.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x0068 -#define MANUFACTURER 68Keys.io -#define PRODUCT The 68Keys.io Keyboard -#define DESCRIPTION A 68 keys mechanical keyboard - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 9 - -#define MATRIX_ROW_PINS \ - { \ - B6, B2, B3, B1, F7, F6, F5, F4 \ - } -#define MATRIX_COL_PINS \ - { \ - D3, D2, D1, D0, D4, C6, D7, E6, B4 \ - } -#define UNUSED_PINS - -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/68keys/info.json b/keyboards/68keys/info.json deleted file mode 100644 index b24e22b0a1e..00000000000 --- a/keyboards/68keys/info.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "keyboard_name": "68Keys.io", - "url": "https://68keys.io", - "maintainer": "qmk", - "width": 17.25, - "height": 5, - "layouts": { - "LAYOUT_68_ansi": { - "layout": [ - { "label": "~", "x": 0, "y": 0 }, - { "label": "!", "x": 1, "y": 0 }, - { "label": "@", "x": 2, "y": 0 }, - { "label": "#", "x": 3, "y": 0 }, - { "label": "$", "x": 4, "y": 0 }, - { "label": "%", "x": 5, "y": 0 }, - { "label": "^", "x": 6, "y": 0 }, - { "label": "&", "x": 7, "y": 0 }, - { "label": "*", "x": 8, "y": 0 }, - { "label": "(", "x": 9, "y": 0 }, - { "label": ")", "x": 10, "y": 0 }, - { "label": "_", "x": 11, "y": 0 }, - { "label": "+", "x": 12, "y": 0 }, - { "label": "Backspace", "x": 13, "y": 0, "w": 2 }, - { "label": "ESC", "x": 15.25, "y": 0 }, - { "label": "PGUP", "x": 16.25, "y": 0 }, - { "label": "Tab", "x": 0, "y": 1, "w": 1.5 }, - { "label": "Q", "x": 1.5, "y": 1 }, - { "label": "W", "x": 2.5, "y": 1 }, - { "label": "E", "x": 3.5, "y": 1 }, - { "label": "R", "x": 4.5, "y": 1 }, - { "label": "T", "x": 5.5, "y": 1 }, - { "label": "Y", "x": 6.5, "y": 1 }, - { "label": "U", "x": 7.5, "y": 1 }, - { "label": "I", "x": 8.5, "y": 1 }, - { "label": "O", "x": 9.5, "y": 1 }, - { "label": "P", "x": 10.5, "y": 1 }, - { "label": "{", "x": 11.5, "y": 1 }, - { "label": "}", "x": 12.5, "y": 1 }, - { "label": "|", "x": 13.5, "y": 1, "w": 1.5 }, - { "label": "DEL", "x": 15.25, "y": 1 }, - { "label": "PGDN", "x": 16.25, "y": 1 }, - { "label": "Caps Lock", "x": 0, "y": 2, "w": 1.75 }, - { "label": "A", "x": 1.75, "y": 2 }, - { "label": "S", "x": 2.75, "y": 2 }, - { "label": "D", "x": 3.75, "y": 2 }, - { "label": "F", "x": 4.75, "y": 2 }, - { "label": "G", "x": 5.75, "y": 2 }, - { "label": "H", "x": 6.75, "y": 2 }, - { "label": "J", "x": 7.75, "y": 2 }, - { "label": "K", "x": 8.75, "y": 2 }, - { "label": "L", "x": 9.75, "y": 2 }, - { "label": ":", "x": 10.75, "y": 2 }, - { "label": "\"", "x": 11.75, "y": 2 }, - { "label": "Enter", "x": 12.75, "y": 2, "w": 2.25 }, - { "label": "Shift", "x": 0, "y": 3, "w": 2.25 }, - { "label": "Z", "x": 2.25, "y": 3 }, - { "label": "X", "x": 3.25, "y": 3 }, - { "label": "C", "x": 4.25, "y": 3 }, - { "label": "V", "x": 5.25, "y": 3 }, - { "label": "B", "x": 6.25, "y": 3 }, - { "label": "N", "x": 7.25, "y": 3 }, - { "label": "M", "x": 8.25, "y": 3 }, - { "label": "<", "x": 9.25, "y": 3 }, - { "label": ">", "x": 10.25, "y": 3 }, - { "label": "?", "x": 11.25, "y": 3 }, - { "label": "Shift", "x": 12.25, "y": 3, "w": 2.75 }, - { "x": 15.25, "y": 3 }, - { "label": "CTRL", "x": 0, "y": 4, "w": 1.25 }, - { "label": "ALT", "x": 1.25, "y": 4, "w": 1.25 }, - { "label": "GUI", "x": 2.5, "y": 4, "w": 1.25 }, - { "x": 3.75, "y": 4, "w": 6.25 }, - { "label": "GUI", "x": 10, "y": 4, "w": 1.25 }, - { "label": "ALT", "x": 11.25, "y": 4, "w": 1.25 }, - { "label": "CTRL", "x": 12.5, "y": 4, "w": 1.25 }, - { "x": 14.25, "y": 4 }, - { "x": 15.25, "y": 4 }, - { "x": 16.25, "y": 4 } - ] - } - } -} diff --git a/keyboards/68keys/keymaps/default/keymap.c b/keyboards/68keys/keymaps/default/keymap.c deleted file mode 100644 index 8f23d224626..00000000000 --- a/keyboards/68keys/keymaps/default/keymap.c +++ /dev/null @@ -1,10 +0,0 @@ -#include QMK_KEYBOARD_H -#include "68keys.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_68_ansi( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_ESC, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, - KC_CAPSLOCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT)}; diff --git a/keyboards/68keys/rules.mk b/keyboards/68keys/rules.mk deleted file mode 100644 index f1a56d496d8..00000000000 --- a/keyboards/68keys/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -LAYOUTS = 68_ansi - -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -BOOTLOADER = atmel-dfu - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration (+1000) -MOUSEKEY_ENABLE = no # Mouse keys (+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control (+450) -CONSOLE_ENABLE = no # Console for debug (+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 - diff --git a/keyboards/6ball/keymaps/default/rules.mk b/keyboards/6ball/keymaps/default/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/6ball/keymaps/default/rules.mk +++ b/keyboards/6ball/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/6ball/readme.md b/keyboards/6ball/readme.md index 7316a981696..c9548453a93 100644 --- a/keyboards/6ball/readme.md +++ b/keyboards/6ball/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make 6ball:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/6ball/rules.mk b/keyboards/6ball/rules.mk index 46f733b873d..89d13248093 100644 --- a/keyboards/6ball/rules.mk +++ b/keyboards/6ball/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/8pack/8pack.c b/keyboards/8pack/8pack.c new file mode 100644 index 00000000000..e89d7281de4 --- /dev/null +++ b/keyboards/8pack/8pack.c @@ -0,0 +1 @@ +#include "8pack.h" diff --git a/keyboards/8pack/8pack.h b/keyboards/8pack/8pack.h new file mode 100644 index 00000000000..1c4ffb55b85 --- /dev/null +++ b/keyboards/8pack/8pack.h @@ -0,0 +1,11 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_8pack_rev11 + #include "rev11.h" +#endif + +#ifdef KEYBOARD_8pack_rev12 + #include "rev12.h" +#endif \ No newline at end of file diff --git a/keyboards/8pack/config.h b/keyboards/8pack/config.h new file mode 100644 index 00000000000..88bd1f351bc --- /dev/null +++ b/keyboards/8pack/config.h @@ -0,0 +1,39 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x2171 +#define MANUFACTURER Charles Garcia +#define PRODUCT 8-Pack + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 4 + +/* key matrix pins */ + +#define DIRECT_PINS { { F4, F5, F6, F7 }, { B1, B3, B2, B6 } } + +#define BACKLIGHT_LED_COUNT 8 +#undef BACKLIGHT_PIN +#define BACKLIGHT_PINS { D1, D0, D4, C6, D7, E6, B4, B5 } +#define BACKLIGHT_LEVELS 8 + +// ws2812 options +#define RGB_DI_PIN D2 // pin the DI on the ws2812 is hooked-up to +#define RGBLED_NUM 8 // number of LEDs +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/8pack/info.json b/keyboards/8pack/info.json new file mode 100644 index 00000000000..82122b8f799 --- /dev/null +++ b/keyboards/8pack/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "8-Pack", + "url": "https://github.com/cgarcia2097/8-Pack", + "maintainer": "Charles Garcia", + "width": 4, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":3, "y":1} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/8pack/keymaps/default/keymap.c b/keyboards/8pack/keymaps/default/keymap.c new file mode 100644 index 00000000000..aa1aa917010 --- /dev/null +++ b/keyboards/8pack/keymaps/default/keymap.c @@ -0,0 +1,12 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_V, KC_C, KC_X, MO(1), + KC_A, KC_S, KC_D, KC_F + ), + [1] = LAYOUT( + RGB_TOG, RGB_RMOD, RGB_MOD, KC_NO, + RESET, BL_DEC, BL_INC, BL_TOGG + ) +}; diff --git a/keyboards/8pack/readme.md b/keyboards/8pack/readme.md new file mode 100644 index 00000000000..ad5df536a18 --- /dev/null +++ b/keyboards/8pack/readme.md @@ -0,0 +1,13 @@ +# 8-Pack Macropad + +An open source 2x4 macropad designed by Charles Garcia. + +Keyboard Maintainer: [Charles Garcia](https://github.com/cgarcia2097) +Hardware Supported: 8-Pack Macropad PCB +Hardware Availability: [8-Pack Github](https://github.com/cgarcia2097/8-Pack) + +Make example for this keyboard (after setting up your build environment): + + make 8pack:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/8pack/rev11/config.h b/keyboards/8pack/rev11/config.h new file mode 100644 index 00000000000..83ad51ada3b --- /dev/null +++ b/keyboards/8pack/rev11/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define DEVICE_VER 0x0001 diff --git a/keyboards/8pack/rev11/rev11.c b/keyboards/8pack/rev11/rev11.c new file mode 100644 index 00000000000..c54ecbe87e5 --- /dev/null +++ b/keyboards/8pack/rev11/rev11.c @@ -0,0 +1 @@ +#include "rev11.h" diff --git a/keyboards/8pack/rev11/rev11.h b/keyboards/8pack/rev11/rev11.h new file mode 100644 index 00000000000..ebf8529ad08 --- /dev/null +++ b/keyboards/8pack/rev11/rev11.h @@ -0,0 +1,11 @@ +#pragma once + +#include "8pack.h" + +#define LAYOUT( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13 \ +) { \ + { K13, K12, K11, K10 }, \ + { K03, K02, K01, K00 } \ +} diff --git a/keyboards/fourier/rev1/rules.mk b/keyboards/8pack/rev11/rules.mk similarity index 100% rename from keyboards/fourier/rev1/rules.mk rename to keyboards/8pack/rev11/rules.mk diff --git a/keyboards/8pack/rev12/config.h b/keyboards/8pack/rev12/config.h new file mode 100644 index 00000000000..9a527501a5e --- /dev/null +++ b/keyboards/8pack/rev12/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define DEVICE_VER 0x0002 diff --git a/keyboards/8pack/rev12/rev12.c b/keyboards/8pack/rev12/rev12.c new file mode 100644 index 00000000000..b2d091af490 --- /dev/null +++ b/keyboards/8pack/rev12/rev12.c @@ -0,0 +1 @@ +#include "rev12.h" diff --git a/keyboards/8pack/rev12/rev12.h b/keyboards/8pack/rev12/rev12.h new file mode 100644 index 00000000000..3efeb06de58 --- /dev/null +++ b/keyboards/8pack/rev12/rev12.h @@ -0,0 +1,11 @@ +#pragma once + +#include "8pack.h" + +#define LAYOUT( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13 \ +) { \ + { K03, K02, K01, K00 }, \ + { K13, K12, K11, K10 } \ +} diff --git a/keyboards/nano/keymaps/default/rules.mk b/keyboards/8pack/rev12/rules.mk similarity index 100% rename from keyboards/nano/keymaps/default/rules.mk rename to keyboards/8pack/rev12/rules.mk diff --git a/keyboards/8pack/rules.mk b/keyboards/8pack/rules.mk new file mode 100644 index 00000000000..97496c8f228 --- /dev/null +++ b/keyboards/8pack/rules.mk @@ -0,0 +1,63 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +OLED_DRIVER_ENABLE = no + +DEFAULT_FOLDER = 8pack/rev12 diff --git a/keyboards/9key/keymaps/default/keymap.c b/keyboards/9key/keymaps/default/keymap.c index 9f639716955..acc0350739e 100644 --- a/keyboards/9key/keymaps/default/keymap.c +++ b/keyboards/9key/keymaps/default/keymap.c @@ -1,16 +1,5 @@ #include QMK_KEYBOARD_H -// Tap Dance Declarations -enum { - ENT_5 = 0, - ZERO_7 -}; - -// Macro Declarations -enum { - DBL_0 = 0 -}; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* LAYER 0 @@ -24,8 +13,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [0] = LAYOUT( \ KC_1, KC_2, KC_3, \ - KC_4, TD(ENT_5), KC_6, \ - TD(ZERO_7), KC_8, LT(1, KC_9) \ + KC_4, KC_5, KC_6, \ + KC_7, KC_8, LT(1, KC_9) \ ), /* LAYER 1 @@ -39,27 +28,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT( \ KC_ESC, KC_PLUS, KC_MINS, \ - KC_BSPC, KC_ASTR, KC_SLSH, \ - M(DBL_0), KC_DOT, KC_TRNS \ + KC_ENTER, KC_ASTR, KC_SLSH, \ + KC_0, KC_DOT, KC_TRNS \ ) }; - -qk_tap_dance_action_t tap_dance_actions[] = { - [ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT), - [ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch(id) { - case DBL_0: - SEND_STRING("00"); - return false; - } - } - return MACRO_NONE; -}; - -void matrix_init_user(void) { -} \ No newline at end of file diff --git a/keyboards/9key/keymaps/default/rules.mk b/keyboards/9key/keymaps/default/rules.mk deleted file mode 100644 index 457a3d01d4a..00000000000 --- a/keyboards/9key/keymaps/default/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/9key/keymaps/tap_dance/keymap.c b/keyboards/9key/keymaps/tap_dance/keymap.c new file mode 100644 index 00000000000..a96880aa529 --- /dev/null +++ b/keyboards/9key/keymaps/tap_dance/keymap.c @@ -0,0 +1,69 @@ +#include QMK_KEYBOARD_H + +// Tap Dance Declarations +enum tap_dances { + ENT_5 = 0, + ZERO_7, +}; + +// Macro Declarations +enum custom_keycodes { + DBL_0 = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* LAYER 0 + * ,-----------------------. + * | 1 | 2 | 3 | + * |-------+-------+-------| + * | 4 | 5/ENT | 6 | Dbl Tap 5 for Enter + * |-------+-------+-------| + * | 7/0 | 8 | 9/FN | 7/0 = Dbl Tap 7 for 0 - 9/FN = Hold 9 for FN + * `-----------------------' + */ +[0] = LAYOUT( \ + KC_1, KC_2, KC_3, \ + KC_4, TD(ENT_5), KC_6, \ + TD(ZERO_7), KC_8, LT(1, KC_9) \ +), + +/* LAYER 1 + * ,-----------------------. + * | ESC | + | - | + * |-------+-------+-------| + * | BSPC | * | / | + * |-------+-------+-------| + * | 00 | . | | + * `-----------------------' + */ +[1] = LAYOUT( \ + KC_ESC, KC_PLUS, KC_MINS, \ + KC_BSPC, KC_ASTR, KC_SLSH, \ + DBL_0, KC_DOT, KC_TRNS \ +) + +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT), + [ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DBL_0: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + tap_code(KC_P0); + tap_code(KC_P0); + } + break; + + } + return true; +}; + + +void matrix_init_user(void) { +} diff --git a/keyboards/tetris/keymaps/default/rules.mk b/keyboards/9key/keymaps/tap_dance/rules.mk similarity index 100% rename from keyboards/tetris/keymaps/default/rules.mk rename to keyboards/9key/keymaps/tap_dance/rules.mk diff --git a/keyboards/9key/readme.md b/keyboards/9key/readme.md index 8c669912933..89629cc8c73 100644 --- a/keyboards/9key/readme.md +++ b/keyboards/9key/readme.md @@ -14,4 +14,4 @@ Make example for this keyboard (after setting up your build environment): make 9key:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/9key/rules.mk b/keyboards/9key/rules.mk index e252640f7e6..eb82006fbda 100644 --- a/keyboards/9key/rules.mk +++ b/keyboards/9key/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -47,7 +46,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) @@ -63,7 +62,7 @@ UNICODE_ENABLE = yes # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = yes -TAP_DANCE_ENABLE = yes +TAP_DANCE_ENABLE = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/abstract/ellipse/info.json b/keyboards/abstract/ellipse/info.json new file mode 100644 index 00000000000..8ad50e6cae8 --- /dev/null +++ b/keyboards/abstract/ellipse/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Ellipse", + "url": "https://abstractkb.tk/product/ellipse-rev1", + "maintainer": "AbstractKB", + "width": 3, + "height": 2.25, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/abstract/ellipse/keymaps/abstractkb/config.h b/keyboards/abstract/ellipse/keymaps/abstractkb/config.h new file mode 100644 index 00000000000..3bc66cd9bdf --- /dev/null +++ b/keyboards/abstract/ellipse/keymaps/abstractkb/config.h @@ -0,0 +1,23 @@ +/* Copyright 2019 AbstractKB + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 2 +#define RGBLIGHT_ANIMATIONS + +// place overrides here diff --git a/keyboards/abstract/ellipse/keymaps/abstractkb/keymap.c b/keyboards/abstract/ellipse/keymaps/abstractkb/keymap.c new file mode 100644 index 00000000000..8d649419d11 --- /dev/null +++ b/keyboards/abstract/ellipse/keymaps/abstractkb/keymap.c @@ -0,0 +1,66 @@ +/* Copyright 2019 AbstractKB + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +/*enum custom_keycodes { + MYKEY = SAFE_RANGE +};*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_MUTE, RGB_TOG, BL_TOGG, + RGB_M_SW, RGB_M_P, BL_BRTG + ) +}; + +/*bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +}*/ + +/*void matrix_init_user(void) { + +}*/ + +/*void matrix_scan_user(void) { + +}*/ + +/*void led_set_user(uint8_t usb_led) { + +}*/ + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + rgblight_increase_hue_noeeprom(); + } else { + rgblight_decrease_hue_noeeprom(); + } + } else if (index == 2) { /* Third encoder */ + if (clockwise) { + backlight_increase(); + } else { + backlight_decrease(); + } + } +} \ No newline at end of file diff --git a/keyboards/abstract/ellipse/keymaps/abstractkb/readme.md b/keyboards/abstract/ellipse/keymaps/abstractkb/readme.md new file mode 100644 index 00000000000..5db2eb647f7 --- /dev/null +++ b/keyboards/abstract/ellipse/keymaps/abstractkb/readme.md @@ -0,0 +1,3 @@ +# My keymap + +This was used for testing lights but will become my personal keymap \ No newline at end of file diff --git a/keyboards/abstract/ellipse/keymaps/abstractkb/rules.mk b/keyboards/abstract/ellipse/keymaps/abstractkb/rules.mk new file mode 100644 index 00000000000..54a2685bf63 --- /dev/null +++ b/keyboards/abstract/ellipse/keymaps/abstractkb/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/abstract/ellipse/keymaps/default/config.h b/keyboards/abstract/ellipse/keymaps/default/config.h new file mode 100644 index 00000000000..e406c488b5a --- /dev/null +++ b/keyboards/abstract/ellipse/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 AbstractKB + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/abstract/ellipse/keymaps/default/keymap.c b/keyboards/abstract/ellipse/keymaps/default/keymap.c new file mode 100644 index 00000000000..ac1ec986b02 --- /dev/null +++ b/keyboards/abstract/ellipse/keymaps/default/keymap.c @@ -0,0 +1,66 @@ +/* Copyright 2019 AbstractKB + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +/*enum custom_keycodes { + MYKEY = SAFE_RANGE +};*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_A, RGB_TOG, KC_C, + KC_X, KC_Y, KC_Z + ) +}; + +/*bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +}*/ + +/*void matrix_init_user(void) { + +}*/ + +/*void matrix_scan_user(void) { + +}*/ + +/*void led_set_user(uint8_t usb_led) { + +}*/ + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_O); + } else { + tap_code(KC_P); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + rgblight_increase_hue_noeeprom(); + } else { + rgblight_decrease_hue_noeeprom(); + } + } else if (index == 2) { + if (clockwise) { + tap_code(KC_M); + } else { + tap_code(KC_R); + } + } +} \ No newline at end of file diff --git a/keyboards/abstract/ellipse/keymaps/default/readme.md b/keyboards/abstract/ellipse/keymaps/default/readme.md new file mode 100644 index 00000000000..e14c0c8bd56 --- /dev/null +++ b/keyboards/abstract/ellipse/keymaps/default/readme.md @@ -0,0 +1,6 @@ +# The default keymap for Ellipse + +This keymap allows for basic testing of the keypad once assembled. +Each knob and key outputs a different standard letter keycode, +except for the middle knob which changes the hue of the RGB LEDs and when +pressed down turns off the RGB LEDs \ No newline at end of file diff --git a/keyboards/quefrency/keymaps/default/rules.mk b/keyboards/abstract/ellipse/keymaps/default/rules.mk similarity index 100% rename from keyboards/quefrency/keymaps/default/rules.mk rename to keyboards/abstract/ellipse/keymaps/default/rules.mk diff --git a/keyboards/abstract/ellipse/readme.md b/keyboards/abstract/ellipse/readme.md new file mode 100644 index 00000000000..973d36f44b7 --- /dev/null +++ b/keyboards/abstract/ellipse/readme.md @@ -0,0 +1,19 @@ +# EllipseRev1 + +![EllipseRev1](http://abstractkb.tk/wp-content/uploads/2019/03/ellipsetop.jpg) + +A small keypad with more knobs than ever before! 3 Knobs and 3 MX-style switches on one little board. + +At this time there are 2 small known issues with the Rev 1. One of which is that backlight breathing does not work, +and the other issue that has been encountered is that the post_init_user function does not seem to be called. +Hopefully these issues can be resolved soon; this QMK file is being released as orders have started to ship and they need to be configurable. + +Keyboard Maintainer: [AbstractKB](https://github.com/abstractkb) +Hardware Supported: The Abstract Ellipse Rev1 +Hardware Availability: https://abstractkb.tk + +Make example for this keyboard (after setting up your build environment): + + make abstract/ellipse/rev1:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/abstract/ellipse/rev1/config.h b/keyboards/abstract/ellipse/rev1/config.h new file mode 100644 index 00000000000..36a4fc40f2a --- /dev/null +++ b/keyboards/abstract/ellipse/rev1/config.h @@ -0,0 +1,239 @@ +/* +Copyright 2019 AbstractKB + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0001 +#define DEVICE_VER 0x0001 +#define MANUFACTURER AbstractKB +#define PRODUCT EllipseRev1 +#define DESCRIPTION The Ellipse Macropad + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, C7 } +#define MATRIX_COL_PINS { F0, B6, B5 } +#define UNUSED_PINS { B0, D0, D1, D2, D4, D6, D7, F1, F4, F5, F6, F7 } + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN C6 +//#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 15 + +#define RGB_DI_PIN E6 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 3 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +#define ENCODERS_PAD_A { B2, B3, D5 } +#define ENCODERS_PAD_B { B1, B7, B4 } +#define ENCODER_RESOLUTION 2 diff --git a/keyboards/abstract/ellipse/rev1/rev1.c b/keyboards/abstract/ellipse/rev1/rev1.c new file mode 100644 index 00000000000..ae7aa640e4a --- /dev/null +++ b/keyboards/abstract/ellipse/rev1/rev1.c @@ -0,0 +1,43 @@ +/* Copyright 2019 AbstractKB + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev1.h" + +/*void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +}*/ \ No newline at end of file diff --git a/keyboards/abstract/ellipse/rev1/rev1.h b/keyboards/abstract/ellipse/rev1/rev1.h new file mode 100644 index 00000000000..de8b9bacb6c --- /dev/null +++ b/keyboards/abstract/ellipse/rev1/rev1.h @@ -0,0 +1,36 @@ +/* Copyright 2019 AbstractKB + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, \ + K10, K11, K12 \ +) \ +{ \ + { K00, K01, K02 }, \ + { K10, K11, K12 }, \ +} + diff --git a/keyboards/abstract/ellipse/rev1/rules.mk b/keyboards/abstract/ellipse/rev1/rules.mk new file mode 100644 index 00000000000..880d40e49be --- /dev/null +++ b/keyboards/abstract/ellipse/rev1/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +ENCODER_ENABLE = yes # Enable support for rotary encoders diff --git a/keyboards/acr60/config.h b/keyboards/acr60/config.h index 3066f349de0..9b2b2a2f00d 100644 --- a/keyboards/acr60/config.h +++ b/keyboards/acr60/config.h @@ -28,7 +28,7 @@ #define BACKLIGHT_LEVELS 5 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -36,11 +36,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 20 diff --git a/keyboards/acr60/keymaps/default/keymap.c b/keyboards/acr60/keymaps/default/keymap.c index a07e0ddc592..aafc1dfe68f 100644 --- a/keyboards/acr60/keymaps/default/keymap.c +++ b/keyboards/acr60/keymaps/default/keymap.c @@ -1,6 +1,10 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -13,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * via the function actions code at the bottom. */ LAYOUT( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, + SFT_ESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, @@ -34,21 +38,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -56,7 +50,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -64,6 +58,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/acr60/readme.md b/keyboards/acr60/readme.md index a0ba2ecdea6..54ea265f1c9 100644 --- a/keyboards/acr60/readme.md +++ b/keyboards/acr60/readme.md @@ -15,4 +15,4 @@ Make example for this keyboard (after setting up your build environment): make acr60:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/adkb96/adkb96.c b/keyboards/adkb96/adkb96.c new file mode 100644 index 00000000000..9a1c85a2ce4 --- /dev/null +++ b/keyboards/adkb96/adkb96.c @@ -0,0 +1,19 @@ +#include "adkb96.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}, {7, 6}}, + {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}, {6, 7}, {7, 7}}, + {{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}, {5, 8}, {6, 8}, {7, 8}}, + {{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}, {5, 9}, {6, 9}, {7, 9}}, + {{0,10}, {1,10}, {2,10}, {3,10}, {4,10}, {5,10}, {6,10}, {7,10}}, + {{0,11}, {1,11}, {2,11}, {3,11}, {4,11}, {5,11}, {6,11}, {7,11}}, + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1}, {7, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {6, 2}, {7, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {6, 3}, {7, 3}}, + {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {6, 4}, {7, 4}}, + {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}, {6, 5}, {7, 5}} +}; +#endif diff --git a/keyboards/adkb96/adkb96.h b/keyboards/adkb96/adkb96.h new file mode 100644 index 00000000000..4b28775006d --- /dev/null +++ b/keyboards/adkb96/adkb96.h @@ -0,0 +1,28 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_adkb96_rev1 + #include "rev1.h" +#endif + + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc_ortho_6x16( \ + L00, L01, L02, L03, L04, L05, L06, L07, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, L16, L17, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, L26, L27, R20, R21, R22, R23, R24, R25, R26, R27, \ + L30, L31, L32, L33, L34, L35, L36, L37, R30, R31, R32, R33, R34, R35, R36, R37, \ + L40, L41, L42, L43, L44, L45, L46, L47, R40, R41, R42, R43, R44, R45, R46, R47, \ + L50, L51, L52, L53, L54, L55, L56, L57, R50, R51, R52, R53, R54, R55, R56, R57 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##L07, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, KC_##R07, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##L17, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, KC_##R17, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, KC_##R27, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, KC_##R37, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##L47, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46, KC_##R47, \ + KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, KC_##L56, KC_##L57, KC_##R50, KC_##R51, KC_##R52, KC_##R53, KC_##R54, KC_##R55, KC_##R56 ,KC_##R57 \ + ) + +#define LAYOUT_kc LAYOUT_kc_ortho_6x16 diff --git a/keyboards/adkb96/config.h b/keyboards/adkb96/config.h new file mode 100644 index 00000000000..93fd2261b18 --- /dev/null +++ b/keyboards/adkb96/config.h @@ -0,0 +1,22 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + diff --git a/keyboards/adkb96/info.json b/keyboards/adkb96/info.json new file mode 100644 index 00000000000..3b914d56b17 --- /dev/null +++ b/keyboards/adkb96/info.json @@ -0,0 +1,494 @@ +{ + "keyboard_name": "adkb96", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT_ortho_6x16": { + "key_count": 96, + "layout": [ + { + "label": "L00", + "x": 0, + "y": 0 + }, + { + "label": "L01", + "x": 1, + "y": 0 + }, + { + "label": "L02", + "x": 2, + "y": 0 + }, + { + "label": "L03", + "x": 3, + "y": 0 + }, + { + "label": "L04", + "x": 4, + "y": 0 + }, + { + "label": "L05", + "x": 5, + "y": 0 + }, + { + "label": "L06", + "x": 6, + "y": 0 + }, + { + "label": "L07", + "x": 7, + "y": 0 + }, + { + "label": "R00", + "x": 8, + "y": 0 + }, + { + "label": "R01", + "x": 9, + "y": 0 + }, + { + "label": "R02", + "x": 10, + "y": 0 + }, + { + "label": "R03", + "x": 11, + "y": 0 + }, + { + "label": "R04", + "x": 12, + "y": 0 + }, + { + "label": "R05", + "x": 13, + "y": 0 + }, + { + "label": "R06", + "x": 14, + "y": 0 + }, + { + "label": "R07", + "x": 15, + "y": 0 + }, + { + "label": "L10", + "x": 0, + "y": 1 + }, + { + "label": "L11", + "x": 1, + "y": 1 + }, + { + "label": "L12", + "x": 2, + "y": 1 + }, + { + "label": "L13", + "x": 3, + "y": 1 + }, + { + "label": "L14", + "x": 4, + "y": 1 + }, + { + "label": "L15", + "x": 5, + "y": 1 + }, + { + "label": "L16", + "x": 6, + "y": 1 + }, + { + "label": "L17", + "x": 7, + "y": 1 + }, + { + "label": "R10", + "x": 8, + "y": 1 + }, + { + "label": "R11", + "x": 9, + "y": 1 + }, + { + "label": "R12", + "x": 10, + "y": 1 + }, + { + "label": "R13", + "x": 11, + "y": 1 + }, + { + "label": "R14", + "x": 12, + "y": 1 + }, + { + "label": "R15", + "x": 13, + "y": 1 + }, + { + "label": "R16", + "x": 14, + "y": 1 + }, + { + "label": "R17", + "x": 15, + "y": 1 + }, + { + "label": "L20", + "x": 0, + "y": 2 + }, + { + "label": "L21", + "x": 1, + "y": 2 + }, + { + "label": "L22", + "x": 2, + "y": 2 + }, + { + "label": "L23", + "x": 3, + "y": 2 + }, + { + "label": "L24", + "x": 4, + "y": 2 + }, + { + "label": "L25", + "x": 5, + "y": 2 + }, + { + "label": "L26", + "x": 6, + "y": 2 + }, + { + "label": "L27", + "x": 7, + "y": 2 + }, + { + "label": "R20", + "x": 8, + "y": 2 + }, + { + "label": "R21", + "x": 9, + "y": 2 + }, + { + "label": "R22", + "x": 10, + "y": 2 + }, + { + "label": "R23", + "x": 11, + "y": 2 + }, + { + "label": "R24", + "x": 12, + "y": 2 + }, + { + "label": "R25", + "x": 13, + "y": 2 + }, + { + "label": "R26", + "x": 14, + "y": 2 + }, + { + "label": "R27", + "x": 15, + "y": 2 + }, + { + "label": "L30", + "x": 0, + "y": 3 + }, + { + "label": "L31", + "x": 1, + "y": 3 + }, + { + "label": "L32", + "x": 2, + "y": 3 + }, + { + "label": "L33", + "x": 3, + "y": 3 + }, + { + "label": "L34", + "x": 4, + "y": 3 + }, + { + "label": "L35", + "x": 5, + "y": 3 + }, + { + "label": "L36", + "x": 6, + "y": 3 + }, + { + "label": "L37", + "x": 7, + "y": 3 + }, + { + "label": "R30", + "x": 8, + "y": 3 + }, + { + "label": "R31", + "x": 9, + "y": 3 + }, + { + "label": "R32", + "x": 10, + "y": 3 + }, + { + "label": "R33", + "x": 11, + "y": 3 + }, + { + "label": "R34", + "x": 12, + "y": 3 + }, + { + "label": "R35", + "x": 13, + "y": 3 + }, + { + "label": "R36", + "x": 14, + "y": 3 + }, + { + "label": "R37", + "x": 15, + "y": 3 + }, + { + "label": "L40", + "x": 0, + "y": 4 + }, + { + "label": "L41", + "x": 1, + "y": 4 + }, + { + "label": "L42", + "x": 2, + "y": 4 + }, + { + "label": "L43", + "x": 3, + "y": 4 + }, + { + "label": "L44", + "x": 4, + "y": 4 + }, + { + "label": "L45", + "x": 5, + "y": 4 + }, + { + "label": "L46", + "x": 6, + "y": 4 + }, + { + "label": "L47", + "x": 7, + "y": 4 + }, + { + "label": "R40", + "x": 8, + "y": 4 + }, + { + "label": "R41", + "x": 9, + "y": 4 + }, + { + "label": "R42", + "x": 10, + "y": 4 + }, + { + "label": "R43", + "x": 11, + "y": 4 + }, + { + "label": "R44", + "x": 12, + "y": 4 + }, + { + "label": "R45", + "x": 13, + "y": 4 + }, + { + "label": "R46", + "x": 14, + "y": 4 + }, + { + "label": "R47", + "x": 15, + "y": 4 + }, + { + "label": "L50", + "x": 0, + "y": 5 + }, + { + "label": "L51", + "x": 1, + "y": 5 + }, + { + "label": "L52", + "x": 2, + "y": 5 + }, + { + "label": "L53", + "x": 3, + "y": 5 + }, + { + "label": "L54", + "x": 4, + "y": 5 + }, + { + "label": "L55", + "x": 5, + "y": 5 + }, + { + "label": "L56", + "x": 6, + "y": 5 + }, + { + "label": "L57", + "x": 7, + "y": 5 + }, + { + "label": "R50", + "x": 8, + "y": 5 + }, + { + "label": "R51", + "x": 9, + "y": 5 + }, + { + "label": "R52", + "x": 10, + "y": 5 + }, + { + "label": "R53", + "x": 11, + "y": 5 + }, + { + "label": "R54", + "x": 12, + "y": 5 + }, + { + "label": "R55", + "x": 13, + "y": 5 + }, + { + "label": "R56", + "x": 14, + "y": 5 + }, + { + "label": "R57", + "x": 15, + "y": 5 + } + ] + } + } +} \ No newline at end of file diff --git a/keyboards/adkb96/keymaps/default/config.h b/keyboards/adkb96/keymaps/default/config.h new file mode 100644 index 00000000000..bef279a6d03 --- /dev/null +++ b/keyboards/adkb96/keymaps/default/config.h @@ -0,0 +1,34 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +//#define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define FORCE_NKRO diff --git a/keyboards/adkb96/keymaps/default/keymap.c b/keyboards/adkb96/keymaps/default/keymap.c new file mode 100644 index 00000000000..c8198ab3359 --- /dev/null +++ b/keyboards/adkb96/keymaps/default/keymap.c @@ -0,0 +1,15 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, XXXXXXX,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DELT, + KC_ZKHK,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_JYEN,KC_BSPC,KC_BSPC, + KC_TAB, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_ENT, KC_ENT, + KC_CAPS,KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_BSLS,KC_ENT, KC_ENT, + KC_LSFT,KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RO, KC_UP, KC_RSFT,KC_RSFT, + KC_LCTL,KC_LALT,KC_LGUI,KC_MHEN,KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_HENK,KC_KANA,KC_RALT,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT,XXXXXXX + ) +}; diff --git a/keyboards/adkb96/readme.md b/keyboards/adkb96/readme.md new file mode 100644 index 00000000000..fa5187966bb --- /dev/null +++ b/keyboards/adkb96/readme.md @@ -0,0 +1,17 @@ +# ADKB96 + +![ADKB96](http://btoshop.jp/wp-content/uploads/sites/3/2019/04/ADKB96_ALL.png) + +A 16x6 ortholinear keyboard kit made and sold by Bit Trade One Ltd. [More info on Web](http://bit-trade-one.co.jp/selfmadekb/adkb96/) + +Keyboard Maintainer: [Bit Trade One Ltd.](http://bit-trade-one.co.jp/) +Hardware Supported: ADKB96 PCB, Pro Micro +Hardware Availability: [PCB & case Data](https://github.com/bit-trade-one/ADKB96-hardware), [BTOS Shop](http://btoshop.jp/2019/04/11/4562469772424/) + +Make example for this keyboard (after setting up your build environment): + +```sh + make adkb96/rev1:default +``` + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/adkb96/rev1/config.h b/keyboards/adkb96/rev1/config.h new file mode 100644 index 00000000000..cff135c261a --- /dev/null +++ b/keyboards/adkb96/rev1/config.h @@ -0,0 +1,77 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x00a5 +#define PRODUCT_ID 0xad96 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Bit Trade One +#define PRODUCT ADKB96 +#define DESCRIPTION + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_COLS 8 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } + +#define SOFT_SERIAL_PIN D0 + +/* define tapping term */ +#define TAPPING_TERM 100 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +/* +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 12 // Number of LEDs +*/ +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/adkb96/rev1/rev1.c b/keyboards/adkb96/rev1/rev1.c new file mode 100644 index 00000000000..872a7e08ff0 --- /dev/null +++ b/keyboards/adkb96/rev1/rev1.c @@ -0,0 +1,15 @@ +#include "adkb96.h" + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/adkb96/rev1/rev1.h b/keyboards/adkb96/rev1/rev1.h new file mode 100644 index 00000000000..0ec70c5d5c9 --- /dev/null +++ b/keyboards/adkb96/rev1/rev1.h @@ -0,0 +1,44 @@ +#pragma once + +#include "adkb96.h" + +//void promicro_bootloader_jmp(bool program); + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define LAYOUT_ortho_6x16( \ + L00, L01, L02, L03, L04, L05, L06, L07, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, L16, L17, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, L26, L27, R20, R21, R22, R23, R24, R25, R26, R27, \ + L30, L31, L32, L33, L34, L35, L36, L37, R30, R31, R32, R33, R34, R35, R36, R37, \ + L40, L41, L42, L43, L44, L45, L46, L47, R40, R41, R42, R43, R44, R45, R46, R47, \ + L50, L51, L52, L53, L54, L55, L56, L57, R50, R51, R52, R53, R54, R55, R56, R57 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06, L07 }, \ + { L10, L11, L12, L13, L14, L15, L16, L17 }, \ + { L20, L21, L22, L23, L24, L25, L26, L27 }, \ + { L30, L31, L32, L33, L34, L35, L36, L37 }, \ + { L40, L41, L42, L43, L44, L45, L46, L47 }, \ + { L50, L51, L52, L53, L54, L55, L56, L57 }, \ + { R00, R01, R02, R03, R04, R05, R06, R07 }, \ + { R10, R11, R12, R13, R14, R15, R16, R17 }, \ + { R20, R21, R22, R23, R24, R25, R26, R27 }, \ + { R30, R31, R32, R33, R34, R35, R36, R37 }, \ + { R40, R41, R42, R43, R44, R45, R46, R47 }, \ + { R50, R51, R52, R53, R54, R55, R56, R57 } \ + } + +#define LAYOUT LAYOUT_ortho_6x16 + diff --git a/keyboards/adkb96/rules.mk b/keyboards/adkb96/rules.mk new file mode 100644 index 00000000000..707fafd7caf --- /dev/null +++ b/keyboards/adkb96/rules.mk @@ -0,0 +1,77 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + # Bootloader selection + # Teensy halfkay + # Pro Micro caterina + # Atmel DFU atmel-dfu + # LUFA DFU lufa-dfu + # QMK DFU qmk-dfu + # atmega32a bootloadHID +BOOTLOADER = caterina + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = adkb96/rev1 diff --git a/keyboards/rama/u80_a/u80_a.c b/keyboards/aeboards/aegis/aegis.c similarity index 100% rename from keyboards/rama/u80_a/u80_a.c rename to keyboards/aeboards/aegis/aegis.c diff --git a/keyboards/aeboards/aegis/aegis.h b/keyboards/aeboards/aegis/aegis.h new file mode 100644 index 00000000000..95ffb73dde0 --- /dev/null +++ b/keyboards/aeboards/aegis/aegis.h @@ -0,0 +1,43 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define _____ KC_NO + +#define LAYOUT_aegis( \ + K0000, K0100, K0001, K0101, K0002, K0102, K0003, K0103, K0004, K0104, K0005, K0105, K0006, K0106, K0007, K0107, K0008, \ + K0200, K0300, K0201, K0301, K0202, K0302, K0203, K0303, K0204, K0304, K0205, K0305, K0206, K0306, K0207, K0307, K0208, K0308, K0108, \ + K0400, K0500, K0401, K0501, K0402, K0502, K0403, K0503, K0404, K0504, K0405, K0505, K0406, K0506, K0407, K0507, K0408, K0508, \ + K0600, K0700, K0601, K0701, K0602, K0702, K0603, K0703, K0604, K0704, K0605, K0705, K0606, K0706, K0607, K0707, K0608, \ + K0800, K0900, K0801, K0901, K0802, K0902, K0803, K0903, K0804, K0904, K0805, K0905, K0806, K0906, K0807, K0907, K0808, K0908, \ + K1000, K1100, K1001, K1101, K1002, K1102, K1003, K1103, K1105, K1107, K1008, K1108 \ +) { \ + { K0000, K0001, K0002, K0003, K0004, K0005, K0006, K0007, K0008 }, \ + { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, K0108 }, \ + { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208 }, \ + { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308 }, \ + { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408 }, \ + { K0500, K0501, K0502, K0503, K0504, K0505, K0506, K0507, K0508 }, \ + { K0600, K0601, K0602, K0603, K0604, K0605, K0606, K0607, K0608 }, \ + { K0700, K0701, K0702, K0703, K0704, K0705, K0706, K0707, _____ }, \ + { K0800, K0801, K0802, K0803, K0804, K0805, K0806, K0807, K0808 }, \ + { K0900, K0901, K0902, K0903, K0904, K0905, K0906, K0907, K0908 }, \ + { K1000, K1001, K1002, K1003, _____, _____, _____, _____, K1008 }, \ + { K1100, K1101, K1102, K1103, _____, K1105, _____, K1107, K1108 } \ +} diff --git a/keyboards/aeboards/aegis/config.h b/keyboards/aeboards/aegis/config.h new file mode 100644 index 00000000000..01e20454c30 --- /dev/null +++ b/keyboards/aeboards/aegis/config.h @@ -0,0 +1,70 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4145 // "AE" +#define PRODUCT_ID 0x0807 // 1800 -> 0x0708 -> 0x0807 ;-) +#define DEVICE_VER 0x0001 +#define MANUFACTURER AEboards +#define PRODUCT AEboards Aegis +#define DESCRIPTION AEboards Aegis + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F5, F6, E6, F7, D1, D0, D6, D4, B4, D7, B6, B5 } +#define MATRIX_COL_PINS { C7, C6, B7, D2, D3, B3, B2, B1, B0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +//#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*12*9*2)) = (35+864) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 899 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 125 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/aeboards/aegis/keymaps/default/keymap.c b/keyboards/aeboards/aegis/keymaps/default/keymap.c new file mode 100644 index 00000000000..8437ffeb4ed --- /dev/null +++ b/keyboards/aeboards/aegis/keymaps/default/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap BASE: (Base Layer) Default Layer + * ,-------------------. ,-------------------------------------------------------------. + * |End |Home|PgDn|PgUp| |Esc| F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12| + * `-------------------' `-------------------------------------------------------------' + * + * |-------------------| ,-------------------------------------------------------------. + * |- | * | / |BSPC| | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|pipe| del| + * |-------------------| |-------------------------------------------------------------| + * | | 9 | 8 | 7 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| BSPC | + * | + |--------------| |-------------------------------------------------------------| + * | | 6 | 5 | 4 | |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-------------------| |-------------------------------------------------------------| + * | | 3 | 2 | 1 | |Up| |Shift| Z| X| C| V| B| N| M| ,| .| /|Shift | FN | + * | ENT|-------------------------------------------------------------------------------| + * | | 0 | left |Dn| rhgt | FN | Alt | Space |Alt |Gui| ctrl| | + * `------------------------------------------------------------------------------------' + */ + [0] = LAYOUT_aegis( + KC_END , KC_HOME, KC_PGDN, KC_PGUP, KC_ESC , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + KC_PMNS, KC_PAST, KC_PSLS, KC_BSPC, KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_DEL, + KC_PPLS, KC_P9 , KC_P8 , KC_P7 , KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSPC, + KC_PPLS, KC_P6 , KC_P5 , KC_P4 , KC_LCTL, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , + KC_PENT, KC_P3 , KC_P2 , KC_P1 , KC_UP , KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, MO(1), + KC_PENT, KC_PDOT, KC_P0 , KC_LEFT, KC_DOWN, KC_RGHT, MO(1), KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + + [1] = LAYOUT_aegis( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_UP , KC_PGDN, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_ENT , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [2] = LAYOUT_aegis( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [3] = LAYOUT_aegis( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) + +}; diff --git a/keyboards/aeboards/aegis/keymaps/default/readme.md b/keyboards/aeboards/aegis/keymaps/default/readme.md new file mode 100644 index 00000000000..e6b24245634 --- /dev/null +++ b/keyboards/aeboards/aegis/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The Default Aegis Layout + diff --git a/keyboards/aeboards/aegis/keymaps/via/keymap.c b/keyboards/aeboards/aegis/keymaps/via/keymap.c new file mode 100644 index 00000000000..8437ffeb4ed --- /dev/null +++ b/keyboards/aeboards/aegis/keymaps/via/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap BASE: (Base Layer) Default Layer + * ,-------------------. ,-------------------------------------------------------------. + * |End |Home|PgDn|PgUp| |Esc| F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12| + * `-------------------' `-------------------------------------------------------------' + * + * |-------------------| ,-------------------------------------------------------------. + * |- | * | / |BSPC| | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|pipe| del| + * |-------------------| |-------------------------------------------------------------| + * | | 9 | 8 | 7 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| BSPC | + * | + |--------------| |-------------------------------------------------------------| + * | | 6 | 5 | 4 | |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-------------------| |-------------------------------------------------------------| + * | | 3 | 2 | 1 | |Up| |Shift| Z| X| C| V| B| N| M| ,| .| /|Shift | FN | + * | ENT|-------------------------------------------------------------------------------| + * | | 0 | left |Dn| rhgt | FN | Alt | Space |Alt |Gui| ctrl| | + * `------------------------------------------------------------------------------------' + */ + [0] = LAYOUT_aegis( + KC_END , KC_HOME, KC_PGDN, KC_PGUP, KC_ESC , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + KC_PMNS, KC_PAST, KC_PSLS, KC_BSPC, KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_DEL, + KC_PPLS, KC_P9 , KC_P8 , KC_P7 , KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSPC, + KC_PPLS, KC_P6 , KC_P5 , KC_P4 , KC_LCTL, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , + KC_PENT, KC_P3 , KC_P2 , KC_P1 , KC_UP , KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, MO(1), + KC_PENT, KC_PDOT, KC_P0 , KC_LEFT, KC_DOWN, KC_RGHT, MO(1), KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + + [1] = LAYOUT_aegis( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_UP , KC_PGDN, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_ENT , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [2] = LAYOUT_aegis( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [3] = LAYOUT_aegis( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) + +}; diff --git a/keyboards/aeboards/aegis/keymaps/via/readme.md b/keyboards/aeboards/aegis/keymaps/via/readme.md new file mode 100644 index 00000000000..a80671bd943 --- /dev/null +++ b/keyboards/aeboards/aegis/keymaps/via/readme.md @@ -0,0 +1,2 @@ +# The VIA Aegis Layout + diff --git a/keyboards/aeboards/aegis/keymaps/via/rules.mk b/keyboards/aeboards/aegis/keymaps/via/rules.mk new file mode 100644 index 00000000000..f072c67198c --- /dev/null +++ b/keyboards/aeboards/aegis/keymaps/via/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/aeboards/aegis/readme.md b/keyboards/aeboards/aegis/readme.md new file mode 100644 index 00000000000..1b8fc124e5b --- /dev/null +++ b/keyboards/aeboards/aegis/readme.md @@ -0,0 +1,14 @@ +AEGIS +=== + +A left handed g80-1800-esque keyboard by [aeboards](https://aeboards.com/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: AEGIS +Hardware Availability: Custom keyboard group buys + +Make example for this keyboard (after setting up your build environment): + + make aeboards/aegis:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/aeboards/aegis/rules.mk b/keyboards/aeboards/aegis/rules.mk new file mode 100644 index 00000000000..f1c632289cc --- /dev/null +++ b/keyboards/aeboards/aegis/rules.mk @@ -0,0 +1,65 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/aeboards/ext65/config.h b/keyboards/aeboards/ext65/config.h new file mode 100644 index 00000000000..2f66f3f9262 --- /dev/null +++ b/keyboards/aeboards/ext65/config.h @@ -0,0 +1,71 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4145 // "AE" +#define PRODUCT_ID 0xAE65 // AEboards EXT65 +#define DEVICE_VER 0x0001 +#define MANUFACTURER AEboards +#define PRODUCT AEboards Ext65 +#define DESCRIPTION AEboards Ext65 + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 10 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { C6, C7, B5, B6, D7, B4, D4, D6, B7, E6 } +#define MATRIX_COL_PINS { B2, B3, B1, B0, F7, F0, F1, F4, F5, F6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +//#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*10*2)) = (35+800) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 835 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 189 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 + diff --git a/keyboards/aeboards/ext65/ext65.c b/keyboards/aeboards/ext65/ext65.c new file mode 100644 index 00000000000..f52f8d43861 --- /dev/null +++ b/keyboards/aeboards/ext65/ext65.c @@ -0,0 +1,18 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Nothing to see here, move along... ;-) + diff --git a/keyboards/aeboards/ext65/ext65.h b/keyboards/aeboards/ext65/ext65.h new file mode 100644 index 00000000000..de79b92abd7 --- /dev/null +++ b/keyboards/aeboards/ext65/ext65.h @@ -0,0 +1,40 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define ____ KC_NO + +#define LAYOUT_ext65( \ + K000, K100, K001, K101, K002, K102, K003, K103, K004, K104, K005, K105, K006, K106, K007, K107, K008, K108, K508, K009, \ + K200, K300, K201, K301, K202, K302, K203, K303, K204, K304, K205, K305, K206, K306, K207, K307, K208, K308, K209, \ + K400, K500, K401, K501, K402, K502, K403, K503, K404, K504, K405, K505, K406, K506, K407, K507, K408, K409, \ + K600, K700, K601, K701, K602, K702, K603, K703, K604, K704, K605, K705, K606, K706, K607, K708, K608, K709, \ + K800, K900, K801, K901, K802, K902, K803, K805, K906, K807, K908, K808, K909 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, ____ }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, ____ }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409 }, \ + { K500, K501, K502, K503, K504, K505, K506, K507, K508, ____ }, \ + { K600, K601, K602, K603, K604, K605, K606, K607, K608, ____ }, \ + { K700, K701, K702, K703, K704, K705, K706, ____, K708, K709 }, \ + { K800, K801, K802, K803, ____, K805, ____, K807, K808, ____ }, \ + { K900, K901, K902, ____, ____, ____, K906, ____, K908, K909 } \ +} diff --git a/keyboards/aeboards/ext65/keymaps/default/keymap.c b/keyboards/aeboards/ext65/keymaps/default/keymap.c new file mode 100644 index 00000000000..79d5ecf5056 --- /dev/null +++ b/keyboards/aeboards/ext65/keymaps/default/keymap.c @@ -0,0 +1,104 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap BASE: (Base Layer) Default Layer + * ,-------------------. ,-------------------------------------------------------------------. + * |- | * | / |NmLK| |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|pipe| ~ | Pscr| + * |-------------------| |-------------------------------------------------------------------| + * | | 9 | 8 | 7 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| BSPC | Del | + * | + |--------------| |-------------------------------------------------------------------| + * | | 6 | 5 | 4 | |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | Pgup| + * |-------------------| |-------------------------------------------------------------------| + * | | 3 | 2 | 1 | |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up | Pgdn| + * | ENT|-------------------------------------------------------------------------------------| + * | | . | 0 | | Ctrl | Win | Alt | Space | FN | Ctrl | |Left| Dn | Rght| + * `------------------------------------------------------------------------------------------' + */ + [0] = LAYOUT_ext65( + KC_PMNS, KC_PAST, KC_PSLS, KC_NLCK, KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_GRV , KC_PSCR, + KC_PPLS, KC_P9 , KC_P8 , KC_P7 , KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL , + KC_PPLS, KC_P6 , KC_P5 , KC_P4 , KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_PGUP, + KC_PENT, KC_P3 , KC_P2 , KC_P1 , KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_PGDN, + KC_PENT, KC_PDOT, KC_P0 , KC_P0 , KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , MO(1) , KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = LAYOUT_ext65( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [2] = LAYOUT_ext65( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [3] = LAYOUT_ext65( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + + +void keyboard_pre_init_user(void) { + // Call the keyboard pre init code. + + // Set our LED pins as output + setPinOutput(D5); + setPinOutput(D3); + setPinOutput(D2); + setPinOutput(D1); +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(D5); + } else { + writePinHigh(D5); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(D3); + } else { + writePinHigh(D3); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(D2); + } else { + writePinHigh(D2); + } +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case 1: + writePinHigh(D1); + break; + default: // for any other layers, or the default layer + writePinLow(D1); + break; + } + return state; +} \ No newline at end of file diff --git a/keyboards/aeboards/ext65/keymaps/default/readme.md b/keyboards/aeboards/ext65/keymaps/default/readme.md new file mode 100644 index 00000000000..b4d9a0b6de7 --- /dev/null +++ b/keyboards/aeboards/ext65/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The Default Ext65 Layout + diff --git a/keyboards/aeboards/ext65/keymaps/via/keymap.c b/keyboards/aeboards/ext65/keymaps/via/keymap.c new file mode 100644 index 00000000000..3079c528eb5 --- /dev/null +++ b/keyboards/aeboards/ext65/keymaps/via/keymap.c @@ -0,0 +1,103 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap BASE: (Base Layer) Default Layer + * ,-------------------. ,-------------------------------------------------------------------. + * |- | * | / |NmLK| |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|pipe| ~ | Pscr| + * |-------------------| |-------------------------------------------------------------------| + * | | 9 | 8 | 7 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| BSPC | Del | + * | + |--------------| |-------------------------------------------------------------------| + * | | 6 | 5 | 4 | |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | Pgup| + * |-------------------| |-------------------------------------------------------------------| + * | | 3 | 2 | 1 | |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up | Pgdn| + * | ENT|-------------------------------------------------------------------------------------| + * | | . | 0 | | Ctrl | Win | Alt | Space | FN | Ctrl | |Left| Dn | Rght| + * `------------------------------------------------------------------------------------------' + */ + [0] = LAYOUT_ext65( + KC_PMNS, KC_PAST, KC_PSLS, KC_NLCK, KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_GRV , KC_PSCR, + KC_PPLS, KC_P9 , KC_P8 , KC_P7 , KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL , + KC_PPLS, KC_P6 , KC_P5 , KC_P4 , KC_LCTL, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_PGUP, + KC_PENT, KC_P3 , KC_P2 , KC_P1 , KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_PGDN, + KC_PENT, KC_PDOT, KC_P0 , KC_P0 , KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , MO(1) , KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = LAYOUT_ext65( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [2] = LAYOUT_ext65( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [3] = LAYOUT_ext65( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +void keyboard_pre_init_user(void) { + // Call the keyboard pre init code. + + // Set our LED pins as output + setPinOutput(D5); + setPinOutput(D3); + setPinOutput(D2); + setPinOutput(D1); +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(D5); + } else { + writePinHigh(D5); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(D3); + } else { + writePinHigh(D3); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(D2); + } else { + writePinHigh(D2); + } +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case 1: + writePinHigh(D1); + break; + default: // for any other layers, or the default layer + writePinLow(D1); + break; + } + return state; +} diff --git a/keyboards/aeboards/ext65/keymaps/via/readme.md b/keyboards/aeboards/ext65/keymaps/via/readme.md new file mode 100644 index 00000000000..c2c416d1668 --- /dev/null +++ b/keyboards/aeboards/ext65/keymaps/via/readme.md @@ -0,0 +1,2 @@ +# The VIA Ext65 Layout + diff --git a/keyboards/aeboards/ext65/keymaps/via/rules.mk b/keyboards/aeboards/ext65/keymaps/via/rules.mk new file mode 100644 index 00000000000..f072c67198c --- /dev/null +++ b/keyboards/aeboards/ext65/keymaps/via/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/aeboards/ext65/readme.md b/keyboards/aeboards/ext65/readme.md new file mode 100644 index 00000000000..5ee7fb4f8d8 --- /dev/null +++ b/keyboards/aeboards/ext65/readme.md @@ -0,0 +1,14 @@ +EXT65 +=== + +A southpaw inspired keyboard by [aeboards](https://aeboards.com/) + +Keyboard Maintainer: [Xelus22](https://github.com/Xelus22) +Hardware Supported: EXT65 +Hardware Availability: Custom keyboard group buys + +Make example for this keyboard (after setting up your build environment): + + make aeboards/ext65:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/aeboards/ext65/rules.mk b/keyboards/aeboards/ext65/rules.mk new file mode 100644 index 00000000000..f1c632289cc --- /dev/null +++ b/keyboards/aeboards/ext65/rules.mk @@ -0,0 +1,65 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/ai03/README.md b/keyboards/ai03/README.md new file mode 100644 index 00000000000..90bd219289a --- /dev/null +++ b/keyboards/ai03/README.md @@ -0,0 +1,4 @@ +# ai03 +QMK folders for PCB commissions. + +Website: [ai03 Keyboard Designs](https://kb.ai03.me/) \ No newline at end of file diff --git a/keyboards/ai03/lunar/config.h b/keyboards/ai03/lunar/config.h new file mode 100644 index 00000000000..a9d19255462 --- /dev/null +++ b/keyboards/ai03/lunar/config.h @@ -0,0 +1,266 @@ +/* +Copyright 2019 Ryota Goto + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xA103 +#define PRODUCT_ID 0x0001 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Switchplate Peripherals +#define PRODUCT Lunar +#define DESCRIPTION 65% AEK keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B3, D0, D1, D2, D3 } +#define MATRIX_COL_PINS { D5, D4, D6, D7, B4, B5, B6, C6, C7, F7, F6, F5, F4, F1, F0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +/* VIA Configurator Compatibility */ + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR = DYNAMIC_KEYMAP_EEPROM_ADDR + (DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 635 +// DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE = 1024 - DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 389 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/ai03/lunar/info.json b/keyboards/ai03/lunar/info.json new file mode 100644 index 00000000000..e18a10bde0e --- /dev/null +++ b/keyboards/ai03/lunar/info.json @@ -0,0 +1,84 @@ +{ + "keyboard_name": "Lunar", + "url": "https://geekhack.org/index.php?topic=96112.0", + "maintainer": "ai03", + "bootloader": "", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"BackspaceL", "x":13, "y":0}, + {"label":"BackspaceR", "x":14, "y":0}, + {"label":"Insert", "x":15, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Home", "x":15, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"\u2191", "x":14, "y":3}, + {"label":"End", "x":15, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.5}, + {"label":"Win", "x":1.5, "y":4, "w":1.25}, + {"label":"Alt", "x":2.75, "y":4, "w":1.5}, + {"x":4.25, "y":4, "w":2.25}, + {"x":6.5, "y":4, "w":1.5}, + {"x":8, "y":4, "w":2.75}, + {"label":"Alt", "x":10.75, "y":4, "w":1.25}, + {"label":"Win", "x":12, "y":4}, + {"label":"\u2190", "x":13, "y":4}, + {"label":"\u2193", "x":14, "y":4}, + {"label":"\u2192", "x":15, "y":4} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/ai03/lunar/keymaps/default/keymap.c b/keyboards/ai03/lunar/keymaps/default/keymap.c new file mode 100644 index 00000000000..4705d00ec1d --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/default/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MANUAL = SAFE_RANGE, + SWPLURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* + + Layout + + K000 K001 K002 K003 K004 K005 K006 K007 K008 K009 K010 K011 K012 K013 K212 K014 + K100 K101 K102 K103 K104 K105 K106 K107 K108 K109 K110 K111 K112 K113 K114 + K200 K201 K202 K203 K204 K205 K206 K207 K208 K209 K210 K211 K213 K214 + K300 K301 K302 K303 K304 K305 K306 K307 K308 K309 K310 K311 K313 K314 + K400 K401 K402 K403 K405 K407 K409 K410 K411 K413 K414 + + K212 = Split backspace (bound to Del by default) + K403, K407 = Split space (bound to space by default) + K405 = Main space + + */ + + [0] = LAYOUT( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(1), KC_GRV, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT( /* FN */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, MANUAL, + KC_CAPS, _______, KC_UP, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_MPRV, KC_MPLY, KC_MNXT, _______, SWPLURL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_VOLD, KC_VOLU, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, + _______, KC_RCTL, KC_RGUI, KC_RALT, _______, _______, KC_P0, KC_P1, KC_P2, KC_P3, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MANUAL: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("https://kb.ai03.me/redir/lunar/index.html"); + } else { + // when keycode QMKBEST is released + } + break; + case SWPLURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://switchplate.co/collections/lunar-group-buy"); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/ai03/lunar/keymaps/default/readme.md b/keyboards/ai03/lunar/keymaps/default/readme.md new file mode 100644 index 00000000000..8ff536ffc1e --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The default keymap for Lunar +For use without VIA configurator. \ No newline at end of file diff --git a/keyboards/ai03/lunar/keymaps/via/keymap.c b/keyboards/ai03/lunar/keymaps/via/keymap.c new file mode 100644 index 00000000000..b98e6cf0aa7 --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/via/keymap.c @@ -0,0 +1,64 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* + + Layout + + K000 K001 K002 K003 K004 K005 K006 K007 K008 K009 K010 K011 K012 K013 K212 K014 + K100 K101 K102 K103 K104 K105 K106 K107 K108 K109 K110 K111 K112 K113 K114 + K200 K201 K202 K203 K204 K205 K206 K207 K208 K209 K210 K211 K213 K214 + K300 K301 K302 K303 K304 K305 K306 K307 K308 K309 K310 K311 K313 K314 + K400 K401 K402 K403 K405 K407 K409 K410 K411 K413 K414 + + K212 = Split backspace (bound to Del by default) + K403, K407 = Split space (bound to space by default) + K405 = Main space + + */ + + [0] = LAYOUT( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(1), KC_GRV, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT( /* FN */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, _______, + KC_CAPS, _______, KC_UP, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_VOLD, KC_VOLU, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, + _______, KC_RCTL, KC_RGUI, KC_RALT, _______, _______, KC_P0, KC_P1, KC_P2, KC_P3, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), + [2] = LAYOUT( /* Blank. For VIA compatibility */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [3] = LAYOUT( /* Blank. For VIA compatibility */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/ai03/lunar/keymaps/via/readme.md b/keyboards/ai03/lunar/keymaps/via/readme.md new file mode 100644 index 00000000000..ff0b73bfcee --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/via/readme.md @@ -0,0 +1,2 @@ +# The VIA keymap for Lunar +This keymap is for compatibility with the VIA configurator. \ No newline at end of file diff --git a/keyboards/ai03/lunar/keymaps/via/rules.mk b/keyboards/ai03/lunar/keymaps/via/rules.mk new file mode 100644 index 00000000000..01fcd55e8df --- /dev/null +++ b/keyboards/ai03/lunar/keymaps/via/rules.mk @@ -0,0 +1,85 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SRC += keyboards/wilba_tech/wt_main.c + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes diff --git a/keyboards/ai03/lunar/lunar.c b/keyboards/ai03/lunar/lunar.c new file mode 100644 index 00000000000..37438c71e61 --- /dev/null +++ b/keyboards/ai03/lunar/lunar.c @@ -0,0 +1,22 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "lunar.h" + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/ai03/lunar/lunar.h b/keyboards/ai03/lunar/lunar.h new file mode 100644 index 00000000000..2e66ecb5c56 --- /dev/null +++ b/keyboards/ai03/lunar/lunar.h @@ -0,0 +1,41 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K212, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K403, K405, K407, K409, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, K402, K403, KC_NO, K405, KC_NO, K407, KC_NO, K409, K410, K411, KC_NO, K413, K414 } \ +} diff --git a/keyboards/ai03/lunar/readme.md b/keyboards/ai03/lunar/readme.md new file mode 100644 index 00000000000..585d6454ba5 --- /dev/null +++ b/keyboards/ai03/lunar/readme.md @@ -0,0 +1,15 @@ +# Lunar + +![Photo](https://i.imgur.com/hYoW8IJ.jpg) + +A 65% keyboard made specifically for Alps SKCM/L switches and AEK/M0116 keycaps. + +Keyboard Maintainer: [ai03](https://github.com/ai03-2725) +Hardware Supported: Official Lunar PCB +Hardware Availability: [Switchplate Peripherals](https://switchplate.co/) + +Make example for this keyboard (after setting up your build environment): + + make ai03/lunar:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ai03/lunar/rules.mk b/keyboards/ai03/lunar/rules.mk new file mode 100644 index 00000000000..6bb6d9ae9a8 --- /dev/null +++ b/keyboards/ai03/lunar/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/ai03/orbit/config.h b/keyboards/ai03/orbit/config.h new file mode 100644 index 00000000000..00945ac7969 --- /dev/null +++ b/keyboards/ai03/orbit/config.h @@ -0,0 +1,249 @@ +/* +Copyright 2018 Ryota Goto + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xA103 +#define PRODUCT_ID 0x0003 +#define DEVICE_VER 0x0003 +#define MANUFACTURER ai03 Keyboard Designs +#define PRODUCT Orbit +#define DESCRIPTION Split ergonomic keyboard + +/* key matrix size */ +#define MATRIX_ROWS 10 // Double rows for split keyboards. Orbit has 5, so define 10 +#define MATRIX_COLS 7 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F7, F6, F5, F4, D3 } +#define MATRIX_COL_PINS { C7, B4, D7, D6, D4, F1, F0 } +#define MATRIX_ROW_PINS_RIGHT { B6, B5, B4, D7, E6 } +#define MATRIX_COL_PINS_RIGHT { D4, D6, F1, F0, F4, F5, C6 } + +#define SPLIT_HAND_PIN D5 + +//#define USE_I2C + +#define SELECT_SOFT_SERIAL_SPEED 1 + +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/ai03/orbit/info.json b/keyboards/ai03/orbit/info.json new file mode 100644 index 00000000000..ca838811301 --- /dev/null +++ b/keyboards/ai03/orbit/info.json @@ -0,0 +1,88 @@ +{ + "keyboard_name": "orbit", + "url": "https://github.com/ai03-2725/Orbit", + "maintainer": "ai03", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0.63}, + {"x":1, "y":0.38}, + {"x":2, "y":0.38}, + {"x":3, "y":0.13}, + {"x":4, "y":0}, + {"x":5, "y":0.13}, + {"x":6, "y":0.25}, + {"x":9, "y":0.25}, + {"x":10, "y":0.13}, + {"x":11, "y":0}, + {"x":12, "y":0.13}, + {"x":13, "y":0.38}, + {"x":14, "y":0.38}, + {"x":15, "y":0.63}, + + {"x":0, "y":1.63}, + {"x":1, "y":1.38}, + {"x":2, "y":1.38}, + {"x":3, "y":1.13}, + {"x":4, "y":1}, + {"x":5, "y":1.13}, + {"x":6, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.13}, + {"x":11, "y":1}, + {"x":12, "y":1.13}, + {"x":13, "y":1.38}, + {"x":14, "y":1.38}, + {"x":15, "y":1.63}, + + {"x":0, "y":2.63}, + {"x":1, "y":2.38}, + {"x":2, "y":2.38}, + {"x":3, "y":2.13}, + {"x":4, "y":2}, + {"x":5, "y":2.13}, + {"x":6, "y":2.25}, + {"x":9, "y":2.25}, + {"x":10, "y":2.13}, + {"x":11, "y":2}, + {"x":12, "y":2.13}, + {"x":13, "y":2.38}, + {"x":14, "y":2.38}, + {"x":15, "y":2.63}, + + {"x":0, "y":3.63}, + {"x":1, "y":3.38}, + {"x":2, "y":3.38}, + {"x":3, "y":3.13}, + {"x":4, "y":3}, + {"x":5, "y":3.13}, + {"x":6, "y":3.25}, + {"x":9, "y":3.25}, + {"x":10, "y":3.13}, + {"x":11, "y":3}, + {"x":12, "y":3.13}, + {"x":13, "y":3.38}, + {"x":14, "y":3.38}, + {"x":15, "y":3.63}, + + {"x":1, "y":4.38}, + {"x":2, "y":4.38}, + {"x":3, "y":4.13}, + {"x":4, "y":4}, + + {"x":5.5, "y":4.25}, + {"x":6.5, "y":4.5, "h":1.5}, + + {"x":8.5, "y":4.5, "h":1.5}, + {"x":9.5, "y":4.25}, + + {"x":11, "y":4}, + {"x":12, "y":4.13}, + {"x":13, "y":4.38}, + {"x":14, "y":4.38} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/ai03/orbit/keymaps/default/keymap.c b/keyboards/ai03/orbit/keymaps/default/keymap.c new file mode 100644 index 00000000000..4c8c39fb0f2 --- /dev/null +++ b/keyboards/ai03/orbit/keymaps/default/keymap.c @@ -0,0 +1,91 @@ +/* Copyright 2018 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MANUAL = SAFE_RANGE, + DBLZERO +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + TO(1), KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_BSPC, \ + TO(1), KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, KC_BSLS, \ + KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_NO, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_PSCR, KC_DEL, \ + KC_LCTL, KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_GRV, KC_MENU, KC_MINS, KC_EQL + ), + [1] = LAYOUT( /* Fn, Arrowkeys, Media control, Backlight */ + TO(2), _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_VOLU, _______, \ + TO(2), _______, _______, KC_PGUP, _______, _______, KC_F11, KC_F12, _______, KC_UP, _______, _______, KC_VOLD, BL_STEP, \ + TO(0), _______, KC_HOME, KC_PGDN, KC_END, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_MPLY, _______, \ + TO(0), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [2] = LAYOUT( /* Mousekeys and Numpad */ + KC_NO, _______, _______, _______, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, _______, \ + KC_NO, _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, KC_P4, KC_P5, KC_P6, KC_PAST, _______, _______, \ + TO(1), _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, _______, \ + TO(1), _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_BTN3, _______, DBLZERO, KC_P0, KC_PDOT, KC_PENT, KC_PPLS, _______, MANUAL, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MANUAL: + if (record->event.pressed) + { + // Keypress + SEND_STRING("https://kb.ai03.me/redir/orbit"); + } + else + { + // Key release + } + break; + case DBLZERO: + if (record->event.pressed) + { + // Keypress + SEND_STRING("00"); + } + else + { + // Key release + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} + +uint32_t layer_state_set_user(uint32_t state) { + + return state; +} diff --git a/keyboards/ai03/orbit/keymaps/default/readme.md b/keyboards/ai03/orbit/keymaps/default/readme.md new file mode 100644 index 00000000000..63c528abfa5 --- /dev/null +++ b/keyboards/ai03/orbit/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default keymap for Orbit + +[KLE of layout](http://www.keyboard-layout-editor.com/#/gists/53ebf59524de12515cb7e2e6de94f0d6) \ No newline at end of file diff --git a/keyboards/ai03/orbit/matrix.c b/keyboards/ai03/orbit/matrix.c new file mode 100644 index 00000000000..a1509666cd5 --- /dev/null +++ b/keyboards/ai03/orbit/matrix.c @@ -0,0 +1,328 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include "wait.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "config.h" +#include "split_flags.h" +#include "quantum.h" +#include "debounce.h" +#include "transport.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +//#define ROWS_PER_HAND (MATRIX_ROWS / 2) + +#ifdef DIRECT_PINS +static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; +#else +static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t raw_matrix[ROWS_PER_HAND]; + +// row offsets for each hand +uint8_t thisHand, thatHand; + +// user-defined overridable functions + +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } + +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } + +__attribute__((weak)) void matrix_init_user(void) {} + +__attribute__((weak)) void matrix_scan_user(void) {} + +__attribute__((weak)) void matrix_slave_scan_user(void) {} + +// helper functions + +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } + +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } + +bool matrix_is_modified(void) { + if (debounce_active()) return false; + return true; +} + +inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } + +inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } + +void matrix_print(void) { + print_matrix_header(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); + print(": "); + print_matrix_row(row); + print("\n"); + } +} + +uint8_t matrix_key_count(void) { + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += matrix_bitpop(i); + } + return count; +} + +// matrix code + +#ifdef DIRECT_PINS + +static void init_pins(void) { + for (int row = 0; row < MATRIX_ROWS; row++) { + for (int col = 0; col < MATRIX_COLS; col++) { + pin_t pin = direct_pins[row][col]; + if (pin != NO_PIN) { + setPinInputHigh(pin); + } + } + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + matrix_row_t last_row_value = current_matrix[current_row]; + current_matrix[current_row] = 0; + + for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + pin_t pin = direct_pins[current_row][col_index]; + if (pin != NO_PIN) { + current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); + } + } + + return (last_row_value != current_matrix[current_row]); +} + +#elif (DIODE_DIRECTION == COL2ROW) + +static void select_row(uint8_t row) { + setPinOutput(row_pins[row]); + writePinLow(row_pins[row]); +} + +static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } + +static void unselect_rows(void) { + for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { + setPinInputHigh(row_pins[x]); + } +} + +static void init_pins(void) { + unselect_rows(); + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + setPinInputHigh(col_pins[x]); + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + // For each col... + for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= readPin(col_pins[col_index]) ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +#elif (DIODE_DIRECTION == ROW2COL) + +static void select_col(uint8_t col) { + setPinOutput(col_pins[col]); + writePinLow(col_pins[col]); +} + +static void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); } + +static void unselect_cols(void) { + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + setPinInputHigh(col_pins[x]); + } +} + +static void init_pins(void) { + unselect_cols(); + for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { + setPinInputHigh(row_pins[x]); + } +} + +static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { + bool matrix_changed = false; + + // Select col and wait for col selecton to stabilize + select_col(current_col); + wait_us(30); + + // For each row... + for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[row_index]; + + // Check row pin state + if (readPin(row_pins[row_index])) { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } else { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } + + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) { + matrix_changed = true; + } + } + + // Unselect col + unselect_col(current_col); + + return matrix_changed; +} + +#endif + +void matrix_init(void) { + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + + // Set pinout for right half if pinout for that half is defined + if (!isLeftHand) { +#ifdef MATRIX_ROW_PINS_RIGHT + const uint8_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + row_pins[i] = row_pins_right[i]; + } +#endif +#ifdef MATRIX_COL_PINS_RIGHT + const uint8_t col_pins_right[MATRIX_COLS] = MATRIX_COL_PINS_RIGHT; + for (uint8_t i = 0; i < MATRIX_COLS; i++) { + col_pins[i] = col_pins_right[i]; + } +#endif + } + + thisHand = isLeftHand ? 0 : (ROWS_PER_HAND); + thatHand = ROWS_PER_HAND - thisHand; + + // initialize key pins + init_pins(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + + debounce_init(ROWS_PER_HAND); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) { + bool changed = false; + +#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) + // Set row, read cols + for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { + changed |= read_cols_on_row(raw_matrix, current_row); + } +#elif (DIODE_DIRECTION == ROW2COL) + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { + changed |= read_rows_on_col(raw_matrix, current_col); + } +#endif + + debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); + + return 1; +} + +uint8_t matrix_scan(void) { + uint8_t ret = _matrix_scan(); + + if (is_keyboard_master()) { + static uint8_t error_count; + + if (!transport_master(matrix + thatHand)) { + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[thatHand + i] = 0; + } + } + } else { + error_count = 0; + } + + matrix_scan_quantum(); + } else { + transport_slave(matrix + thisHand); + matrix_slave_scan_user(); + } + + return ret; +} diff --git a/keyboards/ai03/orbit/matrix.h b/keyboards/ai03/orbit/matrix.h new file mode 100644 index 00000000000..c2bdd3098c1 --- /dev/null +++ b/keyboards/ai03/orbit/matrix.h @@ -0,0 +1,3 @@ +#pragma once + +#include diff --git a/keyboards/ai03/orbit/orbit.c b/keyboards/ai03/orbit/orbit.c new file mode 100644 index 00000000000..2f149875b1c --- /dev/null +++ b/keyboards/ai03/orbit/orbit.c @@ -0,0 +1,228 @@ +/* Copyright 2018 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "orbit.h" +#include "split_util.h" +#include "transport.h" + + +// Call led_toggle to set LEDs easily +// LED IDs: +// +// (LEFT) 0 1 2 | 3 4 5 (RIGHT) + +void led_toggle(int id, bool on) { + + if (isLeftHand) { + switch(id) { + case 0: + // Left hand C6 + if (on) + //PORTC |= (1<<6); + writePinHigh(C6); + else + //PORTC &= ~(1<<6); + writePinLow(C6); + break; + case 1: + // Left hand B6 + if (on) + //PORTB |= (1<<6); + writePinHigh(B6); + else + //PORTB &= ~(1<<6); + writePinLow(B6); + break; + case 2: + // Left hand B5 + if (on) + //PORTB |= (1<<5); + writePinHigh(B5); + else + //PORTB &= ~(1<<5); + writePinLow(B5); + break; + default: + break; + } + } else { + switch(id) { + case 3: + // Right hand F6 + if (on) + //PORTF |= (1<<6); + writePinHigh(F6); + else + //PORTF &= ~(1<<6); + writePinLow(F6); + break; + case 4: + // Right hand F7 + if (on) + //PORTF |= (1<<7); + writePinHigh(F7); + else + //PORTF &= ~(1<<7); + writePinLow(F7); + break; + case 5: + // Right hand C7 + if (on) + //PORTC |= (1<<7); + writePinHigh(C7); + else + //PORTC &= ~(1<<7); + writePinLow(C7); + break; + default: + break; + } + } +} + +// Set all LEDs at once using an array of 6 booleans +// LED IDs: +// +// (LEFT) 0 1 2 | 3 4 5 (RIGHT) +// +// Ex. set_all_leds({ false, false, false, true, true, true }) would turn off left hand, turn on right hand + +void set_all_leds(bool leds[6]) { + for (int i = 0; i < 6; i++) { + led_toggle(i, leds[i]); + } +} + +void set_layer_indicators(uint8_t layer) { + + switch (layer) + { + case 0: + led_toggle(0, true); + led_toggle(1, false); + led_toggle(2, false); + break; + case 1: + led_toggle(0, true); + led_toggle(1, true); + led_toggle(2, false); + break; + case 2: + led_toggle(0, true); + led_toggle(1, true); + led_toggle(2, true); + break; + case 3: + led_toggle(0, false); + led_toggle(1, true); + led_toggle(2, true); + break; + case 4: + led_toggle(0, false); + led_toggle(1, false); + led_toggle(2, true); + break; + default: + led_toggle(0, true); + led_toggle(1, false); + led_toggle(2, true); + break; + } + +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + // Initialize indicator LEDs to output + if (isLeftHand) + { + setPinOutput(C6); + setPinOutput(B6); + setPinOutput(B5); + //DDRC |= (1<<6); + //DDRB |= (1<<6); + //DDRB |= (1<<5); + } + else + { + setPinOutput(F6); + setPinOutput(F7); + setPinOutput(C7); + //DDRF |= (1<<6); + //DDRF |= (1<<7); + //DDRC |= (1<<7); + } + + set_layer_indicators(0); + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (is_keyboard_master()) { + + serial_m2s_buffer.nlock_led = IS_LED_ON(usb_led, USB_LED_NUM_LOCK); + serial_m2s_buffer.clock_led = IS_LED_ON(usb_led, USB_LED_CAPS_LOCK); + serial_m2s_buffer.slock_led = IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK); + + led_toggle(3, IS_LED_ON(usb_led, USB_LED_NUM_LOCK)); + led_toggle(4, IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)); + led_toggle(5, IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)); + + } + + led_set_user(usb_led); +} + +uint32_t layer_state_set_kb(uint32_t state) { + + if (is_keyboard_master()) + { + + current_layer = biton32(state); + serial_m2s_buffer.current_layer = biton32(state); + + // If left half, do the LED toggle thing + if (isLeftHand) + { + set_layer_indicators(biton32(state)); + } + + } + // NOTE: Do not set slave LEDs here. + // This is not called on slave + + return layer_state_set_user(state); +} + + diff --git a/keyboards/ai03/orbit/orbit.h b/keyboards/ai03/orbit/orbit.h new file mode 100644 index 00000000000..211b9ebca9e --- /dev/null +++ b/keyboards/ai03/orbit/orbit.h @@ -0,0 +1,65 @@ +/* Copyright 2018 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef ORBIT_H +#define ORBIT_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45 \ +) \ +{ \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { KC_NO, L41, L42, L43, L44, L45, L46 }, \ + { R00, R01, R02, R03, R04, R05, R06 }, \ + { R10, R11, R12, R13, R14, R15, R16 }, \ + { R20, R21, R22, R23, R24, R25, R26 }, \ + { R30, R31, R32, R33, R34, R35, R36 }, \ + { R40, R41, R42, R43, R44, R45, KC_NO } \ +} + +uint8_t current_layer; + +extern void led_toggle(int id, bool on); +void set_all_leds(bool leds[6]); +extern void set_layer_indicators(uint8_t layer); + +#endif diff --git a/keyboards/ai03/orbit/readme.md b/keyboards/ai03/orbit/readme.md new file mode 100644 index 00000000000..58ba2079d5d --- /dev/null +++ b/keyboards/ai03/orbit/readme.md @@ -0,0 +1,15 @@ +# Orbit + +![Orbit](https://raw.githubusercontent.com/ai03-2725/Orbit/master/Images/PCB-R2.0.jpg) + +A split ergonomic keyboard project. + +Keyboard Maintainer: [ai03](https://github.com/ai03-2725) +Hardware Supported: The [Orbit PCB](https://github.com/ai03-2725/Orbit) +Hardware Availability: [This repository](https://github.com/ai03-2725/Orbit) has PCB files. Case group buy orders are currently closed. + +Make example for this keyboard (after setting up your build environment): + + make ai03/orbit:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ai03/orbit/rules.mk b/keyboards/ai03/orbit/rules.mk new file mode 100644 index 00000000000..e225ad037cf --- /dev/null +++ b/keyboards/ai03/orbit/rules.mk @@ -0,0 +1,91 @@ +SRC += split_util.c \ + split_flags.c \ + serial.c \ + transport.c \ + matrix.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +USE_I2C = no # I2C for split communication +CUSTOM_MATRIX = yes # For providing custom matrix.c (in this case, override regular matrix.c with split matrix.c) +# SPLIT_KEYBOARD = yes # Split keyboard flag disabled as manual edits had to be done to the split common files + + diff --git a/keyboards/ai03/orbit/serial.c b/keyboards/ai03/orbit/serial.c new file mode 100644 index 00000000000..1315377a345 --- /dev/null +++ b/keyboards/ai03/orbit/serial.c @@ -0,0 +1,546 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include +#include "serial.h" +//#include + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_AVR_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps (Experimental only) +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static void serial_delay(void) ALWAYS_INLINE; +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; + } + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) +// 2018-12-17 copy to TOP/quantum/split_common/ and remove backward compatibility code (#4669) diff --git a/keyboards/ai03/orbit/serial.h b/keyboards/ai03/orbit/serial.h new file mode 100644 index 00000000000..1c1e640069c --- /dev/null +++ b/keyboards/ai03/orbit/serial.h @@ -0,0 +1,62 @@ +#pragma once + +#include + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE simple API (using signle-type transaction function) +// /* nothing */ +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif diff --git a/quantum/split_common/split_flags.c b/keyboards/ai03/orbit/split_flags.c similarity index 100% rename from quantum/split_common/split_flags.c rename to keyboards/ai03/orbit/split_flags.c diff --git a/keyboards/ai03/orbit/split_flags.h b/keyboards/ai03/orbit/split_flags.h new file mode 100644 index 00000000000..aaac474a7db --- /dev/null +++ b/keyboards/ai03/orbit/split_flags.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include + +/** +* Global Flags +**/ + +//RGB Stuff +extern volatile bool RGB_DIRTY; + + +//Backlight Stuff +extern volatile bool BACKLIT_DIRTY; diff --git a/keyboards/ai03/orbit/split_util.c b/keyboards/ai03/orbit/split_util.c new file mode 100644 index 00000000000..5095cb8fdce --- /dev/null +++ b/keyboards/ai03/orbit/split_util.c @@ -0,0 +1,87 @@ +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" +#include "timer.h" +#include "split_flags.h" +#include "transport.h" +#include "quantum.h" + +#ifdef EE_HANDS +# include "tmk_core/common/eeprom.h" +# include "eeconfig.h" +#endif + +volatile bool isLeftHand = true; + +__attribute__((weak)) +bool is_keyboard_left(void) { + #ifdef SPLIT_HAND_PIN + // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand + setPinInput(SPLIT_HAND_PIN); + return readPin(SPLIT_HAND_PIN); + #else + #ifdef EE_HANDS + return eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + #ifdef MASTER_RIGHT + return !is_keyboard_master(); + #else + return is_keyboard_master(); + #endif + #endif + #endif +} + +bool is_keyboard_master(void) +{ +#ifdef __AVR__ + static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; + + // only check once, as this is called often + if (usbstate == UNKNOWN) + { + USBCON |= (1 << OTGPADE); // enables VBUS pad + wait_us(5); + + usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS + } + + return (usbstate == MASTER); +#else + return true; +#endif +} + +static void keyboard_master_setup(void) { +#if defined(USE_I2C) || defined(EH) + #ifdef SSD1306OLED + matrix_master_OLED_init (); + #endif +#endif + transport_master_init(); + + // For master the Backlight info needs to be sent on startup + // Otherwise the salve won't start with the proper info until an update + BACKLIT_DIRTY = true; +} + +static void keyboard_slave_setup(void) +{ + transport_slave_init(); +} + +// this code runs before the usb and keyboard is initialized +void matrix_setup(void) +{ + isLeftHand = is_keyboard_left(); + + if (is_keyboard_master()) + { + keyboard_master_setup(); + } + else + { + keyboard_slave_setup(); + } +} diff --git a/keyboards/ai03/orbit/split_util.h b/keyboards/ai03/orbit/split_util.h new file mode 100644 index 00000000000..20f7535bf44 --- /dev/null +++ b/keyboards/ai03/orbit/split_util.h @@ -0,0 +1,10 @@ +#pragma once + +#include +#include +#include +#include + +extern volatile bool isLeftHand; + +void matrix_master_OLED_init (void); diff --git a/keyboards/ai03/orbit/transport.c b/keyboards/ai03/orbit/transport.c new file mode 100644 index 00000000000..adedf243220 --- /dev/null +++ b/keyboards/ai03/orbit/transport.c @@ -0,0 +1,238 @@ + +#include "transport.h" + +#include "config.h" +#include "matrix.h" +#include "quantum.h" + +#include "orbit.h" + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +#ifdef RGBLIGHT_ENABLE +# include "rgblight.h" +#endif + +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" + extern backlight_config_t backlight_config; +#endif + +#if defined(USE_I2C) || defined(EH) + +#include "i2c.h" + +#ifndef SLAVE_I2C_ADDRESS +# define SLAVE_I2C_ADDRESS 0x32 +#endif + +#if (MATRIX_COLS > 8) +# error "Currently only supports 8 COLS" +#endif + +// Get rows from other half over i2c +bool transport_master(matrix_row_t matrix[]) { + int err = 0; + + // write backlight info +#ifdef BACKLIGHT_ENABLE + if (BACKLIT_DIRTY) { + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) { goto i2c_error; } + + // Backlight location + err = i2c_master_write(I2C_BACKLIT_START); + if (err) { goto i2c_error; } + + // Write backlight + i2c_master_write(get_backlight_level()); + + BACKLIT_DIRTY = false; + } +#endif + + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) { goto i2c_error; } + + // start of matrix stored at I2C_KEYMAP_START + err = i2c_master_write(I2C_KEYMAP_START); + if (err) { goto i2c_error; } + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) { goto i2c_error; } + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[i] = i2c_master_read(I2C_ACK); + } + matrix[i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return false; + } + +#ifdef RGBLIGHT_ENABLE + if (RGB_DIRTY) { + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) { goto i2c_error; } + + // RGB Location + err = i2c_master_write(I2C_RGB_START); + if (err) { goto i2c_error; } + + uint32_t dword = eeconfig_read_rgblight(); + + // Write RGB + err = i2c_master_write_data(&dword, 4); + if (err) { goto i2c_error; } + + RGB_DIRTY = false; + i2c_master_stop(); + } +#endif + + return true; +} + +void transport_slave(matrix_row_t matrix[]) { + + for (int i = 0; i < ROWS_PER_HAND; ++i) + { + i2c_slave_buffer[I2C_KEYMAP_START + i] = matrix[i]; + } + // Read Backlight Info + #ifdef BACKLIGHT_ENABLE + if (BACKLIT_DIRTY) + { + backlight_set(i2c_slave_buffer[I2C_BACKLIT_START]); + BACKLIT_DIRTY = false; + } + #endif + #ifdef RGBLIGHT_ENABLE + if (RGB_DIRTY) + { + // Disable interupts (RGB data is big) + cli(); + // Create new DWORD for RGB data + uint32_t dword; + + // Fill the new DWORD with the data that was sent over + uint8_t * dword_dat = (uint8_t *)(&dword); + for (int i = 0; i < 4; i++) + { + dword_dat[i] = i2c_slave_buffer[I2C_RGB_START + i]; + } + + // Update the RGB now with the new data and set RGB_DIRTY to false + rgblight_update_dword(dword); + RGB_DIRTY = false; + // Re-enable interupts now that RGB is set + sei(); + } + #endif +} + +void transport_master_init(void) { + i2c_master_init(); +} + +void transport_slave_init(void) { + i2c_slave_init(SLAVE_I2C_ADDRESS); +} + +#else // USE_SERIAL + +#include "serial.h" + + + +volatile Serial_s2m_buffer_t serial_s2m_buffer = {}; +volatile Serial_m2s_buffer_t serial_m2s_buffer = {}; +uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + sizeof(serial_m2s_buffer), (uint8_t *)&serial_m2s_buffer, + sizeof(serial_s2m_buffer), (uint8_t *)&serial_s2m_buffer + } +}; + +uint8_t slave_layer_cache; +uint8_t slave_nlock_cache; +uint8_t slave_clock_cache; +uint8_t slave_slock_cache; + +void transport_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void transport_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); + slave_layer_cache = 255; + slave_nlock_cache = 255; + slave_clock_cache = 255; + slave_slock_cache = 255; +} + +bool transport_master(matrix_row_t matrix[]) { + + if (soft_serial_transaction()) { + return false; + } + + // TODO: if MATRIX_COLS > 8 change to unpack() + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[i] = serial_s2m_buffer.smatrix[i]; + } + + #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + // Code to send RGB over serial goes here (not implemented yet) + #endif + + #ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0; + #endif + + return true; +} + +void transport_slave(matrix_row_t matrix[]) { + + // TODO: if MATRIX_COLS > 8 change to pack() + for (int i = 0; i < ROWS_PER_HAND; ++i) + { + serial_s2m_buffer.smatrix[i] = matrix[i]; + } + #ifdef BACKLIGHT_ENABLE + backlight_set(serial_m2s_buffer.backlight_level); + #endif + #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + // Add serial implementation for RGB here + #endif + + if (slave_layer_cache != serial_m2s_buffer.current_layer) { + slave_layer_cache = serial_m2s_buffer.current_layer; + set_layer_indicators(slave_layer_cache); + } + + if (slave_nlock_cache != serial_m2s_buffer.nlock_led) { + slave_nlock_cache = serial_m2s_buffer.nlock_led; + led_toggle(3, slave_nlock_cache); + } + if (slave_clock_cache != serial_m2s_buffer.clock_led) { + slave_clock_cache = serial_m2s_buffer.clock_led; + led_toggle(4, slave_clock_cache); + } + if (slave_slock_cache != serial_m2s_buffer.slock_led) { + slave_slock_cache = serial_m2s_buffer.slock_led; + led_toggle(5, slave_slock_cache); + } + +} + +#endif diff --git a/keyboards/ai03/orbit/transport.h b/keyboards/ai03/orbit/transport.h new file mode 100644 index 00000000000..422e2ecb990 --- /dev/null +++ b/keyboards/ai03/orbit/transport.h @@ -0,0 +1,42 @@ +#pragma once + +#include + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +typedef struct _Serial_s2m_buffer_t { + // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack + matrix_row_t smatrix[ROWS_PER_HAND]; +} Serial_s2m_buffer_t; + +typedef struct _Serial_m2s_buffer_t { +#ifdef BACKLIGHT_ENABLE + uint8_t backlight_level; +#endif +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + rgblight_config_t rgblight_config; //not yet use + // + // When MCUs on both sides drive their respective RGB LED chains, + // it is necessary to synchronize, so it is necessary to communicate RGB information. + // In that case, define the RGBLIGHT_SPLIT macro. + // + // Otherwise, if the master side MCU drives both sides RGB LED chains, + // there is no need to communicate. +#endif + + uint8_t current_layer; + uint8_t nlock_led; + uint8_t clock_led; + uint8_t slock_led; + +} Serial_m2s_buffer_t; + +extern volatile Serial_s2m_buffer_t serial_s2m_buffer; +extern volatile Serial_m2s_buffer_t serial_m2s_buffer; + +void transport_master_init(void); +void transport_slave_init(void); + +// returns false if valid data not received from slave +bool transport_master(matrix_row_t matrix[]); +void transport_slave(matrix_row_t matrix[]); diff --git a/keyboards/ai03/quasar/config.h b/keyboards/ai03/quasar/config.h new file mode 100644 index 00000000000..7c02f91d042 --- /dev/null +++ b/keyboards/ai03/quasar/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 Ryota Goto + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xA103 +#define PRODUCT_ID 0x0010 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Ryota Goto +#define PRODUCT Quasar +#define DESCRIPTION SSK Controller + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5, D4, D6, D7 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, B7, F0, F1, F4, F5, F6, F7, C7, C6, B6, B5, B4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/ai03/quasar/info.json b/keyboards/ai03/quasar/info.json new file mode 100644 index 00000000000..20637af55f5 --- /dev/null +++ b/keyboards/ai03/quasar/info.json @@ -0,0 +1,97 @@ +{ + "keyboard_name": "quasar", + "url": "https://github.com/ai03-2725/Quasar/", + "maintainer": "ai03", + "width": 18.5, + "height": 6.75, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.5, "y":0}, + {"label":"Scroll Lock", "x":16.5, "y":0}, + {"label":"Pause", "x":17.5, "y":0}, + {"label":"~", "x":0, "y":1.75}, + {"label":"!", "x":1, "y":1.75}, + {"label":"@", "x":2, "y":1.75}, + {"label":"#", "x":3, "y":1.75}, + {"label":"$", "x":4, "y":1.75}, + {"label":"%", "x":5, "y":1.75}, + {"label":"^", "x":6, "y":1.75}, + {"label":"&", "x":7, "y":1.75}, + {"label":"*", "x":8, "y":1.75}, + {"label":"(", "x":9, "y":1.75}, + {"label":")", "x":10, "y":1.75}, + {"label":"_", "x":11, "y":1.75}, + {"label":"+", "x":12, "y":1.75}, + {"label":"Backspace", "x":13, "y":1.75, "w":2}, + {"label":"Insert", "x":15.5, "y":1.75}, + {"label":"Home", "x":16.5, "y":1.75}, + {"label":"PgUp", "x":17.5, "y":1.75}, + {"label":"Tab", "x":0, "y":2.75, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.75}, + {"label":"W", "x":2.5, "y":2.75}, + {"label":"E", "x":3.5, "y":2.75}, + {"label":"R", "x":4.5, "y":2.75}, + {"label":"T", "x":5.5, "y":2.75}, + {"label":"Y", "x":6.5, "y":2.75}, + {"label":"U", "x":7.5, "y":2.75}, + {"label":"I", "x":8.5, "y":2.75}, + {"label":"O", "x":9.5, "y":2.75}, + {"label":"P", "x":10.5, "y":2.75}, + {"label":"{", "x":11.5, "y":2.75}, + {"label":"}", "x":12.5, "y":2.75}, + {"label":"|", "x":13.5, "y":2.75, "w":1.5}, + {"label":"Delete", "x":15.5, "y":2.75}, + {"label":"End", "x":16.5, "y":2.75}, + {"label":"PgDn", "x":17.5, "y":2.75}, + {"label":"Caps Lock", "x":0, "y":3.75, "w":1.25}, + {"label":"A", "x":1.75, "y":3.75}, + {"label":"S", "x":2.75, "y":3.75}, + {"label":"D", "x":3.75, "y":3.75}, + {"label":"F", "x":4.75, "y":3.75}, + {"label":"G", "x":5.75, "y":3.75}, + {"label":"H", "x":6.75, "y":3.75}, + {"label":"J", "x":7.75, "y":3.75}, + {"label":"K", "x":8.75, "y":3.75}, + {"label":"L", "x":9.75, "y":3.75}, + {"label":":", "x":10.75, "y":3.75}, + {"label":"\"", "x":11.75, "y":3.75}, + {"label":"Enter", "x":12.75, "y":3.75, "w":2.25}, + {"label":"Shift", "x":0, "y":4.75, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.75}, + {"label":"X", "x":3.25, "y":4.75}, + {"label":"C", "x":4.25, "y":4.75}, + {"label":"V", "x":5.25, "y":4.75}, + {"label":"B", "x":6.25, "y":4.75}, + {"label":"N", "x":7.25, "y":4.75}, + {"label":"M", "x":8.25, "y":4.75}, + {"label":"<", "x":9.25, "y":4.75}, + {"label":">", "x":10.25, "y":4.75}, + {"label":"?", "x":11.25, "y":4.75}, + {"label":"Shift", "x":12.25, "y":4.75, "w":2.75}, + {"label":"\u2191", "x":16.5, "y":4.75}, + {"label":"Ctrl", "x":0, "y":5.75, "w":1.5}, + {"label":"Alt", "x":2.5, "y":5.75, "w":1.5}, + {"x":4, "y":5.75, "w":7}, + {"label":"Alt", "x":11, "y":5.75, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":5.75, "w":1.5}, + {"label":"\u2190", "x":15.5, "y":5.75}, + {"label":"\u2193", "x":16.5, "y":5.75}, + {"label":"\u2192", "x":17.5, "y":5.75} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/ai03/quasar/keymaps/ai03/keymap.c b/keyboards/ai03/quasar/keymaps/ai03/keymap.c new file mode 100644 index 00000000000..e2dca55cd17 --- /dev/null +++ b/keyboards/ai03/quasar/keymaps/ai03/keymap.c @@ -0,0 +1,61 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + +/* + * K702, K503, K504, K604, K704, K706, K708, K609, K509, K506, K406, K411, K412, K415, K315, K114, \ + * K502, K402, K403, K404, K405, K505, K507, K407, K408, K409, K410, K510, K508, K606, K512, K514, K513, \ + * K602, K302, K303, K304, K305, K605, K607, K307, K308, K309, K310, K610, K608, K206, K511, K414, K413, \ + * K603, K202, K203, K204, K205, K705, K707, K207, K208, K209, K210, K710, K106, \ + * K601, K102, K103, K104, K105, K005, K007, K107, K108, K109, K010, K101, K714, \ + * K500, K715, K006, K015, K100, K014, K011, K012 \ + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_LGUI, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_GRV, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT( /* FN */ + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, _______, _______, + KC_CAPS, _______, KC_UP, _______, _______, _______, _______, _______, KC_PGUP, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_VOLU, KC_VOLD, KC_HOME, KC_PGDN, KC_END, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_PGUP, + _______, _______, _______, _______, KC_BSPC, KC_HOME, KC_PGDN, KC_END + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/ai03/quasar/keymaps/ai03/readme.md b/keyboards/ai03/quasar/keymaps/ai03/readme.md new file mode 100644 index 00000000000..6f6a0b4fef5 --- /dev/null +++ b/keyboards/ai03/quasar/keymaps/ai03/readme.md @@ -0,0 +1,3 @@ +# The ai03 keymap for Quasar + +Focuses functionality mainly into the 60% cluster. \ No newline at end of file diff --git a/keyboards/ai03/quasar/keymaps/default/keymap.c b/keyboards/ai03/quasar/keymaps/default/keymap.c new file mode 100644 index 00000000000..6de45951a3d --- /dev/null +++ b/keyboards/ai03/quasar/keymaps/default/keymap.c @@ -0,0 +1,61 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + +/* + * K702, K503, K504, K604, K704, K706, K708, K609, K509, K506, K406, K411, K412, K415, K315, K114, \ + * K502, K402, K403, K404, K405, K505, K507, K407, K408, K409, K410, K510, K508, K606, K512, K514, K513, \ + * K602, K302, K303, K304, K305, K605, K607, K307, K308, K309, K310, K610, K608, K206, K511, K414, K413, \ + * K603, K202, K203, K204, K205, K705, K707, K207, K208, K209, K210, K710, K106, \ + * K601, K102, K103, K104, K105, K005, K007, K107, K108, K109, K010, K101, K714, \ + * K500, K715, K006, K015, K100, K014, K011, K012 \ + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT( /* FN */ + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/ai03/quasar/keymaps/default/readme.md b/keyboards/ai03/quasar/keymaps/default/readme.md new file mode 100644 index 00000000000..bcfeda1ad1b --- /dev/null +++ b/keyboards/ai03/quasar/keymaps/default/readme.md @@ -0,0 +1,4 @@ +# The default keymap for Quasar + +Caps lock behaves as Fn/Layer. Press caps+esc for reset, caps+tab for caps lock. +The rest is basic WKL TKL. \ No newline at end of file diff --git a/keyboards/ai03/quasar/quasar.c b/keyboards/ai03/quasar/quasar.c new file mode 100644 index 00000000000..ac8b7517719 --- /dev/null +++ b/keyboards/ai03/quasar/quasar.c @@ -0,0 +1,51 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "quasar.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/ai03/quasar/quasar.h b/keyboards/ai03/quasar/quasar.h new file mode 100644 index 00000000000..4125f81b5a4 --- /dev/null +++ b/keyboards/ai03/quasar/quasar.h @@ -0,0 +1,45 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K702, K503, K504, K604, K704, K706, K708, K609, K509, K506, K406, K411, K412, K415, K315, K114, \ + K502, K402, K403, K404, K405, K505, K507, K407, K408, K409, K410, K510, K508, K606, K512, K514, K513, \ + K602, K302, K303, K304, K305, K605, K607, K307, K308, K309, K310, K610, K608, K206, K511, K414, K413, \ + K603, K202, K203, K204, K205, K705, K707, K207, K208, K209, K210, K710, K106, \ + K601, K102, K103, K104, K105, K005, K007, K107, K108, K109, K010, K101, K714, \ + K500, K715, K006, K015, K100, K014, K011, K012 \ +) \ +{ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K005, K006, K007, KC_NO, KC_NO, K010, K011, K012, KC_NO, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, KC_NO, KC_NO, KC_NO, KC_NO, K114, KC_NO }, \ + { KC_NO, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, K302, K303, K304, K305, KC_NO, K307, K308, K309, K310, KC_NO, KC_NO, KC_NO, KC_NO, K315 }, \ + { KC_NO, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K415 }, \ + { K500, KC_NO, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, KC_NO }, \ + { KC_NO, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, K702, KC_NO, K704, K705, K706, K707, K708, KC_NO, K710, KC_NO, KC_NO, KC_NO, K714, K715 } \ +} diff --git a/keyboards/ai03/quasar/readme.md b/keyboards/ai03/quasar/readme.md new file mode 100644 index 00000000000..e0ea30ac9c7 --- /dev/null +++ b/keyboards/ai03/quasar/readme.md @@ -0,0 +1,15 @@ +# Quasar + +![Quasar](https://i.imgur.com/XIbX2Pw.jpg) + +Replacement controller for the IBM Model M Space Saving keyboard + +Keyboard Maintainer: [ai03](https://github.com/ai03-2725) +Hardware Supported: The Quasar PCB +Hardware Availability: [Source available on GitHub](https://github.com/ai03-2725/Quasar/) + +Make example for this keyboard (after setting up your build environment): + + make ai03/quasar:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ai03/quasar/rules.mk b/keyboards/ai03/quasar/rules.mk new file mode 100644 index 00000000000..afbd1de1479 --- /dev/null +++ b/keyboards/ai03/quasar/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/ai03/soyuz/config.h b/keyboards/ai03/soyuz/config.h new file mode 100644 index 00000000000..299e5999d60 --- /dev/null +++ b/keyboards/ai03/soyuz/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 Ryota Goto + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xA103 +#define PRODUCT_ID 0x0004 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ai03 Design Studio +#define PRODUCT Soyuz +#define DESCRIPTION Single-PCB Numpad Kit + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, B6, E6, B4 } +#define MATRIX_COL_PINS { F4, B3, D7, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/ai03/soyuz/info.json b/keyboards/ai03/soyuz/info.json new file mode 100644 index 00000000000..e4f8eb0aa4a --- /dev/null +++ b/keyboards/ai03/soyuz/info.json @@ -0,0 +1,33 @@ +{ + "keyboard_name": "Soyuz", + "url": "https://github.com/ai03-2725/soyuz", + "maintainer": "ai03", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x4": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":3, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2}, + {"x":3, "y":2}, + {"x":0, "y":3}, + {"x":1, "y":3}, + {"x":2, "y":3}, + {"x":3, "y":3}, + {"x":0, "y":4}, + {"x":1, "y":4}, + {"x":2, "y":4}, + {"x":3, "y":4} + ] + } + } +} diff --git a/keyboards/ai03/soyuz/keymaps/1U/keymap.c b/keyboards/ai03/soyuz/keymaps/1U/keymap.c new file mode 100644 index 00000000000..aa8683c8a44 --- /dev/null +++ b/keyboards/ai03/soyuz/keymaps/1U/keymap.c @@ -0,0 +1,57 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + DBLZERO = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_5x4( /* Base */ + KC_NLCK, KC_PSLS, KC_PAST, KC_BSPC, \ + KC_P7, KC_P8, KC_P9, KC_MINS, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, KC_EQL, \ + DBLZERO, KC_P0, KC_PDOT, KC_PENT \ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DBLZERO: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("00"); + } else { + // when keycode QMKBEST is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/ai03/soyuz/keymaps/1U/readme.md b/keyboards/ai03/soyuz/keymaps/1U/readme.md new file mode 100644 index 00000000000..f030f8c68dd --- /dev/null +++ b/keyboards/ai03/soyuz/keymaps/1U/readme.md @@ -0,0 +1,3 @@ +# The 1U keymap for Soyuz + +A keymap that uses 1U keys everywhere for a 20-key numpad. \ No newline at end of file diff --git a/keyboards/ai03/soyuz/keymaps/default/keymap.c b/keyboards/ai03/soyuz/keymaps/default/keymap.c new file mode 100644 index 00000000000..62bb5c228a7 --- /dev/null +++ b/keyboards/ai03/soyuz/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_5x4( /* Base */ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_P0, KC_P0, KC_PDOT, KC_PENT \ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/ai03/soyuz/keymaps/default/readme.md b/keyboards/ai03/soyuz/keymaps/default/readme.md new file mode 100644 index 00000000000..f4954e8b33b --- /dev/null +++ b/keyboards/ai03/soyuz/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default keymap for Soyuz + +A very basic keymap for a "typical" numpad layout using 2U keys wherever applicable. \ No newline at end of file diff --git a/keyboards/ai03/soyuz/readme.md b/keyboards/ai03/soyuz/readme.md new file mode 100644 index 00000000000..e88dfab43ed --- /dev/null +++ b/keyboards/ai03/soyuz/readme.md @@ -0,0 +1,15 @@ +# Soyuz + +![soyuz](https://raw.githubusercontent.com/ai03-2725/Soyuz/master/Renders/Front.png) + +A single-PCB numpad kit + +Keyboard Maintainer: [ai03](https://github.com/ai03-2725) +Hardware Supported: [Soyuz PCB](https://github.com/ai03-2725/soyuz) +Hardware Availability: Various vendors - List will be maintained in the [PCB repo](https://github.com/ai03-2725/soyuz) + +Make example for this keyboard (after setting up your build environment): + + make ai03/soyuz:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ai03/soyuz/rules.mk b/keyboards/ai03/soyuz/rules.mk new file mode 100644 index 00000000000..5df789e5818 --- /dev/null +++ b/keyboards/ai03/soyuz/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_5x4 diff --git a/keyboards/ai03/soyuz/soyuz.c b/keyboards/ai03/soyuz/soyuz.c new file mode 100644 index 00000000000..dc73f196ef5 --- /dev/null +++ b/keyboards/ai03/soyuz/soyuz.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "soyuz.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/ai03/soyuz/soyuz.h b/keyboards/ai03/soyuz/soyuz.h new file mode 100644 index 00000000000..a379f8ede66 --- /dev/null +++ b/keyboards/ai03/soyuz/soyuz.h @@ -0,0 +1,41 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT_ortho_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33, \ + K40, K41, K42, K43 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 } \ +} diff --git a/keyboards/akb/eb46/config.h b/keyboards/akb/eb46/config.h new file mode 100644 index 00000000000..965f769ccfc --- /dev/null +++ b/keyboards/akb/eb46/config.h @@ -0,0 +1,52 @@ +/* +Copyright 2019 Elliot Powell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4646 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Elliot Powell +#define PRODUCT eb46 +#define DESCRIPTION eb46 running qmk +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS \ + { B5, B4, D7, B6 } +#define MATRIX_COL_PINS \ + { B0, B1, B2, B3, B7, D0, D1, D2, D3, D5, D4, D6, C6 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 diff --git a/keyboards/akb/eb46/eb46.c b/keyboards/akb/eb46/eb46.c new file mode 100644 index 00000000000..3417b4329a3 --- /dev/null +++ b/keyboards/akb/eb46/eb46.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "eb46.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/akb/eb46/eb46.h b/keyboards/akb/eb46/eb46.h new file mode 100644 index 00000000000..8dd5290b8db --- /dev/null +++ b/keyboards/akb/eb46/eb46.h @@ -0,0 +1,40 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define xxx KC_NO + +#define LAYOUT(\ + k000, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b,\ + k100, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, \ + k200, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, \ + k300, k30, k31, k32, k33, k36, k38, k39, k3a \ +) \ +{ \ + {k000, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b},\ + {k100, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, xxx},\ + {k200, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, xxx},\ + {k300, k30, k31, k32, k33, xxx, xxx, k36, xxx, k38, k39, k3a, xxx} \ +} diff --git a/keyboards/akb/eb46/info.json b/keyboards/akb/eb46/info.json new file mode 100644 index 00000000000..5513df39714 --- /dev/null +++ b/keyboards/akb/eb46/info.json @@ -0,0 +1,58 @@ +{ + "keyboard_name": "eb46", + "maintainer": "e11i0t23", + "width": 13.25, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "F1", "x": 0, "y": 0 }, + { "label": "Esc", "x": 1.25, "y": 0 }, + { "label": "Q", "x": 2.25, "y": 0 }, + { "label": "W", "x": 3.25, "y": 0 }, + { "label": "E", "x": 4.25, "y": 0 }, + { "label": "R", "x": 5.25, "y": 0 }, + { "label": "T", "x": 6.25, "y": 0 }, + { "label": "Y", "x": 7.25, "y": 0 }, + { "label": "U", "x": 8.25, "y": 0 }, + { "label": "I", "x": 9.25, "y": 0 }, + { "label": "O", "x": 10.25, "y": 0 }, + { "label": "P", "x": 11.25, "y": 0 }, + { "label": "BackSpace", "x": 12.25, "y": 0 }, + { "label": "F2", "x": 0, "y": 1 }, + { "label": "Tab", "x": 1.25, "y": 1, "w": 1.25 }, + { "label": "A", "x": 2.5, "y": 1 }, + { "label": "S", "x": 3.5, "y": 1 }, + { "label": "D", "x": 4.5, "y": 1 }, + { "label": "F", "x": 5.5, "y": 1 }, + { "label": "G", "x": 6.5, "y": 1 }, + { "label": "H", "x": 7.5, "y": 1 }, + { "label": "J", "x": 8.5, "y": 1 }, + { "label": "K", "x": 9.5, "y": 1 }, + { "label": "L", "x": 10.5, "y": 1 }, + { "label": "Enter", "x": 11.5, "y": 1, "w": 1.75 }, + { "label": "F3", "x": 0, "y": 2 }, + { "label": "Shift", "x": 1.25, "y": 2, "w": 1.75 }, + { "label": "Z", "x": 3, "y": 2 }, + { "label": "X", "x": 4, "y": 2 }, + { "label": "C", "x": 5, "y": 2 }, + { "label": "V", "x": 6, "y": 2 }, + { "label": "B", "x": 7, "y": 2 }, + { "label": "N", "x": 8, "y": 2 }, + { "label": "M", "x": 9, "y": 2 }, + { "label": "<", "x": 10, "y": 2 }, + { "label": ">", "x": 11, "y": 2 }, + { "label": "RShift", "x": 12, "y": 2, "w": 1.25 }, + { "label": "F4", "x": 0, "y": 3 }, + { "label": "Ctrl", "x": 1.25, "y": 3, "w": 1.25 }, + { "label": "Win", "x": 2.5, "y": 3 }, + { "label": "Alt", "x": 3.5, "y": 3, "w": 1.25 }, + { "label": "FN0", "x": 4.75, "y": 3, "w": 2.25 }, + { "label": "Space", "x": 7, "y": 3, "w": 2.75 }, + { "label": "Menu", "x": 9.75, "y": 3 }, + { "label": "RAlt", "x": 10.75, "y": 3, "w": 1.25 }, + { "label": "Super", "x": 12.25, "y": 3 } + ] + } + } +} diff --git a/keyboards/akb/eb46/keymaps/default/keymap.c b/keyboards/akb/eb46/keymaps/default/keymap.c new file mode 100644 index 00000000000..c2114cc65d4 --- /dev/null +++ b/keyboards/akb/eb46/keymaps/default/keymap.c @@ -0,0 +1,34 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_F5, KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_PGUP, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + KC_PGDN, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, + KC_ESC, LCTL_T(KC_LBRC), KC_LGUI, KC_LALT, KC_SPC, LT(1, KC_SPC), KC_RALT, MO(2), RCTL_T(KC_RBRC) ), + [1] = LAYOUT( /* Base */ + _______, _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, _______, + _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + [2] = LAYOUT( /* Base */ + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, KC_QUOT, KC_NUHS, _______, + _______, _______, KC_NUBS, _______, _______, _______, _______, _______, _______, KC_SLSH, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, RESET ), +}; diff --git a/keyboards/akb/eb46/readme.md b/keyboards/akb/eb46/readme.md new file mode 100644 index 00000000000..e7d10462236 --- /dev/null +++ b/keyboards/akb/eb46/readme.md @@ -0,0 +1,13 @@ +# eb46 + +EB46: A 40% plus macro keys + +Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23), [/u/e11i0t23 on reddit](https://reddit.com/u/e11i0t23) +Hardware Supported: EB46 PCB +Hardware Availability: Coming Soon + +Make example for this keyboard (after setting up your build environment): + + make akb/eb46:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/akb/eb46/rules.mk b/keyboards/akb/eb46/rules.mk new file mode 100644 index 00000000000..195c9e50236 --- /dev/null +++ b/keyboards/akb/eb46/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/akb/raine/config.h b/keyboards/akb/raine/config.h new file mode 100644 index 00000000000..f5a8b84b6ca --- /dev/null +++ b/keyboards/akb/raine/config.h @@ -0,0 +1,52 @@ +/* +Copyright 2019 Elliot Powell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER AKB +#define PRODUCT Raine +#define DESCRIPTION Raine + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* key matrix pins */ +#define MATRIX_ROW_PINS \ + { E6, C6, F7, B2, B0 } +#define MATRIX_COL_PINS \ + { F6, F5, F4, B1, F1, F0, B3, B7, D0, D1, D2, D3, D5, D4, D6, D7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/akb/raine/info.json b/keyboards/akb/raine/info.json new file mode 100644 index 00000000000..fc699e4774a --- /dev/null +++ b/keyboards/akb/raine/info.json @@ -0,0 +1,86 @@ +{ + "keyboard_name": "raine", + "maintainer": "e11i0t23", + "width": 16.25, + "height": 5.25, + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "Esc", "x": 0, "y": 0 }, + { "label": "1", "x": 1, "y": 0 }, + { "label": "2", "x": 2, "y": 0 }, + { "label": "3", "x": 3, "y": 0 }, + { "label": "4", "x": 4, "y": 0 }, + { "label": "5", "x": 5, "y": 0 }, + { "label": "6", "x": 6, "y": 0 }, + { "label": "7", "x": 7, "y": 0 }, + { "label": "8", "x": 8, "y": 0 }, + { "label": "9", "x": 9, "y": 0 }, + { "label": "0", "x": 10, "y": 0 }, + { "label": "_", "x": 11, "y": 0 }, + { "label": "BSP", "x": 12, "y": 0 }, + { "label": "Num Lock", "x": 13.25, "y": 0 }, + { "label": "Scroll Lock", "x": 14.25, "y": 0 }, + { "label": "Insert", "x": 15.25, "y": 0 }, + { "label": "Tab", "x": 0, "y": 1, "w": 1.5 }, + { "label": "Q", "x": 1.5, "y": 1 }, + { "label": "W", "x": 2.5, "y": 1 }, + { "label": "E", "x": 3.5, "y": 1 }, + { "label": "R", "x": 4.5, "y": 1 }, + { "label": "T", "x": 5.5, "y": 1 }, + { "label": "Y", "x": 6.5, "y": 1 }, + { "label": "U", "x": 7.5, "y": 1 }, + { "label": "I", "x": 8.5, "y": 1 }, + { "label": "O", "x": 9.5, "y": 1 }, + { "label": "P", "x": 10.5, "y": 1 }, + { "label": "|", "x": 11.5, "y": 1, "w": 1.5 }, + { "label": "7", "x": 13.25, "y": 1 }, + { "label": "8", "x": 14.25, "y": 1 }, + { "label": "9", "x": 15.25, "y": 1 }, + { "label": "Caps", "x": 0, "y": 2, "w": 1.75 }, + { "label": "A", "x": 1.75, "y": 2 }, + { "label": "S", "x": 2.75, "y": 2 }, + { "label": "D", "x": 3.75, "y": 2 }, + { "label": "F", "x": 4.75, "y": 2 }, + { "label": "G", "x": 5.75, "y": 2 }, + { "label": "H", "x": 6.75, "y": 2 }, + { "label": "J", "x": 7.75, "y": 2 }, + { "label": "K", "x": 8.75, "y": 2 }, + { "label": "L", "x": 9.75, "y": 2 }, + { "label": "~", "x": 10.75, "y": 2 }, + { "label": "ENTER", "x": 11.75, "y": 2, "w": 1.25 }, + { "label": "4", "x": 13.25, "y": 2 }, + { "label": "5", "x": 14.25, "y": 2 }, + { "label": "6", "x": 15.25, "y": 2 }, + { "label": "Shift", "x": 0, "y": 3, "w": 1.25 }, + { "label": "|", "x": 1.25, "y": 3 }, + { "label": "Z", "x": 2.25, "y": 3 }, + { "label": "X", "x": 3.25, "y": 3 }, + { "label": "C", "x": 4.25, "y": 3 }, + { "label": "V", "x": 5.25, "y": 3 }, + { "label": "B", "x": 6.25, "y": 3 }, + { "label": "N", "x": 7.25, "y": 3 }, + { "label": "M", "x": 8.25, "y": 3 }, + { "label": "?", "x": 9.25, "y": 3 }, + { "label": "Shift", "x": 10.25, "y": 3, "w": 1.5 }, + { "x": 12, "y": 3.25 }, + { "label": "1", "x": 13.25, "y": 3 }, + { "label": "2", "x": 14.25, "y": 3 }, + { "label": "3", "x": 15.25, "y": 3 }, + { "label": "Ctrl", "x": 0, "y": 4, "w": 1.25 }, + { "label": "Win", "x": 1.25, "y": 4}, + { "label": "Alt", "x": 2.25, "y": 4, "w": 1.25 }, + { "label": "SPLEFT", "x": 3.5, "y": 4, "w": 2.25 }, + { "label": "7U", "x": 5.75, "y": 4 }, + { "label": "SPRIGHT", "x": 6.75, "y": 4, "w": 1.75 }, + { "label": "alt", "x": 8.5, "y": 4}, + { "label": "Menu", "x": 9.5, "y": 4, "w": 1.25 }, + { "x": 11, "y": 4.25 }, + { "x": 12, "y": 4.25 }, + { "x": 13, "y": 4.25 }, + { "label": "0", "x": 14.25, "y": 4 }, + { "label": "Del", "x": 15.25, "y": 4 } + ] + } + } +} diff --git a/keyboards/akb/raine/keymaps/default/keymap.c b/keyboards/akb/raine/keymaps/default/keymap.c new file mode 100644 index 00000000000..1eecbb041f1 --- /dev/null +++ b/keyboards/akb/raine/keymaps/default/keymap.c @@ -0,0 +1,32 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, KC_PSLS, KC_PAST, KC_PPLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_P7, KC_P8, KC_P9, + CTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_BSPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), + [1] = LAYOUT( /* Second */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_DEL, KC_NLCK, KC_PSCR, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, KC_HOME, KC_UP, KC_PGUP, + _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, KC_QUOT, _______, _______, KC_LEFT, KC_SLCK, KC_RGHT, + _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, _______, _______, KC_END, KC_DOWN, KC_PGDN, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET), +}; + diff --git a/keyboards/akb/raine/raine.c b/keyboards/akb/raine/raine.c new file mode 100644 index 00000000000..d73db4409bb --- /dev/null +++ b/keyboards/akb/raine/raine.c @@ -0,0 +1,18 @@ +/* +Copyright 2019 Elliot Powell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "raine.h" diff --git a/keyboards/akb/raine/raine.h b/keyboards/akb/raine/raine.h new file mode 100644 index 00000000000..ec72a605828 --- /dev/null +++ b/keyboards/akb/raine/raine.h @@ -0,0 +1,33 @@ +/* +Copyright 2019 Elliot Powell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K113, K114, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K311, K312, K313, K314, K315, \ + K400, K401, K402, K404, K405, K407, K408, K409, K410, K412, K413, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, KC_NO, K113, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K311, KC_NO, K312, K313, K314, K315 }, \ + { K400, K401, K402, KC_NO, K404, K405, KC_NO, K407, K408, K409, K410, KC_NO, K412, K413, K414, K415 } \ +} diff --git a/keyboards/akb/raine/readme.md b/keyboards/akb/raine/readme.md new file mode 100644 index 00000000000..6aa11a11fd8 --- /dev/null +++ b/keyboards/akb/raine/readme.md @@ -0,0 +1,15 @@ +# Raine-m³ + +![Raine-m³](https://i.imgur.com/da2dZh1.jpg) + +A custom board inspired by both the 1800 layout, and the compact functionality of 40% boards. + +Keyboard Maintainer: [e11i0t23](https://github.com/e11i0t23) +Hardware Supported: Official Raine-m³ PCB +Hardware Availability: Coming Soon + +Make example for this keyboard (after setting up your build environment): + + make akb/raine:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/akb/raine/rules.mk b/keyboards/akb/raine/rules.mk new file mode 100644 index 00000000000..195c9e50236 --- /dev/null +++ b/keyboards/akb/raine/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/al1/config.h b/keyboards/al1/config.h index f92ed44d3c1..f4ded4346cd 100644 --- a/keyboards/al1/config.h +++ b/keyboards/al1/config.h @@ -43,16 +43,15 @@ along with this program. If not, see . * */ -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B6 #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -102,11 +101,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/al1/keymaps/default/keymap.c b/keyboards/al1/keymaps/default/keymap.c index 5da3b5a7b2f..d571c05abb1 100644 --- a/keyboards/al1/keymaps/default/keymap.c +++ b/keyboards/al1/keymaps/default/keymap.c @@ -31,23 +31,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_TRNS, KC_RGUI, KC_RCTRL, BL_TOGG, BL_DEC, BL_INC, KC_P0, KC_PDOT ), }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/al1/keymaps/splitbs/keymap.c b/keyboards/al1/keymaps/splitbs/keymap.c index 095c9b9785d..51f35d0cfb7 100644 --- a/keyboards/al1/keymaps/splitbs/keymap.c +++ b/keyboards/al1/keymaps/splitbs/keymap.c @@ -15,26 +15,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_TRNS, KC_RGUI, KC_RCTRL, BL_TOGG, BL_DEC, BL_INC, KC_P0, KC_PDOT ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/al1/matrix.c b/keyboards/al1/matrix.c index 0b7ec2c8a6a..f6e95108737 100644 --- a/keyboards/al1/matrix.c +++ b/keyboards/al1/matrix.c @@ -7,10 +7,10 @@ #include "util.h" #include "matrix.h" -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; @@ -69,7 +69,7 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<. #define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B6 @@ -62,7 +62,7 @@ along with this program. If not, see . #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -112,11 +112,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -221,4 +216,3 @@ along with this program. If not, see . #define LCD_E_PIN 1 //< pin for Enable line #endif */ - diff --git a/keyboards/alf/dc60/dc60.h b/keyboards/alf/dc60/dc60.h index 30e05b31f0c..db5154a28cf 100644 --- a/keyboards/alf/dc60/dc60.h +++ b/keyboards/alf/dc60/dc60.h @@ -24,19 +24,19 @@ // layout of the board and position of the keys // The second converts the arguments into a two-dimensional array which // represents the switch matrix. -#define LAYOUT( \ +#define LAYOUT_all( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE, \ K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ K40, K42, K43, K45, K47, K48, K4A, K4B, K4C, K4D, K4E \ ) \ { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE }, \ - { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ - { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ - { K40, KC_NO, K42, K43, KC_NO, K45, KC_NO, K47, K48, KC_NO, K4A, K4B, K4C, K4D, K4E }, \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, KC_NO, K42, K43, KC_NO, K45, KC_NO, K47, K48, KC_NO, K4A, K4B, K4C, K4D, K4E }, \ } #endif diff --git a/keyboards/alf/dc60/info.json b/keyboards/alf/dc60/info.json index 39295452055..1c3ebf4f0ab 100644 --- a/keyboards/alf/dc60/info.json +++ b/keyboards/alf/dc60/info.json @@ -2,11 +2,12 @@ "keyboard_name": "dc60", "url": "", "maintainer": "qmk", + "bootloader": "", "width": 15, "height": 5, "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}] } } } \ No newline at end of file diff --git a/keyboards/alf/dc60/keymaps/default/keymap.c b/keyboards/alf/dc60/keymaps/default/keymap.c index b7425178bc3..acd9753ef0f 100644 --- a/keyboards/alf/dc60/keymaps/default/keymap.c +++ b/keyboards/alf/dc60/keymaps/default/keymap.c @@ -16,43 +16,23 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( + [0] = LAYOUT_all( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_RALT, MO(1), KC_RGUI, KC_RGUI, KC_RCTL + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT ), - [1] = LAYOUT( + [1] = LAYOUT_all( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, + KC_TRNS, KC_LSFT, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/alf/dc60/rules.mk b/keyboards/alf/dc60/rules.mk index 9ad6d7875ef..0e8f52e2b69 100644 --- a/keyboards/alf/dc60/rules.mk +++ b/keyboards/alf/dc60/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/alf/x11/config.h b/keyboards/alf/x11/config.h new file mode 100644 index 00000000000..587e97cd87f --- /dev/null +++ b/keyboards/alf/x11/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Alf +#define PRODUCT x11 +#define DESCRIPTION A TKL custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 7 +#define MATRIX_COLS 13 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7, F0, F1, F4, F5, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN F7 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 28 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/alf/x11/info.json b/keyboards/alf/x11/info.json new file mode 100644 index 00000000000..54f2da66d12 --- /dev/null +++ b/keyboards/alf/x11/info.json @@ -0,0 +1,112 @@ +{ + "keyboard_name": "x11", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT": { + "key_count": 88, + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":2, "y":0}, + {"label":"K02", "x":3, "y":0}, + {"label":"K03", "x":4, "y":0}, + {"label":"K04", "x":5, "y":0}, + {"label":"K05", "x":6.5, "y":0}, + {"label":"K06", "x":7.5, "y":0}, + {"label":"K07", "x":8.5, "y":0}, + {"label":"K08", "x":9.5, "y":0}, + {"label":"K09", "x":11, "y":0}, + {"label":"K0A", "x":12, "y":0}, + {"label":"K0B", "x":13, "y":0}, + {"label":"K0C", "x":14, "y":0}, + + {"label":"K62", "x":15.25, "y":0}, + {"label":"K61", "x":16.25, "y":0}, + {"label":"K60", "x":17.25, "y":0}, + + {"label":"K10", "x":0, "y":1.5}, + {"label":"K11", "x":1, "y":1.5}, + {"label":"K12", "x":2, "y":1.5}, + {"label":"K13", "x":3, "y":1.5}, + {"label":"K14", "x":4, "y":1.5}, + {"label":"K15", "x":5, "y":1.5}, + {"label":"K16", "x":6, "y":1.5}, + {"label":"K17", "x":7, "y":1.5}, + {"label":"K18", "x":8, "y":1.5}, + {"label":"K19", "x":9, "y":1.5}, + {"label":"K1A", "x":10, "y":1.5}, + {"label":"K1B", "x":11, "y":1.5}, + {"label":"K1C", "x":12, "y":1.5}, + {"label":"K5A", "x":13, "y":1.5, "w":2}, + + {"label":"K63", "x":15.25, "y":1.5}, + {"label":"K65", "x":16.25, "y":1.5}, + {"label":"K67", "x":17.25, "y":1.5}, + + {"label":"K20", "x":0, "y":2.5, "w":1.5}, + {"label":"K21", "x":1.5, "y":2.5}, + {"label":"K22", "x":2.5, "y":2.5}, + {"label":"K23", "x":3.5, "y":2.5}, + {"label":"K24", "x":4.5, "y":2.5}, + {"label":"K25", "x":5.5, "y":2.5}, + {"label":"K26", "x":6.5, "y":2.5}, + {"label":"K27", "x":7.5, "y":2.5}, + {"label":"K28", "x":8.5, "y":2.5}, + {"label":"K29", "x":9.5, "y":2.5}, + {"label":"K2A", "x":10.5, "y":2.5}, + {"label":"K2B", "x":11.5, "y":2.5}, + {"label":"K2C", "x":12.5, "y":2.5}, + {"label":"K4C", "x":13.5, "y":2.5, "w":1.5}, + + {"label":"K64", "x":15.25, "y":2.5}, + {"label":"K66", "x":16.25, "y":2.5}, + {"label":"K68", "x":17.25, "y":2.5}, + + {"label":"K30", "x":0, "y":3.5, "w":1.75}, + {"label":"K31", "x":1.75, "y":3.5}, + {"label":"K32", "x":2.75, "y":3.5}, + {"label":"K33", "x":3.75, "y":3.5}, + {"label":"K34", "x":4.75, "y":3.5}, + {"label":"K35", "x":5.75, "y":3.5}, + {"label":"K36", "x":6.75, "y":3.5}, + {"label":"K37", "x":7.75, "y":3.5}, + {"label":"K38", "x":8.75, "y":3.5}, + {"label":"K39", "x":9.75, "y":3.5}, + {"label":"K3A", "x":10.75, "y":3.5}, + {"label":"K3B", "x":11.75, "y":3.5}, + {"label":"K3C", "x":12.75, "y":3.5, "w":2.25}, + + {"label":"K40", "x":0, "y":4.5, "w":2.25}, + {"label":"K41", "x":2.25, "y":4.5}, + {"label":"K42", "x":3.25, "y":4.5}, + {"label":"K43", "x":4.25, "y":4.5}, + {"label":"K44", "x":5.25, "y":4.5}, + {"label":"K45", "x":6.25, "y":4.5}, + {"label":"K46", "x":7.25, "y":4.5}, + {"label":"K47", "x":8.25, "y":4.5}, + {"label":"K48", "x":9.25, "y":4.5}, + {"label":"K49", "x":10.25, "y":4.5}, + {"label":"K4A", "x":11.25, "y":4.5}, + {"label":"K4B", "x":12.25, "y":4.5, "w":1.75}, + {"label":"K69", "x":14, "y":4.5}, + + {"label":"K58", "x":16.25, "y":4.5}, + + {"label":"K50", "x":0, "y":5.5, "w":1.25}, + {"label":"K51", "x":1.25, "y":5.5, "w":1.25}, + {"label":"K52", "x":2.5, "y":5.5, "w":1.25}, + {"label":"K53", "x":3.75, "y":5.5, "w":6.25}, + {"label":"K54", "x":10, "y":5.5, "w":1.25}, + {"label":"K55", "x":11.25, "y":5.5, "w":1.25}, + {"label":"K56", "x":12.5, "y":5.5, "w":1.25}, + {"label":"K57", "x":13.75, "y":5.5, "w":1.25}, + + {"label":"K6A", "x":15.25, "y":5.5}, + {"label":"K59", "x":16.25, "y":5.5}, + {"label":"K6B", "x":17.25, "y":5.5} + ] + } + } +} diff --git a/keyboards/alf/x11/keymaps/default/config.h b/keyboards/alf/x11/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/alf/x11/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/alf/x11/keymaps/default/keymap.c b/keyboards/alf/x11/keymaps/default/keymap.c new file mode 100644 index 00000000000..f0747d34505 --- /dev/null +++ b/keyboards/alf/x11/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_DEC, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_MPLY, KC_MSTP, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/alf/x11/keymaps/default/readme.md b/keyboards/alf/x11/keymaps/default/readme.md new file mode 100644 index 00000000000..a08c59173fe --- /dev/null +++ b/keyboards/alf/x11/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for x11 diff --git a/keyboards/alf/x11/readme.md b/keyboards/alf/x11/readme.md new file mode 100644 index 00000000000..b403a0952a4 --- /dev/null +++ b/keyboards/alf/x11/readme.md @@ -0,0 +1,13 @@ +# Alf X1.1 + +TKL Keyboard made by Alf + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Alf X1.1 PCB +Hardware Availability: [Massdrop](https://www.massdrop.com/buy/alf-studio-x1-1-custom-mechanical-keyboard-kit) + +Make example for this keyboard (after setting up your build environment): + + make alf/x11:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/alf/x11/rules.mk b/keyboards/alf/x11/rules.mk new file mode 100644 index 00000000000..d19b7c1baa2 --- /dev/null +++ b/keyboards/alf/x11/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +EXTRAFLAGS += -flto diff --git a/keyboards/alf/x11/x11.c b/keyboards/alf/x11/x11.c new file mode 100644 index 00000000000..9699918d5b2 --- /dev/null +++ b/keyboards/alf/x11/x11.c @@ -0,0 +1,64 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "x11.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + setPinOutput(C6); + setPinOutput(E6); + setPinOutput(C7); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(C6); + } else { + writePinHigh(C6); + } + + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(C7); + } else { + writePinHigh(C7); + } + + led_set_user(usb_led); +} diff --git a/keyboards/alf/x11/x11.h b/keyboards/alf/x11/x11.h new file mode 100644 index 00000000000..2a1d886fddd --- /dev/null +++ b/keyboards/alf/x11/x11.h @@ -0,0 +1,43 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K62, K61, K60, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K5A, K63, K65, K67, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K4C, K64, K66, K68, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K69, K58, \ + K50, K51, K52, K53, K54, K55, K56, K57, K6A, K59, K6B \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, KC_NO, KC_NO }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, KC_NO }, \ +} diff --git a/keyboards/alf/x2/config.h b/keyboards/alf/x2/config.h index f2106fa88e1..205fa358fca 100644 --- a/keyboards/alf/x2/config.h +++ b/keyboards/alf/x2/config.h @@ -30,7 +30,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +38,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/alf/x2/keymaps/default/keymap.c b/keyboards/alf/x2/keymaps/default/keymap.c index 9470e38b562..eb3d7bd468d 100644 --- a/keyboards/alf/x2/keymaps/default/keymap.c +++ b/keyboards/alf/x2/keymaps/default/keymap.c @@ -19,10 +19,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -} - void matrix_init_user(void) { } diff --git a/keyboards/alice/alice.c b/keyboards/alice/alice.c new file mode 100644 index 00000000000..adb88fef0a8 --- /dev/null +++ b/keyboards/alice/alice.c @@ -0,0 +1,55 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +#include "rgblight.h" + +#include "i2c_master.h" +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void matrix_init_kb(void) { + i2c_init(); + // call user level keymaps, if any + matrix_init_user(); +} + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + memset(led, 0, 3 * RGBLED_NUM); + } + + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} + +bool rgb_init = false; + +void matrix_scan_kb(void) { + // if LEDs were previously on before poweroff, turn them back on + if (rgb_init == false && rgblight_config.enable) { + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + rgb_init = true; + } + + rgblight_task(); + matrix_scan_user(); +} +#endif diff --git a/keyboards/alice/alice.h b/keyboards/alice/alice.h new file mode 100644 index 00000000000..1486612f9f1 --- /dev/null +++ b/keyboards/alice/alice.h @@ -0,0 +1,50 @@ +/* +Copyright 2019 Felipe Coury + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + +/* LAYOUT + * ┌───┐ ┌───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┬───┬───┐ + * │50 │ │00 │01 │02 │03 │04 │05 │06 │ │07 │08 │09 │0A │0B │0C │0D │0E │ + * ├───┤ ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┘ ┌─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │51 │ │10 │11 │12 │13 │14 │15 │ │16 │17 │18 │19 │1A │1B │1C │1D │ + * ├───┤ ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ └┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │52 │ │20 │21 │22 │23 │24 │25 │ │26 │27 │28 │29 │2A │2B │2C │ + * └───┘ ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┐ ┌─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │31 │32 │33 │34 │35 │ │36 │37 │38 │39 │4A │4B │4C │4D │ + * ├─────┬──┴──┬┴───┴┬──┴───┴┬──┴─┐ ├───┴───┴──┬┴───┴┬──┴───┴────┬─┴───┤ + * │40 │ │41 │42 │43 │ │46 │47 │ │48 │ + * └─────┘ └─────┴───────┴────┘ └──────────┴─────┘ └─────┘ + */ +#define LAYOUT( \ + K50, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K51, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K52, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K4A, K4B, K4C, K4D, \ + K40, K41, K42, K43, K46, K47, K48 \ +) \ +{ \ + { K00 , K01 , K02 , K03 , K04 , K05 , K06 , K07 , K08 , K09 , K0A , K0B , K0C , K0D , K0E }, \ + { K10 , K11 , K12 , K13 , K14 , K15 , K16 , K17 , K18 , K19 , K1A , K1B , K1C , K1D , KC_NO }, \ + { K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 , K28 , K29 , K2A , K2B , K2C , KC_NO, KC_NO }, \ + { K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 , K38 , K39 , K4A , K4B , K4C , K4D , KC_NO }, \ + { K40 , K41 , K42 , K43 , KC_NO, KC_NO, K46 , K47 , K48 , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K50 , K51 , K52 , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + diff --git a/keyboards/alice/config.h b/keyboards/alice/config.h new file mode 100644 index 00000000000..07b9599f58e --- /dev/null +++ b/keyboards/alice/config.h @@ -0,0 +1,39 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422E +// TODO: share these strings with usbconfig.h +// Edit usbconfig.h to change these. +#define MANUFACTURER TGR +#define PRODUCT TGR Alice + +/* matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } +#define DIODE_DIRECTION COL2ROW + +#define RGBLED_NUM 18 +#define RGBLIGHT_ANIMATIONS + +#define NO_UART 1 +#define BOOTLOADHID_BOOTLOADER 1 diff --git a/keyboards/alice/info.json b/keyboards/alice/info.json new file mode 100644 index 00000000000..b2620933267 --- /dev/null +++ b/keyboards/alice/info.json @@ -0,0 +1,80 @@ +{ + "keyboard_name": "TGR Alice", + "url": "", + "maintainer": "Felipe Coury", + "width": 17.75, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 66, + "layout": [ + {"label":"K63", "x":0, "y":0}, + {"label":"K00", "x":1.25, "y":0}, + {"label":"K01", "x":2.25, "y":0}, + {"label":"K02", "x":3.25, "y":0}, + {"label":"K03", "x":4.25, "y":0}, + {"label":"K04", "x":5.25, "y":0}, + {"label":"K05", "x":6.25, "y":0}, + {"label":"K06", "x":7.25, "y":0}, + {"label":"K07", "x":10.25, "y":0}, + {"label":"K08", "x":11.25, "y":0}, + {"label":"K09", "x":12.25, "y":0}, + {"label":"K10", "x":13.25, "y":0}, + {"label":"K11", "x":14.25, "y":0}, + {"label":"K12", "x":15.25, "y":0}, + {"label":"K13", "x":16.25, "y":0}, + {"label":"K14", "x":17.25, "y":0}, + {"label":"K64", "x":0, "y":1}, + {"label":"K15", "x":1.25, "y":1, "w":1.5}, + {"label":"K16", "x":2.75, "y":1}, + {"label":"K17", "x":3.75, "y":1}, + {"label":"K18", "x":4.75, "y":1}, + {"label":"K19", "x":5.75, "y":1}, + {"label":"K20", "x":6.75, "y":1}, + {"label":"K21", "x":9.75, "y":1}, + {"label":"K22", "x":10.75, "y":1}, + {"label":"K23", "x":11.75, "y":1}, + {"label":"K24", "x":12.75, "y":1}, + {"label":"K25", "x":13.75, "y":1}, + {"label":"K26", "x":14.75, "y":1}, + {"label":"K27", "x":15.75, "y":1}, + {"label":"K28", "x":16.75, "y":1, "w":1.5}, + {"label":"K65", "x":0, "y":2}, + {"label":"K29", "x":1.25, "y":2, "w":1.75}, + {"label":"K30", "x":3, "y":2}, + {"label":"K31", "x":4, "y":2}, + {"label":"K32", "x":5, "y":2}, + {"label":"K33", "x":6, "y":2}, + {"label":"K34", "x":7, "y":2}, + {"label":"K35", "x":10, "y":2}, + {"label":"K36", "x":11, "y":2}, + {"label":"K37", "x":12, "y":2}, + {"label":"K38", "x":13, "y":2}, + {"label":"K39", "x":14, "y":2}, + {"label":"K40", "x":15, "y":2}, + {"label":"K41", "x":16, "y":2, "w":2.25}, + {"label":"K42", "x":1.25, "y":3, "w":2.25}, + {"label":"K43", "x":3.5, "y":3}, + {"label":"K44", "x":4.5, "y":3}, + {"label":"K45", "x":5.5, "y":3}, + {"label":"K46", "x":6.5, "y":3}, + {"label":"K47", "x":7.5, "y":3}, + {"label":"K48", "x":9.5, "y":3}, + {"label":"K49", "x":10.5, "y":3}, + {"label":"K50", "x":11.5, "y":3}, + {"label":"K51", "x":12.5, "y":3}, + {"label":"K52", "x":13.5, "y":3}, + {"label":"K53", "x":14.5, "y":3}, + {"label":"K54", "x":15.5, "y":3, "w":1.75}, + {"label":"K55", "x":17.25, "y":3}, + {"label":"K56", "x":1.25, "y":4, "w":1.5}, + {"label":"K57", "x":4.25, "y":4, "w":1.5}, + {"label":"K58", "x":5.75, "y":4, "w":2}, + {"label":"K59", "x":7.75, "y":4, "w":1.25}, + {"label":"K60", "x":9.5, "y":4, "w":2.75}, + {"label":"K61", "x":12.25, "y":4, "w":1.5}, + {"label":"K62", "x":16.75, "y":4, "w":1.5} + ] + } + } +} diff --git a/keyboards/alice/keymaps/default/keymap.c b/keyboards/alice/keymaps/default/keymap.c new file mode 100644 index 00000000000..29fff66183d --- /dev/null +++ b/keyboards/alice/keymaps/default/keymap.c @@ -0,0 +1,35 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSLS, \ + KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_PGDN, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), \ + KC_LGUI, KC_LALT, KC_SPC, KC_LGUI, KC_SPC, KC_RALT, KC_RCTL \ + ), + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP , _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOWN, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/alice/keymaps/mrkeebs/keymap.c b/keyboards/alice/keymaps/mrkeebs/keymap.c new file mode 100644 index 00000000000..3d8099c4139 --- /dev/null +++ b/keyboards/alice/keymaps/mrkeebs/keymap.c @@ -0,0 +1,35 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSLS, \ + KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_PGDN, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), \ + KC_LGUI, KC_LALT, KC_SPC, KC_LGUI, KC_SPC, KC_RALT, KC_RCTL \ + ), + [1] = LAYOUT( + RESET, KC_GRV , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS, \ + _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_UP , _______, _______, \ + _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOWN, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/alice/readme.md b/keyboards/alice/readme.md new file mode 100644 index 00000000000..8e901ae7e44 --- /dev/null +++ b/keyboards/alice/readme.md @@ -0,0 +1,60 @@ +# TGR Alice + +![TGR Alice](https://i.imgur.com/cJohEqS.jpg) + +An ergonomic 60% keyboard. + +Keyboard Maintainer: [Felipe Coury](https://github.com/fcoury) +Hardware Supported: TGR Alice +Hardware Availability: Group buy finished + +Make example for this keyboard (after setting up your build environment): + + make alice:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + + +ps2avrGB keyboard firmware +========================== + +This keyboard uses the port of the QMK firmware for boards that are based on the +ps2avrGB firmware. + +Note that this is a complete replacement for the firmware, so you won't be +using Bootmapper Client to change any keyboard settings, since not all the +USB report options are supported. + +## Installing + +First, install the requirements. These commands are for OSX, but all you +need is the AVR toolchain and `bootloadHID` for flashing: + +``` +$ brew cask install crosspack-avr +$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb +$ pip install pyusb +``` + +Then, with the keyboard plugged in, simply run this command from the +`qmk_firmware` directory: + +``` +$ make alice +$ bootloadHID -r alice_default.hex +``` + +## Setting the board to bootloader mode + +Hold the ESC key (the one before the 1! key, in case you remaped it). + +## Troubleshooting + +From my experience, it's really hard to brick these boards. But these +tricks have been useful when it got stuck in a weird scenario. + +1. Try plugging the board in while holding the bootloader key. This will force + it to boot only the bootloader without loading the firmware. Once this is + done, just reflash the board with the original firmware. +2. Sometimes USB hubs can act weird, so try connecting the board directly + to your computer or plugging/unplugging the USB hub. diff --git a/keyboards/alice/rules.mk b/keyboards/alice/rules.mk new file mode 100644 index 00000000000..eecd38d7e76 --- /dev/null +++ b/keyboards/alice/rules.mk @@ -0,0 +1,48 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +SRC += i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/alice/usbconfig.h b/keyboards/alice/usbconfig.h new file mode 100644 index 00000000000..df7a88e3abd --- /dev/null +++ b/keyboards/alice/usbconfig.h @@ -0,0 +1,396 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'T', 'G', 'R' +#define USB_CFG_VENDOR_NAME_LEN 3 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'T', 'G', 'R', ' ', 'A', 'l', 'i', 'c', 'e' +#define USB_CFG_DEVICE_NAME_LEN 9 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/alpha/config.h b/keyboards/alpha/config.h index 1e16f5ca3c9..b7348bef17f 100755 --- a/keyboards/alpha/config.h +++ b/keyboards/alpha/config.h @@ -30,7 +30,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,12 +38,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - #define RGB_DI_PIN F4 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/alpha/keymaps/default/keymap.c b/keyboards/alpha/keymaps/default/keymap.c index e8d04b8e7ea..c18790fe4b3 100755 --- a/keyboards/alpha/keymaps/default/keymap.c +++ b/keyboards/alpha/keymaps/default/keymap.c @@ -6,7 +6,7 @@ #define OTHER 3 enum custom_keycodes { - MACRO1 + MACRO1 = SAFE_RANGE }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/alpha/keymaps/vderm/README.md b/keyboards/alpha/keymaps/vderm/README.md new file mode 100644 index 00000000000..26a8ab3e85f --- /dev/null +++ b/keyboards/alpha/keymaps/vderm/README.md @@ -0,0 +1,35 @@ +# Alpha 28-Key Keyboard Alternate Keymap +Alternate keymap for [Alpha 28-key keyboard](https://github.com/qmk/qmk_firmware/tree/master/keyboards/alpha). + +## How-to +Assuming you've followed all the instructions from the original post, put my "keymap.c" file in "$qmk-firmware-folder$/keyboards/alpha/keymaps/vderm/" and then run your make command ("make alpha:vderm" while in $qmk-firmware-folder$ where this folder is what you've downloaded from the official github page) to compile the hex file to upload to your microcontroller. I've also uploaded my hex file. + +## Description +Instead of going up and down layers like in the original Alpha keyboard, I've made the bottom row keys all have alternate functions: ++ Like in the original Alpha28 keymap, the 2U spacebar is a shift key when held down and space when tapped ++ Z and M are Ctrl keys when held down or Z and M when tapped ++ X and N are Alt keys ++ C activates the function keys layer (arrows, page up/dn, esc, tab, etc.) ++ V activates the characters and numbers layer ++ C and V combined activated the F-keys layer (F1, F2, F3, etc.) ++ The enter key is an enter key in the home layer, backspace in the function keys and characters/numbers layer and a delete in the F-keys layer ++ While in the other layers, the bottom row acts like a "regular" bottom modified row: ctrl, alt, winkey + +## Keymap +![keymap](https://imgur.com/ZbDz0eL.jpg) + +## Build Images +Here is my keyboard. ++ Switches: Aliaz Silent Switches (Tactile), PCB mount, 80g from [KBDfans](https://kbdfans.cn/collections/aliaz-switches/products/pre-orderaliaz-silent-switch-tactile?variant=2519899832333) ++ PCB board: ordered from JLCPCB, in white ++ Keycaps: ebay, can't find link :S ++ Bottom plate: I cut a piece of canary wood that was laying around, needs to be varnished; I also need to actually screw the pcb to the wood instead of relying on double-sided tape + +![vderm_alpha0](https://imgur.com/MjjoVtr.jpg) +![vderm_alpha1](https://imgur.com/mIFu9WV.jpg) +![vderm_alpha2](https://imgur.com/A70Iemw.jpg) +![vderm_alpha3](https://imgur.com/eYljPWh.jpg) +![vderm_alpha4](https://imgur.com/OhUKowj.jpg) + +Good luck on your build! +//vderm diff --git a/keyboards/alpha/keymaps/vderm/alpha_vderm.hex b/keyboards/alpha/keymaps/vderm/alpha_vderm.hex new file mode 100644 index 00000000000..7515ad03051 --- /dev/null +++ b/keyboards/alpha/keymaps/vderm/alpha_vderm.hex @@ -0,0 +1,1422 @@ +:100000000C949F020C94E6020C94E6020C94E60217 +:100010000C94E6020C94E6020C94E6020C94E602C0 +:100020000C94E6020C94E6020C94E0250C94B226A3 +:100030000C940D1D0C94E6020C94E6020C94E6025E +:100040000C94E6020C94E6020C94E6020C94E60290 +:100050000C94E6020C94751D0C94E6020C94E602D6 +:100060000C94E6020C94E6020C94E6020C94E60270 +:100070000C94E6020C94E6020C94E6020C94E60260 +:100080000C94E6020C94E6020C94E6020C94E60250 +:100090000C94E6020C94E6020C94E6020C94E60240 +:1000A0000C94E6020C94E6020C94E602AE03B00354 +:1000B000BB03B203B403B603B803BA03BD03BF0363 +:1000C000C103CC03C303C503C703C903CB03CE03DA +:1000D000181318134A134A138813A6130C150C157A +:1000E000E8130C158B148B14FC140C150C1505154A +:1000F00098149814981498149814981498149814A0 +:10010000981498149814981498149814981498148F +:10011000A914B714BE14C514CF149D159D15AF15A1 +:10012000AF15A615AF15AF15AF159D159D15AB15E0 +:10013000AF15AF15AB151F2746273E2846273E288B +:100140009227B5273E280C281B2807634236B79B09 +:10015000D8A71A39685618AEBAAB558C1D3CB7CC27 +:100160005763BD6DEDFD753EF6177231BF0000009F +:10017000803F05A84CCDB2D44EB93836A9020C50F8 +:10018000B9918688083CA6AAAA2ABE000000803F32 +:1001900014001A000800150017001C0018000C00BD +:1001A0001200130004001600070009000A000B00EB +:1001B0000D000E000F0028001D611B64064119424E +:1001C00000002C62000005781174107129007F0076 +:1001D000AA00A900AE004A004E004B004D000000EE +:1001E0002B000000000000000000500051005200F1 +:1001F0004F002A00E000E2000100035100002C62E1 +:100200000000E700E600E4001E001F0020002100BF +:1002100022002300240025002600270035000000CE +:100220002D002E0031002F003000330034002A0052 +:10023000E000E2000351010000002C6200003600E3 +:10024000370038003A003B003C003D003E003F00D4 +:10025000400041004200430044004500000000000F +:10026000000000000000000000004C00E000E20080 +:100270000100010000002C620000E700E600E4003D +:1002800000047F3F1F643214643214783C1E1E1435 +:100290000A056801F000B40078005A000000000070 +:1002A0000001010101010101010102020202020239 +:1002B000020202030303030303030304040404040C +:1002C00004050505050506060606060707070708CF +:1002D0000808080909090A0A0A0A0B0B0B0C0C0C7E +:1002E0000D0D0D0E0E0F0F0F101011111112121314 +:1002F000131414151516161717181819191A1A1B8E +:100300001C1C1D1D1E1F1F202021222223242525E9 +:1003100026272728292A2B2B2C2D2E2F2F30313220 +:1003200033343536363738393A3B3C3D3E3F404131 +:10033000424344464748494A4B4C4D4F5051525313 +:10034000555657585A5B5C5E5F60626364666769C6 +:100350006A6C6D6E707173747678797B7C7E808147 +:10036000838486888A8B8D8F91929496989A9B9D90 +:100370009FA1A3A5A7A9ABADAFB1B3B5B7B9BBBD9D +:10038000BFC1C4C6C8CACCCFD1D3D6D8DADCDFE16E +:10039000E4E6E8EBEDF0F2F5F7FAFCFF04033000D9 +:1003A00000000C0361006C00700068006100000038 +:1003B0000C035000790072006F004C000000040331 +:1003C000090409026D00040100A0FA0904000001FB +:1003D00003010100092111010001224000070581EC +:1003E0000308000A090401000103010200092111A8 +:1003F000010001224D000705820308000A090402DA +:10040000000103000000092111010001223600074C +:1004100005830308000A0904030001030000000922 +:100420002111010001223900070584032000011277 +:1004300001100100000008EDFE60600100010203F0 +:100440000105010906A101050719E029E7150025A5 +:1004500001950875018102050819012905950575A1 +:100460000191029501750391010507190029F715FE +:1004700000250195F875018102C005010980A101DF +:1004800085021601002603001A81002A83007510D8 +:1004900095018100C0050C0901A101850316010029 +:1004A000269C021A01002A9C02751095018100C049 +:1004B00005010902A1010901A10005091901290588 +:1004C00015002501950575018102950175038101CE +:1004D0000501093009311581257F950275088106CE +:1004E00009381581257F950175088106050C0A38A4 +:1004F000021581257F950175088106C0C005010997 +:1005000006A101050719E029E715002501950875E1 +:1005100001810295017508810105081901290595D8 +:1005200005750191029501750391010507190029CF +:10053000FF150026FF00950675088100C0001124F4 +:100540001FBECFEFDAE0DEBFCDBF04B603FE27C08B +:100550008091620290916302A0916402B091650261 +:100560008730904BA740B04BD1F4109262021092AA +:100570006302109264021092650214BE84B7877FF2 +:1005800084BF0FB6F894A89580916000886180932D +:100590006000109260000FBEE0E0F8E3099511E002 +:1005A000A0E0B1E0E0E8F8E502C005900D92A234C9 +:1005B000B107D9F722E0A2E4B1E001C01D92A23652 +:1005C000B207E1F70E940B230C943E2C0C94000020 +:1005D0000895089581E0089581E008950C94EC0257 +:1005E0000C9461080C94630808950C94F4020C9424 +:1005F000F50208950E9489150E94F9022FEF84E305 +:100600009CE0215080409040E1F700C0000087E767 +:1006100097E790930108809300080C949B1DFF922C +:100620000F931F93CF93DF938C01FC01C081D18185 +:1006300080919101811113C08281882349F0CE01FC +:100640000E94E61AF82E682FCE010E948F1A04C06D +:10065000CE010E94BA1AF82EBE018F2D04C0CE0121 +:100660000E94E61ABE010E94B305EC01B8010E9487 +:10067000EE02882309F46CC2B801CE010E94120870 +:10068000882309F465C2C93CFCE5DF0741F4F801A1 +:100690008281882309F45CC20E94290A59C2CA3C9B +:1006A0008CE5D80708F013C1C13C9CE5D90761F47B +:1006B000F8018281882309F44BC20E94B71B827221 +:1006C000F1F00E94490C44C2C23CECE5DE07D0F0D8 +:1006D000F8018281C53CFCE5DF0709F4CDC008F0D4 +:1006E000DDC0C33CECE5DE0709F4CCC008F0D0C0A7 +:1006F000882309F42DC20E94B71B827211F30E9455 +:100700003F0C26C2C531FCE5DF0708F07EC0C230D1 +:100710008CE5D80708F452C0F8018281882309F4D7 +:1007200059C00E94141C811102C00E94F31B0E9438 +:10073000311C90E09093540280935302FE01E350E9 +:10074000FC45E231F10530F4EA5AFF4F8091530243 +:100750000C94E32B80915302816027C0826025C0F6 +:10076000846023C0806121C080621FC080641DC07E +:1007700080681BC08460886018C08E7F16C08D7F23 +:1007800014C08B7F12C08F7E10C08F7D0EC08F7BF8 +:100790000CC08F770AC08B7F877F07C087FB22271B +:1007A00020F991E0922790FB87F980935302809182 +:1007B00053020E94351C0E948915CAC1C1159CE5CF +:1007C000D90781F0C130DC45A9F081E08093470171 +:1007D00080934801C801DF91CF911F910F91FF9045 +:1007E0000C94EA02F8018281882309F4B1C10E94C5 +:1007F000FA02AEC1F8018281882309F4A9C180916F +:100800000B02816080930B02A3C1C531FCE5DF07B9 +:1008100039F50E94B71B982FF801828120910D01B4 +:1008200030910E01882379F09A7A81E009F480E012 +:1008300080934201911102C069E201C065E3C901E0 +:100840000E94971C0AC080914201811102C069E296 +:1008500001C065E3C9010E94A21C0E94841B78C1EB +:10086000C03CDC4509F0B1CFF8018281882309F44E +:100870006FC10E94DA0C6CC1882309F469C10E941F +:10088000880B66C1882309F463C10E94510B60C1C3 +:10089000882309F45DC10E94690B5AC1C73C9CE5DD +:1008A000D90731F4882309F453C10E94BD0B50C10C +:1008B000C83CDC4530F4882309F44AC10E94A30BEC +:1008C00047C1882309F444C10E94D80B41C1C13DEE +:1008D000FCE5DF0749F4F8018281882309F438C177 +:1008E00088E10E943C0C34C1C23D8CE5D80708F079 +:1008F00087C0F8018281CD3CFCE5DF07A1F48823A5 +:1009000009F426C10E941B0A663071058105910514 +:1009100040F00E941B0A683071058105910508F4BA +:10092000EECE86E0DECFCE3C9CE5D90730F5CB3C61 +:10093000ECE5DE0729F4882309F40AC181E0D1CF70 +:10094000CC3CDC4530F4882309F402C10E943E0A05 +:10095000FFC0882309F4FCC00E941B0A62307105A5 +:100960008105910540F00E941B0A653071058105E3 +:10097000910508F4C4CE82E0B4CFCF3C9CE5D90702 +:10098000A1F4882309F4E4C00E941B0A6F307105AA +:100990008105910540F00E941B0A643171058105B3 +:1009A000910508F4ACCE8FE09CCFC03DDC45A0F4AF +:1009B000882309F4CDC00E941B0A693071058105A6 +:1009C000910540F00E941B0A6E307105810591056A +:1009D00008F495CE89E085CF882309F4B9C00E9438 +:1009E0001B0A653171058105910540F00E941B0AC3 +:1009F000673171058105910508F481CE85E171CFDC +:100A0000C53DFCE5DF0739F5F8018281882361F0F7 +:100A1000109248010E943F1D90934601809345012A +:100A200080E20E94D51294C08091480181110FC0CC +:100A300080914501909146010E944B1D883C910593 +:100A400030F487E20E94731187E20E946F1280E205 +:100A50000E94DC127DC0C63D8CE5D80708F043C07B +:100A6000F8018281C33DFCE5DF0729F4882309F4FE +:100A70006FC083E236CFC43DDC45A0F4882309F47F +:100A800067C00E941B0A693171058105910540F01C +:100A90000E941B0A623271058105910508F42FCE70 +:100AA00089E11FCF882351F0109247010E943F1D1A +:100AB000909344018093430182E0B3CF809147013A +:100AC00081110FC080914301909144010E944B1D00 +:100AD000883C910530F486E20E94731186E20E9400 +:100AE0006F1282E0B5CFC93DECE5DE0731F4F801C5 +:100AF0008281882369F180E009C0CA3DFCE5DF07F7 +:100B000041F4F8018281882319F182E00E94A72331 +:100B10001FC0C63DDC4509F058CEF8018281811125 +:100B200077CF80914801811192CF809145019091BA +:100B300046010E944B1D883C910508F088CF80E259 +:100B40000E94DC1288E20E94731188E20E946F12F8 +:100B500080E0DF91CF911F910F91FF90089580E089 +:100B600090E0089508952EE1829FC0011124FC01B8 +:100B70002AE0729FE00DF11D1124E60FF11DEE0F2A +:100B8000FF1FE057FE4F859194910895880F991F9C +:100B9000FC01E058FD4F859194910895CF93DF9328 +:100BA0000E94B3050E947207EC018115904508F080 +:100BB00041C0C11580E4D80708F01CC1C83ED1056A +:100BC00010F5C03ED10508F089C1C83AD10578F4C6 +:100BD000C53AD10508F09EC0C130D10509F47EC1E7 +:100BE00008F435C1C430D10508F078C130C1CD3B1F +:100BF000D10508F49AC0C03CD10508F428C1CE0143 +:100C0000805C9109E9C0C11590E2D90758F4C1157B +:100C100021E0D20708F062C1C03FD10508F417C136 +:100C2000D0655CC1C11580E3D80708F0D9C0CE01FA +:100C30009F70D2C0C11595E5D90708F044C0C11511 +:100C400024E5D20708F0EDC0C11582E5D80710F5FC +:100C5000C11591E5D90708F0D0C0CE0174E0969592 +:100C600087957A95E1F7282F23703C2F337081E028 +:100C700090E002C0880F991F3A95E2F79C68922B8A +:100C8000CF70C695C69520E2C29FE0011124C82B03 +:100C9000D92B24C19E01237033278C2F86958695EE +:100CA000C115D34508F0AEC0C1E0D0E002C0CC0F02 +:100CB000DD1F2A95E2F720E2829FC0011124C82B94 +:100CC000D92BDC680BC1C11529E5D20780F4C11509 +:100CD00088E5D80708F0AAC0C11596E5D90708F03D +:100CE000B6C0CF71DD27DC2FCC27D062F7C0CE0194 +:100CF000C1152AE5D20708F49EC09056811590428E +:100D000008F0A5C08D2F8F710E94EE07DD27D062FD +:100D10008F719BC0C53AD10509F49CC0C63AD10574 +:100D200009F09BC0C2E8D0E4D9C0C83AD10509F4A3 +:100D300097C0C93AD10509F496C0CA3AD10509F459 +:100D400095C0CB3AD10509F494C0CC3AD10509F449 +:100D500093C0CB3BD10509F492C0CC3BD10509F43B +:100D600091C0CD3AD10509F490C0C03BD10509F43A +:100D70008FC0CE3AD10509F48EC0CF3AD10509F41F +:100D80008DC0C13BD10509F48CC0C23BD10509F42B +:100D90008BC0C33BD10509F48AC0C43BD10509F41B +:100DA00089C0C53BD10509F488C0C63BD10509F40B +:100DB00087C0C73BD10509F486C0C83BD10509F4FB +:100DC00085C0C93BD10509F484C0CA3BD10509F4EB +:100DD00083C0C0E0D4E482C00E94C605EC017EC09E +:100DE000CE019927D3FF03C0EC01D86C77C0EC018A +:100DF000D06C74C0DF70D06A71C0DC2FCC27C16F9B +:100E0000D06A6CC0C1E0D0E002C0CC0FDD1F2A95D3 +:100E1000E2F720E2829FC0011124C82BD92BDA68A7 +:100E20005DC0DC2FCC27C46FD06A58C0DC2FCC2724 +:100E3000C06FD06A53C024E0969587952A95E1F754 +:100E40008F70CF70C06ED0E0D06AD82B47C0C0E0A2 +:100E5000D0E044C0C1E8D0E441C0C3E8D0E43EC023 +:100E6000C2EED4E43BC0C9EED4E438C0CAEED4E448 +:100E700035C0C5EBD4E432C0C6EBD4E42FC0C3EB1D +:100E8000D4E42CC0C4EBD4E429C0C7EBD4E426C01E +:100E9000CCECD4E423C0CDECD4E420C0C3E8D5E44A +:100EA0001DC0CAE8D5E41AC0C2E9D5E417C0C4E938 +:100EB000D5E414C0C1E2D6E411C0C3E2D6E40EC04A +:100EC000C4E2D6E40BC0C5E2D6E408C0C6E2D6E46C +:100ED00005C0C7E2D6E402C0CAE2D6E4CE01DF9183 +:100EE000CF9108958238910549F1B0F4813391058D +:100EF00009F459C048F48932910509F44FC08A3287 +:100F0000910509F455C008958533910509F441C050 +:100F10008933910599F00895833E910531F138F4B4 +:100F2000803E910591F0823E9105A9F00895863E9C +:100F3000910501F1873E910539F108952091530201 +:100F400020FD3BC021FD39C008958091530280FFF0 +:100F500034C089E341C08091530282FF30C0809148 +:100F6000530284FD2EC083EE37C08091530282FD70 +:100F700026C0F5CF8091530283FF25C08091530294 +:100F800084FD1FC087EE28C08091530283FD1BC0E3 +:100F9000F5CF8091530285FD18C019C0809153028E +:100FA00085FD15C012C08091530286FD12C013C08A +:100FB0008091530286FD0FC00CC080EE0DC082EE02 +:100FC0000BC080E009C086EE07C089E205C085E35A +:100FD00003C08AE201C081E390E00895909153023A +:100FE00092FF0DC0282F2871283019F4877F846064 +:100FF00006C0282F2471243011F48B7F886093FF62 +:101000000DC0282F2871283119F4877E846106C00D +:10101000282F2471243111F48B7E886194FD877E02 +:10102000089508950F931F93CF93FB0122812111FF +:1010300002C0C1E041C08C01C0915601C11125C060 +:1010400086319C45B1F70E94110881E080935601DA +:101050000E943F1D909355018093540110924901C5 +:1010600010924B0110924A0110924D0110924C01C6 +:1010700010924F0110924E011092510110925001A6 +:10108000109253011092520117C080915401909117 +:1010900055010E944B1D8C32914058F690914901A8 +:1010A000E92FF0E0EE0FFF1FE65BFE4F1183008398 +:1010B0009F5F90934901C0E08C2FCF911F910F91BA +:1010C00008950C94E8020C94E902CF93DF93AAE20E +:1010D000B1E04DE251E061E070E08D91E82FE295E2 +:1010E000EF70F0E021A18F70EB0102C0CC0FDD1F8B +:1010F0008A95E2F7CE019C2F9095922391A392A11D +:10110000892B82A34A175B0741F7A0E2B1E04AE2CC +:1011100051E061E070E08D91E82FE295EF70F0E032 +:1011200021A18F70EB0102C0CC0FDD1F8A95E2F781 +:10113000CE019C2F9095922391A392A1892B82A3FB +:101140004A175B0741F710925E0110925D01109201 +:101150005801109257011092600110925F01109295 +:101160005A0110925901109262011092610110927D +:101170005C0110925B01DF91CF910C94F0022F92F1 +:101180003F924F925F926F927F928F929F92AF9217 +:10119000BF92CF92DF92EF92FF920F931F93CF9364 +:1011A000DF932AE2E22E21E0F22EC7E5D1E03DE511 +:1011B000832E31E0932E01E010E066246394BE019B +:1011C000A880B98019821882D7018D917D01E82FFE +:1011D000E295EF70F0E021A18F70A80102C0440FEA +:1011E000551F8A95E2F7CA01242B21A322A1742E50 +:1011F0007094272122A350EA5A95F1F790E2292E04 +:1012000091E0392E20E030E0D1015D901D01452DA7 +:1012100042954F7050E0DA0190964C90C880D9808A +:10122000552D5F70D80102C0AA0FBB1F5A95E2F777 +:10123000AD01442141F4A801022E02C0440F551F04 +:101240000A94E2F702C040E050E04C295D2959833E +:1012500048832F5F3F4F2A303105B1F691A17922A3 +:1012600071A292A1892B82A32296FB018081918198 +:10127000A816B90641F0609263010E943F1D909349 +:101280006501809364018C169D0609F098CF8091CA +:101290006301882311F180916401909165010E949E +:1012A0004B1D0697D0F08091570190915801909373 +:1012B0005E0180935D018091590190915A01909354 +:1012C000600180935F0180915B0190915C0190933C +:1012D000620180936101109263010E94F20281E039 +:1012E000DF91CF911F910F91FF90EF90DF90CF9002 +:1012F000BF90AF909F908F907F906F905F904F9036 +:101300003F902F900895E82FF0E0EE0FFF1FE35A73 +:10131000FE4F8081918108950895EF92FF920F937F +:101320001F93CF93DF93E901662309F44BC0242F69 +:1013300030E0EFEFF0E0E61BF109B901E69F900124 +:10134000E79F300DF69F300D1124232F8B01031BD7 +:1013500011095CE3E52EF12CB7010E94BB2BFB01C8 +:10136000BC01069FC001079F900D169F900D112490 +:10137000B7010E94BB2BE230F105B1F040F4309789 +:1013800079F0319711F5832F242F461B21C0E430CB +:10139000F105A1F068F03597C1F4842F861B18C0C1 +:1013A000832F262F230F14C0862F830FE42F03C013 +:1013B000E42FE61B842F432F2E2F0AC0842F462FA5 +:1013C000430F06C0842F242F03C080E020E040E0BC +:1013D000E42FF0E0E456FD4F4491E22FF0E0E456B4 +:1013E000FD4F9491E82FF0E0E456FD4FE4914983DE +:1013F0009883EA83DF91CF911F910F91FF90EF9037 +:10140000089588E090E00C94FE2BAB01BC0188E0CD +:1014100090E00C941C2CE9E3F2E083E080831092CE +:101420003A028FEF8283838314826081718182818B +:1014300093810C94050A6091390260FF06C066959D +:101440006F7370E080E090E0089560E070E0CB01A1 +:10145000089580913D0290E001968430910514F04A +:1014600083E090E080933D026091390270913A02EE +:1014700080913B0290913C020C94050A80913D02C0 +:1014800090E0019797FF02C080E090E084309105E2 +:1014900014F083E090E080933D02609139027091F6 +:1014A0003A0280913B0290913C020C94050A809193 +:1014B000390280FF06C065E070E08EE392E00C9494 +:1014C0001910EEE3F2E0118210821282339682E06C +:1014D000ED34F807C1F7EFCF9091390290FF0CC0BF +:1014E000EEE3F2E0818360834283339692E0ED3451 +:1014F000F907C1F70C94570A0895CF93DF9300D0F2 +:101500001F92CDB7DEB72091390220FF0AC09E019D +:101510002F5F3F4F0E948D094B8169818A810E9414 +:101520006C0A0F900F900F90DF91CF9108955F920A +:101530006F927F928F929F92AF92BF92CF92DF92E3 +:10154000EF92FF920F931F93CF93DF9300D01F92E0 +:10155000CDB7DEB78C01E62EF42E522E80913902E3 +:1015600080FF89C0982F9E77923061F49E012F5F93 +:101570003F4FC8010E948D094B8169818A810E9479 +:101580006C0A59C0E82FE695EF739EE39E0F9F7398 +:10159000943018F4F0903C024EC09AE39E0F9F7373 +:1015A000993068F4881F8827881F90913A02292F64 +:1015B000220F022F082B97FB112710F93CC087E25E +:1015C0008E0F8F738A30B8F5F0E07997E0FD02C096 +:1015D00021E001C02FEFEE7FEE56FD4F85919491F3 +:1015E00065E070E00E94BB2B26034001279F900C12 +:1015F0001124580188E9A81A8EEFB80A8EE3C82E84 +:1016000082E0D82E98E6692E77247394C501B30141 +:101610000E94BB2B96014F2D6E2D0E948D09A80CA8 +:10162000B91C83E0C80ED11C8DE4C81682E0D80630 +:1016300069F70E94570A8091390200FB87F980936D +:101640003902902F969580913A028078892B10FB71 +:1016500087F980933A02E0923B02F0923C025520D7 +:1016600051F06091390270913A0280913B02909161 +:101670003C020E94050A0F900F900F90DF91CF91CE +:101680001F910F91FF90EF90DF90CF90BF90AF90A0 +:101690009F908F907F906F905F90089521E00C94C1 +:1016A000970AE9E3F2E02081221F2227221F3091CE +:1016B0003A02432F440F842F822B37FB992790F94E +:1016C000089668E671E00E94CF2B438162810C94FA +:1016D0004E0B20913902221F2227221F30913A02FD +:1016E000432F440F842F822B37FB992790F98830A2 +:1016F00091051CF4805A9E4F05C0089768E671E07A +:101700000E94CF2B40913C0260913B020C944E0B07 +:1017100060913B02862F90E0883F910514F4685F4A +:1017200001C06FEF80913902881F8827881F909130 +:101730003A02292F220F97FB992790F940913C02FA +:10174000822B0C944E0B60913B02862F90E0089701 +:1017500014F0685001C060E080913902881F88272A +:10176000881F90913A02292F220F97FB992790F911 +:1017700040913C02822B0C944E0B40913C02842FF2 +:1017800090E0883F910514F4485F01C04FEF8091CD +:101790003902881F8827881F90913A02292F220F2B +:1017A00097FB992790F960913B02822B0C944E0B8A +:1017B00040913C02842F90E0089714F0485001C0FB +:1017C00040E080913902881F8827881F90913A0253 +:1017D000292F220F97FB992790F960913B02822BCA +:1017E0000C944E0B20E00C94970ACF939091390201 +:1017F00090FF40C09178811102C0926007C085328D +:1018000010F0986403C08F73880F982B909339025F +:10181000662351F06091390270913A0280913B0247 +:1018200090913C020E94050AC09139026C2F669586 +:101830006F7370E04BE050E082E091E00E94E92B92 +:10184000892B19F01092830103C081E080938301FA +:10185000CC1FCC27CC1F90913A02892F880F97FB81 +:10186000992790F940913C0260913B028C2BCF91DB +:101870000C94F20BCF91089561E00C94F50B8091DC +:10188000390286958F738F5F853208F081E00C9462 +:101890003C0C8091390286958F73815009F484E263 +:1018A0000C943C0CE9E3F2E08081816080838695B2 +:1018B0008F730C943C0C60E00C94F50B80910B0240 +:1018C000816080930B020E94141C811104C00E944D +:1018D000F31B0E940B0A0E94010A60933902709365 +:1018E0003A0280933B0290933C026E7761F40E942F +:1018F0000B0A0E94010A6093390270933A028093A6 +:101900003B0290933C0281E08093830180913902F5 +:1019100080FF04C086958F730C945B0C08959091A2 +:10192000390290FF10C0253070F430E0F901EE0F5D +:10193000FF1F2E0F3F1FF901E25CFD4F8183608383 +:1019400042830C94570A08951F93CF93DF9300D0DE +:101950001F92CDB7DEB73091390230FF0CC0122F85 +:101960009E012F5F3F4F0E948D09212F4B8169817E +:101970008A810E948F0C0F900F900F90DF91CF9172 +:101980001F910895E9E3F2E080818E7F808360817A +:101990007181828193810E94050A109283012FEF49 +:1019A00080E792E0215080409040E1F700C00000C5 +:1019B0000C94570A8091390280FD0C94C20C0C944F +:1019C000520CCF93C82F80918101909182010E9487 +:1019D0004B1DEC2FF0E0E257FD4FE491F0E08E1745 +:1019E0009F0708F443C00E943F1D9093820180939B +:1019F00081016091800170E080E090E00E94BC294C +:101A000020E030E04FE753E40E94DF282BED3FE079 +:101A100049E450E40E94E52A0E94522B0E94592971 +:101A20002BE43AE34EE25FE30E94722820EF3BEFA3 +:101A300048ED52E40E94E52A0E948B29462F8091AE +:101A40003902881F8827881F90913A02292F220F78 +:101A500097FB992790F960913B02822B0E947D0AA7 +:101A60008091800190E0019680938001CF9108954C +:101A7000CF93C82F80917E0190917F010E944B1DD2 +:101A8000EC2FF0E0E557FD4FE491F0E08E179F0753 +:101A9000E8F00E943F1D90937F0180937E0140916A +:101AA0003C0260913B0280917C0190917D010E94FB +:101AB0007D0A80917C0190917D01019668E671E03C +:101AC0000E94BB2B90937D0180937C01CF91089560 +:101AD000CF92DF92FF920F931F93CF93DF93F82E55 +:101AE00080917A0190917B010E944B1DEF2DE6952C +:101AF000F0E0E857FD4FE491F0E08E179F07C0F14A +:101B00000E943F1D90937B0180937A010EE312E0C7 +:101B1000C0E0D0E088E6C82EDD24D394809178011F +:101B2000909179018C0F9D1FB6010E94BB2B9801EB +:101B300040913C0260913B020E948D09C85BDF4FDF +:101B40000D5F1F4FC83681E0D80741F70E94570A42 +:101B50008091780190917901F0FE05C00196BE0157 +:101B60000E94BB2B01C0019790937901809378016B +:101B7000DF91CF911F910F91FF90DF90CF9008954B +:101B8000CF92DF92EF92FF920F931F93CF93DF9349 +:101B9000C82F80FF02C01FEF01C011E080917601C5 +:101BA000909177010E944B1DC695EC2FF0E0EB570A +:101BB000FD4FE491F0E08E179F0708F45BC00E9490 +:101BC0003F1D90937701809376012EE3E22E22E071 +:101BD000F22EC0E0D0E0F70111821082128294E070 +:101BE000C92ED12C00E080917501800F87FD8B5F9D +:101BF000082E000C990BC817D907E9F480913C0214 +:101C00008C9DA0018D9D500D11245595479555959E +:101C1000479580913902881F8827881F90913A0242 +:101C2000592F550F97FB992790F9970160913B0227 +:101C3000852B0E948D09010FF1E0CF1AD10899F68A +:101C4000219683E0E80EF11CC530D10521F60E94F3 +:101C5000570A80917501113031F4811102C084E07E +:101C600007C0815005C090E00196BE010E94CF2BB5 +:101C700080937501DF91CF911F910F91FF90EF90AD +:101C8000DF90CF9008950F931F93CF93DF93C82FCA +:101C900080917301909174010E944B1DEC2FF0E034 +:101CA000EE57FD4FE491F0E08E179F0708F456C001 +:101CB0000E943F1D9093740180937301CEE3D2E0A4 +:101CC000FE01118210821282339682E0ED34F80711 +:101CD000C1F700E010E080917201082E000C990B12 +:101CE00008171907ECF080910101082E000C990BE0 +:101CF00080179107ACF080913902881F8827881FD0 +:101D000090913A02592F550F97FB992790F99E0110 +:101D100040913C0260913B02852B0E948D0903C0DB +:101D2000198218821A820F5F1F4F23960530110502 +:101D300091F60E94570A8091000190917201980FCC +:101D40009093720120910101280F20930101121636 +:101D500014F494301CF0819580930001DF91CF91B1 +:101D60001F910F910895EF92FF920F931F93CF93BE +:101D7000DF9380917001909171010E944B1D883E0C +:101D80009340D0F10E943F1D9093710180937001A8 +:101D9000C0916E01D0916F012196C170DD27D09363 +:101DA0006F01C0936E018EE3E82E82E0F82E10E002 +:101DB00008E7812F8695FE01E80FF11DCF018170A4 +:101DC0009927970140913C0260913B02FC010E9FD4 +:101DD000C0010F9F900D11240E948D091F5FF3E039 +:101DE000EF0EF11C153029F7DF91CF911F910F9164 +:101DF000FF90EF900C94570ADF91CF911F910F91B4 +:101E0000FF90EF900895CF93DF9300D01F92CDB74E +:101E1000DEB780916C0190916D010E944B1DE0E84E +:101E2000F2E02591349182179307C0F180916B0104 +:101E300081110CC09E012F5F3F4F4FEF6FEF80E08D +:101E400090E00E948D098A8180936B010E943F1D62 +:101E500090936D0180936C0180916A01813051F003 +:101E600028F0823061F440916B010AC080916B01CF +:101E700040E007C060916B0140E080E003C040E0BB +:101E800080E060E00E946C0A80916A0190E0019617 +:101E900063E070E00E94CF2B80936A010F900F9057 +:101EA0000F90DF91CF910895CF93DF9380916801D8 +:101EB000909169010E944B1D843F914008F444C0F9 +:101EC0000E943F1D9093690180936801C0E0D0E0BB +:101ED00020916601309167018091390290913A0218 +:101EE000C230D1051CF4232B79F002C0232B61F4FE +:101EF000881F8827881F392F330F97FB992790F960 +:101F00002C2F40913C020AC0881F8827881F392F38 +:101F1000330F97FB992790F92C2F40E060913B02FB +:101F2000832B0E94A40C2196C530D10589F60E940E +:101F3000570A8091660190916701019681709927F7 +:101F40009093670180936601DF91CF91089580910E +:101F500083018823D9F190913902892F86958F7357 +:101F60002EE3280F2F73243018F482500C94E10CC8 +:101F70002AE3280F2F73233018F486500C94380D61 +:101F800027E3280F2F73263018F489500C94680D1E +:101F900021E3280F2F73263018F48F500C94C00DB6 +:101FA0002BE2280F2F73233018F485510C94430E25 +:101FB000892F8E77803311F40C94B30E863411F48C +:101FC0000C94030F883411F40C94540F089521B32A +:101FD000342F3095232331B3432B3FB7F894FC01C2 +:101FE000680F791FE617F70789F0819198E041BBE8 +:101FF000000000C087FF21BB880F000000C000C0A8 +:1020000000C021BB00C09A9591F7ECCF3FBF089567 +:1020100020B3242B20BB9B01220F331F620F731FA1 +:102020000E94E70F87EC90E00197F1F700C00000F5 +:10203000089540E10C9408109093890180938801E1 +:102040000895E0918801F0918901309721F0019085 +:10205000F081E02D099480E00895E0918801F091ED +:102060008901309721F00280F381E02D09940895D1 +:10207000E0918801F0918901309721F00480F58189 +:10208000E02D099408952091860130918701281749 +:10209000390771F09093870180938601E091880160 +:1020A000F0918901309721F00680F781E02D0994A5 +:1020B000089520918401309185012817390771F026 +:1020C0009093850180938401E0918801F0918901CA +:1020D000309721F00084F185E02D0994089508954A +:1020E0000C946F1081E008950E94361D85B78068BA +:1020F00085BF85B7806885BF0E9465080E94F81D6E +:102100000C945E0C5F926F927F928F929F92AF922F +:10211000BF92CF92DF92EF92FF920F931F93CF93D4 +:10212000DF93CDB7DEB72A970FB6F894DEBF0FBEA8 +:10213000CDBF0E94BF080E947210811111C08FEFA5 +:1021400089838A831B820E943F1D8160782F9D8333 +:102150008C8349815A816B818D810E943F1156C0C9 +:102160009BE8692E91E0792E00E010E088248394AA +:10217000912C502E802F0E9483096C01F301A190B5 +:10218000B1903F01A826B926A114B10431F40F5F24 +:102190001F4F0330110569F7D2CF80910B0281FDEB +:1021A0000E948C0980E090E07401082E02C0EE0CC1 +:1021B000FF1C0A94E2F795012E213F21232B09F100 +:1021C0008E835F82CE20DF2081E0CD2809F480E07D +:1021D00088870E943F1D8160782F9A8789874E816A +:1021E0005F8168858A850E943F11000F111FF801E9 +:1021F000E557FE4F80819181E826F926F182E08241 +:1022000005C001968A30910579F6C1CF0E949B20C6 +:102210000E94211090918A018917D9F00E94211003 +:1022200080938A012A960FB6F894DEBF0FBECDBF09 +:10223000DF91CF911F910F91FF90EF90DF90CF90A2 +:10224000BF90AF909F908F907F906F905F900C9415 +:10225000F7022A960FB6F894DEBF0FBECDBFDF910E +:10226000CF911F910F91FF90EF90DF90CF90BF9093 +:10227000AF909F908F907F906F905F900895CF93D5 +:10228000DF93CDB7DEB72B970FB6F894DEBF0FBE46 +:10229000CDBF4F83588769877A878B87DE01119678 +:1022A00086E0FD0111928A95E9F785E0FE013796F7 +:1022B00001900D928A95E1F749815A816B817C8169 +:1022C0008D819E810E9456182B960FB6F894DEBF22 +:1022D0000FBECDBFDF91CF910895FC018081918128 +:1022E0000E94251B0895882309F4F8C08238C1F4A0 +:1022F0000E94211081FDF2C069E380910D0190914F +:102300000E010E94971C0E94841B2FEF81EE94E027 +:10231000215080409040E1F700C0000069E319C0FF +:102320008338F9F40E94211080FDD8C063E58091C4 +:102330000D0190910E010E94971C0E94841B2FEFAB +:1023400081EE94E0215080409040E1F700C0000011 +:1023500063E580910D0190910E010E94A21C0C94E6 +:10236000841B8438C1F40E94211082FDB7C067E449 +:1023700080910D0190910E010E94971C0E94841B78 +:102380002FEF81EE94E0215080409040E1F700C0B3 +:10239000000067E4DECF9CEF980F913A40F4682F7D +:1023A00080910D0190910E010E94971CD8CF90E270 +:1023B000980F983050F4877091E001C0990F8A957A +:1023C000EAF7892F0E94BA1BCACF9BE5980F93307A +:1023D00070F4853A29F0863A31F083E890E005C040 +:1023E00081E890E002C082E890E00C94431098E508 +:1023F000980F953108F06EC0883A61F1893A69F119 +:102400008A3A71F18B3A79F18C3A81F18B3B89F1FF +:102410008C3B91F18D3A99F1803BA1F18E3AA9F173 +:102420008F3AB1F1813BB9F1823BC1F1833BC9F1F4 +:10243000843BD1F1853BD9F1863BE1F1873BE9F162 +:10244000883BF1F1893BF9F18A3B09F43FC080E018 +:1024500090E03EC082EE90E03BC089EE90E038C054 +:102460008AEE90E035C085EB90E032C086EB90E0DC +:102470002FC083EB90E02CC084EB90E029C087EB69 +:1024800090E026C08CEC90E023C08DEC90E020C062 +:1024900083E891E01DC08AE891E01AC082E991E0EA +:1024A00017C084E991E014C081E292E011C083E298 +:1024B00092E00EC084E292E00BC085E292E008C098 +:1024C00086E292E005C087E292E002C08AE292E0F2 +:1024D0000C945910803F10F00C94A31F089588238A +:1024E00009F462C0823879F40E94211081FF5CC037 +:1024F00069E380910D0190910E010E94971C0E944A +:10250000841B69E310C08338B1F40E94211080FF5E +:102510004BC063E580910D0190910E010E94971CC4 +:102520000E94841B63E580910D0190910E010E9431 +:10253000A21C0C94841B843879F40E94211082FF21 +:1025400033C067E480910D0190910E010E94971CA9 +:102550000E94841B67E4E7CF9CEF980F913A10F438 +:10256000682FE1CF90E2980F983050F4877091E097 +:1025700001C0990F8A95EAF7892F0E94C01BD9CF15 +:102580009BE5980F933020F480E090E00C9443108A +:1025900098E5980F953120F480E090E00C94591064 +:1025A000803F10F00C940B200895882321F00E94A6 +:1025B000BA1B0C94841B0895882321F00E94C01B31 +:1025C0000C94841B08958F929F92AF92BF92DF92DA +:1025D000EF92FF920F931F93CF93DF937C01D62F3F +:1025E000C72FFC01058102950F70128111110E9405 +:1025F000D71B0E947D1B882379F0112369F080E2AC +:102600008D0F883048F082E00E94661B0E947D1B7F +:1026100091E0D82ED92601C0D12CBC2EB2948FE0E7 +:10262000B8228B2D90E0FC01E859FF4F0C94E32B6E +:102630008C2F807FCF70882311F0C295C07F11232B +:1026400099F0CC2309F4C3C180E28D0F883010F0DB +:10265000D11104C08C2F0E94BA1B03C08C2F0E9482 +:10266000CA1B0E94841BB3C18D2F0E946F12CC2302 +:1026700009F4D2C180E28D0F883010F0D11104C06E +:102680008C2F0E94C01B03C08C2F0E94D01B0E9465 +:10269000841BC2C18C2F807FCF70803211F0C29515 +:1026A000C07FDD2319F0D130C9F022C0112371F0B1 +:1026B000002341F0013031F40E94F01B8C2B0E946A +:1026C000EA1BAAC10E94F01B8C2B3AC1002319F00F +:1026D000013009F4A1C10E94ED1B18C0112321F0A3 +:1026E000063008F099C10EC0053008F095C10EC043 +:1026F000112351F0002331F0F701858180FF67C17C +:102700008F7085838C2F1CC1011172C18C2F1EC14B +:102710008C2F86958695837019F0813061F07CC18D +:10272000112321F08D2F9C2F937002C080E090E048 +:102730000E9443107EC1112321F08D2F9C2F937096 +:1027400002C080E090E00E94591073C11123F9F09B +:10275000D53F51F0D63F71F0D43FA9F480914D029E +:1027600090914E0281600BC080914D0290914E027B +:10277000826005C080914D0290914E0284609093DA +:102780004E0280934D028D2F0E94A31F1EC0D53F85 +:1027900051F0D63F71F0D43FA9F480914D02909151 +:1027A0004E028E7F0BC080914D0290914E028D7F24 +:1027B00005C080914D0290914E028B7F90934E0206 +:1027C00080934D028D2F0E940B200E94902031C1DA +:1027D0008C2F837009F04CC0111127C12D2F229529 +:1027E00026952770220F220F6D2F6F70862F90E095 +:1027F000A0E0B0E04C015D01022E04C0880C991CE1 +:10280000AA1CBB1C0A94D2F7D4FF12C08FE090E040 +:10281000A0E0B0E004C0880F991FAA1FBB1F2A9533 +:10282000D2F7BC01CD01609570958095909503C05D +:1028300060E070E0CB01C695C695C370C23051F020 +:1028400080F4682979298A299B29C13071F00E9476 +:10285000A519EBC0682979298A299B290E94B719F3 +:10286000E4C00E94A519C501B4010E949319DDC0FE +:10287000112319F08C2F817001C08695882309F4EB +:10288000D4C02D2F229526952770220F220F6D2F51 +:102890006F70862F90E0A0E0B0E04C015D01022E49 +:1028A00004C0880C991CAA1CBB1C0A94D2F7D4FF44 +:1028B00012C08FE090E0A0E0B0E004C0880F991F44 +:1028C000AA1FBB1F2A95D2F7BC01CD016095709558 +:1028D0008095909503C060E070E0CB01C695C695E9 +:1028E000C370C23051F080F4682979298A299B2964 +:1028F000C13071F00E946A1A98C0682979298A2922 +:102900009B290E947C1A91C00E946A1AC501B401D9 +:102910000E94581A8AC08D2F90E0FC01E05EF109F8 +:10292000E531F10508F04FC0E858FF4F0C94E32B58 +:10293000DF708C2F8F71112331F00E94F1198D2FD0 +:102940000E94D51269C00E94121A8D2F0E94DC12BB +:1029500063C0112341F0053008F05EC08C2F8F71E9 +:102960000E94371A59C0063008F056C0F7CF11231D +:1029700039F08C2F8F710E94F1194EC01123C9F3C9 +:102980008C2F8F710E94121A47C0112329F08C2FAF +:102990008F710E94DC1940C00E94D7193DC01123DD +:1029A00049F0CF718C2F0E94F11963E08C2F0E94A7 +:1029B0005D1B32C081E00E94661B023068F182E03C +:1029C0000E94661B29C0112331F0002391F28D2F44 +:1029D0000E94731121C0002399F2D93349F4FFEF0B +:1029E00027EE83E0F15020408040E1F700C0000076 +:1029F0008D2F0E946F1210C04C2F4F706D2FC7018A +:102A00000E94AF050E94041914C04C2F4F706D2F07 +:102A1000C7010E94B2050DC098E0B91631F0B91691 +:102A200040F086EF8B0D823020F40E9421100E942E +:102A3000F702DD20E1F00E94591B80FD18C0F7016C +:102A400012820E94531B0E94F119C7010E94431574 +:102A50000E94531BDF91CF911F910F91FF90EF9038 +:102A6000DF90BF90AF909F908F900C94121ADF91DF +:102A7000CF911F910F91FF90EF90DF90BF90AF909B +:102A80009F908F9008950F931F93CF93DF93EC0146 +:102A9000988189812B813C81232B31F08F3F31F448 +:102AA00081E09F3F19F403C081E001C080E080FD18 +:102AB00013C0CE010E940F03882371F068817981D1 +:102AC0008A810E94301B8C010E948E1A0E948119FB +:102AD000B801CE010E94E312DF91CF911F910F91B7 +:102AE00008950E94D71B0E94E71B80910D019091D1 +:102AF0000E010E94AD1C0E94841B0E9432210E9484 +:102B0000902080E090E00E94431080E090E00C94E0 +:102B100059100E94C71B0C9471150E94251BE92FA8 +:102B2000E295EF704E2F50E0FA013297EE30F1054A +:102B3000B0F4E357FF4F0C94E32B803F91F018F46F +:102B4000803E68F40EC0843F51F40BC0803E48F0D4 +:102B5000813F29F406C093FB882780F9089580E01F +:102B6000089581E00895CF93DF9300D000D01F92A5 +:102B7000CDB7DEB70F900F900F900F900F90DF91B1 +:102B8000CF910895CF93DF9300D000D000D0CDB780 +:102B9000DEB726960FB6F894DEBF0FBECDBFDF912D +:102BA000CF9108951F93CF93DF93C091920116E0C8 +:102BB00080919301C81799F0D0E01C9FF0011D9FF0 +:102BC000F00D1124EC56FE4F4081518162817381DA +:102BD000848195810E94C2152196C770E9CFDF914B +:102BE000CF911F9108954091C4015091C50160910A +:102BF000C6017091C7018091C8019091C9010C94E0 +:102C0000C215CF938091C90182958F7009F05FC082 +:102C10008091C601882309F45AC080919201B09135 +:102C200093017091C401A091C5014091C7015091D9 +:102C3000C80191E07F3F09F090E0692FC6E08B1753 +:102C400009F445C04115510521F0AF3F21F020E0C6 +:102C500003C021E001C0262F90E020FD35C0C89FB1 +:102C6000F001C99FF00D1124EC56FE4F21812A136B +:102C70002BC02081271328C02281211125C0238148 +:102C800034812417350710F421503109241B350BEA +:102C9000283C3105C8F42091C9012F702061209390 +:102CA000C90126E0289FF001299FF00D1124E75665 +:102CB000FE4F80818F708061808384EC91E00E9460 +:102CC0004315CF910C94D21501968770B8CFCF9150 +:102CD0000895AF92BF92CF92DF92EF92FF920F933F +:102CE0001F93CF93DF93CDB7DEB761970FB6F894FC +:102CF000DEBF0FBECDBF8C0185E0F801DE011D9661 +:102D000001900D928A95E1F7D8014C9111965C9152 +:102D100011971296EC903091C4016091C501809199 +:102D2000C7019091C801009731F06F3F31F421E065 +:102D30003F3F19F403C021E001C020E0B22FB17081 +:102D4000BB2E20FD60C1F801C380D480A090C601D5 +:102D5000AA2009F4EEC02091C901C816D90628F0AE +:102D6000D601A81BB90BCD0104C0809590958C0DA0 +:102D70009D1DFF24F394883C910580F0F12C207F69 +:102D800009F09CC07C2DD98AC88A6E2D89890E9441 +:102D9000B31584EC91E00E9443152DC1822F807FF2 +:102DA00009F054C0561314C0431312C0FE2CE11096 +:102DB0000FC02F7020612093C9010E94F31584EC8D +:102DC00091E00E9443158091C901F80185835CC19F +:102DD000CD2831F05F3F31F481E04F3F19F403C05B +:102DE00081E001C080E080FD03C081E08E2502C04B +:102DF00080E090E0F82FF170FF2E80FF1CC08091E2 +:102E000092012091930136E0821709F41AC190E0F3 +:102E1000389FF001399FF00D1124EC56FE4F61816F +:102E2000561306C06081461303C06281E61203C0D8 +:102E300001968770E9CFFE2CEE2009F425C1809120 +:102E4000C90181608093C901F12C1EC1561309C0CC +:102E5000431307C0E11005C08091C901F8018583C3 +:102E6000A4C04D875E878D859E850E948D15882321 +:102E700079F1EE2069F12091C901822F82958F703E +:102E800090E0029774F08091C4019091C5019887F9 +:102E90008F831986DB86CA862C87CE0107960E940F +:102EA000431586E0F801A4ECB1E001900D928A95FB +:102EB000E1F70E9401160E94F3150DC0561771F03C +:102EC0004D875E878D859E850E948D1581111AC064 +:102ED000C8010E944315FF24F394D6C04313F0CFDA +:102EE000E110EECF8091C901F8018583C8010E94ED +:102EF000431586E0E4ECF1E0DF011D928A95E9F7E5 +:102F0000FA2CC2C0EE2021F32091C901822F8295B4 +:102F10008F7090E002972CF28091C4019091C501CE +:102F20009A8389831B82DD82CC822E83CE01019617 +:102F3000B6CFC816D90628F0F601E81BF90BCF0169 +:102F400004C0809590958C0D9D1D883C910548F09E +:102F5000F12C7C2DD98AC88A6E2D89890E94B315DF +:102F60004AC0FE2CEE2009F4B3CF561333C04313EE +:102F700031C02091C90120FD24C0822F82958F701D +:102F8000482F50E041155105E1F0D80115962C93DA +:102F900015974F30510549F08F5F982F9295907F8C +:102FA000822F8F70892B15968C93C8010E94431530 +:102FB00086E0F801A4ECB1E001900D928A95E1F76A +:102FC0003DC086E0F801A4ECB1E001900D928A9535 +:102FD000E1F75AC04D875E878D859E850E948D15CD +:102FE00081115FCF8091C90181608093C901C801BF +:102FF0000E94431549C0E4ECF1E086E0DF011D9238 +:103000008A95E9F71BC0EE2009F462CF4D875E87F1 +:103010008D859E850E948D15F82E882309F458CF42 +:1030200086E0F801A4ECB1E001900D928A95E1F7F9 +:1030300084EC91E00E946D110E9401160E94F3152C +:1030400023C04D875E878D859E850E94251B292F75 +:1030500022952F70223028F49F7039F0811105C01D +:103060000BC0243028F49F7049F4805E883020F033 +:10307000C8010E944315BF2CFB2C06C0D801159631 +:103080009C91907F91F7F8CF8F2D61960FB6F894B1 +:10309000DEBF0FBECDBFDF91CF911F910F91FF908B +:1030A000EF90DF90CF90BF90AF9008951F93CF9394 +:1030B000DF93CDB7DEB72C970FB6F894DEBF0FBE07 +:1030C000CDBF4F83588769877A878B879C87CE01CE +:1030D00007960E9469168823D1F09F8188852A85EA +:1030E0003B85232B31F08F3F31F481E09F3F19F472 +:1030F00003C081E001C080E080FD47C04F8158855A +:1031000069857A858B859C850E94C2153EC086E0C4 +:10311000FE013796DE01119601900D928A95E1F736 +:10312000FF81E8856A857B856115710531F0EF3F88 +:1031300031F481E0FF3F19F403C081E001C080E079 +:1031400080FD23C02091930130E0C9010196877072 +:1031500099274091920150E084179507F1F1F98386 +:10316000EA837D836C8396E0929FD001939FB00D9C +:103170001124AC56BE4FFE01319601900D929A95E6 +:10318000E1F7809393010E94D21516E0809192019D +:1031900090919301891771F1189FC00111248C56E9 +:1031A0009E4F0E946916882329F1E09192011E9F8B +:1031B000F0011124EC56FE4F4081518162817381F0 +:1031C000848195810E94C2158091920190E00196C0 +:1031D0008770992780939201D9CF0E948915109208 +:1031E000930110929201E4ECF1E086E0DF011D9280 +:1031F0008A95E9F72C960FB6F894DEBF0FBECDBFC7 +:10320000DF91CF911F910895EF92FF920F931F933B +:10321000CF93DF938C01892B09F46CC0F12CEE2441 +:10322000E394E8012196F8018491843740F48430D6 +:1032300008F051C0813081F0823019F15BC08537D0 +:1032400009F444C0A8F19CE7980F903708F052C0E9 +:103250008F770E946F1241C00E5F1F4FFE01849155 +:1032600090E2980F983050F48770FE2D01C0FF0F48 +:103270008A95EAF78F2F0E94DA1B14C00E947311FF +:103280002DC00E5F1F4FFE01849190E2980F983081 +:1032900060F48770FE2D01C0FF0F8A95EAF78F2F2B +:1032A0000E94E01B0E94841B19C00E946F1216C06E +:1032B0000E5F1F4FFE01C491CC2381F08FE99FE088 +:1032C0000197F1F700C00000C150F6CF0E5F1F4F0D +:1032D000FE01F49003C00E9473118E018F2D88238C +:1032E00009F49FCFEFE9FFE03197F1F700C000004C +:1032F0008150F5CFDF91CF911F910F91FF90EF900B +:103300000895089508950C9482190E94831960937A +:10331000E2017093E3018093E4019093E5010C9442 +:1033200071150C9485190F931F930091E201109170 +:10333000E3012091E4013091E501602B712B822B98 +:10334000932B1F910F910C9485190F931F9300914C +:10335000E2011091E3012091E4013091E501602345 +:103360007123822393231F910F910C9485190F933E +:103370001F930091E2011091E3012091E40130914B +:10338000E50160277127822793271F910F910C94E5 +:1033900085190C9482190E94C9196093DE017093FB +:1033A000DF018093E0019093E1010C94711560E0DE +:1033B00070E0CB010C94CB190F931F9341E050E0C8 +:1033C00060E070E08A019B0104C0000F111F221F02 +:1033D000331F8A95D2F7C901B8011F910F910C9440 +:1033E000CB190F931F9341E050E060E070E004C000 +:1033F000440F551F661F771F8A95D2F78091DE0113 +:103400009091DF01A091E001B091E1018A019B015F +:10341000082B192B2A2B3B2BC901B8011F910F91A7 +:103420000C94CB190F931F9341E050E060E070E0E3 +:1034300004C0440F551F661F771F8A95D2F7409529 +:103440005095609570958091DE019091DF01A0917B +:10345000E001B091E1018A019B01082319232A238D +:103460003B23C901B8011F910F910C94CB190F9305 +:103470001F9341E050E060E070E004C0440F551F2E +:10348000661F771F8A95D2F78091DE019091DF0148 +:10349000A091E001B091E1018A019B010827192761 +:1034A0002A273B27C901B8011F910F910C94CB1912 +:1034B0000F931F930091DE011091DF012091E00135 +:1034C0003091E101602B712B822B932B1F910F9177 +:1034D0000C94CB190F931F930091DE011091DF0123 +:1034E0002091E0013091E101602371238223932335 +:1034F0001F910F910C94CB190F931F930091DE0134 +:103500001091DF012091E0013091E10160277127E6 +:10351000822793271F910F910C94CB1908952AE0CD +:10352000929F800D1124E82FE695E695E695877029 +:1035300051E001C0550F8A95EAF785E0E89FF00158 +:103540001124E653FE4F20E030E070E04081CB01D3 +:10355000022E02C0969587950A94E2F781708195B4 +:1035600084278523842781932F5F3F4F25303105A2 +:1035700069F708952AE0929F800D1124682F6695BF +:1035800066956695982F977085E0689FB001112425 +:1035900040E050E080E0FB01E40FF51FE653FE4FF2 +:1035A000208130E0092E02C0369527950A94E2F773 +:1035B00021703327042E01C0220F0A94EAF7822BD0 +:1035C0004F5F5F4F4530510531F70895CF92DF923D +:1035D000EF92FF920F931F93CF93DF938C01C090D4 +:1035E000DE01D090DF01E090E001F090E1018091F8 +:1035F000E2019091E301A091E401B091E501C82AB4 +:10360000D92AEA2AFB2ACFE1D0E0D701C6010C2E45 +:1036100004C0B695A795979587950A94D2F780FD33 +:1036200004C0219790F780E007C0B8018C2F0E945A +:10363000CE050197B1F38C2FDF91CF911F910F91A0 +:10364000FF90EF90DF90CF900895CF93DF93EC0140 +:103650000E94E61ABE010E94CE05DF91CF91089527 +:103660001F93CF93DF93EB0190919101992321F068 +:10367000CB010E94251B13C0882349F0CB010E9477 +:10368000E61A182F682FCE010E948F1A04C0CB01B2 +:103690000E94BA1A182FBE01812F0E94CE05DF9119 +:1036A000CF911F9108958091E60185958595859527 +:1036B00008958091E6018770089598E0899F9001B0 +:1036C0001124262B2093E6010C94F1192091E60198 +:1036D000809582238093E601982F977069F430E0FB +:1036E000482F082E000C550B2417350729F0859517 +:1036F000859585950C94121A08959091E60197701E +:1037000081E009F480E00895E0910D01F0910E014F +:1037100080910A028083E0910D01F0910E01908169 +:1037200080910902892B8083E0910D01F0910E01B7 +:10373000908180910802892B80838091E701882302 +:1037400081F0E0910D01F0910E019081892B808331 +:1037500080910D0190910E010E943A1C81111092EE +:10376000E70180910D0190910E010C942D10809134 +:103770000A02089590910A02892B80930A02089503 +:10378000809590910A02892380930A0208951092ED +:103790000A02089590910902892B809309020895E5 +:1037A00080959091090289238093090208951092CF +:1037B0000902089590910802892B809308020895C8 +:1037C00080959091080289238093080208951092B1 +:1037D000080208958093E70108951092E701089583 +:1037E0008091E70108956DEE7EEF80E090E00E9409 +:1037F000282C60E082E090E00E940A2C60E083E0E8 +:1038000090E00E940A2C60E084E090E00E940A2C84 +:1038100060E085E090E00E940A2C40E050E0BA01B0 +:1038200088E090E00C941C2C80E090E00E94042C36 +:1038300021E08D3E9E4F09F020E0822F089582E026 +:1038400090E00C94F62B682F82E090E00C940A2C08 +:1038500083E090E00C94F62B682F83E090E00C94CA +:103860000A2C84E090E00C94F62B682F84E090E022 +:103870000C940A2CFC0131969C01205E3F4F80E0A5 +:10388000919191118F5FE217F307D1F708959C0191 +:10389000FC0132969FEF80E04191461789F09F3FEF +:1038A00019F4411101C0982F8F5F8E31A9F79F3F06 +:1038B00039F0F901E90FF11D97FDFA95628308953A +:1038C00008959C01225E3F4FFC014281461301C0D6 +:1038D0001282019682179307B9F70895262F26952D +:1038E000269526952F3169F0FC01E20FF11D6770D6 +:1038F00021E030E001C0220F6A95EAF78181282B90 +:1039000021830895262F2695269526952F3171F02F +:10391000FC01E20FF11D677021E030E001C0220FD1 +:103920006A95EAF7209581812823218308952091C3 +:103930001F01222329F02091530227FD0C946E1CB5 +:103940000C94471C20911F01222329F0209153023F +:1039500027FD0C94821C0C94611CFC01319680960E +:103960001192E817F907E1F7089508950C94B51C32 +:103970000C94B51CCF930E94B81C0E94BF080E94F3 +:10398000B61CC0E08C2F0E948309892B29F4CF5FDD +:10399000C330C1F780E001C081E0CF9108950C945D +:1039A000B51C0C94CF1C0E94D11C8091590284300C +:1039B00049F110920C0220E488E190E00FB6F894EF +:1039C000A895809360000FBE2093600080E00E9465 +:1039D000F7020E94D11C83B7817F846083BF83B7C5 +:1039E000816083BF7894889583B78E7F83BF0FB63D +:1039F000F894A8958091600088618093600010928F +:103A000060000FBE08950C94B51C0E9489150E9499 +:103A100021100E94F7020C94031D1F920F920FB603 +:103A20000F9211248F939F93AF93BF9380910C02B9 +:103A3000811113C080914F0290915002A0915102C8 +:103A4000B09152024196A11DB11D80934F029093F7 +:103A50005002A0935102B0935202BF91AF919F9137 +:103A60008F910F900FBE0F901F90189582E084BD2C +:103A700093E095BD9AEF97BD80936E0008952FB7A0 +:103A8000F89480914F0290915002A0915102B09110 +:103A900052022FBF0895CF92DF92EF92FF920F93C1 +:103AA0001F932FB7F89440914F02509150026091AC +:103AB0005102709152022FBF6A017B01EE24FF2454 +:103AC0008C0120E030E0C016D106E206F30610F4C7 +:103AD000415051099A01281B390BC9011F910F91BF +:103AE000FF90EF90DF90CF90089578941F920F92FF +:103AF0000FB60F9211248F939F93AF93BF93809132 +:103B00004F0290915002A0915102B0915202019641 +:103B1000A11DB11D80934F0290935002A0935102BA +:103B2000B0935202BF91AF919F918F910F900FBEB2 +:103B30000F901F90189587E797E79093010880935F +:103B400000089AE088E10FB6F894A8958093600089 +:103B50000FBE90936000FFCFAF92BF92CF92DF92E3 +:103B6000EF92FF920F931F93CF93C0E0CC24C394A6 +:103B7000D12CE82EF12C8C2F0E9483095C0100E0EF +:103B800010E0C601002E02C0880F991F0A94E2F7C8 +:103B90008A219B21892B31F40F5F1F4F0A301105B9 +:103BA00081F70AC0602F7C2F80E00E94B305E816E1 +:103BB000F90691F781E004C0CF5FC330E1F680E001 +:103BC000CF911F910F91FF90EF90DF90CF90BF901A +:103BD000AF900895CF93C82F8CE20E94AC1D88232C +:103BE00021F08C2FCF910C94AC1D80E0CF910895E3 +:103BF000CF930E94141C811102C00E94F31BC5E6E2 +:103C0000C15049F00E94BF088FE39CE90197F1F78A +:103C100000C00000F5CF89E20E94EA1D81110FC1AA +:103C20008AE20E94EA1D81110E94F31B85E00E9436 +:103C3000EA1D81110E949B1D0E941F1C80930B0294 +:103C400087E00E94EA1D8823A9F18BE10E94EA1D0A +:103C5000882351F080910B0281FB222720F991E00B +:103C6000922790FB81F90EC08EE00E94EA1D882306 +:103C700061F080910B0282FB222720F991E09227CC +:103C800090FB82F980930B0215C080E10E94EA1D2F +:103C900090910B02882341F093FB222720F981E0C9 +:103CA000822780FB93F904C0892F809580FB90F9CF +:103CB00090930B0280910B020E94231C0E94311CE6 +:103CC00090E0909354028093530280EE0E94EA1D8C +:103CD000882341F080915302982F909590FB80F9B2 +:103CE0008093530289E30E94EA1D882359F0809152 +:103CF000530281FB222720F991E0922790FB81F962 +:103D00008093530282EE0E94EA1D882359F080912D +:103D1000530282FB222720F991E0922790FB82F93F +:103D20008093530286EE0E94EA1D882359F0809109 +:103D3000530283FB222720F991E0922790FB83F91D +:103D40008093530283EE0E94EA1D882359F08091EC +:103D5000530284FB222720F991E0922790FB84F9FB +:103D60008093530285E30E94EA1D882359F08091D5 +:103D7000530285FB222720F991E0922790FB85F9D9 +:103D80008093530281E30E94EA1D882359F08091B9 +:103D9000530286FB222720F991E0922790FB86F9B7 +:103DA0008093530281E10E94EA1D882359F080919B +:103DB000530287FB222720F991E0922790FB87F995 +:103DC00080935302809153020E94351C87E20E9427 +:103DD000EA1DC82F8EE10E94EA1D8111C2608FE1A9 +:103DE0000E94EA1D8111C46080E20E94EA1D8111D7 +:103DF000C86081E20E94EA1D8111C06182E20E94D6 +:103E0000EA1D8111C06283E20E94EA1D8111C06433 +:103E100084E20E94EA1D882311F0C06802C0CC230E +:103E200029F08C2F0E942C1C6C2F03C00E94281C90 +:103E3000682F70E080E090E0CF910C949119CF91C1 +:103E4000089580910F0280FF0BC06091120185E000 +:103E5000689FB001112475956795759567952BC07E +:103E600081FF09C06091120185E0689FB0011124B3 +:103E70007595679520C082FF07C06091120185E0AB +:103E8000689FB001112417C0909110029923D1F0BE +:103E900060911101961788F72091120185E0289F03 +:103EA00090011124929FA001939F500D112470E066 +:103EB000CA010E94CF2B6038710540F4611571056D +:103EC00019F406C065E070E0862F08958FE7089525 +:103ED00081E0089580910F0280FF08C06091100179 +:103EE00070E0759567957595679521C081FF06C04F +:103EF0006091100170E07595679519C082FF04C04C +:103F00006091100170E010C090911002992399F017 +:103F100060910F019617A0F780911001899FC00151 +:103F2000112470E00E94CF2B6038710540F46115B8 +:103F3000710519F406C061E070E0862F08958FE7DF +:103F4000089581E00895803F21F40E94211F81950A +:103F500004C0813F29F40E94211F80931302089519 +:103F6000823F21F40E94211F819504C0833F29F4E0 +:103F70000E94211F809312020895893F19F40E9424 +:103F80006A1F05C08A3F31F40E946A1F81958093A1 +:103F9000140208958B3F21F40E946A1F819504C08A +:103FA0008C3F29F40E946A1F809315020895843F74 +:103FB00021F480911102816017C0853F21F4809126 +:103FC0001102826011C0863F21F480911102846049 +:103FD0000BC0873F21F480911102886005C0883FA3 +:103FE00031F48091110280618093110208958D3F18 +:103FF00021F480910F0281600BC08E3F21F48091EB +:104000000F02826005C08F3F29F480910F02846007 +:1040100080930F020895803F39F48091130287FF47 +:104020006CC01092130269C0813F29F48091130281 +:104030001816BCF362C090911202823F29F497FFD8 +:104040005CC01092120259C0833F19F41916CCF3C8 +:1040500054C0893F41F48091140218160CF04DC0F1 +:10406000109214024AC08A3F29F48091140287FFFB +:1040700044C0F6CF8B3F39F48091150287FF3DC0D5 +:10408000109215023AC08C3F29F48091150218163F +:10409000BCF333C0843F21F4809111028E7F17C09E +:1040A000853F21F4809111028D7F11C0863F21F45C +:1040B000809111028B7F0BC0873F21F48091110208 +:1040C000877F05C0883F31F4809111028F7E8093F5 +:1040D000110213C08D3F21F480910F028E7F0BC01F +:1040E0008E3F21F480910F028D7F05C08F3F29F410 +:1040F00080910F028B7F80930F02809112028111B9 +:104100000EC08091130281110AC0809114028111A6 +:1041100006C080911502811102C01092100208950C +:1041200081E192E00E9438100E943F1D90930E02A0 +:1041300080930D0208951F93CF93DF9380910D021A +:1041400090910E020E944B1DAC0190911002992398 +:1041500021F02091130130E006C0209114018AE083 +:10416000289F900111244217530708F477C08091CB +:104170001202C0911302D091140210911502811104 +:1041800007C0C11167C0D11165C0111163C066C0FD +:104190009F3F19F09F5F90931002181624F40E941D +:1041A000211F809312028091120287FF05C00E9496 +:1041B000211F8195809312021C1624F40E94211F56 +:1041C000809313028091130287FF05C00E94211F74 +:1041D000819580931302309112023323C1F0209114 +:1041E00013022223A1F045EB3403C0011124892FCF +:1041F000911101C081E08093120235EB2303C001CD +:104200001124892F911101C081E0809313021D16A2 +:1042100024F40E946A1F809314028091140287FF85 +:1042200005C00E946A1F819580931402111624F420 +:104230000E946A1F809315028091150287FF05C0B6 +:104240000E946A1F819580931502DF91CF911F9183 +:104250000C9490209F3F09F09DCFAECFDF91CF917E +:104260001F910895E1E1F2E085E0DF011D928A955A +:10427000E9F71092100210920F0208958091360211 +:1042800008950F931F93CF93DF9300D01F92CDB764 +:10429000DEB78C010E94B723823011F0843019F50B +:1042A00083E089831B830A838093E9008FEF9091D9 +:1042B000E800815095FD06C095ED9A95F1F7000054 +:1042C0008111F5CF8091E80085FF0DC040E050E0FE +:1042D00063E070E0CE0101960E94D4238091E80053 +:1042E0008E778093E8000F900F900F90DF91CF9121 +:1042F0001F910F910895CF93DF9300D01F92CDB7F8 +:10430000DEB720915902243031F522E0298380580C +:1043100091099B838A8383E08093E9008FEF9091DA +:10432000E800815095FD06C095ED9A95F1F70000E3 +:104330008111F5CF8091E80085FF0DC040E050E08D +:1043400063E070E0CE0101960E94D4238091E800E2 +:104350008E778093E8000F900F900F90DF91CF91B0 +:104360000895CF93DF93EC010E94B723823011F0C0 +:104370008430F9F482E08093E9008FEF9091E800B7 +:10438000815095FD06C095ED9A95F1F700008111D9 +:10439000F5CF8091E80085FF0CC040E050E065E07B +:1043A00070E0CE010E94D4238091E8008E77809344 +:1043B000E800DF91CF910895CF93DF93EC010E9445 +:1043C000B723823019F0843009F047C080911F0173 +:1043D0008823E1F08091530287FF18C084E0809326 +:1043E000E9008FEF9091E800815095FD06C095E1BE +:1043F0009A95F1F700008111F5CF8091E80085FFD3 +:104400002CC040E050E060E270E017C081E0809393 +:10441000E9008FEF9091E800815095FD06C095ED81 +:104420009A95F1F700008111F5CF8091E80085FFA2 +:1044300014C040E050E068E070E0CE010E94D42358 +:104440008091E8008E778093E80080E2FE01A6E18B +:10445000B2E001900D928A95E1F7DF91CF91089536 +:1044600080915802811109C00E9465250E94C225D1 +:104470008091E20084608093E200089510925802D7 +:104480000895089508950C94051D42E061EC81E0C3 +:104490000E94DE2442E061EC82E00E94DE2442E0E1 +:1044A00061EC83E00E94DE2442E261EC84E00C9443 +:1044B000DE2480915B02833009F455C030F48130F2 +:1044C00071F0823009F48EC008958A3009F47AC000 +:1044D0008B3009F460C0893009F09CC020C0809105 +:1044E0005A02813A09F096C08091E800877F809354 +:1044F000E80080915E0290915F02892B21F460E2D6 +:1045000086E192E003C060E080E090E070E00E940D +:104510001F248091E8008B778093E80008958091B4 +:104520005A02813209F076C080915E0290915F025A +:10453000009719F0039709F06DC08091E800877F1C +:104540008093E8008091E80082FD05C080915902C7 +:104550008111F8CF5FC08091F10080933602809185 +:10456000E8008B7753C080915A02813A09F052C01B +:1045700080915E0290915F02892B09F04BC080917F +:10458000E800877F8093E8008091E80080FFFCCFFF +:1045900080911F0136C080915A028132D9F58091F5 +:1045A0005E0290915F02892BA9F58091E800877FD8 +:1045B0008093E8000E94132580915C0280931F0184 +:1045C0000C94891580915A02813221F58091E8007E +:1045D000877F8093E8000E94132580915D0280937D +:1045E0003702089580915A02813AA1F48091E8003F +:1045F000877F8093E8008091E80080FFFCCF809166 +:1046000037028093F1008091E8008E778093E80074 +:104610000C941325089584B7877F84BF0FB6F89450 +:10462000A89580916000886180936000109260007E +:104630000FBE80E880936100109261000E947010AC +:104640000E9465250E94C2258091E20084608093CB +:10465000E20078940E9457280E94741085E191E04E +:104660000E941C1080915902853069F40E94D31C6D +:10467000809157028823B1F30E94BA1C882391F3DA +:104680000E94BE23EFCF0E9482100E94A70FEACFA4 +:104690000C944A23292F332723303105C9F060F4C5 +:1046A0002130310581F02230310509F047C08DE617 +:1046B00090E022EC33E046C02132310511F1223284 +:1046C000310561F13BC082E190E02FE234E03AC075 +:1046D00099278130910561F040F08230910559F0C1 +:1046E000039761F5ECE9F3E008C0EEEBF3E005C0F9 +:1046F000E0EBF3E002C0E2EAF3E0849190E09F0196 +:1047000021C064307105D0F4660F771FFB01E75CB0 +:10471000FE4F2081318189E090E014C06430710542 +:1047200068F4FB01EE0FFF1FEF5CFE4F208131812B +:10473000FB01E35DFE4F808190E004C080E090E0EB +:1047400020E030E0FA013183208308950895CF936B +:10475000C82F0E94A623C0933802CF91089580915C +:104760005902843011F081E0089582E0089580912B +:104770003802811102C00C94AF23089580E189BDF5 +:1047800082E189BD09B400FEFDCF8091D8008F7D04 +:104790008093D8008091E00082608093E000809157 +:1047A000E00081FDFCCF0895CF92DF92EF92FF925F +:1047B0000F931F93CF93DF93EC018B017A010E943B +:1047C0003225811133C0E114F10439F0F701808101 +:1047D0009181081B190BC80FD91FC12CD12C0115B1 +:1047E000110519F18091E80085FD16C08091E8005F +:1047F0008E778093E800E114F10449F0F70180819D +:104800009181C80ED91ED182C08285E00FC00E945E +:104810003225882321F30AC089918093F100015049 +:104820001109FFEFCF1ADF0ADACF80E0DF91CF91D5 +:104830001F910F91FF90EF90DF90CF9008952091FE +:104840006002309161022617370748F06115710543 +:1048500039F42091E8002E772093E80001C0B901D7 +:10486000FC0120E06115710579F1809159028823DE +:10487000F1F18530F1F18091E80083FD3CC0809139 +:10488000E80082FD2EC08091E80080FFEBCF2091F0 +:10489000F3008091F20090E0922B6115710551F0C8 +:1048A0008830910538F421912093F100615071090D +:1048B0000196F3CF21E0089709F020E08091E8000D +:1048C0008E778093E800CECF2111CFCF0AC08091A0 +:1048D0005902882361F0853061F08091E80083FD02 +:1048E0000AC08091E80082FFF2CF80E0089582E064 +:1048F000089583E0089581E0089520916002309149 +:1049000061022617370748F06115710539F42091C7 +:10491000E8002E772093E80001C0B901FC0120E0F7 +:104920006115710591F180915902882309F440C005 +:10493000853009F43FC08091E80083FD3DC080913F +:10494000E80082FD2FC08091E80080FFE9CF209130 +:10495000F3008091F20090E0922B6115710559F0FF +:104960008830910540F424912093F10031966150F4 +:1049700071090196F2CF21E0089709F020E08091BB +:10498000E8008E778093E800CBCF2111CCCF0AC00E +:1049900080915902882361F0853061F08091E800B0 +:1049A00083FD0AC08091E80082FFF2CF80E0089585 +:1049B00082E0089583E0089581E00895982F97306C +:1049C00068F59093E900981739F07091EC00209108 +:1049D000ED005091F00003C0242F762F50E021FD10 +:1049E00002C09F5FECCF3091EB003E7F3093EB0035 +:1049F0003091ED003D7F3093ED003091EB00316060 +:104A00003093EB007093EC002093ED005093F00096 +:104A10002091EE0027FDE5CF80E008958F70809310 +:104A2000E90081E0089580915A0287FF11C08091CA +:104A3000E80082FD05C0809159028111F8CF11C0B4 +:104A40008091E8008B770BC080915902882349F050 +:104A50008091E80080FFF8CF8091E8008E77809306 +:104A6000E80008952091E4003091E50095E640913A +:104A7000EC00842F817040FF23C08091E80080FD0E +:104A80001DC080915902882399F0853099F080915A +:104A9000EB0085FD11C04091E4005091E500241722 +:104AA000350729F3915011F09A01E1CF84E0089580 +:104AB00082E0089583E0089581E0089580E00895FC +:104AC0004091E80042FFDDCF08950E94D3250E9467 +:104AD000DB25E0EEF0E0808181608083E8EDF0E0AE +:104AE00080818F77808319BCA7EDB0E08C918E7F99 +:104AF0008C9380818F7E80831092580208950F934B +:104B00001F93CF93DF930E94D3250E94DB25C8ED2E +:104B1000D0E088818F7788838881806888838881C6 +:104B20008F7D888319BC1092590210925502109201 +:104B300057021092560200EE10E0F80180818B7F40 +:104B4000808388818160888342E060E080E00E9409 +:104B5000DE24E1EEF0E080818E7F8083E2EEF0E003 +:104B6000808181608083808188608083F80180817A +:104B70008E7F8083888180618883DF91CF911F91B0 +:104B80000F910895E8EDF0E080818F7E8083E7ED5E +:104B9000F0E080818160808384E082BF81E0809347 +:104BA00058020C947F25E8EDF0E080818E7F8083B1 +:104BB0001092E20008951092DA001092E100089538 +:104BC0001F920F920FB60F9211242F933F934F9382 +:104BD0005F936F937F938F939F93AF93BF93EF9365 +:104BE000FF938091E10082FF0BC08091E20082FF81 +:104BF00007C08091E1008B7F8093E1000E945628DE +:104C00008091DA0080FF1FC08091D80080FF1BC018 +:104C10008091DA008E7F8093DA008091D90080FF46 +:104C20000DC080E189BD82E189BD09B400FEFDCFE0 +:104C300081E0809359020E94302205C019BC109275 +:104C400059020E943E228091E10080FF19C08091AC +:104C5000E20080FF15C08091E2008E7F8093E20029 +:104C60008091E20080618093E2008091D8008062B0 +:104C70008093D80019BC85E0809359020E9442229B +:104C80008091E10084FF30C08091E20084FF2CC05D +:104C900080E189BD82E189BD09B400FEFDCF80912C +:104CA000D8008F7D8093D8008091E1008F7E809323 +:104CB000E1008091E2008F7E8093E2008091E2002B +:104CC00081608093E20080915502882311F084E096 +:104CD00007C08091E30087FD02C081E001C083E04E +:104CE000809359020E9443228091E10083FF29C0F2 +:104CF0008091E20083FF25C08091E100877F80934F +:104D0000E10082E080935902109255028091E10007 +:104D10008E7F8093E1008091E2008E7F8093E2009D +:104D20008091E20080618093E20042E060E080E0F8 +:104D30000E94DE248091F00088608093F0000E9441 +:104D40004122FF91EF91BF91AF919F918F917F9100 +:104D50006F915F914F913F912F910F900FBE0F90E8 +:104D60001F9018951F920F920FB60F9211242F9338 +:104D70003F934F935F936F937F938F939F93AF93E3 +:104D8000BF93CF93DF93EF93FF93C091E900CF7070 +:104D90008091EC00D82FD17080FDD0E81092E9000E +:104DA0008091F000877F8093F00078940E94F6262F +:104DB0001092E9008091F00088608093F000CD2B84 +:104DC000CF70C093E900FF91EF91DF91CF91BF9138 +:104DD000AF919F918F917F916F915F914F913F9193 +:104DE0002F910F900FBE0F901F9018951F93CF9388 +:104DF000DF93CDB7DEB7AA970FB6F894DEBF0FBE2C +:104E0000CDBFEAE5F2E08091F100819322E0E23645 +:104E1000F207C9F70E9459228091E80083FF2EC152 +:104E200080915A0290915B02492F50E04A3051051F +:104E300008F024C1FA01E556FF4F0C94E32B8038AB +:104E400021F0823809F01AC108C080915602909171 +:104E50005702992389F082600FC080915E028F70A3 +:104E6000873008F00BC18093E9008091EB0085FB4F +:104E7000882780F91092E9009091E800977F90933D +:104E8000E8008093F1001092F100D1C0282F2D7F0F +:104E900009F0F4C0882319F0823061F0EFC08091EE +:104EA0005C02813009F0EAC0933009F080E0809321 +:104EB00057022EC080915C0281112AC080915E024F +:104EC0008F702FEF280F263008F0D8C08093E900AC +:104ED0002091EB0020FF1CC0933021F48091EB0067 +:104EE000806214C09091EB0090619093EB0021E000 +:104EF00030E0A90102C0440F551F8A95E2F74093A4 +:104F0000EA001092EA008091EB0088608093EB0049 +:104F10001092E9008091E800877F8093E8000E946A +:104F20001325ACC08111AAC010915C021F7780913B +:104F3000E3008078812B8093E3008091E800877FF5 +:104F40008093E8000E9413258091E80080FFFCCF49 +:104F50008091E30080688093E300111102C082E039 +:104F600001C083E08093590289C08058823008F0E4 +:104F700085C080915C0290915D028C3D53E0950765 +:104F800079F583E08A838AE289834FB7F894DE015A +:104F9000139620E03EE051E2E32FF0E050935700FB +:104FA000E49120FF03C0E295EF703F5FEF708E2F1A +:104FB00090E0EA3010F0C79601C0C0968D939D93A3 +:104FC0002F5F243149F74FBF8091E800877F80939E +:104FD000E8006AE270E0CE0101960E941F2416C02C +:104FE00060915E0270915F02AE014F5F5F4F0E9461 +:104FF0004823BC01892B09F441C09091E800977FB8 +:105000009093E80089819A810E947D248091E80034 +:105010008B778093E80032C0803881F58091E8007A +:10502000877F8093E800809155028093F100809102 +:10503000E8008E7772CF811121C080915C0290913F +:105040005D0299270297D4F48091E800877F8093CE +:10505000E80080915C02809355020E9413258091A4 +:105060005502811106C08091E30087FD02C081E0F6 +:1050700001C084E0809359020E9445228091E8009B +:1050800083FF0AC08091E800877F8093E8008091C9 +:10509000EB0080628093EB00AA960FB6F894DEBF17 +:1050A0000FBECDBFDF91CF911F9108950895CF938B +:1050B000809159028823A1F0C091E900CF709091AE +:1050C000EC00892F817090FD80E8C82B1092E900D8 +:1050D0008091E80083FD0E94F626CF70C093E9001E +:1050E000CF9108955058BB27AA270E948A280C9474 +:1050F000352A0E94272A38F00E942E2A20F039F4FF +:105100009F3F19F426F40C94FD290EF4E095E7FB7B +:105110000C94F729E92F0E94462A58F3BA17620720 +:1051200073078407950720F079F4A6F50C94682A94 +:105130000EF4E0950B2EBA2FA02D0B01B9019001B2 +:105140000C01CA01A0011124FF27591B99F0593FF6 +:1051500050F4503E68F11A16F040A22F232F342F3E +:105160004427585FF3CF469537952795A795F0408C +:105170005395C9F77EF41F16BA0B620B730B840BA1 +:10518000BAF09150A1F0FF0FBB1F661F771F881F59 +:10519000C2F70EC0BA0F621F731F841F48F48795B1 +:1051A00077956795B795F7959E3F08F0B0CF9395A3 +:1051B000880F08F09927EE0F9795879508950E941C +:1051C000F3280C94352A0E942E2A58F00E94272A90 +:1051D00040F029F45F3F29F00C94F72951110C9409 +:1051E000692A0C94FD290E94462A68F39923B1F399 +:1051F000552391F3951B550BBB27AA2762177307FD +:10520000840738F09F5F5F4F220F331F441FAA1F90 +:10521000A9F335D00E2E3AF0E0E832D0915050404C +:10522000E695001CCAF72BD0FE2F29D0660F771FFA +:10523000881FBB1F261737074807AB07B0E809F0E0 +:10524000BB0B802DBF01FF2793585F4F3AF09E3F65 +:10525000510578F00C94F7290C94692A5F3FE4F328 +:10526000983ED4F3869577956795B795F7959F5FA8 +:10527000C9F7880F911D9695879597F90895E1E0F4 +:10528000660F771F881FBB1F621773078407BA0753 +:1052900020F0621B730B840BBA0BEE1F88F7E095AE +:1052A000089529F416F00C94F7290C94682A0C94AC +:1052B000FD290E944E2AA8F39638A0F707F80F920E +:1052C000E8942BE33AEA48EB5FE70E94FB2A0F924F +:1052D0000F920F924DB75EB70F920E94B12AEAE487 +:1052E000F1E00E94002A4F915F91EF91FF91E595C7 +:1052F000EE1FFF1F49F0FE57E0684427EE0F441FE2 +:10530000FA95E1F74195550B0E947B2A0F9007FE15 +:105310000C946F2A08950E944E2A88F09F5798F0A7 +:10532000B92F9927B751B0F0E1F0660F771F881FAA +:10533000991F1AF0BA95C9F714C0B13091F00E94C4 +:10534000682AB1E008950C94682A672F782F88277F +:10535000B85F39F0B93FCCF3869577956795B395EB +:10536000D9F73EF490958095709561957F4F8F4F5A +:105370009F4F0895E89409C097FB3EF4909580955F +:10538000709561957F4F8F4F9F4F9923A9F0F92F0B +:1053900096E9BB279395F695879577956795B79589 +:1053A000F111F8CFFAF4BB0F11F460FF1BC06F5F6F +:1053B0007F4F8F4F9F4F16C0882311F096E911C081 +:1053C000772321F09EE8872F762F05C0662371F0A2 +:1053D00096E8862F70E060E02AF09A95660F771FB6 +:1053E000881FDAF7880F9695879597F9089597F9AA +:1053F0009F6780E870E060E008959FEF80EC08957B +:10540000DF93CF931F930F93FF92EF92DF927B0175 +:105410008C01689406C0DA2EEF010E94F82AFE0182 +:10542000E894A5912591359145915591A6F3EF0109 +:105430000E948A28FE019701A801DA9469F7DF909B +:10544000EF90FF900F911F91CF91DF91089500246D +:105450000A941616170618060906089500240A94D9 +:1054600012161306140605060895092E0394000C5F +:1054700011F4882352F0BB0F40F4BF2B11F460FFEE +:1054800004C06F5F7F4F8F4F9F4F089557FD905817 +:10549000440F551F59F05F3F71F04795880F97FBF8 +:1054A000991F61F09F3F79F08795089512161306B2 +:1054B0001406551FF2CF4695F1DF08C016161706E1 +:1054C0001806991FF1CF8695710561050894089516 +:1054D000E894BB2766277727CB0197F908959B01AE +:1054E000AC0160E070E080E89FE30C94DF280C944E +:1054F000F7290C945A2B0E944E2AD8F39923C9F30A +:10550000940F511DA3F39150504094F059F088230B +:1055100032F0660F771F881F91505040C1F79E3FB1 +:1055200051052CF7880F911D9695879597F9089549 +:105530005F3FACF0983E9CF0BB27869577956795CA +:10554000B79508F4B1609395C1F7BB0F58F711F404 +:1055500060FFE8CF6F5F7F4F8F4F9F4FE3CF0C947B +:10556000692AFA01DC01AA0FBB1F9B01AC01BF57DE +:1055700028F4222733274427507820C0B75190F4CD +:10558000AB2F0024469537952795011CA395D2F3A0 +:10559000002071F0220F331F441FB395DAF30ED0B1 +:1055A0000C94722861307105A0E88A07B94630F47E +:1055B0009B01AC016627772788279078309621F0E9 +:1055C000208331834283538308950E94F82A0C94E8 +:1055D000352A0E94272A38F00E942E2A20F095238F +:1055E00011F00C94F7290C94FD2911240C94692ACC +:1055F0000E94462A70F3959FC1F3950F50E0551F06 +:10560000629FF001729FBB27F00DB11D639FAA2717 +:10561000F00DB11DAA1F649F6627B00DA11D661F66 +:10562000829F2227B00DA11D621F739FB00DA11D87 +:10563000621F839FA00D611D221F749F3327A00D41 +:10564000611D231F849F600D211D822F762F6A2FDD +:1056500011249F5750409AF0F1F088234AF0EE0F42 +:10566000FF1FBB1F661F771F881F91505040A9F76F +:105670009E3F510580F00C94F7290C94692A5F3FF6 +:10568000E4F3983ED4F3869577956795B795F795AB +:10569000E7959F5FC1F7FE2B880F911D9695879523 +:1056A00097F908959F930E946A2B0F9007FCEE5F75 +:1056B0000C94932B9F3F31F0915020F48795779570 +:1056C0006795B795880F911D9695879597F90895D9 +:1056D0000C94FD290E944E2AD8F3E894E0E0BB2701 +:1056E0009F57F0F02AED3FE049EC06C0EE0FBB0FEC +:1056F000661F771F881F28F0B23A62077307840776 +:1057000028F0B25A620B730B840BE3959A9572F7EB +:10571000803830F49A95BB0F661F771F881FD2F729 +:1057200090480C945C2BEF93E0FF07C0A2EA2AEDAF +:105730003FE049EC5FEB0E948A280E94352A0F90D7 +:10574000039401FC9058E2E7F1E00C94A72B9F939F +:105750008F937F936F93FF93EF939B01AC010E9414 +:10576000E52AEF91FF910E94002A2F913F914F91DE +:105770005F910C94E52AAA1BBB1B51E107C0AA1F2D +:10578000BB1FA617B70710F0A61BB70B881F991FE2 +:105790005A95A9F780959095BC01CD01089597FB86 +:1057A000072E16F4009407D077FD09D00E94BB2B7A +:1057B00007FC05D03EF4909581959F4F0895709514 +:1057C00061957F4F0895EE0FFF1F0590F491E02D36 +:1057D0000994FC014150504030F001900616D1F779 +:1057E0003197CF010895882799270895F999FECF19 +:1057F00092BD81BDF89A992780B50895A6E1B0E0E1 +:1058000044E050E00C94302CA8E1B0E042E050E0DD +:105810000C94302C262FF999FECF92BD81BDF89AB9 +:10582000019700B4021639F01FBA20BD0FB6F894E4 +:10583000FA9AF99A0FBE08950396272F0E940B2C0F +:105840000E940A2C252F0E940B2C242F0C940B2C29 +:105850000196272F0E940B2C0C940A2CDC01CB0103 +:10586000FC01F999FECF06C0F2BDE1BDF89A319670 +:1058700000B40D9241505040B8F70895F894FFCF0E +:10588000010201191A1B1C1D1E1F202122E80128DC +:1058900008140A321E3E21DC21B1217B2141210165 +:1058A00097C66636323331F7F6F5943435404D36C7 +:1058B00039FD04B0047A044104D403ED0306041F47 +:0258C0000400E2 +:00000001FF diff --git a/keyboards/alpha/keymaps/vderm/keymap.c b/keyboards/alpha/keymaps/vderm/keymap.c new file mode 100644 index 00000000000..5fc642319b8 --- /dev/null +++ b/keyboards/alpha/keymaps/vderm/keymap.c @@ -0,0 +1,34 @@ +#include QMK_KEYBOARD_H + +#define HOME 0 +#define FN 1 +#define FNCHAR 2 +#define FKEYS 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [HOME] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + MT(MOD_LCTL, KC_Z), MT(MOD_LALT, KC_X), LT(1, KC_C), LT(2, KC_V), MT(MOD_LSFT, KC_SPC), MT(MOD_RGUI,KC_B), MT(MOD_RALT, KC_N), MT(MOD_RCTL, KC_M)), + + [FN] = LAYOUT( + KC_ESC, KC__MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_NO, + KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_BSPC, + KC_LCTL, KC_LALT, KC_TRNS, MO(3), MT(MOD_LSFT, KC_SPC), KC_RGUI, KC_RALT, KC_RCTL), + + [FNCHAR] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_GRV,KC_NO,KC_MINS,KC_EQL,KC_BSLS,KC_LBRC,KC_RBRC,KC_SCLN,KC_QUOT,KC_BSPC, + KC_LCTL, KC_LALT, MO(3), KC_TRNS, MT(MOD_LSFT, KC_SPC), KC_COMM, KC_DOT, KC_SLSH), + + [FKEYS] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + KC_F11,KC_F12,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_DEL, + KC_LCTL, KC_LALT, KC_TRNS, KC_TRNS, MT(MOD_LSFT, KC_SPC), KC_RGUI, KC_RALT, KC_RCTL), +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} diff --git a/keyboards/alps64/alps64.h b/keyboards/alps64/alps64.h index 4e8587435cf..14ff552185d 100644 --- a/keyboards/alps64/alps64.h +++ b/keyboards/alps64/alps64.h @@ -94,16 +94,16 @@ along with this program. If not, see . K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \ K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \ K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \ - K30, K40, K50, K60, K70, K00, K20 \ + K30, K40, K50, K60, K00, K10, K20 \ ) { \ { K00, K01, K02, K03, K04, K05, K06, K07 }, \ - { KC_NO, K11, K12, K13, K14, K15, K16, K17 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ { K20, K21, KC_NO, K23, K24, K25, KC_NO, K27 }, \ { K30, K31, K32, K33, K34, K35, K36, K37 }, \ { K40, KC_NO, K42, K43, K44, K45, K46, K47 }, \ { K50, K51, K52, K53, K54, K55, K56, K57 }, \ { K60, K61, K62, K63, K64, K65, K66, K67 }, \ - { K70, K71, K72, K73, K74, K75, K76, K77 } \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77 } \ } #define LAYOUT_kc( \ diff --git a/keyboards/alps64/config.h b/keyboards/alps64/config.h index 858a82ecdd9..74f8017add0 100644 --- a/keyboards/alps64/config.h +++ b/keyboards/alps64/config.h @@ -47,13 +47,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/alps64/keymaps/crd/keymap.c b/keyboards/alps64/keymaps/crd/keymap.c index 4f3ea446ece..9268083522e 100644 --- a/keyboards/alps64/keymaps/crd/keymap.c +++ b/keyboards/alps64/keymaps/crd/keymap.c @@ -1,31 +1,30 @@ #include QMK_KEYBOARD_H +enum keyboard_layers { + _BL = 0, // Base Layer + _FL // Function Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_FNDN LT(_FL, KC_DOWN) +#define KC_RGLT RCMD_T(KC_LEFT) +#define KC_RCRT RCTL_T(KC_RIGHT) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - LAYOUT_all( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_UP), _______, - MO(1), KC_LALT, KC_LGUI, KC_SPC, _______, RGUI_T(KC_LEFT), RALT_T(KC_DOWN), LT(2, KC_RIGHT) - ), - /* 1: fn1 */ - LAYOUT_all( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_PGDOWN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ + [_BL] = LAYOUT_aek_103( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, + MO(_FL), KC_LALT, KC_LGUI, KC_SPC, KC_RGLT, KC_FNDN, KC_RCRT ), - /* 2: fn2 */ - LAYOUT_all( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, - _______, _______, _______, DEBUG, _______, _______, _______, _______, _______, _______, KC_SCROLLLOCK, KC_PAUSE, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), -} -; - -const uint16_t PROGMEM fn_actions[] = {}; + [_FL] = LAYOUT_aek_103( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, RESET, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/alps64/keymaps/default/keymap.c b/keyboards/alps64/keymaps/default/keymap.c index dd598379e8d..72d29a06fef 100644 --- a/keyboards/alps64/keymaps/default/keymap.c +++ b/keyboards/alps64/keymaps/default/keymap.c @@ -10,4 +10,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_APP, KC_RALT, KC_RGUI, KC_RCTL ), }; -const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboards/alps64/keymaps/mechmerlin/keymap.c b/keyboards/alps64/keymaps/mechmerlin/keymap.c new file mode 100644 index 00000000000..d32d9f61e99 --- /dev/null +++ b/keyboards/alps64/keymaps/mechmerlin/keymap.c @@ -0,0 +1,26 @@ +#include QMK_KEYBOARD_H +#include "mechmerlin.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty */ + [_BL] = LAYOUT_infinity( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TG(_AL), \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FL), KC_RALT, KC_RGUI, KC_RCTL), + + [_FL] = LAYOUT_infinity( \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_AL] = LAYOUT_infinity( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT), +}; diff --git a/keyboards/alps64/keymaps/mechmerlin/readme.md b/keyboards/alps64/keymaps/mechmerlin/readme.md new file mode 100644 index 00000000000..896e7ec3cb6 --- /dev/null +++ b/keyboards/alps64/keymaps/mechmerlin/readme.md @@ -0,0 +1,10 @@ +# MechMerlin Alps64 Infinity Keymap + +This is the 60% infinity layout used by u/merlin36, host of the [MechMerlin](www.youtube.com/mechmerlin) +YouTube channel. + +## Keymap Notes +- `Caps Lock` can be held to act as a `Left Control` + +### Build +To build the firmware file associated with this keymap, simply run `make alps64:mechmerlin`. diff --git a/keyboards/alps64/readme.md b/keyboards/alps64/readme.md index d6308ab190e..1188d7819cb 100644 --- a/keyboards/alps64/readme.md +++ b/keyboards/alps64/readme.md @@ -1,14 +1,15 @@ -Alps64 -=== +# Alps64 -An Alps-only 60% board designed by Hasu. +An Alps only 60% board designed by Hasu. Keyboard Maintainer: QMK Community Hardware Supported: Alps64 PCB Hardware Availability: https://geekhack.org/index.php?topic=69666.0 +QMK is not the Alps64 official firmware. To use the official tools, refer to [TMK Keymap Editor](http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?alps64) or [TMK Keyboard Firmware on Github](https://github.com/tmk/tmk_keyboard). + Make example for this keyboard (after setting up your build environment): make alps64:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/alu84/config.h b/keyboards/alu84/config.h index 9d2dca409c7..130e2f1b405 100755 --- a/keyboards/alu84/config.h +++ b/keyboards/alu84/config.h @@ -46,7 +46,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -54,11 +54,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLED_NUM 16 diff --git a/keyboards/alu84/keymaps/default/keymap.c b/keyboards/alu84/keymaps/default/keymap.c index 10dbe273a79..4122978ebaf 100755 --- a/keyboards/alu84/keymaps/default/keymap.c +++ b/keyboards/alu84/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) #define _BL 0 #define _FN1 1 @@ -56,15 +55,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - - switch (id) { - - } - return MACRO_NONE; -} - void matrix_init_user(void) { } @@ -108,37 +98,3 @@ void led_set_user(uint8_t usb_led) { } } - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} \ No newline at end of file diff --git a/keyboards/alu84/keymaps/turbomech/rules.mk b/keyboards/alu84/keymaps/turbomech/rules.mk index ff8b4b2e643..c8b74bfc9a0 100644 --- a/keyboards/alu84/keymaps/turbomech/rules.mk +++ b/keyboards/alu84/keymaps/turbomech/rules.mk @@ -10,6 +10,3 @@ AUDIO_ENABLE ?= no RGBLIGHT_ENABLE ?= yes UNICODE_ENABLE ?= yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/alu84/readme.md b/keyboards/alu84/readme.md index ab20c413892..f98addd0bfb 100644 --- a/keyboards/alu84/readme.md +++ b/keyboards/alu84/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make alu84:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/amj40/config.h b/keyboards/amj40/config.h index 41101112230..f9a3c1ac69a 100755 --- a/keyboards/amj40/config.h +++ b/keyboards/amj40/config.h @@ -47,18 +47,13 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Backlight configuration */ #define BACKLIGHT_LEVELS 4 diff --git a/keyboards/amj40/keymaps/default/keymap.c b/keyboards/amj40/keymaps/default/keymap.c index c81317b8442..951857de82a 100755 --- a/keyboards/amj40/keymaps/default/keymap.c +++ b/keyboards/amj40/keymaps/default/keymap.c @@ -21,14 +21,6 @@ enum custom_keycodes { ADJUST, }; - - - - -// increase readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Default Layer * ,-----------------------------------------------------------. @@ -45,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,\ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT,\ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,\ - KC_LCTL, KC_LGUI, KC_LALT, F(0), F(1), F(2), KC_RALT, KC_RCTL \ + KC_LCTL, KC_LGUI, KC_LALT, LT(_LOWER, KC_SPC),LT(_RAISE, KC_SPC),LT(_ADJUST, KC_LGUI), KC_RALT, KC_RCTL \ ), /* Function Layer 1 HHKB style @@ -106,34 +98,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - - - -enum function_id { - LAUNCH, - RGBLED_TOGGLE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), - [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), - [2] = ACTION_LAYER_TAP_KEY(_ADJUST, KC_LGUI), - -}; - - - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - - return MACRO_NONE; -}; - - - - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { diff --git a/keyboards/amj40/keymaps/default/rules.mk b/keyboards/amj40/keymaps/default/rules.mk index fe986722010..cbfa35e6310 100644 --- a/keyboards/amj40/keymaps/default/rules.mk +++ b/keyboards/amj40/keymaps/default/rules.mk @@ -18,7 +18,3 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/amj40/keymaps/fabian/keymap.c b/keyboards/amj40/keymaps/fabian/keymap.c index 5055771ff86..360424f300d 100755 --- a/keyboards/amj40/keymaps/fabian/keymap.c +++ b/keyboards/amj40/keymaps/fabian/keymap.c @@ -50,9 +50,6 @@ enum custom_keycodes { EXT_PLV }; -#define XXXXXXX KC_NO -#define _______ KC_TRNS - #define CTL_ESC CTL_T(KC_ESC) // Tap for Escape, hold for Control #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) #define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) diff --git a/keyboards/amj40/keymaps/myee/keymap.c b/keyboards/amj40/keymaps/myee/keymap.c index baddea72d53..7642ede34da 100644 --- a/keyboards/amj40/keymaps/myee/keymap.c +++ b/keyboards/amj40/keymaps/myee/keymap.c @@ -22,10 +22,6 @@ enum custom_keycodes { ADJUST, }; -// increase readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( \ diff --git a/keyboards/amj40/readme.md b/keyboards/amj40/readme.md index 42c5374d52e..fbf1d9f2299 100755 --- a/keyboards/amj40/readme.md +++ b/keyboards/amj40/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make amj40:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/amj40/rules.mk b/keyboards/amj40/rules.mk index 18403ac3280..b9f70de0f17 100755 --- a/keyboards/amj40/rules.mk +++ b/keyboards/amj40/rules.mk @@ -1,6 +1,4 @@ - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/amj60/config.h b/keyboards/amj60/config.h index 7c06f9a6c79..81b70111b14 100644 --- a/keyboards/amj60/config.h +++ b/keyboards/amj60/config.h @@ -47,18 +47,13 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Backlight configuration */ #define BACKLIGHT_LEVELS 4 diff --git a/keyboards/amj60/keymaps/default/keymap.c b/keyboards/amj60/keymaps/default/keymap.c index fd8e198f59c..c5dc25018c8 100644 --- a/keyboards/amj60/keymaps/default/keymap.c +++ b/keyboards/amj60/keymaps/default/keymap.c @@ -11,10 +11,6 @@ // dual-role shortcuts #define SPACEDUAL LT(_SPC, KC_SPACE) - -// increase readability -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _DEF: Default Layer * ,-----------------------------------------------------------. diff --git a/keyboards/amj60/keymaps/iso_split_rshift/keymap.c b/keyboards/amj60/keymaps/iso_split_rshift/keymap.c index b5fd731ddd9..4fbf87c6525 100644 --- a/keyboards/amj60/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/amj60/keymaps/iso_split_rshift/keymap.c @@ -30,10 +30,6 @@ #define GER_BRC_L RALT(KC_8) // [ #define GER_BRC_R RALT(KC_9) // ] -// increase readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _DEF: Default Layer * ,-----------------------------------------------------------. @@ -72,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ _______, KC_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, _______, \ _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \ - _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, RALT(KC_SPC),_______, _______, _______, _______, KC_VOLU, _______, \ _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) @@ -92,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ _______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \ - _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, A(KC_F2), _______, _______, _______, _______, KC_PGUP, _______, \ _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) @@ -111,35 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_SFX] = LAYOUT_iso_splitrshift( RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \ _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \ - _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \ - _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \ _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT), }; - -enum function_id { - LAUNCH, - RGBLED_TOGGLE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_FUNCTION(LAUNCH), - [10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - return (record->event.pressed ? - MACRO( D(RALT), T(SPC), U(RALT), END ) - :MACRO( END )); - break; - case 1: - return (record->event.pressed ? - MACRO( D(LALT), T(F2), U(LALT), END ) - :MACRO( END )); - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/amj60/keymaps/iso_split_rshift/rules.mk b/keyboards/amj60/keymaps/iso_split_rshift/rules.mk index 931affcd563..1b34f4f6060 100644 --- a/keyboards/amj60/keymaps/iso_split_rshift/rules.mk +++ b/keyboards/amj60/keymaps/iso_split_rshift/rules.mk @@ -18,6 +18,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/amj60/keymaps/maximized/keymap.c b/keyboards/amj60/keymaps/maximized/keymap.c index fd8e198f59c..c5dc25018c8 100644 --- a/keyboards/amj60/keymaps/maximized/keymap.c +++ b/keyboards/amj60/keymaps/maximized/keymap.c @@ -11,10 +11,6 @@ // dual-role shortcuts #define SPACEDUAL LT(_SPC, KC_SPACE) - -// increase readability -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _DEF: Default Layer * ,-----------------------------------------------------------. diff --git a/keyboards/amj60/readme.md b/keyboards/amj60/readme.md index e87b1f9f829..394f8645622 100644 --- a/keyboards/amj60/readme.md +++ b/keyboards/amj60/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make amj60:maximized -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/amj60/rules.mk b/keyboards/amj60/rules.mk index 0df13d3062f..0e9f17d260a 100644 --- a/keyboards/amj60/rules.mk +++ b/keyboards/amj60/rules.mk @@ -1,6 +1,4 @@ - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -65,4 +63,4 @@ AUDIO_ENABLE = no UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -LAYOUTS = 60_ansi \ No newline at end of file +LAYOUTS = 60_ansi diff --git a/keyboards/amj96/config.h b/keyboards/amj96/config.h index 6c51a244365..1f1be03ce29 100644 --- a/keyboards/amj96/config.h +++ b/keyboards/amj96/config.h @@ -44,7 +44,7 @@ along with this program. If not, see . */ #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN D4 @@ -64,7 +64,7 @@ along with this program. If not, see . #define BACKLIGHT_CUSTOM /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -114,11 +114,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/amj96/keymaps/default/config.h b/keyboards/amj96/keymaps/default/config.h index 5e346088ed1..0c01a85594d 100644 --- a/keyboards/amj96/keymaps/default/config.h +++ b/keyboards/amj96/keymaps/default/config.h @@ -14,11 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/amj96/keymaps/default/keymap.c b/keyboards/amj96/keymaps/default/keymap.c index 0976d856e46..a520fdeb31f 100644 --- a/keyboards/amj96/keymaps/default/keymap.c +++ b/keyboards/amj96/keymaps/default/keymap.c @@ -36,26 +36,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/amj96/readme.md b/keyboards/amj96/readme.md index 7c1b61c768a..f1313004797 100644 --- a/keyboards/amj96/readme.md +++ b/keyboards/amj96/readme.md @@ -10,7 +10,7 @@ Make example for this keyboard (after setting up your build environment): make amj96:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Notes - In-switch and underglow LEDs currently not supported. diff --git a/keyboards/amj96/rules.mk b/keyboards/amj96/rules.mk index 59451dee6be..a90f0e75a85 100644 --- a/keyboards/amj96/rules.mk +++ b/keyboards/amj96/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/amjkeyboard/amj66/amj66.c b/keyboards/amjkeyboard/amj66/amj66.c new file mode 100644 index 00000000000..05e29975b66 --- /dev/null +++ b/keyboards/amjkeyboard/amj66/amj66.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "amj66.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/amjkeyboard/amj66/amj66.h b/keyboards/amjkeyboard/amj66/amj66.h new file mode 100644 index 00000000000..e2315f5e9fd --- /dev/null +++ b/keyboards/amjkeyboard/amj66/amj66.h @@ -0,0 +1,79 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. + +/* LAYOUT_all + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0A │0B │0C │0D │0E │ │0F │ ISO Enter + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┤ ┌─────┐ + * │10 │11 │12 │13 │14 │15 │16 │17 │18 │19 │1A │1B │1C │1D │ │1E │ │2C │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┘ ┌──┴┐ │ + * │20 │21 │22 │23 │24 │25 │26 │27 │28 │29 │2A │2B │2C │ │1D │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──┬───┬─┴─┐ └───┴────┘ + * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3A │3B │3C │3D │3E │ + * ├────┴┬──┴─┬─┴──┬┴───┴───┴─┬─┴───┴───┴┬──┴─┬─┴──┬┴────┼───┼───┼───┐ + * │40 │41 │42 │43 │44 │45 │46 │47 │48 │49 │4A │ + * └─────┴────┴────┴──────────┴──────────┴────┴────┴─────┴───┴───┴───┘ + * 2u Backspace = k0D + * ISO # = k1D + * 2.25u Right Shift = k3C + * 6.25u Space = k44 + */ +#define LAYOUT_all( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, KC_NO, KC_NO, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +#define LAYOUT_66_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3E, \ + k40, k41, k42, k44, k45, k46, k47, k48, k49, k4A \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, KC_NO, k0F }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, KC_NO, KC_NO, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, KC_NO, k3E, KC_NO }, \ + { k40, k41, k42, KC_NO, k44, k45, k46, k47, k48, k49, k4A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +#define LAYOUT_66_iso( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k1D, k2C, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3E, \ + k40, k41, k42, k44, k45, k46, k47, k48, k49, k4A \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, KC_NO, k0F }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, KC_NO, KC_NO, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, KC_NO, k3E, KC_NO }, \ + { k40, k41, k42, KC_NO, k44, k45, k46, k47, k48, k49, k4A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} diff --git a/keyboards/amjkeyboard/amj66/config.h b/keyboards/amjkeyboard/amj66/config.h new file mode 100644 index 00000000000..5569bcd919e --- /dev/null +++ b/keyboards/amjkeyboard/amj66/config.h @@ -0,0 +1,55 @@ +/* +Copyright 2018 Alex Peters + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xBD66 +#define DEVICE_VER 0x0001 +#define MANUFACTURER AMJKeyboard +#define PRODUCT AMJ66 +#define DESCRIPTION QMK keyboard firmware for AMJ66 + +/* Key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* Keyboard Matrix Assignments */ +#define MATRIX_ROW_PINS { F7, F6, F5, F4, F1 } +#define MATRIX_COL_PINS { F0, B3, B2, B1, B0, B7, D0, D1, D2, D3, D5, D6, D7, B4, B5, B6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN D4 +#define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 +#define BACKLIGHT_ON_STATE 1 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/amjkeyboard/amj66/info.json b/keyboards/amjkeyboard/amj66/info.json new file mode 100644 index 00000000000..93656c44524 --- /dev/null +++ b/keyboards/amjkeyboard/amj66/info.json @@ -0,0 +1,227 @@ +{ + "keyboard_name": "AMJ66", + "url": "", + "maintainer": "FSund, qmk", + "width": 16.5, + "height": 5, + "layouts": { + "LAYOUT_all": { + "key_count": 70, + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"|", "x":13, "y":0}, + {"label":"~", "x":14, "y":0}, + {"label":"Insert", "x":15.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, + {"label":"Delete", "x":15.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"ISO Backslash", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.25}, + {"label":"HHKB Fn", "x":13.5, "y":3}, + {"label":"Up", "x":14.5, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.5}, + {"label":"Space", "x":4, "y":4, "w":2.75}, + {"label":"Space", "x":6.75, "y":4, "w":2.75}, + {"label":"Alt", "x":9.5, "y":4, "w":1.5}, + {"label":"GUI", "x":11, "y":4, "w":1.25}, + {"label":"Ctrl", "x":12.25, "y":4, "w":1.25}, + {"label":"Left", "x":13.5, "y":4}, + {"label":"Down", "x":14.5, "y":4}, + {"label":"Right", "x":15.5, "y":4} + ] + }, + "LAYOUT_66_ansi": { + "key_count": 66, + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Insert", "x":15.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"Delete", "x":15.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.25}, + {"label":"Up", "x":14.5, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Fn", "x":11.25, "y":4}, + {"label":"Ctrl", "x":12.25, "y":4, "w":1.25}, + {"label":"Left", "x":13.5, "y":4}, + {"label":"Down", "x":14.5, "y":4}, + {"label":"Right", "x":15.5, "y":4} + ] + }, + "LAYOUT_66_iso": { + "key_count": 67, + "layout": [ + {"label":"\u00ac", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"\"", "x":2, "y":0}, + {"label":"\u00a3", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Insert", "x":15.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"Delete", "x":15.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"@", "x":11.75, "y":2}, + {"label":"~", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"|", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.25}, + {"label":"Up", "x":14.5, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"AltGr", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4}, + {"label":"Ctrl", "x":12.25, "y":4, "w":1.25}, + {"label":"Left", "x":13.5, "y":4}, + {"label":"Down", "x":14.5, "y":4}, + {"label":"Right", "x":15.5, "y":4} + ] + } + } +} diff --git a/keyboards/amjkeyboard/amj66/keymaps/default/config.h b/keyboards/amjkeyboard/amj66/keymaps/default/config.h new file mode 100644 index 00000000000..6d42fc568a1 --- /dev/null +++ b/keyboards/amjkeyboard/amj66/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/amjkeyboard/amj66/keymaps/default/keymap.c b/keyboards/amjkeyboard/amj66/keymaps/default/keymap.c new file mode 100644 index 00000000000..cce05a7fe4c --- /dev/null +++ b/keyboards/amjkeyboard/amj66/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, KC_BSPC, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_DEL, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_BRTG, BL_STEP, KC_SLEP, _______, _______, KC_PGUP, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), + +}; diff --git a/keyboards/amjkeyboard/amj66/keymaps/default/readme.md b/keyboards/amjkeyboard/amj66/keymaps/default/readme.md new file mode 100644 index 00000000000..c250695efd5 --- /dev/null +++ b/keyboards/amjkeyboard/amj66/keymaps/default/readme.md @@ -0,0 +1,12 @@ +# The default keymap for AMJ66 + +![AMJ66 Layout Image](https://i.imgur.com/QNpHnMe.jpg) + +This is a fairly universal layout that supports standard ANSI, split backspace, +split left shift, and split right shift. +Cycle backlight: Fn + . +Backlight breathing: Fn + , +Volume Up/Down: Fn + [ and Fn + ] +Mute: Fn + \ +Sleep: Fn + / +Bootloader Mode: Fn + CapsLock \ No newline at end of file diff --git a/keyboards/amjkeyboard/amj66/readme.md b/keyboards/amjkeyboard/amj66/readme.md new file mode 100644 index 00000000000..37a1f27ea6a --- /dev/null +++ b/keyboards/amjkeyboard/amj66/readme.md @@ -0,0 +1,15 @@ +# AMJ66 + +![AMJ66](https://i.imgur.com/qtLuL2o.jpg) + +A 66% keyboard formerly sold by Massdrop and KBDFans. + +Keyboard Maintainer: [FSund](https://github.com/fsund), [The QMK Community](https://github.com/qmk) +Hardware Supported: AMJ66, ATmega32U4 +Hardware Availability: [Drop.com](https://drop.com/buy/kbd66-mechanical-keyboard-kit?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make amjkeyboard/amj66:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/amjkeyboard/amj66/rules.mk b/keyboards/amjkeyboard/amj66/rules.mk new file mode 100644 index 00000000000..80734a99044 --- /dev/null +++ b/keyboards/amjkeyboard/amj66/rules.mk @@ -0,0 +1,70 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +LAYOUTS = 66_ansi 66_iso diff --git a/keyboards/amjpad/config.h b/keyboards/amjpad/config.h index 1a26d2ab6c4..bbb48624f82 100644 --- a/keyboards/amjpad/config.h +++ b/keyboards/amjpad/config.h @@ -47,18 +47,13 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Backlight configuration */ #define BACKLIGHT_LEVELS 4 diff --git a/keyboards/amjpad/keymaps/default/keymap.c b/keyboards/amjpad/keymaps/default/keymap.c index 1ec81e6db81..1c9122c9ec7 100644 --- a/keyboards/amjpad/keymaps/default/keymap.c +++ b/keyboards/amjpad/keymaps/default/keymap.c @@ -1,12 +1,5 @@ #include QMK_KEYBOARD_H -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif - -// Used for SHIFT_ESC -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -14,8 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-------------------. @@ -66,37 +57,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_P0, LT(_FL,KC_PDOT), KC_PENT \ ), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/amjpad/keymaps/max/keymap.c b/keyboards/amjpad/keymaps/max/keymap.c index 463a265de13..eb50567e987 100644 --- a/keyboards/amjpad/keymaps/max/keymap.c +++ b/keyboards/amjpad/keymaps/max/keymap.c @@ -14,8 +14,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-------------------. diff --git a/keyboards/amjpad/keymaps/ortho_left/keymap.c b/keyboards/amjpad/keymaps/ortho_left/keymap.c index 5245138bd16..815ac2a6818 100644 --- a/keyboards/amjpad/keymaps/ortho_left/keymap.c +++ b/keyboards/amjpad/keymaps/ortho_left/keymap.c @@ -11,8 +11,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-------------------. diff --git a/keyboards/amjpad/keymaps/ortho_right/keymap.c b/keyboards/amjpad/keymaps/ortho_right/keymap.c index 52e93524b55..cbb81a2eabf 100644 --- a/keyboards/amjpad/keymaps/ortho_right/keymap.c +++ b/keyboards/amjpad/keymaps/ortho_right/keymap.c @@ -11,8 +11,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-------------------. diff --git a/keyboards/amjpad/readme.md b/keyboards/amjpad/readme.md index 27d5e09270f..c069af25ade 100644 --- a/keyboards/amjpad/readme.md +++ b/keyboards/amjpad/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make amjpad:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/amjpad/rules.mk b/keyboards/amjpad/rules.mk index f378a4ede20..853bbf956fe 100644 --- a/keyboards/amjpad/rules.mk +++ b/keyboards/amjpad/rules.mk @@ -1,6 +1,4 @@ - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/angel64/angel64.c b/keyboards/angel64/angel64.c new file mode 100644 index 00000000000..d26c3608bcb --- /dev/null +++ b/keyboards/angel64/angel64.c @@ -0,0 +1,51 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "angel64.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/angel64/angel64.h b/keyboards/angel64/angel64.h new file mode 100644 index 00000000000..6c0898a56af --- /dev/null +++ b/keyboards/angel64/angel64.h @@ -0,0 +1,48 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, \ + k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, \ + k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, \ + k54, k55, k56, k57, k58, k59, k60, k61, k62, k63, k64\ +) \ +{ \ + { k01, k13, k25, k37, k49, k61 }, \ + { k02, k14, k26, k38, k50, k62 }, \ + { k03, k15, k27, k39, k51, k63 }, \ + { k04, k16, k28, k40, k52, k64 }, \ + { k05, k17, k29, k41, k53, KC_NO }, \ + { k06, k18, k30, k42, k54, KC_NO }, \ + { k07, k19, k31, k43, k55, KC_NO }, \ + { k08, k20, k32, k44, k56, KC_NO }, \ + { k09, k21, k33, k45, k57, KC_NO }, \ + { k10, k22, k34, k46, k58, KC_NO }, \ + { k11, k23, k35, k47, k59, KC_NO }, \ + { k12, k24, k36, k48, k60, KC_NO } \ +} diff --git a/keyboards/angel64/config.h b/keyboards/angel64/config.h new file mode 100644 index 00000000000..fb683bc1532 --- /dev/null +++ b/keyboards/angel64/config.h @@ -0,0 +1,242 @@ +/* +Copyright 2019 kakunpc + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER kakunpc +#define PRODUCT angel64 +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } +#define UNUSED_PINS + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 64 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 25 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ + /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/angel64/info.json b/keyboards/angel64/info.json new file mode 100644 index 00000000000..2bcd0c9ea1f --- /dev/null +++ b/keyboards/angel64/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "angel64", + "url": "https://kakunpc.booth.pm/", + "maintainer": "kakunpc", + "width": 14, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"back", "x":13, "y":0}, {"label":"Q", "x":0, "y":1, "w":1.5}, {"label":"W", "x":1.5, "y":1}, {"label":"E", "x":2.5, "y":1}, {"label":"R", "x":3.5, "y":1}, {"label":"T", "x":4.5, "y":1}, {"label":"Y", "x":5.5, "y":1}, {"label":"U", "x":6.5, "y":1}, {"label":"I", "x":7.5, "y":1}, {"label":"O", "x":8.5, "y":1}, {"label":"P", "x":9.5, "y":1}, {"label":"[", "x":10.5, "y":1}, {"label":"]", "x":11.5, "y":1}, {"label":"|", "x":12.5, "y":1, "w":1.5}, {"label":"Ctrl", "x":0, "y":2}, {"label":"A", "x":1, "y":2}, {"label":"S", "x":2, "y":2}, {"label":"D", "x":3, "y":2}, {"label":"F", "x":4, "y":2}, {"label":"G", "x":5, "y":2}, {"label":"H", "x":6, "y":2}, {"label":"J", "x":7, "y":2}, {"label":"K", "x":8, "y":2}, {"label":"L", "x":9, "y":2}, {"label":";:", "x":10, "y":2}, {"label":"`", "x":11, "y":2}, {"label":"Enter", "x":12, "y":2, "w":2}, {"label":"Shift", "x":0, "y":3, "w":1.5}, {"label":"Z", "x":1.5, "y":3}, {"label":"X", "x":2.5, "y":3}, {"label":"C", "x":3.5, "y":3}, {"label":"V", "x":4.5, "y":3}, {"label":"B", "x":5.5, "y":3}, {"label":"N", "x":6.5, "y":3}, {"label":"M", "x":7.5, "y":3}, {"label":"<", "x":8.5, "y":3}, {"label":">", "x":9.5, "y":3}, {"label":"?", "x":10.5, "y":3}, {"label":"\u2191", "x":11.5, "y":3}, {"label":"Fn", "x":12.5, "y":3, "w":1.5}, {"label":"Caps", "x":0, "y":4}, {"label":"Alt", "x":1, "y":4}, {"label":"Start", "x":2, "y":4, "w":1.5}, {"label":"Ctrl", "x":3.5, "y":4, "w":1.5}, {"label":"Space", "x":5, "y":4, "w":2}, {"label":"Ctrl", "x":7, "y":4, "w":1.5}, {"label":"Alt", "x":8.5, "y":4, "w":1.5}, {"label":"\u2190", "x":10, "y":4}, {"label":"\u2193", "x":11, "y":4}, {"label":"\u2192", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}] + } + } +} diff --git a/keyboards/angel64/keymaps/default/config.h b/keyboards/angel64/keymaps/default/config.h new file mode 100644 index 00000000000..bf1149ebc63 --- /dev/null +++ b/keyboards/angel64/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/angel64/keymaps/default/keymap.c b/keyboards/angel64/keymaps/default/keymap.c new file mode 100644 index 00000000000..50ca64fdec4 --- /dev/null +++ b/keyboards/angel64/keymaps/default/keymap.c @@ -0,0 +1,58 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layers{ + BASE = 0, + COMMAND +}; + +#define KC_COMMAND LT(COMMAND,KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC , + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, + KC_LCTL, KC_LALT, KC_LGUI, KC_COMMAND, KC_SPC, KC_COMMAND, KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_DEL + ), + [COMMAND] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC , + KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} + +void keyboard_post_init_user(void) { +} diff --git a/keyboards/angel64/keymaps/default/readme.md b/keyboards/angel64/keymaps/default/readme.md new file mode 100644 index 00000000000..f4cd48f2ef9 --- /dev/null +++ b/keyboards/angel64/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for angel64 \ No newline at end of file diff --git a/keyboards/angel64/matrix.c b/keyboards/angel64/matrix.c new file mode 100644 index 00000000000..e06fc15dc4f --- /dev/null +++ b/keyboards/angel64/matrix.c @@ -0,0 +1,287 @@ +/* +Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values +static matrix_row_t matrix[MATRIX_ROWS]; //debounced values + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +//Deprecated. +bool matrix_is_modified(void) +{ + if (debounce_active()) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "ares.h" + +#ifdef RGBLIGHT_ENABLE + +#include +#include "i2c_master.h" +#include "rgblight.h" + +extern rgblight_config_t rgblight_config; + +void matrix_init_kb(void) { + i2c_init(); + // call user level keymaps, if any + matrix_init_user(); +} + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + memset(led, 0, 3 * RGBLED_NUM); + } + + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} + +bool rgb_init = false; + +void matrix_scan_kb(void) { + // if LEDs were previously on before poweroff, turn them back on + if (rgb_init == false && rgblight_config.enable) { + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + rgb_init = true; + } + + rgblight_task(); + matrix_scan_user(); +} + +#endif + +#ifdef BACKLIGHT_ENABLE +void backlight_init_ports(void) { + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // Turn out the lights + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // Turn on the lights + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} +#endif + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); +} +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +} +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + return process_record_user(keycode, record); +} +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +*/ \ No newline at end of file diff --git a/keyboards/ares/ares.h b/keyboards/ares/ares.h new file mode 100644 index 00000000000..41ecb570c65 --- /dev/null +++ b/keyboards/ares/ares.h @@ -0,0 +1,37 @@ +/* +Copyright 2019 Maarten Dekkers + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + +#define XXX KC_NO + +#define LAYOUT( \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k4e, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k00, k01, k02, k06, k0a, k0b, k0c, k0d \ +) \ +{ \ + {k00, k01, k02, XXX, XXX, XXX, k06, XXX, XXX, XXX, k0a, k0b, k0c, k0d, XXX}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, XXX}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, XXX}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, XXX}, \ + {k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k4e} \ +} diff --git a/keyboards/ares/config.h b/keyboards/ares/config.h new file mode 100644 index 00000000000..dd01d156594 --- /dev/null +++ b/keyboards/ares/config.h @@ -0,0 +1,50 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define MANUFACTURER LSJ +#define PRODUCT QMK Firmware for Ares + +#define RGBLED_NUM 16 + +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } +#define UNUSED_PINS {} + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCE 5 + +#define BACKLIGHT_LEVELS 1 +#define RGBLIGHT_ANIMATIONS + +#define NO_UART 1 + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/ares/info.json b/keyboards/ares/info.json new file mode 100644 index 00000000000..00911deb93c --- /dev/null +++ b/keyboards/ares/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "LSJ Ares", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"Back space", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"|", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/ares/keymaps/default/keymap.c b/keyboards/ares/keymaps/default/keymap.c new file mode 100644 index 00000000000..18e3d30b0d6 --- /dev/null +++ b/keyboards/ares/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +/* +Copyright 2019 Maarten Dekkers + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +#define _MA 0 +#define _FN 1 + +#define ______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTRL), +[_FN] = LAYOUT( + RGB_MOD, BL_TOGG, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______) + +}; diff --git a/keyboards/ares/readme.md b/keyboards/ares/readme.md new file mode 100644 index 00000000000..338113a13aa --- /dev/null +++ b/keyboards/ares/readme.md @@ -0,0 +1,42 @@ +lSJ Ares +======== + +Keyboard Maintainer: QMK Community +Hardware Supported: LSJ Ares PCB +Hardware Availability: https://geekhack.org/index.php?topic=93146.0 + +Make example for this keyboard (after setting up your build environment): + + make ares:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset by holding the left control key and plugging the cable in. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/ares/rules.mk b/keyboards/ares/rules.mk new file mode 100644 index 00000000000..cd8edc61121 --- /dev/null +++ b/keyboards/ares/rules.mk @@ -0,0 +1,48 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = lite +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no +RGBLIGHT_CUSTOM_DRIVER = yes +NO_UART = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +SRC += i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/ares/usbconfig.h b/keyboards/ares/usbconfig.h new file mode 100644 index 00000000000..89b7ffbaab4 --- /dev/null +++ b/keyboards/ares/usbconfig.h @@ -0,0 +1,396 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'L', 'S', 'J' +#define USB_CFG_VENDOR_NAME_LEN 3 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'A', 'r', 'e', 's' +#define USB_CFG_DEVICE_NAME_LEN 4 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/at101_blackheart/config.h b/keyboards/at101_blackheart/config.h index 237cb095e66..83814c6486c 100644 --- a/keyboards/at101_blackheart/config.h +++ b/keyboards/at101_blackheart/config.h @@ -23,7 +23,7 @@ #define DIODE_DIRECTION COL2ROW /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -33,8 +33,3 @@ /* force n-key rollover*/ #define FORCE_NKRO - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) diff --git a/keyboards/at101_blackheart/info.json b/keyboards/at101_blackheart/info.json new file mode 100644 index 00000000000..4bef46712d1 --- /dev/null +++ b/keyboards/at101_blackheart/info.json @@ -0,0 +1,121 @@ +{ + "keyboard_name": "AT101 Blackheart PCB", + "keyboard_folder": "at101_blackheart", + "url": "https://deskthority.net/group-buys-f50/programmable-vintage-board-pcbs-omnikey-at101-and-z-150-t19325.html", + "maintainer": "qmk, blindassassin111", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"Grave", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"Keypad /", "x":19.5, "y":1.5}, + {"label":"Keypad *", "x":20.5, "y":1.5}, + {"label":"Keypad -", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"LBracket", "x":11.5, "y":2.5}, + {"label":"RBracket]", "x":12.5, "y":2.5}, + {"label":"Backslash", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Keypad 7", "x":18.5, "y":2.5}, + {"label":"Keypad 8", "x":19.5, "y":2.5}, + {"label":"Keypad 9", "x":20.5, "y":2.5}, + {"label":"Keypad +", "x":21.5, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":"Semicolon", "x":10.75, "y":3.5}, + {"label":"Quote", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Keypad 4", "x":18.5, "y":3.5}, + {"label":"Keypad 5", "x":19.5, "y":3.5}, + {"label":"Keypad 6", "x":20.5, "y":3.5}, + {"label":"Keypad =", "x":21.5, "y":3.5}, + {"label":"LShift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO Backslash", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"Comma", "x":9.25, "y":4.5}, + {"label":"Period", "x":10.25, "y":4.5}, + {"label":"Slash", "x":11.25, "y":4.5}, + {"label":"RShift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Fn", "x":14, "y":4.5}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Keypad 1", "x":18.5, "y":4.5}, + {"label":"Keypad 2", "x":19.5, "y":4.5}, + {"label":"Keypad 3", "x":20.5, "y":4.5}, + {"label":"Keypad Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"LCtrl", "x":0, "y":5.5, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"LAlt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"RAlt", "x":10, "y":5.5, "w":1.25}, + {"label":"RGUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"RCtrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"Keypad 0", "x":18.5, "y":5.5, "w":2}, + {"label":"Keypad .", "x":20.5, "y":5.5} + ] + } + } +} diff --git a/keyboards/at101_blackheart/readme.md b/keyboards/at101_blackheart/readme.md index 7b356bc7534..d435d6955aa 100644 --- a/keyboards/at101_blackheart/readme.md +++ b/keyboards/at101_blackheart/readme.md @@ -1,5 +1,6 @@ -AT101 Blackheart PCB -=== +# AT101 Blackheart PCB + +![AT101 Blackheart PCB](https://deskthority.net/resources/image/48571) A replacement PCB for AT101 keyboards. @@ -11,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make at101_blackheart:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/atom47/keymaps/LEdiodes/keymap.c b/keyboards/atom47/keymaps/LEdiodes/keymap.c index 15343ab3354..87e1244214a 100644 --- a/keyboards/atom47/keymaps/LEdiodes/keymap.c +++ b/keyboards/atom47/keymaps/LEdiodes/keymap.c @@ -6,8 +6,6 @@ #define _L2 2 #define _L3 3 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_L0] = LAYOUT( KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, \ diff --git a/keyboards/atom47/keymaps/LEdiodes/rules.mk b/keyboards/atom47/keymaps/LEdiodes/rules.mk index d446d3a6995..9334aaf28f7 100644 --- a/keyboards/atom47/keymaps/LEdiodes/rules.mk +++ b/keyboards/atom47/keymaps/LEdiodes/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/atom47/keymaps/default/keymap.c b/keyboards/atom47/keymaps/default/keymap.c index a66961fba92..dc87b5a52be 100644 --- a/keyboards/atom47/keymaps/default/keymap.c +++ b/keyboards/atom47/keymaps/default/keymap.c @@ -10,8 +10,6 @@ #define _FN1 2 //Fn1 #define _PN 3 //Pn -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MA] = LAYOUT( KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, \ diff --git a/keyboards/atom47/keymaps/maartenwut/keymap.c b/keyboards/atom47/keymaps/maartenwut/keymap.c index 33ed0936a0a..c01ace92a96 100644 --- a/keyboards/atom47/keymaps/maartenwut/keymap.c +++ b/keyboards/atom47/keymaps/maartenwut/keymap.c @@ -9,8 +9,6 @@ #define _LO 1 //FN1 #define _RA 2 //FN -#define _______ KC_TRNS - enum custom_keycodes { CTRLZ = SAFE_RANGE, CTRLX, diff --git a/keyboards/atom47/readme.md b/keyboards/atom47/readme.md index 66f599c6b38..c3cffcea747 100644 --- a/keyboards/atom47/readme.md +++ b/keyboards/atom47/readme.md @@ -21,6 +21,6 @@ Hardware Availability: [GeekHack.com Group Buy](https://geekhack.org/index.php?t ## Build To build the default keymap for the latest revision, simply run `make atom47:default`. Specifiy the revision like so: `make atom47/rev3:default`. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ![Atom47](https://i.imgur.com/JfYnOba.jpg) diff --git a/keyboards/atom47/rev2/config.h b/keyboards/atom47/rev2/config.h index df21130d36b..c38cd450ed6 100644 --- a/keyboards/atom47/rev2/config.h +++ b/keyboards/atom47/rev2/config.h @@ -47,18 +47,13 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Backlight configuration */ #define BACKLIGHT_LEVELS 4 diff --git a/keyboards/atom47/rev2/readme.md b/keyboards/atom47/rev2/readme.md index 30f44df1dc6..b63e1bb44ce 100644 --- a/keyboards/atom47/rev2/readme.md +++ b/keyboards/atom47/rev2/readme.md @@ -20,4 +20,4 @@ To build the default keymap, simply run `make atom47/rev2:default`. For an alternative, heavily modified layout you would just need to run `make atom47/rev2:LEdiodes`. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/atom47/rev2/rev2.c b/keyboards/atom47/rev2/rev2.c index 31a8561f0c5..06fce06dad4 100644 --- a/keyboards/atom47/rev2/rev2.c +++ b/keyboards/atom47/rev2/rev2.c @@ -17,6 +17,9 @@ void matrix_scan_kb(void) { void led_init_ports(void) { // * Set our LED pins as output DDRB &= ~(1<<5); + + //Set output high, so the capslock led is off + PORTB |= (1 << 5); } void led_set_kb(uint8_t usb_led) { diff --git a/keyboards/atom47/rev3/config.h b/keyboards/atom47/rev3/config.h index 8a91e29903e..5a302abff41 100644 --- a/keyboards/atom47/rev3/config.h +++ b/keyboards/atom47/rev3/config.h @@ -47,13 +47,7 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +#define DEBOUNCE 5 /* Backlight configuration */ @@ -61,7 +55,7 @@ along with this program. If not, see . #define RGB_DI_PIN F5 // The pin the LED strip is connected to #define RGBLED_NUM 6 // Number of LEDs in your strip - +#define RGBLIGHT_ANIMATIONS #define QMK_ESC_OUTPUT B7 // usually COL #define QMK_ESC_INPUT B3 // usually ROW #define QMK_LED E6 diff --git a/keyboards/atom47/rev3/rev3.c b/keyboards/atom47/rev3/rev3.c index 2cd04fa767b..c541ed559c6 100644 --- a/keyboards/atom47/rev3/rev3.c +++ b/keyboards/atom47/rev3/rev3.c @@ -17,6 +17,9 @@ void matrix_scan_kb(void) { void led_init_ports(void) { // * Set our LED pins as output DDRE |= (1 << 6); + + //Set output high, so the capslock led is off + PORTE |= (1 << 6); } void led_set_kb(uint8_t usb_led) { diff --git a/keyboards/atom47/rules.mk b/keyboards/atom47/rules.mk index 5f3dbb6686c..9a2cbc55abd 100644 --- a/keyboards/atom47/rules.mk +++ b/keyboards/atom47/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/atomic/config.h b/keyboards/atomic/config.h index 9c40f54e78d..045f8672772 100644 --- a/keyboards/atomic/config.h +++ b/keyboards/atomic/config.h @@ -52,7 +52,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -98,11 +98,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/atomic/keymaps/default/keymap.c b/keyboards/atomic/keymaps/default/keymap.c index ae1efb2b663..6d314f14792 100644 --- a/keyboards/atomic/keymaps/default/keymap.c +++ b/keyboards/atomic/keymaps/default/keymap.c @@ -1,9 +1,7 @@ #include QMK_KEYBOARD_H // Fillers to make layering more clear -#define _______ KC_TRNS #define ___T___ KC_TRNS -#define XXXXXXX KC_NO // Layer shorthand #define _QW 0 @@ -97,7 +95,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN, - M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT + BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT ), /* COLEMAK - MIT ENHANCED / GRID COMPATIBLE @@ -119,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN, - M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT + BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT ), /* DVORAK - MIT ENHANCED / GRID COMPATIBLE @@ -141,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, KC_ENT, KC_ENT, KC_PGUP, KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN, - M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT + BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT ), /* LOWERED @@ -210,24 +208,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R ), }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/atomic/keymaps/michelle.c b/keyboards/atomic/keymaps/michelle.c index 9c22423d685..61953bf6606 100644 --- a/keyboards/atomic/keymaps/michelle.c +++ b/keyboards/atomic/keymaps/michelle.c @@ -168,9 +168,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function switch(id) { diff --git a/keyboards/atomic/keymaps/pvc/config.h b/keyboards/atomic/keymaps/pvc/config.h index e63a7340c70..3803a2ccd01 100644 --- a/keyboards/atomic/keymaps/pvc/config.h +++ b/keyboards/atomic/keymaps/pvc/config.h @@ -37,7 +37,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -53,7 +53,6 @@ along with this program. If not, see . // Enable Keyboard Locking via magic key #define KEYBOARD_LOCK_ENABLE - /* * Force NKRO * @@ -87,11 +86,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -153,7 +147,6 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - //#define VIBRATO_ENABLE //#define VIBRATO_STRENGTH_ENABLE diff --git a/keyboards/atomic/keymaps/pvc/keymap.c b/keyboards/atomic/keymaps/pvc/keymap.c index 4ccac63f6cb..33b3a9d824b 100644 --- a/keyboards/atomic/keymaps/pvc/keymap.c +++ b/keyboards/atomic/keymaps/pvc/keymap.c @@ -104,8 +104,6 @@ enum keyboard_macros { #define TG_NKRO MAGIC_TOGGLE_NKRO #define OS_SHFT KC_FN0 -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define ________________ _______, _______ #define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX @@ -608,4 +606,4 @@ void music_scale_user(void) PLAY_SONG(music_scale); } -#endif /* AUDIO_ENABLE */ \ No newline at end of file +#endif /* AUDIO_ENABLE */ diff --git a/keyboards/atomic/readme.md b/keyboards/atomic/readme.md index 54a6ee9b543..0561c4fea5e 100644 --- a/keyboards/atomic/readme.md +++ b/keyboards/atomic/readme.md @@ -3,7 +3,7 @@ Atomic ![Atomic](http://i.imgur.com/3gNDJAh.jpg) -A compact 60% (15x5) ortholinear keyboard kit made and sold by OLKB. [More info on qmk.fm](http://qmk.fm/atomic/) +A compact 60% (15x5) ortholinear keyboard kit made and sold by OLKB. Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) Hardware Supported: Atomic PCB rev1, Teensy 2.0 @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make atomic:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/atomic/rules.mk b/keyboards/atomic/rules.mk index eee6c2530a2..2f9e2e71322 100644 --- a/keyboards/atomic/rules.mk +++ b/keyboards/atomic/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -68,4 +65,4 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -LAYOUTS = ortho_5x15 \ No newline at end of file +LAYOUTS = ortho_5x15 diff --git a/keyboards/atreus/config.h b/keyboards/atreus/config.h index f8808892c31..b1559a29d8e 100644 --- a/keyboards/atreus/config.h +++ b/keyboards/atreus/config.h @@ -59,18 +59,13 @@ along with this program. If not, see . //#define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/atreus/keymaps/alphadox/config.h b/keyboards/atreus/keymaps/alphadox/config.h index df56849b083..e998e5edc3d 100644 --- a/keyboards/atreus/keymaps/alphadox/config.h +++ b/keyboards/atreus/keymaps/alphadox/config.h @@ -47,18 +47,13 @@ along with this program. If not, see . //#define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/atreus/keymaps/alphadox/keymap.c b/keyboards/atreus/keymaps/alphadox/keymap.c index 575a640c4f1..15485f287d8 100644 --- a/keyboards/atreus/keymaps/alphadox/keymap.c +++ b/keyboards/atreus/keymaps/alphadox/keymap.c @@ -31,10 +31,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { case TEENSY: diff --git a/keyboards/atreus/keymaps/classic/keymap.c b/keyboards/atreus/keymaps/classic/keymap.c index 529b58a13b4..dce9dd96dee 100644 --- a/keyboards/atreus/keymaps/classic/keymap.c +++ b/keyboards/atreus/keymaps/classic/keymap.c @@ -31,10 +31,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/atreus/keymaps/default/keymap.c b/keyboards/atreus/keymaps/default/keymap.c index 2e991ac6f27..bbe4bb51afd 100644 --- a/keyboards/atreus/keymaps/default/keymap.c +++ b/keyboards/atreus/keymaps/default/keymap.c @@ -38,25 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_LW] = LAYOUT( /* [> LOWER <] */ KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10 , - KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11 , + KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11 , KC_NO, KC_VOLU, KC_NO, KC_NO, RESET, KC_NO, KC_F1, KC_F2, KC_F3, KC_F12 , KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, TO(_QW), KC_PSCR, KC_SLCK, KC_PAUS ) }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/atreus/keymaps/dvorak_42_key/config.h b/keyboards/atreus/keymaps/dvorak_42_key/config.h index 43c51fb2f28..12a221d7f56 100644 --- a/keyboards/atreus/keymaps/dvorak_42_key/config.h +++ b/keyboards/atreus/keymaps/dvorak_42_key/config.h @@ -18,10 +18,8 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H - #include "config_common.h" - // mouse speed #define MOUSEKEY_INTERVAL 15 @@ -73,18 +71,13 @@ along with this program. If not, see . //#define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c index 3672a40c1fa..0fda245e2ee 100644 --- a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c @@ -8,6 +8,21 @@ #define COMBINED 3 #define BROWSER_CONTROL 4 +// aliases +// shell +#define SHELL_DEL_WORD RCTL(KC_W) +// android studio + +#define AS_TABLEFT LALT(KC_LEFT) +#define AS_TABRIGHT LALT(KC_RIGHT) +#define AS_SYMBOL LCTL(LALT(KC_N)) +#define AS_CLASS LCTL(KC_N) +#define AS_FINDUSAGE LALT(KC_F7) +#define AS_BACK LCTL(LALT(KC_LEFT)) +#define AS_GO_DECLARATION LCTL(KC_B) +#define AS_GO_IMPLEMENTATION LCTL(LALT(KC_B)) +#define AS_CLOSETAB LCTL(KC_F4) +#define AS_CLOSETOOLWINDOW LCTL(LSFT(KC_F4)) enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here @@ -37,10 +52,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [KEYNAV] = LAYOUT( - KC_ESC, CLOUD9_GOTO_LINE, RCTL(KC_Z), RCTL(KC_S), MEH(KC_F10), KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PGUP, - MEH(KC_F11), CLOUD9_GOTO_SYMBOL, RSFT(KC_TAB), KC_TAB, MEH(KC_A), LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), - MEH(KC_B), CLOUD9_NAVIGATE, CLOUD9_TAB_LEFT, CLOUD9_TAB_RIGHT, CLOUD9_TAB_CLOSE, KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE) + KC_ESC, AS_GO_IMPLEMENTATION, RCTL(KC_Z), RCTL(KC_S), MEH(KC_A), MEH(KC_B), KC_HOME, KC_UP, KC_END, KC_PGUP, + AS_BACK, AS_SYMBOL, RSFT(KC_TAB), KC_TAB, SHELL_DEL_WORD, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), + AS_FINDUSAGE, AS_CLASS, AS_TABLEFT, AS_TABRIGHT, AS_CLOSETAB, KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, + AS_CLOSETOOLWINDOW, AS_GO_DECLARATION, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE) ), [KEYSEL] = LAYOUT( @@ -65,10 +80,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { if(record->event.pressed) { switch (keycode) { diff --git a/keyboards/atreus/keymaps/erlandsona/config.h b/keyboards/atreus/keymaps/erlandsona/config.h index d9eb1903edd..4a7ade96ad8 100644 --- a/keyboards/atreus/keymaps/erlandsona/config.h +++ b/keyboards/atreus/keymaps/erlandsona/config.h @@ -20,7 +20,6 @@ along with this program. If not, see . #include "config_common.h" - /* Make Overloaded Keys switch faster */ #define TAPPING_TERM 150 @@ -63,18 +62,13 @@ along with this program. If not, see . //#define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/atreus/keymaps/erlandsona/keymap.c b/keyboards/atreus/keymaps/erlandsona/keymap.c index 232c700e948..e890e7f5281 100644 --- a/keyboards/atreus/keymaps/erlandsona/keymap.c +++ b/keyboards/atreus/keymaps/erlandsona/keymap.c @@ -11,11 +11,6 @@ #define NUMS 1 #define MOUS 2 -// Some quick aliases, just to make it look pretty -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = LAYOUT( /* Qwerty */ KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , diff --git a/keyboards/atreus/keymaps/gerb/keymap.c b/keyboards/atreus/keymaps/gerb/keymap.c index c52f32ef61d..f858aa49c45 100644 --- a/keyboards/atreus/keymaps/gerb/keymap.c +++ b/keyboards/atreus/keymaps/gerb/keymap.c @@ -46,10 +46,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function switch(id) { diff --git a/keyboards/atreus/keymaps/jeremy/keymap.c b/keyboards/atreus/keymaps/jeremy/keymap.c index 890980f41f7..baf506b9744 100644 --- a/keyboards/atreus/keymaps/jeremy/keymap.c +++ b/keyboards/atreus/keymaps/jeremy/keymap.c @@ -55,10 +55,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) {} diff --git a/keyboards/atreus/keymaps/nojjan/keymap.c b/keyboards/atreus/keymaps/nojjan/keymap.c index 8f56e574677..d0aa3b279a3 100644 --- a/keyboards/atreus/keymaps/nojjan/keymap.c +++ b/keyboards/atreus/keymaps/nojjan/keymap.c @@ -41,10 +41,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, TO(_QW), KC_PSCR, KC_SLCK, KC_PAUS ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/atreus/keymaps/ptillemans/keymap.c b/keyboards/atreus/keymaps/ptillemans/keymap.c new file mode 100644 index 00000000000..9019e9a8c04 --- /dev/null +++ b/keyboards/atreus/keymaps/ptillemans/keymap.c @@ -0,0 +1,49 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QW 0 +#define _RS 1 +#define _LW 2 + +#define MY_SHEN MT(MOD_LSFT, KC_ENT) +#define MY_CTES MT(MOD_LCTL, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT( /* Qwerty */ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P , + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN , + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH , + TT(_LW), KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, MY_CTES, KC_LALT, KC_SPC, TT(_RS), KC_MINS, KC_QUOT, MY_SHEN + ), + + /* + * ! @ up { } || pgup 7 8 9 * + * # left down right $ || pgdn 4 5 6 + + * [ ] ( ) & || ` 1 2 3 \ + * lower insert super shift bksp ctrl || alt space fn . 0 = + */ + [_RS] = LAYOUT( /* [> RAISE <] */ + KC_EXLM, KC_AT, KC_UP, KC_UNDS, KC_PLUS, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR , + KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DLR, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS , + KC_RBRC, KC_LBRC, KC_LPRN, KC_RPRN, KC_AMPR, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS , + TT(_LW), _______, _______, _______, _______, _______, _______, _______, TO(_QW), KC_DOT, KC_0, KC_EQL + ), + /* + * insert home up end pgup || up F7 F8 F9 F10 + * del left down right pgdn || down F4 F5 F6 F11 + * volup reset || F1 F2 F3 F12 + * voldn super shift next ctrl || alt space L0 prtsc scroll pause + */ + [_LW] = LAYOUT( /* [> LOWER <] */ + KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10 , + KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11 , + KC_NO, KC_VOLU, KC_NO, KC_NO, RESET, KC_TILD, KC_F1, KC_F2, KC_F3, KC_F12 , + KC_NO, KC_VOLD, _______, _______, KC_MNXT, _______, _______, _______, TO(_QW), KC_PSCR, KC_SLCK, KC_MPLY + ) +}; diff --git a/keyboards/atreus/keymaps/xk/keymap.c b/keyboards/atreus/keymaps/xk/keymap.c index ed1f634cebe..a03dee9ca9d 100644 --- a/keyboards/atreus/keymaps/xk/keymap.c +++ b/keyboards/atreus/keymaps/xk/keymap.c @@ -57,9 +57,6 @@ WINSH, OSX, }; -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // action-TAP for key/mod behavior LT(layer, KC) #define XK_TAB LT(_KAMELOC, KC_TAB) #define XK_BSP LT(_KAMELOC, KC_BSPC) diff --git a/keyboards/atreus/keymaps/xk/rules.mk b/keyboards/atreus/keymaps/xk/rules.mk index 2e76f9da5dd..5b69426acab 100644 --- a/keyboards/atreus/keymaps/xk/rules.mk +++ b/keyboards/atreus/keymaps/xk/rules.mk @@ -13,6 +13,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c index fb0c5077f84..fe1ca295d86 100644 --- a/keyboards/atreus/keymaps/xyverz/keymap.c +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -38,10 +38,6 @@ enum planck_keycodes { #define ESCTRL CTL_T(KC_ESC) #define TABALT ALT_T(KC_TAB) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Dvorak Layer ,----------------------------------. ,----------------------------------. @@ -163,10 +159,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/keyboards/atreus/keymaps/yttyx/README.md b/keyboards/atreus/keymaps/yttyx/README.md index 9ed9d6239b7..aac02c6c11f 100644 --- a/keyboards/atreus/keymaps/yttyx/README.md +++ b/keyboards/atreus/keymaps/yttyx/README.md @@ -1,77 +1,103 @@ # Overview -A Balance 12 layout for the Atreus keyboard. +This layout is based on Balance Twelve (mirror variant) by Sasha Viminitz. Please see [this page](https://mathematicalmulticore.wordpress.com/the-keyboard-layout-project/) +for more information. It's designed for left-handers who use their right hand for the mouse. -Balance 12 was created by Sasha Viminitz. Please see [this page](https://mathematicalmulticore.wordpress.com/the-keyboard-layout-project/) -for some background on the design of the layout. +## To build -* The variant used here is a mirror of the original for left-handers -* The central column of punctuation keys has been moved elsewhere -* Home positions for the left and right forefingers are *T* and *A* respectively +``` +sudo make atreus:yttyx +``` -## To build/flash +## To flash (example) -> make atreus:yttyx:avrdude +``` +sudo avrdude -p atmega32u4 -c avr109 -U flash:w:atreus_yttyx.hex -P /dev/ttyACM0 +``` ## Layers ### Base: - .----------------------------------. .------------------------------. - | P | L | C | D | W | | U | O | Y | K | Q | - +------+------+------+-----+-------| |------+-----+-----+-----+-----| - | N | R | S | T | M | | A | E | I | H | V | - +------+------+------+-----+-------| |------+-----+-----+-----+-----| - | Z | J | F | G | B | | , | . | ; | X | - | - +------+------+------+-----+-------+---------+------+-----+-----+-----+-----| - | Shft | Ctl | Alt | BS | Space | L1 | R1 | Shft | R2 | Win | Ctl | Alt | - '---------------------------------------------------------------------------' - -### L1: - - .---------------------------------. .--------------------------------. - | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |------+------+------+----+-------| |------+----+-----+------+-------| - | Tab | ? | = | - | _ | | ' | " | + | * | Enter | - |------+------+------+----+-------| |------+----+-----+------+-------| - | Esc | ! | & | | | | , | . | ; | | - | - |------+------+------+----+-------+---------+------+----+-----+------+-------| - | Shft | Ctrl | Alt | Bk | Space | L1 | R1 | Shft | R2 | Sup | Ctrl | Alt | - '----------------------------------------------------------------------------' - -### R1: - - .---------------------------------. .-------------------------------. - | < | > | { | } | @ | | $ | | | | R3 | - +------+------+-----+-----|-------| |------+----+-----+------+------| - | [ | ] | ( | ) | # | | ' | " | ~ | ` | Caps | - |------+------+-----+-----+-------| |------+----+-----+------+------| - | / | \ | ^ | | | % | | , | . | ; | | PScn | - |------+------+-----+-----+-------+---------+------+----+-----+------+------| - | Shft | Ctrl | Alt | Del | Space | L1 | R1 | Shft | R2 | Sup | Ctrl | Alt | - '---------------------------------------------------------------------------' - -### R2: - - .-----------------------------------. .--------------------.-----------------. - | F12 | F11 | F10 | F9 | Copy | | Home | Up | End | PgUp | Insert | - |------+------+------+------+-------| |------+------+------+------+----------| - | F8 | F7 | F6 | F5 | Paste | | Left | Down | Right| PgDn | Enter | - |------+------+------+------+-------| |------+------+------+------+----------| - | F4 | F3 | F2 | F1 | Cut | | ^Tab | | Tab | | | - |------+------+------+------+-------+---------+------+------+------+------+----------| - | Shft | Ctrl | Alt | Del | Undo | L1 | R1 | Shft | R2 | Sup | Ctrl | WinRight | - '------------------------------------------------------------------------------------' - -### R3: - - .----------------------------. .------------------------. - | RESET | | | | | | | | | | R3 | - |-------+----+-----+----+----| |----+----+----+----+----| - | | | | | | | | | | | | - |-------+----+-----+----+----| |----+----+----+----+----| - | | | | | | | | | | | | - |-------+----+-----+----+----+---------+----+----+----+----+----| - | | | | | | | | | | | | | - '---------------------------------------------------------------' - + .--------.-------.-------.-------.--------. .-------.-------.-------.-------.------. + | P | L | C | D | W | | U | O | Y | K | Q | + |--------+-------+-------+-------+--------| |-------+-------+-------+-------+------| + | N | R | S | T | M | | A | E | I | H | V | + |--------+-------+-------+-------+--------| |-------+-------+-------+-------+------| + | Z Sft | J Ctl | F Alt | G | B | | , | . Alt | ; Ctl | X Sft | Sup | + '--------'-------'-------+-------+--------+-----. .-----+-------+-------+-------'-------'------' + | BS P1 | Spc P2 | P3 | | | Sft | | + '-------'--------'-----' '-----'-------'-------' + +### P1: Punctuation (1) + + + .--------.-------.-------.-------.-------. .------.-------.-------.-------.------. + | Esc | | | | RS | | | | / | ^ | | ~ | + |--------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Tab | | | | | | & | \ | ` | $ | Ent | + |--------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | | | % | Alt | Ctl | Sft | Sup | + '--------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------' + | P1 | | | | | Sft | | + '-------'-------'-----' '-----'------'-------' + +### P2: Punctuation (2) + + .-------.-------.-------.-------.-------. .-------.-------.-------.-------.------. + | Esc | | NC | FV | | | ( | ) | " | ? | | + |-------+-------+-------+-------+-------| |-------+-------+-------+-------+------| + | Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | { | } | ' | ! | Ent | + |-------+-------+-------+-------+-------| |-------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | Ent | | # | Alt | Ctl | Sft | Sup | + '-------'-------'-------+-------+-------+-----. .-----+-------+-------+-------'-------'------' + | BS | P2 | | | | Sft | | + '-------'-------'-----' '-----'-------'-------' + +### P3: Punctuation (3) + + .-------.-------.-------.-------.-------. .------.-------.-------.-------.------. + | Esc | | Break | Pscr | ScLk | | < | > | + | _ | = | + |-------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Tab | | | Caps | | | [ | ] | * | - | Ent | + |-------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | | | @ | Alt | Ctl | Sft | Sup | + '-------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------' + | BS | | P3 | | | Sft | | + '-------'-------'-----' '-----'------'-------' + +### Numerals / Cursor control + + .-------.-------.-------.------.-------. .------.-------.-------.------.------. + | 1 | 2 | 3 | 4 | 5 | | Home | Up | End | PgUp | | + |-------+-------+-------+------+-------| |------+-------+-------+------+------| + | 6 | 7 | 8 | 9 | 0 | | Left | Down | Right | PgDn | | + |-------+-------+-------+------+-------| |------+-------+-------+------+------| + | Sft | Ctl | Alt | Del | . | | Ins | Alt | Ctl | Sft | Sup | + '-------'-------'-------+------+-------+-----. .-----+------+-------+-------'------'------' + | BS | BA | | | | Sft | | + '------'-------'-----' '-----'------'-------' + +### FV: Function keys / Cursor control (Vim) + + .-------.------.-------.-----.-------. .------.-------.-----.-------.------. + | F1 | F2 | F3 | F4 | F5 | | 0 | K | $ | Ctl-B | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | F6 | F7 | F8 | F9 | F10 | | H | J | L | Ctl-F | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | Sft | Ctl | Alt | F11 | F12 | | | Alt | Ctl | Sft | Sup | + '-------'------'-------+-----+-------+-----. .-----+------+-------+-----'-------'------' + | BS | BA | | | | Sft | | + '-----'-------'-----' '-----'------'-------' + +### RS: Reset + + .-------.------.-------.-----.-------. .------.-------.-----.-------.------. + | RESET | | | | | | | | | | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | | | | | | | | | | | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | | | | | | | | | | | | + '-------'------'-------+-----+-------+-----. .-----+------+-------+-----'-------'------' + | | BA | | | | | | + '-----'-------'-----' '-----'------'-------' diff --git a/keyboards/atreus/keymaps/yttyx/config.h b/keyboards/atreus/keymaps/yttyx/config.h index 68e0225e008..b9e113ec0bb 100644 --- a/keyboards/atreus/keymaps/yttyx/config.h +++ b/keyboards/atreus/keymaps/yttyx/config.h @@ -1,12 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#define ONESHOT_TIMEOUT 500 // Time (in ms) before the one shot key is released - -// Disable some options to reduce firmware size -#define NO_PRINT -#define NO_ACTION_TAPPING +#pragma once +#define NO_ACTION_ONESHOT #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/atreus/keymaps/yttyx/keymap.c b/keyboards/atreus/keymaps/yttyx/keymap.c index 8773a9734bd..dad36cad928 100644 --- a/keyboards/atreus/keymaps/yttyx/keymap.c +++ b/keyboards/atreus/keymaps/yttyx/keymap.c @@ -2,118 +2,158 @@ #include QMK_KEYBOARD_H enum layers { - BASE, // Balance Twelve - L1, // (momentary) - R1, // (momentary) - R2, // (momentary) - R3 // (momentary) + BA, // Base (Balance Twelve mirror variant) + P1, // Punctuation (1) + P2, // Punctuation (2) + P3, // Punctuation (2) + NC, // Numerals / Cursor control + FV, // Function keys / Cursor control (Vim) + RS // Reset }; -#define xxxxxxx KC_NO -#define _______ KC_TRNS +// Abbreviations - base +#define KX_P1_BSPC LT(P1, KC_BSPC) +#define KX_P2_SPC LT(P2, KC_SPC) -// Aliases from replicaJunction's atreus layout -#define KCX_LST LSFT(KC_TAB) -#define KX_COPY LCTL(KC_C) -#define KX_CUT LCTL(KC_X) -#define KX_PAST LCTL(KC_V) -#define KX_UNDO LCTL(KC_Z) +#define KX_SFT_Z MT(MOD_LSFT, KC_Z) +#define KX_CTL_J MT(MOD_LCTL, KC_J) +#define KX_ALT_F MT(MOD_LALT, KC_F) -#define KX_AT LSFT(KC_QUOT) -#define KX_PIPE LSFT(KC_NUBS) -#define KX_WINR LSFT(LGUI(KC_RGHT)) // Move window to next monitor (Windows) +#define KX_ALT_DOT MT(MOD_LALT, KC_DOT) +#define KX_CTL_SCLN MT(MOD_LCTL, KC_SCLN) +#define KX_SFT_X MT(MOD_LSFT, KC_X) +#define KX_AT LSFT(KC_QUOT) +#define KX_DQUOT LSFT(KC_2) +#define KX_PIPE LSFT(KC_NUBS) +#define KX_TILDA LSFT(KC_NUHS) + const uint16_t PROGMEM keymaps[][ MATRIX_ROWS ][ MATRIX_COLS ] = { + /* + .--------.-------.-------.-------.--------. .-------.-------.-------.-------.------. + | P | L | C | D | W | | U | O | Y | K | Q | + |--------+-------+-------+-------+--------| |-------+-------+-------+-------+------| + | N | R | S | T | M | | A | E | I | H | V | + |--------+-------+-------+-------+--------| |-------+-------+-------+-------+------| + | Z Sft | J Ctl | F Alt | G | B | | , | . Alt | ; Ctl | X Sft | Sup | + '--------'-------'-------+-------+--------+-----. .-----+-------+-------+-------'-------'------' + | BS P1 | Spc P2 | P3 | | | Sft | | + '-------'--------'-----' '-----'-------'-------' + */ + [BA] = LAYOUT( + KC_P, KC_L, KC_C, KC_D, KC_W, KC_U, KC_O, KC_Y, KC_K, KC_Q, + KC_N, KC_R, KC_S, KC_T, KC_M, KC_A, KC_E, KC_I, KC_H, KC_V, + KX_SFT_Z, KX_CTL_J, KX_ALT_F, KC_G, KC_B, KC_COMM, KX_ALT_DOT, KX_CTL_SCLN, KX_SFT_X, KC_LGUI, + XXXXXXX, XXXXXXX, XXXXXXX, KX_P1_BSPC, KX_P2_SPC, MO(P3), XXXXXXX, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* P1: Punctuation (1) + .--------.-------.-------.-------.-------. .------.-------.-------.-------.------. + | Esc | | | | RS | | | | / | ^ | | ~ | + |--------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Tab | | | | | | & | \ | ` | $ | Ent | + |--------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | | | % | Alt | Ctl | Sft | Sup | + '--------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------' + | P1 | | | | | Sft | | + '-------'-------'-----' '-----'------'-------' + */ + [P1] = LAYOUT( + KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, TO(RS), KX_PIPE, KC_SLSH, KC_CIRC, KC_HASH, KX_TILDA, + KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_AMPR, KC_NUBS, KC_GRV, KC_DLR, KC_ENT, + KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, XXXXXXX, KC_PERC, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), - /* Balance Twelve mirror variant (left-handed) - .--------------------------------. .------------------------------. - | P | L | C | D | W | | U | O | Y | K | Q | - +------+------+-----+----+-------| |------+----+-----+------+-----| - | N | R | S | T | M | | A | E | I | H | V | - +------+------+-----+----+-------| |------+----+-----+------+-----| - | Z | J | F | G | B | | , | . | ; | X | - | - +------+------+-----+----+-------+---------+------+----+-----+------+-----| - | Shft | Ctrl | Alt | Bk | Space | L1 | R1 | Shft | R2 | Win | Ctrl | Alt | - '-------------------------------------------------------------------------' + /* P2: Punctuation (2) + .-------.-------.-------.-------.-------. .-------.-------.-------.-------.------. + | Esc | | NC | FV | | | ( | ) | " | ? | | + |-------+-------+-------+-------+-------| |-------+-------+-------+-------+------| + | Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | { | } | ' | ! | Ent | + |-------+-------+-------+-------+-------| |-------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | Ent | | # | Alt | Ctl | Sft | Sup | + '-------'-------'-------+-------+-------+-----. .-----+-------+-------+-------'-------'------' + | BS | P2 | | | | Sft | | + '-------'-------'-----' '-----'-------'-------' */ - [BASE] = LAYOUT( - KC_P, KC_L, KC_C, KC_D, KC_W, KC_U, KC_O, KC_Y, KC_K, KC_Q, - KC_N, KC_R, KC_S, KC_T, KC_M, KC_A, KC_E, KC_I, KC_H, KC_V, - KC_Z, KC_J, KC_F, KC_G, KC_B, KC_COMM, KC_DOT, KC_SCLN, KC_X, KC_MINS, - KC_LSFT, KC_LCTL, KC_LALT, KC_BSPC, KC_SPC, MO(L1), MO(R1), OSM(MOD_LSFT), MO(R2), KC_LWIN, KC_RCTL, KC_RALT + [P2] = LAYOUT( + KC_ESC, XXXXXXX, TO(NC), TO(FV), XXXXXXX, KC_LPRN, KC_RPRN, KX_DQUOT, KC_QUES, XXXXXXX, + KC_TAB, LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_Z), KC_LCBR, KC_RCBR, KC_QUOT, KC_EXLM, KC_ENT, + KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, KC_ENT, KC_NUHS, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ), - /* L1 - .---------------------------------. .--------------------------------. - | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |------+------+------+----+-------| |------+----+-----+------+-------| - | Tab | ? | = | - | _ | | ' | " | + | * | Enter | - |------+------+------+----+-------| |------+----+-----+------+-------| - | Esc | ! | & | | | | , | . | ; | | - | - |------+------+------+----+-------+---------+------+----+-----+------+-------| - | Shft | Ctrl | Alt | Bk | Space | L1 | R1 | Shft | R2 | Sup | Ctrl | Alt | - '----------------------------------------------------------------------------' + /* P3: Punctuation (3) + .-------.-------.-------.-------.-------. .------.-------.-------.-------.------. + | Esc | | Break | Pscr | ScLk | | < | > | + | _ | = | + |-------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Tab | | | Caps | | | [ | ] | * | - | Ent | + |-------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | | | @ | Alt | Ctl | Sft | Sup | + '-------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------' + | BS | | P3 | | | Sft | | + '-------'-------'-----' '-----'------'-------' */ - [L1] = LAYOUT( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, - KC_TAB, KC_QUES, KC_EQL, KC_MINS, KC_UNDS, KC_QUOT, LSFT(KC_2), KC_PLUS, KC_ASTR, KC_ENT, - KC_ESC, KC_EXLM, KC_AMPR, xxxxxxx, xxxxxxx, _______, _______, _______, xxxxxxx, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + [P3] = LAYOUT( + KC_ESC, XXXXXXX, KC_BRK, KC_PSCR, KC_SLCK, KC_LABK, KC_RABK, KC_PLUS, KC_UNDS, KC_EQL, + KC_TAB, XXXXXXX, XXXXXXX, KC_CAPS, XXXXXXX, KC_LBRC, KC_RBRC, KC_ASTR, KC_MINS, KC_ENT, + KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, XXXXXXX, KX_AT, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ), - /* R1 - .---------------------------------. .-------------------------------. - | < | > | { | } | @ | | $ | | | | R3 | - +------+------+-----+-----|-------| |------+----+-----+------+------| - | [ | ] | ( | ) | # | | ' | " | ~ | ` | Caps | - |------+------+-----+-----+-------| |------+----+-----+------+------| - | / | \ | ^ | | | % | | , | . | ; | | PScn | - |------+------+-----+-----+-------+---------+------+----+-----+------+------| - | Shft | Ctrl | Alt | Del | Space | L1 | R1 | Shft | R2 | Sup | Ctrl | Alt | - '---------------------------------------------------------------------------' + /* NC: Numerals / Cursor control + .-------.-------.-------.------.-------. .------.-------.-------.------.------. + | 1 | 2 | 3 | 4 | 5 | | Home | Up | End | PgUp | | + |-------+-------+-------+------+-------| |------+-------+-------+------+------| + | 6 | 7 | 8 | 9 | 0 | | Left | Down | Right | PgDn | | + |-------+-------+-------+------+-------| |------+-------+-------+------+------| + | Sft | Ctl | Alt | Del | . | | Ins | Alt | Ctl | Sft | Sup | + '-------'-------'-------+------+-------+-----. .-----+------+-------+-------'------'------' + | BS | BA | | | | Sft | | + '------'-------'-----' '-----'------'-------' */ - [R1] = LAYOUT( - KC_LABK, KC_RABK, KC_LCBR, KC_RCBR, KX_AT, KC_DLR, KC_HASH, xxxxxxx, xxxxxxx, MO(R3), - KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_NUHS, KC_QUOT, LSFT(KC_2), LSFT(KC_NUHS), KC_GRV, KC_CAPS, - KC_SLSH, KC_NUBS, KC_CIRC, KX_PIPE, KC_PERC, _______, _______, _______, xxxxxxx, KC_PSCR, - _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______ + [NC] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, + KC_6, KC_7, KC_8, KC_9, KC_0, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, + KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, KC_DOT, KC_INS, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, TO(BA), XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ), - /* R2 - .-----------------------------------. .--------------------.-----------------. - | F12 | F11 | F10 | F9 | Copy | | Home | Up | End | PgUp | Insert | - |------+------+------+------+-------| |------+------+------+------+----------| - | F8 | F7 | F6 | F5 | Paste | | Left | Down | Right| PgDn | Enter | - |------+------+------+------+-------| |------+------+------+------+----------| - | F4 | F3 | F2 | F1 | Cut | | ^Tab | | Tab | | | - |------+------+------+------+-------+---------+------+------+------+------+----------| - | Shft | Ctrl | Alt | Del | Undo | L1 | R1 | Shft | R2 | Sup | Ctrl | WinRight | - '------------------------------------------------------------------------------------' + /* FV: Function keys / Cursor control (Vim) + .-------.------.-------.-----.-------. .------.-------.-----.-------.------. + | F1 | F2 | F3 | F4 | F5 | | 0 | K | $ | Ctl-B | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | F6 | F7 | F8 | F9 | F10 | | H | J | L | Ctl-F | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | Sft | Ctl | Alt | F11 | F12 | | | Alt | Ctl | Sft | Sup | + '-------'------'-------+-----+-------+-----. .-----+------+-------+-----'-------'------' + | BS | BA | | | | Sft | | + '-----'-------'-----' '-----'------'-------' */ - [R2] = LAYOUT( - KC_F12, KC_F11, KC_F10, KC_F9, KX_COPY, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_INS, - KC_F8, KC_F7, KC_F6, KC_F5, KX_PAST, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_ENT, - KC_F4, KC_F3, KC_F2, KC_F1, KX_CUT, KCX_LST, xxxxxxx, KC_TAB, xxxxxxx, xxxxxxx, - _______, _______, _______, KC_DEL, KX_UNDO, _______, _______, _______, _______, _______, _______, KX_WINR + [FV] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_0, KC_K, KC_DLR, LCTL(KC_B), XXXXXXX, + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_H, KC_J, KC_L, LCTL(KC_F), XXXXXXX, + KC_LSFT, KC_LCTL, KC_LALT, KC_F11, KC_F12, XXXXXXX, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, TO(BA), XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ), - /* R3 - .----------------------------. .------------------------. - | RESET | | | | | | | | | | R3 | - |-------+----+-----+----+----| |----+----+----+----+----| - | | | | | | | | | | | | - |-------+----+-----+----+----| |----+----+----+----+----| - | | | | | | | | | | | | - |-------+----+-----+----+----+---------+----+----+----+----+----| - | | | | | | | | | | | | | - '---------------------------------------------------------------' + /* RS: Reset + .-------.------.-------.-----.-------. .------.-------.-----.-------.------. + | RESET | | | | | | | | | | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | | | | | | | | | | | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | | | | | | | | | | | | + '-------'------'-------+-----+-------+-----. .-----+------+-------+-----'-------'------' + | | BA | | | | | | + '-----'-------'-----' '-----'------'-------' */ - [R3] = LAYOUT( - RESET, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, _______, - xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, - xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, - xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx + [RS] = LAYOUT( + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TO(BA), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ) }; diff --git a/keyboards/atreus/readme.md b/keyboards/atreus/readme.md index 0756c186c48..5cd797da96f 100644 --- a/keyboards/atreus/readme.md +++ b/keyboards/atreus/readme.md @@ -1,21 +1,24 @@ Atreus -=== +====== A small mechanical keyboard that is based around the shape of the human hand. -These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in two variants: one powered by a Teensy 2, (usually hand-wired) one powered by an A-Star. (usually using a PCB) This repository currently assumes that you have an A-Star powered Atreus. If you are using a Teensy2, specify that by adding `TEENSY2=yes` to your `make` commands. - Keyboard Maintainer: [Phil Hagelberg](https://github.com/technomancy) Hardware Supported: Atreus, PCB-based or hand-wired Hardware Availability: https://atreus.technomancy.us -Make example for this keyboard (after setting up your build environment): +These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in two variants: one powered by a Teensy 2 (usually hand-wired), one powered by an A-Star (usually using a PCB). You will need to use different `make` commands depending on the variant you have; see examples below. + +A-Star:\ +`make atreus:default:avrdude` - make atreus:default:avrdude +Teensy:\ +`make TEENSY2=yes atreus:default:teensy` + +If your keyboard layout is a mirror image of what you expected (i.e. you do not get QWERTY on the left but YTREWQ on the right), then you have an A-Star powered Atreus (older than March 2016) with PCB labels facing *down* instead of up. Specify that by adding `PCBDOWN=yes` to your `make` commands, e.g. -Unlike the TMK firmware, this command should be run from the root of -the repository, not the directory containing this readme. +`make PCBDOWN=yes atreus:default:avrdude` -If your keyboard layout is a mirror image of what you expected (i.e. you do not get QWERTY on the left but YTREWQ on the right), then you have an A-Star powered Atreus (older than March 2016) with PCB labels facing *down* instead of up. Specify that by adding `PCBDOWN=yes` to your `make` commands. +*Unlike the TMK firmware, these commands should be run from the root of the repository, not the directory containing this readme.* -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools), then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/atreus/rules.mk b/keyboards/atreus/rules.mk index 2488fd5e874..eda77404a02 100644 --- a/keyboards/atreus/rules.mk +++ b/keyboards/atreus/rules.mk @@ -1,19 +1,4 @@ - - -ifdef TEENSY2 - OPT_DEFS += -DATREUS_TEENSY2 - ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex -else - OPT_DEFS += -DATREUS_ASTAR -ifdef PCBDOWN - OPT_DEFS += -DPCBDOWN -endif - ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) -endif - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -48,34 +33,56 @@ ARCH = AVR8 # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. F_USB = $(F_CPU) -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID ifdef TEENSY2 BOOTLOADER = halfkay + OPT_DEFS += -DATREUS_TEENSY2 else BOOTLOADER = caterina + OPT_DEFS += -DATREUS_ASTAR + ifdef PCBDOWN + OPT_DEFS += -DPCBDOWN + endif endif -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options -# comment out to disable the options. +# change yes to no to disable # -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# MIDI_ENABLE = YES # MIDI controls -UNICODE_ENABLE = YES # Unicode -# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID - -USB = /dev/cu.usbmodem1411 +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/atreus62/config.h b/keyboards/atreus62/config.h index 8d9248947c4..a7fe5f35429 100644 --- a/keyboards/atreus62/config.h +++ b/keyboards/atreus62/config.h @@ -48,18 +48,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/atreus62/keymaps/default/keymap.c b/keyboards/atreus62/keymaps/default/keymap.c index 89ff7012ea0..06c7ae309e6 100644 --- a/keyboards/atreus62/keymaps/default/keymap.c +++ b/keyboards/atreus62/keymaps/default/keymap.c @@ -46,24 +46,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), */ }; - - - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch (id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } - else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/atreus62/keymaps/jarred/config.h b/keyboards/atreus62/keymaps/jarred/config.h new file mode 100644 index 00000000000..34ab0baaf0b --- /dev/null +++ b/keyboards/atreus62/keymaps/jarred/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// My hand wire diodes are in the opposite direction to the Atreus62 PCB +#undef DIODE_DIRECTION +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/atreus62/keymaps/jarred/keymap.c b/keyboards/atreus62/keymaps/jarred/keymap.c new file mode 100644 index 00000000000..7a49b2890c4 --- /dev/null +++ b/keyboards/atreus62/keymaps/jarred/keymap.c @@ -0,0 +1,26 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "jarred.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_atreus62_grid_wrapper(BLANK_12, QWERTY_1_12, QWERTY_2_12, QWERTY_3_12, QWERTY_L4, KC_NO, KC_NO, QWERTY_R4), + [_LW] = LAYOUT_atreus62_grid_wrapper(BLANK_12, LOWER_1_12 , LOWER_2_12 , LOWER_3_12 , LOWER_L4 , KC_NO, KC_NO, LOWER_R4 ), + [_NV] = LAYOUT_atreus62_grid_wrapper(BLANK_12, NAV_1_12 , NAV_2_12 , NAV_3_12 , NAV_L4 , KC_NO, KC_NO, NAV_R4 ), + [_NP] = LAYOUT_atreus62_grid_wrapper(BLANK_12, NUMPAD_1_12, NUMPAD_2_12, NUMPAD_3_12, NUMPAD_L4, KC_NO, KC_NO, NUMPAD_R4), + [_MS] = LAYOUT_atreus62_grid_wrapper(BLANK_12, MOUSE_1_12 , MOUSE_2_12 , MOUSE_3_12 , MOUSE_L4 , KC_NO, KC_NO, MOUSE_R4 ) +}; diff --git a/keyboards/atreus62/keymaps/mfluid/keymap.c b/keyboards/atreus62/keymaps/mfluid/keymap.c index f19c02d8e6d..206a4655be5 100644 --- a/keyboards/atreus62/keymaps/mfluid/keymap.c +++ b/keyboards/atreus62/keymaps/mfluid/keymap.c @@ -38,12 +38,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - - -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function switch (id) { diff --git a/keyboards/atreus62/keymaps/mneme/keymap.c b/keyboards/atreus62/keymaps/mneme/keymap.c index 299b0c96b1e..ba46d405ea6 100644 --- a/keyboards/atreus62/keymaps/mneme/keymap.c +++ b/keyboards/atreus62/keymaps/mneme/keymap.c @@ -171,9 +171,6 @@ static void m_handle_kf (keyrecord_t *record, uint8_t id) { } } -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch (id) { diff --git a/keyboards/atreus62/keymaps/pcewing/keymap.c b/keyboards/atreus62/keymaps/pcewing/keymap.c index 49d3c908428..eee22271f48 100644 --- a/keyboards/atreus62/keymaps/pcewing/keymap.c +++ b/keyboards/atreus62/keymaps/pcewing/keymap.c @@ -1,6 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS #define FN MO(_FN) #define TODO KC_NO @@ -76,10 +75,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/atreus62/keymaps/xyverz/keymap.c b/keyboards/atreus62/keymaps/xyverz/keymap.c index 0f2e8ea08fc..a7c33ce9eab 100644 --- a/keyboards/atreus62/keymaps/xyverz/keymap.c +++ b/keyboards/atreus62/keymaps/xyverz/keymap.c @@ -63,10 +63,6 @@ enum atreus52_keycodes { RAISE }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Aliases to make the keymap clearer. #define CTL_ENT CTL_T(KC_ENT) @@ -137,9 +133,6 @@ void matrix_init_user(void) { #endif }; -const uint16_t PROGMEM fn_actions[] = { -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/keyboards/atreus62/readme.md b/keyboards/atreus62/readme.md index b2de90011cb..bb2a24e87e3 100644 --- a/keyboards/atreus62/readme.md +++ b/keyboards/atreus62/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make atreus62:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/atreus62/rules.mk b/keyboards/atreus62/rules.mk index 66f6660c6ea..c9edfce0af8 100644 --- a/keyboards/atreus62/rules.mk +++ b/keyboards/atreus62/rules.mk @@ -1,6 +1,4 @@ - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/baguette/baguette.c b/keyboards/baguette/baguette.c index 6a8df873ab2..751a3172562 100644 --- a/keyboards/baguette/baguette.c +++ b/keyboards/baguette/baguette.c @@ -23,7 +23,7 @@ void bootmagic_lite(void) // We need multiple scans because debouncing can't be turned off. matrix_scan(); - wait_ms(DEBOUNCING_DELAY); + wait_ms(DEBOUNCE); matrix_scan(); // If the Esc and space bar are held down on power up, diff --git a/keyboards/baguette/config.h b/keyboards/baguette/config.h index 806f9fb4f69..9aa525cfd5c 100644 --- a/keyboards/baguette/config.h +++ b/keyboards/baguette/config.h @@ -45,7 +45,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B6, C6, C7, F7, F6, F5, F4, F1, F0, B0, D0, D1, D2, D3, D5, D4 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 @@ -62,7 +62,7 @@ along with this program. If not, see . // #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -112,11 +112,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -221,4 +216,3 @@ along with this program. If not, see . #define LCD_E_PIN 1 //< pin for Enable line #endif */ - diff --git a/keyboards/baguette/info.json b/keyboards/baguette/info.json index 777899a6001..2e845cdda59 100644 --- a/keyboards/baguette/info.json +++ b/keyboards/baguette/info.json @@ -1,16 +1,153 @@ { - "keyboard_name": "Baguette", - "url": "", - "maintainer": "qmk", - "bootloader": "atmel-dfu", - "width": 19.75, - "height": 6.5, - "layouts": { - "LAYOUT_ansi": { - "layout": [{"label":"~", "x":3.25, "y":1.5}, {"label":"!", "x":4.25, "y":1.5}, {"label":"@", "x":5.25, "y":1.5}, {"label":"#", "x":6.25, "y":1.5}, {"label":"$", "x":7.25, "y":1.5}, {"label":"%", "x":8.25, "y":1.5}, {"label":"^", "x":9.25, "y":1.5}, {"label":"&", "x":10.25, "y":1.5}, {"label":"*", "x":11.25, "y":1.5}, {"label":"(", "x":12.25, "y":1.5}, {"label":")", "x":13.25, "y":1.5}, {"label":"_", "x":14.25, "y":1.5}, {"label":"+", "x":15.25, "y":1.5}, {"label":"|", "x":16.25, "y":1.5}, {"label":"Del", "x":17.25, "y":1.5}, {"label":"Insert", "x":18.75, "y":1.5}, {"label":"Tab", "x":3.25, "y":2.5, "w":1.5}, {"label":"Q", "x":4.75, "y":2.5}, {"label":"W", "x":5.75, "y":2.5}, {"label":"E", "x":6.75, "y":2.5}, {"label":"R", "x":7.75, "y":2.5}, {"label":"T", "x":8.75, "y":2.5}, {"label":"Y", "x":9.75, "y":2.5}, {"label":"U", "x":10.75, "y":2.5}, {"label":"I", "x":11.75, "y":2.5}, {"label":"O", "x":12.75, "y":2.5}, {"label":"P", "x":13.75, "y":2.5}, {"label":"{", "x":14.75, "y":2.5}, {"label":"}", "x":15.75, "y":2.5}, {"label":"|", "x":16.75, "y":2.5, "w":1.5}, {"label":"Delete", "x":18.75, "y":2.5}, {"label":"Control", "x":3.25, "y":3.5, "w":1.75}, {"label":"A", "x":5, "y":3.5}, {"label":"S", "x":6, "y":3.5}, {"label":"D", "x":7, "y":3.5}, {"label":"F", "x":8, "y":3.5}, {"label":"G", "x":9, "y":3.5}, {"label":"H", "x":10, "y":3.5}, {"label":"J", "x":11, "y":3.5}, {"label":"K", "x":12, "y":3.5}, {"label":"L", "x":13, "y":3.5}, {"label":":", "x":14, "y":3.5}, {"label":"\"", "x":15, "y":3.5}, {"label":"Enter", "x":16, "y":3.5, "w":2.25}, {"x":3.25, "y":4.5, "w":1.25}, {"x":4.5, "y":4.5}, {"label":"Z", "x":5.5, "y":4.5}, {"label":"X", "x":6.5, "y":4.5}, {"label":"C", "x":7.5, "y":4.5}, {"label":"V", "x":8.5, "y":4.5}, {"label":"B", "x":9.5, "y":4.5}, {"label":"N", "x":10.5, "y":4.5}, {"label":"M", "x":11.5, "y":4.5}, {"label":"<", "x":12.5, "y":4.5}, {"label":">", "x":13.5, "y":4.5}, {"label":"?", "x":14.5, "y":4.5}, {"x":15.5, "y":4.5}, {"label":"Shift", "x":16.5, "y":4.5, "w":1.25}, {"label":"\u2191", "x":17.75, "y":4.5}, {"label":"Win", "x":4.5, "y":5.5}, {"label":"Alt", "x":5.5, "y":5.5, "w":1.25}, {"x":6.75, "y":5.5, "w":6.25}, {"label":"Ctrl", "x":13, "y":5.5, "w":1.25}, {"label":"Fn", "x":14.25, "y":5.5}, {"label":"\u2190", "x":16.75, "y":5.5}, {"label":"\u2193", "x":17.75, "y":5.5}, {"label":"\u2192", "x":18.75, "y":5.5}] - }, - "LAYOUT_iso": { - "layout": [{"label":"~", "x":3.25, "y":1.5}, {"label":"!", "x":4.25, "y":1.5}, {"label":"@", "x":5.25, "y":1.5}, {"label":"#", "x":6.25, "y":1.5}, {"label":"$", "x":7.25, "y":1.5}, {"label":"%", "x":8.25, "y":1.5}, {"label":"^", "x":9.25, "y":1.5}, {"label":"&", "x":10.25, "y":1.5}, {"label":"*", "x":11.25, "y":1.5}, {"label":"(", "x":12.25, "y":1.5}, {"label":")", "x":13.25, "y":1.5}, {"label":"_", "x":14.25, "y":1.5}, {"label":"+", "x":15.25, "y":1.5}, {"label":"|", "x":16.25, "y":1.5}, {"label":"Del", "x":17.25, "y":1.5}, {"label":"Insert", "x":18.75, "y":1.5}, {"label":"Tab", "x":3.25, "y":2.5, "w":1.5}, {"label":"Q", "x":4.75, "y":2.5}, {"label":"W", "x":5.75, "y":2.5}, {"label":"E", "x":6.75, "y":2.5}, {"label":"R", "x":7.75, "y":2.5}, {"label":"T", "x":8.75, "y":2.5}, {"label":"Y", "x":9.75, "y":2.5}, {"label":"U", "x":10.75, "y":2.5}, {"label":"I", "x":11.75, "y":2.5}, {"label":"O", "x":12.75, "y":2.5}, {"label":"P", "x":13.75, "y":2.5}, {"label":"{", "x":14.75, "y":2.5}, {"label":"}", "x":15.75, "y":2.5}, {"label":"Enter", "x":17, "y":2.5, "w":1.25, "h":2}, {"label":"Delete", "x":18.75, "y":2.5}, {"label":"Control", "x":3.25, "y":3.5, "w":1.75}, {"label":"A", "x":5, "y":3.5}, {"label":"S", "x":6, "y":3.5}, {"label":"D", "x":7, "y":3.5}, {"label":"F", "x":8, "y":3.5}, {"label":"G", "x":9, "y":3.5}, {"label":"H", "x":10, "y":3.5}, {"label":"J", "x":11, "y":3.5}, {"label":"K", "x":12, "y":3.5}, {"label":"L", "x":13, "y":3.5}, {"label":":", "x":14, "y":3.5}, {"label":"\"", "x":15, "y":3.5}, {"x":16, "y":3.5}, {"x":3.25, "y":4.5, "w":1.25}, {"x":4.5, "y":4.5}, {"label":"Z", "x":5.5, "y":4.5}, {"label":"X", "x":6.5, "y":4.5}, {"label":"C", "x":7.5, "y":4.5}, {"label":"V", "x":8.5, "y":4.5}, {"label":"B", "x":9.5, "y":4.5}, {"label":"N", "x":10.5, "y":4.5}, {"label":"M", "x":11.5, "y":4.5}, {"label":"<", "x":12.5, "y":4.5}, {"label":">", "x":13.5, "y":4.5}, {"label":"?", "x":14.5, "y":4.5}, {"x":15.5, "y":4.5}, {"label":"Shift", "x":16.5, "y":4.5, "w":1.25}, {"label":"\u2191", "x":17.75, "y":4.5}, {"label":"Win", "x":4.5, "y":5.5}, {"label":"Alt", "x":5.5, "y":5.5, "w":1.25}, {"x":6.75, "y":5.5, "w":6.25}, {"label":"Ctrl", "x":13, "y":5.5, "w":1.25}, {"label":"Fn", "x":14.25, "y":5.5}, {"label":"\u2190", "x":16.75, "y":5.5}, {"label":"\u2193", "x":17.75, "y":5.5}, {"label":"\u2192", "x":18.75, "y":5.5}] - } + "keyboard_name": "Baguette", + "url": "", + "maintainer": "qmk", + "bootloader": "atmel-dfu", + "width": 16.5, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0}, + {"label":"Backspace2", "x":14, "y":0}, + {"label":"Insert", "x":15.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Delete", "x":15.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"JP RO", "x":12.25, "y":3}, + {"label":"Shift", "x":13.25, "y":3, "w":1.25}, + {"label":"Up", "x":14.5, "y":3}, + {"label":"GUI", "x":1.25, "y":4}, + {"label":"Alt", "x":2.25, "y":4, "w":1.25}, + {"label":"Space", "x":3.5, "y":4, "w":6.25}, + {"label":"Ctrl", "x":9.75, "y":4, "w":1.25}, + {"label":"Fn", "x":11, "y":4}, + {"label":"Left", "x":13.5, "y":4}, + {"label":"Down", "x":14.5, "y":4}, + {"label":"Right", "x":15.5, "y":4} + ] + }, + + "LAYOUT_iso": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0}, + {"label":"Backspace2", "x":14, "y":0}, + {"label":"Insert", "x":15.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"Delete", "x":15.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"ISO #", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"JP_RO", "x":12.25, "y":3}, + {"label":"Shift", "x":13.25, "y":3, "w":1.25}, + {"label":"Up", "x":14.5, "y":3}, + {"label":"GUI", "x":1.25, "y":4}, + {"label":"Alt", "x":2.25, "y":4, "w":1.25}, + {"label":"Space", "x":3.5, "y":4, "w":6.25}, + {"label":"Ctrl", "x":9.75, "y":4, "w":1.25}, + {"label":"Fn", "x":11, "y":4}, + {"label":"Left", "x":13.5, "y":4}, + {"label":"Down", "x":14.5, "y":4}, + {"label":"Right", "x":15.5, "y":4} + ] } + } } diff --git a/keyboards/baguette/readme.md b/keyboards/baguette/readme.md index d211af16a54..e6188cc9904 100644 --- a/keyboards/baguette/readme.md +++ b/keyboards/baguette/readme.md @@ -6,7 +6,7 @@ Baguette This is a custom keyboard with backlight inspired by France. Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) -Hardware Supported: ATMEGA 32u4 MCU with backlight support. +Hardware Supported: ATMEGA 32u4 MCU with backlight support. Hardware Availability: Closed group-buy please contact the runners (Tesletron and Enjoy) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/baguette/rules.mk b/keyboards/baguette/rules.mk index 062ff1b22c6..de88b9798b4 100644 --- a/keyboards/baguette/rules.mk +++ b/keyboards/baguette/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/bantam44/config.h b/keyboards/bantam44/config.h index a55f629990a..5b1885d83c2 100644 --- a/keyboards/bantam44/config.h +++ b/keyboards/bantam44/config.h @@ -49,18 +49,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/bantam44/keymaps/default/keymap.c b/keyboards/bantam44/keymaps/default/keymap.c index 0e15bebf86d..7f92da08d55 100644 --- a/keyboards/bantam44/keymaps/default/keymap.c +++ b/keyboards/bantam44/keymaps/default/keymap.c @@ -23,11 +23,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_TRNS, KC_SPC, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT \ ) }; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // MACRODOWN only works in this function -{ - return MACRO_NONE; -}; diff --git a/keyboards/bantam44/readme.md b/keyboards/bantam44/readme.md index 0103c164725..08a5167c6f9 100644 --- a/keyboards/bantam44/readme.md +++ b/keyboards/bantam44/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make bantam44:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/bantam44/rules.mk b/keyboards/bantam44/rules.mk index f245a3ba102..cebe7f46407 100644 --- a/keyboards/bantam44/rules.mk +++ b/keyboards/bantam44/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/bface/README.md b/keyboards/bface/README.md deleted file mode 100644 index 4120e3bc2de..00000000000 --- a/keyboards/bface/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# B.face - -A 60% keyboard with RGB that runs ps2avrgb natively. Please note that the B.face and B.fake have different switch matrices. Firmware on one, will not work on the other. - -Keyboard Maintainer: QMK Community -Hardware Supported: B.face PCB -Hardware Availability: [Winkeyless](https://winkeyless.kr/product/b-face-x2-pcb/) - -Make example for this keyboard (after setting up your build environment): - - make bface:default - -Flashing - -ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. - -Windows: -1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). -2. Place your keyboard into reset. -3. Press the `Find Device` button and ensure that your keyboard is found. -4. Press the `Open .hex File` button and locate the `.hex` file you created. -5. Press the `Flash Device` button and wait for the process to complete. - -macOS: -1. Install homebrew by typing the following: - ``` - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - ``` -2. Install `crosspack-avr`. - ``` - brew cask install crosspack-avr - ``` -3. Install the following packages: - ``` - brew install python - brew install pyusb - brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb - ``` - -4. Place your keyboard into reset. -5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. - - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/bface/backlight_ps2avrGB.c b/keyboards/bface/backlight_ps2avrGB.c deleted file mode 100644 index c0f6428407c..00000000000 --- a/keyboards/bface/backlight_ps2avrGB.c +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright 2017 Sebastian Kaim - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifdef BACKLIGHT_ENABLE - -#include "backlight_ps2avrGB.h" -#define sbi(reg,bit) reg |= (_BV(bit)) -#define cbi(reg,bit) reg &= (~_BV(bit)) -#define PWM10 WGM10 -#define PWM11 WGM11 -#define COM1x1 COM1B1 -#define OCR1x OCR1B - -void backlight_init_ports(void) -{ -#if BACKLIGHT_ON_STATE == 0 - backlight_off(); -#else - backlight_on(); -#endif - - // setup pwm - // this bitmagic is sourced from the original firmware - /*TCCR1B = ((TCCR1B & ~0x07) | 0x03); - TCNT1H = 0; - TCNT1L = 0; - sbi(TIMSK, TOIE1); - OCR1BH = 0; - OCR1BL = 0; - cbi(TCCR1A,PWM11); - sbi(TCCR1A,PWM10); - sbi(TCCR1A,COM1B1); - cbi(TCCR1A,COM1B0);*/ - ICR1 = 0xFFFF; - - TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010; - TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; - - backlight_init(); -} - -void backlight_set(uint8_t level) -{ - if( level == 0 ) { - backlight_off(); - } - else { - backlight_on(); - /*uint8_t pwm = get_pwm_for_brightness(level); - set_backlight_pwm(pwm); - TCCR1A |= _BV(COM1x1); - OCR1x = (level >= 2) ? 0xFFFF : 0x00FF;*/ - } -} - -#define PWM_MAX 0xFF -uint8_t get_pwm_for_brightness(uint8_t level) -{ - // we need to cast up here to allow multiplication with 0xFF. We could also use floats, but this is probably a lot faster. - uint16_t brightness = (uint16_t)level * (uint16_t)PWM_MAX / (uint16_t)BACKLIGHT_LEVELS; - return (uint8_t)brightness; -} - -void backlight_on(void) -{ - //_SFR_IO8(0x12) |= _BV(0x4); - LED_PIN |= BACKLIGHT_PORT_NUM; -} - -void backlight_off(void) -{ - //_SFR_IO8(0x12) &= ~_BV(0x4); - LED_PIN &= ~BACKLIGHT_PORT_NUM; -} - -void set_backlight_pwm(uint8_t level) { - // this does not work (yet) - //OCR1B = level; -} - -#endif // BACKLIGHT_ENABLE diff --git a/keyboards/bface/backlight_ps2avrGB.h b/keyboards/bface/backlight_ps2avrGB.h deleted file mode 100644 index d5ca9039936..00000000000 --- a/keyboards/bface/backlight_ps2avrGB.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2017 Sebastian Kaim - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#if defined(__AVR__) -#include -#include -#include -#endif -#include -#include -#include "backlight.h" - -#ifndef PS2AVRGB_BACKLIGHT_H -#define PS2AVRGB_BACKLIGHT_H - -uint8_t get_pwm_for_brightness(uint8_t level); -void set_backlight_pwm(uint8_t level); -void backlight_on(void); -void backlight_off(void); - -#endif diff --git a/keyboards/bface/bface.c b/keyboards/bface/bface.c deleted file mode 100644 index 8422a4a40b0..00000000000 --- a/keyboards/bface/bface.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro -Copyright 2018 Sebastian Kaim - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "bface.h" -#include "rgblight.h" - -#include - -#include "action_layer.h" -#include "i2c.h" -#include "quantum.h" - -extern rgblight_config_t rgblight_config; - -void rgblight_set(void) { - if (!rgblight_config.enable) { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; - } - } - - i2c_init(); - i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { - rgblight_task(); -} diff --git a/keyboards/bface/bface.h b/keyboards/bface/bface.h deleted file mode 100644 index 62d62f69531..00000000000 --- a/keyboards/bface/bface.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro -Copyright 2017 Sebastian Kaim - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include "quantum_keycodes.h" -#include "keycode.h" -#include "action.h" - -#define LAYOUT_60_ansi( \ - K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \ - K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, \ - K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, \ - K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, \ - K00, K10, K20, K56, K57, KA0, KB0, KC0 \ -){ \ - { K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KA0, KB0, KC0, KC_NO, KC_NO }, \ - { K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KC_NO, KC_NO }, \ - { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC_NO, KD2, KC_NO }, \ - { K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ - { K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, K16, K26, K36, K46, K56, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB6, KC6, KD6, KE6 }, \ - { KC_NO, K17, K27, K37, K47, K57, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB7, KC7, KD7, KE7 } \ -} - - -#endif diff --git a/keyboards/bface/config.h b/keyboards/bface/config.h deleted file mode 100644 index 3d74af4f14a..00000000000 --- a/keyboards/bface/config.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro -Copyright 2017 Sebastian Kaim - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#define VENDOR_ID 0x20A0 -#define PRODUCT_ID 0x422D -// You can edit those at usbconfig.h about line 250. These values will -// unforunatly be ignored so far -#define MANUFACTURER winkeyless.kr -#define PRODUCT b.face - -/* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 15 - -#define RGBLED_NUM 16 -#define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 -#define BOOTLOADHID_BOOTLOADER 1 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - -#ifdef BACKLIGHT_ENABLE - // the backlight PWM does not work (yet). Therefore, we only have two backlight levels (on/off) - #define BACKLIGHT_LEVELS 1 - #define LED_PIN PORTD - #define BACKLIGHT_PORT_NUM (1 << 4) -#endif - -#endif diff --git a/keyboards/bface/i2c.c b/keyboards/bface/i2c.c deleted file mode 100644 index c27f3e3d17e..00000000000 --- a/keyboards/bface/i2c.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif diff --git a/keyboards/bface/keymaps/default/keymap.c b/keyboards/bface/keymaps/default/keymap.c deleted file mode 100644 index c29ce9abfa3..00000000000 --- a/keyboards/bface/keymaps/default/keymap.c +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2017 Sebastian Kaim - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_60_ansi( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, - KC_F1, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, - KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL,KC_LALT,KC_LGUI, KC_SPC, KC_RALT,KC_RGUI,MO(1), KC_RCTL - ), - [1] = LAYOUT_60_ansi( - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,BL_INC, BL_DEC, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,RGB_SMOD,KC_TRNS,BL_ON, BL_OFF, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - ), - /* You can copy this layer as base for a new fn layer * / - [n] = LAYOUT_60_ansi( - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - ), // */ -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), -}; diff --git a/keyboards/bface/matrix.c b/keyboards/bface/matrix.c deleted file mode 100644 index b3761a63cad..00000000000 --- a/keyboards/bface/matrix.c +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include - -#include "matrix.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_init(void) { - // all outputs for rows high - DDRB = 0xFF; - PORTB = 0xFF; - // all inputs for columns - DDRA = 0x00; - DDRC &= ~(0x111111<<2); - DDRD &= ~(1<> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x; -} - -uint8_t matrix_scan(void) { - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - matrix_set_row_status(row); - _delay_us(5); - - matrix_row_t cols = ( - // cols 0..7, PORTA 0 -> 7 - (~PINA) & 0xFF - ) | ( - // cols 8..13, PORTC 7 -> 0 - bit_reverse((~PINC) & 0xFF) << 8 - ) | ( - // col 14, PORTD 7 - ((~PIND) & (1 << PIND7)) << 7 - ); - - if (matrix_debouncing[row] != cols) { - matrix_debouncing[row] = cols; - debouncing = DEBOUNCE; - } - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_user(); - - return 1; -} - -inline matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - -void matrix_print(void) { -} diff --git a/keyboards/bface/program b/keyboards/bface/program deleted file mode 100755 index 298e645477d..00000000000 --- a/keyboards/bface/program +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro , Sebastian Kaim -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from __future__ import print_function - -import os -import sys -import time -import usb - - -def checkForKeyboardInNormalMode(): - """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" - return usb.core.find(idVendor=0x20A0, idProduct=0x422D) - -def checkForKeyboardInBootloaderMode(): - """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" - return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) - -def flashKeyboard(firmware_file): - """Calls bootloadHID to flash the given file to the device.""" - print('Flashing firmware to device ...') - if os.system('bootloadHID -r "%s"' % firmware_file) == 0: - print('\nDone!') - else: - print('\nbootloadHID returned an error.') - -def printDeviceInfo(dev): - """Prints all infos for a given USB device""" - print('Device Information:') - print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) - print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) - print('Manufacturer: %s' % (dev.iManufacturer)) - print('Serial: %s' % (dev.iSerialNumber)) - print('Product: %s' % (dev.iProduct), end='\n\n') - -def sendDeviceToBootloaderMode(dev): - """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" - try: - dev.set_configuration() - - request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - - USBRQ_HID_SET_REPORT = 0x09 - HID_REPORT_OPTION = 0x0301 - - dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5) - except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - - -if len(sys.argv) < 2: - print('Usage: %s ' % sys.argv[0]) - sys.exit(1) - -kb = checkForKeyboardInNormalMode() - -if kb is not None: - print('Found a keyboad in normal mode. Attempting to send it to bootloader mode ...', end='') - sendDeviceToBootloaderMode(kb) - print(' done.') - print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") - print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") - -attempts = 12 # 60 seconds -found = False -for attempt in range(1, attempts + 1): - print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') - - if checkForKeyboardInBootloaderMode(): - print('Found', end='\n\n') - flashKeyboard(sys.argv[1]) - found = True - break - else: - print('Nothing.', end='') - - if attempt != attempts: # no need to wait on the last attempt - print(' Sleeping 5 seconds.', end='') - time.sleep(5) - - # print a newline - print() - -if not found: - print("Couldn't find a flashable keyboard. Aborting.") - sys.exit(2) - diff --git a/keyboards/bface/rules.mk b/keyboards/bface/rules.mk deleted file mode 100644 index 95b6c8a97a6..00000000000 --- a/keyboards/bface/rules.mk +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2017 Luiz Ribeiro -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# MCU name -MCU = atmega32a -PROTOCOL = VUSB - -# unsupported features for now -NO_UART = yes -NO_SUSPEND_POWER_DOWN = yes - -# processor frequency -F_CPU = 12000000 - -# build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = no -COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = yes -BACKLIGHT_CUSTOM_DRIVER = yes -BACKLIGHT_BREATHING = no -RGBLIGHT_ENABLE = yes -RGBLIGHT_CUSTOM_DRIVER = yes - -OPT_DEFS = -DDEBUG_LEVEL=0 -OPT_DEFS += -DBOOTLOADER_SIZE=2048 - -# custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c backlight_ps2avrGB.c - -# programming options -PROGRAM_CMD = ./keyboards/bface/program .build/$(TARGET).hex - -LAYOUTS = 60_ansi diff --git a/keyboards/bface/usbconfig.h b/keyboards/bface/usbconfig.h deleted file mode 100644 index f87922615b3..00000000000 --- a/keyboards/bface/usbconfig.h +++ /dev/null @@ -1,396 +0,0 @@ -/* Name: usbconfig.h - * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers - * Author: Christian Starkjohann - * Creation Date: 2005-04-01 - * Tabsize: 4 - * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ - */ - -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ - -#include "config.h" - -/* -General Description: -This file is an example configuration (with inline documentation) for the USB -driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is -also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may -wire the lines to any other port, as long as D+ is also wired to INT0 (or any -other hardware interrupt, as long as it is the highest level interrupt, see -section at the end of this file). -*/ - -/* ---------------------------- Hardware Config ---------------------------- */ - -#define USB_CFG_IOPORTNAME D -/* This is the port where the USB bus is connected. When you configure it to - * "B", the registers PORTB, PINB and DDRB will be used. - */ -#define USB_CFG_DMINUS_BIT 3 -/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. - * This may be any bit in the port. - */ -#define USB_CFG_DPLUS_BIT 2 -/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. - * This may be any bit in the port. Please note that D+ must also be connected - * to interrupt pin INT0! [You can also use other interrupts, see section - * "Optional MCU Description" below, or you can connect D- to the interrupt, as - * it is required if you use the USB_COUNT_SOF feature. If you use D- for the - * interrupt, the USB interrupt will also be triggered at Start-Of-Frame - * markers every millisecond.] - */ -#define USB_CFG_CLOCK_KHZ (F_CPU/1000) -/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, - * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code - * require no crystal, they tolerate +/- 1% deviation from the nominal - * frequency. All other rates require a precision of 2000 ppm and thus a - * crystal! - * Since F_CPU should be defined to your actual clock rate anyway, you should - * not need to modify this setting. - */ -#define USB_CFG_CHECK_CRC 0 -/* Define this to 1 if you want that the driver checks integrity of incoming - * data packets (CRC checks). CRC checks cost quite a bit of code size and are - * currently only available for 18 MHz crystal clock. You must choose - * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. - */ - -/* ----------------------- Optional Hardware Config ------------------------ */ - -/* #define USB_CFG_PULLUP_IOPORTNAME D */ -/* If you connect the 1.5k pullup resistor from D- to a port pin instead of - * V+, you can connect and disconnect the device from firmware by calling - * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). - * This constant defines the port on which the pullup resistor is connected. - */ -/* #define USB_CFG_PULLUP_BIT 4 */ -/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined - * above) where the 1.5k pullup resistor is connected. See description - * above for details. - */ - -/* --------------------------- Functional Range ---------------------------- */ - -#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 -/* Define this to 1 if you want to compile a version with two endpoints: The - * default control endpoint 0 and an interrupt-in endpoint (any other endpoint - * number). - */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 -/* Define this to 1 if you want to compile a version with three endpoints: The - * default control endpoint 0, an interrupt-in endpoint 3 (or the number - * configured below) and a catch-all default interrupt-in endpoint as above. - * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. - */ -#define USB_CFG_EP3_NUMBER 3 -/* If the so-called endpoint 3 is used, it can now be configured to any other - * endpoint number (except 0) with this macro. Default if undefined is 3. - */ -/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ -/* The above macro defines the startup condition for data toggling on the - * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. - * Since the token is toggled BEFORE sending any data, the first packet is - * sent with the oposite value of this configuration! - */ -#define USB_CFG_IMPLEMENT_HALT 0 -/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature - * for endpoint 1 (interrupt endpoint). Although you may not need this feature, - * it is required by the standard. We have made it a config option because it - * bloats the code considerably. - */ -#define USB_CFG_SUPPRESS_INTR_CODE 0 -/* Define this to 1 if you want to declare interrupt-in endpoints, but don't - * want to send any data over them. If this macro is defined to 1, functions - * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if - * you need the interrupt-in endpoints in order to comply to an interface - * (e.g. HID), but never want to send any data. This option saves a couple - * of bytes in flash memory and the transmit buffers in RAM. - */ -#define USB_CFG_INTR_POLL_INTERVAL 1 -/* If you compile a version with endpoint 1 (interrupt-in), this is the poll - * interval. The value is in milliseconds and must not be less than 10 ms for - * low speed devices. - */ -#define USB_CFG_IS_SELF_POWERED 0 -/* Define this to 1 if the device has its own power supply. Set it to 0 if the - * device is powered from the USB bus. - */ -#define USB_CFG_MAX_BUS_POWER 500 -/* Set this variable to the maximum USB bus power consumption of your device. - * The value is in milliamperes. [It will be divided by two since USB - * communicates power requirements in units of 2 mA.] - */ -#define USB_CFG_IMPLEMENT_FN_WRITE 1 -/* Set this to 1 if you want usbFunctionWrite() to be called for control-out - * transfers. Set it to 0 if you don't need it and want to save a couple of - * bytes. - */ -#define USB_CFG_IMPLEMENT_FN_READ 0 -/* Set this to 1 if you need to send control replies which are generated - * "on the fly" when usbFunctionRead() is called. If you only want to send - * data from a static buffer, set it to 0 and return the data from - * usbFunctionSetup(). This saves a couple of bytes. - */ -#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 -/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. - * You must implement the function usbFunctionWriteOut() which receives all - * interrupt/bulk data sent to any endpoint other than 0. The endpoint number - * can be found in 'usbRxToken'. - */ -#define USB_CFG_HAVE_FLOWCONTROL 0 -/* Define this to 1 if you want flowcontrol over USB data. See the definition - * of the macros usbDisableAllRequests() and usbEnableAllRequests() in - * usbdrv.h. - */ -#define USB_CFG_DRIVER_FLASH_PAGE 0 -/* If the device has more than 64 kBytes of flash, define this to the 64 k page - * where the driver's constants (descriptors) are located. Or in other words: - * Define this to 1 for boot loaders on the ATMega128. - */ -#define USB_CFG_LONG_TRANSFERS 0 -/* Define this to 1 if you want to send/receive blocks of more than 254 bytes - * in a single control-in or control-out transfer. Note that the capability - * for long transfers increases the driver size. - */ -/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ -/* This macro is a hook if you want to do unconventional things. If it is - * defined, it's inserted at the beginning of received message processing. - * If you eat the received message and don't want default processing to - * proceed, do a return after doing your things. One possible application - * (besides debugging) is to flash a status LED on each packet. - */ -/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ -/* This macro is a hook if you need to know when an USB RESET occurs. It has - * one parameter which distinguishes between the start of RESET state and its - * end. - */ -/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ -/* This macro (if defined) is executed when a USB SET_ADDRESS request was - * received. - */ -#define USB_COUNT_SOF 1 -/* define this macro to 1 if you need the global variable "usbSofCount" which - * counts SOF packets. This feature requires that the hardware interrupt is - * connected to D- instead of D+. - */ -/* #ifdef __ASSEMBLER__ - * macro myAssemblerMacro - * in YL, TCNT0 - * sts timer0Snapshot, YL - * endm - * #endif - * #define USB_SOF_HOOK myAssemblerMacro - * This macro (if defined) is executed in the assembler module when a - * Start Of Frame condition is detected. It is recommended to define it to - * the name of an assembler macro which is defined here as well so that more - * than one assembler instruction can be used. The macro may use the register - * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages - * immediately after an SOF pulse may be lost and must be retried by the host. - * What can you do with this hook? Since the SOF signal occurs exactly every - * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in - * designs running on the internal RC oscillator. - * Please note that Start Of Frame detection works only if D- is wired to the - * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! - */ -#define USB_CFG_CHECK_DATA_TOGGLING 0 -/* define this macro to 1 if you want to filter out duplicate data packets - * sent by the host. Duplicates occur only as a consequence of communication - * errors, when the host does not receive an ACK. Please note that you need to - * implement the filtering yourself in usbFunctionWriteOut() and - * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable - * for each control- and out-endpoint to check for duplicate packets. - */ -#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 -/* define this macro to 1 if you want the function usbMeasureFrameLength() - * compiled in. This function can be used to calibrate the AVR's RC oscillator. - */ -#define USB_USE_FAST_CRC 0 -/* The assembler module has two implementations for the CRC algorithm. One is - * faster, the other is smaller. This CRC routine is only used for transmitted - * messages where timing is not critical. The faster routine needs 31 cycles - * per byte while the smaller one needs 61 to 69 cycles. The faster routine - * may be worth the 32 bytes bigger code size if you transmit lots of data and - * run the AVR close to its limit. - */ - -/* -------------------------- Device Description --------------------------- */ - -#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) -/* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you may use one of obdev's free - * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) -/* This is the ID of the product, low byte first. It is interpreted in the - * scope of the vendor ID. If you have registered your own VID with usb.org - * or if you have licensed a PID from somebody else, define it here. Otherwise - * you may use one of obdev's free shared VID/PID pairs. See the file - * USB-IDs-for-free.txt for details! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_VERSION 0x00, 0x02 -/* Version number of the device: Minor number first, then major number. - */ -#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' -#define USB_CFG_VENDOR_NAME_LEN 13 -/* These two values define the vendor name returned by the USB device. The name - * must be given as a list of characters under single quotes. The characters - * are interpreted as Unicode (UTF-16) entities. - * If you don't want a vendor name string, undefine these macros. - * ALWAYS define a vendor name containing your Internet domain name if you use - * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for - * details. - */ -#define USB_CFG_DEVICE_NAME 'b', '.', 'f', 'a', 'c', 'e' -#define USB_CFG_DEVICE_NAME_LEN 6 -/* Same as above for the device name. If you don't want a device name, undefine - * the macros. See the file USB-IDs-for-free.txt before you assign a name if - * you use a shared VID/PID. - */ -/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ -/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ -/* Same as above for the serial number. If you don't want a serial number, - * undefine the macros. - * It may be useful to provide the serial number through other means than at - * compile time. See the section about descriptor properties below for how - * to fine tune control over USB descriptors such as the string descriptor - * for the serial number. - */ -#define USB_CFG_DEVICE_CLASS 0 -#define USB_CFG_DEVICE_SUBCLASS 0 -/* See USB specification if you want to conform to an existing device class. - * Class 0xff is "vendor specific". - */ -#define USB_CFG_INTERFACE_CLASS 3 /* HID */ -#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ -#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ -/* See USB specification if you want to conform to an existing device class or - * protocol. The following classes must be set at interface level: - * HID class is 3, no subclass and protocol required (but may be useful!) - * CDC class is 2, use subclass 2 and protocol 1 for ACM - */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 -/* Define this to the length of the HID report descriptor, if you implement - * an HID device. Otherwise don't define it or define it to 0. - * If you use this define, you must add a PROGMEM character array named - * "usbHidReportDescriptor" to your code which contains the report descriptor. - * Don't forget to keep the array and this define in sync! - */ - -/* #define USB_PUBLIC static */ -/* Use the define above if you #include usbdrv.c instead of linking against it. - * This technique saves a couple of bytes in flash memory. - */ - -/* ------------------- Fine Control over USB Descriptors ------------------- */ -/* If you don't want to use the driver's default USB descriptors, you can - * provide our own. These can be provided as (1) fixed length static data in - * flash memory, (2) fixed length static data in RAM or (3) dynamically at - * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more - * information about this function. - * Descriptor handling is configured through the descriptor's properties. If - * no properties are defined or if they are 0, the default descriptor is used. - * Possible properties are: - * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched - * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is - * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if - * you want RAM pointers. - * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found - * in static memory is in RAM, not in flash memory. - * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), - * the driver must know the descriptor's length. The descriptor itself is - * found at the address of a well known identifier (see below). - * List of static descriptor names (must be declared PROGMEM if in flash): - * char usbDescriptorDevice[]; - * char usbDescriptorConfiguration[]; - * char usbDescriptorHidReport[]; - * char usbDescriptorString0[]; - * int usbDescriptorStringVendor[]; - * int usbDescriptorStringDevice[]; - * int usbDescriptorStringSerialNumber[]; - * Other descriptors can't be provided statically, they must be provided - * dynamically at runtime. - * - * Descriptor properties are or-ed or added together, e.g.: - * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) - * - * The following descriptors are defined: - * USB_CFG_DESCR_PROPS_DEVICE - * USB_CFG_DESCR_PROPS_CONFIGURATION - * USB_CFG_DESCR_PROPS_STRINGS - * USB_CFG_DESCR_PROPS_STRING_0 - * USB_CFG_DESCR_PROPS_STRING_VENDOR - * USB_CFG_DESCR_PROPS_STRING_PRODUCT - * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER - * USB_CFG_DESCR_PROPS_HID - * USB_CFG_DESCR_PROPS_HID_REPORT - * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) - * - * Note about string descriptors: String descriptors are not just strings, they - * are Unicode strings prefixed with a 2 byte header. Example: - * int serialNumberDescriptor[] = { - * USB_STRING_DESCRIPTOR_HEADER(6), - * 'S', 'e', 'r', 'i', 'a', 'l' - * }; - */ - -#define USB_CFG_DESCR_PROPS_DEVICE 0 -#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 -#define USB_CFG_DESCR_PROPS_STRINGS 0 -#define USB_CFG_DESCR_PROPS_STRING_0 0 -#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 -#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 -#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 -#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID 0 -#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 -#define USB_CFG_DESCR_PROPS_UNKNOWN 0 - -#define usbMsgPtr_t unsigned short -/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to - * a scalar type here because gcc generates slightly shorter code for scalar - * arithmetics than for pointer arithmetics. Remove this define for backward - * type compatibility or define it to an 8 bit type if you use data in RAM only - * and all RAM is below 256 bytes (tiny memory model in IAR CC). - */ - -/* ----------------------- Optional MCU Description ------------------------ */ - -/* The following configurations have working defaults in usbdrv.h. You - * usually don't need to set them explicitly. Only if you want to run - * the driver on a device which is not yet supported or with a compiler - * which is not fully supported (such as IAR C) or if you use a differnt - * interrupt than INT0, you may have to define some of these. - */ -/* #define USB_INTR_CFG MCUCR */ -/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE GIMSK */ -/* #define USB_INTR_ENABLE_BIT INT0 */ -/* #define USB_INTR_PENDING GIFR */ -/* #define USB_INTR_PENDING_BIT INTF0 */ -/* #define USB_INTR_VECTOR INT0_vect */ - -/* Set INT1 for D- falling edge to count SOF */ -/* #define USB_INTR_CFG EICRA */ -#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE EIMSK */ -#define USB_INTR_ENABLE_BIT INT1 -/* #define USB_INTR_PENDING EIFR */ -#define USB_INTR_PENDING_BIT INTF1 -#define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/bfake/config.h b/keyboards/bfake/config.h index de8c4b5df54..8a43aacd9b8 100644 --- a/keyboards/bfake/config.h +++ b/keyboards/bfake/config.h @@ -35,15 +35,11 @@ along with this program. If not, see . #define UNUSED_PINS #define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 -#define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS #define NO_UART 1 -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - #endif diff --git a/keyboards/bfake/readme.md b/keyboards/bfake/readme.md index ca12b499625..1ccc25f2dc9 100644 --- a/keyboards/bfake/readme.md +++ b/keyboards/bfake/readme.md @@ -41,4 +41,4 @@ macOS: 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/bfo9000/bfo9000.h b/keyboards/bfo9000/bfo9000.h deleted file mode 100644 index c3bd2236cef..00000000000 --- a/keyboards/bfo9000/bfo9000.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef BFO9000_H -#define BFO9000_H - -#include "quantum.h" - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, L07, L08, R00, R01, R02, R03, R04, R05, R06, R07, R08, \ - L10, L11, L12, L13, L14, L15, L16, L17, L18, R10, R11, R12, R13, R14, R15, R16, R17, R18, \ - L20, L21, L22, L23, L24, L25, L26, L27, L28, R20, R21, R22, R23, R24, R25, R26, R27, R28, \ - L30, L31, L32, L33, L34, L35, L36, L37, L38, R30, R31, R32, R33, R34, R35, R36, R37, R38, \ - L40, L41, L42, L43, L44, L45, L46, L47, L48, R40, R41, R42, R43, R44, R45, R46, R47, R48, \ - L50, L51, L52, L53, L54, L55, L56, L57, L58, R50, R51, R52, R53, R54, R55, R56, R57, R58 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06, L07, L08 }, \ - { L10, L11, L12, L13, L14, L15, L16, L17, L18 }, \ - { L20, L21, L22, L23, L24, L25, L26, L27, L28 }, \ - { L30, L31, L32, L33, L34, L35, L36, L37, L38 }, \ - { L40, L41, L42, L43, L44, L45, L46, L47, L48 }, \ - { L50, L51, L52, L53, L54, L55, L56, L57, L58 }, \ - { R00, R01, R02, R03, R04, R05, R06, R07, R08 }, \ - { R10, R11, R12, R13, R14, R15, R16, R17, R18 }, \ - { R20, R21, R22, R23, R24, R25, R26, R27, R28 }, \ - { R30, R31, R32, R33, R34, R35, R36, R37, R38 }, \ - { R40, R41, R42, R43, R44, R45, R46, R47, R48 }, \ - { R50, R51, R52, R53, R54, R55, R56, R57, R58 } \ - } - -#endif diff --git a/keyboards/bfo9000/config.h b/keyboards/bfo9000/config.h deleted file mode 100644 index 893fa5ab6a4..00000000000 --- a/keyboards/bfo9000/config.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1169 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT BFO-9000 -#define DESCRIPTION Really big split ortholinear keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 12 -#define MATRIX_COLS 9 - -// wiring of each half -#define MATRIX_ROW_PINS { D3, D2, D4, C6, D7, E6 } -#define MATRIX_COL_PINS { B5, B6, B2, B3, B1, F7, F6, F5, F4 } - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN B4 - -#define RGBLED_NUM 20 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - - -#endif diff --git a/keyboards/bfo9000/i2c.c b/keyboards/bfo9000/i2c.c deleted file mode 100644 index 084c890c405..00000000000 --- a/keyboards/bfo9000/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/bfo9000/keymaps/andylikescandy6x18/keymap.c b/keyboards/bfo9000/keymaps/andylikescandy6x18/keymap.c deleted file mode 100644 index 24208e2a890..00000000000 --- a/keyboards/bfo9000/keymaps/andylikescandy6x18/keymap.c +++ /dev/null @@ -1,87 +0,0 @@ -#include QMK_KEYBOARD_H - -#include "action_layer.h" - - - -#define _BASE 0 -#define _QWERTY 1 -#define _RAISE 2 -#define _NAVIGATION 3 - - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -//Switch Layouts -#define SWBASE M(_BASE) -#define SWQWERTY M(_QWERTY) - -// layer access -#define RSESPC LT( 2, KC_SPC) -#define NAVSPC LT( 3, KC_SPC) - -// Key Combos -#define CTRLSFT LCTL(KC_LSFT) -#define CTLALTSFT LALT(LCTL(KC_LSFT)) -#define CTLALTDEL LALT(LCTL(KC_DEL)) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[_BASE] = LAYOUT( \ - CTLALTSFT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCREEN, KC_PAUSE, KC_CAPS, KC_INSERT, KC_EQL, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_END, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_PGUP, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_DEL, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PGDN, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, SFT_T(KC_ENT), KC_P1, KC_P2, KC_P3, KC_UP, KC_BSLASH, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \ - KC_LCTL, CTRLSFT, KC_LGUI, KC_LALT, RSESPC, NAVSPC, KC_LCTL, KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT, NAVSPC, RSESPC, KC_RALT, KC_RGUI, KC_APPLICATION, KC_RCTL \ -), -[_QWERTY] = LAYOUT( \ - CTLALTSFT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCREEN, KC_PAUSE, KC_CAPS, KC_INSERT, KC_EQL, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_END, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PGDN, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, SFT_T(KC_ENT), KC_P1, KC_P2, KC_P3, KC_UP, KC_BSLASH, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \ - KC_LCTL, CTRLSFT, KC_LGUI, KC_LALT, RSESPC, NAVSPC, KC_LCTL, KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT, NAVSPC, RSESPC, KC_RALT, KC_RGUI, KC_APPLICATION, KC_RCTL \ -), -[_RAISE] = LAYOUT( \ - CTLALTDEL, SWBASE, SWQWERTY, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, \ - _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, LCTL(KC_PGUP), KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, LCTL(KC_PGDN), KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, LSFT(KC_BSLASH), XXXXXXX, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), -[_NAVIGATION] = LAYOUT( \ - CTLALTDEL, SWBASE, SWQWERTY, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, LCTL(KC_PGUP), XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, \ - KC_DEL, _______, XXXXXXX, KC_LSFT, KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, LCTL(KC_PGDN), XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, LSFT(KC_BSLASH), XXXXXXX, XXXXXXX, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _BASE: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_BASE); - } - break; - case _QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/bfo9000/keymaps/default/config.h b/keyboards/bfo9000/keymaps/default/config.h deleted file mode 100644 index 6b31e8d14ee..00000000000 --- a/keyboards/bfo9000/keymaps/default/config.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#endif diff --git a/keyboards/bfo9000/keymaps/default/keymap.c b/keyboards/bfo9000/keymaps/default/keymap.c deleted file mode 100644 index 5de5e123e50..00000000000 --- a/keyboards/bfo9000/keymaps/default/keymap.c +++ /dev/null @@ -1,19 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _BASE 0 - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[_BASE] = LAYOUT( \ - KC_ESC, KC_VOLU, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_HOME, KC_VOLD, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_END, KC_TAB, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_PGUP, KC_CAPS, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, \ - KC_PGDN, KC_UP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, XXXXXXX, \ - KC_LEFT, KC_DOWN, KC_RGHT, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_ENT, KC_BSPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ -) -}; diff --git a/keyboards/bfo9000/matrix.c b/keyboards/bfo9000/matrix.c deleted file mode 100644 index 2ca5f4d87ab..00000000000 --- a/keyboards/bfo9000/matrix.c +++ /dev/null @@ -1,342 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#ifdef USE_I2C -// provides memcpy for copying TWI slave buffer -// #include -#endif -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -static uint8_t debouncing = DEBOUNCE; -static const int ROWS_PER_HAND = MATRIX_ROWS/2; -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) -{ - // Right hand is stored after the left in the matrix so, we need to offset it - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); - - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i+offset] != cols) { - matrix_debouncing[i+offset] = cols; - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - } - } - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - /* - // read from TWI byte-by-byte into matrix_row_t memory space - size_t i; - for (i = 0; i < SLAVE_BUFFER_SIZE-1; ++i) { - *((uint8_t*)&matrix[slaveOffset]+i) = i2c_master_read(I2C_ACK); - } - // last byte to be read / end of chunk - *((uint8_t*)&matrix[slaveOffset]+i) = i2c_master_read(I2C_NACK); - */ - - // kludge for column #9: unpack bits for keys (2,9) and (3,9) from (1,7) and (1,8) - // i2c_master_read(I2C_ACK); - matrix[slaveOffset+0] = i2c_master_read(I2C_ACK); - // i2c_master_read(I2C_ACK); - matrix[slaveOffset+1] = (matrix_row_t)i2c_master_read(I2C_ACK)\ - | (matrix[slaveOffset+0]&0x40U)<<2; - // i2c_master_read(I2C_ACK); - matrix[slaveOffset+2] = (matrix_row_t)i2c_master_read(I2C_NACK)\ - | (matrix[slaveOffset+0]&0x80U)<<1; - // clear highest two bits on row 1, where the col9 bits were transported - matrix[slaveOffset+0] &= 0x3F; - - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnected, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - int ret = _matrix_scan(); - - - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - // SLAVE_BUFFER_SIZE is from i2c.h - // (MATRIX_ROWS/2*sizeof(matrix_row_t)) - // memcpy((void*)i2c_slave_buffer, (const void*)&matrix[offset], (ROWS_PER_HAND*sizeof(matrix_row_t))); - - // kludge for column #9: put bits for keys (2,9) and (3,9) into (1,7) and (1,8) - i2c_slave_buffer[0] = (uint8_t)(matrix[offset+0])\ - | (matrix[offset+1]&0x100U)>>2\ - | (matrix[offset+2]&0x100U)>>1; - i2c_slave_buffer[1] = (uint8_t)(matrix[offset+1]); - i2c_slave_buffer[2] = (uint8_t)(matrix[offset+2]); - // note: looks like a possible operator-precedence bug here, in last version? - /* - i2c_slave_buffer[1] = (uint8_t)matrix[offset+0]; - i2c_slave_buffer[2] = (uint8_t)(matrix[offset+1]>>8); - i2c_slave_buffer[3] = (uint8_t)(matrix[offset+1]>>8); - i2c_slave_buffer[4] = (uint8_t)(matrix[offset+2]>>8); - i2c_slave_buffer[5] = (uint8_t)matrix[offset+2]; - */ -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); - _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); - } -} - -static matrix_row_t read_cols(void) -{ - matrix_row_t result = 0; - for(int x = 0; x < MATRIX_COLS; x++) { - result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); - } - return result; -} - -static void unselect_rows(void) -{ - for(int x = 0; x < ROWS_PER_HAND; x++) { - _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); - _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); - } -} - -static void select_row(uint8_t row) -{ - _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); - _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); -} diff --git a/keyboards/bfo9000/readme.md b/keyboards/bfo9000/readme.md deleted file mode 100644 index 20c9b2ff793..00000000000 --- a/keyboards/bfo9000/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -BFO-9000 -======== - -A split full-size ortholinear keyboard made and sold by Keebio. Each half is a 6x9 arrangement, with breakable pieces to allow the number of rows to be customized between 4 to 6, and the number of columns to be between 7 to 9. [More info at Keebio](https://keeb.io). - -Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make bfo9000:default - -Example of flashing this keyboard: - - make bfo9000:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/bfo9000/rules.mk b/keyboards/bfo9000/rules.mk deleted file mode 100644 index d11f9a54e7c..00000000000 --- a/keyboards/bfo9000/rules.mk +++ /dev/null @@ -1,70 +0,0 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -CUSTOM_MATRIX = yes diff --git a/keyboards/bfo9000/serial.c b/keyboards/bfo9000/serial.c deleted file mode 100644 index fea57b65101..00000000000 --- a/keyboards/bfo9000/serial.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -matrix_row_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -matrix_row_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define ROW_MASK (((matrix_row_t)0-1)>>(8*sizeof(matrix_row_t)-MATRIX_COLS)) - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -matrix_row_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -matrix_row_t serial_read_byte(void) { - matrix_row_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < MATRIX_COLS; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(matrix_row_t data) { - matrix_row_t b = MATRIX_COLS; - serial_output(); - while( b-- ) { - if(data & (1UL << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - matrix_row_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += ROW_MASK & serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - matrix_row_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += ROW_MASK & serial_master_buffer[i]; - } - matrix_row_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - matrix_row_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += ROW_MASK & serial_slave_buffer[i]; - } - matrix_row_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - matrix_row_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += ROW_MASK & serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/bfo9000/serial.h b/keyboards/bfo9000/serial.h deleted file mode 100644 index 62761945721..00000000000 --- a/keyboards/bfo9000/serial.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include "matrix.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile matrix_row_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile matrix_row_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/bfo9000/split_util.c b/keyboards/bfo9000/split_util.c deleted file mode 100644 index 7f200e6c942..00000000000 --- a/keyboards/bfo9000/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init(); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/bigseries/1key/config.h b/keyboards/bigseries/1key/config.h index 966f2062c4a..66a01247214 100755 --- a/keyboards/bigseries/1key/config.h +++ b/keyboards/bigseries/1key/config.h @@ -40,7 +40,7 @@ along with this program. If not, see . #define DIODE_DIRECTION ROW2COL /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 50 +#define DEBOUNCE 50 /* key combination for command */ #define IS_COMMAND() ( \ diff --git a/keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c b/keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c index eb2d236827c..d87471b0077 100755 --- a/keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c +++ b/keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c @@ -29,10 +29,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/1key/keymaps/default/keymap.c b/keyboards/bigseries/1key/keymaps/default/keymap.c index 7ce837357f1..781205d42a4 100755 --- a/keyboards/bigseries/1key/keymaps/default/keymap.c +++ b/keyboards/bigseries/1key/keymaps/default/keymap.c @@ -28,10 +28,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/1key/keymaps/lock/keymap.c b/keyboards/bigseries/1key/keymaps/lock/keymap.c index 3d3b002b02a..650554e0200 100755 --- a/keyboards/bigseries/1key/keymaps/lock/keymap.c +++ b/keyboards/bigseries/1key/keymaps/lock/keymap.c @@ -28,10 +28,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/1key/keymaps/tester/keymap.c b/keyboards/bigseries/1key/keymaps/tester/keymap.c index 31553cef79e..bfecdb38b8e 100755 --- a/keyboards/bigseries/1key/keymaps/tester/keymap.c +++ b/keyboards/bigseries/1key/keymaps/tester/keymap.c @@ -28,10 +28,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/2key/config.h b/keyboards/bigseries/2key/config.h index 79b9ed3786a..535be27e76f 100755 --- a/keyboards/bigseries/2key/config.h +++ b/keyboards/bigseries/2key/config.h @@ -40,7 +40,7 @@ along with this program. If not, see . #define DIODE_DIRECTION ROW2COL /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 50 +#define DEBOUNCE 50 /* key combination for command */ #define IS_COMMAND() ( \ diff --git a/keyboards/bigseries/2key/keymaps/default/keymap.c b/keyboards/bigseries/2key/keymaps/default/keymap.c index 704649632bf..de430d24d38 100755 --- a/keyboards/bigseries/2key/keymaps/default/keymap.c +++ b/keyboards/bigseries/2key/keymaps/default/keymap.c @@ -28,10 +28,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ // Disable to set a known state diff --git a/keyboards/bigseries/2key/keymaps/lock/keymap.c b/keyboards/bigseries/2key/keymaps/lock/keymap.c index 55a9240f32f..6acf62d4826 100755 --- a/keyboards/bigseries/2key/keymaps/lock/keymap.c +++ b/keyboards/bigseries/2key/keymaps/lock/keymap.c @@ -29,10 +29,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/2key/keymaps/tester/keymap.c b/keyboards/bigseries/2key/keymaps/tester/keymap.c index 5b574824d33..025fd734926 100755 --- a/keyboards/bigseries/2key/keymaps/tester/keymap.c +++ b/keyboards/bigseries/2key/keymaps/tester/keymap.c @@ -28,10 +28,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/3key/config.h b/keyboards/bigseries/3key/config.h index 9963a821977..faf16672559 100755 --- a/keyboards/bigseries/3key/config.h +++ b/keyboards/bigseries/3key/config.h @@ -40,7 +40,7 @@ along with this program. If not, see . #define DIODE_DIRECTION ROW2COL /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 50 +#define DEBOUNCE 50 /* key combination for command */ #define IS_COMMAND() ( \ diff --git a/keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c b/keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c index 8e5b10db8bc..d1410ecf1eb 100755 --- a/keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c +++ b/keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c @@ -29,10 +29,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/3key/keymaps/default/keymap.c b/keyboards/bigseries/3key/keymaps/default/keymap.c index 6f0ffc9e117..3d3f4923dd3 100755 --- a/keyboards/bigseries/3key/keymaps/default/keymap.c +++ b/keyboards/bigseries/3key/keymaps/default/keymap.c @@ -27,10 +27,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/3key/keymaps/tester/keymap.c b/keyboards/bigseries/3key/keymaps/tester/keymap.c index 896a781fc5e..a201acd7e44 100755 --- a/keyboards/bigseries/3key/keymaps/tester/keymap.c +++ b/keyboards/bigseries/3key/keymaps/tester/keymap.c @@ -28,10 +28,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/4key/config.h b/keyboards/bigseries/4key/config.h index a222512d3c5..79fdeb6edcd 100755 --- a/keyboards/bigseries/4key/config.h +++ b/keyboards/bigseries/4key/config.h @@ -40,7 +40,7 @@ along with this program. If not, see . #define DIODE_DIRECTION ROW2COL /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 50 +#define DEBOUNCE 50 /* key combination for command */ #define IS_COMMAND() ( \ diff --git a/keyboards/bigseries/4key/keymaps/default/keymap.c b/keyboards/bigseries/4key/keymaps/default/keymap.c index 1c65f44b08a..4d662a27b97 100755 --- a/keyboards/bigseries/4key/keymaps/default/keymap.c +++ b/keyboards/bigseries/4key/keymaps/default/keymap.c @@ -29,10 +29,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigseries/4key/keymaps/tester/keymap.c b/keyboards/bigseries/4key/keymaps/tester/keymap.c index 5d5fe0d3866..021c7c4b69c 100755 --- a/keyboards/bigseries/4key/keymaps/tester/keymap.c +++ b/keyboards/bigseries/4key/keymaps/tester/keymap.c @@ -28,10 +28,6 @@ LAYOUT( bool initialized = 0; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { if (!initialized){ dprintf("Initializing in matrix_scan_user"); diff --git a/keyboards/bigswitch/config.h b/keyboards/bigswitch/config.h index a0ef6b55543..220f2591bfe 100755 --- a/keyboards/bigswitch/config.h +++ b/keyboards/bigswitch/config.h @@ -40,7 +40,7 @@ along with this program. If not, see . #define DIODE_DIRECTION ROW2COL /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 50 +#define DEBOUNCE 50 /* key combination for command */ #define IS_COMMAND() ( \ diff --git a/keyboards/bigswitch/keymaps/333fred/config.h b/keyboards/bigswitch/keymaps/333fred/config.h new file mode 100644 index 00000000000..76f13f08b5c --- /dev/null +++ b/keyboards/bigswitch/keymaps/333fred/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2018 Fredric Silberberg (333fred) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +// Long tapping term on the big switch, because it takes so long to press +#define TAPPING_TERM 500 diff --git a/keyboards/bigswitch/keymaps/333fred/keymap.c b/keyboards/bigswitch/keymaps/333fred/keymap.c new file mode 100644 index 00000000000..be40fecb23c --- /dev/null +++ b/keyboards/bigswitch/keymaps/333fred/keymap.c @@ -0,0 +1,123 @@ +#include QMK_KEYBOARD_H + +typedef enum { + SINGLE_TAP, SINGLE_HOLD, DOUBLE, TRIPLE, QUAD +} tap_dance_state_enum; + +enum { + TD_KEY = 0 +}; + +static tap_dance_state_enum tap_dance_state; +static bool tap_dance_active = false; +static uint16_t timer; + +void dance_cycle(bool override_timer) { + if (tap_dance_active) + { + if (timer_elapsed(timer) > 100 || override_timer) + { + switch (tap_dance_state) + { + case SINGLE_HOLD: + { + rgblight_increase_hue_noeeprom(); + break; + } + + case DOUBLE: + { + rgblight_step_noeeprom(); + break; + } + + case TRIPLE: + { + rgblight_toggle_noeeprom(); + break; + } + + default: + // Not needed + break; + } + + timer = timer_read(); + } + } +} + +void dance_finished(qk_tap_dance_state_t *state, void* user_data) { + // Determine the current state + switch (state->count) + { + case 1: + { + if (state->interrupted || state->pressed == 0) tap_dance_state = SINGLE_TAP; + else tap_dance_state = SINGLE_HOLD; + break; + } + case 2: + { + tap_dance_state = DOUBLE; + break; + } + case 3: + { + tap_dance_state = TRIPLE; + break; + } + default: + { + tap_dance_state = QUAD; + break; + } + } + + switch (tap_dance_state) + { + case SINGLE_TAP: + { + // VS Build: CTRL+SHIFT+B + send_string_with_delay_P(PSTR(SS_DOWN(X_LCTRL) SS_DOWN(X_LSHIFT) "b" SS_UP(X_LSHIFT) SS_UP(X_LCTRL)), 10); + tap_dance_active = false; + break; + } + + case SINGLE_HOLD: + case DOUBLE: + case TRIPLE: + { + // These are handled by the matrix_scan, which will register the appropriate rgb + // functions every scan + tap_dance_active = true; + timer = timer_read(); + dance_cycle(true); + break; + } + + case QUAD: + { + // Reprogram + reset_keyboard(); + break; + } + } +} + +void dance_reset(qk_tap_dance_state_t *state, void* user_data) +{ + tap_dance_active = false; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_KEY] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_finished, dance_reset) +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT(TD(TD_KEY)) +}; + +void matrix_scan_user(void) { + dance_cycle(false); +} diff --git a/keyboards/bigswitch/keymaps/333fred/rules.mk b/keyboards/bigswitch/keymaps/333fred/rules.mk new file mode 100644 index 00000000000..20aaadacbcd --- /dev/null +++ b/keyboards/bigswitch/keymaps/333fred/rules.mk @@ -0,0 +1,5 @@ +# I'm not using things from my userpace in this one +USER_NAME = disable + +RGBLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = yes diff --git a/keyboards/bigswitch/keymaps/wanleg/config.h b/keyboards/bigswitch/keymaps/wanleg/config.h index 8ac82f40d99..54abb9a6c17 100644 --- a/keyboards/bigswitch/keymaps/wanleg/config.h +++ b/keyboards/bigswitch/keymaps/wanleg/config.h @@ -22,7 +22,7 @@ #undef MATRIX_COL_PINS #define MATRIX_COL_PINS { B6 } -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #undef DIODE_DIRECTION #define DIODE_DIRECTION COL2ROW @@ -32,8 +32,8 @@ #define BREATHING_PERIOD 5 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#undef DEBOUNCING_DELAY -#define DEBOUNCING_DELAY 5 +#undef DEBOUNCE +#define DEBOUNCE 5 // set flashing LED with QMK DFU #define QMK_LED B0 diff --git a/keyboards/blockey/config.h b/keyboards/blockey/config.h index 53860bfbc98..8934fd63a5c 100644 --- a/keyboards/blockey/config.h +++ b/keyboards/blockey/config.h @@ -46,7 +46,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D0, B4, C6, D7, F4, F5, F7 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW /* ws2812 RGB LED */ @@ -58,10 +58,8 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS - - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -111,11 +109,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/blockey/keymaps/default/keymap.c b/keyboards/blockey/keymaps/default/keymap.c index 5b114548232..82366501aed 100644 --- a/keyboards/blockey/keymaps/default/keymap.c +++ b/keyboards/blockey/keymaps/default/keymap.c @@ -20,11 +20,6 @@ extern rgblight_config_t rgblight_config; #endif -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ diff --git a/keyboards/blockey/keymaps/eucalyn/keymap.c b/keyboards/blockey/keymaps/eucalyn/keymap.c index 33d1051a11e..99564cae165 100644 --- a/keyboards/blockey/keymaps/eucalyn/keymap.c +++ b/keyboards/blockey/keymaps/eucalyn/keymap.c @@ -20,11 +20,6 @@ extern rgblight_config_t rgblight_config; #endif -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ diff --git a/keyboards/blockey/readme.md b/keyboards/blockey/readme.md index 24626318fbe..20cb7e98cc1 100644 --- a/keyboards/blockey/readme.md +++ b/keyboards/blockey/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make blockey:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/blockey/rules.mk b/keyboards/blockey/rules.mk index e217305bff2..cea24f83276 100644 --- a/keyboards/blockey/rules.mk +++ b/keyboards/blockey/rules.mk @@ -1,7 +1,4 @@ -SRC += ws2812.c - # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -54,7 +51,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration diff --git a/keyboards/bm16a/bm16a.c b/keyboards/bm16a/bm16a.c new file mode 100644 index 00000000000..3d616f29e9d --- /dev/null +++ b/keyboards/bm16a/bm16a.c @@ -0,0 +1,43 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "bm16a.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/bm16a/bm16a.h b/keyboards/bm16a/bm16a.h new file mode 100644 index 00000000000..cf8bab4730a --- /dev/null +++ b/keyboards/bm16a/bm16a.h @@ -0,0 +1,39 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_4x4( \ + K01, K02, K03, K04, \ + K11, K12, K13, K14, \ + K21, K22, K23, K24, \ + K31, K32, K33, K34 \ +) \ +{ \ + { K01, K02, K03, K04 }, \ + { K11, K12, K13, K14 }, \ + { K21, K22, K23, K24 }, \ + { K31, K32, K33, K34 } \ +} diff --git a/keyboards/bm16a/config.h b/keyboards/bm16a/config.h new file mode 100644 index 00000000000..fc0405475c2 --- /dev/null +++ b/keyboards/bm16a/config.h @@ -0,0 +1,246 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x424D +#define DEVICE_VER 0x0001 +#define MANUFACTURER KPrepublic +#define PRODUCT bm16a +#define DESCRIPTION KPrepublic bm16a + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D5, D1, D2} +#define MATRIX_COL_PINS { D6, D4, D7, B4} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B6 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +#define RGB_DI_PIN E2 +#define RGBLED_NUM 4 +#define RGBLIGHT_ANIMATIONS +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/bm16a/info.json b/keyboards/bm16a/info.json new file mode 100644 index 00000000000..4f87c5ae1d2 --- /dev/null +++ b/keyboards/bm16a/info.json @@ -0,0 +1,30 @@ +{ + "keyboard_name": "bm16a", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "key_count": 16, + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":3, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2}, + {"x":3, "y":2}, + {"x":0, "y":3}, + {"x":1, "y":3}, + {"x":2, "y":3}, + {"x":3, "y":3} + ] + } + } + } \ No newline at end of file diff --git a/keyboards/bm16a/keymaps/default/config.h b/keyboards/bm16a/keymaps/default/config.h new file mode 100644 index 00000000000..08c234aee2b --- /dev/null +++ b/keyboards/bm16a/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/bm16a/keymaps/default/keymap.c b/keyboards/bm16a/keymaps/default/keymap.c new file mode 100644 index 00000000000..a0b06ee92a3 --- /dev/null +++ b/keyboards/bm16a/keymaps/default/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layers { + _BASE = 0, + _FN1, + _FN2, +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_ortho_4x4( + KC_PGUP, KC_HOME, KC_UP, KC_END , \ + KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, \ + MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV, \ + MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT \ + ), + [_FN1] = LAYOUT_ortho_4x4( + KC_ESC, KC_P7, KC_P8, KC_P9, \ + KC_TAB, KC_P4, KC_P5, KC_P6, \ + KC_ENT, KC_P1, KC_P2, KC_P3, \ + _______, KC_P0, KC_P0, KC_DOT \ + ), + [_FN2] = LAYOUT_ortho_4x4( + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \ + _______, _______, _______, RESET, \ + BL_STEP, _______, QMKBEST, QMKURL \ + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} diff --git a/keyboards/bm16a/keymaps/default/readme.md b/keyboards/bm16a/keymaps/default/readme.md new file mode 100644 index 00000000000..f356f2cca05 --- /dev/null +++ b/keyboards/bm16a/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for bm16a \ No newline at end of file diff --git a/keyboards/bm16a/readme.md b/keyboards/bm16a/readme.md new file mode 100644 index 00000000000..8d43b7014d0 --- /dev/null +++ b/keyboards/bm16a/readme.md @@ -0,0 +1,15 @@ +# bm16a + +![bm16a](https://ae01.alicdn.com/kf/HTB1RRRQaZfrK1RjSszcq6xGGFXaY.jpg) + +A 16 key macropad, with USB C, RGB underglow and backlight. + +Keyboard Maintainer: QMK Community +Hardware Supported: The PCBs, controllers supported +Hardware Availability: [KPrepublic](https://kprepublic.com/products/bm16a-16-keys-custom-mechanical-keyboard-pcb-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-bottom-underglow-alps-mx); [AliExpress](https://www.aliexpress.com/store/product/bm16a-16-keys-Custom-Mechanical-Keyboard-PCB-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-bottom/3034003_32970629907.html) + +Make example for this keyboard (after setting up your build environment): + + make bm16a:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/bm16a/rules.mk b/keyboards/bm16a/rules.mk new file mode 100644 index 00000000000..013dac3c90a --- /dev/null +++ b/keyboards/bm16a/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_4x4 diff --git a/keyboards/bm16s/bm16s.h b/keyboards/bm16s/bm16s.h new file mode 100755 index 00000000000..9aca8c0e373 --- /dev/null +++ b/keyboards/bm16s/bm16s.h @@ -0,0 +1,15 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 } \ +} diff --git a/keyboards/bm16s/config.h b/keyboards/bm16s/config.h new file mode 100755 index 00000000000..379e59bd9d8 --- /dev/null +++ b/keyboards/bm16s/config.h @@ -0,0 +1,46 @@ +#pragma once +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KPrepublic +#define PRODUCT bm16s +#define DESCRIPTION KPrepublic bm16s + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, D0, D3, D2 } +#define MATRIX_COL_PINS { F7, F6, D4, D6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN + #define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN + #define RGBLIGHT_ANIMATIONS + #define RGBLED_NUM 16 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/bm16s/info.json b/keyboards/bm16s/info.json new file mode 100644 index 00000000000..706453561e7 --- /dev/null +++ b/keyboards/bm16s/info.json @@ -0,0 +1,30 @@ +{ + "keyboard_name": "bm16s", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "key_count": 16, + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":3, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2}, + {"x":3, "y":2}, + {"x":0, "y":3}, + {"x":1, "y":3}, + {"x":2, "y":3}, + {"x":3, "y":3} + ] + } + } + } \ No newline at end of file diff --git a/keyboards/bm16s/keymaps/default/keymap.c b/keyboards/bm16s/keymaps/default/keymap.c new file mode 100755 index 00000000000..9dd697a0d97 --- /dev/null +++ b/keyboards/bm16s/keymaps/default/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_4x4( + KC_KP_7, KC_KP_8, KC_KP_9, MO(1), \ + KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, \ + KC_KP_1, KC_KP_2, KC_KP_3, KC_PPLS, \ + KC_KP_0, KC_PDOT, KC_PCMM, KC_PENT \ + ), + [1] = LAYOUT_ortho_4x4( + RESET, BL_STEP, _______, KC_VOLU, \ + BL_TOGG, BL_DEC, BL_INC, KC_VOLD, \ + RGB_TOG, RGB_MOD, RGB_HUI, KC_MUTE, \ + RGB_SAI, RGB_SAD, RGB_HUD, _______ \ + ), +}; \ No newline at end of file diff --git a/keyboards/bm16s/keymaps/media/keymap.c b/keyboards/bm16s/keymaps/media/keymap.c new file mode 100755 index 00000000000..082879320a2 --- /dev/null +++ b/keyboards/bm16s/keymaps/media/keymap.c @@ -0,0 +1,20 @@ +#include QMK_KEYBOARD_H + +#define RGB_BRU RGB_VAI +#define RGB_BRD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_ortho_4x4( + KC_BRIU, _______, _______, KC_VOLU, \ + KC_BRID, _______, _______, KC_VOLD, \ + _______, _______, _______, KC_MUTE, \ + KC_MPRV, KC_MPLY, KC_MNXT, MO(1) \ + ), + [1] = LAYOUT_ortho_4x4( + RESET, _______, _______, _______, \ + RGB_SPD, RGB_BRU, RGB_SPI, _______, \ + RGB_RMOD, RGB_BRD, RGB_MOD, _______, \ + RGB_TOG, _______, _______, _______ \ + ), +}; \ No newline at end of file diff --git a/keyboards/bm16s/readme.md b/keyboards/bm16s/readme.md new file mode 100644 index 00000000000..097a3800803 --- /dev/null +++ b/keyboards/bm16s/readme.md @@ -0,0 +1,13 @@ +# bm16s + +A 16-key macropad, with USB C and per-key RGB backlighting. This is a variant of the BM16A, but with low profile Choc switches. + +Keyboard Maintainer: QMK Community +Hardware Supported: The PCBs, controllers supported +Hardware Availability: [KPrepublic](https://kprepublic.com/collections/pcb/products/bm16s-16-keys-custom-mechanical-keyboard-pcb-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch-leds-choc-switch); [AliExpress](https://www.aliexpress.com/item/bm16s-16-keys-Custom-Mechanical-Keyboard-PCB-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch/32999247908.html); [Massdrop](https://www.massdrop.com/buy/78169) + +Make example for this keyboard (after setting up your build environment): + + make bm16s:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/bm16s/rules.mk b/keyboards/bm16s/rules.mk new file mode 100755 index 00000000000..f4f1dfd639b --- /dev/null +++ b/keyboards/bm16s/rules.mk @@ -0,0 +1,72 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes + +LAYOUTS = ortho_4x4 \ No newline at end of file diff --git a/keyboards/bmini/config.h b/keyboards/bmini/config.h deleted file mode 100644 index b7a25e050e2..00000000000 --- a/keyboards/bmini/config.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef BMINI_CONFIG_H -#define BMINI_CONFIG_H - -#include "config_common.h" - -#define VENDOR_ID 0x20A0 -#define PRODUCT_ID 0x422D -#define MANUFACTURER winkeyless.kr -#define PRODUCT B.mini - -#define RGBLED_NUM 16 - -/* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 15 - -#define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - -#endif diff --git a/keyboards/bmini/readme.md b/keyboards/bmini/readme.md deleted file mode 100644 index 38dc4930754..00000000000 --- a/keyboards/bmini/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -B.mini -======== - -A 75% keyboard with RGB - -Keyboard Maintainer: QMK Community -Hardware Supported: B.mini PCB -Hardware Availability: http://winkeyless.kr/product/b-mini-x2-pcb/ - -Make example for this keyboard (after setting up your build environment): - - make bmini:default - -Flashing - -ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. - -Windows: -1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). -2. Place your keyboard into reset. -3. Press the `Find Device` button and ensure that your keyboard is found. -4. Press the `Open .hex File` button and locate the `.hex` file you created. -5. Press the `Flash Device` button and wait for the process to complete. - -macOS: -1. Install homebrew by typing the following: - ``` - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - ``` -2. Install `crosspack-avr`. - ``` - brew cask install crosspack-avr - ``` -3. Install the following packages: - ``` - brew install python - brew install pyusb - brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb - -4. Place your keyboard into reset. -5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. - - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/bmini/rules.mk b/keyboards/bmini/rules.mk deleted file mode 100644 index 73c361e2a82..00000000000 --- a/keyboards/bmini/rules.mk +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2017 Luiz Ribeiro -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# MCU name -MCU = atmega32a -PROTOCOL = VUSB - -# unsupported features for now -NO_UART = yes -NO_SUSPEND_POWER_DOWN = yes - -# processor frequency -F_CPU = 12000000 - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = bootloadHID - -# build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = yes -COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes -RGBLIGHT_CUSTOM_DRIVER = yes - -OPT_DEFS = -DDEBUG_LEVEL=0 - -# custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c - -# programming options -PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/bminiex/bminiex.h b/keyboards/bminiex/bminiex.h deleted file mode 100644 index a58ce689232..00000000000 --- a/keyboards/bminiex/bminiex.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "quantum.h" - -#define LAYOUT( \ - K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ - K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ - K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \ - K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \ - K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ - K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ -){ \ - { K00, K10, K20, K30, KC_NO, KC_NO, K60, KC_NO, K80, K90, KC_NO, KB0, KC0, KD0, KE0 }, \ - { K01, K11, K21, K31, K41, K51, K61, K71, K81, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \ - { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, KD2, KE2 }, \ - { K03, K13, K23, K33, K43, K53, K63, K73, K83, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ - { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4, KB4, KC4, KC_NO, KE4 }, \ - { K05, KC_NO, K25, K35, K45, K55, K65, K75, K85, K95, KC_NO, KB5, KC5, KD5, KE5 }, \ - { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \ - { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ -} - -#define LAYOUT_kc( \ - K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ - K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ - K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \ - K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \ - K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ - K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ -) \ -{ \ - { KC_##K00, KC_##K10, KC_##K20, KC_##K30, KC_NO, KC_NO, KC_##K60, KC_NO, KC_##K80, KC_##K90, KC_NO, KC_##KB0, KC_##KC0, KC_##KD0, KC_##KE0 }, \ - { KC_##K01, KC_##K11, KC_##K21, KC_##K31, KC_##K41, KC_##K51, KC_##K61, KC_##K71, KC_##K81, KC_NO, KC_##KA1, KC_##KB1, KC_NO, KC_##KD1, KC_##KE1 }, \ - { KC_##K02, KC_##K12, KC_##K22, KC_##K32, KC_##K42, KC_##K52, KC_##K62, KC_##K72, KC_##K82, KC_##K92, KC_##KA2, KC_##KB2, KC_##KC2, KC_##KD2, KC_##KE2 }, \ - { KC_##K03, KC_##K13, KC_##K23, KC_##K33, KC_##K43, KC_##K53, KC_##K63, KC_##K73, KC_##K83, KC_NO, KC_##KA3, KC_##KB3, KC_##KC3, KC_##KD3, KC_NO }, \ - { KC_##K04, KC_##K14, KC_##K24, KC_##K34, KC_##K44, KC_##K54, KC_##K64, KC_##K74, KC_##K84, KC_##K94, KC_##KA4, KC_##KB4, KC_##KC4, KC_NO, KC_##KE4 }, \ - { KC_##K05, KC_NO, KC_##K25, KC_##K35, KC_##K45, KC_##K55, KC_##K65, KC_##K75, KC_##K85, KC_##K95, KC_NO, KC_##KB5, KC_##KC5, KC_##KD5, KC_##KE5 }, \ - { KC_##K06, KC_##K16, KC_##K26, KC_##K36, KC_##K46, KC_##K56, KC_##K66, KC_##K76, KC_##K86, KC_##K96, KC_##KA6, KC_##KB6, KC_##KC6, KC_##KD6, KC_##KE6 }, \ - { KC_##K07, KC_##K17, KC_##K27, KC_##K37, KC_##K47, KC_##K57, KC_##K67, KC_##K77, KC_NO, KC_NO, KC_##KA7, KC_##KB7, KC_##KC7, KC_##KD7, KC_##KE7 } \ -} - diff --git a/keyboards/bminiex/config.h b/keyboards/bminiex/config.h deleted file mode 100644 index 3f160109e3a..00000000000 --- a/keyboards/bminiex/config.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "config_common.h" - -#define VENDOR_ID 0x20A0 -#define PRODUCT_ID 0x422E -#define MANUFACTURER winkeyless.kr -#define PRODUCT B.mini Ex - -#define RGBLED_NUM 20 - -/* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 15 - -#define RGBLIGHT_ANIMATIONS - -#define BACKLIGHT_LEVELS 5 - -#define NO_UART 1 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - diff --git a/keyboards/bminiex/readme.md b/keyboards/bminiex/readme.md deleted file mode 100644 index 204bcbbb1b7..00000000000 --- a/keyboards/bminiex/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -B.mini EX -========= - -A compact fullsize keyboard with RGB - -Keyboard Maintainer: QMK Community -Hardware Supported: B.mini EX PCB -Hardware Availability: https://winkeyless.kr/product/b-mini-ex-x2-pcb/ - -Make example for this keyboard (after setting up your build environment): - - make bminiex:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/boardwalk/boardwalk.h b/keyboards/boardwalk/boardwalk.h new file mode 100644 index 00000000000..580a320c1f9 --- /dev/null +++ b/keyboards/boardwalk/boardwalk.h @@ -0,0 +1,78 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_5x14( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k410, k411, k412, k413 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313 }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k410, k411, k412, k413 } \ +} + +#define LAYOUT_ortho_hhkb( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313, \ + k41, k42, k43, k44, k45, k47, k49, k410, k411, k412 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313 }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, KC_NO, k49, k410, k411, k412, KC_NO } \ +} + +#define LAYOUT_ortho_7u( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313, \ + k41, k42, k46, k411, k412 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313 }, \ + { KC_NO, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k411, k412, KC_NO } \ +} + +#define LAYOUT_2u_arrow( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313, \ + k40, k41, k42, k43, k44, k46, k48, k49, k410, k411, k412, k413 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313 }, \ + { k40, k41, k42, k43, k44, KC_NO, k46, KC_NO, k48, k49, k410, k411, k412, k413 } \ +} + +#define LAYOUT_625u_arrow( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313, \ + k40, k41, k42, k45, k49, k410, k411, k412, k413 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, k113 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, k213 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, k313 }, \ + { k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, k49, k410, k411, k412, k413 } \ +} diff --git a/keyboards/boardwalk/config.h b/keyboards/boardwalk/config.h new file mode 100644 index 00000000000..7747502083c --- /dev/null +++ b/keyboards/boardwalk/config.h @@ -0,0 +1,84 @@ +/* +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCDCD +#define PRODUCT_ID 0x5337 +#define DEVICE_VER 0x0001 +#define MANUFACTURER shens +#define PRODUCT Boardwalk +#define DESCRIPTION QMK keyboard firmware for Boardwalk + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6 } +#define MATRIX_COL_PINS { F7, C7, C6, B6, B5, B4, D7, D6, D4, D5, D3, D2, D1, D0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN F5 +// #define BACKLIGHT_LEVELS 6 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +// ws2812 options +#define RGB_DI_PIN B7 // pin the DI on the ws2812 is hooked-up to +#define RGBLIGHT_ANIMATIONS // run RGB animations +#define RGBLED_NUM 14 // number of LEDs +#define RGBLIGHT_HUE_STEP 12 // units to step when in/decreasing hue +#define RGBLIGHT_SAT_STEP 25 // units to step when in/decresing saturation +#define RGBLIGHT_VAL_STEP 12 // units to step when in/decreasing value (brightness) diff --git a/keyboards/boardwalk/info.json b/keyboards/boardwalk/info.json new file mode 100644 index 00000000000..a287f31a44e --- /dev/null +++ b/keyboards/boardwalk/info.json @@ -0,0 +1,359 @@ +{ + "keyboard_name": "Boardwalk", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x14": { + "layout": [ + {"label":"k00", "x":0, "y":0, "w":1.5}, + {"label":"k01", "x":1.5, "y":0}, + {"label":"k02", "x":2.5, "y":0}, + {"label":"k03", "x":3.5, "y":0}, + {"label":"k04", "x":4.5, "y":0}, + {"label":"k05", "x":5.5, "y":0}, + {"label":"k06", "x":6.5, "y":0}, + {"label":"k07", "x":7.5, "y":0}, + {"label":"k08", "x":8.5, "y":0}, + {"label":"k09", "x":9.5, "y":0}, + {"label":"k010", "x":10.5, "y":0}, + {"label":"k011", "x":11.5, "y":0}, + {"label":"k012", "x":12.5, "y":0}, + {"label":"k013", "x":13.5, "y":0, "w":1.5}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k110", "x":10.5, "y":1}, + {"label":"k111", "x":11.5, "y":1}, + {"label":"k112", "x":12.5, "y":1}, + {"label":"k113", "x":13.5, "y":1, "w":1.5}, + {"label":"k20", "x":0, "y":2, "w":1.5}, + {"label":"k21", "x":1.5, "y":2}, + {"label":"k22", "x":2.5, "y":2}, + {"label":"k23", "x":3.5, "y":2}, + {"label":"k24", "x":4.5, "y":2}, + {"label":"k25", "x":5.5, "y":2}, + {"label":"k26", "x":6.5, "y":2}, + {"label":"k27", "x":7.5, "y":2}, + {"label":"k28", "x":8.5, "y":2}, + {"label":"k29", "x":9.5, "y":2}, + {"label":"k210", "x":10.5, "y":2}, + {"label":"k211", "x":11.5, "y":2}, + {"label":"k212", "x":12.5, "y":2}, + {"label":"k213", "x":13.5, "y":2, "w":1.5}, + {"label":"k30", "x":0, "y":3, "w":1.5}, + {"label":"k31", "x":1.5, "y":3}, + {"label":"k32", "x":2.5, "y":3}, + {"label":"k33", "x":3.5, "y":3}, + {"label":"k34", "x":4.5, "y":3}, + {"label":"k35", "x":5.5, "y":3}, + {"label":"k36", "x":6.5, "y":3}, + {"label":"k37", "x":7.5, "y":3}, + {"label":"k38", "x":8.5, "y":3}, + {"label":"k39", "x":9.5, "y":3}, + {"label":"k310", "x":10.5, "y":3}, + {"label":"k311", "x":11.5, "y":3}, + {"label":"k312", "x":12.5, "y":3}, + {"label":"k313", "x":13.5, "y":3, "w":1.5}, + {"label":"k40", "x":0, "y":4, "w":1.5}, + {"label":"k41", "x":1.5, "y":4}, + {"label":"k42", "x":2.5, "y":4}, + {"label":"k43", "x":3.5, "y":4}, + {"label":"k44", "x":4.5, "y":4}, + {"label":"k45", "x":5.5, "y":4}, + {"label":"k46", "x":6.5, "y":4}, + {"label":"k47", "x":7.5, "y":4}, + {"label":"k48", "x":8.5, "y":4}, + {"label":"k49", "x":9.5, "y":4}, + {"label":"k410", "x":10.5, "y":4}, + {"label":"k411", "x":11.5, "y":4}, + {"label":"k412", "x":12.5, "y":4}, + {"label":"k413", "x":13.5, "y":4, "w":1.5} + ] + }, + "LAYOUT_ortho_hhkb": { + "layout": [ + {"label":"k00", "x":0, "y":0, "w":1.5}, + {"label":"k01", "x":1.5, "y":0}, + {"label":"k02", "x":2.5, "y":0}, + {"label":"k03", "x":3.5, "y":0}, + {"label":"k04", "x":4.5, "y":0}, + {"label":"k05", "x":5.5, "y":0}, + {"label":"k06", "x":6.5, "y":0}, + {"label":"k07", "x":7.5, "y":0}, + {"label":"k08", "x":8.5, "y":0}, + {"label":"k09", "x":9.5, "y":0}, + {"label":"k010", "x":10.5, "y":0}, + {"label":"k011", "x":11.5, "y":0}, + {"label":"k012", "x":12.5, "y":0}, + {"label":"k013", "x":13.5, "y":0, "w":1.5}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k110", "x":10.5, "y":1}, + {"label":"k111", "x":11.5, "y":1}, + {"label":"k112", "x":12.5, "y":1}, + {"label":"k113", "x":13.5, "y":1, "w":1.5}, + {"label":"k20", "x":0, "y":2, "w":1.5}, + {"label":"k21", "x":1.5, "y":2}, + {"label":"k22", "x":2.5, "y":2}, + {"label":"k23", "x":3.5, "y":2}, + {"label":"k24", "x":4.5, "y":2}, + {"label":"k25", "x":5.5, "y":2}, + {"label":"k26", "x":6.5, "y":2}, + {"label":"k27", "x":7.5, "y":2}, + {"label":"k28", "x":8.5, "y":2}, + {"label":"k29", "x":9.5, "y":2}, + {"label":"k210", "x":10.5, "y":2}, + {"label":"k211", "x":11.5, "y":2}, + {"label":"k212", "x":12.5, "y":2}, + {"label":"k213", "x":13.5, "y":2, "w":1.5}, + {"label":"k30", "x":0, "y":3, "w":1.5}, + {"label":"k31", "x":1.5, "y":3}, + {"label":"k32", "x":2.5, "y":3}, + {"label":"k33", "x":3.5, "y":3}, + {"label":"k34", "x":4.5, "y":3}, + {"label":"k35", "x":5.5, "y":3}, + {"label":"k36", "x":6.5, "y":3}, + {"label":"k37", "x":7.5, "y":3}, + {"label":"k38", "x":8.5, "y":3}, + {"label":"k39", "x":9.5, "y":3}, + {"label":"k310", "x":10.5, "y":3}, + {"label":"k311", "x":11.5, "y":3}, + {"label":"k312", "x":12.5, "y":3}, + {"label":"k313", "x":13.5, "y":3, "w":1.5}, + {"label":"k41", "x":1.5, "y":4}, + {"label":"k42", "x":2.5, "y":4}, + {"label":"k43", "x":3.5, "y":4}, + {"label":"k44", "x":4.5, "y":4}, + {"label":"k45", "x":5.5, "y":4, "w":2}, + {"label":"k47", "x":7.5, "y":4, "w":2}, + {"label":"k49", "x":9.5, "y":4}, + {"label":"k410", "x":10.5, "y":4}, + {"label":"k411", "x":11.5, "y":4}, + {"label":"k412", "x":12.5, "y":4} + ] + }, + "LAYOUT_ortho_7u": { + "layout": [ + {"label":"k00", "x":0, "y":0, "w":1.5}, + {"label":"k01", "x":1.5, "y":0}, + {"label":"k02", "x":2.5, "y":0}, + {"label":"k03", "x":3.5, "y":0}, + {"label":"k04", "x":4.5, "y":0}, + {"label":"k05", "x":5.5, "y":0}, + {"label":"k06", "x":6.5, "y":0}, + {"label":"k07", "x":7.5, "y":0}, + {"label":"k08", "x":8.5, "y":0}, + {"label":"k09", "x":9.5, "y":0}, + {"label":"k010", "x":10.5, "y":0}, + {"label":"k011", "x":11.5, "y":0}, + {"label":"k012", "x":12.5, "y":0}, + {"label":"k013", "x":13.5, "y":0, "w":1.5}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k110", "x":10.5, "y":1}, + {"label":"k111", "x":11.5, "y":1}, + {"label":"k112", "x":12.5, "y":1}, + {"label":"k113", "x":13.5, "y":1, "w":1.5}, + {"label":"k20", "x":0, "y":2, "w":1.5}, + {"label":"k21", "x":1.5, "y":2}, + {"label":"k22", "x":2.5, "y":2}, + {"label":"k23", "x":3.5, "y":2}, + {"label":"k24", "x":4.5, "y":2}, + {"label":"k25", "x":5.5, "y":2}, + {"label":"k26", "x":6.5, "y":2}, + {"label":"k27", "x":7.5, "y":2}, + {"label":"k28", "x":8.5, "y":2}, + {"label":"k29", "x":9.5, "y":2}, + {"label":"k210", "x":10.5, "y":2}, + {"label":"k211", "x":11.5, "y":2}, + {"label":"k212", "x":12.5, "y":2}, + {"label":"k213", "x":13.5, "y":2, "w":1.5}, + {"label":"k30", "x":0, "y":3, "w":1.5}, + {"label":"k31", "x":1.5, "y":3}, + {"label":"k32", "x":2.5, "y":3}, + {"label":"k33", "x":3.5, "y":3}, + {"label":"k34", "x":4.5, "y":3}, + {"label":"k35", "x":5.5, "y":3}, + {"label":"k36", "x":6.5, "y":3}, + {"label":"k37", "x":7.5, "y":3}, + {"label":"k38", "x":8.5, "y":3}, + {"label":"k39", "x":9.5, "y":3}, + {"label":"k310", "x":10.5, "y":3}, + {"label":"k311", "x":11.5, "y":3}, + {"label":"k312", "x":12.5, "y":3}, + {"label":"k313", "x":13.5, "y":3, "w":1.5}, + {"label":"k41", "x":1.5, "y":4}, + {"label":"k42", "x":2.5, "y":4, "w":1.5}, + {"label":"k46", "x":4, "y":4, "w":7}, + {"label":"k411", "x":11, "y":4, "w":1.5}, + {"label":"k412", "x":12.5, "y":4} + ] + }, + "LAYOUT_2u_arrow": { + "layout": [ + {"label":"k00", "x":0, "y":0, "w":1.5}, + {"label":"k01", "x":1.5, "y":0}, + {"label":"k02", "x":2.5, "y":0}, + {"label":"k03", "x":3.5, "y":0}, + {"label":"k04", "x":4.5, "y":0}, + {"label":"k05", "x":5.5, "y":0}, + {"label":"k06", "x":6.5, "y":0}, + {"label":"k07", "x":7.5, "y":0}, + {"label":"k08", "x":8.5, "y":0}, + {"label":"k09", "x":9.5, "y":0}, + {"label":"k010", "x":10.5, "y":0}, + {"label":"k011", "x":11.5, "y":0}, + {"label":"k012", "x":12.5, "y":0}, + {"label":"k013", "x":13.5, "y":0, "w":1.5}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k110", "x":10.5, "y":1}, + {"label":"k111", "x":11.5, "y":1}, + {"label":"k112", "x":12.5, "y":1}, + {"label":"k113", "x":13.5, "y":1, "w":1.5}, + {"label":"k20", "x":0, "y":2, "w":1.5}, + {"label":"k21", "x":1.5, "y":2}, + {"label":"k22", "x":2.5, "y":2}, + {"label":"k23", "x":3.5, "y":2}, + {"label":"k24", "x":4.5, "y":2}, + {"label":"k25", "x":5.5, "y":2}, + {"label":"k26", "x":6.5, "y":2}, + {"label":"k27", "x":7.5, "y":2}, + {"label":"k28", "x":8.5, "y":2}, + {"label":"k29", "x":9.5, "y":2}, + {"label":"k210", "x":10.5, "y":2}, + {"label":"k211", "x":11.5, "y":2}, + {"label":"k212", "x":12.5, "y":2, "w":1.5}, + {"label":"k213", "x":14, "y":2}, + {"label":"k30", "x":0, "y":3, "w":1.5}, + {"label":"k31", "x":1.5, "y":3}, + {"label":"k32", "x":2.5, "y":3}, + {"label":"k33", "x":3.5, "y":3}, + {"label":"k34", "x":4.5, "y":3}, + {"label":"k35", "x":5.5, "y":3}, + {"label":"k36", "x":6.5, "y":3}, + {"label":"k37", "x":7.5, "y":3}, + {"label":"k38", "x":8.5, "y":3}, + {"label":"k39", "x":9.5, "y":3}, + {"label":"k310", "x":10.5, "y":3}, + {"label":"k311", "x":11.5, "y":3, "w":1.5}, + {"label":"k312", "x":13, "y":3}, + {"label":"k313", "x":14, "y":3}, + {"label":"k40", "x":0, "y":4, "w":1.25}, + {"label":"k41", "x":1.25, "y":4, "w":1.25}, + {"label":"k42", "x":2.5, "y":4}, + {"label":"k43", "x":3.5, "y":4}, + {"label":"k44", "x":4.5, "y":4, "w":2}, + {"label":"k46", "x":6.5, "y":4, "w":2}, + {"label":"k48", "x":8.5, "y":4}, + {"label":"k49", "x":9.5, "y":4, "w":1.25}, + {"label":"k410", "x":10.75, "y":4, "w":1.25}, + {"label":"k411", "x":12, "y":4}, + {"label":"k412", "x":13, "y":4}, + {"label":"k413", "x":14, "y":4} + ] + }, + "LAYOUT_625u_arrow": { + "layout": [ + {"label":"k00", "x":0, "y":0, "w":1.5}, + {"label":"k01", "x":1.5, "y":0}, + {"label":"k02", "x":2.5, "y":0}, + {"label":"k03", "x":3.5, "y":0}, + {"label":"k04", "x":4.5, "y":0}, + {"label":"k05", "x":5.5, "y":0}, + {"label":"k06", "x":6.5, "y":0}, + {"label":"k07", "x":7.5, "y":0}, + {"label":"k08", "x":8.5, "y":0}, + {"label":"k09", "x":9.5, "y":0}, + {"label":"k010", "x":10.5, "y":0}, + {"label":"k011", "x":11.5, "y":0}, + {"label":"k012", "x":12.5, "y":0}, + {"label":"k013", "x":13.5, "y":0, "w":1.5}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k110", "x":10.5, "y":1}, + {"label":"k111", "x":11.5, "y":1}, + {"label":"k112", "x":12.5, "y":1}, + {"label":"k113", "x":13.5, "y":1, "w":1.5}, + {"label":"k20", "x":0, "y":2, "w":1.5}, + {"label":"k21", "x":1.5, "y":2}, + {"label":"k22", "x":2.5, "y":2}, + {"label":"k23", "x":3.5, "y":2}, + {"label":"k24", "x":4.5, "y":2}, + {"label":"k25", "x":5.5, "y":2}, + {"label":"k26", "x":6.5, "y":2}, + {"label":"k27", "x":7.5, "y":2}, + {"label":"k28", "x":8.5, "y":2}, + {"label":"k29", "x":9.5, "y":2}, + {"label":"k210", "x":10.5, "y":2}, + {"label":"k211", "x":11.5, "y":2}, + {"label":"k212", "x":12.5, "y":2, "w":1.5}, + {"label":"k213", "x":14, "y":2}, + {"label":"k30", "x":0, "y":3, "w":1.5}, + {"label":"k31", "x":1.5, "y":3}, + {"label":"k32", "x":2.5, "y":3}, + {"label":"k33", "x":3.5, "y":3}, + {"label":"k34", "x":4.5, "y":3}, + {"label":"k35", "x":5.5, "y":3}, + {"label":"k36", "x":6.5, "y":3}, + {"label":"k37", "x":7.5, "y":3}, + {"label":"k38", "x":8.5, "y":3}, + {"label":"k39", "x":9.5, "y":3}, + {"label":"k310", "x":10.5, "y":3}, + {"label":"k311", "x":11.5, "y":3, "w":1.5}, + {"label":"k312", "x":13, "y":3}, + {"label":"k313", "x":14, "y":3}, + {"label":"k40", "x":0, "y":4, "w":1.25}, + {"label":"k41", "x":1.25, "y":4, "w":1.25}, + {"label":"k42", "x":2.5, "y":4}, + {"label":"k45", "x":3.5, "y":4, "w":6.25}, + {"label":"k49", "x":9.75, "y":4}, + {"label":"k410", "x":10.75, "y":4, "w":1.25}, + {"label":"k411", "x":12, "y":4}, + {"label":"k412", "x":13, "y":4}, + {"label":"k413", "x":14, "y":4} + ] + } + } + } \ No newline at end of file diff --git a/keyboards/boardwalk/keymaps/brendanwr/config.h b/keyboards/boardwalk/keymaps/brendanwr/config.h new file mode 100644 index 00000000000..a2530241f47 --- /dev/null +++ b/keyboards/boardwalk/keymaps/brendanwr/config.h @@ -0,0 +1,16 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once diff --git a/keyboards/boardwalk/keymaps/brendanwr/keymap.c b/keyboards/boardwalk/keymaps/brendanwr/keymap.c new file mode 100644 index 00000000000..b428651e73e --- /dev/null +++ b/keyboards/boardwalk/keymaps/brendanwr/keymap.c @@ -0,0 +1,95 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layer { + _BASE, + _FN, + _BACKLIT +}; + + +#define FN MO(_FN) +#define BACKLIT MO(_BACKLIT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* BASE + * .-----------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | LCTRL | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | HOME | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | FN | END | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | | LALT | LGUI | SPACE | RGUI | RALT | | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_BASE] = LAYOUT_ortho_7u( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN, KC_END, + KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT + ), + +/* FUNCTION + * .-----------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | ` | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | | | | | | | | | | UP | | | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | | VOLD | VOLU | MUTE | | | | | | | LEFT | RIGHT | | PG_UP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | | | | | | | | | | | DOWN | | | PG_DN | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT_ortho_7u( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_GRV, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, KC_DEL, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, KC_PGUP, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOWN, _______, _______, KC_PGDN, + _______, _______, _______, _______, _______ + ), + +/* BACKLIT + * .-----------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | RGBTOG | RGBMOD | RGBHUI | RGBHUD | RGBSAI | RGBSAD | RGBVAI | RGBVAD | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_BACKLIT] = LAYOUT_ortho_7u( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/boardwalk/keymaps/default/config.h b/keyboards/boardwalk/keymaps/default/config.h new file mode 100644 index 00000000000..a2530241f47 --- /dev/null +++ b/keyboards/boardwalk/keymaps/default/config.h @@ -0,0 +1,16 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once diff --git a/keyboards/boardwalk/keymaps/default/keymap.c b/keyboards/boardwalk/keymaps/default/keymap.c new file mode 100644 index 00000000000..fddb3da8251 --- /dev/null +++ b/keyboards/boardwalk/keymaps/default/keymap.c @@ -0,0 +1,162 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +// Layer shorthand +enum layer { + _1U, + _FN, + _HHKB, + _7U, + _2UARROW, + _625UARROW, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* 1uGrid + * .-----------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | LGUI | FN | LALT | SPACE | SPACE | SPACE | SPACE | SPACE | SPACE | RIGHT | DOWN | UP | RIGHT | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_1U] = LAYOUT_ortho_5x14( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, MO(1), KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL \ + ), + + /* HHKB + * .-----------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | | LCTRL | FN | LALT | LGUI | SPACE | SPACE | LEFT | DOWN | UP | RIGHT | | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_HHKB] = LAYOUT_ortho_hhkb( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* 7u HHKB + * .-----------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | | LCTRL | LALT | SPACE | RALT | FN | | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_7U] = LAYOUT_ortho_7u( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, MO(1) \ + ), + + /* 2x2u Space with Arrows + * .-----------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | LGUI | FN | LALT | SPACE | SPACE | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_2UARROW] = LAYOUT_2u_arrow( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_QUOT, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSLS, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, MO(1), KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* 6.25u Space with Arrows + * .-----------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | LGUI | LALT | SPACE | FN | RCTRL | LEFT | DOWN | RIGHT | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + [_625UARROW] = LAYOUT_625u_arrow( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_QUOT, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSLS, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + +/* FUNCTION + * .-----------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------' + */ + + + [_FN] = LAYOUT_ortho_5x14( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/boardwalk/keymaps/default/readme.md b/keyboards/boardwalk/keymaps/default/readme.md new file mode 100644 index 00000000000..73cf19b06fb --- /dev/null +++ b/keyboards/boardwalk/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Boardwalk diff --git a/keyboards/boardwalk/keymaps/mcallaster/keymap.c b/keyboards/boardwalk/keymaps/mcallaster/keymap.c new file mode 100644 index 00000000000..9ec6f926711 --- /dev/null +++ b/keyboards/boardwalk/keymaps/mcallaster/keymap.c @@ -0,0 +1,54 @@ +#include QMK_KEYBOARD_H + +// Layer shorthand +enum layer { + _BASE, + _LOWER, + _RAISE, + _FN +}; + +#define LOWER MO(1) +#define RAISE MO(2) +#define FN MO(3) + +// Mac sleep +#define __SLEEP S(LCTL(KC_POWER)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_ortho_hhkb( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_SLCK, KC_PSCR, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME, KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_END, KC_PGDN, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_INS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_CAPS, KC_LALT, KC_LGUI, RAISE, KC_SPC, KC_SPC, LOWER, KC_RGUI, KC_RALT, KC_RCTL + ), + + [_LOWER] = LAYOUT_ortho_hhkb( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_PAUS, KC_NLCK, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, \ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GRV, KC_BSLS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT_ortho_hhkb( + _______, KC_F11, KC_F12, _______, _______, _______, KC_PAUS, KC_NLCK, _______, _______, _______, _______, _______, _______, \ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_TILD, KC_PIPE, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_FN] = LAYOUT_ortho_hhkb( + __SLEEP, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, \ + _______, RESET, _______, KC_MPRV, KC_MNXT, _______, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, \ + _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, _______, RGB_SAD, RGB_HUD, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, \ + _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _FN); +} diff --git a/keyboards/boardwalk/keymaps/nchristus/config.h b/keyboards/boardwalk/keymaps/nchristus/config.h new file mode 100644 index 00000000000..a2530241f47 --- /dev/null +++ b/keyboards/boardwalk/keymaps/nchristus/config.h @@ -0,0 +1,16 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once diff --git a/keyboards/boardwalk/keymaps/nchristus/keymap.c b/keyboards/boardwalk/keymaps/nchristus/keymap.c new file mode 100644 index 00000000000..57b6736cbb5 --- /dev/null +++ b/keyboards/boardwalk/keymaps/nchristus/keymap.c @@ -0,0 +1,62 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW 0 + +#define LOWER LT(1, KC_SPC) +#define RAISE LT(2, KC_ENT) + +#define CTRLESC CTL_T(KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _QWE: Base Layer (Default Layer) */ + [_QW] = LAYOUT_ortho_hhkb( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + CTRLESC, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + MO(3), KC_LCTL, KC_LALT, KC_LGUI, RAISE, LOWER, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Keymap LOWER: Lower Layer */ + [1] = LAYOUT_ortho_hhkb( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______ + ), + + /* Keymap RAISE: Raise Layer */ + [2] = LAYOUT_ortho_hhkb( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______ + ), + + /* Keymap _FL: Function Layer */ + [3] = LAYOUT_ortho_hhkb( + RESET, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/boardwalk/keymaps/nchristus/readme.md b/keyboards/boardwalk/keymaps/nchristus/readme.md new file mode 100644 index 00000000000..73cf19b06fb --- /dev/null +++ b/keyboards/boardwalk/keymaps/nchristus/readme.md @@ -0,0 +1 @@ +# The default keymap for Boardwalk diff --git a/keyboards/boardwalk/keymaps/nchristus/rules.mk b/keyboards/boardwalk/keymaps/nchristus/rules.mk new file mode 100644 index 00000000000..b07a6475be5 --- /dev/null +++ b/keyboards/boardwalk/keymaps/nchristus/rules.mk @@ -0,0 +1,14 @@ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +RGBLIGHT_ENABLE = yes diff --git a/keyboards/boardwalk/readme.md b/keyboards/boardwalk/readme.md new file mode 100644 index 00000000000..932e7e9d6c4 --- /dev/null +++ b/keyboards/boardwalk/readme.md @@ -0,0 +1,16 @@ +# Boardwalk + +![Boardwalk](https://i.imgur.com/CQj3b9E.jpg) + +The Boardwalk is a 60% ortholinear keyboard, designed around Ergodox keycap sets and to fit into many standard 60% cases. The project was inspired by OLKB’s Atomic keyboard, which used larger 2u mods, but u/shensmobile +decided to switch to 1.5u keys so that Ergodox sets would provide excellent compatibility. The rest of the board can be covered using standard key sizes from 60% sets. + +Keyboard Maintainer: QMK Community +Hardware Supported: Boardwalk Ortholinear PCB +Hardware Availability: [panc.co](https://www.panc.co/boardwalk-group-buy.html) + +Make example for this keyboard (after setting up your build environment): + + make boardwalk:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/boardwalk/rules.mk b/keyboards/boardwalk/rules.mk new file mode 100644 index 00000000000..0a02497bc3b --- /dev/null +++ b/keyboards/boardwalk/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu + +# QMK Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_5x14 diff --git a/keyboards/boston_meetup/2019/2019.c b/keyboards/boston_meetup/2019/2019.c new file mode 100644 index 00000000000..933c14dee4f --- /dev/null +++ b/keyboards/boston_meetup/2019/2019.c @@ -0,0 +1,215 @@ +/* Copyright 2019 ishtob + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "2019.h" +#include "qwiic.h" +#include "action_layer.h" +#include "haptic.h" + +#ifdef RGB_MATRIX_ENABLE +#include "rgb_matrix.h" + +led_config_t g_led_config = { { + { 5, NO_LED, NO_LED, 0 }, + { NO_LED, NO_LED, NO_LED, NO_LED }, + { 4, NO_LED, NO_LED, 1 }, + { 3, NO_LED, NO_LED, 2 } +}, { + { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 } +}, { + 4, 4, 4, 4, 4, 4 +} }; +#endif + +uint8_t *o_fb; + +uint16_t counterst = 0; + + + +#ifdef QWIIC_MICRO_OLED_ENABLE + +/* screen off after this many milliseconds */ +#include "timer.h" +#define ScreenOffInterval 60000 /* milliseconds */ +static uint16_t last_flush; + +volatile uint8_t led_numlock = false; +volatile uint8_t led_capslock = false; +volatile uint8_t led_scrolllock = false; + +static uint8_t layer; +static bool queue_for_send = false; +static uint8_t encoder_value = 32; + +__attribute__ ((weak)) +void draw_ui(void) { + clear_buffer(); + last_flush = timer_read(); + send_command(DISPLAYON); + +/* Boston MK title is 55 x 10 pixels */ +#define NAME_X 0 +#define NAME_Y 0 + + draw_string(NAME_X + 1, NAME_Y + 2, "BOSTON MK", PIXEL_ON, NORM, 0); + +/* Layer indicator is 41 x 10 pixels */ +#define LAYER_INDICATOR_X 60 +#define LAYER_INDICATOR_Y 0 + + draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); + draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); + draw_char(LAYER_INDICATOR_X + 34, LAYER_INDICATOR_Y + 2, layer + 0x30, PIXEL_ON, XOR, 0); + +/* Matrix display is 12 x 12 pixels */ +#define MATRIX_DISPLAY_X 8 +#define MATRIX_DISPLAY_Y 16 + + for (uint8_t x = 0; x < MATRIX_ROWS; x++) { + for (uint8_t y = 0; y < MATRIX_COLS; y++) { + draw_pixel(MATRIX_DISPLAY_X + y + y + 2, MATRIX_DISPLAY_Y + x + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); + draw_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); + draw_pixel(MATRIX_DISPLAY_X + y + y + 2, MATRIX_DISPLAY_Y + x + x + 3,(matrix_get_row(x) & (1 << y)) > 0, NORM); + draw_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 3,(matrix_get_row(x) & (1 << y)) > 0, NORM); + + } + } + draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 12, 12, PIXEL_ON, NORM); + /* hadron oled location on thumbnail */ + draw_rect_filled_soft(MATRIX_DISPLAY_X + 5, MATRIX_DISPLAY_Y + 2, 6, 2, PIXEL_ON, NORM); +/* + draw_rect_soft(0, 13, 64, 6, PIXEL_ON, NORM); + draw_line_vert(encoder_value, 13, 6, PIXEL_ON, NORM); + +*/ + +/* Mod display is 41 x 16 pixels */ +#define MOD_DISPLAY_X 60 +#define MOD_DISPLAY_Y 20 + + uint8_t mods = get_mods(); + if (mods & MOD_LSFT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 0, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LCTL) { + draw_rect_filled_soft(MOD_DISPLAY_X + 10, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LALT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 20, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LGUI) { + draw_rect_filled_soft(MOD_DISPLAY_X + 30, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_ON, NORM, 0); + } + +/* Lock display is 23 x 32 */ +#define LOCK_DISPLAY_X 104 +#define LOCK_DISPLAY_Y 0 + + if (led_numlock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X, LOCK_DISPLAY_Y, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_OFF, NORM, 0); + } else if (led_numlock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_ON, NORM, 0); + } + if (led_capslock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 11, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_OFF, NORM, 0); + } else if (led_capslock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_ON, NORM, 0); + } + + if (led_scrolllock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 22, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_OFF, NORM, 0); + } else if (led_scrolllock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_ON, NORM, 0); + } + send_buffer(); +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + if (led_numlock == false){led_numlock = true;} + } else { + if (led_numlock == true){led_numlock = false;} + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + if (led_capslock == false){led_capslock = true;} + } else { + if (led_capslock == true){led_capslock = false;} + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + if (led_scrolllock == false){led_scrolllock = true;} + } else { + if (led_scrolllock == true){led_scrolllock = false;} + } +} + +uint32_t layer_state_set_kb(uint32_t state) { + state = layer_state_set_user(state); + layer = biton32(state); + queue_for_send = true; + return state; +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + queue_for_send = true; + return process_record_user(keycode, record); +} + +void encoder_update_kb(uint8_t index, bool clockwise) { + encoder_value = (encoder_value + (clockwise ? 1 : -1)) % 64; + queue_for_send = true; +} + +#endif + +void matrix_init_kb(void) { + queue_for_send = true; + matrix_init_user(); +} + +void matrix_scan_kb(void) { +if (queue_for_send) { +#ifdef QWIIC_MICRO_OLED_ENABLE + draw_ui(); +#endif + queue_for_send = false; + } +#ifdef QWIIC_MICRO_OLED_ENABLE + if (timer_elapsed(last_flush) > ScreenOffInterval) { + send_command(DISPLAYOFF); /* 0xAE */ + } +#endif + if (counterst == 0) { + //testPatternFB(o_fb); + } + counterst = (counterst + 1) % 1024; + //rgblight_task(); + matrix_scan_user(); +} diff --git a/keyboards/boston_meetup/2019/2019.h b/keyboards/boston_meetup/2019/2019.h new file mode 100644 index 00000000000..fbba5c3154f --- /dev/null +++ b/keyboards/boston_meetup/2019/2019.h @@ -0,0 +1,19 @@ +/* Copyright 2019 ishtob + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "boston_meetup.h" + diff --git a/keyboards/boston_meetup/2019/config.h b/keyboards/boston_meetup/2019/config.h new file mode 100644 index 00000000000..fa3dda730e2 --- /dev/null +++ b/keyboards/boston_meetup/2019/config.h @@ -0,0 +1,194 @@ +#pragma once + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x07E3 + +#undef MATRIX_ROWS +#undef MATRIX_COLS +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS + +#define MATRIX_ROW_PINS { A3, B8, B9, B1 } +#define MATRIX_COL_PINS { A7, A8, B2, B10 } + +#define ENCODERS_PAD_A { B13 } +#define ENCODERS_PAD_B { B14 } + +//Audio +#undef AUDIO_VOICES +#undef C6_AUDIO + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(ONE_UP_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + +#define AUDIO_CLICKY + /* to enable clicky on startup */ + //#define AUDIO_CLICKY_ON +#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f +#endif + +//configure qwiic micro_oled driver for the 128x32 oled +#ifdef QWIIC_MICRO_OLED_ENABLE + +#undef I2C_ADDRESS_SA0_1 +#define I2C_ADDRESS_SA0_1 0b0111100 +#define LCDWIDTH 128 +#define LCDHEIGHT 32 +#define micro_oled_rotate_180 + +#endif +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 6 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +/* Haptic Driver initialization settings + * Feedback Control Settings */ +#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ +#define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ + +/* default 3V ERM vibration motor voltage and library*/ +#if FB_ERM_LRA == 0 +#define RATED_VOLTAGE 3 +#define V_RMS 2.3 +#define V_PEAK 3.30 +/* Library Selection */ +#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ + +/* default 2V LRA voltage and library */ +#elif FB_ERM_LRA == 1 +#define RATED_VOLTAGE 2 +#define V_RMS 2.0 +#define V_PEAK 2.85 +#define F_LRA 200 +/* Library Selection */ +#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ + +#endif + +/* Control 1 register settings */ +#define DRIVE_TIME 25 +#define AC_COUPLE 0 +#define STARTUP_BOOST 1 + +/* Control 2 Settings */ +#define BIDIR_INPUT 1 +#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ +#define SAMPLE_TIME 3 +#define BLANKING_TIME 1 +#define IDISS_TIME 1 + +/* Control 3 settings */ +#define NG_THRESH 2 +#define ERM_OPEN_LOOP 1 +#define SUPPLY_COMP_DIS 0 +#define DATA_FORMAT_RTO 0 +#define LRA_DRIVE_MODE 0 +#define N_PWM_ANALOG 0 +#define LRA_OPEN_LOOP 0 +/* Control 4 settings */ +#define ZC_DET_TIME 0 +#define AUTO_CAL_TIME 3 + +#define RGBLIGHT_ANIMATIONS + +#define RGBLED_NUM 10 +#define RGB_DI_PIN B5 +#define DRIVER_LED_TOTAL RGBLED_NUM + +#define RGB_MATRIX_KEYPRESSES + +#define SOLENOID_PIN A14 diff --git a/keyboards/boston_meetup/2019/info.json b/keyboards/boston_meetup/2019/info.json new file mode 100644 index 00000000000..15ab72935c2 --- /dev/null +++ b/keyboards/boston_meetup/2019/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Boston Meetup 2019", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 13, + "layout": [{"label":"K00", "x":0, "y":0}, {"label":"K10", "x":0, "y":1}, {"label":"K11", "x":1, "y":1}, {"label":"K12", "x":2, "y":1}, {"label":"K13", "x":3, "y":1}, {"label":"K20", "x":0, "y":2}, {"label":"K21", "x":1, "y":2}, {"label":"K22", "x":2, "y":2}, {"label":"K23", "x":3, "y":2}, {"label":"K30", "x":0, "y":3}, {"label":"K31", "x":1, "y":3}, {"label":"K32", "x":2, "y":3}, {"label":"K33", "x":3, "y":3}] } + } +} diff --git a/keyboards/boston_meetup/2019/keymaps/default/keymap.c b/keyboards/boston_meetup/2019/keymaps/default/keymap.c new file mode 100644 index 00000000000..52d67273e37 --- /dev/null +++ b/keyboards/boston_meetup/2019/keymaps/default/keymap.c @@ -0,0 +1,166 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum custom_layers { + _BASE, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + BASE = SAFE_RANGE, + LOWER, + RAISE, + KC_DEMOMACRO +}; + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl +#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise +#define DEMOMACRO KC_DEMOMACRO // Sample for macros + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base + * ,------. + * | Esc | + * |------+------+-------------. + * | : | 7 | 8 | 9 | + * |------+------+------+------| + * | RAISE| 4 | 5 | 6 | + * |------+------+------+------| + * | LOWER| 1 | 2 | 3 | + * `---------------------------' + */ +[_BASE] = LAYOUT( + KC_ESC, + KC_COLN, KC_P7, KC_P8, KC_P9, + RAISE, KC_P4, KC_P5, KC_P6, + LOWER, KC_P1, KC_P2, KC_P3 +), + +/* Lower + * ,------. + * | Nmlk | + * |------+------+-------------. + * | : | / | * | - | + * |------+------+------+------| + * | | | = | + | + * |------+------+------+------| + * | | 0 | . | ENT | + * `---------------------------' + */ +[_LOWER] = LAYOUT( + KC_NLCK, + KC_COLN, KC_PSLS, KC_PAST, KC_PMNS, + _______, XXXXXXX, KC_EQL, KC_PPLS, + _______, KC_P0, KC_PDOT, KC_PENT +), + +/* Raise + * ,------. + * | Esc | + * |------+------+-------------. + * |RGB TG|RGB M+|RGB M-| | + * |------+------+------+------| + * | |RGB H+|RGB S+|RGB V+| + * |------+------+------+------| + * | ` |RGB H-|RGB S-|RGB V-| + * `---------------------------' + */ +[_RAISE] = LAYOUT( + KC_NLCK, + RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX, + _______, RGB_HUI, RGB_SAI, RGB_VAI, + _______, RGB_HUD, RGB_SAD, RGB_VAD + +), + +/* Adjust + * ,------. + * | DFU | + * |------+------+-------------. + * |HPT TG|HPT FB|HPT RS| BKSP | + * |------+------+------+------| + * | |HPT M+| | | + * |------+------+------+------| + * | |HPT M-|Clk TG| Del | + * `---------------------------' + */ +[_ADJUST] = LAYOUT( + RESET, + HPT_TOG, HPT_FBK, HPT_RST, KC_BSPC, + _______, HPT_MODI, XXXXXXX, XXXXXXX, + _______, HPT_MODD, CK_TOGG, KC_DEL +), + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_DEMOMACRO: + if (record->event.pressed) { + // when keycode KC_DEMOMACRO is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode KC_DEMOMACRO is released + } + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +void matrix_init_user(void) { +} + + +void matrix_scan_user(void) { +} + diff --git a/keyboards/boston_meetup/2019/keymaps/default/readme.md b/keyboards/boston_meetup/2019/keymaps/default/readme.md new file mode 100644 index 00000000000..75f80b51914 --- /dev/null +++ b/keyboards/boston_meetup/2019/keymaps/default/readme.md @@ -0,0 +1,51 @@ +# The Default Boston Meetup 2019 board Layout + +Keymap: +``` +Base +,------. +| Esc | +|------+------+-------------. +| : | 7 | 8 | 9 | +|------+------+------+------| +| RAISE| 4 | 5 | 6 | +|------+------+------+------| +| LOWER| 1 | 2 | 3 | +`---------------------------' + +Lower +,------. +| Nmlk | +|------+------+-------------. +| : | / | * | - | +|------+------+------+------| +| | | = | + | +|------+------+------+------| +| | 0 | . | ENT | +`---------------------------' + +Raise +,------. +| Esc | +|------+------+-------------. +|RGB TG|RGB M+|RGB M-| | +|------+------+------+------| +| |RGB H+|RGB S+|RGB V+| +|------+------+------+------| +| |RGB H-|RGB S-|RGB V-| +`---------------------------' + +Adjust: +,------. +| DFU | +|------+------+-------------. +|HPT TG|HPT FB|HPT RS| BKSP | +|------+------+------+------| +| |HPT M+| | | +|------+------+------+------| +| |HPT M-|Clk TG| Del | +`---------------------------' + +``` + +RGB still work in progress \ No newline at end of file diff --git a/keyboards/boston_meetup/2019/keymaps/readme.md b/keyboards/boston_meetup/2019/keymaps/readme.md new file mode 100644 index 00000000000..c10a49f7d03 --- /dev/null +++ b/keyboards/boston_meetup/2019/keymaps/readme.md @@ -0,0 +1,22 @@ +# How to add your own keymap + +Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`: + + _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author] + +\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements + +and contain the following files: + +* `keymap.c` +* `readme.md` *recommended* +* `config.h` *optional*, found automatically when compiling +* `Makefile` *optional*, found automatically when compling + +When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format: + + * **folder_name** description + +# List of 2019 keymaps + +* **default** default 2019 macropad layout \ No newline at end of file diff --git a/keyboards/boston_meetup/2019/readme.md b/keyboards/boston_meetup/2019/readme.md new file mode 100644 index 00000000000..2bdac9dcde1 --- /dev/null +++ b/keyboards/boston_meetup/2019/readme.md @@ -0,0 +1,13 @@ +# Boston Meetup 2019 Macropad + +![Boston Meetup 2019](https://i.imgur.com/6LgBc4g.jpg) + +Limited-run board designed for Boston MK community meetup 2019. + +Keyboard Maintainer: [ishtob](https://github.com/ishtob), [QMK](https://github.com/qmk) + +Make example for this keyboard (after setting up your build environment): + + make boston_meetup/2019:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/boston_meetup/2019/rules.mk b/keyboards/boston_meetup/2019/rules.mk new file mode 100644 index 00000000000..7c03a025eef --- /dev/null +++ b/keyboards/boston_meetup/2019/rules.mk @@ -0,0 +1,24 @@ +# project specific files + +# Cortex version +MCU = STM32F303 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = no #WS2812 +HAPTIC_ENABLE += DRV2605L +QWIIC_ENABLE += MICRO_OLED +# SERIAL_LINK_ENABLE = yes diff --git a/keyboards/boston_meetup/boston_meetup.c b/keyboards/boston_meetup/boston_meetup.c new file mode 100644 index 00000000000..a9201ac8520 --- /dev/null +++ b/keyboards/boston_meetup/boston_meetup.c @@ -0,0 +1,2 @@ +#include "boston_meetup.h" + diff --git a/keyboards/boston_meetup/boston_meetup.h b/keyboards/boston_meetup/boston_meetup.h new file mode 100644 index 00000000000..e1d9d920603 --- /dev/null +++ b/keyboards/boston_meetup/boston_meetup.h @@ -0,0 +1,19 @@ +#pragma once + +#ifdef KEYBOARD_boston_meetup_2019 + #include "2019.h" +#define LAYOUT( \ + K00, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ + ) \ +{ \ + { K00, KC_NO, KC_NO, KC_NO }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 } \ +} +#endif + +#include "quantum.h" \ No newline at end of file diff --git a/keyboards/boston_meetup/config.h b/keyboards/boston_meetup/config.h new file mode 100644 index 00000000000..b025e18df56 --- /dev/null +++ b/keyboards/boston_meetup/config.h @@ -0,0 +1,60 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFB30 +#define PRODUCT_ID 0x26BE +#define MANUFACTURER ishtob +#define PRODUCT Boston Meetup Board +#define DESCRIPTION A limited-run community meetup board + +//#define AUDIO_VOICES + +//#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/boston_meetup/readme.md b/keyboards/boston_meetup/readme.md new file mode 100644 index 00000000000..2fa1ec9583f --- /dev/null +++ b/keyboards/boston_meetup/readme.md @@ -0,0 +1,14 @@ +# Boston Meetup Macropads + +![Boston Meetup Macropads](https://i.imgur.com/yQcBF8g.jpg) + +Limited-run boards designed for Boston MK community meetups. + +Keyboard Maintainer: [ishtob](https://github.com/ishtob), [QMK](https://github.com/qmk) +Hardware Supported: Boston Meetup PCB 2018, 2019 + +Make example for this keyboard (after setting up your build environment): + + make boston_meetup/YYYY:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/boston_meetup/rules.mk b/keyboards/boston_meetup/rules.mk new file mode 100644 index 00000000000..6dd899edc85 --- /dev/null +++ b/keyboards/boston_meetup/rules.mk @@ -0,0 +1,2 @@ + +DEFAULT_FOLDER = boston_meetup/2019 diff --git a/keyboards/bpiphany/frosty_flake/config.h b/keyboards/bpiphany/frosty_flake/config.h index 2c73f10743b..250a1b775b2 100644 --- a/keyboards/bpiphany/frosty_flake/config.h +++ b/keyboards/bpiphany/frosty_flake/config.h @@ -45,7 +45,7 @@ along with this program. If not, see . #define UNUSED_PINS { B0, C4, D3 } /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -85,11 +85,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/bpiphany/frosty_flake/frosty_flake.h b/keyboards/bpiphany/frosty_flake/frosty_flake.h index 953172a8b0e..82428739634 100644 --- a/keyboards/bpiphany/frosty_flake/frosty_flake.h +++ b/keyboards/bpiphany/frosty_flake/frosty_flake.h @@ -1,5 +1,4 @@ -#ifndef FROSTY_FLAKE_H -#define FROSTY_FLAKE_H +#pragma once #include "quantum.h" @@ -26,7 +25,7 @@ | A4 | P2 | C6 | K6 | C0 | M3 | D0 | A1 | | O0 | K0 | L0 | | L6 | Q6 | | `-------------------------------------------------------------------------' `--------------' `-------------------' */ -#define KEYMAP( \ +#define LAYOUT( \ KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, KK1, KL1, KQ1, KQ0, \ KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, KK5, KL5, KQ5, KO5, \ @@ -66,7 +65,7 @@ `-------------------------------------------------------------------------' `--------------' */ -#define KEYMAP_TKL( \ +#define LAYOUT_tkl( \ KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ @@ -94,7 +93,7 @@ KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \ KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ -) KEYMAP_TKL( \ +) LAYOUT_tkl( \ KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ @@ -103,4 +102,3 @@ KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ ) -#endif diff --git a/keyboards/bpiphany/frosty_flake/info.json b/keyboards/bpiphany/frosty_flake/info.json new file mode 100644 index 00000000000..15fb23d737b --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/info.json @@ -0,0 +1,301 @@ +{ + "keyboard_name": "Frosty Flake", + "url": "", + "maintainer": "qmk", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"/", "x":19.5, "y":1.5}, + {"label":"*", "x":20.5, "y":1.5}, + {"label":"-", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"7", "x":18.5, "y":2.5}, + {"label":"8", "x":19.5, "y":2.5}, + {"label":"9", "x":20.5, "y":2.5}, + {"label":"+", "x":21.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":18.5, "y":3.5}, + {"label":"5", "x":19.5, "y":3.5}, + {"label":"6", "x":20.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"1", "x":18.5, "y":4.5}, + {"label":"2", "x":19.5, "y":4.5}, + {"label":"3", "x":20.5, "y":4.5}, + {"label":"Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"0", "x":18.5, "y":5.5, "w":2}, + {"label":".", "x":20.5, "y":5.5} + ] + }, + "LAYOUT_tkl": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/config.h b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/config.h index b25194014b5..017ead4255d 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/config.h +++ b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/config.h @@ -1,11 +1,4 @@ - -#define TAPPING_TERM 150 //reduce time required to register a held key - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif +#define TAPPING_TERM 150 //reduce time required to register a held key diff --git a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c index 81899396af7..f76b7e02c81 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c +++ b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c @@ -1,9 +1,4 @@ -#include "frosty_flake.h" -#include "action_layer.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#include "eeconfig.h" +#include QMK_KEYBOARD_H enum QFR_layers { _COLEMAK, @@ -26,8 +21,8 @@ enum custom_macros { R_POINT }; - const uint16_t PROGMEM fn_actions[] = { //ACTION_LAYER_TAP_TOGGLE requires that number of taps be defined in *config.h* - default set to 5 - [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), //Hold for momentary Lower layer, Tap for Space, + const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), //Hold for momentary Lower layer, Tap for Space, [1] = ACTION_LAYER_MOMENTARY(_MOUSE) //Hold for momentary MOUSE }; @@ -37,12 +32,8 @@ enum custom_macros { #define PIPE M(R_PIPE) #define POINT M(R_POINT) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_COLEMAK] = KEYMAP_TKL(\ +[_COLEMAK] = LAYOUT_tkl(\ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC,KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ @@ -51,25 +42,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL,KC_LGUI, KC_LALT, SPC_LW, MSE, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT ), -[_QWERTY] = KEYMAP_TKL(\ +[_QWERTY] = LAYOUT_tkl(\ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL,KC_LGUI,KC_LALT, SPC_LW, MSE, KC_RGUI , KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + KC_LCTL,KC_LGUI,KC_LALT, SPC_LW, MSE, KC_RGUI , KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), -[_DVORAK] = KEYMAP_TKL(\ +[_DVORAK] = LAYOUT_tkl(\ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ KC_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ KC_BSPC,KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_QUOT, KC_ENT, \ KC_LSFT,KC_NUBS,KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ - KC_LCTL,KC_LGUI,KC_LALT, SPC_LW, MSE, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + KC_LCTL,KC_LGUI,KC_LALT, SPC_LW, MSE, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), -[_LOWER] = KEYMAP_TKL(\ +[_LOWER] = LAYOUT_tkl(\ RESET, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, _______, KC_MUTE, KC_VOLD, KC_VOLU, QWERTY, COLEMAK,DVORAK, \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LBRC, KC_RBRC, KC_UNDS, KC_PLUS, KC_BSPC, _______,_______,_______, \ KC_TAB, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, KC_PIPE, _______,_______,_______, \ @@ -78,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, KC_RALT, _______, _______, _______, _______,_______,_______ \ ), -[_MOUSE] = KEYMAP_TKL(\ +[_MOUSE] = LAYOUT_tkl(\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,_______,_______, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, _______,_______,_______, \ KC_TAB, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, XXXXXXX, XXXXXXX, KC_BTN3, KC_BTN4, KC_BTN5, XXXXXXX, KC_LBRC, KC_RBRC, KC_BSLS, _______,_______,_______, \ @@ -106,7 +97,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } return MACRO_NONE; } - + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: @@ -126,7 +117,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { set_single_persistent_default_layer(_DVORAK); } return false; - break; + break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/config.h b/keyboards/bpiphany/frosty_flake/keymaps/default/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/default/config.h +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c index 4dc7ed655f7..9d40d4c9cc3 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c @@ -1,11 +1,12 @@ -#include "frosty_flake.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP(\ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, KC_END,KC_PGDN, KC_P7, KC_P8, KC_P9,KC_PPLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) -}; \ No newline at end of file + [0] = LAYOUT(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ) +}; diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk index 93f927c7d0a..5dcea846726 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) @@ -13,9 +13,5 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h index 3f785264377..4bc6d2c3c03 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h @@ -1,8 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once +// place overrides here #define TAPPING_TERM 200 #define LEADER_TIMEOUT 800 @@ -17,7 +15,4 @@ #define MOUSEKEY_DELAY 0 #define MOUSEKEY_TIME_TO_MAX 60 #define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 0 -// place overrides here - -#endif +#define MOUSEKEY_WHEEL_DELAY 0 diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c index bf7c5e58837..dd2098d945b 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c @@ -1,11 +1,5 @@ -#include "frosty_flake.h" -#include "action_layer.h" -#include "eeconfig.h" -#include "process_unicode.h" -#include "process_unicodemap.h" -#include "quantum.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H + #define MAXEMOJITAPS 80 @@ -33,16 +27,16 @@ enum taps{ ALLS }; -enum unicode_name { +enum unicode_name { EMOTIS = 1,//80, //1F60x - 1F64x ANIMALS, //64, //1F40x - 1F43x SYMBOLS,// = 45, //1F300 - 1F32C - FOODS,// = 87 , //1F32D - + FOODS,// = 87 , //1F32D - ETC,// = 192, //1F44x -1F4Fx VEHICLES,// = 83, //1F68x - 1F6Dx SUPPLEMENT,// = 32, //1F91x-1F92x ALCHEMY,// = 116 //1F70x - 1F773 - + }; enum my_macros { @@ -102,7 +96,7 @@ const uint32_t PROGMEM unicode_map[] = { [EMOTIS] = 0x1F600, [ANIMALS] = 0x1F400, [SYMBOLS] = 0x1F300, - [FOODS] = 0x1F32D, + [FOODS] = 0x1F32D, [ETC] = 0x1F440, [VEHICLES] = 0x1F680, [SUPPLEMENT] = 0x1F910, @@ -110,27 +104,30 @@ const uint32_t PROGMEM unicode_map[] = { }; // Layouts const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP(\ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, KC_END,KC_PGDN, KC_P7, KC_P8, KC_P9,KC_PPLS, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSPO,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \ - TD(TD_CTCPS),KC_LGUI,KC_LALT, KC_SPC, KC_LEAD,KC_RGUI, KC_APP,MO(1) , KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT), -[1] = KEYMAP(\ - TD(ALLS), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ - KC_GRV, TD(EMOJIS),TD(ANIMAL),TD(ETC),TD(FOODS), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \ - KC_TAB, KC_Q, M(0), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_UP ,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \ - KC_LCTL, M(1), M(3), M(2), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_LEFT,KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \ - KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2),_______ , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT), -[2] = KEYMAP(\ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \ - KC_LCTL, KC_D, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \ - KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2) , KC_NO , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT), + [0] = LAYOUT(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSPO, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + TD(TD_CTCPS), KC_LGUI, KC_LALT, KC_SPC, KC_LEAD, KC_RGUI, KC_APP, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + [1] = LAYOUT(\ + TD(ALLS), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, TD(EMOJIS), TD(ANIMAL), TD(ETC), TD(FOODS), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MPRV, KC_MPLY, KC_MNXT, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, M(0), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_UP, KC_RBRC, KC_BSLS, KC_MUTE, KC_VOLD, KC_VOLU, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_LCTL, M(1), M(3), M(2), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_LEFT, KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_BTN1, KC_BTN3, KC_BTN2, KC_SPC, KC_RALT, KC_RGUI, TG(2), _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_P0, KC_PDOT \ + ), + [2] = LAYOUT(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MPRV, KC_MPLY, KC_MNXT, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_MUTE, KC_VOLD, KC_VOLU, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_LCTL, KC_D, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_BTN1, KC_BTN3, KC_BTN2, KC_SPC, KC_RALT, KC_RGUI, TG(2), KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_P0, KC_PDOT \ + ), }; LEADER_EXTERNS(); @@ -183,7 +180,7 @@ void cycleEmojis(qk_tap_dance_state_t *state, void *user_data) { } }; -void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) { +void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) { if(state->count == 1) { unicode_input_start(); register_hex32(pgm_read_dword(&unicode_map[ANIMALS])); diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk index fc5761c0535..de0f30e48e7 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk @@ -12,13 +12,9 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode -UNICODEMAP_ENABLE = yes # unicodemap +UNICODEMAP_ENABLE = yes # unicodemap BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes LEADER_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h b/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h +++ b/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c index 99dc95627ed..8e872397193 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c +++ b/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c @@ -1,7 +1,7 @@ -#include "frosty_flake.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP_TKL(\ +[0] = LAYOUT_tkl(\ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ diff --git a/keyboards/bpiphany/frosty_flake/matrix.c b/keyboards/bpiphany/frosty_flake/matrix.c index 480e3455ba1..3c49e9c000f 100644 --- a/keyboards/bpiphany/frosty_flake/matrix.c +++ b/keyboards/bpiphany/frosty_flake/matrix.c @@ -24,10 +24,10 @@ #include "util.h" #include "matrix.h" -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; @@ -111,7 +111,7 @@ uint8_t matrix_scan(void) { bool curr_bit = col_scan & (1<. #include "config_common.h" - /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6050 @@ -53,9 +52,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +98,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/bpiphany/kitten_paw/keymaps/default/keymap.c b/keyboards/bpiphany/kitten_paw/keymaps/default/keymap.c index 6767f04145d..bd909c288cc 100644 --- a/keyboards/bpiphany/kitten_paw/keymaps/default/keymap.c +++ b/keyboards/bpiphany/kitten_paw/keymaps/default/keymap.c @@ -14,26 +14,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } @@ -48,4 +28,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void led_set_user(uint8_t usb_led) { -} \ No newline at end of file +} diff --git a/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c index 856cef9cc24..e2b56132bfb 100644 --- a/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c +++ b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c @@ -1,14 +1,13 @@ #include QMK_KEYBOARD_H #include "mousekey.h" -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define C(kc) LCTL(KC_##kc) +#undef C +#undef S +#define C(kc) LCTL(KC_##kc) +#define S(kc) LSFT(KC_##kc) #define RA(kc) RALT(KC_##kc) #define KC_SLCT KC_SELECT #define MEDAPP LT(MEDIA, KC_APP) -#undef S -#define S(kc) LSFT(KC_##kc) uint8_t current_layer_global = 255; @@ -42,9 +41,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, KC_END,KC_PGDN, KC_P7, KC_P8, KC_P9,KC_PPLS, \ - F(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + TT(MOUSE1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ F(8),KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, F(9), KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \ - F(1),KC_LGUI, F(3), LT(MISC, KC_SPC), F(4), F(5), MEDAPP, F(2), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT), + F(1),KC_LGUI, F(3), LT(MISC, KC_SPC), F(4),TT(PROG1), MEDAPP, F(2), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT), /* Layer 1: Programming Layer 1, emulating US l ayout */ [PROG1] = LAYOUT(\ KC_ESC,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ @@ -98,12 +97,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_TOGGLE(MOUSE1), // tap-toggle mouse layer (4) [1] = ACTION_FUNCTION_TAP(LCTRL_BRACKET), // tap to print [ [2] = ACTION_FUNCTION_TAP(RCTRL_BRACKET), // tap to print ] [3] = ACTION_FUNCTION_TAP(LALT_CURLY), // tap to print { [4] = ACTION_FUNCTION_TAP(RALT_CURLY), // tap to print } - [5] = ACTION_LAYER_TAP_TOGGLE(PROG1), // tap-toggle programming layer 1 [6] = ACTION_LAYER_SET_CLEAR(DEFAULT), [7] = ACTION_FUNCTION_TAP(CTRL_CLICK), [8] = ACTION_FUNCTION_TAP(LSHFT_PAREN), // tap to print ( diff --git a/keyboards/bpiphany/kitten_paw/matrix.c b/keyboards/bpiphany/kitten_paw/matrix.c index 6fdbfffd621..b59089cdf43 100644 --- a/keyboards/bpiphany/kitten_paw/matrix.c +++ b/keyboards/bpiphany/kitten_paw/matrix.c @@ -24,10 +24,10 @@ #include "util.h" #include "matrix.h" -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; @@ -98,7 +98,7 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<. #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +#define DEBOUNCE 5 #endif diff --git a/keyboards/bpiphany/pegasushoof/info.json b/keyboards/bpiphany/pegasushoof/info.json new file mode 100644 index 00000000000..c4fa28ac46a --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/info.json @@ -0,0 +1,192 @@ +{ + "keyboard_name": "Pegasus Hoof", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + } + } +} diff --git a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c index 6faf4db6fa4..7db7e5d39ee 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c +++ b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c @@ -15,9 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "pegasushoof.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H /* Swedish keys */ #define SE_HALF KC_GRV @@ -44,7 +42,7 @@ along with this program. If not, see . const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Blowrak ISO layer, a Swedish take on Dvorak */ - [KM_BLOWRAK] = KEYMAP( \ + [KM_BLOWRAK] = LAYOUT( \ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ KC_TAB, SE_AO, SE_AE, SE_OE, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_COMM,SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ @@ -52,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, SE_LTGT,KC_DOT, KC_Q, KC_J, KC_K, KC_B, KC_X, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), /* Layer 1: Standard ISO layer */ - [KM_QWERTY] = KEYMAP( \ + [KM_QWERTY] = LAYOUT( \ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, SE_AO, SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ @@ -60,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, SE_LTGT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, SE_MINS, KC_RSFT, KC_UP, \ KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), /* Layer 2: Media layer */ - [KM_MEDIA] = KEYMAP( \ + [KM_MEDIA] = LAYOUT( \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_MUTE,_______,KC_VOLD, \ @@ -68,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MPLY, \ _______,_______,_______, _______, _______,_______,RESET ,_______, KC_MPRV,KC_MSTP,KC_MNXT), /* Layer 3: Programming layer */ - [KM_HAXHAX] = KEYMAP( \ + [KM_HAXHAX] = LAYOUT( \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ _______,SE_LCBR,SE_PIPE,SE_RCBR,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ diff --git a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk index 7a616ee5f34..8254a83891d 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk +++ b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) @@ -14,9 +14,4 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h b/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h index 2d27ff392d6..122627e88f4 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h @@ -1,11 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* overridden settings: */ #undef PRODUCT #define PRODUCT Pegasus Hoof Citadel - -#endif diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c index 382854de9b5..5036bcb3f53 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c @@ -14,14 +14,18 @@ * along with this program. If not, see . */ -#include "pegasushoof.h" +#include QMK_KEYBOARD_H /* Allow shortcuts for combos like RALT(KC_RBRC) that don't take up more than 7 characters: */ -#define G(kc) RALT(KC_##kc) -#define A(kc) LALT(KC_##kc) +/* Original shortcuts (quantum_keycodes.h) take full-sized keycodes: too long! */ +#undef C +#undef S +#undef A +#undef G #define C(kc) LCTL(KC_##kc) -#undef S /* Original shortcut (quantum_keycodes.h) takes full-sized keycodes: too long! */ #define S(kc) LSFT(KC_##kc) +#define A(kc) LALT(KC_##kc) +#define G(kc) RALT(KC_##kc) #define CTALDEL LCTL(LALT(KC_DEL)) enum layers { @@ -58,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '------------------------------------------------------------------------' '--------------' * NUHS = true position of KC_NUHS */ -[DEF] = KEYMAP( \ +[DEF] = LAYOUT( \ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,TD(AF4), \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_NUHS, KC_DEL, KC_END, KC_PGDN, \ @@ -89,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '------------------------------------------------------------------------' '--------------' * */ -[FUN] = KEYMAP( \ +[FUN] = LAYOUT( \ CTALDEL, KC_MYCM,KC_WHOM,KC_CALC,KC_MSEL,KC_MPRV,KC_MNXT,KC_MPLY,KC_MSTP,KC_MUTE,KC_VOLD,KC_VOLU,MO(RES), _______,KC_SLCK,KC_PAUS, \ _______,_______,_______,_______,_______,_______,_______,G(7), G(8), G(9), G(0), G(MINS),_______,_______, _______,_______,KC_WH_U, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,G(RBRC),_______, _______,_______,KC_WH_D, \ @@ -99,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 3: Reset layer (prevents accidental resets) */ -[RES] = KEYMAP( \ +[RES] = LAYOUT( \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk index 4cec29477ac..3eb289a7166 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk @@ -13,10 +13,5 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. TAP_DANCE_ENABLE = yes # see https://docs.qmk.fm/#/feature_tap_dance (+1000) - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c index aa006b23a46..621441b9013 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c +++ b/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c @@ -15,46 +15,42 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "pegasushoof.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H #define KM_QWERTY 0 #define KM_MEDIA 1 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: Standard ISO layer */ - [KM_QWERTY] = KEYMAP( \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ - KC_CLCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN0, KC_LEFT,KC_DOWN,KC_RGHT), - /* Layer 1: Function layer */ - [KM_MEDIA] = KEYMAP( \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLD, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MPLY, \ - _______,_______,_______, _______, _______,_______,RESET ,_______, KC_MPRV,KC_MSTP,KC_MNXT) -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(KM_MEDIA) + /* Layer 0: Standard ISO layer */ + [KM_QWERTY] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CLCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + /* Layer 1: Function layer */ + [KM_MEDIA] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WAKE, KC_PWR, KC_SLEP, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, \ + _______, _______, _______, _______, _______, _______, RESET, _______, KC_MPRV, KC_MSTP, KC_MNXT \ + ) }; void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - ph_caps_led_on(); - } else { - ph_caps_led_off(); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - ph_sclk_led_on(); - } else { - ph_sclk_led_off(); - } + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + ph_caps_led_on(); + } else { + ph_caps_led_off(); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + ph_sclk_led_on(); + } else { + ph_sclk_led_off(); + } } diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk index 7a616ee5f34..8254a83891d 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk +++ b/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) @@ -14,9 +14,4 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default_jis/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/default_jis/keymap.c new file mode 100644 index 00000000000..a7747418226 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/default_jis/keymap.c @@ -0,0 +1,54 @@ +/* +Copyright 2016 Daniel Svensson + 2018 Charlie McMackin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +#define KM_JIS 0 +#define KM_MEDIA 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = + { + /* Layer 0: Standard JIS layer */ + [KM_JIS] = LAYOUT_tkl_jis(KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_JYEN, KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_BSLS,KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RO, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI,KC_LALT,KC_MHEN, KC_SPC, KC_HENK,KC_KANA,KC_RALT,MO(1), KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT), + /* Layer 1: Function layer */ + [KM_MEDIA] = LAYOUT_tkl_jis(_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLD, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_MPLY, \ + _______,_______,_______,_______, _______, _______,_______,_______,_______,RESET , KC_MPRV,KC_MSTP,KC_MNXT) + }; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + ph_caps_led_on(); + } else { + ph_caps_led_off(); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + ph_sclk_led_on(); + } else { + ph_sclk_led_off(); + } +} diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default_jis/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/default_jis/rules.mk new file mode 100644 index 00000000000..8254a83891d --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/default_jis/rules.mk @@ -0,0 +1,17 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +CUSTOM_MATRIX = yes # Custom matrix file for the Pegasus Hoof due to the 2x74HC42 +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/bpiphany/pegasushoof/matrix.c b/keyboards/bpiphany/pegasushoof/matrix.c index 127433875df..a670d538238 100644 --- a/keyboards/bpiphany/pegasushoof/matrix.c +++ b/keyboards/bpiphany/pegasushoof/matrix.c @@ -26,7 +26,7 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; @@ -90,7 +90,7 @@ uint8_t matrix_scan(void) bool curr_bit = rows & (1<. #include "matrix.h" #include "quantum.h" -#define ___ KC_NO - -#define KEYMAP( \ - KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ - KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ - KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ - KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ - KB2, KH6, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ - KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ - ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ - /* 0 */ { ___ , ___ , KC0 , ___ , ___ , KF0 , ___ , ___ , ___ , KJ0 , KK0 , ___ , KM0 , KN0 , KO0 , ___ , KQ0 , KR0 }, \ - /* 1 */ { ___ , ___ , ___ , ___ , ___ , ___ , KG1 , KH1 , KI1 , KJ1 , KK1 , KL1 , KM1 , ___ , KO1 , KP1 , ___ , ___ }, \ - /* 2 */ { ___ , KB2 , ___ , KD2 , ___ , KF2 , KG2 , KH2 , KI2 , KJ2 , KK2 , KL2 , KM2 , ___ , KO2 , ___ , ___ , ___ }, \ - /* 3 */ { KA3 , KB3 , ___ , ___ , ___ , KF3 , KG3 , KH3 , KI3 , KJ3 , KK3 , KL3 , KM3 , ___ , KO3 , ___ , ___ , ___ }, \ - /* 4 */ { ___ , ___ , KC4 , ___ , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , KM4 , ___ , KO4 , KP4 , KQ4 , KR4 }, \ - /* 5 */ { ___ , ___ , KC5 , ___ , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , KK5 , KL5 , KM5 , KN5 , KO5 , KP5 , ___ , ___ }, \ - /* 6 */ { ___ , ___ , KC6 , ___ , ___ , KF6 , KG6 , KH6 , KI6 , KJ6 , KK6 , KL6 , ___ , KN6 , KO6 , ___ , KQ6 , ___ }, \ - /* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , ___ , KP7 , ___ , ___ }, \ - } +#define LAYOUT( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ + KB2, KH6, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ + KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ + ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ + /* 0 */ { KC_NO , KC_NO , KC0 , KC_NO , KC_NO , KF0 , KC_NO , KC_NO , KC_NO , KJ0 , KK0 , KC_NO , KM0 , KN0 , KO0 , KC_NO , KQ0 , KR0 }, \ + /* 1 */ { KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KG1 , KH1 , KI1 , KJ1 , KK1 , KL1 , KM1 , KC_NO , KO1 , KP1 , KC_NO , KC_NO }, \ + /* 2 */ { KC_NO , KB2 , KC_NO , KD2 , KC_NO , KF2 , KG2 , KH2 , KI2 , KJ2 , KK2 , KL2 , KM2 , KC_NO , KO2 , KC_NO , KC_NO , KC_NO }, \ + /* 3 */ { KA3 , KB3 , KC_NO , KC_NO , KC_NO , KF3 , KG3 , KH3 , KI3 , KJ3 , KK3 , KL3 , KM3 , KC_NO , KO3 , KC_NO , KC_NO , KC_NO }, \ + /* 4 */ { KC_NO , KC_NO , KC4 , KC_NO , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , KM4 , KC_NO , KO4 , KP4 , KQ4 , KR4 }, \ + /* 5 */ { KC_NO , KC_NO , KC5 , KC_NO , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , KK5 , KL5 , KM5 , KN5 , KO5 , KP5 , KC_NO , KC_NO }, \ + /* 6 */ { KC_NO , KC_NO , KC6 , KC_NO , KC_NO , KF6 , KG6 , KH6 , KI6 , KJ6 , KK6 , KL6 , KC_NO , KN6 , KO6 , KC_NO , KQ6 , KC_NO }, \ + /* 7 */ { KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , KC_NO , KP7 , KC_NO , KC_NO } \ + } + +#define LAYOUT_tkl_ansi( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ + KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ + KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ + ) LAYOUT( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ + KB2,KC_NO,KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ + KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ + ) + +#define LAYOUT_tkl_jis( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO7, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO3, KO1, \ + KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KL0, KB3, KC6, \ + KP4, KD2, KN6, KG0, KQ6, KH0, KI0, KN0, KM0, KP1, KC0, KQ0, KR0 \ + ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ + /* 0 */ { KC_NO, KC_NO, KC0, KC_NO, KC_NO, KF0, KG0, KH0, KI0, KJ0, KK0, KL0, KM0, KN0, KO0, KC_NO, KQ0, KR0 }, \ + /* 1 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KG1, KH1, KI1, KJ1, KK1, KL1, KM1, KC_NO, KO1, KP1, KC_NO, KC_NO }, \ + /* 2 */ { KC_NO, KB2, KC_NO, KD2, KC_NO, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KM2, KC_NO, KO2, KC_NO, KC_NO, KC_NO }, \ + /* 3 */ { KC_NO, KB3, KC_NO, KC_NO, KC_NO, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KC_NO, KO3, KC_NO, KC_NO, KC_NO }, \ + /* 4 */ { KC_NO, KC_NO, KC4, KC_NO, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KM4, KC_NO, KO4, KP4, KQ4, KR4 }, \ + /* 5 */ { KC_NO, KC_NO, KC5, KC_NO, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KM5, KN5, KO5, KP5, KC_NO, KC_NO }, \ + /* 6 */ { KC_NO, KC_NO, KC6, KC_NO, KC_NO, KF6, KG6, KC_NO, KI6, KJ6, KK6, KL6, KC_NO, KN6, KO6, KC_NO, KQ6, KC_NO }, \ + /* 7 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KF7, KG7, KH7, KI7, KJ7, KK7, KL7, KK7, KL7, KO7, KP7, KC_NO, KC_NO } \ +} inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); } inline void ph_caps_led_off(void) { DDRC &= ~(1<<6); PORTC &= ~(1<<6); } diff --git a/keyboards/bpiphany/pegasushoof/readme.md b/keyboards/bpiphany/pegasushoof/readme.md new file mode 100644 index 00000000000..10ec79300ac --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/readme.md @@ -0,0 +1,13 @@ +# Pegasus Hoof Controller + +A replacement controller that turns your Filco Majestouch 87/88 mechanical keyboard into a fully programmable keyboard. + +Keyboard Maintainer: QMK Community +Hardware Supported: Pegasus Hoof +Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/filco-pegasus-hoof-controller/) + +Make example for this keyboard (after setting up your build environment): + + make bpiphany/pegasus_hoof:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/bpiphany/pegasushoof/rules.mk b/keyboards/bpiphany/pegasushoof/rules.mk index 0cfe115aabf..00e4bb0ea10 100644 --- a/keyboards/bpiphany/pegasushoof/rules.mk +++ b/keyboards/bpiphany/pegasushoof/rules.mk @@ -60,8 +60,9 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +LAYOUTS = tkl_ansi CUSTOM_MATRIX = yes SRC = matrix.c diff --git a/keyboards/bpiphany/sixshooter/config.h b/keyboards/bpiphany/sixshooter/config.h new file mode 100644 index 00000000000..ade95cc1918 --- /dev/null +++ b/keyboards/bpiphany/sixshooter/config.h @@ -0,0 +1,122 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6666 +#define DEVICE_VER 0x0001 +#define MANUFACTURER bpiphany +#define PRODUCT sixshooter +#define DESCRIPTION A PCB for the CM Storm switch tester utilizing a Teensy 2.0. + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { } +#define MATRIX_COL_PINS { F7, F6, F1, F5, F4, F0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/sixshooter/info.json b/keyboards/bpiphany/sixshooter/info.json similarity index 100% rename from keyboards/sixshooter/info.json rename to keyboards/bpiphany/sixshooter/info.json diff --git a/keyboards/bpiphany/sixshooter/keymaps/default/keymap.c b/keyboards/bpiphany/sixshooter/keymaps/default/keymap.c new file mode 100644 index 00000000000..51f115d935a --- /dev/null +++ b/keyboards/bpiphany/sixshooter/keymaps/default/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2018 QMK Community + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FN 1 + +// Define keyboard specific keycodes for controlling on/off for all LEDs as they +// are all on different pins with this PCB, rather than a single backlight pin +enum custom_keycodes { + SS_LON = SAFE_RANGE, + SS_LOFF +}; +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base Layer: Media Keys + * ,-----------. + * |FN | V-| V+| + * |---+---+---| + * |Prv|Ply|Nxt| + * `-----------' + */ + [_BL] = LAYOUT( /* Base */ + MO(_FN), KC_VOLD, KC_VOLU, \ + KC_MPRV, KC_MPLY, KC_MNXT \ + ), + /* FN Layer: LED control + * ,-----------. + * |FN | V-| V+| + * |---+---+---| + * |Prv|Ply|Nxt| + * `-----------' + */ + [_FN] = LAYOUT( + KC_TRNS, SS_LON, SS_LOFF, \ + KC_NO, KC_NO, KC_NO + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // Put your per-action keyboard code here. + // Runs for every action, just before processing by the firmware. + if (record->event.pressed) { + + // Check for custom keycodes for turning on and off LEDs + switch(keycode) { + case SS_LON: + sixshooter_led_all_on(); + return false; + case SS_LOFF: + sixshooter_led_all_off(); + return false; + } + } + return true; +}; + +void matrix_init_user(void) { + // Default all LEDs to on + sixshooter_led_all_on(); +} diff --git a/keyboards/sixshooter/keymaps/default/readme.md b/keyboards/bpiphany/sixshooter/keymaps/default/readme.md similarity index 100% rename from keyboards/sixshooter/keymaps/default/readme.md rename to keyboards/bpiphany/sixshooter/keymaps/default/readme.md diff --git a/keyboards/bpiphany/sixshooter/readme.md b/keyboards/bpiphany/sixshooter/readme.md new file mode 100644 index 00000000000..f5d92600348 --- /dev/null +++ b/keyboards/bpiphany/sixshooter/readme.md @@ -0,0 +1,13 @@ +# The Six Shooter + +A PCB for the CM Storm switch tester utilizing a Teensy 2.0 designed by Bpiphany. Because the PCB was designed with individual pins for each LED, there are custom keycodes (`SS_LON` and `SS_LOFF`) for turning on and off the backlight LEDs. + +Keyboard Maintainer: QMK Community +Hardware Supported: Six Shooter PCB, Teensy 2.0 +Hardware Availability: [GeekHack.org](https://geekhack.org/index.php?topic=70033.0) + +Make example for this keyboard (after setting up your build environment): + + make bpiphany/sixshooter:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/sixshooter/rules.mk b/keyboards/bpiphany/sixshooter/rules.mk similarity index 100% rename from keyboards/sixshooter/rules.mk rename to keyboards/bpiphany/sixshooter/rules.mk diff --git a/keyboards/bpiphany/sixshooter/sixshooter.c b/keyboards/bpiphany/sixshooter/sixshooter.c new file mode 100644 index 00000000000..87a739454d3 --- /dev/null +++ b/keyboards/bpiphany/sixshooter/sixshooter.c @@ -0,0 +1,38 @@ +#include "sixshooter.h" + +extern inline void sixshooter_led_0_on(void); +extern inline void sixshooter_led_1_on(void); +extern inline void sixshooter_led_2_on(void); +extern inline void sixshooter_led_3_on(void); +extern inline void sixshooter_led_4_on(void); +extern inline void sixshooter_led_5_on(void); + +extern inline void sixshooter_led_0_off(void); +extern inline void sixshooter_led_1_off(void); +extern inline void sixshooter_led_2_off(void); +extern inline void sixshooter_led_3_off(void); +extern inline void sixshooter_led_4_off(void); +extern inline void sixshooter_led_5_off(void); + +extern inline void sixshooter_led_all_on(void); +extern inline void sixshooter_led_all_off(void); + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/bpiphany/sixshooter/sixshooter.h b/keyboards/bpiphany/sixshooter/sixshooter.h new file mode 100644 index 00000000000..490d562d061 --- /dev/null +++ b/keyboards/bpiphany/sixshooter/sixshooter.h @@ -0,0 +1,44 @@ +#ifndef SIXSHOOTER_H +#define SIXSHOOTER_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, \ + K03, K04, K05 \ +) { \ + { K00, K01, K02, K03, K04, K05 }, \ +} + +inline void sixshooter_led_0_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } +inline void sixshooter_led_1_on(void) { DDRC |= (1<<7); PORTC |= (1<<7); } +inline void sixshooter_led_2_on(void) { DDRD |= (1<<0); PORTD |= (1<<0); } +inline void sixshooter_led_3_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); } +inline void sixshooter_led_4_on(void) { DDRD |= (1<<7); PORTD |= (1<<7); } +inline void sixshooter_led_5_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); } + +inline void sixshooter_led_0_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); } +inline void sixshooter_led_1_off(void) { DDRC &= ~(1<<7); PORTC &= ~(1<<7); } +inline void sixshooter_led_2_off(void) { DDRD &= ~(1<<0); PORTD &= ~(1<<0); } +inline void sixshooter_led_3_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); } +inline void sixshooter_led_4_off(void) { DDRD &= ~(1<<7); PORTD &= ~(1<<7); } +inline void sixshooter_led_5_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); } + +inline void sixshooter_led_all_on(void) { + sixshooter_led_0_on(); + sixshooter_led_1_on(); + sixshooter_led_2_on(); + sixshooter_led_3_on(); + sixshooter_led_4_on(); + sixshooter_led_5_on(); +} +inline void sixshooter_led_all_off(void) { + sixshooter_led_0_off(); + sixshooter_led_1_off(); + sixshooter_led_2_off(); + sixshooter_led_3_off(); + sixshooter_led_4_off(); + sixshooter_led_5_off(); +} + +#endif diff --git a/keyboards/bpiphany/tiger_lily/config.h b/keyboards/bpiphany/tiger_lily/config.h index 4908192906f..1ab352ccb8d 100644 --- a/keyboards/bpiphany/tiger_lily/config.h +++ b/keyboards/bpiphany/tiger_lily/config.h @@ -45,7 +45,7 @@ along with this program. If not, see . #define UNUSED_PINS { B0, C4, D3 } /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -85,11 +85,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default/config.h b/keyboards/bpiphany/tiger_lily/keymaps/default/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/bpiphany/tiger_lily/keymaps/default/config.h +++ b/keyboards/bpiphany/tiger_lily/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk b/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk index 93f927c7d0a..7a331cd530c 100644 --- a/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk +++ b/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk index 93f927c7d0a..7a331cd530c 100644 --- a/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk +++ b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bpiphany/tiger_lily/matrix.c b/keyboards/bpiphany/tiger_lily/matrix.c index 3b48f6b3680..47a92268c86 100644 --- a/keyboards/bpiphany/tiger_lily/matrix.c +++ b/keyboards/bpiphany/tiger_lily/matrix.c @@ -24,10 +24,10 @@ #include "util.h" #include "matrix.h" -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; @@ -111,7 +111,7 @@ uint8_t matrix_scan(void) { bool curr_bit = col_scan & (1<. #define MATRIX_COLS 18 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -83,11 +83,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h b/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h index c55f7f9f7d2..ed56340c391 100644 --- a/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default/keymap.c b/keyboards/bpiphany/unloved_bastard/keymaps/default/keymap.c index ea103154eaa..3c23088357f 100644 --- a/keyboards/bpiphany/unloved_bastard/keymaps/default/keymap.c +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default/keymap.c @@ -25,27 +25,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/keymap.c b/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/keymap.c index 16c0342d237..783e37196ea 100644 --- a/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/keymap.c +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/keymap.c @@ -25,27 +25,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/bpiphany/unloved_bastard/matrix.c b/keyboards/bpiphany/unloved_bastard/matrix.c index bb6de8613af..328d9015c25 100644 --- a/keyboards/bpiphany/unloved_bastard/matrix.c +++ b/keyboards/bpiphany/unloved_bastard/matrix.c @@ -43,10 +43,10 @@ __attribute__ ((weak)) void matrix_scan_user(void) { } -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; @@ -112,7 +112,7 @@ uint8_t matrix_scan(void) { bool curr_bit = col_scan & (1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4257 +#define DEVICE_VER 0x0001 +#define MANUFACTURER BTHLabs +#define PRODUCT GeekPad +#define DESCRIPTION 3x3 custom macro pad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F4, F5, F6 } +#define MATRIX_COL_PINS { D4, D0, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +// #define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +// #define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/bthlabs/geekpad/geekpad.c b/keyboards/bthlabs/geekpad/geekpad.c new file mode 100644 index 00000000000..e52507c93dc --- /dev/null +++ b/keyboards/bthlabs/geekpad/geekpad.c @@ -0,0 +1,43 @@ +/* Copyright 2019-present Tomek Wójcik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "geekpad.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/bthlabs/geekpad/geekpad.h b/keyboards/bthlabs/geekpad/geekpad.h new file mode 100644 index 00000000000..c9f1ac9d4f6 --- /dev/null +++ b/keyboards/bthlabs/geekpad/geekpad.h @@ -0,0 +1,40 @@ +/* Copyright 2019-present Tomek Wójcik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef GEEKPAD_H +#define GEEKPAD_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, \ + K10, K11, K12, \ + K20, K21, K22 \ +) \ +{ \ + { K00, K01, K02 }, \ + { K10, K11, K12 }, \ + { K20, K21, K22 } \ +} + +#endif diff --git a/keyboards/bthlabs/geekpad/info.json b/keyboards/bthlabs/geekpad/info.json new file mode 100644 index 00000000000..c95497c5537 --- /dev/null +++ b/keyboards/bthlabs/geekpad/info.json @@ -0,0 +1,22 @@ +{ + "keyboard_name": "BTHLabs GeekPad", + "url": "https://git.bthlabs.pl/tomekwojcik/geekpad", + "maintainer": "Tomek Wójcik ", + "width": 3, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2,"y": 0}, + {"x": 0, "y": 1}, + {"x": 1, "y": 1}, + {"x": 2,"y": 1}, + {"x": 0, "y": 2}, + {"x": 1, "y": 2}, + {"x": 2,"y": 2} + ] + } + } +} diff --git a/keyboards/bthlabs/geekpad/keymaps/default/config.h b/keyboards/bthlabs/geekpad/keymaps/default/config.h new file mode 100644 index 00000000000..1cba162c796 --- /dev/null +++ b/keyboards/bthlabs/geekpad/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019-present Tomek Wójcik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/bthlabs/geekpad/keymaps/default/keymap.c b/keyboards/bthlabs/geekpad/keymaps/default/keymap.c new file mode 100644 index 00000000000..a8791e70cab --- /dev/null +++ b/keyboards/bthlabs/geekpad/keymaps/default/keymap.c @@ -0,0 +1,24 @@ +/* Copyright 2019-present Tomek Wójcik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_F1, KC_F2, KC_F3, + KC_MEDIA_REWIND, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_FAST_FORWARD, + KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP + ), +}; diff --git a/keyboards/bthlabs/geekpad/readme.md b/keyboards/bthlabs/geekpad/readme.md new file mode 100644 index 00000000000..6558c32d979 --- /dev/null +++ b/keyboards/bthlabs/geekpad/readme.md @@ -0,0 +1,15 @@ +# BTHLabs GeekPad + +![GeekPad](https://i.imgur.com/FEzO81l.jpg) + +A 3x3 custom macro pad designed and developed by Tomek Wójcik. + +Keyboard Maintainer: [Tomek Wójcik](https://www.bthlabs.pl/) +Hardware Supported: GeekPad Custom PCB +Hardware Availability: [Project Repository](https://git.bthlabs.pl/tomekwojcik/geekpad) + +Make example for this keyboard (after setting up your build environment): + + make bthlabs/geekpad:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/bthlabs/geekpad/rules.mk b/keyboards/bthlabs/geekpad/rules.mk new file mode 100644 index 00000000000..f51259b2910 --- /dev/null +++ b/keyboards/bthlabs/geekpad/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/business_card/alpha/alpha.c b/keyboards/business_card/alpha/alpha.c new file mode 100644 index 00000000000..3d2d1de7790 --- /dev/null +++ b/keyboards/business_card/alpha/alpha.c @@ -0,0 +1,51 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "alpha.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/business_card/alpha/alpha.h b/keyboards/business_card/alpha/alpha.h new file mode 100644 index 00000000000..98075768998 --- /dev/null +++ b/keyboards/business_card/alpha/alpha.h @@ -0,0 +1,35 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11, k12 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 }, \ +} diff --git a/keyboards/business_card/alpha/config.h b/keyboards/business_card/alpha/config.h new file mode 100644 index 00000000000..e0324d65448 --- /dev/null +++ b/keyboards/business_card/alpha/config.h @@ -0,0 +1,243 @@ +/* +Copyright 2019 kakunpc + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER kakunpc +#define PRODUCT business_card +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B2, B6 } +#define MATRIX_COL_PINS { E6, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 6 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/business_card/alpha/info.json b/keyboards/business_card/alpha/info.json new file mode 100644 index 00000000000..f0cd04efa28 --- /dev/null +++ b/keyboards/business_card/alpha/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "business_card alpha", + "url": "", + "maintainer": "kakunpc", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"1", "x":0, "y":0}, + {"label":"2", "x":1, "y":0}, + {"label":"3", "x":2, "y":0}, + {"label":"4", "x":0, "y":1}, + {"label":"5", "x":1, "y":1}, + {"label":"6", "x":2, "y":1} + ] + } + } +} diff --git a/keyboards/business_card/alpha/keymaps/default/config.h b/keyboards/business_card/alpha/keymaps/default/config.h new file mode 100644 index 00000000000..7c15789bdf2 --- /dev/null +++ b/keyboards/business_card/alpha/keymaps/default/config.h @@ -0,0 +1,22 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here +#ifdef RGB_DI_PIN + #define RGBLIGHT_ANIMATIONS +#endif diff --git a/keyboards/business_card/alpha/keymaps/default/keymap.c b/keyboards/business_card/alpha/keymaps/default/keymap.c new file mode 100644 index 00000000000..4c7b4237c37 --- /dev/null +++ b/keyboards/business_card/alpha/keymaps/default/keymap.c @@ -0,0 +1,47 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user + +const uint16_t PROGMEM +keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = +LAYOUT(/* Base */ + KC_1, KC_2, KC_3, + KC_4, KC_5, KC_6 +), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } + +void led_set_user(uint8_t usb_led) {} + +void keyboard_post_init_user(void) { + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD); +} + +#ifdef OLED_DRIVER_ENABLE +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0}; + + oled_write_P(qmk_logo, false); +} +void oled_task_user(void) { render_logo(); } +#endif diff --git a/keyboards/business_card/alpha/keymaps/default/readme.md b/keyboards/business_card/alpha/keymaps/default/readme.md new file mode 100644 index 00000000000..22cc77eebff --- /dev/null +++ b/keyboards/business_card/alpha/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for business_card \ No newline at end of file diff --git a/keyboards/business_card/alpha/rules.mk b/keyboards/business_card/alpha/rules.mk new file mode 100644 index 00000000000..8bb38a51426 --- /dev/null +++ b/keyboards/business_card/alpha/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +OLED_DRIVER_ENABLE = yes diff --git a/keyboards/business_card/beta/beta.c b/keyboards/business_card/beta/beta.c new file mode 100644 index 00000000000..c43be6c16ad --- /dev/null +++ b/keyboards/business_card/beta/beta.c @@ -0,0 +1,51 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "beta.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/business_card/beta/beta.h b/keyboards/business_card/beta/beta.h new file mode 100644 index 00000000000..21a334e8a9e --- /dev/null +++ b/keyboards/business_card/beta/beta.h @@ -0,0 +1,37 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, \ + k10, k11, \ + k20, k21 \ +) \ +{ \ + { k21, k20 }, \ + { k11, k10 }, \ + { k01, k00 }, \ +} diff --git a/keyboards/business_card/beta/config.h b/keyboards/business_card/beta/config.h new file mode 100644 index 00000000000..fc6514982f1 --- /dev/null +++ b/keyboards/business_card/beta/config.h @@ -0,0 +1,243 @@ +/* +Copyright 2019 kakunpc + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER kakunpc +#define PRODUCT business_card +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 2 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B3, B2, B6 } +#define MATRIX_COL_PINS { B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 6 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/business_card/beta/info.json b/keyboards/business_card/beta/info.json new file mode 100644 index 00000000000..62f2797a75e --- /dev/null +++ b/keyboards/business_card/beta/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "business_card beta", + "url": "", + "maintainer": "kakunpc", + "width": 2, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"1", "x":0, "y":0}, + {"label":"2", "x":1, "y":0}, + {"label":"3", "x":0, "y":1}, + {"label":"4", "x":1, "y":1}, + {"label":"5", "x":0, "y":2}, + {"label":"6", "x":1, "y":2} + ] + } + } +} diff --git a/keyboards/business_card/beta/keymaps/default/config.h b/keyboards/business_card/beta/keymaps/default/config.h new file mode 100644 index 00000000000..e04ba7e4d03 --- /dev/null +++ b/keyboards/business_card/beta/keymaps/default/config.h @@ -0,0 +1,23 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here + +#ifdef RGB_DI_PIN + #define RGBLIGHT_ANIMATIONS +#endif \ No newline at end of file diff --git a/keyboards/business_card/beta/keymaps/default/keymap.c b/keyboards/business_card/beta/keymaps/default/keymap.c new file mode 100644 index 00000000000..c317a236c43 --- /dev/null +++ b/keyboards/business_card/beta/keymaps/default/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM +keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = +LAYOUT(/* Base */ + KC_1, KC_2, + KC_3, KC_4, + KC_5, KC_6 +), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } + +void matrix_init_user(void) { + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD); +} + +void matrix_scan_user(void) {} + +void led_set_user(uint8_t usb_led) {} + +void keyboard_post_init_user(void) {} + +#ifdef OLED_DRIVER_ENABLE +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0}; + + oled_write_P(qmk_logo, false); +} +void oled_task_user(void) { render_logo(); } +#endif diff --git a/keyboards/business_card/beta/keymaps/default/readme.md b/keyboards/business_card/beta/keymaps/default/readme.md new file mode 100644 index 00000000000..22cc77eebff --- /dev/null +++ b/keyboards/business_card/beta/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for business_card \ No newline at end of file diff --git a/keyboards/business_card/beta/rules.mk b/keyboards/business_card/beta/rules.mk new file mode 100644 index 00000000000..8bb38a51426 --- /dev/null +++ b/keyboards/business_card/beta/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +OLED_DRIVER_ENABLE = yes diff --git a/keyboards/business_card/business_card.c b/keyboards/business_card/business_card.c new file mode 100644 index 00000000000..a57c004570b --- /dev/null +++ b/keyboards/business_card/business_card.c @@ -0,0 +1,51 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "business_card.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/business_card/business_card.h b/keyboards/business_card/business_card.h new file mode 100644 index 00000000000..f330a01822e --- /dev/null +++ b/keyboards/business_card/business_card.h @@ -0,0 +1,25 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#ifdef KEYBOARD_business_card_alpha + #include "alpha.h" +#endif +#ifdef KEYBOARD_business_card_beta + #include "beta.h" +#endif + +#include "quantum.h" diff --git a/keyboards/quefrency/keymaps/default65/rules.mk b/keyboards/business_card/config.h similarity index 100% rename from keyboards/quefrency/keymaps/default65/rules.mk rename to keyboards/business_card/config.h diff --git a/keyboards/business_card/readme.md b/keyboards/business_card/readme.md new file mode 100644 index 00000000000..c1bb32c9c3b --- /dev/null +++ b/keyboards/business_card/readme.md @@ -0,0 +1,15 @@ +# business_card + +![business_card](imgur.com image replace me!) + +A short description of the keyboard/project + +Keyboard Maintainer: [kakunpc](https://github.com/kakunpc) +Hardware Supported: The PCBs, controllers supported +Hardware Availability: links to where you can find this hardware + +Make example for this keyboard (after setting up your build environment): + + make business_card:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/business_card/rules.mk b/keyboards/business_card/rules.mk new file mode 100644 index 00000000000..d0b8a2367a0 --- /dev/null +++ b/keyboards/business_card/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +DEFAULT_FOLDER = business_card/beta diff --git a/keyboards/butterstick/butterstick.c b/keyboards/butterstick/butterstick.c new file mode 100644 index 00000000000..6c00bbe5dfd --- /dev/null +++ b/keyboards/butterstick/butterstick.c @@ -0,0 +1,56 @@ +/* Copyright 2019 Jeremy Bernhardt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "butterstick.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} +*/ + +void matrix_scan_kb(void) { +#ifdef DEBUG_MATRIX + for (uint8_t c = 0; c < MATRIX_COLS; c++) + for (uint8_t r = 0; r < MATRIX_ROWS; r++) + if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c); +#endif + + matrix_scan_user(); +} + +/* +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/butterstick/butterstick.h b/keyboards/butterstick/butterstick.h new file mode 100644 index 00000000000..f97488c3f58 --- /dev/null +++ b/keyboards/butterstick/butterstick.h @@ -0,0 +1,11 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_butter( \ + k09, k08, k07, k06, k05, k04, k03, k02, k01, k00, \ + k19, k18, k17, k16, k15, k14, k13, k12, k11, k10 \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09}, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19}, \ +} diff --git a/keyboards/butterstick/config.h b/keyboards/butterstick/config.h new file mode 100644 index 00000000000..90875d2eedd --- /dev/null +++ b/keyboards/butterstick/config.h @@ -0,0 +1,25 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1337 +#define DEVICE_VER 0x0001 +#define MANUFACTURER g Heavy Industries +#define PRODUCT Butter Stick +#define DESCRIPTION Its a stick of butter +#define VERSION "Paula Deen" + +#define DEBOUNCE 5 +#define FORCE_NKRO + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 10 +#define MATRIX_ROW_PINS { F4, F5 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6, B7, C6, C7} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL diff --git a/keyboards/butterstick/keymaps/default/keymap.c b/keyboards/butterstick/keymaps/default/keymap.c new file mode 100644 index 00000000000..e4d1ea91f3e --- /dev/null +++ b/keyboards/butterstick/keymaps/default/keymap.c @@ -0,0 +1,184 @@ +#include QMK_KEYBOARD_H + +#include "sten.h" +/* + * Key names are inherited from steno machines + * .-----------------------------------------------------. + * | LSU | LFT | LP | LH | ST1 | RF | RP | RL | RT | RD | + * |-----------------------------------------------------| + * | LSD | LK | LW | LR | ST2 | RR | RB | RG | RS | RZ | + * '-----------------------------------------------------' + */ + +// Function prefixes +#define MEDIA (LSD | LK | LW | LR) +#define FUNCT (LSD | LK | LP | LH) +#define MOVE (LSU | LFT | LP | LH) +#define SYMB (RD | RZ) +#define NUMA (LW | LR) +#define NUMB (RR | RB) + +// QMK Layer Numbers + #define BASE 0 + #define GAME 1 + +// Do not change QMK Layer 0! This is your main keyboard. +// Make your QMK modifications to the later layers, to add +// keys/customize on the first layer modify processQwerty(): +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_butter( + STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR + ), + // I don't game don't roast me thanks + [GAME] = LAYOUT_butter( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_ENT, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TO(BASE) + ) +}; + +// Note: You can only use basic keycodes here! +// P() is just a wrapper to make your life easier, any C code can be executed. +// Only the longest matched chord is run! +// +// http://docs.gboards.ca +uint32_t processQwerty(bool lookup) { + // SECRET AGENT CHORDS + P( LSU | LK | RS | RD, SEND_STRING(VERSION); SEND_STRING(__DATE__)); + P( LR | ST2| RR | RB, SEND(KC_BSPC)); + P( LSD | RZ, SEND(KC_SPC)); + + // Dual chords + P( LP | LH, CLICK_MOUSE(KC_MS_BTN2)); + P( ST1 | RF, CLICK_MOUSE(KC_MS_BTN1)); + P( LSU | LFT, SEND(KC_ESC)); + P( LSD | LK, SEND(KC_LSFT)); + P( RZ | RS, SEND(KC_LSFT)); + P( ST2 | RR, SEND(KC_SPC)); + P( RP | RL, SEND(KC_LGUI)); + P( RT | RD, SEND(KC_LCTL)); + P( RL | RT, SEND(KC_LALT)); + P( LSU | LSD | LFT | LK, SEND(KC_LCTL)); + P( RS | RT | RD | RZ, SEND(KC_ENT)); + + // Function Layer + P( FUNCT | RF, SEND(KC_F1)); + P( FUNCT | RP, SEND(KC_F2)); + P( FUNCT | RL, SEND(KC_F3)); + P( FUNCT | RT, SEND(KC_F4)); + P( FUNCT | RF | RR, SEND(KC_F5)); + P( FUNCT | RP | RB, SEND(KC_F6)); + P( FUNCT | RL | RG, SEND(KC_F7)); + P( FUNCT | RT | RS, SEND(KC_F8)); + P( FUNCT | RR, SEND(KC_F9)); + P( FUNCT | RB, SEND(KC_F10)); + P( FUNCT | RG, SEND(KC_F11)); + P( FUNCT | RS, SEND(KC_F12)); + + // Movement Layer + P( MOVE | RF, SEND(KC_LEFT)); + P( MOVE | RP, SEND(KC_DOWN)); + P( MOVE | RL, SEND(KC_UP)); + P( MOVE | RT, SEND(KC_RIGHT)); + P( MOVE | ST1, SEND(KC_PGUP)); + P( MOVE | ST2, SEND(KC_PGDN)); + + // Media Layer + P( MEDIA | RF, SEND(KC_MPRV)); + P( MEDIA | RP, SEND(KC_MPLY)); + P( MEDIA | RL, SEND(KC_MPLY)); + P( MEDIA | RT, SEND(KC_MNXT)); + P( MEDIA | RG, SEND(KC_VOLU)); + P( MEDIA | RB, SEND(KC_VOLD)); + P( MEDIA | RS, SEND(KC_MUTE)); + + // Number Row, Right + P( NUMB | LSU, SEND(KC_1)); + P( NUMB | LFT, SEND(KC_2)); + P( NUMB | LP, SEND(KC_3)); + P( NUMB | LH, SEND(KC_4)); + P( NUMB | ST1, SEND(KC_5)); + P( NUMB | RF, SEND(KC_6)); + P( NUMB | RP, SEND(KC_7)); + P( NUMB | RL, SEND(KC_8)); + P( NUMB | RT, SEND(KC_9)); + P( NUMB | RD, SEND(KC_0)); + + // Number Row, Left + P( NUMA | LSU, SEND(KC_1)); + P( NUMA | LFT, SEND(KC_2)); + P( NUMA | LP, SEND(KC_3)); + P( NUMA | LH, SEND(KC_4)); + P( NUMA | ST1, SEND(KC_5)); + P( NUMA | RF, SEND(KC_6)); + P( NUMA | RP, SEND(KC_7)); + P( NUMA | RL, SEND(KC_8)); + P( NUMA | RT, SEND(KC_9)); + P( NUMA | RD, SEND(KC_0)); + + + // Symbols and Numbers + P( SYMB | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // ( + P( SYMB | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // ) + P( SYMB | ST1 | ST2, SEND(KC_GRV)); // ` + P( SYMB | RR | RF, SEND(KC_LSFT); SEND(KC_3)); // # + P( SYMB | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $ + P( SYMB | LSU, SEND(KC_LSFT); SEND(KC_1)); // ! + P( SYMB | LSD, SEND(KC_LSFT); SEND(KC_5)); // % + P( SYMB | LFT, SEND(KC_LSFT); SEND(KC_2)); // @ + P( SYMB | LK, SEND(KC_LSFT); SEND(KC_6)); // ^ + P( SYMB | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // { + P( SYMB | LW, SEND(KC_LBRC)); + P( SYMB | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // } + P( SYMB | LR, SEND(KC_RBRC)); + P( SYMB | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // | + P( SYMB | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~ + P( SYMB | RP | RB, SEND(KC_QUOT)); + P( SYMB | RP | RG, SEND(KC_LSFT); SEND(KC_QUOT)); // " + P( SYMB | RF, SEND(KC_KP_PLUS)); + P( SYMB | RR, SEND(KC_LSFT); SEND(KC_7)); // & + P( SYMB | RP, SEND(KC_MINS)); + P( SYMB | RB, SEND(KC_EQL)); + P( SYMB | RL, SEND(KC_SLSH)); + P( SYMB | RG, SEND(KC_COMM)); + P( SYMB | RT, SEND(KC_PAST)); + P( SYMB | RS, SEND(KC_DOT)); + + // Letters + P( LSU | LSD, SEND(KC_A)); + P( LFT | LK, SEND(KC_S)); + P( LP | LW, SEND(KC_D)); + P( LH | LR, SEND(KC_F)); + P( ST1 | ST2, SEND(KC_G)); + P( RF | RR, SEND(KC_H)); + P( RT | RS, SEND(KC_L)); + P( RD | RZ, SEND(KC_SCLN)); + P( RG | RL, SEND(KC_K)); + P( RP | RB, SEND(KC_J)); + P( LSU, SEND(KC_Q)); + P( LSD, SEND(KC_Z)); + P( LFT, SEND(KC_W)); + P( LK, SEND(KC_X)); + P( LP, SEND(KC_E)); + P( LW, SEND(KC_C)); + P( LH, SEND(KC_R)); + P( LR, SEND(KC_V)); + P( ST1, SEND(KC_T)); + P( ST2, SEND(KC_B)); + P( RF, SEND(KC_Y)); + P( RR, SEND(KC_N)); + P( RP, SEND(KC_U)); + P( RB, SEND(KC_M)); + P( RL, SEND(KC_I)); + P( RG, SEND(KC_COMM)); + P( RT, SEND(KC_O)); + P( RS, SEND(KC_DOT)); + P( RD, SEND(KC_P)); + P( RZ, SEND(KC_SLSH)); + + return 0; +} + + +// Don't fuck with this, thanks. +size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]); diff --git a/keyboards/quefrency/rev1/rules.mk b/keyboards/butterstick/keymaps/default/rules.mk similarity index 100% rename from keyboards/quefrency/rev1/rules.mk rename to keyboards/butterstick/keymaps/default/rules.mk diff --git a/keyboards/butterstick/readme.md b/keyboards/butterstick/readme.md new file mode 100644 index 00000000000..8bae8ba5a05 --- /dev/null +++ b/keyboards/butterstick/readme.md @@ -0,0 +1,14 @@ +# Butter Stick + +![Butter Stick](https://i.redd.it/mvteaomko7s21.jpg) + +A chorded 20% keyboard packing full sized useage into your pocket. More info on [gboards.ca](http://docs.gboards.ca/Meet-Butter-Stick)! + +Keyboard Maintainer: [Germ](https://github.com/germ) +Hardware Availability: [g Heavy Industries](https://www.gboards.ca/product/butter-stick-limited-edition) + +Make example for this keyboard (after setting up your build environment): + + make butterstick:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/butterstick/rules.mk b/keyboards/butterstick/rules.mk new file mode 100644 index 00000000000..68b117bf590 --- /dev/null +++ b/keyboards/butterstick/rules.mk @@ -0,0 +1,19 @@ +# MCU name +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) + +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -DONLYQWERTY -DDEBUG_MATRIX +SRC += sten.c +EXTRAFLAGS += -flto + + +BOOTLOADER = atmel-dfu +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover +STENO_ENABLE = yes # Needed for chording + diff --git a/keyboards/butterstick/sten.c b/keyboards/butterstick/sten.c new file mode 100644 index 00000000000..a239e388421 --- /dev/null +++ b/keyboards/butterstick/sten.c @@ -0,0 +1,367 @@ +#include "sten.h" + +// Chord state +uint32_t cChord = 0; // Current Chord +int chordIndex = 0; // Keys in previousachord +int32_t chordState[32]; // Full Chord history +#define QWERBUF 24 // Size of chords to buffer for output + +bool repeatFlag = false; // Should we repeat? +uint32_t pChord = 0; // Previous Chord +int pChordIndex = 0; // Keys in previousachord +uint32_t pChordState[32]; // Previous chord sate +uint32_t stickyBits = 0; // Or'd with every incoming press + +// Mode state +enum MODE { STENO = 0, QWERTY, COMMAND }; +enum MODE pMode; +bool QWERSTENO = false; +#ifdef ONLYQWERTY +enum MODE cMode = QWERTY; +#else +enum MODE cMode = STENO; +#endif + +// Command State +#define MAX_CMD_BUF 20 +uint8_t CMDLEN = 0; +uint8_t CMDBUF[MAX_CMD_BUF]; + +// Key Repeat state +bool inChord = false; +bool repEngaged = false; +uint16_t repTimer = 0; +#define REP_INIT_DELAY 750 +#define REP_DELAY 25 + +// Mousekeys state +bool inMouse = false; +int8_t mousePress; + +// All processing done at chordUp goes through here +// Note, this is a gutted version of the Georgi sten.h +bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { + // Check for mousekeys, this is release +#ifdef MOUSEKEY_ENABLE + if (inMouse) { + inMouse = false; + mousekey_off(mousePress); + mousekey_send(); + } +#endif + + // handle command mode + if (cChord == (LSU | LSD | RD | RZ)) { + if (cMode != COMMAND) { // Entering Command Mode + CMDLEN = 0; + pMode = cMode; + cMode = COMMAND; + } else { // Exiting Command Mode + cMode = pMode; + + // Press all and release all + for (int i = 0; i < CMDLEN; i++) { + register_code(CMDBUF[i]); + } + clear_keyboard(); + } + + goto out; + } + + // Handle Gaming Toggle, + if (cChord == (LSU | LSD | LFT | LK | RT | RS | RD | RZ) && keymapsCount > 1) { +#ifndef NO_DEBUG + uprintf("Switching to QMK\n"); +#endif + layer_on(1); + goto out; + } + + // Do QWERTY and Momentary QWERTY + if (cMode == QWERTY || (cMode == COMMAND)) { + processChord(false); + goto out; + } + +out: + cChord = 0; + inChord = false; + chordIndex = 0; + clear_keyboard(); + repEngaged = false; + for (int i = 0; i < 32; i++) + chordState[i] = 0xFFFF; + + return false; +} + +// Update Chord State +bool process_steno_user(uint16_t keycode, keyrecord_t *record) { + // Everything happens in here when steno keys come in. + // Bail on keyup + if (!record->event.pressed) return true; + + // Update key repeat timers + repTimer = timer_read(); + inChord = true; + + // Switch on the press adding to chord + bool pr = record->event.pressed; + switch (keycode) { + // Mods and stuff + case STN_ST1: pr ? (cChord |= (ST1)): (cChord &= ~(ST1)); break; + case STN_ST2: pr ? (cChord |= (ST2)): (cChord &= ~(ST2)); break; + case STN_ST3: pr ? (cChord |= (ST3)): (cChord &= ~(ST3)); break; + case STN_ST4: pr ? (cChord |= (ST4)): (cChord &= ~(ST4)); break; + case STN_FN: pr ? (cChord |= (FN)) : (cChord &= ~(FN)); break; + case STN_PWR: pr ? (cChord |= (PWR)): (cChord &= ~(PWR)); break; + case STN_N1...STN_N6: pr ? (cChord |= (LNO)): (cChord &= ~(LNO)); break; + case STN_N7...STN_NC: pr ? (cChord |= (RNO)): (cChord &= ~(RNO)); break; + + // All the letter keys + case STN_S1: pr ? (cChord |= (LSU)) : (cChord &= ~(LSU)); break; + case STN_S2: pr ? (cChord |= (LSD)) : (cChord &= ~(LSD)); break; + case STN_TL: pr ? (cChord |= (LFT)) : (cChord &= ~(LFT)); break; + case STN_KL: pr ? (cChord |= (LK)) : (cChord &= ~(LK)); break; + case STN_PL: pr ? (cChord |= (LP)) : (cChord &= ~(LP)); break; + case STN_WL: pr ? (cChord |= (LW)) : (cChord &= ~(LW)); break; + case STN_HL: pr ? (cChord |= (LH)) : (cChord &= ~(LH)); break; + case STN_RL: pr ? (cChord |= (LR)) : (cChord &= ~(LR)); break; + case STN_A: pr ? (cChord |= (LA)) : (cChord &= ~(LA)); break; + case STN_O: pr ? (cChord |= (LO)) : (cChord &= ~(LO)); break; + case STN_E: pr ? (cChord |= (RE)) : (cChord &= ~(RE)); break; + case STN_U: pr ? (cChord |= (RU)) : (cChord &= ~(RU)); break; + case STN_FR: pr ? (cChord |= (RF)) : (cChord &= ~(RF)); break; + case STN_RR: pr ? (cChord |= (RR)) : (cChord &= ~(RR)); break; + case STN_PR: pr ? (cChord |= (RP)) : (cChord &= ~(RP)); break; + case STN_BR: pr ? (cChord |= (RB)) : (cChord &= ~(RB)); break; + case STN_LR: pr ? (cChord |= (RL)) : (cChord &= ~(RL)); break; + case STN_GR: pr ? (cChord |= (RG)) : (cChord &= ~(RG)); break; + case STN_TR: pr ? (cChord |= (RT)) : (cChord &= ~(RT)); break; + case STN_SR: pr ? (cChord |= (RS)) : (cChord &= ~(RS)); break; + case STN_DR: pr ? (cChord |= (RD)) : (cChord &= ~(RD)); break; + case STN_ZR: pr ? (cChord |= (RZ)) : (cChord &= ~(RZ)); break; + } + + // Store previous state for fastQWER + if (pr) { + chordState[chordIndex] = cChord; + chordIndex++; + } + + return true; +} +void matrix_scan_user(void) { + // We abuse this for early sending of key + // Key repeat only on QWER/SYMB layers + if (cMode != QWERTY || !inChord) return; + + // Check timers +#ifndef NO_REPEAT + if (repEngaged && timer_elapsed(repTimer) > REP_DELAY) { + // Process Key for report + processChord(false); + + // Send report to host + send_keyboard_report(); + clear_keyboard(); + repTimer = timer_read(); + } + + if (!repEngaged && timer_elapsed(repTimer) > REP_INIT_DELAY) { + repEngaged = true; + } +#endif +}; + +// For Plover NKRO +uint32_t processFakeSteno(bool lookup) { + P( LSU, SEND(KC_Q);); + P( LSD, SEND(KC_A);); + P( LFT, SEND(KC_W);); + P( LP, SEND(KC_E);); + P( LH, SEND(KC_R);); + P( LK, SEND(KC_S);); + P( LW, SEND(KC_D);); + P( LR, SEND(KC_F);); + P( ST1, SEND(KC_T);); + P( ST2, SEND(KC_G);); + P( LA, SEND(KC_C);); + P( LO, SEND(KC_V);); + P( RE, SEND(KC_N);); + P( RU, SEND(KC_M);); + P( ST3, SEND(KC_Y);); + P( ST4, SEND(KC_H);); + P( RF, SEND(KC_U);); + P( RP, SEND(KC_I);); + P( RL, SEND(KC_O);); + P( RT, SEND(KC_P);); + P( RD, SEND(KC_LBRC);); + P( RR, SEND(KC_J);); + P( RB, SEND(KC_K);); + P( RG, SEND(KC_L);); + P( RS, SEND(KC_SCLN);); + P( RZ, SEND(KC_COMM);); + P( LNO, SEND(KC_1);); + P( RNO, SEND(KC_1);); + + return 0; +} + +// Traverse the chord history to a given point +// Returns the mask to use +void processChord(bool useFakeSteno) { + // Save the clean chord state + uint32_t savedChord = cChord; + + // Apply Stick Bits if needed + if (stickyBits != 0) { + cChord |= stickyBits; + for (int i = 0; i <= chordIndex; i++) + chordState[i] |= stickyBits; + } + + // Strip FN + if (cChord & FN) cChord ^= FN; + + // First we test if a whole chord was passsed + // If so we just run it handling repeat logic + if (useFakeSteno && processFakeSteno(true) == cChord) { + processFakeSteno(false); + return; + } else if (processQwerty(true) == cChord) { + processQwerty(false); + // Repeat logic + if (repeatFlag) { + restoreState(); + repeatFlag = false; + processChord(false); + } else { + saveState(cChord); + } + return; + } + + // Iterate through chord picking out the individual + // and longest chords + uint32_t bufChords[QWERBUF]; + int bufLen = 0; + uint32_t mask = 0; + + // We iterate over it multiple times to catch the longest + // chord. Then that gets addded to the mask and re run. + while (savedChord != mask) { + uint32_t test = 0; + uint32_t longestChord = 0; + + for (int i = 0; i <= chordIndex; i++) { + cChord = chordState[i] & ~mask; + if (cChord == 0) + continue; + + // Assume mid parse Sym is new chord + if (i != 0 && test != 0 && (cChord ^ test) == PWR) { + longestChord = test; + break; + } + + // Lock SYM layer in once detected + if (mask & PWR) + cChord |= PWR; + + + // Testing for keycodes + if (useFakeSteno) { + test = processFakeSteno(true); + } else { + test = processQwerty(true); + } + + if (test != 0) { + longestChord = test; + } + } + + mask |= longestChord; + bufChords[bufLen] = longestChord; + bufLen++; + + // That's a loop of sorts, halt processing + if (bufLen >= QWERBUF) { + return; + } + } + + // Now that the buffer is populated, we run it + for (int i = 0; i < bufLen ; i++) { + cChord = bufChords[i]; + if (useFakeSteno) { + processFakeSteno(false); + } else { + processQwerty(false); + } + } + + // Save state in case of repeat + if (!repeatFlag) { + saveState(savedChord); + } + + // Restore cChord for held repeat + cChord = savedChord; + + return; +} +void saveState(uint32_t cleanChord) { + pChord = cleanChord; + pChordIndex = chordIndex; + for (int i = 0; i < 32; i++) + pChordState[i] = chordState[i]; +} +void restoreState() { + cChord = pChord; + chordIndex = pChordIndex; + for (int i = 0; i < 32; i++) + chordState[i] = pChordState[i]; +} + +// Macros for calling from keymap.c +void SEND(uint8_t kc) { + // Send Keycode, Does not work for Quantum Codes + if (cMode == COMMAND && CMDLEN < MAX_CMD_BUF) { +#ifndef NO_DEBUG + uprintf("CMD LEN: %d BUF: %d\n", CMDLEN, MAX_CMD_BUF); +#endif + CMDBUF[CMDLEN] = kc; + CMDLEN++; + } + + if (cMode != COMMAND) register_code(kc); + return; +} +void REPEAT(void) { + if (cMode != QWERTY) + return; + + repeatFlag = true; + return; +} +void SET_STICKY(uint32_t stick) { + stickyBits = stick; + return; +} +void SWITCH_LAYER(int layer) { + if (keymapsCount >= layer) + layer_on(layer); +} +void CLICK_MOUSE(uint8_t kc) { +#ifdef MOUSEKEY_ENABLE + mousekey_on(kc); + mousekey_send(); + + // Store state for later use + inMouse = true; + mousePress = kc; +#endif +} diff --git a/keyboards/butterstick/sten.h b/keyboards/butterstick/sten.h new file mode 100644 index 00000000000..5a9771d9a02 --- /dev/null +++ b/keyboards/butterstick/sten.h @@ -0,0 +1,77 @@ +// 2019, g Heavy Industries +// Blessed mother of Christ, please keep this readable +// and protect us from segfaults. For thine is the clock, +// the slave and the master. Until we return from main. +// +// Amen. + +#include QMK_KEYBOARD_H +#include "mousekey.h" +#include "keymap.h" +#include "keymap_steno.h" +#include "wait.h" + +extern size_t keymapsCount; // Total keymaps +extern uint32_t cChord; // Current Chord + +// Function defs +void processChord(bool useFakeSteno); +uint32_t processQwerty(bool lookup); +uint32_t processFakeSteno(bool lookup); +void saveState(uint32_t cChord); +void restoreState(void); + +// Macros for use in keymap.c +void SEND(uint8_t kc); +void REPEAT(void); +void SET_STICKY(uint32_t); +void SWITCH_LAYER(int); +void CLICK_MOUSE(uint8_t); + +// Keymap helper +#define P(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;} + +// Shift to internal representation +// i.e) S(teno)R(ight)F +#define STN(n) (1L< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCA17 +#define PRODUCT_ID 0xCA39 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Maple Computing +#define PRODUCT C39 +#define DESCRIPTION A compact 39 key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 13 + +#define MATRIX_ROW_PINS { D1, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, D7, E6, C6, D2, D3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/c39/info.json b/keyboards/c39/info.json new file mode 100755 index 00000000000..4ed7f018c8d --- /dev/null +++ b/keyboards/c39/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "C39", + "url": "", + "maintainer": "Space Cat", + "width": 13.25, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Q", "x":0, "y":0}, {"label":"W", "x":1, "y":0}, {"label":"E", "x":2, "y":0}, {"label":"R", "x":3, "y":0}, {"label":"T", "x":4, "y":0}, {"label":"Back", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"M1", "x":11.25, "y":0}, {"label":"M2", "x":12.25, "y":0}, {"label":"A", "x":0, "y":1}, {"label":"S", "x":1, "y":1}, {"label":"D", "x":2, "y":1}, {"label":"F", "x":3, "y":1}, {"label":"G", "x":4, "y":1}, {"label":"Enter", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":";", "x":10, "y":1}, {"label":"M3", "x":11.25, "y":1}, {"label":"M4", "x":12.25, "y":1}, {"label":"Z", "x":0, "y":2}, {"label":"X", "x":1, "y":2}, {"label":"C", "x":2, "y":2}, {"label":"V", "x":3, "y":2}, {"label":"B", "x":4, "y":2}, {"label":"Fn", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":"<", "x":8, "y":2}, {"label":">", "x":9, "y":2}, {"label":"?", "x":10, "y":2}, {"label":"M5", "x":11.25, "y":2}, {"label":"M6", "x":12.25, "y":2}] + } + } +} \ No newline at end of file diff --git a/keyboards/c39/keymaps/default/config.h b/keyboards/c39/keymaps/default/config.h new file mode 100755 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/c39/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/c39/keymaps/default/keymap.c b/keyboards/c39/keymaps/default/keymap.c new file mode 100755 index 00000000000..9de75190d03 --- /dev/null +++ b/keyboards/c39/keymaps/default/keymap.c @@ -0,0 +1,45 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _FN1 1 + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,----------------------------------------------------------------------------. ,-------------. + * | Q | W | E | R | T | Bksp | Y | U | I | O | P | | M1 | M2 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | A | S | D | F | G | Enter| H | J | K | L | ; | | M3 | M4 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | Z | X | C | V | B | FN1 | N | M | , | . | / | | M5 | M6 | + * `----------------------------------------------------------------------------' `-------------' + */ +[_QWERTY] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_1, KC_2, + KC_A, KC_S, KC_D, KC_F, KC_G, MT(MOD_LSFT, KC_ENT), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_3, KC_4, + KC_Z, KC_X, KC_C, KC_V, KC_B, LT(_FN1, KC_SPC), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_5, KC_6 +), + +/* FN1 + * ,----------------------------------------------------------------------------. ,-------------. + * | 1 | 2 | 3 | 4 | 5 | Bksp | 6 | 7 | 8 | 9 | 0 | | M1 | M2 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | 4 | 5 | 6 | + | | Enter| | | | | | | M3 | M4 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | 7 | 8 | 9 | 0 | | FN1 | | | | | | | M5 | M6 | + * `----------------------------------------------------------------------------' `-------------' + */ +[_FN1] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_BSPC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_1, KC_2, + KC_4, KC_5, KC_6, KC_PLUS, _______, KC_ENT, _______, _______, _______, _______, _______, KC_3, KC_4, + KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, _______, KC_5, KC_6 +), +}; diff --git a/keyboards/c39/keymaps/default/readme.md b/keyboards/c39/keymaps/default/readme.md new file mode 100755 index 00000000000..f5b1b6ac114 --- /dev/null +++ b/keyboards/c39/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for the C39 diff --git a/keyboards/c39/readme.md b/keyboards/c39/readme.md new file mode 100755 index 00000000000..0454f1c12b0 --- /dev/null +++ b/keyboards/c39/readme.md @@ -0,0 +1,16 @@ +# C39 +======= + +![C39](https://i.imgur.com/KuWIIuW.png) + +A compact 39 key keyboard. + +Keyboard Maintainer: [Maple Computing]() +Hardware Supported: C39 PCB +Hardware Availability: [SpaceCat.design](https://spacecat.design) + +Make example for this keyboard (after setting up your build environment): + + make c39:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/c39/rules.mk b/keyboards/c39/rules.mk new file mode 100755 index 00000000000..8fcb089817c --- /dev/null +++ b/keyboards/c39/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +RGBLIGHT_ENABLE = no # RGB Enable / Disable diff --git a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.c new file mode 100644 index 00000000000..7e9f90853e3 --- /dev/null +++ b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.c @@ -0,0 +1,111 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + + + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.h new file mode 100644 index 00000000000..173f7b60542 --- /dev/null +++ b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.h @@ -0,0 +1,923 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#ifndef BOARD_H +#define BOARD_H + +/* + * Setup for ST STM32F072B-Discovery board. + */ + +/* + * Board identifier. + */ +#define BOARD_ST_STM32F072B_DISCOVERY +#define BOARD_NAME "ST STM32F072B-Discovery" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +#define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F072xB + +/* + * IO pins assignments. + */ +#define GPIOA_BUTTON 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_SPI2_SCK 13U +#define GPIOB_SPI2_MISO 14U +#define GPIOB_SPI2_MOSI 15U + +#define GPIOC_MEMS_CS 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_LED_RED 6U +#define GPIOC_LED_BLUE 7U +#define GPIOC_LED_ORANGE 8U +#define GPIOC_LED_GREEN 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_OSC32_IN 14U +#define GPIOC_OSC32_OUT 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_OSC_IN 0U +#define GPIOF_OSC_OUT 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) +#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) + +#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) +#define LINE_LED_RED PAL_LINE(GPIOC, 6U) +#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) +#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) +#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - BUTTON (input floating). + * PA1 - PIN1 (input pullup). + * PA2 - PIN2 (input pullup). + * PA3 - PIN3 (input pullup). + * PA4 - PIN4 (input pullup). + * PA5 - PIN5 (input pullup). + * PA6 - PIN6 (input pullup). + * PA7 - PIN7 (input pullup). + * PA8 - PIN8 (input pullup). + * PA9 - PIN9 (input pullup). + * PA10 - PIN10 (input pullup). + * PA11 - USB_DM (input floating). + * PA12 - USB_DP (input floating). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - PIN15 (input pullup). + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_USB_DM) | \ + PIN_MODE_INPUT(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (input pullup). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 (input pullup). + * PB7 - PIN7 (input pullup). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - SPI2_SCK (alternate 0). + * PB14 - SPI2_MISO (alternate 0). + * PB15 - SPI2_MOSI (alternate 0). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) + +/* + * GPIOC setup: + * + * PC0 - MEMS_CS (output pushpull maximum). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - LED_RED (output pushpull maximum). + * PC7 - LED_BLUE (output pushpull maximum). + * PC8 - LED_ORANGE (output pushpull maximum). + * PC9 - LED_GREEN (output pushpull maximum). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - OSC32_IN (input floating). + * PC15 - OSC32_OUT (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ + PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ + PIN_MODE_INPUT(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ + PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_LOW(GPIOC_LED_RED) | \ + PIN_ODR_LOW(GPIOC_LED_BLUE) | \ + PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ + PIN_ODR_LOW(GPIOC_LED_GREEN) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ + PIN_ODR_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - OSC_IN (input floating). + * PF1 - OSC_OUT (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ + PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ + PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ + PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ + PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* BOARD_H */ diff --git a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.mk new file mode 100644 index 00000000000..b98dcdd26c6 --- /dev/null +++ b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY diff --git a/keyboards/candybar/bootloader_defs.h b/keyboards/candybar/bootloader_defs.h new file mode 100644 index 00000000000..43eb7b2f628 --- /dev/null +++ b/keyboards/candybar/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/candybar/candybar.c b/keyboards/candybar/candybar.c new file mode 100644 index 00000000000..c79e536ccc3 --- /dev/null +++ b/keyboards/candybar/candybar.c @@ -0,0 +1,21 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "candybar.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} diff --git a/keyboards/candybar/candybar.h b/keyboards/candybar/candybar.h new file mode 100644 index 00000000000..262edf3bbb4 --- /dev/null +++ b/keyboards/candybar/candybar.h @@ -0,0 +1,30 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, k1d, k1e, k1f, k1g, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \ + k30, k31, k32, k35, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, KC_NO, k1c, k1d, k1e, k1f, k1g }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g }, \ + { k30, k31, k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g } \ +} diff --git a/keyboards/candybar/chconf.h b/keyboards/candybar/chconf.h new file mode 100644 index 00000000000..99fa8ce3982 --- /dev/null +++ b/keyboards/candybar/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE FALSE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP FALSE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/candybar/config.h b/keyboards/candybar/config.h new file mode 100644 index 00000000000..c1539671301 --- /dev/null +++ b/keyboards/candybar/config.h @@ -0,0 +1,115 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0006 +#define MANUFACTURER The Key Company +#define PRODUCT Candybar +#define DESCRIPTION A compact staggered 40% keyboard with attached numpad + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 17 +#define DIODE_DIRECTION COL2ROW +#define MATRIX_ROW_PINS { A8, A9, A10, A13 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, B2, B10, B11, B12, B13, B14, B15 } + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +// #define WS2812_LED_N 2 +// #define RGBLED_NUM WS2812_LED_N +// #define WS2812_TIM_N 2 +// #define WS2812_TIM_CH 2 +// #define PORT_WS2812 GPIOA +// #define PIN_WS2812 1 +// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) +//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP +//#define WS2812_EXTERNAL_PULLUP diff --git a/keyboards/candybar/halconf.h b/keyboards/candybar/halconf.h new file mode 100644 index 00000000000..8b9724b1a30 --- /dev/null +++ b/keyboards/candybar/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/candybar/info.json b/keyboards/candybar/info.json new file mode 100644 index 00000000000..442324ece27 --- /dev/null +++ b/keyboards/candybar/info.json @@ -0,0 +1,210 @@ +{ + "keyboard_name": "TKC Candybar", + "url": "", + "maintainer": "terrymathews", + "width": 17, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", + "x":0, + "y":0}, + {"label":"Q", + "x":1, + "y":0}, + {"label":"W", + "x":2, + "y":0}, + {"label":"E", + "x":3, + "y":0}, + {"label":"R", + "x":4, + "y":0}, + {"label":"T", + "x":5, + "y":0}, + {"label":"Y", + "x":6, + "y":0}, + {"label":"U", + "x":7, + "y":0}, + {"label":"I", + "x":8, + "y":0}, + {"label":"O", + "x":9, + "y":0}, + {"label":"P", + "x":10, + "y":0}, + {"label":"Del", + "x":11, + "y":0}, + {"label":"BkSp", + "x":12, + "y":0}, + {"label":"7", + "x":13, + "y":0}, + {"label":"8", + "x":14, + "y":0}, + {"label":"9", + "x":15, + "y":0}, + {"label":"*", + "x":16, + "y":0}, + {"label":"Tab", + "x":0, + "y":1, + "w":1.25}, + {"label":"A", + "x":1.25, + "y":1}, + {"label":"S", + "x":2.25, + "y":1}, + {"label":"D", + "x":3.25, + "y":1}, + {"label":"F", + "x":4.25, + "y":1}, + {"label":"G", + "x":5.25, + "y":1}, + {"label":"H", + "x":6.25, + "y":1}, + {"label":"J", + "x":7.25, + "y":1}, + {"label":"K", + "x":8.25, + "y":1}, + {"label":"L", + "x":9.25, + "y":1}, + {"label":":", + "x":10.25, + "y":1}, + {"label":"Enter", + "x":11.25, + "y":1, + "w":1.75}, + {"label":"4", + "x":13, + "y":1}, + {"label":"5", + "x":14, + "y":1}, + {"label":"6", + "x":15, + "y":1}, + {"label":"-", + "x":16, + "y":1}, + {"label":"Shift", + "x":0, + "y":2, + "w":1.75}, + {"label":"Z", + "x":1.75, + "y":2}, + {"label":"X", + "x":2.75, + "y":2}, + {"label":"C", + "x":3.75, + "y":2}, + {"label":"V", + "x":4.75, + "y":2}, + {"label":"B", + "x":5.75, + "y":2}, + {"label":"N", + "x":6.75, + "y":2}, + {"label":"M", + "x":7.75, + "y":2}, + {"label":"<", + "x":8.75, + "y":2}, + {"label":">", + "x":9.75, + "y":2}, + {"label":"Shift", + "x":10.75, + "y":2, + "w":1.25}, + {"label":"↑", + "x":12, + "y":2}, + {"label":"1", + "x":13, + "y":2}, + {"label":"2", + "x":14, + "y":2}, + {"label":"3", + "x":15, + "y":2}, + {"label":"+", + "x":16, + "y":2}, + {"label":"Ctrl", + "x":0, + "y":3, + "w":1.25}, + {"label":"GUI", + "x":1.25, + "y":3, + "w":1.25}, + {"label":"Alt", + "x":2.5, + "y":3, + "w":1.25}, + {"x":3.75, + "y":3, + "w":1.75}, + {"x":5.5, + "y":3, + "w":1}, + {"label":"Backspace", + "x":6.5, + "y":3, + "w":2.25}, + {"label":"Menu", + "x":8.75, + "y":3, + "w":1.25}, + {"label":"Fn", + "x":10, + "y":3}, + {"label":"←", + "x":11, + "y":3}, + {"label":"↓", + "x":12, + "y":3}, + {"label":"→", + "x":13, + "y":3}, + {"label":"0", + "x":14, + "y":3}, + {"label":".", + "x":15, + "y":3}, + {"label":"Enter", + "x":16, + "y":3}] + } + } +} \ No newline at end of file diff --git a/keyboards/candybar/keymaps/default/keymap.c b/keyboards/candybar/keymaps/default/keymap.c new file mode 100644 index 00000000000..8f4cc08c746 --- /dev/null +++ b/keyboards/candybar/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = LAYOUT( + KC_ESC,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_DEL,KC_BSPC,KC_P7,KC_P8,KC_P9,KC_PAST, \ + KC_TAB,KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_ENT,KC_P4,KC_P5,KC_P6,KC_PMNS, \ + KC_LSFT,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_RSFT,KC_UP,KC_P1,KC_P2,KC_P3,KC_PPLS, \ + KC_LCTL,KC_LGUI,KC_LALT,KC_SPC,KC_SPC,KC_BSPC,KC_APP,MO(_FL),KC_LEFT,KC_DOWN,KC_RGHT,KC_P0,KC_PDOT,KC_PENT), + + /* Keymap _FL: Function Layer + */ +[_FL] = LAYOUT( + RESET,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_LBRC,KC_RBRC,KC_INS,KC_BSPC,KC_P7,KC_P8,KC_P9,KC_VOLU, \ + KC_TAB,KC_A,KC_SLCK,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_QUOT,KC_BSLS,KC_P4,KC_P5,KC_P6,KC_VOLD, \ + KC_LSFT,KC_Z,KC_X,KC_CAPS,KC_V,KC_B,KC_NLCK,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_PGUP,KC_P1,KC_P2,KC_P3,KC_PEQL, \ + KC_LCTL,KC_LGUI,KC_LALT,KC_SPC,KC_SPC,KC_BSPC,KC_APP,MO(_FL),KC_HOME,KC_PGDN,KC_END,KC_P0,KC_PDOT,KC_PENT), +}; diff --git a/keyboards/candybar/mcuconf.h b/keyboards/candybar/mcuconf.h new file mode 100644 index 00000000000..faca3defdf0 --- /dev/null +++ b/keyboards/candybar/mcuconf.h @@ -0,0 +1,171 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/candybar/readme.md b/keyboards/candybar/readme.md new file mode 100644 index 00000000000..6e0fa028571 --- /dev/null +++ b/keyboards/candybar/readme.md @@ -0,0 +1,18 @@ +The Key Company Candybar +=== + +![Candybar](https://cdn.shopify.com/s/files/1/1679/2319/articles/CandyBar_Promo_400x225_1000x.jpg?v=1538150501) + + +The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller. + +Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/) +Hardware Supported: TKC Candybar +Hardware Availability: Via GB + + +Make example for this keyboard (after setting up your build environment): + + make candybar:default:dfu-util + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/candybar/rules.mk b/keyboards/candybar/rules.mk new file mode 100644 index 00000000000..a0365a20b5f --- /dev/null +++ b/keyboards/candybar/rules.mk @@ -0,0 +1,52 @@ +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F072xB + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = ST_STM32F072B_DISCOVERY + +# Cortex version +MCU = cortex-m0 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +# EXTRAFLAGS+=-flto +LINK_TIME_OPTIMIZATION_ENABLE = yes +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no +SERIAL_LINK_ENABLE = no diff --git a/keyboards/cannonkeys/an_c/an_c.c b/keyboards/cannonkeys/an_c/an_c.c new file mode 100644 index 00000000000..9dfb80e9e2c --- /dev/null +++ b/keyboards/cannonkeys/an_c/an_c.c @@ -0,0 +1 @@ +#include "an_c.h" diff --git a/keyboards/cannonkeys/an_c/an_c.h b/keyboards/cannonkeys/an_c/an_c.h new file mode 100644 index 00000000000..6d208501636 --- /dev/null +++ b/keyboards/cannonkeys/an_c/an_c.h @@ -0,0 +1,47 @@ +#pragma once + +#include "quantum.h" + +#define KNO KC_NO + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K41, K42, K45, K49, K4A, K4B, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KNO}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, KNO }, \ + { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, K4A, K4B, KNO, KNO, K4E } \ +} + +#define LAYOUT_60_tsangan_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3E,\ + K40, K41, K42, K45, K49, K4B, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, K3E }, \ + { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, KNO, K4B, KNO, KNO, K4E } \ +} + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3E,\ + K40, K41, K42, K45, K49, K4A, K4B, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, K3E }, \ + { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, K4A, K4B, KNO, KNO, K4E } \ +} diff --git a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.c new file mode 100644 index 00000000000..9d10fbd754d --- /dev/null +++ b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.c @@ -0,0 +1,109 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.h new file mode 100644 index 00000000000..de3a93d1ceb --- /dev/null +++ b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.h @@ -0,0 +1,922 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#ifndef BOARD_H +#define BOARD_H + +/* + * Setup for ST STM32F072B-Discovery board. + */ + +/* + * Board identifier. + */ +#define BOARD_ST_STM32F072B_DISCOVERY +#define BOARD_NAME "ST STM32F072B-Discovery" + +/* + * Board oscillators-related settings. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 32768 +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +#define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F072xB + +/* + * IO pins assignments. + */ +#define GPIOA_BUTTON 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_SPI2_SCK 13U +#define GPIOB_SPI2_MISO 14U +#define GPIOB_SPI2_MOSI 15U + +#define GPIOC_MEMS_CS 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_LED_RED 6U +#define GPIOC_LED_BLUE 7U +#define GPIOC_LED_ORANGE 8U +#define GPIOC_LED_GREEN 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_OSC32_IN 14U +#define GPIOC_OSC32_OUT 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_OSC_IN 0U +#define GPIOF_OSC_OUT 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) +#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) + +#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) +#define LINE_LED_RED PAL_LINE(GPIOC, 6U) +#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) +#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) +#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - BUTTON (input floating). + * PA1 - PIN1 (input pullup). + * PA2 - PIN2 (input pullup). + * PA3 - PIN3 (input pullup). + * PA4 - PIN4 (input pullup). + * PA5 - PIN5 (input pullup). + * PA6 - PIN6 (input pullup). + * PA7 - PIN7 (input pullup). + * PA8 - PIN8 (input pullup). + * PA9 - PIN9 (input pullup). + * PA10 - PIN10 (input pullup). + * PA11 - USB_DM (input floating). + * PA12 - USB_DP (input floating). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - PIN15 (input pullup). + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_USB_DM) | \ + PIN_MODE_INPUT(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (input pullup). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 (input pullup). + * PB7 - PIN7 (input pullup). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - SPI2_SCK (alternate 0). + * PB14 - SPI2_MISO (alternate 0). + * PB15 - SPI2_MOSI (alternate 0). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) + +/* + * GPIOC setup: + * + * PC0 - MEMS_CS (output pushpull maximum). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - LED_RED (output pushpull maximum). + * PC7 - LED_BLUE (output pushpull maximum). + * PC8 - LED_ORANGE (output pushpull maximum). + * PC9 - LED_GREEN (output pushpull maximum). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - OSC32_IN (input floating). + * PC15 - OSC32_OUT (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ + PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ + PIN_MODE_INPUT(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ + PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_LOW(GPIOC_LED_RED) | \ + PIN_ODR_LOW(GPIOC_LED_BLUE) | \ + PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ + PIN_ODR_LOW(GPIOC_LED_GREEN) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ + PIN_ODR_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - OSC_IN (input floating). + * PF1 - OSC_OUT (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ + PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ + PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ + PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ + PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* BOARD_H */ diff --git a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.mk new file mode 100644 index 00000000000..b98dcdd26c6 --- /dev/null +++ b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY diff --git a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg new file mode 100644 index 00000000000..9c7cf4fd76a --- /dev/null +++ b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg @@ -0,0 +1,703 @@ + + + + + resources/gencfg/processors/boards/stm32f0xx/templates + .. + 3.0.x + + ST STM32F072B-Discovery + ST_STM32F072B_DISCOVERY + + STM32F072xB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/keyboards/cannonkeys/an_c/bootloader_defs.h b/keyboards/cannonkeys/an_c/bootloader_defs.h new file mode 100644 index 00000000000..02c48c4e6dc --- /dev/null +++ b/keyboards/cannonkeys/an_c/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/cannonkeys/an_c/chconf.h b/keyboards/cannonkeys/an_c/chconf.h new file mode 100644 index 00000000000..99fa8ce3982 --- /dev/null +++ b/keyboards/cannonkeys/an_c/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE FALSE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP FALSE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/an_c/config.h b/keyboards/cannonkeys/an_c/config.h new file mode 100644 index 00000000000..f8ded7c1f19 --- /dev/null +++ b/keyboards/cannonkeys/an_c/config.h @@ -0,0 +1,98 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCA04 +#define PRODUCT_ID 0xA00C +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER CannonKeys +#define PRODUCT AN-C +#define DESCRIPTION AN-C Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define MATRIX_COL_PINS { B11, B10, B2, A9, A15, B3, B4, B5, B6, B7, B8, B9, C13, C14, C15 } +#define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 14 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +// EEPROM usage +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x02 +#define EEPROM_VERSION_ADDR 34 + + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +// Dynamic macro starts after dynamic keymaps (35+(4*5*15*2)) = (35+600) = 635 +// start + layer * rows * col * 2 +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +#define EEPROM_CUSTOM_BACKLIGHT 636 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 637 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 200 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/cannonkeys/an_c/halconf.h b/keyboards/cannonkeys/an_c/halconf.h new file mode 100644 index 00000000000..38743e0904f --- /dev/null +++ b/keyboards/cannonkeys/an_c/halconf.h @@ -0,0 +1,354 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/an_c/info.json b/keyboards/cannonkeys/an_c/info.json new file mode 100644 index 00000000000..712ce269e19 --- /dev/null +++ b/keyboards/cannonkeys/an_c/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "AN-C", + "url": "https://cannonkeys.com", + "maintainer": "awkannan", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_tsangan_hhkb": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + } + } +} diff --git a/keyboards/cannonkeys/an_c/keymaps/default/keymap.c b/keyboards/cannonkeys/an_c/keymaps/default/keymap.c new file mode 100644 index 00000000000..d6d69ee8f7e --- /dev/null +++ b/keyboards/cannonkeys/an_c/keymaps/default/keymap.c @@ -0,0 +1,43 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL + ), + + [_FN1] = LAYOUT_60_ansi( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_GRV, _______, _______, _______, _______, _______, _______, RESET + ) +}; diff --git a/keyboards/cannonkeys/an_c/keymaps/tsangan/keymap.c b/keyboards/cannonkeys/an_c/keymaps/tsangan/keymap.c new file mode 100644 index 00000000000..857415ad9fd --- /dev/null +++ b/keyboards/cannonkeys/an_c/keymaps/tsangan/keymap.c @@ -0,0 +1,44 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_tsangan_hhkb( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + + [_FN1] = LAYOUT_60_tsangan_hhkb( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RESET + ) +}; diff --git a/keyboards/cannonkeys/an_c/keymaps/via/keymap.c b/keyboards/cannonkeys/an_c/keymaps/via/keymap.c new file mode 100644 index 00000000000..b182ac5f4f0 --- /dev/null +++ b/keyboards/cannonkeys/an_c/keymaps/via/keymap.c @@ -0,0 +1,43 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_all( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL + ), + + [_FN1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, RESET + ) +}; diff --git a/keyboards/cannonkeys/an_c/keymaps/via/rules.mk b/keyboards/cannonkeys/an_c/keymaps/via/rules.mk new file mode 100644 index 00000000000..d12497792d5 --- /dev/null +++ b/keyboards/cannonkeys/an_c/keymaps/via/rules.mk @@ -0,0 +1,5 @@ +# rules.mk overrides to enable VIA + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes + diff --git a/keyboards/cannonkeys/an_c/mcuconf.h b/keyboards/cannonkeys/an_c/mcuconf.h new file mode 100644 index 00000000000..048eb4df650 --- /dev/null +++ b/keyboards/cannonkeys/an_c/mcuconf.h @@ -0,0 +1,176 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF +// #define STM32F070xB + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/an_c/readme.md b/keyboards/cannonkeys/an_c/readme.md new file mode 100644 index 00000000000..7d631a0a520 --- /dev/null +++ b/keyboards/cannonkeys/an_c/readme.md @@ -0,0 +1,12 @@ +# AN-C + +AN-C Keyboard + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan) +Hardware Supported: STM32F072CBT6 + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/an_c:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cannonkeys/an_c/rules.mk b/keyboards/cannonkeys/an_c/rules.mk new file mode 100644 index 00000000000..2f30956e7d5 --- /dev/null +++ b/keyboards/cannonkeys/an_c/rules.mk @@ -0,0 +1,59 @@ +# project specific files +# SRC = ssd1306.c +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F072xB +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx +# it should exist either in /os/hal/boards/ +# or /boards +BOARD = ST_STM32F072B_DISCOVERY +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m0 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# + +# project specific files +VPATH += keyboards/cannonkeys/stm32f072 +SRC = keyboard.c \ + led.c + +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file +# BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason +RGBLIGHT_ENABLE = yes + +# RAW_ENABLE = yes +# DYNAMIC_KEYMAP_ENABLE = yes + +LAYOUTS = 60_ansi 60_tsangan_hhkb diff --git a/keyboards/cannonkeys/bluepill/keyboard.c b/keyboards/cannonkeys/bluepill/keyboard.c new file mode 100644 index 00000000000..865628eccde --- /dev/null +++ b/keyboards/cannonkeys/bluepill/keyboard.c @@ -0,0 +1,30 @@ +#include "ch.h" +#include "hal.h" +#include "led_custom.h" +#include "util.h" +#include "quantum.h" + +#ifdef BOARD_GENERIC_STM32_F103 +#define LED_ON() do { palClearPad(GPIOC, 13) ;} while (0) +#define LED_OFF() do { palSetPad(GPIOC, 13); } while (0) +#define LED_TGL() do { palTogglePad(GPIOC, 13); } while (0) +#endif + +void matrix_init_kb(void){ + /* MOSI pin*/ + palSetPadMode(GPIOB, 15, PAL_MODE_STM32_ALTERNATE_PUSHPULL); + LED_ON(); + wait_ms(500); + LED_OFF(); + +#ifdef RGBLIGHT_ENABLE + leds_init(); +#endif +} + +void matrix_scan_kb(void) +{ + #ifdef RGBLIGHT_ENABLE + rgblight_task(); + #endif +} diff --git a/keyboards/cannonkeys/bluepill/led.c b/keyboards/cannonkeys/bluepill/led.c new file mode 100644 index 00000000000..a9ede5bbaa8 --- /dev/null +++ b/keyboards/cannonkeys/bluepill/led.c @@ -0,0 +1,257 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "hal.h" +#include "backlight.h" +#include "led.h" +#include "led_custom.h" +#include "printf.h" + +static void breathing_callback(PWMDriver *pwmp); + +static PWMConfig pwmCFG = { + 0xFFFF, /* PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + NULL, /* No Callback */ + { + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +static PWMConfig pwmCFG_breathing = { + 0xFFFF, /* 10kHz PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + breathing_callback, /* Breathing Callback */ + { + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + + +void backlight_init_ports(void) { + printf("backlight_init_ports()\n"); + #ifdef BACKLIGHT_ENABLE + + palSetPadMode(GPIOA, 8, PAL_MODE_STM32_ALTERNATE_PUSHPULL); + pwmStart(&PWMD1, &pwmCFG); + pwmEnableChannel(&PWMD1, 0, PWM_FRACTION_TO_WIDTH(&PWMD1, 0xFFFF,cie_lightness(0xFFFF))); + #endif +} + +void backlight_set(uint8_t level) { + printf("backlight_set(%d)\n", level); + #ifdef BACKLIGHT_ENABLE + uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / BACKLIGHT_LEVELS)); + printf("duty: (%d)\n", duty); + if (level == 0) { + // Turn backlight off + pwmDisableChannel(&PWMD1, 0); + } else { + // Turn backlight on + if(!is_breathing()){ + pwmEnableChannel(&PWMD1, 0, PWM_FRACTION_TO_WIDTH(&PWMD1,0xFFFF,duty)); + } + } + #endif +} + + +uint8_t backlight_tick = 0; + +void backlight_task(void) { +} + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +bool is_breathing(void) { + return PWMD1.config == &pwmCFG_breathing; +} + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0) + + +void breathing_interrupt_enable(void){ + pwmStop(&PWMD1); + printf("starting with callback\n"); + pwmStart(&PWMD1, &pwmCFG_breathing); + chSysLockFromISR(); + pwmEnablePeriodicNotification(&PWMD1); + pwmEnableChannelI( + &PWMD1, + 0, + PWM_FRACTION_TO_WIDTH( + &PWMD1, + 0xFFFF, + 0xFFFF + ) + ); + chSysUnlockFromISR(); +} + +void breathing_interrupt_disable(void){ + pwmStop(&PWMD1); + printf("starting without callback\n"); + pwmStart(&PWMD1, &pwmCFG); +} + +void breathing_enable(void) +{ + printf("breathing_enable()\n"); + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + breathing_interrupt_enable(); +} + +void breathing_pulse(void) +{ + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + breathing_interrupt_enable(); +} + +void breathing_disable(void) +{ + printf("breathing_disable()\n"); + breathing_interrupt_disable(); + // Restore backlight level + backlight_set(get_backlight_level()); +} + +void breathing_self_disable(void) +{ + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()){ + printf("disable breathing\n"); + breathing_disable(); + } else { + printf("enable breathing\n"); + breathing_enable(); + } +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +static void breathing_callback(PWMDriver *pwmp) +{ + (void)pwmp; + uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 256); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + breathing_interrupt_disable(); + } + + uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256)); + + chSysLockFromISR(); + pwmEnableChannelI( + &PWMD1, + 0, + PWM_FRACTION_TO_WIDTH( + &PWMD1, + 0xFFFF, + duty + ) + ); + chSysUnlockFromISR(); +} + + +void led_set(uint8_t usb_led) +{ + if (usb_led & (1< 1tick is 0.32us (2.25 MHz) +}; + + /* + * Function used to initialize the driver. + * + * Starts by shutting off all the LEDs. + * Then gets access on the LED_SPI driver. + * May eventually launch an animation on the LEDs (e.g. a thread setting the + * txbuff values) + */ +void leds_init(void){ + /* MOSI pin*/ + palSetPadMode(PORT_WS2812, PIN_WS2812, PAL_MODE_STM32_ALTERNATE_PUSHPULL); + for(int i = 0; i < RESET_SIZE; i++) + txbuf[DATA_SIZE+i] = 0x00; + for (int i=0; i + + + + resources/gencfg/processors/boards/stm32f0xx/templates + .. + 3.0.x + + ST STM32F072B-Discovery + ST_STM32F072B_DISCOVERY + + STM32F072xB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/keyboards/cannonkeys/instant60/bootloader_defs.h b/keyboards/cannonkeys/instant60/bootloader_defs.h new file mode 100644 index 00000000000..02c48c4e6dc --- /dev/null +++ b/keyboards/cannonkeys/instant60/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/cannonkeys/instant60/chconf.h b/keyboards/cannonkeys/instant60/chconf.h new file mode 100644 index 00000000000..99fa8ce3982 --- /dev/null +++ b/keyboards/cannonkeys/instant60/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE FALSE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP FALSE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/instant60/config.h b/keyboards/cannonkeys/instant60/config.h new file mode 100644 index 00000000000..095384fb9eb --- /dev/null +++ b/keyboards/cannonkeys/instant60/config.h @@ -0,0 +1,98 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCA04 +#define PRODUCT_ID 0x1600 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER CannonKeys +#define PRODUCT Instant60 +#define DESCRIPTION Instant 60 Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define MATRIX_COL_PINS { B2, B10, B11, A9, A15, B3, B4, B5, B6, B7, B8, B9, C13, C14, C15 } +#define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 14 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +// EEPROM usage +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x02 +#define EEPROM_VERSION_ADDR 34 + + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +// Dynamic macro starts after dynamic keymaps (35+(4*5*15*2)) = (35+600) = 635 +// start + layer * rows * col * 2 +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +#define EEPROM_CUSTOM_BACKLIGHT 636 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 637 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 200 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/cannonkeys/instant60/halconf.h b/keyboards/cannonkeys/instant60/halconf.h new file mode 100644 index 00000000000..38743e0904f --- /dev/null +++ b/keyboards/cannonkeys/instant60/halconf.h @@ -0,0 +1,354 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/instant60/info.json b/keyboards/cannonkeys/instant60/info.json new file mode 100644 index 00000000000..6d410968a06 --- /dev/null +++ b/keyboards/cannonkeys/instant60/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "Instant60", + "url": "https://cannonkeys.com", + "maintainer": "awkannan", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_tsangan_hhkb": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + } + } +} diff --git a/keyboards/cannonkeys/instant60/instant60.c b/keyboards/cannonkeys/instant60/instant60.c new file mode 100644 index 00000000000..25b7099b0b1 --- /dev/null +++ b/keyboards/cannonkeys/instant60/instant60.c @@ -0,0 +1 @@ +#include "instant60.h" diff --git a/keyboards/cannonkeys/instant60/instant60.h b/keyboards/cannonkeys/instant60/instant60.h new file mode 100644 index 00000000000..6d208501636 --- /dev/null +++ b/keyboards/cannonkeys/instant60/instant60.h @@ -0,0 +1,47 @@ +#pragma once + +#include "quantum.h" + +#define KNO KC_NO + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K41, K42, K45, K49, K4A, K4B, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KNO}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, KNO }, \ + { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, K4A, K4B, KNO, KNO, K4E } \ +} + +#define LAYOUT_60_tsangan_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3E,\ + K40, K41, K42, K45, K49, K4B, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, K3E }, \ + { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, KNO, K4B, KNO, KNO, K4E } \ +} + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3E,\ + K40, K41, K42, K45, K49, K4A, K4B, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KNO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KNO, KNO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KNO, KNO, K3E }, \ + { K40, K41, K42, KNO, KNO, K45, KNO, KNO, KNO, K49, K4A, K4B, KNO, KNO, K4E } \ +} diff --git a/keyboards/cannonkeys/instant60/keymaps/default/keymap.c b/keyboards/cannonkeys/instant60/keymaps/default/keymap.c new file mode 100644 index 00000000000..303f307301f --- /dev/null +++ b/keyboards/cannonkeys/instant60/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL + ), + + [_FN1] = LAYOUT_60_ansi( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, _______, _______, _______, _______, _______, _______, RESET + ) +}; diff --git a/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c b/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c new file mode 100644 index 00000000000..d75d9f288ad --- /dev/null +++ b/keyboards/cannonkeys/instant60/keymaps/tsangan/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_tsangan_hhkb( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN1),\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + + [_FN1] = LAYOUT_60_tsangan_hhkb( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______,\ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, RESET + ) +}; diff --git a/keyboards/cannonkeys/instant60/keymaps/via/keymap.c b/keyboards/cannonkeys/instant60/keymaps/via/keymap.c new file mode 100644 index 00000000000..9be7d187e45 --- /dev/null +++ b/keyboards/cannonkeys/instant60/keymaps/via/keymap.c @@ -0,0 +1,43 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_all( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL + ), + + [_FN1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, RESET + ) +}; diff --git a/keyboards/cannonkeys/instant60/keymaps/via/rules.mk b/keyboards/cannonkeys/instant60/keymaps/via/rules.mk new file mode 100644 index 00000000000..d12497792d5 --- /dev/null +++ b/keyboards/cannonkeys/instant60/keymaps/via/rules.mk @@ -0,0 +1,5 @@ +# rules.mk overrides to enable VIA + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes + diff --git a/keyboards/cannonkeys/instant60/keymaps/via_standard/keymap.c b/keyboards/cannonkeys/instant60/keymaps/via_standard/keymap.c new file mode 100644 index 00000000000..b182ac5f4f0 --- /dev/null +++ b/keyboards/cannonkeys/instant60/keymaps/via_standard/keymap.c @@ -0,0 +1,43 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_all( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL + ), + + [_FN1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, RESET + ) +}; diff --git a/keyboards/cannonkeys/instant60/keymaps/via_standard/rules.mk b/keyboards/cannonkeys/instant60/keymaps/via_standard/rules.mk new file mode 100644 index 00000000000..d12497792d5 --- /dev/null +++ b/keyboards/cannonkeys/instant60/keymaps/via_standard/rules.mk @@ -0,0 +1,5 @@ +# rules.mk overrides to enable VIA + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes + diff --git a/keyboards/cannonkeys/instant60/mcuconf.h b/keyboards/cannonkeys/instant60/mcuconf.h new file mode 100644 index 00000000000..048eb4df650 --- /dev/null +++ b/keyboards/cannonkeys/instant60/mcuconf.h @@ -0,0 +1,176 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF +// #define STM32F070xB + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/instant60/readme.md b/keyboards/cannonkeys/instant60/readme.md new file mode 100644 index 00000000000..bee5f72ebf9 --- /dev/null +++ b/keyboards/cannonkeys/instant60/readme.md @@ -0,0 +1,14 @@ +# Instant60 + +Instant60 Keyboard + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan) +Hardware Supported: STM32F072CBT6 + +[PCB Support Docs](https://docs.cannonkeys.com/instant60/) + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/instant60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cannonkeys/instant60/rules.mk b/keyboards/cannonkeys/instant60/rules.mk new file mode 100644 index 00000000000..5d4fb1cf724 --- /dev/null +++ b/keyboards/cannonkeys/instant60/rules.mk @@ -0,0 +1,57 @@ +# project specific files +# SRC = ssd1306.c +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F072xB +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx +# it should exist either in /os/hal/boards/ +# or /boards +BOARD = ST_STM32F072B_DISCOVERY +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m0 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# + +# project specific files +VPATH += keyboards/cannonkeys/stm32f072 +SRC = keyboard.c \ + led.c + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file +# BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason +RGBLIGHT_ENABLE = yes + +# RAW_ENABLE = yes +# DYNAMIC_KEYMAP_ENABLE = yes + +LAYOUTS = 60_ansi 60_tsangan_hhkb diff --git a/keyboards/cannonkeys/ortho48/boards/GENERIC_STM32_F103/board.c b/keyboards/cannonkeys/ortho48/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 00000000000..8c5a87f35f8 --- /dev/null +++ b/keyboards/cannonkeys/ortho48/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/cannonkeys/ortho48/boards/GENERIC_STM32_F103/board.h b/keyboards/cannonkeys/ortho48/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 00000000000..9427adabf11 --- /dev/null +++ b/keyboards/cannonkeys/ortho48/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/cannonkeys/ortho48/boards/GENERIC_STM32_F103/board.mk b/keyboards/cannonkeys/ortho48/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 00000000000..6b8b312fd9f --- /dev/null +++ b/keyboards/cannonkeys/ortho48/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/cannonkeys/ortho48/bootloader_defs.h b/keyboards/cannonkeys/ortho48/bootloader_defs.h new file mode 100644 index 00000000000..6b8fa9f727c --- /dev/null +++ b/keyboards/cannonkeys/ortho48/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +#define STM32_BOOTLOADER_ADDRESS 0x80000000 diff --git a/keyboards/cannonkeys/ortho48/chconf.h b/keyboards/cannonkeys/ortho48/chconf.h new file mode 100644 index 00000000000..bbd9b2da62d --- /dev/null +++ b/keyboards/cannonkeys/ortho48/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/ortho48/config.h b/keyboards/cannonkeys/ortho48/config.h new file mode 100644 index 00000000000..497e08bcf5e --- /dev/null +++ b/keyboards/cannonkeys/ortho48/config.h @@ -0,0 +1,80 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCA04 +#define PRODUCT_ID 0x0248 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER QMK +#define PRODUCT Ortho48 +#define DESCRIPTION Ortho48 + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +#define MATRIX_COL_PINS { B11, B10, B1, B0, A7, A6, A5, B14, A15, A0, C15, C14} +#define MATRIX_ROW_PINS { B12, C13, A2, A1 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 9 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/cannonkeys/ortho48/halconf.h b/keyboards/cannonkeys/ortho48/halconf.h new file mode 100644 index 00000000000..72879a575b9 --- /dev/null +++ b/keyboards/cannonkeys/ortho48/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/ortho48/info.json b/keyboards/cannonkeys/ortho48/info.json new file mode 100644 index 00000000000..0e834245a11 --- /dev/null +++ b/keyboards/cannonkeys/ortho48/info.json @@ -0,0 +1,112 @@ +{ + "keyboard_name": "Ortho48", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x12": { + "layout": [ + {"label":"Tab", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"Delete", "x":11, "y":0}, + {"label":"Esc", "x":0, "y":1}, + {"label":"A", "x":1, "y":1}, + {"label":"S", "x":2, "y":1}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1}, + {"label":"G", "x":5, "y":1}, + {"label":"H", "x":6, "y":1}, + {"label":"J", "x":7, "y":1}, + {"label":"K", "x":8, "y":1}, + {"label":"L", "x":9, "y":1}, + {"label":";", "x":10, "y":1}, + {"label":"'", "x":11, "y":1}, + {"label":"Shift", "x":0, "y":2}, + {"label":"Z", "x":1, "y":2}, + {"label":"X", "x":2, "y":2}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2}, + {"label":"B", "x":5, "y":2}, + {"label":"N", "x":6, "y":2}, + {"label":"M", "x":7, "y":2}, + {"label":",", "x":8, "y":2}, + {"label":".", "x":9, "y":2}, + {"label":"/", "x":10, "y":2}, + {"label":"Enter", "x":11, "y":2}, + {"label":"Fn", "x":0, "y":3}, + {"label":"Ctrl", "x":1, "y":3}, + {"label":"Alt", "x":2, "y":3}, + {"label":"Meta", "x":3, "y":3}, + {"label":"Lower", "x":4, "y":3}, + {"label":"Space", "x":5, "y":3}, + {"label":"Space", "x":6, "y":3}, + {"label":"Raise", "x":7, "y":3}, + {"label":"Left", "x":8, "y":3}, + {"label":"Down", "x":9, "y":3}, + {"label":"Up", "x":10, "y":3}, + {"label":"Right", "x":11, "y":3} + ] + }, + "LAYOUT_1x2uC": { + "layout": [ + {"label":"Tab", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"Delete", "x":11, "y":0}, + {"label":"Esc", "x":0, "y":1}, + {"label":"A", "x":1, "y":1}, + {"label":"S", "x":2, "y":1}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1}, + {"label":"G", "x":5, "y":1}, + {"label":"H", "x":6, "y":1}, + {"label":"J", "x":7, "y":1}, + {"label":"K", "x":8, "y":1}, + {"label":"L", "x":9, "y":1}, + {"label":";", "x":10, "y":1}, + {"label":"'", "x":11, "y":1}, + {"label":"Shift", "x":0, "y":2}, + {"label":"Z", "x":1, "y":2}, + {"label":"X", "x":2, "y":2}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2}, + {"label":"B", "x":5, "y":2}, + {"label":"N", "x":6, "y":2}, + {"label":"M", "x":7, "y":2}, + {"label":",", "x":8, "y":2}, + {"label":".", "x":9, "y":2}, + {"label":"/", "x":10, "y":2}, + {"label":"Enter", "x":11, "y":2}, + {"label":"Fn", "x":0, "y":3}, + {"label":"Ctrl", "x":1, "y":3}, + {"label":"Alt", "x":2, "y":3}, + {"label":"Meta", "x":3, "y":3}, + {"label":"Lower", "x":4, "y":3}, + {"label":"Space", "x":5, "y":3, "w":2}, + {"label":"Raise", "x":7, "y":3}, + {"label":"Left", "x":8, "y":3}, + {"label":"Down", "x":9, "y":3}, + {"label":"Up", "x":10, "y":3}, + {"label":"Right", "x":11, "y":3} + ] + } + } +} diff --git a/keyboards/cannonkeys/ortho48/keymaps/default/keymap.c b/keyboards/cannonkeys/ortho48/keymaps/default/keymap.c new file mode 100644 index 00000000000..2c3bc80c5d4 --- /dev/null +++ b/keyboards/cannonkeys/ortho48/keymaps/default/keymap.c @@ -0,0 +1,89 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _RAISE 1 +#define _LOWER 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_BASE] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BL_TOGG, KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + RGB_TOG, RGB_MOD, BL_INC, BL_DEC, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), +}; diff --git a/keyboards/cannonkeys/ortho48/ld/MKL26Z64.ld b/keyboards/cannonkeys/ortho48/ld/MKL26Z64.ld new file mode 100644 index 00000000000..c4ca8b874cc --- /dev/null +++ b/keyboards/cannonkeys/ortho48/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/ortho48/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/cannonkeys/ortho48/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 00000000000..d0688ef6016 --- /dev/null +++ b/keyboards/cannonkeys/ortho48/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/ortho48/mcuconf.h b/keyboards/cannonkeys/ortho48/mcuconf.h new file mode 100644 index 00000000000..fced27289e0 --- /dev/null +++ b/keyboards/cannonkeys/ortho48/mcuconf.h @@ -0,0 +1,209 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define STM32F103_MCUCONF + +/* + * STM32F103 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_RTCSEL STM32_RTCSEL_HSEDIV +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 6 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * RTC driver system settings. + */ +#define STM32_RTC_IRQ_PRIORITY 15 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/ortho48/ortho48.c b/keyboards/cannonkeys/ortho48/ortho48.c new file mode 100644 index 00000000000..fe38f020071 --- /dev/null +++ b/keyboards/cannonkeys/ortho48/ortho48.c @@ -0,0 +1,3 @@ + +#include "ortho48.h" + diff --git a/keyboards/cannonkeys/ortho48/ortho48.h b/keyboards/cannonkeys/ortho48/ortho48.h new file mode 100644 index 00000000000..1e51c37af7e --- /dev/null +++ b/keyboards/cannonkeys/ortho48/ortho48.h @@ -0,0 +1,29 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35 , k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} diff --git a/keyboards/cannonkeys/ortho48/readme.md b/keyboards/cannonkeys/ortho48/readme.md new file mode 100644 index 00000000000..ba5516a3413 --- /dev/null +++ b/keyboards/cannonkeys/ortho48/readme.md @@ -0,0 +1,12 @@ +# Ortho 48 + +A Blue Pill STM32F103C8T6-based 12x4 ortholinear keyboard. + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1) +Hardware Supported: Blue Pill STM32F103C8T6 + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/ortho48:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cannonkeys/ortho48/rules.mk b/keyboards/cannonkeys/ortho48/rules.mk new file mode 100644 index 00000000000..2e483a8c2cc --- /dev/null +++ b/keyboards/cannonkeys/ortho48/rules.mk @@ -0,0 +1,55 @@ +# project specific files +VPATH += keyboards/cannonkeys/bluepill +SRC = led.c \ + keyboard.c + +# GENERIC STM32F103C8T6 board - stm32duino bootloader +OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 +MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader +BOARD = GENERIC_STM32_F103 + +# OPT_DEFS = +# MCU_LDSCRIPT = STM32F103x8 +# BOARD = GENERIC_STM32_F103 + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes + +LAYOUTS = ortho_4x12 diff --git a/keyboards/cannonkeys/ortho60/boards/GENERIC_STM32_F103/board.c b/keyboards/cannonkeys/ortho60/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 00000000000..8c5a87f35f8 --- /dev/null +++ b/keyboards/cannonkeys/ortho60/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/cannonkeys/ortho60/boards/GENERIC_STM32_F103/board.h b/keyboards/cannonkeys/ortho60/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 00000000000..9427adabf11 --- /dev/null +++ b/keyboards/cannonkeys/ortho60/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/cannonkeys/ortho60/boards/GENERIC_STM32_F103/board.mk b/keyboards/cannonkeys/ortho60/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 00000000000..6b8b312fd9f --- /dev/null +++ b/keyboards/cannonkeys/ortho60/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/cannonkeys/ortho60/bootloader_defs.h b/keyboards/cannonkeys/ortho60/bootloader_defs.h new file mode 100644 index 00000000000..6b8fa9f727c --- /dev/null +++ b/keyboards/cannonkeys/ortho60/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +#define STM32_BOOTLOADER_ADDRESS 0x80000000 diff --git a/keyboards/cannonkeys/ortho60/chconf.h b/keyboards/cannonkeys/ortho60/chconf.h new file mode 100644 index 00000000000..bbd9b2da62d --- /dev/null +++ b/keyboards/cannonkeys/ortho60/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/ortho60/config.h b/keyboards/cannonkeys/ortho60/config.h new file mode 100644 index 00000000000..9b85952d789 --- /dev/null +++ b/keyboards/cannonkeys/ortho60/config.h @@ -0,0 +1,78 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER QMK +#define PRODUCT Ortho60 +#define DESCRIPTION Ortho60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +#define MATRIX_COL_PINS { B11, B10, B1, B0, A7, A6, A5, A4, A3, A2, A1, A0 } +#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 16 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/cannonkeys/ortho60/halconf.h b/keyboards/cannonkeys/ortho60/halconf.h new file mode 100644 index 00000000000..72879a575b9 --- /dev/null +++ b/keyboards/cannonkeys/ortho60/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/ortho60/info.json b/keyboards/cannonkeys/ortho60/info.json new file mode 100644 index 00000000000..b94bfc7b538 --- /dev/null +++ b/keyboards/cannonkeys/ortho60/info.json @@ -0,0 +1,136 @@ +{ + "keyboard_name": "Ortho60", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x12": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"Backspace", "x":11, "y":0}, + {"label":"Tab", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"Delete", "x":11, "y":1}, + {"label":"Esc", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":"'", "x":11, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Enter", "x":11, "y":3}, + {"label":"Fn", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"Meta", "x":3, "y":4}, + {"label":"Lower", "x":4, "y":4}, + {"label":"Space", "x":5, "y":4}, + {"label":"Space", "x":6, "y":4}, + {"label":"Raise", "x":7, "y":4}, + {"label":"Left", "x":8, "y":4}, + {"label":"Down", "x":9, "y":4}, + {"label":"Up", "x":10, "y":4}, + {"label":"Right", "x":11, "y":4} + ] + }, + "LAYOUT_1x2uC": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"Backspace", "x":11, "y":0}, + {"label":"Tab", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"Delete", "x":11, "y":1}, + {"label":"Esc", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":"'", "x":11, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Enter", "x":11, "y":3}, + {"label":"Fn", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"Meta", "x":3, "y":4}, + {"label":"Lower", "x":4, "y":4}, + {"label":"Space", "x":5, "y":4, "w":2}, + {"label":"Raise", "x":7, "y":4}, + {"label":"Left", "x":8, "y":4}, + {"label":"Down", "x":9, "y":4}, + {"label":"Up", "x":10, "y":4}, + {"label":"Right", "x":11, "y":4} + ] + } + } +} diff --git a/keyboards/cannonkeys/ortho60/keymaps/default/keymap.c b/keyboards/cannonkeys/ortho60/keymaps/default/keymap.c new file mode 100644 index 00000000000..56caa4dc84f --- /dev/null +++ b/keyboards/cannonkeys/ortho60/keymaps/default/keymap.c @@ -0,0 +1,98 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _RAISE 1 +#define _LOWER 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_BASE] = LAYOUT_ortho_5x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + BL_TOGG, KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_5x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \ + RESET, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_5x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ + RGB_TOG, RGB_MOD, BL_INC, BL_DEC, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +) +}; diff --git a/keyboards/cannonkeys/ortho60/ld/MKL26Z64.ld b/keyboards/cannonkeys/ortho60/ld/MKL26Z64.ld new file mode 100644 index 00000000000..c4ca8b874cc --- /dev/null +++ b/keyboards/cannonkeys/ortho60/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/ortho60/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/cannonkeys/ortho60/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 00000000000..d0688ef6016 --- /dev/null +++ b/keyboards/cannonkeys/ortho60/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/ortho60/mcuconf.h b/keyboards/cannonkeys/ortho60/mcuconf.h new file mode 100644 index 00000000000..fced27289e0 --- /dev/null +++ b/keyboards/cannonkeys/ortho60/mcuconf.h @@ -0,0 +1,209 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define STM32F103_MCUCONF + +/* + * STM32F103 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_RTCSEL STM32_RTCSEL_HSEDIV +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 6 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * RTC driver system settings. + */ +#define STM32_RTC_IRQ_PRIORITY 15 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/ortho60/ortho60.c b/keyboards/cannonkeys/ortho60/ortho60.c new file mode 100644 index 00000000000..f917ef96f94 --- /dev/null +++ b/keyboards/cannonkeys/ortho60/ortho60.c @@ -0,0 +1,3 @@ + +#include "ortho60.h" + diff --git a/keyboards/cannonkeys/ortho60/ortho60.h b/keyboards/cannonkeys/ortho60/ortho60.h new file mode 100644 index 00000000000..0f3ae127aad --- /dev/null +++ b/keyboards/cannonkeys/ortho60/ortho60.h @@ -0,0 +1,33 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45 , k47, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4a, k4b }, \ +} + +#define LAYOUT_ortho_5x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b }, \ +} diff --git a/keyboards/cannonkeys/ortho60/readme.md b/keyboards/cannonkeys/ortho60/readme.md new file mode 100644 index 00000000000..c3fdbccc5d3 --- /dev/null +++ b/keyboards/cannonkeys/ortho60/readme.md @@ -0,0 +1,12 @@ +# Ortho 60 + +A Blue Pill STM32F103C8T6-based 12x5 ortholinear keyboard. + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1) +Hardware Supported: Blue Pill STM32F103C8T6 + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/ortho60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cannonkeys/ortho60/rules.mk b/keyboards/cannonkeys/ortho60/rules.mk new file mode 100644 index 00000000000..359f447a9cf --- /dev/null +++ b/keyboards/cannonkeys/ortho60/rules.mk @@ -0,0 +1,55 @@ +# project specific files +VPATH += keyboards/cannonkeys/bluepill +SRC = led.c \ + keyboard.c + +# GENERIC STM32F103C8T6 board - stm32duino bootloader +OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 +MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader +BOARD = GENERIC_STM32_F103 + +# OPT_DEFS = +# MCU_LDSCRIPT = STM32F103x8 +# BOARD = GENERIC_STM32_F103 + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes + +LAYOUTS = ortho_5x12 diff --git a/keyboards/cannonkeys/ortho75/boards/GENERIC_STM32_F103/board.c b/keyboards/cannonkeys/ortho75/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 00000000000..8c5a87f35f8 --- /dev/null +++ b/keyboards/cannonkeys/ortho75/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/cannonkeys/ortho75/boards/GENERIC_STM32_F103/board.h b/keyboards/cannonkeys/ortho75/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 00000000000..9427adabf11 --- /dev/null +++ b/keyboards/cannonkeys/ortho75/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/cannonkeys/ortho75/boards/GENERIC_STM32_F103/board.mk b/keyboards/cannonkeys/ortho75/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 00000000000..6b8b312fd9f --- /dev/null +++ b/keyboards/cannonkeys/ortho75/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/cannonkeys/ortho75/bootloader_defs.h b/keyboards/cannonkeys/ortho75/bootloader_defs.h new file mode 100644 index 00000000000..6b8fa9f727c --- /dev/null +++ b/keyboards/cannonkeys/ortho75/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +#define STM32_BOOTLOADER_ADDRESS 0x80000000 diff --git a/keyboards/cannonkeys/ortho75/chconf.h b/keyboards/cannonkeys/ortho75/chconf.h new file mode 100644 index 00000000000..bbd9b2da62d --- /dev/null +++ b/keyboards/cannonkeys/ortho75/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/ortho75/config.h b/keyboards/cannonkeys/ortho75/config.h new file mode 100644 index 00000000000..588e2b9215f --- /dev/null +++ b/keyboards/cannonkeys/ortho75/config.h @@ -0,0 +1,81 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER CannonKeys +#define PRODUCT Ortho75 +#define DESCRIPTION Ortho75 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define MATRIX_COL_PINS { B11, B10, B1, B0, A7, A6, A5, B14, A15, A0, C15, C14, B7, B6, B5 } +#define MATRIX_ROW_PINS { B12, C13, A2, A1, A3 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +#define ENCODERS_PAD_A { B9 } +#define ENCODERS_PAD_B { B8 } + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 16 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/cannonkeys/ortho75/halconf.h b/keyboards/cannonkeys/ortho75/halconf.h new file mode 100644 index 00000000000..72879a575b9 --- /dev/null +++ b/keyboards/cannonkeys/ortho75/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/ortho75/info.json b/keyboards/cannonkeys/ortho75/info.json new file mode 100644 index 00000000000..b6aaa8e7e8d --- /dev/null +++ b/keyboards/cannonkeys/ortho75/info.json @@ -0,0 +1,88 @@ +{ + "keyboard_name": "Ortho75", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x12": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"Backspace", "x":11, "y":0}, + {"label":"0", "x":12, "y":0}, + {"label":"0", "x":13, "y":0}, + {"label":"0", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"Delete", "x":11, "y":1}, + {"label":"0", "x":12, "y":1}, + {"label":"0", "x":13, "y":1}, + {"label":"0", "x":14, "y":1}, + {"label":"Esc", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":"'", "x":11, "y":2}, + {"label":"0", "x":12, "y":2}, + {"label":"0", "x":13, "y":2}, + {"label":"0", "x":14, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Enter", "x":11, "y":3}, + {"label":"0", "x":12, "y":3}, + {"label":"0", "x":13, "y":3}, + {"label":"0", "x":14, "y":3}, + {"label":"Fn", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"Meta", "x":3, "y":4}, + {"label":"Lower", "x":4, "y":4}, + {"label":"Space", "x":5, "y":4}, + {"label":"Space", "x":6, "y":4}, + {"label":"Raise", "x":7, "y":4}, + {"label":"Left", "x":8, "y":4}, + {"label":"Down", "x":9, "y":4}, + {"label":"Up", "x":10, "y":4}, + {"label":"Right", "x":11, "y":4}, + {"label":"0", "x":12, "y":4}, + {"label":"0", "x":13, "y":4}, + {"label":"0", "x":14, "y":4} + ] + } + } +} diff --git a/keyboards/cannonkeys/ortho75/keymaps/default/keymap.c b/keyboards/cannonkeys/ortho75/keymaps/default/keymap.c new file mode 100644 index 00000000000..1aef110cb1c --- /dev/null +++ b/keyboards/cannonkeys/ortho75/keymaps/default/keymap.c @@ -0,0 +1,72 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | [ | \ | ] | Y | U | I | O | P | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | HOME | DEL | PG UP | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | END | UP | PG DN | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | LGUI | LALT | FN | SPACE | SPACE | LEFT | DOWN | RIGHT | SPACE | SPACE | FN | RALT | RGUI | RCTRL | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_BASE] = LAYOUT_ortho_5x15( /* QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL + ), + +/* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | NUM LK | P/ | P* | F7 | F8 | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SELECT | CALC | MYCOMP | MAIL | RGB HD | RGB HI | P7 | P8 | P9 | - | | | PR SCR | SCR LK | PAUSE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | PREV | PLAY | NEXT | STOP | RGB SD | RGB SI | P4 | P5 | P6 | + | | RESET | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | VOL- | MUTE | VOL+ | APP | RGB VD | RGB VI | P1 | P2 | P3 | PENT | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT_ortho_5x15( /* FUNCTION */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_MSEL, KC_CALC, KC_MYCM, KC_MAIL, RGB_HUD, RGB_HUI, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, + KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, RGB_SAD, RGB_SAI, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______, + KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, RGB_VAD, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, + _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ + ) +}; diff --git a/keyboards/cannonkeys/ortho75/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/cannonkeys/ortho75/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 00000000000..d0688ef6016 --- /dev/null +++ b/keyboards/cannonkeys/ortho75/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/ortho75/mcuconf.h b/keyboards/cannonkeys/ortho75/mcuconf.h new file mode 100644 index 00000000000..fced27289e0 --- /dev/null +++ b/keyboards/cannonkeys/ortho75/mcuconf.h @@ -0,0 +1,209 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define STM32F103_MCUCONF + +/* + * STM32F103 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_RTCSEL STM32_RTCSEL_HSEDIV +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 6 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * RTC driver system settings. + */ +#define STM32_RTC_IRQ_PRIORITY 15 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/ortho75/ortho75.c b/keyboards/cannonkeys/ortho75/ortho75.c new file mode 100644 index 00000000000..c3ceee28c00 --- /dev/null +++ b/keyboards/cannonkeys/ortho75/ortho75.c @@ -0,0 +1,49 @@ + +#include "ortho75.h" + +#define MEDIA_KEY_DELAY 10 + +uint8_t layer = 0; + +uint32_t layer_state_set_kb(uint32_t state) { + state = layer_state_set_user(state); + layer = biton32(state); + return state; +} + +void encoder_update_kb(uint8_t index, bool clockwise) { + uint16_t mapped_code = 0; + if (index == 0) { + if (clockwise) { + switch(layer){ + case 0: + default: + mapped_code = KC_VOLU; + break; + case 1: + mapped_code = KC_MEDIA_NEXT_TRACK; + break; + case 2: + mapped_code = KC_PGDN; + break; + } + } else { + switch(layer){ + case 0: + default: + mapped_code = KC_VOLD; + break; + case 1: + mapped_code = KC_MEDIA_PREV_TRACK; + break; + case 2: + mapped_code = KC_PGUP; + break; + } + } + uint16_t held_keycode_timer = timer_read(); + register_code(mapped_code); + while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY){ /* no-op */ } + unregister_code(mapped_code); + } +} diff --git a/keyboards/cannonkeys/ortho75/ortho75.h b/keyboards/cannonkeys/ortho75/ortho75.h new file mode 100644 index 00000000000..d23e064296a --- /dev/null +++ b/keyboards/cannonkeys/ortho75/ortho75.h @@ -0,0 +1,18 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_5x15( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k4e \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k4e }, \ +} diff --git a/keyboards/cannonkeys/ortho75/readme.md b/keyboards/cannonkeys/ortho75/readme.md new file mode 100644 index 00000000000..3f94c62465b --- /dev/null +++ b/keyboards/cannonkeys/ortho75/readme.md @@ -0,0 +1,12 @@ +# Ortho 75 + +A Blue Pill STM32F103C8T6-based 15x5 ortholinear keyboard. + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan) +Hardware Supported: Blue Pill STM32F103C8T6 + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/ortho75:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cannonkeys/ortho75/rules.mk b/keyboards/cannonkeys/ortho75/rules.mk new file mode 100644 index 00000000000..113fff5554d --- /dev/null +++ b/keyboards/cannonkeys/ortho75/rules.mk @@ -0,0 +1,57 @@ +# project specific files +VPATH += keyboards/cannonkeys/bluepill +SRC = led.c \ + keyboard.c + +# GENERIC STM32F103C8T6 board - stm32duino bootloader +OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 +MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader +BOARD = GENERIC_STM32_F103 + +# OPT_DEFS = +# MCU_LDSCRIPT = STM32F103x8 +# BOARD = GENERIC_STM32_F103 + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +DFU_ARGS = -d 1eaf:0003 -a 2 -R + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +ENCODER_ENABLE = yes + +LAYOUTS = ortho_5x15 diff --git a/keyboards/cannonkeys/practice60/boards/GENERIC_STM32_F103/board.c b/keyboards/cannonkeys/practice60/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 00000000000..8c5a87f35f8 --- /dev/null +++ b/keyboards/cannonkeys/practice60/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/cannonkeys/practice60/boards/GENERIC_STM32_F103/board.h b/keyboards/cannonkeys/practice60/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 00000000000..9427adabf11 --- /dev/null +++ b/keyboards/cannonkeys/practice60/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/cannonkeys/practice60/boards/GENERIC_STM32_F103/board.mk b/keyboards/cannonkeys/practice60/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 00000000000..6b8b312fd9f --- /dev/null +++ b/keyboards/cannonkeys/practice60/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/cannonkeys/practice60/bootloader_defs.h b/keyboards/cannonkeys/practice60/bootloader_defs.h new file mode 100644 index 00000000000..6b8fa9f727c --- /dev/null +++ b/keyboards/cannonkeys/practice60/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +#define STM32_BOOTLOADER_ADDRESS 0x80000000 diff --git a/keyboards/cannonkeys/practice60/chconf.h b/keyboards/cannonkeys/practice60/chconf.h new file mode 100644 index 00000000000..bbd9b2da62d --- /dev/null +++ b/keyboards/cannonkeys/practice60/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/practice60/config.h b/keyboards/cannonkeys/practice60/config.h new file mode 100644 index 00000000000..c015bb74652 --- /dev/null +++ b/keyboards/cannonkeys/practice60/config.h @@ -0,0 +1,78 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER QMK +#define PRODUCT Practice 60 +#define DESCRIPTION Practice 60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +#define MATRIX_COL_PINS { B11, B10, B1, B0, A7, A6, A5, A4, A3, A2, A1, A0, C15, C14 } +#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 9 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/cannonkeys/practice60/halconf.h b/keyboards/cannonkeys/practice60/halconf.h new file mode 100644 index 00000000000..72879a575b9 --- /dev/null +++ b/keyboards/cannonkeys/practice60/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/practice60/info.json b/keyboards/cannonkeys/practice60/info.json new file mode 100644 index 00000000000..cffbcf49246 --- /dev/null +++ b/keyboards/cannonkeys/practice60/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "Practice 60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/cannonkeys/practice60/keymaps/default/keymap.c b/keyboards/cannonkeys/practice60/keymaps/default/keymap.c new file mode 100644 index 00000000000..66ebe0646d5 --- /dev/null +++ b/keyboards/cannonkeys/practice60/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL + ), + + [_FN1] = LAYOUT_60_ansi( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/cannonkeys/practice60/ld/MKL26Z64.ld b/keyboards/cannonkeys/practice60/ld/MKL26Z64.ld new file mode 100644 index 00000000000..c4ca8b874cc --- /dev/null +++ b/keyboards/cannonkeys/practice60/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/practice60/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/cannonkeys/practice60/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 00000000000..d0688ef6016 --- /dev/null +++ b/keyboards/cannonkeys/practice60/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/practice60/mcuconf.h b/keyboards/cannonkeys/practice60/mcuconf.h new file mode 100644 index 00000000000..fced27289e0 --- /dev/null +++ b/keyboards/cannonkeys/practice60/mcuconf.h @@ -0,0 +1,209 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define STM32F103_MCUCONF + +/* + * STM32F103 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_RTCSEL STM32_RTCSEL_HSEDIV +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 6 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * RTC driver system settings. + */ +#define STM32_RTC_IRQ_PRIORITY 15 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/practice60/practice60.c b/keyboards/cannonkeys/practice60/practice60.c new file mode 100644 index 00000000000..d2cf47deb84 --- /dev/null +++ b/keyboards/cannonkeys/practice60/practice60.c @@ -0,0 +1,2 @@ + +#include "practice60.h" diff --git a/keyboards/cannonkeys/practice60/practice60.h b/keyboards/cannonkeys/practice60/practice60.h new file mode 100644 index 00000000000..5ebba8fb84d --- /dev/null +++ b/keyboards/cannonkeys/practice60/practice60.h @@ -0,0 +1,17 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K41, K42, K43, K49, K4A, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, KC_NO }, \ + { K40, K41, K42, K43, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, KC_NO } \ +} diff --git a/keyboards/cannonkeys/practice60/readme.md b/keyboards/cannonkeys/practice60/readme.md new file mode 100644 index 00000000000..044aadf6e98 --- /dev/null +++ b/keyboards/cannonkeys/practice60/readme.md @@ -0,0 +1,12 @@ +# Practice 60 + +A Blue Pill STM32F103C8T6-based 60% ANSI board. + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1) +Hardware Supported: Blue Pill STM32F103C8T6 + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/practice60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cannonkeys/practice60/rules.mk b/keyboards/cannonkeys/practice60/rules.mk new file mode 100644 index 00000000000..cf8554c0c6f --- /dev/null +++ b/keyboards/cannonkeys/practice60/rules.mk @@ -0,0 +1,57 @@ +# project specific files +VPATH += keyboards/cannonkeys/bluepill +SRC = led.c \ + keyboard.c + +# GENERIC STM32F103C8T6 board - stm32duino bootloader +OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 +MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader +BOARD = GENERIC_STM32_F103 + +# OPT_DEFS = +# MCU_LDSCRIPT = STM32F103x8 +# BOARD = GENERIC_STM32_F103 + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes + +LAYOUTS = 60_ansi + +DEFAULT_FOLDER = cannonkeys/practice60 diff --git a/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.c b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 00000000000..8c5a87f35f8 --- /dev/null +++ b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.h b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 00000000000..9427adabf11 --- /dev/null +++ b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.mk b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 00000000000..6b8b312fd9f --- /dev/null +++ b/keyboards/cannonkeys/practice65/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/cannonkeys/practice65/bootloader_defs.h b/keyboards/cannonkeys/practice65/bootloader_defs.h new file mode 100644 index 00000000000..6b8fa9f727c --- /dev/null +++ b/keyboards/cannonkeys/practice65/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +#define STM32_BOOTLOADER_ADDRESS 0x80000000 diff --git a/keyboards/cannonkeys/practice65/chconf.h b/keyboards/cannonkeys/practice65/chconf.h new file mode 100644 index 00000000000..bbd9b2da62d --- /dev/null +++ b/keyboards/cannonkeys/practice65/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/practice65/config.h b/keyboards/cannonkeys/practice65/config.h new file mode 100644 index 00000000000..d09b521bfab --- /dev/null +++ b/keyboards/cannonkeys/practice65/config.h @@ -0,0 +1,78 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCA04 +#define PRODUCT_ID 0x6565 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER CannonKeys +#define PRODUCT Practice 65 +#define DESCRIPTION Practice 65 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +#define MATRIX_COL_PINS { B8, B0, A0, B5, B10, B9, A6, B12, A7, A5, A4, A3, A2, A1, B13, B14 } +#define MATRIX_ROW_PINS { B4, B11, B1, B7, B6 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 20 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/cannonkeys/practice65/halconf.h b/keyboards/cannonkeys/practice65/halconf.h new file mode 100644 index 00000000000..72879a575b9 --- /dev/null +++ b/keyboards/cannonkeys/practice65/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/practice65/info.json b/keyboards/cannonkeys/practice65/info.json new file mode 100644 index 00000000000..6c448fda205 --- /dev/null +++ b/keyboards/cannonkeys/practice65/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Practice65", + "url": "https://cannonkeys.com", + "maintainer": "awkannan", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_default": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/cannonkeys/practice65/keymaps/default/keymap.c b/keyboards/cannonkeys/practice65/keymaps/default/keymap.c new file mode 100644 index 00000000000..fdc06e39857 --- /dev/null +++ b/keyboards/cannonkeys/practice65/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_default( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,\ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT \ + ), + + [_FN1] = LAYOUT_default( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, _______,\ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ + ) +}; diff --git a/keyboards/cannonkeys/practice65/ld/MKL26Z64.ld b/keyboards/cannonkeys/practice65/ld/MKL26Z64.ld new file mode 100644 index 00000000000..c4ca8b874cc --- /dev/null +++ b/keyboards/cannonkeys/practice65/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/practice65/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/cannonkeys/practice65/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 00000000000..d0688ef6016 --- /dev/null +++ b/keyboards/cannonkeys/practice65/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/cannonkeys/practice65/mcuconf.h b/keyboards/cannonkeys/practice65/mcuconf.h new file mode 100644 index 00000000000..fced27289e0 --- /dev/null +++ b/keyboards/cannonkeys/practice65/mcuconf.h @@ -0,0 +1,209 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define STM32F103_MCUCONF + +/* + * STM32F103 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_RTCSEL STM32_RTCSEL_HSEDIV +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 6 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * RTC driver system settings. + */ +#define STM32_RTC_IRQ_PRIORITY 15 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/practice65/practice65.c b/keyboards/cannonkeys/practice65/practice65.c new file mode 100644 index 00000000000..10f60460fac --- /dev/null +++ b/keyboards/cannonkeys/practice65/practice65.c @@ -0,0 +1,2 @@ + +#include "practice65.h" diff --git a/keyboards/cannonkeys/practice65/practice65.h b/keyboards/cannonkeys/practice65/practice65.h new file mode 100644 index 00000000000..dec02af936f --- /dev/null +++ b/keyboards/cannonkeys/practice65/practice65.h @@ -0,0 +1,19 @@ +#pragma once + +#include "quantum.h" + +#define KNO KC_NO + +#define LAYOUT_default( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2F, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, \ + K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D, K4F \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO , K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO, K2F }, \ + { K30, KNO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F }, \ + { K40, K41, K42, KNO, KC_NO, KC_NO, K46, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D, KC_NO, K4F } \ +} diff --git a/keyboards/cannonkeys/practice65/readme.md b/keyboards/cannonkeys/practice65/readme.md new file mode 100644 index 00000000000..515d1ab5959 --- /dev/null +++ b/keyboards/cannonkeys/practice65/readme.md @@ -0,0 +1,12 @@ +# Practice 65 + +A Blue Pill STM32F103C8T6-based 65% ANSI board. + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1) +Hardware Supported: Blue Pill STM32F103C8T6 + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/practice65:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cannonkeys/practice65/rules.mk b/keyboards/cannonkeys/practice65/rules.mk new file mode 100644 index 00000000000..8bbc910aade --- /dev/null +++ b/keyboards/cannonkeys/practice65/rules.mk @@ -0,0 +1,53 @@ +# project specific files +VPATH += keyboards/cannonkeys/bluepill +SRC = led.c \ + keyboard.c + +# GENERIC STM32F103C8T6 board - stm32duino bootloader +OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 +MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader +BOARD = GENERIC_STM32_F103 + +# OPT_DEFS = +# MCU_LDSCRIPT = STM32F103x8 +# BOARD = GENERIC_STM32_F103 + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes diff --git a/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/board.c new file mode 100644 index 00000000000..d9f7bc329e6 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/board.c @@ -0,0 +1,111 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { + SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP; + SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP); +} diff --git a/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/board.h new file mode 100644 index 00000000000..de3a93d1ceb --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/board.h @@ -0,0 +1,922 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#ifndef BOARD_H +#define BOARD_H + +/* + * Setup for ST STM32F072B-Discovery board. + */ + +/* + * Board identifier. + */ +#define BOARD_ST_STM32F072B_DISCOVERY +#define BOARD_NAME "ST STM32F072B-Discovery" + +/* + * Board oscillators-related settings. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 32768 +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +#define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F072xB + +/* + * IO pins assignments. + */ +#define GPIOA_BUTTON 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_SPI2_SCK 13U +#define GPIOB_SPI2_MISO 14U +#define GPIOB_SPI2_MOSI 15U + +#define GPIOC_MEMS_CS 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_LED_RED 6U +#define GPIOC_LED_BLUE 7U +#define GPIOC_LED_ORANGE 8U +#define GPIOC_LED_GREEN 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_OSC32_IN 14U +#define GPIOC_OSC32_OUT 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_OSC_IN 0U +#define GPIOF_OSC_OUT 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) +#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) + +#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) +#define LINE_LED_RED PAL_LINE(GPIOC, 6U) +#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) +#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) +#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - BUTTON (input floating). + * PA1 - PIN1 (input pullup). + * PA2 - PIN2 (input pullup). + * PA3 - PIN3 (input pullup). + * PA4 - PIN4 (input pullup). + * PA5 - PIN5 (input pullup). + * PA6 - PIN6 (input pullup). + * PA7 - PIN7 (input pullup). + * PA8 - PIN8 (input pullup). + * PA9 - PIN9 (input pullup). + * PA10 - PIN10 (input pullup). + * PA11 - USB_DM (input floating). + * PA12 - USB_DP (input floating). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - PIN15 (input pullup). + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_USB_DM) | \ + PIN_MODE_INPUT(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (input pullup). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 (input pullup). + * PB7 - PIN7 (input pullup). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - SPI2_SCK (alternate 0). + * PB14 - SPI2_MISO (alternate 0). + * PB15 - SPI2_MOSI (alternate 0). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) + +/* + * GPIOC setup: + * + * PC0 - MEMS_CS (output pushpull maximum). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - LED_RED (output pushpull maximum). + * PC7 - LED_BLUE (output pushpull maximum). + * PC8 - LED_ORANGE (output pushpull maximum). + * PC9 - LED_GREEN (output pushpull maximum). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - OSC32_IN (input floating). + * PC15 - OSC32_OUT (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ + PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ + PIN_MODE_INPUT(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ + PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_LOW(GPIOC_LED_RED) | \ + PIN_ODR_LOW(GPIOC_LED_BLUE) | \ + PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ + PIN_ODR_LOW(GPIOC_LED_GREEN) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ + PIN_ODR_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - OSC_IN (input floating). + * PF1 - OSC_OUT (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ + PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ + PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ + PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ + PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* BOARD_H */ diff --git a/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/board.mk new file mode 100644 index 00000000000..b98dcdd26c6 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY diff --git a/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg new file mode 100644 index 00000000000..9c7cf4fd76a --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg @@ -0,0 +1,703 @@ + + + + + resources/gencfg/processors/boards/stm32f0xx/templates + .. + 3.0.x + + ST STM32F072B-Discovery + ST_STM32F072B_DISCOVERY + + STM32F072xB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/keyboards/cannonkeys/satisfaction75/bootloader_defs.h b/keyboards/cannonkeys/satisfaction75/bootloader_defs.h new file mode 100644 index 00000000000..02c48c4e6dc --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/cannonkeys/satisfaction75/chconf.h b/keyboards/cannonkeys/satisfaction75/chconf.h new file mode 100644 index 00000000000..99fa8ce3982 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE FALSE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP FALSE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/cannonkeys/satisfaction75/config.h b/keyboards/cannonkeys/satisfaction75/config.h new file mode 100644 index 00000000000..1cbe43fadfd --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/config.h @@ -0,0 +1,119 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCA04 +#define PRODUCT_ID 0x57F5 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER CannonKeys +#define PRODUCT Satisfaction75 +#define DESCRIPTION Satisfaction 75 Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +#define MATRIX_COL_PINS { B1, B2, B10, B11, B12, B13, B14, A8, A9, A10, B0, A7, A5, B5, A15, A1 } +#define MATRIX_ROW_PINS { B3, B4, A0, A2, A4, A3 } +#define DIODE_DIRECTION COL2ROW + +#define ENCODERS_PAD_A { B9 } +#define ENCODERS_PAD_B { B8 } + +//LEDS A6, RGB B15 +#define BACKLIGHT_LEVELS 24 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#ifdef QWIIC_MICRO_OLED_ENABLE + +#undef I2C_ADDRESS_SA0_1 +#define I2C_ADDRESS_SA0_1 0b0111100 +#define LCDWIDTH 128 +#define LCDHEIGHT 32 + +#endif + + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x01 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 + +// Dynamic macro starts after dynamic keymaps (35+(4*6*16*2)) = (35+768) = 803 + +// I'm also putting my custom stuff after that +// 1 for enabled encoder modes +// 1 for custom backlighting controls +// 1 for OLED default mode +// 6 for 3x custom encoder settings, left, right, and press (18 total) + +#define DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES 803 +#define DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT 804 +#define DYNAMIC_KEYMAP_DEFAULT_OLED 805 +#define DYNAMIC_KEYMAP_CUSTOM_ENCODER 806 + +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 824 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 200 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 + + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/cannonkeys/satisfaction75/halconf.h b/keyboards/cannonkeys/satisfaction75/halconf.h new file mode 100644 index 00000000000..9a9ab838e64 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/halconf.h @@ -0,0 +1,354 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC TRUE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/cannonkeys/satisfaction75/i2c_master.c b/keyboards/cannonkeys/satisfaction75/i2c_master.c new file mode 100644 index 00000000000..0e3adbbf16f --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/i2c_master.c @@ -0,0 +1,124 @@ +/* Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* This library is only valid for STM32 processors. + * This library follows the convention of the AVR i2c_master library. + * As a result addresses are expected to be already shifted (addr << 1). + * I2CD1 is the default driver which corresponds to pins B6 and B7. This + * can be changed. + * Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that + * STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. Pins B6 and B7 are used + * but using any other I2C pins should be trivial. + */ + +#include "i2c_master.h" +#include "quantum.h" +#include +#include + +static uint8_t i2c_address; + +// This configures the I2C clock to 400khz assuming a 48Mhz clock +// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html +static const I2CConfig i2cconfig = { + STM32_TIMINGR_PRESC(0x00U) | + STM32_TIMINGR_SCLDEL(0x03U) | STM32_TIMINGR_SDADEL(0x01U) | + STM32_TIMINGR_SCLH(0x03U) | STM32_TIMINGR_SCLL(0x09U), + 0, + 0 +}; + +static i2c_status_t chibios_to_qmk(const msg_t status) { + switch (status) { + case I2C_NO_ERROR: + return I2C_STATUS_SUCCESS; + case I2C_TIMEOUT: + return I2C_STATUS_TIMEOUT; + // I2C_BUS_ERROR, I2C_ARBITRATION_LOST, I2C_ACK_FAILURE, I2C_OVERRUN, I2C_PEC_ERROR, I2C_SMB_ALERT + default: + return I2C_STATUS_ERROR; + } +} + +__attribute__ ((weak)) +void i2c_init(void) +{ + // Try releasing special pins for a short time + palSetPadMode(GPIOB, 6, PAL_MODE_INPUT); + palSetPadMode(GPIOB, 7, PAL_MODE_INPUT); + + chThdSleepMilliseconds(10); + + palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN); + palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN); + + //i2cInit(); //This is invoked by halInit() so no need to redo it. +} + +i2c_status_t i2c_start(uint8_t address) +{ + i2c_address = address; + i2cStart(&I2C_DRIVER, &i2cconfig); + return I2C_STATUS_SUCCESS; +} + +i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) +{ + i2c_address = address; + i2cStart(&I2C_DRIVER, &i2cconfig); + i2cAcquireBus(&I2C_DRIVER); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); + i2cReleaseBus(&I2C_DRIVER); + return chibios_to_qmk(status); +} + +i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) +{ + i2c_address = address; + i2cStart(&I2C_DRIVER, &i2cconfig); + msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); + return chibios_to_qmk(status); +} + +i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) +{ + i2c_address = devaddr; + i2cStart(&I2C_DRIVER, &i2cconfig); + + uint8_t complete_packet[length + 1]; + for(uint8_t i = 0; i < length; i++) + { + complete_packet[i+1] = data[i]; + } + complete_packet[0] = regaddr; + + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); + return chibios_to_qmk(status); +} + +i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) +{ + i2c_address = devaddr; + i2cStart(&I2C_DRIVER, &i2cconfig); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), ®addr, 1, data, length, MS2ST(timeout)); + return chibios_to_qmk(status); +} + +void i2c_stop(void) +{ + i2cStop(&I2C_DRIVER); +} diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/default/keymap.c b/keyboards/cannonkeys/satisfaction75/keymaps/default/keymap.c new file mode 100644 index 00000000000..5e87c73dcc5 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_default( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, ENC_PRESS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENTER, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_default( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c b/keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c new file mode 100644 index 00000000000..733ba8cd673 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c @@ -0,0 +1,37 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, ENC_PRESS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENTER, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, OLED_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/tester/keymap.c b/keyboards/cannonkeys/satisfaction75/keymaps/tester/keymap.c new file mode 100644 index 00000000000..3595c107b98 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/tester/keymap.c @@ -0,0 +1,37 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, ENC_PRESS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENTER, KC_PGUP, + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/tester/rules.mk b/keyboards/cannonkeys/satisfaction75/keymaps/tester/rules.mk new file mode 100644 index 00000000000..3357eb91c05 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/tester/rules.mk @@ -0,0 +1 @@ +QWIIC_ENABLE = no diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c b/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c new file mode 100644 index 00000000000..296fd7da6aa --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c @@ -0,0 +1,51 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, ENC_PRESS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENTER, KC_PGUP, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/via/rules.mk b/keyboards/cannonkeys/satisfaction75/keymaps/via/rules.mk new file mode 100644 index 00000000000..d12497792d5 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/via/rules.mk @@ -0,0 +1,5 @@ +# rules.mk overrides to enable VIA + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes + diff --git a/keyboards/cannonkeys/satisfaction75/led.c b/keyboards/cannonkeys/satisfaction75/led.c new file mode 100644 index 00000000000..3ddcec2028b --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/led.c @@ -0,0 +1,240 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "hal.h" +#include "led_custom.h" +#include "satisfaction75.h" +#include "printf.h" + +static void breathing_callback(PWMDriver *pwmp); + +static PWMConfig pwmCFG = { + 0xFFFF, /* PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + NULL, /* No Callback */ + { + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +static PWMConfig pwmCFG_breathing = { + 0xFFFF, /* 10kHz PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + breathing_callback, /* Breathing Callback */ + { + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + + +void backlight_init_ports(void) { + palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(1)); + pwmStart(&PWMD3, &pwmCFG); + if(kb_backlight_config.enable){ + if(kb_backlight_config.breathing){ + breathing_enable(); + } else{ + backlight_set(kb_backlight_config.level); + } + } else { + backlight_set(0); + } +} + +void backlight_set(uint8_t level) { + uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / BACKLIGHT_LEVELS)); + if (level == 0) { + // Turn backlight off + pwmDisableChannel(&PWMD3, 0); + } else { + // Turn backlight on + if(!is_breathing()){ + pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3,0xFFFF,duty)); + } + } +} + + +uint8_t backlight_tick = 0; + +void backlight_task(void) { +} + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +bool is_breathing(void) { + return PWMD3.config == &pwmCFG_breathing; +} + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0) + + +void breathing_interrupt_enable(void){ + pwmStop(&PWMD3); + pwmStart(&PWMD3, &pwmCFG_breathing); + chSysLockFromISR(); + pwmEnablePeriodicNotification(&PWMD3); + pwmEnableChannelI( + &PWMD3, + 0, + PWM_FRACTION_TO_WIDTH( + &PWMD3, + 0xFFFF, + 0xFFFF + ) + ); + chSysUnlockFromISR(); +} + +void breathing_interrupt_disable(void){ + pwmStop(&PWMD3); + pwmStart(&PWMD3, &pwmCFG); +} + +void breathing_enable(void) +{ + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + breathing_interrupt_enable(); +} + +void breathing_pulse(void) +{ + if (kb_backlight_config.level == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + breathing_interrupt_enable(); +} + +void breathing_disable(void) +{ + breathing_interrupt_disable(); + // Restore backlight level + backlight_set(kb_backlight_config.level); +} + +void breathing_self_disable(void) +{ + if (kb_backlight_config.level == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()){ + breathing_disable(); + } else { + breathing_enable(); + } +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * kb_backlight_config.level; +} + +static void breathing_callback(PWMDriver *pwmp) +{ + (void)pwmp; + uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 256); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + breathing_interrupt_disable(); + } + + uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256)); + + chSysLockFromISR(); + pwmEnableChannelI( + &PWMD3, + 0, + PWM_FRACTION_TO_WIDTH( + &PWMD3, + 0xFFFF, + duty + ) + ); + chSysUnlockFromISR(); +} diff --git a/keyboards/cannonkeys/satisfaction75/led_custom.h b/keyboards/cannonkeys/satisfaction75/led_custom.h new file mode 100644 index 00000000000..fe5c9e5dcfa --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/led_custom.h @@ -0,0 +1,5 @@ +#pragma once + +void backlight_task(void); +void breathing_interrupt_disable(void); +void breathing_interrupt_enable(void); diff --git a/keyboards/cannonkeys/satisfaction75/mcuconf.h b/keyboards/cannonkeys/satisfaction75/mcuconf.h new file mode 100644 index 00000000000..6d898579628 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/mcuconf.h @@ -0,0 +1,176 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF +// #define STM32F070xB + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED TRUE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSE + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/cannonkeys/satisfaction75/prototype/prototype.h b/keyboards/cannonkeys/satisfaction75/prototype/prototype.h new file mode 100644 index 00000000000..42e574f3ea8 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/prototype/prototype.h @@ -0,0 +1,19 @@ +#pragma once + +#include "satisfaction75.h" + +#define LAYOUT_default( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K315, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K415, \ + K500, K501, K502, K505, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, KC_NO, K315 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, KC_NO, K415 }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} diff --git a/keyboards/cannonkeys/satisfaction75/prototype/rules.mk b/keyboards/cannonkeys/satisfaction75/prototype/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/cannonkeys/satisfaction75/readme.md b/keyboards/cannonkeys/satisfaction75/readme.md new file mode 100644 index 00000000000..361d1eb0f1a --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/readme.md @@ -0,0 +1,12 @@ +# Satisfaction75 + +Satisfaction75 Keyboard + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1) +Hardware Supported: STM32F072CBT6 + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/Satisfaction75:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cannonkeys/satisfaction75/rev1/rev1.h b/keyboards/cannonkeys/satisfaction75/rev1/rev1.h new file mode 100644 index 00000000000..302b7e43def --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/rev1/rev1.h @@ -0,0 +1,108 @@ +#pragma once + +#include "satisfaction75.h" + +// This layout is the default - it's what's in VIA +// ANSI, bottom row 1.25/1.25/1.25/6.25/1/1/1 +#define LAYOUT_default( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K505, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} + +// ISO, bottom row 1.25/1.25/1.25/6.25/1/1/1 +#define LAYOUT_iso( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K505, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} + +// ANSI, bottom row 1.25/1.25/1.25/6.25/1.5/1.5 +#define LAYOUT_3x2( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K505, K509, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, KC_NO, K511, K512, K513, KC_NO, K515 } \ +} + +// ANSI, WKL bottom row 1.5/1.5/7/1.5/1.5, Split Backspace +#define LAYOUT_2x2( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K505, K509, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, KC_NO, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, K509, KC_NO, K511, K512, K513, KC_NO, K515 } \ +} + +// ANSI, bottom row 1.25/1.25/1.25/2.25/1.25/2.75/1/1/1 +// ANSI, bottom row 1.25/1.25/1.25/2.75/1.25/2.25/1/1/1 +#define LAYOUT_split_space( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K503, K505, K507, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, K503, KC_NO, K505, KC_NO, K507, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} + + +// Expose All Keys - Split backspace - ISO Extra keys - Split space bottom row +#define LAYOUT_all( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K503, K505, K507, K509, K510, K511, K512, K513, K515 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, K415 }, \ + { K500, K501, K502, K503, KC_NO, K505, KC_NO, K507, KC_NO, K509, K510, K511, K512, K513, KC_NO, K515 } \ +} diff --git a/keyboards/cannonkeys/satisfaction75/rev1/rules.mk b/keyboards/cannonkeys/satisfaction75/rev1/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/cannonkeys/satisfaction75/rules.mk b/keyboards/cannonkeys/satisfaction75/rules.mk new file mode 100644 index 00000000000..3e2877200ed --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/rules.mk @@ -0,0 +1,57 @@ +# project specific files +# SRC = ssd1306.c +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F072xB +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx +# it should exist either in /os/hal/boards/ +# or /boards +BOARD = ST_STM32F072B_DISCOVERY +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m0 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# + +SRC += led.c \ + satisfaction_encoder.c \ + satisfaction_oled.c + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file +ENCODER_ENABLE = yes +QWIIC_ENABLE += MICRO_OLED +#BACKLIGHT_ENABLE = yes + +# RAW_ENABLE = yes +# DYNAMIC_KEYMAP_ENABLE = yes + +DEFAULT_FOLDER = cannonkeys/satisfaction75/rev1 diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction75.c b/keyboards/cannonkeys/satisfaction75/satisfaction75.c new file mode 100644 index 00000000000..531bf047466 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/satisfaction75.c @@ -0,0 +1,476 @@ +#include "satisfaction75.h" +#include "print.h" +#include "debug.h" + +#include "ch.h" +#include "hal.h" + +#ifdef QWIIC_MICRO_OLED_ENABLE +#include "micro_oled.h" +#include "qwiic.h" +#endif + +#include "timer.h" + +#include "raw_hid.h" +#include "dynamic_keymap.h" +#include "tmk_core/common/eeprom.h" + +// HACK +#include "keyboards/wilba_tech/via_api.h" // Temporary hack +#include "keyboards/wilba_tech/via_keycodes.h" // Temporary hack + + +/* Artificial delay added to get media keys to work in the encoder*/ +#define MEDIA_KEY_DELAY 10 + +uint16_t last_flush; + +volatile uint8_t led_numlock = false; +volatile uint8_t led_capslock = false; +volatile uint8_t led_scrolllock = false; + +uint8_t layer; + +bool queue_for_send = false; +bool clock_set_mode = false; +uint8_t oled_mode = OLED_DEFAULT; +bool oled_sleeping = false; + +uint8_t encoder_value = 32; +uint8_t encoder_mode = ENC_MODE_VOLUME; +uint8_t enabled_encoder_modes = 0x1F; + +RTCDateTime last_timespec; +uint16_t last_minute = 0; + +uint8_t time_config_idx = 0; +int8_t hour_config = 0; +int16_t minute_config = 0; +int8_t year_config = 0; +int8_t month_config = 0; +int8_t day_config = 0; +uint8_t previous_encoder_mode = 0; + +backlight_config_t kb_backlight_config = { + .enable = true, + .breathing = true, + .level = BACKLIGHT_LEVELS +}; + +bool eeprom_is_valid(void) +{ + return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && + eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); +} + +void eeprom_set_valid(bool valid) +{ + eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); + eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); +} + +void eeprom_reset(void) +{ + // Set the VIA specific EEPROM state as invalid. + eeprom_set_valid(false); + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); +} + +#ifdef RAW_ENABLE + +void raw_hid_receive( uint8_t *data, uint8_t length ) +{ + uint8_t *command_id = &(data[0]); + uint8_t *command_data = &(data[1]); + switch ( *command_id ) + { + case id_get_protocol_version: + { + command_data[0] = PROTOCOL_VERSION >> 8; + command_data[1] = PROTOCOL_VERSION & 0xFF; + break; + } + case id_get_keyboard_value: + { + switch( command_data[0]) + { + case id_uptime: + { + uint32_t value = timer_read32(); + command_data[1] = (value >> 24 ) & 0xFF; + command_data[2] = (value >> 16 ) & 0xFF; + command_data[3] = (value >> 8 ) & 0xFF; + command_data[4] = value & 0xFF; + break; + } + case id_oled_default_mode: + { + uint8_t default_oled = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_DEFAULT_OLED); + command_data[1] = default_oled; + break; + } + case id_oled_mode: + { + command_data[1] = oled_mode; + break; + + } + case id_encoder_modes: + { + command_data[1] = enabled_encoder_modes; + break; + } + case id_encoder_custom: + { + // uint8_t custom_encoder_idx = command_data[1]; + // command_data[2] = 0x00; + // command_data[3] = 0x00; + // command_data[4] = 0x00; + // command_data[5] = 0x00; + // command_data[6] = 0x00; + // command_data[7] = 0x00; + break; + } + default: + { + *command_id = id_unhandled; + break; + } + } + break; + } +#ifdef DYNAMIC_KEYMAP_ENABLE + case id_set_keyboard_value: + { + switch(command_data[0]){ + case id_oled_default_mode: + { + eeprom_update_byte((uint8_t*)DYNAMIC_KEYMAP_DEFAULT_OLED, command_data[1]); + break; + } + case id_oled_mode: + { + oled_mode = command_data[1]; + draw_ui(); + break; + } + case id_encoder_modes: + { + enabled_encoder_modes = command_data[1]; + eeprom_update_byte((uint8_t*)DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES, enabled_encoder_modes); + break; + } + case id_encoder_custom: + { + // uint8_t custom_encoder_idx = command_data[1]; + break; + } + default: + { + *command_id = id_unhandled; + break; + } + } + break; + } + case id_dynamic_keymap_get_keycode: + { + uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); + command_data[3] = keycode >> 8; + command_data[4] = keycode & 0xFF; + break; + } + case id_dynamic_keymap_set_keycode: + { + dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); + break; + } + case id_dynamic_keymap_reset: + { + dynamic_keymap_reset(); + break; + } + case id_dynamic_keymap_macro_get_count: + { + command_data[0] = dynamic_keymap_macro_get_count(); + break; + } + case id_dynamic_keymap_macro_get_buffer_size: + { + uint16_t size = dynamic_keymap_macro_get_buffer_size(); + command_data[0] = size >> 8; + command_data[1] = size & 0xFF; + break; + } + case id_dynamic_keymap_macro_get_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_get_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_set_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_set_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_reset: + { + dynamic_keymap_macro_reset(); + break; + } + case id_dynamic_keymap_get_layer_count: + { + command_data[0] = dynamic_keymap_get_layer_count(); + break; + } + case id_dynamic_keymap_get_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_get_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_set_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_set_buffer( offset, size, &command_data[3] ); + break; + } +#endif // DYNAMIC_KEYMAP_ENABLE + case id_eeprom_reset: + { + eeprom_reset(); + break; + } + case id_bootloader_jump: + { + // Need to send data back before the jump + // Informs host that the command is handled + raw_hid_send( data, length ); + // Give host time to read it + wait_ms(100); + bootloader_jump(); + break; + } + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + + // Return same buffer with values changed + raw_hid_send( data, length ); + +} + +#endif + + +void read_host_led_state(void) { + uint8_t leds = host_keyboard_leds(); + if (leds & (1 << USB_LED_NUM_LOCK)) { + if (led_numlock == false){ + led_numlock = true;} + } else { + if (led_numlock == true){ + led_numlock = false;} + } + if (leds & (1 << USB_LED_CAPS_LOCK)) { + if (led_capslock == false){ + led_capslock = true;} + } else { + if (led_capslock == true){ + led_capslock = false;} + } + if (leds & (1 << USB_LED_SCROLL_LOCK)) { + if (led_scrolllock == false){ + led_scrolllock = true;} + } else { + if (led_scrolllock == true){ + led_scrolllock = false;} + } +} + +uint32_t layer_state_set_kb(uint32_t state) { + state = layer_state_set_user(state); + layer = biton32(state); + queue_for_send = true; + return state; +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + queue_for_send = true; + switch (keycode) { + case OLED_TOGG: + if(!clock_set_mode){ + if (record->event.pressed) { + oled_mode = (oled_mode + 1) % _NUM_OLED_MODES; + draw_ui(); + } + } + return false; + case CLOCK_SET: + if (record->event.pressed) { + if(clock_set_mode){ + pre_encoder_mode_change(); + clock_set_mode = false; + encoder_mode = previous_encoder_mode; + post_encoder_mode_change(); + + }else{ + previous_encoder_mode = encoder_mode; + pre_encoder_mode_change(); + clock_set_mode = true; + encoder_mode = ENC_MODE_CLOCK_SET; + post_encoder_mode_change(); + } + } + return false; + case ENC_PRESS: + if (record->event.pressed) { + uint16_t mapped_code = handle_encoder_press(); + uint16_t held_keycode_timer = timer_read(); + if(mapped_code != 0){ + register_code(mapped_code); + while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY){ /* no-op */ } + unregister_code(mapped_code); + } + } else { + // Do something else when release + } + return false; + default: + break; + } + +#ifdef DYNAMIC_KEYMAP_ENABLE + // Handle macros + if (record->event.pressed) { + if ( keycode >= MACRO00 && keycode <= MACRO15 ) + { + uint8_t id = keycode - MACRO00; + dynamic_keymap_macro_send(id); + return false; + } + } +#endif //DYNAMIC_KEYMAP_ENABLE + + return process_record_user(keycode, record); +} + + +void encoder_update_kb(uint8_t index, bool clockwise) { + encoder_value = (encoder_value + (clockwise ? 1 : -1)) % 64; + queue_for_send = true; + if (index == 0) { + if (layer == 0){ + uint16_t mapped_code = 0; + if (clockwise) { + mapped_code = handle_encoder_clockwise(); + } else { + mapped_code = handle_encoder_ccw(); + } + uint16_t held_keycode_timer = timer_read(); + if(mapped_code != 0){ + register_code(mapped_code); + while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY){ /* no-op */ } + unregister_code(mapped_code); + } + } else { + if(clockwise){ + change_encoder_mode(false); + } else { + change_encoder_mode(true); + } + } + } +} + +void dynamic_keymap_custom_reset(void){ + void *p = (void*)(DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT); + void *end = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR); + while ( p != end ) { + eeprom_update_byte(p, 0); + ++p; + } + eeprom_update_byte((uint8_t*)DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES, 0x1F); +} + +void save_backlight_config_to_eeprom(){ + eeprom_update_byte((uint8_t*)DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT, kb_backlight_config.raw); +} + +void load_custom_config(){ + kb_backlight_config.raw = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT); +#ifdef DYNAMIC_KEYMAP_ENABLE + oled_mode = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_DEFAULT_OLED); + enabled_encoder_modes = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES); +#endif +} + +void eeprom_init_kb(void) +{ + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + if (eeprom_is_valid()) { + load_custom_config(); + } else { + // If the EEPROM has not been saved before, or is out of date, + // save the default values to the EEPROM. Default values + // come from construction of the zeal_backlight_config instance. + //backlight_config_save(); +#ifdef DYNAMIC_KEYMAP_ENABLE + // This resets the keymaps in EEPROM to what is in flash. + dynamic_keymap_reset(); + // This resets the macros in EEPROM to nothing. + dynamic_keymap_macro_reset(); + // Reset the custom stuff + dynamic_keymap_custom_reset(); +#endif + // Save the magic number last, in case saving was interrupted + eeprom_set_valid(true); + } +} + +void matrix_init_kb(void) +{ + eeprom_init_kb(); + rtcGetTime(&RTCD1, &last_timespec); + queue_for_send = true; + backlight_init_ports(); + matrix_init_user(); +} + + +void matrix_scan_kb(void) { + rtcGetTime(&RTCD1, &last_timespec); + uint16_t minutes_since_midnight = last_timespec.millisecond / 1000 / 60; + + if (minutes_since_midnight != last_minute){ + last_minute = minutes_since_midnight; + if(!oled_sleeping){ + queue_for_send = true; + } + } +#ifdef QWIIC_MICRO_OLED_ENABLE + if (queue_for_send && oled_mode != OLED_OFF) { + oled_sleeping = false; + read_host_led_state(); + draw_ui(); + queue_for_send = false; + } + if (timer_elapsed(last_flush) > ScreenOffInterval && !oled_sleeping) { + send_command(DISPLAYOFF); /* 0xAE */ + oled_sleeping = true; + } +#endif +} + diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction75.h b/keyboards/cannonkeys/satisfaction75/satisfaction75.h new file mode 100644 index 00000000000..dfab68017f0 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/satisfaction75.h @@ -0,0 +1,113 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_cannonkeys_satisfaction75_prototype + #include "prototype.h" +#else + #include "rev1.h" +#endif + +/* screen off after this many milliseconds */ +#define ScreenOffInterval 60000 /* milliseconds */ + +typedef union { + uint8_t raw; + struct { + bool enable :1; + bool breathing : 1; + uint8_t level :6; + }; +} backlight_config_t; + +// Start these at the USER code range in VIA +enum my_keycodes { + ENC_PRESS = 0x5F80, + CLOCK_SET, + OLED_TOGG +}; + +enum s75_keyboard_value_id { + id_encoder_modes = 0x80, + id_oled_default_mode, + id_encoder_custom, + id_oled_mode +}; + +enum encoder_modes { + ENC_MODE_VOLUME, + ENC_MODE_MEDIA, + ENC_MODE_SCROLL, + ENC_MODE_BRIGHTNESS, + ENC_MODE_BACKLIGHT, + ENC_MODE_CUSTOM0, + ENC_MODE_CUSTOM1, + ENC_MODE_CUSTOM2, + _NUM_ENCODER_MODES, + ENC_MODE_CLOCK_SET // This shouldn't be included in the default modes, so we put it after NUM_ENCODER_MODES +}; + +enum oled_modes { + OLED_DEFAULT, + OLED_TIME, + OLED_OFF, + _NUM_OLED_MODES +}; + + +// Keyboard Information +extern volatile uint8_t led_numlock; +extern volatile uint8_t led_capslock; +extern volatile uint8_t led_scrolllock; +extern uint8_t layer; + +// OLED Behavior +extern uint16_t last_flush; +extern bool queue_for_send; +extern uint8_t oled_mode; +extern bool oled_sleeping; + +// Encoder Behavior +extern uint8_t encoder_value; +extern uint8_t encoder_mode; +extern uint8_t enabled_encoder_modes; + +// RTC +extern RTCDateTime last_timespec; +extern uint16_t last_minute; + +// RTC Configuration +extern bool clock_set_mode; +extern uint8_t time_config_idx; +extern int8_t hour_config; +extern int16_t minute_config; +extern int8_t year_config; +extern int8_t month_config; +extern int8_t day_config; +extern uint8_t previous_encoder_mode; + +// Backlighting +extern backlight_config_t kb_backlight_config; +extern bool kb_backlight_breathing; + +void pre_encoder_mode_change(void); +void post_encoder_mode_change(void); +void change_encoder_mode(bool negative); +uint16_t handle_encoder_clockwise(void); +uint16_t handle_encoder_ccw(void); +uint16_t handle_encoder_press(void); + +void update_time_config(int8_t increment); + +__attribute__ ((weak)) +void draw_ui(void); +void draw_default(void); +void draw_clock(void); + +void backlight_init_ports(void); +void backlight_set(uint8_t level); +bool is_breathing(void); +void breathing_enable(void); +void breathing_disable(void); +void load_custom_config(void); +void save_backlight_config_to_eeprom(void); diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c new file mode 100644 index 00000000000..67768169186 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c @@ -0,0 +1,184 @@ +#include "satisfaction75.h" + +void pre_encoder_mode_change(){ + if(encoder_mode == ENC_MODE_CLOCK_SET){ + RTCDateTime timespec; + timespec.year = year_config; + timespec.month = month_config; + timespec.day = day_config; + // timespec.dayofweek = last_timespec.dayofweek; + // timespec.dstflag = last_timespec.dstflag; + timespec.millisecond = (hour_config * 60 + minute_config) * 60 * 1000; + rtcSetTime(&RTCD1, ×pec); + } else if (encoder_mode == ENC_MODE_BACKLIGHT){ + save_backlight_config_to_eeprom(); + } +} + +void post_encoder_mode_change(){ + if(encoder_mode == ENC_MODE_CLOCK_SET){ + hour_config = (last_minute / 60); + minute_config = last_minute % 60; + year_config = last_timespec.year; + month_config = last_timespec.month; + day_config = last_timespec.day; + time_config_idx = 0; + } +} + +void change_encoder_mode(bool negative){ + pre_encoder_mode_change(); + if(enabled_encoder_modes == 0){ + enabled_encoder_modes = 0x1F; + } + do { + if(negative){ + if (encoder_mode == 0){ + encoder_mode = _NUM_ENCODER_MODES - 1; + } else{ + encoder_mode = encoder_mode - 1; + } + } else { + encoder_mode = (encoder_mode + 1) % _NUM_ENCODER_MODES; + } + } while(((1 << encoder_mode) & enabled_encoder_modes) == 0); + post_encoder_mode_change(); +} + +void update_time_config(int8_t increment){ + uint8_t day_limit = 31; + uint16_t adjusted_year = 1980 + year_config; + switch(time_config_idx){ + case 0: // hour + default: + hour_config = (hour_config + increment) % 24; + if (hour_config < 0){ + hour_config += 24; + } + break; + case 1: // minute + minute_config = (minute_config + increment) % 60; + if (minute_config < 0){ + minute_config += 60; + } + break; + case 2: // year + year_config += increment; + break; + case 3: // month + month_config = (month_config % 12) + increment; + if (month_config <= 0){ + month_config += 12; + } + break; + case 4: //day + if (month_config == 9 || month_config == 4 || month_config == 6 || month_config == 11){ + day_limit = 30; + } else if(month_config == 2){ + day_limit = adjusted_year % 4 == 0 && !(adjusted_year % 100 == 0 && adjusted_year % 400 != 0) ? 29 : 28; + } + day_config = (day_config % day_limit) + increment; + if(day_config <= 0){ + day_config += day_limit; + } + break; + } +} + +uint16_t handle_encoder_clockwise(){ + uint16_t mapped_code = 0; + switch(encoder_mode){ + default: + case ENC_MODE_VOLUME: + mapped_code = KC_VOLU; + break; + case ENC_MODE_MEDIA: + mapped_code = KC_MEDIA_NEXT_TRACK; + break; + case ENC_MODE_SCROLL: + mapped_code = KC_WH_D; + break; + case ENC_MODE_BACKLIGHT: + kb_backlight_config.level = kb_backlight_config.level + 1; + if(kb_backlight_config.level > BACKLIGHT_LEVELS){ + kb_backlight_config.level = BACKLIGHT_LEVELS; + } + backlight_set(kb_backlight_config.level); + if (kb_backlight_config.level != 0){ + kb_backlight_config.enable = true; + } + break; + case ENC_MODE_BRIGHTNESS: + mapped_code = KC_BRIGHTNESS_UP; + break; + case ENC_MODE_CLOCK_SET: + update_time_config(1); + queue_for_send = true; + break; + } + return mapped_code; +} + +uint16_t handle_encoder_ccw(){ + uint16_t mapped_code = 0; + switch(encoder_mode){ + default: + case ENC_MODE_VOLUME: + mapped_code = KC_VOLD; + break; + case ENC_MODE_MEDIA: + mapped_code = KC_MEDIA_PREV_TRACK; + break; + case ENC_MODE_SCROLL: + mapped_code = KC_WH_U; + break; + case ENC_MODE_BACKLIGHT: + // mapped_code = BL_DEC; + if(kb_backlight_config.level != 0){ + kb_backlight_config.level = kb_backlight_config.level - 1; + } + backlight_set(kb_backlight_config.level); + if (kb_backlight_config.level == 0){ + kb_backlight_config.enable = false; + } + break; + case ENC_MODE_BRIGHTNESS: + mapped_code = KC_BRIGHTNESS_DOWN; + break; + case ENC_MODE_CLOCK_SET: + update_time_config(-1); + queue_for_send = true; + break; + } + return mapped_code; +} + +uint16_t handle_encoder_press(){ + uint16_t mapped_code = 0; + switch(encoder_mode){ + case ENC_MODE_VOLUME: + mapped_code = KC_MUTE; + break; + case ENC_MODE_MEDIA: + mapped_code = KC_MEDIA_PLAY_PAUSE; + break; + case ENC_MODE_SCROLL: + mapped_code = KC_BTN3; + break; + case ENC_MODE_BACKLIGHT: + // mapped_code = BL_TOGG; + kb_backlight_config.breathing = !kb_backlight_config.breathing; + if(!kb_backlight_config.breathing){ + breathing_disable(); + } else{ + breathing_enable(); + } + break; + case ENC_MODE_CLOCK_SET: + time_config_idx = (time_config_idx + 1) % 5; + default: + case ENC_MODE_BRIGHTNESS: + break; + } + return mapped_code; +} diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c b/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c new file mode 100644 index 00000000000..4e22587db85 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c @@ -0,0 +1,271 @@ +#include "satisfaction75.h" +#include "micro_oled.h" + +__attribute__ ((weak)) +void draw_ui() { +#ifdef QWIIC_MICRO_OLED_ENABLE + clear_buffer(); + last_flush = timer_read(); + send_command(DISPLAYON); + if(clock_set_mode){ + draw_clock(); + return; + } + switch (oled_mode){ + default: + case OLED_DEFAULT: + draw_default(); + break; + case OLED_TIME: + draw_clock(); + break; + case OLED_OFF: + send_command(DISPLAYOFF); + break; + } +#endif +} + +void draw_encoder(int8_t startX, int8_t startY, bool show_legend){ + if(show_legend){ + draw_string(startX + 1, startY + 2, "ENC", PIXEL_ON, NORM, 0); + } else { + startX -= 22; + } + draw_rect_filled_soft(startX + 22, startY + 1, 3 + (3 * 6), 9, PIXEL_ON, NORM); + char* mode_string = ""; + switch(encoder_mode){ + default: + case ENC_MODE_VOLUME: + mode_string = "VOL"; + break; + case ENC_MODE_MEDIA: + mode_string = "MED"; + break; + case ENC_MODE_SCROLL: + mode_string = "SCR"; + break; + case ENC_MODE_BRIGHTNESS: + mode_string = "BRT"; + break; + case ENC_MODE_BACKLIGHT: + mode_string = "BKL"; + break; + case ENC_MODE_CLOCK_SET: + mode_string = "CLK"; + break; + case ENC_MODE_CUSTOM0: + mode_string = "CS0"; + break; + case ENC_MODE_CUSTOM1: + mode_string = "CS1"; + break; + case ENC_MODE_CUSTOM2: + mode_string = "CS2"; + break; + } + draw_string(startX + 24, startY + 2, mode_string, PIXEL_ON, XOR, 0); +} + +void draw_layer_section(int8_t startX, int8_t startY, bool show_legend){ + if(show_legend){ + draw_string(startX + 1, startY + 2, "LAYER", PIXEL_ON, NORM, 0); + } else { + startX -= 32; + } + draw_rect_filled_soft(startX + 32, startY + 1, 9, 9, PIXEL_ON, NORM); + draw_char(startX + 34, startY + 2, layer + 0x30, PIXEL_ON, XOR, 0); +} + +void draw_default(){ + uint8_t hour = last_minute / 60; + uint16_t minute = last_minute % 60; + + if(encoder_mode == ENC_MODE_CLOCK_SET){ + hour = hour_config; + minute = minute_config; + } + + bool is_pm = (hour / 12) > 0; + hour = hour % 12; + if (hour == 0){ + hour = 12; + } + char hour_str[2] = ""; + char min_str[2] = ""; + + sprintf(hour_str, "%02d", hour); + sprintf(min_str, "%02d", minute); + + uint8_t mods = get_mods(); + +/* Layer indicator is 41 x 10 pixels */ + draw_layer_section(0,0,true); + +#define ENCODER_INDICATOR_X 45 +#define ENCODER_INDICATOR_Y 0 + draw_encoder(ENCODER_INDICATOR_X, ENCODER_INDICATOR_Y, true); +/* Matrix display is 19 x 9 pixels */ +#define MATRIX_DISPLAY_X 0 +#define MATRIX_DISPLAY_Y 18 + + for (uint8_t x = 0; x < MATRIX_ROWS; x++) { + for (uint8_t y = 0; y < MATRIX_COLS; y++) { + draw_pixel(MATRIX_DISPLAY_X + y + 2, MATRIX_DISPLAY_Y + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); + } + } + draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 19, 9, PIXEL_ON, NORM); + /* hadron oled location on thumbnail */ + draw_rect_filled_soft(MATRIX_DISPLAY_X + 14, MATRIX_DISPLAY_Y + 2, 3, 1, PIXEL_ON, NORM); + +/* Mod display is 41 x 16 pixels */ +#define MOD_DISPLAY_X 30 +#define MOD_DISPLAY_Y 18 + + if (mods & MOD_LSFT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 0, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LCTL) { + draw_rect_filled_soft(MOD_DISPLAY_X + 10, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LALT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 20, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LGUI) { + draw_rect_filled_soft(MOD_DISPLAY_X + 30, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_ON, NORM, 0); + } + +/* Lock display is 23 x 21 */ +#define LOCK_DISPLAY_X 100 +#define LOCK_DISPLAY_Y 0 + + if (led_capslock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y +1, "CAP", PIXEL_OFF, NORM, 0); + } else if (led_capslock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y +1, "CAP", PIXEL_ON, NORM, 0); + } + + if (led_scrolllock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 11, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "SCR", PIXEL_OFF, NORM, 0); + } else if (led_scrolllock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "SCR", PIXEL_ON, NORM, 0); + } + +#define TIME_DISPLAY_X 82 +#define TIME_DISPLAY_Y 22 + draw_string(TIME_DISPLAY_X, TIME_DISPLAY_Y, hour_str, PIXEL_ON, NORM, 0); + draw_string(TIME_DISPLAY_X + 11, TIME_DISPLAY_Y, ":", PIXEL_ON, NORM, 0); + draw_string(TIME_DISPLAY_X + 15, TIME_DISPLAY_Y, min_str, PIXEL_ON, NORM, 0); + if(is_pm){ + draw_string(TIME_DISPLAY_X + 27, TIME_DISPLAY_Y, "pm", PIXEL_ON, NORM, 0); + } else{ + draw_string(TIME_DISPLAY_X + 27, TIME_DISPLAY_Y, "am", PIXEL_ON, NORM, 0); + } + + send_buffer(); +} + +void draw_clock(){ + int8_t hour = last_minute / 60; + int16_t minute = last_minute % 60; + int16_t year = last_timespec.year + 1980; + int8_t month = last_timespec.month; + int8_t day = last_timespec.day; + + if(encoder_mode == ENC_MODE_CLOCK_SET){ + hour = hour_config; + minute = minute_config; + year = year_config + 1980; + month = month_config; + day = day_config; + } + + bool is_pm = (hour / 12) > 0; + hour = hour % 12; + if (hour == 0){ + hour = 12; + } + char hour_str[2] = ""; + char min_str[2] = ""; + char year_str[4] = ""; + char month_str[2] = ""; + char day_str[2] = ""; + + sprintf(hour_str, "%02d", hour); + sprintf(min_str, "%02d", minute); + sprintf(year_str, "%d", year); + sprintf(month_str, "%02d", month); + sprintf(day_str, "%02d", day); + + +#define DATE_DISPLAY_X 6 +#define DATE_DISPLAY_Y 0 + draw_string(DATE_DISPLAY_X, DATE_DISPLAY_Y, year_str, PIXEL_ON, NORM, 0); + draw_string(DATE_DISPLAY_X + 25, DATE_DISPLAY_Y, "-", PIXEL_ON, NORM, 0); + draw_string(DATE_DISPLAY_X + 31, DATE_DISPLAY_Y, month_str, PIXEL_ON, NORM, 0); + draw_string(DATE_DISPLAY_X + 44, DATE_DISPLAY_Y, "-", PIXEL_ON, NORM, 0); + draw_string(DATE_DISPLAY_X + 50, DATE_DISPLAY_Y, day_str, PIXEL_ON, NORM, 0); + +#define CLOCK_DISPLAY_X 6 +#define CLOCK_DISPLAY_Y 14 + draw_string(CLOCK_DISPLAY_X, CLOCK_DISPLAY_Y, hour_str, PIXEL_ON, NORM, 1); + draw_string(CLOCK_DISPLAY_X + 17, CLOCK_DISPLAY_Y, ":", PIXEL_ON, NORM, 1); + draw_string(CLOCK_DISPLAY_X + 25, CLOCK_DISPLAY_Y, min_str, PIXEL_ON, NORM, 1); + if(is_pm){ + draw_string(CLOCK_DISPLAY_X + 41, CLOCK_DISPLAY_Y, "pm", PIXEL_ON, NORM, 1); + } else{ + draw_string(CLOCK_DISPLAY_X + 41, CLOCK_DISPLAY_Y, "am", PIXEL_ON, NORM, 1); + } + + if(clock_set_mode){ + switch(time_config_idx){ + case 0: // hour + default: + draw_line(CLOCK_DISPLAY_X, CLOCK_DISPLAY_Y + 17, CLOCK_DISPLAY_X + 16, CLOCK_DISPLAY_Y + 17, PIXEL_ON, NORM); + break; + case 1: // minute + draw_line(CLOCK_DISPLAY_X + 25, CLOCK_DISPLAY_Y + 17, CLOCK_DISPLAY_X + 41, CLOCK_DISPLAY_Y + 17, PIXEL_ON, NORM); + break; + case 2: // year + draw_line(DATE_DISPLAY_X, DATE_DISPLAY_Y + 9, DATE_DISPLAY_X + 23, DATE_DISPLAY_Y + 9, PIXEL_ON, NORM); + break; + case 3: // month + draw_line(DATE_DISPLAY_X + 31, DATE_DISPLAY_Y + 9, DATE_DISPLAY_X + 43, DATE_DISPLAY_Y + 9, PIXEL_ON, NORM); + break; + case 4: //day + draw_line(DATE_DISPLAY_X + 50, DATE_DISPLAY_Y + 9, DATE_DISPLAY_X + 61, DATE_DISPLAY_Y + 9,PIXEL_ON, NORM); + break; + } + } + + draw_encoder(80, 0, true); + draw_layer_section(80, 11, true); + +#define CAPS_DISPLAY_X 86 +#define CAPS_DISPLAY_Y 22 + + if (led_capslock == true) { + draw_rect_filled_soft(CAPS_DISPLAY_X, CAPS_DISPLAY_Y, 5 + (4 * 6), 9, PIXEL_ON, NORM); + draw_string(CAPS_DISPLAY_X + 3, CAPS_DISPLAY_Y +1, "CAPS", PIXEL_OFF, NORM, 0); + } else if (led_capslock == false) { + draw_string(CAPS_DISPLAY_X + 3, CAPS_DISPLAY_Y +1, "CAPS", PIXEL_ON, NORM, 0); + } + + + send_buffer(); + +} diff --git a/keyboards/cannonkeys/stm32f072/keyboard.c b/keyboards/cannonkeys/stm32f072/keyboard.c new file mode 100644 index 00000000000..9520398d05f --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/keyboard.c @@ -0,0 +1,303 @@ +#include "keyboard.h" +#include "ch.h" +#include "hal.h" +#include "led_custom.h" +#include "util.h" +#include "quantum.h" + +#include "ws2812.h" + +#include "raw_hid.h" +#include "dynamic_keymap.h" +#include "tmk_core/common/eeprom.h" + +// HACK +#include "keyboards/wilba_tech/via_api.h" // Temporary hack +#include "keyboards/wilba_tech/via_keycodes.h" // Temporary hack + + +backlight_config_t kb_backlight_config = { + .enable = true, + .breathing = true, + .level = BACKLIGHT_LEVELS +}; + +bool eeprom_is_valid(void) +{ + return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && + eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); +} + +void eeprom_set_valid(bool valid) +{ + eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); + eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); +} + +void eeprom_reset(void) +{ + eeprom_set_valid(false); + eeconfig_disable(); +} + +void save_backlight_config_to_eeprom(){ + eeprom_update_byte((uint8_t*)EEPROM_CUSTOM_BACKLIGHT, kb_backlight_config.raw); +} + +void load_custom_config(){ + kb_backlight_config.raw = eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_BACKLIGHT); +} + +#ifdef DYNAMIC_KEYMAP_ENABLE +void dynamic_keymap_custom_reset(void){ + void *p = (void*)(EEPROM_CUSTOM_BACKLIGHT); + void *end = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR); + while ( p != end ) { + eeprom_update_byte(p, 0); + ++p; + } +} +#endif + +void eeprom_init_kb(void) +{ + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + if (eeprom_is_valid()) { + load_custom_config(); + } else { +#ifdef DYNAMIC_KEYMAP_ENABLE + // This resets the keymaps in EEPROM to what is in flash. + dynamic_keymap_reset(); + // This resets the macros in EEPROM to nothing. + dynamic_keymap_macro_reset(); + // Reset the custom stuff + dynamic_keymap_custom_reset(); +#endif + // Save the magic number last, in case saving was interrupted + save_backlight_config_to_eeprom(); + eeprom_set_valid(true); + } +} + +__attribute__ ((weak)) +void matrix_init_board(void); + +void matrix_init_kb(void){ + eeprom_init_kb(); + /* MOSI pin*/ + palSetPadMode(PORT_WS2812, PIN_WS2812, PAL_MODE_ALTERNATE(0)); + wait_ms(500); + +#ifdef RGBLIGHT_ENABLE + leds_init(); +#endif + backlight_init_ports(); + + matrix_init_board(); +} + +void matrix_scan_kb(void) +{ + #ifdef RGBLIGHT_ENABLE + rgblight_task(); + #endif +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BL_INC: + if (record->event.pressed) { + kb_backlight_config.level = kb_backlight_config.level + 1; + if(kb_backlight_config.level > BACKLIGHT_LEVELS){ + kb_backlight_config.level = BACKLIGHT_LEVELS; + } + backlight_set(kb_backlight_config.level); + save_backlight_config_to_eeprom(); + } + return false; + case BL_TOGG: + if (record->event.pressed) { + kb_backlight_config.enable = !kb_backlight_config.enable; + if(kb_backlight_config.enable){ + backlight_set(kb_backlight_config.level); + } else { + backlight_set(0); + } + save_backlight_config_to_eeprom(); + } + return false; + + case BL_DEC: + if (record->event.pressed) { + if(kb_backlight_config.level <= 1){ + kb_backlight_config.level = 0; + } else { + kb_backlight_config.level = kb_backlight_config.level - 1; + } + backlight_set(kb_backlight_config.level); + save_backlight_config_to_eeprom(); + } + return false; + case BL_BRTG: + if (record->event.pressed) { + kb_backlight_config.breathing = !kb_backlight_config.breathing; + breathing_toggle(); + save_backlight_config_to_eeprom(); + } + return false; + default: + break; + } + + #ifdef DYNAMIC_KEYMAP_ENABLE + // Handle macros + if (record->event.pressed) { + if ( keycode >= MACRO00 && keycode <= MACRO15 ) + { + uint8_t id = keycode - MACRO00; + dynamic_keymap_macro_send(id); + return false; + } + } + #endif //DYNAMIC_KEYMAP_ENABLE + + return process_record_user(keycode, record);; +} + + +// Start Dynamic Keymap code +#ifdef RAW_ENABLE + +void raw_hid_receive( uint8_t *data, uint8_t length ) +{ + uint8_t *command_id = &(data[0]); + uint8_t *command_data = &(data[1]); + switch ( *command_id ) + { + case id_get_protocol_version: + { + command_data[0] = PROTOCOL_VERSION >> 8; + command_data[1] = PROTOCOL_VERSION & 0xFF; + break; + } + case id_get_keyboard_value: + { + switch( command_data[0]) + { + case id_uptime: + { + uint32_t value = timer_read32(); + command_data[1] = (value >> 24 ) & 0xFF; + command_data[2] = (value >> 16 ) & 0xFF; + command_data[3] = (value >> 8 ) & 0xFF; + command_data[4] = value & 0xFF; + break; + } + default: + { + *command_id = id_unhandled; + break; + } + } + break; + } +#ifdef DYNAMIC_KEYMAP_ENABLE + + case id_dynamic_keymap_get_keycode: + { + uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); + command_data[3] = keycode >> 8; + command_data[4] = keycode & 0xFF; + break; + } + case id_dynamic_keymap_set_keycode: + { + dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); + break; + } + case id_dynamic_keymap_reset: + { + dynamic_keymap_reset(); + break; + } + case id_dynamic_keymap_macro_get_count: + { + command_data[0] = dynamic_keymap_macro_get_count(); + break; + } + case id_dynamic_keymap_macro_get_buffer_size: + { + uint16_t size = dynamic_keymap_macro_get_buffer_size(); + command_data[0] = size >> 8; + command_data[1] = size & 0xFF; + break; + } + case id_dynamic_keymap_macro_get_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_get_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_set_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_set_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_reset: + { + dynamic_keymap_macro_reset(); + break; + } + case id_dynamic_keymap_get_layer_count: + { + command_data[0] = dynamic_keymap_get_layer_count(); + break; + } + case id_dynamic_keymap_get_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_get_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_set_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_set_buffer( offset, size, &command_data[3] ); + break; + } +#endif // DYNAMIC_KEYMAP_ENABLE + case id_eeprom_reset: + { + eeprom_reset(); + break; + } + case id_bootloader_jump: + { + // Need to send data back before the jump + // Informs host that the command is handled + raw_hid_send( data, length ); + // Give host time to read it + wait_ms(100); + bootloader_jump(); + break; + } + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + + // Return same buffer with values changed + raw_hid_send( data, length ); + +} + +#endif diff --git a/keyboards/cannonkeys/stm32f072/keyboard.h b/keyboards/cannonkeys/stm32f072/keyboard.h new file mode 100644 index 00000000000..94c973d6153 --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/keyboard.h @@ -0,0 +1,23 @@ +#pragma once + +#include "quantum.h" + +typedef union { + uint8_t raw; + struct { + bool enable :1; + bool breathing : 1; + uint8_t level :6; + }; +} backlight_config_t; + +// Backlighting +extern backlight_config_t kb_backlight_config; +extern bool kb_backlight_breathing; +void backlight_init_ports(void); +void backlight_set(uint8_t level); +bool is_breathing(void); +void breathing_enable(void); +void breathing_disable(void); +void load_custom_config(void); +void save_backlight_config_to_eeprom(void); diff --git a/keyboards/cannonkeys/stm32f072/led.c b/keyboards/cannonkeys/stm32f072/led.c new file mode 100644 index 00000000000..5c7df47da75 --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/led.c @@ -0,0 +1,251 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "hal.h" +#include "led_custom.h" +#include "keyboard.h" +#include "printf.h" + +static void breathing_callback(PWMDriver *pwmp); + +static PWMConfig pwmCFG = { + 0xFFFF, /* PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + NULL, /* No Callback */ + { + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +static PWMConfig pwmCFG_breathing = { + 0xFFFF, /* 10kHz PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + breathing_callback, /* Breathing Callback */ + { + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + + +uint8_t get_backlight_level(void){ + return kb_backlight_config.level; +} + +void backlight_init_ports(void) { + printf("backlight_init_ports()\n"); + palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(1)); + pwmStart(&PWMD3, &pwmCFG); + // pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3, 0xFFFF,cie_lightness(0xFFFF))); + if(kb_backlight_config.enable){ + backlight_set(kb_backlight_config.level); + if(kb_backlight_config.breathing){ + breathing_enable(); + } + } else { + backlight_set(0); + } + +} + +void backlight_set(uint8_t level) { + printf("backlight_set(%d)\n", level); + uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / BACKLIGHT_LEVELS)); + printf("duty: (%d)\n", duty); + if (level == 0) { + // Turn backlight off + pwmDisableChannel(&PWMD3, 0); + } else { + // Turn backlight on + if(!is_breathing()){ + pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3,0xFFFF,duty)); + } + } +} + + +uint8_t backlight_tick = 0; + +void backlight_task(void) { +} + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +bool is_breathing(void) { + return PWMD3.config == &pwmCFG_breathing; +} + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0) + + +void breathing_interrupt_enable(void){ + pwmStop(&PWMD3); + pwmStart(&PWMD3, &pwmCFG_breathing); + chSysLockFromISR(); + pwmEnablePeriodicNotification(&PWMD3); + pwmEnableChannelI( + &PWMD3, + 0, + PWM_FRACTION_TO_WIDTH( + &PWMD3, + 0xFFFF, + 0xFFFF + ) + ); + chSysUnlockFromISR(); +} + +void breathing_interrupt_disable(void){ + pwmStop(&PWMD3); + pwmStart(&PWMD3, &pwmCFG); +} + +void breathing_enable(void) +{ + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + breathing_interrupt_enable(); +} + +void breathing_pulse(void) +{ + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + breathing_interrupt_enable(); +} + +void breathing_disable(void) +{ + printf("breathing_disable()\n"); + breathing_interrupt_disable(); + // Restore backlight level + backlight_set(get_backlight_level()); +} + +void breathing_self_disable(void) +{ + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()){ + printf("disable breathing\n"); + breathing_disable(); + } else { + printf("enable breathing\n"); + breathing_enable(); + } +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +static void breathing_callback(PWMDriver *pwmp) +{ + (void)pwmp; + uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 256); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + breathing_interrupt_disable(); + } + + uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256)); + + chSysLockFromISR(); + pwmEnableChannelI( + &PWMD3, + 0, + PWM_FRACTION_TO_WIDTH( + &PWMD3, + 0xFFFF, + duty + ) + ); + chSysUnlockFromISR(); +} diff --git a/keyboards/cannonkeys/stm32f072/led_custom.h b/keyboards/cannonkeys/stm32f072/led_custom.h new file mode 100644 index 00000000000..28e0f02ed34 --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/led_custom.h @@ -0,0 +1,6 @@ +#pragma once + +void backlight_task(void); +void breathing_interrupt_disable(void); +void breathing_interrupt_enable(void); +void breathing_toggle(void); diff --git a/keyboards/cannonkeys/stm32f072/ws2812.c b/keyboards/cannonkeys/stm32f072/ws2812.c new file mode 100644 index 00000000000..665763931e3 --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/ws2812.c @@ -0,0 +1,150 @@ +#include "ch.h" +#include "hal.h" + +#include "ws2812.h" + +#define BYTES_FOR_LED_BYTE 4 +#define NB_COLORS 3 +#define BYTES_FOR_LED BYTES_FOR_LED_BYTE*NB_COLORS +#define DATA_SIZE BYTES_FOR_LED*NB_LEDS +#define RESET_SIZE 200 + +// Define the spi your LEDs are plugged to here +#define LEDS_SPI WS2812_SPI +// Define the number of LEDs you wish to control in your LED strip +#define NB_LEDS RGBLED_NUM + +#define LED_SPIRAL 0 + +static uint8_t txbuf[DATA_SIZE + RESET_SIZE]; +static uint8_t get_protocol_eq(uint8_t data, int pos); + +/* + * This lib is meant to be used asynchronously, thus the colors contained in + * the txbuf will be sent in loop, so that the colors are always the ones you + * put in the table (the user thus have less to worry about) + * + * Since the data are sent via DMA, and the call to spiSend is a blocking one, + * the processor ressources are not used to much, if you see your program being + * too slow, simply add a: + * chThdSleepMilliseconds(x); + * after the spiSend, where you increment x untill you are satisfied with your + * program speed, another trick may be to lower this thread priority : your call + */ +static THD_WORKING_AREA(LEDS_THREAD_WA, 128); +static THD_FUNCTION(ledsThread, arg) { + (void) arg; + while(1){ + spiSend(&LEDS_SPI, DATA_SIZE + RESET_SIZE, txbuf); + } +} + +#if LED_SPIRAL +/* + * 'Led spiral' is a simple demo in which we put all the leds to the same + * color, where this color does all the hsv circle in loop. + * If you want to launch the thread that will chage the led colors to the + * appropriate value, simply set LED_SPIRAL to 1. + */ + +static THD_WORKING_AREA(HSVTRANS_WA, 128); +static THD_FUNCTION(hsv_transThread, arg) { + (void) arg; + hsv_color color = {0, 255, 255}; + while(1){ + color.h += 1; + color.h %= 256; + set_leds_color_hsv(color); + chThdSleepMilliseconds(50); + } +} +#endif + +static const SPIConfig spicfg = { + NULL, + GPIOB, + 15, + SPI_CR1_BR_1|SPI_CR1_BR_0 // baudrate : fpclk / 8 => 1tick is 0.32us +}; + +/* + * Function used to initialize the driver. + * + * Starts by shutting off all the LEDs. + * Then gets access on the LED_SPI driver. + * May eventually launch an animation on the LEDs (e.g. a thread setting the + * txbuff values) + */ +void leds_init(void){ + for(int i = 0; i < RESET_SIZE; i++) + txbuf[DATA_SIZE+i] = 0x00; + spiAcquireBus(&LEDS_SPI); /* Acquire ownership of the bus. */ + spiStart(&LEDS_SPI, &spicfg); /* Setup transfer parameters. */ + spiSelect(&LEDS_SPI); /* Slave Select assertion. */ + chThdCreateStatic(LEDS_THREAD_WA, sizeof(LEDS_THREAD_WA),NORMALPRIO, ledsThread, NULL); +#if LED_SPIRAL + chThdCreateStatic(HSVTRANS_WA, sizeof(HSVTRANS_WA), + NORMALPRIO, hsv_transThread, NULL); +#endif +} + +/* + * As the trick here is to use the SPI to send a huge pattern of 0 and 1 to + * the ws2812b protocol, we use this helper function to translate bytes into + * 0s and 1s for the LED (with the appropriate timing). + */ +static uint8_t get_protocol_eq(uint8_t data, int pos){ + uint8_t eq = 0; + if (data & (1 << (2*(3-pos)))) + eq = 0b1110; + else + eq = 0b1000; + if (data & (2 << (2*(3-pos)))) + eq += 0b11100000; + else + eq += 0b10000000; + return eq; +} + +// +///* +// * If you want to set a LED's color in the RGB color space, simply call this +// * function with a hsv_color containing the desired color and the index of the +// * led on the LED strip (starting from 0, the first one being the closest the +// * first plugged to the board) +// * +// * Only set the color of the LEDs through the functions given by this API +// * (unless you really know what you are doing) +// */ +void set_led_color_rgb(LED_TYPE color, int pos){ + for(int j = 0; j < 4; j++) + txbuf[BYTES_FOR_LED*pos + j] = get_protocol_eq(color.g, j); + for(int j = 0; j < 4; j++) + txbuf[BYTES_FOR_LED*pos + BYTES_FOR_LED_BYTE+j] = get_protocol_eq(color.r, j); + for(int j = 0; j < 4; j++) + txbuf[BYTES_FOR_LED*pos + BYTES_FOR_LED_BYTE*2+j] = get_protocol_eq(color.b, j); +} + + +void WS2812_init(void) { + leds_init(); +} + +void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds) { + uint8_t i = 0; + while (i < number_of_leds) { + set_led_color_rgb(ledarray[i], i); + i++; + } +} + + +void set_leds_color_rgb(LED_TYPE color){ + for(int i = 0; i < NB_LEDS; i++) + set_led_color_rgb(color, i); +} + + +void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds) { + +} diff --git a/keyboards/cannonkeys/stm32f072/ws2812.h b/keyboards/cannonkeys/stm32f072/ws2812.h new file mode 100644 index 00000000000..9b545fcd533 --- /dev/null +++ b/keyboards/cannonkeys/stm32f072/ws2812.h @@ -0,0 +1,19 @@ +#pragma once + +#include "hal.h" +#include "color.h" + +void set_leds_color_rgb(LED_TYPE color); +void set_led_color_rgb(LED_TYPE color, int pos); +void leds_init(void); + + + // This is what users will use to interface with this +void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds); +void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds); + + +void WS2812_init(void); +void WS2812_set_color( uint8_t index, uint8_t red, uint8_t green, uint8_t blue ); +void WS2812_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); +void WS2812_send_colors(void); diff --git a/keyboards/canoe/config.h b/keyboards/canoe/config.h index 0e70094ae8b..45581b54932 100644 --- a/keyboards/canoe/config.h +++ b/keyboards/canoe/config.h @@ -35,15 +35,11 @@ along with this program. If not, see . #define UNUSED_PINS #define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 -#define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS #define NO_UART 1 -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - #endif diff --git a/keyboards/canoe/info.json b/keyboards/canoe/info.json index fec60338af6..17bdacaa5db 100644 --- a/keyboards/canoe/info.json +++ b/keyboards/canoe/info.json @@ -2,7 +2,7 @@ "keyboard_name": "Canoe", "maintainer": "qmk", "url": "", - "height": 8, + "height": 6, "width": 15, "layouts": { "LAYOUT_iso": { diff --git a/keyboards/canoe/keymaps/boy_314/keymap.c b/keyboards/canoe/keymaps/boy_314/keymap.c new file mode 100644 index 00000000000..e3b4c88d285 --- /dev/null +++ b/keyboards/canoe/keymaps/boy_314/keymap.c @@ -0,0 +1,56 @@ +/* +Copyright 2019 Boy_314 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _F1 1 +#define _F2 2 + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_PGUP, \ + CTL_T(KC_CAPS), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGDN, \ + KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, KC_UP, MO(_F2), \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_F1), KC_LEFT, KC_DOWN, KC_RIGHT), + + [_F1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS, \ + KC_TRNS, KC_NO, KC_UP, KC_NO, RGB_TOG,RGB_VAI,RGB_HUI,RGB_SAI,KC_INS, RESET, KC_PSCR, KC_TRNS, KC_PAUS, KC_BSLS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,RGB_MOD,RGB_VAD,RGB_HUD,RGB_SAD,KC_NO, KC_NO, KC_F14, KC_F15, KC_INS, KC_HOME, \ + KC_LSPO, KC_MPRV, KC_MPLY, KC_MNXT,KC_NO, KC_NO, KC_NO, KC_MUTE,KC_VOLD, KC_VOLU, KC_NO, KC_RSPC, KC_VOLU, KC_TRNS, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_TRNS, KC_RALT, KC_TRNS, KC_MPLY, KC_VOLD, KC_MNXT), + + [_F2] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_PAUS, \ + KC_TRNS, KC_NO, KC_UP, KC_NO, RGB_TOG,RGB_VAI,RGB_HUI,RGB_SAI,KC_INS, RESET, KC_PSCR, KC_SLCK, KC_PAUS, KC_BSLS, KC_SLCK, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,RGB_MOD,RGB_VAD,RGB_HUD,RGB_SAD,KC_NO, KC_NO, KC_F14, KC_F15, KC_INS, KC_HOME, \ + KC_LSPO, KC_MPRV, KC_MPLY, KC_MNXT,KC_NO, KC_NO, KC_NO, KC_MUTE,KC_VOLD, KC_VOLU, KC_NO, KC_RSPC, KC_PGUP, KC_TRNS, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_TRNS, KC_RALT, KC_TRNS, KC_HOME, KC_PGDOWN,KC_END) + +}; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1<. #define DIODE_DIRECTION COL2ROW /* Set 0 if debouncing isn't needed */ -// #define DEBOUNCING_DELAY 0 +// #define DEBOUNCE 0 /* key combination for command */ #define IS_COMMAND() ( \ diff --git a/keyboards/catch22/keymaps/default/keymap.c b/keyboards/catch22/keymaps/default/keymap.c index f36478d4401..abe88df23c8 100644 --- a/keyboards/catch22/keymaps/default/keymap.c +++ b/keyboards/catch22/keymaps/default/keymap.c @@ -3,8 +3,6 @@ #define _BASE 0 #define _FN 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT( /* Base */ KC_NLCK, KC_PSLS, KC_PAST, KC_BSPC, \ @@ -21,11 +19,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______ \ ), }; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // MACRODOWN only works in this function -{ - return MACRO_NONE; -}; diff --git a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c new file mode 100644 index 00000000000..7e9f90853e3 --- /dev/null +++ b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c @@ -0,0 +1,111 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + + + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h new file mode 100644 index 00000000000..173f7b60542 --- /dev/null +++ b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h @@ -0,0 +1,923 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#ifndef BOARD_H +#define BOARD_H + +/* + * Setup for ST STM32F072B-Discovery board. + */ + +/* + * Board identifier. + */ +#define BOARD_ST_STM32F072B_DISCOVERY +#define BOARD_NAME "ST STM32F072B-Discovery" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +#define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F072xB + +/* + * IO pins assignments. + */ +#define GPIOA_BUTTON 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_SPI2_SCK 13U +#define GPIOB_SPI2_MISO 14U +#define GPIOB_SPI2_MOSI 15U + +#define GPIOC_MEMS_CS 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_LED_RED 6U +#define GPIOC_LED_BLUE 7U +#define GPIOC_LED_ORANGE 8U +#define GPIOC_LED_GREEN 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_OSC32_IN 14U +#define GPIOC_OSC32_OUT 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_OSC_IN 0U +#define GPIOF_OSC_OUT 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) +#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) + +#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) +#define LINE_LED_RED PAL_LINE(GPIOC, 6U) +#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) +#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) +#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - BUTTON (input floating). + * PA1 - PIN1 (input pullup). + * PA2 - PIN2 (input pullup). + * PA3 - PIN3 (input pullup). + * PA4 - PIN4 (input pullup). + * PA5 - PIN5 (input pullup). + * PA6 - PIN6 (input pullup). + * PA7 - PIN7 (input pullup). + * PA8 - PIN8 (input pullup). + * PA9 - PIN9 (input pullup). + * PA10 - PIN10 (input pullup). + * PA11 - USB_DM (input floating). + * PA12 - USB_DP (input floating). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - PIN15 (input pullup). + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_USB_DM) | \ + PIN_MODE_INPUT(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (input pullup). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 (input pullup). + * PB7 - PIN7 (input pullup). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - SPI2_SCK (alternate 0). + * PB14 - SPI2_MISO (alternate 0). + * PB15 - SPI2_MOSI (alternate 0). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) + +/* + * GPIOC setup: + * + * PC0 - MEMS_CS (output pushpull maximum). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - LED_RED (output pushpull maximum). + * PC7 - LED_BLUE (output pushpull maximum). + * PC8 - LED_ORANGE (output pushpull maximum). + * PC9 - LED_GREEN (output pushpull maximum). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - OSC32_IN (input floating). + * PC15 - OSC32_OUT (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ + PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ + PIN_MODE_INPUT(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ + PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_LOW(GPIOC_LED_RED) | \ + PIN_ODR_LOW(GPIOC_LED_BLUE) | \ + PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ + PIN_ODR_LOW(GPIOC_LED_GREEN) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ + PIN_ODR_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - OSC_IN (input floating). + * PF1 - OSC_OUT (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ + PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ + PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ + PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ + PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* BOARD_H */ diff --git a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk new file mode 100644 index 00000000000..b98dcdd26c6 --- /dev/null +++ b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY diff --git a/keyboards/chibios_test/config.h b/keyboards/chibios_test/config.h index 89eb1f33b4d..91350c4457c 100644 --- a/keyboards/chibios_test/config.h +++ b/keyboards/chibios_test/config.h @@ -44,13 +44,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/chibios_test/keymaps/default/keymap.c b/keyboards/chibios_test/keymaps/default/keymap.c index a362e2ccf67..0edc697bf9f 100644 --- a/keyboards/chibios_test/keymaps/default/keymap.c +++ b/keyboards/chibios_test/keymaps/default/keymap.c @@ -15,11 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "chibios_test.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {{KC_CAPS}}, // test with KC_CAPS, KC_A, RESET }; - -const uint16_t fn_actions[] = { -}; diff --git a/keyboards/chimera_ergo/config.h b/keyboards/chimera_ergo/config.h index 8ce195cc06b..4a47effdde3 100644 --- a/keyboards/chimera_ergo/config.h +++ b/keyboards/chimera_ergo/config.h @@ -41,12 +41,6 @@ along with this program. If not, see . #define ONESHOT_TIMEOUT 500 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/chimera_ergo/keymaps/default/keymap.c b/keyboards/chimera_ergo/keymaps/default/keymap.c index f24e6194bc6..51ab0e92cde 100644 --- a/keyboards/chimera_ergo/keymaps/default/keymap.c +++ b/keyboards/chimera_ergo/keymaps/default/keymap.c @@ -17,6 +17,14 @@ enum chimera_ergo_layers _NAV }; +enum custom_keycodes { + SC_INCL = SAFE_RANGE, + SC_PULL, + SC_PUSH, + SC_SCAP, + SC_SCOF +}; + #define SC_NMPD TG(_NUMPAD) #define SC_SYMB TG(_SYMBOLS) #define SC_SPFN LT(_NAV,KC_EQL) @@ -26,20 +34,11 @@ enum chimera_ergo_layers #define SC_SPRT MT(MOD_LALT, KC_1) #define SC_GBRC MT(MOD_RGUI, KC_RBRC) #define SC_MESC LT(_MACROS, KC_ESC) -#define SC_INCL M(0) -#define SC_PULL M(1) -#define SC_PUSH M(2) -#define SC_SCAP M(3) -#define SC_SCOF M(4) #define SC_CAD LALT(LCTL(KC_DEL)) #define LONGPRESS_DELAY 150 //#define LAYER_TOGGLE_DELAY 300 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( @@ -92,52 +91,45 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { /* include some kind of library or header */ - case 0: + case SC_INCL: if (record->event.pressed) { SEND_STRING("#include <>"); - return MACRO( T(LEFT), END); + tap_code(KC_LEFT); } - break; - case 1: + return false; + case SC_PULL: if (record->event.pressed) { SEND_STRING("git pull"); - return MACRO( T(ENT), END ); + tap_code(KC_ENT); } - break; - case 2: - if (record->event.pressed){ + return false; + case SC_PUSH: + if (record->event.pressed) { SEND_STRING("git push"); - return MACRO( T(ENT), END ); + tap_code(KC_ENT); } - break; - case 3: - if (record->event.pressed){ + return false; + case SC_SCAP: + if (record->event.pressed) { layer_on(_CAPS); - register_code(KC_CAPSLOCK); - unregister_code(KC_CAPSLOCK); + tap_code(KC_CAPS); } - break; - case 4: - if (record->event.pressed){ + return false; + case SC_SCOF: + if (record->event.pressed) { layer_off(_CAPS); - register_code(KC_CAPSLOCK); - unregister_code(KC_CAPSLOCK); + tap_code(KC_CAPS); } - break; + return false; + default: + return true; } - return MACRO_NONE; + return true; }; - void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboards/chimera_ergo/matrix.c b/keyboards/chimera_ergo/matrix.c index 21d46ef9b47..d512a51d973 100644 --- a/keyboards/chimera_ergo/matrix.c +++ b/keyboards/chimera_ergo/matrix.c @@ -112,7 +112,7 @@ uint8_t matrix_scan(void) if (timeout > 10000){ break; } - } + } uart_data[i] = SERIAL_UART_DATA; } @@ -134,7 +134,7 @@ uint8_t matrix_scan(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1. #define ONESHOT_TIMEOUT 500 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/chimera_ls/matrix.c b/keyboards/chimera_ls/matrix.c index 665d0d35733..72fe4413704 100644 --- a/keyboards/chimera_ls/matrix.c +++ b/keyboards/chimera_ls/matrix.c @@ -116,7 +116,7 @@ uint8_t matrix_scan(void) if (timeout > 10000){ break; } - } + } uart_data[i] = SERIAL_UART_DATA; } @@ -138,7 +138,7 @@ uint8_t matrix_scan(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1. #define ONESHOT_TIMEOUT 500 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/chimera_ortho/info.json b/keyboards/chimera_ortho/info.json index b1384379ce2..3f8481be4b6 100644 --- a/keyboards/chimera_ortho/info.json +++ b/keyboards/chimera_ortho/info.json @@ -1,240 +1,58 @@ { + "keyboard_name": "Chimera Ortho", + "keyboard_folder": "chimera_ortho", "maintainer": "qmk", "width": 15.5, "height": 4.25, "layouts": { - "KEYMAP": { + "LAYOUT": { "layout": [ - { - "label": "Esc", - "x": 0, - "y": 0 - }, - { - "label": "Q", - "x": 1, - "y": 0 - }, - { - "label": "W", - "x": 2, - "y": 0 - }, - { - "label": "E", - "x": 3, - "y": 0 - }, - { - "label": "R", - "x": 4, - "y": 0 - }, - { - "label": "T", - "x": 5, - "y": 0 - }, - { - "label": "{", - "x": 6, - "y": 0 - }, - { - "label": "}", - "x": 8.5, - "y": 0 - }, - { - "label": "Y", - "x": 9.5, - "y": 0 - }, - { - "label": "U", - "x": 10.5, - "y": 0 - }, - { - "label": "I", - "x": 11.5, - "y": 0 - }, - { - "label": "O", - "x": 12.5, - "y": 0 - }, - { - "label": "P", - "x": 13.5, - "y": 0 - }, - { - "label": "\"", - "x": 14.5, - "y": 0 - }, - { - "label": "Tab", - "x": 0, - "y": 1 - }, - { - "label": "A", - "x": 1, - "y": 1 - }, - { - "label": "S", - "x": 2, - "y": 1 - }, - { - "label": "D", - "x": 3, - "y": 1 - }, - { - "label": "F", - "x": 4, - "y": 1 - }, - { - "label": "G", - "x": 5, - "y": 1 - }, - { - "label": "-", - "x": 6, - "y": 1 - }, - { - "label": "1", - "x": 8.5, - "y": 1 - }, - { - "label": "H", - "x": 9.5, - "y": 1 - }, - { - "label": "J", - "x": 10.5, - "y": 1 - }, - { - "label": "K", - "x": 11.5, - "y": 1 - }, - { - "label": "L", - "x": 12.5, - "y": 1 - }, - { - "label": ";", - "x": 13.5, - "y": 1 - }, - { - "label": "Enter", - "x": 14.5, - "y": 1 - }, - { - "label": "(", - "x": 0, - "y": 2 - }, - { - "label": "Z", - "x": 1, - "y": 2 - }, - { - "label": "X", - "x": 2, - "y": 2 - }, - { - "label": "C", - "x": 3, - "y": 2 - }, - { - "label": "V", - "x": 4, - "y": 2 - }, - { - "label": "B", - "x": 5, - "y": 2 - }, - { - "label": "=", - "x": 6, - "y": 2 - }, - { - "label": "8", - "x": 8.5, - "y": 2 - }, - { - "label": "N", - "x": 9.5, - "y": 2 - }, - { - "label": "M", - "x": 10.5, - "y": 2 - }, - { - "label": ",", - "x": 11.5, - "y": 2 - }, - { - "label": ".", - "x": 12.5, - "y": 2 - }, - { - "label": "/", - "x": 13.5, - "y": 2 - }, - { - "label": ")", - "x": 14.5, - "y": 2 - }, - { - "label": "Num Layer", - "x": 4, - "y": 3.25 - }, - { - "label": "Back Space", - "x": 5, - "y": 3.25 - }, - { - "label": "Space", - "x": 9.5, - "y": 3.25 - }, - { - "label": "Symbol Layer", - "x": 10.5, - "y": 3.25 - } + {"label": "Esc", "x": 0, "y": 0}, + {"label": "Q", "x": 1, "y": 0}, + {"label": "W", "x": 2, "y": 0}, + {"label": "E", "x": 3, "y": 0}, + {"label": "R", "x": 4, "y": 0}, + {"label": "T", "x": 5, "y": 0}, + {"label": "{", "x": 6, "y": 0}, + {"label": "}", "x": 8.5, "y": 0}, + {"label": "Y", "x": 9.5, "y": 0}, + {"label": "U", "x": 10.5, "y": 0}, + {"label": "I", "x": 11.5, "y": 0}, + {"label": "O", "x": 12.5, "y": 0}, + {"label": "P", "x": 13.5, "y": 0}, + {"label": "\"", "x": 14.5, "y": 0}, + {"label": "Tab", "x": 0, "y": 1}, + {"label": "A", "x": 1, "y": 1}, + {"label": "S", "x": 2, "y": 1}, + {"label": "D", "x": 3, "y": 1}, + {"label": "F", "x": 4, "y": 1}, + {"label": "G", "x": 5, "y": 1}, + {"label": "-", "x": 6, "y": 1}, + {"label": "1", "x": 8.5, "y": 1}, + {"label": "H", "x": 9.5, "y": 1}, + {"label": "J", "x": 10.5, "y": 1}, + {"label": "K", "x": 11.5, "y": 1}, + {"label": "L", "x": 12.5, "y": 1}, + {"label": ";", "x": 13.5, "y": 1}, + {"label": "Enter", "x": 14.5, "y": 1}, + {"label": "(", "x": 0, "y": 2}, + {"label": "Z", "x": 1, "y": 2}, + {"label": "X", "x": 2, "y": 2}, + {"label": "C", "x": 3, "y": 2}, + {"label": "V", "x": 4, "y": 2}, + {"label": "B", "x": 5, "y": 2}, + {"label": "=", "x": 6, "y": 2}, + {"label": "8", "x": 8.5, "y": 2}, + {"label": "N", "x": 9.5, "y": 2}, + {"label": "M", "x": 10.5, "y": 2}, + {"label": ", ", "x": 11.5, "y": 2}, + {"label": ".", "x": 12.5, "y": 2}, + {"label": "/", "x": 13.5, "y": 2}, + {"label": ")", "x": 14.5, "y": 2}, + {"label": "Num Layer", "x": 4, "y": 3.25}, + {"label": "Back Space", "x": 5, "y": 3.25}, + {"label": "Space", "x": 9.5, "y": 3.25}, + {"label": "Symbol Layer", "x": 10.5, "y": 3.25} ] } } diff --git a/keyboards/chimera_ortho/keymaps/dcompact/README.md b/keyboards/chimera_ortho/keymaps/dcompact/README.md deleted file mode 100644 index 18c23d66eda..00000000000 --- a/keyboards/chimera_ortho/keymaps/dcompact/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# DCompact Layout - -**Dvorak, Layered, Mouse-Enabled, Compact -- Plover coming soon!?!~** - -_See [the layout source](keymap.c) for the actual layout_ - -## Goals - -The following are the goals kept in mind when designing the DCompact -layout: - -- Provide minimal travel distance when typing English or coding -- Consistent muscle memory translation from standard QWERTY -- Stateless typing experience -- OS-agnostic features, macros, and key placement -- Minimize dependence on mouse usage - -These are generally all met or balanced within reason. This layout is -not intended at all to be a familiar layout for much of anyone (except -maybe those who already type in Dvorak) -- this is meant to amplify the -best parts of having limited, ortholinear keys with layering. - -## As Reference Material - -If you're reading this hoping to find reference material to implement -your own layout, then please feel free to copy over this layout and -make edits where you see fit. I removed a lot of the features I felt -extraneous to my usage and simplified style where I felt needed. This -would hopefully mean that my code should feel like a good base to -develop from for those new to QMK. - -_Remember that settings defined in the layout directory override and -merge with those in the keyboard folder_ - -## Relevant Links - -- ![Online Dvorak Layout Trainer](https://learn.dvorak.nl/) -- ![Dvorak Wikipedia Page](https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard) -- ![QMK Docs](https://docs.qmk.fm/#/) -- ![QMK KeyCode Reference](https://docs.qmk.fm/#/keycodes) - -## Contact - -Maintainer: [Dan](https://github.com/loksonarius) - diff --git a/keyboards/chimera_ortho/keymaps/dcompact/keymap.c b/keyboards/chimera_ortho/keymaps/dcompact/keymap.c index 74c3a25cda0..1c6ef7d6f9a 100644 --- a/keyboards/chimera_ortho/keymaps/dcompact/keymap.c +++ b/keyboards/chimera_ortho/keymaps/dcompact/keymap.c @@ -1,4 +1,4 @@ -#include "chimera_ortho.h" +#include QMK_KEYBOARD_H enum chimera_ortho_layers { @@ -34,7 +34,7 @@ enum chimera_ortho_layers const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = KC_KEYMAP( + [_BASE] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. LALT ,TAB ,QUOT ,COMM ,DOT ,P ,Y ,F ,G ,C ,R ,L ,SLSH ,FUNC //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //\-------------------------------+-------+-------+-------/ \-------+-------+---------------------------------------/ ), - [_NAV] = KC_KEYMAP( + [_NAV] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. , , , , , , , ,HOME ,PGDOWN ,PGUP ,END , , //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| @@ -58,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //\-------------------------------+-------+-------+-------/ \-------+-------+---------------------------------------/ ), - [_SYM] = KC_KEYMAP( + [_SYM] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. ,QUAKE ,GRAVE ,TILDE ,BSLASH ,PIPE ,LPRN ,RPRN ,7 ,8 ,9 ,SLSH ,EQUAL , //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| @@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //\-------------------------------+-------+-------+-------/ \-------+-------+---------------------------------------/ ), - [_FUNC] = KC_KEYMAP( + [_FUNC] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. ,RESET ,SLEP ,MRWD ,MPLY ,MFFD , , ,F9 ,F10 ,F11 ,F12 , , //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| @@ -82,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //\-------------------------------+-------+-------+-------/ \-------+-------+---------------------------------------/ ), - [_MOUSE] = KC_KEYMAP( + [_MOUSE] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. , , , , , , , , , , , , , //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| diff --git a/keyboards/chimera_ortho/keymaps/dcompact/readme.md b/keyboards/chimera_ortho/keymaps/dcompact/readme.md new file mode 100644 index 00000000000..bf72567ef10 --- /dev/null +++ b/keyboards/chimera_ortho/keymaps/dcompact/readme.md @@ -0,0 +1,45 @@ +# DCompact Layout + +**Dvorak, Layered, Mouse-Enabled, Compact -- Plover coming soon!?!~** + +_See [the layout source](keymap.c) for the actual layout_ + +## Goals + +The following are the goals kept in mind when designing the DCompact +layout: + +- Provide minimal travel distance when typing English or coding +- Consistent muscle memory translation from standard QWERTY +- Stateless typing experience +- OS-agnostic features, macros, and key placement +- Minimize dependence on mouse usage + +These are generally all met or balanced within reason. This layout is +not intended at all to be a familiar layout for much of anyone (except +maybe those who already type in Dvorak) -- this is meant to amplify the +best parts of having limited, ortholinear keys with layering. + +## As Reference Material + +If you're reading this hoping to find reference material to implement +your own layout, then please feel free to copy over this layout and +make edits where you see fit. I removed a lot of the features I felt +extraneous to my usage and simplified style where I felt needed. This +would hopefully mean that my code should feel like a good base to +develop from for those new to QMK. + +_Remember that settings defined in the layout directory override and +merge with those in the keyboard folder_ + +## Relevant Links + +- [Online Dvorak Layout Trainer](https://learn.dvorak.nl/) +- [Dvorak Wikipedia Page](https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard) +- [QMK Docs](https://docs.qmk.fm/#/) +- [QMK KeyCode Reference](https://docs.qmk.fm/#/keycodes) + +## Contact + +Maintainer: [Dan](https://github.com/loksonarius) + diff --git a/keyboards/chimera_ortho/keymaps/default/config.h b/keyboards/chimera_ortho/keymaps/default/config.h new file mode 100644 index 00000000000..bdfd4db80fa --- /dev/null +++ b/keyboards/chimera_ortho/keymaps/default/config.h @@ -0,0 +1,5 @@ +#pragma once + +// place overrides here +#define LONGPRESS_DELAY 150 +//#define LAYER_TOGGLE_DELAY 300 diff --git a/keyboards/chimera_ortho/keymaps/default/keymap.c b/keyboards/chimera_ortho/keymaps/default/keymap.c index 6201eebac85..6a676493dda 100644 --- a/keyboards/chimera_ortho/keymaps/default/keymap.c +++ b/keyboards/chimera_ortho/keymaps/default/keymap.c @@ -1,20 +1,19 @@ // this is the style you want to emulate. // This is the canonical layout file for the Quantum project. If you want to add another keyboard, -#include "chimera_ortho.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -enum chimera_ortho_layers -{ - _QWERTY, - _CAPS, - _NUMPAD, - _SYMBOLS, - _MACROS, - _NAV +enum chimera_ortho_layers { + _QWERTY, + _CAPS, + _NUMPAD, + _SYMBOLS, + _MACROS, + _NAV }; #define KC_NMPD TG(_NUMPAD) @@ -27,153 +26,140 @@ enum chimera_ortho_layers #define KC_GBRC MT(MOD_RGUI, KC_8) #define KC_GQOT MT(MOD_LGUI, KC_QUOT) #define KC_MESC LT(_MACROS, KC_ESC) -#define KC_INCL M(0) -#define KC_PULL M(1) -#define KC_PUSH M(2) -#define KC_SCAP M(3) -#define KC_SCOF M(4) #define KC_CAD LALT(LCTL(KC_DEL)) -#define LONGPRESS_DELAY 150 -//#define LAYER_TOGGLE_DELAY 300 - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_ KC_TRNS +enum custom_keycodes { + KC_INCL = SAFE_RANGE, + KC_PULL, + KC_PUSH, + KC_SCAP, + KC_SCOF +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - MESC, Q , W , E , R , T ,SCTL, SCTR, Y , U , I , O , P ,QUOT, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - TAB , A , S , D , F , G ,SPLT, SPRT, H , J , K , L ,SCLN,ENT , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - LSPO, Z , X , C , V , B ,SPFN, GBRC, N , M ,COMM,DOT ,SLSH,RSPC, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - NMPD,BSPC, SPC ,SYMB - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_QWERTY] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + KC_MESC, KC_Q , KC_W , KC_E , KC_R , KC_T ,KC_SCTL, KC_SCTR, KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_QUOT, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G ,KC_SPLT, KC_SPRT, KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_ENT , + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_SPFN, KC_GBRC, KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSPC, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_NMPD,KC_BSPC, KC_SPC ,KC_SYMB + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_CAPS] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , , , , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , ,UNDS, , , , , ,COLN, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - SCOF, , , , , , , , , , , , ,SCOF, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_CAPS] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,_______,_______,_______,KC_UNDS, _______,_______,_______,_______,_______,KC_COLN,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_SCOF,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,KC_SCOF, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______, _______,_______ + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_NUMPAD] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , ,COLN , , , , , , , 7 , 8 , 9 ,ASTR,MINS, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , ,DOT , , , , , , , 4 , 5 , 6 ,PLUS, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , 1 , 2 , 3 ,SLSH, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , 0 - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_NUMPAD] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,_______,KC_COLN,_______,_______,_______,_______, _______,_______, KC_7 , KC_8 , KC_9 ,KC_ASTR,KC_MINS, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,KC_DOT ,_______,_______,_______,_______, _______,_______, KC_4 , KC_5 , KC_6 ,KC_PLUS,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,_______,_______,_______,_______, _______,_______, KC_1 , KC_2 , KC_3 ,KC_SLSH,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______, _______, KC_0 + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_SYMBOLS] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - ,EXLM, AT ,HASH,DLR ,PERC, , ,CIRC,AMPR,ASTR,LPRN,RPRN,BSLS, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , F1 , F2 , F3 , F4 , F5 , , ,TILD,COLN,UNDS,LCBR,RCBR, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , F6 , F7 , F8 , F9 ,F10 , , ,GRV ,SCLN,MINS,LBRC,RBRC, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PIPE, , , - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_SYMBOLS] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC,_______, _______,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_BSLS, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 ,_______, _______,KC_TILD,KC_COLN,KC_UNDS,KC_LCBR,KC_RCBR,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______, KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,_______, _______,KC_GRV ,KC_SCLN,KC_MINS,KC_LBRC,KC_RBRC,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_PIPE,_______, _______,_______ + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_NAV] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , , , , , , , , , , UP , ,PSCR, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , ,LEFT,DOWN,RGHT, , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , ,PGUP,PGDN, , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,DEL , , - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_NAV] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______, KC_UP ,_______,KC_PSCR,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,_______,_______,_______,_______, _______,_______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,_______,_______,_______,_______, _______,_______,KC_PGUP,KC_PGDN,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,KC_DEL , _______,_______ + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_MACROS] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , , , , , , , , , ,INCL, , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , ,CAD , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - SCAP, , , , , , , , , ,PULL,PUSH, ,SCAP, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_MACROS] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,KC_INCL,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,KC_CAD ,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_SCAP,_______,_______,_______,_______,_______,_______, _______,_______,_______,KC_PULL,KC_PUSH,_______,KC_SCAP, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______, _______,_______ + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { /* include some kind of library or header */ - case 0: + case KC_INCL: if (record->event.pressed) { - SEND_STRING("#include <>"); - return MACRO( T(LEFT), END); + SEND_STRING("#include <>" SS_TAP(X_LEFT)); } - break; - case 1: + return false; + case KC_PULL: if (record->event.pressed) { - SEND_STRING("git pull"); - return MACRO( T(ENT), END ); + SEND_STRING("git pull" SS_TAP(X_ENTER)); } - break; - case 2: + return false; + case KC_PUSH: if (record->event.pressed){ - SEND_STRING("git push"); - return MACRO( T(ENT), END ); + SEND_STRING("git push" SS_TAP(X_ENTER)); } - break; - case 3: + return false; + case KC_SCAP: if (record->event.pressed){ layer_on(_CAPS); register_code(KC_CAPSLOCK); unregister_code(KC_CAPSLOCK); } - break; - case 4: + return false; + case KC_SCOF: if (record->event.pressed){ layer_off(_CAPS); register_code(KC_CAPSLOCK); unregister_code(KC_CAPSLOCK); } - break; + return false; } - return MACRO_NONE; + return true; }; - + void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); - + switch (layer) { - case _QWERTY: - set_led_green; - break; + case _QWERTY: + set_led_green; + break; case _CAPS: - set_led_white; - break; + set_led_white; + break; case _NUMPAD: set_led_blue; break; @@ -181,11 +167,11 @@ void matrix_scan_user(void) { set_led_red; break; case _NAV: - set_led_magenta; - break; + set_led_magenta; + break; case _MACROS: - set_led_cyan; - break; + set_led_cyan; + break; default: set_led_green; break; diff --git a/keyboards/chimera_ortho/keymaps/gordon/keymap.c b/keyboards/chimera_ortho/keymaps/gordon/keymap.c index c6d668f8f83..c0543f2e041 100644 --- a/keyboards/chimera_ortho/keymaps/gordon/keymap.c +++ b/keyboards/chimera_ortho/keymaps/gordon/keymap.c @@ -1,10 +1,8 @@ // this is the style you want to emulate. // This is the canonical layout file for the Quantum project. If you want to add another keyboard, -#include "chimera_ortho.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H #include "version.h" -#include "process_keycode/process_tap_dance.h" #include "gordon.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. @@ -83,11 +81,9 @@ //#define LAYER_TOGGLE_DELAY 300 // Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_ KC_TRNS +#define KC_ KC_TRNS -/* TODO: +/* TODO: * * DONE: RESET and CAD into macro layer. * DONE: WINUP AND WINDOWN in NAV layer @@ -113,7 +109,7 @@ * Russain layer * Hebrew layer * Get rid of stupid git pull and push macros. - * + * */ //Tap dance enums @@ -127,14 +123,14 @@ enum { CALC_PRINTSCREEN }; -static xtap ttt_state = { +static xtap ttt_state = { .is_press_action = true, .state = 0 }; //Already exists in gordon.c, shouldn't need this anymore -/*// To activate SINGLE_HOLD, you will need to hold for 200ms first. +/*// To activate SINGLE_HOLD, you will need to hold for 200ms first. // This tap dance favors keys that are used frequently in typing like 'f' int cur_dance (qk_tap_dance_state_t *state) { if (state->count == 1) { @@ -151,8 +147,8 @@ int cur_dance (qk_tap_dance_state_t *state) { else if (state->count == 2) { if (state->interrupted) return DOUBLE_SINGLE_TAP; else if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } + else return DOUBLE_TAP; + } else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) return TRIPLE_TAP; else if (state->count == 3) return TRIPLE_HOLD; else return 8; //magic number. At some point this method will expand to work for more presses @@ -194,7 +190,7 @@ void TTT_reset (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_action_t tap_dance_actions[] = { // simple tap dance - [F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))), + [F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))), [CALCCOMP] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_MY_COMPUTER), [CALC_PRINTSCREEN] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_PSCR), [ALTF4] = ACTION_TAP_DANCE_DOUBLE(KC_F4,LALT(KC_F4)), @@ -206,7 +202,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KC_KEYMAP( + [_QWERTY] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. MESC, Q ,CSHW,ENAV, R , T ,SPC , CLPS, Y , U ,INAV, O , P ,TTT, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -218,7 +214,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_NUMPAD] = KC_KEYMAP( + [_NUMPAD] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , , , ,ASTR, , , , , 7 , 8 , 9 ,ASTR,/**/, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -226,11 +222,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , ,SLSH, , , , , 1 , 2 , 3 ,SLSH, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , 0 + , , , 0 // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_SYMBOLS] = KC_KEYMAP( + [_SYMBOLS] = LAYOUT_kc( //,----+----+-----+----+----+----+----. ,----+----+----+----+----+----+----. ,EXLM, AT ,LCBR,RCBR,HASH, , ,CIRC,AMPR,ASTR,LPRN,RPRN,/**/, //|----+----+-----+----+----+----+----| |----+----+----+----+----+----+----| @@ -242,7 +238,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // \-------------------+----+----+---/ \---+----+----+-------------------/ ), - [_FUNCTION] = KC_KEYMAP( + [_FUNCTION] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. F6F7 ,F1 ,F2 ,F3 ,ALF4,F5 ,F6 , F7 ,F8 ,F9 ,F10 ,F11 ,F12 ,/**/, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -250,11 +246,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , + , , , // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_NAV] = KC_KEYMAP( + [_NAV] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , ,SNAPLEFT,/**/,SNAPRIGHT,, , , , , UP , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -262,11 +258,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , ,WORKLEFT, ,WORKRIGHT,, , , ,PGUP,PGDN, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - CDEL ,DEL, , + CDEL ,DEL, , // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_TEXTNAV] = KC_KEYMAP( + [_TEXTNAV] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , , , , , , , , , ,/**/, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -274,11 +270,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , + , , , // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_MOUSE] = KC_KEYMAP( + [_MOUSE] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , , ,MS_UP, , , , , , , UP , , , ,/**/ //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -286,12 +282,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,MS_BTN1 ,MS_BTN2 , + ,MS_BTN1 ,MS_BTN2 , // \------------------+----+----+---/ \---+----+----+-------------------/ - ), + ), - [_MACROS] = KC_KEYMAP( + [_MACROS] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. /**/,RESET,SECRET_2,SECRET_3, , , ,SYSTEM_SLEEP, , ,INCL, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -299,17 +295,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| SCAP, , , , , , , , , , , , ,SCAP, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , + , , , // \------------------+----+----+---/ \---+----+----+-------------------/ ) }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { @@ -349,11 +340,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; - + void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); - + switch (layer) { case _QWERTY: set_led_green; @@ -381,7 +372,7 @@ void matrix_scan_user(void) { _delay_ms(45); set_led_blue; _delay_ms(45); - break; + break; default: set_led_green; break; diff --git a/keyboards/chimera_ortho/matrix.c b/keyboards/chimera_ortho/matrix.c index 66d29f8b38f..dc38ba74f86 100644 --- a/keyboards/chimera_ortho/matrix.c +++ b/keyboards/chimera_ortho/matrix.c @@ -102,7 +102,7 @@ uint8_t matrix_scan(void) if (timeout > 10000){ break; } - } + } uart_data[i] = SERIAL_UART_DATA; } @@ -124,7 +124,7 @@ uint8_t matrix_scan(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1. + */ +#include "choco60.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/choco60/choco60.h b/keyboards/choco60/choco60.h new file mode 100644 index 00000000000..fedcf942bfd --- /dev/null +++ b/keyboards/choco60/choco60.h @@ -0,0 +1,46 @@ +/* Copyright 2019 Naoto Takai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, R06, R07, R08, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L43, R40, R41, R43, R44 \ +) \ +{ \ + { L00, L01, L02, L03, L04, L05, KC_NO, KC_NO, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO, KC_NO, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO, KC_NO, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, KC_NO, KC_NO, KC_NO }, \ + { L40, L41, KC_NO, L43, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { R00, R01, R02, R03, R04, R05, R06, R07, R08 }, \ + { R10, R11, R12, R13, R14, R15, R16, R17, KC_NO }, \ + { R20, R21, R22, R23, R24, R25, R26, KC_NO, KC_NO }, \ + { R30, R31, R32, R33, R34, R35, R36, KC_NO, KC_NO }, \ + { R40, R41, KC_NO, R43, R44, KC_NO, KC_NO, KC_NO, KC_NO } \ +} diff --git a/keyboards/choco60/config.h b/keyboards/choco60/config.h new file mode 100644 index 00000000000..97d7c61acdb --- /dev/null +++ b/keyboards/choco60/config.h @@ -0,0 +1,55 @@ +/* +Copyright 2019 Naoto Takai + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC0C0 +#define PRODUCT_ID 0x6000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Naoto Takai +#define PRODUCT choco60 +#define DESCRIPTION A 60% split keyboard for programmers. + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D3 // or D1, D2, D3, E6 +#define SPLIT_HAND_PIN D0 diff --git a/keyboards/choco60/info.json b/keyboards/choco60/info.json new file mode 100644 index 00000000000..3918dcb5f01 --- /dev/null +++ b/keyboards/choco60/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Choco60", + "url": "https://keys.recompile.net/projects/choco60/", + "maintainer": "Naoto Takai", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":7, "y":0}, {"label":"&", "x":8, "y":0}, {"label":"*", "x":9, "y":0}, {"label":"(", "x":10, "y":0}, {"label":")", "x":11, "y":0}, {"label":"_", "x":12, "y":0}, {"label":"+", "x":13, "y":0}, {"label":"|", "x":14, "y":0}, {"label":"~", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":7.5, "y":1}, {"label":"U", "x":8.5, "y":1}, {"label":"I", "x":9.5, "y":1}, {"label":"O", "x":10.5, "y":1}, {"label":"P", "x":11.5, "y":1}, {"label":"{", "x":12.5, "y":1}, {"label":"}", "x":13.5, "y":1}, {"label":"Delete", "x":14.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":7.75, "y":2}, {"label":"J", "x":8.75, "y":2}, {"label":"K", "x":9.75, "y":2}, {"label":"L", "x":10.75, "y":2}, {"label":":", "x":11.75, "y":2}, {"label":"\"", "x":12.75, "y":2}, {"label":"Return", "x":13.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":8.25, "y":3}, {"label":"M", "x":9.25, "y":3}, {"label":"<", "x":10.25, "y":3}, {"label":">", "x":11.25, "y":3}, {"label":"?", "x":12.25, "y":3}, {"label":"Shift", "x":13.25, "y":3, "w":1.75}, {"label":"Fn", "x":15, "y":3}, {"label":"Opt", "x":1.5, "y":4}, {"label":"\u2318", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":2.75}, {"label":"Opt", "x":7.75, "y":4}, {"x":8.75, "y":4, "w":2.25}, {"label":"\u2318", "x":11, "y":4, "w":1.5}, {"label":"Ctrl", "x":12.5, "y":4}] + } + } +} diff --git a/keyboards/choco60/keymaps/default/config.h b/keyboards/choco60/keymaps/default/config.h new file mode 100644 index 00000000000..cf4c8bcbe6e --- /dev/null +++ b/keyboards/choco60/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Naoto Takai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/choco60/keymaps/default/keymap.c b/keyboards/choco60/keymaps/default/keymap.c new file mode 100644 index 00000000000..ab3f2c6a2bc --- /dev/null +++ b/keyboards/choco60/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +/* Copyright 2019 Naoto Takai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layer_names { + _BASE, + _FN, +}; + +#define KC_FN MO(_FN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSLASH, KC_GRAVE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRACKET, KC_RBRACKET, KC_BSPACE, + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, KC_ENTER, + KC_LSHIFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSHIFT, KC_FN, + KC_LALT, KC_LGUI, KC_SPACE, KC_SPACE, KC_SPACE, KC_RGUI, KC_RALT + ), + [_FN] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INSERT, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCREEN, KC_SCROLLLOCK, KC_PAUSE, KC_UP, KC_RBRACKET, KC_BSPACE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT, KC_RIGHT, KC_ENTER, + RESET, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDOWN, KC_DOWN, KC_RSHIFT, KC_FN, + _______, _______, _______, _______, _______, KC_STOP, _______ + ) +}; diff --git a/keyboards/choco60/keymaps/default/readme.md b/keyboards/choco60/keymaps/default/readme.md new file mode 100644 index 00000000000..f55e392c391 --- /dev/null +++ b/keyboards/choco60/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for choco60 diff --git a/keyboards/choco60/readme.md b/keyboards/choco60/readme.md new file mode 100644 index 00000000000..ca309fdcbca --- /dev/null +++ b/keyboards/choco60/readme.md @@ -0,0 +1,15 @@ +# choco60 + +![choco60](https://keys.recompile.net/images/choco60-main@600w.jpg) + +A 60% split keyboard for programmers. + +Keyboard Maintainer: [Naoto Takai](https://github.com/takai) +Hardware Supported: The Choco60 PCBs, Pro Micro supported +Hardware Availability: https://keys.recompile.net/projects/choco60/ + +Make example for this keyboard (after setting up your build environment): + + make choco60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/choco60/rules.mk b/keyboards/choco60/rules.mk new file mode 100644 index 00000000000..343469db2b3 --- /dev/null +++ b/keyboards/choco60/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SPLIT_KEYBOARD = yes # Enable split keyboard diff --git a/keyboards/chocopad/README.md b/keyboards/chocopad/README.md deleted file mode 100644 index ad0f6b35602..00000000000 --- a/keyboards/chocopad/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Chocopad -======== - -A 4x4 macropad keyboard using Kailh PG1350 Lower Profile Choc switches. - -Keyboard Maintainer: Keebio -Hardware Supported: Chocopad PCB, Arduino Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make chocopad:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/chocopad/chocopad.h b/keyboards/chocopad/chocopad.h deleted file mode 100644 index ec73b1465bc..00000000000 --- a/keyboards/chocopad/chocopad.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef CHOCOPAD_H -#define CHOCOPAD_H - -#include "quantum.h" - -#define LAYOUT_ortho_4x4( \ - A1, A2, A3, A4, \ - B1, B2, B3, B4, \ - C1, C2, C3, C4, \ - D1, D2, D3, D4 \ -) { \ - { A1, A2, A3, A4 }, \ - { B1, B2, B3, B4 }, \ - { C1, C2, C3, C4 }, \ - { D1, D2, D3, D4 } \ -} - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - A1, A2, A3, A4, \ - B1, B2, B3, B4, \ - C1, C2, C3, C4, \ - D1, D2, D3, D4 \ -) \ - LAYOUT_ortho_4x4( \ - KC_##A1, KC_##A2, KC_##A3, KC_##A4, \ - KC_##B1, KC_##B2, KC_##B3, KC_##B4, \ - KC_##C1, KC_##C2, KC_##C3, KC_##C4, \ - KC_##D1, KC_##D2, KC_##D3, KC_##D4 \ - ) - -#endif diff --git a/keyboards/chocopad/config.h b/keyboards/chocopad/config.h deleted file mode 100644 index d2a1a7b4843..00000000000 --- a/keyboards/chocopad/config.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1144 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Chocopad -#define DESCRIPTION 4x4 macropad using Kailh Choc low-profile switches - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 4 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D7, E6, B3, B2 } -#define MATRIX_COL_PINS { D2, D4, F6, F5 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* number of backlight levels */ -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_LEVELS 6 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 4 - -#endif diff --git a/keyboards/chocopad/keymaps/default/keymap.c b/keyboards/chocopad/keymaps/default/keymap.c deleted file mode 100644 index df22e8b1fb1..00000000000 --- a/keyboards/chocopad/keymaps/default/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 - -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_BASE] = LAYOUT_ortho_4x4( - KC_PGUP, KC_HOME, KC_UP, KC_END , \ - KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, \ - MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV, \ - MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT \ - ), - [_FN1] = LAYOUT_ortho_4x4( - KC_ESC, KC_P7, KC_P8, KC_P9, \ - KC_TAB, KC_P4, KC_P5, KC_P6, \ - KC_ENT, KC_P1, KC_P2, KC_P3, \ - _______, KC_P0, KC_P0, KC_DOT \ - ), - [_FN2] = LAYOUT_ortho_4x4( - RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \ - _______, _______, _______, RESET, \ - BL_STEP, _______, _______, _______ \ - ) - -}; diff --git a/keyboards/chocopad/keymaps/default/rules.mk b/keyboards/chocopad/keymaps/default/rules.mk deleted file mode 100644 index 1e576127880..00000000000 --- a/keyboards/chocopad/keymaps/default/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/chocopad/keymaps/khord/config.h b/keyboards/chocopad/keymaps/khord/config.h deleted file mode 100644 index 7fa3bf328ec..00000000000 --- a/keyboards/chocopad/keymaps/khord/config.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#endif diff --git a/keyboards/chocopad/keymaps/khord/keymap.c b/keyboards/chocopad/keymaps/khord/keymap.c deleted file mode 100644 index ea36c6f6401..00000000000 --- a/keyboards/chocopad/keymaps/khord/keymap.c +++ /dev/null @@ -1,104 +0,0 @@ -#include "chocopad.h" - -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 - -// Fillers to make layering more clear -#define KC_ KC_TRNS -#define KC_XX KC_NO - -#define KC_L1 LT(1, KC_P0) -#define KC_L2 LT(2, KC_SPC) -#define KC_RST RESET -#define KC_BSTP BL_STEP -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD -#define KC_MAC1 ADMIN -#define KC_MAC2 SMSPC -#define KC_M192 M192 -#define KC_M255 M255 - -enum custom_keycodes { - NUMPAD = SAFE_RANGE, - ADMIN, - SMSPC, - M192, - M255 -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_BASE] = KC_KEYMAP( - //,----+----+----+----. - P7 , P8 , P9 ,BSPC, - //|----+----+----+----| - P4 , P5 , P6 ,TAB , - //|----+----+----+----| - P1 , P2 , P3 ,PENT, - //|----+----+----+----| - L1 , L2 ,PDOT,PSLS - //`----+----+----+----' - ), - - [_FN1] = KC_KEYMAP( - //,----+----+----+----. - ESC ,MAC1,MAC2,DEL , - //|----+----+----+----| - LEFT,DOWN, UP ,RGHT, - //|----+----+----+----| - M192,M255, XX , XX , - //|----+----+----+----| - , XX , , XX - //`----+----+----+----' - ), - - [_FN2] = KC_KEYMAP( - //,----+----+----+----. - RST , XX , XX , XX , - //|----+----+----+----| - RTOG,RHUI,RSAI,RVAI, - //|----+----+----+----| - RMOD,RHUD,RSAD,RVAD, - //|----+----+----+----| - BSTP, , XX , XX - //`----+----+----+----' - ) - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case ADMIN: - if (record->event.pressed) { - SEND_STRING("Administrator"); - } - return false; - break; - case SMSPC: - if (record->event.pressed) { - SEND_STRING("Simspace1!"); - } - return false; - break; - case M192: - if (record->event.pressed) { - SEND_STRING("192.168."); - } - return false; - break; - case M255: - if (record->event.pressed) { - SEND_STRING("255"); - } - return false; - break; - } - return true; -}; diff --git a/keyboards/chocopad/keymaps/khord/rules.mk b/keyboards/chocopad/keymaps/khord/rules.mk deleted file mode 100644 index 1e576127880..00000000000 --- a/keyboards/chocopad/keymaps/khord/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/christmas_tree/config.h b/keyboards/christmas_tree/config.h index 4929f0ef50d..66fccebdb9c 100644 --- a/keyboards/christmas_tree/config.h +++ b/keyboards/christmas_tree/config.h @@ -48,16 +48,11 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #endif diff --git a/keyboards/christmas_tree/keymaps/default/config.h b/keyboards/christmas_tree/keymaps/default/config.h index 4553e621ddf..271f48d0011 100644 --- a/keyboards/christmas_tree/keymaps/default/config.h +++ b/keyboards/christmas_tree/keymaps/default/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif \ No newline at end of file +// place overrides here diff --git a/keyboards/christmas_tree/keymaps/default/keymap.c b/keyboards/christmas_tree/keymaps/default/keymap.c index 7880fd62547..6621201996b 100644 --- a/keyboards/christmas_tree/keymaps/default/keymap.c +++ b/keyboards/christmas_tree/keymaps/default/keymap.c @@ -28,8 +28,6 @@ enum custom_keycodes { BACKLIT }; -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base @@ -82,4 +80,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/christmas_tree/keymaps/default/rules.mk b/keyboards/christmas_tree/keymaps/default/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/christmas_tree/keymaps/default/rules.mk +++ b/keyboards/christmas_tree/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/christmas_tree/readme.md b/keyboards/christmas_tree/readme.md index e0252328dce..b3337dd5ba6 100644 --- a/keyboards/christmas_tree/readme.md +++ b/keyboards/christmas_tree/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make christmas_tree/V2017:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/christmas_tree/rules.mk b/keyboards/christmas_tree/rules.mk index 741747ecac5..ec73e527b56 100644 --- a/keyboards/christmas_tree/rules.mk +++ b/keyboards/christmas_tree/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/ckeys/handwire_101/config.h b/keyboards/ckeys/handwire_101/config.h new file mode 100755 index 00000000000..3dc99319ed0 --- /dev/null +++ b/keyboards/ckeys/handwire_101/config.h @@ -0,0 +1,191 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ckeys_handwire +#define PRODUCT ckeys_handwire +#define DESCRIPTION 4x4 handwire workshop board + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { D4, C6, D7, E6 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +//#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +//#define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +// Audio Click +#define AUDIO_CLICKY + +// Music Mode Polyphony +// NOTE: Must change polyphony_rate to a number higher than 0 in voices.c +#define AUDIO_VOICES +#define PITCH_STANDARD_A 880.0f + +// Mouse keys +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 2 +#define MOUSEKEY_TIME_TO_MAX 5 +#define MOUSEKEY_WHEEL_DELAY 0 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/ckeys/handwire_101/handwire_101.c b/keyboards/ckeys/handwire_101/handwire_101.c new file mode 100755 index 00000000000..a6ff8f0e3d0 --- /dev/null +++ b/keyboards/ckeys/handwire_101/handwire_101.c @@ -0,0 +1,28 @@ +#include "handwire_101.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + // Turn status LED on + //DDRD |= (1<<6); + //PORTD |= (1<<6); + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} diff --git a/keyboards/ckeys/handwire_101/handwire_101.h b/keyboards/ckeys/handwire_101/handwire_101.h new file mode 100755 index 00000000000..0f0309c3245 --- /dev/null +++ b/keyboards/ckeys/handwire_101/handwire_101.h @@ -0,0 +1,21 @@ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, k23, \ + k30, k31, k32, k33 \ +) \ +{ \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, k23 }, \ + { k30, k31, k32, k33 } \ +} + diff --git a/keyboards/ckeys/handwire_101/info.json b/keyboards/ckeys/handwire_101/info.json new file mode 100644 index 00000000000..dfe6c483046 --- /dev/null +++ b/keyboards/ckeys/handwire_101/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "cKeys Handwire 101", + "url": "https://ckeys.org/slides/handwire/", + "maintainer": "brandenbyers", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "key_count": 16, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}] + } + } +} diff --git a/keyboards/ckeys/handwire_101/keymaps/default/config.h b/keyboards/ckeys/handwire_101/keymaps/default/config.h new file mode 100755 index 00000000000..9935accb02d --- /dev/null +++ b/keyboards/ckeys/handwire_101/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +// Add overrides here diff --git a/keyboards/ckeys/handwire_101/keymaps/default/keymap.c b/keyboards/ckeys/handwire_101/keymaps/default/keymap.c new file mode 100755 index 00000000000..383b3355dec --- /dev/null +++ b/keyboards/ckeys/handwire_101/keymaps/default/keymap.c @@ -0,0 +1,178 @@ +#include QMK_KEYBOARD_H + +enum layers { + _BASE, // base layer + _LAYERS, // layer of all layers + _MUSIC, // music mode + _MUSIC_4_LIFE, // music mode until unplugged + _MOUSE, // mousekeys + _TERMINAL, // terminal + _ADMIN // admin duties +}; + +enum custom_keycodes { + TERM_ABOUT = SAFE_RANGE, + TERM_PRINT, + TERM_FLUSH, + TERM_HELP, + CKEYS_ABOUT, +}; + +extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* BASE (numpad) + * ,-----------------------. + * | 7 | 8 | 9 | / | <-- Hold for LAYERS + * |-----+-----+-----+-----| + * | 4 | 5 | 6 | * | + * |-----+-----+-----+-----| + * | 1 | 2 | 3 | - | + * |-----+-----+-----+-----| + * | 0 | . | = | + | + * `---------------------- ' + */ + [_BASE] = LAYOUT( + KC_KP_7, KC_KP_8, KC_KP_9, LT(MO(_LAYERS), KC_PSLS), \ + KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, \ + KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, \ + KC_KP_0, KC_KP_DOT, KC_KP_EQUAL, KC_PPLS \ + ), + /* LAYERS + * ,---------------------------. + * | MUSIC | | | X | + * |---------+-----+-----+-----| + * | MOUSE | | | | + * |---------+-----+-----+-----| + * |TERMINAL | | | | + * |---------+-----+-----+-----| + * | ADMIN | | | | + * `---------------------------' + */ + [_LAYERS] = LAYOUT( + TG(_MUSIC), _______, _______, _______, \ + TG(_MOUSE), _______, _______, _______, \ + TG(_TERMINAL), _______, _______, _______, \ + TG(_ADMIN), _______, _______, _______\ + ), + /* MUSIC + * ,-----------------------. + * | X | | | X | + * |-----+-----+-----+-----| + * | | | |4EVER| + * |-----+-----+-----+-----| + * | OFF | | | | + * |-----+-----+-----+-----| + * | ON | | |MODES| + * `---------------------- ' + */ + // TODO: Make this music layer the one to jump to other music layers (different octaves) + [_MUSIC] = LAYOUT( + _______, _______, _______, _______, \ + _______, _______, _______, TG(_MUSIC_4_LIFE), \ + MU_OFF, _______, _______, _______, \ + MU_ON, _______, _______, MU_MOD \ + ), + /* MUSIC_4_LIFE + * ,-----------------------. + * | ♫ | ♫ | ♫ | ♫ | + * |-----+-----+-----+-----| + * | ♫ | ♫ | ♫ | ♫ | + * |-----+-----+-----+-----| + * | ♫ | ♫ | ♫ | ♫ | + * |-----+-----+-----+-----| + * | ♫ | ♫ | ♫ | ♫ | + * `---------------------- ' + */ + [_MUSIC_4_LIFE] = LAYOUT( + KC_M, KC_M, KC_M, KC_M, \ + KC_M, KC_M, KC_M, KC_M, \ + KC_M, KC_M, KC_M, KC_M, \ + KC_M, KC_M, KC_M, KC_M \ + ), + /* MOUSE + * ,-------------------------------------------------. + * | BUTTON 5 | | SCROLL UP | X | + * |-----------+-----------+------------+------------| + * | X |LEFT CLICK | UP |RIGHT CLICK | + * |-----------+-----------+------------+------------| + * | BUTTON 4 | LEFT | DOWN | RIGHT | + * |-----------+-----------+------------+------=-----| + * | BUTTON 3 |SCROLL LEFT|SCROLL DOWN |SCROLL RIGHT| + * `-------------------------------------------------' + */ + [_MOUSE] = LAYOUT( + KC_MS_BTN5, _______, KC_MS_WH_UP, _______, \ + _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, \ + KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, \ + KC_MS_BTN3, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_RIGHT \ + ), + /* TERMINAL + * ,---------------------------------------. + * | |ABOUT| | X | + * |------------+-----+----------+---------| + * |TERMINAL OFF|PRINT| | | + * |------------+-----+----------+---------| + * | X |FLUSH| | | + * |------------+-----+----------+---------| + * |TERMINAL ON |HELP | | | + * `--------=======------------------------' + */ + [_TERMINAL] = LAYOUT( + _______, TERM_ABOUT, _______, _______, \ + TERM_OFF, TERM_PRINT, _______, _______, \ + _______, TERM_FLUSH, _______, _______, \ + TERM_ON, TERM_HELP , _______, _______\ + ), + /* ADMIN + * ,-----------------------------------------. + * | RESET | | | X | + * |------------+-----+-----------+----------| + * |ABOUT CKEYS | | | | + * |------------+-----+-----------+----------| + * | | |CLICKY UP |CLICKY OFF| + * |------------+-----+-----------+----------| + * | X | |CLICKY DOWN|CLICKY ON | + * `-----------------------------------------' + */ + [_ADMIN] = LAYOUT( + RESET, _______, _______, _______, \ + CKEYS_ABOUT, _______, _______, _______, \ + _______, _______, _______, CK_OFF, \ + _______, _______, _______, CK_ON \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case TERM_ABOUT: + if (record->event.pressed) { + // when keycode TERM_ABOUT is pressed + SEND_STRING("about"SS_TAP(X_ENTER)); + } else { + // when keycode TERM_ABOUT is released + } + break; + case TERM_PRINT: + if (record->event.pressed) { + SEND_STRING("print"SS_TAP(X_ENTER)); + } else { } + break; + case TERM_FLUSH: + if (record->event.pressed) { + SEND_STRING("flush"SS_TAP(X_ENTER)); + } else { } + break; + case TERM_HELP: + if (record->event.pressed) { + SEND_STRING("help"SS_TAP(X_ENTER)); + } else { } + break; + case CKEYS_ABOUT: + if (record->event.pressed) { + SEND_STRING("https://cKeys.org"SS_TAP(X_ENTER)"Making people smile one keyboard at a time."SS_TAP(X_ENTER)"cKeys is a volunteer-run 501(c)(3) nonprofit organization."SS_TAP(X_ENTER)); + } else { } + break; + } + return true; +}; diff --git a/keyboards/ckeys/handwire_101/keymaps/default/readme.md b/keyboards/ckeys/handwire_101/keymaps/default/readme.md new file mode 100755 index 00000000000..4594bdfe317 --- /dev/null +++ b/keyboards/ckeys/handwire_101/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for the cKeys Handwire 101 4x4 keyboard. \ No newline at end of file diff --git a/keyboards/ckeys/handwire_101/readme.md b/keyboards/ckeys/handwire_101/readme.md new file mode 100755 index 00000000000..cf20dab60b7 --- /dev/null +++ b/keyboards/ckeys/handwire_101/readme.md @@ -0,0 +1,163 @@ +# cKeys Handwire 101 Workshop + +![](https://ckeys.org/images/proton-c-handwire-1.jpg) + +## Slides + +Slides can be found at: https://ckeys.org/slides/handwire/ + +## Case Design + +The laser cutting file is ideal for Ponoko's P1 board size. + +## Firmware + +If you want to reflash the pre-installed firmware, use the `.bin` file for Proton C and the `.hex` file for Pro Micro builds. Flash with the QMK Toolbox or via the command line. + +Building for Proton C: `make ckeys/handwire_101:default CTPC=yes` +Building for Pro Micro: `make ckeys/handwire_101:default` + +Pre-built firmware files (and laser cutting case files) can be found here: https://github.com/c-keys/handwire + +## Default Layout + +You can find the default layout in `qmk-handwire/keymaps/default/keymap.c` + +### Layers + +When you plug in your keyboard, it will function as a numpad. You will remain in the `Base` numpad layer unless you hold down the top right corner key and select one of the keys in the left most column. In QMK, this is called a momentary switch and looks like `MO(LAYERS)` in the default `keymap.c`. You can read more about layer switching in the [QMK Documentation](https://beta.docs.qmk.fm/features/feature_advanced_keycodes#switching-and-toggling-layers). + +#### Base +``` + /* BASE (numpad) + * ,-----------------------. + * | 7 | 8 | 9 | / | <-- Hold for LAYERS + * |-----+-----+-----+-----| + * | 4 | 5 | 6 | * | + * |-----+-----+-----+-----| + * | 1 | 2 | 3 | - | + * |-----+-----+-----+-----| + * | 0 | . | = | + | + * `---------------------- ' + */ +``` + +#### Layers + +``` + /* LAYERS + * ,---------------------------. + * | MUSIC | | | X | + * |---------+-----+-----+-----| + * | MOUSE | | | | + * |---------+-----+-----+-----| + * |TERMINAL | | | | + * |---------+-----+-----+-----| + * | ADMIN | | | | + * `---------------------------' + */ +``` + +This is the layers layer. This is how you toggle other layers on and off. If you toggle on a layer, it is important that you re-toggle that layer offbefore switching to a new layer. + +#### Music + +``` + /* MUSIC + * ,-----------------------. + * | X | | | X | + * |-----+-----+-----+-----| + * | | | |4EVER| + * |-----+-----+-----+-----| + * | OFF | | | | + * |-----+-----+-----+-----| + * | ON | | |MODES| + * `---------------------- ' + */ +``` + +You can toggle the music mode on and off. You can also change the mode of music modes. Lastly, you can switch to the Music 4 Life mode but tapping the key marked `4EVER` above (see below). For more information on music mode, see the [QMK Documentation](https://beta.docs.qmk.fm/features/feature_audio). + +_NOTE: This layer will only make sounds if you install a speaker. At the time of this writing, you can get the Proton C specific piezo speaker for [$2.61 with free overnight shipping](https://www.arrow.com/en/products/ast1109mltrq/mallory-sonalert-products). You can solder it on by desoldering the row wires where they contact the cathode end of the diodes. Then flip over the Proton C and solder the piezo speaker in. Then re-solder the row wires and you should hear beeps and boops the next time you plug in your keyboard._ + +#### Music 4 Life + +``` + /* MUSIC_4_LIFE + * ,-----------------------. + * | ♫ | ♫ | ♫ | ♫ | + * |-----+-----+-----+-----| + * | ♫ | ♫ | ♫ | ♫ | + * |-----+-----+-----+-----| + * | ♫ | ♫ | ♫ | ♫ | + * |-----+-----+-----+-----| + * | ♫ | ♫ | ♫ | ♫ | + * `---------------------- ' + */ +``` + +Music mode on every single key. However, you will need to unplug your keyboard in order to get out of this mode. The benefit of this is that you can use every single key as opposed to the few left over in the Music Mode layer. Try changing the chromatic mode before switching to this mode. + +#### Mouse + +``` + /* MOUSE + * ,-------------------------------------------------. + * | BUTTON 5 | | SCROLL UP | X | + * |-----------+-----------+------------+------------| + * | X |LEFT CLICK | UP |RIGHT CLICK | + * |-----------+-----------+------------+------------| + * | BUTTON 4 | LEFT | DOWN | RIGHT | + * |-----------+-----------+------------+------=-----| + * | BUTTON 3 |SCROLL LEFT|SCROLL DOWN |SCROLL RIGHT| + * `-------------------------------------------------' + */ +``` + +Switch to this mode, force yourself through the steep transitionary period, and then you can ditch mice and trackpads forever! + +#### Terminal + +``` + /* TERMINAL + * ,---------------------------------------. + * | |ABOUT| | X | + * |------------+-----+----------+---------| + * |TERMINAL OFF|PRINT| | | + * |------------+-----+----------+---------| + * | X |FLUSH| | | + * |------------+-----+----------+---------| + * |TERMINAL ON |HELP | | | + * `--------=======------------------------' + */ +``` + +This layer is not currently working but has been left as an example of how to write macros. + +#### Admin + +``` + /* ADMIN + * ,-----------------------------------------. + * | RESET | | | X | + * |------------+-----+-----------+----------| + * |ABOUT CKEYS | | | | + * |------------+-----+-----------+----------| + * | | |CLICKY UP |CLICKY OFF| + * |------------+-----+-----------+----------| + * | X | |CLICKY DOWN|CLICKY ON | + * `-----------------------------------------' + */ +``` + +The most important key in this layer is the `RESET` switch. Use it to flash new firmware. It does the same thing as the hardware button on the Proton C. But since you soldered the Proton C with the reset button facing towards the keys, the only way to reach it is to de-solder wires. The reset switch solves this. Program a reset switch into all of your future keyboards. + +The `ABOUT CKEYS` is another example of using a macro. It will type out a few sentences about cKeys. + +The clicky buttons will only make a difference if you install a piezo speaker. If you install a speaker, then you can make your keyboard extra clicky sounding even if you did not install clicky switches. + +![](https://ckeys.org/images/proton-c-handwire-2.jpg) +![](https://ckeys.org/images/proton-c-handwire-3.jpg) +![](https://ckeys.org/images/handwire-1.jpg) +![](https://ckeys.org/images/handwire-2.jpg) +![](https://ckeys.org/images/handwire-3.jpg) diff --git a/keyboards/ckeys/handwire_101/rules.mk b/keyboards/ckeys/handwire_101/rules.mk new file mode 100755 index 00000000000..cf904d93c34 --- /dev/null +++ b/keyboards/ckeys/handwire_101/rules.mk @@ -0,0 +1,68 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = caterina + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +TERMINAL_ENABLE = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +#MIDI_ENABLE = yes # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = yes # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/ckeys/nakey/config.h b/keyboards/ckeys/nakey/config.h index 38fed297efb..add3a352213 100644 --- a/keyboards/ckeys/nakey/config.h +++ b/keyboards/ckeys/nakey/config.h @@ -46,16 +46,15 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B0, B1, B2, B3 } #define UNUSED_PINS { D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, B4, B5, B6, B7 } -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -105,11 +104,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/ckeys/nakey/keymaps/default/keymap.c b/keyboards/ckeys/nakey/keymaps/default/keymap.c index 9c3e45b9461..be147b2d88c 100644 --- a/keyboards/ckeys/nakey/keymaps/default/keymap.c +++ b/keyboards/ckeys/nakey/keymaps/default/keymap.c @@ -25,25 +25,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/ckeys/nakey/readme.md b/keyboards/ckeys/nakey/readme.md index c7250cf5064..b85e822abdf 100644 --- a/keyboards/ckeys/nakey/readme.md +++ b/keyboards/ckeys/nakey/readme.md @@ -12,7 +12,7 @@ Make example for this keyboard (after setting up your build environment): make ckeys/nakey:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Quantum MK Firmware diff --git a/keyboards/ckeys/nakey/rules.mk b/keyboards/ckeys/nakey/rules.mk index 36b2193aae8..4ba89cee4d6 100644 --- a/keyboards/ckeys/nakey/rules.mk +++ b/keyboards/ckeys/nakey/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/ckeys/obelus/config.h b/keyboards/ckeys/obelus/config.h index a1451c1420e..4d7afc4f52e 100644 --- a/keyboards/ckeys/obelus/config.h +++ b/keyboards/ckeys/obelus/config.h @@ -46,16 +46,15 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F0, F1, B2, B3 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/ckeys/obelus/keymaps/default/config.h b/keyboards/ckeys/obelus/keymaps/default/config.h index 04bf9f4a9d3..271f48d0011 100644 --- a/keyboards/ckeys/obelus/keymaps/default/config.h +++ b/keyboards/ckeys/obelus/keymaps/default/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" -// Add overrides here -#endif +// place overrides here diff --git a/keyboards/ckeys/obelus/keymaps/default/keymap.c b/keyboards/ckeys/obelus/keymaps/default/keymap.c index bdad1cacab1..f71ac562766 100644 --- a/keyboards/ckeys/obelus/keymaps/default/keymap.c +++ b/keyboards/ckeys/obelus/keymaps/default/keymap.c @@ -1,7 +1,4 @@ #include QMK_KEYBOARD_H -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif extern keymap_config_t keymap_config; diff --git a/keyboards/ckeys/obelus/readme.md b/keyboards/ckeys/obelus/readme.md index 6767956bf9b..640e0f55e41 100644 --- a/keyboards/ckeys/obelus/readme.md +++ b/keyboards/ckeys/obelus/readme.md @@ -15,5 +15,5 @@ Or to make and flash: make ckeys/obelus:default:dfu -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) and [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/ckeys/obelus/rules.mk b/keyboards/ckeys/obelus/rules.mk index f40610ee952..7b556b23c00 100644 --- a/keyboards/ckeys/obelus/rules.mk +++ b/keyboards/ckeys/obelus/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/ckeys/readme.md b/keyboards/ckeys/readme.md index 01991d9e3fe..bdcf5b34d84 100644 --- a/keyboards/ckeys/readme.md +++ b/keyboards/ckeys/readme.md @@ -1,9 +1,10 @@ -# Ckeys.org +# cKeys.org -[ckeys](https://ckeys.org/) is a mechanical keyboard based non profit, located in Seattle, Washington. +[cKeys](https://ckeys.org/) is a mechanical keyboard-based nonprofit organization located in Seattle, Washington. -In addition, to hosting the [Seattle Mechanical Keyboard Meetups](https://ckeys.org/events/), they have [soldering workshops](https://ckeys.org/workshops/) featuring hardware hosted in this repository. +In addition, to hosting the [Seattle Mechanical Keyboard Meetups](https://ckeys.org/events/), they have [soldering workshops](https://ckeys.org/workshops/) featuring hardware hosted in this repository. * Supported Hardware - * The Obelus - 4x4 Macropad - * naKey - Through hole numpad \ No newline at end of file + * The Obelus - 4x4 Macropad + * naKey - Through hole numpad + * Handwire 101 - Handwired 4x4 (Proton C or Pro Micro) diff --git a/keyboards/claw44/claw44.c b/keyboards/claw44/claw44.c new file mode 100644 index 00000000000..f564fb623b8 --- /dev/null +++ b/keyboards/claw44/claw44.c @@ -0,0 +1,10 @@ +#include "claw44.h" +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { +#ifdef SSD1306OLED + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +#else + return process_record_user(keycode, record); +#endif +} diff --git a/keyboards/claw44/claw44.h b/keyboards/claw44/claw44.h new file mode 100644 index 00000000000..4ca25fcb2b1 --- /dev/null +++ b/keyboards/claw44/claw44.h @@ -0,0 +1,5 @@ +#pragma once + +#ifdef KEYBOARD_claw44_rev1 + #include "rev1.h" +#endif diff --git a/keyboards/claw44/config.h b/keyboards/claw44/config.h new file mode 100644 index 00000000000..fb1cdf3962a --- /dev/null +++ b/keyboards/claw44/config.h @@ -0,0 +1,28 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" +#include + +#define USE_I2C +#define USE_SERIAL + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/claw44/i2c.c b/keyboards/claw44/i2c.c new file mode 100644 index 00000000000..4bee5c63982 --- /dev/null +++ b/keyboards/claw44/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); diff --git a/keyboards/claw44/keymaps/default/config.h b/keyboards/claw44/keymaps/default/config.h new file mode 100644 index 00000000000..eff6ad3c7ba --- /dev/null +++ b/keyboards/claw44/keymaps/default/config.h @@ -0,0 +1,35 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_TERM 200 diff --git a/keyboards/claw44/keymaps/default/keymap.c b/keyboards/claw44/keymaps/default/keymap.c new file mode 100644 index 00000000000..c346571255f --- /dev/null +++ b/keyboards/claw44/keymaps/default/keymap.c @@ -0,0 +1,169 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +#define KC_ KC_TRNS +#define KC_RST RESET +#define KC_L_SPC LT(_LOWER, KC_SPC) // lower +#define KC_R_ENT LT(_RAISE, KC_ENT) // raise +#define KC_G_JA LGUI_T(KC_LANG1) // cmd or win +#define KC_G_EN LGUI_T(KC_LANG2) // cmd or win +#define KC_C_BS LCTL_T(KC_BSPC) // ctrl +#define KC_A_DEL ALT_T(KC_DEL) // alt + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( \ + //,--------+--------+---------+--------+---------+--------. ,--------+---------+--------+---------+--------+--------. + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_MINS, + //|--------+--------+---------+--------+---------+--------| |--------+---------+--------+---------+--------+--------| + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, + //|--------+--------+---------+--------+---------+--------| |--------+---------+--------+---------+--------+--------| + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, + //`--------+--------+---------+--------+---------+--------/ \--------+---------+--------+---------+--------+--------' + KC_A_DEL, KC_G_EN, KC_L_SPC, KC_C_BS, KC_C_BS, KC_R_ENT, KC_G_JA, KC_A_DEL + // `----------+--------+---------+--------' `--------+---------+--------+---------' + ), + + // \ ^ ! & | @ = + * % - + // ( # $ " ' ~ ← ↓ ↑ → ` ) + // { [ ] } + + [_RAISE] = LAYOUT( \ + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, KC_BSLS, KC_CIRC, KC_EXLM, KC_AMPR, KC_PIPE, KC_AT , KC_EQL , KC_PLUS, KC_ASTR, KC_PERC, KC_MINS, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LPRN, KC_HASH, KC_DLR , KC_DQT , KC_QUOT, KC_TILD, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, KC_GRV , KC_RPRN, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, KC_LCBR, KC_LBRC, KC_RBRC, KC_RCBR, _______, _______, _______, _______, + //`--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------' + _______, _______, _______, _______, _______, _______, _______, RESET + // `--------+--------+--------+--------' `--------+--------+--------+--------' + ), + + [_LOWER] = LAYOUT( \ + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , _______, KC_EQL , KC_PLUS, KC_ASTR, KC_PERC, KC_MINS, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______, _______, KC_COMM, KC_DOT , KC_SLSH, _______, + //`--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------' + RESET , _______, _______, _______, _______, _______, _______, _______ + // `--------+--------+--------+--------' `--------+--------+--------+--------' + ), +}; + +void matrix_init_user(void) { + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + } + return true; +} diff --git a/keyboards/claw44/keymaps/yfuku/config.h b/keyboards/claw44/keymaps/yfuku/config.h new file mode 100644 index 00000000000..244ffa7096d --- /dev/null +++ b/keyboards/claw44/keymaps/yfuku/config.h @@ -0,0 +1,36 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_TERM 180 +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/claw44/keymaps/yfuku/keymap.c b/keyboards/claw44/keymaps/yfuku/keymap.c new file mode 100644 index 00000000000..77d459b928d --- /dev/null +++ b/keyboards/claw44/keymaps/yfuku/keymap.c @@ -0,0 +1,221 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +// common +#define KC_ KC_TRNS +#define KC_XXXX KC_NO +#define KC_RST RESET +#define KC_VD KC__VOLDOWN +#define KC_VU KC__VOLUP + +// layer +#define KC_L_SPC LT(_LOWER, KC_SPC) +#define KC_R_ENT LT(_RAISE, KC_ENT) + +// shift_t +#define KC_S_TAB LSFT_T(KC_TAB) +#define KC_S_ESC LSFT_T(KC_ESC) +#define KC_S_JA LSFT_T(KC_LANG1) +#define KC_S_EN LSFT_T(KC_LANG2) + +// cmd_t +#define KC_M_F LCMD_T(KC_F) +#define KC_M_D LCMD_T(KC_D) +#define KC_M_J LCMD_T(KC_J) +#define KC_M_K LCMD_T(KC_K) + +// ctl_t +#define KC_C_S LCTL_T(KC_S) +#define KC_C_L LCTL_T(KC_L) +#define KC_C_BS LCTL_T(KC_BSPC) + +// alt_t +#define KC_A_D ALT_T(KC_D) +#define KC_A_K ALT_T(KC_K) +#define KC_A_Z ALT_T(KC_Z) +#define KC_A_SL ALT_T(KC_SLSH) +#define KC_A_DEL ALT_T(KC_DEL) + +// cmd+shift_t +#define KC_MS_Q SCMD_T(KC_Q) +#define KC_MS_A SCMD_T(KC_A) +#define KC_MS_S SCMD_T(KC_S) +#define KC_MS_SC SCMD_T(KC_SCLN) +#define KC_MS_ESC SCMD_T(KC_ESC) + +// +#define KC_MR RCMD(KC_R) +#define KC_MF RCMD(KC_F) +#define KC_MW RCMD(KC_W) +#define KC_MX RCMD(KC_X) +#define KC_MC RCMD(KC_C) +#define KC_MV RCMD(KC_V) +#define KC_MTAB RCMD(KC_TAB) +#define KC_MSF RCMD(RSFT(KC_F)) +#define KC_MSR RCMD(RSFT(KC_R)) +#define KC_MST RCMD(RSFT(KC_T)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // M_ = LCMD_T( + // A_ = ALT_T( + // C_ = LCTL_T( + // MS_ = SMD_T( + // R_ = LT(_RAISE + // L_ = LT(_LOWER + + [_QWERTY] = LAYOUT_kc( \ + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , Q , W , E , R , T , Y , U , I , O , P ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + S_TAB, A ,C_S , D ,M_F , G , H ,M_J , K ,C_L ,SCLN,S_ESC, + //|----+----+----+----+----+----+ |----+----+----+----+----+----| + , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, , + //`----+----+----+----+----+----/ \----+----+----+----+----+----' + A_DEL,S_EN,L_SPC,C_BS, C_BS,R_ENT,S_JA,A_DEL + // `----+----+----+----' `----+----+----+----' + ), + + // \ ^ ! & | @ = + * % - + // ( # $ " ' ~ ← ↓ ↑ → ` ) + // { [ ] } + + [_RAISE] = LAYOUT_kc( \ + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ,BSLS,CIRC,EXLM,AMPR,PIPE, AT ,EQL ,PLUS,ASTR,PERC,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LPRN,HASH,DLR ,DQT ,QUOT,TILD, LEFT,DOWN, UP ,RGHT,GRV ,RPRN, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , ,LCBR,LBRC, RBRC,RCBR, , , , , + //`----+----+----+----+----+----/ \----+----+----+----+----+----' + , ,BSPC, , , , ,RST + // `----+----+----+----' `----+----+----+----' + ), + + [_LOWER] = LAYOUT_kc( \ + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , ,MSF ,MSR ,MST , ,EQL ,PLUS,ASTR,PERC,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , ,COMM,DOT ,SLSH, , + //`----+----+----+--+-+----+----/ \----+----+----+----+----+----' + RST , , , , ,DEL , , + // `----+----+----+----' `----+----+----+----' + ), +}; + +void matrix_init_user(void) { + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + } + return true; +} + diff --git a/keyboards/claw44/lib/glcdfont.c b/keyboards/claw44/lib/glcdfont.c new file mode 100644 index 00000000000..91f53d9c24e --- /dev/null +++ b/keyboards/claw44/lib/glcdfont.c @@ -0,0 +1,243 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font +const unsigned char font[] PROGMEM = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, +0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, +0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, +0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, +0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, +0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, +0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, +0x00, 0x18, 0x24, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, +0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, +0x26, 0x29, 0x79, 0x29, 0x26, 0x00, +0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, +0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, +0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, +0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, +0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, +0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, +0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, +0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, +0x60, 0x60, 0x60, 0x60, 0x60, 0x00, +0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, +0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, +0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, +0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, +0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, +0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, +0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, +0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, +0x00, 0x07, 0x00, 0x07, 0x00, 0x00, +0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, +0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, +0x23, 0x13, 0x08, 0x64, 0x62, 0x00, +0x36, 0x49, 0x56, 0x20, 0x50, 0x00, +0x00, 0x08, 0x07, 0x03, 0x00, 0x00, +0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, +0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, +0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, +0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, +0x00, 0x80, 0x70, 0x30, 0x00, 0x00, +0x08, 0x08, 0x08, 0x08, 0x08, 0x00, +0x00, 0x00, 0x60, 0x60, 0x00, 0x00, +0x20, 0x10, 0x08, 0x04, 0x02, 0x00, +0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, +0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, +0x72, 0x49, 0x49, 0x49, 0x46, 0x00, +0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, +0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, +0x27, 0x45, 0x45, 0x45, 0x39, 0x00, +0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, +0x41, 0x21, 0x11, 0x09, 0x07, 0x00, +0x36, 0x49, 0x49, 0x49, 0x36, 0x00, +0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, +0x00, 0x00, 0x14, 0x00, 0x00, 0x00, +0x00, 0x40, 0x34, 0x00, 0x00, 0x00, +0x00, 0x08, 0x14, 0x22, 0x41, 0x00, +0x14, 0x14, 0x14, 0x14, 0x14, 0x00, +0x00, 0x41, 0x22, 0x14, 0x08, 0x00, +0x02, 0x01, 0x59, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, +0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, +0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, +0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, +0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, +0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, +0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, +0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, +0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, +0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, +0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, +0x26, 0x49, 0x49, 0x49, 0x32, 0x00, +0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, +0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, +0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, +0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, +0x63, 0x14, 0x08, 0x14, 0x63, 0x00, +0x03, 0x04, 0x78, 0x04, 0x03, 0x00, +0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, +0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, +0x04, 0x02, 0x01, 0x02, 0x04, 0x00, +0x40, 0x40, 0x40, 0x40, 0x40, 0x00, +0x00, 0x03, 0x07, 0x08, 0x00, 0x00, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, +0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, +0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, +0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, +0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, +0x48, 0x54, 0x54, 0x54, 0x24, 0x00, +0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, +0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, +0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, +0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, +0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, +0x00, 0x08, 0x36, 0x41, 0x00, 0x00, +0x00, 0x00, 0x77, 0x00, 0x00, 0x00, +0x00, 0x41, 0x36, 0x08, 0x00, 0x00, +0x02, 0x01, 0x02, 0x04, 0x02, 0x00, +0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0xFC, 0xFC, 0xFC, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xC0, 0xF0, 0xF8, 0xF8, + 0xF8, 0xF8, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xE0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, +0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, +0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, +0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, +0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, +0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, +0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, + 0xFF, 0x1F, 0x07, 0x07, 0x07, 0x07, + 0x1F, 0x1F, 0x1F, 0x1E, 0x18, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0x00, 0x00, 0x9E, 0xDF, 0xDF, + 0xCF, 0xC7, 0xE7, 0xE7, 0xE7, 0xFF, + 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x03, + 0x3F, 0xFF, 0xFF, 0xFE, 0xC0, 0x00, + 0xF0, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, + 0xF0, 0x00, 0xC0, 0xFC, 0xFF, 0xFF, + 0x3F, 0x03, 0x00, 0xC0, 0xF0, 0xF8, + 0xFE, 0x9F, 0x87, 0x83, 0x80, 0xFF, + 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x00, + 0x00, 0xE0, 0xF8, 0xFC, 0xBF, 0x8F, + 0x83, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, + 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, +0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, +0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, +0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, +0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, +0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x1F, 0x3F, + 0x7F, 0x7C, 0x78, 0x70, 0x70, 0x78, + 0x7E, 0x3E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x00, 0x1F, 0x3F, 0x7F, 0x7F, + 0x79, 0x71, 0x70, 0x30, 0x38, 0x3F, + 0x7F, 0x7F, 0x7F, 0x60, 0x00, 0x00, + 0x00, 0x01, 0x1F, 0x7F, 0x7F, 0x7E, + 0x7F, 0x1F, 0x01, 0x00, 0x01, 0x3F, + 0x7F, 0x7E, 0x7F, 0x7F, 0x0F, 0x01, + 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x7F, + 0x7F, 0x7F, 0x7F, 0x03, 0x03, 0x00, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x7F, 0x7F, 0x7F, 0x7F, + 0x07, 0x03, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +#endif // FONT5X7_H diff --git a/keyboards/claw44/lib/host_led_state_reader.c b/keyboards/claw44/lib/host_led_state_reader.c new file mode 100644 index 00000000000..980823b318c --- /dev/null +++ b/keyboards/claw44/lib/host_led_state_reader.c @@ -0,0 +1,15 @@ +#include +#include "claw44.h" + +char host_led_state_str[24]; + +const char *read_host_led_state(void) +{ + uint8_t leds = host_keyboard_leds(); + snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", + (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "); + + return host_led_state_str; +} diff --git a/keyboards/claw44/lib/keylogger.c b/keyboards/claw44/lib/keylogger.c new file mode 100644 index 00000000000..092b6929bc2 --- /dev/null +++ b/keyboards/claw44/lib/keylogger.c @@ -0,0 +1,45 @@ +#include +#include "claw44.h" + +char keylog_str[24] = {}; +char keylogs_str[21] = {}; +int keylogs_str_idx = 0; + +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void set_keylog(uint16_t keycode, keyrecord_t *record) { + char name = ' '; + if (keycode < 60) { + name = code_to_name[keycode]; + } + + // update keylog + snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", + record->event.key.row, record->event.key.col, + keycode, name); + + // update keylogs + if (keylogs_str_idx == sizeof(keylogs_str) - 1) { + keylogs_str_idx = 0; + for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { + keylogs_str[i] = ' '; + } + } + + keylogs_str[keylogs_str_idx] = name; + keylogs_str_idx++; +} + +const char *read_keylog(void) { + return keylog_str; +} + +const char *read_keylogs(void) { + return keylogs_str; +} diff --git a/keyboards/claw44/lib/layer_state_reader.c b/keyboards/claw44/lib/layer_state_reader.c new file mode 100644 index 00000000000..d92b6df5827 --- /dev/null +++ b/keyboards/claw44/lib/layer_state_reader.c @@ -0,0 +1,35 @@ + +#include QMK_KEYBOARD_H +#include +#include "claw44.h" + +#define L_BASE 0 +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +char layer_state_str[24]; + +const char *read_layer_state(void) { + switch (layer_state) + { + case L_BASE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default"); + break; + case L_RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case L_LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case L_ADJUST: + case L_ADJUST_TRI: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); + } + + return layer_state_str; +} diff --git a/keyboards/claw44/lib/logo_reader.c b/keyboards/claw44/lib/logo_reader.c new file mode 100644 index 00000000000..b5b437b2b89 --- /dev/null +++ b/keyboards/claw44/lib/logo_reader.c @@ -0,0 +1,11 @@ +#include "claw44.h" + +const char *read_logo(void) { + static char logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0}; + + return logo; +} diff --git a/keyboards/claw44/lib/mode_icon_reader.c b/keyboards/claw44/lib/mode_icon_reader.c new file mode 100644 index 00000000000..a9272bb9a78 --- /dev/null +++ b/keyboards/claw44/lib/mode_icon_reader.c @@ -0,0 +1,15 @@ +#include +#include "claw44.h" + +char mode_icon[24]; + +const char *read_mode_icon(bool swap) { + static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; + if (swap == false) { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]); + } else { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]); + } + + return mode_icon; +} diff --git a/keyboards/claw44/lib/rgb_state_reader.c b/keyboards/claw44/lib/rgb_state_reader.c new file mode 100644 index 00000000000..e0efe2e5288 --- /dev/null +++ b/keyboards/claw44/lib/rgb_state_reader.c @@ -0,0 +1,15 @@ +#ifdef RGBLIGHT_ENABLE + +#include QMK_KEYBOARD_H +#include + +extern rgblight_config_t rgblight_config; +char rbf_info_str[24]; +const char *read_rgb_info(void) { + + snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d", + rgblight_config.enable ? "on" : "- ", rgblight_config.mode, + rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + return rbf_info_str; +} +#endif diff --git a/keyboards/claw44/lib/timelogger.c b/keyboards/claw44/lib/timelogger.c new file mode 100644 index 00000000000..ecd4ed3ea8c --- /dev/null +++ b/keyboards/claw44/lib/timelogger.c @@ -0,0 +1,16 @@ +#include +#include "claw44.h" + +char timelog_str[24] = {}; +int last_time = 0; +int elapsed_time = 0; + +void set_timelog(void) { + elapsed_time = timer_elapsed(last_time); + last_time = timer_read(); + snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); +} + +const char *read_timelog(void) { + return timelog_str; +} diff --git a/keyboards/claw44/readme.md b/keyboards/claw44/readme.md new file mode 100644 index 00000000000..7e72e089713 --- /dev/null +++ b/keyboards/claw44/readme.md @@ -0,0 +1,15 @@ +# Claw44 + +![Claw44](https://i.imgur.com/5a8iogl.jpg) + +A split keyboard with 3x6 vertically staggered keys and 4 thumb keys. + +Keyboard Maintainer: [@yfuku_](https://twitter.com/yfuku_) +Hardware Supported: Claw44 PCB, ProMicro +Hardware Availability: https://yfuku.booth.pm/ + +Make example for this keyboard (after setting up your build environment): + + make claw44:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/claw44/rev1/config.h b/keyboards/claw44/rev1/config.h new file mode 100644 index 00000000000..f3406fee5c3 --- /dev/null +++ b/keyboards/claw44/rev1/config.h @@ -0,0 +1,76 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER yfuku +#define PRODUCT claw44 +#define DESCRIPTION A split keyboard with 3x6 vertically staggered keys and 4 thumb keys + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 7 +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } + +// wiring of each half +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +/* +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 12 // Number of LEDs +*/ + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/claw44/rev1/matrix.c b/keyboards/claw44/rev1/matrix.c new file mode 100644 index 00000000000..718cc574481 --- /dev/null +++ b/keyboards/claw44/rev1/matrix.c @@ -0,0 +1,357 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "split_scomm.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + TXLED0; + RXLED0; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(int master_changed) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else + int ret=serial_update_buffers(); +#endif + if (ret ) { + if(ret==2) RXLED1; + return 1; + } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH); + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + int mchanged = 1; + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction(mchanged) ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif + for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif + serial_slave_buffer[i] = matrix[offset+i]; + } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/claw44/rev1/rev1.c b/keyboards/claw44/rev1/rev1.c new file mode 100644 index 00000000000..9529636f563 --- /dev/null +++ b/keyboards/claw44/rev1/rev1.c @@ -0,0 +1,8 @@ +#include "claw44.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif diff --git a/keyboards/claw44/rev1/rev1.h b/keyboards/claw44/rev1/rev1.h new file mode 100644 index 00000000000..f7ec2cbfe65 --- /dev/null +++ b/keyboards/claw44/rev1/rev1.h @@ -0,0 +1,57 @@ +#pragma once + +#include "../claw44.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, R30, R31, R32, R33 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { KC_NO, KC_NO, L30, L31, L32, L33 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { KC_NO, KC_NO, R33, R32, R31, R30 } \ + } + +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, R30, R31, R32, R33 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##R30, KC_##R31, KC_##R32, KC_##R33 \ + ) + +enum layer_number { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST, +}; diff --git a/keyboards/claw44/rev1/rules.mk b/keyboards/claw44/rev1/rules.mk new file mode 100644 index 00000000000..ae95ec40145 --- /dev/null +++ b/keyboards/claw44/rev1/rules.mk @@ -0,0 +1,31 @@ +SRC += rev1/matrix.c +SRC += rev1/split_util.c +SRC += rev1/split_scomm.c + +# Build Options +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/rgb_state_reader.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/claw44/rev1/serial_config.h b/keyboards/claw44/rev1/serial_config.h new file mode 100644 index 00000000000..4fab8e8ddfc --- /dev/null +++ b/keyboards/claw44/rev1/serial_config.h @@ -0,0 +1,4 @@ +#ifndef SOFT_SERIAL_PIN +#define SOFT_SERIAL_PIN D2 +#define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/claw44/rev1/split_scomm.c b/keyboards/claw44/rev1/split_scomm.c new file mode 100644 index 00000000000..a1fe6ba5b82 --- /dev/null +++ b/keyboards/claw44/rev1/split_scomm.c @@ -0,0 +1,91 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include +#include +#include +#include +#include "serial.h" +#ifdef CONSOLE_ENABLE + #include +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status, smatstatus; + static int need_retry = 0; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3]); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; + } + return smatstatus; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/claw44/rev1/split_scomm.h b/keyboards/claw44/rev1/split_scomm.h new file mode 100644 index 00000000000..873d8939d81 --- /dev/null +++ b/keyboards/claw44/rev1/split_scomm.h @@ -0,0 +1,24 @@ +#ifndef SPLIT_COMM_H +#define SPLIT_COMM_H + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif + +#endif /* SPLIT_COMM_H */ diff --git a/keyboards/claw44/rev1/split_util.c b/keyboards/claw44/rev1/split_util.c new file mode 100644 index 00000000000..e1ff8b4379d --- /dev/null +++ b/keyboards/claw44/rev1/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "split_scomm.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/claw44/rules.mk b/keyboards/claw44/rules.mk new file mode 100644 index 00000000000..c27f399ffd1 --- /dev/null +++ b/keyboards/claw44/rules.mk @@ -0,0 +1,73 @@ +SRC += i2c.c +SRC += serial.c +SRC += ssd1306.c + +# if firmware size over limit, try this option +# CFLAGS += -flto + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = claw44/rev1 diff --git a/keyboards/claw44/serial.c b/keyboards/claw44/serial.c new file mode 100644 index 00000000000..325c29a3f70 --- /dev/null +++ b/keyboards/claw44/serial.c @@ -0,0 +1,590 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include +#include "serial.h" +//#include + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ + int result; + result = soft_serial_transaction(); + return result; +} + +#endif // end of Simple API (OLD API, compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static void serial_delay(void) ALWAYS_INLINE; +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; + } + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/claw44/serial.h b/keyboards/claw44/serial.h new file mode 100644 index 00000000000..7e0c0847a43 --- /dev/null +++ b/keyboards/claw44/serial.h @@ -0,0 +1,84 @@ +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H + +#include + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE Simple API (OLD API, compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if SERIAL_SLAVE_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#endif +#if SERIAL_MASTER_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +#endif + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); + +#endif // USE Simple API + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif + +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/claw44/ssd1306.c b/keyboards/claw44/ssd1306.c new file mode 100644 index 00000000000..e32fc091c24 --- /dev/null +++ b/keyboards/claw44/ssd1306.c @@ -0,0 +1,346 @@ +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include +#include "print.h" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +extern const unsigned char font[] PROGMEM; + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +static bool force_dirty = true; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + i2c_master_init(); + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data) { + char data_ln[strlen(data)+2]; + snprintf(data_ln, sizeof(data_ln), "%s\n", data); + matrix_write(matrix, data_ln); +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty|| force_dirty) { + iota_gfx_flush(); + force_dirty = false; + } + + /* + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } + */ +} + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + +#endif diff --git a/keyboards/claw44/ssd1306.h b/keyboards/claw44/ssd1306.h new file mode 100644 index 00000000000..ea8c9232805 --- /dev/null +++ b/keyboards/claw44/ssd1306.h @@ -0,0 +1,91 @@ +#pragma once + +#include +#include +#include "pincontrol.h" +#include "action.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); \ No newline at end of file diff --git a/keyboards/clueboard/17/17.c b/keyboards/clueboard/17/17.c index f84e3253e9c..627aa236ddb 100644 --- a/keyboards/clueboard/17/17.c +++ b/keyboards/clueboard/17/17.c @@ -12,13 +12,11 @@ void matrix_init_kb(void) { MCUCR |= (1<. //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Number of backlighting levels */ #define BACKLIGHT_LEVELS 3 @@ -62,11 +62,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Underlight configuration */ #define RGB_DI_PIN F6 diff --git a/keyboards/clueboard/17/info.json b/keyboards/clueboard/17/info.json new file mode 100644 index 00000000000..12338ae1d34 --- /dev/null +++ b/keyboards/clueboard/17/info.json @@ -0,0 +1,31 @@ +{ + "keyboard_name": "Clueboard 17% (Cluepad)", + "keyboard_folder": "clueboard/17", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT_numpad_5x4": { + "layout": [ + {"label":"Num Lock", "x":0, "y":0}, + {"label":"/", "x":1, "y":0}, + {"label":"*", "x":2, "y":0}, + {"label":"-", "x":3, "y":0}, + {"label":"7", "x":0, "y":1}, + {"label":"8", "x":1, "y":1}, + {"label":"9", "x":2, "y":1}, + {"label":"4", "x":0, "y":2}, + {"label":"5", "x":1, "y":2}, + {"label":"6", "x":2, "y":2}, + {"label":"+", "x":3, "y":1, "h":2}, + {"label":"1", "x":0, "y":3}, + {"label":"2", "x":1, "y":3}, + {"label":"3", "x":2, "y":3}, + {"label":"0", "x":0, "y":4, "w":2}, + {"label":".", "x":2, "y":4}, + {"label":"Enter", "x":3, "y":3, "h":2} + ] + } + } +} diff --git a/keyboards/clueboard/17/keymaps/default/keymap.c b/keyboards/clueboard/17/keymaps/default/keymap.c index e8f3525a869..65c64e43c4f 100644 --- a/keyboards/clueboard/17/keymaps/default/keymap.c +++ b/keyboards/clueboard/17/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "17.h" - -#include "backlight.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -8,7 +6,6 @@ // entirely and just use numbers. #define _BL 0 #define _FL 1 -#define _RS 2 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer @@ -24,12 +21,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | 0| .| Ent| * '-------------------' */ -[_BL] = KEYMAP( - LT(_FL, KC_NLCK), KC_PSLS, KC_PAST, KC_PMNS, \ - KC_P7, KC_P8, KC_P9, KC_PPLS, \ - KC_P4, KC_P5, KC_P6, \ - KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_P0, KC_PDOT), + [_BL] = LAYOUT_numpad_5x4( + LT(_FL, KC_NLCK), KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, \ + KC_P0, KC_PDOT, KC_PENT \ + ), /* Keymap _FL: Function Layer * .-------------------. @@ -44,22 +42,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn1| | Fn7| * '-------------------' */ -[_FL] = KEYMAP( - LT(_FL, KC_NLCK), KC_TRNS, KC_TRNS, RGB_TOG, \ - KC_TRNS, RGB_SAI, KC_TRNS, RGB_VAI, \ - RGB_HUD, BL_STEP, RGB_HUI, \ - KC_TRNS, RGB_SAD, KC_TRNS, RGB_VAD, \ - RGB_MOD, KC_TRNS) -}; - -/*enum function_id { -};*/ - -const uint16_t PROGMEM fn_actions[] = { + [_FL] = LAYOUT_numpad_5x4( + LT(_FL, KC_NLCK), _______, _______, RGB_TOG, \ + _______, RGB_SAI, _______, \ + RGB_HUD, BL_STEP, RGB_HUI, RGB_VAI, \ + _______, RGB_SAD, _______, \ + RGB_MOD, _______, RGB_VAD \ + ) }; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - } -} - diff --git a/keyboards/clueboard/17/readme.md b/keyboards/clueboard/17/readme.md index 877adc78420..c183657f96b 100644 --- a/keyboards/clueboard/17/readme.md +++ b/keyboards/clueboard/17/readme.md @@ -1,6 +1,6 @@ # Clueboard 17% (Formerly Cluepad) -![Clueboard 17%](https://static1.squarespace.com/static/55c13bdee4b099be5dcb82eb/5842fbdce3df28eae5ec557e/5844fb2cb8a79bbdfd63bad1/1498501250178/IMGP3931.jpg?format=750w) +![Clueboard 17%](https://i.imgur.com/3XBC5c0.jpg) A basic 17 key numpad PCB. @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make clueboard/17:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/clueboard/17/rules.mk b/keyboards/clueboard/17/rules.mk index 264aba044d3..591d40f030c 100644 --- a/keyboards/clueboard/17/rules.mk +++ b/keyboards/clueboard/17/rules.mk @@ -1,6 +1,4 @@ - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -50,16 +48,13 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -# CONSOLE_ENABLE = yes # Console for debug(+400) -# COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable numpad's backlight functionality -RGBLIGHT_ENABLE = yes -# MIDI_ENABLE = YES # MIDI controls -# UNICODE_ENABLE = YES # Unicode -# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID \ No newline at end of file +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode diff --git a/keyboards/clueboard/2x1800/2x1800.c b/keyboards/clueboard/2x1800/2x1800.c index 4ad78899fc3..09c90adbcf6 100644 --- a/keyboards/clueboard/2x1800/2x1800.c +++ b/keyboards/clueboard/2x1800/2x1800.c @@ -21,10 +21,6 @@ void matrix_init_kb(void) { DDRB |= (1<<5); // Capslock DDRB |= (1<<6); // Scroll Lock - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1<. #define MATRIX_COL_PINS { D2, D3, D4, D5, D7, E0, E1, B0, E6, B3, B2 } #define UNUSED_PINS { D0, D1, D6, C5, C6, E4, E5, E7, F0, F1, A0, A1, A2, A3, A4, A5, A6, A7 } -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -58,6 +58,7 @@ along with this program. If not, see . /* audio support */ #define B7_AUDIO #define C4_AUDIO +#define AUDIO_CLICKY /* number of backlight levels */ // #define BACKLIGHT_PIN B7 @@ -114,11 +115,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/clueboard/2x1800/info.json b/keyboards/clueboard/2x1800/info.json index 86fd37ffa58..0e3bb36a9d8 100644 --- a/keyboards/clueboard/2x1800/info.json +++ b/keyboards/clueboard/2x1800/info.json @@ -1,5 +1,5 @@ { - "keyboard_name": "CB 2x1800", + "keyboard_name": "Clueboard 2x1800", "url": "", "maintainer": "skullydazed", "width": 24, @@ -8,388 +8,34 @@ "LAYOUT": { "key_count": 127, "layout": [ - {"label":"Home", "x":0, "y":0}, - {"label":"End", "x":1, "y":0}, - {"label":"PgUp", "x":2, "y":0}, - {"label":"PgDn", "x":3, "y":0}, - {"label":"Esc", "x":4.75, "y":0}, - {"label":"F1", "x":6.25, "y":0}, - {"label":"F2", "x":7.25, "y":0}, - {"label":"F3", "x":8.25, "y":0}, - {"label":"F4", "x":9.25, "y":0}, - {"label":"F5", "x":10.75, "y":0}, - {"label":"F6", "x":11.75, "y":0}, - {"label":"F7", "x":12.75, "y":0}, - {"label":"F8", "x":13.75, "y":0}, - {"label":"F9", "x":15.25, "y":0}, - {"label":"F10", "x":16.25, "y":0}, - {"label":"F11", "x":17.25, "y":0}, - {"label":"F12", "x":18.25, "y":0}, - {"label":"PrtSc", "x":20, "y":0}, - {"label":"Scroll Lock", "x":21, "y":0}, - {"label":"Pause", "x":22, "y":0}, - {"label":"Insert", "x":23, "y":0}, - {"label":"-", "x":0, "y":1.25}, - {"label":"Num Lock", "x":1, "y":1.25}, - {"label":"/", "x":2, "y":1.25}, - {"label":"*", "x":3, "y":1.25}, - {"label":"~", "x":4.5, "y":1.25}, - {"label":"!", "x":5.5, "y":1.25}, - {"label":"@", "x":6.5, "y":1.25}, - {"label":"#", "x":7.5, "y":1.25}, - {"label":"$", "x":8.5, "y":1.25}, - {"label":"%", "x":9.5, "y":1.25}, - {"label":"^", "x":10.5, "y":1.25}, - {"label":"&", "x":11.5, "y":1.25}, - {"label":"*", "x":12.5, "y":1.25}, - {"label":"(", "x":13.5, "y":1.25}, - {"label":")", "x":14.5, "y":1.25}, - {"label":"_", "x":15.5, "y":1.25}, - {"label":"+", "x":16.5, "y":1.25}, - {"label":"Backspace", "x":17.5, "y":1.25, "w":2}, - {"label":"Num Lock", "x":20, "y":1.25}, - {"label":"/", "x":21, "y":1.25}, - {"label":"*", "x":22, "y":1.25}, - {"label":"-", "x":23, "y":1.25}, - {"label":"+", "x":0, "y":2.25, "h":2}, - {"label":"7", "x":1, "y":2.25}, - {"label":"8", "x":2, "y":2.25}, - {"label":"9", "x":3, "y":2.25}, - {"label":"Tab", "x":4.5, "y":2.25, "w":1.5}, - {"label":"Q", "x":6, "y":2.25}, - {"label":"W", "x":7, "y":2.25}, - {"label":"E", "x":8, "y":2.25}, - {"label":"R", "x":9, "y":2.25}, - {"label":"T", "x":10, "y":2.25}, - {"label":"Y", "x":11, "y":2.25}, - {"label":"U", "x":12, "y":2.25}, - {"label":"I", "x":13, "y":2.25}, - {"label":"O", "x":14, "y":2.25}, - {"label":"P", "x":15, "y":2.25}, - {"label":"{", "x":16, "y":2.25}, - {"label":"}", "x":17, "y":2.25}, - {"label":"|", "x":18, "y":2.25, "w":1.5}, - {"label":"7", "x":20, "y":2.25}, - {"label":"8", "x":21, "y":2.25}, - {"label":"9", "x":22, "y":2.25}, - {"label":"+", "x":23, "y":2.25, "h":2}, - {"label":"4", "x":1, "y":3.25}, - {"label":"5", "x":2, "y":3.25}, - {"label":"6", "x":3, "y":3.25}, - {"label":"Caps Lock", "x":4.5, "y":3.25, "w":1.75}, - {"label":"A", "x":6.25, "y":3.25}, - {"label":"S", "x":7.25, "y":3.25}, - {"label":"D", "x":8.25, "y":3.25}, - {"label":"F", "x":9.25, "y":3.25}, - {"label":"G", "x":10.25, "y":3.25}, - {"label":"H", "x":11.25, "y":3.25}, - {"label":"J", "x":12.25, "y":3.25}, - {"label":"K", "x":13.25, "y":3.25}, - {"label":"L", "x":14.25, "y":3.25}, - {"label":":", "x":15.25, "y":3.25}, - {"label":"\"", "x":16.25, "y":3.25}, - {"label":"Enter", "x":17.25, "y":3.25, "w":2.25}, - {"label":"4", "x":20, "y":3.25}, - {"label":"5", "x":21, "y":3.25}, - {"label":"6", "x":22, "y":3.25}, - {"label":"Enter", "x":0, "y":4.25, "h":2}, - {"label":"1", "x":1, "y":4.25}, - {"label":"2", "x":2, "y":4.25}, - {"label":"3", "x":3, "y":4.25}, - {"label":"\\u2191", "x":4.25, "y":4.5}, - {"label":"Shift", "x":5.5, "y":4.25, "w":1.25}, - {"label":"Z", "x":6.75, "y":4.25}, - {"label":"X", "x":7.75, "y":4.25}, - {"label":"C", "x":8.75, "y":4.25}, - {"label":"V", "x":9.75, "y":4.25}, - {"label":"B", "x":10.75, "y":4.25}, - {"label":"N", "x":11.75, "y":4.25}, - {"label":"M", "x":12.75, "y":4.25}, - {"label":"<", "x":13.75, "y":4.25}, - {"label":">", "x":14.75, "y":4.25}, - {"label":"?", "x":15.75, "y":4.25}, - {"label":"Shift", "x":16.75, "y":4.25, "w":1.75}, - {"label":"\\u2191", "x":18.75, "y":4.5}, - {"label":"1", "x":20, "y":4.25}, - {"label":"2", "x":21, "y":4.25}, - {"label":"3", "x":22, "y":4.25}, - {"label":"Enter", "x":23, "y":4.25, "h":2}, - {"label":"0", "x":1, "y":5.25}, - {"label":".", "x":2, "y":5.25}, - {"label":"\\u2190", "x":3.25, "y":5.5}, - {"label":"\\u2193", "x":4.25, "y":5.5}, - {"label":"\\u2192", "x":5.25, "y":5.5}, - {"label":"Ctrl", "x":6.5, "y":5.25}, - {"label":"Win", "x":7.5, "y":5.25}, - {"label":"Alt", "x":8.5, "y":5.25}, - {"label":"1u", "x":9.5, "y":5.25}, - {"label":"1u", "x":10.5, "y":5.25}, - {"label":"1u", "x":11.5, "y":5.25}, - {"label":"1u", "x":12.5, "y":5.25}, - {"label":"Alt", "x":13.5, "y":5.25}, - {"label":"Win", "x":14.5, "y":5.25}, - {"label":"Menu", "x":15.5, "y":5.25}, - {"label":"Ctrl", "x":16.5, "y":5.25}, - {"label":"\\u2190", "x":17.75, "y":5.5}, - {"label":"\\u2193", "x":18.75, "y":5.5}, - {"label":"\\u2192", "x":19.75, "y":5.5}, - {"label":"0", "x":21, "y":5.25}, - {"label":".", "x":22, "y":5.25} + {"label":"Home", "x":0, "y":0}, {"label":"End", "x":1, "y":0}, {"label":"PgUp", "x":2, "y":0}, {"label":"PgDn", "x":3, "y":0}, {"label":"Esc", "x":4.75, "y":0}, {"label":"F1", "x":6.25, "y":0}, {"label":"F2", "x":7.25, "y":0}, {"label":"F3", "x":8.25, "y":0}, {"label":"F4", "x":9.25, "y":0}, {"label":"F5", "x":10.75, "y":0}, {"label":"F6", "x":11.75, "y":0}, {"label":"F7", "x":12.75, "y":0}, {"label":"F8", "x":13.75, "y":0}, {"label":"F9", "x":15.25, "y":0}, {"label":"F10", "x":16.25, "y":0}, {"label":"F11", "x":17.25, "y":0}, {"label":"F12", "x":18.25, "y":0}, {"label":"PrtSc", "x":20, "y":0}, {"label":"Scroll Lock", "x":21, "y":0}, {"label":"Pause", "x":22, "y":0}, {"label":"Insert", "x":23, "y":0}, + {"label":"-", "x":0, "y":1.25}, {"label":"Num Lock", "x":1, "y":1.25}, {"label":"/", "x":2, "y":1.25}, {"label":"*", "x":3, "y":1.25}, {"label":"~", "x":4.5, "y":1.25}, {"label":"!", "x":5.5, "y":1.25}, {"label":"@", "x":6.5, "y":1.25}, {"label":"#", "x":7.5, "y":1.25}, {"label":"$", "x":8.5, "y":1.25}, {"label":"%", "x":9.5, "y":1.25}, {"label":"^", "x":10.5, "y":1.25}, {"label":"&", "x":11.5, "y":1.25}, {"label":"*", "x":12.5, "y":1.25}, {"label":"(", "x":13.5, "y":1.25}, {"label":")", "x":14.5, "y":1.25}, {"label":"_", "x":15.5, "y":1.25}, {"label":"+", "x":16.5, "y":1.25}, {"label":"Backspace", "x":17.5, "y":1.25, "w":2}, {"label":"Num Lock", "x":20, "y":1.25}, {"label":"/", "x":21, "y":1.25}, {"label":"*", "x":22, "y":1.25}, {"label":"-", "x":23, "y":1.25}, + {"label":"+", "x":0, "y":2.25, "h":2}, {"label":"7", "x":1, "y":2.25}, {"label":"8", "x":2, "y":2.25}, {"label":"9", "x":3, "y":2.25}, {"label":"Tab", "x":4.5, "y":2.25, "w":1.5}, {"label":"Q", "x":6, "y":2.25}, {"label":"W", "x":7, "y":2.25}, {"label":"E", "x":8, "y":2.25}, {"label":"R", "x":9, "y":2.25}, {"label":"T", "x":10, "y":2.25}, {"label":"Y", "x":11, "y":2.25}, {"label":"U", "x":12, "y":2.25}, {"label":"I", "x":13, "y":2.25}, {"label":"O", "x":14, "y":2.25}, {"label":"P", "x":15, "y":2.25}, {"label":"{", "x":16, "y":2.25}, {"label":"}", "x":17, "y":2.25}, {"label":"|", "x":18, "y":2.25, "w":1.5}, {"label":"7", "x":20, "y":2.25}, {"label":"8", "x":21, "y":2.25}, {"label":"9", "x":22, "y":2.25}, {"label":"+", "x":23, "y":2.25, "h":2}, + {"label":"4", "x":1, "y":3.25}, {"label":"5", "x":2, "y":3.25}, {"label":"6", "x":3, "y":3.25}, {"label":"Caps Lock", "x":4.5, "y":3.25, "w":1.75}, {"label":"A", "x":6.25, "y":3.25}, {"label":"S", "x":7.25, "y":3.25}, {"label":"D", "x":8.25, "y":3.25}, {"label":"F", "x":9.25, "y":3.25}, {"label":"G", "x":10.25, "y":3.25}, {"label":"H", "x":11.25, "y":3.25}, {"label":"J", "x":12.25, "y":3.25}, {"label":"K", "x":13.25, "y":3.25}, {"label":"L", "x":14.25, "y":3.25}, {"label":":", "x":15.25, "y":3.25}, {"label":"\"", "x":16.25, "y":3.25}, {"label":"Enter", "x":17.25, "y":3.25, "w":2.25}, {"label":"4", "x":20, "y":3.25}, {"label":"5", "x":21, "y":3.25}, {"label":"6", "x":22, "y":3.25}, + {"label":"Enter", "x":0, "y":4.25, "h":2}, {"label":"1", "x":1, "y":4.25}, {"label":"2", "x":2, "y":4.25}, {"label":"3", "x":3, "y":4.25}, {"label":"\\u2191", "x":4.25, "y":4.5}, {"label":"Shift", "x":5.5, "y":4.25, "w":1.25}, {"label":"Z", "x":6.75, "y":4.25}, {"label":"X", "x":7.75, "y":4.25}, {"label":"C", "x":8.75, "y":4.25}, {"label":"V", "x":9.75, "y":4.25}, {"label":"B", "x":10.75, "y":4.25}, {"label":"N", "x":11.75, "y":4.25}, {"label":"M", "x":12.75, "y":4.25}, {"label":"<", "x":13.75, "y":4.25}, {"label":">", "x":14.75, "y":4.25}, {"label":"?", "x":15.75, "y":4.25}, {"label":"Shift", "x":16.75, "y":4.25, "w":1.75}, {"label":"\\u2191", "x":18.75, "y":4.5}, {"label":"1", "x":20, "y":4.25}, {"label":"2", "x":21, "y":4.25}, {"label":"3", "x":22, "y":4.25}, {"label":"Enter", "x":23, "y":4.25, "h":2}, + {"label":"0", "x":1, "y":5.25}, {"label":".", "x":2, "y":5.25}, {"label":"\\u2190", "x":3.25, "y":5.5}, {"label":"\\u2193", "x":4.25, "y":5.5}, {"label":"\\u2192", "x":5.25, "y":5.5}, {"label":"Ctrl", "x":6.5, "y":5.25}, {"label":"Win", "x":7.5, "y":5.25}, {"label":"Alt", "x":8.5, "y":5.25}, {"label":"1u", "x":9.5, "y":5.25}, {"label":"1u", "x":10.5, "y":5.25}, {"label":"1u", "x":11.5, "y":5.25}, {"label":"1u", "x":12.5, "y":5.25}, {"label":"Alt", "x":13.5, "y":5.25}, {"label":"Win", "x":14.5, "y":5.25}, {"label":"Menu", "x":15.5, "y":5.25}, {"label":"Ctrl", "x":16.5, "y":5.25}, {"label":"\\u2190", "x":17.75, "y":5.5}, {"label":"\\u2193", "x":18.75, "y":5.5}, {"label":"\\u2192", "x":19.75, "y":5.5}, {"label":"0", "x":21, "y":5.25}, {"label":".", "x":22, "y":5.25} ] }, "LAYOUT_7u_space": { "key_count": 121, "layout": [ - {"label":"k00", "x":0, "y":0}, - {"label":"k01", "x":1, "y":0}, - {"label":"k02", "x":2, "y":0}, - {"label":"k03", "x":3, "y":0}, - {"label":"k04", "x":4.75, "y":0}, - {"label":"k06", "x":6.25, "y":0}, - {"label":"k07", "x":7.25, "y":0}, - {"label":"k08", "x":8.25, "y":0}, - {"label":"k09", "x":9.25, "y":0}, - {"label":"k0a", "x":10.75, "y":0}, - {"label":"k60", "x":11.75, "y":0}, - {"label":"k61", "x":12.75, "y":0}, - {"label":"k62", "x":13.75, "y":0}, - {"label":"k63", "x":15.25, "y":0}, - {"label":"k64", "x":16.25, "y":0}, - {"label":"k65", "x":17.25, "y":0}, - {"label":"k66", "x":18.25, "y":0}, - {"label":"k67", "x":20, "y":0}, - {"label":"k68", "x":21, "y":0}, - {"label":"k69", "x":22, "y":0}, - {"label":"k6a", "x":23, "y":0}, - {"label":"k10", "x":0, "y":1.25}, - {"label":"k11", "x":1, "y":1.25}, - {"label":"k12", "x":2, "y":1.25}, - {"label":"k13", "x":3, "y":1.25}, - {"label":"k14", "x":4.5, "y":1.25}, - {"label":"k15", "x":5.5, "y":1.25}, - {"label":"k16", "x":6.5, "y":1.25}, - {"label":"k17", "x":7.5, "y":1.25}, - {"label":"k18", "x":8.5, "y":1.25}, - {"label":"k19", "x":9.5, "y":1.25}, - {"label":"k0a", "x":10.5, "y":1.25}, - {"label":"k70", "x":11.5, "y":1.25}, - {"label":"k71", "x":12.5, "y":1.25}, - {"label":"k72", "x":13.5, "y":1.25}, - {"label":"k73", "x":14.5, "y":1.25}, - {"label":"k74", "x":15.5, "y":1.25}, - {"label":"k75", "x":16.5, "y":1.25}, - {"label":"k76", "x":17.5, "y":1.25, "w":2}, - {"label":"k77", "x":20, "y":1.25}, - {"label":"k78", "x":21, "y":1.25}, - {"label":"k79", "x":22, "y":1.25}, - {"label":"k7a", "x":23, "y":1.25}, - {"label":"k20", "x":0, "y":2.25, "h":2}, - {"label":"k21", "x":1, "y":2.25}, - {"label":"k22", "x":2, "y":2.25}, - {"label":"k23", "x":3, "y":2.25}, - {"label":"k24", "x":4.5, "y":2.25, "w":1.5}, - {"label":"k25", "x":6, "y":2.25}, - {"label":"k26", "x":7, "y":2.25}, - {"label":"k27", "x":8, "y":2.25}, - {"label":"k28", "x":9, "y":2.25}, - {"label":"k29", "x":10, "y":2.25}, - {"label":"k2a", "x":11, "y":2.25}, - {"label":"k80", "x":12, "y":2.25}, - {"label":"k81", "x":13, "y":2.25}, - {"label":"k82", "x":14, "y":2.25}, - {"label":"k83", "x":15, "y":2.25}, - {"label":"k84", "x":16, "y":2.25}, - {"label":"k85", "x":17, "y":2.25}, - {"label":"k86", "x":18, "y":2.25, "w":1.5}, - {"label":"k87", "x":20, "y":2.25}, - {"label":"k88", "x":21, "y":2.25}, - {"label":"k89", "x":22, "y":2.25}, - {"label":"k8a", "x":23, "y":2.25, "h":2}, - {"label":"k31", "x":1, "y":3.25}, - {"label":"k32", "x":2, "y":3.25}, - {"label":"k33", "x":3, "y":3.25}, - {"label":"k34", "x":4.5, "y":3.25, "w":1.75}, - {"label":"k35", "x":6.25, "y":3.25}, - {"label":"k36", "x":7.25, "y":3.25}, - {"label":"k37", "x":8.25, "y":3.25}, - {"label":"k38", "x":9.25, "y":3.25}, - {"label":"k39", "x":10.25, "y":3.25}, - {"label":"k3a", "x":11.25, "y":3.25}, - {"label":"k90", "x":12.25, "y":3.25}, - {"label":"k91", "x":13.25, "y":3.25}, - {"label":"k92", "x":14.25, "y":3.25}, - {"label":"k93", "x":15.25, "y":3.25}, - {"label":"k94", "x":16.25, "y":3.25}, - {"label":"k95", "x":17.25, "y":3.25, "w":2.25}, - {"label":"k97", "x":20, "y":3.25}, - {"label":"k98", "x":21, "y":3.25}, - {"label":"k99", "x":22, "y":3.25}, - {"label":"k40", "x":0, "y":4.25, "h":2}, - {"label":"k41", "x":1, "y":4.25}, - {"label":"k42", "x":2, "y":4.25}, - {"label":"k43", "x":3, "y":4.25}, - {"label":"k45", "x":5.5, "y":4.25, "w":1.25}, - {"label":"k46", "x":6.75, "y":4.25}, - {"label":"k47", "x":7.75, "y":4.25}, - {"label":"k48", "x":8.75, "y":4.25}, - {"label":"k49", "x":9.75, "y":4.25}, - {"label":"k4a", "x":10.75, "y":4.25}, - {"label":"ka0", "x":11.75, "y":4.25}, - {"label":"ka1", "x":12.75, "y":4.25}, - {"label":"ka2", "x":13.75, "y":4.25}, - {"label":"ka3", "x":14.75, "y":4.25}, - {"label":"ka4", "x":15.75, "y":4.25}, - {"label":"ka5", "x":16.75, "y":4.25, "w":1.75}, - {"label":"ka7", "x":20, "y":4.25}, - {"label":"ka8", "x":21, "y":4.25}, - {"label":"ka9", "x":22, "y":4.25}, - {"label":"kaa", "x":23, "y":4.25, "h":2}, - {"label":"k44", "x":4.25, "y":4.5}, - {"label":"k96", "x":18.75, "y":4.5}, - {"label":"k51", "x":1, "y":5.25}, - {"label":"k52", "x":2, "y":5.25}, - {"label":"k56", "x":6.5, "y":5.25}, - {"label":"k57", "x":7.5, "y":5.25}, - {"label":"kb0", "x":8.5, "y":5.25, "w":7}, - {"label":"kb4", "x":15.5, "y":5.25}, - {"label":"kb5", "x":16.5, "y":5.25}, - {"label":"kb8", "x":21, "y":5.25}, - {"label":"kb9", "x":22, "y":5.25}, - {"label":"k53", "x":3.25, "y":5.5}, - {"label":"k54", "x":4.25, "y":5.5}, - {"label":"k55", "x":5.25, "y":5.5}, - {"label":"ka6", "x":17.75, "y":5.5}, - {"label":"kb6", "x":18.75, "y":5.5}, - {"label":"kb7", "x":19.75, "y":5.5} + {"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4.75, "y":0}, {"label":"k06", "x":6.25, "y":0}, {"label":"k07", "x":7.25, "y":0}, {"label":"k08", "x":8.25, "y":0}, {"label":"k09", "x":9.25, "y":0}, {"label":"k0a", "x":10.75, "y":0}, {"label":"k60", "x":11.75, "y":0}, {"label":"k61", "x":12.75, "y":0}, {"label":"k62", "x":13.75, "y":0}, {"label":"k63", "x":15.25, "y":0}, {"label":"k64", "x":16.25, "y":0}, {"label":"k65", "x":17.25, "y":0}, {"label":"k66", "x":18.25, "y":0}, {"label":"k67", "x":20, "y":0}, {"label":"k68", "x":21, "y":0}, {"label":"k69", "x":22, "y":0}, {"label":"k6a", "x":23, "y":0}, + {"label":"k10", "x":0, "y":1.25}, {"label":"k11", "x":1, "y":1.25}, {"label":"k12", "x":2, "y":1.25}, {"label":"k13", "x":3, "y":1.25}, {"label":"k14", "x":4.5, "y":1.25}, {"label":"k15", "x":5.5, "y":1.25}, {"label":"k16", "x":6.5, "y":1.25}, {"label":"k17", "x":7.5, "y":1.25}, {"label":"k18", "x":8.5, "y":1.25}, {"label":"k19", "x":9.5, "y":1.25}, {"label":"k0a", "x":10.5, "y":1.25}, {"label":"k70", "x":11.5, "y":1.25}, {"label":"k71", "x":12.5, "y":1.25}, {"label":"k72", "x":13.5, "y":1.25}, {"label":"k73", "x":14.5, "y":1.25}, {"label":"k74", "x":15.5, "y":1.25}, {"label":"k75", "x":16.5, "y":1.25}, {"label":"k76", "x":17.5, "y":1.25, "w":2}, {"label":"k77", "x":20, "y":1.25}, {"label":"k78", "x":21, "y":1.25}, {"label":"k79", "x":22, "y":1.25}, {"label":"k7a", "x":23, "y":1.25}, + {"label":"k20", "x":0, "y":2.25, "h":2}, {"label":"k21", "x":1, "y":2.25}, {"label":"k22", "x":2, "y":2.25}, {"label":"k23", "x":3, "y":2.25}, {"label":"k24", "x":4.5, "y":2.25, "w":1.5}, {"label":"k25", "x":6, "y":2.25}, {"label":"k26", "x":7, "y":2.25}, {"label":"k27", "x":8, "y":2.25}, {"label":"k28", "x":9, "y":2.25}, {"label":"k29", "x":10, "y":2.25}, {"label":"k2a", "x":11, "y":2.25}, {"label":"k80", "x":12, "y":2.25}, {"label":"k81", "x":13, "y":2.25}, {"label":"k82", "x":14, "y":2.25}, {"label":"k83", "x":15, "y":2.25}, {"label":"k84", "x":16, "y":2.25}, {"label":"k85", "x":17, "y":2.25}, {"label":"k86", "x":18, "y":2.25, "w":1.5}, {"label":"k87", "x":20, "y":2.25}, {"label":"k88", "x":21, "y":2.25}, {"label":"k89", "x":22, "y":2.25}, {"label":"k8a", "x":23, "y":2.25, "h":2}, + {"label":"k31", "x":1, "y":3.25}, {"label":"k32", "x":2, "y":3.25}, {"label":"k33", "x":3, "y":3.25}, {"label":"k34", "x":4.5, "y":3.25, "w":1.75}, {"label":"k35", "x":6.25, "y":3.25}, {"label":"k36", "x":7.25, "y":3.25}, {"label":"k37", "x":8.25, "y":3.25}, {"label":"k38", "x":9.25, "y":3.25}, {"label":"k39", "x":10.25, "y":3.25}, {"label":"k3a", "x":11.25, "y":3.25}, {"label":"k90", "x":12.25, "y":3.25}, {"label":"k91", "x":13.25, "y":3.25}, {"label":"k92", "x":14.25, "y":3.25}, {"label":"k93", "x":15.25, "y":3.25}, {"label":"k94", "x":16.25, "y":3.25}, {"label":"k95", "x":17.25, "y":3.25, "w":2.25}, {"label":"k97", "x":20, "y":3.25}, {"label":"k98", "x":21, "y":3.25}, {"label":"k99", "x":22, "y":3.25}, + {"label":"k40", "x":0, "y":4.25, "h":2}, {"label":"k41", "x":1, "y":4.25}, {"label":"k42", "x":2, "y":4.25}, {"label":"k43", "x":3, "y":4.25}, {"label":"k45", "x":5.5, "y":4.25, "w":1.25}, {"label":"k46", "x":6.75, "y":4.25}, {"label":"k47", "x":7.75, "y":4.25}, {"label":"k48", "x":8.75, "y":4.25}, {"label":"k49", "x":9.75, "y":4.25}, {"label":"k4a", "x":10.75, "y":4.25}, {"label":"ka0", "x":11.75, "y":4.25}, {"label":"ka1", "x":12.75, "y":4.25}, {"label":"ka2", "x":13.75, "y":4.25}, {"label":"ka3", "x":14.75, "y":4.25}, {"label":"ka4", "x":15.75, "y":4.25}, {"label":"ka5", "x":16.75, "y":4.25, "w":1.75}, {"label":"ka7", "x":20, "y":4.25}, {"label":"ka8", "x":21, "y":4.25}, {"label":"ka9", "x":22, "y":4.25}, {"label":"kaa", "x":23, "y":4.25, "h":2}, {"label":"k44", "x":4.25, "y":4.5}, {"label":"k96", "x":18.75, "y":4.5}, + {"label":"k51", "x":1, "y":5.25}, {"label":"k52", "x":2, "y":5.25}, {"label":"k56", "x":6.5, "y":5.25}, {"label":"k57", "x":7.5, "y":5.25}, {"label":"kb0", "x":8.5, "y":5.25, "w":7}, {"label":"kb4", "x":15.5, "y":5.25}, {"label":"kb5", "x":16.5, "y":5.25}, {"label":"kb8", "x":21, "y":5.25}, {"label":"kb9", "x":22, "y":5.25}, {"label":"k53", "x":3.25, "y":5.5}, {"label":"k54", "x":4.25, "y":5.5}, {"label":"k55", "x":5.25, "y":5.5}, {"label":"ka6", "x":17.75, "y":5.5}, {"label":"kb6", "x":18.75, "y":5.5}, {"label":"kb7", "x":19.75, "y":5.5} ] }, "LAYOUT_4u_space": { "key_count": 124, "layout": [ - {"label":"k00", "x":0, "y":0}, - {"label":"k01", "x":1, "y":0}, - {"label":"k02", "x":2, "y":0}, - {"label":"k03", "x":3, "y":0}, - {"label":"k04", "x":4.75, "y":0}, - {"label":"k06", "x":6.25, "y":0}, - {"label":"k07", "x":7.25, "y":0}, - {"label":"k08", "x":8.25, "y":0}, - {"label":"k09", "x":9.25, "y":0}, - {"label":"k0a", "x":10.75, "y":0}, - {"label":"k60", "x":11.75, "y":0}, - {"label":"k61", "x":12.75, "y":0}, - {"label":"k62", "x":13.75, "y":0}, - {"label":"k63", "x":15.25, "y":0}, - {"label":"k64", "x":16.25, "y":0}, - {"label":"k65", "x":17.25, "y":0}, - {"label":"k66", "x":18.25, "y":0}, - {"label":"k67", "x":20, "y":0}, - {"label":"k68", "x":21, "y":0}, - {"label":"k69", "x":22, "y":0}, - {"label":"k6a", "x":23, "y":0}, - {"label":"k10", "x":0, "y":1.25}, - {"label":"k11", "x":1, "y":1.25}, - {"label":"k12", "x":2, "y":1.25}, - {"label":"k13", "x":3, "y":1.25}, - {"label":"k14", "x":4.5, "y":1.25}, - {"label":"k15", "x":5.5, "y":1.25}, - {"label":"k16", "x":6.5, "y":1.25}, - {"label":"k17", "x":7.5, "y":1.25}, - {"label":"k18", "x":8.5, "y":1.25}, - {"label":"k19", "x":9.5, "y":1.25}, - {"label":"k0a", "x":10.5, "y":1.25}, - {"label":"k70", "x":11.5, "y":1.25}, - {"label":"k71", "x":12.5, "y":1.25}, - {"label":"k72", "x":13.5, "y":1.25}, - {"label":"k73", "x":14.5, "y":1.25}, - {"label":"k74", "x":15.5, "y":1.25}, - {"label":"k75", "x":16.5, "y":1.25}, - {"label":"k76", "x":17.5, "y":1.25, "w":2}, - {"label":"k77", "x":20, "y":1.25}, - {"label":"k78", "x":21, "y":1.25}, - {"label":"k79", "x":22, "y":1.25}, - {"label":"k7a", "x":23, "y":1.25}, - {"label":"k20", "x":0, "y":2.25, "h":2}, - {"label":"k21", "x":1, "y":2.25}, - {"label":"k22", "x":2, "y":2.25}, - {"label":"k23", "x":3, "y":2.25}, - {"label":"k24", "x":4.5, "y":2.25, "w":1.5}, - {"label":"k25", "x":6, "y":2.25}, - {"label":"k26", "x":7, "y":2.25}, - {"label":"k27", "x":8, "y":2.25}, - {"label":"k28", "x":9, "y":2.25}, - {"label":"k29", "x":10, "y":2.25}, - {"label":"k2a", "x":11, "y":2.25}, - {"label":"k80", "x":12, "y":2.25}, - {"label":"k81", "x":13, "y":2.25}, - {"label":"k82", "x":14, "y":2.25}, - {"label":"k83", "x":15, "y":2.25}, - {"label":"k84", "x":16, "y":2.25}, - {"label":"k85", "x":17, "y":2.25}, - {"label":"k86", "x":18, "y":2.25, "w":1.5}, - {"label":"k87", "x":20, "y":2.25}, - {"label":"k88", "x":21, "y":2.25}, - {"label":"k89", "x":22, "y":2.25}, - {"label":"k8a", "x":23, "y":2.25, "h":2}, - {"label":"k31", "x":1, "y":3.25}, - {"label":"k32", "x":2, "y":3.25}, - {"label":"k33", "x":3, "y":3.25}, - {"label":"k34", "x":4.5, "y":3.25, "w":1.75}, - {"label":"k35", "x":6.25, "y":3.25}, - {"label":"k36", "x":7.25, "y":3.25}, - {"label":"k37", "x":8.25, "y":3.25}, - {"label":"k38", "x":9.25, "y":3.25}, - {"label":"k39", "x":10.25, "y":3.25}, - {"label":"k3a", "x":11.25, "y":3.25}, - {"label":"k90", "x":12.25, "y":3.25}, - {"label":"k91", "x":13.25, "y":3.25}, - {"label":"k92", "x":14.25, "y":3.25}, - {"label":"k93", "x":15.25, "y":3.25}, - {"label":"k94", "x":16.25, "y":3.25}, - {"label":"k95", "x":17.25, "y":3.25, "w":2.25}, - {"label":"k97", "x":20, "y":3.25}, - {"label":"k98", "x":21, "y":3.25}, - {"label":"k99", "x":22, "y":3.25}, - {"label":"k40", "x":0, "y":4.25, "h":2}, - {"label":"k41", "x":1, "y":4.25}, - {"label":"k42", "x":2, "y":4.25}, - {"label":"k43", "x":3, "y":4.25}, - {"label":"k45", "x":5.5, "y":4.25, "w":1.25}, - {"label":"k46", "x":6.75, "y":4.25}, - {"label":"k47", "x":7.75, "y":4.25}, - {"label":"k48", "x":8.75, "y":4.25}, - {"label":"k49", "x":9.75, "y":4.25}, - {"label":"k4a", "x":10.75, "y":4.25}, - {"label":"ka0", "x":11.75, "y":4.25}, - {"label":"ka1", "x":12.75, "y":4.25}, - {"label":"ka2", "x":13.75, "y":4.25}, - {"label":"ka3", "x":14.75, "y":4.25}, - {"label":"ka4", "x":15.75, "y":4.25}, - {"label":"ka5", "x":16.75, "y":4.25, "w":1.75}, - {"label":"ka7", "x":20, "y":4.25}, - {"label":"ka8", "x":21, "y":4.25}, - {"label":"ka9", "x":22, "y":4.25}, - {"label":"kaa", "x":23, "y":4.25, "h":2}, - {"label":"k44", "x":4.25, "y":4.5}, - {"label":"k96", "x":18.75, "y":4.5}, - {"label":"k51", "x":1, "y":5.25}, - {"label":"k52", "x":2, "y":5.25}, - {"label":"k56", "x":6.5, "y":5.25}, - {"label":"k57", "x":7.5, "y":5.25}, - {"label":"k58", "x":8.5, "y":5.25}, - {"label":"kb0", "x":9.5, "y":5.25, "w":4}, - {"label":"kb2", "x":13.5, "y":5.25}, - {"label":"kb3", "x":14.5, "y":5.25}, - {"label":"kb4", "x":15.5, "y":5.25}, - {"label":"kb5", "x":16.5, "y":5.25}, - {"label":"kb8", "x":21, "y":5.25}, - {"label":"kb9", "x":22, "y":5.25}, - {"label":"k53", "x":3.25, "y":5.5}, - {"label":"k54", "x":4.25, "y":5.5}, - {"label":"k55", "x":5.25, "y":5.5}, - {"label":"ka6", "x":17.75, "y":5.5}, - {"label":"kb6", "x":18.75, "y":5.5}, - {"label":"kb7", "x":19.75, "y":5.5} + {"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4.75, "y":0}, {"label":"k06", "x":6.25, "y":0}, {"label":"k07", "x":7.25, "y":0}, {"label":"k08", "x":8.25, "y":0}, {"label":"k09", "x":9.25, "y":0}, {"label":"k0a", "x":10.75, "y":0}, {"label":"k60", "x":11.75, "y":0}, {"label":"k61", "x":12.75, "y":0}, {"label":"k62", "x":13.75, "y":0}, {"label":"k63", "x":15.25, "y":0}, {"label":"k64", "x":16.25, "y":0}, {"label":"k65", "x":17.25, "y":0}, {"label":"k66", "x":18.25, "y":0}, {"label":"k67", "x":20, "y":0}, {"label":"k68", "x":21, "y":0}, {"label":"k69", "x":22, "y":0}, {"label":"k6a", "x":23, "y":0}, + {"label":"k10", "x":0, "y":1.25}, {"label":"k11", "x":1, "y":1.25}, {"label":"k12", "x":2, "y":1.25}, {"label":"k13", "x":3, "y":1.25}, {"label":"k14", "x":4.5, "y":1.25}, {"label":"k15", "x":5.5, "y":1.25}, {"label":"k16", "x":6.5, "y":1.25}, {"label":"k17", "x":7.5, "y":1.25}, {"label":"k18", "x":8.5, "y":1.25}, {"label":"k19", "x":9.5, "y":1.25}, {"label":"k0a", "x":10.5, "y":1.25}, {"label":"k70", "x":11.5, "y":1.25}, {"label":"k71", "x":12.5, "y":1.25}, {"label":"k72", "x":13.5, "y":1.25}, {"label":"k73", "x":14.5, "y":1.25}, {"label":"k74", "x":15.5, "y":1.25}, {"label":"k75", "x":16.5, "y":1.25}, {"label":"k76", "x":17.5, "y":1.25, "w":2}, {"label":"k77", "x":20, "y":1.25}, {"label":"k78", "x":21, "y":1.25}, {"label":"k79", "x":22, "y":1.25}, {"label":"k7a", "x":23, "y":1.25}, + {"label":"k20", "x":0, "y":2.25, "h":2}, {"label":"k21", "x":1, "y":2.25}, {"label":"k22", "x":2, "y":2.25}, {"label":"k23", "x":3, "y":2.25}, {"label":"k24", "x":4.5, "y":2.25, "w":1.5}, {"label":"k25", "x":6, "y":2.25}, {"label":"k26", "x":7, "y":2.25}, {"label":"k27", "x":8, "y":2.25}, {"label":"k28", "x":9, "y":2.25}, {"label":"k29", "x":10, "y":2.25}, {"label":"k2a", "x":11, "y":2.25}, {"label":"k80", "x":12, "y":2.25}, {"label":"k81", "x":13, "y":2.25}, {"label":"k82", "x":14, "y":2.25}, {"label":"k83", "x":15, "y":2.25}, {"label":"k84", "x":16, "y":2.25}, {"label":"k85", "x":17, "y":2.25}, {"label":"k86", "x":18, "y":2.25, "w":1.5}, {"label":"k87", "x":20, "y":2.25}, {"label":"k88", "x":21, "y":2.25}, {"label":"k89", "x":22, "y":2.25}, {"label":"k8a", "x":23, "y":2.25, "h":2}, + {"label":"k31", "x":1, "y":3.25}, {"label":"k32", "x":2, "y":3.25}, {"label":"k33", "x":3, "y":3.25}, {"label":"k34", "x":4.5, "y":3.25, "w":1.75}, {"label":"k35", "x":6.25, "y":3.25}, {"label":"k36", "x":7.25, "y":3.25}, {"label":"k37", "x":8.25, "y":3.25}, {"label":"k38", "x":9.25, "y":3.25}, {"label":"k39", "x":10.25, "y":3.25}, {"label":"k3a", "x":11.25, "y":3.25}, {"label":"k90", "x":12.25, "y":3.25}, {"label":"k91", "x":13.25, "y":3.25}, {"label":"k92", "x":14.25, "y":3.25}, {"label":"k93", "x":15.25, "y":3.25}, {"label":"k94", "x":16.25, "y":3.25}, {"label":"k95", "x":17.25, "y":3.25, "w":2.25}, {"label":"k97", "x":20, "y":3.25}, {"label":"k98", "x":21, "y":3.25}, {"label":"k99", "x":22, "y":3.25}, + {"label":"k40", "x":0, "y":4.25, "h":2}, {"label":"k41", "x":1, "y":4.25}, {"label":"k42", "x":2, "y":4.25}, {"label":"k43", "x":3, "y":4.25}, {"label":"k45", "x":5.5, "y":4.25, "w":1.25}, {"label":"k46", "x":6.75, "y":4.25}, {"label":"k47", "x":7.75, "y":4.25}, {"label":"k48", "x":8.75, "y":4.25}, {"label":"k49", "x":9.75, "y":4.25}, {"label":"k4a", "x":10.75, "y":4.25}, {"label":"ka0", "x":11.75, "y":4.25}, {"label":"ka1", "x":12.75, "y":4.25}, {"label":"ka2", "x":13.75, "y":4.25}, {"label":"ka3", "x":14.75, "y":4.25}, {"label":"ka4", "x":15.75, "y":4.25}, {"label":"ka5", "x":16.75, "y":4.25, "w":1.75}, {"label":"ka7", "x":20, "y":4.25}, {"label":"ka8", "x":21, "y":4.25}, {"label":"ka9", "x":22, "y":4.25}, {"label":"kaa", "x":23, "y":4.25, "h":2}, {"label":"k44", "x":4.25, "y":4.5}, {"label":"k96", "x":18.75, "y":4.5}, + {"label":"k51", "x":1, "y":5.25}, {"label":"k52", "x":2, "y":5.25}, {"label":"k56", "x":6.5, "y":5.25}, {"label":"k57", "x":7.5, "y":5.25}, {"label":"k58", "x":8.5, "y":5.25}, {"label":"kb0", "x":9.5, "y":5.25, "w":4}, {"label":"kb2", "x":13.5, "y":5.25}, {"label":"kb3", "x":14.5, "y":5.25}, {"label":"kb4", "x":15.5, "y":5.25}, {"label":"kb5", "x":16.5, "y":5.25}, {"label":"kb8", "x":21, "y":5.25}, {"label":"kb9", "x":22, "y":5.25}, {"label":"k53", "x":3.25, "y":5.5}, {"label":"k54", "x":4.25, "y":5.5}, {"label":"k55", "x":5.25, "y":5.5}, {"label":"ka6", "x":17.75, "y":5.5}, {"label":"kb6", "x":18.75, "y":5.5}, {"label":"kb7", "x":19.75, "y":5.5} ] } } diff --git a/keyboards/clueboard/2x1800/keymaps/default/config.h b/keyboards/clueboard/2x1800/keymaps/default/config.h index f5eccb22529..dd48c69e36e 100644 --- a/keyboards/clueboard/2x1800/keymaps/default/config.h +++ b/keyboards/clueboard/2x1800/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/clueboard/2x1800/keymaps/default_4u/config.h b/keyboards/clueboard/2x1800/keymaps/default_4u/config.h index f5eccb22529..152e2f14875 100644 --- a/keyboards/clueboard/2x1800/keymaps/default_4u/config.h +++ b/keyboards/clueboard/2x1800/keymaps/default_4u/config.h @@ -14,11 +14,8 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/clueboard/2x1800/keymaps/default_7u/config.h b/keyboards/clueboard/2x1800/keymaps/default_7u/config.h index f5eccb22529..152e2f14875 100644 --- a/keyboards/clueboard/2x1800/keymaps/default_7u/config.h +++ b/keyboards/clueboard/2x1800/keymaps/default_7u/config.h @@ -14,11 +14,8 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/clueboard/2x1800/keymaps/macroboard/config.h b/keyboards/clueboard/2x1800/keymaps/macroboard/config.h index f5eccb22529..152e2f14875 100644 --- a/keyboards/clueboard/2x1800/keymaps/macroboard/config.h +++ b/keyboards/clueboard/2x1800/keymaps/macroboard/config.h @@ -14,11 +14,8 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/clueboard/2x1800/keymaps/mouseboard_left/config.h b/keyboards/clueboard/2x1800/keymaps/mouseboard_left/config.h index f5eccb22529..152e2f14875 100644 --- a/keyboards/clueboard/2x1800/keymaps/mouseboard_left/config.h +++ b/keyboards/clueboard/2x1800/keymaps/mouseboard_left/config.h @@ -14,11 +14,8 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/clueboard/2x1800/keymaps/mouseboard_left/rules.mk b/keyboards/clueboard/2x1800/keymaps/mouseboard_left/rules.mk deleted file mode 100644 index 6c605daecf5..00000000000 --- a/keyboards/clueboard/2x1800/keymaps/mouseboard_left/rules.mk +++ /dev/null @@ -1 +0,0 @@ -MOUSEKEY_ENABLE = yes diff --git a/keyboards/clueboard/2x1800/keymaps/mouseboard_right/config.h b/keyboards/clueboard/2x1800/keymaps/mouseboard_right/config.h index f5eccb22529..152e2f14875 100644 --- a/keyboards/clueboard/2x1800/keymaps/mouseboard_right/config.h +++ b/keyboards/clueboard/2x1800/keymaps/mouseboard_right/config.h @@ -14,11 +14,8 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/clueboard/2x1800/keymaps/mouseboard_right/rules.mk b/keyboards/clueboard/2x1800/keymaps/mouseboard_right/rules.mk deleted file mode 100644 index 6c605daecf5..00000000000 --- a/keyboards/clueboard/2x1800/keymaps/mouseboard_right/rules.mk +++ /dev/null @@ -1 +0,0 @@ -MOUSEKEY_ENABLE = yes diff --git a/keyboards/clueboard/2x1800/readme.md b/keyboards/clueboard/2x1800/readme.md index cccd8ac15f1..7e2c206ede7 100644 --- a/keyboards/clueboard/2x1800/readme.md +++ b/keyboards/clueboard/2x1800/readme.md @@ -2,12 +2,12 @@ Clueboard Double 1800 All The Way -Keyboard Maintainer: [Zach White](https://github.com/skullydazed) -Hardware Supported: Clueboard 2x1800 PCB -Hardware Availability: 2018 Apr 1 Group Buy +* Keyboard Maintainer: [Zach White](https://github.com/skullydazed) +* Hardware Supported: Clueboard 2x1800 PCB +* Hardware Availability: 2018 Apr 1 Group Buy -Make example for this keyboard (after setting up your build environment): +Make example for this keyboard: make 2x1800:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/clueboard/2x1800/rules.mk b/keyboards/clueboard/2x1800/rules.mk index 516a536f6b1..eb679b9fb77 100644 --- a/keyboards/clueboard/2x1800/rules.mk +++ b/keyboards/clueboard/2x1800/rules.mk @@ -1,64 +1,20 @@ -# MCU name +# MCU details MCU = at90usb1286 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 OPT_DEFS += -DBOOTLOADER_SIZE=1024 # Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode -RGBLIGHT_ENABLE = no # RGB on port C6 -AUDIO_ENABLE = no # Audio output on port C4 and B7 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +RGBLIGHT_ENABLE = yes # RGB on port C6 +AUDIO_ENABLE = yes # Audio output on port C4 and B7 diff --git a/keyboards/clueboard/60/60.h b/keyboards/clueboard/60/60.h index ffff18f9e44..713f0d42be8 100644 --- a/keyboards/clueboard/60/60.h +++ b/keyboards/clueboard/60/60.h @@ -19,15 +19,15 @@ #include "quantum.h" /* - * These are shortcuts to help you work with the various layout options. If your + * These are shortcuts to help you work with the various layout options. If your * keymap works with one of the LAYOUT_...() macros you are encouraged to use that - * and to contribute your keymap to the corresponding layout in + * and to contribute your keymap to the corresponding layout in * `qmk_firmware/layouts/community`. */ -/* The fully-featured KEYMAP() that has every single key available in the matrix. +/* The fully-featured LAYOUT_all() that has every single key available in the matrix. */ -#define KEYMAP(\ +#define LAYOUT_all(\ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ @@ -44,7 +44,7 @@ /* A layout that matches the Apple Extended Keyboard's main area. No split keys, * 3 mods on either side of the spacebar. */ -#define KEYMAP_AEK(\ +#define LAYOUT_aek(\ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2e, \ @@ -102,4 +102,7 @@ { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, KC_NO, k3e, }, \ { k40, k41, k42, KC_NO, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, k4a, k4b, k4c, KC_NO, k4e, }, \ } + +#define LAYOUT LAYOUT_all +#define KEYMAP LAYOUT_all #endif diff --git a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h b/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h deleted file mode 100644 index e09112eb982..00000000000 --- a/keyboards/clueboard/60/boards/GENERIC_STM32_F303XC/board.h +++ /dev/null @@ -1,1187 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for Clueboard 60% Keyboard - */ - -/* - * Board identifier. - */ -#define BOARD_GENERIC_STM32_F303XC -#define BOARD_NAME "Clueboard 60 PCB" - -/* - * Board oscillators-related settings. - * NOTE: LSE not fitted. - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 0U -#endif - -#define STM32_LSEDRV (3U << 3U) - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 8000000U -#endif - -// #define STM32_HSE_BYPASS - -/* - * MCU type as defined in the ST header. - */ -#define STM32F303xC - -/* - * IO pins assignments. - */ -#define GPIOA_PIN0 0U -#define GPIOA_PIN1 1U -#define GPIOA_PIN2 2U -#define GPIOA_PIN3 3U -#define GPIOA_PIN4 4U -#define GPIOA_PIN5 5U -#define GPIOA_PIN6 6U -#define GPIOA_PIN7 7U -#define GPIOA_PIN8 8U -#define GPIOA_PIN9 9U -#define GPIOA_PIN10 10U -#define GPIOA_USB_DM 11U -#define GPIOA_USB_DP 12U -#define GPIOA_SWDIO 13U -#define GPIOA_SWCLK 14U -#define GPIOA_PIN15 15U - -#define GPIOB_PIN0 0U -#define GPIOB_PIN1 1U -#define GPIOB_PIN2 2U -#define GPIOB_PIN3 3U -#define GPIOB_PIN4 4U -#define GPIOB_PIN5 5U -#define GPIOB_PIN6 6U -#define GPIOB_PIN7 7U -#define GPIOB_PIN8 8U -#define GPIOB_PIN9 9U -#define GPIOB_PIN10 10U -#define GPIOB_PIN11 11U -#define GPIOB_PIN12 12U -#define GPIOB_PIN13 13U -#define GPIOB_PIN14 14U -#define GPIOB_PIN15 15U - -#define GPIOC_PIN0 0U -#define GPIOC_PIN1 1U -#define GPIOC_PIN2 2U -#define GPIOC_PIN3 3U -#define GPIOC_PIN4 4U -#define GPIOC_PIN5 5U -#define GPIOC_PIN6 6U -#define GPIOC_PIN7 7U -#define GPIOC_PIN8 8U -#define GPIOC_PIN9 9U -#define GPIOC_PIN10 10U -#define GPIOC_PIN11 11U -#define GPIOC_PIN12 12U -#define GPIOC_PIN13 13U -#define GPIOC_PIN14 14U -#define GPIOC_PIN15 15U - -#define GPIOD_PIN0 0U -#define GPIOD_PIN1 1U -#define GPIOD_PIN2 2U -#define GPIOD_PIN3 3U -#define GPIOD_PIN4 4U -#define GPIOD_PIN5 5U -#define GPIOD_PIN6 6U -#define GPIOD_PIN7 7U -#define GPIOD_PIN8 8U -#define GPIOD_PIN9 9U -#define GPIOD_PIN10 10U -#define GPIOD_PIN11 11U -#define GPIOD_PIN12 12U -#define GPIOD_PIN13 13U -#define GPIOD_PIN14 14U -#define GPIOD_PIN15 15U - -#define GPIOE_PIN0 0U -#define GPIOE_PIN1 1U -#define GPIOE_PIN2 2U -#define GPIOE_PIN3 3U -#define GPIOE_PIN4 4U -#define GPIOE_PIN5 5U -#define GPIOE_PIN6 6U -#define GPIOE_PIN7 7U -#define GPIOE_PIN8 8U -#define GPIOE_PIN9 9U -#define GPIOE_PIN10 10U -#define GPIOE_PIN11 11U -#define GPIOE_PIN12 12U -#define GPIOE_PIN13 13U -#define GPIOE_PIN14 14U -#define GPIOE_PIN15 15U - -#define GPIOF_I2C2_SDA 0U -#define GPIOF_I2C2_SCL 1U -#define GPIOF_PIN2 2U -#define GPIOF_PIN3 3U -#define GPIOF_PIN4 4U -#define GPIOF_PIN5 5U -#define GPIOF_PIN6 6U -#define GPIOF_PIN7 7U -#define GPIOF_PIN8 8U -#define GPIOF_PIN9 9U -#define GPIOF_PIN10 10U -#define GPIOF_PIN11 11U -#define GPIOF_PIN12 12U -#define GPIOF_PIN13 13U -#define GPIOF_PIN14 14U -#define GPIOF_PIN15 15U - -#define GPIOG_PIN0 0U -#define GPIOG_PIN1 1U -#define GPIOG_PIN2 2U -#define GPIOG_PIN3 3U -#define GPIOG_PIN4 4U -#define GPIOG_PIN5 5U -#define GPIOG_PIN6 6U -#define GPIOG_PIN7 7U -#define GPIOG_PIN8 8U -#define GPIOG_PIN9 9U -#define GPIOG_PIN10 10U -#define GPIOG_PIN11 11U -#define GPIOG_PIN12 12U -#define GPIOG_PIN13 13U -#define GPIOG_PIN14 14U -#define GPIOG_PIN15 15U - -#define GPIOH_PIN0 0U -#define GPIOH_PIN1 1U -#define GPIOH_PIN2 2U -#define GPIOH_PIN3 3U -#define GPIOH_PIN4 4U -#define GPIOH_PIN5 5U -#define GPIOH_PIN6 6U -#define GPIOH_PIN7 7U -#define GPIOH_PIN8 8U -#define GPIOH_PIN9 9U -#define GPIOH_PIN10 10U -#define GPIOH_PIN11 11U -#define GPIOH_PIN12 12U -#define GPIOH_PIN13 13U -#define GPIOH_PIN14 14U -#define GPIOH_PIN15 15U - -/* - * IO lines assignments. - */ -#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) -#define LINE_USB_DM PAL_LINE(GPIOA, 11U) -#define LINE_USB_DP PAL_LINE(GPIOA, 12U) -#define LINE_SWDIO PAL_LINE(GPIOA, 13U) -#define LINE_SWCLK PAL_LINE(GPIOA, 14U) - -#define LINE_PIN6 PAL_LINE(GPIOF, 0U) -#define LINE_PIN7 PAL_LINE(GPIOF, 1U) - -#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) - - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) - -/* - * GPIOA setup: - * - * PA0 - NC - * PA1 - NC - * PA2 - COL1 - * PA3 - COL2 - * PA4 - SPEAKER1 - * PA5 - SPEAKER2 - * PA6 - COL3 - * PA7 - COL8 - * PA8 - COL6 - * PA9 - COL7 - * PA10 - ROW5 - * PA11 - USB_DM (alternate 14). - * PA12 - USB_DP (alternate 14). - * PA13 - SWDIO (alternate 0). - * PA14 - SWCLK (alternate 0). - * PA15 - ROW4 - */ -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ - PIN_MODE_INPUT(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_PIN2) | \ - PIN_MODE_INPUT(GPIOA_PIN3) | \ - PIN_MODE_INPUT(GPIOA_PIN4) | \ - PIN_MODE_INPUT(GPIOA_PIN5) | \ - PIN_MODE_INPUT(GPIOA_PIN6) | \ - PIN_MODE_INPUT(GPIOA_PIN7) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_PIN9) | \ - PIN_MODE_INPUT(GPIOA_PIN10) | \ - PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ - PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ - PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ - PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ - PIN_MODE_INPUT(GPIOA_PIN15)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ - PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ - PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ - PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ - PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN15)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ - PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ - PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN15)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_PIN2) | \ - PIN_ODR_HIGH(GPIOA_PIN3) | \ - PIN_ODR_HIGH(GPIOA_PIN4) | \ - PIN_ODR_HIGH(GPIOA_PIN5) | \ - PIN_ODR_HIGH(GPIOA_PIN6) | \ - PIN_ODR_HIGH(GPIOA_PIN7) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_PIN9) | \ - PIN_ODR_HIGH(GPIOA_PIN10) | \ - PIN_ODR_HIGH(GPIOA_USB_DM) | \ - PIN_ODR_HIGH(GPIOA_USB_DP) | \ - PIN_ODR_HIGH(GPIOA_SWDIO) | \ - PIN_ODR_HIGH(GPIOA_SWCLK) | \ - PIN_ODR_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ - PIN_AFIO_AF(GPIOA_PIN1, 0) | \ - PIN_AFIO_AF(GPIOA_PIN2, 0) | \ - PIN_AFIO_AF(GPIOA_PIN3, 0) | \ - PIN_AFIO_AF(GPIOA_PIN4, 0) | \ - PIN_AFIO_AF(GPIOA_PIN5, 5) | \ - PIN_AFIO_AF(GPIOA_PIN6, 5) | \ - PIN_AFIO_AF(GPIOA_PIN7, 5)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ - PIN_AFIO_AF(GPIOA_PIN9, 0) | \ - PIN_AFIO_AF(GPIOA_PIN10, 0) | \ - PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ - PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ - PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ - PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ - PIN_AFIO_AF(GPIOA_PIN15, 0)) - -/* - * GPIOB setup: - * - * PB0 - PIN0 (input pullup). - * PB1 - PIN1 (input pullup). - * PB2 - PIN2 (input pullup). - * PB3 - PIN3 (alternate 0). - * PB4 - PIN4 (input pullup). - * PB5 - PIN5 (input pullup). - * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). - * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). - * PB8 - PIN8 (input pullup). - * PB9 - PIN9 (input pullup). - * PB10 - PIN10 (input pullup). - * PB11 - PIN11 (input pullup). - * PB12 - PIN12 (input pullup). - * PB13 - PIN13 (input pullup). - * PB14 - PIN14 (input pullup). - * PB15 - PIN15 (input pullup). - */ -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ - PIN_MODE_INPUT(GPIOB_PIN1) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ - PIN_MODE_INPUT(GPIOB_PIN4) | \ - PIN_MODE_INPUT(GPIOB_PIN5) | \ - PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ - PIN_MODE_OUTPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_INPUT(GPIOB_PIN9) | \ - PIN_MODE_INPUT(GPIOB_PIN10) | \ - PIN_MODE_INPUT(GPIOB_PIN11) | \ - PIN_MODE_INPUT(GPIOB_PIN12) | \ - PIN_MODE_INPUT(GPIOB_PIN13) | \ - PIN_MODE_INPUT(GPIOB_PIN14) | \ - PIN_MODE_INPUT(GPIOB_PIN15)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ - PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ - PIN_OSPEED_HIGH(GPIOB_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ - PIN_OSPEED_HIGH(GPIOB_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN15)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ - PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN15)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ - PIN_ODR_HIGH(GPIOB_PIN1) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_PIN3) | \ - PIN_ODR_HIGH(GPIOB_PIN4) | \ - PIN_ODR_HIGH(GPIOB_PIN5) | \ - PIN_ODR_HIGH(GPIOB_PIN6) | \ - PIN_ODR_LOW(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_PIN9) | \ - PIN_ODR_HIGH(GPIOB_PIN10) | \ - PIN_ODR_HIGH(GPIOB_PIN11) | \ - PIN_ODR_HIGH(GPIOB_PIN12) | \ - PIN_ODR_HIGH(GPIOB_PIN13) | \ - PIN_ODR_HIGH(GPIOB_PIN14) | \ - PIN_ODR_HIGH(GPIOB_PIN15)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ - PIN_AFIO_AF(GPIOB_PIN1, 0) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0) | \ - PIN_AFIO_AF(GPIOB_PIN3, 0) | \ - PIN_AFIO_AF(GPIOB_PIN4, 0) | \ - PIN_AFIO_AF(GPIOB_PIN5, 0) | \ - PIN_AFIO_AF(GPIOB_PIN6, 4) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ - PIN_AFIO_AF(GPIOB_PIN9, 0) | \ - PIN_AFIO_AF(GPIOB_PIN10, 0) | \ - PIN_AFIO_AF(GPIOB_PIN11, 0) | \ - PIN_AFIO_AF(GPIOB_PIN12, 0) | \ - PIN_AFIO_AF(GPIOB_PIN13, 0) | \ - PIN_AFIO_AF(GPIOB_PIN14, 0) | \ - PIN_AFIO_AF(GPIOB_PIN15, 0)) - -/* - * GPIOC setup: - * - * PC0 - PIN0 (input pullup). - * PC1 - PIN1 (input pullup). - * PC2 - PIN2 (input pullup). - * PC3 - PIN3 (input pullup). - * PC4 - PIN4 (input pullup). - * PC5 - PIN5 (input pullup). - * PC6 - PIN6 (input pullup). - * PC7 - PIN7 (input pullup). - * PC8 - PIN8 (input pullup). - * PC9 - PIN9 (input pullup). - * PC10 - PIN10 (input pullup). - * PC11 - PIN11 (input pullup). - * PC12 - PIN12 (input pullup). - * PC13 - PIN13 (input pullup). - * PC14 - PIN14 (input floating). - * PC15 - PIN15 (input floating). - */ -#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ - PIN_MODE_INPUT(GPIOC_PIN1) | \ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PIN3) | \ - PIN_MODE_INPUT(GPIOC_PIN4) | \ - PIN_MODE_INPUT(GPIOC_PIN5) | \ - PIN_MODE_INPUT(GPIOC_PIN6) | \ - PIN_MODE_INPUT(GPIOC_PIN7) | \ - PIN_MODE_INPUT(GPIOC_PIN8) | \ - PIN_MODE_INPUT(GPIOC_PIN9) | \ - PIN_MODE_INPUT(GPIOC_PIN10) | \ - PIN_MODE_INPUT(GPIOC_PIN11) | \ - PIN_MODE_INPUT(GPIOC_PIN12) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_PIN14) | \ - PIN_MODE_INPUT(GPIOC_PIN15)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ - PIN_OSPEED_HIGH(GPIOC_PIN14) | \ - PIN_OSPEED_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN15)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ - PIN_ODR_HIGH(GPIOC_PIN1) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PIN3) | \ - PIN_ODR_HIGH(GPIOC_PIN4) | \ - PIN_ODR_HIGH(GPIOC_PIN5) | \ - PIN_ODR_HIGH(GPIOC_PIN6) | \ - PIN_ODR_HIGH(GPIOC_PIN7) | \ - PIN_ODR_HIGH(GPIOC_PIN8) | \ - PIN_ODR_HIGH(GPIOC_PIN9) | \ - PIN_ODR_HIGH(GPIOC_PIN10) | \ - PIN_ODR_HIGH(GPIOC_PIN11) | \ - PIN_ODR_HIGH(GPIOC_PIN12) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_PIN14) | \ - PIN_ODR_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ - PIN_AFIO_AF(GPIOC_PIN1, 0) | \ - PIN_AFIO_AF(GPIOC_PIN2, 0) | \ - PIN_AFIO_AF(GPIOC_PIN3, 0) | \ - PIN_AFIO_AF(GPIOC_PIN4, 0) | \ - PIN_AFIO_AF(GPIOC_PIN5, 0) | \ - PIN_AFIO_AF(GPIOC_PIN6, 0) | \ - PIN_AFIO_AF(GPIOC_PIN7, 0)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ - PIN_AFIO_AF(GPIOC_PIN9, 0) | \ - PIN_AFIO_AF(GPIOC_PIN10, 0) | \ - PIN_AFIO_AF(GPIOC_PIN11, 0) | \ - PIN_AFIO_AF(GPIOC_PIN12, 0) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0) | \ - PIN_AFIO_AF(GPIOC_PIN14, 0) | \ - PIN_AFIO_AF(GPIOC_PIN15, 0)) - -/* - * GPIOD setup: - * - * PD0 - PIN0 (input pullup). - * PD1 - PIN1 (input pullup). - * PD2 - PIN2 (input pullup). - * PD3 - PIN3 (input pullup). - * PD4 - PIN4 (input pullup). - * PD5 - PIN5 (input pullup). - * PD6 - PIN6 (input pullup). - * PD7 - PIN7 (input pullup). - * PD8 - PIN8 (input pullup). - * PD9 - PIN9 (input pullup). - * PD11 - PIN10 (input pullup). - * PD11 - PIN11 (input pullup). - * PD12 - PIN12 (input pullup). - * PD13 - PIN13 (input pullup). - * PD14 - PIN14 (input pullup). - * PD15 - PIN15 (input pullup). - */ -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ - PIN_MODE_INPUT(GPIOD_PIN1) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_INPUT(GPIOD_PIN4) | \ - PIN_MODE_INPUT(GPIOD_PIN5) | \ - PIN_MODE_INPUT(GPIOD_PIN6) | \ - PIN_MODE_INPUT(GPIOD_PIN7) | \ - PIN_MODE_INPUT(GPIOD_PIN8) | \ - PIN_MODE_INPUT(GPIOD_PIN9) | \ - PIN_MODE_INPUT(GPIOD_PIN10) | \ - PIN_MODE_INPUT(GPIOD_PIN11) | \ - PIN_MODE_INPUT(GPIOD_PIN12) | \ - PIN_MODE_INPUT(GPIOD_PIN13) | \ - PIN_MODE_INPUT(GPIOD_PIN14) | \ - PIN_MODE_INPUT(GPIOD_PIN15)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN15)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN15)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ - PIN_ODR_HIGH(GPIOD_PIN1) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_PIN4) | \ - PIN_ODR_HIGH(GPIOD_PIN5) | \ - PIN_ODR_HIGH(GPIOD_PIN6) | \ - PIN_ODR_HIGH(GPIOD_PIN7) | \ - PIN_ODR_HIGH(GPIOD_PIN8) | \ - PIN_ODR_HIGH(GPIOD_PIN9) | \ - PIN_ODR_HIGH(GPIOD_PIN10) | \ - PIN_ODR_HIGH(GPIOD_PIN11) | \ - PIN_ODR_HIGH(GPIOD_PIN12) | \ - PIN_ODR_HIGH(GPIOD_PIN13) | \ - PIN_ODR_HIGH(GPIOD_PIN14) | \ - PIN_ODR_HIGH(GPIOD_PIN15)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ - PIN_AFIO_AF(GPIOD_PIN1, 0) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0) | \ - PIN_AFIO_AF(GPIOD_PIN4, 0) | \ - PIN_AFIO_AF(GPIOD_PIN5, 0) | \ - PIN_AFIO_AF(GPIOD_PIN6, 0) | \ - PIN_AFIO_AF(GPIOD_PIN7, 0)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ - PIN_AFIO_AF(GPIOD_PIN9, 0) | \ - PIN_AFIO_AF(GPIOD_PIN10, 0) | \ - PIN_AFIO_AF(GPIOD_PIN11, 0) | \ - PIN_AFIO_AF(GPIOD_PIN12, 0) | \ - PIN_AFIO_AF(GPIOD_PIN13, 0) | \ - PIN_AFIO_AF(GPIOD_PIN14, 0) | \ - PIN_AFIO_AF(GPIOD_PIN15, 0)) - -/* - * GPIOE setup: - * - * PE0 - PIN0 (input pullup). - * PE1 - PIN1 (input pullup). - * PE2 - PIN2 (input pullup). - * PE3 - PIN3 L3GD20_CS (output pushpull maximum). - * PE4 - PIN4 (input pullup). - * PE5 - PIN5 (input pullup). - * PE6 - PIN6 (input pullup). - * PE7 - PIN7 (input pullup). - * PE8 - PIN8 (output pushpull maximum). - * PE9 - PIN9 (output pushpull maximum). - * PE10 - PIN10 (output pushpull maximum). - * PE11 - PIN11 (output pushpull maximum). - * PE12 - PIN12 (output pushpull maximum). - * PE13 - PIN13 (output pushpull maximum). - * PE14 - PIN14 (output pushpull maximum). - * PE15 - PIN15 (output pushpull maximum). - */ -#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ - PIN_MODE_INPUT(GPIOE_PIN1) | \ - PIN_MODE_INPUT(GPIOE_PIN2) |\ - PIN_MODE_OUTPUT(GPIOE_PIN3) | \ - PIN_MODE_INPUT(GPIOE_PIN4) |\ - PIN_MODE_INPUT(GPIOE_PIN5) |\ - PIN_MODE_INPUT(GPIOE_PIN6) | \ - PIN_MODE_INPUT(GPIOE_PIN7) | \ - PIN_MODE_OUTPUT(GPIOE_PIN8) | \ - PIN_MODE_OUTPUT(GPIOE_PIN9) | \ - PIN_MODE_OUTPUT(GPIOE_PIN10) | \ - PIN_MODE_OUTPUT(GPIOE_PIN11) | \ - PIN_MODE_OUTPUT(GPIOE_PIN12) | \ - PIN_MODE_OUTPUT(GPIOE_PIN13) | \ - PIN_MODE_OUTPUT(GPIOE_PIN14) | \ - PIN_MODE_OUTPUT(GPIOE_PIN15)) -#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ - PIN_OSPEED_HIGH(GPIOE_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ - PIN_OSPEED_HIGH(GPIOE_PIN8) | \ - PIN_OSPEED_HIGH(GPIOE_PIN9) | \ - PIN_OSPEED_HIGH(GPIOE_PIN10) | \ - PIN_OSPEED_HIGH(GPIOE_PIN11) | \ - PIN_OSPEED_HIGH(GPIOE_PIN12) | \ - PIN_OSPEED_HIGH(GPIOE_PIN13) | \ - PIN_OSPEED_HIGH(GPIOE_PIN14) | \ - PIN_OSPEED_HIGH(GPIOE_PIN15)) -#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ - PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ - PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ - PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ - PIN_PUPDR_FLOATING(GPIOE_PIN15)) -#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ - PIN_ODR_HIGH(GPIOE_PIN1) | \ - PIN_ODR_HIGH(GPIOE_PIN2) | \ - PIN_ODR_HIGH(GPIOE_PIN3) | \ - PIN_ODR_HIGH(GPIOE_PIN4) | \ - PIN_ODR_HIGH(GPIOE_PIN5) | \ - PIN_ODR_HIGH(GPIOE_PIN6) | \ - PIN_ODR_HIGH(GPIOE_PIN7) | \ - PIN_ODR_LOW(GPIOE_PIN8) | \ - PIN_ODR_LOW(GPIOE_PIN9) | \ - PIN_ODR_LOW(GPIOE_PIN10) | \ - PIN_ODR_LOW(GPIOE_PIN11) | \ - PIN_ODR_LOW(GPIOE_PIN12) | \ - PIN_ODR_LOW(GPIOE_PIN13) | \ - PIN_ODR_LOW(GPIOE_PIN14) | \ - PIN_ODR_LOW(GPIOE_PIN15)) -#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ - PIN_AFIO_AF(GPIOE_PIN1, 0) | \ - PIN_AFIO_AF(GPIOE_PIN2, 0) |\ - PIN_AFIO_AF(GPIOE_PIN3, 0) | \ - PIN_AFIO_AF(GPIOE_PIN4, 0) |\ - PIN_AFIO_AF(GPIOE_PIN5, 0) |\ - PIN_AFIO_AF(GPIOE_PIN6, 0) | \ - PIN_AFIO_AF(GPIOE_PIN7, 0)) -#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ - PIN_AFIO_AF(GPIOE_PIN9, 0) | \ - PIN_AFIO_AF(GPIOE_PIN10, 0) | \ - PIN_AFIO_AF(GPIOE_PIN11, 0) | \ - PIN_AFIO_AF(GPIOE_PIN12, 0) | \ - PIN_AFIO_AF(GPIOE_PIN13, 0) | \ - PIN_AFIO_AF(GPIOE_PIN14, 0) | \ - PIN_AFIO_AF(GPIOE_PIN15, 0)) - -/* - * GPIOF setup: - * - * PF0 - I2C2_SDA (input floating). - * PF1 - I2C2_SCL (input floating). - * PF2 - PIN2 (input pullup). - * PF3 - PIN3 (input pullup). - * PF4 - PIN4 (input pullup). - * PF5 - PIN5 (input pullup). - * PF6 - PIN6 (input pullup). - * PF7 - PIN7 (input pullup). - * PF8 - PIN8 (input pullup). - * PF9 - PIN9 (input pullup). - * PF10 - PIN10 (input pullup). - * PF11 - PIN11 (input pullup). - * PF12 - PIN12 (input pullup). - * PF13 - PIN13 (input pullup). - * PF14 - PIN14 (input pullup). - * PF15 - PIN15 (input pullup). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ - PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_PIN7) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ - PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ - PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ - PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ - PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_PIN7) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ - PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0) | \ - PIN_AFIO_AF(GPIOF_PIN7, 0)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0)) - -/* - * GPIOG setup: - * - * PG0 - PIN0 (input pullup). - * PG1 - PIN1 (input pullup). - * PG2 - PIN2 (input pullup). - * PG3 - PIN3 (input pullup). - * PG4 - PIN4 (input pullup). - * PG5 - PIN5 (input pullup). - * PG6 - PIN6 (input pullup). - * PG7 - PIN7 (input pullup). - * PG8 - PIN8 (input pullup). - * PG9 - PIN9 (input pullup). - * PG10 - PIN10 (input pullup). - * PG11 - PIN11 (input pullup). - * PG12 - PIN12 (input pullup). - * PG13 - PIN13 (input pullup). - * PG14 - PIN14 (input pullup). - * PG15 - PIN15 (input pullup). - */ -#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ - PIN_MODE_INPUT(GPIOG_PIN1) | \ - PIN_MODE_INPUT(GPIOG_PIN2) | \ - PIN_MODE_INPUT(GPIOG_PIN3) | \ - PIN_MODE_INPUT(GPIOG_PIN4) | \ - PIN_MODE_INPUT(GPIOG_PIN5) | \ - PIN_MODE_INPUT(GPIOG_PIN6) | \ - PIN_MODE_INPUT(GPIOG_PIN7) | \ - PIN_MODE_INPUT(GPIOG_PIN8) | \ - PIN_MODE_INPUT(GPIOG_PIN9) | \ - PIN_MODE_INPUT(GPIOG_PIN10) | \ - PIN_MODE_INPUT(GPIOG_PIN11) | \ - PIN_MODE_INPUT(GPIOG_PIN12) | \ - PIN_MODE_INPUT(GPIOG_PIN13) | \ - PIN_MODE_INPUT(GPIOG_PIN14) | \ - PIN_MODE_INPUT(GPIOG_PIN15)) -#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN15)) -#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN15)) -#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ - PIN_ODR_HIGH(GPIOG_PIN1) | \ - PIN_ODR_HIGH(GPIOG_PIN2) | \ - PIN_ODR_HIGH(GPIOG_PIN3) | \ - PIN_ODR_HIGH(GPIOG_PIN4) | \ - PIN_ODR_HIGH(GPIOG_PIN5) | \ - PIN_ODR_HIGH(GPIOG_PIN6) | \ - PIN_ODR_HIGH(GPIOG_PIN7) | \ - PIN_ODR_HIGH(GPIOG_PIN8) | \ - PIN_ODR_HIGH(GPIOG_PIN9) | \ - PIN_ODR_HIGH(GPIOG_PIN10) | \ - PIN_ODR_HIGH(GPIOG_PIN11) | \ - PIN_ODR_HIGH(GPIOG_PIN12) | \ - PIN_ODR_HIGH(GPIOG_PIN13) | \ - PIN_ODR_HIGH(GPIOG_PIN14) | \ - PIN_ODR_HIGH(GPIOG_PIN15)) -#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ - PIN_AFIO_AF(GPIOG_PIN1, 0) | \ - PIN_AFIO_AF(GPIOG_PIN2, 0) | \ - PIN_AFIO_AF(GPIOG_PIN3, 0) | \ - PIN_AFIO_AF(GPIOG_PIN4, 0) | \ - PIN_AFIO_AF(GPIOG_PIN5, 0) | \ - PIN_AFIO_AF(GPIOG_PIN6, 0) | \ - PIN_AFIO_AF(GPIOG_PIN7, 0)) -#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ - PIN_AFIO_AF(GPIOG_PIN9, 0) | \ - PIN_AFIO_AF(GPIOG_PIN10, 0) | \ - PIN_AFIO_AF(GPIOG_PIN11, 0) | \ - PIN_AFIO_AF(GPIOG_PIN12, 0) | \ - PIN_AFIO_AF(GPIOG_PIN13, 0) | \ - PIN_AFIO_AF(GPIOG_PIN14, 0) | \ - PIN_AFIO_AF(GPIOG_PIN15, 0)) - -/* - * GPIOH setup: - * - * PH0 - PIN0 (input pullup). - * PH1 - PIN1 (input pullup). - * PH2 - PIN2 (input pullup). - * PH3 - PIN3 (input pullup). - * PH4 - PIN4 (input pullup). - * PH5 - PIN5 (input pullup). - * PH6 - PIN6 (input pullup). - * PH7 - PIN7 (input pullup). - * PH8 - PIN8 (input pullup). - * PH9 - PIN9 (input pullup). - * PH10 - PIN10 (input pullup). - * PH11 - PIN11 (input pullup). - * PH12 - PIN12 (input pullup). - * PH13 - PIN13 (input pullup). - * PH14 - PIN14 (input pullup). - * PH15 - PIN15 (input pullup). - */ -#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ - PIN_MODE_INPUT(GPIOH_PIN1) | \ - PIN_MODE_INPUT(GPIOH_PIN2) | \ - PIN_MODE_INPUT(GPIOH_PIN3) | \ - PIN_MODE_INPUT(GPIOH_PIN4) | \ - PIN_MODE_INPUT(GPIOH_PIN5) | \ - PIN_MODE_INPUT(GPIOH_PIN6) | \ - PIN_MODE_INPUT(GPIOH_PIN7) | \ - PIN_MODE_INPUT(GPIOH_PIN8) | \ - PIN_MODE_INPUT(GPIOH_PIN9) | \ - PIN_MODE_INPUT(GPIOH_PIN10) | \ - PIN_MODE_INPUT(GPIOH_PIN11) | \ - PIN_MODE_INPUT(GPIOH_PIN12) | \ - PIN_MODE_INPUT(GPIOH_PIN13) | \ - PIN_MODE_INPUT(GPIOH_PIN14) | \ - PIN_MODE_INPUT(GPIOH_PIN15)) -#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN15)) -#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN15)) -#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ - PIN_ODR_HIGH(GPIOH_PIN1) | \ - PIN_ODR_HIGH(GPIOH_PIN2) | \ - PIN_ODR_HIGH(GPIOH_PIN3) | \ - PIN_ODR_HIGH(GPIOH_PIN4) | \ - PIN_ODR_HIGH(GPIOH_PIN5) | \ - PIN_ODR_HIGH(GPIOH_PIN6) | \ - PIN_ODR_HIGH(GPIOH_PIN7) | \ - PIN_ODR_HIGH(GPIOH_PIN8) | \ - PIN_ODR_HIGH(GPIOH_PIN9) | \ - PIN_ODR_HIGH(GPIOH_PIN10) | \ - PIN_ODR_HIGH(GPIOH_PIN11) | \ - PIN_ODR_HIGH(GPIOH_PIN12) | \ - PIN_ODR_HIGH(GPIOH_PIN13) | \ - PIN_ODR_HIGH(GPIOH_PIN14) | \ - PIN_ODR_HIGH(GPIOH_PIN15)) -#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ - PIN_AFIO_AF(GPIOH_PIN1, 0) | \ - PIN_AFIO_AF(GPIOH_PIN2, 0) | \ - PIN_AFIO_AF(GPIOH_PIN3, 0) | \ - PIN_AFIO_AF(GPIOH_PIN4, 0) | \ - PIN_AFIO_AF(GPIOH_PIN5, 0) | \ - PIN_AFIO_AF(GPIOH_PIN6, 0) | \ - PIN_AFIO_AF(GPIOH_PIN7, 0)) -#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ - PIN_AFIO_AF(GPIOH_PIN9, 0) | \ - PIN_AFIO_AF(GPIOH_PIN10, 0) | \ - PIN_AFIO_AF(GPIOH_PIN11, 0) | \ - PIN_AFIO_AF(GPIOH_PIN12, 0) | \ - PIN_AFIO_AF(GPIOH_PIN13, 0) | \ - PIN_AFIO_AF(GPIOH_PIN14, 0) | \ - PIN_AFIO_AF(GPIOH_PIN15, 0)) - - -/* - * USB bus activation macro, required by the USB driver. - */ -// #define usb_lld_connect_bus(usbp) -#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) -// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) -/* - * USB bus de-activation macro, required by the USB driver. - */ -// #define usb_lld_disconnect_bus(usbp) -#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) -// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/keyboards/clueboard/60/config.h b/keyboards/clueboard/60/config.h index a862d2cda3f..aa544c70bba 100644 --- a/keyboards/clueboard/60/config.h +++ b/keyboards/clueboard/60/config.h @@ -15,8 +15,9 @@ * along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once + +#include "config_common.h" /* USB Device descriptor parameter */ #define VENDOR_ID 0xC1ED @@ -26,6 +27,12 @@ #define PRODUCT Clueboard 60% #define DESCRIPTION Clueboard 60% +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 + /* key matrix size */ #define MATRIX_ROWS 5 #define MATRIX_COLS 15 @@ -33,18 +40,16 @@ /* * Keyboard Matrix Assignments * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom + * COLS: Pins used for columns, left to right + * ROWS: Pins used for rows, top to bottom * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * */ -/* Note: These are not used for arm boards. They're here purely as documentation. - * #define MATRIX_ROW_PINS { PB0, PB1, PB2, PA15, PA10 } - * #define MATRIX_COL_PINS { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC14, PC15, PC13, PB5, PB6 } - * #define UNUSED_PINS - */ +#define MATRIX_ROW_PINS { B0, B1, B2, A15, A10 } +#define MATRIX_COL_PINS { A2, A3, A6, B14, B15, A8, A9, A7, B3, B4, C14, C15, C13, B5, B6 } +#define UNUSED_PINS { A0, A1, A9, B7, B8, B9, B10, B11, B12, B13 } +#define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 6 @@ -75,11 +80,6 @@ */ //#define FORCE_NKRO -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -121,8 +121,6 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#endif - /* Backlight configuration */ #define BACKLIGHT_LEVELS 1 diff --git a/keyboards/clueboard/60/info.json b/keyboards/clueboard/60/info.json index abafb69f99e..aed18b6f05c 100644 --- a/keyboards/clueboard/60/info.json +++ b/keyboards/clueboard/60/info.json @@ -8,1642 +8,51 @@ "LAYOUT_60_ansi": { "key_count": 61, "layout": [ - { - "label": "~", - "x": 0, - "y": 0 - }, - { - "label": "!", - "x": 1, - "y": 0 - }, - { - "label": "@", - "x": 2, - "y": 0 - }, - { - "label": "#", - "x": 3, - "y": 0 - }, - { - "label": "$", - "x": 4, - "y": 0 - }, - { - "label": "%", - "x": 5, - "y": 0 - }, - { - "label": "^", - "x": 6, - "y": 0 - }, - { - "label": "&", - "x": 7, - "y": 0 - }, - { - "label": "*", - "x": 8, - "y": 0 - }, - { - "label": "(", - "x": 9, - "y": 0 - }, - { - "label": ")", - "x": 10, - "y": 0 - }, - { - "label": "_", - "x": 11, - "y": 0 - }, - { - "label": "+", - "x": 12, - "y": 0 - }, - { - "label": "Backspace", - "x": 13, - "y": 0, - "w": 2 - }, - { - "label": "Tab", - "x": 0, - "y": 1, - "w": 1.5 - }, - { - "label": "Q", - "x": 1.5, - "y": 1 - }, - { - "label": "W", - "x": 2.5, - "y": 1 - }, - { - "label": "E", - "x": 3.5, - "y": 1 - }, - { - "label": "R", - "x": 4.5, - "y": 1 - }, - { - "label": "T", - "x": 5.5, - "y": 1 - }, - { - "label": "Y", - "x": 6.5, - "y": 1 - }, - { - "label": "U", - "x": 7.5, - "y": 1 - }, - { - "label": "I", - "x": 8.5, - "y": 1 - }, - { - "label": "O", - "x": 9.5, - "y": 1 - }, - { - "label": "P", - "x": 10.5, - "y": 1 - }, - { - "label": "{", - "x": 11.5, - "y": 1 - }, - { - "label": "}", - "x": 12.5, - "y": 1 - }, - { - "label": "|", - "x": 13.5, - "y": 1, - "w": 1.5 - }, - { - "label": "Caps Lock", - "x": 0, - "y": 2, - "w": 1.75 - }, - { - "label": "A", - "x": 1.75, - "y": 2 - }, - { - "label": "S", - "x": 2.75, - "y": 2 - }, - { - "label": "D", - "x": 3.75, - "y": 2 - }, - { - "label": "F", - "x": 4.75, - "y": 2 - }, - { - "label": "G", - "x": 5.75, - "y": 2 - }, - { - "label": "H", - "x": 6.75, - "y": 2 - }, - { - "label": "J", - "x": 7.75, - "y": 2 - }, - { - "label": "K", - "x": 8.75, - "y": 2 - }, - { - "label": "L", - "x": 9.75, - "y": 2 - }, - { - "label": ":", - "x": 10.75, - "y": 2 - }, - { - "label": "\"", - "x": 11.75, - "y": 2 - }, - { - "label": "Enter", - "x": 12.75, - "y": 2, - "w": 2.25 - }, - { - "label": "Shift", - "x": 0, - "y": 3, - "w": 2.25 - }, - { - "label": "Z", - "x": 2.25, - "y": 3 - }, - { - "label": "X", - "x": 3.25, - "y": 3 - }, - { - "label": "C", - "x": 4.25, - "y": 3 - }, - { - "label": "V", - "x": 5.25, - "y": 3 - }, - { - "label": "B", - "x": 6.25, - "y": 3 - }, - { - "label": "N", - "x": 7.25, - "y": 3 - }, - { - "label": "M", - "x": 8.25, - "y": 3 - }, - { - "label": "<", - "x": 9.25, - "y": 3 - }, - { - "label": ">", - "x": 10.25, - "y": 3 - }, - { - "label": "?", - "x": 11.25, - "y": 3 - }, - { - "label": "Shift", - "x": 12.25, - "y": 3, - "w": 2.75 - }, - { - "label": "Ctrl", - "x": 0, - "y": 4, - "w": 1.25 - }, - { - "label": "Win", - "x": 1.25, - "y": 4, - "w": 1.25 - }, - { - "label": "Alt", - "x": 2.5, - "y": 4, - "w": 1.25 - }, - { - "x": 3.75, - "y": 4, - "w": 6.25 - }, - { - "label": "Alt", - "x": 10, - "y": 4, - "w": 1.25 - }, - { - "label": "Win", - "x": 11.25, - "y": 4, - "w": 1.25 - }, - { - "label": "Menu", - "x": 12.5, - "y": 4, - "w": 1.25 - }, - { - "label": "Ctrl", - "x": 13.75, - "y": 4, - "w": 1.25 - } + {"label": "~", "x": 0, "y": 0}, {"label": "!", "x": 1, "y": 0}, {"label": "@", "x": 2, "y": 0}, {"label": "#", "x": 3, "y": 0}, {"label": "$", "x": 4, "y": 0}, {"label": "%", "x": 5, "y": 0}, {"label": "^", "x": 6, "y": 0}, {"label": "&", "x": 7, "y": 0}, {"label": "*", "x": 8, "y": 0}, {"label": "(", "x": 9, "y": 0}, {"label": ")", "x": 10, "y": 0}, {"label": "_", "x": 11, "y": 0}, {"label": "+", "x": 12, "y": 0}, {"label": "Backspace", "x": 13, "y": 0, "w": 2}, + {"label": "Tab", "x": 0, "y": 1, "w": 1.5}, {"label": "Q", "x": 1.5, "y": 1}, {"label": "W", "x": 2.5, "y": 1}, {"label": "E", "x": 3.5, "y": 1}, {"label": "R", "x": 4.5, "y": 1}, {"label": "T", "x": 5.5, "y": 1}, {"label": "Y", "x": 6.5, "y": 1}, {"label": "U", "x": 7.5, "y": 1}, {"label": "I", "x": 8.5, "y": 1}, {"label": "O", "x": 9.5, "y": 1}, {"label": "P", "x": 10.5, "y": 1}, {"label": "{", "x": 11.5, "y": 1}, {"label": "}", "x": 12.5, "y": 1}, {"label": "|", "x": 13.5, "y": 1, "w": 1.5}, + {"label": "Caps Lock", "x": 0, "y": 2, "w": 1.75}, {"label": "A", "x": 1.75, "y": 2}, {"label": "S", "x": 2.75, "y": 2}, {"label": "D", "x": 3.75, "y": 2}, {"label": "F", "x": 4.75, "y": 2}, {"label": "G", "x": 5.75, "y": 2}, {"label": "H", "x": 6.75, "y": 2}, {"label": "J", "x": 7.75, "y": 2}, {"label": "K", "x": 8.75, "y": 2}, {"label": "L", "x": 9.75, "y": 2}, {"label": ":", "x": 10.75, "y": 2}, {"label": "\"", "x": 11.75, "y": 2}, {"label": "Enter", "x": 12.75, "y": 2, "w": 2.25}, + {"label": "Shift", "x": 0, "y": 3, "w": 2.25}, {"label": "Z", "x": 2.25, "y": 3}, {"label": "X", "x": 3.25, "y": 3}, {"label": "C", "x": 4.25, "y": 3}, {"label": "V", "x": 5.25, "y": 3}, {"label": "B", "x": 6.25, "y": 3}, {"label": "N", "x": 7.25, "y": 3}, {"label": "M", "x": 8.25, "y": 3}, {"label": "<", "x": 9.25, "y": 3}, {"label": ">", "x": 10.25, "y": 3}, {"label": "?", "x": 11.25, "y": 3}, {"label": "Shift", "x": 12.25, "y": 3, "w": 2.75}, + {"label": "Ctrl", "x": 0, "y": 4, "w": 1.25}, {"label": "Win", "x": 1.25, "y": 4, "w": 1.25}, {"label": "Alt", "x": 2.5, "y": 4, "w": 1.25}, {"x": 3.75, "y": 4, "w": 6.25}, {"label": "Alt", "x": 10, "y": 4, "w": 1.25}, {"label": "Win", "x": 11.25, "y": 4, "w": 1.25}, {"label": "Menu", "x": 12.5, "y": 4, "w": 1.25}, {"label": "Ctrl", "x": 13.75, "y": 4, "w": 1.25 } ] - }, + }, "LAYOUT_60_iso": { "key_count": 62, "layout": [ - { - "label": "\\u00ac", - "x": 0, - "y": 0 - }, - { - "label": "!", - "x": 1, - "y": 0 - }, - { - "label": "\"", - "x": 2, - "y": 0 - }, - { - "label": "\\u00a3", - "x": 3, - "y": 0 - }, - { - "label": "$", - "x": 4, - "y": 0 - }, - { - "label": "%", - "x": 5, - "y": 0 - }, - { - "label": "^", - "x": 6, - "y": 0 - }, - { - "label": "&", - "x": 7, - "y": 0 - }, - { - "label": "*", - "x": 8, - "y": 0 - }, - { - "label": "(", - "x": 9, - "y": 0 - }, - { - "label": ")", - "x": 10, - "y": 0 - }, - { - "label": "_", - "x": 11, - "y": 0 - }, - { - "label": "+", - "x": 12, - "y": 0 - }, - { - "label": "Backspace", - "x": 13, - "y": 0, - "w": 2 - }, - { - "label": "Tab", - "x": 0, - "y": 1, - "w": 1.5 - }, - { - "label": "Q", - "x": 1.5, - "y": 1 - }, - { - "label": "W", - "x": 2.5, - "y": 1 - }, - { - "label": "E", - "x": 3.5, - "y": 1 - }, - { - "label": "R", - "x": 4.5, - "y": 1 - }, - { - "label": "T", - "x": 5.5, - "y": 1 - }, - { - "label": "Y", - "x": 6.5, - "y": 1 - }, - { - "label": "U", - "x": 7.5, - "y": 1 - }, - { - "label": "I", - "x": 8.5, - "y": 1 - }, - { - "label": "O", - "x": 9.5, - "y": 1 - }, - { - "label": "P", - "x": 10.5, - "y": 1 - }, - { - "label": "{", - "x": 11.5, - "y": 1 - }, - { - "label": "}", - "x": 12.5, - "y": 1 - }, - { - "label": "Enter", - "x": 13.75, - "y": 1, - "w": 1.25, - "h": 2 - }, - { - "label": "Caps Lock", - "x": 0, - "y": 2, - "w": 1.75 - }, - { - "label": "A", - "x": 1.75, - "y": 2 - }, - { - "label": "S", - "x": 2.75, - "y": 2 - }, - { - "label": "D", - "x": 3.75, - "y": 2 - }, - { - "label": "F", - "x": 4.75, - "y": 2 - }, - { - "label": "G", - "x": 5.75, - "y": 2 - }, - { - "label": "H", - "x": 6.75, - "y": 2 - }, - { - "label": "J", - "x": 7.75, - "y": 2 - }, - { - "label": "K", - "x": 8.75, - "y": 2 - }, - { - "label": "L", - "x": 9.75, - "y": 2 - }, - { - "label": ":", - "x": 10.75, - "y": 2 - }, - { - "label": "@", - "x": 11.75, - "y": 2 - }, - { - "label": "~", - "x": 12.75, - "y": 2 - }, - { - "label": "Shift", - "x": 0, - "y": 3, - "w": 1.25 - }, - { - "label": "|", - "x": 1.25, - "y": 3 - }, - { - "label": "Z", - "x": 2.25, - "y": 3 - }, - { - "label": "X", - "x": 3.25, - "y": 3 - }, - { - "label": "C", - "x": 4.25, - "y": 3 - }, - { - "label": "V", - "x": 5.25, - "y": 3 - }, - { - "label": "B", - "x": 6.25, - "y": 3 - }, - { - "label": "N", - "x": 7.25, - "y": 3 - }, - { - "label": "M", - "x": 8.25, - "y": 3 - }, - { - "label": "<", - "x": 9.25, - "y": 3 - }, - { - "label": ">", - "x": 10.25, - "y": 3 - }, - { - "label": "?", - "x": 11.25, - "y": 3 - }, - { - "label": "Shift", - "x": 12.25, - "y": 3, - "w": 2.75 - }, - { - "label": "Ctrl", - "x": 0, - "y": 4, - "w": 1.25 - }, - { - "label": "Win", - "x": 1.25, - "y": 4, - "w": 1.25 - }, - { - "label": "Alt", - "x": 2.5, - "y": 4, - "w": 1.25 - }, - { - "x": 3.75, - "y": 4, - "w": 6.25 - }, - { - "label": "AltGr", - "x": 10, - "y": 4, - "w": 1.25 - }, - { - "label": "Win", - "x": 11.25, - "y": 4, - "w": 1.25 - }, - { - "label": "Menu", - "x": 12.5, - "y": 4, - "w": 1.25 - }, - { - "label": "Ctrl", - "x": 13.75, - "y": 4, - "w": 1.25 - } + {"label": "\\u00ac", "x": 0, "y": 0}, {"label": "!", "x": 1, "y": 0}, {"label": "\"", "x": 2, "y": 0}, {"label": "\\u00a3", "x": 3, "y": 0}, {"label": "$", "x": 4, "y": 0}, {"label": "%", "x": 5, "y": 0}, {"label": "^", "x": 6, "y": 0}, {"label": "&", "x": 7, "y": 0}, {"label": "*", "x": 8, "y": 0}, {"label": "(", "x": 9, "y": 0}, {"label": ")", "x": 10, "y": 0}, {"label": "_", "x": 11, "y": 0}, {"label": "+", "x": 12, "y": 0}, {"label": "Backspace", "x": 13, "y": 0, "w": 2}, + {"label": "Tab", "x": 0, "y": 1, "w": 1.5}, {"label": "Q", "x": 1.5, "y": 1}, {"label": "W", "x": 2.5, "y": 1}, {"label": "E", "x": 3.5, "y": 1}, {"label": "R", "x": 4.5, "y": 1}, {"label": "T", "x": 5.5, "y": 1}, {"label": "Y", "x": 6.5, "y": 1}, {"label": "U", "x": 7.5, "y": 1}, {"label": "I", "x": 8.5, "y": 1}, {"label": "O", "x": 9.5, "y": 1}, {"label": "P", "x": 10.5, "y": 1}, {"label": "{", "x": 11.5, "y": 1}, {"label": "}", "x": 12.5, "y": 1}, {"label": "Enter", "x": 13.75, "y": 1, "w": 1.25, "h": 2}, + {"label": "Caps Lock", "x": 0, "y": 2, "w": 1.75}, {"label": "A", "x": 1.75, "y": 2}, {"label": "S", "x": 2.75, "y": 2}, {"label": "D", "x": 3.75, "y": 2}, {"label": "F", "x": 4.75, "y": 2}, {"label": "G", "x": 5.75, "y": 2}, {"label": "H", "x": 6.75, "y": 2}, {"label": "J", "x": 7.75, "y": 2}, {"label": "K", "x": 8.75, "y": 2}, {"label": "L", "x": 9.75, "y": 2}, {"label": ":", "x": 10.75, "y": 2}, {"label": "@", "x": 11.75, "y": 2}, {"label": "~", "x": 12.75, "y": 2}, + {"label": "Shift", "x": 0, "y": 3, "w": 1.25}, {"label": "|", "x": 1.25, "y": 3}, {"label": "Z", "x": 2.25, "y": 3}, {"label": "X", "x": 3.25, "y": 3}, {"label": "C", "x": 4.25, "y": 3}, {"label": "V", "x": 5.25, "y": 3}, {"label": "B", "x": 6.25, "y": 3}, {"label": "N", "x": 7.25, "y": 3}, {"label": "M", "x": 8.25, "y": 3}, {"label": "<", "x": 9.25, "y": 3}, {"label": ">", "x": 10.25, "y": 3}, {"label": "?", "x": 11.25, "y": 3}, {"label": "Shift", "x": 12.25, "y": 3, "w": 2.75}, + {"label": "Ctrl", "x": 0, "y": 4, "w": 1.25}, {"label": "Win", "x": 1.25, "y": 4, "w": 1.25}, {"label": "Alt", "x": 2.5, "y": 4, "w": 1.25}, {"x": 3.75, "y": 4, "w": 6.25}, {"label": "AltGr", "x": 10, "y": 4, "w": 1.25}, {"label": "Win", "x": 11.25, "y": 4, "w": 1.25}, {"label": "Menu", "x": 12.5, "y": 4, "w": 1.25}, {"label": "Ctrl", "x": 13.75, "y": 4, "w": 1.25 } ] - }, - "KEYMAP_AEK": { + }, + "LAYOUT_aek": { "key_count": 60, "layout": [ - { - "label": "~", - "x": 0, - "y": 0 - }, - { - "label": "!", - "x": 1, - "y": 0 - }, - { - "label": "@", - "x": 2, - "y": 0 - }, - { - "label": "#", - "x": 3, - "y": 0 - }, - { - "label": "$", - "x": 4, - "y": 0 - }, - { - "label": "%", - "x": 5, - "y": 0 - }, - { - "label": "^", - "x": 6, - "y": 0 - }, - { - "label": "&", - "x": 7, - "y": 0 - }, - { - "label": "*", - "x": 8, - "y": 0 - }, - { - "label": "(", - "x": 9, - "y": 0 - }, - { - "label": ")", - "x": 10, - "y": 0 - }, - { - "label": "_", - "x": 11, - "y": 0 - }, - { - "label": "+", - "x": 12, - "y": 0 - }, - { - "label": "Backspace", - "x": 13, - "y": 0, - "w": 2 - }, - { - "label": "Tab", - "x": 0, - "y": 1, - "w": 1.5 - }, - { - "label": "Q", - "x": 1.5, - "y": 1 - }, - { - "label": "W", - "x": 2.5, - "y": 1 - }, - { - "label": "E", - "x": 3.5, - "y": 1 - }, - { - "label": "R", - "x": 4.5, - "y": 1 - }, - { - "label": "T", - "x": 5.5, - "y": 1 - }, - { - "label": "Y", - "x": 6.5, - "y": 1 - }, - { - "label": "U", - "x": 7.5, - "y": 1 - }, - { - "label": "I", - "x": 8.5, - "y": 1 - }, - { - "label": "O", - "x": 9.5, - "y": 1 - }, - { - "label": "P", - "x": 10.5, - "y": 1 - }, - { - "label": "{", - "x": 11.5, - "y": 1 - }, - { - "label": "}", - "x": 12.5, - "y": 1 - }, - { - "label": "|", - "x": 13.5, - "y": 1, - "w": 1.5 - }, - { - "label": "Caps Lock", - "x": 0, - "y": 2, - "w": 1.75 - }, - { - "label": "A", - "x": 1.75, - "y": 2 - }, - { - "label": "S", - "x": 2.75, - "y": 2 - }, - { - "label": "D", - "x": 3.75, - "y": 2 - }, - { - "label": "F", - "x": 4.75, - "y": 2 - }, - { - "label": "G", - "x": 5.75, - "y": 2 - }, - { - "label": "H", - "x": 6.75, - "y": 2 - }, - { - "label": "J", - "x": 7.75, - "y": 2 - }, - { - "label": "K", - "x": 8.75, - "y": 2 - }, - { - "label": "L", - "x": 9.75, - "y": 2 - }, - { - "label": ":", - "x": 10.75, - "y": 2 - }, - { - "label": "\"", - "x": 11.75, - "y": 2 - }, - { - "label": "Enter", - "x": 12.75, - "y": 2, - "w": 2.25 - }, - { - "label": "Shift", - "x": 0, - "y": 3, - "w": 2.25 - }, - { - "label": "Z", - "x": 2.25, - "y": 3 - }, - { - "label": "X", - "x": 3.25, - "y": 3 - }, - { - "label": "C", - "x": 4.25, - "y": 3 - }, - { - "label": "V", - "x": 5.25, - "y": 3 - }, - { - "label": "B", - "x": 6.25, - "y": 3 - }, - { - "label": "N", - "x": 7.25, - "y": 3 - }, - { - "label": "M", - "x": 8.25, - "y": 3 - }, - { - "label": "<", - "x": 9.25, - "y": 3 - }, - { - "label": ">", - "x": 10.25, - "y": 3 - }, - { - "label": "?", - "x": 11.25, - "y": 3 - }, - { - "label": "Shift", - "x": 12.25, - "y": 3, - "w": 2.75 - }, - { - "label": "Ctrl", - "x": 0, - "y": 4, - "w": 1.5 - }, - { - "label": "Win", - "x": 1.5, - "y": 4, - "w": 1.25 - }, - { - "label": "Alt", - "x": 2.75, - "y": 4, - "w": 1.5 - }, - { - "x": 4.25, - "y": 4, - "w": 6.5 - }, - { - "label": "AltGr", - "x": 10.75, - "y": 4, - "w": 1.5 - }, - { - "label": "Win", - "x": 12.25, - "y": 4, - "w": 1.25 - }, - { - "label": "Ctrl", - "x": 13.5, - "y": 4, - "w": 1.5 - } + {"label": "~", "x": 0, "y": 0}, {"label": "!", "x": 1, "y": 0}, {"label": "@", "x": 2, "y": 0}, {"label": "#", "x": 3, "y": 0}, {"label": "$", "x": 4, "y": 0}, {"label": "%", "x": 5, "y": 0}, {"label": "^", "x": 6, "y": 0}, {"label": "&", "x": 7, "y": 0}, {"label": "*", "x": 8, "y": 0}, {"label": "(", "x": 9, "y": 0}, {"label": ")", "x": 10, "y": 0}, {"label": "_", "x": 11, "y": 0}, {"label": "+", "x": 12, "y": 0}, {"label": "Backspace", "x": 13, "y": 0, "w": 2}, + {"label": "Tab", "x": 0, "y": 1, "w": 1.5}, {"label": "Q", "x": 1.5, "y": 1}, {"label": "W", "x": 2.5, "y": 1}, {"label": "E", "x": 3.5, "y": 1}, {"label": "R", "x": 4.5, "y": 1}, {"label": "T", "x": 5.5, "y": 1}, {"label": "Y", "x": 6.5, "y": 1}, {"label": "U", "x": 7.5, "y": 1}, {"label": "I", "x": 8.5, "y": 1}, {"label": "O", "x": 9.5, "y": 1}, {"label": "P", "x": 10.5, "y": 1}, {"label": "{", "x": 11.5, "y": 1}, {"label": "}", "x": 12.5, "y": 1}, {"label": "|", "x": 13.5, "y": 1, "w": 1.5}, + {"label": "Caps Lock", "x": 0, "y": 2, "w": 1.75}, {"label": "A", "x": 1.75, "y": 2}, {"label": "S", "x": 2.75, "y": 2}, {"label": "D", "x": 3.75, "y": 2}, {"label": "F", "x": 4.75, "y": 2}, {"label": "G", "x": 5.75, "y": 2}, {"label": "H", "x": 6.75, "y": 2}, {"label": "J", "x": 7.75, "y": 2}, {"label": "K", "x": 8.75, "y": 2}, {"label": "L", "x": 9.75, "y": 2}, {"label": ":", "x": 10.75, "y": 2}, {"label": "\"", "x": 11.75, "y": 2}, {"label": "Enter", "x": 12.75, "y": 2, "w": 2.25}, + {"label": "Shift", "x": 0, "y": 3, "w": 2.25}, {"label": "Z", "x": 2.25, "y": 3}, {"label": "X", "x": 3.25, "y": 3}, {"label": "C", "x": 4.25, "y": 3}, {"label": "V", "x": 5.25, "y": 3}, {"label": "B", "x": 6.25, "y": 3}, {"label": "N", "x": 7.25, "y": 3}, {"label": "M", "x": 8.25, "y": 3}, {"label": "<", "x": 9.25, "y": 3}, {"label": ">", "x": 10.25, "y": 3}, {"label": "?", "x": 11.25, "y": 3}, {"label": "Shift", "x": 12.25, "y": 3, "w": 2.75}, + {"label": "Ctrl", "x": 0, "y": 4, "w": 1.5}, {"label": "Win", "x": 1.5, "y": 4, "w": 1.25}, {"label": "Alt", "x": 2.75, "y": 4, "w": 1.5}, {"x": 4.25, "y": 4, "w": 6.5}, {"label": "AltGr", "x": 10.75, "y": 4, "w": 1.5}, {"label": "Win", "x": 12.25, "y": 4, "w": 1.25}, {"label": "Ctrl", "x": 13.5, "y": 4, "w": 1.5 } ] - }, - "KEYMAP": { + }, + "LAYOUT_all": { "key_count": 65, "layout": [ - { - "label": "~", - "x": 0, - "y": 0 - }, - { - "label": "!", - "x": 1, - "y": 0 - }, - { - "label": "@", - "x": 2, - "y": 0 - }, - { - "label": "#", - "x": 3, - "y": 0 - }, - { - "label": "$", - "x": 4, - "y": 0 - }, - { - "label": "%", - "x": 5, - "y": 0 - }, - { - "label": "^", - "x": 6, - "y": 0 - }, - { - "label": "&", - "x": 7, - "y": 0 - }, - { - "label": "*", - "x": 8, - "y": 0 - }, - { - "label": "(", - "x": 9, - "y": 0 - }, - { - "label": ")", - "x": 10, - "y": 0 - }, - { - "label": "_", - "x": 11, - "y": 0 - }, - { - "label": "+", - "x": 12, - "y": 0 - }, - { - "x": 13, - "y": 0 - }, - { - "label": "Back", - "x": 14, - "y": 0 - }, - { - "label": "Tab", - "x": 0, - "y": 1, - "w": 1.5 - }, - { - "label": "Q", - "x": 1.5, - "y": 1 - }, - { - "label": "W", - "x": 2.5, - "y": 1 - }, - { - "label": "E", - "x": 3.5, - "y": 1 - }, - { - "label": "R", - "x": 4.5, - "y": 1 - }, - { - "label": "T", - "x": 5.5, - "y": 1 - }, - { - "label": "Y", - "x": 6.5, - "y": 1 - }, - { - "label": "U", - "x": 7.5, - "y": 1 - }, - { - "label": "I", - "x": 8.5, - "y": 1 - }, - { - "label": "O", - "x": 9.5, - "y": 1 - }, - { - "label": "P", - "x": 10.5, - "y": 1 - }, - { - "label": "{", - "x": 11.5, - "y": 1 - }, - { - "label": "}", - "x": 12.5, - "y": 1 - }, - { - "label": "|", - "x": 13.5, - "y": 1, - "w": 1.5 - }, - { - "label": "Caps Lock", - "x": 0, - "y": 2, - "w": 1.75 - }, - { - "label": "A", - "x": 1.75, - "y": 2 - }, - { - "label": "S", - "x": 2.75, - "y": 2 - }, - { - "label": "D", - "x": 3.75, - "y": 2 - }, - { - "label": "F", - "x": 4.75, - "y": 2 - }, - { - "label": "G", - "x": 5.75, - "y": 2 - }, - { - "label": "H", - "x": 6.75, - "y": 2 - }, - { - "label": "J", - "x": 7.75, - "y": 2 - }, - { - "label": "K", - "x": 8.75, - "y": 2 - }, - { - "label": "L", - "x": 9.75, - "y": 2 - }, - { - "label": ":", - "x": 10.75, - "y": 2 - }, - { - "label": "\"", - "x": 11.75, - "y": 2 - }, - { - "x": 12.75, - "y": 2 - }, - { - "label": "Enter", - "x": 13.75, - "y": 2, - "w": 1.25 - }, - { - "x": 0, - "y": 3 - }, - { - "label": "Shift", - "x": 1, - "y": 3, - "w": 1.25 - }, - { - "label": "Z", - "x": 2.25, - "y": 3 - }, - { - "label": "X", - "x": 3.25, - "y": 3 - }, - { - "label": "C", - "x": 4.25, - "y": 3 - }, - { - "label": "V", - "x": 5.25, - "y": 3 - }, - { - "label": "B", - "x": 6.25, - "y": 3 - }, - { - "label": "N", - "x": 7.25, - "y": 3 - }, - { - "label": "M", - "x": 8.25, - "y": 3 - }, - { - "label": "<", - "x": 9.25, - "y": 3 - }, - { - "label": ">", - "x": 10.25, - "y": 3 - }, - { - "label": "?", - "x": 11.25, - "y": 3 - }, - { - "label": "Shift", - "x": 12.25, - "y": 3, - "w": 1.75 - }, - { - "x": 14, - "y": 3 - }, - { - "label": "Ctrl", - "x": 0, - "y": 4, - "w": 1.25 - }, - { - "label": "Win", - "x": 1.25, - "y": 4, - "w": 1.25 - }, - { - "label": "Alt", - "x": 2.5, - "y": 4, - "w": 1.25 - }, - { - "x": 3.75, - "y": 4, - "w": 6.25 - }, - { - "label": "Alt", - "x": 10, - "y": 4, - "w": 1.25 - }, - { - "label": "Win", - "x": 11.25, - "y": 4, - "w": 1.25 - }, - { - "label": "Menu", - "x": 12.5, - "y": 4, - "w": 1.25 - }, - { - "label": "Ctrl", - "x": 13.75, - "y": 4, - "w": 1.25 - } + {"label": "~", "x": 0, "y": 0}, {"label": "!", "x": 1, "y": 0}, {"label": "@", "x": 2, "y": 0}, {"label": "#", "x": 3, "y": 0}, {"label": "$", "x": 4, "y": 0}, {"label": "%", "x": 5, "y": 0}, {"label": "^", "x": 6, "y": 0}, {"label": "&", "x": 7, "y": 0}, {"label": "*", "x": 8, "y": 0}, {"label": "(", "x": 9, "y": 0}, {"label": ")", "x": 10, "y": 0}, {"label": "_", "x": 11, "y": 0}, {"label": "+", "x": 12, "y": 0}, {"x": 13, "y": 0}, {"label": "Back", "x": 14, "y": 0}, + {"label": "Tab", "x": 0, "y": 1, "w": 1.5}, {"label": "Q", "x": 1.5, "y": 1}, {"label": "W", "x": 2.5, "y": 1}, {"label": "E", "x": 3.5, "y": 1}, {"label": "R", "x": 4.5, "y": 1}, {"label": "T", "x": 5.5, "y": 1}, {"label": "Y", "x": 6.5, "y": 1}, {"label": "U", "x": 7.5, "y": 1}, {"label": "I", "x": 8.5, "y": 1}, {"label": "O", "x": 9.5, "y": 1}, {"label": "P", "x": 10.5, "y": 1}, {"label": "{", "x": 11.5, "y": 1}, {"label": "}", "x": 12.5, "y": 1}, {"label": "|", "x": 13.5, "y": 1, "w": 1.5}, + {"label": "Caps Lock", "x": 0, "y": 2, "w": 1.75}, {"label": "A", "x": 1.75, "y": 2}, {"label": "S", "x": 2.75, "y": 2}, {"label": "D", "x": 3.75, "y": 2}, {"label": "F", "x": 4.75, "y": 2}, {"label": "G", "x": 5.75, "y": 2}, {"label": "H", "x": 6.75, "y": 2}, {"label": "J", "x": 7.75, "y": 2}, {"label": "K", "x": 8.75, "y": 2}, {"label": "L", "x": 9.75, "y": 2}, {"label": ":", "x": 10.75, "y": 2}, {"label": "\"", "x": 11.75, "y": 2}, {"x": 12.75, "y": 2}, {"label": "Enter", "x": 13.75, "y": 2, "w": 1.25}, + {"x": 0, "y": 3}, {"label": "Shift", "x": 1, "y": 3, "w": 1.25}, {"label": "Z", "x": 2.25, "y": 3}, {"label": "X", "x": 3.25, "y": 3}, {"label": "C", "x": 4.25, "y": 3}, {"label": "V", "x": 5.25, "y": 3}, {"label": "B", "x": 6.25, "y": 3}, {"label": "N", "x": 7.25, "y": 3}, {"label": "M", "x": 8.25, "y": 3}, {"label": "<", "x": 9.25, "y": 3}, {"label": ">", "x": 10.25, "y": 3}, {"label": "?", "x": 11.25, "y": 3}, {"label": "Shift", "x": 12.25, "y": 3, "w": 1.75}, {"x": 14, "y": 3}, + {"label": "Ctrl", "x": 0, "y": 4, "w": 1.25}, {"label": "Win", "x": 1.25, "y": 4, "w": 1.25}, {"label": "Alt", "x": 2.5, "y": 4, "w": 1.25}, {"x": 3.75, "y": 4, "w": 6.25}, {"label": "Alt", "x": 10, "y": 4, "w": 1.25}, {"label": "Win", "x": 11.25, "y": 4, "w": 1.25}, {"label": "Menu", "x": 12.5, "y": 4, "w": 1.25}, {"label": "Ctrl", "x": 13.75, "y": 4, "w": 1.25 } ] - }, + }, "LAYOUT_60_ansi_split_bs_rshift": { "key_count": 63, "layout": [ - { - "label": "~", - "x": 0, - "y": 0 - }, - { - "label": "!", - "x": 1, - "y": 0 - }, - { - "label": "@", - "x": 2, - "y": 0 - }, - { - "label": "#", - "x": 3, - "y": 0 - }, - { - "label": "$", - "x": 4, - "y": 0 - }, - { - "label": "%", - "x": 5, - "y": 0 - }, - { - "label": "^", - "x": 6, - "y": 0 - }, - { - "label": "&", - "x": 7, - "y": 0 - }, - { - "label": "*", - "x": 8, - "y": 0 - }, - { - "label": "(", - "x": 9, - "y": 0 - }, - { - "label": ")", - "x": 10, - "y": 0 - }, - { - "label": "_", - "x": 11, - "y": 0 - }, - { - "label": "+", - "x": 12, - "y": 0 - }, - { - "x": 13, - "y": 0 - }, - { - "label": "Back", - "x": 14, - "y": 0 - }, - { - "label": "Tab", - "x": 0, - "y": 1, - "w": 1.5 - }, - { - "label": "Q", - "x": 1.5, - "y": 1 - }, - { - "label": "W", - "x": 2.5, - "y": 1 - }, - { - "label": "E", - "x": 3.5, - "y": 1 - }, - { - "label": "R", - "x": 4.5, - "y": 1 - }, - { - "label": "T", - "x": 5.5, - "y": 1 - }, - { - "label": "Y", - "x": 6.5, - "y": 1 - }, - { - "label": "U", - "x": 7.5, - "y": 1 - }, - { - "label": "I", - "x": 8.5, - "y": 1 - }, - { - "label": "O", - "x": 9.5, - "y": 1 - }, - { - "label": "P", - "x": 10.5, - "y": 1 - }, - { - "label": "{", - "x": 11.5, - "y": 1 - }, - { - "label": "}", - "x": 12.5, - "y": 1 - }, - { - "label": "|", - "x": 13.5, - "y": 1, - "w": 1.5 - }, - { - "label": "Caps Lock", - "x": 0, - "y": 2, - "w": 1.75 - }, - { - "label": "A", - "x": 1.75, - "y": 2 - }, - { - "label": "S", - "x": 2.75, - "y": 2 - }, - { - "label": "D", - "x": 3.75, - "y": 2 - }, - { - "label": "F", - "x": 4.75, - "y": 2 - }, - { - "label": "G", - "x": 5.75, - "y": 2 - }, - { - "label": "H", - "x": 6.75, - "y": 2 - }, - { - "label": "J", - "x": 7.75, - "y": 2 - }, - { - "label": "K", - "x": 8.75, - "y": 2 - }, - { - "label": "L", - "x": 9.75, - "y": 2 - }, - { - "label": ":", - "x": 10.75, - "y": 2 - }, - { - "label": "\"", - "x": 11.75, - "y": 2 - }, - { - "label": "Enter", - "x": 12.75, - "y": 2, - "w": 2.25 - }, - { - "label": "Shift", - "x": 0, - "y": 3, - "w": 2.25 - }, - { - "label": "Z", - "x": 2.25, - "y": 3 - }, - { - "label": "X", - "x": 3.25, - "y": 3 - }, - { - "label": "C", - "x": 4.25, - "y": 3 - }, - { - "label": "V", - "x": 5.25, - "y": 3 - }, - { - "label": "B", - "x": 6.25, - "y": 3 - }, - { - "label": "N", - "x": 7.25, - "y": 3 - }, - { - "label": "M", - "x": 8.25, - "y": 3 - }, - { - "label": "<", - "x": 9.25, - "y": 3 - }, - { - "label": ">", - "x": 10.25, - "y": 3 - }, - { - "label": "?", - "x": 11.25, - "y": 3 - }, - { - "label": "Shift", - "x": 12.25, - "y": 3, - "w": 1.75 - }, - { - "x": 14, - "y": 3 - }, - { - "label": "Ctrl", - "x": 0, - "y": 4, - "w": 1.25 - }, - { - "label": "Win", - "x": 1.25, - "y": 4, - "w": 1.25 - }, - { - "label": "Alt", - "x": 2.5, - "y": 4, - "w": 1.25 - }, - { - "x": 3.75, - "y": 4, - "w": 6.25 - }, - { - "label": "Alt", - "x": 10, - "y": 4, - "w": 1.25 - }, - { - "label": "Win", - "x": 11.25, - "y": 4, - "w": 1.25 - }, - { - "label": "Menu", - "x": 12.5, - "y": 4, - "w": 1.25 - }, - { - "label": "Ctrl", - "x": 13.75, - "y": 4, - "w": 1.25 - } + {"label": "~", "x": 0, "y": 0}, {"label": "!", "x": 1, "y": 0}, {"label": "@", "x": 2, "y": 0}, {"label": "#", "x": 3, "y": 0}, {"label": "$", "x": 4, "y": 0}, {"label": "%", "x": 5, "y": 0}, {"label": "^", "x": 6, "y": 0}, {"label": "&", "x": 7, "y": 0}, {"label": "*", "x": 8, "y": 0}, {"label": "(", "x": 9, "y": 0}, {"label": ")", "x": 10, "y": 0}, {"label": "_", "x": 11, "y": 0}, {"label": "+", "x": 12, "y": 0}, {"x": 13, "y": 0}, {"label": "Back", "x": 14, "y": 0}, + {"label": "Tab", "x": 0, "y": 1, "w": 1.5}, {"label": "Q", "x": 1.5, "y": 1}, {"label": "W", "x": 2.5, "y": 1}, {"label": "E", "x": 3.5, "y": 1}, {"label": "R", "x": 4.5, "y": 1}, {"label": "T", "x": 5.5, "y": 1}, {"label": "Y", "x": 6.5, "y": 1}, {"label": "U", "x": 7.5, "y": 1}, {"label": "I", "x": 8.5, "y": 1}, {"label": "O", "x": 9.5, "y": 1}, {"label": "P", "x": 10.5, "y": 1}, {"label": "{", "x": 11.5, "y": 1}, {"label": "}", "x": 12.5, "y": 1}, {"label": "|", "x": 13.5, "y": 1, "w": 1.5}, + {"label": "Caps Lock", "x": 0, "y": 2, "w": 1.75}, {"label": "A", "x": 1.75, "y": 2}, {"label": "S", "x": 2.75, "y": 2}, {"label": "D", "x": 3.75, "y": 2}, {"label": "F", "x": 4.75, "y": 2}, {"label": "G", "x": 5.75, "y": 2}, {"label": "H", "x": 6.75, "y": 2}, {"label": "J", "x": 7.75, "y": 2}, {"label": "K", "x": 8.75, "y": 2}, {"label": "L", "x": 9.75, "y": 2}, {"label": ":", "x": 10.75, "y": 2}, {"label": "\"", "x": 11.75, "y": 2}, {"label": "Enter", "x": 12.75, "y": 2, "w": 2.25}, + {"label": "Shift", "x": 0, "y": 3, "w": 2.25}, {"label": "Z", "x": 2.25, "y": 3}, {"label": "X", "x": 3.25, "y": 3}, {"label": "C", "x": 4.25, "y": 3}, {"label": "V", "x": 5.25, "y": 3}, {"label": "B", "x": 6.25, "y": 3}, {"label": "N", "x": 7.25, "y": 3}, {"label": "M", "x": 8.25, "y": 3}, {"label": "<", "x": 9.25, "y": 3}, {"label": ">", "x": 10.25, "y": 3}, {"label": "?", "x": 11.25, "y": 3}, {"label": "Shift", "x": 12.25, "y": 3, "w": 1.75}, {"x": 14, "y": 3}, + {"label": "Ctrl", "x": 0, "y": 4, "w": 1.25}, {"label": "Win", "x": 1.25, "y": 4, "w": 1.25}, {"label": "Alt", "x": 2.5, "y": 4, "w": 1.25}, {"x": 3.75, "y": 4, "w": 6.25}, {"label": "Alt", "x": 10, "y": 4, "w": 1.25}, {"label": "Win", "x": 11.25, "y": 4, "w": 1.25}, {"label": "Menu", "x": 12.5, "y": 4, "w": 1.25}, {"label": "Ctrl", "x": 13.75, "y": 4, "w": 1.25} ] } } diff --git a/keyboards/clueboard/60/keymaps/default/keymap.c b/keyboards/clueboard/60/keymaps/default/keymap.c index 8397c4bbfb1..89d2180ca65 100644 --- a/keyboards/clueboard/60/keymaps/default/keymap.c +++ b/keyboards/clueboard/60/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "60.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H enum keyboard_layers { _BL, @@ -32,7 +30,7 @@ enum custom_keycodes { float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE); #endif -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,-----------------------------------------------------------. * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| @@ -46,19 +44,19 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl |Gui|Alt | Space |Alt |Gui|Fn |Ctrl | * `-----------------------------------------------------------' */ - [_BL] = KEYMAP( + [_BL] = LAYOUT_all( KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_GRV, KC_BSPC,\ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS, KC_ENT, \ KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_BSLS, \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL), - [_FL] = KEYMAP( + [_FL] = LAYOUT_all( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,_______,\ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ _______,_______,_______, _______, _______, _______, MO(_FL), _______), - [_CL] = KEYMAP( + [_CL] = LAYOUT_all( BL_STEP,S_BSKTC,S_ODEJY,S_RCKBY,S_DOEDR,S_SCALE,S_ONEUP,S_COIN, S_SONIC,S_ZELDA,_______,_______,_______,_______,_______,\ _______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ diff --git a/keyboards/clueboard/60/keymaps/default_aek/keymap.c b/keyboards/clueboard/60/keymaps/default_aek/keymap.c index 63b1d8ba2e6..ed4132f415e 100644 --- a/keyboards/clueboard/60/keymaps/default_aek/keymap.c +++ b/keyboards/clueboard/60/keymaps/default_aek/keymap.c @@ -1,6 +1,4 @@ -#include "60.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H enum keyboard_layers { _BL, @@ -8,7 +6,7 @@ enum keyboard_layers { _CL }; -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,-----------------------------------------------------------. * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BkSp| @@ -22,19 +20,19 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl |Gui|Alt | Space |Alt|Fn |Ctrl | * `-----------------------------------------------------------' */ - [_BL] = KEYMAP_AEK( + [_BL] = LAYOUT_aek( KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS,\ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL), - [_FL] = KEYMAP_AEK( + [_FL] = LAYOUT_aek( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______, _______, _______, _______, MO(_FL), _______), - [_CL] = KEYMAP_AEK( + [_CL] = LAYOUT_aek( BL_STEP,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______,\ _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ diff --git a/keyboards/clueboard/60/keymaps/yanfali/keymap.c b/keyboards/clueboard/60/keymaps/yanfali/keymap.c index eec17720a5d..7c81ea028b6 100644 --- a/keyboards/clueboard/60/keymaps/yanfali/keymap.c +++ b/keyboards/clueboard/60/keymaps/yanfali/keymap.c @@ -1,6 +1,4 @@ -#include "60.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H enum keyboard_layers { _BL, @@ -33,7 +31,7 @@ enum custom_keycodes { float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE); #endif -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,-----------------------------------------------------------------. * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| @@ -47,25 +45,25 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl |Alt|Gui | Space |Alt |Gui|Fn |Ctrl | * `-----------------------------------------------------------------' */ - [_BL] = KEYMAP( + [_BL] = LAYOUT_all( KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_GRV, KC_BSPC,\ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, \ MT(MOD_LCTL, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS, KC_ENT, \ KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, MO(_YF), \ KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL), - [_FL] = KEYMAP( + [_FL] = LAYOUT_all( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,_______,\ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, MO(_YF), \ _______,_______,_______, _______, _______, _______, MO(_FL), _______), - [_CL] = KEYMAP( + [_CL] = LAYOUT_all( BL_STEP,S_BSKTC,S_ODEJY,S_RCKBY,S_DOEDR,S_SCALE,S_ONEUP,S_COIN, S_SONIC,S_ZELDA,_______,_______,_______,_______,_______,\ _______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, MO(_YF), \ _______, _______, _______, _______, _______, _______, MO(_FL), _______), - [_YF] = KEYMAP( + [_YF] = LAYOUT_all( _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ _______,_______,KC_UP ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ diff --git a/keyboards/clueboard/60/matrix.c b/keyboards/clueboard/60/matrix.c deleted file mode 100644 index 7c38a3bd45a..00000000000 --- a/keyboards/clueboard/60/matrix.c +++ /dev/null @@ -1,175 +0,0 @@ -#include -#include -#include -#include "hal.h" -#include "timer.h" -#include "wait.h" -#include "printf.h" -#include "backlight.h" -#include "matrix.h" - - -/* Clueboard 60% - * - * Column pins are input with internal pull-down. - * Row pins are output and strobe with high. - * Key is high or 1 when it turns on. - * - * col: { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC15, PC14, PC13, PB5, PB6 } - * row: { PB0, PB1, PB2, PA15, PA10 } - */ -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_COLS]; -static bool debouncing = false; -static uint16_t debouncing_time = 0; - -__attribute__ ((weak)) -void matrix_init_user(void) {} - -__attribute__ ((weak)) -void matrix_scan_user(void) {} - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -void matrix_init(void) { - printf("matrix init\n"); - //debug_matrix = true; - - /* Column(sense) */ - palSetPadMode(GPIOA, 2, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOA, 3, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOA, 6, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOB, 14, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOB, 15, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOA, 8, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOA, 9, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOB, 4, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOC, 15, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOC, 14, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOC, 13, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOB, 5, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOB, 6, PAL_MODE_OUTPUT_PUSHPULL); - - /* Row(strobe) */ - palSetPadMode(GPIOB, 0, PAL_MODE_INPUT_PULLDOWN); - palSetPadMode(GPIOB, 1, PAL_MODE_INPUT_PULLDOWN); - palSetPadMode(GPIOB, 2, PAL_MODE_INPUT_PULLDOWN); - palSetPadMode(GPIOA, 15, PAL_MODE_INPUT_PULLDOWN); - palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLDOWN); - - memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t)); - - palClearPad(GPIOB, 7); // Turn off capslock - matrix_init_quantum(); -} - -uint8_t matrix_scan(void) { - for (int col = 0; col < MATRIX_COLS; col++) { - matrix_row_t data = 0; - - // strobe col { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC14, PC15, PC13, PB5, PB6 } - switch (col) { - case 0: palSetPad(GPIOA, 2); break; - case 1: palSetPad(GPIOA, 3); break; - case 2: palSetPad(GPIOA, 6); break; - case 3: palSetPad(GPIOB, 14); break; - case 4: palSetPad(GPIOB, 15); break; - case 5: palSetPad(GPIOA, 8); break; - case 6: palSetPad(GPIOA, 9); break; - case 7: palSetPad(GPIOA, 7); break; - case 8: palSetPad(GPIOB, 3); break; - case 9: palSetPad(GPIOB, 4); break; - case 10: palSetPad(GPIOC, 15); break; - case 11: palSetPad(GPIOC, 14); break; - case 12: palSetPad(GPIOC, 13); break; - case 13: palSetPad(GPIOB, 5); break; - case 14: palSetPad(GPIOB, 6); break; - } - - // need wait to settle pin state - wait_us(20); - - // read row data { PB0, PB1, PB2, PA15, PA10 } - data = ( - (palReadPad(GPIOB, 0) << 0 ) | - (palReadPad(GPIOB, 1) << 1 ) | - (palReadPad(GPIOB, 2) << 2 ) | - (palReadPad(GPIOA, 15) << 3 ) | - (palReadPad(GPIOA, 10) << 4 ) - ); - - // unstrobe col { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC15, PC14, PC13, PB5, PB6 } - switch (col) { - case 0: palClearPad(GPIOA, 2); break; - case 1: palClearPad(GPIOA, 3); break; - case 2: palClearPad(GPIOA, 6); break; - case 3: palClearPad(GPIOB, 14); break; - case 4: palClearPad(GPIOB, 15); break; - case 5: palClearPad(GPIOA, 8); break; - case 6: palClearPad(GPIOA, 9); break; - case 7: palClearPad(GPIOA, 7); break; - case 8: palClearPad(GPIOB, 3); break; - case 9: palClearPad(GPIOB, 4); break; - case 10: palClearPad(GPIOC, 15); break; - case 11: palClearPad(GPIOC, 14); break; - case 12: palClearPad(GPIOC, 13); break; - case 13: palClearPad(GPIOB, 5); break; - case 14: palClearPad(GPIOB, 6); break; - } - - if (matrix_debouncing[col] != data) { - matrix_debouncing[col] = data; - debouncing = true; - debouncing_time = timer_read(); - } - } - - if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { - for (int row = 0; row < MATRIX_ROWS; row++) { - matrix[row] = 0; - for (int col = 0; col < MATRIX_COLS; col++) { - matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col); - } - } - debouncing = false; - } - - matrix_scan_quantum(); - - return 1; -} - -bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CLUEBOARD_66_CONFIG_H -#define CLUEBOARD_66_CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xC1ED -#define MANUFACTURER Clueboard -#define PRODUCT Clueboard -#define DESCRIPTION QMK keyboard firmware for Clueboard - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/clueboard/66/info.json b/keyboards/clueboard/66/info.json index 1675ae7617a..514ba456dab 100644 --- a/keyboards/clueboard/66/info.json +++ b/keyboards/clueboard/66/info.json @@ -3,12 +3,34 @@ "width": 16.5, "height": 5, "layouts": { - "KEYMAP": { - "layout": [{"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 12.75, "y": 2, "w": 1, "label": "ISOHASH"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 12.25, "y": 3, "w": 1, "label": "JPBACKSLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"}] + "LAYOUT_all": { + "layout": [ + {"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, + {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, + {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 12.75, "y": 2, "w": 1, "label": "ISOHASH"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, + {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 12.25, "y": 3, "w": 1, "label": "JPBACKSLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, + {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"} + ] }, "LAYOUT_66_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4}] + "layout": [ + {"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"x":14.5, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6}, {"label":"Alt", "x":9.75, "y":4, "w":1.25}, {"label":"Win", "x":11, "y":4, "w":1.25}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4} + ] + }, + + "LAYOUT_66_iso": { + "layout": [ + {"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Insert", "x":15.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":15.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"\\", "x":1.25, "y":3, "w":1}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"label":"\u2191", "x":14.5, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6}, {"label":"Alt", "x":9.75, "y":4, "w":1.25}, {"label":"Ctrl", "x":11, "y":4, "w":1.25}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13.5, "y":4}, {"label":"\u2193", "x":14.5, "y":4}, {"label":"\u2192", "x":15.5, "y":4} + ] } } } diff --git a/keyboards/clueboard/66/keymaps/66_ansi/keymap.c b/keyboards/clueboard/66/keymaps/66_ansi/keymap.c index cfa641dcc6c..73c809ded6f 100644 --- a/keyboards/clueboard/66/keymaps/66_ansi/keymap.c +++ b/keyboards/clueboard/66/keymaps/66_ansi/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/66_ansi/readme.md b/keyboards/clueboard/66/keymaps/66_ansi/readme.md index 25b5d7eb18c..eee81c0c2d1 100644 --- a/keyboards/clueboard/66/keymaps/66_ansi/readme.md +++ b/keyboards/clueboard/66/keymaps/66_ansi/readme.md @@ -1,6 +1,4 @@ -![Clueboard Layout Image](http://i.imgur.com/7Capi8W.png) - -# Basic Clueboard 66% Hotswap Layout +# Basic Clueboard 66% Hotswap ANSI Layout This is the default layout that comes flashed on every Clueboard. For the most part it's a straightforward and easy to follow layout. The only unusual key is diff --git a/keyboards/clueboard/66/keymaps/66_iso/keymap.c b/keyboards/clueboard/66/keymaps/66_iso/keymap.c index 577cf045b54..ff27acf5cde 100644 --- a/keyboards/clueboard/66/keymaps/66_iso/keymap.c +++ b/keyboards/clueboard/66/keymaps/66_iso/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/66_iso/readme.md b/keyboards/clueboard/66/keymaps/66_iso/readme.md index 019131aeb19..6d895b0eba7 100644 --- a/keyboards/clueboard/66/keymaps/66_iso/readme.md +++ b/keyboards/clueboard/66/keymaps/66_iso/readme.md @@ -1,6 +1,4 @@ -![Clueboard Layout Image](http://i.imgur.com/7Capi8W.png) - -# Default Clueboard Layout +# Default Clueboard 66% ISO Layout This is the default layout that comes flashed on every Clueboard. For the most part it's a straightforward and easy to follow layout. The only unusual key is diff --git a/keyboards/clueboard/66/keymaps/bloodlvst/config.h b/keyboards/clueboard/66/keymaps/bloodlvst/config.h index 456936cf930..60c6ad4a12c 100644 --- a/keyboards/clueboard/66/keymaps/bloodlvst/config.h +++ b/keyboards/clueboard/66/keymaps/bloodlvst/config.h @@ -1,7 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #define DISABLE_SPACE_CADET_ROLLOVER -#endif diff --git a/keyboards/clueboard/66/keymaps/bloodlvst/keymap.c b/keyboards/clueboard/66/keymaps/bloodlvst/keymap.c index 73543cbfad9..7c7faba9ce9 100644 --- a/keyboards/clueboard/66/keymaps/bloodlvst/keymap.c +++ b/keyboards/clueboard/66/keymaps/bloodlvst/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/caps_fn/keymap.c b/keyboards/clueboard/66/keymaps/caps_fn/keymap.c index c48c5073879..fc0c56d9a77 100644 --- a/keyboards/clueboard/66/keymaps/caps_fn/keymap.c +++ b/keyboards/clueboard/66/keymaps/caps_fn/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/caps_fn/readme.md b/keyboards/clueboard/66/keymaps/caps_fn/readme.md index 47a530a80b4..71d1246c078 100644 --- a/keyboards/clueboard/66/keymaps/caps_fn/readme.md +++ b/keyboards/clueboard/66/keymaps/caps_fn/readme.md @@ -1,5 +1,3 @@ -![Clueboard Layout Image](http://i.imgur.com/kGADucy.png) - # Caps Fn Layout This is the default layout except that Caps Lock acts like Caps Lock when diff --git a/keyboards/clueboard/66/keymaps/colemak/keymap.c b/keyboards/clueboard/66/keymaps/colemak/keymap.c index 3666bd0e640..4479556b65b 100644 --- a/keyboards/clueboard/66/keymaps/colemak/keymap.c +++ b/keyboards/clueboard/66/keymaps/colemak/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/default/keymap.c b/keyboards/clueboard/66/keymaps/default/keymap.c index 555ff97f0c6..95283db886c 100644 --- a/keyboards/clueboard/66/keymaps/default/keymap.c +++ b/keyboards/clueboard/66/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/default/readme.md b/keyboards/clueboard/66/keymaps/default/readme.md index 019131aeb19..b1cdcbe4e26 100644 --- a/keyboards/clueboard/66/keymaps/default/readme.md +++ b/keyboards/clueboard/66/keymaps/default/readme.md @@ -1,6 +1,4 @@ -![Clueboard Layout Image](http://i.imgur.com/7Capi8W.png) - -# Default Clueboard Layout +# Default Clueboard 66% Universal Layout This is the default layout that comes flashed on every Clueboard. For the most part it's a straightforward and easy to follow layout. The only unusual key is diff --git a/keyboards/clueboard/66/keymaps/jokrik/keymap.c b/keyboards/clueboard/66/keymaps/jokrik/keymap.c index 118efe0a977..9c6997c34e2 100644 --- a/keyboards/clueboard/66/keymaps/jokrik/keymap.c +++ b/keyboards/clueboard/66/keymaps/jokrik/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/mac_optimized/keymap.c b/keyboards/clueboard/66/keymaps/mac_optimized/keymap.c index 29d96842963..30e772900ee 100644 --- a/keyboards/clueboard/66/keymaps/mac_optimized/keymap.c +++ b/keyboards/clueboard/66/keymaps/mac_optimized/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/mac_optimized/readme.md b/keyboards/clueboard/66/keymaps/mac_optimized/readme.md index 282da369dc6..db7a87d443b 100644 --- a/keyboards/clueboard/66/keymaps/mac_optimized/readme.md +++ b/keyboards/clueboard/66/keymaps/mac_optimized/readme.md @@ -1,5 +1,3 @@ -![Clueboard Layout Image](http://i.imgur.com/7oZCsHF.png) - # Default Clueboard Layout for Mac This is the default Clueboard layout with Alt and GUI switched to match Mac diff --git a/keyboards/clueboard/66/keymaps/magicmonty/config.h b/keyboards/clueboard/66/keymaps/magicmonty/config.h index d933fa9979e..65853f6b0c1 100644 --- a/keyboards/clueboard/66/keymaps/magicmonty/config.h +++ b/keyboards/clueboard/66/keymaps/magicmonty/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* * MIDI options @@ -36,5 +33,3 @@ #define LSPO_KEY KC_8 #define RSPC_KEY KC_9 #define PERMISSIVE_HOLD - -#endif diff --git a/keyboards/clueboard/66/keymaps/magicmonty/keymap.c b/keyboards/clueboard/66/keymaps/magicmonty/keymap.c index 7f91224cfb5..cd9ae01188e 100644 --- a/keyboards/clueboard/66/keymaps/magicmonty/keymap.c +++ b/keyboards/clueboard/66/keymaps/magicmonty/keymap.c @@ -1,7 +1,4 @@ -#include "66.h" - -// Helpful defines -#define xxxxxxx KC_NO +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -90,19 +87,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) /* Keymap _MI: MIDI layer (Advanced)*/ [_MI] = LAYOUT( - TO_BASE,MI_VEL_1,MI_VEL_2,MI_VEL_3,MI_VEL_4,MI_VEL_5,MI_VEL_6,MI_VEL_7,MI_VEL_8,MI_VEL_9,MI_VEL_10, MI_CHD, MI_CHU, xxxxxxx, xxxxxxx, xxxxxxx, - xxxxxxx, xxxxxxx, MI_Cs, MI_Ds, xxxxxxx, MI_Fs, MI_Gs, MI_As, xxxxxxx, MI_Cs_1, MI_Ds_1, xxxxxxx, MI_Fs_1, xxxxxxx, xxxxxxx, - MI_MOD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, MI_G_1, xxxxxxx, - MI_SUS, xxxxxxx, MI_OCTD, MI_OCTU,MI_MODSD,MI_MODSU, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, MI_TRNSD,MI_TRNSU,MI_TRNS_0, MI_SUS, xxxxxxx, - xxxxxxx, xxxxxxx, xxxxxxx,xxxxxxx, MI_ALLOFF, MI_ALLOFF, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx), + TO_BASE,MI_VEL_1,MI_VEL_2,MI_VEL_3,MI_VEL_4,MI_VEL_5,MI_VEL_6,MI_VEL_7,MI_VEL_8,MI_VEL_9,MI_VEL_10, MI_CHD, MI_CHU, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, MI_Cs, MI_Ds, XXXXXXX, MI_Fs, MI_Gs, MI_As, XXXXXXX, MI_Cs_1, MI_Ds_1, XXXXXXX, MI_Fs_1, XXXXXXX, XXXXXXX, + MI_MOD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, MI_G_1, XXXXXXX, + MI_SUS, XXXXXXX, MI_OCTD, MI_OCTU,MI_MODSD,MI_MODSU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MI_TRNSD,MI_TRNSU,MI_TRNS_0, MI_SUS, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, MI_ALLOFF, MI_ALLOFF, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX), #elif defined(MIDI_ENABLE) && defined(MIDI_BASIC) /* Keymap _MI: MIDI layer (Basic)*/ [_MI] = LAYOUT( - TO_BASE, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, - xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, - xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, - xxxxxxx, xxxxxxx, MI_ON, MI_OFF, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, - xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx), + TO_BASE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, MI_ON, MI_OFF, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX), #endif }; diff --git a/keyboards/clueboard/66/keymaps/magicmonty/rules.mk b/keyboards/clueboard/66/keymaps/magicmonty/rules.mk index 7ee1ff16905..46222e2d342 100644 --- a/keyboards/clueboard/66/keymaps/magicmonty/rules.mk +++ b/keyboards/clueboard/66/keymaps/magicmonty/rules.mk @@ -1,6 +1,7 @@ MOUSEKEY_ENABLE = yes EXTRAKEY_ENABLE = yes +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality MIDI_ENABLE = yes diff --git a/keyboards/clueboard/66/keymaps/manofinterests/keymap.c b/keyboards/clueboard/66/keymaps/manofinterests/keymap.c index 08815dc5a90..e71419980d6 100644 --- a/keyboards/clueboard/66/keymaps/manofinterests/keymap.c +++ b/keyboards/clueboard/66/keymaps/manofinterests/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/maximised/keymap.c b/keyboards/clueboard/66/keymaps/maximised/keymap.c index 1b117dc6050..c2e05a5a277 100644 --- a/keyboards/clueboard/66/keymaps/maximised/keymap.c +++ b/keyboards/clueboard/66/keymaps/maximised/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/maximised/readme.md b/keyboards/clueboard/66/keymaps/maximised/readme.md index fc82e687935..b8d54a30939 100644 --- a/keyboards/clueboard/66/keymaps/maximised/readme.md +++ b/keyboards/clueboard/66/keymaps/maximised/readme.md @@ -1,5 +1,3 @@ -![Clueboard Layout Image](http://i.imgur.com/7oZCsHF.png) - # Maximised Clueboard Layout This layout is intended for a board with one or both shifts split. The outside key on the split shift is an Fn, while the inside is shift. The bottom row has all the mods on both sides, optimised for a Mac. diff --git a/keyboards/clueboard/66/keymaps/mouse_keys/keymap.c b/keyboards/clueboard/66/keymaps/mouse_keys/keymap.c index 2169312d465..be5634f103f 100644 --- a/keyboards/clueboard/66/keymaps/mouse_keys/keymap.c +++ b/keyboards/clueboard/66/keymaps/mouse_keys/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/mouse_keys/readme.md b/keyboards/clueboard/66/keymaps/mouse_keys/readme.md index 7fb038205a3..de883e8940b 100644 --- a/keyboards/clueboard/66/keymaps/mouse_keys/readme.md +++ b/keyboards/clueboard/66/keymaps/mouse_keys/readme.md @@ -1,5 +1,3 @@ -![Clueboard Layout Image](layout.png) - # MouseKeys Layout This layout adds a mouse layer. When you hold down the spacebar the arrow keys diff --git a/keyboards/clueboard/66/keymaps/mrscooty/keymap.c b/keyboards/clueboard/66/keymaps/mrscooty/keymap.c index abf98615ea4..302649c9234 100644 --- a/keyboards/clueboard/66/keymaps/mrscooty/keymap.c +++ b/keyboards/clueboard/66/keymaps/mrscooty/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/muzfuz/keymap.c b/keyboards/clueboard/66/keymaps/muzfuz/keymap.c new file mode 100644 index 00000000000..d4af3548315 --- /dev/null +++ b/keyboards/clueboard/66/keymaps/muzfuz/keymap.c @@ -0,0 +1,74 @@ +#include QMK_KEYBOARD_H + +// Helpful defines +#define ESC_CTL CTL_T(KC_ESCAPE) // Tap for Esc, hold for Ctrl +#define _FL_KCF LT(1,KC_F) +#define _FL_KCJ LT(1,KC_J) +#define _AL_KCA LT(2,KC_A) +#define CMD_ENT LGUI(LSFT(KC_ENT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +#define _BL 0 +#define _FL 1 +#define _AL 2 +#define _CL 3 + +enum custom_keycodes { + HASHRKT = SAFE_RANGE, + CLNEQLS, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ + [_BL] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, HASHRKT, LGUI(KC_C), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, LGUI(KC_V), + ESC_CTL, _AL_KCA, KC_S, KC_D, _FL_KCF, KC_G, KC_H, _FL_KCJ, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_LGUI, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_SLSH, KC_RSFT, KC_UP, + CMD_ENT, KC_LCTL, KC_LALT, KC_LGUI, KC_ENT, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, MO(_CL), KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap _FL: Function Layer + */ + [_FL] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, KC_VOLU, + _______, HASHRKT, _______, KC_LCBR, KC_RCBR, _______, _______, KC_UNDS, KC_PLUS, KC_PIPE, _______, _______, _______, KC_MUTE, KC_VOLD, + _______, CLNEQLS, _______, KC_LBRC, KC_RBRC, _______, _______, KC_MINS, KC_EQL, KC_BSLS, KC_TILD, KC_GRV, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), + + /* Keymap _FL: Function Layer + */ + [_AL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + /* Keymap _CL: Control layer + */ + [_CL] = LAYOUT( + BL_STEP, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, _______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, RGB_VAD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, + _______, _______, _______, _______, RGB_MOD, RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case HASHRKT: + if (record->event.pressed) { + SEND_STRING("=>"); + } + break; + case CLNEQLS: + if (record->event.pressed) { + SEND_STRING(":="); + } + break; + } + return true; +} diff --git a/keyboards/clueboard/66/keymaps/muzfuz/readme.md b/keyboards/clueboard/66/keymaps/muzfuz/readme.md new file mode 100644 index 00000000000..ce23a8a99c0 --- /dev/null +++ b/keyboards/clueboard/66/keymaps/muzfuz/readme.md @@ -0,0 +1,8 @@ +# muzfuz Clueboard layout + +```shell +make clueboard/66/rev3:muzfuz +dfu-programmer atmega32u4 erase --force && \ +dfu-programmer atmega32u4 flash .build/clueboard_66_rev3_muzfuz.hex && \ +dfu-programmer atmega32u4 reset +``` diff --git a/keyboards/clueboard/66/keymaps/serubin/keymap.c b/keyboards/clueboard/66/keymaps/serubin/keymap.c index 32507e91848..e77417c3c29 100644 --- a/keyboards/clueboard/66/keymaps/serubin/keymap.c +++ b/keyboards/clueboard/66/keymaps/serubin/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/shift_fn/keymap.c b/keyboards/clueboard/66/keymaps/shift_fn/keymap.c index 3736db89921..8556f90803a 100644 --- a/keyboards/clueboard/66/keymaps/shift_fn/keymap.c +++ b/keyboards/clueboard/66/keymaps/shift_fn/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/shift_fn/readme.md b/keyboards/clueboard/66/keymaps/shift_fn/readme.md index 4bd920ad4ef..d68c5b05321 100644 --- a/keyboards/clueboard/66/keymaps/shift_fn/readme.md +++ b/keyboards/clueboard/66/keymaps/shift_fn/readme.md @@ -1,4 +1,4 @@ -# Shift Fn Clueboard Layout +# Shift Fn Clueboard 66% Layout This is an experimental layout. It makes the left shift key a dual roll key. For most keys it acts as a shift key, but for some keys it activates an diff --git a/keyboards/clueboard/66/keymaps/smt/keymap.c b/keyboards/clueboard/66/keymaps/smt/keymap.c index 42dcfecac09..89fc495919e 100644 --- a/keyboards/clueboard/66/keymaps/smt/keymap.c +++ b/keyboards/clueboard/66/keymaps/smt/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -16,9 +16,6 @@ enum planck_keycodes { DVORAK }; -// Helpful defines -#define XXXXXXX KC_NO - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) diff --git a/keyboards/clueboard/66/keymaps/tetris/keymap.c b/keyboards/clueboard/66/keymaps/tetris/keymap.c index f7c6d4c139d..ef3abd66720 100644 --- a/keyboards/clueboard/66/keymaps/tetris/keymap.c +++ b/keyboards/clueboard/66/keymaps/tetris/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H #include "tetris_text.h" // Helpful defines diff --git a/keyboards/clueboard/66/keymaps/unix_optimized/keymap.c b/keyboards/clueboard/66/keymaps/unix_optimized/keymap.c index 927e848539c..823959ee0dc 100644 --- a/keyboards/clueboard/66/keymaps/unix_optimized/keymap.c +++ b/keyboards/clueboard/66/keymaps/unix_optimized/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/unix_optimized/readme.md b/keyboards/clueboard/66/keymaps/unix_optimized/readme.md index 9e6d0e902aa..79c7daef842 100644 --- a/keyboards/clueboard/66/keymaps/unix_optimized/readme.md +++ b/keyboards/clueboard/66/keymaps/unix_optimized/readme.md @@ -1,6 +1,4 @@ -![Clueboard Layout Image](http://i.imgur.com/BnWlOht.png) - -# Default Clueboard Layout +# Default Clueboard 66% Layout This is the default layout except that Caps Lock has been changed to Control and Insert and Delete have been put into the Fn layer. diff --git a/keyboards/clueboard/66/keymaps/win_optimized/keymap.c b/keyboards/clueboard/66/keymaps/win_optimized/keymap.c index 2432350164f..2c5cb863986 100644 --- a/keyboards/clueboard/66/keymaps/win_optimized/keymap.c +++ b/keyboards/clueboard/66/keymaps/win_optimized/keymap.c @@ -1,4 +1,4 @@ -#include "66.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66/keymaps/win_optimized/readme.md b/keyboards/clueboard/66/keymaps/win_optimized/readme.md index 703a37be0c1..d79603268d2 100644 --- a/keyboards/clueboard/66/keymaps/win_optimized/readme.md +++ b/keyboards/clueboard/66/keymaps/win_optimized/readme.md @@ -1,6 +1,4 @@ -![Clueboard Layout Image](http://i.imgur.com/fsqOqZo.png) - -# Default Clueboard Layout +# Default Clueboard 66% Layout This is the default layout that comes flashed on every Clueboard. For the most part it's a straightforward and easy to follow layout. The only unusual key is diff --git a/keyboards/clueboard/66/keymaps/xyverz/config.h b/keyboards/clueboard/66/keymaps/xyverz/config.h index 4999e4ff6c0..979cbf57687 100644 --- a/keyboards/clueboard/66/keymaps/xyverz/config.h +++ b/keyboards/clueboard/66/keymaps/xyverz/config.h @@ -1,3 +1,3 @@ -#include "../config.h" +#pragma once -#define TAPPING_TERM 600 // ms +#define TAPPING_TERM 600 // ms diff --git a/keyboards/clueboard/66/keymaps/xyverz/keymap.c b/keyboards/clueboard/66/keymaps/xyverz/keymap.c index e3f413b4901..3341ced918a 100644 --- a/keyboards/clueboard/66/keymaps/xyverz/keymap.c +++ b/keyboards/clueboard/66/keymaps/xyverz/keymap.c @@ -1,7 +1,7 @@ // Xyverz' keymap. // It's based on the default keymap, but Dvorak! -#include "66.h" +#include QMK_KEYBOARD_H #include "action_layer.h" #include "eeconfig.h" @@ -24,8 +24,6 @@ enum planck_keycodes { }; // Useful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) #define FN_CAPS LT(_FL, KC_CAPS) // Tap for Caps Lock, Hold for Function Layer diff --git a/keyboards/clueboard/66/keymaps/xyverz/rules.mk b/keyboards/clueboard/66/keymaps/xyverz/rules.mk index fc02ecb7ef9..6fa110a7b66 100644 --- a/keyboards/clueboard/66/keymaps/xyverz/rules.mk +++ b/keyboards/clueboard/66/keymaps/xyverz/rules.mk @@ -44,6 +44,3 @@ # RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/clueboard/66/readme.md b/keyboards/clueboard/66/readme.md index 42a261e2abe..094cc219e9c 100644 --- a/keyboards/clueboard/66/readme.md +++ b/keyboards/clueboard/66/readme.md @@ -1,6 +1,6 @@ # Clueboard 66% -![Clueboard](https://static1.squarespace.com/static/55c13bdee4b099be5dcb82eb/t/5867eeaad2b857fd0d196f4b/1494021396651/IMGP4201.jpg?format=1500w) +![Clueboard](https://i.imgur.com/hLePwJu.jpg) A fully customizable 66% keyboard. @@ -8,11 +8,11 @@ A fully customizable 66% keyboard. * Hardware Supported: Clueboard 66% PCB * rev1 (PCB Version 1.0) * rev2 (PCB Versions 2.0, 2.0.1, 2.1, 2.5, 2.5.1, 2.6) - * rev3 (PCB Versions 2.7, 2.8) + * rev3 (PCB Versions 2.7, 2.8, 2.9) * Hardware Availability: [clueboard.co](https://clueboard.co/) Make example for this keyboard (after setting up your build environment): make clueboard/66/rev3:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/clueboard/66/rev1/config.h b/keyboards/clueboard/66/rev1/config.h index 210718d5603..9db64fbd498 100644 --- a/keyboards/clueboard/66/rev1/config.h +++ b/keyboards/clueboard/66/rev1/config.h @@ -1,28 +1,55 @@ -#ifndef CLUEBOARD_66_REV1_CONFIG_H -#define CLUEBOARD_66_REV1_CONFIG_H +#pragma once #include "config_common.h" +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC1ED #define PRODUCT_ID 0x2301 #define DEVICE_VER 0x0003 +#define MANUFACTURER Clueboard +#define PRODUCT Clueboard +#define DESCRIPTION QMK keyboard firmware for Clueboard -/* key matrix size */ +/* key matrix size + */ #define MATRIX_ROWS 5 #define MATRIX_COLS 16 -// ROWS: Top to bottom, COLS: Left to right -/* Column pin configuration -* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -* pin: B3 F1 F4 F5 F6 C7 C6 B6 B5 B4 D7 D6 D4 F7 B0 B1 -*/ +/* ROWS: Top to bottom, COLS: Left to right + */ #define MATRIX_COL_PINS { B3, F1, F4, F5, F6, C7, C6, B6, B5, B4, D7, D6, D4, F7, B0, B1 } -/* Row pin configuration -* row: 0 1 2 3 4 -* pin: D1 D0 D2 D5 D3 -*/ #define MATRIX_ROW_PINS { D1, D0, D2, D5, D3 } #define UNUSED_PINS +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + /* Underlight configuration */ #define RGB_DI_PIN B2 @@ -31,6 +58,3 @@ #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 - - -#endif diff --git a/keyboards/clueboard/66/rev1/rev1.h b/keyboards/clueboard/66/rev1/rev1.h index 58694fcb973..e071f4c7968 100644 --- a/keyboards/clueboard/66/rev1/rev1.h +++ b/keyboards/clueboard/66/rev1/rev1.h @@ -1,7 +1,6 @@ -#ifndef REV1_H -#define REV1_H +#pragma once -#include "../66.h" +#include "quantum.h" /* Clueboard matrix layout * ,-----------------------------------------------------------. ,---. @@ -30,7 +29,7 @@ // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define LAYOUT( \ +#define LAYOUT_all( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \ @@ -43,7 +42,6 @@ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \ { k40, k41, k42, k43, KC_NO, k45, k46, KC_NO, KC_NO, k49, k4A, k4B, k4C, k4D, k4E, k4F } \ } -#define KEYMAP LAYOUT #define LAYOUT_66_ansi( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0E, k0F, \ @@ -73,4 +71,5 @@ { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4A, k4B, k4C, k4D, k4E, k4F } \ } -#endif +#define KEYMAP LAYOUT_all +#define LAYOUT LAYOUT_all diff --git a/keyboards/clueboard/66/rev1/rules.mk b/keyboards/clueboard/66/rev1/rules.mk index f845616741c..96d4125ac4c 100644 --- a/keyboards/clueboard/66/rev1/rules.mk +++ b/keyboards/clueboard/66/rev1/rules.mk @@ -1 +1,23 @@ -BACKLIGHT_ENABLE = no \ No newline at end of file +LAYOUTS = 66_ansi 66_iso +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/clueboard/66/rev2/config.h b/keyboards/clueboard/66/rev2/config.h index 6ab2b1127db..f11cfe82f7e 100644 --- a/keyboards/clueboard/66/rev2/config.h +++ b/keyboards/clueboard/66/rev2/config.h @@ -1,28 +1,54 @@ -#ifndef CLUEBOARD_66_REV2_CONFIG_H -#define CLUEBOARD_66_REV2_CONFIG_H +#pragma once #include "config_common.h" +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC1ED #define PRODUCT_ID 0x2320 #define DEVICE_VER 0x0001 +#define MANUFACTURER Clueboard +#define PRODUCT Clueboard +#define DESCRIPTION QMK keyboard firmware for Clueboard /* key matrix size */ #define MATRIX_ROWS 10 #define MATRIX_COLS 8 -// ROWS: Top to bottom, COLS: Left to right -/* Row pin configuration -* row: 0 1 2 3 4 5 6 7 8 9 -* pin: B2 C7 C6 B6 B5 B0 B3 D5 D3 D2 +/* ROWS: Top to bottom, COLS: Left to right */ #define MATRIX_ROW_PINS { B2, C7, C6, B6, B5, B0, B3, D5, D3, D2 } -/* Column pin configuration - * col: 0 1 2 3 4 5 6 7 - * pin: F0 F1 F4 F5 F6 F7 E6 B1 - */ #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, E6, B1 } #define UNUSED_PINS +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + /* Backlight configuration */ #define BACKLIGHT_LEVELS 1 @@ -44,5 +70,3 @@ #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 1 // The led to start at #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 5 // How many LEDs to travel #define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up - -#endif diff --git a/keyboards/clueboard/66/rev2/rev2.h b/keyboards/clueboard/66/rev2/rev2.h index bac608df979..86688c7a155 100644 --- a/keyboards/clueboard/66/rev2/rev2.h +++ b/keyboards/clueboard/66/rev2/rev2.h @@ -1,7 +1,6 @@ -#ifndef REV2_H -#define REV2_H +#pragma once -#include "66.h" +#include "quantum.h" /* Clueboard matrix layout * ,-----------------------------------------------------------. ,---. @@ -30,7 +29,7 @@ // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array -#define LAYOUT( \ +#define LAYOUT_all( \ k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k55, k56, k57, \ k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \ k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k74, k75, \ @@ -48,7 +47,6 @@ { k80, k81, k82, k83, k84, k85, k86, KC_NO }, \ { k90, KC_NO, k92, k93, k94, k95, k96, k97 } \ } -#define KEYMAP LAYOUT /* LAYOUT_66_ansi, standard 66 key ANSI layout */ @@ -92,4 +90,5 @@ { KC_NO, KC_NO, k92, k93, k94, k95, k96, k97 } \ } -#endif +#define KEYMAP LAYOUT_all +#define LAYOUT LAYOUT_all diff --git a/keyboards/clueboard/66/rev2/rules.mk b/keyboards/clueboard/66/rev2/rules.mk index 54a2685bf63..4987ac1378d 100644 --- a/keyboards/clueboard/66/rev2/rules.mk +++ b/keyboards/clueboard/66/rev2/rules.mk @@ -1 +1,22 @@ -BACKLIGHT_ENABLE = yes \ No newline at end of file +LAYOUTS = 66_ansi 66_iso +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +BACKLIGHT_ENABLE = yes +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/clueboard/66/rev3/config.h b/keyboards/clueboard/66/rev3/config.h index 218736a889d..bbbd82a1c04 100644 --- a/keyboards/clueboard/66/rev3/config.h +++ b/keyboards/clueboard/66/rev3/config.h @@ -1,28 +1,54 @@ -#ifndef CLUEBOARD_66_REV3_CONFIG_H -#define CLUEBOARD_66_REV3_CONFIG_H +#pragma once #include "config_common.h" +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC1ED #define PRODUCT_ID 0x2370 #define DEVICE_VER 0x0001 +#define MANUFACTURER Clueboard +#define PRODUCT Clueboard +#define DESCRIPTION QMK keyboard firmware for Clueboard /* key matrix size */ #define MATRIX_ROWS 10 #define MATRIX_COLS 8 -// ROWS: Top to bottom, COLS: Left to right -/* Row pin configuration -* row: 0 1 2 3 4 5 6 7 8 9 -* pin: B2 C7 C6 B6 B5 B0 B3 D5 D3 D2 +/* ROWS: Top to bottom, COLS: Left to right */ #define MATRIX_ROW_PINS { B2, C7, C6, B6, B5, B0, B3, D5, D3, D2 } -/* Column pin configuration - * col: 0 1 2 3 4 5 6 7 - * pin: F0 F1 F4 F5 F6 F7 E6 B1 - */ #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, E6, B1 } #define UNUSED_PINS +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + /* Backlight configuration */ #define BACKLIGHT_LEVELS 1 @@ -44,5 +70,3 @@ #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 // The led to start at #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 5 // How many LEDs to travel #define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up - -#endif diff --git a/keyboards/clueboard/66/rev3/rev3.c b/keyboards/clueboard/66/rev3/rev3.c index 713d998e6d1..195a21a9e88 100644 --- a/keyboards/clueboard/66/rev3/rev3.c +++ b/keyboards/clueboard/66/rev3/rev3.c @@ -8,10 +8,6 @@ void matrix_init_kb(void) { // runs once when the firmware starts up matrix_init_user(); led_init_ports(); - - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1<. #define DIODE_DIRECTION COL2ROW /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/proton_c/chconf.h b/keyboards/clueboard/66_hotswap/gen1/chconf.h similarity index 100% rename from keyboards/proton_c/chconf.h rename to keyboards/clueboard/66_hotswap/gen1/chconf.h diff --git a/keyboards/clueboard/66_hotswap/gen1/config.h b/keyboards/clueboard/66_hotswap/gen1/config.h index 14188634b37..ea01a078b24 100644 --- a/keyboards/clueboard/66_hotswap/gen1/config.h +++ b/keyboards/clueboard/66_hotswap/gen1/config.h @@ -1,51 +1,141 @@ +/* + * Copyright 2017 skully + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #pragma once #include "config_common.h" -#define PRODUCT_ID 0x2390 +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC1ED +#define PRODUCT_ID 0x2391 #define DEVICE_VER 0x0001 +#define MANUFACTURER Clueboard + +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 /* key matrix size */ #define MATRIX_ROWS 10 #define MATRIX_COLS 8 -// ROWS: Top to bottom, COLS: Left to right -/* Row pin configuration -* row: 0 1 2 3 4 5 6 7 8 9 -* pin: B2 C7 C6 B6 B5 B0 B3 D5 D3 D2 +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * */ +#define MATRIX_ROW_PINS { B11, A6, A3, A2, A1, B5, B6, C15, C14, C13 } +#define MATRIX_COL_PINS { B10, B2, B1, B0, A7, B4, B3, B7 } +#define UNUSED_PINS { A0, A8, A15, B12, B13, B14, B15 } +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +// #define DEBOUNCE 6 -#define MATRIX_ROW_PINS { B2, C7, C6, B6, B5, B0, B3, D5, D3, D2 } -/* Column pin configuration - * col: 0 1 2 3 4 5 6 7 - * pin: F0 F1 F4 F5 F6 F7 E6 B1 +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * */ -#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, E6, B1 } -#define UNUSED_PINS +//#define FORCE_NKRO -/* Speaker configuration +/* + * Feature disable options + * These options are also useful to firmware size reduction. */ -#define B7_AUDIO -#define NO_MUSIC_MODE -#define AUDIO_CLICKY -/* Backlight configuration +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options */ -#define BACKLIGHT_LEVELS 1 -/* Underlight configuration +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + + /* Backlight configuration */ -#define RGB_DI_PIN D7 -#define RGBLED_NUM 26 // Number of LEDs -#define RGBLIGHT_HUE_STEP 32 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 -#define RGBLIGHT_EFFECT_BREATHE_MAX 200 -#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 666*2 -#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4 // How many LEDs wide to light up -#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 16 // The led to start at -#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 8 // How many LEDs to travel -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up +#define BACKLIGHT_LEVELS 10 + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 0b1110100 AD <-> GND +// 0b1110111 AD <-> VCC +// 0b1110101 AD <-> SCL +// 0b1110110 AD <-> SDA +#define LED_DRIVER_ADDR_1 0b1110100 +#define I2C1_BANK GPIOB +#define I2C1_SCL 8 +#define I2C1_SDA 9 + +#define LED_DRIVER_COUNT 1 +#define LED_DRIVER_LED_COUNT 71 diff --git a/keyboards/clueboard/66_hotswap/gen1/gen1.c b/keyboards/clueboard/66_hotswap/gen1/gen1.c index 01f74bc50bc..c70f223756c 100644 --- a/keyboards/clueboard/66_hotswap/gen1/gen1.c +++ b/keyboards/clueboard/66_hotswap/gen1/gen1.c @@ -1,63 +1,186 @@ +/* Copyright 2017 Clueboard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "gen1.h" -#include -#include "backlight.h" -#include "print.h" +#include "is31fl3731-simple.h" void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); - - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #pragma once #include "quantum.h" +/* + * These are shortcuts to help you work with the various layout options. If your + * keymap works with one of the LAYOUT_...() macros you are encouraged to use that + * and to contribute your keymap to the corresponding layout in + * `qmk_firmware/layouts/community`. + */ + /* Clueboard matrix layout * ,-----------------------------------------------------------. ,---. * | 00| 01| 02| 03| 04| 05| 06| 07| 50| 51| 52| 53| 54| 56 | | 57| * |-----------------------------------------------------------| |---| * | 10| 11| 12| 13| 14| 15| 16| 17| 60| 61| 62| 63| 64| 65| | 67| * |-----------------------------------------------------------| `---' - * | 20| 21| 22| 23| 24| 25| 26| 27| 70| 71| 72| 73| 74| 75| - * |------------------------------------------------------------. - * | 30| 31| 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 84| 85|86| + * | 20| 21| 22| 23| 24| 25| 26| 27| 70| 71| 72| 73| 75| + * |--------------------------------------------------------------. + * | 30 | 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 85 |86| * |------------------------------------------------------------------. - * | 40| 41| 42| 43| 45| 46| 90| 92| 93| 94| 95| 96| 97| + * | 40| 41| 42| 45| 46| 90| 92| 93| 94| 95|96| 97| * `------------------------------------------------------------------' * ,-----------------------------------------------------------. ,---. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins| @@ -20,7 +42,7 @@ * |-----------------------------------------------------------| `---' * |Caps | A| S| D| F| G| H| J| k| L| ;| '|Enter | * |--------------------------------------------------------------. - * |Shift| \| Z| X| C| V| B| N| M| ,| .| /| \|Shift| Up| + * |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift| Up| * |------------------------------------------------------------------. * |Ctrl|Alt|Gui | Space| Space|Gui |Alt |Fn |Ctrl|Left|Down|Rgt| * `------------------------------------------------------------------' @@ -29,26 +51,26 @@ // The second converts the arguments into a two-dimensional array #define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \ + k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k55, k57, \ k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \ k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \ - k30, k31, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k84, k85, k86, \ + k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \ k40, k41, k42, k45, k46, k90, k92, k93, k94, k95, k96, k97 \ ) { \ { k00, k01, k02, k03, k04, k05, k06, k07 }, \ { k10, k11, k12, k13, k14, k15, k16, k17 }, \ { k20, k21, k22, k23, k24, k25, k26, k27 }, \ - { k30, k31, k32, k33, k34, k35, k36, k37 }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ { k40, k41, k42, KC_NO, KC_NO, k45, k46, KC_NO }, \ - { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \ + { k50, k51, k52, k53, k54, k55, KC_NO, k57 }, \ { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ - { k80, k81, k82, k83, k84, k85, k86, KC_NO }, \ + { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ { k90, KC_NO, k92, k93, k94, k95, k96, k97 } \ } #define LAYOUT_66_ansi( \ - k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \ + k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k55, k57, \ k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \ k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k75, \ k30, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k85, k86, \ @@ -59,7 +81,7 @@ { k20, k21, k22, k23, k24, k25, k26, k27 }, \ { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \ - { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \ + { k50, k51, k52, k53, k54, k55, KC_NO, k57 }, \ { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ diff --git a/keyboards/clueboard/66_hotswap/gen1/halconf.h b/keyboards/clueboard/66_hotswap/gen1/halconf.h new file mode 100644 index 00000000000..eda293c49b8 --- /dev/null +++ b/keyboards/clueboard/66_hotswap/gen1/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/keyboards/clueboard/66_hotswap/gen1/info.json b/keyboards/clueboard/66_hotswap/gen1/info.json new file mode 100644 index 00000000000..bab110f3d50 --- /dev/null +++ b/keyboards/clueboard/66_hotswap/gen1/info.json @@ -0,0 +1,11 @@ +{ + "layouts": { + "LAYOUT": { + "layout": [{"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"}] + }, + + "LAYOUT_66_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4}] + } + } +} diff --git a/keyboards/clueboard/66_hotswap/gen1/led.c b/keyboards/clueboard/66_hotswap/gen1/led.c new file mode 100644 index 00000000000..efbf532022a --- /dev/null +++ b/keyboards/clueboard/66_hotswap/gen1/led.c @@ -0,0 +1,21 @@ +/* + * Copyright 2017 skully + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +#include "hal.h" +#include "backlight.h" +#include "led.h" +#include "printf.h" diff --git a/keyboards/clueboard/66_hotswap/gen1/matrix.c b/keyboards/clueboard/66_hotswap/gen1/matrix.c new file mode 100644 index 00000000000..c3e59b56460 --- /dev/null +++ b/keyboards/clueboard/66_hotswap/gen1/matrix.c @@ -0,0 +1,160 @@ +#include +#include +#include +#include "hal.h" +#include "timer.h" +#include "wait.h" +#include "printf.h" +#include "backlight.h" +#include "matrix.h" +#include "action.h" +#include "keycode.h" +#include + +/* + * #define MATRIX_ROW_PINS { PB11, PA6, PA3, PA2, PA1, PB5, PB6, PC15, PC14, PC13 } + * #define MATRIX_COL_PINS { PB10, PB2, PB1, PB0, PA7, PB4, PB3, PB7 } + */ +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_COLS]; +static bool debouncing = false; +static uint16_t debouncing_time = 0; + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +void matrix_init(void) { + printf("matrix init\n"); + //debug_matrix = true; + + // actual matrix setup + palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 4, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL); + + palSetPadMode(GPIOB, 11, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 3, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 1, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOB, 5, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOB, 6, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 14, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 13, PAL_MODE_INPUT_PULLDOWN); + + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t)); + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + // actual matrix + for (int col = 0; col < MATRIX_COLS; col++) { + matrix_row_t data = 0; + + // strobe col { PB10, PB2, PB1, PB0, PA7, PB4, PB3, PB7 } + switch (col) { + case 0: palSetPad(GPIOB, 10); break; + case 1: palSetPad(GPIOB, 2); break; + case 2: palSetPad(GPIOB, 1); break; + case 3: palSetPad(GPIOB, 0); break; + case 4: palSetPad(GPIOA, 7); break; + case 5: palSetPad(GPIOB, 4); break; + case 6: palSetPad(GPIOB, 3); break; + case 7: palSetPad(GPIOB, 7); break; + } + + // need wait to settle pin state + wait_us(20); + + // read row data { PB11, PA6, PA3, PA2, PA1, PB5, PB6, PC15, PC14, PC13 } + data = ( + (palReadPad(GPIOB, 11) << 0 ) | + (palReadPad(GPIOA, 6) << 1 ) | + (palReadPad(GPIOA, 3) << 2 ) | + (palReadPad(GPIOA, 2) << 3 ) | + (palReadPad(GPIOA, 1) << 4 ) | + (palReadPad(GPIOB, 5) << 5 ) | + (palReadPad(GPIOB, 6) << 6 ) | + (palReadPad(GPIOC, 15) << 7 ) | + (palReadPad(GPIOC, 14) << 8 ) | + (palReadPad(GPIOC, 13) << 9 ) + ); + + // unstrobe col { B11, B10, B2, B1, A7, B0 } + switch (col) { + case 0: palClearPad(GPIOB, 10); break; + case 1: palClearPad(GPIOB, 2); break; + case 2: palClearPad(GPIOB, 1); break; + case 3: palClearPad(GPIOB, 0); break; + case 4: palClearPad(GPIOA, 7); break; + case 5: palClearPad(GPIOB, 4); break; + case 6: palClearPad(GPIOB, 3); break; + case 7: palClearPad(GPIOB, 7); break; + } + + if (matrix_debouncing[col] != data) { + matrix_debouncing[col] = data; + debouncing = true; + debouncing_time = timer_read(); + } + } + + if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { + for (int row = 0; row < MATRIX_ROWS; row++) { + matrix[row] = 0; + for (int col = 0; col < MATRIX_COLS; col++) { + matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col); + } + } + debouncing = false; + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_on(uint8_t row, uint8_t col) { + return (matrix[row] & (1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# LED Configuration +LED_MATRIX_ENABLE = IS31FL3731 # Build Options # comment out to disable the options. # BACKLIGHT_ENABLE = yes -BOOTMAGIC_ENABLE = no -MOUSEKEY_ENABLE = no -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = yes -COMMAND_ENABLE = no -NKRO_ENABLE = yes +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +#CUSTOM_MATRIX = yes # Custom matrix file AUDIO_ENABLE = yes -RGBLIGHT_ENABLE = yes -MIDI_ENABLE = no -UNICODE_ENABLE = no -BLUETOOTH_ENABLE = no +# SERIAL_LINK_ENABLE = yes diff --git a/keyboards/clueboard/66_hotswap/info.json b/keyboards/clueboard/66_hotswap/info.json index 42fbecedddb..04a748764c4 100644 --- a/keyboards/clueboard/66_hotswap/info.json +++ b/keyboards/clueboard/66_hotswap/info.json @@ -4,11 +4,22 @@ "height": 5, "layouts": { "LAYOUT": { - "layout": [{"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 12.75, "y": 2, "w": 1, "label": "ISOHASH"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 12.25, "y": 3, "w": 1, "label": "JPBACKSLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"}] + "layout": [ + {"x": 0, "y": 0, "label": "GRAVE"}, {"x": 1, "y": 0, "label": "1"}, {"x": 2, "y": 0, "label": "2"}, {"x": 3, "y": 0, "label": "3"}, {"x": 4, "y": 0, "label": "4"}, {"x": 5, "y": 0, "label": "5"}, {"x": 6, "y": 0, "label": "6"}, {"x": 7, "y": 0, "label": "7"}, {"x": 8, "y": 0, "label": "8"}, {"x": 9, "y": 0, "label": "9"}, {"x": 10, "y": 0, "label": "0"}, {"x": 11, "y": 0, "label": "DASH"}, {"x": 12, "y": 0, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 2, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "label": "PAGEUP"}, + {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "label": "Q"}, {"x": 2.5, "y": 1, "label": "W"}, {"x": 3.5, "y": 1, "label": "E"}, {"x": 4.5, "y": 1, "label": "R"}, {"x": 5.5, "y": 1, "label": "T"}, {"x": 6.5, "y": 1, "label": "Y"}, {"x": 7.5, "y": 1, "label": "U"}, {"x": 8.5, "y": 1, "label": "I"}, {"x": 9.5, "y": 1, "label": "O"}, {"x": 10.5, "y": 1, "label": "P"}, {"x": 11.5, "y": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "label": "PAGEDOWN"}, + {"x": 0, "y": 2, "w": 1.75, "label": "CAPS LOCK"}, {"x": 1.75, "y": 2, "label": "A"}, {"x": 2.75, "y": 2, "label": "S"}, {"x": 3.75, "y": 2, "label": "D"}, {"x": 4.75, "y": 2, "label": "F"}, {"x": 5.75, "y": 2, "label": "G"}, {"x": 6.75, "y": 2, "label": "H"}, {"x": 7.75, "y": 2, "label": "J"}, {"x": 8.75, "y": 2, "label": "K"}, {"x": 9.75, "y": 2, "label": "L"}, {"x": 10.75, "y": 2, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "label": "QUOTE"}, {"x": 12.75, "y": 2, "w": 2.25, "label": "ENTER"}, + {"x": 0, "y": 3, "w": 2.25, "label": "LSHIFT"}, {"x": 2.25, "y": 3, "label": "Z"}, {"x": 3.25, "y": 3, "label": "X"}, {"x": 4.25, "y": 3, "label": "C"}, {"x": 5.25, "y": 3, "label": "V"}, {"x": 6.25, "y": 3, "label": "B"}, {"x": 7.25, "y": 3, "label": "N"}, {"x": 8.25, "y": 3, "label": "M"}, {"x": 9.25, "y": 3, "label": "COMMA"}, {"x": 10.25, "y": 3, "label": "PERIOD"}, {"x": 11.25, "y": 3, "label": "SLASH"}, {"x": 12.25, "y": 3, "w": 2.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "label": "UP"}, + {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1.25, "label": "LGUI"}, {"x": 2.5, "y": 4, "w": 1.25, "label": "LALT"}, {"x": 3.75, "y": 4, "w": 2.75, "label": "SPACE1"}, {"x": 6.5, "y": 4, "w": 2.25, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "RGUI"}, {"x": 10, "y": 4, "w": 1.25, "label": "RALT"}, {"x": 11.25, "y": 4, "label": "FN"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "RCTRL"}, {"x": 13.5, "y": 4, "label": "LEFT"}, {"x": 14.5, "y": 4, "label": "DOWN"}, {"x": 15.5, "y": 4, "label": "RIGHT"} + ] }, - "LAYOUT_66_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4}] + "layout": [ + {"label": "~", "x": 0, "y": 0}, {"label": "!", "x": 1, "y": 0}, {"label": "@", "x": 2, "y": 0}, {"label": "#", "x": 3, "y": 0}, {"label": "$", "x": 4, "y": 0}, {"label": "%", "x": 5, "y": 0}, {"label": "^", "x": 6, "y": 0}, {"label": "&", "x": 7, "y": 0}, {"label": "*", "x": 8, "y": 0}, {"label": "(", "x": 9, "y": 0}, {"label": ")", "x": 10, "y": 0}, {"label": "_", "x": 11, "y": 0}, {"label": "+", "x": 12, "y": 0}, {"label": "BACKSPACE", "x": 13, "y": 0, "w": 2}, {"label": "PAGEUP", "x": 15.5, "y": 0}, + {"label": "Tab", "x": 0, "y": 1, "w": 1.5}, {"label": "Q", "x": 1.5, "y": 1}, {"label": "W", "x": 2.5, "y": 1}, {"label": "E", "x": 3.5, "y": 1}, {"label": "R", "x": 4.5, "y": 1}, {"label": "T", "x": 5.5, "y": 1}, {"label": "Y", "x": 6.5, "y": 1}, {"label": "U", "x": 7.5, "y": 1}, {"label": "I", "x": 8.5, "y": 1}, {"label": "O", "x": 9.5, "y": 1}, {"label": "P", "x": 10.5, "y": 1}, {"label": "{", "x": 11.5, "y": 1}, {"label": "}", "x": 12.5, "y": 1}, {"label": "|", "x": 13.5, "y": 1, "w": 1.5}, {"label": "PAGEDOWN", "x": 15.5, "y": 1}, + {"label": "CAPS LOCK", "x": 0, "y": 2, "w": 1.75}, {"label": "A", "x": 1.75, "y": 2}, {"label": "S", "x": 2.75, "y": 2}, {"label": "D", "x": 3.75, "y": 2}, {"label": "F", "x": 4.75, "y": 2}, {"label": "G", "x": 5.75, "y": 2}, {"label": "H", "x": 6.75, "y": 2}, {"label": "J", "x": 7.75, "y": 2}, {"label": "K", "x": 8.75, "y": 2}, {"label": "L", "x": 9.75, "y": 2}, {"label": "SEMICOLON", "x": 10.75, "y": 2}, {"label": "QUOTE", "x": 11.75, "y": 2}, {"label": "ENTER", "x": 12.75, "y": 2, "w": 2.25}, + {"label": "LSHIFT", "x": 0, "y": 3, "w": 2.25}, {"label": "Z", "x": 2.25, "y": 3}, {"label": "X", "x": 3.25, "y": 3}, {"label": "C", "x": 4.25, "y": 3}, {"label": "V", "x": 5.25, "y": 3}, {"label": "B", "x": 6.25, "y": 3}, {"label": "N", "x": 7.25, "y": 3}, {"label": "M", "x": 8.25, "y": 3}, {"label": "COMMA", "x": 9.25, "y": 3}, {"label": "PERIOD", "x": 10.25, "y": 3}, {"label": "SLASH", "x": 11.25, "y": 3}, {"label": "RSHIFT", "x": 12.25, "y": 3, "w": 2.25}, {"label": "UP", "x": 14.5, "y": 3}, + {"label": "LCTRL", "x": 0, "y": 4, "w": 1.25}, {"label": "LGUI", "x": 1.25, "y": 4, "w": 1.25}, {"label": "LALT", "x": 2.5, "y": 4, "w": 1.25}, {"label": "SPACE", "x": 3.75, "y": 4, "w": 6.25}, {"label": "RALT", "x": 10, "y": 4, "w": 1.25}, {"label": "RGUI", "x": 11.25, "y": 4}, {"label": "FN", "x": 12.25, "y": 4, "w": 1.25}, {"label": "LEFT", "x": 13.5, "y": 4}, {"label": "DOWN", "x": 14.5, "y": 4}, {"label": "RIGHT", "x": 15.5, "y": 4} + ] } } } diff --git a/keyboards/clueboard/66_hotswap/keymaps/66_ansi/keymap.c b/keyboards/clueboard/66_hotswap/keymaps/66_ansi/keymap.c index 977a3501b13..224362fe549 100644 --- a/keyboards/clueboard/66_hotswap/keymaps/66_ansi/keymap.c +++ b/keyboards/clueboard/66_hotswap/keymaps/66_ansi/keymap.c @@ -1,4 +1,4 @@ -#include "66_hotswap.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c b/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c index 240eb0e9704..6451cf0370b 100644 --- a/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c +++ b/keyboards/clueboard/66_hotswap/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "66_hotswap.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -6,6 +6,30 @@ #define _FL 1 #define _CL 2 +enum custom_keycodes { + S_BSKTC = SAFE_RANGE, + S_ODEJY, + S_RCKBY, + S_DOEDR, + S_SCALE, + S_ONEUP, + S_COIN, + S_SONIC, + S_ZELDA +}; + +#ifdef AUDIO_ENABLE + float song_basketcase[][2] = SONG(BASKET_CASE); + float song_ode_to_joy[][2] = SONG(ODE_TO_JOY); + float song_rock_a_bye_baby[][2] = SONG(ROCK_A_BYE_BABY); + float song_doe_a_deer[][2] = SONG(DOE_A_DEER); + float song_scale[][2] = SONG(MUSIC_SCALE_SOUND); + float song_coin[][2] = SONG(COIN_SOUND); + float song_one_up[][2] = SONG(ONE_UP_SOUND); + float song_sonic_ring[][2] = SONG(SONIC_RING); + float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE); +#endif + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: Base Layer (Default Layer) */ @@ -13,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_PGDN, \ KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT,MO(_FL),KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,MO(_FL), KC_RSFT, KC_UP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_SPC, KC_RGUI,KC_RALT,MO(_FL),KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT), /* Keymap _FL: Function Layer @@ -22,15 +46,78 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_VOLU, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_MUTE, KC_VOLD, \ _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,MO(_FL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,MO(_FL),_______, KC_PGUP, \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_PGUP, \ _______,_______,_______, _______,_______, _______,_______,MO(_FL),_______,KC_HOME,KC_PGDN,KC_END), /* Keymap _CL: Control layer */ [_CL] = LAYOUT( - BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, RGB_TOG, RGB_VAI, \ - _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ + BL_STEP,S_ONEUP,S_SCALE,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, BL_TOGG, BL_INC, \ + _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC, \ _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,MO(_FL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,MO(_FL),_______, RGB_SAI, \ - _______,_______,_______, RGB_MOD,RGB_MOD, _______,_______,MO(_FL),_______,RGB_HUD,RGB_SAD,RGB_HUI), + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \ + _______,_______,_______, BL_BRTG,BL_BRTG, _______,_______,MO(_FL),_______,RGB_HUD,RGB_SAD,RGB_HUI), }; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + #ifdef AUDIO_ENABLE + case S_BSKTC: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_basketcase); + } + return false; + case S_ODEJY: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_ode_to_joy); + } + return false; + case S_RCKBY: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_rock_a_bye_baby); + } + return false; + case S_DOEDR: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_doe_a_deer); + } + return false; + case S_SCALE: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_scale); + } + return false; + case S_ONEUP: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_one_up); + } + return false; + case S_COIN: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_coin); + } + return false; + case S_SONIC: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_sonic_ring); + } + return false; + case S_ZELDA: + if (record->event.pressed) { + stop_all_notes(); + PLAY_SONG(song_zelda_puzzle); + } + return false; + #endif + } + return true; +} diff --git a/keyboards/clueboard/66_hotswap/keymaps/json/keymap.json b/keyboards/clueboard/66_hotswap/keymaps/json/keymap.json new file mode 100644 index 00000000000..20aa9f0f6cf --- /dev/null +++ b/keyboards/clueboard/66_hotswap/keymaps/json/keymap.json @@ -0,0 +1 @@ +{"keyboard":"clueboard/66_hotswap/gen1","keymap":"default_66","layout":"LAYOUT","layers":[["KC_GESC","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_BSPC","KC_PGUP","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRC","KC_RBRC","KC_BSLS","KC_PGDN","KC_CAPS","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_ENT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RSFT","KC_UP","KC_LCTL","KC_LGUI","KC_LALT","KC_SPC","KC_SPC","KC_RALT","KC_RGUI","MO(1)","KC_RCTL","KC_LEFT","KC_DOWN","KC_RGHT"],["KC_GRV","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_DEL","BL_INC","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_MPRV","KC_MPLY","KC_MNXT","KC_NO","KC_MUTE","BL_DEC","KC_NO","KC_NO","MO(2)","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PGUP","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","MO(1)","KC_NO","KC_HOME","KC_PGDN","KC_END"],["KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","BL_TOGG","BL_INC","KC_NO","KC_NO","KC_NO","KC_NO","RESET","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","BL_DEC","KC_NO","KC_NO","MO(2)","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","BL_STEP","KC_NO","KC_NO","MO(1)","KC_NO","KC_NO","KC_NO","KC_NO"]],"author":"","notes":""} \ No newline at end of file diff --git a/keyboards/clueboard/66_hotswap/prototype/config.h b/keyboards/clueboard/66_hotswap/prototype/config.h new file mode 100644 index 00000000000..7679d08e523 --- /dev/null +++ b/keyboards/clueboard/66_hotswap/prototype/config.h @@ -0,0 +1,55 @@ +#pragma once +#include "config_common.h" + +#define PRODUCT_ID 0x2390 +#define DEVICE_VER 0x0001 + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +// ROWS: Top to bottom, COLS: Left to right +/* Row pin configuration +* row: 0 1 2 3 4 5 6 7 8 9 +* pin: B2 C7 C6 B6 B5 B0 B3 D5 D3 D2 +*/ + +#define MATRIX_ROW_PINS { B2, C7, C6, B6, B5, B0, B3, D5, D3, D2 } +/* Column pin configuration + * col: 0 1 2 3 4 5 6 7 + * pin: F0 F1 F4 F5 F6 F7 E6 B1 + */ +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, E6, B1 } +#define UNUSED_PINS + +/* Speaker configuration + */ +#define B7_AUDIO +#define NO_MUSIC_MODE +#define AUDIO_CLICKY + +/* Space savings + */ +#define NO_ACTION_TAPPING + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 1 + +/* Underlight configuration + */ +#define RGB_DI_PIN D7 +#define RGBLED_NUM 26 // Number of LEDs +#define RGBLIGHT_HUE_STEP 32 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +#define RGBLIGHT_EFFECT_BREATHE_MAX 200 +#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 666*2 +#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4 // How many LEDs wide to light up +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 16 // The led to start at +#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 8 // How many LEDs to travel +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up diff --git a/keyboards/clueboard/66_hotswap/prototype/prototype.c b/keyboards/clueboard/66_hotswap/prototype/prototype.c new file mode 100644 index 00000000000..991d4b8faea --- /dev/null +++ b/keyboards/clueboard/66_hotswap/prototype/prototype.c @@ -0,0 +1,63 @@ +#include "prototype.h" +#include +#include "backlight.h" +#include "print.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); + + // JTAG disable for PORT F. write JTD bit twice within four cycles. + MCUCR |= (1<. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -32,15 +31,7 @@ along with this program. If not, see . #define MATRIX_ROWS 4 #define MATRIX_COLS 3 -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * +/* Keyboard Matrix Assignments */ #define MATRIX_ROW_PINS { F0, F5, F4, B4 } #define MATRIX_COL_PINS { F1, F7, F6 } @@ -48,9 +39,9 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION ROW2COL - + /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 20 +#define DEBOUNCE 20 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -96,11 +87,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -163,5 +149,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/clueboard/card/info.json b/keyboards/clueboard/card/info.json new file mode 100644 index 00000000000..8dfa035996f --- /dev/null +++ b/keyboards/clueboard/card/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "Cluecard", + "keyboard_folder": "clueboard/card", + "url": "", + "maintainer": "skullydazed", + "width": 10, + "height": 8, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"ON/OFF", "x":0, "y":0}, {"label":"SAT+", "x":4, "y":0}, {"label":"BRIGHT+", "x":8, "y":0}, + {"label":"HUE-", "x":2, "y":1}, {"label":"HUE+", "x":6, "y":1}, + {"label":"MODE", "x":0, "y":2}, {"label":"SAT-", "x":4, "y":2}, {"label":"BRIGHT-", "x":8, "y":2}, + {"label":"LAYER", "x":2, "y":4}, + + {"label":"MX1", "x":4, "y":6, "w":2, "h":2}, {"label":"MX2", "x":6, "y":6, "w":2, "h":2}, {"label":"MX3", "x":8, "y":6, "w":2, "h":2} + ] + } + } +} diff --git a/keyboards/clueboard/card/keymaps/default/config.h b/keyboards/clueboard/card/keymaps/default/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/clueboard/card/keymaps/default/config.h +++ b/keyboards/clueboard/card/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/clueboard/card/keymaps/default/keymap.c b/keyboards/clueboard/card/keymaps/default/keymap.c index 5fa6ae20a93..0fa1d9d9891 100644 --- a/keyboards/clueboard/card/keymaps/default/keymap.c +++ b/keyboards/clueboard/card/keymaps/default/keymap.c @@ -1,15 +1,18 @@ -#include "card.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif +#include QMK_KEYBOARD_H + +enum custom_keycodes { + SONG_SU = SAFE_RANGE, + SONG_SC, + SONG_GB +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( + [0] = LAYOUT( RGB_TOG, RGB_SAI, RGB_VAI, \ RGB_HUD, RGB_HUI, \ RGB_MOD, RGB_SAD, RGB_VAD, \ BL_STEP, \ - F(0), F(1), F(2) \ + SONG_SU,SONG_SC,SONG_GB \ ) }; @@ -26,28 +29,6 @@ float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float tone_goodbye[][2] = SONG(GOODBYE_SOUND); #endif -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(0), - [1] = ACTION_FUNCTION(1), - [2] = ACTION_FUNCTION(2) -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch (id) { - case 0: - PLAY_SONG(tone_startup); - break; - case 1: - PLAY_SONG(music_scale); - break; - case 2: - PLAY_SONG(tone_goodbye); - break; - } - } -}; - void matrix_init_user(void) { } @@ -56,7 +37,31 @@ void matrix_scan_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; + switch (keycode) { + case SONG_SU: + if (record->event.pressed) { + PLAY_SONG(tone_startup); + } + + return false; + + case SONG_SC: + if (record->event.pressed) { + PLAY_SONG(music_scale); + } + + return false; + + case SONG_GB: + if (record->event.pressed) { + PLAY_SONG(tone_goodbye); + } + + return false; + + default: + return true; + } } void led_set_user(uint8_t usb_led) { diff --git a/keyboards/clueboard/card/keymaps/default/rules.mk b/keyboards/clueboard/card/keymaps/default/rules.mk index 8ee841da020..3b11f550f95 100644 --- a/keyboards/clueboard/card/keymaps/default/rules.mk +++ b/keyboards/clueboard/card/keymaps/default/rules.mk @@ -3,19 +3,15 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 +AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/clueboard/card/keymaps/rgb_effects/config.h b/keyboards/clueboard/card/keymaps/rgb_effects/config.h index c6c9342c818..0b2a68f544f 100644 --- a/keyboards/clueboard/card/keymaps/rgb_effects/config.h +++ b/keyboards/clueboard/card/keymaps/rgb_effects/config.h @@ -1,12 +1,7 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 - -#endif diff --git a/keyboards/clueboard/card/keymaps/rgb_effects/keymap.c b/keyboards/clueboard/card/keymaps/rgb_effects/keymap.c index 15cf5325d03..92d39aef5b6 100644 --- a/keyboards/clueboard/card/keymaps/rgb_effects/keymap.c +++ b/keyboards/clueboard/card/keymaps/rgb_effects/keymap.c @@ -1,12 +1,12 @@ -#include "card.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( + [0] = LAYOUT( RGB_TOG, RGB_SAI, RGB_VAI, \ RGB_HUD, RGB_HUI, \ RGB_MOD, RGB_SAD, RGB_VAD, \ BL_STEP, \ - KC_NO, KC_NO, KC_NO \ + KC_NO, KC_NO, KC_NO \ ) }; diff --git a/keyboards/clueboard/card/keymaps/rgb_effects/rules.mk b/keyboards/clueboard/card/keymaps/rgb_effects/rules.mk index 00670c0cf43..54d74abbe53 100644 --- a/keyboards/clueboard/card/keymaps/rgb_effects/rules.mk +++ b/keyboards/clueboard/card/keymaps/rgb_effects/rules.mk @@ -3,19 +3,15 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/clueboard/card/readme.md b/keyboards/clueboard/card/readme.md index 27089d465ba..20272d236c4 100644 --- a/keyboards/clueboard/card/readme.md +++ b/keyboards/clueboard/card/readme.md @@ -1,5 +1,7 @@ # Cluecard +![Cluecard](https://i.imgur.com/dTu0Pzx.jpg) + A simple QMK dev kit. * Keyboard Maintainer: [Zach White](https://github.com/skullydazed) @@ -10,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make clueboard/card:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/clueboard/card/rules.mk b/keyboards/clueboard/card/rules.mk index 2117c812728..37b439e75a7 100644 --- a/keyboards/clueboard/card/rules.mk +++ b/keyboards/clueboard/card/rules.mk @@ -1,70 +1,21 @@ - - -# MCU name -#MCU = at90usb1287 MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options -# change yes to no to disable -# BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality by default -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = yes # Audio output on port C6 +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # USB Nkey Rollover +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = yes # Audio output on port C6 diff --git a/keyboards/clueboard/readme.md b/keyboards/clueboard/readme.md index 226bc079c65..451db3307b9 100644 --- a/keyboards/clueboard/readme.md +++ b/keyboards/clueboard/readme.md @@ -1,12 +1,13 @@ -![Clueboard Logo](https://static1.squarespace.com/static/55c13bdee4b099be5dcb82eb/t/59c9703318b27d1ab34f40df/1508257572555/) +![Clueboard Logo](https://i.imgur.com/220uMry.png) -Clueboard makes fully customizable custom keyboards in a variety of formfactors. Inside this directory you'll find support for the entire line of Clueboard products. +Clueboard makes fully customizable custom keyboards in a variety of form-factors. Inside this directory you'll find support for the entire line of Clueboard products. * Maintainer: [Zach White](https://github.com/skullydazed) * Hardware Supported: * [`17`](17/): Clueboard "Cluepad" PCB + * [`2x1800`](2x1800/): Clueboard 2x1800 PCB * [`60`](60/): Clueboard 60% PCB * [`66`](66/): Clueboard 66% PCB - * [`2x1800`](2x1800/): Clueboard 2x1800 PCB + * [`66_hotswap`](66/): Clueboard 66% USB-C Hotswappable PCB * [`card`](card/): Special Cluecard PCB * Hardware Availability: [clueboard.co](https://clueboard.co/) diff --git a/keyboards/cocoa40/cocoa40.c b/keyboards/cocoa40/cocoa40.c new file mode 100644 index 00000000000..22d19828d6a --- /dev/null +++ b/keyboards/cocoa40/cocoa40.c @@ -0,0 +1,43 @@ +/* Copyright 2019 'Naoto Takai' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "cocoa40.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/cocoa40/cocoa40.h b/keyboards/cocoa40/cocoa40.h new file mode 100644 index 00000000000..a468a75ef2c --- /dev/null +++ b/keyboards/cocoa40/cocoa40.h @@ -0,0 +1,44 @@ +/* Copyright 2019 'Naoto Takai' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, R26, \ + L31, L32, L33, R30, R32, R33 \ +) \ +{ \ + { L00, L01, L02, L03, L04, L05, KC_NO, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO, KC_NO }, \ + { KC_NO, L31, L32, L33, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { R00, R01, R02, R03, R04, R05, R06, R07 }, \ + { R10, R11, R12, R13, R14, R15, R16, KC_NO }, \ + { R20, R21, R22, R23, R24, R25, R26, KC_NO }, \ + { R30, KC_NO, R32, R33, KC_NO, KC_NO, KC_NO, KC_NO } \ +} diff --git a/keyboards/cocoa40/config.h b/keyboards/cocoa40/config.h new file mode 100644 index 00000000000..0dfa02aa672 --- /dev/null +++ b/keyboards/cocoa40/config.h @@ -0,0 +1,55 @@ +/* +Copyright 2019 'Naoto Takai' + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC0C0 +#define PRODUCT_ID 0x4000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER recompile keys +#define PRODUCT cocoa40 +#define DESCRIPTION A 40% keyboard for programmers. + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { B5, B4, E6, D7, C6, D4, D0, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D2 // or D1, D2, D3, E6 +#define SPLIT_HAND_PIN D3 diff --git a/keyboards/cocoa40/info.json b/keyboards/cocoa40/info.json new file mode 100644 index 00000000000..d359c0ddb6b --- /dev/null +++ b/keyboards/cocoa40/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Cocoa40", + "url": "https://keys.recompile.net/projects/cocoa40/", + "maintainer": "Naoto Takai", + "width": 15.25, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":7.25, "y":0}, {"label":"U", "x":8.25, "y":0}, {"label":"I", "x":9.25, "y":0}, {"label":"O", "x":10.25, "y":0}, {"label":"P", "x":11.25, "y":0}, {"label":"{", "x":12.25, "y":0}, {"label":"}", "x":13.25, "y":0}, {"label":"Back
Space", "x":14.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":7.5, "y":1}, {"label":"J", "x":8.5, "y":1}, {"label":"K", "x":9.5, "y":1}, {"label":"L", "x":10.5, "y":1}, {"label":":", "x":11.5, "y":1}, {"label":"\"", "x":12.5, "y":1}, {"label":"Enter", "x":13.5, "y":1, "w":1.75}, {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":8, "y":2}, {"label":"M", "x":9, "y":2}, {"label":"<", "x":10, "y":2}, {"label":">", "x":11, "y":2}, {"label":"?", "x":12, "y":2}, {"label":"Shift", "x":13, "y":2, "w":1.25}, {"label":"Fn", "x":14.25, "y":2}, {"label":"Opt", "x":1.5, "y":3}, {"label":"Command", "x":2.5, "y":3, "w":1.5}, {"label":"", "x":4, "y":3, "w":2.25}, {"label":"", "x":7.5, "y":3, "w":2.75}, {"label":"Command", "x":10.25, "y":3, "w":1.5}, {"label":"Opt", "x":11.75, "y":3}] + } + } +} diff --git a/keyboards/cocoa40/keymaps/default/config.h b/keyboards/cocoa40/keymaps/default/config.h new file mode 100644 index 00000000000..01232ff92f2 --- /dev/null +++ b/keyboards/cocoa40/keymaps/default/config.h @@ -0,0 +1,20 @@ +/* Copyright 2019 'Naoto Takai' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here + diff --git a/keyboards/cocoa40/keymaps/default/keymap.c b/keyboards/cocoa40/keymaps/default/keymap.c new file mode 100644 index 00000000000..320f918a9e2 --- /dev/null +++ b/keyboards/cocoa40/keymaps/default/keymap.c @@ -0,0 +1,55 @@ +/* Copyright 2019 'Naoto Takai' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layer_names { + _BASE, + _NUMS, + _SYMS, + _FN, +}; + +#define KC_NUMS LT(_NUMS, KC_SPACE) +#define KC_SYMS LT(_SYMS, KC_SPACE) +#define KC_FN MO(_FN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRACKET, KC_RBRACKET, KC_BSPACE, + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, KC_ENTER, + KC_LSHIFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSHIFT, KC_FN, + KC_LALT, KC_LGUI, KC_NUMS, KC_SYMS, KC_RGUI, KC_RALT + ), + [_NUMS] = LAYOUT( + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSLASH, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ), + [_SYMS] = LAYOUT( + KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_MINUS, KC_PLUS, KC_PIPE, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ), + [_FN] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/cocoa40/keymaps/default/readme.md b/keyboards/cocoa40/keymaps/default/readme.md new file mode 100644 index 00000000000..9e530faff07 --- /dev/null +++ b/keyboards/cocoa40/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for cocoa40 diff --git a/keyboards/cocoa40/keymaps/default/rules.mk b/keyboards/cocoa40/keymaps/default/rules.mk new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/keyboards/cocoa40/keymaps/default/rules.mk @@ -0,0 +1 @@ + diff --git a/keyboards/cocoa40/readme.md b/keyboards/cocoa40/readme.md new file mode 100644 index 00000000000..e05caaba9c1 --- /dev/null +++ b/keyboards/cocoa40/readme.md @@ -0,0 +1,15 @@ +# cocoa40 + +![cocoa40](https://keys.recompile.net/images/cocoa40-main@600w.jpg) + +A 40% split keyboard for programmers. + +Keyboard Maintainer: [Naoto Takai](https://github.com/takai) +Hardware Supported: The Cocoa40 PCBs, Pro Micro supported +Hardware Availability: https://keys.recompile.net/projects/cocoa40/ + +Make example for this keyboard (after setting up your build environment): + + make cocoa40:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cocoa40/rules.mk b/keyboards/cocoa40/rules.mk new file mode 100644 index 00000000000..f7e529a4b2f --- /dev/null +++ b/keyboards/cocoa40/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE =no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +SPLIT_KEYBOARD = yes diff --git a/keyboards/cod67/config.h b/keyboards/cod67/config.h deleted file mode 100644 index 612379271fe..00000000000 --- a/keyboards/cod67/config.h +++ /dev/null @@ -1,189 +0,0 @@ -/* -Copyright 2018 MechMerlin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Gray -#define PRODUCT cod67 -#define DESCRIPTION 60% Custom Keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 } -#define MATRIX_COL_PINS { D7, F7, F6, F5, F4, F1, F0, E6, B0, B7, D0, D1, D2, D3 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN D4 -#define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/cod67/keymaps/default/keymap.c b/keyboards/cod67/keymaps/default/keymap.c deleted file mode 100644 index a85dc2c288b..00000000000 --- a/keyboards/cod67/keymaps/default/keymap.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) - -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/cod67/readme.md b/keyboards/cod67/readme.md deleted file mode 100644 index 9471a2034e1..00000000000 --- a/keyboards/cod67/readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# Gray COD67 - -![cod67](imgur.com image replace me!) - -The Gray COD67 is a 60% keyboard with a modern and bold design. It features 20 RGB Underglow LED lights and a unique diffuser placement. The COD67 has the most stunning RGB light strip for a custom mechanical keyboard. It also features a center mounted USB C port. - -There were only 75 units made worldwide. - -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: Gray COD67 -Hardware Availability: [Zfrontier](https://en.zfrontier.com/products/cod67) - -At this time, flashing ONLY works on Windows systems. - -To put in bootloader mode, hold the `Esc` key while plugging in the USB cable. - -The COD67 will show up as a drive. - -Make example for this keyboard (after setting up your build environment): - - make cod67:default:bin - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -Rename the resulting `.bin` file to `cod67.bin`. - -Drag and drop `cod67.bin` to the drive, overwriting the previous `cod67.bin` stored on it. - -Press the `Esc` key again to reset the board. You are now ready to type! - -## Notes -The backlight pin is attached to a non PWM pin `D4` so backlight is only on/off. diff --git a/keyboards/cod67/rules.mk b/keyboards/cod67/rules.mk deleted file mode 100644 index 45eb6ee3766..00000000000 --- a/keyboards/cod67/rules.mk +++ /dev/null @@ -1,68 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/comet46/comet46.c b/keyboards/comet46/comet46.c index 20dcfab83c9..0710b8e330d 100644 --- a/keyboards/comet46/comet46.c +++ b/keyboards/comet46/comet46.c @@ -4,19 +4,11 @@ void uart_init(void) { SERIAL_UART_INIT(); } -void led_init(void) { - DDRD |= (1<<1); - PORTD |= (1<<1); - DDRF |= (1<<4) | (1<<5); - PORTF |= (1<<4) | (1<<5); -} - void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up matrix_init_user(); uart_init(); - led_init(); } void matrix_scan_kb(void) { diff --git a/keyboards/comet46/comet46.h b/keyboards/comet46/comet46.h index 7d6d6d513b8..07dad0a0014 100644 --- a/keyboards/comet46/comet46.h +++ b/keyboards/comet46/comet46.h @@ -6,46 +6,6 @@ #include "backlight.h" #include -#define red_led_off PORTF |= (1<<5) -#define red_led_on PORTF &= ~(1<<5) -#define blu_led_off PORTF |= (1<<4) -#define blu_led_on PORTF &= ~(1<<4) -#define grn_led_off PORTD |= (1<<1) -#define grn_led_on PORTD &= ~(1<<1) - -#define set_led_off red_led_off; grn_led_off; blu_led_off -#define set_led_red red_led_on; grn_led_off; blu_led_off -#define set_led_blue red_led_off; grn_led_off; blu_led_on -#define set_led_green red_led_off; grn_led_on; blu_led_off -#define set_led_yellow red_led_on; grn_led_on; blu_led_off -#define set_led_magenta red_led_on; grn_led_off; blu_led_on -#define set_led_cyan red_led_off; grn_led_on; blu_led_on -#define set_led_white red_led_on; grn_led_on; blu_led_on - -/* -#define LED_B 5 -#define LED_R 6 -#define LED_G 7 - -#define all_leds_off PORTF &= ~(1<. #define ONESHOT_TIMEOUT 500 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -65,6 +59,12 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION +// Define masks for modifiers +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) +#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) + //UART settings for communication with the RF microcontroller #define SERIAL_UART_BAUD 1000000 #define SERIAL_UART_DATA UDR1 diff --git a/keyboards/comet46/i2c.c b/keyboards/comet46/i2c.c new file mode 100644 index 00000000000..4bee5c63982 --- /dev/null +++ b/keyboards/comet46/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/comet46/info.json b/keyboards/comet46/info.json new file mode 100644 index 00000000000..9881397b404 --- /dev/null +++ b/keyboards/comet46/info.json @@ -0,0 +1,62 @@ +{ + "keyboard_name": "Comet46", + "url": "", + "maintainer": "SatT", + "width": 15, + "height": 4.9, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"TAB", "x":0, "y":0.45}, + {"label":"Q", "x":1, "y":0.45}, + {"label":"W", "x":2, "y":0.15}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0.30}, + {"label":"T", "x":5, "y":0.45}, + {"label":"Y", "x":9, "y":0.45}, + {"label":"U", "x":10, "y":0.30}, + {"label":"I", "x":11, "y":0}, + {"label":"O", "x":12, "y":0.15}, + {"label":"P", "x":13, "y":0.45}, + {"label":"BSPC", "x":14, "y":0.45}, + + {"label":"LCTL", "x":0, "y":1.45}, + {"label":"A", "x":1, "y":1.45}, + {"label":"S", "x":2, "y":1.15}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1.30}, + {"label":"G", "x":5, "y":1.45}, + {"label":"ESC", "x":6, "y":1}, + {"label":"DEL", "x":8, "y":1}, + {"label":"H", "x":9, "y":1.45}, + {"label":"J", "x":10, "y":1.30}, + {"label":"K", "x":11, "y":1}, + {"label":"L", "x":12, "y":1.15}, + {"label":"SCLN", "x":13, "y":1.45}, + {"label":"QUOT", "x":14, "y":1.45}, + + {"label":"LSFT", "x":0, "y":2.45}, + {"label":"Z", "x":1, "y":2.45}, + {"label":"X", "x":2, "y":2.15}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2.30}, + {"label":"B", "x":5, "y":2.45}, + {"label":"LCBR", "x":6, "y":2}, + {"label":"RCBR", "x":8, "y":2}, + {"label":"N", "x":9, "y":2.45}, + {"label":"M", "x":10, "y":2.30}, + {"label":"COMM", "x":11, "y":2}, + {"label":"DOT", "x":12, "y":2.15}, + {"label":"SLSH", "x":13, "y":2.45}, + {"label":"RSFT", "x":14, "y":2.45}, + + {"label":"LGUI", "x":4, "y":3.9}, + {"label":"LOWER", "x":5, "y":3.9}, + {"label":"SPACE", "x":6, "y":3.4, "h":1.5}, + {"label":"ENTER", "x":8, "y":3.4, "h":1.5}, + {"label":"RAISE", "x":9, "y":3.9}, + {"label":"LALT", "x":10, "y":3.9} + ] + } + } +} diff --git a/keyboards/comet46/keymaps/default-rgbled/keymap.c b/keyboards/comet46/keymaps/default-rgbled/keymap.c new file mode 100644 index 00000000000..a576cc36b13 --- /dev/null +++ b/keyboards/comet46/keymaps/default-rgbled/keymap.c @@ -0,0 +1,223 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum comet46_layers +{ + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | S | D | F | G | Esc | | Del | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | { | | } | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_ESC, KC_DEL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + + /* Colemak + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | R | S | T | D | Esc | | Del | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | { | | } | K | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_ESC, KC_DEL, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + + /* Dvorak + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | " | , | . | P | Y | | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | O | E | U | I | Esc | | Del | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | { | | } | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_DVORAK] = LAYOUT( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_ESC, KC_DEL, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCBR, KC_RCBR, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + + /* Lower + * ,-----------------------------------------+ +-----------------------------------------. + * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | | | | ` | \ | - | = | [ | ] | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | | | | ~ | | | _ | + | { | } | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | | | | | | | | + * +--------------------/ \--------------------+ + */ + [_LOWER] = LAYOUT( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, _______, _______, _______, _______, _______, _______, KC_GRV, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, _______, _______, _______, _______, _______ + ), + + /* Raise + * ,-----------------------------------------+ +-----------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | | | Left | Down | Up |Right | End | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | | PgDn | PgUp | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | | | | | | | | + * +--------------------/ \--------------------+ + */ + [_RAISE] = LAYOUT( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______ + ), + + /* Adjust + * ,-----------------------------------------+ +-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | |Qwerty| |Colemk| | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | |Reset | |Dvorak| | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | | | | | | | | + * +--------------------/ \--------------------+ + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RESET, DVORAK, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ) +}; + + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); +} + +// settings for LED on receiver +void led_init(void) { + DDRD |= (1<<1); + PORTD |= (1<<1); + DDRF |= (1<<4) | (1<<5); + PORTF |= (1<<4) | (1<<5); +} + +#define red_led_off PORTF |= (1<<5) +#define red_led_on PORTF &= ~(1<<5) +#define blu_led_off PORTF |= (1<<4) +#define blu_led_on PORTF &= ~(1<<4) +#define grn_led_off PORTD |= (1<<1) +#define grn_led_on PORTD &= ~(1<<1) + +#define set_led_off red_led_off; grn_led_off; blu_led_off +#define set_led_red red_led_on; grn_led_off; blu_led_off +#define set_led_blue red_led_off; grn_led_off; blu_led_on +#define set_led_green red_led_off; grn_led_on; blu_led_off +#define set_led_yellow red_led_on; grn_led_on; blu_led_off +#define set_led_magenta red_led_on; grn_led_off; blu_led_on +#define set_led_cyan red_led_off; grn_led_on; blu_led_on +#define set_led_white red_led_on; grn_led_on; blu_led_on + +void matrix_init_user(void) { + led_init(); +} + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + uint8_t default_layer = biton32(eeconfig_read_default_layer()); + switch (layer) { + case _LOWER: + set_led_red; + break; + case _RAISE: + set_led_blue; + break; + case _ADJUST: + set_led_magenta; + break; + default: + switch (default_layer) { + case _COLEMAK: + set_led_white; + break; + case _DVORAK: + set_led_yellow; + break; + default: + set_led_green; + break; + } + break; + } +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + break; + } + return true; +} diff --git a/keyboards/comet46/keymaps/default-rgbled/readme.md b/keyboards/comet46/keymaps/default-rgbled/readme.md new file mode 100644 index 00000000000..40cc7443376 --- /dev/null +++ b/keyboards/comet46/keymaps/default-rgbled/readme.md @@ -0,0 +1,3 @@ +## default-led + +A keymap that is compatible with mitosis-type receivers, which use RGB LED for layer indication. diff --git a/keyboards/comet46/keymaps/default/config.h b/keyboards/comet46/keymaps/default/config.h new file mode 100644 index 00000000000..ee02a94b7e1 --- /dev/null +++ b/keyboards/comet46/keymaps/default/config.h @@ -0,0 +1,29 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here + + +/* Use I2C or Serial */ + +#define USE_I2C +#define SSD1306OLED diff --git a/keyboards/comet46/keymaps/default/keymap.c b/keyboards/comet46/keymaps/default/keymap.c index b03ece4e952..9ef96764657 100644 --- a/keyboards/comet46/keymaps/default/keymap.c +++ b/keyboards/comet46/keymaps/default/keymap.c @@ -2,6 +2,10 @@ // This is the canonical layout file for the Quantum project. If you want to add another keyboard, #include QMK_KEYBOARD_H +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -9,20 +13,22 @@ // entirely and just use numbers. enum comet46_layers { - _QWERTY, - _LOWER, - _RAISE, + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST, }; enum custom_keycodes { QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, LOWER, RAISE, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) @@ -46,6 +52,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT ), + /* Colemak + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | R | S | T | D | Esc | | Del | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | { | | } | K | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_ESC, KC_DEL, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + + /* Dvorak + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | " | , | . | P | Y | | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | O | E | U | I | Esc | | Del | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | { | | } | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_DVORAK] = LAYOUT( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_ESC, KC_DEL, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCBR, KC_RCBR, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + /* Lower * ,-----------------------------------------+ +-----------------------------------------. * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | @@ -70,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| * | | F1 | F2 | F3 | F4 | F5 | F6 | | | Left | Down | Up |Right | End | | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | | | | | | | + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | | PgDn | PgUp | | | | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| * | | | | | | | | * +--------------------/ \--------------------+ @@ -78,26 +120,134 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT( _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, _______, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______ + ), + + /* Adjust + * ,-----------------------------------------+ +-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | |Qwerty| |Colemk| | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | |Reset | |Dvorak| | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | | | | | | | | + * +--------------------/ \--------------------+ + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RESET, DVORAK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// You need to add source files to SRC in rules.mk when using OLED display functions +void set_keylog(uint16_t keycode); +const char *read_keylog(void); +const char *read_modifier_state(void); +const char *read_host_led_state(void); + +void matrix_init_user(void) { + iota_gfx_init(false); // turns on the display +} + void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - switch (layer) { - case _QWERTY: - set_led_green; - break; - case _RAISE: - set_led_blue; - break; - case _LOWER: - set_led_red; - break; + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void render_status(struct CharacterMatrix *matrix) { + // Layer state + char layer_str[22]; + matrix_write(matrix, "Layer: "); + uint8_t layer = biton32(layer_state); + uint8_t default_layer = biton32(eeconfig_read_default_layer()); + switch (layer) { + case _QWERTY: + switch (default_layer) { + case _QWERTY: + snprintf(layer_str, sizeof(layer_str), "Qwerty"); + break; + case _COLEMAK: + snprintf(layer_str, sizeof(layer_str), "Colemak"); + break; + case _DVORAK: + snprintf(layer_str, sizeof(layer_str), "Dvorak"); + break; default: - set_led_green; - break; + snprintf(layer_str, sizeof(layer_str), "Undef-%d", default_layer); + break; + } + break; + case _RAISE: + snprintf(layer_str, sizeof(layer_str), "Raise"); + break; + case _LOWER: + snprintf(layer_str, sizeof(layer_str), "Lower"); + break; + case _ADJUST: + snprintf(layer_str, sizeof(layer_str), "Adjust"); + break; + default: + snprintf(layer_str, sizeof(layer_str), "Undef-%d", layer); + } + matrix_write_ln(matrix, layer_str); + // Last entered keycode + matrix_write_ln(matrix, read_keylog()); + // Modifier state + matrix_write_ln(matrix, read_modifier_state()); + // Host Keyboard LED Status + matrix_write(matrix, read_host_led_state()); +} + + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + render_status(&matrix); + matrix_update(&display, &matrix); +} + +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + #ifdef SSD1306OLED + if (record->event.pressed) { + set_keylog(keycode); } + #endif + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + break; + } + return true; } diff --git a/keyboards/comet46/keymaps/default/readme.md b/keyboards/comet46/keymaps/default/readme.md new file mode 100644 index 00000000000..b0085d2a626 --- /dev/null +++ b/keyboards/comet46/keymaps/default/readme.md @@ -0,0 +1,3 @@ +## default-oled-display + +A keymap that is compatible with receivers with an OLED display. diff --git a/keyboards/comet46/keymaps/default/rules.mk b/keyboards/comet46/keymaps/default/rules.mk new file mode 100644 index 00000000000..3fa01f96af5 --- /dev/null +++ b/keyboards/comet46/keymaps/default/rules.mk @@ -0,0 +1,5 @@ +# If you want to change display settings of the OLED, you need to change the following lines +SRC += ./lib/glcdfont.c \ + ./lib/keylogger.c \ + ./lib/modifier_state_reader.c \ + ./lib/host_led_state_reader.c diff --git a/keyboards/comet46/keymaps/satt/action_pseudo_lut.c b/keyboards/comet46/keymaps/satt/action_pseudo_lut.c index 5664d4d2a54..4a7cb3a3a2f 100644 --- a/keyboards/comet46/keymaps/satt/action_pseudo_lut.c +++ b/keyboards/comet46/keymaps/satt/action_pseudo_lut.c @@ -1,4 +1,5 @@ #include "quantum.h" +#include "command.h" #include "action_pseudo_lut.h" static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE]; @@ -10,133 +11,133 @@ static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE]; * Memo: Using other layer keymap to get keycode */ void action_pseudo_lut(keyrecord_t *record, uint8_t base_keymap_id, const uint16_t (*keymap)[2]) { - uint8_t prev_shift; - uint16_t keycode; - uint16_t pseudo_keycode; + uint8_t prev_shift; + uint16_t keycode; + uint16_t pseudo_keycode; - /* get keycode from keymap you specified */ - keycode = keymap_key_to_keycode(base_keymap_id, record->event.key); + /* get keycode from keymap you specified */ + keycode = keymap_key_to_keycode(base_keymap_id, record->event.key); - prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); - if (record->event.pressed) { - /* when magic commands entered, keycode does not converted */ - if (IS_COMMAND()) { - if (prev_shift) { - add_shift_bit(keycode); - } - register_code(keycode); - return; - } + if (record->event.pressed) { + /* when magic commands entered, keycode does not converted */ + if (IS_COMMAND()) { + if (prev_shift) { + add_shift_bit(keycode); + } + register_code(keycode); + return; + } - if (prev_shift) { - pseudo_keycode = convert_keycode(keymap, keycode, true); - dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); - add_shift_bit(keycode); + if (prev_shift) { + pseudo_keycode = convert_keycode(keymap, keycode, true); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + add_shift_bit(keycode); - if (IS_LSFT(pseudo_keycode)) { - register_code(QK_LSFT ^ pseudo_keycode); - } else { - /* delete shift mod temporarily */ - del_mods(prev_shift); - send_keyboard_report(); - register_code(pseudo_keycode); - add_mods(prev_shift); - send_keyboard_report(); - } - } else { - pseudo_keycode = convert_keycode(keymap, keycode, false); - dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + if (IS_LSFT(pseudo_keycode)) { + register_code(QK_LSFT ^ pseudo_keycode); + } else { + /* delete shift mod temporarily */ + del_mods(prev_shift); + send_keyboard_report(); + register_code(pseudo_keycode); + add_mods(prev_shift); + send_keyboard_report(); + } + } else { + pseudo_keycode = convert_keycode(keymap, keycode, false); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); - if (IS_LSFT(pseudo_keycode)) { - add_weak_mods(MOD_BIT(KC_LSFT)); - send_keyboard_report(); - register_code(QK_LSFT ^ pseudo_keycode); - /* on Windows, prevent key repeat to avoid unintended output */ - unregister_code(QK_LSFT ^ pseudo_keycode); - del_weak_mods(MOD_BIT(KC_LSFT)); - send_keyboard_report(); - } else { - register_code(pseudo_keycode); - } - } + if (IS_LSFT(pseudo_keycode)) { + add_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + register_code(QK_LSFT ^ pseudo_keycode); + /* on Windows, prevent key repeat to avoid unintended output */ + unregister_code(QK_LSFT ^ pseudo_keycode); + del_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + } else { + register_code(pseudo_keycode); + } + } + } else { + if (get_shift_bit(keycode)) { + del_shift_bit(keycode); + pseudo_keycode = convert_keycode(keymap, keycode, true); } else { - if (get_shift_bit(keycode)) { - del_shift_bit(keycode); - pseudo_keycode = convert_keycode(keymap, keycode, true); - } else { - pseudo_keycode = convert_keycode(keymap, keycode, false); - } - dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode); + pseudo_keycode = convert_keycode(keymap, keycode, false); + } + dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode); - if (IS_LSFT(pseudo_keycode)) { - unregister_code(QK_LSFT ^ pseudo_keycode); - } else { - unregister_code(pseudo_keycode); - } + if (IS_LSFT(pseudo_keycode)) { + unregister_code(QK_LSFT ^ pseudo_keycode); + } else { + unregister_code(pseudo_keycode); } + } } uint16_t convert_keycode(const uint16_t (*keymap)[2], uint16_t keycode, bool shift_modded) { - uint16_t pseudo_keycode; + uint16_t pseudo_keycode; - switch (keycode) { - case KC_A ... KC_CAPSLOCK: -#if defined(__AVR__) - if (shift_modded) { - pseudo_keycode = pgm_read_word(&keymap[keycode][1]); - } else { - pseudo_keycode = pgm_read_word(&keymap[keycode][0]); - } -#else - if (shift_modded) { - pseudo_keycode = keymap[keycode][1]; - } else { - pseudo_keycode = keymap[keycode][0]; - } -#endif - /* if undefined, use got keycode as it is */ - if (pseudo_keycode == 0x00) { - if (shift_modded) { - pseudo_keycode = S(keycode); - } else { - pseudo_keycode = keycode; - } - } - break; - default: - if (shift_modded) { - pseudo_keycode = S(keycode); - } else { - pseudo_keycode = keycode; - } - break; - } - return pseudo_keycode; + switch (keycode) { + case KC_A ... KC_CAPSLOCK: + #if defined(__AVR__) + if (shift_modded) { + pseudo_keycode = pgm_read_word(&keymap[keycode][1]); + } else { + pseudo_keycode = pgm_read_word(&keymap[keycode][0]); + } + #else + if (shift_modded) { + pseudo_keycode = keymap[keycode][1]; + } else { + pseudo_keycode = keymap[keycode][0]; + } + #endif + /* if undefined, use got keycode as it is */ + if (pseudo_keycode == 0x00) { + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + } + break; + default: + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + break; + } + return pseudo_keycode; } uint8_t get_shift_bit(uint16_t keycode) { - if ((keycode >> 3) < SHIFT_BIT_SIZE) { - return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7)); - } else { - dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode); - return 0; - } + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7)); + } else { + dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode); + return 0; + } } void add_shift_bit(uint16_t keycode) { - if ((keycode >> 3) < SHIFT_BIT_SIZE) { - send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7)); - } else { - dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode); - } + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7)); + } else { + dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode); + } } void del_shift_bit(uint16_t keycode) { - if ((keycode >> 3) < SHIFT_BIT_SIZE) { - send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7)); - } else { - dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode); - } + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7)); + } else { + dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode); + } } diff --git a/keyboards/comet46/keymaps/satt/config.h b/keyboards/comet46/keymaps/satt/config.h new file mode 100644 index 00000000000..a3ca2ebfefe --- /dev/null +++ b/keyboards/comet46/keymaps/satt/config.h @@ -0,0 +1,29 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +/* Use I2C or Serial */ + +#define USE_I2C +#define SSD1306OLED + +#endif diff --git a/keyboards/comet46/keymaps/satt/keymap.c b/keyboards/comet46/keymaps/satt/keymap.c index 7e728e5d08e..eec40eff49c 100644 --- a/keyboards/comet46/keymaps/satt/keymap.c +++ b/keyboards/comet46/keymaps/satt/keymap.c @@ -4,64 +4,96 @@ #include QMK_KEYBOARD_H #include "keymap_jis2us.h" #include "action_pseudo_lut.h" +#include "keymap_jp.h" +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. enum comet46_layers { - _QWERTY, - _LOWER, - _RAISE, - _PSEUDO_US, - _PSEUDO_US_LOWER, - _PSEUDO_US_RAISE, - _ADJUST + _QWERTY, + _LOWER, + _RAISE, + _PSEUDO_US, + _PSEUDO_US_LOWER, + _PSEUDO_US_RAISE, + _ADJUST }; enum custom_keycodes { QWERTY = SAFE_RANGE, PSEUDO_US, + JIS2US, }; -#define KC_LWR MO(_LOWER) -#define KC_RSE MO(_RAISE) +// JIS keycodes +#define KC_JZHT JP_ZHTG // hankaku/zenkaku|kanzi +#define KC_JCIR JP_CIRC // ^, ~ +#define KC_JAT JP_AT // @, ` +#define KC_JLBR JP_LBRC // [, { +#define KC_JCOL JP_COLN // :, * +#define KC_JRBR JP_RBRC // ], } +#define KC_JBSL JP_BSLS // \, _ +#define KC_JMHE JP_MHEN // muhenkan +#define KC_JHEN JP_HENK // henkan +#define KC_JKAN JP_KANA // katakana/hiragana|ro-mazi +#define KC_JMKA JP_MKANA //kana on MacOSX +#define KC_JMEI JP_MEISU //eisu on MacOSX +#define KC_JAMP JP_AMPR // & +#define KC_JQUO JP_QUOT // ' +#define KC_JLPR JP_LPRN // ( +#define KC_JRPR JP_RPRN // ) +#define KC_JEQL JP_EQL // = +#define KC_JTIL JP_TILD // ~ +#define KC_JPIP JP_PIPE // | +#define KC_JGRV JP_GRV // ` +#define KC_JLCB JP_LCBR // { +#define KC_JPLU JP_PLUS // + +#define KC_JAST JP_ASTR // * +#define KC_JRCB JP_RCBR // } +#define KC_JUND JP_UNDS // _ + +// Layer related keycodes +#define KC_LWR MO(_LOWER) +#define KC_RSE MO(_RAISE) #define KC_P_LW MO(_PSEUDO_US_LOWER) #define KC_P_RS MO(_PSEUDO_US_RAISE) #define KC_QWRT QWERTY #define KC_P_US PSEUDO_US +#define KC_J2US JIS2US + +// Special keycodes #define KC_SPCT CTL_T(KC_SPC) #define KC_ENSF SFT_T(KC_ENT) -#define KC_SFTA SFT_T(KC_A) -#define KC_CTSF S(KC_LCTL) +#define KC_CAEC MT(MOD_LCTL | MOD_LALT, KC_ESC) +#define KC_CSTB C_S_T(KC_TAB) #define KC_IMON ALT_T(KC_F13) #define KC_IMOF GUI_T(KC_F14) -#define KC_SRO S(KC_RO) -#define KC_SYEN S(KC_JYEN) #define KC_CAD LCA(KC_DEL) #define KC_RST RESET -#define LONGPRESS_DELAY 150 - // Fillers to make layering more clear -#define KC_ KC_TRNS +#define KC_ KC_TRNS #define KC_XXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( + [_QWERTY] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. - ESC , Q , W , E , R , T , Y , U , I , O , P ,DEL , + CAEC, Q , W , E , R , T , Y , U , I , O , P ,DEL , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| - TAB ,SFTA, S , D , F , G ,LPRN, RPRN, H , J , K , L ,SCLN,BSPC, + CSTB, A , S , D , F , G ,LPRN, RPRN, H , J , K , L ,SCLN,BSPC, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - CTSF, Z , X , C , V , B ,LBRC, RBRC, N , M ,COMM,DOT ,SLSH,QUOT, + LSFT, Z , X , C , V , B ,LBRC, RBRC, N , M ,COMM,DOT ,SLSH,QUOT, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| IMOF,LWR ,SPCT, ENSF,RSE ,IMON // +----+----+---/ \---+----+----+ ), - [_LOWER] = LAYOUT_kc( + [_LOWER] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| @@ -69,60 +101,60 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , F7 , F8 , F9 , F10, F11, F12, TILD,PIPE,UNDS,PLUS,LCBR,RCBR, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ), - [_RAISE] = LAYOUT_kc( + [_RAISE] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| , , , , , , , XXXX,LEFT,DOWN, UP ,RGHT,END , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , HOME,XXXX,XXXX,XXXX,XXXX,XXXX, , + , , , , , , , HOME,XXXX,PGDN,PGUP,XXXX,XXXX, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ), - [_PSEUDO_US] = LAYOUT_kc( + [_PSEUDO_US] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. - ESC , Q , W , E , R , T , Y , U , I , O , P ,DEL , + CAEC, Q , W , E , R , T , Y , U , I , O , P ,DEL , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| - TAB ,SFTA, S , D , F , G ,ASTR, LPRN, H , J , K , L ,FN0 ,BSPC, + CSTB, A , S , D , F , G ,JLPR, JRPR, H , J , K , L ,J2US,BSPC, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - CTSF, Z , X , C , V , B ,FN0 , FN0 , N , M ,COMM,DOT ,SLSH,FN0 , + LSFT, Z , X , C , V , B ,J2US, J2US, N , M ,COMM,DOT ,SLSH,J2US, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| IMOF,P_LW,SPCT, ENSF,P_RS,IMON // +----+----+---/ \---+----+----+ ), - [_PSEUDO_US_LOWER] = LAYOUT_kc( + [_PSEUDO_US_LOWER] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. - ,EXLM,LBRC,HASH,DLR ,PERC, EQL ,CIRC, DQT,ASTR,LPRN, , + ,EXLM,JAT ,HASH,DLR ,PERC, JCIR,JAMP,JAST,JLPR,JRPR, , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| - , F1 , F2 , F3 , F4 , F5 , F6 , LCBR,JYEN,MINS,UNDS,RBRC,BSLS, , + , F1 , F2 , F3 , F4 , F5 , F6 , JGRV,JBSL,MINS,JEQL,JLBR,JRBR, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , F7 , F8 , F9 , F10, F11, F12, PLUS,SYEN,SRO ,COLN,RCBR,PIPE, , + , F7 , F8 , F9 , F10, F11, F12, JTIL,JPIP,JUND,JPLU,JLCB,JRCB, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ), - [_PSEUDO_US_RAISE] = LAYOUT_kc( + [_PSEUDO_US_RAISE] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| - , , , , , , GRV, XXXX,LEFT,DOWN, UP ,RGHT,END , , + , , , , , ,JZHT, XXXX,LEFT,DOWN, UP ,RGHT,END , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , HOME,XXXX,XXXX,XXXX,XXXX,XXXX, , + , , , , , , , HOME,XXXX,PGDN,PGUP,XXXX,XXXX, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ), - [_ADJUST] = LAYOUT_kc( + [_ADJUST] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. , , , , , , , , , , , , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| @@ -130,90 +162,130 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , ,RST , P_US, , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ) }; +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _PSEUDO_US_LOWER: + case _PSEUDO_US_RAISE: + return update_tri_layer_state(state, _PSEUDO_US_RAISE, _PSEUDO_US_LOWER, _ADJUST); + break; + default: + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); + break; + } +} -/* - * user defined action function - */ -enum function_id { - PSEUDO_US_FUNCTION, -}; +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) - { - case PSEUDO_US_FUNCTION: - action_pseudo_lut(record, _QWERTY, keymap_jis2us); - break; - } -} +// You need to add source files to SRC in rules.mk when using OLED display functions +void set_keylog(uint16_t keycode); +const char *read_keylog(void); +const char *read_modifier_state(void); +const char *read_host_led_state(void); -/* - * Fn action definition - */ -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(PSEUDO_US_FUNCTION), -}; +void matrix_init_user(void) { + iota_gfx_init(false); // turns on the display +} void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void render_status(struct CharacterMatrix *matrix) { + // Layer state + char layer_str[22]; + matrix_write(matrix, "Layer: "); + uint8_t layer = biton32(layer_state); + uint8_t default_layer = biton32(eeconfig_read_default_layer()); switch (layer) { - case _LOWER: - set_led_red; - break; + case _QWERTY: + switch (default_layer) { + case _QWERTY: + snprintf(layer_str, sizeof(layer_str), "Qwerty"); + break; + case _PSEUDO_US: + snprintf(layer_str, sizeof(layer_str), "Psuedo_US"); + break; + default: + snprintf(layer_str, sizeof(layer_str), "Undef-%d", default_layer); + break; + } + break; case _RAISE: - set_led_blue; - break; - case _PSEUDO_US_LOWER: - set_led_yellow; - break; + snprintf(layer_str, sizeof(layer_str), "Raise"); + break; + case _LOWER: + snprintf(layer_str, sizeof(layer_str), "Lower"); + break; case _PSEUDO_US_RAISE: - set_led_cyan; - break; + snprintf(layer_str, sizeof(layer_str), "P_US_Raise"); + break; + case _PSEUDO_US_LOWER: + snprintf(layer_str, sizeof(layer_str), "P_US_Lower"); + break; case _ADJUST: - set_led_magenta; - break; + snprintf(layer_str, sizeof(layer_str), "Adjust"); + break; default: - set_led_green; - break; + snprintf(layer_str, sizeof(layer_str), "Undef-%d", layer); } -}; + matrix_write_ln(matrix, layer_str); + // Last entered keycode + matrix_write_ln(matrix, read_keylog()); + // Modifier state + matrix_write_ln(matrix, read_modifier_state()); + // Host Keyboard LED Status + matrix_write(matrix, read_host_led_state()); +} -uint32_t layer_state_set_user(uint32_t state) { - switch (biton32(state)) { - case _PSEUDO_US: - return update_tri_layer_state(state, _PSEUDO_US_RAISE, _PSEUDO_US_LOWER, _ADJUST); - break; - case _PSEUDO_US_LOWER: - return update_tri_layer_state(state, _PSEUDO_US_RAISE, _PSEUDO_US_LOWER, _ADJUST); - break; - case _PSEUDO_US_RAISE: - return update_tri_layer_state(state, _PSEUDO_US_RAISE, _PSEUDO_US_LOWER, _ADJUST); - break; - default: - return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); - break; +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; } +#endif + + matrix_clear(&matrix); + render_status(&matrix); + matrix_update(&display, &matrix); } +#endif//SSD1306OLED + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + #ifdef SSD1306OLED + if (record->event.pressed) { + set_keylog(keycode); + } + #endif switch (keycode) { case QWERTY: if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } - return false; break; case PSEUDO_US: if (record->event.pressed) { set_single_persistent_default_layer(_PSEUDO_US); } - return false; + break; + case JIS2US: + action_pseudo_lut(record, _QWERTY, keymap_jis2us); break; } return true; diff --git a/keyboards/comet46/keymaps/satt/keymap_jis2us.h b/keyboards/comet46/keymaps/satt/keymap_jis2us.h index cf2bd4f0e84..e32a0579aa0 100644 --- a/keyboards/comet46/keymaps/satt/keymap_jis2us.h +++ b/keyboards/comet46/keymaps/satt/keymap_jis2us.h @@ -3,30 +3,30 @@ /* keymap for convert from JIS to US */ const uint16_t PROGMEM keymap_jis2us[][2] = { - [KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */ + [KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */ - [KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */ - [KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */ - [KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */ - [KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */ - [KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */ - [KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */ - [KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */ - [KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */ - [KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */ - [KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */ - [KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */ - [KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */ - [KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */ - [KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */ - [KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */ - [KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */ - [KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */ - [KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */ - [KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */ - [KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */ - [KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */ - [KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */ + [KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */ + [KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */ + [KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */ + [KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */ + [KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */ + [KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */ + [KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */ + [KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */ + [KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */ + [KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */ + [KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */ + [KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */ + [KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */ + [KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */ + [KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */ + [KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */ + [KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */ + [KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */ + [KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */ + [KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */ + [KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */ + [KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */ }; #endif diff --git a/keyboards/comet46/keymaps/satt/rules.mk b/keyboards/comet46/keymaps/satt/rules.mk index dc4355c78f4..91609dd4fdf 100644 --- a/keyboards/comet46/keymaps/satt/rules.mk +++ b/keyboards/comet46/keymaps/satt/rules.mk @@ -1,26 +1,8 @@ SRC += action_pseudo_lut.c -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -ONEHAND_ENABLE = no # Enable one-hand typing +# If you want to change display settings of the OLED, you need to change the following lines +SRC += ./lib/glcdfont.c \ + ./lib/keylogger.c \ + ./lib/modifier_state_reader.c \ + ./lib/host_led_state_reader.c -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/comet46/lib/glcdfont.c b/keyboards/comet46/lib/glcdfont.c new file mode 100644 index 00000000000..e912d2233c4 --- /dev/null +++ b/keyboards/comet46/lib/glcdfont.c @@ -0,0 +1,148 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00 +}; +#endif // FONT5X7_H diff --git a/keyboards/comet46/lib/host_led_state_reader.c b/keyboards/comet46/lib/host_led_state_reader.c new file mode 100644 index 00000000000..864b1e24475 --- /dev/null +++ b/keyboards/comet46/lib/host_led_state_reader.c @@ -0,0 +1,15 @@ +#include +#include "comet46.h" + +char host_led_state_str[22]; + +const char *read_host_led_state(void) { + uint8_t leds = host_keyboard_leds(); + + snprintf(host_led_state_str, sizeof(host_led_state_str), "Lock: %s%s%s", + (leds & (1 << USB_LED_CAPS_LOCK)) ? "CAPL " : "", + (leds & (1 << USB_LED_SCROLL_LOCK)) ? "SCRL " : "", + (leds & (1 << USB_LED_NUM_LOCK)) ? "NUML" : ""); + + return host_led_state_str; +} diff --git a/keyboards/comet46/lib/keylogger.c b/keyboards/comet46/lib/keylogger.c new file mode 100644 index 00000000000..184f601095a --- /dev/null +++ b/keyboards/comet46/lib/keylogger.c @@ -0,0 +1,294 @@ +#include + +#ifdef __AVR__ + #include + #include +#else + #define PROGMEM +#endif + +#define NUM_USB_HID_KEYCODES 255 +#define LEN_KEYCODE_STR 4 + +char keylog[22] = {"KC: ID: "}; + +// Quick and dirty way to display USB HID keycodes used in QMK +// USB HID keycodes from 0x0000 to 0x00FF are stored in a 4x256+1 length char +const char code_to_name[] PROGMEM = { + "NO " //0x00 + "TRNS" + "? " + "? " + "A " + "B " + "C " + "D " + "E " + "F " + "G " + "H " + "I " + "J " + "K " + "L " + "M " //0x10 + "N " + "O " + "P " + "Q " + "R " + "S " + "T " + "U " + "V " + "W " + "X " + "Y " + "Z " + "1 " + "2 " + "3 " //0x20 + "4 " + "5 " + "6 " + "7 " + "8 " + "9 " + "0 " + "ENT " + "ESC " + "BSPC" + "TAB " + "SPC " + "MINS" + "EQL " + "LBRC" + "RBRC" //0x30 + "BSLS" + "NUHS" + "SCLN" + "QUOT" + "GRV " + "COMM" + "DOT " + "SLSH" + "CAPS" + "F1 " + "F2 " + "F3 " + "F4 " + "F5 " + "F6 " + "F7 " //0x40 + "F8 " + "F9 " + "F10 " + "F11 " + "F12 " + "PSCR" + "SLCK" + "PAUS" + "INS " + "HOME" + "PGUP" + "DEL " + "END " + "PGDN" + "RGHT" + "LEFT" //0x50 + "DOWN" + "UP " + "NLCK" + "PSLS" + "PAST" + "PMNS" + "PPLS" + "PENT" + "P1 " + "P2 " + "P3 " + "P4 " + "P5 " + "P6 " + "P7 " + "P8 " //0x60 + "P9 " + "P0 " + "PDOT" + "NUBS" + "APP " + "POW " + "PEQL" + "F13 " + "F14 " + "F15 " + "F16 " + "F17 " + "F18 " + "F19 " + "F20 " + "F21 " //0x70 + "F22 " + "F23 " + "F24 " + "EXEC" + "HELP" + "MENU" + "SLCT" + "STOP" + "AGIN" + "UNDO" + "CUT " + "COPY" + "PSTE" + "FIND" + "_MUT" + "_VUP" //0x80 + "_VDN" + "LCAP" + "LNUM" + "LSCR" + "PCMM" + "PEQA" + "INT1" + "INT2" + "INT3" + "INT4" + "INT5" + "INT6" + "INT7" + "INT8" + "INT9" + "LAN1" //0x90 + "LAN2" + "LAN3" + "LAN4" + "LAN5" + "LAN6" + "LAN7" + "LAN8" + "LAN9" + "ERAS" + "SYSR" + "CNCL" + "CLR " + "PRIR" + "RTRN" + "SEP " + "OUT " //0xA0 + "OPER" + "CLRA" + "CSEL" + "ESEL" + "PWR " //0xA5 + "SLEP" + "WAKE" + "MUTE" + "VOLU" + "VOLD" + "MNXT" + "MPRV" + "MSTP" + "MPLY" + "MSEL" + "EJCT" //0xB0 + "MAIL" + "CALC" + "MYCM" + "WSCH" + "WHOM" + "WBAK" + "WFWD" + "WSTP" + "WREF" + "WFAV" + "MFFD" + "MRWD" + "BRIU" + "BRID" + "? " + "FN0 " //0xC0 + "FN1 " + "FN2 " + "FN3 " + "FN4 " + "FN5 " + "FN6 " + "FN7 " + "FN8 " + "FN9 " + "FN10" + "FN11" + "FN12" + "FN13" + "FN14" + "FN15" + "FN16" //0xD0 + "FN17" + "FN18" + "FN19" + "FN20" + "FN21" + "FN22" + "FN23" + "FN24" + "FN25" + "FN26" + "FN27" + "FN28" + "FN29" + "FN30" + "FN31" + "LCTL" //0xE0 + "LSFT" + "LALT" + "LGUI" + "RCTL" + "RSFT" + "RALT" + "RGUI" + "? " + "? " + "? " + "? " + "? " + "? " + "? " + "? " + "MS_U" //0xF0 + "MS_D" + "MS_L" + "MS_R" + "BTN1" + "BTN2" + "BTN3" + "BTN4" + "BTN5" + "WH_U" + "WH_D" + "WH_L" + "WH_R" + "ACL0" + "ACL1" + "ACL2" +}; + +void set_keylog(uint16_t keycode) +{ + char name[LEN_KEYCODE_STR+1] = "? "; + + if (keycode <= NUM_USB_HID_KEYCODES) { + for (uint8_t k = 0; k < LEN_KEYCODE_STR; k++) { + name[k] = pgm_read_byte_near(code_to_name + keycode * LEN_KEYCODE_STR + k); + } + } else if (keycode > NUM_USB_HID_KEYCODES) { + snprintf(name, sizeof(name), "QMK "); + } + + // update keylog + snprintf(keylog, sizeof(keylog), "KC: %s ID: %d", name, keycode); +} + +const char *read_keylog(void) { + return keylog; +} diff --git a/keyboards/comet46/lib/modifier_state_reader.c b/keyboards/comet46/lib/modifier_state_reader.c new file mode 100644 index 00000000000..518eef92a62 --- /dev/null +++ b/keyboards/comet46/lib/modifier_state_reader.c @@ -0,0 +1,18 @@ +#include +#include "comet46.h" + +char modifier_state_str[22]; + +const char *read_modifier_state(void) { + uint8_t modifiers = get_mods(); + uint8_t one_shot = get_oneshot_mods(); + + snprintf(modifier_state_str, sizeof(modifier_state_str), "Mod: %s%s%s%s", + (modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) ? "CTL " : "", + (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK) ? "GUI " : "", + (modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) ? "ALT " : "", + (modifiers & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) ? "SFT" : "" + ); + + return modifier_state_str; +} diff --git a/keyboards/comet46/matrix.c b/keyboards/comet46/matrix.c index 66d29f8b38f..dc38ba74f86 100644 --- a/keyboards/comet46/matrix.c +++ b/keyboards/comet46/matrix.c @@ -102,7 +102,7 @@ uint8_t matrix_scan(void) if (timeout > 10000){ break; } - } + } uart_data[i] = SERIAL_UART_DATA; } @@ -124,7 +124,7 @@ uint8_t matrix_scan(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1 +#include "print.h" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +extern const unsigned char font[] PROGMEM; + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +static bool force_dirty = true; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + i2c_master_init(); + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data) { + char data_ln[strlen(data)+2]; + snprintf(data_ln, sizeof(data_ln), "%s\n", data); + matrix_write(matrix, data_ln); +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty|| force_dirty) { + iota_gfx_flush(); + force_dirty = false; + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + +#endif diff --git a/keyboards/comet46/ssd1306.h b/keyboards/comet46/ssd1306.h new file mode 100644 index 00000000000..ea8c9232805 --- /dev/null +++ b/keyboards/comet46/ssd1306.h @@ -0,0 +1,91 @@ +#pragma once + +#include +#include +#include "pincontrol.h" +#include "action.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); \ No newline at end of file diff --git a/keyboards/contra/config.h b/keyboards/contra/config.h index c6bb374da23..b32d8686542 100755 --- a/keyboards/contra/config.h +++ b/keyboards/contra/config.h @@ -30,7 +30,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +38,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/contra/keymaps/dana/keymap.c b/keyboards/contra/keymaps/dana/keymap.c index f296805b0b9..51fa9f75fb4 100644 --- a/keyboards/contra/keymaps/dana/keymap.c +++ b/keyboards/contra/keymaps/dana/keymap.c @@ -5,10 +5,6 @@ extern keymap_config_t keymap_config; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/contra/keymaps/dana/rules.mk b/keyboards/contra/keymaps/dana/rules.mk index 1198f378a8e..cf891fad353 100644 --- a/keyboards/contra/keymaps/dana/rules.mk +++ b/keyboards/contra/keymaps/dana/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/contra/keymaps/default/config.h b/keyboards/contra/keymaps/default/config.h index a1635f2bab5..d61ee2938e9 100644 --- a/keyboards/contra/keymaps/default/config.h +++ b/keyboards/contra/keymaps/default/config.h @@ -1,7 +1,5 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "config_common.h" #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PLANCK_SOUND) @@ -25,7 +23,7 @@ /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ - + #define MIDI_BASIC /* enable advanced MIDI features: @@ -38,5 +36,3 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#endif \ No newline at end of file diff --git a/keyboards/contra/keymaps/losinggeneration/rules.mk b/keyboards/contra/keymaps/losinggeneration/rules.mk index ea2b7165d9b..17ef684830f 100644 --- a/keyboards/contra/keymaps/losinggeneration/rules.mk +++ b/keyboards/contra/keymaps/losinggeneration/rules.mk @@ -12,6 +12,3 @@ MIDI_ENABLE = no # MIDI controls NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/contra/keymaps/maxr1998/keymap.c b/keyboards/contra/keymaps/maxr1998/keymap.c index 87bf3389489..c32a8566115 100644 --- a/keyboards/contra/keymaps/maxr1998/keymap.c +++ b/keyboards/contra/keymaps/maxr1998/keymap.c @@ -19,16 +19,17 @@ enum contra_layers { _QWERTZ, - _FUNC, - _NUMROW, - _NUMROW_L3, + _FN, + _NR, + _NR_L3, + _FX, _GAMING }; -#define KC_I3 LM(_NUMROW, MOD_LALT) -#define KC_NR MO(_NUMROW) -#define NR_L3 SAFE_RANGE -#define FUN MO(_FUNC) +#define KC_I3 LM(_NR, MOD_LALT) +#define KC_NR SAFE_RANGE +#define KC_N3 (SAFE_RANGE + 1) +#define KC_FN MO(_FN) #define G_1 TO(_GAMING) #define G_0 TG(_GAMING) @@ -49,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_PLUS, KC_ENT }, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT}, - {KC_LCTL, KC_LGUI, KC_LALT, KC_I3, KC_NR, KC_SPC, KC_SPC, NR_L3, FUN, KC_LEFT, KC_DOWN, KC_RGHT} + {KC_LCTL, KC_LGUI, KC_LALT, KC_I3, KC_NR, KC_SPC, KC_SPC, KC_N3, KC_FN, KC_LEFT, KC_DOWN, KC_RGHT} }, /* Function layer @@ -60,10 +61,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | | | | | | | RGBH-| RGBT | RGBH+| PgUp | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | ---- | ---- | | | ---- | ---- | Home | PgDn | End | + * | | | | ---- | ---- | | ---- | ---- | Home | PgDn | End | * `-----------------------------------------------------------------------------------' */ -[_FUNC] = { +[_FN] = { {_______, _______, _______, _______, _______, _______, _______, DE_UE, _______, DE_OE, _______, KC_DEL }, {KC_LOCK, DE_AE, DE_SS, _______, _______, G_1, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______}, {_______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_TOG, RGB_HUI, KC_PGUP, _______}, @@ -72,26 +73,44 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Numrow layer (special characters with Shift and ISO_L3_Shift) * ,-----------------------------------------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | * |------+------+------+------+------+-------------+------+------+------+------+------| * | | | | | | | | | | | #' | | * |------+------+------+------+------+------|------+------+------+------+------+------| * | | <> | | | | | | | | | | -_ | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | ---- | ---- | | | ---- | ---- | | | | + * | | | | ---- | ---- | | ---- | ---- | | | | * `-----------------------------------------------------------------------------------' */ -[_NUMROW] = { +[_NR] = { {_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DE_HASH, _______}, {_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______}, - {_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______} + {_______, _______, _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, _______, _______, _______} }, -[_NUMROW_L3] = { - {_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______}, +[_NR_L3] = { + {_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS }, {_______, DE_Q, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, {_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______}, - {_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______} + {_______, _______, _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, _______, _______, _______} +}, + +/* Function keys + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FX] = { + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, _______, _______, _______} }, /* Gaming @@ -102,17 +121,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Space| | | | | | | | Reset| | | | + * | Space| | | | | | | Leave| | | | * `-----------------------------------------------------------------------------------' */ [_GAMING] = { {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_SPC, _______, _______, _______, _______, _______, _______, _______, G_0, _______, _______, _______} + {KC_SPC, XXXXXXX, _______, _______, _______, KC_LCTL, KC_LCTL, _______, G_0, _______, _______, _______} } }; +void update_tri_layer_user(void); + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch(keycode) { case KC_BSPC: @@ -125,20 +146,36 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unregister_code(DE_SS); } return true; - case NR_L3: + case KC_NR: + if (record->event.pressed) { + layer_on(_NR); + } else { + layer_off(_NR); + } + update_tri_layer_user(); + return false; + case KC_N3: if (record->event.pressed) { - register_code(DE_ALGR); - layer_on(_NUMROW_L3); + layer_on(_NR_L3); } else { - layer_off(_NUMROW_L3); - unregister_code(DE_ALGR); + layer_off(_NR_L3); } + update_tri_layer_user(); return false; default: return true; } } +void update_tri_layer_user(void) { + update_tri_layer(_NR, _NR_L3, _FX); + if (layer_state_is(_NR_L3) && !layer_state_is(_FX)) { + register_code(KC_ALGR); + } else { + unregister_code(KC_ALGR); + } +} + void led_set_user(uint8_t usb_led) { // Force-enable Numlock if (!(usb_led & (1<event.pressed) { + // print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/contra/keymaps/msiu/readme.md b/keyboards/contra/keymaps/msiu/readme.md new file mode 100644 index 00000000000..80aba109548 --- /dev/null +++ b/keyboards/contra/keymaps/msiu/readme.md @@ -0,0 +1,2 @@ +# The Default Contra Layout + diff --git a/keyboards/contra/keymaps/ryanm101/keymap.c b/keyboards/contra/keymaps/ryanm101/keymap.c index 70082a5a4f5..721a9a06eaf 100644 --- a/keyboards/contra/keymaps/ryanm101/keymap.c +++ b/keyboards/contra/keymaps/ryanm101/keymap.c @@ -3,9 +3,6 @@ extern keymap_config_t keymap_config; -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom Key Combos #define LCKSCR LCTL(LGUI(KC_Q)) //#define KC_CAD LCTL(LALT(KC_DEL)) // CTL+ALT+DEL (windows) diff --git a/keyboards/contra/readme.md b/keyboards/contra/readme.md index c1915a811d2..f16598581ec 100644 --- a/keyboards/contra/readme.md +++ b/keyboards/contra/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make contra:dana -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/converter/adb_usb/README.md b/keyboards/converter/adb_usb/README.md index ed717500807..8de9b9ad46d 100644 --- a/keyboards/converter/adb_usb/README.md +++ b/keyboards/converter/adb_usb/README.md @@ -1,4 +1,4 @@ -ADB-to USB Keyboard Converter +ADB-to-USB Keyboard Converter ============================= This firmware converts Apple Desktop Bus (ADB) keyboard protocol to USB so that you can use an ADB keyboard on a modern computer. It works on the PJRC Teensy 2.0 and other USB AVR MCUs (ATMega32U4, AT90USB64/128, etc) and needs at least 10KB of flash memory. @@ -81,3 +81,4 @@ though the ADB protocol itself supports it. See protocol/adb.c for more info. QMK Port Changelog --------- - 2018/09/16 - Initial release. +- 2018/12/23 - Fixed lock LED support. diff --git a/keyboards/converter/adb_usb/adb_usb.h b/keyboards/converter/adb_usb/adb_usb.h index 491db95f1c9..8691adcc65e 100644 --- a/keyboards/converter/adb_usb/adb_usb.h +++ b/keyboards/converter/adb_usb/adb_usb.h @@ -17,8 +17,8 @@ along with this program. If not, see . Ported to QMK by Peter Roe */ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H +#ifndef ADB_USB_H +#define ADB_USB_H #include "quantum.h" @@ -58,10 +58,10 @@ Ported to QMK by Peter Roe { KC_NO, KC_NO, KC_NO, K4B, K4C, KC_NO, K4E, KC_NO, }, \ { KC_NO, KC_NO, K52, K53, K54, K55, K56, K57 }, \ { K58, K59, KC_NO, K5B, K5C, KC_NO, KC_NO, KC_NO, }, \ - { K60, K61, K62, K63, K64, K65, KC_NO, K67 }, \ - { KC_NO, K69, KC_NO, K6B, KC_NO, K6D, KC_NO, K6F }, \ - { KC_NO, K71, K72, K73, K74, K75, K76, K77 }, \ - { K78, K79, K7A, K7B, K7C, K7D, KC_NO, K7F } \ + { K60, K61, K62, K63, K64, K65, KC_NO, K67 }, \ + { KC_NO, K69, KC_NO, K6B, KC_NO, K6D, KC_NO, K6F }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77 }, \ + { K78, K79, K7A, K7B, K7C, K7D, KC_NO, K7F } \ } /* M0116 Apple Standard Keyboard ANSI diff --git a/keyboards/converter/adb_usb/info.json b/keyboards/converter/adb_usb/info.json new file mode 100644 index 00000000000..e06f9c1adb6 --- /dev/null +++ b/keyboards/converter/adb_usb/info.json @@ -0,0 +1,204 @@ +{ + "keyboard_name": "ADB to USB Keyboard Converter", + "url": "", + "maintainer": "qmk", + "width": 22.5, + "height": 7, + "layouts": { + "LAYOUT_ext_ansi": { + "layout": [ + {"label":"Escape", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"Eject", "x":21.5, "y":0}, + {"label":"`", "x":0, "y":2}, + {"label":"1", "x":1, "y":2}, + {"label":"2", "x":2, "y":2}, + {"label":"3", "x":3, "y":2}, + {"label":"4", "x":4, "y":2}, + {"label":"5", "x":5, "y":2}, + {"label":"6", "x":6, "y":2}, + {"label":"7", "x":7, "y":2}, + {"label":"8", "x":8, "y":2}, + {"label":"9", "x":9, "y":2}, + {"label":"0", "x":10, "y":2}, + {"label":"-", "x":11, "y":2}, + {"label":"=", "x":12, "y":2}, + {"label":"Backspace", "x":13, "y":2, "w":2}, + {"label":"Insert", "x":15.25, "y":2}, + {"label":"Home", "x":16.25, "y":2}, + {"label":"Page Up", "x":17.25, "y":2}, + {"label":"Num Lock", "x":18.5, "y":2}, + {"label":"Num =", "x":19.5, "y":2}, + {"label":"Num /", "x":20.5, "y":2}, + {"label":"Num *", "x":21.5, "y":2}, + {"label":"Tab", "x":0, "y":3, "w":1.5}, + {"label":"Q", "x":1.5, "y":3}, + {"label":"W", "x":2.5, "y":3}, + {"label":"E", "x":3.5, "y":3}, + {"label":"R", "x":4.5, "y":3}, + {"label":"T", "x":5.5, "y":3}, + {"label":"Y", "x":6.5, "y":3}, + {"label":"U", "x":7.5, "y":3}, + {"label":"I", "x":8.5, "y":3}, + {"label":"O", "x":9.5, "y":3}, + {"label":"P", "x":10.5, "y":3}, + {"label":"[", "x":11.5, "y":3}, + {"label":"]", "x":12.5, "y":3}, + {"label":"\\", "x":13.5, "y":3, "w":1.5}, + {"label":"Delete", "x":15.25, "y":3}, + {"label":"End", "x":16.25, "y":3}, + {"label":"Page Down", "x":17.25, "y":3}, + {"label":"Num 7", "x":18.5, "y":3}, + {"label":"Num 8", "x":19.5, "y":3}, + {"label":"Num 9", "x":20.5, "y":3}, + {"label":"Num -", "x":21.5, "y":3}, + {"label":"Lcap", "x":0, "y":4, "w":1.75}, + {"label":"A", "x":1.75, "y":4}, + {"label":"S", "x":2.75, "y":4}, + {"label":"D", "x":3.75, "y":4}, + {"label":"F", "x":4.75, "y":4}, + {"label":"G", "x":5.75, "y":4}, + {"label":"H", "x":6.75, "y":4}, + {"label":"J", "x":7.75, "y":4}, + {"label":"K", "x":8.75, "y":4}, + {"label":"L", "x":9.75, "y":4}, + {"label":";", "x":10.75, "y":4}, + {"label":"\"", "x":11.75, "y":4}, + {"label":"Enter", "x":12.75, "y":4, "w":2.25}, + {"label":"Num 4", "x":18.5, "y":4}, + {"label":"Num 5", "x":19.5, "y":4}, + {"label":"Num 6", "x":20.5, "y":4}, + {"label":"Num +", "x":21.5, "y":4}, + {"label":"Shift", "x":0, "y":5, "w":2.25}, + {"label":"Z", "x":2.25, "y":5}, + {"label":"X", "x":3.25, "y":5}, + {"label":"C", "x":4.25, "y":5}, + {"label":"V", "x":5.25, "y":5}, + {"label":"B", "x":6.25, "y":5}, + {"label":"N", "x":7.25, "y":5}, + {"label":"M", "x":8.25, "y":5}, + {"label":",", "x":9.25, "y":5}, + {"label":".", "x":10.25, "y":5}, + {"label":"/", "x":11.25, "y":5}, + {"label":"Shift", "x":12.25, "y":5, "w":2.75}, + {"label":"Up", "x":16.25, "y":5}, + {"label":"Num 1", "x":18.5, "y":5}, + {"label":"Num 2", "x":19.5, "y":5}, + {"label":"Num 3", "x":20.5, "y":5}, + {"label":"Ctrl", "x":0, "y":6, "w":1.5}, + {"label":"Alt", "x":1.5, "y":6, "w":1.25}, + {"label":"Command", "x":2.75, "y":6, "w":1.5}, + {"label":"Space", "x":4.25, "y":6, "w":6.5}, + {"label":"Alt", "x":12.25, "y":6, "w":1.25}, + {"label":"Ctrl", "x":13.5, "y":6, "w":1.5}, + {"label":"Left", "x":15.25, "y":6}, + {"label":"Down", "x":16.25, "y":6}, + {"label":"Right", "x":17.25, "y":6}, + {"label":"Num 0", "x":18.5, "y":6, "w":2}, + {"label":"Num .", "x":20.5, "y":6}, + {"label":"Num Enter", "x":21.5, "y":5, "h":2} + ] + }, + "LAYOUT_m0116_ansi": { + "width": 19.5, + "height": 6.25, + "layout": [ + {"label":"Power", "x":5, "y":0, "w":2}, + {"label":"Esc", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":7, "y":1.25}, + {"label":"8", "x":8, "y":1.25}, + {"label":"9", "x":9, "y":1.25}, + {"label":"0", "x":10, "y":1.25}, + {"label":"-", "x":11, "y":1.25}, + {"label":"=", "x":12, "y":1.25}, + {"label":"Delete", "x":13, "y":1.25, "w":1.5}, + {"label":"Clear", "x":15.5, "y":1.25}, + {"label":"Num =", "x":16.5, "y":1.25}, + {"label":"Num /", "x":17.5, "y":1.25}, + {"label":"Num *", "x":18.5, "y":1.25}, + {"label":"Tab", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"[", "x":11.5, "y":2.25}, + {"label":"]", "x":12.5, "y":2.25}, + {"label":"Num 7", "x":15.5, "y":2.25}, + {"label":"Num 8", "x":16.5, "y":2.25}, + {"label":"Num 9", "x":17.5, "y":2.25}, + {"label":"Num +", "x":18.5, "y":2.25}, + {"label":"Ctrl", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":";", "x":10.75, "y":3.25}, + {"label":"'", "x":11.75, "y":3.25}, + {"label":"Return", "x":12.75, "y":3.25, "w":1.75}, + {"label":"Num 4", "x":15.5, "y":3.25}, + {"label":"Num 5", "x":16.5, "y":3.25}, + {"label":"Num 6", "x":17.5, "y":3.25}, + {"label":"Num -", "x":18.5, "y":3.25}, + {"label":"Shift", "x":0, "y":4.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":",", "x":9.25, "y":4.25}, + {"label":".", "x":10.25, "y":4.25}, + {"label":"/", "x":11.25, "y":4.25}, + {"label":"Shift", "x":12.25, "y":4.25, "w":2.25}, + {"label":"Num 1", "x":15.5, "y":4.25}, + {"label":"Num 2", "x":16.5, "y":4.25}, + {"label":"Num 3", "x":17.5, "y":4.25}, + {"label":"Caps Lock", "x":0, "y":5.25}, + {"label":"Option", "x":1, "y":5.25}, + {"label":"Command", "x":2, "y":5.25, "w":1.75}, + {"label":"`", "x":3.75, "y":5.25}, + {"label":"Space", "x":4.75, "y":5.25, "w":4.75}, + {"label":"\\", "x":9.5, "y":5.25}, + {"label":"Left", "x":10.5, "y":5.25}, + {"label":"Right", "x":11.5, "y":5.25}, + {"label":"Down", "x":12.5, "y":5.25}, + {"label":"Up", "x":13.5, "y":5.25}, + {"label":"Num 0", "x":15.5, "y":5.25, "w":2}, + {"label":"Num .", "x":17.5, "y":5.25}, + {"label":"Num Enter", "x":18.5, "y":4.25, "h":2} + ] + } + } +} diff --git a/keyboards/converter/adb_usb/led.c b/keyboards/converter/adb_usb/led.c index ea9bf77b5c1..3ee64a8e7d3 100644 --- a/keyboards/converter/adb_usb/led.c +++ b/keyboards/converter/adb_usb/led.c @@ -23,5 +23,5 @@ along with this program. If not, see . void led_set(uint8_t usb_led) { - adb_host_kbd_led(ADB_ADDR_KEYBOARD, ~usb_led); + adb_host_kbd_led(~usb_led); } diff --git a/keyboards/converter/adb_usb/matrix.c b/keyboards/converter/adb_usb/matrix.c index 8ee48bf23f2..4a70eb50213 100644 --- a/keyboards/converter/adb_usb/matrix.c +++ b/keyboards/converter/adb_usb/matrix.c @@ -58,26 +58,20 @@ void matrix_scan_user(void) { void matrix_init(void) { - // LED on - DDRD |= (1<<6); PORTD |= (1<<6); - adb_host_init(); + // wait for keyboard to boot up and receive command _delay_ms(2000); // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - led_set(host_keyboard_leds()); - - // debug_enable = false; + // debug_enable = true; // debug_matrix = true; // debug_keyboard = true; // debug_mouse = true; // print("debug enabled.\n"); - // LED off - DDRD |= (1<<6); PORTD &= ~(1<<6); matrix_init_quantum(); } diff --git a/keyboards/converter/adb_usb/rules.mk b/keyboards/converter/adb_usb/rules.mk index 3a9b6dedcca..7901898c7c3 100644 --- a/keyboards/converter/adb_usb/rules.mk +++ b/keyboards/converter/adb_usb/rules.mk @@ -1,7 +1,7 @@ # MCU name -# atmega32u4 Teensy2.0 -# atemga32u4 TMK Converter rev.1 -# atemga32u2 TMK Converter rev.2 +# atmega32u4 Teensy2.0 +# atemga32u4 TMK Converter rev.1 +# atemga32u2 TMK Converter rev.2 MCU = atmega32u4 # Processor frequency. @@ -50,24 +50,23 @@ BOOTLOADER = caterina # Boot Section Size in *bytes* # Teensy halfKay 512 # Teensy++ halfKay 1024 -# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2 +# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2 # LUFA bootloader 4096 # USBaspLoader 2048 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = no # USB Nkey Rollover - not yet supported in LUFA -EXTRAKEY_ENABLE = yes -USB_HID_ENABLE = yes -BACKLIGHT_ENABLE = no -#BLUETOOTH = AdafruitBLE # For Adafruit Feather 32U4 BLE support, uncomment this line +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover - not yet supported in LUFA +EXTRAKEY_ENABLE = yes +USB_HID_ENABLE = yes +BACKLIGHT_ENABLE = no +#BLUETOOTH = AdafruitBLE # For Adafruit Feather 32U4 BLE support, uncomment this line +CUSTOM_MATRIX = yes -CUSTOM_MATRIX = yes -SRC = matrix.c \ - adb.c +SRC = matrix.c adb.c led.c diff --git a/keyboards/converter/hp_46010a/config.h b/keyboards/converter/hp_46010a/config.h index f77ed4115f9..b7297ab884a 100644 --- a/keyboards/converter/hp_46010a/config.h +++ b/keyboards/converter/hp_46010a/config.h @@ -30,6 +30,4 @@ along with this program. If not, see . #define MATRIX_COLS 8 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - - +#define DEBOUNCE 5 diff --git a/keyboards/converter/hp_46010a/matrix.c b/keyboards/converter/hp_46010a/matrix.c index 2ca7d0357e3..ac9224087f0 100644 --- a/keyboards/converter/hp_46010a/matrix.c +++ b/keyboards/converter/hp_46010a/matrix.c @@ -34,18 +34,18 @@ along with this program. If not, see . #include "config.h" -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if ( DEBOUNCING_DELAY > 0 ) +#if ( DEBOUNCE > 0 ) static uint16_t debouncing_time ; static bool debouncing = false ; #endif static uint8_t matrix [MATRIX_ROWS] = {0}; -#if ( DEBOUNCING_DELAY > 0 ) +#if ( DEBOUNCE > 0 ) static uint8_t matrix_debounce_old [MATRIX_ROWS] = {0}; static uint8_t matrix_debounce_new [MATRIX_ROWS] = {0}; #endif @@ -172,7 +172,7 @@ uint8_t matrix_scan(void) { // the first byte of the keyboard's output data can be ignored Matrix_ThrowByte(); -#if ( DEBOUNCING_DELAY > 0 ) +#if ( DEBOUNCE > 0 ) for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { //transfer old debouncing values @@ -194,8 +194,8 @@ uint8_t matrix_scan(void) { #endif -#if ( DEBOUNCING_DELAY > 0 ) - if ( debouncing && ( timer_elapsed( debouncing_time ) > DEBOUNCING_DELAY ) ) { +#if ( DEBOUNCE > 0 ) + if ( debouncing && ( timer_elapsed( debouncing_time ) > DEBOUNCE ) ) { for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { matrix[row] = matrix_debounce_new[row] ; diff --git a/keyboards/converter/hp_46010a/rules.mk b/keyboards/converter/hp_46010a/rules.mk index ddd2d593bd2..797258caf78 100644 --- a/keyboards/converter/hp_46010a/rules.mk +++ b/keyboards/converter/hp_46010a/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -39,7 +38,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = halfkay @@ -48,8 +47,8 @@ BOOTLOADER = halfkay # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work @@ -62,11 +61,9 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = no SPLIT_KEYBOARD = no WAIT_FOR_USB = yes - +LAYOUTS_HAS_RGB = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -LAYOUTS_HAS_RGB = NO - +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend CUSTOM_MATRIX = yes -SRC = matrix.c \ No newline at end of file + +SRC = matrix.c diff --git a/keyboards/converter/ibm_5291/config.h b/keyboards/converter/ibm_5291/config.h new file mode 100644 index 00000000000..9701bdfe973 --- /dev/null +++ b/keyboards/converter/ibm_5291/config.h @@ -0,0 +1,40 @@ +/* +Copyright 2018 listofoptions + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 1 +#define MANUFACTURER QMK +#define PRODUCT 5291 keyboard converter +#define DESCRIPTION 5291 keyboard converter + +#define MATRIX_ROWS 24 +#define MATRIX_COLS 4 + +#define MATRIX_ROW_PINS {B2, B3, B4, B5, B6} +#define MATRIX_COL_PINS {B0, B1} +#define MATRIX_DATA_PIN D0 +#define MATRIX_STROBE_PIN D1 +#define LED_PIN D6 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 0 diff --git a/keyboards/converter/ibm_5291/ibm_5291.c b/keyboards/converter/ibm_5291/ibm_5291.c new file mode 100644 index 00000000000..9b937a545ae --- /dev/null +++ b/keyboards/converter/ibm_5291/ibm_5291.c @@ -0,0 +1,3 @@ +#include "ibm_5291.h" +#include +#include "quantum.h" \ No newline at end of file diff --git a/keyboards/converter/ibm_5291/ibm_5291.h b/keyboards/converter/ibm_5291/ibm_5291.h new file mode 100644 index 00000000000..aa1b403242e --- /dev/null +++ b/keyboards/converter/ibm_5291/ibm_5291.h @@ -0,0 +1,69 @@ +/* +Copyright 2018 listofoptions + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + +/* + * ,-------. ,--------------------------------------------------------------------------. + * | F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck | + * |-------| |--------------------------------------------------------------------------| + * | F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -| + * |-------| |------------------------------------------------------|Ent|---------------| + * | F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| | + * |-------| |----------------------------------------------------------------------| | + * | F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift|PrS| 1| 2| 3| +| + * |-------| |----------------------------------------------------------------------| | + * | F9|F10| | Alt | Space |CapsLck| 0 | . | | + * `-------' `--------------------------------------------------------------------------' +*/ + +#define LAYOUT_5291( \ + KEY_F1,KEY_F2, KEY_ESC, KEY_1, KEY_2,KEY_3,KEY_4,KEY_5,KEY_6,KEY_7,KEY_8,KEY_9, KEY_0, KEY_MIN, KEY_EQU, KEY_BACK, KEY_NLOCK, KEY_SLOCK, \ + KEY_F3,KEY_F4, KEY_TAB, KEY_Q, KEY_W,KEY_E,KEY_R,KEY_T,KEY_Y,KEY_U,KEY_I,KEY_O, KEY_P, KEY_LBRC,KEY_RBRC, KEY_PAD7,KEY_PAD8, KEY_PAD9,KEY_PMIN, \ + KEY_F5,KEY_F6, KEY_LCTR,KEY_A, KEY_S,KEY_D,KEY_F,KEY_G,KEY_H,KEY_J,KEY_K,KEY_L, KEY_SEMI,KEY_QUOT,KEY_TICK, KEY_ENTR,KEY_PAD4,KEY_PAD5, KEY_PAD6, \ + KEY_F7,KEY_F8, KEY_LSFS,KEY_BSLS,KEY_Z,KEY_X,KEY_C,KEY_V,KEY_B,KEY_N,KEY_M,KEY_COMM,KEY_DOT, KEY_SLS,KEY_RSFS, KEY_PAST,KEY_PAD1,KEY_PAD2, KEY_PAD3,KEY_PPLS, \ + KEY_F9,KEY_F10, KEY_LALT, KEY_SPACE, KEY_CLOCK, KEY_PAD0, KEY_PDOT \ +) \ +{ {KEY_Z, KEY_S, KEY_W, KEY_3 }\ +, {KEY_X, KEY_D, KEY_E, KEY_4 }\ +, {KEY_C, KEY_F, KEY_R, KEY_5 }\ +, {KEY_V, KEY_G, KEY_T, KEY_6 }\ +, {KEY_B, KEY_H, KEY_Y, KEY_7 }\ +, {KEY_N, KEY_J, KEY_U, KEY_8 }\ +, {KEY_PAD2, KEY_PAD5,KEY_PAD8,KEY_NLOCK }\ +, {KEY_M, KEY_K, KEY_I, KEY_9 }\ +, {KEY_COMM, KEY_L, KEY_O, KEY_0 }\ +, {KEY_DOT, KEY_SEMI,KEY_P, KEY_MIN }\ +, {KEY_SLS, KEY_QUOT,KEY_LBRC,KEY_EQU }\ +, {KEY_SPACE, KEY_RSFS,KEY_TICK,KEY_RBRC }\ +, {KEY_CLOCK, KEY_PAST,KEY_ENTR,KEY_BACK }\ +, {KEY_PAD0, KEY_PAD1,KEY_PAD4,KEY_PAD7 }\ +, {KEY_PPLS, KC_NO, KEY_PMIN,KEY_SLOCK }\ +, {KEY_PDOT, KEY_PAD3,KEY_PAD6,KEY_PAD9 }\ +, {KEY_BSLS, KEY_A, KEY_Q, KEY_2 }\ +, {KEY_LALT, KC_NO, KC_NO, KEY_1 }\ +, {KEY_F7, KEY_F5, KEY_F3, KEY_F1 }\ +, {KEY_F8, KEY_F6, KEY_F4, KEY_F2 }\ +, {KC_F10, KC_NO, KC_NO, KC_NO }\ +, {KC_F9, KC_NO, KC_NO, KC_NO }\ +, {KEY_LSFS, KEY_LCTR,KEY_TAB, KEY_ESC }\ +, {KC_NO, KC_NO, KC_NO, KC_NO }\ +} + +#define LAYOUT LAYOUT_5291 \ No newline at end of file diff --git a/keyboards/converter/ibm_5291/info.json b/keyboards/converter/ibm_5291/info.json new file mode 100644 index 00000000000..2cb3b76c205 --- /dev/null +++ b/keyboards/converter/ibm_5291/info.json @@ -0,0 +1,97 @@ +{ + "keyboard_name": "IBM 5291", + "keyboard_folder": "converter/ibm_5291", + "url": "https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard", + "maintainer": "listofoptions", + "width": 21, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Sys Req", "x":0, "y":0}, + {"label":"Cmd", "x":1, "y":0}, + {"label":"`", "x":2.25, "y":0}, + {"label":"1", "x":3.25, "y":0}, + {"label":"2", "x":4.25, "y":0}, + {"label":"3", "x":5.25, "y":0}, + {"label":"4", "x":6.25, "y":0}, + {"label":"5", "x":7.25, "y":0}, + {"label":"6", "x":8.25, "y":0}, + {"label":"7", "x":9.25, "y":0}, + {"label":"8", "x":10.25, "y":0}, + {"label":"9", "x":11.25, "y":0}, + {"label":"0", "x":12.25, "y":0}, + {"label":"-", "x":13.25, "y":0}, + {"label":"=", "x":14.25, "y":0}, + {"label":"Backspace", "x":15.25, "y":0, "w":1.75}, + {"label":"Reverse Tab", "x":17, "y":0, "w":2}, + {"label":"Dup", "x":19, "y":0, "w":2}, + {"label":"Del", "x":0, "y":1}, + {"label":"Erase Input", "x":1, "y":1}, + {"label":"Tab", "x":2.25, "y":1, "w":1.5}, + {"label":"Q", "x":3.75, "y":1}, + {"label":"W", "x":4.75, "y":1}, + {"label":"E", "x":5.75, "y":1}, + {"label":"R", "x":6.75, "y":1}, + {"label":"T", "x":7.75, "y":1}, + {"label":"Y", "x":8.75, "y":1}, + {"label":"U", "x":9.75, "y":1}, + {"label":"I", "x":10.75, "y":1}, + {"label":"O", "x":11.75, "y":1}, + {"label":"P", "x":12.75, "y":1}, + {"label":"¢", "x":13.75, "y":1}, + {"label":"\\", "x":14.75, "y":1, "w":1.25}, + {"label":"7", "x":17, "y":1}, + {"label":"8", "x":18, "y":1}, + {"label":"9", "x":19, "y":1}, + {"label":"Field -", "x":20, "y":1}, + {"label":"Print", "x":0, "y":2}, + {"label":"Help", "x":1, "y":2}, + {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, + {"label":"A", "x":4, "y":2}, + {"label":"S", "x":5, "y":2}, + {"label":"D", "x":6, "y":2}, + {"label":"F", "x":7, "y":2}, + {"label":"G", "x":8, "y":2}, + {"label":"H", "x":9, "y":2}, + {"label":"J", "x":10, "y":2}, + {"label":"K", "x":11, "y":2}, + {"label":"L", "x":12, "y":2}, + {"label":";", "x":13, "y":2}, + {"label":"'", "x":14, "y":2}, + {"label":"{", "x":15, "y":2}, + {"label":"Field Exit", "x":16, "y":1, "h":2}, + {"label":"4", "x":17, "y":2}, + {"label":"5", "x":18, "y":2}, + {"label":"6", "x":19, "y":2}, + {"label":"Roll Up", "x":0, "y":3}, + {"label":"Roll Down", "x":1, "y":3}, + {"label":"Shift", "x":2.25, "y":3, "w":1.25}, + {"label":"<", "x":3.5, "y":3}, + {"label":"Z", "x":4.5, "y":3}, + {"label":"X", "x":5.5, "y":3}, + {"label":"C", "x":6.5, "y":3}, + {"label":"V", "x":7.5, "y":3}, + {"label":"B", "x":8.5, "y":3}, + {"label":"N", "x":9.5, "y":3}, + {"label":"M", "x":10.5, "y":3}, + {"label":",", "x":11.5, "y":3}, + {"label":".", "x":12.5, "y":3}, + {"label":"/", "x":13.5, "y":3}, + {"label":"Shift", "x":14.5, "y":3, "w":1.5}, + {"label":"Return", "x":16, "y":3}, + {"label":"1", "x":17, "y":3}, + {"label":"2", "x":18, "y":3}, + {"label":"3", "x":19, "y":3}, + {"label":"Field +", "x":20, "y":2, "h":3}, + {"label":"Left", "x":0, "y":4}, + {"label":"Right", "x":1, "y":4}, + {"label":"Error Reset", "x":2.25, "y":4, "w":2}, + {"label":"Space", "x":4.25, "y":4, "w":9.75}, + {"label":"Enter Rec Adv", "x":14, "y":4, "w":2}, + {"label":"0", "x":16, "y":4, "w":2}, + {"label":".", "x":18, "y":4, "w":2} + ] + } + } +} diff --git a/keyboards/converter/ibm_5291/keymaps/default/keymap.c b/keyboards/converter/ibm_5291/keymaps/default/keymap.c new file mode 100644 index 00000000000..9b286c887d6 --- /dev/null +++ b/keyboards/converter/ibm_5291/keymaps/default/keymap.c @@ -0,0 +1,233 @@ +/* +Copyright 2018 listofoptions + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H +/* +enum xt_keycodes + { XT_PAST = SAFE_RANGE // XT pad asterisk / print screen + , XT_SLCK // XT scroll lock / break + , XT_F6 // F6 / app key + , XT_F5 // F5 / gui + , XT_F9 // F9 / F11 + , XT_F10 // F10 / F12 + } ; + +static bool shift_pressed = false , + alt_pressed = false , + ctrl_pressed = false , + xt_pscr_pressed = false , + xt_brk_pressed = false , + xt_app_pressed = false , + xt_gui_pressed = false , + xt_lout_pressed = false , + xt_f11_pressed = false , + xt_f12_pressed = false ; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LSFT: + case KC_RSFT: + if (record->event.pressed) { + shift_pressed = true ; + } else { + shift_pressed = false ; + } + return true; + break; + + case KC_LALT: + if (record->event.pressed) { + alt_pressed = true ; + } else { + alt_pressed = false ; + } + return true; + break; + + case KC_LCTL: + if (record->event.pressed) { + ctrl_pressed = true ; + } else { + ctrl_pressed = false ; + } + return true; + break; + + case XT_PAST: + if (record->event.pressed) { + if (shift_pressed) { + xt_pscr_pressed = true ; + register_code(KC_PSCR); + } else { + register_code(KC_PAST); + } + } else { + if (xt_pscr_pressed) { + xt_pscr_pressed = false ; + unregister_code(KC_PSCR); + } else { + unregister_code(KC_PAST); + } + } + return false; + break; + + case XT_SLCK: + if (record->event.pressed) { + if (ctrl_pressed) { + xt_brk_pressed = true ; + register_code(KC_BRK); + } else { + register_code(KC_SLCK); + } + } else { + if (xt_brk_pressed) { + xt_brk_pressed = false ; + unregister_code(KC_BRK); + } else { + unregister_code(KC_SLCK); + } + } + return false; + break; + + case XT_F6: + if (record->event.pressed) { + if (shift_pressed) { + xt_app_pressed = true ; + register_code(KC_APP); + } else { + register_code(KC_F6); + } + } else { + if (xt_app_pressed) { + xt_app_pressed = false ; + unregister_code(KC_APP); + } else { + unregister_code(KC_F6); + } + } + return false; + break; + + case XT_F5: + if (record->event.pressed) { + if (shift_pressed) { + xt_gui_pressed = true ; + register_code(KC_LGUI); + } else if (ctrl_pressed) { + xt_lout_pressed = true ; + register_code (KC_LGUI) ; + register_code (KC_L) ; + } else { + register_code(KC_F5); + } + } else { + if (xt_gui_pressed) { + xt_gui_pressed = false ; + unregister_code(KC_LGUI); + } else if (xt_lout_pressed) { + xt_lout_pressed = false ; + unregister_code (KC_LGUI) ; + unregister_code (KC_L) ; + } else { + unregister_code(KC_F5); + } + } + return false; + break; + + case XT_F9: + if (record->event.pressed) { + if (shift_pressed) { + xt_f11_pressed = true ; + register_code(KC_F11); + } else { + register_code(KC_F9); + } + } else { + if (xt_f11_pressed) { + xt_f11_pressed = false ; + unregister_code(KC_F11); + } else { + unregister_code(KC_F9); + } + } + return false; + break; + + case XT_F10: + if (record->event.pressed) { + if (shift_pressed) { + xt_f12_pressed = true ; + register_code(KC_F12); + } else { + register_code(KC_F10); + } + } else { + if (xt_f12_pressed) { + xt_f12_pressed = false ; + unregister_code(KC_F12); + } else { + unregister_code(KC_F10); + } + } + return false; + break; + + default: + return true; + break; + } + + return true; +} +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// default layout is the standard XT layout +/* + * ,-------. ,--------------------------------------------------------------------------. + * | F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck | + * |-------| |--------------------------------------------------------------------------| + * | F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -| + * |-------| |------------------------------------------------------|Ent|---------------| + * | F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| | + * |-------| |----------------------------------------------------------------------| | + * | F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift| *| 1| 2| 3| +| + * |-------| |----------------------------------------------------------------------| | + * | F9|F10| | Alt | Space |CapsLck| 0 | . | | + * `-------' `--------------------------------------------------------------------------' +*/ +/* + [0] = LAYOUT ( + KC_F1,KC_F2, KC_ESC, KC_1, KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_NLCK, XT_SLCK, + KC_F3,KC_F4, KC_TAB, KC_Q, KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_O, KC_P, KC_LBRC,KC_RBRC, KC_P7,KC_P8, KC_P9, KC_PMNS, + XT_F5,XT_F6, KC_LCTL,KC_A, KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L, KC_SCLN,KC_QUOT,KC_GRV, KC_ENT, KC_P4,KC_P5, KC_P6, + KC_F7,KC_F8, KC_LSFT,KC_BSLS,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,XT_PAST,KC_P1,KC_P2, KC_P3, KC_PPLS, + XT_F9,XT_F10,KC_LALT, KC_SPACE, KC_CAPS, KC_P0, KC_PDOT + ) +*/ + [0] = LAYOUT ( + KC_F1,KC_F2, KC_ESC, KC_1, KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_NLCK, KC_SLCK, + KC_F3,KC_F4, KC_TAB, KC_Q, KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_O, KC_P, KC_LBRC,KC_RBRC, KC_P7,KC_P8, KC_P9, KC_PMNS, + KC_F5,KC_F6, KC_LCTL,KC_A, KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L, KC_SCLN,KC_QUOT,KC_GRV, KC_ENT, KC_P4,KC_P5, KC_P6, + KC_F7,KC_F8, KC_LSFT,KC_BSLS,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_PAST,KC_P1,KC_P2, KC_P3, KC_PPLS, + KC_F9,KC_F10,KC_LALT, KC_SPACE, KC_CAPS, KC_P0, KC_PDOT + ) +} ; + diff --git a/keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf b/keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf new file mode 100644 index 00000000000..3560598f02b Binary files /dev/null and b/keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf differ diff --git a/keyboards/converter/ibm_5291/matrix.c b/keyboards/converter/ibm_5291/matrix.c new file mode 100644 index 00000000000..8b2dba7ab6f --- /dev/null +++ b/keyboards/converter/ibm_5291/matrix.c @@ -0,0 +1,284 @@ +/* +Copyright 2018 listofoptions + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include +#include +#if defined(__AVR__) +#include +#endif +#include + +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + +#include "config.h" + + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define print_matrix_header() print("\nr/c 01234567\n") +#define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +#define matrix_bitpop(i) bitpop(matrix[i]) +#define ROW_SHIFTER ((uint8_t)1) +#define check_bit(var,pos) ((var) & (1<<(pos))) + +#define NUM_ROW_PINS 5 +#define NUM_COL_PINS 2 + +static const uint8_t row_pins [NUM_ROW_PINS] = MATRIX_ROW_PINS ; +static const uint8_t col_pins [NUM_ROW_PINS] = MATRIX_COL_PINS ; + +#if ( DEBOUNCE > 0 ) +static uint16_t debouncing_time ; +static bool debouncing = false ; +#endif + +static uint8_t matrix [MATRIX_ROWS] = {0}; + +#if ( DEBOUNCE > 0 ) +static uint8_t matrix_debounce [MATRIX_ROWS] = {0}; +#endif + +static +inline +void toggle_led(void) { + uint8_t pin = LED_PIN ; + _SFR_IO8((pin >> 4) + 2) ^= _BV(pin & 0xF); +} + +static +inline +void init_led(void) { + uint8_t pin = LED_PIN ; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static +inline +void init_data(void) { + uint8_t pin = MATRIX_DATA_PIN ; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // LO +} + +static +inline +void init_strobe(void) { + uint8_t pin = MATRIX_STROBE_PIN ; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static +inline +void init_rows(void) { + for ( uint8_t i = 0 ; i < NUM_ROW_PINS; ++i ) { + uint8_t pin = row_pins[i]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } +} + +static +inline +void init_cols(void) { + for ( uint8_t i = 0 ; i < NUM_COL_PINS; ++i ) { + uint8_t pin = col_pins[i]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } +} + +static +inline +void select_row(uint8_t current_row) { + for ( uint8_t i = 0 ; i < NUM_ROW_PINS; ++i ) { + uint8_t pin = row_pins[i] ; + if ( check_bit( current_row, i ) ) { + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } else { + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } + } + wait_us(30) ; +} + +static +inline +void select_col(uint8_t current_col) { + for ( uint8_t i = 0 ; i < NUM_COL_PINS; ++i ) { + uint8_t pin = col_pins[i] ; + if ( check_bit( current_col, i ) ) { + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } else { + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } + } + wait_us(30) ; +} + +static +inline +uint8_t matrix_strobe(uint8_t col_index) { + uint8_t strobe_pin = MATRIX_STROBE_PIN ; + uint8_t data_pin = MATRIX_DATA_PIN ; + + // set strobe pin low + _SFR_IO8((strobe_pin >> 4) + 2) &= ~_BV(strobe_pin & 0xF); + + wait_us(30) ; + + // read data + uint8_t data = (_SFR_IO8(data_pin >> 4) & _BV(data_pin & 0xF)) ; + + // set strobe pin hi + _SFR_IO8((strobe_pin >> 4) + 2) |= _BV(strobe_pin & 0xF); + + uint8_t out = data ? (1 << col_index) : 0 ; + return out ; +} + +static +bool matrix_read(uint8_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + uint8_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + select_row(current_row); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; ++col_index) { + + select_col(col_index) ; + + // strobe the matrix + // Populate the matrix row with the state of the data pin + current_matrix[current_row] |= matrix_strobe(col_index) ; + } + + bool test = last_row_value != current_matrix[current_row] ; + return test ; +} + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +inline +uint8_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_init(void) { + init_led() ; + init_rows() ; + init_cols() ; + init_data() ; + init_strobe() ; + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; +# if (DEBOUNCE > 0) + matrix_debounce [i] = 0; +# endif + } + + matrix_init_quantum() ; +} + +uint8_t matrix_scan(void) { + for ( uint8_t current_row = 0; current_row < MATRIX_ROWS; ++current_row ) { +# if (DEBOUNCE > 0) + bool matrix_changed = matrix_read(matrix_debounce, current_row); + + if (matrix_changed) { + debouncing = true ; + debouncing_time = timer_read(); + } + +# else + matrix_read(matrix, current_row); +# endif + } + +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debounce[i]; + } + debouncing = false; + } +# endif + + matrix_scan_quantum(); + return 1; +} + +void matrix_print(void) { + print_matrix_header(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + print_matrix_row(row); + print("\n"); + } +} diff --git a/keyboards/converter/ibm_5291/matrix.csv b/keyboards/converter/ibm_5291/matrix.csv new file mode 100644 index 00000000000..40462c2143e --- /dev/null +++ b/keyboards/converter/ibm_5291/matrix.csv @@ -0,0 +1,96 @@ +0,Z +1,S +2,W +3,3 +4,X +5,D +6,E +7,4 +8,C +9,F +10,R +11,5 +12,V +13,G +14,T +15,6 +16,B +17,H +18,Y +19,7 +20,N +21,J +22,U +23,8 +24,PAD_2 +25,PAD_5 +26,PAD_8 +27,NUM_LOCK +28,M +29,K +30,I +31,9 +32,COMMA +33,L +34,O +35,0 +36,PERIOD +37,SEMICOLON +38,P +39,MINUS +40,SLASH +41,QUOTE +42,LEFT_BRACE +43,EQUAL +44,SPACE +45,RSHIFT +46,BACK_QUOTE +47,RIGHT_BRACE +48,CAPS_LOCK +49,PAD_ASTERIX +50,ENTER +51,BACKSPACE +52,PAD_0 +53,PAD_1 +54,PAD_4 +55,PAD_7 +56,PAD_PLUS +57,UNASSIGNED +58,PAD_MINUS +59,SCROLL_LOCK +60,PAD_PERIOD +61,PAD_3 +62,PAD_6 +63,PAD_9 +64,BACKSLASH +65,A +66,Q +67,2 +68,LALT +69,UNASSIGNED +70,UNASSIGNED +71,1 +72,F7 +73,F5 +74,F3 +75,F1 +76,F8 +77,F6 +78,F4 +79,F2 +80,F10 +81,UNASSIGNED +82,UNASSIGNED +83,UNASSIGNED +84,F9 +85,UNASSIGNED +86,UNASSIGNED +87,UNASSIGNED +88,LSHIFT +89,LCTRL +90,TAB +91,ESC +92,UNASSIGNED +93,UNASSIGNED +94,UNASSIGNED +95,UNASSIGNED diff --git a/keyboards/converter/ibm_5291/readme.md b/keyboards/converter/ibm_5291/readme.md new file mode 100644 index 00000000000..03406d3f9de --- /dev/null +++ b/keyboards/converter/ibm_5291/readme.md @@ -0,0 +1,72 @@ +# IBM 5291 keyboard converter + +[IBM 5291](https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard) + +A converter for the eponymous keyboard. + +Keyboard Maintainer: [Listofoptions](https://github.com/listofoptions) +Hardware Supported: IBM 5291, Teensy 2.0 + +Make example for this keyboard (after setting up your build environment): + + make converter/ibm_5291:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + + +The pinout is as follows: + +IBM−5291−Cable to Pinhead−14 + +| pin | description +----|------------------------ +1 | GND +2 | NC +3 | GND +4 | GN) +5 | +5V +6 | D0 +7 | D1 +8 | D2 +9 | D3 +10| D4 +11| D5 +12| D6 +13| Strobe +14| Out + +The pins on this connector are organized +![here](https://geekhack.org/index.php?action=dlattach;topic=48950.0;attach=36759;image) + +IBM−5291−2 Cable with DB15M connector + +| pin | description +----|------------- +|1,2,3 | GND +|4 | +5V +|5 | D0 +|6 | D1 +|7 | D2 +|8 | D3 +|9 | D4 +|10 | D5 +|11 | D6 +|12 | Strobe +|13 | Out +|14 | PE +|15 | NC + +The above connector is actually numbered so it should be easier to determine +where the needed connections are. + +To connect to the teensy, the following are pins are needed (if you should choose not set your own): + +* PB0 -> PB6 are connected to D0 -> D6 +* +5V is connected to the corresponding teensy pin +* gnd is as well, only one of the gnd pins needs to be connected though. +* strobe is connected to pin PD1 +* data is connected to PD0 +* PE does not need to be connected to anything, but it could also be connected to gnd + +sources: + http://www.retrocomputing.eu/documents/5291_MaintenanceLibrary.pdf diff --git a/keyboards/converter/ibm_5291/rules.mk b/keyboards/converter/ibm_5291/rules.mk new file mode 100644 index 00000000000..457dad16612 --- /dev/null +++ b/keyboards/converter/ibm_5291/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = halfkay + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no +SPLIT_KEYBOARD = no +WAIT_FOR_USB = yes +LAYOUTS_HAS_RGB = no +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +CUSTOM_MATRIX = yes + +SRC = matrix.c diff --git a/keyboards/converter/ibm_terminal/README.md b/keyboards/converter/ibm_terminal/README.md deleted file mode 100644 index dff26e0594f..00000000000 --- a/keyboards/converter/ibm_terminal/README.md +++ /dev/null @@ -1,40 +0,0 @@ -Keyboard converter for IBM terminal keyboard -============================================ - -This is a port of TMK's converter/terminal_usb to QMK. - -It supports PS/2 Scan Code Set 3 and runs on USB AVR chips such like PJRC Teensy. -I tested the converter on ATMega32U4 with 1392595(102keys) and 6110345(122keys). - -Source code: https://github.com/qmk/qmk_firmware.git -Article: http://geekhack.org/index.php?topic=27272.0 - - -CONNECTION ----------- -Keyboard ATMega32U4 ----------------------- -Data: PD2 -Clock: PD5 - -And VCC and GND, of course. See RESOURCE for keyboard connector pin assign. - - -BUILD ------ -$ git clone https://github.com/qmk/qmk_firmware.git -$ cd qmk_firmware -$ make converter/ibm_terminal:default - - -RESOURCE --------- -Soarer's Converter: http://geekhack.org/index.php?topic=17458.0 -102keys(1392595): http://geekhack.org/index.php?topic=10737.0 -122keys(1390876): http://www.seasip.info/VintagePC/ibm_1390876.html -KbdBabel: http://www.kbdbabel.org/ -RJ45 Connector: http://www.kbdbabel.org/conn/kbd_connector_ibmterm.png -DIN Connector: http://www.kbdbabel.org/conn/kbd_connector_ibm3179_318x_319x.png -WinAVR: http://winavr.sourceforge.net/ - -EOF diff --git a/keyboards/converter/ibm_terminal/config.h b/keyboards/converter/ibm_terminal/config.h index 4dd85f6983a..ba9ec82fa28 100644 --- a/keyboards/converter/ibm_terminal/config.h +++ b/keyboards/converter/ibm_terminal/config.h @@ -39,11 +39,11 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_RALT) | MOD_BIT(KC_RCTL)) \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_RALT) | MOD_BIT(KC_RCTL)) \ ) -/* +/* * PS/2 USART configuration for ATMega32U4 */ #ifdef PS2_USE_USART diff --git a/keyboards/converter/ibm_terminal/ibm_terminal.h b/keyboards/converter/ibm_terminal/ibm_terminal.h index c6468349ca2..adf048206e9 100644 --- a/keyboards/converter/ibm_terminal/ibm_terminal.h +++ b/keyboards/converter/ibm_terminal/ibm_terminal.h @@ -19,7 +19,7 @@ void matrix_init_user(void); * 17| | * +---------+ */ -#define KEYMAP( \ +#define LAYOUT( \ K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \ K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, \ \ @@ -45,13 +45,13 @@ void matrix_init_user(void); { K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \ { K70, K71, K72, K73, K74, K75, K76, K77 }, \ { K78, K79, K7A, K7B, K7C, K7D, K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, K83, K84, KC_NO, KC_NO, KC_NO,}, \ + { KC_NO, KC_NO, KC_NO, K83, K84, KC_NO, KC_NO, KC_NO } \ } /* * IBM Terminal keyboard 1399625, 101-key */ -#define KEYMAP_101( \ +#define LAYOUT_101( \ K08, K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, K57,K5F,K62, \ \ K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, K67,K6E,K6F, K76,K77,K7E,K84, \ @@ -76,7 +76,7 @@ void matrix_init_user(void); { KC_NO, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \ { K70, K71, K72, K73, K74, K75, K76, K77 }, \ { KC_NO, K79, K7A, KC_NO, K7C, K7D, K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, K84, KC_NO, KC_NO, KC_NO,}, \ + { KC_NO, KC_NO, KC_NO, KC_NO, K84, KC_NO, KC_NO, KC_NO } \ } -#endif \ No newline at end of file +#endif diff --git a/keyboards/converter/ibm_terminal/info.json b/keyboards/converter/ibm_terminal/info.json new file mode 100644 index 00000000000..f064f3c5bd1 --- /dev/null +++ b/keyboards/converter/ibm_terminal/info.json @@ -0,0 +1,245 @@ +{ + "keyboard_name": "Keyboard converter for IBM terminal keyboard", + "url": "", + "maintainer": "qmk", + "width": 24.75, + "height": 8, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"F13", "x":3.25, "y":0}, + {"label":"F14", "x":4.25, "y":0}, + {"label":"F15", "x":5.25, "y":0}, + {"label":"F16", "x":6.25, "y":0}, + {"label":"F17", "x":7.25, "y":0}, + {"label":"F18", "x":8.25, "y":0}, + {"label":"F19", "x":9.25, "y":0}, + {"label":"F20", "x":10.25, "y":0}, + {"label":"F21", "x":11.25, "y":0}, + {"label":"F22", "x":12.25, "y":0}, + {"label":"F23", "x":13.25, "y":0}, + {"label":"F24", "x":14.25, "y":0}, + {"label":"F1", "x":3.25, "y":1}, + {"label":"F2", "x":4.25, "y":1}, + {"label":"F3", "x":5.25, "y":1}, + {"label":"F4", "x":6.25, "y":1}, + {"label":"F5", "x":7.25, "y":1}, + {"label":"F6", "x":8.25, "y":1}, + {"label":"F7", "x":9.25, "y":1}, + {"label":"F8", "x":10.25, "y":1}, + {"label":"F9", "x":11.25, "y":1}, + {"label":"F10", "x":12.25, "y":1}, + {"label":"F11", "x":13.25, "y":1}, + {"label":"F12", "x":14.25, "y":1}, + {"label":"Print Screen", "x":0, "y":3}, + {"label":"Esc", "x":1, "y":3}, + {"label":"Esc", "x":2.25, "y":3}, + {"label":"1", "x":3.25, "y":3}, + {"label":"2", "x":4.25, "y":3}, + {"label":"3", "x":5.25, "y":3}, + {"label":"4", "x":6.25, "y":3}, + {"label":"5", "x":7.25, "y":3}, + {"label":"6", "x":8.25, "y":3}, + {"label":"7", "x":9.25, "y":3}, + {"label":"8", "x":10.25, "y":3}, + {"label":"9", "x":11.25, "y":3}, + {"label":"0", "x":12.25, "y":3}, + {"label":"-", "x":13.25, "y":3}, + {"label":"=", "x":14.25, "y":3}, + {"label":"No", "x":15.25, "y":3}, + {"label":"Back Space", "x":16.25, "y":3}, + {"label":"Insert", "x":17.5, "y":3}, + {"label":"Home", "x":18.5, "y":3}, + {"label":"Page Up", "x":19.5, "y":3}, + {"label":"Num Lock", "x":20.75, "y":3}, + {"label":"/", "x":21.75, "y":3}, + {"label":"*", "x":22.75, "y":3}, + {"label":"-", "x":23.75, "y":3}, + {"label":"Scroll Lock", "x":0, "y":4}, + {"label":"Int4", "x":1, "y":4}, + {"label":"Tab", "x":2.25, "y":4, "w":1.5}, + {"label":"Q", "x":3.75, "y":4}, + {"label":"W", "x":4.75, "y":4}, + {"label":"E", "x":5.75, "y":4}, + {"label":"R", "x":6.75, "y":4}, + {"label":"T", "x":7.75, "y":4}, + {"label":"Y", "x":8.75, "y":4}, + {"label":"U", "x":9.75, "y":4}, + {"label":"I", "x":10.75, "y":4}, + {"label":"O", "x":11.75, "y":4}, + {"label":"P", "x":12.75, "y":4}, + {"label":"[", "x":13.75, "y":4}, + {"label":"]", "x":14.75, "y":4}, + {"label":"No", "x":15.75, "y":4, "w":1.5}, + {"label":"Delete", "x":17.5, "y":4}, + {"label":"End", "x":18.5, "y":4}, + {"label":"Page Down", "x":19.5, "y":4}, + {"label":"7", "x":20.75, "y":4}, + {"label":"8", "x":21.75, "y":4}, + {"label":"9", "x":22.75, "y":4}, + {"label":"+", "x":23.75, "y":4}, + {"label":"Pause", "x":0, "y":5}, + {"label":"Int5", "x":1, "y":5}, + {"label":"Caps Lock", "x":2.25, "y":5, "w":1.75}, + {"label":"A", "x":4, "y":5}, + {"label":"S", "x":5, "y":5}, + {"label":"D", "x":6, "y":5}, + {"label":"F", "x":7, "y":5}, + {"label":"G", "x":8, "y":5}, + {"label":"H", "x":9, "y":5}, + {"label":"J", "x":10, "y":5}, + {"label":"K", "x":11, "y":5}, + {"label":"L", "x":12, "y":5}, + {"label":";", "x":13, "y":5}, + {"label":"'", "x":14, "y":5}, + {"label":"\\", "x":15, "y":5}, + {"label":"Enter", "x":16, "y":5, "w":1.25}, + {"label":"Up", "x":18.5, "y":5}, + {"label":"4", "x":20.75, "y":5}, + {"label":"5", "x":21.75, "y":5}, + {"label":"6", "x":22.75, "y":5}, + {"label":",", "x":23.75, "y":5}, + {"label":"App", "x":0, "y":6}, + {"label":"Int6", "x":1, "y":6}, + {"label":"Shift", "x":2.25, "y":6, "w":1.25}, + {"label":"ISO \\", "x":3.5, "y":6}, + {"label":"Z", "x":4.5, "y":6}, + {"label":"X", "x":5.5, "y":6}, + {"label":"C", "x":6.5, "y":6}, + {"label":"V", "x":7.5, "y":6}, + {"label":"B", "x":8.5, "y":6}, + {"label":"N", "x":9.5, "y":6}, + {"label":"M", "x":10.5, "y":6}, + {"label":",", "x":11.5, "y":6}, + {"label":".", "x":12.5, "y":6}, + {"label":"/", "x":13.5, "y":6}, + {"label":"No", "x":14.5, "y":6}, + {"label":"Shift", "x":15.5, "y":6, "w":1.75}, + {"label":"Left", "x":17.5, "y":6}, + {"label":"Int2", "x":18.5, "y":6}, + {"label":"Right", "x":19.5, "y":6}, + {"label":"1", "x":20.75, "y":6}, + {"label":"2", "x":21.75, "y":6}, + {"label":"3", "x":22.75, "y":6}, + {"label":"Enter", "x":23.75, "y":6}, + {"label":"RGUI", "x":0, "y":7}, + {"label":"lgui", "x":1, "y":7}, + {"label":"Ctrl", "x":2.25, "y":7, "w":1.5}, + {"label":"Alt", "x":4.75, "y":7, "w":1.5}, + {"label":"Space", "x":6.25, "y":7, "w":7}, + {"label":"Alt", "x":13.25, "y":7, "w":1.5}, + {"label":"Ctrl", "x":15.75, "y":7, "w":1.5}, + {"label":"Down", "x":18.5, "y":7}, + {"label":"No", "x":20.75, "y":7}, + {"label":"0", "x":21.75, "y":7}, + {"label":".", "x":22.75, "y":7}, + {"label":"No", "x":23.75, "y":7} + ] + }, + "LAYOUT_101": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":2}, + {"label":"1", "x":1, "y":2}, + {"label":"2", "x":2, "y":2}, + {"label":"3", "x":3, "y":2}, + {"label":"4", "x":4, "y":2}, + {"label":"5", "x":5, "y":2}, + {"label":"6", "x":6, "y":2}, + {"label":"7", "x":7, "y":2}, + {"label":"8", "x":8, "y":2}, + {"label":"9", "x":9, "y":2}, + {"label":"0", "x":10, "y":2}, + {"label":"-", "x":11, "y":2}, + {"label":"=", "x":12, "y":2}, + {"label":"Back Space", "x":13, "y":2, "w":2}, + {"label":"Insert", "x":15.25, "y":2}, + {"label":"Home", "x":16.25, "y":2}, + {"label":"Page Up", "x":17.25, "y":2}, + {"label":"Num Lock", "x":18.5, "y":2}, + {"label":"/", "x":19.5, "y":2}, + {"label":"*", "x":20.5, "y":2}, + {"label":"-", "x":21.5, "y":2}, + {"label":"Tab", "x":0, "y":3, "w":1.5}, + {"label":"Q", "x":1.5, "y":3}, + {"label":"W", "x":2.5, "y":3}, + {"label":"E", "x":3.5, "y":3}, + {"label":"R", "x":4.5, "y":3}, + {"label":"T", "x":5.5, "y":3}, + {"label":"Y", "x":6.5, "y":3}, + {"label":"U", "x":7.5, "y":3}, + {"label":"I", "x":8.5, "y":3}, + {"label":"O", "x":9.5, "y":3}, + {"label":"P", "x":10.5, "y":3}, + {"label":"[", "x":11.5, "y":3}, + {"label":"]", "x":12.5, "y":3}, + {"label":"\\", "x":13.5, "y":3, "w":1.5}, + {"label":"Delete", "x":15.25, "y":3}, + {"label":"End", "x":16.25, "y":3}, + {"label":"Page Down", "x":17.25, "y":3}, + {"label":"7", "x":18.5, "y":3}, + {"label":"8", "x":19.5, "y":3}, + {"label":"9", "x":20.5, "y":3}, + {"label":"Caps Lock", "x":0, "y":4, "w":1.75}, + {"label":"A", "x":1.75, "y":4}, + {"label":"S", "x":2.75, "y":4}, + {"label":"D", "x":3.75, "y":4}, + {"label":"F", "x":4.75, "y":4}, + {"label":"G", "x":5.75, "y":4}, + {"label":"H", "x":6.75, "y":4}, + {"label":"J", "x":7.75, "y":4}, + {"label":"K", "x":8.75, "y":4}, + {"label":"L", "x":9.75, "y":4}, + {"label":";", "x":10.75, "y":4}, + {"label":"'", "x":11.75, "y":4}, + {"label":"Enter", "x":12.75, "y":4, "w":2.25}, + {"label":"4", "x":18.5, "y":4}, + {"label":"5", "x":19.5, "y":4}, + {"label":"6", "x":20.5, "y":4}, + {"label":"+", "x":21.5, "y":3, "h":2}, + {"label":"Shift", "x":0, "y":5, "w":2.25}, + {"label":"Z", "x":2.25, "y":5}, + {"label":"X", "x":3.25, "y":5}, + {"label":"C", "x":4.25, "y":5}, + {"label":"V", "x":5.25, "y":5}, + {"label":"B", "x":6.25, "y":5}, + {"label":"N", "x":7.25, "y":5}, + {"label":"M", "x":8.25, "y":5}, + {"label":",", "x":9.25, "y":5}, + {"label":".", "x":10.25, "y":5}, + {"label":"/", "x":11.25, "y":5}, + {"label":"Shift", "x":12.25, "y":5, "w":2.75}, + {"label":"Up", "x":16.25, "y":5}, + {"label":"1", "x":18.5, "y":5}, + {"label":"2", "x":19.5, "y":5}, + {"label":"3", "x":20.5, "y":5}, + {"label":"Ctrl", "x":0, "y":6, "w":1.5}, + {"label":"Alt", "x":2.5, "y":6, "w":1.5}, + {"label":"Space", "x":4, "y":6, "w":7}, + {"label":"Alt", "x":11, "y":6, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":6, "w":1.5}, + {"label":"Left", "x":15.25, "y":6}, + {"label":"Down", "x":16.25, "y":6}, + {"label":"Right", "x":17.25, "y":6}, + {"label":"0", "x":18.5, "y":6, "w":2}, + {"label":".", "x":20.5, "y":6}, + {"label":"Enter", "x":21.5, "y":5, "h":2} + ] + } + } +} diff --git a/keyboards/converter/ibm_terminal/keymaps/default/config.h b/keyboards/converter/ibm_terminal/keymaps/default/config.h index 7fa3bf328ec..271f48d0011 100644 --- a/keyboards/converter/ibm_terminal/keymaps/default/config.h +++ b/keyboards/converter/ibm_terminal/keymaps/default/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/converter/ibm_terminal/keymaps/default/keymap.c b/keyboards/converter/ibm_terminal/keymaps/default/keymap.c index 2beb51106ec..59187ef339e 100644 --- a/keyboards/converter/ibm_terminal/keymaps/default/keymap.c +++ b/keyboards/converter/ibm_terminal/keymaps/default/keymap.c @@ -15,18 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include -#include -#include "keycode.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "ibm_terminal.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Layer 0 - KEYMAP( + LAYOUT( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, @@ -56,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `----' `---------------------------------------' `----' `-----------' `---------------' */ /* - KEYMAP_101( + LAYOUT_101( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK, KC_BRK, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, diff --git a/keyboards/converter/ibm_terminal/keymaps/default/rules.mk b/keyboards/converter/ibm_terminal/keymaps/default/rules.mk index 76d349920fc..8ff09504720 100644 --- a/keyboards/converter/ibm_terminal/keymaps/default/rules.mk +++ b/keyboards/converter/ibm_terminal/keymaps/default/rules.mk @@ -12,9 +12,8 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode -UNICODEMAP_ENABLE = yes BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. PS2_USE_USART = yes API_SYSEX_ENABLE = no diff --git a/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h b/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h index 7fa3bf328ec..271f48d0011 100644 --- a/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h +++ b/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c b/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c index 47a5181ddef..3d6da6eab87 100644 --- a/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c +++ b/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c @@ -15,17 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "keycode.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "ibm_terminal.h" -#include "action_layer.h" - -// Fillers to make layering clearer - -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#include QMK_KEYBOARD_H enum layers { QWE, // qwerty @@ -159,7 +149,7 @@ const uint32_t PROGMEM unicode_map[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* qwerty */ - [QWE] = KEYMAP( + [QWE] = LAYOUT( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_PSCR, KC_SLCK, KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, @@ -171,7 +161,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* colemak */ - [COL] = KEYMAP( + [COL] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -183,7 +173,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* workman */ - [WOR] = KEYMAP( + [WOR] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -195,7 +185,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* dvorak */ - [DVO] = KEYMAP( + [DVO] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -207,7 +197,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* system */ - [SYS] = KEYMAP( + [SYS] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -219,7 +209,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* mouse keys */ - [MOU] = KEYMAP( + [MOU] = LAYOUT( XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, @@ -231,7 +221,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* emoji */ - [EMO] = KEYMAP( + [EMO] = LAYOUT( XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, @@ -243,7 +233,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* - [XXX] = KEYMAP( + [XXX] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/converter/ibm_terminal/readme.md b/keyboards/converter/ibm_terminal/readme.md new file mode 100644 index 00000000000..b781b046878 --- /dev/null +++ b/keyboards/converter/ibm_terminal/readme.md @@ -0,0 +1,39 @@ +# Keyboard converter for IBM terminal keyboard + +This is a port of TMK's converter/terminal_usb to QMK. + +It supports PS/2 Scan Code Set 3 and runs on USB AVR chips such like PJRC Teensy. +I tested the converter on ATMega32U4 with 1392595(102keys) and 6110345(122keys). + +Source code: https://github.com/qmk/qmk_firmware.git +Article: http://geekhack.org/index.php?topic=27272.0 + + +## Connection + +Keyboard | ATMega32U4 +:------- | :--------- +Data | PD2 +Clock | PD5 + +And VCC and GND, of course. See Resource section for keyboard connector pin assign. + + +## Build + +``` +git clone https://github.com/qmk/qmk_firmware.git +cd qmk_firmware +make converter/ibm_terminal:default +``` + +## Resource + +- Soarer's Converter: http://geekhack.org/index.php?topic=17458.0 +- 102keys(1392595): http://geekhack.org/index.php?topic=10737.0 +- 122keys(1390876): http://www.seasip.info/VintagePC/ibm_1390876.html +- KbdBabel: http://www.kbdbabel.org/ +- RJ45 Connector: http://www.kbdbabel.org/conn/kbd_connector_ibmterm.png +- DIN Connector: http://www.kbdbabel.org/conn/kbd_connector_ibm3179_318x_319x.png +- WinAVR: http://winavr.sourceforge.net/ + diff --git a/keyboards/converter/ibm_terminal/rules.mk b/keyboards/converter/ibm_terminal/rules.mk index 77b3a6f3f75..a48038ccde2 100644 --- a/keyboards/converter/ibm_terminal/rules.mk +++ b/keyboards/converter/ibm_terminal/rules.mk @@ -36,7 +36,6 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - # Boot Section Size in *bytes* # Teensy halfKay 512 # Teensy++ halfKay 1024 @@ -46,11 +45,11 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration @@ -59,14 +58,12 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode -UNICODEMAP_ENABLE = yes BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. PS2_USE_USART = yes -API_SYSEX_ENABLE = n -CUSTOM_MATRIX = yes - +API_SYSEX_ENABLE = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +CUSTOM_MATRIX = yes -SRC = matrix.c led.c \ No newline at end of file +SRC = matrix.c led.c diff --git a/keyboards/converter/m0110_usb/README.md b/keyboards/converter/m0110_usb/README.md index 3041eb0b4a5..2e8a2eaef1e 100644 --- a/keyboards/converter/m0110_usb/README.md +++ b/keyboards/converter/m0110_usb/README.md @@ -1,19 +1,19 @@ -M0110(A) keyboard converter -====================================== +# M0110(A) keyboard converter + This is a port of the original M0110 converter from TMK to QMK. The original converter was designed to work with **ATmega32U2** and **ATmega32U4** based microcontrollers to convert Apple M0110/M0110A keyboards and M0120 numpads to USB. This port has been tested to be compatible with the [**Adafruit Feather 32U4 BLE**](https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le). -### Enabling Bluetooth for the Adafruit Feather 32U4 BLE ----------------------------------------------------- +## Enabling Bluetooth for the Adafruit Feather 32U4 BLE + Simply add `BLUETOOTH = AdafruitBLE` to your `rules.mk` file. This enables code specifically for the Adafruit Feather 32U4 BLE. If enabled, the device will use the `PRODUCT` and `DESCRIPTION` values from `config.h` for the device name displayed by the Feather on host devices. You can simply change these values to change the device name. -### Pins ----- +## Pins + This port utilizes the same pins that the TMK converter used. `PD1` is used for `CLOCK` and `PD0` is used for the `DATA` from the keyboard. These pins can be changed in `config.h`. -### Other important hardware notes from the original TMK converter Readme: +## Other important hardware notes from the original TMK converter Readme: >### Hardware >-------- >You can buy preassembled [TMK converter] or make yourown with AVR dev board like PJRC [Teensy]. @@ -45,7 +45,7 @@ This port utilizes the same pins that the TMK converter used. `PD1` is used for [**View the original TMK converter Repository**](https://github.com/tmk/tmk_keyboard/tree/master/converter/m0110_usb) -### QMK Port Changelog ---------- +## QMK Port Changelog + - 2018/08/01 - Original Release diff --git a/keyboards/converter/m0110_usb/config.h b/keyboards/converter/m0110_usb/config.h index 79abb9a889f..02e4c30fb00 100644 --- a/keyboards/converter/m0110_usb/config.h +++ b/keyboards/converter/m0110_usb/config.h @@ -39,8 +39,8 @@ Ported to QMK by Techsock /* magic key */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LCTL)) \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LCTL)) \ ) /* boot magic key */ diff --git a/keyboards/converter/m0110_usb/info.json b/keyboards/converter/m0110_usb/info.json new file mode 100644 index 00000000000..6ef61033450 --- /dev/null +++ b/keyboards/converter/m0110_usb/info.json @@ -0,0 +1,172 @@ +{ + "keyboard_name": "M0110(A) keyboard converter", + "url": "", + "maintainer": "qmk", + "width": 19.25, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "key_count": 78, + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":1.5}, + {"label":"Num Lock", "x":15.25, "y":0}, + {"label":"=", "x":16.25, "y":0}, + {"label":"/", "x":17.25, "y":0}, + {"label":"*", "x":18.25, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"7", "x":15.25, "y":1}, + {"label":"8", "x":16.25, "y":1}, + {"label":"9", "x":17.25, "y":1}, + {"label":"-", "x":18.25, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":1.75}, + {"label":"4", "x":15.25, "y":2}, + {"label":"5", "x":16.25, "y":2}, + {"label":"6", "x":17.25, "y":2}, + {"label":"+", "x":18.25, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Up", "x":13.5, "y":3}, + {"label":"1", "x":15.25, "y":3}, + {"label":"2", "x":16.25, "y":3}, + {"label":"3", "x":17.25, "y":3}, + {"label":"Enter", "x":18.25, "y":3, "h":2}, + {"label":"Alt", "x":0, "y":4, "w":1.5}, + {"label":"GUI", "x":1.5, "y":4, "w":2}, + {"label":"Space", "x":3.5, "y":4, "w":6}, + {"label":"MO(1)", "x":9.5, "y":4}, + {"label":"\\", "x":10.5, "y":4}, + {"label":"Left", "x":11.5, "y":4}, + {"label":"Right", "x":12.5, "y":4}, + {"label":"Down", "x":13.5, "y":4}, + {"label":"0", "x":15.25, "y":4, "w":2}, + {"label":".", "x":17.25, "y":4} + ] + }, + "LAYOUT_iso": { + "key_count": 75, + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":1.5}, + {"label":"Num Lock", "x":15.25, "y":0}, + {"label":"=", "x":16.25, "y":0}, + {"label":"/", "x":17.25, "y":0}, + {"label":"*", "x":18.25, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"Return", "x":13.75, "y":1, "w":0.75, "h":2}, + {"label":"7", "x":15.25, "y":1}, + {"label":"8", "x":16.25, "y":1}, + {"label":"9", "x":17.25, "y":1}, + {"label":"-", "x":18.25, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"#", "x":12.75, "y":2}, + {"label":"4", "x":15.25, "y":2}, + {"label":"5", "x":16.25, "y":2}, + {"label":"6", "x":17.25, "y":2}, + {"label":"+", "x":18.25, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"\\", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"1", "x":15.25, "y":3}, + {"label":"2", "x":16.25, "y":3}, + {"label":"3", "x":17.25, "y":3}, + {"label":"Enter", "x":18.25, "y":3, "h":2}, + {"label":"Option", "x":1, "y":4}, + {"label":"GUI", "x":2, "y":4, "w":1.5}, + {"label":"Space", "x":3.5, "y":4, "w":7.5}, + {"label":"Enter", "x":11, "y":4, "w":1.5}, + {"label":"0", "x":15.25, "y":4, "w":2}, + {"label":".", "x":17.25, "y":4} + ] + } + } +} diff --git a/keyboards/converter/m0110_usb/rules.mk b/keyboards/converter/m0110_usb/rules.mk index 3b4ca83b750..bffee05fde2 100644 --- a/keyboards/converter/m0110_usb/rules.mk +++ b/keyboards/converter/m0110_usb/rules.mk @@ -1,7 +1,7 @@ # MCU name -# atmega32u4 Teensy2.0 -# atemga32u4 TMK Converter rev.1 -# atemga32u2 TMK Converter rev.2 +# atmega32u4 Teensy2.0 +# atemga32u4 TMK Converter rev.1 +# atemga32u2 TMK Converter rev.2 MCU = atmega32u4 # Processor frequency. @@ -43,31 +43,30 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina # Boot Section Size in *bytes* # Teensy halfKay 512 # Teensy++ halfKay 1024 -# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2 +# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2 # LUFA bootloader 4096 # USBaspLoader 2048 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = no # USB Nkey Rollover - not yet supported in LUFA -EXTRAKEY_ENABLE = yes -USB_HID_ENABLE = yes -BACKLIGHT_ENABLE = no -#BLUETOOTH = AdafruitBLE # For Adafruit Feather 32U4 BLE support, uncomment this line +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover - not yet supported in LUFA +EXTRAKEY_ENABLE = yes +USB_HID_ENABLE = yes +BACKLIGHT_ENABLE = no +#BLUETOOTH = AdafruitBLE # For Adafruit Feather 32U4 BLE support, uncomment this line +CUSTOM_MATRIX = yes -CUSTOM_MATRIX = yes -SRC = matrix.c \ - m0110.c +SRC = matrix.c m0110.c diff --git a/keyboards/converter/modelm101/config.h b/keyboards/converter/modelm101/config.h new file mode 100644 index 00000000000..958b29b7436 --- /dev/null +++ b/keyboards/converter/modelm101/config.h @@ -0,0 +1,123 @@ +/* +Copyright 2019 iw0rm3r + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER iw0rm3r +#define PRODUCT IBM Model M 101/102 +#define DESCRIPTION Controlled by AVR chip + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F7, F6, F5, F4, F3, F2, F1, F0 } +#define MATRIX_COL_PINS { C7, C6, C5, C4, C3, C2, C1, C0, E1, E0, D7, D6, D5, D4, D3, D2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed (5 is default) */ +#define DEBOUNCE 5 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/converter/modelm101/info.json b/keyboards/converter/modelm101/info.json new file mode 100644 index 00000000000..868cd89b1a6 --- /dev/null +++ b/keyboards/converter/modelm101/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "IBM Model M 101 ANSI/102 ISO", + "url": "https://github.com/iw0rm3r/qmk_firmware/tree/modelm101/keyboards/converter/modelm101", + "maintainer": "iw0rm3r", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.5}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"~", "x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, {"x":4, "y":5.5, "w":7}, {"label":"Alt", "x":11, "y":5.5, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/converter/modelm101/keymaps/default/config.h b/keyboards/converter/modelm101/keymaps/default/config.h new file mode 100644 index 00000000000..779e5a858f9 --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 iw0rm3r + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/converter/modelm101/keymaps/default/keymap.c b/keyboards/converter/modelm101/keymaps/default/keymap.c new file mode 100644 index 00000000000..644e9a5ef82 --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/default/keymap.c @@ -0,0 +1,43 @@ +/* Copyright 2019 iw0rm3r + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base layer */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/converter/modelm101/keymaps/default/readme.md b/keyboards/converter/modelm101/keymaps/default/readme.md new file mode 100644 index 00000000000..fb91a8ebe52 --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for modelm101 \ No newline at end of file diff --git a/keyboards/converter/modelm101/keymaps/iw0rm3r/config.h b/keyboards/converter/modelm101/keymaps/iw0rm3r/config.h new file mode 100644 index 00000000000..779e5a858f9 --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/iw0rm3r/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 iw0rm3r + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c b/keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c new file mode 100644 index 00000000000..26ced801e5a --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c @@ -0,0 +1,43 @@ +/* Copyright 2019 iw0rm3r + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base layer */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_CAPS, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_APP, KC_PDOT + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md b/keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md new file mode 100644 index 00000000000..17b0f40da27 --- /dev/null +++ b/keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md @@ -0,0 +1,5 @@ +# This is my personal keymap for modelm101 + +Caps Lock is mapped as LGUI (Windows key). +Num Enter is mapped as Caps Lock. +Num0 is mapped as App key (context menu). \ No newline at end of file diff --git a/keyboards/converter/modelm101/modelm101.c b/keyboards/converter/modelm101/modelm101.c new file mode 100644 index 00000000000..c2204bea660 --- /dev/null +++ b/keyboards/converter/modelm101/modelm101.c @@ -0,0 +1,67 @@ +/* Copyright 2019 iw0rm3r + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "modelm101.h" + +void keyboard_pre_init_kb(void) { + /* Setting status LEDs pins to output and +5V (off) */ + setPinOutput(B4); + setPinOutput(B5); + setPinOutput(B6); + writePinHigh(B4); + writePinHigh(B5); + writePinHigh(B6); +} + +void matrix_init_kb(void) { + /* put your keyboard start-up code here + * runs once when the firmware starts up */ + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + /* put your looping keyboard code here + * runs every cycle (a lot) */ + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + /* put your per-action keyboard code here + * runs for every action, just before processing by the firmware */ + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<. + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * The first section contains "names" for physical keys of the keyboard + * and defines their position on the board. + * The second section defines position of the keys on the switch matrix + * (where COLUMNS and ROWS crosses). */ + +#define LAYOUT( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, \ + \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, K4P, K4Q, K4R, K4S, K4T, K4U, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3O, K3P, K3Q, K3R, K3S, K3T, K3U, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2N, K2O, K2P, K2Q, \ + K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, K1O, K1P, K1Q, K1R, \ + K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, K0J \ +) \ +{ \ +/* 00 */ { KC_NO, KC_NO, K5A, K1B, K5E, K2F, K5F, K2G, K5G, KC_NO, K2L, KC_NO, K0I, K0J, K1N, K0B }, \ +/* 01 */ { KC_NO, K1A, K3A, K2A, K5D, K3F, K4N, K3G, K3M, K5H, K3L, K2O, K2P, K2Q, KC_NO, KC_NO }, \ +/* 02 */ { K0A, KC_NO, K4A, K5B, K5C, K4F, K5J, K4G, K4M, K5I, K4L, K3O, K4O, K4Q, K4P, KC_NO }, \ +/* 03 */ { KC_NO, KC_NO, K4B, K4C, K4D, K4E, K5K, K4H, K4I, K4J, K4K, K5L, K5M, K3Q, K3P, K5N }, \ +/* 04 */ { KC_NO, KC_NO, K3B, K3C, K3D, K3E, KC_NO, K3H, K3I, K3J, K3K, K3R, K3S, K3T, K3U, K5O }, \ +/* 05 */ { KC_NO, KC_NO, K2B, K2C, K2D, K2E, K3N, K2H, K2I, K2J, K2K, K1O, K1P, K1Q, K1R, KC_NO }, \ +/* 06 */ { K0E, K1M, K1C, K1D, K1E, K1F, K2N, K1I, K1J, K1K, K2M, K4R, K4S, K4T, K5P, KC_NO }, \ +/* 07 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K1G, K0C, K1H, KC_NO, KC_NO, K1L, K0G, K0H, K4U, K0F, K0D }, \ +} +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ \ No newline at end of file diff --git a/keyboards/converter/modelm101/readme.md b/keyboards/converter/modelm101/readme.md new file mode 100644 index 00000000000..5355c800714 --- /dev/null +++ b/keyboards/converter/modelm101/readme.md @@ -0,0 +1,42 @@ +# modelm101 + +![IBM Model M 101 ANSI/102 ISO](https://i.imgur.com/DAE3W7g.jpg) + +This is a configuration for the QMK firmware for reversible conversion of IBM's Model M keyboards (common 101-key ANSI and 102-key ISO models) from stock, power-hungry controller, to a modern one, running the USB bus. +Configuration is build for the Atmel AT90USB1286 controller, which you can easily use on the Teensy 2.0++ board (produced by PJRC). +Project is heavely based on 2 other projects: +1. Teensy 2.0++-based custom Model M controller running TMK firmware ('modelm" by [lmorchard](https://blog.lmorchard.com/2016/02/21/modelm-controller/)); - had a few issues. +2. Teensy 2.0++-based custom Model M 122-key controller running QMK firmware ("ibm122m" by [lukexorz](https://github.com/lukexorz)); - had wrong layout for 101/102-key boards and no status LED support. + +For this conversion you will need: +1. Teensy 2.0++ dev board itself (can be used a different dev board, but it will require some changes in configuration); +2. Ribbon connectors to connect the membrane to a dev board. Depending on your Model M variation, you will need 1 Trio-mate 16pin connector (6-520315-6 or 6-520415-6) and 1 Trio-mate 8pin connector (5-120628-8 or 5-520314-8), or 2 Trio-mate 16pin connectors; +3. Full-sized breadboard (without power rails; half-size should do, but full-sized one looks more native) or a PCB to wire everything up; +4. A bunch of jumper wires; +5. mini-USB male cable with any USB socket you want to use to connect Teensy inside the keyboard to your PC (I use short mini-USB male to mini-USB female cable); +6. (optional) Resistors for connecting status LEDs if your LED PCB doesn't have any; +7. (optional) Double-sided tape to fix USB socket on or inside the keyboard case. + +Pins of the Teensy board you should use by default: +``` +Columns: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +Pins: C7 C6 C5 C4 C3 C2 C1 C0 E1 E0 D7 D6 D5 D4 D3 D2 +-------------------------------------------------------- +Rows: 1 2 3 4 5 6 7 8 +Pins: F7 F6 F5 F4 F3 F2 F1 F0 +-------------------------------------------------------- +Status LEDs: CapsLock +5V ScrollLock NumLock +Pins: B6 5V B5 B4 +``` + +Please note that some versions of Model M have LED connected with a ribbon cable, and not with separate wires. + +Keyboard Maintainer: [iw0rm3r](https://github.com/iw0rm3r) +Hardware Supported: Teensy 2.0++ board by PJRC +Hardware Availability: https://www.pjrc.com/store/teensypp.html + +Make example for this keyboard (after setting up your build environment): + + make converter/modelm101:default:teensy + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/converter/modelm101/rules.mk b/keyboards/converter/modelm101/rules.mk new file mode 100644 index 00000000000..4c05d9b8528 --- /dev/null +++ b/keyboards/converter/modelm101/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = at90usb1286 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +#OPT_DEFS += -DBOOTLOADER_SIZE=1024 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/converter/numeric_keypad_IIe/config.h b/keyboards/converter/numeric_keypad_IIe/config.h new file mode 100644 index 00000000000..a129e1210f6 --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/config.h @@ -0,0 +1,101 @@ +/* +Copyright 2019 Adam Newbold + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Apple Inc. +#define PRODUCT Numeric Keypad IIe +#define DESCRIPTION "Numeric Keypad IIe, A2M2003" + +/* + +Pin Mappings +============ + +Dsub-15 Connection +------------------ + + Dsub-15 (female) + ,-------------------------. + \ 08 07 06 05 04 03 02 01 / + \ 15 14 13 12 11 10 09 / + `---------------------' + +Header Pins +----------- + _____________________________________ +| | +| 11 10 9 8 7 6 5 4 3 2 1 | +|_____________________________________| + + +Header / Matrix +--------------- + +Pin Name Description +-------------------------------------------------------------- +1,2,5,3,4,6 Y0-Y5 Y-direction key-matrix connections +7 NC +9,11,10,8 X4-X7 X-direction key-matrix connections + + +Microcontroller Configuration +----------------------------- + +(Pins are for an Arduino Micro) + ++-----------------------------------+ +| Dsub-15 | Header | Matrix | Micro | +|---------+--------+--------+-------| +| 12 | 11 | X5 | B0 | +| 11 | 10 | X6 | D3 | +| 10 | 9 | X4 | B2 | +| 9 | 8 | X7 | D2 | +| NC | 7 | NC | -- | +| 7 | 6 | Y5 | E6 | +| 6 | 5 | Y2 | D4 | +| 5 | 4 | Y4 | D7 | +| 3 | 3 | Y3 | C6 | +| 2 | 2 | Y1 | D0 | +| 1 | 1 | Y0 | D1 | ++-----------------------------------+ + +Note: Dsub-15 pins 4, 8, 13, 14, and 15 are unused + +Reference +--------- + +https://deskthority.net/wiki/Apple_Numeric_Keypad_IIe +https://geekhack.org/index.php?topic=78048.0 +http://wiki.apple2.org/index.php?title=Pinouts#Apple_.2F.2Fe_Numeric_Keypad_connector + +*/ + +#define MATRIX_ROWS 4 +#define MATRIX_COLS 6 +#define MATRIX_ROW_PINS { B0, B2, D2, D3 } +#define MATRIX_COL_PINS { D1, D0, D4, C6, D7, E6 } +#define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW +#define SOFT_SERIAL_PIN D0 +#define DEBOUNCE 5 diff --git a/keyboards/converter/numeric_keypad_IIe/info.json b/keyboards/converter/numeric_keypad_IIe/info.json new file mode 100644 index 00000000000..f1990698ae1 --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Numeric Keypad IIe", + "url": "", + "maintainer": "qmk", + "width": 7.5, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"7", "x":2, "y":0}, {"label":"8", "x":3, "y":0}, {"label":"9", "x":4, "y":0}, {"label":"(", "x":5.5, "y":0}, {"label":")", "x":6.5, "y":0}, {"label":"\u2190", "x":0, "y":1}, {"label":"4", "x":2, "y":1}, {"label":"5", "x":3, "y":1}, {"label":"6", "x":4, "y":1}, {"label":"\u2212", "x":5.5, "y":1}, {"label":"\u00f7", "x":6.5, "y":1}, {"label":"\u2192", "x":0, "y":2}, {"label":"1", "x":2, "y":2}, {"label":"2", "x":3, "y":2}, {"label":"3", "x":4, "y":2}, {"label":"+", "x":5.5, "y":2}, {"label":"\u00d7", "x":6.5, "y":2}, {"label":"Space", "x":0, "y":3}, {"label":"0", "x":1.5, "y":3, "w":1.5}, {"label":",", "x":3, "y":3}, {"label":".", "x":4, "y":3}, {"label":"Ret", "x":5.5, "y":3}, {"label":"Print", "x":6.5, "y":3}] + } + } +} diff --git a/keyboards/converter/numeric_keypad_IIe/keymaps/default/config.h b/keyboards/converter/numeric_keypad_IIe/keymaps/default/config.h new file mode 100644 index 00000000000..667668959a3 --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Adam Newbold + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/converter/numeric_keypad_IIe/keymaps/default/keymap.c b/keyboards/converter/numeric_keypad_IIe/keymaps/default/keymap.c new file mode 100644 index 00000000000..a8f45535569 --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/keymaps/default/keymap.c @@ -0,0 +1,62 @@ +/* Copyright 2019 Adam Newbold + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + +-------+ +-------+-------+-------+ +-------+-------+ + | Esc | | 7 | 8 | 9 | | ( | ) | + +-------+ +-------+-------+-------+ +-------+-------+ + | <-- | | 4 | 5 | 6 | | - | / | + +-------+ +-------+-------+-------+ +-------+-------+ + | --> | | 1 | 2 | 3 | | + | * | + +-------+ +--+-------+-------+-------+ +-------+-------+ + | Space | | 0 | , | . | | Ret | Print | + +-------+ +----------+-------+-------+ +-------+-------+ +*/ + [0] = LAYOUT( + KC_ESCAPE, KC_KP_7, KC_KP_8, KC_KP_9, KC_LEFT_PAREN, KC_RIGHT_PAREN, \ + KC_LEFT, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_KP_SLASH, \ + KC_RIGHT, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, KC_KP_ASTERISK, \ + KC_SPACE, KC_KP_0, KC_KP_COMMA, KC_KP_DOT, KC_RETURN, KC_QUESTION \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void keyboard_post_init_user(void) { + +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/converter/numeric_keypad_IIe/keymaps/default/readme.md b/keyboards/converter/numeric_keypad_IIe/keymaps/default/readme.md new file mode 100644 index 00000000000..c58b09d156c --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# Numeric Keypad //e Default Keymap + +All keys perform their default functions displayed on the stock keycaps. Note that the "Print" key presses a question mark (?), which was the default behavior on the Apple //e (with ? the shorthand for the AppleSoft BASIC PRINT command). diff --git a/keyboards/converter/numeric_keypad_IIe/keymaps/newbold/config.h b/keyboards/converter/numeric_keypad_IIe/keymaps/newbold/config.h new file mode 100644 index 00000000000..667668959a3 --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/keymaps/newbold/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Adam Newbold + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/converter/numeric_keypad_IIe/keymaps/newbold/keymap.c b/keyboards/converter/numeric_keypad_IIe/keymaps/newbold/keymap.c new file mode 100644 index 00000000000..e0f04557c64 --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/keymaps/newbold/keymap.c @@ -0,0 +1,68 @@ +/* Copyright 2019 Adam Newbold + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + +-------+ +-------+-------+-------+ +-------+-------+ + | Esc | | 7 | 8 | 9 | | ( | ) | + +-------+ +-------+-------+-------+ +-------+-------+ + | <-- | | 4 | 5 | 6 | | - | / | + +-------+ +-------+-------+-------+ +-------+-------+ + | --> | | 1 | 2 | 3 | | + | * | + +-------+ +--+-------+-------+-------+ +-------+-------+ + | Space | | 0 | , | . | | Ret | Print | + +-------+ +----------+-------+-------+ +-------+-------+ +*/ + [0] = LAYOUT( + KC__MUTE, KC_KP_7, KC_KP_8, KC_KP_9, KC_LEFT_PAREN, KC_RIGHT_PAREN, \ + KC__VOLDOWN, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_KP_SLASH, \ + KC__VOLUP, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, KC_KP_ASTERISK, \ + MO(1), KC_KP_0, KC_KP_COMMA, KC_KP_DOT, KC_RETURN, KC_QUESTION \ + ), + [1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_BRMD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_BRMU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void keyboard_post_init_user(void) { + +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/converter/numeric_keypad_IIe/keymaps/newbold/readme.md b/keyboards/converter/numeric_keypad_IIe/keymaps/newbold/readme.md new file mode 100644 index 00000000000..0bccfdb6cf8 --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/keymaps/newbold/readme.md @@ -0,0 +1,28 @@ +# @newbold's layout for the Numeric Keypad IIe + +Includes the standard layout for all keys except for the left-most column, which is remapped to these keys: + + +-----------------+ + | Mute | + +-----------------+ + | Volume Down | + +-----------------+ + | Volume Up | + +-----------------+ + | Function | + +-----------------+ + + With Function held down: + + +-----------------+ + | Mute | + +-----------------+ + | Brightness Down | + +-----------------+ + | Brightness Up | + +-----------------+ + | Function | + +-----------------+ + + And also with Function held down, "Print" (the lower right key) will trigger RESET (putting the controller into bootloader mode so it can be flashed). + \ No newline at end of file diff --git a/keyboards/converter/numeric_keypad_IIe/numeric_keypad_IIe.c b/keyboards/converter/numeric_keypad_IIe/numeric_keypad_IIe.c new file mode 100644 index 00000000000..c29d85d488e --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/numeric_keypad_IIe.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Adam Newbold + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "numeric_keypad_IIe.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/converter/numeric_keypad_IIe/numeric_keypad_IIe.h b/keyboards/converter/numeric_keypad_IIe/numeric_keypad_IIe.h new file mode 100644 index 00000000000..8892b5553b7 --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/numeric_keypad_IIe.h @@ -0,0 +1,30 @@ +/* Copyright Adam Newbold + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "quantum.h" + +#define LAYOUT( \ + K_ESC, K_7, K_8, K_9, K_LEFT_PARENS, K_RIGHT_PARENS, \ + K_LEFT, K_4, K_5, K_6, K_MINUS, K_DIVIDE, \ + K_RIGHT, K_1, K_2, K_3, K_PLUS, K_MULTIPLY, \ + K_SPACE, K_0, K_COMMA, K_DOT, K_RETURN, K_PRINT \ +){ \ + { K_RIGHT_PARENS, K_ESC, K_4, K_5, K_6, K_7 },\ + { K_DIVIDE, K_LEFT, K_0, K_1, K_2, K_3 },\ + { K_PRINT, K_SPACE, K_LEFT_PARENS, K_MINUS, K_RETURN, K_COMMA },\ + { K_MULTIPLY, K_RIGHT, K_8, K_9, K_DOT, K_PLUS },\ +} diff --git a/keyboards/converter/numeric_keypad_IIe/readme.md b/keyboards/converter/numeric_keypad_IIe/readme.md new file mode 100644 index 00000000000..9eba41610a8 --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/readme.md @@ -0,0 +1,16 @@ +# Numeric Keypad IIe + +![Numeric Keypad IIe](https://upload.wikimedia.org/wikipedia/commons/3/3b/Apple_Numeric_Keypad_IIe.jpg) + +This is a conversion project for the Numeric Keypad IIe, model A2M2003. This was an external keypad that connected to the Apple //e's motherboard (and as such, it lacked any kind of onboard controller). + +The reference conversion setup uses the keyboard's DB15 (VGA) fixed cable connected to a DB15 wiring terminal with breakout board ([this one](https://www.amazon.com/gp/product/B07437293Y/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1), specifically) and wired to an [Arduino Micro](https://store.arduino.cc/usa/arduino-micro). + +Keyboard Maintainer: [Adam Newbold](https://github.com/newbold) +Hardware Supported: Internal Numeric Keypad IIe PCB (Apple part 820.0081.c), ATmega32U4 microcontroller + +Make example for this keyboard (after setting up your build environment): + + make converter/numeric_keypad_IIe:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/converter/numeric_keypad_IIe/rules.mk b/keyboards/converter/numeric_keypad_IIe/rules.mk new file mode 100644 index 00000000000..f61a7d4501b --- /dev/null +++ b/keyboards/converter/numeric_keypad_IIe/rules.mk @@ -0,0 +1,76 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/converter/palm_usb/config.h b/keyboards/converter/palm_usb/config.h new file mode 100644 index 00000000000..4233a53ef03 --- /dev/null +++ b/keyboards/converter/palm_usb/config.h @@ -0,0 +1,120 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* This code makes use of cy384's Arduino USB HID adapter for the Palm Portable + Keyboard, released under the BSD licence */ + + + + +#pragma once + +#define CUSTOM_MATRIX 2 + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0001 +#define DEVICE_VER 0x0100 +#define MANUFACTURER QMK +#define PRODUCT Stowaway converter +#define DESCRIPTION USB converter for Stowaway keyboard + +// IO pins to serial +// https://deskthority.net/wiki/Arduino_Pro_Micro for pin lookup +#define VCC_PIN D1 // pro micro 2 +#define RX_PIN D0 //pro micro 3 , was 8 on cy384 +#define RTS_PIN C6 // 5 //[ was D4 // 4 on the cy384 +#define DCD_PIN E6 //7 + +// if using the particular arduino pinout of CY384 +#ifdef CY384 + #define GND_PIN D7 //6 + #define PULLDOWN_PIN B1 // 15 +#endif + +#ifndef HANDSPRING +// Set to 1 for Handspring or to disable RTS/DCD based handshake. + #define HANDSPRING 0 +#endif + +#define MAXDROP 10 // check if keyboard is connected every X polling cycles +#define SLEEP_TIMEOUT 500000 // check keyboard/reset this many millis + + +#define MATRIX_ROWS 12 +#define MATRIX_COLS 8 + +/* key combination for command */ +#define IS_COMMAND() ( \ + get_mods() == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \ + get_mods() == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + +/* Serial(USART) configuration + * asynchronous, negative logic, 9600baud, no flow control + * 1-start bit, 8-data bit, non parity, 1-stop bit + */ +#define SERIAL_SOFT_BAUD 9600 +#define SERIAL_SOFT_PARITY_NONE +#define SERIAL_SOFT_BIT_ORDER_LSB +#if (HANDSPRING == 0) + #define SERIAL_SOFT_LOGIC_NEGATIVE //RS232 logic +#endif +/* RXD Port */ +#define SERIAL_SOFT_RXD_ENABLE + +// we are using Pro micro pin 3 / D0 as serial +#define SERIAL_SOFT_RXD_DDR DDRD +#define SERIAL_SOFT_RXD_PORT PORTD +#define SERIAL_SOFT_RXD_PIN PIND +#define SERIAL_SOFT_RXD_BIT 0 +#define SERIAL_SOFT_RXD_VECT INT0_vect + +/* RXD Interupt */ +#define SERIAL_SOFT_RXD_INIT() do { \ + /* pin configuration: input with pull-up */ \ + SERIAL_SOFT_RXD_DDR &= ~(1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H +#include "protocol/serial.h" +#include "timer.h" +#include "pincontrol.h" + + +/* + * Matrix Array usage: + * + * ROW: 12(4bits) + * COL: 8(3bits) + * + * +---------+ + * 0|00 ... 07| + * 1|00 ... 07| + * :| ... | + * :| ... | + * A| | + * B| | + * +---------+ + */ +static uint8_t matrix[MATRIX_ROWS]; + + +// we're going to need a sleep timer +static uint16_t last_activity ; +// and a byte to track duplicate up events signalling all keys up. +static uint16_t last_upKey ; +// serial device can disconnect. Check every MAXDROP characters. +static uint16_t disconnect_counter = 0; + + +// bitmath masks. +#define KEY_MASK 0b10000000 +#define COL_MASK 0b00000111 +#define ROW_MASK 0b01111000 + + +#define ROW(code) (( code & ROW_MASK ) >>3) +#define COL(code) ((code & COL_MASK) ) +#define KEYUP(code) ((code & KEY_MASK) >>7 ) + +static bool is_modified = false; + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + + +void pins_init(void) { + // set pins for pullups, Rts , power &etc. + + //print ("pins setup\n"); + pinMode(VCC_PIN, PinDirectionOutput); + digitalWrite(VCC_PIN, PinLevelLow); + +#if ( HANDSPRING == 0) + +#ifdef CY835 + pinMode(GND_PIN, PinDirectionOutput); + digitalWrite(GND_PIN, PinLevelLow); + + pinMode(PULLDOWN_PIN, PinDirectionOutput); + digitalWrite(PULLDOWN_PIN, PinLevelLow); +#endif + + pinMode(DCD_PIN, PinDirectionInput); + pinMode(RTS_PIN, PinDirectionInput); +#endif + +/* check that the other side isn't powered up. + test=digitalRead(DCD_PIN); + xprintf("b%02X:", test); + test=digitalRead(RTS_PIN); + xprintf("%02X\n", test); +*/ + +} + +uint8_t rts_reset(void) { + static uint8_t firstread ; +/* bounce RTS so device knows it is rebooted */ + +// On boot, we keep rts as input, then switch roles here +// on leaving sleep, we toggle the same way + + firstread=digitalRead(RTS_PIN); + // printf("r%02X:", firstread); + + pinMode(RTS_PIN, PinDirectionOutput); + + if (firstread == PinLevelHigh) { + digitalWrite(RTS_PIN, PinLevelLow); + } + _delay_ms(10); + digitalWrite(RTS_PIN, PinLevelHigh); + + +/* the future is Arm + if (palReadPad(RTS_PIN_IOPRT) == PinLevelLow) + { + _delay_ms(10); + palSetPadMode(RTS_PINn_IOPORT, PinDirectionOutput_PUSHPULL); + palSetPad(RTS_PORT, RTS_PIN); + } + else + { + palSetPadMode(RTS_PIN_RTS_PORT, PinDirectionOutput_PUSHPULL); + palSetPad(RTS_PORT, RTS_PIN); + palClearPad(RTS_PORT, RTS_PIN); + _delay_ms(10); + palSetPad(RTS_PORT, RTS_PIN); + } +*/ + + + _delay_ms(5); + //print("rts\n"); + return 1; +} + +uint8_t get_serial_byte(void) { + static uint8_t code; + while(1) { + code = serial_recv(); + if (code) { + debug_hex(code); debug(" "); + return code; + } + } +} + +uint8_t palm_handshake(void) { + // assumes something has seen DCD go high, we've toggled RTS + // and we now need to verify handshake. + // listen for up to 4 packets before giving up. + // usually I get the sequence FF FA FD + static uint8_t codeA=0; + + for (uint8_t i=0; i < 5; i++) { + codeA=get_serial_byte(); + if ( 0xFA == codeA) { + if( 0xFD == get_serial_byte()) { + return 1; + } + } + } + return 0; +} + +uint8_t palm_reset(void) { + print("@"); + rts_reset(); // shouldn't need to power cycle. + + if ( palm_handshake() ) { + last_activity = timer_read(); + return 1; + } else { + print("failed reset"); + return 0; + } + +} + +uint8_t handspring_handshake(void) { + // should be sent 15 ms after power up. + // listen for up to 4 packets before giving up. + static uint8_t codeA=0; + + for (uint8_t i=0; i < 5; i++) { + codeA=get_serial_byte(); + if ( 0xF9 == codeA) { + if( 0xFB == get_serial_byte()) { + return 1; + } + } + } + return 0; +} + +uint8_t handspring_reset(void) { + digitalWrite(VCC_PIN, PinLevelLow); + _delay_ms(5); + digitalWrite(VCC_PIN, PinLevelHigh); + + if ( handspring_handshake() ) { + last_activity = timer_read(); + disconnect_counter=0; + return 1; + } else { + print("-HSreset"); + return 0; + } +} + +void matrix_init(void) +{ + debug_enable = true; + //debug_matrix =true; + + serial_init(); // arguments all #defined + +#if (HANDSPRING == 0) + pins_init(); // set all inputs and outputs. +#endif + + print("power up\n"); + digitalWrite(VCC_PIN, PinLevelHigh); + + // wait for DCD strobe from keyboard - it will do this + // up to 3 times, then the board needs the RTS toggled to try again + +#if ( HANDSPRING == 1) + if ( handspring_handshake() ) { + last_activity = timer_read(); + } else { + print("failed handshake"); + _delay_ms(1000); + //BUG /should/ power cycle or toggle RTS & reset, but this usually works. + } + +#else /// Palm / HP device with DCD + while( digitalRead(DCD_PIN) != PinLevelHigh ) {;} + print("dcd\n"); + + rts_reset(); // at this point the keyboard should think all is well. + + if ( palm_handshake() ) { + last_activity = timer_read(); + } else { + print("failed handshake"); + _delay_ms(1000); + //BUG /should/ power cycle or toggle RTS & reset, but this usually works. + } + +#endif + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; + + matrix_init_quantum(); + return; + + +} + + +uint8_t matrix_scan(void) +{ + uint8_t code; + code = serial_recv(); + if (!code) { +/* + disconnect_counter ++; + if (disconnect_counter > MAXDROP) { + // set all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; + } +*/ + // check if the keyboard is asleep. + if (timer_elapsed(last_activity) > SLEEP_TIMEOUT) { +#if(HANDSPRING ==0 ) + palm_reset(); +#else + handspring_reset(); +#endif + return 0; + } + + } + + last_activity = timer_read(); + disconnect_counter=0; // if we are getting serial data, we're connected. + + debug_hex(code); debug(" "); + + + switch (code) { + case 0xFD: // unexpected reset byte 2 + print("rstD "); + return 0; + case 0xFA: // unexpected reset + print("rstA "); + return 0; + } + + if (KEYUP(code)) { + if (code == last_upKey) { + // all keys are not pressed. + // Manual says to disable all modifiers left open now. + // but that could defeat sticky keys. + // BUG? dropping this byte. + last_upKey=0; + return 0; + } + // release + if (matrix_is_on(ROW(code), COL(code))) { + matrix[ROW(code)] &= ~(1<. +*/ + +#include QMK_KEYBOARD_H + +enum layers { +_QWERTY=0, +_CDH, +_FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BACK, APP0, + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, APP1, + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, APP2, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, APP3, + LCTL, FN, LALT, CMD, SPACE,SPACE,GRAVE,DONE, DEL, LEFT, DOWN, RIGHT + +*/ + [_QWERTY] = LAYOUT( /* Base */ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_ESC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, TG(_CDH), + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, MO(_FN), KC_LALT, KC_LGUI, KC_SPACE,KC_SPACE,KC_GRAVE,KC_RGUI, KC_DEL, KC_LEFT,KC_DOWN, KC_RIGHT + ), + + [_CDH] = LAYOUT( /* Base */ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_ESC, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, _______, + KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, MO(_FN), KC_LALT, KC_LGUI, KC_SPACE,KC_SPACE,KC_GRAVE,KC_RGUI, KC_DEL, KC_LEFT,KC_DOWN, KC_RIGHT + ), + + [_FN] = LAYOUT( // FN Key + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_ENT, _______, _______, _______, _______, _______, _______, _______ + ), + +}; diff --git a/keyboards/converter/palm_usb/stowaway/rules.mk b/keyboards/converter/palm_usb/stowaway/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/converter/palm_usb/stowaway/stowaway.h b/keyboards/converter/palm_usb/stowaway/stowaway.h new file mode 100644 index 00000000000..71af9bf4a81 --- /dev/null +++ b/keyboards/converter/palm_usb/stowaway/stowaway.h @@ -0,0 +1,53 @@ +/* +Copyright 2018 milestogo + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + + +/* Stowaway Keyboard + based on matrix from http://www.splorp.com/pdf/stowawayhwref.pdf + + 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BACK APP0, + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, APP1, + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, APP2, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, APP3, + LCTL, FN, LALT, CMD, SPACE,SPACE,GRAVE,DONE, DEL, LEFT, DOWN, RIGHT + +*/ +#define LAYOUT( \ + K000, K001, K002, K004, K005, K006, K007, K064, K065, K066, K060, K061, K062, K063,\ + K031, K011, K012, K013, K014, K015, K016, K074, K075, K076, K077, K070, K071, K072, K073,\ + K030, K021, K022, K023, K024, K025, K026, K084, K085, K086, K087, K080, K081, K082,\ + K110, K003, K020, K054, K055, K056, K057, K094, K095, K096, K090, K111, K091, K092,\ + K032, K042, K043, K010, K027, K067, K017, K097, K100, K101, K102, K103 \ +) { \ + { K000, K001, K002 , K003, K004, K005, K006, K007 }, \ + { K010, K011, K012 , K013, K014, K015, K016, K017 }, \ + { K020, K021, K022 , K023, K024, K025, K026, K027 }, \ + { K030, K031, K032 , KC_NO,KC_NO, KC_NO,KC_NO, KC_NO }, \ + { KC_NO, KC_NO, K042 , K043, KC_NO, KC_NO,KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO,K054, K055, K056, K057 }, \ + { K060, K061, K062 , K063, K064, K065, K066, K067 }, \ + { K070, K071, K072 , K073, K074, K075, K076, K077 }, \ + { K080, K081, K082 , KC_NO,K084, K085, K086, K087 }, \ + { K090, K091, K092 , KC_NO,K094, K095, K096, K097 }, \ + { K100, K101, K102 , K103, KC_NO, KC_NO,KC_NO, KC_NO }, \ + { K110, K111, KC_NO, KC_NO,KC_NO, KC_NO,KC_NO, KC_NO } \ +} + diff --git a/keyboards/converter/siemens_tastatur/boards/GENERIC_STM32_F103/board.c b/keyboards/converter/siemens_tastatur/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 00000000000..8c5a87f35f8 --- /dev/null +++ b/keyboards/converter/siemens_tastatur/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/converter/siemens_tastatur/boards/GENERIC_STM32_F103/board.h b/keyboards/converter/siemens_tastatur/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 00000000000..9427adabf11 --- /dev/null +++ b/keyboards/converter/siemens_tastatur/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/converter/siemens_tastatur/boards/GENERIC_STM32_F103/board.mk b/keyboards/converter/siemens_tastatur/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 00000000000..6b8b312fd9f --- /dev/null +++ b/keyboards/converter/siemens_tastatur/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/converter/siemens_tastatur/bootloader_defs.h b/keyboards/converter/siemens_tastatur/bootloader_defs.h new file mode 100644 index 00000000000..6b8fa9f727c --- /dev/null +++ b/keyboards/converter/siemens_tastatur/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +#define STM32_BOOTLOADER_ADDRESS 0x80000000 diff --git a/keyboards/converter/siemens_tastatur/chconf.h b/keyboards/converter/siemens_tastatur/chconf.h new file mode 100644 index 00000000000..bbd9b2da62d --- /dev/null +++ b/keyboards/converter/siemens_tastatur/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/converter/siemens_tastatur/config.h b/keyboards/converter/siemens_tastatur/config.h new file mode 100644 index 00000000000..bbb74715210 --- /dev/null +++ b/keyboards/converter/siemens_tastatur/config.h @@ -0,0 +1,67 @@ +/* +Copyright 2019 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x8968 +#define PRODUCT_ID 0x4353 +#define DEVICE_VER 0x0001 + +#define MANUFACTURER Yiancar-Designs +#define PRODUCT Siemens Tastatur +#define DESCRIPTION Practice + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 19 + +//This is all fake and not used +#define MATRIX_COL_PINS { B11, B10, B1, B0, A7, A6, A5, A4, A3, A2, A1, A0, C15, C14 } +#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } +#define DIODE_DIRECTION COL2ROW + + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/converter/siemens_tastatur/halconf.h b/keyboards/converter/siemens_tastatur/halconf.h new file mode 100644 index 00000000000..4ffc50fb118 --- /dev/null +++ b/keyboards/converter/siemens_tastatur/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT TRUE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/converter/siemens_tastatur/keymaps/default/config.h b/keyboards/converter/siemens_tastatur/keymaps/default/config.h new file mode 100644 index 00000000000..76d8106decf --- /dev/null +++ b/keyboards/converter/siemens_tastatur/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* +Copyright 2019 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +// place overrides here diff --git a/keyboards/converter/siemens_tastatur/keymaps/default/keymap.c b/keyboards/converter/siemens_tastatur/keymaps/default/keymap.c new file mode 100644 index 00000000000..70edf94d73f --- /dev/null +++ b/keyboards/converter/siemens_tastatur/keymaps/default/keymap.c @@ -0,0 +1,64 @@ +/* +Copyright 2019 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + DCAPS = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SCLN, KC_CIRC, KC_BSPC, KC_ENT, KC_0, KC_1, KC_2, KC_3, KC_4, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_RBRC, KC_PLUS, KC_5, KC_6, KC_7, KC_8, KC_9, + DCAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_BSLS, KC_RBRC, KC_DLR, KC_EQL, KC_0, KC_1, KC_2, KC_3, KC_4, + KC_LSFT, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_MINS, KC_5, KC_6, KC_7, KC_8, KC_9, + KC_SPC + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DCAPS: + if (record->event.pressed) { + // When keycode DCAPS is pressed. + // This is needed for mac. + tap_code(KC_CAPS); + } else { + // When keycode DCAPS is released. + } + break; + } + return true; +} + +void matrix_init_user(void) { + setPinOutput(B0); + writePinLow(B0); +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(B0); + } else { + writePinLow(B0); + } +} diff --git a/keyboards/converter/siemens_tastatur/keymaps/default/readme.md b/keyboards/converter/siemens_tastatur/keymaps/default/readme.md new file mode 100644 index 00000000000..8b72f0770ea --- /dev/null +++ b/keyboards/converter/siemens_tastatur/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for siemens_tastatur diff --git a/keyboards/converter/siemens_tastatur/ld/MKL26Z64.ld b/keyboards/converter/siemens_tastatur/ld/MKL26Z64.ld new file mode 100644 index 00000000000..c4ca8b874cc --- /dev/null +++ b/keyboards/converter/siemens_tastatur/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/converter/siemens_tastatur/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/converter/siemens_tastatur/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 00000000000..d0688ef6016 --- /dev/null +++ b/keyboards/converter/siemens_tastatur/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/converter/siemens_tastatur/matrix.c b/keyboards/converter/siemens_tastatur/matrix.c new file mode 100644 index 00000000000..b7654e6e12f --- /dev/null +++ b/keyboards/converter/siemens_tastatur/matrix.c @@ -0,0 +1,252 @@ +/* +Copyright 2019 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include +#include "quantum.h" +#include "timer.h" +#include "wait.h" +#include "print.h" +#include "matrix.h" +#include "ch.h" +#include "hal.h" + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +volatile uint16_t porta_buffer = 0; +volatile uint16_t portb_buffer = 0; + +static uint32_t switch_buffer = 0; + +// Trigger on negative edge of any of the sense lines. +static void extcb1(EXTDriver *extp, expchannel_t channel) { + + (void)extp; + (void)channel; + chSysLockFromISR(); + porta_buffer = palReadPort(GPIOA); + portb_buffer = palReadPort(GPIOB); + //Disable further interrupts that might occur on same button press. + extChannelDisable(&EXTD1,0); + extChannelDisable(&EXTD1,1); + extChannelDisable(&EXTD1,2); + extChannelDisable(&EXTD1,9); + extChannelDisable(&EXTD1,10); + extChannelDisable(&EXTD1,12); + extChannelDisable(&EXTD1,13); + extChannelDisable(&EXTD1,14); + extChannelDisable(&EXTD1,15); + + extChannelEnable(&EXTD1,0); + extChannelEnable(&EXTD1,1); + extChannelEnable(&EXTD1,2); + extChannelEnable(&EXTD1,9); + extChannelEnable(&EXTD1,10); + extChannelEnable(&EXTD1,12); + extChannelEnable(&EXTD1,13); + extChannelEnable(&EXTD1,14); + extChannelEnable(&EXTD1,15); + chSysUnlockFromISR(); +} + +static const EXTConfig extcfg = { + { + {EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA, extcb1 }, //0 + {EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA, extcb1 }, //1 + {EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA, extcb1 }, //2 + {EXT_CH_MODE_DISABLED, NULL}, + {EXT_CH_MODE_DISABLED, NULL}, + {EXT_CH_MODE_DISABLED, NULL}, + {EXT_CH_MODE_DISABLED, NULL}, + {EXT_CH_MODE_DISABLED, NULL}, + {EXT_CH_MODE_DISABLED, NULL}, + {EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA, extcb1 }, //9 + {EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA, extcb1 }, //10 + {EXT_CH_MODE_DISABLED, NULL}, + {EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOB, extcb1 }, //12 + {EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOB, extcb1 }, //13 + {EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOB, extcb1 }, //14 + {EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOB, extcb1 } //15 + }, +}; + +void matrix_init(void) { + //Set I/O as pull-up inputs to read states + setPinInputHigh(A0); + setPinInputHigh(A1); + setPinInputHigh(A2); + setPinInputHigh(A3); + setPinInputHigh(A4); + setPinInputHigh(A5); + setPinInputHigh(A6); + setPinInputHigh(A7); + setPinInputHigh(A8); + setPinInputHigh(A9); + setPinInputHigh(A10); + setPinInputHigh(B3); + setPinInputHigh(B4); + setPinInputHigh(B5); + setPinInputHigh(B6); + setPinInputHigh(B7); + setPinInputHigh(B8); + setPinInputHigh(B9); + setPinInputHigh(B11); + setPinInputHigh(B12); + setPinInputHigh(B13); + setPinInputHigh(B14); + setPinInputHigh(B15); + + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + + matrix_init_quantum(); + //Start interrupt driver + extStart(&EXTD1, &extcfg); +} + +uint8_t matrix_scan(void) { + switch_buffer = ((uint32_t)(porta_buffer & 0x7FF)) | ((uint32_t)(portb_buffer & 0x3F8) << 8); + + switch (switch_buffer) { + case 0x1134E: matrix[0] = 0x01; break; + case 0x3774D: matrix[0] = 0x02; break; + case 0x10BCC: matrix[0] = 0x04; break; + case 0x16B4B: matrix[0] = 0x08; break; + case 0x167CA: matrix[0] = 0x10; break; + case 0x35FC9: matrix[0] = 0x20; break; + case 0x15B48: matrix[0] = 0x40; break; + case 0x28347: matrix[0] = 0x80; break; + case 0x173C6: matrix[0] = 0x100; break; + case 0x143CF: matrix[0] = 0x200; break; + case 0x3FDC5: matrix[0] = 0x400; break; + case 0x3FD21: matrix[0] = 0x800; break; + case 0x3FD77: matrix[0] = 0x1000; break; + case 0x3FD72: matrix[0] = 0x2000; break; + //Special pin + case 0x3E7FA: matrix[0] = 0x8000; break; + case 0x183EE: matrix[0] = 0x10000; break; + case 0x197F3: matrix[0] = 0x20000; break; + case 0x1AB7E: matrix[0] = 0x40000; break; + + case 0x107C3: matrix[1] = 0x01; break; + case 0x3FD2E: matrix[1] = 0x02; break; + case 0x3FD28: matrix[1] = 0x04; break; + case 0x3FD3A: matrix[1] = 0x08; break; + case 0x3FD2D: matrix[1] = 0x10; break; + case 0x3FD2B: matrix[1] = 0x20; break; + case 0x3FDA5: matrix[1] = 0x40; break; + case 0x3FDAA: matrix[1] = 0x80; break; + case 0x3FD36: matrix[1] = 0x100; break; + case 0x3FD30: matrix[1] = 0x200; break; + case 0x3FDAF: matrix[1] = 0x400; break; + case 0x3FD22: matrix[1] = 0x800; break; + case 0x157D4: matrix[1] = 0x1000; break; + //Does not exist in matrix + //Special pin + case 0x1C778: matrix[1] = 0x8000; break; + case 0x387ED: matrix[1] = 0x10000; break; + case 0x19B74: matrix[1] = 0x20000; break; + case 0x3FD7D: matrix[1] = 0x40000; break; + + //Special pin + case 0x3FDBE: matrix[2] = 0x02; break; + case 0x3FDAC: matrix[2] = 0x04; break; + case 0x3FDBB: matrix[2] = 0x08; break; + case 0x3FD39: matrix[2] = 0x10; break; + case 0x3FDB8: matrix[2] = 0x20; break; + case 0x3FDB7: matrix[2] = 0x40; break; + case 0x3FD35: matrix[2] = 0x80; break; + case 0x3FDB4: matrix[2] = 0x100; break; + case 0x3FD33: matrix[2] = 0x200; break; + case 0x3FDA3: matrix[2] = 0x400; break; + case 0x3FD24: matrix[2] = 0x800; break; + case 0x0FFDB: matrix[2] = 0x1000; break; + case 0x3FDF5: matrix[2] = 0x2000; break; + case 0x3FDFF: matrix[2] = 0x4000; break; + case 0x3C3E4: matrix[2] = 0x8000; break; + case 0x38B6C: matrix[2] = 0x10000; break; + case 0x39FF6: matrix[2] = 0x20000; break; + case 0x3FDFC: matrix[2] = 0x40000; break; + + //Special pin + case 0x3FDA6: matrix[3] = 0x02; break; + case 0x3FD27: matrix[3] = 0x04; break; + case 0x3FD3C: matrix[3] = 0x08; break; + case 0x3FDA9: matrix[3] = 0x10; break; + case 0x3FDBD: matrix[3] = 0x20; break; + case 0x3FDB1: matrix[3] = 0x40; break; + case 0x3FDB2: matrix[3] = 0x80; break; + case 0x30353: matrix[3] = 0x100; break; + case 0x37BD1: matrix[3] = 0x200; break; + case 0x363D2: matrix[3] = 0x400; break; + case 0x3FD5F: matrix[3] = 0x800; break; + //Does not exist in matrix + //Does not exist in matrix + //Special pin + case 0x1BF00: matrix[3] = 0x8000; break; + case 0x18FEB: matrix[3] = 0x10000; break; + case 0x3FF69: matrix[3] = 0x20000; break; + case 0x3A37B: matrix[3] = 0x40000; break; + default: + if ((portb_buffer & 0x1000) == 0) { matrix[1] = 0x4000; break; } + if ((portb_buffer & 0x2000) == 0) { matrix[3] = 0x4000; break; } + if ((portb_buffer & 0x4000) == 0) { matrix[0] = 0x4000; break; } + if ((portb_buffer & 0x8000) == 0) { matrix[2] = 0x01; break; } + matrix[0] = 0x00; + matrix[1] = 0x00; + matrix[2] = 0x00; + matrix[3] = 0x00; + } + //Special case for Shift + if (readPin(B11) == 0) { matrix[3] |= 0x01; } + + porta_buffer = 65535; + portb_buffer = 65535; + + matrix_scan_quantum(); + return 1; +} + +matrix_row_t matrix_get_row(uint8_t row) +{ + return matrix[row]; +} + +void matrix_print(void) +{ + +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + diff --git a/keyboards/converter/siemens_tastatur/mcuconf.h b/keyboards/converter/siemens_tastatur/mcuconf.h new file mode 100644 index 00000000000..9945e7408d1 --- /dev/null +++ b/keyboards/converter/siemens_tastatur/mcuconf.h @@ -0,0 +1,209 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define STM32F103_MCUCONF + +/* + * STM32F103 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_RTCSEL STM32_RTCSEL_HSEDIV +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 6 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * RTC driver system settings. + */ +#define STM32_RTC_IRQ_PRIORITY 15 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/converter/siemens_tastatur/readme.md b/keyboards/converter/siemens_tastatur/readme.md new file mode 100644 index 00000000000..ca1b6ec0f3d --- /dev/null +++ b/keyboards/converter/siemens_tastatur/readme.md @@ -0,0 +1,17 @@ +# Siemens Tastatur + +[Siemens_tastatur](https://i.imgur.com/mQY4CQA.jpg) + +A Blue Pill STM32F103C8T6-based Converter board for a very very old keyboard. + +Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) +Hardware Supported: Blue Pill STM32F103C8T6 +Hardware Availability: Custom PCB available, contact me + +Make example for this keyboard (after setting up your build environment): + + make converter/siemens_tastatur:default + +Unplugging and replugging the keyboard is necessary after a firmware update. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/converter/siemens_tastatur/rules.mk b/keyboards/converter/siemens_tastatur/rules.mk new file mode 100644 index 00000000000..75b3d7b3613 --- /dev/null +++ b/keyboards/converter/siemens_tastatur/rules.mk @@ -0,0 +1,52 @@ +SRC = matrix.c +# GENERIC STM32F103C8T6 board - stm32duino bootloader +OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 +MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader +BOARD = GENERIC_STM32_F103 + +# OPT_DEFS = +# MCU_LDSCRIPT = STM32F103x8 +# BOARD = GENERIC_STM32_F103 + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +DFU_ARGS = -d 1eaf:0003 -a 2 + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no +CUSTOM_MATRIX = yes + diff --git a/keyboards/converter/siemens_tastatur/siemens_tastatur.c b/keyboards/converter/siemens_tastatur/siemens_tastatur.c new file mode 100644 index 00000000000..298f24c36f9 --- /dev/null +++ b/keyboards/converter/siemens_tastatur/siemens_tastatur.c @@ -0,0 +1,45 @@ +/* +Copyright 2019 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include "siemens_tastatur.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + diff --git a/keyboards/converter/siemens_tastatur/siemens_tastatur.h b/keyboards/converter/siemens_tastatur/siemens_tastatur.h new file mode 100644 index 00000000000..6a81b2550d7 --- /dev/null +++ b/keyboards/converter/siemens_tastatur/siemens_tastatur.h @@ -0,0 +1,41 @@ +/* +Copyright 2019 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, k0h, k0i, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, k1g, k1h, k1i, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h, k2i, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3e, k3f, k3g, k3h, k3i, \ + k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, k0h, k0i }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, KC_NO, k1e, k1f, k1g, k1h, k1i }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h, k2i }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, KC_NO, k3e, k3f, k3g, k3h, k3i }, \ +} diff --git a/keyboards/converter/sun_usb/config.h b/keyboards/converter/sun_usb/config.h index f7ad4163939..7713e0a915b 100644 --- a/keyboards/converter/sun_usb/config.h +++ b/keyboards/converter/sun_usb/config.h @@ -33,9 +33,9 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ + get_mods() == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \ + get_mods() == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) diff --git a/keyboards/converter/sun_usb/readme.md b/keyboards/converter/sun_usb/readme.md index 3470e6091c4..69bc6ef04c6 100644 --- a/keyboards/converter/sun_usb/readme.md +++ b/keyboards/converter/sun_usb/readme.md @@ -12,7 +12,7 @@ Make example for this keyboard (after setting up your build environment): make converter/sun_usb/type5:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Hardware diff --git a/keyboards/converter/sun_usb/rules.mk b/keyboards/converter/sun_usb/rules.mk index 3cf503b1d25..db6b5c7ee40 100644 --- a/keyboards/converter/sun_usb/rules.mk +++ b/keyboards/converter/sun_usb/rules.mk @@ -9,36 +9,32 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT BOOTLOADER = lufa-dfu # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode -UNICODEMAP_ENABLE = yes BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -CUSTOM_MATRIX = yes - +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend #HARDWARE_SERIAL = yes +CUSTOM_MATRIX = yes SRC += matrix.c led.c - ifdef HARDWARE_SERIAL - SRC += protocol/serial_uart.c - OPT_DEFS += -DHARDWARE_SERIAL + SRC += protocol/serial_uart.c + OPT_DEFS += -DHARDWARE_SERIAL else - SRC += protocol/serial_soft.c + SRC += protocol/serial_soft.c endif DEFAULT_FOLDER = converter/sun_usb/type5 diff --git a/keyboards/converter/sun_usb/type3/info.json b/keyboards/converter/sun_usb/type3/info.json new file mode 100644 index 00000000000..f8525b15cb3 --- /dev/null +++ b/keyboards/converter/sun_usb/type3/info.json @@ -0,0 +1,109 @@ +{ + "keyboard_name": "Sun Type 3", + "keyboard_folder": "converter/sun_usb/type3", + "url": "", + "maintainer": "qmk", + "width": 21, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"STOP", "x":0, "y":0}, + {"label":"AGAIN", "x":1, "y":0}, + {"label":"CAPS LOCK", "x":2.5, "y":0}, + {"label":"F2", "x":3.5, "y":0}, + {"label":"F3", "x":4.5, "y":0, "w":2}, + {"label":"F4", "x":6.5, "y":0, "w":2}, + {"label":"F5", "x":8.5, "y":0, "w":2}, + {"label":"F6", "x":10.5, "y":0, "w":2}, + {"label":"F7", "x":12.5, "y":0, "w":2}, + {"label":"F8", "x":14.5, "y":0}, + {"label":"F9", "x":15.5, "y":0}, + {"label":"BACKSPACE", "x":16.5, "y":0}, + {"label":"R1", "x":18, "y":0}, + {"label":"R2", "x":19, "y":0}, + {"label":"R3", "x":20, "y":0}, + {"label":"PROPS", "x":0, "y":1}, + {"label":"UNDO", "x":1, "y":1}, + {"label":"ESC", "x":2.5, "y":1}, + {"label":"1", "x":3.5, "y":1}, + {"label":"2", "x":4.5, "y":1}, + {"label":"3", "x":5.5, "y":1}, + {"label":"4", "x":6.5, "y":1}, + {"label":"5", "x":7.5, "y":1}, + {"label":"6", "x":8.5, "y":1}, + {"label":"7", "x":9.5, "y":1}, + {"label":"8", "x":10.5, "y":1}, + {"label":"9", "x":11.5, "y":1}, + {"label":"0", "x":12.5, "y":1}, + {"label":"MINUS", "x":13.5, "y":1}, + {"label":"EQUAL", "x":14.5, "y":1}, + {"label":"BACKSLASH", "x":15.5, "y":1}, + {"label":"GRAVE", "x":16.5, "y":1}, + {"label":"R4", "x":18, "y":1}, + {"label":"R5", "x":19, "y":1}, + {"label":"R6", "x":20, "y":1}, + {"label":"FRONT", "x":0, "y":2}, + {"label":"COPY", "x":1, "y":2}, + {"label":"TAB", "x":2.5, "y":2, "w":1.5}, + {"label":"Q", "x":4, "y":2}, + {"label":"W", "x":5, "y":2}, + {"label":"E", "x":6, "y":2}, + {"label":"R", "x":7, "y":2}, + {"label":"T", "x":8, "y":2}, + {"label":"Y", "x":9, "y":2}, + {"label":"U", "x":10, "y":2}, + {"label":"I", "x":11, "y":2}, + {"label":"O", "x":12, "y":2}, + {"label":"P", "x":13, "y":2}, + {"label":"LBRACKET", "x":14, "y":2}, + {"label":"RBRACKET", "x":15, "y":2}, + {"label":"DELETE", "x":16, "y":2, "w":1.5}, + {"label":"R7", "x":18, "y":2}, + {"label":"R8", "x":19, "y":2}, + {"label":"R9", "x":20, "y":2}, + {"label":"OPEN", "x":0, "y":3}, + {"label":"PASTE", "x":1, "y":3}, + {"label":"CONTROL", "x":2.5, "y":3, "w":1.75}, + {"label":"A", "x":4.25, "y":3}, + {"label":"S", "x":5.25, "y":3}, + {"label":"D", "x":6.25, "y":3}, + {"label":"F", "x":7.25, "y":3}, + {"label":"G", "x":8.25, "y":3}, + {"label":"H", "x":9.25, "y":3}, + {"label":"J", "x":10.25, "y":3}, + {"label":"K", "x":11.25, "y":3}, + {"label":"L", "x":12.25, "y":3}, + {"label":"SEMICOLON", "x":13.25, "y":3}, + {"label":"QUOTE", "x":14.25, "y":3}, + {"label":"RETURN", "x":15.25, "y":3, "w":2.25}, + {"label":"R10", "x":18, "y":3}, + {"label":"R11", "x":19, "y":3}, + {"label":"R12", "x":20, "y":3}, + {"label":"FIND", "x":0, "y":4}, + {"label":"CUT", "x":1, "y":4}, + {"label":"LSHIFT", "x":2.5, "y":4, "w":2.25}, + {"label":"Z", "x":4.75, "y":4}, + {"label":"X", "x":5.75, "y":4}, + {"label":"C", "x":6.75, "y":4}, + {"label":"V", "x":7.75, "y":4}, + {"label":"B", "x":8.75, "y":4}, + {"label":"N", "x":9.75, "y":4}, + {"label":"M", "x":10.75, "y":4}, + {"label":"COMMA", "x":11.75, "y":4}, + {"label":"PERIOD", "x":12.75, "y":4}, + {"label":"SLASH", "x":13.75, "y":4}, + {"label":"RSHIFT", "x":14.75, "y":4, "w":1.75}, + {"label":"LINE FEED", "x":16.5, "y":4}, + {"label":"R13", "x":18, "y":4}, + {"label":"R14", "x":19, "y":4}, + {"label":"R15", "x":20, "y":4}, + {"label":"CAPS", "x":2.5, "y":5, "w":1.25}, + {"label":"LEFT", "x":3.75, "y":5, "w":1.5}, + {"label":"SPACE", "x":5.25, "y":5, "w":9}, + {"label":"RIGHT", "x":14.25, "y":5, "w":1.5}, + {"label":"ALTERNATE", "x":15.75, "y":5, "w":1.75} + ] + } + } +} diff --git a/keyboards/converter/sun_usb/type5/info.json b/keyboards/converter/sun_usb/type5/info.json new file mode 100644 index 00000000000..6785bbc076c --- /dev/null +++ b/keyboards/converter/sun_usb/type5/info.json @@ -0,0 +1,381 @@ +{ + "keyboard_name": "Sun Type 5", + "keyboard_folder": "converter/sun_usb/type5", + "url": "", + "maintainer": "qmk", + "width": 24.75, + "height": 7, + "layouts": { + "LAYOUT_jp_unix": { + "layout": [ + {"label":"HELP", "x":0, "y":0, "w":2}, + {"label":"NO", "x":2.25, "y":0}, + {"label":"F1", "x":4.25, "y":0}, + {"label":"F2", "x":5.25, "y":0}, + {"label":"F3", "x":6.25, "y":0}, + {"label":"F4", "x":7.25, "y":0}, + {"label":"F5", "x":8.75, "y":0}, + {"label":"F6", "x":9.75, "y":0}, + {"label":"F7", "x":10.75, "y":0}, + {"label":"F8", "x":11.75, "y":0}, + {"label":"F9", "x":13.25, "y":0}, + {"label":"F10", "x":14.25, "y":0}, + {"label":"F11", "x":15.25, "y":0}, + {"label":"F12", "x":16.25, "y":0}, + {"label":"PRINT SCREEN", "x":17.5, "y":0}, + {"label":"SCROLL LOCK", "x":18.5, "y":0}, + {"label":"PAUSE", "x":19.5, "y":0}, + {"label":"MUTE", "x":20.75, "y":0}, + {"label":"VOLD", "x":21.75, "y":0}, + {"label":"VOLU", "x":22.75, "y":0}, + {"label":"PWR", "x":23.75, "y":0}, + {"label":"STOP", "x":0, "y":2}, + {"label":"AGAIN", "x":1, "y":2}, + {"label":"ESC", "x":2.25, "y":2}, + {"label":"1", "x":3.25, "y":2}, + {"label":"2", "x":4.25, "y":2}, + {"label":"3", "x":5.25, "y":2}, + {"label":"4", "x":6.25, "y":2}, + {"label":"5", "x":7.25, "y":2}, + {"label":"6", "x":8.25, "y":2}, + {"label":"7", "x":9.25, "y":2}, + {"label":"8", "x":10.25, "y":2}, + {"label":"9", "x":11.25, "y":2}, + {"label":"0", "x":12.25, "y":2}, + {"label":"MINUS", "x":13.25, "y":2}, + {"label":"EQUAL", "x":14.25, "y":2}, + {"label":"BACKSLASH", "x":15.25, "y":2}, + {"label":"GRAVE", "x":16.25, "y":2}, + {"label":"INSERT", "x":17.5, "y":2}, + {"label":"HOME", "x":18.5, "y":2}, + {"label":"PAGE UP", "x":19.5, "y":2}, + {"label":"NUM LOCK", "x":20.75, "y":2}, + {"label":"PSLASH", "x":21.75, "y":2}, + {"label":"PASTERISK", "x":22.75, "y":2}, + {"label":"PMINUS", "x":23.75, "y":2}, + {"label":"MENU", "x":0, "y":3}, + {"label":"UNDO", "x":1, "y":3}, + {"label":"TAB", "x":2.25, "y":3, "w":1.5}, + {"label":"Q", "x":3.75, "y":3}, + {"label":"W", "x":4.75, "y":3}, + {"label":"E", "x":5.75, "y":3}, + {"label":"R", "x":6.75, "y":3}, + {"label":"T", "x":7.75, "y":3}, + {"label":"Y", "x":8.75, "y":3}, + {"label":"U", "x":9.75, "y":3}, + {"label":"I", "x":10.75, "y":3}, + {"label":"O", "x":11.75, "y":3}, + {"label":"P", "x":12.75, "y":3}, + {"label":"LBRACKET", "x":13.75, "y":3}, + {"label":"RBRACKET", "x":14.75, "y":3}, + {"label":"BACKSPACE", "x":15.75, "y":3, "w":1.5}, + {"label":"DELETE", "x":17.5, "y":3}, + {"label":"END", "x":18.5, "y":3}, + {"label":"PAGE DOWN", "x":19.5, "y":3}, + {"label":"P7", "x":20.75, "y":3}, + {"label":"P8", "x":21.75, "y":3}, + {"label":"P9", "x":22.75, "y":3}, + {"label":"PPLUS", "x":23.75, "y":3, "h":2}, + {"label":"SELECT", "x":0, "y":4}, + {"label":"COPY", "x":1, "y":4}, + {"label":"LCTRL", "x":2.25, "y":4, "w":1.75}, + {"label":"A", "x":4, "y":4}, + {"label":"S", "x":5, "y":4}, + {"label":"D", "x":6, "y":4}, + {"label":"F", "x":7, "y":4}, + {"label":"G", "x":8, "y":4}, + {"label":"H", "x":9, "y":4}, + {"label":"J", "x":10, "y":4}, + {"label":"K", "x":11, "y":4}, + {"label":"L", "x":12, "y":4}, + {"label":"SEMICOLON", "x":13, "y":4}, + {"label":"QUOTE", "x":14, "y":4}, + {"label":"ENTER", "x":15, "y":4, "w":2.25}, + {"label":"P4", "x":20.75, "y":4}, + {"label":"P5", "x":21.75, "y":4}, + {"label":"P6", "x":22.75, "y":4}, + {"label":"EXECUTE", "x":0, "y":5}, + {"label":"PASTE", "x":1, "y":5}, + {"label":"LSHIFT", "x":2.25, "y":5, "w":2.25}, + {"label":"Z", "x":4.5, "y":5}, + {"label":"X", "x":5.5, "y":5}, + {"label":"C", "x":6.5, "y":5}, + {"label":"V", "x":7.5, "y":5}, + {"label":"B", "x":8.5, "y":5}, + {"label":"N", "x":9.5, "y":5}, + {"label":"M", "x":10.5, "y":5}, + {"label":"COMMA", "x":11.5, "y":5}, + {"label":"PERIOD", "x":12.5, "y":5}, + {"label":"SLASH", "x":13.5, "y":5}, + {"label":"RSHIFT", "x":14.5, "y":5, "w":2.75}, + {"label":"UP", "x":18.5, "y":5}, + {"label":"P1", "x":20.75, "y":5}, + {"label":"P2", "x":21.75, "y":5}, + {"label":"P3", "x":22.75, "y":5}, + {"label":"PENTER", "x":23.75, "y":5, "h":2}, + {"label":"FIND", "x":0, "y":6}, + {"label":"CUT", "x":1, "y":6}, + {"label":"CAPS LOCK", "x":2.25, "y":6}, + {"label":"LALT", "x":3.25, "y":6}, + {"label":"LGUI", "x":4.25, "y":6}, + {"label":"HENKAN", "x":5.25, "y":6, "w":1.5}, + {"label":"SPACE", "x":6.75, "y":6, "w":5}, + {"label":"MUHENKAN", "x":11.75, "y":6, "w":1.5}, + {"label":"KANA", "x":13.25, "y":6}, + {"label":"RGUI", "x":14.25, "y":6}, + {"label":"APP", "x":15.25, "y":6}, + {"label":"RALT", "x":16.25, "y":6}, + {"label":"LEFT", "x":17.5, "y":6}, + {"label":"DOWN", "x":18.5, "y":6}, + {"label":"RIGHT", "x":19.5, "y":6}, + {"label":"P0", "x":20.75, "y":6, "w":2}, + {"label":"PDOT", "x":22.75, "y":6} + ] + }, + "LAYOUT_us_unix": { + "layout": [ + {"label":"HELP", "x":0, "y":0, "w":2}, + {"label":"NO", "x":2.25, "y":0}, + {"label":"F1", "x":4.25, "y":0}, + {"label":"F2", "x":5.25, "y":0}, + {"label":"F3", "x":6.25, "y":0}, + {"label":"F4", "x":7.25, "y":0}, + {"label":"F5", "x":8.75, "y":0}, + {"label":"F6", "x":9.75, "y":0}, + {"label":"F7", "x":10.75, "y":0}, + {"label":"F8", "x":11.75, "y":0}, + {"label":"F9", "x":13.25, "y":0}, + {"label":"F10", "x":14.25, "y":0}, + {"label":"F11", "x":15.25, "y":0}, + {"label":"F12", "x":16.25, "y":0}, + {"label":"PRINT SCREEN", "x":17.5, "y":0}, + {"label":"SCROLL LOCK", "x":18.5, "y":0}, + {"label":"PAUSE", "x":19.5, "y":0}, + {"label":"MUTE", "x":20.75, "y":0}, + {"label":"VOLD", "x":21.75, "y":0}, + {"label":"VOLU", "x":22.75, "y":0}, + {"label":"PWR", "x":23.75, "y":0}, + {"label":"STOP", "x":0, "y":2}, + {"label":"AGAIN", "x":1, "y":2}, + {"label":"ESC", "x":2.25, "y":2}, + {"label":"1", "x":3.25, "y":2}, + {"label":"2", "x":4.25, "y":2}, + {"label":"3", "x":5.25, "y":2}, + {"label":"4", "x":6.25, "y":2}, + {"label":"5", "x":7.25, "y":2}, + {"label":"6", "x":8.25, "y":2}, + {"label":"7", "x":9.25, "y":2}, + {"label":"8", "x":10.25, "y":2}, + {"label":"9", "x":11.25, "y":2}, + {"label":"0", "x":12.25, "y":2}, + {"label":"MINUS", "x":13.25, "y":2}, + {"label":"EQUAL", "x":14.25, "y":2}, + {"label":"BACKSLASH", "x":15.25, "y":2}, + {"label":"GRAVE", "x":16.25, "y":2}, + {"label":"INSERT", "x":17.5, "y":2}, + {"label":"HOME", "x":18.5, "y":2}, + {"label":"PAGE UP", "x":19.5, "y":2}, + {"label":"NUM LOCK", "x":20.75, "y":2}, + {"label":"PSLASH", "x":21.75, "y":2}, + {"label":"PASTERISK", "x":22.75, "y":2}, + {"label":"PMINUS", "x":23.75, "y":2}, + {"label":"MENU", "x":0, "y":3}, + {"label":"UNDO", "x":1, "y":3}, + {"label":"TAB", "x":2.25, "y":3, "w":1.5}, + {"label":"Q", "x":3.75, "y":3}, + {"label":"W", "x":4.75, "y":3}, + {"label":"E", "x":5.75, "y":3}, + {"label":"R", "x":6.75, "y":3}, + {"label":"T", "x":7.75, "y":3}, + {"label":"Y", "x":8.75, "y":3}, + {"label":"U", "x":9.75, "y":3}, + {"label":"I", "x":10.75, "y":3}, + {"label":"O", "x":11.75, "y":3}, + {"label":"P", "x":12.75, "y":3}, + {"label":"LBRACKET", "x":13.75, "y":3}, + {"label":"RBRACKET", "x":14.75, "y":3}, + {"label":"BACKSPACE", "x":15.75, "y":3, "w":1.5}, + {"label":"DELETE", "x":17.5, "y":3}, + {"label":"END", "x":18.5, "y":3}, + {"label":"PAGE DOWN", "x":19.5, "y":3}, + {"label":"P7", "x":20.75, "y":3}, + {"label":"P8", "x":21.75, "y":3}, + {"label":"P9", "x":22.75, "y":3}, + {"label":"PPLUS", "x":23.75, "y":3, "h":2}, + {"label":"SELECT", "x":0, "y":4}, + {"label":"COPY", "x":1, "y":4}, + {"label":"LCTRL", "x":2.25, "y":4, "w":1.75}, + {"label":"A", "x":4, "y":4}, + {"label":"S", "x":5, "y":4}, + {"label":"D", "x":6, "y":4}, + {"label":"F", "x":7, "y":4}, + {"label":"G", "x":8, "y":4}, + {"label":"H", "x":9, "y":4}, + {"label":"J", "x":10, "y":4}, + {"label":"K", "x":11, "y":4}, + {"label":"L", "x":12, "y":4}, + {"label":"SEMICOLON", "x":13, "y":4}, + {"label":"QUOTE", "x":14, "y":4}, + {"label":"ENTER", "x":15, "y":4, "w":2.25}, + {"label":"P4", "x":20.75, "y":4}, + {"label":"P5", "x":21.75, "y":4}, + {"label":"P6", "x":22.75, "y":4}, + {"label":"EXECUTE", "x":0, "y":5}, + {"label":"PASTE", "x":1, "y":5}, + {"label":"LSHIFT", "x":2.25, "y":5, "w":2.25}, + {"label":"Z", "x":4.5, "y":5}, + {"label":"X", "x":5.5, "y":5}, + {"label":"C", "x":6.5, "y":5}, + {"label":"V", "x":7.5, "y":5}, + {"label":"B", "x":8.5, "y":5}, + {"label":"N", "x":9.5, "y":5}, + {"label":"M", "x":10.5, "y":5}, + {"label":"COMMA", "x":11.5, "y":5}, + {"label":"PERIOD", "x":12.5, "y":5}, + {"label":"SLASH", "x":13.5, "y":5}, + {"label":"RSHIFT", "x":14.5, "y":5, "w":2.75}, + {"label":"UP", "x":18.5, "y":5}, + {"label":"P1", "x":20.75, "y":5}, + {"label":"P2", "x":21.75, "y":5}, + {"label":"P3", "x":22.75, "y":5}, + {"label":"PENTER", "x":23.75, "y":5, "h":2}, + {"label":"FIND", "x":0, "y":6}, + {"label":"CUT", "x":1, "y":6}, + {"label":"CAPS LOCK", "x":2.25, "y":6, "w":1.75}, + {"label":"LALT", "x":4, "y":6}, + {"label":"LGUI", "x":5, "y":6}, + {"label":"SPACE", "x":6, "y":6, "w":8.25}, + {"label":"RGUI", "x":14.25, "y":6}, + {"label":"APP", "x":15.25, "y":6}, + {"label":"RALT", "x":16.25, "y":6}, + {"label":"LEFT", "x":17.5, "y":6}, + {"label":"DOWN", "x":18.5, "y":6}, + {"label":"RIGHT", "x":19.5, "y":6}, + {"label":"P0", "x":20.75, "y":6, "w":2}, + {"label":"PDOT", "x":22.75, "y":6} + ] + }, + "LAYOUT_ansi": { + "layout": [ + {"label":"HELP", "x":0, "y":0, "w":2}, + {"label":"ESC", "x":2.25, "y":0}, + {"label":"F1", "x":4.25, "y":0}, + {"label":"F2", "x":5.25, "y":0}, + {"label":"F3", "x":6.25, "y":0}, + {"label":"F4", "x":7.25, "y":0}, + {"label":"F5", "x":8.75, "y":0}, + {"label":"F6", "x":9.75, "y":0}, + {"label":"F7", "x":10.75, "y":0}, + {"label":"F8", "x":11.75, "y":0}, + {"label":"F9", "x":13.25, "y":0}, + {"label":"F10", "x":14.25, "y":0}, + {"label":"F11", "x":15.25, "y":0}, + {"label":"F12", "x":16.25, "y":0}, + {"label":"PRINT SCREEN", "x":17.5, "y":0}, + {"label":"SCROLL LOCK", "x":18.5, "y":0}, + {"label":"PAUSE", "x":19.5, "y":0}, + {"label":"MUTE", "x":20.75, "y":0}, + {"label":"VOLD", "x":21.75, "y":0}, + {"label":"VOLU", "x":22.75, "y":0}, + {"label":"PWR", "x":23.75, "y":0}, + {"label":"STOP", "x":0, "y":2}, + {"label":"AGAIN", "x":1, "y":2}, + {"label":"GRAVE", "x":2.25, "y":2}, + {"label":"1", "x":3.25, "y":2}, + {"label":"2", "x":4.25, "y":2}, + {"label":"3", "x":5.25, "y":2}, + {"label":"4", "x":6.25, "y":2}, + {"label":"5", "x":7.25, "y":2}, + {"label":"6", "x":8.25, "y":2}, + {"label":"7", "x":9.25, "y":2}, + {"label":"8", "x":10.25, "y":2}, + {"label":"9", "x":11.25, "y":2}, + {"label":"0", "x":12.25, "y":2}, + {"label":"MINUS", "x":13.25, "y":2}, + {"label":"EQUAL", "x":14.25, "y":2}, + {"label":"BACKSPACE", "x":15.25, "y":2, "w":2}, + {"label":"INSERT", "x":17.5, "y":2}, + {"label":"HOME", "x":18.5, "y":2}, + {"label":"PAGE UP", "x":19.5, "y":2}, + {"label":"NUM LOCK", "x":20.75, "y":2}, + {"label":"PSLASH", "x":21.75, "y":2}, + {"label":"PASTERISK", "x":22.75, "y":2}, + {"label":"PMINUS", "x":23.75, "y":2}, + {"label":"MENU", "x":0, "y":3}, + {"label":"UNDO", "x":1, "y":3}, + {"label":"TAB", "x":2.25, "y":3, "w":1.5}, + {"label":"Q", "x":3.75, "y":3}, + {"label":"W", "x":4.75, "y":3}, + {"label":"E", "x":5.75, "y":3}, + {"label":"R", "x":6.75, "y":3}, + {"label":"T", "x":7.75, "y":3}, + {"label":"Y", "x":8.75, "y":3}, + {"label":"U", "x":9.75, "y":3}, + {"label":"I", "x":10.75, "y":3}, + {"label":"O", "x":11.75, "y":3}, + {"label":"P", "x":12.75, "y":3}, + {"label":"LBRACKET", "x":13.75, "y":3}, + {"label":"RBRACKET", "x":14.75, "y":3}, + {"label":"BACKSLASH", "x":15.75, "y":3, "w":1.5}, + {"label":"DELETE", "x":17.5, "y":3}, + {"label":"END", "x":18.5, "y":3}, + {"label":"PAGE DOWN", "x":19.5, "y":3}, + {"label":"P7", "x":20.75, "y":3}, + {"label":"P8", "x":21.75, "y":3}, + {"label":"P9", "x":22.75, "y":3}, + {"label":"PPLUS", "x":23.75, "y":3, "h":2}, + {"label":"SELECT", "x":0, "y":4}, + {"label":"COPY", "x":1, "y":4}, + {"label":"CAPS LOCK", "x":2.25, "y":4, "w":1.75}, + {"label":"A", "x":4, "y":4}, + {"label":"S", "x":5, "y":4}, + {"label":"D", "x":6, "y":4}, + {"label":"F", "x":7, "y":4}, + {"label":"G", "x":8, "y":4}, + {"label":"H", "x":9, "y":4}, + {"label":"J", "x":10, "y":4}, + {"label":"K", "x":11, "y":4}, + {"label":"L", "x":12, "y":4}, + {"label":"SEMICOLON", "x":13, "y":4}, + {"label":"QUOTE", "x":14, "y":4}, + {"label":"ENTER", "x":15, "y":4, "w":2.25}, + {"label":"P4", "x":20.75, "y":4}, + {"label":"P5", "x":21.75, "y":4}, + {"label":"P6", "x":22.75, "y":4}, + {"label":"EXECUTE", "x":0, "y":5}, + {"label":"PASTE", "x":1, "y":5}, + {"label":"LSHIFT", "x":2.25, "y":5, "w":2.25}, + {"label":"Z", "x":4.5, "y":5}, + {"label":"X", "x":5.5, "y":5}, + {"label":"C", "x":6.5, "y":5}, + {"label":"V", "x":7.5, "y":5}, + {"label":"B", "x":8.5, "y":5}, + {"label":"N", "x":9.5, "y":5}, + {"label":"M", "x":10.5, "y":5}, + {"label":"COMMA", "x":11.5, "y":5}, + {"label":"PERIOD", "x":12.5, "y":5}, + {"label":"SLASH", "x":13.5, "y":5}, + {"label":"RSHIFT", "x":14.5, "y":5, "w":2.75}, + {"label":"UP", "x":18.5, "y":5}, + {"label":"P1", "x":20.75, "y":5}, + {"label":"P2", "x":21.75, "y":5}, + {"label":"P3", "x":22.75, "y":5}, + {"label":"PENTER", "x":23.75, "y":5, "h":2}, + {"label":"FIND", "x":0, "y":6}, + {"label":"CUT", "x":1, "y":6}, + {"label":"LCTRL", "x":2.25, "y":6, "w":1.75}, + {"label":"LALT", "x":4, "y":6}, + {"label":"LGUI", "x":5, "y":6}, + {"label":"SPACE", "x":6, "y":6, "w":8.25}, + {"label":"RGUI", "x":14.25, "y":6}, + {"label":"APP", "x":15.25, "y":6}, + {"label":"RALT", "x":16.25, "y":6}, + {"label":"LEFT", "x":17.5, "y":6}, + {"label":"DOWN", "x":18.5, "y":6}, + {"label":"RIGHT", "x":19.5, "y":6}, + {"label":"P0", "x":20.75, "y":6, "w":2}, + {"label":"PDOT", "x":22.75, "y":6} + ] + } + } +} diff --git a/keyboards/converter/usb_usb/README.md b/keyboards/converter/usb_usb/README.md index faee7a5fd88..64334a85fba 100644 --- a/keyboards/converter/usb_usb/README.md +++ b/keyboards/converter/usb_usb/README.md @@ -11,7 +11,7 @@ Make example for this keyboard (after setting up your build environment): make converter/usb_usb:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Note that you have to choose the right hardware variant as your subproject, otherwise you will probably have issues. diff --git a/keyboards/converter/usb_usb/config.h b/keyboards/converter/usb_usb/config.h index deee35948bf..fdaf42eda49 100644 --- a/keyboards/converter/usb_usb/config.h +++ b/keyboards/converter/usb_usb/config.h @@ -32,16 +32,12 @@ along with this program. If not, see . #define PRODUCT QMK USB-USB Converter #define DESCRIPTION USB to USB Keyboard Converter with QMK - /* size of virtual matrix */ #define MATRIX_ROWS 16 #define MATRIX_COLS 16 /* matrix scanning is done in custom_matrix.cpp */ -#define DIODE_DIRECTION CUSTOM_MATRIX - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) +//#define DIODE_DIRECTION /* * Feature disable options diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp index fba107c7cba..296f7fcd026 100644 --- a/keyboards/converter/usb_usb/custom_matrix.cpp +++ b/keyboards/converter/usb_usb/custom_matrix.cpp @@ -74,8 +74,6 @@ static bool matrix_is_mod = false; * This supports two cascaded hubs and four keyboards */ USB usb_host; -USBHub hub1(&usb_host); -USBHub hub2(&usb_host); HIDBoot kbd1(&usb_host); HIDBoot kbd2(&usb_host); HIDBoot kbd3(&usb_host); @@ -84,6 +82,8 @@ KBDReportParser kbd_parser1; KBDReportParser kbd_parser2; KBDReportParser kbd_parser3; KBDReportParser kbd_parser4; +USBHub hub1(&usb_host); +USBHub hub2(&usb_host); extern "C" @@ -98,6 +98,7 @@ extern "C" kbd2.SetReportParser(0, (HIDReportParser*)&kbd_parser2); kbd3.SetReportParser(0, (HIDReportParser*)&kbd_parser3); kbd4.SetReportParser(0, (HIDReportParser*)&kbd_parser4); + matrix_init_quantum(); } static void or_report(report_keyboard_t report) { @@ -115,6 +116,24 @@ extern "C" } } + __attribute__ ((weak)) + void matrix_init_kb(void) { + matrix_init_user(); + } + + __attribute__ ((weak)) + void matrix_init_user(void) { + } + + __attribute__ ((weak)) + void matrix_scan_kb(void) { + matrix_scan_user(); + } + + __attribute__ ((weak)) + void matrix_scan_user(void) { + } + uint8_t matrix_scan(void) { static uint16_t last_time_stamp1 = 0; static uint16_t last_time_stamp2 = 0; @@ -169,6 +188,7 @@ extern "C" keyboard_set_leds(host_keyboard_leds()); } } + matrix_scan_quantum(); return 1; } @@ -232,10 +252,10 @@ extern "C" void led_set(uint8_t usb_led) { - kbd1.SetReport(0, 0, 2, 0, 1, &usb_led); - kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); - kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); - kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); + if (kbd1.isReady()) kbd1.SetReport(0, 0, 2, 0, 1, &usb_led); + if (kbd2.isReady()) kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); + if (kbd3.isReady()) kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); + if (kbd4.isReady()) kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); led_set_kb(usb_led); } diff --git a/keyboards/converter/usb_usb/info.json b/keyboards/converter/usb_usb/info.json new file mode 100644 index 00000000000..af3dd0b5e41 --- /dev/null +++ b/keyboards/converter/usb_usb/info.json @@ -0,0 +1,485 @@ +{ + "keyboard_name": "converter/usb_usb", + "url": "", + "maintainer": "qmk", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"label":"F13", "x":2, "y":0}, + {"label":"F14", "x":3, "y":0}, + {"label":"F15", "x":4, "y":0}, + {"label":"F16", "x":5, "y":0}, + {"label":"F17", "x":6.5, "y":0}, + {"label":"F18", "x":7.5, "y":0}, + {"label":"F19", "x":8.5, "y":0}, + {"label":"F20", "x":9.5, "y":0}, + {"label":"F21", "x":11, "y":0}, + {"label":"F22", "x":12, "y":0}, + {"label":"F23", "x":13, "y":0}, + {"label":"F24", "x":14, "y":0}, + {"label":"Esc", "x":0, "y":1}, + {"label":"F1", "x":2, "y":1}, + {"label":"F2", "x":3, "y":1}, + {"label":"F3", "x":4, "y":1}, + {"label":"F4", "x":5, "y":1}, + {"label":"F5", "x":6.5, "y":1}, + {"label":"F6", "x":7.5, "y":1}, + {"label":"F7", "x":8.5, "y":1}, + {"label":"F8", "x":9.5, "y":1}, + {"label":"F9", "x":11, "y":1}, + {"label":"F10", "x":12, "y":1}, + {"label":"F11", "x":13, "y":1}, + {"label":"F12", "x":14, "y":1}, + {"label":"Print Screen", "x":15.25, "y":1}, + {"label":"Scroll Lock", "x":16.25, "y":1}, + {"label":"Pause", "x":17.25, "y":1}, + {"label":"Volume Down", "x":18.5, "y":1}, + {"label":"Vol Up", "x":19.5, "y":1}, + {"label":"Mute", "x":20.5, "y":1}, + {"label":"Power", "x":21.5, "y":1}, + {"label":"Help", "x":22.75, "y":1}, + {"label":"`", "x":0, "y":2.5}, + {"label":"1", "x":1, "y":2.5}, + {"label":"2", "x":2, "y":2.5}, + {"label":"3", "x":3, "y":2.5}, + {"label":"4", "x":4, "y":2.5}, + {"label":"5", "x":5, "y":2.5}, + {"label":"6", "x":6, "y":2.5}, + {"label":"7", "x":7, "y":2.5}, + {"label":"8", "x":8, "y":2.5}, + {"label":"9", "x":9, "y":2.5}, + {"label":"0", "x":10, "y":2.5}, + {"label":"-", "x":11, "y":2.5}, + {"label":"=", "x":12, "y":2.5}, + {"label":"Yen", "x":13, "y":2.5}, + {"label":"Back Space", "x":14, "y":2.5}, + {"label":"Insert", "x":15.25, "y":2.5}, + {"label":"Home", "x":16.25, "y":2.5}, + {"label":"Page Up", "x":17.25, "y":2.5}, + {"label":"Num Lock", "x":18.5, "y":2.5}, + {"label":"Num /", "x":19.5, "y":2.5}, + {"label":"Num *", "x":20.5, "y":2.5}, + {"label":"Num -", "x":21.5, "y":2.5}, + {"label":"Stop", "x":22.75, "y":2.5}, + {"label":"Again", "x":23.75, "y":2.5}, + {"label":"Tab", "x":0, "y":3.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":3.5}, + {"label":"W", "x":2.5, "y":3.5}, + {"label":"E", "x":3.5, "y":3.5}, + {"label":"R", "x":4.5, "y":3.5}, + {"label":"T", "x":5.5, "y":3.5}, + {"label":"Y", "x":6.5, "y":3.5}, + {"label":"U", "x":7.5, "y":3.5}, + {"label":"I", "x":8.5, "y":3.5}, + {"label":"O", "x":9.5, "y":3.5}, + {"label":"P", "x":10.5, "y":3.5}, + {"label":"[", "x":11.5, "y":3.5}, + {"label":"]", "x":12.5, "y":3.5}, + {"label":"\\", "x":13.5, "y":3.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":3.5}, + {"label":"End", "x":16.25, "y":3.5}, + {"label":"Page Down", "x":17.25, "y":3.5}, + {"label":"Num 7", "x":18.5, "y":3.5}, + {"label":"Num 8", "x":19.5, "y":3.5}, + {"label":"Num 9", "x":20.5, "y":3.5}, + {"label":"Num +", "x":21.5, "y":3.5}, + {"label":"Menu", "x":22.75, "y":3.5}, + {"label":"Undo", "x":23.75, "y":3.5}, + {"label":"Caps Lock", "x":0, "y":4.5, "w":1.75}, + {"label":"A", "x":1.75, "y":4.5}, + {"label":"S", "x":2.75, "y":4.5}, + {"label":"D", "x":3.75, "y":4.5}, + {"label":"F", "x":4.75, "y":4.5}, + {"label":"G", "x":5.75, "y":4.5}, + {"label":"H", "x":6.75, "y":4.5}, + {"label":"J", "x":7.75, "y":4.5}, + {"label":"K", "x":8.75, "y":4.5}, + {"label":"L", "x":9.75, "y":4.5}, + {"label":";", "x":10.75, "y":4.5}, + {"label":"\"", "x":11.75, "y":4.5}, + {"label":"ISO #", "x":12.75, "y":4.5}, + {"label":"Enter", "x":13.75, "y":4.5, "w":1.25}, + {"label":"Num 4", "x":18.5, "y":4.5}, + {"label":"Num 5", "x":19.5, "y":4.5}, + {"label":"Num 6", "x":20.5, "y":4.5}, + {"label":"Num , ", "x":21.5, "y":4.5}, + {"label":"Select", "x":22.75, "y":4.5}, + {"label":"Copy", "x":23.75, "y":4.5}, + {"label":"Shift", "x":0, "y":5.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":5.5}, + {"label":"Z", "x":2.25, "y":5.5}, + {"label":"X", "x":3.25, "y":5.5}, + {"label":"C", "x":4.25, "y":5.5}, + {"label":"V", "x":5.25, "y":5.5}, + {"label":"B", "x":6.25, "y":5.5}, + {"label":"N", "x":7.25, "y":5.5}, + {"label":"M", "x":8.25, "y":5.5}, + {"label":",", "x":9.25, "y":5.5}, + {"label":".", "x":10.25, "y":5.5}, + {"label":"/", "x":11.25, "y":5.5}, + {"label":"JIS \\", "x":12.25, "y":5.5}, + {"label":"Shift", "x":13.25, "y":5.5, "w":1.75}, + {"label":"Up", "x":16.25, "y":5.5}, + {"label":"Num 1", "x":18.5, "y":5.5}, + {"label":"Num 2", "x":19.5, "y":5.5}, + {"label":"Num 3", "x":20.5, "y":5.5}, + {"label":"Num =", "x":21.5, "y":5.5}, + {"label":"Exec", "x":22.75, "y":5.5}, + {"label":"Paste", "x":23.75, "y":5.5}, + {"label":"Ctrl", "x":0, "y":6.5}, + {"label":"GUI", "x":1, "y":6.5}, + {"label":"Alt", "x":2, "y":6.5}, + {"label":"JIS Muhenkan", "x":3, "y":6.5}, + {"label":"Hanja", "x":4, "y":6.5}, + {"label":"Space", "x":5, "y":6.5, "w":3}, + {"label":"Hangul/English", "x":8, "y":6.5}, + {"label":"JIS Henkan", "x":9, "y":6.5}, + {"label":"JIS Katakana/Hiragana", "x":10, "y":6.5}, + {"label":"Alt", "x":11, "y":6.5}, + {"label":"GUI", "x":12, "y":6.5}, + {"label":"App", "x":13, "y":6.5}, + {"label":"Ctrl", "x":14, "y":6.5}, + {"label":"Left", "x":15.25, "y":6.5}, + {"label":"Down", "x":16.25, "y":6.5}, + {"label":"Right", "x":17.25, "y":6.5}, + {"label":"Num 0", "x":18.5, "y":6.5, "w":2}, + {"label":"Num .", "x":20.5, "y":6.5}, + {"label":"Num Enter", "x":21.5, "y":6.5}, + {"label":"Find", "x":22.75, "y":6.5}, + {"label":"Cut", "x":23.75, "y":6.5} + ] + }, + "LAYOUT_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"Num /", "x":19.5, "y":1.5}, + {"label":"Num *", "x":20.5, "y":1.5}, + {"label":"Num -", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Num 7", "x":18.5, "y":2.5}, + {"label":"Num 8", "x":19.5, "y":2.5}, + {"label":"Num 9", "x":20.5, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Num 4", "x":18.5, "y":3.5}, + {"label":"Num 5", "x":19.5, "y":3.5}, + {"label":"Num 6", "x":20.5, "y":3.5}, + {"label":"Num +", "x":21.5, "y":2.5, "h":2}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Num 1", "x":18.5, "y":4.5}, + {"label":"Num 2", "x":19.5, "y":4.5}, + {"label":"Num 3", "x":20.5, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"Num 0", "x":18.5, "y":5.5, "w":2}, + {"label":"Num .", "x":20.5, "y":5.5}, + {"label":"Num Enter", "x":21.5, "y":4.5, "h":2} + ] + }, + "LAYOUT_iso": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"Num /", "x":19.5, "y":1.5}, + {"label":"Num *", "x":20.5, "y":1.5}, + {"label":"Num -", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Num 7", "x":18.5, "y":2.5}, + {"label":"Num 8", "x":19.5, "y":2.5}, + {"label":"Num 9", "x":20.5, "y":2.5}, + {"label":"Num +", "x":21.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"ISO #", "x":12.75, "y":3.5}, + {"label":"Num 4", "x":18.5, "y":3.5}, + {"label":"Num 5", "x":19.5, "y":3.5}, + {"label":"Num 6", "x":20.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Num 1", "x":18.5, "y":4.5}, + {"label":"Num 2", "x":19.5, "y":4.5}, + {"label":"Num 3", "x":20.5, "y":4.5}, + {"label":"Num Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"Num 0", "x":18.5, "y":5.5, "w":2}, + {"label":"Num .", "x":20.5, "y":5.5} + ] + }, + "LAYOUT_jis": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"JIS Hankaku / Zenkaku", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"ˆ", "x":12, "y":1.5}, + {"label":"JIS Yen", "x":13, "y":1.5}, + {"label":"Back Space", "x":14, "y":1.5}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"Num /", "x":19.5, "y":1.5}, + {"label":"Num *", "x":20.5, "y":1.5}, + {"label":"Num -", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"@", "x":11.5, "y":2.5}, + {"label":"[", "x":12.5, "y":2.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Num 7", "x":18.5, "y":2.5}, + {"label":"Num 8", "x":19.5, "y":2.5}, + {"label":"Num 9", "x":20.5, "y":2.5}, + {"label":"Num +", "x":21.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":":", "x":11.75, "y":3.5}, + {"label":"]", "x":12.75, "y":3.5}, + {"label":"Num 4", "x":18.5, "y":3.5}, + {"label":"Num 5", "x":19.5, "y":3.5}, + {"label":"Num 6", "x":20.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"JIS \\", "x":12.25, "y":4.5}, + {"label":"Shift", "x":13.25, "y":4.5, "w":1.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Num 1", "x":18.5, "y":4.5}, + {"label":"Num 2", "x":19.5, "y":4.5}, + {"label":"Num 3", "x":20.5, "y":4.5}, + {"label":"Num Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"JIS Muhenkan", "x":3.75, "y":5.5, "w":1.25}, + {"label":"Space", "x":5, "y":5.5, "w":2.5}, + {"label":"JIS Henkan", "x":7.5, "y":5.5, "w":1.25}, + {"label":"JIS Hiragana / Katakana", "x":8.75, "y":5.5, "w":1.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"Num 0", "x":18.5, "y":5.5, "w":2}, + {"label":"Num .", "x":20.5, "y":5.5} + ] + } + } +} diff --git a/keyboards/converter/usb_usb/keymaps/ble/keymap.c b/keyboards/converter/usb_usb/keymaps/ble/keymap.c index 094bd95693f..190b3319fe9 100644 --- a/keyboards/converter/usb_usb/keymaps/ble/keymap.c +++ b/keyboards/converter/usb_usb/keymaps/ble/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching @@ -36,9 +36,9 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| * `-----------------------------------------------------------' `-----------' `---------------' `-------' */ - [0] = KEYMAP_ALL( + [0] = LAYOUT_all( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MENU, KC_UNDO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PCMM, KC_SLCT, KC_COPY, @@ -47,18 +47,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - default: - return MACRO_NONE; - } -}; - - void matrix_init_user(void) { } diff --git a/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c b/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c index 0cc66fd53dc..6dfd1ad79e6 100644 --- a/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c +++ b/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching @@ -36,7 +36,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| * `-----------------------------------------------------------' `-----------' `---------------' `-------' */ - // KEYMAP_ALL( + // LAYOUT_all( // F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, // ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, // GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -45,17 +45,17 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { // LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, // LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT // ), - KEYMAP_ALL( + LAYOUT_all( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MENU, KC_UNDO, MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PCMM, KC_SLCT, KC_COPY, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE, KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT ), - KEYMAP_ALL( - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + LAYOUT_all( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______, KC_GRV, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, KC_CAPS, KC_MPRV, KC_VOLU, KC_MNXT, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, @@ -65,18 +65,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - default: - return MACRO_NONE; - } -}; - - void matrix_init_user(void) { } @@ -113,7 +101,7 @@ void led_set_user(uint8_t usb_led) { * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .|Ent| * `-----------------------------------------------------------' `-----------' `---------------' */ - KEYMAP( + LAYOUT_ansi( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, @@ -138,13 +126,13 @@ void led_set_user(uint8_t usb_led) { * |Ctl|Gui|Alt| Space |HNK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | * `-----------------------------------------------------------' `-----------' `---------------' */ - KEYMAP_ISO( + LAYOUT_iso( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,ENT, DEL, END, PGDN, P7, P8, P9, PPLS, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6, LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, PENT, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT + LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT ), /* JIS layout @@ -163,13 +151,13 @@ void led_set_user(uint8_t usb_led) { * |Ctl|Gui|Alt|MHEN| Space |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | * `-----------------------------------------------------------' `-----------' `---------------' */ - KEYMAP_JIS( + LAYOUT_jis( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JPY, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, ENT, DEL, END, PGDN, P7, P8, P9, PPLS, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6, LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT, - LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT + LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT ), /* Colemak http://colemak.com @@ -185,7 +173,7 @@ void led_set_user(uint8_t usb_led) { * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| * `----------------------------------------------------------' */ - KEYMAP_ALL( + LAYOUT_all( F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -208,7 +196,7 @@ void led_set_user(uint8_t usb_led) { * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| * `-----------------------------------------------------------' */ - KEYMAP_ALL( + LAYOUT_all( F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -231,7 +219,7 @@ void led_set_user(uint8_t usb_led) { * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| * `-----------------------------------------------------------' */ - KEYMAP_ALL( + LAYOUT_all( F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -265,7 +253,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| * `-----------------------------------------------------------' `-----------' `---------------' `-------' */ - [0] = KEYMAP_ALL( + [0] = LAYOUT_all( F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -288,7 +276,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ - [1] = KEYMAP_ALL( + [1] = LAYOUT_all( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, diff --git a/keyboards/converter/usb_usb/keymaps/default/config.h b/keyboards/converter/usb_usb/keymaps/default/config.h index 7fa3bf328ec..271f48d0011 100644 --- a/keyboards/converter/usb_usb/keymaps/default/config.h +++ b/keyboards/converter/usb_usb/keymaps/default/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/converter/usb_usb/keymaps/default/keymap.c b/keyboards/converter/usb_usb/keymaps/default/keymap.c index 9817a607d38..170ed31ef87 100644 --- a/keyboards/converter/usb_usb/keymaps/default/keymap.c +++ b/keyboards/converter/usb_usb/keymaps/default/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching @@ -36,17 +36,17 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| * `-----------------------------------------------------------' `-----------' `---------------' `-------' */ - [0] = KEYMAP_ALL( + [0] = LAYOUT_all( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MENU, KC_UNDO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PCMM, KC_SLCT, KC_COPY, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE, KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT ), - [1] = KEYMAP_ALL( - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + [1] = LAYOUT_all( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, @@ -56,18 +56,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - default: - return MACRO_NONE; - } -}; - - void matrix_init_user(void) { } diff --git a/keyboards/converter/usb_usb/rules.mk b/keyboards/converter/usb_usb/rules.mk index 7a8f24bb49a..dfe89ee7d94 100644 --- a/keyboards/converter/usb_usb/rules.mk +++ b/keyboards/converter/usb_usb/rules.mk @@ -1,7 +1,6 @@ # MCU name MCU = atmega32u4 - # Processor frequency. # This will define a symbol, F_CPU, in all source code files equal to the # processor frequency in Hz. You can then use this symbol in your source code to @@ -23,7 +22,6 @@ F_CPU ?= 16000000 DEFAULT_FOLDER = converter/usb_usb/hasu - # # LUFA specific # @@ -45,7 +43,7 @@ F_USB = $(F_CPU) # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -55,15 +53,15 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Build Options # comment out to disable the options. # -# BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -# CONSOLE_ENABLE = yes # Console for debug(+400) -# COMMAND_ENABLE = yes # Commands for debug and configuration -# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -# BACKLIGHT_ENABLE = yes -USB_HID_ENABLE = yes +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +#MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +#CONSOLE_ENABLE = yes # Console for debug(+400) +#COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +#BACKLIGHT_ENABLE = yes +USB_HID_ENABLE = yes +CUSTOM_MATRIX = yes -CUSTOM_MATRIX = yes -SRC = custom_matrix.cpp \ No newline at end of file +SRC = custom_matrix.cpp diff --git a/keyboards/converter/usb_usb/usb_usb.h b/keyboards/converter/usb_usb/usb_usb.h index c31fae1d0fa..e0c7c9c0d45 100644 --- a/keyboards/converter/usb_usb/usb_usb.h +++ b/keyboards/converter/usb_usb/usb_usb.h @@ -62,7 +62,7 @@ along with this program. If not, see . * * TODO: use same keycode to pass through instead of KC_NO? */ -#define KEYMAP_ALL( \ +#define LAYOUT_all( \ K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73, \ K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, K81,K80,K7F,K66, K75, \ K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A, K49,K4A,K4B, K53,K54,K55,K56, K78,K79, \ @@ -120,21 +120,21 @@ along with this program. If not, see . * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .|Ent| * `-----------------------------------------------------------' `-----------' `---------------' */ -#define KEYMAP( \ +#define LAYOUT_ansi( \ K29,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, \ K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K31, K4C,K4D,K4E, K5F,K60,K61, \ K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K28, K5C,K5D,K5E,K57, \ KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, KE5, K52, K59,K5A,K5B, \ KE0,KE3,KE2, K2C, KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58 \ -) KEYMAP_ALL( \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,KC_NO, K2A, K49,K4A,K4B, K53,K54,K55,K56, KC_NO, KC_NO, \ - K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, K5F,K60,K61,K57, KC_NO, KC_NO, \ - K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, KC_NO, K28, K5C,K5D,K5E,KC_NO, KC_NO, KC_NO, \ - KE1,KC_NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, KC_NO, KE5, K52, K59,K5A,K5B,KC_NO, KC_NO, KC_NO, \ - KE0,KE3,KE2,KC_NO, KC_NO, K2C, KC_NO, KC_NO, KC_NO, KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58, KC_NO, KC_NO \ +) LAYOUT_all( \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K29, K3A, K3B, K3C, K3D, K3E, K3F, K40, K41, K42, K43, K44, K45, K46, K47, K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K35, K1E, K1F, K20, K21, K22, K23, K24, K25, K26, K27, K2D, K2E, KC_NO, K2A, K49, K4A, K4B, K53, K54, K55, K56, KC_NO, KC_NO, \ + K2B, K14, K1A, K08, K15, K17, K1C, K18, K0C, K12, K13, K2F, K30, K31, K4C, K4D, K4E, K5F, K60, K61, K57, KC_NO, KC_NO, \ + K39, K04, K16, K07, K09, K0A, K0B, K0D, K0E, K0F, K33, K34, KC_NO, K28, K5C, K5D, K5E, KC_NO, KC_NO, KC_NO, \ + KE1, KC_NO, K1D, K1B, K06, K19, K05, K11, K10, K36, K37, K38, KC_NO, KE5, K52, K59, K5A, K5B, KC_NO, KC_NO, KC_NO, \ + KE0, KE3, KE2, KC_NO, KC_NO, K2C, KC_NO, KC_NO, KC_NO, KE6, KE7, K65, KE4, K50, K51, K4F, K62, K63, K58, KC_NO, KC_NO \ ) /* ,---. ,---------------. ,---------------. ,---------------. ,-----------. @@ -152,21 +152,21 @@ along with this program. If not, see . * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | * `-----------------------------------------------------------' `-----------' `---------------' */ -#define KEYMAP_ISO( \ +#define LAYOUT_iso( \ K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, \ K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K28, K4C,K4D,K4E, K5F,K60,K61,K57, \ K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,K32, K5C,K5D,K5E, \ KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, KE5, K52, K59,K5A,K5B,K58, \ KE0,KE3,KE2, K2C, KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63 \ -) KEYMAP_ALL( \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,KC_NO, K2A, K49,K4A,K4B, K53,K54,K55,K56, KC_NO, KC_NO, \ - K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K32, K4C,K4D,K4E, K5F,K60,K61,K57, KC_NO, KC_NO, \ - K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K32,K28, K5C,K5D,K5E,KC_NO, KC_NO, KC_NO, \ - KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, KC_NO, KE5, K52, K59,K5A,K5B,KC_NO, KC_NO, KC_NO, \ - KE0,KE3,KE2,KC_NO, KC_NO, K2C, KC_NO, KC_NO, KC_NO, KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58, KC_NO, KC_NO \ +) LAYOUT_all( \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K29, K3A, K3B, K3C, K3D, K3E, K3F, K40, K41, K42, K43, K44, K45, K46, K47, K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K35, K1E, K1F, K20, K21, K22, K23, K24, K25, K26, K27, K2D, K2E, KC_NO, K2A, K49, K4A, K4B, K53, K54, K55, K56, KC_NO, KC_NO, \ + K2B, K14, K1A, K08, K15, K17, K1C, K18, K0C, K12, K13, K2F, K30, K32, K4C, K4D, K4E, K5F, K60, K61, K57, KC_NO, KC_NO, \ + K39, K04, K16, K07, K09, K0A, K0B, K0D, K0E, K0F, K33, K34, K32, K28, K5C, K5D, K5E, KC_NO, KC_NO, KC_NO, \ + KE1, K64, K1D, K1B, K06, K19, K05, K11, K10, K36, K37, K38, KC_NO, KE5, K52, K59, K5A, K5B, KC_NO, KC_NO, KC_NO, \ + KE0, KE3, KE2, KC_NO, KC_NO, K2C, KC_NO, KC_NO, KC_NO, KE6, KE7, K65, KE4, K50, K51, K4F, K62, K63, K58, KC_NO, KC_NO \ ) /* ,---. ,---------------. ,---------------. ,---------------. ,-----------. @@ -184,20 +184,20 @@ along with this program. If not, see . * |Ctl|Gui|Alt|MHEN| Space |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | * `-----------------------------------------------------------' `-----------' `---------------' */ -#define KEYMAP_JIS( \ +#define LAYOUT_jis( \ K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, \ K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K28, K4C,K4D,K4E, K5F,K60,K61,K57, \ K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,K32, K5C,K5D,K5E, \ KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K87,KE5, K52, K59,K5A,K5B,K58, \ KE0,KE3,KE2,K8B, K2C, K8A,K88,KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63 \ -) KEYMAP_ALL( \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A, K49,K4A,K4B, K53,K54,K55,K56, KC_NO, KC_NO, \ - K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K32, K4C,K4D,K4E, K5F,K60,K61,K57, KC_NO, KC_NO, \ - K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K32,K28, K5C,K5D,K5E,KC_NO, KC_NO, KC_NO, \ - KE1,KC_NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K87,KE5, K52, K59,K5A,K5B,KC_NO, KC_NO, KC_NO, \ - KE0,KE3,KE2,K8B,KC_NO, K2C, KC_NO, K8A,K88,KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58, KC_NO, KC_NO \ +) LAYOUT_all( \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K29, K3A, K3B, K3C, K3D, K3E, K3F, K40, K41, K42, K43, K44, K45, K46, K47, K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K35, K1E, K1F, K20, K21, K22, K23, K24, K25, K26, K27, K2D, K2E, K89, K2A, K49, K4A, K4B, K53, K54, K55, K56, KC_NO, KC_NO, \ + K2B, K14, K1A, K08, K15, K17, K1C, K18, K0C, K12, K13, K2F, K30, K32, K4C, K4D, K4E, K5F, K60, K61, K57, KC_NO, KC_NO, \ + K39, K04, K16, K07, K09, K0A, K0B, K0D, K0E, K0F, K33, K34, K32, K28, K5C, K5D, K5E, KC_NO, KC_NO, KC_NO, \ + KE1, KC_NO, K1D, K1B, K06, K19, K05, K11, K10, K36, K37, K38, K87, KE5, K52, K59, K5A, K5B, KC_NO, KC_NO, KC_NO, \ + KE0, KE3, KE2, K8B, KC_NO, K2C, KC_NO, K8A, K88, KE6, KE7, K65, KE4, K50, K51, K4F, K62, K63, K58, KC_NO, KC_NO \ ) #endif diff --git a/keyboards/converter/xt_usb/config.h b/keyboards/converter/xt_usb/config.h index 963a3c63967..ecebc123fa1 100644 --- a/keyboards/converter/xt_usb/config.h +++ b/keyboards/converter/xt_usb/config.h @@ -31,8 +31,8 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ + get_mods() == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ ) diff --git a/keyboards/converter/xt_usb/info.json b/keyboards/converter/xt_usb/info.json new file mode 100644 index 00000000000..1fde77d1f92 --- /dev/null +++ b/keyboards/converter/xt_usb/info.json @@ -0,0 +1,229 @@ +{ + "keyboard_name": "IBM PC XT", + "keyboard_folder": "converter/xt_usb", + "url": "", + "maintainer": "qmk", + "width": 21, + "height": 5, + "layouts": { + "LAYOUT_xt": { + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F2", "x":1, "y":0}, + {"label":"Esc", "x":2.25, "y":0}, + {"label":"1", "x":3.25, "y":0}, + {"label":"2", "x":4.25, "y":0}, + {"label":"3", "x":5.25, "y":0}, + {"label":"4", "x":6.25, "y":0}, + {"label":"5", "x":7.25, "y":0}, + {"label":"6", "x":8.25, "y":0}, + {"label":"7", "x":9.25, "y":0}, + {"label":"8", "x":10.25, "y":0}, + {"label":"9", "x":11.25, "y":0}, + {"label":"0", "x":12.25, "y":0}, + {"label":"-", "x":13.25, "y":0}, + {"label":"=", "x":14.25, "y":0}, + {"label":"Backspace", "x":15.25, "y":0, "w":1.75}, + {"label":"Num Lock", "x":17, "y":0, "w":2}, + {"label":"Scroll Lock", "x":19, "y":0, "w":2}, + {"label":"F3", "x":0, "y":1}, + {"label":"F4", "x":1, "y":1}, + {"label":"Tab", "x":2.25, "y":1, "w":1.5}, + {"label":"Q", "x":3.75, "y":1}, + {"label":"W", "x":4.75, "y":1}, + {"label":"E", "x":5.75, "y":1}, + {"label":"R", "x":6.75, "y":1}, + {"label":"T", "x":7.75, "y":1}, + {"label":"Y", "x":8.75, "y":1}, + {"label":"U", "x":9.75, "y":1}, + {"label":"I", "x":10.75, "y":1}, + {"label":"O", "x":11.75, "y":1}, + {"label":"P", "x":12.75, "y":1}, + {"label":"[", "x":13.75, "y":1}, + {"label":"]", "x":14.75, "y":1}, + {"label":"7", "x":17, "y":1}, + {"label":"8", "x":18, "y":1}, + {"label":"9", "x":19, "y":1}, + {"label":"-", "x":20, "y":1}, + {"label":"F5", "x":0, "y":2}, + {"label":"F6", "x":1, "y":2}, + {"label":"Ctrl", "x":2.25, "y":2, "w":1.75}, + {"label":"A", "x":4, "y":2}, + {"label":"S", "x":5, "y":2}, + {"label":"D", "x":6, "y":2}, + {"label":"F", "x":7, "y":2}, + {"label":"G", "x":8, "y":2}, + {"label":"H", "x":9, "y":2}, + {"label":"J", "x":10, "y":2}, + {"label":"K", "x":11, "y":2}, + {"label":"L", "x":12, "y":2}, + {"label":";", "x":13, "y":2}, + {"label":"'", "x":14, "y":2}, + {"label":"`", "x":15, "y":2}, + {"label":"Enter", "x":16, "y":1, "h":2}, + {"label":"4", "x":17, "y":2}, + {"label":"5", "x":18, "y":2}, + {"label":"6", "x":19, "y":2}, + {"label":"F7", "x":0, "y":3}, + {"label":"F8", "x":1, "y":3}, + {"label":"Shift", "x":2.25, "y":3, "w":1.25}, + {"label":"\\", "x":3.5, "y":3}, + {"label":"Z", "x":4.5, "y":3}, + {"label":"X", "x":5.5, "y":3}, + {"label":"C", "x":6.5, "y":3}, + {"label":"V", "x":7.5, "y":3}, + {"label":"B", "x":8.5, "y":3}, + {"label":"N", "x":9.5, "y":3}, + {"label":"M", "x":10.5, "y":3}, + {"label":",", "x":11.5, "y":3}, + {"label":".", "x":12.5, "y":3}, + {"label":"/", "x":13.5, "y":3}, + {"label":"Shift", "x":14.5, "y":3, "w":1.5}, + {"label":"Print Screen", "x":16, "y":3}, + {"label":"1", "x":17, "y":3}, + {"label":"2", "x":18, "y":3}, + {"label":"3", "x":19, "y":3}, + {"label":"+", "x":20, "y":2, "h":3}, + {"label":"F9", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + {"label":"Alt", "x":2.25, "y":4, "w":2}, + {"label":"Space", "x":4.25, "y":4, "w":9.75}, + {"label":"Caps Lock", "x":14, "y":4, "w":2}, + {"label":"0", "x":16, "y":4, "w":2}, + {"label":".", "x":18, "y":4, "w":2} + ] + }, + "LAYOUT": { + "layout": [ + {"label":"F13", "x":2, "y":0}, + {"label":"F14", "x":3, "y":0}, + {"label":"F15", "x":4, "y":0}, + {"label":"F16", "x":5, "y":0}, + {"label":"F17", "x":6, "y":0}, + {"label":"F18", "x":7, "y":0}, + {"label":"F19", "x":8, "y":0}, + {"label":"F20", "x":9, "y":0}, + {"label":"F21", "x":10, "y":0}, + {"label":"F22", "x":11, "y":0}, + {"label":"F23", "x":12, "y":0}, + {"label":"F24", "x":13, "y":0}, + {"label":"Esc", "x":0, "y":1}, + {"label":"F1", "x":2, "y":1}, + {"label":"F2", "x":3, "y":1}, + {"label":"F3", "x":4, "y":1}, + {"label":"F4", "x":5, "y":1}, + {"label":"F5", "x":6, "y":1}, + {"label":"F6", "x":7, "y":1}, + {"label":"F7", "x":8, "y":1}, + {"label":"F8", "x":9, "y":1}, + {"label":"F9", "x":10, "y":1}, + {"label":"F10", "x":11, "y":1}, + {"label":"F11", "x":12, "y":1}, + {"label":"F12", "x":13, "y":1}, + {"label":"Print Screen", "x":15.25, "y":1}, + {"label":"Scroll Lock", "x":16.25, "y":1}, + {"label":"Pause", "x":17.25, "y":1}, + {"label":"Volume Down", "x":19.5, "y":1}, + {"label":"Volume Up", "x":20.5, "y":1}, + {"label":"Mute", "x":21.5, "y":1}, + {"label":"`", "x":0, "y":2.5}, + {"label":"1", "x":1, "y":2.5}, + {"label":"2", "x":2, "y":2.5}, + {"label":"3", "x":3, "y":2.5}, + {"label":"4", "x":4, "y":2.5}, + {"label":"5", "x":5, "y":2.5}, + {"label":"6", "x":6, "y":2.5}, + {"label":"7", "x":7, "y":2.5}, + {"label":"8", "x":8, "y":2.5}, + {"label":"9", "x":9, "y":2.5}, + {"label":"0", "x":10, "y":2.5}, + {"label":"-", "x":11, "y":2.5}, + {"label":"=", "x":12, "y":2.5}, + {"label":"JP Yen", "x":13, "y":2.5}, + {"label":"Back Space", "x":14, "y":2.5}, + {"label":"Insert", "x":15.25, "y":2.5}, + {"label":"Home", "x":16.25, "y":2.5}, + {"label":"Page Up", "x":17.25, "y":2.5}, + {"label":"Num Lock", "x":18.5, "y":2.5}, + {"label":"KP/", "x":19.5, "y":2.5}, + {"label":"KP*", "x":20.5, "y":2.5}, + {"label":"KP-", "x":21.5, "y":2.5}, + {"label":"Tab", "x":0, "y":3.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":3.5}, + {"label":"W", "x":2.5, "y":3.5}, + {"label":"E", "x":3.5, "y":3.5}, + {"label":"R", "x":4.5, "y":3.5}, + {"label":"T", "x":5.5, "y":3.5}, + {"label":"Y", "x":6.5, "y":3.5}, + {"label":"U", "x":7.5, "y":3.5}, + {"label":"I", "x":8.5, "y":3.5}, + {"label":"O", "x":9.5, "y":3.5}, + {"label":"P", "x":10.5, "y":3.5}, + {"label":"[", "x":11.5, "y":3.5}, + {"label":"]", "x":12.5, "y":3.5}, + {"label":"\\", "x":13.5, "y":3.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":3.5}, + {"label":"End", "x":16.25, "y":3.5}, + {"label":"Page Down", "x":17.25, "y":3.5}, + {"label":"KP 7", "x":18.5, "y":3.5}, + {"label":"KP 8", "x":19.5, "y":3.5}, + {"label":"KP 9", "x":20.5, "y":3.5}, + {"label":"KP+", "x":21.5, "y":3.5}, + {"label":"Caps Lock", "x":0, "y":4.5, "w":1.75}, + {"label":"A", "x":1.75, "y":4.5}, + {"label":"S", "x":2.75, "y":4.5}, + {"label":"D", "x":3.75, "y":4.5}, + {"label":"F", "x":4.75, "y":4.5}, + {"label":"G", "x":5.75, "y":4.5}, + {"label":"H", "x":6.75, "y":4.5}, + {"label":"J", "x":7.75, "y":4.5}, + {"label":"K", "x":8.75, "y":4.5}, + {"label":"L", "x":9.75, "y":4.5}, + {"label":";", "x":10.75, "y":4.5}, + {"label":"'", "x":11.75, "y":4.5}, + {"label":"ISO #", "x":12.75, "y":4.5}, + {"label":"Enter", "x":13.75, "y":4.5, "w":1.25}, + {"label":"KP 4", "x":18.5, "y":4.5}, + {"label":"KP 5", "x":19.5, "y":4.5}, + {"label":"KP 6", "x":20.5, "y":4.5}, + {"label":"KP ,", "x":21.5, "y":4.5}, + {"label":"Shift", "x":0, "y":5.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":5.5}, + {"label":"Z", "x":2.25, "y":5.5}, + {"label":"X", "x":3.25, "y":5.5}, + {"label":"C", "x":4.25, "y":5.5}, + {"label":"V", "x":5.25, "y":5.5}, + {"label":"B", "x":6.25, "y":5.5}, + {"label":"N", "x":7.25, "y":5.5}, + {"label":"M", "x":8.25, "y":5.5}, + {"label":",", "x":9.25, "y":5.5}, + {"label":".", "x":10.25, "y":5.5}, + {"label":"/", "x":11.25, "y":5.5}, + {"label":"JP RO", "x":12.25, "y":5.5}, + {"label":"Shift", "x":13.25, "y":5.5, "w":1.75}, + {"label":"Up", "x":16.25, "y":5.5}, + {"label":"KP 1", "x":18.5, "y":5.5}, + {"label":"KP 2", "x":19.5, "y":5.5}, + {"label":"KP 3", "x":20.5, "y":5.5}, + {"label":"KP Enter", "x":21.5, "y":5.5}, + {"label":"Ctrl", "x":0, "y":6.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":6.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":6.5, "w":1.25}, + {"label":"Muhenkan", "x":3.75, "y":6.5, "w":1.25}, + {"label":"Space", "x":5, "y":6.5, "w":3.25}, + {"label":"Henkan", "x":8.25, "y":6.5, "w":1.25}, + {"label":"Kana", "x":9.5, "y":6.5, "w":1.25}, + {"label":"Alt", "x":10.75, "y":6.5}, + {"label":"GUI", "x":11.75, "y":6.5}, + {"label":"Menu", "x":12.75, "y":6.5}, + {"label":"Ctrl", "x":13.75, "y":6.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":6.5}, + {"label":"Down", "x":16.25, "y":6.5}, + {"label":"Right", "x":17.25, "y":6.5}, + {"label":"KP 0", "x":18.5, "y":6.5, "w":2}, + {"label":"KP .", "x":20.5, "y":6.5}, + {"label":"KP =", "x":21.5, "y":6.5} + ] + } + } +} diff --git a/keyboards/converter/xt_usb/rules.mk b/keyboards/converter/xt_usb/rules.mk index 0b8731f3263..1f96251830f 100644 --- a/keyboards/converter/xt_usb/rules.mk +++ b/keyboards/converter/xt_usb/rules.mk @@ -14,7 +14,6 @@ MCU = atmega32u4 # software delays. F_CPU = 16000000 - # # LUFA specific # @@ -42,21 +41,19 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # BOOTLOADER = caterina # Pro Micro BOOTLOADER = halfkay # Teensy - # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # USB Nkey Rollover -XT_ENABLE = yes -CUSTOM_MATRIX = yes +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover +XT_ENABLE = yes +CUSTOM_MATRIX = yes +SRC = matrix.c led.c # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax - -SRC = matrix.c led.c diff --git a/keyboards/coseyfannitutti/mullet/config.h b/keyboards/coseyfannitutti/mullet/config.h new file mode 100644 index 00000000000..2025cb43330 --- /dev/null +++ b/keyboards/coseyfannitutti/mullet/config.h @@ -0,0 +1,171 @@ +/* +Copyright 2019 COSEYFANNITUTTI + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6969 +#define DEVICE_VER 0x0001 +#define MANUFACTURER coseyfannitutti +#define PRODUCT mullet +#define DESCRIPTION 65% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, B0, F0, F1 } +#define MATRIX_COL_PINS { B2, F4, F5, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4, D2, D3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D5 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_SLEEP +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/coseyfannitutti/mullet/info.json b/keyboards/coseyfannitutti/mullet/info.json new file mode 100644 index 00000000000..a6088863336 --- /dev/null +++ b/keyboards/coseyfannitutti/mullet/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "mullet", + "url": "https://github.com/coseyfannitutti/mullet", + "maintainer": "coseyfannitutti", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Insert", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Page Up", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Page Down", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Fn", "x":11.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/coseyfannitutti/mullet/keymaps/alternate/keymap.c b/keyboards/coseyfannitutti/mullet/keymaps/alternate/keymap.c new file mode 100644 index 00000000000..21ca2ffb636 --- /dev/null +++ b/keyboards/coseyfannitutti/mullet/keymaps/alternate/keymap.c @@ -0,0 +1,68 @@ +/* Copyright 2019 COSEYFANNITUTTI + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 + + /* Qwerty + * .---------------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | Del | + * |---------------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | PgUp| + * |---------------------------------------------------------------------------------------------+ + * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | PgDn| + * |---------------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | Fn | + * |---------------------------------------------------------------------------------------------+ + * | Ctrl | Win | Alt | Space | RAlt | Fn |||||Left |Down |Right| + * '---------------------------------------------------------------------------------------------' + */ + + /* FnLayer + * .---------------------------------------------------------------------------------------------. + * | ` ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Delete | | + * |---------------------------------------------------------------------------------------------+ + * | Tab |STATC|BRTHE|RNBOW|RESET| | | | | | |PrScr| | \ | Home| + * |---------------------------------------------------------------------------------------------+ + * | Caps |RGBH+|RGBS+|RGBB+| | | | | | | | | Enter | End | + * |---------------------------------------------------------------------------------------------+ + * | Shift |RGBH-|RGBS-|RGBB-| | | | |RGBM-|RGBM+|RGBTG| Shift |VolUp| | + * |---------------------------------------------------------------------------------------------+ + * | Ctrl | Win | Alt | | RAlt | Fn ||||| |VolDn| | + * '---------------------------------------------------------------------------------------------' + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(_FL), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_LEFT, KC_DOWN, KC_RIGHT), + + [_FL] = LAYOUT( + /* esc 1 2 3 4 5 6 7 8 9 0 - = bkspc delete */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_PSCR, + /* tab Q W E R T Y U I O P [ ] \ pg up */ + KC_TRNS, RGB_M_P, RGB_M_B, RGB_M_R, RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_BSLS, KC_HOME, + /* caps A S D F G H J K L ; ' enter pg dn */ + KC_TRNS, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_END, + /* shift Z X C V B N M , . / shift up fn */ + KC_LSFT, RGB_HUD, RGB_SAD, RGB_VAD,KC_TRNS,KC_TRNS,KC_TRNS,KC_MUTE,RGB_RMOD, RGB_MOD, RGB_TOG, KC_RSFT, KC_VOLU, KC_TRNS, + /* ctrl win alt space alt fn left down right */ + KC_LCTL, KC_LGUI, KC_LALT, KC_TRNS, KC_RALT, KC_TRNS, KC_TRNS, KC_VOLD, KC_TRNS) +}; diff --git a/keyboards/coseyfannitutti/mullet/keymaps/default/keymap.c b/keyboards/coseyfannitutti/mullet/keymaps/default/keymap.c new file mode 100644 index 00000000000..07d939dfdc1 --- /dev/null +++ b/keyboards/coseyfannitutti/mullet/keymaps/default/keymap.c @@ -0,0 +1,68 @@ +/* Copyright 2019 COSEYFANNITUTTI + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 + + /* Qwerty + * .---------------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | Ins | + * |---------------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Del | + * |---------------------------------------------------------------------------------------------+ + * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | PgUp| + * |---------------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | U | Pgdn| + * |---------------------------------------------------------------------------------------------+ + * | Ctrl | Win | Alt | Space | RAlt | FN ||||| L | D | R | + * '---------------------------------------------------------------------------------------------' + */ + + /* FnLayer + * .---------------------------------------------------------------------------------------------. + * | ` ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE |PNTSC| + * |---------------------------------------------------------------------------------------------+ + * | Tab |STATC|BRTHE|RNBOW|RESET| | | | | | |PAUSE| | \ | | + * |---------------------------------------------------------------------------------------------+ + * | Caps |RGBH+|RGBS+|RGBB+| | | | | | | | INS | Enter | HOME| + * |---------------------------------------------------------------------------------------------+ + * | Shift |RGBH-|RGBS-|RGBB-| | | | |RGBM-|RGBM+|RGBTG| Shift |VOLUP| END | + * |---------------------------------------------------------------------------------------------+ + * | Ctrl | Win | Alt | | RAlt | FN ||||| L |VOLDN| R | + * '---------------------------------------------------------------------------------------------' + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_LEFT, KC_DOWN, KC_RIGHT), + + [_FL] = LAYOUT( + /* esc 1 2 3 4 5 6 7 8 9 0 - = bkspc insert*/ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_PSCR, + /* tab Q W E R T Y U I O P [ ] \ delete*/ + KC_TRNS, RGB_M_P, RGB_M_B, RGB_M_R, RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, KC_BSLS, KC_TRNS, + /* caps A S D F G H J K L ; ' enter pg up*/ + KC_TRNS, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, + /* shift Z X C V B N M , . / shift up pg dn*/ + KC_LSFT, RGB_HUD, RGB_SAD, RGB_VAD,KC_TRNS,KC_TRNS,KC_TRNS,KC_MUTE,RGB_RMOD, RGB_MOD, RGB_TOG, KC_RSFT, KC_VOLU, KC_END, + /* ctrl win alt space alt fn left down right*/ + KC_LCTL, KC_LGUI, KC_LALT, KC_TRNS, KC_RALT, KC_TRNS, KC_TRNS, KC_VOLD, KC_TRNS) +}; diff --git a/keyboards/coseyfannitutti/mullet/mullet.c b/keyboards/coseyfannitutti/mullet/mullet.c new file mode 100644 index 00000000000..4f451f3dbb1 --- /dev/null +++ b/keyboards/coseyfannitutti/mullet/mullet.c @@ -0,0 +1,23 @@ +/* Copyright 2019 COSEYFANNITUTTI + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "mullet.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} diff --git a/keyboards/coseyfannitutti/mullet/mullet.h b/keyboards/coseyfannitutti/mullet/mullet.h new file mode 100644 index 00000000000..848fd19226f --- /dev/null +++ b/keyboards/coseyfannitutti/mullet/mullet.h @@ -0,0 +1,42 @@ +/* Copyright 2019 COSEYFANNITUTTI + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define _x_ KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E \ +) { \ +{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ +{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ +{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, _x_, K2D, K2E }, \ +{ K30, _x_, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ +{ K40, K41, K42, _x_, _x_, _x_, K46, _x_, _x_, _x_, K4A, K4B, K4C, K4D, K4E} \ +} diff --git a/keyboards/coseyfannitutti/mullet/readme.md b/keyboards/coseyfannitutti/mullet/readme.md new file mode 100644 index 00000000000..45c17fb5ba6 --- /dev/null +++ b/keyboards/coseyfannitutti/mullet/readme.md @@ -0,0 +1,15 @@ +# mullet + +![mullet](https://i.imgur.com/EBOMbhH.jpg) + +A 68 key keyboard with USB Type-C and RGB underglow + +Keyboard Maintainer: [coseyfannitutti](https://github.com/coseyfannitutti) +Hardware Supported: Mullet, atmega32u4 +Hardware Availability: https://github.com/coseyfannitutti/mullet + +Make example for this keyboard (after setting up your build environment): + + make coseyfannitutti/mullet:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/coseyfannitutti/mullet/rules.mk b/keyboards/coseyfannitutti/mullet/rules.mk new file mode 100644 index 00000000000..fa02fe6fce9 --- /dev/null +++ b/keyboards/coseyfannitutti/mullet/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/coseyfannitutti/mulletpad/config.h b/keyboards/coseyfannitutti/mulletpad/config.h new file mode 100644 index 00000000000..2174d64925a --- /dev/null +++ b/keyboards/coseyfannitutti/mulletpad/config.h @@ -0,0 +1,171 @@ +/* +Copyright 2019 COSEYFANNITUTTI + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6666 +#define DEVICE_VER 0x0001 +#define MANUFACTURER coseyfannitutti +#define PRODUCT mulletpad +#define DESCRIPTION numpad + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F4, F1, F5, F6, F7 } +#define MATRIX_COL_PINS { F0, C7, C6, B6, } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +//#define RGB_DI_PIN D5 +//#ifdef RGB_DI_PIN +//#define RGBLIGHT_ANIMATIONS +//#define RGBLED_NUM 8 +//#define RGBLIGHT_HUE_STEP 8 +//#define RGBLIGHT_SAT_STEP 8 +//#define RGBLIGHT_VAL_STEP 8 +//#define RGBLIGHT_SLEEP +//#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/coseyfannitutti/mulletpad/info.json b/keyboards/coseyfannitutti/mulletpad/info.json new file mode 100644 index 00000000000..7115bc75122 --- /dev/null +++ b/keyboards/coseyfannitutti/mulletpad/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "mulletpad", + "url": "https://github.com/coseyfannitutti/mulletpad", + "maintainer": "coseyfannitutti", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT_numpad_5x4": { + "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "y":1, "h":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"0", "x":0, "y":4, "w":2}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":3, "h":2}] + } + } +} diff --git a/keyboards/coseyfannitutti/mulletpad/keymaps/default/keymap.c b/keyboards/coseyfannitutti/mulletpad/keymaps/default/keymap.c new file mode 100644 index 00000000000..ffdc1044dff --- /dev/null +++ b/keyboards/coseyfannitutti/mulletpad/keymaps/default/keymap.c @@ -0,0 +1,27 @@ +/* Copyright 2019 COSEYFANNITUTTI + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _BL 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_numpad_5x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, + KC_P0, KC_PDOT, KC_PENT ) +}; diff --git a/keyboards/coseyfannitutti/mulletpad/mulletpad.c b/keyboards/coseyfannitutti/mulletpad/mulletpad.c new file mode 100644 index 00000000000..be335cc547c --- /dev/null +++ b/keyboards/coseyfannitutti/mulletpad/mulletpad.c @@ -0,0 +1,23 @@ +/* Copyright 2019 COSEYFANNITUTTI + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "mulletpad.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} diff --git a/keyboards/coseyfannitutti/mulletpad/mulletpad.h b/keyboards/coseyfannitutti/mulletpad/mulletpad.h new file mode 100644 index 00000000000..41c5c014a98 --- /dev/null +++ b/keyboards/coseyfannitutti/mulletpad/mulletpad.h @@ -0,0 +1,42 @@ +/* Copyright 2019 COSEYFANNITUTTI + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define _x_ KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_numpad_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, \ + K20, K21, K22, K23, \ + K30, K31, K32, \ + K40, K42, K43 \ +) { \ +{ K00, K01, K02, K03, }, \ +{ K10, K11, K12, _x_, }, \ +{ K20, K21, K22, K23, }, \ +{ K30, K31, K32, _x_, }, \ +{ K40, _x_, K42, K43, }, \ +} diff --git a/keyboards/coseyfannitutti/mulletpad/readme.md b/keyboards/coseyfannitutti/mulletpad/readme.md new file mode 100644 index 00000000000..9ee49ca96cb --- /dev/null +++ b/keyboards/coseyfannitutti/mulletpad/readme.md @@ -0,0 +1,15 @@ +# mulletpad + +![mulletpad](https://i.imgur.com/MHKo5f5.png) + +A 17-key numpad with USB Type-C. + +Keyboard Maintainer: [coseyfannitutti](https://github.com/coseyfannitutti) +Hardware Supported: Mulletpad, atmega32u4 +Hardware Availability: https://github.com/coseyfannitutti/mulletpad + +Make example for this keyboard (after setting up your build environment): + + make coseyfannitutti/mulletpad:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/coseyfannitutti/mulletpad/rules.mk b/keyboards/coseyfannitutti/mulletpad/rules.mk new file mode 100644 index 00000000000..b3a473ef4b9 --- /dev/null +++ b/keyboards/coseyfannitutti/mulletpad/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = numpad_5x4 diff --git a/keyboards/cospad/config.h b/keyboards/cospad/config.h index 4bdf434a47d..9844f2724a8 100644 --- a/keyboards/cospad/config.h +++ b/keyboards/cospad/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -32,47 +31,43 @@ along with this program. If not, see . #define MATRIX_ROWS 6 #define MATRIX_COLS 4 -// ROWS: Top to bottom, COLS: Left to right - +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ #define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5 } #define MATRIX_COL_PINS { F0, F1, E6, C7 } #define UNUSED_PINS -#define BACKLIGHT_PIN F7 - /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST +/* Backlight configuration */ +#define BACKLIGHT_PIN F7 +#define BACKLIGHT_LEVELS 1 + +/* Underlight configuration */ +#define RGB_DI_PIN F6 +#define RGBLED_NUM 4 +#define RGBLIGHT_ANIMATIONS -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Backlight configuration - */ -#define BACKLIGHT_LEVELS 4 - -/* Underlight configuration - */ - -#define RGB_DI_PIN F6 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 4 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -91,4 +86,6 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#endif +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/cospad/cospad.c b/keyboards/cospad/cospad.c index 48d752a84b1..e7ef71f874b 100644 --- a/keyboards/cospad/cospad.c +++ b/keyboards/cospad/cospad.c @@ -1,37 +1,33 @@ + +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "cospad.h" -#include "led.h" -extern inline void cospad_bl_led_on(void); -extern inline void cospad_bl_led_off(void); -extern inline void cospad_bl_led_togg(void); +#ifdef BACKLIGHT_ENABLE -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); -}; - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -}; +void backlight_init_ports(void) { + setPinOutput(F7); +} -void led_init_ports(void) { - // * Set our LED pins as output - DDRB |= (1<<2); - DDRF |= (1<<7); - // * Setting BL LEDs to init as off - PORTF |= (1<<7); +void backlight_set(uint8_t level) { + writePin(F7, !!level); } -void led_set_kb(uint8_t usb_led) { - if (usb_led & (1<. + */ +#pragma once #include "quantum.h" +#define ___ KC_NO -// readability -#define XXX KC_NO +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ /* COSPAD ortho matrix layout * ,-------------------. @@ -21,40 +43,6 @@ * | 50 | 51 | 52 | 53 | * `-------------------' */ - -/* COSPAD gamepad matrix layout - * ,-------------------. - * | 00 | 01 | 02 | 03 | - * |----|----|----|----| - * | 10 | 11 | 12 | 13 | - * |----|----|----|----| - * | 20 | 21 | 22 | | - * |----|----|----| 23 | - * | 30 | 31 | 32 | | - * |----|----|----|----| - * | 40 | 41 | 42 | 43 | - * |----|----|----|----| - * | 50 | 51 | 52 | 53 | - * `-------------------' - */ - -/* COSPAD numpad matrix layout - * ,-------------------. - * | 00 | 01 | 02 | 03 | - * |----|----|----|----| - * | 10 | 11 | 12 | 13 | - * |----|----|----|----| - * | 20 | 21 | 22 | | - * |----|----|----| 23 | - * | 30 | 31 | 32 | | - * |----|----|----|----| - * | 40 | 41 | 42 | | - * |----|----|----| 43 | - * | 50 | 52 | | - * `-------------------' - */ -// The first section contains all of the arguments -// The second converts the arguments into a two-dimensional array #define LAYOUT_ortho_6x4( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ @@ -72,6 +60,21 @@ {k50, k51, k52, k53} \ } +/* COSPAD gamepad matrix layout + * ,-------------------. + * | 00 | 01 | 02 | 03 | + * |----|----|----|----| + * | 10 | 11 | 12 | 13 | + * |----|----|----|----| + * | 20 | 21 | 22 | | + * |----|----|----| 23 | + * | 30 | 31 | 32 | | + * |----|----|----|----| + * | 40 | 41 | 42 | 43 | + * |----|----|----|----| + * | 50 | 51 | 52 | 53 | + * `-------------------' + */ #define LAYOUT_gamepad_6x4( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ @@ -84,11 +87,26 @@ {k00, k01, k02, k03}, \ {k10, k11, k12, k13}, \ {k20, k21, k22, k23}, \ - {k30, k31, k32, KC_NO}, \ + {k30, k31, k32, ___}, \ {k40, k41, k42, k43}, \ {k50, k51, k52, k53} \ } +/* COSPAD numpad matrix layout + * ,-------------------. + * | 00 | 01 | 02 | 03 | + * |----|----|----|----| + * | 10 | 11 | 12 | 13 | + * |----|----|----|----| + * | 20 | 21 | 22 | | + * |----|----|----| 23 | + * | 30 | 31 | 32 | | + * |----|----|----|----| + * | 40 | 41 | 42 | | + * |----|----|----| 43 | + * | 50 | 52 | | + * `-------------------' + */ #define LAYOUT_numpad_6x4( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ @@ -98,25 +116,15 @@ k50, k52, k43 \ ) \ { \ - {k00, k01, k02, k03}, \ - {k10, k11, k12, k13}, \ - {k20, k21, k22, k23}, \ - {k30, k31, k32, KC_NO}, \ - {k40, k41, k42, k43}, \ - {k50, KC_NO, k52, KC_NO} \ + {k00, k01, k02, k03}, \ + {k10, k11, k12, k13}, \ + {k20, k21, k22, k23}, \ + {k30, k31, k32, ___}, \ + {k40, k41, k42, k43}, \ + {k50, ___, k52, ___} \ } -void matrix_init_user(void); -void matrix_scan_user(void); -inline void cospad_bl_led_on(void) { PORTF &= ~(1<<7); } -inline void cospad_bl_led_off(void) { PORTF |= (1<<7); } - -inline void cospad_bl_led_togg(void) { - uint8_t bl_mask = PORTF&(1<<7); - if (bl_mask) { - PORTF &= ~(1<<7); - } else { - PORTF |= (1<<7); - } -} -#endif +// Add backwards compatibility for existing keymaps +#define cospad_bl_led_on backlight_enable +#define cospad_bl_led_off backlight_disable +#define cospad_bl_led_togg backlight_toggle diff --git a/keyboards/cospad/info.json b/keyboards/cospad/info.json index 4fd2ea087f2..c17f44f5259 100644 --- a/keyboards/cospad/info.json +++ b/keyboards/cospad/info.json @@ -1,16 +1,95 @@ { - "keyboard_name": "", - "url": "", - "maintainer": "qmk", - "width": 4, - "height": 6, - "layouts": { - "LAYOUT_numpad_6x4": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"Fn", "x":2, "y":0}, {"label":"Back", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"+", "x":3, "y":2, "h":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4, "h":2}, {"label":"0", "x":0, "y":5, "w":2}, {"label":".", "x":2, "y":5}] - }, + "keyboard_name": "Cospad", + "keyboard_folder": "cospad", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 6, + "layouts": { + "LAYOUT_numpad_6x4": { + "key_count": 21, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"Tab", "x":1, "y":0}, + {"label":"Fn", "x":2, "y":0}, + {"label":"Back", "x":3, "y":0}, + {"label":"Num Lock", "x":0, "y":1}, + {"label":"/", "x":1, "y":1}, + {"label":"*", "x":2, "y":1}, + {"label":"-", "x":3, "y":1}, + {"label":"7", "x":0, "y":2}, + {"label":"8", "x":1, "y":2}, + {"label":"9", "x":2, "y":2}, + {"label":"4", "x":0, "y":3}, + {"label":"5", "x":1, "y":3}, + {"label":"6", "x":2, "y":3}, + {"label":"+", "x":3, "y":2, "h":2}, + {"label":"1", "x":0, "y":4}, + {"label":"2", "x":1, "y":4}, + {"label":"3", "x":2, "y":4}, + {"label":"0", "x":0, "y":5, "w":2}, + {"label":".", "x":2, "y":5}, + {"label":"Enter", "x":3, "y":4, "h":2} + ] + }, - "LAYOUT_ortho_6x4": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"Fn", "x":2, "y":0}, {"label":"Back", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"+", "x":3, "y":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"x":3, "y":3}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}, {"label":"0", "x":0, "y":5}, {"x":1, "y":5}, {"label":".", "x":2, "y":5}, {"x":3, "y":5}] - } + "LAYOUT_gamepad_6x4": { + "key_count": 23, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k23", "x":3, "y":2, "h":2}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k50", "x":0, "y":5}, + {"label":"k51", "x":1, "y":5}, + {"label":"k52", "x":2, "y":5}, + {"label":"k53", "x":3, "y":5} + ] + }, + + "LAYOUT_ortho_6x4": { + "key_count": 24, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k50", "x":0, "y":5}, + {"label":"k51", "x":1, "y":5}, + {"label":"k52", "x":2, "y":5}, + {"label":"k53", "x":3, "y":5} + ] } -} \ No newline at end of file + } +} diff --git a/keyboards/cospad/keymaps/default/keymap.c b/keyboards/cospad/keymaps/default/keymap.c index 3cea2f8e635..adcca112d23 100644 --- a/keyboards/cospad/keymaps/default/keymap.c +++ b/keyboards/cospad/keymaps/default/keymap.c @@ -1,91 +1,60 @@ #include QMK_KEYBOARD_H -#include "led.h" - -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -#define _BL 0 -#define _FL 1 - -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: (Base Layer) Default Layer - * ,-------------------. - * |Esc |TAB | FN | BS | - * |----|----|----|----| - * | NL | / | * | - | - * |----|----|----|----| - * | 7 | 8 | 9 | | - * |----|----|----| + | - * | 4 | 5 | 6 | | - * |----|----|----|----| - * | 1 | 2 | 3 | | - * |----|----|----| En | - * | 0 | . | | - * `-------------------' - */ - -[_BL] = LAYOUT_numpad_6x4( - KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \ - KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ - KC_P7, KC_P8, KC_P9, \ - KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_P1, KC_P2, KC_P3, \ - KC_P0, KC_PDOT, KC_PENT), - - /* Keymap _FL: Function Layer - * ,-------------------. - * |RGBT|TAB | FN | BS | - * |----|----|----|----| - * |RGBM|RGBP|BTOG| - | - * |----|----|----|----| - * |HUD |HUI |BON | | - * |----|----|----| + | - * |SAD |SAI |BOFF| | - * |----|----|----|----| - * |VAD |VAS | 3 | | - * |----|----|----| En | - * | 0 |RST | | - * `-------------------' - */ -[_FL] = LAYOUT_numpad_6x4( - RGB_TOG, KC_TAB, KC_TRNS, KC_BSPC, \ - RGB_MOD, RGB_M_P, BL_TOGG, KC_PMNS, \ - RGB_HUD, RGB_HUI, BL_ON, \ - RGB_SAD, RGB_SAI, BL_OFF, KC_PPLS, \ - RGB_VAD, RGB_VAI, KC_P3, \ - KC_P0, RESET, KC_PENT), +enum layers { + _BL = 0, + _FL }; - -const uint16_t PROGMEM fn_actions[] = { - [0] = MO(_FL), +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap _BL: (Base Layer) Default Layer + * ,-------------------. + * |Esc |TAB | FN | BS | + * |----|----|----|----| + * | NL | / | * | - | + * |----|----|----|----| + * | 7 | 8 | 9 | | + * |----|----|----| + | + * | 4 | 5 | 6 | | + * |----|----|----|----| + * | 1 | 2 | 3 | | + * |----|----|----| En | + * | 0 | . | | + * `-------------------' + */ + [_BL] = LAYOUT_numpad_6x4( + KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, \ + KC_P0, KC_PDOT, KC_PENT + ), + +/* Keymap _FL: Function Layer + * ,-------------------. + * |RGBT| | | | + * |----|----|----|----| + * |RGBM|RGBP|BTOG| | + * |----|----|----|----| + * |HUD |HUI |BON | | + * |----|----|----| | + * |SAD |SAI |BOFF| | + * |----|----|----|----| + * |VAD |VAS |BSTP| | + * |----|----|----| | + * | |RST | | + * `-------------------' + */ + [_FL] = LAYOUT_numpad_6x4( + RGB_TOG, _______, _______, _______, \ + RGB_MOD, RGB_M_P, BL_TOGG, _______, \ + RGB_HUD, RGB_HUI, BL_ON, \ + RGB_SAD, RGB_SAI, BL_OFF, _______, \ + RGB_VAD, RGB_VAI, BL_STEP, \ + _______, RESET, _______ + ), }; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case BL_TOGG: - if (record->event.pressed) { - cospad_bl_led_togg(); - } - return false; - case BL_ON: - if (record->event.pressed) { - cospad_bl_led_on(); - } - return false; - case BL_OFF: - if(record->event.pressed) { - cospad_bl_led_off(); - } - return false; - default: - return true; - } -} diff --git a/keyboards/cospad/keymaps/detrus/keymap.c b/keyboards/cospad/keymaps/detrus/keymap.c index f9eddc2a87a..93f95bb01ef 100644 --- a/keyboards/cospad/keymaps/detrus/keymap.c +++ b/keyboards/cospad/keymaps/detrus/keymap.c @@ -6,8 +6,6 @@ #include "rgblight.h" #endif -#define _______ KC_TRNS - // Each layer gets a name for readability, which is then used in the keymap matrix below. enum cospad_layers { _QWERTY_LAYER, diff --git a/keyboards/cospad/readme.md b/keyboards/cospad/readme.md index 436b87dcee6..2e9add691f1 100644 --- a/keyboards/cospad/readme.md +++ b/keyboards/cospad/readme.md @@ -4,8 +4,8 @@ COSPAD A DIY Keypad Kit sold by KPRepublic, runs TKG natively. Keyboard Maintainer: QMK Community -Hardware Supported: COSPAD -Hardware Availability: https://aliexpress.com/item/cospad-Custom-Mechanical-Keyboard-Kit-up-tp-24-keys-Supports-TKG-TOOLS-Underglow-RGB-PCB-20/32818383873.html +Hardware Supported: COSPAD +Hardware Availability: [KPrepublic on Aliexpress](https://aliexpress.com/item/cospad-Custom-Mechanical-Keyboard-Kit-up-tp-24-keys-Supports-TKG-TOOLS-Underglow-RGB-PCB-20/32818383873.html) Only supports on and off for the backlight leds, as they are not connected to a PWM pin. @@ -18,4 +18,4 @@ Make example for this keyboard (after setting up your build environment): make cospad:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cospad/rules.mk b/keyboards/cospad/rules.mk index 3c5913d0d91..61c7a5182ce 100644 --- a/keyboards/cospad/rules.mk +++ b/keyboards/cospad/rules.mk @@ -1,6 +1,5 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -40,27 +39,43 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + # Boot Section Size in *bytes* # Teensy halfKay 512 # Teensy++ halfKay 1024 # Atmel DFU loader 4096 # LUFA bootloader 4096 # USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BACKLIGHT_CUSTOM_DRIVER = yes +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + + +LAYOUTS = numpad_6x4 ortho_6x4 diff --git a/keyboards/crawlpad/config.h b/keyboards/crawlpad/config.h index c72be83f28d..d51ad174442 100755 --- a/keyboards/crawlpad/config.h +++ b/keyboards/crawlpad/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -27,7 +26,7 @@ #define DIODE_DIRECTION ROW2COL /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -45,5 +44,3 @@ #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 3 #endif - -#endif diff --git a/keyboards/crawlpad/crawlpad.h b/keyboards/crawlpad/crawlpad.h index 74416c6b1ab..572907c2563 100755 --- a/keyboards/crawlpad/crawlpad.h +++ b/keyboards/crawlpad/crawlpad.h @@ -1,9 +1,8 @@ -#ifndef KB_H -#define KB_H +#pragma once #include "quantum.h" -#define KEYMAP( \ +#define LAYOUT_ortho_4x4( \ K00, K01, K02, K03, \ K10, K11, K12, K13, \ K20, K21, K22, K23, \ @@ -15,4 +14,3 @@ { K30, K31, K32, K33 } \ } -#endif \ No newline at end of file diff --git a/keyboards/crawlpad/crawlpad.json b/keyboards/crawlpad/crawlpad.json deleted file mode 100644 index 3a6eb553d2e..00000000000 --- a/keyboards/crawlpad/crawlpad.json +++ /dev/null @@ -1 +0,0 @@ -{"version":1,"keyboard":{"keys":[{"id":0,"legend":"7\nHome\n\n\n\n\n\nNLCK","state":{"x":0,"y":1,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000\n\n\n\n\n\n\n#0015d4","fa":[0,1,0,0,0,0,0,1]},"row":0,"col":0,"keycodes":[{"id":"KC_P7","fields":[]},{"id":"KC_NLCK","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":1,"legend":"8\n↑\n\n\n\n\n\nBL1","state":{"x":1,"y":1,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000\n\n\n\n\n\n\n#0015d4","fa":[0,0,0,0,0,0,0,1]},"row":0,"col":1,"keycodes":[{"id":"KC_P8","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":2,"legend":"9\nPgUp","state":{"x":2,"y":1,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1]},"row":0,"col":2,"keycodes":[{"id":"KC_P9","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":3,"legend":"+\n\n\n\n\n\n\n/","state":{"x":3,"y":1,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000\n\n\n#020ad1\n\n\n\n#0015d4","fa":[0,0,0,0,0,0,0,1],"f":3},"row":0,"col":3,"keycodes":[{"id":"KC_PPLS","fields":[]},{"id":"KC_PSLS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":4,"legend":"4\n←","state":{"x":0,"y":2,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1],"f":3},"row":1,"col":0,"keycodes":[{"id":"KC_P4","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":5,"legend":"5\n\n\n\n\n\n\nBL2","state":{"x":1,"y":2,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000\n\n\n\n\n\n\n#0015d4","fa":[0,0,0,0,0,0,0,1],"f":3},"row":1,"col":1,"keycodes":[{"id":"KC_P5","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":6,"legend":"6\n→","state":{"x":2,"y":2,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1],"f":3},"row":1,"col":2,"keycodes":[{"id":"KC_P6","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":7,"legend":"-","state":{"x":3,"y":2,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1],"f":3},"row":1,"col":3,"keycodes":[{"id":"KC_PMNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":8,"legend":"1\nEnd","state":{"x":0,"y":3,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1],"f":3},"row":2,"col":0,"keycodes":[{"id":"KC_P1","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":9,"legend":"2\n↓\n\n\n\n\n\nBL3","state":{"x":1,"y":3,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000\n\n\n\n\n\n\n#0015d4","fa":[0,0,0,0,0,0,0,1],"f":3},"row":2,"col":1,"keycodes":[{"id":"KC_P2","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":10,"legend":"3\nPgDn","state":{"x":2,"y":3,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1],"f":3},"row":2,"col":2,"keycodes":[{"id":"KC_P3","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":11,"legend":"*","state":{"x":3,"y":3,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1],"f":3},"row":2,"col":3,"keycodes":[{"id":"KC_PAST","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":12,"legend":"Fn","state":{"x":0,"y":4,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1],"f":3},"row":3,"col":0,"keycodes":[{"id":"MO()","fields":[1]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":13,"legend":"0\nIns\n\n\n\n\n\nBL4","state":{"x":1,"y":4,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000\n\n\n\n\n\n\n#0015d4","fa":[0,0,0,0,0,0,0,1],"f":3},"row":3,"col":1,"keycodes":[{"id":"KC_P0","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":14,"legend":".\nDel","state":{"x":2,"y":4,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1],"f":3},"row":3,"col":2,"keycodes":[{"id":"KC_PDOT","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":15,"legend":"Enter","state":{"x":3,"y":4,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"t":"#000000","fa":[0,0,0,0,0,0,0,1],"f":3},"row":3,"col":3,"keycodes":[{"id":"KC_PENT","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]}],"controller":1,"bounds":{"min":{"x":0,"y":0},"max":{"x":4,"y":4}},"rows":4,"cols":4,"pins":{"row":["F0","F1","F4","F5"],"col":["D4","D5","D6","D7"],"num":null,"caps":null,"scroll":null,"compose":null,"kana":null,"led":null,"rgb":null},"macros":{},"quantum":"void matrix_init_user(void) {\n}\n\nvoid matrix_scan_user(void) {\n}\n\nbool process_record_user(uint16_t keycode, keyrecord_t *record) {\n\treturn true;\n}","settings":{"diodeDirection":1,"name":"Crawlpad","bootloaderSize":2,"rgbNum":0,"backlightLevels":3}}} \ No newline at end of file diff --git a/keyboards/crawlpad/info.json b/keyboards/crawlpad/info.json new file mode 100644 index 00000000000..b243ead304d --- /dev/null +++ b/keyboards/crawlpad/info.json @@ -0,0 +1,29 @@ +{ + "keyboard_name": "Crawlpad", + "url": "", + "maintainer": "colemarkham", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "layout": [ + {"label":"7", "x":0, "y":0}, + {"label":"8", "x":1, "y":0}, + {"label":"9", "x":2, "y":0}, + {"label":"+", "x":3, "y":0}, + {"label":"4", "x":0, "y":1}, + {"label":"5", "x":1, "y":1}, + {"label":"6", "x":2, "y":1}, + {"label":"-", "x":3, "y":1}, + {"label":"1", "x":0, "y":2}, + {"label":"2", "x":1, "y":2}, + {"label":"3", "x":2, "y":2}, + {"label":"*", "x":3, "y":2}, + {"label":"Fn", "x":0, "y":3}, + {"label":"0", "x":1, "y":3}, + {"label":".", "x":2, "y":3}, + {"label":"Enter", "x":3, "y":3} + ] + } + } +} diff --git a/keyboards/crawlpad/keymaps/default/keymap.c b/keyboards/crawlpad/keymaps/default/keymap.c index 49d8bfb1c9f..ec985739f11 100755 --- a/keyboards/crawlpad/keymaps/default/keymap.c +++ b/keyboards/crawlpad/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "../../crawlpad.h" +#include QMK_KEYBOARD_H enum custom_keycodes { BL1 = SAFE_RANGE, @@ -11,17 +11,19 @@ const uint8_t LED_PINS[] = LED_ROW_PINS; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -KEYMAP( - KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_P4, KC_P5, KC_P6, KC_PMNS, - KC_P1, KC_P2, KC_P3, KC_PAST, - MO(1), KC_P0, KC_PDOT, KC_ENT), + [0] = LAYOUT_ortho_4x4( + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_PMNS, + KC_P1, KC_P2, KC_P3, KC_PAST, + MO(1), KC_P0, KC_PDOT, KC_ENT + ), -KEYMAP( - KC_NLCK, BL1, KC_TRNS, KC_PSLS, - RESET, BL2, KC_TRNS, KC_TRNS, - KC_TRNS, BL3, KC_TRNS, KC_TRNS, - KC_TRNS, BL4, KC_TRNS, KC_TRNS), + [1] = LAYOUT_ortho_4x4( + KC_NLCK, BL1, KC_TRNS, KC_PSLS, + RESET, BL2, KC_TRNS, KC_TRNS, + KC_TRNS, BL3, KC_TRNS, KC_TRNS, + KC_TRNS, BL4, KC_TRNS, KC_TRNS + ), }; @@ -35,19 +37,6 @@ void set_led(int idx, bool enable) { } } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - -void matrix_init_user(void) { - /* set LED row pins to output and low */ - DDRB |= (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7); - PORTB &= ~(1 << 4) & ~(1 << 5) & ~(1 << 6) & ~(1 << 7); -} - -void matrix_scan_user(void) { -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case BL1: @@ -82,6 +71,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } +void matrix_init_user(void) { + /* set LED row pins to output and low */ + DDRB |= (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7); + PORTB &= ~(1 << 4) & ~(1 << 5) & ~(1 << 6) & ~(1 << 7); +} + +void matrix_scan_user(void) { +} + void led_set_user(uint8_t usb_led) { if (usb_led & (1 << USB_LED_NUM_LOCK)) { diff --git a/keyboards/crawlpad/readme.md b/keyboards/crawlpad/readme.md index 0bdc0f17224..9eb01b7b616 100644 --- a/keyboards/crawlpad/readme.md +++ b/keyboards/crawlpad/readme.md @@ -1,6 +1,6 @@ # Crawlpad -![Crawlpad](https://imgur.com/8BnztWo) +![Crawlpad](https://i.imgur.com/8BnztWo.jpg) A 4x4 macropad/numpad, exclusively availabe at Keycrawl events. @@ -12,6 +12,4 @@ Make example for this keyboard (after setting up your build environment): make crawlpad:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -For those that prefer a GUI tool, the crawlpad.json file in this repo can be used on [kbfirmware.com](http://kbfirmware.com). \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/crawlpad/rules.mk b/keyboards/crawlpad/rules.mk index 63a6d616aeb..2dda38e2013 100755 --- a/keyboards/crawlpad/rules.mk +++ b/keyboards/crawlpad/rules.mk @@ -44,13 +44,15 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # [Crawlpad] Custom backlighting code is used, so this should not be enabled -AUDIO_ENABLE ?= no # [Crawlpad] This can be enabled if a speaker is connected to the expansion port. Not compatible with RGBLIGHT below -RGBLIGHT_ENABLE ?= no # [Crawlpad] This can be enabled if a ws2812 strip is connected to the expansion port. \ No newline at end of file +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # [Crawlpad] Custom backlighting code is used, so this should not be enabled +AUDIO_ENABLE = no # [Crawlpad] This can be enabled if a speaker is connected to the expansion port. Not compatible with RGBLIGHT below +RGBLIGHT_ENABLE = no # [Crawlpad] This can be enabled if a ws2812 strip is connected to the expansion port. + +LAYOUTS = ortho_4x4 diff --git a/keyboards/crkbd/crkbd.c b/keyboards/crkbd/crkbd.c index 5e8ba8bacf4..7417ad60478 100644 --- a/keyboards/crkbd/crkbd.c +++ b/keyboards/crkbd/crkbd.c @@ -1 +1,9 @@ #include "crkbd.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { +#ifdef SSD1306OLED + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +#else + return process_record_user(keycode, record); +#endif +} diff --git a/keyboards/crkbd/info.json b/keyboards/crkbd/info.json index 45a0255c1ac..d7f6309043b 100644 --- a/keyboards/crkbd/info.json +++ b/keyboards/crkbd/info.json @@ -3,7 +3,7 @@ "url": "", "maintainer": "qmk", "width": 15, - "height": 4.5, + "height": 4.7, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/crkbd/keymaps/default/config.h b/keyboards/crkbd/keymaps/default/config.h index 644e8136509..899fde008de 100644 --- a/keyboards/crkbd/keymaps/default/config.h +++ b/keyboards/crkbd/keymaps/default/config.h @@ -35,10 +35,12 @@ along with this program. If not, see . #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 27 -#define RGBLIGHT_LIMIT_VAL 120 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 +#ifdef RGBLIGHT_ENABLE + #undef RGBLED_NUM + #define RGBLIGHT_ANIMATIONS + #define RGBLED_NUM 27 + #define RGBLIGHT_LIMIT_VAL 120 + #define RGBLIGHT_HUE_STEP 10 + #define RGBLIGHT_SAT_STEP 17 + #define RGBLIGHT_VAL_STEP 17 +#endif diff --git a/keyboards/crkbd/keymaps/default/keymap.c b/keyboards/crkbd/keymaps/default/keymap.c index e92fbdebfa8..40bf9b65863 100644 --- a/keyboards/crkbd/keymaps/default/keymap.c +++ b/keyboards/crkbd/keymaps/default/keymap.c @@ -1,12 +1,4 @@ #include QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA - #include "lufa.h" - #include "split_util.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif extern keymap_config_t keymap_config; @@ -22,9 +14,9 @@ extern uint8_t is_master; // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. #define _QWERTY 0 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 enum custom_keycodes { QWERTY = SAFE_RANGE, @@ -39,70 +31,52 @@ enum macro_keycodes { KC_SAMPLEMACRO, }; -#define KC______ KC_TRNS -#define KC_XXXXX KC_NO -#define KC_LOWER LOWER -#define KC_RAISE RAISE -#define KC_RST RESET -#define KC_LRST RGBRST -#define KC_LTOG RGB_TOG -#define KC_LHUI RGB_HUI -#define KC_LHUD RGB_HUD -#define KC_LSAI RGB_SAI -#define KC_LSAD RGB_SAD -#define KC_LVAI RGB_VAI -#define KC_LVAD RGB_VAD -#define KC_LSMOD RGB_SMOD -#define KC_CTLTB CTL_T(KC_TAB) -#define KC_GUIEI GUI_T(KC_LANG2) -#define KC_ALTKN ALT_T(KC_LANG1) - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( \ + [_QWERTY] = LAYOUT( \ //,-----------------------------------------. ,-----------------------------------------. - ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_BSPC,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - CTLTB, A, S, D, F, G, H, J, K, L, SCLN, QUOT,\ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_RSFT,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + KC_LGUI, LOWER,KC_SPC, KC_ENT, RAISE,KC_RALT \ //`--------------------' `--------------------' ), - [_LOWER] = LAYOUT_kc( \ + [_LOWER] = LAYOUT( \ //,-----------------------------------------. ,-----------------------------------------. - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC,\ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_BSPC,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - CTLTB, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, XXXXX,\ + KC_LCTL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT,KC_NO,KC_NO,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LSFT, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, XXXXX,\ + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + KC_LGUI, LOWER,KC_SPC, KC_ENT, RAISE,KC_RALT \ //`--------------------' `--------------------' ), - [_RAISE] = LAYOUT_kc( \ + [_RAISE] = LAYOUT( \ //,-----------------------------------------. ,-----------------------------------------. - ESC, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, BSPC,\ + KC_ESC,KC_EXLM,KC_AT,KC_HASH,KC_DLR,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_BSPC,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - CTLTB, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, MINS, EQL, LCBR, RCBR, PIPE, GRV,\ + KC_LCTL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MINS,KC_EQL,KC_LCBR,KC_RCBR,KC_PIPE,KC_GRV,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LSFT, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, UNDS, PLUS, LBRC, RBRC, BSLS, TILD,\ + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UNDS,KC_PLUS,KC_LBRC,KC_RBRC,KC_BSLS,KC_TILD,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + KC_LGUI, LOWER,KC_SPC, KC_ENT, RAISE,KC_RALT \ //`--------------------' `--------------------' ), - [_ADJUST] = LAYOUT_kc( \ + [_ADJUST] = LAYOUT( \ //,-----------------------------------------. ,-----------------------------------------. - RST, LRST, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + RESET,RGBRST, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + RGB_TOG,RGB_HUI,RGB_SAI,RGB_VAI,KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LSMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + RGB_MOD,RGB_HUD,RGB_SAD,RGB_VAD,KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + KC_LGUI, LOWER,KC_SPC, KC_ENT, RAISE,KC_RALT \ //`--------------------' `--------------------' ) }; @@ -157,7 +131,7 @@ void matrix_render_user(struct CharacterMatrix *matrix) { // If you want to change the display of OLED, you need to change here matrix_write_ln(matrix, read_layer_state()); matrix_write_ln(matrix, read_keylog()); - matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_keylogs()); //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); //matrix_write_ln(matrix, read_host_led_state()); //matrix_write_ln(matrix, read_timelog()); @@ -179,10 +153,13 @@ void iota_gfx_task_user(void) { matrix_render_user(&matrix); matrix_update(&display, &matrix); } +#endif//SSD1306OLED bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { +#ifdef SSD1306OLED set_keylog(keycode, record); +#endif // set_timelog(); } @@ -192,7 +169,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { persistent_default_layer_set(1UL<<_QWERTY); } return false; - break; case LOWER: if (record->event.pressed) { layer_on(_LOWER); @@ -202,7 +178,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } return false; - break; case RAISE: if (record->event.pressed) { layer_on(_RAISE); @@ -212,7 +187,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } return false; - break; case ADJUST: if (record->event.pressed) { layer_on(_ADJUST); @@ -220,7 +194,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_ADJUST); } return false; - break; case RGB_MOD: #ifdef RGBLIGHT_ENABLE if (record->event.pressed) { @@ -230,7 +203,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } #endif return false; - break; case RGBRST: #ifdef RGBLIGHT_ENABLE if (record->event.pressed) { @@ -243,5 +215,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } - -#endif diff --git a/keyboards/crkbd/keymaps/default/rules.mk b/keyboards/crkbd/keymaps/default/rules.mk index 16deaf45d1d..f84e5b2af86 100644 --- a/keyboards/crkbd/keymaps/default/rules.mk +++ b/keyboards/crkbd/keymaps/default/rules.mk @@ -1,25 +1,4 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SWAP_HANDS_ENABLE = no # Enable one-hand typing - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - # If you want to change the display of OLED, you need to change here SRC += ./lib/glcdfont.c \ ./lib/rgb_state_reader.c \ diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index adfd79044d9..d35f723dac7 100644 --- a/keyboards/crkbd/keymaps/drashna/config.h +++ b/keyboards/crkbd/keymaps/drashna/config.h @@ -20,14 +20,14 @@ along with this program. If not, see . #pragma once - /* Select hand configuration */ // #define MASTER_LEFT // #define MASTER_RIGHT #define EE_HANDS -#define SSD1306OLED +#undef USE_I2C +#undef SSD1306OLED #define USE_SERIAL_PD2 @@ -35,11 +35,40 @@ along with this program. If not, see . // #define TAPPING_TERM 100 #ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 27 +# undef RGBLED_NUM +# define RGBLED_NUM 27 + +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 5 +# define RGBLIGHT_LIMIT_VAL 150 +#endif + +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) +// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) +// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 +# define RGB_MATRIX_HUE_STEP 8 +# define RGB_MATRIX_SAT_STEP 8 +# define RGB_MATRIX_VAL_STEP 5 +# define RGB_MATRIX_SPD_STEP 10 +#endif -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_LIMIT_VAL 120 +#ifdef AUDIO_ENABLE +# define B6_AUDIO +// #define NO_MUSIC_MODE #endif + +#undef PRODUCT +#define PRODUCT Drashna Hacked Corne Keyboard + +#define OLED_FONT_H "keyboards/crkbd/keymaps/drashna/glcdfont.c" +// #define OLED_FONT_WIDTH 5 +// #define OLED_FONT_HEIGHT 7 + +#define OLED_DISABLE_TIMEOUT +#define TAPPING_TERM_PER_KEY diff --git a/keyboards/crkbd/keymaps/drashna/glcdfont.c b/keyboards/crkbd/keymaps/drashna/glcdfont.c new file mode 100644 index 00000000000..28521b42892 --- /dev/null +++ b/keyboards/crkbd/keymaps/drashna/glcdfont.c @@ -0,0 +1,240 @@ +#pragma once + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Helidox 8x6 font with QMK Firmware Logo +// Online editor: http://teripom.x0.com/ + +const unsigned char font[] PROGMEM = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, +0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, +0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, +0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, +0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, +0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, +0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, +0x00, 0x18, 0x24, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, +0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, +0x26, 0x29, 0x79, 0x29, 0x26, 0x00, +0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, +0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, +0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, +0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, +0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, +0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, +0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, +0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, +0x60, 0x60, 0x60, 0x60, 0x60, 0x00, +0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, +0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, +0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, +0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, +0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, +0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, +0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, +0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, +0x00, 0x07, 0x00, 0x07, 0x00, 0x00, +0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, +0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, +0x23, 0x13, 0x08, 0x64, 0x62, 0x00, +0x36, 0x49, 0x56, 0x20, 0x50, 0x00, +0x00, 0x08, 0x07, 0x03, 0x00, 0x00, +0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, +0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, +0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, +0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, +0x00, 0x80, 0x70, 0x30, 0x00, 0x00, +0x08, 0x08, 0x08, 0x08, 0x08, 0x00, +0x00, 0x00, 0x60, 0x60, 0x00, 0x00, +0x20, 0x10, 0x08, 0x04, 0x02, 0x00, +0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, +0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, +0x72, 0x49, 0x49, 0x49, 0x46, 0x00, +0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, +0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, +0x27, 0x45, 0x45, 0x45, 0x39, 0x00, +0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, +0x41, 0x21, 0x11, 0x09, 0x07, 0x00, +0x36, 0x49, 0x49, 0x49, 0x36, 0x00, +0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, +0x00, 0x00, 0x14, 0x00, 0x00, 0x00, +0x00, 0x40, 0x34, 0x00, 0x00, 0x00, +0x00, 0x08, 0x14, 0x22, 0x41, 0x00, +0x14, 0x14, 0x14, 0x14, 0x14, 0x00, +0x00, 0x41, 0x22, 0x14, 0x08, 0x00, +0x02, 0x01, 0x59, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, +0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, +0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, +0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, +0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, +0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, +0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, +0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, +0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, +0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, +0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, +0x26, 0x49, 0x49, 0x49, 0x32, 0x00, +0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, +0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, +0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, +0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, +0x63, 0x14, 0x08, 0x14, 0x63, 0x00, +0x03, 0x04, 0x78, 0x04, 0x03, 0x00, +0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, +0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, +0x04, 0x02, 0x01, 0x02, 0x04, 0x00, +0x40, 0x40, 0x40, 0x40, 0x40, 0x00, +0x00, 0x03, 0x07, 0x08, 0x00, 0x00, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, +0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, +0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, +0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, +0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, +0x48, 0x54, 0x54, 0x54, 0x24, 0x00, +0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, +0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, +0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, +0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, +0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, +0x00, 0x08, 0x36, 0x41, 0x00, 0x00, +0x00, 0x00, 0x77, 0x00, 0x00, 0x00, +0x00, 0x41, 0x36, 0x08, 0x00, 0x00, +0x02, 0x01, 0x02, 0x04, 0x02, 0x00, +0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, +0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, +0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, +0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, +0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, +0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, +0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, +0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, +0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, +0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, +0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, +0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, +0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, +0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, +0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, +0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, +0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, +0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x81, +0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, +0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, +0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, +0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, +0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, +0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, +0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, +0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, +0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, +0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, +0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, +0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x03, 0x07, 0x07, +0x07, 0x07, 0x07, 0x07, 0x07, 0x07, +0x03, 0x01, 0x00, 0x00, 0x00, 0x00, +0x01, 0x03, 0x07, 0x07, 0x07, 0x07, +0x07, 0x07, 0x07, 0x07, 0x03, 0x01, +0x00, 0x00, 0x00, 0x07, 0x07, 0x07, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x07, 0x07, 0x07, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x07, 0x07, +0x07, 0x00, 0x00, 0x00, 0x01, 0x03, +0x07, 0x07, 0x07, 0x07, 0x07, 0x07, +0x07, 0x07, 0x03, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 99dcdb4e173..693c53b1675 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -1,35 +1,27 @@ #include QMK_KEYBOARD_H #include "drashna.h" -#ifdef PROTOCOL_LUFA - #include "lufa.h" - #include "split_util.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif extern keymap_config_t keymap_config; -extern uint8_t is_master; +extern uint8_t is_master; #ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings +// Following line allows macro to read current RGB settings extern rgblight_config_t rgblight_config; #endif -enum crkbd_keycodes { - RGBRST = NEW_SAFE_RANGE -}; +enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; +// clang-format off #define LAYOUT_crkbd_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ ) \ LAYOUT_wrapper( \ - KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ - OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ - LT(_LOWER,KC_GRV), KC_SPC, LALT_T(KC_BSPC), KC_DEL, KC_ENT, RAISE \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ + KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ + KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ ) #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) @@ -58,6 +50,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ ), + [_NORMAN] = LAYOUT_crkbd_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_crkbd_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_crkbd_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_crkbd_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + [_MODS] = LAYOUT_wrapper( _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, @@ -66,14 +82,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_LOWER] = LAYOUT_wrapper( - KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, - KC_F11, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, - KC_F12, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, + KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, + KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, _______, _______, _______, _______, _______, _______ ), [_RAISE] = LAYOUT_wrapper( \ - KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, + _______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, _______, _______, _______, _______, _______, _______ @@ -81,117 +97,286 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_wrapper( \ KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, - VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EPRM, - TG_MODS, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, - _______, _______, _______, _______, _______, _______ + VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, + _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, + _______, KC_NUKE, _______, _______, TG_MODS, _______ ) }; +// clang-format on + +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } +uint16_t oled_timer; + +char keylog_str[5] = {}; +uint8_t keylogs_str_idx = 0; +uint16_t log_timer = 0; + +const char code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; + +void add_keylog(uint16_t keycode) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { + keycode = keycode & 0xFF; + } + + for (uint8_t i = 4; i > 0; i--) { + keylog_str[i] = keylog_str[i - 1]; + } + if (keycode < 60) { + keylog_str[0] = code_to_name[keycode]; + } + keylog_str[5] = 0; + + log_timer = timer_read(); +} + +void update_log(void) { + if (timer_elapsed(log_timer) > 750) { + add_keylog(0); + } +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + add_keylog(keycode); + oled_timer = timer_read(); + } + return true; +} + +void render_rgb_status(void) { + oled_write_ln("RGB:", false); + static char temp[20] = {0}; + snprintf(temp, sizeof(temp) + 1, "M:%3dH:%3dS:%3dV:%3d", rgb_matrix_config.mode, rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); + oled_write(temp, false); +} -int RGB_current_mode; - -void matrix_init_keymap(void) { - #ifdef RGBLIGHT_ENABLE - RGB_current_mode = rgblight_config.mode; - #endif - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif - - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); - - DDRB &= ~(1<<0); - PORTB &= ~(1<<0);} - -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED - -// When add source files to SRC in rules.mk, you can use functions. -const char *read_layer_state(void); -const char *read_logo(void); -void set_keylog(uint16_t keycode, keyrecord_t *record); -const char *read_keylog(void); -const char *read_keylogs(void); -char layer_state_str[24]; -// const char *read_mode_icon(bool swap); -const char *read_host_led_state(void); -// void set_timelog(void); -// const char *read_timelog(void); - - -const char* read_layer_state(void) { - switch (layer_state) { - case _QWERTY: - switch (default_layer_state) { +void render_status_main(void) { + /* Show Keyboard Layout */ + oled_write("Lyout", false); + switch (biton32(default_layer_state)) { case _QWERTY: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: QWERTY"); - break; + oled_write(" QRTY", false); + break; case _COLEMAK: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak"); - break; + oled_write(" COLE", false); + break; case _DVORAK: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak"); - break; + oled_write(" DVRK", false); + break; case _WORKMAN: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman"); - break; - } - break; - case _RAISE: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); - break; - case _LOWER: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); - break; - case _ADJUST: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); - break; - default: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); - } - - return layer_state_str; -} + oled_write(" WKMN", false); + break; + case _NORMAN: + oled_write(" NORM", false); + break; + case _MALTRON: + oled_write(" MLTN", false); + break; + case _EUCALYN: + oled_write(" ECLN", false); + break; + case _CARPLAX: + oled_write(" CRPX", false); + break; + } + + /* Show Lock Status (only work on master side) */ + uint8_t led_usb_state = host_keyboard_leds(); + oled_write("Lock:", false); + oled_write(" ", false); + oled_write_ln("NUM", led_usb_state & (1 << USB_LED_NUM_LOCK)); + oled_write(" ", false); + oled_write("CAPS", led_usb_state & (1 << USB_LED_CAPS_LOCK)); + oled_write(" ", false); + oled_write("SCRL", led_usb_state & (1 << USB_LED_SCROLL_LOCK)); + + /* Show Alt-Gui Swap options */ + oled_write("BTMGK", false); + oled_write(" ", false); + oled_write_ln("Win", !keymap_config.swap_lalt_lgui); + oled_write(" ", false); + oled_write_ln("Mac", keymap_config.swap_lalt_lgui); -void matrix_scan_keymap(void) { - iota_gfx_task(); +# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + /* Show RGB Options */ + render_rgb_status(); +# endif + + oled_write(keylog_str, false); } -void matrix_render_user(struct CharacterMatrix *matrix) { - if (is_master) { - // If you want to change the display of OLED, you need to change here - matrix_write_ln(matrix, read_layer_state()); - matrix_write_ln(matrix, read_keylog()); - matrix_write_ln(matrix, read_keylogs()); - //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - matrix_write_ln(matrix, read_host_led_state()); - //matrix_write_ln(matrix, read_timelog()); - } else { - matrix_write(matrix, read_logo()); - } +void render_status_secondary(void) { + /* Show Keyboard Layout */ + oled_write("Lyout", false); + switch (biton32(default_layer_state)) { + case _QWERTY: + oled_write(" QRTY", false); + break; + case _COLEMAK: + oled_write(" COLE", false); + break; + case _DVORAK: + oled_write(" DVRK", false); + break; + case _WORKMAN: + oled_write(" WKMN", false); + break; + case _NORMAN: + oled_write(" NORM", false); + break; + case _MALTRON: + oled_write(" MLTN", false); + break; + case _EUCALYN: + oled_write(" ECLN", false); + break; + case _CARPLAX: + oled_write(" CRPX", false); + break; + } + + /* Show Activate layer */ + oled_write("Layer", false); + switch (biton32(layer_state)) { + case _RAISE: + oled_write("Raise", false); + break; + case _LOWER: + oled_write("Lower", false); + break; + case _ADJUST: + oled_write("Adjst", false); + break; + default: + oled_write("Dflt ", false); + break; + } + + /* Show Mod */ + uint8_t modifiers = get_mods() | get_oneshot_mods(); + + oled_write("Mods:", false); + oled_write(" ", false); + oled_write_ln("SFT", (modifiers & MOD_MASK_SHIFT)); + oled_write(" ", false); + oled_write_ln("CTL", (modifiers & MOD_MASK_CTRL)); + oled_write(" ", false); + oled_write_ln("ALT", (modifiers & MOD_MASK_ALT)); + oled_write(" ", false); + oled_write_ln("GUI", (modifiers & MOD_MASK_GUI)); + +# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + render_rgb_status(); +# endif + + /* Show logged Keys */ + oled_write(keylog_str, false); } -void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } +void oled_task_user(void) { + if (timer_elapsed(oled_timer) > 60000) { + oled_off(); + return; + } + if (is_master) { + render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_status_secondary(); + } } -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - matrix_clear(&matrix); - matrix_render_user(&matrix); - matrix_update(&display, &matrix); +void matrix_scan_keymap(void) { update_log(); } +#endif + +uint16_t get_tapping_term(uint16_t keycode) { + switch (keycode) { + case ALT_T(KC_A): + return TAPPING_TERM + 100; + default: + return TAPPING_TERM; + } } -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - set_keylog(keycode, record); - // set_timelog(); - } - return true; +#ifdef RGB_MATRIX_ENABLE + +static bool is_suspended; +static bool rgb_matrix_enabled; + +void suspend_power_down_keymap(void) { + rgb_matrix_set_suspend_state(true); + if (!is_suspended) { + is_suspended = true; + rgb_matrix_enabled = (bool)rgb_matrix_config.enable; + rgb_matrix_disable_noeeprom(); + } } +void suspend_wakeup_init_keymap(void) { + rgb_matrix_set_suspend_state(false); + is_suspended = false; + if (rgb_matrix_enabled) { + rgb_matrix_enable_noeeprom(); + } +} +void rgb_matrix_indicators_user(void) { + if (userspace_config.rgb_layer_change && +# ifdef RGB_DISABLE_WHEN_USB_SUSPENDED + !g_suspend_state && +# endif +# if defined(RGBLIGHT_ENABLE) + (!rgblight_config.enable && rgb_matrix_config.enable) +# else + rgb_matrix_config.enable +# endif + ) { + switch (biton32(layer_state)) { + case _GAMEPAD: + rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _DIABLO: + rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _RAISE: + rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _LOWER: + rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _ADJUST: + rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + default: { + bool mods_enabled = IS_LAYER_ON(_MODS); + switch (biton32(default_layer_state)) { + case _QWERTY: + rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _COLEMAK: + rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _DVORAK: + rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _WORKMAN: + rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _NORMAN: + rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _MALTRON: + rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _EUCALYN: + rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + case _CARPLAX: + rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + break; + } + break; + } + } + } +} #endif diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index ccf8e2b7c8d..af340459716 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -3,29 +3,24 @@ # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SWAP_HANDS_ENABLE = no # Enable one-hand typing +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +RGB_MATRIX_ENABLE = WS2812 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# If you want to change the display of OLED, you need to change here -SRC += ./lib/glcdfont.c \ - ./lib/rgb_state_reader.c \ - ./lib/logo_reader.c \ - ./lib/keylogger.c \ - ./lib/host_led_state_reader.c \ - # ./lib/layer_state_reader.c \ - # ./lib/mode_icon_reader.c \ - # ./lib/timelogger.c \ +BOOTLOADER = qmk-dfu + +OLED_DRIVER_ENABLE = yes diff --git a/keyboards/crkbd/keymaps/edvorakjp/config.h b/keyboards/crkbd/keymaps/edvorakjp/config.h new file mode 100644 index 00000000000..b8662aca092 --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/config.h @@ -0,0 +1,25 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +/* Select hand configuration */ + +// #define MASTER_LEFT +#define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED +#define SWAP_SCLN + +// #define TAPPING_FORCE_HOLD +#define TAPPING_TERM 300 +#define IGNORE_MOD_TAP_INTERRUPT + +#undef RGBLED_NUM +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 100 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#endif // CONFIG_USER_H diff --git a/keyboards/crkbd/keymaps/edvorakjp/keymap.c b/keyboards/crkbd/keymaps/edvorakjp/keymap.c new file mode 100644 index 00000000000..32001f22daa --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/keymap.c @@ -0,0 +1,98 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "oled.h" +#endif + +#include "edvorakjp.h" + +/* + * enum custom_keycodes { + * KC_LOCK = NEW_SAFE_RANGE, + * }; + */ + +#define KC_ KC_TRNS + +#define KC_TMB1 KC_LA(TAB) +#define KC_TMB2 KC_LS(SPC) +#define KC_TMB3 TD(TD_LOWER) // act as LOWER when hold, as KC_LANG2(=English) when tapped +#define KC_TMB4 TD(TD_RAISE) // act as RAISE when hold, as KC_LANG1(=Japanese) when tapped +#define KC_TMB5 KC_RC(BSPC) +#define KC_TMB6 KC_RG(ENT) +#define KC_TMB7 KC_RC(DEL) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_EDVORAK] = LAYOUT_kc( + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + GRV ,QUOT,COMM , DOT , Y , Q , F , G , R , W , P ,BSLS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + EQL , A ,LA(O),LG(E),LC(I), U , D ,RS(T),RG(N),RA(S), M ,MINS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + ESC ,SCLN, X , C , V , Z , H , J , K , L , B ,SLSH, + //`----+----+-----+-----+-----+----+----| |----+----+-----+-----+-----+----+----' + TMB1 ,TMB2,TMB3, TMB4,TMB5,TMB6 + // `-----+----+----' `----+----+-----' + ), + + [_LOWER] = LAYOUT_kc( + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + , , LCBR , LBRC , LPRN , , , RPRN , RBRC , RCBR , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + F1 , F2 ,LA(F3),LG(F4),LC(F5), F6 , F7 ,RS(F8),RG(F9),RA(F10),F11 ,F12 , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + PSCR, , HOME , PGDN , PGUP ,END , LEFT, DOWN , UP , RGHT , , , + //`----+----+------+------+------+----+----| |----+----+------+------+-------+----+----' + , , NO , MAC ,TMB7, + // `-----+----+----' `----+----+-----' + ), + + [_RAISE] = LAYOUT_kc( + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , ,EXLM , AT ,HASH ,DLR , PERC,CIRC ,AMPR ,ASTR , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , 1 ,LA(2),LG(3),LC(4), 5 , 6 ,RS(7),RG(8),RA(9), 0 , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + PSCR, ,HOME ,PGDN ,PGUP ,END , LEFT,DOWN , UP ,RGHT , , , + //`----+----+-----+-----+-----+----+----| |----+----+-----+-----+-----+----+----' + , ,WIN , NO , , + // `-----+----+----' `----+----+----' + ) +}; + +#ifdef SSD1306OLED +void matrix_init_keymap(void) { + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h +#ifdef MASTER_RIGHT + iota_gfx_init(has_usb()); // turns on the display +#else + iota_gfx_init(!has_usb()); +#endif // MASTER_RIGHT +} + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} +#endif + +#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT +uint32_t layer_state_set_keymap(uint32_t state) { + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + switch (biton32(state)) { + case _LOWER: + rgblight_sethsv_noeeprom_red(); + break; + case _RAISE: + rgblight_sethsv_noeeprom_green(); + break; + default: // for any other layers, or the default layer + rgblight_mode(RGBLIGHT_MODE_STATIC_GRADIENT + 3); + rgblight_sethsv_red(); + break; + } + return state; +} +#endif diff --git a/keyboards/crkbd/keymaps/edvorakjp/oled.c b/keyboards/crkbd/keymaps/edvorakjp/oled.c new file mode 100644 index 00000000000..cbb43d06156 --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/oled.c @@ -0,0 +1,76 @@ +#include +#include "oled.h" + +// NOTE: Redefined to avoid to use snprintf(); It makes size of firmware big. +const char *read_mode_icon(bool windows_mode) { + static const char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; + static char mode_icon[10]; + + int mode_number = windows_mode ? 1 : 0; + strcpy(mode_icon, logo[mode_number][0]); + + strcat(mode_icon, "\n"); + strcat(mode_icon, logo[mode_number][1]); + + return mode_icon; +} + +const char *read_layer_state(void) { + static char layer_state_str[24]; + char layer_name[17]; + + switch (biton32(layer_state)) { + case L_BASE: + strcpy(layer_name, "Default"); + break; + case _RAISE: + strcpy(layer_name, "Raise"); + break; + case _LOWER: + strcpy(layer_name, "Lower"); + break; + default: + snprintf(layer_name, sizeof(layer_name), "Undef-%ld", layer_state); + } + + strcpy(layer_state_str, "Layer: "); + + strcat(layer_state_str, layer_name); + strcat(layer_state_str, "\n"); + return layer_state_str; +} + +const char *read_host_led_state(void) { + static char led_str[24]; + strcpy(led_str, (host_keyboard_leds() & (1<display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + + matrix_clear(&matrix); +#ifdef MASTER_RIGHT + if (!is_master) { +#else + if (is_master) { +#endif // MASTER_RIGHT + matrix_write(&matrix, read_mode_icon(!get_enable_kc_lang())); + matrix_write(&matrix, " "); + matrix_write(&matrix, read_layer_state()); + matrix_write(&matrix, read_host_led_state()); + } else { + matrix_write(&matrix, read_logo()); + } + matrix_update(&display, &matrix); +} diff --git a/keyboards/crkbd/keymaps/edvorakjp/oled.h b/keyboards/crkbd/keymaps/edvorakjp/oled.h new file mode 100644 index 00000000000..896347aea98 --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/oled.h @@ -0,0 +1,24 @@ +#ifndef OLED_USER_H +#define OLED_USER_H + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#include "ssd1306.h" +#include "edvorakjp.h" + +//assign the right code to your layers for OLED display +#define L_BASE 0 + +extern uint8_t is_master; +extern bool japanese_mode; + +// method prototypes defined in crkbd/lib +extern const char *read_logo(void); + +const char *read_mode_icon(bool swap); +const char *read_layer_state(void); +const char *read_host_led_state(void); +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source); +void iota_gfx_task_user(void); + +#endif // OLED_CONFIG_USER_H diff --git a/keyboards/iris/keymaps/edvorakjp/readme.md b/keyboards/crkbd/keymaps/edvorakjp/readme.md similarity index 100% rename from keyboards/iris/keymaps/edvorakjp/readme.md rename to keyboards/crkbd/keymaps/edvorakjp/readme.md diff --git a/keyboards/crkbd/keymaps/edvorakjp/rules.mk b/keyboards/crkbd/keymaps/edvorakjp/rules.mk new file mode 100644 index 00000000000..b4f6d2f1f15 --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/rules.mk @@ -0,0 +1,32 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/logo_reader.c \ + oled.c \ + # ./lib/rgb_state_reader.c \ + # ./lib/layer_state_reader.c \ + # ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/crkbd/keymaps/foostan/config.h b/keyboards/crkbd/keymaps/foostan/config.h new file mode 100644 index 00000000000..644e8136509 --- /dev/null +++ b/keyboards/crkbd/keymaps/foostan/config.h @@ -0,0 +1,44 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/foostan/keymap.c b/keyboards/crkbd/keymaps/foostan/keymap.c new file mode 100644 index 00000000000..5235b783637 --- /dev/null +++ b/keyboards/crkbd/keymaps/foostan/keymap.c @@ -0,0 +1,241 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + BACKLIT, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_RST RESET +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LMOD RGB_MOD +#define KC_GUIEI GUI_T(KC_LANG2) +#define KC_ALTKN ALT_T(KC_LANG1) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ESC,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + //`--------------------' `--------------------' + ), + + [_LOWER] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + TAB, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LCTL, F1, F2, F3, F4, F5, LEFT, DOWN, UP, RIGHT, XXXXX, XXXXX,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, F6, F7, F8, F9, F10, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + //`--------------------' `--------------------' + ), + + [_RAISE] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + TAB, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, BSPC,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LCTL, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, MINS, EQL, LCBR, RCBR, PIPE, GRV,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, UNDS, PLUS, LBRC, RBRC, BSLS, TILD,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + //`--------------------' `--------------------' + ), + + [_ADJUST] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + RST, LRST, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + //`--------------------' `--------------------' + ) +}; + +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} diff --git a/keyboards/crkbd/keymaps/foostan/rules.mk b/keyboards/crkbd/keymaps/foostan/rules.mk new file mode 100644 index 00000000000..f84e5b2af86 --- /dev/null +++ b/keyboards/crkbd/keymaps/foostan/rules.mk @@ -0,0 +1,10 @@ + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/crkbd/keymaps/jarred/config.h b/keyboards/crkbd/keymaps/jarred/config.h new file mode 100644 index 00000000000..ac4c1cc88f5 --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/config.h @@ -0,0 +1,44 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +//#define TAPPING_FORCE_HOLD +//#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/jarred/keymap.c b/keyboards/crkbd/keymaps/jarred/keymap.c new file mode 100644 index 00000000000..f00a735bfc5 --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/keymap.c @@ -0,0 +1,182 @@ +#include QMK_KEYBOARD_H +#include "jarred.h" + +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; +extern uint8_t is_master; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +#define LAYOUT_crkbd_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K31, K32, K33, K34, K35, K36 \ + ) + +#define LAYOUT_crkbd_wrapper(...) LAYOUT(__VA_ARGS__) + +#define QWERTY_4_CRKBD KC_LCTL, MO(_LW), KC_SPC, KC_ENT, MO(_LW), KC_RALT + +#define BLANK_4_CRKBD KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_crkbd_wrapper( + QWERTY_1_12, + QWERTY_2_12, + QWERTY_3_12, + QWERTY_4_DOX + ), + + [_LW] = LAYOUT_crkbd_wrapper( + LOWER_1_12, + LOWER_2_12, + LOWER_3_12, + LOWER_4_DOX + ), + + [_NV] = LAYOUT_crkbd_wrapper( + NAV_1_12, + NAV_2_12, + NAV_3_12, + NAV_4_DOX + ), + + [_NP] = LAYOUT_crkbd_wrapper( + NUMPAD_1_12, + NUMPAD_2_12, + NUMPAD_3_12, + NUMPAD_4_DOX + ), + + [_MS] = LAYOUT_crkbd_wrapper( + MOUSE_1_12, + MOUSE_2_12, + MOUSE_3_12, + MOUSE_4_DOX + ) +}; + +void matrix_init_user(void) { + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +char matrix_line_str[24]; + +const char *read_layer_state(void) { + uint8_t layer = biton32(layer_state); + + strcpy(matrix_line_str, "Layer: "); + + switch (layer) + { + case _QW: + strcat(matrix_line_str, "Default"); + break; + case _LW: + strcat(matrix_line_str, "Lower"); + break; + case _NV: + strcat(matrix_line_str, "Navigation"); + break; + case _NP: + strcat(matrix_line_str, "Adjust"); + break; + case _MS: + strcat(matrix_line_str, "Mouse"); + break; + default: + sprintf(matrix_line_str + strlen(matrix_line_str), "Unknown (%d)", layer); + } + + return matrix_line_str; +} + +const char *read_usb_state(void) { + + strcpy(matrix_line_str, "USB : "); + + switch (USB_DeviceState) { + case DEVICE_STATE_Unattached: + strcat(matrix_line_str, "Unattached"); + break; + case DEVICE_STATE_Suspended: + strcat(matrix_line_str, "Suspended"); + break; + case DEVICE_STATE_Configured: + strcat(matrix_line_str, "Connected"); + break; + case DEVICE_STATE_Powered: + strcat(matrix_line_str, "Powered"); + break; + case DEVICE_STATE_Default: + strcat(matrix_line_str, "Default"); + break; + case DEVICE_STATE_Addressed: + strcat(matrix_line_str, "Addressed"); + break; + default: + strcat(matrix_line_str, "Invalid"); + } + + return matrix_line_str; +} + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_usb_state()); + matrix_write_ln(matrix, read_keylogs()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + set_keylog(keycode, record); + } + + return true; +} diff --git a/keyboards/crkbd/keymaps/jarred/readme.md b/keyboards/crkbd/keymaps/jarred/readme.md new file mode 100644 index 00000000000..15e355bbca1 --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/readme.md @@ -0,0 +1,9 @@ +# Jarred's CRKBD Layout + +Check out [user space readme](../../../../users/jarred/readme.md) for more info + +# Build + +``` +make crkbd:jarred:avrdude +``` diff --git a/keyboards/crkbd/keymaps/jarred/rules.mk b/keyboards/crkbd/keymaps/jarred/rules.mk new file mode 100644 index 00000000000..ab6329f0ebf --- /dev/null +++ b/keyboards/crkbd/keymaps/jarred/rules.mk @@ -0,0 +1,31 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + #./lib/layer_state_reader.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/crkbd/keymaps/like_jis/config.h b/keyboards/crkbd/keymaps/like_jis/config.h index 0e2960a937d..a061b4fb09f 100644 --- a/keyboards/crkbd/keymaps/like_jis/config.h +++ b/keyboards/crkbd/keymaps/like_jis/config.h @@ -34,7 +34,7 @@ along with this program. If not, see . #define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD -#define TAPPING_TERM 150 +#define TAPPING_TERM 250 #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/crkbd/keymaps/like_jis/keymap.c b/keyboards/crkbd/keymaps/like_jis/keymap.c index 05d31845c83..41df6330f51 100644 --- a/keyboards/crkbd/keymaps/like_jis/keymap.c +++ b/keyboards/crkbd/keymaps/like_jis/keymap.c @@ -7,41 +7,45 @@ #ifdef SSD1306OLED #include "ssd1306.h" #endif +#include "oled_helper.h" extern keymap_config_t keymap_config; -#ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; -#endif - extern uint8_t is_master; // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -#define _QWERTY 0 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; enum custom_keycodes { LOWER = SAFE_RANGE, RAISE, ADJUST, + KANJI, RGBRST }; -#define KC______ KC_TRNS -#define KC_XXXXX KC_NO -#define KC_KANJI KC_GRV +enum tapdances{ + TD_CODO = 0, + // TD_MNUB, +}; +// Layer Mode aliases #define KC_LOWER LOWER #define KC_RAISE RAISE -#define KC_RST RESET +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_KANJI KANJI +#define KC_RST RESET #define KC_LRST RGBRST #define KC_LTOG RGB_TOG #define KC_LHUI RGB_HUI @@ -50,32 +54,42 @@ enum custom_keycodes { #define KC_LSAD RGB_SAD #define KC_LVAI RGB_VAI #define KC_LVAD RGB_VAD -#define KC_LSMOD RGB_SMOD - +#define KC_LMOD RGB_MOD #define KC_KNRM AG_NORM #define KC_KSWP AG_SWAP -#define KC_GUAP LALT_T(KC_APP) + +#define KC_TBSF LSFT_T(KC_TAB) +// #define KC_SPSF LSFT_T(KC_SPC) +#define KC_ALAP LALT_T(KC_APP) + +#define KC_CODO TD(TD_CODO) +// #define KC_MNUB TD(TD_MNUB) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT), + // [TD_MNUB] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, LSFT(KC_RO)), +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( \ + [_BASE] = LAYOUT_kc( \ //,-----------------------------------------. ,-----------------------------------------. ESC, Q, W, E, R, T, Y, U, I, O, P, MINS,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LSFT, A, S, D, F, G, H, J, K, L, UP, ENT,\ + TBSF, A, S, D, F, G, H, J, K, L, UP, ENT,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LCTRL, Z, X, C, V, B, N, M, COMM, LEFT, DOWN, RGHT,\ + LCTRL, Z, X, C, V, B, N, M, CODO, LEFT, DOWN, RGHT,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - LGUI, LOWER, BSPC, SPC, RAISE, GUAP \ + LGUI, LOWER, BSPC, SPC, RAISE, ALAP \ //`--------------------' `--------------------' ), [_LOWER] = LAYOUT_kc( \ //,-----------------------------------------. ,-----------------------------------------. - TAB, F1, F2, F3, F4, F5, XXXXX, MINS, EQL, JYEN, LBRC, RBRC,\ + _____, F1, F2, F3, F4, F5, XXXXX, MINS, EQL, JYEN, LBRC, RBRC,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| _____, F6, F7, F8, F9, F10, XXXXX, XXXXX, XXXXX, SCLN, QUOT, BSLS,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - _____, F11, F12, XXXXX, KANJI, ENT, XXXXX, XXXXX, COMM, DOT, SLSH, RO,\ + _____, F11, F12, TAB, KANJI, ENT, XXXXX, XXXXX, COMM, DOT, SLSH, RO,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| _____, _____, DEL, _____, _____, APP \ //`--------------------' `--------------------' @@ -83,11 +97,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT_kc( \ //,-----------------------------------------. ,-----------------------------------------. - _____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, XXXXX,\ + _____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, PSLS,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 4, 5, 6, QUOT, XXXXX,\ + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, QUOT, 4, 5, 6, PPLS, PAST,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 0, 1, 2, 3, DOT, XXXXX,\ + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 0, 1, 2, 3, DOT, PMNS,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| _____, _____, BSPC, _____, _____, LALT \ //`--------------------' `--------------------' @@ -95,152 +109,183 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_kc( \ //,-----------------------------------------. ,-----------------------------------------. - _____, RST, LRST, KNRM, KSWP,XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + _____, RST, LRST, KNRM, KSWP, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ //|------+-------+------+------+------+-----| |------+------+------+------+------+------| - _____, LTOG, LHUI, LSAI, LVAI,XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, PGUP, XXXXX,\ + _____, LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, PGUP, XXXXX,\ //|------+-------+------+------+------+-----| |------+------+------+------+------+------| - _____, LSMOD, LHUD, LSAD, LVAD,XXXXX, XXXXX, XXXXX, XXXXX, HOME, PGDN, END,\ + _____, LMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, HOME, PGDN, END,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| _____, _____, XXXXX, _____, _____, XXXXX \ //`--------------------' `--------------------' ) }; -int RGB_current_mode; +#define L_BASE _BASE +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) -// Setting ADJUST layer RGB back to default -static inline void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { - if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { - layer_on(layer3); - } else { - layer_off(layer3); +#ifdef SSD1306OLED +typedef struct { + uint8_t state; + char name[8]; +}LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 5 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {L_BASE, "Base"}, + {L_BASE + 1, "Base"}, + {L_LOWER, "Lower"}, + {L_RAISE, "Raise"}, + {L_ADJUST_TRI, "Adjust"} +}; + +static inline const char* get_leyer_status(void) { + + for (uint8_t i = 0; i < LAYER_DISPLAY_MAX; ++i) { + if (layer_state == 0 && layer_display_name[i].state == default_layer_state) { + + return layer_display_name[i].name; + } else if (layer_state != 0 && layer_display_name[i].state == layer_state) { + + return layer_display_name[i].name; + } } -} -void matrix_init_user(void) { - #ifdef RGBLIGHT_ENABLE - RGB_current_mode = rgblight_config.mode; - #endif - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif + return "?"; } -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED +static char layer_status_buf[24] = "Layer state ready.\n"; +static inline void update_keymap_status(void) { + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "OS:%s Layer:%s\n", + keymap_config.swap_lalt_lgui? "win" : "mac", get_leyer_status()); +} -// When add source files to SRC in rules.mk, you can use functions. -const char *read_layer_state(void); -const char *read_logo(void); -void set_keylog(uint16_t keycode, keyrecord_t *record); -const char *read_keylog(void); -const char *read_keylogs(void); +static inline void render_keymap_status(struct CharacterMatrix *matrix) { -// const char *read_mode_icon(bool swap); -// const char *read_host_led_state(void); -// void set_timelog(void); -// const char *read_timelog(void); + matrix_write(matrix, layer_status_buf); +} + +#define UPDATE_KEYMAP_STATUS() update_keymap_status() +#define RENDER_KEYMAP_STATUS(a) render_keymap_status(a) -#ifdef RGBLIGHT_ENABLE - const char *read_rgb_info(void); - #define RENDER_RGB_INFO(m) matrix_write_ln(m, (const char*)read_rgb_info()) #else - #define RENDER_RGB_INFO(m) + +#define UPDATE_KEYMAP_STATUS() +#define RENDER_KEYMAP_STATUS(a) + #endif +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { -void matrix_scan_user(void) { - iota_gfx_task(); + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); } -static inline void matrix_render_user(struct CharacterMatrix *matrix) { - if (is_master) { - // If you want to change the display of OLED, you need to change here - matrix_write_ln(matrix, read_layer_state()); - matrix_write_ln(matrix, read_keylog()); - RENDER_RGB_INFO(matrix); - // matrix_write_ln(matrix, read_keylogs()); - // matrix_write_ln(matrix, read_host_led_state()); - - // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - // matrix_write_ln(matrix, read_timelog()); - } else { - matrix_write(matrix, read_logo()); +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + UPDATE_KEY_STATUS(keycode, record); + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; } + + UPDATE_KEYMAP_STATUS(); + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + UPDATE_KEYMAP_STATUS(); + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously } -static inline void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { +static inline void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { if (memcmp(dest->display, source->display, sizeof(dest->display))) { memcpy(dest->display, source->display, sizeof(dest->display)); dest->dirty = true; } } -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - matrix_clear(&matrix); - matrix_render_user(&matrix); - matrix_update(&display, &matrix); +static inline void render_status(struct CharacterMatrix *matrix) { + + UPDATE_LED_STATUS(); + RENDER_LED_STATUS(matrix); + RENDER_KEYMAP_STATUS(matrix); + UPDATE_LOCK_STATUS(); + RENDER_LOCK_STATUS(matrix); + RENDER_KEY_STATUS(matrix); } -#endif +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - #ifdef SSD1306OLED - if (record->event.pressed) { - set_keylog(keycode, record); - // set_timelog(); + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; } #endif - switch (keycode) { - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - break; - - #ifdef RGBLIGHT_ENABLE - case RGB_MOD: - if (record->event.pressed) { - rgblight_mode(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - break; - case RGBRST: - if (record->event.pressed) { - eeconfig_update_rgblight_default(); - rgblight_enable(); - RGB_current_mode = rgblight_config.mode; - } - break; - #endif - default: - return true; + matrix_clear(&matrix); + if (is_master) { + render_status(&matrix); + } else { + RENDER_LOGO(&matrix); } - return false; + matrix_update(&display, &matrix); } + +#endif diff --git a/keyboards/crkbd/keymaps/like_jis/oled_helper.c b/keyboards/crkbd/keymaps/like_jis/oled_helper.c new file mode 100644 index 00000000000..500d3c0dc10 --- /dev/null +++ b/keyboards/crkbd/keymaps/like_jis/oled_helper.c @@ -0,0 +1,83 @@ +#ifdef SSD1306OLED +#include QMK_KEYBOARD_H +#include "ssd1306.h" + +void render_logo(struct CharacterMatrix *matrix) { + + const char logo_buf[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + + matrix_write(matrix, logo_buf); +} + +static char keylog_buf[24] = "Key state ready."; +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', '-', ' ', '@', ' ', ' ', + ' ', ';', ':', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void update_key_status(uint16_t keycode, keyrecord_t *record) { + + if (!record->event.pressed) return; + + char name = (keycode < 60) ? code_to_name[keycode] : ' '; + snprintf(keylog_buf, sizeof(keylog_buf) - 1, "Key:%dx%d %2x %c", + record->event.key.row, record->event.key.col, + (uint16_t)keycode, name); +} + +void render_key_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, keylog_buf); +} + +static char lock_buf[24] = "Lock state ready.\n"; +void update_lock_status(void) { + + uint8_t leds = host_keyboard_leds(); + char *num_lock = (leds & (1< +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 +#define BACKLIGHT_LEVELS 10 + +#undef PRODUCT +#define PRODUCT "Vee's hotswappable Helidox/Corne/CRKBD split keeb" + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/crkbd/keymaps/omgvee/keymap.c b/keyboards/crkbd/keymaps/omgvee/keymap.c new file mode 100644 index 00000000000..2c33d8b8c57 --- /dev/null +++ b/keyboards/crkbd/keymaps/omgvee/keymap.c @@ -0,0 +1,242 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + BACKLIT, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_RST RESET +#define KC_ERST EEPROM_RESET +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LMOD RGB_MOD +#define KC_SFCPS SFT_T(KC_CAPS) +#define KC_CTLTB CTL_T(KC_TAB) +#define KC_GUIEI GUI_T(KC_LANG2) +#define KC_ALTKN ALT_T(KC_LANG1) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + SFCPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + CTLTB, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, ENT, SPC, RAISE, ALTKN \ + //`--------------------' `--------------------' + ), + + [_LOWER] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + SFCPS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, ENT,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + CTLTB, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, RSFT,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, ENT, SPC, RAISE, ALTKN \ + //`--------------------' `--------------------' + ), + + [_RAISE] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + TAB, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, DEL,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + SFCPS, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, MINS, EQL, LCBR, RCBR, PIPE, BSLS,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + CTLTB, XXXXX, VOLD, VOLU, MUTE, MPLY, UNDS, PLUS, LBRC, RBRC, SLSH, RSFT,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, ENT, SPC, RAISE, ALTKN \ + //`--------------------' `--------------------' + ), + + [_ADJUST] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + RST, LRST, XXXXX, XXXXX, XXXXX, ERST, MNXT, MPRV, MFFD, MRWD, XXXXX, EJCT,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LTOG, LHUI, LSAI, LVAI, PGUP, HOME, LEFT, DOWN, UP, RIGHT, XXXXX, INS,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LMOD, LHUD, LSAD, LVAD, PGDN, END, BRID, BRIU, VOLD, VOLU, MUTE, MPLY,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, ENT, SPC, RAISE, ALTKN \ + //`--------------------' `--------------------' + ) +}; + +int RGB_current_mode; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} diff --git a/keyboards/crkbd/keymaps/omgvee/readme.md b/keyboards/crkbd/keymaps/omgvee/readme.md new file mode 100644 index 00000000000..bc316c2a351 --- /dev/null +++ b/keyboards/crkbd/keymaps/omgvee/readme.md @@ -0,0 +1,18 @@ +# Reade.md for what I want from my HeliDox(CRKBD) layout +====================================================== + + +![My beloved HeliDox keeb](https://i.imgur.com/NbVAB3g.jpg) + +- media keys and media controls +- in-switch LED intensity controls (+/-) +- underglow RGB hue/color controls +- underglow RGB intensity controls +- familiar key arrangement with Enter and symbols on the usual keys (to the right hand side) +- navigation keys should be the vim ones really; +- arrow keys on one layer(most likely on the ADJUST one) + +See keymap.c for layouts + + +P.S> this lil' keeb is so addictive I have no words, really... diff --git a/keyboards/crkbd/keymaps/omgvee/rules.mk b/keyboards/crkbd/keymaps/omgvee/rules.mk new file mode 100644 index 00000000000..88e43aa99f3 --- /dev/null +++ b/keyboards/crkbd/keymaps/omgvee/rules.mk @@ -0,0 +1,32 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +EXTRAFLAGS += -flto +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/crkbd/keymaps/rs/config.h b/keyboards/crkbd/keymaps/rs/config.h new file mode 100644 index 00000000000..9701c2b3f2c --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/config.h @@ -0,0 +1,44 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 300 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/rs/keymap.c b/keyboards/crkbd/keymaps/rs/keymap.c new file mode 100644 index 00000000000..135ccb076c0 --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/keymap.c @@ -0,0 +1,39 @@ +#include QMK_KEYBOARD_H +#include "rs.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , E , R , T , Y , U , I , O , P ,EQL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+ |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LGUI,SPC , BSPC,CODE,FN + // `----+----+----' `+---+----+----'c + ), + [_CODE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV ,EXLM, AT ,HASH, DLR,PERC, CIRC,LPLT,ASTR,RPGT,NEQL, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , 1 , 2 , 3 , 4 , 5 , MINS,LBRC, UP ,RBRC, ,BSLS, + //|----+----+----+----+----+----+ |----+----+----+----+----+----| + , 6 , 7 , 8 , 9 , 0 , AMPR,LEFT,DOWN,RGHT, ,PIPE, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DOT , , , + // `----+----+----' `----+----+----' + ), + [_FN] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10, F11, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LTOG,LHUI,LSAI,LVAI,LRST,BRMU, VOLU, ,PGUP, , , , + //|----+----+----+----+----+----+ |----+----+----+----+----+----| + LMOD,LHUD,LSAD,LVAD,RST ,BRMD, VOLD,CTRA,PGDN,CTRE, , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , MUTE, , + // `----+----+----' `----+----+----' + ), +}; + diff --git a/keyboards/crkbd/keymaps/rs/oled.c b/keyboards/crkbd/keymaps/rs/oled.c new file mode 100644 index 00000000000..c94dff9eda9 --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/oled.c @@ -0,0 +1,104 @@ +#ifdef SSD1306OLED +#include QMK_KEYBOARD_H +#include "ssd1306.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +extern uint8_t is_master; + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_logo(void); +const char *read_keylog(void); +const char *read_keylogs(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); + +void matrix_scan_user(void) { iota_gfx_task(); } + +typedef struct { + uint8_t state; + char name[8]; +} LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 5 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {0, "Base"}, + {2, "Code"}, + {4, "Fn"}, + {6, "Fn+Code"}, + {__UINT8_MAX__, "?"}, +}; +static uint8_t layer_name_idx; +static char layer_status_buf[24] = "Layer: Base\n"; + +#ifdef RGBLIGHT_ENABLE +// Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +void update_keymap_status(void) { + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "Layer:%s RGB: %d\n", + layer_display_name[layer_name_idx].name, rgblight_config.mode); +} +#else +void update_keymap_status(void) { + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "Layer:%s\n", + layer_display_name[layer_name_idx].name); +} +#endif + +void matrix_init_user(void) { + iota_gfx_init(!has_usb()); // turns on the display + update_keymap_status(); +} + +// declared in users/rs/rs.c +void rgb_mod_changed_keymap(void) { + update_keymap_status(); +} + +// declared in users/rs/rs.c +void keylog_set_keymap(uint16_t keycode, keyrecord_t *record) { + set_keylog(keycode, record); +} + +uint32_t layer_state_set_user(uint32_t state) { + for (layer_name_idx = 0; layer_name_idx < LAYER_DISPLAY_MAX; ++layer_name_idx) { + if (state == 0 && layer_display_name[layer_name_idx].state == default_layer_state) { + break; + } else if (state != 0 && layer_display_name[layer_name_idx].state == state) { + break; + } + } + update_keymap_status(); + return state; +} + +static inline void render_keymap_status(struct CharacterMatrix *matrix) { + matrix_write(matrix, layer_status_buf); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + render_keymap_status(matrix); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} + +#endif diff --git a/keyboards/crkbd/keymaps/rs/readme.md b/keyboards/crkbd/keymaps/rs/readme.md new file mode 100644 index 00000000000..d7f7bb6459e --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/readme.md @@ -0,0 +1,19 @@ +# RS40: Code Friendly 40% Keymap + +This keymap is an evolution of my previous keymap optimized for coding with a 60% keyboards like the Iris. I tried to keep the simplicity of my previous keymap with all the keys necessary for coding on a single layer in addition to the base one. + +Because I sometime have to use my internal keyboard I my macbook, a karabiner configuration is also provided to get most of the features of this keyboard, including the code layer / backspace on right command key etc. + +See [rs readme](../../../../users/rs/readme.md) for a list of other keyboards supported by this keymap. + +## Base Layer + +[![](http://poitr.us/moooMf+)](http://www.keyboard-layout-editor.com/##@_backcolor=%23d8c1f5&switchMount=cherry&pcb:false&plate:true%3B&@_x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=E&_x:8%3B&=I%3B&@_y:-0.87&x:2%3B&=W&_x:1%3B&=R&_x:6%3B&=U&_x:1%3B&=O%3B&@_y:-0.8799999999999999&x:5%3B&=T&_x:4%3B&=Y%3B&@_y:-0.87&c=%233a1ee6&t=%23b84465%3B&=Tab&_c=%236750f2&t=%2344b8b8%3B&=Q&_x:12%3B&=P&_c=%233a1ee6&t=%23b84465&a:5%3B&=+%0A%2F=%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=D&_x:8%3B&=K%3B&@_y:-0.8700000000000001&x:2%3B&=S&_x:1%3B&=F&_x:6%3B&=J&_x:1%3B&=L%3B&@_y:-0.8799999999999999&x:5%3B&=G&_x:4%3B&=H%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465&a:5%3B&=Esc%0ACtrl&_c=%236750f2&t=%2344b8b8&a:7%3B&=A&_x:12&a:5%3B&=%2F:%0A%2F%3B&_c=%233a1ee6&t=%23b84465%3B&=%22%0A'%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=C&_x:8&a:5%3B&=%3C%0A,%3B&@_y:-0.8700000000000001&x:2&a:7%3B&=X&_x:1%3B&=V&_x:6%3B&=M&_x:1&a:5%3B&=%3E%0A.%3B&@_y:-0.8799999999999999&x:5&a:7%3B&=B&_x:4%3B&=N%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=Shift&_c=%236750f2&t=%2344b8b8%3B&=Z&_x:12&a:5%3B&=%3F%0A%2F%2F&_c=%233a1ee6&t=%23b84465&a:7%3B&=Enter%3B&@_y:-0.17999999999999972&x:11.75%3B&=Fn%3B&@_ry:0.25&y:2.95&x:3.3%3B&=Alt%3B&@_r:12&ry:1.75&y:0.5&x:4.8%3B&=Cmd%3B&@_r:35&rx:6.5&ry:4.25&y:-0.75&x:-0.75&c=%23d12424&t=%23ffffff&h:1.5%3B&=Space%3B&@_r:-35&rx:13&y:-2.75&x:-3.0999999999999996&h:1.5%3B&=Back%20Space%3B&@_r:-12&rx:0&ry:0&y:5.55&x:9.55&c=%233a1ee6&t=%23b84465%3B&=Code) + +## Code Layer + +[![](http://poitr.us/GvljvC+)](http://www.keyboard-layout-editor.com/##@_backcolor=%23d8c1f5&switchMount=cherry&pcb:false&plate:true%3B&@_x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=%23&_x:8%3B&=*%3B&@_y:-0.87&x:2%3B&=%2F@&_x:1%3B&=$&_x:6&a:5%3B&=%3C%0A(&_x:1%3B&=%3E%0A)%3B&@_y:-0.8799999999999999&x:5&a:7%3B&=%25&_x:4%3B&=%5E%3B&@_y:-0.87&c=%233a1ee6&t=%23b84465%3B&=Tab&_c=%236750f2&t=%2344b8b8%3B&=!&_x:12%3B&=!%2F=&_c=%233a1ee6&t=%23b84465&a:5%3B&=+%0A%2F=%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=3&_x:8%3B&=↑%3B&@_y:-0.8700000000000001&x:2%3B&=2&_x:1%3B&=4&_x:6&a:5%3B&=%7B%0A%5B&_x:1%3B&=%7D%0A%5D%3B&@_y:-0.8799999999999999&x:5&a:7%3B&=5&_x:4&a:5%3B&=%2F_%0A-%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=Esc%0ACtrl&_c=%236750f2&t=%2344b8b8&a:7%3B&=1&_x:12&a:5%3B&=%2F:%0A%2F%3B&_c=%233a1ee6&t=%23b84465%3B&=%7C%0A%5C%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=8&_x:8%3B&=↓%3B&@_y:-0.8700000000000001&x:2%3B&=7&_x:1%3B&=9&_x:6%3B&=←&_x:1%3B&=→%3B&@_y:-0.8799999999999999&x:5%3B&=0&_x:4%3B&=%2F&%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=Shift&_c=%236750f2&t=%2344b8b8%3B&=6&_x:12&a:5%3B&=%3F%0A%2F%2F&_c=%233a1ee6&t=%23b84465&a:7%3B&=Enter%3B&@_y:-0.17999999999999972&x:11.75%3B&=Fn%3B&@_ry:0.25&y:2.95&x:3.3%3B&=Alt%3B&@_r:12&ry:1.75&y:0.5&x:4.8%3B&=Cmd%3B&@_r:35&rx:6.5&ry:4.25&y:-0.75&x:-0.75&c=%23d12424&t=%23ffffff&h:1.5%3B&=.%3B&@_r:-35&rx:13&y:-2.75&x:-3.0999999999999996&h:1.5%3B&=Back%20Space%3B&@_r:-12&rx:0&ry:0&y:5.55&x:9.55&c=%233a1ee6&t=%23b84465%3B&=Code) + +## Fn Layer + +[![](http://poitr.us/OXwmBK+)](http://www.keyboard-layout-editor.com/##@_backcolor=%23d8c1f5&switchMount=cherry&pcb:false&plate:true%3B&@_x:3&c=%236750f2&t=%2344b8b8&a:7%3B&=F3&_x:8%3B&=F8%3B&@_y:-0.87&x:2%3B&=F2&_x:1%3B&=F4&_x:6%3B&=F7&_x:1%3B&=F9%3B&@_y:-0.8799999999999999&x:5%3B&=F5&_x:4%3B&=F6%3B&@_y:-0.87&c=%233a1ee6&t=%23b84465%3B&=&_c=%236750f2&t=%2344b8b8%3B&=F1&_x:12%3B&=F10&_c=%233a1ee6&t=%23b84465%3B&=F11%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8%3B&=RGB%20Value+&_x:8%3B&=Page%20Up%3B&@_y:-0.8700000000000001&x:2%3B&=RGB%20Sat+&_x:1%3B&=RGB%20Reset&_x:6%3B&=&_x:1%3B&=%3B&@_y:-0.8799999999999999&x:5%3B&=Bright+&_x:4%3B&=Vol+%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=RGB%20Toggle&_c=%236750f2&t=%2344b8b8%3B&=RGB%20Hue+&_x:12%3B&=&_c=%233a1ee6&t=%23b84465%3B&=%3B&@_y:-0.3799999999999999&x:3&c=%236750f2&t=%2344b8b8%3B&=RGB%20Value-&_x:8%3B&=Page%20Down%3B&@_y:-0.8700000000000001&x:2%3B&=RGB%20Sat-&_x:1%3B&=Reset&_x:6%3B&=Ctrl+A&_x:1%3B&=Ctrl+E%3B&@_y:-0.8799999999999999&x:5%3B&=Bright-&_x:4%3B&=Vol-%3B&@_y:-0.8700000000000001&c=%233a1ee6&t=%23b84465%3B&=RGB%20Mode&_c=%236750f2&t=%2344b8b8%3B&=RGB%20Hue-&_x:12%3B&=&_c=%233a1ee6&t=%23b84465%3B&=%3B&@_y:-0.17999999999999972&x:11.75%3B&=Fn%3B&@_ry:0.25&y:2.95&x:3.3%3B&=%3B&@_r:12&ry:1.75&y:0.5&x:4.8%3B&=%3B&@_r:35&rx:6.5&ry:4.25&y:-0.75&x:-0.75&c=%23d12424&t=%23ffffff&h:1.5%3B&=%3B&@_r:-35&rx:13&y:-2.75&x:-3.0999999999999996&h:1.5%3B&=Mute%3B&@_r:-12&rx:0&ry:0&y:5.55&x:9.55&c=%233a1ee6&t=%23b84465%3B&=Code) \ No newline at end of file diff --git a/keyboards/crkbd/keymaps/rs/rules.mk b/keyboards/crkbd/keymaps/rs/rules.mk new file mode 100644 index 00000000000..683b4b70ddd --- /dev/null +++ b/keyboards/crkbd/keymaps/rs/rules.mk @@ -0,0 +1,32 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = no + +BOOTLOADER = atmel-dfu + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += oled.c \ + ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ diff --git a/keyboards/crkbd/keymaps/thefrey/README.md b/keyboards/crkbd/keymaps/thefrey/README.md new file mode 100644 index 00000000000..69b20cfcd6a --- /dev/null +++ b/keyboards/crkbd/keymaps/thefrey/README.md @@ -0,0 +1,16 @@ +![the-frey-layout](https://raw.githubusercontent.com/the-frey/the-frey.github.com/master/assets/images/keyboard-layout.jpg) + +# Keyboard layout by the-frey + +This is a layout that allows access to all the paren keys easily, has a tab on the lower layer (for SUPER-TAB app switching) and some utility features like PGUP/PGDOWN and HOME/END. + +In addition, the arrows are on the lower layer and are bound to the vim keys (h,j,k,l). I've found this a productive layout for programming in emacs and hopefully you will too. + +The layout image above shows the keymap, with each key marked with all three layers: + +- The top indicates the raise layer +- The middle indicates the default layer +- The bottom indicates the lower layer + +All the keys respond as you'd expect to the 'shift' key - i.e. on a UK/GB keyboard, `/` becomes `?` and so on. + diff --git a/keyboards/crkbd/keymaps/thefrey/config.h b/keyboards/crkbd/keymaps/thefrey/config.h new file mode 100644 index 00000000000..cee901fc816 --- /dev/null +++ b/keyboards/crkbd/keymaps/thefrey/config.h @@ -0,0 +1,45 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C +#define FORCE_NKRO + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/thefrey/keymap.c b/keyboards/crkbd/keymaps/thefrey/keymap.c new file mode 100644 index 00000000000..9a142a924ae --- /dev/null +++ b/keyboards/crkbd/keymaps/thefrey/keymap.c @@ -0,0 +1,243 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + BACKLIT, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_RST RESET +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LMOD RGB_MOD +#define KC_CTLTB CTL_T(KC_TAB) +#define KC_GUIEI GUI_T(KC_LANG2) +#define KC_ALTKN ALT_T(KC_LANG1) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + CTLTB, A, S, D, F, G, H, J, K, L, SCLN, QUOT,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + //`--------------------' `--------------------' + ), + + [_LOWER] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + TAB, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + CTLTB, MUTE, VOLD, VOLU, PGUP, PGDN, LEFT, DOWN, UP, RIGHT, HOME, END,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, XXXXX,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + //`--------------------' `--------------------' + ), + + [_RAISE] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + ESC, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, BSPC,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + CTLTB, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, MINS, EQL, LCBR, RCBR, PIPE, GRV,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, UNDS, PLUS, LBRC, RBRC, BSLS, TILD,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + //`--------------------' `--------------------' + ), + + [_ADJUST] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + RST, LRST, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ + //`--------------------' `--------------------' + ) +}; + +int RGB_current_mode; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} diff --git a/keyboards/crkbd/keymaps/thefrey/rules.mk b/keyboards/crkbd/keymaps/thefrey/rules.mk new file mode 100644 index 00000000000..16deaf45d1d --- /dev/null +++ b/keyboards/crkbd/keymaps/thefrey/rules.mk @@ -0,0 +1,31 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/crkbd/keymaps/thumb_ctrl/config.h b/keyboards/crkbd/keymaps/thumb_ctrl/config.h new file mode 100755 index 00000000000..5670d8c646f --- /dev/null +++ b/keyboards/crkbd/keymaps/thumb_ctrl/config.h @@ -0,0 +1,44 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 150 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/thumb_ctrl/keymap.c b/keyboards/crkbd/keymaps/thumb_ctrl/keymap.c new file mode 100755 index 00000000000..c67958aa14a --- /dev/null +++ b/keyboards/crkbd/keymaps/thumb_ctrl/keymap.c @@ -0,0 +1,253 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + BACKLIT, + RGBRST +}; + +#define KC_ KC_TRNS +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_RST RESET +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LMOD RGB_MOD +#define KC_CTLTB CTL_T(KC_TAB) +#define KC_GUIEI GUI_T(KC_LANG2) +#define KC_ALTKN ALT_T(KC_LANG1) +#define KC_CTLEN CTL_T(KC_LANG2) // for Linux and Windows +#define KC_GUIEN GUI_T(KC_LANG2) // for Mac +#define KC_SFTJP SFT_T(KC_LANG1) +#define KC_ALTSP ALT_T(KC_SPACE) +#define KC_ALTDL ALT_T(KC_DEL) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + CTLTB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + ALTSP, LOWER, GUIEN, SFTJP, RAISE, ALTDL + //`--------------------' `--------------------' + ), + + [_LOWER] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + , 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, , + //|------+------+------+------+------+------| |------+------+------+------+------+------| + , HOME, END, PGDN, PGUP, F11, LEFT, DOWN, UP, RGHT, F12, PIPE, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + , F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, , + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + , , , , , + //`--------------------' `--------------------' + ), + + [_RAISE] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + , EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, , + //|------+------+------+------+------+------| |------+------+------+------+------+------| + , XXXXX, XXXXX, XXXXX, XXXXX, PSCR, GRV, MINS, PLUS, LCBR, RCBR, BSLS, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + , XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, TILD, UNDS, EQL, LBRC, RBRC, , + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + , , , , , + //`--------------------' `--------------------' + ), + + [_ADJUST] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + RST, LRST, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + GUIEI, LOWER, SPC, ENT, RAISE, ALTKN + //`--------------------' `--------------------' + ) +}; + +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + diff --git a/keyboards/crkbd/keymaps/thumb_ctrl/rules.mk b/keyboards/crkbd/keymaps/thumb_ctrl/rules.mk new file mode 100755 index 00000000000..16deaf45d1d --- /dev/null +++ b/keyboards/crkbd/keymaps/thumb_ctrl/rules.mk @@ -0,0 +1,31 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_left/config.h b/keyboards/crkbd/keymaps/vlukash_trackpad_left/config.h new file mode 100644 index 00000000000..bdd1a099ae8 --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_left/config.h @@ -0,0 +1,21 @@ +#pragma once + +/* Select hand configuration */ + +#define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_left/keymap.c b/keyboards/crkbd/keymaps/vlukash_trackpad_left/keymap.c new file mode 100644 index 00000000000..48f60419fb2 --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_left/keymap.c @@ -0,0 +1,227 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + RGBRST, + MBTN1, + SCRL +}; + +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_RST RESET +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LMOD RGB_MOD + +#define KC_CTLA CTL_T(KC_A) +#define KC_CTLSC CTL_T(KC_SCLN) +#define KC_SFTZ SFT_T(KC_Z) +#define KC_SFTSL SFT_T(KC_SLSH) +#define KC_WINX LWIN_T(KC_X) +#define KC_WINDO RWIN_T(KC_DOT) + +#define KC_MBTN1 MBTN1 +#define KC_SCRL SCRL + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + TAB, CTLA, S, D, F, G, H, J, K, L, CTLSC, QUOT, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + GRAVE, SFTZ, WINX, C, V, B, N, M, COMM, WINDO, SFTSL,BSLASH, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + LOWER, SPC, SCRL, MBTN1, ENT, RAISE + //`--------------------' `--------------------' + ), + + [_LOWER] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + ESC, XXXXX, PGDN, PSCR, PGUP, LBRC, RBRC, 7, 8, 9, XXXXX, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + XXXXX, LCTRL, PLUS, MINS, EQL, LPRN, RPRN, 4, 5, 6, RCTRL, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + XXXXX, LSFT, HOME, XXXXX, END, LCBR, RCBR, 1, 2, 3, RSFT, XXXXX, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + LOWER, SPC, SCRL, MBTN1, ENT, 0 + //`--------------------' `--------------------' + ), + + [_RAISE] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + ESC, XXXXX, F7, F8, F9, F10, BTN2, BTN2, MNXT, MPRV, MPLY, MSTP, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + XXXXX, LCTRL, F4, F5, F6, F11, LEFT, DOWN, UP, RIGHT, RCTRL, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + XXXXX, LSFT, F1, F2, F3, F12, XXXXX, XXXXX, VOLU, VOLD, MUTE, RSFT, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + LOWER, SPC, SCRL, MBTN1, ENT, RAISE + //`--------------------' `--------------------' + ), + + [_ADJUST] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + RST, LRST, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, RST, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + LOWER, SPC, SCRL, MBTN1, ENT, RAISE + //`--------------------' `--------------------' + ) +}; + +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_left/readme.md b/keyboards/crkbd/keymaps/vlukash_trackpad_left/readme.md new file mode 100644 index 00000000000..91b884749fa --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_left/readme.md @@ -0,0 +1,14 @@ +# CrKbd with the Trackpad support + +CrKbd version that supports BlackBerry 8520 trackpad via additional PCB. +See this repository for more details: + - https://github.com/vlukash/corne-trackpad + - https://vlukash.com/2019/01/15/trackpad-in-keycap-corne-crkbd-keyboard + +This firmware is for the Left keyboard. + +# Build + +``` +make crkbd:vlukash_trackpad_left:dfu +``` diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_left/rules.mk b/keyboards/crkbd/keymaps/vlukash_trackpad_left/rules.mk new file mode 100644 index 00000000000..46be73c475b --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_left/rules.mk @@ -0,0 +1,11 @@ +# Build Options +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +BOOTLOADER = atmel-dfu + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_right/config.h b/keyboards/crkbd/keymaps/vlukash_trackpad_right/config.h new file mode 100644 index 00000000000..8cbd8e90782 --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_right/config.h @@ -0,0 +1,35 @@ +#pragma once + +#define NO_DEBUG_LEDS + +// Connector PCB version +// 1 - PCB that supports flex caple and the trackpad sensor is mounted on an 'H' keycap +// - https://github.com/vlukash/corne-trackpad/tree/master/connector +// 2 - PCB woth no flex option, track sensor mounted directly on the PCB +// - https://github.com/vlukash/corne-trackpad/tree/master/connector-no-flex +#define TRACKPAD_CONNECTOR_VER 1 + +/* Select hand configuration */ +#define MASTER_RIGHT + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 300 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* key matrix size */ +// Rows are doubled-up +#undef MATRIX_COL_PINS +#define MATRIX_COL_PINS { F4, F5, F6, F7, B7, D5 } + +/* ws2812 RGB LED */ +#undef RGB_DI_PIN +#define RGB_DI_PIN B5 diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_right/keymap.c b/keyboards/crkbd/keymaps/vlukash_trackpad_right/keymap.c new file mode 100644 index 00000000000..8749f7a6861 --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_right/keymap.c @@ -0,0 +1,199 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#include "mousekey.h" +#include "pointing_device.h" +#include "report.h" + +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif + +extern bool isScrollMode; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + RGBRST, + MBTN1, + SCRL +}; + +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_RST RESET +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LMOD RGB_MOD + +#define KC_CTLA CTL_T(KC_A) +#define KC_CTLSC CTL_T(KC_SCLN) +#define KC_SFTZ SFT_T(KC_Z) +#define KC_SFTSL SFT_T(KC_SLSH) +#define KC_WINX LWIN_T(KC_X) +#define KC_WINDO RWIN_T(KC_DOT) + +#define KC_MBTN1 MBTN1 +#define KC_SCRL SCRL + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + TAB, CTLA, S, D, F, G, H, J, K, L, CTLSC, QUOT, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + GRAVE, SFTZ, WINX, C, V, B, N, M, COMM, WINDO, SFTSL,BSLASH, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + LOWER, SPC, SCRL, MBTN1, ENT, RAISE + //`--------------------' `--------------------' + ), + + [_LOWER] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + ESC, XXXXX, PGDN, PSCR, PGUP, LBRC, RBRC, 7, 8, 9, XXXXX, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + XXXXX, LCTRL, PLUS, MINS, EQL, LPRN, RPRN, 4, 5, 6, RCTRL, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + XXXXX, LSFT, HOME, XXXXX, END, LCBR, RCBR, 1, 2, 3, RSFT, XXXXX, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + LOWER, SPC, SCRL, MBTN1, ENT, 0 + //`--------------------' `--------------------' + ), + + [_RAISE] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + ESC, XXXXX, F7, F8, F9, F10, BTN2, BTN2, MNXT, MPRV, MPLY, MSTP, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + XXXXX, LCTRL, F4, F5, F6, F11, LEFT, DOWN, UP, RIGHT, RCTRL, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + XXXXX, LSFT, F1, F2, F3, F12, XXXXX, XXXXX, VOLU, VOLD, MUTE, RSFT, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + LOWER, SPC, SCRL, MBTN1, ENT, RAISE + //`--------------------' `--------------------' + ), + + [_ADJUST] = LAYOUT_kc( + //,-----------------------------------------. ,-----------------------------------------. + RST, LRST, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, RST, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + LOWER, SPC, SCRL, MBTN1, ENT, RAISE + //`--------------------' `--------------------' + ) +}; + +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + report_mouse_t currentReport = {}; + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + case MBTN1: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + currentReport.buttons |= MOUSE_BTN1; + } + else { + currentReport.buttons &= ~MOUSE_BTN1; + } + pointing_device_set_report(currentReport); + pointing_device_send(); + return false; + case SCRL: + if (record->event.pressed) { + isScrollMode = true; + } + else { + isScrollMode = false; + } + return false; + } + return true; +} diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_right/readme.md b/keyboards/crkbd/keymaps/vlukash_trackpad_right/readme.md new file mode 100644 index 00000000000..cd511018c14 --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_right/readme.md @@ -0,0 +1,14 @@ +# CrKbd with the Trackpad support + +CrKbd version that supports BlackBerry 8520 trackpad via additional PCB. +See this repository for more details: + - https://github.com/vlukash/corne-trackpad + - https://vlukash.com/2019/01/15/trackpad-in-keycap-corne-crkbd-keyboard + +This firmware is for the Right keyboard. + +# Build + +``` +make crkbd:vlukash_trackpad_right:dfu +``` diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_right/rules.mk b/keyboards/crkbd/keymaps/vlukash_trackpad_right/rules.mk new file mode 100644 index 00000000000..bd53c192119 --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_right/rules.mk @@ -0,0 +1,10 @@ +# Build Options +POINTING_DEVICE_ENABLE = yes # Generic Pointer, not as big as mouse keys hopefully. +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +BOOTLOADER = atmel-dfu + +# Add support for the BB 8520 trackpad +SRC += trackpad.c diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.c b/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.c new file mode 100644 index 00000000000..afccb8c7edc --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.c @@ -0,0 +1,78 @@ +#include "trackpad.h" + +// bool isScrollingMode = false; +bool isScrollMode = false; + +void pointing_device_init(void){ + + SPI_Init(SPI_SPEED_FCPU_DIV_8 | SPI_MODE_MASTER); + + // Set as output + TP_RESET_INIT; + TP_SHUTDOWN_INIT; + TP_CS_INIT; + LVL_SHIFT_EN_INIT; + + // Reset level shifter + LVL_SHIFT_EN_LO; + wait_ms(100); + LVL_SHIFT_EN_HI; + + // Force a BB-8520 reset + TP_RESET_HI; + wait_ms(100); + TP_RESET_LO; + + // Turn on BB-8520 trackpad + TP_SHUTDOWN_LO; + + TP_CS_HI; +} + +uint8_t readRegister(uint8_t address) { + uint8_t data; + + TP_CS_LO; + + // Read the data + SPI_TransferByte(address); + data = SPI_TransferByte(0x00); + + TP_CS_HI; + + return data; +} + +void pointing_device_task(void){ + uint8_t motion = readRegister(0x02); + + // Motion has occurred on the trackpad + if (motion > 127) { + + int8_t dx, dy; + + if(TRACKPAD_CONNECTOR_VER == 1) { + dx = readRegister(0x03); + dy = -readRegister(0x04); + } + else { + dy = -readRegister(0x03); + dx = -readRegister(0x04); + } + + report_mouse_t currentReport = pointing_device_get_report(); + if (isScrollMode) + { + currentReport.h = dx/SCROLL_SPEED_DIVIDER; + currentReport.v = dy/SCROLL_SPEED_DIVIDER; + } + else + { + currentReport.x = dx * POINTER_SPEED_MULTIPLIER; + currentReport.y = dy * POINTER_SPEED_MULTIPLIER; + } + + pointing_device_set_report(currentReport); + pointing_device_send(); + } +} diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h b/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h new file mode 100644 index 00000000000..755abc7de21 --- /dev/null +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h @@ -0,0 +1,32 @@ +#pragma once + +#include "pointing_device.h" +#include "quantum.h" +#include "report.h" +#include +#include "../../lib/lufa/LUFA/Drivers/Peripheral/SPI.h" + +// Trackpad speed adjustments +#define POINTER_SPEED_MULTIPLIER 2 +#define SCROLL_SPEED_DIVIDER 6 + +// Pins on corresponding ports +#define TP_RESET 1 +#define TP_SHUTDOWN 0 +#define TP_CS 0 +#define LVL_SHIFT_EN 7 + +// Configure as output +#define TP_RESET_INIT DDRF |= (1 << TP_RESET); +#define TP_SHUTDOWN_INIT DDRF |= (1 << TP_SHUTDOWN); +#define TP_CS_INIT DDRB |= (1 << TP_CS); +#define LVL_SHIFT_EN_INIT DDRC |= (1 << LVL_SHIFT_EN); + +#define TP_RESET_HI PORTF |= (1 << TP_RESET); +#define TP_RESET_LO PORTF &= ~ (1 << TP_RESET); +#define TP_SHUTDOWN_HI PORTF |= (1 << TP_SHUTDOWN); +#define TP_SHUTDOWN_LO PORTF &= ~ (1 << TP_SHUTDOWN); +#define TP_CS_HI PORTB |= (1 << TP_CS); +#define TP_CS_LO PORTB &= ~ (1 << TP_CS); +#define LVL_SHIFT_EN_HI PORTC |= (1 << LVL_SHIFT_EN); +#define LVL_SHIFT_EN_LO PORTC &= ~ (1 << LVL_SHIFT_EN); diff --git a/keyboards/crkbd/keymaps/vxid/README.md b/keyboards/crkbd/keymaps/vxid/README.md new file mode 100644 index 00000000000..7b0f9b8af5a --- /dev/null +++ b/keyboards/crkbd/keymaps/vxid/README.md @@ -0,0 +1,3 @@ +# Vxid crkbd layout + +Inspired by sdothum's wide planck layout. diff --git a/keyboards/crkbd/keymaps/vxid/config.h b/keyboards/crkbd/keymaps/vxid/config.h new file mode 100644 index 00000000000..bbf76d705f8 --- /dev/null +++ b/keyboards/crkbd/keymaps/vxid/config.h @@ -0,0 +1,44 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +#define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/vxid/keymap.c b/keyboards/crkbd/keymaps/vxid/keymap.c new file mode 100644 index 00000000000..e1c73caeb7a --- /dev/null +++ b/keyboards/crkbd/keymaps/vxid/keymap.c @@ -0,0 +1,85 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif + +extern keymap_config_t keymap_config; + +extern uint8_t is_master; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_LOWER LOWER +#define KC_RAISE RAISE + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( \ + //,-----------------------------------------. ,-----------------------------------------. + Q, W, E, R, T, ESC, DEL, Y, U, I, O, P,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + A, S, D, F, G, SPC, BSPC, H, J, K, L, SCLN,\ + //|------+------+------+------+------+------| |------+------+------+------+------+------| + Z, X, C, V, B, TAB, ENT, N, M, COMM, DOT, SLSH,\ + //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + LALT, LGUI, LCTL, LSFT, RAISE, LOWER \ + //`--------------------' `--------------------' + ), + + [_LOWER] = LAYOUT_kc( \ + //,-----------------------------------------. ,------------------------------------------. + 1, 2, 3, 4, 5, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------| |-------+------+------+------+------+------| + 6, 7, 8, 9, 0, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------| |-------+------+------+------+------+------| + EQL, PLUS, MINS, SLSH, ASTR, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------+------| |------+-------+------+------+------+------+------| + LALT, LGUI, LCTL, LSFT, RAISE, LOWER \ + //`--------------------' `--------------------' + ), + + [_RAISE] = LAYOUT_kc( \ + //,-----------------------------------------. ,------------------------------------------. + EXLM, AT, HASH, DLR, PERC, LPRN, RPRN, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------| |-------+------+------+------+------+------| + CIRC, AMPR, ASTR, QUOT, DQUO, LCBR, RCBR, LEFT, DOWN, UP, RIGHT, XXXXX,\ + //|------+------+------+------+------+------| |-------+------+------+------+------+------| + BSLS, TILD, GRV, UNDS, PIPE, LBRC, RBRC, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+------+------+------+------+------+------| |------+-------+------+------+------+------+------| + LALT, LGUI, LCTL, LSFT, RAISE, LOWER \ + //`--------------------' `--------------------' + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + } + return true; +} diff --git a/keyboards/crkbd/keymaps/vxid/rules.mk b/keyboards/crkbd/keymaps/vxid/rules.mk new file mode 100644 index 00000000000..83e87ecf989 --- /dev/null +++ b/keyboards/crkbd/keymaps/vxid/rules.mk @@ -0,0 +1,31 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/crkbd/lib/layer_state_reader.c b/keyboards/crkbd/lib/layer_state_reader.c index eddb71337eb..63d80b136cc 100644 --- a/keyboards/crkbd/lib/layer_state_reader.c +++ b/keyboards/crkbd/lib/layer_state_reader.c @@ -3,11 +3,12 @@ #include #include "crkbd.h" +// in the future, should use (1U<<_LAYER_NAME) instead, but needs to be moved to keymap,c #define L_BASE 0 -#define L_LOWER 8 -#define L_RAISE 16 -#define L_ADJUST 65536 -#define L_ADJUST_TRI 65560 +#define L_LOWER 2 +#define L_RAISE 4 +#define L_ADJUST 8 +#define L_ADJUST_TRI 14 char layer_state_str[24]; diff --git a/keyboards/crkbd/readme.md b/keyboards/crkbd/readme.md index 591fdfe0da9..2f599544a56 100644 --- a/keyboards/crkbd/readme.md +++ b/keyboards/crkbd/readme.md @@ -1,5 +1,6 @@ -Crkbd -=== +# Corne Keyboard (CRKBD) + +Also known (incorrectly) as the `HeliDox`. ![Crkbd](https://user-images.githubusercontent.com/736191/40575636-6fba63a4-6123-11e8-9ca0-3f990f1f9f4c.jpg) @@ -13,6 +14,80 @@ Hardware Availability: [PCB & Case Data](https://github.com/foostan/crkbd) Make example for this keyboard (after setting up your build environment): - make crkbd:default +```sh +make crkbd:default +``` See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## RGB Matrix +The Corne Keyboard also supports using the RGB Matrix feature, in place of RGB Light. This provids a better experience when using the keyboard, as it supports a number of per key effects properly. If you're not using the in switch LEDs, then you may want to pass on doing this. + +In your keymap's `rules.mk` file, add the following: + +```make +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = WS2812 +``` + +And in your `config.h` file, add the following: + +```c + +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) +// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) +// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash. +# define RGB_MATRIX_HUE_STEP 8 +# define RGB_MATRIX_SAT_STEP 8 +# define RGB_MATRIX_VAL_STEP 8 +# define RGB_MATRIX_SPD_STEP 10 + +/* Disable the animations you don't want/need. You will need to disable a good number of these * + * because they take up a lot of space. Disable until you can successfully compile your firmware. */ +// # define DISABLE_RGB_MATRIX_ALPHAS_MODS +// # define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// # define DISABLE_RGB_MATRIX_BREATHING +// # define DISABLE_RGB_MATRIX_CYCLE_ALL +// # define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +// # define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN +// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +// # define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +// # define DISABLE_RGB_MATRIX_DUAL_BEACON +// # define DISABLE_RGB_MATRIX_RAINBOW_BEACON +// # define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +// # define DISABLE_RGB_MATRIX_RAINDROPS +// # define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +// # define DISABLE_RGB_MATRIX_TYPING_HEATMAP +// # define DISABLE_RGB_MATRIX_DIGITAL_RAIN +// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE +// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +// # define DISABLE_RGB_MATRIX_SPLASH +// # define DISABLE_RGB_MATRIX_MULTISPLASH +// # define DISABLE_RGB_MATRIX_SOLID_SPLASH +// # define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif +``` + +However, to properly handle the LED matrix, two LED maps had to be used. One for the left half, and one for the right half. For the left, you don't need to do anything. That's the default setup. But for the right side, you need to add `RGB_MATRIX_SPLIT_RIGHT=yes` needs to be added to the command. + +First, compile and flash the left half. Then when that's done, recompile with the setting above. It should look something like: + +```sh +make crkbd:default RGB_MATRIX_SPLIT_RIGHT=yes +``` +And then flash this new firmware image. + +After this is done, you should be able to use the normal RGB keycodes, but you'll see the RGB Matrix effects in use, giving a much better experience. diff --git a/keyboards/crkbd/rev1/config.h b/keyboards/crkbd/rev1/config.h index 915779060b9..200923db552 100644 --- a/keyboards/crkbd/rev1/config.h +++ b/keyboards/crkbd/rev1/config.h @@ -23,7 +23,7 @@ along with this program. If not, see . #define PRODUCT_ID 0x3060 #define DEVICE_VER 0x0001 #define MANUFACTURER foostan -#define PRODUCT Crkbd +#define PRODUCT Corne Keyboard (crkbd) #define DESCRIPTION A split keyboard with 3x6 vertically staggered keys and 3 thumb keys /* key matrix size */ @@ -43,22 +43,24 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 +#ifdef RGBLIGHT_ENABLE #define RGBLED_NUM 12 // Number of LEDs +#endif + +#ifdef RGB_MATRIX_ENABLE +#define RGBLED_NUM 54 // Number of LEDs +#define DRIVER_LED_TOTAL RGBLED_NUM +#endif /* * Feature disable options diff --git a/keyboards/crkbd/rev1/matrix.c b/keyboards/crkbd/rev1/matrix.c index 718cc574481..dd93506db1d 100644 --- a/keyboards/crkbd/rev1/matrix.c +++ b/keyboards/crkbd/rev1/matrix.c @@ -93,6 +93,44 @@ uint8_t matrix_cols(void) return MATRIX_COLS; } +void tx_rx_leds_init(void) +{ +#ifndef NO_DEBUG_LEDS + TX_RX_LED_INIT; + TXLED0; + RXLED0; +#endif +} + +void tx_led_on(void) +{ +#ifndef NO_DEBUG_LEDS + TXLED1; +#endif +} + +void tx_led_off(void) +{ +#ifndef NO_DEBUG_LEDS + TXLED0; +#endif +} + +void rx_led_on(void) +{ +#ifndef NO_DEBUG_LEDS + RXLED1; +#endif +} + +void rx_led_off(void) +{ +#ifndef NO_DEBUG_LEDS + RXLED0; +#endif +} + + void matrix_init(void) { debug_enable = true; @@ -102,9 +140,7 @@ void matrix_init(void) unselect_rows(); init_cols(); - TX_RX_LED_INIT; - TXLED0; - RXLED0; + tx_rx_leds_init(); // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { @@ -189,10 +225,10 @@ int serial_transaction(int master_changed) { int ret=serial_update_buffers(); #endif if (ret ) { - if(ret==2) RXLED1; + if(ret==2) rx_led_on(); return 1; } - RXLED0; + rx_led_off(); memcpy(&matrix[slaveOffset], (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); return 0; @@ -241,7 +277,7 @@ uint8_t matrix_master_scan(void) { if( serial_transaction(mchanged) ) { #endif // turn on the indicator led when halves are disconnected - TXLED1; + tx_led_on(); error_count++; @@ -254,7 +290,7 @@ uint8_t matrix_master_scan(void) { } } else { // turn off the indicator led on no error - TXLED0; + tx_led_off(); error_count = 0; } matrix_scan_quantum(); diff --git a/keyboards/crkbd/rev1/rev1.c b/keyboards/crkbd/rev1/rev1.c index 6523feebade..24800358d59 100644 --- a/keyboards/crkbd/rev1/rev1.c +++ b/keyboards/crkbd/rev1/rev1.c @@ -1,32 +1,102 @@ #include "crkbd.h" -#ifdef AUDIO_ENABLE - float tone_startup[][2] = SONG(STARTUP_SOUND); - float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - //led_set_user(usb_led); -} -#endif +#ifdef RGB_MATRIX_ENABLE -void matrix_init_kb(void) { + // Logical Layout + // Columns + // Left + // 0 1 2 3 4 5 + // ROWS + // 25 24 19 18 11 10 0 + // 03 02 01 + // 26 23 20 17 12 09 1 + // 04 05 06 + // 27 22 21 16 13 08 2 + // + // 15 14 07 3 + // + // Right + // 0 1 2 3 4 5 + // ROWS + // 25 24 19 18 11 10 4 + // 03 02 01 + // 26 23 20 17 12 09 5 + // 04 05 06 + // 27 22 21 16 13 08 6 + // + // 15 14 07 7 + // + // Physical Layout + // Columns + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 + // ROWS + // 25 24 19 18 11 10 10 11 18 19 24 25 0 + // 03 02 01 01 02 03 + // 26 23 20 17 12 09 09 12 17 20 23 26 1 + // 04 04 + // 27 22 21 16 13 08 08 13 16 21 22 27 2 + // 05 06 06 05 + // 15 14 07 07 14 15 3 - #ifdef AUDIO_ENABLE - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); - #endif - matrix_init_user(); -}; - -void shutdown_kb(void) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); - #endif -} +#ifdef RGB_MATRIX_SPLIT_RIGHT +led_config_t g_led_config = { { + { 51, 50, 45, 44, 37, 36, NO_LED }, + { 52, 49, 46, 43, 38, 35, NO_LED }, + { 53, 48, 47, 42, 39, 34, NO_LED }, + { NO_LED, NO_LED, NO_LED, 41, 40, 33, NO_LED }, + { 24, 23, 18, 17, 10, 9, NO_LED }, + { 25, 22, 19, 16, 11, 8, NO_LED }, + { 26, 21, 20, 15, 12, 7, NO_LED }, + { NO_LED, NO_LED, NO_LED, 14, 13, 6, NO_LED } +}, { + { 139, 16 }, { 174, 13 }, { 208, 20 }, { 208, 38 }, { 174, 48 }, { 139, 52 }, { 129, 63 }, + { 139, 39 }, { 139, 21 }, { 139, 4 }, { 156, 2 }, { 156, 19 }, { 156, 37 }, { 144, 58 }, + { 164, 55 }, { 174, 35 }, { 174, 13 }, { 174, 0 }, { 191, 3 }, { 191, 20 }, { 191, 37 }, + { 208, 42 }, { 208, 24 }, { 208, 7 }, { 224, 7 }, { 224, 24 }, { 224, 41 }, { 85, 16 }, + { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, { 95, 63 }, { 85, 39 }, + { 85, 21 }, { 85, 4 }, { 68, 2 }, { 68, 19 }, { 68, 37 }, { 80, 58 }, { 60, 55 }, + { 50, 35 }, { 50, 13 }, { 50, 0 }, { 33, 3 }, { 33, 20 }, { 33, 37 }, { 16, 42 }, + { 16, 24 }, { 16, 7 }, { 0, 7 }, { 0, 24 }, { 0, 41 } +}, { + 2, 2, 2, 2, 2, 2, 1, + 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 1, 4, + 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1 +} }; +#else +led_config_t g_led_config = { { + { 24, 23, 18, 17, 10, 9, NO_LED }, + { 25, 22, 19, 16, 11, 8, NO_LED }, + { 26, 21, 20, 15, 12, 7, NO_LED }, + { NO_LED, NO_LED, NO_LED, 14, 13, 6, NO_LED }, + { 51, 50, 45, 44, 37, 36, NO_LED }, + { 52, 49, 46, 43, 38, 35, NO_LED }, + { 53, 48, 47, 42, 39, 34, NO_LED }, + { NO_LED, NO_LED, NO_LED, 41, 40, 33, NO_LED } +}, { + { 85, 16 }, { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, { 95, 63 }, + { 85, 39 }, { 85, 21 }, { 85, 4 }, { 68, 2 }, { 68, 19 }, { 68, 37 }, { 80, 58 }, + { 60, 55 }, { 50, 35 }, { 50, 13 }, { 50, 0 }, { 33, 3 }, { 33, 20 }, { 33, 37 }, + { 16, 42 }, { 16, 24 }, { 16, 7 }, { 0, 7 }, { 0, 24 }, { 0, 41 }, { 139, 16 }, + { 174, 13 }, { 208, 20 }, { 208, 38 }, { 174, 48 }, { 139, 52 }, { 129, 63 }, { 139, 39 }, + { 139, 21 }, { 139, 4 }, { 156, 2 }, { 156, 19 }, { 156, 37 }, { 144, 58 }, { 164, 55 }, + { 174, 35 }, { 174, 13 }, { 174, 0 }, { 191, 3 }, { 191, 20 }, { 191, 37 }, { 208, 42 }, + { 208, 24 }, { 208, 7 }, { 224, 7 }, { 224, 24 }, { 224, 41 } +}, { + 2, 2, 2, 2, 2, 2, 1, + 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 1, 4, + 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1 +} }; +#endif +#endif diff --git a/keyboards/crkbd/rev1/rev1.h b/keyboards/crkbd/rev1/rev1.h index cdd61d2bf9a..9023248e28f 100644 --- a/keyboards/crkbd/rev1/rev1.h +++ b/keyboards/crkbd/rev1/rev1.h @@ -1,23 +1,28 @@ #pragma once -#include "../crkbd.h" +#include "crkbd.h" -//void promicro_bootloader_jmp(bool program); +// void promicro_bootloader_jmp(bool program); #include "quantum.h" -#ifdef RGBLIGHT_ENABLE -//rgb led driver -#include "ws2812.h" +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" #endif -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include +#ifdef SSD1306OLED + #include "ssd1306.h" #endif + +#ifdef USE_I2C + #include + #ifdef __AVR__ + #include + #include + #endif #endif +// clang-format off //void promicro_bootloader_jmp(bool program); #define LAYOUT( \ L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ @@ -48,3 +53,4 @@ KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ KC_##L30, KC_##L31, KC_##L32, KC_##R30, KC_##R31, KC_##R32 \ ) +// clang-format on diff --git a/keyboards/crkbd/rev1/rules.mk b/keyboards/crkbd/rev1/rules.mk index 6028b5a5b95..30778637507 100644 --- a/keyboards/crkbd/rev1/rules.mk +++ b/keyboards/crkbd/rev1/rules.mk @@ -1,3 +1,9 @@ -SRC += rev1/matrix.c -SRC += rev1/split_util.c -SRC += rev1/split_scomm.c +RGB_MATRIX_SPLIT_RIGHT = no # if no, order LEDs for left hand, if yes, order LEDs for right hand + +ifeq ($(strip $(RGB_MATRIX_SPLIT_RIGHT)), yes) + OPT_DEFS += -DRGB_MATRIX_SPLIT_RIGHT +endif + +SRC += matrix.c \ + split_util.c \ + split_scomm.c diff --git a/keyboards/crkbd/rev1/serial_config.h b/keyboards/crkbd/rev1/serial_config.h index 671ed821d24..4fab8e8ddfc 100644 --- a/keyboards/crkbd/rev1/serial_config.h +++ b/keyboards/crkbd/rev1/serial_config.h @@ -1,10 +1,4 @@ -#pragma once - -/* Soft Serial defines */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect - +#ifndef SOFT_SERIAL_PIN +#define SOFT_SERIAL_PIN D2 #define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/crkbd/rev1/split_scomm.c b/keyboards/crkbd/rev1/split_scomm.c index 9719eb22ea1..a1fe6ba5b82 100644 --- a/keyboards/crkbd/rev1/split_scomm.c +++ b/keyboards/crkbd/rev1/split_scomm.c @@ -7,8 +7,8 @@ #include #include #include "serial.h" -#ifdef SERIAL_DEBUG_MODE -#include +#ifdef CONSOLE_ENABLE + #include #endif uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; @@ -17,6 +17,7 @@ uint8_t volatile status_com = 0; uint8_t volatile status1 = 0; uint8_t slave_buffer_change_count = 0; uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; SSTD_t transactions[] = { #define GET_SLAVE_STATUS 0 @@ -41,12 +42,12 @@ SSTD_t transactions[] = { void serial_master_init(void) { - soft_serial_initiator_init(transactions); + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } void serial_slave_init(void) { - soft_serial_target_init(transactions); + soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error @@ -54,19 +55,36 @@ void serial_slave_init(void) // 2 => checksum error int serial_update_buffers(int master_update) { - int status; + int status, smatstatus; static int need_retry = 0; - if( s_change_old != slave_buffer_change_count ) { - status = soft_serial_transaction(GET_SLAVE_BUFFER); - if( status == TRANSACTION_END ) - s_change_old = slave_buffer_change_count; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3]); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; } - if( !master_update && !need_retry) - status = soft_serial_transaction(GET_SLAVE_STATUS); - else - status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); - need_retry = ( status == TRANSACTION_END ) ? 0 : 1; - return status; + return smatstatus; } #endif // SERIAL_USE_MULTI_TRANSACTION diff --git a/keyboards/crkbd/rev1/split_scomm.h b/keyboards/crkbd/rev1/split_scomm.h index 16887eb74f7..873d8939d81 100644 --- a/keyboards/crkbd/rev1/split_scomm.h +++ b/keyboards/crkbd/rev1/split_scomm.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef SPLIT_COMM_H +#define SPLIT_COMM_H #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ @@ -19,3 +20,5 @@ void serial_slave_init(void); int serial_update_buffers(int master_changed); #endif + +#endif /* SPLIT_COMM_H */ diff --git a/keyboards/crkbd/rev1/split_util.h b/keyboards/crkbd/rev1/split_util.h index f593047560a..687ca19bd3e 100644 --- a/keyboards/crkbd/rev1/split_util.h +++ b/keyboards/crkbd/rev1/split_util.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef SPLIT_KEYBOARD_UTIL_H +#define SPLIT_KEYBOARD_UTIL_H #include #include "eeconfig.h" @@ -14,3 +15,5 @@ void split_keyboard_setup(void); bool has_usb(void); void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/crkbd/rules.mk b/keyboards/crkbd/rules.mk index 426ed0c03f3..950000a7ecb 100644 --- a/keyboards/crkbd/rules.mk +++ b/keyboards/crkbd/rules.mk @@ -1,12 +1,11 @@ -SRC += i2c.c -SRC += serial.c +QUANTUM_LIB_SRC += i2c.c \ + serial.c SRC += ssd1306.c # if firmware size over limit, try this option # CFLAGS += -flto # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -55,7 +54,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration @@ -65,9 +64,8 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = no -USE_I2C = yes +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/crkbd/serial.c b/keyboards/crkbd/serial.c index 11ceff0b37c..325c29a3f70 100644 --- a/keyboards/crkbd/serial.c +++ b/keyboards/crkbd/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU @@ -14,8 +19,58 @@ #include "serial.h" //#include -#ifdef USE_SERIAL +#ifdef SOFT_SERIAL_PIN +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 @@ -42,56 +97,118 @@ SSTD_t transactions[] = { }; void serial_master_init(void) -{ soft_serial_initiator_init(transactions); } +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } void serial_slave_init(void) -{ soft_serial_target_init(transactions); } +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error // 1 => slave did not respond // 2 => checksum error int serial_update_buffers() -{ return soft_serial_transaction(); } +{ + int result; + result = soft_serial_transaction(); + return result; +} -#endif // Simple API (OLD API, compatible with let's split serial.c) +#endif // end of Simple API (OLD API, compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) #define NO_INLINE __attribute__((noinline)) #define _delay_sub_us(x) __builtin_avr_delay_cycles(x) -// Serial pulse period in microseconds. -#define TID_SEND_ADJUST 14 +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif -#define SELECT_SERIAL_SPEED 1 -#if SELECT_SERIAL_SPEED == 0 +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 1 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 2 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 3 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 4 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed - #define SERIAL_DELAY 50 // micro sec + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #else -#error Illegal Serial Speed -#endif - +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) @@ -105,17 +222,21 @@ int serial_update_buffers() #endif static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); } +inline static void serial_delay_half2(void) ALWAYS_INLINE; inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); @@ -135,6 +256,7 @@ void serial_input_with_pullup(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); @@ -152,30 +274,28 @@ void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void soft_serial_initiator_init(SSTD_t *sstd_table) +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_output(); serial_high(); } -void soft_serial_target_init(SSTD_t *sstd_table) +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_input_with_pullup(); -#if SERIAL_PIN_MASK == _BV(PD0) - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -#elif SERIAL_PIN_MASK == _BV(PD2) - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; #else - #error unknown SERIAL_PIN_MASK value + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; #endif } @@ -191,7 +311,7 @@ void sync_recv(void) { } // Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void)NO_INLINE; +static void sync_send(void) NO_INLINE; static void sync_send(void) { serial_low(); @@ -205,12 +325,12 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { uint8_t byte, i, p, pb; _delay_sub_us(READ_WRITE_START_ADJUST); - for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { serial_delay_half1(); // read the middle of pulses if( serial_read_pin() ) { - byte = (byte << 1) | 1; p ^= 1; + byte = (byte << 1) | 1; p ^= 1; } else { - byte = (byte << 1) | 0; p ^= 0; + byte = (byte << 1) | 0; p ^= 0; } _delay_sub_us(READ_WRITE_WIDTH_ADJUST); serial_delay_half2(); @@ -230,13 +350,13 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; void serial_write_chunk(uint8_t data, uint8_t bit) { uint8_t b, p; - for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { - if(data & b) { - serial_high(); p ^= 1; - } else { - serial_low(); p ^= 0; - } - serial_delay(); + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } /* send parity bit */ if(p & 1) { serial_high(); } @@ -288,6 +408,13 @@ void change_reciver2sender(void) { serial_delay_half1(); //4 } +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + // interrupt handle to be used by the target device ISR(SERIAL_PIN_INTERRUPT) { @@ -297,12 +424,15 @@ ISR(SERIAL_PIN_INTERRUPT) { SSTD_t *trans = Transaction_table; #else // recive transaction table index - uint8_t tid; + uint8_t tid, bits; uint8_t pecount = 0; sync_recv(); - tid = serial_read_chunk(&pecount,4); - if(pecount> 0) + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { return; + } serial_delay_half1(); serial_high(); // response step1 low->high @@ -315,17 +445,17 @@ ISR(SERIAL_PIN_INTERRUPT) { // target send phase if( trans->target2initiator_buffer_size > 0 ) serial_send_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size); + trans->target2initiator_buffer_size); // target switch to input change_sender2reciver(); // target recive phase if( trans->initiator2target_buffer_size > 0 ) { if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size) ) { - *trans->status = TRANSACTION_ACCEPTED; + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; } else { - *trans->status = TRANSACTION_DATA_ERROR; + *trans->status = TRANSACTION_DATA_ERROR; } } else { *trans->status = TRANSACTION_ACCEPTED; @@ -349,6 +479,8 @@ int soft_serial_transaction(void) { SSTD_t *trans = Transaction_table; #else int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; SSTD_t *trans = &Transaction_table[sstd_index]; #endif cli(); @@ -375,9 +507,10 @@ int soft_serial_transaction(int sstd_index) { #else // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); sync_send(); _delay_sub_us(TID_SEND_ADJUST); - serial_write_chunk(sstd_index, 4); + serial_write_chunk(tid, 7); serial_delay_half1(); // wait for the target response (step1 low->high) @@ -389,12 +522,12 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; } _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } @@ -404,12 +537,12 @@ int soft_serial_transaction(int sstd_index) { // if the target is present syncronize with it if( trans->target2initiator_buffer_size > 0 ) { if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size) ) { - serial_output(); - serial_high(); - *trans->status = TRANSACTION_DATA_ERROR; - sei(); - return TRANSACTION_DATA_ERROR; + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; } } @@ -419,7 +552,7 @@ int soft_serial_transaction(int sstd_index) { // initiator send phase if( trans->initiator2target_buffer_size > 0 ) { serial_send_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size); + trans->initiator2target_buffer_size); } // always, release the line when not in use @@ -442,3 +575,16 @@ int soft_serial_get_and_clean_status(int sstd_index) { #endif #endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/crkbd/serial.h b/keyboards/crkbd/serial.h index 76c6aaa0434..7e0c0847a43 100644 --- a/keyboards/crkbd/serial.h +++ b/keyboards/crkbd/serial.h @@ -1,16 +1,19 @@ -#pragma once +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H #include // ///////////////////////////////////////////////////////////////// -// Need Soft Serial defines in serial_config.h +// Need Soft Serial defines in config.h // ///////////////////////////////////////////////////////////////// // ex. -// #define SERIAL_PIN_DDR DDRD -// #define SERIAL_PIN_PORT PORTD -// #define SERIAL_PIN_INPUT PIND -// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 -// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps // // //// USE Simple API (OLD API, compatible with let's split serial.c) // ex. @@ -46,16 +49,18 @@ typedef struct _SSTD_t { uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) // initiator is transaction start side -void soft_serial_initiator_init(SSTD_t *sstd_table); +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); // target is interrupt accept side -void soft_serial_target_init(SSTD_t *sstd_table); +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); // initiator resullt #define TRANSACTION_END 0 #define TRANSACTION_NO_RESPONSE 0x1 #define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 #ifndef SERIAL_USE_MULTI_TRANSACTION int soft_serial_transaction(void); #else @@ -71,7 +76,9 @@ int soft_serial_transaction(int sstd_index); // target: // TRANSACTION_DATA_ERROR // or TRANSACTION_ACCEPTED -#define TRANSACTION_ACCEPTED 0x4 +#define TRANSACTION_ACCEPTED 0x8 #ifdef SERIAL_USE_MULTI_TRANSACTION int soft_serial_get_and_clean_status(int sstd_index); #endif + +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/crkbd/ssd1306.c b/keyboards/crkbd/ssd1306.c index 205ce67a9e0..20c2738db77 100644 --- a/keyboards/crkbd/ssd1306.c +++ b/keyboards/crkbd/ssd1306.c @@ -13,7 +13,7 @@ #include "sendchar.h" #include "timer.h" -static const unsigned char font[] PROGMEM; +extern const unsigned char font[] PROGMEM; // Set this to 1 to help diagnose early startup problems // when testing power-on with ble. Turn it off otherwise, @@ -24,12 +24,17 @@ static const unsigned char font[] PROGMEM; //static uint16_t last_battery_update; //static uint32_t vbat; //#define BatteryUpdateInterval 10000 /* milliseconds */ -#define ScreenOffInterval 300000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ #if DEBUG_TO_SCREEN static uint8_t displaying; #endif static uint16_t last_flush; +static bool force_dirty = true; + // Write command sequence. // Returns true on success. static inline bool _send_cmd1(uint8_t cmd) { @@ -321,12 +326,19 @@ void iota_gfx_task_user(void) { void iota_gfx_task(void) { iota_gfx_task_user(); - if (display.dirty) { + if (display.dirty|| force_dirty) { iota_gfx_flush(); + force_dirty = false; } if (timer_elapsed(last_flush) > ScreenOffInterval) { iota_gfx_off(); } } + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + #endif diff --git a/keyboards/crkbd/ssd1306.h b/keyboards/crkbd/ssd1306.h index 76dd6a2a72d..ea8c9232805 100644 --- a/keyboards/crkbd/ssd1306.h +++ b/keyboards/crkbd/ssd1306.h @@ -3,6 +3,7 @@ #include #include #include "pincontrol.h" +#include "action.h" enum ssd1306_cmds { DisplayOff = 0xAE, @@ -86,3 +87,5 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data); void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); \ No newline at end of file diff --git a/keyboards/cu24/config.h b/keyboards/cu24/config.h index df009c953a6..7bb49816b9d 100644 --- a/keyboards/cu24/config.h +++ b/keyboards/cu24/config.h @@ -45,9 +45,9 @@ #define MATRIX_COL_PINS { F0, F1, D0, D1 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL - + /* Backlight */ #define BACKLIGHT_PIN B5 #define BACKLIGHT_BREATHING @@ -59,7 +59,7 @@ #define RGBLIGHT_ANIMATIONS /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -107,11 +107,6 @@ * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/cu24/keymaps/default/keymap.c b/keyboards/cu24/keymaps/default/keymap.c index 73427ee8aba..e6db359edfb 100644 --- a/keyboards/cu24/keymaps/default/keymap.c +++ b/keyboards/cu24/keymaps/default/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "cu24.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_grid( /* Base */ @@ -35,22 +35,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -/* Use this function to add macros */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } diff --git a/keyboards/cu24/readme.md b/keyboards/cu24/readme.md index 4624c1aa968..ca3f3f5a040 100644 --- a/keyboards/cu24/readme.md +++ b/keyboards/cu24/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make CU24:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/cu24/rules.mk b/keyboards/cu24/rules.mk index 86f1a8479c5..01d74ac473d 100644 --- a/keyboards/cu24/rules.mk +++ b/keyboards/cu24/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/cu75/config.h b/keyboards/cu75/config.h index c21e1da017f..e01f947a020 100644 --- a/keyboards/cu75/config.h +++ b/keyboards/cu75/config.h @@ -42,7 +42,7 @@ along with this program. If not, see . #define RGBLIGHT_VAL_STEP 17 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -89,11 +89,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/cu75/keymaps/default/config.h b/keyboards/cu75/keymaps/default/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/cu75/keymaps/default/config.h +++ b/keyboards/cu75/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/cu75/keymaps/default/keymap.c b/keyboards/cu75/keymaps/default/keymap.c index 9fbd41089b0..c78c5cd121d 100644 --- a/keyboards/cu75/keymaps/default/keymap.c +++ b/keyboards/cu75/keymaps/default/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -//Define a clearer 'transparent' key code -#define _______ KC_TRNS - enum keymap_layout { VANILLA = 0, FUNC, @@ -61,21 +58,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape - }; - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/cu75/keymaps/default/rules.mk b/keyboards/cu75/keymaps/default/rules.mk index 39f6eca8b04..fd26d69fb6e 100644 --- a/keyboards/cu75/keymaps/default/rules.mk +++ b/keyboards/cu75/keymaps/default/rules.mk @@ -23,10 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install thi WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - ifeq ($(strip $(ISSI_ENABLE)), yes) TMK_COMMON_DEFS += -DISSI_ENABLE endif diff --git a/keyboards/cu75/keymaps/iso/keymap.c b/keyboards/cu75/keymaps/iso/keymap.c index 7f5952c1c2e..18bd9a59ae7 100644 --- a/keyboards/cu75/keymaps/iso/keymap.c +++ b/keyboards/cu75/keymaps/iso/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -//Define a clearer 'transparent' key code -#define _______ KC_TRNS - enum keymap_layout { VANILLA = 0, FUNC, @@ -60,21 +57,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape - }; - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/cu75/keymaps/iso/rules.mk b/keyboards/cu75/keymaps/iso/rules.mk index f8b4d556897..9407f110346 100644 --- a/keyboards/cu75/keymaps/iso/rules.mk +++ b/keyboards/cu75/keymaps/iso/rules.mk @@ -23,10 +23,6 @@ ISSI_ENABLE = no # If the I2C pullup resistors aren't install this WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - ifeq ($(strip $(ISSI_ENABLE)), yes) TMK_COMMON_DEFS += -DISSI_ENABLE endif diff --git a/keyboards/cu75/readme.md b/keyboards/cu75/readme.md index a5193bd7070..43603440fd2 100644 --- a/keyboards/cu75/readme.md +++ b/keyboards/cu75/readme.md @@ -14,4 +14,4 @@ Make example for this keyboard (after setting up your build environment): make CU75:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/daisy/config.h b/keyboards/daisy/config.h index d2ab92f875b..567a215a6c7 100644 --- a/keyboards/daisy/config.h +++ b/keyboards/daisy/config.h @@ -29,15 +29,14 @@ #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B6, B5, B4, D7, D6 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW - + #define BACKLIGHT_PIN D0 #define BACKLIGHT_LEVELS 6 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -82,11 +81,6 @@ * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/daisy/keymaps/default/keymap.c b/keyboards/daisy/keymaps/default/keymap.c index 833620b01f2..9a520ba55d9 100644 --- a/keyboards/daisy/keymaps/default/keymap.c +++ b/keyboards/daisy/keymaps/default/keymap.c @@ -64,16 +64,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RS] = LAYOUT( RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_END, KC_PGDN, KC_TRNS, - KC_TRNS, RGB_TOG, RGB_SMOD, RGB_HUD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, BL_STEP, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case LOWER: diff --git a/keyboards/daisy/readme.md b/keyboards/daisy/readme.md index 427891d96e6..c8175c28303 100644 --- a/keyboards/daisy/readme.md +++ b/keyboards/daisy/readme.md @@ -10,7 +10,7 @@ Make example for this keyboard (after setting up your build environment): make daisy:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. # Other Keymaps diff --git a/keyboards/daisy/rules.mk b/keyboards/daisy/rules.mk index 8157b168e5d..5a7cc564c29 100644 --- a/keyboards/daisy/rules.mk +++ b/keyboards/daisy/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -63,4 +62,4 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/dc01/arrow/config.h b/keyboards/dc01/arrow/config.h index 75c674f6316..801dbb54de1 100644 --- a/keyboards/dc01/arrow/config.h +++ b/keyboards/dc01/arrow/config.h @@ -45,16 +45,15 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F0, B7, D2 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -104,11 +103,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/dc01/arrow/matrix.c b/keyboards/dc01/arrow/matrix.c index 68abb6791a7..1823138c39d 100644 --- a/keyboards/dc01/arrow/matrix.c +++ b/keyboards/dc01/arrow/matrix.c @@ -36,11 +36,11 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -155,7 +155,7 @@ uint8_t matrix_scan(void) // Set row, read cols for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); if (matrix_changed) { @@ -173,7 +173,7 @@ uint8_t matrix_scan(void) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); if (matrix_changed) { debouncing = true; @@ -187,29 +187,29 @@ uint8_t matrix_scan(void) #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } debouncing = false; } # endif - + if (USB_DeviceState != DEVICE_STATE_Configured){ - txbuffer[1] = 0x55; + i2c_slave_reg[1] = 0x55; for (uint8_t i = 0; i < MATRIX_ROWS; i++){ - txbuffer[i+2] = matrix[i]; //send matrix over i2c + i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c } } - + matrix_scan_quantum(); return 1; } bool matrix_is_modified(void) { -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) if (debouncing) return false; #endif return true; @@ -218,7 +218,7 @@ bool matrix_is_modified(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1. #define F_SCL 300000UL -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -107,11 +106,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/dc01/left/matrix.c b/keyboards/dc01/left/matrix.c index 806583580d7..0e7b591f82c 100644 --- a/keyboards/dc01/left/matrix.c +++ b/keyboards/dc01/left/matrix.c @@ -42,11 +42,11 @@ static uint8_t error_count_arrow = 0; /* Set 0 if debouncing isn't needed */ -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -158,7 +158,7 @@ void matrix_init(void) { matrix[i] = 0; matrix_debouncing[i] = 0; } - + matrix_init_quantum(); } @@ -169,7 +169,7 @@ uint8_t matrix_scan(void) // Set row, read cols for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); if (matrix_changed) { @@ -187,7 +187,7 @@ uint8_t matrix_scan(void) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); if (matrix_changed) { debouncing = true; @@ -201,15 +201,15 @@ uint8_t matrix_scan(void) #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } debouncing = false; } # endif - + if (i2c_transaction(SLAVE_I2C_ADDRESS_RIGHT, 0x3F, 0)){ //error has occured for main right half error_count_right++; if (error_count_right > ERROR_DISCONNECT_COUNT){ //disconnect half @@ -220,7 +220,7 @@ uint8_t matrix_scan(void) }else{ //no error error_count_right = 0; } - + if (i2c_transaction(SLAVE_I2C_ADDRESS_ARROW, 0X3FFF, 8)){ //error has occured for arrow cluster error_count_arrow++; if (error_count_arrow > ERROR_DISCONNECT_COUNT){ //disconnect arrow cluster @@ -249,7 +249,7 @@ uint8_t matrix_scan(void) bool matrix_is_modified(void) { -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) if (debouncing) return false; #endif return true; @@ -258,7 +258,7 @@ bool matrix_is_modified(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1. #define MATRIX_COL_PINS { F0, B7, D2, D3 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -104,11 +103,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/dc01/numpad/keymaps/default/keymap.c b/keyboards/dc01/numpad/keymaps/default/keymap.c index a4461a7d4e5..6c88d445fcb 100644 --- a/keyboards/dc01/numpad/keymaps/default/keymap.c +++ b/keyboards/dc01/numpad/keymaps/default/keymap.c @@ -15,9 +15,6 @@ */ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_numpad_5x4( TG(1), KC_PSLS, KC_PAST, KC_PMNS, \ diff --git a/keyboards/dc01/numpad/keymaps/ortho_5x4/keymap.c b/keyboards/dc01/numpad/keymaps/ortho_5x4/keymap.c index cde2b26e21f..133f33cb005 100644 --- a/keyboards/dc01/numpad/keymaps/ortho_5x4/keymap.c +++ b/keyboards/dc01/numpad/keymaps/ortho_5x4/keymap.c @@ -15,9 +15,6 @@ */ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum custom_keycodes { KC_P00 = SAFE_RANGE }; diff --git a/keyboards/dc01/numpad/matrix.c b/keyboards/dc01/numpad/matrix.c index f9a9a7f63d7..f8b725adc28 100644 --- a/keyboards/dc01/numpad/matrix.c +++ b/keyboards/dc01/numpad/matrix.c @@ -36,11 +36,11 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -155,7 +155,7 @@ uint8_t matrix_scan(void) // Set row, read cols for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); if (matrix_changed) { @@ -173,7 +173,7 @@ uint8_t matrix_scan(void) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); if (matrix_changed) { debouncing = true; @@ -187,29 +187,29 @@ uint8_t matrix_scan(void) #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } debouncing = false; } # endif - + if (USB_DeviceState != DEVICE_STATE_Configured){ - txbuffer[1] = 0x55; + i2c_slave_reg[1] = 0x55; for (uint8_t i = 0; i < MATRIX_ROWS; i++){ - txbuffer[i+2] = matrix[i]; //send matrix over i2c + i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c } } - + matrix_scan_quantum(); return 1; } bool matrix_is_modified(void) { -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) if (debouncing) return false; #endif return true; @@ -218,7 +218,7 @@ bool matrix_is_modified(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1. #define MATRIX_COL_PINS { F1, E6, F6, F5, F4, D4, D6, D7 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -104,11 +103,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/dc01/right/matrix.c b/keyboards/dc01/right/matrix.c index aa2e880d01e..6ec3a3b7231 100644 --- a/keyboards/dc01/right/matrix.c +++ b/keyboards/dc01/right/matrix.c @@ -36,11 +36,11 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -155,7 +155,7 @@ uint8_t matrix_scan(void) // Set row, read cols for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); if (matrix_changed) { @@ -173,7 +173,7 @@ uint8_t matrix_scan(void) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); if (matrix_changed) { debouncing = true; @@ -187,29 +187,29 @@ uint8_t matrix_scan(void) #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } debouncing = false; } # endif - + if (USB_DeviceState != DEVICE_STATE_Configured){ - txbuffer[1] = 0x55; + i2c_slave_reg[1] = 0x55; for (uint8_t i = 0; i < MATRIX_ROWS; i++){ - txbuffer[i+2] = matrix[i]; //send matrix over i2c + i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c } } - + matrix_scan_quantum(); return 1; } bool matrix_is_modified(void) { -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) if (debouncing) return false; #endif return true; @@ -218,7 +218,7 @@ bool matrix_is_modified(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1. */ +#pragma once + #define USE_SERIAL #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - - -#ifdef SUBPROJECT_v2 - #include "../../v2/config.h" -#endif -#ifdef SUBPROJECT_protosplit - #include "../../protosplit/config.h" -#endif diff --git a/keyboards/deltasplit75/keymaps/default/keymap.c b/keyboards/deltasplit75/keymaps/default/keymap.c index 8824986120c..fc34d1cec9b 100644 --- a/keyboards/deltasplit75/keymaps/default/keymap.c +++ b/keyboards/deltasplit75/keymaps/default/keymap.c @@ -7,11 +7,6 @@ extern keymap_config_t keymap_config; // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -// Fillers to make layering more clear - -#define _______ KC_TRNS - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_v2( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, diff --git a/keyboards/deltasplit75/keymaps/itsaferbie/keymap.c b/keyboards/deltasplit75/keymaps/itsaferbie/keymap.c index d7857294fb4..8eadc7aee12 100644 --- a/keyboards/deltasplit75/keymaps/itsaferbie/keymap.c +++ b/keyboards/deltasplit75/keymaps/itsaferbie/keymap.c @@ -7,11 +7,6 @@ extern keymap_config_t keymap_config; // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -// Fillers to make layering more clear - -#define _______ KC_TRNS - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer *,-----------------------------------------------------------------------. diff --git a/keyboards/deltasplit75/keymaps/itsaferbie/rules.mk b/keyboards/deltasplit75/keymaps/itsaferbie/rules.mk index 75db99ebece..92f24224c78 100644 --- a/keyboards/deltasplit75/keymaps/itsaferbie/rules.mk +++ b/keyboards/deltasplit75/keymaps/itsaferbie/rules.mk @@ -2,6 +2,3 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. AUDIO_ENABLE = no # Audio disabled while using RGB underlight. EXTRAKEY_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/deltasplit75/keymaps/mbsurfer/keymap.c b/keyboards/deltasplit75/keymaps/mbsurfer/keymap.c index d42d15da047..cba17015de9 100644 --- a/keyboards/deltasplit75/keymaps/mbsurfer/keymap.c +++ b/keyboards/deltasplit75/keymaps/mbsurfer/keymap.c @@ -9,9 +9,6 @@ extern keymap_config_t keymap_config; // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -// Fillers to make layering more clear -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,---------------------------- ----------------------------------------. diff --git a/keyboards/deltasplit75/keymaps/protosplit/keymap.c b/keyboards/deltasplit75/keymaps/protosplit/keymap.c index 5505f978029..7d6cb33949a 100644 --- a/keyboards/deltasplit75/keymaps/protosplit/keymap.c +++ b/keyboards/deltasplit75/keymaps/protosplit/keymap.c @@ -7,11 +7,6 @@ extern keymap_config_t keymap_config; // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -// Fillers to make layering more clear - -#define _______ KC_TRNS - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_protosplit( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, diff --git a/keyboards/deltasplit75/matrix.c b/keyboards/deltasplit75/matrix.c index 1ac5c5039d8..28198d89b0e 100644 --- a/keyboards/deltasplit75/matrix.c +++ b/keyboards/deltasplit75/matrix.c @@ -37,11 +37,11 @@ along with this program. If not, see . # include "serial.h" #endif -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -140,7 +140,7 @@ uint8_t _matrix_scan(void) #if (DIODE_DIRECTION == COL2ROW) // Set row, read cols for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); if (matrix_changed) { @@ -157,7 +157,7 @@ uint8_t _matrix_scan(void) #elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); if (matrix_changed) { debouncing = true; @@ -170,8 +170,8 @@ uint8_t _matrix_scan(void) } #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { matrix[i+offset] = matrix_debouncing[i+offset]; } diff --git a/keyboards/deltasplit75/readme.md b/keyboards/deltasplit75/readme.md index 990f8902d0e..096fced97f2 100644 --- a/keyboards/deltasplit75/readme.md +++ b/keyboards/deltasplit75/readme.md @@ -11,7 +11,7 @@ Make example for this keyboard (after setting up your build environment): make deltasplit75/v2:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Files are available here: [DeltaSplit75 Case Files](https://github.com/xyxjj/DeltaSplit75-Case-files) diff --git a/keyboards/deltasplit75/rules.mk b/keyboards/deltasplit75/rules.mk index 5c7571b9dbc..eadea189294 100644 --- a/keyboards/deltasplit75/rules.mk +++ b/keyboards/deltasplit75/rules.mk @@ -4,7 +4,6 @@ SRC += matrix.c \ serial.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/deltasplit75/v2/config.h b/keyboards/deltasplit75/v2/config.h index 475a5c9dc54..6a2e48f4f4f 100644 --- a/keyboards/deltasplit75/v2/config.h +++ b/keyboards/deltasplit75/v2/config.h @@ -47,18 +47,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 @@ -82,5 +77,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - #endif diff --git a/keyboards/dichotemy/config.h b/keyboards/dichotemy/config.h deleted file mode 100644 index 1d92cf74e57..00000000000 --- a/keyboards/dichotemy/config.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xACC7 -#define DEVICE_VER 0x0001 -#define MANUFACTURER unknown -#define PRODUCT Dichotemy -#define DESCRIPTION q.m.k. keyboard firmware for Dichotemy - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 12 - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -//#define BACKLIGHT_LEVELS 3 - -#define ONESHOT_TIMEOUT 500 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_DATA UDR1 -#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) -#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT() do { \ - /* baud rate */ \ - UBRR1L = SERIAL_UART_UBRR; \ - /* baud rate */ \ - UBRR1H = SERIAL_UART_UBRR >> 8; \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ - } while(0) - -#endif diff --git a/keyboards/dichotemy/dichotemy.c b/keyboards/dichotemy/dichotemy.c deleted file mode 100644 index 080c2654cd1..00000000000 --- a/keyboards/dichotemy/dichotemy.c +++ /dev/null @@ -1,86 +0,0 @@ -#include "dichotemy.h" -#include "pointing_device.h" -#include "report.h" - -void uart_init(void) { - SERIAL_UART_INIT(); -} - -void pointing_device_task(void){ - report_mouse_t currentReport = {}; - SERIAL_UART_INIT(); - uint32_t timeout = 0; - - //the m character requests the RF slave to send the mouse report - SERIAL_UART_DATA = 'm'; - - //trust the external inputs completely, erase old data - uint8_t uart_data[5] = {0}; - - //there are 10 bytes corresponding to 10 columns, and an end byte - for (uint8_t i = 0; i < 5; i++) { - //wait for the serial data, timeout if it's been too long - //this only happened in testing with a loose wire, but does no - //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ - timeout++; - if (timeout > 10000){ - break; - } - } - uart_data[i] = SERIAL_UART_DATA; - } - - //check for the end packet, bits 1-4 are movement and scroll - //but bit 5 has bits 0-3 for the scroll button state - //(1000 if pressed, 0000 if not) and bits 4-7 are always 1 - //We can use this to verify the report sent properly. - if (uart_data[4] == 0x0F || uart_data[4] == 0x8F) - { - currentReport = pointing_device_get_report(); - //shifting and transferring the info to the mouse report varaible - //mouseReport.x = 127 max -127 min - currentReport.x = uart_data[0]; - //mouseReport.y = 127 max -127 min - currentReport.y = uart_data[1]; - //mouseReport.v = 127 max -127 min (scroll vertical) - currentReport.v = uart_data[2]; - //mouseReport.h = 127 max -127 min (scroll horizontal) - currentReport.h = uart_data[3]; - //mouseReport.buttons = 0x31 max (bitmask for mouse buttons 1-5) 0x00 min - //mouse buttons 1 and 2 are handled by the keymap, but not 3 - if (uart_data[4] == 0x0F) { //then 3 is not pressed - currentReport.buttons &= ~MOUSE_BTN3; //MOUSE_BTN3 is def in report.h - } else { //3 must be pressed - currentReport.buttons |= MOUSE_BTN3; - } - pointing_device_set_report(currentReport); - } - pointing_device_send(); -} - -void led_init(void) { - DDRD |= (1<<1); - PORTD |= (1<<1); - DDRF |= (1<<4) | (1<<5); - PORTF |= (1<<4) | (1<<5); -} - - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - uart_init(); - led_init(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -} - -void led_set_kb(uint8_t usb_led) { - -} diff --git a/keyboards/dichotemy/dichotemy.h b/keyboards/dichotemy/dichotemy.h deleted file mode 100644 index 1d617d91c9d..00000000000 --- a/keyboards/dichotemy/dichotemy.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef DICHOTEMY_H -#define DICHOTEMY_H - -#include "quantum.h" -#include "matrix.h" -#include "backlight.h" -#include - -#define red_led_off PORTF |= (1<<5) -#define red_led_on PORTF &= ~(1<<5) -#define blu_led_off PORTF |= (1<<4) -#define blu_led_on PORTF &= ~(1<<4) -#define grn_led_off PORTD |= (1<<1) -#define grn_led_on PORTD &= ~(1<<1) - -#define set_led_off red_led_off; grn_led_off; blu_led_off -#define set_led_red red_led_on; grn_led_off; blu_led_off -#define set_led_blue red_led_off; grn_led_off; blu_led_on -#define set_led_green red_led_off; grn_led_on; blu_led_off -#define set_led_yellow red_led_on; grn_led_on; blu_led_off -#define set_led_magenta red_led_on; grn_led_off; blu_led_on -#define set_led_cyan red_led_off; grn_led_on; blu_led_on -#define set_led_white red_led_on; grn_led_on; blu_led_on - -/* -#define LED_B 5 -#define LED_R 6 -#define LED_G 7 - -#define all_leds_off PORTF &= ~(1<event.pressed) { - num_timer = timer_read(); - number_singular_key = true; - layer_invert(_NM); - } else { - if (timer_elapsed(num_timer) < MAX_TOGGLE_LENGTH && number_singular_key) { - //do nothing, the layer has already been inverted - } else { - layer_invert(_NM); - } - } - update_tri_layer(_NM, _SF, _NS); - return false; - break; - //SHIFT is handled as LSHIFT in the general case - 'toggle' shoudl activate caps, while the layer is only active when shift is held. - case SFTKEY: - if (record->event.pressed) { - shift_held = true; - shift_suspended = false; - shift_timer = timer_read(); - shift_singular_key = true; - layer_on(_SF); - register_code(KC_LSFT); - } else { - shift_held = false; - if (timer_elapsed(shift_timer) < MAX_TOGGLE_LENGTH && shift_singular_key) { - //this was basically a toggle, so activate/deactivate caps lock. - SEND_STRING(SS_TAP(X_CAPSLOCK)); - } - layer_off(_SF); - unregister_code(KC_LSFT); - } - update_tri_layer(_NM, _SF, _NS); - return false; - break; - //MOUSE layer needs to be handled the same way as NUMKEY, but differently from shift - case MOUSE: - if (record->event.pressed) { - mouse_timer = timer_read(); - mouse_singular_key = true; - layer_invert(_MS); - } else { - if (timer_elapsed(mouse_timer) < MAX_TOGGLE_LENGTH && number_singular_key){ - //do nothing, it was a toggle (and it's already been toggled) - } else { - layer_invert(_MS); - } - } - return false; - break; - //Custom macros for strange keys with different long-tap behavior - case CK_1G: - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - shift_singular_key = false; - number_singular_key = false; - mouse_singular_key = false; - if (record->event.pressed) { - special_timers[CK_1G-SAFE_RANGE] = timer_read(); - } else { - if (special_key_states[CK_1G-SAFE_RANGE]){ - //key was activated after longpress_delay, need to close those keycodes - special_key_states[CK_1G-SAFE_RANGE] = 0; - unregister_code(KC_GRAVE); - } else { - //key was not activated, return macro activating proper, pre-long-tap key - SEND_STRING(SS_TAP(X_1)); - } - special_timers[CK_1G-SAFE_RANGE] = 0xFFFF; - } - break; - case CK_BSPE: - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - shift_singular_key = false; - number_singular_key = false; - mouse_singular_key = false; - if (record->event.pressed) { - special_timers[CK_BSPE-SAFE_RANGE] = timer_read(); - } else { - if (special_key_states[CK_BSPE-SAFE_RANGE]){ - //key was activated after longpress_delay, need to close those keycodes - special_key_states[CK_BSPE-SAFE_RANGE] = 0; - unregister_code(KC_ENTER); - } else { - //key was not activated, return macro activating proper, pre-long-tap key - SEND_STRING(SS_TAP(X_BSLASH)); - } - special_timers[CK_BSPE-SAFE_RANGE] = 0xFFFF; - } - break; - case CK_QE: - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - shift_singular_key = false; - number_singular_key = false; - mouse_singular_key = false; - if (record->event.pressed) { - special_timers[CK_QE-SAFE_RANGE] = timer_read(); - } else { - if (special_key_states[CK_QE-SAFE_RANGE]){ - //key was activated after longpress_delay, need to close those keycodes - special_key_states[CK_QE-SAFE_RANGE] = 0; - unregister_code(KC_ENTER); - } else { - //key was not activated, return macro activating proper, pre-long-tap key - SEND_STRING(SS_TAP(X_QUOTE)); - } - special_timers[CK_QE-SAFE_RANGE] = 0xFFFF; - } - break; - case CK_TE: - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - if (record->event.pressed) { - special_timers[CK_TE-SAFE_RANGE] = timer_read(); - } else { - if (special_key_states[CK_TE-SAFE_RANGE]){ - //key was activated after longpress_delay, need to close those keycodes - special_key_states[CK_TE-SAFE_RANGE] = 0; - unregister_code(KC_ENTER); - } else { - //key was not activated, return macro activating proper, pre-long-tap key - SEND_STRING(SS_TAP(X_TAB)); - } - special_timers[CK_TE-SAFE_RANGE] = 0xFFFF; - } - break; - //No-shift keys, they unregister the KC_LSFT code so they can send - //unshifted values - but they don't change the bool. if any other - //key is pressed and the bool is set, KC_LSFT is registered again. - case NS_HYPH: - if (record->event.pressed) { - shift_suspended = true; - unregister_code(KC_LSFT); - register_code(KC_MINS); - } else { - unregister_code(KC_MINS); - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - } - break; - case NS_EQU: - if (record->event.pressed) { - shift_suspended = true; - unregister_code(KC_LSFT); - register_code(KC_EQUAL); - } else { - unregister_code(KC_EQUAL); - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - } - break; - - //mouse buttons, for 1-3, to update the mouse report: - case MS_BTN1: - currentReport = pointing_device_get_report(); - if (record->event.pressed) { - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - //update mouse report here - currentReport.buttons |= MOUSE_BTN1; //MOUSE_BTN1 is a const defined in report.h - } else { - //update mouse report here - currentReport.buttons &= ~MOUSE_BTN1; - } - pointing_device_set_report(currentReport); - break; - case MS_BTN2: - currentReport = pointing_device_get_report(); - if (record->event.pressed) { - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - //update mouse report here - currentReport.buttons |= MOUSE_BTN2; //MOUSE_BTN2 is a const defined in report.h - } else { - //update mouse report here - } - pointing_device_set_report(currentReport); - break; - //there is a case for button 3, but that's handled in dichotemy.c, and this is being - //disabled to avoid any conflict. - /*case MS_BTN3: - currentReport = pointing_device_get_report(); - if (record->event.pressed) { - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - //update mouse report here - currentReport.buttons |= MOUSE_BTN3; //MOUSE_BTN2 is a const defined in report.h - } else { - //update mouse report here - } - pointing_device_set_report(currentReport); - break;*/ - - //If any other key was pressed during the layer mod hold period, - //then the layer mod was used momentarily, and should block latching - //Additionally, if NS_ keys are in use, then shift may be held (but is - //disabled for the unshifted keycodes to be send. Check the bool and - //register shift as necessary. - default: - if (shift_held){ - register_code(KC_LSFT); - } - shift_singular_key = false; - number_singular_key = false; - mouse_singular_key = false; - break; - } - return true; -}; - -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - for (uint8_t i = 0; i= LONGPRESS_DELAY && !special_key_states[i]){ - switch (i + SAFE_RANGE){ - case CK_1G: - register_code(KC_GRAVE); - break; - case CK_BSPE: - register_code(KC_ENTER); - break; - case CK_QE: - register_code(KC_ENTER); - break; - case CK_TE: - register_code(KC_ESCAPE); - break; - } - special_key_states[i] = 1; - } - } - switch (layer) { - case _BS: - set_led_off; - break; - case _NM: - set_led_blue; - break; - case _SF: - set_led_red; - break; - case _NS: - set_led_green; - break; - default: - break; - } -}; - diff --git a/keyboards/dichotemy/matrix.c b/keyboards/dichotemy/matrix.c deleted file mode 100644 index f2841df1dec..00000000000 --- a/keyboards/dichotemy/matrix.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2014 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -#define MAIN_ROWMASK 0xFFF0; -#define LOWER_ROWMASK 0x1F80; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -void matrix_init(void) { - - matrix_init_quantum(); -} - -uint8_t matrix_scan(void) -{ - SERIAL_UART_INIT(); - - uint32_t timeout = 0; - - //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; - - //trust the external keystates entirely, erase the last data - uint8_t uart_data[7] = {0}; - - //there are 10 bytes corresponding to 10 columns, and an end byte - for (uint8_t i = 0; i < 7; i++) { - //wait for the serial data, timeout if it's been too long - //this only happened in testing with a loose wire, but does no - //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ - timeout++; - if (timeout > 10000){ - break; - } - } - uart_data[i] = SERIAL_UART_DATA; - } - - //check for the end packet, the key state bytes use the LSBs, so 0xE0 - //will only show up here if the correct bytes were recieved - if (uart_data[6] == 0x96) { //this is an arbitrary binary checksum (10010110) - //shifting and transferring the keystates to the QMK matrix variable - //bits 1-12 are row 1, 13-24 are row 2, 25-36 are row 3, - //bits 37-42 are row 4 (only 6 wide, 1-3 are 0, and 10-12 are 0) - //bits 43-48 are row 5 (same as row 4) - /* ASSUMING MSB FIRST */ - matrix[0] = (((uint16_t) uart_data[0] << 8) | ((uint16_t) uart_data[1])) & MAIN_ROWMASK; - matrix[1] = ((uint16_t) uart_data[1] << 12) | ((uint16_t) uart_data[2] << 4); - matrix[2] = (((uint16_t) uart_data[3] << 8) | ((uint16_t) uart_data[4])) & MAIN_ROWMASK; - matrix[3] = (((uint16_t) uart_data[4] << 9) | ((uint16_t) uart_data[5] << 1)) & LOWER_ROWMASK; - matrix[4] = ((uint16_t) uart_data[5] << 7) & LOWER_ROWMASK; - /* OK, TURNS OUT THAT WAS A BAD ASSUMPTION */ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - //I've unpacked these into the mirror image of what QMK expects them to be, so... - matrix[i] = ((matrix[i] * 0x0802LU & 0x22110LU) | (matrix[i] * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; - //bithack mirror! Doesn't make any sense, but works - and efficiently. - } - } - - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1.c` and see keymap document (you can find in top readme.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with a keymap like this: - -``` -$ make [default|jack|] -``` -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/dichotemy/rules.mk b/keyboards/dichotemy/rules.mk deleted file mode 100644 index 4e9db86875a..00000000000 --- a/keyboards/dichotemy/rules.mk +++ /dev/null @@ -1,75 +0,0 @@ - -OPT_DEFS += -DDICHOTEMY_PROMICRO -DICHOTEMY_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) - -# # project specific files -SRC = matrix.c - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -#MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -POINTING_DEVICE_ENABLE = yes # Generic Pointer, not as big as mouse keys hopefully. -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -CUSTOM_MATRIX = yes # Remote matrix from the wireless bridge -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# MIDI_ENABLE = YES # MIDI controls -UNICODE_ENABLE = YES # Unicode -# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID - -USB = /dev/ttyACM0 - -#upload: build -# $(DICHOTEMY_UPLOAD_COMMAND) diff --git a/keyboards/dichotomy/config.h b/keyboards/dichotomy/config.h new file mode 100755 index 00000000000..2fc098fe343 --- /dev/null +++ b/keyboards/dichotomy/config.h @@ -0,0 +1,79 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xACC7 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Broekhuijsen +#define PRODUCT Dichotomy +#define DESCRIPTION q.m.k. keyboard firmware for Dichotomy + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +//#define BACKLIGHT_LEVELS 3 + +#define ONESHOT_TIMEOUT 500 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +//UART settings for communication with the RF microcontroller +#define SERIAL_UART_BAUD 1000000 +#define SERIAL_UART_DATA UDR1 +#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) +#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) +#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) +#define SERIAL_UART_INIT() do { \ + /* baud rate */ \ + UBRR1L = SERIAL_UART_UBRR; \ + /* baud rate */ \ + UBRR1H = SERIAL_UART_UBRR >> 8; \ + /* enable TX and RX */ \ + UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ + /* 8-bit data */ \ + UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ + } while(0) + +#endif diff --git a/keyboards/dichotomy/dichotomy.c b/keyboards/dichotomy/dichotomy.c new file mode 100755 index 00000000000..41e12090cbd --- /dev/null +++ b/keyboards/dichotomy/dichotomy.c @@ -0,0 +1,89 @@ +#include "dichotomy.h" + +void uart_init(void) { + SERIAL_UART_INIT(); +} + +void pointing_device_task(void){ + /*report_mouse_t currentReport = {}; + SERIAL_UART_INIT(); + uint32_t timeout = 0; + + //the m character requests the RF slave to send the mouse report + SERIAL_UART_DATA = 'm'; + + //trust the external inputs completely, erase old data + uint8_t uart_data[5] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 5; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while(!SERIAL_UART_RXD_PRESENT){ + timeout++; + if (timeout > 10000){ + xprintf("\r\nTIMED OUT"); + break; + } + } + xprintf("\r\nGOT DATA for %d",i); + uart_data[i] = SERIAL_UART_DATA; + } + + //check for the end packet, bytes 1-4 are movement and scroll + //but byte 5 has bits 0-3 for the scroll button state + //(1000 if pressed, 0000 if not) and bits 4-7 are always 1 + //We can use this to verify the report sent properly. + if (uart_data[4] == 0x0F || uart_data[4] == 0x8F) + { + xprintf("\r\nREQUESTED MOUSE, RECEIVED %i, %i, %i, %i, %i",uart_data[0],uart_data[1],uart_data[2],uart_data[3],uart_data[4]); + currentReport = pointing_device_get_report(); + //shifting and transferring the info to the mouse report varaible + //mouseReport.x = 127 max -127 min + currentReport.x = (int8_t) uart_data[0]; + //mouseReport.y = 127 max -127 min + currentReport.y = (int8_t) uart_data[1]; + //mouseReport.v = 127 max -127 min (scroll vertical) + currentReport.v = (int8_t) uart_data[2]; + //mouseReport.h = 127 max -127 min (scroll horizontal) + currentReport.h = (int8_t) uart_data[3]; + //mouseReport.buttons = 0x31 max (bitmask for mouse buttons 1-5) 0x00 min + //mouse buttons 1 and 2 are handled by the keymap, but not 3 + if (uart_data[4] == 0x0F) { //then 3 is not pressed + currentReport.buttons &= ~MOUSE_BTN3; //MOUSE_BTN3 is def in report.h + } else { //3 must be pressed + currentReport.buttons |= MOUSE_BTN3; + } + pointing_device_set_report(currentReport); + } else { + xprintf("\r\nRequested packet, data 4 was %d",uart_data[4]); + }*/ + pointing_device_send(); +} + +void led_init(void) { + DDRD |= (1<<1); + PORTD |= (1<<1); + DDRF |= (1<<4) | (1<<5); + PORTF |= (1<<4) | (1<<5); +} + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + uart_init(); + led_init(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +} + +void led_set_kb(uint8_t usb_led) { + +} diff --git a/keyboards/dichotomy/dichotomy.h b/keyboards/dichotomy/dichotomy.h new file mode 100755 index 00000000000..030209ff01a --- /dev/null +++ b/keyboards/dichotomy/dichotomy.h @@ -0,0 +1,46 @@ +#ifndef DICHOTOMY_H +#define DICHOTOMY_H + +#include QMK_KEYBOARD_H +#include "report.h" +#include "pointing_device.h" +#include "quantum.h" +#include "matrix.h" +#include "backlight.h" +#include + +#define red_led_off() PORTF |= (1<<6) +#define red_led_on() PORTF &= ~(1<<6) +#define blu_led_off() PORTF |= (1<<5) +#define blu_led_on() PORTF &= ~(1<<5) +#define grn_led_off() PORTD |= (1<<1) +#define grn_led_on() PORTD &= ~(1<<1) + +#define set_led_off() red_led_off(); grn_led_off(); blu_led_off() +#define set_led_red() red_led_on(); grn_led_off(); blu_led_off() +#define set_led_blue() red_led_off(); grn_led_off(); blu_led_on() +#define set_led_green() red_led_off(); grn_led_on(); blu_led_off() +#define set_led_yellow() red_led_on(); grn_led_on(); blu_led_off() +#define set_led_magenta() red_led_on(); grn_led_off(); blu_led_on() +#define set_led_cyan() red_led_off(); grn_led_on(); blu_led_on() +#define set_led_white() red_led_on(); grn_led_on(); blu_led_on() + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, \ + k33, k34, k35, k36, k37, k38, \ + k42, k43, k44, k45, k46, k47, k48, k49 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B }, \ + { KC_NO, KC_NO, KC_NO, k33, k34, k35, k36, k37, k38, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, k42, k43, k44, k45, k46, k47, k48, k49, KC_NO, KC_NO } \ +} + +#endif diff --git a/keyboards/dichotomy/info.json b/keyboards/dichotomy/info.json new file mode 100644 index 00000000000..4008ce18b75 --- /dev/null +++ b/keyboards/dichotomy/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Dichotomy", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [{"label":"k00", "x":0, "y":0.5}, {"label":"k01", "x":1, "y":0.5}, {"label":"k02", "x":2, "y":0.25}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0.5}, {"label":"k05", "x":5, "y":0.5}, {"label":"k06", "x":7, "y":0.5}, {"label":"k07", "x":8, "y":0.5}, {"label":"k08", "x":9, "y":0}, {"label":"k09", "x":10, "y":0.25}, {"label":"k0A", "x":11, "y":0.5}, {"label":"k0B", "x":12, "y":0.5}, {"label":"k10", "x":0, "y":1.5}, {"label":"k11", "x":1, "y":1.5}, {"label":"k12", "x":2, "y":1.25}, {"label":"k13", "x":3, "y":1}, {"label":"k14", "x":4, "y":1.5}, {"label":"k15", "x":5, "y":1.5}, {"label":"k16", "x":7, "y":1.5}, {"label":"k17", "x":8, "y":1.5}, {"label":"k18", "x":9, "y":1}, {"label":"k19", "x":10, "y":1.25}, {"label":"k1A", "x":11, "y":1.5}, {"label":"k1B", "x":12, "y":1.5}, {"label":"k20", "x":0, "y":2.5}, {"label":"k21", "x":1, "y":2.5}, {"label":"k22", "x":2, "y":2.25}, {"label":"k23", "x":3, "y":2}, {"label":"k24", "x":4, "y":2.5}, {"label":"k25", "x":5, "y":2.5}, {"label":"k26", "x":7, "y":2.5}, {"label":"k27", "x":8, "y":2.5}, {"label":"k28", "x":9, "y":2}, {"label":"k29", "x":10, "y":2.25}, {"label":"k2A", "x":11, "y":2.5}, {"label":"k2B", "x":12, "y":2.5}, {"label":"k33", "x":3, "y":4}, {"label":"k34", "x":4, "y":4}, {"label":"k35", "x":5, "y":4}, {"label":"k36", "x":7, "y":4}, {"label":"k37", "x":8, "y":4}, {"label":"k38", "x":9, "y":4}, {"label":"k42", "x":2, "y":5}, {"label":"k43", "x":3, "y":5}, {"label":"k44", "x":4, "y":5}, {"label":"k45", "x":5, "y":5}, {"label":"k46", "x":7, "y":5}, {"label":"k47", "x":8, "y":5}, {"label":"k48", "x":9, "y":5}, {"label":"k49", "x":10, "y":5}] + } + } +} diff --git a/keyboards/dichotomy/keymaps/alairock/keymap.c b/keyboards/dichotomy/keymaps/alairock/keymap.c new file mode 100644 index 00000000000..a1d196fb066 --- /dev/null +++ b/keyboards/dichotomy/keymaps/alairock/keymap.c @@ -0,0 +1,196 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _MOUSE 8 +#define _ADJUST 16 + + +enum dichotomy_keycodes +{ + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + MOUKEY, + MS_BTN1, + MS_BTN2, + MS_BTN3 +}; + +#define RED_BRIGHTNESS 3 +#define GREEN_BRIGHTNESS 2 +#define BLUE_BRIGHTNESS 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +[_QWERTY] = LAYOUT( /* Base layout, nearly qwerty but with modifications because it's not a full keyboard. Obviously. */ + KC_ESCAPE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MOUKEY, + KC_LCTL, KC_LALT, MOUKEY, KC_RGUI, KC_RALT, KC_RCTL, + MS_BTN3, SFT_T(KC_ESCAPE), KC_LGUI, KC_BSPC, KC_SPC, RAISE, LOWER, MS_BTN3 +), + +[_RAISE] = LAYOUT( /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, _______, KC_VOLD, KC_VOLU, KC_MPLY, KC_MFFD, KC_MUTE, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + _______, _______, KC_GRV, _______, _______, KC_MRWD, _______, _______, _______, KC_BSLS, KC_QUOT, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, KC_LABK, _______, _______, KC_RABK, _______, _______ +), + +[_LOWER] = LAYOUT( /* Number layout, basically the main function layer */ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, _______, KC_VOLD, KC_VOLU, KC_MPLY, KC_MFFD, KC_MUTE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, _______, KC_TILD, _______, _______, KC_MRWD, _______, _______, _______, KC_PIPE, KC_DQT, _______, + _______, _______, _______, _______, _______, _______, + _______, RAISE, _______, _______, _______, _______, _______, _______ +), + +[_ADJUST] = LAYOUT( /* Shifted number/function layout, for per-key control. Only active when shift is held, and number is toggled or held */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_UP, _______, _______, _______, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MOUSE] = LAYOUT( /* Mouse layer, including buttons for clicking. */ + _______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_PGDN, _______, _______, _______, + _______, _______, _______, _______, KC_UP, _______, + _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______ +) + +}; // end keymaps block + +static bool shift_held = false; +static bool shift_suspended = false; +report_mouse_t currentReport = {}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + grn_led_on(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + grn_led_off(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + //SHIFT is handled as LSHIFT in the general case - 'toggle' shoudl activate caps, while the layer is only active when shift is held. + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + red_led_on(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + red_led_off(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //MOUSE layer needs to be handled the same way as NUMKEY, but differently from shift + case MOUKEY: + if (record->event.pressed) { + layer_on(_MOUSE); + blu_led_on(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_MOUSE); + blu_led_off(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + //mouse buttons, for 1-3, to update the mouse report: + case MS_BTN1: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN1; //MOUSE_BTN1 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN1; + } + pointing_device_set_report(currentReport); + return false; + break; + case MS_BTN2: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN2; //MOUSE_BTN2 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN2; + } + pointing_device_set_report(currentReport); + return false; + break; + case MS_BTN3: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN3; //MOUSE_BTN3 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN3; + } + pointing_device_set_report(currentReport); + return false; + break; + //Additionally, if NS_ keys are in use, then shift may be held (but is + //disabled for the unshifted keycodes to be send. Check the bool and + //register shift as necessary. + // default: + // if (shift_held){ + // register_code(KC_LSFT); + // } + // break; + } + return true; +}; diff --git a/keyboards/dichotomy/keymaps/default/keymap.c b/keyboards/dichotomy/keymaps/default/keymap.c new file mode 100755 index 00000000000..b8c7ef42745 --- /dev/null +++ b/keyboards/dichotomy/keymaps/default/keymap.c @@ -0,0 +1,497 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum dichotomy_layers { + _BS, + _SF, + _NM, + _NS, + _MS +}; + +#define LONGPRESS_COUNT 4 + +enum dichotomy_keycodes +{ + CK_1G = SAFE_RANGE, + CK_BSPE, + CK_QE, + CK_TE, //these 4 CK_XXXX keys are special "alternate long-press" keys controlled with unique timers. Make sure you understand them before you mess with them. + NS_HYPH, + NS_EQU, + NUMKEY, + SFTKEY, + MOUKEY, + MS_BTN1, + MS_BTN2, + MS_BTN3 +}; + +#define CUSTOM_LONGPRESS 150 +#define CUSTOM_TOGGLE_TIME 300 + +#define RED_BRIGHTNESS 3 +#define GREEN_BRIGHTNESS 2 +#define BLUE_BRIGHTNESS 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_BS] = LAYOUT( /* Base layout, nearly qwerty but with modifications because it's not a full keyboard. Obviously. */ + CK_TE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + NUMKEY, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CK_QE, + SFTKEY, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MOUKEY, + KC_LCTL, KC_LALT, KC_LGUI, KC_RGUI, KC_RALT, KC_RCTL, + MS_BTN3, KC_LBRC, KC_LPRN, KC_SPC, KC_SPC, KC_RPRN, KC_RBRC, MS_BTN3 +), + +[_SF] = LAYOUT( /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NS_HYPH, KC_UNDS, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, KC_LABK, _______, _______, KC_RABK, _______, _______ +), + +[_NM] = LAYOUT( /* Number layout, basically the main function layer */ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, CK_1G, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, CK_BSPE, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_NS] = LAYOUT( /* Shifted number/function layout, for per-key control. Only active when shift is held, and number is toggled or held */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, NS_EQU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MS] = LAYOUT( /* Mouse layer, including buttons for clicking. */ + _______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_PGDN, _______, _______, _______, + _______, _______, _______, _______, KC_UP, _______, + _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______ +) + +}; + +static uint16_t special_timers[LONGPRESS_COUNT] = {0xFFFF,0xFFFF,0xFFFF,0xFFFF}; +static bool special_key_states[LONGPRESS_COUNT] = {0,0,0,0}; +static bool special_key_pressed[LONGPRESS_COUNT] = {0,0,0,0}; + +static uint16_t shift_timer; +static uint16_t num_timer; +static uint16_t mouse_timer; + +static uint8_t red_timer; +static uint8_t green_timer; +static uint8_t blue_timer; + +static bool shift_singular_key = false; +static bool number_singular_key = false; +static bool mouse_singular_key = false; +static bool capsLED = false; +static bool shiftLED = false; +static bool numLED = false; +static bool mouseLED = false; + +static bool shift_held = false; +static bool shift_suspended = false; +report_mouse_t currentReport = {}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //uint8_t layer; + //layer = biton32(layer_state); // get the current layer //Or don't, I didn't use it. + bool returnVal = true; //this is to determine if more key processing is needed. + + //custom layer handling for tri_layer, + switch (keycode) { + case NUMKEY: + if (record->event.pressed) { + num_timer = timer_read(); + number_singular_key = true; + layer_invert(_NM); + numLED = !numLED; + } else { + if (timer_elapsed(num_timer) < CUSTOM_TOGGLE_TIME && number_singular_key) { + //do nothing, the layer has already been inverted + } else { + layer_invert(_NM); + numLED = !numLED; + } + } + update_tri_layer(_NM, _SF, _NS); + returnVal = false; + break; + //SHIFT is handled as LSHIFT in the general case - 'toggle' shoudl activate caps, while the layer is only active when shift is held. + case SFTKEY: + if (record->event.pressed) { + shift_held = true; + shiftLED = true; + shift_suspended = false; + shift_timer = timer_read(); + shift_singular_key = true; + layer_on(_SF); + register_code(KC_LSFT); + } else { + shift_held = false; + shiftLED = false; + if (timer_elapsed(shift_timer) < CUSTOM_TOGGLE_TIME && shift_singular_key) { + //this was basically a toggle, so activate/deactivate caps lock. + SEND_STRING(SS_TAP(X_CAPSLOCK)); + capsLED = !capsLED; + } + layer_off(_SF); + unregister_code(KC_LSFT); + } + update_tri_layer(_NM, _SF, _NS); + returnVal = false; + break; + //MOUSE layer needs to be handled the same way as NUMKEY, but differently from shift + case MOUKEY: + if (record->event.pressed) { + mouse_timer = timer_read(); + mouse_singular_key = true; + layer_invert(_MS); + mouseLED = !mouseLED; + } else { + if (timer_elapsed(mouse_timer) < CUSTOM_TOGGLE_TIME && mouse_singular_key){ + //do nothing, it was a toggle (and it's already been toggled) + } else { + layer_invert(_MS); + mouseLED = !mouseLED; + } + } + returnVal = false; + break; + //Custom macros for strange keys with different long-tap behavior + case CK_1G: + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + if (record->event.pressed) { + special_timers[CK_1G-SAFE_RANGE] = timer_read(); + special_key_pressed[CK_1G-SAFE_RANGE] = 1; + } else { + if (special_key_states[CK_1G-SAFE_RANGE]){ + //key was activated after custom_longpress, need to close those keycodes + special_key_states[CK_1G-SAFE_RANGE] = 0; + unregister_code(KC_GRAVE); + } else { + if (special_key_pressed[CK_1G-SAFE_RANGE]){ + //key was not activated, return macro activating proper, pre-long-tap key + SEND_STRING(SS_TAP(X_1)); + special_key_pressed[CK_1G-SAFE_RANGE] = 0; + } else { + //the short key was already sent, because another key was pressed. + //Do nothing. + } + + } + } + returnVal = false; + break; + case CK_BSPE: + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + if (record->event.pressed) { + special_timers[CK_BSPE-SAFE_RANGE] = timer_read(); + special_key_pressed[CK_BSPE-SAFE_RANGE] = 1; + } else { + if (special_key_states[CK_BSPE-SAFE_RANGE]){ + //key was activated after custom_longpress, need to close those keycodes + special_key_states[CK_BSPE-SAFE_RANGE] = 0; + unregister_code(KC_ENTER); + } else { + if (special_key_pressed[CK_BSPE-SAFE_RANGE]){ + //key was not activated, return macro activating proper, pre-long-tap key + SEND_STRING(SS_TAP(X_BSLASH)); + special_key_pressed[CK_BSPE-SAFE_RANGE] = 0; + } else { + //the short key was already sent, because another key was pressed. + //Do nothing. + } + } + } + returnVal = false; + break; + case CK_QE: + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + if (record->event.pressed) { + special_timers[CK_QE-SAFE_RANGE] = timer_read(); + special_key_pressed[CK_QE-SAFE_RANGE] = 1; + } else { + if (special_key_states[CK_QE-SAFE_RANGE]){ + //key was activated after custom_longpress, need to close those keycodes + special_key_states[CK_QE-SAFE_RANGE] = 0; + unregister_code(KC_ENTER); + } else { + if (special_key_pressed[CK_QE-SAFE_RANGE]){ + //the long-press key was not activated, return macro activating proper, pre-long-tap key + SEND_STRING(SS_TAP(X_QUOTE)); + special_key_pressed[CK_QE-SAFE_RANGE] = 0; + } else { + //the short key was already sent, because another key was pressed. + //Do nothing. + } + } + } + returnVal = false; + break; + case CK_TE: + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + if (record->event.pressed) { + special_timers[CK_TE-SAFE_RANGE] = timer_read(); + special_key_pressed[CK_TE-SAFE_RANGE] = 1; + } else { + if (special_key_states[CK_TE-SAFE_RANGE]){ + //key was activated after custom_longpress, need to close those keycodes + special_key_states[CK_TE-SAFE_RANGE] = 0; + unregister_code(KC_ESCAPE); + } else { + if (special_key_pressed[CK_TE-SAFE_RANGE]){ + //the long-press key was not activated, return macro activating proper, pre-long-tap key + SEND_STRING(SS_TAP(X_TAB)); + special_key_pressed[CK_TE-SAFE_RANGE] = 0; + } else { + //the short key was already sent, because another key was pressed. + //Do nothing. + } + } + } + returnVal = false; + break; + //No-shift keys, they unregister the KC_LSFT code so they can send + //unshifted values - but they don't change the bool. if any other + //key is pressed and the bool is set, KC_LSFT is registered again. + case NS_HYPH: + if (record->event.pressed) { + shift_suspended = true; + unregister_code(KC_LSFT); + register_code(KC_MINS); + } else { + unregister_code(KC_MINS); + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + } + returnVal = false; + break; + case NS_EQU: + if (record->event.pressed) { + shift_suspended = true; + unregister_code(KC_LSFT); + register_code(KC_EQUAL); + } else { + unregister_code(KC_EQUAL); + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + } + returnVal = false; + break; + + //mouse buttons, for 1-3, to update the mouse report: + case MS_BTN1: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN1; //MOUSE_BTN1 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN1; + } + pointing_device_set_report(currentReport); + returnVal = false; + break; + case MS_BTN2: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN2; //MOUSE_BTN2 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN2; + } + pointing_device_set_report(currentReport); + returnVal = false; + break; + case MS_BTN3: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN3; //MOUSE_BTN3 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN3; + } + pointing_device_set_report(currentReport); + returnVal = false; + break; + //Additionally, if NS_ keys are in use, then shift may be held (but is + //disabled for the unshifted keycodes to be send. Check the bool and + //register shift as necessary. + default: + if (shift_held){ + register_code(KC_LSFT); + } + break; + } + switch (keycode){ + case KC_BSPC: + case KC_NO: + case NUMKEY: + case SFTKEY: + case MOUKEY: + //don't want to reset single key variables + break; + default: + //If any other key was pressed during the layer mod hold period, + //then the layer mod was used momentarily, and should block latching + shift_singular_key = false; + number_singular_key = false; + mouse_singular_key = false; + break; + } + switch (keycode){ + case KC_BSPC: + case KC_NO: + case NUMKEY: + case SFTKEY: + case MOUKEY: + case MOUSE_BTN1: + case MOUSE_BTN2: + case MOUSE_BTN3: + case KC_LCTL: + case KC_LALT: + case KC_LGUI: + case KC_RCTL: + case KC_RALT: + case KC_RGUI: + case CK_1G: + case CK_BSPE: + case CK_QE: + case CK_TE: + //Do nothing, don't want to trigger the timer key rollover + break; + default: + //Now we're checking to see if any of the special timer keys are pressed + //if so, we need to activate their short-press features + if (record->event.pressed) { + for (uint8_t i = 0; i= CUSTOM_LONGPRESS) && (!special_key_states[i]) && special_key_pressed[i]){ + switch (i + SAFE_RANGE){ + case CK_1G: + register_code(KC_GRAVE); + break; + case CK_BSPE: + register_code(KC_ENTER); + break; + case CK_QE: + register_code(KC_ENTER); + break; + case CK_TE: + register_code(KC_ESCAPE); + break; + } + special_key_pressed[i] = 0; + special_key_states[i] = 1; + } + } + if (shiftLED || capsLED){ + red_timer++; + if (red_timer < RED_BRIGHTNESS){ + red_led_on(); + } else { + red_timer = 0; + red_led_off(); + } + } else { + red_timer = 0; + red_led_off(); + } + if (numLED){ + green_timer++; + if (green_timer < GREEN_BRIGHTNESS){ + grn_led_on(); + } else { + green_timer = 0; + grn_led_off(); + } + } else { + green_timer = 0; + grn_led_off(); + } + if (mouseLED){ + blue_timer++; + if (blue_timer < BLUE_BRIGHTNESS){ + blu_led_on(); + } else { + blue_timer = 0; + blu_led_off(); + } + } else { + blue_timer = 0; + blu_led_off(); + } +}; diff --git a/keyboards/dichotomy/matrix.c b/keyboards/dichotomy/matrix.c new file mode 100755 index 00000000000..f14c9012882 --- /dev/null +++ b/keyboards/dichotomy/matrix.c @@ -0,0 +1,228 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#if defined(__AVR__) +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" +#include "dichotomy.h" +#include "pointing_device.h" +#include "report.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#define MAIN_ROWMASK 0xFFF0; +#define LOWER_ROWMASK 0x3FC0; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +void matrix_init(void) { + DDRF |= (1<<6); + DDRF |= (1<<5); + DDRD |= (1<<1); + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) +{ + SERIAL_UART_INIT(); + //xprintf("\r\nTRYING TO SCAN"); + + uint32_t timeout = 0; + + //the s character requests the RF slave to send the matrix + SERIAL_UART_DATA = 's'; + + //trust the external keystates entirely, erase the last data + uint8_t uart_data[11] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 11; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while(!SERIAL_UART_RXD_PRESENT){ + timeout++; + if (timeout > 10000){ + xprintf("\r\nTime out in keyboard."); + break; + } + } + uart_data[i] = SERIAL_UART_DATA; + } + + //check for the end packet, the key state bytes use the LSBs, so 0xE0 + //will only show up here if the correct bytes were recieved + uint8_t checksum = 0x00; + for (uint8_t z=0; z<10; z++){ + checksum = checksum^uart_data[z]; + } + checksum = checksum ^ (uart_data[10] & 0xF0); + // Smash the checksum from 1 byte into 4 bits + checksum = (checksum ^ ((checksum & 0xF0)>>4)) & 0x0F; +//xprintf("\r\nGOT RAW PACKET: \r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d",uart_data[0],uart_data[1],uart_data[2],uart_data[3],uart_data[4],uart_data[5],uart_data[6],uart_data[7],uart_data[8],uart_data[9],uart_data[10],checksum); + if ((uart_data[10] & 0x0F) == checksum) { //this is an arbitrary binary checksum (1001) (that would be 0x9.) + //xprintf("\r\nGOT PACKET: \r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d",uart_data[0],uart_data[1],uart_data[2],uart_data[3],uart_data[4],uart_data[5]); + //shifting and transferring the keystates to the QMK matrix variable + //bits 1-12 are row 1, 13-24 are row 2, 25-36 are row 3, + //bits 37-42 are row 4 (only 6 wide, 1-3 are 0, and 10-12 are 0) + //bits 43-48 are row 5 (same as row 4) + /* ASSUMING MSB FIRST */ + matrix[0] = (((uint16_t) uart_data[0] << 8) | ((uint16_t) uart_data[1])) & MAIN_ROWMASK; + matrix[1] = ((uint16_t) uart_data[1] << 12) | ((uint16_t) uart_data[2] << 4); + matrix[2] = (((uint16_t) uart_data[3] << 8) | ((uint16_t) uart_data[4])) & MAIN_ROWMASK; + matrix[3] = (((uint16_t) uart_data[4] << 9) | ((uint16_t) uart_data[5] << 1)) & LOWER_ROWMASK; + matrix[4] = (((uint16_t) uart_data[5] << 7) | ((uart_data[10] & 1<<7) ? 1:0) << 13 | ((uart_data[10] & 1<<6) ? 1:0) << 6) & LOWER_ROWMASK; + /* OK, TURNS OUT THAT WAS A BAD ASSUMPTION */ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + //I've unpacked these into the mirror image of what QMK expects them to be, so... + /*uint8_t halfOne = (matrix[i]>>8); + uint8_t halfTwo = (matrix[i] & 0xFF); + halfOne = ((halfOne * 0x0802LU & 0x22110LU) | (halfOne * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; + halfTwo = ((halfTwo * 0x0802LU & 0x22110LU) | (halfTwo * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; + matrix[i] = ((halfTwo<<8) & halfOne);*/ + //matrix[i] = ((matrix[i] * 0x0802LU & 0x22110LU) | (matrix[i] * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; + matrix[i] = bitrev16(matrix[i]); + //bithack mirror! Doesn't make any sense, but works - and efficiently. + } + //if (uart_data[6]!=0 || uart_data[7]!=0){ + //if (maxCount<101){ + // xprintf("\r\nMouse data: x=%d, y=%d",(int8_t)uart_data[6],(int8_t)uart_data[7]); + //} + report_mouse_t currentReport = {}; + //check for the end packet, bytes 1-4 are movement and scroll + //but byte 5 has bits 0-3 for the scroll button state + //(1000 if pressed, 0000 if not) and bits 4-7 are always 1 + //We can use this to verify the report sent properly. + + currentReport = pointing_device_get_report(); + //shifting and transferring the info to the mouse report varaible + //mouseReport.x = 127 max -127 min + currentReport.x = (int8_t) uart_data[6]; + //mouseReport.y = 127 max -127 min + currentReport.y = (int8_t) uart_data[7]; + //mouseReport.v = 127 max -127 min (scroll vertical) + currentReport.v = (int8_t) uart_data[8]; + //mouseReport.h = 127 max -127 min (scroll horizontal) + currentReport.h = (int8_t) uart_data[9]; + /* + currentReport.x = 0; + currentReport.y = 0; + currentReport.v = 0; + currentReport.h = 0;*/ + pointing_device_set_report(currentReport); + } else { + //xprintf("\r\nRequested packet, data 10 was %d but checksum was %d",(uart_data[10] & 0x0F), (checksum & 0x0F)); + } + //matrix_print(); + + matrix_scan_quantum(); + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<.c` and see keymap document (you can find in top readme.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + +``` +$ make [default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/dichotomy/rules.mk b/keyboards/dichotomy/rules.mk new file mode 100755 index 00000000000..1cced064789 --- /dev/null +++ b/keyboards/dichotomy/rules.mk @@ -0,0 +1,76 @@ + +OPT_DEFS += -DDICHOTOMY_PROMICRO +DICHOTOMY_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) + +# # project specific files +SRC = matrix.c + + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader + # This definition is optional, and if your keyboard supports multiple bootloaders of + # different sizes, comment this out, and the correct address will be loaded + # automatically (+60). See bootloader.mk for all options. + BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# comment out to disable the options. +# +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +#MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +POINTING_DEVICE_ENABLE = yes # Generic Pointer, not as big as mouse keys hopefully. +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +CUSTOM_MATRIX = yes # Remote matrix from the wireless bridge +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +# MIDI_ENABLE = YES # MIDI controls +UNICODE_ENABLE = YES # Unicode +# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID + +USB = /dev/ttyACM0 + +#upload: build +# $(DICHOTOMY_UPLOAD_COMMAND) diff --git a/keyboards/dilly/README.md b/keyboards/dilly/README.md deleted file mode 100644 index 866d07ccbbf..00000000000 --- a/keyboards/dilly/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Dilly -===== - -A 3x10 ortholinear keyboard using Kailh PG1350 Lower Profile Choc switches. - -Keyboard Maintainer: Keebio -Hardware Supported: Dilly PCB, Arduino Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make dilly:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/dilly/config.h b/keyboards/dilly/config.h deleted file mode 100644 index 084186fc66d..00000000000 --- a/keyboards/dilly/config.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCB10 -#define PRODUCT_ID 0x113a -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Dilly -#define DESCRIPTION 30 percent ortholinear keyboard - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 5 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D7, E6, B4, B1, B3, B2 } -#define MATRIX_COL_PINS { D2, D4, C6, F6, F5 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* number of backlight levels */ -#define BACKLIGHT_PIN B5 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 3 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 10 - -#endif diff --git a/keyboards/dilly/keymaps/default/config.h b/keyboards/dilly/keymaps/default/config.h deleted file mode 100644 index 7fa3bf328ec..00000000000 --- a/keyboards/dilly/keymaps/default/config.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#endif diff --git a/keyboards/dilly/keymaps/default/keymap.c b/keyboards/dilly/keymaps/default/keymap.c deleted file mode 100644 index 03b539e3d80..00000000000 --- a/keyboards/dilly/keymaps/default/keymap.c +++ /dev/null @@ -1,69 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 -#define _FN3 3 -#define _FN4 4 -#define _FN5 5 - -#define _______ KC_TRNS - -// Tap-Hold keys -#define KC_ASFT MT(MOD_LSFT, KC_A) -#define KC_F_L3 LT(_FN3, KC_F) -#define KC_ZCTL MT(MOD_LCTL, KC_Z) -#define KC_XALT MT(MOD_LALT, KC_X) -#define KC_CGUI MT(MOD_LGUI, KC_C) -#define KC_V_L4 LT(_FN4, KC_V) -#define KC_SPL2 LT(_FN2, KC_SPC) -#define KC_B_L1 LT(_FN1, KC_B) -#define KC_N_L5 LT(_FN5, KC_N) -#define KC_MALT MT(MOD_RALT, KC_M) -#define KC_BSCT MT(MOD_RCTL, KC_BSPC) -#define KC_ENTS MT(MOD_RSFT, KC_ENT) -#define KC_ESCS MT(MOD_RSFT, KC_ESC) - -#define KC_GUIC LGUI(KC_C) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_BASE] = LAYOUT_ortho_3x10( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_ASFT, KC_S, KC_D, KC_F_L3, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESCS, - KC_ZCTL, KC_XALT, KC_CGUI, KC_V_L4, KC_SPL2, KC_B_L1, KC_N_L5, KC_MALT, KC_BSCT, KC_ENTS - ), - - [_FN1] = LAYOUT_ortho_3x10( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, - _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______ - ), - - [_FN2] = LAYOUT_ortho_3x10( - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, - KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, KC_GRV, - _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______ - ), - - [_FN3] = LAYOUT_ortho_3x10( - _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - KC_TAB, _______, _______, _______, _______, KC_COMM, KC_DOT, KC_SLSH, KC_SCLN, KC_QUOT, - _______, _______, _______, _______, KC_BSPC, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - ), - - [_FN4] = LAYOUT_ortho_3x10( - _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - KC_TAB, _______, _______, _______, _______, KC_LT, KC_GT, KC_QUES, KC_COLN, KC_DQUO, - _______, _______, KC_GUIC, _______, KC_BSPC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END - ), - - [_FN5] = LAYOUT_ortho_3x10( - RGB_TOG, RGB_MOD, _______, RESET, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, - _______, _______, DEBUG, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, - BL_STEP, _______, KC_GUIC, _______, _______, _______, _______, _______, _______, _______ - ) - -}; diff --git a/keyboards/dilly/keymaps/delmo/keymap.c b/keyboards/dilly/keymaps/delmo/keymap.c deleted file mode 100644 index d3e8c5daf24..00000000000 --- a/keyboards/dilly/keymaps/delmo/keymap.c +++ /dev/null @@ -1,106 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 -#define _FN3 3 -#define _FN4 4 -#define _FN5 5 - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -// Tap-Hold keys -//#define KC_ASFT MT(MOD_LSFT, KC_A) -#define KC_F_L3 LT(_FN3, KC_F) -#define KC_ZCTL MT(MOD_LCTL, KC_Z) -#define KC_XALT MT(MOD_LALT, KC_X) -//#define KC_CGUI MT(MOD_LGUI, KC_C) -#define KC_V_L4 LT(_FN4, KC_V) -#define KC_SPL2 LT(_FN2, KC_SPC) -#define KC_B_L1 LT(_FN1, KC_B) -#define KC_N_L5 LT(_FN5, KC_N) -//#define KC_MALT MT(MOD_RALT, KC_M) -//#define KC_BSCT MT(MOD_RCTL, KC_BSPC) -#define KC_ENTS MT(MOD_RSFT, KC_ENT) -#define KC_BSCS MT(MOD_RSFT, KC_BSPC) - -#define KC_GUIC LGUI(KC_C) - -#define KC_RST RESET -#define KC_BL_S BL_STEP -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_BASE] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - Q , W , E , R , T , Y , U , I , O , P , - //|----+----+----+----+----+----+----+----+----+----| - A , S , D ,F_L3, G , H , J , K , L ,BSCS, - //|----+----+----+----+----+----+----+----+----+----| - ZCTL,XALT,C ,V_L4,B_L1,SPL2,N_L5,M ,DOT ,ENTS - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN1] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , - //|----+----+----+----+----+----+----+----+----+----| - F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , - //|----+----+----+----+----+----+----+----+----+----| - , , , , ,BSPC, , , ,CAPS - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN2] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN, - //|----+----+----+----+----+----+----+----+----+----| - F11 ,F12 , , , , , , , ,GRV , - //|----+----+----+----+----+----+----+----+----+----| - , , , ,DEL , , , , , - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN3] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - ESC , , , , ,MINS,EQL ,LBRC,RBRC,BSLS, - //|----+----+----+----+----+----+----+----+----+----| - TAB , , , , ,COMM,DOT ,SLSH,SCLN,QUOT, - //|----+----+----+----+----+----+----+----+----+----| - , , , ,BSPC, ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN4] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - , , , , ,UNDS,PLUS,LCBR,RCBR,PIPE, - //|----+----+----+----+----+----+----+----+----+----| - TAB , , , , , LT , GT ,QUES,COLN,DQUO, - //|----+----+----+----+----+----+----+----+----+----| - , ,GUIC, ,BSPC, ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN5] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - RTOG,RMOD, ,RST ,RHUI,RSAI,RVAI, , , , - //|----+----+----+----+----+----+----+----+----+----| - , ,DBUG, ,RHUD,RSAD,RVAD, , , , - //|----+----+----+----+----+----+----+----+----+----| - BL_S, ,GUIC, , , , , , , - //`----+----+----+----+----+----+----+----+----+----' - ) - -}; \ No newline at end of file diff --git a/keyboards/dilly/keymaps/pletcher/keymap.c b/keyboards/dilly/keymaps/pletcher/keymap.c deleted file mode 100644 index 4e7a5c89d22..00000000000 --- a/keyboards/dilly/keymaps/pletcher/keymap.c +++ /dev/null @@ -1,96 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 -#define _FN3 3 -#define _FN4 4 -#define _FN5 5 - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -// Tap-Hold keys -#define KC_F_L3 LT(_FN3, KC_F) -#define KC_ZCTL MT(MOD_LCTL, KC_Z) -#define KC_XALT MT(MOD_LALT, KC_X) -#define KC_CGUI MT(MOD_LGUI, KC_C) -#define KC_V_L4 LT(_FN4, KC_V) -#define KC_SPL2 LT(_FN2, KC_SPC) -#define KC_B_L1 LT(_FN1, KC_B) -#define KC_N_L5 LT(_FN5, KC_N) -#define KC_MALT MT(MOD_RALT, KC_M) -#define KC_BSCT MT(MOD_RCTL, KC_BSPC) -#define KC_ENTS MT(MOD_RSFT, KC_ENT) -#define KC_ESCS MT(MOD_RSFT, KC_ESC) - -#define KC_GUIC LGUI(KC_C) - -#define KC_RST RESET -#define KC_DBUG DEBUG - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_BASE] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - Q , W , E , R , T , Y , U , I , O , P , - //|----+----+----+----+----+----+----+----+----+----| - A , S , D ,F_L3, G , H , J , K , L ,ESCS, - //|----+----+----+----+----+----+----+----+----+----| - ZCTL,XALT,CGUI,V_L4,SPL2,B_L1,N_L5,MALT,BSCT,ENTS - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN1] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , - //|----+----+----+----+----+----+----+----+----+----| - F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , - //|----+----+----+----+----+----+----+----+----+----| - , , , ,BSPC, , , , , - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN2] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN, - //|----+----+----+----+----+----+----+----+----+----| - F11 ,F12 , , , , , , , ,GRV , - //|----+----+----+----+----+----+----+----+----+----| - , , , ,TAB , DEL, , , , - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN3] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - , , , , ,MINS,EQL ,LBRC,RBRC,BSLS, - //|----+----+----+----+----+----+----+----+----+----| - TAB , , , , ,COMM,DOT ,SLSH,SCLN,QUOT, - //|----+----+----+----+----+----+----+----+----+----| - , , , ,BSPC, ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN4] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - , , , , ,UNDS,PLUS,LCBR,RCBR,PIPE, - //|----+----+----+----+----+----+----+----+----+----| - TAB , , , , , LT , GT ,QUES,COLN,DQUO, - //|----+----+----+----+----+----+----+----+----+----| - , ,GUIC, ,BSPC, ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----+----+----+----' - ), - - [_FN5] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----. - , , ,RST , , ,MSTP,VOLD,VOLU,MPLY, - //|----+----+----+----+----+----+----+----+----+----| - , ,DBUG, , , , ,ASDN,ASUP,ASRP, - //|----+----+----+----+----+----+----+----+----+----| - , ,GUIC, , , , , , ,ASTG - //`----+----+----+----+----+----+----+----+----+----' - ) - -}; diff --git a/keyboards/diverge3/config.h b/keyboards/diverge3/config.h index f3ed06739a8..a593bca9db6 100644 --- a/keyboards/diverge3/config.h +++ b/keyboards/diverge3/config.h @@ -31,10 +31,6 @@ along with this program. If not, see . /* key matrix size */ #define MATRIX_ROWS 10 #define MATRIX_COLS 8 -// Only SERIAL is currently supported -// By converting this to use I2C, backlight -// would/should be fully functional as well -#define USE_SERIAL /* * Keyboard Matrix Assignments @@ -50,20 +46,21 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL -// #define BACKLIGHT_PIN C6 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - +#define BACKLIGHT_PIN C6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -73,7 +70,7 @@ along with this program. If not, see . /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. * This is userful for the Windows task manager shortcut (ctrl+shift+esc). */ -// #define GRAVE_ESC_CTRL_OVERRIDE + #define GRAVE_ESC_CTRL_OVERRIDE /* * Force NKRO @@ -108,11 +105,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/diverge3/keymaps/default/config.h b/keyboards/diverge3/keymaps/default/config.h index 87ce06b3b8d..fc375f08129 100644 --- a/keyboards/diverge3/keymaps/default/config.h +++ b/keyboards/diverge3/keymaps/default/config.h @@ -14,14 +14,9 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here #define MASTER_RIGHT #define PERMISSIVE_HOLD #define TAPPING_TERM 150 - -#endif diff --git a/keyboards/diverge3/keymaps/default/keymap.c b/keyboards/diverge3/keymaps/default/keymap.c index 1b704e87ed2..29e5576fcde 100644 --- a/keyboards/diverge3/keymaps/default/keymap.c +++ b/keyboards/diverge3/keymaps/default/keymap.c @@ -95,9 +95,6 @@ enum custom_keycodes { PSELF_MACRO }; -// Make layer undefined do nothing -#define _______ KC_TRNS - // Macros #define KC_PMAC PAREN_MACRO #define KC_AMAC ARROW_MACRO diff --git a/keyboards/diverge3/keymaps/iso_uk/config.h b/keyboards/diverge3/keymaps/iso_uk/config.h new file mode 100755 index 00000000000..83f65979c7e --- /dev/null +++ b/keyboards/diverge3/keymaps/iso_uk/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 IslandMan93 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + + +// place overrides here +#define MASTER_LEFT +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 + diff --git a/keyboards/diverge3/keymaps/iso_uk/keymap.c b/keyboards/diverge3/keymaps/iso_uk/keymap.c new file mode 100644 index 00000000000..80433478508 --- /dev/null +++ b/keyboards/diverge3/keymaps/iso_uk/keymap.c @@ -0,0 +1,45 @@ +/* Copyright 2017 IslandMan93 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + +enum layers { + _QWERTY, + _LOWER, +}; + +#define LOWER MO(_LOWER) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_CAPS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LCBR, KC_RCBR, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_PSCR, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_NUHS, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_INS, KC_PGDN, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_HOME, KC_END, KC_SPC, KC_SPC, LOWER, KC_QUOT, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_SLASH + ), + + [_LOWER] = LAYOUT( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + BL_TOGG, KC_ASTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_INC, KC_ASUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_DEC, KC_ASDN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_ASRP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; diff --git a/keyboards/diverge3/keymaps/iso_uk/readme.md b/keyboards/diverge3/keymaps/iso_uk/readme.md new file mode 100755 index 00000000000..ff4971754ae --- /dev/null +++ b/keyboards/diverge3/keymaps/iso_uk/readme.md @@ -0,0 +1 @@ +# My UK based diverge 3 layout diff --git a/keyboards/nyquist/keymaps/yshrsmz/rules.mk b/keyboards/diverge3/keymaps/iso_uk/rules.mk old mode 100644 new mode 100755 similarity index 100% rename from keyboards/nyquist/keymaps/yshrsmz/rules.mk rename to keyboards/diverge3/keymaps/iso_uk/rules.mk diff --git a/keyboards/diverge3/keymaps/workman/keymap.c b/keyboards/diverge3/keymaps/workman/keymap.c index 5e681f4188d..415df2eead5 100644 --- a/keyboards/diverge3/keymaps/workman/keymap.c +++ b/keyboards/diverge3/keymaps/workman/keymap.c @@ -22,8 +22,6 @@ extern keymap_config_t keymap_config; #define _GAME 1 #define _RAISE 2 -#define _______ KC_TRNS - #define SHIFT_MOD MOD_BIT(KC_LSFT) #define SPACE_RAISE LT(_RAISE, KC_SPC) #define ENT_RAISE LT(_RAISE, KC_ENT) @@ -209,4 +207,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, BL_BRTG, KC_MUTE, _______, _______, KC_MPRV, KC_MNXT, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______), -}; \ No newline at end of file +}; diff --git a/keyboards/diverge3/readme.md b/keyboards/diverge3/readme.md index 43add9d990b..45ddaa64cfd 100644 --- a/keyboards/diverge3/readme.md +++ b/keyboards/diverge3/readme.md @@ -14,7 +14,7 @@ Or for the [Workman](https://github.com/ojbucao/workman) layout: make diverge3:workman -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. # Reflashing Animus Reflashing the stock firmware is pretty easy. Just follow the same steps in the [original guide](https://imgur.com/a/8UapN). You will have to manually reset the Pro Micro (by shorting the GND and RST pins) during the upload step. Then reapply your keymap through Arbites. \ No newline at end of file diff --git a/keyboards/diverge3/rules.mk b/keyboards/diverge3/rules.mk index 38f3ee4e6a9..3888ee9370a 100644 --- a/keyboards/diverge3/rules.mk +++ b/keyboards/diverge3/rules.mk @@ -1,9 +1,4 @@ -SRC += ../lets_split/matrix.c \ - ../lets_split/serial.c \ - ../lets_split/split_util.c - # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -61,13 +56,12 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. - +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SPLIT_KEYBOARD = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes diff --git a/keyboards/divergetm2/config.h b/keyboards/divergetm2/config.h index 8bc9d2c803b..8ad948676d4 100644 --- a/keyboards/divergetm2/config.h +++ b/keyboards/divergetm2/config.h @@ -45,12 +45,11 @@ #define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* number of backlight levels */ @@ -59,6 +58,9 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* * Magic Key Options * @@ -70,10 +72,3 @@ * useful if your keyboard/keypad is missing keys and you want magic key support. * */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - diff --git a/keyboards/divergetm2/info.json b/keyboards/divergetm2/info.json new file mode 100644 index 00000000000..3a4389bb827 --- /dev/null +++ b/keyboards/divergetm2/info.json @@ -0,0 +1,59 @@ +{ + "keyboard_name": "UniKeyboard Diverge TM 2", + "url": "", + "maintainer": "islandman93, xton", + "width": 13, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"R00", "x":7, "y":0}, + {"label":"R01", "x":8, "y":0}, + {"label":"R02", "x":9, "y":0}, + {"label":"R03", "x":10, "y":0}, + {"label":"R04", "x":11, "y":0}, + {"label":"R05", "x":12, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"R10", "x":7, "y":1}, + {"label":"R11", "x":8, "y":1}, + {"label":"R12", "x":9, "y":1}, + {"label":"R13", "x":10, "y":1}, + {"label":"R14", "x":11, "y":1}, + {"label":"R15", "x":12, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"R20", "x":7, "y":2}, + {"label":"R21", "x":8, "y":2}, + {"label":"R22", "x":9, "y":2}, + {"label":"R23", "x":10, "y":2}, + {"label":"R24", "x":11, "y":2}, + {"label":"R25", "x":12, "y":2}, + {"label":"L30", "x":0, "y":3}, + {"label":"L31", "x":1, "y":3}, + {"label":"L32", "x":2, "y":3}, + {"label":"L33", "x":3, "y":3}, + {"label":"L34", "x":4, "y":3, "w":2}, + {"label":"R31", "x":7, "y":3, "w":2}, + {"label":"R32", "x":9, "y":3}, + {"label":"R33", "x":10, "y":3}, + {"label":"R34", "x":11, "y":3}, + {"label":"R35", "x":12, "y":3} + ] + } + } +} diff --git a/keyboards/divergetm2/rules.mk b/keyboards/divergetm2/rules.mk index 084a3bf63e3..f330bd79023 100644 --- a/keyboards/divergetm2/rules.mk +++ b/keyboards/divergetm2/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/dk60/config.h b/keyboards/dk60/config.h index 5b712fe9bd3..6a69516cb15 100644 --- a/keyboards/dk60/config.h +++ b/keyboards/dk60/config.h @@ -41,15 +41,10 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Set 0 if debouncing isn't needed */ - #define DEBOUNCING_DELAY 5 + #define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - - /* key combination for command */ - #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ - ) #endif diff --git a/keyboards/dk60/dk60.c b/keyboards/dk60/dk60.c index 93aeb33b4a3..8b9dc547d4e 100644 --- a/keyboards/dk60/dk60.c +++ b/keyboards/dk60/dk60.c @@ -1,5 +1,15 @@ #include "dk60.h" +extern inline void dk60_caps_led_on(void); +extern inline void dk60_esc_led_on(void); + +extern inline void dk60_caps_led_off(void); +extern inline void dk60_esc_led_off(void); + +extern inline void dk60_led_all_on(void); +extern inline void dk60_led_all_off(void); + + void dk60_blink_all_leds(void) { dk60_led_all_off(); diff --git a/keyboards/dk60/readme.md b/keyboards/dk60/readme.md index 3e6f6806157..b9d9b671131 100644 --- a/keyboards/dk60/readme.md +++ b/keyboards/dk60/readme.md @@ -12,6 +12,6 @@ Make example for this keyboard (after setting up your build environment): make dk60:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Open Hardware project! diff --git a/keyboards/do60/config.h b/keyboards/do60/config.h index 4a7dcddfdb4..82e818328c2 100644 --- a/keyboards/do60/config.h +++ b/keyboards/do60/config.h @@ -55,7 +55,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* RGB Underglow * F5 PIN for DO60's pre-soldered WS2812 LEDs @@ -72,11 +72,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define TAPPING_TERM 200 #endif diff --git a/keyboards/do60/do60.h b/keyboards/do60/do60.h index 30615d1d3dd..8ee90220415 100644 --- a/keyboards/do60/do60.h +++ b/keyboards/do60/do60.h @@ -39,6 +39,20 @@ inline void setdefaultrgb(void){ rgblight_sethsv(100,100,100); } { K40, K41, K42, KC_NO,KC_NO,K45, K46, K47, KC_NO,KC_NO,K4A, K4B, K4C, K4D, K4E } \ } +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K41, K42, K46, K4A, K4B \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, KC_NO, K2E }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ + { KC_NO, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, KC_NO, KC_NO, KC_NO } \ +} + #define LAYOUT_60_ansi( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ diff --git a/keyboards/do60/info.json b/keyboards/do60/info.json index 6acfa08ef18..4c98bd85133 100644 --- a/keyboards/do60/info.json +++ b/keyboards/do60/info.json @@ -9,6 +9,10 @@ "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"\u2190", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"x":12, "y":3}, {"label":"\u2191", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"3u(Space)", "x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4}, {"label":"3u(Space)", "x":7.5, "y":4, "w":2.25}, {"label":"Alt", "x":9.75, "y":4, "w":1.25}, {"label":"win", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4}] }, + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + }, + "LAYOUT_chiwi60_default": { "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"\u2190", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3, "w":1.75}, {"label":"\u2191", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"3u(Space)", "x":3.75, "y":4, "w":3}, {"label":"3u(Space)", "x":6.75, "y":4, "w":3}, {"label":"Alt", "x":9.75, "y":4, "w":1.25}, {"label":"win", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4}] }, diff --git a/keyboards/do60/keymaps/crd/keymap.c b/keyboards/do60/keymaps/crd/keymap.c new file mode 100644 index 00000000000..2c83df867f9 --- /dev/null +++ b/keyboards/do60/keymaps/crd/keymap.c @@ -0,0 +1,33 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL, // Function Layer + _CL // Control Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_RGLT RCMD_T(KC_LEFT) +#define KC_RADN RALT_T(KC_DOWN) +#define KC_RCRT RCTL_T(KC_RIGHT) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_ansi_split_bs_rshift( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, MO(_FL), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, XXXXXXX, KC_RGLT, KC_RADN, KC_RCRT + ), + [_FL] = LAYOUT_60_ansi_split_bs_rshift( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, RESET, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + diff --git a/keyboards/do60/keymaps/default/keymap.c b/keyboards/do60/keymaps/default/keymap.c index 1a8b98a46b1..8ade985b325 100644 --- a/keyboards/do60/keymaps/default/keymap.c +++ b/keyboards/do60/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -9,39 +8,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_SLSH, KC_UP, KC_SLSH, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_BSPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_BSPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT), // 1: Function Layer [1] = LAYOUT_all( RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, \ KC_NO, RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, BL_TOGG,BL_ON, BL_INC, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \ - KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SMOD, BL_STEP,BL_OFF, BL_DEC, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ + KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_RMOD, BL_STEP,BL_OFF, BL_DEC, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP, KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_RSFT, KC_NO , KC_PGUP, KC_INS, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, F(0), KC_HOME, KC_PGDOWN,KC_END), + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, MO(1), KC_HOME, KC_PGDOWN,KC_END), }; -// Custom Actions -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - }; - -// Macros -/* -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { register_code(KC_RSFT); } - else { unregister_code(KC_RSFT); } - break; - } - - return MACRO_NONE; -}; -*/ // Loop void matrix_scan_user(void) { // Empty -}; \ No newline at end of file +}; diff --git a/keyboards/do60/keymaps/test/keymap.c b/keyboards/do60/keymaps/test/keymap.c index 04b5f44bb1c..9e81ce1eae0 100644 --- a/keyboards/do60/keymaps/test/keymap.c +++ b/keyboards/do60/keymaps/test/keymap.c @@ -9,38 +9,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_SLSH, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT), // 1: Function Layer [1] = LAYOUT_all( RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, \ KC_NO, RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \ - KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SMOD, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ + KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_RMOD, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP, KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_RSFT, KC_NO , KC_PGUP, KC_INS, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, F(0), KC_HOME, KC_PGDOWN,KC_END), + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, MO(1), KC_HOME, KC_PGDOWN,KC_END), }; -// Custom Actions - const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - }; - -// Macros -/* -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { register_code(KC_RSFT); } - else { unregister_code(KC_RSFT); } - break; - } - - return MACRO_NONE; -}; -*/ // Loop void matrix_scan_user(void) { // Empty diff --git a/keyboards/do60/readme.md b/keyboards/do60/readme.md index fce7c922c54..c4122361f23 100644 --- a/keyboards/do60/readme.md +++ b/keyboards/do60/readme.md @@ -1,11 +1,14 @@ -# QMK Firmware for DoyuStudio DO60 PCB +# DoyuStudio DO60 PCB +60% board supporting in-switch LEDs (two-pin, single colour) +Build-in WS2182 RGB LED for underglow lighting. -## Quantum MK Firmware -For the full Quantum feature list, see [the parent readme.md](/readme.md). +Keyboard Maintainer: QMK Community +Hardware Supported: Doyu Studios 60% PCB +Hardware Availability: [Doyustudio](https://shopkey.doyustudio.com/001pcb60) -Board supports in-switch LEDs (two-pin, single colour) -Build-in WS2182 RGB LED for underglow lighting. +Make example for this keyboard (after setting up your build environment): + + make do60:default -## Build -To build the default keymap, simply run `make do60:default`. \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/do60/rules.mk b/keyboards/do60/rules.mk index 8003914fa70..7370a6262e8 100644 --- a/keyboards/do60/rules.mk +++ b/keyboards/do60/rules.mk @@ -63,4 +63,4 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend UNICODE_ENABLE = no # Unicode -LAYOUTS = 60_ansi 60_ansi_split_bs_rshift \ No newline at end of file +LAYOUTS = 60_ansi 60_hhkb 60_ansi_split_bs_rshift \ No newline at end of file diff --git a/keyboards/donutcables/budget96/budget96.c b/keyboards/donutcables/budget96/budget96.c new file mode 100644 index 00000000000..7831a91f523 --- /dev/null +++ b/keyboards/donutcables/budget96/budget96.c @@ -0,0 +1,80 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "budget96.h" + +#ifdef BACKLIGHT_ENABLE +#include "backlight.h" +#endif +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +#include + +#include "action_layer.h" +#include "i2c_master.h" +#include "quantum.h" + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + + void backlight_set(uint8_t level) { + if (level == 0) { + // turn RGB LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } + } diff --git a/keyboards/donutcables/budget96/budget96.h b/keyboards/donutcables/budget96/budget96.h new file mode 100644 index 00000000000..561d0cbfa22 --- /dev/null +++ b/keyboards/donutcables/budget96/budget96.h @@ -0,0 +1,56 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT_all( \ + k50, k52, k53, k54, k55, k60, k6A, k7A, k70, k5B, k5C, k5D, k5E, k1D, k2E, k0D, k76, k79, k78, \ + k40, k41, k42, k43, k44, k45, k61, k6B, k7B, k71, k4A, k4B, k4C, k4D, k4E, k46, k47, k48, k49, \ + k30, k31, k32, k33, k34, k35, k62, k6C, k7C, k72, k3A, k3B, k3C, k3D, k36, k37, k38, k39, \ + k20, k21, k22, k23, k24, k25, k63, k6D, k7D, k73, k2A, k2B, k2C, k2D, k26, k27, k28, k29, \ + k10, k03, k11, k12, k13, k14, k15, k64, k6E, k7E, k74, k1A, k1B, k68, k16, k17, k18, k19, \ + k00, k01, k02, k65, k75, k0A, k0B, k66, k67, k69, k06, k08, k09 \ +) \ +{ \ + { k00, k01, k02, k03, KC_NO, KC_NO, k06, KC_NO, k08, k09, k0A, k0B, KC_NO, k0D, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, KC_NO, k1D, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E }, \ + { k50, KC_NO, k52, k53, k54, k55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E }, \ + { k70, k71, k72, k73, k74, k75, k76, KC_NO, k78, k79, k7A, k7B, k7C, k7D, k7E }, \ +} + +#define LAYOUT_96_ansi( \ + k50, k52, k53, k54, k55, k60, k6A, k7A, k70, k5B, k5C, k5D, k5E, k1D, k2E, k0D, k76, k79, k78, \ + k40, k41, k42, k43, k44, k45, k61, k6B, k7B, k71, k4A, k4B, k4C, k4E, k46, k47, k48, k49, \ + k30, k31, k32, k33, k34, k35, k62, k6C, k7C, k72, k3A, k3B, k3C, k3D, k36, k37, k38, k39, \ + k20, k21, k22, k23, k24, k25, k63, k6D, k7D, k73, k2A, k2B, k2D, k26, k27, k28, k29, \ + k10, k11, k12, k13, k14, k15, k64, k6E, k7E, k74, k1A, k1B, k68, k16, k17, k18, \ + k00, k01, k02, k65, k75, k0B, k66, k67, k69, k06, k08, k09 \ +) \ +{ \ + { k00, k01, k02, KC_NO, KC_NO, KC_NO, k06, KC_NO, k08, k09, KC_NO, k0B, KC_NO, k0D, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, KC_NO, k1A, k1B, KC_NO, k1D, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, KC_NO, k4E }, \ + { k50, KC_NO, k52, k53, k54, k55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E }, \ + { k70, k71, k72, k73, k74, k75, k76, KC_NO, k78, k79, k7A, k7B, k7C, k7D, k7E }, \ +} diff --git a/keyboards/donutcables/budget96/config.h b/keyboards/donutcables/budget96/config.h new file mode 100644 index 00000000000..b8772fc8656 --- /dev/null +++ b/keyboards/donutcables/budget96/config.h @@ -0,0 +1,40 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define MANUFACTURER DonutCables +#define PRODUCT budget96 + +#define RGBLED_NUM 16 + +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCE 5 + +#define BACKLIGHT_LEVELS 1 +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/donutcables/budget96/info.json b/keyboards/donutcables/budget96/info.json new file mode 100644 index 00000000000..40a942127f4 --- /dev/null +++ b/keyboards/donutcables/budget96/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "budget96", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":16, "y":0}, {"x":17, "y":0}, {"x":18, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":16, "y":1}, {"x":17, "y":1}, {"x":18, "y":1}, {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":13.5, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":16, "y":2}, {"x":17, "y":2}, {"x":18, "y":2}, {"x":0, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3}, {"x":13.75, "y":3, "w":1.25}, {"x":15, "y":3}, {"x":16, "y":3}, {"x":17, "y":3}, {"x":18, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":16, "y":4}, {"x":17, "y":4}, {"x":18, "y":4}, {"x":0, "y":5, "w":1.25}, {"x":1.25, "y":5, "w":1.25}, {"x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"x":10, "y":5}, {"x":11, "y":5}, {"x":12, "y":5}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}, {"x":16, "y":5}, {"x":17, "y":5}, {"x":18, "y":5}] + }, + + "LAYOUT_96_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":16, "y":0}, {"x":17, "y":0}, {"x":18, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1, "w":2}, {"x":15, "y":1}, {"x":16, "y":1}, {"x":17, "y":1}, {"x":18, "y":1}, {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":13.5, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":16, "y":2}, {"x":17, "y":2}, {"x":18, "y":2}, {"x":0, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3, "w":2.25}, {"x":15, "y":3}, {"x":16, "y":3}, {"x":17, "y":3}, {"x":18, "y":3}, {"x":0, "y":4, "w":2.25}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":16, "y":4}, {"x":17, "y":4}, {"x":0, "y":5, "w":1.25}, {"x":1.25, "y":5, "w":1.25}, {"x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"x":10, "y":5, "w":1.5}, {"x":11.5, "y":5, "w":1.5}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}, {"x":16, "y":5}, {"x":17, "y":5}, {"x":18, "y":4, "h":2}] + } + } +} diff --git a/keyboards/donutcables/budget96/keymaps/default/config.h b/keyboards/donutcables/budget96/keymaps/default/config.h new file mode 100644 index 00000000000..a3ed4f762a6 --- /dev/null +++ b/keyboards/donutcables/budget96/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/donutcables/budget96/keymaps/default/keymap.c b/keyboards/donutcables/budget96/keymaps/default/keymap.c new file mode 100644 index 00000000000..dcb79780e08 --- /dev/null +++ b/keyboards/donutcables/budget96/keymaps/default/keymap.c @@ -0,0 +1,35 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_96_ansi(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_NLCK, KC_INS, KC_HOME, KC_PGUP, KC_PSLS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_END, KC_PGDN, KC_PSLS, KC_PAST, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT, KC_PENT), \ + +[1] = LAYOUT_96_ansi(\ + RESET, EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + BL_TOGG, BL_STEP, BL_ON, BL_OFF, BL_INC, BL_DEC, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), \ +}; + diff --git a/keyboards/donutcables/budget96/keymaps/default/readme.md b/keyboards/donutcables/budget96/keymaps/default/readme.md new file mode 100644 index 00000000000..acbac7b4e0b --- /dev/null +++ b/keyboards/donutcables/budget96/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for budget96 diff --git a/keyboards/donutcables/budget96/readme.md b/keyboards/donutcables/budget96/readme.md new file mode 100644 index 00000000000..70e4d3afba7 --- /dev/null +++ b/keyboards/donutcables/budget96/readme.md @@ -0,0 +1,44 @@ +# budget96 + +96 key atmega32a keyboard. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Budget96 PCB +Hardware Availability: [DonutCables](https://donutcables.com/) + +Make example for this keyboard (after setting up your build environment): + + make donutcables/budget96:default + +Flashing + +**Reset Key:** Hold down the key located at `K00`, commonly programmed as left control while plugging in the keyboard. + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/donutcables/budget96/rules.mk b/keyboards/donutcables/budget96/rules.mk new file mode 100644 index 00000000000..67697ac7333 --- /dev/null +++ b/keyboards/donutcables/budget96/rules.mk @@ -0,0 +1,49 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +SRC = i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/donutcables/budget96/usbconfig.h b/keyboards/donutcables/budget96/usbconfig.h new file mode 100644 index 00000000000..223b69bb94c --- /dev/null +++ b/keyboards/donutcables/budget96/usbconfig.h @@ -0,0 +1,394 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'D', 'o', 'n', 'u', 't', 'C', 'a', 'b', 'l', 'e', 's' +#define USB_CFG_VENDOR_NAME_LEN 11 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'b', 'u', 'd', 'g', 'e', 't', '9', '6' +#define USB_CFG_DEVICE_NAME_LEN 8 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + diff --git a/keyboards/donutcables/readme.md b/keyboards/donutcables/readme.md new file mode 100644 index 00000000000..d68b6a743cc --- /dev/null +++ b/keyboards/donutcables/readme.md @@ -0,0 +1,12 @@ +# Donut Cables + +Donut Cables LLC is located in North Carolina, USA. + +Website: https://donutcables.com/ + +**Contact Donut Cables at the following:** + +Email: contact@donutcables.com +Reddit: /u/donutcat_cables +Geekhack/DeskThority: donutcat +Discord: @donutcat on the #mechkeys Discord \ No newline at end of file diff --git a/keyboards/donutcables/scrabblepad/config.h b/keyboards/donutcables/scrabblepad/config.h new file mode 100644 index 00000000000..d6490349e82 --- /dev/null +++ b/keyboards/donutcables/scrabblepad/config.h @@ -0,0 +1,189 @@ +/* +Copyright 2018 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Donut Cables +#define PRODUCT ScrabblePad +#define DESCRIPTION 15x15 Ortholinear Board + +/* key matrix size */ +#define MATRIX_ROWS 15 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D5, F1, C7, F2, C6, F3, C5, F4, C4, F5, C3, F6, C2, F7, C1 } +#define MATRIX_COL_PINS { D6, D7, E0, E1, B7, D2, D3, D4, C0, B4, B5, B6, F0, E6, E7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// ws2812 options +//#define RGB_DI_PIN A0 // pin the DI on the ws2812 is hooked-up to +//#define RGBLIGHT_ANIMATIONS // run RGB animations +//#define RGBLED_NUM 6 // number of LEDs +//#define RGBLIGHT_HUE_STEP 12 // units to step when in/decreasing hue +//#define RGBLIGHT_SAT_STEP 25 // units to step when in/decresing saturation +//#define RGBLIGHT_VAL_STEP 12 // units to step when in/decreasing value (brightness) + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 diff --git a/keyboards/scrabblepad/info.json b/keyboards/donutcables/scrabblepad/info.json similarity index 100% rename from keyboards/scrabblepad/info.json rename to keyboards/donutcables/scrabblepad/info.json diff --git a/keyboards/donutcables/scrabblepad/keymaps/default/config.h b/keyboards/donutcables/scrabblepad/keymaps/default/config.h new file mode 100644 index 00000000000..a3ed4f762a6 --- /dev/null +++ b/keyboards/donutcables/scrabblepad/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/donutcables/scrabblepad/keymaps/default/keymap.c b/keyboards/donutcables/scrabblepad/keymaps/default/keymap.c new file mode 100644 index 00000000000..bb78e71313b --- /dev/null +++ b/keyboards/donutcables/scrabblepad/keymaps/default/keymap.c @@ -0,0 +1,52 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT( /* Base */ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ + KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC \ +), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/scrabblepad/keymaps/default/readme.md b/keyboards/donutcables/scrabblepad/keymaps/default/readme.md similarity index 100% rename from keyboards/scrabblepad/keymaps/default/readme.md rename to keyboards/donutcables/scrabblepad/keymaps/default/readme.md diff --git a/keyboards/donutcables/scrabblepad/keymaps/random/keymap.c b/keyboards/donutcables/scrabblepad/keymaps/random/keymap.c new file mode 100644 index 00000000000..8e782596615 --- /dev/null +++ b/keyboards/donutcables/scrabblepad/keymaps/random/keymap.c @@ -0,0 +1,75 @@ +#include "scrabblepad.h" +#include + +static uint16_t keystroke; +static bool shift_pressed; + +static int lower = (int) KC_A; +static int upper = (int) KC_Z; + +uint16_t random_keycode(void) { + return lower + (rand() % (upper - lower + 1)); +}; + +enum custom_keycodes { + RND_KEY = SAFE_RANGE +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case RND_KEY: + if (record->event.pressed) { + keystroke = random_keycode(); + if (rand() % 2 > 0) { + shift_pressed = 1; + register_code(KC_LSHIFT); + } + register_code(keystroke); + } else { + if (shift_pressed > 0) { + unregister_code(KC_LSHIFT); + } + unregister_code(keystroke); + } + + return false; + + default: + return true; + } + + return true; +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT( /* Base */ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RESET, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY +), +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/donutcables/scrabblepad/keymaps/random/readme.md b/keyboards/donutcables/scrabblepad/keymaps/random/readme.md new file mode 100644 index 00000000000..e719adaeb8a --- /dev/null +++ b/keyboards/donutcables/scrabblepad/keymaps/random/readme.md @@ -0,0 +1,5 @@ +# Scrabblepad keymap with every key press random + +Every key produces a random key press, except the middle key, which is reserved for resetting the board. + +The random key press is selected between KC_A and KC_Z keycodes. diff --git a/keyboards/donutcables/scrabblepad/readme.md b/keyboards/donutcables/scrabblepad/readme.md new file mode 100644 index 00000000000..f0b05cbcedf --- /dev/null +++ b/keyboards/donutcables/scrabblepad/readme.md @@ -0,0 +1,17 @@ +# ScrabblePad + +The ScrabblePad is a 15x15 ortholinear keyboard designed for use with +the XDA Scrabble Board sold by [Novelkeys](https://novelkeys.xyz). + +It uses a [Teensy++ 2.0](https://www.pjrc.com/store/teensypp.html) +featuring an at90usb1286 8 bit microcontroller. Usage requires modifying the Teensy by removing the LED on pin D6. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Donut Cables](https://donutcables.com/) +Hardware Supported: Teensy++ 2.0 and ScrabblePad PCB +Hardware Availability: [Donut Cables](https://donutcables.com/) + +Make example for this keyboard (after setting up your build environment): + + make donutcables/scrabblepad:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/scrabblepad/rules.mk b/keyboards/donutcables/scrabblepad/rules.mk similarity index 100% rename from keyboards/scrabblepad/rules.mk rename to keyboards/donutcables/scrabblepad/rules.mk diff --git a/keyboards/scrabblepad/scrabblepad.c b/keyboards/donutcables/scrabblepad/scrabblepad.c similarity index 100% rename from keyboards/scrabblepad/scrabblepad.c rename to keyboards/donutcables/scrabblepad/scrabblepad.c diff --git a/keyboards/donutcables/scrabblepad/scrabblepad.h b/keyboards/donutcables/scrabblepad/scrabblepad.h new file mode 100644 index 00000000000..b4ac8b2c4f5 --- /dev/null +++ b/keyboards/donutcables/scrabblepad/scrabblepad.h @@ -0,0 +1,54 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// Written in the format K(row)(column) where numbering is in hexadecimal +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, \ + k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, k5D, k5E, \ + k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E, \ + k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7A, k7B, k7C, k7D, k7E, \ + k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8A, k8B, k8C, k8D, k8E, \ + k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, k9A, k9B, k9C, k9D, k9E, \ + kA0, kA1, kA2, kA3, kA4, kA5, kA6, kA7, kA8, kA9, kAA, kAB, kAC, kAD, kAE, \ + kB0, kB1, kB2, kB3, kB4, kB5, kB6, kB7, kB8, kB9, kBA, kBB, kBC, kBD, kBE, \ + kC0, kC1, kC2, kC3, kC4, kC5, kC6, kC7, kC8, kC9, kCA, kCB, kCC, kCD, kCE, \ + kD0, kD1, kD2, kD3, kD4, kD5, kD6, kD7, kD8, kD9, kDA, kDB, kDC, kDD, kDE, \ + kE0, kE1, kE2, kE3, kE4, kE5, kE6, kE7, kE8, kE9, kEA, kEB, kEC, kED, kEE \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, }, \ + { k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, k5D, k5E, }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E, }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7A, k7B, k7C, k7D, k7E, }, \ + { k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8A, k8B, k8C, k8D, k8E, }, \ + { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, k9A, k9B, k9C, k9D, k9E, }, \ + { kA0, kA1, kA2, kA3, kA4, kA5, kA6, kA7, kA8, kA9, kAA, kAB, kAC, kAD, kAE, }, \ + { kB0, kB1, kB2, kB3, kB4, kB5, kB6, kB7, kB8, kB9, kBA, kBB, kBC, kBD, kBE, }, \ + { kC0, kC1, kC2, kC3, kC4, kC5, kC6, kC7, kC8, kC9, kCA, kCB, kCC, kCD, kCE, }, \ + { kD0, kD1, kD2, kD3, kD4, kD5, kD6, kD7, kD8, kD9, kDA, kDB, kDC, kDD, kDE, }, \ + { kE0, kE1, kE2, kE3, kE4, kE5, kE6, kE7, kE8, kE9, kEA, kEB, kEC, kED, kEE } \ +} diff --git a/keyboards/doro67/multi/config.h b/keyboards/doro67/multi/config.h new file mode 100644 index 00000000000..4a15063cc26 --- /dev/null +++ b/keyboards/doro67/multi/config.h @@ -0,0 +1,33 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xD070 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Backprop Studio +#define PRODUCT Doro67 Multi PCB +#define DESCRIPTION 65% custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7, F5, F6, F7 } + +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 7 diff --git a/keyboards/doro67/multi/info.json b/keyboards/doro67/multi/info.json new file mode 100644 index 00000000000..03252140dd5 --- /dev/null +++ b/keyboards/doro67/multi/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "Doro67 Multi PCB", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Ins", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"MO(1)", "x":11.25, "y":4, "w":1.25}, {"label":"Left", "x":13, "y":4}, {"label":"Down", "x":14, "y":4}, {"label":"Right", "x":15, "y":4}] + }, + "LAYOUT_iso": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Ins", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"MO(1)", "x":11.25, "y":4, "w":1.25}, {"label":"Left", "x":13, "y":4}, {"label":"Down", "x":14, "y":4}, {"label":"Right", "x":15, "y":4}] + }, + "LAYOUT_multi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Back", "x":13, "y":0}, {"label":"F2", "x":14, "y":0}, {"label":"Ins", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"F1", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4}, {"label":"MO(1)", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"Left", "x":13, "y":4}, {"label":"Down", "x":14, "y":4}, {"label":"Right", "x":15, "y":4}] + } + } +} diff --git a/keyboards/doro67/multi/keymaps/default/keymap.c b/keyboards/doro67/multi/keymaps/default/keymap.c new file mode 100644 index 00000000000..dd40a6c3faa --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2019 ShadeDream + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + BL_TOGG, BL_STEP, BL_DEC, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; diff --git a/keyboards/doro67/multi/keymaps/default/readme.md b/keyboards/doro67/multi/keymaps/default/readme.md new file mode 100644 index 00000000000..9b9136b3441 --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default/readme.md @@ -0,0 +1,43 @@ +# Default Doro67 ANSI layout. + +**THIS IS THE DEFAULT ANSI KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + +This is the default ANSI layout that comes flashed on the Doro67 multi PCB with +the exception of adding backtick as it was not mapped. + +Default Layer: + +``` +,---------------------------------------------------------------. +|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BackSp |Ins| +|---------------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del| +|---------------------------------------------------------------| +|Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Enter |PUp| +|---------------------------------------------------------------| +|Shift | Z| X| C| V| B| N| M| ,| .| /| Shift| Up|PDn| +|---------------------------------------------------------------| +|Ctrl |GUI |Alt | Space |Alt |FN |Lft|Dwn|Rgt| +`---------------------------------------------------------------' +``` + +FN Layer: + +``` +,---------------------------------------------------------------. +|` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | +|---------------------------------------------------------------| +|BLTog|Stp|Dec|Inc| | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | +`---------------------------------------------------------------' +``` diff --git a/keyboards/doro67/multi/keymaps/default_iso/keymap.c b/keyboards/doro67/multi/keymaps/default_iso/keymap.c new file mode 100644 index 00000000000..2e8d8398204 --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default_iso/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2019 ShadeDream + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_iso( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_PGUP, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_iso( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + BL_TOGG, BL_STEP, BL_DEC, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; diff --git a/keyboards/doro67/multi/keymaps/default_iso/readme.md b/keyboards/doro67/multi/keymaps/default_iso/readme.md new file mode 100644 index 00000000000..4b3d2ba4ad4 --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default_iso/readme.md @@ -0,0 +1,43 @@ +# Default Doro67 ISO layout. + +**THIS IS THE DEFAULT ISO KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + +This is the default ISO layout that comes flashed on the Doro67 multi PCB with +the exception of adding backtick and UK ISO specific keycodes as they were not mapped. + +Default Layer: + +``` +,---------------------------------------------------------------. +|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BackSp |Ins| +|---------------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| |Del| +|------------------------------------------------------|Entr|---| +|Ctrl | A| S| D| F| G| H| J| K| L| ;| '| #| |PUp| +|---------------------------------------------------------------| +|Shft| \| Z| X| C| V| B| N| M| ,| .| /| Shift| Up|PDn| +|---------------------------------------------------------------| +|Ctrl |GUI |Alt | Space |Alt |FN |Lft|Dwn|Rgt| +`---------------------------------------------------------------' +``` + +FN Layer: + +``` +,---------------------------------------------------------------. +|` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | +|---------------------------------------------------------------| +|BLTog|Stp|Dec|Inc| | | | | | | | | | | | +|------------------------------------------------------| |---| +| | | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | +`---------------------------------------------------------------' +``` diff --git a/keyboards/doro67/multi/keymaps/default_multi/keymap.c b/keyboards/doro67/multi/keymaps/default_multi/keymap.c new file mode 100644 index 00000000000..e57dce1ea2b --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default_multi/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2019 ShadeDream + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_multi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_F2, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_F1, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_multi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, + BL_TOGG, BL_STEP, BL_DEC, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; diff --git a/keyboards/doro67/multi/keymaps/default_multi/readme.md b/keyboards/doro67/multi/keymaps/default_multi/readme.md new file mode 100644 index 00000000000..5761c006bfb --- /dev/null +++ b/keyboards/doro67/multi/keymaps/default_multi/readme.md @@ -0,0 +1,46 @@ +# Default Doro67 Multi layout. + +**THIS IS THE DEFAULT MULTI-LAYOUT (SPLIT BACKSPACE) KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + +This is the default Multi layout that comes flashed on the Doro67 multi PCB with +the exception of adding backtick as it was not mapped. + +This layout supports both the blocker and non-blocker layouts (2 & 4) with the +difference that the blocker layout lacks the right control key. + +Default Layer: + +``` +,---------------------------------------------------------------. +|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS| F2|Ins| +|---------------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del| +|---------------------------------------------------------------| +|Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Enter |PUp| +|---------------------------------------------------------------| +|Shft| F1| Z| X| C| V| B| N| M| ,| .| /| Shift| Up|PDn| +|---------------------------------------------------------------| +|Ctrl |GUI |Alt | Space |Space| Space |Alt|MO1|Ctl|Lft|Dwn|Rgt| +`---------------------------------------------------------------' +``` + +FN Layer: + +``` +,---------------------------------------------------------------. +|` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | +|---------------------------------------------------------------| +|BLTog|Stp|Dec|Inc| | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | | | | +|---------------------------------------------------------------| +| | | | | | | | | | | | | +`---------------------------------------------------------------' +``` diff --git a/keyboards/doro67/multi/multi.c b/keyboards/doro67/multi/multi.c new file mode 100644 index 00000000000..14e3359c1af --- /dev/null +++ b/keyboards/doro67/multi/multi.c @@ -0,0 +1,50 @@ +/* Copyright 2019 ShadeDream + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "multi.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + setPinOutput(E6); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + + led_set_user(usb_led); +} diff --git a/keyboards/doro67/multi/multi.h b/keyboards/doro67/multi/multi.h new file mode 100644 index 00000000000..0b68aed4260 --- /dev/null +++ b/keyboards/doro67/multi/multi.h @@ -0,0 +1,59 @@ +/* Copyright 2019 ShadeDream + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K44, K49, K4A, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, K44, KC_NO, KC_NO, KC_NO, KC_NO, K49, K4A, KC_NO, K4C, K4D, K4E }, \ +} + +#define LAYOUT_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K44, K49, K4A, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, K44, KC_NO, KC_NO, KC_NO, KC_NO, K49, K4A, KC_NO, K4C, K4D, K4E }, \ +} + +#define LAYOUT_multi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K48, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K43, K44, K45, K49, K4A, K4B, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, KC_NO, KC_NO, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ +} diff --git a/keyboards/doro67/multi/readme.md b/keyboards/doro67/multi/readme.md new file mode 100644 index 00000000000..80465c3ac97 --- /dev/null +++ b/keyboards/doro67/multi/readme.md @@ -0,0 +1,20 @@ +# Doro67 Multi PCB + +65% custom keyboard made by 80ultraman/Alf/Backprop Studios with multiple layout support. Despite the layout options available, layout is dictated by the selected integrated plate. + +**MULTI-LAYOUT PCB (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + +Keyboard Maintainer: [ShadeDream](https://github.com/shadedream) +Hardware Supported: Doro67 Multi PCB +Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) + +Make example for this keyboard (after setting up your build environment): + + make doro67/multi:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/doro67/multi/rules.mk b/keyboards/doro67/multi/rules.mk new file mode 100644 index 00000000000..387ce74822c --- /dev/null +++ b/keyboards/doro67/multi/rules.mk @@ -0,0 +1,47 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/doro67/readme.md b/keyboards/doro67/readme.md new file mode 100644 index 00000000000..1648fbde577 --- /dev/null +++ b/keyboards/doro67/readme.md @@ -0,0 +1,12 @@ +# Doro67 + +The Doro67 is a 65% USB C, integrated plate keyboard with blocker based on the M65-a by Keyclack/Rama. + +The [Group Buy](https://geekhack.org/index.php?topic=97265.0) was run by 80ultraman in coordination with Alf for machining and Backprop Studios for PCB design. + +There were 3 different PCBs available for this group buy. +## **Please be aware of which PCB you own and flash the correct firmware on it.** + +**Regular:** PCB made for the China GB which only had 1 layout. +**Multi:** PCB made for the international GB comprising of multiple layouts. While several layouts were possible, layout was determined by the integrated plate layout chosen by the customer. +**RGB:** PCB made for the international GB which had an identical switch matrix and layout to the regular PCB, with the addition of per key RGB LEDs. \ No newline at end of file diff --git a/keyboards/doro67/regular/config.h b/keyboards/doro67/regular/config.h new file mode 100644 index 00000000000..8c5c670da92 --- /dev/null +++ b/keyboards/doro67/regular/config.h @@ -0,0 +1,31 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Backprop Studio +#define PRODUCT Doro67 Regular PCB +#define DESCRIPTION 65% custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7, F5, F6, F7 } + +#define DIODE_DIRECTION COL2ROW + diff --git a/keyboards/doro67/regular/info.json b/keyboards/doro67/regular/info.json new file mode 100644 index 00000000000..68c9f5dbdf3 --- /dev/null +++ b/keyboards/doro67/regular/info.json @@ -0,0 +1,82 @@ +{ + "keyboard_name": "", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 67, + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K07", "x":7, "y":0}, + {"label":"K08", "x":8, "y":0}, + {"label":"K09", "x":9, "y":0}, + {"label":"K0A", "x":10, "y":0}, + {"label":"K0B", "x":11, "y":0}, + {"label":"K0C", "x":12, "y":0}, + {"label":"K0D", "x":13, "y":0, "w":2}, + {"label":"K0E", "x":15, "y":0}, + {"label":"K10", "x":0, "y":1, "w":1.5}, + {"label":"K11", "x":1.5, "y":1}, + {"label":"K12", "x":2.5, "y":1}, + {"label":"K13", "x":3.5, "y":1}, + {"label":"K14", "x":4.5, "y":1}, + {"label":"K15", "x":5.5, "y":1}, + {"label":"K16", "x":6.5, "y":1}, + {"label":"K17", "x":7.5, "y":1}, + {"label":"K18", "x":8.5, "y":1}, + {"label":"K19", "x":9.5, "y":1}, + {"label":"K1A", "x":10.5, "y":1}, + {"label":"K1B", "x":11.5, "y":1}, + {"label":"K1C", "x":12.5, "y":1}, + {"label":"K1D", "x":13.5, "y":1, "w":1.5}, + {"label":"K1E", "x":15, "y":1}, + {"label":"K20", "x":0, "y":2, "w":1.75}, + {"label":"K21", "x":1.75, "y":2}, + {"label":"K22", "x":2.75, "y":2}, + {"label":"K23", "x":3.75, "y":2}, + {"label":"K24", "x":4.75, "y":2}, + {"label":"K25", "x":5.75, "y":2}, + {"label":"K26", "x":6.75, "y":2}, + {"label":"K27", "x":7.75, "y":2}, + {"label":"K28", "x":8.75, "y":2}, + {"label":"K29", "x":9.75, "y":2}, + {"label":"K2A", "x":10.75, "y":2}, + {"label":"K2B", "x":11.75, "y":2}, + {"label":"K2D", "x":12.75, "y":2, "w":2.25}, + {"label":"K2E", "x":15, "y":2}, + {"label":"K30", "x":0, "y":3, "w":2.25}, + {"label":"K32", "x":2.25, "y":3}, + {"label":"K33", "x":3.25, "y":3}, + {"label":"K34", "x":4.25, "y":3}, + {"label":"K35", "x":5.25, "y":3}, + {"label":"K36", "x":6.25, "y":3}, + {"label":"K37", "x":7.25, "y":3}, + {"label":"K38", "x":8.25, "y":3}, + {"label":"K39", "x":9.25, "y":3}, + {"label":"K3A", "x":10.25, "y":3}, + {"label":"K3B", "x":11.25, "y":3}, + {"label":"K3C", "x":12.25, "y":3, "w":1.75}, + {"label":"K3D", "x":14, "y":3}, + {"label":"K3E", "x":15, "y":3}, + {"label":"K40", "x":0, "y":4, "w":1.25}, + {"label":"K41", "x":1.25, "y":4, "w":1.25}, + {"label":"K42", "x":2.5, "y":4, "w":1.25}, + {"label":"K43", "x":3.75, "y":4, "w":6.25}, + {"label":"K49", "x":10, "y":4, "w":1.25}, + {"label":"K4A", "x":11.25, "y":4, "w":1.25}, + {"label":"K4C", "x":13, "y":4}, + {"label":"K4D", "x":14, "y":4}, + {"label":"K4E", "x":15, "y":4} + ] + } + } + } + \ No newline at end of file diff --git a/keyboards/doro67/regular/keymaps/default/config.h b/keyboards/doro67/regular/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/doro67/regular/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/doro67/regular/keymaps/default/keymap.c b/keyboards/doro67/regular/keymaps/default/keymap.c new file mode 100644 index 00000000000..5271d42c15a --- /dev/null +++ b/keyboards/doro67/regular/keymaps/default/keymap.c @@ -0,0 +1,134 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, KC_LSFT, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, KC_LCTL, KC_LGUI, \ + KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [2] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [3] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [4] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [5] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [6] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [7] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [8] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [9] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [10] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [11] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [12] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [13] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [14] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [15] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + +}; diff --git a/keyboards/doro67/regular/keymaps/default/readme.md b/keyboards/doro67/regular/keymaps/default/readme.md new file mode 100644 index 00000000000..0af057d7800 --- /dev/null +++ b/keyboards/doro67/regular/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# The default keymap for doro67 + +**THIS IS THE DEFAULT KEYMAP DIRECTORY (AVAILABILITY: CHINA GB ONLY)** +If you are a non-china buyer, you probably have the multi PCB or rgb PCB. +Please look at the "multi" and "rgb" readme files. \ No newline at end of file diff --git a/keyboards/doro67/regular/readme.md b/keyboards/doro67/regular/readme.md new file mode 100644 index 00000000000..e2ef7bc646b --- /dev/null +++ b/keyboards/doro67/regular/readme.md @@ -0,0 +1,19 @@ +# Doro67 Regular PCB + +65% custom keyboard made by 80ultraman/Alf/Backprop Studios available during the China Group Buy. + +This is not the PCB with RGB support. Do not flash RGB firmware for this board. + +**REGULAR PCB (AVAILABILITY: CHINA GB ONLY)* +If you are a non-china buyer, you probably have the multi PCB or rgb PCB. +Please look at the "multi" and "rgb" readme files. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Doro67 Regular PCB +Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) + +Make example for this keyboard (after setting up your build environment): + + make doro67/regular:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/doro67/regular/regular.c b/keyboards/doro67/regular/regular.c new file mode 100644 index 00000000000..719ceea6fe9 --- /dev/null +++ b/keyboards/doro67/regular/regular.c @@ -0,0 +1,47 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "regular.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(E6); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + led_set_user(usb_led); +} diff --git a/keyboards/doro67/regular/regular.h b/keyboards/doro67/regular/regular.h new file mode 100644 index 00000000000..76d606b13a0 --- /dev/null +++ b/keyboards/doro67/regular/regular.h @@ -0,0 +1,41 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K43, K49, K4A, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K49, K4A, KC_NO, K4C, K4D, K4E }, \ +} + diff --git a/keyboards/doro67/regular/rules.mk b/keyboards/doro67/regular/rules.mk new file mode 100644 index 00000000000..360c00813f3 --- /dev/null +++ b/keyboards/doro67/regular/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/doro67/rgb/config.h b/keyboards/doro67/rgb/config.h new file mode 100644 index 00000000000..16dc4fc0a48 --- /dev/null +++ b/keyboards/doro67/rgb/config.h @@ -0,0 +1,71 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Backprop Studio +#define PRODUCT Doro67 RGB PCB +#define DESCRIPTION 65% custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// The pin connected to the data pin of the LEDs +#define RGB_DI_PIN B7 +// The number of LEDs connected +#define DRIVER_LED_TOTAL 67 + +#define RGB_MATRIX_KEYPRESSES + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define RGBLED_NUM 67 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/doro67/rgb/info.json b/keyboards/doro67/rgb/info.json new file mode 100644 index 00000000000..2d9b79a23e1 --- /dev/null +++ b/keyboards/doro67/rgb/info.json @@ -0,0 +1,82 @@ +{ + "keyboard_name": "Doro 67 RGB", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 67, + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K07", "x":7, "y":0}, + {"label":"K08", "x":8, "y":0}, + {"label":"K09", "x":9, "y":0}, + {"label":"K0A", "x":10, "y":0}, + {"label":"K0B", "x":11, "y":0}, + {"label":"K0C", "x":12, "y":0}, + {"label":"K0D", "x":13, "y":0, "w":2}, + {"label":"K0E", "x":15, "y":0}, + {"label":"K10", "x":0, "y":1, "w":1.5}, + {"label":"K11", "x":1.5, "y":1}, + {"label":"K12", "x":2.5, "y":1}, + {"label":"K13", "x":3.5, "y":1}, + {"label":"K14", "x":4.5, "y":1}, + {"label":"K15", "x":5.5, "y":1}, + {"label":"K16", "x":6.5, "y":1}, + {"label":"K17", "x":7.5, "y":1}, + {"label":"K18", "x":8.5, "y":1}, + {"label":"K19", "x":9.5, "y":1}, + {"label":"K1A", "x":10.5, "y":1}, + {"label":"K1B", "x":11.5, "y":1}, + {"label":"K1C", "x":12.5, "y":1}, + {"label":"K1D", "x":13.5, "y":1, "w":1.5}, + {"label":"K1E", "x":15, "y":1}, + {"label":"K20", "x":0, "y":2, "w":1.75}, + {"label":"K21", "x":1.75, "y":2}, + {"label":"K22", "x":2.75, "y":2}, + {"label":"K23", "x":3.75, "y":2}, + {"label":"K24", "x":4.75, "y":2}, + {"label":"K25", "x":5.75, "y":2}, + {"label":"K26", "x":6.75, "y":2}, + {"label":"K27", "x":7.75, "y":2}, + {"label":"K28", "x":8.75, "y":2}, + {"label":"K29", "x":9.75, "y":2}, + {"label":"K2A", "x":10.75, "y":2}, + {"label":"K2B", "x":11.75, "y":2}, + {"label":"K2D", "x":12.75, "y":2, "w":2.25}, + {"label":"K2E", "x":15, "y":2}, + {"label":"K30", "x":0, "y":3, "w":2.25}, + {"label":"K32", "x":2.25, "y":3}, + {"label":"K33", "x":3.25, "y":3}, + {"label":"K34", "x":4.25, "y":3}, + {"label":"K35", "x":5.25, "y":3}, + {"label":"K36", "x":6.25, "y":3}, + {"label":"K37", "x":7.25, "y":3}, + {"label":"K38", "x":8.25, "y":3}, + {"label":"K39", "x":9.25, "y":3}, + {"label":"K3A", "x":10.25, "y":3}, + {"label":"K3B", "x":11.25, "y":3}, + {"label":"K3C", "x":12.25, "y":3, "w":1.75}, + {"label":"K3D", "x":14, "y":3}, + {"label":"K3E", "x":15, "y":3}, + {"label":"K40", "x":0, "y":4, "w":1.25}, + {"label":"K41", "x":1.25, "y":4, "w":1.25}, + {"label":"K42", "x":2.5, "y":4, "w":1.25}, + {"label":"K43", "x":3.75, "y":4, "w":6.25}, + {"label":"K49", "x":10, "y":4, "w":1.25}, + {"label":"K4A", "x":11.25, "y":4, "w":1.25}, + {"label":"K4C", "x":13, "y":4}, + {"label":"K4D", "x":14, "y":4}, + {"label":"K4E", "x":15, "y":4} + ] + } + } + } + \ No newline at end of file diff --git a/keyboards/doro67/rgb/keymaps/default/config.h b/keyboards/doro67/rgb/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/doro67/rgb/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/doro67/rgb/keymaps/default/keymap.c b/keyboards/doro67/rgb/keymaps/default/keymap.c new file mode 100644 index 00000000000..d02665ae768 --- /dev/null +++ b/keyboards/doro67/rgb/keymaps/default/keymap.c @@ -0,0 +1,62 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + [1] = LAYOUT( \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ + QMKBEST, QMKURL, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} diff --git a/keyboards/doro67/rgb/keymaps/default/readme.md b/keyboards/doro67/rgb/keymaps/default/readme.md new file mode 100644 index 00000000000..eb5c49419d8 --- /dev/null +++ b/keyboards/doro67/rgb/keymaps/default/readme.md @@ -0,0 +1,7 @@ +# The default keymap for rgb + +**RGB PCB (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "rgb" directory includes the keymap for the RGB PCB. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased a non-rgb PCB, please see the 'multi' directory. \ No newline at end of file diff --git a/keyboards/doro67/rgb/readme.md b/keyboards/doro67/rgb/readme.md new file mode 100644 index 00000000000..61c82d0d146 --- /dev/null +++ b/keyboards/doro67/rgb/readme.md @@ -0,0 +1,23 @@ +# Doro67 RGB PCB + +65% custom keyboard made by 80ultraman/Alf/Backprop Studios with in switch RGB featuring the same switch matrix and layout as the regular PCB. + +Flashing the regular PCB firmware on this board will work, but will disable RGB lighting. + +**THIS IS THE RGB PCB DIRECTORY (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "rgb" directory includes the keymap for the RGB PCB. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased a non-rgb PCB, please see the 'multi' directory. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Doro 67 RGB PCB +Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) + +Make example for this keyboard (after setting up your build environment): + + make doro67/rgb:default + +**RGB Note:** The WS2812 string of LEDs starts from the `K00` key connected to pin `B7` and is connected from left to right, top to bottom, following the physical layout of the board. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/doro67/rgb/rgb.c b/keyboards/doro67/rgb/rgb.c new file mode 100644 index 00000000000..e8c9ac63216 --- /dev/null +++ b/keyboards/doro67/rgb/rgb.c @@ -0,0 +1,84 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rgb.h" +#include "rgb_matrix_types.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(E6); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + led_set_user(usb_led); +} + +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 }, + { 58, 59, 60, 61, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 62, 63, NO_LED, 64, 65, 66 } +}, { + // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Ins + { 0, 0 }, { 15, 0 }, { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 120, 0 }, { 135, 0 }, { 150, 0 }, { 165, 0 }, { 180, 0 }, { 202, 0 }, { 225, 0 }, + // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], , Del + { 7, 16 }, { 22, 16 }, { 37, 16 }, { 52, 16 }, { 67, 16 }, { 82, 16 }, { 97, 16 }, { 112, 16 }, { 127, 16 }, { 142, 16 }, { 157, 16 }, { 172, 16 }, { 187, 16 }, { 206, 16 }, { 225, 16 }, + // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Pgup + { 11, 32 }, { 26, 32 }, { 41, 32 }, { 56, 32 }, { 71, 32 }, { 86, 32 }, { 101, 32 }, { 116, 32 }, { 131, 32 }, { 146, 32 }, { 161, 32 }, { 176, 32 }, { 198, 32 }, { 225, 32 }, + // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Pgdn + { 18, 48 }, { 30, 48 }, { 45, 48 }, { 60, 48 }, { 75, 48 }, { 90, 48 }, { 105, 48 }, { 120, 48 }, { 135, 48 }, { 150, 48 }, { 165, 48 }, { 191, 48 }, { 210, 48 }, { 225, 48 }, + // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right + { 3, 64 }, { 22, 64 }, { 33, 64 }, { 101, 64 }, { 135, 64 }, { 153, 64 }, { 195, 64 }, { 210, 64 }, { 225, 64 } +}, { + // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Ins + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], , Del + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Pgup + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Pgdn + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, + // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right + 1, 1, 1, 4, 1, 1, 1, 1, 1 +} }; diff --git a/keyboards/doro67/rgb/rgb.h b/keyboards/doro67/rgb/rgb.h new file mode 100644 index 00000000000..aafba11d0e6 --- /dev/null +++ b/keyboards/doro67/rgb/rgb.h @@ -0,0 +1,41 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2E, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ + k40, k41, k42, k43, k49, k4A, k4C, k4D, k4E \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, k2E }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \ + { k40, k41, k42, k43, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k49, k4A, KC_NO, k4C, k4D, k4E }, \ +} diff --git a/keyboards/doro67/rgb/rules.mk b/keyboards/doro67/rgb/rules.mk new file mode 100644 index 00000000000..36001da3aca --- /dev/null +++ b/keyboards/doro67/rgb/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +RGB_MATRIX_ENABLE = WS2812 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/dozen0/config.h b/keyboards/dozen0/config.h new file mode 100644 index 00000000000..9ea2c1795fd --- /dev/null +++ b/keyboards/dozen0/config.h @@ -0,0 +1,222 @@ +/* +Copyright 2019 yynmt + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER yynmt +#define PRODUCT Dozen0 +#define DESCRIPTION 12 keys macropad + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F4 } +#define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, B5, B4, E6, D7, C6, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/dozen0/dozen0.c b/keyboards/dozen0/dozen0.c new file mode 100644 index 00000000000..8b52aa89867 --- /dev/null +++ b/keyboards/dozen0/dozen0.c @@ -0,0 +1,43 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "dozen0.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/dozen0/dozen0.h b/keyboards/dozen0/dozen0.h new file mode 100644 index 00000000000..e2ab35bcef8 --- /dev/null +++ b/keyboards/dozen0/dozen0.h @@ -0,0 +1,34 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, \ + K06, K07, K08, K09, K10, K11 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11 }, \ +} diff --git a/keyboards/dozen0/info.json b/keyboards/dozen0/info.json new file mode 100644 index 00000000000..36eb8bec63c --- /dev/null +++ b/keyboards/dozen0/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Dozen0", + "url": "http://yynmt.com", + "maintainer": "yynmt", + "width": 6, + "height": 2, + "layouts": { + "LAYOUT": { + "key_count": 12, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1} + ] + } + } +} diff --git a/keyboards/dozen0/keymaps/default/config.h b/keyboards/dozen0/keymaps/default/config.h new file mode 100644 index 00000000000..bab59c67e07 --- /dev/null +++ b/keyboards/dozen0/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/dozen0/keymaps/default/keymap.c b/keyboards/dozen0/keymaps/default/keymap.c new file mode 100644 index 00000000000..da0aae0b02b --- /dev/null +++ b/keyboards/dozen0/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_UP, KC_DEL, KC_BSPC, \ + KC_LCTRL, KC_LSFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_ENT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/dozen0/keymaps/default/readme.md b/keyboards/dozen0/keymaps/default/readme.md new file mode 100644 index 00000000000..bf63c1f1ae1 --- /dev/null +++ b/keyboards/dozen0/keymaps/default/readme.md @@ -0,0 +1,8 @@ +# The default keymap for Dozen0 + +``` + ,-------------------------------------------------. +| Ctrl+X | Ctrl+C | Ctrl+V | Up | Delete | Bksp | +| Ctrl | Shift | Left | Down | Right | Enter | +`--------------------------------------------------' +``` diff --git a/keyboards/dozen0/keymaps/f12/config.h b/keyboards/dozen0/keymaps/f12/config.h new file mode 100644 index 00000000000..bab59c67e07 --- /dev/null +++ b/keyboards/dozen0/keymaps/f12/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/dozen0/keymaps/f12/keymap.c b/keyboards/dozen0/keymaps/f12/keymap.c new file mode 100644 index 00000000000..bc8cd4123dd --- /dev/null +++ b/keyboards/dozen0/keymaps/f12/keymap.c @@ -0,0 +1,40 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, \ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/dozen0/readme.md b/keyboards/dozen0/readme.md new file mode 100644 index 00000000000..7ef11924619 --- /dev/null +++ b/keyboards/dozen0/readme.md @@ -0,0 +1,15 @@ +# Dozen0 + +![Dozen0](https://raw.githubusercontent.com/yynmt/Dozen0/master/images/main_image_mx.jpg) + +Dozen0 is 12 keys macropad. + +Keyboard Maintainer: [yynmt](https://github.com/yynmt) +Hardware Supported: Dozen0 PCBs, ProMicro supported +Hardware Availability: links to where you can find this hardware + +Make example for this keyboard (after setting up your build environment): + + make dozen0:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/dozen0/rules.mk b/keyboards/dozen0/rules.mk new file mode 100644 index 00000000000..bc370be0397 --- /dev/null +++ b/keyboards/dozen0/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/duck/duck_led/duck_led.c b/keyboards/duck/duck_led/duck_led.c new file mode 100644 index 00000000000..2fa920e4b61 --- /dev/null +++ b/keyboards/duck/duck_led/duck_led.c @@ -0,0 +1,7 @@ +#include +#include "duck_led.h" +#include "quantum.h" + +void show(void) { + wait_us((RES / 1000UL) + 1); +} diff --git a/keyboards/duck/duck_led/duck_led.h b/keyboards/duck/duck_led/duck_led.h new file mode 100644 index 00000000000..2546366d0c5 --- /dev/null +++ b/keyboards/duck/duck_led/duck_led.h @@ -0,0 +1,16 @@ +#pragma once + +#define RES 6000 + +#define NS_PER_SEC (1000000000L) +#define CYCLES_PER_SEC (F_CPU) +#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) +#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) + +enum Device { + Device_PCBRGB, + Device_STATUSLED +}; + +void show(void); + diff --git a/keyboards/duck/eagle_viper/readme.md b/keyboards/duck/eagle_viper/readme.md index ded0fa72e96..63623940bec 100644 --- a/keyboards/duck/eagle_viper/readme.md +++ b/keyboards/duck/eagle_viper/readme.md @@ -2,11 +2,6 @@ Non official firmware for custom Korean keyboard with 60% key layout made by Duck. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127) -Make example for this keyboard (after setting up your build environment): - - make duck/eagle_viper/v2:default - +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/duck/eagle_viper/v2/config.h b/keyboards/duck/eagle_viper/v2/config.h index f04b4a0fd30..e328b1ee228 100644 --- a/keyboards/duck/eagle_viper/v2/config.h +++ b/keyboards/duck/eagle_viper/v2/config.h @@ -15,15 +15,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 +#define VENDOR_ID 0x444B // Duck ("DK") +#define PRODUCT_ID 0x4556 // Eagle/Viper ("EV") +#define DEVICE_VER 0x0002 #define MANUFACTURER Duck #define PRODUCT Eagle/Viper V2 #define DESCRIPTION 60% Korean custom keyboard @@ -35,20 +34,17 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* number of backlight levels */ #define BACKLIGHT_LEVELS 3 -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGBLIGHT_ANIMATIONS #define RGB_DI_PIN D6 #define RGBLED_NUM 17 -#define TAPPING_TERM 200 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 4 +#define BOOTMAGIC_LITE_COLUMN 10 -#endif +#define TAPPING_TERM 200 diff --git a/keyboards/duck/eagle_viper/v2/indicator_leds.c b/keyboards/duck/eagle_viper/v2/indicator_leds.c index 03a93197da6..fc90ed3fbda 100644 --- a/keyboards/duck/eagle_viper/v2/indicator_leds.c +++ b/keyboards/duck/eagle_viper/v2/indicator_leds.c @@ -19,19 +19,13 @@ along with this program. If not, see . #include #include #include "indicator_leds.h" - -#define RES 6000 +#include "duck_led/duck_led.h" #define LED_T1H 600 #define LED_T1L 650 #define LED_T0H 250 #define LED_T0L 1000 -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) - void send_bit_d4(bool bitVal) { if(bitVal) { asm volatile ( @@ -66,14 +60,12 @@ void send_bit_d4(bool bitVal) { } } -void show(void) { - _delay_us((RES / 1000UL) + 1); -} - -void send_value(uint8_t byte) { +void send_value(uint8_t byte, enum Device device) { for(uint8_t b = 0; b < 8; b++) { - send_bit_d4(byte & 0b10000000); - byte <<= 1; + if(device == Device_STATUSLED) { + send_bit_d4(byte & 0b10000000); + byte <<= 1; + } } } @@ -83,7 +75,8 @@ void indicator_leds_set(bool leds[8]) { cli(); for(led_cnt = 0; led_cnt < 8; led_cnt++) - send_value(leds[led_cnt] ? 255 : 0); + send_value(leds[led_cnt] ? 255 : 0, Device_STATUSLED); sei(); show(); } + diff --git a/keyboards/duck/eagle_viper/v2/indicator_leds.h b/keyboards/duck/eagle_viper/v2/indicator_leds.h index c174fa404da..fe66eef6b2f 100644 --- a/keyboards/duck/eagle_viper/v2/indicator_leds.h +++ b/keyboards/duck/eagle_viper/v2/indicator_leds.h @@ -1,2 +1 @@ void indicator_leds_set(bool leds[8]); -void show(void); diff --git a/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c b/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c index 332db66e641..e7dff55d0bf 100644 --- a/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c +++ b/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c @@ -33,7 +33,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; diff --git a/keyboards/duck/eagle_viper/v2/matrix.c b/keyboards/duck/eagle_viper/v2/matrix.c index 7003a7ae00d..0964493ac6c 100644 --- a/keyboards/duck/eagle_viper/v2/matrix.c +++ b/keyboards/duck/eagle_viper/v2/matrix.c @@ -22,7 +22,7 @@ along with this program. If not, see . #include "print.h" #include "debug.h" -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -89,7 +89,10 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<. */ -#ifndef V2_H -#define V2_H +#pragma once #include "quantum.h" @@ -78,4 +77,3 @@ #define LAYOUT_eagle LAYOUT_60_ansi -#endif diff --git a/keyboards/duck/jetfire/backlight_led.c b/keyboards/duck/jetfire/backlight_led.c deleted file mode 100644 index 7e9dca6e9f1..00000000000 --- a/keyboards/duck/jetfire/backlight_led.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2016 Ralf Schmitt -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include -#include "backlight_led.h" -#include "quantum.h" -// #include "led.h" - - -#define T1H 900 -#define T1L 600 -#define T0H 400 -#define T0L 900 -#define RES 6000 - -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) - -void send_bit_d4(bool bitVal) -{ - if(bitVal) { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); - } else { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); - } -} - -void send_bit_d6(bool bitVal) -{ - if(bitVal) { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); - } else { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); - } -} - -void show(void) -{ - _delay_us((RES / 1000UL) + 1); -} - -void send_value(uint8_t byte, enum Device device) -{ - for(uint8_t b = 0; b < 8; b++) { - if(device == Device_STATELED) { - send_bit_d4(byte & 0b10000000); - } - if(device == Device_PCBRGB) { - send_bit_d6(byte & 0b10000000); - } - byte <<= 1; - } -} - -void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) -{ - send_value(g, device); - send_value(r, device); - send_value(b, device); -} diff --git a/keyboards/duck/jetfire/backlight_led.h b/keyboards/duck/jetfire/backlight_led.h deleted file mode 100644 index 36d8d9aa9b3..00000000000 --- a/keyboards/duck/jetfire/backlight_led.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef BACKLIGHT_LED_H -#define BACKLIGHT_LED_H - -enum Device { - Device_PCBRGB, - Device_STATELED -}; - -void backlight_init_ports(void); -void backlight_set_state(bool cfg[7]); -void backlight_update_state(void); -void backlight_toggle_rgb(bool enabled); -void backlight_set_rgb(uint8_t cfg[17][3]); -void backlight_set(uint8_t level); -void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device); -void show(void); - -#endif diff --git a/keyboards/duck/jetfire/config.h b/keyboards/duck/jetfire/config.h index 80b531fd527..f616bc238e8 100644 --- a/keyboards/duck/jetfire/config.h +++ b/keyboards/duck/jetfire/config.h @@ -20,9 +20,9 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 +#define VENDOR_ID 0x444B // Duck ("DK") +#define PRODUCT_ID 0x4A46 // Jetfire ("JF") +#define DEVICE_VER 0x0001 #define MANUFACTURER Duck #define PRODUCT Jetfire #define DESCRIPTION A custom keyboard @@ -31,10 +31,9 @@ along with this program. If not, see . #define MATRIX_ROWS 6 #define MATRIX_COLS 20 -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW - #define BACKLIGHT_LEVELS 1 #define RGB_DI_PIN D6 @@ -47,8 +46,11 @@ along with this program. If not, see . // #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 10 /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. * This is userful for the Windows task manager shortcut (ctrl+shift+esc). @@ -88,11 +90,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -197,4 +194,3 @@ along with this program. If not, see . #define LCD_E_PIN 1 //< pin for Enable line #endif */ - diff --git a/keyboards/duck/jetfire/indicator_leds.c b/keyboards/duck/jetfire/indicator_leds.c new file mode 100644 index 00000000000..7dbdb1ff79b --- /dev/null +++ b/keyboards/duck/jetfire/indicator_leds.c @@ -0,0 +1,116 @@ +/* +Copyright 2016 Ralf Schmitt +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include +#include +#include +#include +#include "indicator_leds.h" +#include "quantum.h" + +#define LED_T1H 900 +#define LED_T1L 600 +#define LED_T0H 400 +#define LED_T0L 900 + +void send_bit_d4(bool bitVal) +{ + if(bitVal) { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); + } else { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); + } +} + +void send_bit_d6(bool bitVal) +{ + if(bitVal) { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (6), + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); + } else { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (6), + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); + } +} + +void send_value(uint8_t byte, enum Device device) +{ + for(uint8_t b = 0; b < 8; b++) { + if(device == Device_STATUSLED) { + send_bit_d4(byte & 0b10000000); + } + if(device == Device_PCBRGB) { + send_bit_d6(byte & 0b10000000); + } + byte <<= 1; + } +} + +void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) +{ + send_value(r, device); + send_value(g, device); + send_value(b, device); +} diff --git a/keyboards/duck/jetfire/indicator_leds.h b/keyboards/duck/jetfire/indicator_leds.h new file mode 100644 index 00000000000..695e1db6d41 --- /dev/null +++ b/keyboards/duck/jetfire/indicator_leds.h @@ -0,0 +1,11 @@ +#pragma once + +#include "duck_led/duck_led.h" + +void backlight_init_ports(void); +void backlight_set_state(bool cfg[7]); +void backlight_update_state(void); +void backlight_toggle_rgb(bool enabled); +void backlight_set_rgb(uint8_t cfg[17][3]); +void backlight_set(uint8_t level); +void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device); diff --git a/keyboards/duck/jetfire/jetfire.c b/keyboards/duck/jetfire/jetfire.c index 81bdb95ba1f..0662489c6f2 100644 --- a/keyboards/duck/jetfire/jetfire.c +++ b/keyboards/duck/jetfire/jetfire.c @@ -14,9 +14,9 @@ * along with this program. If not, see . */ #include "jetfire.h" -#include "backlight_led.h" +#include "indicator_leds.h" -enum backlight_level { +enum BACKLIGHT_AREAS { BACKLIGHT_ALPHA = 0b0000001, BACKLIGHT_MOD = 0b0000010, BACKLIGHT_FROW = 0b0000100, @@ -137,15 +137,15 @@ void backlight_update_state() send_color(backlight_state_led & (1<. */ -#ifndef JETFIRE_H -#define JETFIRE_H +#pragma once #include "quantum.h" @@ -57,4 +56,3 @@ { K0A, K0B, K0C, KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, K0I, KC_NO,KC_NO,KC_NO, K0M, K0N, K0O, K0P, K0Q, K0R, K0S, KC_NO } \ } -#endif diff --git a/keyboards/duck/jetfire/keymaps/default/keymap.c b/keyboards/duck/jetfire/keymaps/default/keymap.c index da0081a75e6..9377ef00280 100644 --- a/keyboards/duck/jetfire/keymaps/default/keymap.c +++ b/keyboards/duck/jetfire/keymaps/default/keymap.c @@ -26,22 +26,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_COMM), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/duck/jetfire/matrix.c b/keyboards/duck/jetfire/matrix.c index 51202aeb643..2dd94a72ac0 100644 --- a/keyboards/duck/jetfire/matrix.c +++ b/keyboards/duck/jetfire/matrix.c @@ -21,7 +21,7 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -97,7 +97,7 @@ uint8_t matrix_scan(void) if (debouncing) { dprint("bounce!: "); dprintf("%02X", debouncing); dprintln(); } - debouncing = DEBOUNCING_DELAY; + debouncing = DEBOUNCE; } } unselect_cols(); diff --git a/keyboards/duck/jetfire/readme.md b/keyboards/duck/jetfire/readme.md index fe641e622f9..8de2f5ced6f 100644 --- a/keyboards/duck/jetfire/readme.md +++ b/keyboards/duck/jetfire/readme.md @@ -9,10 +9,10 @@ Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) Hardware Supported: Duck Jetfire PCB Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=92708.0) -To get into bootloader mode, hold the top top most key above the 2 navigation keys while connecting the USB cable. +**Reset Key:** To put the Jetfire into reset, hold top most key above the 2 navigation keys (`K5P`) while plugging in. Make example for this keyboard (after setting up your build environment): make duck/jetfire:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/duck/jetfire/rules.mk b/keyboards/duck/jetfire/rules.mk index 8e05516df3d..dceddc7c7d0 100644 --- a/keyboards/duck/jetfire/rules.mk +++ b/keyboards/duck/jetfire/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -51,7 +50,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) @@ -70,5 +69,5 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) CUSTOM_MATRIX = yes -SRC += backlight_led.c \ - matrix.c +SRC += indicator_leds.c \ + matrix.c duck_led/duck_led.c diff --git a/keyboards/duck/lightsaver/config.h b/keyboards/duck/lightsaver/config.h index bc984c7e56f..5bb4e6faf97 100644 --- a/keyboards/duck/lightsaver/config.h +++ b/keyboards/duck/lightsaver/config.h @@ -15,14 +15,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x1337 +#define VENDOR_ID 0x444B // Duck ("DK") +#define PRODUCT_ID 0x4C53 // Lightsaver ("LS") #define DEVICE_VER 0x0003 #define MANUFACTURER Duck #define PRODUCT Lightsaver V3 @@ -35,20 +34,17 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* number of backlight levels */ #define BACKLIGHT_LEVELS 1 -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGBLIGHT_ANIMATIONS #define RGB_DI_PIN D6 #define RGBLED_NUM 17 -#define TAPPING_TERM 200 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 10 -#endif +#define TAPPING_TERM 200 diff --git a/keyboards/duck/lightsaver/indicator_leds.c b/keyboards/duck/lightsaver/indicator_leds.c index 0a54e151e1d..5d2e1ad9f63 100644 --- a/keyboards/duck/lightsaver/indicator_leds.c +++ b/keyboards/duck/lightsaver/indicator_leds.c @@ -18,17 +18,12 @@ along with this program. If not, see . #include #include #include +#include "duck_led/duck_led.h" -#define T1H 900 -#define T1L 600 -#define T0H 400 -#define T0L 900 -#define RES 6000 - -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) +#define LED_T1H 900 +#define LED_T1L 600 +#define LED_T0H 400 +#define LED_T0L 900 void send_bit_d4(bool bitVal) { if(bitVal) { @@ -44,8 +39,8 @@ void send_bit_d4(bool bitVal) { :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); } else { asm volatile ( "sbi %[port], %[bit] \n\t" @@ -59,33 +54,31 @@ void send_bit_d4(bool bitVal) { :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); } } -void show(void) { - _delay_us((RES / 1000UL) + 1); -} - -void send_value(uint8_t byte) { +void send_value(uint8_t byte, enum Device device) { for(uint8_t b = 0; b < 8; b++) { - send_bit_d4(byte & 0b10000000); - byte <<= 1; + if(device == Device_STATUSLED) { + send_bit_d4(byte & 0b10000000); + byte <<= 1; + } } } -void send_color(uint8_t r, uint8_t g, uint8_t b) { - send_value(g); - send_value(r); - send_value(b); +void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) { + send_value(r, device); + send_value(g, device); + send_value(b, device); } void indicator_leds_set(bool leds[8]) { cli(); - send_color(leds[1] ? 255 : 0, leds[2] ? 255 : 0, leds[0] ? 255 : 0); - send_color(leds[4] ? 255 : 0, leds[5] ? 255 : 0, leds[3] ? 255 : 0); - send_color(leds[6] ? 255 : 0, leds[7] ? 255 : 0, 0); + send_color(leds[1] ? 255 : 0, leds[2] ? 255 : 0, leds[0] ? 255 : 0, Device_STATUSLED); + send_color(leds[4] ? 255 : 0, leds[5] ? 255 : 0, leds[3] ? 255 : 0, Device_STATUSLED); + send_color(leds[6] ? 255 : 0, leds[7] ? 255 : 0, 0, Device_STATUSLED); sei(); show(); } diff --git a/keyboards/duck/lightsaver/keymaps/default/keymap.c b/keyboards/duck/lightsaver/keymaps/default/keymap.c index d945ada24da..346a87e3ee4 100644 --- a/keyboards/duck/lightsaver/keymaps/default/keymap.c +++ b/keyboards/duck/lightsaver/keymaps/default/keymap.c @@ -42,7 +42,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), \ }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; diff --git a/keyboards/duck/lightsaver/keymaps/rasmus/keymap.c b/keyboards/duck/lightsaver/keymaps/rasmus/keymap.c index 518ba2d21a7..70dc17bb139 100644 --- a/keyboards/duck/lightsaver/keymaps/rasmus/keymap.c +++ b/keyboards/duck/lightsaver/keymaps/rasmus/keymap.c @@ -91,9 +91,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { case SHRG: diff --git a/keyboards/duck/lightsaver/lightsaver.h b/keyboards/duck/lightsaver/lightsaver.h index 19fcf36bacb..1e1185713b1 100644 --- a/keyboards/duck/lightsaver/lightsaver.h +++ b/keyboards/duck/lightsaver/lightsaver.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef LIGHTSAVER_H -#define LIGHTSAVER_H +#pragma once #include "quantum.h" @@ -37,4 +36,3 @@ /* 5 */ { K0A, K0B, K0C, NO, NO, NO, NO, NO, K0I, NO, K0K, NO, K0M, K0N, K0O, K0P, K0Q, K0R } \ } -#endif diff --git a/keyboards/duck/lightsaver/matrix.c b/keyboards/duck/lightsaver/matrix.c index a07cdd0d161..066452724f1 100644 --- a/keyboards/duck/lightsaver/matrix.c +++ b/keyboards/duck/lightsaver/matrix.c @@ -22,7 +22,7 @@ along with this program. If not, see . #include "print.h" #include "debug.h" -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -87,7 +87,10 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<. */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 +#define VENDOR_ID 0x444B // Duck ("DK") +#define PRODUCT_ID 0x4F31 // Octagon V1 ("O1") +#define DEVICE_VER 0x0001 #define MANUFACTURER Duck #define PRODUCT Octagon V1 #define DESCRIPTION Duck Octagon V1 @@ -35,20 +34,17 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* number of backlight levels */ #define BACKLIGHT_LEVELS 1 -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGBLIGHT_ANIMATIONS #define RGB_DI_PIN D6 #define RGBLED_NUM 17 -#define TAPPING_TERM 200 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 10 -#endif +#define TAPPING_TERM 200 diff --git a/keyboards/duck/octagon/v1/info.json b/keyboards/duck/octagon/v1/info.json index 1feff95192c..ff45267004d 100644 --- a/keyboards/duck/octagon/v1/info.json +++ b/keyboards/duck/octagon/v1/info.json @@ -5,8 +5,94 @@ "width": 16, "height": 6, "layouts": { - "LAYOUT": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] + "LAYOUT_75_ansi": { + "key_count": 84, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PrtSc", "x":13, "y":0}, + {"label":"ScrLk", "x":14, "y":0}, + {"label":"Pause", "x":15, "y":0}, + {"label":"~", "x":0, "y":1}, + {"label":"!", "x":1, "y":1}, + {"label":"@", "x":2, "y":1}, + {"label":"#", "x":3, "y":1}, + {"label":"$", "x":4, "y":1}, + {"label":"%", "x":5, "y":1}, + {"label":"^", "x":6, "y":1}, + {"label":"&", "x":7, "y":1}, + {"label":"*", "x":8, "y":1}, + {"label":"(", "x":9, "y":1}, + {"label":")", "x":10, "y":1}, + {"label":"_", "x":11, "y":1}, + {"label":"+", "x":12, "y":1}, + {"label":"Backspace", "x":13, "y":1, "w":2}, + {"label":"Home", "x":15, "y":1}, + {"label":"Tab", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"{", "x":11.5, "y":2}, + {"label":"}", "x":12.5, "y":2}, + {"label":"|", "x":13.5, "y":2, "w":1.5}, + {"label":"Page Up", "x":15, "y":2}, + {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":":", "x":10.75, "y":3}, + {"label":"\"", "x":11.75, "y":3}, + {"label":"Enter", "x":12.75, "y":3, "w":2.25}, + {"label":"Page Down", "x":15, "y":3}, + {"label":"Shift", "x":0, "y":4, "w":2.25}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":"<", "x":9.25, "y":4}, + {"label":">", "x":10.25, "y":4}, + {"label":"?", "x":11.25, "y":4}, + {"label":"Shift", "x":12.25, "y":4, "w":1.75}, + {"label":"\u2191", "x":14, "y":4}, + {"label":"End", "x":15, "y":4}, + {"label":"Ctrl", "x":0, "y":5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5, "w":6.25}, + {"label":"Alt", "x":10, "y":5}, + {"label":"Fn", "x":11, "y":5}, + {"label":"Ctrl", "x":12, "y":5}, + {"label":"\u2190", "x":13, "y":5}, + {"label":"\u2193", "x":14, "y":5}, + {"label":"\u2192", "x":15, "y":5} + ] } } } diff --git a/keyboards/duck/octagon/v1/matrix.c b/keyboards/duck/octagon/v1/matrix.c index 8555349943c..a2bea865bc3 100644 --- a/keyboards/duck/octagon/v1/matrix.c +++ b/keyboards/duck/octagon/v1/matrix.c @@ -22,7 +22,7 @@ along with this program. If not, see . #include "print.h" #include "debug.h" -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -84,7 +84,10 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<. */ -#ifndef V1_H -#define V1_H +#pragma once #include "quantum.h" -#define LAYOUT( \ - K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5P, \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4P, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3P, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K5O, K2N, K2P, \ - K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, K1P, \ - K0A, K0B, K0C, K0G, K0J, K0K, K0L, K0M, K0N, K0P \ -) { \ - { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P }, \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, KC_NO, K4P }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, KC_NO, K3P }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, K2N, KC_NO, K2P }, \ - { K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, KC_NO, K1M, K1N, KC_NO, K1P }, \ - { K0A, K0B, K0C, KC_NO, KC_NO, K0G, KC_NO, KC_NO, K0J, K0K, K0L, KC_NO, K0M, K0N, KC_NO, K0P } \ -} - #define LAYOUT_75_ansi( \ K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, \ K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4P, \ @@ -49,4 +32,3 @@ { K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, KC_NO, K1M, K1N, KC_NO, K1P }, \ { K0A, K0B, K0C, KC_NO, KC_NO, K0G, KC_NO, KC_NO, K0J, K0K, K0L, KC_NO, K0M, K0N, KC_NO, K0P } \ } -#endif diff --git a/keyboards/duck/octagon/v2/config.h b/keyboards/duck/octagon/v2/config.h index c916a30a1e9..82b0c8a9971 100644 --- a/keyboards/duck/octagon/v2/config.h +++ b/keyboards/duck/octagon/v2/config.h @@ -15,15 +15,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 +#define VENDOR_ID 0x444B // Duck ("DK") +#define PRODUCT_ID 0x4F32 // Octagon V2 ("O2") +#define DEVICE_VER 0x0002 #define MANUFACTURER Duck #define PRODUCT Octagon V2 #define DESCRIPTION Duck Octagon V2 @@ -35,20 +34,17 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* number of backlight levels */ #define BACKLIGHT_LEVELS 1 -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGBLIGHT_ANIMATIONS #define RGB_DI_PIN D6 #define RGBLED_NUM 17 -#define TAPPING_TERM 200 +/* Set to top left most key */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 10 -#endif +#define TAPPING_TERM 200 diff --git a/keyboards/duck/octagon/v2/indicator_leds.c b/keyboards/duck/octagon/v2/indicator_leds.c index c24509f5144..116306fb712 100644 --- a/keyboards/duck/octagon/v2/indicator_leds.c +++ b/keyboards/duck/octagon/v2/indicator_leds.c @@ -20,16 +20,10 @@ along with this program. If not, see . #include #include "indicator_leds.h" -#define T1H 900 -#define T1L 600 -#define T0H 400 -#define T0L 900 -#define RES 6000 - -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) +#define LED_T1H 900 +#define LED_T1L 600 +#define LED_T0H 400 +#define LED_T0L 900 void send_bit_d4(bool bitVal) { if(bitVal) { @@ -45,8 +39,8 @@ void send_bit_d4(bool bitVal) { :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); } else { asm volatile ( "sbi %[port], %[bit] \n\t" @@ -60,8 +54,8 @@ void send_bit_d4(bool bitVal) { :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); } } @@ -80,8 +74,8 @@ void send_bit_d6(bool bitVal) :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); } else { asm volatile ( "sbi %[port], %[bit] \n\t" @@ -95,15 +89,11 @@ void send_bit_d6(bool bitVal) :: [port] "I" (_SFR_IO_ADDR(PORTD)), [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); } } -void show(void) { - _delay_us((RES / 1000UL) + 1); -} - void send_value(uint8_t byte, enum Device device) { for(uint8_t b = 0; b < 8; b++) { if(device == Device_STATUSLED) { @@ -117,8 +107,8 @@ void send_value(uint8_t byte, enum Device device) { } void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) { - send_value(g, device); send_value(r, device); + send_value(g, device); send_value(b, device); } diff --git a/keyboards/duck/octagon/v2/indicator_leds.h b/keyboards/duck/octagon/v2/indicator_leds.h index 9bb2c8ced93..ad3ec54f52a 100644 --- a/keyboards/duck/octagon/v2/indicator_leds.h +++ b/keyboards/duck/octagon/v2/indicator_leds.h @@ -1,11 +1,7 @@ -enum Device { - Device_PCBRGB, - Device_STATUSLED -}; +#include "duck_led/duck_led.h" void indicator_leds_set(bool leds[8]); void backlight_toggle_rgb(bool enabled); void backlight_set_rgb(uint8_t cfg[17][3]); void backlight_init_ports(void); void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device); -void show(void); \ No newline at end of file diff --git a/keyboards/duck/octagon/v2/info.json b/keyboards/duck/octagon/v2/info.json index 7bc0c6ef90c..11bde45a5d4 100644 --- a/keyboards/duck/octagon/v2/info.json +++ b/keyboards/duck/octagon/v2/info.json @@ -1,12 +1,16 @@ { - "keyboard_name": "Octagon V2", - "url": "", - "maintainer": "qmk", - "width": 16, - "height": 6, + "keyboard_name": "Octagon V2", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, "layouts": { "LAYOUT": { "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] + }, + + "LAYOUT_75_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1, "w":2}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":13.5, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3, "w":2.25}, {"x":15, "y":3}, {"x":0, "y":4, "w":2.25}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":0, "y":5, "w":1.25}, {"x":1.25, "y":5, "w":1.25}, {"x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"x":10, "y":5}, {"x":11, "y":5}, {"x":12, "y":5}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}] } } } diff --git a/keyboards/duck/octagon/v2/matrix.c b/keyboards/duck/octagon/v2/matrix.c index a63a37640ff..25d1e45b051 100644 --- a/keyboards/duck/octagon/v2/matrix.c +++ b/keyboards/duck/octagon/v2/matrix.c @@ -22,7 +22,7 @@ along with this program. If not, see . #include "print.h" #include "debug.h" -static uint8_t debouncing = DEBOUNCING_DELAY; +static uint8_t debouncing = DEBOUNCE; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -89,7 +89,10 @@ uint8_t matrix_scan(void) { bool curr_bit = rows & (1<. */ -#ifndef V2_H -#define V2_H +#pragma once #include "quantum.h" @@ -49,4 +48,3 @@ { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ } -#endif diff --git a/keyboards/dumbpad/config.h b/keyboards/dumbpad/config.h new file mode 100644 index 00000000000..a7d4e7b3c8c --- /dev/null +++ b/keyboards/dumbpad/config.h @@ -0,0 +1,259 @@ +/* +Copyright 2019 imchipwood + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xDEAF +#define PRODUCT_ID 0x0913 +#define DEVICE_VER 0x0001 +#define MANUFACTURER imchipwood +#define PRODUCT dumbpad +#define DESCRIPTION 4x4 macro/numpad with rotary encoder + + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 5 +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* Rotary encoder */ +#define ENCODERS_PAD_A { D0 } +#define ENCODERS_PAD_B { D4 } + +/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */ +#define BOOTMAGIC_LITE_ROW 3 +#define BOOTMAGIC_LITE_COLUMN 0 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/dumbpad/dumbpad.c b/keyboards/dumbpad/dumbpad.c new file mode 100644 index 00000000000..b53856237c0 --- /dev/null +++ b/keyboards/dumbpad/dumbpad.c @@ -0,0 +1,51 @@ +/* Copyright 2019 Chip + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "dumbpad.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/dumbpad/dumbpad.h b/keyboards/dumbpad/dumbpad.h new file mode 100644 index 00000000000..b7c7694e30b --- /dev/null +++ b/keyboards/dumbpad/dumbpad.h @@ -0,0 +1,39 @@ +/* Copyright 2019 Chip + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k01, k02, k03, k04, \ + k11, k12, k13, k14, \ + k21, k22, k23, k24, \ + k30, k31, k32, k33, k34 \ +) \ +{ \ + { KC_NO, k01, k02, k03, k04 }, \ + { KC_NO, k11, k12, k13, k14 }, \ + { KC_NO, k21, k22, k23, k24 }, \ + { k30, k31, k32, k33, k34 }, \ +} diff --git a/keyboards/dumbpad/info.json b/keyboards/dumbpad/info.json new file mode 100644 index 00000000000..8b6a8116e3c --- /dev/null +++ b/keyboards/dumbpad/info.json @@ -0,0 +1,30 @@ +{ + "keyboard_name": "dumbpad", + "url": "", + "maintainer": "qmk", + "width": 5, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"7", "x":1, "y":0}, + {"label":"8", "x":2, "y":0}, + {"label":"9", "x":3, "y":0}, + {"label":"BSPC", "x":4, "y":0}, + {"label":"4", "x":1, "y":1}, + {"label":"5", "x":2, "y":1}, + {"label":"6", "x":3, "y":1}, + {"label":"ESC", "x":4, "y":1}, + {"label":"1", "x":1, "y":2}, + {"label":"2", "x":2, "y":2}, + {"label":"3", "x":3, "y":2}, + {"label":"TAB", "x":4, "y":2}, + {"label":"LMOUSE", "x":0, "y":3}, + {"label":"TT(2)", "x":1, "y":3}, + {"label":"0", "x":2, "y":3}, + {"label":".", "x":3, "y":3}, + {"label":"ENT", "x":4, "y":3} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/dumbpad/keymaps/default/keymap.c b/keyboards/dumbpad/keymaps/default/keymap.c new file mode 100644 index 00000000000..061215a61bc --- /dev/null +++ b/keyboards/dumbpad/keymaps/default/keymap.c @@ -0,0 +1,106 @@ +/* Copyright 2019 imchipwood + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _BASE 0 +#define _SUB 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + BASE LAYER + /-----------------------------------------------------` + | | 7 | 8 | 9 | Bkspc | + | |---------|---------|---------|---------| + | | 4 | 5 | 6 | Esc | + | |---------|---------|---------|---------| + | | 1 | 2 | 3 | Tab | + |-------------|---------|---------|---------|---------| + | Left mouse | MO(SUB) | 0 | . | Enter | + \-----------------------------------------------------' + */ + [_BASE] = LAYOUT( /* Base */ + KC_7, KC_8, KC_9, KC_BSPC, + KC_4, KC_5, KC_6, KC_ESC, + KC_1, KC_2, KC_3, KC_TAB, + KC_BTN1, MO(_SUB), KC_0, KC_DOT, KC_ENTER + ), + /* + SUB LAYER + /-----------------------------------------------------` + | | | | | Reset | + | |---------|---------|---------|---------| + | | | | | + | + | |---------|---------|---------|---------| + | | | | | - | + |-------------|---------|---------|---------|---------| + | LOCK | | | | = | + \-----------------------------------------------------' + */ + [_SUB] = LAYOUT( + _______, _______, _______, RESET, + _______, _______, _______, KC_KP_PLUS, + _______, _______, _______, KC_KP_MINUS, + KC_LOCK, _______, _______, _______, KC_EQL + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // If console is enabled, it will print the matrix position and status of each key pressed +/* +#ifdef CONSOLE_ENABLE + uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); +#endif +*/ + return true; +} + +void keyboard_post_init_user(void) { + // Customise these values to desired behaviour + //debug_enable = true; + //debug_matrix = true; + //debug_keyboard = true; + //debug_mouse = true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (layer_state && 0x1) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else { + if (clockwise) { + tap_code(KC_MS_R); + } else { + tap_code(KC_MS_L); + } + } + } +} diff --git a/keyboards/dumbpad/readme.md b/keyboards/dumbpad/readme.md new file mode 100644 index 00000000000..8f3789bcb31 --- /dev/null +++ b/keyboards/dumbpad/readme.md @@ -0,0 +1,19 @@ +# dumbpad + +![dumbpad](https://i.imgur.com/sS3fq1Z.jpg) + +A 4x4 macro/numpad with rotary encoder. + +Keyboard Maintainer: [imchipwood](https://github.com/imchipwood) + +PCB repository: https://github.com/imchipwood/dumbpad + +Make example for this keyboard (after setting up your build environment): + + make dumbpad:default + +Program with: + + make dumbpad:default:avrdude + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/dumbpad/rules.mk b/keyboards/dumbpad/rules.mk new file mode 100644 index 00000000000..5d585c65be6 --- /dev/null +++ b/keyboards/dumbpad/rules.mk @@ -0,0 +1,84 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +ENCODER_ENABLE = yes +MOUSEKEY_ENABLE = yes +KEY_LOCK_ENABLE = yes diff --git a/keyboards/dz60/config.h b/keyboards/dz60/config.h index e58eae0858a..8d66c358472 100644 --- a/keyboards/dz60/config.h +++ b/keyboards/dz60/config.h @@ -28,7 +28,7 @@ #define BACKLIGHT_LEVELS 5 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -36,11 +36,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 16 diff --git a/keyboards/dz60/dz60.c b/keyboards/dz60/dz60.c index b54ff011703..8295fb432c7 100644 --- a/keyboards/dz60/dz60.c +++ b/keyboards/dz60/dz60.c @@ -23,11 +23,9 @@ void led_init_ports(void) { void led_set_kb(uint8_t usb_led) { if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); } else { - DDRB &= ~(1 << 2); - PORTB &= ~(1 << 2); + PORTB |= (1 << 2); } led_set_user(usb_led); diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index 2cf2eec7a08..de18faf6265 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -88,6 +88,33 @@ { KC_NO, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d, KC_NO } \ } +/* LAYOUT_60_ansi_split_bs_rshift + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │40 │41 │43 │46 │4a │4b │4d │4e │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ +*/ +#define LAYOUT_60_ansi_split_bs_rshift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k46, k4a, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ +} + // 带方向配列 /* Directional arrangement | LAYOUT_directional * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ @@ -170,6 +197,60 @@ { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ } +/* LAYOUT_60_ansi_split + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4d │4e │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ +*/ +#define LAYOUT_60_ansi_split( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ +} + +/* LAYOUT_60_ansi_split_space_rshift + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├────┬───┴┬──┴─┬─┴───┴───┴┬──┴─┬─┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4d │4e │ + * └────┴────┴────┴──────────┴────┴────────┴────┴────┴────┴────┘ +*/ +#define LAYOUT_60_ansi_split_space_rshift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ +} + /* LAYOUT_60_iso * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │ @@ -305,5 +386,139 @@ { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } +/* LAYOUT_60_tsangan + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │ 0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │40 │41 │43 │46 (7u) │4b │4d │4e │ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ +*/ +#define LAYOUT_60_tsangan( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k46, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d, k4e } \ +} + +/* LAYOUT_60_tsangan_hhkb + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │40 │41 │43 │46 (7u) │4b │4d │4e │ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ +*/ +#define LAYOUT_60_tsangan_hhkb( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k46, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d, k4e } \ +} + +/* LAYOUT_60_calbatr0ss + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4d │4e │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +#define LAYOUT_60_calbatr0ss( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ +} + +/* LAYOUT_60_iso_split_space_bs_rshift + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐2d │ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │1e │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ + * │30 |31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├────┼───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4d │4e │ + * └────┴────┴────┴────────┴────┴──────────┴────┴────┴────┴────┘ +*/ +#define LAYOUT_60_iso_split_space_bs_rshift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1e, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO,k3d, k3e }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, KC_NO,k4d, k4e } \ +} + +/* LAYOUT_60_2_function + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┴┬──┴──┬───┼───┤ + * │40 │41 │43 │46 │4a │4c │4d │4e │ + * └────┴────┴────┴────────────────────────┴─────┴─────┴───┴───┘ +*/ +#define LAYOUT_60_2_function( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k46, k4a, k4c, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, KC_NO, k4c, k4d, k4e } \ +} #endif diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index a163cc6a467..06ce3627206 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -25,6 +25,14 @@ "key_count": 61, "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, + "LAYOUT_60_ansi_split": { + "key_count": 63, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6.00, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_ansi_split_space_rshift": { + "key_count": 64, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"FN", "x":14, "y": 3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, "LAYOUT_60_iso": { "key_count": 62, "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] @@ -48,6 +56,26 @@ "LAYOUT_60_b_iso": { "key_count": 67, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"x":13, "y":0}, {"label":"Back Space", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"#", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"\\", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"Shift", "x":11.25, "y":3, "w":1.75}, {"label":"Up", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"Space", "x":3.75, "y":4, "w":2.25}, {"label":"Space", "x":6, "y":4, "w":1.25}, {"label":"Space", "x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Left", "x":12, "y":4}, {"label":"Down", "x":13, "y":4}, {"label":"Right", "x":14, "y":4}] - } + }, + "LAYOUT_60_tsangan": { + "keycount": 61, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + "LAYOUT_60_tsangan_hhkb": { + "key_count": 62, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Win", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + "LAYOUT_60_calbatr0ss": { + "key_count": 65, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Ctrl", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Caps Lock", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"Shift", "x":3.75, "y":4, "w":2.25}, {"label":"Fn", "x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_iso_split_space_bs_rshift": { + "key_count": 66, + "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Del", "x":13, "y":0, "w":1}, {"label":"Backspace", "x":14, "y":0, "w":1}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Print screen", "x":14, "y":3, "w":1}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6.00, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_2_function": { + "key_count": 63, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.5}, {"label":"Control", "x":11.5, "y":4, "w":1.5}, {"label":"GUI", "x":13, "y":4}, {"label":"Fn2", "x":14, "y":4}] + } } } diff --git a/keyboards/dz60/keymaps/60_tsangan/keymap.c b/keyboards/dz60/keymaps/60_tsangan/keymap.c new file mode 100644 index 00000000000..dfbc51dd999 --- /dev/null +++ b/keyboards/dz60/keymaps/60_tsangan/keymap.c @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL, // Function Layer + _CL // Control Layer +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_tsangan( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FL), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + [_FL] = LAYOUT_60_tsangan( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, _______, _______, + _______, _______, _______, _______, _______, MO(_CL), _______ + ), + [_CL] = LAYOUT_60_tsangan( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/dz60/keymaps/LEdiodes/config.h b/keyboards/dz60/keymaps/LEdiodes/config.h index 4f991b9ca2c..196d05c5336 100644 --- a/keyboards/dz60/keymaps/LEdiodes/config.h +++ b/keyboards/dz60/keymaps/LEdiodes/config.h @@ -28,7 +28,7 @@ #define BACKLIGHT_LEVELS 5 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -36,11 +36,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 16 diff --git a/keyboards/dz60/keymaps/LEdiodes/keymap.c b/keyboards/dz60/keymaps/LEdiodes/keymap.c index 8149b255bc6..c6a9214a013 100644 --- a/keyboards/dz60/keymaps/LEdiodes/keymap.c +++ b/keyboards/dz60/keymaps/LEdiodes/keymap.c @@ -6,8 +6,6 @@ #define _L3 3 #define _L4 4 -#define _______ KC_TRNS - enum { TD_SPC_ENT = 0, TD_KC_LSFT_CAPS, diff --git a/keyboards/dz60/keymaps/atlacat/keymap.c b/keyboards/dz60/keymaps/atlacat/keymap.c index 72d6b04a4de..606698b7551 100644 --- a/keyboards/dz60/keymaps/atlacat/keymap.c +++ b/keyboards/dz60/keymaps/atlacat/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define RGB_STA RGB_M_P //rgb static #define RGB_BRE RGB_M_B //rgb breathe #define RGB_RAI RGB_M_R //rgb rainbow diff --git a/keyboards/dz60/keymaps/billiams/build_flash.sh b/keyboards/dz60/keymaps/billiams/build_flash.sh new file mode 100644 index 00000000000..e7a81114415 --- /dev/null +++ b/keyboards/dz60/keymaps/billiams/build_flash.sh @@ -0,0 +1,9 @@ +# dfu-programmer atmega32u4 erase --force +# dfu-programmer atmega32u4 flash /path/to/firmware.hex +# dfu-programmer atmega32u4 reset + +# run this in the qmk_firmware directory +make dz60:billiams +dfu-programmer atmega32u4 erase --force && \ +dfu-programmer atmega32u4 flash dz60_billiams.hex && \ +dfu-programmer atmega32u4 reset \ No newline at end of file diff --git a/keyboards/dz60/keymaps/billiams/config.h b/keyboards/dz60/keymaps/billiams/config.h new file mode 100644 index 00000000000..9560d51a6f9 --- /dev/null +++ b/keyboards/dz60/keymaps/billiams/config.h @@ -0,0 +1 @@ +#define GRAVE_ESC_GUI_OVERRIDE # Always send Escape if GUI is pressed diff --git a/keyboards/dz60/keymaps/billiams/keymap.c b/keyboards/dz60/keymaps/billiams/keymap.c new file mode 100644 index 00000000000..b59040d7720 --- /dev/null +++ b/keyboards/dz60/keymaps/billiams/keymap.c @@ -0,0 +1,48 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . |Tap(/) Shft| U | ESC | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Alt | Cmd | Space | Alt | Fn | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, _______, RSFT_T(KC_SLSH) , KC_UP, KC_ESCAPE, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + /* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | + * |-----------------------------------------------------------------------------------------+ + * | |RBB T|RGB M| Hue-| Hue+| Sat-| Sat+| Val-| Val+| Mute | Vol-| Vol+| Prev | Next | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | Left| Down| Up |Right| | | Play/Pause | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | |Scr- |Scr+ | |PG_UP|RESET| + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | HOME|PG_DN| END | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, + _______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, KC_MUTE, KC__VOLDOWN, KC__VOLUP, KC_MRWD, KC_MFFD, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRID, KC_BRIU, _______, _______, KC_PGUP, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END + ), +}; diff --git a/keyboards/dz60/keymaps/billiams/readme.md b/keyboards/dz60/keymaps/billiams/readme.md new file mode 100644 index 00000000000..0f917bf4153 --- /dev/null +++ b/keyboards/dz60/keymaps/billiams/readme.md @@ -0,0 +1,72 @@ +## Billiam's DZ60 layout + +This layout is optimized for MacOS and is for a Build 4 DZ60 with a 2U left shift, 2U right shift and an arrow +cluster in the bottom right. Don't use this layout if you didn't get Build 4, you will enter a world of pain Donny. + +Settings: + +* The `CAPS LOCK` key is replaced with a second function key. +* The `ALT` and `CMD` keys are swapped to replicate the Mac layout. +* Del is available as `Fn` + `Backspace` +* `/ ?` are available when you tap the right shift. Otherwise RShift is shift when held down +* RESET is available as `Fn`+ ` ESC` +* Underglow toggle is available as `Fn` + `Q`. Yes your keyboard has lights even if you didn't get the LEDs. Bonus! +* vim-style arrow key bindings H J K L in layer 1 +* The `Bkspc` and `\` keys have been swapped, the reach was too great to have backspace on the top row + +### Initial Installation + +I found the instructions to be longer than they had to be, and I ended up having to Google some steps anyway. These are the steps I took to get my keyboard setup, in case you are new to the process. + +1. Clone the qmk_firmware repo locally +``` +# Choose one: +git clone git@github.com:qmk/qmk_firmware.git # OR +git clone https://github.com/qmk/qmk_firmware.git +``` +2. Customize your layout by starting with a [keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/dz60/keymaps). I copied [StephenGrier](https://github.com/qmk/qmk_firmware/tree/master/keyboards/dz60/keymaps/stephengrier)'s and modified it for DZ60 Build 4 and changed a few things, like the `grave` key, `ESC` and `/`. + +3. Build your hex file +``` +make dz60:billiams # be in the qmk_firmware directory to do this +``` +A hex file `dz60_billiams.hex` will be created in the base qmk_firmware directory + +4. Before plugging in your keyboard into your computer, hold `SPACE` and `B` keys down +5. Holding those keys down, plug the keyboard into your computer, which will put the keyboard in bootlegger mode +6. If you are using [QMK toolbox](https://github.com/qmk/qmk_toolbox/releases), upload the .hex file you made above, select it and hit the flash button. For the love of all that is good and holy on Earth, don't hit the load button, that will load the default keymap and that's not what you want! Unless it is, in which case click away. + +Note: If you didn't follow my instructions in 4 and accidentally loaded the default keymap, then to `RESET` the keyboard and kick it into bootleg mode again, hold the `down arrow` key and `\`. The default layout is Build 1 and sets the `MENU` key on that build to `Fn`. `MENU` corresponds to `down arrow` in build 4. Note that you don't have to unplug the keyboard. + +Hope this helps! + +### 0 Qwerty +``` +,-----------------------------------------------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | +|-----------------------------------------------------------------------------------------+ +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bkspc | +|-----------------------------------------------------------------------------------------+ +| Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +|-----------------------------------------------------------------------------------------+ +| Shift | Z | X | C | V | B | N | M | , | . | Tap:/ RSh | U | ESC | +|-----------------------------------------------------------------------------------------+ +| Ctrl | Alt | Cmd | Space | Alt | Fn | L | D | R | +`-----------------------------------------------------------------------------------------' +``` + +### 1 Fn Layer +``` +FN Layer +,-----------------------------------------------------------------------------------------. +| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | +|-----------------------------------------------------------------------------------------+ +| |RBB T|RGB M| Hue-| Hue+| Sat-| Sat+| Val-| Val+| Mute | Vol-| Vol+| Prev | Next | +|-----------------------------------------------------------------------------------------+ +| | | | | | | Left| Down| Up |Right| | | Play/Pause | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | |Scr- |Scr+ | | PG_UP |RESET| +|-----------------------------------------------------------------------------------------+ +| | | | | | | HOME | PG_DN | END | +`-----------------------------------------------------------------------------------------' +``` diff --git a/keyboards/dz60/keymaps/billypython/config.h b/keyboards/dz60/keymaps/billypython/config.h new file mode 100644 index 00000000000..4b511eb8484 --- /dev/null +++ b/keyboards/dz60/keymaps/billypython/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define LAYER_FN diff --git a/keyboards/dz60/keymaps/billypython/keymap.c b/keyboards/dz60/keymaps/billypython/keymap.c new file mode 100644 index 00000000000..78fc55f6f95 --- /dev/null +++ b/keyboards/dz60/keymaps/billypython/keymap.c @@ -0,0 +1,46 @@ +#include QMK_KEYBOARD_H +#include "billypython.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┬───┤ + * │LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RSC│ ↑ │Del│ + * ├────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤ + * │LCtl│LGui│LAlt│ Space │RAl│FnL│ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ + [L_BASE] = LAYOUT_directional( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSF_RCT, KC_UP, KC_DEL, \ + KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, KC_SPC, XXXXXXX, KC_RALT, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │PSc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │PgU│ ↑ │PgD│Ply│Prv│Nxt│Clear│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │M← │M↓ │M→ │MW↑│ │Hom│ ← │ ↓ │ → │End│ │ │ + * ├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┬───┤ + * │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│App│PgU│Ins│ + * ├────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤ + * │ │ │ │ MW↓ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ + [L_FN] = LAYOUT_directional( \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, \ + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, KC_PGUP, KC_UP, KC_PGDN, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, \ + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, _______, \ + _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, KC_INS, \ + _______, _______, _______, XXXXXXX, KC_WH_D, XXXXXXX, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), +}; diff --git a/keyboards/dz60/keymaps/billypython/rules.mk b/keyboards/dz60/keymaps/billypython/rules.mk new file mode 100644 index 00000000000..3326136043f --- /dev/null +++ b/keyboards/dz60/keymaps/billypython/rules.mk @@ -0,0 +1,8 @@ +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +RGBLIGHT_ENABLE = no +TAP_DANCE_ENABLE = yes diff --git a/keyboards/dz60/keymaps/bingocaller/config.h b/keyboards/dz60/keymaps/bingocaller/config.h new file mode 100644 index 00000000000..b04b47a30bc --- /dev/null +++ b/keyboards/dz60/keymaps/bingocaller/config.h @@ -0,0 +1,3 @@ +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_TIME_TO_MAX 15 diff --git a/keyboards/dz60/keymaps/bingocaller/keymap.c b/keyboards/dz60/keymaps/bingocaller/keymap.c new file mode 100644 index 00000000000..6b331749782 --- /dev/null +++ b/keyboards/dz60/keymaps/bingocaller/keymap.c @@ -0,0 +1,93 @@ +#include QMK_KEYBOARD_H + +#define WORD_BACK A(KC_LEFT) +#define WORD_FORWARD A(KC_RIGHT) +#define DELETE_WORD_BACK A(KC_BSPACE) +#define DELETE_WORD_FORWARD A(KC_DELETE) +#define FINE_VOLUP S(A(KC__VOLUP)) +#define FINE_VOLDOWN S(A(KC__VOLDOWN)) + +enum layers { + _BASE, + _ARROWS, + _HDUE, // Home, PgDown, PgUp, End + _MOUSE, + _FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Default layer: + * Space Cadet shifts (parentheses on tap) + * Caps Lock is Control on hold, Esc on tap + * Hyper/Caps Lock on Control + * Hold D to activate layer 1 + * Hold Space to activate layer 3 (Mouse keys) + * Hold FN to activate layer 4 + */ + [_BASE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + LCTL_T(KC_ESC), KC_A, KC_S, LT(_ARROWS, KC_D), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_NO, + ALL_T(KC_CAPS), KC_LALT, KC_LGUI, KC_NO, LT(_MOUSE, KC_SPC), KC_NO, KC_RGUI, KC_RALT, KC_NO, MO(_FN), ALL_T(KC_CAPS)), + + /* Layer 1: + * Vim arrows (HJKL) + * Vim-like move across words with W(ord), and B(eginning) + * Media controls (fine volume controls using Option+Shift) + * Backspace/Del on N/M + * Hold F to activate layer 2 + */ + [_ARROWS] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, WORD_FORWARD, _______, _______, _______, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC__MUTE, FINE_VOLDOWN, FINE_VOLUP, _______, + _______, _______, _______, _______, LT(_HDUE, _______), _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, + _______, _______, _______, _______, _______, _______, WORD_BACK, KC_BSPC, KC_DEL, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + /* Layer 2: + * Home, End, Page Up, Page Down + * Delete word forward/back on W/B + */ + [_HDUE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, DELETE_WORD_FORWARD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_PGUP, KC_END, _______, _______, _______, + _______, _______, _______, _______, _______, _______, DELETE_WORD_BACK, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + /* Layer 3: + * Mouse keys + * Cursor movement: HJKL + * MB 1, 2, and 3 on F, D, and S, respectively + * Mouse wheel: up (V), down (R) (reversed because of Natural Scrolling) + */ + [_MOUSE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_WH_D, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, _______, + _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + /* Layer 4: + * F1-12 + * Del on backspace + * RGB (underglow) controls + * RESET firmware on backslash + * Screen brightness: Z (decrease), X (increase) + */ + [_FN] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_BRMD, KC_BRMU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + // TEMPLATE + // LAYOUT( + // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; diff --git a/keyboards/dz60/keymaps/bingocaller/readme.md b/keyboards/dz60/keymaps/bingocaller/readme.md new file mode 100644 index 00000000000..d32dc626749 --- /dev/null +++ b/keyboards/dz60/keymaps/bingocaller/readme.md @@ -0,0 +1,114 @@ +# MacOS standard 60% keymap with Vim-like arrows + +This is a MacOS-specific keymap for DZ60 configured in a standard 60% ANSI layout, with a stepped Caps Lock: + +[![](https://i.imgur.com/lFP2O41.png)](http://www.keyboard-layout-editor.com/#/gists/4b156fdf2c1426bffc82fadd2b1c5634) + +**[Fully assembled 60% keyboard from KBDfans](https://kbdfans.cn/collections/fully-assembled-keyboard/products/fully-assembled-plastic-case-mechanical-keyboard)** + +## Base Layer + +``` +,-----------------------------------------------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +|-----------------------------------------------------------------------------------------+ +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +|-----------------------------------------------------------------------------------------+ +| Ctrl/Esc | A | S | D/L1 | F | G | H | J | K | L | ; | ' | Enter | +|-----------------------------------------------------------------------------------------+ +| Shift/( | Z | X | C | V | B | N | M | , | . | / | Shift/) | +|-----------------------------------------------------------------------------------------+ +| Hyper | Alt | Cmd | Space/L3 | Cmd | Alt | L4 | Hyper | +`-----------------------------------------------------------------------------------------' +``` + +* Space Cadet shifts (parentheses on tap) +* Caps Lock is Control on hold, Esc on tap +* Hyper/Caps Lock on Control +* Hold D to activate layer 1 +* Hold Space to activate layer 3 (Mouse keys) +* Hold FN to activate layer 4 + +## `L1` + +``` +,-----------------------------------------------------------------------------------------. +| | | | | | | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | W→ | | | | | ⏮ | ⏯ | ⏭ | 🔇 | 🔉 | 🔊 | | +|-----------------------------------------------------------------------------------------+ +| | | | | L2 | | ← | ↓ | ↑ | → | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | W← | ⌫ | ⌦ | | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | +`-----------------------------------------------------------------------------------------' +``` + +* Vim arrows (HJKL) +* Vim-like move across words with W(ord), and B(eginning) +* Media controls (fine volume controls using Option+Shift) +* Backspace/Del on N/M +* Hold F to activate layer 2 + +## `L2` + +``` +,-----------------------------------------------------------------------------------------. +| | | | | | | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | W⌦ | | | | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | ↖ | ⇞ | ⇟ | ↘︎ | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | W⌫ | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | +`-----------------------------------------------------------------------------------------' +``` + +* Home, End, Page Up, Page Down +* Delete word forward/back on W/B + +## `L3` + +``` +,-----------------------------------------------------------------------------------------. +| | | | | | | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | MWU | | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | M3 | M2 | M1 | | M← | M↓ | M↑ | M→ | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | MWD | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | +`-----------------------------------------------------------------------------------------' +``` + +* Mouse keys + * Cursor movement: HJKL + * MB 1, 2, and 3 on F, D, and S, respectively + * Mouse wheel: up (V), down (R) (reversed because of Natural Scrolling) + +## `L4` + +``` +,-----------------------------------------------------------------------------------------. +| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | ⌦ | +|-----------------------------------------------------------------------------------------+ +| |RGB_T|RGB_M|RGB_H+|RGB_H-|RGB_S+|RGB_S-|RGB_V+|RGB_V-| | | | | RESET | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | 🔅 | 🔆 | | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | +`-----------------------------------------------------------------------------------------' +``` + +* F1-12 +* Del on backspace +* RGB (underglow) controls +* RESET firmware on backspace +* Screen brightness: Z (decrease), X (increase) diff --git a/keyboards/dz60/keymaps/calbatr0ss/keymap.c b/keyboards/dz60/keymaps/calbatr0ss/keymap.c new file mode 100644 index 00000000000..2852b4a2073 --- /dev/null +++ b/keyboards/dz60/keymaps/calbatr0ss/keymap.c @@ -0,0 +1,84 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* LAYER 0 + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ESC│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ BKSP│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ CTRL │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ ENTER │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ SHIFT │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ SHIFT│LYR│ + * ├────┬───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │CAPS│ OS │ ALT│ SPACE │ FN │ SPACE │ ALT│ OS │MENU│CTRL│ + * └────┴────┴────┴────────┴────┴──────────┴────┴────┴────┴────┘ + */ + LAYOUT_60_calbatr0ss( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(3), + KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, MO(2), KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL), + +/* LAYER 1 + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ESC│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ BKSP│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ CTRL │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ ENTER │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ SHIFT │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ SHIFT│LYR│ + * ├────┬───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │CAPS│ ALT│ OS │ SPACE │ FN │ SPACE │ OS │ ALT│MENU│CTRL│ + * └────┴────┴────┴────────┴────┴──────────┴────┴────┴────┴────┘ + */ + LAYOUT_60_calbatr0ss( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(3), + KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, MO(2), KC_SPC, KC_RGUI, KC_RALT, KC_APP, KC_RCTL), + +/* LAYER 2 + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │ │ │ │ │ │ │PDN│ UP│PUP│ │ │ │ DEL │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │HOM│LFT│DWN│RHT│END│ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ │ │ │ │ │VDN│VUP│MUT│PRV│NXT│PLY│ │ │ + * ├────┬───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │RSET│ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────┴────┴──────────┴────┴────┴────┴────┘ + */ + LAYOUT_60_calbatr0ss( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_UP, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPRV, KC_MNXT, KC_MPLY, KC_TRNS, KC_TRNS, + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +/* LAYER 3 + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │WIN│MAC│ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────┴────┴──────────┴────┴────┴────┴────┘ + */ + LAYOUT_60_calbatr0ss( + KC_TRNS, DF(0), DF(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; diff --git a/keyboards/dz60/keymaps/crd/keymap.c b/keyboards/dz60/keymaps/crd/keymap.c deleted file mode 100644 index 148b03b995b..00000000000 --- a/keyboards/dz60/keymaps/crd/keymap.c +++ /dev/null @@ -1,70 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------------. - * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | - * |-----------------------------------------------------------------------------------------+ - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | - * |-----------------------------------------------------------------------------------------+ - * | Ctrl/Esc| A | S | D | F | G | H | J | K | L | ; | ' | Enter | - * |-----------------------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | DEL | - * |-----------------------------------------------------------------------------------------+ - * | FN1 | Alt | Cmd | Space | Cmd | FN2 | L | D | R | - * `-----------------------------------------------------------------------------------------' - */ - - LAYOUT_directional( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL, - MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(2), KC_LEFT, KC_DOWN, KC_RIGHT - ), - - /* FN1 Layer - * ,-----------------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | L | D | U | R | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | |PgUp | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | |Home |PgDn | End | - * `-----------------------------------------------------------------------------------------' - */ - - LAYOUT_directional( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END - ), - - /* FN2 Layer (Media) - * ,-----------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | RESET | - * |-----------------------------------------------------------------------------------------+ - * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | |Pl/Ps|Vol+ |Mute | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | |Prev |Vol- |Next | - * `-----------------------------------------------------------------------------------------' - */ - - LAYOUT_directional( - KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_MUTE, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT - ), -}; diff --git a/keyboards/dz60/keymaps/crd_2u_lshift/keymap.c b/keyboards/dz60/keymaps/crd_2u_lshift/keymap.c new file mode 100644 index 00000000000..4d2ca279c25 --- /dev/null +++ b/keyboards/dz60/keymaps/crd_2u_lshift/keymap.c @@ -0,0 +1,70 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl/Esc| A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / |Home | U | End | + * |-----------------------------------------------------------------------------------------+ + * | FN1 | Alt | Cmd | Space | Cmd | FN2 | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_HOME, KC_UP, KC_END, + MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(2), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + /* FN1 Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | Home | PgUp | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | L | D | U | R | End | PgDn| | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | |PgUp | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | |Home |PgDn | End | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_PGDOWN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END + ), + + /* FN2 Layer (Media) + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | RESET | + * |-----------------------------------------------------------------------------------------+ + * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| |Mute | Vol- | Vol+ | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | |Bri- |Bri+ | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | |Pl/Ps|Vol+ |Mute | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | |Prev |Vol- |Next | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, + _______, _______, _______, DEBUG, _______, _______, _______, _______, _______, _______, KC_SCROLLLOCK, KC_PAUSE, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT + ), +}; diff --git a/keyboards/dz60/keymaps/crd_ansi/keymap.c b/keyboards/dz60/keymaps/crd_ansi/keymap.c new file mode 100644 index 00000000000..5d7b24d1873 --- /dev/null +++ b/keyboards/dz60/keymaps/crd_ansi/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL // Function Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_FNLT LT(_FL, KC_LEFT) +#define KC_RADN RALT_T(KC_DOWN) +#define KC_RCRT RCTL_T(KC_RIGHT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_ansi( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_FNLT, KC_RADN, KC_RCRT + ), + [_FL] = LAYOUT_60_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, RESET, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/dz60/keymaps/crd_tsangan/keymap.c b/keyboards/dz60/keymaps/crd_tsangan/keymap.c new file mode 100644 index 00000000000..320de07a173 --- /dev/null +++ b/keyboards/dz60/keymaps/crd_tsangan/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL // Function Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_RGLT RGUI_T(KC_LEFT) +#define KC_RADN RALT_T(KC_DOWN) +#define KC_RCRT RCTL_T(KC_RIGHT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_tsangan_hhkb( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_ESC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, MO(_FL), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGLT, KC_RADN, KC_RCRT + ), + [_FL] = LAYOUT_60_tsangan_hhkb( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RESET, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/dz60/keymaps/drewsky/Readme.md b/keyboards/dz60/keymaps/drewsky/Readme.md new file mode 100755 index 00000000000..115d9cf83b8 --- /dev/null +++ b/keyboards/dz60/keymaps/drewsky/Readme.md @@ -0,0 +1,11 @@ +# **DREWSKY'S DZ60 ANSI Layout** +![Imgur](https://i.imgur.com/v4zVbl7.jpg) + + +Layer 1 is default configuration, for the exception of the Space cadet shifts. Layer 2 is for WASD arrows and Media, which I have included both PREV and NEXT for Windows and macOS. Layer 3 is for RGB underglow. Legends in picture follow Layers. Modifier one is momentary, and the RGB layer is TT (TAP_TOGGLE) + +Make example for this keyboard (after setting up your build environment): + + make dz60:drewsky + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/dz60/keymaps/drewsky/keymap.c b/keyboards/dz60/keymaps/drewsky/keymap.c new file mode 100755 index 00000000000..aba0d238f03 --- /dev/null +++ b/keyboards/dz60/keymaps/drewsky/keymap.c @@ -0,0 +1,34 @@ +#include QMK_KEYBOARD_H + +// Helpful defines +#define _L0 0 +#define _L1 1 +#define _L2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_L0] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, TT(2), KC_RALT, MO(1), KC_RCTL), + + [_L1] = LAYOUT_60_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, + KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGDN, + KC_NO, KC_MRWD, KC_MFFD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_MSTP, KC_VOLD, KC_VOLU, KC_MPLY, KC__VOLDOWN, KC__VOLUP, KC_TRNS, KC_NO), + + [_L2] = LAYOUT_60_ansi( + KC_ESC, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, RGB_HUD, RGB_HUI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, RGB_SAD, RGB_SAI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, RGB_VAD, RGB_VAI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_SPD, RGB_SPI, KC_NO, + KC_NO, KC_NO, KC_NO, RGB_TOG, KC_TRNS, KC_NO, KC_NO, DEBUG) +}; + + + + diff --git a/keyboards/dz60/keymaps/edulpn/README.md b/keyboards/dz60/keymaps/edulpn/README.md new file mode 100644 index 00000000000..221be722b1b --- /dev/null +++ b/keyboards/dz60/keymaps/edulpn/README.md @@ -0,0 +1,10 @@ +# Edulpn Tsangan Keymap for the DZ60 PCB + +## Additional Notes +Tsangan 60% Keymap for DZ60 + Fn layer. + +### Layout +![Edulpn Tsangan Keymap for the DZ60](https://i.imgur.com/z7HHeH7.png) + +## Build +To build the default keymap, simply run `make dz60:edulpn`. diff --git a/keyboards/dz60/keymaps/edulpn/keymap.c b/keyboards/dz60/keymaps/edulpn/keymap.c new file mode 100644 index 00000000000..74d7ca4f21d --- /dev/null +++ b/keyboards/dz60/keymaps/edulpn/keymap.c @@ -0,0 +1,18 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_tsangan_hhkb( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + [1] = LAYOUT_60_tsangan_hhkb( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RESET, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_DEL, + KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_RIGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/dz60/keymaps/hailbreno/keymap.c b/keyboards/dz60/keymaps/hailbreno/keymap.c index edc22a5a245..130927e1267 100644 --- a/keyboards/dz60/keymaps/hailbreno/keymap.c +++ b/keyboards/dz60/keymaps/hailbreno/keymap.c @@ -8,7 +8,6 @@ #include QMK_KEYBOARD_H #define X KC_NO -#define _______ KC_TRNS extern keymap_config_t keymap_config; diff --git a/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c b/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c index 7c17a6f5f81..a54c06f5578 100644 --- a/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c +++ b/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c @@ -9,11 +9,6 @@ #include QMK_KEYBOARD_H - -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO - /* * Each layer gets a name for readability. * The underscores don't mean anything - you can diff --git a/keyboards/dz60/keymaps/iso_uk/keymap.c b/keyboards/dz60/keymaps/iso_uk/keymap.c index 13e6e185947..b725907ec85 100644 --- a/keyboards/dz60/keymaps/iso_uk/keymap.c +++ b/keyboards/dz60/keymaps/iso_uk/keymap.c @@ -10,12 +10,6 @@ #define _CONTROL 2 // Control layer #define _CN _CONTROL -// KEYCODES -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -#define MO_FN MO(1) -#define MO_FN MO(1) #define MO_FN MO(1) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/dz60/keymaps/jarred/keymap.c b/keyboards/dz60/keymaps/jarred/keymap.c index 9e685068317..2ef6794934d 100644 --- a/keyboards/dz60/keymaps/jarred/keymap.c +++ b/keyboards/dz60/keymaps/jarred/keymap.c @@ -13,9 +13,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT,KC_RGUI, XXXXXXX,KC_APP, KC_RCTL), [_NV] = LAYOUT( - KC_GRV ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,_______,_______, - _______,_______,_______,_______,KC_DEL ,KC_BSPC,_______,KC_HOME,KC_UP ,KC_END ,KC_INS ,_______,_______,_______, - _______,_______,_______,KC_LSFT,KC_LCTL,KC_ENT ,_______,KC_LEFT,KC_DOWN,KC_RGHT,KC_DEL ,KC_DEL , _______, - _______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,_______,_______,_______, - _______,_______,_______, _______,_______,_______, _______,_______,_______, RESET, _______) + KC_GRV ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,XXXXXXX,_______, + _______,RGB_TOG,RGB_MOD,_______,KC_DEL ,KC_BSPC,_______,KC_HOME,KC_UP ,KC_END ,KC_INS ,_______,_______,_______, + _______,RGB_HUI,RGB_HUD,KC_LSFT,KC_LCTL,KC_ENT ,_______,KC_LEFT,KC_DOWN,KC_RGHT,KC_DEL ,KC_DEL , _______, + _______,XXXXXXX,RGB_SAD,RGB_SAI,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,_______,_______,XXXXXXX, + _______,RGB_VAD,RGB_VAI, _______,_______,_______, _______,_______,XXXXXXX, RESET,_______) }; diff --git a/keyboards/dz60/keymaps/kifinnsson/keymap.c b/keyboards/dz60/keymaps/kifinnsson/keymap.c new file mode 100644 index 00000000000..7d88b6dbb46 --- /dev/null +++ b/keyboards/dz60/keymaps/kifinnsson/keymap.c @@ -0,0 +1,210 @@ +#include QMK_KEYBOARD_H + +bool is_lgui_active = false; +uint16_t lgui_timer = 0; + + +//Macro Declarations +enum my_keycodes { + KI_NO = SAFE_RANGE, + KI_1, + KI_2, + KI_3, + KI_4, + KI_5, + KI_6, + KI_7, + KI_8, + KI_9, + KI_10, + KI_11, + KI_12, + KI_ESC, + KI_BKSP, + KI_BSLS, + KI_WLFT, + KI_WRGT, + }; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_all( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, + MO(1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(2), KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, XXXXXXX, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), XXXXXXX, MO(3), KC_RCTL), + + LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, KC_TAB, KC_LSFT, KC_LCTL, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_CAPS, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,, + _______, _______, XXXXXXX, KC_ENT, KC_ENT, KC_ENT, _______, _______, _______, _______, RESET), + + LAYOUT_all( + KI_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KI_BKSP, + _______, KI_1, KI_2, KI_3, KI_4, KI_5, KI_6, KI_7, KI_8, KI_9, KI_10, KI_11, KI_12, KI_BSLS, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, KI_WLFT, KI_WRGT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX), + + LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // Keycodes Starting with KI_ are place holders for my personal macros. They are set below. Most are simple SEND_STRINGS(). + case KI_ESC: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_1: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_2: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_3: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_4: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_5: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_6: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_7: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_8: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_9: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_10: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_11: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_12: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_BKSP: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + case KI_BSLS: + if (record->event.pressed) { + SEND_STRING(""); + } else { + + } + return false; // Skip all further processing of this key + + //Windows Win+Left tap to move window without resetting KC_LGUI + //Additional code is in matrix_scan_user() + case KI_WLFT: + if (record->event.pressed) { + if (!is_lgui_active) { + is_lgui_active = true; + register_code(KC_LGUI); + } + lgui_timer = timer_read(); + tap_code(KC_LEFT); + } else { + + } + return false; // Skip all further processing of this key + //Windows Win+Right tap to move window without resetting KC_LGUI + //Additional code is in matrix_scan_user() + case KI_WRGT: + if (record->event.pressed) { + if (!is_lgui_active) { + is_lgui_active = true; + register_code(KC_LGUI); + } + lgui_timer = timer_read(); + tap_code(KC_RIGHT); + } else { + + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} + +//Check if KC_LGUI is active in KI_WLFT and KI_WRGT +void matrix_scan_user(void) { + if (is_lgui_active) { + if (timer_elapsed(lgui_timer) > 1000) { + unregister_code(KC_LGUI); + is_lgui_active = false; + } + } +} \ No newline at end of file diff --git a/keyboards/dz60/keymaps/kifinnsson/readme.md b/keyboards/dz60/keymaps/kifinnsson/readme.md new file mode 100644 index 00000000000..49f55950301 --- /dev/null +++ b/keyboards/dz60/keymaps/kifinnsson/readme.md @@ -0,0 +1,5 @@ +# kifinnsson's Colemak angle mod ansi-ish layout +----------------- + +Keymap for my non-standard DZ60 layout. It is an ansi layout on the right and iso on the left (ie 1.25x left shift). This is to implement the angle mod on for Colemak which is the base layer. A side effect of this is that I have an extra key on row 4, which sits between the "b" and "k" keys in Colemak. I use this key as a switch to layer 2 which is my macro layer. + diff --git a/keyboards/dz60/keymaps/kifinnsson/rules.mk b/keyboards/dz60/keymaps/kifinnsson/rules.mk new file mode 100644 index 00000000000..5fb201c88a2 --- /dev/null +++ b/keyboards/dz60/keymaps/kifinnsson/rules.mk @@ -0,0 +1,6 @@ +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) \ No newline at end of file diff --git a/keyboards/dz60/keymaps/kream/keymap.c b/keyboards/dz60/keymaps/kream/keymap.c new file mode 100644 index 00000000000..2c74de482c1 --- /dev/null +++ b/keyboards/dz60/keymaps/kream/keymap.c @@ -0,0 +1,17 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi_split_space_rshift( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_NO, KC_SPC, KC_CAPS, KC_NO, KC_NO, KC_ENT), + + [1] = LAYOUT_60_ansi_split_space_rshift( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_PSCR, KC_GRV, KC_TILD, _______, + _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, + _______, KC_SLCK, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; diff --git a/keyboards/dz60/keymaps/kream/rules.mk b/keyboards/dz60/keymaps/kream/rules.mk new file mode 100644 index 00000000000..6a82f21b358 --- /dev/null +++ b/keyboards/dz60/keymaps/kream/rules.mk @@ -0,0 +1,3 @@ +MOUSEKEY_ENABLE=no +BACKLIGHT_ENABLE=no +RGBLIGHT_ENABLE=no diff --git a/keyboards/dz60/keymaps/krusli/keymap.c b/keyboards/dz60/keymaps/krusli/keymap.c index 0ad6f1b2b54..59162675dda 100644 --- a/keyboards/dz60/keymaps/krusli/keymap.c +++ b/keyboards/dz60/keymaps/krusli/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( diff --git a/keyboards/dz60/keymaps/macos_64/config.h b/keyboards/dz60/keymaps/macos_64/config.h new file mode 100644 index 00000000000..235ae1b2db2 --- /dev/null +++ b/keyboards/dz60/keymaps/macos_64/config.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_KEYMAP_H +#define CONFIG_KEYMAP_H + +#include "../../config.h" + +// Fix KC_GESC conflict with Cmd+Alt+Esc on macos +#define GRAVE_ESC_GUI_OVERRIDE + +#endif \ No newline at end of file diff --git a/keyboards/dz60/keymaps/macos_64/keymap.c b/keyboards/dz60/keymaps/macos_64/keymap.c new file mode 100644 index 00000000000..fd19bfe14e7 --- /dev/null +++ b/keyboards/dz60/keymaps/macos_64/keymap.c @@ -0,0 +1,42 @@ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / |Shift| Up |Delete| + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Alt | Cmd | Space | Fn | Alt | Left| Down|Right| + * `-----------------------------------------------------------------------------------------' + */ + LAYOUT_all( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DELETE, + KC_LCTL, KC_LALT, KC_LGUI, KC_NO, KC_SPC, KC_NO, MO(1), KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT), + + /* ,-----------------------------------------------------------------------------------------. + * | ` ~ | BR- | BR+ | | | | |PREV |PLAY |NEXT |MUTE | V- | V+ | Delete | + * |-----------------------------------------------------------------------------------------+ + * | | | | Up | | | | | 0 | 1 | 2 | 3 | | RESET | + * |-----------------------------------------------------------------------------------------+ + * | | | Left| Down|Right| | | | | 4 | 5 | 6 | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | 7 | 8 | 9 | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + LAYOUT_all( + KC_GRV , KC_SCROLLLOCK, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_NO, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_1, KC_2, KC_3, KC_TRNS, RESET, + KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/dz60/keymaps/macos_64/readme.md b/keyboards/dz60/keymaps/macos_64/readme.md new file mode 100644 index 00000000000..c559c2b3836 --- /dev/null +++ b/keyboards/dz60/keymaps/macos_64/readme.md @@ -0,0 +1,45 @@ +# MacOS 64 keymap + +This is a keymap of DZ60 configured with 64 keys for MacOS. It refers the keymap of [macos_arrow](../macos_arrow/readme.md). + +## How to use + +1. Follow the [introduction](https://docs.qmk.fm/#/) to compile the keymap +2. Download QMK Toolbox from [here](https://github.com/qmk/qmk_toolbox/releases) +3. Insert the dz60 keyboard while pressing ```Space+b``` (default) +4. Flash the firmware + +More details about flashing firmware please check the [documentation](https://docs.qmk.fm/#/) of QMK. + +## Base Layer + +``` +,-----------------------------------------------------------------------------------------. +| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +|-----------------------------------------------------------------------------------------+ +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +|-----------------------------------------------------------------------------------------+ +| Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +|-----------------------------------------------------------------------------------------+ +| Shift | Z | X | C | V | B | N | M | , | . | / |Shift| Up |Delete| +|-----------------------------------------------------------------------------------------+ +| Ctrl | Alt | Cmd | Space | Fn | Alt | Left| Down|Right| +`-----------------------------------------------------------------------------------------' +``` + +## Fn Layer + +``` +,-----------------------------------------------------------------------------------------. +| ` ~ | BR- | BR+ | | | | |PREV |PLAY |NEXT |MUTE | V- | V+ | Delete | +|-----------------------------------------------------------------------------------------+ +| | | | Up | | | | | 0 | 1 | 2 | 3 | | RESET | +|-----------------------------------------------------------------------------------------+ +| | | Left| Down|Right| | | | | 4 | 5 | 6 | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | | 7 | 8 | 9 | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | | +`-----------------------------------------------------------------------------------------' + +``` diff --git a/keyboards/dz60/keymaps/macos_64/rules.mk b/keyboards/dz60/keymaps/macos_64/rules.mk new file mode 100644 index 00000000000..e1cfb3e508c --- /dev/null +++ b/keyboards/dz60/keymaps/macos_64/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/dz60/keymaps/macos_arrow/keymap.c b/keyboards/dz60/keymaps/macos_arrow/keymap.c index 81d61a59aec..0675a7954ab 100644 --- a/keyboards/dz60/keymaps/macos_arrow/keymap.c +++ b/keyboards/dz60/keymaps/macos_arrow/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------------------------+ * | Shift | Z | X | C | V | B | N | M | , | . | / | | Up |Shift| * |-----------------------------------------------------------------------------------------+ - * | Ctrl | Alt | Gui | Space / _NL |Gui/_ML| Alt | Left| Down|Right| + * | Ctrl | Alt | Gui | Space |Gui/_ML| Alt | Left| Down|Right| * `-----------------------------------------------------------------------------------------' */ [_BL] = LAYOUT_all( @@ -30,25 +30,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, LT(_FL, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_A, KC_UP, KC_RSFT, - KC_LCTL, KC_LALT, KC_LGUI, KC_NO, LT(_NL, KC_SPC), KC_NO, LM(_ML, MOD_RGUI), KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT), + KC_LCTL, KC_LALT, KC_LGUI, KC_NO, KC_SPC, KC_NO, LM(_ML, MOD_RGUI), KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT), /* ,-----------------------------------------------------------------------------------------. * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | |PgUp | | | | | | | + * | | | | PgUp| | | | | Up | | | | | | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | Left| Down| Up |Right| | | | + * | | |Home |PgDwn| End | | | Left| Down|Right| | | | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | |PgDwn| | | | | | | + * | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------+ * | | | | | | | | | | * `-----------------------------------------------------------------------------------------' */ [_FL] = LAYOUT_all( _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL, - _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, - _______, KC_NO, _______, _______, _______, _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_PGUP, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, + _______, _______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), /* ,-----------------------------------------------------------------------------------------. @@ -64,30 +64,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ [_ML] = LAYOUT_all( - KC_MEDIA_EJECT, BR_DOWN, BR_UP, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_NO, _______, + KC_MEDIA_EJECT, BR_DOWN, BR_UP, BL_TOGG, RGB_TOG, _______, _______, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - - /* ,-----------------------------------------------------------------------------------------. - * | | | | | | | | | % | ( | ) | < | > | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | * | 0 | 1 | 2 | 3 | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | . | - | 4 | 5 | 6 | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | , | = | 7 | 8 | 9 | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | - * `-----------------------------------------------------------------------------------------' - */ - [_NL] = LAYOUT_all( - _______, _______, _______, _______, _______, _______, _______, _______, KC_PERCENT, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_LEFT_ANGLE_BRACKET, KC_RIGHT_ANGLE_BRACKET, KC_NO, _______, - _______, _______, _______, _______, _______, _______, _______, KC_ASTERISK, KC_0, KC_1, KC_2, KC_3, _______, RESET, - _______, _______, _______, _______, _______, _______, _______, KC_DOT, KC_MINS, KC_4, KC_5, KC_6, _______, - _______, KC_NO, _______, _______, _______, _______, _______, _______, KC_COMMA, KC_EQL, KC_7, KC_8, KC_9, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_BRTG, BL_INC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_MODE_REVERSE, BL_DEC, RGB_MODE_FORWARD), }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/dz60/keymaps/macos_arrow/rules.mk b/keyboards/dz60/keymaps/macos_arrow/rules.mk index e1cfb3e508c..1572f18c79a 100644 --- a/keyboards/dz60/keymaps/macos_arrow/rules.mk +++ b/keyboards/dz60/keymaps/macos_arrow/rules.mk @@ -1,2 +1,2 @@ -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no \ No newline at end of file +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/dz60/keymaps/marianas/customLogic.c b/keyboards/dz60/keymaps/marianas/customLogic.c new file mode 100644 index 00000000000..b7dbcac95b7 --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/customLogic.c @@ -0,0 +1,138 @@ +#include QMK_KEYBOARD_H +#include "customLogic.h" +#include "keymap.h" +#include "keyDefinitions.h" +#include "relativity.h" +#include "timer.h" + +static int16_t fnTimer = 0; + + + +uint32_t layer_state_set_user(uint32_t state) +{ + switch (biton32(state)) + { + case QWERTY: + rgblight_mode(9); + break; + case NAV_CLUSTER: + rgblight_mode(29); + break; + case GAMING: + rgblight_mode(26); + break; + case SQLMACROS: + rgblight_mode(1); + break; + case FN_LAYER: + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL+5); + break; + } + return state; +} + + + +bool printSqlVerbs(uint16_t keycode, keyrecord_t *record) +{ + if (record->event.pressed) + { + switch (keycode) + { + case S_LFTJN: + SEND_STRING("LEFT JOIN"); + activateRelativity(); + return false; + case S_INRJN: + SEND_STRING("INNER JOIN "); + activateRelativity(); + return false; + case S_SLCT: + SEND_STRING("SELECT "); return + false; + case S_FROM: + SEND_STRING("FROM "); return + false; + case S_DSNCT: + SEND_STRING("DISTINCT "); return + false; + case S_ORDER: + SEND_STRING("ORDER BY "); return + false; + case S_WHERE: + SEND_STRING("WHERE "); return + false; + case S_ALTER: + SEND_STRING("ALTER SESSION SET CURRENT_SCHEMA = SUPPLY;"); return false; + case S_ASTRK: + SEND_STRING("* "); return false; + + } + } + return true; +} + + +bool isFn = false; +bool didFn = false; + + +bool updateLayerState(uint16_t keycode, keyrecord_t *record) +{ + + if (record->event.pressed) + { + switch (keycode) + { + case FN_QT: + fnTimer = timer_read(); + layer_on(FN_LAYER); + isFn = true; + return false; + } + if (isFn) + { + didFn = true; + return true; + } + } + else + { + switch(keycode) + { + case FN_QT: + layer_off(FN_LAYER); + if (!didFn) + { + #if fnTimeout + if (TIMER_DIFF_16(timer_read(), fnTimer) <= fnTimeout) + { + activateRelativity(); + } + else + { + deactivateRelativity(); + } + #else + activateRelativity(); + #endif + } + didFn = false; + isFn = false; + return false; + } + } + return true; +} + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + return + storeShiftState(keycode, record) && + printSqlVerbs(keycode, record) && + updateLayerState(keycode, record) && + handleSmartMacros(keycode, record); +} diff --git a/keyboards/dz60/keymaps/marianas/customLogic.h b/keyboards/dz60/keymaps/marianas/customLogic.h new file mode 100644 index 00000000000..f0e6ecdcac1 --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/customLogic.h @@ -0,0 +1,10 @@ +#define fnTimeout 500 + + +uint32_t layer_state_set_user(uint32_t state); + +bool printSqlVerbs(uint16_t keycode, keyrecord_t *record); + +bool updateLayerState(uint16_t keycode, keyrecord_t *record); + +bool process_record_user(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/dz60/keymaps/marianas/keyDefinitions.h b/keyboards/dz60/keymaps/marianas/keyDefinitions.h new file mode 100644 index 00000000000..d3aac3dcbf4 --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/keyDefinitions.h @@ -0,0 +1,123 @@ + +//Control +#define MO_FNLR MO(FN_LAYER) +#define BACKSPC KC_BSPC +#define ENTER_OR_SQL LT(SQLMACROS,KC_ENT) +#define ESCAP KC_ESC +#define PSCR KC_PSCREEN +#define SCRL KC_SCROLLLOCK +#define PAUS KC_PAUSE +#define NSRT KC_INSERT +#define HOME KC_HOME +#define PGUP KC_PGUP +#define PGDN KC_PGDN +#define END_ KC_END +#define DELT KC_DELETE +#define UPUP KC_UP +#define D_WN KC_DOWN +#define LEFT KC_LEFT +#define RGHT KC_RIGHT + +//KEYPAD +#define KP_1 KC_KP_1 +#define KP_2 KC_KP_2 +#define KP_3 KC_KP_3 +#define KP_4 KC_KP_4 +#define KP_5 KC_KP_5 +#define KP_6 KC_KP_6 +#define KP_7 KC_KP_7 +#define KP_8 KC_KP_8 +#define KP_9 KC_KP_9 +#define KP_0 KC_KP_0 +#define NMLK KC_NUMLOCK +#define STAR KC_KP_ASTERISK +#define KSSH KC_KP_SLASH +#define KMIN KC_KP_MINUS +#define PLUS KC_KP_PLUS +#define KNTR KC_KP_ENTER +#define KDOT KC_KP_DOT + +//Modifiers +#define CTLL KC_LCTL +#define LEFTSHFT KC_LSPO +#define WINL KC_LGUI +#define ALTL KC_LALT +#define CTLR KC_RCTL +#define RIGHT_SHIFT__PAREN KC_RSPC +#define WINR KC_RGUI +#define ALTR KC_RALT +#define APPR KC_APP + + +//Punctuation +#define CMMA KC_COMM +#define PRRD KC_DOT +#define SLSH KC_SLSH +#define QUOT KC_QUOT +#define COLN KC_SCLN +#define LBRC KC_LBRC +#define RBRC KC_RBRC +#define EQUL KC_EQL +#define MNUS KC_MINS +#define BSLASH KC_BSLS + +//Layers +#define QWRTY TO(QWERTY) +#define NAVS TO(NAV_CLUSTER) +#define GAME TO(GAMING) + +//Space +#define ____ KC_TRNS +#define _____ KC_TRNS +#define ______ KC_TRNS +#define ________ KC_TRNS +#define ___________ KC_TRNS +#define _________________ KC_TRNS +#define SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE KC_SPC +#define KCNO KC_NO + +enum sql_macros { + S_LFTJN = SAFE_RANGE, // L + S_INRJN, // I + S_SLCT, // S + S_FROM, // F + S_DSNCT, // D + S_ORDER, // O + S_WHERE, // W + S_ALTER, // Esc + S_ASTRK, // * + + TD_A, + TD_B, + TD_C, // Corp, Corporation, Company + TD_D, // Distribution, Dist, Distributor + TD_E, + TD_F, + TD_G, // GlobalLookup + TD_H, + TD_I, // Instance, Item + TD_J, + TD_K, + TD_L, + TD_M, + TD_N, // NadRate + TD_O, + TD_P, // Product, Person, + TD_Q, // Darden + TD_R, + TD_S, // Supplier, Step + TD_T, // Task, Type + TD_U, + TD_V, + TD_W, // Workflow, + TD_X, + TD_Y, + TD_Z, + TD_BSPC, + TD_ENT, + TD_ESC, + + FN_QT +}; + +bool isShifted(void); diff --git a/keyboards/dz60/keymaps/marianas/keymap.c b/keyboards/dz60/keymaps/marianas/keymap.c index e40bc6897b7..f86074b9c24 100644 --- a/keyboards/dz60/keymaps/marianas/keymap.c +++ b/keyboards/dz60/keymaps/marianas/keymap.c @@ -1,505 +1,10 @@ #include QMK_KEYBOARD_H #include "keymap.h" +#include "relativity.h" +#include "keyDefinitions.h" +#include "customLogic.h" -enum marianas_layers { - QWERTY, -/* - COLEMAK, - DVORAK, -*/ - NAV_CLUSTER, - GAMING, - SQLMACROS, - SQLNAMES, - FN_LAYER -}; - -enum sql_macros { - S_LFTJN = SAFE_RANGE, // L - S_INRJN, // I - S_SLCT, // S - S_FROM, // F - S_DSNCT, // D - S_ORDER, // O - S_WHERE, // W - S_ALTER, // Esc - S_ASTRK, // * - - TD_A, - TD_B, - TD_C, // Corp, Corporation, Company - TD_D, // Distribution, Dist, Distributor - TD_E, - TD_F, - TD_G, // GlobalLookup - TD_H, - TD_I, // Instance, Item - TD_J, - TD_K, - TD_L, - TD_M, - TD_N, // NadRate - TD_O, - TD_P, // Product, Person, - TD_Q, // Darden - TD_R, - TD_S, // Supplier, Step - TD_T, // Task, Type - TD_U, - TD_V, - TD_W, // Workflow, - TD_X, - TD_Y, - TD_Z, - TD_BSPC, - TD_ENT, - TD_ESC -}; - -uint16_t *macroTaps = 0; - -char *tableNameList = 0; - -uint8_t *charCount = 0; -uint8_t countPointer = 0; - -bool shifted = false; - -bool sendAbbr = false; - - -void initStringData(void) -{ - if (macroTaps == 0) - { - macroTaps = malloc(macroTapsLen*sizeof(uint16_t)); - for(int i = 0; i < macroTapsLen; i++) - { - macroTaps[i] = 0; - } - } - if (tableNameList == 0) - { - tableNameList = malloc(tableNameListLen*sizeof(char)); - for(int i = 0; i < tableNameListLen; i++) - { - tableNameList[i] = 0; - } - } - if (charCount == 0) - { - charCount = malloc(charCountLen*sizeof(uint8_t)); - for (int i = 0; i < charCountLen; i++) - { - charCount[i] = 0; - } - } -} - - -uint32_t layer_state_set_user(uint32_t state) -{ - switch (biton32(state)) - { - case QWERTY: - rgblight_mode(9); - break; - case NAV_CLUSTER: - rgblight_mode(29); - break; - case GAMING: - rgblight_mode(26); - break; - case SQLMACROS: - rgblight_mode(1); - rgblight_setrgb(0x00, 0xFF, 0x80); - break; - case SQLNAMES: - rgblight_mode(1); - rgblight_setrgb(0x80, 0xFF, 0x00); - break; - case FN_LAYER: - rgblight_mode(1); - rgblight_setrgb(0x00, 0x80, 0xFF); - break; - } - return state; -} - -bool containsCode(uint16_t kc) -{ - for (int i = 0; i < macroTapsLen && macroTaps[i] > 0; i++) - { - if (macroTaps[i] == kc) return true; - } - return false; -} - -bool lastCodeIs(uint16_t kc) -{ - for (int i = 0; i < macroTapsLen-1 && macroTaps[i] > 0; i++) - { - if (macroTaps[i] == kc && macroTaps[i+1] == 0) return true; - } - return false; -} - -bool last2CodeAre(uint16_t kc) -{ - for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) - { - if (macroTaps[i] == kc && macroTaps[i+1] == kc && macroTaps[i+2] == 0) return true; - } - return false; -} - -bool last2CodesAre(uint16_t kc, uint16_t kc2) -{ - for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) - { - if (macroTaps[i] == kc && macroTaps[i+1] == kc2 && macroTaps[i+2] == 0) return true; - } - return false; -} - -void addKeyCode(uint16_t kc) -{ - int i = 0; - while (i < macroTapsLen-2 && macroTaps[i] > 0) i++; - if (macroTaps[i] == 0) - { - macroTaps[i] = kc; - macroTaps[i+1] = 0; - } -} - -void eraseKeyCodes(void) -{ - int i = 0; - while (i < macroTapsLen && macroTaps[i] > 0) macroTaps[i++] = 0; -} - -void eraseCharCounts(void) -{ - int i = 0; - while (i < charCountLen) - { - charCount[i] = 0; - } -} - -void printTableAbbreviation(void) -{ - initStringData(); - if (tableNameList[0] == 0) - { - return; - } - send_char(0x20); - int i = 0; - for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) - { - if (tableNameList[i] >= 65 && tableNameList[i] <= 90) - { - send_char(tableNameList[i]+32); - } - else - { - send_char(tableNameList[i]); - } - } - send_char(0x20); -} - -void eraseTableAbbreviation(void) -{ - initStringData(); - for (int i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) - { - tableNameList[i] = '\0'; - } -} - -void printString(char* str) -{ - - if (str[0] != '\0') - { - int i = 0; - while (true) - { - if (str[i] == 0) - { - break; - } - send_char(str[i++]); - charCount[countPointer]++; - } - } -} - -void printStringAndQueueChar(char* str) -{ - initStringData(); - if (charCount[countPointer] != 0) - { - countPointer++; - } - sendAbbr = true; - if (str[0] != '\0') - { - printString(str); - - for (int i = 0; i < tableNameListLen-1; i++) - { - if (tableNameList[i] == '\0') - { - tableNameList[i] = str[0]; - tableNameList[i+1] = '\0'; - break; - } - else if (i == tableNameListLen-2) - { - printTableAbbreviation(); - break; - } - } - //for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) - //{ - // send_char(tableNameList[i]); - //} - //send_string_P("Darden"); - //send_string_P(&myarray); - //send_string_P(str); - } -} - -void ReplaceString(char *orig, char *repl) -{ - int i = 0; - while((orig[i] != 0x0 && repl[i] != 0x0) && orig[i] == repl[i]) - i++; - - if(orig[i] != 0x0) - { - int o = i; - while (orig[o++] != 0x0) { - charCount[countPointer]--; - register_code(KC_BSPC); - unregister_code(KC_BSPC); - } - } - printString(repl+i); -} - -void deletePrev(void) -{ - for (int i = 0; i < charCount[countPointer]; i++) - { - register_code(KC_BSPC); - unregister_code(KC_BSPC); - } - charCount[countPointer] = 0; - countPointer--; - int i = 1; - for (;i < tableNameListLen-1; i++) - { - if (tableNameList[i] == 0x0) - { - break; - } - } - tableNameList[i-1] = 0x0; -} - -void processSmartMacroTap(uint16_t kc) -{ - initStringData(); - switch(kc) - { - case TD_C: - if (containsCode(TD_D)) - { - printString("ribution"); - printStringAndQueueChar("Center"); - } - else if (last2CodeAre(TD_C)) - { - ReplaceString("Corporation", "Contact"); - } - else if(lastCodeIs(TD_C)) - { - printString("oration"); - } - else - { - printStringAndQueueChar("Corp"); - } - break; - case TD_D: - if (last2CodeAre(TD_D)) - { - ReplaceString("Distribution", "Distributor"); - } - else if(lastCodeIs(TD_D)) - { - printString("ribution"); - } - else - { - printStringAndQueueChar("Dist"); - } - break; - case TD_G: - printStringAndQueueChar("Global"); - printStringAndQueueChar("Lookup"); - break; - case TD_I: - if (containsCode(TD_W)) - printStringAndQueueChar("Instance"); - else - printStringAndQueueChar("Item"); - break; - case TD_N: - printStringAndQueueChar("NadRate"); - break; - case TD_P: - if (last2CodesAre(TD_D, TD_C)) - { - ReplaceString("DistributionCenter", "DistCenter"); - printStringAndQueueChar("Pricing"); - } - else if (last2CodeAre(TD_P)) - { - } - else if(lastCodeIs(TD_P)) - { - ReplaceString("Product", "Person"); - } - else - { - printStringAndQueueChar("Product"); - } - break; - case TD_Q: - printStringAndQueueChar("Darden"); - break; - case TD_S: - if (containsCode(TD_W)) - if (containsCode(TD_S) || containsCode(TD_D)) - printStringAndQueueChar("Step"); - else - printStringAndQueueChar("Session"); - else - printStringAndQueueChar("Supplier"); - break; - case TD_T: - if (containsCode(TD_W)) - printStringAndQueueChar("Task"); - else - printStringAndQueueChar("Type"); - break; - case TD_W: - printStringAndQueueChar("Workflow"); - break; - } - addKeyCode(kc); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - if (record->event.pressed) - { - switch (keycode) - { - case KC_LSPO: - case KC_RSPC: - shifted = true; - return true; - - case S_LFTJN: SEND_STRING("LEFT JOIN"); return false; - case S_INRJN: SEND_STRING("INNER JOIN "); return false; - case S_SLCT: SEND_STRING("SELECT "); return false; - case S_FROM: SEND_STRING("FROM "); return false; - case S_DSNCT: SEND_STRING("DISTINCT "); return false; - case S_ORDER: SEND_STRING("ORDER "); return false; - case S_WHERE: SEND_STRING("WHERE "); return false; - case S_ALTER: SEND_STRING("ALTER SESSION SET CURRENT_SCHEMA = "); return false; - case S_ASTRK: SEND_STRING("* "); return false; - - case KC_BSLS: - initStringData(); - layer_on(SQLNAMES); - return false; - - case TD_BSPC: - if (!shifted){ - deletePrev(); - } - else { - register_code(KC_BSPC); - unregister_code(KC_BSPC); - } - return false; - - case TD_A: - case TD_B: - case TD_C: - case TD_D: - case TD_E: - case TD_F: - case TD_G: - case TD_H: - case TD_I: - case TD_J: - case TD_K: - case TD_L: - case TD_M: - case TD_N: - case TD_O: - case TD_P: - case TD_Q: - case TD_R: - case TD_S: - case TD_T: - case TD_U: - case TD_V: - case TD_W: - case TD_X: - case TD_Y: - case TD_Z: - processSmartMacroTap(keycode); - return false; - - case TD_ENT: - printTableAbbreviation(); - case TD_ESC: - eraseKeyCodes(); - eraseTableAbbreviation(); - layer_off(SQLNAMES); - return true; - } - } - else - { - switch (keycode) - { - - case KC_BSLS: - if (macroTaps[0] == 0) - { - SEND_STRING("\\"); - layer_off(SQLNAMES); - } - return true; - case KC_LSPO: - case KC_RSPC: - shifted = false; - return true; - } - } - return true; -}; +// planned change: store previous table names and abbreviations to allow scrolling for inner joins on table name+id and abbreviation+id. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -507,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_60_ansi( ESCAP, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, MNUS, EQUL, BACKSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, LBRC, RBRC, BSLASH, - MO_FNLR, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, COLN, QUOT, ENTER_OR_SQL, + FN_QT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, COLN, QUOT, ENTER_OR_SQL, LEFTSHFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, CMMA, PRRD, SLSH, RIGHT_SHIFT__PAREN, CTLL, WINL, ALTL, SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE, ALTR, WINR, APPR, CTLR), @@ -531,23 +36,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_60_ansi( S_ALTER, ____, ____, ____, ____, ____, ____, ____, S_ASTRK, ____, ____, ____, ____, ___________, ______, ____, S_WHERE, ____, ____, ____, ____, ____, S_INRJN, S_ORDER, ____, ____, ____, ______, - _______, KC_LBRC, S_SLCT, KC_PAST,S_FROM, ____, ____, ____, ____, S_LFTJN, ____, RBRC, ___________, - ________, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, _________________, + _______, KC_LBRC, S_SLCT, S_ASTRK ,S_FROM, ____, ____, ____, ____, S_LFTJN, ____, RBRC, ___________, + ________, RGB_VAI, RGB_VAD, ____, ____, ____, ____, ____, ____, ____, ____, _________________, ____, ____, ____, /*------------------*/_____/*------------------*/, ____, ____, ____, ____), - [SQLNAMES]= - LAYOUT_60_ansi( - TD_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, TD_BSPC, - ________, TD_Q, TD_W, TD_E, TD_R, TD_T, TD_Y, TD_U, TD_I, TD_O, TD_P, ____, ____, _____, - ___________, TD_A, TD_S, TD_D, TD_F, TD_G, TD_H, TD_J, TD_K, TD_L, ____, ____, TD_ENT, - ___________, TD_Z, TD_X, TD_C, TD_V, TD_B, TD_N, TD_M, ____, ____, ____, _________________, - ____, ____, ____, /*----------------------*/TD_ENT/*-----------------------*/, ____, ____, ____, RESET), - [FN_LAYER]= LAYOUT_60_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_CAPSLOCK, KC_MPRV, KC_MPLY, KC_MNXT, LWIN(KC_R), ____, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_BRK, ____, ____, KC_VOLD, KC_MUTE, KC_VOLU, ____, ____, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, ____, - ____, ____, ____, ____, ____, ____, KC_END, ____, QWRTY, NAVS, GAME, ____, - ____, ____, ____, _________________, ____, KC_HYPR, KC_MEH, ____) + ____, RGB_HUI, RGB_SAI, RGB_SAD, ____, ____, KC_END, QWRTY, GAME, NAVS, ____, ____, + ____, ____, ____, _________________, ____, KC_HYPR, KC_MEH, RESET) }; diff --git a/keyboards/dz60/keymaps/marianas/keymap.h b/keyboards/dz60/keymaps/marianas/keymap.h index 00e51cea2c5..bb1ea68c77a 100644 --- a/keyboards/dz60/keymaps/marianas/keymap.h +++ b/keyboards/dz60/keymaps/marianas/keymap.h @@ -1,105 +1,15 @@ -#include "quantum.h" +#include QMK_KEYBOARD_H -//Control -#define MO_FNLR MO(FN_LAYER) -#define BACKSPC KC_BSPC -#define ENTER_OR_SQL LT(SQLMACROS,KC_ENT) -#define ESCAP KC_ESC -#define PSCR KC_PSCREEN -#define SCRL KC_SCROLLLOCK -#define PAUS KC_PAUSE -#define NSRT KC_INSERT -#define HOME KC_HOME -#define PGUP KC_PGUP -#define PGDN KC_PGDN -#define END_ KC_END -#define DELT KC_DELETE -#define UPUP KC_UP -#define D_WN KC_DOWN -#define LEFT KC_LEFT -#define RGHT KC_RIGHT -//KEYPAD -#define KP_1 KC_KP_1 -#define KP_2 KC_KP_2 -#define KP_3 KC_KP_3 -#define KP_4 KC_KP_4 -#define KP_5 KC_KP_5 -#define KP_6 KC_KP_6 -#define KP_7 KC_KP_7 -#define KP_8 KC_KP_8 -#define KP_9 KC_KP_9 -#define KP_0 KC_KP_0 -#define NMLK KC_NUMLOCK -#define STAR KC_KP_ASTERISK -#define KSSH KC_KP_SLASH -#define KMIN KC_KP_MINUS -#define PLUS KC_KP_PLUS -#define KNTR KC_KP_ENTER -#define KDOT KC_KP_DOT +enum marianas_layers { + QWERTY, +/* + COLEMAK, + DVORAK, +*/ + NAV_CLUSTER, + GAMING, + SQLMACROS, + FN_LAYER +}; -//Modifiers -#define CTLL KC_LCTL -#define LEFTSHFT KC_LSPO -#define WINL KC_LGUI -#define ALTL KC_LALT -#define CTLR KC_RCTL -#define RIGHT_SHIFT__PAREN KC_RSPC -#define WINR KC_RGUI -#define ALTR KC_RALT -#define APPR KC_APP - - -//Punctuation -#define CMMA KC_COMM -#define PRRD KC_DOT -#define SLSH KC_SLSH -#define QUOT KC_QUOT -#define COLN KC_SCLN -#define LBRC KC_LBRC -#define RBRC KC_RBRC -#define EQUL KC_EQL -#define MNUS KC_MINS -#define BSLASH KC_BSLS - -//Layers -#define QWRTY TO(QWERTY) -#define NAVS TO(NAV_CLUSTER) -#define GAME TO(GAMING) - -//Space -#define ____ KC_TRNS -#define _____ KC_TRNS -#define ______ KC_TRNS -#define _______ KC_TRNS -#define ________ KC_TRNS -#define ___________ KC_TRNS -#define _________________ KC_TRNS -#define SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE KC_SPC -#define KCNO KC_NO - - - - - -#define macroTapsLen 32 -#define tableNameListLen 32 -#define charCountLen 32 - -void initStringData(void); -uint32_t layer_state_set_user(uint32_t state); -bool containsCode(uint16_t kc); -bool lastCodeIs(uint16_t kc); -bool last2CodeAre(uint16_t kc); -bool last2CodesAre(uint16_t kc, uint16_t kc2); -void addKeyCode(uint16_t kc); -void eraseKeyCodes(void); -void eraseCharCounts(void); -void printTableAbbreviation(void); -void eraseTableAbbreviation(void); -void printString(char* str); -void printStringAndQueueChar(char* str); -void ReplaceString(char *orig, char *repl); -void deletePrev(void); -void processSmartMacroTap(uint16_t kc); -bool process_record_user(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/dz60/keymaps/marianas/relativity.c b/keyboards/dz60/keymaps/marianas/relativity.c new file mode 100644 index 00000000000..96a5eb4e6ff --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/relativity.c @@ -0,0 +1,510 @@ +#include "relativity.h" +#include "keymap.h" +#include "keyDefinitions.h" + + +uint16_t *macroTaps = 0; + +char *tableNameList = 0; + +uint8_t *charCount = 0; +uint8_t countPointer = 0; + +bool relativityActive = false; + + +bool sendAbbr = false; + + +static int16_t relativityTimer = 0; + + +bool tempOff = false; + + + + +void initStringData() +{ + if (macroTaps == 0) + { + macroTaps = malloc(macroTapsLen*sizeof(uint16_t)); + for(int i = 0; i < macroTapsLen; i++) + { + macroTaps[i] = 0; + } + } + if (tableNameList == 0) + { + tableNameList = malloc(tableNameListLen*sizeof(char)); + for(int i = 0; i < tableNameListLen; i++) + { + tableNameList[i] = 0; + } + } + if (charCount == 0) + { + charCount = malloc(charCountLen*sizeof(uint8_t)); + for (int i = 0; i < charCountLen; i++) + { + charCount[i] = 0; + } + } +} + +void activateRelativity(void) +{ + initStringData(); + rgblight_mode(RGBLIGHT_MODE_KNIGHT); + relativityTimer = timer_read(); + relativityActive = true; +} + +bool deactivateRelativity(void) +{ + rgblight_mode(9); + eraseKeyCodes(); + eraseTableAbbreviation(); + eraseCharCounts(); + relativityActive = false; + tempOff = false; + return false; +} + +bool containsCode(uint16_t kc) +{ + for (int i = 0; i < macroTapsLen && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc) return true; + } + return false; +} + +bool lastCodeIs(uint16_t kc) +{ + for (int i = 0; i < macroTapsLen-1 && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc && macroTaps[i+1] == 0) return true; + } + return false; +} + +bool last2CodeAre(uint16_t kc) +{ + for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc && macroTaps[i+1] == kc && macroTaps[i+2] == 0) return true; + } + return false; +} + +bool last2CodesAre(uint16_t kc, uint16_t kc2) +{ + for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc && macroTaps[i+1] == kc2 && macroTaps[i+2] == 0) return true; + } + return false; +} + +void addKeyCode(uint16_t kc) +{ + int i = 0; + while (i < macroTapsLen-2 && macroTaps[i] > 0) i++; + if (macroTaps[i] == 0) + { + macroTaps[i] = kc; + macroTaps[i+1] = 0; + } +} + +void eraseKeyCodes(void) +{ + int i = 0; + while (i < macroTapsLen && macroTaps[i] > 0) macroTaps[i++] = 0; +} + +void eraseCharCounts(void) +{ + while (countPointer > 0) + { + charCount[countPointer] = 0; + countPointer--; + } + charCount[countPointer] = 0; +} + +void printTableAbbreviationLimited(void) +{ + if (tableNameList[0] == 0) + { + return; + } + int i = 0; + for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + { + if (tableNameList[i] >= 65 && tableNameList[i] <= 90) + { + send_char(tableNameList[i]+32); + } + else + { + send_char(tableNameList[i]); + } + } +} + +void printTableAbbreviation(void) +{ + if (tableNameList[0] == 0) + { + return; + } + send_char(0x20); + int i = 0; + for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + { + if (tableNameList[i] >= 65 && tableNameList[i] <= 90) + { + send_char(tableNameList[i]+32); + } + else + { + send_char(tableNameList[i]); + } + } + send_char(0x20); +} + +void eraseTableAbbreviation(void) +{ + for (int i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + { + tableNameList[i] = '\0'; + } +} + +void printString(char* str) +{ + + if (str[0] != '\0') + { + int i = 0; + while (true) + { + if (str[i] == 0) + { + break; + } + send_char(str[i++]); + charCount[countPointer]++; + } + } +} + +void printStringAndQueueChar(char* str) +{ + if (charCount[countPointer] > 0 && countPointer < charCountLen) + { + countPointer++; + } + sendAbbr = true; + if (str[0] != '\0') + { + printString(str); + + for (int i = 0; i < tableNameListLen-1; i++) + { + if (tableNameList[i] == '\0') + { + tableNameList[i] = str[0]; + tableNameList[i+1] = '\0'; + break; + } + else if (i == tableNameListLen-2) + { + printTableAbbreviation(); + break; + } + } + //for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + //{ + // send_char(tableNameList[i]); + //} + //send_string_P("Darden"); + //send_string_P(&myarray); + //send_string_P(str); + } +} + +void ReplaceString(char *orig, char *repl) +{ + int i = 0; + while((orig[i] != 0x0 && repl[i] != 0x0) && orig[i] == repl[i]) + i++; + + if(orig[i] != 0x0) + { + int o = i; + while (orig[o++] != 0x0) { + charCount[countPointer]--; + register_code(KC_BSPC); + unregister_code(KC_BSPC); + } + } + printString(repl+i); +} + +void deletePrev(void) +{ + if (countPointer == 0 && charCount[countPointer] == 0) + return; + for (int i = 0; i < charCount[countPointer]; i++) + { + register_code(KC_BSPC); + unregister_code(KC_BSPC); + } + charCount[countPointer] = 0; + int i = 1; + for (;i < tableNameListLen-1; i++) + { + if (tableNameList[i] == 0x0) + { + break; + } + } + tableNameList[i-1] = 0x0; + if (countPointer > 0) + { + countPointer--; + } +} + +bool processSmartMacroTap(uint16_t kc) +{ + if (relativityTimer > 0 && TIMER_DIFF_16(timer_read(), relativityTimer) >= relTimeout) + { + deactivateRelativity(); + return true; + } + relativityTimer = 0; + switch(kc) + { + case KC_C: + if (containsCode(KC_D)) + { + printString("ribution"); + printStringAndQueueChar("Center"); + } + else if (last2CodeAre(KC_C)) + { + ReplaceString("Corporation", "Contact"); + } + else if(lastCodeIs(KC_C)) + { + printString("oration"); + } + else + { + printStringAndQueueChar("Corp"); + } + break; + case KC_D: + if (last2CodeAre(KC_D)) + { + ReplaceString("Distribution", "Distributor"); + } + else if(lastCodeIs(KC_D)) + { + printString("ribution"); + } + else + { + printStringAndQueueChar("Dist"); + } + break; + case KC_G: + printStringAndQueueChar("Global"); + printStringAndQueueChar("Lookup"); + break; + case KC_I: + if (containsCode(KC_W)) + printStringAndQueueChar("Instance"); + else + printStringAndQueueChar("Item"); + break; + case KC_N: + printStringAndQueueChar("NadRate"); + break; + case KC_P: + if (last2CodesAre(KC_D, KC_C)) + { + ReplaceString("DistributionCenter", "DistCenter"); + printStringAndQueueChar("Pricing"); + } + else if (last2CodeAre(KC_P)) + { + } + else if(lastCodeIs(KC_P)) + { + ReplaceString("Product", "Person"); + } + else + { + printStringAndQueueChar("Product"); + } + break; + case KC_Q: + printStringAndQueueChar("Darden"); + break; + case KC_S: + if (containsCode(KC_W)) + if (containsCode(KC_S) || containsCode(KC_D)) + printStringAndQueueChar("Step"); + else + printStringAndQueueChar("Session"); + else + printStringAndQueueChar("Supplier"); + break; + case KC_T: + if (containsCode(KC_W)) + printStringAndQueueChar("Task"); + else + printStringAndQueueChar("Type"); + break; + case KC_W: + printStringAndQueueChar("Workflow"); + break; + } + addKeyCode(kc); + return false; +} + + +bool shifted = false; +bool isShifted() +{ + return shifted; +} + +void setShifted(bool val) +{ + shifted = val; +} + + +bool storeShiftState(uint16_t keycode, keyrecord_t *record) +{ + + if (record->event.pressed) + { + switch (keycode) + { + case KC_LSPO: + case KC_RSPC: + shifted = true; + } + } + else + { + switch (keycode) + { + + case KC_LSPO: + case KC_RSPC: + shifted = false; + return true; + } + } + return true; +} + +bool handleSmartMacros(uint16_t keycode, keyrecord_t *record) +{ + if (relativityActive != true) return true; + if (record->event.pressed) + { + switch (keycode) + { + case KC_BSPC: + if (!isShifted()){ + deletePrev(); + } + else { + register_code(KC_BSPC); + unregister_code(KC_BSPC); + } + return false; + case KC_A: + case KC_B: + case KC_C: + case KC_D: + case KC_E: + case KC_F: + case KC_G: + case KC_H: + case KC_I: + case KC_J: + case KC_K: + case KC_L: + case KC_M: + case KC_N: + case KC_O: + case KC_P: + case KC_Q: + case KC_R: + case KC_S: + case KC_T: + case KC_U: + case KC_V: + case KC_W: + case KC_X: + case KC_Y: + case KC_Z: + return processSmartMacroTap(keycode); + + case PRRD: + if (tempOff) + { + SEND_STRING("Id = "); + printTableAbbreviationLimited(); + SEND_STRING(".Id"); + return deactivateRelativity(); + } + else + { + printTableAbbreviation(); + SEND_STRING("ON "); + printTableAbbreviationLimited(); + eraseKeyCodes(); + eraseTableAbbreviation(); + eraseCharCounts(); + tempOff = true; + return true; + } + + + case KC_SPC: + printTableAbbreviation(); + return deactivateRelativity(); + case ENTER_OR_SQL: + if (tempOff) + { + SEND_STRING("Id = "); + printTableAbbreviationLimited(); + SEND_STRING(".Id"); + deactivateRelativity(); + return true; + } + else + { + printTableAbbreviation(); + deactivateRelativity(); + return true; + } + case KC_ESC: + return deactivateRelativity(); + } + } + return true; +} diff --git a/keyboards/dz60/keymaps/marianas/relativity.h b/keyboards/dz60/keymaps/marianas/relativity.h new file mode 100644 index 00000000000..c917b1a4dcd --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/relativity.h @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H +#define macroTapsLen 32 +#define tableNameListLen 32 +#define charCountLen 32 + +#define relTimeout 1500 + + +void activateRelativity(void); +bool deactivateRelativity(void); +void initStringData(void); +bool containsCode(uint16_t kc); +bool lastCodeIs(uint16_t kc); +bool last2CodeAre(uint16_t kc); +bool last2CodesAre(uint16_t kc, uint16_t kc2); +void addKeyCode(uint16_t kc); +void eraseKeyCodes(void); +void eraseCharCounts(void); +void printTableAbbreviation(void); +void eraseTableAbbreviation(void); +void printString(char* str); +void printStringAndQueueChar(char* str); +void ReplaceString(char *orig, char *repl); +void deletePrev(void); +bool processSmartMacroTap(uint16_t kc); +bool isShifted(void); +void setShifted(bool); + + + +bool handleSmartMacros(uint16_t keycode, keyrecord_t *record); +bool storeShiftState(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/dz60/keymaps/marianas/rules.mk b/keyboards/dz60/keymaps/marianas/rules.mk index ab188f3b2c4..230d194ab88 100644 --- a/keyboards/dz60/keymaps/marianas/rules.mk +++ b/keyboards/dz60/keymaps/marianas/rules.mk @@ -15,3 +15,7 @@ AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes TAP_DANCE_ENABLE = no AUTO_SHIFT_ENABLE = no + + +SRC += relativity.c +SRC += customLogic.c diff --git a/keyboards/dz60/keymaps/mechmerlin/config.h b/keyboards/dz60/keymaps/mechmerlin/config.h new file mode 100644 index 00000000000..92d4cfb50a3 --- /dev/null +++ b/keyboards/dz60/keymaps/mechmerlin/config.h @@ -0,0 +1,6 @@ +#pragma once + +// Turn off RGB when computer goes to sleep +#ifdef RGBLIGHT_ENABLE +#define RGBLIGHT_SLEEP +#endif // RGBLIGHT_ENABLE diff --git a/keyboards/dz60/keymaps/mechmerlin/keymap.c b/keyboards/dz60/keymaps/mechmerlin/keymap.c new file mode 100644 index 00000000000..f7ad17fd8c1 --- /dev/null +++ b/keyboards/dz60/keymaps/mechmerlin/keymap.c @@ -0,0 +1,40 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL, // Function Layer + _CL // Control Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTCP LCTL_T(KC_CAPS) +#define KC_RSSH RSFT_T(KC_SLSH) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_b_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSSH, KC_UP, KC_DEL, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [_FL] = LAYOUT_60_b_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_PGUP, MO(_CL), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + + [_CL] = LAYOUT_60_b_ansi( + RESET, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +// Set underglow RGB leds to yellow +// Find the list of available colors in quantum/rgblight_list.h +void matrix_init_user(void) { + rgblight_sethsv_noeeprom_yellow(); +} diff --git a/keyboards/dz60/keymaps/mechmerlin/readme.md b/keyboards/dz60/keymaps/mechmerlin/readme.md new file mode 100644 index 00000000000..76ff54de548 --- /dev/null +++ b/keyboards/dz60/keymaps/mechmerlin/readme.md @@ -0,0 +1,68 @@ +# MechMerlin's DZ60 Keymap + +The purpose of this keymap is to provide examples on how to do some common QMK features. + +Make example for this keyboard (after setting up your build environment): + + make dz60:mechmerlin + +## Merlin's DZ60 Hardware Info +--- + +The DZ60 is a 60% pcb produced by KBDFans. It comes in two variants, USB Mini B and USB C. It supports many many layouts. It also supports both backlight and RGB underglow. The USB C variant does not have a hardware reset switch. USB C to C is not supported. + +Merlin's DZ60 uses +- Layout B, in QMK this is LAYOUT_60_b_ansi. +- USB C +- 50g Zilents +- Arrows are 78g Zilents +- KPRepublic XD64 Case + +## Layers +--- + +Merlin's keymap has three different layers. To switch layers you can use the `MO(X)` keycode, where `X` is the layer you want to switch to. + +### _BL + +This is the base layer also known as layer 0. It is a standard QWERTY layout. It has the `_FL` layer switch key. + +### _FL + +This is the function layer also known as layer 1. It utiizes the following: +- Function Keys +- Navigation Keys +- Audio keys such as Mute, Volume Down and Volume Up. +- `_CL` layer switch key + +### _CL + +This is the control layer also known as layer 2. It utilizes the following: +- RGB Controls +- `RESET` key + +## Non Standard Keycodes +--- +### RESET + +As long `BOOTMAGIC_ENABLE` is set to `yes` in `rules.mk`, the DZ60 can be put into bootloader mode by holding the `space` key and the `b` key while plugging in. However sometmes this doesn't work or is troublesome to do, might as well use the `RESET` keycode to accomplish this. + +### RSFT_T(KC_SLSH) + +Layout B is missing the `?` key and is instead replaced with a `right shift`. This keycode makes it so that the key can be tapped for `?` and held for `right shift`. + +### LCTL_T(KC_CAPS) + +`Caps Lock` is only ever used by tapping, why not use it as a `control` key when held? This keycode makes it so that the key can be tapped for `caps lock` and held for `control`. + + +## RGB Lighting +--- + +### RGBLIGHT_SLEEP + +This is set in `mechmerlin/config.h` so that when the computer goes to sleep, the RGB lights will also go to sleep on the keyboard. They will turn back on when the computer wakes. + +### RGB Underglow Color: Yellow + +This is set in `mechmerlin/keymap.c` in the `matrix_init_user` function. The list of available colors can be found in [`quantum/rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/388df5359b913eaf1ce6fb0ef624e430ad010ea5/quantum/rgblight_list.h#L59-L121). diff --git a/keyboards/dz60/keymaps/mpaarating/keymap.c b/keyboards/dz60/keymaps/mpaarating/keymap.c new file mode 100644 index 00000000000..3ad32aae0a7 --- /dev/null +++ b/keyboards/dz60/keymaps/mpaarating/keymap.c @@ -0,0 +1,24 @@ +#include QMK_KEYBOARD_H + +// Layer definition +#define L0 0 +#define L1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [L0] = LAYOUT_60_2_function( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLASH, KC_GRAVE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPACE, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(L1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_RGUI, MO(L1) + ), + + [L1] = LAYOUT_60_2_function( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_PSCR, KC_UP, KC_TRNS, KC_DELETE, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_LEFT, KC_RIGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_END, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/dz60/keymaps/mpaarating/readme.md b/keyboards/dz60/keymaps/mpaarating/readme.md new file mode 100644 index 00000000000..d21d26c757b --- /dev/null +++ b/keyboards/dz60/keymaps/mpaarating/readme.md @@ -0,0 +1,12 @@ +# DZ60 + +![dz60](https://i.imgur.com/nVOX9Gb.jpg) + +### Layout +**Note:** Layer 2 does not exist currently +![layer 0](https://i.imgur.com/uXFTNBs.png) +![layer 1](https://i.imgur.com/f7uTkDU.png) + +Make example for this keyboard (after setting up your build environment): + + make dz60:mpaarating diff --git a/keyboards/dz60/keymaps/muzfuz/README.md b/keyboards/dz60/keymaps/muzfuz/README.md new file mode 100644 index 00000000000..711d6d5f56a --- /dev/null +++ b/keyboards/dz60/keymaps/muzfuz/README.md @@ -0,0 +1,8 @@ +# muzfuz DZ60 layout + +```shell +make dz60:muzfuz +dfu-programmer atmega32u4 erase --force && \ +dfu-programmer atmega32u4 flash .build/dz60_muzfuz_v2.hex && \ +dfu-programmer atmega32u4 reset +``` diff --git a/keyboards/dz60/keymaps/muzfuz/keymap.c b/keyboards/dz60/keymaps/muzfuz/keymap.c new file mode 100644 index 00000000000..848569f61e1 --- /dev/null +++ b/keyboards/dz60/keymaps/muzfuz/keymap.c @@ -0,0 +1,80 @@ +#include QMK_KEYBOARD_H + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define ESC_CTL CTL_T(KC_ESCAPE) // Tap for Esc, hold for Ctrl + +enum custom_keycodes { + HASHRKT = SAFE_RANGE, + CLNEQLS, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, HASHRKT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + ESC_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_RGUI, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_ENT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_RGHT, KC_DOWN), + + LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { + case HASHRKT: + if (record->event.pressed) + { + SEND_STRING("=>"); + } + break; + case CLNEQLS: + if (record->event.pressed) + { + SEND_STRING(":="); + } + break; + } + return true; +} diff --git a/keyboards/dz60/keymaps/n0velty/keymap.c b/keyboards/dz60/keymaps/n0velty/keymap.c index 7f532b7beb7..1b9c73eb959 100644 --- a/keyboards/dz60/keymaps/n0velty/keymap.c +++ b/keyboards/dz60/keymaps/n0velty/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS //readability - #define _DL 0 //default #define _F1 1 //function 1 #define _F2 2 //function 2 diff --git a/keyboards/dz60/keymaps/olligranlund_iso/keymap.c b/keyboards/dz60/keymaps/olligranlund_iso/keymap.c new file mode 100644 index 00000000000..74953764fdc --- /dev/null +++ b/keyboards/dz60/keymaps/olligranlund_iso/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +/* ISO 60 layout by olligranlund +* +* This layout starts from a standard ISO 60% layout, and adds one function layer. +* If you wish to only have one wide spacebar, you can easily do that by dismissing the "side" spacebar switches. +* +* Default Layer +* ,-----------------------------------------------------------------------------------------. +* | Esc | 1 ! | 2 " | 3 § | 4 $ | 5 % | 6 & | 7 / | 8 ( | 9 ) | 0 = | ß ? | ´ ` | Del | BSPC| +* |-----------------------------------------------------------------------------------------| +* | Tab | Q | W | E | R | T | Y | U | I | O | P | Ä | + * | Enter | +* |---------------------------------------------------------------------------------- | +* | FN | A | S | D | F | G | H | J | K | L | Ö | Ü | # ' | | +* |-----------------------------------------------------------------------------------------| +* | Shift | < > | Z | X | C | V | B | N | M | , ; | . : | - _ | Shift |Shift| +* |-----------------------------------------------------------------------------------------| +* | LCtl | LGUI | LAlt | Space | Space | Space | RAlt | FN | App | RCtl | +* `-----------------------------------------------------------------------------------------' +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_60_iso_split_space_bs_rshift( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_PSCR, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL), + + LAYOUT_60_iso_split_space_bs_rshift( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, + KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_PGDOWN,KC_UP, KC_PGUP, KC_NO, KC_NO, KC_NO, + KC_NO, KC_VOLD, KC_MUTE, KC_VOLU, KC_NO, KC_NO, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, KC_RSFT, KC_CAPS, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL), + +}; diff --git a/keyboards/dz60/keymaps/olligranlund_iso/readme.md b/keyboards/dz60/keymaps/olligranlund_iso/readme.md new file mode 100644 index 00000000000..6aa4007d387 --- /dev/null +++ b/keyboards/dz60/keymaps/olligranlund_iso/readme.md @@ -0,0 +1,6 @@ +# DZ60 with splitted parts +### by Oliver Granlund + +![Finished product](https://i.imgur.com/HlEo5Yg.jpg) + +This is still under progress, but currently works on Windows as a daily driver. \ No newline at end of file diff --git a/keyboards/dz60/keymaps/tailcall/keymap.c b/keyboards/dz60/keymaps/tailcall/keymap.c index f824e9de380..3835b1f646e 100644 --- a/keyboards/dz60/keymaps/tailcall/keymap.c +++ b/keyboards/dz60/keymaps/tailcall/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( diff --git a/keyboards/dz60/keymaps/weeheavy_2.25_lshift/README.md b/keyboards/dz60/keymaps/weeheavy_2.25_lshift/README.md new file mode 100644 index 00000000000..6ff8d9e67ca --- /dev/null +++ b/keyboards/dz60/keymaps/weeheavy_2.25_lshift/README.md @@ -0,0 +1,53 @@ +![DZ60 ANSI with arrow cluster](https://i.imgur.com/hX6rMcm.png) + +# weeheavy's DZ60 layout + +* Default 2.25 left shift +* arrow cluster + +## Layouts + +The base layout is ANSI QWERTY. + +Key sizes (ASCII keyboards below match this scale): + + 1u = 4 chars = | | + 1.25u = 5 chars = | | + 1.5u = 6 chars = | | + 1.75u = 7 chars = | | + 2u = 8 chars = | | + 2.25u = 9 chars = | | + 2.75u = 11 chars = | | + 6.25u = 25 chars = | | + +### Layer 0: Base layout + +Specialities: + +* Arrow cluster +* FN: access to layer 1 + +``` +,----------------------------------------------------------. +|Es||1 ||2 ||3 ||4 ||5 ||6 ||7 ||8 ||9 ||0 ||- ||= || Bksp | +|----------------------------------------------------------+ +|Tab ||Q ||W ||E ||R ||T ||Y ||U ||I ||O ||P ||[ ||] || \ | +|----------------------------------------------------------+ +|Caps ||A ||S ||D ||F ||G ||H ||J ||K ||L ||; ||' || Enter | +|----------------------------------------------------------+ +| Shift ||Z ||X ||C ||V ||B ||N ||M ||, ||. ||/ || Shift | +|----------------------------------------------------------+ +|Ctl||Win||Alt|| Space |FN||← ||↑ ||↓ ||→ | +`----------------------------------------------------------' +``` + +### Layer 1: Utility + +Specialities: + +* F1-F12 keys when holding FN +* Multimedia cluster on the bottom right +* RGB config on the left hand side +* Reset key on ESC and backslash location +* Brightness control top right +* Additional "B" key (a learning from my mistakes) diff --git a/keyboards/dz60/keymaps/weeheavy_2.25_lshift/keymap.c b/keyboards/dz60/keymaps/weeheavy_2.25_lshift/keymap.c new file mode 100644 index 00000000000..38e4519b333 --- /dev/null +++ b/keyboards/dz60/keymaps/weeheavy_2.25_lshift/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +// Make special keycodes more visible +#define ____ KC_TRNS +#define XXXX KC_NO + +// Layer definition +#define L0 0 +#define L1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Base layer - ANSI QWERTY +[L0] = LAYOUT_all( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXX, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, XXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(L1), KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT), + +// Utility layer - RGB and multimedia control, reset and additional "b" button +[L1] = LAYOUT_all( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ____, ____, + KC_B, RGB_TOG, RGB_MOD, RGB_M_K, RGB_M_R, ____, ____, KC_PSCR, ____, KC_PAUS, KC_BRID, KC_BRIU, ____, RESET, + ____, RGB_HUI, RGB_HUD, KC_DEL, ____, ____, ____, KC_INS, KC_HOME, KC_PGUP, ____, ____, ____, + ____, ____, RGB_SAI, RGB_SAD, ____, ____, ____, ____, ____, KC_END, KC_PGDN, KC_MPLY, ____, KC_MUTE, KC_MUTE, + ____, RGB_VAI, RGB_VAD, ____, ____, ____, ____, KC_MPRV, KC_VOLU, KC_VOLD, KC_MNXT), + +}; + diff --git a/keyboards/dz60/keymaps/zepol_layout/keymap.c b/keyboards/dz60/keymaps/zepol_layout/keymap.c new file mode 100644 index 00000000000..4caf83b67e5 --- /dev/null +++ b/keyboards/dz60/keymaps/zepol_layout/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, + KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(2), KC_NO, MO(1), KC_RCTL), + + LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_SCROLLLOCK, KC_PAUSE, KC_HOME, KC_END, KC_INSERT, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + LAYOUT( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/dz60/keymaps/zvecr/keymap.c b/keyboards/dz60/keymaps/zvecr/keymap.c new file mode 100644 index 00000000000..9127fa0a7e6 --- /dev/null +++ b/keyboards/dz60/keymaps/zvecr/keymap.c @@ -0,0 +1,40 @@ +#include QMK_KEYBOARD_H + +/* +* Each layer gets a name for readability. +* The underscores don't mean anything - you can +* have a layer called STUFF or any other name. +* Layer names don't all need to be of the same +* length, and you can also skip them entirely +* and just use numbers. +* +*/ +#define BL 0 // Base Layer +#define FL 1 // Function Layer +#define ML 2 // Macro Layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BL] = LAYOUT_60_ansi_split( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(FL), KC_SPC, KC_RALT, KC_RGUI, MO(ML), KC_RCTL), + + [FL] = LAYOUT_60_ansi_split( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, _______, + _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, KC_DEL, KC_END, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + + [ML] = LAYOUT_60_ansi_split( + _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + +}; diff --git a/keyboards/dz60/readme.md b/keyboards/dz60/readme.md index 78b290fbadc..a06db93b5f3 100644 --- a/keyboards/dz60/readme.md +++ b/keyboards/dz60/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make dz60:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/dz60/rules.mk b/keyboards/dz60/rules.mk index f290c305e22..ed683dbfa25 100644 --- a/keyboards/dz60/rules.mk +++ b/keyboards/dz60/rules.mk @@ -55,4 +55,4 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes -LAYOUTS = 60_ansi 60_iso 60_hhkb +LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_hhkb 60_iso diff --git a/keyboards/dztech/dz40rgb/config.h b/keyboards/dztech/dz40rgb/config.h new file mode 100644 index 00000000000..5f1502f4af1 --- /dev/null +++ b/keyboards/dztech/dz40rgb/config.h @@ -0,0 +1,32 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1220 +#define DEVICE_VER 0x0001 +#define MANUFACTURER DZTECH +#define PRODUCT DZ40RGB +#define DESCRIPTION DZ40 ARM RGB keyboard +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +#define MATRIX_ROW_PINS { B13, B12, A2, A1 } +#define MATRIX_COL_PINS {A6, A7, B0, B1, C15, C14, C13, B9, B8, A8, B14, B15 } + +/* #define UNUSED_PINS {A0,A1,A2, A3,A4,A9,A10,C15,A13,A14,B2}*/ + +#define DIODE_DIRECTION COL2ROW + +#define DEBOUNCE 3 +#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +#define RGB_MATRIX_KEYPRESSES +#define DISABLE_RGB_MATRIX_SPLASH +#define DISABLE_RGB_MATRIX_MULTISPLASH +#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH +#define DRIVER_ADDR_1 0b1010000 +#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. + +#define DRIVER_COUNT 2 diff --git a/keyboards/dztech/dz40rgb/dz40rgb.c b/keyboards/dztech/dz40rgb/dz40rgb.c new file mode 100644 index 00000000000..92e4a7cad30 --- /dev/null +++ b/keyboards/dztech/dz40rgb/dz40rgb.c @@ -0,0 +1,203 @@ +#include "dz40rgb.h" +#include "config.h" +#if defined (split_space) +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, + {0, K_1, J_1, L_1}, + + {0, K_13, J_13, L_13}, + {0, K_14, J_14, L_14}, + + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, + + {0, H_13, G_13, I_13}, + {0, H_14, G_14, I_14}, + + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, + + {0, E_13, D_13, F_13}, + {0, E_14, D_14, F_14}, + + {0, B_12, A_12, C_12}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_7, A_7, C_7}, + {0, B_6, A_6, C_6}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1} + +}; + +led_config_t g_led_config = { { + { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28 }, + { 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42 } +}, { + { 223, 0 }, { 203, 0 }, { 183, 0 }, { 162, 0 }, { 142, 0 }, { 122, 0 }, { 101, 0 }, { 81, 0 }, { 61, 0 }, { 40, 0 }, { 20, 0 }, { 0, 0 }, + { 223, 10 }, { 0, 10 }, { 223, 21 }, { 203, 21 }, { 183, 21 }, { 162, 21 }, { 142, 21 }, { 122, 21 }, { 101, 21 }, { 81, 21 }, { 61, 21 }, { 40, 21 }, + { 20, 21 }, { 0, 21 }, { 223, 31 }, { 0, 31 }, { 223, 42 }, { 203, 42 }, { 183, 42 }, { 162, 42 }, { 142, 42 }, { 122, 42 }, { 101, 42 }, { 81, 42 }, + { 61, 42 }, { 40, 42 }, { 20, 42 }, { 0, 42 }, { 223, 53 }, { 0, 53 }, { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 122, 63 }, + { 101, 63 }, { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1 +} }; + +#else +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, + {0, K_1, J_1, L_1}, + + {0, K_13, J_13, L_13}, + {0, K_14, J_14, L_14}, + + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, + + {0, H_13, G_13, I_13}, + {0, H_14, G_14, I_14}, + + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, + + {0, E_13, D_13, F_13}, + {0, E_14, D_14, F_14}, + + {0, B_12, A_12, C_12}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_13, A_13, C_13}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1} + +}; + +led_config_t g_led_config = { { + { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28 }, + { 52, 51, 50, 49, 48, NO_LED, 47, 46, 45, 44, 43, 42 } +}, { + { 223, 0 }, { 203, 0 }, { 183, 0 }, { 162, 0 }, { 142, 0 }, { 122, 0 }, { 101, 0 }, { 81, 0 }, { 61, 0 }, { 40, 0 }, { 20, 0 }, { 0, 0 }, + { 223, 10 }, { 0, 10 }, { 223, 21 }, { 203, 21 }, { 183, 21 }, { 162, 21 }, { 142, 21 }, { 122, 21 }, { 101, 21 }, { 81, 21 }, { 61, 21 }, { 40, 21 }, + { 20, 21 }, { 0, 21 }, { 223, 31 }, { 0, 31 }, { 223, 42 }, { 203, 42 }, { 183, 42 }, { 162, 42 }, { 142, 42 }, { 122, 42 }, { 101, 42 }, { 81, 42 }, + { 61, 42 }, { 40, 42 }, { 20, 42 }, { 0, 42 }, { 223, 53 }, { 0, 53 }, { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 111, 63 }, + { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 +} }; + +#endif + +void matrix_init_kb(void) { + matrix_init_user(); +} +void matrix_scan_kb(void) { + matrix_scan_user(); +} +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} diff --git a/keyboards/dztech/dz40rgb/dz40rgb.h b/keyboards/dztech/dz40rgb/dz40rgb.h new file mode 100644 index 00000000000..5f88a6225ad --- /dev/null +++ b/keyboards/dztech/dz40rgb/dz40rgb.h @@ -0,0 +1,27 @@ +#pragma once +#include "quantum.h" +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k36, k36, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_SPLIT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} diff --git a/keyboards/dztech/dz40rgb/keymaps/default/config.h b/keyboards/dztech/dz40rgb/keymaps/default/config.h new file mode 100644 index 00000000000..30bf11ed5d1 --- /dev/null +++ b/keyboards/dztech/dz40rgb/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once +#define DRIVER_1_LED_TOTAL 53 +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL diff --git a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c new file mode 100644 index 00000000000..e4f56f5a8ee --- /dev/null +++ b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c @@ -0,0 +1,71 @@ +#include QMK_KEYBOARD_H +#define _LAYER0 0 +#define _LAYER1 1 +#define _LAYER2 2 +#define _LAYER3 3 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_LAYER0] = LAYOUT( /* Base */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + RGB_MOD, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + [_LAYER1] = LAYOUT( /* FN */ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, TO(3), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + [_LAYER2] = LAYOUT( /* FN2 */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + RGB_TOG, RGB_MOD, BL_INC, BL_DEC, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + [_LAYER3] = LAYOUT( /* FN3 */ + TO(0), RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); + } + } +} + +void rgb_matrix_indicators_user(void) { + if (!g_suspend_state) { + switch (biton32(layer_state)) { + case _LAYER1: + rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; + case _LAYER2: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; + case _LAYER3: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; + } + } + +} + + + + + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; + } + diff --git a/keyboards/dztech/dz40rgb/keymaps/split_space/config.h b/keyboards/dztech/dz40rgb/keymaps/split_space/config.h new file mode 100644 index 00000000000..4f35bef3736 --- /dev/null +++ b/keyboards/dztech/dz40rgb/keymaps/split_space/config.h @@ -0,0 +1,5 @@ +#pragma once +#include "../../config.h" +#define split_space +#define DRIVER_1_LED_TOTAL 54 +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL diff --git a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c new file mode 100644 index 00000000000..04c31bab1bf --- /dev/null +++ b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c @@ -0,0 +1,96 @@ +#include QMK_KEYBOARD_H +#define _LAYER0 0 +#define _LAYER1 1 +#define _LAYER2 2 +#define _LAYER3 3 +#define _LAYER4 4 +#define _LAYER5 5 +#define _LAYER6 6 +#define _LAYER7 7 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_LAYER0] = LAYOUT_SPLIT( /* Base */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + RGB_MOD, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + [_LAYER1] = LAYOUT_SPLIT( /* FN */ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + [_LAYER2] = LAYOUT_SPLIT( /* LIGHT */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + [_LAYER3] = LAYOUT_SPLIT( /* NUMPAD */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + RGB_MOD, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + [_LAYER4] = LAYOUT_SPLIT( /* MAC */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + RGB_MOD, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + [_LAYER5] = LAYOUT_SPLIT( /* NEED TO DEFINE */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + RGB_MOD, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + [_LAYER6] = LAYOUT_SPLIT( /* NEED TO DEFINE */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + RGB_MOD, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + [_LAYER7] = LAYOUT_SPLIT( /* NEED TO DEFINE */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + RGB_MOD, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + }; + + + +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); + } + } +} + +void rgb_matrix_indicators_user(void) { + if (!g_suspend_state) { + switch (biton32(layer_state)) { + case _LAYER1: + rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; + case _LAYER2: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; + case _LAYER4: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; + case _LAYER5: + rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, false); break; + case _LAYER6: + rgb_matrix_layer_helper(0xFF, 0xFF, 0xFF, false); break; + } + } + +} + + + + + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; + } + diff --git a/keyboards/dztech/dz40rgb/rules.mk b/keyboards/dztech/dz40rgb/rules.mk new file mode 100644 index 00000000000..fc4b028d5c0 --- /dev/null +++ b/keyboards/dztech/dz40rgb/rules.mk @@ -0,0 +1,14 @@ +MCU = STM32F303 +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover +AUDIO_ENABLE = no +RGB_MATRIX_ENABLE = IS31FL3733 # Use RGB matrix +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in66666666666666666666666666 diff --git a/keyboards/dztech/dz60rgb/config.h b/keyboards/dztech/dz60rgb/config.h new file mode 100644 index 00000000000..edf0982ab20 --- /dev/null +++ b/keyboards/dztech/dz60rgb/config.h @@ -0,0 +1,42 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1219 +#define DEVICE_VER 0x0001 +#define MANUFACTURER DZTECH + +#define PRODUCT DZ60RGB +#define DESCRIPTION DZ60 ARM RGB keyboard +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +#define MATRIX_ROW_PINS { B1, B10, B11, B14, B12 } +#define MATRIX_COL_PINS {A6, A7, B0, B13, B15, A8, A15, B3, B4, B5, B8, B9, C13, C14 } + +/* #define UNUSED_PINS {A0,A1,A2, A3,A4,A9,A10,C15,A13,A14,B2}*/ + +#define DIODE_DIRECTION COL2ROW + +#define DEBOUNCE 3 +#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_LED_PROCESS_LIMIT 4 +#define RGB_MATRIX_LED_FLUSH_LIMIT 26 +#define DISABLE_RGB_MATRIX_SPLASH +#define DISABLE_RGB_MATRIX_MULTISPLASH +#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH +#define DRIVER_ADDR_1 0b1010000 +#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. +#define DRIVER_COUNT 2 +#if defined (dzrgb60_ansi) || defined (dzrgb60_iso) +#define DRIVER_1_LED_TOTAL 61 +#elif defined (dzrgb60_hhkb) || defined (dzrgb60_hhkb_iso) +#define DRIVER_1_LED_TOTAL 62 +#else +#define DRIVER_1_LED_TOTAL 63 +#endif +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL diff --git a/keyboards/dztech/dz60rgb/dz60rgb.c b/keyboards/dztech/dz60rgb/dz60rgb.c new file mode 100644 index 00000000000..0909ace2324 --- /dev/null +++ b/keyboards/dztech/dz60rgb/dz60rgb.c @@ -0,0 +1,454 @@ +#include "dz60rgb.h" +#include "config.h" +#if defined (dzrgb60_iso) +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + {0, K_14, J_14, L_14}, + {0, K_13, J_13, L_13}, + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, + {0, K_1, J_1, L_1}, + {0, H_15, G_15, I_15}, + {0, H_13, G_13, I_13}, + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, + {0, B_14, A_14, C_14}, + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, + {0, B_13, A_13, C_13}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_7, A_7, C_7}, + {0, B_6, A_6, C_6}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1}, + {0, B_15, A_15, C_15}, + {0, E_13, D_13, F_13}, + {0, B_12, A_12, C_12}, + {0, E_15, D_15, F_15}, + {0, B_16, A_16, C_16}, + {0, E_16, D_16, F_16}, + {0, H_16, G_16, I_16}, + {0, K_16, J_16, L_16}, +}; + +led_config_t g_led_config = { { + { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 28 }, + { 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, NO_LED, 14 }, + { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, NO_LED }, + { 60, 59, 58, NO_LED, NO_LED, 57, NO_LED, NO_LED, NO_LED, 56, 55, 54, NO_LED, 53 } +}, { + { 216, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, { 0, 0 }, + { 220, 24 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, { 4, 16 }, + { 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, { 210, 48 }, + { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 222, 64 }, { 202, 64 }, { 182, 64 }, + { 162, 64 }, { 102, 64 }, { 42, 64 }, { 22, 64 }, { 2, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, + 1, 4, 1, 1, 1 +} }; + +#elif defined (dzrgb60_hhkb) +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + {0, H_15, G_15, I_15}, + {0, K_14, J_14, L_14}, + {0, K_13, J_13, L_13}, + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, + {0, K_1, J_1, L_1}, + {0, H_14, G_14, I_14}, + {0, H_13, G_13, I_13}, + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, + {0, E_14, D_14, F_14}, + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, + {0, B_14, A_14, C_14}, + {0, B_13, A_13, C_13}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_7, A_7, C_7}, + {0, B_6, A_6, C_6}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1}, + {0, B_15, A_15, C_15}, + {0, E_13, D_13, F_13}, + {0, B_12, A_12, C_12}, + {0, B_16, A_16, C_16}, + {0, E_16, D_16, F_16}, + {0, H_16, G_16, I_16}, + {0, K_16, J_16, L_16}, +}; + +led_config_t g_led_config = { { + { 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }, + { 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15 }, + { 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 0, 29 }, + { 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, NO_LED, 42 }, + { 61, 60, 59, NO_LED, NO_LED, 58, NO_LED, NO_LED, NO_LED, NO_LED, 57, 56, NO_LED, 55 } +}, { + { 224, 0 }, { 208, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, + { 0, 0 }, { 220, 16 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, + { 4, 16 }, { 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, + { 224, 48 }, { 202, 48 }, { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 218, 64 }, + { 198, 64 }, { 178, 64 }, { 112, 64 }, { 46, 64 }, { 26, 64 }, { 6, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 4, 1, 1, 1 +} }; + +#elif defined (dzrgb60_hhkb_iso) +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + {0, H_15, G_15, I_15}, + {0, K_14, J_14, L_14}, + {0, K_13, J_13, L_13}, + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, + {0, K_1, J_1, L_1}, + {0, K_15, J_15, L_15}, + {0, H_13, G_13, I_13}, + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, + {0, E_15, D_15, F_15}, + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, + {0, B_14, A_14, C_14}, + {0, B_13, A_13, C_13}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_7, A_7, C_7}, + {0, B_6, A_6, C_6}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1}, + {0, B_15, A_15, C_15}, + {0, E_13, D_13, F_13}, + {0, B_12, A_12, C_12}, + {0, B_16, A_16, C_16}, + {0, E_16, D_16, F_16}, + {0, H_16, G_16, I_16}, + {0, K_16, J_16, L_16}, +}; + +led_config_t g_led_config = { { + { 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }, + { 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29 }, + { 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 0, 15 }, + { 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, NO_LED, 42 }, + { 61, 60, 59, NO_LED, NO_LED, 58, NO_LED, NO_LED, NO_LED, NO_LED, 57, 56, NO_LED, 55 } +}, { + { 224, 0 }, { 208, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, + { 0, 0 }, { 220, 24 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, + { 4, 16 }, { 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, + { 224, 48 }, { 202, 48 }, { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 218, 64 }, + { 198, 64 }, { 178, 64 }, { 112, 64 }, { 46, 64 }, { 26, 64 }, { 6, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 4, 1, 1, 1 +} }; + +#elif defined (dzrgb60_ansi) +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + {0, K_14, J_14, L_14}, + {0, K_13, J_13, L_13}, + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, + {0, K_1, J_1, L_1}, + {0, H_14, G_14, I_14}, + {0, H_13, G_13, I_13}, + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, + {0, E_14, D_14, F_14}, + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, + {0, B_13, A_13, C_13}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_7, A_7, C_7}, + {0, B_6, A_6, C_6}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1}, + {0, B_15, A_15, C_15}, + {0, E_13, D_13, F_13}, + {0, B_12, A_12, C_12}, + {0, E_15, D_15, F_15}, + {0, B_16, A_16, C_16}, + {0, E_16, D_16, F_16}, + {0, H_16, G_16, I_16}, + {0, K_16, J_16, L_16}, +}; + +led_config_t g_led_config = { { + { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, NO_LED, 28 }, + { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, NO_LED }, + { 60, 59, 58, NO_LED, NO_LED, 57, NO_LED, NO_LED, NO_LED, 56, 55, 54, NO_LED, 53 } +}, { + { 216, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, { 0, 0 }, + { 220, 16 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, { 4, 16 }, + { 214, 24 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, { 210, 48 }, + { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 222, 64 }, { 202, 64 }, { 182, 64 }, + { 162, 64 }, { 102, 64 }, { 42, 64 }, { 22, 64 }, { 2, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, + 1, 4, 1, 1, 1 +} }; + +#else +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + {0, K_14, J_14, L_14}, + {0, K_13, J_13, L_13}, + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, + {0, K_1, J_1, L_1}, + {0, H_14, G_14, I_14}, + {0, H_13, G_13, I_13}, + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, + {0, E_14, D_14, F_14}, + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, + {0, B_14, A_14, C_14}, + {0, B_13, A_13, C_13}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_7, A_7, C_7}, + {0, B_6, A_6, C_6}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1}, + {0, B_15, A_15, C_15}, + {0, E_13, D_13, F_13}, + {0, B_12, A_12, C_12}, + {0, E_15, D_15, F_15}, + {0, H_15, G_15, I_15}, + {0, B_16, A_16, C_16}, + {0, E_16, D_16, F_16}, + {0, H_16, G_16, I_16}, + {0, K_16, J_16, L_16}, +}; + +led_config_t g_led_config = { { + { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, NO_LED, 28 }, + { 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, NO_LED, 41 }, + { 62, 61, 60, NO_LED, NO_LED, 59, NO_LED, NO_LED, 58, 57, 56, 55, NO_LED, 54 } +}, { + { 216, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, { 0, 0 }, + { 220, 16 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, { 4, 16 }, + { 214, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, { 224, 48 }, + { 208, 48 }, { 186, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 36, 48 }, { 9, 48 }, { 224, 64 }, { 208, 64 }, + { 192, 64 }, { 176, 64 }, { 160, 64 }, { 102, 64 }, { 42, 64 }, { 22, 64 }, { 2, 64 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, + 1, 1, 1, 4, 1, 1, 1 +} }; + + +#endif + +void matrix_init_kb(void) { + matrix_init_user(); +} +void matrix_scan_kb(void) { + matrix_scan_user(); +} +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} diff --git a/keyboards/dztech/dz60rgb/dz60rgb.h b/keyboards/dztech/dz60rgb/dz60rgb.h new file mode 100644 index 00000000000..1884ddfb0b8 --- /dev/null +++ b/keyboards/dztech/dz60rgb/dz60rgb.h @@ -0,0 +1,72 @@ +#pragma once +#define XXX KC_NO +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K45, K48, K49, K4A, K4B, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, K48, K49, K4A, K4B, XXX, K4D } \ +} +#define LAYOUT_ISO( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K41, K42, K45, K49, K4A, K4B, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, XXX }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, K4B, XXX, K4D } \ +} + +#define LAYOUT_HHKB( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D,\ + K40, K41, K42, K45, K4A, K4B, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, XXX, K4A, K4B, XXX, K4D } \ +} + +#define LAYOUT_HHKB_ISO( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K45, K4A, K4B, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D,}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, XXX, K4A, K4B, XXX, K4D } \ +} + +#define LAYOUT_ANSI( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K41, K42, K45, K49, K4A, K4B, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, XXX }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, K4B, XXX, K4D } \ +} diff --git a/keyboards/dztech/dz60rgb/info.json b/keyboards/dztech/dz60rgb/info.json new file mode 100644 index 00000000000..d615fe53db5 --- /dev/null +++ b/keyboards/dztech/dz60rgb/info.json @@ -0,0 +1,17 @@ +{ + "keyboard_name": "dz60rgb", + "url": "", + "maintainer": "dztch", + "width": 14, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 63, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"Shift", "x":11.25, "y":3, "w":1.75}, {"label":"\u2191", "x":13, "y":3},{"label":"?", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Ctrl", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4}] + }, + "LAYOUT_ANSI": { + "key_count": 61, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/config.h b/keyboards/dztech/dz60rgb/keymaps/ansi/config.h new file mode 100644 index 00000000000..4bfad0df0df --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/ansi/config.h @@ -0,0 +1,2 @@ +#pragma once +#define dzrgb60_ansi diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c new file mode 100644 index 00000000000..8633b1836a9 --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c @@ -0,0 +1,78 @@ +#include QMK_KEYBOARD_H +#define _LAYER0 0 +#define _LAYER1 1 +#define _LAYER2 2 +#define _LAYER3 3 +#define _LAYER4 4 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_LAYER0] = LAYOUT_ANSI( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH,\ + CTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), MO(2), KC_RCTL), + [_LAYER1] = LAYOUT_ANSI( /* FN */ + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET ,\ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS,\ + KC_MPRV, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDOWN,KC_MNXT, \ + KC_TRNS, KC_TRNS, KC_TRNS, TO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [_LAYER2] = LAYOUT_ANSI( /* FN2 */ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_TRNS, RGB_TOG, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, RESET ,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [_LAYER3] = LAYOUT_ANSI( /* FN3 */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH,\ + CTL_T(KC_CAPS),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_TRNS,MO(4), KC_RALT, KC_RCTL), + [_LAYER4] = LAYOUT_ANSI( /* FN4 */ + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_TRNS, RGB_TOG, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_MOD, KC_PSCR, KC_SLCK, KC_PAUS, RESET ,\ + KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPI, RGB_SPD, KC_HOME, KC_PGUP, KC_TRNS,\ + KC_MPRV, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDOWN,KC_MNXT, \ + KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + }; + +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); + } + } +} + +void rgb_matrix_indicators_user(void) { + uint8_t this_led = host_keyboard_leds(); + if (!g_suspend_state) { + switch (biton32(layer_state)) { + case _LAYER1: + rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; + case _LAYER2: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; + case _LAYER3: + rgb_matrix_layer_helper(0x00, 0x00, 0xFF, false); break; + case _LAYER4: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; + } + } + if ( this_led & (1< 255 ? 255 : hsv.s + 16; + sad.s = hsv.s - 16 < 0 ? 0 : hsv.s - 16; + vai.v = hsv.v + 16 > 255 ? 255 : hsv.v + 16; + vad.v = hsv.v - 16 < 0 ? 0 : hsv.v - 16; + RGB rgb = hsv_to_rgb(hsv); + RGB rgbHUI = hsv_to_rgb(hui); + RGB rgbHUD = hsv_to_rgb(hud); + RGB rgbSAI = hsv_to_rgb(sai); + RGB rgbSAD = hsv_to_rgb(sad); + RGB rgbVAI = hsv_to_rgb(vai); + RGB rgbVAD = hsv_to_rgb(vad); + rgb_matrix_set_color(41, 0xFF, 0xFF, 0xFF); // layer indicator + rgb_matrix_set_color(59, rgb.r, rgb.g, rgb.b); // color indicator + rgb_matrix_set_color(26, 0xFF, 0x80, 0x00); //MOD + rgb_matrix_set_color(39, 0xFF, 0x80, 0x00); //MOD + rgb_matrix_set_color(16, 0xFF, 0x80, 0x00); //RGB_RMOD + rgb_matrix_set_color(15, 0xFF, 0x80, 0x00); //MOD + rgb_matrix_set_color(52, 0xFF, 0x40, 0x00); //TOG + rgb_matrix_set_color(25, 0x80, 0x80, 0x80); //SPI + rgb_matrix_set_color(38, 0x80, 0x80, 0x80); //SPD + rgb_matrix_set_color(24, rgbHUI.r, rgbHUI.g, rgbHUI.b); //HUI + rgb_matrix_set_color(37, rgbHUD.r, rgbHUD.g, rgbHUD.b); //HUD + rgb_matrix_set_color(23, rgbSAI.r, rgbSAI.g, rgbSAI.b); //SAI + rgb_matrix_set_color(36, rgbSAD.r, rgbSAD.g, rgbSAD.b); //SAD + rgb_matrix_set_color(22, rgbVAI.r, rgbVAI.g, rgbVAI.b); //VAI + rgb_matrix_set_color(35, rgbVAD.r, rgbVAD.g, rgbVAD.b); //VAD + rgb_matrix_set_color(19, 0xF0, 0x00, 0xFF); //MAS_MGT + rgb_matrix_set_color(18, 0x00, 0x02, 0xFF); //MAS_BLU + rgb_matrix_set_color(33, 0xFF, 0x00, 0x00); //MAS_RED + rgb_matrix_set_color(32, 0x00, 0x00, 0x00); //MAS_KEY + rgb_matrix_set_color(31, 0x00, 0xFF, 0xF7); //MAS_CYN + rgb_matrix_set_color(46, 0xFF, 0xDA, 0x00); //MAS_YEL + rgb_matrix_set_color(45, 0x00, 0xFF, 0x01); //MAS_GRN + rgb_matrix_set_color(44, 0xFF, 0xA5, 0x18); //MAS_CRM + rgb_matrix_set_color(30, 0x81, 0x3C, 0xFF); //MAS_PRP + rgb_matrix_set_color(17, 0xFF, 0xFF, 0xFF); //MAS_WHT + } + break; + + case _FNC: + rgb_matrix_set_color(57, 0xFF, 0xFF, 0xFF); // layer indicator + rgb_matrix_set_color(48, 0xFF, 0x00, 0x00); // bootloader + rgb_matrix_set_color(42, 0x00, 0x80, 0xFF); // vol + rgb_matrix_set_color(55, 0x00, 0x80, 0xFF); + rgb_matrix_set_color(58, 0xFF, 0x00, 0x00); // mute + rgb_matrix_set_color(56, 0xFF, 0x80, 0x00); // ctrl+left/right + rgb_matrix_set_color(54, 0xFF, 0x80, 0x00); + rgb_matrix_set_color(41, 0xFF, 0x00, 0x40); // ctrl+delete + rgb_matrix_set_color(43, 0xFF, 0x00, 0x40); // ctrl+slash + + if (this_led & (1 << !autoshift_enabled)) { + rgb_matrix_set_color(0, 0xFF, 0x00, 0x00); // KC_ASTG + } else { + rgb_matrix_set_color(0, 0xFF, 0xFF, 0x00); + } + + break; + } + } + + if (this_led & (1 << USB_LED_CAPS_LOCK)) { + rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); + } +} + +void matrix_init_user(void) +{ + //user initialization + autoshift_disable(); +} + +void matrix_scan_user(void) +{ + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t* record) +{ + static uint32_t key_timer; + + switch (keycode) { + case REBOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + rgb_matrix_enable_noeeprom(); + rgb_matrix_mode_noeeprom(1); + rgb_matrix_sethsv_noeeprom(11, 11, 11); + wait_ms(150); + reset_keyboard(); + } else { + register_code(KC_RCTL); + tap_code(KC_B); + unregister_code(KC_RCTL); + } + } + + return false; + + case MAS_CRM: + if (record->event.pressed) { + rgb_matrix_sethsv(32, 160, 255); + } + + return false; + + case MAS_PRP: + if (record->event.pressed) { + rgb_matrix_sethsv(192, 112, 255); + } + + return false; + + case MAS_RED: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 255, 255); + } + + return false; + + case MAS_GRN: + if (record->event.pressed) { + rgb_matrix_sethsv(88, 255, 255); + } + + return false; + + case MAS_BLU: + if (record->event.pressed) { + rgb_matrix_sethsv(168, 255, 255); + } + + return false; + + case MAS_CYN: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 255, 255); + } + + return false; + + case MAS_MGT: + if (record->event.pressed) { + rgb_matrix_sethsv(216, 255, 255); + } + + return false; + + case MAS_YEL: + if (record->event.pressed) { + rgb_matrix_sethsv(40, 255, 255); + } + + return false; + + case MAS_KEY: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 0, 0); + } + + return false; + + case MAS_WHT: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 0, 255); + } + + return false; + + default: + return true; + } +} diff --git a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk new file mode 100644 index 00000000000..15b8ec1bafc --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk @@ -0,0 +1,7 @@ +NKRO_ENABLE = yes # USB Nkey Rollover +AUTO_SHIFT_ENABLE = yes # Auto Shift +# VELOCIKEY_ENABLE = yes + +EXTRAFLAGS += -flto + +# SRC += dz60rgb.c diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c new file mode 100644 index 00000000000..11afb22d9b0 --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c @@ -0,0 +1,173 @@ +#include QMK_KEYBOARD_H +#define _LAYER0 0 +#define _LAYER1 1 +#define _LAYER2 2 +#define _LAYER3 3 +#define _LAYER4 4 +#define _LAYER5 5 +#define _LAYER6 6 +#define _LAYER7 7 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_LAYER0] = LAYOUT( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \ + CTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL), \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(1) , KC_LEFT, KC_DOWN, KC_RIGHT), + [_LAYER1] = LAYOUT( /* FN */ + TO(3), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL , \ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET , \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDOWN, KC_VOLU, KC_MUTE, \ + KC_TRNS, KC_TRNS, KC_TRNS, TO(4), KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), + [_LAYER2] = LAYOUT( /* LIGHT */ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL , \ + KC_TRNS, RGB_TOG, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, RESET , \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [_LAYER3] = LAYOUT( /* NUMPAD */ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_TRNS, \ + KC_TRNS, KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, TO(0), \ + KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_PENT, \ + KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_P0, KC_PDOT, KC_PENT, KC_P0, KC_PDOT, KC_TRNS, KC_TRNS, KC_TRNS), + [_LAYER4] = LAYOUT( /* MAC */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \ + CTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL), \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(5) , KC_LEFT, KC_DOWN, KC_RIGHT), + [_LAYER5] = LAYOUT( /* FN */ + TO(3), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL , \ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET , \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDOWN, KC_VOLU, KC_MUTE, \ + KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), +} +; + + + +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); + } + } +} + +void rgb_matrix_indicators_user(void) +{ + uint8_t this_led = host_keyboard_leds(); + + if (!g_suspend_state) { + switch (biton32(layer_state)) { + case _LAYER1: + rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; + + case _LAYER2: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; + + case _LAYER4: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; + } + } + + if (this_led & (1 << USB_LED_CAPS_LOCK)) { + rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); + } + + switch (biton32(layer_state)) { + case _LAYER3: + if (this_led & (1 << USB_LED_NUM_LOCK)) { + rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); + } else { + rgb_matrix_set_color(13, 0x00, 0x00, 0x00); + } + + rgb_matrix_set_color(0, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(1, 0x00, 0x00, 0x00); + rgb_matrix_set_color(1, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(2, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(3, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(4, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(5, 0x00, 0x00, 0x00); + rgb_matrix_set_color(6, 0x00, 0x00, 0x00); + rgb_matrix_set_color(7, 0x00, 0x00, 0x00); + rgb_matrix_set_color(8, 0x00, 0x00, 0x00); + rgb_matrix_set_color(9, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(10, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(11, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(12, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(14, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(15, 0x00, 0x00, 0x00); + rgb_matrix_set_color(16, 0x00, 0x00, 0x00); + rgb_matrix_set_color(17, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(18, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(19, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(20, 0x00, 0x00, 0x00); + rgb_matrix_set_color(21, 0x00, 0x00, 0x00); + rgb_matrix_set_color(22, 0x00, 0x00, 0x00); + rgb_matrix_set_color(23, 0x00, 0x00, 0x00); + rgb_matrix_set_color(24, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(25, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(26, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(27, 0x00, 0x00, 0x00); + rgb_matrix_set_color(28, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(29, 0x00, 0x00, 0x00); + rgb_matrix_set_color(30, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(31, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(33, 0x00, 0x00, 0x00); + rgb_matrix_set_color(34, 0x00, 0x00, 0x00); + rgb_matrix_set_color(35, 0x00, 0x00, 0x00); + rgb_matrix_set_color(36, 0x00, 0x00, 0x00); + rgb_matrix_set_color(37, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(38, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(39, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(40, 0x00, 0x00, 0x00); + rgb_matrix_set_color(41, 0x00, 0x00, 0x00); + rgb_matrix_set_color(42, 0x00, 0x00, 0x00); + rgb_matrix_set_color(43, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(44, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(45, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(46, 0x00, 0x00, 0x00); + rgb_matrix_set_color(47, 0x00, 0x00, 0x00); + rgb_matrix_set_color(48, 0x00, 0x00, 0x00); + rgb_matrix_set_color(49, 0x00, 0x00, 0x00); + rgb_matrix_set_color(50, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(51, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(52, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(53, 0x00, 0x00, 0x00); + rgb_matrix_set_color(54, 0x00, 0x00, 0x00); + rgb_matrix_set_color(55, 0x00, 0x00, 0x00); + rgb_matrix_set_color(56, 0x00, 0x00, 0x00); + rgb_matrix_set_color(57, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(58, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(59, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(60, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(61, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(62, 0x00, 0x00, 0x00); + break; + } +} + + + + + +void matrix_init_user(void) +{ + //user initialization +} + +void matrix_scan_user(void) +{ + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t* record) +{ + return true; +} diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/readme.md b/keyboards/dztech/dz60rgb/keymaps/mekanist/readme.md new file mode 100644 index 00000000000..e85200457e3 --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/readme.md @@ -0,0 +1,34 @@ +# mekanist keymap instructions + +## Dev Environment setup (macOS) + +1. Install Homebrew by copy pasting the following into a terminal: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` + +2. Refer to the [QMK macOS Instructions](https://github.com/qmk/qmk_firmware/blob/master/docs/getting_started_build_tools.md#macos) and install the list of tools using the `brew` command in terminal. + +3. While in terminal, issue the following command within the directory you wish to clone qmk_firmware in. + + ``` + git clone https://github.com/qmk/qmk_firmware.git + ``` + +## Creating the mekanist dz60rgb firmware file + +1. While in the `qmk_firmware` directory, issue the following command + + ``` + make git-submodule + ``` + + This will download the chibi-os submoduled needed to create firmware for ARM based boards such as the dz60rgb. + +2. While in the `qmk_firmware` directory, issue the followng command + + ``` + make dztech/dz60rgb:mekanist + ``` + + This will result in a file called `dztech_dz60rgb_mekanist.bin` that you can flash onto your board using QMK Toolbox. diff --git a/keyboards/dztech/dz60rgb/readme.md b/keyboards/dztech/dz60rgb/readme.md new file mode 100644 index 00000000000..a8dbb5af645 --- /dev/null +++ b/keyboards/dztech/dz60rgb/readme.md @@ -0,0 +1,15 @@ +# DZ60RGB + +![dz60rgb](https://cdn.shopify.com/s/files/1/0043/9140/3591/products/TIM_20190130170231_grande.jpg?v=1548839053) + +A customizable 60% RGB keyboard. + +Keyboard Maintainer: DZtech +Hardware Supported: DZtech +Hardware Availability: [kbdfans](https://kbdfans.myshopify.com/) + +Make example for this keyboard (after setting up your build environment): + + make dztech/dz60rgb:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/dztech/dz60rgb/rules.mk b/keyboards/dztech/dz60rgb/rules.mk new file mode 100644 index 00000000000..8ff1cbdc296 --- /dev/null +++ b/keyboards/dztech/dz60rgb/rules.mk @@ -0,0 +1,14 @@ +MCU = STM32F303 +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover +AUDIO_ENABLE = no +RGB_MATRIX_ENABLE = IS31FL3733 # Use RGB matrix +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in diff --git a/keyboards/dztech/dz65rgb/config.h b/keyboards/dztech/dz65rgb/config.h new file mode 100644 index 00000000000..f4c1f111493 --- /dev/null +++ b/keyboards/dztech/dz65rgb/config.h @@ -0,0 +1,29 @@ +#pragma once +#include "config_common.h" +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1224 +#define DEVICE_VER 0x0001 +#define MANUFACTURER DZTECH +#define PRODUCT DZ65RGB +#define DESCRIPTION DZ65 ARM RGB keyboard + +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 +#define MATRIX_ROW_PINS { B1, B10, B11, B14, B12 } +#define MATRIX_COL_PINS {A6, A7, B0, B13, B15, A8, A15, B3, B4, B5, B8, B9, C13, C14, C15 } +#define DIODE_DIRECTION COL2ROW + +#define RGB_MATRIX_LED_PROCESS_LIMIT 4 +#define RGB_MATRIX_LED_FLUSH_LIMIT 26 +#define DEBOUNCE 3 +#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 180 + +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110111 +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 35 +#define DRIVER_2_LED_TOTAL 33 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) diff --git a/keyboards/dztech/dz65rgb/dz65rgb.c b/keyboards/dztech/dz65rgb/dz65rgb.c new file mode 100644 index 00000000000..932d3f68b6c --- /dev/null +++ b/keyboards/dztech/dz65rgb/dz65rgb.c @@ -0,0 +1,116 @@ +#include "dz65rgb.h" +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + {0, C2_1, C3_1, C4_1}, // LA0 + {0, C1_1, C3_2, C4_2}, // LA1 + {0, C1_2, C2_2, C4_3}, // LA2 + {0, C1_3, C2_3, C3_3}, // LA3 + {0, C1_4, C2_4, C3_4}, // LA4 + {0, C1_5, C2_5, C3_5}, // LA5 + {0, C1_6, C2_6, C3_6}, // LA6 + {0, C1_7, C2_7, C3_7}, // LA7 + {0, C1_8, C2_8, C3_8}, // LA8 + {0, C9_1, C8_1, C7_1}, // LA9 + {0, C9_2, C8_2, C7_2}, // LA10 + {0, C9_3, C8_3, C7_3}, // LA11 + {0, C9_4, C8_4, C7_4}, // LA12 + {0, C9_5, C8_5, C7_5}, // LA13 + {0, C9_6, C8_6, C7_6}, // LA14 + {0, C9_7, C8_7, C6_6}, // LA15 + {0, C9_8, C7_7, C6_7}, // LA16 + {0, C8_8, C7_8, C6_8}, // LA17 + {0, C2_9, C3_9, C4_9}, // LB0 + {0, C1_9, C3_10, C4_10}, // LB1 + {0, C1_10, C2_10, C4_11}, // LB2 + {0, C1_11, C2_11, C3_11}, // LB3 + //{0, C1_12, C2_12, C3_12}, // LB4 + {0, C1_13, C2_13, C3_13}, // LB5 + {0, C1_14, C2_14, C3_14}, // LB6 + {0, C1_15, C2_15, C3_15}, // LB7 + {0, C1_16, C2_16, C3_16}, // LB8 + {0, C9_9, C8_9, C7_9}, // LB9 + {0, C9_10, C8_10, C7_10}, // LB10 + {0, C9_11, C8_11, C7_11}, // LB11 + {0, C9_12, C8_12, C7_12}, // LB12 + {0, C9_13, C8_13, C7_13}, // LB13 + {0, C9_14, C8_14, C7_14}, // LB14 + {0, C9_15, C8_15, C6_14}, // LB15 + {0, C9_16, C7_15, C6_15}, // LB16 + {0, C8_16, C7_16, C6_16}, // LB17 + {1, C2_1, C3_1, C4_1}, // LC0 + {1, C1_1, C3_2, C4_2}, // LC1 + {1, C1_2, C2_2, C4_3}, // LC2 + {1, C1_3, C2_3, C3_3}, // LC3 + {1, C1_4, C2_4, C3_4}, // LC4 + {1, C1_5, C2_5, C3_5}, // LC5 + //{1, C1_6, C2_6, C3_6}, // LC6 + {1, C1_7, C2_7, C3_7}, // LC7 + {1, C1_8, C2_8, C3_8}, // LC8 + {1, C9_1, C8_1, C7_1}, // LC9 + {1, C9_2, C8_2, C7_2}, // LC10 + {1, C9_3, C8_3, C7_3}, // LC11 + {1, C9_4, C8_4, C7_4}, // LC12 + {1, C9_5, C8_5, C7_5}, // LC13 + {1, C9_6, C8_6, C7_6}, // LC14 + //{1, C9_7, C8_7, C6_6}, // LC15 + {1, C9_8, C7_7, C6_7}, // LC16 + {1, C8_8, C7_8, C6_8}, // LC17 + {1, C2_9, C3_9, C4_9}, // LD0 + {1, C1_9, C3_10, C4_10}, // LD1 + {1, C1_10, C2_10, C4_11}, // LD2 + {1, C1_11, C2_11, C3_11}, // LD3 + {1, C1_12, C2_12, C3_12}, // LD4 + {1, C1_13, C2_13, C3_13}, // LD5 + {1, C1_14, C2_14, C3_14}, // LD6 + {1, C1_15, C2_15, C3_15}, // LD7 + {1, C1_16, C2_16, C3_16}, // LD8 + {1, C9_9, C8_9, C7_9}, // LD9 + {1, C9_10, C8_10, C7_10}, // LD10 + {1, C9_11, C8_11, C7_11}, // LD11 + {1, C9_12, C8_12, C7_12}, // LD12 + //{1, C9_13, C8_13, C7_13}, // LD13 + {1, C9_14, C8_14, C7_14}, // LD14 + {1, C9_15, C8_15, C6_14}, // LD15 + {1, C9_16, C7_15, C6_15}, // LD16 + {1, C8_16, C7_16, C6_16}, // LD17 +}; + +led_config_t g_led_config = { { + { 17, 16, 15, 14, 13, 12, 11, 10, 9, 18, 19, 20, 21, 22, 23 }, + { 7, 6, 5, 4, 3, 2, 1, 0, 26, 27, 28, 29, 30, 31, 24 }, + { 8, 48, 47, 46, 45, 44, 43, 51, 52, 53, 54, 55, NO_LED, 56, 25 }, + { 49, 40, 39, 38, 37, 36, 60, 61, 62, 63, 57, 58, NO_LED, 59, 32 }, + { 50, 42, 41, NO_LED, NO_LED, 35, NO_LED, NO_LED, 64, 65, 66, 67, NO_LED, 34, 33 } +}, { + { 112, 16 }, { 96, 16 }, { 80, 16 }, { 64, 16 }, { 48, 16 }, { 32, 16 }, { 16, 16 }, { 0, 16 }, { 0, 32 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, + { 32, 0 }, { 16, 0 }, { 0, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 208, 0 }, { 224, 0 }, { 224, 16 }, { 224, 32 }, { 128, 16 }, { 144, 16 }, { 160, 16 }, { 176, 16 }, + { 192, 16 }, { 208, 16 }, { 224, 48 }, { 224, 64 }, { 208, 64 }, { 80, 64 }, { 80, 48 }, { 64, 48 }, { 48, 48 }, { 32, 48 }, { 16, 48 }, { 32, 64 }, { 16, 64 }, { 96, 32 }, { 80, 32 }, + { 64, 32 }, { 48, 32 }, { 32, 32 }, { 16, 32 }, { 0, 48 }, { 0, 64 }, { 112, 32 }, { 128, 32 }, { 144, 32 }, { 160, 32 }, { 176, 32 }, { 208, 32 }, { 160, 48 }, { 176, 48 }, { 208, 48 }, + { 96, 48 }, { 112, 48 }, { 128, 48 }, { 144, 48 }, { 128, 64 }, { 144, 64 }, { 160, 64 }, { 176, 64 } +}, { + 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 1, 1, 4, 4, + 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 1, 1, 1, 1 +} }; + +void matrix_init_kb(void) { + matrix_init_user(); +} +void matrix_scan_kb(void) { + matrix_scan_user(); +} +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} diff --git a/keyboards/dztech/dz65rgb/dz65rgb.h b/keyboards/dztech/dz65rgb/dz65rgb.h new file mode 100644 index 00000000000..b251a339f91 --- /dev/null +++ b/keyboards/dztech/dz65rgb/dz65rgb.h @@ -0,0 +1,16 @@ +#pragma once +#define XXX KC_NO +#include "quantum.h" +#define LAYOUT_65_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K45, K48, K49, K4A, K4B, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, K48, K49, K4A, K4B, XXX, K4D, K4E } \ +} diff --git a/keyboards/dztech/dz65rgb/info.json b/keyboards/dztech/dz65rgb/info.json new file mode 100644 index 00000000000..fe61e5d9733 --- /dev/null +++ b/keyboards/dztech/dz65rgb/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "dz65rgb", + "url": "", + "maintainer": "dztch", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_65_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2},{"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5},{"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75},{"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/dztech/dz65rgb/keymaps/default/keymap.c b/keyboards/dztech/dz65rgb/keymaps/default/keymap.c new file mode 100644 index 00000000000..dae08a48c67 --- /dev/null +++ b/keyboards/dztech/dz65rgb/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +#include QMK_KEYBOARD_H +#define _LAYER0 0 +#define _LAYER1 1 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_LAYER0] = LAYOUT_65_ansi( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, KC_PGUP,\ + CTL_T(KC_CAPS),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + [_LAYER1] = LAYOUT_65_ansi( /* FN */ + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME,\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI,RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP,\ + CTL_T(KC_CAPS),RGB_SPI, RGB_SPD, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, EEP_RST, KC_PGDN,\ + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_MUTE,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), +}; + +void rgb_matrix_indicators_user(void) +{ + if (IS_LED_ON(host_keyboard_leds(), USB_LED_CAPS_LOCK)) + { + rgb_matrix_set_color(8, 0xFF, 0xFF, 0xFF); + } +} + +void matrix_init_user(void) +{ + //user initialization +} + +void matrix_scan_user(void) +{ + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + return true; +} diff --git a/keyboards/dztech/dz65rgb/readme.md b/keyboards/dztech/dz65rgb/readme.md new file mode 100644 index 00000000000..7f8aad95f87 --- /dev/null +++ b/keyboards/dztech/dz65rgb/readme.md @@ -0,0 +1,14 @@ +# DZ65RGB + +A customizable 65% RGB keyboard. + +Keyboard Maintainer: [DZtech](http://keyboarddiy.taobao.com) +Hardware Supported: [DZtech](http://keyboarddiy.taobao.com) +Hardware Availability: [kbdfans](https://kbdfans.myshopify.com/) + + +Make example for this keyboard (after setting up your build environment): + + make dztech/dz65rgb:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/dztech/dz65rgb/rules.mk b/keyboards/dztech/dz65rgb/rules.mk new file mode 100644 index 00000000000..bf392b4faad --- /dev/null +++ b/keyboards/dztech/dz65rgb/rules.mk @@ -0,0 +1,14 @@ +MCU = STM32F303 +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no +RGB_MATRIX_ENABLE = yes # Use RGB matrix + +LAYOUTS = 65_ansi diff --git a/keyboards/e6v2/le/config.h b/keyboards/e6v2/le/config.h deleted file mode 100644 index e1554515034..00000000000 --- a/keyboards/e6v2/le/config.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0002 -#define MANUFACTURER Exclusive / E-Team -#define PRODUCT E6-V2 LE -#define DESCRIPTION E6-V2 LE QMK PCB (Mid-Port) - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* QMK E6-V2 PCB default pin-out */ -#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } -#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } -#define UNUSED_PINS - -#define RGB_DI_PIN E6 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#endif - -#define BACKLIGHT_PIN B6 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 2 -#define BACKLIGHT_BREAHTING -#define BREATHING_PERIOD 3 -#endif - -#define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 - -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ - ) - - - -#endif diff --git a/keyboards/e6v2/le/readme.md b/keyboards/e6v2/le/readme.md deleted file mode 100644 index 20848a2bc0c..00000000000 --- a/keyboards/e6v2/le/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# E6-V2 Last Edition (LE) - -These docs are for the QMK version of the E6-V2 PCB. [More info on qmk.fm](http://qmk.fm/) - -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: E6-V2 LE Mid Port rev.qmk -Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0) - -**Please do not flash LE firmware on OE hardware.** - -Make example for this keyboard (after setting up your build environment): - - make e6v2/le:default - -Or to make and flash: - - make e6v2/le:default:dfu - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/e6v2/le/rules.mk b/keyboards/e6v2/le/rules.mk deleted file mode 100644 index 7d28042d85c..00000000000 --- a/keyboards/e6v2/le/rules.mk +++ /dev/null @@ -1,70 +0,0 @@ -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE = yes -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 - -LAYOUTS = 60_ansi \ No newline at end of file diff --git a/keyboards/e6v2/oe/config.h b/keyboards/e6v2/oe/config.h deleted file mode 100644 index b80afcb51ae..00000000000 --- a/keyboards/e6v2/oe/config.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0002 -#define MANUFACTURER Exclusive / E-Team -#define PRODUCT E6-V2 -#define DESCRIPTION E6-V2 QMK PCB (Mid-Port) - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* QMK E6-V2 PCB default pin-out */ -#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } -#define MATRIX_COL_PINS { C7, C6, B5, B4, D7, D6, D4, F6, F7, F5, F4, F1, F0, B0, B1 } -#define UNUSED_PINS { E6, B2, B3, B7 } - -#define RGB_DI_PIN E2 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#endif - -#define BACKLIGHT_PIN B6 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 5 -#define BACKLIGHT_BREAHTING -#define BREATHING_PERIOD 3 -#endif - -#define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 - -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ - ) - - - -#endif diff --git a/keyboards/e6v2/oe/readme.md b/keyboards/e6v2/oe/readme.md deleted file mode 100644 index 3e1c5753083..00000000000 --- a/keyboards/e6v2/oe/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# E6-V2 Original Edition (OE) - -These docs are for the QMK version of the E6-V2 PCB. [More info on qmk.fm](http://qmk.fm/) - -Keyboard Maintainer: [amnesia0287](https://github.com/amnesia0287) -Hardware Supported: E6-V2 OE Mid Port rev.qmk -Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0) - -**Please do not flash OE firmware on LE hardware.** - -Make example for this keyboard (after setting up your build environment): - - make e6v2/oe:default - -Or to make and flash: - - make e6v2/oe:default:dfu - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/e6v2/oe/rules.mk b/keyboards/e6v2/oe/rules.mk deleted file mode 100644 index 7d28042d85c..00000000000 --- a/keyboards/e6v2/oe/rules.mk +++ /dev/null @@ -1,70 +0,0 @@ -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE = yes -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 - -LAYOUTS = 60_ansi \ No newline at end of file diff --git a/keyboards/e6v2/readme.md b/keyboards/e6v2/readme.md deleted file mode 100644 index c09d1ccf1b5..00000000000 --- a/keyboards/e6v2/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# E6-V2 - -The E6-V2 is a 60% keyboard manufactured by Exclusive. - -### Round 1: -- ps2avrGB PCB and QMK powered PCB option (OE PCB) -- Center mount and side mount USB - -### Round 2 -- ps2avrGB PCB and QMK powered PCB option (LE PCB) -- Only center mount USB offered -- All brass option - -These docs are for the QMK version of the E6-V2 PCB. [More info on qmk.fm](http://qmk.fm/) - -The E6V2 has been available with either a bootmapper client or QMK powered PCB. During the second round, the QMK powered PCB was redesigned and used different ports and a different switch matrix. - -Please use the appropriate version when making your firmware. Flashing one in place of the other, can brick your PCB. Please be certain whether you have a OE or LE PCB. - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/eco/config.h b/keyboards/eco/config.h index f6b78631ea0..a6ae1821a79 100644 --- a/keyboards/eco/config.h +++ b/keyboards/eco/config.h @@ -38,18 +38,13 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/eco/keymaps/default/keymap.c b/keyboards/eco/keymaps/default/keymap.c index 7d714d9ad34..ede68d59da6 100644 --- a/keyboards/eco/keymaps/default/keymap.c +++ b/keyboards/eco/keymaps/default/keymap.c @@ -18,10 +18,6 @@ enum eco_keycodes { QWERTY = SAFE_RANGE }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/keyboards/eco/keymaps/default/rules.mk b/keyboards/eco/keymaps/default/rules.mk index 0996602325b..83d1175db99 100644 --- a/keyboards/eco/keymaps/default/rules.mk +++ b/keyboards/eco/keymaps/default/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/eco/keymaps/fsck/config.h b/keyboards/eco/keymaps/fsck/config.h new file mode 100644 index 00000000000..b0a7901b2d6 --- /dev/null +++ b/keyboards/eco/keymaps/fsck/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Frederick Hirsch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define USB_MAX_POWER_CONSUMPTION 100 diff --git a/keyboards/eco/keymaps/fsck/keymap.c b/keyboards/eco/keymaps/fsck/keymap.c new file mode 100644 index 00000000000..8d7cb89c175 --- /dev/null +++ b/keyboards/eco/keymaps/fsck/keymap.c @@ -0,0 +1,76 @@ +/* Copyright 2019 Frederick Hirsch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _RAISE 3 + +enum eco_keycodes { + QWERTY = SAFE_RANGE, + RAISE +}; + +#define JC_Z CTL_T(KC_Z) +#define JC_X ALT_T(KC_X) +#define JC_C GUI_T(KC_C) +#define JC_COMM GUI_T(KC_COMM) +#define JC_DOT ALT_T(KC_DOT) +#define JC_SLSH CTL_T(KC_SLSH) + +#define JC_CAPS LT(_RAISE,KC_CAPS) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-------------------------------------------------------------------------------------------------. + * | Tab | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 10 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ESC | Q | W | E | R | T | Home | PgUp | Y | U | I | O | P | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Raise| A | S | D | F | G | End | PgDn | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | Space | N | M | , | . | / | Shift| + * | | Ctrl | Alt | GUI | | | | GUI | Alt | Ctrl | | + * `-------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME, KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, + JC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_END, KC_PGDN, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, JC_Z, JC_X, JC_C, KC_V, KC_B, KC_SPC, KC_SPC, KC_N, KC_M, JC_COMM, JC_DOT, JC_SLSH, KC_RSFT +), + + +/* Raise + * ,-------------------------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | | | F6 | F7 | F8 | F9 | F0 | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | | Up | | | | |PrntSc| | | | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | Left | Down | Right| | |ScrLck|Pause | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | |Insert| + * `-------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + _______, _______, KC_UP, _______, _______, _______, _______, KC_PSCR, _______, _______, _______, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_LEFT, KC_DOWN, KC_RIGHT,_______, _______, KC_SLCK, KC_PAUS, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS +) +}; \ No newline at end of file diff --git a/keyboards/eco/keymaps/fsck/readme.md b/keyboards/eco/keymaps/fsck/readme.md new file mode 100644 index 00000000000..1f3678daf11 --- /dev/null +++ b/keyboards/eco/keymaps/fsck/readme.md @@ -0,0 +1,5 @@ +![eco:fsck Layout Image](https://i.imgur.com/Sb8n8B0.png) + +# ECO Layout by fsck + +This is the fsck layout for the eco keyboard. The bottom row of the default layer are dual function tap/hold keys. \ No newline at end of file diff --git a/keyboards/eco/keymaps/fsck/rules.mk b/keyboards/eco/keymaps/fsck/rules.mk new file mode 100644 index 00000000000..8fb2adf3838 --- /dev/null +++ b/keyboards/eco/keymaps/fsck/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/eco/keymaps/hexwire/keymap.c b/keyboards/eco/keymaps/hexwire/keymap.c index 7c6616aac87..3f21eacd3b2 100644 --- a/keyboards/eco/keymaps/hexwire/keymap.c +++ b/keyboards/eco/keymaps/hexwire/keymap.c @@ -23,8 +23,6 @@ enum eco_keycodes { // Fillers to make layering more clear #define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define KC_RST RESET #define KC_DBUG DEBUG diff --git a/keyboards/eco/keymaps/hexwire/rules.mk b/keyboards/eco/keymaps/hexwire/rules.mk index 0996602325b..83d1175db99 100644 --- a/keyboards/eco/keymaps/hexwire/rules.mk +++ b/keyboards/eco/keymaps/hexwire/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/eco/keymaps/that_canadian/keymap.c b/keyboards/eco/keymaps/that_canadian/keymap.c index 444bc48f804..f9696c77e5f 100644 --- a/keyboards/eco/keymaps/that_canadian/keymap.c +++ b/keyboards/eco/keymaps/that_canadian/keymap.c @@ -25,10 +25,6 @@ enum eco_keycodes { RAISE }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/keyboards/eco/keymaps/that_canadian/rules.mk b/keyboards/eco/keymaps/that_canadian/rules.mk index 0996602325b..83d1175db99 100644 --- a/keyboards/eco/keymaps/that_canadian/rules.mk +++ b/keyboards/eco/keymaps/that_canadian/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/eco/keymaps/xyverz/keymap.c b/keyboards/eco/keymaps/xyverz/keymap.c index b4ca0f1a5f1..395a014acb3 100644 --- a/keyboards/eco/keymaps/xyverz/keymap.c +++ b/keyboards/eco/keymaps/xyverz/keymap.c @@ -28,10 +28,6 @@ enum planck_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Aliases to make reading the keymap easier #define GUIBSPC GUI_T(KC_BSPC) // GUI when held, BSPC when tapped. diff --git a/keyboards/eco/readme.md b/keyboards/eco/readme.md index 0826337e757..fac80e0a1bc 100644 --- a/keyboards/eco/readme.md +++ b/keyboards/eco/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make eco/rev2:that_canadian -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/eco/rules.mk b/keyboards/eco/rules.mk index 35ee906b1e8..e2cebaf97d5 100644 --- a/keyboards/eco/rules.mk +++ b/keyboards/eco/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -64,4 +63,4 @@ API_SYSEX_ENABLE = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -DEFAULT_FOLDER = eco/rev2 \ No newline at end of file +DEFAULT_FOLDER = eco/rev2 diff --git a/keyboards/emptystring/NQG/NQG.c b/keyboards/emptystring/NQG/NQG.c new file mode 100644 index 00000000000..eedf25e8815 --- /dev/null +++ b/keyboards/emptystring/NQG/NQG.c @@ -0,0 +1 @@ +#include "NQG.h" diff --git a/keyboards/emptystring/NQG/NQG.h b/keyboards/emptystring/NQG/NQG.h new file mode 100644 index 00000000000..943ea6ab167 --- /dev/null +++ b/keyboards/emptystring/NQG/NQG.h @@ -0,0 +1,15 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, \ + L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, \ + L20, L21, L22, L23, L24, L25, L26, L27, L28, L29, \ + L30, L32, L33, L34, L35, L36, L37 \ + ) { \ + {L00, L01, L02, L03, L04, L05, L06, L07, L08, L09}, \ + {L10, L11, L12, L13, L14, L15, L16, L17, L18, L19}, \ + {L20, L21, L22, L23, L24, L25, L26, L27, L28, L29}, \ + {L30, KC_NO, L32, L33, L34, L35, L36, L37, KC_NO, KC_NO} \ + } diff --git a/keyboards/emptystring/NQG/config.h b/keyboards/emptystring/NQG/config.h new file mode 100644 index 00000000000..3f52ba3ea68 --- /dev/null +++ b/keyboards/emptystring/NQG/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2019 Bernard Shih (twitter: @SA_EndlessGame) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x0076 +#define PRODUCT_ID 0x0037 +#define DEVICE_VER 0x0100 +#define MANUFACTURER emptystring +#define PRODUCT NQG +#define DESCRIPTION 30% ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 10 + +/* key matrix pins */ +#define MATRIX_ROW_PINS {B6, B2, B3, B1} +#define MATRIX_COL_PINS {F7, F6, B5, B4, E6, D7, C6, D4, D0, D1} + + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define TAPPING_TERM 200 diff --git a/keyboards/emptystring/NQG/info.json b/keyboards/emptystring/NQG/info.json new file mode 100644 index 00000000000..008dbbe98d9 --- /dev/null +++ b/keyboards/emptystring/NQG/info.json @@ -0,0 +1,50 @@ +{ + "keyboard_name": "NQG (Not Quite Gherkin)", + "url": "", + "maintainer": "culturalsnow", + "width": 11, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"A", "x":1, "y":1}, + {"label":"S", "x":2, "y":1}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1}, + {"label":"G", "x":5, "y":1}, + {"label":"H", "x":6, "y":1}, + {"label":"J", "x":7, "y":1}, + {"label":"K", "x":8, "y":1}, + {"label":"L", "x":9, "y":1}, + {"label":"; '", "x":10, "y":1}, + {"label":"Z", "x":1, "y":2}, + {"label":"X", "x":2, "y":2}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2}, + {"label":"B", "x":5, "y":2}, + {"label":"N", "x":6, "y":2}, + {"label":"M", "x":7, "y":2}, + {"label":",", "x":8, "y":2}, + {"label":".", "x":9, "y":2}, + {"label":"/ Enter", "x":10, "y":2}, + {"label":"Shift / Tab", "x":0, "y":2}, + {"label":"LT(_LOWER, KC_ESC)", "x":3, "y":3}, + {"label":"Ctrl / Backspace", "x":4, "y":3}, + {"label":"Ctrl / Backspace", "x":5, "y":3}, + {"label":"Space", "x":6, "y":3}, + {"label":"Space", "x":7, "y":3}, + {"label":"MO(_RAISE)", "x":8, "y":3} + ] + } + } +} diff --git a/keyboards/emptystring/NQG/keymaps/default/keymap.c b/keyboards/emptystring/NQG/keymaps/default/keymap.c new file mode 100644 index 00000000000..cd465519bf6 --- /dev/null +++ b/keyboards/emptystring/NQG/keymaps/default/keymap.c @@ -0,0 +1,61 @@ +#include QMK_KEYBOARD_H + +#define _BASE 0 +#define _LOWER 1 +#define _RAISE 2 + +enum tapdances{ + TD_SCCL = 0, + TD_ENSL, + TD_N0BS, + TD_RPPI, +}; + +#define KC_SCCL TD(TD_SCCL) +#define KC_ENSL TD(TD_ENSL) +#define KC_N0BS TD(TD_N0BS) +#define KC_RPPI TD(TD_RPPI) + +#define KC_BSCT LCTL_T(KC_BSPC) +#define KC_ALEN LALT(KC_ENT) +#define KC_CTEN LCTL(KC_ENT) +#define KC_STAB LSFT_T(KC_TAB) +#define KC_WLNG LALT(KC_LSFT) +#define KC_LOCK LGUI(KC_L) +#define KC_ULCK LCTL(LALT(KC_DEL)) +#define KC_DSTP LGUI(KC_D) +#define KC_ESLO LT(_LOWER, KC_ESC) + + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), + [TD_ENSL] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ENT), + [TD_N0BS] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_BSLS), + [TD_RPPI] = ACTION_TAP_DANCE_DOUBLE(KC_RPRN, KC_PIPE), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_ENSL,\ + KC_STAB, KC_ESLO, KC_BSCT, KC_BSCT, KC_SPC, KC_SPC, MO(_RAISE) + ), + + [_LOWER] = LAYOUT( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPPI, \ + _______, _______, KC_DSTP, _______, KC_WLNG, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, \ + _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, KC_HOME, KC_END,\ + KC_CTEN, _______, KC_BSCT, KC_BSCT, KC_SPC, KC_SPC, KC_ULCK + ), + + [_RAISE] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_N0BS, \ + _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, \ + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT,\ + KC_ALEN, KC_LOCK, KC_BSCT, KC_BSCT, KC_SPC, KC_SPC, _______ + ), + + +}; diff --git a/keyboards/emptystring/NQG/keymaps/default/rules.mk b/keyboards/emptystring/NQG/keymaps/default/rules.mk new file mode 100644 index 00000000000..e5ddcae8d92 --- /dev/null +++ b/keyboards/emptystring/NQG/keymaps/default/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/emptystring/NQG/readme.md b/keyboards/emptystring/NQG/readme.md new file mode 100644 index 00000000000..5e78420e2b0 --- /dev/null +++ b/keyboards/emptystring/NQG/readme.md @@ -0,0 +1,15 @@ +# NQG: Not Quite Gherkin + +![NQG](https://github.com/culturalsnow/NQG/blob/master/images/NQGLayout.jpg) + +NQG (Not Quite Gherkin) is a 30% ortholinear keyboard with a macro key and dedicated row for thumb keys, made by emptystring studio. + +Keyboard Maintainer: [Culturalsnow](http://github.com/culturalsnow) +Hardware Supported: NQG PCB, Pro Micro +Hardware Availability: Kits are available from [SA_EndlessGame](http://twitter.com/SA_EndlessGame) + +Make example for this keyboard (after setting up your build environment): + + make emptystring/NQG:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/emptystring/NQG/rules.mk b/keyboards/emptystring/NQG/rules.mk new file mode 100644 index 00000000000..9a46bb85440 --- /dev/null +++ b/keyboards/emptystring/NQG/rules.mk @@ -0,0 +1,64 @@ +# MCU name + +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/ep/40/40.c b/keyboards/ep/40/40.c new file mode 100644 index 00000000000..7c235f3ce5c --- /dev/null +++ b/keyboards/ep/40/40.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "40.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/handwired/ep40/ep40.h b/keyboards/ep/40/40.h similarity index 100% rename from keyboards/handwired/ep40/ep40.h rename to keyboards/ep/40/40.h diff --git a/keyboards/ep/40/config.h b/keyboards/ep/40/config.h new file mode 100644 index 00000000000..c954882b81d --- /dev/null +++ b/keyboards/ep/40/config.h @@ -0,0 +1,110 @@ +/* +Copyright 2018 Elliot Powell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4040 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Elliot Powell +#define PRODUCT ep40 +#define DESCRIPTION A simple 40% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C7, C6, B6, B5 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, D2, D3, D5, D4, D6, D7, B4 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/handwired/ep40/info.json b/keyboards/ep/40/info.json similarity index 100% rename from keyboards/handwired/ep40/info.json rename to keyboards/ep/40/info.json diff --git a/keyboards/ep/40/keymaps/default/keymap.c b/keyboards/ep/40/keymaps/default/keymap.c new file mode 100644 index 00000000000..1ac66bc0126 --- /dev/null +++ b/keyboards/ep/40/keymaps/default/keymap.c @@ -0,0 +1,71 @@ +/* Copyright 2018 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +static bool bsdel_mods = false; + +enum custom_keycodes { + M_BSDEL = SAFE_RANGE, // ensure these codes start after the highest keycode defined in Quantum +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, M_BSDEL,\ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT,\ + LCTL_T(KC_LBRC), KC_LGUI, KC_LALT, KC_SPC, LT(1, KC_SPC), KC_RALT, MO(2), RCTL_T(KC_RBRC), KC_F5 \ + ), + + [1] = LAYOUT( /* Base */ + KC_TRNS, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_TRNS,\ + KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + + [2] = LAYOUT( /* Base */ + KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 ,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_NUHS, KC_TRNS,\ + KC_TRNS, KC_NUBS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case M_BSDEL: { + uint8_t kc = KC_BSPC; + + if (record->event.pressed) { + if (keyboard_report->mods) { + kc = KC_DEL; + } + register_code (kc); + bsdel_mods = keyboard_report->mods; + } + else { + if (bsdel_mods) { + kc = KC_DEL; + } + unregister_code (kc); + } + + return false; + break; + } + } + return true; +} diff --git a/keyboards/handwired/ep40/keymaps/default/readme.md b/keyboards/ep/40/keymaps/default/readme.md similarity index 100% rename from keyboards/handwired/ep40/keymaps/default/readme.md rename to keyboards/ep/40/keymaps/default/readme.md diff --git a/keyboards/ep/40/readme.md b/keyboards/ep/40/readme.md new file mode 100644 index 00000000000..647842bade8 --- /dev/null +++ b/keyboards/ep/40/readme.md @@ -0,0 +1,15 @@ +# ep40 + +![ep40](https://i.imgur.com/Jl7w6I9.jpg) + +A simple 40% keyboard + +Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23), [/u/e11i0t23 on reddit](https://reddit.com/u/e11i0t23) +Hardware Supported: EP40 PCB +Hardware Availability: None at the moment + +Make example for this keyboard (after setting up your build environment): + + make ep/40:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/ep40/rules.mk b/keyboards/ep/40/rules.mk similarity index 100% rename from keyboards/handwired/ep40/rules.mk rename to keyboards/ep/40/rules.mk diff --git a/keyboards/ep/96/96.c b/keyboards/ep/96/96.c new file mode 100644 index 00000000000..9fdd51977d4 --- /dev/null +++ b/keyboards/ep/96/96.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "96.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/ep/96/96.h b/keyboards/ep/96/96.h new file mode 100644 index 00000000000..1887eb472c0 --- /dev/null +++ b/keyboards/ep/96/96.h @@ -0,0 +1,47 @@ +/* Copyright 2018 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef EP96_H +#define EP96_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define xxxx KC_NO + +#define LAYOUT( \ + K000, K001, K002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, k016, k017, k018, \ + K100, K101, K102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k114, k115, k116, k117, k118, \ + K200, K202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k215, k216, k217, \ + K300, K302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, k317, k318, \ + K400, K401, K402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k413, k414, k415, k416, k417, \ + K500, K501, K502, k506, k511, k512, k513, k514, k515, k516, k517, k518) \ +{ \ + {K000, K001, K002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, k016, k017, k018}, \ + {K100, K101, K102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, xxxx, k114, k115, k116, k117, k118}, \ + {K200, xxxx, K202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, xxxx, k215, k216, k217, xxxx}, \ + {K300, xxxx, K302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, k317, k318}, \ + {K400, K401, K402, k403, k404, k405, k406, k407, k408, k409, k410, k411, xxxx, k413, k414, k415, k416, k417, xxxx}, \ + {K500, K501, K502, xxxx, xxxx, xxxx, k506, xxxx, xxxx, xxxx, xxxx, k511, k512, k513, k514, k515, k516, k517, k518} \ +} + +#endif diff --git a/keyboards/ep/96/config.h b/keyboards/ep/96/config.h new file mode 100644 index 00000000000..22d406fd5d5 --- /dev/null +++ b/keyboards/ep/96/config.h @@ -0,0 +1,205 @@ +/* +Copyright 2018 Elliot Powell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x9696 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Elliot Powell +#define PRODUCT ep96 +#define DESCRIPTION A simple 96 key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 19 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B3, B2, B7, C6 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C7, F7, F6, F5, F4, F1, F0, E6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/ep/96/info.json b/keyboards/ep/96/info.json new file mode 100644 index 00000000000..4be41b24c3f --- /dev/null +++ b/keyboards/ep/96/info.json @@ -0,0 +1,426 @@ +{ + "keyboard_name": "ep96", + "maintainer": "e11i0t23", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT": { + "key_count": 100, + "layout": [{ + "label": "Esc", + "x": 0, + "y": 0 + }, { + "label": "F1", + "x": 1, + "y": 0 + }, { + "label": "F2", + "x": 2, + "y": 0 + }, { + "label": "F3", + "x": 3, + "y": 0 + }, { + "label": "F4", + "x": 4, + "y": 0 + }, { + "label": "F5", + "x": 5, + "y": 0 + }, { + "label": "F6", + "x": 6, + "y": 0 + }, { + "label": "F7", + "x": 7, + "y": 0 + }, { + "label": "F8", + "x": 8, + "y": 0 + }, { + "label": "F9", + "x": 9, + "y": 0 + }, { + "label": "F10", + "x": 10, + "y": 0 + }, { + "label": "F11", + "x": 11, + "y": 0 + }, { + "label": "F12", + "x": 12, + "y": 0 + }, { + "label": "Prt Sc", + "x": 13, + "y": 0 + }, { + "label": "Delete", + "x": 14, + "y": 0 + }, { + "label": "home", + "x": 15, + "y": 0 + }, { + "label": "Menu", + "x": 16, + "y": 0 + }, { + "label": "Pg Up", + "x": 17, + "y": 0 + }, { + "label": "Pg Dn", + "x": 18, + "y": 0 + }, { + "label": "~", + "x": 0, + "y": 1 + }, { + "label": "!", + "x": 1, + "y": 1 + }, { + "label": "@", + "x": 2, + "y": 1 + }, { + "label": "#", + "x": 3, + "y": 1 + }, { + "label": "$", + "x": 4, + "y": 1 + }, { + "label": "%", + "x": 5, + "y": 1 + }, { + "label": "^", + "x": 6, + "y": 1 + }, { + "label": "&", + "x": 7, + "y": 1 + }, { + "label": "*", + "x": 8, + "y": 1 + }, { + "label": "(", + "x": 9, + "y": 1 + }, { + "label": ")", + "x": 10, + "y": 1 + }, { + "label": "_", + "x": 11, + "y": 1 + }, { + "label": "+", + "x": 12, + "y": 1 + }, { + "label": "Backspace", + "x": 13, + "y": 1, + "w": 2 + }, { + "label": "Num Lock", + "x": 15, + "y": 1 + }, { + "label": "/", + "x": 16, + "y": 1 + }, { + "label": "*", + "x": 17, + "y": 1 + }, { + "label": "-", + "x": 18, + "y": 1 + }, { + "label": "Tab", + "x": 0, + "y": 2, + "w": 1.5 + }, { + "label": "Q", + "x": 1.5, + "y": 2 + }, { + "label": "W", + "x": 2.5, + "y": 2 + }, { + "label": "E", + "x": 3.5, + "y": 2 + }, { + "label": "R", + "x": 4.5, + "y": 2 + }, { + "label": "T", + "x": 5.5, + "y": 2 + }, { + "label": "Y", + "x": 6.5, + "y": 2 + }, { + "label": "U", + "x": 7.5, + "y": 2 + }, { + "label": "I", + "x": 8.5, + "y": 2 + }, { + "label": "O", + "x": 9.5, + "y": 2 + }, { + "label": "P", + "x": 10.5, + "y": 2 + }, { + "label": "{", + "x": 11.5, + "y": 2 + }, { + "label": "}", + "x": 12.5, + "y": 2 + }, { + "label": "Enter", + "x": 13.75, + "y": 2, + "w": 1.25, + "h": 2 + }, { + "label": "7", + "x": 15, + "y": 2 + }, { + "label": "8", + "x": 16, + "y": 2 + }, { + "label": "9", + "x": 17, + "y": 2 + }, { + "label": "+", + "x": 18, + "y": 2, + "h": 2 + }, { + "label": "Caps Lock", + "x": 0, + "y": 3, + "w": 1.75 + }, { + "label": "A", + "x": 1.75, + "y": 3 + }, { + "label": "S", + "x": 2.75, + "y": 3 + }, { + "label": "D", + "x": 3.75, + "y": 3 + }, { + "label": "F", + "x": 4.75, + "y": 3 + }, { + "label": "G", + "x": 5.75, + "y": 3 + }, { + "label": "H", + "x": 6.75, + "y": 3 + }, { + "label": "J", + "x": 7.75, + "y": 3 + }, { + "label": "K", + "x": 8.75, + "y": 3 + }, { + "label": "L", + "x": 9.75, + "y": 3 + }, { + "label": ":", + "x": 10.75, + "y": 3 + }, { + "label": "\"", + "x": 11.75, + "y": 3 + }, { + "label": "~", + "x": 12.75, + "y": 3 + }, { + "label": "4", + "x": 15, + "y": 3 + }, { + "label": "5", + "x": 16, + "y": 3 + }, { + "label": "6", + "x": 17, + "y": 3 + }, { + "label": "Shift", + "x": 0, + "y": 4, + "w": 1.25 + }, { + "label": "|", + "x": 1.25, + "y": 4 + }, { + "label": "Z", + "x": 2.25, + "y": 4 + }, { + "label": "X", + "x": 3.25, + "y": 4 + }, { + "label": "C", + "x": 4.25, + "y": 4 + }, { + "label": "V", + "x": 5.25, + "y": 4 + }, { + "label": "B", + "x": 6.25, + "y": 4 + }, { + "label": "N", + "x": 7.25, + "y": 4 + }, { + "label": "M", + "x": 8.25, + "y": 4 + }, { + "label": "<", + "x": 9.25, + "y": 4 + }, { + "label": ">", + "x": 10.25, + "y": 4 + }, { + "label": "?", + "x": 11.25, + "y": 4 + }, { + "label": "Shift", + "x": 12.25, + "y": 4, + "w": 1.75 + }, { + "label": "\u2191", + "x": 14, + "y": 4 + }, { + "label": "1", + "x": 15, + "y": 4 + }, { + "label": "2", + "x": 16, + "y": 4 + }, { + "label": "3", + "x": 17, + "y": 4 + }, { + "label": "Enter", + "x": 18, + "y": 4, + "h": 2 + }, { + "label": "Ctrl", + "x": 0, + "y": 5, + "w": 1.25 + }, { + "label": "Win", + "x": 1.25, + "y": 5, + "w": 1.25 + }, { + "label": "Alt", + "x": 2.5, + "y": 5, + "w": 1.25 + }, { + "x": 3.75, + "y": 5, + "w": 6.25 + }, { + "label": "Alt", + "x": 10, + "y": 5, + "w": 1.5 + }, { + "label": "Crtl", + "x": 11.5, + "y": 5, + "w": 1.5 + }, { + "label": "\u2190", + "x": 13, + "y": 5 + }, { + "label": "\u2193", + "x": 14, + "y": 5 + }, { + "label": "\u2192", + "x": 15, + "y": 5 + }, { + "label": "0", + "x": 16, + "y": 5 + }, { + "label": ".", + "x": 17, + "y": 5 + }] + } + } +} diff --git a/keyboards/ep/96/keymaps/default/keymap.c b/keyboards/ep/96/keymaps/default/keymap.c new file mode 100644 index 00000000000..d5120415359 --- /dev/null +++ b/keyboards/ep/96/keymaps/default/keymap.c @@ -0,0 +1,67 @@ +/* Copyright 2018 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/ep/96/keymaps/default/readme.md b/keyboards/ep/96/keymaps/default/readme.md new file mode 100644 index 00000000000..81e87464f0c --- /dev/null +++ b/keyboards/ep/96/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for ep96 \ No newline at end of file diff --git a/keyboards/ep/96/readme.md b/keyboards/ep/96/readme.md new file mode 100644 index 00000000000..404419b63ae --- /dev/null +++ b/keyboards/ep/96/readme.md @@ -0,0 +1,15 @@ +# ep96 + +![ep96](https://i.imgur.com/PZ2C7a8.jpg) + +A simple 96 key keyboard + +Keyboard Maintainer: Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23), [/u/e11i0t23](https://reddit.com/u/e11i0t23) +Hardware Supported: EP96 PCB +Hardware Availability: Possible availability upon request + +Make example for this keyboard (after setting up your build environment): + + make ep/96:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ep/96/rules.mk b/keyboards/ep/96/rules.mk new file mode 100644 index 00000000000..9ddf9717e94 --- /dev/null +++ b/keyboards/ep/96/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/ep/comsn/hs68/config.h b/keyboards/ep/comsn/hs68/config.h new file mode 100644 index 00000000000..db633a25095 --- /dev/null +++ b/keyboards/ep/comsn/hs68/config.h @@ -0,0 +1,59 @@ +/* +Copyright 2019 Elliot Powell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6868 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Elliot Powell +#define PRODUCT ephs68 +#define DESCRIPTION A Hotswapable keyboard for kayak + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS \ + { B6, B5, B4, D0, F6 } +#define MATRIX_COL_PINS \ + { B0, B1, B3, B2, B7, D3, F1, D5, D6, D7, F4, F5, C7, C6, F0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/ep/comsn/hs68/hs68.c b/keyboards/ep/comsn/hs68/hs68.c new file mode 100644 index 00000000000..fdde3ad78d4 --- /dev/null +++ b/keyboards/ep/comsn/hs68/hs68.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "hs68.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/ep/comsn/hs68/hs68.h b/keyboards/ep/comsn/hs68/hs68.h new file mode 100644 index 00000000000..394208c55ce --- /dev/null +++ b/keyboards/ep/comsn/hs68/hs68.h @@ -0,0 +1,42 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define xxx KC_NO + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E \ +) { \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, xxx, K1E}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E}, \ + {K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E}, \ + { K40, K41, K42, xxx, xxx, xxx, K46, xxx, xxx, xxx, K4A, K4B, K4C, K4D, K4E } \ + } diff --git a/keyboards/ep/comsn/hs68/info.json b/keyboards/ep/comsn/hs68/info.json new file mode 100644 index 00000000000..957684bc5b7 --- /dev/null +++ b/keyboards/ep/comsn/hs68/info.json @@ -0,0 +1,364 @@ +{ + "keyboard_name": "EPHS68", + "maintainer": "Elliot Powell (u/e11i0t23)", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + { + "label": "ESC", + "x": 0, + "y": 0 + }, + { + "label": "!", + "x": 1, + "y": 0 + }, + { + "label": "\"", + "x": 2, + "y": 0 + }, + { + "label": "\u00a3", + "x": 3, + "y": 0 + }, + { + "label": "$", + "x": 4, + "y": 0 + }, + { + "label": "%", + "x": 5, + "y": 0 + }, + { + "label": "^", + "x": 6, + "y": 0 + }, + { + "label": "&", + "x": 7, + "y": 0 + }, + { + "label": "*", + "x": 8, + "y": 0 + }, + { + "label": "(", + "x": 9, + "y": 0 + }, + { + "label": ")", + "x": 10, + "y": 0 + }, + { + "label": "_", + "x": 11, + "y": 0 + }, + { + "label": "+", + "x": 12, + "y": 0 + }, + { + "label": "Backspace", + "x": 13, + "y": 0, + "w": 2 + }, + { + "label": "GRAV", + "x": 15, + "y": 0 + }, + { + "label": "Tab", + "x": 0, + "y": 1, + "w": 1.5 + }, + { + "label": "Q", + "x": 1.5, + "y": 1 + }, + { + "label": "W", + "x": 2.5, + "y": 1 + }, + { + "label": "E", + "x": 3.5, + "y": 1 + }, + { + "label": "R", + "x": 4.5, + "y": 1 + }, + { + "label": "T", + "x": 5.5, + "y": 1 + }, + { + "label": "Y", + "x": 6.5, + "y": 1 + }, + { + "label": "U", + "x": 7.5, + "y": 1 + }, + { + "label": "I", + "x": 8.5, + "y": 1 + }, + { + "label": "O", + "x": 9.5, + "y": 1 + }, + { + "label": "P", + "x": 10.5, + "y": 1 + }, + { + "label": "{", + "x": 11.5, + "y": 1 + }, + { + "label": "}", + "x": 12.5, + "y": 1 + }, + { + "label": "DEL", + "x": 15, + "y": 1 + }, + { + "label": "Caps Lock", + "x": 0, + "y": 2, + "w": 1.75 + }, + { + "label": "A", + "x": 1.75, + "y": 2 + }, + { + "label": "S", + "x": 2.75, + "y": 2 + }, + { + "label": "D", + "x": 3.75, + "y": 2 + }, + { + "label": "F", + "x": 4.75, + "y": 2 + }, + { + "label": "G", + "x": 5.75, + "y": 2 + }, + { + "label": "H", + "x": 6.75, + "y": 2 + }, + { + "label": "J", + "x": 7.75, + "y": 2 + }, + { + "label": "K", + "x": 8.75, + "y": 2 + }, + { + "label": "L", + "x": 9.75, + "y": 2 + }, + { + "label": ":", + "x": 10.75, + "y": 2 + }, + { + "label": "@", + "x": 11.75, + "y": 2 + }, + { + "label": "~", + "x": 12.75, + "y": 2 + }, + { + "label": "Enter", + "x": 13.75, + "y": 1, + "w": 1.25, + "h": 2 + }, + { + "label": "PGUP", + "x": 15, + "y": 2 + }, + { + "label": "Shift", + "x": 0, + "y": 3, + "w": 1.25 + }, + { + "label": "|", + "x": 1.25, + "y": 3 + }, + { + "label": "Z", + "x": 2.25, + "y": 3 + }, + { + "label": "X", + "x": 3.25, + "y": 3 + }, + { + "label": "C", + "x": 4.25, + "y": 3 + }, + { + "label": "V", + "x": 5.25, + "y": 3 + }, + { + "label": "B", + "x": 6.25, + "y": 3 + }, + { + "label": "N", + "x": 7.25, + "y": 3 + }, + { + "label": "M", + "x": 8.25, + "y": 3 + }, + { + "label": "<", + "x": 9.25, + "y": 3 + }, + { + "label": ">", + "x": 10.25, + "y": 3 + }, + { + "label": "?", + "x": 11.25, + "y": 3 + }, + { + "label": "Shift", + "x": 12.25, + "y": 3, + "w": 1.75 + }, + { + "label": "UP", + "x": 14, + "y": 3 + }, + { + "label": "PGDN", + "x": 15, + "y": 3 + }, + { + "label": "Ctrl", + "x": 0, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 1.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Alt", + "x": 2.5, + "y": 4, + "w": 1.25 + }, + { + "x": 3.75, + "y": 4, + "w": 6.25 + }, + { + "label": "AltGr", + "x": 10, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 11.25, + "y": 4, + "w": 1.25 + }, + { + "label": "LEFT", + "x": 13, + "y": 4 + }, + { + "label": "DOWN", + "x": 14, + "y": 4 + }, + { + "label": "RIGHT", + "x": 15, + "y": 4 + } + ] + } + } +} diff --git a/keyboards/ep/comsn/hs68/keymaps/default/keymap.c b/keyboards/ep/comsn/hs68/keymaps/default/keymap.c new file mode 100644 index 00000000000..b2972da6da4 --- /dev/null +++ b/keyboards/ep/comsn/hs68/keymaps/default/keymap.c @@ -0,0 +1,27 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUBS, KC_ENT, KC_END, + KC_LSFT, KC_NUHS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RIGHT + ), +}; diff --git a/keyboards/ep/comsn/hs68/readme.md b/keyboards/ep/comsn/hs68/readme.md new file mode 100644 index 00000000000..0f230208f01 --- /dev/null +++ b/keyboards/ep/comsn/hs68/readme.md @@ -0,0 +1,13 @@ +# hs68 + +Hotswap 68% deisnged for the Kayak + +Keyboard Maintainer: [e11i0t23](https://github.com/e11i0t23) +Hardware Supported: ephs68 pcb. Kayak case kits +Hardware Availability: None + +Make example for this keyboard (after setting up your build environment): + + make ep/comsn/hs68:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ep/comsn/hs68/rules.mk b/keyboards/ep/comsn/hs68/rules.mk new file mode 100644 index 00000000000..b7d3b9b5285 --- /dev/null +++ b/keyboards/ep/comsn/hs68/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/ep/comsn/mollydooker/config.h b/keyboards/ep/comsn/mollydooker/config.h new file mode 100644 index 00000000000..3ba661525a5 --- /dev/null +++ b/keyboards/ep/comsn/mollydooker/config.h @@ -0,0 +1,214 @@ +/* +Copyright 2019 Elliot Powell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x9696 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Elliot Powell +#define PRODUCT mollydooker +#define DESCRIPTION Custom southpaw replacement PCB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 19 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS \ + { F4, F5, F6, F7, D2 } +#define MATRIX_COL_PINS \ + { B1, B2, B3, E6, B7, F1, F0, D0, D1, D7, D5, D4, D6, B4, B5, D3, B6, C6, C7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE +#define RGB_DI_PIN B0 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 84 +#define RGBLIGHT_LIMIT_VAL 35 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/ep/comsn/mollydooker/info.json b/keyboards/ep/comsn/mollydooker/info.json new file mode 100644 index 00000000000..6ede5c1d8a2 --- /dev/null +++ b/keyboards/ep/comsn/mollydooker/info.json @@ -0,0 +1,96 @@ +{ + "keyboard_name": "mollydooker", + "maintainer": "Elliot Powell (u/e11i0t23)", + "width": 20, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "VolDn", "x": 0, "y": 0 }, + { "label": "VolUp", "x": 1, "y": 0 }, + { "label": "Mute", "x": 2, "y": 0 }, + { "label": "~", "x": 3, "y": 0 }, + { "label": "Esc", "x": 4, "y": 0 }, + { "label": "!", "x": 5, "y": 0 }, + { "label": "@", "x": 6, "y": 0 }, + { "label": "#", "x": 7, "y": 0 }, + { "label": "$", "x": 8, "y": 0 }, + { "label": "%", "x": 9, "y": 0 }, + { "label": "^", "x": 10, "y": 0 }, + { "label": "&", "x": 11, "y": 0 }, + { "label": "*", "x": 12, "y": 0 }, + { "label": "(", "x": 13, "y": 0 }, + { "label": ")", "x": 14, "y": 0 }, + { "label": "_", "x": 15, "y": 0 }, + { "label": "+", "x": 16, "y": 0 }, + { "label": "Backspace", "x": 17, "y": 0, "w": 2 }, + { "label": "Del", "x": 19, "y": 0 }, + { "label": "7", "x": 0, "y": 1 }, + { "label": "8", "x": 1, "y": 1 }, + { "label": "9", "x": 2, "y": 1 }, + { "label": "+", "x": 3, "y": 1, "h": 2 }, + { "label": "Tab", "x": 4, "y": 1, "w": 1.5 }, + { "label": "Q", "x": 5.5, "y": 1 }, + { "label": "W", "x": 6.5, "y": 1 }, + { "label": "E", "x": 7.5, "y": 1 }, + { "label": "R", "x": 8.5, "y": 1 }, + { "label": "T", "x": 9.5, "y": 1 }, + { "label": "Y", "x": 10.5, "y": 1 }, + { "label": "U", "x": 11.5, "y": 1 }, + { "label": "I", "x": 12.5, "y": 1 }, + { "label": "O", "x": 13.5, "y": 1 }, + { "label": "P", "x": 14.5, "y": 1 }, + { "label": "{", "x": 15.5, "y": 1 }, + { "label": "}", "x": 16.5, "y": 1 }, + { "label": "|", "x": 17.5, "y": 1, "w": 1.5 }, + { "label": "PgUp", "x": 19, "y": 1 }, + { "label": "4", "x": 0, "y": 2 }, + { "label": "5", "x": 1, "y": 2 }, + { "label": "6", "x": 2, "y": 2 }, + { "label": "Caps Lock", "x": 4, "y": 2, "w": 1.75 }, + { "label": "A", "x": 5.75, "y": 2 }, + { "label": "S", "x": 6.75, "y": 2 }, + { "label": "D", "x": 7.75, "y": 2 }, + { "label": "F", "x": 8.75, "y": 2 }, + { "label": "G", "x": 9.75, "y": 2 }, + { "label": "H", "x": 10.75, "y": 2 }, + { "label": "J", "x": 11.75, "y": 2 }, + { "label": "K", "x": 12.75, "y": 2 }, + { "label": "L", "x": 13.75, "y": 2 }, + { "label": ":", "x": 14.75, "y": 2 }, + { "label": "\"", "x": 15.75, "y": 2 }, + { "label": "Enter", "x": 16.75, "y": 2, "w": 2.25 }, + { "label": "PgDn", "x": 19, "y": 2 }, + { "label": "1", "x": 0, "y": 3 }, + { "label": "2", "x": 1, "y": 3 }, + { "label": "3", "x": 2, "y": 3 }, + { "label": "Enter", "x": 3, "y": 3, "h": 2 }, + { "label": "Shift", "x": 4, "y": 3, "w": 2.25 }, + { "label": "Z", "x": 6.25, "y": 3 }, + { "label": "X", "x": 7.25, "y": 3 }, + { "label": "C", "x": 8.25, "y": 3 }, + { "label": "V", "x": 9.25, "y": 3 }, + { "label": "B", "x": 10.25, "y": 3 }, + { "label": "N", "x": 11.25, "y": 3 }, + { "label": "M", "x": 12.25, "y": 3 }, + { "label": "<", "x": 13.25, "y": 3 }, + { "label": ">", "x": 14.25, "y": 3 }, + { "label": "?", "x": 15.25, "y": 3 }, + { "label": "Shift", "x": 16.25, "y": 3, "w": 1.75 }, + { "label": "Up", "x": 18, "y": 3 }, + { "label": "fn0", "x": 19, "y": 3 }, + { "label": "0", "x": 0, "y": 4, "w": 2 }, + { "label": ".", "x": 2, "y": 4 }, + { "label": "Ctrl", "x": 4, "y": 4, "w": 1.25 }, + { "label": "Win", "x": 5.25, "y": 4, "w": 1.25 }, + { "label": "Alt", "x": 6.5, "y": 4, "w": 1.25 }, + { "label": "Space", "x": 7.75, "y": 4, "w": 6.25 }, + { "label": "Alt", "x": 14, "y": 4, "w": 1.5 }, + { "label": "Ctrl", "x": 15.5, "y": 4, "w": 1.5 }, + { "label": "Left", "x": 17, "y": 4 }, + { "label": "Down", "x": 18, "y": 4 }, + { "label": "Right", "x": 19, "y": 4 } + ] + } + } +} diff --git a/keyboards/ep/comsn/mollydooker/keymaps/default/keymap.c b/keyboards/ep/comsn/mollydooker/keymaps/default/keymap.c new file mode 100644 index 00000000000..a213973cdb5 --- /dev/null +++ b/keyboards/ep/comsn/mollydooker/keymaps/default/keymap.c @@ -0,0 +1,55 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_NLCK, KC_PSLS, KC_PMNS, RGB_MOD, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_P7, KC_P8, KC_P9, KC_PPLS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_P4, KC_P5, KC_P6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_P1, KC_P2, KC_P3, KC_PENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_F5, + KC_P0, KC_PDOT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), +}; + +int RGB_current_mode; + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + enum rgb_matrix_effects { + RGB_MATRIX_SOLID_COLOR = 1, + #ifdef RGB_MATRIX_KEYPRESSES + RGB_MATRIX_SOLID_REACTIVE, + #endif + RGB_MATRIX_EFFECT_MAX + }; + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/ep/comsn/mollydooker/mollydooker.c b/keyboards/ep/comsn/mollydooker/mollydooker.c new file mode 100644 index 00000000000..d0d6f302eeb --- /dev/null +++ b/keyboards/ep/comsn/mollydooker/mollydooker.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "mollydooker.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/ep/comsn/mollydooker/mollydooker.h b/keyboards/ep/comsn/mollydooker/mollydooker.h new file mode 100644 index 00000000000..0cdac37a02a --- /dev/null +++ b/keyboards/ep/comsn/mollydooker/mollydooker.h @@ -0,0 +1,41 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define xxxx KC_NO + +#define LAYOUT( \ + K100, K101, K102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k114, k115, k116, k117, k118, \ + K200, k201, K202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214, k215, k216, k217, k218, \ + K300, k301, K302, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k317, k318, \ + K400, K401, K402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, k414, k416, k417, k418, \ + K500, K502, k504, k505, k506, k509, k513, k514, k516, k517, k518) \ +{ \ + {K100, K101, K102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k114, k115, k116, k117, k118}, \ + {K200, k201, K202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214, k215, k216, k217, k218}, \ + {K300, k301, K302, xxxx, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, xxxx, k317, k318}, \ + {K400, K401, K402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, k414, xxxx, k416, k417, k418}, \ + {K500, xxxx, K502, xxxx, k504, k505, k506, xxxx, xxxx, k509, xxxx, xxxx, xxxx, k513, k514, xxxx, k516, k517, k518} \ +} diff --git a/keyboards/ep/comsn/mollydooker/readme.md b/keyboards/ep/comsn/mollydooker/readme.md new file mode 100644 index 00000000000..c43875fdde6 --- /dev/null +++ b/keyboards/ep/comsn/mollydooker/readme.md @@ -0,0 +1,13 @@ +# mollydooker + +A southpaw extended 65 replacement PCB with per key RGB + +Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23), [/u/e11i0t23](https://reddit.com/u/e11i0t23) +Hardware Supported: mollydooker +Hardware Availability: None + +Make example for this keyboard (after setting up your build environment): + + make ep/comsn/mollydooker:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ep/comsn/mollydooker/rules.mk b/keyboards/ep/comsn/mollydooker/rules.mk new file mode 100644 index 00000000000..db4f2edc0bc --- /dev/null +++ b/keyboards/ep/comsn/mollydooker/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/ep/comsn/tf_longeboye/config.h b/keyboards/ep/comsn/tf_longeboye/config.h new file mode 100644 index 00000000000..e622010dbe6 --- /dev/null +++ b/keyboards/ep/comsn/tf_longeboye/config.h @@ -0,0 +1,64 @@ +/* +Copyright 2019 Elliot Powell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x9696 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Elliot Powell +#define PRODUCT TF Longeboye +#define DESCRIPTION TF Longeboye Designed for Papi SodaMan of MKUK + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 18 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS \ + { B5, B4, D1, D2, D3 } +#define MATRIX_COL_PINS \ + { F4, F5, F6, F7, B1, B3, B2, B6, F0, F1, C7, D5, B7, E6, D7, C6, D4, D0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/ep/comsn/tf_longeboye/info.json b/keyboards/ep/comsn/tf_longeboye/info.json new file mode 100644 index 00000000000..5cfa993d30c --- /dev/null +++ b/keyboards/ep/comsn/tf_longeboye/info.json @@ -0,0 +1,99 @@ +{ + "keyboard_name": "tf_longeboye", + "maintainer": "Elliot Powell (u/e11i0t23)", + "width": 21.5, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "Esc", "x": 0, "y": 0 }, + { "label": "!", "x": 1, "y": 0 }, + { "label": "\"", "x": 2, "y": 0 }, + { "label": "\u00a3", "x": 3, "y": 0 }, + { "label": "$", "x": 4, "y": 0 }, + { "label": "%", "x": 5, "y": 0 }, + { "label": "^", "x": 6, "y": 0 }, + { "label": "&", "x": 7, "y": 0 }, + { "label": "*", "x": 8, "y": 0 }, + { "label": "(", "x": 9, "y": 0 }, + { "label": ")", "x": 10, "y": 0 }, + { "label": "_", "x": 11, "y": 0 }, + { "label": "+", "x": 12, "y": 0 }, + { "label": "Backspace", "x": 13, "y": 0, "w": 2 }, + { "label": "Insert", "x": 15.25, "y": 0 }, + { "label": "PgUp", "x": 16.25, "y": 0 }, + { "label": "Num Lock", "x": 17.5, "y": 0 }, + { "label": "/", "x": 18.5, "y": 0 }, + { "label": "*", "x": 19.5, "y": 0 }, + { "label": "-", "x": 20.5, "y": 0 }, + { "label": "Tab", "x": 0, "y": 1, "w": 1.5 }, + { "label": "Q", "x": 1.5, "y": 1 }, + { "label": "W", "x": 2.5, "y": 1 }, + { "label": "E", "x": 3.5, "y": 1 }, + { "label": "R", "x": 4.5, "y": 1 }, + { "label": "T", "x": 5.5, "y": 1 }, + { "label": "Y", "x": 6.5, "y": 1 }, + { "label": "U", "x": 7.5, "y": 1 }, + { "label": "I", "x": 8.5, "y": 1 }, + { "label": "O", "x": 9.5, "y": 1 }, + { "label": "P", "x": 10.5, "y": 1 }, + { "label": "{", "x": 11.5, "y": 1 }, + { "label": "}", "x": 12.5, "y": 1 }, + { "label": "Delete", "x": 15.25, "y": 1 }, + { "label": "PgDn", "x": 16.25, "y": 1 }, + { "label": "7", "x": 17.5, "y": 1 }, + { "label": "8", "x": 18.5, "y": 1 }, + { "label": "9", "x": 19.5, "y": 1 }, + { "label": "+", "x": 20.5, "y": 1, "h": 2 }, + { "label": "Caps Lock", "x": 0, "y": 2, "w": 1.75 }, + { "label": "A", "x": 1.75, "y": 2 }, + { "label": "S", "x": 2.75, "y": 2 }, + { "label": "D", "x": 3.75, "y": 2 }, + { "label": "F", "x": 4.75, "y": 2 }, + { "label": "G", "x": 5.75, "y": 2 }, + { "label": "H", "x": 6.75, "y": 2 }, + { "label": "J", "x": 7.75, "y": 2 }, + { "label": "K", "x": 8.75, "y": 2 }, + { "label": "L", "x": 9.75, "y": 2 }, + { "label": ":", "x": 10.75, "y": 2 }, + { "label": "@", "x": 11.75, "y": 2 }, + { "label": "~", "x": 12.75, "y": 2 }, + { "label": "Enter", "x": 13.75, "y": 1, "w": 1.25, "h": 2 }, + { "label": "4", "x": 17.5, "y": 2 }, + { "label": "5", "x": 18.5, "y": 2 }, + { "label": "6", "x": 19.5, "y": 2 }, + { "label": "Shift", "x": 0, "y": 3, "w": 1.25 }, + { "label": "|", "x": 1.25, "y": 3 }, + { "label": "Z", "x": 2.25, "y": 3 }, + { "label": "X", "x": 3.25, "y": 3 }, + { "label": "C", "x": 4.25, "y": 3 }, + { "label": "V", "x": 5.25, "y": 3 }, + { "label": "B", "x": 6.25, "y": 3 }, + { "label": "N", "x": 7.25, "y": 3 }, + { "label": "M", "x": 8.25, "y": 3 }, + { "label": "<", "x": 9.25, "y": 3 }, + { "label": ">", "x": 10.25, "y": 3 }, + { "label": "?", "x": 11.25, "y": 3 }, + { "label": "Shift", "x": 12.25, "y": 3, "w": 1.75 }, + { "label": "fn", "x": 14, "y": 3 }, + { "label": "\u2191", "x": 15.25, "y": 3 }, + { "label": "1", "x": 17.5, "y": 3 }, + { "label": "2", "x": 18.5, "y": 3 }, + { "label": "3", "x": 19.5, "y": 3 }, + { "label": "Enter", "x": 20.5, "y": 3, "h": 2 }, + { "label": "Ctrl", "x": 0, "y": 4, "w": 1.25 }, + { "label": "Win", "x": 1.25, "y": 4, "w": 1.25 }, + { "label": "Alt", "x": 2.5, "y": 4, "w": 1.25 }, + { "x": 3.75, "y": 4, "w": 6.25 }, + { "label": "Alt Gr", "x": 10, "y": 4, "w": 1.25 }, + { "label": "Fn", "x": 11.25, "y": 4, "w": 1.25 }, + { "label": "Ctrl", "x": 12.5, "y": 4, "w": 1.25 }, + { "label": "\u2190", "x": 14.25, "y": 4 }, + { "label": "\u2193", "x": 15.25, "y": 4 }, + { "label": "\u2192", "x": 16.25, "y": 4 }, + { "label": "0", "x": 17.5, "y": 4, "w": 2 }, + { "label": ".", "x": 19.5, "y": 4 } + ] + } + } +} diff --git a/keyboards/ep/comsn/tf_longeboye/keymaps/default/keymap.c b/keyboards/ep/comsn/tf_longeboye/keymaps/default/keymap.c new file mode 100644 index 00000000000..2e9da9b04a3 --- /dev/null +++ b/keyboards/ep/comsn/tf_longeboye/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_P7, KC_P8, KC_P9, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ), + [1] = LAYOUT( /* Base */ + + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, SGUI(KC_S), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS +), + +}; + + diff --git a/keyboards/ep/comsn/tf_longeboye/readme.md b/keyboards/ep/comsn/tf_longeboye/readme.md new file mode 100644 index 00000000000..3bd89fbec0e --- /dev/null +++ b/keyboards/ep/comsn/tf_longeboye/readme.md @@ -0,0 +1,11 @@ +# TF Longeboye + +Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23), [/u/e11i0t23](https://reddit.com/u/e11i0t23) +Hardware Supported: TF Longeboye +Hardware Availability: None + +Make example for this keyboard (after setting up your build environment): + + make ep/comsn/tf_longeboye:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ep/comsn/tf_longeboye/rules.mk b/keyboards/ep/comsn/tf_longeboye/rules.mk new file mode 100644 index 00000000000..195c9e50236 --- /dev/null +++ b/keyboards/ep/comsn/tf_longeboye/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/ep/comsn/tf_longeboye/tf__longeboye.c b/keyboards/ep/comsn/tf_longeboye/tf__longeboye.c new file mode 100644 index 00000000000..9e8141772c2 --- /dev/null +++ b/keyboards/ep/comsn/tf_longeboye/tf__longeboye.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "tf_longeboye.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/ep/comsn/tf_longeboye/tf_longeboye.h b/keyboards/ep/comsn/tf_longeboye/tf_longeboye.h new file mode 100644 index 00000000000..f673ff66d76 --- /dev/null +++ b/keyboards/ep/comsn/tf_longeboye/tf_longeboye.h @@ -0,0 +1,40 @@ +/* Copyright 2019 Elliot Powell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K013, K014, K015, K016, K018, K019, K408, K114, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K113, K115, K116, K118, K119, K407, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, K214, K218, K219, K405, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, K315, K318, K319, K404, K316, \ + K400, K401, K402, K406, K410, K411, K413, K414, K415, K416, K418, K403 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K013, K014, K015, K016, K018, K019, }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K113, K114, K115, K116, K118, K119, }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, K214, KC_NO, K216, K218, K219, }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, K315, K316, K318, K319, }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, KC_NO, K410, K411, K413, K414, K415, K416, K418, KC_NO, } \ +} diff --git a/keyboards/ergo42/info.json b/keyboards/ergo42/info.json index 6489e25a806..cac5a46a143 100644 --- a/keyboards/ergo42/info.json +++ b/keyboards/ergo42/info.json @@ -5,7 +5,7 @@ "width": 15, "height": 4, "layouts": { - "LAYOUT_ortho_4x14": { + "LAYOUT": { "key_count": 56, "layout": [{"label":"L00", "x":0, "y":0}, {"label":"L01", "x":1, "y":0}, {"label":"L02", "x":2, "y":0}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0}, {"label":"L05", "x":5, "y":0}, {"label":"L06", "x":6, "y":0}, {"label":"R00", "x":8, "y":0}, {"label":"R01", "x":9, "y":0}, {"label":"R02", "x":10, "y":0}, {"label":"R03", "x":11, "y":0}, {"label":"R04", "x":12, "y":0}, {"label":"R05", "x":13, "y":0}, {"label":"R06", "x":14, "y":0}, {"label":"L10", "x":0, "y":1}, {"label":"L11", "x":1, "y":1}, {"label":"L12", "x":2, "y":1}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1}, {"label":"L15", "x":5, "y":1}, {"label":"L16", "x":6, "y":1}, {"label":"R10", "x":8, "y":1}, {"label":"R11", "x":9, "y":1}, {"label":"R12", "x":10, "y":1}, {"label":"R13", "x":11, "y":1}, {"label":"R14", "x":12, "y":1}, {"label":"R15", "x":13, "y":1}, {"label":"R16", "x":14, "y":1}, {"label":"L20", "x":0, "y":2}, {"label":"L21", "x":1, "y":2}, {"label":"L22", "x":2, "y":2}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2}, {"label":"L25", "x":5, "y":2}, {"label":"L26", "x":6, "y":2}, {"label":"R20", "x":8, "y":2}, {"label":"R21", "x":9, "y":2}, {"label":"R22", "x":10, "y":2}, {"label":"R23", "x":11, "y":2}, {"label":"R24", "x":12, "y":2}, {"label":"R25", "x":13, "y":2}, {"label":"R26", "x":14, "y":2}, {"label":"L30", "x":0, "y":3}, {"label":"L31", "x":1, "y":3}, {"label":"L32", "x":2, "y":3}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3}, {"label":"L35", "x":5, "y":3}, {"label":"L36", "x":6, "y":3}, {"label":"R30", "x":8, "y":3}, {"label":"R31", "x":9, "y":3}, {"label":"R32", "x":10, "y":3}, {"label":"R33", "x":11, "y":3}, {"label":"R34", "x":12, "y":3}, {"label":"R35", "x":13, "y":3}, {"label":"R36", "x":14, "y":3}] } diff --git a/keyboards/ergo42/keymaps/biacco-biacco/keymap.c b/keyboards/ergo42/keymaps/biacco-biacco/keymap.c index ee471b3a51c..9eaba22099f 100644 --- a/keyboards/ergo42/keymaps/biacco-biacco/keymap.c +++ b/keyboards/ergo42/keymaps/biacco-biacco/keymap.c @@ -12,10 +12,6 @@ extern keymap_config_t keymap_config; #define BMETA 5 #define BSYMB 6 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BASE diff --git a/keyboards/ergo42/keymaps/biacco-macOS/keymap.c b/keyboards/ergo42/keymaps/biacco-macOS/keymap.c index 7d897abbf8e..8299eb70110 100644 --- a/keyboards/ergo42/keymaps/biacco-macOS/keymap.c +++ b/keyboards/ergo42/keymaps/biacco-macOS/keymap.c @@ -7,10 +7,6 @@ extern keymap_config_t keymap_config; #define SYMB 2 #define GAME 3 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BASE diff --git a/keyboards/ergo42/keymaps/biacco-underglow/keymap.c b/keyboards/ergo42/keymaps/biacco-underglow/keymap.c index 7722eb0068e..3449192802a 100644 --- a/keyboards/ergo42/keymaps/biacco-underglow/keymap.c +++ b/keyboards/ergo42/keymaps/biacco-underglow/keymap.c @@ -8,10 +8,6 @@ extern keymap_config_t keymap_config; #define GAME 3 #define RGB 4 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #ifdef RGBLIGHT_ENABLE //Following line allows macro to read current RGB settings extern rgblight_config_t rgblight_config; diff --git a/keyboards/ergo42/keymaps/biacco/keymap.c b/keyboards/ergo42/keymaps/biacco/keymap.c index c567e5c758b..a6cc610529a 100644 --- a/keyboards/ergo42/keymaps/biacco/keymap.c +++ b/keyboards/ergo42/keymaps/biacco/keymap.c @@ -7,10 +7,6 @@ extern keymap_config_t keymap_config; #define SYMB 2 #define GAME 3 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BASE diff --git a/keyboards/ergo42/keymaps/default-illustrator/keymap.c b/keyboards/ergo42/keymaps/default-illustrator/keymap.c index 9e0f7fb2e96..62af6b2ab11 100644 --- a/keyboards/ergo42/keymaps/default-illustrator/keymap.c +++ b/keyboards/ergo42/keymaps/default-illustrator/keymap.c @@ -8,10 +8,6 @@ extern keymap_config_t keymap_config; #define GAME 3 #define ILLUST 4 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BASE diff --git a/keyboards/ergo42/keymaps/default-underglow/keymap.c b/keyboards/ergo42/keymaps/default-underglow/keymap.c index 4d7242579ac..212d9138df0 100644 --- a/keyboards/ergo42/keymaps/default-underglow/keymap.c +++ b/keyboards/ergo42/keymaps/default-underglow/keymap.c @@ -8,10 +8,6 @@ extern keymap_config_t keymap_config; #define GAME 3 #define RGB 4 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #ifdef RGBLIGHT_ENABLE //Following line allows macro to read current RGB settings extern rgblight_config_t rgblight_config; diff --git a/keyboards/ergo42/keymaps/default/keymap.c b/keyboards/ergo42/keymaps/default/keymap.c index 6c4cc1a620d..f99ec5fb667 100644 --- a/keyboards/ergo42/keymaps/default/keymap.c +++ b/keyboards/ergo42/keymaps/default/keymap.c @@ -7,10 +7,6 @@ extern keymap_config_t keymap_config; #define SYMB 2 #define GAME 3 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BASE diff --git a/keyboards/ergo42/keymaps/hdbx/keymap.c b/keyboards/ergo42/keymaps/hdbx/keymap.c index b7bddd55312..da579de01a9 100644 --- a/keyboards/ergo42/keymaps/hdbx/keymap.c +++ b/keyboards/ergo42/keymaps/hdbx/keymap.c @@ -26,9 +26,6 @@ enum custom_keycodes { // Use Dynamic macro #include "dynamic_macro.h" -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define KC_LOWR LT(_LOWER, KC_MHEN) // タップで無変換 ホールドでLower #define KC_RASE LT(_RAISE, KC_HENK) // タップで変換 ホールドでRaise #define KC_LSLB MT(MOD_LSFT, JP_LBRC) // タップで[ ホールドで左Shift diff --git a/keyboards/ergo42/keymaps/ichi-t/keymap.c b/keyboards/ergo42/keymaps/ichi-t/keymap.c index 82cda6df1dd..94d57936ed5 100644 --- a/keyboards/ergo42/keymaps/ichi-t/keymap.c +++ b/keyboards/ergo42/keymaps/ichi-t/keymap.c @@ -8,10 +8,6 @@ extern keymap_config_t keymap_config; #define _CMOVE 3 #define _WIN 4 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY diff --git a/keyboards/ergo42/keymaps/koba/keymap.c b/keyboards/ergo42/keymaps/koba/keymap.c index f05f78b9e7c..9bc504207fb 100644 --- a/keyboards/ergo42/keymaps/koba/keymap.c +++ b/keyboards/ergo42/keymaps/koba/keymap.c @@ -37,36 +37,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* WIN * ,------------------------------------------------. ,------------------------------------------------. - * | Esc | Tab | Q | W | E | R | T | | Y | U | I | O | P | @ ` | Bksp | - * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| - * | Del | Ctrl | A | S | D | F | G | | H | J | K | L | ; + | ; * |Enter | - * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Esc | Del | Q | W | E | R | T | | Y | U | I | O | P | @ ` | Bksp | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Tab | Ctrl | A | S | D | F | G | | H | J | K | L | ; + | ; * |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | H/Z |Shift | Z | X | C | V | B | | N | M | , < | . > | / ? | Up |Shift | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | Fn | Ctrl | Win | Alt | Mhen |LOWER |Space | |Space |RAISE | Henk | Menu | Left | Down |Right | * `------------------------------------------------' `------------------------------------------------' */ [_WIN] = LAYOUT( \ - KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, KC_BSPC, \ - KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, KC_ENT, \ + KC_ESC, KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, KC_BSPC, \ + KC_TAB, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, KC_ENT, \ KC_ZKHK, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ FN, KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, LOWER, KC_SPC, KC_SPC, RAISE, KC_HENK, KC_APP, KC_LEFT, KC_DOWN, KC_RGHT \ ), /* MACOS * ,------------------------------------------------. ,------------------------------------------------. - * | Esc | Tab | Q | W | E | R | T | | Y | U | I | O | P | @ ` | Bksp | - * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| - * | Del | Ctrl | A | S | D | F | G | | H | J | K | L | ; + | ; * |Enter | - * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Esc | Del | Q | W | E | R | T | | Y | U | I | O | P | @ ` | Bksp | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Tab | Ctrl | A | S | D | F | G | | H | J | K | L | ; + | ; * |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | Caps |Shift | Z | X | C | V | B | | N | M | , < | . > | / ? | Up |Shift | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | Fn | Ctrl | Opt | Cmd | Eisu |LOWER |Space | |Space |RAISE | Kana | Cmd | Left | Down |Right | * `------------------------------------------------' `------------------------------------------------' */ [_MACOS] = LAYOUT( \ - KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, KC_BSPC, \ - KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, KC_ENT, \ + KC_ESC, KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, KC_BSPC, \ + KC_TAB, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, KC_ENT, \ KC_CAPS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ FN, KC_LCTL, KC_LALT, KC_LGUI, KC_EISU, LOWER, KC_SPC, KC_SPC, RAISE, KC_KNA, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT \ ), @@ -74,9 +74,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* LOWER * ,------------------------------------------------. ,------------------------------------------------. * | | | ! | " | # | $ | % | | & | ' | ( | ) | | = | | - * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | | | XXXX | XXXX | XXXX | { | ( | | ) | } | XXXX | ~ | | | _ | | - * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | | | XXXX | XXXX | XXXX | XXXX | XXXX | | XXXX | XXXX | XXXX | XXXX | XXXX | PgUp | | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | | | | | | | | | | | | | Home | PgDn | End | @@ -92,9 +92,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* RAISE * ,------------------------------------------------. ,------------------------------------------------. * | | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | | - * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | | | F11 | F12 | XXXX | [ | ( | | ) | ] | XXXX | ^ | \ | \ | | - * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| * | | | | | | | | | | | | | | | | @@ -109,20 +109,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* FUNC * ,------------------------------------------------. ,------------------------------------------------. - * |Reset | | XXXX | XXXX | XXXX | XXXX | XXXX | |PrtSc |SLock |Pause | XXXX | XXXX | XXXX | | - * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| - * | | | XXXX | XXXX | XXXX | XXXX | >Win | | Ins | XXXX | XXXX | XXXX | XXXX | XXXX | | - * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| - * | | | XXXX | XXXX | XXXX | XXXX | >Mac | | XXXX | XXXX | XXXX | XXXX | XXXX | Vol+ | | + * |Reset | Ins | XXXX | XXXX | XXXX | XXXX | XXXX | | XXXX | XXXX |PrtSc |SrcLk |Pause | XXXX | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | XXXX | XXXX | XXXX | XXXX | >Win | | * | / | Home | PgUp | XXXX | XXXX | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Caps | | XXXX | XXXX | XXXX | XXXX | >Mac | | + | - | End | PgDn | XXXX | Vol+ | | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | Vol- | Play | + * | | | | | | | | | | | | | Mute | Vol- | Play | * `------------------------------------------------' `------------------------------------------------' */ [_FUNC] = LAYOUT( \ - RESET, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ - _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, WIN, KC_INS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ - _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MACOS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_VOLD, KC_MPLY \ + RESET, KC_INS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, _______, \ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, WIN, JP_ASTR, KC_SLSH, KC_HOME, KC_PGUP, XXXXXXX, XXXXXXX, _______, \ + KC_CAPS, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MACOS, JP_PLUS, KC_MINS, KC_END, KC_PGDN, XXXXXXX, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_MPLY \ ) }; diff --git a/keyboards/ergo42/keymaps/koba/readme.md b/keyboards/ergo42/keymaps/koba/readme.md index 1fe0543902f..bbf9c1c4a6c 100644 --- a/keyboards/ergo42/keymaps/koba/readme.md +++ b/keyboards/ergo42/keymaps/koba/readme.md @@ -6,12 +6,12 @@ This keymap is for Ergo42. - JIS layout. - Independent Windows layout/MacOS layout layers. -- Bottom row keys arranged like a standard keyboard. +- Bottom row keys are arranged like a standard keyboard. - Arrow keys are designed in the inverted-T. ## Layout -![keyboard-layout](https://user-images.githubusercontent.com/1042121/45888288-aa35ed00-bdf8-11e8-8741-71fe9a0fadc6.png) +![keyboard-layout](https://user-images.githubusercontent.com/1042121/52666273-32a45e00-2f51-11e9-9e15-c231155f3bed.png) ## Windows mode/MacOS mode diff --git a/keyboards/ergo42/keymaps/koba/readme_ja.md b/keyboards/ergo42/keymaps/koba/readme_ja.md index e1dbda821f0..188fb48310e 100644 --- a/keyboards/ergo42/keymaps/koba/readme_ja.md +++ b/keyboards/ergo42/keymaps/koba/readme_ja.md @@ -11,7 +11,7 @@ Ergo42 用キーマップです。 ## レイアウト -![keyboard-layout](https://user-images.githubusercontent.com/1042121/45888288-aa35ed00-bdf8-11e8-8741-71fe9a0fadc6.png) +![keyboard-layout](https://user-images.githubusercontent.com/1042121/52666273-32a45e00-2f51-11e9-9e15-c231155f3bed.png) ## Windows モード/MacOS モード diff --git a/keyboards/ergo42/keymaps/shinze/config.h b/keyboards/ergo42/keymaps/shinze/config.h new file mode 100644 index 00000000000..360d6a56217 --- /dev/null +++ b/keyboards/ergo42/keymaps/shinze/config.h @@ -0,0 +1,33 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + diff --git a/keyboards/ergo42/keymaps/shinze/keymap.c b/keyboards/ergo42/keymaps/shinze/keymap.c new file mode 100644 index 00000000000..4f4247deb6b --- /dev/null +++ b/keyboards/ergo42/keymaps/shinze/keymap.c @@ -0,0 +1,39 @@ +#include QMK_KEYBOARD_H +#include "keymap_bepo.h" +#include "keymap_french.h" + +extern keymap_config_t keymap_config; + +#define BASE 0 +#define NUMB 1 +#define SHORT 2 + +// Special keys +#define COPY RGUI(BP_C) +#define PASTE RGUI(BP_V) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE] = LAYOUT( \ + KC_TAB, BP_B, BP_ECUT, BP_P, BP_O, BP_EGRV, KC_ESC, KC_BSPC, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, \ + BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMM, _______, _______, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, \ + KC_LSFT, BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K, _______, _______, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, \ + MO(SHORT), KC_LCTL, _______, KC_LALT, KC_LGUI, KC_SPC, MO(NUMB), KC_RGUI, KC_RSFT, KC_SPC, _______, _______, _______, _______ \ + ), + + [NUMB] = LAYOUT( \ + BP_HASH, BP_DQOT, BP_LDQT, BP_RDQT, BP_LPRN, BP_RPRN, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, BP_EQL, BP_PERC, KC_BSPC, \ + BP_DLR, BP_1, BP_2, BP_3, BP_4, BP_5, KC_LBRC, KC_RBRC, BP_6, BP_7, BP_8, BP_9, BP_0, BP_DEGR, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + [SHORT] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, COPY, PASTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + +}; + diff --git a/keyboards/ergo42/keymaps/yshrsmz/keymap.c b/keyboards/ergo42/keymaps/yshrsmz/keymap.c index a4a83a2e1b3..55fe30e89b6 100644 --- a/keyboards/ergo42/keymaps/yshrsmz/keymap.c +++ b/keyboards/ergo42/keymaps/yshrsmz/keymap.c @@ -17,10 +17,6 @@ enum custom_keycodes { KANA }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BASE diff --git a/keyboards/ergo42/matrix.c b/keyboards/ergo42/matrix.c index fc42dd14d9d..328d16c77bf 100644 --- a/keyboards/ergo42/matrix.c +++ b/keyboards/ergo42/matrix.c @@ -37,11 +37,11 @@ along with this program. If not, see . # include "serial.h" #endif -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -145,7 +145,7 @@ uint8_t _matrix_scan(void) #if (DIODE_DIRECTION == COL2ROW) // Set row, read cols for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); if (matrix_changed) { @@ -162,7 +162,7 @@ uint8_t _matrix_scan(void) #elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); if (matrix_changed) { debouncing = true; @@ -175,8 +175,8 @@ uint8_t _matrix_scan(void) } #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { matrix[i+offset] = matrix_debouncing[i+offset]; } diff --git a/keyboards/ergo42/readme.md b/keyboards/ergo42/readme.md index 9534bc71312..112e62b551a 100644 --- a/keyboards/ergo42/readme.md +++ b/keyboards/ergo42/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make ergo42/rev1:default:avrdude -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/ergo42/rev1/config.h b/keyboards/ergo42/rev1/config.h index a7edb409724..68a5e2bbe5f 100644 --- a/keyboards/ergo42/rev1/config.h +++ b/keyboards/ergo42/rev1/config.h @@ -52,18 +52,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 @@ -87,5 +82,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - #endif diff --git a/keyboards/ergo42/rules.mk b/keyboards/ergo42/rules.mk index cdc9da90845..286c5fccb50 100644 --- a/keyboards/ergo42/rules.mk +++ b/keyboards/ergo42/rules.mk @@ -5,7 +5,6 @@ SRC += matrix.c \ ssd1306.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/ergodash/ergodash.h b/keyboards/ergodash/ergodash.h index bf2bac581eb..83c78593078 100644 --- a/keyboards/ergodash/ergodash.h +++ b/keyboards/ergodash/ergodash.h @@ -6,26 +6,6 @@ #ifdef KEYBOARD_ergodash_rev1 #include "rev1.h" - // Used to create a keymap using only KC_ prefixed keys - #define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ - KC_##LT0, KC_##LT1, KC_##LT2, KC_##LT3, KC_##LT4, KC_##LT5, KC_##RT0, KC_##RT1, KC_##RT2, KC_##RT3, KC_##RT4, KC_##RT5 \ - ) -#endif // #ifdef KEYBOARD_ergodash_rev1 - -#ifdef KEYBOARD_ergodash_rev2 - #include "rev2.h" - // Used to create a keymap using only KC_ prefixed keys #define LAYOUT_kc( \ L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ @@ -41,7 +21,7 @@ KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \ ) -#endif // #ifdef KEYBOARD_ergodash_rev2 +#endif // #ifdef KEYBOARD_ergodash_rev1 #ifdef KEYBOARD_ergodash_mini #include "mini.h" diff --git a/keyboards/ergodash/i2c.c b/keyboards/ergodash/i2c.c deleted file mode 100644 index 084c890c405..00000000000 --- a/keyboards/ergodash/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/ergodash/matrix.c b/keyboards/ergodash/matrix.c deleted file mode 100644 index bdf265a8749..00000000000 --- a/keyboards/ergodash/matrix.c +++ /dev/null @@ -1,490 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" - -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" - extern backlight_config_t backlight_config; -#endif - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define SERIAL_LED_ADDR 0x00 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col -#if (DIODE_DIRECTION == COL2ROW) - unselect_rows(); - init_cols(); -#elif (DIODE_DIRECTION == ROW2COL) - unselect_cols(); - init_rows(); -#endif - - TX_RX_LED_INIT; - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); - -} - -uint8_t _matrix_scan(void) -{ - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); -#if (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - PORTD ^= (1 << 2); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0); -#else - // Write zero, so our byte index is the same - err = i2c_master_write(0x00); -#endif - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_LED_ADDR] = backlight_config.enable ? backlight_config.level : 0; -#endif - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(i2c_slave_buffer[0]); -#endif - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i+1] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); -#endif -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/ergodash/mini/config.h b/keyboards/ergodash/mini/config.h index 11cff145e18..2fa51dcc126 100644 --- a/keyboards/ergodash/mini/config.h +++ b/keyboards/ergodash/mini/config.h @@ -45,10 +45,6 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST #define C6_AUDIO -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(STARTUP_SOUND) - #define GOODBYE_SONG SONG(GOODBYE_SOUND) -#endif /* number of backlight levels */ #ifdef BACKLIGHT_ENABLE @@ -59,37 +55,27 @@ along with this program. If not, see . #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 - -#define RGBLED_NUM 20 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 10, 10 } // Number of LEDs + +#define SOFT_SERIAL_PIN D0 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/ergodash/mini/keymaps/default/config.h b/keyboards/ergodash/mini/keymaps/default/config.h index a5a722fb2a3..df04873a97e 100644 --- a/keyboards/ergodash/mini/keymaps/default/config.h +++ b/keyboards/ergodash/mini/keymaps/default/config.h @@ -20,6 +20,7 @@ along with this program. If not, see . #pragma once + /* Use I2C or Serial, not both */ #define USE_SERIAL @@ -30,10 +31,3 @@ along with this program. If not, see . #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 20 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/ergodash/mini/keymaps/default/keymap.c b/keyboards/ergodash/mini/keymaps/default/keymap.c index ecf1f723f7a..35cbd87a36a 100644 --- a/keyboards/ergodash/mini/keymaps/default/keymap.c +++ b/keyboards/ergodash/mini/keymaps/default/keymap.c @@ -14,9 +14,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define EISU LALT(KC_GRV) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/ergodash/mini/keymaps/default/rules.mk b/keyboards/ergodash/mini/keymaps/default/rules.mk index e69de29bb2d..bb9e33b0829 100644 --- a/keyboards/ergodash/mini/keymaps/default/rules.mk +++ b/keyboards/ergodash/mini/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no +AUDIO_ENABLE = no diff --git a/keyboards/ergodash/mini/rules.mk b/keyboards/ergodash/mini/rules.mk index b6c9a258059..bb9e33b0829 100644 --- a/keyboards/ergodash/mini/rules.mk +++ b/keyboards/ergodash/mini/rules.mk @@ -1,2 +1,3 @@ BACKLIGHT_ENABLE = no RGBLIGHT_ENABLE = no +AUDIO_ENABLE = no diff --git a/keyboards/ergodash/readme.md b/keyboards/ergodash/readme.md index 7fa76344f1d..27672c3ecf3 100644 --- a/keyboards/ergodash/readme.md +++ b/keyboards/ergodash/readme.md @@ -9,10 +9,24 @@ Hardware Availability: Order your own [yourself](https://github.com/omkbd/ErgoDa Make example for this keyboard (after setting up your build environment): - make ergodash/rev2:default + make ergodash/rev1:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +Install Example: (for pro micro) + `make ergodash/rev1:default:avrdude` + +Note: + "rev1" is for PCB ver 1.0,1.1,1.2 + **The original Rev 1 was owned only by the designer. Therefore, Rev1 has been removed. Since the current PCB is Rev1, we changed Rev2 to Rev1 to match the firmware version.** + + # Layout ![layout](https://github.com/omkbd/picture/blob/master/ergodash-layout.png) + +Layout Note: +- In thumb cluster, it is not possible to use all 5 positions as small keys. (as pictured) +- The top 2 1u keys in the thumb cluster share the same connection. +- 2u key (center) position shares with the lower 1u key position + ![PCB](https://github.com/omkbd/picture/blob/master/Ergodash_PCB.jpg) diff --git a/keyboards/ergodash/rev1/config.h b/keyboards/ergodash/rev1/config.h index d3f3314ee61..52f81e4ac9d 100644 --- a/keyboards/ergodash/rev1/config.h +++ b/keyboards/ergodash/rev1/config.h @@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once #include "config_common.h" @@ -35,9 +34,9 @@ along with this program. If not, see . #define MATRIX_COLS 7 // wiring of each half -#define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } -#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } -// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order /* define tapping term */ #define TAPPING_TERM 120 @@ -45,44 +44,38 @@ along with this program. If not, see . /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST +#define C6_AUDIO + /* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 +#ifdef BACKLIGHT_ENABLE + #define BACKLIGHT_PIN B6 + #define BACKLIGHT_LEVELS 7 +// #define BACKLIGHT_BREATHING +// #define BREATHING_PERIOD 4 +#endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 - -#define RGBLED_NUM 24 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - - -#endif +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 24 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 12, 12 } // Number of LEDs + +#define SOFT_SERIAL_PIN D0 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/ergodash/rev1/info.json b/keyboards/ergodash/rev1/info.json index f5ed321de66..de8b0c070e0 100644 --- a/keyboards/ergodash/rev1/info.json +++ b/keyboards/ergodash/rev1/info.json @@ -1,13 +1,366 @@ { - "keyboard_name": "ErgoDash rev1", - "url": "", - "maintainer": "qmk", - "width": 16, - "height": 6.25, - "layouts": { - "LAYOUT": { - "key_count": 68, - "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.375}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.75}, {"label":"R00", "x":9, "y":0.75}, {"label":"R01", "x":10, "y":0.25}, {"label":"R02", "x":11, "y":0.125}, {"label":"R03", "x":12, "y":0}, {"label":"R04", "x":13, "y":0.125}, {"label":"R05", "x":14, "y":0.375}, {"label":"R06", "x":15, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.375}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.75}, {"label":"R10", "x":9, "y":1.75}, {"label":"R11", "x":10, "y":1.25}, {"label":"R12", "x":11, "y":1.125}, {"label":"R13", "x":12, "y":1}, {"label":"R14", "x":13, "y":1.125}, {"label":"R15", "x":14, "y":1.375}, {"label":"R16", "x":15, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.375}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6, "y":2.75}, {"label":"R20", "x":9, "y":2.75}, {"label":"R21", "x":10, "y":2.25}, {"label":"R22", "x":11, "y":2.125}, {"label":"R23", "x":12, "y":2}, {"label":"R24", "x":13, "y":2.125}, {"label":"R25", "x":14, "y":2.375}, {"label":"R26", "x":15, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.375}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3.125}, {"label":"L35", "x":5, "y":3.25}, {"label":"L36", "x":6.5, "y":4.25}, {"label":"R30", "x":8.5, "y":4.25}, {"label":"R31", "x":10, "y":3.25}, {"label":"R32", "x":11, "y":3.125}, {"label":"R33", "x":12, "y":3}, {"label":"R34", "x":13, "y":3.125}, {"label":"R35", "x":14, "y":3.375}, {"label":"R36", "x":15, "y":3.375}, {"label":"LT0", "x":0, "y":4.375}, {"label":"LT1", "x":1, "y":4.375}, {"label":"LT2", "x":2, "y":4.125}, {"label":"LT3", "x":3, "y":4}, {"label":"LT4", "x":5.5, "y":5.25}, {"label":"LT5", "x":6.5, "y":5.25}, {"label":"RT0", "x":8.5, "y":5.25}, {"label":"RT1", "x":9.5, "y":5.25}, {"label":"RT2", "x":12, "y":4}, {"label":"RT3", "x":13, "y":4.125}, {"label":"RT4", "x":14, "y":4.375}, {"label":"RT5", "x":15, "y":4.375}] + "keyboard_name": "ErgoDash rev1.2", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 8.375, + "layouts": { + "LAYOUT_4key": { + "layout": [ + {"y": 0.375, "x": 0.5, "label": "L00"}, + {"y": 0.375, "x": 1.5, "label": "L01"}, + {"y": 0.125, "x": 2.5, "label": "L02"}, + {"y": 0, "x": 3.5, "label": "L03"}, + {"y": 0.125, "x": 4.5, "label": "L04"}, + {"y": 0.25, "x": 5.5, "label": "L05"}, + {"y": 0.75, "x": 6.5, "label": "L06"}, + {"y": 0.75, "x": 12, "label": "R00"}, + {"y": 0.25, "x": 13, "label": "R01"}, + {"y": 0.125, "x": 14, "label": "R02"}, + {"y": 0, "x": 15, "label": "R03"}, + {"y": 0.125, "x": 16, "label": "R04"}, + {"y": 0.375, "x": 17, "label": "R05"}, + {"y": 0.375, "x": 18, "label": "R06"}, + {"y": 1.375, "x": 0.5, "label": "L10"}, + {"y": 1.375, "x": 1.5, "label": "L11"}, + {"y": 1.125, "x": 2.5, "label": "L12"}, + {"y": 1, "x": 3.5, "label": "L13"}, + {"y": 1.125, "x": 4.5, "label": "L14"}, + {"y": 1.25, "x": 5.5, "label": "L15"}, + {"y": 1.75, "x": 6.5, "label": "L16"}, + {"y": 1.75, "x": 12, "label": "R10"}, + {"y": 1.25, "x": 13, "label": "R11"}, + {"y": 1.125, "x": 14, "label": "R12"}, + {"y": 1, "x": 15, "label": "R13"}, + {"y": 1.125, "x": 16, "label": "R14"}, + {"y": 1.375, "x": 17, "label": "R15"}, + {"y": 1.375, "x": 18, "label": "R16"}, + {"y": 2.375, "x": 0.5, "label": "L20"}, + {"y": 2.375, "x": 1.5, "label": "L21"}, + {"y": 2.125, "x": 2.5, "label": "L22"}, + {"y": 2, "x": 3.5, "label": "L23"}, + {"y": 2.125, "x": 4.5, "label": "L24"}, + {"y": 2.25, "x": 5.5, "label": "L25"}, + {"y": 2.75, "x": 6.5, "label": "L26"}, + {"y": 2.75, "x": 12, "label": "R20"}, + {"y": 2.25, "x": 13, "label": "R21"}, + {"y": 2.125, "x": 14, "label": "R22"}, + {"y": 2, "x": 15, "label": "R23"}, + {"y": 2.125, "x": 16, "label": "R24"}, + {"y": 2.375, "x": 17, "label": "R25"}, + {"y": 2.375, "x": 18, "label": "R26"}, + {"y": 3.375, "x": 0.5, "label": "L30"}, + {"y": 3.375, "x": 1.5, "label": "L31"}, + {"y": 3.125, "x": 2.5, "label": "L32"}, + {"y": 3, "x": 3.5, "label": "L33"}, + {"y": 3.125, "x": 4.5, "label": "L34"}, + {"y": 3.25, "x": 5.5, "label": "L35"}, + {"y": 4, "x": 6.5, "label": "L36"}, + {"y": 4, "x": 12, "label": "R30"}, + {"y": 3.25, "x": 13, "label": "R31"}, + {"y": 3.125, "x": 14, "label": "R32"}, + {"y": 3, "x": 15, "label": "R33"}, + {"y": 3.125, "x": 16, "label": "R34"}, + {"y": 3.375, "x": 17, "label": "R35"}, + {"y": 3.375, "x": 18, "label": "R36"}, + {"y": 4.375, "x": 0.5, "label": "L40"}, + {"y": 4.375, "x": 1.5, "label": "L41"}, + {"y": 4.125, "x": 2.5, "label": "L42"}, + {"y": 4, "x": 3.5, "label": "L43"}, + {"y": 5, "x": 5.5, "label": "L44"}, + {"y": 5, "x": 6.5, "label": "L45"}, + {"h": 2, "y": 4, "x": 7.5, "label": "L46"}, + {"h": 2, "y": 4, "x": 11, "label": "R40"}, + {"y": 5, "x": 12, "label": "R41"}, + {"y": 5, "x": 13, "label": "R42"}, + {"y": 4, "x": 15, "label": "R43"}, + {"y": 4.125, "x": 16, "label": "R44"}, + {"y": 4.375, "x": 17, "label": "R45"}, + {"y": 4.375, "x": 18, "label": "R46"}] + }, + "LAYOUT_4key_2u_inner": { + "layout": [ + {"y": 0.375, "x": 0.5, "label": "L00"}, + {"y": 0.375, "x": 1.5, "label": "L01"}, + {"y": 0.125, "x": 2.5, "label": "L02"}, + {"y": 0, "x": 3.5, "label": "L03"}, + {"y": 0.125, "x": 4.5, "label": "L04"}, + {"y": 0.25, "x": 5.5, "label": "L05"}, + {"y": 0.75, "x": 6.5, "label": "L06"}, + {"y": 0.75, "x": 12, "label": "R00"}, + {"y": 0.25, "x": 13, "label": "R01"}, + {"y": 0.125, "x": 14, "label": "R02"}, + {"y": 0, "x": 15, "label": "R03"}, + {"y": 0.125, "x": 16, "label": "R04"}, + {"y": 0.375, "x": 17, "label": "R05"}, + {"y": 0.375, "x": 18, "label": "R06"}, + {"y": 1.375, "x": 0.5, "label": "L10"}, + {"y": 1.375, "x": 1.5, "label": "L11"}, + {"y": 1.125, "x": 2.5, "label": "L12"}, + {"y": 1, "x": 3.5, "label": "L13"}, + {"y": 1.125, "x": 4.5, "label": "L14"}, + {"y": 1.25, "x": 5.5, "label": "L15"}, + {"y": 1.75, "x": 6.5, "label": "L16"}, + {"y": 1.75, "x": 12, "label": "R10"}, + {"y": 1.25, "x": 13, "label": "R11"}, + {"y": 1.125, "x": 14, "label": "R12"}, + {"y": 1, "x": 15, "label": "R13"}, + {"y": 1.125, "x": 16, "label": "R14"}, + {"y": 1.375, "x": 17, "label": "R15"}, + {"y": 1.375, "x": 18, "label": "R16"}, + {"y": 2.375, "x": 0.5, "label": "L20"}, + {"y": 2.375, "x": 1.5, "label": "L21"}, + {"y": 2.125, "x": 2.5, "label": "L22"}, + {"y": 2, "x": 3.5, "label": "L23"}, + {"y": 2.125, "x": 4.5, "label": "L24"}, + {"y": 2.25, "x": 5.5, "label": "L25"}, + {"y": 2.75, "x": 6.5, "label": "L26"}, + {"y": 2.75, "x": 12, "label": "R20"}, + {"y": 2.25, "x": 13, "label": "R21"}, + {"y": 2.125, "x": 14, "label": "R22"}, + {"y": 2, "x": 15, "label": "R23"}, + {"y": 2.125, "x": 16, "label": "R24"}, + {"y": 2.375, "x": 17, "label": "R25"}, + {"y": 2.375, "x": 18, "label": "R26"}, + {"y": 3.375, "x": 0.5, "label": "L30"}, + {"y": 3.375, "x": 1.5, "label": "L31"}, + {"y": 3.125, "x": 2.5, "label": "L32"}, + {"y": 3, "x": 3.5, "label": "L33"}, + {"y": 3.125, "x": 4.5, "label": "L34"}, + {"y": 3.25, "x": 5.5, "label": "L35"}, + {"y": 4, "x": 7.5, "label": "L36"}, + {"y": 4, "x": 11, "label": "R30"}, + {"y": 3.25, "x": 13, "label": "R31"}, + {"y": 3.125, "x": 14, "label": "R32"}, + {"y": 3, "x": 15, "label": "R33"}, + {"y": 3.125, "x": 16, "label": "R34"}, + {"y": 3.375, "x": 17, "label": "R35"}, + {"y": 3.375, "x": 18, "label": "R36"}, + {"y": 4.375, "x": 0.5, "label": "L40"}, + {"y": 4.375, "x": 1.5, "label": "L41"}, + {"y": 4.125, "x": 2.5, "label": "L42"}, + {"y": 4, "x": 3.5, "label": "L43"}, + {"y": 5, "x": 5.5, "label": "L44"}, + {"h": 2, "y": 4, "x": 6.5, "label": "L45"}, + {"y": 5, "x": 7.5, "label": "L46"}, + {"y": 5, "x": 11, "label": "R40"}, + {"h": 2, "y": 4, "x": 12, "label": "R41"}, + {"y": 5, "x": 13, "label": "R42"}, + {"y": 4, "x": 15, "label": "R43"}, + {"y": 4.125, "x": 16, "label": "R44"}, + {"y": 4.375, "x": 17, "label": "R45"}, + {"y": 4.375, "x": 18, "label": "R46"}] + }, + "LAYOUT_3key_2us": { + "layout": [ + {"y": 0.375, "x": 0.5, "label": "L00"}, + {"y": 0.375, "x": 1.5, "label": "L01"}, + {"y": 0.125, "x": 2.5, "label": "L02"}, + {"y": 0, "x": 3.5, "label": "L03"}, + {"y": 0.125, "x": 4.5, "label": "L04"}, + {"y": 0.25, "x": 5.5, "label": "L05"}, + {"y": 0.75, "x": 6.5, "label": "L06"}, + {"y": 0.75, "x": 12, "label": "R00"}, + {"y": 0.25, "x": 13, "label": "R01"}, + {"y": 0.125, "x": 14, "label": "R02"}, + {"y": 0, "x": 15, "label": "R03"}, + {"y": 0.125, "x": 16, "label": "R04"}, + {"y": 0.375, "x": 17, "label": "R05"}, + {"y": 0.375, "x": 18, "label": "R06"}, + {"y": 1.375, "x": 0.5, "label": "L10"}, + {"y": 1.375, "x": 1.5, "label": "L11"}, + {"y": 1.125, "x": 2.5, "label": "L12"}, + {"y": 1, "x": 3.5, "label": "L13"}, + {"y": 1.125, "x": 4.5, "label": "L14"}, + {"y": 1.25, "x": 5.5, "label": "L15"}, + {"y": 1.75, "x": 6.5, "label": "L16"}, + {"y": 1.75, "x": 12, "label": "R10"}, + {"y": 1.25, "x": 13, "label": "R11"}, + {"y": 1.125, "x": 14, "label": "R12"}, + {"y": 1, "x": 15, "label": "R13"}, + {"y": 1.125, "x": 16, "label": "R14"}, + {"y": 1.375, "x": 17, "label": "R15"}, + {"y": 1.375, "x": 18, "label": "R16"}, + {"y": 2.375, "x": 0.5, "label": "L20"}, + {"y": 2.375, "x": 1.5, "label": "L21"}, + {"y": 2.125, "x": 2.5, "label": "L22"}, + {"y": 2, "x": 3.5, "label": "L23"}, + {"y": 2.125, "x": 4.5, "label": "L24"}, + {"y": 2.25, "x": 5.5, "label": "L25"}, + {"y": 2.75, "x": 6.5, "label": "L26"}, + {"y": 2.75, "x": 12, "label": "R20"}, + {"y": 2.25, "x": 13, "label": "R21"}, + {"y": 2.125, "x": 14, "label": "R22"}, + {"y": 2, "x": 15, "label": "R23"}, + {"y": 2.125, "x": 16, "label": "R24"}, + {"y": 2.375, "x": 17, "label": "R25"}, + {"y": 2.375, "x": 18, "label": "R26"}, + {"y": 3.375, "x": 0.5, "label": "L30"}, + {"y": 3.375, "x": 1.5, "label": "L31"}, + {"y": 3.125, "x": 2.5, "label": "L32"}, + {"y": 3, "x": 3.5, "label": "L33"}, + {"y": 3.125, "x": 4.5, "label": "L34"}, + {"y": 3.25, "x": 5.5, "label": "L35"}, + {"y": 3.25, "x": 13, "label": "R31"}, + {"y": 3.125, "x": 14, "label": "R32"}, + {"y": 3, "x": 15, "label": "R33"}, + {"y": 3.125, "x": 16, "label": "R34"}, + {"y": 3.375, "x": 17, "label": "R35"}, + {"y": 3.375, "x": 18, "label": "R36"}, + {"y": 4.375, "x": 0.5, "label": "L40"}, + {"y": 4.375, "x": 1.5, "label": "L41"}, + {"y": 4.125, "x": 2.5, "label": "L42"}, + {"y": 4, "x": 3.5, "label": "L43"}, + {"y": 5, "x": 5.5, "label": "L44"}, + {"h": 2, "y": 4, "x": 6.5, "label": "L45"}, + {"h": 2, "y": 4, "x": 7.5, "label": "L46"}, + {"h": 2, "y": 4, "x": 11, "label": "R40"}, + {"h": 2, "y": 4, "x": 12, "label": "R41"}, + {"y": 5, "x": 13, "label": "R42"}, + {"y": 4, "x": 15, "label": "R43"}, + {"y": 4.125, "x": 16, "label": "R44"}, + {"y": 4.375, "x": 17, "label": "R45"}, + {"y": 4.375, "x": 18, "label": "R46"}] + }, + "LAYOUT_3key_1us": { + "layout": [ + {"y": 0.375, "x": 0.5, "label": "L00"}, + {"y": 0.375, "x": 1.5, "label": "L01"}, + {"y": 0.125, "x": 2.5, "label": "L02"}, + {"y": 0, "x": 3.5, "label": "L03"}, + {"y": 0.125, "x": 4.5, "label": "L04"}, + {"y": 0.25, "x": 5.5, "label": "L05"}, + {"y": 0.75, "x": 6.5, "label": "L06"}, + {"y": 0.75, "x": 12, "label": "R00"}, + {"y": 0.25, "x": 13, "label": "R01"}, + {"y": 0.125, "x": 14, "label": "R02"}, + {"y": 0, "x": 15, "label": "R03"}, + {"y": 0.125, "x": 16, "label": "R04"}, + {"y": 0.375, "x": 17, "label": "R05"}, + {"y": 0.375, "x": 18, "label": "R06"}, + {"y": 1.375, "x": 0.5, "label": "L10"}, + {"y": 1.375, "x": 1.5, "label": "L11"}, + {"y": 1.125, "x": 2.5, "label": "L12"}, + {"y": 1, "x": 3.5, "label": "L13"}, + {"y": 1.125, "x": 4.5, "label": "L14"}, + {"y": 1.25, "x": 5.5, "label": "L15"}, + {"y": 1.75, "x": 6.5, "label": "L16"}, + {"y": 1.75, "x": 12, "label": "R10"}, + {"y": 1.25, "x": 13, "label": "R11"}, + {"y": 1.125, "x": 14, "label": "R12"}, + {"y": 1, "x": 15, "label": "R13"}, + {"y": 1.125, "x": 16, "label": "R14"}, + {"y": 1.375, "x": 17, "label": "R15"}, + {"y": 1.375, "x": 18, "label": "R16"}, + {"y": 2.375, "x": 0.5, "label": "L20"}, + {"y": 2.375, "x": 1.5, "label": "L21"}, + {"y": 2.125, "x": 2.5, "label": "L22"}, + {"y": 2, "x": 3.5, "label": "L23"}, + {"y": 2.125, "x": 4.5, "label": "L24"}, + {"y": 2.25, "x": 5.5, "label": "L25"}, + {"y": 2.75, "x": 6.5, "label": "L26"}, + {"y": 2.75, "x": 12, "label": "R20"}, + {"y": 2.25, "x": 13, "label": "R21"}, + {"y": 2.125, "x": 14, "label": "R22"}, + {"y": 2, "x": 15, "label": "R23"}, + {"y": 2.125, "x": 16, "label": "R24"}, + {"y": 2.375, "x": 17, "label": "R25"}, + {"y": 2.375, "x": 18, "label": "R26"}, + {"y": 3.375, "x": 0.5, "label": "L30"}, + {"y": 3.375, "x": 1.5, "label": "L31"}, + {"y": 3.125, "x": 2.5, "label": "L32"}, + {"y": 3, "x": 3.5, "label": "L33"}, + {"y": 3.125, "x": 4.5, "label": "L34"}, + {"y": 3.25, "x": 5.5, "label": "L35"}, + {"y": 4, "x": 6.5, "label": "L36"}, + {"y": 4, "x": 12, "label": "R30"}, + {"y": 3.25, "x": 13, "label": "R31"}, + {"y": 3.125, "x": 14, "label": "R32"}, + {"y": 3, "x": 15, "label": "R33"}, + {"y": 3.125, "x": 16, "label": "R34"}, + {"y": 3.375, "x": 17, "label": "R35"}, + {"y": 3.375, "x": 18, "label": "R36"}, + {"y": 4.375, "x": 0.5, "label": "L40"}, + {"y": 4.375, "x": 1.5, "label": "L41"}, + {"y": 4.125, "x": 2.5, "label": "L42"}, + {"y": 4, "x": 3.5, "label": "L43"}, + {"y": 5, "x": 5.5, "label": "L44"}, + {"y": 5, "x": 6.5, "label": "L45"}, + {"y": 5, "x": 12, "label": "R41"}, + {"y": 5, "x": 13, "label": "R42"}, + {"y": 4, "x": 15, "label": "R43"}, + {"y": 4.125, "x": 16, "label": "R44"}, + {"y": 4.375, "x": 17, "label": "R45"}, + {"y": 4.375, "x": 18, "label": "R46"}] + }, + "LAYOUT_2key": { + "layout": [ + {"y": 0.375, "x": 0.5, "label": "L00"}, + {"y": 0.375, "x": 1.5, "label": "L01"}, + {"y": 0.125, "x": 2.5, "label": "L02"}, + {"y": 0, "x": 3.5, "label": "L03"}, + {"y": 0.125, "x": 4.5, "label": "L04"}, + {"y": 0.25, "x": 5.5, "label": "L05"}, + {"y": 0.75, "x": 6.5, "label": "L06"}, + {"y": 0.75, "x": 12, "label": "R00"}, + {"y": 0.25, "x": 13, "label": "R01"}, + {"y": 0.125, "x": 14, "label": "R02"}, + {"y": 0, "x": 15, "label": "R03"}, + {"y": 0.125, "x": 16, "label": "R04"}, + {"y": 0.375, "x": 17, "label": "R05"}, + {"y": 0.375, "x": 18, "label": "R06"}, + {"y": 1.375, "x": 0.5, "label": "L10"}, + {"y": 1.375, "x": 1.5, "label": "L11"}, + {"y": 1.125, "x": 2.5, "label": "L12"}, + {"y": 1, "x": 3.5, "label": "L13"}, + {"y": 1.125, "x": 4.5, "label": "L14"}, + {"y": 1.25, "x": 5.5, "label": "L15"}, + {"y": 1.75, "x": 6.5, "label": "L16"}, + {"y": 1.75, "x": 12, "label": "R10"}, + {"y": 1.25, "x": 13, "label": "R11"}, + {"y": 1.125, "x": 14, "label": "R12"}, + {"y": 1, "x": 15, "label": "R13"}, + {"y": 1.125, "x": 16, "label": "R14"}, + {"y": 1.375, "x": 17, "label": "R15"}, + {"y": 1.375, "x": 18, "label": "R16"}, + {"y": 2.375, "x": 0.5, "label": "L20"}, + {"y": 2.375, "x": 1.5, "label": "L21"}, + {"y": 2.125, "x": 2.5, "label": "L22"}, + {"y": 2, "x": 3.5, "label": "L23"}, + {"y": 2.125, "x": 4.5, "label": "L24"}, + {"y": 2.25, "x": 5.5, "label": "L25"}, + {"y": 2.75, "x": 6.5, "label": "L26"}, + {"y": 2.75, "x": 12, "label": "R20"}, + {"y": 2.25, "x": 13, "label": "R21"}, + {"y": 2.125, "x": 14, "label": "R22"}, + {"y": 2, "x": 15, "label": "R23"}, + {"y": 2.125, "x": 16, "label": "R24"}, + {"y": 2.375, "x": 17, "label": "R25"}, + {"y": 2.375, "x": 18, "label": "R26"}, + {"y": 3.375, "x": 0.5, "label": "L30"}, + {"y": 3.375, "x": 1.5, "label": "L31"}, + {"y": 3.125, "x": 2.5, "label": "L32"}, + {"y": 3, "x": 3.5, "label": "L33"}, + {"y": 3.125, "x": 4.5, "label": "L34"}, + {"y": 3.25, "x": 5.5, "label": "L35"}, + {"y": 3.25, "x": 13, "label": "R31"}, + {"y": 3.125, "x": 14, "label": "R32"}, + {"y": 3, "x": 15, "label": "R33"}, + {"y": 3.125, "x": 16, "label": "R34"}, + {"y": 3.375, "x": 17, "label": "R35"}, + {"y": 3.375, "x": 18, "label": "R36"}, + {"y": 4.375, "x": 0.5, "label": "L40"}, + {"y": 4.375, "x": 1.5, "label": "L41"}, + {"y": 4.125, "x": 2.5, "label": "L42"}, + {"y": 4, "x": 3.5, "label": "L43"}, + {"y": 5, "x": 5.5, "label": "L44"}, + {"h": 2, "y": 4, "x": 6.5, "label": "L45"}, + {"h": 2, "y": 4, "x": 12, "label": "R41"}, + {"y": 5, "x": 13, "label": "R42"}, + {"y": 4, "x": 15, "label": "R43"}, + {"y": 4.125, "x": 16, "label": "R44"}, + {"y": 4.375, "x": 17, "label": "R45"}, + {"y": 4.375, "x": 18, "label": "R46"}] + } } - } } diff --git a/keyboards/ergodash/rev1/keymaps/333fred/config.h b/keyboards/ergodash/rev1/keymaps/333fred/config.h new file mode 100644 index 00000000000..e48702fd6b0 --- /dev/null +++ b/keyboards/ergodash/rev1/keymaps/333fred/config.h @@ -0,0 +1,10 @@ +#pragma once + +#include QMK_KEYBOARD_CONFIG_H +#include "333fred_config.h" + +#define USE_SERIAL +#define MASTER_LEFT + +#undef TAPPING_TERM +#define TAPPING_TERM 200 diff --git a/keyboards/ergodash/rev1/keymaps/333fred/keymap.c b/keyboards/ergodash/rev1/keymaps/333fred/keymap.c new file mode 100644 index 00000000000..8ed826d5a12 --- /dev/null +++ b/keyboards/ergodash/rev1/keymaps/333fred/keymap.c @@ -0,0 +1,57 @@ +#include QMK_KEYBOARD_H +#include "333fred.h" + +extern keymap_config_t keymap_config; + +// Use an expanded macro with VA_ARGS to ensure that the common +// rows get expanded out before getting passed to the LAYOUT +// macro. + +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_wrapper( \ + ROW5_LEFT_BASE, KC_F5, KC_F6, ROW5_RGHT_BASE, + ROW4_LEFT_BASE, TG(GAME), TG(GAME_ARROW), ROW4_RGHT_BASE, + ROW3_LEFT_BASE, KC_LGUI, KC_BSPC, ROW3_RGHT_BASE, + ROW2_LEFT_BASE, TD(TD_COPY_PASTE), KC_UP , ROW2_RGHT_BASE, + ROW1_LEFT_BASE, KC_BSPC, TD(TD_SYM_VIM), KC_DEL, KC_ENT, KC_SPC , KC_DOWN, ROW1_RGHT_BASE + ), + + [SYMB] = LAYOUT_wrapper( + ROW5_LEFT_SYMB, _______, _______, ROW5_RGHT_SYMB, + ROW4_LEFT_SYMB, PSCREEN_APP, _______, ROW4_RGHT_SYMB, + ROW3_LEFT_SYMB, KC_PSCR, KC_VOLU, ROW3_RGHT_SYMB, + ROW2_LEFT_SYMB, _______, KC_VOLD, ROW2_RGHT_SYMB, + ROW1_LEFT_SYMB, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, ROW1_RGHT_SYMB + ), + + [VIM] = LAYOUT_wrapper( + ROW5_LEFT_VIM, _______, _______, ROW5_RGHT_VIM, + ROW4_LEFT_VIM, _______, _______, ROW4_RGHT_VIM, + ROW3_LEFT_VIM, _______, _______, ROW3_RGHT_VIM, + ROW2_LEFT_VIM, _______, _______, ROW2_RGHT_VIM, + ROW1_LEFT_VIM, _______, _______, _______, _______, _______, _______, ROW1_RGHT_VIM + ), + + [GAME] = LAYOUT_wrapper( + KC_ESC, SIX_TRNS, _______, SIX_TRNS, + SIX_TRNS, _______, _______, SIX_TRNS, + KC_LCTL, FOUR_TRNS, _______, KC_F6, _______, SIX_TRNS, + KC_LSFT, KC_Z, FOUR_TRNS, KC_F5, _______, SIX_TRNS, + KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSM(SYMB), _______, SIX_TRNS + ), + + [GAME_ARROW] = LAYOUT_wrapper( + KC_ESC, SIX_TRNS, _______, SIX_TRNS, + _______, _______, KC_UP, _______, _______, _______, _______, _______, SIX_TRNS, + KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_F6, _______, SIX_TRNS, + KC_LSFT, KC_Z, FOUR_TRNS, KC_F5, _______, SIX_TRNS, + KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSM(SYMB), _______, SIX_TRNS + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_process_keycode(keycode); + return !try_handle_macro(keycode, record); +} diff --git a/keyboards/ergodash/rev1/keymaps/333fred/rules.mk b/keyboards/ergodash/rev1/keymaps/333fred/rules.mk new file mode 100644 index 00000000000..9d8ff37e11d --- /dev/null +++ b/keyboards/ergodash/rev1/keymaps/333fred/rules.mk @@ -0,0 +1,7 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no +NKRO_ENABLE = yes +KEY_LOCK_ENABLE = yes +TAP_DANCE_ENABLE = yes +CONSOLE_ENABLE = no diff --git a/keyboards/ergodash/rev1/keymaps/default/config.h b/keyboards/ergodash/rev1/keymaps/default/config.h index 7e7fe4f69a8..df04873a97e 100644 --- a/keyboards/ergodash/rev1/keymaps/default/config.h +++ b/keyboards/ergodash/rev1/keymaps/default/config.h @@ -18,10 +18,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" /* Use I2C or Serial, not both */ @@ -33,12 +31,3 @@ along with this program. If not, see . #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - -#endif - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 24 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/ergodash/rev1/keymaps/default/keymap.c b/keyboards/ergodash/rev1/keymaps/default/keymap.c index 1464fd20e0c..61539987482 100644 --- a/keyboards/ergodash/rev1/keymaps/default/keymap.c +++ b/keyboards/ergodash/rev1/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" extern keymap_config_t keymap_config; @@ -16,95 +14,92 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_JPN LALT(KC_GRV) +#define EISU LALT(KC_GRV) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty - * ,-------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | [ | ] | 6 | 7 | 8 | 9 | 0 | Caps | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Q | W | E | R | T | - | = | Y | U | I | O | P | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | A | S | D | F | G | Del | Bksp | H | J | K | L | ; | " | - * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | JPN | Enter| N | M | , | . | / | Shift| - * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | Ctrl | GUI | ALt |Adjust| |Lower | Space |Enter |Raise| | Left| Down | Up | Right| - * ,-------------------------------------------------------------------------------------------------. + * ,----------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 |Pscree| + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | ` | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | Del | | Bksp | H | J | K | L | ; | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | Space| | Enter| N | M | , | . | / | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| Del |||||||| Bksp | Enter| Raise|||||||| Left | Down | Up | Right| + * ,----------------------------------------------------------------------------------------------------------------------. */ [_QWERTY] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CAPS, \ - KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_JPN , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC , KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, \ + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower - * ,-------------------------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | { | } | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | _ | + | ^ | & | * | ( | ) | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | 1 | 2 | 3 | 4 | 5 | Del | Bksp | H | J | K | L | : | " | - * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | JPN | Enter| N | M | < | > | ? | Shift| - * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | Ctrl | GUI | ALt |Adjust| |Lower | Space |Enter |Raise| | Home |PageDn|PageUp| End | - * ,-------------------------------------------------------------------------------------------------. + * ,----------------------------------------------------------------------------------------------------------------------. + * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| Del |||||||| Bksp | Enter| Raise|||||||| Home |PageDn|PageUp| End | + * ,----------------------------------------------------------------------------------------------------------------------. */ [_LOWER] = LAYOUT( - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_JPN , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC , KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ + KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ ), /* Raise - * ,-------------------------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | { | } | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | _ | + | ^ | & | * | ( | ) | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | 1 | 2 | 3 | 4 | 5 | Del | Bksp | H | J | K | L | : | " | - * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | JPN | Enter| N | M | < | > | ? | Shift| - * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | Ctrl | GUI | ALt |Adjust| |Lower | Space |Enter |Raise| | Home |PageDn|PageUp| End | - * ,-------------------------------------------------------------------------------------------------. + * ,----------------------------------------------------------------------------------------------------------------------. + * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| Del |||||||| Bksp | Enter| Raise|||||||| Home |PageDn|PageUp| End | + * ,----------------------------------------------------------------------------------------------------------------------. */ [_RAISE] = LAYOUT( - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_JPN , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC , KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ + KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ ), /* Adjust - * ,-------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset|RGB ON| MODE| HUE-| HUE+| | | SAT-| SAT+| VAL-| VAL+| | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | - * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | | | | | | | | | | | | | | | - * ,-------------------------------------------------------------------------------------------------. + * ,----------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | | Reset|RGB ON| MODE| HUE-| HUE+| | | | SAT-| SAT+| VAL-| VAL+| | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | | | BL ON| BRTG| INC| DEC| | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | | | | |||||||| | | |||||||| | | |||||||| | | | | + * ,----------------------------------------------------------------------------------------------------------------------. */ [_ADJUST] = LAYOUT( - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ + _______, _______, BL_TOGG, BL_BRTG, BL_INC , BL_DEC ,_______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______,_______,_______, _______,_______, _______, _______, _______, _______, _______ \ ) }; diff --git a/keyboards/ergodash/rev1/keymaps/default/rules.mk b/keyboards/ergodash/rev1/keymaps/default/rules.mk index e69de29bb2d..bb9e33b0829 100644 --- a/keyboards/ergodash/rev1/keymaps/default/rules.mk +++ b/keyboards/ergodash/rev1/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no +AUDIO_ENABLE = no diff --git a/keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h new file mode 100644 index 00000000000..df04873a97e --- /dev/null +++ b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h @@ -0,0 +1,33 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json new file mode 100644 index 00000000000..8f8d3085538 --- /dev/null +++ b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json @@ -0,0 +1,460 @@ +[ + { + "name": "gsm-ErgoDash", + "notes": "Front Legend = \"Adust\" layer (both lower and Raise)\n\n\nLayout Positions are an aproximation and not exact" + }, + [ + { + "x": 3, + "t": "#0000ff\n#ff0000" + }, + "\nF3\n\n\n\n\n\n\n\n3 #", + { + "x": 11 + }, + "\nF8\n\n\n\n\n\n\n\n8 *" + ], + [ + { + "y": -0.875, + "x": 2 + }, + "\nF2\n\n\n\n\n\n\n\n2 @", + { + "x": 1 + }, + "\nF4\n\n\n\n\n\n\n\n4 $", + { + "x": 9 + }, + "\nF7\n\n\n\n\n\n\n\n7 &", + { + "x": 1 + }, + "\nF9\n\n\n\n\n\n\n\n9 (" + ], + [ + { + "y": -0.875, + "x": 5 + }, + "\nF5\n\n\n\n\n\n\n\n5 %", + { + "x": 7 + }, + "\nF6\n\n\n\n\n\n\n\n6 &" + ], + [ + { + "y": -0.875, + "t": "#000000", + "a": 3 + }, + "Esc\n\n\n\nreset", + { + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "\nF1\n\n\n\n\n\n\n\n1 !", + { + "x": 15 + }, + "\nF10\n\n\n\n\n\n\n\n0 )", + { + "t": "#000000", + "a": 7, + "fa": [ + 2 + ] + }, + "Bksp" + ], + [ + { + "y": -0.625, + "x": 6, + "f": 3 + }, + "= +", + { + "x": 5, + "f": 3 + }, + "- _" + ], + [ + { + "y": -0.75, + "x": 3, + "f": 3 + }, + "E", + { + "x": 11, + "f": 3 + }, + "I" + ], + [ + { + "y": -0.875, + "x": 2, + "t": "#0000ff\n#ff0000\n\n\n\n\n\n\n\n\n#ff0000", + "a": 4, + "f": 3 + }, + "PgUP\nUP\n\n\n\n\n\n\n\nW", + { + "x": 1, + "t": "#000000", + "a": 3, + "f": 3 + }, + "R\n\n\n\nrgb_tog", + { + "x": 9, + "a": 7, + "f": 3 + }, + "U", + { + "x": 1, + "f": 3 + }, + "O" + ], + [ + { + "y": -0.875, + "x": 5, + "a": 3, + "f": 3 + }, + "T\n\n\n\nbl_tog", + { + "x": 7, + "a": 7, + "f": 3 + }, + "Y" + ], + [ + { + "y": -0.875, + "f": 3 + }, + "Tab", + { + "f": 3 + }, + "Q", + { + "x": 15, + "f": 3 + }, + "P", + { + "f": 3 + }, + "] }" + ], + [ + { + "y": -0.625, + "x": 6 + }, + "", + { + "x": 5, + "f": 3 + }, + "[ {" + ], + [ + { + "y": -0.75, + "x": 3, + "t": "#0000ff\n#ff0000\n\n\n\n\n\n\n\n\n#ff0000", + "a": 0, + "f": 3 + }, + "End\nRIGHT\n\n\nrgb_sai\n\n\n\n\nD", + { + "x": 11, + "t": "#000000", + "a": 7, + "f": 3 + }, + "K" + ], + [ + { + "y": -0.875, + "x": 2, + "t": "#0000ff\n#ff0000\n\n\n\n\n\n\n\n\n#ff0000", + "a": 0, + "f": 3 + }, + "PgDwn\nDOWN\n\n\nrgb_hai\n\n\n\n\nS", + { + "x": 1, + "t": "#000000", + "a": 3, + "f": 3 + }, + "F\n\n\n\nrgb_val", + { + "x": 9, + "a": 7, + "f": 3 + }, + "J", + { + "x": 1, + "f": 3 + }, + "L" + ], + [ + { + "y": -0.875, + "x": 5, + "a": 3, + "f": 3 + }, + "G\n\n\n\nbl_inc", + { + "x": 7, + "a": 7, + "f": 3 + }, + "H" + ], + [ + { + "y": -0.875, + "c": "#0000ff", + "t": "#ffffffff", + "f": 3 + }, + "Raise", + { + "c": "#cccccc", + "t": "#0000ff\n#ff0000\n\n\n\n\n\n\n\n\n#ff0000", + "a": 4, + "f": 3 + }, + "Home\nLEFT\n\n\n\n\n\n\n\nA", + { + "x": 15, + "t": "#000000", + "a": 7, + "f": 3 + }, + ": ;", + { + "f": 3 + }, + "' \"" + ], + [ + { + "y": -0.625, + "x": 6 + }, + "", + { + "x": 5 + }, + "" + ], + [ + { + "y": -0.75, + "x": 3, + "a": 3, + "f": 3 + }, + "C\n\n\n\nrgb_sad", + { + "x": 11, + "a": 7, + "f": 3 + }, + ", <" + ], + [ + { + "y": -0.875, + "x": 2, + "a": 3, + "f": 3 + }, + "X\n\n\n\nrgb_sad", + { + "x": 1, + "f": 3 + }, + "V\n\n\n\nrgb_vad", + { + "x": 9, + "a": 7, + "f": 3 + }, + "M", + { + "x": 1, + "f": 3 + }, + ". >" + ], + [ + { + "y": -0.875, + "x": 5, + "a": 3, + "f": 3 + }, + "B\n\n\n\nbl_dec", + { + "x": 7, + "a": 7, + "f": 3 + }, + "N" + ], + [ + { + "y": -0.875, + "a": 3, + "f": 3 + }, + "Shift\n\n\n\neep_rst", + { + "a": 7, + "f": 3 + }, + "Z", + { + "x": 15, + "f": 3 + }, + "/ ?", + { + "f": 3 + }, + "Shift" + ], + [ + { + "y": -0.25, + "x": 2, + "f": 3 + }, + "Alt", + { + "x": 13, + "f": 3 + }, + "DOWN" + ], + [ + { + "y": -0.9749999999999996, + "x": 3.5, + "f": 3 + }, + "Ctrl", + { + "x": 10.15, + "f": 3 + }, + "LEFT" + ], + [ + { + "y": -0.7750000000000004, + "f": 3 + }, + "`~", + { + "f": 3 + }, + "\\|", + { + "x": 15, + "f": 3 + }, + "UP", + { + "f": 3 + }, + "RIGHT" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -0.25, + "x": -0.2999999999999998, + "c": "#eb7c15", + "f": 3, + "h": 2 + }, + "Space", + { + "c": "#cccccc", + "f": 3 + }, + "Del" + ], + [ + { + "x": -1.2999999999999998, + "c": "#ff0000", + "f": 3 + }, + "Lower", + { + "x": 1, + "c": "#cccccc", + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "\nApp\n\n\n\n\n\n\n\nOS" + ], + [ + { + "r": -30, + "rx": 13, + "y": -0.5, + "x": -2, + "t": "#000000", + "a": 7, + "f": 3 + }, + "PrtScr", + { + "c": "#eb7c15", + "f": 3, + "h": 2 + }, + "Space" + ], + [ + { + "x": -2, + "c": "#cccccc", + "f": 3 + }, + "Enter", + { + "x": 1, + "c": "#0000ff", + "t": "#ffffff", + "f": 3 + }, + "Raise" + ] +] \ No newline at end of file diff --git a/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keymap.c b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keymap.c new file mode 100644 index 00000000000..7a7985f75fc --- /dev/null +++ b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keymap.c @@ -0,0 +1,136 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,----------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | = | | - | 6 | 7 | 8 | 9 | 0 |Backsp| + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | | [ | Y | U | I | O | P | ] | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Raise| A | S | D | F | G | | | | H | J | K | L | ; | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B |||||||| Del | | |||||||| N | M | , | . | / | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | ` | \ | ALt | Ctrl |||||||| Lower| Space| LGui|||||||| Enter| Space| Raise|||||||| Left | Down | Up | Right| + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_QWERTY] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, \ + RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_PSCR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_GRV,KC_BSLS, KC_LALT, KC_LCTL, LOWER, KC_SPC,KC_LGUI, KC_ENT ,KC_SPC , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,----------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | | | Up | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Raise| Left | Down | Rght | | | | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| | | | | |||||||| | | |||||||| | | | | | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | | | | |||||||| Lower| Space| |||||||| | Space| Raise|||||||| | | | | + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_LOWER] = LAYOUT( + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RAISE, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, \ + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, LOWER, KC_SPC ,XXXXXXX, XXXXXXX, KC_SPC , RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ), + + /* Raise + * ,----------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | | | PgUp | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Raise| Home | PgDwn| End | | | | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| | | | | |||||||| | | |||||||| | | | | | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | | | | |||||||| Lower| Space| |||||||| |Space | Raise|||||||| | | | | + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_RAISE] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RAISE, KC_HOME,KC_PGDOWN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, \ + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, LOWER, KC_SPC ,XXXXXXX, XXXXXXX, KC_SPC , RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ), + + /* Adjust (Both Raise and Lower Together) + * ,----------------------------------------------------------------------------------------------------------------------. + * | Reset| | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | | | | |rgbtog|bl_tog| | | | | | | | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Raise| |rgbhui|rgbsai|rgbvai|bl_inc| | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + *|EEP_RST| |rgbhud|rgbdec|rgbvad|bl_dec|||||||| | | |||||||| | | | | | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | | | | |||||||| Lower| Space| |||||||| | Space| Raise|||||||| | | | | + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_ADJUST] = LAYOUT( + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, BL_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RAISE, XXXXXXX, RGB_HUI, RGB_SAI, RGB_VAI, BL_INC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + EEP_RST, XXXXXXX, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, \ + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, LOWER, KC_SPC ,XXXXXXX, XXXXXXX, KC_SPC, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/ergodash/rev1/keymaps/greenshadowmaker/rules.mk b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/rules.mk new file mode 100644 index 00000000000..11b62b9bffe --- /dev/null +++ b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no diff --git a/keyboards/ergodash/rev1/rev1.h b/keyboards/ergodash/rev1/rev1.h index 952801916a1..f494a3558a7 100644 --- a/keyboards/ergodash/rev1/rev1.h +++ b/keyboards/ergodash/rev1/rev1.h @@ -10,8 +10,8 @@ #ifdef USE_I2C #include #ifdef __AVR__ - #include - #include + #include + #include #endif #endif @@ -20,47 +20,132 @@ #ifndef FLIP_HALF // Standard Keymap // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { LT0, LT1, LT2, LT3, LT4, LT5, KC_NO }, \ - { R06, R05, R04, R03, R02, R01, R00 }, \ - { R16, R15, R14, R13, R12, R11, R10 }, \ - { R26, R25, R24, R23, R22, R21, R20 }, \ - { R36, R35, R34, R33, R32, R31, R30 }, \ - { RT5, RT4, RT3, RT2, RT1, RT0, KC_NO } \ - } +#define LAYOUT_4key( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 }, \ + { R46, R45, R44, R43, R42, R41, R40 } \ + } + +// Just defined for configurator support, the matrix is identical to LAYOUT_4key +#define LAYOUT_4key_2u_inner( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 }, \ + { R46, R45, R44, R43, R42, R41, R40 } \ + } + +#define LAYOUT_3key_2us( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, KC_NO }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, KC_NO }, \ + { R46, R45, R44, R43, R42, R41, R40 } \ + } + + +#define LAYOUT_3key_1us( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, KC_NO }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 }, \ + { R46, R45, R44, R43, R42, R41, KC_NO } \ + } + +#define LAYOUT_2key( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, KC_NO }, \ + { L40, L41, L42, L43, L44, L45, KC_NO }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, KC_NO }, \ + { R46, R45, R44, R43, R42, R41, KC_NO } \ + } + +#define LAYOUT LAYOUT_4key + #else // Keymap with right side flipped // (TRRS jack on both halves are to the right) #define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { LT0, LT1, LT2, LT3, LT4, LT5, KC_NO }, \ - { R00, R01, R02, R03, R04, R05, R06 }, \ - { R10, R11, R12, R13, R14, R15, R16 }, \ - { R20, R21, R22, R23, R24, R25, R26 }, \ - { R30, R31, R32, R33, R34, R35, R36 }, \ - { RT0, RT1, RT2, RT3, RT4, RT5, KC_NO } \ - } + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R00, R01, R02, R03, R04, R05, R06 }, \ + { R10, R11, R12, R13, R14, R15, R16 }, \ + { R20, R21, R22, R23, R24, R25, R26 }, \ + { R30, R31, R32, R33, R34, R35, R36 }, \ + { R40, R41, R42, R43, R44, R45, R46 } \ + } #endif #endif diff --git a/keyboards/ergodash/rev1/rules.mk b/keyboards/ergodash/rev1/rules.mk index 7b30c0beff2..bb9e33b0829 100644 --- a/keyboards/ergodash/rev1/rules.mk +++ b/keyboards/ergodash/rev1/rules.mk @@ -1 +1,3 @@ BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no +AUDIO_ENABLE = no diff --git a/keyboards/ergodash/rev2/config.h b/keyboards/ergodash/rev2/config.h deleted file mode 100644 index 5f9c689916b..00000000000 --- a/keyboards/ergodash/rev2/config.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef REV2_CONFIG_H -#define REV2_CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Omkbd -#define PRODUCT ErgoDash -#define DESCRIPTION Power - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 7 - -// wiring of each half -#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } -#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } -// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order - -/* define tapping term */ -#define TAPPING_TERM 120 - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -#define C6_AUDIO - -/* number of backlight levels */ -#ifdef BACKLIGHT_ENABLE - #define BACKLIGHT_PIN B6 - #define BACKLIGHT_LEVELS 7 -// #define BACKLIGHT_BREATHING -// #define BREATHING_PERIOD 4 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 24 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - - -#endif diff --git a/keyboards/ergodash/rev2/info.json b/keyboards/ergodash/rev2/info.json deleted file mode 100644 index bcfbda6d33b..00000000000 --- a/keyboards/ergodash/rev2/info.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "keyboard_name": "ErgoDash rev2", - "url": "", - "maintainer": "qmk", - "width": 18, - "height": 6.25, - "layouts": { - "LAYOUT": { - "key_count": 70, - "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.375}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.75}, {"label":"R00", "x":11, "y":0.75}, {"label":"R01", "x":12, "y":0.25}, {"label":"R02", "x":13, "y":0.125}, {"label":"R03", "x":14, "y":0}, {"label":"R04", "x":15, "y":0.125}, {"label":"R05", "x":16, "y":0.375}, {"label":"R06", "x":17, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.375}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.75}, {"label":"R10", "x":11, "y":1.75}, {"label":"R11", "x":12, "y":1.25}, {"label":"R12", "x":13, "y":1.125}, {"label":"R13", "x":14, "y":1}, {"label":"R14", "x":15, "y":1.125}, {"label":"R15", "x":16, "y":1.375}, {"label":"R16", "x":17, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.375}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6, "y":2.75}, {"label":"R20", "x":11, "y":2.75}, {"label":"R21", "x":12, "y":2.25}, {"label":"R22", "x":13, "y":2.125}, {"label":"R23", "x":14, "y":2}, {"label":"R24", "x":15, "y":2.125}, {"label":"R25", "x":16, "y":2.375}, {"label":"R26", "x":17, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.375}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3.125}, {"label":"L35", "x":5, "y":3.25}, {"label":"L36", "x":6.5, "y":4.25}, {"label":"R30", "x":10.5, "y":4.25}, {"label":"R31", "x":12, "y":3.25}, {"label":"R32", "x":13, "y":3.125}, {"label":"R33", "x":14, "y":3}, {"label":"R34", "x":15, "y":3.125}, {"label":"R35", "x":16, "y":3.375}, {"label":"R36", "x":17, "y":3.375}, {"label":"L40", "x":0, "y":4.375}, {"label":"L41", "x":1, "y":4.375}, {"label":"L42", "x":2, "y":4.125}, {"label":"L43", "x":3, "y":4}, {"label":"L44", "x":5.5, "y":5.25}, {"label":"L45", "x":6.5, "y":5.25}, {"label":"L46", "x":7.5, "y":4.25, "h":2}, {"label":"R40", "x":9.5, "y":4.25, "h":2}, {"label":"R41", "x":10.5, "y":5.25}, {"label":"R42", "x":11.5, "y":5.25}, {"label":"R43", "x":14, "y":4}, {"label":"R44", "x":15, "y":4.125}, {"label":"R45", "x":16, "y":4.375}, {"label":"R46", "x":17, "y":4.375}] - } - } -} diff --git a/keyboards/ergodash/rev2/keymaps/default/config.h b/keyboards/ergodash/rev2/keymaps/default/config.h deleted file mode 100644 index 7e7fe4f69a8..00000000000 --- a/keyboards/ergodash/rev2/keymaps/default/config.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#endif - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 24 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/ergodash/rev2/keymaps/default/keymap.c b/keyboards/ergodash/rev2/keymaps/default/keymap.c deleted file mode 100644 index 418089e1b03..00000000000 --- a/keyboards/ergodash/rev2/keymaps/default/keymap.c +++ /dev/null @@ -1,159 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define EISU LALT(KC_GRV) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,----------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 |Pscree| - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | ` | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | Tab | A | S | D | F | G | Del | | Bksp | H | J | K | L | ; | " | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | Space| | Enter| N | M | , | . | / | Shift| - * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Left | Down | Up | Right| - * ,----------------------------------------------------------------------------------------------------------------------. - */ - [_QWERTY] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, \ - KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,_______, _______,KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Lower - * ,----------------------------------------------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| - * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | - * ,----------------------------------------------------------------------------------------------------------------------. - */ - [_LOWER] = LAYOUT( - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,_______, _______,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ - ), - - /* Raise - * ,----------------------------------------------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | - * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| - * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| - * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | - * ,----------------------------------------------------------------------------------------------------------------------. - */ - [_RAISE] = LAYOUT( - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,_______, _______,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ - ), - - /* Adjust - * ,----------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | | Reset|RGB ON| MODE| HUE-| HUE+| | | | SAT-| SAT+| VAL-| VAL+| | | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | | | | |||||||| | | |||||||| | | |||||||| | | | | - * ,----------------------------------------------------------------------------------------------------------------------. - */ - [_ADJUST] = LAYOUT( - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, BL_TOGG, BL_BRTG, BL_INC , BL_DEC ,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______,_______,_______, _______,_______, _______, _______, _______, _______, _______ \ - ) -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/ergodash/rev2/rev2.c b/keyboards/ergodash/rev2/rev2.c deleted file mode 100644 index 5e787921cbb..00000000000 --- a/keyboards/ergodash/rev2/rev2.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "ergodash.h" - -#ifdef AUDIO_ENABLE - float tone_startup[][2] = SONG(STARTUP_SOUND); - float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - #ifdef AUDIO_ENABLE - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); - #endif - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; - -void shutdown_user(void) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); - #endif -} diff --git a/keyboards/ergodash/rev2/rev2.h b/keyboards/ergodash/rev2/rev2.h deleted file mode 100644 index 55135adca6d..00000000000 --- a/keyboards/ergodash/rev2/rev2.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef REV1_H -#define REV1_H - -#include "ergodash.h" - -//void promicro_bootloader_jmp(bool program); -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -//void promicro_bootloader_jmp(bool program); - -#ifndef FLIP_HALF -// Standard Keymap -// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { R06, R05, R04, R03, R02, R01, R00 }, \ - { R16, R15, R14, R13, R12, R11, R10 }, \ - { R26, R25, R24, R23, R22, R21, R20 }, \ - { R36, R35, R34, R33, R32, R31, R30 }, \ - { R46, R45, R44, R43, R42, R41, R40 } \ - } -#else -// Keymap with right side flipped -// (TRRS jack on both halves are to the right) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { R00, R01, R02, R03, R04, R05, R06 }, \ - { R10, R11, R12, R13, R14, R15, R16 }, \ - { R20, R21, R22, R23, R24, R25, R26 }, \ - { R30, R31, R32, R33, R34, R35, R36 }, \ - { R40, R41, R42, R43, R44, R45, R46 } \ - } -#endif - -#endif diff --git a/keyboards/ergodash/rules.mk b/keyboards/ergodash/rules.mk index e25346dacd1..8be059d969f 100644 --- a/keyboards/ergodash/rules.mk +++ b/keyboards/ergodash/rules.mk @@ -1,52 +1,21 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c \ - ssd1306.c - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. F_CPU = 16000000 -# # LUFA specific # # Target architecture (see library "Board Types" documentation). ARCH = AVR8 # Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina # Build Options @@ -57,19 +26,17 @@ BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes # Enables split keyboard support -DEFAULT_FOLDER = ergodash/rev2 +DEFAULT_FOLDER = ergodash/rev1 diff --git a/keyboards/ergodash/serial.c b/keyboards/ergodash/serial.c deleted file mode 100644 index 74bcbb6bf6e..00000000000 --- a/keyboards/ergodash/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/ergodash/serial.h b/keyboards/ergodash/serial.h deleted file mode 100644 index 15fe4db7b4c..00000000000 --- a/keyboards/ergodash/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/ergodash/split_util.c b/keyboards/ergodash/split_util.c deleted file mode 100644 index 346cbc90894..00000000000 --- a/keyboards/ergodash/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/ergodone/config.h b/keyboards/ergodone/config.h index 2c764d782c1..815af357dea 100644 --- a/keyboards/ergodone/config.h +++ b/keyboards/ergodone/config.h @@ -37,8 +37,8 @@ /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ ) /* number of backlight levels */ diff --git a/keyboards/ergodone/info.json b/keyboards/ergodone/info.json index 81c7e2afaa7..33128758ac3 100644 --- a/keyboards/ergodone/info.json +++ b/keyboards/ergodone/info.json @@ -1,8 +1,8 @@ { "keyboard_name": "Ergodone", "maintainer": "Yu He", - "width": 19.5, - "height": 9.375, + "width": 17, + "height": 8, "layouts": { "LAYOUT_ergodox": { diff --git a/keyboards/ergodone/keymaps/default/keymap.c b/keyboards/ergodone/keymaps/default/keymap.c index cbc180d6a07..28b393a3d8f 100644 --- a/keyboards/ergodone/keymaps/default/keymap.c +++ b/keyboards/ergodone/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" #include "version.h" #define BASE 0 // default layer @@ -53,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -143,28 +141,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - } - return MACRO_NONE; -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // dynamically generate these. diff --git a/keyboards/ergodone/keymaps/eozaki/keymap.c b/keyboards/ergodone/keymaps/eozaki/keymap.c index a6d17b61c29..d29f4b76318 100644 --- a/keyboards/ergodone/keymaps/eozaki/keymap.c +++ b/keyboards/ergodone/keymaps/eozaki/keymap.c @@ -143,10 +143,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/ergodone/keymaps/erovia/keymap.c b/keyboards/ergodone/keymaps/erovia/keymap.c index 627805afb07..697e917119a 100644 --- a/keyboards/ergodone/keymaps/erovia/keymap.c +++ b/keyboards/ergodone/keymaps/erovia/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_COPY, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MUTE, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_FN1, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, TT(FN), KC_LCTL, KC_LGUI, KC_LALT, KC_LEFT, KC_RGHT, KC_CAPS, KC_LGUI, KC_HOME, @@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_COPY, KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_MUTE, KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_G, - KC_LSPO, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_FN1, + KC_LSPO, KC_Z, KC_X, KC_C, KC_D, KC_V, TT(FN), KC_LCTL, KC_LGUI, KC_LALT, KC_LEFT, KC_RGHT, KC_CAPS, KC_LGUI, KC_HOME, @@ -146,10 +146,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(FN) // FN1 - Momentary Layer 1 -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case VRSN: diff --git a/keyboards/ergodone/keymaps/vega/keymap.c b/keyboards/ergodone/keymaps/vega/keymap.c new file mode 100644 index 00000000000..9e5229528d9 --- /dev/null +++ b/keyboards/ergodone/keymaps/vega/keymap.c @@ -0,0 +1,555 @@ +#include QMK_KEYBOARD_H + +enum layer_names { + BASE, + GREL, + GREU, + SYMB, + MATH, + QWER, + FNLR +}; + +enum unicode_names { + //MATH + neq, //≠ + intgrl, //∫ + angl, //∠ + imply, //⇒ + equiv, //⇔ + porp, //∝ + exists, //∃ + nexists, //∄ + forall, //∀ + and, //∧ + or, //∨ + xor, //⊕ + apeql, //≅ + root, //√ + not, //¬ + sum, //∑ + plsminus, //± + infin, //∞ + emtyset, //∅ + Mn, //ℕ + Mz, //ℤ + Mq, //ℚ + Mr, //ℝ + Mc, //ℂ + eleof, //∈ + member, //∋ + neleof, //∉ + nmember, //∌ + subsetof, //⊂ + suprsetof, //⊃ + intersection, //∩ + Munion, //∪ + + //SYMB + arwl, + arwu, + arwr, + arwd, + + uxclm, + cent, + degree, + trade, + copy, + numero, + sect, + mdot, + rang, + + + lshade, + mshade, + dshade, + + fire, + water, + cleft, + baster, + neteen, + floppy, + + boxemp, + boxchk, + boxX, + + bbstr, + bbstl, + bbml, + bbmr, + bbmb, + bbrtr, + bbrbr, + bbrtl, + bbrbl, + bbsbr, + bbsbl, + bbmbr, + bbmbl, + + Agrave, + Aacute, + Acircm, + Atilde, + Abreve, + Adiaer, + Adacut, + + // not all ogham letters, as I + // actually intend to use them for hex + OS, + Oa, + Ob, + Oc, + Od, + Oe, + Of, + Og, + Oh, + Oi, + OA, + OB, + OC, + OD, + OE, + OF, + Os, + OED, + Ox, + gnd, + sqr, + sine, + opt, + + geq, + leq, + brkup, + brkdn, + perup, + perdn, + + //GREEL + rone, // 1:: ⅰ + rtwo, + rthree, + rfour, // 4:: ⅳ + rfive, // 5:: ⅴ + rsix, // 6:: ⅵ + rseven, // 7:: ⅶ + reight, // 8:: ⅷ + rnine, // 9:: ⅸ + rten, // 0:: ⅹ + gq, // q:: θ + gw, // w:: ω + ge, // e:: ε + gr, // r:: ρ + gt, // t:: τ + gy, // y:: ψ + gu, // u:: υ + gi, // i:: ι + go, // o:: ο + gp, // p:: π + ga, // a:: α + gs, // s:: σ + gd, // d:: δ + gf, // f:: φ + gg, // g:: γ + gh, // h:: η + gj, // j:: ϑ + gk, // k:: κ + gl, // l:: λ + gz, // z:: ζ + gx, // x:: ξ + gc, // c:: χ + gv, // v:: ς + gb, // b:: β + gn, // n:: ν + gm, // m:: μ + + //GREEU + Rone, // 1:: Ⅰ + Rtwo, // 2:: Ⅱ + Rthree, // 3:: Ⅲ + Rfour, // 4:: Ⅳ + Rfive, // 5:: Ⅴ + Rsix, // 6:: Ⅵ + Rseven, // 7:: Ⅶ + Reight, // 8:: Ⅷ + Rnine, // 9:: Ⅸ + Rten, + Gq, // Q:: Θ + Gw, // W:: Ω + Ge, // E:: Ε + Gr, // R:: Ρ + Gt, // T:: Τ + Gy, // Y:: Ψ + Gu, // U:: Υ + Gi, // I:: Ι + Go, // O:: Ο + Gp, // P:: Π + Ga, // A:: Α + Gs, // S:: Σ + Gd, // D:: Δ + Gf, // F:: Φ + Gg, // G:: Γ + Gh, // H:: Η + Gj, // J:: J + Gk, // K:: Κ + Gl, // L:: Λ + Gz, // Z:: Ζ + Gx, // X:: Ξ + Gc, // C:: Χ + Gv, // V:: V + Gb, // B:: Β + Gn, // N:: Ν + Gm, // M:: Μ +}; + +const uint32_t PROGMEM unicode_map[] = { + //MATH + [neq] = 0x2260, //≠ + [intgrl] = 0x222B, //∫ + [angl] = 0x2220, //∠ + [imply] = 0x21D2, //⇒ + [equiv] = 0x21D4, //⇔ + [porp] = 0x221D, //∝ + [exists] = 0x2203, //∃ + [nexists] = 0x2204, //∄ + [forall] = 0x2200, //∀ + [and] = 0x2227, //∧ + [or] = 0x2228, //∨ + [xor] = 0x2295, //⊕ + [apeql] = 0x2245, //≅ + [root] = 0x221A, //√ + [not] = 0x00AC, //¬ + [sum] = 0x2211, //∑ + [plsminus] = 0x00B1, //± + [infin] = 0x221E, //∞ + [emtyset] = 0x2205, //∅ + [Mn] = 0x2115, //ℕ + [Mz] = 0x2124, //ℤ + [Mq] = 0x211A, //ℚ + [Mr] = 0x211D, //ℝ + [Mc] = 0x2102, //ℂ + [eleof] = 0x2208, //∈ + [member] = 0x220B, //∋ + [neleof] = 0x2209, //∉ + [nmember] = 0x220C, //∌ + [subsetof] = 0x2282, //⊂ + [suprsetof] = 0x2283, // + [intersection] = 0x2229, //∩ + [Munion] = 0x222A, //∪ + //Symbol + [arwl] = 0x2190, //← + [arwu] = 0x2191, //↑ + [arwr] = 0x2192, //→ + [arwd] = 0x2193, //↓ + + [uxclm] = 0x00A1, //¡ + [cent] = 0x00A2, //¢ + [degree] = 0x00B0, //° + [trade] = 0x2122, //™ + [copy] = 0x00A9, //© + [numero] = 0x2116, //№ + [sect] = 0x00A7, //§ + [mdot] = 0x00B7, //· + [rang] = 0x299C, //⦜ + + + [lshade] = 0x2591,//░ + [mshade] = 0x2592,//▒ + [dshade] = 0x2593,//▓ + + [fire] = 0x1F525, //🔥 + [water] = 0x1F322, //🌢 + [cleft] = 0x1F12F, //🄯 + [baster] = 0x1F7BC, //🞼 + [neteen] = 0x1F51E, //🔞 + [floppy] = 0x1F5AB, //🖫 + + [boxemp] = 0x2610, //☐ + [boxchk] = 0x2611, //☑ + [boxX] = 0x2612, //☒ + + [bbstr] = 0x23A1, //⎡ + [bbstl] = 0x23A4, //⎤ + [bbml] = 0x23A8, //⎨ + [bbmr] = 0x23AC, //⎬ + [bbmb] = 0x23AA, //⎪ + [bbrtr] = 0x23A7, //⎧ + [bbrbr] = 0x23A9, //⎩ + [bbrtl] = 0x23AB, //⎫ + [bbrbl] = 0x23AD, //⎭ + [bbsbr] = 0x23A3, //⎣ + [bbsbl] = 0x23A6, //⎦ + [bbmbr] = 0x23A5, //⎥ + [bbmbl] = 0x23A2, //⎢ + + [Agrave] = 0x0300,//è //above [wtf] = 0x1242A, //𒐪 + [Aacute] = 0x0301,//é //1st + [Acircm] = 0x0302,//ê //2nd + [Atilde] = 0x0303,//ẽ //5th + [Abreve] = 0x0306,//ĕ //4th + [Adiaer] = 0x0308,//ë //3rd + [Adacut] = 0x030B,//e̋ + + // not all ogham letters, as I + // actually intend to use them for hex + [OS] = 0x1680,//space + [Oa] = 0x1681,//1 + [Ob] = 0x1682,//2 + [Oc] = 0x1683,//3 + [Od] = 0x1684,//4 + [Oe] = 0x1685,//5 + [Of] = 0x1686,//6 + [Og] = 0x1687,//7 + [Oh] = 0x1688,//8 + [Oi] = 0x1689,//9 + [OA] = 0x168A,//A + [OB] = 0x168B,//B + [OC] = 0x168C,//C + [OD] = 0x168D,//D + [OE] = 0x168E,//E + [OF] = 0x168F,//F + [Os] = 0x169B,//Start + [OED] = 0x169C,//End + [Ox] = 0x1695,//X + + [gnd] = 0x23DA,//⏚ + [sqr] = 0x238D,//⎍, actually monostable + [sine] = 0x223F,//∿ + [opt] = 0x2325,//⌥, actually option used for switch + + [geq] = 0x2264, //≤ + [leq] = 0x2265, //≥ + [brkup] = 0xFE38, //︸ + [brkdn] = 0xFE37, //︷ + [perup] = 0xFE35, //︵ + [perdn] = 0xFE36, //︶ + //GREEKL + [rone] = 0x2170, // 1:: ⅰ + [rtwo] = 0x2171, // 2:: ⅱ + [rthree] = 0x2172, // 3:: ⅲ + [rfour] = 0x2173, // 4:: ⅳ + [rfive] = 0x2174, // 5:: ⅴ + [rsix] = 0x2175, // 6:: ⅵ + [rseven] = 0x2176, // 7:: ⅶ + [reight] = 0x2177, // 8:: ⅷ + [rnine] = 0x2178, // 9:: ⅸ + [rten] = 0x2179, // 0:: ⅹ + [gq] = 0x03B8, // q:: θ + [gw] = 0x03C9, // w:: ω + [ge] = 0x03B5, // e:: ε + [gr] = 0x03C1, // r:: ρ + [gt] = 0x03C4, // t:: τ + [gy] = 0x03C8, // y:: ψ + [gu] = 0x03C5, // u:: υ + [gi] = 0x03B9, // i:: ι + [go] = 0x03BF, // o:: ο + [gp] = 0x03C0, // p:: π + [ga] = 0x03B1, // a:: α + [gs] = 0x03C3, // s:: σ + [gd] = 0x03B4, // d:: δ + [gf] = 0x03C6, // f:: φ + [gg] = 0x03B3, // g:: γ + [gh] = 0x03B7, // h:: η + [gj] = 0x03D1, // j:: ϑ + [gk] = 0x03BA, // k:: κ + [gl] = 0x03BB, // l:: λ + [gz] = 0x03B6, // z:: ζ + [gx] = 0x03BE, // x:: ξ + [gc] = 0x03C7, // c:: χ + [gv] = 0x03C2, // v:: ς + [gb] = 0x03B2, // b:: β + [gn] = 0x03BD, // n:: ν + [gm] = 0x03BC, // m:: μ + //GREEKU + [Rone] = 0x2160, // 1:: Ⅰ + [Rtwo] = 0x2161, // 2:: Ⅱ + [Rthree] = 0x2162, // 3:: Ⅲ + [Rfour] = 0x2163, // 4:: Ⅳ + [Rfive] = 0x2164, // 5:: Ⅴ + [Rsix] = 0x2165, // 6:: Ⅵ + [Rseven] = 0x2166, // 7:: Ⅶ + [Reight] = 0x2167, // 8:: Ⅷ + [Rnine] = 0x2168, // 9:: Ⅸ + [Rten] = 0x2169, // 0:: Ⅹ + [Gq] = 0x0398, // Q:: Θ + [Gw] = 0x03A9, // W:: Ω + [Ge] = 0x0395, // E:: Ε + [Gr] = 0x03A1, // R:: Ρ + [Gt] = 0x03A4, // T:: Τ + [Gy] = 0x03A8, // Y:: Ψ + [Gu] = 0x03A5, // U:: Υ + [Gi] = 0x0399, // I:: Ι + [Go] = 0x039F, // O:: Ο + [Gp] = 0x03A0, // P:: Π + [Ga] = 0x0391, // A:: Α + [Gs] = 0x03A3, // S:: Σ + [Gd] = 0x0394, // D:: Δ + [Gf] = 0x03A6, // F:: Φ + [Gg] = 0x0393, // G:: Γ + [Gh] = 0x0397, // H:: Η + [Gj] = 0x004A, // J:: J + [Gk] = 0x039A, // K:: Κ + [Gl] = 0x039B, // L:: Λ + [Gz] = 0x0396, // Z:: Ζ + [Gx] = 0x039E, // X:: Ξ + [Gc] = 0x03A7, // C:: Χ + [Gv] = 0x0056, // V:: V + [Gb] = 0x0392, // B:: Β + [Gn] = 0x039D, // N:: Ν + [Gm] = 0x039C, // M:: Μ +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[BASE] = LAYOUT_ergodox( // layer 0 : default + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRV, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_BSLS, + KC_EQL, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_AMPR, + OSL(FNLR), TT(GREL), TT(MATH), KC_UP, KC_DOWN, + KC_LBRC, KC_HOME, KC_INS, KC_SPC, KC_LGUI, KC_DEL, + + OSL(FNLR), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_PGUP, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + KC_PGDN, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, + KC_LEFT, KC_RIGHT, KC_RALT, TT(SYMB), TT(QWER), + KC_END, KC_RBRC, KC_PSCR, KC_RALT, KC_RCTL, KC_ENT +), + +[FNLR] = LAYOUT_ergodox( + // left hand + KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, + KC_NO,KC_F11, KC_F12, KC_F13,KC_F14, KC_F15, KC_NO, + KC_NO,KC_F21, KC_F22, KC_F23,KC_F24, KC_NO, + KC_NO,KC_PAUSE,KC_PSCR,KC_SLCK,KC_NO,KC_NO,KC_NO, + EEP_RST,TO(BASE),TO(BASE),TO(BASE),TO(BASE), + KC_NO,KC_NO, + KC_NO, + KC_NO,KC_NO,KC_NO, + // right hand + TO(BASE), KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, UC_M_LN, + KC_NO, KC_F16, KC_F17,KC_F18, KC_F19, KC_F20, UC_M_WI, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_RCTL, KC_NO +), + +[QWER] = LAYOUT_ergodox( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSLS, + KC_AMPR, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_QUOT, + KC_BSLS, KC_LCTL, KC_LGUI, KC_RALT, KC_APP, + KC_LBRC, KC_HOME, KC_PGUP, KC_SPC, KC_LSFT, KC_PGDN, + + OSL(FNLR), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_MINS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SLSH, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_EQL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, TO(BASE), + KC_END, KC_INS, KC_DEL, KC_RGHT, KC_ENT, KC_SPC +), + +[MATH] = LAYOUT_ergodox( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRV, + KC_TAB, X(Mc), X(Munion), X(arwl), X(or), X(exists), KC_BSLASH, + X(arwr), X(root), X(and), X(imply), X(nexists), X(forall), + KC_LSPO, KC_SCLN, X(intgrl), X(Mn), X(Mz), X(member), X(arwl), + KC_MS_L, TO(BASE), TO(BASE), KC_INS, KC_DEL, + KC_LBRC, KC_HOME, KC_UP, KC_SPC, KC_LGUI, KC_DOWN, + + TT(FNLR), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_PGUP, X(plsminus), X(infin), X(neleof), X(equiv), X(Mq), KC_EQL, + X(sum), X(emtyset), X(porp), X(suprsetof), X(not), X(neq), + KC_PGDN, X(subsetof), X(intersection), X(angl), X(nmember), X(eleof), KC_RSPC, + KC_RCTL, KC_RALT, KC_APP, TO(BASE), TO(BASE), + KC_END, KC_RBRC, KC_LEFT, KC_RGHT, KC_ENT, KC_SPC +), + +[SYMB] = LAYOUT_ergodox( + X(Os), X(Oa), X(Ob), X(Oc), X(Od), X(Oe), X(mdot), + X(boxemp), X(bbstr), X(bbrtr), X(bbrtl), X(bbstl), X(degree), X(brkdn), + X(boxchk), X(bbmbl), X(bbml), X(bbmr), X(bbmbr), X(neteen), + X(boxX), X(bbsbr), X(bbrbr), X(bbrbl), X(bbsbl), X(uxclm), X(brkup), + X(floppy), TO(BASE), TO(BASE), X(arwu), X(arwd), + X(fire), X(lshade), X(mshade), KC_SPC, X(OS), X(dshade), + + X(Ox), X(Of), X(Og), X(Oh), X(Oi), X(OA), X(OB), + X(numero), X(trade), X(copy), X(cleft), X(cent), X(OED), X(OC), + X(Agrave), X(gnd), X(sqr), X(sine), X(opt), X(OD), + X(sect), X(Aacute), X(Acircm), X(Adiaer), X(Abreve), X(Atilde), X(OE), + X(arwl), X(arwr), X(geq), X(leq), X(OF), + X(rang), X(water), X(perup), X(perdn), X(baster), KC_ENT +), + +[GREL] = LAYOUT_ergodox( + KC_ESC, X(Rone), X(Rtwo), X(Rthree), X(Rfour), X(Rfive), KC_GRV, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, X(gp), X(gy), KC_SLSH, + KC_SLSH, X(ga), X(go), X(ge), X(gu), X(gi), + MO(GREU), KC_SCLN, X(gq), X(gj), X(gk), X(gx), KC_AMPR, + KC_MS_L, TO(BASE), TO(BASE), KC_INS, KC_DEL, + KC_LBRC, KC_HOME, KC_UP, KC_SPC, KC_LGUI, KC_DOWN, + + TO(BASE), X(Rsix), X(Rseven), X(Reight), X(Rnine), X(Rten), KC_BSPC, + KC_PGUP, X(gf), X(gg), X(gc), X(gr), X(gl), KC_EQL, + X(gd), X(gh), X(gt), X(gn), X(gs), KC_MINS, + KC_PGDN, X(gb), X(gm), X(gw), X(gv), X(gz), MO(GREU), + KC_RCTL, KC_RALT, KC_APP, TO(BASE), TO(BASE), + KC_END, KC_RBRC, KC_LEFT, KC_RGHT, KC_ENT, KC_SPC +), + +[GREU] = LAYOUT_ergodox( + KC_ESC, X(Rone), X(Rtwo), X(Rthree), X(Rfour), X(Rfive), KC_GRV, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, X(Gp), X(Gy), KC_SLSH, + KC_SLSH, X(Ga), X(Go), X(Ge), X(Gu), X(Gi), + KC_TRNS, KC_SCLN, X(Gq), X(Gj), X(Gk), X(Gx), KC_AMPR, + KC_MS_L, TO(BASE), TO(BASE), KC_INS, KC_DEL, + KC_LBRC, KC_HOME, KC_UP, KC_SPC, KC_LGUI, KC_DOWN, + + TO(BASE), X(Rsix), X(Rseven), X(Reight), X(Rnine), X(Rten), KC_BSPC, + KC_PGUP, X(Gf), X(Gg), X(Gc), X(Gr), X(Gl), KC_EQL, + X(Gd), X(Gh), X(Gt), X(Gn), X(Gs), KC_MINS, + KC_PGDN, X(Gb), X(Gm), X(Gw), X(Gv), X(Gz), KC_TRNS, + KC_RCTL, KC_RALT, KC_APP, TO(BASE), TO(BASE), + KC_END, KC_RBRC, KC_LEFT, KC_RGHT, KC_ENT, KC_SPC +), + +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } +}; diff --git a/keyboards/ergodone/keymaps/vega/rules.mk b/keyboards/ergodone/keymaps/vega/rules.mk new file mode 100644 index 00000000000..d4b85472257 --- /dev/null +++ b/keyboards/ergodone/keymaps/vega/rules.mk @@ -0,0 +1,2 @@ +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = yes diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index 7a350183b19..d22836bd867 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h @@ -55,8 +55,8 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ ) /* number of backlight levels */ @@ -85,17 +85,19 @@ along with this program. If not, see . #define RGBW 1 -/* "debounce" is measured in keyboard scans. Some users reported - * needing values as high as 15, which was at the time around 50ms. +/* + * The debounce filtering reports a key/switch change directly, + * without any extra delay. After that the debounce logic will filter + * all further changes, until the key/switch reports the same state for + * the given count of scans. + * So a perfect switch will get a short debounce period and + * a bad key will get a much longer debounce period. + * The result is an adaptive debouncing period for each switch. + * * If you don't define it here, the matrix code will default to * 5, which is now closer to 10ms, but still plenty according to * manufacturer specs. - * - * Default is quite high, because of reports with some production - * runs seeming to need it. This may change when configuration for - * this is more directly exposed. */ -#define DEBOUNCE 15 #define USB_MAX_POWER_CONSUMPTION 500 @@ -105,8 +107,7 @@ along with this program. If not, see . #define DRIVER_COUNT 2 #define DRIVER_1_LED_TOTAL 24 #define DRIVER_2_LED_TOTAL 24 -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL -#define RGB_MATRIX_SKIP_FRAMES 10 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) // #define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF /* #define RGBLIGHT_COLOR_LAYER_1 0x00, 0x00, 0xFF */ diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index 61f910711ac..947a173e369 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c @@ -128,7 +128,7 @@ uint8_t init_mcp23018(void) { mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); // set pull-up // - unused : on : 1 @@ -140,7 +140,7 @@ uint8_t init_mcp23018(void) { mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; out: - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); #ifdef LEFT_LEDS if (!mcp23018_status) mcp23018_status = ergodox_left_leds_update(); @@ -179,7 +179,7 @@ uint8_t ergodox_left_leds_update(void) { if (mcp23018_status) goto out; out: - i2c_stop(ERGODOX_EZ_I2C_TIMEOUT); + i2c_stop(); return mcp23018_status; } #endif @@ -269,68 +269,49 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - - /*{row | col << 4} - | {x=0..224, y=0..64} - | | modifier - | | | */ - {{0|(0<<4)}, {24.9*5, 16*0}, 0}, // LED 1 on right - {{0|(1<<4)}, {24.9*6, 16*0}, 0}, // LED 2 - {{0|(2<<4)}, {24.9*7, 16*0}, 0}, // LED 3 - {{0|(3<<4)}, {24.9*8, 16*0}, 0}, // LED 4 - {{0|(4<<4)}, {24.9*9, 16*0}, 0}, // LED 5 - - {{1|(5<<4)}, {24.9*5, 16*1}, 0}, // LED 6 - {{1|(6<<4)}, {24.9*6, 16*1}, 0}, // LED 7 - {{1|(7<<4)}, {24.9*7, 16*1}, 0}, // LED 8 - {{1|(8<<4)}, {24.9*8, 16*1}, 0}, // LED 9 - {{1|(9<<4)}, {24.9*9, 16*1}, 0}, // LED 10 - - {{2|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 11 - {{2|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 12 - {{2|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 13 - {{2|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 14 - {{2|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 15 - - {{3|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 16 - {{3|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 17 - {{3|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 18 - {{3|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 19 - {{3|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 20 - - {{4|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 21 - {{4|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 22 - {{4|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 23 - {{4|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 24 - - {{0|(0<<4)}, {24.9*4, 16*0}, 0}, // LED 1 on left - {{0|(1<<4)}, {24.9*3, 16*0}, 0}, // LED 2 - {{0|(2<<4)}, {24.9*2, 16*0}, 0}, // LED 3 - {{0|(3<<4)}, {24.9*1, 16*0}, 0}, // LED 4 - {{0|(4<<4)}, {24.9*0, 16*0}, 0}, // LED 5 - - {{1|(5<<4)}, {24.9*4, 16*1}, 0}, // LED 6 - {{1|(6<<4)}, {24.9*3, 16*1}, 0}, // LED 7 - {{1|(7<<4)}, {24.9*2, 16*1}, 0}, // LED 8 - {{1|(8<<4)}, {24.9*1, 16*1}, 0}, // LED 9 - {{1|(9<<4)}, {24.9*0, 16*1}, 0}, // LED 10 - - {{2|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 11 - {{2|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 12 - {{2|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 13 - {{2|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 14 - {{2|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 15 - - {{3|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 16 - {{3|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 17 - {{3|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 18 - {{3|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 19 - {{3|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 20 - - {{4|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 21 - {{4|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 22 - {{4|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 23 - {{4|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 24 -}; +led_config_t g_led_config = { { + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { 28, 33, 38, 43, 47, NO_LED }, + { 27, 32, 37, 42, 46, NO_LED }, + { 26, 31, 36, 41, 45, NO_LED }, + { 25, 30, 35, 40, 44, NO_LED }, + { 24, 29, 34, 39, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { 0, 5, 10, 15, NO_LED, NO_LED }, + { 1, 6, 11, 16, 20, NO_LED }, + { 2, 7, 12, 17, 21, NO_LED }, + { 3, 8, 13, 18, 22, NO_LED }, + { 4, 9, 14, 19, 23, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED } +}, { + { 137, 0 }, { 154, 0 }, { 172, 0 }, { 189, 0 }, { 206, 0 }, { 137, 12 }, + { 154, 12 }, { 172, 12 }, { 189, 12 }, { 206, 12 }, { 137, 25 }, { 154, 25 }, + { 172, 25 }, { 189, 25 }, { 206, 25 }, { 137, 38 }, { 154, 38 }, { 172, 38 }, + { 189, 38 }, { 206, 38 }, { 154, 51 }, { 172, 51 }, { 189, 51 }, { 206, 51 }, + { 86, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 86, 12 }, + { 68, 12 }, { 51, 12 }, { 34, 12 }, { 17, 12 }, { 86, 25 }, { 68, 25 }, + { 51, 25 }, { 34, 25 }, { 17, 25 }, { 86, 38 }, { 68, 38 }, { 51, 38 }, + { 34, 38 }, { 17, 38 }, { 68, 51 }, { 51, 51 }, { 34, 51 }, { 17, 51 } +}, { + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1 +} }; + +void suspend_power_down_kb(void) { + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + + void suspend_wakeup_init_kb(void) { + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} + #endif diff --git a/keyboards/ergodox_ez/i2cmaster.h b/keyboards/ergodox_ez/i2cmaster.h deleted file mode 100644 index 3917b9e6c00..00000000000 --- a/keyboards/ergodox_ez/i2cmaster.h +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef _I2CMASTER_H -#define _I2CMASTER_H 1 -/************************************************************************* -* Title: C include file for the I2C master interface -* (i2cmaster.S or twimaster.c) -* Author: Peter Fleury http://jump.to/fleury -* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device -* Usage: see Doxygen manual -**************************************************************************/ - -#ifdef DOXYGEN -/** - @defgroup pfleury_ic2master I2C Master library - @code #include @endcode - - @brief I2C (TWI) Master Software Library - - Basic routines for communicating with I2C slave devices. This single master - implementation is limited to one bus master on the I2C bus. - - This I2c library is implemented as a compact assembler software implementation of the I2C protocol - which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). - Since the API for these two implementations is exactly the same, an application can be linked either against the - software I2C implementation or the hardware I2C implementation. - - Use 4.7k pull-up resistor on the SDA and SCL pin. - - Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module - i2cmaster.S to your target when using the software I2C implementation ! - - Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. - - @note - The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted - to GNU assembler and AVR-GCC C call interface. - Replaced the incorrect quarter period delays found in AVR300 with - half period delays. - - @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury - - @par API Usage Example - The following code shows typical usage of this library, see example test_i2cmaster.c - - @code - - #include - - - #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet - - int main(void) - { - unsigned char ret; - - i2c_init(); // initialize I2C library - - // write 0x75 to EEPROM address 5 (Byte Write) - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - i2c_write(0x05); // write address = 5 - i2c_write(0x75); // write value 0x75 to EEPROM - i2c_stop(); // set stop conditon = release bus - - - // read previously written value back from EEPROM address 5 - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - - i2c_write(0x05); // write address = 5 - i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode - - ret = i2c_readNak(); // read one byte from EEPROM - i2c_stop(); - - for(;;); - } - @endcode - -*/ -#endif /* DOXYGEN */ - -/**@{*/ - -#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 -#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" -#endif - -#include - -/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_READ 1 - -/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_WRITE 0 - - -/** - @brief initialize the I2C master interace. Need to be called only once - @param void - @return none - */ -extern void i2c_init(void); - - -/** - @brief Terminates the data transfer and releases the I2C bus - @param void - @return none - */ -extern void i2c_stop(void); - - -/** - @brief Issues a start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_start(unsigned char addr); - - -/** - @brief Issues a repeated start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_rep_start(unsigned char addr); - - -/** - @brief Issues a start condition and sends address and transfer direction - - If device is busy, use ack polling to wait until device ready - @param addr address and transfer direction of I2C device - @return none - */ -extern void i2c_start_wait(unsigned char addr); - - -/** - @brief Send one byte to I2C device - @param data byte to be transfered - @retval 0 write successful - @retval 1 write failed - */ -extern unsigned char i2c_write(unsigned char data); - - -/** - @brief read one byte from the I2C device, request more data from device - @return byte read from I2C device - */ -extern unsigned char i2c_readAck(void); - -/** - @brief read one byte from the I2C device, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_readNak(void); - -/** - @brief read one byte from the I2C device - - Implemented as a macro, which calls either i2c_readAck or i2c_readNak - - @param ack 1 send ack, request more data from device
- 0 send nak, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_read(unsigned char ack); -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - - -/**@}*/ -#endif diff --git a/keyboards/ergodox_ez/info.json b/keyboards/ergodox_ez/info.json index 7470ab90683..e543206fedc 100644 --- a/keyboards/ergodox_ez/info.json +++ b/keyboards/ergodox_ez/info.json @@ -1,9 +1,9 @@ { "keyboard_name": "ErgoDox EZ", "url": "ergodox-ez.com", - "maintainer": "erez", - "width": 19.5, - "height": 9.375, + "maintainer": "ZSA", + "width": 17, + "height": 8, "layouts": { "LAYOUT_ergodox": { diff --git a/keyboards/ergodox_ez/keymaps/bdk/config.h b/keyboards/ergodox_ez/keymaps/bdk/config.h new file mode 100644 index 00000000000..e824b731091 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bdk/config.h @@ -0,0 +1,5 @@ +#pragma once + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 167 +#define FORCE_NKRO diff --git a/keyboards/ergodox_ez/keymaps/bdk/keymap.c b/keyboards/ergodox_ez/keymaps/bdk/keymap.c new file mode 100644 index 00000000000..20af6c18ed4 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bdk/keymap.c @@ -0,0 +1,176 @@ +#include QMK_KEYBOARD_H + +#define SHIFT_DOWN() (get_mods() & (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT))) +#define KC_FKEYS MO(FKEYS) + +// Layers +enum { + BASE=0, + SYMNUM, // Symbols and numbers (activated by holding enter) + FKEYS, // Function keys (activated by a thumb button) +}; + +// counter that increments on all key press events. This is needed for our LT +// handling +uint16_t press_counter = 0; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Keymap 0: Base layer + +[BASE] = LAYOUT_ergodox( + // left hand --------------------------------------------------------------------------------------------------- + KC_NO, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, + KC_GRV, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_LGUI, + KC_SLSH, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_HOME, + KC_LCTL, KC_LALT, KC_PGUP, KC_PGDN, KC_NO, + // left thumb -------------------------------------------------------------------------------------------------- + KC_NO, KC_NO, + KC_NO, + KC_SPC, KC_TAB, KC_FKEYS, + // right hand -------------------------------------------------------------------------------------------------- + KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_NO, + KC_RGUI, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + KC_END, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_RCTL, + // right thumb ------------------------------------------------------------------------------------------------- + KC_NO, KC_NO, + KC_NO, + KC_DEL, KC_BSPC, KC_ENT +), +// SYMNUM -- numpad and function keys +[SYMNUM] = LAYOUT_ergodox( + // left hand --------------------------------------------------------------------------------------------------- + KC_TRNS, LALT(KC_1), LALT(KC_2), LALT(KC_3), LALT(KC_4), LALT(KC_5), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AMPR, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LCBR, KC_LBRC, KC_LPRN, KC_0, KC_MINS, + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_SLSH, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // left thumb -------------------------------------------------------------------------------------------------- + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand -------------------------------------------------------------------------------------------------- + KC_TRNS, LALT(KC_6), LALT(KC_7), LALT(KC_8), LALT(KC_9), LALT(KC_0), KC_TRNS, + KC_TRNS, KC_PERC, KC_EQL, KC_LT, KC_GT, KC_EXLM, KC_TRNS, + KC_PLUS, KC_1, KC_RPRN, KC_RBRC, KC_RCBR, KC_TRNS, + KC_TRNS, KC_ASTR, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // right thumb ------------------------------------------------------------------------------------------------- + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +// FKEYS -- function keys +[FKEYS] = LAYOUT_ergodox( + // left hand --------------------------------------------------------------------------------------------------- + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // left thumb -------------------------------------------------------------------------------------------------- + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand -------------------------------------------------------------------------------------------------- + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // right thumb ------------------------------------------------------------------------------------------------- + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +// Code to handle layer tap. +// +// The default code doesn't work for me, so I rolled my own code. The main +// difference is that it always tries to send modifier+key combination, rather +// than two keys. One place where this is noticable is if you tap the key, +// then try hold it. + +struct tap_start_info { + uint16_t timer; + uint16_t initial_press_counter; +}; + +static struct tap_start_info tap_start_infos[5]; + +// Quick check to see if a key is down. Note that this requires NKRO enabled +static bool key_down(uint8_t code) { + return (keyboard_report->nkro.bits[code>>3] & 1<<(code&7)) != 0; +} + +static bool handle_lt(uint16_t keycode, keyrecord_t *record, uint8_t layer, uint8_t index) { + struct tap_start_info* tap_start = tap_start_infos + index; + + if(record->event.pressed) { + layer_on(layer); + tap_start->timer = timer_read(); + tap_start->initial_press_counter = press_counter; + } else { + layer_off(layer); + // Only click the key if: + // - No other keys are pressed between the press and release events + // - The release happens before the ONESHOT_TIMEOUT + if(press_counter == tap_start->initial_press_counter && timer_elapsed(tap_start->timer) < ONESHOT_TIMEOUT) { + register_code16(keycode); + unregister_code16(keycode); + } + } + return false; +} + +static bool handle_mt(uint16_t keycode, keyrecord_t *record, uint8_t mods, uint8_t index) { + struct tap_start_info* tap_start = tap_start_infos + index; + + if(record->event.pressed) { + register_mods(mods); + tap_start->timer = timer_read(); + tap_start->initial_press_counter = press_counter; + } else { + unregister_mods(mods); + // Only click the key if: + // - No other keys are pressed between the press and release events + // - The release happens before the ONESHOT_TIMEOUT + if(press_counter == tap_start->initial_press_counter && timer_elapsed(tap_start->timer) < ONESHOT_TIMEOUT) { + register_code16(keycode); + unregister_code16(keycode); + } + } + return false; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if(record->event.pressed) { + press_counter++; + // The symbol layer allows sequences repeat the same "physical" key. + // For example "0)", which is like pressing the "0" key twice in a + // row. It's very easy to make a sequence of these where the ")" + // press comes before the "0" release. If that happens, force a + // release of the "0" key, otherwise nothing will happen. + uint8_t shortcode = keycode & 0xFF; + if(key_down(shortcode)) { + unregister_code(shortcode); + } + } + + switch(keycode) { + case KC_ENTER: + return handle_lt(keycode, record, SYMNUM, 0); + + case KC_TAB: + return handle_mt(keycode, record, MOD_BIT(KC_LCTL), 1); + + case KC_LSFT: + case KC_RSFT: + return handle_mt(KC_ESC, record, MOD_BIT(keycode), 2); + } + return true; +} diff --git a/keyboards/ergodox_ez/keymaps/bdk/readme.md b/keyboards/ergodox_ez/keymaps/bdk/readme.md new file mode 100644 index 00000000000..36a211d321f --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bdk/readme.md @@ -0,0 +1,36 @@ +# The BDK Ergodox Keyboard Layout + +## Dvorak-based + +This was the first alternative layout I switched to and I don't want to change +again. + +## Mod-tap / Layer-tap is great for thumb keys + +This means a key that activates a layer/modifier when you hold it down, but +results in a keyclick when you tap it. Thumb keys are great for this since +they are good for both high-usage keys as well as modifiers. + +The one thing to avoid is when you mean to tap a key, but hit the next key +before you release, which results in the modifier/layer instead of a tap. To +avoid this, I chose Enter/Tab as the tap keys, since they aren't chorded +together with other keys often. + +The other issue is I found several problems with using the standard MT,LT code, +so I rolled my own to handle it. + +## Don't have too many layers + +My first layouts had multiple layers that I could switch to, but that +overloaded my brain. This layout basically only uses 1 extra layer. +Technically there's also a function key layer, but I only use those keys for +a handlful of things: boot order, rename, reload page, that's basically it. + +## Brackets should be easy to use + +There's a lot of ways to lay out a symbol layer. I organized mine around +making the {[()]} chars easy to use since they're so frequent in programming. +I put them all on the symbol layer home row. + +I also arranged the numbers so 0/1 were also on the symbol layer home row. +This makes for fairly easy chording of "[0]" and "[1]". diff --git a/keyboards/ergodox_ez/keymaps/bdk/rules.mk b/keyboards/ergodox_ez/keymaps/bdk/rules.mk new file mode 100644 index 00000000000..6c516362390 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bdk/rules.mk @@ -0,0 +1,3 @@ +# CONSOLE_ENABLE = yes +# DEBUG_ENABLE = yes +COMMAND_ENABLE = no diff --git a/keyboards/ergodox_ez/keymaps/blakedietz/keymap.c b/keyboards/ergodox_ez/keymaps/blakedietz/keymap.c index 325743b2ec0..8facc6e9256 100644 --- a/keyboards/ergodox_ez/keymaps/blakedietz/keymap.c +++ b/keyboards/ergodox_ez/keymaps/blakedietz/keymap.c @@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_QUOT, MEH_T(KC_NO), KC_N, KC_M, GUI_COMM, ALT_DOT, CTL_SLSH, KC_RSFT, - KC_DOWN, KC_UP, KC_LBRC, KC_RBRC, KC_FN1, + KC_DOWN, KC_UP, KC_LBRC, KC_RBRC, TT(SYMB), KC_PGDN, KC_PGUP, KC_ESC, @@ -198,10 +198,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - // MACRODOWN only works in this function const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { diff --git a/keyboards/ergodox_ez/keymaps/colemak_es_osx/config.h b/keyboards/ergodox_ez/keymaps/colemak_es_osx/config.h new file mode 100644 index 00000000000..a1e4d79768b --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/colemak_es_osx/config.h @@ -0,0 +1,20 @@ +#pragma once + +// Sets good default for the speed of the mouse. +#undef MOUSEKEY_INTERVAL +#undef MOUSEKEY_DELAY +#undef MOUSEKEY_TIME_TO_MAX +#undef MOUSEKEY_MAX_SPEED + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 100 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 + +#undef MOUSEKEY_WHEEL_MAX_SPEED +#undef MOUSEKEY_WHEEL_TIME_TO_MAX +#undef MOUSEKEY_WHEEL_DELAY + +#define MOUSEKEY_WHEEL_MAX_SPEED 5 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_DELAY 100 \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/colemak_es_osx/keymap.c b/keyboards/ergodox_ez/keymaps/colemak_es_osx/keymap.c new file mode 100644 index 00000000000..0abd028a018 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/colemak_es_osx/keymap.c @@ -0,0 +1,397 @@ +/* + Copyright 2019 Mario Arias + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H +#include "version.h" + +#include "keymap_spanish.h" + +enum layers { + BASE = 0, //Colemak + QWERTY, //Qwerty + FN, //Colemak but FN1 to FN12 instead of numbers + NUM, //Numpad + MOUSE, //Mouse and media controls + IDEA //Shortcuts for IDEA / Other tools +}; + +//Special paste +#define S_PASTE LSFT(LGUI(KC_V)) +//tmux prefix +#define T_PREFIX LCTL(KC_B) +// Column mode +#define I_COLUMN ALGR(LCTL(LGUI(ES_MINS))) +// Terminal +#define I_TERM ALGR(KC_F12) +// Line comment +#define I_LN_COM LCTL(LGUI(KC_7)) +// Block comment +#define I_BK_COM LCTL(LGUI(KC_8)) +// Reformat code +#define I_REFORM LALT(LGUI(KC_L)) +// Rename +#define I_RENAME LSFT(KC_F6) +// Find usages +#define I_FUSAGE LALT(KC_F7) +// Code for Packt +#define P_CODE LCTL(ALGR(KC_X)) +// Search +#define I_SEARCH LCTL(LSFT(KC_F)) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Colemak MacOS Spanish layer + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 ! | 2 " | 3 · | 4 $ | 5 % | º \ | | ¡ ¿ | 6 & | 7 / | 8 ( | 9 ) | 0 = | Backsp | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | Q | W | F | P | G | Home | | End | J | L | U | Y | Ñ | ' ? | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CAPS | A | R | S | T | D |------| |------| H | N | E | I | O | ENT | + * |--------+------+------+------+------+------| <> | | -_ |------+------+------+------+------+--------| + * | Shift | Z | X | C | V | B | | | | K | M | , ; | . : | UP | Shift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Del | PgUp |Ctl/PD|Alt/[ |Cmd/] | |Cmd/{ |Alt/} | LEFT | DOWN | RIGHT| + * `----------------------------------' `----------------------------------' + * ,--------------. ,--------------. + * | Num | Mouse | | Qwer | Ctrl | + * ,------|------|-------| |------+-------+------. + * | | | FN | |SPaste| | | + * |LShift|Backsp|-------| |------| ENT |Space | + * | | | IDEA | | T-pre| | | + * `---------------------' `---------------------' + */ +[BASE] = LAYOUT_ergodox( +// left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, ES_LESS, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_HOME, + KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, + KC_DEL, KC_PGUP, CTL_T(KC_PGDN), ALT_T(ES_GRV), GUI_T(ES_PLUS), + + DF(NUM), DF(MOUSE), + DF(FN), + KC_LSFT, KC_BSPC, MO(IDEA), + +// right hand + ES_IEXL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_END, KC_J, KC_L, KC_U, KC_Y, ES_NTIL, ES_APOS, + KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT, + ES_MINS, KC_K, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT, + GUI_T(ES_ACUT), ALT_T(KC_BSLS), KC_LEFT, KC_DOWN, KC_RIGHT, + + DF(QWERTY), KC_RCTL, + S_PASTE, + T_PREFIX, KC_ENT, KC_SPC +), +/* Keymap 1: Spanish QWERTY layer (games) //Will probably change it for a Linux/Windows Colemak layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | Q | W | E | R | T | | | | Y | U | I | O | P | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | A | S | D | F | G |------| |------| H | J | K | L | Ñ | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Z | X | C | V | B | | | | N | M | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | Base | | + * ,------|------|------| |------+--------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `----------------------' + */ +[QWERTY] = LAYOUT_ergodox( + // left hand + _______, _______, _______, _______, _______, _______, _______, + _______, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, + _______, KC_A, KC_S, KC_D, KC_F, KC_G, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, + _______, _______, _______, _______, _______, + + _______, _______, + _______, + _______, _______, _______, + +// right hand + _______, _______, _______, _______, _______, _______, _______, + _______, KC_Y, KC_U, KC_I, KC_O, KC_P, _______, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, _______, + _______, KC_N, KC_M, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + DF(BASE), _______, + _______, + _______, _______, _______ +), +/* Keymap 2: Function Layer +* +* ,--------------------------------------------------. ,--------------------------------------------------. +* | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | +* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +* | | | | | | | | | | | | | | | | +* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +* | | | | | | |------| |------| | | | | | | +* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +* | | | | | | | | | | | | | | | | +* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' +* | | | | | | | | | | | | +* `----------------------------------' `----------------------------------' +* ,-------------. ,-------------. +* | | | | | | +* ,------|------|------| |------+------+------. +* | | | Base | | | | | +* | | |------| |------| | | +* | | | | | | | | +* `--------------------' `--------------------' +*/ +[FN] = LAYOUT_ergodox( + // left hand + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + + _______, _______, + DF(BASE), + _______, _______, _______, + +// right hand + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + + _______, _______, + _______, + _______, _______, _______ +), +/* Mouse and media controls + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | | | | | | Play | | Vol+ | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | Ms U | | | | | | | | Wh U | | | | + * |--------+------+------+------+------+------| Rwd | | Vol- |------+------+------+------+------+--------| + * | | | Ms L | Ms D | Ms R | |------| |------| | Wh L | Wh D | Wh R | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | Acc0 | Acc1 | Acc2 | | Fwd | | Mute | | Btn1 | Btn2 | Btn3 | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Num | Base | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------ |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[MOUSE] = LAYOUT_ergodox( +// left hand + KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY, + XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, XXXXXXX, KC_MRWD, + XXXXXXX, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, + XXXXXXX, XXXXXXX, KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, KC_MFFD, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + DF(NUM), DF(BASE), + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + +// right hand + KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_VOLD, XXXXXXX, XXXXXXX, KC_WH_U, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_WH_L, KC_WH_D, KC_WH_R, XXXXXXX, XXXXXXX, + KC_MUTE, XXXXXXX, KC_BTN1, KC_BTN2, KC_BTN3, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX +), +/* Num pad + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | ( | ) | = | / | * | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | Up | | | | | | | 7 | 8 | 9 | - | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | Left | Down |Right | |------| |------| | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | 1 | 2 | 3 |Enter | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | 0 | 0 | , |Enter | . | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Base | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------ |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[NUM] = LAYOUT_ergodox( +// left hand + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + + DF(BASE), _______, + _______, + _______, _______, _______, + +// right hand + _______, LSFT(KC_8), LSFT(KC_9), KC_PEQL, KC_PSLS, KC_PAST, _______, + _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______, + _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______, + _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, + KC_P0, KC_P0, KC_PDOT, KC_PENT, KC_DOT, + + _______, _______, + _______, + _______, _______, _______ +), +/* IDEA + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | Renm | | Usag | | LnCm | BkCm | | Term | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | |Search| | | | | | | Refm | | | | | + * |--------+------+------+------+------+------| | | Col |------+------+------+------+------+--------| + * | | | | | | |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | Code | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------ |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[IDEA] = LAYOUT_ergodox( + +//Left hand + _______, _______, _______, _______, _______, _______, I_RENAME, + _______, _______, _______, I_SEARCH, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, P_CODE, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + + _______, DF(BASE), + _______, + _______, _______, _______, + +// right hand + I_FUSAGE, _______, I_LN_COM, I_BK_COM, _______, I_TERM, _______, + I_COLUMN, _______, I_REFORM, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + + _______, _______, + _______, + _______, _______, _______ +) +}; + + +void led_1_off(void) { + ergodox_right_led_1_off(); +} + +void led_2_off(void) { + ergodox_right_led_2_off(); +} + +void led_3_off(void) { + ergodox_right_led_3_off(); +} + +//Runs just one time when the keyboard initializes +void matrix_init_use(void) { + led_1_off(); + led_2_off(); + led_3_off(); +} + +// Value to use to switch LEDs on. The default value of 255 is far too bright. +static const uint8_t max_led_value = 20; + + +void led_1_on(void) { + ergodox_right_led_1_on(); + ergodox_right_led_1_set(max_led_value); +} + +void led_2_on(void) { + ergodox_right_led_2_on(); + ergodox_right_led_2_set(max_led_value); +} + +void led_3_on(void) { + ergodox_right_led_3_on(); + ergodox_right_led_3_set(max_led_value); +} + +uint32_t layer_state_set_user(uint32_t state) { + + if(layer_state_cmp(state ,IDEA)) { + led_1_on(); + led_3_on(); + } else { + led_1_off(); + led_3_off(); + } + + return state; +}; + +void matrix_scan_user(void) { + + ergodox_board_led_off(); + led_1_off(); + led_2_off(); + led_3_off(); + + if(layer_state_cmp(default_layer_state, QWERTY)) { + led_3_on(); + } + + if(layer_state_cmp(default_layer_state, FN)) { + led_2_on(); + } + + if(layer_state_cmp(default_layer_state, NUM)) { + led_2_on(); + led_3_on(); + } + + if(layer_state_cmp(default_layer_state, MOUSE)) { + led_1_on(); + } +}; diff --git a/keyboards/ergodox_ez/keymaps/colemak_es_osx/readme.md b/keyboards/ergodox_ez/keymaps/colemak_es_osx/readme.md new file mode 100644 index 00000000000..b17ae015aaa --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/colemak_es_osx/readme.md @@ -0,0 +1,67 @@ +# ErgoDox EZ Spanish Colemak configuration + +## Description + +A Colemak keymap adapted for Spanish. + +### Base Layer - Spanish Colemak + +The Base Layer is a Colemak keymap with an additional "ñ" next to the "y" key. The arrow cluster has a proper T inverted shape. + +It includes almost all Spanish Symbols from a normal 100% keyboard thanks to the use of tap keys + + +| Pressed | Tap | Shift | Alt | +|---|---|---|---| +|Left Ctrl|PgDn||| +|Left Alt|`|ˆ|[| +|Left Cmd|+|*|]| +|Right Cmd|´|¨|{| +|Right Alt|ç|Ç|}| + +For example, if you want to type ```[]```, you keep pressing the "Left Alt" (To modify) and tap "Right Alt" and "Right Cmd" to send "[" and "]" + +### Qwerty Layer + +A Qwerty layer for gaming and maybe some VIM commands. It just modifies the few keys that are different between Colemak and Qwerty and keep all the others keys + +### Fn Layer + +A layer to change the number row including "º" and "¡" for "Fn1" to "Fn12". The rest is just the same as the Base layer + +### Mouse and media controls + +Mouse movement on the left hand, wheel and buttons on the right hand. "Play/Pause", "Rewind", "Forward" in the Left inner column. "Volume Up", "Volume Down" and "Mute" in the Right inner column + +### Numpad + +A complete numpad in the right hand, plus and Arrow cluster on the left hand + +### IDEA (JetBrains IDEs) + +A momentary layer for IDEA shortcuts that require more than two fingers or any Fn key + +## How to build it + +If you already have all the dependencies (Check QMK's documentation), you can run the command: + +```bash +make ergodox_ez:colemak_es_osx +``` + +On MacOS, if you're using MacPorts you can install the following dependencies: + +```bash +port install avr-binutils +port install avr-gcc +port install avr-libc +``` + +This isn't an exhaustive list and maybe there other dependencies that are technically necessary + +## Changelog + +* Jul 2019: + * Initial version for the new QMK version + +![](https://imgur.com/AyWNGlL.png) \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index ef70decd531..40d0a1eaf03 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" #include "version.h" #define BASE 0 // default layer @@ -8,8 +6,7 @@ #define MDIA 2 // media keys enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, + EPRM = SAFE_RANGE, VRSN, RGB_SLD }; @@ -36,28 +33,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |ace | End | | PgDn | | | * `--------------------' `----------------------' */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), +[BASE] = LAYOUT_ergodox( + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), GUI_T(KC_QUOT), + MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB), + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN, KC_TAB, KC_ENT +), /* Keymap 1: Symbol Layer * * ,---------------------------------------------------. ,--------------------------------------------------. @@ -79,26 +74,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ -// SYMBOLS [SYMB] = LAYOUT_ergodox( - // left hand - VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - RGB_MOD,KC_TRNS, - KC_TRNS, - RGB_VAD,RGB_VAI,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - RGB_TOG, RGB_SLD, - KC_TRNS, - KC_TRNS, RGB_HUD, RGB_HUI + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, + EPRM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_MOD, KC_TRNS, + KC_TRNS, + RGB_VAD, RGB_VAI, KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS, + RGB_TOG, RGB_SLD, + KC_TRNS, + KC_TRNS, RGB_HUD, RGB_HUI ), /* Keymap 2: Media and mouse keys * @@ -121,73 +115,43 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ -// MEDIA AND MOUSE [MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - } - return MACRO_NONE; -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // dynamically generate these. - case EPRM: - if (record->event.pressed) { + if (record->event.pressed) { + switch (keycode) { + case EPRM: eeconfig_init(); - } - return false; - break; - case VRSN: - if (record->event.pressed) { + return false; + case VRSN: SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - case RGB_SLD: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_mode(1); - #endif - } - return false; - break; + return false; + #ifdef RGBLIGHT_ENABLE + case RGB_SLD: + rgblight_mode(1); + return false; + #endif + } } return true; } @@ -199,11 +163,6 @@ void matrix_init_user(void) { #endif }; -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - -}; - // Runs whenever there is a layer state change. uint32_t layer_state_set_user(uint32_t state) { ergodox_board_led_off(); diff --git a/keyboards/ergodox_ez/keymaps/default_glow/keymap.c b/keyboards/ergodox_ez/keymaps/default_glow/keymap.c new file mode 100644 index 00000000000..526c364029f --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/default_glow/keymap.c @@ -0,0 +1 @@ +// Placeholder. See ../default/keymap.c for details diff --git a/keyboards/ergodox_ez/keymaps/default_glow/rules.mk b/keyboards/ergodox_ez/keymaps/default_glow/rules.mk new file mode 100644 index 00000000000..360c3c51b89 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/default_glow/rules.mk @@ -0,0 +1,4 @@ +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = yes # enable later + +SRC += ../default/keymap.c diff --git a/keyboards/ergodox_ez/keymaps/default_osx/keymap.c b/keyboards/ergodox_ez/keymaps/default_osx/keymap.c index 038940772ac..6388586de84 100644 --- a/keyboards/ergodox_ez/keymaps/default_osx/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default_osx/keymap.c @@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_LGUI, MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -138,25 +138,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c index dd5ee289795..c342b907698 100644 --- a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c @@ -55,14 +55,16 @@ enum custom_keycodes { }; -#define BASE 0 // base dvorak layer -#define KEYNAV 1 // arrow navigation (right hand) -#define KEYSEL 2 // arrow navigation + shift (allow text selection) -#define SHELL_NAV 3 // bash shortcuts -#define SHELL_SCREEN 4 // linux screen shortcuts -#define SCREEN_NAV 5 // navigate between linux screen tabs -#define BROWSER_CONTROL 6 // control browser and mouse -#define COMBINED 7 // combined numbers and symbols layer +#define BASE 0 // base dvorak layer +#define BASE_ALTERNATE 1 // base dvorak layer, with different layer toggling +#define KEYNAV 2 // arrow navigation (right hand) +#define KEYSEL 3 // arrow navigation + shift (allow text selection) +#define SHELL_NAV 4 // bash shortcuts +#define SHELL_SCREEN 5 // linux screen shortcuts +#define SCREEN_NAV 6 // navigate between linux screen tabs +#define BROWSER_CONTROL 7 // control browser and mouse +#define COMBINED 8 // combined numbers and symbols layer +#define ANDROID_STUDIO 9 // macros @@ -94,7 +96,17 @@ enum custom_keycodes { #define SCREEN_PASTEREG_3 30 #define DEL_TO_HOME 36 - +// Android Studio shortcuts +#define AS_TABLEFT LALT(KC_LEFT) +#define AS_TABRIGHT LALT(KC_RIGHT) +#define AS_SYMBOL LCTL(LALT(KC_N)) +#define AS_CLASS LCTL(KC_N) +#define AS_FINDUSAGE LALT(KC_F7) +#define AS_BACK LCTL(LALT(KC_LEFT)) +#define AS_GO_DECLARATION LCTL(KC_B) +#define AS_GO_IMPLEMENTATION LCTL(LALT(KC_B)) +#define AS_CLOSETAB LCTL(KC_F4) +#define AS_CLOSETOOLWINDOW LCTL(LSFT(KC_F4)) #define MACRO_SCREEN_NUM(MACRO_NAME,NUM) \ @@ -164,6 +176,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MEH(KC_F5),MEH(KC_F6),MEH(KC_F7),MEH(KC_F8),KC_ENTER,KC_SPACE ), + + // alternate base layout + [BASE_ALTERNATE] = LAYOUT_ergodox( + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + OSL(ANDROID_STUDIO),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // bottom row + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + // thumb cluster + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // bottom row + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // thumb cluster + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), [KEYNAV] = LAYOUT_ergodox( // left hand @@ -195,7 +233,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,MEH(KC_L), MEH(KC_M),MEH(KC_N), MEH(KC_O), MEH(KC_P), KC_TRNS,MEH(KC_Q), MEH(KC_R),MEH(KC_S), MEH(KC_T), MEH(KC_U), KC_TRNS, // bottom row - RESET,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + RESET,DF(BASE),DF(BASE_ALTERNATE),KC_TRNS,KC_TRNS, // thumb cluster KC_TRNS,KC_TRNS, KC_TRNS, @@ -294,7 +332,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), - + // android studio shortcuts + [ANDROID_STUDIO] = LAYOUT_ergodox( + // left hand + KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // bottom row + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + // thumb cluster + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, AS_FINDUSAGE, AS_GO_DECLARATION, AS_GO_IMPLEMENTATION, KC_TRNS, + KC_TRNS, AS_TABLEFT, AS_TABRIGHT, AS_SYMBOL, AS_CLASS, AS_BACK, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, AS_CLOSETAB, AS_CLOSETOOLWINDOW, KC_TRNS, + // bottom row + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // thumb cluster + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), [COMBINED] = LAYOUT_ergodox( @@ -348,10 +410,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(1) -}; - // leaving this in place for compatibilty with old keymaps cloned and re-compiled. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/.gitignore b/keyboards/ergodox_ez/keymaps/hacker_dvorak/.gitignore new file mode 100644 index 00000000000..504afef81fb --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +package-lock.json diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h b/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h new file mode 100644 index 00000000000..a0ba655ede1 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h @@ -0,0 +1,92 @@ +/* + Set any config.h overrides for your specific keymap here. + See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file +*/ +#pragma once + + +#undef TAPPING_TERM +#define TAPPING_TERM 175 + +#undef DEBOUNCE +#define DEBOUNCE 15 + +#undef IGNORE_MOD_TAP_INTERRUPT +#define IGNORE_MOD_TAP_INTERRUPT + +#define RGB_DISABLE_WHEN_USB_SUSPENDED true + +#undef FORCE_NKRO +#define FORCE_NKRO + +#undef TAPPING_TOGGLE +#define TAPPING_TOGGLE 5 + +#define LEADER_TIMEOUT 1000 +#define PERMISSIVE_HOLD +#define QMK_KEYS_PER_SCAN 4 +#define DANCING_TERM 175 + +#define ONESHOT_TAP_TOGGLE 5 + +#undef ONESHOT_TIMEOUT +#define ONESHOT_TIMEOUT 5000 + +#define COMBO_COUNT 4 +#define COMBO_TERM 200 + + +#undef RGBLIGHT_HUE_STEP +#define RGBLIGHT_HUE_STEP 24 + +#undef RGBLIGHT_SAT_STEP +#define RGBLIGHT_SAT_STEP 24 + +#undef RGBLIGHT_VAL_STEP +#define RGBLIGHT_VAL_STEP 24 + +#undef RGBLIGHT_BRI_STEP +#define RGBLIGHT_BRI_STEP 24 + +#undef RGBLIGHT_LIMIT_VAL +#define RGBLIGHT_LIMIT_VAL 255 + + +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 10 + +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 15 + +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 20 + +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 200 + +#undef MOUSEKEY_WHEEL_MAX_SPEED +#define MOUSEKEY_WHEEL_MAX_SPEED 20 + +#undef MOUSEKEY_WHEEL_TIME_TO_MAX +#define MOUSEKEY_WHEEL_TIME_TO_MAX 200 + + +// #undef NO_DEBUG +// #define NO_DEBUG + +// #undef NO_PRINT +// #define NO_PRINT + +// #define RETRO_TAPPING +// #define TAPPING_FORCE_HOLD + +// #define AUTO_SHIFT_TIMEOUT 150 +// #define NO_AUTO_SHIFT_SPECIAL +// #define NO_AUTO_SHIFT_NUMERIC +// #define NO_AUTO_SHIFT_ALPHA + +// #define EXTRA_LONG_COMBOS +// #define EXTRA_EXTRA_LONG_COMBOS +// #define COMBO_ALLOW_ACTION_KEYS + +// #define RGBLIGHT_SLEEP diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js b/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js new file mode 100644 index 00000000000..81a4e93fda4 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js @@ -0,0 +1,22 @@ +const gulp = require('gulp'); +const run = require('gulp-run-command').default; + + +const ROOT_DIR = '../../../../'; +const BUILD_DIR = `${ROOT_DIR}.build`; +const HACKER_DVORAK_DIR = './**/*'; + +const CLEAN_CMD = `rm -rf ${BUILD_DIR}`; +const BUILD_CMD = `make -C ${ROOT_DIR} ergodox_ez:hacker_dvorak`; + +gulp.task('clean', run(CLEAN_CMD)); + +gulp.task('build', gulp.series('clean', run(BUILD_CMD, { + ignoreErrors: true +}))); + +gulp.task('watch', gulp.series('build', () => { + gulp.watch(HACKER_DVORAK_DIR, gulp.series('build')); +})); + +gulp.task('default', gulp.series('watch')); diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/hacker_dvorak.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/hacker_dvorak.c new file mode 100644 index 00000000000..71cf1053aa0 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/hacker_dvorak.c @@ -0,0 +1,353 @@ +// Keyboard keymap: +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DVORAK] = LAYOUT_ergodox( + + // HACKER DVORAK left hand + + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // ESCAPE | | | | | | START RECORDING // + // | | | | | | // + KC_ESC, TD(GRV_TILD), TD(AT_DLR), TD(LCBR_LABK), TD(LPRN_LBRC), TD(EXLM_QUES), DYN_REC_START1, // + // | ~ | $ | < | [ | ? | // + // | TAP DANCE: ` | TAP DANCE: @ TAP DANCE: { | TAP DANCE: ( | TAP DANCE: ! | DYNAMIC MARCO 1 // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // TAB | MOD TAP: ALT+SHIFT | MOD TAP: CTRL+ALT | MOD TAP: CTRL+SHIFT | P | Y | // + // | | | | | | // + KC_TAB, TD(NONE_LEAD), TD(QUOT_DQUO), TD(DOT_COMM), LCG_T(KC_P), LAG_T(KC_Y), DYN_MACRO_PLAY1, // + // | LEAD | " | , | | | // + // | TAP DANCE: NONE | TAP DANCE: ' | TAP DANCE: . | MOD TAP: CTRL+GUI | MOD TAP: ALT+GUI | // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------| PLAY DYNAMIC MACRO 1 // + // | MOD TAP: ALT | MOD TAP: CTRL | LAYER TAP: SHIFT | M TAP DANCE: ARROWS/GUI | MOD TAP: SHIFT+GUI | // + // | | | | Ü | | // + TD(EQL_PLUS), LALT_T(KC_A), LCTL_T(KC_O), LSFT_T(KC_E), TD(U_ARR_GUI), SGUI_T(KC_I), //-----------------------// + // + | Á | Ó | É | Ú | Í | // + // TAP DANCE: = | TAP DANCE: A | TAP DANCE: O | TAP DANCE: E | TAP DANCE: U | TAP DANCE: I | // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------| META // + // STOP RECORDING | MOD TAP: GUI+SHIFT+ALT | Q | J | K | X | // + // | | | | | | // + DYN_REC_STOP, TD(SCLN_COLN), LCAG_T(KC_Q), TD(J_MED_MEH), TD(K_NUM_HYP), LCSG_T(KC_X), KC_LGUI, // + // | : | | | | | // + // DYNAMIC MACRO | TAP DANCE: ; | MOD TAP: SHIFT+GUI | M TAP DANCE: MEDIA/MEH | M TAP DANCE: ATM/HYPER | MOD TAP: CTL+SHIFT+GUI | // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // LAYERS SWITCHER | APPLICATION MENU | | | // + // | | | | SCROLL // + TG(LAYERS), KC_APP, KC_NLCK, KC_SLCK, KC_CAPS, // + // | | | | NUM // + // LAYER TOGGLE | | | | TAP DANCE: CAPS // + //------------------------+-------------------------+-------------------------+-------------------------+------------------------// + + // HACKER DVORAK left thumb + + //------------------------+------------------------// + // MOUSE WHEEL LEFT | MOUSE WHEEL RIGHT // + // | // + KC_WH_L, KC_WH_R, // + // | // + // | // + //-------------------------+-------------------------+------------------------// + // | | HOME // + // | | // + /* SPACE | BACKSPACE */ KC_HOME, // + // | | // + // | | // + KC_SPC, KC_BSPC, //-----------------------// + // | | END // + // | | // + /* | */ KC_END, // + // | | // + // | | // + //-------------------------+-------------------------+------------------------// + + // HACKER DVORAK right hand + + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | | | // + // | | | | | | // + DYN_REC_START2, TD(APMR_PIPE), TD(RPRN_RBRC), TD(RCBR_RABK), TD(HASH_PERC), TD(ASTR_CIRC), XXXXXXX, // + // | | | | | | // + // | | | | | | // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | | | // + // | | | | | | // + DYN_MACRO_PLAY2, LAG_T(KC_F), LCG_T(KC_G), C_S_T(KC_C), LCA_T(KC_R), LAS_T(KC_L), TD(SLSH_BSLS), // + // | | | | | | // + // | | | | | | // + // |-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | | | // + // | | | | | | // + /*-----------------------*/ SGUI_T(KC_D), TD(H_MOU_GUI), LSFT_T(KC_T), LCTL_T(KC_N), LALT_T(KC_S), TD(MINS_UNDS), // + // | | | | | | // + // | | | | | | // + // |-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | | | // + // | | | | | | // + KC_LGUI, LCSG_T(KC_B), TD(M_CHO_HYP), TD(W_MED_MEH), LCAG_T(KC_V), LASG_T(KC_Z), COMPOSE, // + // | | | | | | // + // | | | | | | ⎄ // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | // + // | | | | // + KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_SYSREQ, // + // | | | | // + // | | | | // + //------------------------+-------------------------+-------------------------+-------------------------+------------------------// + + // HACKER DVORAK right thumb + + //------------------------+------------------------// + // | // + // | // + KC_WH_U, KC_WH_D, // + // | // + // | // + //------------------------+-------------------------+------------------------// + // | | // + // | | // + KC_PGUP, // | // + // | | // + // | | // + //------------------------| | // + // | | // + // | | // + KC_PGDN, KC_DEL, KC_ENT // + // | | // + // | | // + //------------------------+-------------------------+------------------------// + + ), + + [PLOVER] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_BTN3, GUI_T(KC_NO), + KC_ESC, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN5, PV_NUM, + KC_TAB, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, + KC_CLCK, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, + XXXXXXX, TG(LAYERS), PV_NUM, PV_NUM, PV_NUM, + + // left thumb + KC_SPACE, KC_BSPACE, + KC_HOME, + PV_A, PV_O, KC_END, + + // right hand + KC_MS_ACCEL2, KC_MS_ACCEL1, KC_MS_ACCEL0, KC_UP, KC_APPLICATION, XXXXXXX, KC_MS_WH_UP, + PV_NUM, KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_MS_WH_DOWN, + PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, + PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, + PV_NUM, PV_NUM, PV_NUM, PV_NUM, XXXXXXX, + + // right thumb + KC_DELETE, KC_ENTER, + KC_PGUP, + KC_PGDOWN, PV_E, PV_U + ), + + [GAMING] = LAYOUT_ergodox( + // left hand + KC_ESCAPE, GUI_T(KC_MINS), KC_I, KC_O, KC_P, ALGR_T(KC_EQL), KC_T, + KC_TAB, KC_LALT, KC_Q, KC_W, KC_E, ALL_T(KC_R), KC_G, + LT(MOUSE, KC_GRV), KC_LCTRL, KC_A, KC_S, KC_D, MEH_T(KC_F), + KC_BSLS, KC_LSHIFT, KC_Z, KC_X, KC_C, SCMD_T(KC_V), KC_M, + XXXXXXX, TG(LAYERS), KC_COMM, KC_DOT, KC_LBRC, + + // left thumb + MO(MEDIA_FN), KC_NLCK, + KC_SCLN, + KC_SPACE, KC_ENTER, KC_BSPACE, + + // right hand + KC_QUOT, KC_Y, KC_K, KC_U, KC_KP_7, KC_KP_8, KC_KP_9, + KC_MS_WH_UP, KC_H, KC_J, KC_L, KC_KP_4, KC_KP_2, KC_KP_6, + KC_B, KC_MS_UP, KC_N, KC_KP_1, KC_KP_5, KC_KP_3, + KC_MS_WH_DOWN, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_UP, KC_KP_0, KC_SLASH, + KC_RBRC, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, + + // right thumb + KC_MS_BTN5, MO(CHORD), + KC_MS_BTN4, + KC_MS_BTN3, KC_MS_BTN2, KC_MS_BTN1 + ), + + [ARROWS] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, SCMD_T(KC_NO), MEH_T(KC_NO), ALL_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_LCTRL, KC_LSHIFT, XXXXXXX, _______, XXXXXXX, + XXXXXXX, KC_RALT, KC_LALT, GUI_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + KC_HOME, + KC_SPACE, KC_BSPACE, KC_END, + + // right hand + LGUI(KC_X), XXXXXXX, LCTL(KC_X), KC_MS_WH_UP, XXXXXXX, XXXXXXX, XXXXXXX, + LGUI(KC_C), XXXXXXX, LCTL(KC_C), KC_UP, SCTL(KC_C), LCTL(KC_Z), LGUI(KC_Z), + KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_APPLICATION, + LGUI(KC_V), XXXXXXX, LCTL(KC_V), KC_MS_WH_DOWN, SCTL(KC_V), LCTL(KC_Y), SGUI(KC_Z), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, + + // right thumb + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + + [MOUSE] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_WH_UP, LCTL(KC_X), XXXXXXX, LGUI(KC_X), + LGUI(KC_Z), LCTL(KC_Z), SCTL(KC_C), KC_MS_UP, LCTL(KC_C), KC_MS_BTN4, LGUI(KC_C), + KC_MS_BTN3, KC_MS_WH_LEFT, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_RIGHT, + LGUI(KC_Z), LCTL(KC_Y), SCTL(KC_V), KC_MS_WH_DOWN, LCTL(KC_V), KC_MS_BTN5, LGUI(KC_V), + KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + KC_MS_BTN1, KC_MS_BTN2, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, ALL_T(KC_NO), MEH_T(KC_NO), SCMD_T(KC_NO), XXXXXXX, + XXXXXXX, _______, KC_MS_ACCEL1, KC_LSHIFT, KC_LCTRL, KC_MS_ACCEL2, + XXXXXXX, XXXXXXX, XXXXXXX, GUI_T(KC_NO), KC_LALT, KC_RALT, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, KC_MS_ACCEL0 + ), + + [NUMPAD] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, GUI_T(KC_NO), XXXXXXX, ALL_T(KC_NO), XXXXXXX, XXXXXXX, + _______, KC_LCTRL, KC_LSHIFT, _______, MEH_T(KC_NO), XXXXXXX, + XXXXXXX, KC_RALT, KC_LALT, XXXXXXX, SCMD_T(KC_NO), XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + KC_HOME, + KC_SPACE, KC_BSPACE, KC_END, + + // right hand + KC_X, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, + KC_O, KC_I, KC_1, KC_2, KC_3, KC_SLSH, KC_PERC, + KC_M, KC_4, KC_5, KC_6, KC_PLUS, KC_MINS, + KC_L, KC_J, KC_7, KC_8, KC_9, KC_ASTR, KC_CIRC, + KC_DOT, KC_0, KC_COMM, KC_UNDS, KC_BSLS, + + // right thumb + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + + [LAYERS] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, TO(DVORAK), TO(PLOVER), TO(GAMING), XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [MEDIA_FN] = LAYOUT_ergodox( + // left hand + KC_VOLD, KC_MUTE, RGB_TOG, XXXXXXX, KC_MAIL, KC_FIND, KC_WWW_REFRESH, + KC_MPRV, KC_F9, KC_F7, KC_F5, KC_F3, KC_F1, KC_WWW_HOME, + KC_PAUS, KC_F19, KC_F17, KC_F15, KC_F13, KC_F11, + RGB_HUD, XXXXXXX, XXXXXXX, _______, KC_F23, KC_F21, KC_WWW_BACK, + RGB_VAD, KC_CLCK, KC_PSCREEN, XXXXXXX, MO(FIRMWARE), + + // left thumb + _______, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, KC_MEDIA_EJECT, + + // right hand + KC_WWW_FAVORITES, KC_MYCM, KC_CALC, XXXXXXX, RGB_MOD, RGB_M_P, KC_VOLU, + KC_WWW_SEARCH, KC_F2, KC_F4, KC_F6, KC_F8, KC_F10, KC_MNXT, + KC_F12, KC_F14, KC_F16, KC_F18, KC_F20, KC_MPLY, + KC_WWW_FORWARD, KC_F22, KC_F24, _______, XXXXXXX, XXXXXXX, RGB_HUI, + KC_PWR, XXXXXXX, KC_SLEP, KC_WAKE, RGB_VAI, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [CHORD] = LAYOUT_ergodox( + // left hand + XXXXXXX, HYPR(KC_F1), HYPR(KC_F2), HYPR(KC_F3), HYPR(KC_F4), HYPR(KC_F5), XXXXXXX, + XXXXXXX, HYPR(KC_F6), HYPR(KC_F7), HYPR(KC_F8), HYPR(KC_F9), HYPR(KC_F10), XXXXXXX, + XXXXXXX, HYPR(KC_F11), HYPR(KC_F12), HYPR(KC_F13), HYPR(KC_F14), HYPR(KC_F15), + XXXXXXX, HYPR(KC_F16), HYPR(KC_F17), HYPR(KC_F18), HYPR(KC_F19), HYPR(KC_F20), XXXXXXX, + XXXXXXX, HYPR(KC_F21), HYPR(KC_F22), HYPR(KC_F23), HYPR(KC_F24), + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, _______, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [FIRMWARE] = LAYOUT_ergodox( + + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + RESET, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, EEP_RST + ) +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/aliases_definitions.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/aliases_definitions.c new file mode 100644 index 00000000000..323358357ad --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/aliases_definitions.c @@ -0,0 +1,13 @@ +// Compound keycode aliases +#define SCTL(kc) LSFT(LCTL(kc)) // Modifier keys: SHIFT+CTRL+kc combination. + +// Tap +#define LASG_T(kc) MT(MOD_LGUI | MOD_LALT | MOD_LSFT, kc) // Mod tap: kc when tapped, GUI+ALT+SHIFT when held. +#define LCSG_T(kc) MT(MOD_LGUI | MOD_LSFT | MOD_LCTL, kc) // Mod tap: kc when tapped, GUI+CTL+SHIFT when held. + +#define LCG_T(kc) MT(MOD_LCTL | MOD_LGUI, kc) // Mod tap: kc when tapped, CTL+GUI when held. +#define LAS_T(kc) MT(MOD_LALT | MOD_LSFT, kc) // Mod tap: kc when tapped, ALT+SHIFT when held. +#define LAG_T(kc) MT(MOD_LALT | MOD_LGUI, kc) // Mod tap: kc when tapped, ALT+GUI when held. + +// Others +#define COMPOSE KC_RALT // Compose key (used to input characters like á, ñ, ü). diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/custom_keycodes.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/custom_keycodes.c new file mode 100644 index 00000000000..338910b53f6 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/custom_keycodes.c @@ -0,0 +1,7 @@ +// Define custom user keycodes: +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // Can always be here. + MY_CUSTOM_MACRO, // Custom macro example. + MY_OTHER_MACRO, // Custom macro example. + DYNAMIC_MACRO_RANGE // Should always be the last. +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c new file mode 100644 index 00000000000..e953f06de8c --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c @@ -0,0 +1,28 @@ +#include QMK_KEYBOARD_H // Includes the QMK-verse. +#include "keymap_plover.h" // Includes the Plover keymap for easier readability. + + +// TODO: No eeprom changes unless needed, custom rgb settings for animations. +#include "keycodes/aliases_definitions.c" +#include "layers/layers_definitions.c" +#include "tap_dance/tap_dance_setup.c" +#include "tap_dance/tap_dances.c" +#include "user/matrix_scan_user.c" +#include "tap_dance/mod_tap_layer_dances/none_lead.c" +#include "tap_dance/mod_tap_layer_dances/dot_comm.c" +#include "tap_dance/mod_tap_layer_dances/quot_dquot.c" +#include "tap_dance/mod_tap_layer_dances/scln_coln.c" +#include "tap_dance/mod_tap_layer_dances/u_arrows_gui.c" +#include "tap_dance/mod_tap_layer_dances/h_mouse_gui.c" +#include "tap_dance/mod_tap_layer_dances/j_media_meh.c" +#include "tap_dance/mod_tap_layer_dances/w_media_meh.c" +#include "tap_dance/mod_tap_layer_dances/k_numpad_hyper.c" +#include "tap_dance/mod_tap_layer_dances/m_chords_hyper.c" +#include "tap_dance/tap_dance_actions.c" +#include "keycodes/custom_keycodes.c" +#include "dynamic_macro.h" // Includes dynamic macro definitions, needed *after* the custom keycodes. +#include "hacker_dvorak.c" +#include "user/eeconfig_init_user.c" +#include "user/process_record_user.c" +#include "plover/plover_mode.c" +#include "user/layer_set_state_user.c" diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/layers/layers_definitions.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/layers/layers_definitions.c new file mode 100644 index 00000000000..f252bc802b2 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/layers/layers_definitions.c @@ -0,0 +1,12 @@ +enum layers { // Hacker Dvorak keyboard layers: + DVORAK = 0, // * Dvorak base layer. + PLOVER = 1, // * Steno layer for use with Plover. + GAMING = 2, // * Gaming layer intended for general purpose playing. + ARROWS = 3, // * Arrows movement keys and edition shortcuts. + MOUSE = 4, // * Mouse movement keys and edition shortcuts. + NUMPAD = 5, // * ATM style numpad with symbols and letters that should suffice to input any numeric literal. + LAYERS = 6, // * Layer switcher used to change between DVORAK, PLOVER and GAMING layers. + MEDIA_FN = 7, // * Media, RGB and function keys from F1 to F24 in symmetric fashion. + CHORD = 8, // * Hot keys layer (uses hyper + F1 .. F24) suitable for global shortcut tasks. + FIRMWARE = 9 // * Layer with firmware related functionality, like the reset and EEPROM keys. +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c new file mode 100644 index 00000000000..8d5fa00a7d4 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c @@ -0,0 +1,14 @@ +LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY(TD(APMR_PIPE)) { + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + } +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c new file mode 100644 index 00000000000..c22670a05aa --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c @@ -0,0 +1 @@ +LEADER_EXTERNS(); diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/package.json b/keyboards/ergodox_ez/keymaps/hacker_dvorak/package.json new file mode 100644 index 00000000000..173bcd5a866 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/package.json @@ -0,0 +1,15 @@ +{ + "name": "hacker_dvorak", + "version": "1.0.0", + "description": "Inspired by the [*Programmer Dvorak*](https://www.kaufmann.no/roland/dvorak) keyboard layout, cherry picked ideas from other layouts in the [EZ Repository](https://configure.ergodox-ez.com/search?q=dvorak&legacy=true), a character distribution [heatmap vizualizer](https://run.plnkr.co/plunks/5EEO8nJ2wRzYAfT3), my own subjective use cases and lots of trial and error.", + "main": "gulpfile.js", + "scripts": { + "test": "test" + }, + "author": "SalchiPapa", + "license": "GPL-2.0", + "dependencies": { + "gulp": "^4.0.0", + "gulp-run-command": "0.0.9" + } +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/plover/plover_mode.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/plover/plover_mode.c new file mode 100644 index 00000000000..b388264907a --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/plover/plover_mode.c @@ -0,0 +1,20 @@ +// TODO: improve feedback +void plover_toggle(void) { + // Press "PHROLG" + register_code(PV_LP); + register_code(PV_LH); + register_code(PV_LR); + register_code(PV_O); + register_code(PV_RL); + register_code(PV_RG); + + // Release "PHROLG" + unregister_code(PV_LP); + unregister_code(PV_LH); + unregister_code(PV_LR); + unregister_code(PV_O); + unregister_code(PV_RL); + unregister_code(PV_RG); +} + +bool PLOVER_MODE = false; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md b/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md new file mode 100644 index 00000000000..8089a6d55a4 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md @@ -0,0 +1,62 @@ +# [Ergodox EZ Hacker Dvorak Layout](https://configure.ergodox-ez.com/layouts/Wadz/latest/0) + +Inspired by the [*Programmer Dvorak*](https://www.kaufmann.no/roland/dvorak) keyboard layout, cherry picked ideas from other layouts in the [EZ Repository](https://configure.ergodox-ez.com/search?q=dvorak&legacy=true), a character distribution [heatmap vizualizer](https://run.plnkr.co/plunks/5EEO8nJ2wRzYAfT3), my own subjective use cases and lots of trial and error. + +## Setup + +Configure your OS keyboard layout to US, or the keymap will be incorrect. + +## Limitations + +I plan to use [QMK](https://docs.qmk.fm) in the future, in order to overcome some limitations of the Ergodox EZ [graphical configurator](https://configure.ergodox-ez.com/layouts/default/latest/0)), however I will defer that, until more progress is made to the new [configurator](https://medium.com/the-ergo/the-configurator-is-out-of-beta-e107aec80cae). + +## Layers + +1. Dvorak + * US Dvorak layout. + * All symbols (including shifted symbols). + * All modifier are dual keys positioned near the home row. +2. Querty + * Used to overcome the limitation pointed above, when your OS layout is set to Dvorak instead of US, this way you can use + Standard Dvorak (available by default on all the main operating systems) on other normal keybdoards and Hacker Dvorak on + the Ergodox EZ Shine at the same time, without changing back and forth tho OS layout. +3. Gaming + * Still in development. + * Left side is mainly "normal" Qwerty. + * Right side is mainly for movement, either using the mouse, the arrow keys, the number pad or the `H`, `J`, `K`, `L` as direction keys. +4. Arrows + * Arrow keys navigation. + * All modifier keys. + * Common text edititng shortcuts (doesn't work for MacOS). +5. Mouse + * Mouse navigation. + * All modifier keys. + * Common text edititng shortcuts (doesn't work for MacOS). +6. Numpad + * ATM style numpad. + * All modifier keys. + * Letters from `A` to `F` for hexadecimal numbers (`B` is also used for binary numeric literals in most programming + languages, ie. `0b11001`). + * `X` for hexadecimal numeric literals in most programming languages, ie. `0xbeef`. + * `O` for octal numeric literals in most programming languages, ie `0o123`. + * `J` for complex numeric literals in Python, ie. `3j`. + * `I` and `M` for complex Julia numeric literals, ie. `3im`. + * Common symbols for mathematical operations. +7. Hyper Fn + * Useful for custom global shortcuts. +8. Media Fn + * Media keys. + * Function keys. + * EZ Shine keys. +9. Meh Fn + * Useful for custom application shortcuts. +10. Meh Fn + + * Useful for custom standard shortcuts. + +## To Do + +Add images. + +*** + +Please comment below if you have any ideas or suggestions. If you have used this layout or used it as a base, I'd love to hear about your experience! diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk b/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk new file mode 100644 index 00000000000..aa13f98bd60 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk @@ -0,0 +1,41 @@ +# Set any rules.mk overrides for your specific keymap here. +# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file + +LINK_TIME_OPTIMIZATION_ENABLE = yes +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +TAP_DANCE_ENABLE = yes +MOUSEKEY_ENABLE = yes # Mouse keys(+4700b). +EXTRAKEY_ENABLE = yes # Audio control and System control(+450b). +RGBLIGHT_ENABLE = yes +LEADER_ENABLE = yes + +UNICODE_ENABLE = no +COMMAND_ENABLE = no # Commands for debug and configuration +SWAP_HANDS_ENABLE = no # Allow swapping hands of keyboard. + + +# This are by default off: +# COMBO_ENABLE = no +# UCIS_ENABLE = no # For Unicode. +# UNICODEMAP_ENABLE = no +# SLEEP_LED_ENABLE = no # Turn off leds when computer is sleeping. +# KEY_LOCK_ENABLE = no # (+1730b) +# CONSOLE_ENABLE = no # Console for debug(+400b) +# BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000b) +# API_SYSEX_ENABLE = no +# MIDI_ENABLE = no +# BLUETOOTH_ENABLE = no +# AUDIO_ENABLE = no +# FAUXCLICKY_ENABLE = no +# VARIABLE_TRACE = no +# BACKLIGHT_ENABLE = no +# RGB_MATRIX_ENABLE = no + +# POINTING_DEVICE_ENABLE = no + +# AUTO_SHIFT_ENABLE = no +# AUTO_SHIFT_MODIFIERS = no + +# This don't need argument? +# CUSTOM_MATRIX # Custom matrix file for the ErgoDox EZ +# SPLIT_KEYBOARD diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/dot_comm.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/dot_comm.c new file mode 100644 index 00000000000..cbfbcdaf9f5 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/dot_comm.c @@ -0,0 +1,41 @@ +//instanalize an instance of 'tap' for the Dot - Comma tap dance. +static tap dot_comm_state = { + .is_press_action = true, + .state = 0 +}; + +void dot_comm_finished(qk_tap_dance_state_t *state, void *user_data) { + dot_comm_state.state = current_dance(state); + switch (dot_comm_state.state) { + case SINGLE_TAP: + register_code(KC_DOT); + break; + + case SINGLE_HOLD: + register_code(KC_LCTL); + register_code(KC_LSFT); + break; + + case DOUBLE_TAP: + register_code(KC_COMM); + break; + } +} + +void dot_comm_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (dot_comm_state.state) { + case SINGLE_TAP: + unregister_code(KC_DOT); + break; + + case SINGLE_HOLD: + unregister_code(KC_LCTL); + unregister_code(KC_LSFT); + break; + + case DOUBLE_TAP: + unregister_code(KC_COMM); + break; + } + dot_comm_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/h_mouse_gui.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/h_mouse_gui.c new file mode 100644 index 00000000000..76dda6eb320 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/h_mouse_gui.c @@ -0,0 +1,39 @@ +//instanalize an instance of 'tap' for the H - Mouse - Gui tap dance. +static tap h_mouse_gui_state = { + .is_press_action = true, + .state = 0 +}; + +void h_mouse_gui_finished(qk_tap_dance_state_t *state, void *user_data) { + h_mouse_gui_state.state = current_dance(state); + switch (h_mouse_gui_state.state) { + case SINGLE_TAP: + register_code(KC_H); + break; + + case SINGLE_HOLD: + layer_on(MOUSE); + break; + + case DOUBLE_HOLD: + register_code(KC_LGUI); + break; + } +} + +void h_mouse_gui_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (h_mouse_gui_state.state) { + case SINGLE_TAP: + unregister_code(KC_H); + break; + + case SINGLE_HOLD: + layer_off(MOUSE); + break; + + case DOUBLE_HOLD: + unregister_code(KC_LGUI); + break; + } + h_mouse_gui_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/j_media_meh.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/j_media_meh.c new file mode 100644 index 00000000000..daf7be1f6f1 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/j_media_meh.c @@ -0,0 +1,43 @@ +//instanalize an instance of 'tap' for the J - Media - Meh tap dance. +static tap j_media_meh_state = { + .is_press_action = true, + .state = 0 +}; + +void j_media_meh_finished(qk_tap_dance_state_t *state, void *user_data) { + j_media_meh_state.state = current_dance(state); + switch (j_media_meh_state.state) { + case SINGLE_TAP: + register_code(KC_J); + break; + + case SINGLE_HOLD: + layer_on(MEDIA_FN); + break; + + case DOUBLE_HOLD: + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_LALT); + break; + } +} + +void j_media_meh_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (j_media_meh_state.state) { + case SINGLE_TAP: + unregister_code(KC_J); + break; + + case SINGLE_HOLD: + layer_off(MEDIA_FN); + break; + + case DOUBLE_HOLD: + unregister_code(KC_LCTL); + unregister_code(KC_LSFT); + unregister_code(KC_LALT); + break; + } + j_media_meh_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/k_numpad_hyper.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/k_numpad_hyper.c new file mode 100644 index 00000000000..609e9f55392 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/k_numpad_hyper.c @@ -0,0 +1,45 @@ +//instanalize an instance of 'tap' for the K - Numpad - Hyper tap dance. +static tap k_numpad_hyper_state = { + .is_press_action = true, + .state = 0 +}; + +void k_numpad_hyper_finished(qk_tap_dance_state_t *state, void *user_data) { + k_numpad_hyper_state.state = current_dance(state); + switch (k_numpad_hyper_state.state) { + case SINGLE_TAP: + register_code(KC_K); + break; + + case SINGLE_HOLD: + layer_on(NUMPAD); + break; + + case DOUBLE_HOLD: + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_LALT); + register_code(KC_LGUI); + break; + } +} + +void k_numpad_hyper_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (k_numpad_hyper_state.state) { + case SINGLE_TAP: + unregister_code(KC_K); + break; + + case SINGLE_HOLD: + layer_off(NUMPAD); + break; + + case DOUBLE_HOLD: + unregister_code(KC_LCTL); + unregister_code(KC_LSFT); + unregister_code(KC_LALT); + unregister_code(KC_LGUI); + break; + } + k_numpad_hyper_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/m_chords_hyper.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/m_chords_hyper.c new file mode 100644 index 00000000000..e7df3aef14c --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/m_chords_hyper.c @@ -0,0 +1,45 @@ +//instanalize an instance of 'tap' for the M - Chords - Hyper tap dance. +static tap m_chords_hyper_state = { + .is_press_action = true, + .state = 0 +}; + +void m_chords_hyper_finished(qk_tap_dance_state_t *state, void *user_data) { + m_chords_hyper_state.state = current_dance(state); + switch (m_chords_hyper_state.state) { + case SINGLE_TAP: + register_code(KC_M); + break; + + case SINGLE_HOLD: + layer_on(CHORD); + break; + + case DOUBLE_HOLD: + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_LALT); + register_code(KC_LGUI); + break; + } +} + +void m_chords_hyper_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (m_chords_hyper_state.state) { + case SINGLE_TAP: + unregister_code(KC_M); + break; + + case SINGLE_HOLD: + layer_off(CHORD); + break; + + case DOUBLE_HOLD: + unregister_code(KC_LCTL); + unregister_code(KC_LSFT); + unregister_code(KC_LALT); + unregister_code(KC_LGUI); + break; + } + m_chords_hyper_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/none_lead.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/none_lead.c new file mode 100644 index 00000000000..0ba31cec81f --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/none_lead.c @@ -0,0 +1,40 @@ +//instanalize an instance of 'tap' for the None - Lead tap dance. +static tap none_lead_state = { + .is_press_action = true, + .state = 0 +}; + +void none_lead_finished(qk_tap_dance_state_t *state, void *user_data) { + none_lead_state.state = current_dance(state); + switch (none_lead_state.state) { + case SINGLE_TAP: + register_code(KC_NO); + break; + + case SINGLE_HOLD: + register_code(KC_LALT); + register_code(KC_LSFT); + break; + + case DOUBLE_TAP: + qk_leader_start(); + break; + } +} + +void none_lead_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (none_lead_state.state) { + case SINGLE_TAP: + unregister_code(KC_NO); + break; + + case SINGLE_HOLD: + unregister_code(KC_LALT); + unregister_code(KC_LSFT); + break; + + case DOUBLE_TAP: + break; + } + none_lead_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/quot_dquot.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/quot_dquot.c new file mode 100644 index 00000000000..ac6da9e00e6 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/quot_dquot.c @@ -0,0 +1,41 @@ +//instanalize an instance of 'tap' for the Quote - Double Quote tap dance. +static tap quot_dquot_state = { + .is_press_action = true, + .state = 0 +}; + +void quot_dquot_finished(qk_tap_dance_state_t *state, void *user_data) { + quot_dquot_state.state = current_dance(state); + switch (quot_dquot_state.state) { + case SINGLE_TAP: + register_code(KC_QUOT); + break; + + case SINGLE_HOLD: + register_code(KC_LCTL); + register_code(KC_LALT); + break; + + case DOUBLE_TAP: + register_code16(KC_DQUO); + break; + } +} + +void quot_dquot_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (quot_dquot_state.state) { + case SINGLE_TAP: + unregister_code(KC_QUOT); + break; + + case SINGLE_HOLD: + unregister_code(KC_LCTL); + unregister_code(KC_LALT); + break; + + case DOUBLE_TAP: + unregister_code16(KC_DQUO); + break; + } + quot_dquot_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/scln_coln.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/scln_coln.c new file mode 100644 index 00000000000..513c9326630 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/scln_coln.c @@ -0,0 +1,43 @@ +//instanalize an instance of 'tap' for the Semicolon - Colon tap dance. +static tap scln_coln_state = { + .is_press_action = true, + .state = 0 +}; + +void scln_coln_finished(qk_tap_dance_state_t *state, void *user_data) { + scln_coln_state.state = current_dance(state); + switch (scln_coln_state.state) { + case SINGLE_TAP: + register_code(KC_SCLN); + break; + + case SINGLE_HOLD: + register_code(KC_LALT); + register_code(KC_LSFT); + register_code(KC_LGUI); + break; + + case DOUBLE_TAP: + register_code16(KC_COLN); + break; + } +} + +void scln_coln_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (scln_coln_state.state) { + case SINGLE_TAP: + unregister_code(KC_SCLN); + break; + + case SINGLE_HOLD: + unregister_code(KC_LALT); + unregister_code(KC_LSFT); + unregister_code(KC_LGUI); + break; + + case DOUBLE_TAP: + unregister_code16(KC_COLN); + break; + } + scln_coln_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/u_arrows_gui.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/u_arrows_gui.c new file mode 100644 index 00000000000..e57502a7906 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/u_arrows_gui.c @@ -0,0 +1,39 @@ +//instanalize an instance of 'tap' for the U - Arrows - Gui tap dance. +static tap u_arrows_gui_state = { + .is_press_action = true, + .state = 0 +}; + +void u_arrows_gui_finished(qk_tap_dance_state_t *state, void *user_data) { + u_arrows_gui_state.state = current_dance(state); + switch (u_arrows_gui_state.state) { + case SINGLE_TAP: + register_code(KC_U); + break; + + case SINGLE_HOLD: + layer_on(ARROWS); + break; + + case DOUBLE_HOLD: + register_code(KC_LGUI); + break; + } +} + +void u_arrows_gui_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (u_arrows_gui_state.state) { + case SINGLE_TAP: + unregister_code(KC_U); + break; + + case SINGLE_HOLD: + layer_off(ARROWS); + break; + + case DOUBLE_HOLD: + unregister_code(KC_LGUI); + break; + } + u_arrows_gui_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/w_media_meh.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/w_media_meh.c new file mode 100644 index 00000000000..c26980526c7 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/w_media_meh.c @@ -0,0 +1,43 @@ +//instanalize an instance of 'tap' for the W - Media - Meh tap dance. +static tap w_media_meh_state = { + .is_press_action = true, + .state = 0 +}; + +void w_media_meh_finished(qk_tap_dance_state_t *state, void *user_data) { + w_media_meh_state.state = current_dance(state); + switch (w_media_meh_state.state) { + case SINGLE_TAP: + register_code(KC_W); + break; + + case SINGLE_HOLD: + layer_on(MEDIA_FN); + break; + + case DOUBLE_HOLD: + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_LALT); + break; + } +} + +void w_media_meh_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (w_media_meh_state.state) { + case SINGLE_TAP: + unregister_code(KC_W); + break; + + case SINGLE_HOLD: + layer_off(MEDIA_FN); + break; + + case DOUBLE_HOLD: + unregister_code(KC_LCTL); + unregister_code(KC_LSFT); + unregister_code(KC_LALT); + break; + } + w_media_meh_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_actions.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_actions.c new file mode 100644 index 00000000000..59e3e2b0dcd --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_actions.c @@ -0,0 +1,26 @@ +// Register the double tap dances: +qk_tap_dance_action_t tap_dance_actions[] = { + [EQL_PLUS] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), + [MINS_UNDS] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), + [SLSH_BSLS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS), + [GRV_TILD] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), + [ASTR_CIRC] = ACTION_TAP_DANCE_DOUBLE(KC_ASTR, KC_CIRC), + [APMR_PIPE] = ACTION_TAP_DANCE_DOUBLE(KC_AMPR, KC_PIPE), + [EXLM_QUES] = ACTION_TAP_DANCE_DOUBLE(KC_EXLM, KC_QUES), + [HASH_PERC] = ACTION_TAP_DANCE_DOUBLE(KC_HASH, KC_PERC), + [AT_DLR] = ACTION_TAP_DANCE_DOUBLE(KC_AT, KC_DLR), + [LPRN_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_LBRC), + [RPRN_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_RPRN, KC_RBRC), + [LCBR_LABK] = ACTION_TAP_DANCE_DOUBLE(KC_LCBR, KC_LABK), + [RCBR_RABK] = ACTION_TAP_DANCE_DOUBLE(KC_RCBR, KC_RABK), + [SCLN_COLN] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, scln_coln_finished, scln_coln_reset, DANCING_TERM), + [QUOT_DQUO] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, quot_dquot_finished, quot_dquot_reset, DANCING_TERM), + [DOT_COMM] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, dot_comm_finished, dot_comm_reset, DANCING_TERM), + [NONE_LEAD] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, none_lead_finished, none_lead_reset, DANCING_TERM), + [U_ARR_GUI] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, u_arrows_gui_finished, u_arrows_gui_reset, DANCING_TERM), + [H_MOU_GUI] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, h_mouse_gui_finished, h_mouse_gui_reset, DANCING_TERM), + [J_MED_MEH] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, j_media_meh_finished, j_media_meh_reset, DANCING_TERM), + [W_MED_MEH] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, w_media_meh_finished, w_media_meh_reset, DANCING_TERM), + [K_NUM_HYP] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, k_numpad_hyper_finished, k_numpad_hyper_reset, DANCING_TERM), + [M_CHO_HYP] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, m_chords_hyper_finished, m_chords_hyper_reset, DANCING_TERM), +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_setup.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_setup.c new file mode 100644 index 00000000000..340ccca133f --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_setup.c @@ -0,0 +1,75 @@ +typedef struct { + bool is_press_action; + int state; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, // Send two single taps. + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7, + TRIPLE_SINGLE_TAP = 8 // Send three single taps. +}; + +/* Return an integer that corresponds to what kind of tap dance should be executed. + * + * How to figure out tap dance state: interrupted and pressed. + * + * Interrupted: If the state of a dance dance is "interrupted", that means that another key has been hit + * under the tapping term. This is typically indicitive that you are trying to "tap" the key. + * + * Pressed: Whether or not the key is still being pressed. If this value is true, that means the tapping term + * has ended, but the key is still being pressed down. This generally means the key is being "held". + * + * One thing that is currenlty not possible with qmk software in regards to tap dance is to mimic the "permissive hold" + * feature. In general, advanced tap dances do not work well if they are used with commonly typed letters. + * For example "A". Tap dances are best used on non-letter keys that are not hit while typing letters. + * + * Good places to put an advanced tap dance: + * z,q,x,j,k,v,b, any function key, home/end, comma, semi-colon + * + * Criteria for "good placement" of a tap dance key: + * Not a key that is hit frequently in a sentence + * Not a key that is used frequently to double tap, for example 'tab' is often double tapped in a terminal, or + * in a web form. So 'tab' would be a poor choice for a tap dance. + * Letters used in common words as a double. For example 'p' in 'pepper'. If a tap dance function existed on the + * letter 'p', the word 'pepper' would be quite frustating to type. + * + * For the third point, there does exist the 'DOUBLE_SINGLE_TAP', however this is not fully tested + * + */ +int current_dance(qk_tap_dance_state_t *state) { + int current_state = 0; + if (state->count == 1) { + if (state->interrupted || !state->pressed) { + current_state = SINGLE_TAP; + } else { + current_state = SINGLE_HOLD; //key has not been interrupted, but they key is still held. Means you want to send a 'HOLD'. + } + } else if (state->count == 2) { + /* + * DOUBLE_SINGLE_TAP is to distinguish between typing "pepper", and actually wanting a double tap + * action when hitting 'pp'. Suggested use case for this return value is when you want to send two + * keystrokes of the key, and not the 'double tap' action/macro. + */ + if (state->interrupted) { + current_state = DOUBLE_SINGLE_TAP; + } else if (state->pressed) { + current_state = DOUBLE_HOLD; + } else { + current_state = DOUBLE_TAP; + } + } else if (state->count == 3) { + if (state->interrupted) { + current_state = TRIPLE_SINGLE_TAP; + } else if (state->pressed) { + current_state = TRIPLE_HOLD; + } else { + current_state = TRIPLE_TAP; + } + } + return current_state; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dances.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dances.c new file mode 100644 index 00000000000..d05a71d7e59 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dances.c @@ -0,0 +1,98 @@ + //--------------------------------------------------------------------------------------------// + // | | | | | // + // Single tap | Single hold | Double tap | Double hold | Triple tap | Triple hold // +// Mod tap dances: // | | | | | // +enum tap_dances { //--------------------------------------------------------------------------------------------// + // | | | | | // + EQL_PLUS = 0, // = | | + | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + MINS_UNDS = 1, // - | | _ | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + SLSH_BSLS = 2, // / | | \ | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + GRV_TILD = 3, // ` | | ~ | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + QUOT_DQUO = 4, // ' | CTRL+ALT | " | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + SCLN_COLN = 5, // ; |ALT+SHIFT+META | : | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + ASTR_CIRC = 6, // * | | ^ | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + APMR_PIPE = 7, // & | | | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + EXLM_QUES = 8, // ! | | ? | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + HASH_PERC = 9, // # | | % | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + AT_DLR = 10, // @ | | $ | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + LPRN_LBRC = 11, // ( | | [ | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + RPRN_RBRC = 12, // ) | | ] | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + LCBR_LABK = 13, // { | | < | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + RCBR_RABK = 14, // } | | > | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + DOT_COMM = 15, // . | CTRL+SHIFT | , | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + NONE_LEAD = 16, // NONE | ALT+SHIFT | LEAD | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + U_ARR_GUI = 17, // U | ARROWS | | GUI | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + H_MOU_GUI = 18, // H | MOUSE | | GUI | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + J_MED_MEH = 19, // J | MEDIA_FN | | MEH | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + W_MED_MEH = 20, // W | MEDIA_FN | | MEH | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + K_NUM_HYP = 21, // K | NUMPAD | | HYPER | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + M_CHO_HYP = 22, // M | CHORD | | HYPER | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/eeconfig_init_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/eeconfig_init_user.c new file mode 100644 index 00000000000..41b7b669413 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/eeconfig_init_user.c @@ -0,0 +1,3 @@ +// void eeconfig_init_user(void) { +// +// }; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/layer_set_state_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/layer_set_state_user.c new file mode 100644 index 00000000000..c0b3b9c9951 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/layer_set_state_user.c @@ -0,0 +1,121 @@ + +uint32_t layer_state_set_user(uint32_t state) { + uint8_t layer = biton32(state); + + switch (layer) { + case DVORAK: + rgblight_sethsv_noeeprom_green(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case PLOVER: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + + if (!(PLOVER_MODE)) { + plover_toggle(); + PLOVER_MODE = true; + } + + break; + + case GAMING: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case ARROWS: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case MOUSE: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case NUMPAD: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case LAYERS: + rgblight_sethsv_noeeprom_cyan(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case MEDIA_FN: + rgblight_sethsv_noeeprom_yellow(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case CHORD: + rgblight_sethsv_noeeprom_magenta(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case FIRMWARE: + rgblight_sethsv_noeeprom_magenta(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + default: + break; + } + + return state; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c new file mode 100644 index 00000000000..3b78079ccaf --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c @@ -0,0 +1,12 @@ +#include "../leader/leader_setup.c" + +bool MATRIX_SCANNED = false; + +void matrix_scan_user(void) { + if (!(MATRIX_SCANNED)) { + rgblight_sethsv_noeeprom_green(); + MATRIX_SCANNED = true; + } + + #include "../leader/leader_dictionary.c" +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/process_record_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/process_record_user.c new file mode 100644 index 00000000000..76446358241 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/process_record_user.c @@ -0,0 +1,75 @@ +// TODO: Improve this currently there is no feedback if activated by other means. +bool CAPS_LOCK = false; +bool NUM_LOCK = false; +bool SCROLL_LOCK = false; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + switch (keycode) { + case KC_CLCK: + if (record->event.pressed) { + if (!(CAPS_LOCK)) { + ergodox_right_led_1_on(); + CAPS_LOCK = true; + } else { + ergodox_right_led_1_off(); + CAPS_LOCK = false; + } + } + + return true; + + case KC_NLCK: + if (record->event.pressed) { + if (!(NUM_LOCK)) { + ergodox_right_led_2_on(); + NUM_LOCK = true; + } else { + ergodox_right_led_2_off(); + NUM_LOCK = false; + } + } + + return true; + + case KC_SLCK: + if (record->event.pressed) { + if (!(SCROLL_LOCK)) { + ergodox_right_led_3_on(); + SCROLL_LOCK = true; + } else { + ergodox_right_led_3_off(); + SCROLL_LOCK = false; + } + } + + return true; + + case KC_MS_WH_UP ... KC_MS_WH_RIGHT: + if (record->event.pressed) { + if (SCROLL_LOCK) { + return false; + } else { + return true; + } + } + + case MY_CUSTOM_MACRO: + if (record->event.pressed) { + SEND_STRING("QMK is the best thing ever!"); // this is our macro! + return false; + } + + case MY_OTHER_MACRO: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("ac")); // selects all and copies + return false; + } + + default: + return true; + } +} diff --git a/keyboards/ergodox_ez/keymaps/heartrobotninja/rules.mk b/keyboards/ergodox_ez/keymaps/heartrobotninja/rules.mk index db5e5d15587..6f40259b61c 100644 --- a/keyboards/ergodox_ez/keymaps/heartrobotninja/rules.mk +++ b/keyboards/ergodox_ez/keymaps/heartrobotninja/rules.mk @@ -30,6 +30,3 @@ KEYMAP_BRANCH = $(shell \ OPT_DEFS += -DKEYMAP_VERSION=\"$(KEYMAP_VERSION)\\\#$(KEYMAP_BRANCH)\" -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergodox_ez/keymaps/kou/keymap.c b/keyboards/ergodox_ez/keymaps/kou/keymap.c index 6116548050d..98fafe8ce62 100644 --- a/keyboards/ergodox_ez/keymaps/kou/keymap.c +++ b/keyboards/ergodox_ez/keymaps/kou/keymap.c @@ -248,11 +248,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/ergodox_ez/keymaps/matrixman/keymap.c b/keyboards/ergodox_ez/keymaps/matrixman/keymap.c index d40f6475bc8..f5d0a0cf799 100644 --- a/keyboards/ergodox_ez/keymaps/matrixman/keymap.c +++ b/keyboards/ergodox_ez/keymaps/matrixman/keymap.c @@ -162,11 +162,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { -// [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Tap/Toggle Layer 1 (Symbols) -// [2] = ACTION_LAYER_TAP_TOGGLE(NAV) // FN2 - Tap/Toggle Layer 2 (Nav) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/ergodox_ez/keymaps/profet_80/keymap.c b/keyboards/ergodox_ez/keymaps/profet_80/keymap.c index 984c90b1eac..29505b641e5 100644 --- a/keyboards/ergodox_ez/keymaps/profet_80/keymap.c +++ b/keyboards/ergodox_ez/keymaps/profet_80/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP,KC_3, KC_4, KC_PGDN,KC_TAB, KC_ENT @@ -136,10 +136,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/ergodox_ez/keymaps/pvinis/keymap.c b/keyboards/ergodox_ez/keymaps/pvinis/keymap.c new file mode 100644 index 00000000000..dc804d632c5 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/pvinis/keymap.c @@ -0,0 +1,330 @@ +// pvinis ergodox ez +// ,------------------------------------. ,------------------------------------. +// | | | | | | | | | | | | | | | | +// |------+----+----+----+----+---------| |----+----+----+----+----+----+------| +// | | | | | | | | | | | | | | | | +// |------+----+----+----x----x----| | | |----x----x----+----+----+------| +// | | | | | | |----| |----| | | | | | | +// |------+----+----+----x----x----| | | |----x----x----+----+----+------| +// | | | | | | | | | | | | | | | | +// `------+----+----+----+----+---------' `---------+----+----+----+----+------' +// | | | | | | | | | | | | +// `------------------------' `------------------------' +// ,---------. ,---------. +// | | | | | | +// ,----+----+----| |----+----+----. +// | | | | | | | | +// | | |----| |----| | | +// | | | | | | | | +// `--------------' `--------------' + + +#include QMK_KEYBOARD_H +#include "pvinis.h" +#include "mousekey.h" + + +// layers +enum { + MOUSE = 8, +}; + +// extra keys +enum { + NONE = 30, + TD_LAYR, // SYSCTL and MOUSE layer switch +}; + +// application selection +// this is sending ctrl-alt-gui-, and this is picked up by hammerspoon +#define AP_SLCK ALLM(KC_S) +#define AP_XCOD ALLM(KC_X) +#define AP_MSGR ALLM(KC_M) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // ,------------------------------------. ,------------------------------------. + // |4xFLSH| | | | | |Opt | | | | | | | | | + // |------+----+----+----+----+---------| |----+----+----+----+----+----+------| + // | Tab | | | | | | | | | | | | | | | + // |------+----+----+----x----x----| | | |----x----x----+----+----+------| + // |EscCtl| | | | | |----| |----| | | | | | Ent | + // |------+----+----+----x----x----| | | |----x----x----+----+----+------| + // |LShift| | | | | | | | | | | | | |RShift| + // `------+----+----+----+----+---------' `---------+----+----+----+----+------' + // | | | | |Cmd | | | | | | | + // `------------------------' `------------------------' + // ,---------. ,---------. + // |QWER| | | | | + // ,----+----+----| |----+----+----. + // | Ba | L | | | | | | + // | ck |Shi |----| |----| |Spc | + // | spc| ft | | | | | | + // `--------------' `--------------' + [LR_BASE] = LAYOUT_ergodox_pretty_wrapper( + TD_3FLS, _______, _______, _______, _______, _______, KC_LALT, _______, _______, _______, _______, _______, _______, _______, + KC_TAB , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + PV_ESCC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT , + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, + _______, _______, _______, KC_LGUI, SYMBOL , SYSCTL , KC_RALT, _______, _______, _______, + QWERTY , CARPALX, _______, _______, + _______, _______, + KC_BSPC, _______, _______, _______, _______, KC_SPC + ), + + // ,------------------------------------. ,------------------------------------. + // | | NUMBERS_L | | | - | NUMBERS_R | = | + // |------+----+----+----+----+---------| |----+----+----+----+----+----+------| + // | | | [ | | ] | | | + // |------+ | | | | +------| + // | | QWERTY_L |----| |----| QWERTY_R | | + // |------+ | ( | | ) | +------| + // | | | | | | | | + // `------+----+----+----+----+---------' `---------+----+----+----+----+------' + // | | ` | | | | | | | | ' | | + // `------------------------' `------------------------' + // ,---------. ,---------. + // | | | | | | + // ,----+----+----| |----+----+----. + // | | | | | | | | + // | | |----| |----| | | + // | | | | | | | | + // `--------------' `--------------' + // See `users/pvinis/pvinis.h` + [LR_QWERTY] = LAYOUT_ergodox_pretty_wrapper( + _______, ________________NUMBERS_L__________________, _______, KC_MINS, ________________NUMBERS_R__________________, KC_EQL , + _______, _________________QWERTY_L1_________________, KC_LBRC, KC_RBRC, _________________QWERTY_R1_________________, _______, + _______, _____________MOD_QWERTY_L2_________________, _____________MOD_QWERTY_R2_________________, _______, + _______, _________________QWERTY_L3_________________, KC_LPRN, KC_RPRN, _________________QWERTY_R3_________________, _______, + _______, KC_GRV, _______, _______, _______, _______, _______, _______, KC_QUOT , _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ + ), + + // ,------------------------------------. ,------------------------------------. + // | | NUMBERS_L | | | | NUMBERS_R | | + // |------+----+----+----+----+---------| |----+----+----+----+----+----+------| + // | | | | | | | | + // |------+ | | | | +------| + // | | CARPALX_L |----| |----| CARPALX_R | | + // |------+ | | | | +------| + // | | | | | | | | + // `------+----+----+----+----+---------' `---------+----+----+----+----+------' + // | | | | | | | | | | | | + // `------------------------' `------------------------' + // ,---------. ,---------. + // | | | | | | + // ,----+----+----| |----+----+----. + // | | | | | | | | + // | | |----| |----| | | + // | | | | | | | | + // `--------------' `--------------' + // See `users/pvinis/pvinis.h` + [LR_CARPALX] = LAYOUT_ergodox_pretty_wrapper( + _______, ________________NUMBERS_L__________________, _______, _______, ________________NUMBERS_R__________________, _______, + _______, ________________CARPALX_L1_________________, _______, _______, ________________CARPALX_R1_________________, _______, + _______, ________________CARPALX_L2_________________, ________________CARPALX_R2_________________, _______, + _______, ________________CARPALX_L3_________________, _______, _______, ________________CARPALX_R3_________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ + ), + + // See `users/pvinis/pvinis.h` + [LR_SYMBOL] = LAYOUT_ergodox_pretty_wrapper( + _______, ______________________F_L__________________, KC_F11 , KC_F12 , ______________________F_R__________________, _______, + _______, _________________SYMBOL_L1_________________, _______, _______, _________________SYMBOL_R1_________________, _______, + _______, _________________SYMBOL_L2_________________, _________________SYMBOL_R2_________________, _______, + _______, _________________SYMBOL_L3_________________, _______, _______, _________________SYMBOL_R3_________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ + ), + + // See `users/pvinis/pvinis.h` + [LR_SYSCTL] = LAYOUT_ergodox_pretty_wrapper( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _________________SYSCTL_R1_________________, _______, + _______, _______, _______, _______, _______, _______, _________________SYSCTL_R2_________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _________________SYSCTL_R3_________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ + ), + + // See `users/pvinis/pvinis.h` + [LR_KBCTL] = LAYOUT_ergodox_pretty_wrapper( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, __________________KBCTL_R1_________________, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, __________________KBCTL_R2_________________, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, __________________KBCTL_R3_________________, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + +/* MOUSE + * a keymap to control my system. + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ^ | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | MsUp | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| |MsLeft| MsDn |MsRght| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | |MidClk| + * ,------|------|------| |------+------+------. + * | | | | | |Left |Right | + * | | |------| |------| Click| Click| + * | | | ^ | | | | | + * `--------------------' `--------------------' + */ + [MOUSE] = LAYOUT_ergodox_pretty( + KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_NO ,KC_TRNS + + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_MS_U ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_NO ,KC_NO + ), +}; + + +// keyboard initialization +void keyboard_post_init_user_local(void) { + ergodox_led_all_on(); + for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { + ergodox_led_all_set(i); + wait_ms(5); + } + wait_ms(1000); + for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { + ergodox_led_all_set(i); + wait_ms(10); + } + ergodox_led_all_off(); + + // restore default brightness for future use + ergodox_led_all_set(LED_BRIGHTNESS_HI); +} + +// light up leds based on the layer +uint32_t layer_state_set_user_local(uint32_t state) { + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (biton32(state)) { + case LR_SYSCTL: + ergodox_right_led_3_on(); // blue + break; + case LR_KBCTL: + ergodox_right_led_1_on(); // red + break; + case LR_SYMBOL: + ergodox_right_led_2_on(); // green + break; + default: break; + } + return state; +} + +// extra keys +// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + // switch (id) { + // } + // return MACRO_NONE; +// } + +// tap dances + +// flash keyboard on 4x tap, with leds +// void flash_each_tap(qk_tap_dance_state_t *state, void *user_data) { +// switch (state->count) { +// case 1: +// ergodox_right_led_3_on(); +// break; +// case 2: +// ergodox_right_led_2_on(); +// break; +// case 3: +// ergodox_right_led_1_on(); +// break; +// case 4: +// ergodox_right_led_3_off(); +// wait_ms(50); +// ergodox_right_led_2_off(); +// wait_ms(50); +// ergodox_right_led_1_off(); +// break; +// } +// } + +// void flash_dance_finished(qk_tap_dance_state_t *state, void *user_data) { +// if (state->count >= 4) { +// reset_keyboard(); +// reset_tap_dance(state); +// } +// } + +// void flash_dance_reset(qk_tap_dance_state_t *state, void *user_data) { +// ergodox_right_led_1_off(); +// wait_ms(50); +// ergodox_right_led_2_off(); +// wait_ms(50); +// ergodox_right_led_3_off(); +// } + +// SYSCTL on first tap, MOUSE ON second tap +// void layers_dance_finished(qk_tap_dance_state_t *state, void *user_data) { +// uint8_t layer = biton32(layer_state); + +// switch(state->count) { +// case 1: +// switch(layer) { +// case LR_SYSCTL: +// layer_off(LR_SYSCTL); +// break; +// case MOUSE: +// layer_off(MOUSE); +// break; +// default: +// layer_on(LR_SYSCTL); +// break; +// } +// break; +// case 2: +// layer_on(MOUSE); +// break; +// } +// } + +// qk_tap_dance_action_t tap_dance_actions[] = { + // [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED( flash_each_tap, flash_dance_finished, flash_dance_reset ), + // [TD_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, layers_dance_finished, NULL ), +// }; diff --git a/layouts/community/ergodox/pvinis/Readme.md b/keyboards/ergodox_ez/keymaps/pvinis/readme.md similarity index 100% rename from layouts/community/ergodox/pvinis/Readme.md rename to keyboards/ergodox_ez/keymaps/pvinis/readme.md diff --git a/keyboards/ergodox_ez/keymaps/pvinis/rules.mk b/keyboards/ergodox_ez/keymaps/pvinis/rules.mk new file mode 100644 index 00000000000..e5ddcae8d92 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/pvinis/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/ergodox_ez/keymaps/skug/keymap.c b/keyboards/ergodox_ez/keymaps/skug/keymap.c index d17990481e5..6f9a577f7e3 100644 --- a/keyboards/ergodox_ez/keymaps/skug/keymap.c +++ b/keyboards/ergodox_ez/keymaps/skug/keymap.c @@ -80,7 +80,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, KC_H, KC_J, KC_K, KC_L, LT(MDIA, NO_OSLH), LT(SYMB, NO_AE), KC_WFWD, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC, - KC_SPC, KC_BSPC, NO_ALGR, NO_ASTR, CTL_T(NO_TILD), + KC_SPC, KC_BSPC, KC_ALGR, NO_ASTR, CTL_T(NO_TILD), KC_HOME, NO_CIRC, KC_PGUP, KC_UP, KC_DOWN, KC_LGUI, ALT_T(KC_ESC), CTL_T(KC_ENT) @@ -192,10 +192,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/ergodox_ez/keymaps/smurmann/keymap.c b/keyboards/ergodox_ez/keymaps/smurmann/keymap.c index eec8ef8753c..9194c041c28 100644 --- a/keyboards/ergodox_ez/keymaps/smurmann/keymap.c +++ b/keyboards/ergodox_ez/keymaps/smurmann/keymap.c @@ -6,8 +6,6 @@ #define BASE 0 // default layer #define MDIA 1 // media keys -#define _______ KC_TRNS - enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here EPRM, @@ -105,10 +103,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(MDIA) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/ergodox_ez/keymaps/steno/keymap.c b/keyboards/ergodox_ez/keymaps/steno/keymap.c index 3cc008e7bc9..45fc9f8ba99 100644 --- a/keyboards/ergodox_ez/keymaps/steno/keymap.c +++ b/keyboards/ergodox_ez/keymaps/steno/keymap.c @@ -1,8 +1,7 @@ #include QMK_KEYBOARD_H #include "debug.h" #include "action_layer.h" -#include "sendchar.h" -#include "virtser.h" +#include "keymap_steno.h" #define BASE 0 // default layer #define SYMB 1 // symbols @@ -49,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(TXBOLT), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -137,35 +136,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_WBAK ), -// TxBolt Codes -#define Sl 0b00000001 -#define Tl 0b00000010 -#define Kl 0b00000100 -#define Pl 0b00001000 -#define Wl 0b00010000 -#define Hl 0b00100000 -#define Rl 0b01000001 -#define Al 0b01000010 -#define Ol 0b01000100 -#define X 0b01001000 -#define Er 0b01010000 -#define Ur 0b01100000 -#define Fr 0b10000001 -#define Rr 0b10000010 -#define Pr 0b10000100 -#define Br 0b10001000 -#define Lr 0b10010000 -#define Gr 0b10100000 -#define Tr 0b11000001 -#define Sr 0b11000010 -#define Dr 0b11000100 -#define Zr 0b11001000 -#define NM 0b11010000 -#define GRPMASK 0b11000000 -#define GRP0 0b00000000 -#define GRP1 0b01000000 -#define GRP2 0b10000000 -#define GRP3 0b11000000 /* Keymap 3: TxBolt (Serial) * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -190,22 +160,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // TxBolt over Serial [TXBOLT] = LAYOUT_ergodox( KC_BSPC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, M(NM), M(NM), M(NM), M(NM), M(NM), KC_NO, - KC_NO, M(Sl), M(Tl), M(Pl), M(Hl), M(X), - KC_NO, M(Sl), M(Kl), M(Wl), M(Rl), M(X), KC_NO, + KC_NO, STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, KC_NO, + KC_NO, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, + KC_NO, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - M(Al), M(Ol), KC_NO, + STN_A, STN_O, KC_NO, // right hand KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, M(NM), M(NM), M(NM), M(NM), M(NM), M(NM), - M(X), M(Fr), M(Pr), M(Lr), M(Tr), M(Dr), - KC_NO, M(X), M(Rr), M(Br), M(Gr), M(Sr), M(Zr), + KC_TRNS, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, + STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + KC_NO, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, M(Er), M(Ur) + KC_NO, STN_E, STN_U ), /* Keymap 4: TxBolt (Serial) Alternative * @@ -230,73 +200,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // TxBolt over Serial [TXBOLT2] = LAYOUT_ergodox( - KC_NO, M(NM), M(NM), M(NM), M(NM), M(NM), KC_NO, - KC_NO, M(Sl), M(Tl), M(Pl), M(Hl), M(X), KC_NO, - KC_NO, M(Sl), M(Kl), M(Wl), M(Rl), M(X), + KC_NO, STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, KC_NO, + KC_NO, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, KC_NO, + KC_NO, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, M(Al), M(Ol), + KC_NO, KC_NO, KC_NO, STN_A, STN_O, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, // right hand - KC_NO, M(NM), M(NM), M(NM), M(NM), M(NM), M(NM), - KC_TRNS, M(X), M(Fr), M(Pr), M(Lr), M(Tr), M(Dr), - M(X), M(Rr), M(Br), M(Gr), M(Sr), M(Zr), + KC_NO, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, + KC_TRNS, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - M(Er), M(Ur), KC_NO, KC_NO, KC_NO, + STN_E, STN_U, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -uint8_t chord[4] = {0,0,0,0}; -uint8_t pressed_count = 0; - -void send_chord(void) -{ - for(uint8_t i = 0; i < 4; i++) - { - if(chord[i]) - virtser_send(chord[i]); - } - virtser_send(0); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - // We need to track keypresses in all modes, in case the user - // changes mode whilst pressing other keys. - if (record->event.pressed) - pressed_count++; - else - pressed_count--; - return true; -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - - if (record->event.pressed) { - uint8_t grp = (id & GRPMASK) >> 6; - chord[grp] |= id; - } - else { - if (pressed_count == 0) { - send_chord(); - chord[0] = chord[1] = chord[2] = chord[3] = 0; - } - } - return MACRO_NONE; -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { + steno_set_mode(STENO_MODE_BOLT); // or STENO_MODE_GEMINI }; // Runs constantly in the background, in a loop. diff --git a/keyboards/ergodox_ez/keymaps/steno/rules.mk b/keyboards/ergodox_ez/keymaps/steno/rules.mk index b6fb9b1a800..4b64fd22de6 100644 --- a/keyboards/ergodox_ez/keymaps/steno/rules.mk +++ b/keyboards/ergodox_ez/keymaps/steno/rules.mk @@ -1,3 +1,3 @@ -VIRTSER_ENABLE = yes +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER # Not enough interupts, so something has to go MOUSEKEY_ENABLE = no diff --git a/keyboards/ergodox_ez/keymaps/testing/keymap.c b/keyboards/ergodox_ez/keymaps/testing/keymap.c index df0ed073f20..a90458cefe4 100644 --- a/keyboards/ergodox_ez/keymaps/testing/keymap.c +++ b/keyboards/ergodox_ez/keymaps/testing/keymap.c @@ -28,23 +28,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(1) -}; - -// leaving this in place for compatibilty with old keymaps cloned and re-compiled. -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - } - return MACRO_NONE; -}; - void matrix_init_user(void) { #ifdef RGBLIGHT_COLOR_LAYER_0 rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); diff --git a/keyboards/ergodox_ez/keymaps/vim/keymap.c b/keyboards/ergodox_ez/keymaps/vim/keymap.c index 5ebe0c8475b..2823a7b4eaf 100644 --- a/keyboards/ergodox_ez/keymaps/vim/keymap.c +++ b/keyboards/ergodox_ez/keymaps/vim/keymap.c @@ -5,7 +5,6 @@ #include "vim.h" #define VERSION_STRING QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION -#define _______ KC_TRNS #define X_____X KC_TRNS #define KC_ATM LGUI(LSFT(KC_P)) #define KC_ATP LGUI(LCTL(KC_P)) @@ -154,10 +153,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(1) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { case 0: diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 2e95c83b65c..2bfe27b9a30 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -1,9 +1,5 @@ /* -Note for ErgoDox EZ customizers: Here be dragons! -This is not a file you want to be messing with. -All of the interesting stuff for you is under keymaps/ :) -Love, Erez Copyright 2013 Oleg Kostyuk @@ -33,14 +29,14 @@ along with this program. If not, see . #include "debug.h" #include "util.h" #include "matrix.h" +#include "debounce.h" #include QMK_KEYBOARD_H #ifdef DEBUG_MATRIX_SCAN_RATE -#include "timer.h" +# include "timer.h" #endif /* - * This constant define not debouncing time in msecs, but amount of matrix - * scan loops which should be made to get stable debounced results. + * This constant define not debouncing time in msecs, assuming eager_pr. * * On Ergodox matrix scan rate is relatively low, because of slow I2C. * Now it's only 317 scans/second, or about 3.15 msec/scan. @@ -52,21 +48,17 @@ along with this program. If not, see . */ #ifndef DEBOUNCE -# define DEBOUNCE 5 +# define DEBOUNCE 5 #endif /* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -// Debouncing: store for each key the number of scans until it's eligible to -// change. When scanning the matrix, ignore any changes in keys that have -// already changed in the last DEBOUNCE scans. -static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; +static matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values +static matrix_row_t matrix[MATRIX_ROWS]; // debounced values static matrix_row_t read_cols(uint8_t row); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); static uint8_t mcp23018_reset_loop; // static uint16_t mcp23018_reset_loop; @@ -76,195 +68,150 @@ uint32_t matrix_timer; uint32_t matrix_scan_count; #endif +__attribute__((weak)) void matrix_init_user(void) {} -__attribute__ ((weak)) -void matrix_init_user(void) {} +__attribute__((weak)) void matrix_scan_user(void) {} -__attribute__ ((weak)) -void matrix_scan_user(void) {} +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } -void matrix_init(void) -{ - // initialize row and col +void matrix_init(void) { + // initialize row and col - mcp23018_status = init_mcp23018(); + mcp23018_status = init_mcp23018(); + unselect_rows(); + init_cols(); - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - for (uint8_t j=0; j < MATRIX_COLS; ++j) { - debounce_matrix[i * MATRIX_COLS + j] = 0; - } - } + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + raw_matrix[i] = 0; + } #ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; + matrix_timer = timer_read32(); + matrix_scan_count = 0; #endif - - matrix_init_quantum(); - + debounce_init(MATRIX_ROWS); + matrix_init_quantum(); } void matrix_power_up(void) { - mcp23018_status = init_mcp23018(); + mcp23018_status = init_mcp23018(); - unselect_rows(); - init_cols(); + unselect_rows(); + init_cols(); - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - } + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } #ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; + matrix_timer = timer_read32(); + matrix_scan_count = 0; #endif } -// Returns a matrix_row_t whose bits are set if the corresponding key should be -// eligible to change in this scan. -matrix_row_t debounce_mask(uint8_t row) { - matrix_row_t result = 0; - for (uint8_t j=0; j < MATRIX_COLS; ++j) { - if (debounce_matrix[row * MATRIX_COLS + j]) { - --debounce_matrix[row * MATRIX_COLS + j]; - } else { - result |= (1 << j); - } +// Reads and stores a row, returning +// whether a change occurred. +static inline bool store_raw_matrix_row(uint8_t index) { + matrix_row_t temp = read_cols(index); + if (raw_matrix[index] != temp) { + raw_matrix[index] = temp; + return true; } - return result; + return false; } -// Report changed keys in the given row. Resets the debounce countdowns -// corresponding to each set bit in 'change' to DEBOUNCE. -void debounce_report(matrix_row_t change, uint8_t row) { - for (uint8_t i = 0; i < MATRIX_COLS; ++i) { - if (change & (1 << i)) { - debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; +uint8_t matrix_scan(void) { + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // if (++mcp23018_reset_loop >= 1300) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + ergodox_blink_all_leds(); + } } } -} - -uint8_t matrix_scan(void) -{ - if (mcp23018_status) { // if there was an error - if (++mcp23018_reset_loop == 0) { - // if (++mcp23018_reset_loop >= 1300) { - // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans - // this will be approx bit more frequent than once per second - print("trying to reset mcp23018\n"); - mcp23018_status = init_mcp23018(); - if (mcp23018_status) { - print("left side not responding\n"); - } else { - print("left side attached\n"); - ergodox_blink_all_leds(); - } - } - } #ifdef DEBUG_MATRIX_SCAN_RATE - matrix_scan_count++; + matrix_scan_count++; - uint32_t timer_now = timer_read32(); - if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { - print("matrix scan frequency: "); - pdec(matrix_scan_count); - print("\n"); + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer) > 1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); - matrix_timer = timer_now; - matrix_scan_count = 0; - } + matrix_timer = timer_now; + matrix_scan_count = 0; + } #endif #ifdef LEFT_LEDS - mcp23018_status = ergodox_left_leds_update(); -#endif // LEFT_LEDS - for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { - select_row(i); - // and select on left hand - select_row(i + MATRIX_ROWS_PER_SIDE); - // we don't need a 30us delay anymore, because selecting a - // left-hand row requires more than 30us for i2c. - matrix_row_t mask = debounce_mask(i); - matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask); - debounce_report(cols ^ matrix[i], i); - matrix[i] = cols; - // grab cols from right hand - mask = debounce_mask(i + MATRIX_ROWS_PER_SIDE); - cols = (read_cols(i + MATRIX_ROWS_PER_SIDE) & mask) | (matrix[i + MATRIX_ROWS_PER_SIDE] & ~mask); - debounce_report(cols ^ matrix[i + MATRIX_ROWS_PER_SIDE], i + MATRIX_ROWS_PER_SIDE); - matrix[i + MATRIX_ROWS_PER_SIDE] = cols; - unselect_rows(); - } + mcp23018_status = ergodox_left_leds_update(); +#endif // LEFT_LEDS + bool changed = false; + for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { + // select rows from left and right hands + uint8_t left_index = i; + uint8_t right_index = i + MATRIX_ROWS_PER_SIDE; + select_row(left_index); + select_row(right_index); + + // we don't need a 30us delay anymore, because selecting a + // left-hand row requires more than 30us for i2c. + + changed |= store_raw_matrix_row(left_index); + changed |= store_raw_matrix_row(right_index); - matrix_scan_quantum(); + unselect_rows(); + } - return 1; -} + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + matrix_scan_quantum(); -bool matrix_is_modified(void) // deprecated and evidently not called. -{ - return true; + return 1; } -inline -bool matrix_is_on(uint8_t row, uint8_t col) +bool matrix_is_modified(void) // deprecated and evidently not called. { - return (matrix[row] & ((matrix_row_t)1<> 2)); + uint8_t data = 0; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOB, ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_READ, ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status) goto out; + mcp23018_status = i2c_read_nack(ERGODOX_EZ_I2C_TIMEOUT); + if (mcp23018_status < 0) goto out; + data = ~((uint8_t)mcp23018_status); + mcp23018_status = I2C_STATUS_SUCCESS; + out: + i2c_stop(); + return data; } + } else { + /* read from teensy + * bitmask is 0b11110011, but we want those all + * in the lower six bits. + * we'll return 1s for the top two, but that's harmless. + */ + + return ~((PINF & 0x03) | ((PINF & 0xF0) >> 2)); + } } /* Row pin configuration @@ -326,70 +275,70 @@ static matrix_row_t read_cols(uint8_t row) * row: 0 1 2 3 4 5 6 * pin: A0 A1 A2 A3 A4 A5 A6 */ -static void unselect_rows(void) -{ - // no need to unselect on mcp23018, because the select step sets all - // the other row bits high, and it's not changing to a different - // direction - - // unselect on teensy - // Hi-Z(DDR:0, PORT:0) to unselect - DDRB &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3); - PORTB &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3); - DDRD &= ~(1<<2 | 1<<3); - PORTD &= ~(1<<2 | 1<<3); - DDRC &= ~(1<<6); - PORTC &= ~(1<<6); +static void unselect_rows(void) { + // no need to unselect on mcp23018, because the select step sets all + // the other row bits high, and it's not changing to a different + // direction + + // unselect on teensy + // Hi-Z(DDR:0, PORT:0) to unselect + DDRB &= ~(1 << 0 | 1 << 1 | 1 << 2 | 1 << 3); + PORTB &= ~(1 << 0 | 1 << 1 | 1 << 2 | 1 << 3); + DDRD &= ~(1 << 2 | 1 << 3); + PORTD &= ~(1 << 2 | 1 << 3); + DDRC &= ~(1 << 6); + PORTC &= ~(1 << 6); } -static void select_row(uint8_t row) -{ - if (row < 7) { - // select on mcp23018 - if (mcp23018_status) { // if there was an error - // do nothing - } else { - // set active row low : 0 - // set other rows hi-Z : 1 - mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPIOA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0xFF & ~(1< http://jump.to/fleury -* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device with hardware TWI -* Usage: API compatible with I2C Software Library i2cmaster.h -**************************************************************************/ -#include -#include - -#include - - -/* define CPU frequency in Mhz here if not defined in Makefile */ -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -/* I2C clock in Hz */ -#define SCL_CLOCK 400000L - - -/************************************************************************* - Initialization of the I2C bus interface. Need to be called only once -*************************************************************************/ -void i2c_init(void) -{ - /* initialize TWI clock - * minimal values in Bit Rate Register (TWBR) and minimal Prescaler - * bits in the TWI Status Register should give us maximal possible - * I2C bus speed - about 444 kHz - * - * for more details, see 20.5.2 in ATmega16/32 secification - */ - - TWSR = 0; /* no prescaler */ - TWBR = 10; /* must be >= 10 for stable operation */ - -}/* i2c_init */ - - -/************************************************************************* - Issues a start condition and sends address and transfer direction. - return 0 = device accessible, 1= failed to access device -*************************************************************************/ -unsigned char i2c_start(unsigned char address) -{ - uint8_t twst; - - // send START condition - TWCR = (1<. /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ ) /* key matrix size */ diff --git a/keyboards/ergodox_infinity/info.json b/keyboards/ergodox_infinity/info.json index a24c6b0a197..e70b2a19e70 100644 --- a/keyboards/ergodox_infinity/info.json +++ b/keyboards/ergodox_infinity/info.json @@ -1,7 +1,7 @@ { "keyboard_name": "Infinity Ergodox", - "width": 19.5, - "height": 9.375, + "width": 17, + "height": 8, "layouts": { "LAYOUT_ergodox": { "layout": [ diff --git a/keyboards/ergodox_infinity/keymaps/default/keymap.c b/keyboards/ergodox_infinity/keymaps/default/keymap.c index cbc180d6a07..28b393a3d8f 100644 --- a/keyboards/ergodox_infinity/keymaps/default/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" #include "version.h" #define BASE 0 // default layer @@ -53,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -143,28 +141,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - } - return MACRO_NONE; -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // dynamically generate these. diff --git a/keyboards/ergodox_infinity/keymaps/gordon/keymap.c b/keyboards/ergodox_infinity/keymaps/gordon/keymap.c index f67dd13a5b1..c321d546fb5 100644 --- a/keyboards/ergodox_infinity/keymaps/gordon/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/gordon/keymap.c @@ -331,10 +331,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(1) }; void matrix_scan_user(void) { diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h b/keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h index 187ce87034e..2e83f799c7c 100644 --- a/keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h +++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h @@ -49,8 +49,8 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ ) /* key matrix size */ diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c index 8b6a0fcc702..7f829b243e4 100644 --- a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c @@ -456,11 +456,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/ergodox_infinity/keymaps/input_club/keymap.c b/keyboards/ergodox_infinity/keymaps/input_club/keymap.c index 45ad1f51f70..064c01c5511 100644 --- a/keyboards/ergodox_infinity/keymaps/input_club/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/input_club/keymap.c @@ -187,10 +187,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(L1) // FN1 - Momentary Layer 1 (Function) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/ergodox_infinity/keymaps/narze/keymap.c b/keyboards/ergodox_infinity/keymaps/narze/keymap.c index 3fd3b697144..d562c4a9deb 100644 --- a/keyboards/ergodox_infinity/keymaps/narze/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/narze/keymap.c @@ -55,10 +55,6 @@ static uint16_t m_gui_unds_timer; static uint16_t m_sft_po_timer; static uint16_t m_sft_pc_timer; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Narze : Custom Macros #define HPR_ESC ALL_T(KC_ESC) #define SFT_ENT SFT_T(KC_ENT) diff --git a/keyboards/ergodox_infinity/keymaps/nordic_ergo/keymap.c b/keyboards/ergodox_infinity/keymaps/nordic_ergo/keymap.c index 72ee2bc6fe5..156fd2f1987 100644 --- a/keyboards/ergodox_infinity/keymaps/nordic_ergo/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/nordic_ergo/keymap.c @@ -13,8 +13,6 @@ #define SYMB 2 // symbol layer #define MDIA 3 // media keys -#define _______ KC_TRNS - enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here EPRM, @@ -199,10 +197,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [2] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 2 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function @@ -272,4 +266,4 @@ void matrix_scan_user(void) { // none break; } -}; \ No newline at end of file +}; diff --git a/keyboards/ergodox_infinity/keymaps/rask/keymap.c b/keyboards/ergodox_infinity/keymaps/rask/keymap.c index e63e2e2cff6..990081f2f01 100644 --- a/keyboards/ergodox_infinity/keymaps/rask/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/rask/keymap.c @@ -143,10 +143,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(FL1) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/ergodox_infinity/rules.mk b/keyboards/ergodox_infinity/rules.mk index 1cc95193cb5..af8e9ef200c 100644 --- a/keyboards/ergodox_infinity/rules.mk +++ b/keyboards/ergodox_infinity/rules.mk @@ -59,6 +59,7 @@ OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000 # DFU_ARGS = -d 1c11:b007 +DFU_SUFFIX_ARGS = -p b007 -v 1c11 BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) diff --git a/keyboards/ergoinu/config.h b/keyboards/ergoinu/config.h index de72635b19d..dfc8a529304 100644 --- a/keyboards/ergoinu/config.h +++ b/keyboards/ergoinu/config.h @@ -57,18 +57,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN B6 diff --git a/keyboards/ergoinu/info.json b/keyboards/ergoinu/info.json index f85447913cf..81f53fd2557 100644 --- a/keyboards/ergoinu/info.json +++ b/keyboards/ergoinu/info.json @@ -2,18 +2,85 @@ "keyboard_name": "Ergoinu", "url": "", "maintainer": "hsgw", - "width": 17, - "height": 6.75, + "width": 18, + "height": 5.4, "layouts": { "LAYOUT": { "key_count": 64, "layout": [ - {"x": 0, "y": 0.6}, {"x": 1, "y": 0.4}, {"x": 2, "y": 0.4}, {"x": 3, "y": 0.25}, {"x": 4, "y": 0}, {"x": 5, "y": 0.25}, {"x": 6, "y": 0.4}, {"x": 10, "y": 0.4}, {"x": 11, "y": 0.25}, {"x": 12, "y": 0}, {"x": 13, "y": 0.25}, {"x": 14, "y": 0.4}, {"x": 15, "y": 0.4}, {"x": 16, "y": 0.6}, - {"x": 0, "y": 1.6}, {"x": 1, "y": 1.4}, {"x": 2, "y": 1.4}, {"x": 3, "y": 1.25}, {"x": 4, "y": 1}, {"x": 5, "y": 1.25}, {"x": 6, "y": 1.4}, {"x": 10, "y": 1.4}, {"x": 11, "y": 1.25}, {"x": 12, "y": 1}, {"x": 13, "y": 1.25}, {"x": 14, "y": 1.4}, {"x": 15, "y": 1.4}, {"x": 16, "y": 1.6}, - {"x": 0.25, "y": 2.6, "W":1.75}, {"x": 2, "y": 2.4}, {"x": 3, "y": 2.25}, {"x": 4, "y": 2}, {"x": 5, "y": 2.25}, {"x": 6, "y": 2.4}, {"x": 10, "y": 2.4}, {"x": 11, "y": 2.25}, {"x": 12, "y": 2}, {"x": 13, "y": 2.25}, {"x": 14, "y": 2.4}, {"x": 15, "y": 2.4}, {"x": 16, "y": 2.6}, - {"x": 0.25, "y": 3.6, "W":1.75}, {"x": 2, "y": 3.4}, {"x": 3, "y": 3.25}, {"x": 4, "y": 3}, {"x": 5, "y": 3.25}, {"x": 6, "y": 3.4}, {"x": 10, "y": 3.4}, {"x": 11, "y": 3.25}, {"x": 12, "y": 3}, {"x": 13, "y": 3.25}, {"x": 14, "y": 3.4}, {"x": 15, "y": 3.4}, {"x": 16, "y": 3.6}, - {"x": 3, "y": 4.25}, {"x": 4, "y": 4}, {"x": 5, "y": 4.25}, {"x": 6, "y": 4.4}, {"X":7.5, "Y":4.4, "H":1.25,"R":30, "RX":6, "RY":4.4}, - {"X":8.25, "Y":4.4, "H":1.25,"R":-30, "RX":11, "RY":4.4}, {"x": 10, "y": 4.4}, {"x": 11, "y": 4.25}, {"x": 12, "y": 4}, {"x": 13, "y": 4.4} + { "x": 0, "y": 0.6, "label": "ESC" }, + { "x": 1, "y": 0.4, "label": "1" }, + { "x": 2, "y": 0.4, "label": "2" }, + { "x": 3, "y": 0.25, "label": "3" }, + { "x": 4, "y": 0, "label": "4" }, + { "x": 5, "y": 0.25, "label": "5" }, + { "x": 6, "y": 0.4, "label": "6" }, + + { "x": 11, "y": 0.4, "label": "7" }, + { "x": 12, "y": 0.25, "label": "8" }, + { "x": 13, "y": 0, "label": "9" }, + { "x": 14, "y": 0.25, "label": "0" }, + { "x": 15, "y": 0.4, "label": "MINUS" }, + { "x": 16, "y": 0.4, "label": "EQUAL" }, + { "x": 17, "y": 0.6, "label": "BACKSLASH" }, + + { "x": 0, "y": 1.6, "label": "DELETE" }, + { "x": 1, "y": 1.4, "label": "TAB" }, + { "x": 2, "y": 1.4, "label": "Q" }, + { "x": 3, "y": 1.25, "label": "W" }, + { "x": 4, "y": 1, "label": "E" }, + { "x": 5, "y": 1.25, "label": "R" }, + { "x": 6, "y": 1.4, "label": "T" }, + + { "x": 11, "y": 1.4, "label": "Y" }, + { "x": 12, "y": 1.25, "label": "U" }, + { "x": 13, "y": 1, "label": "I" }, + { "x": 14, "y": 1.25, "label": "O" }, + { "x": 15, "y": 1.4, "label": "P" }, + { "x": 16, "y": 1.4, "label": "LBRACKET" }, + { "x": 17, "y": 1.6, "label": "RBRACKET" }, + + { "x": 0.25, "y": 2.6, "w": 1.75, "label": "LCTRL" }, + { "x": 2, "y": 2.4, "label": "A" }, + { "x": 3, "y": 2.25, "label": "S" }, + { "x": 4, "y": 2, "label": "D" }, + { "x": 5, "y": 2.25, "label": "F" }, + { "x": 6, "y": 2.4, "label": "G" }, + + { "x": 11, "y": 2.4, "label": "H" }, + { "x": 12, "y": 2.25, "label": "J" }, + { "x": 13, "y": 2, "label": "K" }, + { "x": 14, "y": 2.25, "label": "L" }, + { "x": 15, "y": 2.4, "label": "SEMICOLON" }, + { "x": 16, "y": 2.4, "label": "QUOTE" }, + { "x": 17, "y": 2.6, "label": "GRAVE" }, + + { "x": 0.25, "y": 3.6, "w": 1.75, "label": "LSHIFT" }, + { "x": 2, "y": 3.4, "label": "Z" }, + { "x": 3, "y": 3.25, "label": "X" }, + { "x": 4, "y": 3, "label": "C" }, + { "x": 5, "y": 3.25, "label": "V" }, + { "x": 6, "y": 3.4, "label": "B" }, + + { "x": 11, "y": 3.4, "label": "N" }, + { "x": 12, "y": 3.25, "label": "M" }, + { "x": 13, "y": 3, "label": "COMMA" }, + { "x": 14, "y": 3.25, "label": "DOT" }, + { "x": 15, "y": 3.4, "label": "SLASH" }, + { "x": 16, "y": 3.4, "label": "RSHIFT" }, + { "x": 17, "y": 3.6, "label": "RSHIFT" }, + + { "x": 3, "y": 4.25, "label": "MO(META)" }, + { "x": 4, "y": 4, "label": "LALT" }, + { "x": 5, "y": 4.25, "label": "LGUI" }, + { "x": 6, "y": 4.4, "label": "ENT" }, + { "x": 7, "y": 4.4, "w": 1.5, "label": "SPACE" }, + + { "x": 9.5, "y": 4.4, "w": 1.5, "label": "ENTER" }, + { "x": 11, "y": 4.4, "label": "BACKSPACE" }, + { "x": 12, "y": 4.25, "label": "RGUI" }, + { "x": 13, "y": 4, "label": "RALT" }, + { "x": 14, "y": 4.25, "label": "MO(META)" } ] } } diff --git a/keyboards/ergoinu/readme.md b/keyboards/ergoinu/readme.md index a0d1c18a243..06e0cf352eb 100644 --- a/keyboards/ergoinu/readme.md +++ b/keyboards/ergoinu/readme.md @@ -18,4 +18,4 @@ Make example for this keyboard (after setting up your build environment): make ergoinu:default_jis -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/ergoinu/rules.mk b/keyboards/ergoinu/rules.mk index de4bcad526a..1797d03ccb4 100644 --- a/keyboards/ergoinu/rules.mk +++ b/keyboards/ergoinu/rules.mk @@ -1,7 +1,6 @@ SRC += matrix.c serial.c split_util.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/ergotaco/config.h b/keyboards/ergotaco/config.h new file mode 100644 index 00000000000..4dbe0573b3d --- /dev/null +++ b/keyboards/ergotaco/config.h @@ -0,0 +1,61 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +// Copy and worked on with love from the EZ team + +#pragma once +#include "config_common.h" + +#define VERBOSE + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1337 +#define DEVICE_VER 0x0001 +#define MANUFACTURER g Heavy Industries +#define PRODUCT ErgoTaco +#define DESCRIPTION QMK keyboard firmware for ErgoTaco + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2) +#define MATRIX_COLS 1 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 +#define TAPPING_TOGGLE 1 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() (get_mods() == MOD_MASK_CTRL || get_mods() == MOD_MASK_SHIFT) + +#define DEBOUNCE 5 +#define USB_MAX_POWER_CONSUMPTION 500 diff --git a/keyboards/ergotaco/ergotaco.c b/keyboards/ergotaco/ergotaco.c new file mode 100644 index 00000000000..ecab74b3a26 --- /dev/null +++ b/keyboards/ergotaco/ergotaco.c @@ -0,0 +1,72 @@ +#include QMK_KEYBOARD_H + +bool i2c_initialized = 0; +i2c_status_t mcp23018_status = 0x20; + +void matrix_init_kb(void) { + // (tied to Vcc for hardware convenience) + //DDRB &= ~(1<<4); // set B(4) as input + //PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + + // unused pins + // set as input with internal pull-up enabled + DDRB &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); + PORTB |= (1<<4 | 1<<5 | 1<<6 | 1<<7); + + DDRC &= ~(1<<7 | 1<<6); + PORTC |= (1<<7 | 1<<6); + + DDRD &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); + PORTD |= (1<<4 | 1<<5 | 1<<6 | 1<<7); + + DDRE &= ~(1<<6); + PORTE |= (1<<6); + + DDRF &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6 | 1<<7); + PORTF |= (1<<0 | 1<<1 | 1<<4 | 1<<6 | 1<<7); + + matrix_init_user(); +} + + +uint8_t init_mcp23018(void) { + print("starting init"); + mcp23018_status = 0x20; + + // I2C subsystem + + // uint8_t sreg_prev; + // sreg_prev=SREG; + // cli(); + + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized = true; + _delay_ms(1000); + } + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + i2c_stop(); + + // set pull-up + // - unused : on : 1 + // - input : on : 1 + // - driving : off : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + +out: + i2c_stop(); + // SREG=sreg_prev; + //uprintf("Init %x\n", mcp23018_status); + return mcp23018_status; +} diff --git a/keyboards/ergotaco/ergotaco.h b/keyboards/ergotaco/ergotaco.h new file mode 100644 index 00000000000..6bc5ce36f89 --- /dev/null +++ b/keyboards/ergotaco/ergotaco.h @@ -0,0 +1,50 @@ +#pragma once +#include +#include +#include +#include "quantum.h" +#include "i2c_master.h" +#include "matrix.h" + + +extern i2c_status_t mcp23018_status; +#define ERGODOX_EZ_I2C_TIMEOUT 1000 +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +// I2C aliases and register addresses (see "mcp23018.md") +//#define I2C_ADDR 0b0100000 +#define I2C_ADDR 0x20 +#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) +#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +void init_ergodox(void); +uint8_t init_mcp23018(void); + +/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ +#define LAYOUT( \ + L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05) \ + \ + /* matrix positions */ \ + { \ + {R00}, \ + {R01}, \ + {R02}, \ + {R03}, \ + {R04}, \ + {R05}, \ + {L05}, \ + {L04}, \ + {L03}, \ + {L02}, \ + {L01}, \ + {L00}, \ +} diff --git a/keyboards/ergotaco/info.json b/keyboards/ergotaco/info.json new file mode 100644 index 00000000000..cf6b810fecd --- /dev/null +++ b/keyboards/ergotaco/info.json @@ -0,0 +1,61 @@ +{ + "keyboard_name": "ErgoTaco", + "url": "http://gboards.ca", + "maintainer": "germ", + "width": 13, + "height": 2.75, + "layouts": { + "LAYOUT": { + "layout": [ + { + "x": 0, + "y": 1.25 + }, + { + "x": 1, + "y": 0.75 + }, + { + "x": 2, + "y": 0.5 + }, + { + "x": 3, + "y": 0.25 + }, + { + "x": 4, + "y": 1 + }, + { + "x": 5, + "y": 1.75 + }, + { + "x": 7, + "y": 1.75 + }, + { + "x": 8, + "y": 1 + }, + { + "x": 9, + "y": 0.25 + }, + { + "x": 10, + "y": 0.5 + }, + { + "x": 11, + "y": 0.75 + }, + { + "x": 12, + "y": 1.25 + } + ] + } + } +} diff --git a/keyboards/ergotaco/keymaps/default/keymap.c b/keyboards/ergotaco/keymaps/default/keymap.c new file mode 100644 index 00000000000..be1267ef06c --- /dev/null +++ b/keyboards/ergotaco/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H + +#define FIESTA 0 // default layer +#define TACOTIME 1 // symbols + +// Blank template at the bottom +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap template + * + * ,-------------------------------------------------. ,--------------------------------------------. + * | | | | | | | | | | | | | | | + * `-------+------+------+------+------+-------------' `-------+------+------+------+------+--------' */ +[FIESTA] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H +), +}; + +/* Keymap template + * + * ,-------------------------------------------------. ,--------------------------------------------. + * | | | | | | | | | | | | | | | + * `-------+------+------+------+------+-------------' `-------+------+------+------+------+--------' +[FIESTA] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + */ + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; diff --git a/keyboards/ergotaco/keymaps/default/readme.md b/keyboards/ergotaco/keymaps/default/readme.md new file mode 100644 index 00000000000..653f3774eaa --- /dev/null +++ b/keyboards/ergotaco/keymaps/default/readme.md @@ -0,0 +1,6 @@ +This is the default keymap for the ErgoTaco, Make it your own! + +## Settings +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/ergotaco/keymaps/default/rules.mk + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/ergotaco/keymaps/default/rules.mk b/keyboards/ergotaco/keymaps/default/rules.mk new file mode 100644 index 00000000000..e394fbf1e64 --- /dev/null +++ b/keyboards/ergotaco/keymaps/default/rules.mk @@ -0,0 +1,10 @@ +#---------------------------------------------------------------------------- +# make ergotaco:default:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- +# Firmware options + +#Debug options +VERBOSE = yes +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_MATRIX = yes diff --git a/keyboards/ergotaco/matrix.c b/keyboards/ergotaco/matrix.c new file mode 100644 index 00000000000..f7ceb194ad6 --- /dev/null +++ b/keyboards/ergotaco/matrix.c @@ -0,0 +1,362 @@ +/* + +Copyright 2013 Oleg Kostyuk + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "matrix.h" +#include +#include +#include +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include QMK_KEYBOARD_H +#ifdef DEBUG_MATRIX_SCAN_RATE +#include "timer.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +// ATmega pin defs +#define ROW1 (1<<5) +#define COL6 (1<<0) +#define COL7 (1<<1) +#define COL8 (1<<2) +#define COL9 (1<<3) +#define COL10 (1<<2) +#define COL11 (1<<3) + + +// bit masks +#define BMASK (COL7 | COL8 | COL9 | COL6) +#define DMASK (COL10 | COL11) +#define FMASK (ROW1) + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +/* + * matrix state(1:on, 0:off) + * contains the raw values without debounce filtering of the last read cycle. + */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; + +// Debouncing: store for each key the number of scans until it's eligible to +// change. When scanning the matrix, ignore any changes in keys that have +// already changed in the last DEBOUNCE scans. +static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +static uint8_t mcp23018_reset_loop; +// static uint16_t mcp23018_reset_loop; + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + + +void matrix_init(void) +{ + // initialize row and col + mcp23018_status = init_mcp23018(); + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + raw_matrix[i] = 0; + for (uint8_t j=0; j < MATRIX_COLS; ++j) { + debounce_matrix[i * MATRIX_COLS + j] = 0; + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + matrix_init_quantum(); +} + +void matrix_power_up(void) { + mcp23018_status = init_mcp23018(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + +} + +// Returns a matrix_row_t whose bits are set if the corresponding key should be +// eligible to change in this scan. +matrix_row_t debounce_mask(matrix_row_t rawcols, uint8_t row) { + matrix_row_t result = 0; + matrix_row_t change = rawcols ^ raw_matrix[row]; + raw_matrix[row] = rawcols; + for (uint8_t i = 0; i < MATRIX_COLS; ++i) { + if (debounce_matrix[row * MATRIX_COLS + i]) { + --debounce_matrix[row * MATRIX_COLS + i]; + } else { + result |= (1 << i); + } + if (change & (1 << i)) { + debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; + } + } + return result; +} + +matrix_row_t debounce_read_cols(uint8_t row) { + // Read the row without debouncing filtering and store it for later usage. + matrix_row_t cols = read_cols(row); + // Get the Debounce mask. + matrix_row_t mask = debounce_mask(cols, row); + // debounce the row and return the result. + return (cols & mask) | (matrix[row] & ~mask);; +} + +uint8_t matrix_scan(void) +{ + // Then the keyboard + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // if (++mcp23018_reset_loop >= 1300) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + } + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_scan_count++; + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { + select_row(i); + // and select on left hand + select_row(i + MATRIX_ROWS_PER_SIDE); + // we don't need a 30us delay anymore, because selecting a + // left-hand row requires more than 30us for i2c. + + // grab cols from left hand + matrix[i] = debounce_read_cols(i); + // grab cols from right hand + matrix[i + MATRIX_ROWS_PER_SIDE] = debounce_read_cols(i + MATRIX_ROWS_PER_SIDE); + + unselect_rows(); + } + + matrix_scan_quantum(); + +#ifdef DEBUG_MATRIX + for (uint8_t c = 0; c < MATRIX_COLS; c++) + for (uint8_t r = 0; r < MATRIX_ROWS; r++) + if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c); +#endif + + return 1; +} + +bool matrix_is_modified(void) // deprecated and evidently not called. +{ + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 2) & 0x01 ; + mcp23018_status = I2C_STATUS_SUCCESS; + out: + i2c_stop(); + +#ifdef DEBUG_MATRIX + if (data != 0x00) xprintf("I2C: %d\n", data); +#endif + return data; + } + } else { + // Read using bitmask + return ~((((PINF & ROW1) >> 5)) & 0x1); + } +} + +// Row pin configuration +static void unselect_rows(void) +{ + // no need to unselect on mcp23018, because the select step sets all + // the other row bits high, and it's not changing to a different + // direction + // Hi-Z(DDR:0, PORT:0) to unselect + DDRB &= ~BMASK; + PORTB &= ~BMASK; + DDRD &= ~DMASK; + PORTD &= ~DMASK; +} + +static void select_row(uint8_t row) +{ + if (row < 6) { + // select on mcp23018 + if (mcp23018_status) { // do nothing on error + // Read using bitmask + } else { // set active row low : 0 // set other rows hi-Z : 1 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(~(1<. #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 +#define RGBLED_NUM 14 #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/ergotravel/keymaps/default/keymap.c b/keyboards/ergotravel/keymaps/default/keymap.c index d6f8d117158..370ee2092f8 100644 --- a/keyboards/ergotravel/keymaps/default/keymap.c +++ b/keyboards/ergotravel/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include QMK_KEYBOARD_H +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -14,58 +14,45 @@ enum custom_keycodes { ADJUST, }; -// #define KC_ KC_TRNS -#define _______ KC_TRNS - +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_A, KC_A, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LBRC, KC_RBRC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_A, KC_SPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC, KC_SPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' ), [_LOWER] = LAYOUT( - //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_A, KC_B, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_TAB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_D, KC_Y, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_SPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT - //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_HOME, KC_PGUP, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_END , KC_PGDN, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_BSPC, KC_BSPC, KC_F12, _______, _______, KC_MUTE, _______, KC_PIPE, \ + _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), [_RAISE] = LAYOUT( - //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_A, KC_B, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_C, KC_D, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_A, KC_SPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT - //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_4, KC_5, KC_6, KC_PLUS, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, \ + KC_ENT, KC_7, KC_8, KC_9, KC_MINS, _______, _______, _______, _______, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS, \ + _______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), [_ADJUST] = LAYOUT( - //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_C, KC_D, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_A, KC_SPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT - //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + TSKMGR, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, CALTDEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET ) }; diff --git a/keyboards/ergotravel/keymaps/ian/keymap.c b/keyboards/ergotravel/keymaps/ian/keymap.c index fd4006d51d6..0dbf3278ac7 100644 --- a/keyboards/ergotravel/keymaps/ian/keymap.c +++ b/keyboards/ergotravel/keymaps/ian/keymap.c @@ -1,4 +1,4 @@ -#include QMK_KEYBOARD_H +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -10,10 +10,6 @@ enum custom_layers { _QWERTY }; - - -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define BASELYR TO(_COLEMAK) // base layer #define LOWER MO(_LOWER) // momentary lower layer #define RAISE MO(_RAISE) // momentary raise layer diff --git a/keyboards/ergotravel/keymaps/jarred/config.h b/keyboards/ergotravel/keymaps/jarred/config.h new file mode 100644 index 00000000000..d64187b5982 --- /dev/null +++ b/keyboards/ergotravel/keymaps/jarred/config.h @@ -0,0 +1,29 @@ +/* +Copyright 2017 Pierre Constantineau + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/ergotravel/keymaps/jarred/keymap.c b/keyboards/ergotravel/keymaps/jarred/keymap.c new file mode 100644 index 00000000000..33031f931b3 --- /dev/null +++ b/keyboards/ergotravel/keymaps/jarred/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "jarred.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_ergotravel_grid_wrapper( + QWERTY_L1, KC_NO, KC_NO, QWERTY_R1, + QWERTY_L2, KC_NO, KC_NO, QWERTY_R2, + QWERTY_L3, KC_NO, KC_NO, QWERTY_R3, + QWERTY_4_12), + + [_LW] = LAYOUT_ergotravel_grid_wrapper( + LOWER_L1, KC_NO, KC_NO, LOWER_R1, + LOWER_L2, KC_NO, KC_NO, LOWER_R2, + LOWER_L3, KC_NO, KC_NO, LOWER_R3, + LOWER_4_12), + + [_NV] = LAYOUT_ergotravel_grid_wrapper( + NAV_L1, KC_NO, KC_NO, NAV_R1, + NAV_L2, KC_NO, KC_NO, NAV_R2, + NAV_L3, KC_NO, KC_NO, NAV_R3, + NAV_4_12), + + [_NP] = LAYOUT_ergotravel_grid_wrapper( + NUMPAD_L1, KC_NO, KC_NO, NUMPAD_R1, + NUMPAD_L2, KC_NO, KC_NO, NUMPAD_R2, + NUMPAD_L3, KC_NO, KC_NO, NUMPAD_R3, + NUMPAD_4_12), + + [_MS] = LAYOUT_ergotravel_grid_wrapper( + MOUSE_L1, KC_NO, KC_NO, MOUSE_R1, + MOUSE_L2, KC_NO, KC_NO, MOUSE_R2, + MOUSE_L3, KC_NO, KC_NO, MOUSE_R3, + MOUSE_4_12) +}; diff --git a/keyboards/ergotravel/keymaps/jpconstantineau/keymap.c b/keyboards/ergotravel/keymaps/jpconstantineau/keymap.c index b2374b71155..764b2b18c77 100644 --- a/keyboards/ergotravel/keymaps/jpconstantineau/keymap.c +++ b/keyboards/ergotravel/keymaps/jpconstantineau/keymap.c @@ -1,4 +1,4 @@ -#include QMK_KEYBOARD_H +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -15,7 +15,6 @@ enum custom_keycodes { }; #define KC_ KC_TRNS -#define _______ KC_TRNS #define KC_LOWR LOWER #define KC_RASE RAISE diff --git a/keyboards/ergotravel/keymaps/rs/config.h b/keyboards/ergotravel/keymaps/rs/config.h new file mode 100644 index 00000000000..eeca26ce1db --- /dev/null +++ b/keyboards/ergotravel/keymaps/rs/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Pierre Constantineau + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + + diff --git a/keyboards/ergotravel/keymaps/rs/keymap.c b/keyboards/ergotravel/keymaps/rs/keymap.c new file mode 100644 index 00000000000..1ac0a94d938 --- /dev/null +++ b/keyboards/ergotravel/keymaps/rs/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H +#include "rs.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + TAB , Q , W , E , R , T , GRV, BSLS, Y , U , I , O , P ,EQL , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ESCC, A , S , D , F , G ,PIPE, MINS, H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + LSFT, Z , X , C , V , B , SPC, BSPC, N , M ,COMM,DOT ,SLSH,ENTS, + //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| + FN , ,LCTL,LALT,LGUI, SPC, BSPC, CODE,LEFT, UP ,DOWN,RIGHT + //`----+----+----+--+-+----/----/ \----\----+----+----+----+----' + ), + [_CODE] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + GRV ,EXLM, AT ,HASH, DLR,PERC, , ,CIRC,LPLT,ASTR,RPGT,NEQL, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , 1 , 2 , 3 , 4 , 5 , , ,MINS,LBRC, UP ,RBRC, ,BSLS, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , 6 , 7 , 8 , 9 , 0 , DOT, ,AMPR,LEFT,DOWN,RGHT, ,PIPE, + //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| + , , , , , , , , , , , + //`----+----+----+----+----/----/ \----\----+----+----+----+----' + ), + [_FN] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , F1 , F2 , F3 , F4 , F5 , , , F6 , F7 , F8 , F9 , F10,F11 , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , ,BRMU, , , ,PGUP, , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , RST,BRMD, VOLU, ,CTRA,PGDN,CTRE, , , + //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| + , , , , , , VOLD,MUTE, , , , + //`----+----+----+----+----/----/ \----\----+----+----+----+----' + ), +}; \ No newline at end of file diff --git a/keyboards/ergotravel/keymaps/rs/readme.md b/keyboards/ergotravel/keymaps/rs/readme.md new file mode 100644 index 00000000000..d23ab66877a --- /dev/null +++ b/keyboards/ergotravel/keymaps/rs/readme.md @@ -0,0 +1 @@ +See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/keyboards/ergotravel/keymaps/rs/rules.mk b/keyboards/ergotravel/keymaps/rs/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/ergotravel/keymaps/viet/keymap.c b/keyboards/ergotravel/keymaps/viet/keymap.c index 0e3ec074c77..dd7fffcc69e 100644 --- a/keyboards/ergotravel/keymaps/viet/keymap.c +++ b/keyboards/ergotravel/keymaps/viet/keymap.c @@ -1,4 +1,4 @@ -#include "ergotravel.h" +#include "ergotravel.h" #include "action_layer.h" #include "eeconfig.h" #include "mousekey.h" @@ -26,7 +26,6 @@ enum custom_keycodes { }; #define KC_ KC_TRNS -#define _______ KC_TRNS #define KC_ADJT MO(_ADJUST) #define KC_RST RESET diff --git a/keyboards/ergotravel/keymaps/yanfali/config.h b/keyboards/ergotravel/keymaps/yanfali/config.h new file mode 100644 index 00000000000..eeca26ce1db --- /dev/null +++ b/keyboards/ergotravel/keymaps/yanfali/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Pierre Constantineau + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + + diff --git a/keyboards/ergotravel/keymaps/yanfali/keymap.c b/keyboards/ergotravel/keymaps/yanfali/keymap.c new file mode 100644 index 00000000000..399dc9998c4 --- /dev/null +++ b/keyboards/ergotravel/keymaps/yanfali/keymap.c @@ -0,0 +1,108 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //,---------------------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINUS, + //|---------------------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + MT(MOD_LCTL, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_LCBR, KC_RCBR, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //|---------------------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO, KC_NO, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + //|---------------------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + ADJUST, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + //`---------------------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ), + + [_LOWER] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_Y, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, RAISE, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ), + + + [_RAISE] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, RAISE, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, RAISE, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ) + +}; + + + + + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/ergotravel/keymaps/yanfali/rules.mk b/keyboards/ergotravel/keymaps/yanfali/rules.mk new file mode 100644 index 00000000000..0613ea8667c --- /dev/null +++ b/keyboards/ergotravel/keymaps/yanfali/rules.mk @@ -0,0 +1 @@ +BOOTLOADER = qmk-dfu diff --git a/keyboards/ergotravel/readme.md b/keyboards/ergotravel/readme.md index ad37bc1acce..7c76d5fc0bb 100644 --- a/keyboards/ergotravel/readme.md +++ b/keyboards/ergotravel/readme.md @@ -23,6 +23,6 @@ Example of flashing this keyboard: make ergotravel/rev1:default:avrdude -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. A build guide for this keyboard can be found here: [Build Guide](https://github.com/jpconstantineau) diff --git a/keyboards/ergotravel/rev1/config.h b/keyboards/ergotravel/rev1/config.h index 3af1147a7ad..89045666be0 100644 --- a/keyboards/ergotravel/rev1/config.h +++ b/keyboards/ergotravel/rev1/config.h @@ -44,17 +44,15 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 #define BACKLIGHT_PIN B5 #define BACKLIGHT_LEVELS 5 diff --git a/keyboards/ergotravel/rules.mk b/keyboards/ergotravel/rules.mk index 55155b5a3ea..c88a7fa14f0 100644 --- a/keyboards/ergotravel/rules.mk +++ b/keyboards/ergotravel/rules.mk @@ -1,6 +1,4 @@ - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/espectro/config.h b/keyboards/espectro/config.h new file mode 100755 index 00000000000..2736c1d8804 --- /dev/null +++ b/keyboards/espectro/config.h @@ -0,0 +1,63 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA96 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MECHKEYS +#define PRODUCT Espectro +#define DESCRIPTION 96% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 13 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B7, B3, E6, F0, D5, D4, D6, C7 } +#define MATRIX_COL_PINS { C6, F1, F4, F5, F6, F7, D7, B4, B5, D0, D1, D2, D3} +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 5 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLED_NUM 18 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 10 +#define RGBLIGHT_VAL_STEP 10 + +#define RGBLIGHT_ANIMATIONS + +#endif diff --git a/keyboards/espectro/espectro.c b/keyboards/espectro/espectro.c new file mode 100755 index 00000000000..13030cdd414 --- /dev/null +++ b/keyboards/espectro/espectro.c @@ -0,0 +1,76 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include QMK_KEYBOARD_H +#include "quantum.h" + + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 1); PORTB &= ~(1 << 1); + } else { + DDRB &= ~(1 << 1); PORTB &= ~(1 << 1); + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + diff --git a/keyboards/espectro/espectro.h b/keyboards/espectro/espectro.h new file mode 100755 index 00000000000..98c930f8f57 --- /dev/null +++ b/keyboards/espectro/espectro.h @@ -0,0 +1,163 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#pragma once + +#include "quantum.h" + + +/* + * Placement of every possible switch defined below. + * x2 means the diode allows two possible positions for the switch + * + * Layout: + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │K00 │K01 │K02 │K03 │K04 │K60 │K61 │K62 │K63 │K05 │K06 │K07 │K08 │K72 │K09 │K0A │K0B │K0C │K7C │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │K10 │K11 │K12 │K13 │K14 │K64 │K65 │K66 │K67 │K15 │K16 │K17 │K18 │K70 │K71 │K19 │K1A │K1B │K1C │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │x2 │ │ │ │ │ + * ├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴─────┼─────┼─────┼─────┼─────┤ ┌────────┐ + * │K20 │K21 │K22 │K23 │K24 │K68 │K69 │K6A │K6B │K25 │K26 │K27 │K28 │K73 │K29 │K2A │K2B │K2C │ │K38 │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────────┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴────────┼─────┼─────┼─────┼─────┤ ┌───┴─┐ │ + * │K30 │K31 │K32 │K33 │K34 │K6C │K75 │K76 │K77 │K35 │K36 │K37 │K38 │K39 │K3A │K3B │K3C │ │K73 │ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───────┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──────┬─────┼─────┼─────┼─────┼─────┤ └─────┴──────┘ + * │K40x2 │K41 │K42 │K43 │K44 │K78 │K79 │K7A │K7B │K45 │K46 │K47 │K48 │K74 │K49 │K4A │K4B │K4C │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───────┼─────┴─┬───┴───┬─┴─────┴─────┴─────┴─────┴─────┴───┬─┴───┬─┴───┬─┴───┬─────┼─────┼─────┼─────┼─────┼─────┤ + * │K50 │K51 │K52 │K59 │K55 │K56 │K57 │K58 │K53 │K54 │K5A │K5B │K5C │ + * │x2 │x2 │ │x3 │x3 │x2 │x2 │x2 │x2 │ │x2 │ │ │ + * └───────┴───────┴───────┴───────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + * + * Variants: + * - 2u Backspace: Delete K70 Use K71 + * - 2u Num +: Delete K3C Use K2C + * - 2u Num Enter: Delete K5C Use K4C + * - ANSI Left Shift: Delete K41 Use K40 + * + * ANSI Backslash and ISO Hash are the same position + * ANSI Enter and ISO Enter are the same position + * For two 1.5u modifiers on the right of the Spacebar, delete K56 and use K55 and K57 + * + * Matrix: + * { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + * { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + * { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + * { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \ + * { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + * { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C }, \ + * { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C }, \ + * { K70, K71, K72, K73, K74, K75, K76, K77, K78, K79, K7A, K7B, K7C } \ + */ + + +/* LAYOUT_all (Identical to LAYOUT_split_shift_and_bs) + * Every matrix position + * ,---------------------------------------------------------------------------. + * | 00| 01| 02| 03| 04| 60| 61| 62| 63| 05| 06| 07| 08| 72| 09| 0A| 0B| 0C| 7C| + * |---------------------------------------------------------------------------| + * | 10| 11| 12| 13| 14| 64| 65| 66| 67| 15| 16| 17| 18| 70| 71| 19| 1A| 1B| 1C| + * |---------------------------------------------------------------------------| + * | 20 | 21| 22| 23| 24| 68| 69| 6A| 6B| 25| 26| 27| 28| 73| 29| 2A| 2B| 2C| + * |---------------------------------------------------------------------------| + * | 30 | 31| 32| 33| 34| 6C| 75| 76| 77| 35| 36| 37| 38| 39| 3A| 3B| 3C| + * |---------------------------------------------------------------------------| + * | 40 | 41| 42| 43| 44| 78| 79| 7A| 7B| 45| 46| 47| 48| 74| 49| 4A| 4B| 4C| + * |---------------------------------------------------------------------------| + * | 50 | 51 | 52 | 59 | 55| 56| 57| 58| 53| 54| 5A| 5B| 5C| + * `---------------------------------------------------------------------------' +*/ + + +//Arrow keys and 1.75u right shift +#define LAYOUT_default( \ + K00, K01, K02, K03, K04, K60, K61, K62, K63, K05, K06, K07, K08, K72, K09, K0A, K0B, K0C, K7C, \ + K10, K11, K12, K13, K14, K64, K65, K66, K67, K15, K16, K17, K18, K71, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K68, K69, K6A, K6B, K25, K26, K27, K28, K73, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K6C, K75, K76, K77, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K42, K43, K44, K78, K79, K7A, K7B, K45, K46, K47, K48, K74, K49, K4A, K4B, K4C, \ + K50, K51, K52, K59, K55, K56, K57, K58, K53, K54, K5A, K5B \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO }, \ + { K40, KC_NO, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, KC_NO }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, K79, K7A, K7B, K7C } \ +} + +// Split backspace 1.5u right mods +#define LAYOUT_split_bs_joined_right( \ + K00, K01, K02, K03, K04, K60, K61, K62, K63, K05, K06, K07, K08, K72, K09, K0A, K0B, K0C, K7C, \ + K10, K11, K12, K13, K14, K64, K65, K66, K67, K15, K16, K17, K18, K70, K71, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K68, K69, K6A, K6B, K25, K26, K27, K28, K73, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K6C, K75, K76, K77, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K42, K43, K44, K78, K79, K7A, K7B, K45, K46, K47, K48, K74, K49, K4A, K4B, K4C, \ + K50, K51, K52, K59, K55, K57, K58, K53, K54, K5A, K5B \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO }, \ + { K40, KC_NO, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + { K50, K51, K52, K53, K54, K55, KC_NO, K57, K58, K59, K5A, K5B, KC_NO }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C }, \ + { K70, K71, K72, K73, K74, K75, K76, K77, K78, K79, K7A, K7B, K7C }, \ +} + +// Split numpad (enter, 0), split shifts (right, left), split backspace +// This layout contains every possible keycode placement +#define LAYOUT_split_shift_and_bs( \ + K00, K01, K02, K03, K04, K60, K61, K62, K63, K05, K06, K07, K08, K72, K09, K0A, K0B, K0C, K7C, \ + K10, K11, K12, K13, K14, K64, K65, K66, K67, K15, K16, K17, K18, K70, K71, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K68, K69, K6A, K6B, K25, K26, K27, K28, K73, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K6C, K75, K76, K77, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K43, K44, K78, K79, K7A, K7B, K45, K46, K47, K48, K74, K49, K4A, K4B, K4C, \ + K50, K51, K52, K59, K55, K56, K57, K58, K53, K54, K5A, K5B, K5C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C }, \ + { K70, K71, K72, K73, K74, K75, K76, K77, K78, K79, K7A, K7B, K7C }, \ +} + +// ISO Layout +#define LAYOUT_iso( \ + K00, K01, K02, K03, K04, K60, K61, K62, K63, K05, K06, K07, K08, K72, K09, K0A, K0B, K0C, K7C, \ + K10, K11, K12, K13, K14, K64, K65, K66, K67, K15, K16, K17, K18, K71, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K68, K69, K6A, K6B, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K6C, K75, K76, K77, K35, K36, K37, K73, K38, K39, K3A, K3B, \ + K40, K41, K42, K43, K44, K78, K79, K7A, K7B, K45, K46, K47, K48, K74, K49, K4A, K4B, K4C, \ + K50, K51, K52, K59, K55, K56, K57, K58, K53, K54, K5A, K5B \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, KC_NO }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, K79, K7A, K7B, K7C } \ +} diff --git a/keyboards/espectro/info.json b/keyboards/espectro/info.json new file mode 100644 index 00000000000..dc8546f537b --- /dev/null +++ b/keyboards/espectro/info.json @@ -0,0 +1,458 @@ +{ + "keyboard_name": "Espectro", + "keyboard_folder": "espectro", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT_default": { + "key_count": 100, + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PRINT SCREEN", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"PAGE UP", "x":16, "y":0}, + {"label":"PAGE DOWN", "x":17, "y":0}, + {"label":"DELETE", "x":18, "y":0}, + + {"label":"GRAVE", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"MINUS", "x":11, "y":1}, + {"label":"EQUAL", "x":12, "y":1}, + {"label":"BACKSPACE", "x":13, "y":1, "w":2}, + {"label":"NUM LOCK", "x":15, "y":1}, + {"label":"KEYPAD /", "x":16, "y":1}, + {"label":"KEYPAD *", "x":17, "y":1}, + {"label":"KEYPAD -", "x":18, "y":1}, + + {"label":"TAB", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"LBRACKET", "x":11.5, "y":2}, + {"label":"RBRACKET", "x":12.5, "y":2}, + {"label":"BACKSLASH", "x":13.5, "y":2, "w":1.5}, + {"label":"KEYPAD 7", "x":15, "y":2}, + {"label":"KEYPAD 8", "x":16, "y":2}, + {"label":"KEYPAD 9", "x":17, "y":2}, + {"label":"KEYPAD +", "x":18, "y":2, "h":2}, + + {"label":"CAPS LOCK", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":"SEMICOLON", "x":10.75, "y":3}, + {"label":"QUOTE", "x":11.75, "y":3}, + {"label":"ENTER", "x":12.75, "y":3, "w":2.25}, + {"label":"KEYPAD 4", "x":15, "y":3}, + {"label":"KEYPAD 5", "x":16, "y":3}, + {"label":"KEYPAD 6", "x":17, "y":3}, + + {"label":"LSHIFT", "x":0, "y":4, "w":2.25}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":"COMMA", "x":9.25, "y":4}, + {"label":"PERIOD", "x":10.25, "y":4}, + {"label":"SLASH", "x":11.25, "y":4}, + {"label":"RSHIFT", "x":12.25, "y":4, "w":1.75}, + {"label":"UP", "x":14, "y":4}, + {"label":"KEYPAD 1", "x":15, "y":4}, + {"label":"KEYPAD 2", "x":16, "y":4}, + {"label":"KEYPAD 3", "x":17, "y":4}, + {"label":"KEYPAD ENTER", "x":18, "y":4, "h":2}, + + {"label":"LCTRL", "x":0, "y":5, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5, "w":1.25}, + {"label":"SPACE", "x":3.75, "y":5, "w":6.25}, + {"label":"RALT", "x":10, "y":5}, + {"label":"RCTRL", "x":11, "y":5}, + {"label":"FN", "x":12, "y":5}, + {"label":"LEFT", "x":13, "y":5}, + {"label":"DOWN", "x":14, "y":5}, + {"label":"RIGHT", "x":15, "y":5}, + {"label":"KEYPAD 0", "x":16, "y":5}, + {"label":"KEYPAD .", "x":17, "y":5} + ] + }, + + "LAYOUT_split_bs_joined_right": { + "key_count": 100, + "layout": [ + {"label": "K00", "x": 0, "y": 0}, + {"label": "K01", "x": 1, "y": 0}, + {"label": "K02", "x": 2, "y": 0}, + {"label": "K03", "x": 3, "y": 0}, + {"label": "K04", "x": 4, "y": 0}, + {"label": "K60", "x": 5, "y": 0}, + {"label": "K61", "x": 6, "y": 0}, + {"label": "K62", "x": 7, "y": 0}, + {"label": "K63", "x": 8, "y": 0}, + {"label": "K05", "x": 9, "y": 0}, + {"label": "K06", "x": 10, "y": 0}, + {"label": "K07", "x": 11, "y": 0}, + {"label": "K08", "x": 12, "y": 0}, + {"label": "K72", "x": 13, "y": 0}, + {"label": "K09", "x": 14, "y": 0}, + {"label": "K0A", "x": 15, "y": 0}, + {"label": "K0B", "x": 16, "y": 0}, + {"label": "K0C", "x": 17, "y": 0}, + {"label": "K7C", "x": 18, "y": 0}, + + {"label": "K10", "x": 0, "y": 1}, + {"label": "K11", "x": 1, "y": 1}, + {"label": "K12", "x": 2, "y": 1}, + {"label": "K13", "x": 3, "y": 1}, + {"label": "K14", "x": 4, "y": 1}, + {"label": "K64", "x": 5, "y": 1}, + {"label": "K65", "x": 6, "y": 1}, + {"label": "K66", "x": 7, "y": 1}, + {"label": "K67", "x": 8, "y": 1}, + {"label": "K15", "x": 9, "y": 1}, + {"label": "K16", "x": 10, "y": 1}, + {"label": "K17", "x": 11, "y": 1}, + {"label": "K18", "x": 12, "y": 1}, + {"label": "K70", "x": 13, "y": 1}, + {"label": "K71", "x": 14, "y": 1}, + {"label": "K19", "x": 15, "y": 1}, + {"label": "K1A", "x": 16, "y": 1}, + {"label": "K1B", "x": 17, "y": 1}, + {"label": "K1C", "x": 18, "y": 1}, + + {"label": "K20", "x": 0, "y": 2, "w": 1.5}, + {"label": "K21", "x": 1.5, "y": 2}, + {"label": "K22", "x": 2.5, "y": 2}, + {"label": "K23", "x": 3.5, "y": 2}, + {"label": "K24", "x": 4.5, "y": 2}, + {"label": "K68", "x": 5.5, "y": 2}, + {"label": "K69", "x": 6.5, "y": 2}, + {"label": "K6A", "x": 7.5, "y": 2}, + {"label": "K6B", "x": 8.5, "y": 2}, + {"label": "K25", "x": 9.5, "y": 2}, + {"label": "K26", "x": 10.5, "y": 2}, + {"label": "K27", "x": 11.5, "y": 2}, + {"label": "K28", "x": 12.5, "y": 2}, + {"label": "K73", "x": 13.5, "y": 2, "w": 1.5}, + {"label": "K29", "x": 15, "y": 2}, + {"label": "K2A", "x": 16, "y": 2}, + {"label": "K2B", "x": 17, "y": 2}, + {"label": "K2C", "x": 18, "y": 2, "h": 2}, + + {"label": "K30", "x": 0, "y": 3, "w": 1.75}, + {"label": "K31", "x": 1.75, "y": 3}, + {"label": "K32", "x": 2.75, "y": 3}, + {"label": "K33", "x": 3.75, "y": 3}, + {"label": "K34", "x": 4.75, "y": 3}, + {"label": "K6C", "x": 5.75, "y": 3}, + {"label": "K75", "x": 6.75, "y": 3}, + {"label": "K76", "x": 7.75, "y": 3}, + {"label": "K77", "x": 8.75, "y": 3}, + {"label": "K35", "x": 9.75, "y": 3}, + {"label": "K36", "x": 10.75, "y": 3}, + {"label": "K37", "x": 11.75, "y": 3}, + {"label": "K38", "x": 12.75, "y": 3, "w": 2.25}, + {"label": "K39", "x": 15, "y": 3}, + {"label": "K3A", "x": 16, "y": 3}, + {"label": "K3B", "x": 17, "y": 3}, + + {"label": "K40", "x": 0, "y": 4, "w": 2.25}, + {"label": "K42", "x": 2.25, "y": 4}, + {"label": "K43", "x": 3.25, "y": 4}, + {"label": "K44", "x": 4.25, "y": 4}, + {"label": "K78", "x": 5.25, "y": 4}, + {"label": "K79", "x": 6.25, "y": 4}, + {"label": "K7A", "x": 7.25, "y": 4}, + {"label": "K7B", "x": 8.25, "y": 4}, + {"label": "K45", "x": 9.25, "y": 4}, + {"label": "K46", "x": 10.25, "y": 4}, + {"label": "K47", "x": 11.25, "y": 4}, + {"label": "K48", "x": 12.25, "y": 4, "w": 1.75}, + {"label": "K74", "x": 14, "y": 4}, + {"label": "K49", "x": 15, "y": 4}, + {"label": "K4A", "x": 16, "y": 4}, + {"label": "K4B", "x": 17, "y": 4}, + {"label": "K4C", "x": 18, "y": 4, "h": 2}, + + {"label": "K50", "x": 0, "y": 5, "w": 1.25}, + {"label": "K51", "x": 1.25, "y": 5, "w": 1.25}, + {"label": "K52", "x": 2.5, "y": 5, "w": 1.25}, + {"label": "K59", "x": 3.75, "y": 5, "w": 6.25}, + {"label": "K55", "x": 10, "y": 5, "w": 1.5}, + {"label": "K57", "x": 11.5, "y": 5, "w": 1.5}, + {"label": "K58", "x": 13, "y": 5}, + {"label": "K53", "x": 14, "y": 5}, + {"label": "K54", "x": 15, "y": 5}, + {"label": "K5A", "x": 16, "y": 5}, + {"label": "K5B", "x": 17, "y": 5} + ] + }, + + "LAYOUT_split_shift_and_bs": { + "key_count": 104, + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PRINT SCREEN", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"PAGE UP", "x":16, "y":0}, + {"label":"PAGE DOWN", "x":17, "y":0}, + {"label":"DELETE", "x":18, "y":0}, + + {"label":"GRAVE", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"MINUS", "x":11, "y":1}, + {"label":"EQUAL", "x":12, "y":1}, + {"label":"BACKSPACE", "x":13, "y":1}, + {"label":"BACKSPACE", "x":14, "y":1}, + {"label":"NUM LOCK", "x":15, "y":1}, + {"label":"KEYPAD /", "x":16, "y":1}, + {"label":"KEYPAD *", "x":17, "y":1}, + {"label":"KEYPAD -", "x":18, "y":1}, + + {"label":"TAB", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"LBRACKET", "x":11.5, "y":2}, + {"label":"RBRACKET", "x":12.5, "y":2}, + {"label":"BACKSLASH", "x":13.5, "y":2, "w":1.5}, + {"label":"KEYPAD 7", "x":15, "y":2}, + {"label":"KEYPAD 8", "x":16, "y":2}, + {"label":"KEYPAD 9", "x":17, "y":2}, + {"label":"KEYPAD +", "x":18, "y":2}, + + {"label":"CAPS LOCK", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":"SEMICOLON", "x":10.75, "y":3}, + {"label":"QUOTE", "x":11.75, "y":3}, + {"label":"ENTER", "x":12.75, "y":3, "w":2.25}, + {"label":"KEYPAD 4", "x":15, "y":3}, + {"label":"KEYPAD 5", "x":16, "y":3}, + {"label":"KEYPAD 6", "x":17, "y":3}, + {"label":"KEYPAD +", "x":18, "y":3}, + + {"label":"LSHIFT", "x":0, "y":4, "w":1.25}, + {"label":"ISO BACKSLASH", "x":1.25, "y":4}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":"COMMA", "x":9.25, "y":4}, + {"label":"PERIOD", "x":10.25, "y":4}, + {"label":"SLASH", "x":11.25, "y":4}, + {"label":"RSHIFT", "x":12.25, "y":4, "w":1.75}, + {"label":"UP", "x":14, "y":4}, + {"label":"KEYPAD 1", "x":15, "y":4}, + {"label":"KEYPAD 2", "x":16, "y":4}, + {"label":"KEYPAD 3", "x":17, "y":4}, + {"label":"KEYPAD ENTER", "x":18, "y":4}, + + {"label":"LCTRL", "x":0, "y":5, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5, "w":1.25}, + {"label":"SPACE", "x":3.75, "y":5, "w":6.25}, + {"label":"RALT", "x":10, "y":5}, + {"label":"MENU", "x":11, "y":5}, + {"label":"RCTRL", "x":12, "y":5}, + {"label":"LEFT", "x":13, "y":5}, + {"label":"DOWN", "x":14, "y":5}, + {"label":"RIGHT", "x":15, "y":5}, + {"label":"KEYPAD 0", "x":16, "y":5}, + {"label":"KEYPAD .", "x":17, "y":5}, + {"label":"KEYPAD ENTER", "x":18, "y":5} + ] + }, + + "LAYOUT_iso": { + "key_count": 101, + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PRINT SCREEN", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"PAGE UP", "x":16, "y":0}, + {"label":"PAGE DOWN", "x":17, "y":0}, + {"label":"DELETE", "x":18, "y":0}, + + {"label":"GRAVE", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"MINUS", "x":11, "y":1}, + {"label":"EQUAL", "x":12, "y":1}, + {"label":"BACKSPACE", "x":13, "y":1, "w":2}, + {"label":"NUM LOCK", "x":15, "y":1}, + {"label":"KEYPAD /", "x":16, "y":1}, + {"label":"KEYPAD *", "x":17, "y":1}, + {"label":"KEYPAD -", "x":18, "y":1}, + + {"label":"TAB", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"LBRACKET", "x":11.5, "y":2}, + {"label":"RBRACKET", "x":12.5, "y":2}, + {"label":"KEYPAD 7", "x":15, "y":2}, + {"label":"KEYPAD 8", "x":16, "y":2}, + {"label":"KEYPAD 9", "x":17, "y":2}, + {"label":"KEYPAD +", "x":18, "y":2, "h":2}, + + {"label":"CAPS LOCK", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":"SEMICOLON", "x":10.75, "y":3}, + {"label":"QUOTE", "x":11.75, "y":3}, + {"label":"ISO HASH", "x":12.75, "y":3}, + {"label":"ENTER", "x":13.75, "y":2, "w":1.25, "h":2}, + {"label":"KEYPAD 4", "x":15, "y":3}, + {"label":"KEYPAD 5", "x":16, "y":3}, + {"label":"KEYPAD 6", "x":17, "y":3}, + + {"label":"LSHIFT", "x":0, "y":4, "w":1.25}, + {"label":"ISO BACKSLASH", "x":1.25, "y":4}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":"COMMA", "x":9.25, "y":4}, + {"label":"PERIOD", "x":10.25, "y":4}, + {"label":"SLASH", "x":11.25, "y":4}, + {"label":"RSHIFT", "x":12.25, "y":4, "w":1.75}, + {"label":"UP", "x":14, "y":4}, + {"label":"KEYPAD 1", "x":15, "y":4}, + {"label":"KEYPAD 2", "x":16, "y":4}, + {"label":"KEYPAD 3", "x":17, "y":4}, + {"label":"KEYPAD ENTER", "x":18, "y":4, "h":2}, + + {"label":"LCTRL", "x":0, "y":5, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5, "w":1.25}, + {"label":"SPACE", "x":3.75, "y":5, "w":6.25}, + {"label":"RALT", "x":10, "y":5}, + {"label":"MENU", "x":11, "y":5}, + {"label":"RCTRL", "x":12, "y":5}, + {"label":"LEFT", "x":13, "y":5}, + {"label":"DOWN", "x":14, "y":5}, + {"label":"RIGHT", "x":15, "y":5}, + {"label":"KEYPAD 0", "x":16, "y":5}, + {"label":"KEYPAD .", "x":17, "y":5} + ] + } + } +} diff --git a/keyboards/espectro/keymaps/default/keymap.c b/keyboards/espectro/keymaps/default/keymap.c new file mode 100755 index 00000000000..b78fdbcac16 --- /dev/null +++ b/keyboards/espectro/keymaps/default/keymap.c @@ -0,0 +1,88 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include QMK_KEYBOARD_H + +#define _BL 0 //Base layer +#define _FN1 1 //Function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BL +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | PRT SC | SCR LK | PAUSE | P UP | P DOWN | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | BACK | NUM | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________| + | +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | MO | | | | | | | +| CTRL | LGUI | L ALT | SPACE | R ALT | R CTRL | _FN | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_BL] = LAYOUT_default( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_PSCR, KC_SLCK, KC_PAUS, KC_PGUP, KC_PGDN, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + +/* FN_1 +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | VOL | VOL | NEXT | | | +| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | SAT | | | | | DELETE | | | | | +|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| +| | BACK | BACK | | | | | | | | | | | | | | | | +| | LIGHT | LIGHT | | | | | | | | | | | | | | | | +|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|_____________|________|________|________| | +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| | +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_FN1] = LAYOUT_default( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END, \ + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + +}; + diff --git a/keyboards/espectro/keymaps/iso/keymap.c b/keyboards/espectro/keymaps/iso/keymap.c new file mode 100755 index 00000000000..a9625e4d96f --- /dev/null +++ b/keyboards/espectro/keymaps/iso/keymap.c @@ -0,0 +1,88 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include QMK_KEYBOARD_H + +#define _BL 0 //Base layer +#define _FN1 1 //Function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BL +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE | P SCN | HOME | END | P UP | P DOWN | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| ` | | | | | | | | | | | | | BACK | NUM | | | | +| ¬ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|__ ENTER |________|________|________| + | +| | | | | | | | | | | ; | ' | # | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | @ | ~ | | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|________|___________|________|________|________|________| +| | \ | | | | | | | | , | . | / | | | | | | | +| SHIFT | | | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________|_______|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | MO | | | | | | | +| CTRL | LGUI | L ALT | SPACE | R ALT | R CTRL | _FN | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_BL] = LAYOUT_iso( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_PSCR, KC_HOME, KC_END, KC_PGUP, KC_PGDN, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + +/* FN_1 +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | VOL | VOL | NEXT | | | +| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | SAT | | | | | DELETE | | | | | +|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| +| | BACK | BACK | | | | | | | | | | | | | | | | +| | LIGHT | LIGHT | | | | | | | | | | | | | | | | +|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|__ |________|________|________| | +| | | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|________|___________|________|________|________|________| +| | | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | | +|__________|_______|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| | +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_FN1] = LAYOUT_iso( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END, \ + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + +}; + diff --git a/keyboards/espectro/keymaps/mac/config.h b/keyboards/espectro/keymaps/mac/config.h new file mode 100644 index 00000000000..a18495221b0 --- /dev/null +++ b/keyboards/espectro/keymaps/mac/config.h @@ -0,0 +1,22 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define TAPPING_TOGGLE 2 + +// place overrides here + diff --git a/keyboards/espectro/keymaps/mac/keymap.c b/keyboards/espectro/keymaps/mac/keymap.c new file mode 100644 index 00000000000..9bd75d61d64 --- /dev/null +++ b/keyboards/espectro/keymaps/mac/keymap.c @@ -0,0 +1,163 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include QMK_KEYBOARD_H + + +#define _QWERTY 0 //BASE layer +#define _FUNCTION 1 //Function layer +#define _WINDOWS 2 //Windows layer + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EXPOSE, // Expose (LCTRL + UP) + LAUNCH, + DOCK, + SCRCAP, + CS1, + CS2, + QALL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base Layer +____________________________________________________________________________________________________________________________________________________________________________ +| | SCREEN | SCREEN | | |SHOW | TOGGLE |SCREEN |CUSTOM |CUSTOM |PREVIOUS| PLAY/ | NEXT | | | | | | | +| ESC |BRIGHTEN| DIM | EXPOSE |LAUNCHPA|DESKTOP | DOCK |CAPTURE |SHORTCUT|SHORTCUT| TRACK | PAUSE | TRACK | MUTE | VOL DN | VOL UP | PG UP |PG DOWN | POWER | +|________|________|________|________|________|________|________|________|___1____|___2____|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | BACK | | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | DELETE | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________| + | +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | TT | | | | | | | +| CTRL | L ALT | L GUI | SPACE | R GUI | R CTRL | _FN | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________| COMMAND |________________________________________________________|COMMAND |________|________|________|________|________|________|________|________| + */ + + [_QWERTY] = LAYOUT_default( + KC_ESC, KC_F14, KC_F15, EXPOSE, LAUNCH, KC_F11, DOCK, SCRCAP, CS1, CS2, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PGUP, KC_PGDN, KC_POWER, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, TT(1), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT + ), +/* FN1 - SEE readme.md +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| QUIT | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | | HOME | END | RESET | +|_ALL____|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | | | | | | DELETE | | | | | +|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| +| | BACK | BACK | | | | | | | | | | | | | | | | +| | LIGHT | LIGHT | | | | | | | | | | | | | | | | +|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|_____________|________|________|________| | +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| | +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + + [_FUNCTION] = LAYOUT_default( + QALL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_HOME, KC_END, RESET, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, TO(2), _______, _______, _______, _______, _______, _______ + + ), + +/* Windows layer +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE | HOME | END | P UP | P DOWN | MENU | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | BACK | NUM | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________| + | +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | TO | | | | | | | +| L GUI | L ALT | L CTL | SPACE | R CTL | R ALT |LAYER 0 | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + + [_WINDOWS] = LAYOUT_default( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_MENU, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LGUI, KC_LALT, KC_LCTL, KC_SPC, KC_RCTL, KC_RALT, TO(0), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT + ), +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch (keycode) { + // dynamically generate these. + case EXPOSE: + SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_UP) SS_UP(X_LCTRL)); + return false; + case LAUNCH: + SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_L) SS_UP(X_LCTRL)); + return false; + case DOCK: + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LGUI) SS_TAP(X_D) SS_UP(X_LGUI) SS_UP(X_LALT)); + return false; + case SCRCAP: //screen capture + SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_S) SS_UP(X_LCTRL)); + return false; + case CS1: //custom shortcut 1 + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LGUI) SS_TAP(X_1) SS_UP(X_LGUI) SS_UP(X_LALT)); + return false; + case CS2: //custom shortcut 2 + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LGUI) SS_TAP(X_2) SS_UP(X_LGUI) SS_UP(X_LALT)); + return false; + case QALL: //quit all applications + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LGUI) SS_TAP(X_Q) SS_UP(X_LGUI) SS_UP(X_LALT)); + return false; + } + } + return true; +}; diff --git a/keyboards/espectro/keymaps/mac/readme.md b/keyboards/espectro/keymaps/mac/readme.md new file mode 100644 index 00000000000..fb62260181c --- /dev/null +++ b/keyboards/espectro/keymaps/mac/readme.md @@ -0,0 +1,56 @@ +# This is u/TurboMech's keyboard layout for Espectro. + +## It is designed for Mac OS, due to the specific functions created. + +### Here is the layout found in the keymap.c file. +##### I use shortcuts for the Function row (above number row) listed below + - Scrn Bright Up: F14 + - Scrn Bright Down: F15 + - Expose: LCTRL + Up + - Launchpad: LCTRL + L + - Show Desktop: F11 + - Show/Hide Dock: LALT + LGUI + D + - Screen Capture: LCTRL + S + - Custom Shortcut 1: LCTRL + LGUI + 1 + - Custom Shortcut 2: LCTRL + LGUI + 2 + - use the custom shortcuts for whatever you want: launch an application, a macro, etc. + - Play/Pause: exactly that + - Mute / Volume Up / Volume Down: exactly what it says + - QALL: Quit all applications + + ##### Going down the right side from Vol Down: + - POWER: this serves as the power button on Mac's only. Press and hold the button as you would on your Macbook or iMac keyboard. + - Menu: this slides the notification bar on the right side (its the same as on iPhones/ iPads) + +### See below keymaps for how to setup shortcuts on Mac + +#### Base Layer +``` +Needs updating. +``` +#### Function Layer 1 - See above for shortcuts +``` +Needs updating +``` + +#### How to use/ setup shortcuts on Mac +- First navigate to System Preferences > Keyboard > Shortcuts + - You can use any of them in here + - Just set them to the shortcut keys listed above + +#### How to make your own (to launch applications, quit all, etc.) +- Navigate to Automator > New Document > click Service > Choose +- Now we have to setup our shortcut + - Here's how to setup the Quit All Shortcut + - In the right window select the Service recieves dropdown > select No Input + - At the top left click the Name (Search) > type quit > click and hold Quit All Applications > drag to the right hand box (under the Service Recieves) + - **IMPORTANT** You have to click the Run button at the upper right hand corner in order for these to actually work. + - Now click File > Save > save it as Quit All Apps (or whatever you want) / you can also just exit out and it'll ask you if you want to save +- Navigate back to System Preferences > Keyboard > Shortcuts + - The new shortcut can be found under services, set it to one of the shortcuts I listed above and done +- The same applies for applications in the Name (search) just type the application you want to have as shortcut. Don't forget to run it, then do the same steps + to set it up as a shortcut. + + + + diff --git a/keyboards/espectro/keymaps/mapdev/keymap.c b/keyboards/espectro/keymaps/mapdev/keymap.c new file mode 100644 index 00000000000..89d412b2dd1 --- /dev/null +++ b/keyboards/espectro/keymaps/mapdev/keymap.c @@ -0,0 +1,87 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include QMK_KEYBOARD_H + +#define _BL 0 //Base layer +#define _FN1 1 //Function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BL +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | P SCN | HOME | END | P UP | P DOWN | DEL | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | BACK | NUM | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________| + | +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | MO | | | | | | | +| CTRL | LGUI | L ALT | SPACE | R ALT | R CTRL | _FN | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_BL] = LAYOUT_default( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_VOLU, KC_HOME, KC_END, KC_PGUP, KC_PGDN, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + MO(_FN1), KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, _______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT + ), + +/* FN_1 +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | VOL | VOL | NEXT | | | +| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | | | | | | DELETE | | | | | +|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| +| | BACK | BACK | | | | | | | | | | | | | | | | +| | LIGHT | LIGHT | | | | | | | | | | | | | | | | +|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|_____________|________|________|________| | +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| | +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_FN1] = LAYOUT_default( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, KC_END, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + diff --git a/keyboards/espectro/keymaps/mikethetiger/keymap.c b/keyboards/espectro/keymaps/mikethetiger/keymap.c new file mode 100644 index 00000000000..e594184ca53 --- /dev/null +++ b/keyboards/espectro/keymaps/mikethetiger/keymap.c @@ -0,0 +1,88 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include QMK_KEYBOARD_H + +#define _BL 0 //Base layer +#define _FN1 1 //Function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BL +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | PRT SC | SCR LK | PAUSE | P UP | P DOWN | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | BACK | NUM | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________| + | +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | MO | | | | | | | +| CTRL | LGUI | L ALT | SPACE | VOL Dn | VOL Up | _FN | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_BL] = LAYOUT_default( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_PSCR, KC_SLCK, KC_PAUS, KC_PGUP, KC_PGDN, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_VOLD, KC_VOLU, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + +/* FN_1 +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | VOL | VOL | NEXT | | | +| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | SAT | | | | | DELETE | | | | | +|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| +| | BACK | BACK | | | | | | | | | | | | | | | | +| | LIGHT | LIGHT | | | | | | | | | | | | | | | | +|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|_____________|________|________|________| | +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| | +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_FN1] = LAYOUT_default( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END, \ + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + +}; + diff --git a/keyboards/espectro/readme.md b/keyboards/espectro/readme.md new file mode 100644 index 00000000000..c4c0edc7f74 --- /dev/null +++ b/keyboards/espectro/readme.md @@ -0,0 +1,15 @@ +# Espectro + +![Espectro](https://cdn.shopify.com/s/files/1/1697/5323/products/IMG_0162_53a5ca83-3ce5-4741-92e8-10f769cf5ee1_1024x1024.jpg?v=1540701787) + +A 96% keyboard made and sold by MECHKEYS [More info on MECHKEYS](https://mechkeys.ca). + +Keyboard Maintainer: [TurboMech](https://github.com/TurboMech) +Hardware Supported: Espectro +Hardware Availability: [MECHKEYS](https://mechkeys.ca) + +Make example for this keyboard (after setting up your build environment): + + make espectro:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/espectro/rules.mk b/keyboards/espectro/rules.mk new file mode 100755 index 00000000000..2c28fe8504e --- /dev/null +++ b/keyboards/espectro/rules.mk @@ -0,0 +1,61 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes diff --git a/keyboards/evil80/config.h b/keyboards/evil80/config.h index 81138a7703c..ae507c74f9c 100644 --- a/keyboards/evil80/config.h +++ b/keyboards/evil80/config.h @@ -32,7 +32,7 @@ #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -40,11 +40,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/evil80/rules.mk b/keyboards/evil80/rules.mk index 1067b43445b..d86594f98f1 100644 --- a/keyboards/evil80/rules.mk +++ b/keyboards/evil80/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/exclusive/e6_rgb/config.h b/keyboards/exclusive/e6_rgb/config.h new file mode 100644 index 00000000000..cb213c25e20 --- /dev/null +++ b/keyboards/exclusive/e6_rgb/config.h @@ -0,0 +1,65 @@ +/** + * config.h + * + */ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xDEAD +#define PRODUCT_ID 0xFEED +#define DEVICE_VER 0x0062 +#define MANUFACTURER astro +#define PRODUCT e6rgb +#define DESCRIPTION 60% rgb keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 +/* key matrix pins */ +#define MATRIX_ROW_PINS { F1, F4, F5, F6, D6 } +#define MATRIX_COL_PINS { D7, B4, B5, B6, C6, C7, F7, F0, B0, B1, D2, D3, B3, B2 } +#define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +//rgb light setting +#define RGBLED_NUM 6 +#define RGB_DI_PIN B7 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#define DRIVER_ADDR_1 0b1010000 +#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 63 +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + +// tapping setting +#define TAPPING_TERM 200 +#define RETRO_TAPPING +#define PERMISSIVE_HOLD diff --git a/keyboards/exclusive/e6_rgb/e6_rgb.c b/keyboards/exclusive/e6_rgb/e6_rgb.c new file mode 100644 index 00000000000..106e58497ee --- /dev/null +++ b/keyboards/exclusive/e6_rgb/e6_rgb.c @@ -0,0 +1,192 @@ +/** + * e6_rgb.c + */ + +#include "e6_rgb.h" + +#ifdef RGB_MATRIX_ENABLE +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { + setPinOutput(D5); + writePinHigh(D5); +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ +//cs1 + {0, K_1, J_1, L_1}, + {0, H_1, G_1, I_1}, + {0, E_1, D_1, F_1}, + {0, B_1, A_1, C_1}, + +//cs2 + {0, K_2, J_2, L_2}, + {0, H_2, G_2, I_2}, + {0, E_2, D_2, F_2}, + {0, B_2, A_2, C_2}, +//cs3 + {0, K_3, J_3, L_3}, + {0, H_3, G_3, I_3}, + {0, E_3, D_3, F_3}, + {0, B_3, A_3, C_3}, +//cs4 + {0, K_4, J_4, L_4}, + {0, H_4, G_4, I_4}, + {0, E_4, D_4, F_4}, + {0, B_4, A_4, C_4}, +//cs5 + {0, K_5, J_5, L_5}, + {0, H_5, G_5, I_5}, + {0, E_5, D_5, F_5}, + {0, B_5, A_5, C_5}, +//cs6 + {0, K_6, J_6, L_6}, + {0, H_6, G_6, I_6}, + {0, E_6, D_6, F_6}, + {0, B_6, A_6, C_6}, +//cs7 + {0, K_7, J_7, L_7}, + {0, H_7, G_7, I_7}, + {0, E_7, D_7, F_7}, + {0, B_7, A_7, C_7}, +//cs8 + {0, K_8, J_8, L_8}, + {0, H_8, G_8, I_8}, + {0, E_8, D_8, F_8}, + {0, B_8, A_8, C_8}, +//cs9 + {0, K_9, J_9, L_9}, + {0, H_9, G_9, I_9}, + {0, E_9, D_9, F_9}, + {0, B_9, A_9, C_9}, +//cs10 + {0, K_10, J_10, L_10}, + {0, H_10, G_10, I_10}, + {0, E_10, D_10, F_10}, + {0, B_10, A_10, C_10}, +//cs11 + {0, K_11, J_11, L_11}, + {0, H_11, G_11, I_11}, + {0, E_11, D_11, F_11}, + {0, B_11, A_11, C_11}, +//cs12 + {0, K_12, J_12, L_12}, + {0, H_12, G_12, I_12}, + {0, E_12, D_12, F_12}, + {0, B_12, A_12, C_12}, +//cs13 + {0, K_13, J_13, L_13}, + {0, H_13, G_13, I_13}, + {0, E_13, D_13, F_13}, + {0, B_13, A_13, C_13}, +//cs14 + {0, K_14, J_14, L_14}, + {0, H_14, G_14, I_14}, + {0, E_14, D_14, F_14}, + {0, B_14, A_14, C_14}, +//cs15 + {0, K_15, J_15, L_15}, + + {0, E_15, D_15, F_15}, + {0, B_15, A_15, C_15}, +//cs16 + {0, K_16, J_16, L_16}, + {0, H_16, G_16, I_16}, + {0, E_16, D_16, F_16}, + {0, B_16, A_16, C_16}, +}; + +led_config_t g_led_config = { { + { 0, 1, 4, 5, 12, 13, 36, 20, 21, 24, 25, 16, 17, 28 }, + { 2, 6, 7, 14, 15, 37, 38, 22, 23, 26, 27, 18, 19, 30 }, + { 3, 8, 9, 32, 33, 39, 40, 44, 45, 48, 49, 52, 31, NO_LED }, + { 59, 10, 11, 34, 35, 41, 42, 46, 47, 50, 53, 54, 56, NO_LED }, + { 60, 61, 62, NO_LED, NO_LED, 43, 51, 55, 58, 57, NO_LED, NO_LED, NO_LED, NO_LED } +}, { +//cs1 + { 0, 0 }, { 17, 0 }, { 0, 16 }, { 0, 32 }, +//cs2 + { 34, 0 }, { 51, 0 }, { 17, 16 }, { 34, 16 }, +//cs3 + { 17, 32 }, { 34, 32 }, { 17, 48 }, { 34, 48 }, +//cs4 + { 68, 0 }, { 85, 0 }, { 51, 16 }, { 68, 16 }, +//cs5 + { 187, 0 }, { 204, 0 }, { 187, 16 }, { 204, 16 }, +//cs6 + { 119, 0 }, { 136, 0 }, { 119, 16 }, { 136, 16 }, +//cs7 + { 153, 0 }, { 170, 0 }, { 153, 16 }, { 170, 16 }, +//cs8 + { 221, 0 }, { 221, 0 }, { 221, 32 }, { 221, 16 }, +//cs9 + { 51, 32 }, { 68, 32 }, { 51, 48 }, { 68, 48 }, +//cs10 + { 102, 0 }, { 85, 16 }, { 102, 16 }, { 85, 32 }, +//cs11 + { 102, 32 }, { 85, 48 }, { 102, 48 }, { 102, 64 }, +//cs12 + { 119, 32 }, { 136, 32 }, { 119, 48 }, { 136, 48 }, +//cs13 + { 153, 32 }, { 170, 32 }, { 153, 48 }, { 136, 48 }, +//cs14 + { 187, 32 }, { 170, 48 }, { 187, 48 }, { 153, 48 }, +//cs15 + { 221, 48 }, { 221, 64 }, { 204, 64 }, +//cs16 + { 0, 48 }, { 0, 64 }, { 17, 64 }, { 34, 64 } +}, { +//cs1 + 1, 4, 1, 1, +//cs2 + 4, 4, 4, 4, +//cs3 + 4, 4, 4, 4, +//cs4 + 4, 4, 4, 4, +//cs5 + 4, 4, 4, 4, +//cs6 + 4, 4, 4, 4, +//cs7 + 4, 4, 4, 4, +//cs8 + 4, 4, 1, 1, +//cs9 + 4, 4, 4, 4, +//cs10 + 4, 4, 4, 4, +//cs11 + 4, 4, 4, 4, +//cs12 + 4, 4, 4, 4, +//cs13 + 4, 4, 4, 1, +//cs14 + 4, 4, 1, 1, +//cs15 + 1, 1, 1, +//cs16 + 1, 1, 1, 1 +} }; + +#endif diff --git a/keyboards/exclusive/e6_rgb/e6_rgb.h b/keyboards/exclusive/e6_rgb/e6_rgb.h new file mode 100644 index 00000000000..01f700c0097 --- /dev/null +++ b/keyboards/exclusive/e6_rgb/e6_rgb.h @@ -0,0 +1,83 @@ + /** + * e6_rgb.h + * + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT_60_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ + k40, k42, k43, k47, k48, k49, k4a, k4b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k0e}, \ + {k30, k32, k33, k34, k35, k36, k37, k38, KC_NO, k39, k3a, k3b, k3c, KC_NO}, \ + {k40, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, k48, k49, k4a, k4b} \ +} + +#define LAYOUT_60_wkl( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k42, k43, k47, k49, k4a, k4b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k0e}, \ + {k30, k32, k33, k34, k35, k36, k37, k38, KC_NO, k39, k3a, k3b, k3c, k3d}, \ + {k40, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, KC_NO, k49, k4a, k4b} \ +} + +#define LAYOUT_60_hhkb( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k42, k43, k47, k49, k4a \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k0e}, \ + {k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3c, k3d}, \ + {KC_NO, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, KC_NO, k49, k4a, KC_NO} \ +} +#define LAYOUT_60_wkl_split_bs( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k42, k43, k47, k49, k4a, k4b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k0e}, \ + {k30, k32, k33, k34, k35, k36, k37, k38, KC_NO, k39, k3a, k3b, k3c, k3d}, \ + {k40, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, KC_NO, k49, k4a, k4b} \ +} +#define LAYOUT_60_ansi_split_bs_shift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k42, k43, k47, k48, k49, k4a, k4b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k0e}, \ + {k30, k32, k33, k34, k35, k36, k37, k38, KC_NO, k39, k3a, k3b, k3c, k3d}, \ + {k40, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, k48, k49, k4a, k4b} \ +} diff --git a/keyboards/exclusive/e6_rgb/info.json b/keyboards/exclusive/e6_rgb/info.json new file mode 100644 index 00000000000..80f3610029f --- /dev/null +++ b/keyboards/exclusive/e6_rgb/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "e6_rgb", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_wkl": { + "key_count":61, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + "LAYOUT_60_ansi": { + "key_count":61, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_hhkb": { + "key_count":60, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}] + } + } +} diff --git a/keyboards/exclusive/e6_rgb/keymaps/60_ansi/keymap.c b/keyboards/exclusive/e6_rgb/keymaps/60_ansi/keymap.c new file mode 100644 index 00000000000..0f7f09f5516 --- /dev/null +++ b/keyboards/exclusive/e6_rgb/keymaps/60_ansi/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BSp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0| + * |-----------------------------------------------------------' + * |Ctrl |Gui|Alt | Space |Alt |Gui|Fn |Ctrl | + * `-----------------------------------------------------------' + */ + [0] = LAYOUT_60_ansi( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS,\ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + [1] = LAYOUT_60_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,\ + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______,_______,_______, _______, _______,_______,_______,_______), +}; diff --git a/keyboards/exclusive/e6_rgb/keymaps/60_ansi_split_bs_shift/keymap.c b/keyboards/exclusive/e6_rgb/keymaps/60_ansi_split_bs_shift/keymap.c new file mode 100644 index 00000000000..1ecde0089ce --- /dev/null +++ b/keyboards/exclusive/e6_rgb/keymaps/60_ansi_split_bs_shift/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi_split_bs_shift( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS, KC_GRV,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC,\ + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_END,\ + KC_CAPS, KC_LGUI, KC_LALT, LT(1,KC_SPC), KC_RALT, KC_RGUI, TG(1), KC_RCTL), + [1] = LAYOUT_60_ansi_split_bs_shift( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,KC_PSCR,\ + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,\ + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______,_______,_______, _______, _______,_______,TG(0),_______), +}; diff --git a/keyboards/exclusive/e6_rgb/keymaps/60_hhkb/keymap.c b/keyboards/exclusive/e6_rgb/keymaps/60_hhkb/keymap.c new file mode 100644 index 00000000000..e1d2cca3728 --- /dev/null +++ b/keyboards/exclusive/e6_rgb/keymaps/60_hhkb/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_hhkb( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS, KC_GRV,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC,\ + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_BSLS,\ + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1)), + [1] = LAYOUT_60_hhkb( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,_______,\ + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______,_______, _______, _______,_______), +}; diff --git a/keyboards/exclusive/e6_rgb/keymaps/60_wkl/keymap.c b/keyboards/exclusive/e6_rgb/keymaps/60_wkl/keymap.c new file mode 100644 index 00000000000..e149c7f06ba --- /dev/null +++ b/keyboards/exclusive/e6_rgb/keymaps/60_wkl/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_wkl( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC,\ + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_DEL,\ + KC_CAPS, KC_LGUI, KC_LALT, LT(1,KC_SPC), KC_RALT, TG(1), KC_RCTL), + [1] = LAYOUT_60_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,KC_DEL,\ + RESET, RGB_TOG, RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,\ + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______,_______,_______, _______, _______,TG(0),_______), +}; diff --git a/keyboards/exclusive/e6_rgb/keymaps/60_wkl_split_bs/keymap.c b/keyboards/exclusive/e6_rgb/keymaps/60_wkl_split_bs/keymap.c new file mode 100644 index 00000000000..d9a7885eb8d --- /dev/null +++ b/keyboards/exclusive/e6_rgb/keymaps/60_wkl_split_bs/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_wkl_split_bs( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS, KC_GRV,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC,\ + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_END,\ + KC_CAPS, KC_LGUI, KC_LALT, LT(1,KC_SPC), KC_RALT, TG(1), KC_RCTL), + [1] = LAYOUT_60_wkl_split_bs( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,KC_PSCR,\ + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,\ + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______,_______,_______, _______, _______,TG(0),_______), +}; diff --git a/keyboards/exclusive/e6_rgb/keymaps/default/keymap.c b/keyboards/exclusive/e6_rgb/keymaps/default/keymap.c new file mode 100644 index 00000000000..0f7f09f5516 --- /dev/null +++ b/keyboards/exclusive/e6_rgb/keymaps/default/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BSp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0| + * |-----------------------------------------------------------' + * |Ctrl |Gui|Alt | Space |Alt |Gui|Fn |Ctrl | + * `-----------------------------------------------------------' + */ + [0] = LAYOUT_60_ansi( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS,\ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + [1] = LAYOUT_60_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,\ + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______,_______,_______, _______, _______,_______,_______,_______), +}; diff --git a/keyboards/exclusive/e6_rgb/readme.md b/keyboards/exclusive/e6_rgb/readme.md new file mode 100644 index 00000000000..b252ab53b4f --- /dev/null +++ b/keyboards/exclusive/e6_rgb/readme.md @@ -0,0 +1,12 @@ +# e6 pcb with rgb + +A full rgb pcb for exclusive E6V1&V2 + +Keyboard Maintainer: [astro](https://github.com/yulei) +Hardware Supported: E6V1, E6V2 + +Make example for this keyboard (after setting up your build environment): + + make exclusive/e6_rgb:60_ansi + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/exclusive/e6_rgb/rules.mk b/keyboards/exclusive/e6_rgb/rules.mk new file mode 100644 index 00000000000..9e4e0f58f5f --- /dev/null +++ b/keyboards/exclusive/e6_rgb/rules.mk @@ -0,0 +1,77 @@ +# MCU name +MCU = atmega32u4 + +# project specific files +#SRC = + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu +#OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +#OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +#RGBLIGHT_ENABLE = yes # Use RGB bottom light +RGB_MATRIX_ENABLE = IS31FL3733# Use RGB matrix +LAYOUTS = 60_ansi 60_hhkb diff --git a/keyboards/exclusive/e6v2/le/config.h b/keyboards/exclusive/e6v2/le/config.h new file mode 100644 index 00000000000..6477d5364ab --- /dev/null +++ b/keyboards/exclusive/e6v2/le/config.h @@ -0,0 +1,59 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Exclusive / E-Team +#define PRODUCT E6-V2 LE +#define DESCRIPTION E6-V2 LE QMK PCB (Mid-Port) + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* QMK E6-V2 PCB default pin-out */ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } +#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } +#define UNUSED_PINS + +#define RGB_DI_PIN E6 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_VAL_STEP 12 +#endif + +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 2 +#define BACKLIGHT_BREAHTING +#define BREATHING_PERIOD 3 +#endif + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCE 5 + +#endif diff --git a/keyboards/e6v2/le/info.json b/keyboards/exclusive/e6v2/le/info.json similarity index 100% rename from keyboards/e6v2/le/info.json rename to keyboards/exclusive/e6v2/le/info.json diff --git a/keyboards/e6v2/le/keymaps/default/keymap.c b/keyboards/exclusive/e6v2/le/keymaps/default/keymap.c similarity index 100% rename from keyboards/e6v2/le/keymaps/default/keymap.c rename to keyboards/exclusive/e6v2/le/keymaps/default/keymap.c diff --git a/keyboards/e6v2/le/keymaps/eric/keymap.c b/keyboards/exclusive/e6v2/le/keymaps/eric/keymap.c similarity index 100% rename from keyboards/e6v2/le/keymaps/eric/keymap.c rename to keyboards/exclusive/e6v2/le/keymaps/eric/keymap.c diff --git a/keyboards/e6v2/le/keymaps/johu/keymap.c b/keyboards/exclusive/e6v2/le/keymaps/johu/keymap.c similarity index 100% rename from keyboards/e6v2/le/keymaps/johu/keymap.c rename to keyboards/exclusive/e6v2/le/keymaps/johu/keymap.c diff --git a/keyboards/e6v2/le/keymaps/johu/readme.md b/keyboards/exclusive/e6v2/le/keymaps/johu/readme.md similarity index 100% rename from keyboards/e6v2/le/keymaps/johu/readme.md rename to keyboards/exclusive/e6v2/le/keymaps/johu/readme.md diff --git a/keyboards/e6v2/le/le.c b/keyboards/exclusive/e6v2/le/le.c similarity index 100% rename from keyboards/e6v2/le/le.c rename to keyboards/exclusive/e6v2/le/le.c diff --git a/keyboards/e6v2/le/le.h b/keyboards/exclusive/e6v2/le/le.h similarity index 100% rename from keyboards/e6v2/le/le.h rename to keyboards/exclusive/e6v2/le/le.h diff --git a/keyboards/exclusive/e6v2/le/readme.md b/keyboards/exclusive/e6v2/le/readme.md new file mode 100644 index 00000000000..b57bb016048 --- /dev/null +++ b/keyboards/exclusive/e6v2/le/readme.md @@ -0,0 +1,19 @@ +# E6-V2 Last Edition (LE) + +These docs are for the QMK version of the E6-V2 PCB. [More info on qmk.fm](http://qmk.fm/) + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: E6-V2 LE Mid Port rev.qmk +Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0) + +**Please do not flash LE firmware on OE hardware.** + +Make example for this keyboard (after setting up your build environment): + + make exclusive/e6v2/le:default + +Or to make and flash: + + make exclusive/e6v2/le:default:dfu + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/exclusive/e6v2/le/rules.mk b/keyboards/exclusive/e6v2/le/rules.mk new file mode 100644 index 00000000000..ffad52dbc55 --- /dev/null +++ b/keyboards/exclusive/e6v2/le/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + +LAYOUTS = 60_ansi diff --git a/keyboards/exclusive/e6v2/le_bmc/config.h b/keyboards/exclusive/e6v2/le_bmc/config.h new file mode 100644 index 00000000000..d0b976c1ec2 --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/config.h @@ -0,0 +1,49 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER exclusive +#define PRODUCT e6v2 le bmc +#define DESCRIPTION A custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 11 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + +// 0 1 2 3 4 5 6 7 8 9 A +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, C2, C3, C4, C5, D7 } +#define DIODE_DIRECTION COL2ROW + +#define RGBLED_NUM 6 +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/exclusive/e6v2/le_bmc/info.json b/keyboards/exclusive/e6v2/le_bmc/info.json new file mode 100644 index 00000000000..aa6d171ba87 --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/info.json @@ -0,0 +1,24 @@ +{ + "keyboard_name": "", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.26}, {"x":10.0, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + }, + + "LAYOUT_60_tsangan": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.5}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}, {"x":13.5, "y":4, "w":1.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/exclusive/e6v2/le_bmc/keymaps/default/config.h b/keyboards/exclusive/e6v2/le_bmc/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/exclusive/e6v2/le_bmc/keymaps/default/keymap.c b/keyboards/exclusive/e6v2/le_bmc/keymaps/default/keymap.c new file mode 100644 index 00000000000..73004191765 --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/keymaps/default/keymap.c @@ -0,0 +1,74 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(1) + ), + +[1] = LAYOUT_60_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + BL_TOGG, BL_INC, BL_DEC, BL_STEP, RESET, EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/exclusive/e6v2/le_bmc/keymaps/default/readme.md b/keyboards/exclusive/e6v2/le_bmc/keymaps/default/readme.md new file mode 100644 index 00000000000..4a1b6efa62c --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for bmc diff --git a/keyboards/exclusive/e6v2/le_bmc/le_bmc.c b/keyboards/exclusive/e6v2/le_bmc/le_bmc.c new file mode 100644 index 00000000000..5f7ef25b227 --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/le_bmc.c @@ -0,0 +1,88 @@ +/* Copyright 2018 amnesia0287 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rgblight.h" +#include "i2c_master.h" +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +void matrix_init_kb(void) { +#ifdef RGBLIGHT_ENABLE + if (rgblight_config.enable) { + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + } +#endif + // call user level keymaps, if any + matrix_init_user(); +} + +void matrix_scan_kb(void) { +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif + matrix_scan_user(); + /* Nothing else for now. */ +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // turn backlight LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} \ No newline at end of file diff --git a/keyboards/exclusive/e6v2/le_bmc/le_bmc.h b/keyboards/exclusive/e6v2/le_bmc/le_bmc.h new file mode 100644 index 00000000000..2328690ad34 --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/le_bmc.h @@ -0,0 +1,103 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +// LAYOUT_all ignores the key often coded as ~# to the left of Enter on ISO layouts. +// This is done as it shares the same row AND col as the pipe key. + +#define LAYOUT_all( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k52, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k53, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, k54, \ + k00, k01, k02, k65, k04, k08, k09, k05 \ +) \ +{ \ + { k00, k01, k02, KC_NO, k04, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, k53, k54, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, k65, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, KC_NO, k76, k77, k78, KC_NO, k7A }, \ +} + + +#define LAYOUT_60_ansi( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, \ + k00, k01, k02, k65, k04, k08, k09, k05 \ +) \ +{ \ + { k00, k01, k02, KC_NO, k04, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, k65, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, KC_NO, k76, k77, k78, KC_NO, k7A }, \ +} + +#define LAYOUT_60_hhkb( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k52, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, k54, \ + k01, k02, k65, k08, k09 \ +) \ +{ \ + { KC_NO, k01, k02, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, KC_NO, k54, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, k65, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, KC_NO, k76, k77, k78, KC_NO, k7A }, \ +} + +#define LAYOUT_60_tsangan( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k52, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, k54, \ + k00, k01, k02, k65, k08, k09, k05 \ +) \ +{ \ + { k00, k01, k02, KC_NO, KC_NO, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, KC_NO, k54, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, k65, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, KC_NO, k76, k77, k78, KC_NO, k7A }, \ +} diff --git a/keyboards/exclusive/e6v2/le_bmc/readme.md b/keyboards/exclusive/e6v2/le_bmc/readme.md new file mode 100644 index 00000000000..4dc8e6ef512 --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/readme.md @@ -0,0 +1,44 @@ +# E6-V2 Bootmapper Client (ps2avrgb) LE + +These docs are for the BMC version of the E6-V2 PCB sold during Round 2 which has an atmega32a microcontroller. Please do not flash this `.hex` file on your atmega32u4 equipped E6-V2 or your E6V2 BMC from Round 1. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: ps2avrgb E6-V2 with atmega32a microcontroller +Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0) + +Make example for this keyboard (after setting up your build environment): + + make exclusive/e6v2/le_bmc:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +**Reset Key:** Hold down the key located at `K00`, commonly programmed as left control while plugging in the keyboard. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/exclusive/e6v2/le_bmc/rules.mk b/keyboards/exclusive/e6v2/le_bmc/rules.mk new file mode 100644 index 00000000000..a9156adeb5f --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/rules.mk @@ -0,0 +1,89 @@ +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 12000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +# ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +# F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS = -DDEBUG_LEVEL=0 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = bootloadHID + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_CUSTOM_DRIVER = yes +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SRC += i2c_master.c + +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/exclusive/e6v2/le_bmc/usbconfig.h b/keyboards/exclusive/e6v2/le_bmc/usbconfig.h new file mode 100644 index 00000000000..f22f2b631db --- /dev/null +++ b/keyboards/exclusive/e6v2/le_bmc/usbconfig.h @@ -0,0 +1,393 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'E', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e' +#define USB_CFG_VENDOR_NAME_LEN 9 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'E', '6', 'V', '2' +#define USB_CFG_DEVICE_NAME_LEN 4 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect diff --git a/keyboards/exclusive/e6v2/oe/config.h b/keyboards/exclusive/e6v2/oe/config.h new file mode 100644 index 00000000000..9206916d347 --- /dev/null +++ b/keyboards/exclusive/e6v2/oe/config.h @@ -0,0 +1,59 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Exclusive / E-Team +#define PRODUCT E6-V2 +#define DESCRIPTION E6-V2 QMK PCB (Mid-Port) + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* QMK E6-V2 PCB default pin-out */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { C7, C6, B5, B4, D7, D6, D4, F6, F7, F5, F4, F1, F0, B0, B1 } +#define UNUSED_PINS { E6, B2, B3, B7 } + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_VAL_STEP 12 +#endif + +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 5 +#define BACKLIGHT_BREAHTING +#define BREATHING_PERIOD 3 +#endif + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCE 5 + +#endif diff --git a/keyboards/e6v2/oe/info.json b/keyboards/exclusive/e6v2/oe/info.json similarity index 100% rename from keyboards/e6v2/oe/info.json rename to keyboards/exclusive/e6v2/oe/info.json diff --git a/keyboards/e6v2/oe/keymaps/amnesia0287/keymap.c b/keyboards/exclusive/e6v2/oe/keymaps/amnesia0287/keymap.c similarity index 100% rename from keyboards/e6v2/oe/keymaps/amnesia0287/keymap.c rename to keyboards/exclusive/e6v2/oe/keymaps/amnesia0287/keymap.c diff --git a/keyboards/e6v2/oe/keymaps/amnesia0287/readme.md b/keyboards/exclusive/e6v2/oe/keymaps/amnesia0287/readme.md similarity index 100% rename from keyboards/e6v2/oe/keymaps/amnesia0287/readme.md rename to keyboards/exclusive/e6v2/oe/keymaps/amnesia0287/readme.md diff --git a/keyboards/e6v2/oe/keymaps/default/keymap.c b/keyboards/exclusive/e6v2/oe/keymaps/default/keymap.c similarity index 100% rename from keyboards/e6v2/oe/keymaps/default/keymap.c rename to keyboards/exclusive/e6v2/oe/keymaps/default/keymap.c diff --git a/keyboards/e6v2/oe/keymaps/default/readme.md b/keyboards/exclusive/e6v2/oe/keymaps/default/readme.md similarity index 100% rename from keyboards/e6v2/oe/keymaps/default/readme.md rename to keyboards/exclusive/e6v2/oe/keymaps/default/readme.md diff --git a/keyboards/e6v2/oe/oe.c b/keyboards/exclusive/e6v2/oe/oe.c similarity index 100% rename from keyboards/e6v2/oe/oe.c rename to keyboards/exclusive/e6v2/oe/oe.c diff --git a/keyboards/e6v2/oe/oe.h b/keyboards/exclusive/e6v2/oe/oe.h similarity index 100% rename from keyboards/e6v2/oe/oe.h rename to keyboards/exclusive/e6v2/oe/oe.h diff --git a/keyboards/exclusive/e6v2/oe/readme.md b/keyboards/exclusive/e6v2/oe/readme.md new file mode 100644 index 00000000000..9d5dd626153 --- /dev/null +++ b/keyboards/exclusive/e6v2/oe/readme.md @@ -0,0 +1,19 @@ +# E6-V2 Original Edition (OE) + +These docs are for the QMK version of the E6-V2 PCB. [More info on qmk.fm](http://qmk.fm/) + +Keyboard Maintainer: [amnesia0287](https://github.com/amnesia0287) +Hardware Supported: E6-V2 OE Mid Port rev.qmk +Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0) + +**Please do not flash OE firmware on LE hardware.** + +Make example for this keyboard (after setting up your build environment): + + make e6v2/oe:default + +Or to make and flash: + + make e6v2/oe:default:dfu + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/exclusive/e6v2/oe/rules.mk b/keyboards/exclusive/e6v2/oe/rules.mk new file mode 100644 index 00000000000..ffad52dbc55 --- /dev/null +++ b/keyboards/exclusive/e6v2/oe/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + +LAYOUTS = 60_ansi diff --git a/keyboards/exclusive/e6v2/oe_bmc/config.h b/keyboards/exclusive/e6v2/oe_bmc/config.h new file mode 100644 index 00000000000..fc7c91ca665 --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/config.h @@ -0,0 +1,49 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER exclusive +#define PRODUCT e6v2 oe bmc +#define DESCRIPTION A custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 11 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + +// 0 1 2 3 4 5 6 7 8 9 A +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, C2, C3, C4, C5, D7 } +#define DIODE_DIRECTION COL2ROW + +#define RGBLED_NUM 6 +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/exclusive/e6v2/oe_bmc/info.json b/keyboards/exclusive/e6v2/oe_bmc/info.json new file mode 100644 index 00000000000..aa6d171ba87 --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/info.json @@ -0,0 +1,24 @@ +{ + "keyboard_name": "", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.26}, {"x":10.0, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + }, + + "LAYOUT_60_tsangan": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.5}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}, {"x":13.5, "y":4, "w":1.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/config.h b/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/keymap.c b/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/keymap.c new file mode 100644 index 00000000000..73004191765 --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/keymap.c @@ -0,0 +1,74 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(1) + ), + +[1] = LAYOUT_60_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + BL_TOGG, BL_INC, BL_DEC, BL_STEP, RESET, EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/readme.md b/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/readme.md new file mode 100644 index 00000000000..4a1b6efa62c --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for bmc diff --git a/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c new file mode 100644 index 00000000000..5357550ae12 --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c @@ -0,0 +1,96 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "oe_bmc.h" +#include "rgblight.h" +#include "i2c_master.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // turn RGB LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} diff --git a/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.h b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.h new file mode 100644 index 00000000000..44c02c8600f --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.h @@ -0,0 +1,101 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +// LAYOUT_all ignores the key often coded as ~# to the left of Enter on ISO layouts. +// This is done as it shares the same row AND col as the pipe key. +#define LAYOUT_all( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k52, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k53, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, k54, \ + k00, k01, k02, k75, k04, k08, k09, k05 \ +) \ +{ \ + { k00, k01, k02, KC_NO, k04, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, k53, k54, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, KC_NO, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, k75, k76, k77, k78, KC_NO, k7A }, \ +} + +#define LAYOUT_60_ansi( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, \ + k00, k01, k02, k75, k04, k08, k09, k05 \ +) \ +{ \ + { k00, k01, k02, KC_NO, k04, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, KC_NO, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, k75, k76, k77, k78, KC_NO, k7A }, \ +} + +#define LAYOUT_60_hhkb( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k52, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, k54, \ + k01, k02, k75, k08, k09 \ +) \ +{ \ + { KC_NO, k01, k02, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, KC_NO, k54, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, KC_NO, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, k75, k76, k77, k78, KC_NO, k7A }, \ +} + +#define LAYOUT_60_tsangan( \ + k50, k41, k42, k43, k44, k45, k61, k68, k78, k71, k49, k48, k47, k52, k4A, \ + k30, k31, k32, k33, k34, k35, k62, k67, k77, k72, k39, k38, k37, k36, \ + k20, k21, k22, k23, k24, k25, k63, k66, k76, k73, k29, k28, k26, \ + k10, k11, k12, k13, k14, k15, k64, k6A, k7A, k74, k19, k18, k54, \ + k00, k01, k02, k75, k08, k09, k05 \ +) \ +{ \ + { k00, k01, k02, KC_NO, KC_NO, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, KC_NO, k54, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, k61, k62, k63, k64, KC_NO, k66, k67, k68, KC_NO, k6A }, \ + { KC_NO, k71, k72, k73, k74, k75, k76, k77, k78, KC_NO, k7A }, \ +} diff --git a/keyboards/exclusive/e6v2/oe_bmc/readme.md b/keyboards/exclusive/e6v2/oe_bmc/readme.md new file mode 100644 index 00000000000..a386abf6c0a --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/readme.md @@ -0,0 +1,44 @@ +# E6-V2 Bootmapper Client (ps2avrgb) OE + +These docs are for the BMC version of the E6-V2 PCB sold during Round 1 which has an atmega32a microcontroller. Please do not flash this `.hex` file on your atmega32u4 equipped E6-V2 or your E6V2 BMC from Round 2. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: ps2avrgb E6-V2 with atmega32a microcontroller +Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0) + +Make example for this keyboard (after setting up your build environment): + + make exclusive/e6v2/oe_bmc:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +**Reset Key:** Hold down the key located at `K00`, commonly programmed as left control while plugging in the keyboard. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/exclusive/e6v2/oe_bmc/rules.mk b/keyboards/exclusive/e6v2/oe_bmc/rules.mk new file mode 100644 index 00000000000..a9156adeb5f --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/rules.mk @@ -0,0 +1,89 @@ +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 12000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +# ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +# F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS = -DDEBUG_LEVEL=0 + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = bootloadHID + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_CUSTOM_DRIVER = yes +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SRC += i2c_master.c + +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/exclusive/e6v2/oe_bmc/usbconfig.h b/keyboards/exclusive/e6v2/oe_bmc/usbconfig.h new file mode 100644 index 00000000000..f22f2b631db --- /dev/null +++ b/keyboards/exclusive/e6v2/oe_bmc/usbconfig.h @@ -0,0 +1,393 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'E', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e' +#define USB_CFG_VENDOR_NAME_LEN 9 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'E', '6', 'V', '2' +#define USB_CFG_DEVICE_NAME_LEN 4 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect diff --git a/keyboards/exclusive/e6v2/readme.md b/keyboards/exclusive/e6v2/readme.md new file mode 100644 index 00000000000..515db082e0e --- /dev/null +++ b/keyboards/exclusive/e6v2/readme.md @@ -0,0 +1,20 @@ +# E6-V2 + +The E6-V2 is a 60% keyboard manufactured by Exclusive. + +### Round 1: +- ps2avrGB PCB and QMK powered PCB option (OE PCB) +- Center mount and side mount USB + +### Round 2 +- ps2avrGB PCB and QMK powered PCB option (LE PCB) +- Only center mount USB offered +- All brass option + +These docs are for the QMK version of the E6-V2 PCB. [More info on qmk.fm](http://qmk.fm/) + +The E6V2 has been available with either a Bootmapper Client or QMK-powered PCB. During the second round, the QMK-powered and BMC PCBs were redesigned, and used different ports and a different switch matrix. + +Please use the appropriate version when making your firmware. Flashing one in place of the other, can brick your PCB. Please be certain whether you have a OE or LE PCB. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/exclusive/e7v1/config.h b/keyboards/exclusive/e7v1/config.h new file mode 100644 index 00000000000..689d7e8621f --- /dev/null +++ b/keyboards/exclusive/e7v1/config.h @@ -0,0 +1,47 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x7050 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Exclusive / E-Team +#define PRODUCT E7-V1 +#define DESCRIPTION E7-V1 QMK PCB(LED) + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5 } +#define MATRIX_COL_PINS { B6, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7, F1 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 6 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN E6 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/exclusive/e7v1/e7v1.c b/keyboards/exclusive/e7v1/e7v1.c new file mode 100644 index 00000000000..381585e6cfb --- /dev/null +++ b/keyboards/exclusive/e7v1/e7v1.c @@ -0,0 +1,25 @@ +#include "e7v1.h" + +void matrix_init_kb(void) { + setPinOutput(F0); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + writePinHigh(F0); + } else { + writePinLow(F0); + } + + led_set_user(usb_led); +} + diff --git a/keyboards/exclusive/e7v1/e7v1.h b/keyboards/exclusive/e7v1/e7v1.h new file mode 100644 index 00000000000..2fc7acb3bab --- /dev/null +++ b/keyboards/exclusive/e7v1/e7v1.h @@ -0,0 +1,103 @@ +#pragma once + +#include "quantum.h" + +// layout with all the switches supported by the PCB +#define LAYOUT_all( \ + K000, K001, K002, K003, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, \ + K500, K501, K502, K505, K510, K511, K512, K513, K514, K515 \ +) { \ + { K000, K001, K002, K003, KC_NO, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, KC_NO }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, KC_NO }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, KC_NO, K510, K511, K512, K513, K514, K515 } \ +} + +#define LAYOUT_75_ansi( \ + K000, K001, K002, K003, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, \ + K500, K501, K502, K505, K510, K512, K513, K514, K515 \ +) { \ + { K000, K001, K002, K003, KC_NO, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, KC_NO }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, KC_NO, K510, KC_NO, K512, K513, K514, K515 } \ +} + +// Ansi layout with a 7u space bar +#define LAYOUT_75_ansi_7u( \ + K000, K001, K002, K003, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, \ + K500, K501, K505, K510, K512, K513, K514, K515 \ +) { \ + { K000, K001, K002, K003, KC_NO, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, KC_NO }, \ + { K500, K501, KC_NO, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, KC_NO, K510, KC_NO, K512, K513, K514, K515 } \ +} + +// ANSI layout with split backspace +#define LAYOUT_75_ansi_splitbs( \ + K000, K001, K002, K003, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400 , K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, \ + K500, K501, K502, K505, K510, K512, K513, K514, K515 \ +) { \ + { K000, K001, K002, K003, KC_NO, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, KC_NO }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, KC_NO, K510, KC_NO, K512, K513, K514, K515 } \ +} + +// ANSI layout with split backspace +#define LAYOUT_75_ansi_7u_splitbs( \ + K000, K001, K002, K003, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400 , K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, \ + K500, K501, K505, K510, K512, K513, K514, K515 \ +) { \ + { K000, K001, K002, K003, KC_NO, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, KC_NO }, \ + { K500, K501, KC_NO, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, KC_NO, K510, KC_NO, K512, K513, K514, K515 } \ +} + +#define LAYOUT_75_iso( \ + K000, K001, K002, K003, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K214, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, \ + K500, K501, K502, K505, K510, K512, K513, K514, K515 \ +) { \ + { K000, K001, K002, K003, KC_NO, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, KC_NO }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, KC_NO }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, KC_NO, K510, KC_NO, K512, K513, K514, K515 } \ +} diff --git a/keyboards/exclusive/e7v1/info.json b/keyboards/exclusive/e7v1/info.json new file mode 100644 index 00000000000..e675e661fa4 --- /dev/null +++ b/keyboards/exclusive/e7v1/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "E7-V1", + "url": "", + "maintainer": "masterzen", + "width": 16.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"x":13, "y":1.5}, {"label":"Backspace", "x":14, "y":1.5}, {"label":"Page Up", "x":15.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, {"label":"Page down", "x":15.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"Z", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":4.75}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5}, {"label":"Win", "x":11, "y":5.5}, {"x":12, "y":5.5}, {"label":"\u2190", "x":13.25, "y":5.75}, {"label":"\u2193", "x":14.25, "y":5.75}, {"label":"\u2192", "x":15.25, "y":5.75}] + }, + "LAYOUT_75_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Page Up", "x":15.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, {"label":"Page down", "x":15.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":4.75}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.5}, {"label":"Win", "x":11.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":13.25, "y":5.75}, {"label":"\u2193", "x":14.25, "y":5.75}, {"label":"\u2192", "x":15.25, "y":5.75}] + }, + "LAYOUT_75_ansi_7u": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"|", "x":13, "y":1.5, "w":2}, {"label":"Page Up", "x":15.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"Backspace", "x":13.5, "y":2.5, "w":1.5}, {"label":"Page down", "x":15.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":4.75}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Win", "x":1.5, "y":5.5, "w":1.5}, {"x":3, "y":5.5, "w":7}, {"label":"Alt", "x":10, "y":5.5, "w":1.5}, {"label":"Win", "x":11.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":13.25, "y":5.75}, {"label":"\u2193", "x":14.25, "y":5.75}, {"label":"\u2192", "x":15.25, "y":5.75}] }, + "LAYOUT_75_ansi_7u_splitbs": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"|", "x":13, "y":1.5}, {"label":"Del", "x":14, "y":1.5}, {"label":"Page Up", "x":15.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"Backspace", "x":13.5, "y":2.5, "w":1.5}, {"label":"Page down", "x":15.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":4.75}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Win", "x":1.5, "y":5.5, "w":1.5}, {"x":3, "y":5.5, "w":7}, {"label":"Alt", "x":10, "y":5.5, "w":1.5}, {"label":"Win", "x":11.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":13.25, "y":5.75}, {"label":"\u2193", "x":14.25, "y":5.75}, {"label":"\u2192", "x":15.25, "y":5.75}] + }, + "LAYOUT_75_iso": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Page Up", "x":15.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"Page down", "x":15.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"Z", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":4.75}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.5}, {"label":"Win", "x":11.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":13.25, "y":5.75}, {"label":"\u2193", "x":14.25, "y":5.75}, {"label":"\u2192", "x":15.25, "y":5.75}]}, + "LAYOUT_75_ansi_splitbs": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"|", "x":13, "y":1.5}, {"label":"Del", "x":14, "y":1.5}, {"label":"Page Up", "x":15.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"Backspace", "x":13.5, "y":2.5, "w":1.5}, {"label":"Page down", "x":15.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":4.75}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.5}, {"label":"Win", "x":11.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":13.25, "y":5.75}, {"label":"\u2193", "x":14.25, "y":5.75}, {"label":"\u2192", "x":15.25, "y":5.75}] + } + } +} diff --git a/keyboards/exclusive/e7v1/keymaps/ansi_splitbs/keymap.c b/keyboards/exclusive/e7v1/keymaps/ansi_splitbs/keymap.c new file mode 100644 index 00000000000..242020b20a5 --- /dev/null +++ b/keyboards/exclusive/e7v1/keymaps/ansi_splitbs/keymap.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H + +/* + * ,---------------------------------------------------------------------| + * |Esc|▓|F1 |F2 |F3 |F4 |▓|F5 |F6 |F7 |F8 |▓|F9 |F10|F11|F12|▓|Ins|▓|Del| + * |---------------------------------------------------------------------| + * |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |\ |Del|▓PgU | + * |---------------------------------------------------------------------| + * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ | ] | BSpc|▓PgDn| + * |---------------------------------------------------------------------| + * |Caps |A |S |D |F |G |H |J |K |L |; |' | Enter |▓▓▓▓▓▓▓| + * |---------------------------------------------------------------------| + * |Shft |Z |X |C |V |B |N |M |, |. |/ |Shift |▓| Up |▓▓| + * |---------------------------------------------------------------------| + * |Ctrl|GUI |Alt | Space |Alt |Fn |▓|Lt |Dn |Rt | + * `---------------------------------------------------------------------|' + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_75_ansi_splitbs( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS,KC_DEL, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_75_ansi_splitbs( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_DEC, BL_INC, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, MO(1), RGB_MOD, RGB_VAD, RGB_HUD), + + +}; diff --git a/keyboards/exclusive/e7v1/keymaps/ansi_splitbs/readme.md b/keyboards/exclusive/e7v1/keymaps/ansi_splitbs/readme.md new file mode 100644 index 00000000000..be9f4c312e2 --- /dev/null +++ b/keyboards/exclusive/e7v1/keymaps/ansi_splitbs/readme.md @@ -0,0 +1,5 @@ +# ANSI split backspace Keymap + +Split backspace ANSI keymap with a base layer and an adjust layer. + +Keymap Maintainer: [masterzen](https://github.com/amnesia0287) diff --git a/keyboards/exclusive/e7v1/keymaps/default/keymap.c b/keyboards/exclusive/e7v1/keymaps/default/keymap.c new file mode 100644 index 00000000000..189c01eca29 --- /dev/null +++ b/keyboards/exclusive/e7v1/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H + +/* + * ,---------------------------------------------------------------------| + * |Esc|▓|F1 |F2 |F3 |F4 |▓|F5 |F6 |F7 |F8 |▓|F9 |F10|F11|F12|▓|Ins|▓|Del| + * |---------------------------------------------------------------------| + * |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backspace|▓PgU | + * |---------------------------------------------------------------------| + * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ | ] | \ |▓PgDn| + * |---------------------------------------------------------------------| + * |Caps |A |S |D |F |G |H |J |K |L |; |' | Enter |▓▓▓▓▓▓▓| + * |---------------------------------------------------------------------| + * |Shft |Z |X |C |V |B |N |M |, |. |/ |Shift |▓| Up |▓▓| + * |---------------------------------------------------------------------| + * |Ctrl|GUI |Alt | Space |Alt |Fn |▓|Lt |Dn |Rt | + * `---------------------------------------------------------------------|' + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_75_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_75_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_DEC, BL_INC, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, MO(1), RGB_MOD, RGB_VAD, RGB_HUD), + + +}; diff --git a/keyboards/exclusive/e7v1/keymaps/default/readme.md b/keyboards/exclusive/e7v1/keymaps/default/readme.md new file mode 100644 index 00000000000..a6fc70a6aa8 --- /dev/null +++ b/keyboards/exclusive/e7v1/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# Default Keymap + +Default ANSI keymap with a base layer and an adjust layer. + +Keymap Maintainer: [masterzen](https://github.com/amnesia0287) diff --git a/keyboards/exclusive/e7v1/keymaps/masterzen/keymap.c b/keyboards/exclusive/e7v1/keymaps/masterzen/keymap.c new file mode 100644 index 00000000000..61a41f629ca --- /dev/null +++ b/keyboards/exclusive/e7v1/keymaps/masterzen/keymap.c @@ -0,0 +1,138 @@ +#include QMK_KEYBOARD_H + +enum layers { + BASE, // qwerty linux + OSX, // qwerty osx + + _ADJUST, // function key layer +}; + +enum keycodes { + // default layout switcher + LAY_LIN = SAFE_RANGE, + LAY_OSX +}; + +/* + * ,---------------------------------------------------------------------| + * |Esc|▓|F1 |F2 |F3 |F4 |▓|F5 |F6 |F7 |F8 |▓|F9 |F10|F11|F12|▓|Hom|▓|End| + * |---------------------------------------------------------------------| + * |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |\ |Del|▓PgU | + * |---------------------------------------------------------------------| + * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ | ] | BSpc|▓PgDn| + * |---------------------------------------------------------------------| + * |LCTRL |A |S |D |F |G |H |J |K |L |; |' | Enter |▓▓▓▓▓▓▓| + * |---------------------------------------------------------------------| + * |Shft |Z |X |C |V |B |N |M |, |. |/ |Shift |▓| Up |▓▓| + * |---------------------------------------------------------------------| + * |Ctrl|GUI |Alt | Space |Alt |Fn |▓|Lt |Dn |Rt | + * `---------------------------------------------------------------------|' + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_75_ansi_splitbs( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, LT(_ADJUST,KC_END), + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS,KC_DEL, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGDN, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT), + + [OSX] = LAYOUT_75_ansi_splitbs( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LCTL, KC_LALT, KC_LGUI, _______, KC_LGUI, KC_RALT, _______, _______, _______), + + [_ADJUST] = LAYOUT_75_ansi_splitbs( + RESET, LAY_LIN, LAY_OSX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MO(_ADJUST), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_DEC, BL_INC, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_VAD, RGB_HUD), + + +}; + +extern rgblight_config_t rgblight_config; + +bool edit = false; +uint32_t mode; +uint16_t hue; +uint8_t sat; +uint8_t val; + +void matrix_init_user(void) +{ + mode = rgblight_config.mode; +} + + +void persistent_default_layer_set(uint16_t default_layer) +{ + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { + /* layout switcher */ + case LAY_LIN: + if (record->event.pressed) + { + persistent_default_layer_set(1UL << BASE); + } + return false; + break; + case LAY_OSX: + if (record->event.pressed) + { + persistent_default_layer_set(1UL << OSX); + } + return false; + break; + case RGB_MOD: + // allows to set the rgb mode while in the ADJUST layer which uses + // its own mode + if (record->event.pressed) + { + rgblight_mode(mode); + rgblight_step(); + mode = rgblight_config.mode; + } + return false; + break; + } + return true; +} + +uint32_t layer_state_set_user(uint32_t state) +{ + if (state == BASE && edit == true) + { + hue = rgblight_get_hue(); + sat = rgblight_get_sat(); + val = rgblight_get_val(); + edit = false; + } + + switch (biton32(state)) + { + case _ADJUST: + mode = rgblight_get_mode(); + rgblight_mode_noeeprom(1); + rgblight_setrgb(0xD3, 0x7F, 0xED); + edit = true; + break; + default: + rgblight_mode(mode); + rgblight_sethsv(hue, sat, val); + break; + } + return state; +} diff --git a/keyboards/exclusive/e7v1/keymaps/masterzen/readme.md b/keyboards/exclusive/e7v1/keymaps/masterzen/readme.md new file mode 100644 index 00000000000..ee4f2a531f5 --- /dev/null +++ b/keyboards/exclusive/e7v1/keymaps/masterzen/readme.md @@ -0,0 +1,14 @@ +# masterzen's Keymap + +![masterzen keymap Layout Image](https://imgur.com/SF4UP2j) + +Keymap Maintainer: [masterzen](https://github.com/masterzen) + + +Difference from base layout: + * split backspace + * Home & End on last keys of row 0 instead of Insert/Del + * Fn is on the End key when hold + * supports both a windows/linux keymap and osx keymap + * layer change is reflected in the rgb leds of the logo + diff --git a/keyboards/exclusive/e7v1/readme.md b/keyboards/exclusive/e7v1/readme.md new file mode 100644 index 00000000000..9d1b8538b49 --- /dev/null +++ b/keyboards/exclusive/e7v1/readme.md @@ -0,0 +1,15 @@ +# E7-V1 + +![E7-V1](https://imgur.com/a/5v5pV9U) + +A 75% keyboard made by Exclusive and run in a Geekhack group buy. + +Keyboard Maintainer: [masterzen](https://github.com/masterzen) +Hardware Supported: E7 - V1 QMK PCB LED +Hardware Availability: [https://geekhack.org/index.php?topic=97182.msg2654226#msg2654226](https://geekhack.org/index.php?topic=97182.msg2654226#msg2654226) + +Make example for this keyboard (after setting up your build environment): + + make exclusive/e7v1:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/exclusive/e7v1/rules.mk b/keyboards/exclusive/e7v1/rules.mk new file mode 100644 index 00000000000..f903df7de52 --- /dev/null +++ b/keyboards/exclusive/e7v1/rules.mk @@ -0,0 +1,54 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes diff --git a/keyboards/exclusive/readme.md b/keyboards/exclusive/readme.md new file mode 100644 index 00000000000..85409c92367 --- /dev/null +++ b/keyboards/exclusive/readme.md @@ -0,0 +1,9 @@ +# Exclusive Firmware + +All files related to firmware of keyboards designed by Exclusive. + +## Keyboards + +* [e6_rgb](./e6_rgb/): maintainer [astro](https://github.com/yulei) +* [e6-v2](./e6v2/): maintainers [MechMerlin](https://github.com/mechmerlin), [amnesia0287](https://github.com/amnesia0287) +* [e7-v1](./e7v1): maintainer [masterzen](https://github.com/masterzen) diff --git a/keyboards/facew/config.h b/keyboards/facew/config.h index d424404865e..62ba98be59d 100644 --- a/keyboards/facew/config.h +++ b/keyboards/facew/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef FACEW_CONFIG_H -#define FACEW_CONFIG_H +#pragma once #include "config_common.h" @@ -35,15 +34,7 @@ along with this program. If not, see . #define UNUSED_PINS #define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 -#define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - -#endif diff --git a/keyboards/facew/facew.c b/keyboards/facew/facew.c index 9c255c68f45..7ec56548b16 100644 --- a/keyboards/facew/facew.c +++ b/keyboards/facew/facew.c @@ -26,7 +26,7 @@ along with this program. If not, see . #include #include "action_layer.h" -#include "i2c.h" +#include "i2c_master.h" #include "quantum.h" #ifdef RGBLIGHT_ENABLE @@ -42,7 +42,7 @@ void rgblight_set(void) { } i2c_init(); - i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); } #endif diff --git a/keyboards/facew/facew.h b/keyboards/facew/facew.h index 7d949de98e3..b3356f2628e 100644 --- a/keyboards/facew/facew.h +++ b/keyboards/facew/facew.h @@ -15,15 +15,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef FACEW_H -#define FACEW_H +#pragma once #include "quantum.h" #define LAYOUT_all( \ K61, K71, K72, K73, K74, K64, K65, K75, K76, K77, K78, K68, K66, K10, K60,\ K11, K01, K02, K03, K04, K14, K15, K05, K06, K07, K08, K18, K16, K20, \ - K12, K21, K22, K23, K24, K34, K35, K25, K26, K27, K28, K38, K40, \ + K12, K21, K22, K23, K24, K34, K35, K25, K26, K27, K28, K38, K48, K40, \ K19, K13, K41, K42, K43, K44, K54, K55, K45, K46, K47, K58, K49, K50,\ K09, K00, K39, K30, K59, K69, K57, K29\ ){ \ @@ -31,7 +30,7 @@ along with this program. If not, see . { KC_NO, K11, K12, K13, K14, K15, K16, KC_NO, K18, K19, K10}, \ { KC_NO, K21, K22, K23, K24, K25, K26, K27, K28, K29, K20}, \ { KC_NO, KC_NO, KC_NO, KC_NO, K34, K35, KC_NO, KC_NO, K38, K39, K30}, \ - { KC_NO, K41, K42, K43, K44, K45, K46, K47, KC_NO, K49, K40}, \ + { KC_NO, K41, K42, K43, K44, K45, K46, K47, K48, K49, K40}, \ { KC_NO, KC_NO, KC_NO, KC_NO, K54, K55, KC_NO, K57, K58, K59, K50}, \ { KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, KC_NO, K68, K69, K60}, \ { KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, KC_NO, KC_NO}, \ @@ -53,5 +52,3 @@ along with this program. If not, see . { KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, KC_NO, K68, K69, K60}, \ { KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, KC_NO, KC_NO}, \ } - -#endif diff --git a/keyboards/facew/i2c.h b/keyboards/facew/i2c.h deleted file mode 100644 index 93a69c94da3..00000000000 --- a/keyboards/facew/i2c.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif diff --git a/keyboards/facew/info.json b/keyboards/facew/info.json index 3f94985b2dd..b7b6acca785 100644 --- a/keyboards/facew/info.json +++ b/keyboards/facew/info.json @@ -6,7 +6,7 @@ "height": 5, "layouts": { "LAYOUT_all": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, "LAYOUT_60_ansi": { diff --git a/keyboards/facew/keymaps/default/keymap.c b/keyboards/facew/keymaps/default/keymap.c index a237f8489e7..6e91fba238b 100644 --- a/keyboards/facew/keymaps/default/keymap.c +++ b/keyboards/facew/keymaps/default/keymap.c @@ -21,21 +21,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_all( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, - MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL ), [1] = LAYOUT_all( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_DEL, - MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, + MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_TRNS, KC_TRNS, MO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [2] = LAYOUT_all( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), diff --git a/keyboards/facew/keymaps/mechmerlin/keymap.c b/keyboards/facew/keymaps/mechmerlin/keymap.c deleted file mode 100644 index 35b59e6a42f..00000000000 --- a/keyboards/facew/keymaps/mechmerlin/keymap.c +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_all( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TG(2), - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(1), KC_RALT, KC_RGUI, KC_RCTL - ), - [1] = LAYOUT_all( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), - [2] = LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT - ), - - [3] = LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - diff --git a/keyboards/facew/keymaps/mechmerlin/readme.md b/keyboards/facew/keymaps/mechmerlin/readme.md deleted file mode 100644 index eeb83b0a16d..00000000000 --- a/keyboards/facew/keymaps/mechmerlin/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -MechMerlin's FaceW Sprit Edition Layout -====================== - -This is the preferred 60% layout used by u/merlin36, host of the [MechMerlin YouTube channel](www.youtube.com/mechmerlin). - -## Keyboard Notes -- The FaceW Sprit Edition can be purchased on [mechanicalkeyboards.com](www.mechanicalkeyboards.com) -- Uses ps2avru instead of ps2avrgb -- To put in reset mode hold `q` while inserting the USB cable -- Use flashing instructions from ps2avrgb QMK port - -## Keymap Notes -- Does not support any form of inswitch lighting as Merlin hates them. -- Arrow toggle switch to the right of right shift -- Reset is FN + Left Shift + R - -### Build -To build this keymap, simply run `make facew:mechmerlin` from the qmk_firmware directory. diff --git a/keyboards/facew/matrix.c b/keyboards/facew/matrix.c deleted file mode 100644 index 57aa36b5ff7..00000000000 --- a/keyboards/facew/matrix.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include - -#include "matrix.h" - -#ifndef DEBOUNCE -#define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_init(void) { - // all outputs for rows high - DDRB = 0xFF; - PORTB = 0xFF; - // all inputs for columns - DDRA = 0x00; - DDRC &= ~(0x111111<<2); - DDRD &= ~(1<> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x; -} - -uint8_t matrix_scan(void) { - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - matrix_set_row_status(row); - _delay_us(5); - - matrix_row_t cols = ( - // cols 0..7, PORTA 0 -> 7 - (~PINA) & 0xFF - ) | ( - // cols 8..13, PORTC 7 -> 0 - bit_reverse((~PINC) & 0xFF) << 8 - ) | ( - // col 14, PORTD 7 - ((~PIND) & (1 << PIND7)) << 7 - ); - - if (matrix_debouncing[row] != cols) { - matrix_debouncing[row] = cols; - debouncing = DEBOUNCE; - } - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_user(); - - return 1; -} - -inline matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - -void matrix_print(void) { -} diff --git a/keyboards/facew/readme.md b/keyboards/facew/readme.md index 6d7186704b1..b749d18d296 100644 --- a/keyboards/facew/readme.md +++ b/keyboards/facew/readme.md @@ -2,20 +2,12 @@ A 60% no frills keyboard. -The FaceW is a special run of the WKL B.Face sourced from Sprit that doesn't have underglow RGB LEDs -but does have in switch LEDs. Also unlike the B.Face, it is based on ps2avru instead of ps2avrGB. It -is designed and manufactured in Korea. It originally uses BootMapperClient for programming but -can now also use QMK. +The FaceW is a special run of the WKL B.Face sourced from Sprit that doesn't have underglow RGB LEDs but does have in switch LEDs. Also unlike the B.Face, it is based on ps2avru instead of ps2avrGB. It is designed and manufactured in Korea. Keyboard Maintainer: [MechMerlin](www.github.com/mechmerlin) Hardware Supported: FaceW Sprit Edition PCB Hardware Availability: https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=1352 -## Keyboard Notes -- The FaceW Sprit Edition can be purchased on [mechanicalkeyboards.com](www.mechanicalkeyboards.com) -- Uses ps2avru instead of ps2avrgb -- To put in reset mode hold `q` while inserting the USB cable - Make example for this keyboard (after setting up your build environment): make facew:default @@ -24,6 +16,8 @@ Flashing ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. +**Reset Key:** To put the FaceW into reset, hold `q` (`K01`) while plugging in. + Windows: 1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). 2. Place your keyboard into reset. @@ -42,12 +36,12 @@ macOS: ``` 3. Install the following packages: ``` - brew install python - brew install pyusb - brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb 4. Place your keyboard into reset. 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/facew/rules.mk b/keyboards/facew/rules.mk index 77d29b3320d..b939b0fd240 100644 --- a/keyboards/facew/rules.mk +++ b/keyboards/facew/rules.mk @@ -31,20 +31,19 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes +BOOTMAGIC_ENABLE = no MOUSEKEY_ENABLE = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 # custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c +SRC = i2c_master.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/facew/usbconfig.h b/keyboards/facew/usbconfig.h index d2d848fcdc8..f3d663f8a6e 100644 --- a/keyboards/facew/usbconfig.h +++ b/keyboards/facew/usbconfig.h @@ -8,8 +8,7 @@ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -241,8 +240,8 @@ section at the end of this file). #define USB_CFG_DEVICE_VERSION 0x00, 0x02 /* Version number of the device: Minor number first, then major number. */ -#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' -#define USB_CFG_VENDOR_NAME_LEN 13 +#define USB_CFG_VENDOR_NAME 'S', 'p', 'r', 'i', 't' +#define USB_CFG_VENDOR_NAME_LEN 5 /* These two values define the vendor name returned by the USB device. The name * must be given as a list of characters under single quotes. The characters * are interpreted as Unicode (UTF-16) entities. @@ -251,8 +250,8 @@ section at the end of this file). * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for * details. */ -#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' -#define USB_CFG_DEVICE_NAME_LEN 8 +#define USB_CFG_DEVICE_NAME 'F', 'a', 'c', 'e', 'W' +#define USB_CFG_DEVICE_NAME_LEN 5 /* Same as above for the device name. If you don't want a device name, undefine * the macros. See the file USB-IDs-for-free.txt before you assign a name if * you use a shared VID/PID. @@ -392,5 +391,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/fc660c/README.md b/keyboards/fc660c/README.md index 5cb9bcea48c..638c5595772 100644 --- a/keyboards/fc660c/README.md +++ b/keyboards/fc660c/README.md @@ -13,7 +13,7 @@ Make example for this keyboard (after setting up your build environment): make fc660c:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. To flash the firmware, press the reset button on the controller and run: diff --git a/keyboards/fc660c/config.h b/keyboards/fc660c/config.h index 9771c8c03d7..e55896e6c91 100644 --- a/keyboards/fc660c/config.h +++ b/keyboards/fc660c/config.h @@ -32,7 +32,7 @@ along with this program. If not, see . #define MATRIX_ROWS 8 #define MATRIX_COLS 16 -#define DIODE_DIRECTION CUSTOM_MATRIX +//#define DIODE_DIRECTION /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -44,7 +44,7 @@ along with this program. If not, see . // #define BACKLIGHT_PIN B7 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 0 +#define DEBOUNCE 0 #define TAPPING_TERM 175 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ @@ -52,13 +52,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ // #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/fc660c/keymaps/dbroqua/keymap.c b/keyboards/fc660c/keymaps/dbroqua/keymap.c index 62ef234c75f..0c6931a3f28 100644 --- a/keyboards/fc660c/keymaps/dbroqua/keymap.c +++ b/keyboards/fc660c/keymaps/dbroqua/keymap.c @@ -42,6 +42,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______, _______, _______,_______,MO(1), _______,_______,_______ ) }; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/fc660c/keymaps/default/config.h b/keyboards/fc660c/keymaps/default/config.h index 596198be104..b89b05009a6 100644 --- a/keyboards/fc660c/keymaps/default/config.h +++ b/keyboards/fc660c/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/fc660c/keymaps/default/keymap.c b/keyboards/fc660c/keymaps/default/keymap.c index eae07c08b17..bf890c2c1d9 100644 --- a/keyboards/fc660c/keymaps/default/keymap.c +++ b/keyboards/fc660c/keymaps/default/keymap.c @@ -32,6 +32,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______, _______, _______,_______,MO(1), _______,_______,_______ ) }; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/fc660c/keymaps/siroleo/README.md b/keyboards/fc660c/keymaps/siroleo/README.md new file mode 100644 index 00000000000..f174c7f3ebd --- /dev/null +++ b/keyboards/fc660c/keymaps/siroleo/README.md @@ -0,0 +1,9 @@ +# Sid's mods for the fc660c + +Emulates original keymap with modifications for: + +- Media keys +- Grave key(s) +- Reset on the function layer +- Mouse keys ala Tada68 +- A layer for playing with Colemak diff --git a/keyboards/fc660c/keymaps/siroleo/config.h b/keyboards/fc660c/keymaps/siroleo/config.h new file mode 100644 index 00000000000..8262805a0a1 --- /dev/null +++ b/keyboards/fc660c/keymaps/siroleo/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Khader Syed + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/fc660c/keymaps/siroleo/keymap.c b/keyboards/fc660c/keymaps/siroleo/keymap.c new file mode 100644 index 00000000000..37113367132 --- /dev/null +++ b/keyboards/fc660c/keymaps/siroleo/keymap.c @@ -0,0 +1,111 @@ +/* +Copyright 2019 Khader Syed + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +enum siroleo_layers +{ + _QWERTY, + _COLEMAK, + _FNM +}; + +enum siroleo_keycodes +{ + QWERTY = SAFE_RANGE, + COLEMAK +}; + +#define FNM MO(_FNM) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* BASE layer: Default Layer + * ,--------------------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | | ` | + * |-----------------------------------------------------------------------------------------+ +-----+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | | Del | + * |-----------------------------------------------------------------------------------------+ +-----+ + * | ` | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |--------------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | + * +--------------------------------------------------------------------------------------------+-----+ + * | Ctrl | Alt | Gui | Space | Fn | Ctrl | Alt | Left| Down|Right| + * `--------------------------------------------------------------------------------------------------´ + */ + [_QWERTY] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, + KC_GRV , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH,KC_RSFT, KC_UP, + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, FNM,KC_RCTL,KC_RALT, KC_LEFT,KC_DOWN,KC_RGHT + ), + /* Colemak Layer + * ,--------------------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | | ` | + * |-----------------------------------------------------------------------------------------+ +-----+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | | Del | + * |-----------------------------------------------------------------------------------------+ +-----+ + * | ` | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |--------------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | + * +--------------------------------------------------------------------------------------------+-----+ + * | Ctrl | Alt | Gui | Space | Fn | Ctrl | Alt | Left| Down|Right| + * `--------------------------------------------------------------------------------------------------´ + */ + [_COLEMAK] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, + KC_GRV , KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O ,KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT,KC_SLSH,KC_RSFT, KC_UP, + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, FNM,KC_RCTL,KC_RALT, KC_LEFT,KC_DOWN,KC_RGHT + ), + /* FN layer + * ,--------------------------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Mute| | Vol-| + * |-----------------------------------------------------------------------------------------+ +-----+ + * | | | | | | | | |PrtSc| Slck| Paus| | | | | Vol+| + * |-----------------------------------------------------------------------------------------+ +-----+ + * | | | | | | | | | Home| PgUp| | | | + * |--------------------------------------------------------------------------------------------+ + * | | | | | | | | | End | PgDn| | Mouse Btn 1 | MsU | + * +--------------------------------------------------------------------------------------------+-----+ + * | | Reset | | | | | | MsL | MsD | MsR | + * `--------------------------------------------------------------------------------------------------´ + */ + [_FNM] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLU, + _______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______, RESET, KC_VOLD, + _______,_______,_______, QWERTY,COLEMAK,_______,_______,_______,KC_HOME,KC_PGUP,_______,_______, _______, + _______,_______,_______,_______,_______,_______,_______,_______,KC_END, KC_PGDN,_______,KC_BTN1, KC_MS_U, + _______,_______,_______, _______, _______,_______,_______, KC_MS_L,KC_MS_D,KC_MS_R + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + } + return true; +} \ No newline at end of file diff --git a/keyboards/fc660c/keymaps/spacebarracecar/config.h b/keyboards/fc660c/keymaps/spacebarracecar/config.h deleted file mode 100644 index 9d83a27000e..00000000000 --- a/keyboards/fc660c/keymaps/spacebarracecar/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -/* -higher value means deeper actuation point, less sensitive -this should probably stay in the range +/-5. -*/ -#undef ACTUATION_DEPTH_ADJUSTMENT -#define ACTUATION_DEPTH_ADJUSTMENT -1 diff --git a/keyboards/fc660c/keymaps/spacebarracecar/keymap.c b/keyboards/fc660c/keymaps/spacebarracecar/keymap.c deleted file mode 100644 index 760b83b9fb8..00000000000 --- a/keyboards/fc660c/keymaps/spacebarracecar/keymap.c +++ /dev/null @@ -1,38 +0,0 @@ -#include QMK_KEYBOARD_H -#include "spacebarracecar.h" - -enum layers { - _BASE -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_BASE] = LAYOUT( - KC_ESC, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, DE_MINS,CU_EQL, KC_BSPC, KC_INS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, CU_Z, KC_U, KC_I, KC_O, KC_P, CU_LBRC,CU_RBRC,CU_BSLS, KC_DEL, - CU_NAV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, CU_SCLN,CU_QUOT, KC_ENT, - CU_LSFT,CU_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, CU_COMM,CU_DOT, CU_SLSH,CU_RSFT, KC_UP, - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ), - - [_DEADKEY] = LAYOUT( - CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, CU_ED, - _______,CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, - _______,CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, CU_DDQ , - _______,CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, - _______,_______,_______, CU_DDQ, _______,_______,_______, _______,_______,_______ - ), - - [_NAV] = LAYOUT( - CU_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, CU_GAME, - _______,KC_PGDN,KC_UP, KC_PGUP,KC_HOME,XXXXXXX,XXXXXXX,XXXXXXX,GUIU, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, CU_ESCT, - _______,KC_LEFT,KC_DOWN,KC_RGHT,KC_END, XXXXXXX,XXXXXXX,GUIL, GUID, GUIR, XXXXXXX,XXXXXXX, KC_ENT, - _______,KC_MPRV,KC_MPLY,KC_MNXT,KC_VOLD,KC_VOLU,KC_MUTE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______, KC_PGUP, - RESET, _______,_______, KC_SPC, _______,_______,_______, KC_HOME,KC_PGDN,KC_END - ) - -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} diff --git a/keyboards/fc660c/keymaps/spacebarracecar/readme.md b/keyboards/fc660c/keymaps/spacebarracecar/readme.md deleted file mode 100644 index 88c447e75c6..00000000000 --- a/keyboards/fc660c/keymaps/spacebarracecar/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# SpacebarRacecar US-International FC660C Keymap for German PCs - -This keymap emulates most keys of the US-International layout on PCs that have German set as input language. -This allows the use of the keyboard on any PC in Germany without the need to change any settings. -The keymap is mostly based on the US-International layout. diff --git a/keyboards/fc660c/keymaps/spacebarracecar/rules.mk b/keyboards/fc660c/keymaps/spacebarracecar/rules.mk deleted file mode 100644 index 8ee642a4a73..00000000000 --- a/keyboards/fc660c/keymaps/spacebarracecar/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work - -# Userspace defines -GERMAN_ENABLE = yes # Enable Custom US Ansi Keycodes for PC with German set as input language diff --git a/keyboards/fc980c/README.md b/keyboards/fc980c/README.md index 16ad9021cde..61dcf6ee964 100644 --- a/keyboards/fc980c/README.md +++ b/keyboards/fc980c/README.md @@ -15,7 +15,7 @@ Make example for this keyboard (after setting up your build environment): make fc980c:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. To flash the firmware, press the reset button on the controller and run: @@ -155,7 +155,7 @@ Datasheets - AD5258: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5258.pdf - JST S5B-PH-SM4: http://www.jst-mfg.com/product/pdf/eng/ePH.pdf - Hirose UX60SC-MB-5S8: https://www.hirose.com/product/en/products/UX/UX60SC-MB-5S8%2880%29/ -- Tr(E42) for LED?: http://cj-elec.com/txUpfile/2013614923661845.pdf +- Tr(E42) for LED?: http://www.bklighting.com/cimages/specs-758.pdf - TYU TU1252WNR-05S: http://php2.twinner.com.tw/files/goodjob/TY1252series.pdf diff --git a/keyboards/fc980c/config.h b/keyboards/fc980c/config.h index 1b1f41c9091..f9d3e06d6e8 100644 --- a/keyboards/fc980c/config.h +++ b/keyboards/fc980c/config.h @@ -36,7 +36,7 @@ along with this program. If not, see . // #define MATRIX_COL_PINS { F5, B1, F0, F1, F4, B3, D7, D6, D4, D5, D3, D2, D1, D0 } // #define UNUSED_PINS -#define DIODE_DIRECTION CUSTOM_MATRIX +//#define DIODE_DIRECTION /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -48,7 +48,7 @@ along with this program. If not, see . // #define BACKLIGHT_PIN B7 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 0 +#define DEBOUNCE 0 #define TAPPING_TERM 175 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ @@ -56,13 +56,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ // #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/fc980c/fc980c.h b/keyboards/fc980c/fc980c.h index 74c46806131..ffb02e25799 100644 --- a/keyboards/fc980c/fc980c.h +++ b/keyboards/fc980c/fc980c.h @@ -14,11 +14,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef FC980C_H -#define FC980C_H +#pragma once #include "quantum.h" -// #include "quantum_keycodes.h" /* ---------------------------------------------------------------------------------------------------------------------- @@ -37,42 +35,31 @@ along with this program. If not, see . ---------------------------------------------------------------------------------------------------------------------- */ -#define LAYOUT( \ - K0D, K2D, K5D, K3D, K6D, K7D, K7F, K7E, K7C, K72, K71, K70, K73, K74, K76, K77, K75, \ - K0A, K69, K59, K58, K5B, K6F, K5F, K5E, K6C, K5C, K52, K51, K50, K55, K54, K56, K57, K65, \ - K6A, K39, K68, K6B, K3B, K3F, K6E, K3E, K3C, K62, K61, K60, K33, K53, K64, K66, K67, K25, \ - K3A, K29, K38, K28, K2B, K2F, K2E, K2C, K1C, K32, K31, K20, K63, K24, K26, K27, \ - K2A, K18, K08, K1B, K0B, K1F, K1E, K0E, K22, K11, K21, K30, K34, K14, K16, K17, K15, \ - K1A, K09, K19, K0F, K02, K01, K10, K00, K04, K06, K07, K05) \ - { \ - {K00, K01, K02, KC_NO, K04, K05, K06, K07, \ - K08, K09, K0A, K0B, KC_NO, K0D, K0E, K0F}, \ - {K10, K11, KC_NO, KC_NO, K14, K15, K16, K17, \ - K18, K19, K1A, K1B, K1C, KC_NO, K1E, K1F}, \ - {K20, K21, K22, KC_NO, K24, K25, K26, K27, \ - K28, K29, K2A, K2B, K2C, K2D, K2E, K2F}, \ - {K30, K31, K32, K33, K34, KC_NO, KC_NO, KC_NO, \ - K38, K39, K3A, K3B, K3C, K3D, K3E, K3F}, \ - {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, \ - {K50, K51, K52, K53, K54, K55, K56, K57, \ - K58, K59, KC_NO, K5B, K5C, K5D, K5E, K5F}, \ - {K60, K61, K62, K63, K64, K65, K66, K67, \ - K68, K69, K6A, K6B, K6C, K6D, K6E, K6F}, \ - { \ - K70, K71, K72, K73, K74, K75, K76, K77, \ - KC_NO, KC_NO, KC_NO, KC_NO, K7C, K7D, K7E, K7F \ - } \ - } +#define LAYOUT( \ + K0D, K2D, K5D, K3D, K6D, K7D, K7F, K7E, K7C, K72, K71, K70, K73, K74, K76, K77, K75, \ + K0A, K69, K59, K58, K5B, K6F, K5F, K5E, K6C, K5C, K52, K51, K50, K55, K54, K56, K57, K65, \ + K6A, K39, K68, K6B, K3B, K3F, K6E, K3E, K3C, K62, K61, K60, K33, K53, K64, K66, K67, K25, \ + K3A, K29, K38, K28, K2B, K2F, K2E, K2C, K1C, K32, K31, K20, K63, K24, K26, K27, \ + K2A, K18, K08, K1B, K0B, K1F, K1E, K0E, K22, K11, K21, K30, K34, K14, K16, K17, K15, \ + K1A, K09, K19, K0F, K02, K01, K10, K00, K04, K06, K07, K05 \ +) { \ + { K00, K01, K02, KC_NO, K04, K05, K06, K07, K08, K09, K0A, K0B, KC_NO, K0D, K0E, K0F }, \ + { K10, K11, KC_NO, KC_NO, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO, K1E, K1F }, \ + { K20, K21, K22, KC_NO, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, KC_NO, KC_NO, KC_NO, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, KC_NO, K5B, K5C, K5D, K5E, K5F }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \ + { K70, K71, K72, K73, K74, K75, K76, K77, KC_NO, KC_NO, KC_NO, KC_NO, K7C, K7D, K7E, K7F } \ +} /* LAYOUT( - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______,_______,_______, - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______,_______,_______, - _______,_______,_______, _______, _______,_______,_______, _______,_______,_______, _______,_______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) */ -#endif diff --git a/keyboards/fc980c/info.json b/keyboards/fc980c/info.json index f3007f2f848..a15ff216ca9 100644 --- a/keyboards/fc980c/info.json +++ b/keyboards/fc980c/info.json @@ -6,105 +6,106 @@ "height": 6.75, "layouts": { "LAYOUT": { + "key_count": 98, "layout": [ - { "label": "Esc", "x": 0, "y": 0 }, - { "label": "F1", "x": 2, "y": 0 }, - { "label": "F2", "x": 3, "y": 0 }, - { "label": "F3", "x": 4, "y": 0 }, - { "label": "F4", "x": 5, "y": 0 }, - { "label": "F5", "x": 6.5, "y": 0 }, - { "label": "F6", "x": 7.5, "y": 0 }, - { "label": "F7", "x": 8.5, "y": 0 }, - { "label": "F8", "x": 9.5, "y": 0 }, - { "label": "F9", "x": 11, "y": 0 }, - { "label": "F10", "x": 12, "y": 0 }, - { "label": "F11", "x": 13, "y": 0 }, - { "label": "F12", "x": 14, "y": 0 }, - { "label": "Delete", "x": 15.5, "y": 0 }, - { "label": "Insert", "x": 16.5, "y": 0 }, - { "label": "Pg Up", "x": 17.5, "y": 0 }, - { "label": "Pg Dn", "x": 18.5, "y": 0 }, - { "label": "~", "x": 0, "y": 1.5 }, - { "label": "!", "x": 1, "y": 1.5 }, - { "label": "@", "x": 2, "y": 1.5 }, - { "label": "#", "x": 3, "y": 1.5 }, - { "label": "$", "x": 4, "y": 1.5 }, - { "label": "%", "x": 5, "y": 1.5 }, - { "label": "^", "x": 6, "y": 1.5 }, - { "label": "&", "x": 7, "y": 1.5 }, - { "label": "*", "x": 8, "y": 1.5 }, - { "label": "(", "x": 9, "y": 1.5 }, - { "label": ")", "x": 10, "y": 1.5 }, - { "label": "_", "x": 11, "y": 1.5 }, - { "label": "+", "x": 12, "y": 1.5 }, - { "label": "Backspace", "x": 13, "y": 1.5, "w": 2 }, - { "label": "Num Lock", "x": 15.5, "y": 1.5 }, - { "label": "/", "x": 16.5, "y": 1.5 }, - { "label": "*", "x": 17.5, "y": 1.5 }, - { "label": "-", "x": 18.5, "y": 1.5 }, - { "label": "Tab", "x": 0, "y": 2.5, "w": 1.5 }, - { "label": "Q", "x": 1.5, "y": 2.5 }, - { "label": "W", "x": 2.5, "y": 2.5 }, - { "label": "E", "x": 3.5, "y": 2.5 }, - { "label": "R", "x": 4.5, "y": 2.5 }, - { "label": "T", "x": 5.5, "y": 2.5 }, - { "label": "Y", "x": 6.5, "y": 2.5 }, - { "label": "U", "x": 7.5, "y": 2.5 }, - { "label": "I", "x": 8.5, "y": 2.5 }, - { "label": "O", "x": 9.5, "y": 2.5 }, - { "label": "P", "x": 10.5, "y": 2.5 }, - { "label": "{", "x": 11.5, "y": 2.5 }, - { "label": "}", "x": 12.5, "y": 2.5 }, - { "label": "|", "x": 13.5, "y": 2.5, "w": 1.5 }, - { "label": "7", "x": 15.5, "y": 2.5 }, - { "label": "8", "x": 16.5, "y": 2.5 }, - { "label": "9", "x": 17.5, "y": 2.5 }, - { "label": "+", "x": 18.5, "y": 2.5, "h": 2 }, - { "label": "Caps Lock", "x": 0, "y": 3.5, "w": 1.75 }, - { "label": "A", "x": 1.75, "y": 3.5 }, - { "label": "S", "x": 2.75, "y": 3.5 }, - { "label": "D", "x": 3.75, "y": 3.5 }, - { "label": "F", "x": 4.75, "y": 3.5 }, - { "label": "G", "x": 5.75, "y": 3.5 }, - { "label": "H", "x": 6.75, "y": 3.5 }, - { "label": "J", "x": 7.75, "y": 3.5 }, - { "label": "K", "x": 8.75, "y": 3.5 }, - { "label": "L", "x": 9.75, "y": 3.5 }, - { "label": ":", "x": 10.75, "y": 3.5 }, - { "label": "\"", "x": 11.75, "y": 3.5 }, - { "label": "Enter", "x": 12.75, "y": 3.5, "w": 2.25 }, - { "label": "4", "x": 15.5, "y": 3.5 }, - { "label": "5", "x": 16.5, "y": 3.5 }, - { "label": "6", "x": 17.5, "y": 3.5 }, - { "label": "Shift", "x": 0, "y": 4.5, "w": 2.25 }, - { "label": "Z", "x": 2.25, "y": 4.5 }, - { "label": "X", "x": 3.25, "y": 4.5 }, - { "label": "C", "x": 4.25, "y": 4.5 }, - { "label": "V", "x": 5.25, "y": 4.5 }, - { "label": "B", "x": 6.25, "y": 4.5 }, - { "label": "N", "x": 7.25, "y": 4.5 }, - { "label": "M", "x": 8.25, "y": 4.5 }, - { "label": "<", "x": 9.25, "y": 4.5 }, - { "label": ">", "x": 10.25, "y": 4.5 }, - { "label": "?", "x": 11.25, "y": 4.5 }, - { "label": "Shift", "x": 12.25, "y": 4.5, "w": 1.75 }, - { "label": "1", "x": 15.5, "y": 4.5 }, - { "label": "2", "x": 16.5, "y": 4.5 }, - { "label": "3", "x": 17.5, "y": 4.5 }, - { "label": "Enter", "x": 18.5, "y": 4.5, "h": 2 }, - { "label": "\u2191", "x": 14.25, "y": 4.75 }, - { "label": "Ctrl", "x": 0, "y": 5.5, "w": 1.25 }, - { "label": "Win", "x": 1.25, "y": 5.5 }, - { "label": "Alt", "x": 2.25, "y": 5.5, "w": 1.25 }, - { "x": 3.5, "y": 5.5, "w": 6 }, - { "label": "Alt", "x": 9.5, "y": 5.5, "w": 1.25 }, - { "label": "Ctrl", "x": 10.75, "y": 5.5 }, - { "label": "Fn", "x": 11.75, "y": 5.5, "w": 1.25 }, - { "label": "0", "x": 16.5, "y": 5.5 }, - { "label": ".", "x": 17.5, "y": 5.5 }, - { "label": "\u2190", "x": 13.25, "y": 5.75 }, - { "label": "\u2193", "x": 14.25, "y": 5.75 }, - { "label": "\u2192", "x": 15.25, "y": 5.75 } + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Delete", "x":15.5, "y":0}, + {"label":"Insert", "x":16.5, "y":0}, + {"label":"Page Up", "x":17.5, "y":0}, + {"label":"Page Down", "x":18.5, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Num Lock", "x":15.5, "y":1.5}, + {"label":"/", "x":16.5, "y":1.5}, + {"label":"*", "x":17.5, "y":1.5}, + {"label":"-", "x":18.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"7", "x":15.5, "y":2.5}, + {"label":"8", "x":16.5, "y":2.5}, + {"label":"9", "x":17.5, "y":2.5}, + {"label":"+", "x":18.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":15.5, "y":3.5}, + {"label":"5", "x":16.5, "y":3.5}, + {"label":"6", "x":17.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Up", "x":14.25, "y":4.75}, + {"label":"1", "x":15.5, "y":4.5}, + {"label":"2", "x":16.5, "y":4.5}, + {"label":"3", "x":17.5, "y":4.5}, + {"label":"Enter", "x":18.5, "y":4.5, "h":2}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5}, + {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.5, "y":5.5, "w":6}, + {"label":"Alt", "x":9.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":10.75, "y":5.5}, + {"label":"Fn", "x":11.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":13.25, "y":5.75}, + {"label":"Down", "x":14.25, "y":5.75}, + {"label":"Right", "x":15.25, "y":5.75}, + {"label":"0", "x":16.5, "y":5.5}, + {"label":".", "x":17.5, "y":5.5} ] } } diff --git a/keyboards/fc980c/keymaps/actuation-point-example/keymap.c b/keyboards/fc980c/keymaps/actuation-point-example/keymap.c index ac993ae6baa..96393a4d76f 100644 --- a/keyboards/fc980c/keymaps/actuation-point-example/keymap.c +++ b/keyboards/fc980c/keymaps/actuation-point-example/keymap.c @@ -80,5 +80,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) return true; } }; - -const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboards/fc980c/keymaps/coloneljesus/keymap.c b/keyboards/fc980c/keymaps/coloneljesus/keymap.c index 26d476ab614..664d146fa7b 100644 --- a/keyboards/fc980c/keymaps/coloneljesus/keymap.c +++ b/keyboards/fc980c/keymaps/coloneljesus/keymap.c @@ -32,5 +32,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, LCTL(KC_BSPC), LCTL(KC_DEL), _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_APP, _______, KC_HOME, KC_PGDN, KC_END, _______, _______), }; - -const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboards/fc980c/keymaps/default/config.h b/keyboards/fc980c/keymaps/default/config.h index 596198be104..20fd511474e 100644 --- a/keyboards/fc980c/keymaps/default/config.h +++ b/keyboards/fc980c/keymaps/default/config.h @@ -14,11 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/fc980c/keymaps/default/keymap.c b/keyboards/fc980c/keymaps/default/keymap.c index b3f7bb7b114..b3d86192d31 100644 --- a/keyboards/fc980c/keymaps/default/keymap.c +++ b/keyboards/fc980c/keymaps/default/keymap.c @@ -32,5 +32,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_APP, _______, KC_HOME, KC_PGDN, KC_END, _______, _______), }; - -const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboards/felix/config.h b/keyboards/felix/config.h index 003fe87dc83..19a5247d27d 100644 --- a/keyboards/felix/config.h +++ b/keyboards/felix/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -9,46 +8,225 @@ #define DEVICE_VER 0x0001 #define MANUFACTURER Unikeyboard #define PRODUCT Felix -#define DESCRIPTION 4x5 number/macropad. +#define DESCRIPTION 4x5 number/macropad /* key matrix size */ #define MATRIX_ROWS 5 #define MATRIX_COLS 4 -/* key matrix pins */ +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ #define MATRIX_ROW_PINS { B2, B3, B1, F7, F6 } #define MATRIX_COL_PINS { B5, B4, E6, D7 } #define UNUSED_PINS -/* COL2ROW or ROW2COL */ +/* COL2ROW, ROW2COL */ #define DIODE_DIRECTION ROW2COL -/* number of backlight levels */ -/* Not sure what pin controls the backlighting, need help for this. */ -#define BACKLIGHT_PIN +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN C6 #define BACKLIGHT_LEVELS 5 +//#define BACKLIGHT_BREATHING + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE - /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ +/* disable debug print */ +//#define NO_DEBUG -/* there is no rgb underglow by default. */ -#define RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 +/* disable print */ +//#define NO_PRINT +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line #endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/felix/felix.h b/keyboards/felix/felix.h index 86a9b4e72ef..f43a586c8ee 100644 --- a/keyboards/felix/felix.h +++ b/keyboards/felix/felix.h @@ -1,5 +1,4 @@ -#ifndef FELIX_H -#define FELIX_H +#pragma once #include "quantum.h" @@ -18,5 +17,3 @@ } #define LAYOUT LAYOUT_ortho_5x4 - -#endif \ No newline at end of file diff --git a/keyboards/felix/info.json b/keyboards/felix/info.json index a9b3c3dd0ed..3b1cfda2f31 100644 --- a/keyboards/felix/info.json +++ b/keyboards/felix/info.json @@ -6,7 +6,28 @@ "height": 5, "layouts": { "LAYOUT_ortho_5x4": { - "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K100", "x":0, "y":1}, {"label":"K101", "x":1, "y":1}, {"label":"K102", "x":2, "y":1}, {"label":"K103", "x":3, "y":1}, {"label":"K200", "x":0, "y":2}, {"label":"K201", "x":1, "y":2}, {"label":"K202", "x":2, "y":2}, {"label":"K203", "x":3, "y":2}, {"label":"K300", "x":0, "y":3}, {"label":"K301", "x":1, "y":3}, {"label":"K302", "x":2, "y":3}, {"label":"K303", "x":3, "y":3}, {"label":"K400", "x":0, "y":4}, {"label":"K401", "x":1, "y":4}, {"label":"K402", "x":2, "y":4}, {"label":"K403", "x":3, "y":4}] + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":1, "y":0}, + {"label":"K002", "x":2, "y":0}, + {"label":"K003", "x":3, "y":0}, + {"label":"K100", "x":0, "y":1}, + {"label":"K101", "x":1, "y":1}, + {"label":"K102", "x":2, "y":1}, + {"label":"K103", "x":3, "y":1}, + {"label":"K200", "x":0, "y":2}, + {"label":"K201", "x":1, "y":2}, + {"label":"K202", "x":2, "y":2}, + {"label":"K203", "x":3, "y":2}, + {"label":"K300", "x":0, "y":3}, + {"label":"K301", "x":1, "y":3}, + {"label":"K302", "x":2, "y":3}, + {"label":"K303", "x":3, "y":3}, + {"label":"K400", "x":0, "y":4}, + {"label":"K401", "x":1, "y":4}, + {"label":"K402", "x":2, "y":4}, + {"label":"K403", "x":3, "y":4} + ] } } } diff --git a/keyboards/felix/keymaps/default/keymap.c b/keyboards/felix/keymaps/default/keymap.c index a0093bf8e4b..630a46c086b 100644 --- a/keyboards/felix/keymaps/default/keymap.c +++ b/keyboards/felix/keymaps/default/keymap.c @@ -1,22 +1,11 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT( - KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_P4, KC_P5, KC_P6, KC_HOME, - KC_P1, KC_P2, KC_P3, KC_END, - KC_P0, KC_PEQL, KC_PDOT, KC_PENT - ), - + LAYOUT_ortho_5x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_HOME, + KC_P1, KC_P2, KC_P3, KC_END, + KC_P0, KC_PEQL, KC_PDOT, KC_PENT + ) }; - -void persistant_default_layer_set(uint16_t default_layer) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - } - return true; -} diff --git a/keyboards/felix/readme.md b/keyboards/felix/readme.md index e41782c3ccf..0a3fe10a6ec 100644 --- a/keyboards/felix/readme.md +++ b/keyboards/felix/readme.md @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make felix:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/felix/rules.mk b/keyboards/felix/rules.mk index e8f83434169..b33785b64a1 100644 --- a/keyboards/felix/rules.mk +++ b/keyboards/felix/rules.mk @@ -37,22 +37,34 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina # Build Options -# comment out to disable the options. +# change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) LAYOUTS = ortho_5x4 diff --git a/keyboards/fleuron/config.h b/keyboards/fleuron/config.h index a3ff43b06ba..0236bc3b6c8 100644 --- a/keyboards/fleuron/config.h +++ b/keyboards/fleuron/config.h @@ -46,16 +46,15 @@ along with this program. If not, see . #define MATRIX_COL_PINS { C7, B6, B3, B5, B4, D7, D4, D5, D3, D2, D1, D0, B7, B0, B1, B2 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -105,11 +104,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/fleuron/keymaps/default/keymap.c b/keyboards/fleuron/keymaps/default/keymap.c index 3314013669c..367ee489507 100644 --- a/keyboards/fleuron/keymaps/default/keymap.c +++ b/keyboards/fleuron/keymaps/default/keymap.c @@ -34,9 +34,6 @@ enum custom_keycodes { #define _RAISE 2 */ -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_ortho_6x16( /* Qwerty diff --git a/keyboards/fleuron/keymaps/dollartacos/keymap.c b/keyboards/fleuron/keymaps/dollartacos/keymap.c index e38dd8bd572..f8535fdc788 100644 --- a/keyboards/fleuron/keymaps/dollartacos/keymap.c +++ b/keyboards/fleuron/keymaps/dollartacos/keymap.c @@ -34,9 +34,6 @@ enum custom_keycodes { #define _RAISE 2 */ -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_fleuron_grid( /* Qwerty diff --git a/keyboards/fleuron/readme.md b/keyboards/fleuron/readme.md index 077753a2879..286ceb7cf85 100644 --- a/keyboards/fleuron/readme.md +++ b/keyboards/fleuron/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make fleuron:default to build firmware make fleuron:default:dfu to make and flash with dfu -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/fleuron/rules.mk b/keyboards/fleuron/rules.mk index c295dc55dbc..8e0b084c459 100644 --- a/keyboards/fleuron/rules.mk +++ b/keyboards/fleuron/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -68,4 +67,4 @@ AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches RGBLIGHT_ENABLE = yes -LAYOUTS = ortho_6x16 \ No newline at end of file +LAYOUTS = ortho_6x16 diff --git a/keyboards/fortitude60/keymaps/default/config.h b/keyboards/fortitude60/keymaps/default/config.h index 17483734816..b6c6273d927 100644 --- a/keyboards/fortitude60/keymaps/default/config.h +++ b/keyboards/fortitude60/keymaps/default/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once #define USE_SERIAL @@ -34,5 +31,3 @@ along with this program. If not, see . /* #define RGBLIGHT_HUE_STEP 8 */ /* #define RGBLIGHT_SAT_STEP 8 */ /* #define RGBLIGHT_VAL_STEP 8 */ - -#endif diff --git a/keyboards/fortitude60/keymaps/default/keymap.c b/keyboards/fortitude60/keymaps/default/keymap.c index 9d724a8ec63..d20ca40fbba 100644 --- a/keyboards/fortitude60/keymaps/default/keymap.c +++ b/keyboards/fortitude60/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "eeconfig.h" extern keymap_config_t keymap_config; @@ -23,9 +22,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) @@ -41,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | [ | ] | N | M | , | . | / |Enter | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | GUI | Ctrl |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | + * | GUI | Alt |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | * `---------------------------------------------------------------------' */ [_QWERTY] = LAYOUT( \ @@ -62,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | [ | ] | K | M | , | . | / |Enter | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | GUI | Ctrl |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | + * | GUI | Alt |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | * `---------------------------------------------------------------------' */ [_COLEMAK] = LAYOUT( \ @@ -83,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| * | Shift| ; | Q | J | K | X | [ | ] | B | M | W | V | Z |Enter | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | GUI | Ctrl |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | + * | GUI | Alt |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | * `---------------------------------------------------------------------' */ [_DVORAK] = LAYOUT( \ diff --git a/keyboards/fortitude60/matrix.c b/keyboards/fortitude60/matrix.c index 565f417d855..9037d53a649 100644 --- a/keyboards/fortitude60/matrix.c +++ b/keyboards/fortitude60/matrix.c @@ -38,11 +38,11 @@ extern backlight_config_t backlight_config; #include "serial.h" -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -144,7 +144,7 @@ uint8_t _matrix_scan(void) #if (DIODE_DIRECTION == COL2ROW) // Set row, read cols for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); if (matrix_changed) { @@ -161,7 +161,7 @@ uint8_t _matrix_scan(void) #elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); if (matrix_changed) { debouncing = true; @@ -174,8 +174,8 @@ uint8_t _matrix_scan(void) } #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { matrix[i+offset] = matrix_debouncing[i+offset]; } diff --git a/keyboards/fortitude60/readme.md b/keyboards/fortitude60/readme.md index 58453ccc474..369f5e24b04 100644 --- a/keyboards/fortitude60/readme.md +++ b/keyboards/fortitude60/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make fortitude60/rev1:default:avrdude -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/fortitude60/rev1/config.h b/keyboards/fortitude60/rev1/config.h index b89f5c7df92..ad4407a1116 100644 --- a/keyboards/fortitude60/rev1/config.h +++ b/keyboards/fortitude60/rev1/config.h @@ -51,18 +51,13 @@ along with this program. If not, see . #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN B5 diff --git a/keyboards/fortitude60/rules.mk b/keyboards/fortitude60/rules.mk index 3d1745c6f77..5ea1cc5a50a 100644 --- a/keyboards/fortitude60/rules.mk +++ b/keyboards/fortitude60/rules.mk @@ -3,7 +3,6 @@ SRC += matrix.c \ serial.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/fortitude60/serial.c b/keyboards/fortitude60/serial.c index cea1a5f6caa..6006ebf1bdb 100644 --- a/keyboards/fortitude60/serial.c +++ b/keyboards/fortitude60/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU @@ -14,10 +19,60 @@ #include "serial.h" //#include -#ifdef USE_SERIAL +#ifdef SOFT_SERIAL_PIN -#ifndef SERIAL_USE_MULTI_TRANSACTION -/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; #endif @@ -42,56 +97,118 @@ SSTD_t transactions[] = { }; void serial_master_init(void) -{ soft_serial_initiator_init(transactions); } +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } void serial_slave_init(void) -{ soft_serial_target_init(transactions); } +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error // 1 => slave did not respond // 2 => checksum error int serial_update_buffers() -{ return soft_serial_transaction(); } +{ + int result; + result = soft_serial_transaction(); + return result; +} -#endif // Simple API (OLD API, compatible with let's split serial.c) +#endif // end of OLD API (compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) #define NO_INLINE __attribute__((noinline)) #define _delay_sub_us(x) __builtin_avr_delay_cycles(x) -// Serial pulse period in microseconds. -#define TID_SEND_ADJUST 14 +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif -#define SELECT_SERIAL_SPEED 1 -#if SELECT_SERIAL_SPEED == 0 +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 1 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 2 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 3 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 4 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed - #define SERIAL_DELAY 50 // micro sec + #define SERIAL_DELAY 36 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #else -#error Illegal Serial Speed -#endif - +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) @@ -105,17 +222,21 @@ int serial_update_buffers() #endif static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); } +inline static void serial_delay_half2(void) ALWAYS_INLINE; inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); @@ -135,6 +256,7 @@ void serial_input_with_pullup(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); @@ -152,30 +274,28 @@ void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void soft_serial_initiator_init(SSTD_t *sstd_table) +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_output(); serial_high(); } -void soft_serial_target_init(SSTD_t *sstd_table) +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_input_with_pullup(); -#if SERIAL_PIN_MASK == _BV(PD0) - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -#elif SERIAL_PIN_MASK == _BV(PD2) - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; #else - #error unknown SERIAL_PIN_MASK value + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; #endif } @@ -191,7 +311,7 @@ void sync_recv(void) { } // Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void)NO_INLINE; +static void sync_send(void) NO_INLINE; static void sync_send(void) { serial_low(); @@ -205,12 +325,12 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { uint8_t byte, i, p, pb; _delay_sub_us(READ_WRITE_START_ADJUST); - for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { serial_delay_half1(); // read the middle of pulses if( serial_read_pin() ) { - byte = (byte << 1) | 1; p ^= 1; + byte = (byte << 1) | 1; p ^= 1; } else { - byte = (byte << 1) | 0; p ^= 0; + byte = (byte << 1) | 0; p ^= 0; } _delay_sub_us(READ_WRITE_WIDTH_ADJUST); serial_delay_half2(); @@ -230,13 +350,13 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; void serial_write_chunk(uint8_t data, uint8_t bit) { uint8_t b, p; - for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { - if(data & b) { - serial_high(); p ^= 1; - } else { - serial_low(); p ^= 0; - } - serial_delay(); + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } /* send parity bit */ if(p & 1) { serial_high(); } @@ -288,6 +408,13 @@ void change_reciver2sender(void) { serial_delay_half1(); //4 } +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + // interrupt handle to be used by the target device ISR(SERIAL_PIN_INTERRUPT) { @@ -297,12 +424,15 @@ ISR(SERIAL_PIN_INTERRUPT) { SSTD_t *trans = Transaction_table; #else // recive transaction table index - uint8_t tid; + uint8_t tid, bits; uint8_t pecount = 0; sync_recv(); - tid = serial_read_chunk(&pecount,4); - if(pecount> 0) + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { return; + } serial_delay_half1(); serial_high(); // response step1 low->high @@ -315,17 +445,17 @@ ISR(SERIAL_PIN_INTERRUPT) { // target send phase if( trans->target2initiator_buffer_size > 0 ) serial_send_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size); + trans->target2initiator_buffer_size); // target switch to input change_sender2reciver(); // target recive phase if( trans->initiator2target_buffer_size > 0 ) { if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size) ) { - *trans->status = TRANSACTION_ACCEPTED; + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; } else { - *trans->status = TRANSACTION_DATA_ERROR; + *trans->status = TRANSACTION_DATA_ERROR; } } else { *trans->status = TRANSACTION_ACCEPTED; @@ -349,6 +479,8 @@ int soft_serial_transaction(void) { SSTD_t *trans = Transaction_table; #else int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; SSTD_t *trans = &Transaction_table[sstd_index]; #endif cli(); @@ -375,9 +507,10 @@ int soft_serial_transaction(int sstd_index) { #else // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); sync_send(); _delay_sub_us(TID_SEND_ADJUST); - serial_write_chunk(sstd_index, 4); + serial_write_chunk(tid, 7); serial_delay_half1(); // wait for the target response (step1 low->high) @@ -389,12 +522,12 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; } _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } @@ -404,12 +537,12 @@ int soft_serial_transaction(int sstd_index) { // if the target is present syncronize with it if( trans->target2initiator_buffer_size > 0 ) { if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size) ) { - serial_output(); - serial_high(); - *trans->status = TRANSACTION_DATA_ERROR; - sei(); - return TRANSACTION_DATA_ERROR; + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; } } @@ -419,7 +552,7 @@ int soft_serial_transaction(int sstd_index) { // initiator send phase if( trans->initiator2target_buffer_size > 0 ) { serial_send_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size); + trans->initiator2target_buffer_size); } // always, release the line when not in use @@ -441,4 +574,17 @@ int soft_serial_get_and_clean_status(int sstd_index) { } #endif -#endif \ No newline at end of file +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/fortitude60/serial.h b/keyboards/fortitude60/serial.h index d008980556c..2e53928df2d 100644 --- a/keyboards/fortitude60/serial.h +++ b/keyboards/fortitude60/serial.h @@ -4,40 +4,47 @@ #include // ///////////////////////////////////////////////////////////////// -// Need Soft Serial defines in serial_config.h +// Need Soft Serial defines in config.h // ///////////////////////////////////////////////////////////////// // ex. -// #define SERIAL_PIN_DDR DDRD -// #define SERIAL_PIN_PORT PORTD -// #define SERIAL_PIN_INPUT PIND -// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 -// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps // -// //// USE Simple API (OLD API, compatible with let's split serial.c) +// //// USE OLD API (compatible with let's split serial.c) // ex. // #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 // #define SERIAL_MASTER_BUFFER_LENGTH 1 // -// //// USE flexible API (using multi-type transaction function) -// #define SERIAL_USE_MULTI_TRANSACTION +// //// USE NEW API +// //// USE simple API (using signle-type transaction function) +// #define SERIAL_USE_SINGLE_TRANSACTION +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION // // ///////////////////////////////////////////////////////////////// -#ifndef SERIAL_USE_MULTI_TRANSACTION -/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ -#if SERIAL_SLAVE_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -#endif -#if SERIAL_MASTER_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; -#endif +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + #endif -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); + void serial_master_init(void); + void serial_slave_init(void); + int serial_update_buffers(void); -#endif // USE Simple API +#endif // end of USE OLD API +//////////////////////////////////////////////////////////////////////////// // Soft Serial Transaction Descriptor typedef struct _SSTD_t { @@ -47,16 +54,18 @@ typedef struct _SSTD_t { uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) // initiator is transaction start side -void soft_serial_initiator_init(SSTD_t *sstd_table); +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); // target is interrupt accept side -void soft_serial_target_init(SSTD_t *sstd_table); +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); // initiator resullt #define TRANSACTION_END 0 #define TRANSACTION_NO_RESPONSE 0x1 #define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 #ifndef SERIAL_USE_MULTI_TRANSACTION int soft_serial_transaction(void); #else @@ -72,9 +81,9 @@ int soft_serial_transaction(int sstd_index); // target: // TRANSACTION_DATA_ERROR // or TRANSACTION_ACCEPTED -#define TRANSACTION_ACCEPTED 0x4 +#define TRANSACTION_ACCEPTED 0x8 #ifdef SERIAL_USE_MULTI_TRANSACTION int soft_serial_get_and_clean_status(int sstd_index); #endif -#endif /* SOFT_SERIAL_H */ \ No newline at end of file +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/fortitude60/serial_config.h b/keyboards/fortitude60/serial_config.h index 96a54afbd80..d4a42bce388 100644 --- a/keyboards/fortitude60/serial_config.h +++ b/keyboards/fortitude60/serial_config.h @@ -2,13 +2,9 @@ #define SOFT_SERIAL_CONFIG_H /* Soft Serial defines */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect +#define SOFT_SERIAL_PIN D2 #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH 1 -#endif /* SOFT_SERIAL_CONFIG_H */ \ No newline at end of file +#endif /* SOFT_SERIAL_CONFIG_H */ diff --git a/keyboards/four_banger/config.h b/keyboards/four_banger/config.h index 761ddba7151..8e0738e6d04 100644 --- a/keyboards/four_banger/config.h +++ b/keyboards/four_banger/config.h @@ -30,7 +30,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +38,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E6 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/four_banger/keymaps/default/keymap.c b/keyboards/four_banger/keymaps/default/keymap.c index 3fea0afd4fa..fc04e0fb1bc 100644 --- a/keyboards/four_banger/keymaps/default/keymap.c +++ b/keyboards/four_banger/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "four_banger.h" +#include QMK_KEYBOARD_H enum custom_keycodes { UP_URL = SAFE_RANGE diff --git a/keyboards/four_banger/readme.md b/keyboards/four_banger/readme.md index ffb6091f95c..913ca6ee85a 100644 --- a/keyboards/four_banger/readme.md +++ b/keyboards/four_banger/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make four_banger:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/fourier/config.h b/keyboards/fourier/config.h deleted file mode 100644 index 8f0524f9726..00000000000 --- a/keyboards/fourier/config.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -#ifdef SUBPROJECT_rev1 - #include "rev1/config.h" -#endif - -#endif diff --git a/keyboards/fourier/fourier.h b/keyboards/fourier/fourier.h deleted file mode 100644 index 4e9797b35b9..00000000000 --- a/keyboards/fourier/fourier.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef FOURIER_H -#define FOURIER_H - -#include "quantum.h" - -#ifdef KEYBOARD_fourier_rev1 - #include "rev1.h" -#endif - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - LA1, LA2, LA3, LA4, LA5, LA6, RA1, RA2, RA3, RA4, RA5, RA6, RA7, \ - LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB7, \ - LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC3, RC4, RC5, RC6, RC7, \ - LD1, LD2, LD3, LD4, LD5, RD1, RD4, RD5, RD6, RD7 \ - ) \ - LAYOUT( \ - KC_##LA1, KC_##LA2, KC_##LA3, KC_##LA4, KC_##LA5, KC_##LA6, KC_##RA1, KC_##RA2, KC_##RA3, KC_##RA4, KC_##RA5, KC_##RA6, KC_##RA7, \ - KC_##LB1, KC_##LB2, KC_##LB3, KC_##LB4, KC_##LB5, KC_##LB6, KC_##RB1, KC_##RB2, KC_##RB3, KC_##RB4, KC_##RB5, KC_##RB7, \ - KC_##LC1, KC_##LC2, KC_##LC3, KC_##LC4, KC_##LC5, KC_##LC6, KC_##RC1, KC_##RC3, KC_##RC4, KC_##RC5, KC_##RC6, KC_##RC7, \ - KC_##LD1, KC_##LD2, KC_##LD3, KC_##LD4, KC_##LD5, KC_##RD1, KC_##RD4, KC_##RD5, KC_##RD6, KC_##RD7 \ - ) -#endif diff --git a/keyboards/fourier/i2c.c b/keyboards/fourier/i2c.c deleted file mode 100644 index 084c890c405..00000000000 --- a/keyboards/fourier/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/fourier/keymaps/default/keymap.c b/keyboards/fourier/keymaps/default/keymap.c deleted file mode 100644 index 9c201377683..00000000000 --- a/keyboards/fourier/keymaps/default/keymap.c +++ /dev/null @@ -1,46 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, -}; - -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_FN1 MO(_FN1) -#define KC_FN2 MO(_FN2) -#define KC_SPFN1 LT(_FN1, KC_SPACE) -#define KC_BSFN2 LT(_FN2, KC_BSPC) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LALT, KC_LGUI, KC_FN1, KC_SPFN1, KC_BSFN2, KC_RGUI, KC_RALT, KC_FN2, KC_RCTL - ), - - [_FN1] = LAYOUT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, - RESET, RGB_HUI, RGB_SAI, RGB_VAI, KC_VOLU, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_SCLN, _______, - RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_VOLD, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, KC_UP, _______, - RGB_TOG, _______, _______, _______, _______, KC_DEL, KC_0, KC_LEFT, KC_DOWN, KC_RGHT - ), - - [_FN2] = LAYOUT( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, - _______, _______, _______, KC_INS, KC_PGUP, KC_HOME, _______, _______, _______, _______, KC_COLN, _______, - _______, _______, _______, KC_DEL, KC_PGDN, KC_END, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______ - ) - -}; diff --git a/keyboards/fourier/keymaps/default/rules.mk b/keyboards/fourier/keymaps/default/rules.mk deleted file mode 100644 index 457a3d01d4a..00000000000 --- a/keyboards/fourier/keymaps/default/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/fourier/keymaps/jennetters/keymap.c b/keyboards/fourier/keymaps/jennetters/keymap.c deleted file mode 100644 index 5037d3ddf5e..00000000000 --- a/keyboards/fourier/keymaps/jennetters/keymap.c +++ /dev/null @@ -1,148 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_FN1 MO(_FN1) -#define KC_FN2 MO(_FN2) -#define KC_SPFN1 LT(_FN1, KC_SPACE) -#define KC_SPFN2 LT(_FN2, KC_SPACE) -#define KC_BSFN1 LT(_FN1, KC_BSPC) -#define KC_BSFN2 LT(_FN2, KC_BSPC) -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - -//Tap Dance Declarations -enum { - ESC_GR = 0, - Q_1, - W_2, - E_3, - R_4, - T_5, - Y_6, - U_7, - I_8, - O_9, - P_0, - MIN_LB, - EQL_RB, - SCL_QUO -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_BASE] = LAYOUT( - // ,----+----+----+----+----+----|----+----+----+----+----+----+----. - // |ESC | Q1 | W2 | E3 | R4 | T5 | Y6 | U7 | I8 | O9 | P0 | -[ | =] | - // |----`----`----`----`----`----|----`----`----`----`----`----`----| - // | TAB | A | S | D | F | G | H | H | J | K | L | BKSP | - // |-----`----`----`----`----`----|----`----`----`----`----`--------| - // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHFT | - // |-------`----`----`----`----`----|----`----`----`----`----`------| - // | CTL | SYS| ALT | SP SPACE | SPACE | FN1 | CTL | \ | ENT | - // `-----+----+-----+----+--------|--------+-----+------+----+------' - - TD(ESC_GR), TD(Q_1), TD(W_2), TD(E_3), TD(R_4), TD(T_5), TD(Y_6), TD(U_7), TD(I_8), TD(O_9), TD(P_0),TD(MIN_LB),TD(EQL_RB), \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD(SCL_QUO), KC_BSPC, \ - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_FN1, KC_LCTL, KC_NUBS, KC_ENTER - ), - - [_FN1] = LAYOUT_kc( - // ,----+----+----+----+----+----|----+----+----+----+----+----+----. - // | | | UP | | | | | | | | | | | - // |----`----`----`----`----`----|----`----`----`----`----`----`----| - // | | LT | DN | RT | | | | | | | ' | DEL | - // |-----`----`----`----`----`----|----`----`----`----`----`--------| - // | | | | | | | | | | |PIPE| | - // |-------`----`----`----`----`----|----`----`----`----`----`------| - // | | | | | | | | | | | - // `-----+----+-----+----+--------|--------+-----+------+----+------' - - , , UP, , , , , , , , , , , \ - , LEFT, DOWN, RIGHT, , , , , , , QUOT, DEL, \ - , , , , , , , , , , NUBS, , \ - , , , , , , , , , - ), - - [_FN2] = LAYOUT_kc( - // ,----+----+----+----+----+----|----+----+----+----+----+----+----. - // | | | | | | | | | | | | | | - // |----`----`----`----`----`----|----`----`----`----`----`----`----| - // | | | | | | | | | | | | | - // |-----`----`----`----`----`----|----`----`----`----`----`--------| - // | | | | | | | | | | | | | - // |-------`----`----`----`----`----|----`----`----`----`----`------| - // | | | | | | | | | | | - // `-----+----+-----+----+--------|--------+-----+------+----+------' - - , , , , , , , , , , , , , \ - , , , , , , , , , , , , \ - , , , , , , , , , , , , \ - , , , , , , , , , - ) - -}; - -void esc_gr_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_ESC); - } else if (state->count == 2) { - register_code (KC_GRV); - } else { - register_code (KC_LSFT); - register_code (KC_GRV); - } -} - -void esc_gr_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_ESC); - } else if (state->count == 2) { - unregister_code (KC_GRV); - } else { - unregister_code (KC_LSFT); - unregister_code (KC_GRV); - } -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { -[ESC_GR] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, esc_gr_finished, esc_gr_reset), //Tap once for ESC, twice for `, thrice for ~ -[Q_1] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_1), //Tap once for Q, twice for 1/! -[W_2] = ACTION_TAP_DANCE_DOUBLE(KC_W, KC_2), //Tap once for W, twice for 2/@ -[E_3] = ACTION_TAP_DANCE_DOUBLE(KC_E, KC_3), //Tap once for E, twice for 3/# -[R_4] = ACTION_TAP_DANCE_DOUBLE(KC_R, KC_4), //Tap once for R, twice for 4/$ -[T_5] = ACTION_TAP_DANCE_DOUBLE(KC_T, KC_5), //Tap once for T, twice for 5/% -[Y_6] = ACTION_TAP_DANCE_DOUBLE(KC_Y, KC_6), //Tap once for Y, twice for 6/^ -[U_7] = ACTION_TAP_DANCE_DOUBLE(KC_U, KC_7), //Tap once for U, twice for 7/& -[I_8] = ACTION_TAP_DANCE_DOUBLE(KC_I, KC_8), //Tap once for I, twice for 8/* -[O_9] = ACTION_TAP_DANCE_DOUBLE(KC_O, KC_9), //Tap once for O, twice for 9/( -[P_0] = ACTION_TAP_DANCE_DOUBLE(KC_P, KC_0), //Tap once for P, twice for 0/) -[MIN_LB] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_LBRC), //Tap once for -, twice for [/{ -[EQL_RB] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_RBRC), //Tap once for =, twice for ]/} -[SCL_QUO] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT) //Tap once for ;, '/" -// Other declarations would go here, separated by commas, if you have them -}; \ No newline at end of file diff --git a/keyboards/fourier/keymaps/valgrahf/config.h b/keyboards/fourier/keymaps/valgrahf/config.h deleted file mode 100644 index 20e49c42195..00000000000 --- a/keyboards/fourier/keymaps/valgrahf/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -#endif diff --git a/keyboards/fourier/keymaps/valgrahf/keymap.c b/keyboards/fourier/keymaps/valgrahf/keymap.c deleted file mode 100644 index 4679d165c43..00000000000 --- a/keyboards/fourier/keymaps/valgrahf/keymap.c +++ /dev/null @@ -1,71 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_FN1 LT(_FN1, KC_NO) -#define KC_FN2 LT(_FN2, KC_NO) -#define KC_SPFN LT(_FN1, KC_SPACE) -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_kc( - //,----+----+----+----+----+----|----+----+----+----+----+----+----. - TAB , Q , W , E , R , T , Y , U , I , O , P , DEL,BSPC, - //|----`----`----`----`----`----|----`----`----`----`----`----`----| - ESC , A , S , D , F , G , H , J , K , L ,QUOT, SCLN , - //|-----`----`----`----`----`----|----`----`----`----`----`--------| - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, PGUP , - //|-------`----`----`----`----`----|----`----`----`----`----`------| - LCTL ,LALT, FN1, ,ENTER , SPACE , FN2 , HOME, END , PGDN - //`-----+----+-----+-------------|--------+-----+-----+-----+------' - ), - - [_FN1] = LAYOUT_kc( - //,----+----+----+----+----+----|----+----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , , - //|----`----`----`----`----`----|----`----`----`----`----`----`----| - DEL , F1 ,F2 , F3 , F4 , F5 , F6 ,MINS, EQL,LBRC,RBRC, BSLS , - //|-----`----`----`----`----`----|----`----`----`----`----`--------| - , F7 , F8 , F9 , F10, F11, F12, , , , UP , , - //|-------`----`----`----`----`----|----`----`----`----`----`------| - , , , , , ,RGUI,LEFT ,DOWN ,RIGHT - //`-----+----+-----+-------------|--------+-----+-----+-----+------' - ), - - [_FN2] = LAYOUT_kc( - //,----+----+----+----+----+----|----+----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN, , , - //|----`----`----`----`----`----|----`----`----`----`----`----`----| - DEL ,RHUI,RSAI,RVAI, , , ,UNDS,PLUS,LCBR,RCBR, PIPE , - //|-----`----`----`----`----`----|----`----`----`----`----`--------| - ,RHUD,RSAD,RVAD, , ,VOLU,VOLD, , , UP , , - //|-------`----`----`----`----`----|----`----`----`----`----`------| - ,RTOG,RMOD , , , , , LEFT, DOWN, RIGHT - //`-----+----+-----+-------------|--------+-----+-----+-----+------' - ) - -}; diff --git a/keyboards/fourier/keymaps/valgrahf/rules.mk b/keyboards/fourier/keymaps/valgrahf/rules.mk deleted file mode 100644 index 457a3d01d4a..00000000000 --- a/keyboards/fourier/keymaps/valgrahf/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/fourier/keymaps/xyverz/keymap.c b/keyboards/fourier/keymaps/xyverz/keymap.c deleted file mode 100644 index 09aaa97f7de..00000000000 --- a/keyboards/fourier/keymaps/xyverz/keymap.c +++ /dev/null @@ -1,86 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_FN1 MO(_FN1) -#define KC_FN2 MO(_FN2) -#define KC_ESFN1 LT(_FN1, KC_ESC) -#define KC_SPFN1 LT(_FN1, KC_SPACE) -#define KC_SPFN2 LT(_FN2, KC_SPACE) -#define KC_BSFN1 LT(_FN1, KC_BSPC) -#define KC_BSFN2 LT(_FN2, KC_BSPC) -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_kc( - //,----+----+----+----+----+----|----+----+----+----+----+----+----. - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH,MINS, - //|----`----`----`----`----`----|----`----`----`----`----`----`----| - ESC , A , O , E , U , I , D , H , T , N , S , ENTER , - //|-----`----`----`----`----`----|----`----`----`----`----`--------| - LSFT ,SCLN, Q , J , K , X , B , M , W , V , Z , RSFT , - //|-------`----`----`----`----`----|----`----`----`----`----`------| - LCTL ,LALT,LGUI ,FN2 , BSPC , SPC , FN1 ,RGUI ,RALT , RCTL - //`-----+----+-----+----+--------|--------+-----+-----+-----+------' - ), - - [_FN1] = LAYOUT_kc( - //,----+----+----+----+----+----|----+----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , - //|----`----`----`----`----`----|----`----`----`----`----`----`----| - CAPS ,RHUI,RSAI,RVAI,VOLU,LBRC,RBRC, , , ,SCLN, , - //|-----`----`----`----`----`----|----`----`----`----`----`--------| - RMOD ,RHUD,RSAD,RVAD,VOLD,LCBR,RCBR, , , , UP , , - //|-------`----`----`----`----`----|----`----`----`----`----`------| - RTOG , , , , DEL , INS , ,LEFT ,DOWN , RGHT - //`-----+----+-----+----+--------|--------+-----+-----+-----+------' - ), - - [_FN2] = LAYOUT_kc( - //,----+----+----+----+----+----|----+----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN,UNDS,PLUS, - //|----`----`----`----`----`----|----`----`----`----`----`----`----| - CAPS , , ,INS ,PGUP,HOME, F1 , F2 , F3 , F4 , F5 , F6 , - //|-----`----`----`----`----`----|----`----`----`----`----`--------| - , , ,DEL ,PGDN,END , F7 , F8 , F9 ,F10 ,F11 , F12 , - //|-------`----`----`----`----`----|----`----`----`----`----`------| - , , , , DEL , INS , , , , - //`-----+----+-----+----+--------|--------+-----+-----+-----+------' - ) - -}; - -void matrix_init_user(void) { - // This will disable the red LEDs on the ProMicros - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); -}; - diff --git a/keyboards/fourier/matrix.c b/keyboards/fourier/matrix.c deleted file mode 100644 index fdeead7dc70..00000000000 --- a/keyboards/fourier/matrix.c +++ /dev/null @@ -1,467 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" -#include "backlight.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define SERIAL_LED_ADDR 0x00 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); - -} - -uint8_t _matrix_scan(void) -{ - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); -#if (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level(); -#endif - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); -#endif -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/fourier/readme.md b/keyboards/fourier/readme.md deleted file mode 100644 index 9420fb30e52..00000000000 --- a/keyboards/fourier/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -Fourier -======== - -A split 40% staggered keyboard made and sold by Keebio. [More info at Keebio](https://keeb.io). - -Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io/collections/frontpage/products/fourier-40-split-staggered-keyboard) - -Make example for this keyboard (after setting up your build environment): - - make fourier/rev1:default - -Example of flashing this keyboard: - - make fourier/rev1:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -A build guide for this keyboard can be found here: [Keebio Build Guides](https://docs.keeb.io) diff --git a/keyboards/fourier/rev1/config.h b/keyboards/fourier/rev1/config.h deleted file mode 100644 index 3bd67228c3d..00000000000 --- a/keyboards/fourier/rev1/config.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include "../config.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCB10 -#define PRODUCT_ID 0x1247 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Fourier -#define DESCRIPTION Split 40 percent staggered keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 8 -#define MATRIX_COLS 7 - -// wiring of each half -#define MATRIX_ROW_PINS { F4, D7, E6, B4 } -#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 14 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - - -#endif diff --git a/keyboards/fourier/rev1/rev1.c b/keyboards/fourier/rev1/rev1.c deleted file mode 100644 index 61d7139d6c8..00000000000 --- a/keyboards/fourier/rev1/rev1.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "fourier.h" - - -void matrix_init_kb(void) { - matrix_init_user(); -}; - diff --git a/keyboards/fourier/rev1/rev1.h b/keyboards/fourier/rev1/rev1.h deleted file mode 100644 index 9ef9b92330b..00000000000 --- a/keyboards/fourier/rev1/rev1.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef REV1_H -#define REV1_H - -#include "../fourier.h" - -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -#define LAYOUT( \ - LA1, LA2, LA3, LA4, LA5, LA6, RA1, RA2, RA3, RA4, RA5, RA6, RA7, \ - LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB7, \ - LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC3, RC4, RC5, RC6, RC7, \ - LD1, LD2, LD3, LD4, LD5, RD1, RD4, RD5, RD6, RD7 \ - ) \ - { \ - { LA1, LA2, LA3, LA4, LA5, LA6, KC_NO}, \ - { LB1, LB2, LB3, LB4, LB5, LB6, KC_NO}, \ - { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO}, \ - { LD1, LD2, LD3, LD4, LD5, KC_NO, KC_NO}, \ - { RA1, RA2, RA3, RA4, RA5, RA6, RA7}, \ - { RB1, RB2, RB3, RB4, RB5, KC_NO, RB7}, \ - { RC1, KC_NO, RC3, RC4, RC5, RC6, RC7}, \ - { RD1, KC_NO, KC_NO, RD4, RD5, RD6, RD7} \ - } - -#endif diff --git a/keyboards/fourier/rules.mk b/keyboards/fourier/rules.mk deleted file mode 100644 index 9ec05e87400..00000000000 --- a/keyboards/fourier/rules.mk +++ /dev/null @@ -1,74 +0,0 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -CUSTOM_MATRIX = yes - -DEFAULT_FOLDER = fourier/rev1 diff --git a/keyboards/fourier/serial.c b/keyboards/fourier/serial.c deleted file mode 100644 index 74bcbb6bf6e..00000000000 --- a/keyboards/fourier/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/fourier/serial.h b/keyboards/fourier/serial.h deleted file mode 100644 index 15fe4db7b4c..00000000000 --- a/keyboards/fourier/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/fourier/split_util.c b/keyboards/fourier/split_util.c deleted file mode 100644 index 2704e30e043..00000000000 --- a/keyboards/fourier/split_util.c +++ /dev/null @@ -1,80 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" -#include "pincontrol.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - // Test D2 pin for handedness, if D2 is grounded, it's the right hand - pinMode(D2, PinDirectionInput); - isLeftHand = digitalRead(D2); -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init(); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/foxlab/leaf60/hotswap/config.h b/keyboards/foxlab/leaf60/hotswap/config.h new file mode 100644 index 00000000000..752b403c509 --- /dev/null +++ b/keyboards/foxlab/leaf60/hotswap/config.h @@ -0,0 +1,229 @@ +/* +Copyright 2019 Fox Lab + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Fox Lab +#define PRODUCT Leaf60 Hotswap +#define DESCRIPTION A custom hotswap 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D2, D1, D0, D3, D5 } +#define MATRIX_COL_PINS { F5, F4, F1, F0, B0, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 4 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 8 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/foxlab/leaf60/hotswap/hotswap.c b/keyboards/foxlab/leaf60/hotswap/hotswap.c new file mode 100644 index 00000000000..20778d927d2 --- /dev/null +++ b/keyboards/foxlab/leaf60/hotswap/hotswap.c @@ -0,0 +1,59 @@ +/* Copyright 2019 Fox Lab + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "hotswap.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(E6); + matrix_init_user(); +} +/* + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + led_set_user(usb_led); +} diff --git a/keyboards/foxlab/leaf60/hotswap/hotswap.h b/keyboards/foxlab/leaf60/hotswap/hotswap.h new file mode 100644 index 00000000000..eaf0b2d3aed --- /dev/null +++ b/keyboards/foxlab/leaf60/hotswap/hotswap.h @@ -0,0 +1,40 @@ +/* Copyright 2019 Fox Lab + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_60_tsangan_hhkb( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K407, K411, K412, K413 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, KC_NO, K407, KC_NO, KC_NO, KC_NO, K411, K412, K413, KC_NO } \ +} diff --git a/keyboards/foxlab/leaf60/hotswap/info.json b/keyboards/foxlab/leaf60/hotswap/info.json new file mode 100644 index 00000000000..1e8daa704d7 --- /dev/null +++ b/keyboards/foxlab/leaf60/hotswap/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Fox Lab Hotswap Leaf60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_tsangan_hhkb": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.5}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}, {"x":13.5, "y":4, "w":1.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/foxlab/leaf60/hotswap/keymaps/default/config.h b/keyboards/foxlab/leaf60/hotswap/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/foxlab/leaf60/hotswap/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/foxlab/leaf60/hotswap/keymaps/default/keymap.c b/keyboards/foxlab/leaf60/hotswap/keymaps/default/keymap.c new file mode 100644 index 00000000000..3f9ea1b49c5 --- /dev/null +++ b/keyboards/foxlab/leaf60/hotswap/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2019 Fox Lab + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_60_tsangan_hhkb( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RCTL), + + LAYOUT_60_tsangan_hhkb( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/foxlab/leaf60/hotswap/keymaps/default/readme.md b/keyboards/foxlab/leaf60/hotswap/keymaps/default/readme.md new file mode 100644 index 00000000000..870439f268a --- /dev/null +++ b/keyboards/foxlab/leaf60/hotswap/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Fox Lab Hotswap Leaf60 \ No newline at end of file diff --git a/keyboards/foxlab/leaf60/hotswap/readme.md b/keyboards/foxlab/leaf60/hotswap/readme.md new file mode 100644 index 00000000000..cdec1870d74 --- /dev/null +++ b/keyboards/foxlab/leaf60/hotswap/readme.md @@ -0,0 +1,13 @@ +# Fox Lab Hotswap Leaf60 + +A hotswap, Tsangan-layout, gasket-mount 60% keyboard. + +Keyboard Maintainer: [Fox Lab](https://github.com/fox-lab), [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Leaf60 powered by the ATmega32U4 +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=99002.0) + +Make example for this keyboard (after setting up your build environment): + + make foxlab/leaf60/hotswap:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/foxlab/leaf60/hotswap/rules.mk b/keyboards/foxlab/leaf60/hotswap/rules.mk new file mode 100644 index 00000000000..75ee00a1a9c --- /dev/null +++ b/keyboards/foxlab/leaf60/hotswap/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/foxlab/leaf60/readme.md b/keyboards/foxlab/leaf60/readme.md new file mode 100644 index 00000000000..994915680ca --- /dev/null +++ b/keyboards/foxlab/leaf60/readme.md @@ -0,0 +1,7 @@ +# Fox Lab Leaf60 + +The Leaf60 is a 60% gasket mount board sold via [Geekhack Group Buy](https://geekhack.org/index.php?topic=99002.0). + +It was available with a universal layout PCB and a hotswap tsangan PCB. + +**Firmware generated for one PCB will not work on the other.** \ No newline at end of file diff --git a/keyboards/foxlab/leaf60/universal/config.h b/keyboards/foxlab/leaf60/universal/config.h new file mode 100644 index 00000000000..f038430f931 --- /dev/null +++ b/keyboards/foxlab/leaf60/universal/config.h @@ -0,0 +1,229 @@ +/* +Copyright 2019 Fox Lab + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Fox Lab +#define PRODUCT Leaf60 Universal +#define DESCRIPTION A custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, F0, F4, F1 } +#define MATRIX_COL_PINS { B0, F5, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4, D5, D3, D2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 8 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/foxlab/leaf60/universal/info.json b/keyboards/foxlab/leaf60/universal/info.json new file mode 100644 index 00000000000..f08503377fe --- /dev/null +++ b/keyboards/foxlab/leaf60/universal/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "Fox Lab Leaf60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_hhkb": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/foxlab/leaf60/universal/keymaps/default/config.h b/keyboards/foxlab/leaf60/universal/keymaps/default/config.h new file mode 100644 index 00000000000..d8f6533c6ba --- /dev/null +++ b/keyboards/foxlab/leaf60/universal/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Fox Lab + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/foxlab/leaf60/universal/keymaps/default/keymap.c b/keyboards/foxlab/leaf60/universal/keymaps/default/keymap.c new file mode 100644 index 00000000000..ff84fa39995 --- /dev/null +++ b/keyboards/foxlab/leaf60/universal/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2019 Fox Lab + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL), + + LAYOUT_all( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/foxlab/leaf60/universal/keymaps/default/readme.md b/keyboards/foxlab/leaf60/universal/keymaps/default/readme.md new file mode 100644 index 00000000000..a9f03336743 --- /dev/null +++ b/keyboards/foxlab/leaf60/universal/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Universal Leaf60 \ No newline at end of file diff --git a/keyboards/foxlab/leaf60/universal/readme.md b/keyboards/foxlab/leaf60/universal/readme.md new file mode 100644 index 00000000000..b65f1d40f40 --- /dev/null +++ b/keyboards/foxlab/leaf60/universal/readme.md @@ -0,0 +1,13 @@ +# Fox Lab Leaf60 + +A 60% gasket sandwich made by Fox Lab. + +Keyboard Maintainer: [Fox Lab](https://github.com/fox-lab), [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Leaf60 powered by the ATmega32U4 +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=99002.0) + +Make example for this keyboard (after setting up your build environment): + + make foxlab/leaf60/universal:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/foxlab/leaf60/universal/rules.mk b/keyboards/foxlab/leaf60/universal/rules.mk new file mode 100644 index 00000000000..a865410333a --- /dev/null +++ b/keyboards/foxlab/leaf60/universal/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = 60_ansi 60_hhkb diff --git a/keyboards/foxlab/leaf60/universal/universal.c b/keyboards/foxlab/leaf60/universal/universal.c new file mode 100644 index 00000000000..5fe663a1bff --- /dev/null +++ b/keyboards/foxlab/leaf60/universal/universal.c @@ -0,0 +1,61 @@ +/* Copyright 2019 Fox Lab + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "universal.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(E6); + matrix_init_user(); +} + +/* + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ + + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + led_set_user(usb_led); +} diff --git a/keyboards/foxlab/leaf60/universal/universal.h b/keyboards/foxlab/leaf60/universal/universal.h new file mode 100644 index 00000000000..8d8f836185f --- /dev/null +++ b/keyboards/foxlab/leaf60/universal/universal.h @@ -0,0 +1,68 @@ +/* Copyright 2019 Fox Lab + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K404, K406, K408, K410, K411, K412, K413 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO }, \ + { K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, KC_NO } \ +} + +#define LAYOUT_60_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K401, K402, K406, K410, K411, K412, K413 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, KC_NO }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \ +} + +#define LAYOUT_60_hhkb( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K401, K402, K406, K411, K412 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO }, \ + { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, K412, KC_NO, KC_NO } \ +} diff --git a/keyboards/fractal/config.h b/keyboards/fractal/config.h index 396c3b4b949..f67f61c13ff 100755 --- a/keyboards/fractal/config.h +++ b/keyboards/fractal/config.h @@ -31,7 +31,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -39,11 +39,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/fractal/fractal.h b/keyboards/fractal/fractal.h index 1eefcecd753..0af7c22390a 100755 --- a/keyboards/fractal/fractal.h +++ b/keyboards/fractal/fractal.h @@ -1,5 +1,4 @@ -#ifndef FRACTAL_H -#define FRACTAL_H +#pragma once #include "quantum.h" @@ -30,7 +29,3 @@ { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 }, \ { K400, K401, K402, K403, K404, KC_NO, K406, K407, K408, K409, K410, K411 } \ } - -#define KEYMAP LAYOUT_preonic_mit - -#endif diff --git a/keyboards/fractal/readme.md b/keyboards/fractal/readme.md index 1bb41cf7ffb..3b9e59d2172 100644 --- a/keyboards/fractal/readme.md +++ b/keyboards/fractal/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make fractal:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/fractal/rules.mk b/keyboards/fractal/rules.mk index b5808c15eaf..0de2a7d39f7 100755 --- a/keyboards/fractal/rules.mk +++ b/keyboards/fractal/rules.mk @@ -57,5 +57,5 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 -LAYOUTS = preonic_mit ortho_5x12 +LAYOUTS = ortho_5x12 # preonic_mit LAYOUTS_HAS_RGB = no diff --git a/keyboards/ft/mars80/config.h b/keyboards/ft/mars80/config.h new file mode 100644 index 00000000000..1bf93928725 --- /dev/null +++ b/keyboards/ft/mars80/config.h @@ -0,0 +1,48 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define DEVICE_VER 0x0001 +#define MANUFACTURER FT +#define PRODUCT Mars 8.0 +#define DESCRIPTION A custom TKL Keyboard + +#define RGBLED_NUM 20 + +#define MATRIX_ROWS 7 +#define MATRIX_COLS 14 +// 0 1 2 3 4 5 6 7 8 9 A B C D +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2 } +#define UNUSED_PINS {} + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCE 5 + +#define BACKLIGHT_LEVELS 1 +#define RGBLIGHT_ANIMATIONS + +#define NO_UART 1 + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/ft/mars80/info.json b/keyboards/ft/mars80/info.json new file mode 100644 index 00000000000..7d71cd040a8 --- /dev/null +++ b/keyboards/ft/mars80/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Mars 8.0", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_tkl_ansi": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5, "w":2}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.5, "y":2.5, "w":1.5}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5, "w":2.25}, {"x":0, "y":4.5, "w":2.25}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":2.75}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5, "w":1.25}, {"x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"x":10, "y":5.5, "w":1.25}, {"x":11.25, "y":5.5, "w":1.25}, {"x":12.5, "y":5.5, "w":1.25}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + }, + + "LAYOUT_tkl_iso": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5, "w":2}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.75, "y":2.5, "w":1.25, "h":2}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":2.75}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5, "w":1.25}, {"x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"x":10, "y":5.5, "w":1.25}, {"x":11.25, "y":5.5, "w":1.25}, {"x":12.5, "y":5.5, "w":1.25}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/ft/mars80/keymaps/default/config.h b/keyboards/ft/mars80/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/ft/mars80/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/ft/mars80/keymaps/default/keymap.c b/keyboards/ft/mars80/keymaps/default/keymap.c new file mode 100644 index 00000000000..ba7ef83d987 --- /dev/null +++ b/keyboards/ft/mars80/keymaps/default/keymap.c @@ -0,0 +1,75 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT_tkl_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSEL, \ + _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/ft/mars80/keymaps/default/readme.md b/keyboards/ft/mars80/keymaps/default/readme.md new file mode 100644 index 00000000000..180935f5d4a --- /dev/null +++ b/keyboards/ft/mars80/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Mars 8.0 \ No newline at end of file diff --git a/keyboards/ft/mars80/mars80.c b/keyboards/ft/mars80/mars80.c new file mode 100644 index 00000000000..75434508223 --- /dev/null +++ b/keyboards/ft/mars80/mars80.c @@ -0,0 +1,91 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "mars80.h" + +#include "rgblight.h" +#include "i2c_master.h" +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +void matrix_init_kb(void) { +#ifdef RGBLIGHT_ENABLE + if (rgblight_config.enable) { + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + } +#endif + // call user level keymaps, if any + matrix_init_user(); +} + +void matrix_scan_kb(void) { +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif + matrix_scan_user(); + /* Nothing else for now. */ +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // turn backlight LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} \ No newline at end of file diff --git a/keyboards/ft/mars80/mars80.h b/keyboards/ft/mars80/mars80.h new file mode 100644 index 00000000000..6308d06d0df --- /dev/null +++ b/keyboards/ft/mars80/mars80.h @@ -0,0 +1,63 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT_tkl_iso( \ + k11, k13, k14, k15, k16, k18, k19, k1A, k1B, k1C, k10, k1D, k12, k02, k03, k00, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k20, k2D, k07, k06, k05, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k30, k0D, k09, k08, \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k3D, k40, \ + k51, k4D, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, k5D, \ + k61, k62, k63, k65, k69, k6A, k6B, k6C, k60, k6D, k68 \ +) \ +{ \ + { k00, KC_NO, k02, k03, KC_NO, k05, k06, k07, k08, k09, KC_NO, KC_NO, KC_NO, k0D }, \ + { k10, k11, k12, k13, k14, k15, k16, KC_NO, k18, k19, k1A, k1B, k1C, k1D }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, k5D }, \ + { k60, k61, k62, k63, KC_NO, k65, KC_NO, KC_NO, k68, k69, k6A, k6B, k6C, k6D }, \ +} + +#define LAYOUT_tkl_ansi( \ + k11, k13, k14, k15, k16, k18, k19, k1A, k1B, k1C, k10, k1D, k12, k02, k03, k00, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k20, k2D, k07, k06, k05, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k30, k3D, k0D, k09, k08, \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k40, \ + k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, k5D, \ + k61, k62, k63, k65, k69, k6A, k6B, k6C, k60, k6D, k68 \ +) \ +{ \ + { k00, KC_NO, k02, k03, KC_NO, k05, k06, k07, k08, k09, KC_NO, KC_NO, KC_NO, k0D }, \ + { k10, k11, k12, k13, k14, k15, k16, KC_NO, k18, k19, k1A, k1B, k1C, k1D }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, KC_NO }, \ + { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, k5D }, \ + { k60, k61, k62, k63, KC_NO, k65, KC_NO, KC_NO, k68, k69, k6A, k6B, k6C, k6D }, \ +} diff --git a/keyboards/ft/mars80/readme.md b/keyboards/ft/mars80/readme.md new file mode 100644 index 00000000000..96227513341 --- /dev/null +++ b/keyboards/ft/mars80/readme.md @@ -0,0 +1,44 @@ +# Mars 8.0 + +TKL Keyboard with in switch backlight and RGB Underglow. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Mars 8.0 PCB +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=93723.0) + +Make example for this keyboard (after setting up your build environment): + + make ft/mars80:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +**Reset Key:** Hold down the key located at `K00`, commonly programmed as `Pause/Break` while plugging in the keyboard. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ft/mars80/rules.mk b/keyboards/ft/mars80/rules.mk new file mode 100644 index 00000000000..159307f8d0c --- /dev/null +++ b/keyboards/ft/mars80/rules.mk @@ -0,0 +1,50 @@ +# Copyright 2019 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +SRC += i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex + +LAYOUTS = tkl_ansi tkl_iso diff --git a/keyboards/ft/mars80/usbconfig.h b/keyboards/ft/mars80/usbconfig.h new file mode 100644 index 00000000000..338b67f5839 --- /dev/null +++ b/keyboards/ft/mars80/usbconfig.h @@ -0,0 +1,393 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'f', 't' +#define USB_CFG_VENDOR_NAME_LEN 2 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'm', 'a', 'r', 's', '8', '0' +#define USB_CFG_DEVICE_NAME_LEN 6 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect diff --git a/keyboards/geekboards/tester/config.h b/keyboards/geekboards/tester/config.h new file mode 100644 index 00000000000..ac67877ffc4 --- /dev/null +++ b/keyboards/geekboards/tester/config.h @@ -0,0 +1,39 @@ +#pragma once + +#include "config_common.h" + + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1319 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Geekboards +#define PRODUCT Geekboards Tester +#define DESCRIPTION Geekboards 8-keys macropad + + +#define MATRIX_ROWS 2 +#define MATRIX_COLS 4 + +#define MATRIX_ROW_PINS { B0, D4} +#define MATRIX_COL_PINS { F7, F6, D2, D3} +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW +#define LOCKING_SUPPORT_ENABL +#define LOCKING_RESYNC_ENABLE + +#define DEBOUNCE 3 +#define RGB_DISABLE_AFTER_TIMEOUT 0 +#define RGB_DISABLE_WHEN_USB_SUSPENDED true +#define RGB_MATRIX_KEYPRESSES +#define DISABLE_RGB_MATRIX_SPLASH +#define DISABLE_RGB_MATRIX_MULTISPLASH +#define DISABLE_RGB_MATRIX_SOLID_SPLASH +#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110101 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 8 +#define DRIVER_2_LED_TOTAL 0 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) diff --git a/keyboards/geekboards/tester/keymaps/default/keymap.c b/keyboards/geekboards/tester/keymaps/default/keymap.c new file mode 100644 index 00000000000..e68f15f63dd --- /dev/null +++ b/keyboards/geekboards/tester/keymaps/default/keymap.c @@ -0,0 +1,23 @@ +#include QMK_KEYBOARD_H +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT( /* Base */ + RGB_MOD, KC_1, KC_2, KC_3, + KC_4, KC_5, KC_6, MO(1) + ), +[1] = LAYOUT( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, + KC_F4, KC_F5, KC_F6, KC_F7 + ), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/geekboards/tester/readme.md b/keyboards/geekboards/tester/readme.md new file mode 100644 index 00000000000..7da0693082a --- /dev/null +++ b/keyboards/geekboards/tester/readme.md @@ -0,0 +1,12 @@ +Geekboards 8-keys macropad +===== + +Keyboard Maintainer: [dztech](https://github.com/moyi4681) +Hardware Supported: Geekboards 8-keys macropad +Hardware Availability: geekboards.ru(https://geekboards.ru/) + +Make example for this keyboard (after setting up your build environment): + + make geekboards/tester:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/geekboards/tester/rules.mk b/keyboards/geekboards/tester/rules.mk new file mode 100644 index 00000000000..7e8d595fb71 --- /dev/null +++ b/keyboards/geekboards/tester/rules.mk @@ -0,0 +1,68 @@ +# MCU name +MCU = atmega32u4 + +# project specific files +#SRC = + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section +BOOTLOADER = qmk-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +RGB_MATRIX_ENABLE = yes # Use RGB matrix diff --git a/keyboards/geekboards/tester/tester.c b/keyboards/geekboards/tester/tester.c new file mode 100644 index 00000000000..4fab1a7012f --- /dev/null +++ b/keyboards/geekboards/tester/tester.c @@ -0,0 +1,56 @@ +#include "tester.h" +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C1_1, C3_2, C4_2}, //A1 + {0, C1_2, C2_2, C4_3}, //A2 + {0, C1_3, C2_3, C3_3}, //A3 + {0, C1_4, C2_4, C3_4}, //A4 + {0, C1_5, C2_5, C3_5}, //A5 + {0, C1_6, C2_6, C3_6}, //A6 + {0, C1_7, C2_7, C3_7}, //A7 + {0, C1_8, C2_8, C3_8}, //A8 +}; + +led_config_t g_led_config = { +{ + { 0, 1, 2, 3}, + { 4, 5, 6, 7} +}, +{ + { 0, 0 }, { 75, 0 }, { 151, 0 }, { 224, 0 }, { 0, 64 }, { 75, 64 }, { 151, 64 }, { 224, 64 } +}, +{ + 4, 4, 4, 4, 4, 4, 4, 4 +} +}; + + + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} + +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} diff --git a/keyboards/geekboards/tester/tester.h b/keyboards/geekboards/tester/tester.h new file mode 100644 index 00000000000..28c555f0b60 --- /dev/null +++ b/keyboards/geekboards/tester/tester.h @@ -0,0 +1,10 @@ +#pragma once +#include "quantum.h" +#define LAYOUT( \ + k00, k01, k02, k03,\ + k10, k11, k12, k13\ +) \ +{ \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 } \ +} diff --git a/keyboards/georgi/config.h b/keyboards/georgi/config.h new file mode 100644 index 00000000000..49d54adcd88 --- /dev/null +++ b/keyboards/georgi/config.h @@ -0,0 +1,73 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +// Copy and worked on with love from the EZ team + +#pragma once +#include "config_common.h" + +/* Defaults */ + +#define VERSION "v1.1: ClayM" +#define VERBOSE + +#define FORCE_NKRO +#define NO_ACTION_FUNCTION +#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO +#define IGNORE_MOD_TAP_INTERRUPT + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1337 +#define DEVICE_VER 0x0001 +#define MANUFACTURER g Heavy Industries +#define PRODUCT Georgi +#define DESCRIPTION QMK keyboard firmware for Georgi + +/* key matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2) +#define MATRIX_COLS 4 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 +#define TAPPING_TOGGLE 2 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ +) + +#define DEBOUNCE 5 +#define USB_MAX_POWER_CONSUMPTION 500 diff --git a/keyboards/georgi/georgi.c b/keyboards/georgi/georgi.c new file mode 100644 index 00000000000..8866886ce7c --- /dev/null +++ b/keyboards/georgi/georgi.c @@ -0,0 +1,68 @@ +#include QMK_KEYBOARD_H + +bool i2c_initialized = 0; +i2c_status_t mcp23018_status = 0x20; + +void matrix_init_kb(void) { + steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT + + // (tied to Vcc for hardware convenience) + //DDRB &= ~(1<<4); // set B(4) as input + //PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + + // unused pins - C7, D4, D5, D7, E6 + // set as input with internal pull-up enabled + DDRC &= ~(1<<7); + DDRD &= ~(1<<5 | 1<<4 | 1<<6 | 1<<7); + DDRE &= ~(1<<6); + PORTC |= (1<<7); + PORTD |= (1<<5 | 1<<4 | 1<<6 | 1<<7); + PORTE |= (1<<6); + + matrix_init_user(); +} + + +uint8_t init_mcp23018(void) { + print("starting init"); + mcp23018_status = 0x20; + + // I2C subsystem + + // uint8_t sreg_prev; + // sreg_prev=SREG; + // cli(); + + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized = true; + _delay_ms(1000); + } + // i2c_init(); // on pins D(1,0) + // _delay_ms(1000); + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + i2c_stop(); + + // set pull-up + // - unused : on : 1 + // - input : on : 1 + // - driving : off : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + +out: + i2c_stop(); + // SREG=sreg_prev; + //uprintf("Init %x\n", mcp23018_status); + return mcp23018_status; +} diff --git a/keyboards/georgi/georgi.h b/keyboards/georgi/georgi.h new file mode 100644 index 00000000000..df6bb6ea9a4 --- /dev/null +++ b/keyboards/georgi/georgi.h @@ -0,0 +1,82 @@ +#pragma once +#include +#include +#include +#include "quantum.h" +#include "i2c_master.h" +#include "matrix.h" + + +extern i2c_status_t mcp23018_status; +#define ERGODOX_EZ_I2C_TIMEOUT 1000 +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +// I2C aliases and register addresses (see "mcp23018.md") +//#define I2C_ADDR 0b0100000 +#define I2C_ADDR 0x20 +#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) +#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +void init_ergodox(void); +uint8_t init_mcp23018(void); + +/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ +#define LAYOUT_georgi( \ + L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05, \ + L10,L11,L12,L13,L14,L15, R10,R11,R12,R13,R14,R15, \ + L20,L21,L22, R20,R21,R22) \ + \ + { \ + { KC_NO, R00, R10, R21}, \ + { KC_NO, R01, R11, R20}, \ + { KC_NO, R02, R12, R22}, \ + { KC_NO, R03, R13, KC_NO}, \ + { KC_NO, R04, R14, KC_NO}, \ + { KC_NO, R05, R15, KC_NO}, \ + { KC_NO, KC_NO, KC_NO, KC_NO}, \ + \ + { KC_NO, L05, L15, L22}, \ + { KC_NO, L04, L14, L21}, \ + { KC_NO, L03, L13, L20}, \ + { KC_NO, L02, L12, KC_NO}, \ + { KC_NO, L01, L11, KC_NO}, \ + { KC_NO, L00, L10, KC_NO}, \ + { KC_NO, KC_NO, KC_NO, KC_NO}, \ + \ +} + +/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- +#define LAYOUT_GERGO( \ + L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05, \ + L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ + L20,L21,L22,L23,L24,L25,L26, R20,R21,R22,R23,R24,R25,R26, \ + L31,L32, R33,R34, \ + L30, R30, \ + L33,L34, R31,R32) \ + \ + { \ + { KC_NO, L16, L26, L30}, \ + { L05, L15, L25, L34}, \ + { L04, L14, L24, L33}, \ + { L03, L13, L23, L32}, \ + { L02, L12, L22, L31}, \ + { L01, L11, L21, KC_NO}, \ + { L00, L10, L20, KC_NO}, \ + \ + { KC_NO, R10, R20, R30}, \ + { R00, R11, R21, R31}, \ + { R01, R12, R22, R32}, \ + { R02, R13, R23, R33}, \ + { R03, R14, R24, R34}, \ + { R04, R15, R25, KC_NO}, \ + { R05, R16, R26, KC_NO}, \ +} */ diff --git a/keyboards/georgi/info.json b/keyboards/georgi/info.json new file mode 100644 index 00000000000..d0752e2cd3e --- /dev/null +++ b/keyboards/georgi/info.json @@ -0,0 +1,133 @@ +{ + "keyboard_name": "Georgi", + "url": "http://gboards.ca", + "maintainer": "germ", + "width": 13.2, + "height": 3.68, + "layouts": { + "LAYOUT_georgi": { + "layout": [ + { + "x": 0.05, + "y": 0.54 + }, + { + "x": 1.06, + "y": 0.55 + }, + { + "x": 2.06, + "y": 0.29 + }, + { + "x": 3.05, + "y": 0.16 + }, + { + "x": 4.06, + "y": 0.41 + }, + { + "x": 5.06, + "y": 0.54 + }, + { + "x": 7.1899999999999995, + "y": 0.41 + }, + { + "x": 8.2, + "y": 0.3 + }, + { + "x": 9.2, + "y": 0.05 + }, + { + "x": 10.2, + "y": 0.29 + }, + { + "x": 11.2, + "y": 0.43 + }, + { + "x": 12.2, + "y": 0.42 + }, + { + "x": 0.05, + "y": 1.54 + }, + { + "x": 1.06, + "y": 1.54 + }, + { + "x": 2.06, + "y": 1.28 + }, + { + "x": 3.05, + "y": 1.16 + }, + { + "x": 4.06, + "y": 1.4 + }, + { + "x": 5.06, + "y": 1.54 + }, + { + "x": 7.1899999999999995, + "y": 1.4 + }, + { + "x": 8.2, + "y": 1.28 + }, + { + "x": 9.2, + "y": 1.04 + }, + { + "x": 10.2, + "y": 1.28 + }, + { + "x": 11.2, + "y": 1.42 + }, + { + "x": 12.2, + "y": 1.42 + }, + { + "x": 3.05, + "y": 2.67 + }, + { + "x": 4.06, + "y": 2.68 + }, + { + "x": 5.06, + "y": 2.68 + }, + { + "x": 7.19, + "y": 2.67 + }, + { + "x": 8.2, + "y": 2.67 + }, + { + "x": 9.2, + "y": 2.66 + } + ] + } + } +} diff --git a/keyboards/georgi/keymaps/colemak-dh/keymap.c b/keyboards/georgi/keymaps/colemak-dh/keymap.c new file mode 100644 index 00000000000..29b35f6abd9 --- /dev/null +++ b/keyboards/georgi/keymaps/colemak-dh/keymap.c @@ -0,0 +1,306 @@ +/* + * Good on you for modifying your layout, this is the most nonQMK layout you will come across + * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer + * + * Don't modify the steno layer directly, instead add chords using the keycodes and macros + * from sten.h to the layout you want to modify. + * + * Observe the comment above processQWERTY! + * + * http://docs.gboards.ca + */ + +#include QMK_KEYBOARD_H +#include "sten.h" +#include "keymap_steno.h" +#define IGNORE_MOD_TAP_INTERRUPT + +// Steno Layers +#define FUNCT ( LSD | LK | LP | LH ) +#define MEDIA ( LSD | LK | LW | LR ) +#define MOVE ( LSD | LK ) +#define NUM ( PWR ) +#define SYM ( RZ ) + +// Keys and chords that, once they appear, are added to every subsequent partial chord +// until the whole thing is sent. +uint32_t stenoLayers[] = {NUM, SYM, MOVE, MEDIA, FUNCT}; + +// QMK Layers +#define STENO_LAYER 0 +#define GAMING 1 +#define GAMING_2 2 + +/* Keyboard Layout + * ,---------------------------------. ,------------------------------. + * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD | + * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----| + * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | RB | RG | RS | RZ | + * `---------------------------------' `------------------------------' + * ,---------------, .---------------. + * | LNO | LA | LO | | RE | RU | RNO | + * `---------------' `---------------' + */ + +// Note: You can only use basic keycodes here! +// +// P() is just a wrapper to make your life easier. +// PC() applies the mapping to all of the StenoLayers. For overloading, define these last. +// +// FN is unavailable. That is reserved for system use. +// Chords containing PWR are always available, even in steno mode. +// +// http://docs.gboards.ca +uint32_t processQwerty(bool lookup) { + // Special keys + P( RT | RS | RD | RZ | LNO, SEND_STRING(VERSION); SEND_STRING(__DATE__)); + P( LFT | LK | LP | LW, REPEAT()); + + // Mouse Keys + /* P( LO | LSD | LK, CLICK_MOUSE(KC_MS_BTN2)); */ + /* P( LO | LR | LW, CLICK_MOUSE(KC_MS_BTN1)); */ + + +/* Function layer + * ,-----------------------------------, ,-----------------------------------, + * | | | | NCTFUNCTF | | | | F1 | F2 | F3 | F4 | | + * | + + + + + | | + F5 + F6 + F7 + F8 + | + * | | FUNCTFUNC | | | | | | F9 | F10 | F11 | F12 | | + * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----' +*/ + P( FUNCT | RF, SEND(KC_F1)); + P( FUNCT | RP, SEND(KC_F2)); + P( FUNCT | RL, SEND(KC_F3)); + P( FUNCT | RT, SEND(KC_F4)); + + P( FUNCT | RF | RR, SEND(KC_F5)); + P( FUNCT | RP | RB, SEND(KC_F6)); + P( FUNCT | RL | RG, SEND(KC_F7)); + P( FUNCT | RT | RS, SEND(KC_F8)); + + P( FUNCT | RR, SEND(KC_F9)); + P( FUNCT | RG, SEND(KC_F10)); + P( FUNCT | RB, SEND(KC_F11)); + P( FUNCT | RS, SEND(KC_F12)); + + +/* Movement layer + * ,-----------------------------------, ,-----------------------------------, + * | | | | | | | | | <- | ↓ | ↑ | -> | | + * | + + + + + | | + + + + + | + * | | MOVEMOVEM | | | | | | Hm | PgD | PgU | End | | + * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----' +*/ + P( MOVE | RF, SEND(KC_LEFT)); + P( MOVE | RP, SEND(KC_DOWN)); + P( MOVE | RL, SEND(KC_UP)); + P( MOVE | RT, SEND(KC_RIGHT)); + + P( MOVE | RR, SEND(KC_HOME)); + P( MOVE | RB, SEND(KC_PGDN)); + P( MOVE | RG, SEND(KC_PGUP)); + P( MOVE | RS, SEND(KC_END)); + + +/* Media Layer + * ,-----------------------------------, ,-----------------------------------, + * | | | | | | | | |Prev |Play | PLY |Next | VolU| + * | + + + + + | | + + + + + | + * | | MEDIAMEDIAMEDIAMEDIAM | | | | | | |Mute | VolD| + * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----' +*/ + P( MEDIA | RF, SEND(KC_MPRV)); + P( MEDIA | RP, SEND(KC_MPLY)); + P( MEDIA | RL, SEND(KC_MPLY)); + P( MEDIA | RT, SEND(KC_MNXT)); + P( MEDIA | RD, SEND(KC_VOLU)); + + P( MEDIA | RS, SEND(KC_MUTE)); + P( MEDIA | RZ, SEND(KC_VOLD)); + + +/* Numbers + * ,-----------------------------------, ,-----------------------------------, + * | | | a | b | c | | | : | 1 | 2 | 3 | . | | + * | + + d + e + f + | | 0 + 4 + 5 + 6 + - + | + * | NUM | | | | | | | | 7 | 8 | 9 | 0 | | + * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----' +*/ + P( NUM | LFT, SEND(KC_A)); + P( NUM | LP, SEND(KC_B)); + P( NUM | LH, SEND(KC_C)); + P( NUM | LK, SEND(KC_D)); + P( NUM | LW, SEND(KC_E)); + P( NUM | LR, SEND(KC_F)); + + // Right hand + P( NUM | ST3, SEND_STRING(":")); + P( NUM | RF, SEND(KC_1)); + P( NUM | RP, SEND(KC_2)); + P( NUM | RL, SEND(KC_3)); + P( NUM | RT, SEND(KC_DOT)); + + P( NUM | ST3 | ST4, SEND(KC_0)); + P( NUM | RF | RR, SEND(KC_4)); + P( NUM | RP | RB, SEND(KC_5)); + P( NUM | RG | RL, SEND(KC_6)); + P( NUM | RT | RS, SEND(KC_MINUS)); + + P( NUM | RR, SEND(KC_7)); + P( NUM | RB, SEND(KC_8)); + P( NUM | RG, SEND(KC_9)); + P( NUM | RS, SEND(KC_0)); + + +/* Symbols + * ,-----------------------------------, ,-----------------------------------, + * | | ` | [ | { | ( | < | | > | ) | } | ] | ? | | + * | + ~ + - + ' + : + _ | | \ + = + " + + + ? + | + * | | ! | @ | # | $ | % | | | | ^ | & | * | ? | SYM | + * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----' +*/ + // Left hand + P( SYM | LSU, SEND(KC_GRV)); + P( SYM | LFT, SEND(KC_LBRC)); + P( SYM | LP, SEND_STRING("{")); + P( SYM | LH, SEND_STRING("(")); + P( SYM | ST1, SEND_STRING("<")); + + P( SYM | LSU | LSD, SEND_STRING("~")); + P( SYM | LFT | LK, SEND(KC_MINS)); + P( SYM | LP | LW, SEND(KC_QUOTE)); + P( SYM | LH | LR, SEND_STRING(":")); + P( SYM | ST1 | ST2, SEND_STRING("_")); + + P( SYM | LSD, SEND_STRING("!")); + P( SYM | LK, SEND_STRING("@")); + P( SYM | LW, SEND_STRING("#")); + P( SYM | LR, SEND_STRING("$")); + P( SYM | ST2, SEND_STRING("%")); + + // Right hand + P( SYM | ST3, SEND_STRING(">")); + P( SYM | RF, SEND_STRING(")")); + P( SYM | RP, SEND_STRING("}")); + P( SYM | RL, SEND_STRING("]")); + P( SYM | RT, SEND_STRING("?")); + + P( SYM | ST3 | ST4, SEND(KC_BSLASH)); + P( SYM | RF | RR, SEND(KC_EQUAL)); + P( SYM | RP | RB, SEND_STRING("\"")); + P( SYM | RG | RL, SEND_STRING("+")); + P( SYM | RT | RS, SEND_STRING("?")); + + P( SYM | ST4, SEND_STRING("|")); + P( SYM | RR, SEND_STRING("^")); + P( SYM | RB, SEND_STRING("&")); + P( SYM | RG, SEND_STRING("*")); + P( SYM | RS, SEND_STRING("?")); + + +/* Letters + * ,-----------------------------------, ,-----------------------------------, + * | | Q | W | F | P | B | | J | L | U | Y | ; | ctl | + * +-----+- A -+- R -+- S -+- T -+- G -| |- M -+- N -+- E -+- I -+- O -+-----| + * | bsp | Z | X | C | D | V | | K | H | , | . | / | del | + * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----' + * ,---------------, .---------------. + * | alt | ent|shfr| | spc| gui| alt | + * `---------------' `---------------' +*/ + // Left hand + P( LSU, SEND(KC_Q)); + P( LFT, SEND(KC_W)); + P( LP, SEND(KC_F)); + P( LH, SEND(KC_P)); + P( ST1, SEND(KC_B)); + + P( LSU | LSD, SEND(KC_A)); + P( LFT | LK, SEND(KC_R)); + P( LP | LW, SEND(KC_S)); + P( LH | LR, SEND(KC_T)); + P( ST1 | ST2, SEND(KC_G)); + + P( LSD, SEND(KC_Z)); + P( LK, SEND(KC_X)); + P( LW, SEND(KC_C)); + P( LR, SEND(KC_D)); + P( ST2, SEND(KC_V)); + + // Right hand + P( ST3, SEND(KC_J)); + P( RF, SEND(KC_L)); + P( RP, SEND(KC_U)); + P( RL, SEND(KC_Y)); + P( RT, SEND(KC_SCLN)); + + P( ST3 | ST4, SEND(KC_M)); + P( RF | RR, SEND(KC_N)); + P( RP | RB, SEND(KC_E)); + P( RG | RL, SEND(KC_I)); + P( RT | RS, SEND(KC_O)); + + P( ST4, SEND(KC_K)); + P( RR, SEND(KC_H)); + P( RB, SEND(KC_COMM)); + P( RG, SEND(KC_DOT)); + P( RS, SEND(KC_SLSH)); + + // Thumb Chords and modifiers + // + PC( LNO | RNO | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT)); + PC( LNO | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT)); + + // overrides + P( PWR | LO, SEND(KC_LSFT); SEND(KC_BSPC)); + P( PWR | RD, SEND(KC_LCTL); SEND(KC_BSPC)); + P( RZ | RD, SEND(KC_LCTL); SEND(KC_DEL)); + + PC( LNO | LA | LO, SEND(KC_LSFT); SEND(KC_ESC)); + PC( LA | LO, SEND(KC_ESC)); + PC( LNO, SEND(KC_LALT)); + PC( LA, SEND(KC_ENT)); + PC( LO, SEND(KC_LSFT)); + + PC( RNO, SEND(KC_RALT)); + PC( RE | RU, SEND(KC_TAB)); + PC( RE, SEND(KC_SPC)); + PC( RU, SEND(KC_LGUI)); + + PC( PWR, SEND(KC_BSPC)); + PC( RD, SEND(KC_LCTL)); + P( RZ, SEND(KC_DEL)); + + return 0; +} + +// "Layers" +// Steno layer should be first in your map. +// When PWR | FN | ST3 | ST4 is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end. +// If you need more space for chords, remove the two gaming layers. +// Note: If using NO_ACTION_TAPPING, LT will not work! + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Main layer, everything goes through here + [STENO_LAYER] = LAYOUT_georgi( + STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N7 + ), + // Gaming layer with Numpad, Very limited + [GAMING] = LAYOUT_georgi( + KC_LSFT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DQUO, + KC_LALT, KC_SPC, LT(GAMING_2, KC_ENT), KC_DEL, KC_ASTR, TO(STENO_LAYER) + ), + + [GAMING_2] = LAYOUT_georgi( + KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, + KC_LALT, KC_SPC, KC_ENT, KC_DEL, KC_ASTR, TO(STENO_LAYER) + ) +}; + +// Don't fuck with this, thanks. +size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]); +size_t stenoLayerCount = sizeof(stenoLayers)/sizeof(stenoLayers[0]); diff --git a/keyboards/georgi/keymaps/colemak-dh/readme.md b/keyboards/georgi/keymaps/colemak-dh/readme.md new file mode 100644 index 00000000000..f9da34b0245 --- /dev/null +++ b/keyboards/georgi/keymaps/colemak-dh/readme.md @@ -0,0 +1,11 @@ +# Georgi QWERTY/Steno firmware + +This is the default keymap for Georgi, it's based heavily off of the naps62 ErgoDox and the Gergo layout. +It is both a ergonomic and programmer friendly keymap. + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! + +## Space issues +If you find yourself running out of space for dictionary entries, disabling mousekeys in rules.mk will save +you about 4k for entries! +Get a free 1k by deleting the Gaming layers from the keymap! diff --git a/keyboards/georgi/keymaps/colemak-dh/rules.mk b/keyboards/georgi/keymaps/colemak-dh/rules.mk new file mode 100644 index 00000000000..07394aef485 --- /dev/null +++ b/keyboards/georgi/keymaps/colemak-dh/rules.mk @@ -0,0 +1,45 @@ +#---------------------------------------------------------------------------- +# make georgi:claymager:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- + +NO_REPEAT = yes +VERBOSE = yes +KEYBOARD_SHARED_EP = yes +CUSTOM_MATRIX = yes +STENO_LAYERS = yes + +#Firmware reduction options +MOUSEKEY_ENABLE = yes # 1500 bytes +NO_TAPPING = no # 2000 bytes +NO_PRINT = yes + +#Debug options +CONSOLE_ENABLE = no +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_MATRIX = no +ONLY_QWERTY = no + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif +ifeq ($(strip $(NO_REPEAT)), yes) + OPT_DEFS += -DNO_REPEAT +endif +ifeq ($(strip $(NO_PRINT)), yes) + OPT_DEFS += -DNO_PRINT -DNO_DEBUG +endif +ifeq ($(strip $(ONLY_QWERTY)), yes) + OPT_DEFS += -DONLYQWERTY +endif +ifeq ($(strip $(NO_TAPPING)), yes) + OPT_DEFS += -DNO_ACTION_TAPPING +endif +ifeq ($(strip $(STENO_LAYERS)), yes) + OPT_DEFS += -DSTENOLAYERS +endif diff --git a/keyboards/georgi/keymaps/default-flipped/keymap.c b/keyboards/georgi/keymaps/default-flipped/keymap.c new file mode 100644 index 00000000000..09243f2a248 --- /dev/null +++ b/keyboards/georgi/keymaps/default-flipped/keymap.c @@ -0,0 +1,237 @@ +/* + * Good on you for modifying your layout, this is the most nonQMK layout you will come across + * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer + * + * Don't modify the steno layer directly, instead add chords using the keycodes and macros + * from sten.h to the layout you want to modify. + * + * Observe the comment above processQWERTY! + * + * http://docs.gboards.ca + */ + +#include QMK_KEYBOARD_H +#include "sten.h" +#include "keymap_steno.h" + +// Proper Layers +#define FUNCT (LSD | LK | LP | LH) +#define MEDIA (LSD | LK | LW | LR) +#define MOVE (ST1 | ST2) + +// QMK Layers +#define STENO_LAYER 0 +#define GAMING 1 +#define GAMING_2 2 + +/* Keyboard Layout + * ,---------------------------------. ,------------------------------. + * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD | + * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----| + * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | BB | RG | RS | RZ | + * `---------------------------------' `------------------------------' + * ,---------------, .---------------. + * | LNO | LA | LO | | RE | RU | RNO | + * `---------------' `---------------' + */ + +// Note: You can only use basic keycodes here! +// P() is just a wrapper to make your life easier. +// +// http://docs.gboards.ca +uint32_t processQwerty(bool lookup) { + // Specials + P( RT | RS | RD | RZ | LNO, SEND_STRING(VERSION); SEND_STRING(__DATE__)); + P( LNO | RNO | LA | LO | RE | RU, SEND(KC_MPLY)); + P( LFT | LK | LP | LW, REPEAT()); + P( ST1 | ST2 | LW | ST4, SEND(KC_BSPC)); + + // Mouse Keys + P( LO | LSD | LK, CLICK_MOUSE(KC_MS_BTN2)); + P( LO | LR | LW, CLICK_MOUSE(KC_MS_BTN1)); + + // Thumb Chords + P( LA | LO | RE | RU, SEND(KC_CAPS)); + P( LA | RU, SEND(KC_ESC)); + P( LO | RE, SEND(KC_LCTL)); + P( LNO | RNO | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT)); + P( LNO | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT)); + + // Mods + P( RT | RD | RS | RZ, SEND(KC_LGUI)); + P( RT | RD, SEND(KC_LCTL)); + P( RS | RZ, SEND(KC_LALT)); + P( LA | LNO, SEND(KC_LCTL)); + P( LA | LO, SEND(KC_LALT)); + P( LO, SEND(KC_LSFT)); + + // Function Layer + P( FUNCT | RF | RR, SEND(KC_F5)); + P( FUNCT | RP | RB, SEND(KC_F6)); + P( FUNCT | RL | RG, SEND(KC_F7)); + P( FUNCT | RT | RS, SEND(KC_F8)); + P( FUNCT | RF, SEND(KC_F1)); + P( FUNCT | RP, SEND(KC_F2)); + P( FUNCT | RL, SEND(KC_F3)); + P( FUNCT | RT, SEND(KC_F4)); + P( FUNCT | RR, SEND(KC_F9)); + P( FUNCT | RG, SEND(KC_F10)); + P( FUNCT | RB, SEND(KC_F11)); + P( FUNCT | RS, SEND(KC_F12)); + + // Movement Layer + P( MOVE | RF, SEND(KC_LEFT)); + P( MOVE | RP, SEND(KC_DOWN)); + P( MOVE | RL, SEND(KC_UP)); + P( MOVE | RT, SEND(KC_RIGHT)); + P( MOVE | ST3, SEND(KC_PGUP)); + P( MOVE | ST4, SEND(KC_PGDN)); + + // Media Layer + P( MEDIA | RF, SEND(KC_MPRV)); + P( MEDIA | RP, SEND(KC_MPLY)); + P( MEDIA | RL, SEND(KC_MPLY)); + P( MEDIA | RT, SEND(KC_MNXT)); + P( MEDIA | RD, SEND(KC_VOLU)); + P( MEDIA | RZ, SEND(KC_VOLD)); + P( MEDIA | RS, SEND(KC_MUTE)); + + // Number Row, Left + P( LNO | LSU, SEND(KC_1)); + P( LNO | LFT, SEND(KC_2)); + P( LNO | LP, SEND(KC_3)); + P( LNO | LH, SEND(KC_4)); + P( LNO | ST1, SEND(KC_5)); + P( LNO | ST3, SEND(KC_6)); + P( LNO | RF, SEND(KC_7)); + P( LNO | RP, SEND(KC_8)); + P( LNO | RL, SEND(KC_9)); + P( LNO | RT, SEND(KC_0)); + + // Number Row, Right + P( RNO | LSU, SEND(KC_1)); + P( RNO | LFT, SEND(KC_2)); + P( RNO | LP, SEND(KC_3)); + P( RNO | LH, SEND(KC_4)); + P( RNO | ST1, SEND(KC_5)); + P( RNO | ST3, SEND(KC_6)); + P( RNO | RF, SEND(KC_7)); + P( RNO | RP, SEND(KC_8)); + P( RNO | RL, SEND(KC_9)); + P( RNO | RT, SEND(KC_0)); + P( RNO | LA, SEND(KC_5)); + + // Specials + P( RU | RNO, SEND(KC_TAB)); + P( RE | RU, SEND(KC_BSPC)); + P( RD | RZ, SEND(KC_ENT)); + P( RE, SEND(KC_ENT)); + P( RD, SEND(KC_BSPC)); + P( LNO, SEND(KC_BSPC)); + P( RNO, SEND(KC_BSPC)); + P( LA, SEND(KC_SPC)); + P( RU, SEND(KC_SPC)); + P( RZ, SEND(KC_ESC)); + + // Symbols and Numbers + P( PWR | RE | RU, SEND(KC_ENT)); + P( PWR | LA | LO, SEND(KC_SPC)); + P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // ( + P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // ) + P( PWR | ST1 | ST2, SEND(KC_GRV)); // ` + P( PWR | RD | RZ, SEND(KC_ESC)); + P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // # + P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $ + P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // ! + P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // % + P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @ + P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^ + P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // { + P( PWR | LW, SEND(KC_LBRC)); + P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // } + P( PWR | LR, SEND(KC_RBRC)); + P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // | + P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~ + P( PWR | ST3, SEND(KC_QUOT)); + P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // " + P( PWR | RF, SEND(KC_KP_PLUS)); + P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // & + P( PWR | RP, SEND(KC_MINS)); + P( PWR | RB, SEND(KC_EQL)); + P( PWR | RL, SEND(KC_SLSH)); + P( PWR | RG, SEND(KC_COMM)); + P( PWR | RT, SEND(KC_PAST)); + P( PWR | RS, SEND(KC_DOT)); + P( PWR | RD, SEND(KC_TAB)); + P( PWR | LA, SEND(KC_LSFT)); + P( PWR | LO, SEND(KC_SLSH)); + P( PWR | RE, SEND(KC_SCLN)); + P( PWR | RU, SEND(KC_BSLS)); + P( PWR | LNO, SEND(KC_BSLS)); + + // Letters + P( LSU | LSD, SEND(KC_A)); + P( LFT | LK, SEND(KC_S)); + P( LP | LW, SEND(KC_D)); + P( LH | LR, SEND(KC_F)); + P( ST1 | ST2, SEND(KC_G)); + P( ST3 | ST4, SEND(KC_H)); + P( RF | RR, SEND(KC_J)); + P( RT | RS, SEND(KC_SCLN)); + P( RG | RL, SEND(KC_L)); + P( RP | RB, SEND(KC_K)); + P( LSU, SEND(KC_Q)); + P( LSD, SEND(KC_Z)); + P( LFT, SEND(KC_W)); + P( LK, SEND(KC_X)); + P( LP, SEND(KC_E)); + P( LW, SEND(KC_C)); + P( LH, SEND(KC_R)); + P( LR, SEND(KC_V)); + P( ST1, SEND(KC_T)); + P( ST2, SEND(KC_B)); + P( ST3, SEND(KC_Y)); + P( ST4, SEND(KC_N)); + P( RF, SEND(KC_U)); + P( RR, SEND(KC_M)); + P( RP, SEND(KC_I)); + P( RB, SEND(KC_COMM)); + P( RL, SEND(KC_O)); + P( RG, SEND(KC_DOT)); + P( RT, SEND(KC_P)); + P( RS, SEND(KC_SLSH)); + P( RNO, SEND(KC_BSPC)); + P( LNO, SEND(KC_BSPC)); + + return 0; +} + +// "Layers" +// Steno layer should be first in your map. +// When PWR | FN | ST3 | ST4 is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end. +// If you need more space for chords, remove the two gaming layers. +// Note: If using NO_ACTION_TAPPING, LT will not work! + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Main layer, everything goes through here + [STENO_LAYER] = LAYOUT_georgi( + STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + STN_A, STN_O, STN_N1, STN_N7, STN_E, STN_U + ), + // Gaming layer with Numpad, Very limited + [GAMING] = LAYOUT_georgi( + KC_LSFT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DQUO, + KC_LALT, KC_SPC, LT(GAMING_2, KC_ENT), KC_DEL, KC_ASTR, TO(STENO_LAYER) + ), + + [GAMING_2] = LAYOUT_georgi( + KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, + KC_LALT, KC_SPC, KC_ENT, KC_DEL, KC_ASTR, TO(STENO_LAYER) + ) +}; + +// Don't fuck with this, thanks. +size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]); diff --git a/keyboards/georgi/keymaps/default-flipped/readme.md b/keyboards/georgi/keymaps/default-flipped/readme.md new file mode 100644 index 00000000000..f9da34b0245 --- /dev/null +++ b/keyboards/georgi/keymaps/default-flipped/readme.md @@ -0,0 +1,11 @@ +# Georgi QWERTY/Steno firmware + +This is the default keymap for Georgi, it's based heavily off of the naps62 ErgoDox and the Gergo layout. +It is both a ergonomic and programmer friendly keymap. + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! + +## Space issues +If you find yourself running out of space for dictionary entries, disabling mousekeys in rules.mk will save +you about 4k for entries! +Get a free 1k by deleting the Gaming layers from the keymap! diff --git a/keyboards/georgi/keymaps/default-flipped/rules.mk b/keyboards/georgi/keymaps/default-flipped/rules.mk new file mode 100644 index 00000000000..90d8057c325 --- /dev/null +++ b/keyboards/georgi/keymaps/default-flipped/rules.mk @@ -0,0 +1,41 @@ +#---------------------------------------------------------------------------- +# make georgi:default:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- + +NO_REPEAT = no +VERBOSE = yes +KEYBOARD_SHARED_EP = yes +CUSTOM_MATRIX = yes + +#Firmware reduction options +MOUSEKEY_ENABLE = yes # 1500 bytes +NO_TAPPING = no # 2000 bytes +NO_PRINT = yes + +#Debug options +CONSOLE_ENABLE = no +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_MATRIX = no +ONLY_QWERTY = no + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif +ifeq ($(strip $(NO_REPEAT)), yes) + OPT_DEFS += -DNO_REPEAT +endif +ifeq ($(strip $(NO_PRINT)), yes) + OPT_DEFS += -DNO_PRINT -DNO_DEBUG +endif +ifeq ($(strip $(ONLY_QWERTY)), yes) + OPT_DEFS += -DONLYQWERTY +endif +ifeq ($(strip $(NO_TAPPING)), yes) + OPT_DEFS += -DNO_ACTION_TAPPING +endif diff --git a/keyboards/georgi/keymaps/default/keymap.c b/keyboards/georgi/keymaps/default/keymap.c new file mode 100644 index 00000000000..93c551af274 --- /dev/null +++ b/keyboards/georgi/keymaps/default/keymap.c @@ -0,0 +1,247 @@ +/* + * Good on you for modifying your layout, this is the most nonQMK layout you will come across + * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer + * + * Don't modify the steno layer directly, instead add chords using the keycodes and macros + * from sten.h to the layout you want to modify. + * + * Observe the comment above processQWERTY! + * + * http://docs.gboards.ca + */ + +#include QMK_KEYBOARD_H +#include "sten.h" +#include "keymap_steno.h" + +// Proper Layers +#define FUNCT (LSD | LK | LP | LH) +#define MEDIA (LSD | LK | LW | LR) +#define MOVE (ST1 | ST2) + +// QMK Layers +#define STENO_LAYER 0 +#define GAMING 1 +#define GAMING_2 2 + +/* Keyboard Layout + * ,---------------------------------. ,------------------------------. + * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD | + * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----| + * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | BB | RG | RS | RZ | + * `---------------------------------' `------------------------------' + * ,---------------, .---------------. + * | LNO | LA | LO | | RE | RU | RNO | + * `---------------' `---------------' + */ + +// Note: You can only use basic keycodes here! +// P() is just a wrapper to make your life easier. +// PC() applies the mapping to all of the StenoLayers. +// To overload, declare it with P() first. +// Be sure to enable in rules.mk and see colemak-dh for usage +// +// FN is unavailable. That is reserved for system use. +// Chords containing PWR are always available, even in steno mode. +// +// http://docs.gboards.ca +uint32_t processQwerty(bool lookup) { + // Specials + P( RT | RS | RD | RZ | LNO, SEND_STRING(VERSION); SEND_STRING(__DATE__)); + P( LNO | RNO | LA | LO | RE | RU, SEND(KC_MPLY)); + P( LFT | LK | LP | LW, REPEAT()); + P( ST1 | ST2 | LW | ST4, SEND(KC_BSPC)); + + // Mouse Keys + P( LO | LSD | LK, CLICK_MOUSE(KC_MS_BTN2)); + P( LO | LR | LW, CLICK_MOUSE(KC_MS_BTN1)); + + // Thumb Chords + P( LA | LO | RE | RU, SEND(KC_CAPS)); + P( LA | RU, SEND(KC_ESC)); + P( LO | RE, SEND(KC_LCTL)); + P( LNO | RNO | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT)); + P( LNO | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT)); + + // Mods + P( RT | RD | RS | RZ, SEND(KC_LGUI)); + P( RT | RD, SEND(KC_LCTL)); + P( RS | RZ, SEND(KC_LALT)); + P( LA | LNO, SEND(KC_LCTL)); + P( LA | LO, SEND(KC_LALT)); + P( LO, SEND(KC_LSFT)); + + // Function Layer + P( FUNCT | RF | RR, SEND(KC_F5)); + P( FUNCT | RP | RB, SEND(KC_F6)); + P( FUNCT | RL | RG, SEND(KC_F7)); + P( FUNCT | RT | RS, SEND(KC_F8)); + P( FUNCT | RF, SEND(KC_F1)); + P( FUNCT | RP, SEND(KC_F2)); + P( FUNCT | RL, SEND(KC_F3)); + P( FUNCT | RT, SEND(KC_F4)); + P( FUNCT | RR, SEND(KC_F9)); + P( FUNCT | RG, SEND(KC_F10)); + P( FUNCT | RB, SEND(KC_F11)); + P( FUNCT | RS, SEND(KC_F12)); + + // Movement Layer + P( MOVE | RF, SEND(KC_LEFT)); + P( MOVE | RP, SEND(KC_DOWN)); + P( MOVE | RL, SEND(KC_UP)); + P( MOVE | RT, SEND(KC_RIGHT)); + P( MOVE | ST3, SEND(KC_PGUP)); + P( MOVE | ST4, SEND(KC_PGDN)); + + // Media Layer + P( MEDIA | RF, SEND(KC_MPRV)); + P( MEDIA | RP, SEND(KC_MPLY)); + P( MEDIA | RL, SEND(KC_MPLY)); + P( MEDIA | RT, SEND(KC_MNXT)); + P( MEDIA | RD, SEND(KC_VOLU)); + P( MEDIA | RZ, SEND(KC_VOLD)); + P( MEDIA | RS, SEND(KC_MUTE)); + + // Number Row, Left + P( LNO | LSU, SEND(KC_1)); + P( LNO | LFT, SEND(KC_2)); + P( LNO | LP, SEND(KC_3)); + P( LNO | LH, SEND(KC_4)); + P( LNO | ST1, SEND(KC_5)); + P( LNO | ST3, SEND(KC_6)); + P( LNO | RF, SEND(KC_7)); + P( LNO | RP, SEND(KC_8)); + P( LNO | RL, SEND(KC_9)); + P( LNO | RT, SEND(KC_0)); + + // Number Row, Right + P( RNO | LSU, SEND(KC_1)); + P( RNO | LFT, SEND(KC_2)); + P( RNO | LP, SEND(KC_3)); + P( RNO | LH, SEND(KC_4)); + P( RNO | ST1, SEND(KC_5)); + P( RNO | ST3, SEND(KC_6)); + P( RNO | RF, SEND(KC_7)); + P( RNO | RP, SEND(KC_8)); + P( RNO | RL, SEND(KC_9)); + P( RNO | RT, SEND(KC_0)); + P( RNO | LA, SEND(KC_5)); + + // Specials + P( RU | RNO, SEND(KC_TAB)); + P( RE | RU, SEND(KC_BSPC)); + P( RD | RZ, SEND(KC_ENT)); + P( RE, SEND(KC_ENT)); + P( RD, SEND(KC_BSPC)); + P( LNO, SEND(KC_BSPC)); + P( RNO, SEND(KC_BSPC)); + P( LA, SEND(KC_SPC)); + P( RU, SEND(KC_SPC)); + P( RZ, SEND(KC_ESC)); + + // Symbols and Numbers + P( PWR | RE | RU, SEND(KC_ENT)); + P( PWR | LA | LO, SEND(KC_SPC)); + P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // ( + P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // ) + P( PWR | ST1 | ST2, SEND(KC_GRV)); // ` + P( PWR | RD | RZ, SEND(KC_ESC)); + P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // # + P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $ + P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // ! + P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // % + P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @ + P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^ + P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // { + P( PWR | LW, SEND(KC_LBRC)); + P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // } + P( PWR | LR, SEND(KC_RBRC)); + P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // | + P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~ + P( PWR | ST3, SEND(KC_QUOT)); + P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // " + P( PWR | RF, SEND(KC_KP_PLUS)); + P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // & + P( PWR | RP, SEND(KC_MINS)); + P( PWR | RB, SEND(KC_EQL)); + P( PWR | RL, SEND(KC_SLSH)); + P( PWR | RG, SEND(KC_COMM)); + P( PWR | RT, SEND(KC_PAST)); + P( PWR | RS, SEND(KC_DOT)); + P( PWR | RD, SEND(KC_TAB)); + P( PWR | LA, SEND(KC_LSFT)); + P( PWR | LO, SEND(KC_SLSH)); + P( PWR | RE, SEND(KC_SCLN)); + P( PWR | RU, SEND(KC_BSLS)); + P( PWR | LNO, SEND(KC_BSLS)); + P( PWR | RF | RR, SEND(KC_LEFT)); + P( PWR | RP | RB, SEND(KC_DOWN)); + P( PWR | RL | RG, SEND(KC_UP)); + P( PWR | RT | RS, SEND(KC_RIGHT)); + + // Letters + P( LSU | LSD, SEND(KC_A)); + P( LFT | LK, SEND(KC_S)); + P( LP | LW, SEND(KC_D)); + P( LH | LR, SEND(KC_F)); + P( ST1 | ST2, SEND(KC_G)); + P( ST3 | ST4, SEND(KC_H)); + P( RF | RR, SEND(KC_J)); + P( RT | RS, SEND(KC_SCLN)); + P( RG | RL, SEND(KC_L)); + P( RP | RB, SEND(KC_K)); + P( LSU, SEND(KC_Q)); + P( LSD, SEND(KC_Z)); + P( LFT, SEND(KC_W)); + P( LK, SEND(KC_X)); + P( LP, SEND(KC_E)); + P( LW, SEND(KC_C)); + P( LH, SEND(KC_R)); + P( LR, SEND(KC_V)); + P( ST1, SEND(KC_T)); + P( ST2, SEND(KC_B)); + P( ST3, SEND(KC_Y)); + P( ST4, SEND(KC_N)); + P( RF, SEND(KC_U)); + P( RR, SEND(KC_M)); + P( RP, SEND(KC_I)); + P( RB, SEND(KC_COMM)); + P( RL, SEND(KC_O)); + P( RG, SEND(KC_DOT)); + P( RT, SEND(KC_P)); + P( RS, SEND(KC_SLSH)); + P( RNO, SEND(KC_BSPC)); + P( LNO, SEND(KC_BSPC)); + + return 0; +} + +// "Layers" +// Steno layer should be first in your map. +// When PWR | FN | ST3 | ST4 is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end. +// If you need more space for chords, remove the two gaming layers. +// Note: If using NO_ACTION_TAPPING, LT will not work! + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Main layer, everything goes through here + [STENO_LAYER] = LAYOUT_georgi( + STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N7 + ), + // Gaming layer with Numpad, Very limited + [GAMING] = LAYOUT_georgi( + KC_LSFT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DQUO, + KC_LALT, KC_SPC, LT(GAMING_2, KC_ENT), KC_DEL, KC_ASTR, TO(STENO_LAYER) + ), + + [GAMING_2] = LAYOUT_georgi( + KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, + KC_LALT, KC_SPC, KC_ENT, KC_DEL, KC_ASTR, TO(STENO_LAYER) + ) +}; + +// Don't fuck with this, thanks. +size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]); diff --git a/keyboards/georgi/keymaps/default/readme.md b/keyboards/georgi/keymaps/default/readme.md new file mode 100644 index 00000000000..f9da34b0245 --- /dev/null +++ b/keyboards/georgi/keymaps/default/readme.md @@ -0,0 +1,11 @@ +# Georgi QWERTY/Steno firmware + +This is the default keymap for Georgi, it's based heavily off of the naps62 ErgoDox and the Gergo layout. +It is both a ergonomic and programmer friendly keymap. + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! + +## Space issues +If you find yourself running out of space for dictionary entries, disabling mousekeys in rules.mk will save +you about 4k for entries! +Get a free 1k by deleting the Gaming layers from the keymap! diff --git a/keyboards/georgi/keymaps/default/rules.mk b/keyboards/georgi/keymaps/default/rules.mk new file mode 100644 index 00000000000..7bd3d7aa204 --- /dev/null +++ b/keyboards/georgi/keymaps/default/rules.mk @@ -0,0 +1,42 @@ +#---------------------------------------------------------------------------- +# make georgi:default:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- + +NO_REPEAT = no +VERBOSE = yes +KEYBOARD_SHARED_EP = yes +CUSTOM_MATRIX = yes +STENO_LAYERS = no + +#Firmware reduction options +MOUSEKEY_ENABLE = yes # 1500 bytes +NO_TAPPING = no # 2000 bytes +NO_PRINT = yes + +#Debug options +CONSOLE_ENABLE = no +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_MATRIX = no +ONLY_QWERTY = no + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif +ifeq ($(strip $(NO_REPEAT)), yes) + OPT_DEFS += -DNO_REPEAT +endif +ifeq ($(strip $(NO_PRINT)), yes) + OPT_DEFS += -DNO_PRINT -DNO_DEBUG +endif +ifeq ($(strip $(ONLY_QWERTY)), yes) + OPT_DEFS += -DONLYQWERTY +endif +ifeq ($(strip $(NO_TAPPING)), yes) + OPT_DEFS += -DNO_ACTION_TAPPING +endif diff --git a/keyboards/georgi/keymaps/minimal/keymap.c b/keyboards/georgi/keymaps/minimal/keymap.c new file mode 100644 index 00000000000..e9294c5cc83 --- /dev/null +++ b/keyboards/georgi/keymaps/minimal/keymap.c @@ -0,0 +1,222 @@ +/* + * Good on you for modifying your layout, this is the most nonQMK layout you will come across + * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer + * + * Don't modify the steno layer directly, instead add chords using the keycodes and macros + * from sten.h to the layout you want to modify. + * + * Observe the comment above processQWERTY! + * + * http://docs.gboards.ca + */ + +#include QMK_KEYBOARD_H +#include "sten.h" +#include "keymap_steno.h" + +// Proper Layers +#define FUNCT (LSD | LK | LP | LH) +#define MEDIA (LSD | LK | LW | LR) +#define MOVE (ST1 | ST2) + +// QMK Layers +#define STENO_LAYER 0 + +/* Keyboard Layout + * ,---------------------------------. ,------------------------------. + * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD | + * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----| + * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | BB | RG | RS | RZ | + * `---------------------------------' `------------------------------' + * ,---------------, .---------------. + * | LNO | LA | LO | | RE | RU | RNO | + * `---------------' `---------------' + */ + +// Note: You can only use basic keycodes here! +// P() is just a wrapper to make your life easier. +// +// http://docs.gboards.ca +uint32_t processQwerty(bool lookup) { + // Specials + P( RT | RS | RD | RZ | LNO, SEND_STRING(VERSION); SEND_STRING(__DATE__)); + P( LNO | RNO | LA | LO | RE | RU, SEND(KC_MPLY)); + P( LFT | LK | LP | LW, REPEAT()); + P( ST1 | ST2 | LW | ST4, SEND(KC_BSPC)); + + // Mouse Keys + P( LO | LSD | LK, CLICK_MOUSE(KC_MS_BTN2)); + P( LO | LR | LW, CLICK_MOUSE(KC_MS_BTN1)); + + // Thumb Chords + P( LA | LO | RE | RU, SEND(KC_CAPS)); + P( LA | RU, SEND(KC_ESC)); + P( LO | RE, SEND(KC_LCTL)); + P( LNO | RNO | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT)); + P( LNO | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT)); + + // Mods + P( RT | RD | RS | RZ, SEND(KC_LGUI)); + P( RT | RD, SEND(KC_LCTL)); + P( RS | RZ, SEND(KC_LALT)); + P( LA | LNO, SEND(KC_LCTL)); + P( LA | LO, SEND(KC_LALT)); + P( LO, SEND(KC_LSFT)); + + // Function Layer + P( FUNCT | RF | RR, SEND(KC_F5)); + P( FUNCT | RP | RB, SEND(KC_F6)); + P( FUNCT | RL | RG, SEND(KC_F7)); + P( FUNCT | RT | RS, SEND(KC_F8)); + P( FUNCT | RF, SEND(KC_F1)); + P( FUNCT | RP, SEND(KC_F2)); + P( FUNCT | RL, SEND(KC_F3)); + P( FUNCT | RT, SEND(KC_F4)); + P( FUNCT | RR, SEND(KC_F9)); + P( FUNCT | RG, SEND(KC_F10)); + P( FUNCT | RB, SEND(KC_F11)); + P( FUNCT | RS, SEND(KC_F12)); + + // Movement Layer + P( MOVE | RF, SEND(KC_LEFT)); + P( MOVE | RP, SEND(KC_DOWN)); + P( MOVE | RL, SEND(KC_UP)); + P( MOVE | RT, SEND(KC_RIGHT)); + P( MOVE | ST3, SEND(KC_PGUP)); + P( MOVE | ST4, SEND(KC_PGDN)); + + // Media Layer + P( MEDIA | RF, SEND(KC_MPRV)); + P( MEDIA | RP, SEND(KC_MPLY)); + P( MEDIA | RL, SEND(KC_MPLY)); + P( MEDIA | RT, SEND(KC_MNXT)); + P( MEDIA | RD, SEND(KC_VOLU)); + P( MEDIA | RZ, SEND(KC_VOLD)); + P( MEDIA | RS, SEND(KC_MUTE)); + + // Number Row, Left + P( LNO | LSU, SEND(KC_1)); + P( LNO | LFT, SEND(KC_2)); + P( LNO | LP, SEND(KC_3)); + P( LNO | LH, SEND(KC_4)); + P( LNO | ST1, SEND(KC_5)); + P( LNO | ST3, SEND(KC_6)); + P( LNO | RF, SEND(KC_7)); + P( LNO | RP, SEND(KC_8)); + P( LNO | RL, SEND(KC_9)); + P( LNO | RT, SEND(KC_0)); + + // Number Row, Right + P( RNO | LSU, SEND(KC_1)); + P( RNO | LFT, SEND(KC_2)); + P( RNO | LP, SEND(KC_3)); + P( RNO | LH, SEND(KC_4)); + P( RNO | ST1, SEND(KC_5)); + P( RNO | ST3, SEND(KC_6)); + P( RNO | RF, SEND(KC_7)); + P( RNO | RP, SEND(KC_8)); + P( RNO | RL, SEND(KC_9)); + P( RNO | RT, SEND(KC_0)); + P( RNO | LA, SEND(KC_5)); + + // Specials + P( RU | RNO, SEND(KC_TAB)); + P( RE | RU, SEND(KC_BSPC)); + P( RD | RZ, SEND(KC_ENT)); + P( RE, SEND(KC_ENT)); + P( RD, SEND(KC_BSPC)); + P( LNO, SEND(KC_BSPC)); + P( RNO, SEND(KC_BSPC)); + P( LA, SEND(KC_SPC)); + P( RU, SEND(KC_SPC)); + P( RZ, SEND(KC_ESC)); + + // Symbols and Numbers + P( PWR | RE | RU, SEND(KC_ENT)); + P( PWR | LA | LO, SEND(KC_SPC)); + P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // ( + P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // ) + P( PWR | ST1 | ST2, SEND(KC_GRV)); // ` + P( PWR | RD | RZ, SEND(KC_ESC)); + P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // # + P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $ + P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // ! + P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // % + P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @ + P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^ + P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // { + P( PWR | LW, SEND(KC_LBRC)); + P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // } + P( PWR | LR, SEND(KC_RBRC)); + P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // | + P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~ + P( PWR | ST3, SEND(KC_QUOT)); + P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // " + P( PWR | RF, SEND(KC_KP_PLUS)); + P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // & + P( PWR | RP, SEND(KC_MINS)); + P( PWR | RB, SEND(KC_EQL)); + P( PWR | RL, SEND(KC_SLSH)); + P( PWR | RG, SEND(KC_COMM)); + P( PWR | RT, SEND(KC_PAST)); + P( PWR | RS, SEND(KC_DOT)); + P( PWR | RD, SEND(KC_TAB)); + P( PWR | LA, SEND(KC_LSFT)); + P( PWR | LO, SEND(KC_SLSH)); + P( PWR | RE, SEND(KC_SCLN)); + P( PWR | RU, SEND(KC_BSLS)); + P( PWR | LNO, SEND(KC_BSLS)); + + // Letters + P( LSU | LSD, SEND(KC_A)); + P( LFT | LK, SEND(KC_S)); + P( LP | LW, SEND(KC_D)); + P( LH | LR, SEND(KC_F)); + P( ST1 | ST2, SEND(KC_G)); + P( ST3 | ST4, SEND(KC_H)); + P( RF | RR, SEND(KC_J)); + P( RT | RS, SEND(KC_SCLN)); + P( RG | RL, SEND(KC_L)); + P( RP | RB, SEND(KC_K)); + P( LSU, SEND(KC_Q)); + P( LSD, SEND(KC_Z)); + P( LFT, SEND(KC_W)); + P( LK, SEND(KC_X)); + P( LP, SEND(KC_E)); + P( LW, SEND(KC_C)); + P( LH, SEND(KC_R)); + P( LR, SEND(KC_V)); + P( ST1, SEND(KC_T)); + P( ST2, SEND(KC_B)); + P( ST3, SEND(KC_Y)); + P( ST4, SEND(KC_N)); + P( RF, SEND(KC_U)); + P( RR, SEND(KC_M)); + P( RP, SEND(KC_I)); + P( RB, SEND(KC_COMM)); + P( RL, SEND(KC_O)); + P( RG, SEND(KC_DOT)); + P( RT, SEND(KC_P)); + P( RS, SEND(KC_SLSH)); + P( RNO, SEND(KC_BSPC)); + P( LNO, SEND(KC_BSPC)); + + return 0; +} + +// "Layers" +// Steno layer should be first in your map. +// When PWR | FN | ST3 | ST4 is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end. +// If you need more space for chords, remove the two gaming layers. +// Note: If using NO_ACTION_TAPPING, LT will not work! + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Main layer, everything goes through here + [STENO_LAYER] = LAYOUT_georgi( + STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N7 + ) +}; +// Don't fuck with this, thanks. +size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]); diff --git a/keyboards/georgi/keymaps/minimal/readme.md b/keyboards/georgi/keymaps/minimal/readme.md new file mode 100644 index 00000000000..f9da34b0245 --- /dev/null +++ b/keyboards/georgi/keymaps/minimal/readme.md @@ -0,0 +1,11 @@ +# Georgi QWERTY/Steno firmware + +This is the default keymap for Georgi, it's based heavily off of the naps62 ErgoDox and the Gergo layout. +It is both a ergonomic and programmer friendly keymap. + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! + +## Space issues +If you find yourself running out of space for dictionary entries, disabling mousekeys in rules.mk will save +you about 4k for entries! +Get a free 1k by deleting the Gaming layers from the keymap! diff --git a/keyboards/georgi/keymaps/minimal/rules.mk b/keyboards/georgi/keymaps/minimal/rules.mk new file mode 100644 index 00000000000..cdbbbc280ec --- /dev/null +++ b/keyboards/georgi/keymaps/minimal/rules.mk @@ -0,0 +1,41 @@ +#---------------------------------------------------------------------------- +# make georgi:default:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- + +NO_REPEAT = no +VERBOSE = yes +KEYBOARD_SHARED_EP = yes +CUSTOM_MATRIX = yes + +#Firmware reduction options +MOUSEKEY_ENABLE = no # 1500 bytes +NO_TAPPING = yes # 2000 bytes +NO_PRINT = yes + +#Debug options +CONSOLE_ENABLE = no +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_MATRIX = no +ONLY_QWERTY = no + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif +ifeq ($(strip $(NO_REPEAT)), yes) + OPT_DEFS += -DNO_REPEAT +endif +ifeq ($(strip $(NO_PRINT)), yes) + OPT_DEFS += -DNO_PRINT -DNO_DEBUG +endif +ifeq ($(strip $(ONLY_QWERTY)), yes) + OPT_DEFS += -DONLYQWERTY +endif +ifeq ($(strip $(NO_TAPPING)), yes) + OPT_DEFS += -DNO_ACTION_TAPPING +endif diff --git a/keyboards/georgi/keymaps/norman/keymap.c b/keyboards/georgi/keymaps/norman/keymap.c new file mode 100644 index 00000000000..4591aab22fe --- /dev/null +++ b/keyboards/georgi/keymaps/norman/keymap.c @@ -0,0 +1,266 @@ +/* + * Good on you for modifying your layout, this is the most nonQMK layout you will come across + * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer + * + * Don't modify the steno layer directly, instead add chords using the keycodes and macros + * from sten.h to the layout you want to modify. + * + * Observe the comment above processQWERTY! + * + * http://docs.gboards.ca + */ + +#include QMK_KEYBOARD_H +#include "sten.h" +#include "keymap_steno.h" + +// Proper Layers +#define FUNCT (LSD | LK | LP | LH) +#define MEDIA (LSD | LK | LW | LR) +#define MOVE (LH | ST2) + +/* Keyboard Layout + * ,---------------------------------. ,------------------------------. + * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD | + * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----| + * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | RB | RG | RS | RZ | + * `---------------------------------' `------------------------------' + * ,---------------, .---------------. + * | LNO | LA | LO | | RE | RU | RNO | + * `---------------' `---------------' + */ + +// YOU MUST ORDER THIS! +// Order your chords from longest to shortest! +// You can only use basic keycodes here! +// +// P() is just a wrapper to make your life easier. +// +// http://docs.gboards.ca +uint32_t processQwerty(bool lookup) { + // Specials + P( RT | RS | RD | RZ | LNO, SEND_STRING(VERSION); SEND_STRING(__DATE__)); + P( LNO | LA | LO | RE | RU, SEND(KC_MPLY)); + P( ST1 | ST2 | ST3 | ST4, SEND(KC_BSPC)); + + // Thumb Chords + P( LA | LO | RE | RU, SEND(KC_CAPS)); + P( LA | RU, SEND(KC_ESC)); + P( LO | RE, SEND(KC_LCTL)); + P( LNO | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT)); + P( LNO | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT)); + + // Mods + P( RT | RD | RS | RZ, SEND(KC_LGUI)); + P( RT | RD, SEND(KC_LCTL)); + P( RS | RZ, SEND(KC_LALT)); + P( LA | LNO, SEND(KC_LCTL)); + P( LA | LO, SEND(KC_LALT)); + P( LO, SEND(KC_LSFT)); + + // Function Layer + P( FUNCT | RF | RR, SEND(KC_F6)); + P( FUNCT | RP | RB, SEND(KC_F7)); + P( FUNCT | RL | RG, SEND(KC_F8)); + P( FUNCT | ST3 | ST4, SEND(KC_F5)); + P( FUNCT| ST3, SEND(KC_F1)); + P( FUNCT| ST4, SEND(KC_F9)); + P( FUNCT | RF, SEND(KC_F2)); + P( FUNCT | RP, SEND(KC_F3)); + P( FUNCT | RL, SEND(KC_F4)); + P( FUNCT | RR, SEND(KC_F10)); + P( FUNCT | RG, SEND(KC_F12)); + P( FUNCT | RB, SEND(KC_F11)); + P( FUNCT | RD, SEND(KC_RALT); SEND(KC_T); SEND(KC_H); SEND(KC_U); SEND(KC_P)); + P( FUNCT | RZ, SEND(KC_RALT); SEND(KC_T); SEND(KC_H); SEND(KC_D); SEND(KC_N)); + P( FUNCT | RT, SEND(KC_RALT); SEND(KC_S); SEND(KC_F)); + P( FUNCT | RS, SEND(KC_LALT); SEND(KC_SPC)); + P( FUNCT | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_ESC)); + P( FUNCT | RU, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_0)); + + // Movement Layer + P( MOVE | RF, SEND(KC_LGUI); SEND(KC_LSFT); SEND(KC_LEFT)); + P( MOVE | RP, SEND(KC_UP)); + P( MOVE | RL, SEND(KC_LGUI); SEND(KC_LSFT); SEND(KC_RGHT)); + P( MOVE | RT, SEND(KC_LALT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_C)); + P( MOVE | ST3, SEND(KC_PGUP)); + P( MOVE | ST4, SEND(KC_PGDN)); + P( MOVE | RD, SEND(KC_HOME)); + P( MOVE | RZ, SEND(KC_END)); + P( MOVE | RG, SEND(KC_RIGHT)); + P( MOVE | RB, SEND(KC_DOWN)); + P( MOVE | RR, SEND(KC_LEFT)); + P( MOVE | RS, SEND(KC_LSFT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_T)); + P( MOVE | RE, SEND(KC_LSFT); SEND(KC_LALT); SEND(KC_LGUI); SEND(KC_S)); + P( MOVE | RU, SEND(KC_LSFT); SEND(KC_LCTL); SEND(KC_1)); + + + // Media Layer + P( MEDIA | RF, SEND(KC_MEDIA_PREV_TRACK)); + P( MEDIA | RP, SEND(KC_MPLY)); + P( MEDIA | RL, SEND(KC_MPLY)); + P( MEDIA | RT, SEND(KC_MEDIA_NEXT_TRACK)); + P( MEDIA | RD, SEND(KC_VOLU)); + P( MEDIA | RZ, SEND(KC_VOLD)); + P( MEDIA | RS, SEND(KC_MUTE)); + P( MEDIA | ST3, SEND(KC_LALT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_4)); + P( MEDIA | ST4, SEND(KC_LALT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_2)); + P( MEDIA | RR, SEND(KC_LALT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_3)); + P( MEDIA | RB, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_GRV)); + P( MEDIA | RG, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_8)); + P( MEDIA | RE, SEND(KC_RALT); SEND(KC_F); SEND(KC_I); SEND(KC_R); SEND(KC_E)); + P( MEDIA | RU, SEND(KC_RALT); SEND(KC_T); SEND(KC_A); SEND(KC_D)); + + // Mouse Keys and Printscreen + P( LFT | LH, CLICK_MOUSE(KC_MS_BTN1)); + P( LK | LR, CLICK_MOUSE(KC_MS_BTN2)); + P( RF | RT, SEND(KC_PSCR);); + + // Number Row Left + P( LNO | LSU, SEND(KC_1)); + P( LNO | LFT, SEND(KC_2)); + P( LNO | LP, SEND(KC_3)); + P( LNO | LH, SEND(KC_4)); + P( LNO | ST1, SEND(KC_5)); + P( LNO | ST3, SEND(KC_6)); + P( LNO | RF, SEND(KC_7)); + P( LNO | RP, SEND(KC_8)); + P( LNO | RL, SEND(KC_9)); + P( LNO | RT, SEND(KC_0)); + P( LNO | LA, SEND(KC_5)); + P( LNO | RT, SEND(KC_0)); + + // Number Row Right + P( RNO | LSU, SEND(KC_1)); + P( RNO | LFT, SEND(KC_2)); + P( RNO | LP, SEND(KC_3)); + P( RNO | LH, SEND(KC_4)); + P( RNO | ST1, SEND(KC_5)); + P( RNO | ST3, SEND(KC_6)); + P( RNO | RF, SEND(KC_7)); + P( RNO | RP, SEND(KC_8)); + P( RNO | RL, SEND(KC_9)); + P( RNO | RT, SEND(KC_0)); + P( RNO | LA, SEND(KC_5)); + P( RNO | RT, SEND(KC_0)); + + // Specials + P( LA | LNO, SEND(KC_ESC)); + P( RU | RNO, SEND(KC_TAB)); + P( RE | RU, SEND(KC_LSFT); SEND(KC_SLSH)); + P( RD | RZ, SEND(KC_ENT)); + P( RE, SEND(KC_ENT)); + //P( RD, SEND(KC_BSPC)); + P( LNO, SEND(KC_BSPC)); + P( RD, SEND(KC_DEL)); + P( LA, SEND(KC_SPC)); + P( RU, SEND(KC_SPC)); + P( RZ, SEND(KC_ESC)); + //P( RNO, REPEAT()); + + // Letters + P( LSU | LSD, SEND(KC_A)); + P( LFT | LK, SEND(KC_S)); + P( LP | LW, SEND(KC_E)); + P( LH | LR, SEND(KC_T)); + P( ST1 | ST2, SEND(KC_G)); + P( ST3 | ST4, SEND(KC_Y)); + P( RF | RR, SEND(KC_N)); + P( RT | RS, SEND(KC_H)) + P( RG | RL, SEND(KC_O)); + P( RP | RB, SEND(KC_I)); + P( LSU, SEND(KC_Q)); + P( LSD, SEND(KC_Z)); + P( LFT, SEND(KC_W)); + P( LK, SEND(KC_X)); + P( LP, SEND(KC_D)); + P( LW, SEND(KC_C)); + P( LH, SEND(KC_F)); + P( LR, SEND(KC_V)); + P( ST1, SEND(KC_K)); + P( ST2, SEND(KC_B)); + P( ST3, SEND(KC_J)); + P( ST4, SEND(KC_P)); + P( RF, SEND(KC_U)); + P( RR, SEND(KC_M)); + P( RP, SEND(KC_R)); + P( RB, SEND(KC_COMM)); + P( RL, SEND(KC_L)); + P( RG, SEND(KC_DOT)); + P( RT, SEND(KC_SCLN)); + P( RS, SEND(KC_SLSH)); + + // Symbols and Numbers + P( PWR | RE | RU, SEND(KC_ENT)); + P( PWR | LA | LO, SEND(KC_SPC)); + P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // ( + P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // ) + P( PWR | ST1 | ST2, SEND(KC_GRV)); // ` + P( PWR | RD | RZ, SEND(KC_ESC)); + P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // # + P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $ + P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // ! + P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // % + P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @ + P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^ + P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // { + P( PWR | LW, SEND(KC_LBRC)); + P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // } + P( PWR | LR, SEND(KC_RBRC)); + P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // | + P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~ + P( PWR | ST3, SEND(KC_QUOT)); + P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // " + P( PWR | RF, SEND(KC_KP_PLUS)); + P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // & + P( PWR | RP, SEND(KC_MINS)); + P( PWR | RB, SEND(KC_EQL)); + P( PWR | RL, SEND(KC_SLSH)); + P( PWR | RG, SEND(KC_LSFT); SEND(KC_MINS)); + P( PWR | RT, SEND(KC_PAST)); + P( PWR | RS, SEND(KC_DOT)); + P( PWR | RD, SEND(KC_TAB)); + P( PWR | LA, SEND(KC_LSFT); SEND(KC_SCLN)); + P( PWR | LO, SEND(KC_BSLS)); + P( PWR | RE, SEND(KC_SCLN)); + P( PWR | RU, SEND(KC_BSLS)); + P( PWR | RZ, SEND(KC_LSFT)); + + return 0; +} + +#define STENO_LAYER 0 +#define GAMING 1 +#define GAMING_2 2 +#define MOVEMENT 3 + +// "Layers" +// Steno layer should be first in your map. +// When PWR | FN | ST3 | ST4 is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end. +// If you need more space for chords, remove the two gaming layers. + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// Main layer, everything goes through here +[STENO_LAYER] = LAYOUT_georgi( +STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, +STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N7) +, +// Gaming layer with Numpad, Very limited +[GAMING] = LAYOUT_georgi( +KC_LSFT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, +KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DQUO, +KC_LALT, KC_SPC, LT(GAMING_2, KC_ENT), KC_DEL, KC_ASTR, TO(STENO_LAYER)), + +[GAMING_2] = LAYOUT_georgi( +KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, +KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, + KC_LALT, KC_SPC, KC_NO, KC_DEL, KC_ASTR, TO(STENO_LAYER)), + +[MOVEMENT] = LAYOUT_georgi( +KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_PGUP, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_HOME, +KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_END, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; +// Don't fuck with this, thanks. +size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]); diff --git a/keyboards/georgi/keymaps/norman/readme.md b/keyboards/georgi/keymaps/norman/readme.md new file mode 100644 index 00000000000..f9da34b0245 --- /dev/null +++ b/keyboards/georgi/keymaps/norman/readme.md @@ -0,0 +1,11 @@ +# Georgi QWERTY/Steno firmware + +This is the default keymap for Georgi, it's based heavily off of the naps62 ErgoDox and the Gergo layout. +It is both a ergonomic and programmer friendly keymap. + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! + +## Space issues +If you find yourself running out of space for dictionary entries, disabling mousekeys in rules.mk will save +you about 4k for entries! +Get a free 1k by deleting the Gaming layers from the keymap! diff --git a/keyboards/georgi/keymaps/norman/rules.mk b/keyboards/georgi/keymaps/norman/rules.mk new file mode 100644 index 00000000000..bb97bef2815 --- /dev/null +++ b/keyboards/georgi/keymaps/norman/rules.mk @@ -0,0 +1,35 @@ +#---------------------------------------------------------------------------- +# make georgi:default:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- + +NO_REPEAT = yes +VERBOSE = yes +KEYBOARD_SHARED_EP = yes +CUSTOM_MATRIX = yes +MOUSEKEY_ENABLE = yes + +#Debug options +CONSOLE_ENABLE = no +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_MATRIX = no +NO_PRINT = yes +ONLY_QWERTY = no + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif +ifeq ($(strip $(NO_REPEAT)), yes) + OPT_DEFS += -DNO_REPEAT +endif +ifeq ($(strip $(NO_PRINT)), yes) + OPT_DEFS += -DNO_PRINT -DNO_DEBUG +endif +ifeq ($(strip $(ONLY_QWERTY)), yes) + OPT_DEFS += -DONLYQWERTY +endif diff --git a/keyboards/georgi/matrix.c b/keyboards/georgi/matrix.c new file mode 100644 index 00000000000..58f0776c425 --- /dev/null +++ b/keyboards/georgi/matrix.c @@ -0,0 +1,398 @@ +/* + +Copyright 2013 Oleg Kostyuk + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "matrix.h" +#include +#include +#include +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "keymap_steno.h" +#include QMK_KEYBOARD_H +#ifdef DEBUG_MATRIX_SCAN_RATE +#include "timer.h" +#endif + + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +// MCP Pin Defs +#define RROW1 (1<<3) +#define RROW2 (1<<2) +#define RROW3 (1<<1) +#define RROW4 (1<<0) +#define COL0 (1<<0) +#define COL1 (1<<1) +#define COL2 (1<<2) +#define COL3 (1<<3) +#define COL4 (1<<4) +#define COL5 (1<<5) +#define COL6 (1<<6) + +// ATmega pin defs +#define ROW1 (1<<6) +#define ROW2 (1<<5) +#define ROW3 (1<<4) +#define ROW4 (1<<1) +#define COL7 (1<<0) +#define COL8 (1<<1) +#define COL9 (1<<2) +#define COL10 (1<<3) +#define COL11 (1<<2) +#define COL12 (1<<3) +#define COL13 (1<<6) + + +// bit masks +#define BMASK (COL7 | COL8 | COL9 | COL10) +#define CMASK (COL13) +#define DMASK (COL11 | COL12) +#define FMASK (ROW1 | ROW2 | ROW3 | ROW4) +#define RROWMASK (RROW1 | RROW2 | RROW3 | RROW4) +#define MCPMASK (COL0 | COL1 | COL2 | COL3 | COL4 | COL5 | COL6) + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +/* + * matrix state(1:on, 0:off) + * contains the raw values without debounce filtering of the last read cycle. + */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; + +// Debouncing: store for each key the number of scans until it's eligible to +// change. When scanning the matrix, ignore any changes in keys that have +// already changed in the last DEBOUNCE scans. +static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +static uint8_t mcp23018_reset_loop; +// static uint16_t mcp23018_reset_loop; + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + + +void matrix_init(void) +{ + // initialize row and col + mcp23018_status = init_mcp23018(); + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + raw_matrix[i] = 0; + for (uint8_t j=0; j < MATRIX_COLS; ++j) { + debounce_matrix[i * MATRIX_COLS + j] = 0; + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + matrix_init_quantum(); +} + +void matrix_power_up(void) { + mcp23018_status = init_mcp23018(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + +} + +// Returns a matrix_row_t whose bits are set if the corresponding key should be +// eligible to change in this scan. +matrix_row_t debounce_mask(matrix_row_t rawcols, uint8_t row) { + matrix_row_t result = 0; + matrix_row_t change = rawcols ^ raw_matrix[row]; + raw_matrix[row] = rawcols; + for (uint8_t i = 0; i < MATRIX_COLS; ++i) { + if (debounce_matrix[row * MATRIX_COLS + i]) { + --debounce_matrix[row * MATRIX_COLS + i]; + } else { + result |= (1 << i); + } + if (change & (1 << i)) { + debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; + } + } + return result; +} + +matrix_row_t debounce_read_cols(uint8_t row) { + // Read the row without debouncing filtering and store it for later usage. + matrix_row_t cols = read_cols(row); + // Get the Debounce mask. + matrix_row_t mask = debounce_mask(cols, row); + // debounce the row and return the result. + return (cols & mask) | (matrix[row] & ~mask);; +} + +uint8_t matrix_scan(void) +{ + // Then the keyboard + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // if (++mcp23018_reset_loop >= 1300) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + } + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_scan_count++; + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { + select_row(i); + // and select on left hand + select_row(i + MATRIX_ROWS_PER_SIDE); + // we don't need a 30us delay anymore, because selecting a + // left-hand row requires more than 30us for i2c. + + // grab cols from left hand + matrix[i] = debounce_read_cols(i); + // grab cols from right hand + matrix[i + MATRIX_ROWS_PER_SIDE] = debounce_read_cols(i + MATRIX_ROWS_PER_SIDE); + + unselect_rows(); + } + + matrix_scan_quantum(); + +#ifdef DEBUG_MATRIX + for (uint8_t c = 0; c < MATRIX_COLS; c++) + for (uint8_t r = 0; r < MATRIX_ROWS; r++) + if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c); +#endif + + return 1; +} + +bool matrix_is_modified(void) // deprecated and evidently not called. +{ + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 1 | ((PINC & CMASK) >> 6) | (PIN))); + //return ~((PINF & 0x03) | ((PINF & 0xF0) >> 2)); + return ~( + (((PINF & ROW4) >> 1) + | ((PINF & (ROW1 | ROW2 | ROW3)) >> 3)) + & 0xF); + } +} + +// Row pin configuration +static void unselect_rows(void) +{ + // no need to unselect on mcp23018, because the select step sets all + // the other row bits high, and it's not changing to a different + // direction + // Hi-Z(DDR:0, PORT:0) to unselect + DDRB &= ~(BMASK); + PORTB &= ~(BMASK); + DDRC &= ~CMASK; + PORTC &= ~CMASK; + DDRD &= ~DMASK; + PORTD &= ~DMASK; +} + +static void select_row(uint8_t row) +{ + if (row < 7) { + // select on mcp23018 + if (mcp23018_status) { // do nothing on error + } else { // set active row low : 0 // set other rows hi-Z : 1 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0xFF & ~(1< 1) { +#ifndef NO_DEBUG + uprintf("Switching to QMK\n"); +#endif + layer_on(1); + goto out; + } + + // Lone FN press, toggle QWERTY +#ifndef ONLYQWERTY + if (cChord == FN) { + (cMode == STENO) ? (cMode = QWERTY) : (cMode = STENO); + goto out; + } +#endif + + // Check for Plover momentary + if (cMode == QWERTY && (cChord & FN)) { + cChord ^= FN; + goto steno; + } + + // Do QWERTY and Momentary QWERTY + if (cMode == QWERTY || (cMode == COMMAND) || (cChord & (FN | PWR))) { + processChord(false); + goto out; + } + + // Fallback NKRO Steno + if (cMode == STENO && QWERSTENO) { + processChord(true); + goto out; + } + +steno: + // Hey that's a steno chord! + inChord = false; + chordIndex = 0; + cChord = 0; + return true; + +out: + cChord = 0; + inChord = false; + chordIndex = 0; + clear_keyboard(); + repEngaged = false; + for (int i = 0; i < 32; i++) + chordState[i] = 0xFFFF; + + return false; +} + +// Update Chord State +bool process_steno_user(uint16_t keycode, keyrecord_t *record) { + // Everything happens in here when steno keys come in. + // Bail on keyup + if (!record->event.pressed) return true; + + // Update key repeat timers + repTimer = timer_read(); + inChord = true; + + // Switch on the press adding to chord + bool pr = record->event.pressed; + switch (keycode) { + // Mods and stuff + case STN_ST1: pr ? (cChord |= (ST1)): (cChord &= ~(ST1)); break; + case STN_ST2: pr ? (cChord |= (ST2)): (cChord &= ~(ST2)); break; + case STN_ST3: pr ? (cChord |= (ST3)): (cChord &= ~(ST3)); break; + case STN_ST4: pr ? (cChord |= (ST4)): (cChord &= ~(ST4)); break; + case STN_FN: pr ? (cChord |= (FN)) : (cChord &= ~(FN)); break; + case STN_PWR: pr ? (cChord |= (PWR)): (cChord &= ~(PWR)); break; + case STN_N1...STN_N6: pr ? (cChord |= (LNO)): (cChord &= ~(LNO)); break; + case STN_N7...STN_NC: pr ? (cChord |= (RNO)): (cChord &= ~(RNO)); break; + + // All the letter keys + case STN_S1: pr ? (cChord |= (LSU)) : (cChord &= ~(LSU)); break; + case STN_S2: pr ? (cChord |= (LSD)) : (cChord &= ~(LSD)); break; + case STN_TL: pr ? (cChord |= (LFT)) : (cChord &= ~(LFT)); break; + case STN_KL: pr ? (cChord |= (LK)) : (cChord &= ~(LK)); break; + case STN_PL: pr ? (cChord |= (LP)) : (cChord &= ~(LP)); break; + case STN_WL: pr ? (cChord |= (LW)) : (cChord &= ~(LW)); break; + case STN_HL: pr ? (cChord |= (LH)) : (cChord &= ~(LH)); break; + case STN_RL: pr ? (cChord |= (LR)) : (cChord &= ~(LR)); break; + case STN_A: pr ? (cChord |= (LA)) : (cChord &= ~(LA)); break; + case STN_O: pr ? (cChord |= (LO)) : (cChord &= ~(LO)); break; + case STN_E: pr ? (cChord |= (RE)) : (cChord &= ~(RE)); break; + case STN_U: pr ? (cChord |= (RU)) : (cChord &= ~(RU)); break; + case STN_FR: pr ? (cChord |= (RF)) : (cChord &= ~(RF)); break; + case STN_RR: pr ? (cChord |= (RR)) : (cChord &= ~(RR)); break; + case STN_PR: pr ? (cChord |= (RP)) : (cChord &= ~(RP)); break; + case STN_BR: pr ? (cChord |= (RB)) : (cChord &= ~(RB)); break; + case STN_LR: pr ? (cChord |= (RL)) : (cChord &= ~(RL)); break; + case STN_GR: pr ? (cChord |= (RG)) : (cChord &= ~(RG)); break; + case STN_TR: pr ? (cChord |= (RT)) : (cChord &= ~(RT)); break; + case STN_SR: pr ? (cChord |= (RS)) : (cChord &= ~(RS)); break; + case STN_DR: pr ? (cChord |= (RD)) : (cChord &= ~(RD)); break; + case STN_ZR: pr ? (cChord |= (RZ)) : (cChord &= ~(RZ)); break; + } + + // Store previous state for fastQWER + if (pr) { + chordState[chordIndex] = cChord; + chordIndex++; + } + + return true; +} +void matrix_scan_user(void) { + // We abuse this for early sending of key + // Key repeat only on QWER/SYMB layers + if (cMode != QWERTY || !inChord) return; + + // Check timers +#ifndef NO_REPEAT + if (repEngaged && timer_elapsed(repTimer) > REP_DELAY) { + // Process Key for report + processChord(false); + + // Send report to host + send_keyboard_report(); + clear_keyboard(); + repTimer = timer_read(); + } + + if (!repEngaged && timer_elapsed(repTimer) > REP_INIT_DELAY) { + repEngaged = true; + } +#endif +}; + +// For Plover NKRO +uint32_t processFakeSteno(bool lookup) { + P( LSU, SEND(KC_Q);); + P( LSD, SEND(KC_A);); + P( LFT, SEND(KC_W);); + P( LP, SEND(KC_E);); + P( LH, SEND(KC_R);); + P( LK, SEND(KC_S);); + P( LW, SEND(KC_D);); + P( LR, SEND(KC_F);); + P( ST1, SEND(KC_T);); + P( ST2, SEND(KC_G);); + P( LA, SEND(KC_C);); + P( LO, SEND(KC_V);); + P( RE, SEND(KC_N);); + P( RU, SEND(KC_M);); + P( ST3, SEND(KC_Y);); + P( ST4, SEND(KC_H);); + P( RF, SEND(KC_U);); + P( RP, SEND(KC_I);); + P( RL, SEND(KC_O);); + P( RT, SEND(KC_P);); + P( RD, SEND(KC_LBRC);); + P( RR, SEND(KC_J);); + P( RB, SEND(KC_K);); + P( RG, SEND(KC_L);); + P( RS, SEND(KC_SCLN);); + P( RZ, SEND(KC_COMM);); + P( LNO, SEND(KC_1);); + P( RNO, SEND(KC_1);); + + return 0; +} + +// Traverse the chord history to a given point +// Returns the mask to use +void processChord(bool useFakeSteno) { + // Save the clean chord state + uint32_t savedChord = cChord; + + // Apply Stick Bits if needed + if (stickyBits != 0) { + cChord |= stickyBits; + for (int i = 0; i <= chordIndex; i++) + chordState[i] |= stickyBits; + } + + // Strip FN + if (cChord & FN) cChord ^= FN; + + // First we test if a whole chord was passsed + // If so we just run it handling repeat logic + if (useFakeSteno && processFakeSteno(true) == cChord) { + processFakeSteno(false); + return; + } else if (processQwerty(true) == cChord) { + processQwerty(false); + // Repeat logic + if (repeatFlag) { + restoreState(); + repeatFlag = false; + processChord(false); + } else { + saveState(cChord); + } + return; + } + + // Iterate through chord picking out the individual + // and longest chords + uint32_t bufChords[QWERBUF]; + int bufLen = 0; + uint32_t mask = 0; + + // We iterate over it multiple times to catch the longest + // chord. Then that gets addded to the mask and re run. + while (savedChord != mask) { + uint32_t test = 0; + uint32_t longestChord = 0; + + for (int i = 0; i <= chordIndex; i++) { + cChord = chordState[i] & ~mask; + if (cChord == 0) + continue; + + // Assume mid parse Sym is new chord + if (i != 0 && test != 0 && (cChord ^ test) == PWR) { + longestChord = test; + break; + } + + // Lock SYM layer in once detected + if (mask & PWR) + cChord |= PWR; + + + // Testing for keycodes + if (useFakeSteno) { + test = processFakeSteno(true); + } else { + test = processQwerty(true); + } + + if (test != 0) { + longestChord = test; + } + } + + mask |= longestChord; + bufChords[bufLen] = longestChord; + bufLen++; + + // That's a loop of sorts, halt processing + if (bufLen >= QWERBUF) { + return; + } + } + + // Now that the buffer is populated, we run it + for (int i = 0; i < bufLen ; i++) { + cChord = bufChords[i]; + if (useFakeSteno) { + processFakeSteno(false); + } else { + processQwerty(false); + } + } + + // Save state in case of repeat + if (!repeatFlag) { + saveState(savedChord); + } + + // Restore cChord for held repeat + cChord = savedChord; + + return; +} +void saveState(uint32_t cleanChord) { + pChord = cleanChord; + pChordIndex = chordIndex; + for (int i = 0; i < 32; i++) + pChordState[i] = chordState[i]; +} +void restoreState() { + cChord = pChord; + chordIndex = pChordIndex; + for (int i = 0; i < 32; i++) + chordState[i] = pChordState[i]; +} + +// Macros for calling from keymap.c +void SEND(uint8_t kc) { + // Send Keycode, Does not work for Quantum Codes + if (cMode == COMMAND && CMDLEN < MAX_CMD_BUF) { +#ifndef NO_DEBUG + uprintf("CMD LEN: %d BUF: %d\n", CMDLEN, MAX_CMD_BUF); +#endif + CMDBUF[CMDLEN] = kc; + CMDLEN++; + } + + if (cMode != COMMAND) register_code(kc); + return; +} +void REPEAT(void) { + if (cMode != QWERTY) + return; + + repeatFlag = true; + return; +} +void SET_STICKY(uint32_t stick) { + stickyBits = stick; + return; +} +void SWITCH_LAYER(int layer) { + if (keymapsCount >= layer) + layer_on(layer); +} +void CLICK_MOUSE(uint8_t kc) { +#ifdef MOUSEKEY_ENABLE + mousekey_on(kc); + mousekey_send(); + + // Store state for later use + inMouse = true; + mousePress = kc; +#endif +} diff --git a/keyboards/georgi/sten.h b/keyboards/georgi/sten.h new file mode 100644 index 00000000000..e94f10fc288 --- /dev/null +++ b/keyboards/georgi/sten.h @@ -0,0 +1,85 @@ +// 2019, g Heavy Industries +// Blessed mother of Christ, please keep this readable +// and protect us from segfaults. For thine is the clock, +// the slave and the master. Until we return from main. +// +// Amen. + +#include QMK_KEYBOARD_H +#include "mousekey.h" +#include "keymap.h" +#include "keymap_steno.h" +#include "wait.h" + +extern size_t keymapsCount; // Total keymaps +extern uint32_t cChord; // Current Chord +extern uint32_t stenoLayers[]; // Chords that simulate QMK layers +extern size_t stenoLayerCount; // Number of simulated layers +uint32_t refChord; // Reference chord for PC macro + +// Function defs +void processChord(bool useFakeSteno); +uint32_t processQwerty(bool lookup); +uint32_t processFakeSteno(bool lookup); +void saveState(uint32_t cChord); +void restoreState(void); + +// Macros for use in keymap.c +void SEND(uint8_t kc); +void REPEAT(void); +void SET_STICKY(uint32_t); +void SWITCH_LAYER(int); +void CLICK_MOUSE(uint8_t); + +// Keymap helper +#define P(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;} +#define PC(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;} \ + for(int i = 0; i < stenoLayerCount; i++) { \ + refChord = stenoLayers[i] | chord; \ + if (cChord == (refChord)) { if (!lookup) {act;} return refChord;}; \ +} + +// Shift to internal representation +// i.e) S(teno)R(ight)F +#define STN(n) (1L< +Copyright 2013 Oleg Kostyuk + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +// Copy and worked on with love from the EZ team + +#pragma once +#include "config_common.h" + +/* Defaults */ +#ifndef BALLSTEP +#define BALLSTEP 20 +#endif + +#ifndef SCROLLSTEP +#define SCROLLSTEP 1 +#endif + +#define VERBOSE + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1307 +#define DEVICE_VER 0x0001 +#define MANUFACTURER g Heavy Industries +#define PRODUCT Gergo +#define DESCRIPTION QMK keyboard firmware for Gergo + +/* key matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2) +#define MATRIX_COLS 4 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 +#define TAPPING_TOGGLE 1 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ +) + +#define DEBOUNCE 5 +#define USB_MAX_POWER_CONSUMPTION 500 diff --git a/keyboards/gergo/gergo.c b/keyboards/gergo/gergo.c new file mode 100644 index 00000000000..fab8d0f44c9 --- /dev/null +++ b/keyboards/gergo/gergo.c @@ -0,0 +1,84 @@ +#include QMK_KEYBOARD_H + +bool i2c_initialized = 0; +i2c_status_t mcp23018_status = 0x20; + +void matrix_init_kb(void) { + // (tied to Vcc for hardware convenience) + //DDRB &= ~(1<<4); // set B(4) as input + //PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + + // unused pins - C7, D4, D5, D7, E6 + // set as input with internal pull-up enabled + DDRC &= ~(1<<7); + DDRD &= ~(1<<5 | 1<<4 | 1<<6 | 1<<7); + DDRE &= ~(1<<6); + PORTC |= (1<<7); + PORTD |= (1<<5 | 1<<4 | 1<<6 | 1<<7); + PORTE |= (1<<6); + + matrix_init_user(); +} + + +uint8_t init_mcp23018(void) { + print("starting init"); + mcp23018_status = 0x20; + + // I2C subsystem + + // uint8_t sreg_prev; + // sreg_prev=SREG; + // cli(); + + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized = true; + _delay_ms(1000); + } + // i2c_init(); // on pins D(1,0) + // _delay_ms(1000); + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, I2C_TIMEOUT); if (mcp23018_status) goto out; + i2c_stop(); + + // set pull-up + // - unused : on : 1 + // - input : on : 1 + // - driving : off : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, I2C_TIMEOUT); if (mcp23018_status) goto out; + +out: + i2c_stop(); + // SREG=sreg_prev; + //uprintf("Init %x\n", mcp23018_status); + return mcp23018_status; +} + +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + { {0,0}, {0,7}, {2,7}, {3,7} }, + { {0,8}, {1,8}, {2,8}, {3,8} }, + { {0,9}, {1,9}, {2,9}, {3,9} }, + { {0,10}, {1,10}, {2,10}, {3,10} }, + { {0,11}, {1,11}, {2,11}, {3,11} }, + { {0,12}, {1,12}, {2,12}, {0,0} }, + { {0,13}, {1,13}, {2,13}, {0,0} }, + + { {1,0}, {0,0}, {2,0}, {3,0} }, + { {0,1}, {1,1}, {2,1}, {3,1} }, + { {0,2}, {1,2}, {2,2}, {3,2} }, + { {0,3}, {1,3}, {2,3}, {3,3} }, + { {0,4}, {1,4}, {2,4}, {3,4} }, + { {0,5}, {1,5}, {2,5}, {3,5} }, + { {0,6}, {1,6}, {2,6}, {3,6} } +}; diff --git a/keyboards/gergo/gergo.h b/keyboards/gergo/gergo.h new file mode 100644 index 00000000000..1370325f28a --- /dev/null +++ b/keyboards/gergo/gergo.h @@ -0,0 +1,54 @@ +#pragma once + +#include "quantum.h" +#include +#include +#include "i2c_master.h" +#include + + +extern i2c_status_t mcp23018_status; +#define I2C_TIMEOUT 1000 +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +// I2C aliases and register addresses (see "mcp23018.md") +//#define I2C_ADDR 0b0100000 +#define I2C_ADDR 0x20 +#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) +#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +uint8_t init_mcp23018(void); + +/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ +#define LAYOUT_gergo( \ + L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05, \ + L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ + L20,L21,L22,L23,L24,L25,L26,L30, R30,R20,R21,R22,R23,R24,R25,R26, \ + L31,L32,L33,L34, R31,R32,R33,R34) \ + /* matrix positions */ \ + { \ + { KC_NO, L16, L26, L30}, \ + { L05, L15, L25, L34}, \ + { L04, L14, L24, L33}, \ + { L03, L13, L23, L32}, \ + { L02, L12, L22, L31}, \ + { L01, L11, L21, KC_NO}, \ + { L00, L10, L20, KC_NO}, \ + \ + { KC_NO, R10, R20, R30}, \ + { R00, R11, R21, R31}, \ + { R01, R12, R22, R32}, \ + { R02, R13, R23, R33}, \ + { R03, R14, R24, R34}, \ + { R04, R15, R25, KC_NO}, \ + { R05, R16, R26, KC_NO}, \ +} diff --git a/keyboards/gergo/info.json b/keyboards/gergo/info.json new file mode 100644 index 00000000000..586b9c90812 --- /dev/null +++ b/keyboards/gergo/info.json @@ -0,0 +1,277 @@ +{ + "maintainer": "germ", + "height": 5.75, + "width": 19.5, + "keyboard_name": "Gergo", + "url": "http://gboards.ca", + "layouts": { + "LAYOUT_gergo": { + "layout": [ + { + "label": "L00", + "w": 1.5, + "x": 0, + "y": 0.38 + }, + { + "label": "L01", + "x": 1.5, + "y": 0.38 + }, + { + "label": "L02", + "x": 2.5, + "y": 0.13 + }, + { + "label": "L03", + "x": 3.5, + "y": 0 + }, + { + "label": "L04", + "x": 4.5, + "y": 0.13 + }, + { + "label": "L05", + "x": 5.5, + "y": 0.25 + }, + { + "label": "R00", + "x": 13, + "y": 0.25 + }, + { + "label": "R01", + "x": 14, + "y": 0.13 + }, + { + "label": "R02", + "x": 15, + "y": 0 + }, + { + "label": "R03", + "x": 16, + "y": 0.13 + }, + { + "label": "R04", + "x": 17, + "y": 0.38 + }, + { + "label": "R05", + "w": 1.5, + "x": 18, + "y": 0.38 + }, + { + "label": "L10", + "w": 1.5, + "x": 0, + "y": 1.3800000000000001 + }, + { + "label": "L11", + "x": 1.5, + "y": 1.3800000000000001 + }, + { + "label": "L12", + "x": 2.5, + "y": 1.1300000000000001 + }, + { + "label": "L13", + "x": 3.5, + "y": 1.0 + }, + { + "label": "L14", + "x": 4.5, + "y": 1.1300000000000001 + }, + { + "label": "L15", + "x": 5.5, + "y": 1.25 + }, + { + "h": 1.5, + "label": "L16", + "x": 6.5, + "y": 0.25 + }, + { + "h": 1.5, + "label": "R10", + "x": 12, + "y": 0.25 + }, + { + "label": "R11", + "x": 13, + "y": 1.25 + }, + { + "label": "R12", + "x": 14, + "y": 1.1300000000000001 + }, + { + "label": "R13", + "x": 15, + "y": 1.0 + }, + { + "label": "R14", + "x": 16, + "y": 1.1300000000000001 + }, + { + "label": "R15", + "x": 17, + "y": 1.3800000000000001 + }, + { + "label": "R16", + "w": 1.5, + "x": 18, + "y": 1.3800000000000001 + }, + { + "label": "L20", + "w": 1.5, + "x": 0, + "y": 2.38 + }, + { + "label": "L21", + "x": 1.5, + "y": 2.38 + }, + { + "label": "L22", + "x": 2.5, + "y": 2.13 + }, + { + "label": "L23", + "x": 3.5, + "y": 2 + }, + { + "label": "L24", + "x": 4.5, + "y": 2.13 + }, + { + "label": "L25", + "x": 5.5, + "y": 2.25 + }, + { + "h": 1.5, + "label": "L26", + "x": 6.5, + "y": 1.75 + }, + { + "label": "L30", + "x": 8.25, + "y": 2.75 + }, + { + "label": "R30", + "x": 10.25, + "y": 2.75 + }, + { + "h": 1.5, + "label": "R20", + "x": 12, + "y": 1.75 + }, + { + "label": "R21", + "x": 13, + "y": 2.25 + }, + { + "label": "R22", + "x": 14, + "y": 2.13 + }, + { + "label": "R23", + "x": 15, + "y": 2 + }, + { + "label": "R24", + "x": 16, + "y": 2.13 + }, + { + "label": "R25", + "x": 17, + "y": 2.38 + }, + { + "label": "R26", + "w": 1.5, + "x": 18, + "y": 2.38 + }, + { + "label": "L31", + "x": 4.75, + "y": 3.25 + }, + { + "label": "L32", + "x": 6, + "y": 3.63 + }, + { + "h": 2, + "label": "L33", + "x": 7.25, + "y": 3.75 + }, + { + "h": 2, + "label": "L34", + "x": 8.25, + "y": 3.75 + }, + { + "h": 2, + "label": "R31", + "x": 10.25, + "y": 3.75 + }, + { + "h": 2, + "label": "R32", + "x": 11.25, + "y": 3.75 + }, + { + "label": "R33", + "x": 12.5, + "y": 3.63 + }, + { + "label": "R34", + "x": 13.75, + "y": 3.25 + } + ] + } + } +} diff --git a/keyboards/gergo/keymaps/colemak/keymap.c b/keyboards/gergo/keymaps/colemak/keymap.c new file mode 100644 index 00000000000..b2e79114f23 --- /dev/null +++ b/keyboards/gergo/keymaps/colemak/keymap.c @@ -0,0 +1,174 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H + +#define IGNORE_MOD_TAP_INTERRUPT +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define NUMB 2 // numbers/motion + +enum custom_keycodes { + M1_STRING = SAFE_RANGE, + M2_URL, +}; + +// Blank template at the bottom + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | TAB | Q | W | F | P | G | | J | L | U | Y | ; : | | \ | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | Ctrl | A | R | S | T | D |O(CMD)| |O(CTL)| H | N | E | I | O | ' " | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B |O(ALT)| | | K | M | , < | . > | / ? | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .----------. .-------. .------. .--------. + * | alt/del | | BKSP | | Space| |cmd/del | + * '----------' '-------' `------. '--------' + * ,-------. ,-------. + * | MMB | | : | + * ,------|-------| |-------|------. + * | NUMB | SYMB | | SYMB | NUMB | + * | Esc | F13 | | F14 | Enter| + * | | | | | | + * `--------------' `--------------' + */ +[BASE] = LAYOUT_gergo( +KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y,KC_SCLN, KC_BSLS, +KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, OSM(MOD_LGUI), OSM(MOD_LCTL), KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, +KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, OSM(MOD_LALT), KC_TRNS, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + + ALT_T(KC_DEL), KC_BSPC, KC_SPC, CMD_T(KC_DEL), + + KC_BTN3, KC_COLON, + LT(SYMB, KC_ESC), LT(NUMB, KC_F13), LT(NUMB, KC_F14), LT(SYMB, KC_ENT)), +/* Keymap 1: Symbols layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | VolUp | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | [ | ] | { | } | ` | M1 | | | | - | _ | + | = | VolDn | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | ` | ~ | | | ~ | M2 | | | | | Prev |Pl/Pau| Next | Mute | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' + */ +[SYMB] = LAYOUT_gergo( +KC_TRNS, KC_EXLM, KC_AT, KC_HASH,KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC__VOLUP, +KC_TRNS, KC_LBRC, KC_RBRC, KC_LCBR,KC_RCBR, KC_PLUS, M1_STRING, KC_TRNS, KC_TRNS, KC_MINS, KC_UNDERSCORE, KC_PLUS, KC_EQL, KC__VOLDOWN, +KC_TRNS, KC_GRV, KC_TILD,KC_TRNS,KC_TRNS, KC_EQL, M2_URL, KC_TRNS, KC_TRNS, KC_TRNS, KC_MEDIA_REWIND, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_FAST_FORWARD, KC__MUTE, + + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +/* Keymap 2: Pad/Function layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | PgUp | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | F1 | F2 | F3 | F4 | F5 | F6 | BTN1 | | Home | LEFT | DOWN | UP | RIGHT| End | PgDn | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | F7 | F8 | F9 | F10 | F11 | F12 | BTN2 | | | MLFT | MDWN | MUP | MRGHT| | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | ALT | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' + */ +[NUMB] = LAYOUT_gergo( +KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGUP, +KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_BTN1, KC_HOME, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_PGDN, +KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BTN2, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +/* Keymap template + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' +[SYMB] = LAYOUT_gergo( +KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, +KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, +KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + */ + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + //uint8_t layer = biton32(layer_state); + biton32(layer_state); +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case M1_STRING: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("Hi!" SS_TAP(X_ENTER)); + } else { + // when keycode QMKBEST is released + } + break; + + case M2_URL: + if (record->event.pressed) { + SEND_STRING("https://ddg.gg" SS_TAP(X_ENTER)); + } + break; + + } + return true; +}; + diff --git a/keyboards/gergo/keymaps/colemak/readme.md b/keyboards/gergo/keymaps/colemak/readme.md new file mode 100644 index 00000000000..1c1cc7bdea2 --- /dev/null +++ b/keyboards/gergo/keymaps/colemak/readme.md @@ -0,0 +1,16 @@ +# [Gergo! By g Heavy Industries](http://gboards.ca) + +![Gergo image](https://4.bp.blogspot.com/-889nMXxgSM0/XCNxwnO5kUI/AAAAAAAA6mI/tZbWgZVCBW0dyZOCGJDkjN06DVax7j8XwCLcBGAs/s1600/48422820_967732713413298_485744639215665152_n.jpg) + +This is a [Colemak](https://colemak.com/) mapping for the Gergo, + +Unlike the default mapping, most symbols are at their original place on the number row to ease in the +learning curve. + +You can view this layout over at +[keyboad-layout-editor.com](http://www.keyboard-layout-editor.com/#/gists/f04d6a3b0cd3db91407c51f7ba36aeb3). + +## Settings +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/colemak/rules.mk b/keyboards/gergo/keymaps/colemak/rules.mk new file mode 100644 index 00000000000..ddec12d1b14 --- /dev/null +++ b/keyboards/gergo/keymaps/colemak/rules.mk @@ -0,0 +1,36 @@ +#---------------------------------------------------------------------------- +# make gergo:germ:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- +# Firmware options +BALLER = no # Enable to ball out +BALLSTEP = 20 # Multiple in px to move, multiplied by layer number +SCROLLSTEP = 1 # Lines to scroll with ball +MOUSEKEY_ENABLE = yes # Mouse keys(+4700), needed for baller + +#Debug options +VERBOSE = no +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_BALLER = no +DEBUG_MATRIX = no + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifneq ($(strip $(BALLSTEP)),) + OPT_DEFS += -DTRKSTEP=$(strip $(BALLSTEP)) +endif +ifneq ($(strip $(SCROLLSTEP)),) + OPT_DEFS += -DSCROLLSTEP=$(strip $(SCROLLSTEP)) +endif +ifeq ($(strip $(BALLER)), yes) + OPT_DEFS += -DBALLER +endif +ifeq ($(strip $(DEBUG_BALLER)), yes) + OPT_DEFS += -DDEBUG_BALLER +endif +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif diff --git a/keyboards/gergo/keymaps/default/config.h b/keyboards/gergo/keymaps/default/config.h new file mode 100644 index 00000000000..6393d46f14b --- /dev/null +++ b/keyboards/gergo/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/gergo/keymaps/default/keymap.c b/keyboards/gergo/keymaps/default/keymap.c new file mode 100644 index 00000000000..8e26223f17d --- /dev/null +++ b/keyboards/gergo/keymaps/default/keymap.c @@ -0,0 +1,128 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define NUMB 2 // numbers/motion + +// Blank template at the bottom + +enum customKeycodes { + URL = 1 +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | L1/ESC | Q | W | E | R | T | | Y | U | I | O | P | | \ | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * |Ctrl/BS | A | S | D | F | G | RMB | | | H | J | K | L | ; : | ' " | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | LMB | | | N | M | , < | . > | / ? | - _ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .----------. .-------. .------. .-----. + * | Super/Del| |Ent/ALT| | Tab | |BKSP | + * '----------' '-------' `------. '-----' + * ,-------. ,-------. + * | MMB | | PgDn | + * ,------|-------| |-------|------. + * | SYMB | NUMB | | SYMB | NUMB | + * | Space| Escape| | Mod |Space | + * | | | | | | + * `--------------' `--------------' + */ +[BASE] = LAYOUT_gergo( + LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BTN3, KC_PGDN, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC), KC_TAB, KC_BSPC + ), +/* Keymap 1: Symbols layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | ! | @ | { | } | | | | | | | | | \ | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` | | | | + | - | / | * | % | ' " | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | = | , | . | / ? | - _ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | DEL | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | PgUp | + * ,------|-------| |-------|------. + * | | | | | | + * | ; | = | | = | ; | + * | | | | | | + * `--------------' `--------------' + */ +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_TRNS, KC_TRNS, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_PGUP, KC_DEL + ), +/* Keymap 2: Pad/Function layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | F1 | F2 | F3 | F4 | F5 | F6 | BTN1 | | | LEFT | DOWN | UP | RIGHT|VolDn | VolUp | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | F7 | F8 | F9 | F10 | F11 | F12 | BTN2 | | | MLFT | MDWN | MUP | MRGHT|Ply/Pa| Skip | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | PgUp | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' + */ +[NUMB] = LAYOUT_gergo( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +/* Keymap template + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) + */ diff --git a/keyboards/gergo/keymaps/default/readme.md b/keyboards/gergo/keymaps/default/readme.md new file mode 100644 index 00000000000..471a20fbdff --- /dev/null +++ b/keyboards/gergo/keymaps/default/readme.md @@ -0,0 +1,10 @@ +# [Gergo! By g Heavy Industries](http://gboards.ca) + +![Gergo image](https://4.bp.blogspot.com/-889nMXxgSM0/XCNxwnO5kUI/AAAAAAAA6mI/tZbWgZVCBW0dyZOCGJDkjN06DVax7j8XwCLcBGAs/s1600/48422820_967732713413298_485744639215665152_n.jpg) + +This is the default keymap for Gergo, it's based heavily off of the naps62 ErgoDox layout and is aimed at a programmer friendly keymap. + +## Settings +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/default/rules.mk b/keyboards/gergo/keymaps/default/rules.mk new file mode 100644 index 00000000000..da2d03af2c4 --- /dev/null +++ b/keyboards/gergo/keymaps/default/rules.mk @@ -0,0 +1,37 @@ +#---------------------------------------------------------------------------- +# make gergo:germ:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- +# Firmware options +BALLER = no # Enable to ball out +BALLSTEP = 20 # Multiple in px to move, multiplied by layer number +SCROLLSTEP = 1 # Lines to scroll with ball +MOUSEKEY_ENABLE = yes # Mouse keys(+4700), needed for baller + +#Debug options +VERBOSE = yes +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_BALLER = no +DEBUG_MATRIX = yes + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifneq ($(strip $(BALLSTEP)),) + OPT_DEFS += -DTRKSTEP=$(strip $(BALLSTEP)) +endif +ifneq ($(strip $(SCROLLSTEP)),) + OPT_DEFS += -DSCROLLSTEP=$(strip $(SCROLLSTEP)) +endif +ifeq ($(strip $(BALLER)), yes) + POINTING_DEVICE_ENABLE = yes + OPT_DEFS += -DBALLER +endif +ifeq ($(strip $(DEBUG_BALLER)), yes) + OPT_DEFS += -DDEBUG_BALLER +endif +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif diff --git a/keyboards/gergo/keymaps/drashna/keymap.c b/keyboards/gergo/keymaps/drashna/keymap.c new file mode 100644 index 00000000000..2843b332a5f --- /dev/null +++ b/keyboards/gergo/keymaps/drashna/keymap.c @@ -0,0 +1,114 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H +#include "drashna.h" + +// clang-format off +#define LAYOUT_gergo_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_gergo_wrapper( \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \ + KC_TAB, K11, K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, KC_QUOT, \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ + KC_GRV, KC_SPC, BK_LWER, OS_LALT, OS_RGUI, DL_RAIS, KC_ENT, _______ \ + ) + +#define LAYOUT_gergo_base_wrapper(...) LAYOUT_gergo_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_gergo_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + [_COLEMAK] = LAYOUT_gergo_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DVORAK] = LAYOUT_gergo_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + [_WORKMAN] = LAYOUT_gergo_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), + + [_NORMAN] = LAYOUT_gergo_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_gergo_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_gergo_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_gergo_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + + [_MODS] = LAYOUT_gergo_wrapper( + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, _______, _______, _______, _______, ___________________BLANK___________________, KC_RSFT, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_LOWER] = LAYOUT_gergo_wrapper( + KC_F12, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, + _______, _________________LOWER_L2__________________, _______, _______, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _______, _______, _______, _______, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT_gergo_wrapper( + _______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, + _______, _________________RAISE_L2__________________, _______, _______, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _______, _______, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT_gergo_wrapper( + KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, + VRSN, _________________ADJUST_L2_________________, _______, KC_NUKE, _________________ADJUST_R2_________________, EEP_RST, + _______, _________________ADJUST_L3_________________, _______, _______, _______, _______, _________________ADJUST_R3_________________, TG_MODS, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +/* Keymap template + + [SYMB] = LAYOUT_gergo_wrapper( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + */ +// clang-format on diff --git a/keyboards/gergo/keymaps/drashna/rules.mk b/keyboards/gergo/keymaps/drashna/rules.mk new file mode 100644 index 00000000000..ec81d11e9c5 --- /dev/null +++ b/keyboards/gergo/keymaps/drashna/rules.mk @@ -0,0 +1,2 @@ +CONSOLE_ENABLE = no +COMMAND_ENABLE = no diff --git a/keyboards/gergo/keymaps/germ/config.h b/keyboards/gergo/keymaps/germ/config.h new file mode 100644 index 00000000000..6393d46f14b --- /dev/null +++ b/keyboards/gergo/keymaps/germ/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/gergo/keymaps/germ/keymap.c b/keyboards/gergo/keymaps/germ/keymap.c new file mode 100644 index 00000000000..8e26223f17d --- /dev/null +++ b/keyboards/gergo/keymaps/germ/keymap.c @@ -0,0 +1,128 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define NUMB 2 // numbers/motion + +// Blank template at the bottom + +enum customKeycodes { + URL = 1 +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | L1/ESC | Q | W | E | R | T | | Y | U | I | O | P | | \ | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * |Ctrl/BS | A | S | D | F | G | RMB | | | H | J | K | L | ; : | ' " | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | LMB | | | N | M | , < | . > | / ? | - _ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .----------. .-------. .------. .-----. + * | Super/Del| |Ent/ALT| | Tab | |BKSP | + * '----------' '-------' `------. '-----' + * ,-------. ,-------. + * | MMB | | PgDn | + * ,------|-------| |-------|------. + * | SYMB | NUMB | | SYMB | NUMB | + * | Space| Escape| | Mod |Space | + * | | | | | | + * `--------------' `--------------' + */ +[BASE] = LAYOUT_gergo( + LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BTN3, KC_PGDN, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC), KC_TAB, KC_BSPC + ), +/* Keymap 1: Symbols layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | ! | @ | { | } | | | | | | | | | \ | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` | | | | + | - | / | * | % | ' " | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | = | , | . | / ? | - _ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | DEL | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | PgUp | + * ,------|-------| |-------|------. + * | | | | | | + * | ; | = | | = | ; | + * | | | | | | + * `--------------' `--------------' + */ +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_TRNS, KC_TRNS, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_PGUP, KC_DEL + ), +/* Keymap 2: Pad/Function layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | F1 | F2 | F3 | F4 | F5 | F6 | BTN1 | | | LEFT | DOWN | UP | RIGHT|VolDn | VolUp | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | F7 | F8 | F9 | F10 | F11 | F12 | BTN2 | | | MLFT | MDWN | MUP | MRGHT|Ply/Pa| Skip | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | PgUp | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' + */ +[NUMB] = LAYOUT_gergo( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +/* Keymap template + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) + */ diff --git a/keyboards/gergo/keymaps/germ/readme.md b/keyboards/gergo/keymaps/germ/readme.md new file mode 100644 index 00000000000..471a20fbdff --- /dev/null +++ b/keyboards/gergo/keymaps/germ/readme.md @@ -0,0 +1,10 @@ +# [Gergo! By g Heavy Industries](http://gboards.ca) + +![Gergo image](https://4.bp.blogspot.com/-889nMXxgSM0/XCNxwnO5kUI/AAAAAAAA6mI/tZbWgZVCBW0dyZOCGJDkjN06DVax7j8XwCLcBGAs/s1600/48422820_967732713413298_485744639215665152_n.jpg) + +This is the default keymap for Gergo, it's based heavily off of the naps62 ErgoDox layout and is aimed at a programmer friendly keymap. + +## Settings +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/germ/rules.mk b/keyboards/gergo/keymaps/germ/rules.mk new file mode 100644 index 00000000000..badfe7bb998 --- /dev/null +++ b/keyboards/gergo/keymaps/germ/rules.mk @@ -0,0 +1,37 @@ +#---------------------------------------------------------------------------- +# make gergo:germ:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- +# Firmware options +BALLER = yes # Enable to ball out +BALLSTEP = 20 # Multiple in px to move, multiplied by layer number +SCROLLSTEP = 1 # Lines to scroll with ball +MOUSEKEY_ENABLE = yes # Mouse keys(+4700), needed for baller + +#Debug options +VERBOSE = yes +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_BALLER = no +DEBUG_MATRIX = no + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +SRC += matrix.c i2c_master.c +ifneq ($(strip $(BALLSTEP)),) + OPT_DEFS += -DTRKSTEP=$(strip $(BALLSTEP)) +endif +ifneq ($(strip $(SCROLLSTEP)),) + OPT_DEFS += -DSCROLLSTEP=$(strip $(SCROLLSTEP)) +endif +ifeq ($(strip $(BALLER)), yes) + OPT_DEFS += -DBALLER + POINTING_DEVICE_ENABLE = yes +endif +ifeq ($(strip $(DEBUG_BALLER)), yes) + OPT_DEFS += -DDEBUG_BALLER +endif +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif diff --git a/keyboards/gergo/matrix.c b/keyboards/gergo/matrix.c new file mode 100644 index 00000000000..9ef1f6b5cfa --- /dev/null +++ b/keyboards/gergo/matrix.c @@ -0,0 +1,478 @@ +/* + +Copyright 2013 Oleg Kostyuk + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "matrix.h" +#include +#include +#include +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "debounce.h" +#include QMK_KEYBOARD_H +#ifdef DEBUG_MATRIX_SCAN_RATE +# include "timer.h" +#endif + +#ifdef BALLER +#include +#include "pointing_device.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +// MCP Pin Defs +#define RROW1 (1<<3) +#define RROW2 (1<<2) +#define RROW3 (1<<1) +#define RROW4 (1<<0) +#define COL0 (1<<0) +#define COL1 (1<<1) +#define COL2 (1<<2) +#define COL3 (1<<3) +#define COL4 (1<<4) +#define COL5 (1<<5) +#define COL6 (1<<6) + +// ATmega pin defs +#define ROW1 (1<<6) +#define ROW2 (1<<5) +#define ROW3 (1<<4) +#define ROW4 (1<<1) +#define COL7 (1<<0) +#define COL8 (1<<1) +#define COL9 (1<<2) +#define COL10 (1<<3) +#define COL11 (1<<2) +#define COL12 (1<<3) +#define COL13 (1<<6) + +//Trackball pin defs +#define TRKUP (1<<4) +#define TRKDN (1<<5) +#define TRKLT (1<<6) +#define TRKRT (1<<7) +#define TRKBTN (1<<6) + + +// Multiple for mouse moves +#ifndef TRKSTEP +#define TRKSTEP 20 +#endif + +// multiple for mouse scroll +#ifndef SCROLLSTEP +#define SCROLLSTEP 5 +#endif + +// bit masks +#define BMASK (COL7 | COL8 | COL9 | COL10) +#define CMASK (COL13) +#define DMASK (COL11 | COL12) +#define FMASK (ROW1 | ROW2 | ROW3 | ROW4) +#define RROWMASK (RROW1 | RROW2 | RROW3 | RROW4) +#define MCPMASK (COL0 | COL1 | COL2 | COL3 | COL4 | COL5 | COL6) +#define TRKMASK (TRKUP | TRKDN | TRKRT | TRKLT) + +// Trackball interrupts accumulate over here. Processed on scan +// Stores prev state of mouse, high bits store direction +uint8_t trkState = 0; +uint8_t trkBtnState = 0; + +volatile uint8_t tbUpCnt = 0; +volatile uint8_t tbDnCnt = 0; +volatile uint8_t tbLtCnt = 0; +volatile uint8_t tbRtCnt = 0; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +/* + * matrix state(1:on, 0:off) + * contains the raw values without debounce filtering of the last read cycle. + */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; + +// Debouncing: store for each key the number of scans until it's eligible to +// change. When scanning the matrix, ignore any changes in keys that have +// already changed in the last DEBOUNCE scans. + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static void enableInterrupts(void); + +static uint8_t mcp23018_reset_loop; +// static uint16_t mcp23018_reset_loop; + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__attribute__ ((weak)) void matrix_init_user(void) {} + +__attribute__ ((weak)) void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } + +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } + + +void matrix_init(void) { + // initialize row and col + mcp23018_status = init_mcp23018(); + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + raw_matrix[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + debounce_init(MATRIX_ROWS); + matrix_init_quantum(); +} + +void matrix_power_up(void) { + mcp23018_status = init_mcp23018(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + +} + +// Reads and stores a row, returning +// whether a change occurred. +static inline bool store_raw_matrix_row(uint8_t index) { + matrix_row_t temp = read_cols(index); + if (raw_matrix[index] != temp) { + raw_matrix[index] = temp; + return true; + } + return false; +} + + + +uint8_t matrix_scan(void) { + // TODO: Find what is trashing interrupts + enableInterrupts(); + + // First we handle the mouse inputs +#ifdef BALLER + uint8_t pBtn = PINE & TRKBTN; + + #ifdef DEBUG_BALLER + // Compare to previous, mod report + if (tbUpCnt + tbDnCnt + tbLtCnt + tbRtCnt != 0) + xprintf("U: %d D: %d L: %d R: %d B: %d\n", tbUpCnt, tbDnCnt, tbLtCnt, tbRtCnt, (trkBtnState >> 6)); + #endif + + // Modify the report + report_mouse_t pRprt = pointing_device_get_report(); + + // Scroll by default, move on layer + if (layer_state == 0) { + pRprt.h += tbLtCnt * SCROLLSTEP; tbLtCnt = 0; + pRprt.h -= tbRtCnt * SCROLLSTEP; tbRtCnt = 0; + pRprt.v -= tbUpCnt * SCROLLSTEP; tbUpCnt = 0; + pRprt.v += tbDnCnt * SCROLLSTEP; tbDnCnt = 0; + } else { + pRprt.x -= tbLtCnt * TRKSTEP * (layer_state - 1); tbLtCnt = 0; + pRprt.x += tbRtCnt * TRKSTEP * (layer_state - 1); tbRtCnt = 0; + pRprt.y -= tbUpCnt * TRKSTEP * (layer_state - 1); tbUpCnt = 0; + pRprt.y += tbDnCnt * TRKSTEP * (layer_state - 1); tbDnCnt = 0; + } + +#ifdef DEBUG_BALLER + if (pRprt.x != 0 || pRprt.y != 0) + xprintf("X: %d Y: %d\n", pRprt.x, pRprt.y); +#endif + + if ((pBtn != trkBtnState) && ((pBtn >> 6) == 0)) pRprt.buttons |= MOUSE_BTN1; + if ((pBtn != trkBtnState) && ((pBtn >> 6) == 1)) pRprt.buttons &= ~MOUSE_BTN1; + + // Save state, push update + if (pRprt.x != 0 || pRprt.y != 0 || pRprt.h != 0 || pRprt.v != 0 || (trkBtnState != pBtn)) + pointing_device_set_report(pRprt); + + trkBtnState = pBtn; +#endif + + // Then the keyboard + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // if (++mcp23018_reset_loop >= 1300) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + } + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_scan_count++; + + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer) > 1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + + bool changed = false; + for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) { + // select rows from left and right hands + uint8_t left_index = i; + uint8_t right_index = i + MATRIX_ROWS_PER_SIDE; + select_row(left_index); + select_row(right_index); + + // we don't need a 30us delay anymore, because selecting a + // left-hand row requires more than 30us for i2c. + + changed |= store_raw_matrix_row(left_index); + changed |= store_raw_matrix_row(right_index); + + unselect_rows(); + } + + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + matrix_scan_quantum(); + + enableInterrupts(); + +#ifdef DEBUG_MATRIX + for (uint8_t c = 0; c < MATRIX_COLS; c++) + for (uint8_t r = 0; r < MATRIX_ROWS; r++) + if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c); +#endif + + return 1; +} + +bool matrix_is_modified(void) // deprecated and evidently not called. +{ + return true; +} + +inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } + +inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } + +void matrix_print(void) { + print("\nr/c 0123456789ABCDEF\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + pbin_reverse16(matrix_get_row(row)); + print("\n"); + } +} + +uint8_t matrix_key_count(void) { + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += bitpop16(matrix[i]); + } + return count; +} + +// Remember this means ROWS +static void init_cols(void) { + // init on mcp23018 + // not needed, already done as part of init_mcp23018() + + // Input with pull-up(DDR:0, PORT:1) + DDRF &= ~FMASK; + PORTF |= FMASK; +} + +static matrix_row_t read_cols(uint8_t row) { + if (row < 7) { + if (mcp23018_status) { // if there was an error + return 0; + } else { + uint8_t data = 0; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOB, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_READ, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_read_nack(I2C_TIMEOUT); if (mcp23018_status < 0) goto out; + data = ~((uint8_t)mcp23018_status); + mcp23018_status = I2C_STATUS_SUCCESS; + out: + i2c_stop(); + +#ifdef DEBUG_MATRIX + if (data != 0x00) xprintf("I2C: %d\n", data); +#endif + return data; + } + } else { + /* read from teensy + * bitmask is 0b0111001, but we want the lower four + * we'll return 1s for the top two, but that's harmless. + */ + // So I need to confuckulate all this + //return ~(((PIND & DMASK) >> 1 | ((PINC & CMASK) >> 6) | (PIN))); + //return ~((PINF & 0x03) | ((PINF & 0xF0) >> 2)); + return ~( + (((PINF & ROW4) >> 1) + | ((PINF & (ROW1 | ROW2 | ROW3)) >> 3)) + & 0xF); + } +} + +// Row pin configuration +static void unselect_rows(void) +{ + // no need to unselect on mcp23018, because the select step sets all + // the other row bits high, and it's not changing to a different + // direction + // Hi-Z(DDR:0, PORT:0) to unselect + DDRB &= ~(BMASK | TRKMASK); + PORTB &= ~(BMASK); + DDRC &= ~CMASK; + PORTC &= ~CMASK; + DDRD &= ~DMASK; + PORTD &= ~DMASK; + + // Fix trashing of DDRB for TB + PORTB |= TRKMASK; +} + +static void select_row(uint8_t row) +{ + if (row < 7) { + // select on mcp23018 + if (mcp23018_status) { // do nothing on error + } else { // set active row low : 0 // set other rows hi-Z : 1 + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0xFF & ~(1<. #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -99,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/gh60/gh60.c b/keyboards/gh60/gh60.c index 441c799fa37..10ae8935949 100644 --- a/keyboards/gh60/gh60.c +++ b/keyboards/gh60/gh60.c @@ -15,25 +15,13 @@ extern inline void gh60_wasd_leds_off(void); void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - if (usb_led & (1<", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"HHKB Fn", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + }, + "LAYOUT": { - "key_count": 65, - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Win", "x":11, "y":4}, {"label":"Menu", "x":12, "y":4}, {"label":"Ctrl", "x":13, "y":4}, {"x":14, "y":4}] + "key_count": 65, + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"ISO Hash", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":1.25}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"ISO Backslash", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"HHKB Fn", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Backspace Extra", "x":14, "y":0}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] }, "LAYOUT_60_ansi": { - "key_count": 61, - "layout": [{"x":0, "y":0, "label":"~"}, {"x":1, "y":0, "label":"!"}, {"x":2, "y":0, "label":"@"}, {"x":3, "y":0, "label":"#"}, {"x":4, "y":0, "label":"$"}, {"x":5, "y":0, "label":"%"}, {"x":6, "y":0, "label":"^"}, {"x":7, "y":0, "label":"&"}, {"x":8, "y":0, "label":"*"}, {"x":9, "y":0, "label":"("}, {"x":10, "y":0, "label":")"}, {"x":11, "y":0, "label":"_"}, {"x":12, "y":0, "label":"+"}, {"x":13, "y":0, "label":"Backspace", "w":2}, {"x":0, "y":1, "label":"Tab", "w":1.5}, {"x":1.5, "y":1, "label":"Q"}, {"x":2.5, "y":1, "label":"W"}, {"x":3.5, "y":1, "label":"E"}, {"x":4.5, "y":1, "label":"R"}, {"x":5.5, "y":1, "label":"T"}, {"x":6.5, "y":1, "label":"Y"}, {"x":7.5, "y":1, "label":"U"}, {"x":8.5, "y":1, "label":"I"}, {"x":9.5, "y":1, "label":"O"}, {"x":10.5, "y":1, "label":"P"}, {"x":11.5, "y":1, "label":"{"}, {"x":12.5, "y":1, "label":"}"}, {"x":13.5, "y":1, "label":"|", "w":1.5}, {"x":0, "y":2, "label":"Caps Lock", "w":1.75}, {"x":1.75, "y":2, "label":"A"}, {"x":2.75, "y":2, "label":"S"}, {"x":3.75, "y":2, "label":"D"}, {"x":4.75, "y":2, "label":"F"}, {"x":5.75, "y":2, "label":"G"}, {"x":6.75, "y":2, "label":"H"}, {"x":7.75, "y":2, "label":"J"}, {"x":8.75, "y":2, "label":"K"}, {"x":9.75, "y":2, "label":"L"}, {"x":10.75, "y":2, "label":":"}, {"x":11.75, "y":2, "label":"\""}, {"x":12.75, "y":2, "label":"Enter", "w":2.25}, {"x":0, "y":3, "label":"Shift", "w":2.25}, {"x":2.25, "y":3, "label":"Z"}, {"x":3.25, "y":3, "label":"X"}, {"x":4.25, "y":3, "label":"C"}, {"x":5.25, "y":3, "label":"V"}, {"x":6.25, "y":3, "label":"B"}, {"x":7.25, "y":3, "label":"N"}, {"x":8.25, "y":3, "label":"M"}, {"x":9.25, "y":3, "label":"<"}, {"x":10.25, "y":3, "label":">"}, {"x":11.25, "y":3, "label":"?"}, {"x":12.25, "y":3, "label":"Shift", "w":2.75}, {"x":0, "y":4, "label":"Ctrl", "w":1.25}, {"x":1.25, "y":4, "label":"Win", "w":1.25}, {"x":2.5, "y":4, "label":"Alt", "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "label":"Alt", "w":1.25}, {"x":11.25, "y":4, "label":"Win", "w":1.25}, {"x":12.5, "y":4, "label":"Menu", "w":1.25}, {"x":13.75, "y":4, "label":"Ctrl", "w":1.25}] + "key_count": 61, + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] }, "LAYOUT_60_iso": { - "key_count": 62, - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + "key_count": 62, + "layout": [ + {"label":"\u00ac", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"\"", "x":2, "y":0}, + {"label":"\u00a3", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"@", "x":11.75, "y":2}, + {"label":"~", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"|", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"AltGr", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] }, "LAYOUT_60_ansi_split_bs_rshift": { - "key_count": 63, - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":6}, {"label":"Alt", "x":10, "y":4, "w":1.5}, {"label":"Win", "x":11.5, "y":4}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + "key_count": 63, + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0}, + {"label":"Backspace Extra", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"HHKB Fn", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.5}, + {"label":"Win", "x":1.5, "y":4}, + {"label":"Alt", "x":2.5, "y":4, "w":1.5}, + {"label":"Space", "x":4, "y":4, "w":6}, + {"label":"Alt", "x":10, "y":4, "w":1.5}, + {"label":"Win", "x":11.5, "y":4}, + {"label":"Menu", "x":12.5, "y":4}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5} + ] }, "LAYOUT_60_ansi_split_rshift": { "key_count": 62, - "layout": [{"label":"K00", "x":0, "y":0}, {"label":"K01", "x":1, "y":0}, {"label":"K02", "x":2, "y":0}, {"label":"K03", "x":3, "y":0}, {"label":"K04", "x":4, "y":0}, {"label":"K05", "x":5, "y":0}, {"label":"K06", "x":6, "y":0}, {"label":"K07", "x":7, "y":0}, {"label":"K08", "x":8, "y":0}, {"label":"K09", "x":9, "y":0}, {"label":"K0A", "x":10, "y":0}, {"label":"K0B", "x":11, "y":0}, {"label":"K0C", "x":12, "y":0}, {"label":"K0D", "x":13, "y":0, "w":2}, {"label":"K10", "x":0, "y":1, "w":1.5}, {"label":"K11", "x":1.5, "y":1}, {"label":"K12", "x":2.5, "y":1}, {"label":"K13", "x":3.5, "y":1}, {"label":"K14", "x":4.5, "y":1}, {"label":"K15", "x":5.5, "y":1}, {"label":"K16", "x":6.5, "y":1}, {"label":"K17", "x":7.5, "y":1}, {"label":"K18", "x":8.5, "y":1}, {"label":"K19", "x":9.5, "y":1}, {"label":"K1A", "x":10.5, "y":1}, {"label":"K1B", "x":11.5, "y":1}, {"label":"K1C", "x":12.5, "y":1}, {"label":"K1D", "x":13.5, "y":1, "w":1.5}, {"label":"K20", "x":0, "y":2, "w":1.75}, {"label":"K21", "x":1.75, "y":2}, {"label":"K22", "x":2.75, "y":2}, {"label":"K23", "x":3.75, "y":2}, {"label":"K24", "x":4.75, "y":2}, {"label":"K25", "x":5.75, "y":2}, {"label":"K26", "x":6.75, "y":2}, {"label":"K27", "x":7.75, "y":2}, {"label":"K28", "x":8.75, "y":2}, {"label":"K29", "x":9.75, "y":2}, {"label":"K2A", "x":10.75, "y":2}, {"label":"K2B", "x":11.75, "y":2}, {"label":"K2D", "x":12.75, "y":2, "w":2.25}, {"label":"K30", "x":0, "y":3, "w":2.25}, {"label":"K32", "x":2.25, "y":3}, {"label":"K33", "x":3.25, "y":3}, {"label":"K34", "x":4.25, "y":3}, {"label":"K35", "x":5.25, "y":3}, {"label":"K36", "x":6.25, "y":3}, {"label":"K37", "x":7.25, "y":3}, {"label":"K38", "x":8.25, "y":3}, {"label":"K39", "x":9.25, "y":3}, {"label":"K3A", "x":10.25, "y":3}, {"label":"K3B", "x":11.25, "y":3}, {"label":"K3D", "x":12.25, "y":3, "w":1.75}, {"label":"K3C", "x":14, "y":3}, {"label":"K40", "x":0, "y":4, "w":1.25}, {"label":"K41", "x":1.25, "y":4, "w":1.25}, {"label":"K42", "x":2.5, "y":4, "w":1.25}, {"label":"K45", "x":3.75, "y":4, "w":6.25}, {"label":"K4A", "x":10, "y":4, "w":1.25}, {"label":"K4B", "x":11.25, "y":4, "w":1.25}, {"label":"K4C", "x":12.5, "y":4, "w":1.25}, {"label":"K4D", "x":13.75, "y":4, "w":1.25}] + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"HHKB Fn", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] } } } - - - diff --git a/keyboards/gh60/keymaps/bluezio/keymap.c b/keyboards/gh60/keymaps/bluezio/keymap.c index 7b2f16fadaa..c0f650ecc5a 100644 --- a/keyboards/gh60/keymaps/bluezio/keymap.c +++ b/keyboards/gh60/keymaps/bluezio/keymap.c @@ -36,6 +36,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_HOME, KC_SPC, KC_END, KC_PSCREEN, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/gh60/keymaps/bluezio/rules.mk b/keyboards/gh60/keymaps/bluezio/rules.mk index bfd26779c65..4b820c974b6 100644 --- a/keyboards/gh60/keymaps/bluezio/rules.mk +++ b/keyboards/gh60/keymaps/bluezio/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/gh60/keymaps/chaser/keymap.c b/keyboards/gh60/keymaps/chaser/keymap.c index bff29428bb5..29228eec2de 100644 --- a/keyboards/gh60/keymaps/chaser/keymap.c +++ b/keyboards/gh60/keymaps/chaser/keymap.c @@ -13,10 +13,6 @@ extern keymap_config_t keymap_config; #define _FL 1 #define _MC 2 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - bool git_duet = false; bool backlight_arrows = false; bool backlight_gaming = false; diff --git a/keyboards/gh60/keymaps/dbroqua/config.h b/keyboards/gh60/keymaps/dbroqua/config.h index fd63c9a8f76..8952200e055 100644 --- a/keyboards/gh60/keymaps/dbroqua/config.h +++ b/keyboards/gh60/keymaps/dbroqua/config.h @@ -50,7 +50,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -96,11 +96,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/gh60/keymaps/dbroqua/rules.mk b/keyboards/gh60/keymaps/dbroqua/rules.mk index 31c63ffd841..21d4b60d961 100644 --- a/keyboards/gh60/keymaps/dbroqua/rules.mk +++ b/keyboards/gh60/keymaps/dbroqua/rules.mk @@ -39,7 +39,6 @@ #---------------------------------------------------------------------------- # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -106,7 +105,3 @@ NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: htt # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable RGB Underglow -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - diff --git a/keyboards/gh60/keymaps/dbroqua_7U/rules.mk b/keyboards/gh60/keymaps/dbroqua_7U/rules.mk index e5460196922..21192b17941 100644 --- a/keyboards/gh60/keymaps/dbroqua_7U/rules.mk +++ b/keyboards/gh60/keymaps/dbroqua_7U/rules.mk @@ -39,7 +39,6 @@ #---------------------------------------------------------------------------- # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -106,6 +105,3 @@ NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: htt # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable RGB Underglow -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/gh60/keymaps/default/keymap.c b/keyboards/gh60/keymaps/default/keymap.c index f8ca9a35c01..a8fd4f3c229 100644 --- a/keyboards/gh60/keymaps/default/keymap.c +++ b/keyboards/gh60/keymaps/default/keymap.c @@ -1,56 +1,31 @@ #include QMK_KEYBOARD_H -// Fillers to make layering more clear -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, - KC_LSFT, F(1), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, F(0), KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_BSLS, KC_RALT, KC_RGUI, KC_APP, KC_RCTL - ), - /* 1: fn */ - LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - /* 2: arrows */ - LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, - _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT - ), - -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - [1] = ACTION_LAYER_TOGGLE(2), // toggle arrow overlay -}; + [0] = LAYOUT_all( /* 0: qwerty */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, + KC_LSFT, TG(2), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + ), + + [1] = LAYOUT_all( /* 1: fn */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [2] = LAYOUT_all( /* 2: arrows */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT + ), -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; }; void matrix_scan_user(void) { diff --git a/keyboards/gh60/keymaps/emiilsd/keymap.c b/keyboards/gh60/keymaps/emiilsd/keymap.c index 0fbfe38c235..a863511d609 100644 --- a/keyboards/gh60/keymaps/emiilsd/keymap.c +++ b/keyboards/gh60/keymaps/emiilsd/keymap.c @@ -15,9 +15,6 @@ */ #include QMK_KEYBOARD_H -// Fillers to make layering more clear -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ISO HHKB layout: diff --git a/keyboards/gh60/keymaps/robotmaxtron/config.h b/keyboards/gh60/keymaps/robotmaxtron/config.h index 925a69efe09..1cc41d183b6 100644 --- a/keyboards/gh60/keymaps/robotmaxtron/config.h +++ b/keyboards/gh60/keymaps/robotmaxtron/config.h @@ -53,7 +53,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -99,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/gh60/keymaps/robotmaxtron/rules.mk b/keyboards/gh60/keymaps/robotmaxtron/rules.mk index 2b80ea00e38..b6761ac9ff8 100644 --- a/keyboards/gh60/keymaps/robotmaxtron/rules.mk +++ b/keyboards/gh60/keymaps/robotmaxtron/rules.mk @@ -39,7 +39,6 @@ #---------------------------------------------------------------------------- # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -106,7 +105,3 @@ NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https:/ # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable RGB Underglow -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - diff --git a/keyboards/gh60/keymaps/sethbc/rules.mk b/keyboards/gh60/keymaps/sethbc/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/gh60/keymaps/sethbc/rules.mk +++ b/keyboards/gh60/keymaps/sethbc/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/gh60/keymaps/xyverz/keymap.c b/keyboards/gh60/keymaps/xyverz/keymap.c index 3709a0c0526..e47fcc2f943 100644 --- a/keyboards/gh60/keymaps/xyverz/keymap.c +++ b/keyboards/gh60/keymaps/xyverz/keymap.c @@ -18,10 +18,6 @@ extern keymap_config_t keymap_config; #define DVORAK M(_DV) #define COLEMAK M(_CM) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* @@ -118,10 +114,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/keyboards/gh60/readme.md b/keyboards/gh60/readme.md index 01a23aca754..b63cce9735e 100644 --- a/keyboards/gh60/readme.md +++ b/keyboards/gh60/readme.md @@ -13,7 +13,7 @@ Make example for this keyboard (after setting up your build environment): make gh60:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). ## GH60 Hardware Information diff --git a/keyboards/gh60/rules.mk b/keyboards/gh60/rules.mk index 37511432aab..a4ee56d84a2 100644 --- a/keyboards/gh60/rules.mk +++ b/keyboards/gh60/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -65,4 +64,4 @@ NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https: # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift \ No newline at end of file +LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift diff --git a/keyboards/gh80_3000/config.h b/keyboards/gh80_3000/config.h index ca72aba5aa3..edcacc20e10 100644 --- a/keyboards/gh80_3000/config.h +++ b/keyboards/gh80_3000/config.h @@ -30,7 +30,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +38,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/gh80_3000/readme.md b/keyboards/gh80_3000/readme.md index d6beebf9071..ca269470461 100644 --- a/keyboards/gh80_3000/readme.md +++ b/keyboards/gh80_3000/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make gh80_3000:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/gherkin/README.md b/keyboards/gherkin/README.md deleted file mode 100644 index 5e0daeabf93..00000000000 --- a/keyboards/gherkin/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Gherkin -=== - -A 30 key keyboard. - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gherkin) - -Keyboard Maintainer: QMK Community -Hardware Supported: Gherkin PCB -Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2016/11/gherkin.html) - -Make example for this keyboard (after setting up your build environment): - - make gherkin:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. -First pass at adding support for the gherkin keyboard. Compiles but completely -untested. Intended to kick-start development. diff --git a/keyboards/gherkin/config.h b/keyboards/gherkin/config.h deleted file mode 100644 index 34f38e35c29..00000000000 --- a/keyboards/gherkin/config.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER 40 Percent Club -#define PRODUCT Gherkin -#define DESCRIPTION A 30 key ortholinear keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 6 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } -#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* number of backlight levels */ -#define BACKLIGHT_PIN B5 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 3 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 0 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -#endif diff --git a/keyboards/gherkin/gherkin.h b/keyboards/gherkin/gherkin.h deleted file mode 100644 index f8674be40ed..00000000000 --- a/keyboards/gherkin/gherkin.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef GHERKIN_H -#define GHERKIN_H - -#include "quantum.h" - -#define LAYOUT_ortho_3x10( \ - K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \ - K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \ - K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \ -) { \ - { K00, K01, K02, K03, K04, K05 }, \ - { K10, K11, K12, K13, K14, K15 }, \ - { K20, K21, K22, K23, K24, K25 }, \ - { K30, K31, K32, K33, K34, K35 }, \ - { K40, K41, K42, K43, K44, K45 } \ -} - -#endif diff --git a/keyboards/gherkin/keymaps/bbaserdem/config.h b/keyboards/gherkin/keymaps/bbaserdem/config.h deleted file mode 100644 index 37d7113e78b..00000000000 --- a/keyboards/gherkin/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H - -#include "../../config.h" -#define RGB_DI_PIN F6 -#define RGBLED_NUM 10 -#define RGBLIGHT_ANIMATIONS -#ifdef BACKLIGHT_LEVELS -#undef BACKLIGHT_LEVELS -#endif -#define BACKLIGHT_LEVELS 3 - -#endif diff --git a/keyboards/gherkin/keymaps/bbaserdem/rules.mk b/keyboards/gherkin/keymaps/bbaserdem/rules.mk deleted file mode 100644 index cd1cddebf42..00000000000 --- a/keyboards/gherkin/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -USER_NAME := bbaserdem-nouserspace - -STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -AUDIO_ENABLE = no # Enable audio output from keyboard - -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable RBG light strips -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/gherkin/keymaps/default/keymap.c b/keyboards/gherkin/keymaps/default/keymap.c deleted file mode 100644 index f018200304e..00000000000 --- a/keyboards/gherkin/keymaps/default/keymap.c +++ /dev/null @@ -1,74 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _______ KC_TRNS -#define FN1_Q LT(1, KC_Q) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_ortho_3x10( - FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC, - KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT - ), - - [1] = LAYOUT_ortho_3x10( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_INC, - _______, _______, _______, _______, _______, _______, RESET, _______, _______, BL_DEC - ), - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - (void)event; - - switch (id) { - - } - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - DDRD |= (1 << 5); PORTD &= ~(1 << 5); - } else { - DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 0); PORTB &= ~(1 << 0); - } else { - DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/gherkin/keymaps/itsaferbie/config.h b/keyboards/gherkin/keymaps/itsaferbie/config.h deleted file mode 100644 index 71c0cb8b568..00000000000 --- a/keyboards/gherkin/keymaps/itsaferbie/config.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#undef RGB_DI_PIN -#undef RGBLED_NUM -#define RGB_DI_PIN D2 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/itsaferbie/keymap.c b/keyboards/gherkin/keymaps/itsaferbie/keymap.c deleted file mode 100644 index 580b041c9cb..00000000000 --- a/keyboards/gherkin/keymaps/itsaferbie/keymap.c +++ /dev/null @@ -1,152 +0,0 @@ -#include QMK_KEYBOARD_H - -extern rgblight_config_t rgblight_config; -extern keymap_config_t keymap_config; - -#define _PS 0 // This is the Photoshop Layer -#define _AI 1 // This is the Illustrator Layer -#define _PR 2 // This is the Premier Layer -#define _XD 3 // This is the Experience Design Layer - -enum custom_keycodes { - PS = SAFE_RANGE, - AI, - PR, -}; - -#define _______ KC_TRNS - -#define PS TO(0) -#define AI TO(1) -#define PR TO(2) -#define XD TO(3) - -// Mix of Photoshop, Illustrator, Premiere, and Experience Design shortcuts. -#define SAVE LCTL(KC_S) -#define OPEN LCTL(KC_O) -#define COPY LCTL(KC_C) -#define PAST LCTL(KC_V) -#define CUNDO LCTL(LALT(KC_Z)) -#define INVERT LCTL(LSFT(KC_I)) -#define NLAYER LSFT(LCTL(KC_N)) -#define UNDO LCTL(KC_Z) -#define TRANS LCTL(KC_T) -#define ALIGNL LCTL(LSFT(KC_L)) -#define ALIGNC LCTL(LSFT(KC_C)) -#define ALIGNR LCTL(LSFT(KC_R)) -#define BRINGF LCTL(KC_RBRC) -#define BRINGB LCTL(KC_LBRC) - -// Illustrator layer shortcuts. -#define SHAPE LSFT(KC_M) -#define RULER LCTL(LALT(KC_R)) - -// Premiere layer shortcuts. -#define REDO LCTL(LSFT(KC_Z)) -#define EXPORT LCTL(KC_M) -#define IMPORT LCTL(KC_I) -#define PCOPY LCTL(KC_V) -#define PPASTE LCTL(LSFT(KC_V)) - -// Experience Design layer shortcuts. (can be used with others too.) -#define NEW LCTL(KC_N) -#define LOCK LCTL(KC_L) -#define SYMB LCTL(KC_K) -#define HIDE LCTL(KC_SCLN) -#define REPEAT LCTL(KC_R) -#define MASK LCTL(LSFT(KC_M)) -#define GROUP LCTL(KC_G) -#define UNGRP LCTL(LSFT(KC_G)) -#define VIEW LCTL(KC_TAB) -#define HORZ LSFT(KC_C) -#define VERT LSFT(KC_M) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - // Photoshop layer - [_PS] = LAYOUT_ortho_3x10( - SAVE, KC_W, KC_E, KC_T, KC_U, KC_I, KC_P, INVERT, CUNDO, NLAYER, - UNDO, KC_H, KC_L, TRANS, ALIGNL, ALIGNC, ALIGNR, BRINGB, BRINGF, OPEN, - KC_LSFT, COPY, PAST, KC_Z, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, AI - ), - - // Illustrator layer - [_AI] = LAYOUT_ortho_3x10( - _______, M(0), RULER, _______, KC_G, _______, _______, KC_Q, KC_MINS, KC_PLUS, - _______, _______, _______, KC_E, _______, _______, _______, SHAPE, KC_O, OPEN, - _______, _______, _______, _______, _______, _______, _______, KC_M, KC_SLSH, PR - ), - - // Premiere layer - [_PR] = LAYOUT_ortho_3x10( - _______, KC_Q, KC_W, KC_I, KC_O, KC_P, IMPORT, EXPORT, KC_MINS, KC_EQL, - _______, REDO, KC_D, KC_F, KC_H, KC_M, KC_ENT, KC_LBRC, KC_RBRC, OPEN, - _______, PCOPY, PPASTE, KC_SPC, KC_Z, KC_C, KC_V, KC_LEFT, KC_RIGHT, XD - ), - - // Experience Design layer - [_XD] = LAYOUT_ortho_3x10( - _______, KC_E, KC_R, KC_T, KC_P, KC_A, KC_L, KC_V, KC_DEL, NEW, - _______, REDO, GROUP, UNGRP, VIEW, HORZ, VERT, KC_Z, KC_ENT, OPEN, - _______, KC_LCTL, COPY, PAST, SYMB, LOCK, MASK, HIDE, REPEAT, PS - ), - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -void matrix_init_user(void) { - rgblight_enable(); -} - -void matrix_scan_user(void) { - #ifdef RGBLIGHT_ENABLE - - static uint8_t old_layer = 255; - uint8_t new_layer = biton32(layer_state); - - // Color of the Icons. - if (old_layer != new_layer) { - switch (new_layer) { - case _PS: - // #31C5F0 - rgblight_setrgb(49, 197, 240); - break; - case _AI: - // #FF8011 - rgblight_setrgb(255, 128, 17); - break; - case _PR: - // #E788FF - rgblight_setrgb(231, 136, 255); - break; - case _XD: - // #FF2BC2 - rgblight_setrgb(255, 43, 194); - break; - } - old_layer = new_layer; - } - #endif -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - (void)event; - - switch (id) { - case 0: - // Save for Web Macro. - return MACRO(D(LSFT), D(LALT), D(LCTL), T(S), U(LCTL), U(LALT), U(LSFT), END); - } - return MACRO_NONE; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - } - return true; -} diff --git a/keyboards/gherkin/keymaps/itsaferbie/rules.mk b/keyboards/gherkin/keymaps/itsaferbie/rules.mk deleted file mode 100644 index ed0af7b8bd7..00000000000 --- a/keyboards/gherkin/keymaps/itsaferbie/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -BACKLIGHT_ENABLE = yes -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/mjt/config.h b/keyboards/gherkin/keymaps/mjt/config.h deleted file mode 100644 index bb59ec213d5..00000000000 --- a/keyboards/gherkin/keymaps/mjt/config.h +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Some Guy -#define PRODUCT Gherkin -#define DESCRIPTION 30 percent disaster - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 6 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ - -// These are with USB on the left. -// #define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } -// original from TMK: #define MATRIX_COL_PINS { D0, D4, C6, D7, E6, B4 } -// #define MATRIX_COL_PINS { D0, D4, F6, D7, E6, B4 } - -// these are with USB on the right. -#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } -#define MATRIX_COL_PINS { B4, E6, D7, F6, D4, D0 } - -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 -#define BACKLIGHT_PIN B5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -#define AUDIO_VOICES - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/gherkin/keymaps/mjt/keymap.c b/keyboards/gherkin/keymaps/mjt/keymap.c deleted file mode 100644 index 2b4369c34f8..00000000000 --- a/keyboards/gherkin/keymaps/mjt/keymap.c +++ /dev/null @@ -1,279 +0,0 @@ -#include QMK_KEYBOARD_H -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif - -extern keymap_config_t keymap_config; - -//Tap Dance Declarations -enum { - TD_Z_LCTL = 0, - TD_X_LGUI = 1, - TD_C_LALT = 2, - TD_A_TAB = 3, - TD_Q_ESC = 4, -// M(0) -}; - -//Friendly Layer Names -enum gherkin_layers { - _QWERTY, - _SONGS, - _NUMBERS, - _SYMBOLS, - _PLOVER, - _ADJUST -}; - -// custom keycodes -enum gherkin_keycodes { - QWERTY = SAFE_RANGE, - NUMBERS, - SYMBOLS, - SONGS, - PLOVER, - BACKLIT, - MACSLEEP, - EXT_PLV -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_ortho_3x10( - TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - TD(TD_A_TAB), LT(_SYMBOLS,KC_S), KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_ADJUST,KC_SPC), - TD(TD_Z_LCTL), TD(TD_X_LGUI), TD(TD_C_LALT), KC_V, KC_B, LT(_NUMBERS, KC_N), KC_M, KC_COMM, KC_DOT, SFT_T(KC_ENT) - ), - [_NUMBERS] = LAYOUT_ortho_3x10( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_HOME, KC_PGDN, KC_PGUP, KC_END , - KC_F7, KC_F8, KC_F9, KC_F10, LT(_ADJUST,KC_F11), _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT - ), - [_SYMBOLS] = LAYOUT_ortho_3x10( - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, - KC_GRV, _______, XXXXXXX, KC_LBRC, KC_RBRC, KC_BSLS, KC_MINS, KC_EQL , KC_SCLN, KC_QUOT, - KC_TILD, MO(_ADJUST), XXXXXXX, KC_LCBR, KC_RCBR, KC_PIPE, KC_UNDS, KC_PLUS, S(KC_SCLN), S(KC_QUOT) - ), - [_PLOVER] = LAYOUT_ortho_3x10( - KC_Q, KC_W, KC_E, KC_R, KC_1, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - EXT_PLV, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX - ), - [_ADJUST] = LAYOUT_ortho_3x10( - RESET, _______, _______, _______, _______, QWERTY, NUMBERS, SYMBOLS, PLOVER, SONGS, - MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, _______, _______, MACSLEEP, _______, - BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float tone_plover[][2] = SONG(PLOVER_SOUND); -float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); - -float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case NUMBERS: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistant_default_layer_set(1UL<<_NUMBERS); - } - return false; - break; - case SYMBOLS: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistant_default_layer_set(1UL<<_SYMBOLS); - } - return false; - break; - case PLOVER: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_plover); - #endif - layer_off(_NUMBERS); - layer_off(_SYMBOLS); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_plover_gb); - #endif - layer_off(_PLOVER); - } - return false; - break; - case MACSLEEP: - if (record->event.pressed) { - // ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_POWER); - register_code(KC_RSFT); - register_code(KC_RCTL); - register_code(KC_POWER); - unregister_code(KC_POWER); - unregister_code(KC_RCTL); - unregister_code(KC_RSFT); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - } - return true; -} - - -/* -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - - switch (id) { - case 0: { - if (record->event.pressed) { - key_timer = timer_read(); // if the key is being pressed, we start the timer. - } - else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down"). - if (timer_elapsed(key_timer) > 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap. - return MACRO( D(LSFT), END ); - } - else { - return MACRO( T(N), END ); - } - } - break; - } - } - return MACRO_NONE; -}*/ - -void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); -} - -void shutdown_user() -{ - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_SONG(music_scale); -} - -#endif - -void matrix_scan_user(void) { -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - //Tap once for Esc, twice for Caps Lock - [TD_Z_LCTL] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_LCTL), - [TD_X_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_X, KC_LGUI), - [TD_C_LALT] = ACTION_TAP_DANCE_DOUBLE(KC_C, KC_LALT), - [TD_A_TAB] = ACTION_TAP_DANCE_DOUBLE(KC_A, KC_TAB), - [TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) -}; - -// don't know what this is doing... -/* -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - DDRD |= (1 << 5); PORTD &= ~(1 << 5); - } else { - DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 0); PORTB &= ~(1 << 0); - } else { - DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} -*/ diff --git a/keyboards/gherkin/keymaps/mjt/rules.mk b/keyboards/gherkin/keymaps/mjt/rules.mk deleted file mode 100644 index afb93b674c1..00000000000 --- a/keyboards/gherkin/keymaps/mjt/rules.mk +++ /dev/null @@ -1,29 +0,0 @@ -## not sure where this stuff goes ## -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE=yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/gherkin/keymaps/steno/config.h b/keyboards/gherkin/keymaps/steno/config.h deleted file mode 100644 index abacefa01d2..00000000000 --- a/keyboards/gherkin/keymaps/steno/config.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define NO_ACTION_LAYER -#define NO_ACTION_TAPPING -#define NO_ACTION_ONESHOT -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION - -#endif \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/steno/rules.mk b/keyboards/gherkin/keymaps/steno/rules.mk deleted file mode 100644 index fa813f2099f..00000000000 --- a/keyboards/gherkin/keymaps/steno/rules.mk +++ /dev/null @@ -1,16 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/talljoe-gherkin/config.h b/keyboards/gherkin/keymaps/talljoe-gherkin/config.h deleted file mode 100644 index 7fa3bf328ec..00000000000 --- a/keyboards/gherkin/keymaps/talljoe-gherkin/config.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#endif diff --git a/keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c b/keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c deleted file mode 100644 index ea2921924e7..00000000000 --- a/keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c +++ /dev/null @@ -1,58 +0,0 @@ -#include QMK_KEYBOARD_H -#include "keymap_steno.h" - -#define ST_BOLT QK_STENO_BOLT -#define ST_GEM QK_STENO_GEMINI - -#define XXXXXXX KC_NO - -enum keyboard_layers { - _QWERTY, - _RAISE, - _LOWER, - _PLOVER, - _ADJUST -}; - -#define ADJ_Z LT(_ADJUST, KC_Z) -#define RS_BSPC LT(_RAISE, KC_BSPC) -#define LW_SPC LT(_LOWER, KC_SPC) -#define MO_ADJ MO(_ADJUST) -#define TG_PLV TG(_PLOVER) -#define OS_LCTL OSM(MOD_LCTL) -#define OS_LALT OSM(MOD_LALT) -#define OS_LGUI OSM(MOD_LGUI) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_ortho_3x10( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_RSFT, - ADJ_Z, KC_X, KC_C, KC_V, RS_BSPC, LW_SPC, KC_B, KC_N, KC_M, KC_ENT - ), - - [_RAISE] = LAYOUT_ortho_3x10( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_7, KC_9, KC_0, - KC_ESC, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC, _______, KC_QUOT, KC_SCLN, _______, - OS_LCTL, OS_LGUI, OS_LALT, KC_GRV, _______, KC_TAB, KC_BSLS, KC_COMM, KC_DOT, KC_SLSH - ), - - [_LOWER] = LAYOUT_ortho_3x10( - KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, - KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, - KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, OS_LALT, OS_LGUI, OS_LCTL, KC_CAPS - ), - - [_PLOVER] = LAYOUT_ortho_3x10( - STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, - STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, - MO_ADJ, STN_NUM, STN_A, STN_O, STN_NUM, STN_E, STN_U, STN_NUM, STN_NUM, XXXXXXX - ), - - [_ADJUST] = LAYOUT_ortho_3x10( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ST_BOLT, ST_GEM, TG_PLV, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET - ), - -}; diff --git a/keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk b/keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk deleted file mode 100644 index 02216ecb36e..00000000000 --- a/keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER diff --git a/keyboards/gherkin/rules.mk b/keyboards/gherkin/rules.mk deleted file mode 100644 index 416ca5e5f4a..00000000000 --- a/keyboards/gherkin/rules.mk +++ /dev/null @@ -1,59 +0,0 @@ -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = no - -LAYOUTS = ortho_3x10 diff --git a/keyboards/gingham/config.h b/keyboards/gingham/config.h new file mode 100644 index 00000000000..53601e8cada --- /dev/null +++ b/keyboards/gingham/config.h @@ -0,0 +1,250 @@ +/* +Copyright 2019 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x8968 +#define PRODUCT_ID 0x4748 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar-Designs +#define PRODUCT Gingham +#define DESCRIPTION A 65 persent keyboard with only through hole components + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ + +/* A Custom matrix.c is used to poll the port expander C6 shows that the pins are hardwired there */ +#define MATRIX_ROW_PINS { D0, C3, D1, C1, C2 } +#define MATRIX_COL_PINS { D4, D4, C0, B5, D5, B4, D6, B1, B0, B2, D7, B3, D4, D4 } +#define UNUSED_PINS +#define PORT_EXPANDER_ADDRESS 0x20 + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define NO_UART 1 + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 + diff --git a/keyboards/gingham/gingham.c b/keyboards/gingham/gingham.c new file mode 100644 index 00000000000..9a5ffe4530c --- /dev/null +++ b/keyboards/gingham/gingham.c @@ -0,0 +1,40 @@ +/* Copyright 2019 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "gingham.h" +#include "i2c_master.h" + +uint8_t send_data; + +void matrix_init_kb(void) { + // Due to the way the port expander is setup both LEDs are already outputs. This is set n matrix.copy + //Turn the red LED on as power indicator. + send_data = 0x10; + i2c_writeReg((PORT_EXPANDER_ADDRESS << 1), 0x09, &send_data, 1, 20); + + matrix_init_user(); +} + +void led_set_kb(uint8_t usb_led) { + // Bit 3 is Green LED, bit 4 is Red LED. + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + send_data = 0x18; + } else { + send_data = 0x10; + } + i2c_writeReg((PORT_EXPANDER_ADDRESS << 1), 0x09, &send_data, 1, 20); + + led_set_user(usb_led); +} diff --git a/keyboards/gingham/gingham.h b/keyboards/gingham/gingham.h new file mode 100644 index 00000000000..a9785b54167 --- /dev/null +++ b/keyboards/gingham/gingham.h @@ -0,0 +1,49 @@ +/* Copyright 2019 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define XXX KC_NO + +#include "quantum.h" + +#define LAYOUT_60_iso_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \ +} diff --git a/keyboards/gingham/info.json b/keyboards/gingham/info.json new file mode 100644 index 00000000000..ed58ef6a6cc --- /dev/null +++ b/keyboards/gingham/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "Gingham", + "url": "https://yiancar-designs.com/product/gingham/", + "maintainer": "Yiancar", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi_split_bs_rshift": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Back", "x":13, "y":0}, {"label":"Delete", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Shift", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Fn", "x":11.25, "y":4, "w":1.25}, {"label":"App", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_iso_split_bs_rshift": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Back", "x":13, "y":0}, {"label":"Delete", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"ISO Hash", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"ISO \\", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Shift", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Fn", "x":11.25, "y":4, "w":1.25}, {"label":"App", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} diff --git a/keyboards/gingham/keymaps/default/keymap.c b/keyboards/gingham/keymaps/default/keymap.c new file mode 100644 index 00000000000..b5b4de5fffa --- /dev/null +++ b/keyboards/gingham/keymaps/default/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +//This is the ANSI version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_ansi_split_bs_rshift( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), + +[1] = LAYOUT_60_ansi_split_bs_rshift( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_60_ansi_split_bs_rshift( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_60_ansi_split_bs_rshift( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/gingham/keymaps/default/readme.md b/keyboards/gingham/keymaps/default/readme.md new file mode 100644 index 00000000000..2f3372492e1 --- /dev/null +++ b/keyboards/gingham/keymaps/default/readme.md @@ -0,0 +1,6 @@ +The default keymap for Gingham +============================== + +![Layout image](https://i.imgur.com/WwOVJTh.jpg) + +Default layer is normal ANSI and Fn layer is used for Volume control and arrow cluster. \ No newline at end of file diff --git a/keyboards/gingham/keymaps/iso/keymap.c b/keyboards/gingham/keymaps/iso/keymap.c new file mode 100644 index 00000000000..0058df54acb --- /dev/null +++ b/keyboards/gingham/keymaps/iso/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +//This is the ISO version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_iso_split_bs_rshift( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), + +[1] = LAYOUT_60_iso_split_bs_rshift( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_60_iso_split_bs_rshift( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_60_iso_split_bs_rshift( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/gingham/keymaps/iso/readme.md b/keyboards/gingham/keymaps/iso/readme.md new file mode 100644 index 00000000000..cd29c289009 --- /dev/null +++ b/keyboards/gingham/keymaps/iso/readme.md @@ -0,0 +1,6 @@ +The default keymap for ISO Gingham +================================== + +![Layout image](https://i.imgur.com/WwOVJTh.jpg) + +Default layer is normal ISO and Fn layer is used for Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/gingham/matrix.c b/keyboards/gingham/matrix.c new file mode 100644 index 00000000000..790ba9c287b --- /dev/null +++ b/keyboards/gingham/matrix.c @@ -0,0 +1,247 @@ +/* +Copyright 2012-2019 Jun Wako, Jack Humbert, Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" +#include "i2c_master.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values +static matrix_row_t matrix[MATRIX_ROWS]; //debounced values + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +//Deprecated. +bool matrix_is_modified(void) +{ + if (debounce_active()) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< 0) && (x < 12) ) { + setPinInputHigh(col_pins[x]); + } + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) +{ + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + uint8_t pin_state; + // Select the col pin to read (active low) + switch (col_index) { + case 0 : + i2c_readReg((PORT_EXPANDER_ADDRESS << 1), 0x09, &pin_state, 1, 20); + pin_state = pin_state & 0x01; + break; + case 12 : + i2c_readReg((PORT_EXPANDER_ADDRESS << 1), 0x09, &pin_state, 1, 20); + pin_state = pin_state & (1 << 2); + break; + case 13 : + i2c_readReg((PORT_EXPANDER_ADDRESS << 1), 0x09, &pin_state, 1, 20); + pin_state = pin_state & (1 << 1); + break; + default : + pin_state = readPin(col_pins[col_index]); + } + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +void matrix_init(void) { + + // Initialize I2C + i2c_init(); + + // initialize key pins + init_pins(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + raw_matrix[i] = 0; + matrix[i] = 0; + } + + debounce_init(MATRIX_ROWS); + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) +{ + bool changed = false; + + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + changed |= read_cols_on_row(raw_matrix, current_row); + } + + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + + matrix_scan_quantum(); + return (uint8_t)changed; +} diff --git a/keyboards/gingham/readme.md b/keyboards/gingham/readme.md new file mode 100644 index 00000000000..9893884e84e --- /dev/null +++ b/keyboards/gingham/readme.md @@ -0,0 +1,22 @@ +# Gingham + +![gingham](https://yiancar-designs.com/wp-content/uploads/2019/06/IMG_20190625_233619.jpg) + +A 60% keyboard with only through hole components. + +Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) +Hardware Supported: ATMEGA328p with vusb [PCB](https://github.com/yiancar/gingham_pcb) +Hardware Availability: https://yiancar-designs.com/, https://novelkeys.xyz, https://mechboards.co.uk/ + +Make example for this keyboard (after setting up your build environment): + make gingham:default + +Flash firmware: + // In bootloader mode + make gingham:default:program + +Bootloader: +use usbasploader HSGW's my repository. +https://github.com/hsgw/USBaspLoader/tree/plaid + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/gingham/rules.mk b/keyboards/gingham/rules.mk new file mode 100644 index 00000000000..83f424ba032 --- /dev/null +++ b/keyboards/gingham/rules.mk @@ -0,0 +1,93 @@ +SRC = matrix.c \ + i2c_master.c + +# MCU name +MCU = atmega328p +PROTOCOL = VUSB + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +# +# This uses usbaspbootloader +BOOTLOADER = USBasp + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 + +# Flash program via avrdude, but default command is not suitable. +# You can use plaid:default:program +PROGRAM_CMD = avrdude -c usbasp -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex + +# disable debug code +OPT_DEFS = -DDEBUG_LEVEL=0 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes +CUSTOM_MATRIX = yes diff --git a/keyboards/gingham/usbconfig.h b/keyboards/gingham/usbconfig.h new file mode 100644 index 00000000000..30cdd36987b --- /dev/null +++ b/keyboards/gingham/usbconfig.h @@ -0,0 +1,397 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +// max power draw with maxed white underglow measured at 120 mA (peaks) +#define USB_CFG_MAX_BUS_POWER 100 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 0 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x01, 0x00 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'Y','i','a','n','c','a','r','-','D','e', 's', 'i', 'g', 'n', 's' +#define USB_CFG_VENDOR_NAME_LEN 15 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'G', 'i', 'n', 'g', 'h', 'a', 'm' +#define USB_CFG_DEVICE_NAME_LEN 7 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +#define USB_CFG_SERIAL_NUMBER '0' +#define USB_CFG_SERIAL_NUMBER_LEN 1 +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +// #define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +// /* #define USB_INTR_CFG_CLR 0 */ +// /* #define USB_INTR_ENABLE EIMSK */ +// #define USB_INTR_ENABLE_BIT INT1 +// /* #define USB_INTR_PENDING EIFR */ +// #define USB_INTR_PENDING_BIT INTF1 +// #define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/gonnerd/config.h b/keyboards/gonnerd/config.h index cad8fe58618..5b22495db72 100644 --- a/keyboards/gonnerd/config.h +++ b/keyboards/gonnerd/config.h @@ -28,16 +28,11 @@ #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #endif diff --git a/keyboards/gonnerd/keymaps/default/keymap.c b/keyboards/gonnerd/keymaps/default/keymap.c index 1055ddc53f7..19b79601617 100644 --- a/keyboards/gonnerd/keymaps/default/keymap.c +++ b/keyboards/gonnerd/keymaps/default/keymap.c @@ -20,7 +20,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { __x__, __x__, __x__, __x__, __x__, __x__, KC_TRNS, __x__ \ ), }; - -const uint16_t PROGMEM fn_actions[] = { - -}; diff --git a/keyboards/gonnerd/keymaps/default/rules.mk b/keyboards/gonnerd/keymaps/default/rules.mk index e34aba6927f..6de64fcf894 100644 --- a/keyboards/gonnerd/keymaps/default/rules.mk +++ b/keyboards/gonnerd/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/gonnerd/keymaps/gam3cat/config.h b/keyboards/gonnerd/keymaps/gam3cat/config.h index d86da86e40b..334beb0ac2b 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/config.h +++ b/keyboards/gonnerd/keymaps/gam3cat/config.h @@ -1,6 +1,10 @@ -#include "../../config.h" +#pragma once + +//Force NKRO to be enabled. +#define FORCE_NKRO + //GRAVE_ESC override for CTRL+SHIFT+ESC Windows task manager shortcut. -#define GRAVE_ESC_CTRL_OVERRIDE +//#define GRAVE_ESC_CTRL_OVERRIDE //Delay matrix scan for tap dance, reduce to activate modifier keys faster. //#define TAPPING_TERM 200 diff --git a/keyboards/gonnerd/keymaps/gam3cat/keymap.c b/keyboards/gonnerd/keymaps/gam3cat/keymap.c index 3e43d67d504..3142209d6fb 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/keymap.c +++ b/keyboards/gonnerd/keymaps/gam3cat/keymap.c @@ -11,13 +11,16 @@ enum layers { _AL, // Adjust Layer }; -enum gonnerd_keycodes { - DYNAMIC_MACRO_RANGE = SAFE_RANGE, +enum custom_keycodes { + QMK_REV = SAFE_RANGE, + KC_WEB, + KC_SP4, + DYNAMIC_MACRO_RANGE }; +extern backlight_config_t backlight_config; + #include "dynamic_macro.h" -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define FN_CAPS LT(_FL, KC_CAPS) #define KC_DMR1 DYN_REC_START1 #define KC_DMR2 DYN_REC_START2 @@ -25,47 +28,44 @@ enum gonnerd_keycodes { #define KC_DMP2 DYN_MACRO_PLAY2 #define KC_DMRS DYN_REC_STOP -static uint8_t current_layer; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* _BL: Base Layer, mostly standard TKL QWERTY layout. - * .-----------------------------------------------------------------------. - * |Esc||||| F1| F2| F3| F4||| F5| F6| F7| F8||| F9|F10|F11|F12|PSc|SLk|Pau| - * |-----------------------------------------------------------|-----------| - * | ~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Ins|Hom|PgU| - * |-----------------------------------------------------------|-----------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|Del|End|PgD| - * |-----------------------------------------------------------|-----------| - * |FnCaps| A| S| D| F| G| H| J| K| L| ;| '|Return | | - * |-----------------------------------------------------------|-----------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up| | - * |-----------------------------------------------------------|-----------| - * |Ctrl |||||Win | Space |RAlt |||||Ctrl |Lft|Dwn|Rgt| - * *-----------------------------------------------------------------------* + /*#### _BL: Base Layer - Standard TKL QWERTY layout. + * .-----------------------------------------------------------------------. + * |Esc|||||F1 |F2 |F3 |F4 |||F5 |F6 |F7 |F8 |||F9 |F10|F11|F12|PSc|SLk|Pau| + * |-----------------------------------------------------------|-----------| + * |~ |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backsp |Ins|Hom|PgU| + * |-----------------------------------------------------------|-----------| + * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del|End|PgD| + * |-----------------------------------------------------------|-----------| + * |Caps |A |S |D |F |G |H |J |K |L |; |' |Return | | + * |-----------------------------------------------------------|-----------| + * |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Fn | | Up| | + * |-----------------------------------------------------------|-----------| + * |Ctrl |Win|Alt | Space |RAlt |Fn |Ctrl |Lft|Dwn|Rgt| + * *-----------------------------------------------------------------------* */ [_BL] = LAYOUT_tkl( \ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ - FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FL), KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ ), - - /* _WL: Workman Layer. - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | -| =| | | | | - * |-----------------------------------------------------------|-----------| - * | | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| | | | - * |-----------------------------------------------------------|-----------| - * | | A| S| H| T| G| Y| N| E| O| I| '| | | - * |-----------------------------------------------------------|-----------| - * | | Z| X| M| C| V| K| L| ,| .| /| | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _WL: Workman Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |S |H |T |G |Y |N |E |O |I |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |M |C |V |K |L |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* */ [_WL] = LAYOUT_tkl( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -75,21 +75,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), - - /* _NL: Norman Layer. - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | -| =| | | | | - * |-----------------------------------------------------------|-----------| - * | | Q| W| D| F| K| J| U| R| L| ;| [| ]| \| | | | - * |-----------------------------------------------------------|-----------| - * | | A| S| E| T| G| Y| N| I| O| H| '| | | - * |-----------------------------------------------------------|-----------| - * | | Z| X| C| V| B| P| M| ,| .| /| | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _NL: Norman Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |S |E |T |G |Y |N |I |O |H |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |C |V |B |P |M |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* */ [_NL] = LAYOUT_tkl( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -99,21 +98,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_P , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), - - /* _DL: Dvorak Layer. - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | [| ]| | | | | - * |-----------------------------------------------------------|-----------| - * | | '| ,| .| P| Y| F| G| C| R| L| /| =| \| | | | - * |-----------------------------------------------------------|-----------| - * | | A| O| E| U| I| D| H| T| N| S| -| | | - * |-----------------------------------------------------------|-----------| - * | | ;| Q| J| K| X| B| M| W| V| Z| | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _DL: Dvorak Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |[ |] | | | | | + * |-----------------------------------------------------------|-----------| + * | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |O |E |U |I |D |H |T |N |S |- | | | + * |-----------------------------------------------------------|-----------| + * | |; |Q |J |K |X |B |M |W |V |Z | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* */ [_DL] = LAYOUT_tkl( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -123,21 +121,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z , _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), - - /* _CL: Colmak Layer. - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | -| =| | | | | - * |-----------------------------------------------------------|-----------| - * | | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| | | | - * |-----------------------------------------------------------|-----------| - * | | A| R| S| T| D| H| N| E| I| O| '| | | - * |-----------------------------------------------------------|-----------| - * | | Z| X| C| V| B| K| M| ,| .| /| | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _CL: Colmak Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |R |S |T |D |H |N |E |I |O |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |C |V |B |K |M |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* */ [_CL] = LAYOUT_tkl( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -147,142 +144,126 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), - - /* _FL: Function Layer. - * M0 opens Chrome - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | - * .-----------------------------------------------------------|-----------| - * | M0| | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * |Fn_AL| | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * |FnCaps| | | | | | |Lft|Dwn|Up |Rgt| | | | - * |-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| |WBk| |WFw| - * *-----------------------------------------------------------------------* + /*#### _FL: Function Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | + * .-----------------------------------------------------------|-----------| + * |Web| | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * |Fn_AL| | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | |Lft|Dwn|Up |Rgt| | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | | |Fn | | | | + * |-----------------------------------------------------------|-----------| + * | | | | SP4 | |Fn | |WBk| |WFw| + * *-----------------------------------------------------------------------* */ [_FL] = LAYOUT_tkl( \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, \ - M(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_WEB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ MO(_AL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \ - XXXXXXX, XXXXXXX, KC_MENU, M(1), XXXXXXX, _______, XXXXXXX, XXXXXXX, KC_WBAK, XXXXXXX, KC_WFWD \ + XXXXXXX, XXXXXXX, KC_MENU, KC_SP4, XXXXXXX, _______, XXXXXXX, XXXXXXX, KC_WBAK, XXXXXXX, KC_WFWD \ ), - - /* _AL: Adjust Layer. - * Default keymap, RGB Underglow, LED backlight, and Dynamic Macro settings. - * .-----------------------------------------------------------------------. - * |Rst||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * |Ver|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| - * |-----------------------------------------------------------|-----------| - * |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| - * |-----------------------------------------------------------|-----------| - * |FnCaps| | |_DL| | | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * | | | |_CL| |_BL|_NL| | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _AL: Adjust Layer - Keymap select, LED backlight, and Dynamic Macro settings. + * .-----------------------------------------------------------------------. + * |Rst||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| + * |-----------------------------------------------------------|-----------| + * |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| + * |-----------------------------------------------------------|-----------| + * | | | |_DL| | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | |_CL| |_BL|_NL| | | | | |Fn | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | |Fn | | | | | + * *-----------------------------------------------------------------------* */ [_AL] = LAYOUT_tkl( \ RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - F(0), RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMR1, KC_DMP1, \ + QMK_REV, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMR1, KC_DMP1, \ _______, DF(_BL), DF(_WL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMRS, KC_DMR2, KC_DMP2, \ - _______, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DF(_CL), XXXXXXX, DF(_BL), DF(_NL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMK_REV: if (record->event.pressed) { - return MACRO(I(0), D(LGUI), T(R), U(LGUI), END); + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE); } - else { + return false; + break; + case KC_WEB: + if (record->event.pressed) { + SEND_STRING(SS_LGUI("r")); + wait_ms(100); SEND_STRING("chrome.exe\n"); - return false; } - break; - case 1: + return false; + break; + case KC_SP4: if (record->event.pressed) { - return MACRO(I(0), T(SPC), T(SPC), T(SPC), T(SPC), END); + SEND_STRING (" "); } - else { - return false; - } - break; + return false; + break; } - return MACRO_NONE; -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(0), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case 0: - if (record->event.pressed) { - SEND_STRING ("[QMK:" QMK_KEYBOARD ":" QMK_KEYMAP ":" QMK_VERSION "]"); - } - break; + // Dynamic Macros. + if (!process_record_dynamic_macro(keycode, record)) { + return false; } + return true; +} + +void custom_backlight_level(uint8_t level) { + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + backlight_config.level = level; + backlight_config.enable = !!backlight_config.level; + backlight_set(backlight_config.level); } void matrix_init_user(void) { #ifdef BACKLIGHT_ENABLE - backlight_level(0); + custom_backlight_level(0); #endif } -// Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - if (current_layer == layer) { - } - else { - current_layer = layer; - switch (layer) { - case 0: - backlight_level(0); - break; - case 1: - backlight_level(1); - break; - case 2: - backlight_level(1); - break; - case 3: - backlight_level(1); - break; - case 4: - backlight_level(1); - break; - case 5: - backlight_level(2); - break; - case 6: - backlight_level(3); - break; - default: - backlight_level(0); - break; - } - } } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // Enable Dynamic Macros. - if (!process_record_dynamic_macro(keycode, record)) { - return false; +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _BL: + custom_backlight_level(0); + break; + case _WL: + case _NL: + case _DL: + case _CL: + custom_backlight_level(1); + break; + case _FL: + custom_backlight_level(2); + break; + case _AL: + custom_backlight_level(3); + break; + default: + custom_backlight_level(0); + break; } - return true; + return state; +} + +void led_set_user(uint8_t usb_led) { + } diff --git a/keyboards/gonnerd/keymaps/gam3cat/readme.md b/keyboards/gonnerd/keymaps/gam3cat/readme.md index 181369790a5..8630ea2966c 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/readme.md +++ b/keyboards/gonnerd/keymaps/gam3cat/readme.md @@ -1,120 +1,114 @@ # Keymap Maintainer: Gam3cat make gonnerd:gam3cat ## Layout Config: -2u backspace, 2.25u left shift/enter, 1.75u right shift. -2x1.5u, 1x7.0u, 2x1.5u, 3x1u bottom row. - - FN_CAPS = MO(_FL) when held, CAPS when tapped. - GRAVE_ESC + GUI = ` - GRAVE_ESC + SHIFT = ~ +2u backspace, 2.25u lshift/enter, [2.75u rshift] or [1.75u rshift, 1u Fn]. +[1.5u, 1u, 1.5u 1x7.0u, 1.5u, 1u, 1.5u, 3x1u] or [2x1.5u, 1x7.0u, 2x1.5u, 3x1u] bottom row. ## Base Layer Selection: -(Caps+TAB+( )): (Q)WERTY, (W)orkman, (N)orman, (D)vorak, (C)olmak +(Fn+TAB+( )): (Q)WERTY, (W)orkman, (N)orman, (D)vorak, (C)olmak ### Base Layer Options: - _BL: Base Layer, mostly standard TKL QWERTY layout. +#### _BL: Base Layer - Standard TKL QWERTY layout. .-----------------------------------------------------------------------. - |Esc||||| F1| F2| F3| F4||| F5| F6| F7| F8||| F9|F10|F11|F12|PSc|SLk|Pau| + |Esc|||||F1 |F2 |F3 |F4 |||F5 |F6 |F7 |F8 |||F9 |F10|F11|F12|PSc|SLk|Pau| |-----------------------------------------------------------|-----------| - | ~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Ins|Hom|PgU| + |~ |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backsp |Ins|Hom|PgU| |-----------------------------------------------------------|-----------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|Del|End|PgD| + |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del|End|PgD| |-----------------------------------------------------------|-----------| - |FnCaps| A| S| D| F| G| H| J| K| L| ;| '|Return | | + |Caps |A |S |D |F |G |H |J |K |L |; |' |Return | | |-----------------------------------------------------------|-----------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up| | + |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Fn | | Up| | |-----------------------------------------------------------|-----------| - |Ctrl |||||Win | Space |RAlt |||||Ctrl |Lft|Dwn|Rgt| + |Ctrl |Win|Alt | Space |RAlt |Fn |Ctrl |Lft|Dwn|Rgt| *-----------------------------------------------------------------------* - - _WL: Workman Layer. + +#### _WL: Workman Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - | | | | | | | | | | | | -| =| | | | | + | | | | | | | | | | | |- |= | | | | | |-----------------------------------------------------------|-----------| - | | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| | | | + | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | | | |-----------------------------------------------------------|-----------| - | | A| S| H| T| G| Y| N| E| O| I| '| | | + | |A |S |H |T |G |Y |N |E |O |I |' | | | |-----------------------------------------------------------|-----------| - | | Z| X| M| C| V| K| L| ,| .| /| | | | | | + | |Z |X |M |C |V |K |L |, |. |/ | | | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | | | | | | | *-----------------------------------------------------------------------* - - _NL: Norman Layer. + +#### _NL: Norman Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - | | | | | | | | | | | | -| =| | | | | + | | | | | | | | | | | |- |= | | | | | |-----------------------------------------------------------|-----------| - | | Q| W| D| F| K| J| U| R| L| ;| [| ]| \| | | | + | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | | | |-----------------------------------------------------------|-----------| - | | A| S| E| T| G| Y| N| I| O| H| '| | | + | |A |S |E |T |G |Y |N |I |O |H |' | | | |-----------------------------------------------------------|-----------| - | | Z| X| C| V| B| P| M| ,| .| /| | | | | | + | |Z |X |C |V |B |P |M |, |. |/ | | | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | | | | | | | *-----------------------------------------------------------------------* - - _DL: Dvorak Layer. + +#### _DL: Dvorak Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - | | | | | | | | | | | | [| ]| | | | | + | | | | | | | | | | | |[ |] | | | | | |-----------------------------------------------------------|-----------| - | | '| ,| .| P| Y| F| G| C| R| L| /| =| \| | | | + | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | | | |-----------------------------------------------------------|-----------| - | | A| O| E| U| I| D| H| T| N| S| -| | | + | |A |O |E |U |I |D |H |T |N |S |- | | | |-----------------------------------------------------------|-----------| - | | ;| Q| J| K| X| B| M| W| V| Z| | | | | | + | |; |Q |J |K |X |B |M |W |V |Z | | | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | | | | | | | *-----------------------------------------------------------------------* - - _CL: Colmak Layer. + +#### _CL: Colmak Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - | | | | | | | | | | | | -| =| | | | | + | | | | | | | | | | | |- |= | | | | | |-----------------------------------------------------------|-----------| - | | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| | | | + | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | | | |-----------------------------------------------------------|-----------| - | | A| R| S| T| D| H| N| E| I| O| '| | | + | |A |R |S |T |D |H |N |E |I |O |' | | | |-----------------------------------------------------------|-----------| - | | Z| X| C| V| B| K| M| ,| .| /| | | | | | + | |Z |X |C |V |B |K |M |, |. |/ | | | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | | | | | | | *-----------------------------------------------------------------------* - - _FL: Function Layer. - M0 opens Chrome + +#### _FL: Function Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | .-----------------------------------------------------------|-----------| - | M0| | | | | | | | | | | | | | | | | + |Web| | | | | | | | | | | | | | | | | |-----------------------------------------------------------|-----------| - | | | | | | | | | | | | | | | | | | + |Fn_AL| | | | | | | | | | | | | | | | | |-----------------------------------------------------------|-----------| | | | | | | | |Lft|Dwn|Up |Rgt| | | | |-----------------------------------------------------------|-----------| - | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | |Fn | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| |WBk| |WFw| + | | | | SP4 | |Fn | |WBk| |WFw| *-----------------------------------------------------------------------* - - _AL: Adjust Layer. - Default keymap, RGB Underglow, LED backlight, and Dynamic Macro settings. + +#### _AL: Adjust Layer - Keymap select, LED backlight, and Dynamic Macro settings. .-----------------------------------------------------------------------. |Rst||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - |Ver|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| + |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| |-----------------------------------------------------------|-----------| |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| |-----------------------------------------------------------|-----------| - |FnCaps| | |_DL| | | | | | | | | | | + | | | |_DL| | | | | | | | | | | |-----------------------------------------------------------|-----------| - | | | |_CL| |_BL|_NL| | | | | | | | | | + | | | |_CL| |_BL|_NL| | | | | |Fn | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | |Fn | | | | | *-----------------------------------------------------------------------* diff --git a/keyboards/gonnerd/keymaps/gam3cat/rules.mk b/keyboards/gonnerd/keymaps/gam3cat/rules.mk index a226838424f..6eab033cc0c 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/rules.mk +++ b/keyboards/gonnerd/keymaps/gam3cat/rules.mk @@ -2,20 +2,23 @@ # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # +TAP_DANCE_ENABLE = no # Enable TapDance functionality +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+1500) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # Nkey Rollover - If this doesn't work, add this to config.h: #define FORCE_NKRO +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = no # Enable extended unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Uses buzzer to emulate clicky switches. By default, uses the C6 pin, same as AUDIO_ENABLE. +#VARIABLE_TRACE = no # Use this to debug changes to variable values +API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings(+5390) +KEY_LOCK_ENABLE = no # This enables key lock(+260) +SPLIT_KEYBOARD = no # This enables split keyboard support and includes all necessary files located at quantum/split_common diff --git a/keyboards/gonnerd/keymaps/mauin/rules.mk b/keyboards/gonnerd/keymaps/mauin/rules.mk index e34aba6927f..6de64fcf894 100644 --- a/keyboards/gonnerd/keymaps/mauin/rules.mk +++ b/keyboards/gonnerd/keymaps/mauin/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/gonnerd/keymaps/tkl/keymap.c b/keyboards/gonnerd/keymaps/tkl/keymap.c index 1b7e7031a0d..404f3825f65 100644 --- a/keyboards/gonnerd/keymaps/tkl/keymap.c +++ b/keyboards/gonnerd/keymaps/tkl/keymap.c @@ -25,7 +25,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - -const uint16_t PROGMEM fn_actions[] = { - -}; diff --git a/keyboards/gonnerd/keymaps/tkl/rules.mk b/keyboards/gonnerd/keymaps/tkl/rules.mk index b96663efe6c..09b51e5a093 100644 --- a/keyboards/gonnerd/keymaps/tkl/rules.mk +++ b/keyboards/gonnerd/keymaps/tkl/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/gonnerd/readme.md b/keyboards/gonnerd/readme.md index 9bc879e3d54..223fdf3d3ff 100644 --- a/keyboards/gonnerd/readme.md +++ b/keyboards/gonnerd/readme.md @@ -11,7 +11,7 @@ Make example for this keyboard (after setting up your build environment): make gonnerd:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Changing Bootloader diff --git a/keyboards/cod67/cod67.c b/keyboards/gray_studio/cod67/cod67.c similarity index 100% rename from keyboards/cod67/cod67.c rename to keyboards/gray_studio/cod67/cod67.c diff --git a/keyboards/cod67/cod67.h b/keyboards/gray_studio/cod67/cod67.h similarity index 100% rename from keyboards/cod67/cod67.h rename to keyboards/gray_studio/cod67/cod67.h diff --git a/keyboards/gray_studio/cod67/config.h b/keyboards/gray_studio/cod67/config.h new file mode 100644 index 00000000000..47b42d8a601 --- /dev/null +++ b/keyboards/gray_studio/cod67/config.h @@ -0,0 +1,183 @@ +/* +Copyright 2018 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Gray +#define PRODUCT cod67 +#define DESCRIPTION 60% Custom Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 } +#define MATRIX_COL_PINS { D7, F7, F6, F5, F4, F1, F0, E6, B0, B7, D0, D1, D2, D3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN D4 +#define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#endif diff --git a/keyboards/cod67/info.json b/keyboards/gray_studio/cod67/info.json similarity index 100% rename from keyboards/cod67/info.json rename to keyboards/gray_studio/cod67/info.json diff --git a/keyboards/gray_studio/cod67/keymaps/default/keymap.c b/keyboards/gray_studio/cod67/keymaps/default/keymap.c new file mode 100644 index 00000000000..245d7eee6f0 --- /dev/null +++ b/keyboards/gray_studio/cod67/keymaps/default/keymap.c @@ -0,0 +1,43 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/cod67/keymaps/default/readme.md b/keyboards/gray_studio/cod67/keymaps/default/readme.md similarity index 100% rename from keyboards/cod67/keymaps/default/readme.md rename to keyboards/gray_studio/cod67/keymaps/default/readme.md diff --git a/keyboards/gray_studio/cod67/readme.md b/keyboards/gray_studio/cod67/readme.md new file mode 100644 index 00000000000..7f91cf30d1e --- /dev/null +++ b/keyboards/gray_studio/cod67/readme.md @@ -0,0 +1,30 @@ +# Gray COD67 + +The Gray COD67 is a 60% keyboard with a modern and bold design. It features 20 RGB Underglow LED lights and a unique diffuser placement. The COD67 has the most stunning RGB light strip for a custom mechanical keyboard. It also features a center mounted USB C port. + +There were only 75 units made worldwide. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Gray COD67 +Hardware Availability: [Zfrontier](https://en.zfrontier.com/products/cod67) + +At this time, flashing ONLY works on Windows systems. + +To put in bootloader mode, hold the `Esc` key while plugging in the USB cable. + +The COD67 will show up as a drive. + +Make example for this keyboard (after setting up your build environment): + + make gray_studio/cod67:default:bin + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +Rename the resulting `.bin` file to `cod67.bin`. + +Drag and drop `cod67.bin` to the drive, overwriting the previous `cod67.bin` stored on it. + +Press the `Esc` key again to reset the board. You are now ready to type! + +## Notes +The backlight pin is attached to a non PWM pin `D4` so backlight is only on/off. diff --git a/keyboards/gray_studio/cod67/rules.mk b/keyboards/gray_studio/cod67/rules.mk new file mode 100644 index 00000000000..6cba6b6b869 --- /dev/null +++ b/keyboards/gray_studio/cod67/rules.mk @@ -0,0 +1,67 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/gray_studio/hb85/config.h b/keyboards/gray_studio/hb85/config.h new file mode 100644 index 00000000000..da230f7e8d5 --- /dev/null +++ b/keyboards/gray_studio/hb85/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422F +#define MANUFACTURER Gray Studio +#define PRODUCT HB85 + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } +#define DIODE_DIRECTION COL2ROW + +#define RGBLED_NUM 5 +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/gray_studio/hb85/hb85.c b/keyboards/gray_studio/hb85/hb85.c new file mode 100644 index 00000000000..3e420235878 --- /dev/null +++ b/keyboards/gray_studio/hb85/hb85.c @@ -0,0 +1,75 @@ +/* +Copyright 2017 Luiz Ribeiro , + 2019 fcoury + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +#include "rgblight.h" + +#include "i2c_master.h" +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // turn RGB LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn RGB LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} diff --git a/keyboards/gray_studio/hb85/hb85.h b/keyboards/gray_studio/hb85/hb85.h new file mode 100644 index 00000000000..48808105f43 --- /dev/null +++ b/keyboards/gray_studio/hb85/hb85.h @@ -0,0 +1,100 @@ +/* +Copyright 2019 fcoury , MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + +// Generic layout enabling splits, and all positions available in STT, Basic, and AOP. + +#define LAYOUT_all( \ + K0C, K0B, K0A, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0E, \ + K1E, K1D, K1C, K1B, K1A, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K59, K58, K57, \ + K2E, K2D, K2C, K2B, K2A, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K56, K55, \ + K3E, K3D, K3C, K3B, K3A, K30, K31, K32, K33, K34, K35, K36, K37, K39, K76, K75, \ + K4E, K4D, K4C, K4B, K4A, K40, K41, K42, K43, K44, K45, K48, K46, K47, K49, K78, K77, \ + K6D, K6C, K61, K64, K65, K66, K67, K68, K69, K79 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, KC_NO, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K55, K56, K57, K58, K59, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, K67, K68, K69, KC_NO, KC_NO, K6C, K6D, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K75, K76, K77, K78, K79, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +// Layout with blocker + +#define LAYOUT_stt( \ + K0C, K0B, K0A, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0E, \ + K1E, K1D, K1C, K1B, K1A, K10, K11, K12, K13, K14, K15, K16, K17, K18, K59, K58, K57, \ + K2E, K2D, K2C, K2B, K2A, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K56, K55, \ + K3E, K3D, K3C, K3B, K3A, K30, K31, K32, K33, K34, K35, K36, K37, K39, K76, K75, \ + K4E, K4C, K4B, K4A, K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K78, K77, \ + K6D, K6C, K61, K64, K65, K67, K68, K69, K79 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, KC_NO, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, KC_NO, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, K4E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K55, K56, K57, K58, K59, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K61, KC_NO, KC_NO, K64, K65, KC_NO, K67, K68, K69, KC_NO, KC_NO, K6C, K6D, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K75, K76, K77, K78, K79, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ +} + +#define LAYOUT_basic( \ + K0C, K0B, K0A, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0E, \ + K1E, K1D, K1C, K1B, K1A, K10, K11, K12, K13, K14, K15, K16, K17, K18, K59, K58, K57, \ + K2E, K2D, K2C, K2B, K2A, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K56, K55, \ + K3E, K3D, K3C, K3B, K3A, K30, K31, K32, K33, K34, K35, K36, K37, K39, K76, K75, \ + K4E, K4C, K4B, K4A, K40, K41, K42, K43, K44, K45, K46, K47, K49, K77, \ + K6D, K6C, K61, K64, K65 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, KC_NO, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, KC_NO, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, KC_NO, K49, K4A, K4B, K4C, KC_NO, K4E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K55, K56, K57, K58, K59, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K61, KC_NO, KC_NO, K64, K65, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K6C, K6D, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K75, K76, K77, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ +} + +#define LAYOUT_aop( \ + K0C, K0B, K0A, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0E, \ + K1E, K1D, K1C, K1B, K1A, K10, K11, K12, K13, K14, K15, K16, K17, K18, K59, K58, K57, \ + K2E, K2D, K2C, K2B, K2A, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K56, K55, \ + K3E, K3D, K3C, K3B, K3A, K30, K31, K32, K33, K34, K35, K36, K37, K39, K76, K75, \ + K4E, K4C, K4B, K4A, K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K78, K77, \ + K6D, K6C, K61, K64, K65, K66, K67, K68, K69, K79 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, KC_NO, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, KC_NO, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, K4E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K55, K56, K57, K58, K59, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, K67, K68, K69, KC_NO, KC_NO, K6C, K6D, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K75, K76, K77, K78, K79, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ +} diff --git a/keyboards/gray_studio/hb85/info.json b/keyboards/gray_studio/hb85/info.json new file mode 100644 index 00000000000..3c7ac9c43cc --- /dev/null +++ b/keyboards/gray_studio/hb85/info.json @@ -0,0 +1,24 @@ +{ + "keyboard_name": "Gray Studio HB85", + "url": "", + "maintainer": "qmk", + "width": 18, + "height": 6.25, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":1.5, "y":0}, {"x":2.75, "y":0}, {"x":3.75, "y":0}, {"x":4.75, "y":0}, {"x":5.75, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.5, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"x":15, "y":1.25}, {"x":16, "y":1.25}, {"x":17, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15, "y":2.25}, {"x":16, "y":2.25}, {"x":17, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15, "y":3.25}, {"x":16, "y":3.25}, {"x":17, "y":3.25}, {"x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":15, "y":4.25}, {"x":16, "y":4.25}, {"x":17, "y":4.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25}, {"x":11, "y":5.25}, {"x":12, "y":5.25}, {"x":13, "y":5.25}, {"x":14, "y":5.25}, {"x":15, "y":5.25}, {"x":16, "y":5.25}] + }, + + "LAYOUT_stt": { + "layout": [{"x":1.5, "y":0}, {"x":2.75, "y":0}, {"x":3.75, "y":0}, {"x":4.75, "y":0}, {"x":5.75, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.5, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15, "y":1.25}, {"x":16, "y":1.25}, {"x":17, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15, "y":2.25}, {"x":16, "y":2.25}, {"x":17, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15, "y":3.25}, {"x":16, "y":3.25}, {"x":17, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":15, "y":4.25}, {"x":16, "y":4.25}, {"x":17, "y":4.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25, "w":1.25}, {"x":11.25, "y":5.25, "w":1.25}, {"x":13, "y":5.25}, {"x":14, "y":5.25}, {"x":15, "y":5.25}, {"x":16, "y":5.25}] + }, + + "LAYOUT_basic": { + "layout": [{"x":1.5, "y":0}, {"x":2.75, "y":0}, {"x":3.75, "y":0}, {"x":4.75, "y":0}, {"x":5.75, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.5, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15, "y":1.25}, {"x":16, "y":1.25}, {"x":17, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15, "y":2.25}, {"x":16, "y":2.25}, {"x":17, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15, "y":3.25}, {"x":16, "y":3.25}, {"x":17, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":2.75}, {"x":15, "y":4.25, "w":2}, {"x":17, "y":4.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25, "w":1.25}, {"x":11.25, "y":5.25, "w":1.25}] + }, + + "LAYOUT_aop": { + "layout": [{"x":1.5, "y":0}, {"x":2.75, "y":0}, {"x":3.75, "y":0}, {"x":4.75, "y":0}, {"x":5.75, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.5, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15, "y":1.25}, {"x":16, "y":1.25}, {"x":17, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15, "y":2.25}, {"x":16, "y":2.25}, {"x":17, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15, "y":3.25}, {"x":16, "y":3.25}, {"x":17, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":15, "y":4.25}, {"x":16, "y":4.25}, {"x":17, "y":4.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25}, {"x":11, "y":5.25}, {"x":12, "y":5.25}, {"x":13, "y":5.25}, {"x":14, "y":5.25}, {"x":15, "y":5.25}, {"x":16, "y":5.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/gray_studio/hb85/keymaps/default/keymap.c b/keyboards/gray_studio/hb85/keymaps/default/keymap.c new file mode 100644 index 00000000000..be89cbbf6a8 --- /dev/null +++ b/keyboards/gray_studio/hb85/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* +Copyright 2019 Felipe Coury + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +// Layer shorthand +enum layers { + _BASE = 0, // Base + _CTRL // Multimedia and RGB +}; + +#define KC_TGCT MO(_CTRL) // Toggles CTRL layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_all( + KC_ESC , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_TGCT, \ +KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSPC, KC_BSPC, KC_PSLS, KC_PAST, KC_PMNS, \ +KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_P7 , KC_P8 , KC_P9 , \ +KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_P4 , KC_P5 , KC_P6 , \ +KC_LSFT, KC_NO , KC_Z , KC_Z , KC_X , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_P1 , KC_P2 , KC_P3 , \ + KC_LCTL, KC_LALT, KC_SPC , KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0 , KC_PDOT \ + ), + + [_CTRL] = LAYOUT_all( + RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ +_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, \ +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/gray_studio/hb85/keymaps/stt/keymap.c b/keyboards/gray_studio/hb85/keymaps/stt/keymap.c new file mode 100644 index 00000000000..5665e2f0e1f --- /dev/null +++ b/keyboards/gray_studio/hb85/keymaps/stt/keymap.c @@ -0,0 +1,38 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_stt( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MO(1), \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0 \ + ), + + [1] = LAYOUT_stt( + RESET, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + BL_TOGG, BL_STEP, BL_INC, BL_DEC, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), +}; diff --git a/keyboards/gray_studio/hb85/readme.md b/keyboards/gray_studio/hb85/readme.md new file mode 100644 index 00000000000..c0c2fdf3710 --- /dev/null +++ b/keyboards/gray_studio/hb85/readme.md @@ -0,0 +1,48 @@ +# Gray Studio HB85 + +![Gray Studio HB85](https://i.imgur.com/Sk3cupR.jpg) + +A Sony HitBit MSX Computer inspired Keyboard. + +Keyboard Maintainer: [Felipe Coury](https://github.com/fcoury) +Hardware Supported: Gray Studio HB85 +Hardware Availability: [Group buy](https://en.zfrontier.com/products/gray-hb85) finished + +Make example for this keyboard (after setting up your build environment): + + make gray_studio/hb85:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +**Reset Key:** Hold down the key located at `K00`, commonly programmed as F3 while plugging in the keyboard. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +**Please Note:** You will need to use the `EEP_RST` keycode first, followed by unplugging/replugging the board to get RGB underglow effects to work. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/gray_studio/hb85/rules.mk b/keyboards/gray_studio/hb85/rules.mk new file mode 100644 index 00000000000..c3e17e4932d --- /dev/null +++ b/keyboards/gray_studio/hb85/rules.mk @@ -0,0 +1,48 @@ +# Copyright 2019 fcoury +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +SRC += i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/gray_studio/hb85/usbconfig.h b/keyboards/gray_studio/hb85/usbconfig.h new file mode 100644 index 00000000000..c52c90ce8a5 --- /dev/null +++ b/keyboards/gray_studio/hb85/usbconfig.h @@ -0,0 +1,393 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'G', 'r', 'a', 'y', ' ', 'S', 't', 'u', 'd', 'i', 'o' +#define USB_CFG_VENDOR_NAME_LEN 11 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'H', 'B', '8', '5' +#define USB_CFG_DEVICE_NAME_LEN 4 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect diff --git a/keyboards/gray_studio/readme.md b/keyboards/gray_studio/readme.md new file mode 100644 index 00000000000..dc1baa51630 --- /dev/null +++ b/keyboards/gray_studio/readme.md @@ -0,0 +1 @@ +# Gray Studio diff --git a/keyboards/gray_studio/space65/config.h b/keyboards/gray_studio/space65/config.h new file mode 100644 index 00000000000..979cb0a604e --- /dev/null +++ b/keyboards/gray_studio/space65/config.h @@ -0,0 +1,244 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Gray Studio +#define PRODUCT Space65 +#define DESCRIPTION 65% custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, F0, F4, F1 } +#define MATRIX_COL_PINS { B0, B3, F5, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4, D5, D3, D2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 6 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/gray_studio/space65/info.json b/keyboards/gray_studio/space65/info.json new file mode 100644 index 00000000000..9c1d439b417 --- /dev/null +++ b/keyboards/gray_studio/space65/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Gray Studio Space65", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/gray_studio/space65/keymaps/default/config.h b/keyboards/gray_studio/space65/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/gray_studio/space65/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/gray_studio/space65/keymaps/default/keymap.c b/keyboards/gray_studio/space65/keymaps/default/keymap.c new file mode 100644 index 00000000000..229a0c574bb --- /dev/null +++ b/keyboards/gray_studio/space65/keymaps/default/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), +[1] = LAYOUT( \ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_MUTE, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/gray_studio/space65/keymaps/default/readme.md b/keyboards/gray_studio/space65/keymaps/default/readme.md new file mode 100644 index 00000000000..944c1e8a0f5 --- /dev/null +++ b/keyboards/gray_studio/space65/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for space65 diff --git a/keyboards/gray_studio/space65/readme.md b/keyboards/gray_studio/space65/readme.md new file mode 100644 index 00000000000..00d289e3bb7 --- /dev/null +++ b/keyboards/gray_studio/space65/readme.md @@ -0,0 +1,15 @@ +# Gray Studio Space65 + +A 65% keyboard with RGB underglow, backlighting, and USB C. Its design was inspired by the Voyager I space probe and Apple II home computer. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Gray Studio Space65 +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=98768.0) + +**Reset Sequence:** Using this firmware sets `BOOTLOADER_ENABLE` to `lite`. While plugging in, hold the top left key, commonly programmed as `Esc` to put your board into bootloader mode. + +Make example for this keyboard (after setting up your build environment): + + make gray_studio/space65:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/gray_studio/space65/rules.mk b/keyboards/gray_studio/space65/rules.mk new file mode 100644 index 00000000000..10bd7cf0356 --- /dev/null +++ b/keyboards/gray_studio/space65/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/gray_studio/space65/space65.c b/keyboards/gray_studio/space65/space65.c new file mode 100644 index 00000000000..74a86a202d0 --- /dev/null +++ b/keyboards/gray_studio/space65/space65.c @@ -0,0 +1,49 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "space65.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + setPinOutput(E6); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + + led_set_user(usb_led); +} diff --git a/keyboards/gray_studio/space65/space65.h b/keyboards/gray_studio/space65/space65.h new file mode 100644 index 00000000000..b7d8580c06c --- /dev/null +++ b/keyboards/gray_studio/space65/space65.h @@ -0,0 +1,42 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2F, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, k3E, k3F, \ + k40, k41, k43, k45, k47, k48, k4A, k4B, k4D, k4E, k4F \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO, k2F }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, KC_NO, k3D, k3E, k3F }, \ + { k40, k41, KC_NO, k43, KC_NO, k45, KC_NO, k47, k48, KC_NO, k4A, k4B, KC_NO, k4D, k4E, k4F }, \ +} + diff --git a/keyboards/grid600/press/config.h b/keyboards/grid600/press/config.h new file mode 100644 index 00000000000..7c934570054 --- /dev/null +++ b/keyboards/grid600/press/config.h @@ -0,0 +1,78 @@ +/* +Copyright 2019 mechmerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x7539 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Grid +#define PRODUCT PRESS +#define DESCRIPTION Top module for Grid 600 + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0 } +#define MATRIX_COL_PINS { F1, F4, F5, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + + +#define RGB_DI_PIN B6 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 4 + #define RGBLIGHT_HUE_STEP 10 + #define RGBLIGHT_SAT_STEP 17 + #define RGBLIGHT_VAL_STEP 17 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ + #define RGBLIGHT_ANIMATIONS +/*== customize breathing effect ==*/ + /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ + #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 + /*==== use exp() and sin() ====*/ + #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 + #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/grid600/press/info.json b/keyboards/grid600/press/info.json new file mode 100644 index 00000000000..131b094af55 --- /dev/null +++ b/keyboards/grid600/press/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Grid 600 Type 05 PRESS Cover Module", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 1, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}] + } + } +} \ No newline at end of file diff --git a/keyboards/grid600/press/keymaps/default/config.h b/keyboards/grid600/press/keymaps/default/config.h new file mode 100644 index 00000000000..60dd02a9d0e --- /dev/null +++ b/keyboards/grid600/press/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 mechmerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/grid600/press/keymaps/default/keymap.c b/keyboards/grid600/press/keymaps/default/keymap.c new file mode 100644 index 00000000000..f253c692150 --- /dev/null +++ b/keyboards/grid600/press/keymaps/default/keymap.c @@ -0,0 +1,34 @@ +/* Copyright 2019 mechmerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_G, KC_R, KC_I, KC_D + ), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/grid600/press/keymaps/default/readme.md b/keyboards/grid600/press/keymaps/default/readme.md new file mode 100644 index 00000000000..b29ee678683 --- /dev/null +++ b/keyboards/grid600/press/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for grid diff --git a/keyboards/grid600/press/press.c b/keyboards/grid600/press/press.c new file mode 100644 index 00000000000..33935deca4a --- /dev/null +++ b/keyboards/grid600/press/press.c @@ -0,0 +1,16 @@ +/* Copyright 2019 mechmerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "press.h" \ No newline at end of file diff --git a/keyboards/grid600/press/press.h b/keyboards/grid600/press/press.h new file mode 100644 index 00000000000..ca9eac9d193 --- /dev/null +++ b/keyboards/grid600/press/press.h @@ -0,0 +1,32 @@ +/* Copyright 2019 mechmerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, K03 \ +) { \ + { K00, K01, K02, K03 } \ +} diff --git a/keyboards/grid600/press/readme.md b/keyboards/grid600/press/readme.md new file mode 100644 index 00000000000..4113b372e9f --- /dev/null +++ b/keyboards/grid600/press/readme.md @@ -0,0 +1,18 @@ +# Grid 600 Type 05 "PRESS" Cover Module + +Cover module for Grid 600 Keyboard with 4 keys. + +Code for the module was originally located at [gridishere's QMK fork](https://github.com/gridishere/qmk_firmware/tree/master/keyboards/grid/gridmod5). + +Please keep in mind that this is actually a separate keyboard from the one installed in the Grid 600. +Functionality such as layer changes and light modifications triggered on one PCB will not affect the other. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Grid 600 Type 05 "PRESS" cover module. +Hardware Availability: [zFrontier](https://en.zfrontier.com/products/grid600s) + +Make example for this keyboard (after setting up your build environment): + + make grid600/press:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/grid600/press/rules.mk b/keyboards/grid600/press/rules.mk new file mode 100644 index 00000000000..1fcf3841bec --- /dev/null +++ b/keyboards/grid600/press/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/grid600/readme.md b/keyboards/grid600/readme.md new file mode 100644 index 00000000000..f7fa6a085b1 --- /dev/null +++ b/keyboards/grid600/readme.md @@ -0,0 +1,7 @@ +# Grid 600 Cover Modules + +The Grid 600 is a tray mount 60% case supporting most standard 60% PCBs. + +A unique feature of the Grid 600 is that it has five different cover modules that not only include USB C pass through, but also have functions such as RGB or additional macro keys. + +This is a collection of some of the programmable modules available for this enclosure. \ No newline at end of file diff --git a/keyboards/gskt00/config.h b/keyboards/gskt00/config.h index f36493f2889..7e1107d31f4 100755 --- a/keyboards/gskt00/config.h +++ b/keyboards/gskt00/config.h @@ -23,17 +23,10 @@ #define DIODE_DIRECTION COL2ROW /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - diff --git a/keyboards/gskt00/info.json b/keyboards/gskt00/info.json index 88191240b9f..bfbb1fd7cd1 100644 --- a/keyboards/gskt00/info.json +++ b/keyboards/gskt00/info.json @@ -1,16 +1,84 @@ { - "keyboard_name": "gskt00", - "url": "", - "maintainer": "nachie", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT_60_ansi_tsangan": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] - }, - - "LAYOUT_60_iso_tsangan": { - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"AltGr", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] - } + "keyboard_name": "gskt00", + "url": "", + "maintainer": "nachie", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi_tsangan": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + + "LAYOUT_60_iso_tsangan": { + "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"AltGr", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + + "LAYOUT_all": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"\\", "x":13, "y":0}, + {"label":"`", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Fn", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.5}, + {"label":"GUI", "x":1.5, "y":4}, + {"label":"Alt", "x":2.5, "y":4, "w":1.5}, + {"label":"Space", "x":4, "y":4, "w":7}, + {"label":"Alt", "x":11, "y":4, "w":1.5}, + {"label":"GUI", "x":12.5, "y":4}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5} + ] } } +} diff --git a/keyboards/h87a/config.h b/keyboards/h87a/config.h deleted file mode 100644 index a98b7b2832d..00000000000 --- a/keyboards/h87a/config.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2018 Josh Hinnebusch - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER hineybush -#define PRODUCT h87a -#define DESCRIPTION QMK-programmable TKL PCB for custom keyboards - -#define CONFIG_H - -#include "config_common.h" - -/* key matrix size */ -#define MATRIX_ROWS 12 -#define MATRIX_COLS 9 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B0, B1, B2, B3, D0, D1, B5, B6, D7, B4, D6, D4 } -#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7, C6, D2 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define RGB_DI_PIN D3 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 24 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif diff --git a/keyboards/h87a/h87a.h b/keyboards/h87a/h87a.h deleted file mode 100644 index 8aa3e160e67..00000000000 --- a/keyboards/h87a/h87a.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2018 Josh Hinnebusch - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef H87A_H -#define H87A_H - -#include "quantum.h" - -// This a shortcut to help you visually see your layout. -// The following is an example using the Planck MIT layout -// The first section contains all of the arguments -// The second converts the arguments into a two-dimensional array -#define LAYOUT_all(\ - K000, K001, K011, K002, K012, K003, K013, K004, K014, K015, K006, K016, K007, K017, K008, K018, \ - K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K036, K027, K037, K028, K038, \ - K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K057, K048, K058, \ - K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K066, K076, \ - K080, K090, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K096, K088, \ - K100, K110, K101, K113, K105, K115, K106, K116, K117, K108, K118 \ -) { \ - { K000, K001, K002, K003, K004, KC_NO, K006, K007, K008 }, \ - { KC_NO, K011, K012, K013, K014, K015, K016, K017, K018 }, \ - { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ - { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ - { K040, K041, K042, K043, K044, K045, K046, KC_NO, K048 }, \ - { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ - { K060, K061, K062, K063, K064, K065, K066, KC_NO, KC_NO }, \ - { K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \ - { K080, K081, K082, K083, K084, K085, K086, KC_NO, K088 }, \ - { K090, K091, K092, K093, K094, K095, K096, KC_NO, KC_NO }, \ - { K100, K101, KC_NO, KC_NO, KC_NO, K105, K106, KC_NO, K108 }, \ - { K110, KC_NO, KC_NO, K113, KC_NO, K115, K116, K117, K118 } \ -} - -#endif diff --git a/keyboards/h87a/info.json b/keyboards/h87a/info.json deleted file mode 100644 index cf3e81dd3a4..00000000000 --- a/keyboards/h87a/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "h87a", - "url": "", - "maintainer": "hineybush", - "width": 18.25, - "height": 6.5, - "layouts": { - "LAYOUT_all": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"x":13, "y":1.5}, {"x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] - } - } -} \ No newline at end of file diff --git a/keyboards/h87a/keymaps/default/keymap.c b/keyboards/h87a/keymaps/default/keymap.c deleted file mode 100644 index 20418604ce5..00000000000 --- a/keyboards/h87a/keymaps/default/keymap.c +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright 2018 Josh Hinnebusch - - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_all( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_TRNS, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - - [1] = LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_init_ports(void) { - DDRD |= (1<<5); // OUT - DDRE |= (1<<6); // OUT -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRD |= (1 << 5); PORTD &= ~(1 << 5); - } else { - DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRE |= (1 << 6); PORTE &= ~(1 << 6); - } else { - DDRE &= ~(1 << 6); PORTE &= ~(1 << 6); - } - -} diff --git a/keyboards/h87a/readme.md b/keyboards/h87a/readme.md deleted file mode 100644 index d7185db522c..00000000000 --- a/keyboards/h87a/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -h87a -=== - -A QMK-powered replacement PCB for custom TKL keyboards. This PCB has the same size of the b.87 PCB, while using the USB port placement and spacebar stabilizer orientation as the a.87 PCB. - -Keyboard Maintainer: hineybush (Josh Hinnebusch) - -Hardware Supported: h87a Rev 1 - -Hardware Availability: Currently prototyped, group buy TBD - -Make example for this keyboard (after setting up your build environment): - - make h87a:default - -## h87a hardware information - -Controller: Atmega32u4 - - /* Column pin configuration - * col: 0 1 2 3 4 5 6 7 8 - * pin: F0 F1 F4 F5 F6 F7 C7 C6 D2 - */ - - /* Row pin configuration - * row: 0 1 2 3 4 5 6 7 8 9 10 11 - * pin: B0 B1 B2 B3 D0 D1 B5 B6 D7 B4 D6 D4 (Rev 1) - */ - -The H87a PCB utilizes duplex matrix organization. - - Caps Lock LED: D5 - Scroll Lock LED: E6 - Num Lock LED: not supported - Backlight Pin: B7 - RGB Data Pin: D3 - -To connect the Caps Lock LED to the main backlight matrix, jump the middle pad and the left pad on J1. To use the Caps Lock LED as an indicator, jump the middle pad and the right pad on J1. - -To connect the Scroll Lock LED to the main backlight matrix, jump the middle pad and the right pad on J2. To use the Scroll Lock LED as an indicator, jump the middle pad and the left pad on J2. - -Note: The different orientations of J1 and J2 will be fixed with Rev 2. diff --git a/keyboards/h87a/rules.mk b/keyboards/h87a/rules.mk deleted file mode 100644 index dac21d72c84..00000000000 --- a/keyboards/h87a/rules.mk +++ /dev/null @@ -1,70 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE = yes # Enable RGB underglow -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -EXTRAFLAGS += -flto \ No newline at end of file diff --git a/keyboards/hadron/config.h b/keyboards/hadron/config.h index 9111ad72796..3fc76b0b3b4 100644 --- a/keyboards/hadron/config.h +++ b/keyboards/hadron/config.h @@ -20,14 +20,11 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 +#define VENDOR_ID 0xFB30 +#define PRODUCT_ID 0x5F37 #define MANUFACTURER ishtob #define PRODUCT Hadron Keyboard -#define DESCRIPTION A cherry ML ortholinear keyboard - - - +#define DESCRIPTION A low profile ortholinear keyboard //#define AUDIO_VOICES @@ -43,17 +40,12 @@ along with this program. If not, see . //#define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE +//#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +//#define LOCKING_RESYNC_ENABLE /* * Feature disable options @@ -70,7 +62,5 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION - - +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/hadron/hadron.c b/keyboards/hadron/hadron.c index ca5b20e894b..fa5065b327e 100644 --- a/keyboards/hadron/hadron.c +++ b/keyboards/hadron/hadron.c @@ -1,26 +1,2 @@ #include "hadron.h" - -void matrix_init_kb(void) { - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} \ No newline at end of file diff --git a/keyboards/hadron/hadron.h b/keyboards/hadron/hadron.h index a165f4c5c92..426face6f4e 100644 --- a/keyboards/hadron/hadron.h +++ b/keyboards/hadron/hadron.h @@ -7,7 +7,9 @@ #ifdef SUBPROJECT_ver2 #include "ver2.h" #endif - +#ifdef SUBPROJECT_ver3 + #include "ver3.h" +#endif #include "quantum.h" diff --git a/keyboards/hadron/keymaps/default/config.h b/keyboards/hadron/keymaps/default/config.h deleted file mode 100644 index 09922b61bcf..00000000000 --- a/keyboards/hadron/keymaps/default/config.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define LEADER_TIMEOUT 300 -//#define BACKLIGHT_BREATHING - -#define USE_I2C -#define SSD1306OLED -#define OLED_ROTATE180 - -/* ws2812 RGB LED*/ -#define RGB_DI_PIN D4 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 14 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 - -#endif diff --git a/keyboards/hadron/keymaps/default/keymap.c b/keyboards/hadron/keymaps/default/keymap.c deleted file mode 100644 index de5979c1d2b..00000000000 --- a/keyboards/hadron/keymaps/default/keymap.c +++ /dev/null @@ -1,493 +0,0 @@ -#include QMK_KEYBOARD_H -#include "LUFA/Drivers/Peripheral/TWI.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef USE_I2C -#include "i2c.h" -#endif -#ifdef SSD1306OLED -#include "ssd1306.h" -#endif -extern keymap_config_t keymap_config; - -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _MOUSECURSOR 8 -#define _ADJUST 16 - -enum preonic_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - BACKLIT, - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, -}; - -enum macro_keycodes { - KC_DEMOMACRO, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl -#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -// Requires KC_TRNS/_______ for the trigger key in the destination layer -#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor -#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise -#define DEMOMACRO M(KC_DEMOMACRO) // Sample for macros - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Tab | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | CAPS | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ;/Nav| ' | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / |Ctl/Et| - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | - * `--------------------------------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_H, KC_J, KC_K, KC_L,LT_MC(KC_SCLN), KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, CTL_ENT, \ - KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT,KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Colemak - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Tab | Q | W | F | P | G | 7 | 8 | 9 | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | CAPS | A | R | S | T | D | 4 | 5 | 6 | H | N | E | I | O | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | 1 | 2 | 3 | K | M | , | . | / |Ctl/Et| - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | - * `--------------------------------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_P7, KC_P8, KC_P9, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_LCTRL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_P4, KC_P5, KC_P6, KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O), KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, CTL_ENT, \ - KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - -/* Dvorak - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Tab | " | , | . | P | Y | 7 | 8 | 9 | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | Esc | A | O | E | U | I | 4 | 5 | 6 | D | H | T | N | S | / | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | 1 | 2 | 3 | B | M | W | V | Z |Ctl/Et| - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | - * `--------------------------------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_P7, KC_P8, KC_P9, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_P4, KC_P5, KC_P6, KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S), KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_P1, KC_P2, KC_P3, KC_B, KC_M, KC_W, KC_V, KC_Z, CTL_ENT, \ - KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,------+------+------+------+------+------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | - * `--------------------------------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO # |ISO / | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | - * `--------------------------------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Mouse Layer (semi-col) - * ,------+------+------+------+------+------------------------------------------------. - * | ACCL0| ACCL1| ACCL2| | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | | | | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| Macro| | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | BTN1 | | | | BTN1 | | | | | | - * `--------------------------------------------------------------------------------------------------------' - */ - -[_MOUSECURSOR] = LAYOUT( - KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R,DEMOMACRO,_______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, \ - _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______ \ -), - -/* Adjust (Lower + Raise) - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | | | | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm| | | |AGswap|Qwerty|Colemk| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | BL + |BL ST |BL TG | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\ -) - - - -}; - - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -// define variables for reactive RGB -bool RGB_INIT = false; -bool TOG_STATUS = false; -int RGB_current_mode; - - - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { - if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { - rgblight_mode(RGB_current_mode); - layer_on(layer3); - } else { - layer_off(layer3); - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistant_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(16); - } - layer_on(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - TOG_STATUS = false; - layer_off(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(15); - } - layer_on(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - layer_off(_RAISE); - TOG_STATUS = false; - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - case RGB_MOD: - //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released - if (record->event.pressed) { - rgblight_mode(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - return false; - break; - } - return true; -} - -void matrix_init_user(void) { - #ifdef USE_I2C - i2c_master_init(); - #ifdef SSD1306OLED - // calls code for the SSD1306 OLED - _delay_ms(400); - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - iota_gfx_init(); // turns on the display - #endif - #endif - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -void matrix_scan_user(void) { - #ifdef SSD1306OLED - iota_gfx_task(); // this is what updates the display continuously - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); -} - -void shutdown_user() -{cc - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_SONG(music_scale); -} - -#endif - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - - switch (id) { - case KC_DEMOMACRO: - if (record->event.pressed){ - return MACRO (I(1), T(H),T(E),T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); - } - } - - return MACRO_NONE; -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -//assign the right code to your layers for OLED display -#define L_BASE 0 -#define L_LOWER 8 -#define L_RAISE 16 -#define L_FNLAYER 64 -#define L_NUMLAY 128 -#define L_NLOWER 136 -#define L_NFNLAYER 192 -#define L_MOUSECURSOR 256 -#define L_ADJUST 65560 - -void iota_gfx_task_user(void) { -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif - - struct CharacterMatrix matrix; - - matrix_clear(&matrix); - matrix_write_P(&matrix, PSTR("USB: ")); -#ifdef PROTOCOL_LUFA - switch (USB_DeviceState) { - case DEVICE_STATE_Unattached: - matrix_write_P(&matrix, PSTR("Unattached")); - break; - case DEVICE_STATE_Suspended: - matrix_write_P(&matrix, PSTR("Suspended")); - break; - case DEVICE_STATE_Configured: - matrix_write_P(&matrix, PSTR("Connected")); - break; - case DEVICE_STATE_Powered: - matrix_write_P(&matrix, PSTR("Powered")); - break; - case DEVICE_STATE_Default: - matrix_write_P(&matrix, PSTR("Default")); - break; - case DEVICE_STATE_Addressed: - matrix_write_P(&matrix, PSTR("Addressed")); - break; - default: - matrix_write_P(&matrix, PSTR("Invalid")); - } -#endif - -// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - - char buf[40]; - snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); - matrix_write_P(&matrix, PSTR("\n\nLayer: ")); - switch (layer_state) { - case L_BASE: - matrix_write_P(&matrix, PSTR("Default")); - break; - case L_RAISE: - matrix_write_P(&matrix, PSTR("Raise")); - break; - case L_LOWER: - matrix_write_P(&matrix, PSTR("Lower")); - break; - case L_ADJUST: - matrix_write_P(&matrix, PSTR("ADJUST")); - break; - default: - matrix_write(&matrix, buf); - } - - // Host Keyboard LED Status - char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1<sort lines), and use this format: - - * **folder_name** description - -# List of Planck keymaps - -* **default** default Planck layout -* **cbbrowne** cbbrowne's Planck layout \ No newline at end of file diff --git a/keyboards/hadron/keymaps/side_numpad/config.h b/keyboards/hadron/keymaps/side_numpad/config.h deleted file mode 100644 index 09922b61bcf..00000000000 --- a/keyboards/hadron/keymaps/side_numpad/config.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define LEADER_TIMEOUT 300 -//#define BACKLIGHT_BREATHING - -#define USE_I2C -#define SSD1306OLED -#define OLED_ROTATE180 - -/* ws2812 RGB LED*/ -#define RGB_DI_PIN D4 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 14 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 - -#endif diff --git a/keyboards/hadron/keymaps/side_numpad/keymap.c b/keyboards/hadron/keymaps/side_numpad/keymap.c deleted file mode 100644 index fa42c79ea04..00000000000 --- a/keyboards/hadron/keymaps/side_numpad/keymap.c +++ /dev/null @@ -1,502 +0,0 @@ -#include QMK_KEYBOARD_H -#include "LUFA/Drivers/Peripheral/TWI.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef USE_I2C -#include "i2c.h" -#endif -#ifdef SSD1306OLED -#include "ssd1306.h" -#endif -extern keymap_config_t keymap_config; - -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _LOWER 3 -#define _RAISE 4 -#define _FNLAYER 6 -#define _NUMLAY 7 -#define _MOUSECURSOR 8 -#define _ADJUST 16 - -enum preonic_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - BACKLIT, - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, -}; - -enum macro_keycodes { - KC_DEMOMACRO, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl -#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -// Requires KC_TRNS/_______ for the trigger key in the destination layer -#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer -#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor -#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise -#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY -#define DEMOMACRO M(KC_DEMOMACRO) // My login macros - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | 7 | 8 | 9 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | CAPS | A | S | D | F | G | H | J | K | L | ; |Enter | 4 | 5 | 6 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / | = | 1 | 2 | 3 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ~ | Ctrl | Alt | GUI |Lower |Space |Space |Raise | RAlt | Ins | Del |NumLay| 0 | . | ENT | - * `--------------------------------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,\ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_P7, KC_P8, KC_P9, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT_MC(KC_SCLN), CTL_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_EQL, KC_P1, KC_P2, KC_P3, \ - KC_GRV, KC_RCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, KC_INS, KC_DEL, TG_NUMLAY, KC_P0, KC_PDOT, KC_PENT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | CAPS | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | [ | ] | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Next | Vol- | Vol+ | Play | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT( - KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_BSLS, _______, _______, _______, \ - KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, _______, _______, _______, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_LCBR, KC_RCBR, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______\ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | | A | Up | D | PrSc | | 4 | 5 | 6 | * | : | ' | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | Lt | Dn | Rt | Mute | | 1 | 2 | 3 | Up | / | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | |Space | 0 | | Left | Down | Right| | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS, KC_BSLS, _______, _______, _______, \ - _______, KC_A, KC_UP, KC_D, KC_PSCR, _______, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, _______, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC__MUTE, _______, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______ \ -), - -/* FN layer on Esc key - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | [ | ] | ' | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | { | } | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Next | Vol- | Vol+ | Play | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_FNLAYER] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, _______, _______, _______, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, _______, _______, _______, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS), S(KC_NUBS), KC_LCBR, KC_RCBR, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______ \ -), - -/* Num Layer - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | | | | | | | | | | | | | F7 | F8 | F9 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | F4 | F5 | F6 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | Up | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | Exit | Left | Down | Rght | - * `--------------------------------------------------------------------------------------------------------' - */ -[_NUMLAY] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_END, KC_PGDN, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PMNS, KC_UP, KC_PPLS, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT \ -), - -/* Mouse Layer (semi-col) - * ,-----------------------------------------------------------------------------------. - * | |ACCL0| ACCL1| ACCL2 | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | BTN1 | | | | BTN1 | | | | | | - * `--------------------------------------------------------------------------------------------------------' - */ - -[_MOUSECURSOR] = LAYOUT( - _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, DEMOMACRO, _______, _______, _______, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, _______, _______, _______ \ -), - -/* Adjust (Lower + Raise) - - * ,-----------------------------------------------------------------------------------. - * | Reset| | | | | | | | | VolD | VolU | Mute | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | |RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | Del | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | BL + |BL ST |BLSTEP| BL TG| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT( - RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLD, KC_VOLU, KC_MUTE, \ - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_DEL, _______, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, _______, _______, _______, \ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - - -}; - - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -// define variables for reactive RGB -bool RGB_INIT = false; -bool TOG_STATUS = false; -bool NUMLAY_STATUS = false; -int RGB_current_mode; - - - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { - if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { - rgblight_mode(RGB_current_mode); - layer_on(layer3); - } else { - layer_off(layer3); - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(16); - } - layer_on(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - TOG_STATUS = false; - layer_off(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(15); - } - layer_on(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - layer_off(_RAISE); - TOG_STATUS = false; - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - //my attempt for RGB layer lock indication via changing the mode, still have to figure out how to not have other keypress not override this mode - case TG_NUMLAY: - if (record->event.pressed) { - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - NUMLAY_STATUS = !NUMLAY_STATUS; - if (NUMLAY_STATUS) { - rgblight_mode(4); - layer_on(_NUMLAY); - } else { - rgblight_mode(RGB_current_mode); - layer_off(_NUMLAY); } - } - return false; - break; - case RGB_MOD: - //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released - if (record->event.pressed) { - rgblight_mode(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - return false; - break; - } - return true; -} - -void matrix_init_user(void) { - #ifdef USE_I2C - i2c_master_init(); - #ifdef SSD1306OLED - // calls code for the SSD1306 OLED - _delay_ms(400); - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - iota_gfx_init(); // turns on the display - #endif - #endif - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -void matrix_scan_user(void) { - #ifdef SSD1306OLED - iota_gfx_task(); // this is what updates the display continuously - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); -} - -void shutdown_user() -{cc - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_SONG(music_scale); -} - -#endif - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - - switch (id) { - case KC_DEMOMACRO: - if (record->event.pressed){ - return MACRO (I(1), T(H),T(E),T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); - } - } - - return MACRO_NONE; -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -//assign the right code to your layers for OLED display -#define L_BASE 0 -#define L_LOWER 8 -#define L_RAISE 16 -#define L_FNLAYER 64 -#define L_NUMLAY 128 -#define L_NLOWER 136 -#define L_NFNLAYER 192 -#define L_MOUSECURSOR 256 -#define L_ADJUST 65560 - -void iota_gfx_task_user(void) { -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif - - struct CharacterMatrix matrix; - - matrix_clear(&matrix); - matrix_write_P(&matrix, PSTR("USB: ")); -#ifdef PROTOCOL_LUFA - switch (USB_DeviceState) { - case DEVICE_STATE_Unattached: - matrix_write_P(&matrix, PSTR("Unattached")); - break; - case DEVICE_STATE_Suspended: - matrix_write_P(&matrix, PSTR("Suspended")); - break; - case DEVICE_STATE_Configured: - matrix_write_P(&matrix, PSTR("Connected")); - break; - case DEVICE_STATE_Powered: - matrix_write_P(&matrix, PSTR("Powered")); - break; - case DEVICE_STATE_Default: - matrix_write_P(&matrix, PSTR("Default")); - break; - case DEVICE_STATE_Addressed: - matrix_write_P(&matrix, PSTR("Addressed")); - break; - default: - matrix_write_P(&matrix, PSTR("Invalid")); - } -#endif - -// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - - char buf[40]; - snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); - matrix_write_P(&matrix, PSTR("\n\nLayer: ")); - switch (layer_state) { - case L_BASE: - matrix_write_P(&matrix, PSTR("Default")); - break; - case L_RAISE: - matrix_write_P(&matrix, PSTR("Raise")); - break; - case L_LOWER: - matrix_write_P(&matrix, PSTR("Lower")); - break; - case L_ADJUST: - matrix_write_P(&matrix, PSTR("ADJUST")); - break; - default: - matrix_write(&matrix, buf); - } - - // Host Keyboard LED Status - char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#pragma once - -/* USB Device descriptor parameter */ -#define DEVICE_VER 0x0001 - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* Hadron Ver0 PCB default pin-out */ -#define MATRIX_ROW_PINS { D7, E6, B4, B5, B6 } -#define MATRIX_COL_PINS { F6, F7, C6, C7, F5, F4, F1, F0, D2, D3, D5, B3, B2, B1, B0 } -#define UNUSED_PINS - - - diff --git a/keyboards/hadron/ver0/rules.mk b/keyboards/hadron/ver0/rules.mk deleted file mode 100644 index a3952a5d338..00000000000 --- a/keyboards/hadron/ver0/rules.mk +++ /dev/null @@ -1 +0,0 @@ -#AUDIO_ENABLE ?= yes # Audio output on port C6 \ No newline at end of file diff --git a/keyboards/hadron/ver0/ver0.c b/keyboards/hadron/ver0/ver0.c deleted file mode 100644 index acb3a9105f7..00000000000 --- a/keyboards/hadron/ver0/ver0.c +++ /dev/null @@ -1 +0,0 @@ -#include "ver0.h" \ No newline at end of file diff --git a/keyboards/hadron/ver0/ver0.h b/keyboards/hadron/ver0/ver0.h deleted file mode 100644 index 5710af322e8..00000000000 --- a/keyboards/hadron/ver0/ver0.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef VER0_H -#define VER0_H - -#include "../hadron.h" - -#endif \ No newline at end of file diff --git a/keyboards/hadron/ver2/config.h b/keyboards/hadron/ver2/config.h index 5ee3f931ff7..e051db209cb 100644 --- a/keyboards/hadron/ver2/config.h +++ b/keyboards/hadron/ver2/config.h @@ -29,4 +29,15 @@ along with this program. If not, see . #define UNUSED_PINS +#define USE_I2C +#define SSD1306OLED +#define OLED_ROTATE180 + +/* ws2812 RGB LED*/ +#define RGB_DI_PIN D4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + diff --git a/keyboards/hadron/ver2/keymaps/default/config.h b/keyboards/hadron/ver2/keymaps/default/config.h new file mode 100644 index 00000000000..e1fdd6dd3e6 --- /dev/null +++ b/keyboards/hadron/ver2/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND) \ + } + +#define LEADER_TIMEOUT 300 +//#define BACKLIGHT_BREATHING + diff --git a/keyboards/hadron/ver2/keymaps/default/keymap.c b/keyboards/hadron/ver2/keymaps/default/keymap.c new file mode 100644 index 00000000000..41802d38c41 --- /dev/null +++ b/keyboards/hadron/ver2/keymaps/default/keymap.c @@ -0,0 +1,422 @@ +#include QMK_KEYBOARD_H +#ifdef USE_I2C +#include "i2c.h" +#endif +#ifdef SSD1306OLED +#include "ssd1306.h" +#endif +extern keymap_config_t keymap_config; + +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MOUSECURSOR 8 +#define _ADJUST 16 + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, + DEMOMACRO +}; + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl +#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ;/Nav| ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_H, KC_J, KC_K, KC_L,LT_MC(KC_SCLN), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT,KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | F | P | G | 7 | 8 | 9 | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | CAPS | A | R | S | T | D | 4 | 5 | 6 | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | K | M | , | . | / |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_P7, KC_P8, KC_P9, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTRL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_P4, KC_P5, KC_P6, KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + +/* Dvorak + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | " | , | . | P | Y | 7 | 8 | 9 | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | 4 | 5 | 6 | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | 1 | 2 | 3 | B | M | W | V | Z |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_P7, KC_P8, KC_P9, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_P4, KC_P5, KC_P6, KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S), KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_P1, KC_P2, KC_P3, KC_B, KC_M, KC_W, KC_V, KC_Z, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,------+------+------+------+------+------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Mouse Layer (semi-col) + * ,------+------+------+------+------+------------------------------------------------. + * | ACCL0| ACCL1| ACCL2| | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| Macro| | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | BTN1 | | | | BTN1 | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = LAYOUT( + KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R,DEMOMACRO,_______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, \ + _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | | | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm| | | |AGswap|Qwerty|Colemk| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | BL + |BL ST |BL TG | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\ +) + + + +}; + +// define variables for reactive RGB +bool RGB_INIT = false; +bool TOG_STATUS = false; +int RGB_current_mode; + +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + rgblight_mode(RGB_current_mode); + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(16); + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(15); + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case RGB_MOD: + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + return false; + break; + case DEMOMACRO: + if (record->event.pressed) { + SEND_STRING("hello world"); + } + return false; + break; + } + return true; +} + +//Functions for ver2 +#ifdef KEYBOARD_hadron_ver2 +#include "LUFA/Drivers/Peripheral/TWI.h" +void matrix_init_user(void) { + #ifdef USE_I2C + i2c_master_init(); + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(); // turns on the display + #endif + #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + + +void matrix_scan_user(void) { + #ifdef SSD1306OLED + iota_gfx_task(); // this is what updates the display continuously + #endif +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER 8 +#define L_RAISE 16 +#define L_FNLAYER 64 +#define L_NUMLAY 128 +#define L_NLOWER 136 +#define L_NFNLAYER 192 +#define L_MOUSECURSOR 256 +#define L_ADJUST 65560 + +void iota_gfx_task_user(void) { +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +#endif + + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + matrix_write_P(&matrix, PSTR("USB: ")); +#ifdef PROTOCOL_LUFA + switch (USB_DeviceState) { + case DEVICE_STATE_Unattached: + matrix_write_P(&matrix, PSTR("Unattached")); + break; + case DEVICE_STATE_Suspended: + matrix_write_P(&matrix, PSTR("Suspended")); + break; + case DEVICE_STATE_Configured: + matrix_write_P(&matrix, PSTR("Connected")); + break; + case DEVICE_STATE_Powered: + matrix_write_P(&matrix, PSTR("Powered")); + break; + case DEVICE_STATE_Default: + matrix_write_P(&matrix, PSTR("Default")); + break; + case DEVICE_STATE_Addressed: + matrix_write_P(&matrix, PSTR("Addressed")); + break; + default: + matrix_write_P(&matrix, PSTR("Invalid")); + } +#endif + +// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(&matrix, PSTR("\n\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(&matrix, PSTR("Default")); + break; + case L_RAISE: + matrix_write_P(&matrix, PSTR("Raise")); + break; + case L_LOWER: + matrix_write_P(&matrix, PSTR("Lower")); + break; + case L_ADJUST: + matrix_write_P(&matrix, PSTR("ADJUST")); + break; + default: + matrix_write(&matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1<sort lines), and use this format: + + * **folder_name** description + +# List of Planck keymaps + +* **default** default Planck layout diff --git a/keyboards/hadron/ver2/keymaps/side_numpad/config.h b/keyboards/hadron/ver2/keymaps/side_numpad/config.h new file mode 100644 index 00000000000..409279a95ff --- /dev/null +++ b/keyboards/hadron/ver2/keymaps/side_numpad/config.h @@ -0,0 +1,8 @@ +#pragma once + +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND)\ + } + +#define LEADER_TIMEOUT 300 +//#define BACKLIGHT_BREATHING + diff --git a/keyboards/hadron/ver2/keymaps/side_numpad/keymap.c b/keyboards/hadron/ver2/keymaps/side_numpad/keymap.c new file mode 100644 index 00000000000..0e5ab74533f --- /dev/null +++ b/keyboards/hadron/ver2/keymaps/side_numpad/keymap.c @@ -0,0 +1,481 @@ +#include QMK_KEYBOARD_H +#include "LUFA/Drivers/Peripheral/TWI.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef USE_I2C +#include "i2c.h" +#endif +#ifdef SSD1306OLED +#include "ssd1306.h" +#endif +extern keymap_config_t keymap_config; + +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 3 +#define _RAISE 4 +#define _FNLAYER 6 +#define _NUMLAY 7 +#define _MOUSECURSOR 8 +#define _ADJUST 16 + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +enum macro_keycodes { + KC_DEMOMACRO, +}; + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl +#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise +#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY +#define DEMOMACRO M(KC_DEMOMACRO) // My login macros + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | 7 | 8 | 9 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | A | S | D | F | G | H | J | K | L | ; |Enter | 4 | 5 | 6 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | = | 1 | 2 | 3 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | Ctrl | Alt | GUI |Lower |Space |Space |Raise | RAlt | Ins | Del |NumLay| 0 | . | ENT | + * `--------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_P7, KC_P8, KC_P9, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT_MC(KC_SCLN), CTL_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_EQL, KC_P1, KC_P2, KC_P3, \ + KC_GRV, KC_RCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, KC_INS, KC_DEL, TG_NUMLAY, KC_P0, KC_PDOT, KC_PENT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | CAPS | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | [ | ] | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( + KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_BSLS, _______, _______, _______, \ + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, _______, _______, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_LCBR, KC_RCBR, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______\ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | | A | Up | D | PrSc | | 4 | 5 | 6 | * | : | ' | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | Lt | Dn | Rt | Mute | | 1 | 2 | 3 | Up | / | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | |Space | 0 | | Left | Down | Right| | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS, KC_BSLS, _______, _______, _______, \ + _______, KC_A, KC_UP, KC_D, KC_PSCR, _______, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC__MUTE, _______, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______ \ +), + +/* FN layer on Esc key + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | [ | ] | ' | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | { | } | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_FNLAYER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, _______, _______, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, _______, _______, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS), S(KC_NUBS), KC_LCBR, KC_RCBR, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______ \ +), + +/* Num Layer + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | | | | | | | | F7 | F8 | F9 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | F4 | F5 | F6 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | Up | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Exit | Left | Down | Rght | + * `--------------------------------------------------------------------------------------------------------' + */ +[_NUMLAY] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_END, KC_PGDN, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PMNS, KC_UP, KC_PPLS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT \ +), + +/* Mouse Layer (semi-col) + * ,-----------------------------------------------------------------------------------. + * | |ACCL0| ACCL1| ACCL2 | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | BTN1 | | | | BTN1 | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = LAYOUT( + _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, DEMOMACRO, _______, _______, _______, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + + * ,-----------------------------------------------------------------------------------. + * | Reset| | | | | | | | | VolD | VolU | Mute | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | |RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | Del | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | BL + |BL ST |BLSTEP| BL TG| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( + RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLD, KC_VOLU, KC_MUTE, \ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_DEL, _______, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + + +}; + +// define variables for reactive RGB +bool RGB_INIT = false; +bool TOG_STATUS = false; +bool NUMLAY_STATUS = false; +int RGB_current_mode; + + +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + rgblight_mode(RGB_current_mode); + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(16); + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(15); + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + //my attempt for RGB layer lock indication via changing the mode, still have to figure out how to not have other keypress not override this mode + case TG_NUMLAY: + if (record->event.pressed) { + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + NUMLAY_STATUS = !NUMLAY_STATUS; + if (NUMLAY_STATUS) { + rgblight_mode(4); + layer_on(_NUMLAY); + } else { + rgblight_mode(RGB_current_mode); + layer_off(_NUMLAY); } + } + return false; + break; + case RGB_MOD: + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef USE_I2C + i2c_master_init(); + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(); // turns on the display + #endif + #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +void matrix_scan_user(void) { + #ifdef SSD1306OLED + iota_gfx_task(); // this is what updates the display continuously + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user() +{cc + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + switch (id) { + case KC_DEMOMACRO: + if (record->event.pressed){ + return MACRO (I(1), T(H),T(E),T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); + } + } + + return MACRO_NONE; +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER 8 +#define L_RAISE 16 +#define L_FNLAYER 64 +#define L_NUMLAY 128 +#define L_NLOWER 136 +#define L_NFNLAYER 192 +#define L_MOUSECURSOR 256 +#define L_ADJUST 65560 + +void iota_gfx_task_user(void) { +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +#endif + + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + matrix_write_P(&matrix, PSTR("USB: ")); +#ifdef PROTOCOL_LUFA + switch (USB_DeviceState) { + case DEVICE_STATE_Unattached: + matrix_write_P(&matrix, PSTR("Unattached")); + break; + case DEVICE_STATE_Suspended: + matrix_write_P(&matrix, PSTR("Suspended")); + break; + case DEVICE_STATE_Configured: + matrix_write_P(&matrix, PSTR("Connected")); + break; + case DEVICE_STATE_Powered: + matrix_write_P(&matrix, PSTR("Powered")); + break; + case DEVICE_STATE_Default: + matrix_write_P(&matrix, PSTR("Default")); + break; + case DEVICE_STATE_Addressed: + matrix_write_P(&matrix, PSTR("Addressed")); + break; + default: + matrix_write_P(&matrix, PSTR("Invalid")); + } +#endif + +// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(&matrix, PSTR("\n\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(&matrix, PSTR("Default")); + break; + case L_RAISE: + matrix_write_P(&matrix, PSTR("Raise")); + break; + case L_LOWER: + matrix_write_P(&matrix, PSTR("Lower")); + break; + case L_ADJUST: + matrix_write_P(&matrix, PSTR("ADJUST")); + break; + default: + matrix_write(&matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef REV3_CONFIG_H +#define REV3_CONFIG_H + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x0003 + +#undef MATRIX_ROWS +#undef MATRIX_COLS +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS + +#define MATRIX_ROW_PINS { C15, C14, A10, A9, A8 } +#define MATRIX_COL_PINS { B8, B2, B10, A0, A1, A2, B0, A3, B1, A6, A7, B12, C13, B11, B9 } +#define UNUSED_PINS + +#define ENCODERS_PAD_A { B13 } +#define ENCODERS_PAD_B { B14 } + + +//Audio +#undef AUDIO_VOICES +#undef C6_AUDIO + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#define AUDIO_CLICKY + /* to enable clicky on startup */ + //#define AUDIO_CLICKY_ON +#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f +#endif + +//configure qwiic micro_oled driver for the 128x32 oled +#ifdef QWIIC_MICRO_OLED_ENABLE + +#undef I2C_ADDRESS_SA0_1 +#define I2C_ADDRESS_SA0_1 0b0111100 +#define LCDWIDTH 128 +#define LCDHEIGHT 32 +#define micro_oled_rotate_180 + +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +// #define DEBOUNCE 6 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +/* Haptic Driver initialization settings + * Feedback Control Settings */ +#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ +#define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ + +/* default 3V ERM vibration motor voltage and library*/ +#if FB_ERM_LRA == 0 +#define RATED_VOLTAGE 3 +#define V_RMS 2.3 +#define V_PEAK 3.30 +/* Library Selection */ +#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ + +/* default 2V LRA voltage and library */ +#elif FB_ERM_LRA == 1 +#define RATED_VOLTAGE 2 +#define V_RMS 2.0 +#define V_PEAK 2.85 +#define F_LRA 200 +/* Library Selection */ +#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ + +#endif + +/* Control 1 register settings */ +#define DRIVE_TIME 25 +#define AC_COUPLE 0 +#define STARTUP_BOOST 1 + +/* Control 2 Settings */ +#define BIDIR_INPUT 1 +#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ +#define SAMPLE_TIME 3 +#define BLANKING_TIME 1 +#define IDISS_TIME 1 + +/* Control 3 settings */ +#define NG_THRESH 2 +#define ERM_OPEN_LOOP 1 +#define SUPPLY_COMP_DIS 0 +#define DATA_FORMAT_RTO 0 +#define LRA_DRIVE_MODE 0 +#define N_PWM_ANALOG 0 +#define LRA_OPEN_LOOP 0 +/* Control 4 settings */ +#define ZC_DET_TIME 0 +#define AUTO_CAL_TIME 3 + +#define RGBLIGHT_ANIMATIONS + +#define RGBLED_NUM 10 +#define RGB_DI_PIN B5 +#define DRIVER_LED_TOTAL RGBLED_NUM + +// #define RGB_MATRIX_KEYPRESSES + +#define SOLENOID_PIN A14 + +#endif diff --git a/keyboards/hadron/ver3/halconf.h b/keyboards/hadron/ver3/halconf.h new file mode 100644 index 00000000000..a14ace02b4b --- /dev/null +++ b/keyboards/hadron/ver3/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/config.h b/keyboards/hadron/ver3/keymaps/default/config.h similarity index 100% rename from keyboards/niu_mini/keymaps/spacebarracecar/config.h rename to keyboards/hadron/ver3/keymaps/default/config.h diff --git a/keyboards/hadron/ver3/keymaps/default/keymap.c b/keyboards/hadron/ver3/keymaps/default/keymap.c new file mode 100644 index 00000000000..749c385c85e --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/default/keymap.c @@ -0,0 +1,270 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MOUSECURSOR 8 +#define _ADJUST 16 + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, + DEMOMACRO +}; + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl +#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ;/Nav| ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_H, KC_J, KC_K, KC_L,LT_MC(KC_SCLN), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT,KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | F | P | G | 7 | 8 | 9 | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | CAPS | A | R | S | T | D | 4 | 5 | 6 | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | K | M | , | . | / |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_P7, KC_P8, KC_P9, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTRL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_P4, KC_P5, KC_P6, KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, CTL_ENT, \ + KC_GRV, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + +/* Dvorak + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | " | , | . | P | Y | 7 | 8 | 9 | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | 4 | 5 | 6 | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | 1 | 2 | 3 | B | M | W | V | Z |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_P7, KC_P8, KC_P9, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_P4, KC_P5, KC_P6, KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S), KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_P1, KC_P2, KC_P3, KC_B, KC_M, KC_W, KC_V, KC_Z, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,------+------+------+------+------+------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Mouse Layer (semi-col) + * ,------+------+------+------+------+------------------------------------------------. + * | ACCL0| ACCL1| ACCL2| | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| Macro| | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | BTN1 | | | | BTN1 | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = LAYOUT( + KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R,DEMOMACRO,_______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, \ + _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + * ,------+------+------+------+------+------------------------------------------------. + * | Reset|HPT TG|HPT FB|HPT M+|HPT M-|HPT RS| | | | | |EEP RS| + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | |RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | | | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm| | | |AGswap|Qwerty|Colemk| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | | |BL - | BL + |BL ST |BL TG | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | |CK RS |CK - |CK + |CK TG | + * `--------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( + RESET, HPT_TOG, HPT_FBK, HPT_MODI, HPT_MODD, HPT_RST , _______, _______, _______, _______, _______, EEP_RST, \ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG\ +) + + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case DEMOMACRO: + if (record->event.pressed) { + SEND_STRING("hello world"); + } + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +void matrix_init_user(void) { +} + + +void matrix_scan_user(void) { +} + diff --git a/keyboards/hadron/ver3/keymaps/default/readme.md b/keyboards/hadron/ver3/keymaps/default/readme.md new file mode 100644 index 00000000000..88b958ec423 --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The Default Hadron Layout + diff --git a/keyboards/hadron/ver3/keymaps/ishtob/config.h b/keyboards/hadron/ver3/keymaps/ishtob/config.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/ishtob/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/hadron/ver3/keymaps/ishtob/keymap.c b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c new file mode 100644 index 00000000000..51062acc227 --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c @@ -0,0 +1,250 @@ +#include QMK_KEYBOARD_H +#include "ishtob.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------+------+------+------+------+------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | LCTL | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ;/Nav|Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Ctrl | GUI | Alt |Lower |Space | 0 | . | = |Space |Raise | Alt | NumL | App | Del | + * `--------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_wrapper( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + LT_FN(KC_TAB), _________________QWERTY_L1_________________, KC_P7, KC_P8, KC_P9, _________________QWERTY_R1_________________, KC_BSPC, \ + KC_CAPS, _________________QWERTY_L2_________________, KC_P4, KC_P5, KC_P6, _________________QWERTY_R2_________________, CTL_ENT, \ + KC_LSFT, _________________QWERTY_L3_________________, KC_P1, KC_P2, KC_P3, _________________QWERTY_R3_________________, LT_RAI(KC_MINS), \ + KC_ESC, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_DEL \ +), + +/* Colemak + * ,------+------+------+------+------+------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | F | P | G | 7 | 8 | 9 | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | CAPS | A | R | S | T | D | 4 | 5 | 6 | H | N | E | I | O |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | K | M | , | . | / | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Ctrl | GUI | Alt |Lower |Space | 0 | . | = |Space |Raise | Alt | NumL | App | Del | + * `--------------------------------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_wrapper( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + LT_FN(KC_TAB), _________________COLEMAK_L1________________, KC_P7, KC_P8, KC_P9, _________________COLEMAK_R1________________, KC_BSPC, \ + KC_LCTRL, _________________COLEMAK_L2________________, KC_P4, KC_P5, KC_P6, _________________COLEMAK_R2________________, CTL_ENT, \ + KC_LSFT, _________________COLEMAK_L3________________, KC_P1, KC_P2, KC_P3, _________________COLEMAK_R3________________, LT_RAI(KC_MINS), \ + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_DEL \ + ), + +/* Dvorak + * ,------+------+------+------+------+------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | " | , | . | P | Y | 7 | 8 | 9 | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | 4 | 5 | 6 | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | 1 | 2 | 3 | B | M | W | V | Z |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Ctrl | GUI | Alt |Lower |Space | 0 | . | = |Space |Raise | Alt | NumL | App | Del | + * `--------------------------------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_wrapper( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + LT_FN(KC_TAB), _________________DVORAK_L1_________________, KC_P7, KC_P8, KC_P9, _________________DVORAK_R1_________________, KC_BSPC, \ + KC_LCTL, _________________DVORAK_L2_________________, KC_P4, KC_P5, KC_P6, _________________DVORAK_R2_________________, CTL_ENT, \ + KC_LSFT, _________________DVORAK_L3_________________, KC_P1, KC_P2, KC_P3, _________________DVORAK_R3_________________, LT_RAI(KC_MINS), \ + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_DEL \ +), + +/* Lower + * ,------+------+------+------+------+------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_wrapper( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_wrapper( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + ________________NUMBER_LEFT________________, KC_6, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, KC_PLUS, KC_BSLS, \ + KC_DEL, KC_A, KC_UP, KC_D, KC_PSCR, KC_VOLU, _______, _______, _______, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT,KC__MUTE, KC_VOLD, _______, _______, _______, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, \ + _______, _______, _______, _______, _______, KC_SPC, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NLCK \ +), + +/* FN layer on Esc key + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | + | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | = | [ | ] | ' | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | { | } |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * '------+------+------+------+------+------+------+------+------+------+------+------+--------------------' + */ +[_FNLAYER] = LAYOUT_wrapper( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, \ + _______, __________________LONG_FUNC_LEFT___________________, _______, _______, _______, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, \ + _______, __________________LONG_FUNC_RIGHT__________________, _______, _______, _______,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Mouse Layer (semi-col) + * ,------+------+------+------+------+------------------------------------------------. + * | ACCL0| ACCL1| ACCL2| | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| Macro| | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | BTN1 | | | | BTN1 | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = LAYOUT_wrapper( + KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, M_EMAIL,M_EMAIL2, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, P_MPASS, P_META, \ + _______, _______, _______, _______, O_RTQ6H, _______, _______, _______, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, O_DAYRN, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, \ + _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, KC_BTN1, _______, _______, _______, P_CITRIX, O_AUTODC \ +), + +/* Adjust (Lower + Raise) + * ,------+------+------+------+------+------------------------------------------------. + * | Reset|HPT TG|HPT FB|HPT M+|HPT M-|HPT RS| | | | | |EEP RS| + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | |RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | | | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm| | | |AGswap|Qwerty|Colemk| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | | |BL - | BL + |BL ST |BL TG | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | |CK RS |CK - |CK + |CK TG | + * `--------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_wrapper( + _______, HPT_TOG, HPT_FBK, HPT_MODI, HPT_MODD, HPT_RST, _______, _______, _______, _______, _______, EEP_RST, \ + RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ + _______, MAGIC_TOGGLE_NKRO, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG\ +) + + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + + +void matrix_init_keymap(void) { +} + + +void matrix_scan_keymap(void) { +} + diff --git a/keyboards/hadron/ver3/keymaps/ishtob/readme.md b/keyboards/hadron/ver3/keymaps/ishtob/readme.md new file mode 100644 index 00000000000..88b958ec423 --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/ishtob/readme.md @@ -0,0 +1,2 @@ +# The Default Hadron Layout + diff --git a/keyboards/hadron/ver3/keymaps/readme.md b/keyboards/hadron/ver3/keymaps/readme.md new file mode 100644 index 00000000000..66bf06b7111 --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/readme.md @@ -0,0 +1,24 @@ +# How to add your own keymap + +Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`: + + _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author] + +\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements + +and contain the following files: + +* `keymap.c` +* `readme.md` *recommended* +* `config.h` *optional*, found automatically when compiling +* `Makefile` *optional*, found automatically when compling + +When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format: + + * **folder_name** description + +# List of Hadron keymaps + +* **default** default Hadron layout +* **ishtob** ishtob's Hadron layout +* **sebaslayout** sebaslayout's Hadron layout \ No newline at end of file diff --git a/keyboards/hadron/ver3/keymaps/sebaslayout/config.h b/keyboards/hadron/ver3/keymaps/sebaslayout/config.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/sebaslayout/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/hadron/ver3/keymaps/sebaslayout/keymap.c b/keyboards/hadron/ver3/keymaps/sebaslayout/keymap.c new file mode 100644 index 00000000000..01fe45bd05e --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/sebaslayout/keymap.c @@ -0,0 +1,57 @@ +#include QMK_KEYBOARD_H +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_P7, KC_P8, KC_P9, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_SCLN, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_SLSH, KC_P1, KC_P2, KC_P3, + KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, KC_SPC, KC_SPC, MO(1), KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), +/* Primary + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | PRTSN| + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ˜ | Q | W | E | R | T | Y | U | I | O | P | BKSP | 7 | 8 | 9 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ' | ; | 4 | 5 | 6 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up | /? | 1 | 2 | 3 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | Raise| Space | Raise| Ctrl | Left | Down |Right | 0 | . | Enter| + * `--------------------------------------------------------------------------------------------------------' + */ + LAYOUT( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_HOME, KC_INS, KC_PGUP, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_DEL, KC_PGDN, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +/* Secondary + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | | | | | F11 | F12 | | Home | Ins | PgUP | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | End | Del | PgDN | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Vol+ | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Vol- | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/hadron/ver3/keymaps/sebaslayout/readme.md b/keyboards/hadron/ver3/keymaps/sebaslayout/readme.md new file mode 100644 index 00000000000..ce6974ce096 --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/sebaslayout/readme.md @@ -0,0 +1,7 @@ +![Hadron v3 Layout Image](https://i.imgur.com/Mi5L57j.png) + +# My Custome Hadron Layout + ++ Moved numpad to the right ++ changed F row to standard numbers ++ Bottom row subject to change diff --git a/keyboards/hadron/ver3/keymaps/xulkal/config.h b/keyboards/hadron/ver3/keymaps/xulkal/config.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/xulkal/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/hadron/ver3/keymaps/xulkal/keymap.c b/keyboards/hadron/ver3/keymaps/xulkal/keymap.c new file mode 100644 index 00000000000..0b7fd6f5e5f --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/xulkal/keymap.c @@ -0,0 +1,73 @@ +#include QMK_KEYBOARD_H +#include "xulkal.h" + +#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty Layout + * ,-----------------------------------------------------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------|------+------+------+------+------+------+--------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | 7 | 8 | 9 | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| + * |FN(CAPS)| A | S | D | F | G | H | J | K | L | ; | Enter| 4 | 5 | 6 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Sft[ | Z | X | C | V | B | N | M | , | . | / | Sft] | 1 | 2 | 3 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctl- | Win | LOWER| RAISE| Alt | Space| Space| Left | Up | Down | Right| Ctl= | 0 | . | = | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------' + */ + [_QWERTY] = EXPAND_LAYOUT( \ + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________,\ + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_P7, KC_P8, KC_P9, \ + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_P4, KC_P5, KC_P6, \ + _________________QWERTY_L4_________________, _________________QWERTY_R4_________________, KC_P1, KC_P2, KC_P3, \ + _________________QWERTY_L5_________________, _________________QWERTY_R5_________________, KC_P0, KC_DOT, KC_EQL \ + ), + +#ifndef GAMELAYER_DISABLE + [_GAME] = EXPAND_LAYOUT( \ + ___________________GAME_L1_________________, ___________________GAME_R1_________________, \ + ___________________GAME_L2_________________, ___________________GAME_R2_________________, _______, _______, _______, \ + ___________________GAME_L3_________________, ___________________GAME_R3_________________, _______, _______, _______, \ + ___________________GAME_L4_________________, ___________________GAME_R4_________________, _______, _______, _______, \ + ___________________GAME_L5_________________, ___________________GAME_R5_________________, _______, _______, _______ \ + ), +#endif + + [_LOWER] = EXPAND_LAYOUT( \ + __________________LOWER_L1_________________, __________________LOWER_R1_________________, \ + __________________LOWER_L2_________________, __________________LOWER_R2_________________, _______, _______, _______, \ + __________________LOWER_L3_________________, __________________LOWER_R3_________________, _______, _______, _______, \ + __________________LOWER_L4_________________, __________________LOWER_R4_________________, _______, _______, _______, \ + __________________LOWER_L5_________________, __________________LOWER_R5_________________, _______, _______, _______ \ + ), + + [_RAISE] = EXPAND_LAYOUT( \ + __________________RAISE_L1_________________, __________________RAISE_R1_________________, \ + __________________RAISE_L2_________________, __________________RAISE_R2_________________, _______, _______, _______, \ + __________________RAISE_L3_________________, __________________RAISE_R3_________________, _______, _______, _______, \ + __________________RAISE_L4_________________, __________________RAISE_R4_________________, _______, _______, _______, \ + __________________RAISE_L5_________________, __________________RAISE_R5_________________, _______, _______, _______ \ + ), + +#ifdef TRILAYER_ENABLED + [_ADJUST] = EXPAND_LAYOUT( \ + _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, \ + _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, _______, _______, _______, \ + _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, _______, _______, _______, \ + _________________ADJUST_L4_________________, _________________ADJUST_R4_________________, _______, _______, _______, \ + _________________ADJUST_L5_________________, _________________ADJUST_R5_________________, _______, _______, _______ \ + ), +#endif +}; + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/hadron/ver3/keymaps/xulkal/rules.mk b/keyboards/hadron/ver3/keymaps/xulkal/rules.mk new file mode 100644 index 00000000000..0305226b321 --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/xulkal/rules.mk @@ -0,0 +1,4 @@ +# Overridden build options + +COMMAND_ENABLE = no +ENCODER_ENABLER = no diff --git a/keyboards/hadron/ver3/mcuconf.h b/keyboards/hadron/ver3/mcuconf.h new file mode 100644 index 00000000000..94d761cfba7 --- /dev/null +++ b/keyboards/hadron/ver3/mcuconf.h @@ -0,0 +1,257 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32F3xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F3xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 +#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_USART2SW STM32_USART2SW_PCLK +#define STM32_USART3SW STM32_USART3SW_PCLK +#define STM32_UART4SW STM32_UART4SW_PCLK +#define STM32_UART5SW STM32_UART5SW_PCLK +#define STM32_I2C1SW STM32_I2C1SW_SYSCLK +#define STM32_I2C2SW STM32_I2C2SW_SYSCLK +#define STM32_TIM1SW STM32_TIM1SW_PCLK2 +#define STM32_TIM8SW STM32_TIM8SW_PCLK2 +#define STM32_RTCSEL STM32_RTCSEL_LSI +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 + +#undef STM32_HSE_BYPASS +// #error "oh no" +// #endif + +/* + * ADC driver system settings. + */ +#define STM32_ADC_DUAL_MODE FALSE +#define STM32_ADC_COMPACT_SAMPLES FALSE +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_USE_ADC2 FALSE +#define STM32_ADC_USE_ADC3 FALSE +#define STM32_ADC_USE_ADC4 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) +#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) +#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) +#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC2_DMA_PRIORITY 2 +#define STM32_ADC_ADC3_DMA_PRIORITY 2 +#define STM32_ADC_ADC4_DMA_PRIORITY 2 +#define STM32_ADC_ADC12_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 +#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE FALSE +#define STM32_DAC_USE_DAC1_CH1 TRUE +#define STM32_DAC_USE_DAC1_CH2 TRUE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM6 TRUE +#define STM32_GPT_USE_TIM7 TRUE +#define STM32_GPT_USE_TIM8 TRUE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM6_IRQ_PRIORITY 7 +#define STM32_GPT_TIM7_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 10 +#define STM32_I2C_I2C2_IRQ_PRIORITY 10 +#define STM32_I2C_USE_DMA FALSE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 TRUE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 3 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +#endif /* MCUCONF_H */ diff --git a/keyboards/hadron/ver3/rules.mk b/keyboards/hadron/ver3/rules.mk new file mode 100644 index 00000000000..599fb53fae6 --- /dev/null +++ b/keyboards/hadron/ver3/rules.mk @@ -0,0 +1,25 @@ +# projecct specific files + +# Cortex version +MCU = STM32F303 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = no #WS2812 once arm_rgb is implemented +HAPTIC_ENABLE += DRV2605L +QWIIC_ENABLE += MICRO_OLED +ENCODER_ENABLER = yes +# SERIAL_LINK_ENABLE = yes diff --git a/keyboards/hadron/ver3/ver3.c b/keyboards/hadron/ver3/ver3.c new file mode 100644 index 00000000000..1491caba43f --- /dev/null +++ b/keyboards/hadron/ver3/ver3.c @@ -0,0 +1,215 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "ver3.h" +#include "qwiic.h" +#include "action_layer.h" +#include "haptic.h" + +#ifdef RGB_MATRIX_ENABLE +#include "rgb_matrix.h" + +led_config_t g_led_config = { { + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 6, NO_LED, NO_LED, 7, NO_LED, NO_LED, 8, NO_LED, NO_LED, 9, NO_LED, NO_LED, 0, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 5, NO_LED, NO_LED, 4, NO_LED, NO_LED, 3, NO_LED, NO_LED, 2, NO_LED, NO_LED, 1, NO_LED } +}, { + { 195, 3 }, { 195, 16 }, { 150, 16 }, { 105, 16 }, { 60, 16 }, { 15, 16 }, { 15, 3 }, { 60, 3 }, { 105, 3 }, { 150, 3 } +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 +} }; + +#endif + +uint8_t *o_fb; + +uint16_t counterst = 0; + + + +#ifdef QWIIC_MICRO_OLED_ENABLE + +/* screen off after this many milliseconds */ +#include "timer.h" +#define ScreenOffInterval 60000 /* milliseconds */ +static uint16_t last_flush; + +volatile uint8_t led_numlock = false; +volatile uint8_t led_capslock = false; +volatile uint8_t led_scrolllock = false; + +static uint8_t layer; +static bool queue_for_send = false; +static uint8_t encoder_value = 32; + +__attribute__ ((weak)) +void draw_ui(void) { + clear_buffer(); + last_flush = timer_read(); + send_command(DISPLAYON); + +/* Layer indicator is 41 x 10 pixels */ +#define LAYER_INDICATOR_X 5 +#define LAYER_INDICATOR_Y 0 + + draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); + draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); + draw_char(LAYER_INDICATOR_X + 34, LAYER_INDICATOR_Y + 2, layer + 0x30, PIXEL_ON, XOR, 0); + +/* Matrix display is 19 x 9 pixels */ +#define MATRIX_DISPLAY_X 5 +#define MATRIX_DISPLAY_Y 18 + + for (uint8_t x = 0; x < MATRIX_ROWS; x++) { + for (uint8_t y = 0; y < MATRIX_COLS; y++) { + draw_pixel(MATRIX_DISPLAY_X + y + 2, MATRIX_DISPLAY_Y + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); + } + } + draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 19, 9, PIXEL_ON, NORM); + /* hadron oled location on thumbnail */ + draw_rect_filled_soft(MATRIX_DISPLAY_X + 14, MATRIX_DISPLAY_Y + 2, 3, 1, PIXEL_ON, NORM); +/* + draw_rect_soft(0, 13, 64, 6, PIXEL_ON, NORM); + draw_line_vert(encoder_value, 13, 6, PIXEL_ON, NORM); + +*/ + +/* Mod display is 41 x 16 pixels */ +#define MOD_DISPLAY_X 30 +#define MOD_DISPLAY_Y 18 + + uint8_t mods = get_mods(); + if (mods & MOD_LSFT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 0, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LCTL) { + draw_rect_filled_soft(MOD_DISPLAY_X + 10, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LALT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 20, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LGUI) { + draw_rect_filled_soft(MOD_DISPLAY_X + 30, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_ON, NORM, 0); + } + +/* Lock display is 23 x 32 */ +#define LOCK_DISPLAY_X 100 +#define LOCK_DISPLAY_Y 0 + + if (led_numlock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X, LOCK_DISPLAY_Y, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_OFF, NORM, 0); + } else if (led_numlock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_ON, NORM, 0); + } + if (led_capslock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 11, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_OFF, NORM, 0); + } else if (led_capslock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_ON, NORM, 0); + } + + if (led_scrolllock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 22, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_OFF, NORM, 0); + } else if (led_scrolllock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_ON, NORM, 0); + } + send_buffer(); +} + +void read_host_led_state(void) { + uint8_t leds = host_keyboard_leds(); + if (leds & (1 << USB_LED_NUM_LOCK)) { + if (led_numlock == false){ + led_numlock = true;} + } else { + if (led_numlock == true){ + led_numlock = false;} + } + if (leds & (1 << USB_LED_CAPS_LOCK)) { + if (led_capslock == false){ + led_capslock = true;} + } else { + if (led_capslock == true){ + led_capslock = false;} + } + if (leds & (1 << USB_LED_SCROLL_LOCK)) { + if (led_scrolllock == false){ + led_scrolllock = true;} + } else { + if (led_scrolllock == true){ + led_scrolllock = false;} + } +} + +uint32_t layer_state_set_kb(uint32_t state) { + state = layer_state_set_user(state); + layer = biton32(state); + queue_for_send = true; + return state; +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + queue_for_send = true; + return process_record_user(keycode, record); +} + +void encoder_update_kb(uint8_t index, bool clockwise) { + encoder_value = (encoder_value + (clockwise ? 1 : -1)) % 64; + queue_for_send = true; +} + +#endif + +void matrix_init_kb(void) { + queue_for_send = true; + matrix_init_user(); +} + +void matrix_scan_kb(void) { +if (queue_for_send) { +#ifdef QWIIC_MICRO_OLED_ENABLE + read_host_led_state(); + draw_ui(); +#endif + queue_for_send = false; + } +#ifdef QWIIC_MICRO_OLED_ENABLE + if (timer_elapsed(last_flush) > ScreenOffInterval) { + send_command(DISPLAYOFF); /* 0xAE */ + } +#endif + if (counterst == 0) { + //testPatternFB(o_fb); + } + counterst = (counterst + 1) % 1024; + //rgblight_task(); + matrix_scan_user(); +} diff --git a/keyboards/hadron/ver3/ver3.h b/keyboards/hadron/ver3/ver3.h new file mode 100644 index 00000000000..95926469bf8 --- /dev/null +++ b/keyboards/hadron/ver3/ver3.h @@ -0,0 +1,18 @@ +/* Copyright 2018 ishtob + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "hadron.h" \ No newline at end of file diff --git a/keyboards/halberd/config.h b/keyboards/halberd/config.h new file mode 100644 index 00000000000..cf3460b6182 --- /dev/null +++ b/keyboards/halberd/config.h @@ -0,0 +1,223 @@ +/* Copyright 2019 ENDO Katsuhiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Kagizaraya +#define PRODUCT Halberd +#define DESCRIPTION 40% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 11 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D6, D4, D5, E6 } +#define MATRIX_COL_PINS { D7, B4, C7, C6, B6, B5, F7, F6, F5, F4, F1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 40 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +#define TAPPING_TERM 100 diff --git a/keyboards/halberd/halberd.c b/keyboards/halberd/halberd.c new file mode 100644 index 00000000000..8b59310a7fc --- /dev/null +++ b/keyboards/halberd/halberd.c @@ -0,0 +1,43 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "halberd.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/halberd/halberd.h b/keyboards/halberd/halberd.h new file mode 100644 index 00000000000..d2adb4a15cb --- /dev/null +++ b/keyboards/halberd/halberd.h @@ -0,0 +1,40 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K20, K21, \ + K22, K23, K24, K25, K26, K27, K28, K29, K30, K31, K32, \ + K33, K34, K35, K36, K37, K38, K39 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K10 }, \ + { K11, K12, K13, K14, K15, K16, K17, K18, K19, K20, K21 }, \ + { K22, K23, K24, K25, K26, K27, K28, K29, K30, K31, K32 }, \ + { KC_NO, KC_NO, K33, K34, K35, K36, K37, K38, K39, KC_NO, KC_NO } \ +} + diff --git a/keyboards/halberd/info.json b/keyboards/halberd/info.json new file mode 100644 index 00000000000..5e2a57f216d --- /dev/null +++ b/keyboards/halberd/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Halberd", + "url": "", + "maintainer": "ka2hiro", + "width": 11, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"label":"!", "x":0, "y":0}, {"label":"@", "x":1, "y":0}, {"label":"#", "x":2, "y":0}, {"label":"$", "x":3, "y":0}, {"label":"%", "x":4, "y":0}, {"label":"Tab", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"Tab", "x":0, "y":1}, {"label":"_", "x":1, "y":1}, {"label":"+", "x":2, "y":1}, {"label":"|", "x":3, "y":1}, {"label":"~", "x":4, "y":1}, {"label":"BkSp", "x":5, "y":1}, {"label":":", "x":6, "y":1}, {"label":"\"", "x":7, "y":1}, {"label":">", "x":8, "y":1}, {"label":"{", "x":9, "y":1}, {"label":"}", "x":10, "y":1}, {"label":"Caps", "x":0, "y":2}, {"label":"-", "x":1, "y":2}, {"label":"=", "x":2, "y":2}, {"label":"\\", "x":3, "y":2}, {"label":"`", "x":4, "y":2}, {"label":"Enter", "x":5, "y":2}, {"label":";", "x":6, "y":2}, {"label":"'", "x":7, "y":2}, {"label":"<", "x":8, "y":2}, {"label":"[", "x":9, "y":2}, {"label":"]", "x":10, "y":2}, {"label":"GUI", "x":2, "y":3}, {"label":"Lower", "x":3, "y":3}, {"label":"Esc", "x":4, "y":3}, {"x":5, "y":3}, {"label":"Shift", "x":6, "y":3}, {"label":"Raise", "x":7, "y":3}, {"label":"Alt", "x":8, "y":3}] + } + } +} + diff --git a/keyboards/halberd/keymaps/default/config.h b/keyboards/halberd/keymaps/default/config.h new file mode 100644 index 00000000000..cea12f905cd --- /dev/null +++ b/keyboards/halberd/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/halberd/keymaps/default/keymap.c b/keyboards/halberd/keymaps/default/keymap.c new file mode 100644 index 00000000000..c79a81deff6 --- /dev/null +++ b/keyboards/halberd/keymaps/default/keymap.c @@ -0,0 +1,160 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * + * ,----------------------------------------------------------------------------. + * | Q | W | E | R | T | Tab | Y | U | I | O | P | + * |------+------+------+------+------|------|------+------+------+------+------| + * | A | S | D | F | G | BkSp | H | J | K | L | ; | + * |------+------+------+------+------|------|------+------+------+------+------| + * | Z | X | C | V | B | Enter| N | M | , | . | / | + * `-------------+------+------+------|------|------+------+------+------+------' + * | GUI | LOWER|Ctrl/Esc|Space|Shift| RAISE| Alt | + * `------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_LGUI, LOWER, MT(MOD_LCTL, KC_ESC), KC_SPC, KC_LSFT, RAISE, KC_LALT +), + +/* Raise + * + * ,----------------------------------------------------------------------------. + * | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + * |------+------+------+------+------|------|------+------+------+------+------| + * | Tab | _ | + | | | ~ | | : | " | > | { | } | + * |------+------+------+------+------|------|------+------+------+------+------| + * | Caps| - | = | \ | ` | | ; | ' | < | [ | ] | + * `-------------+------+------+------|------|------+------+------+------+------' + * | | LOWER| | | Esc | RAISE| | + * `------------------------------------------------' + */ +[_RAISE] = LAYOUT( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_TAB, KC_UNDS, KC_PLUS, KC_PIPE, KC_TILD, _______, KC_COLN, KC_DQUO, KC_GT, KC_LCBR, KC_RCBR, + KC_CAPS, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, _______, KC_SCLN, KC_QUOT, KC_LT, KC_LBRC, KC_RBRC, + _______, _______, _______, _______, _______, _______, _______ +), + +/* Lower + * + * ,----------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | + * |------+------+------+------+------|------|------+------+------+------+------| + * | Tab | | | |Enter | | Left | Down | Up | Right| Enter| + * |------+------+------+------+------|------|------+------+------+------+------| + * | Ctrl| | GUI | Alt | Del | | BkSp | PgUp | PgDn | | | + * `-------------+------+------+------|------|------+------+------+------+------' + * | | LOWER| | | | RAISE| | + * `------------------------------------------------' + */ +[_LOWER] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_TAB, _______, _______, _______, KC_ENT, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ENT, + KC_LCTL, _______, KC_LGUI, KC_LALT, KC_DEL, _______, KC_BSPC, KC_PGUP, KC_PGDN, _______, _______, + _______, _______, _______, _______, _______, _______, _______ +), + + +/* Adjust (Lower + Raise) + * + * ,----------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * |------+------+------+------+------|------|------+------+------+------+------| + * | F11 | F12 | |RGBSAI|RGBSAD| |RGBVAI|RGBVAD| | | | + * |------+------+------+------+------|------|------+------+------+------+------| + * | Reset|RGBTOG|RGBMOD|RGBHUI|RGBHUD| | Prev | Next | Vol- | Vol+ | Play | + * `-------------+------+------+------|------|------+------+------+------+------' + * | | LOWER| | | | RAISE| | + * `------------------------------------------------' + */ +[_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + KC_F11, KC_F12, RGB_RMOD, RGB_SAI, RGB_SAD, _______, RGB_VAI, RGB_VAD, _______, _______, _______, + RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, _______, KC_MPRV, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, + _______, _______, _______, _______, _______, _______, _______ +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + // persistant_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/halberd/keymaps/default/readme.md b/keyboards/halberd/keymaps/default/readme.md new file mode 100644 index 00000000000..567b45c4747 --- /dev/null +++ b/keyboards/halberd/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for halberd diff --git a/keyboards/halberd/keymaps/right_modifiers/config.h b/keyboards/halberd/keymaps/right_modifiers/config.h new file mode 100644 index 00000000000..cea12f905cd --- /dev/null +++ b/keyboards/halberd/keymaps/right_modifiers/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/halberd/keymaps/right_modifiers/keymap.c b/keyboards/halberd/keymaps/right_modifiers/keymap.c new file mode 100644 index 00000000000..f74eef45413 --- /dev/null +++ b/keyboards/halberd/keymaps/right_modifiers/keymap.c @@ -0,0 +1,160 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * + * ,----------------------------------------------------------------------------. + * | Q | W | E | R | T | Y | U | I | O | P | BkSp | + * |------+------+------+------+------|------+------+------+------+------|------| + * | A | S | D | F | G | H | J | K | L | ; | Enter| + * |------+------+------+------+------|------+------+------+------+------|------| + * | Z | X | C | V | B | N | M | , | . | / | Shift| + * `-------------+------+------+------|------+------+------+------+------+------' + * | GUI | LOWER|Ctrl/Esc|Space| RAISE| Alt | Tab | + * `------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_LGUI, LOWER, MT(MOD_LCTL, KC_ESC), KC_SPC, RAISE, KC_LALT, KC_TAB +), + +/* Raise + * + * ,----------------------------------------------------------------------------. + * | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------|------+------+------+------+------|------| + * | Tab | _ | + | | | ~ | : | " | > | { | } | | + * |------+------+------+------+------|------+------+------+------+------|------| + * | Caps| - | = | \ | ` | ; | ' | < | [ | ] | | + * `-------------+------+------+------|------+------+------+------+------+------' + * | | | | | | | | + * `------------------------------------------------' + */ +[_RAISE] = LAYOUT( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_TAB, KC_UNDS, KC_PLUS, KC_PIPE, KC_TILD, KC_COLN, KC_DQUO, KC_GT, KC_LCBR, KC_RCBR, _______, + KC_CAPS, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_SCLN, KC_QUOT, KC_LT, KC_LBRC, KC_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______ +), + +/* Lower + * + * ,----------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------|------+------+------+------+------|------| + * | Tab | | | |Enter | Left | Down | Up | Right| Enter| | + * |------+------+------+------+------|------+------+------+------+------|------| + * | Ctrl| | GUI | Alt | Del | BkSp | PgUp | PgDn | | | | + * `-------------+------+------+------|------+------+------+------+------+------' + * | | | | | | | | + * `------------------------------------------------' + */ +[_LOWER] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_TAB, _______, _______, _______, KC_ENT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ENT, _______, + KC_LCTL, _______, KC_LGUI, KC_LALT, KC_DEL, KC_BSPC, KC_PGUP, KC_PGDN, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ +), + + +/* Adjust (Lower + Raise) + * + * ,----------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------|------+------+------+------+------|------| + * | F11 | F12 | |RGBSAI|RGBSAD|RGBVAI|RGBVAD| | | | | + * |------+------+------+------+------|------+------+------+------+------|------| + * | Reset|RGBTOG|RGBMOD|RGBHUI|RGBHUD| Prev | Next | Vol- | Vol+ | Play | | + * `-------------+------+------+------|------+------+------+------+------+------' + * | | | | | | | | + * `------------------------------------------------' + */ +[_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + KC_F11, KC_F12, RGB_RMOD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, + RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_MPRV, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, + _______, _______, _______, _______, _______, _______, _______ +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + // persistant_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/halberd/keymaps/right_modifiers/readme.md b/keyboards/halberd/keymaps/right_modifiers/readme.md new file mode 100644 index 00000000000..2479922bdc1 --- /dev/null +++ b/keyboards/halberd/keymaps/right_modifiers/readme.md @@ -0,0 +1,2 @@ +# Modifiers on the right side. + diff --git a/keyboards/halberd/readme.md b/keyboards/halberd/readme.md new file mode 100644 index 00000000000..7fa0388fdaa --- /dev/null +++ b/keyboards/halberd/readme.md @@ -0,0 +1,15 @@ +# Halberd + +![Halberd](https://i.imgur.com/QabQNPQ.jpg) + +40% keyboard. + +Keyboard Maintainer: [ka2hiro](https://github.com/ka2hiro) [@ka2hiro](https://twitter.com/ka2hiro) +Hardware Supported: Halberd PCB, ATMEGA32U4 +Hardware Availability: [@kagizaraya](https://twitter.com/kagizaraya) + +Make example for this keyboard (after setting up your build environment): + + make halberd:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/halberd/rules.mk b/keyboards/halberd/rules.mk new file mode 100644 index 00000000000..ed4e6bde325 --- /dev/null +++ b/keyboards/halberd/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/handwired/108key_trackpoint/108key_trackpoint.c b/keyboards/handwired/108key_trackpoint/108key_trackpoint.c new file mode 100644 index 00000000000..3834f89613f --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/108key_trackpoint.c @@ -0,0 +1 @@ +#include "108key_trackpoint.h" diff --git a/keyboards/handwired/108key_trackpoint/108key_trackpoint.h b/keyboards/handwired/108key_trackpoint/108key_trackpoint.h new file mode 100644 index 00000000000..100f4cb9328 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/108key_trackpoint.h @@ -0,0 +1,23 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K000, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K019, K020, K021, K022, \ + \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, K217, K219, K220, K221, K222, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K319, K320, K321, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K419, K420, K421, K422, \ + K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K513, K516, K519, K520, K521, \ + K600, K601, K603, K606, K610, K611, K613, K614, K615, K616, K617, K619, K621, K622, \ + K705, K706, K707 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, KC_NO, K019, K020, K021, K022 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214, K215, K216, K217, KC_NO, K219, K220, K221, K222 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, KC_NO, K319, K320, K321, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K419, K420, K421, K422 }, \ + { KC_NO, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, KC_NO, K513, KC_NO, KC_NO, K516, KC_NO, KC_NO, K519, K520, K521, KC_NO }, \ + { K600, K601, KC_NO, K603, KC_NO, KC_NO, K606, KC_NO, KC_NO, KC_NO, K610, K611, KC_NO, K613, K614, K615, K616, K617, KC_NO, K619, KC_NO, K621, K622 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K705, K706, K707, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} diff --git a/keyboards/handwired/108key_trackpoint/config.h b/keyboards/handwired/108key_trackpoint/config.h new file mode 100644 index 00000000000..2c0662c0b67 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/config.h @@ -0,0 +1,67 @@ +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x1234 +#define PRODUCT_ID 0x5678 +#define DEVICE_VER 0x0001 +#define MANUFACTURER QMK +#define PRODUCT 108Key-Trackpoint +#define DESCRIPTION A 108 key ANSI keyboard with a trackpoint and three mouse buttons + +#define MATRIX_ROWS 8 +#define MATRIX_COLS 23 + +#ifdef PS2_USE_USART + #define PS2_CLOCK_PORT PORTD + #define PS2_CLOCK_PIN PIND + #define PS2_CLOCK_DDR DDRD + #define PS2_CLOCK_BIT 5 + #define PS2_DATA_PORT PORTD + #define PS2_DATA_PIN PIND + #define PS2_DATA_DDR DDRD + #define PS2_DATA_BIT 2 + + /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ + /* set DDR of CLOCK as input to be slave */ + #define PS2_USART_INIT() do { \ + PS2_CLOCK_DDR &= ~(1<. + */ +#include "6macro.h" diff --git a/keyboards/handwired/6macro/6macro.h b/keyboards/handwired/6macro/6macro.h new file mode 100644 index 00000000000..c1d50051283 --- /dev/null +++ b/keyboards/handwired/6macro/6macro.h @@ -0,0 +1,35 @@ +/* Copyright 2019 joaofbmaia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11, k12 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 }, \ +} diff --git a/keyboards/handwired/6macro/config.h b/keyboards/handwired/6macro/config.h new file mode 100644 index 00000000000..7919c3c71ff --- /dev/null +++ b/keyboards/handwired/6macro/config.h @@ -0,0 +1,70 @@ +/* +Copyright 2019 joaofbmaia + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0037 +#define DEVICE_VER 0x0001 +#define MANUFACTURER joaofbmaia +#define PRODUCT 6macro +#define DESCRIPTION 6macro + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +/* pinout - DON'T CHANGE */ +#define MATRIX_ROW_PINS { B3, B4 } +#define MATRIX_COL_PINS { B0, B1, B2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define RGB_DI_PIN D2 +#define RGBLED_NUM 10 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 +#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 \ No newline at end of file diff --git a/keyboards/handwired/6macro/info.json b/keyboards/handwired/6macro/info.json new file mode 100644 index 00000000000..52bd03a1dd8 --- /dev/null +++ b/keyboards/handwired/6macro/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "6macro", + "url": "", + "maintainer": "joaofbmaia", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k10", "x":0, "y":1}, {"label":"k11", "x":1, "y":1}, {"label":"k12", "x":2, "y":1}] + } + } + } + \ No newline at end of file diff --git a/keyboards/handwired/6macro/keymaps/default/config.h b/keyboards/handwired/6macro/keymaps/default/config.h new file mode 100644 index 00000000000..64ba57443f8 --- /dev/null +++ b/keyboards/handwired/6macro/keymaps/default/config.h @@ -0,0 +1,18 @@ +/* Copyright 2019 joaofbmaia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + diff --git a/keyboards/handwired/6macro/keymaps/default/keymap.c b/keyboards/handwired/6macro/keymaps/default/keymap.c new file mode 100644 index 00000000000..365dbf7b05a --- /dev/null +++ b/keyboards/handwired/6macro/keymaps/default/keymap.c @@ -0,0 +1,56 @@ +/* Copyright 2019 joaofbmaia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* LAYER 0 + * ,-----------------------. + * | F13 | F14 | F15/FN| Hold for FN + * |-------+-------+-------| + * | F16 | F17 | F18 | + * `-------+-------+-------' + */ + [0] = LAYOUT( + KC_F13, KC_F14, LT(1, KC_F15), \ + KC_F16, KC_F17, KC_F18 \ + ), + + /* LAYER 1 + * ,-----------------------. + * |RGB_TOG|RGBMOD+| | + * |-------+-------+-------| + * |RGBHUE+|RGBBRI+|Spec FN| Hold along with previous to access special funtions (RESET) + * `-------+-------+-------' + */ + [1] = LAYOUT( + RGB_TOG, RGB_MOD, KC_TRNS, \ + RGB_HUI, RGB_VAI, MO(2) \ + ), + + /* LAYER 2 + * ,-----------------------. + * | RESET |RGBMOD-| | + * |-------+-------+-------| + * |RGBHUE-|RGBBRI-| | + * `-------+-------+-------' + */ + [2] = LAYOUT( + RESET, RGB_RMOD, KC_NO, \ + RGB_HUD, RGB_VAD, KC_TRNS \ + ) + +}; diff --git a/keyboards/handwired/6macro/keymaps/default/readme.md b/keyboards/handwired/6macro/keymaps/default/readme.md new file mode 100644 index 00000000000..dd42a8fc62a --- /dev/null +++ b/keyboards/handwired/6macro/keymaps/default/readme.md @@ -0,0 +1,15 @@ +Layer 0: + +![Layer 0](https://raw.githubusercontent.com/joaofbmaia/6macro/master/layer0_default.png) + +Layer 1: + +![Layer 1](https://raw.githubusercontent.com/joaofbmaia/6macro/master/layer1.png) + +Layer 2: + +![Layer 2](https://raw.githubusercontent.com/joaofbmaia/6macro/master/layer2.png) + +# Default 6macro Layout + +This is the default layout. Layer 0 is mappped to function keys 13-18. Top right key switches to layer above when held. Upper layers are for RGB control. \ No newline at end of file diff --git a/keyboards/handwired/6macro/keymaps/osu/config.h b/keyboards/handwired/6macro/keymaps/osu/config.h new file mode 100644 index 00000000000..64ba57443f8 --- /dev/null +++ b/keyboards/handwired/6macro/keymaps/osu/config.h @@ -0,0 +1,18 @@ +/* Copyright 2019 joaofbmaia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + diff --git a/keyboards/handwired/6macro/keymaps/osu/keymap.c b/keyboards/handwired/6macro/keymaps/osu/keymap.c new file mode 100644 index 00000000000..ffed7d909f5 --- /dev/null +++ b/keyboards/handwired/6macro/keymaps/osu/keymap.c @@ -0,0 +1,56 @@ +/* Copyright 2019 joaofbmaia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* LAYER 0 + * ,-----------------------. + * | ESC | ~ | SPC/FN| Hold for FN + * |-------+-------+-------| + * | C | Z | X | + * `-------+-------+-------' + */ + [0] = LAYOUT( + KC_ESC, KC_GRAVE, LT(1, KC_SPC), \ + KC_C, KC_Z, KC_X \ + ), + + /* LAYER 1 + * ,-----------------------. + * |RGB_TOG|RGBMOD+| | + * |-------+-------+-------| + * |RGBHUE+|RGBBRI+|Spec FN| Hold along with previous to access special funtions (RESET) + * `-------+-------+-------' + */ + [1] = LAYOUT( + RGB_TOG, RGB_MOD, KC_TRNS, \ + RGB_HUI, RGB_VAI, MO(2) \ + ), + + /* LAYER 2 + * ,-----------------------. + * | RESET |RGBMOD-| | + * |-------+-------+-------| + * |RGBHUE-|RGBBRI-| | + * `-------+-------+-------' + */ + [2] = LAYOUT( + RESET, RGB_RMOD, KC_NO, \ + RGB_HUD, RGB_VAD, KC_TRNS \ + ) + +}; diff --git a/keyboards/handwired/6macro/keymaps/osu/readme.md b/keyboards/handwired/6macro/keymaps/osu/readme.md new file mode 100644 index 00000000000..0de5d6bf2e0 --- /dev/null +++ b/keyboards/handwired/6macro/keymaps/osu/readme.md @@ -0,0 +1,15 @@ +Layer 0: + +![Layer 0](https://raw.githubusercontent.com/joaofbmaia/6macro/master/layer0_osu.png) + +Layer 1: + +![Layer 1](https://raw.githubusercontent.com/joaofbmaia/6macro/master/layer1.png) + +Layer 2: + +![Layer 2](https://raw.githubusercontent.com/joaofbmaia/6macro/master/layer2.png) + +# OSU 6macro Layout + +This layout is for the game OSU. Layer 0 is mappped as shown above. Top right key switches to layer above when held. Upper layers are for RGB control. \ No newline at end of file diff --git a/keyboards/handwired/6macro/readme.md b/keyboards/handwired/6macro/readme.md new file mode 100644 index 00000000000..3fbd917c805 --- /dev/null +++ b/keyboards/handwired/6macro/readme.md @@ -0,0 +1,15 @@ +# 6macro + +![6macro photo](https://raw.githubusercontent.com/joaofbmaia/6macro/master/photo.jpg) +![6macro photo with RGB](https://raw.githubusercontent.com/joaofbmaia/6macro/master/photo_rgb.jpg) + +This is a 6-key keyboard intended for macros or as a dedicated controller for games with few bindings. + +Keyboard Maintainer: [joaofbmaia](https://github.com/joaofbmaia) +Hardware: https://github.com/joaofbmaia/6macro + +Make example for this keyboard (after setting up your build environment): + + make handwired/6macro:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/6macro/rules.mk b/keyboards/handwired/6macro/rules.mk new file mode 100644 index 00000000000..fc886fb9afa --- /dev/null +++ b/keyboards/handwired/6macro/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u2 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +#RGB_MATRIX_ENABLE = WS2812 # Enable per-key coordinate based RGB effects. Do not enable with RGBlight (+8500) +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/handwired/CMD60/CMD60.c b/keyboards/handwired/CMD60/CMD60.c deleted file mode 100644 index 799848e34e9..00000000000 --- a/keyboards/handwired/CMD60/CMD60.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "CMD60.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} diff --git a/keyboards/handwired/CMD60/CMD60.h b/keyboards/handwired/CMD60/CMD60.h deleted file mode 100644 index f90871fc715..00000000000 --- a/keyboards/handwired/CMD60/CMD60.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CMD60_H -#define CMD60_H - -#include "quantum.h" - -#define KEYMAP( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K45, K4A, K4B, K4C, K4D \ - ) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO,K4A, K4B, K4C, K4D } \ -} - -#endif \ No newline at end of file diff --git a/keyboards/handwired/CMD60/README.md b/keyboards/handwired/CMD60/README.md deleted file mode 100644 index 8b0dd109f65..00000000000 --- a/keyboards/handwired/CMD60/README.md +++ /dev/null @@ -1,35 +0,0 @@ -CMD60 keyboard firmware -====================== - -##CMD60 - -This layout has been designed to optimize use of the left-hand, and it focussed specifically on programmers who work -with text editors like SublimeText and Atom. It utilizes the power of Space_fn, and features a caps lock swap for Fn2 -and enter key on tap. These features allow you to keep your right hand on the mouse more and should enable you to -achieve a higher level of productivity if you take the time to learn its function layers. - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/docs/README.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/handwired/CMD60 folder. -Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use -the Teensy Loader to program your .hex file. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default - -To build with the default keymap, simply run `make`. - -### Other Keymaps - -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: - -``` -$ make keymap=[default|jack|] -``` - -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` diff --git a/keyboards/handwired/CMD60/config.h b/keyboards/handwired/CMD60/config.h deleted file mode 100644 index 27eb400b878..00000000000 --- a/keyboards/handwired/CMD60/config.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER cmd -#define PRODUCT CMD60 -#define DESCRIPTION Advanced Programming Keeb Layout - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { F0, F4, F5, F6, F7 } -#define MATRIX_COL_PINS { B0, B1, B2, B3, B7, D0, D1, D2, D3, C6, D7, B4, B5, B6 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/handwired/CMD60/keymaps/default/keymap.c b/keyboards/handwired/CMD60/keymaps/default/keymap.c deleted file mode 100644 index 9f9cbcd6613..00000000000 --- a/keyboards/handwired/CMD60/keymaps/default/keymap.c +++ /dev/null @@ -1,66 +0,0 @@ -#include "CMD60.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( /* CMD60 - QWERTY */ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - LT(3, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_NO, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, LT(2, KC_SPC), MO(3), MO(4), MO(5), TG(1) \ - ), - [1] = KEYMAP( /* CMD60 - GameMode */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_RSFT, \ - KC_TRNS, KC_NO, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - [2] = KEYMAP( /* CMD60 - Arrows */ - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_TRNS, KC_BSPC, KC_UP, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - [3] = KEYMAP( /* CMD60 - Functions */ - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_AUDIO_MUTE, KC_BSPC, KC_PGUP, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_PAUSE, KC_SLCK, KC_PSCREEN, \ - KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_INSERT, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - [4] = KEYMAP( /* CMD60 - Mouse */ - KC_SYSTEM_SLEEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_TRNS, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_WH_UP, KC_MS_BTN3, KC_MS_WH_DOWN, KC_NO, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - [5] = KEYMAP( /* CMD60 - Media */ - KC_SYSTEM_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MEDIA_PREV_TRACK, KC_MEDIA_NEXT_TRACK, KC_MEDIA_PLAY_PAUSE, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WWW_BACK, KC_WWW_FORWARD, KC_NO, KC_NO, KC_WWW_REFRESH, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c deleted file mode 100644 index 64982fb62df..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c +++ /dev/null @@ -1 +0,0 @@ -#include "MS_sculpt_mobile.h" diff --git a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h deleted file mode 100644 index 1583dea6e88..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef MICROSOFT_SCULPT_MOBILE_H -#define MICROSOFT_SCULPT_MOBILE_H - -#include "quantum.h" - - -#define KEYMAP( \ - k7Q, k6O, k6P, k6Q, k5O, k5P, k5Q, k7A, k7B, k7C, k7D, k7E, k7F, k1O, k1K, k1L, \ - k5A, k5K, k5L, k5M, k5N, k5H, k5I, k2A, k2B, k2C, k2D, k5B, k5C, k5J, k2E, \ - k6R, k6D, k6E, k6F, k7I, k7J, k4A, k4B, k4C, k4D, k3A, k3B, k3C, k3D, \ - k0J, k6A, k6B, k6C, k7H, k1A, k1B, k5D, k5E, k5F, k5G, k1C, k7P, k2G, \ - k2P, k7K, k7L, k7M, k7O, k0A, k0B, k0C, k0D, k0E, k0F, k2L, k6G, k1P,\ - k1Q, k4N, k3O,k6N, k3K, k0R, k1M, k6H, k6I, k6J \ -) \ -{ \ - {k0A, k0B, k0C, k0D, k0E, k0F, KC_NO, KC_NO, KC_NO, k0J, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, k0R},\ - {k1A, k1B, k1C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k1K, k1L, k1M, KC_NO, k1O, k1P, k1Q, KC_NO},\ - {k2A, k2B, k2C, k2D, k2E, KC_NO, k2G, KC_NO, KC_NO, KC_NO, KC_NO, k2L, KC_NO, KC_NO, KC_NO, k2P, KC_NO, KC_NO},\ - {k3A, k3B, k3C, k3D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k3K, KC_NO, KC_NO, KC_NO, k3O, KC_NO, KC_NO, KC_NO},\ - {k4A, k4B, k4C, k4D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k4N, KC_NO,KC_NO, KC_NO, KC_NO},\ - {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q, KC_NO },\ - {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6J, KC_NO, KC_NO, KC_NO, k6N, k6O, k6P, k6Q, k6R},\ - {k7A, k7B, k7C, k7D, k7E, k7F, KC_NO, k7H, k7I, k7J, k7K, k7L, k7M, KC_NO, k7O, k7P, k7Q, KC_NO},\ -} - - -#define MATRIX_TESTING_KEYMAP( \ - k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q,\ - k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q,\ - k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q,\ - k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q,\ - k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q,\ - k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q,\ - k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q,\ - k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q\ -) \ -{ \ - {k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q},\ - {k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q},\ - {k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q},\ - {k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q},\ - {k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q},\ - {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q},\ - {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q},\ - {k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q},\ -} - -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.c b/keyboards/handwired/MS_sculpt_mobile/babblePaste.c deleted file mode 100644 index 22394cc7d2d..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/babblePaste.c +++ /dev/null @@ -1,460 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c -*/ - -#include "../MS_sculpt_mobile/babblePaste.h" - -#include "action_macro.h" - -#ifdef USE_BABLPASTE - -// GLOBAL variable to determine mode. Sets startup default if no eeppom -uint8_t babble_mode =0 ; - -// small function that we might also want to call from a keymap. - -macro_t* switch_babble_mode( uint8_t id) { - babble_mode= id; - return MACRO_NONE; //less typing where called -} - - -// Today I learned that the preprocessor can not create a switch statement label from an argument -// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 -#define BABLM(ent, macro...) \ - if ( ent == shortcut ) \ - { action_macro_play( MACRO(macro)); return MACRO_NONE; } - - -/* this function runs the appropriate babblepaste macro, given -the global babble_mode, and a shortcut from the ENUM in babblePaste.h -TODO, the pointers in this function should be stored in a PROGMEM array, not ram. -But that requires even more clever preprocessor foo. -*/ -const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) { -/* - if ( shortcut < BABL_START_NUM || \ - shortcut >= (BABL_START_NUM + BABL_NUM_MACROS ) ) { - return MACRO_NONE; - } -*/ - - -#ifdef MS_MODE - if ( BABL_WINDOWS == shortcut ) { return switch_babble_mode(MS_MODE); } -#endif -#ifdef MAC_MODE - if ( BABL_MAC == shortcut) { return switch_babble_mode(MAC_MODE); } -#endif -#ifdef LINUX_MODE - if ( BABL_LINUX == shortcut ) { return switch_babble_mode(LINUX_MODE); } -#endif - #ifdef READMUX_MODE - if ( BABL_READLINE == shortcut ) { switch_babble_mode(READMUX_MODE); return MACRO_NONE; } -#endif -#ifdef VI_MODE - if ( BABL_VI == shortcut ) { return switch_babble_mode(VI_MODE); } -#endif -#ifdef EMACS_MODE - if ( BABL_EMACS == shortcut ) { return switch_babble_mode(EMACS_MODE); } -#endif - - - - switch(babble_mode) { - -#ifdef MS_MODE - - case MS_MODE: - BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD, D(LCTL), T(LEFT), U(LCTL), END ); - BABLM( BABL_GO_RIGHT_WORD, D(LCTL), T(RIGHT), U(LCTL), END ); - BABLM( BABL_GO_START_LINE, T(HOME), END ); - BABLM( BABL_GO_END_LINE, T(END), END ); - BABLM( BABL_GO_START_DOC, D(LCTL),T(HOME), U(LCTL),END ); - BABLM( BABL_GO_END_DOC, D(LCTL),T(END), U(LCTL),END ); - BABLM( BABL_GO_NEXT_LINE, T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE, T(UP), END ); - BABLM( BABL_PGDN, T(PGDN), END ); - BABLM( BABL_PGUP, T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C, T(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD, D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD, D(LCTL), T(DEL), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); - BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO, D(LCTL), T(Z), U(LCTL), END ); - BABLM( BABL_REDO, D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_CUT, D(LCTL), T(X), U(LCTL), END ); - BABLM( BABL_COPY, D(LCTL), T(C), U(LCTL), END ); - BABLM( BABL_PASTE, D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); - BABLM( BABL_FIND_NEXT, T(F3),END ); - BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); - BABLM( BABL_RUNAPP, D(LGUI),T(R), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_NEXT, D(LALT),T(TAB), U(LALT),END ); - BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LALT),T(TAB), U(LALT), U(LSFT),END ); - BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); - BABLM( BABL_HELP, T(F1),END ); -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); - BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); - BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); - BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LCTL),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), D(RSFT), T(EQL), U(RSFT), U(LCTL),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); -#endif -#endif - - // Todo, ring bell, flash light, show user this isn't supported - return MACRO_NONE; - - -#endif /* MS_MODE*/ - - -#ifdef LINUX_MODE - - case LINUX_MODE: - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LCTL), T(LEFT), U(LCTL), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LCTL), T(RIGHT), U(LCTL), END ); - BABLM( BABL_GO_START_LINE , T(HOME), END ); - BABLM( BABL_GO_END_LINE , T(END), END ); - BABLM( BABL_GO_START_DOC , D(LCTL),T(HOME), U(LCTL),END ); - BABLM( BABL_GO_END_DOC , D(LCTL),T(END), U(LCTL),END ); - BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE , T(UP), END ); - BABLM( BABL_PGDN , T(PGDN), END ); - BABLM( BABL_PGUP , T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LCTL), T(DEL), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); - BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LCTL), T(Z), U(LCTL), END ); - BABLM( BABL_REDO , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_CUT , D(LCTL), T(X), U(LCTL), END ); - BABLM( BABL_COPY , D(LCTL), T(C), U(LCTL), END ); - BABLM( BABL_PASTE , D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); - /* BABLM(BABL_FIND_NEXT , T(F3),END ); KDE */ - BABLM( BABL_FIND_NEXT, D(LCTL),T(G), U(LCTL),END ); // Gnome*/ - /* BABLM( , D(LCTL),T(R), U(LCTL),END ); KDE */ - BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); // Gnome*/ - BABLM( BABL_RUNAPP, D(LALT),T(F2), U(LALT),END ); - BABLM( BABL_SWITCH_APP_NEXT, D(LCTL),T(TAB), U(LCTL),END ); - BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LCTL),T(TAB), U(LCTL), U(LSFT),END ); - BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); - //BABLM( BABL_HELP, END ); - -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); - BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); - BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); - BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), T(PLUS), U(LCTL),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); -#endif -#endif - return MACRO_NONE; - -#endif - -#ifdef MAC_MODE - - case MAC_MODE: - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LALT), T(LEFT), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(RIGHT), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LGUI), T(LEFT), U(LGUI), END ); - BABLM( BABL_GO_END_LINE , D(LGUI), T(RIGHT), U(LGUI), END ); - BABLM( BABL_GO_START_DOC , D(LGUI),T(UP), U(LGUI),END ); - BABLM( BABL_GO_END_DOC , D(LGUI),T(DOWN), U(LGUI),END ); - BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE , T(UP), END ); - BABLM( BABL_PGDN , D(LALT),T(DOWN), U(LALT), END ); - BABLM( BABL_PGUP , D(LALT),T(UP), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD , D(LALT), T(BSPACE), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_WORD, D(LALT), T(DEL), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END );// there must be another way - BABLM( BABL_DEL_TO_LINE_START, D(LGUI), T(BSPACE), U(LGUI), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(1), D(LGUI), T(Z), U(LGUI), END ); - BABLM( BABL_REDO , D(LSFT),D(LGUI), T(Z), U(LSFT),U(LGUI), END ); - BABLM( BABL_CUT , D(LGUI), T(X), U(LGUI), END ); - BABLM( BABL_COPY , D(LGUI), T(C), U(LGUI), END ); - BABLM( BABL_PASTE , D(LGUI), T(V), U(LGUI), END ); - BABLM( BABL_SELECT_ALL , D(LGUI), T(A), U(LGUI), END ); - BABLM( BABL_FIND , D(LGUI),T(F), U(LGUI),END ); - BABLM( BABL_FIND_NEXT, D(LGUI),T(G), U(LGUI),END ); - BABLM( BABL_FIND_REPLACE, D(LGUI),T(F), U(LGUI),END ); - BABLM( BABL_RUNAPP , D(LGUI),T(R), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_NEXT , D(LGUI),T(TAB), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_LAST , D(LSFT),D(LGUI),T(TAB), U(LGUI), U(LSFT),END ); - BABLM( BABL_CLOSE_APP , D(LGUI),T(Q), U(LGUI),END ); - BABLM( BABL_HELP , D(LSFT),D(LGUI),T(SLASH), U(LGUI), U(LSFT),END ); - -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -#endif -#endif - - return MACRO_NONE; -#endif - -#ifdef EMACS_MODE - - case EMACS_MODE: - switch(shortcut) { -//probably should allow meta to not be ALT - - BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD, D(LALT), T(B), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); - BABLM( BABL_GO_START_DOC , D(LALT), D(LSFT), T(COMM),U(LSFT), U(LALT) ,END ); - BABLM( BABL_GO_END_DOC , D(LALT), D(LSFT), T(DOT), U(LSFT), U(LALT) ,END ); - BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); - BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); - BABLM( BABL_PGDN , D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_PGUP , D(LALT), T(V), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_1C, D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_START, T(ESC), T(0), D(LCTL), T(K), U(LCTL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LCTL), T(X), U(LCTL),T(C), END ); - BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably - BABLM( BABL_CUT , D(LCTL), T(W), U(LCTL), END ); - BABLM( BABL_COPY , D(LALT), T(W), U(LALT), END ); //really? - BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_SELECT_ALL ,D(LCTL), T(X), U(LCTL),T(H), END ); - BABLM( BABL_FIND , D(LCTL), T(S), U(LCTL),END ); - BABLM( BABL_FIND_NEXT , D(LCTL), T(S), U(LCTL),END ); - BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); - BABLM( BABL_RUNAPP , D(LALT), T(X), U(LALT),T(S),T(H),T(E),T(L),T(L),END );// arguably - BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(X), U(LCTL),T(RIGHT), END ); // arguably - BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(X), U(LCTL),T(LEFT), END ); // arguably - BABLM( BABL_CLOSE_APP , D(LCTL), T(X), U(LCTL),T(C),END ); - BABLM( BABL_HELP , D(LCTL),T(H), U(LCTL),T(A),END); // start search in help -#ifndef BABL_NOBROWSER -/* you get to figure w3 out - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - break; - - return MACRO_NONE; - } - -#endif - - -#ifdef VI_MODE - case VI_MODE: -// you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) - - - BABLM( BABL_GO_LEFT_1C , T(H), END ); - BABLM( BABL_GO_RIGHT_1C , T(L), END ); - BABLM( BABL_GO_LEFT_WORD , T(B),END ); - BABLM( BABL_GO_RIGHT_WORD , T(W), END ); - BABLM( BABL_GO_START_LINE , D(LSFT), T(6),U(LSFT), END ); //^ - BABLM( BABL_GO_END_LINE , D(LSFT), T(4),U(LSFT) , END ); //$ - BABLM( BABL_GO_START_DOC , T(G),T(G) ,END ); - BABLM( BABL_GO_END_DOC , D(LSFT), T(G),U(LSFT),END ); - BABLM( BABL_GO_NEXT_LINE , T(J), END ); - BABLM( BABL_GO_PREV_LINE, T(K), END ); - BABLM( BABL_PGDN ,D(LCTL), T(F), U(LCTL), END ); - BABLM( BABL_PGUP , D(LCTL), T(B), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_1C , T(X),END ); - BABLM( BABL_DEL_LEFT_WORD , T(D),T(G),T(E),END ); - BABLM( BABL_DEL_RIGHT_WORD , T(D),T(W),END ); - BABLM( BABL_DEL_TO_LINE_END, T(D),D(LSFT), T(4),U(LSFT) ,END ); // d$ - BABLM( BABL_DEL_TO_LINE_START, T(D),D(LSFT), T(6),U(LSFT) ,END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , T(U), END ); - BABLM( BABL_REDO , D(LCTL), T(R), U(LCTL), END ); - BABLM( BABL_CUT , T(X), END ); - BABLM( BABL_COPY , T(Y),END ); - BABLM( BABL_PASTE , T(P), END ); - BABLM( BABL_SELECT_ALL , D(LSFT), T(SCLN),U(LSFT),D(LSFT), T(5),U(LSFT),T(Y), END ); // wrong but helpful? - BABLM( BABL_FIND , T(SLASH),END ); - BABLM( BABL_FIND_NEXT , T(N),END ); - BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); - BABLM( BABL_RUNAPP,END ); - BABLM( BABL_SWITCH_APP_NEXT ,END ); - BABLM( BABL_SWITCH_APP_LAST ,END ); - BABLM(BABL_CLOSE_APP, D(LSFT), T(SCLN),U(LSFT), T(Q), D(RSFT), T(1),U(RSFT), END ); - BABLM(BABL_HELP, D(LSFT), T(SCLN),U(LSFT),T(H),END); // start search in help -#ifndef BABL_NOBROWSER -/* you get to figure this out - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - return MACRO_NONE; -#endif - - - - -#ifdef READMUX_MODE -// Readline command line editing + tmux windowing -// I havent decided how much to do readline and how much tmux - - - case READMUX_MODE: - - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LALT), T(B), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); - //BABLM( BABL_GO_START_DOC ,END );// tmux? - //BABLM( BABL_GO_END_DOC ,END ); // tmux? - BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); - BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); - BABLM( BABL_PGDN , T(PGDN), END ); - BABLM( BABL_PGUP , T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C , D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(W), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_START, D(LCTL), T(U), U(LCTL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LALT), T(R), U(LALT) , END ); - BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably - BABLM( BABL_CUT , D(LCTL), T(K), U(LCTL), END ); // wrong half the time - //BABLM( BABL_COPY ,END ); - BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_SELECT_ALL , D(LCTL), T(A), T(K), T(Y), U(LCTL) , END ); - BABLM( BABL_FIND , D(LCTL), T(R), U(LCTL), END ); // search history - BABLM(BABL_FIND_NEXT, D(LCTL), T(S), U(LCTL), END ); - //BABLM( BABL_FIND_REPLACE ,END ); - BABLM( BABL_RUNAPP , D(LCTL), T(B), U(LCTL), T(C),END ); //tmux - BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(B), U(LCTL), T(N),END ); //tmux - BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(B), U(LCTL), T(P),END ); //tmux - BABLM( BABL_CLOSE_APP , D(LCTL), T(B), U(LCTL), T(D),END); // usually what I want - // BABLM( BABL_HELP ,END ); -#ifndef BABL_NOBROWSER -/* Add lynx shortcuts? - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - - return MACRO_NONE; - -#endif - - default: - return MACRO_NONE; - } - -} - - -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.h b/keyboards/handwired/MS_sculpt_mobile/babblePaste.h deleted file mode 100644 index cedd7d92bac..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/babblePaste.h +++ /dev/null @@ -1,238 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. - -Setting the bable_mode is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and jeebak & algernon's keymap -*/ -#ifndef _babblePaste_h_included__ -#define _babblePaste_h_included__ -#include "../MS_sculpt_mobile/config.h" -#include "action_layer.h" -#include "quantum_keycodes.h" - -#ifdef USE_BABLPASTE - -/* *************************** - -// Uncomment any modes you want. Whatever mode = 0 will be the default on boot -// Expect to get errors if you comment a feature out and leave it in your keymap. - -#define USE_BABLPASTE - -//#define MS_MODE 0 // Windows. -//#define MAC_MODE 1 -//#define LINUX_MODE 2 //aka gnome+KDE -//#define EMACS_MODE 3 -//#define VI_MODE 4 -//#define WORDSTAR_MODE 5 -//#define READMUX 6 // Readline and tmux - -// This removes everything but cursor movement -//#define BABL_MOVEMENTONLY -// and this just removes browser shortcuts -//#define BABL_NOBROWSER -****************************/ - - -// Uncomment if you need more free flash space -// It removes everything but cursor movement -//#define BABL_MOVEMENTONLY - - -// Define starting number for BABL macros in the macro range. -// Probably can start the default even lower -#define BABL_START_NUM 50 - -/* Macros handled by babblepaste. Most should be available for all platforms. -Whatever isn't defined will NOP */ -enum { -// Movement macros - // left & right - BABL_GO_LEFT_1C= BABL_START_NUM, - BABL_GO_RIGHT_1C, - BABL_GO_LEFT_WORD, - BABL_GO_RIGHT_WORD, - BABL_GO_START_LINE, - BABL_GO_END_LINE, - // now up & down - BABL_GO_START_DOC, - BABL_GO_END_DOC, - BABL_GO_NEXT_LINE, - BABL_GO_PREV_LINE, - BABL_PGDN, - BABL_PGUP, - // And the delete options - //BABL_DEL_LEFT_1C == backspace, so why bother. - BABL_DEL_RIGHT_1C, // usually = Del - BABL_DEL_LEFT_WORD, - BABL_DEL_RIGHT_WORD, - BABL_DEL_TO_LINE_END, // delete from cursor to end of line - BABL_DEL_TO_LINE_START, // delete from cursor to begining line -#ifndef BABL_MOVEMENTONLY - // Cut & Paste - BABL_UNDO, - BABL_REDO, - BABL_CUT, - BABL_COPY, - BABL_PASTE, - BABL_SELECT_ALL, - /* not yet implemented - BABL_SWAP_LAST2C // swap last characters before the cursor - BABL_SWAP_LAST2W // Swap the last two words before the cursor - */ - // find & replace - BABL_FIND, - BABL_FIND_NEXT, - BABL_FIND_REPLACE, - // GUI or app - BABL_RUNAPP, - BABL_SWITCH_APP_NEXT, - BABL_SWITCH_APP_LAST, // previous - BABL_CLOSE_APP, - BABL_HELP, - -#ifndef BABL_NOBROWSER - BABL_BROWSER_NEW_TAB, - BABL_BROWSER_CLOSE_TAB, - BABL_BROWSER_REOPEN_LAST_TAB, - BABL_BROWSER_NEXT_TAB, - BABL_BROWSER_PREV_TAB, - BABL_BROWSER_URL_BAR, - BABL_BROWSER_FORWARD, - BABL_BROWSER_BACK, - BABL_BROWSER_FIND, - BABL_BROWSER_BOOKMARK, - BABL_BROWSER_DEV_TOOLS, // hard one to remember - BABL_BROWSER_RELOAD, - BABL_BROWSER_FULLSCREEN, - BABL_BROWSER_ZOOM_IN, - BABL_BROWSER_ZOOM_OUT, - -#endif - -#endif -// Macros for mode switching -#ifdef MS_MODE - BABL_WINDOWS, -#endif -#ifdef MAC_MODE - BABL_MAC, -#endif -#ifdef LINUX_MODE - BABL_LINUX, -#endif -#ifdef EMACS_MODE - BABL_EMACS, -#endif -#ifdef VI_MODE - BABL_VI, -#endif -#ifdef READMUX_MODE - BABL_READLINE, -#endif - - -}; - -// BUG, used to jump to babble functiion. Surely there is a way to calculate size of enum? -#define BABL_NUM_MACROS 48+4 // 48 + # of defined modes. - -/* And all the shorthand keymap ready versions */ -// First the mode switching macros -#ifdef MS_MODE -#define B_WIN M(BABL_WINDOWS) -#endif -#ifdef MAC_MODE -#define B_MAC M(BABL_MAC) -#endif -#ifdef LINUX_MODE -#define B_LNX M(BABL_LINUX) -#endif -#ifdef EMACS_MODE -#define B_EMAX M(BABL_EMACS) -#endif -#ifdef VI_MODE -#define B_VI M(BABL_VI) -#endif -#ifdef READMUX_MODE -#define B_READ M(BABL_READLINE) -#endif - -// and all the movement & action. - -#define B_L1C M(BABL_GO_LEFT_1C) -#define B_R1C M(BABL_GO_RIGHT_1C) -#define B_L1W M(BABL_GO_LEFT_WORD) -#define B_R1W M(BABL_GO_RIGHT_WORD) -#define B_GSOL M(BABL_GO_START_LINE) -#define B_GEOL M(BABL_GO_END_LINE) -#define B_GTOP M(BABL_GO_START_DOC) -#define B_GEND M(BABL_GO_END_DOC) -#define B_DOWN M(BABL_GO_NEXT_LINE) -#define B_UP M(BABL_GO_PREV_LINE) -#define B_PGDN M(BABL_PGDN) -#define B_PGUP M(BABL_PGUP) -//#define B_BKSP M(BABL_DEL_LEFT_1C) == backspace so why bother. -#define B_DEL M(BABL_DEL_RIGHT_1C) // usually = Del -#define B_DLW M(BABL_DEL_LEFT_WORD) -#define B_DRW M(BABL_DEL_RIGHT_WORD) -#define B_DEOL M(BABL_DEL_TO_LINE_END) // delete from cursor to end of line -#define B_DSOL M(BABL_DEL_TO_LINE_START) // delete from cursor to begining line -#define B_UNDO M(BABL_UNDO) -#define B_REDO M(BABL_REDO) -#define B_CUT M(BABL_CUT) -#define B_COPY M(BABL_COPY) -#define B_PAST M(BABL_PASTE) -#define B_SELA M(BABL_SELECT_ALL) -#define B_FIND M(BABL_FIND) -#define B_FINDN M(BABL_FIND_NEXT) -#define B_FINDR M(BABL_FIND_REPLACE) -#define B_RAPP M(BABL_RUNAPP) -#define B_NAPP M(BABL_SWITCH_APP_NEXT) -#define B_PAPP M(BABL_SWITCH_APP_LAST) // previous -#define B_CAPP M(BABL_CLOSE_APP) -#define B_HELP M(BABL_HELP) -#define B_NTAB M(BABL_BROWSER_NEW_TAB) -#define B_CTAB M(BABL_BROWSER_CLOSE_TAB) -#define B_ROTB M(BABL_BROWSER_REOPEN_LAST_TAB) -#define B_NXTB M(BABL_BROWSER_NEXT_TAB) -#define B_PTAB M(BABL_BROWSER_PREV_TAB) -#define B_NURL M(BABL_BROWSER_URL_BAR) -#define B_BFWD M(BABL_BROWSER_FORWARD) -#define B_BBAK M(BABL_BROWSER_BACK) -#define B_BFND M(BABL_BROWSER_FIND) -#define B_BOOK M(BABL_BROWSER_BOOKMARK) -#define B_BDEV M(BABL_BROWSER_DEV_TOOLS) // hard one to remember -#define B_BRLD M(BABL_BROWSER_RELOAD) -#define B_BFUlL M(BABL_BROWSER_FULLSCREEN) -#define B_ZMIN M(BABL_BROWSER_ZOOM_IN) -#define B_ZMOT M(BABL_BROWSER_ZOOM_OUT) - - - - - - - -/* from action_macro.h -typedef uint8_t macro_t; - -#define MACRO_NONE (macro_t*)0 -#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; }) -#define MACRO_GET(p) pgm_read_byte(p) - -#define BABL_MSTART (entry, os, macro...) ( const macro_t bablDict[entry][os] PROGMEM = { macro... }; ) - -*/ - -const macro_t *babblePaste(keyrecord_t *record, uint8_t shortcut); - -macro_t* switch_babble_mode( uint8_t id); - - -#endif -#endif - diff --git a/keyboards/handwired/MS_sculpt_mobile/config.h b/keyboards/handwired/MS_sculpt_mobile/config.h deleted file mode 100644 index c3bdf333e26..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/config.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Microsoftplus -#define DESCRIPTION 6000 - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 18 - -#ifdef ASTAR -#define PRODUCT sculpt mobile astar - /*0 1 2 3 4 5 6 7 8 */ -#define MATRIX_ROW_PINS {D7, C6, D4, D0, D1, D3, D2, E2} -/* A B C D E F G H I J K L M N O P Q R */ -#define MATRIX_COL_PINS {B4, B5, E6, B7, B6, D6, C7, F7, F6, F4,F5, F1,F0, D5, B0, B1, B2, B3} - -#else -#define PRODUCT sculpt mobile teensypp -/* 0 1 2 3 4 5 6 7 */ -#define MATRIX_ROW_PINS { F7,F6,F4,F5,F3,F2,F1,F0} -/* A B C D E F G H I J K L M N O P Q R */ -#define MATRIX_COL_PINS { B7, D0, D1, D2, D3, D4, D5, D6, D7, E0,E1,C1, C0, C3, C2, C5, C4,C7} -#define UNUSED_PINS { B6,B5,B4,B3,B2,B1,B0 } - - -#endif - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION ROW2COL - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h deleted file mode 100644 index 4f3a425b7e8..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../../MS_sculpt_mobile/config.h" - -// place overrides here - -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c deleted file mode 100644 index a8802c99a41..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "../../MS_sculpt_mobile.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|Mute| -* -------------------------------------------------------------------------------' -* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del | -* -------------------------------------------------------------------------- -* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* | caps | a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space |Ralt | FN | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[0] = KEYMAP( \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_VOLU, KC_MUTE,\ - KC_GRAVE, KC_1, KC_2, KC_3 ,KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_DEL,\ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,\ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,\ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,\ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, RSFT(KC_1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT -) - -}; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md deleted file mode 100644 index e67ddc6fecc..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for microsoft-sculpt-mobile diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h deleted file mode 100644 index 5c04f647c30..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../../MS_sculpt_mobile/config.h" - -#define USE_BABLPASTE - -// Expect to get errors if you comment a feature out and leave it in your keymap. - -#ifdef USE_BABLPASTE -//define BabblePaste maps -// Windows. -#define MAC_MODE 0 -#define MS_MODE 1 -//aka gnome+KDE -//#define LINUX_MODE 2 -//#define EMACS_MODE 3 -#define VI_MODE 3 -// Readline and tmux -#define READMUX_MODE 2 -//#define WORDSTAR_MODE 5 -#endif - -// Uncomment if you need more free flash space - -// This removes everything but cursor movement -//#define BABL_MOVEMENTONLY -// and this just removes browser shortcuts -//#define BABL_NOBROWSER - -// place overrides here -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c deleted file mode 100644 index c9b16e75e5f..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c +++ /dev/null @@ -1,272 +0,0 @@ -#include "../../../MS_sculpt_mobile/babblePaste.h" -#include "../../MS_sculpt_mobile.h" -#include "action_layer.h" -#include "action_util.h" - -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif - -#define _QWR 0 -#define _CDH 2 -#define _SYM 3 -#define _MOV 4 -#define _TRAN 5 - - -enum layer_keycodes { -QWR, -CDH, -SYM, -MOV, -NUM, -TRAN -}; - - -// Shorter spacing -#define XXXX KC_NO -#define ____ KC_TRNS - -// Custom macros - -/* Fn Keys */ -#define TT_SYM MO(_SYM) -#define TT_MOV KC_FN2 -#define TT_NUM MO(_NUM) -#define SSFT ACTION_MODS_ONESHOT(MOD_LSFT) - -enum macro_keycodes { -DHPASTE=1, -VIBRK, -}; - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* QWERTY -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| -* -------------------------------------------------------------------------------' -* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| -* --------------------------------------------------------------------------- -* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_QWR] = KEYMAP( \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_VOLU, CDH,\ - KC_ESC, KC_1, KC_2, KC_3 ,KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_DEL,\ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,\ - TT_MOV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,\ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH,KC_RSFT, KC_UP, KC_PGDN,\ - KC_LCTL, KC_LGUI, KC_LALT, KC_FN1, KC_RGUI,TT_SYM,KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT -), - -[_CDH] = KEYMAP (\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, QWR, \ - KC_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, ____, ____, ____,\ - TT_MOV, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_2,\ - KC_LSFT, KC_Z, KC_X, KC_C, M(DHPASTE), KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, ____, KC_1,\ - ____, ____, ____ , KC_FN1, ____, ____, ____, ____, ____, ____ - -), - - -/* SYM -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| -* -------------------------------------------------------------------------------' -* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace|Del | -* -------------------------------------------------------------------------- -* | ESC: | ^ | { | } | @ | % | | [ | ( | ) | _ | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| ! | # | 0 | = | { | } | - | 1 | + | ] | ` | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | ; | ~ | : | ~ | "|"| $ | * | | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_SYM] = KEYMAP (\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - M(VIBRK), KC_CIRC, KC_LCBR, KC_RCBR,KC_AT, KC_PERC, ____, KC_LBRC,KC_LPRN,KC_RPRN,KC_UNDS, ____, ____, ____,\ - ____, KC_EXLM, KC_HASH, KC_0, KC_EQL, KC_LCBR, KC_RCBR,KC_MINS,KC_1, KC_PLUS,KC_RBRC, KC_GRV, ____, ____,\ - ____, KC_SCLN, KC_TILDE, KC_COLN, KC_TILDE, KC_PIPE, KC_DLR, KC_ASTR, ____, KC_DOT , KC_SLSH, ____, ____, ____,\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -), -/* -* |ESC | MAC| Win|RdLn| VI | | | | | | | | | | | | -* -------------------------------------------------------------------------------' -* | | | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| -* --------------------------------------------------------------------------- -* | tab | | |Find| |pTab |DSOL|DelW| Up |DelW|DEOL| [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| | | | |nTab |GSOL| <- | Dwn | -> | EOL | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft |Undo| Cut|Copy|Pste| | | | | | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_MOV] = KEYMAP (\ - ____, B_MAC,B_WIN,B_READ, B_VI, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, B_PAPP, B_NAPP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, B_UNDO, ____, B_BFND, ____, B_PTAB, B_DSOL, B_DLW, B_UP, B_DRW, B_DEOL, ____, ____, ____, \ - ____, B_SELA, B_BRLD, ____, ____, B_NXTB, B_GSOL, B_L1C, B_DOWN, B_R1C,B_GEOL, ____, ____, ____,\ - ____, B_UNDO,B_CUT, B_COPY, B_PAST, B_PAST, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -), - -[_TRAN] = KEYMAP (\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -) -}; - -const uint16_t PROGMEM fn_actions[] = { -[1] = ACTION_LAYER_TAP_KEY(_SYM,KC_SPACE), -[2] = ACTION_LAYER_TAP_KEY(_MOV,KC_BSPC) -}; - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWR: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - layer_off(_CDH); - } - return false; - break; - - case CDH: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - layer_on(_CDH); - } - return false; - break; - - case SYM: - if (record->event.pressed) { - layer_on(_SYM); - } else { - layer_off(_SYM); - } - return false; - break; - - } - return true; - -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - -/* If id is in the range of BABL macros, call the babl function */ -/* Any clever remapping with modifiers should happen here e.g. shift bablkey does opposite*/ -#ifdef USE_BABLPASTE - - if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { - if (record->event.pressed) { // is there a case where this isn't desired? - - babblePaste ( record, id ); - return MACRO_NONE; - } - } -#endif - - - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - - /* Colemak mod-dh moves the D key to the qwerty V position - This hack makes apple-V_position do what I mean */ - case DHPASTE: - if(keyboard_report->mods & MOD_BIT(KC_LGUI) ) { - if (record->event.pressed) { - clear_keyboard_but_mods(); - register_code(KC_V); - } else { - unregister_code(KC_V); - } - } else { - if (record->event.pressed) { - register_code(KC_D); - } else { - unregister_code(KC_D); - } - } - break; - - case VIBRK: // vi esc: - if (record->event.pressed) { - return MACRO( T(ESC),D(LSFT),T(SCLN),U(LSFT), END ); - } - break; - - - - - default: - return MACRO_NONE; - } - - -return MACRO_NONE; -}; - - - - - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { - -} - - -void led_set_user(uint8_t usb_led) { - -} - - - - - - diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md deleted file mode 100644 index 96ee0e77a5c..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md +++ /dev/null @@ -1 +0,0 @@ -# A more programmer oriented keymap for microsoft-sculpt-mobile diff --git a/keyboards/handwired/MS_sculpt_mobile/readme.md b/keyboards/handwired/MS_sculpt_mobile/readme.md deleted file mode 100644 index d435b449fb0..00000000000 --- a/keyboards/handwired/MS_sculpt_mobile/readme.md +++ /dev/null @@ -1,58 +0,0 @@ - -This is a way to take a Microsoft ergonomic bluetooth keyboard, and make it -into a hard-wired keyboard running QMK. - -The keyboard is known under several different names: -Mobile Bluetooth 5000, Mobile 6000, Sculpt mobile, and Asus rebranded - -I had a stack of them,since they're cheap on ebay, travel well, and are just ergo enough. - -The ribbon cable is 1mm pitch, which is hard to hand solder. I bought a cheap set of -"pitch adapter" boards https://www.amazon.com/Double-Sided-0-4mm-1-0-Adapter-60mmx38mm/dp/B00OK42118 - -Cut the original ribbon cable sockets off the bluetooth board using a razor, they're hard to desolder. -They're also allow the cable to be inserted on top or bottom. - -If I was going to do it again, I'd make the MCU connection come out the top of the keyboard -and avoid the wires dangling out the bottom. - -As I was debugging the matrix, I started to get random failures. In desparation I tried a second MCU, -but had the same problems. It turns out that the ribbon cable connections can get worn. Shave a -half millimeter off the end of the ribbon cable & the errors go away. - -My method for discovering the matrix was to set up a KEYMAP macro that included all pins. -See MATRIX_TESTING_KEYMAP if you need it. Then set up a keymap that has all printable symbols -in the first 4 rows. test each key & record output. Then switch the printable symbols to the -bottom 4 rows & repeat. This was enough to show the matrix. - - -The full original keymap for the sculpt is - A B C D E F G H ---> -0 b n m , . / -1 g h " -2 7 8 9 0 Del PgUp -3 p [ ] \ -4 y u i o -5 ~ - += j k l ; 5 -6 a s d q w e, Up left -7 F7 F8 F9 F10 F11 F12 f - ------> I J K L M N O P Q R -0 Caps FN -1 Vol+ mute Rctl vol- pgdn LCTL -2 Rshift LShift -3 Ralt LAlt -4 LGUI -5 6 bakspc 1 2 3 4 F4 F5 F6 -6 Down right spc F1 F2 F3 tab -7 r t z x c v enter Esc - -This works with 18 cols + 8 rows on a Teensy++, or Arm based Teensy. - -The Astar mini has all pins exposed , so you can do 18x8 -If you want a speaker, LEDs &etc, you'll need to free up a pin. I recommend joining columns -R and L to the same pin. - -Building - add ASTAR=1 to the compile line or leave out for teensy2++ - - diff --git a/keyboards/handwired/arrow_pad/arrow_pad.h b/keyboards/handwired/arrow_pad/arrow_pad.h index 62882b9b54c..b93fd113f27 100644 --- a/keyboards/handwired/arrow_pad/arrow_pad.h +++ b/keyboards/handwired/arrow_pad/arrow_pad.h @@ -10,4 +10,34 @@ #include #include +// This is the 21-key keypad to 4x6 element matrix mapping +#define LAYOUT( \ + KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ + KM_NUM, KM_FSL, KM_AST, KM_MIN, \ + KM___7, KM___8, KM___9, KM_EQU, \ + KM___4, KM___5, KM___6, KM_PLS, \ + KM___1, KM___2, KM___3, ___ENT, \ + KM___0, _____0, KM_DOT, KM_ENT \ +) { \ + { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \ + { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \ + { KM___7, KM___8, KM___9, KM_EQU }, \ + { KM___4, KM___5, KM___6, KM_PLS }, \ + { KM___1, KM___2, KM___3, KC_NO }, \ + { KM___0, KC_NO, KM_DOT, KM_ENT } \ +} + +// This is the 21-key keypad to 2x11 element matrix mapping +#define LAYOUT_pad21( \ + KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ + KM_NUM, KM_FSL, KM_AST, KM_MIN, \ + KM___7, KM___8, KM___9, \ + KM___4, KM___5, KM___6, KM_PLS, \ + KM___1, KM___2, KM___3, \ + KM___0, KM_DOT, KM_ENT \ +) { \ + { KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \ + { KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \ +} + #endif diff --git a/keyboards/handwired/arrow_pad/config.h b/keyboards/handwired/arrow_pad/config.h index 3d8d8709a5e..abb600c51ce 100644 --- a/keyboards/handwired/arrow_pad/config.h +++ b/keyboards/handwired/arrow_pad/config.h @@ -52,7 +52,7 @@ along with this program. If not, see . #define DIODE_DIRECTION ROW2COL /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -98,11 +98,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/arrow_pad/info.json b/keyboards/handwired/arrow_pad/info.json new file mode 100644 index 00000000000..ad15e8e740e --- /dev/null +++ b/keyboards/handwired/arrow_pad/info.json @@ -0,0 +1,62 @@ +{ + "keyboard_name": "arrow_pad", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"KM_ESC", "x":0, "y":0}, + {"label":"KM_TAB", "x":1, "y":0}, + {"label":"KM_BSL", "x":2, "y":0}, + {"label":"KM_ARR", "x":3, "y":0}, + {"label":"KM_NUM", "x":0, "y":1}, + {"label":"KM_FSL", "x":1, "y":1}, + {"label":"KM_AST", "x":2, "y":1}, + {"label":"KM_MIN", "x":3, "y":1}, + {"label":"KM___7", "x":0, "y":2}, + {"label":"KM___8", "x":1, "y":2}, + {"label":"KM___9", "x":2, "y":2}, + {"label":"KM_EQU", "x":3, "y":2}, + {"label":"KM___4", "x":0, "y":3}, + {"label":"KM___5", "x":1, "y":3}, + {"label":"KM___6", "x":2, "y":3}, + {"label":"KM_PLS", "x":3, "y":3}, + {"label":"KM___1", "x":0, "y":4}, + {"label":"KM___2", "x":1, "y":4}, + {"label":"KM___3", "x":2, "y":4}, + {"label":"___ENT", "x":3, "y":4}, + {"label":"KM___0", "x":0, "y":5}, + {"label":"_____0", "x":1, "y":5}, + {"label":"KM_DOT", "x":2, "y":5}, + {"label":"KM_ENT", "x":3, "y":5} + ] + }, + "LAYOUT_pad21": { + "layout": [ + {"label":"KM_ESC", "x":0, "y":0}, + {"label":"KM_TAB", "x":1, "y":0}, + {"label":"KM_BSL", "x":2, "y":0}, + {"label":"KM_ARR", "x":3, "y":0}, + {"label":"KM_NUM", "x":0, "y":1}, + {"label":"KM_FSL", "x":1, "y":1}, + {"label":"KM_AST", "x":2, "y":1}, + {"label":"KM_MIN", "x":3, "y":1}, + {"label":"KM___7", "x":0, "y":2}, + {"label":"KM___8", "x":1, "y":2}, + {"label":"KM___9", "x":2, "y":2}, + {"label":"KM___4", "x":0, "y":3}, + {"label":"KM___5", "x":1, "y":3}, + {"label":"KM___6", "x":2, "y":3}, + {"label":"KM_PLS", "x":3, "y":2, "h":2}, + {"label":"KM___1", "x":0, "y":4}, + {"label":"KM___2", "x":1, "y":4}, + {"label":"KM___3", "x":2, "y":4}, + {"label":"KM___0", "x":0, "y":5, "w":2}, + {"label":"KM_DOT", "x":2, "y":5}, + {"label":"KM_ENT", "x":3, "y":4, "h":2} + ] + } + } +} diff --git a/keyboards/handwired/arrow_pad/keymaps/default/keymap.c b/keyboards/handwired/arrow_pad/keymaps/default/keymap.c index b5d3047081e..dd729c59a10 100644 --- a/keyboards/handwired/arrow_pad/keymaps/default/keymap.c +++ b/keyboards/handwired/arrow_pad/keymaps/default/keymap.c @@ -1,35 +1,18 @@ -#include "arrow_pad.h" +#include QMK_KEYBOARD_H #include "led.h" -// This is the 21-key keypad to 2x11 element matrix mapping -#define LAYOUT( \ - KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ - KM_NUM, KM_FSL, KM_AST, KM_MIN, \ - KM___7, KM___8, KM___9, KM_EQU, \ - KM___4, KM___5, KM___6, KM_PLS, \ - KM___1, KM___2, KM___3, ___ENT, \ - KM___0, _____0, KM_DOT, KM_ENT \ -) { \ - { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \ - { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \ - { KM___7, KM___8, KM___9, KM_EQU }, \ - { KM___4, KM___5, KM___6, KM_PLS }, \ - { KM___1, KM___2, KM___3, KC_NO }, \ - { KM___0, KC_NO, KM_DOT, KM_ENT } \ -} - -#define LAYER_BASE 0 -#define LAYER_EDIT 1 -#define LAYER_FUNCTION 2 - -#define MACRO_COPY_CUT 0 -#define MACRO_SHIFT_CONTROL 1 -#define MACRO_CONTROL_ALT 2 +enum layers { + LAYER_BASE, + LAYER_EDIT, + LAYER_FUNCTION +}; -#define M_COPY KC_FN5 -#define M_SHFCT KC_FN6 -#define M_CTALT KC_FN7 +enum custom_keycodes { + M_COPY = SAFE_RANGE, // KC_FN5: MACRO_COPY_CUT + M_SHFCT, // KC_FN6: MACRO_SHIFT_CONTROL + M_CTALT // KC_FN7: MACRO_CONTROL_ALT +}; #define SC_UNDO LCTL(KC_Z) #define SC_REDO LCTL(KC_Y) @@ -42,13 +25,10 @@ #define SC_ACLS LALT(KC_F4) #define SC_CCLS LCTL(KC_F4) -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_BASE] = LAYOUT( \ - KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ + KC_ESC, KC_TAB, KC_BSLS, MO(2), \ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ KC_P7, KC_P8, KC_P9, KC_PEQL, \ KC_P4, KC_P5, KC_P6, KC_PPLS, \ @@ -57,15 +37,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_EDIT] = LAYOUT( \ KC_ESC, KC_TAB, KC_SPC, _______, \ - KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ + TG(1), SC_PSTE, SC_REDO, SC_UNDO, \ KC_HOME, KC_UP, KC_PGUP, KC_LALT, \ KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \ KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ - KC_BSPC, KC_PENT, KC_DEL, M_SHFCT), + KC_BSPC, KC_PENT, KC_DEL, M_SHFCT ), [LAYER_FUNCTION] = LAYOUT( \ - KC_FN2, KC_FN3, KC_FN4, _______, \ - KC_FN1, _______, _______, _______, \ + BL_TOGG, BL_INC, BL_DEC, _______, \ + TG(1), _______, _______, _______, \ _______, _______, _______, _______, \ _______, _______, _______, _______, \ _______, _______, _______, XXXXXXX, \ @@ -74,68 +54,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), - [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), - [2] = ACTION_BACKLIGHT_TOGGLE(), - [3] = ACTION_BACKLIGHT_INCREASE(), - [4] = ACTION_BACKLIGHT_DECREASE(), - [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), - [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), - [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), - -}; - - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -} +bool process_record_user(uint16_t keycode, keyrecord_t * record) { + // MACRODOWN only works in this function + switch (keycode) { + + case M_COPY: + if (record->event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + case M_SHFCT: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) { - - case MACRO_COPY_CUT: - if (record->event.pressed) { - register_code(KC_LCTL); - if (record->tap.count == 1) { - register_code(KC_C); - unregister_code(KC_C); - } - else if (record->tap.count == 2) { - register_code(KC_X); - unregister_code(KC_X); - } - unregister_code(KC_LCTL); - } - break; - - case MACRO_SHIFT_CONTROL: - if (record->event.pressed) { - if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); - if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count == 3) register_code(KC_PENT);; - } - else { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); - unregister_code(KC_PENT); - } - break; - - case MACRO_CONTROL_ALT: - if (record->event.pressed) { - if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); - } - else { - unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); - } - break; + case M_CTALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); } + break; + } - return MACRO_NONE; + return true; } void led_set_user(uint8_t usb_led) diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_21/config.h b/keyboards/handwired/arrow_pad/keymaps/pad_21/config.h index a095e873743..0e471527dff 100644 --- a/keyboards/handwired/arrow_pad/keymaps/pad_21/config.h +++ b/keyboards/handwired/arrow_pad/keymaps/pad_21/config.h @@ -50,7 +50,7 @@ along with this program. If not, see . #define DIODE_DIRECTION ROW2COL /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -96,11 +96,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c b/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c index a29f9e10117..1692976357b 100644 --- a/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c +++ b/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c @@ -1,32 +1,18 @@ -#include "arrow_pad.h" +#include QMK_KEYBOARD_H #include "led.h" -// This is the 21-key keypad to 2x11 element matrix mapping -#define LAYOUT( \ - KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ - KM_NUM, KM_FSL, KM_AST, KM_MIN, \ - KM___7, KM___8, KM___9, ___PLS, \ - KM___4, KM___5, KM___6, KM_PLS, \ - KM___1, KM___2, KM___3, ___ENT, \ - KM___0, _____0, KM_DOT, KM_ENT \ -) { \ - { KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \ - { KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \ -} - - -#define LAYER_BASE 0 -#define LAYER_EDIT 1 -#define LAYER_FUNCTION 2 - -#define MACRO_COPY_CUT 0 -#define MACRO_SHIFT_CONTROL 1 -#define MACRO_CONTROL_ALT 2 +enum layers { + LAYER_BASE, + LAYER_EDIT, + LAYER_FUNCTION +}; -#define M_COPY KC_FN5 -#define M_SHFCT KC_FN6 -#define M_CTALT KC_FN7 +enum custom_keycodes { + M_COPY = SAFE_RANGE, // KC_FN5: MACRO_COPY_CUT + M_SHFCT, // KC_FN6: MACRO_SHIFT_CONTROL + M_CTALT // KC_FN7: MACRO_CONTROL_ALT +}; #define SC_UNDO LCTL(KC_Z) #define SC_REDO LCTL(KC_Y) @@ -39,100 +25,75 @@ #define SC_ACLS LALT(KC_F4) #define SC_CCLS LCTL(KC_F4) -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[LAYER_BASE] = LAYOUT( \ - KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ +[LAYER_BASE] = LAYOUT_pad21( \ + KC_ESC, KC_TAB, KC_BSLS, MO(2), \ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ - KC_P7, KC_P8, KC_P9, XXXXXXX, \ + KC_P7, KC_P8, KC_P9, \ KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_P1, KC_P2, KC_P3, XXXXXXX, \ - KC_P0, XXXXXXX, KC_PDOT, KC_PENT ), + KC_P1, KC_P2, KC_P3, \ + KC_P0, KC_PDOT, KC_PENT ), -[LAYER_EDIT] = LAYOUT( \ +[LAYER_EDIT] = LAYOUT_pad21( \ KC_ESC, KC_TAB, KC_SPC, _______, \ - KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ - KC_HOME, KC_UP, KC_PGUP, XXXXXXX, \ + TG(1), SC_PSTE, SC_REDO, SC_UNDO, \ + KC_HOME, KC_UP, KC_PGUP, \ KC_LEFT, M_COPY, KC_RGHT, M_CTALT, \ - KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ - KC_BSPC, XXXXXXX, KC_DEL, M_SHFCT), + KC_END, KC_DOWN, KC_PGDN, \ + KC_BSPC, KC_DEL, M_SHFCT), -[LAYER_FUNCTION] = LAYOUT( \ - KC_FN2, KC_FN3, KC_FN4, _______, \ - KC_FN1, _______, _______, _______, \ - _______, _______, _______, XXXXXXX, \ +[LAYER_FUNCTION] = LAYOUT_pad21( \ + BL_TOGG, BL_INC, BL_DEC, _______, \ + TG(1), _______, _______, _______, \ + _______, _______, _______, \ _______, _______, _______, _______, \ - _______, _______, _______, XXXXXXX, \ - RESET, XXXXXXX, _______, _______ ), - -}; - - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), - [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), - [2] = ACTION_BACKLIGHT_TOGGLE(), - [3] = ACTION_BACKLIGHT_INCREASE(), - [4] = ACTION_BACKLIGHT_DECREASE(), - [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), - [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), - [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), + _______, _______, _______, \ + RESET, _______, _______ ), }; -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -} +bool process_record_user(uint16_t keycode, keyrecord_t * record) { + // MACRODOWN only works in this function + switch (keycode) { + + case M_COPY: + if (record->event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + case M_SHFCT: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) { - - case MACRO_COPY_CUT: - if (record->event.pressed) { - register_code(KC_LCTL); - if (record->tap.count == 1) { - register_code(KC_C); - unregister_code(KC_C); - } - else if (record->tap.count == 2) { - register_code(KC_X); - unregister_code(KC_X); - } - unregister_code(KC_LCTL); - } - break; - - case MACRO_SHIFT_CONTROL: - if (record->event.pressed) { - if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); - if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count == 3) register_code(KC_PENT);; - } - else { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); - unregister_code(KC_PENT); - } - break; - - case MACRO_CONTROL_ALT: - if (record->event.pressed) { - if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); - } - else { - unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); - } - break; + case M_CTALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); } + break; + } - return MACRO_NONE; + return true; } void led_set_user(uint8_t usb_led) diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_24/config.h b/keyboards/handwired/arrow_pad/keymaps/pad_24/config.h index e940acaa0c1..aba085f3d4c 100644 --- a/keyboards/handwired/arrow_pad/keymaps/pad_24/config.h +++ b/keyboards/handwired/arrow_pad/keymaps/pad_24/config.h @@ -52,7 +52,7 @@ along with this program. If not, see . #define DIODE_DIRECTION ROW2COL /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -98,11 +98,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c b/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c index b5d3047081e..dd729c59a10 100644 --- a/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c +++ b/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c @@ -1,35 +1,18 @@ -#include "arrow_pad.h" +#include QMK_KEYBOARD_H #include "led.h" -// This is the 21-key keypad to 2x11 element matrix mapping -#define LAYOUT( \ - KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ - KM_NUM, KM_FSL, KM_AST, KM_MIN, \ - KM___7, KM___8, KM___9, KM_EQU, \ - KM___4, KM___5, KM___6, KM_PLS, \ - KM___1, KM___2, KM___3, ___ENT, \ - KM___0, _____0, KM_DOT, KM_ENT \ -) { \ - { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \ - { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \ - { KM___7, KM___8, KM___9, KM_EQU }, \ - { KM___4, KM___5, KM___6, KM_PLS }, \ - { KM___1, KM___2, KM___3, KC_NO }, \ - { KM___0, KC_NO, KM_DOT, KM_ENT } \ -} - -#define LAYER_BASE 0 -#define LAYER_EDIT 1 -#define LAYER_FUNCTION 2 - -#define MACRO_COPY_CUT 0 -#define MACRO_SHIFT_CONTROL 1 -#define MACRO_CONTROL_ALT 2 +enum layers { + LAYER_BASE, + LAYER_EDIT, + LAYER_FUNCTION +}; -#define M_COPY KC_FN5 -#define M_SHFCT KC_FN6 -#define M_CTALT KC_FN7 +enum custom_keycodes { + M_COPY = SAFE_RANGE, // KC_FN5: MACRO_COPY_CUT + M_SHFCT, // KC_FN6: MACRO_SHIFT_CONTROL + M_CTALT // KC_FN7: MACRO_CONTROL_ALT +}; #define SC_UNDO LCTL(KC_Z) #define SC_REDO LCTL(KC_Y) @@ -42,13 +25,10 @@ #define SC_ACLS LALT(KC_F4) #define SC_CCLS LCTL(KC_F4) -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_BASE] = LAYOUT( \ - KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ + KC_ESC, KC_TAB, KC_BSLS, MO(2), \ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ KC_P7, KC_P8, KC_P9, KC_PEQL, \ KC_P4, KC_P5, KC_P6, KC_PPLS, \ @@ -57,15 +37,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_EDIT] = LAYOUT( \ KC_ESC, KC_TAB, KC_SPC, _______, \ - KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ + TG(1), SC_PSTE, SC_REDO, SC_UNDO, \ KC_HOME, KC_UP, KC_PGUP, KC_LALT, \ KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \ KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ - KC_BSPC, KC_PENT, KC_DEL, M_SHFCT), + KC_BSPC, KC_PENT, KC_DEL, M_SHFCT ), [LAYER_FUNCTION] = LAYOUT( \ - KC_FN2, KC_FN3, KC_FN4, _______, \ - KC_FN1, _______, _______, _______, \ + BL_TOGG, BL_INC, BL_DEC, _______, \ + TG(1), _______, _______, _______, \ _______, _______, _______, _______, \ _______, _______, _______, _______, \ _______, _______, _______, XXXXXXX, \ @@ -74,68 +54,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), - [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), - [2] = ACTION_BACKLIGHT_TOGGLE(), - [3] = ACTION_BACKLIGHT_INCREASE(), - [4] = ACTION_BACKLIGHT_DECREASE(), - [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), - [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), - [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), - -}; - - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -} +bool process_record_user(uint16_t keycode, keyrecord_t * record) { + // MACRODOWN only works in this function + switch (keycode) { + + case M_COPY: + if (record->event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + case M_SHFCT: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) { - - case MACRO_COPY_CUT: - if (record->event.pressed) { - register_code(KC_LCTL); - if (record->tap.count == 1) { - register_code(KC_C); - unregister_code(KC_C); - } - else if (record->tap.count == 2) { - register_code(KC_X); - unregister_code(KC_X); - } - unregister_code(KC_LCTL); - } - break; - - case MACRO_SHIFT_CONTROL: - if (record->event.pressed) { - if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); - if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count == 3) register_code(KC_PENT);; - } - else { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); - unregister_code(KC_PENT); - } - break; - - case MACRO_CONTROL_ALT: - if (record->event.pressed) { - if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); - } - else { - unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); - } - break; + case M_CTALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); } + break; + } - return MACRO_NONE; + return true; } void led_set_user(uint8_t usb_led) diff --git a/keyboards/handwired/arrow_pad/readme.md b/keyboards/handwired/arrow_pad/readme.md index d0d172272ee..43a0e33c406 100644 --- a/keyboards/handwired/arrow_pad/readme.md +++ b/keyboards/handwired/arrow_pad/readme.md @@ -94,13 +94,13 @@ More info can be found on [GeekHack](https://geekhack.org/index.php?topic=73632. The second ArrowPad was a conversion from a 21-key Genovation keypad. It used a 2 row x 11 column matrix. ``` -#define KEYMAP( \ +#define LAYOUT_pad21( \ KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ KM_NUM, KM_FSL, KM_AST, KM_MIN, \ - KM___7, KM___8, KM___9, ___PLS, \ + KM___7, KM___8, KM___9, \ KM___4, KM___5, KM___6, KM_PLS, \ - KM___1, KM___2, KM___3, ___ENT, \ - KM___0, _____0, KM_DOT, KM_ENT \ + KM___1, KM___2, KM___3, \ + KM___0, KM_DOT, KM_ENT \ ) { \ { KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \ { KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \ @@ -119,7 +119,7 @@ Download or clone the whole firmware and navigate to the keyboards/arrow_pad fol Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make default`. +To build with the default keymap, simply run `make handwired/arrow_pad:default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. @@ -127,7 +127,7 @@ Several version of keymap are available in advance but you are recommended to de To build the firmware binary hex file with a keymap just do `make` with a keymap like this: ``` -$ make [default|pad_21|pad_24|] +$ make handwired/arrow_pad:[default|pad_21|pad_24|] ``` Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/handwired/arrow_pad/rules.mk b/keyboards/handwired/arrow_pad/rules.mk index a03f0836b22..7e68eb5990e 100644 --- a/keyboards/handwired/arrow_pad/rules.mk +++ b/keyboards/handwired/arrow_pad/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -67,4 +64,4 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 \ No newline at end of file +AUDIO_ENABLE = no # Audio output on port C6 diff --git a/keyboards/handwired/atreus50/atreus50.h b/keyboards/handwired/atreus50/atreus50.h index de06f255e8e..eb31ca1b8e6 100644 --- a/keyboards/handwired/atreus50/atreus50.h +++ b/keyboards/handwired/atreus50/atreus50.h @@ -5,7 +5,7 @@ // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ @@ -18,7 +18,7 @@ { k30, k31, k32, k33, k34, k35, km1, k36, k37, k38, k39, k3a, k3b } \ } -#define COMPACT_KEYMAP( \ +#define LAYOUT_kc( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ diff --git a/keyboards/handwired/atreus50/config.h b/keyboards/handwired/atreus50/config.h index 2e34e0f8980..0d51e1185d8 100644 --- a/keyboards/handwired/atreus50/config.h +++ b/keyboards/handwired/atreus50/config.h @@ -44,9 +44,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -58,7 +57,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - /* ws2812 RGB LED */ #define RGB_DI_PIN C6 #define RGBLIGHT_ANIMATIONS @@ -67,7 +65,6 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 - /* * Force NKRO * @@ -101,11 +98,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/atreus50/info.json b/keyboards/handwired/atreus50/info.json new file mode 100644 index 00000000000..4e3b4ac4973 --- /dev/null +++ b/keyboards/handwired/atreus50/info.json @@ -0,0 +1,70 @@ +{ + "keyboard_name": "Atreus50", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 4.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Tab", "x":0, "y":0.5}, + {"label":"Q", "x":1, "y":0.5}, + {"label":"W", "x":2, "y":0.25}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0.25}, + {"label":"T", "x":5, "y":0.5}, + + {"label":"Y", "x":9, "y":0.5}, + {"label":"U", "x":10, "y":0.25}, + {"label":"I", "x":11, "y":0}, + {"label":"O", "x":12, "y":0.25}, + {"label":"P", "x":13, "y":0.5}, + {"label":"-", "x":14, "y":0.5}, + + {"label":"Ctrl/Esc", "x":0, "y":1.5}, + {"label":"A", "x":1, "y":1.5}, + {"label":"S", "x":2, "y":1.25}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1.25}, + {"label":"G", "x":5, "y":1.5}, + + {"label":"H", "x":9, "y":1.5}, + {"label":"J", "x":10, "y":1.25}, + {"label":"K", "x":11, "y":1}, + {"label":"L", "x":12, "y":1.25}, + {"label":";", "x":13, "y":1.5}, + {"label":"'", "x":14, "y":1.5}, + + {"label":"LShift", "x":0, "y":2.5}, + {"label":"Z", "x":1, "y":2.5}, + {"label":"X", "x":2, "y":2.25}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2.25}, + {"label":"B", "x":5, "y":2.5}, + + {"label":"N", "x":9, "y":2.5}, + {"label":"M", "x":10, "y":2.25}, + {"label":",", "x":11, "y":2}, + {"label":".", "x":12, "y":2.25}, + {"label":"/", "x":13, "y":2.5}, + {"label":"Shift/Enter", "x":14, "y":2.5}, + + {"label":"`", "x":0, "y":3.5}, + {"label":"LCtrl", "x":1, "y":3.5}, + {"label":"LAlt", "x":2, "y":3.25}, + {"label":"LGUI", "x":3, "y":3}, + {"label":"Lower", "x":4, "y":3.25}, + {"label":"Space", "x":5, "y":3.5}, + {"label":"Fn", "x":6, "y":2.75, "h":1.5}, + + {"label":"RShift", "x":8, "y":2.75, "h":1.5}, + {"label":"Back Space", "x":9, "y":3.5}, + {"label":"Raise", "x":10, "y":3.25}, + {"label":"Left", "x":11, "y":3}, + {"label":"Down", "x":12, "y":3.25}, + {"label":"Up", "x":13, "y":3.5}, + {"label":"Right", "x":14, "y":3.5} + ] + } + } +} diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c b/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c index 5b13224b0bb..1e53d050b0b 100644 --- a/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c @@ -1,6 +1,4 @@ -#include "atreus50.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H #include "keymap_uk.h" extern keymap_config_t keymap_config; @@ -37,10 +35,6 @@ enum planck_keycodes { #include "dynamic_macro.h" -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -54,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn | Ctrl | Alt | GUI |Lower | Bksp | Ctrl | Alt |Space |Raise | Shift| MENU | Ctrl | Fn2 | * `-------------------------------------------------------------------------------------------------' */ -[_QWERTY] = KEYMAP( +[_QWERTY] = LAYOUT( KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT) , KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT , @@ -72,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn | Ctrl | Alt | GUI |Lower | Bksp | Ctrl | Alt |Space |Mouse | MENU | Alt | Ctrl | Fn | * `-------------------------------------------------------------------------------------------------' */ -[_FUNC] = KEYMAP( +[_FUNC] = LAYOUT( KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT , KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , @@ -90,7 +84,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | |Lower | Del | Ctrl | Alt |Space | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ -[_LOWER] = KEYMAP( +[_LOWER] = LAYOUT( KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC , LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC) , KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , @@ -108,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Mouse| | | | | Alt | Ctrl | Alt |Enter |Raise | | | | | * `-------------------------------------------------------------------------------------------------' */ -[_RAISE] = KEYMAP( +[_RAISE] = LAYOUT( KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN , KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) , _______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) , @@ -126,11 +120,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ -[_ADJUST] = KEYMAP( +[_ADJUST] = LAYOUT( M(0), RESET, QWERTY, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL , KC_CAPS, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ , TG(_MAC), _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ , - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Mouse @@ -144,7 +138,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ -[_MOUSE] = KEYMAP( +[_MOUSE] = LAYOUT( KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______ , KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______ , @@ -162,42 +156,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ -[_FUNC2] = KEYMAP( +[_FUNC2] = LAYOUT( _______, _______, M(1), _______, _______, _______, M(5), _______, _______, _______, _______, _______, _______, _______, M(3), M(7), _______, _______, _______, M(10), _______, _______, _______, _______, _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M(98) , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -[_MAC] = KEYMAP( +[_MAC] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MFNC, _______, _______, _______, MLWR, _______, _______, _______, _______, MRSE, _______, _______, _______, MFNC2 ), -[_MLWR] = KEYMAP( +[_MLWR] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -[_MRSE] = KEYMAP( +[_MRSE] = LAYOUT( _______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL) , _______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -[_MFNC] = KEYMAP( +[_MFNC] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -[_MFNC2] = KEYMAP( +[_MFNC2] = LAYOUT( _______, _______, M(2), _______, _______, _______, M(6), _______, _______, _______, _______, _______, _______, _______, M(4), M(8), _______, _______, _______, M(10), _______, _______, _______, _______, _______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M(99) , diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/rules.mk b/keyboards/handwired/atreus50/keymaps/ajp10304/rules.mk index f2a91de8971..fc5d9ba1aa5 100644 --- a/keyboards/handwired/atreus50/keymaps/ajp10304/rules.mk +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/rules.mk @@ -1,7 +1,3 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - AUDIO_ENABLE = no MOUSEKEY_ENABLE = yes diff --git a/keyboards/handwired/atreus50/keymaps/default/keymap.c b/keyboards/handwired/atreus50/keymaps/default/keymap.c index 21d91a8797e..97b90a6db6e 100644 --- a/keyboards/handwired/atreus50/keymaps/default/keymap.c +++ b/keyboards/handwired/atreus50/keymaps/default/keymap.c @@ -1,9 +1,4 @@ -#include "atreus50.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -28,86 +23,52 @@ enum custom_keycodes { }; // Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for ESC -#define KC_X1 LOWER -#define KC_X2 RAISE -#define KC_X3 MO(_MOVEMENT) -#define KC_X4 MT(MOD_LSFT, KC_ENT) // Hold for Left Shift, Tap for Enter +#define X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for ESC +#define X3 MO(_MOVEMENT) +#define X4 MT(MOD_LSFT, KC_ENT) // Hold for Left Shift, Tap for Enter const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + X0, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, X4, + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, X3, KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), - [_COLEMAK] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS, + X0, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, X4, + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, X3, KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), - [_DVORAK] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , O , E , U , I , D , H , T , N , S ,SLSH, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_DVORAK] = LAYOUT( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_MINS, + X0, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, X4, + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, X3, KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), - [_LOWER] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_END, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - [_RAISE] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , F12 ,NUHS,NUBS, , , , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - [_MOVEMENT] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR, UP ,LPRN,RPRN,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , F1 , F2 , F3 , F4 , F5 , F6 ,LEFT,DOWN,RGHT,RCBR,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - , , , , , , , ,PGDN,PGUP,MNXT,VOLD,VOLU,MPLY - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_MOVEMENT] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_UP, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LEFT, KC_DOWN, KC_RGHT, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_END, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_PGUP, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -121,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ - [_ADJUST] = KEYMAP( \ + [_ADJUST] = LAYOUT( \ _______, RESET, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ diff --git a/keyboards/handwired/atreus50/readme.md b/keyboards/handwired/atreus50/readme.md index 0c24f67db2c..9449d66e5b3 100644 --- a/keyboards/handwired/atreus50/readme.md +++ b/keyboards/handwired/atreus50/readme.md @@ -1,7 +1,9 @@ -Handwired Atreus50 -================== +# Handwired Atreus50 -This firmware is for a Handwired Atreus50 using an Arduino Pro Micro. +This firmware is for a handwired Atreus50 using an Arduino Pro Micro. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: Arduino Pro Micro ## Pinout @@ -11,6 +13,12 @@ The following pins are used: ## Compiling and loading the firmware -To build the firmware, run `make`. +Make example for this keyboard (after setting up your build environment): + + make handwired/atreus50:default + +To flash the firmware onto the microcontroller, run `make avrdude`, and press the reset button. + + make handwired/atreus50:default:avrdude -To flash the firemware onto the microcontroller, run `make avrdude`, and press the reset button. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/atreus50/rules.mk b/keyboards/handwired/atreus50/rules.mk index 21c4704e0db..1db2bfa9280 100644 --- a/keyboards/handwired/atreus50/rules.mk +++ b/keyboards/handwired/atreus50/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/bluepill/bluepill70/info.json b/keyboards/handwired/bluepill/bluepill70/info.json new file mode 100644 index 00000000000..3f08b50e551 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/info.json @@ -0,0 +1,187 @@ +{ + "keyboard_name": "BluePill 70", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT_seventy_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"Print Screen", "x":13, "y":0}, + {"label":"Home", "x":14, "y":0}, + {"label":"End", "x":15, "y":0}, + {"label":"`", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"-", "x":11, "y":1}, + {"label":"=", "x":12, "y":1}, + {"label":"Backspace", "x":13, "y":1, "w":2}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Tab", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"[", "x":11.5, "y":2}, + {"label":"]", "x":12.5, "y":2}, + {"label":"Page Up", "x":15, "y":2}, + {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":";", "x":10.75, "y":3}, + {"label":"'", "x":11.75, "y":3}, + {"label":"Enter", "x":12.75, "y":3, "w":2.25}, + {"label":"\\", "x":13.5, "y":2, "w":1.5}, + {"label":"Page Down", "x":15, "y":3}, + {"label":"Shift", "x":0, "y":4, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":",", "x":9.25, "y":4}, + {"label":".", "x":10.25, "y":4}, + {"label":"/", "x":11.25, "y":4}, + {"label":"Shift", "x":12.25, "y":4, "w":1.75}, + {"label":"Up", "x":14, "y":4}, + {"label":"TT(2)", "x":15, "y":4}, + {"label":"Ctrl", "x":0, "y":5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5, "w":6.25}, + {"label":"Alt", "x":10, "y":5}, + {"label":"Fn", "x":11, "y":5}, + {"label":"Ctrl", "x":12, "y":5}, + {"label":"Left", "x":13, "y":5}, + {"label":"Down", "x":14, "y":5}, + {"label":"Right", "x":15, "y":5} + ] + }, + "LAYOUT_seventy_iso": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"Print Screen", "x":13, "y":0}, + {"label":"Home", "x":14, "y":0}, + {"label":"End", "x":15, "y":0}, + {"label":"`", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"-", "x":11, "y":1}, + {"label":"=", "x":12, "y":1}, + {"label":"Backspace", "x":13, "y":1, "w":2}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Tab", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"[", "x":11.5, "y":2}, + {"label":"]", "x":12.5, "y":2}, + {"label":"Page Up", "x":15, "y":2}, + {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":";", "x":10.75, "y":3}, + {"label":",", "x":11.75, "y":3}, + {"label":"ISO #", "x":12.75, "y":3}, + {"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, + {"label":"Page Down", "x":15, "y":3}, + {"label":"Shift", "x":0, "y":4, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":",", "x":9.25, "y":4}, + {"label":".", "x":10.25, "y":4}, + {"label":"/", "x":11.25, "y":4}, + {"label":"Shift", "x":12.25, "y":4, "w":1.75}, + {"label":"Up", "x":14, "y":4}, + {"label":"TT(2)", "x":15, "y":4}, + {"label":"Ctrl", "x":0, "y":5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5, "w":6.25}, + {"label":"Alt", "x":10, "y":5}, + {"label":"Fn", "x":11, "y":5}, + {"label":"Ctrl", "x":12, "y":5}, + {"label":"Left", "x":13, "y":5}, + {"label":"Down", "x":14, "y":5}, + {"label":"Right", "x":15, "y":5} + ] + } + } +} diff --git a/keyboards/handwired/bluepill/config.h b/keyboards/handwired/bluepill/config.h index aeab1808a8c..6d583b98966 100644 --- a/keyboards/handwired/bluepill/config.h +++ b/keyboards/handwired/bluepill/config.h @@ -29,11 +29,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Backlighting include */ /*#define BACKLIGHT_PIN 19 #define BACKLIGHT_LEVELS 5 diff --git a/keyboards/handwired/bluepill/readme.md b/keyboards/handwired/bluepill/readme.md index 8b53f12f46e..b8ca96992cf 100644 --- a/keyboards/handwired/bluepill/readme.md +++ b/keyboards/handwired/bluepill/readme.md @@ -3,15 +3,15 @@ Keyboards using a BluePill controller (generic Chinese STM32F103C8T6) and based on the [KC64 of Xydane](https://github.com/Xydane/qmk_firmware). -Keyboard Maintainer: [FPazos](https://github.com/fpazos), but I hope to leave the project in better hands. -Hardware Supported: Bluepill STM32F103C8T6 +Keyboard Maintainer: [FPazos](https://github.com/fpazos), but I hope to leave the project in better hands. +Hardware Supported: Bluepill STM32F103C8T6 Hardware Availability: Everywhere Make example for BluePill70 (after setting up your build environment): -make handwired/bluepill/bluepill70:default + make handwired/bluepill/bluepill70:default -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). Read everything before using it. @@ -47,14 +47,14 @@ That's the pinout; A4 LCT| WIN| ALT| ESPACE | ALG| FN | RCT| LEF| DOW| RIG And the wiring: -ISO +ISO ![Wiring](https://i.imgur.com/ZCaxVzs.jpg) -ANSI +ANSI ![Wiring](https://i.imgur.com/dBUJCdD.jpg) -It also uses: +It also uses: PC13: Caps Lock led. -Backlight dual color leds, my version is for common anode that's more common, for leds with common anode just replace the palSetPad with palClearPad and viceversa. -PA1: Backlight color A. -PA0: Backlight color B. \ No newline at end of file +Backlight dual color leds, my version is for common anode that's more common, for leds with common anode just replace the palSetPad with palClearPad and viceversa. +PA1: Backlight color A. +PA0: Backlight color B. diff --git a/keyboards/handwired/ck4x4/bootloader_defs.h b/keyboards/handwired/ck4x4/bootloader_defs.h new file mode 100644 index 00000000000..02c48c4e6dc --- /dev/null +++ b/keyboards/handwired/ck4x4/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/handwired/ck4x4/chconf.h b/keyboards/handwired/ck4x4/chconf.h new file mode 100644 index 00000000000..99fa8ce3982 --- /dev/null +++ b/keyboards/handwired/ck4x4/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE FALSE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP FALSE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/ck4x4/ck4x4.c b/keyboards/handwired/ck4x4/ck4x4.c new file mode 100644 index 00000000000..3091ce9c015 --- /dev/null +++ b/keyboards/handwired/ck4x4/ck4x4.c @@ -0,0 +1 @@ +#include "ck4x4.h" diff --git a/keyboards/handwired/ck4x4/ck4x4.h b/keyboards/handwired/ck4x4/ck4x4.h new file mode 100644 index 00000000000..33c1b8dd994 --- /dev/null +++ b/keyboards/handwired/ck4x4/ck4x4.h @@ -0,0 +1,15 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, k23, \ + k30, k31, k32, k33 \ +) {\ +{ k00, k01, k02, k03 }, \ +{ k10, k11, k12, k13 }, \ +{ k20, k21, k22, k23 }, \ +{ k30, k31, k32, k33 }, \ +} diff --git a/keyboards/handwired/ck4x4/config.h b/keyboards/handwired/ck4x4/config.h new file mode 100644 index 00000000000..4ee5e8f4a83 --- /dev/null +++ b/keyboards/handwired/ck4x4/config.h @@ -0,0 +1,70 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER QMK +#define PRODUCT CK4x4 +#define DESCRIPTION Cannon Keys 4x4 MacroPad + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +#define MATRIX_COL_PINS { B7, B8, B9, B10 } +#define MATRIX_ROW_PINS { B3, B4, B5, B6 } +#define DIODE_DIRECTION COL2ROW + +//LEDS A6, RGB B15 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + diff --git a/keyboards/handwired/ck4x4/halconf.h b/keyboards/handwired/ck4x4/halconf.h new file mode 100644 index 00000000000..8b9724b1a30 --- /dev/null +++ b/keyboards/handwired/ck4x4/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/handwired/ck4x4/keymaps/default/keymap.c b/keyboards/handwired/ck4x4/keymaps/default/keymap.c new file mode 100644 index 00000000000..d3717754d89 --- /dev/null +++ b/keyboards/handwired/ck4x4/keymaps/default/keymap.c @@ -0,0 +1,29 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT(KC_7, KC_8, KC_9, KC_MINUS, \ + KC_4, KC_5, KC_6, KC_PLUS, \ + KC_1, KC_2, KC_3, KC_ENTER, \ + RESET, KC_NO, KC_NO, KC_NO \ + ), // test with KC_CAPS, KC_A, RESET +}; + +const uint16_t fn_actions[] = { +}; diff --git a/keyboards/handwired/ck4x4/mcuconf.h b/keyboards/handwired/ck4x4/mcuconf.h new file mode 100644 index 00000000000..faca3defdf0 --- /dev/null +++ b/keyboards/handwired/ck4x4/mcuconf.h @@ -0,0 +1,171 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/handwired/ck4x4/readme.md b/keyboards/handwired/ck4x4/readme.md new file mode 100644 index 00000000000..d25a9c4df3e --- /dev/null +++ b/keyboards/handwired/ck4x4/readme.md @@ -0,0 +1,3 @@ +# CK4x4 + +Cannon Keys 4x4 Macro Pad diff --git a/keyboards/handwired/ck4x4/rules.mk b/keyboards/handwired/ck4x4/rules.mk new file mode 100644 index 00000000000..7ed9022e656 --- /dev/null +++ b/keyboards/handwired/ck4x4/rules.mk @@ -0,0 +1,49 @@ +# project specific files +# SRC = matrix.c \ +# led.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F072xB +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx +# it should exist either in /os/hal/boards/ +# or /boards +BOARD = ST_STM32F072B_DISCOVERY +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m0 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file + +DEFAULT_FOLDER = handwired/ck4x4 diff --git a/keyboards/handwired/cmd60/cmd60.c b/keyboards/handwired/cmd60/cmd60.c new file mode 100644 index 00000000000..91bbbd453b5 --- /dev/null +++ b/keyboards/handwired/cmd60/cmd60.c @@ -0,0 +1,8 @@ +#include "cmd60.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} diff --git a/keyboards/handwired/cmd60/cmd60.h b/keyboards/handwired/cmd60/cmd60.h new file mode 100644 index 00000000000..2e0baa9997b --- /dev/null +++ b/keyboards/handwired/cmd60/cmd60.h @@ -0,0 +1,20 @@ +#ifndef CMD60_H +#define CMD60_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \ + K40, K41, K42, K45, K4A, K4B, K4C, K4D \ + ) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D } \ +} + +#endif diff --git a/keyboards/handwired/cmd60/config.h b/keyboards/handwired/cmd60/config.h new file mode 100644 index 00000000000..ee676ca05da --- /dev/null +++ b/keyboards/handwired/cmd60/config.h @@ -0,0 +1,156 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER cmd +#define PRODUCT CMD60 +#define DESCRIPTION Advanced Programming Keeb Layout + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, F4, F5, F6, F7 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, B7, D0, D1, D2, D3, C6, D7, B4, B5, B6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/handwired/cmd60/info.json b/keyboards/handwired/cmd60/info.json new file mode 100644 index 00000000000..8d555dc078b --- /dev/null +++ b/keyboards/handwired/cmd60/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "CMD60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/handwired/cmd60/keymaps/default/keymap.c b/keyboards/handwired/cmd60/keymaps/default/keymap.c new file mode 100644 index 00000000000..448d81dc16c --- /dev/null +++ b/keyboards/handwired/cmd60/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* CMD60 - QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + LT(3, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, LT(2, KC_SPC), MO(3), MO(4), MO(5), TG(1) \ + ), + [1] = LAYOUT( /* CMD60 - GameMode */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, \ + _______, XXXXXXX, _______, KC_SPC, _______, _______, _______, _______ \ + ), + [2] = LAYOUT( /* CMD60 - Arrows */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + _______, KC_BSPC, KC_UP, KC_DEL, _______, _______, _______, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, \ + _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [3] = LAYOUT( /* CMD60 - Functions */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_MUTE, KC_BSPC, KC_PGUP, KC_DEL, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, _______, KC_PAUS, KC_SLCK, KC_PSCR, \ + _______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_INS, _______, \ + _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [4] = LAYOUT( /* CMD60 - Mouse */ + KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_U, KC_BTN3, KC_WH_D, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [5] = LAYOUT( /* CMD60 - Media */ + KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MPLY, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WBAK, KC_WFWD, KC_WREF, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/handwired/cmd60/readme.md b/keyboards/handwired/cmd60/readme.md new file mode 100644 index 00000000000..933ac16d599 --- /dev/null +++ b/keyboards/handwired/cmd60/readme.md @@ -0,0 +1,19 @@ +# CMD60 + +![CMD60](https://i.imgur.com/r9LA6Lx.jpg) + +This layout has been designed to optimize use of the left-hand, and it focussed specifically on programmers who work +with text editors like SublimeText and Atom. It utilizes the power of Space_fn, and features a caps lock swap for Fn2 +and enter key on tap. These features allow you to keep your right hand on the mouse more and should enable you to +achieve a higher level of productivity if you take the time to learn its function layers. + +[Build Log](https://redd.it/4mkuu8) + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: CMD60 handwired, Teensy 2.0 + +Make example for this keyboard (after setting up your build environment): + + make handwired/cmd60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/CMD60/rules.mk b/keyboards/handwired/cmd60/rules.mk similarity index 100% rename from keyboards/handwired/CMD60/rules.mk rename to keyboards/handwired/cmd60/rules.mk diff --git a/keyboards/handwired/co60/info.json b/keyboards/handwired/co60/info.json new file mode 100644 index 00000000000..46f369f92cc --- /dev/null +++ b/keyboards/handwired/co60/info.json @@ -0,0 +1,38 @@ +{ + "keyboard_name": "CO60", + "url": "https://github.com/jmdaly/CO60", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "key_count": 68, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"LSpace", "x":3.75, "y":4, "w":2.25}, {"label":"Fn", "x":6, "y":4, "w":1.25}, {"label":"RSpace", "x":7.25, "y":4, "w":2.75}, {"label":"Alt", "x":10, "y":4, "w":1}, {"label":"Win", "x":11, "y":4, "w":1}, {"label":"Menu", "x":12, "y":4, "w":1}, {"label":"Ctrl", "x":13, "y":4, "w":1}, {"label":"Fn", "x":14, "y":4, "w":1}] + }, + "LAYOUT_60_ansi": { + "key_count": 61, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_ansi_split_bs_rshift": { + "key_count": 63, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0, "w":1}, {"label":"Del", "x":14, "y":0, "w":1}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3, "w":1}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_iso": { + "key_count": 62, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_hhkb": { + "key_count": 60, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75},{"label":"Fn", "x":14, "y":3}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"label":"Space", "x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}] + }, + "LAYOUT_60_hhkb_split_space": { + "key_count": 62, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75},{"label":"Fn", "x":14, "y":3}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"label":"LSpace", "x":4, "y":4, "w":2.75}, {"label":"Fn", "x":6.75, "y":4, "w":1.5}, {"label":"RSpace", "x":8.25, "y":4, "w":2.75}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}] + }, + "LAYOUT_60_hhkb_split_625u_space": { + "key_count": 63, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75},{"label":"Fn", "x":14, "y":3}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"LSpace", "x":3.75, "y":4, "w":2.25}, {"label":"Fn", "x":6, "y":4, "w":1.25}, {"label":"RSpace", "x":7.25, "y":4, "w":2.75}, {"label":"Menu", "x":10, "y":4, "w":1.25}, {"label":"Alt", "x":11.25, "y":4, "w":1.25}, {"label":"Win", "x":12.5, "y":4}] + } + } +} + diff --git a/keyboards/handwired/co60/keymaps/all_keys/config.h b/keyboards/handwired/co60/keymaps/all_keys/config.h new file mode 100644 index 00000000000..a68c5c7465e --- /dev/null +++ b/keyboards/handwired/co60/keymaps/all_keys/config.h @@ -0,0 +1,20 @@ +/* Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + + +// place overrides here diff --git a/keyboards/handwired/co60/keymaps/all_keys/keymap.c b/keyboards/handwired/co60/keymaps/all_keys/keymap.c new file mode 100644 index 00000000000..797b7ece3ad --- /dev/null +++ b/keyboards/handwired/co60/keymaps/all_keys/keymap.c @@ -0,0 +1,48 @@ +/* Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + +enum co60_layers { + _L1, + _L2 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_L1] = LAYOUT_all( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, KC_HOME, KC_END, KC_INS, KC_RALT, KC_RGUI, KC_RIGHT, KC_RCTL + ) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/co60/keymaps/all_keys/readme.md b/keyboards/handwired/co60/keymaps/all_keys/readme.md new file mode 100644 index 00000000000..0e472f235b8 --- /dev/null +++ b/keyboards/handwired/co60/keymaps/all_keys/readme.md @@ -0,0 +1,5 @@ +# Keymap that uses all possible switches + +This is in part to test all of the switches, +but also it may be useful if anyone ever makes a +layout that requires all switch positions. diff --git a/keyboards/handwired/co60/keymaps/default/config.h b/keyboards/handwired/co60/keymaps/default/config.h new file mode 100644 index 00000000000..124091cc5ad --- /dev/null +++ b/keyboards/handwired/co60/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/handwired/co60/keymaps/default/keymap.c b/keyboards/handwired/co60/keymaps/default/keymap.c new file mode 100644 index 00000000000..35151c42126 --- /dev/null +++ b/keyboards/handwired/co60/keymaps/default/keymap.c @@ -0,0 +1,54 @@ +/* Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum co60_layers { + _L1, + _L2 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_L1] = LAYOUT_60_ansi( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_L2), KC_RCTL + ), + [_L2] = LAYOUT_60_ansi( /* Base */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_GRV, + _______, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, KC_INSERT, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_HOME, KC_END, _______, + _______, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDOWN, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/co60/keymaps/default/readme.md b/keyboards/handwired/co60/keymaps/default/readme.md new file mode 100644 index 00000000000..eb8ba49e3eb --- /dev/null +++ b/keyboards/handwired/co60/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for co60 \ No newline at end of file diff --git a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/config.h b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/config.h new file mode 100644 index 00000000000..c88fbc29d6c --- /dev/null +++ b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/config.h @@ -0,0 +1,21 @@ +/* Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define LEADER_TIMEOUT 300 + +// place overrides here diff --git a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c new file mode 100644 index 00000000000..0f19f9fbe37 --- /dev/null +++ b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c @@ -0,0 +1,137 @@ +/* Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum co60_layers { + _L1, + _L2, + _L3 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Default base layer. Except for the bottom row, this + // is close to a standard HHKB layout. + [_L1] = LAYOUT_60_hhkb_split_625u_space( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(_L3), + KC_LALT, KC_LGUI, KC_ENT, MO(_L3), KC_SPC, KC_LEAD, KC_RGUI, KC_RALT + ), + // My preferred base layout. This doesn't match the caps + // on my boards, so I don't make it default. + [_L2] = LAYOUT_60_hhkb_split_625u_space( /* Base */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(_L3), + KC_LALT, KC_LGUI, KC_ENT, MO(_L3), KC_SPC, KC_LEAD, KC_RGUI, KC_RALT + ), + [_L3] = LAYOUT_60_hhkb_split_625u_space( /* Function */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + BL_BRTG, BL_TOGG, BL_INC, BL_DEC, BL_ON, BL_OFF, _______, _______, _______, _______, _______, KC_PGUP, KC_INSERT, KC_DEL, + _______, RGB_TOG, RGB_MOD, RGB_RMOD, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_HOME, KC_END, _______, + _______, BL_DEC, _______, _______, _______, _______, _______, DF(_L1), DF(_L2), _______, KC_PGDOWN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +void matrix_init_user(void) { + +} + +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + // Close a program in i3wm + SEQ_ONE_KEY(KC_Q) { + register_code(KC_LGUI); + register_code(KC_LSHIFT); + register_code(KC_Q); + unregister_code(KC_Q); + unregister_code(KC_LSHIFT); + unregister_code(KC_LGUI); + } + // Exit i3wm + SEQ_ONE_KEY(KC_E) { + register_code(KC_LGUI); + register_code(KC_LSHIFT); + register_code(KC_E); + unregister_code(KC_E); + unregister_code(KC_LSHIFT); + unregister_code(KC_LGUI); + } + // Copy selected text in suckless terminal + SEQ_ONE_KEY(KC_C) { + register_code(KC_LCTL); + register_code(KC_LSHIFT); + register_code(KC_C); + unregister_code(KC_C); + unregister_code(KC_LSHIFT); + unregister_code(KC_LCTL); + } + // Paste text in suckless terminal + SEQ_ONE_KEY(KC_V) { + register_code(KC_LCTL); + register_code(KC_LSHIFT); + register_code(KC_V); + unregister_code(KC_V); + unregister_code(KC_LSHIFT); + unregister_code(KC_LCTL); + } + // FZF shortcut to fuzzy switch directories + SEQ_ONE_KEY(KC_D) { + register_code(KC_LALT); + register_code(KC_C); + unregister_code(KC_C); + unregister_code(KC_LALT); + } + // Send keys to bring up fuzzy process kill + SEQ_ONE_KEY(KC_K) { + SEND_STRING("kill " SS_TAP(X_TAB)); + } + // Send keys to start neovim and fuzzy search for filename + SEQ_ONE_KEY(KC_T) { + SEND_STRING("nvim "); + register_code(KC_LCTL); + register_code(KC_T); + unregister_code(KC_T); + unregister_code(KC_LCTL); + } + // Switch between windows in tmux + SEQ_ONE_KEY(KC_L) { + register_code(KC_LCTL); + register_code(KC_B); + unregister_code(KC_B); + unregister_code(KC_LCTL); + register_code(KC_L); + unregister_code(KC_L); + } + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/readme.md b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/readme.md new file mode 100644 index 00000000000..032fc85f96d --- /dev/null +++ b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/readme.md @@ -0,0 +1,6 @@ +# The split-space HHKB keymap for co60 + +This keymap implements a modified MX HHKB layout, but in addition to 7u space, +this layout supports a number of split spacebar bottom rows. The full set of +layout options is found +[here](http://www.keyboard-layout-editor.com/#/gists/b488496b3a71c8192113c07e298be340). diff --git a/keyboards/handwired/co60/readme.md b/keyboards/handwired/co60/readme.md new file mode 100644 index 00000000000..2a649ea9b46 --- /dev/null +++ b/keyboards/handwired/co60/readme.md @@ -0,0 +1,26 @@ +# co60 + +The CO60 is a 60% PCB that aims to meet the following goals: + +* Switches oriented such that the LEDs are South-facing, for + compatibility with Cherry profile keycaps. +* USB Type-C support in both A to C and C to C configurations. +* QMK support. +* A variety of split spacebar configurations, including split 6.25U + space and split 7U space. +* ESD protection circuitry, including data line protection and a + polyfuse on the VCC line. +* Support for per-switch LED backlighting. +* Fits in standard 60% keyboard cases. + +More info on the project, including all of the design files, can be found [here](https://github.com/jmdaly/CO60). + +Keyboard Maintainer: [jmdaly](https://github.com/jmdaly) +Hardware Supported: Supports the CO60 PCB rev1, rev6, rev7 +Hardware Availability: Through group buys. + +Make example for this keyboard (after setting up your build environment): + + make handwired/co60/rev7:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/co60/rev1/config.h b/keyboards/handwired/co60/rev1/config.h new file mode 100644 index 00000000000..4d5140dafd2 --- /dev/null +++ b/keyboards/handwired/co60/rev1/config.h @@ -0,0 +1,161 @@ +/* +Copyright 2018 John M Daly + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER John M Daly +#define PRODUCT CO60 +#define DESCRIPTION An open hardware sixty percent PCB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B2, B5, B4, D7, D6, B3, B0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#ifdef __AVR__ +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#endif +#define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +// #define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/handwired/co60/rev1/rev1.c b/keyboards/handwired/co60/rev1/rev1.c new file mode 100644 index 00000000000..abdfa884d60 --- /dev/null +++ b/keyboards/handwired/co60/rev1/rev1.c @@ -0,0 +1,46 @@ +/* Copyright 2018 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev1.h" + +__attribute__ ((weak)) +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +__attribute__ ((weak)) +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/handwired/co60/rev1/rev1.h b/keyboards/handwired/co60/rev1/rev1.h new file mode 100644 index 00000000000..3cf6a853f2f --- /dev/null +++ b/keyboards/handwired/co60/rev1/rev1.h @@ -0,0 +1,127 @@ +/* Copyright 2018 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is a layout that uses all available switch positions. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K404, K406, K408, K410, K411, K412, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 }, \ +} + +#define LAYOUT_60_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K402, K406, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K406, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \ +} + +#define LAYOUT_60_iso( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K402, K406, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \ +} + +#define LAYOUT_60_hhkb( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K406, K411, K413 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \ +} + +#define LAYOUT_60_hhkb_split_space( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K404, K406, K408, K411, K413 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \ +} + +#define LAYOUT_60_hhkb_split_625u_space( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K404, K406, K408, K410, K411, K413 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, KC_NO }, \ +} diff --git a/keyboards/handwired/co60/rev1/rules.mk b/keyboards/handwired/co60/rev1/rules.mk new file mode 100644 index 00000000000..31ce6cbe41a --- /dev/null +++ b/keyboards/handwired/co60/rev1/rules.mk @@ -0,0 +1,70 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +LEADER_ENABLE = yes # Turn on leader support + +# Layouts supported by this PCB: +LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift 60_hhkb diff --git a/keyboards/handwired/co60/rev6/chconf.h b/keyboards/handwired/co60/rev6/chconf.h new file mode 100644 index 00000000000..1d9f12ff1f8 --- /dev/null +++ b/keyboards/handwired/co60/rev6/chconf.h @@ -0,0 +1,520 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM TRUE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/co60/rev6/config.h b/keyboards/handwired/co60/rev6/config.h new file mode 100644 index 00000000000..b1ab99fd9ba --- /dev/null +++ b/keyboards/handwired/co60/rev6/config.h @@ -0,0 +1,60 @@ +/* + * Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER John M Daly +#define PRODUCT CO60 rev6 +#define DESCRIPTION An open hardware sixty percent PCB + +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* ROWS: Top to bottom, COLS: Left to right +*/ +#define MATRIX_ROW_PINS { B0, B1, B2, A15, A10 } +#define MATRIX_COL_PINS { A2, A3, A6, B14, B15, A8, A9, A7, B3, B4, C14, C15, C13, B5, B6 } + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* Backlight configuration + * Backlight LEDs on B8 + */ +#define BACKLIGHT_LEVELS 24 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 diff --git a/keyboards/preonic/rev3/halconf.h b/keyboards/handwired/co60/rev6/halconf.h similarity index 100% rename from keyboards/preonic/rev3/halconf.h rename to keyboards/handwired/co60/rev6/halconf.h diff --git a/keyboards/handwired/co60/rev6/led.c b/keyboards/handwired/co60/rev6/led.c new file mode 100644 index 00000000000..fe28ce2e8f5 --- /dev/null +++ b/keyboards/handwired/co60/rev6/led.c @@ -0,0 +1,240 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "hal.h" +#include "led_custom.h" +#include "rev6.h" +#include "printf.h" + +static void breathing_callback(PWMDriver *pwmp); + +static PWMConfig pwmCFG = { + 0xFFFF, /* PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + NULL, /* No Callback */ + { + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 3 */ + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +static PWMConfig pwmCFG_breathing = { + 0xFFFF, /* 10kHz PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + breathing_callback, /* Breathing Callback */ + { + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 3 */ + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t)y; + } +} + +void backlight_init_ports(void) { + palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(2)); + pwmStart(&PWMD4, &pwmCFG); + if (kb_backlight_config.enable) { + if (kb_backlight_config.breathing) { + breathing_enable(); + } else { + backlight_set(kb_backlight_config.level); + } + } else { + backlight_set(0); + } +} + +void backlight_set(uint8_t level) { + uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t)level / BACKLIGHT_LEVELS)); + if (level == 0) { + // Turn backlight off + // Disable channel 3 on PWM4 + pwmDisableChannel(&PWMD4, 2); + } else { + // Turn backlight on + if (!is_breathing()) { + // Enable channel 3 on PWM4 + pwmEnableChannel(&PWMD4, 2, PWM_FRACTION_TO_WIDTH(&PWMD4, 0xFFFF, duty)); + } + } +} + +uint8_t backlight_tick = 0; + +void backlight_task(void) { +} + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +bool is_breathing(void) { + return PWMD4.config == &pwmCFG_breathing; +} + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0) + + +void breathing_interrupt_enable(void){ + pwmStop(&PWMD4); + pwmStart(&PWMD4, &pwmCFG_breathing); + chSysLockFromISR(); + pwmEnablePeriodicNotification(&PWMD4); + pwmEnableChannelI( + &PWMD4, + 2, + PWM_FRACTION_TO_WIDTH( + &PWMD4, + 0xFFFF, + 0xFFFF + ) + ); + chSysUnlockFromISR(); +} + +void breathing_interrupt_disable(void){ + pwmStop(&PWMD4); + pwmStart(&PWMD4, &pwmCFG); +} + +void breathing_enable(void) +{ + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + breathing_interrupt_enable(); +} + +void breathing_pulse(void) +{ + if (kb_backlight_config.level == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + breathing_interrupt_enable(); +} + +void breathing_disable(void) +{ + breathing_interrupt_disable(); + // Restore backlight level + backlight_set(kb_backlight_config.level); +} + +void breathing_self_disable(void) +{ + if (kb_backlight_config.level == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()){ + breathing_disable(); + } else { + breathing_enable(); + } +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * kb_backlight_config.level; +} + +static void breathing_callback(PWMDriver *pwmp) +{ + (void)pwmp; + uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 256); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + breathing_interrupt_disable(); + } + + uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256)); + + chSysLockFromISR(); + pwmEnableChannelI( + &PWMD4, + 2, + PWM_FRACTION_TO_WIDTH( + &PWMD4, + 0xFFFF, + duty + ) + ); + chSysUnlockFromISR(); +} diff --git a/keyboards/handwired/co60/rev6/led_custom.h b/keyboards/handwired/co60/rev6/led_custom.h new file mode 100644 index 00000000000..96c4d0c2ba7 --- /dev/null +++ b/keyboards/handwired/co60/rev6/led_custom.h @@ -0,0 +1,22 @@ +/* + * Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +void backlight_task(void); +void breathing_interrupt_disable(void); +void breathing_interrupt_enable(void); diff --git a/keyboards/handwired/co60/rev6/mcuconf.h b/keyboards/handwired/co60/rev6/mcuconf.h new file mode 100644 index 00000000000..69bf9185d17 --- /dev/null +++ b/keyboards/handwired/co60/rev6/mcuconf.h @@ -0,0 +1,257 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32F3xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F3xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 +#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_USART2SW STM32_USART2SW_PCLK +#define STM32_USART3SW STM32_USART3SW_PCLK +#define STM32_UART4SW STM32_UART4SW_PCLK +#define STM32_UART5SW STM32_UART5SW_PCLK +#define STM32_I2C1SW STM32_I2C1SW_SYSCLK +#define STM32_I2C2SW STM32_I2C2SW_SYSCLK +#define STM32_TIM1SW STM32_TIM1SW_PCLK2 +#define STM32_TIM8SW STM32_TIM8SW_PCLK2 +#define STM32_RTCSEL STM32_RTCSEL_LSI +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 + +#undef STM32_HSE_BYPASS +// #error "oh no" +// #endif + +/* + * ADC driver system settings. + */ +#define STM32_ADC_DUAL_MODE FALSE +#define STM32_ADC_COMPACT_SAMPLES FALSE +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_USE_ADC2 FALSE +#define STM32_ADC_USE_ADC3 FALSE +#define STM32_ADC_USE_ADC4 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) +#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) +#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) +#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC2_DMA_PRIORITY 2 +#define STM32_ADC_ADC3_DMA_PRIORITY 2 +#define STM32_ADC_ADC4_DMA_PRIORITY 2 +#define STM32_ADC_ADC12_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 +#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE FALSE +#define STM32_DAC_USE_DAC1_CH1 TRUE +#define STM32_DAC_USE_DAC1_CH2 TRUE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM6 TRUE +#define STM32_GPT_USE_TIM7 TRUE +#define STM32_GPT_USE_TIM8 TRUE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM6_IRQ_PRIORITY 7 +#define STM32_GPT_TIM7_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 10 +#define STM32_I2C_I2C2_IRQ_PRIORITY 10 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 TRUE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +#endif /* MCUCONF_H */ diff --git a/keyboards/handwired/co60/rev6/rev6.c b/keyboards/handwired/co60/rev6/rev6.c new file mode 100644 index 00000000000..f597513b16d --- /dev/null +++ b/keyboards/handwired/co60/rev6/rev6.c @@ -0,0 +1,39 @@ +/* Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev6.h" + +#include "backlight.h" +#include "led.h" +#include "printf.h" + +backlight_levels_config_t kb_backlight_config = { + .enable = true, + .breathing = true, + .level = BACKLIGHT_LEVELS +}; + +uint8_t *o_fb; + +uint16_t counterst = 0; + +void matrix_init_kb(void) { + matrix_init_user(); + backlight_init_ports(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} diff --git a/keyboards/handwired/co60/rev6/rev6.h b/keyboards/handwired/co60/rev6/rev6.h new file mode 100644 index 00000000000..7d11f19d3c9 --- /dev/null +++ b/keyboards/handwired/co60/rev6/rev6.h @@ -0,0 +1,146 @@ +/* Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is a layout that uses all available switch positions. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K404, K406, K408, K410, K411, K412, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 }, \ +} + +#define LAYOUT_60_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K402, K406, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K406, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \ +} + +#define LAYOUT_60_iso( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K402, K406, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \ +} + +#define LAYOUT_60_hhkb( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K406, K411, K413 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \ +} + +#define LAYOUT_60_hhkb_split_space( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K404, K406, K408, K411, K413 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \ +} + +#define LAYOUT_60_hhkb_split_625u_space( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K404, K406, K408, K410, K411, K413 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, KC_NO }, \ +} + +// Backlighting +typedef union { + uint8_t raw; + struct { + bool enable :1; + bool breathing : 1; + uint8_t level :6; + }; +} backlight_levels_config_t; + +extern backlight_levels_config_t kb_backlight_config; +extern bool kb_backlight_breathing; + +void backlight_init_ports(void); +void backlight_set(uint8_t level); +bool is_breathing(void); +void breathing_enable(void); +void breathing_disable(void); diff --git a/keyboards/handwired/co60/rev6/rules.mk b/keyboards/handwired/co60/rev6/rules.mk new file mode 100644 index 00000000000..dba41e12be5 --- /dev/null +++ b/keyboards/handwired/co60/rev6/rules.mk @@ -0,0 +1,59 @@ +# project specific files + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -v 0483 -p df11 + +# Code for backlight breathing: +SRC += led.c + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = yes +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +LEADER_ENABLE = yes + +LAYOUTS += 60_ansi 60_ansi_split_bs_rshift 60_iso 60_hhkb diff --git a/keyboards/handwired/co60/rev7/chconf.h b/keyboards/handwired/co60/rev7/chconf.h new file mode 100644 index 00000000000..1d9f12ff1f8 --- /dev/null +++ b/keyboards/handwired/co60/rev7/chconf.h @@ -0,0 +1,520 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM TRUE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/co60/rev7/config.h b/keyboards/handwired/co60/rev7/config.h new file mode 100644 index 00000000000..1ccc12ad4c0 --- /dev/null +++ b/keyboards/handwired/co60/rev7/config.h @@ -0,0 +1,70 @@ +/* +Copyright 2019 John M Daly + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER John M Daly +#define PRODUCT CO60 rev7 +#define DESCRIPTION An open hardware sixty percent PCB + +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* ROWS: Top to bottom, COLS: Left to right +*/ +#define MATRIX_ROW_PINS { A8, A2, B13, B2, B10 } +#define MATRIX_COL_PINS { A10, A9, A3, A4, A5, A6, B0, B1, A15, B3, B4, B5, C13, C14, C15 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* Backlight configuration + * Backlight LEDs on B8 + */ +#define BACKLIGHT_LEVELS 24 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +#define RGBLIGHT_ANIMATIONS + +#define RGBLED_NUM 16 +#define RGB_DI_PIN A7 +#define DRIVER_LED_TOTAL RGBLED_NUM + +#define RGB_MATRIX_KEYPRESSES diff --git a/keyboards/handwired/co60/rev7/halconf.h b/keyboards/handwired/co60/rev7/halconf.h new file mode 100644 index 00000000000..5e5d70219e2 --- /dev/null +++ b/keyboards/handwired/co60/rev7/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/co60/rev7/led.c b/keyboards/handwired/co60/rev7/led.c new file mode 100644 index 00000000000..13f8d98608f --- /dev/null +++ b/keyboards/handwired/co60/rev7/led.c @@ -0,0 +1,242 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "hal.h" +#include "led_custom.h" +#include "rev7.h" +#include "printf.h" + +static void breathing_callback(PWMDriver *pwmp); + +static PWMConfig pwmCFG = { + 0xFFFF, /* PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + NULL, /* No Callback */ + { + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 3 */ + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +static PWMConfig pwmCFG_breathing = { + 0xFFFF, /* 10kHz PWM clock frequency */ + 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + breathing_callback, /* Breathing Callback */ + { + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_DISABLED, NULL}, + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 3 */ + {PWM_OUTPUT_DISABLED, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + + +void backlight_init_ports(void) { + palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(2)); + pwmStart(&PWMD4, &pwmCFG); + if(kb_backlight_config.enable){ + if(kb_backlight_config.breathing){ + breathing_enable(); + } else{ + backlight_set(kb_backlight_config.level); + } + } else { + backlight_set(0); + } +} + +void backlight_set(uint8_t level) { + uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / BACKLIGHT_LEVELS)); + if (level == 0) { + // Turn backlight off + // Disable channel 3 on PWM4 + pwmDisableChannel(&PWMD4, 2); + } else { + // Turn backlight on + if(!is_breathing()){ + // Enable channel 3 on PWM4 + pwmEnableChannel(&PWMD4, 2, PWM_FRACTION_TO_WIDTH(&PWMD4,0xFFFF,duty)); + } + } +} + + +uint8_t backlight_tick = 0; + +void backlight_task(void) { +} + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +bool is_breathing(void) { + return PWMD4.config == &pwmCFG_breathing; +} + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0) + + +void breathing_interrupt_enable(void){ + pwmStop(&PWMD4); + pwmStart(&PWMD4, &pwmCFG_breathing); + chSysLockFromISR(); + pwmEnablePeriodicNotification(&PWMD4); + pwmEnableChannelI( + &PWMD4, + 2, + PWM_FRACTION_TO_WIDTH( + &PWMD4, + 0xFFFF, + 0xFFFF + ) + ); + chSysUnlockFromISR(); +} + +void breathing_interrupt_disable(void){ + pwmStop(&PWMD4); + pwmStart(&PWMD4, &pwmCFG); +} + +void breathing_enable(void) +{ + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + breathing_interrupt_enable(); +} + +void breathing_pulse(void) +{ + if (kb_backlight_config.level == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + breathing_interrupt_enable(); +} + +void breathing_disable(void) +{ + breathing_interrupt_disable(); + // Restore backlight level + backlight_set(kb_backlight_config.level); +} + +void breathing_self_disable(void) +{ + if (kb_backlight_config.level == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()){ + breathing_disable(); + } else { + breathing_enable(); + } +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * kb_backlight_config.level; +} + +static void breathing_callback(PWMDriver *pwmp) +{ + (void)pwmp; + uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 256); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + breathing_interrupt_disable(); + } + + uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256)); + + chSysLockFromISR(); + pwmEnableChannelI( + &PWMD4, + 2, + PWM_FRACTION_TO_WIDTH( + &PWMD4, + 0xFFFF, + duty + ) + ); + chSysUnlockFromISR(); +} diff --git a/keyboards/handwired/co60/rev7/led_custom.h b/keyboards/handwired/co60/rev7/led_custom.h new file mode 100644 index 00000000000..56e723db8f7 --- /dev/null +++ b/keyboards/handwired/co60/rev7/led_custom.h @@ -0,0 +1,22 @@ +/* +Copyright 2019 John M Daly + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +void backlight_task(void); +void breathing_interrupt_disable(void); +void breathing_interrupt_enable(void); diff --git a/keyboards/handwired/co60/rev7/mcuconf.h b/keyboards/handwired/co60/rev7/mcuconf.h new file mode 100644 index 00000000000..69bf9185d17 --- /dev/null +++ b/keyboards/handwired/co60/rev7/mcuconf.h @@ -0,0 +1,257 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32F3xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F3xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 +#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_USART2SW STM32_USART2SW_PCLK +#define STM32_USART3SW STM32_USART3SW_PCLK +#define STM32_UART4SW STM32_UART4SW_PCLK +#define STM32_UART5SW STM32_UART5SW_PCLK +#define STM32_I2C1SW STM32_I2C1SW_SYSCLK +#define STM32_I2C2SW STM32_I2C2SW_SYSCLK +#define STM32_TIM1SW STM32_TIM1SW_PCLK2 +#define STM32_TIM8SW STM32_TIM8SW_PCLK2 +#define STM32_RTCSEL STM32_RTCSEL_LSI +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 + +#undef STM32_HSE_BYPASS +// #error "oh no" +// #endif + +/* + * ADC driver system settings. + */ +#define STM32_ADC_DUAL_MODE FALSE +#define STM32_ADC_COMPACT_SAMPLES FALSE +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_USE_ADC2 FALSE +#define STM32_ADC_USE_ADC3 FALSE +#define STM32_ADC_USE_ADC4 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) +#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) +#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) +#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC2_DMA_PRIORITY 2 +#define STM32_ADC_ADC3_DMA_PRIORITY 2 +#define STM32_ADC_ADC4_DMA_PRIORITY 2 +#define STM32_ADC_ADC12_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 +#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE FALSE +#define STM32_DAC_USE_DAC1_CH1 TRUE +#define STM32_DAC_USE_DAC1_CH2 TRUE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM6 TRUE +#define STM32_GPT_USE_TIM7 TRUE +#define STM32_GPT_USE_TIM8 TRUE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM6_IRQ_PRIORITY 7 +#define STM32_GPT_TIM7_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 10 +#define STM32_I2C_I2C2_IRQ_PRIORITY 10 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 TRUE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +#endif /* MCUCONF_H */ diff --git a/keyboards/handwired/co60/rev7/rev7.c b/keyboards/handwired/co60/rev7/rev7.c new file mode 100644 index 00000000000..3d0964d899e --- /dev/null +++ b/keyboards/handwired/co60/rev7/rev7.c @@ -0,0 +1,39 @@ +/* Copyright 2019 John M Daly + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev7.h" + +#include "backlight.h" +#include "led.h" +#include "printf.h" + +backlight_levels_config_t kb_backlight_config = { + .enable = true, + .breathing = true, + .level = BACKLIGHT_LEVELS +}; + +uint8_t *o_fb; + +uint16_t counterst = 0; + +void matrix_init_kb(void) { + matrix_init_user(); + backlight_init_ports(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} diff --git a/keyboards/handwired/co60/rev7/rev7.h b/keyboards/handwired/co60/rev7/rev7.h new file mode 100644 index 00000000000..4ab2b8d7220 --- /dev/null +++ b/keyboards/handwired/co60/rev7/rev7.h @@ -0,0 +1,146 @@ +/* Copyright 2019 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is a layout that uses all available switch positions. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K404, K406, K408, K410, K411, K412, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 }, \ +} + +#define LAYOUT_60_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K402, K406, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K406, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \ +} + +#define LAYOUT_60_iso( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K402, K406, K410, K411, K413, K414 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \ +} + +#define LAYOUT_60_hhkb( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K406, K411, K413 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \ +} + +#define LAYOUT_60_hhkb_split_space( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K404, K406, K408, K411, K413 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \ +} + +#define LAYOUT_60_hhkb_split_625u_space( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K404, K406, K408, K410, K411, K413 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, KC_NO }, \ +} + +// Backlighting +typedef union { + uint8_t raw; + struct { + bool enable :1; + bool breathing : 1; + uint8_t level :6; + }; +} backlight_levels_config_t; + +extern backlight_levels_config_t kb_backlight_config; +extern bool kb_backlight_breathing; + +void backlight_init_ports(void); +void backlight_set(uint8_t level); +bool is_breathing(void); +void breathing_enable(void); +void breathing_disable(void); diff --git a/keyboards/handwired/co60/rev7/rules.mk b/keyboards/handwired/co60/rev7/rules.mk new file mode 100644 index 00000000000..6e0b3856ab6 --- /dev/null +++ b/keyboards/handwired/co60/rev7/rules.mk @@ -0,0 +1,59 @@ +# project specific files + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -v 0483 -p df11 + +# Code for backlight breathing: +SRC += led.c + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = yes +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +LEADER_ENABLE = yes + +LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_iso 60_hhkb diff --git a/keyboards/handwired/dactyl/config.h b/keyboards/handwired/dactyl/config.h index 08931ecd345..49524c20975 100644 --- a/keyboards/handwired/dactyl/config.h +++ b/keyboards/handwired/dactyl/config.h @@ -36,7 +36,8 @@ along with this program. If not, see . #define COL_EXPANDED { true, true, true, true, true, true, false, false, false, false, false, false} #define MATRIX_ONBOARD_ROW_PINS { F0, F1, F4, F5, F6, F7 } #define MATRIX_ONBOARD_COL_PINS { 0, 0, 0, 0, 0, 0, B1, B2, B3, D2, D3, C6 } -#define EXPANDER_COL_REGISTER 0 +#define EXPANDER_COL_REGISTER GPIOA +#define EXPANDER_ROW_REGISTER GPIOB #define MATRIX_EXPANDER_COL_PINS {0, 1, 2, 3, 4, 5} #define MATRIX_EXPANDER_ROW_PINS {0, 1, 2, 3, 4, 5} @@ -53,8 +54,8 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ ) /* fix space cadet rollover issue */ diff --git a/keyboards/handwired/dactyl/keymaps/default/keymap.c b/keyboards/handwired/dactyl/keymaps/default/keymap.c index c4a638c2a46..07d95844926 100644 --- a/keyboards/handwired/dactyl/keymaps/default/keymap.c +++ b/keyboards/handwired/dactyl/keymaps/default/keymap.c @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), GUI_T(KC_QUOT), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB), KC_RALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN, KC_TAB, KC_ENT @@ -137,28 +137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - } - return MACRO_NONE; -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case VRSN: diff --git a/keyboards/handwired/dactyl/keymaps/dvorak/keymap.c b/keyboards/handwired/dactyl/keymaps/dvorak/keymap.c index 56762d1b67c..7c44f78a656 100644 --- a/keyboards/handwired/dactyl/keymaps/dvorak/keymap.c +++ b/keyboards/handwired/dactyl/keymaps/dvorak/keymap.c @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), GUI_T(KC_SLSH), KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, - KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB), KC_RALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN, KC_TAB, KC_ENT @@ -137,10 +137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/handwired/dactyl/matrix.c b/keyboards/handwired/dactyl/matrix.c index f63cf1188f6..28cf37522b0 100644 --- a/keyboards/handwired/dactyl/matrix.c +++ b/keyboards/handwired/dactyl/matrix.c @@ -31,11 +31,11 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -82,10 +82,6 @@ uint32_t matrix_scan_count; #endif #define ROW_SHIFTER ((matrix_row_t)1) -#if (DIODE_DIRECTION == COL2ROW) -// bitmask to ensure the row state from the expander only applies to its columns -#define EXPANDER_MASK ((matrix_row_t)0b00111111) -#endif __attribute__ ((weak)) void matrix_init_user(void) {} @@ -166,17 +162,17 @@ void init_expander(void) { /* Pin direction and pull-up depends on both the diode direction - and on whether the column register is 0 ("A") or 1 ("B"): + and on whether the column register is GPIOA or GPIOB +-------+---------------+---------------+ | | ROW2COL | COL2ROW | +-------+---------------+---------------+ - | Reg 0 | input, output | output, input | + | GPIOA | input, output | output, input | +-------+---------------+---------------+ - | Reg 1 | output, input | input, output | + | GPIOB | output, input | input, output | +-------+---------------+---------------+ */ -#if (EXPANDER_COLUMN_REGISTER == 0) +#if (EXPANDER_COL_REGISTER == GPIOA) # if (DIODE_DIRECTION == COL2ROW) expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out; expander_status = i2c_write(0); if (expander_status) goto out; @@ -184,7 +180,7 @@ void init_expander(void) { expander_status = i2c_write(0); if (expander_status) goto out; expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out; # endif -#elif (EXPANDER_COLUMN_REGISTER == 1) +#elif (EXPANDER_COL_REGISTER == GPIOB) # if (DIODE_DIRECTION == COL2ROW) expander_status = i2c_write(0); if (expander_status) goto out; expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out; @@ -202,7 +198,7 @@ void init_expander(void) { // - driving : off : 0 expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out; expander_status = i2c_write(GPPUA); if (expander_status) goto out; -#if (EXPANDER_COLUMN_REGISTER == 0) +#if (EXPANDER_COL_REGISTER == GPIOA) # if (DIODE_DIRECTION == COL2ROW) expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out; expander_status = i2c_write(0); if (expander_status) goto out; @@ -210,7 +206,7 @@ void init_expander(void) { expander_status = i2c_write(0); if (expander_status) goto out; expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out; # endif -#elif (EXPANDER_COLUMN_REGISTER == 1) +#elif (EXPANDER_COL_REGISTER == GPIOB) # if (DIODE_DIRECTION == COL2ROW) expander_status = i2c_write(0); if (expander_status) goto out; expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out; @@ -256,7 +252,7 @@ uint8_t matrix_scan(void) #if (DIODE_DIRECTION == COL2ROW) for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); if (matrix_changed) { @@ -270,7 +266,7 @@ uint8_t matrix_scan(void) #elif (DIODE_DIRECTION == ROW2COL) for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); if (matrix_changed) { @@ -284,8 +280,8 @@ uint8_t matrix_scan(void) } #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } @@ -299,7 +295,7 @@ uint8_t matrix_scan(void) bool matrix_is_modified(void) // deprecated and evidently not called. { -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) if (debouncing) return false; #endif return true; @@ -365,11 +361,11 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) // Read columns from expander, unless it's in an error state if (! expander_status) { - expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out; - expander_status = i2c_write(GPIOA); if (expander_status) goto out; - expander_status = i2c_start(I2C_ADDR_READ); if (expander_status) goto out; + expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out; + expander_status = i2c_write(EXPANDER_COL_REGISTER); if (expander_status) goto out; + expander_status = i2c_start(I2C_ADDR_READ); if (expander_status) goto out; - current_matrix[current_row] |= (~i2c_readNak()) & EXPANDER_MASK; + current_matrix[current_row] |= (~i2c_readNak()) & expander_input_pin_mask; out: i2c_stop(); @@ -394,9 +390,9 @@ static void select_row(uint8_t row) { if (! expander_status) { // set active row low : 0 // set other rows hi-Z : 1 - expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out; - expander_status = i2c_write(GPIOB); if (expander_status) goto out; - expander_status = i2c_write(0xFF & ~(1<. /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST +// WS2812 RGB LED strip input and number of LEDs +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 + /* number of backlight levels */ // #define BACKLIGHT_LEVELS 3 - - diff --git a/keyboards/handwired/dactyl_manuform/4x5/info.json b/keyboards/handwired/dactyl_manuform/4x5/info.json new file mode 100644 index 00000000000..4ee52e16446 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/info.json @@ -0,0 +1,59 @@ +{ + "keyboard_name": "Dactyl Manuform 4x5", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 7, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"R00", "x":10, "y":0}, + {"label":"R01", "x":11, "y":0}, + {"label":"R02", "x":12, "y":0}, + {"label":"R03", "x":13, "y":0}, + {"label":"R04", "x":14, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"R10", "x":10, "y":1}, + {"label":"R11", "x":11, "y":1}, + {"label":"R12", "x":12, "y":1}, + {"label":"R13", "x":13, "y":1}, + {"label":"R14", "x":14, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"R20", "x":10, "y":2}, + {"label":"R21", "x":11, "y":2}, + {"label":"R22", "x":12, "y":2}, + {"label":"R23", "x":13, "y":2}, + {"label":"R24", "x":14, "y":2}, + {"label":"L31", "x":1, "y":3}, + {"label":"L32", "x":2, "y":3}, + {"label":"R32", "x":12, "y":3}, + {"label":"R33", "x":13, "y":3}, + {"label":"L33", "x":3, "y":4}, + {"label":"L34", "x":4, "y":4}, + {"label":"R30", "x":10, "y":4}, + {"label":"R31", "x":11, "y":4}, + {"label":"L44", "x":5, "y":5}, + {"label":"L43", "x":6, "y":5}, + {"label":"R41", "x":8, "y":5}, + {"label":"R40", "x":9, "y":5}, + {"label":"L42", "x":5, "y":6}, + {"label":"L41", "x":6, "y":6}, + {"label":"R43", "x":8, "y":6}, + {"label":"R42", "x":9, "y":6} + ] + } + } +} diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h index 682c7a868b0..6b0ddbfe8e3 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h @@ -20,8 +20,6 @@ along with this program. If not, see . #pragma once -#include "../../config.h" - /* Use I2C or Serial, not both */ #define USE_SERIAL diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c index 24c02215ee5..2e5cfd7cedd 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "dactyl_manuform.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -126,4 +124,3 @@ void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); } - diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/rules.mk b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/rules.mk +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/rules.mk b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/rules.mk +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/handwired/dactyl_manuform/4x6/config.h b/keyboards/handwired/dactyl_manuform/4x6/config.h index d4a1922876a..a9ad1a36d70 100644 --- a/keyboards/handwired/dactyl_manuform/4x6/config.h +++ b/keyboards/handwired/dactyl_manuform/4x6/config.h @@ -38,3 +38,7 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW + +// WS2812 RGB LED strip input and number of LEDs +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 diff --git a/keyboards/handwired/dactyl_manuform/4x6/info.json b/keyboards/handwired/dactyl_manuform/4x6/info.json new file mode 100644 index 00000000000..ba358a703f4 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/info.json @@ -0,0 +1,65 @@ +{ + "keyboard_name": "Dactyl Manuform 4x6", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 7, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"R00", "x":11, "y":0}, + {"label":"R01", "x":12, "y":0}, + {"label":"R02", "x":13, "y":0}, + {"label":"R03", "x":14, "y":0}, + {"label":"R04", "x":15, "y":0}, + {"label":"R05", "x":16, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"R10", "x":11, "y":1}, + {"label":"R11", "x":12, "y":1}, + {"label":"R12", "x":13, "y":1}, + {"label":"R13", "x":14, "y":1}, + {"label":"R14", "x":15, "y":1}, + {"label":"R15", "x":16, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"R20", "x":11, "y":2}, + {"label":"R21", "x":12, "y":2}, + {"label":"R22", "x":13, "y":2}, + {"label":"R23", "x":14, "y":2}, + {"label":"R24", "x":15, "y":2}, + {"label":"R25", "x":16, "y":2}, + {"label":"L32", "x":2, "y":3}, + {"label":"L33", "x":3, "y":3}, + {"label":"R32", "x":13, "y":3}, + {"label":"R33", "x":14, "y":3}, + {"label":"L34", "x":4, "y":4}, + {"label":"L35", "x":5, "y":4}, + {"label":"R30", "x":11, "y":4}, + {"label":"R31", "x":12, "y":4}, + {"label":"L44", "x":6, "y":5}, + {"label":"L45", "x":7, "y":5}, + {"label":"R40", "x":9, "y":5}, + {"label":"R41", "x":10, "y":5}, + {"label":"L42", "x":6, "y":6}, + {"label":"L43", "x":7, "y":6}, + {"label":"R42", "x":9, "y":6}, + {"label":"R43", "x":10, "y":6} + ] + } + } +} diff --git a/keyboards/handwired/dactyl_manuform/5x6/5x6.h b/keyboards/handwired/dactyl_manuform/5x6/5x6.h index 72045cc2918..5292ca0972e 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/5x6.h +++ b/keyboards/handwired/dactyl_manuform/5x6/5x6.h @@ -6,35 +6,33 @@ #ifdef USE_I2C #include #ifdef __AVR__ - #include - #include + #include + #include #endif #endif #define LAYOUT_5x6(\ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L42, L43, R42, R43, \ - L44, L45, R40, R41, \ - L54, L55, R50, R51, \ - L52, L53, R52, R53 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { KC_NO, KC_NO, L42, L43, L44, L45 }, \ - { KC_NO, KC_NO, L52, L53, L54, L55 }, \ -\ - { R00, R01, R02, R03, R04, R05 }, \ - { R10, R11, R12, R13, R14, R15 }, \ - { R20, R21, R22, R23, R24, R25 }, \ - { R30, R31, R32, R33, R34, R35 }, \ - { R40, R41, R42, R43, KC_NO, KC_NO },\ - { R50, R51, R52, R53, KC_NO, KC_NO }, \ - } - - + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L42, L43, R42, R43, \ + L44, L45, R40, R41, \ + L54, L55, R50, R51, \ + L52, L53, R52, R53 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, L42, L43, L44, L45 }, \ + { KC_NO, KC_NO, L52, L53, L54, L55 }, \ + \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, KC_NO, KC_NO }, \ + { R50, R51, R52, R53, KC_NO, KC_NO } \ +} diff --git a/keyboards/handwired/dactyl_manuform/5x6/config.h b/keyboards/handwired/dactyl_manuform/5x6/config.h index 06ac02dfcb6..413039449f8 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/config.h +++ b/keyboards/handwired/dactyl_manuform/5x6/config.h @@ -32,10 +32,12 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } #define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } +// WS2812 RGB LED strip input and number of LEDs +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST /* number of backlight levels */ // #define BACKLIGHT_LEVELS 3 - diff --git a/keyboards/handwired/dactyl_manuform/5x6/info.json b/keyboards/handwired/dactyl_manuform/5x6/info.json new file mode 100644 index 00000000000..14afc704cd2 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/info.json @@ -0,0 +1,77 @@ +{ + "keyboard_name": "Dactyl Manuform 5x6", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 8, + "layouts": { + "LAYOUT_5x6": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"R00", "x":11, "y":0}, + {"label":"R01", "x":12, "y":0}, + {"label":"R02", "x":13, "y":0}, + {"label":"R03", "x":14, "y":0}, + {"label":"R04", "x":15, "y":0}, + {"label":"R05", "x":16, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"R10", "x":11, "y":1}, + {"label":"R11", "x":12, "y":1}, + {"label":"R12", "x":13, "y":1}, + {"label":"R13", "x":14, "y":1}, + {"label":"R14", "x":15, "y":1}, + {"label":"R15", "x":16, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"R20", "x":11, "y":2}, + {"label":"R21", "x":12, "y":2}, + {"label":"R22", "x":13, "y":2}, + {"label":"R23", "x":14, "y":2}, + {"label":"R24", "x":15, "y":2}, + {"label":"R25", "x":16, "y":2}, + {"label":"L30", "x":0, "y":3}, + {"label":"L31", "x":1, "y":3}, + {"label":"L32", "x":2, "y":3}, + {"label":"L33", "x":3, "y":3}, + {"label":"L34", "x":4, "y":3}, + {"label":"L35", "x":5, "y":3}, + {"label":"R30", "x":11, "y":3}, + {"label":"R31", "x":12, "y":3}, + {"label":"R32", "x":13, "y":3}, + {"label":"R33", "x":14, "y":3}, + {"label":"R34", "x":15, "y":3}, + {"label":"R35", "x":16, "y":3}, + {"label":"L42", "x":2, "y":4}, + {"label":"L43", "x":3, "y":4}, + {"label":"R42", "x":13, "y":4}, + {"label":"R43", "x":14, "y":4}, + {"label":"L44", "x":4, "y":5}, + {"label":"L45", "x":5, "y":5}, + {"label":"R40", "x":11, "y":5}, + {"label":"R41", "x":12, "y":5}, + {"label":"L54", "x":6, "y":6}, + {"label":"L55", "x":7, "y":6}, + {"label":"R50", "x":9, "y":6}, + {"label":"R51", "x":10, "y":6}, + {"label":"L52", "x":6, "y":7}, + {"label":"L53", "x":7, "y":7}, + {"label":"R52", "x":9, "y":7}, + {"label":"R53", "x":10, "y":7} + ] + } + } +} diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/config.h b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/config.h new file mode 100644 index 00000000000..10b96932677 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/config.h @@ -0,0 +1,9 @@ +#pragma once + +#include "333fred_config.h" + +#define USE_SERIAL +#define EE_HANDS + +#undef TAPPING_TERM +#define TAPPING_TERM 200 diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/keymap.c new file mode 100644 index 00000000000..bc61579de8a --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/keymap.c @@ -0,0 +1,60 @@ +#include QMK_KEYBOARD_H +#include "333fred.h" + +enum custom_macros { + DLEFT, + DRIGHT, + PSCREEN_APP +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE] = LAYOUT_5x6( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_RSFT), + KC_F4, KC_F5, TG(CODEFLOW), KC_EQL, + KC_LALT, KC_BSPC, KC_SPC, OSL(VIM), + TD(TD_COPY_PASTE), TD(TD_SYM_VIM), KC_ENT, KC_RGUI, + KC_LCTL, KC_DEL, KC_UP, KC_DOWN + ), + + [CODEFLOW] = LAYOUT_5x6( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F7, KC_F8, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), + + [SYMB] = LAYOUT_5x6( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, _______, KC_7, KC_8, KC_9, _______, KC_F12, + _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, _______, KC_4, KC_5, KC_6, _______, _______, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, KC_1, KC_2, KC_3, _______, _______, + KC_F7, KC_F8, KC_0, KC_ENT, + _______, _______, KC_MPLY, KC_MNXT, + _______, _______, KC_MPRV, _______, + _______, _______, KC_VOLU, KC_VOLD + ), + + [VIM] = LAYOUT_5x6( + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, + _______, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, + _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_process_keycode(keycode); + return !try_handle_macro(keycode, record); +} diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk new file mode 100644 index 00000000000..79ef33e7c36 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk @@ -0,0 +1,7 @@ + +NKRO_ENABLE = yes +KEY_LOCK_ENABLE = yes +TAP_DANCE_ENABLE = yes +CONSOLE_ENABLE = no +PERMISSIVE_HOLD = yes +EXTRAFLAGS += -flto diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c index 7be6a5bc71e..0d1efde33bb 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c @@ -11,10 +11,6 @@ extern keymap_config_t keymap_config; #define RAISE MO(_RAISE) #define LOWER MO(_LOWER) -#define _______ KC_TRNS - - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_5x6( diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c index 9a89212fec5..179b4486648 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c @@ -12,10 +12,6 @@ extern keymap_config_t keymap_config; #define RAISE MO(_RAISE) #define LOWER MO(_LOWER) -#define _______ KC_TRNS - - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/handwired/dactyl_manuform/5x7/5x7.h b/keyboards/handwired/dactyl_manuform/5x7/5x7.h index 95fd5bb1024..88b68b31e66 100644 --- a/keyboards/handwired/dactyl_manuform/5x7/5x7.h +++ b/keyboards/handwired/dactyl_manuform/5x7/5x7.h @@ -6,40 +6,40 @@ #ifdef USE_I2C #include #ifdef __AVR__ - #include - #include + #include + #include #endif #endif #define LAYOUT_5x7( \ - L11, L12, L13, L14, L15, L16, L17, \ - L21, L22, L23, L24, L25, L26, L27, \ - L31, L32, L33, L34, L35, L36, L37, \ - L41, L42, L43, L44, L45, L46, \ - L51, L52, L53, L54, \ - L55, L56, \ - L65, L66, \ - L63, L64, \ - R11, R12, R13, R14, R15, R16, R17, \ - R21, R22, R23, R24, R25, R26, R27, \ - R31, R32, R33, R34, R35, R36, R37, \ - R42, R43, R44, R45, R46, R47, \ - R54, R55, R56, R57, \ - R52, R53, \ - R62, R63, \ - R64, R65 \ - ) \ - { \ - { L11, L12, L13, L14, L15, L16, L17 }, \ - { L21, L22, L23, L24, L25, L26, L27 }, \ - { L31, L32, L33, L34, L35, L36, L37 }, \ - { L41, L42, L43, L44, L45, L46, KC_NO }, \ - { L51, L52, L53, L54, L55, L56, KC_NO }, \ - { KC_NO, KC_NO, L63, L64, L65, L66, KC_NO }, \ - { R11, R12, R13, R14, R15, R16, R17 }, \ - { R21, R22, R23, R24, R25, R26, R27 }, \ - { R31, R32, R33, R34, R35, R36, R37 }, \ - { KC_NO, R42, R43, R44, R45, R46, R47 }, \ - { KC_NO, R52, R53, R54, R55, R56, R57 }, \ - { KC_NO, R62, R63, R64, R65, KC_NO, KC_NO } \ - } + L11, L12, L13, L14, L15, L16, L17, \ + L21, L22, L23, L24, L25, L26, L27, \ + L31, L32, L33, L34, L35, L36, L37, \ + L41, L42, L43, L44, L45, L46, \ + L51, L52, L53, L54, \ + L55, L56, \ + L65, L66, \ + L63, L64, \ + R11, R12, R13, R14, R15, R16, R17, \ + R21, R22, R23, R24, R25, R26, R27, \ + R31, R32, R33, R34, R35, R36, R37, \ + R42, R43, R44, R45, R46, R47, \ + R54, R55, R56, R57, \ + R52, R53, \ + R62, R63, \ + R64, R65 \ + ) \ + { \ + { L11, L12, L13, L14, L15, L16, L17 }, \ + { L21, L22, L23, L24, L25, L26, L27 }, \ + { L31, L32, L33, L34, L35, L36, L37 }, \ + { L41, L42, L43, L44, L45, L46, KC_NO }, \ + { L51, L52, L53, L54, L55, L56, KC_NO }, \ + { KC_NO, KC_NO, L63, L64, L65, L66, KC_NO }, \ + { R11, R12, R13, R14, R15, R16, R17 }, \ + { R21, R22, R23, R24, R25, R26, R27 }, \ + { R31, R32, R33, R34, R35, R36, R37 }, \ + { KC_NO, R42, R43, R44, R45, R46, R47 }, \ + { KC_NO, R52, R53, R54, R55, R56, R57 }, \ + { KC_NO, R62, R63, R64, R65, KC_NO, KC_NO } \ +} diff --git a/keyboards/handwired/dactyl_manuform/5x7/config.h b/keyboards/handwired/dactyl_manuform/5x7/config.h index bef48f17ea9..43583749874 100644 --- a/keyboards/handwired/dactyl_manuform/5x7/config.h +++ b/keyboards/handwired/dactyl_manuform/5x7/config.h @@ -31,3 +31,7 @@ along with this program. If not, see . // wiring of each half #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 } #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } + +// WS2812 RGB LED strip input and number of LEDs +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 diff --git a/keyboards/handwired/dactyl_manuform/5x7/info.json b/keyboards/handwired/dactyl_manuform/5x7/info.json new file mode 100644 index 00000000000..33ba1b0e796 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x7/info.json @@ -0,0 +1,87 @@ +{ + "keyboard_name": "Dactyl Manuform 5x7", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 8, + "layouts": { + "LAYOUT_5x7": { + "layout": [ + {"label":"L11", "x":0, "y":0}, + {"label":"L12", "x":1, "y":0}, + {"label":"L13", "x":2, "y":0}, + {"label":"L14", "x":3, "y":0}, + {"label":"L15", "x":4, "y":0}, + {"label":"L16", "x":5, "y":0}, + {"label":"L17", "x":6, "y":0}, + {"label":"L21", "x":0, "y":1}, + {"label":"L22", "x":1, "y":1}, + {"label":"L23", "x":2, "y":1}, + {"label":"L24", "x":3, "y":1}, + {"label":"L25", "x":4, "y":1}, + {"label":"L26", "x":5, "y":1}, + {"label":"L27", "x":6, "y":1}, + {"label":"L31", "x":0, "y":2}, + {"label":"L32", "x":1, "y":2}, + {"label":"L33", "x":2, "y":2}, + {"label":"L34", "x":3, "y":2}, + {"label":"L35", "x":4, "y":2}, + {"label":"L36", "x":5, "y":2}, + {"label":"L37", "x":6, "y":2}, + {"label":"L41", "x":0, "y":3}, + {"label":"L42", "x":1, "y":3}, + {"label":"L43", "x":2, "y":3}, + {"label":"L44", "x":3, "y":3}, + {"label":"L45", "x":4, "y":3}, + {"label":"L46", "x":5, "y":3}, + {"label":"L51", "x":0, "y":4}, + {"label":"L52", "x":1, "y":4}, + {"label":"L53", "x":2, "y":4}, + {"label":"L54", "x":3, "y":4}, + {"label":"L55", "x":4, "y":5}, + {"label":"L56", "x":5, "y":5}, + {"label":"L65", "x":6, "y":6}, + {"label":"L66", "x":7, "y":6}, + {"label":"L63", "x":6, "y":7}, + {"label":"L64", "x":7, "y":7}, + {"label":"R11", "x":10, "y":0}, + {"label":"R12", "x":11, "y":0}, + {"label":"R13", "x":12, "y":0}, + {"label":"R14", "x":13, "y":0}, + {"label":"R15", "x":14, "y":0}, + {"label":"R16", "x":15, "y":0}, + {"label":"R17", "x":16, "y":0}, + {"label":"R21", "x":10, "y":1}, + {"label":"R22", "x":11, "y":1}, + {"label":"R23", "x":12, "y":1}, + {"label":"R24", "x":13, "y":1}, + {"label":"R25", "x":14, "y":1}, + {"label":"R26", "x":15, "y":1}, + {"label":"R27", "x":16, "y":1}, + {"label":"R31", "x":10, "y":2}, + {"label":"R32", "x":11, "y":2}, + {"label":"R33", "x":12, "y":2}, + {"label":"R34", "x":13, "y":2}, + {"label":"R35", "x":14, "y":2}, + {"label":"R36", "x":15, "y":2}, + {"label":"R37", "x":16, "y":2}, + {"label":"R42", "x":11, "y":3}, + {"label":"R43", "x":12, "y":3}, + {"label":"R44", "x":13, "y":3}, + {"label":"R45", "x":14, "y":3}, + {"label":"R46", "x":15, "y":3}, + {"label":"R47", "x":16, "y":3}, + {"label":"R54", "x":13, "y":4}, + {"label":"R55", "x":14, "y":4}, + {"label":"R56", "x":15, "y":4}, + {"label":"R57", "x":16, "y":4}, + {"label":"R52", "x":11, "y":5}, + {"label":"R53", "x":12, "y":5}, + {"label":"R62", "x":9, "y":6}, + {"label":"R63", "x":10, "y":6}, + {"label":"R64", "x":9, "y":7}, + {"label":"R65", "x":10, "y":7} + ] + } + } +} diff --git a/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/keymap.c index 8b83b538fee..1378f872324 100644 --- a/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/keymap.c +++ b/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/keymap.c @@ -10,10 +10,6 @@ extern keymap_config_t keymap_config; #define _FN 1 #define _NUMPAD 2 - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO // Some basic macros #define TASK LCTL(LSFT(KC_ESC)) #define TAB_R LCTL(KC_TAB) diff --git a/keyboards/handwired/dactyl_manuform/6x6/6x6.h b/keyboards/handwired/dactyl_manuform/6x6/6x6.h index c2980b3d318..039e6b40dfb 100644 --- a/keyboards/handwired/dactyl_manuform/6x6/6x6.h +++ b/keyboards/handwired/dactyl_manuform/6x6/6x6.h @@ -7,38 +7,36 @@ #ifdef USE_I2C #include #ifdef __AVR__ - #include - #include + #include + #include #endif #endif #define LAYOUT_6x6(\ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45, \ - L52, L53, R52, R53, \ - L54, L55, R50, R51, \ - L64, L65, R60, R61, \ - L62, L63, R62, R63 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { L40, L41, L42, L43, L44, L45 }, \ - { KC_NO, KC_NO, L52, L53, L54, L55 }, \ - { KC_NO, KC_NO, L62, L63, L64, L65 }, \ -\ - { R00, R01, R02, R03, R04, R05 }, \ - { R10, R11, R12, R13, R14, R15 }, \ - { R20, R21, R22, R23, R24, R25 }, \ - { R30, R31, R32, R33, R34, R35 }, \ - { R40, R41, R42, R43, R44, R45 }, \ - { R50, R51, R52, R53, KC_NO, KC_NO },\ - { R60, R61, R62, R63, KC_NO, KC_NO }, \ - } - - + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45, \ + L52, L53, R52, R53, \ + L54, L55, R50, R51, \ + L64, L65, R60, R61, \ + L62, L63, R62, R63 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { KC_NO, KC_NO, L52, L53, L54, L55 }, \ + { KC_NO, KC_NO, L62, L63, L64, L65 }, \ + \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 }, \ + { R50, R51, R52, R53, KC_NO, KC_NO }, \ + { R60, R61, R62, R63, KC_NO, KC_NO } \ +} diff --git a/keyboards/handwired/dactyl_manuform/6x6/config.h b/keyboards/handwired/dactyl_manuform/6x6/config.h index 9bb7b07bf2d..9bc501c5e90 100644 --- a/keyboards/handwired/dactyl_manuform/6x6/config.h +++ b/keyboards/handwired/dactyl_manuform/6x6/config.h @@ -31,3 +31,7 @@ along with this program. If not, see . // wiring of each half #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } #define MATRIX_ROW_PINS { F5, F6, F7, B1, B3, B2, B6 } + +// WS2812 RGB LED strip input and number of LEDs +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 diff --git a/keyboards/handwired/dactyl_manuform/6x6/info.json b/keyboards/handwired/dactyl_manuform/6x6/info.json new file mode 100644 index 00000000000..e617b39a82d --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/6x6/info.json @@ -0,0 +1,89 @@ +{ + "keyboard_name": "Dactyl Manuform 6x6", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 9, + "layouts": { + "LAYOUT_6x6": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"R00", "x":11, "y":0}, + {"label":"R01", "x":12, "y":0}, + {"label":"R02", "x":13, "y":0}, + {"label":"R03", "x":14, "y":0}, + {"label":"R04", "x":15, "y":0}, + {"label":"R05", "x":16, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"R10", "x":11, "y":1}, + {"label":"R11", "x":12, "y":1}, + {"label":"R12", "x":13, "y":1}, + {"label":"R13", "x":14, "y":1}, + {"label":"R14", "x":15, "y":1}, + {"label":"R15", "x":16, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"R20", "x":11, "y":2}, + {"label":"R21", "x":12, "y":2}, + {"label":"R22", "x":13, "y":2}, + {"label":"R23", "x":14, "y":2}, + {"label":"R24", "x":15, "y":2}, + {"label":"R25", "x":16, "y":2}, + {"label":"L30", "x":0, "y":3}, + {"label":"L31", "x":1, "y":3}, + {"label":"L32", "x":2, "y":3}, + {"label":"L33", "x":3, "y":3}, + {"label":"L34", "x":4, "y":3}, + {"label":"L35", "x":5, "y":3}, + {"label":"R30", "x":11, "y":3}, + {"label":"R31", "x":12, "y":3}, + {"label":"R32", "x":13, "y":3}, + {"label":"R33", "x":14, "y":3}, + {"label":"R34", "x":15, "y":3}, + {"label":"R35", "x":16, "y":3}, + {"label":"L40", "x":0, "y":4}, + {"label":"L41", "x":1, "y":4}, + {"label":"L42", "x":2, "y":4}, + {"label":"L43", "x":3, "y":4}, + {"label":"L44", "x":4, "y":4}, + {"label":"L45", "x":5, "y":4}, + {"label":"R40", "x":11, "y":4}, + {"label":"R41", "x":12, "y":4}, + {"label":"R42", "x":13, "y":4}, + {"label":"R43", "x":14, "y":4}, + {"label":"R44", "x":15, "y":4}, + {"label":"R45", "x":16, "y":4}, + {"label":"L52", "x":2, "y":5}, + {"label":"L53", "x":3, "y":5}, + {"label":"R52", "x":13, "y":5}, + {"label":"R53", "x":14, "y":5}, + {"label":"L54", "x":4, "y":6}, + {"label":"L55", "x":5, "y":6}, + {"label":"R50", "x":11, "y":6}, + {"label":"R51", "x":12, "y":6}, + {"label":"L64", "x":6, "y":7}, + {"label":"L65", "x":7, "y":7}, + {"label":"R60", "x":9, "y":7}, + {"label":"R61", "x":10, "y":7}, + {"label":"L62", "x":6, "y":8}, + {"label":"L63", "x":7, "y":8}, + {"label":"R62", "x":9, "y":8}, + {"label":"R63", "x":10, "y":8} + ] + } + } +} diff --git a/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/keymap.c index 1b1cbd4aea2..b78a5600867 100644 --- a/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/keymap.c +++ b/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/keymap.c @@ -9,8 +9,6 @@ extern keymap_config_t keymap_config; #define RAISE MO(_RAISE) #define LOWER MO(_LOWER) -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_6x6( diff --git a/keyboards/handwired/dactyl_manuform/config.h b/keyboards/handwired/dactyl_manuform/config.h index 320ce3c482d..7c95f705853 100644 --- a/keyboards/handwired/dactyl_manuform/config.h +++ b/keyboards/handwired/dactyl_manuform/config.h @@ -36,27 +36,19 @@ along with this program. If not, see . #define MOUSEKEY_WHEEL_DELAY 0 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Enables This makes it easier for fast typists to use dual-function keys */ #define PERMISSIVE_HOLD -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 12 // Number of LEDs - - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h index eea0757d59d..72f2acaab43 100644 --- a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h +++ b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h @@ -10,6 +10,8 @@ #include "5x7.h" #elif KEYBOARD_handwired_dactyl_manuform_6x6 #include "6x6.h" +#elif KEYBOARD_handwired_dactyl_manuform_dmote_62key + #include "62key.h" #endif //void promicro_bootloader_jmp(bool program); @@ -23,5 +25,3 @@ #include #endif #endif - - diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/62key.c b/keyboards/handwired/dactyl_manuform/dmote/62key/62key.c new file mode 100644 index 00000000000..e5d444277d2 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/62key.c @@ -0,0 +1,5 @@ +#include "62key.h" + +void matrix_init_kb(void) { + matrix_init_user(); +}; diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/62key.h b/keyboards/handwired/dactyl_manuform/dmote/62key/62key.h new file mode 100644 index 00000000000..27341016542 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/62key.h @@ -0,0 +1,54 @@ +#pragma once + +#include "dactyl_manuform.h" +#include "quantum.h" + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +// This uses the same coordinate system as the program that defines +// the case model, but not the same coordinates. +// Numbers increase going to the right and away from the user on the +// right-hand side of the keyboard. This is mirrored for the +// left-hand side. +// The matrix is constructed for ease of soldering, with the columns +// of the thumb cluster extending along the sides of the finger +// cluster so that everything can be contained in a 6x6 pattern. + +#define LAYOUT_62key( \ + LA_20, LA_10, LF_35, LF_25, LF_15, LF_05, \ + LF_55, LF_45, LF_34, LF_24, LF_14, LF_04, \ + LF_54, LF_44, LF_33, LF_23, LF_13, LF_03, \ + LF_53, LF_43, LF_32, LF_22, LF_12, \ + LF_21, LT_21, LT_22, \ + LT_10, LT_11, LT_12, \ + LT_01, LT_02, \ + \ + RF_05, RF_15, RF_25, RF_35, RA_10, RA_20, \ + RF_04, RF_14, RF_24, RF_34, RF_45, RF_55, \ + RF_03, RF_13, RF_23, RF_33, RF_44, RF_54, \ + RF_12, RF_22, RF_32, RF_43, RF_53, \ + RT_22, RT_21, RF_21, \ + RT_12, RT_11, RT_10, \ + RT_02, RT_01 \ + ) \ + { \ + { LA_20, LA_10, LF_35, LF_25, LF_15, LF_05 }, \ + { LF_55, LF_45, LF_34, LF_24, LF_14, LF_04 }, \ + { LF_54, LF_44, LF_33, LF_23, LF_13, LF_03 }, \ + { LF_53, LF_43, LF_32, LF_22, LF_12, LT_22 }, \ + { KC_NO, KC_NO, LT_21, LF_21, LT_11, LT_12 }, \ + { KC_NO, KC_NO, LT_10, KC_NO, LT_01, LT_02 }, \ + \ + { RA_20, RA_10, RF_35, RF_25, RF_15, RF_05 }, \ + { RF_55, RF_45, RF_34, RF_24, RF_14, RF_04 }, \ + { RF_54, RF_44, RF_33, RF_23, RF_13, RF_03 }, \ + { RF_53, RF_43, RF_32, RF_22, RF_12, RT_22 }, \ + { KC_NO, KC_NO, RT_21, RF_21, RT_11, RT_12 }, \ + { KC_NO, KC_NO, RT_10, KC_NO, RT_01, RT_02 }, \ + } diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/config.h b/keyboards/handwired/dactyl_manuform/dmote/62key/config.h new file mode 100644 index 00000000000..7db3ceb753b --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/config.h @@ -0,0 +1,49 @@ +#pragma once + +#include "config_common.h" + +#define PRODUCT DMOTE (62-key) +#define MATRIX_ROWS 12 +#define MATRIX_COLS 6 + +// MCUs are flipped on each side, relative to the shape of the case, +// but for ease of mounting, the pinout is not flipped with the controller. +// The same finger on each hand uses a column connected to the pin with the +// same silk-screen label on each Pro Micro. + +// Pin use: +// +// MCU | Silk | DMOTE +// -----+------+---------- +// D3 | TX0 | +// D2 | RX1 | +// D1 | 2 | LED strip input (dominant half only) +// D0 | 3 | Serial interface between halves +// D4 | 4 | Outermost pinky-finger column +// C6 | 5 | Column +// D7 | 6 | Column +// E6 | 7 | Column +// B4 | 8 | Column +// B5 | 9 | Outermost index-finger column +// -----+------+---------- +// F4 | A3 | +// F5 | A2 | +// F6 | A1 | Top row (furthest from user) +// F7 | A0 | Row +// B1 | 15 | Row +// B3 | 14 | Row +// B2 | 16 | Row +// B6 | 10 | Bottom row (closest to user) +#define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } + +// WS2812 RGB LED, normally used to indicate keyboard state: +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 +#define RGB_DI_PIN D1 +#define RGBLED_NUM 6 // Used when chaining strips +#define RGBLED_SPLIT { 3, 3 } // Used when not chaining strips +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/config.h new file mode 100644 index 00000000000..2e1d4f8dc37 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/config.h @@ -0,0 +1,5 @@ +#pragma once + +#define USE_SERIAL + +#define EE_HANDS diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/keymap.c new file mode 100644 index 00000000000..3012d40a1b5 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/keymap.c @@ -0,0 +1,146 @@ +#include "62key.h" +#include "rgblight.h" +#include +#include + +extern keymap_config_t keymap_config; + +// Automatic Layer ID: +enum layer_names { + _QWERTY, // OS-side Colemak. Default. + _COLEMAK, // Keyboard-side Colemak. Portability, emergency. + _NUMERIC +}; + +// Shorthand: +#define LAYER_N MO(_NUMERIC) +#define LAYER_C TG(_COLEMAK) +#define PASTE LSFT(KC_INS) // Terminal-compatible paste. +#define SLQ RALT(KC_9) // Single left-side quotation mark (in Colemak). +#define SRQ RALT(KC_0) +#define EMDASH RALT(LSFT(KC_MINUS)) // Em dash character (in Colemak). +#define BK_LCTL CTL_T(KC_LBRACKET) +#define BK_RCTL RCTL_T(KC_RBRACKET) +// TODO: Mod-tap ALT with a curvilinear brace. +// https://github.com/qmk/qmk_firmware/pull/2055 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_62key( + KC_VOLD, KC_VOLU, CM_W, CM_F, CM_P, CM_G, + KC_TAB, CM_Q, CM_R, CM_S, CM_T, CM_D, + KC_BSPC, CM_A, CM_X, CM_C, CM_V, CM_B, + SLQ, CM_Z, KC_HOME, KC_PGUP, KC_END, + KC_PGDN, KC_ENT, KC_SPC, + KC_LSPO, KC_LGUI, KC_MINS, + BK_LCTL, KC_LALT, + + CM_J, CM_L, CM_U, CM_Y, KC_MPLY, KC_MUTE, + CM_H, CM_N, CM_E, CM_I, CM_SCLN, KC_BSLS, + CM_K, CM_M, KC_COMM, KC_DOT, CM_O, KC_QUOT, + KC_LEFT, KC_UP, KC_RGHT, KC_SLSH, SRQ, + KC_DEL, KC_ESC, KC_DOWN, + KC_EQL, LAYER_N, KC_RSPC, + KC_RALT, BK_RCTL +), + +[_COLEMAK] = LAYOUT_62key( + _______, _______, KC_W, KC_F, KC_P, KC_G, + _______, KC_Q, KC_R, KC_S, KC_T, KC_D, + _______, KC_A, KC_X, KC_C, KC_V, KC_B, + _______, KC_Z, _______, _______, _______, + _______, _______, _______, + _______, _______, _______, + _______, _______, + + KC_J, KC_L, KC_U, KC_Y, _______, _______, + KC_H, KC_N, KC_E, KC_I, KC_SCLN, _______, + KC_K, KC_M, _______, _______, KC_O, _______, + _______, _______, _______, _______, _______, + _______, _______, _______, + _______, _______, _______, + _______, _______ +), + +[_NUMERIC] = LAYOUT_62key( + LAYER_C, KC_INS, KC_F2, KC_F3, KC_F4, KC_F5, + KC_F12, KC_F1, KC_2, KC_3, KC_4, KC_5, + _______, KC_1, KC_AT, KC_HASH, KC_DLR, KC_PERC, + KC_GRV, KC_EXLM, KC_BTN1, KC_WH_U, KC_BTN2, + KC_WH_D, RGB_MOD, _______, + _______, _______, EMDASH, + _______, _______, + + KC_F6, KC_F7, KC_F8, KC_F9, RESET, KC_WAKE, // * + KC_6, KC_7, KC_8, KC_9, KC_F10, KC_F11, + KC_CIRC, KC_AMPR, KC_ASTR, KC_APP, KC_0, PASTE, + KC_MS_L, KC_MS_U, KC_MS_R, KC_PSCR, RGB_TOG, + KC_ACL1, KC_ACL2, KC_MS_D, + KC_ACL0, _______, _______, + _______, _______ +) +}; +// *KC_WAKE: Used in place of KC_SLEP because X11 with i3 on prerelease +// Debian 10 was seeing duplicate keypress and release events for sleep +// (regardless of i3 binding), which ruined the function. + + +/* +The rest is all about lighting control. +The logic here represents a pretty poor compromise solution between the +following concerns: + +- Feedback on active modifiers. +- Flexibility: Both sides of the keyboard are interchangeable. +- Regular QMK RBG lighting modes. Specifically, Knight and Xmas. + +Currently, the last item suffers, because the first two seem to require +calling a function that implements the RGBLIGHT_SPLIT_SET_CHANGE_HSVS macro, +which most of the rgblight.c functions do not. In particular, functions that +target an individual LED do not do so correctly across the wire, so instead +we let HSV vary without ever targeting LEDs. +*/ + +// How long to wait between animation steps for "Knight" animation: +const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {255, 200, 100}; + +bool _initialized = false; +bool _leds_dirty = false; + +void modal_leds(void) { + uint8_t mods = get_mods(); + uint16_t hue = 355; // Rough match to printed case. + uint8_t saturation = 255; + uint8_t value = 0; + if (layer_state_is(_COLEMAK)) { hue -= 50; saturation -= 20; value += 20; }; + if (layer_state_is(_NUMERIC)) { value += 30; }; + if (mods & MOD_MASK_SHIFT) { saturation -= 20; value += 30; }; + if (mods & MOD_MASK_ALT) { hue -= 100; saturation -= 20; value += 30; }; + if (mods & MOD_MASK_CTRL) { hue -= 200; saturation -= 20; value += 30; }; + // rgblight_sethsv_eeprom_helper is not a great API function but it does + // affect both halves of a split keyboard. + rgblight_sethsv_eeprom_helper(hue, saturation, value, false); + _leds_dirty = false; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { + if (_leds_dirty) { modal_leds(); }; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!_initialized) { + // Static lighting is amenable to customization. + rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); + _initialized = true; + }; + if (keycode == KC_WAKE) { + // Turn the lights off before going to sleep. + rgblight_sethsv_eeprom_helper(0, 0, 0, false); + } else { + _leds_dirty = true; + }; + return true; +} diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/rules.mk b/keyboards/handwired/dactyl_manuform/dmote/62key/rules.mk new file mode 100644 index 00000000000..28d0bfb5c5b --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/rules.mk @@ -0,0 +1,5 @@ +# Build-process overrides for the DMOTE. +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +RGBLIGHT_ENABLE = yes # Needed for the C linker with lighting control. +COMMAND_ENABLE = no # Not a good combo with Space Cadet shift. diff --git a/keyboards/handwired/dactyl_manuform/dmote/config.h b/keyboards/handwired/dactyl_manuform/dmote/config.h new file mode 100644 index 00000000000..b8c5759db6b --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/config.h @@ -0,0 +1,3 @@ +#pragma once + +#include "config_common.h" diff --git a/keyboards/handwired/dactyl_manuform/dmote/readme.md b/keyboards/handwired/dactyl_manuform/dmote/readme.md new file mode 100644 index 00000000000..7aff2df5244 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/readme.md @@ -0,0 +1,16 @@ +DMOTE +====== + +The “Dactyl-ManuForm: Opposable Thumb Edition” is made from a Clojure +application maintained [here](https://github.com/veikman/dactyl-keyboard). +The application supports varied physical layouts and therefore matrices. +This physical variability is its main feature; its QMK firmware is ordinary. + +Consult the general [Dactyl-ManuForm readme](../readme.md). + +## The `62key` layout + +This folder represents the default build target of the Clojure application +as of its version 0.4.0. The default keymap for this layout has a QWERTY base +layer but is intended for running Colemak on the OS side with the i3 tiling +window manager. It’s also got a layer that forces Colemak from the QMK side. diff --git a/keyboards/handwired/dactyl_manuform/readme.md b/keyboards/handwired/dactyl_manuform/readme.md index 00288a8768d..3221da0e9db 100644 --- a/keyboards/handwired/dactyl_manuform/readme.md +++ b/keyboards/handwired/dactyl_manuform/readme.md @@ -131,17 +131,9 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep -// or the equivalent in dfu-programmer - -``` -and similarly for right half +make handwired/dactyl_promicro:default:dfu-split-left +make handwired/dactyl_promicro:default:dfu-split-right ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep -// or the equivalent in dfu-programmer -``` - -NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`) After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash. @@ -162,6 +154,6 @@ Also, if the slave board is producing weird characters in certain columns, update the following line in `matrix.c` to the following: ``` -// _delay_us(30); // without this wait read unstable value. -_delay_us(300); // without this wait read unstable value. +// wait_us(30); // without this wait read unstable value. +wait_us(300); // without this wait read unstable value. ``` diff --git a/keyboards/handwired/dactyl_manuform/rules.mk b/keyboards/handwired/dactyl_manuform/rules.mk index a93de368587..37806fa1647 100644 --- a/keyboards/handwired/dactyl_manuform/rules.mk +++ b/keyboards/handwired/dactyl_manuform/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/dactyl_promicro/config.h b/keyboards/handwired/dactyl_promicro/config.h new file mode 100644 index 00000000000..3c0b541d1a0 --- /dev/null +++ b/keyboards/handwired/dactyl_promicro/config.h @@ -0,0 +1,83 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" +#define PRODUCT Dactyl Ergo(6x6) + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } +#define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +//#define MANUFACTURER tshort +// defined in subfolder +#define DESCRIPTION A split keyboard + +/* mouse config */ +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* Enables This makes it easier for fast typists to use dual-function keys */ +#define PERMISSIVE_HOLD + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 12 // Number of LEDs + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/handwired/dactyl_promicro/dactyl_promicro.c b/keyboards/handwired/dactyl_promicro/dactyl_promicro.c new file mode 100644 index 00000000000..5d708cf4805 --- /dev/null +++ b/keyboards/handwired/dactyl_promicro/dactyl_promicro.c @@ -0,0 +1,12 @@ +#include "dactyl_promicro.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + matrix_init_user(); +}; \ No newline at end of file diff --git a/keyboards/handwired/dactyl_promicro/dactyl_promicro.h b/keyboards/handwired/dactyl_promicro/dactyl_promicro.h new file mode 100644 index 00000000000..5dfc42f2a94 --- /dev/null +++ b/keyboards/handwired/dactyl_promicro/dactyl_promicro.h @@ -0,0 +1,39 @@ +#pragma once + +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + + +#define LAYOUT_6x6(\ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45, \ + L55, L51, L52, R53, R54, R50, \ + L53, R52, \ + L54, R51 \ + )\ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { KC_NO, L51, L52, L53, L54, L55 }, \ +\ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 }, \ + { R50, R51, R52, R53, R54, KC_NO }, \ +} diff --git a/keyboards/handwired/dactyl_promicro/keymaps/default/config.h b/keyboards/handwired/dactyl_promicro/keymaps/default/config.h new file mode 100644 index 00000000000..ce8f3501ada --- /dev/null +++ b/keyboards/handwired/dactyl_promicro/keymaps/default/config.h @@ -0,0 +1,25 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define USE_SERIAL + +#define MASTER_RIGHT +// #define MASTER_RIGHT +//#define EE_HANDS +// Rows are doubled-up diff --git a/keyboards/handwired/dactyl_promicro/keymaps/default/keymap.c b/keyboards/handwired/dactyl_promicro/keymaps/default/keymap.c new file mode 100644 index 00000000000..d396e467628 --- /dev/null +++ b/keyboards/handwired/dactyl_promicro/keymaps/default/keymap.c @@ -0,0 +1,47 @@ + +/* A QWERTY 3 Layer layout for the Dactyl Manuform 6x6 Keyboard */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + [_QWERTY] = LAYOUT_6x6( + KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, + KC_LSFT , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, + KC_LCTL , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM , KC_DOT ,KC_SLSH,KC_BSLASH, + KC_PLUS , KC_LEFT,KC_UP ,KC_DOWN, KC_RGHT, RAISE , LOWER , KC_HOME, KC_PGUP, KC_PGDN,KC_END ,KC_EQL, + _______,KC_LALT,KC_PSCR, KC_LGUI, KC_SPC, KC_ENT,KC_GRAVE, KC_AT ,KC_PSCR ,_______ + + ), + + + [_LOWER] = LAYOUT_6x6( + KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS, + _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE, + _______,_______,_______,_______,_______,KC_PSCR, KC_P0 , KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______, _______,_______,_______,_______,_______ +), + + [_RAISE] = LAYOUT_6x6( + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE, + _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______, _______,_______,_______,_______,_______ + ), + + }; diff --git a/keyboards/handwired/dactyl_promicro/keymaps/impstyle/config.h b/keyboards/handwired/dactyl_promicro/keymaps/impstyle/config.h new file mode 100644 index 00000000000..ce8f3501ada --- /dev/null +++ b/keyboards/handwired/dactyl_promicro/keymaps/impstyle/config.h @@ -0,0 +1,25 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define USE_SERIAL + +#define MASTER_RIGHT +// #define MASTER_RIGHT +//#define EE_HANDS +// Rows are doubled-up diff --git a/keyboards/handwired/dactyl_promicro/keymaps/impstyle/keymap.c b/keyboards/handwired/dactyl_promicro/keymaps/impstyle/keymap.c new file mode 100644 index 00000000000..d396e467628 --- /dev/null +++ b/keyboards/handwired/dactyl_promicro/keymaps/impstyle/keymap.c @@ -0,0 +1,47 @@ + +/* A QWERTY 3 Layer layout for the Dactyl Manuform 6x6 Keyboard */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + [_QWERTY] = LAYOUT_6x6( + KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, + KC_LSFT , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, + KC_LCTL , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM , KC_DOT ,KC_SLSH,KC_BSLASH, + KC_PLUS , KC_LEFT,KC_UP ,KC_DOWN, KC_RGHT, RAISE , LOWER , KC_HOME, KC_PGUP, KC_PGDN,KC_END ,KC_EQL, + _______,KC_LALT,KC_PSCR, KC_LGUI, KC_SPC, KC_ENT,KC_GRAVE, KC_AT ,KC_PSCR ,_______ + + ), + + + [_LOWER] = LAYOUT_6x6( + KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS, + _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE, + _______,_______,_______,_______,_______,KC_PSCR, KC_P0 , KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______, _______,_______,_______,_______,_______ +), + + [_RAISE] = LAYOUT_6x6( + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE, + _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______, _______,_______,_______,_______,_______ + ), + + }; diff --git a/keyboards/handwired/dactyl_promicro/readme.md b/keyboards/handwired/dactyl_promicro/readme.md new file mode 100644 index 00000000000..a426319b4e5 --- /dev/null +++ b/keyboards/handwired/dactyl_promicro/readme.md @@ -0,0 +1,93 @@ +# Dactyl with Arduino Pro Micro + +See https://github.com/adereth/dactyl-keyboard for the original Version. + +This Dactyl uses the Arduino Pro Mirco (2x). +Wiring is a 6x6 Matrix like the [Dactyl Manuform](https://github.com/qmk/qmk_firmware/tree/master/keyboards/handwired/dactyl_manuform) + + +## Build the Firmware: + + - Build the firmware with `make handwired/dactyl_promicro:`, for example `make handwired/dactyl:default` + - This will result in a hex file called `handwired_dactyl_promicro_.hex`, e.g. + `handwired_dactyl_promicro_default.hex` + +How to setup your build enviroment can be found here: [Installing Build Tools](https://docs.qmk.fm/#/getting_started_build_tools) + +## Required Hardware + +Apart from diodes and key switches for the keyboard matrix in each half, you +will need: + +* 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each. +* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable + +Alternatively, you can use any sort of cable and socket that has at least 3 +wires. If you want to use I2C to communicate between halves, you will need a +cable with at least 4 wires and 2x 4.7kΩ pull-up resistors + +## Optional Hardware +A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. + +## Wiring + +The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. +PD0 on the ATmega32u4) between the two Pro Micros. + +Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro +and modify the `matrix.c` accordingly. + +The wiring for serial: + +![serial wiring](https://i.imgur.com/C3D1GAQ.png) + +The wiring for i2c: + +![i2c wiring](https://i.imgur.com/Hbzhc6E.png) + +The pull-up resistors may be placed on either half. It is also possible +to use 4 resistors and have the pull-ups in both halves, but this is +unnecessary in simple use cases. + +You can change your configuration between serial and i2c by modifying your `config.h` file. + +## Notes on Software Configuration + +the keymaps in here are for the 4x5 layout of the keyboard only. + +## Flashing + +To flash your firmware take a look at: [Flashing Instructions and Bootloader Information](https://docs.qmk.fm/#/flashing). + +Under Windows the most convenient way is installing the [QMK Drivers](https://github.com/qmk/qmk_driver_installer/releases) and use the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases). + + +## Choosing which board to plug the USB cable into (choosing Master) + +### Setting the right or left hand as master + +If you always plug the usb cable into the right board, add an extra flag to your `config.h` +``` + #define MASTER_RIGHT +``` + +OR + +``` + #define MASTER_LEFT +``` + + +Notes on Using Pro Micro 3.3V +----------------------------- + +Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects +the frequency on the 3.3V board. + +Also, if the slave board is producing weird characters in certain columns, +update the following line in `matrix.c` to the following: + +``` +// _delay_us(30); // without this wait read unstable value. +_delay_us(300); // without this wait read unstable value. +``` diff --git a/keyboards/handwired/dactyl_promicro/rules.mk b/keyboards/handwired/dactyl_promicro/rules.mk new file mode 100644 index 00000000000..37806fa1647 --- /dev/null +++ b/keyboards/handwired/dactyl_promicro/rules.mk @@ -0,0 +1,65 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes diff --git a/keyboards/handwired/daishi/config.h b/keyboards/handwired/daishi/config.h new file mode 100644 index 00000000000..b4665bece47 --- /dev/null +++ b/keyboards/handwired/daishi/config.h @@ -0,0 +1,60 @@ +/* +Copyright 2019 Crokto + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6D6D +#define PRODUCT_ID 0x0001 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MetaMechs +#define PRODUCT Daishi +#define DESCRIPTION Compact Battlecruiser + +/* key matrix size */ +#define MATRIX_ROWS 7 +#define MATRIX_COLS 18 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D6, D7, E0, E1, C0, C1, C2 } +#define MATRIX_COL_PINS { E6, E7, E3, B0, B1, B2, A6, A5, A4, A3, A2, A1, A0, F7, F6, F5, F4, F3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Set up rotary encoder */ +#define ENCODERS_PAD_A { F1 } +#define ENCODERS_PAD_B { F0 } +#define ENCODER_RESOLUTION 2 + +/* Set delay for tap_code on rotary encoder */ +#define TAP_CODE_DELAY 10 diff --git a/keyboards/handwired/daishi/daishi.c b/keyboards/handwired/daishi/daishi.c new file mode 100644 index 00000000000..dcd2cd0d153 --- /dev/null +++ b/keyboards/handwired/daishi/daishi.c @@ -0,0 +1,22 @@ +#include "daishi.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} \ No newline at end of file diff --git a/keyboards/handwired/daishi/daishi.h b/keyboards/handwired/daishi/daishi.h new file mode 100644 index 00000000000..49e37758972 --- /dev/null +++ b/keyboards/handwired/daishi/daishi.h @@ -0,0 +1,25 @@ +#pragma once + +#include "quantum.h" + +#define encoder_update(clockwise) encoder_update_user(uint8_t index, clockwise) + +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4E, K4F, K4G, K4H, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5D, K5E, K5F, K5G, K5H, \ + K60, K61, K62, K65, K69, K6A, K6C, K6D, K6E, K6F, K6G \ +){ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, K4E, K4F, K4G, K4H }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, KC_NO, K5D, K5E, K5F, K5G, K5H }, \ + { K60, K61, K62, KC_NO, KC_NO, K65, KC_NO, KC_NO, KC_NO, K69, K6A, KC_NO, K6C, K6D, K6E, K6F, K6G, KC_NO } \ +} diff --git a/keyboards/handwired/daishi/keymaps/default/keymap.c b/keyboards/handwired/daishi/keymaps/default/keymap.c new file mode 100644 index 00000000000..c0baf7006b9 --- /dev/null +++ b/keyboards/handwired/daishi/keymaps/default/keymap.c @@ -0,0 +1,124 @@ +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW 0 +#define _FN 1 + +enum custom_keycodes { + M_EXAMPLE1 = SAFE_RANGE, + M_EXAMPLE2, + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .-----------------------------------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | | | | | | | | | | DM1 | DM2 | DMSTOP | PRINT | SCROLL | PAUSE | FN | VOL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | HOME | PGUP | END | INS | NUM | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACK | PGDN | / | * | - | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | 7 | 8 | 9 | + | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | | 4 | 5 | 6 | = | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | | UP | 1 | 2 | 3 | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | LCTRL | LGUI | LALT | | | SPACE | | | | RALT | RCTRL | | LEFT | DOWN | RIGHT | 0 | . | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------' + */ + + [_QW] = LAYOUT( /* QWERTY */ + KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______,DYN_MACRO_PLAY1,DYN_MACRO_PLAY2,DYN_REC_STOP, KC_PSCR, KC_SLCK, KC_PAUS, MO(_FN), KC_MUTE, + KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_DEL , KC_HOME, KC_PGUP, KC_END , KC_INS , KC_NLCK, + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSPC, KC_PGDN, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_P7 , KC_P8 , KC_P9 , KC_PPLS, + KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_P4 , KC_P5 , KC_P6 , KC_EQL , + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_P1 , KC_P2 , KC_P3 , KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0 , KC_PDOT + ), + +/* FN + * .-----------------------------------------------------------------------------------------------------------------------------------------------------------------. + * | RESET | F13 | F14 | F15 | f16 | f17 | f18 | F19 | F20 | F21 | DM1 R | DM2 R | DMSTOP | | | | FN | DEBUG | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------| + * | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------' + */ + + [_FN] = LAYOUT( /* Function */ + RESET , KC_F13 , KC_F14 , KC_F15 , KC_F16 , KC_F17 , KC_F18 , KC_F19 , KC_F20 , KC_F21 ,DYN_REC_START1,DYN_REC_START2,DYN_REC_STOP, _______, _______, _______, MO(_FN), DEBUG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + if (record->event.pressed) { + switch(keycode) { + case M_EXAMPLE1: + SEND_STRING("This is an example macro!"SS_TAP(X_ENTER)); //prints "This is an example macro!" and hits Enter + return false; + case M_EXAMPLE2: + SEND_STRING("This is a another example!"SS_TAP(X_ENTER)); //prints "This is a another example!" and hits Enter + return false; + } + } + return true; +}; + +void encoder_update(bool clockwise) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } +} + +void matrix_init_user(void) { + // Call the keymap level matrix init. + + // Set our LED pins as output + setPinOutput(C4); + setPinOutput(C5); + setPinOutput(C6); +} + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_OFF(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(C4); + } else { + writePinHigh(C4); + } + if (IS_LED_OFF(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(C5); + } else { + writePinHigh(C5); + } + if (IS_LED_OFF(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(C6); + } else { + writePinHigh(C6); + } +} \ No newline at end of file diff --git a/keyboards/handwired/daishi/keymaps/default/readme.md b/keyboards/handwired/daishi/keymaps/default/readme.md new file mode 100644 index 00000000000..bed7fcb237b --- /dev/null +++ b/keyboards/handwired/daishi/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# Default Daishi Layout + +![Daishi Layout Image](https://i.imgur.com/fuJZGmw.png) + +This is the default layout that comes on the Daishi. For more information on the design of this layout, check out [kb.metamechs.com](http://kb.metamechs.com/daishi/). diff --git a/keyboards/handwired/daishi/readme.md b/keyboards/handwired/daishi/readme.md new file mode 100644 index 00000000000..88ac8ea79d0 --- /dev/null +++ b/keyboards/handwired/daishi/readme.md @@ -0,0 +1,15 @@ +# Daishi + +![Daishi](http://kb.metamechs.com/wp-content/uploads/2019/03/IMG_20190325_113405-e1553610532162-1024x709.jpg) + +A compact battlecruiser using the CBC1 PCB. [More info on kb.metamechs.com](http://kb.metamechs.com/daishi/) + +Keyboard Maintainer: [Crokto](https://github.com/Croktopus/) +Hardware Supported: CBC1 PCB +Hardware Availability: [kb.metamechs.com](http://kb.metamechs.com/daishi/get-your-own-daishi/) + +Make example for this keyboard (after setting up your build environment): + + make handwired/daishi:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/daishi/rules.mk b/keyboards/handwired/daishi/rules.mk new file mode 100644 index 00000000000..ece1eaaac3a --- /dev/null +++ b/keyboards/handwired/daishi/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = at90usb1286 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu + +# QMK Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +ENCODER_ENABLE = yes # Add rotary encoder support \ No newline at end of file diff --git a/keyboards/handwired/datahand/config.h b/keyboards/handwired/datahand/config.h new file mode 100644 index 00000000000..c7a0a43def3 --- /dev/null +++ b/keyboards/handwired/datahand/config.h @@ -0,0 +1,82 @@ +/* Copyright 2017-2019 Nikolaus Wittenstein + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +/* Taken from the DataHand PS/2-USB adaptor. */ +#define VENDOR_ID 0x13BA +#define PRODUCT_ID 0x0017 +#define DEVICE_VER 0x0001 +#define MANUFACTURER DataHand +#define PRODUCT DataHand +#define DESCRIPTION DataHand Teensy++ 2.0 conversion + +/* key matrix size */ +#define MATRIX_ROWS 13 +#define MATRIX_COLS 4 + +//#define DIODE_DIRECTION + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + */ +#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + */ + +/* + * Command/Windows key option + * + * If you define this, the thumb enter key becomes the Command/Windows key. There's still an enter key on the right + * ring finger, so this key is much better utilized as the otherwise nonexistent Command key. I think some newer + * DataHands let you remap right ring east as Command, but having it on the thumb is nicer. Comment out this define + * to use the original layout. + */ +#define DATAHAND_THUMB_RETURN_COMMAND diff --git a/keyboards/handwired/datahand/datahand.h b/keyboards/handwired/datahand/datahand.h new file mode 100644 index 00000000000..cb9a4d3e3b6 --- /dev/null +++ b/keyboards/handwired/datahand/datahand.h @@ -0,0 +1,133 @@ +/* Copyright 2017-2019 Nikolaus Wittenstein + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * The first section contains all of the arguements; the second converts the arguments into a two-dimensional array. + */ + +/* Each code is three letters + * l or r - left or right hand + * p, r, m, i, t - pinky, ring finger, middle finger, index finger, thumb + * fingers: n, s, e, w, c - north, south, east, west, and center (manual calls this "well" but we already have "west") + * thumb: p, n, c, l, u, k - pad, nail, center, lock (harder center), up, knuckle + */ +#define LAYOUT( \ + lpn, lrn, lmn, lin, rin, rmn, rrn, rpn, \ +lpw, lpc, lpe, lrw, lrc, lre, lmw, lmc, lme, liw, lic, lie, riw, ric, rie, rmw, rmc, rme, rrw, rrc, rre, rpw, rpc, rpe, \ + lps, lrs, lms, lis, ris, rms, rrs, rps, \ + ltp, ltn, rtn, rtp, \ + ltc, rtc, \ + ltl, rtl, \ + ltu, ltk, rtk, rtu) \ +{ \ + {riw, rin, lpw, lpn},\ + {ric, rie, lpc, lpe},\ + {ris, rms, lps, lrs},\ + {rmw, rmn, lrw, lrn},\ + {rmc, rme, lrc, lre},\ + {rrw, rrn, lmw, lmn},\ + {rrc, rre, lmc, lme},\ + {rrs, rps, lms, lis},\ + {rpw, rpn, liw, lin},\ + {rpc, rpe, lic, lie},\ + {rtk, rtn, ltk, ltn},\ + {rtc, rtl, ltc, ltl},\ + {rtp, rtu, ltp, ltu},\ +} + +/* Mode LEDs are active-low on Port B on the Teensy. */ +#define LED_MODE_PORT PORTB +#define LED_TENKEY (1<<3) +#define LED_FN (1<<4) +#define LED_NORMAL (1<<5) +#define LED_NAS (1<<6) + +/* Lock LEDs are active-low on Port F on the Teensy. */ +#define LED_LOCK_PORT PORTF +#define LED_CAPS_LOCK (1<<4) +#define LED_MOUSE_LOCK (1<<5) +#define LED_NUM_LOCK (1<<6) +#define LED_SCROLL_LOCK (1<<7) + + +/* Appendix: + * Table based on https://geekhack.org/index.php?topic=12212.msg2059319#msg2059319 + * Some pin assignments (e.g. for PS/2 I/O) have been fixed. + * + * Teensy Datahand 8051 pin pin 8051 Datahand Teensy + * ------ -------- ---- --- --- ---- -------- ------ + * GND Mtrx send A P1.0 1 40 VCC VCC VCC + * PB7 Mtrx send B P1.1 2 39 P0.0 LED RH NAS PB6 + * PD0 Mtrx send C P1.2 3 38 P0.1 LED RH NORM PB5 + * PD1 Mtrx send D P1.3 4 37 P0.2 LED RH FCTN PB4 + * PD2 RH rcv 0 P1.4 5 36 P0.3 LED RH 10K PB3 + * PD3 RH rcv 1 P1.5 6 35 P0.4 LED RH unused PB2 + * PD4 LH rcv 0 P1.6 7 34 P0.5 LED RH unused PE1 + * PD5 LH rcv 1 P1.7 8 33 P0.6 LED RH unused PE0 + * PD6 Reset button RST 9 32 P0.7 ? PE7 + * PD7 ? P3.0 10 31 VPP - PE6 + * PE0 ? P3.1 11 30 ALE - GND + * PE1 kbd data P3.2 12 29 PSEN - AREF + * PC0 ? P3.3 13 28 P2.7 ? PF0 + * PC1 kbd clk P3.4 14 27 P2.6 ? PF1 + * PC2 ? P3.5 15 26 P2.5 ? PF2 + * PC3 RAM P3.6 16 25 P2.4 ? PF3 + * PC4 RAM P3.7 17 24 P2.3 LED D15 LH (CAPLK) PF4 + * PC5 XTAL2 XTAL2 18 23 P2.2 LED D13 LH (MSELK) PF5 + * PC6 XTAL1 XTAL1 19 22 P2.1 LED D6 LH (NUMLK) PF6 + * PC7 GND GND 20 21 P2.0 LED D14 LH (SCRLK) PF7 + * + * JP3 Pinout + * 2 - keyboard data + * 3 - keyboard clock + * + * In order to get the Teensy to work, we need to move pin 1 to a different pin. This is + * because on the Teensy pin 1 is ground, but we need to write to pin 1 in order to read + * the keyboard matrix. An ideal pin to move it to is VPP (pin 31), because this pin tells + * the 8051 whether it should read from external or internal memory. The Teensy doesn't + * care about that. + * + * The easiest way to reassign the pin is to use standoffs. You can check out this thread: + * https://geekhack.org/index.php?topic=12212.msg235382#msg235382 for a picture of what + * this looks like. Note that in the picture the pin has been reassigned to pin 12. We + * don't want to do that because we're going to use that pin to send data over PS/2. + * + * We could if we wanted also reassign the PS/2 pins to Teensy hardware UART pins, but + * that's more work. Instead we'll just bit-bang PS/2 because it's an old, slow protocol + * (and because there's already a bit-banged PS/2 host implementation in QMK - we just + * need to add the device side). + * + * So overall, we want the following inputs and outputs: + * Outputs: + * Matrix: + * PB7 + * PD0 + * PD1 + * PE6 (moved from pin1, GND) + * LEDs: + * PB3-6 + * PF4-7 + * Inputs: + * Matrix: + * PD2-5 + * I/Os (start up as inputs): + * PS/2: + * PC1 + * PE1 + */ diff --git a/keyboards/handwired/datahand/keymaps/default/keymap.c b/keyboards/handwired/datahand/keymaps/default/keymap.c new file mode 100644 index 00000000000..8f44535594e --- /dev/null +++ b/keyboards/handwired/datahand/keymaps/default/keymap.c @@ -0,0 +1,313 @@ +/* Copyright 2017-2019 Nikolaus Wittenstein + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#include QMK_KEYBOARD_H + +#include + +/* Datahand features not supported: + * * All online reprogramming (user settings using the reset button). + * * Program Selection features. + * * Macros. + * * Direct substitutions. + * * L/R Modf. + * * Mouse Click Lock (Function Direct Access + Mouse Button key). + * * Different mouse movement speeds with the two pointer fingers, and using both pointer fingers to move even faster. + * + * As far as I know, everything else works. + */ + +enum layer { + NORMAL, +#ifdef DATAHAND_THUMB_RETURN_COMMAND + NORMAL_THUMB_RETURN_COMMAND, +#endif + FUNCTION_MOUSE, + FUNCTION_ARROWS, + NAS, + NAS_NUMLOCK, + NAS_TENKEY, + NAS_TENKEY_NUMLOCK, + + NUM_LAYERS +}; + +enum custom_keycodes { + N = SAFE_RANGE, /* Normal */ + NS, /* NAS */ + NSL, /* NAS Lock */ + NLK, /* Numlock */ + FN, /* Function mode - needs to be able to switch to mouse or arrow layer */ + TK0, /* Ten-key off button */ + TK1, /* Ten-key on button */ + AR, /* FN arrow mode */ + MS, /* FN mouse mode */ + DZ, /* Double zero button */ +}; + +static bool mouse_enabled = true; +static bool tenkey_enabled = false; +static bool numlock_enabled = false; +static bool nas_locked = false; + +/* Declared weak so that it can easily be overridden. */ +__attribute__((weak)) const uint16_t PROGMEM keymaps[NUM_LAYERS][MATRIX_ROWS][MATRIX_COLS] = { +[NORMAL] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_U, KC_I, KC_O, KC_P, +KC_DEL, KC_A, KC_LBRC, KC_ESC, KC_S, KC_B, KC_GRV, KC_D, KC_T, KC_DQT, KC_F, KC_G, KC_H, KC_J, KC_QUOT, KC_Y, KC_K, KC_COLN, KC_N, KC_L, KC_ENT, KC_RBRC, KC_SCLN, KC_BSLS, + KC_Z, KC_X, KC_C, KC_V, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_ENT, KC_TAB, KC_BSPC, KC_SPC, + KC_LSFT, NS, + KC_CAPS, NSL, + N, KC_LCTL, KC_LALT, FN), + +#ifdef DATAHAND_THUMB_RETURN_COMMAND +[NORMAL_THUMB_RETURN_COMMAND] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, + KC_LCMD, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, _______, _______), +#endif + +[FUNCTION_MOUSE] = LAYOUT( + KC_F2, KC_F4, KC_F6, KC_MS_U, KC_MS_U, KC_F8, KC_F10, KC_PGUP, +_______, KC_NO, KC_SLCK, _______, KC_BTN3, NLK, KC_BTN1, MS, KC_BTN2, KC_MS_L, KC_BTN1, KC_MS_R, KC_MS_L, KC_BTN2, KC_MS_R, KC_END, AR, KC_LSFT, KC_INS, KC_9, KC_ENT, KC_F11, KC_0, KC_F12, + KC_F1, KC_F3, KC_F5, KC_MS_D, KC_MS_D, KC_F7, KC_F9, KC_PGDN, + _______, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, _______, _______), +[FUNCTION_ARROWS] = LAYOUT( + _______, _______, _______, KC_UP, KC_UP, _______, _______, _______, +_______, _______, _______, _______, KC_LCTL, _______, _______, _______, _______, KC_LEFT, KC_HOME, KC_RGHT, KC_LEFT, KC_HOME, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_DOWN, KC_DOWN, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, _______, _______), +[NAS] = LAYOUT( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, +_______, KC_1, KC_TILD, _______, KC_2, NLK, KC_LABK, KC_3, KC_RABK, KC_SLSH, KC_4, KC_5, KC_6, KC_7, KC_UNDS, KC_CIRC, KC_8, KC_ENT, KC_SCLN, KC_9, KC_BSLS, TK0, KC_0, TK1, + KC_EQL, KC_X, KC_PERC, KC_MINS, KC_PLUS, KC_DOT, KC_SLSH, KC_QUES, + _______, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, _______, _______), +[NAS_NUMLOCK] = LAYOUT( + _______, _______, _______, _______, _______, KC_PAST, _______, _______, +_______, KC_KP_1, _______, _______, KC_KP_2, _______, _______, KC_KP_3, _______, KC_PSLS, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_7, _______, _______, KC_KP_8, _______, _______, KC_KP_9, KC_PENT, _______, KC_KP_0, _______, + KC_PEQL, _______, _______, KC_PMNS, KC_PPLS, _______, KC_PDOT, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, _______, _______), +[NAS_TENKEY] = LAYOUT( + _______, _______, _______, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, +_______, KC_QUOT, _______, _______, KC_DLR, _______, _______, KC_AMPR, _______, KC_LEFT, KC_HOME, KC_RGHT, KC_0, KC_4, DZ, KC_PLUS, KC_5, KC_MINS, KC_EQL, KC_6, KC_ENT, _______, KC_DOT, _______, + KC_LPRN, KC_RPRN, _______, KC_DOWN, KC_1, KC_2, KC_3, KC_SLSH, + _______, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, _______, _______), +[NAS_TENKEY_NUMLOCK] = LAYOUT( + _______, _______, _______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_PAST, +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_KP_4, _______, KC_PPLS, KC_KP_5, KC_PMNS, KC_PEQL, KC_KP_6, KC_PENT, _______, KC_PDOT, _______, + _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, + _______, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, _______, _______), +}; + +static void lock_led_set(bool on, uint8_t led) { + if (on) { + LED_LOCK_PORT &= ~led; + } else { + LED_LOCK_PORT |= led; + } +} + +static void mode_led_set(uint8_t led) { + static const uint8_t ALL_MODE_LEDS = LED_FN | LED_NORMAL | LED_NAS | LED_TENKEY; + LED_MODE_PORT |= ALL_MODE_LEDS; + LED_MODE_PORT &= ~led; +} + +static void layer_set(bool on, uint8_t layer) { + if (on) { + layer_on(layer); + } else { + layer_off(layer); + } + + if (layer_state_is(NAS) || layer_state_is(NAS_NUMLOCK) || layer_state_is(NAS_TENKEY) || layer_state_is(NAS_TENKEY_NUMLOCK)) { + if (tenkey_enabled) { + mode_led_set(LED_NAS | LED_TENKEY); + } else { + mode_led_set(LED_NAS); + } + } else if (layer_state_is(FUNCTION_MOUSE) || layer_state_is(FUNCTION_ARROWS)) { + mode_led_set(LED_FN); + } else if (layer_state_is(NORMAL)) { + mode_led_set(LED_NORMAL); + } +} + +static void set_normal(void) { + layer_move(NORMAL); + +#ifdef DATAHAND_THUMB_RETURN_COMMAND + layer_set(true, NORMAL_THUMB_RETURN_COMMAND); +#endif + + /* Then call layer_set to update LEDs. */ + layer_set(true, NORMAL); +} + +static void set_nas(bool on) { + /* Always turn on the base NAS layer so other layers can fall through. */ + layer_set(on, NAS); + + layer_set(on && numlock_enabled, NAS_NUMLOCK); + layer_set(on && tenkey_enabled, NAS_TENKEY); + layer_set(on && tenkey_enabled && numlock_enabled, NAS_TENKEY_NUMLOCK); +} + +static void set_tenkey(bool on) { + tenkey_enabled = on; + + /* We have to be on the NAS layer in order to be able to toggle TK. + * Re-toggle it on so that we move to the right layer (and set the right LED). + */ + set_nas(true); +} + +static void toggle_numlock(void) { + numlock_enabled = !numlock_enabled; + lock_led_set(numlock_enabled, LED_NUM_LOCK); + + if (layer_state_is(NAS)) { + /* If we're already in NAS, re-set it so that we activate the numlock layer. */ + set_nas(true); + } +} + +static void set_function(void) { + /* Make sure to turn off NAS if we're entering function */ + set_nas(false); + + /* Always turn on the mouse layer so the arrow layer can fall through. */ + layer_set(true, FUNCTION_MOUSE); + layer_set(!mouse_enabled, FUNCTION_ARROWS); +} + +static void set_mouse_enabled(bool on) { + mouse_enabled = on; + + /* Re-run set_function to set our layers correctly. */ + set_function(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + bool pressed = record->event.pressed; + + switch(keycode) { + case N: + if (pressed) { + set_normal(); + } + break; + + case NS: + if (pressed) { + nas_locked = false; + } + set_nas(pressed); + break; + + case NSL: + if (pressed) { + nas_locked = true; + set_nas(true); + } + break; + + case NLK: + if (pressed) { + toggle_numlock(); + SEND_STRING(SS_DOWN(X_NUMLOCK)); + } else { + SEND_STRING(SS_UP(X_NUMLOCK)); + } + break; + + case FN: + if (pressed) { + set_function(); + } + break; + + case TK0: + if (pressed) { + set_tenkey(false); + } + break; + + case TK1: + if (pressed) { + set_tenkey(true); + } + break; + + case MS: + if (pressed) { + set_mouse_enabled(true); + } + break; + + case AR: + if (pressed) { + set_mouse_enabled(false); + } + break; + + case DZ: + if (pressed) { + SEND_STRING(SS_TAP(X_KP_0) SS_TAP(X_KP_0)); + } + break; + } + + return true; +}; + +void matrix_init_user(void) { +#ifdef DATAHAND_THUMB_RETURN_COMMAND + set_normal(); +#endif +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + lock_led_set(usb_led & (1< + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#include "datahand.h" + +#include "matrix.h" +#include "action.h" + +#include +#include +#include + +static matrix_row_t matrix[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void select_row(uint8_t row); + +void matrix_init(void) { + /* See datahand.h for more detail on pins. */ + + /* 7 - matrix scan; 6-3 - mode LEDs */ + DDRB = 0b11111000; + + /* 1-0 - matrix scan */ + DDRD = 0b00000011; + + /* 6 - matrix scan */ + DDRE = 0b01000000; + + /* 7-4 - lock LEDs */ + DDRF = 0b11110000; + + /* Turn off the non-Normal LEDs (they're active low). */ + PORTB |= LED_TENKEY | LED_FN | LED_NAS; + + /* Turn off the lock LEDs. */ + PORTF |= LED_CAPS_LOCK | LED_NUM_LOCK | LED_SCROLL_LOCK | LED_MOUSE_LOCK; + + matrix_init_user(); +} + +uint8_t matrix_scan(void) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + select_row(row); + /* The default hardware works down to at least 100us, but I have a replacement + * photodiode that responds a little more slowly. Cranking it up to 1000us fixes + * shadowing issues. + */ + _delay_us(1000); + matrix[row] = read_cols(); + } + + matrix_scan_user(); + + return 1; +} + +matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_print(void) { + print("\nr/c 01234567\n"); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); + print(": "); + print_bin_reverse8(matrix_get_row(row)); + print("\n"); + } +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} + +static void select_row(uint8_t row) { + /* Original 8051: P1 bits 0-3 (pins 1-4) + * Teensy++: PE0, PB7, PD0, PD1 + */ + + if (row & (1<<0)) { + PORTE |= (1<<6); + } else { + PORTE &= ~(1<<6); + } + + if (row & (1<<1)) { + PORTB |= (1<<7); + } else { + PORTB &= ~(1<<7); + } + + if (row & (1<<2)) { + PORTD |= (1<<0); + } else { + PORTD &= ~(1<<0); + } + + if (row & (1<<3)) { + PORTD |= (1<<1); + } else { + PORTD &= ~(1<<1); + } +} + +static matrix_row_t read_cols(void) { + /* Original 8051: P1 bits 4-7 (pins 5-8) + * Teensy++: PD bits 2-5 + */ + + return (PIND & 0b00111100) >> 2; +} diff --git a/keyboards/handwired/datahand/readme.md b/keyboards/handwired/datahand/readme.md new file mode 100644 index 00000000000..923cebb00e7 --- /dev/null +++ b/keyboards/handwired/datahand/readme.md @@ -0,0 +1,15 @@ +# DataHand + +A keyboard designed to prevent RSI. See [Wikipedia](https://en.wikipedia.org/wiki/DataHand) and [this website](http://octopup.org/computer/datahand) for more info. + +To use this firmware, you have to replace the stock microcontroller with a Teensy++ 2.0. This is relatively easy and also reversible. See the notes at the bottom of datahand.h for more info. + +Keyboard Maintainer: [Nikolaus Wittenstein](https://github.com/adzenith) +Hardware Supported: DataHand Personal or Pro II +Hardware Availability: No longer in production + +Make example for this keyboard (after setting up your build environment): + + make handwired/datahand:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/datahand/rules.mk b/keyboards/handwired/datahand/rules.mk new file mode 100644 index 00000000000..59f14e17a40 --- /dev/null +++ b/keyboards/handwired/datahand/rules.mk @@ -0,0 +1,59 @@ +# Project-specific includes +SRC = matrix.c + +# MCU name +MCU = at90usb1286 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = halfkay + +# Build Options +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +CUSTOM_MATRIX = yes # We definitely have a nonstandard matrix + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/downbubble/config.h b/keyboards/handwired/downbubble/config.h new file mode 100644 index 00000000000..f2628cb706e --- /dev/null +++ b/keyboards/handwired/downbubble/config.h @@ -0,0 +1,240 @@ +/* +Copyright 2018 Don Chiou + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Flehrad +#define PRODUCT downbubble +#define DESCRIPTION An Ergonomic Centered Numpad Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 20 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F1, F2, F3, F4, F5, F6 } +#define MATRIX_COL_PINS { F7, C7, C6, C5, C4, C3, C2, C1, C0, E1, E0, D7, D6, D5, D4, D3, D2, D1, D0, B7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/handwired/downbubble/downbubble.c b/keyboards/handwired/downbubble/downbubble.c new file mode 100644 index 00000000000..48be8e49982 --- /dev/null +++ b/keyboards/handwired/downbubble/downbubble.c @@ -0,0 +1,16 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "downbubble.h" diff --git a/keyboards/handwired/downbubble/downbubble.h b/keyboards/handwired/downbubble/downbubble.h new file mode 100644 index 00000000000..0df39dd9ee0 --- /dev/null +++ b/keyboards/handwired/downbubble/downbubble.h @@ -0,0 +1,111 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_standard( \ + K00, K01, K02, K03, K04, K05, K06, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, K118, K119,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K29, K310, K311, K312, K313, K314, K315, K317, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K410, K411, K412, K413, K414, K416, K418, \ + K50, K51, K52, K53, K54, K56, K58, K49, K510, K512, K513, K514, K516, K517, K518, K519 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, KC_NO, KC_NO, KC_NO, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, KC_NO, K118, K119 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, KC_NO, K310, K311, K312, K313, K314, K315, KC_NO, K317, KC_NO, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K410, K411, K412, K413, K414, KC_NO, K416, KC_NO, K418, KC_NO }, \ + { K50, K51, K52, K53, K54, KC_NO, K56, KC_NO, K58, KC_NO, K510, KC_NO, K512, K513, K514, KC_NO, K516, K517, K518, K519 }, \ + } + +#define LAYOUT_split_bs( \ + K00, K01, K02, K03, K04, K05, K06, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K29, K310, K311, K312, K313, K314, K315, K317, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K410, K411, K412, K413, K414, K416, K418, \ + K50, K51, K52, K53, K54, K56, K58, K49, K510, K512, K513, K514, K516, K517, K518, K519 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, KC_NO, KC_NO, KC_NO, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, KC_NO, K310, K311, K312, K313, K314, K315, KC_NO, K317, KC_NO, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K410, K411, K412, K413, K414, KC_NO, K416, KC_NO, K418, KC_NO }, \ + { K50, K51, K52, K53, K54, KC_NO, K56, KC_NO, K58, KC_NO, K510, KC_NO, K512, K513, K514, KC_NO, K516, K517, K518, K519 }, \ + } + +#define LAYOUT_split_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, K118, K119,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K29, K310, K311, K312, K313, K314, K315, K317, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K410, K411, K412, K413, K414, K416, K417, K418, \ + K50, K51, K52, K53, K54, K56, K58, K49, K510, K512, K513, K514, K516, K517, K518, K519 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, KC_NO, KC_NO, KC_NO, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, KC_NO, K118, K119 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, KC_NO, K310, K311, K312, K313, K314, K315, KC_NO, K317, KC_NO, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K410, K411, K412, K413, K414, KC_NO, K416, K417, K418, KC_NO }, \ + { K50, K51, K52, K53, K54, KC_NO, K56, KC_NO, K58, KC_NO, K510, KC_NO, K512, K513, K514, KC_NO, K516, K517, K518, K519 }, \ + } + +#define LAYOUT_split_numpad( \ + K00, K01, K02, K03, K04, K05, K06, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, K118, K119,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312, K313, K314, K315, K317, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K410, K411, K412, K413, K414, K416, K418, \ + K50, K51, K52, K53, K54, K56, K57, K58, K59, K510, K512, K513, K514, K516, K517, K518, K519 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, KC_NO, KC_NO, KC_NO, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, KC_NO, K118, K119 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312, K313, K314, K315, KC_NO, K317, KC_NO, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K410, K411, K412, K413, K414, KC_NO, K416, KC_NO, K418, KC_NO }, \ + { K50, K51, K52, K53, K54, KC_NO, K56, K57, K58, K59, K510, KC_NO, K512, K513, K514, KC_NO, K516, K517, K518, K519 }, \ + } + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312, K313, K314, K315, K317, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K410, K411, K412, K413, K414, K416, K417, K418, \ + K50, K51, K52, K53, K54, K56, K57, K58, K59, K510, K512, K513, K514, K516, K517, K518, K519 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, KC_NO, KC_NO, KC_NO, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312, K313, K314, K315, KC_NO, K317, KC_NO, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K410, K411, K412, K413, K414, KC_NO, K416, K417, K418, KC_NO }, \ + { K50, K51, K52, K53, K54, KC_NO, K56, K57, K58, K59, K510, KC_NO, K512, K513, K514, KC_NO, K516, K517, K518, K519 }, \ + } diff --git a/keyboards/handwired/downbubble/info.json b/keyboards/handwired/downbubble/info.json new file mode 100644 index 00000000000..c5cd97de548 --- /dev/null +++ b/keyboards/handwired/downbubble/info.json @@ -0,0 +1,559 @@ +{ + "keyboard_name": "downbubble", + "url": "", + "maintainer": "flehrad", + "width": 22.75, + "height": 6, + "layouts": { + "LAYOUT_standard": { + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K010", "x":12.75, "y":0}, + {"label":"K011", "x":13.75, "y":0}, + {"label":"K012", "x":14.75, "y":0}, + {"label":"K013", "x":15.75, "y":0}, + {"label":"K014", "x":16.75, "y":0}, + {"label":"K015", "x":17.75, "y":0}, + {"label":"K016", "x":18.75, "y":0}, + {"label":"K017", "x":19.75, "y":0}, + {"label":"K018", "x":20.75, "y":0}, + {"label":"K019", "x":21.75, "y":0}, + {"label":"K10", "x":0, "y":1}, + {"label":"K11", "x":1, "y":1}, + {"label":"K12", "x":2, "y":1}, + {"label":"K13", "x":3, "y":1}, + {"label":"K14", "x":4, "y":1}, + {"label":"K15", "x":5, "y":1}, + {"label":"K16", "x":6, "y":1}, + {"label":"K17", "x":8.75, "y":1}, + {"label":"K18", "x":9.75, "y":1}, + {"label":"K19", "x":10.75, "y":1}, + {"label":"K110", "x":12.75, "y":1}, + {"label":"K111", "x":13.75, "y":1}, + {"label":"K112", "x":14.75, "y":1}, + {"label":"K113", "x":15.75, "y":1}, + {"label":"K114", "x":16.75, "y":1}, + {"label":"K115", "x":17.75, "y":1}, + {"label":"K116", "x":18.75, "y":1, "w":2}, + {"label":"K118", "x":20.75, "y":1}, + {"label":"K119", "x":21.75, "y":1}, + {"label":"K20", "x":0, "y":2, "w":1.5}, + {"label":"K21", "x":1.5, "y":2}, + {"label":"K22", "x":2.5, "y":2}, + {"label":"K23", "x":3.5, "y":2}, + {"label":"K24", "x":4.5, "y":2}, + {"label":"K25", "x":5.5, "y":2}, + {"label":"K26", "x":7.75, "y":2}, + {"label":"K17", "x":8.75, "y":2}, + {"label":"K28", "x":9.75, "y":2}, + {"label":"K210", "x":12.25, "y":2}, + {"label":"K211", "x":13.25, "y":2}, + {"label":"K212", "x":14.25, "y":2}, + {"label":"K213", "x":15.25, "y":2}, + {"label":"K214", "x":16.25, "y":2}, + {"label":"K215", "x":17.25, "y":2}, + {"label":"K216", "x":18.25, "y":2}, + {"label":"K217", "x":19.25, "y":2, "w":1.5}, + {"label":"K218", "x":20.75, "y":2}, + {"label":"K219", "x":21.75, "y":2}, + {"label":"K30", "x":0, "y":3, "w":1.75}, + {"label":"K31", "x":1.75, "y":3}, + {"label":"K32", "x":2.75, "y":3}, + {"label":"K33", "x":3.75, "y":3}, + {"label":"K34", "x":4.75, "y":3}, + {"label":"K35", "x":5.75, "y":3}, + {"label":"K36", "x":7.75, "y":3}, + {"label":"K37", "x":8.75, "y":3}, + {"label":"K38", "x":9.75, "y":3}, + {"label":"K29", "x":10.75, "y":2, "h":2}, + {"label":"K310", "x":12.5, "y":3}, + {"label":"K311", "x":13.5, "y":3}, + {"label":"K312", "x":14.5, "y":3}, + {"label":"K313", "x":15.5, "y":3}, + {"label":"K314", "x":16.5, "y":3}, + {"label":"K315", "x":17.5, "y":3}, + {"label":"K317", "x":18.5, "y":3, "w":2.25}, + {"label":"K40", "x":0, "y":4, "w":2.25}, + {"label":"K41", "x":2.25, "y":4}, + {"label":"K42", "x":3.25, "y":4}, + {"label":"K43", "x":4.25, "y":4}, + {"label":"K44", "x":5.25, "y":4}, + {"label":"K45", "x":6.25, "y":4}, + {"label":"K46", "x":7.75, "y":4}, + {"label":"K47", "x":8.75, "y":4}, + {"label":"K48", "x":9.75, "y":4}, + {"label":"K410", "x":13, "y":4}, + {"label":"K411", "x":14, "y":4}, + {"label":"K412", "x":15, "y":4}, + {"label":"K413", "x":16, "y":4}, + {"label":"K414", "x":17, "y":4}, + {"label":"K416", "x":18, "y":4, "w":2.75}, + {"label":"K418", "x":20.75, "y":4}, + {"label":"K50", "x":0, "y":5, "w":1.25}, + {"label":"K51", "x":1.25, "y":5, "w":1.25}, + {"label":"K52", "x":2.5, "y":5, "w":1.25}, + {"label":"K53", "x":3.75, "y":5, "w":1.25}, + {"label":"K54", "x":5, "y":5, "w":2.25}, + {"label":"K56", "x":7.75, "y":5, "w":2}, + {"label":"K58", "x":9.75, "y":5}, + {"label":"K49", "x":10.75, "y":4, "h":2}, + {"label":"K510", "x":13, "y":5, "w":2}, + {"label":"K512", "x":15, "y":5, "w":1.25}, + {"label":"K513", "x":16.25, "y":5, "w":1.25}, + {"label":"K514", "x":17.5, "y":5, "w":1.25}, + {"label":"K516", "x":18.75, "y":5}, + {"label":"K517", "x":19.75, "y":5}, + {"label":"K518", "x":20.75, "y":5}, + {"label":"K519", "x":21.75, "y":5} + ] + }, + "LAYOUT_split_bs": { + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K010", "x":12.75, "y":0}, + {"label":"K011", "x":13.75, "y":0}, + {"label":"K012", "x":14.75, "y":0}, + {"label":"K013", "x":15.75, "y":0}, + {"label":"K014", "x":16.75, "y":0}, + {"label":"K015", "x":17.75, "y":0}, + {"label":"K016", "x":18.75, "y":0}, + {"label":"K017", "x":19.75, "y":0}, + {"label":"K018", "x":20.75, "y":0}, + {"label":"K019", "x":21.75, "y":0}, + {"label":"K10", "x":0, "y":1}, + {"label":"K11", "x":1, "y":1}, + {"label":"K12", "x":2, "y":1}, + {"label":"K13", "x":3, "y":1}, + {"label":"K14", "x":4, "y":1}, + {"label":"K15", "x":5, "y":1}, + {"label":"K16", "x":6, "y":1}, + {"label":"K17", "x":8.75, "y":1}, + {"label":"K18", "x":9.75, "y":1}, + {"label":"K19", "x":10.75, "y":1}, + {"label":"K110", "x":12.75, "y":1}, + {"label":"K111", "x":13.75, "y":1}, + {"label":"K112", "x":14.75, "y":1}, + {"label":"K113", "x":15.75, "y":1}, + {"label":"K114", "x":16.75, "y":1}, + {"label":"K115", "x":17.75, "y":1}, + {"label":"K116", "x":18.75, "y":1}, + {"label":"K117", "x":19.75, "y":1}, + {"label":"K118", "x":20.75, "y":1}, + {"label":"K119", "x":21.75, "y":1}, + {"label":"K20", "x":0, "y":2, "w":1.5}, + {"label":"K21", "x":1.5, "y":2}, + {"label":"K22", "x":2.5, "y":2}, + {"label":"K23", "x":3.5, "y":2}, + {"label":"K24", "x":4.5, "y":2}, + {"label":"K25", "x":5.5, "y":2}, + {"label":"K26", "x":7.75, "y":2}, + {"label":"K17", "x":8.75, "y":2}, + {"label":"K28", "x":9.75, "y":2}, + {"label":"K210", "x":12.25, "y":2}, + {"label":"K211", "x":13.25, "y":2}, + {"label":"K212", "x":14.25, "y":2}, + {"label":"K213", "x":15.25, "y":2}, + {"label":"K214", "x":16.25, "y":2}, + {"label":"K215", "x":17.25, "y":2}, + {"label":"K216", "x":18.25, "y":2}, + {"label":"K217", "x":19.25, "y":2, "w":1.5}, + {"label":"K218", "x":20.75, "y":2}, + {"label":"K219", "x":21.75, "y":2}, + {"label":"K30", "x":0, "y":3, "w":1.75}, + {"label":"K31", "x":1.75, "y":3}, + {"label":"K32", "x":2.75, "y":3}, + {"label":"K33", "x":3.75, "y":3}, + {"label":"K34", "x":4.75, "y":3}, + {"label":"K35", "x":5.75, "y":3}, + {"label":"K36", "x":7.75, "y":3}, + {"label":"K37", "x":8.75, "y":3}, + {"label":"K38", "x":9.75, "y":3}, + {"label":"K29", "x":10.75, "y":2, "h":2}, + {"label":"K310", "x":12.5, "y":3}, + {"label":"K311", "x":13.5, "y":3}, + {"label":"K312", "x":14.5, "y":3}, + {"label":"K313", "x":15.5, "y":3}, + {"label":"K314", "x":16.5, "y":3}, + {"label":"K315", "x":17.5, "y":3}, + {"label":"K317", "x":18.5, "y":3, "w":2.25}, + {"label":"K40", "x":0, "y":4, "w":2.25}, + {"label":"K41", "x":2.25, "y":4}, + {"label":"K42", "x":3.25, "y":4}, + {"label":"K43", "x":4.25, "y":4}, + {"label":"K44", "x":5.25, "y":4}, + {"label":"K45", "x":6.25, "y":4}, + {"label":"K46", "x":7.75, "y":4}, + {"label":"K47", "x":8.75, "y":4}, + {"label":"K48", "x":9.75, "y":4}, + {"label":"K410", "x":13, "y":4}, + {"label":"K411", "x":14, "y":4}, + {"label":"K412", "x":15, "y":4}, + {"label":"K413", "x":16, "y":4}, + {"label":"K414", "x":17, "y":4}, + {"label":"K416", "x":18, "y":4, "w":2.75}, + {"label":"K418", "x":20.75, "y":4}, + {"label":"K50", "x":0, "y":5, "w":1.25}, + {"label":"K51", "x":1.25, "y":5, "w":1.25}, + {"label":"K52", "x":2.5, "y":5, "w":1.25}, + {"label":"K53", "x":3.75, "y":5, "w":1.25}, + {"label":"K54", "x":5, "y":5, "w":2.25}, + {"label":"K56", "x":7.75, "y":5, "w":2}, + {"label":"K58", "x":9.75, "y":5}, + {"label":"K49", "x":10.75, "y":4, "h":2}, + {"label":"K510", "x":13, "y":5, "w":2}, + {"label":"K512", "x":15, "y":5, "w":1.25}, + {"label":"K513", "x":16.25, "y":5, "w":1.25}, + {"label":"K514", "x":17.5, "y":5, "w":1.25}, + {"label":"K516", "x":18.75, "y":5}, + {"label":"K517", "x":19.75, "y":5}, + {"label":"K518", "x":20.75, "y":5}, + {"label":"K519", "x":21.75, "y":5} + ] + }, + "LAYOUT_split_rshift": { + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K010", "x":12.75, "y":0}, + {"label":"K011", "x":13.75, "y":0}, + {"label":"K012", "x":14.75, "y":0}, + {"label":"K013", "x":15.75, "y":0}, + {"label":"K014", "x":16.75, "y":0}, + {"label":"K015", "x":17.75, "y":0}, + {"label":"K016", "x":18.75, "y":0}, + {"label":"K017", "x":19.75, "y":0}, + {"label":"K018", "x":20.75, "y":0}, + {"label":"K019", "x":21.75, "y":0}, + {"label":"K10", "x":0, "y":1}, + {"label":"K11", "x":1, "y":1}, + {"label":"K12", "x":2, "y":1}, + {"label":"K13", "x":3, "y":1}, + {"label":"K14", "x":4, "y":1}, + {"label":"K15", "x":5, "y":1}, + {"label":"K16", "x":6, "y":1}, + {"label":"K17", "x":8.75, "y":1}, + {"label":"K18", "x":9.75, "y":1}, + {"label":"K19", "x":10.75, "y":1}, + {"label":"K110", "x":12.75, "y":1}, + {"label":"K111", "x":13.75, "y":1}, + {"label":"K112", "x":14.75, "y":1}, + {"label":"K113", "x":15.75, "y":1}, + {"label":"K114", "x":16.75, "y":1}, + {"label":"K115", "x":17.75, "y":1}, + {"label":"K116", "x":18.75, "y":1, "w":2}, + {"label":"K118", "x":20.75, "y":1}, + {"label":"K119", "x":21.75, "y":1}, + {"label":"K20", "x":0, "y":2, "w":1.5}, + {"label":"K21", "x":1.5, "y":2}, + {"label":"K22", "x":2.5, "y":2}, + {"label":"K23", "x":3.5, "y":2}, + {"label":"K24", "x":4.5, "y":2}, + {"label":"K25", "x":5.5, "y":2}, + {"label":"K26", "x":7.75, "y":2}, + {"label":"K17", "x":8.75, "y":2}, + {"label":"K28", "x":9.75, "y":2}, + {"label":"K210", "x":12.25, "y":2}, + {"label":"K211", "x":13.25, "y":2}, + {"label":"K212", "x":14.25, "y":2}, + {"label":"K213", "x":15.25, "y":2}, + {"label":"K214", "x":16.25, "y":2}, + {"label":"K215", "x":17.25, "y":2}, + {"label":"K216", "x":18.25, "y":2}, + {"label":"K217", "x":19.25, "y":2, "w":1.5}, + {"label":"K218", "x":20.75, "y":2}, + {"label":"K219", "x":21.75, "y":2}, + {"label":"K30", "x":0, "y":3, "w":1.75}, + {"label":"K31", "x":1.75, "y":3}, + {"label":"K32", "x":2.75, "y":3}, + {"label":"K33", "x":3.75, "y":3}, + {"label":"K34", "x":4.75, "y":3}, + {"label":"K35", "x":5.75, "y":3}, + {"label":"K36", "x":7.75, "y":3}, + {"label":"K37", "x":8.75, "y":3}, + {"label":"K38", "x":9.75, "y":3}, + {"label":"K29", "x":10.75, "y":2, "h":2}, + {"label":"K310", "x":12.5, "y":3}, + {"label":"K311", "x":13.5, "y":3}, + {"label":"K312", "x":14.5, "y":3}, + {"label":"K313", "x":15.5, "y":3}, + {"label":"K314", "x":16.5, "y":3}, + {"label":"K315", "x":17.5, "y":3}, + {"label":"K317", "x":18.5, "y":3, "w":2.25}, + {"label":"K40", "x":0, "y":4, "w":2.25}, + {"label":"K41", "x":2.25, "y":4}, + {"label":"K42", "x":3.25, "y":4}, + {"label":"K43", "x":4.25, "y":4}, + {"label":"K44", "x":5.25, "y":4}, + {"label":"K45", "x":6.25, "y":4}, + {"label":"K46", "x":7.75, "y":4}, + {"label":"K47", "x":8.75, "y":4}, + {"label":"K48", "x":9.75, "y":4}, + {"label":"K410", "x":13, "y":4}, + {"label":"K411", "x":14, "y":4}, + {"label":"K412", "x":15, "y":4}, + {"label":"K413", "x":16, "y":4}, + {"label":"K414", "x":17, "y":4}, + {"label":"K416", "x":18, "y":4, "w":1.75}, + {"label":"K417", "x":19.75, "y":4}, + {"label":"K418", "x":20.75, "y":4}, + {"label":"K50", "x":0, "y":5, "w":1.25}, + {"label":"K51", "x":1.25, "y":5, "w":1.25}, + {"label":"K52", "x":2.5, "y":5, "w":1.25}, + {"label":"K53", "x":3.75, "y":5, "w":1.25}, + {"label":"K54", "x":5, "y":5, "w":2.25}, + {"label":"K56", "x":7.75, "y":5, "w":2}, + {"label":"K58", "x":9.75, "y":5}, + {"label":"K49", "x":10.75, "y":4, "h":2}, + {"label":"K510", "x":13, "y":5, "w":2}, + {"label":"K512", "x":15, "y":5, "w":1.25}, + {"label":"K513", "x":16.25, "y":5, "w":1.25}, + {"label":"K514", "x":17.5, "y":5, "w":1.25}, + {"label":"K516", "x":18.75, "y":5}, + {"label":"K517", "x":19.75, "y":5}, + {"label":"K518", "x":20.75, "y":5}, + {"label":"K519", "x":21.75, "y":5} + ] + }, + "LAYOUT_split_numpad": { + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K010", "x":12.75, "y":0}, + {"label":"K011", "x":13.75, "y":0}, + {"label":"K012", "x":14.75, "y":0}, + {"label":"K013", "x":15.75, "y":0}, + {"label":"K014", "x":16.75, "y":0}, + {"label":"K015", "x":17.75, "y":0}, + {"label":"K016", "x":18.75, "y":0}, + {"label":"K017", "x":19.75, "y":0}, + {"label":"K018", "x":20.75, "y":0}, + {"label":"K019", "x":21.75, "y":0}, + {"label":"K10", "x":0, "y":1}, + {"label":"K11", "x":1, "y":1}, + {"label":"K12", "x":2, "y":1}, + {"label":"K13", "x":3, "y":1}, + {"label":"K14", "x":4, "y":1}, + {"label":"K15", "x":5, "y":1}, + {"label":"K16", "x":6, "y":1}, + {"label":"K17", "x":8.75, "y":1}, + {"label":"K18", "x":9.75, "y":1}, + {"label":"K19", "x":10.75, "y":1}, + {"label":"K110", "x":12.75, "y":1}, + {"label":"K111", "x":13.75, "y":1}, + {"label":"K112", "x":14.75, "y":1}, + {"label":"K113", "x":15.75, "y":1}, + {"label":"K114", "x":16.75, "y":1}, + {"label":"K115", "x":17.75, "y":1}, + {"label":"K116", "x":18.75, "y":1, "w":2}, + {"label":"K118", "x":20.75, "y":1}, + {"label":"K119", "x":21.75, "y":1}, + {"label":"K20", "x":0, "y":2, "w":1.5}, + {"label":"K21", "x":1.5, "y":2}, + {"label":"K22", "x":2.5, "y":2}, + {"label":"K23", "x":3.5, "y":2}, + {"label":"K24", "x":4.5, "y":2}, + {"label":"K25", "x":5.5, "y":2}, + {"label":"K26", "x":7.75, "y":2}, + {"label":"K17", "x":8.75, "y":2}, + {"label":"K28", "x":9.75, "y":2}, + {"label":"K29", "x":10.75, "y":2}, + {"label":"K210", "x":12.25, "y":2}, + {"label":"K211", "x":13.25, "y":2}, + {"label":"K212", "x":14.25, "y":2}, + {"label":"K213", "x":15.25, "y":2}, + {"label":"K214", "x":16.25, "y":2}, + {"label":"K215", "x":17.25, "y":2}, + {"label":"K216", "x":18.25, "y":2}, + {"label":"K217", "x":19.25, "y":2, "w":1.5}, + {"label":"K218", "x":20.75, "y":2}, + {"label":"K219", "x":21.75, "y":2}, + {"label":"K30", "x":0, "y":3, "w":1.75}, + {"label":"K31", "x":1.75, "y":3}, + {"label":"K32", "x":2.75, "y":3}, + {"label":"K33", "x":3.75, "y":3}, + {"label":"K34", "x":4.75, "y":3}, + {"label":"K35", "x":5.75, "y":3}, + {"label":"K36", "x":7.75, "y":3}, + {"label":"K37", "x":8.75, "y":3}, + {"label":"K38", "x":9.75, "y":3}, + {"label":"K39", "x":10.75, "y":3}, + {"label":"K310", "x":12.5, "y":3}, + {"label":"K311", "x":13.5, "y":3}, + {"label":"K312", "x":14.5, "y":3}, + {"label":"K313", "x":15.5, "y":3}, + {"label":"K314", "x":16.5, "y":3}, + {"label":"K315", "x":17.5, "y":3}, + {"label":"K317", "x":18.5, "y":3, "w":2.25}, + {"label":"K40", "x":0, "y":4, "w":2.25}, + {"label":"K41", "x":2.25, "y":4}, + {"label":"K42", "x":3.25, "y":4}, + {"label":"K43", "x":4.25, "y":4}, + {"label":"K44", "x":5.25, "y":4}, + {"label":"K45", "x":6.25, "y":4}, + {"label":"K46", "x":7.75, "y":4}, + {"label":"K47", "x":8.75, "y":4}, + {"label":"K48", "x":9.75, "y":4}, + {"label":"K49", "x":10.75, "y":4}, + {"label":"K410", "x":13, "y":4}, + {"label":"K411", "x":14, "y":4}, + {"label":"K412", "x":15, "y":4}, + {"label":"K413", "x":16, "y":4}, + {"label":"K414", "x":17, "y":4}, + {"label":"K416", "x":18, "y":4, "w":2.75}, + {"label":"K418", "x":20.75, "y":4}, + {"label":"K50", "x":0, "y":5, "w":1.25}, + {"label":"K51", "x":1.25, "y":5, "w":1.25}, + {"label":"K52", "x":2.5, "y":5, "w":1.25}, + {"label":"K53", "x":3.75, "y":5, "w":1.25}, + {"label":"K54", "x":5, "y":5, "w":2.25}, + {"label":"K56", "x":7.75, "y":5}, + {"Label":"K57", "x":8.75, "y":5}, + {"label":"K58", "x":9.75, "y":5}, + {"label":"K59", "x":10.75, "y":5}, + {"label":"K510", "x":13, "y":5, "w":2}, + {"label":"K512", "x":15, "y":5, "w":1.25}, + {"label":"K513", "x":16.25, "y":5, "w":1.25}, + {"label":"K514", "x":17.5, "y":5, "w":1.25}, + {"label":"K516", "x":18.75, "y":5}, + {"label":"K517", "x":19.75, "y":5}, + {"label":"K518", "x":20.75, "y":5}, + {"label":"K519", "x":21.75, "y":5} + ] + }, + "LAYOUT_all": { + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K010", "x":12.75, "y":0}, + {"label":"K011", "x":13.75, "y":0}, + {"label":"K012", "x":14.75, "y":0}, + {"label":"K013", "x":15.75, "y":0}, + {"label":"K014", "x":16.75, "y":0}, + {"label":"K015", "x":17.75, "y":0}, + {"label":"K016", "x":18.75, "y":0}, + {"label":"K017", "x":19.75, "y":0}, + {"label":"K018", "x":20.75, "y":0}, + {"label":"K019", "x":21.75, "y":0}, + {"label":"K10", "x":0, "y":1}, + {"label":"K11", "x":1, "y":1}, + {"label":"K12", "x":2, "y":1}, + {"label":"K13", "x":3, "y":1}, + {"label":"K14", "x":4, "y":1}, + {"label":"K15", "x":5, "y":1}, + {"label":"K16", "x":6, "y":1}, + {"label":"K17", "x":8.75, "y":1}, + {"label":"K18", "x":9.75, "y":1}, + {"label":"K19", "x":10.75, "y":1}, + {"label":"K110", "x":12.75, "y":1}, + {"label":"K111", "x":13.75, "y":1}, + {"label":"K112", "x":14.75, "y":1}, + {"label":"K113", "x":15.75, "y":1}, + {"label":"K114", "x":16.75, "y":1}, + {"label":"K115", "x":17.75, "y":1}, + {"label":"K116", "x":18.75, "y":1}, + {"label":"K117", "x":19.75, "y":1}, + {"label":"K118", "x":20.75, "y":1}, + {"label":"K119", "x":21.75, "y":1}, + {"label":"K20", "x":0, "y":2, "w":1.5}, + {"label":"K21", "x":1.5, "y":2}, + {"label":"K22", "x":2.5, "y":2}, + {"label":"K23", "x":3.5, "y":2}, + {"label":"K24", "x":4.5, "y":2}, + {"label":"K25", "x":5.5, "y":2}, + {"label":"K26", "x":7.75, "y":2}, + {"label":"K27", "x":8.75, "y":2}, + {"label":"K28", "x":9.75, "y":2}, + {"label":"K29", "x":10.75, "y":2}, + {"label":"K210", "x":12.25, "y":2}, + {"label":"K211", "x":13.25, "y":2}, + {"label":"K212", "x":14.25, "y":2}, + {"label":"K213", "x":15.25, "y":2}, + {"label":"K214", "x":16.25, "y":2}, + {"label":"K215", "x":17.25, "y":2}, + {"label":"K216", "x":18.25, "y":2}, + {"label":"K217", "x":19.25, "y":2, "w":1.5}, + {"label":"K218", "x":20.75, "y":2}, + {"label":"K219", "x":21.75, "y":2}, + {"label":"K30", "x":0, "y":3, "w":1.75}, + {"label":"K31", "x":1.75, "y":3}, + {"label":"K32", "x":2.75, "y":3}, + {"label":"K33", "x":3.75, "y":3}, + {"label":"K34", "x":4.75, "y":3}, + {"label":"K35", "x":5.75, "y":3}, + {"label":"K36", "x":7.75, "y":3}, + {"label":"K37", "x":8.75, "y":3}, + {"label":"K38", "x":9.75, "y":3}, + {"label":"K39", "x":10.75, "y":3}, + {"label":"K310", "x":12.5, "y":3}, + {"label":"K311", "x":13.5, "y":3}, + {"label":"K312", "x":14.5, "y":3}, + {"label":"K313", "x":15.5, "y":3}, + {"label":"K314", "x":16.5, "y":3}, + {"label":"K315", "x":17.5, "y":3}, + {"label":"K317", "x":18.5, "y":3, "w":2.25}, + {"label":"K40", "x":0, "y":4, "w":2.25}, + {"label":"K41", "x":2.25, "y":4}, + {"label":"K42", "x":3.25, "y":4}, + {"label":"K43", "x":4.25, "y":4}, + {"label":"K44", "x":5.25, "y":4}, + {"label":"K45", "x":6.25, "y":4}, + {"label":"K46", "x":7.75, "y":4}, + {"label":"K47", "x":8.75, "y":4}, + {"label":"K48", "x":9.75, "y":4}, + {"label":"K49", "x":10.75, "y":4}, + {"label":"K410", "x":13, "y":4}, + {"label":"K411", "x":14, "y":4}, + {"label":"K412", "x":15, "y":4}, + {"label":"K413", "x":16, "y":4}, + {"label":"K414", "x":17, "y":4}, + {"label":"K416", "x":18, "y":4, "w":1.75}, + {"label":"K417", "x":19.75, "y":4}, + {"label":"K418", "x":20.75, "y":4}, + {"label":"K50", "x":0, "y":5, "w":1.25}, + {"label":"K51", "x":1.25, "y":5, "w":1.25}, + {"label":"K52", "x":2.5, "y":5, "w":1.25}, + {"label":"K53", "x":3.75, "y":5, "w":1.25}, + {"label":"K54", "x":5, "y":5, "w":2.25}, + {"label":"K56", "x":7.75, "y":5}, + {"label":"K57", "x":8.75, "y":5}, + {"label":"K58", "x":9.75, "y":5}, + {"label":"K59", "x":10.75, "y":5}, + {"label":"K510", "x":13, "y":5, "w":2}, + {"label":"K512", "x":15, "y":5, "w":1.25}, + {"label":"K513", "x":16.25, "y":5, "w":1.25}, + {"label":"K514", "x":17.5, "y":5, "w":1.25}, + {"label":"K516", "x":18.75, "y":5}, + {"label":"K517", "x":19.75, "y":5}, + {"label":"K518", "x":20.75, "y":5}, + {"label":"K519", "x":21.75, "y":5} + ] + } + } +} diff --git a/keyboards/handwired/downbubble/keymaps/default/config.h b/keyboards/handwired/downbubble/keymaps/default/config.h new file mode 100644 index 00000000000..4496c591006 --- /dev/null +++ b/keyboards/handwired/downbubble/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/handwired/downbubble/keymaps/default/keymap.c b/keyboards/handwired/downbubble/keymaps/default/keymap.c new file mode 100644 index 00000000000..48303900fb8 --- /dev/null +++ b/keyboards/handwired/downbubble/keymaps/default/keymap.c @@ -0,0 +1,103 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_standard(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_NLCK, KC_HOME, KC_TRNS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_PSLS, KC_PAST, KC_PMNS, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_END, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC, KC_SPC, KC_P0, KC_PDOT, KC_PENT, KC_BSPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + LAYOUT_split_bs(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_NLCK, KC_HOME, KC_TRNS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_PSLS, KC_PAST, KC_PMNS, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TRNS, KC_END, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC, KC_SPC, KC_P0, KC_PDOT, KC_PENT, KC_BSPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + LAYOUT_split_rshift(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_NLCK, KC_HOME, KC_TRNS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_PSLS, KC_PAST, KC_PMNS, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_END, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC, KC_SPC, KC_P0, KC_PDOT, KC_PENT, KC_BSPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + LAYOUT_split_numpad(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_NLCK, KC_HOME, KC_TRNS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_PSLS, KC_PAST, KC_PMNS, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_END, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_PENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC, KC_SPC, KC_P0, KC_TRNS, KC_PDOT, KC_TRNS, KC_BSPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + LAYOUT_all(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_NLCK, KC_HOME, KC_TRNS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_PSLS, KC_PAST, KC_PMNS, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TRNS, KC_END, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_PENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC, KC_SPC, KC_P0, KC_TRNS, KC_PDOT, KC_TRNS, KC_BSPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/downbubble/keymaps/default/readme.md b/keyboards/handwired/downbubble/keymaps/default/readme.md new file mode 100644 index 00000000000..757d9906258 --- /dev/null +++ b/keyboards/handwired/downbubble/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymaps for downbubble diff --git a/keyboards/handwired/downbubble/license b/keyboards/handwired/downbubble/license new file mode 100644 index 00000000000..e6e77b08909 --- /dev/null +++ b/keyboards/handwired/downbubble/license @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/keyboards/handwired/downbubble/readme.md b/keyboards/handwired/downbubble/readme.md new file mode 100644 index 00000000000..e6623451277 --- /dev/null +++ b/keyboards/handwired/downbubble/readme.md @@ -0,0 +1,15 @@ +# downbubble + +Prototype hand-wired version of this keyboard - https://imgur.com/a/0KbX1JH + +This is an ergonomic keyboard with a 5 degree rotation on keyboard halves, and a rotated numpad in the center for RH users. + +Keyboard Maintainer: [Flehrad](https://github.com/flehrad) +Hardware Supported: downbubble PCB, AT90USB1286 MCU, MX switches and MiniUSB connector +Hardware Availability: The Board Podcast Slack + +Make example for this keyboard (after setting up your build environment): + + make downbubble:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/downbubble/rules.mk b/keyboards/handwired/downbubble/rules.mk new file mode 100644 index 00000000000..c751d9d4a4e --- /dev/null +++ b/keyboards/handwired/downbubble/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = at90usb1286 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/handwired/ep40/config.h b/keyboards/handwired/ep40/config.h deleted file mode 100644 index 90630cd68d4..00000000000 --- a/keyboards/handwired/ep40/config.h +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2018 Elliot Powell - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x4040 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Elliot Powell -#define PRODUCT ep40 -#define DESCRIPTION A simple 40% keyboard - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 12 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { C7, C6, B6, B5 } -#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, D2, D3, D5, D4, D6, D7, B4 } - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION diff --git a/keyboards/handwired/ep40/ep40.c b/keyboards/handwired/ep40/ep40.c deleted file mode 100644 index 257f9fa807d..00000000000 --- a/keyboards/handwired/ep40/ep40.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2018 Elliot Powell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "ep40.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/handwired/ep40/keymaps/default/keymap.c b/keyboards/handwired/ep40/keymaps/default/keymap.c deleted file mode 100644 index 2d8a5d0592e..00000000000 --- a/keyboards/handwired/ep40/keymaps/default/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2018 Elliot Powell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( /* Base */ - KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,\ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT,\ - LCTL_T(KC_LBRC), KC_LGUI, KC_LALT, KC_SPC, LT(1, KC_SPC), KC_RGUI, MO(2), RCTL_T(KC_RBRC), KC_RALT \ - ), - - [1] = LAYOUT( /* Base */ - KC_TRNS, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0, KC_DEL ,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_TRNS,\ - KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_TRNS,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - - [2] = LAYOUT( /* Base */ - KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 ,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_NUHS, KC_TRNS,\ - KC_TRNS, KC_NUBS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET \ - ), -}; diff --git a/keyboards/handwired/ep40/readme.md b/keyboards/handwired/ep40/readme.md deleted file mode 100644 index 5acd8892dd5..00000000000 --- a/keyboards/handwired/ep40/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# ep40 - -![ep40](https://i.imgur.com/Jl7w6I9.jpg) - -A simple 40% keyboard - -Keyboard Maintainer: [Elliot Powell](https://reddit.com/u/e11i0t23, https://github.com/e11i0t23) -Hardware Supported: EP40 PCB -Hardware Availability: None at the moment - -Make example for this keyboard (after setting up your build environment): - - make ep40:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/fivethirteen/README.md b/keyboards/handwired/fivethirteen/README.md deleted file mode 100644 index a965650fc6b..00000000000 --- a/keyboards/handwired/fivethirteen/README.md +++ /dev/null @@ -1,28 +0,0 @@ -fivethirteen keyboard firmware -====================== - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/doc/README.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/handwired/fivethirteen folder. -Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use -the Teensy Loader to program your .hex file. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default - -To build with the default keymap, simply run `make`. - -### Other Keymaps - -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: - -``` -$ make keymap=[default|jack|] -``` - -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` diff --git a/keyboards/handwired/fivethirteen/config.h b/keyboards/handwired/fivethirteen/config.h index 76596342b48..95112229740 100644 --- a/keyboards/handwired/fivethirteen/config.h +++ b/keyboards/handwired/fivethirteen/config.h @@ -53,9 +53,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/fivethirteen/fivethirteen.h b/keyboards/handwired/fivethirteen/fivethirteen.h index faa6de737d4..6d14b7f1c03 100644 --- a/keyboards/handwired/fivethirteen/fivethirteen.h +++ b/keyboards/handwired/fivethirteen/fivethirteen.h @@ -3,19 +3,19 @@ #include "quantum.h" -#define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, \ - k40, k41, k42, k43, k44, k46, k47, k48, k49, k410, k411, k412 \ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, \ + k40, k41, k42, k43, k44, k46, k47, k48, k49, k410, k411, k412 \ ) \ { \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012 }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112 }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212 }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312 }, \ - { k40, k41, k42, k43, k44, KC_NO, k46, k47, k48, k49, k410, k411, k412 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312 }, \ + { k40, k41, k42, k43, k44, KC_NO, k46, k47, k48, k49, k410, k411, k412 } \ } #endif diff --git a/keyboards/handwired/fivethirteen/info.json b/keyboards/handwired/fivethirteen/info.json new file mode 100644 index 00000000000..f95cbbe0118 --- /dev/null +++ b/keyboards/handwired/fivethirteen/info.json @@ -0,0 +1,77 @@ +{ + "keyboard_name": "fivethirteen", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Tab", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"[", "x":11, "y":1}, + {"label":"]", "x":12, "y":1}, + {"label":"Ctrl/Esc", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":"'", "x":11, "y":2}, + {"label":"Enter", "x":12, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Up", "x":11, "y":3}, + {"label":"\\", "x":12, "y":3}, + {"label":"MO(MOS)", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"GUI", "x":3, "y":4}, + {"label":"MO(HDN)", "x":4, "y":4}, + {"label":"Space", "x":5, "y":4, "w":2}, + {"label":"Shift/Backspace", "x":7, "y":4}, + {"label":"MO(OSY)", "x":8, "y":4}, + {"label":"MO(HDN)", "x":9, "y":4}, + {"label":"Left", "x":10, "y":4}, + {"label":"Down", "x":11, "y":4}, + {"label":"Right", "x":12, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/fivethirteen/keymaps/default/keymap.c b/keyboards/handwired/fivethirteen/keymaps/default/keymap.c index d718510d500..d92f32e35c7 100644 --- a/keyboards/handwired/fivethirteen/keymaps/default/keymap.c +++ b/keyboards/handwired/fivethirteen/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "fivethirteen.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H #define HDN 1 #define OSY 2 @@ -9,28 +7,28 @@ #define SFT_BSP SFT_T(KC_BSPC) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( +[0] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_BSLS, \ MO(MOS), KC_LCTL, KC_LALT, KC_LGUI, MO(HDN), KC_SPC , SFT_BSP, MO(OSY), MO(HDN), KC_LEFT, KC_DOWN, KC_RGHT \ ), -[HDN] = KEYMAP( +[HDN] = LAYOUT( _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, \ _______, KC_TILD, KC_GRV, KC_BSLS, KC_PIPE, KC_MINS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TILD, KC_GRV, _______, \ _______, _______, _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______, KC_PGUP, _______, \ _______, _______, _______, _______, _______, KC_UNDS , KC_DEL, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), -[OSY] = KEYMAP( +[OSY] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), -[MOS] = KEYMAP( +[MOS] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, _______, \ @@ -38,12 +36,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) }; - - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; diff --git a/keyboards/handwired/fivethirteen/readme.md b/keyboards/handwired/fivethirteen/readme.md new file mode 100644 index 00000000000..1a22fc9b938 --- /dev/null +++ b/keyboards/handwired/fivethirteen/readme.md @@ -0,0 +1,12 @@ +# fivethirteen + +A handwired 5x13 ortholinear keyboard with a 2U space bar. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: fivethirteen handwired + +Make example for this keyboard (after setting up your build environment): + + make handwired/fivethirteen:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/frenchdev/config.h b/keyboards/handwired/frenchdev/config.h index dd386402c8a..eca66909052 100644 --- a/keyboards/handwired/frenchdev/config.h +++ b/keyboards/handwired/frenchdev/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef FRENCHDEV_V1_CONFIG_H -#define FRENCHDEV_V1_CONFIG_H +#pragma once #include "config_common.h" @@ -59,8 +58,8 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ ) /* @@ -81,5 +80,3 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION //#define DEBUG_MATRIX_SCAN_RATE - -#endif //FRENCHDEV_V1_CONFIG_H diff --git a/keyboards/handwired/frenchdev/frenchdev.c b/keyboards/handwired/frenchdev/frenchdev.c index 6d5883a3a82..6eed4de5ff0 100644 --- a/keyboards/handwired/frenchdev/frenchdev.c +++ b/keyboards/handwired/frenchdev/frenchdev.c @@ -1,5 +1,26 @@ #include "frenchdev.h" -#include "i2cmaster.h" + +extern inline void frenchdev_board_led_on(void); +extern inline void frenchdev_led_1_on(void); +extern inline void frenchdev_led_2_on(void); +extern inline void frenchdev_led_3_on(void); +extern inline void frenchdev_led_on(uint8_t led); + +extern inline void frenchdev_board_led_off(void); +extern inline void frenchdev_led_1_off(void); +extern inline void frenchdev_led_2_off(void); +extern inline void frenchdev_led_3_off(void); +extern inline void frenchdev_led_off(uint8_t led); + +extern inline void frenchdev_led_all_on(void); +extern inline void frenchdev_led_all_off(void); + +extern inline void frenchdev_led_1_set(uint8_t n); +extern inline void frenchdev_led_2_set(uint8_t n); +extern inline void frenchdev_led_3_set(uint8_t n); +extern inline void frenchdev_led_set(uint8_t led, uint8_t n); + +extern inline void frenchdev_led_all_set(uint8_t n); bool i2c_initialized = 0; uint8_t mcp23018_status = 0x20; @@ -31,15 +52,15 @@ void frenchdev_blink_all_leds(void) frenchdev_led_all_off(); frenchdev_led_all_set(LED_BRIGHTNESS_HI); frenchdev_led_1_on(); - _delay_ms(50); + wait_ms(50); frenchdev_led_2_on(); - _delay_ms(50); + wait_ms(50); frenchdev_led_3_on(); - _delay_ms(50); + wait_ms(50); frenchdev_led_1_off(); - _delay_ms(50); + wait_ms(50); frenchdev_led_2_off(); - _delay_ms(50); + wait_ms(50); frenchdev_led_3_off(); frenchdev_led_all_off(); } @@ -54,28 +75,28 @@ uint8_t init_mcp23018(void) { // cli(); if (i2c_initialized == 0) { i2c_init(); // on pins D(1,0) - i2c_initialized++; - _delay_ms(1000); + i2c_initialized = true;; + wait_ms(1000); } // set pin direction // - unused : input : 1 // - input : input : 1 // - driving : output : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(IODIRA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00111111, I2C_TIMEOUT); if (mcp23018_status) goto out; i2c_stop(); // set pull-up // - unused : on : 1 // - input : on : 1 // - driving : off : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPPUA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00111111, I2C_TIMEOUT); if (mcp23018_status) goto out; out: i2c_stop(); @@ -84,4 +105,3 @@ out: return mcp23018_status; } - diff --git a/keyboards/handwired/frenchdev/frenchdev.h b/keyboards/handwired/frenchdev/frenchdev.h index 82121e044e0..1df39908879 100644 --- a/keyboards/handwired/frenchdev/frenchdev.h +++ b/keyboards/handwired/frenchdev/frenchdev.h @@ -1,10 +1,9 @@ -#ifndef FRENCHDEV_V1_H -#define FRENCHDEV_V1_H +#pragma once #include "quantum.h" #include #include -#include "i2cmaster.h" +#include "i2c_master.h" #include #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) @@ -24,6 +23,7 @@ #define OLATB 0x15 extern uint8_t mcp23018_status; +#define I2C_TIMEOUT 100 void init_frenchdev(void); void frenchdev_blink_all_leds(void); @@ -77,7 +77,7 @@ inline void frenchdev_led_all_set(uint8_t n) frenchdev_led_3_set(n); } -#define KEYMAP( \ +#define LAYOUT( \ \ k01, k02, k03, k04, k05, k06, k09, k0a, k0b, k0c, k0d, k0e, \ k10, k11, k12, k13, k14, k15, k16, k19, k1a, k1b, k1c, k1d, k1e, k1f, \ @@ -111,5 +111,3 @@ inline void frenchdev_led_all_set(uint8_t n) { k51, k41, k31, k21, k11, k01 }, \ { k50, k40, k30, k20, k10, KC_NO } \ } - -#endif diff --git a/keyboards/handwired/frenchdev/i2cmaster.h b/keyboards/handwired/frenchdev/i2cmaster.h deleted file mode 100644 index 3917b9e6c00..00000000000 --- a/keyboards/handwired/frenchdev/i2cmaster.h +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef _I2CMASTER_H -#define _I2CMASTER_H 1 -/************************************************************************* -* Title: C include file for the I2C master interface -* (i2cmaster.S or twimaster.c) -* Author: Peter Fleury http://jump.to/fleury -* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device -* Usage: see Doxygen manual -**************************************************************************/ - -#ifdef DOXYGEN -/** - @defgroup pfleury_ic2master I2C Master library - @code #include @endcode - - @brief I2C (TWI) Master Software Library - - Basic routines for communicating with I2C slave devices. This single master - implementation is limited to one bus master on the I2C bus. - - This I2c library is implemented as a compact assembler software implementation of the I2C protocol - which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). - Since the API for these two implementations is exactly the same, an application can be linked either against the - software I2C implementation or the hardware I2C implementation. - - Use 4.7k pull-up resistor on the SDA and SCL pin. - - Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module - i2cmaster.S to your target when using the software I2C implementation ! - - Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. - - @note - The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted - to GNU assembler and AVR-GCC C call interface. - Replaced the incorrect quarter period delays found in AVR300 with - half period delays. - - @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury - - @par API Usage Example - The following code shows typical usage of this library, see example test_i2cmaster.c - - @code - - #include - - - #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet - - int main(void) - { - unsigned char ret; - - i2c_init(); // initialize I2C library - - // write 0x75 to EEPROM address 5 (Byte Write) - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - i2c_write(0x05); // write address = 5 - i2c_write(0x75); // write value 0x75 to EEPROM - i2c_stop(); // set stop conditon = release bus - - - // read previously written value back from EEPROM address 5 - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - - i2c_write(0x05); // write address = 5 - i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode - - ret = i2c_readNak(); // read one byte from EEPROM - i2c_stop(); - - for(;;); - } - @endcode - -*/ -#endif /* DOXYGEN */ - -/**@{*/ - -#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 -#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" -#endif - -#include - -/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_READ 1 - -/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_WRITE 0 - - -/** - @brief initialize the I2C master interace. Need to be called only once - @param void - @return none - */ -extern void i2c_init(void); - - -/** - @brief Terminates the data transfer and releases the I2C bus - @param void - @return none - */ -extern void i2c_stop(void); - - -/** - @brief Issues a start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_start(unsigned char addr); - - -/** - @brief Issues a repeated start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_rep_start(unsigned char addr); - - -/** - @brief Issues a start condition and sends address and transfer direction - - If device is busy, use ack polling to wait until device ready - @param addr address and transfer direction of I2C device - @return none - */ -extern void i2c_start_wait(unsigned char addr); - - -/** - @brief Send one byte to I2C device - @param data byte to be transfered - @retval 0 write successful - @retval 1 write failed - */ -extern unsigned char i2c_write(unsigned char data); - - -/** - @brief read one byte from the I2C device, request more data from device - @return byte read from I2C device - */ -extern unsigned char i2c_readAck(void); - -/** - @brief read one byte from the I2C device, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_readNak(void); - -/** - @brief read one byte from the I2C device - - Implemented as a macro, which calls either i2c_readAck or i2c_readNak - - @param ack 1 send ack, request more data from device
- 0 send nak, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_read(unsigned char ack); -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - - -/**@}*/ -#endif diff --git a/keyboards/handwired/frenchdev/info.json b/keyboards/handwired/frenchdev/info.json new file mode 100644 index 00000000000..28f09a3aa11 --- /dev/null +++ b/keyboards/handwired/frenchdev/info.json @@ -0,0 +1,114 @@ +{ + "keyboard_name": "", + "url": "", + "maintainer": "qmk", + "bootloader": "", + "width": 20, + "height": 9.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"F1", "x":1, "y":0.9}, + {"label":"F2", "x":2, "y":0.3}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0.4}, + {"label":"F5", "x":5, "y":0.5}, + {"label":"F6", "x":6, "y":0.5}, + {"label":"F7", "x":13, "y":0.5}, + {"label":"F8", "x":14, "y":0.5}, + {"label":"F9", "x":15, "y":0.4}, + {"label":"F10", "x":16, "y":0}, + {"label":"F11", "x":17, "y":0.3}, + {"label":"F12", "x":18, "y":0.9}, + + {"label":"Esc", "x":0, "y":1.9}, + {"label":"\"", "x":1, "y":1.9}, + {"label":"\u00ab", "x":2, "y":1.3}, + {"label":"\u00bb", "x":3, "y":1}, + {"label":"(", "x":4, "y":1.4}, + {"label":")", "x":5, "y":1.5}, + {"label":"\u00a8", "x":6, "y":1.5}, + {"label":"^", "x":13, "y":1.5}, + {"label":"@", "x":14, "y":1.5}, + {"label":"+", "x":15, "y":1.4}, + {"label":"-", "x":16, "y":1}, + {"label":"/", "x":17, "y":1.3}, + {"label":"*", "x":18, "y":1.9}, + {"label":"Backspace", "x":19, "y":1.9}, + + {"label":"Tab", "x":0, "y":2.9}, + {"label":"B", "x":1, "y":2.9}, + {"label":"É", "x":2, "y":2.3}, + {"label":"P", "x":3, "y":2}, + {"label":"O", "x":4, "y":2.4}, + {"label":"È", "x":5, "y":2.5}, + {"label":"_", "x":6, "y":2.5}, + {"label":"=", "x":13, "y":2.5}, + {"label":"K", "x":14, "y":2.5}, + {"label":"V", "x":15, "y":2.4}, + {"label":"D", "x":16, "y":2}, + {"label":"L", "x":17, "y":2.3}, + {"label":"J", "x":18, "y":2.9}, + {"label":"Enter", "x":19, "y":2.9}, + + {"label":"`", "x":0, "y":3.9}, + {"label":"A", "x":1, "y":3.9}, + {"label":"U", "x":2, "y":3.3}, + {"label":"E", "x":3, "y":3}, + {"label":"I", "x":4, "y":3.4}, + {"label":"F", "x":5, "y":3.5}, + {"label":";", "x":6, "y":3.5}, + {"label":"!", "x":13, "y":3.5}, + {"label":"C", "x":14, "y":3.5}, + {"label":"T", "x":15, "y":3.4}, + {"label":"S", "x":16, "y":3}, + {"label":"R", "x":17, "y":3.3}, + {"label":"N", "x":18, "y":3.9}, + {"label":"'", "x":19, "y":3.9}, + + {"label":"Shift", "x":0, "y":4.9}, + {"label":"Z", "x":1, "y":4.9}, + {"label":"À", "x":2, "y":4.3}, + {"label":"Y", "x":3, "y":4}, + {"label":"X", "x":4, "y":4.4}, + {"label":"]", "x":5, "y":4.5}, + {"label":"Shift/Space", "x":6.5, "y":5}, + {"label":"Ctrl/Backspace", "x":7.5, "y":5}, + {"label":"Layer 2/Insert", "x":8.5, "y":5}, + {"label":"Layer 2 Lock", "x":10.5, "y":5}, + {"label":"Ctrl/Delete", "x":11.5, "y":5}, + {"label":"Shift/Space", "x":12.5, "y":5}, + {"label":"M", "x":14, "y":4.5}, + {"label":"G", "x":15, "y":4.4}, + {"label":"Up", "x":16, "y":4}, + {"label":"H", "x":17, "y":4.3}, + {"label":"Q", "x":18, "y":4.9}, + {"label":"Shift", "x":19, "y":4.9}, + + {"label":"Ctrl", "x":0, "y":5.9}, + {"label":"GUI", "x":1, "y":5.9}, + {"label":"Keypad /", "x":2, "y":5.3}, + {"label":".", "x":3, "y":5}, + {"label":",", "x":4, "y":5.4}, + {"label":"Space", "x":5, "y":5.5}, + {"label":"Layer 1/Space", "x":6.5, "y":6}, + {"label":"Alt", "x":7.5, "y":6}, + {"label":"Caps Lock", "x":11.5, "y":6}, + {"label":"Layer 1/Space", "x":12.5, "y":6}, + {"label":"Space", "x":14, "y":5.5}, + {"label":"Left", "x":15, "y":5.4}, + {"label":"Down", "x":16, "y":5}, + {"label":"Right", "x":17, "y":5.3}, + {"label":":", "x":18, "y":5.9}, + {"label":"Ctrl", "x":19, "y":5.9}, + + {"label":"Left Pedal 1", "x":2.25, "y":7.5, "w":1.5, "h":2}, + {"label":"Left Pedal 2", "x":3.75, "y":7.5, "w":1.5, "h":2}, + {"label":"Left Pedal 3", "x":5.25, "y":7.5, "w":1.5, "h":2}, + {"label":"Right Pedal 1", "x":13.25, "y":7.5, "w":1.5, "h":2}, + {"label":"Right Pedal 2", "x":14.75, "y":7.5, "w":1.5, "h":2}, + {"label":"Right Pedal 3", "x":16.25, "y":7.5, "w":1.5, "h":2} + ] + } + } +} diff --git a/keyboards/handwired/frenchdev/keymaps/default/keymap.c b/keyboards/handwired/frenchdev/keymaps/default/keymap.c index e6d72d0131e..b0713b730cb 100644 --- a/keyboards/handwired/frenchdev/keymaps/default/keymap.c +++ b/keyboards/handwired/frenchdev/keymaps/default/keymap.c @@ -1,8 +1,5 @@ -#include "frenchdev.h" -#include "mousekey.h" -#include "action.h" -#include "action_layer.h" -#include "keymap_extras/keymap_bepo.h" +#include QMK_KEYBOARD_H +#include "keymap_bepo.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. @@ -15,8 +12,8 @@ #define PEDAL_DELAY 250 #define KEY_DELAY 130 -enum macros { - M_LP, // left pedal +enum custom_keycodes { + M_LP = SAFE_RANGE, // left pedal M_RP, // right pedal M_SF, // shift M_SFS, // shift and space @@ -65,19 +62,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------| / |------| , | space|------|------|------ .. ------|------|------| L1/sp| LEFT |------| UP |------+------| * * | CTRL | win |------/ \-------------| L1 | alt | .. | CAPS | L1 |-------------/ \------| : | CTRL | * * `-------------/ \-------------/ .. \-------------/ \-------------/ * - *M(M_LP) */ -[_BASE] = KEYMAP( +[_BASE] = LAYOUT( KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ KC_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_DTRM, BP_DCRC, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, KC_BSPC, \ KC_TAB, BP_B, BP_ECUT, BP_O, BP_P, BP_EGRV, BP_UNDS, BP_EQL, BP_K, BP_V, BP_D, BP_L, BP_J, KC_ENT, \ BP_GRV, BP_A, BP_U, BP_E, BP_I, BP_F, BP_SCLN, BP_EXLM, BP_C, BP_T, BP_S, BP_R, BP_N, BP_APOS, \ - M(M_SF), BP_Z, BP_AGRV, BP_Y, BP_X, KC_RBRACKET, M(M_SFS), BP_CBSP, M(L2INS), M(L2LOC), BP_CDEL, M(M_SFS),BP_M, BP_G, KC_UP, BP_H, BP_Q, M(M_SF), \ - KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M(M_L1E), KC_LALT, KC_CAPS, M(M_L1E),KC_SPACE,KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \ + M_SF, BP_Z, BP_AGRV, BP_Y, BP_X, KC_RBRC, M_SFS, BP_CBSP, L2INS, L2LOC, BP_CDEL, M_SFS, BP_M, BP_G, KC_UP, BP_H, BP_Q, M_SF, \ + KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M_L1E, KC_LALT, KC_CAPS, M_L1E, KC_SPACE, KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \ //left pedals - M(M_LP), M(M_RP), KC_TRNS, \ + M_LP, M_RP, KC_TRNS, \ //right pedals - M(M_LP), M(M_RP), KC_TRNS \ + M_LP, M_RP, KC_TRNS \ ), /* Larer 1 for symbols. @@ -99,12 +95,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------/ \-------------/ .. \-------------/ \-------------/ * * */ -[_SYMBOLS] = KEYMAP( +[_SYMBOLS] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, BP_DCUR, BP_PARG, BP_SECT, BP_DGRK, KC_TRNS, BP_TILD, BP_DCAR, BP_LEQL, BP_GEQL, BP_PSMS, BP_OBEL, BP_TIMS, KC_TRNS, \ KC_TRNS, BP_BSLS, BP_ASTR, BP_LCBR, BP_RCBR, BP_GRV, KC_TRNS, BP_DIFF, BP_HASH, BP_LBRC, BP_RBRC, BP_PERC, BP_PMIL, KC_TRNS, \ KC_TRNS, BP_EQL, BP_UGRV, BP_LPRN, BP_RPRN, BP_PLUS, BP_COLN, BP_QEST, BP_CCED, BP_LESS, BP_GRTR, BP_AMPR, BP_UNDS, KC_TRNS, \ - KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), M(M_SE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \ + KC_TRNS, M_UN, M_CUT, M_CP, M_PS, M_SE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \ KC_TRNS, KC_TRNS, BP_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, \ //left pedals KC_TRNS, KC_BTN1, KC_TRNS, \ @@ -131,17 +127,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------/ \-------------/ .. \-------------/ \-------------/ * * */ -[_MEDIA] = KEYMAP( +[_MEDIA] = LAYOUT( RESET, KC_SLCK, KC_PAUS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_CALC, KC_NLCK, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_MPRV, KC_MNXT, KC_MPLY, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, KC_PMNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_BTN4, KC_BTN5, KC_BTN4, KC_BTN5, KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, KC_TRNS, \ - KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, KC_TRNS, \ + KC_TRNS, M_UN, M_CUT, M_CP, M_PS, KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_PDOT, BP_DOT, BP_COMM, KC_TRNS, \ //left pedals - KC_BTN3, M(M_RP), KC_TRNS, \ + KC_BTN3, M_RP, KC_TRNS, \ //right pedals - KC_BTN3, M(M_RP), KC_TRNS \ + KC_BTN3, M_RP, KC_TRNS \ ), /* TRNS - skeleton for laters @@ -163,7 +159,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * */ -[_TRNS] = KEYMAP( +[_TRNS] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ @@ -171,18 +167,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ //left pedals - KC_BTN3, M(M_RP), KC_TRNS, \ + KC_BTN3, M_RP, KC_TRNS, \ //right pedals - KC_BTN3, M(M_RP), KC_TRNS \ + KC_BTN3, M_RP, KC_TRNS \ ), }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - void hold_shift(void) { shift_count = shift_count + 1; register_code(KC_LSHIFT); @@ -198,28 +189,52 @@ void release_shift(void) { void press_space(void) { if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code (KC_SPACE); - unregister_code (KC_SPACE); + tap_code(KC_SPACE); if(shift_count > 0) register_code (KC_LSHIFT); } void press_enter(void) { if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code (KC_ENT); - unregister_code (KC_ENT); + tap_code (KC_ENT); if(shift_count > 0) register_code (KC_LSHIFT); } void press_underscore(void) { if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code ((unsigned char) BP_UNDS); - unregister_code ((unsigned char) BP_UNDS); + tap_code ((unsigned char) BP_UNDS); if(shift_count > 0) register_code (KC_LSHIFT); } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { +void matrix_init_user(void) { +} + +// Bleah globals need to be initialized. +uint8_t old_layer=_BASE; + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + frenchdev_led_1_off(); + frenchdev_led_2_off(); + switch (layer) { + case _BASE: + frenchdev_led_2_on(); + break; + case _SYMBOLS: + frenchdev_led_1_on(); + break; + case _MEDIA: + frenchdev_led_1_on(); + frenchdev_led_2_on(); + default: + // none + break; + } +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { case M_LP: //left pedal if (record->event.pressed) { layer_on(1); @@ -227,25 +242,19 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) key_timer_left_pedal = timer_read(); // if the key is being pressed, we start the timer. } else { if (timer_elapsed(key_timer_left_pedal) < KEY_DELAY) { - mousekey_on (KC_BTN2); - mousekey_send(); - mousekey_off (KC_BTN2); - mousekey_send(); + tap_code (KC_BTN2); } unregister_code (KC_SLCK); layer_off(1); } - break; + break; case M_RP: //right pedal if (record->event.pressed) { layer_on(2); key_timer_right_pedal = timer_read(); // if the key is being pressed, we start the timer. } else { if (timer_elapsed(key_timer_right_pedal) < PEDAL_DELAY) { - mousekey_on (KC_BTN1); - mousekey_send(); - mousekey_off (KC_BTN1); - mousekey_send(); + tap_code (KC_BTN1); } layer_off(2); } @@ -296,13 +305,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. } else { if (timer_elapsed(key_timer_2) < KEY_DELAY) { - register_code (KC_INS); - unregister_code (KC_INS); + tap_code (KC_INS); } l2_locked = 0; layer_off(2); } - break; + break; case L2LOC: //lock L2 if (record->event.pressed) { key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. @@ -316,84 +324,33 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) layer_off(2); } } - break; + break; case M_UN: // undo if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_Z); - unregister_code(BP_Z); - unregister_code(KC_LCTL); + tap_code16(C(BP_Z)); } - break; + break; case M_CUT: // cut if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_X); - unregister_code(BP_X); - unregister_code(KC_LCTL); + tap_code16(C(BP_X)); } - break; + break; case M_CP: // copy if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_C); - unregister_code(BP_C); - unregister_code(KC_LCTL); + tap_code16(C(BP_C)); } - break; + break; case M_PS: // paste if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_V); - unregister_code(BP_V); - unregister_code(KC_LCTL); + tap_code16(C(BP_V)); } - break; + break; case M_SE: // search if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_F); - unregister_code(BP_F); - unregister_code(KC_LCTL); + tap_code16(C(BP_F)); } - break; + break; } - return MACRO_NONE; -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - -} - -void matrix_init_user(void) { -} - -// Bleah globals need to be initialized. -uint8_t old_layer=_BASE; - -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - frenchdev_led_1_off(); - frenchdev_led_2_off(); - switch (layer) { - case _BASE: - frenchdev_led_2_on(); - break; - case _SYMBOLS: - frenchdev_led_1_on(); - break; - case _MEDIA: - frenchdev_led_1_on(); - frenchdev_led_2_on(); - default: - // none - break; - } -} - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } @@ -405,5 +362,3 @@ void led_set_user(uint8_t usb_led) { } return ; } - - diff --git a/keyboards/handwired/frenchdev/matrix.c b/keyboards/handwired/frenchdev/matrix.c index 7fe3d0bbf24..26c2b312609 100644 --- a/keyboards/handwired/frenchdev/matrix.c +++ b/keyboards/handwired/frenchdev/matrix.c @@ -5,11 +5,6 @@ The "column" and "row" in here actually refers to the opposite on the keyboard see definition of KEYMAP in v1.h, the grid is transposed so that a "row" in here is actually a "column" on the physical keyboard Nicolas -Note for ErgoDox EZ customizers: Here be dragons! -This is not a file you want to be messing with. -All of the interesting stuff for you is under keymaps/ :) -Love, Erez - Copyright 2013 Oleg Kostyuk Copyright 2013 Nicolas Poirey @@ -40,7 +35,6 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" #include "frenchdev.h" -#include "i2cmaster.h" #ifdef DEBUG_MATRIX_SCAN_RATE #include "timer.h" #endif @@ -280,11 +274,12 @@ static matrix_row_t read_cols(uint8_t row) return 0; } else { uint8_t data = 0; - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPIOB); if (mcp23018_status) goto out; - mcp23018_status = i2c_start(I2C_ADDR_READ); if (mcp23018_status) goto out; - data = i2c_readNak(); - data = ~data; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOB, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_READ, I2C_TIMEOUT); if (mcp23018_status) goto out; + data = i2c_read_nack(I2C_TIMEOUT); if (mcp23018_status < 0) goto out; + data = ~((uint8_t)mcp23018_status); + mcp23018_status = I2C_STATUS_SUCCESS; out: i2c_stop(); return data; @@ -318,11 +313,9 @@ static void unselect_rows(void) // do nothing } else { // set all rows hi-Z : 1 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write( 0xFF - & ~(0<<8) - ); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPIOA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write( 0xFF & ~(0<<8), I2C_TIMEOUT); if (mcp23018_status) goto out; out: i2c_stop(); } @@ -346,11 +339,9 @@ static void select_row(uint8_t row) } else { // set active row low : 0 // set other rows hi-Z : 1 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write( 0xFF & ~(1< http://jump.to/fleury -* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device with hardware TWI -* Usage: API compatible with I2C Software Library i2cmaster.h -**************************************************************************/ -#include -#include - -#include - - -/* define CPU frequency in Mhz here if not defined in Makefile */ -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -/* I2C clock in Hz */ -#define SCL_CLOCK 400000L - - -/************************************************************************* - Initialization of the I2C bus interface. Need to be called only once -*************************************************************************/ -void i2c_init(void) -{ - /* initialize TWI clock - * minimal values in Bit Rate Register (TWBR) and minimal Prescaler - * bits in the TWI Status Register should give us maximal possible - * I2C bus speed - about 444 kHz - * - * for more details, see 20.5.2 in ATmega16/32 secification - */ - - TWSR = 0; /* no prescaler */ - TWBR = 10; /* must be >= 10 for stable operation */ - -}/* i2c_init */ - - -/************************************************************************* - Issues a start condition and sends address and transfer direction. - return 0 = device accessible, 1= failed to access device -*************************************************************************/ -unsigned char i2c_start(unsigned char address) -{ - uint8_t twst; - - // send START condition - TWCR = (1<event.pressed) { - PORTC &= ~(1 << 6); // PC6 goes low - PORTD |= (1<<4); //PD4 goes high - } - break; -``` - -This is the code for the KC_FN1 button. Notice how we check against what key is pressed in the case and then set pin C6 low and pin D4 high. Adjust this as you see fit. - - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/docs/README.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/handwired/gamenum folder. -Read the README.md for the qmk repository on how to set up your developer enviroment to build your firmware with. -Building firmware on Windows can be a bit of a hassle. Linux is a lot easier to use if you have some experience with it. A raspberry pi will already be able to build the firmware for you. -Once your dev env is set up, you'll be able to type `make` to generate your .hex - you can then use AVRDudess to program your .hex file. - -### Default - -To build with the default keymap, simply run `make`. - -### Other Keymaps - -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: - -``` -$ make keymap=[default|jack|] -``` - -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` - - diff --git a/keyboards/handwired/gamenum/config.h b/keyboards/handwired/gamenum/config.h index 6af876ab79b..ff60aa52930 100644 --- a/keyboards/handwired/gamenum/config.h +++ b/keyboards/handwired/gamenum/config.h @@ -53,9 +53,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/gamenum/gamenum.h b/keyboards/handwired/gamenum/gamenum.h index ea633b9bfa3..3a1429ff8cb 100644 --- a/keyboards/handwired/gamenum/gamenum.h +++ b/keyboards/handwired/gamenum/gamenum.h @@ -3,19 +3,19 @@ #include "quantum.h" -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ - k20, k21, k22, \ - k30, k31, k32, \ - k41, k42, k43 \ + k20, k21, k22, \ + k30, k31, k32, \ + k41, k42, k43 \ ) \ { \ - { k00, k01, k02, k03}, \ - { k10, k11, k12, k13}, \ - { k20, k21, k22, KC_NO}, \ - { k30, k31, k32, KC_NO}, \ - { KC_NO, k41, k42, k43} \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, KC_NO }, \ + { k30, k31, k32, KC_NO }, \ + { KC_NO, k41, k42, k43 } \ } #endif diff --git a/keyboards/handwired/gamenum/info.json b/keyboards/handwired/gamenum/info.json new file mode 100644 index 00000000000..dc80f027e81 --- /dev/null +++ b/keyboards/handwired/gamenum/info.json @@ -0,0 +1,30 @@ +{ + "keyboard_name": "gamenum", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Fn", "x":0, "y":0}, + {"label":"/", "x":1, "y":0}, + {"label":"*", "x":2, "y":0}, + {"label":"-", "x":3, "y":0}, + {"label":"7", "x":0, "y":1}, + {"label":"8", "x":1, "y":1}, + {"label":"9", "x":2, "y":1}, + {"label":"+", "x":3, "y":1, "h":2}, + {"label":"4", "x":0, "y":2}, + {"label":"5", "x":1, "y":2}, + {"label":"6", "x":2, "y":2}, + {"label":"1", "x":0, "y":3}, + {"label":"2", "x":1, "y":3}, + {"label":"3", "x":2, "y":3}, + {"label":"0", "x":0, "y":4, "w":2}, + {"label":".", "x":2, "y":4}, + {"label":"Ent", "x":3, "y":3, "h":2} + ] + } + } +} diff --git a/keyboards/handwired/gamenum/keymaps/default/keymap.c b/keyboards/handwired/gamenum/keymaps/default/keymap.c index 6950b741a33..237b0fb9272 100644 --- a/keyboards/handwired/gamenum/keymaps/default/keymap.c +++ b/keyboards/handwired/gamenum/keymaps/default/keymap.c @@ -1,68 +1,59 @@ -#include "gamenum.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H -#define _______ KC_TRNS - #define DEF 0 #define HDN 1 #define OSY 2 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[DEF] = KEYMAP( - KC_FN0, KC_SLSH, KC_ASTR, KC_MINS, \ - KC_7, KC_8, KC_9, KC_PLUS, \ - KC_4, KC_5, KC_6, \ - KC_1, KC_2, KC_3, \ - KC_0, KC_DOT, KC_ENT \ -), -[HDN] = KEYMAP( - KC_FN1, KC_1, KC_2, KC_3, \ - KC_Q, KC_W, KC_E, KC_R, \ - KC_A, KC_S, KC_D, \ - KC_Z, KC_X, KC_C, \ - KC_LSFT, KC_LALT, KC_SPC \ -), -[OSY] = KEYMAP( - KC_A, KC_Q, KC_1, KC_FN2, \ - KC_S, KC_W, KC_2, KC_LALT, \ - KC_D, KC_E, KC_3, \ - KC_F, KC_R, KC_4, \ - KC_SPC, KC_T, KC_TAB \ -) + [DEF] = LAYOUT( + TO(HDN), KC_SLSH, KC_ASTR, KC_MINS, \ + KC_7, KC_8, KC_9, KC_PLUS, \ + KC_4, KC_5, KC_6, \ + KC_1, KC_2, KC_3, \ + KC_0, KC_DOT, KC_ENT \ + ), + [HDN] = LAYOUT( + TO(OSY), KC_1, KC_2, KC_3, \ + KC_Q, KC_W, KC_E, KC_R, \ + KC_A, KC_S, KC_D, \ + KC_Z, KC_X, KC_C, \ + KC_LSFT, KC_LALT, KC_SPC \ + ), + [OSY] = LAYOUT( + KC_A, KC_Q, KC_1, TO(DEF), \ + KC_S, KC_W, KC_2, KC_LALT, \ + KC_D, KC_E, KC_3, \ + KC_F, KC_R, KC_4, \ + KC_SPC, KC_T, KC_TAB \ + ) }; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case TO(HDN): + if (record->event.pressed) { + PORTC |= (1 << 6); // PC6 goes high + } -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_SET(HDN, ON_PRESS), - [1] = ACTION_LAYER_SET(OSY, ON_PRESS), - [2] = ACTION_LAYER_SET(DEF, ON_PRESS), -}; + return true; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; + case TO(OSY): + if (record->event.pressed) { + PORTC &= ~(1 << 6); // PC6 goes high + PORTD |= (1<<4); + } + return true; -bool process_record_user (uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case KC_FN0: - if (record->event.pressed) { - PORTC |= (1 << 6); // PC6 goes high - } - break; - case KC_FN1: - if (record->event.pressed) { - PORTC &= ~(1 << 6); // PC6 goes high - PORTD |= (1<<4); - } - break; - case KC_FN2: + case TO(DEF): if (record->event.pressed) { - PORTD &= ~(1 << 4); // PC6 goes high - } - break; + PORTD &= ~(1 << 4); // PC6 goes high + } + + return true; + + default: + return true; } - return true; -} \ No newline at end of file +} diff --git a/keyboards/handwired/gamenum/readme.md b/keyboards/handwired/gamenum/readme.md new file mode 100644 index 00000000000..ee28cc1822d --- /dev/null +++ b/keyboards/handwired/gamenum/readme.md @@ -0,0 +1,85 @@ +# GameNum + +A handwired standard numpad oriented toward gaming on the go. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: GameNum, Pro Micro + +Make example for this keyboard (after setting up your build environment): + + make handwired/gamenum:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Board overview + +The GameNum was designed to facilitate the use of mechanical keys for gaming even when your packing space is limited. +It uses a standard numpad layout replacing the NumLock key with a layer toggle that allows you to cycle through the different layers. +The standard layout features a default layer that acts as a standard numpad, a layer that was meant for simple WASD based games and a layer that was designed to be used for MOBA/RTS related games. +The RTS layer is meant to be used rotating the device 90 degrees counterclockwise. + +The README.MD for this board is reasonably extensive and in-depth because the build is quite small and covers a lot of things that I feel that it would be a good starting point for getting into QMK. + +## Build considerations + +Since the GameNum is handwired and uses 2 of its pins to toggle indicator lights there are some things to keep in mind. +Firmware was build for use with a Pro Micro based on a ATMEGA32u4 at 16mHz. +The indicator LED's are normally assigned to `pin C6` and `pin D4`, C6 goes high when the first layer is used, D4 goes high when layer 2 is used. Both LED's are off when the default layer is enabled. +'+' of the LED goes to the respective pins and can be joined together on the '-' into a resistor that runs to the ground pin of the pro micro. With a standard LED a resistor value of 100 ohm is fine, keep in mind that you cannot use high powered LEDS on these pins without ruining your pro micro. + +## schematic of the switches and diodes + +![schematic overview](http://i.imgur.com/fleitoA.jpg) + +Keep in mind that the minus of the diodes should point towards the pro micros inputs. + +## LED hookup + +![led overview](http://i.imgur.com/U6m865n.jpg) + +## Adding more layers + +Adding additional layers is pretty straight forward. Look in `keymaps/default/keymap.c` and find `#define OSY 2` add a new definition for the layer you are going to add. This can be named pretty much anything. Example: `#define NAMEHERE 3`. +Keep in mind here that the number after the name should correspond with the number that the layer has in the stack of layers. + +Next thing to do is to add the actual layer for the keymap. + +``` + [DEF] = LAYOUT( + KC_FN0, KC_SLSH, KC_ASTR, KC_MINS, \ + KC_7, KC_8, KC_9, KC_PLUS, \ + KC_4, KC_5, KC_6, \ + KC_1, KC_2, KC_3, \ + KC_0, KC_DOT, KC_ENT \ + ) +``` + +This is the default layer for the gamenum. It's generally easiest to just copy this and change things as you see fit. Keep in mind that at least 1 button on the pad has to be used to switch to the next layer in the stack or you will be stuck in that layer FOREVER! D: +In the case of DEF this is key `KC_FN0`. Also keep in mind that the last layer that you add does not have a comma after its closing bracket but any other layer does! + +Which brings us nicely to the next part, the layer switching logic. Under the keymaps look for `PROGMEM fn_actions[]` this function handles the switching between layers, as you might have noticed every layer in the keymap has its own KC_FNx key. This is the key responsible for switching you from layer to layer. +The number that is at the end of the keycode corresponds with the code in the function. +`[0] = ACTION_LAYER_SET(HDN, ON_PRESS),` When `KC_FN0` is pressed the keyboard switches layer `HDN` on when the key is pressed down. Add an extra line for your layer here as well. + +Now for the LEDs, if you plan on adding extra LED's to the keyboard to indicate other layers you have to first define the pin that the LED will be using in `gamenum.c`. +Look for this piece of code: + +``` + DDRD |= (1<<4); + PORTD &= ~(1<<4); +``` + +Copy it and change the letter after DDR and PORT to the letter of your pin. Change the 4 to the number of your pin. `DDRx |= (1<event.pressed) { + PORTC &= ~(1 << 6); // PC6 goes low + PORTD |= (1<<4); //PD4 goes high + } + break; +``` + +This is the code for the KC_FN1 button. Notice how we check against what key is pressed in the case and then set pin C6 low and pin D4 high. Adjust this as you see fit. diff --git a/keyboards/handwired/hacked_motospeed/config.h b/keyboards/handwired/hacked_motospeed/config.h new file mode 100644 index 00000000000..1a341c0f4eb --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/config.h @@ -0,0 +1,249 @@ +/* +Copyright 2019 Vladislav Opara + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0690 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MMO_Corp +#define PRODUCT hacked_motospeed +#define DESCRIPTION Motospeed Numpads wired to Teensy++2.0 + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + +// WR XR YR ZR VR ZL YL XL WL VL +#define MATRIX_ROW_PINS { B3, B5, F1, B4, B6, D5, D4, D6, D7, C4} + +// ER DR CR BR AR FR FL AL BL CL DL EL +#define MATRIX_COL_PINS { F7, F6, F5, F4, F3, F2, E0, E1, C0, C1, C2, C3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +//#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 \ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/hacked_motospeed.c b/keyboards/handwired/hacked_motospeed/hacked_motospeed.c new file mode 100644 index 00000000000..21643895d75 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/hacked_motospeed.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Vladislav Opara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "hacked_motospeed.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/hacked_motospeed.h b/keyboards/handwired/hacked_motospeed/hacked_motospeed.h new file mode 100644 index 00000000000..1063fd2e623 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/hacked_motospeed.h @@ -0,0 +1,46 @@ +/* Copyright 2019 Vladislav Opara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + EWR, DWR, CWR, BWR, AWR, FXR, FYL, AZL, BZL, CZL, DZL, \ + DXR, CXR, BXR, AXR, FZR, DVL, AYL, BYL, CYL, DYL, EZL, \ + EZR, DYR, CYR, BYR, AYR, DVR, FZL, AXL, BXL, CXL, DXL, \ + DZR, CZR, BZR, AZR, FYR, FXL, AWL, BWL, CWL, DWL, EWL \ +) \ +{ \ + { EWR, DWR, CWR, BWR, AWR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, DXR, CXR, BXR, AXR, FXR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, DYR, CYR, BYR, AYR, FYR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { EZR, DZR, CZR, AZR, BZR, FZR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, DVR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, FZL, BZL, AZL, CZL, DZL, EZL }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, FYL, AYL, BYL, CYL, DYL, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, FXL, AXL, BXL, CXL, DXL, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, AWL, BWL, CWL, DWL, EWL }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, DVL, KC_NO } \ +} diff --git a/keyboards/handwired/hacked_motospeed/info.json b/keyboards/handwired/hacked_motospeed/info.json new file mode 100644 index 00000000000..7ca92785ebd --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Hacked Motospeed", + "url": "", + "maintainer": "Deckweiss", + "width": 13, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"label":"ESC", "x":0, "y":0, "h":2}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Z", "x":7, "y":0}, {"label":"U", "x":8, "y":0}, {"label":"I", "x":9, "y":0}, {"label":"O", "x":10, "y":0}, {"label":"P", "x":11, "y":0, "w":2}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"H", "x":7, "y":1}, {"label":"J", "x":8, "y":1}, {"label":"K", "x":9, "y":1}, {"label":"L", "x":10, "y":1}, {"label":"(", "x":11, "y":1}, {"label":")", "x":12, "y":1}, {"label":"=", "x":0, "y":2}, {"label":"Y", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"N", "x":7, "y":2}, {"label":"M", "x":8, "y":2}, {"label":",", "x":9, "y":2}, {"label":".", "x":10, "y":2}, {"label":"?", "x":11, "y":2}, {"label":"Fn", "x":0, "y":3, "w":2}, {"label":"Num", "x":2, "y":3}, {"label":"Bksp", "x":3, "y":3}, {"label":"Enter", "x":4, "y":3}, {"label":"Spc", "x":5, "y":3}, {"label":"LShift", "x":7, "y":3}, {"label":"LCtrl", "x":8, "y":3}, {"label":"LAlt", "x":9, "y":3}, {"label":"RAlt", "x":10, "y":3}, {"label":"Meta", "x":11, "y":3}, {"label":"Fn", "x":12, "y":2, "h":2}] + } + } +} \ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/keymaps/default/config.h b/keyboards/handwired/hacked_motospeed/keymaps/default/config.h new file mode 100644 index 00000000000..72de214ba72 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Vladislav Opara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here \ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/keymaps/default/keymap.c b/keyboards/handwired/hacked_motospeed/keymaps/default/keymap.c new file mode 100644 index 00000000000..bdec8f24615 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2019 Vladislav Opara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_LPRN, KC_RPRN, \ + KC_PEQL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_QUES, \ + XXXXXXX, XXXXXXX, KC_BSPC, KC_ENT, KC_SPC, KC_LSFT, KC_LCTRL, KC_LALT, KC_ALGR, KC_LWIN, XXXXXXX \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/keymaps/default/readme.md b/keyboards/handwired/hacked_motospeed/keymaps/default/readme.md new file mode 100644 index 00000000000..4c740bd9a55 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for hacked_motospeed \ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/readme.md b/keyboards/handwired/hacked_motospeed/readme.md new file mode 100644 index 00000000000..ac2d4afc28a --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/readme.md @@ -0,0 +1,23 @@ +# hacked_motospeed + +This is a + - tiny (44key), + - budget (~50€ total expense), + - portable (HID bluetooth & 5aH battery) + - easy to diy (little wiring & soldering needed), + +mechanical keyboard. +It is made by wiring two Motospeed K22 numpads to a Teensy++ 2.0, while reusing as much of the original PCB as possible. +The numpads come with Outemu red linear switches. +(A detailed guide will be posted and linked later) + + +Keyboard Maintainer: [Deckweiss](https://github.com/Deckweiss) +Hardware Supported: Motospeed K22 numpads wired to Teensy++ 2.0 according to my guide (upcoming). +Hardware Availability: Ebay, AliExpress + +Make example for this keyboard (after setting up your build environment): + + make handwired/hacked_motospeed:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/handwired/hacked_motospeed/rules.mk b/keyboards/handwired/hacked_motospeed/rules.mk new file mode 100644 index 00000000000..17d71ada4d3 --- /dev/null +++ b/keyboards/handwired/hacked_motospeed/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = at90usb1286 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=1024 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/handwired/hexon38/config.h b/keyboards/handwired/hexon38/config.h new file mode 100644 index 00000000000..e9e1eb4d297 --- /dev/null +++ b/keyboards/handwired/hexon38/config.h @@ -0,0 +1,54 @@ +// see https://github.com/pepaslabs/hexon38 + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER pepaslabs +#define PRODUCT hexon38 +#define DESCRIPTION "A handmade non-split ergonomic 38-key keyboard, inspired by the lil38. See https://github.com/pepaslabs/hexon38." + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, F0, B2, F4 } +#define MATRIX_COL_PINS { C6, D3, D2, D1, D0, B7, F6, F7, B6, B5, B4, D7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 0 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + + +// Disabled features: + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* prevent stuck modifiers */ +//#define PREVENT_STUCK_MODIFIERS diff --git a/keyboards/handwired/hexon38/hexon38.c b/keyboards/handwired/hexon38/hexon38.c new file mode 100644 index 00000000000..d830adef3c7 --- /dev/null +++ b/keyboards/handwired/hexon38/hexon38.c @@ -0,0 +1,3 @@ +// see https://github.com/pepaslabs/hexon38 + +#include "hexon38.h" diff --git a/keyboards/handwired/hexon38/hexon38.h b/keyboards/handwired/hexon38/hexon38.h new file mode 100644 index 00000000000..f98f460faf8 --- /dev/null +++ b/keyboards/handwired/hexon38/hexon38.h @@ -0,0 +1,17 @@ +// see https://github.com/pepaslabs/hexon38 + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K002, K003, K004, K005, K006, K007, K008, K009, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K207, K208, K209, K210, K211, \ + K302, K303, K304, K305, K306, K307, K308, K309 \ +) { \ + { KC_NO, KC_NO, K002, K003, K004, K005, K006, K007, K008, K009, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, KC_NO, KC_NO, K207, K208, K209, K210, K211 }, \ + { KC_NO, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, KC_NO, KC_NO } \ +} diff --git a/keyboards/handwired/hexon38/keymaps/default/keymap.c b/keyboards/handwired/hexon38/keymaps/default/keymap.c new file mode 100644 index 00000000000..65dfb4ca04f --- /dev/null +++ b/keyboards/handwired/hexon38/keymaps/default/keymap.c @@ -0,0 +1,407 @@ +// see https://github.com/pepaslabs/hexon38 + +#include QMK_KEYBOARD_H + +#define A_ KC_A +#define B_ KC_B +#define C_ KC_C +#define D_ KC_D +#define E_ KC_E +#define F_ KC_F +#define G_ KC_G +#define H_ KC_H +#define I_ KC_I +#define J_ KC_J +#define K_ KC_K +#define L_ KC_L +#define M_ KC_M +#define N_ KC_N +#define O_ KC_O +#define P_ KC_P +#define Q_ KC_Q +#define R_ KC_R +#define S_ KC_S +#define T_ KC_T +#define U_ KC_U +#define V_ KC_V +#define W_ KC_W +#define X_ KC_X +#define Y_ KC_Y +#define Z_ KC_Z + +// Dual-role keys: modifier when held, alpha when tapped. +#define A_CTL CTL_T(KC_A) +#define S_ALT ALT_T(KC_S) +#define D_GUI GUI_T(KC_D) +#define F_SFT SFT_T(KC_F) +#define J_SFT SFT_T(KC_J) +#define K_GUI GUI_T(KC_K) +#define L_ALT ALT_T(KC_L) +#define COLN_CTL CTL_T(KC_SCLN) + +#define ______ KC_TRNS +#define LSHIFT KC_LSHIFT +#define RSHIFT KC_RSHIFT +#define COMMA KC_COMM +#define SLASH KC_SLSH +#define SPACE KC_SPC +#define TAB KC_TAB +#define BKSPC KC_BSPC +#define ENTER KC_ENT +#define PERIOD KC_DOT + +#define BASE_LAYER LAYOUT +#define BLANK_LAYER LAYOUT + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + BASE_LAYER( +// ,--------+--------+--------+--------. ,--------+--------+--------+--------. + W_ , E_ , R_ , T_ , Y_ , U_ , I_ , O_ , +//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------. + Q_ , A_CTL , S_ALT , D_GUI , F_SFT , G_ , H_ , J_SFT , K_GUI , L_ALT ,COLN_CTL, P_ , +//|--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------| + B_ , Z_ , X_ , C_ , V_ , M_ , COMMA , PERIOD , SLASH , N_ , +//`--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------' + +// ,--------+--------+--------+--------. ,--------+--------+--------+--------. + LSHIFT , SPACE , TAB , DEBUG , SPACE , BKSPC , ENTER , RSHIFT +// `--------+--------+--------+--------' `--------+--------+--------+--------' +), + + BLANK_LAYER( +// ,--------+--------+--------+--------. ,--------+--------+--------+--------. + ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , +//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------. + ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , +//|--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------| + ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , +//`--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------' + +// ,--------+--------+--------+--------. ,--------+--------+--------+--------. + ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ +// `--------+--------+--------+--------' `--------+--------+--------+--------' +) + +}; + +// a linked list of pending key events (press or release) which we haven't processed yet. +struct _pending_key_t { + uint16_t keycode; + keyrecord_t record; + struct _pending_key_t *next; +}; +typedef struct _pending_key_t pending_key_t; + +// worst case is 10 down strokes and 1 up stroke before we can start disambiguating. +#define RINGSIZE 11 + +// a ring buffer and linked list to store pending key events (presses and releases). +// (basically, this is a fixed-allocation linked list.) +struct _kring_t { + // the actual key events. + pending_key_t items[RINGSIZE]; + // the index of the oldest item, or -1 if no items. + int8_t ifirst; + // the index of the most recently added item, or -1 if no items. + int8_t ilast; + // the number of items in the ring. + uint8_t count; + // the head of the linked list. + pending_key_t *head; +}; +typedef struct _kring_t kring_t; + +// safe accessor to the i-th item of the linked list (returns pointer or NULL). +pending_key_t* kring_get(kring_t *ring, uint8_t i) { + if (i >= ring->count) { + return NULL; + } + uint8_t j = (ring->ifirst + i) % RINGSIZE; + return &(ring->items[j]); +} + +// return the last key in the list of buffered keys. +pending_key_t* kring_last(kring_t *ring) { + if (ring->count == 0) { + return NULL; + } + return kring_get(ring, ring->count - 1); +} + +// remove the oldest item from the ring (the head of the list). +void kring_pop(kring_t *ring) { + if (ring->count > 0) { + ring->ifirst += 1; + ring->ifirst %= RINGSIZE; + ring->head = ring->head->next; + ring->count -= 1; + } +} + +// add an item to the ring (append to the list). +void kring_append(kring_t *ring, uint16_t keycode, keyrecord_t *record) { + if (ring->count >= RINGSIZE) { + // uh oh, we overflowed the capacity of our buffer :( + return; + } + + // if the ring is empty, insert at index 0. + if (ring->count == 0) { + ring->count += 1; + ring->ifirst = 0; + ring->ilast = 0; + ring->head = &(ring->items[0]); + } + // else, append it onto the end. + else { + ring->count += 1; + ring->ilast += 1; + ring->ilast %= RINGSIZE; + } + + // the index at which we should insert this item. + int8_t i = ring->ilast; + + // insert the item. + ring->items[i].keycode = keycode; + ring->items[i].record.event = record->event; +#ifndef NO_ACTION_TAPPING + ring->items[i].record.tap = record->tap; +#endif + ring->items[i].next = NULL; + + // update the previous item to point to this item. + if (ring->count > 1) { + kring_get(ring, ring->count - 2)->next = &(ring->items[i]); + } +} + +kring_t g_pending; + +void matrix_init_user(void) { + g_pending.ifirst = -1; + g_pending.ilast = -1; + g_pending.count = 0; + g_pending.head = NULL; +} + +void matrix_scan_user(void) {} + +/* +a_ a-: emit a +a_ b_ b- a-: emit SHIFT+b +a_ b_ a- b-: emit a, b +dual1down, dual1up -> norm1down, norm1up +dual1down, norm2down, norm2up -> mod1down, norm2down, norm2up +dual1down, norm2down, dual1up -> norm1down, norm2down, norm1up +dual1down, dual2down, norm3down, norm3up -> mod1down, mod2down, norm3down, norm3up +so, a dual key can't be disambiguated until the next keyup of a keydown (not including keyups from keys before it). +*/ + +bool is_ambiguous_kc(uint16_t kc) { + // See the MT() define: https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum_keycodes.h#L642 + // See the QK_MOD_TAP case: https://github.com/qmk/qmk_firmware/blob/master/quantum/keymap_common.c#L134 + uint8_t mod = mod_config((kc >> 0x8) & 0x1F); + return mod != 0; +} + +bool is_down(pending_key_t *k) { + return k->record.event.pressed; +} + +bool is_up(pending_key_t *k) { + return !is_down(k); +} + +bool keys_match(pending_key_t *a, pending_key_t *b) { + return a->record.event.key.col == b->record.event.key.col + && a->record.event.key.row == b->record.event.key.row; +} + +// both the down and corresponding upstroke of a keypress. +struct _pending_pair_t { + pending_key_t *down; + pending_key_t *up; +}; +typedef struct _pending_pair_t pending_pair_t; + +// returns true if this keydown event has a corresponding keyup event in the +// list of buffered keys. also fills out 'p'. +bool is_downup_pair(pending_key_t *k, pending_pair_t *p) { + // first, make sure this event is keydown. + if (!is_down(k)) { + return false; + } + // now find its matching keyup. + pending_key_t *next = k->next; + while (next != NULL) { + if (keys_match(k, next) && is_up(next)) { + // found it. + if (p != NULL) { + p->down = k; + p->up = next; + } + return true; + } + next = next->next; + } + // didn't find it. + return false; +} + +// given a QK_MOD_TAP keycode, return the KC_* version of the modifier keycode. +uint16_t get_mod_kc(uint16_t keycode) { + uint8_t mod = mod_config((keycode >> 0x8) & 0x1F); + switch (mod) { + case MOD_LCTL: + return KC_LCTL; + case MOD_RCTL: + return KC_RCTL; + case MOD_LSFT: + return KC_LSFT; + case MOD_RSFT: + return KC_RSFT; + case MOD_LALT: + return KC_LALT; + case MOD_RALT: + return KC_RALT; + case MOD_LGUI: + return KC_LGUI; + case MOD_RGUI: + return KC_RGUI; + default: + // shrug? this shouldn't happen. + return keycode; + } +} + +bool is_mod_kc(uint16_t keycode) { + switch (keycode) { + case QK_MODS ... QK_MODS_MAX: + return true; + default: + return false; + } +} + +void interpret_as_mod(pending_pair_t *p) { + // see https://github.com/qmk/qmk_firmware/issues/1503 + pending_key_t *k; + k = p->down; + if (k != NULL) { + k->keycode = get_mod_kc(k->keycode); + } + k = p->up; + if (k != NULL) { + k->keycode = get_mod_kc(k->keycode); + } +} + +void interpret_as_normal(pending_pair_t *p) { + pending_key_t *k; + k = p->down; + if (k != NULL) { + k->keycode = k->keycode & 0xFF; + } + k = p->up; + if (k != NULL) { + k->keycode = k->keycode & 0xFF; + } +} + +void execute_head_and_pop(kring_t *ring) { + pending_key_t *head = kring_get(ring, 0); + uint16_t kc = head->keycode; + if (is_mod_kc(kc)) { + if (is_down(head)) { + dprintf(" %s: mod down 0x%04X\n", __func__, kc); + set_mods(get_mods() | MOD_BIT(kc)); + } else { + dprintf(" %s: mod up 0x%04X\n", __func__, kc); + set_mods(get_mods() & ~MOD_BIT(kc)); + } + } else { + if (is_down(head)) { + dprintf(" %s: key down 0x%04X\n", __func__, kc); + register_code16(kc); + } else { + dprintf(" %s: key up 0x%04X\n", __func__, kc); + unregister_code16(kc); + } + } + kring_pop(ring); +} + +// try to figure out what the next pending keypress means. +bool parse_next(kring_t *pending) { + pending_pair_t p; + pending_key_t *first = kring_get(pending, 0); + if (!is_ambiguous_kc(first->keycode)) { + // this pending key isn't ambiguous, so execute it. + dprintf(" %s: found unambiguous key\n", __func__); + execute_head_and_pop(pending); + return true; + } else if (is_ambiguous_kc(first->keycode) && is_up(first)) { + dprintf(" %s: interpreting keyup as mod\n", __func__); + p.down = NULL; + p.up = first; + interpret_as_mod(&p); + execute_head_and_pop(pending); + return true; + } else if (is_downup_pair(first, &p)) { + // 'first' was released before any other pressed key, so treat this as + // a rolling series of normal key taps. + dprintf(" %s: found down-up pair, interpreting as normal key\n", __func__); + interpret_as_normal(&p); + execute_head_and_pop(pending); + return true; + } else { + // if another key was pressed and released while 'first' was held, then we + // should treat it like a modifier. + pending_key_t *next = first->next; + while (next != NULL) { + if (is_downup_pair(next, NULL)) { + dprintf(" %s: found subsequent downup pair, interpreting head as mod\n", __func__); + p.down = first; + p.up = NULL; + interpret_as_mod(&p); + execute_head_and_pop(pending); + return true; + } + next = next->next; + } + + // we can't disambiguate 'first' yet. wait for another keypress. + dprintf(" %s: can't disambiguate (yet)\n", __func__); + return false; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (keycode == DEBUG) { + return true; + } + + if (g_pending.count == 0 && !is_ambiguous_kc(keycode)) { + // we have no pending keys and this key isn't ambiguous, so we should + // just let QMK take care of it. + dprintf("%s: handled by qmk\n", __func__); + return true; + } else { + dprintf("%s: got dual-role key\n", __func__); + // append the keypress and then try parsing all pending keypresses. + kring_append(&g_pending, keycode, record); + while (g_pending.count > 0) { + dprintf("%s: looping through %d keys...\n", __func__, g_pending.count); + if (!parse_next(&g_pending)) { + // one of our keypresses is ambiguous and we can't proceed until + // we get further keypresses to disambiguate it. + dprintf("%s: %d pending keys are ambiguous\n", __func__, g_pending.count); + break; + } + } + return false; + } +} diff --git a/keyboards/handwired/hexon38/readme.md b/keyboards/handwired/hexon38/readme.md new file mode 100644 index 00000000000..c8ada8e2b2f --- /dev/null +++ b/keyboards/handwired/hexon38/readme.md @@ -0,0 +1,11 @@ +# hexon38 + +QMK support for the [hexon38](https://github.com/pepaslabs/hexon38). + +## Building + +``` +$ cd qmk_firmware +$ make handwired/hexon38 +``` + diff --git a/keyboards/handwired/hexon38/rules.mk b/keyboards/handwired/hexon38/rules.mk new file mode 100644 index 00000000000..2b6f17afc28 --- /dev/null +++ b/keyboards/handwired/hexon38/rules.mk @@ -0,0 +1,64 @@ +# see https://github.com/pepaslabs/hexon38 + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# Enabled build options: +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work + +# Disabled build options: +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no diff --git a/keyboards/handwired/hnah40/config.h b/keyboards/handwired/hnah40/config.h new file mode 100644 index 00000000000..b7a4105d002 --- /dev/null +++ b/keyboards/handwired/hnah40/config.h @@ -0,0 +1,220 @@ +/* Copyright 2018 HnahKB + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0002 +#define MANUFACTURER HnahKB +#define PRODUCT hnah40 +#define DESCRIPTION Custom 40% PCB + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 11 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B4, B5, B3, D4 } +#define MATRIX_COL_PINS { B0, D7, D6, D5, B2, B1, C0, C1, C2, C3, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + + + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/handwired/hnah40/hnah40.c b/keyboards/handwired/hnah40/hnah40.c new file mode 100644 index 00000000000..0f08136c210 --- /dev/null +++ b/keyboards/handwired/hnah40/hnah40.c @@ -0,0 +1,43 @@ +/* Copyright 2019 HnahKB + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "hnah40.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/handwired/hnah40/hnah40.h b/keyboards/handwired/hnah40/hnah40.h new file mode 100644 index 00000000000..28e09f66832 --- /dev/null +++ b/keyboards/handwired/hnah40/hnah40.h @@ -0,0 +1,38 @@ +/* Copyright 2019 HnahKB + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments representing the physical +// layout of the board and position of the keys +// The second converts the arguments into a two-dimensional array which +// represents the switch matrix. + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k39, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, \ + k30, k31, k32, k33, k35, k37, k38, k3A\ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A }, \ + { k30, k31, k32, k33, KC_NO, k35, KC_NO, k37, k38, k39, k3A }, \ +} diff --git a/keyboards/handwired/hnah40/info.json b/keyboards/handwired/hnah40/info.json new file mode 100644 index 00000000000..6a577a5207e --- /dev/null +++ b/keyboards/handwired/hnah40/info.json @@ -0,0 +1,54 @@ +{ + "keyboard_name": "Hnah40", + "url": "https://github.com/vuhopkep/PCB/tree/master/Hnah40-Atmega328p/PCB_V1/PCB", + "maintainer": "HnahKB", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"BSPC", "x":11, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"A", "x":1.5, "y":1}, + {"label":"S", "x":2.5, "y":1}, + {"label":"D", "x":3.5, "y":1}, + {"label":"F", "x":4.5, "y":1}, + {"label":"G", "x":5.5, "y":1}, + {"label":"H", "x":6.5, "y":1}, + {"label":"J", "x":7.5, "y":1}, + {"label":"K", "x":8.5, "y":1}, + {"label":"L", "x":9.5, "y":1}, + {"label":"Enter", "x":10.5, "y":1, "w":1.5}, + {"label":"Shift", "x":0, "y":2, "w":1.75}, + {"label":"Z", "x":1.75, "y":2}, + {"label":"X", "x":2.75, "y":2}, + {"label":"C", "x":3.75, "y":2}, + {"label":"V", "x":4.75, "y":2}, + {"label":"B", "x":5.75, "y":2}, + {"label":"N", "x":6.75, "y":2}, + {"label":"M", "x":7.75, "y":2}, + {"label":",", "x":8.75, "y":2}, + {"label":"Shift", "x":9.75, "y":2, "w":2.25}, + {"label":"Ctrl", "x":0, "y":3, "w":1.25}, + {"label":"Win", "x":1.25, "y":3, "w":1.5}, + {"label":"Alt", "x":2.75, "y":3, "w":1.25}, + {"label":"Space", "x":4, "y":3, "w":2}, + {"label":"Space", "x":6, "y":3, "w":2}, + {"label":"App", "x":8, "y":3, "w":1.25}, + {"label":"Fn", "x":9.25, "y":3, "w":1.5}, + {"label":"Ctrl", "x":10.75, "y":3, "w":1.25} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/handwired/hnah40/keymaps/default/config.h b/keyboards/handwired/hnah40/keymaps/default/config.h new file mode 100644 index 00000000000..74412a948e8 --- /dev/null +++ b/keyboards/handwired/hnah40/keymaps/default/config.h @@ -0,0 +1,18 @@ +/* Copyright 2019 HnahKB + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/handwired/hnah40/keymaps/default/keymap.c b/keyboards/handwired/hnah40/keymaps/default/keymap.c new file mode 100644 index 00000000000..2fc67ba5ece --- /dev/null +++ b/keyboards/handwired/hnah40/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* Copyright 2019 HnahKB + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum hnah_layers{ + _QWERTY, + _LOWER, + _RAISE +}; + + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( /* Base */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT(RAISE, KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_APP, LOWER, KC_RCTL + ), + [_LOWER] = LAYOUT( /* Base */ + RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + RAISE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_COMM, KC_DOT, KC_SLSH, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_APP, KC_TRNS, KC_RCTL + ), + [_RAISE] = LAYOUT( /* Base */ + RESET, KC_1, KC_UP, RGB_TOG, RGB_MOD, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT , RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_ENT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE, KC_SPACE, KC_LEFT, KC_DOWN, KC_RGHT + ), +}; diff --git a/keyboards/handwired/hnah40/keymaps/default/readme.md b/keyboards/handwired/hnah40/keymaps/default/readme.md new file mode 100644 index 00000000000..b948ef96426 --- /dev/null +++ b/keyboards/handwired/hnah40/keymaps/default/readme.md @@ -0,0 +1 @@ +![Hnah40 Layout Image](https://i.imgur.com/7LT6Vam.jpg) \ No newline at end of file diff --git a/keyboards/handwired/hnah40/readme.md b/keyboards/handwired/hnah40/readme.md new file mode 100644 index 00000000000..20e2d712740 --- /dev/null +++ b/keyboards/handwired/hnah40/readme.md @@ -0,0 +1,20 @@ +# hnah40 + +![Hnah40](https://i.imgur.com/nXVmcyc.jpg) + +A custom 40% keyboard PCB, insprired by Plaid keyboard from hsgw + + +Keyboard Maintainer: [vuhopkep](https://github.com/vuhopkep) +Hardware Availability: https://github.com/vuhopkep/PCB/tree/master/Hnah40-Atmega328p + +Make example for this keyboard (after setting up your build environment): + + make handwired/hnah40:default:program + +## Bootloader +use usbasploader from hsgw. +https://github.com/hsgw/USBaspLoader/tree/plaid + + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/hnah40/rules.mk b/keyboards/handwired/hnah40/rules.mk new file mode 100644 index 00000000000..efd11bfa5c3 --- /dev/null +++ b/keyboards/handwired/hnah40/rules.mk @@ -0,0 +1,73 @@ +# MCU name +MCU = atmega328p +PROTOCOL = VUSB + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = bootloadHID + +# Flash program via avrdude, but default command is not suitable. +# You can use hnah40:default:program +PROGRAM_CMD = avrdude -c usbasp -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex + + +# disable debug code +OPT_DEFS = -DDEBUG_LEVEL=0 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes \ No newline at end of file diff --git a/keyboards/handwired/hnah40/usbconfig.h b/keyboards/handwired/hnah40/usbconfig.h new file mode 100644 index 00000000000..cbd37c34dcb --- /dev/null +++ b/keyboards/handwired/hnah40/usbconfig.h @@ -0,0 +1,397 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +// max power draw with maxed white underglow measured at 120 mA (peaks) +#define USB_CFG_MAX_BUS_POWER 100 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 0 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x01 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'H','n','a','h','K','B' +#define USB_CFG_VENDOR_NAME_LEN 6 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'H', 'n', 'a', 'h', '4', '0' +#define USB_CFG_DEVICE_NAME_LEN 6 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +#define USB_CFG_SERIAL_NUMBER 'H','n','a','h','K','B' +#define USB_CFG_SERIAL_NUMBER_LEN 6 +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +// #define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +// /* #define USB_INTR_CFG_CLR 0 */ +// /* #define USB_INTR_ENABLE EIMSK */ +// #define USB_INTR_ENABLE_BIT INT1 +// /* #define USB_INTR_PENDING EIFR */ +// #define USB_INTR_PENDING_BIT INTF1 +// #define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/handwired/ibm122m/config.h b/keyboards/handwired/ibm122m/config.h index 1c8e0587dcf..8189f704d70 100644 --- a/keyboards/handwired/ibm122m/config.h +++ b/keyboards/handwired/ibm122m/config.h @@ -45,16 +45,15 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { F0, B5, B4, B3, B2, B1, B0, E7 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 15 +#define DEBOUNCE 15 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -104,11 +103,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define B6_AUDIO #define C6_AUDIO diff --git a/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c b/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c index 9cd58c0ec9a..130465e8d88 100644 --- a/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c +++ b/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c @@ -137,10 +137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ),*/ }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/handwired/ibm122m/readme.md b/keyboards/handwired/ibm122m/readme.md index 09dac49c0d9..de89d7596e6 100644 --- a/keyboards/handwired/ibm122m/readme.md +++ b/keyboards/handwired/ibm122m/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make handwired/ibm122m:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/handwired/jn68m/config.h b/keyboards/handwired/jn68m/config.h index 22ab1158d7f..ef0c09cf142 100644 --- a/keyboards/handwired/jn68m/config.h +++ b/keyboards/handwired/jn68m/config.h @@ -36,19 +36,14 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4, E6, D1 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) diff --git a/keyboards/handwired/jn68m/rules.mk b/keyboards/handwired/jn68m/rules.mk index 42d85ada17b..fa95254d8ae 100644 --- a/keyboards/handwired/jn68m/rules.mk +++ b/keyboards/handwired/jn68m/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/jopr/config.h b/keyboards/handwired/jopr/config.h new file mode 100644 index 00000000000..aece7091564 --- /dev/null +++ b/keyboards/handwired/jopr/config.h @@ -0,0 +1,49 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4DAE +#define PRODUCT_ID 0x1000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER joelproko +#define PRODUCT jopr-106-Nl2SR-Cl2nL +#define DESCRIPTION jopr-106 Mechanical Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 11 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D6, D2, D4, D3, D5, D7, C6, B6, F5 } +#define MATRIX_COL_PINS { B3, B2, B1, B0, F7, E6, F6, B5, C7, B4, D1 } +#define UNUSED_PINS { B7 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 0 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +/* #define LOCKING_SUPPORT_ENABLE */ + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE +/* #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) */ +#define NO_ACTION_ONESHOT +#define TAPPING_TOGGLE 3 + +/*#define RGB_DI_PIN F4*/ +#ifdef RGB_DI_PIN +/*#define RGBLIGHT_ANIMATIONS*/ +#define RGBLED_NUM 1 +#define RGBLIGHT_HUE_STEP 1 +#define RGBLIGHT_SAT_STEP 1 +#define RGBLIGHT_VAL_STEP 1 +#endif diff --git a/keyboards/handwired/jopr/info.json b/keyboards/handwired/jopr/info.json new file mode 100644 index 00000000000..c4cadb8c3e1 --- /dev/null +++ b/keyboards/handwired/jopr/info.json @@ -0,0 +1,562 @@ +{ + "keyboard_name": "jopr-106", + "url": "https://github.com/joelproko/keyboard_layout_jopr", + "maintainer": "joelproko", + "width": 22.5, + "height": 6.25, + "layouts": { + "LAYOUT": { + "key_count": 106, + "layout": [ + { + "label": "MX_A0", + "x": 0, + "y": 0 + }, + { + "label": "MX_B0", + "x": 1.25, + "y": 0 + }, + { + "label": "MX_C0", + "x": 2.25, + "y": 0 + }, + { + "label": "MX_D0", + "x": 3.25, + "y": 0 + }, + { + "label": "MX_E0", + "x": 4.25, + "y": 0 + }, + { + "label": "MX_F0", + "x": 5.5, + "y": 0 + }, + { + "label": "MX_G0", + "x": 6.5, + "y": 0 + }, + { + "label": "MX_H0", + "x": 7.5, + "y": 0 + }, + { + "label": "MX_I0", + "x": 8.5, + "y": 0 + }, + { + "label": "MX_J0", + "x": 9.75, + "y": 0 + }, + { + "label": "MX_A6", + "x": 10.75, + "y": 0 + }, + { + "label": "MX_B6", + "x": 11.75, + "y": 0 + }, + { + "label": "MX_C6", + "x": 12.75, + "y": 0 + }, + { + "label": "MX_D6", + "x": 14, + "y": 0 + }, + { + "label": "MX_E6", + "x": 15.25, + "y": 0 + }, + { + "label": "MX_F6", + "x": 16.25, + "y": 0 + }, + { + "label": "MX_G6", + "x": 17.25, + "y": 0 + }, + { + "label": "MX_H6", + "x": 18.25, + "y": 0 + }, + { + "label": "MX_A1", + "x": 0, + "y": 1.25 + }, + { + "label": "MX_B1", + "x": 1, + "y": 1.25 + }, + { + "label": "MX_C1", + "x": 2, + "y": 1.25 + }, + { + "label": "MX_D1", + "x": 3, + "y": 1.25 + }, + { + "label": "MX_E1", + "x": 4, + "y": 1.25 + }, + { + "label": "MX_F1", + "x": 5, + "y": 1.25 + }, + { + "label": "MX_G1", + "x": 6, + "y": 1.25 + }, + { + "label": "MX_H1", + "x": 7, + "y": 1.25 + }, + { + "label": "MX_I1", + "x": 8, + "y": 1.25 + }, + { + "label": "MX_J1", + "x": 9, + "y": 1.25 + }, + { + "label": "MX_A7", + "x": 10, + "y": 1.25 + }, + { + "label": "MX_B7", + "x": 11, + "y": 1.25 + }, + { + "label": "MX_C7", + "x": 12, + "y": 1.25 + }, + { + "label": "MX_D7", + "x": 13, + "y": 1.25, + "w": 2 + }, + { + "label": "MX_E7", + "x": 15.25, + "y": 1.25 + }, + { + "label": "MX_F7", + "x": 16.25, + "y": 1.25 + }, + { + "label": "MX_G7", + "x": 17.25, + "y": 1.25 + }, + { + "label": "MX_H7", + "x": 18.25, + "y": 1.25 + }, + { + "label": "MX_A2", + "x": 0, + "y": 2.25, + "w": 1.5 + }, + { + "label": "MX_B2", + "x": 1.5, + "y": 2.25 + }, + { + "label": "MX_C2", + "x": 2.5, + "y": 2.25 + }, + { + "label": "MX_D2", + "x": 3.5, + "y": 2.25 + }, + { + "label": "MX_E2", + "x": 4.5, + "y": 2.25 + }, + { + "label": "MX_F2", + "x": 5.5, + "y": 2.25 + }, + { + "label": "MX_G2", + "x": 6.5, + "y": 2.25 + }, + { + "label": "MX_H2", + "x": 7.5, + "y": 2.25 + }, + { + "label": "MX_I2", + "x": 8.5, + "y": 2.25 + }, + { + "label": "MX_J2", + "x": 9.5, + "y": 2.25 + }, + { + "label": "MX_A8", + "x": 10.5, + "y": 2.25 + }, + { + "label": "MX_B8", + "x": 11.5, + "y": 2.25 + }, + { + "label": "MX_C8", + "x": 12.5, + "y": 2.25 + }, + { + "label": "MX_D8", + "x": 13.75, + "y": 2.25, + "w": 1.25, + "h": 2 + }, + { + "label": "MX_E8", + "x": 15.25, + "y": 2.25 + }, + { + "label": "MX_F8", + "x": 16.25, + "y": 2.25 + }, + { + "label": "MX_G8", + "x": 17.25, + "y": 2.25 + }, + { + "label": "MX_H8", + "x": 18.25, + "y": 2.25, + "h": 2 + }, + { + "label": "MX_A3", + "x": 0, + "y": 3.25, + "w": 1.75 + }, + { + "label": "MX_B3", + "x": 1.75, + "y": 3.25 + }, + { + "label": "MX_C3", + "x": 2.75, + "y": 3.25 + }, + { + "label": "MX_D3", + "x": 3.75, + "y": 3.25 + }, + { + "label": "MX_E3", + "x": 4.75, + "y": 3.25 + }, + { + "label": "MX_F3", + "x": 5.75, + "y": 3.25 + }, + { + "label": "MX_G3", + "x": 6.75, + "y": 3.25 + }, + { + "label": "MX_H3", + "x": 7.75, + "y": 3.25 + }, + { + "label": "MX_I3", + "x": 8.75, + "y": 3.25 + }, + { + "label": "MX_J3", + "x": 9.75, + "y": 3.25 + }, + { + "label": "MX_A9", + "x": 10.75, + "y": 3.25 + }, + { + "label": "MX_B9", + "x": 11.75, + "y": 3.25 + }, + { + "label": "MX_C9", + "x": 12.75, + "y": 3.25 + }, + { + "label": "MX_E9", + "x": 15.25, + "y": 3.25 + }, + { + "label": "MX_F9", + "x": 16.25, + "y": 3.25 + }, + { + "label": "MX_G9", + "x": 17.25, + "y": 3.25 + }, + { + "label": "MX_H9", + "x": 19.5, + "y": 3.25 + }, + { + "label": "MX_K1", + "x": 20.5, + "y": 3.25 + }, + { + "label": "MX_K0", + "x": 21.5, + "y": 3.25 + }, + { + "label": "MX_A4", + "x": 0, + "y": 4.25, + "w": 1.25 + }, + { + "label": "MX_B4", + "x": 1.25, + "y": 4.25 + }, + { + "label": "MX_C4", + "x": 2.25, + "y": 4.25 + }, + { + "label": "MX_D4", + "x": 3.25, + "y": 4.25 + }, + { + "label": "MX_E4", + "x": 4.25, + "y": 4.25 + }, + { + "label": "MX_F4", + "x": 5.25, + "y": 4.25 + }, + { + "label": "MX_G4", + "x": 6.25, + "y": 4.25 + }, + { + "label": "MX_H4", + "x": 7.25, + "y": 4.25 + }, + { + "label": "MX_I4", + "x": 8.25, + "y": 4.25 + }, + { + "label": "MX_J4", + "x": 9.25, + "y": 4.25 + }, + { + "label": "MX_I9", + "x": 10.25, + "y": 4.25 + }, + { + "label": "MX_I8", + "x": 11.25, + "y": 4.25 + }, + { + "label": "MX_I7", + "x": 12.25, + "y": 4.25, + "w": 2.75 + }, + { + "label": "MX_I6", + "x": 15.25, + "y": 4.25 + }, + { + "label": "MX_J9", + "x": 16.25, + "y": 4.25 + }, + { + "label": "MX_J8", + "x": 17.25, + "y": 4.25 + }, + { + "label": "MX_J7", + "x": 18.25, + "y": 4.25, + "h": 2 + }, + { + "label": "MX_J6", + "x": 19.5, + "y": 4.25 + }, + { + "label": "MX_K3", + "x": 20.5, + "y": 4.25 + }, + { + "label": "MX_K2", + "x": 21.5, + "y": 4.25 + }, + { + "label": "MX_A5", + "x": 0, + "y": 5.25, + "w": 1.25 + }, + { + "label": "MX_B5", + "x": 1.25, + "y": 5.25, + "w": 1.25 + }, + { + "label": "MX_C5", + "x": 2.5, + "y": 5.25, + "w": 1.25 + }, + { + "label": "MX_D5", + "x": 3.75, + "y": 5.25, + "w": 6.25 + }, + { + "label": "MX_J5", + "x": 10, + "y": 5.25, + "w": 1.25 + }, + { + "label": "MX_I5", + "x": 11.25, + "y": 5.25, + "w": 1.25 + }, + { + "label": "MX_K9", + "x": 12.5, + "y": 5.25, + "w": 1.25 + }, + { + "label": "MX_E5", + "x": 13.75, + "y": 5.25, + "w": 1.25 + }, + { + "label": "MX_K8", + "x": 15.25, + "y": 5.25, + "w": 2 + }, + { + "label": "MX_K7", + "x": 17.25, + "y": 5.25 + }, + { + "label": "MX_K6", + "x": 19.5, + "y": 5.25 + }, + { + "label": "MX_K5", + "x": 20.5, + "y": 5.25 + }, + { + "label": "MX_K4", + "x": 21.5, + "y": 5.25 + } + ] + } + } +} diff --git a/keyboards/handwired/jopr/jopr.c b/keyboards/handwired/jopr/jopr.c new file mode 100644 index 00000000000..3dccb719c2e --- /dev/null +++ b/keyboards/handwired/jopr/jopr.c @@ -0,0 +1,11 @@ +#include "jopr.h" +void matrix_init_kb(void) { + matrix_init_user(); + led_init_ports(); +}; + +void led_init_ports(void) { + setPinOutput(F0); + setPinOutput(F1); + setPinOutput(F4); +} \ No newline at end of file diff --git a/keyboards/handwired/jopr/jopr.h b/keyboards/handwired/jopr/jopr.h new file mode 100644 index 00000000000..b79a8f2646c --- /dev/null +++ b/keyboards/handwired/jopr/jopr.h @@ -0,0 +1,24 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K600, K601, K602, K603, K604, K605, K606, K607, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K700, K701, K702, K703, K704, K705, K706, K707, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K800, K801, K802, K803, K804, K805, K806, K807, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K900, K901, K902, K904, K905, K906, K907, K110, K010, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K908, K808, K708, K608, K909, K809, K709, K609, K310, K210, \ + K500, K501, K502, K503, K509, K508, K910, K504, K810, K710, K610, K510, K410 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410 }, \ + { K500, K501, K502, K503, K504, KC_NO, KC_NO, KC_NO, K508, K509, K510 }, \ + { K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610 }, \ + { K700, K701, K702, K703, K704, K705, K706, K707, K708, K709, K710 }, \ + { K800, K801, K802, K803, K804, K805, K806, K807, K808, K809, K810 }, \ + { K900, K901, K902, KC_NO, K904, K905, K906, K907, K908, K909, K910 } \ +} diff --git a/keyboards/handwired/jopr/keymaps/default/keymap.c b/keyboards/handwired/jopr/keymaps/default/keymap.c new file mode 100644 index 00000000000..d6b998f49b7 --- /dev/null +++ b/keyboards/handwired/jopr/keymaps/default/keymap.c @@ -0,0 +1,59 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FN 1 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_NO, KC_CAPS, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_MHEN, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_P4, KC_P5, KC_P6, KC_PGUP, KC_INS, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, KC_HOME, KC_UP, KC_END, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, KC_RWIN, LT(_FN,KC_APP), KC_RCTL, KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT + ), + [_FN] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SYSREQ, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_VOLU, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_MUTE, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, _______, _______, KC_VOLD, KC_MSTP, KC_VOLU, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT + ) +}; + +void led_set_user(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(F1); + } else { + writePinLow(F1); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(F0); + } else { + writePinLow(F0); + } + + if (!(IS_LED_ON(usb_led, USB_LED_NUM_LOCK))) { + tap_code(KC_NUMLOCK); + } +} +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static bool sysreq_led = false; + if (record->event.pressed) { + if (sysreq_led) { + sysreq_led = false; + writePinLow(F4); + } + else { + switch(keycode) { + case KC_SYSREQ: + sysreq_led = true; + writePinHigh(F4); + } + } + } + return true; +} diff --git a/keyboards/handwired/jopr/keymaps/modded_white/keymap.c b/keyboards/handwired/jopr/keymaps/modded_white/keymap.c new file mode 100644 index 00000000000..da1f9e1838e --- /dev/null +++ b/keyboards/handwired/jopr/keymaps/modded_white/keymap.c @@ -0,0 +1,59 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FN 1 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_NO, KC_CAPS, KC_SLCK, KC_PAUS, + KC_NUHS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NUBS, KC_SLSH, KC_BSPC, KC_PSCR, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_V, KC_Y, KC_D, KC_COMM, KC_QUOT, KC_INT1, KC_J, KC_M, KC_L, KC_U, KC_LBRC, KC_RBRC, KC_ENT, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_MHEN, KC_A, KC_T, KC_H, KC_E, KC_B, KC_MINS, KC_C, KC_S, KC_N, KC_O, KC_I, KC_EQL, KC_P4, KC_P5, KC_P6, KC_PGUP, KC_INS, KC_PGDN, + KC_LSFT, KC_GRV, KC_P, KC_K, KC_G, KC_W, KC_Q, KC_X, KC_R, KC_F, KC_DOT, KC_Z, KC_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, KC_HOME, KC_UP, KC_END, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, KC_RWIN, LT(_FN,KC_APP), KC_RCTL, KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT + ), + [_FN] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SYSREQ, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_VOLU, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_MUTE, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, _______, _______, KC_VOLD, KC_MSTP, KC_VOLU, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT + ) +}; + +void led_set_user(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(F1); + } else { + writePinLow(F1); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(F0); + } else { + writePinLow(F0); + } + + if (!(IS_LED_ON(usb_led, USB_LED_NUM_LOCK))) { + tap_code(KC_NUMLOCK); + } +} +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static bool sysreq_led = false; + if (record->event.pressed) { + if (sysreq_led) { + sysreq_led = false; + writePinLow(F4); + } + else { + switch(keycode) { + case KC_SYSREQ: + sysreq_led = true; + writePinHigh(F4); + } + } + } + return true; +} \ No newline at end of file diff --git a/keyboards/handwired/jopr/readme.md b/keyboards/handwired/jopr/readme.md new file mode 100644 index 00000000000..eab197d2de9 --- /dev/null +++ b/keyboards/handwired/jopr/readme.md @@ -0,0 +1,17 @@ +# jopr-106-Nl2SR-Cl2MH + +106-key based on ISO 105-key, NumLock to SysReq, CapsLock to Muhenkan/ROYA, NumLock state forced on + +![jopr-106-default](https://raw.githubusercontent.com/joelproko/keyboard_layout_jopr/master/keycode_layout_default.png) +![jopr-106-modded_white](https://raw.githubusercontent.com/joelproko/keyboard_layout_jopr/master/keycap_layout_modded_white.png) + +Inspired by [KeyBored](https://github.com/itractus/KeyBored) and [white_keyboard_layout](https://github.com/mw8/white_keyboard_layout) + +Keyboard Maintainer: [joelproko](https://github.com/joelproko) +Hardware: https://github.com/joelproko/keyboard_layout_jopr + +Make example for this keyboard (after setting up your build environment): + + make jopr:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/jopr/rules.mk b/keyboards/handwired/jopr/rules.mk new file mode 100644 index 00000000000..de83252c38a --- /dev/null +++ b/keyboards/handwired/jopr/rules.mk @@ -0,0 +1,63 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +UNICODE_ENABLE = yes +RGBLIGHT_ENABLE = no diff --git a/keyboards/handwired/jot50/config.h b/keyboards/handwired/jot50/config.h new file mode 100644 index 00000000000..2d2c1c18301 --- /dev/null +++ b/keyboards/handwired/jot50/config.h @@ -0,0 +1,38 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Jotix +#define PRODUCT Jot50 +#define DESCRIPTION A 5x12 compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +/* pro_micro pin-out */ +#define MATRIX_ROW_PINS { D7, E6, B4, B6, B2 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, D3, D2, D1, D0, D4, C6 } +#define UNUSED_PINS + +/* leds */ +#define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 5 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/handwired/jot50/jot50.c b/keyboards/handwired/jot50/jot50.c new file mode 100644 index 00000000000..a1d2258a581 --- /dev/null +++ b/keyboards/handwired/jot50/jot50.c @@ -0,0 +1,6 @@ +#include "jot50.h" + +void matrix_init_kb(void) { + + matrix_init_user(); +} diff --git a/keyboards/handwired/jot50/jot50.h b/keyboards/handwired/jot50/jot50.h new file mode 100644 index 00000000000..b7e67ae61ff --- /dev/null +++ b/keyboards/handwired/jot50/jot50.h @@ -0,0 +1,19 @@ +#pragma once + +#include "quantum.h" + + +#define LAYOUT_ortho_5x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ +} diff --git a/keyboards/handwired/jot50/keymaps/default/keymap.c b/keyboards/handwired/jot50/keymaps/default/keymap.c new file mode 100644 index 00000000000..4ec535c31df --- /dev/null +++ b/keyboards/handwired/jot50/keymaps/default/keymap.c @@ -0,0 +1,84 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +/* Funct + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | caps | F11 | F12 | | | | | - | = | [ | ] | \ | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | vol- | mute | vol+ | | | | _ | + | { | } | | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | prev | play | next | | | | | | | | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | | | | | | | | home | pgdn | pgup | end | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + */ +#define _FUNCT LAYOUT_ortho_5x12 (\ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,\ + KC_CAPS, KC_F11, KC_F12, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,\ + _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,\ + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END\ +) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | bspc | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | ` | Q | W | E | R | T | Y | U | I | O | P | del | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | tab | A | S | D | F | G | H | J | K | L | ; | ' | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | lshift | Z | X | C | V | B | N | M | , | . | / | enter | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | lctrl | lgui | lalt | ralt | lower | space | space | raise | left | down | up | right | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + */ +[_QWERTY] = LAYOUT_ortho_5x12 ( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_RALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[_LOWER] = _FUNCT, + +[_RAISE] = _FUNCT, + +[_ADJUST] = LAYOUT_ortho_5x12 ( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RESET, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BL_STEP, BL_BRTG, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +void matrix_init_user(void) { +} + diff --git a/keyboards/handwired/jot50/readme.md b/keyboards/handwired/jot50/readme.md new file mode 100644 index 00000000000..4c22b953d7e --- /dev/null +++ b/keyboards/handwired/jot50/readme.md @@ -0,0 +1,35 @@ +# Jot50 + +A compact 50% (12x5) ortholinear keyboard kit inspired in the Preonic made by jotix. + +Keyboard Maintainer: [jotix](https://github.com/jotix) +Hardware Supported: Arduino Pro Micro + +### Arduino Pro Micro Pinout + +| Rows | 0 | 1 | 2 | 3 | 4 | +|-------------|----|----|----|----|----| +| Arduino pin | 6 | 7 | 8 | 10 | 16 | +| QMK pin | D7 | E6 | B4 | B6 | B2 | + +| Columns | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | +|-------------|----|----|----|----|----|----|-----|-----|----|----|----|----| +| Arduino pin | A3 | A2 | A1 | A0 | 15 | 14 | TX0 | RXI | 2 | 3 | 4 | 5 | +| QMK pin | F4 | F5 | F6 | F7 | B1 | B3 | D3 | D2 | D1 | D0 | D4 | C6 | + +| | Backlight | +|-------------|-----------| +| Arduino pin | 9 | +| QMK pin | B5 | + +### Compiling the Firmware + +Make example for this keyboard (after setting up your build environment): + + make handwired/jot50:default + +### The Defaukt Keymap + +![Default Keymap](https://i.imgur.com/g85V8K6.png) + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/jot50/rules.mk b/keyboards/handwired/jot50/rules.mk new file mode 100644 index 00000000000..36a100c9631 --- /dev/null +++ b/keyboards/handwired/jot50/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +LAYOUTS = ortho_5x12 diff --git a/keyboards/handwired/jotanck/config.h b/keyboards/handwired/jotanck/config.h new file mode 100644 index 00000000000..925464825b2 --- /dev/null +++ b/keyboards/handwired/jotanck/config.h @@ -0,0 +1,37 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Jotix +#define PRODUCT Jotanck +#define DESCRIPTION A Jotantastic compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* pro_micro pin-out */ +#define MATRIX_ROW_PINS { D7, E6, B6, B2 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, D3, D2, D1, D0, D4, C6 } +#define UNUSED_PINS + +/* leds */ +#define JOTANCK_LEDS +#define JOTANCK_LED1 B5 +#define JOTANCK_LED2 B4 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/handwired/jotanck/jotanck.c b/keyboards/handwired/jotanck/jotanck.c new file mode 100644 index 00000000000..812781c3b71 --- /dev/null +++ b/keyboards/handwired/jotanck/jotanck.c @@ -0,0 +1,10 @@ +#include "jotanck.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void keyboard_pre_init_user() { + setPinOutput(JOTANCK_LED1); + setPinOutput(JOTANCK_LED2); +} diff --git a/keyboards/handwired/jotanck/jotanck.h b/keyboards/handwired/jotanck/jotanck.h new file mode 100644 index 00000000000..e253940ddc9 --- /dev/null +++ b/keyboards/handwired/jotanck/jotanck.h @@ -0,0 +1,17 @@ +#pragma once + +#include "quantum.h" + + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} diff --git a/keyboards/handwired/jotanck/keymaps/default/keymap.c b/keyboards/handwired/jotanck/keymaps/default/keymap.c new file mode 100644 index 00000000000..44f993db60c --- /dev/null +++ b/keyboards/handwired/jotanck/keymaps/default/keymap.c @@ -0,0 +1,122 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +static bool is_ctl_pressed; +static bool is_esc_pressed; +static bool is_bspc_pressed; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | esc | Q | W | E | R | T | Y | U | I | O | P | bksp | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | tab | A | S | D | F | G | H | J | K | L | ; | ' | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | lshift | Z | X | C | V | B | N | M | , | . | / | enter | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | lctrl | lgui | lalt | ralt | lower | space | space | raise | left | down | up | right | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + */ +[_QWERTY] = LAYOUT_ortho_4x12 ( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_RALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | | | | | | | | | | | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + */ +[_LOWER] = LAYOUT_ortho_4x12 ( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | del | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + * | | | | | | | | | home | home | pgdn | end | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ + */ +[_RAISE] = LAYOUT_ortho_4x12 ( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +}; + +uint32_t layer_state_set_user(uint32_t state) { + #ifdef JOTANCK_LEDS + switch (biton32(state)) { + case _LOWER: + writePinHigh(JOTANCK_LED1); + writePinLow(JOTANCK_LED2); + break; + case _RAISE: + writePinLow(JOTANCK_LED1); + writePinHigh(JOTANCK_LED2); + break; + default: + writePinLow(JOTANCK_LED1); + writePinLow(JOTANCK_LED2); + break; + }; + #endif + return state; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LCTL: + is_ctl_pressed = record->event.pressed; + break; + case KC_ESC: + is_esc_pressed = record->event.pressed; + break; + case KC_BSPC: + is_bspc_pressed = record->event.pressed; + break; + }; + return true; +} + +void matrix_scan_user(void) { + if (is_ctl_pressed && is_esc_pressed && is_bspc_pressed) { + reset_keyboard(); + } +} + diff --git a/keyboards/handwired/jotanck/readme.md b/keyboards/handwired/jotanck/readme.md new file mode 100644 index 00000000000..3ceea1ef4c1 --- /dev/null +++ b/keyboards/handwired/jotanck/readme.md @@ -0,0 +1,40 @@ +# Jotanck + +![Jotanck](https://i.imgur.com/bBfO4L2.jpg) + +A compact 40% (12x4) ortholinear keyboard kit inspired in the Planck made by jotix. + +Keyboard Maintainer: [jotix](https://github.com/jotix) +Hardware Supported: Arduino Pro Micro +Hardware Availability: [Mercado Libre](https://articulo.mercadolibre.com.ar/MLA-771696548-teclado-mecanico-handwired-black-switchs-pbt-keycaps-_JM) + +### Arduino Pro Micro Pinout + +| Rows | 0 | 1 | 2 | 3 | +|-------------|----|----|----|----| +| Arduino pin | 6 | 7 | 10 | 16 | +| QMK pin | D7 | E6 | B6 | B2 | + +| Columns | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | +|-------------|----|----|----|----|----|----|-----|-----|----|----|----|----| +| Arduino pin | A3 | A2 | A1 | A0 | 15 | 14 | TX0 | RXI | 2 | 3 | 4 | 5 | +| QMK pin | F4 | F5 | F6 | F7 | B1 | B3 | D3 | D2 | D1 | D0 | D4 | C6 | + +| | LED1 | LED2 | +|-------------|------|------| +| Arduino pin | 9 | 8 | +| QMK pin | B5 | B4 | + +### Compiling the Firmware + +Make example for this keyboard (after setting up your build environment): + + make handwired/jotanck:default + +### The Defaukt Keymap + +![Default Keymap](https://i.imgur.com/xh7Dmd7.png) + +To reset the keyboard press Ctrl+Esc+BackSpace + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/jotanck/rules.mk b/keyboards/handwired/jotanck/rules.mk new file mode 100644 index 00000000000..fa288141334 --- /dev/null +++ b/keyboards/handwired/jotanck/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +LAYOUTS = ortho_4x12 diff --git a/keyboards/handwired/jotpad16/config.h b/keyboards/handwired/jotpad16/config.h new file mode 100644 index 00000000000..075f9649c77 --- /dev/null +++ b/keyboards/handwired/jotpad16/config.h @@ -0,0 +1,37 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Jotix +#define PRODUCT JotPad16 +#define DESCRIPTION A Jotantastic compact NumPad + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* pro_micro pin-out */ +#define MATRIX_ROW_PINS { B6, B2, D2, D3 } +#define MATRIX_COL_PINS { B5, B4, B3, B1 } +#define UNUSED_PINS + +/* leds */ +#define QMK_LED E6 +#define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_PIN D7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/handwired/jotpad16/jotpad16.c b/keyboards/handwired/jotpad16/jotpad16.c new file mode 100644 index 00000000000..512234b9177 --- /dev/null +++ b/keyboards/handwired/jotpad16/jotpad16.c @@ -0,0 +1,6 @@ +#include "jotpad16.h" + +void matrix_init_kb(void) { + + matrix_init_user(); +} diff --git a/keyboards/handwired/jotpad16/jotpad16.h b/keyboards/handwired/jotpad16/jotpad16.h new file mode 100644 index 00000000000..012c9290ddf --- /dev/null +++ b/keyboards/handwired/jotpad16/jotpad16.h @@ -0,0 +1,18 @@ +#pragma once + +#include "quantum.h" + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_ortho_4x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, k23, \ + k30, k31, k32, k33 \ +) \ +{ \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, k23 }, \ + { k30, k31, k32, k33 } \ +} + diff --git a/keyboards/handwired/jotpad16/keymaps/default/keymap.c b/keyboards/handwired/jotpad16/keymaps/default/keymap.c new file mode 100644 index 00000000000..fb5dc71e234 --- /dev/null +++ b/keyboards/handwired/jotpad16/keymaps/default/keymap.c @@ -0,0 +1,34 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _NUMPAD 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Numpad + * +-------+-------+-------+-------+ + * | 7 | 8 | 9 | - | + * +-------+-------+-------+-------+ + * | 4 | 5 | 6 | + | + * +-------+-------+-------+-------+ + * | 1 | 2 | 3 | enter | + * +-------+-------+-------+-------+ + * | 0 | . | / | * | + * +-------+-------+-------+-------+ + */ +[_NUMPAD] = LAYOUT_ortho_4x4( + KC_P7, KC_P8, KC_P9, KC_MINS, + KC_P4, KC_P5, KC_P6, KC_PLUS, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_P0, KC_PDOT,KC_PSLS,KC_ASTR +), +}; diff --git a/keyboards/handwired/jotpad16/readme.md b/keyboards/handwired/jotpad16/readme.md new file mode 100644 index 00000000000..3d971a51548 --- /dev/null +++ b/keyboards/handwired/jotpad16/readme.md @@ -0,0 +1,39 @@ +# JotPad16 + +![JotPad16](https://i.imgur.com/RwmqWuS.jpg) + +A ortholinear keypad (4x4) made by jotix. + +Keyboard Maintainer: [jotix](https://github.com/jotix) +Hardware Supported: Arduino Pro Micro + +### Arduino Pro Micro Pinout + +| rows | 0 | 1 | 2 | 3 | +|-------------|----|----|-----|-----| +| arduino pin | 10 | 16 | RXI | TX0 | +| qmk pin | B6 | B2 | D2 | D3 | + +| columns | 0 | 1 | 2 | 3 | +|-------------|----|----|----|----| +| arduino pin | 9 | 8 | 14 | 15 | +| qmk pin | B5 | B4 | B3 | C3 | + +| | QMK led | Backlight | +|-------------|-----------|-----------| +| Arduino pin | 7 | 6 | +| qmk pin | E6 | D7 | + +### Compiling the Firmware + +Make example for this keyboard (after setting up your build environment): + + make handwired/jotpad16:default + +### The Default Keymap + +![Default Keymap](https://i.imgur.com/VJZcFRN.jpg) + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + + diff --git a/keyboards/handwired/jotpad16/rules.mk b/keyboards/handwired/jotpad16/rules.mk new file mode 100644 index 00000000000..8105f800cb9 --- /dev/null +++ b/keyboards/handwired/jotpad16/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +LAYOUTS = ortho_4x4 diff --git a/keyboards/handwired/kbod/config.h b/keyboards/handwired/kbod/config.h index a3f3e3908a1..f0bba68a55f 100644 --- a/keyboards/handwired/kbod/config.h +++ b/keyboards/handwired/kbod/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -46,16 +45,15 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D0, D1, F0, F1, F4, F5, F6, F7 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +98,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -161,5 +154,3 @@ along with this program. If not, see . #undef TAPPING_TOGGLE #define TAPPING_TOGGLE 2 - -#endif diff --git a/keyboards/handwired/kbod/info.json b/keyboards/handwired/kbod/info.json new file mode 100644 index 00000000000..02586164b23 --- /dev/null +++ b/keyboards/handwired/kbod/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "kbod", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/handwired/kbod/kbod.h b/keyboards/handwired/kbod/kbod.h index 35606362429..5d9dbd05b32 100644 --- a/keyboards/handwired/kbod/kbod.h +++ b/keyboards/handwired/kbod/kbod.h @@ -3,7 +3,7 @@ #include "quantum.h" -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, \ diff --git a/keyboards/handwired/kbod/keymaps/default/config.h b/keyboards/handwired/kbod/keymaps/default/config.h index df06a262062..271f48d0011 100644 --- a/keyboards/handwired/kbod/keymaps/default/config.h +++ b/keyboards/handwired/kbod/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/handwired/kbod/keymaps/default/keymap.c b/keyboards/handwired/kbod/keymaps/default/keymap.c index 1386b742f58..3119784e267 100644 --- a/keyboards/handwired/kbod/keymaps/default/keymap.c +++ b/keyboards/handwired/kbod/keymaps/default/keymap.c @@ -1,9 +1,12 @@ -#include "kbod.h" - -#define _____ KC_TRNS +#include QMK_KEYBOARD_H #define MODS_PRESSED(btn) (get_mods() & (MOD_BIT(KC_L##btn)|MOD_BIT(KC_R##btn))) +enum custom_keycodes { + SFT_ESC = SAFE_RANGE, + ALT_F4 +}; + #define SET_WHETHER(mask, btn1, btn2) \ if (record->event.pressed) { \ if (mask) { \ @@ -25,62 +28,53 @@ if (record->event.pressed) { \ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP( /* Base */ - F(0), KC_1, KC_2, KC_3, F(1), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQUAL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_ENTER, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSFT, - TT(1), KC_LCTL, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + LAYOUT( /* Base */ + SFT_ESC, KC_1, KC_2, KC_3, ALT_F4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + TT(1), KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL \ ), - KEYMAP( /* Cursor layer */ - KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, - TT(3), _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_INSERT, - TT(2), _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_HOME, _____, - _____, _____, _____, _____, _____, _____, _____, _____, KC_PGUP, KC_PGDN, KC_END, KC_UP, - _____, _____, _____, _____, _____, KC_LEFT, KC_DOWN, KC_RIGHT + LAYOUT( /* Cursor layer */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + TT(3), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + TT(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_END, KC_UP, \ + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT \ ), - KEYMAP( /* Keypad layer */ - TO(0), KC_1, KC_2, KC_3, F(1), KC_5, KC_6, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, KC_BSPC, - _____, _____, _____, _____, _____, _____, _____, KC_P4, KC_P5, KC_P6, _____, _____, _____, _____, - _____, _____, _____, _____, _____, _____, _____, KC_P1, KC_P2, KC_P3, _____, _____, _____, - _____, _____, _____, _____, _____, _____, _____, KC_P0, KC_PDOT, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, - _____, _____, _____, _____, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN3 + LAYOUT( /* Keypad layer */ + TO(0), KC_1, KC_2, KC_3, ALT_F4, KC_5, KC_6, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, KC_BSPC, \ + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_BTN1, KC_MS_U, KC_BTN2, \ + _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN3 \ ), - KEYMAP( /* Multimedia layer */ - TO(0), _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, _____, - _____, _____, KC_WAKE, _____, _____, _____, _____, _____, _____, _____, KC_MSTP, KC_MPRV, KC_MNXT, _____, - _____, _____, KC_SLEP, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, - _____, _____, KC_PWR, _____, _____, _____, _____, _____, _____, KC_MS_BTN1, KC_MS_WH_UP, KC_MS_BTN2, - _____, _____, _____, KC_MPLY, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_RIGHT, KC_MS_BTN3 + LAYOUT( /* Multimedia layer */ + TO(0), _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, \ + _______, _______, KC_WAKE, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPRV, KC_MNXT, _______, \ + _______, _______, KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_PWR, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_WH_U, KC_BTN2, \ + _______, _______, _______, KC_MPLY, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3 \ ), }; -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(0), - [1] = ACTION_FUNCTION(1), -}; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: + SET_WHETHER(MODS_PRESSED(SHIFT), KC_ESC, KC_GRAVE); + + return false; + case ALT_F4: + SET_WHETHER(MODS_PRESSED(ALT), KC_4, KC_F4); -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_mask; - static uint8_t alt_mask; - switch (id) { - case 0: - shift_esc_mask = MODS_PRESSED(SHIFT); - SET_WHETHER(shift_esc_mask, KC_ESC, KC_GRAVE); - break; - case 1: - alt_mask = MODS_PRESSED(ALT); - SET_WHETHER(alt_mask, KC_4, KC_F4); - break; + return false; + + default: + return true; } } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -}; - void led_set_user(uint8_t usb_led) { if (usb_led & _BV(USB_LED_CAPS_LOCK)) { PORTB |= _BV(PB0); @@ -101,4 +95,4 @@ void matrix_scan_user(void) { } else { PORTC &= ~_BV(PC7); } -} \ No newline at end of file +} diff --git a/keyboards/handwired/kbod/readme.md b/keyboards/handwired/kbod/readme.md index d2f2c01ae89..470ccce0e3d 100644 --- a/keyboards/handwired/kbod/readme.md +++ b/keyboards/handwired/kbod/readme.md @@ -1,21 +1,18 @@ -KBOD keyboard firmware -====================== +# KBOD -KBOD is a 60% Keyboard kit, hand-wired, with Arduino Micro as its controller. It's utilize 8x8 matrix and has layout similar to GH-60 +![KBOD](https://f4.fudanchii.net/shx/2017/02/IMG_20170212_224547.jpg) -## Quantum MK Firmware +KBOD is a 60% Keyboard kit, hand-wired, with Arduino Micro as its controller. It utilizes an 8x8 matrix and has layout similar to GH60. [More info](https://github.com/fudanchii/keyboard_of_disapproval) -For the full Quantum feature list, see [the parent readme](/). +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: Arduino Micro -## Building +Make example for this keyboard (after setting up your build environment): -Download or clone the whole firmware and use ```make handwired/kbod:default``` to generate the .hex file. You may flash it with avrdude + make handwired/kbod:default -## Flashing -Something along this line: +Flashing your firmware may be done with avrdude. The command should be something along this line: -``` -avrdude -p m32u4 -c avr109 -P -C -e -u flash:w:handwired_kbod_default.hex -``` + avrdude -p m32u4 -c avr109 -P -C -e -u flash:w:handwired_kbod_default.hex -[More info](https://github.com/fudanchii/keyboard_of_disapproval) \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/kbod/rules.mk b/keyboards/handwired/kbod/rules.mk index b97cacd5c3f..55ab9f350a4 100644 --- a/keyboards/handwired/kbod/rules.mk +++ b/keyboards/handwired/kbod/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/lovelive9/config.h b/keyboards/handwired/lovelive9/config.h new file mode 100644 index 00000000000..c11a25df600 --- /dev/null +++ b/keyboards/handwired/lovelive9/config.h @@ -0,0 +1,39 @@ + + +#pragma once +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0007 +#define DEVICE_VER 0x0001 +#define MANUFACTURER numazu Keyboards +#define PRODUCT lovelive9 +#define DESCRIPTION lovelive sunshine Keyboards 9Key + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 9 + +/* default pin-out */ +#define MATRIX_ROW_PINS { NO_PIN } +#define MATRIX_COL_PINS { B4, B6, B2, D7, B1, F7, F6, F5, F4 } + +#define UNUSED_PINS + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 9 // Number of LEDs + +#define RGBLIGHT_ANIMATIONS +#define BACKLIGHT_LEVELS 5 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 +#define BREATHING_PERIOD 2 +#define RGBLIGHT_LIMIT_VAL 255 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 +#define USB_MAX_POWER_CONSUMPTION 400 + +#define TAPPING_TERM 200 diff --git a/keyboards/handwired/lovelive9/info.json b/keyboards/handwired/lovelive9/info.json new file mode 100644 index 00000000000..4f81d321d9e --- /dev/null +++ b/keyboards/handwired/lovelive9/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "lovelive9", + "url": "https://github.com/ginjake", + "maintainer": "ginjake", + "width": 9, + "height": 1, + "layouts": { + "LAYOUT": { + "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0}, {"label":"k05", "x":5, "y":0}, {"label":"k06", "x":6, "y":0}, {"label":"k07", "x":7, "y":0}, {"label":"k08", "x":8, "y":0}] + } + } +} diff --git a/keyboards/handwired/lovelive9/keymaps/default/keymap.c b/keyboards/handwired/lovelive9/keymaps/default/keymap.c new file mode 100644 index 00000000000..605f722f444 --- /dev/null +++ b/keyboards/handwired/lovelive9/keymaps/default/keymap.c @@ -0,0 +1,338 @@ +#include QMK_KEYBOARD_H + +//#include "v1.h" + +//Following line allows macro to read current RGB settings + +rgblight_config_t RGB_current_config; + +#define KC_KANJI KC_GRV + + +enum Layer +{ + _QWERTY, + _DIA, + _YOU, + _CHIKA, + _ZURA, + _RUBY, + _YOHANE, + _RIKO, + _MARI, + _KANAN, + _RUBY_SUB1, + _RUBY_SUB2, + _RUBY_SUB3, + _SCHOOL_IDOL_FESTIVAL +}; + +#define SEND_DIA 100 +#define SEND_YOU 101 +#define SEND_CHIKA 102 +#define SEND_ZURA 103 +#define SEND_RUBY 104 +#define SEND_YOHANE 105 +#define SEND_RIKO 106 +#define SEND_MARI 107 +#define SEND_KANAN 108 + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + DIA, + YOU, + CHIKA, + ZURA, + RUBY, + RUBY_SUB1, + RUBY_SUB2, + RUBY_SUB3, + YOHANE, + RIKO, + MARI, + KANAN, + TO_SCHOOL_IDOL_FESTIVAL, + RETURN_SCHOOL_IDOL_FESTIVAL +}; + + +int long_tap_timer; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + DIA, YOU, CHIKA, ZURA, RUBY, YOHANE, RIKO, MARI, KANAN + ), + [_DIA] = LAYOUT( + DIA, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_LSFT + ), + + [_YOU] = LAYOUT( + KC_H, YOU, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_LSFT + ), + + [_CHIKA] = LAYOUT( + KC_O, KC_P, CHIKA, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_LSFT + ), + + [_ZURA] = LAYOUT( + KC_V, KC_W, KC_X, ZURA, KC_Y, KC_Z, KC_M, KC_N, KC_LSFT + ), + + //推しをたくさん押せるようにルビーちゃんには複数のレイヤー設定 + [_RUBY] = LAYOUT( + KC_CIRC, KC_LPRN, KC_QUOT, RUBY_SUB1, RUBY, RUBY_SUB2, KC_LCBR, KC_EXLM, KC_LSFT + ), + [_RUBY_SUB1] = LAYOUT( + KC_RCBR, KC_AT, KC_PIPE, RUBY_SUB1, RUBY, RUBY_SUB2, KC_HASH, KC_EQL, KC_LSFT + ), + [_RUBY_SUB2] = LAYOUT( + KC_TILD, KC_DLR, KC_LBRC, RUBY_SUB1, RUBY, RUBY_SUB2, KC_PERC, KC_RBRC, KC_LSFT + ), + [_RUBY_SUB3] = LAYOUT( + TO_SCHOOL_IDOL_FESTIVAL, KC_DLR, KC_LBRC, RUBY_SUB1, RUBY, RUBY_SUB2, KC_PERC, KC_RBRC, RETURN_SCHOOL_IDOL_FESTIVAL + ), + + [_YOHANE] = LAYOUT( + KC_0, KC_1, KC_2, KC_3, KC_4, YOHANE, KC_5, KC_6, KC_LSFT + ), + + [_RIKO] = LAYOUT( + KC_7, KC_8, KC_9, KC_PLUS, KC_MINS, KC_ASTR, RIKO, KC_SLSH, KC_LSFT + ), + + [_MARI] = LAYOUT( + KC_TAB, KC_DEL, KC_COMM, KC_SPC, KC_ENT, KC_BSPC, KC_DOT, MARI, KC_LSFT + ), + + [_KANAN] = LAYOUT( + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ENT, KC_BSPC, KC_AMPR, KC_KANJI, KANAN + ), + [_SCHOOL_IDOL_FESTIVAL] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9 + ), +}; + +void check_tap_and_send_key(int MEMBER) { + if (long_tap_timer < 500) { + switch (MEMBER) { + case SEND_DIA: + SEND_STRING("KUROSAWA DIA"); + break; + case SEND_YOU: + SEND_STRING("WATANABE YOU"); + break; + case SEND_CHIKA: + SEND_STRING("TAKAMI CHIKA"); + break; + case SEND_ZURA: + SEND_STRING("KUNIKIDA HANAMARU"); + break; + case SEND_RUBY: + SEND_STRING("KUROSAWA RUBY"); + break; + case SEND_YOHANE: + SEND_STRING("TSUSHIMA YOSHIKO"); + break; + case SEND_RIKO: + SEND_STRING("SAKURAUCHI RIKO"); + break; + case SEND_MARI: + SEND_STRING("OHARA MARI"); + break; + case SEND_KANAN: + SEND_STRING("MATSUURA KANAN"); + break; + } + } + long_tap_timer = 0; +} + +int aqours_color_h[] = { 26, 340, 150, 0, 199, 220, 53, 265, 322}; +int aqours_color_s[] = {255, 165, 255, 255, 255, 350, 255, 255, 255}; +int aqours_color_v[] = {255, 255, 255, 255, 255, 255, 200, 255, 255}; + +void LED_default_set(void) { + + sethsv(aqours_color_h[2], aqours_color_s[2], aqours_color_v[2], (LED_TYPE *)&led[0]); + sethsv(aqours_color_h[7], aqours_color_s[7], aqours_color_v[7], (LED_TYPE *)&led[1]); + sethsv(aqours_color_h[1], aqours_color_s[1], aqours_color_v[1], (LED_TYPE *)&led[2]); + sethsv(aqours_color_h[5], aqours_color_s[5], aqours_color_v[5], (LED_TYPE *)&led[3]); + sethsv(aqours_color_h[8], aqours_color_s[8], aqours_color_v[8], (LED_TYPE *)&led[4]); + sethsv(aqours_color_h[6], aqours_color_s[6], aqours_color_v[6], (LED_TYPE *)&led[5]); + sethsv(aqours_color_h[0], aqours_color_s[0], aqours_color_v[0], (LED_TYPE *)&led[6]); + sethsv(aqours_color_h[4], aqours_color_s[4], aqours_color_v[4], (LED_TYPE *)&led[7]); + sethsv(aqours_color_h[3], aqours_color_s[3], aqours_color_v[3], (LED_TYPE *)&led[8]); + + rgblight_set(); + +} + + +void LED_layer_set(int aqours_index) { + for (int c = 0; c < 9; c++) { + sethsv(aqours_color_h[aqours_index], aqours_color_s[aqours_index], aqours_color_v[aqours_index], (LED_TYPE *)&led[c]); + } + rgblight_set(); +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case DIA: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_DIA); + LED_layer_set(3); + } else { + check_tap_and_send_key(SEND_DIA); + layer_off(_DIA); + LED_default_set(); + } + break; + + case YOU: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_YOU); + LED_layer_set(4); + } else { + check_tap_and_send_key(SEND_YOU); + layer_off(_YOU); + LED_default_set(); + } + break; + + case CHIKA: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_CHIKA); + LED_layer_set(0); + } else { + check_tap_and_send_key(SEND_CHIKA); + layer_off(_CHIKA); + LED_default_set(); + } + break; + + case ZURA: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_ZURA); + LED_layer_set(6); + } else { + check_tap_and_send_key(SEND_ZURA); + layer_off(_ZURA); + LED_default_set(); + } + break; + + case RUBY: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_RUBY); + LED_layer_set(8); + } else { + check_tap_and_send_key(SEND_RUBY); + layer_off(_RUBY); + LED_default_set(); + } + break; + case RUBY_SUB1: + if (record->event.pressed) { + layer_on(_RUBY_SUB1); + if (IS_LAYER_ON(_RUBY_SUB1) && IS_LAYER_ON(_RUBY_SUB2)) { + layer_on(_RUBY_SUB3); + } else { + layer_off(_RUBY_SUB3); + } + } else { + layer_off(_RUBY_SUB1); + } + break; + case RUBY_SUB2: + if (record->event.pressed) { + layer_on(_RUBY_SUB2); + if (IS_LAYER_ON(_RUBY_SUB1) && IS_LAYER_ON(_RUBY_SUB2)) { + layer_on(_RUBY_SUB3); + } else { + layer_off(_RUBY_SUB3); + } + } else { + layer_off(_RUBY_SUB2); + } + break; + + case YOHANE: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_YOHANE); + LED_layer_set(5); + } else { + check_tap_and_send_key(SEND_YOHANE); + layer_off(_YOHANE); + LED_default_set(); + } + break; + + case RIKO: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_RIKO); + LED_layer_set(1); + } else { + check_tap_and_send_key(SEND_RIKO); + layer_off(_RIKO); + LED_default_set(); + } + break; + + case MARI: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_MARI); + LED_layer_set(7); + } else { + check_tap_and_send_key(SEND_MARI); + layer_off(_MARI); + LED_default_set(); + } + break; + + case KANAN: + if (record->event.pressed) { + long_tap_timer = 1; + layer_on(_KANAN); + LED_layer_set(2); + } else { + check_tap_and_send_key(SEND_KANAN); + layer_off(_KANAN); + LED_default_set(); + } + break; + + case TO_SCHOOL_IDOL_FESTIVAL: + if (record->event.pressed) { + LED_default_set(); + layer_on(_SCHOOL_IDOL_FESTIVAL); + } + break; + case RETURN_SCHOOL_IDOL_FESTIVAL: + if (record->event.pressed) { + layer_off(_SCHOOL_IDOL_FESTIVAL); + } + break; + } + + return true; +} + + +void matrix_scan_user(void) { + + if (long_tap_timer > 0) { + long_tap_timer++; + } +} diff --git a/keyboards/handwired/lovelive9/lovelive9.c b/keyboards/handwired/lovelive9/lovelive9.c new file mode 100644 index 00000000000..1ec8ae0527c --- /dev/null +++ b/keyboards/handwired/lovelive9/lovelive9.c @@ -0,0 +1,7 @@ +#include "lovelive9.h" + + + +void matrix_init_kb(void) { + matrix_init_user(); +} diff --git a/keyboards/handwired/lovelive9/lovelive9.h b/keyboards/handwired/lovelive9/lovelive9.h new file mode 100644 index 00000000000..f6fb1f94cc0 --- /dev/null +++ b/keyboards/handwired/lovelive9/lovelive9.h @@ -0,0 +1,9 @@ +#pragma once + +#include "quantum.h" +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08 } \ +} diff --git a/keyboards/handwired/lovelive9/readme.md b/keyboards/handwired/lovelive9/readme.md new file mode 100644 index 00000000000..2046472773c --- /dev/null +++ b/keyboards/handwired/lovelive9/readme.md @@ -0,0 +1,14 @@ +# lovelive9 + +lovelive9 is 9keys keyboard. + +![lovelive9](https://user-images.githubusercontent.com/16838187/53496102-a6fc0700-3ae4-11e9-85e4-1e6cd981b410.jpg) + +Keyboard Maintainer: [ginjake](https://github.com/ginjake) [Twitter:@sirojake](https://twitter.com/sirojake) +Hardware Supported: Pro Micro, handwired (LED used [CherryMXLEDBitBoard](https://github.com/swanmatch/MxLEDBitPCB) with handwired) + +Make example for this keyboard (after setting up your build environment): + + make handwired/lovelive9:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/n diff --git a/keyboards/handwired/lovelive9/rules.mk b/keyboards/handwired/lovelive9/rules.mk new file mode 100644 index 00000000000..8ec4ed3d659 --- /dev/null +++ b/keyboards/handwired/lovelive9/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = caterina + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/maartenwut/config.h b/keyboards/handwired/maartenwut/config.h index 066f1385603..d059c6e4ab8 100755 --- a/keyboards/handwired/maartenwut/config.h +++ b/keyboards/handwired/maartenwut/config.h @@ -32,12 +32,7 @@ #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +#define DEBOUNCE 5 #define QMK_ESC_OUTPUT C6 // usually COL #define QMK_ESC_INPUT D0 // usually ROW diff --git a/keyboards/handwired/maartenwut/info.json b/keyboards/handwired/maartenwut/info.json new file mode 100644 index 00000000000..98720d24f13 --- /dev/null +++ b/keyboards/handwired/maartenwut/info.json @@ -0,0 +1,80 @@ +{ + "keyboard_name": "Maartenwut Ortho", + "url": "", + "maintainer": "maartenwut", + "width": 14, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0}, + {"label":"Esc", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"[", "x":11, "y":1}, + {"label":"]", "x":12, "y":1}, + {"label":"\\", "x":13, "y":1}, + {"label":"Tab", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":"'", "x":11, "y":2}, + {"label":"Delete", "x":12, "y":2}, + {"label":"Enter", "x":13, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Shift", "x":11, "y":3}, + {"label":"Up", "x":12, "y":3}, + {"label":"Print Screen", "x":13, "y":3}, + {"label":"Ctrl", "x":0, "y":4}, + {"label":"GUI", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"Fn", "x":3, "y":4}, + {"label":"Fn3 / Space", "x":4, "y":4, "w":2.25}, + {"label":"Space", "x":6.25, "y":4, "w":2.75}, + {"label":"Fn2", "x":9, "y":4}, + {"label":"Alt", "x":10, "y":4}, + {"label":"Left", "x":11, "y":4}, + {"label":"Down", "x":12, "y":4}, + {"label":"Right", "x":13, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/maartenwut/keymaps/default/keymap.c b/keyboards/handwired/maartenwut/keymaps/default/keymap.c index 9152d8ca220..54276d4b20d 100755 --- a/keyboards/handwired/maartenwut/keymaps/default/keymap.c +++ b/keyboards/handwired/maartenwut/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "maartenwut.h" +#include QMK_KEYBOARD_H #define _MA 0 #define _NU 1 @@ -6,9 +6,6 @@ #define _GA 3 #define _AR 4 -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define LSHIFT OSM(MOD_LSFT) #define SPACE LT(_AR, KC_SPC) @@ -43,4 +40,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) -}; \ No newline at end of file +}; diff --git a/keyboards/handwired/maartenwut/readme.md b/keyboards/handwired/maartenwut/readme.md index 31fc76743c6..0ae73827112 100644 --- a/keyboards/handwired/maartenwut/readme.md +++ b/keyboards/handwired/maartenwut/readme.md @@ -2,7 +2,7 @@ Custom handwired keyboard for maartenwut. -Keyboard Maintainer: [Maarten Dekekrs](https://github.com/maartenwut) +Keyboard Maintainer: [Maarten Dekkers](https://github.com/maartenwut) Hardware Supported: Custom handwired Hardware Availability: @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make handwired/maartenwut:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/magicforce61/README.md b/keyboards/handwired/magicforce61/README.md deleted file mode 100644 index cc86732627c..00000000000 --- a/keyboards/handwired/magicforce61/README.md +++ /dev/null @@ -1,24 +0,0 @@ -Magicforce "61" Handwired -======================= - -Basically I cut 7 keys off the magicforce68 and handwired everything to a -teensy++ 2.0 to make it a ~60% board. - -## Wiring Layout - -![Wiring Layout](https://imgur.com/gallery/RxYyA) - -## Pinout - -The following pins are used: - - ``` - #define MATRIX_ROW_PINS { D0, D1, D2, D3, D4 } - #define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 } - ``` - -## Compiling and loading the firmware - -To build the firmware, run `make handwired/magicforce61`. - -Flash the firmware using the teensy loader or avrdude. diff --git a/keyboards/handwired/magicforce61/config.h b/keyboards/handwired/magicforce61/config.h index bb329541c7c..446f4aefca1 100644 --- a/keyboards/handwired/magicforce61/config.h +++ b/keyboards/handwired/magicforce61/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -43,7 +42,7 @@ along with this program. If not, see . * */ #define MATRIX_ROW_PINS { D0, D1, D2, D3, D4 } -#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 } +#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 } #define UNUSED_PINS /* COL2ROW or ROW2COL */ @@ -53,9 +52,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +98,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -158,5 +151,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/handwired/magicforce61/info.json b/keyboards/handwired/magicforce61/info.json new file mode 100644 index 00000000000..22ffccd3ced --- /dev/null +++ b/keyboards/handwired/magicforce61/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "Magicforce \"61\"", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/handwired/magicforce61/keymaps/default/keymap.c b/keyboards/handwired/magicforce61/keymaps/default/keymap.c index 9559be5d21b..12252c978ab 100644 --- a/keyboards/handwired/magicforce61/keymaps/default/keymap.c +++ b/keyboards/handwired/magicforce61/keymaps/default/keymap.c @@ -1,69 +1,54 @@ -#include "magicforce61.h" +#include QMK_KEYBOARD_H #define _QWERTY 0 #define _FN1 1 #define _FN2 2 -#define KC_ KC_TRNS + #define KC_X0 LT(_FN2, KC_GRV) #define KC_X1 MO(_FN1) -#define KC_NAV_ESC LT(_FN1, KC_ESC) +#define NAV_ESC LT(_FN1, KC_ESC) #define KC_GUI MAGIC_UNNO_GUI const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KEYMAP( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. */ - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| */ - NAV_ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| */ - LSPO , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSPC , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------. */ - LCTL , RGUI ,LALT , SPACE , X1 ,RALT ,RCTL , X1 - /*`-----+-----+-----+------------------------------+------+-----+-----' ANY */ + [_QWERTY] = LAYOUT( + /*,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + /*|esc-----`-1------`-2------`-3------`-4------`-5------`-6------`-7------`-8------`-9------`-0------`mnus----`plus----`--bksp--| */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + /*|tab-----`-q------`-w------`-e------`-r------`-t------`-y------`-u------`-i------`-o------`-p------`-{------`-}------`--|-----| */ + NAV_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + /*|caps----`-a------`-s------`-d------`-f------`-g------`-h------`-j------`-k------`-l------`-;------`-'------`-----------enter-| */ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + /*|shift---`-z------`-x------`-c------`-v------`-b------`-n------`-m------`-,------`-.------`-/------`--------------------shift-| */ + KC_LCTL, KC_RGUI, KC_LALT, KC_SPC, KC_X1, KC_RALT, KC_RCTL, KC_X1 \ + /*`ctrl----`-gui----`-alt----`------------------space---------------------------------------`-fn-----`-alt----`ctrl----' ANY */ ), - [_FN1] = KEYMAP( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| */ - , , UP , , , , , ,INS ,PSCR, , , , , - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| */ - ,LEFT,DOWN,RGHT, , , , PGDN , PGUP , , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| */ - , , , , , ,VOLD,VOLU,MUTE, , , , - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-. */ - , , , , , , , MPLY - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' ANY */ + [_FN1] = LAYOUT( + /*,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, \ + /*|esc-----`-1------`-2------`-3------`-4------`-5------`-6------`-7------`-8------`-9------`-0------`mnus----`plus----`--bksp--| */ + _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_INS, KC_PSCR, _______, _______, _______, _______, \ + /*|tab-----`-q------`-w------`-e------`-r------`-t------`-y------`-u------`-i------`-o------`-p------`-{------`-}------`--|-----| */ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_PGDN, KC_PGUP, _______, _______, _______, _______, \ + /*|caps----`-a------`-s------`-d------`-f------`-g------`-h------`-j------`-k------`-l------`-;------`-'------`-----------enter-| */ + _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, \ + /*|shift---`-z------`-x------`-c------`-v------`-b------`-n------`-m------`-,------`-.------`-/------`--------------------shift-| */ + _______, _______, _______, _______, _______, _______, _______, KC_MPLY \ + /*`ctrl----`-gui----`-alt----`------------------space---------------------------------------`-fn-----`-alt----`ctrl----' ANY */ ), - [_FN2] = KEYMAP( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| */ - , , , , , , , 7 , 8 , 9 , , , , , - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| */ - , , , , , , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| */ - , , , , , , 0 , 1 , 2 , 3 , , , - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-. */ - , , , , , , , - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' ANY */ + [_FN2] = LAYOUT( + /*,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, \ + /*|esc-----`-1------`-2------`-3------`-4------`-5------`-6------`-7------`-8------`-9------`-0------`mnus----`plus----`--bksp--| */ + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, \ + /*|tab-----`-q------`-w------`-e------`-r------`-t------`-y------`-u------`-i------`-o------`-p------`-{------`-}------`--|-----| */ + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, \ + /*|caps----`-a------`-s------`-d------`-f------`-g------`-h------`-j------`-k------`-l------`-;------`-'------`-----------enter-| */ + _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, _______, _______, \ + /*|shift---`-z------`-x------`-c------`-v------`-b------`-n------`-m------`-,------`-.------`-/------`--------------------shift-| */ + _______, _______, _______, _______, _______, _______, _______, _______ \ + /*`ctrl----`-gui----`-alt----`------------------space---------------------------------------`-fn-----`-alt----`ctrl----' ANY */ ) }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/handwired/magicforce61/magicforce61.h b/keyboards/handwired/magicforce61/magicforce61.h index 784f2b2c802..37a32ed7839 100644 --- a/keyboards/handwired/magicforce61/magicforce61.h +++ b/keyboards/handwired/magicforce61/magicforce61.h @@ -1,20 +1,17 @@ -#ifndef MAGICFORCE61_H -#define MAGICFORCE61_H +#pragma once #include "quantum.h" -#define KEYMAP( \ +#define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \ K40, K41, K42, K45, K49, K4A, K4C, K4D \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_NO, KC_##K3D }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_NO, KC_##K4C, KC_##K4D }, \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, KC_NO, K4C, K4D }, \ } - -#endif diff --git a/keyboards/handwired/magicforce61/readme.md b/keyboards/handwired/magicforce61/readme.md new file mode 100644 index 00000000000..081992aa841 --- /dev/null +++ b/keyboards/handwired/magicforce61/readme.md @@ -0,0 +1,31 @@ +# Magicforce "61" Handwired + +Basically I cut 7 keys off the magicforce68 and handwired everything to a teensy++ 2.0 to make it a ~60% board. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: magicforce61, teensy++ 2.0 + +Make example for this keyboard (after setting up your build environment): + + make handwired/magicforce61:default + +Flash the firmware using the teensy loader or avrdude. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Wiring Layout / Pinout + +| | B5 | B4 | B3 | B2 | B1 | B0 | E7 | E6 | F0 | F1 | F2 | F3 | F4 | F5 | +| -----: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | +| **D0** | Esc | 1! | 2@ | 3# | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | -_ | =+ | Bspc | +| **D1** | Tab | Q | W | E | R | T | Y | U | I | O | P | [{ | ]} | \\\| | +| **D2** | Caps | A | S | D | F | G | H | J | K | L | ;: | '" | | Ent | +| **D3** | LSft | Z | X | C | V | B | N | M | , | . | / | | | RSft | +| **D4** | LCtl | LGUI | LAlt | | | Spc | | | | RAlt | RGUI | | App | RCtl | + +The following pins are used: + +``` +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4 } +#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 } +``` diff --git a/keyboards/handwired/magicforce68/README.md b/keyboards/handwired/magicforce68/README.md deleted file mode 100644 index a0de66069db..00000000000 --- a/keyboards/handwired/magicforce68/README.md +++ /dev/null @@ -1,20 +0,0 @@ -Magicforce 68 Handwired -======================= - -This firmware is for a Magicforce 68 that's had its PCB removed and is handwired with an Arduino Micro. NOTE: The Arduino Micro is different than the Arduino *Pro* Micro. - -## Wiring Layout - -![Wiring Layout](http://i.imgur.com/NmTCv5u.png) - -## Pinout - -The following pins are used: -- Columns 1-15: B2, B0, D3, D2, D1, D0, D4, C6, D7, E6, B4, B5, B6, B7, D6 -- Rows 1-5: F0, F1, F4, F5, F6 - -## Compiling and loading the firmware - -To build the firmware, run `make`. - -To flash the firemware onto the microcontroller, run `make avrdude`, and press the reset button. diff --git a/keyboards/handwired/magicforce68/config.h b/keyboards/handwired/magicforce68/config.h index 1e2b7d3e731..1cb7e91b416 100644 --- a/keyboards/handwired/magicforce68/config.h +++ b/keyboards/handwired/magicforce68/config.h @@ -53,9 +53,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/magicforce68/info.json b/keyboards/handwired/magicforce68/info.json new file mode 100644 index 00000000000..a3905336ab8 --- /dev/null +++ b/keyboards/handwired/magicforce68/info.json @@ -0,0 +1,81 @@ +{ + "keyboard_name": "Magicforce 68 Handwired", + "url": "", + "maintainer": "qmk", + "width": 17.25, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Insert", "x":15.25, "y":0}, + {"label":"Page Up", "x":16.25, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Delete", "x":15.25, "y":1}, + {"label":"Page Down", "x":16.25, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Up", "x":15.25, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Fn", "x":10, "y":4, "w":1.25}, + {"label":"Alt", "x":11.25, "y":4, "w":1.25}, + {"label":"Ctrl", "x":12.5, "y":4, "w":1.25}, + {"label":"Left", "x":14.25, "y":4}, + {"label":"Down", "x":15.25, "y":4}, + {"label":"Right", "x":16.25, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/magicforce68/keymaps/default/keymap.c b/keyboards/handwired/magicforce68/keymaps/default/keymap.c index 22553f714c3..e44cfefdb15 100644 --- a/keyboards/handwired/magicforce68/keymaps/default/keymap.c +++ b/keyboards/handwired/magicforce68/keymaps/default/keymap.c @@ -1,67 +1,34 @@ -#include "magicforce68.h" +#include QMK_KEYBOARD_H #define _QWERTY 0 #define _FN1 1 #define _FN2 2 -#define KC_ KC_TRNS + #define KC_X0 LT(_FN2, KC_GRV) #define KC_X1 MO(_FN1) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KEYMAP( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ - LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT - /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ + [_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, \ + KC_X0, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_X1, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ ), - [_FN1] = KEYMAP( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , , , , , , , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , , , , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , ,MUTE, , , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + [_FN1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, KC_VOLU, KC_HOME, \ + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, \ + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, KC_MUTE, \ + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT \ ), - [_FN2] = KEYMAP( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , 0 , 1 , 2 , 3 , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + [_FN2] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, KC_VOLU, KC_HOME, \ + _______, _______, _______, KC_UP, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, KC_VOLD, KC_END, \ + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, _______, _______, KC_MUTE, \ + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT \ ) }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/handwired/magicforce68/magicforce68.h b/keyboards/handwired/magicforce68/magicforce68.h index cfcdce38d57..949507fef79 100644 --- a/keyboards/handwired/magicforce68/magicforce68.h +++ b/keyboards/handwired/magicforce68/magicforce68.h @@ -3,18 +3,18 @@ #include "quantum.h" -#define KEYMAP( \ +#define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K2E, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K3E, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3D, \ K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D, K4E \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_NO, KC_##K2E }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_##K3C, KC_##K3D, KC_##K3E }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D, K4E } \ } -#endif \ No newline at end of file +#endif diff --git a/keyboards/handwired/magicforce68/readme.md b/keyboards/handwired/magicforce68/readme.md new file mode 100644 index 00000000000..5b5ade3b7f3 --- /dev/null +++ b/keyboards/handwired/magicforce68/readme.md @@ -0,0 +1,24 @@ +# Magicforce 68 Handwired + +This firmware is for a Magicforce 68 that's had its PCB removed and is handwired with an Arduino Micro. NOTE: The Arduino Micro is different than the Arduino *Pro* Micro. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: magicforce68, Arduino Micro + +## Wiring Layout + +![Wiring Layout](http://i.imgur.com/NmTCv5u.png) + +## Pinout + +The following pins are used: +- Columns 1-15: B2, B0, D3, D2, D1, D0, D4, C6, D7, E6, B4, B5, B6, B7, D6 +- Rows 1-5: F0, F1, F4, F5, F6 + +Make example for this keyboard (after setting up your build environment): + + make handwired/magicforce68:default + +To flash the firmware onto the microcontroller, run `make handwired/magicforce68:default:avrdude`, and press the reset button. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/mechboards_micropad/config.h b/keyboards/handwired/mechboards_micropad/config.h new file mode 100644 index 00000000000..8f237a64a14 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x8968 +#define PRODUCT_ID 0x0001 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar +#define PRODUCT Mechboards Micropad +#define DESCRIPTION Enjoy your freebie! + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B6 } +#define MATRIX_COL_PINS { B2, B3, B1, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/handwired/mechboards_micropad/info.json b/keyboards/handwired/mechboards_micropad/info.json new file mode 100644 index 00000000000..f8908d9fcf0 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Mechboards Micropad", + "url": "", + "maintainer": "yiancar", + "width": 4, + "height": 1, + "layouts": { + "LAYOUT": { + "layout": [{"label":"1", "x":0, "y":0}, {"label":"2", "x":1, "y":0}, {"label":"3", "x":2, "y":0}, {"label":"4", "x":3, "y":0}] + } + } +} \ No newline at end of file diff --git a/keyboards/handwired/mechboards_micropad/keymaps/default/keymap.c b/keyboards/handwired/mechboards_micropad/keymaps/default/keymap.c new file mode 100644 index 00000000000..41784c5204c --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/keymaps/default/keymap.c @@ -0,0 +1,84 @@ +/* Copyright 2019 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +uint8_t led_state = 1; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MECHBOARDURL = SAFE_RANGE, + QMKURL, + MKUK, + LEDCHANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + MECHBOARDURL, QMKURL, MKUK, LEDCHANGE \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MECHBOARDURL: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("https://mechboards.co.uk/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + case MKUK: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("MKUK4 was amazing!"); + } else { + // when keycode QMKURL is released + } + break; + case LEDCHANGE: + if (record->event.pressed) { + // when keycode QMKURL is pressed + led_state = !led_state; + writePin(F6, led_state); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + setPinOutput(F6); + writePinLow(F6); +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/mechboards_micropad/keymaps/default/readme.md b/keyboards/handwired/mechboards_micropad/keymaps/default/readme.md new file mode 100644 index 00000000000..92d37ad8b92 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/keymaps/default/readme.md @@ -0,0 +1,4 @@ +# The default keymap for mechboards_micropad + +This is a 4 key micropad freebie from Mechboards and Yiancar-Designs. +Press the keys to find out the secrets:) \ No newline at end of file diff --git a/keyboards/handwired/mechboards_micropad/mechboards_micropad.c b/keyboards/handwired/mechboards_micropad/mechboards_micropad.c new file mode 100644 index 00000000000..d4c8fa9b928 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/mechboards_micropad.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "mechboards_micropad.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/handwired/mechboards_micropad/mechboards_micropad.h b/keyboards/handwired/mechboards_micropad/mechboards_micropad.h new file mode 100644 index 00000000000..98390848623 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/mechboards_micropad.h @@ -0,0 +1,33 @@ +/* Copyright 2019 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03 \ +) \ +{ \ + { k00, k01, k02, k03 } \ +} diff --git a/keyboards/handwired/mechboards_micropad/readme.md b/keyboards/handwired/mechboards_micropad/readme.md new file mode 100644 index 00000000000..36230b1281b --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/readme.md @@ -0,0 +1,14 @@ +Mechboards Micropad +=================== + +This was a freebie, use me and find out more about me :) + +Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) +Hardware Supported: ATMega32u4 +Hardware Availability: Random mechboards.co.uk order and UK meetups! + +Make example for this keyboard (after setting up your build environment): + + make handwired/mechboards_micropad:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/mechboards_micropad/rules.mk b/keyboards/handwired/mechboards_micropad/rules.mk new file mode 100644 index 00000000000..033ccaf84f8 --- /dev/null +++ b/keyboards/handwired/mechboards_micropad/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/handwired/minorca/config.h b/keyboards/handwired/minorca/config.h index 4cdafcbd2e4..fea201b9cf2 100644 --- a/keyboards/handwired/minorca/config.h +++ b/keyboards/handwired/minorca/config.h @@ -47,18 +47,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/handwired/minorca/info.json b/keyboards/handwired/minorca/info.json new file mode 100644 index 00000000000..dafee63456c --- /dev/null +++ b/keyboards/handwired/minorca/info.json @@ -0,0 +1,55 @@ +{ + "keyboard_name": "Minorca Handwired", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"KA00", "x":0, "y":0}, + {"label":"KA01", "x":1, "y":0}, + {"label":"KA02", "x":2, "y":0}, + {"label":"KA03", "x":3, "y":0}, + {"label":"KA04", "x":4, "y":0}, + {"label":"KA05", "x":5, "y":0}, + {"label":"KA06", "x":6, "y":0}, + {"label":"KA07", "x":7, "y":0}, + {"label":"KA08", "x":8, "y":0}, + {"label":"KA09", "x":9, "y":0}, + {"label":"KA10", "x":10, "y":0}, + {"label":"KA11", "x":11, "y":0}, + {"label":"KB00", "x":0, "y":1, "w":1.25}, + {"label":"KB01", "x":1.25, "y":1}, + {"label":"KB02", "x":2.25, "y":1}, + {"label":"KB03", "x":3.25, "y":1}, + {"label":"KB04", "x":4.25, "y":1}, + {"label":"KB05", "x":5.25, "y":1}, + {"label":"KB06", "x":6.25, "y":1}, + {"label":"KB07", "x":7.25, "y":1}, + {"label":"KB08", "x":8.25, "y":1}, + {"label":"KB09", "x":9.25, "y":1}, + {"label":"KB11", "x":10.25, "y":1, "w":1.75}, + {"label":"KC00", "x":0, "y":2, "w":1.75}, + {"label":"KC02", "x":1.75, "y":2}, + {"label":"KC03", "x":2.75, "y":2}, + {"label":"KC04", "x":3.75, "y":2}, + {"label":"KC05", "x":4.75, "y":2}, + {"label":"KC06", "x":5.75, "y":2}, + {"label":"KC07", "x":6.75, "y":2}, + {"label":"KC08", "x":7.75, "y":2}, + {"label":"KC09", "x":8.75, "y":2}, + {"label":"KC10", "x":9.75, "y":2}, + {"label":"KC11", "x":10.75, "y":2, "w":1.25}, + {"label":"KD00", "x":0, "y":3, "w":1.25}, + {"label":"KD02", "x":1.25, "y":3, "w":1.25}, + {"label":"KD03", "x":2.5, "y":3, "w":1.25}, + {"label":"KD04", "x":3.75, "y":3, "w":2.25}, + {"label":"KD07", "x":6, "y":3, "w":2.25}, + {"label":"KD09", "x":8.25, "y":3, "w":1.25}, + {"label":"KD10", "x":9.5, "y":3}, + {"label":"KD11", "x":10.5, "y":3, "w":1.5} + ] + } + } +} diff --git a/keyboards/handwired/minorca/keymaps/default/config.h b/keyboards/handwired/minorca/keymaps/default/config.h index bf40376c19b..c19ad737241 100644 --- a/keyboards/handwired/minorca/keymaps/default/config.h +++ b/keyboards/handwired/minorca/keymaps/default/config.h @@ -1,12 +1,10 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +// place overrides here -#include "../../config.h" /* bootmagic salt key */ #define BOOTMAGIC_KEY_SALT KC_ESC /* skip bootmagic and eeconfig */ #define BOOTMAGIC_KEY_SKIP KC_SPACE - -#endif diff --git a/keyboards/handwired/minorca/keymaps/default/keymap.c b/keyboards/handwired/minorca/keymaps/default/keymap.c index 3392f25ef87..29ed7aa03f9 100644 --- a/keyboards/handwired/minorca/keymaps/default/keymap.c +++ b/keyboards/handwired/minorca/keymaps/default/keymap.c @@ -1,7 +1,4 @@ - -#include "minorca.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -10,33 +7,23 @@ extern keymap_config_t keymap_config; // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { /* Base */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT }, - {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, KC_FN1, KC_FN0 }, - {KC_NO, XXXXXXX, KC_NO, KC_LALT, KC_SPC, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_DOT, KC_SLSH, KC_NO } - }, - [1] = { /* First */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT }, - {KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX, KC_LGUI }, - {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_PGDN, KC_END, KC_L, KC_SCLN, KC_UP, KC_FN1, KC_FN0 }, - {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } - }, - [2] = { /* Second */ - {KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT }, - {KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, XXXXXXX, KC_ENT }, - {KC_CAPS, XXXXXXX, KC_LSFT, KC_RSFT, KC_PAUSE,KC_F10, KC_F11, KC_F12, KC_NO, KC_UP, KC_FN1, KC_FN0 }, - {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } - }, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to First overlay - [1] = ACTION_LAYER_MOMENTARY(2), // to Second overlay - -}; \ No newline at end of file + [0] = LAYOUT( /* Base */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, \ + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, MO(2), MO(1), \ + XXXXXXX, XXXXXXX, KC_LALT, KC_SPC, KC_SPC, KC_DOT, KC_SLSH, XXXXXXX \ + ), + [1] = LAYOUT( /* First */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_LGUI, \ + KC_LCTL, KC_Z, KC_X, KC_C, KC_PGDN, KC_END, KC_L, KC_SCLN, KC_UP, _______, _______, \ + XXXXXXX, XXXXXXX, KC_LALT, _______, _______, KC_DOWN, KC_RGHT, XXXXXXX \ + ), + [2] = LAYOUT( /* Second */ + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_ENT, \ + KC_CAPS, KC_LSFT, KC_RSFT, KC_PAUS, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_UP, _______, _______, \ + XXXXXXX, XXXXXXX, KC_LALT, _______, _______, KC_DOWN, KC_RGHT, XXXXXXX \ + ), +}; diff --git a/keyboards/handwired/minorca/keymaps/rgb/keymap.c b/keyboards/handwired/minorca/keymaps/rgb/keymap.c index e1ee49dce63..c99a255e404 100644 --- a/keyboards/handwired/minorca/keymaps/rgb/keymap.c +++ b/keyboards/handwired/minorca/keymaps/rgb/keymap.c @@ -1,7 +1,4 @@ - -#include "minorca.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -14,50 +11,34 @@ extern keymap_config_t keymap_config; #define _RAISE 2 #define _TB 3 -// Macro name shortcuts -#define QWERTY M(_QWERTY) -#define LOWER M(_LOWER) -#define RAISE M(_RAISE) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = { /* Qwerty */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {FUNC(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_QUOT}, - {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, FUNC(1)}, - {KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, FUNC(2), XXXXXXX, XXXXXXX, FUNC(3), XXXXXXX, KC_RALT, KC_APP, KC_RCTL} -}, - -[_RAISE] = { - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), XXXXXXX, S(KC_BSLS)}, - {KC_TRNS, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_ENT}, - {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_MNXT, KC_MUTE, KC_MPLY} -}, - -[_LOWER] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, XXXXXXX, KC_BSLS}, - {KC_TRNS, XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_PGUP, KC_ENT}, - {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_HOME, KC_PGDN, KC_END} -}, - -[_TB] = { /* Tab */ - {KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, KC_TRNS}, - {KC_TRNS, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_UP, KC_ENT}, - {BL_STEP, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT} -} -}; - + [_QWERTY] = LAYOUT( /* Qwerty */ \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + LT(_TB, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MT(MOD_RSFT, KC_ENT), \ + KC_LCTL, KC_LGUI, KC_LALT, LT(_RAISE, KC_SPC), LT(_LOWER, KC_SPC), KC_RALT, KC_APP, KC_RCTL \ + ), + + [_RAISE] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + _______, _______, _______, KC_PAUS, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_PIPE, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_ENT, \ + _______, _______, _______, _______, _______, KC_MNXT, KC_MUTE, KC_MPLY \ + ), + + [_LOWER] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_BSLS, \ + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_PGUP, KC_ENT, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), + + [_TB] = LAYOUT( /* Tab */ \ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_UP, KC_ENT, \ + BL_STEP, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT \ + ) -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(_TB, KC_TAB), - [1] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), - [2] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), - [3] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), }; diff --git a/keyboards/handwired/minorca/minorca.h b/keyboards/handwired/minorca/minorca.h index 158e5b4c55b..2df4ebdc4f7 100644 --- a/keyboards/handwired/minorca/minorca.h +++ b/keyboards/handwired/minorca/minorca.h @@ -3,4 +3,16 @@ #include "quantum.h" +#define LAYOUT( \ + KA00, KA01, KA02, KA03, KA04, KA05, KA06, KA07, KA08, KA09, KA10, KA11, \ + KB00, KB01, KB02, KB03, KB04, KB05, KB06, KB07, KB08, KB09, KB11, \ + KC00, KC02, KC03, KC04, KC05, KC06, KC07, KC08, KC09, KC10, KC11, \ + KD00, KD02, KD03, KD04, KD07, KD09, KD10, KD11 \ +) { \ + { KA00, KA01, KA02, KA03, KA04, KA05, KA06, KA07, KA08, KA09, KA10, KA11 }, \ + { KB00, KB01, KB02, KB03, KB04, KB05, KB06, KB07, KB08, KB09, KC_NO, KB11 }, \ + { KC00, KC_NO, KC02, KC03, KC04, KC05, KC06, KC07, KC08, KC09, KC10, KC11 }, \ + { KD00, KC_NO, KD02, KD03, KD04, KC_NO, KC_NO, KD07, KC_NO, KD09, KD10, KD11 } \ +} + #endif diff --git a/keyboards/handwired/minorca/readme.md b/keyboards/handwired/minorca/readme.md index 0253506e09a..c910459603f 100644 --- a/keyboards/handwired/minorca/readme.md +++ b/keyboards/handwired/minorca/readme.md @@ -1,33 +1,13 @@ -minorca keyboard firmware -====================== -Handwired 40% keyboard +# minorca -http://www.panc.co/blog/minorcasebright-information-page +A handwired 40% keyboard by panc.co. -## Quantum MK Firmware +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: panc.co minorca +Hardware Availability: [panc.co](https://www.panc.co/blog/minorcasebright-information-page) -For the full Quantum feature list, see [the parent readme.md](/readme.md). +Make example for this keyboard (after setting up your build environment): -## Building + make handwired/minorca:default -Download or clone the whole firmware and navigate to the keyboards/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default -To build with the default keymap, simply run `make`. - -### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: -``` -$ make KEYMAP=[default|jack|] -``` -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. - -### Notable forks (which some of the keymap files are from) -- [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) -- [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) -- [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) -- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck) +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/minorca/rules.mk b/keyboards/handwired/minorca/rules.mk index 3e408e2b936..3e8d8285614 100644 --- a/keyboards/handwired/minorca/rules.mk +++ b/keyboards/handwired/minorca/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -64,4 +63,4 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.c b/keyboards/handwired/ms_sculpt_mobile/babblePaste.c new file mode 100644 index 00000000000..e0356487061 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/babblePaste.c @@ -0,0 +1,460 @@ +/* A library to output the right key shortcut in any common app. +Given a global variable babble_mode to show the environment and a +key that calls the paste macro, do the right type of paste. +Setting the context is done by another macro, or TBD interaction with the host. + +Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c +*/ + +#include "babblePaste.h" + +#include "action_macro.h" + +#ifdef USE_BABLPASTE + +// GLOBAL variable to determine mode. Sets startup default if no eeppom +uint8_t babble_mode =0 ; + +// small function that we might also want to call from a keymap. + +macro_t* switch_babble_mode( uint8_t id) { + babble_mode= id; + return MACRO_NONE; //less typing where called +} + + +// Today I learned that the preprocessor can not create a switch statement label from an argument +// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 +#define BABLM(ent, macro...) \ + if ( ent == shortcut ) \ + { action_macro_play( MACRO(macro)); return MACRO_NONE; } + + +/* this function runs the appropriate babblepaste macro, given +the global babble_mode, and a shortcut from the ENUM in babblePaste.h +TODO, the pointers in this function should be stored in a PROGMEM array, not ram. +But that requires even more clever preprocessor foo. +*/ +const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) { +/* + if ( shortcut < BABL_START_NUM || \ + shortcut >= (BABL_START_NUM + BABL_NUM_MACROS ) ) { + return MACRO_NONE; + } +*/ + + +#ifdef MS_MODE + if ( BABL_WINDOWS == shortcut ) { return switch_babble_mode(MS_MODE); } +#endif +#ifdef MAC_MODE + if ( BABL_MAC == shortcut) { return switch_babble_mode(MAC_MODE); } +#endif +#ifdef LINUX_MODE + if ( BABL_LINUX == shortcut ) { return switch_babble_mode(LINUX_MODE); } +#endif + #ifdef READMUX_MODE + if ( BABL_READLINE == shortcut ) { switch_babble_mode(READMUX_MODE); return MACRO_NONE; } +#endif +#ifdef VI_MODE + if ( BABL_VI == shortcut ) { return switch_babble_mode(VI_MODE); } +#endif +#ifdef EMACS_MODE + if ( BABL_EMACS == shortcut ) { return switch_babble_mode(EMACS_MODE); } +#endif + + + + switch(babble_mode) { + +#ifdef MS_MODE + + case MS_MODE: + BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD, D(LCTL), T(LEFT), U(LCTL), END ); + BABLM( BABL_GO_RIGHT_WORD, D(LCTL), T(RIGHT), U(LCTL), END ); + BABLM( BABL_GO_START_LINE, T(HOME), END ); + BABLM( BABL_GO_END_LINE, T(END), END ); + BABLM( BABL_GO_START_DOC, D(LCTL),T(HOME), U(LCTL),END ); + BABLM( BABL_GO_END_DOC, D(LCTL),T(END), U(LCTL),END ); + BABLM( BABL_GO_NEXT_LINE, T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE, T(UP), END ); + BABLM( BABL_PGDN, T(PGDN), END ); + BABLM( BABL_PGUP, T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C, T(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD, D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD, D(LCTL), T(DEL), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); + BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO, D(LCTL), T(Z), U(LCTL), END ); + BABLM( BABL_REDO, D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_CUT, D(LCTL), T(X), U(LCTL), END ); + BABLM( BABL_COPY, D(LCTL), T(C), U(LCTL), END ); + BABLM( BABL_PASTE, D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); + BABLM( BABL_FIND_NEXT, T(F3),END ); + BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); + BABLM( BABL_RUNAPP, D(LGUI),T(R), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_NEXT, D(LALT),T(TAB), U(LALT),END ); + BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LALT),T(TAB), U(LALT), U(LSFT),END ); + BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); + BABLM( BABL_HELP, T(F1),END ); +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); + BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); + BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); + BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LCTL),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), D(RSFT), T(EQL), U(RSFT), U(LCTL),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); +#endif +#endif + + // Todo, ring bell, flash light, show user this isn't supported + return MACRO_NONE; + + +#endif /* MS_MODE*/ + + +#ifdef LINUX_MODE + + case LINUX_MODE: + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LCTL), T(LEFT), U(LCTL), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LCTL), T(RIGHT), U(LCTL), END ); + BABLM( BABL_GO_START_LINE , T(HOME), END ); + BABLM( BABL_GO_END_LINE , T(END), END ); + BABLM( BABL_GO_START_DOC , D(LCTL),T(HOME), U(LCTL),END ); + BABLM( BABL_GO_END_DOC , D(LCTL),T(END), U(LCTL),END ); + BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE , T(UP), END ); + BABLM( BABL_PGDN , T(PGDN), END ); + BABLM( BABL_PGUP , T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LCTL), T(DEL), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); + BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LCTL), T(Z), U(LCTL), END ); + BABLM( BABL_REDO , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_CUT , D(LCTL), T(X), U(LCTL), END ); + BABLM( BABL_COPY , D(LCTL), T(C), U(LCTL), END ); + BABLM( BABL_PASTE , D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); + /* BABLM(BABL_FIND_NEXT , T(F3),END ); KDE */ + BABLM( BABL_FIND_NEXT, D(LCTL),T(G), U(LCTL),END ); // Gnome*/ + /* BABLM( , D(LCTL),T(R), U(LCTL),END ); KDE */ + BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); // Gnome*/ + BABLM( BABL_RUNAPP, D(LALT),T(F2), U(LALT),END ); + BABLM( BABL_SWITCH_APP_NEXT, D(LCTL),T(TAB), U(LCTL),END ); + BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LCTL),T(TAB), U(LCTL), U(LSFT),END ); + BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); + //BABLM( BABL_HELP, END ); + +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); + BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); + BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); + BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), T(PLUS), U(LCTL),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); +#endif +#endif + return MACRO_NONE; + +#endif + +#ifdef MAC_MODE + + case MAC_MODE: + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LALT), T(LEFT), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(RIGHT), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LGUI), T(LEFT), U(LGUI), END ); + BABLM( BABL_GO_END_LINE , D(LGUI), T(RIGHT), U(LGUI), END ); + BABLM( BABL_GO_START_DOC , D(LGUI),T(UP), U(LGUI),END ); + BABLM( BABL_GO_END_DOC , D(LGUI),T(DOWN), U(LGUI),END ); + BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE , T(UP), END ); + BABLM( BABL_PGDN , D(LALT),T(DOWN), U(LALT), END ); + BABLM( BABL_PGUP , D(LALT),T(UP), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD , D(LALT), T(BSPACE), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_WORD, D(LALT), T(DEL), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END );// there must be another way + BABLM( BABL_DEL_TO_LINE_START, D(LGUI), T(BSPACE), U(LGUI), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(1), D(LGUI), T(Z), U(LGUI), END ); + BABLM( BABL_REDO , D(LSFT),D(LGUI), T(Z), U(LSFT),U(LGUI), END ); + BABLM( BABL_CUT , D(LGUI), T(X), U(LGUI), END ); + BABLM( BABL_COPY , D(LGUI), T(C), U(LGUI), END ); + BABLM( BABL_PASTE , D(LGUI), T(V), U(LGUI), END ); + BABLM( BABL_SELECT_ALL , D(LGUI), T(A), U(LGUI), END ); + BABLM( BABL_FIND , D(LGUI),T(F), U(LGUI),END ); + BABLM( BABL_FIND_NEXT, D(LGUI),T(G), U(LGUI),END ); + BABLM( BABL_FIND_REPLACE, D(LGUI),T(F), U(LGUI),END ); + BABLM( BABL_RUNAPP , D(LGUI),T(R), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_NEXT , D(LGUI),T(TAB), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_LAST , D(LSFT),D(LGUI),T(TAB), U(LGUI), U(LSFT),END ); + BABLM( BABL_CLOSE_APP , D(LGUI),T(Q), U(LGUI),END ); + BABLM( BABL_HELP , D(LSFT),D(LGUI),T(SLASH), U(LGUI), U(LSFT),END ); + +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +#endif +#endif + + return MACRO_NONE; +#endif + +#ifdef EMACS_MODE + + case EMACS_MODE: + switch(shortcut) { +//probably should allow meta to not be ALT + + BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD, D(LALT), T(B), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); + BABLM( BABL_GO_START_DOC , D(LALT), D(LSFT), T(COMM),U(LSFT), U(LALT) ,END ); + BABLM( BABL_GO_END_DOC , D(LALT), D(LSFT), T(DOT), U(LSFT), U(LALT) ,END ); + BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); + BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); + BABLM( BABL_PGDN , D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_PGUP , D(LALT), T(V), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_1C, D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_START, T(ESC), T(0), D(LCTL), T(K), U(LCTL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LCTL), T(X), U(LCTL),T(C), END ); + BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably + BABLM( BABL_CUT , D(LCTL), T(W), U(LCTL), END ); + BABLM( BABL_COPY , D(LALT), T(W), U(LALT), END ); //really? + BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_SELECT_ALL ,D(LCTL), T(X), U(LCTL),T(H), END ); + BABLM( BABL_FIND , D(LCTL), T(S), U(LCTL),END ); + BABLM( BABL_FIND_NEXT , D(LCTL), T(S), U(LCTL),END ); + BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); + BABLM( BABL_RUNAPP , D(LALT), T(X), U(LALT),T(S),T(H),T(E),T(L),T(L),END );// arguably + BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(X), U(LCTL),T(RIGHT), END ); // arguably + BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(X), U(LCTL),T(LEFT), END ); // arguably + BABLM( BABL_CLOSE_APP , D(LCTL), T(X), U(LCTL),T(C),END ); + BABLM( BABL_HELP , D(LCTL),T(H), U(LCTL),T(A),END); // start search in help +#ifndef BABL_NOBROWSER +/* you get to figure w3 out + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + break; + + return MACRO_NONE; + } + +#endif + + +#ifdef VI_MODE + case VI_MODE: +// you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) + + + BABLM( BABL_GO_LEFT_1C , T(H), END ); + BABLM( BABL_GO_RIGHT_1C , T(L), END ); + BABLM( BABL_GO_LEFT_WORD , T(B),END ); + BABLM( BABL_GO_RIGHT_WORD , T(W), END ); + BABLM( BABL_GO_START_LINE , D(LSFT), T(6),U(LSFT), END ); //^ + BABLM( BABL_GO_END_LINE , D(LSFT), T(4),U(LSFT) , END ); //$ + BABLM( BABL_GO_START_DOC , T(G),T(G) ,END ); + BABLM( BABL_GO_END_DOC , D(LSFT), T(G),U(LSFT),END ); + BABLM( BABL_GO_NEXT_LINE , T(J), END ); + BABLM( BABL_GO_PREV_LINE, T(K), END ); + BABLM( BABL_PGDN ,D(LCTL), T(F), U(LCTL), END ); + BABLM( BABL_PGUP , D(LCTL), T(B), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_1C , T(X),END ); + BABLM( BABL_DEL_LEFT_WORD , T(D),T(G),T(E),END ); + BABLM( BABL_DEL_RIGHT_WORD , T(D),T(W),END ); + BABLM( BABL_DEL_TO_LINE_END, T(D),D(LSFT), T(4),U(LSFT) ,END ); // d$ + BABLM( BABL_DEL_TO_LINE_START, T(D),D(LSFT), T(6),U(LSFT) ,END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , T(U), END ); + BABLM( BABL_REDO , D(LCTL), T(R), U(LCTL), END ); + BABLM( BABL_CUT , T(X), END ); + BABLM( BABL_COPY , T(Y),END ); + BABLM( BABL_PASTE , T(P), END ); + BABLM( BABL_SELECT_ALL , D(LSFT), T(SCLN),U(LSFT),D(LSFT), T(5),U(LSFT),T(Y), END ); // wrong but helpful? + BABLM( BABL_FIND , T(SLASH),END ); + BABLM( BABL_FIND_NEXT , T(N),END ); + BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); + BABLM( BABL_RUNAPP,END ); + BABLM( BABL_SWITCH_APP_NEXT ,END ); + BABLM( BABL_SWITCH_APP_LAST ,END ); + BABLM(BABL_CLOSE_APP, D(LSFT), T(SCLN),U(LSFT), T(Q), D(RSFT), T(1),U(RSFT), END ); + BABLM(BABL_HELP, D(LSFT), T(SCLN),U(LSFT),T(H),END); // start search in help +#ifndef BABL_NOBROWSER +/* you get to figure this out + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + return MACRO_NONE; +#endif + + + + +#ifdef READMUX_MODE +// Readline command line editing + tmux windowing +// I havent decided how much to do readline and how much tmux + + + case READMUX_MODE: + + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LALT), T(B), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); + //BABLM( BABL_GO_START_DOC ,END );// tmux? + //BABLM( BABL_GO_END_DOC ,END ); // tmux? + BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); + BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); + BABLM( BABL_PGDN , T(PGDN), END ); + BABLM( BABL_PGUP , T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C , D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(W), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_START, D(LCTL), T(U), U(LCTL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LALT), T(R), U(LALT) , END ); + BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably + BABLM( BABL_CUT , D(LCTL), T(K), U(LCTL), END ); // wrong half the time + //BABLM( BABL_COPY ,END ); + BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_SELECT_ALL , D(LCTL), T(A), T(K), T(Y), U(LCTL) , END ); + BABLM( BABL_FIND , D(LCTL), T(R), U(LCTL), END ); // search history + BABLM(BABL_FIND_NEXT, D(LCTL), T(S), U(LCTL), END ); + //BABLM( BABL_FIND_REPLACE ,END ); + BABLM( BABL_RUNAPP , D(LCTL), T(B), U(LCTL), T(C),END ); //tmux + BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(B), U(LCTL), T(N),END ); //tmux + BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(B), U(LCTL), T(P),END ); //tmux + BABLM( BABL_CLOSE_APP , D(LCTL), T(B), U(LCTL), T(D),END); // usually what I want + // BABLM( BABL_HELP ,END ); +#ifndef BABL_NOBROWSER +/* Add lynx shortcuts? + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + + return MACRO_NONE; + +#endif + + default: + return MACRO_NONE; + } + +} + + +#endif diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.h b/keyboards/handwired/ms_sculpt_mobile/babblePaste.h new file mode 100644 index 00000000000..1e8206212a1 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/babblePaste.h @@ -0,0 +1,238 @@ +/* A library to output the right key shortcut in any common app. +Given a global variable babble_mode to show the environment and a +key that calls the paste macro, do the right type of paste. + +Setting the bable_mode is done by another macro, or TBD interaction with the host. + +Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and jeebak & algernon's keymap +*/ +#ifndef _babblePaste_h_included__ +#define _babblePaste_h_included__ +#include "config.h" +#include "action_layer.h" +#include "quantum_keycodes.h" + +#ifdef USE_BABLPASTE + +/* *************************** + +// Uncomment any modes you want. Whatever mode = 0 will be the default on boot +// Expect to get errors if you comment a feature out and leave it in your keymap. + +#define USE_BABLPASTE + +//#define MS_MODE 0 // Windows. +//#define MAC_MODE 1 +//#define LINUX_MODE 2 //aka gnome+KDE +//#define EMACS_MODE 3 +//#define VI_MODE 4 +//#define WORDSTAR_MODE 5 +//#define READMUX 6 // Readline and tmux + +// This removes everything but cursor movement +//#define BABL_MOVEMENTONLY +// and this just removes browser shortcuts +//#define BABL_NOBROWSER +****************************/ + + +// Uncomment if you need more free flash space +// It removes everything but cursor movement +//#define BABL_MOVEMENTONLY + + +// Define starting number for BABL macros in the macro range. +// Probably can start the default even lower +#define BABL_START_NUM 50 + +/* Macros handled by babblepaste. Most should be available for all platforms. +Whatever isn't defined will NOP */ +enum { +// Movement macros + // left & right + BABL_GO_LEFT_1C= BABL_START_NUM, + BABL_GO_RIGHT_1C, + BABL_GO_LEFT_WORD, + BABL_GO_RIGHT_WORD, + BABL_GO_START_LINE, + BABL_GO_END_LINE, + // now up & down + BABL_GO_START_DOC, + BABL_GO_END_DOC, + BABL_GO_NEXT_LINE, + BABL_GO_PREV_LINE, + BABL_PGDN, + BABL_PGUP, + // And the delete options + //BABL_DEL_LEFT_1C == backspace, so why bother. + BABL_DEL_RIGHT_1C, // usually = Del + BABL_DEL_LEFT_WORD, + BABL_DEL_RIGHT_WORD, + BABL_DEL_TO_LINE_END, // delete from cursor to end of line + BABL_DEL_TO_LINE_START, // delete from cursor to begining line +#ifndef BABL_MOVEMENTONLY + // Cut & Paste + BABL_UNDO, + BABL_REDO, + BABL_CUT, + BABL_COPY, + BABL_PASTE, + BABL_SELECT_ALL, + /* not yet implemented + BABL_SWAP_LAST2C // swap last characters before the cursor + BABL_SWAP_LAST2W // Swap the last two words before the cursor + */ + // find & replace + BABL_FIND, + BABL_FIND_NEXT, + BABL_FIND_REPLACE, + // GUI or app + BABL_RUNAPP, + BABL_SWITCH_APP_NEXT, + BABL_SWITCH_APP_LAST, // previous + BABL_CLOSE_APP, + BABL_HELP, + +#ifndef BABL_NOBROWSER + BABL_BROWSER_NEW_TAB, + BABL_BROWSER_CLOSE_TAB, + BABL_BROWSER_REOPEN_LAST_TAB, + BABL_BROWSER_NEXT_TAB, + BABL_BROWSER_PREV_TAB, + BABL_BROWSER_URL_BAR, + BABL_BROWSER_FORWARD, + BABL_BROWSER_BACK, + BABL_BROWSER_FIND, + BABL_BROWSER_BOOKMARK, + BABL_BROWSER_DEV_TOOLS, // hard one to remember + BABL_BROWSER_RELOAD, + BABL_BROWSER_FULLSCREEN, + BABL_BROWSER_ZOOM_IN, + BABL_BROWSER_ZOOM_OUT, + +#endif + +#endif +// Macros for mode switching +#ifdef MS_MODE + BABL_WINDOWS, +#endif +#ifdef MAC_MODE + BABL_MAC, +#endif +#ifdef LINUX_MODE + BABL_LINUX, +#endif +#ifdef EMACS_MODE + BABL_EMACS, +#endif +#ifdef VI_MODE + BABL_VI, +#endif +#ifdef READMUX_MODE + BABL_READLINE, +#endif + + +}; + +// BUG, used to jump to babble functiion. Surely there is a way to calculate size of enum? +#define BABL_NUM_MACROS 48+4 // 48 + # of defined modes. + +/* And all the shorthand keymap ready versions */ +// First the mode switching macros +#ifdef MS_MODE +#define B_WIN M(BABL_WINDOWS) +#endif +#ifdef MAC_MODE +#define B_MAC M(BABL_MAC) +#endif +#ifdef LINUX_MODE +#define B_LNX M(BABL_LINUX) +#endif +#ifdef EMACS_MODE +#define B_EMAX M(BABL_EMACS) +#endif +#ifdef VI_MODE +#define B_VI M(BABL_VI) +#endif +#ifdef READMUX_MODE +#define B_READ M(BABL_READLINE) +#endif + +// and all the movement & action. + +#define B_L1C M(BABL_GO_LEFT_1C) +#define B_R1C M(BABL_GO_RIGHT_1C) +#define B_L1W M(BABL_GO_LEFT_WORD) +#define B_R1W M(BABL_GO_RIGHT_WORD) +#define B_GSOL M(BABL_GO_START_LINE) +#define B_GEOL M(BABL_GO_END_LINE) +#define B_GTOP M(BABL_GO_START_DOC) +#define B_GEND M(BABL_GO_END_DOC) +#define B_DOWN M(BABL_GO_NEXT_LINE) +#define B_UP M(BABL_GO_PREV_LINE) +#define B_PGDN M(BABL_PGDN) +#define B_PGUP M(BABL_PGUP) +//#define B_BKSP M(BABL_DEL_LEFT_1C) == backspace so why bother. +#define B_DEL M(BABL_DEL_RIGHT_1C) // usually = Del +#define B_DLW M(BABL_DEL_LEFT_WORD) +#define B_DRW M(BABL_DEL_RIGHT_WORD) +#define B_DEOL M(BABL_DEL_TO_LINE_END) // delete from cursor to end of line +#define B_DSOL M(BABL_DEL_TO_LINE_START) // delete from cursor to begining line +#define B_UNDO M(BABL_UNDO) +#define B_REDO M(BABL_REDO) +#define B_CUT M(BABL_CUT) +#define B_COPY M(BABL_COPY) +#define B_PAST M(BABL_PASTE) +#define B_SELA M(BABL_SELECT_ALL) +#define B_FIND M(BABL_FIND) +#define B_FINDN M(BABL_FIND_NEXT) +#define B_FINDR M(BABL_FIND_REPLACE) +#define B_RAPP M(BABL_RUNAPP) +#define B_NAPP M(BABL_SWITCH_APP_NEXT) +#define B_PAPP M(BABL_SWITCH_APP_LAST) // previous +#define B_CAPP M(BABL_CLOSE_APP) +#define B_HELP M(BABL_HELP) +#define B_NTAB M(BABL_BROWSER_NEW_TAB) +#define B_CTAB M(BABL_BROWSER_CLOSE_TAB) +#define B_ROTB M(BABL_BROWSER_REOPEN_LAST_TAB) +#define B_NXTB M(BABL_BROWSER_NEXT_TAB) +#define B_PTAB M(BABL_BROWSER_PREV_TAB) +#define B_NURL M(BABL_BROWSER_URL_BAR) +#define B_BFWD M(BABL_BROWSER_FORWARD) +#define B_BBAK M(BABL_BROWSER_BACK) +#define B_BFND M(BABL_BROWSER_FIND) +#define B_BOOK M(BABL_BROWSER_BOOKMARK) +#define B_BDEV M(BABL_BROWSER_DEV_TOOLS) // hard one to remember +#define B_BRLD M(BABL_BROWSER_RELOAD) +#define B_BFUlL M(BABL_BROWSER_FULLSCREEN) +#define B_ZMIN M(BABL_BROWSER_ZOOM_IN) +#define B_ZMOT M(BABL_BROWSER_ZOOM_OUT) + + + + + + + +/* from action_macro.h +typedef uint8_t macro_t; + +#define MACRO_NONE (macro_t*)0 +#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; }) +#define MACRO_GET(p) pgm_read_byte(p) + +#define BABL_MSTART (entry, os, macro...) ( const macro_t bablDict[entry][os] PROGMEM = { macro... }; ) + +*/ + +const macro_t *babblePaste(keyrecord_t *record, uint8_t shortcut); + +macro_t* switch_babble_mode( uint8_t id); + + +#endif +#endif + diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.txt b/keyboards/handwired/ms_sculpt_mobile/babblePaste.txt similarity index 100% rename from keyboards/handwired/MS_sculpt_mobile/babblePaste.txt rename to keyboards/handwired/ms_sculpt_mobile/babblePaste.txt diff --git a/keyboards/handwired/ms_sculpt_mobile/config.h b/keyboards/handwired/ms_sculpt_mobile/config.h new file mode 100644 index 00000000000..0b1d3e6b3b7 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/config.h @@ -0,0 +1,90 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Microsoftplus +#define DESCRIPTION 6000 + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 18 + +#ifdef ASTAR +#define PRODUCT sculpt mobile astar + /*0 1 2 3 4 5 6 7 8 */ +#define MATRIX_ROW_PINS {D7, C6, D4, D0, D1, D3, D2, E2} +/* A B C D E F G H I J K L M N O P Q R */ +#define MATRIX_COL_PINS {B4, B5, E6, B7, B6, D6, C7, F7, F6, F4,F5, F1,F0, D5, B0, B1, B2, B3} + +#else +#define PRODUCT sculpt mobile teensypp +/* 0 1 2 3 4 5 6 7 */ +#define MATRIX_ROW_PINS { F7,F6,F4,F5,F3,F2,F1,F0} +/* A B C D E F G H I J K L M N O P Q R */ +#define MATRIX_COL_PINS { B7, D0, D1, D2, D3, D4, D5, D6, D7, E0,E1,C1, C0, C3, C2, C5, C4,C7} +#define UNUSED_PINS { B6,B5,B4,B3,B2,B1,B0 } + +#endif + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/handwired/ms_sculpt_mobile/info.json b/keyboards/handwired/ms_sculpt_mobile/info.json new file mode 100644 index 00000000000..86d5fde2e3a --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/info.json @@ -0,0 +1,96 @@ +{ + "keyboard_name": "MS Sculpt Mobile", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PrtSc", "x":13, "y":0}, + {"label":"Home", "x":14, "y":0}, + {"label":"End", "x":15, "y":0}, + {"label":"`", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"-", "x":11, "y":1}, + {"label":"=", "x":12, "y":1}, + {"label":"Backspace", "x":13, "y":1, "w":2}, + {"label":"Del", "x":15, "y":1, "h":1.6}, + {"label":"Tab", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"[", "x":11.5, "y":2}, + {"label":"]", "x":12.5, "y":2}, + {"label":"\\", "x":13.5, "y":2, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":";", "x":10.75, "y":3}, + {"label":"'", "x":11.75, "y":3}, + {"label":"Enter", "x":12.75, "y":3, "w":2.25}, + {"label":"PgUp", "x":15, "y":2.6, "h":1.2}, + {"label":"LShift", "x":0, "y":4, "w":2.25}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":",", "x":9.25, "y":4}, + {"label":".", "x":10.25, "y":4}, + {"label":"/", "x":11.25, "y":4}, + {"label":"RShift", "x":12.25, "y":4, "w":1.75}, + {"label":"Up", "x":14, "y":4}, + {"label":"PgDn", "x":15, "y":3.8, "h":1.2}, + {"label":"LCtrl", "x":0, "y":5, "w":1.25}, + {"label":"LWin", "x":1.25, "y":5, "w":1.25}, + {"label":"LAlt", "x":2.5, "y":5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5, "w":5.5}, + {"label":"RAlt", "x":9.25, "y":5, "w":1.25}, + {"label":"Fn", "x":10.5, "y":5, "w":1.25}, + {"label":"RCtrl", "x":11.75, "y":5, "w":1.25}, + {"label":"Left", "x":13, "y":5}, + {"label":"Down", "x":14, "y":5}, + {"label":"Right", "x":15, "y":5} + ] + } + } +} diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/default/config.h b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/default/keymap.c b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/keymap.c new file mode 100644 index 00000000000..d4d0f33e9c8 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +* +* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|Mute| +* -------------------------------------------------------------------------------' +* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del | +* -------------------------------------------------------------------------- +* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | +* -------------------------------------------------------------------------------' +* | caps | a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space |Ralt | FN | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + + [0] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_VOLU, KC_MUTE, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, RSFT(KC_1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/default/readme.md b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/readme.md new file mode 100644 index 00000000000..91575f7cd52 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Microsoft Sculpt Mobile diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/rules.mk similarity index 100% rename from keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk rename to keyboards/handwired/ms_sculpt_mobile/keymaps/default/rules.mk diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/config.h b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/config.h new file mode 100644 index 00000000000..9d6be063e29 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/config.h @@ -0,0 +1,28 @@ +#pragma once + +#define USE_BABLPASTE + +// Expect to get errors if you comment a feature out and leave it in your keymap. + +#ifdef USE_BABLPASTE +//define BabblePaste maps +// Windows. +#define MAC_MODE 0 +#define MS_MODE 1 +//aka gnome+KDE +//#define LINUX_MODE 2 +//#define EMACS_MODE 3 +#define VI_MODE 3 +// Readline and tmux +#define READMUX_MODE 2 +//#define WORDSTAR_MODE 5 +#endif + +// Uncomment if you need more free flash space + +// This removes everything but cursor movement +//#define BABL_MOVEMENTONLY +// and this just removes browser shortcuts +//#define BABL_NOBROWSER + +// place overrides here diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/keymap.c b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/keymap.c new file mode 100644 index 00000000000..c5ed18797fb --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/keymap.c @@ -0,0 +1,266 @@ +#include "babblePaste.h" +#include QMK_KEYBOARD_H + +#define _QWR 0 +#define _CDH 2 +#define _SYM 3 +#define _MOV 4 +#define _TRAN 5 + + +enum layer_keycodes { +QWR, +CDH, +SYM, +MOV, +NUM, +TRAN +}; + + +// Shorter spacing +#define XXXX KC_NO +#define ____ KC_TRNS + +// Custom macros + +/* Fn Keys */ +#define TT_SYM MO(_SYM) +#define TT_MOV KC_FN2 +#define TT_NUM MO(_NUM) +#define SSFT ACTION_MODS_ONESHOT(MOD_LSFT) + +enum macro_keycodes { +DHPASTE=1, +VIBRK, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* QWERTY +* +* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| +* -------------------------------------------------------------------------------' +* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| +* --------------------------------------------------------------------------- +* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | +* -------------------------------------------------------------------------------' +* |Bak/Mov| a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[_QWR] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_VOLU, CDH,\ + KC_ESC, KC_1, KC_2, KC_3 ,KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_DEL,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,\ + TT_MOV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH,KC_RSFT, KC_UP, KC_PGDN,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_FN1, KC_RGUI,TT_SYM,KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT +), + +[_CDH] = LAYOUT(\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, QWR, \ + KC_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, ____, ____, ____,\ + TT_MOV, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_2,\ + KC_LSFT, KC_Z, KC_X, KC_C, M(DHPASTE), KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, ____, KC_1,\ + ____, ____, ____ , KC_FN1, ____, ____, ____, ____, ____, ____ + +), + + +/* SYM +* +* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| +* -------------------------------------------------------------------------------' +* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace|Del | +* -------------------------------------------------------------------------- +* | ESC: | ^ | { | } | @ | % | | [ | ( | ) | _ | [ | ] | \ | | +* -------------------------------------------------------------------------------' +* |Bak/Mov| ! | # | 0 | = | { | } | - | 1 | + | ] | ` | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft | ; | ~ | : | ~ | "|"| $ | * | | . | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[_SYM] = LAYOUT(\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + M(VIBRK), KC_CIRC, KC_LCBR, KC_RCBR,KC_AT, KC_PERC, ____, KC_LBRC,KC_LPRN,KC_RPRN,KC_UNDS, ____, ____, ____,\ + ____, KC_EXLM, KC_HASH, KC_0, KC_EQL, KC_LCBR, KC_RCBR,KC_MINS,KC_1, KC_PLUS,KC_RBRC, KC_GRV, ____, ____,\ + ____, KC_SCLN, KC_TILDE, KC_COLN, KC_TILDE, KC_PIPE, KC_DLR, KC_ASTR, ____, KC_DOT , KC_SLSH, ____, ____, ____,\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ +), +/* +* |ESC | MAC| Win|RdLn| VI | | | | | | | | | | | | +* -------------------------------------------------------------------------------' +* | | | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| +* --------------------------------------------------------------------------- +* | tab | | |Find| |pTab |DSOL|DelW| Up |DelW|DEOL| [ | ] | \ | | +* -------------------------------------------------------------------------------' +* |Bak/Mov| | | | |nTab |GSOL| <- | Dwn | -> | EOL | ' | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft |Undo| Cut|Copy|Pste| | | | | | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[_MOV] = LAYOUT(\ + ____, B_MAC,B_WIN,B_READ, B_VI, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, B_PAPP, B_NAPP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, B_UNDO, ____, B_BFND, ____, B_PTAB, B_DSOL, B_DLW, B_UP, B_DRW, B_DEOL, ____, ____, ____, \ + ____, B_SELA, B_BRLD, ____, ____, B_NXTB, B_GSOL, B_L1C, B_DOWN, B_R1C,B_GEOL, ____, ____, ____,\ + ____, B_UNDO,B_CUT, B_COPY, B_PAST, B_PAST, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ +), + +[_TRAN] = LAYOUT(\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ +) +}; + +const uint16_t PROGMEM fn_actions[] = { +[1] = ACTION_LAYER_TAP_KEY(_SYM,KC_SPACE), +[2] = ACTION_LAYER_TAP_KEY(_MOV,KC_BSPC) +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWR: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + layer_off(_CDH); + } + return false; + break; + + case CDH: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + layer_on(_CDH); + } + return false; + break; + + case SYM: + if (record->event.pressed) { + layer_on(_SYM); + } else { + layer_off(_SYM); + } + return false; + break; + + } + return true; + +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + +/* If id is in the range of BABL macros, call the babl function */ +/* Any clever remapping with modifiers should happen here e.g. shift bablkey does opposite*/ +#ifdef USE_BABLPASTE + + if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { + if (record->event.pressed) { // is there a case where this isn't desired? + + babblePaste ( record, id ); + return MACRO_NONE; + } + } +#endif + + + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + + /* Colemak mod-dh moves the D key to the qwerty V position + This hack makes apple-V_position do what I mean */ + case DHPASTE: + if(keyboard_report->mods & MOD_BIT(KC_LGUI) ) { + if (record->event.pressed) { + clear_keyboard_but_mods(); + register_code(KC_V); + } else { + unregister_code(KC_V); + } + } else { + if (record->event.pressed) { + register_code(KC_D); + } else { + unregister_code(KC_D); + } + } + break; + + case VIBRK: // vi esc: + if (record->event.pressed) { + return MACRO( T(ESC),D(LSFT),T(SCLN),U(LSFT), END ); + } + break; + + + + + default: + return MACRO_NONE; + } + + +return MACRO_NONE; +}; + + + + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { + +} + + +void led_set_user(uint8_t usb_led) { + +} + + + + + + diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/readme.md b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/readme.md new file mode 100644 index 00000000000..3cb1380d1cd --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/readme.md @@ -0,0 +1 @@ +# A more programmer oriented keymap for Microsoft Sculpt Mobile diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk similarity index 100% rename from keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk rename to keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk diff --git a/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.c b/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.c new file mode 100644 index 00000000000..53773e5d854 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.c @@ -0,0 +1 @@ +#include "ms_sculpt_mobile.h" diff --git a/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.h b/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.h new file mode 100644 index 00000000000..cfa07c92efa --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.h @@ -0,0 +1,48 @@ +#ifndef MICROSOFT_SCULPT_MOBILE_H +#define MICROSOFT_SCULPT_MOBILE_H + +#include "quantum.h" + + +#define LAYOUT( \ + k7Q, k6O, k6P, k6Q, k5O, k5P, k5Q, k7A, k7B, k7C, k7D, k7E, k7F, k1O, k1K, k1L, \ + k5A, k5K, k5L, k5M, k5N, k5H, k5I, k2A, k2B, k2C, k2D, k5B, k5C, k5J, k2E, \ + k6R, k6D, k6E, k6F, k7I, k7J, k4A, k4B, k4C, k4D, k3A, k3B, k3C, k3D, \ + k0J, k6A, k6B, k6C, k7H, k1A, k1B, k5D, k5E, k5F, k5G, k1C, k7P, k2G, \ + k2P, k7K, k7L, k7M, k7O, k0A, k0B, k0C, k0D, k0E, k0F, k2L, k6G, k1P,\ + k1Q, k4N, k3O,k6N, k3K, k0R, k1M, k6H, k6I, k6J \ +) \ +{ \ + {k0A, k0B, k0C, k0D, k0E, k0F, KC_NO, KC_NO, KC_NO, k0J, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, k0R},\ + {k1A, k1B, k1C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k1K, k1L, k1M, KC_NO, k1O, k1P, k1Q, KC_NO},\ + {k2A, k2B, k2C, k2D, k2E, KC_NO, k2G, KC_NO, KC_NO, KC_NO, KC_NO, k2L, KC_NO, KC_NO, KC_NO, k2P, KC_NO, KC_NO},\ + {k3A, k3B, k3C, k3D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k3K, KC_NO, KC_NO, KC_NO, k3O, KC_NO, KC_NO, KC_NO},\ + {k4A, k4B, k4C, k4D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k4N, KC_NO,KC_NO, KC_NO, KC_NO},\ + {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q, KC_NO },\ + {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6J, KC_NO, KC_NO, KC_NO, k6N, k6O, k6P, k6Q, k6R},\ + {k7A, k7B, k7C, k7D, k7E, k7F, KC_NO, k7H, k7I, k7J, k7K, k7L, k7M, KC_NO, k7O, k7P, k7Q, KC_NO},\ +} + + +#define MATRIX_TESTING_LAYOUT( \ + k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q,\ + k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q,\ + k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q,\ + k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q,\ + k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q,\ + k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q,\ + k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q,\ + k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q\ +) \ +{ \ + {k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q},\ + {k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q},\ + {k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q},\ + {k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q},\ + {k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q},\ + {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q},\ + {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q},\ + {k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q},\ +} + +#endif diff --git a/keyboards/handwired/ms_sculpt_mobile/readme.md b/keyboards/handwired/ms_sculpt_mobile/readme.md new file mode 100644 index 00000000000..98fd1f8d1aa --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/readme.md @@ -0,0 +1,55 @@ +# Microsoft Sculpt Mobile + +This is a way to take a Microsoft ergonomic bluetooth keyboard, and make it +into a hard-wired keyboard running QMK. + +The keyboard is known under several different names: +Mobile Bluetooth 5000, Mobile 6000, Sculpt mobile, and Asus rebranded. + +I had a stack of them, since they're cheap on ebay, travel well, and are just ergo enough. + +The ribbon cable is 1mm pitch, which is hard to hand solder. I bought a cheap set of +"pitch adapter" boards https://www.amazon.com/Double-Sided-0-4mm-1-0-Adapter-60mmx38mm/dp/B00OK42118 + +Cut the original ribbon cable sockets off the bluetooth board using a razor, they're hard to desolder. +They're also allow the cable to be inserted on top or bottom. + +If I was going to do it again, I'd make the MCU connection come out the top of the keyboard +and avoid the wires dangling out the bottom. + +As I was debugging the matrix, I started to get random failures. In desparation I tried a second MCU, +but had the same problems. It turns out that the ribbon cable connections can get worn. Shave a +half millimeter off the end of the ribbon cable & the errors go away. + +My method for discovering the matrix was to set up a LAYOUT macro that included all pins. +See MATRIX_TESTING_LAYOUT if you need it. Then set up a keymap that has all printable symbols +in the first 4 rows. test each key & record output. Then switch the printable symbols to the +bottom 4 rows & repeat. This was enough to show the matrix. + + +The full original keymap for the Sculpt is + +| | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | +|:-:|:--:|:--:|:--:|:---:|:---:|:---:|:----:|:----:|:----:|:-----:|:----:|:------:|:----:|:-----:|:----:|:------:|:----:|:---:| +| 0 | b | n | m | , | . | / | | | | Caps | | | | | | | | Fn | +| 1 | g | h | " | | | | | | | | Vol+ | Mute | RCtl | | Vol- | PgDn | LCtl | | +| 2 | 7 | 8 | 9 | 0 | Del | | PgUp | | | | | RShift | | | | LShift | | | +| 3 | p | [ | ] | \ | | | | | | | RAlt | | | | LAlt | | | | +| 4 | y | u | i | o | | | | | | | | | | LGUI | | | | | +| 5 | ~ | - | += | j | k | l | ; | 5 | 6 | Bksp | 1 | 2 | 3 | 4 | F4 | F5 | F6 | | +| 6 | a | s | d | q | w | e | Up | Left | Down | Right | | | | Space | F1 | F2 | F3 | Tab | +| 7 | F7 | F8 | F9 | F10 | F11 | F12 | | f | r | t | z | x | c | | v | Enter | Esc | | + +This works with 18 cols + 8 rows on a Teensy++, or ARM-based Teensy. + +The Astar mini has all pins exposed , so you can do 18x8 +If you want a speaker, LEDs, etc., you'll need to free up a pin. I recommend joining columns +R and L to the same pin. + +Building - add ASTAR=1 to the compile line or leave out for teensy2++ + +Make example for this keyboard (after setting up your build environment): + + make handwired/ms_sculpt_mobile:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/MS_sculpt_mobile/rules.mk b/keyboards/handwired/ms_sculpt_mobile/rules.mk similarity index 100% rename from keyboards/handwired/MS_sculpt_mobile/rules.mk rename to keyboards/handwired/ms_sculpt_mobile/rules.mk diff --git a/keyboards/handwired/nicekey/config.h b/keyboards/handwired/nicekey/config.h index 652711be849..4af56cc5289 100644 --- a/keyboards/handwired/nicekey/config.h +++ b/keyboards/handwired/nicekey/config.h @@ -47,13 +47,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/handwired/nicekey/keymaps/default/keymap.c b/keyboards/handwired/nicekey/keymaps/default/keymap.c index 57323771566..139ea6a3beb 100644 --- a/keyboards/handwired/nicekey/keymaps/default/keymap.c +++ b/keyboards/handwired/nicekey/keymaps/default/keymap.c @@ -71,5 +71,5 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - {{ RANDOM_STRING_MACRO }} + LAYOUT( RANDOM_STRING_MACRO ) }; diff --git a/keyboards/handwired/nicekey/nicekey.h b/keyboards/handwired/nicekey/nicekey.h index 7a4a4835e61..ee5bcfd6be6 100644 --- a/keyboards/handwired/nicekey/nicekey.h +++ b/keyboards/handwired/nicekey/nicekey.h @@ -1 +1,12 @@ -#include "quantum.h" \ No newline at end of file +#ifndef NICEKEY_H +#define NICEKEY_H + +#include "quantum.h" + +#define LAYOUT( \ + k00 \ + ) { \ + { k00 } \ +} + +#endif diff --git a/keyboards/handwired/nicekey/readme.md b/keyboards/handwired/nicekey/readme.md index a867e907e6f..e108b38dd1f 100644 --- a/keyboards/handwired/nicekey/readme.md +++ b/keyboards/handwired/nicekey/readme.md @@ -5,7 +5,7 @@ Custom handwired nicekey, a one key keyboard that writes random compliments. -Keyboard Maintainer: spydon +Keyboard Maintainer: [spydon](https://github.com/spydon) Hardware Supported: Custom handwired one key Hardware Availability: @@ -15,4 +15,4 @@ Make example for this keyboard (after setting up your build environment): make handwired/nicekey:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/not_so_minidox/config.h b/keyboards/handwired/not_so_minidox/config.h index 3c0af7bf76b..e92621af419 100644 --- a/keyboards/handwired/not_so_minidox/config.h +++ b/keyboards/handwired/not_so_minidox/config.h @@ -54,18 +54,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* disable debug print */ //#define NO_DEBUG @@ -79,6 +74,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - - #endif diff --git a/keyboards/handwired/not_so_minidox/info.json b/keyboards/handwired/not_so_minidox/info.json new file mode 100644 index 00000000000..9c286eb1f9b --- /dev/null +++ b/keyboards/handwired/not_so_minidox/info.json @@ -0,0 +1,63 @@ +{ + "keyboard_name": "Not So MiniDox", + "url": "", + "maintainer": "qmk", + "width": 14, + "height": 5.75, + "layouts": { + "LAYOUT": { + "key_count": 42, + "layout": [ + {"x":0, "y":0.375}, + {"x":1, "y":0.25}, + {"x":2, "y":0.125}, + {"x":3, "y":0}, + {"x":4, "y":0.125}, + {"x":5, "y":0.25}, + + {"x":8, "y":0.25}, + {"x":9, "y":0.125}, + {"x":10, "y":0}, + {"x":11, "y":0.125}, + {"x":12, "y":0.25}, + {"x":13, "y":0.375}, + + {"x":0, "y":1.375}, + {"x":1, "y":1.25}, + {"x":2, "y":1.125}, + {"x":3, "y":1}, + {"x":4, "y":1.125}, + {"x":5, "y":1.25}, + + {"x":8, "y":1.25}, + {"x":9, "y":1.125}, + {"x":10, "y":1}, + {"x":11, "y":1.125}, + {"x":12, "y":1.25}, + {"x":13, "y":1.375}, + + {"x":0, "y":2.375}, + {"x":1, "y":2.25}, + {"x":2, "y":2.125}, + {"x":3, "y":2}, + {"x":4, "y":2.125}, + {"x":5, "y":2.25}, + + {"x":8, "y":2.25}, + {"x":9, "y":2.125}, + {"x":10, "y":2}, + {"x":11, "y":2.125}, + {"x":12, "y":2.25}, + {"x":13, "y":2.375}, + + {"x":3.5, "y":4.75}, + {"x":4.5, "y":4.75}, + {"x":5.5, "y":3.75, "h":2}, + + {"x":7.5, "y":3.75, "h":2}, + {"x":8.5, "y":4.75}, + {"x":9.5, "y":4.75} + ] + } + } +} diff --git a/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c b/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c index 8ea36198a1c..9e89611631d 100644 --- a/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c +++ b/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c @@ -18,10 +18,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define KC_LOWR LOWER #define KC_RASE RAISE #define KC_RST RESET diff --git a/keyboards/handwired/not_so_minidox/readme.md b/keyboards/handwired/not_so_minidox/readme.md index 22d35587353..c791e6e3f9e 100644 --- a/keyboards/handwired/not_so_minidox/readme.md +++ b/keyboards/handwired/not_so_minidox/readme.md @@ -12,7 +12,7 @@ Make example for this keyboard (after setting up your build environment): make not_so_minidox/rev1:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Flashing ------- @@ -50,13 +50,13 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep" // or the equivalent in dfu-programmer ``` and similarly for right half ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-righthand.eep" // or the equivalent in dfu-programmer ``` diff --git a/keyboards/handwired/not_so_minidox/rules.mk b/keyboards/handwired/not_so_minidox/rules.mk index 833dd4b79e3..d8735651942 100644 --- a/keyboards/handwired/not_so_minidox/rules.mk +++ b/keyboards/handwired/not_so_minidox/rules.mk @@ -4,7 +4,6 @@ SRC += matrix.c \ serial.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/numbrero/config.h b/keyboards/handwired/numbrero/config.h new file mode 100644 index 00000000000..ac38e081459 --- /dev/null +++ b/keyboards/handwired/numbrero/config.h @@ -0,0 +1,46 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Flehrad +#define PRODUCT Numbrero +#define DESCRIPTION Pro Micro-powered Reversible L/H Numpad with Extra Macro Keys + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 5 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F6, B5, B4, E6, F7 } +#define MATRIX_COL_PINS { D1, D0, D4, F5, F4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 5 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/handwired/numbrero/info.json b/keyboards/handwired/numbrero/info.json new file mode 100644 index 00000000000..d2f7ebd031d --- /dev/null +++ b/keyboards/handwired/numbrero/info.json @@ -0,0 +1,62 @@ +{ + "keyboard_name": "Numbrero", + "url": "", + "maintainer": "Flehrad", + "width": 5, + "height": 5, + "layouts": { + "LAYOUT_numbrero_numpad": { + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K10", "x":0, "y":1, "h":1.5}, + {"label":"K11", "x":1, "y":1}, + {"label":"K12", "x":2, "y":1}, + {"label":"K13", "x":3, "y":1}, + {"label":"K20", "x":0, "y":2.5}, + {"label":"K21", "x":1, "y":2}, + {"label":"K22", "x":2, "y":2}, + {"label":"K23", "x":3, "y":2}, + {"label":"K14", "x":4, "y":1, "h":2}, + {"label":"K30", "x":0, "y":3.5, "h":1.5}, + {"label":"K31", "x":1, "y":3}, + {"label":"K32", "x":2, "y":3}, + {"label":"K33", "x":3, "y":3}, + {"label":"K41", "x":1, "y":4, "w":2}, + {"label":"K43", "x":3, "y":4}, + {"label":"K34", "x":4, "y":3, "h":2} + ] + }, + "LAYOUT_numbrero_ortho": { + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K10", "x":0, "y":1, "h":1.5}, + {"label":"K11", "x":1, "y":1}, + {"label":"K12", "x":2, "y":1}, + {"label":"K13", "x":3, "y":1}, + {"label":"K14", "x":4, "y":1}, + {"label":"K20", "x":0, "y":2.5}, + {"label":"K21", "x":1, "y":2}, + {"label":"K22", "x":2, "y":2}, + {"label":"K23", "x":3, "y":2}, + {"label":"K24", "x":4, "y":2}, + {"label":"K30", "x":0, "y":3.5, "h":1.5}, + {"label":"K31", "x":1, "y":3}, + {"label":"K32", "x":2, "y":3}, + {"label":"K33", "x":3, "y":3}, + {"label":"K34", "x":4, "y":3}, + {"label":"K41", "x":1, "y":4}, + {"label":"K42", "x":2, "y":4}, + {"label":"K43", "x":3, "y":4}, + {"label":"K44", "x":4, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/numbrero/keymaps/default/keymap.c b/keyboards/handwired/numbrero/keymaps/default/keymap.c new file mode 100644 index 00000000000..903ed8d88c5 --- /dev/null +++ b/keyboards/handwired/numbrero/keymaps/default/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_numbrero_numpad( + KC_TRNS, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TRNS, KC_P7, KC_P8, KC_P9, + KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_TRNS, KC_P1, KC_P2, KC_P3, + KC_P0, KC_PDOT, KC_PENT), + + LAYOUT_numbrero_ortho( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/handwired/numbrero/license b/keyboards/handwired/numbrero/license new file mode 100644 index 00000000000..b09cd7856d5 --- /dev/null +++ b/keyboards/handwired/numbrero/license @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/keyboards/handwired/numbrero/numbrero.c b/keyboards/handwired/numbrero/numbrero.c new file mode 100644 index 00000000000..d3ec36904a4 --- /dev/null +++ b/keyboards/handwired/numbrero/numbrero.c @@ -0,0 +1 @@ +#include "numbrero.h" diff --git a/keyboards/handwired/numbrero/numbrero.h b/keyboards/handwired/numbrero/numbrero.h new file mode 100644 index 00000000000..c72e6540788 --- /dev/null +++ b/keyboards/handwired/numbrero/numbrero.h @@ -0,0 +1,30 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_numbrero_numpad( \ + K00, K01, K02, K03, K04, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, K14, \ + K30, K31, K32, K33, \ + K41, K43, K34 \ +) { \ + { K00, K01, K02, K03, K04 }, \ + { K10, K11, K12, K13, K14 }, \ + { K20, K21, K22, K23, KC_NO }, \ + { K30, K31, K32, K33, K34 }, \ + { KC_NO, K41, KC_NO, K43, KC_NO } \ +} +#define LAYOUT_numbrero_ortho(\ + K00, K01, K02, K03, K04, \ + K10, K11, K12, K13, K14, \ + K20, K21, K22, K23, K24, \ + K30, K31, K32, K33, K34, \ + K41, K42, K43, K44 \ +){ \ + { K00, K01, K02, K03, K04 }, \ + { K10, K11, K12, K13, K14 }, \ + { K20, K21, K22, K23, K24 }, \ + { K30, K31, K32, K33, K34 }, \ + { KC_NO, K41, K42, K43, K44 } \ +} diff --git a/keyboards/handwired/numbrero/readme.md b/keyboards/handwired/numbrero/readme.md new file mode 100644 index 00000000000..931c601274f --- /dev/null +++ b/keyboards/handwired/numbrero/readme.md @@ -0,0 +1,13 @@ +# Numbrero + +A reversible numpad (left/right-handed) with extra macro keys. + +Keyboard Maintainer: [Flehrad](https://github.com/flehrad) +Hardware Supported: Numbrero PCB, Pro Micro +Hardware Availability: The Board Podcast Slack + +Make example for this keyboard (after setting up your build environment): + + make handwired/numbrero:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/numbrero/rules.mk b/keyboards/handwired/numbrero/rules.mk new file mode 100644 index 00000000000..bda6c866e21 --- /dev/null +++ b/keyboards/handwired/numbrero/rules.mk @@ -0,0 +1,59 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +#Bootloder +#Pro Micro = caterina +BOOTLOADER = caterina + +# Boot Section Size in *bytes* +#OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no diff --git a/keyboards/handwired/numpad20/config.h b/keyboards/handwired/numpad20/config.h index 847f2111f52..78d95965a74 100644 --- a/keyboards/handwired/numpad20/config.h +++ b/keyboards/handwired/numpad20/config.h @@ -53,9 +53,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/numpad20/info.json b/keyboards/handwired/numpad20/info.json new file mode 100644 index 00000000000..691acb31504 --- /dev/null +++ b/keyboards/handwired/numpad20/info.json @@ -0,0 +1,33 @@ +{ + "keyboard_name": "numpad20 handwired", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K10", "x":0, "y":1}, + {"label":"K11", "x":1, "y":1}, + {"label":"K12", "x":2, "y":1}, + {"label":"K13", "x":3, "y":1}, + {"label":"K20", "x":0, "y":2}, + {"label":"K21", "x":1, "y":2}, + {"label":"K22", "x":2, "y":2}, + {"label":"K23", "x":3, "y":2}, + {"label":"K30", "x":0, "y":3}, + {"label":"K31", "x":1, "y":3}, + {"label":"K32", "x":2, "y":3}, + {"label":"K33", "x":3, "y":3}, + {"label":"K40", "x":0, "y":4}, + {"label":"K41", "x":1, "y":4}, + {"label":"K42", "x":2, "y":4}, + {"label":"K43", "x":3, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/numpad20/keymaps/default/keymap.c b/keyboards/handwired/numpad20/keymaps/default/keymap.c index 65799bfee41..414b104afd0 100644 --- a/keyboards/handwired/numpad20/keymaps/default/keymap.c +++ b/keyboards/handwired/numpad20/keymaps/default/keymap.c @@ -1,16 +1,11 @@ -#include "numpad20.h" - -#define KC_ KC_TRNS +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - LEFT,RGHT, UP ,DOWN, \ - P7 , P8 , P9 ,PLUS, \ - P4 , P5 , P6 ,MINS, \ - P1 , P2 , P3 , ENT, \ - P0 ,DOT ,RGHT, TAB \ - ) -}; - -const uint16_t PROGMEM fn_actions[] = { + KC_LEFT, KC_RGHT, KC_UP, KC_DOWN, \ + KC_P7, KC_P8, KC_P9, KC_PLUS, \ + KC_P4, KC_P5, KC_P6, KC_MINS, \ + KC_P1, KC_P2, KC_P3, KC_ENT, \ + KC_P0, KC_DOT, KC_RGHT, KC_TAB \ + ) }; diff --git a/keyboards/handwired/numpad20/numpad20.h b/keyboards/handwired/numpad20/numpad20.h index a2aa8d16bac..c15aa9ac700 100644 --- a/keyboards/handwired/numpad20/numpad20.h +++ b/keyboards/handwired/numpad20/numpad20.h @@ -10,11 +10,11 @@ K30, K31, K32, K33, \ K40, K41, K42, K43 \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03 }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13 }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23 }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33 }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43 } \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 } \ } -#endif \ No newline at end of file +#endif diff --git a/keyboards/handwired/numpad20/readme.md b/keyboards/handwired/numpad20/readme.md index 29c832daf06..4e14fbb005b 100644 --- a/keyboards/handwired/numpad20/readme.md +++ b/keyboards/handwired/numpad20/readme.md @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make handwired/numpad20:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/handwired/onekey/bluepill/boards/GENERIC_STM32_F103/board.c b/keyboards/handwired/onekey/bluepill/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 00000000000..8c5a87f35f8 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/handwired/onekey/bluepill/boards/GENERIC_STM32_F103/board.h b/keyboards/handwired/onekey/bluepill/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 00000000000..9427adabf11 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/handwired/onekey/bluepill/boards/GENERIC_STM32_F103/board.mk b/keyboards/handwired/onekey/bluepill/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 00000000000..6b8b312fd9f --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/handwired/onekey/bluepill/bootloader_defs.h b/keyboards/handwired/onekey/bluepill/bootloader_defs.h new file mode 100644 index 00000000000..6b8fa9f727c --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +#define STM32_BOOTLOADER_ADDRESS 0x80000000 diff --git a/keyboards/handwired/onekey/bluepill/chconf.h b/keyboards/handwired/onekey/bluepill/chconf.h new file mode 100644 index 00000000000..bbd9b2da62d --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/onekey/bluepill/config.h b/keyboards/handwired/onekey/bluepill/config.h new file mode 100644 index 00000000000..3d88ee00e52 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/config.h @@ -0,0 +1,23 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +#define MATRIX_COL_PINS { B0 } +#define MATRIX_ROW_PINS { A7 } +#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/bluepill/halconf.h b/keyboards/handwired/onekey/bluepill/halconf.h new file mode 100644 index 00000000000..72879a575b9 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/handwired/onekey/bluepill/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/handwired/onekey/bluepill/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 00000000000..d0688ef6016 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/handwired/onekey/bluepill/mcuconf.h b/keyboards/handwired/onekey/bluepill/mcuconf.h new file mode 100644 index 00000000000..fced27289e0 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/mcuconf.h @@ -0,0 +1,209 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define STM32F103_MCUCONF + +/* + * STM32F103 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_RTCSEL STM32_RTCSEL_HSEDIV +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 6 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * RTC driver system settings. + */ +#define STM32_RTC_IRQ_PRIORITY 15 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/handwired/onekey/bluepill/readme.md b/keyboards/handwired/onekey/bluepill/readme.md new file mode 100644 index 00000000000..0bf1f5701c8 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/readme.md @@ -0,0 +1,3 @@ +# bluepill onekey + +To trigger keypress, short together pins *B0* and *A7*. diff --git a/keyboards/handwired/onekey/bluepill/rules.mk b/keyboards/handwired/onekey/bluepill/rules.mk new file mode 100644 index 00000000000..46274066dd6 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill/rules.mk @@ -0,0 +1,37 @@ +# GENERIC STM32F103C8T6 board - stm32duino bootloader +OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 +MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader +BOARD = GENERIC_STM32_F103 + +# OPT_DEFS = +# MCU_LDSCRIPT = STM32F103x8 +# BOARD = GENERIC_STM32_F103 + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 diff --git a/keyboards/handwired/onekey/config.h b/keyboards/handwired/onekey/config.h index c0a6b583921..6f7ec1289fa 100644 --- a/keyboards/handwired/onekey/config.h +++ b/keyboards/handwired/onekey/config.h @@ -15,14 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6464 +#define PRODUCT_ID 0x6465 #define DEVICE_VER 0x0001 #define MANUFACTURER none #define PRODUCT onekey @@ -32,10 +29,6 @@ along with this program. If not, see . #define MATRIX_ROWS 1 #define MATRIX_COLS 1 -#define MATRIX_COL_PINS { B0 } -#define MATRIX_ROW_PINS { D0 } -#define UNUSED_PINS - /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -47,13 +40,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -71,5 +57,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/handwired/onekey/elite_c/config.h b/keyboards/handwired/onekey/elite_c/config.h new file mode 100644 index 00000000000..fbcd630d790 --- /dev/null +++ b/keyboards/handwired/onekey/elite_c/config.h @@ -0,0 +1,23 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +#define MATRIX_COL_PINS { F4 } +#define MATRIX_ROW_PINS { F5 } +#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/elite_c/readme.md b/keyboards/handwired/onekey/elite_c/readme.md new file mode 100644 index 00000000000..28a0885bb3e --- /dev/null +++ b/keyboards/handwired/onekey/elite_c/readme.md @@ -0,0 +1,3 @@ +# Elite-C onekey + +To trigger keypress, short together pins *F4* and *F5* (marked on the PCB as *A3* and *A2*). diff --git a/keyboards/handwired/onekey/elite_c/rules.mk b/keyboards/handwired/onekey/elite_c/rules.mk new file mode 100644 index 00000000000..eb7c443951d --- /dev/null +++ b/keyboards/handwired/onekey/elite_c/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/handwired/onekey/keymaps/default/keymap.c b/keyboards/handwired/onekey/keymaps/default/keymap.c index 10c486718d5..dd64f9fa55b 100644 --- a/keyboards/handwired/onekey/keymaps/default/keymap.c +++ b/keyboards/handwired/onekey/keymaps/default/keymap.c @@ -1,5 +1,5 @@ -#include "onekey.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - {{ KC_A }} + LAYOUT( KC_A ) }; diff --git a/keyboards/handwired/onekey/onekey.h b/keyboards/handwired/onekey/onekey.h index 7a4a4835e61..2924ff3ff8d 100644 --- a/keyboards/handwired/onekey/onekey.h +++ b/keyboards/handwired/onekey/onekey.h @@ -1 +1,25 @@ -#include "quantum.h" \ No newline at end of file +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00 \ + ) { \ + { k00 } \ +} diff --git a/keyboards/handwired/onekey/promicro/config.h b/keyboards/handwired/onekey/promicro/config.h new file mode 100644 index 00000000000..fbcd630d790 --- /dev/null +++ b/keyboards/handwired/onekey/promicro/config.h @@ -0,0 +1,23 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +#define MATRIX_COL_PINS { F4 } +#define MATRIX_ROW_PINS { F5 } +#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/promicro/readme.md b/keyboards/handwired/onekey/promicro/readme.md new file mode 100644 index 00000000000..260eab83de5 --- /dev/null +++ b/keyboards/handwired/onekey/promicro/readme.md @@ -0,0 +1,3 @@ +# Pro Micro onekey + +To trigger keypress, short together pins *F4* and *F5* (marked on the PCB as *A3* and *A2*). diff --git a/keyboards/handwired/onekey/promicro/rules.mk b/keyboards/handwired/onekey/promicro/rules.mk new file mode 100644 index 00000000000..dc6f1962373 --- /dev/null +++ b/keyboards/handwired/onekey/promicro/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/handwired/onekey/proton_c/config.h b/keyboards/handwired/onekey/proton_c/config.h new file mode 100644 index 00000000000..f6bedcfe648 --- /dev/null +++ b/keyboards/handwired/onekey/proton_c/config.h @@ -0,0 +1,23 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +#define MATRIX_COL_PINS { A3 } +#define MATRIX_ROW_PINS { A2 } +#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/proton_c/readme.md b/keyboards/handwired/onekey/proton_c/readme.md new file mode 100644 index 00000000000..0feedbbd46a --- /dev/null +++ b/keyboards/handwired/onekey/proton_c/readme.md @@ -0,0 +1,3 @@ +# Proton C onekey + +To trigger keypress, short together pins *A3* and *A2*. diff --git a/keyboards/handwired/onekey/proton_c/rules.mk b/keyboards/handwired/onekey/proton_c/rules.mk new file mode 100644 index 00000000000..b17a3d0316b --- /dev/null +++ b/keyboards/handwired/onekey/proton_c/rules.mk @@ -0,0 +1,2 @@ +# MCU name +MCU = STM32F303 diff --git a/keyboards/handwired/onekey/readme.md b/keyboards/handwired/onekey/readme.md index c28e284f327..0e9d6a538aa 100644 --- a/keyboards/handwired/onekey/readme.md +++ b/keyboards/handwired/onekey/readme.md @@ -2,14 +2,14 @@ Custom handwired one key keyboard. -Keyboard Maintainer: -Hardware Supported: Custom handwired one key +Keyboard Maintainer: QMK Community +Hardware Supported: bluepill, Elite-C, Pro Micro, Proton C, Teensy 2.0, Teensy++ 2.0, Teensy LC, Teensy 3.2 Hardware Availability: -Switch must be connected to pins B0 and D0. +**See each individual board for pin infomation** Make example for this keyboard (after setting up your build environment): make handwired/onekey:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/onekey/rules.mk b/keyboards/handwired/onekey/rules.mk index cfa693a73b9..245f9025d77 100644 --- a/keyboards/handwired/onekey/rules.mk +++ b/keyboards/handwired/onekey/rules.mk @@ -1,61 +1,22 @@ - - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - # Build Options -# comment out to disable the options. +# change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA \ No newline at end of file +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +DEFAULT_FOLDER = handwired/onekey/promicro diff --git a/keyboards/handwired/onekey/teensy_2/config.h b/keyboards/handwired/onekey/teensy_2/config.h new file mode 100644 index 00000000000..fbcd630d790 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_2/config.h @@ -0,0 +1,23 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +#define MATRIX_COL_PINS { F4 } +#define MATRIX_ROW_PINS { F5 } +#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/teensy_2/readme.md b/keyboards/handwired/onekey/teensy_2/readme.md new file mode 100644 index 00000000000..86a3114e56a --- /dev/null +++ b/keyboards/handwired/onekey/teensy_2/readme.md @@ -0,0 +1,3 @@ +# Teensy 2.0 onekey + +To trigger keypress, short together pins *F4* and *F5* diff --git a/keyboards/handwired/onekey/teensy_2/rules.mk b/keyboards/handwired/onekey/teensy_2/rules.mk new file mode 100644 index 00000000000..3fb7c7e5a7e --- /dev/null +++ b/keyboards/handwired/onekey/teensy_2/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/handwired/onekey/teensy_2pp/config.h b/keyboards/handwired/onekey/teensy_2pp/config.h new file mode 100644 index 00000000000..9d993980c25 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_2pp/config.h @@ -0,0 +1,23 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +#define MATRIX_COL_PINS { B2 } +#define MATRIX_ROW_PINS { B1 } +#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/teensy_2pp/readme.md b/keyboards/handwired/onekey/teensy_2pp/readme.md new file mode 100644 index 00000000000..9cb99e11815 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_2pp/readme.md @@ -0,0 +1,3 @@ +# Teensy++ 2.0 onekey + +To trigger keypress, short together pins *B2* and *B1* diff --git a/keyboards/handwired/onekey/teensy_2pp/rules.mk b/keyboards/handwired/onekey/teensy_2pp/rules.mk new file mode 100644 index 00000000000..e318e4b9e7b --- /dev/null +++ b/keyboards/handwired/onekey/teensy_2pp/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = at90usb1286 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/handwired/onekey/teensy_32/chconf.h b/keyboards/handwired/onekey/teensy_32/chconf.h new file mode 100644 index 00000000000..3294ac7eeef --- /dev/null +++ b/keyboards/handwired/onekey/teensy_32/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 1000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 20 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK TRUE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS TRUE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS TRUE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS TRUE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/onekey/teensy_32/config.h b/keyboards/handwired/onekey/teensy_32/config.h new file mode 100644 index 00000000000..0d82a057869 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_32/config.h @@ -0,0 +1,24 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// TODO: including this causes "error: expected identifier before '(' token" errors +//#include "config_common.h" + +#define MATRIX_COL_PINS { D5 } +#define MATRIX_ROW_PINS { B2 } +#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/teensy_32/halconf.h b/keyboards/handwired/onekey/teensy_32/halconf.h new file mode 100644 index 00000000000..1b6f2adc206 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_32/halconf.h @@ -0,0 +1,354 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ + diff --git a/keyboards/handwired/onekey/teensy_32/ld/MK20DX256.ld b/keyboards/handwired/onekey/teensy_32/ld/MK20DX256.ld new file mode 100644 index 00000000000..66bc6b81e28 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_32/ld/MK20DX256.ld @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * MK20DX256 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x400 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 256k - 0x410 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFF8000, len = 64k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/handwired/onekey/teensy_32/mcuconf.h b/keyboards/handwired/onekey/teensy_32/mcuconf.h new file mode 100644 index 00000000000..13a9e3333f2 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_32/mcuconf.h @@ -0,0 +1,45 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define K20x_MCUCONF + +/* + * HAL driver system settings. + */ +/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */ +#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE +#define KINETIS_PLLCLK_FREQUENCY 96000000UL +#define KINETIS_SYSCLK_FREQUENCY 48000000UL + +/* + * SERIAL driver system settings. + */ +#define KINETIS_SERIAL_USE_UART0 TRUE + +/* + * USB driver settings + */ +#define KINETIS_USB_USE_USB0 TRUE + +/* Need to redefine this, since the default (configured for K20x) might not apply + * 2 for Teensy LC + * 5 for Teensy 3.x */ +#define KINETIS_USB_USB0_IRQ_PRIORITY 5 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/handwired/onekey/teensy_32/readme.md b/keyboards/handwired/onekey/teensy_32/readme.md new file mode 100644 index 00000000000..216aecfaf71 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_32/readme.md @@ -0,0 +1,40 @@ +# Teensy 3.2 onekey + +To trigger keypress, short together pins *D5* and *B2* (marked on the PCB as *20* and *19*). + +## Hardware + +### Pins +When setting matrix pins, you need to use the MCU definitions instead of what is printed on the PCB. Sourced from . The following table can be used to convert between the two. + +| PCB | MCU | Notes | +|------- |-----|-----------------------------| +| 0 | B16 | | +| 1 | B17 | | +| 2 | D0 | | +| 3 | A12 | | +| 4 | A13 | | +| 5 | D7 | | +| 6 | D4 | | +| 7 | D2 | | +| 8 | D3 | | +| 9 | C3 | | +| 10 | C4 | | +| 11 | C6 | | +| 12 | C7 | | +| 13/LED | C5 | | +| 14/A0 | D1 | | +| 15/A1 | C0 | | +| 16/A2 | B0 | | +| 17/A3 | B1 | | +| 18/A4 | B3 | | +| 19/A5 | B2 | | +| 20/A6 | D5 | | +| 21/A7 | D6 | | +| 22/A8 | C1 | | +| 23/A9 | C2 | | +| 24/A10 | | ADC0_DP0 in schematic *[1]* | +| 25/A11 | | ADC0_DM0 in schematic *[1]* | +| 26/A12 | | ADC0_DP3 in schematic *[1]* | + +*[1]* - Currently not configured and may require extra work to implement. diff --git a/keyboards/handwired/onekey/teensy_32/rules.mk b/keyboards/handwired/onekey/teensy_32/rules.mk new file mode 100644 index 00000000000..97171611efa --- /dev/null +++ b/keyboards/handwired/onekey/teensy_32/rules.mk @@ -0,0 +1,41 @@ +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +# - For Teensies, FAMILY = KINETIS and SERIES is either +# KL2x (LC) or K20x (3.0,3.1,3.2). +MCU_FAMILY = KINETIS +MCU_SERIES = K20x + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# - NOTE: a custom ld script is needed for EEPROM on Teensy LC +# - LDSCRIPT = +# - MKL26Z64 for Teensy LC +# - MK20DX128 for Teensy 3.0 +# - MK20DX256 for Teensy 3.1 and 3.2 +MCU_LDSCRIPT = MK20DX256 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - STARTUP = +# - kl2x for Teensy LC +# - k20x5 for Teensy 3.0 +# - k20x7 for Teensy 3.1 and 3.2 +MCU_STARTUP = k20x7 + +# Board: it should exist either in /os/hal/boards/ +# or /boards +# - BOARD = +# - PJRC_TEENSY_LC for Teensy LC +# - PJRC_TEENSY_3 for Teensy 3.0 +# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 +BOARD = PJRC_TEENSY_3_1 + +# Cortex version +# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4 +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +# I.e. 6 for Teensy LC; 7 for Teensy 3.x +ARMV = 7 diff --git a/keyboards/handwired/onekey/teensy_lc/chconf.h b/keyboards/handwired/onekey/teensy_lc/chconf.h new file mode 100644 index 00000000000..3294ac7eeef --- /dev/null +++ b/keyboards/handwired/onekey/teensy_lc/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 1000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 20 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK TRUE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS TRUE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS TRUE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS TRUE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/onekey/teensy_lc/config.h b/keyboards/handwired/onekey/teensy_lc/config.h new file mode 100644 index 00000000000..0d82a057869 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_lc/config.h @@ -0,0 +1,24 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// TODO: including this causes "error: expected identifier before '(' token" errors +//#include "config_common.h" + +#define MATRIX_COL_PINS { D5 } +#define MATRIX_ROW_PINS { B2 } +#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/teensy_lc/halconf.h b/keyboards/handwired/onekey/teensy_lc/halconf.h new file mode 100644 index 00000000000..1b6f2adc206 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_lc/halconf.h @@ -0,0 +1,354 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ + diff --git a/keyboards/handwired/onekey/teensy_lc/ld/MKL26Z64.ld b/keyboards/handwired/onekey/teensy_lc/ld/MKL26Z64.ld new file mode 100644 index 00000000000..c4ca8b874cc --- /dev/null +++ b/keyboards/handwired/onekey/teensy_lc/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/handwired/onekey/teensy_lc/mcuconf.h b/keyboards/handwired/onekey/teensy_lc/mcuconf.h new file mode 100644 index 00000000000..ea576df5bc6 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_lc/mcuconf.h @@ -0,0 +1,45 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define KL2x_MCUCONF + +/* + * HAL driver system settings. + */ +/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */ +#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE +#define KINETIS_PLLCLK_FREQUENCY 96000000UL +#define KINETIS_SYSCLK_FREQUENCY 48000000UL + +/* + * SERIAL driver system settings. + */ +#define KINETIS_SERIAL_USE_UART0 TRUE + +/* + * USB driver settings + */ +#define KINETIS_USB_USE_USB0 TRUE + +/* Need to redefine this, since the default (configured for K20x) might not apply + * 2 for Teensy LC + * 5 for Teensy 3.x */ +#define KINETIS_USB_USB0_IRQ_PRIORITY 2 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/handwired/onekey/teensy_lc/readme.md b/keyboards/handwired/onekey/teensy_lc/readme.md new file mode 100644 index 00000000000..676d794d87b --- /dev/null +++ b/keyboards/handwired/onekey/teensy_lc/readme.md @@ -0,0 +1,40 @@ +# Teensy LC onekey + +To trigger keypress, short together pins *D5* and *B2* (marked on the PCB as *20* and *19*). + +## Hardware + +### Pins +When setting matrix pins, you need to use the MCU definitions instead of what is printed on the PCB. Sourced from . The following table can be used to convert between the two. + +| PCB | MCU | Notes | +|------- |-----|-------| +| 0 | B16 | | +| 1 | B17 | | +| 2 | D0 | | +| 3 | A1 | | +| 4 | A2 | | +| 5 | D7 | | +| 6 | D4 | | +| 7 | D2 | | +| 8 | D3 | | +| 9 | C3 | | +| 10 | C4 | | +| 11 | C6 | | +| 12 | C7 | | +| 13/LED | C5 | | +| 14/A0 | D1 | | +| 15/A1 | C0 | | +| 16/A2 | B0 | | +| 17/A3 | B1 | | +| 18/A4 | B3 | | +| 19/A5 | B2 | | +| 20/A6 | D5 | | +| 21/A7 | D6 | | +| 22/A8 | C1 | | +| 23/A9 | C2 | | +| 24/A10 | E2 | | +| 25/A11 | E21 | *[1]* | +| 26/A12 | E30 | *[1]* | + +*[1]* - Currently not configured and may require extra work to implement. diff --git a/keyboards/handwired/onekey/teensy_lc/rules.mk b/keyboards/handwired/onekey/teensy_lc/rules.mk new file mode 100644 index 00000000000..7859f6d741a --- /dev/null +++ b/keyboards/handwired/onekey/teensy_lc/rules.mk @@ -0,0 +1,41 @@ +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +# - For Teensies, FAMILY = KINETIS and SERIES is either +# KL2x (LC) or K20x (3.0,3.1,3.2). +MCU_FAMILY = KINETIS +MCU_SERIES = KL2x + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# - NOTE: a custom ld script is needed for EEPROM on Teensy LC +# - LDSCRIPT = +# - MKL26Z64 for Teensy LC +# - MK20DX128 for Teensy 3.0 +# - MK20DX256 for Teensy 3.1 and 3.2 +MCU_LDSCRIPT = MKL26Z64 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - STARTUP = +# - kl2x for Teensy LC +# - k20x5 for Teensy 3.0 +# - k20x7 for Teensy 3.1 and 3.2 +MCU_STARTUP = kl2x + +# Board: it should exist either in /os/hal/boards/ +# or /boards +# - BOARD = +# - PJRC_TEENSY_LC for Teensy LC +# - PJRC_TEENSY_3 for Teensy 3.0 +# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 +BOARD = PJRC_TEENSY_LC + +# Cortex version +# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4 +MCU = cortex-m0plus + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +# I.e. 6 for Teensy LC; 7 for Teensy 3.x +ARMV = 6 diff --git a/keyboards/handwired/ortho5x13/config.h b/keyboards/handwired/ortho5x13/config.h index f85159596ca..b3850a48a45 100644 --- a/keyboards/handwired/ortho5x13/config.h +++ b/keyboards/handwired/ortho5x13/config.h @@ -53,9 +53,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/ortho5x13/info.json b/keyboards/handwired/ortho5x13/info.json new file mode 100644 index 00000000000..886bfe02893 --- /dev/null +++ b/keyboards/handwired/ortho5x13/info.json @@ -0,0 +1,77 @@ +{ + "keyboard_name": "ortho5x13", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Tab", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"[", "x":11, "y":1}, + {"label":"]", "x":12, "y":1}, + {"label":"`", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":",", "x":11, "y":2}, + {"label":"\\", "x":12, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Enter", "x":11, "y":3}, + {"label":"Up", "x":12, "y":3}, + {"label":"Hyper", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"GUI", "x":3, "y":4}, + {"label":"Lower", "x":4, "y":4}, + {"label":"Space", "x":5, "y":4, "w":2}, + {"label":"Raise", "x":7, "y":4}, + {"label":"Backspace", "x":8, "y":4}, + {"label":"Shift", "x":9, "y":4}, + {"label":"Left", "x":10, "y":4}, + {"label":"Right", "x":11, "y":4}, + {"label":"Down", "x":12, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/ortho5x13/keymaps/default/keymap.c b/keyboards/handwired/ortho5x13/keymaps/default/keymap.c index 0d5d0c430b3..0c8bbb055ea 100644 --- a/keyboards/handwired/ortho5x13/keymaps/default/keymap.c +++ b/keyboards/handwired/ortho5x13/keymaps/default/keymap.c @@ -1,9 +1,4 @@ -#include "ortho5x13.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -25,146 +20,142 @@ enum custom_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define KC_L1 LOWER #define KC_L2 RAISE const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty + /* Qwerty + * ,------------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | ` | A | S | D | F | G | H | J | K | L | ; | ' | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | Up | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Hyper| Ctrl | Alt | GUI |Lower | Space |Raise | Bksp |Shift | Left | Down |Right | + * `------------------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. + KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS ,KC_EQL , + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC ,KC_RBRC , + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_GRV ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_QUOT ,KC_BSLS , + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_ENT ,KC_UP , + //|--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------+--------| + KC_HYPR ,KC_LCTL ,KC_LALT ,KC_LGUI ,KC_L1 , KC_SPC ,KC_L2 ,KC_BSPC ,KC_RSFT ,KC_LEFT ,KC_RGHT ,KC_DOWN + //`--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------+--------' + ), + +/* Colemak * ,------------------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | * |------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | | * |------+------+------+------+------+-------------+------+------+------+------+------+------| - * | ` | A | S | D | F | G | H | J | K | L | ; | ' | \ | + * | Esc | A | R | S | T | D | H | N | E | I | O | " | | * |------+------+------+------+------+------|------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | Up | + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | | * |------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Hyper| Ctrl | Alt | GUI |Lower | Space |Raise | Bksp |Shift | Left | Down |Right | + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | | * `------------------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_compact( - //,----+----+----+----+----+----+----+----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , - //|----+----+----+----+----+----+----+----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, - //|----+----+----+----+----+----+----+----+----+----+----+----+----| - GRV , A , S , D , F , G , H , J , K , L ,SCLN,QUOT,BSLS, - //|----+----+----+----+----+----+----+----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENT , UP , - //|----+----+----+----+----+---------+----+----+----+----+----+----| - HYPR,LCTL,LALT,LGUI, L1 , SPACE , L2 ,BSPC,RSFT,LEFT,RGHT,DOWN - //`----+----+----+----+----+---------+----+----+----+----+----+----' - ), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_COLEMAK] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, _______, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL , _______, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, _______, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , _______, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______ +), /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' + * ,------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | | + * `------------------------------------------------------------------------------------------' */ -[_DVORAK] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_DVORAK] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, _______, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL , _______, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, _______, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , _______, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______ +), /* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' + * ,------------------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | | + * `------------------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, +[_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, _______, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______ +), /* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' + * ,------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | | + * `------------------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, +[_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL , _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______ +), /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' + * ,------------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `------------------------------------------------------------------------------------------' */ -[_ADJUST] = { - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, - {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, - {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, - {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -} +[_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , _______, + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , _______, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) }; @@ -286,4 +277,4 @@ void music_scale_user(void) PLAY_SONG(music_scale); } -#endif \ No newline at end of file +#endif diff --git a/keyboards/handwired/ortho5x13/ortho5x13.h b/keyboards/handwired/ortho5x13/ortho5x13.h index 93551bd70b2..a43fc76ae6e 100644 --- a/keyboards/handwired/ortho5x13/ortho5x13.h +++ b/keyboards/handwired/ortho5x13/ortho5x13.h @@ -1,5 +1,4 @@ -#ifndef ORTHO5X13_H -#define ORTHO5X13_H +#pragma once #include "quantum.h" @@ -18,7 +17,7 @@ { k40, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4a, k4b, k4c } \ } -#define LAYOUT_compact( \ +#define LAYOUT_kc( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ @@ -32,5 +31,3 @@ { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k35, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b, KC_##k3c }, \ { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45, KC_NO, KC_##k47, KC_##k48, KC_##k49, KC_##k4a, KC_##k4b, KC_##k4c } \ } - -#endif \ No newline at end of file diff --git a/keyboards/handwired/ortho5x13/readme.md b/keyboards/handwired/ortho5x13/readme.md index 7241ddae8a8..444cfec96e9 100644 --- a/keyboards/handwired/ortho5x13/readme.md +++ b/keyboards/handwired/ortho5x13/readme.md @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make handwired/ortho5x13:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/pilcrow/config.h b/keyboards/handwired/pilcrow/config.h index d63eeba36e8..439686ae621 100644 --- a/keyboards/handwired/pilcrow/config.h +++ b/keyboards/handwired/pilcrow/config.h @@ -53,9 +53,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/pilcrow/info.json b/keyboards/handwired/pilcrow/info.json new file mode 100644 index 00000000000..824e2abbc5d --- /dev/null +++ b/keyboards/handwired/pilcrow/info.json @@ -0,0 +1,53 @@ +{ + "keyboard_name": "pilcrow", + "url": "", + "maintainer": "qmk", + "width": 10, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Q", "x":0, "y":0}, + {"label":"W", "x":1, "y":0}, + {"label":"E", "x":2, "y":0}, + {"label":"R", "x":3, "y":0}, + {"label":"T", "x":4, "y":0}, + {"label":"Y", "x":5, "y":0}, + {"label":"U", "x":6, "y":0}, + {"label":"I", "x":7, "y":0}, + {"label":"O", "x":8, "y":0}, + {"label":"P", "x":9, "y":0}, + {"label":"A", "x":0, "y":1}, + {"label":"S", "x":1, "y":1}, + {"label":"D", "x":2, "y":1}, + {"label":"F", "x":3, "y":1}, + {"label":"G", "x":4, "y":1}, + {"label":"H", "x":5, "y":1}, + {"label":"J", "x":6, "y":1}, + {"label":"K", "x":7, "y":1}, + {"label":"L", "x":8, "y":1}, + {"label":";", "x":9, "y":1}, + {"label":"Z", "x":0, "y":2}, + {"label":"X", "x":1, "y":2}, + {"label":"C", "x":2, "y":2}, + {"label":"V", "x":3, "y":2}, + {"label":"B", "x":4, "y":2}, + {"label":"N", "x":5, "y":2}, + {"label":"M", "x":6, "y":2}, + {"label":",", "x":7, "y":2}, + {"label":".", "x":8, "y":2}, + {"label":"/", "x":9, "y":2}, + {"label":"Ctrl", "x":0, "y":3}, + {"label":"Alt", "x":1, "y":3}, + {"label":"GUI", "x":2, "y":3}, + {"label":"MO(1)", "x":3, "y":3}, + {"label":"Space", "x":4, "y":3}, + {"label":"Shift / Space", "x":5, "y":3}, + {"label":"MO(2)", "x":6, "y":3}, + {"label":"MO(3)", "x":7, "y":3}, + {"label":"Delete", "x":8, "y":3}, + {"label":"Esc", "x":9, "y":3} + ] + } + } +} diff --git a/keyboards/handwired/pilcrow/keymaps/default/config.h b/keyboards/handwired/pilcrow/keymaps/default/config.h index df06a262062..271f48d0011 100644 --- a/keyboards/handwired/pilcrow/keymaps/default/config.h +++ b/keyboards/handwired/pilcrow/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/handwired/pilcrow/keymaps/default/keymap.c b/keyboards/handwired/pilcrow/keymaps/default/keymap.c index e382e4c6ad1..617ff4f6cda 100644 --- a/keyboards/handwired/pilcrow/keymaps/default/keymap.c +++ b/keyboards/handwired/pilcrow/keymaps/default/keymap.c @@ -1,76 +1,58 @@ -#include "pilcrow.h" -#define _______ KC_TRNS -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( \ - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ - KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ - KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, MT(MOD_LSFT, KC_SPC), MO(2), MO(3), KC_DEL, KC_ESC \ -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[1] = KEYMAP( \ - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, \ - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_PIPE, S(KC_QUOT), \ - _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_GRV \ -), -[2] = KEYMAP( \ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ - KC_TAB, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, \ - OSM(MOD_LSFT), KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_BSLS, KC_QUOT, \ - _______, _______, _______, _______, KC_ENT, KC_ENT, _______, KC_MNXT, KC_VOLD, KC_VOLU \ -), +#include QMK_KEYBOARD_H -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[3] = KEYMAP( \ - RESET, KC_UP, _______, _______, _______, _______, _______, KC_MS_WH_DOWN, KC_MS_U, KC_MS_WH_UP, \ - KC_LEFT, KC_DOWN, KC_RIGHT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, KC_MS_L,KC_MS_D, KC_MS_R, \ - RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, \ - _______, _______, _______, _______, KC_MS_BTN1, KC_MS_BTN2, _______, _______, _______, _______ \ -) -}; +#define SFT_SPC MT(MOD_LSFT, KC_SPC) -const uint16_t PROGMEM fn_actions[] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ + KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, SFT_SPC, MO(2), MO(3), KC_DEL, KC_ESC \ + ), -}; + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [1] = LAYOUT( \ + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, \ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_PIPE, S(KC_QUOT), \ + _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_GRV \ + ), + [2] = LAYOUT( \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_TAB, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, \ + OSM(MOD_LSFT), KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_BSLS, KC_QUOT, \ + _______, _______, _______, _______, KC_ENT, KC_ENT, _______, KC_MNXT, KC_VOLD, KC_VOLU \ + ), -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [3] = LAYOUT( \ + RESET, KC_UP, _______, _______, _______, _______, _______, KC_WH_D, KC_MS_U, KC_WH_U, \ + KC_LEFT, KC_DOWN, KC_RGHT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, KC_MS_L, KC_MS_D, KC_MS_R, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, \ + _______, _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, _______ \ + ) }; - void matrix_init_user(void) { } diff --git a/keyboards/handwired/pilcrow/pilcrow.h b/keyboards/handwired/pilcrow/pilcrow.h index 7138ccb3f62..37d2914f24f 100644 --- a/keyboards/handwired/pilcrow/pilcrow.h +++ b/keyboards/handwired/pilcrow/pilcrow.h @@ -7,7 +7,7 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ diff --git a/keyboards/handwired/pilcrow/readme.md b/keyboards/handwired/pilcrow/readme.md index 7a7f6d2af58..79f22518e82 100644 --- a/keyboards/handwired/pilcrow/readme.md +++ b/keyboards/handwired/pilcrow/readme.md @@ -1,28 +1,14 @@ -pilcrow keyboard firmware -====================== +# pilcrow -## Quantum MK Firmware +![pilcrow](https://i.imgur.com/KQdn2kg.jpg) -For the full Quantum feature list, see [the parent readme](/). +A 4x10 ortholinear keyboard powered by a Teensy. -## Building +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: Teensy-powered pilcrow -Download or clone the whole firmware and navigate to the keyboards/pilcrow folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. +Make example for this keyboard (after setting up your build environment): -Depending on which keymap you would like to use, you will have to compile slightly differently. + make handwired/pilcrow:default -### Default - -To build with the default keymap, simply run `make default`. - -### Other Keymaps - -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. - -To build the firmware binary hex file with a keymap just do `make` with a keymap like this: - -``` -$ make [default|jack|] -``` - -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/pilcrow/rules.mk b/keyboards/handwired/pilcrow/rules.mk index 67badc82076..762ae481ecc 100644 --- a/keyboards/handwired/pilcrow/rules.mk +++ b/keyboards/handwired/pilcrow/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/prime_exl/config.h b/keyboards/handwired/prime_exl/config.h index e34fbb8ccc0..a2962c07466 100644 --- a/keyboards/handwired/prime_exl/config.h +++ b/keyboards/handwired/prime_exl/config.h @@ -20,8 +20,8 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x4024 +#define VENDOR_ID 0x5052 +#define PRODUCT_ID 0x6578 #define DEVICE_VER 0x0001 #define MANUFACTURER PrimeKB #define PRODUCT Prime_EXL @@ -36,21 +36,36 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D0, B3, B2, D1, D2, D3, F7, F6, F5 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 #define BACKLIGHT_LEVELS 5 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*9*2)) = (35+720) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 755 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 269 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 \ No newline at end of file diff --git a/keyboards/handwired/prime_exl/info.json b/keyboards/handwired/prime_exl/info.json index edab7886079..65b08d61517 100644 --- a/keyboards/handwired/prime_exl/info.json +++ b/keyboards/handwired/prime_exl/info.json @@ -2,8 +2,8 @@ "keyboard_name": "Prime_EXL", "url": "https://www.primekb.com", "maintainer": "holtenc", - "width": 18, - "height": 5, + "width": 20.75, + "height": 6, "layouts": { "LAYOUT": { "layout": [{"x":0,"y":0,"w":1,"h":1}, {"x":1,"y":0,"w":1,"h":1}, {"x":2,"y":0,"w":1,"h":1}, {"x":3,"y":0,"w":1,"h":1}, {"x":4,"y":0,"w":1,"h":1}, {"x":5,"y":0,"w":1,"h":1}, {"x":6.5,"y":0,"w":1,"h":1}, {"x":7.5,"y":0,"w":1,"h":1}, {"x":8.5,"y":0,"w":1,"h":1}, {"x":9.5,"y":0,"w":1,"h":1}, {"x":10.5,"y":0,"w":1,"h":1}, {"x":11.5,"y":0,"w":1,"h":1}, {"x":13.75,"y":0,"w":1,"h":1}, {"x":14.75,"y":0,"w":1,"h":1}, {"x":15.75,"y":0,"w":1,"h":1}, {"x":16.75,"y":0,"w":1,"h":1}, {"x":17.75,"y":0,"w":1,"h":1}, {"x":18.75,"y":0,"w":2,"h":1}, {"x":0,"y":1,"w":1,"h":1}, {"x":1,"y":1,"w":1,"h":1}, {"x":2,"y":1,"w":1,"h":1}, {"x":3,"y":1,"w":1,"h":1}, {"x":4,"y":1,"w":1,"h":1}, {"x":5,"y":1,"w":1,"h":1}, {"x":6.5,"y":1,"w":1.26,"h":1}, {"x":7.75,"y":1,"w":1,"h":1}, {"x":8.75,"y":1,"w":1,"h":1}, {"x":9.75,"y":1,"w":1,"h":1}, {"x":10.75,"y":1,"w":1,"h":1}, {"x":11.75,"y":1,"w":1,"h":1}, {"x":14,"y":1,"w":1,"h":1}, {"x":15,"y":1,"w":1,"h":1}, {"x":16,"y":1,"w":1,"h":1}, {"x":17,"y":1,"w":1,"h":1}, {"x":18,"y":1,"w":1,"h":1}, {"x":19,"y":1,"w":1.75,"h":1}, {"x":0,"y":2,"w":1,"h":1}, {"x":1,"y":2,"w":1,"h":1}, {"x":2,"y":2,"w":1,"h":1}, {"x":3,"y":2,"w":1,"h":1}, {"x":4,"y":2,"w":1,"h":1}, {"x":5,"y":2,"w":1,"h":1}, {"x":6.5,"y":2,"w":1.75,"h":1}, {"x":8.25,"y":2,"w":1,"h":1}, {"x":9.25,"y":2,"w":1,"h":1}, {"x":10.25,"y":2,"w":1,"h":1}, {"x":11.25,"y":2,"w":1,"h":1}, {"x":12.25,"y":2,"w":1,"h":1}, {"x":13.5,"y":2,"w":1,"h":1}, {"x":14.5,"y":2,"w":1,"h":1}, {"x":15.5,"y":2,"w":1,"h":1}, {"x":16.5,"y":2,"w":1,"h":1}, {"x":17.5,"y":2,"w":1,"h":1}, {"x":18.5,"y":2,"w":1,"h":1}, {"x":19.5,"y":2,"w":1.25,"h":1}, {"x":0,"y":3,"w":1,"h":1}, {"x":1,"y":3,"w":1,"h":1}, {"x":2,"y":3,"w":1,"h":1}, {"x":3,"y":3,"w":1,"h":1}, {"x":4,"y":3,"w":1,"h":1}, {"x":5,"y":3,"w":1,"h":1}, {"x":6.5,"y":3,"w":1.25,"h":1}, {"x":7.75,"y":3,"w":1.25,"h":1}, {"x":9,"y":3,"w":1,"h":1}, {"x":10,"y":3,"w":1,"h":1}, {"x":11,"y":3,"w":2,"h":1}, {"x":13.5,"y":3,"w":2,"h":1}, {"x":15.5,"y":3,"w":1,"h":1}, {"x":16.5,"y":3,"w":1,"h":1}, {"x":17.5,"y":3,"w":1.5,"h":1}, {"x":19,"y":3,"w":1.5,"h":1}, {"x":0,"y":4,"w":1,"h":1}, {"x":1,"y":4,"w":1,"h":1}, {"x":2,"y":4,"w":1,"h":1}, {"x":3,"y":4,"w":1,"h":1}, {"x":4,"y":4,"w":1,"h":1}, {"x":5,"y":4,"w":1,"h":1}] diff --git a/keyboards/handwired/prime_exl/keymaps/default/keymap.c b/keyboards/handwired/prime_exl/keymaps/default/keymap.c index 0e1c60d4aaf..1dac7825e4b 100644 --- a/keyboards/handwired/prime_exl/keymaps/default/keymap.c +++ b/keyboards/handwired/prime_exl/keymaps/default/keymap.c @@ -37,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - + [2] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_F9, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_LALT, KC_LBRC, KC_RBRC, MO(5), KC_SPC, KC_MINS, KC_EQL, KC_LGUI, MO(4), KC_LCTL, KC_LALT, TO(0), KC_P, KC_H, KC_SPC ), - + [3] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - + [4] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - + [5] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_SCLN, KC_BSLS, @@ -96,14 +96,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void matrix_init_user(void) { // set CapsLock LED to output and low - DDRC |= (1 << 6); - PORTC &= ~(1 << 6); + setPinOutput(C6); + writePinHigh(C6); // set NumLock LED to output and low - DDRB |= (1 << 6); - PORTB &= ~(1 << 6); + setPinOutput(B6); + writePinHigh(B6); // set ScrollLock LED to output and low - DDRB |= (1 << 5); - PORTB &= ~(1 << 5); + setPinOutput(B5); + writePinHigh(B5); } void matrix_scan_user(void) { @@ -112,21 +112,21 @@ void matrix_scan_user(void) { void led_set_user(uint8_t usb_led) { - if (usb_led & (1<. + */ +#include QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT( + KC_NLCK, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, KC_BSPC, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_F1, KC_F2, KC_P7, KC_P8, KC_P9, KC_DEL, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_F3, KC_F4, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(3), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_F5, KC_F6, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_LCTL, KC_LALT, KC_LBRC, KC_RBRC, MO(2), KC_SPC, KC_MINS, KC_EQL, KC_LGUI, MO(3), + KC_F7, KC_F8, MO(1), KC_PDOT, KC_P0, KC_PENT + ), + + LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_F9, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(3), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_LALT, KC_LBRC, KC_RBRC, MO(2), KC_SPC, KC_MINS, KC_EQL, KC_LGUI, MO(3), + KC_LCTL, KC_LALT, TO(0), KC_P, KC_H, KC_SPC + ), + + LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_SCLN, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, + BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + + +void matrix_init_user(void) { + // set CapsLock LED to output and low + setPinOutput(C6); + writePinHigh(C6); + // set NumLock LED to output and low + setPinOutput(B6); + writePinHigh(B6); + // set ScrollLock LED to output and low + setPinOutput(B5); + writePinHigh(B5); +} + +void matrix_scan_user(void) { + +} + + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(B6); + } else { + writePinLow(B6); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(B5); + } else { + writePinLow(B5); + } + /* + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(C6); + } else { + writePinLow(C6); + } + */ +} + +//function for layer indicator LED +uint32_t layer_state_set_user(uint32_t state) +{ + if (biton32(state) == 2) { + writePinHigh(C6); + } else { + writePinLow(C6); + } + return state; +} diff --git a/keyboards/handwired/prime_exl/keymaps/via/readme.md b/keyboards/handwired/prime_exl/keymaps/via/readme.md new file mode 100644 index 00000000000..c2278bd4600 --- /dev/null +++ b/keyboards/handwired/prime_exl/keymaps/via/readme.md @@ -0,0 +1 @@ +# The default keymap for prime_exl \ No newline at end of file diff --git a/keyboards/handwired/prime_exl/keymaps/via/rules.mk b/keyboards/handwired/prime_exl/keymaps/via/rules.mk new file mode 100644 index 00000000000..e726a8a0e07 --- /dev/null +++ b/keyboards/handwired/prime_exl/keymaps/via/rules.mk @@ -0,0 +1,86 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# This is the VIA magic +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +SRC += keyboards/wilba_tech/wt_main.c + diff --git a/keyboards/handwired/prime_exl/prime_exl.c b/keyboards/handwired/prime_exl/prime_exl.c index d088f6ad11e..bae606ffbf5 100644 --- a/keyboards/handwired/prime_exl/prime_exl.c +++ b/keyboards/handwired/prime_exl/prime_exl.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ #include "prime_exl.h" - +/* void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up @@ -41,3 +41,4 @@ void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); } +*/ \ No newline at end of file diff --git a/keyboards/handwired/prime_exl/prime_exl.h b/keyboards/handwired/prime_exl/prime_exl.h index 727db5db8da..03524da3c2a 100644 --- a/keyboards/handwired/prime_exl/prime_exl.h +++ b/keyboards/handwired/prime_exl/prime_exl.h @@ -13,8 +13,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef PRIME_EXL_H -#define PRIME_EXL_H +//#ifndef PRIME_EXL_H +//#define PRIME_EXL_H #include "quantum.h" @@ -37,4 +37,4 @@ { K090, K091, K092, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ } -#endif \ No newline at end of file +//#endif \ No newline at end of file diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h index ea5f2b76e8c..f05273d2548 100644 --- a/keyboards/handwired/promethium/config.h +++ b/keyboards/handwired/promethium/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -61,7 +60,7 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -96,7 +95,7 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RCTRL)) \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RCTRL)) \ ) /* control how magic key switches layers */ @@ -159,27 +158,6 @@ along with this program. If not, see . #define MAX_VOLTAGE 4.2 #define MIN_VOLTAGE 3.2 -#define ___ KC_NO - -#define KEYMAP_CUSTOM( \ - k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ - k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ - k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ - k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \ - tp1, tp2, tp3 \ -) \ -{ \ - {k11, k12, k13, k14, k15, k16}, \ - {k21, k22, k23, k24, k25, k26}, \ - {k31, k32, k33, k34, k35, k36}, \ - {k41, k42, k43, k44, k45, k46}, \ - {k17, k18, k19, k1a, k1b, k1c}, \ - {k27, k28, k29, k2a, k2b, k2c}, \ - {k37, k38, k39, k3a, k3b, k3c}, \ - {k47, k48, k49, k4a, k4b, k4c}, \ - {tp1, tp2, tp3, ___, ___, ___} \ -} - #ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file enum led_sequence { LED_IND_LINUX, @@ -351,6 +329,3 @@ enum led_sequence { #define PS2_USART_ERROR (UCSR1A & ((1<. #include "led.h" #define COUNT(x) (sizeof (x) / sizeof (*(x))) -// Fillers to make layering clearer -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define G(x) LGUI(x) #define KC_WWWB KC_WWW_BACK #define KC_WWWF KC_WWW_FORWARD @@ -686,7 +682,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI | Punc | Num | Space | Fun |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = KEYMAP_CUSTOM( +[_QWERTY] = LAYOUT( KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT , KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, @@ -706,7 +702,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ #ifdef LAYOUT_DVORAK -[_DVORAK] = KEYMAP_CUSTOM( +[_DVORAK] = LAYOUT( _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, @@ -728,7 +724,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef LAYOUT_COLEMAK -[_COLEMAK] = KEYMAP_CUSTOM( +[_COLEMAK] = LAYOUT( _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______, _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, @@ -750,7 +746,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef LAYOUT_NORMAN -[_NORMAN] = KEYMAP_CUSTOM( +[_NORMAN] = LAYOUT( _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______, _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, @@ -772,7 +768,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef LAYOUT_WORKMAN -[_WORKMAN] = KEYMAP_CUSTOM( +[_WORKMAN] = LAYOUT( _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______, _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______, @@ -792,7 +788,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | : | | * `-----------------------------------------------------------------------------------' */ -[_PUNC] = KEYMAP_CUSTOM( +[_PUNC] = LAYOUT( KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, @@ -811,7 +807,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | x | | | | | 0 | , | . | : | | * `-----------------------------------------------------------------------------------' */ -[_NUM] = KEYMAP_CUSTOM( +[_NUM] = LAYOUT( KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_1, KC_2, KC_3, S(KC_D), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_7, KC_8, KC_9, S(KC_F), _______, @@ -830,7 +826,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_FUN] = KEYMAP_CUSTOM( +[_FUN] = LAYOUT( XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL, KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, @@ -849,7 +845,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GREEKU] = KEYMAP_CUSTOM( +[_GREEKU] = LAYOUT( _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______, _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______, _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______, @@ -868,7 +864,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GREEKL] = KEYMAP_CUSTOM( +[_GREEKL] = LAYOUT( _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______, _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______, _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______, @@ -887,7 +883,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_EMPTY] = KEYMAP_CUSTOM( +[_EMPTY] = LAYOUT( XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, @@ -906,7 +902,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_EMOJI] = KEYMAP_CUSTOM( +[_EMOJI] = LAYOUT( X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW), X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS), X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH), @@ -925,7 +921,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GUI] = KEYMAP_CUSTOM( +[_GUI] = LAYOUT( XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX, KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, @@ -944,7 +940,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_SYS] = KEYMAP_CUSTOM( +[_SYS] = LAYOUT( DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, RGBDEMO, XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, @@ -1281,7 +1277,7 @@ void set_output_user(uint8_t output) { } void matrix_init_user() { - _delay_ms(500); // give time for usb to initialize + wait_ms(500); // give time for usb to initialize set_unicode_input_mode(UC_LNX); @@ -1365,4 +1361,4 @@ void turn_off_capslock() { rcv = ps2_host_send(0x01); } } -#endif \ No newline at end of file +#endif diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h index 2064f3676a7..0630fd43e38 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/config.h +++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #define PRIYADI_PROMETHIUM @@ -23,5 +20,3 @@ #define DOUBLESPACE_LAYER_ENABLE // #define TOLELOT_ENABLE - -#endif diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index e229b67e541..fbb1ae1d69f 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -53,14 +53,12 @@ along with this program. If not, see . } while (0) #endif #endif +#ifdef __AVR__ #include "outputselect.h" +#endif #include "led.h" #define COUNT(x) (sizeof (x) / sizeof (*(x))) -// Fillers to make layering clearer -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define G(x) LGUI(x) #define KC_WWWB KC_WWW_BACK #define KC_WWWF KC_WWW_FORWARD @@ -686,7 +684,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI | Punc | Num | Space | Fun |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = KEYMAP_CUSTOM( +[_QWERTY] = LAYOUT( KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT , KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, @@ -706,7 +704,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ #ifdef LAYOUT_DVORAK -[_DVORAK] = KEYMAP_CUSTOM( +[_DVORAK] = LAYOUT( _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, @@ -728,7 +726,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef LAYOUT_COLEMAK -[_COLEMAK] = KEYMAP_CUSTOM( +[_COLEMAK] = LAYOUT( _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______, _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, @@ -750,7 +748,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef LAYOUT_NORMAN -[_NORMAN] = KEYMAP_CUSTOM( +[_NORMAN] = LAYOUT( _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______, _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, @@ -772,7 +770,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef LAYOUT_WORKMAN -[_WORKMAN] = KEYMAP_CUSTOM( +[_WORKMAN] = LAYOUT( _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______, _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______, @@ -792,7 +790,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | : | | * `-----------------------------------------------------------------------------------' */ -[_PUNC] = KEYMAP_CUSTOM( +[_PUNC] = LAYOUT( KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, @@ -811,7 +809,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | x | | | | | 0 | , | . | : | | * `-----------------------------------------------------------------------------------' */ -[_NUM] = KEYMAP_CUSTOM( +[_NUM] = LAYOUT( KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_1, KC_2, KC_3, S(KC_D), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_7, KC_8, KC_9, S(KC_F), _______, @@ -830,7 +828,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_FUN] = KEYMAP_CUSTOM( +[_FUN] = LAYOUT( XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL, KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, @@ -849,7 +847,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GREEKU] = KEYMAP_CUSTOM( +[_GREEKU] = LAYOUT( _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______, _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______, _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______, @@ -868,7 +866,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GREEKL] = KEYMAP_CUSTOM( +[_GREEKL] = LAYOUT( _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______, _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______, _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______, @@ -887,7 +885,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_EMPTY] = KEYMAP_CUSTOM( +[_EMPTY] = LAYOUT( XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, @@ -906,7 +904,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_EMOJI] = KEYMAP_CUSTOM( +[_EMOJI] = LAYOUT( X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW), X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS), X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH), @@ -925,7 +923,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GUI] = KEYMAP_CUSTOM( +[_GUI] = LAYOUT( XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX, KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, @@ -944,7 +942,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_SYS] = KEYMAP_CUSTOM( +[_SYS] = LAYOUT( DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, RGBDEMO, XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, @@ -1281,7 +1279,7 @@ void set_output_user(uint8_t output) { } void matrix_init_user() { - _delay_ms(500); // give time for usb to initialize + wait_ms(500); // give time for usb to initialize set_unicode_input_mode(UC_LNX); @@ -1365,4 +1363,4 @@ void turn_off_capslock() { rcv = ps2_host_send(0x01); } } -#endif \ No newline at end of file +#endif diff --git a/keyboards/handwired/promethium/matrix.c b/keyboards/handwired/promethium/matrix.c index 00f2b8e9dca..3b8e5af820a 100644 --- a/keyboards/handwired/promethium/matrix.c +++ b/keyboards/handwired/promethium/matrix.c @@ -31,11 +31,11 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -128,7 +128,7 @@ uint8_t matrix_scan(void) { // Set row, read cols for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); if (matrix_changed) { @@ -142,8 +142,8 @@ uint8_t matrix_scan(void) } -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } @@ -157,7 +157,7 @@ uint8_t matrix_scan(void) bool matrix_is_modified(void) { -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) if (debouncing) return false; #endif return true; @@ -167,7 +167,7 @@ inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +#define DEBOUNCE 5 // 5 is default /* prevent stuck modifiers */ #define PREVENT_STUCK_MODIFIERS diff --git a/keyboards/handwired/pteron/info.json b/keyboards/handwired/pteron/info.json new file mode 100644 index 00000000000..7b3b1b696f8 --- /dev/null +++ b/keyboards/handwired/pteron/info.json @@ -0,0 +1,78 @@ +{ + "keyboard_name": "pteron", + "url": "", + "maintainer": "FSund", + "width": 17, + "height": 5.95, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"K000", "x":0, "y":0.75}, + {"label":"K001", "x":1, "y":0.75}, + {"label":"K002", "x":2, "y":0.25}, + {"label":"K003", "x":3, "y":0}, + {"label":"K004", "x":4, "y":0.35}, + {"label":"K005", "x":5, "y":0.45}, + + {"label":"K006", "x":11, "y":0.45}, + {"label":"K007", "x":12, "y":0.35}, + {"label":"K008", "x":13, "y":0}, + {"label":"K009", "x":14, "y":0.25}, + {"label":"K010", "x":15, "y":0.75}, + {"label":"K011", "x":16, "y":0.75}, + + {"label":"K100", "x":0, "y":1.75}, + {"label":"K101", "x":1, "y":1.75}, + {"label":"K102", "x":2, "y":1.25}, + {"label":"K103", "x":3, "y":1}, + {"label":"K104", "x":4, "y":1.35}, + {"label":"K105", "x":5, "y":1.45}, + + {"label":"K106", "x":11, "y":1.45}, + {"label":"K107", "x":12, "y":1.35}, + {"label":"K108", "x":13, "y":1}, + {"label":"K109", "x":14, "y":1.25}, + {"label":"K110", "x":15, "y":1.75}, + {"label":"K111", "x":16, "y":1.75}, + + {"label":"K200", "x":0, "y":2.75}, + {"label":"K201", "x":1, "y":2.75}, + {"label":"K202", "x":2, "y":2.25}, + {"label":"K203", "x":3, "y":2}, + {"label":"K204", "x":4, "y":2.35}, + {"label":"K205", "x":5, "y":2.45}, + + {"label":"K206", "x":11, "y":2.45}, + {"label":"K207", "x":12, "y":2.35}, + {"label":"K208", "x":13, "y":2}, + {"label":"K209", "x":14, "y":2.25}, + {"label":"K210", "x":15, "y":2.75}, + {"label":"K211", "x":16, "y":2.75}, + + {"label":"K300", "x":0, "y":3.75}, + {"label":"K301", "x":1, "y":3.75}, + {"label":"K302", "x":2, "y":3.25}, + {"label":"K303", "x":3, "y":3}, + {"label":"K304", "x":4, "y":3.35}, + {"label":"K305", "x":5, "y":3.45}, + + {"label":"K306", "x":11, "y":3.45}, + {"label":"K307", "x":12, "y":3.35}, + {"label":"K308", "x":13, "y":3}, + {"label":"K309", "x":14, "y":3.25}, + {"label":"K310", "x":15, "y":3.75}, + {"label":"K311", "x":16, "y":3.75}, + + {"label":"K402", "x":4, "y":4.35}, + {"label":"K403", "x":5, "y":4.45}, + {"label":"K404", "x":6, "y":4.65}, + {"label":"K405", "x":7, "y":4.95}, + + {"label":"K406", "x":9, "y":4.95}, + {"label":"K407", "x":10, "y":4.65}, + {"label":"K408", "x":11, "y":4.45}, + {"label":"K409", "x":12, "y":4.35} + ] + } + } +} diff --git a/keyboards/handwired/pteron/keymaps/FSund/keymap.c b/keyboards/handwired/pteron/keymaps/FSund/keymap.c index f34beae0637..a52e8429777 100644 --- a/keyboards/handwired/pteron/keymaps/FSund/keymap.c +++ b/keyboards/handwired/pteron/keymaps/FSund/keymap.c @@ -10,10 +10,8 @@ enum pteron_layers { #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) -// use S() to produce shifted versions of keys -// #define S(kc) LSFT(kc) // defined by default - // alt gr +#undef G #define G(kc) RALT(kc) // custom keycodes diff --git a/keyboards/handwired/qc60/README.md b/keyboards/handwired/qc60/README.md index 85570a8a76e..4fdd9ba6ef5 100644 --- a/keyboards/handwired/qc60/README.md +++ b/keyboards/handwired/qc60/README.md @@ -1,5 +1,4 @@ -QC60 -======== +# QC60 ![qc60 layout](https://i.imgur.com/BAW1VGc.png) @@ -19,4 +18,4 @@ Example of flashing this keyboard: make handwired/qc60/proto:avrdude -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/qc60/config.h b/keyboards/handwired/qc60/config.h index 3b6f84390bc..0c8f8f00792 100644 --- a/keyboards/handwired/qc60/config.h +++ b/keyboards/handwired/qc60/config.h @@ -16,9 +16,7 @@ #define MATRIX_COLS 8 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 diff --git a/keyboards/handwired/qc60/info.json b/keyboards/handwired/qc60/info.json index b39ec587bc5..c047d503071 100644 --- a/keyboards/handwired/qc60/info.json +++ b/keyboards/handwired/qc60/info.json @@ -1,11 +1,93 @@ { - "keyboard_name": "QC60", - "url": "", - "maintainer": "coarse", - "width": 15, - "height": 5, + "keyboard_name": "QC60", + "url": "", + "maintainer": "coarse", + "width": 16, + "height": 5, "layouts": { - "LAYOUT_ANSI_DEFAULT": { + "LAYOUT": { + "key_count": 67, + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"L06", "x":6, "y":0}, + + {"label":"R00", "x":8, "y":0}, + {"label":"R01", "x":9, "y":0}, + {"label":"R02", "x":10, "y":0}, + {"label":"R03", "x":11, "y":0}, + {"label":"R04", "x":12, "y":0}, + {"label":"R05", "x":13, "y":0}, + {"label":"R06", "x":14, "y":0}, + {"label":"R07", "x":15, "y":0}, + + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + + {"label":"R10", "x":7.5, "y":1}, + {"label":"R11", "x":8.5, "y":1}, + {"label":"R12", "x":9.5, "y":1}, + {"label":"R13", "x":10.5, "y":1}, + {"label":"R14", "x":11.5, "y":1}, + {"label":"R15", "x":12.5, "y":1}, + {"label":"R16", "x":13.5, "y":1}, + {"label":"R17", "x":14.5, "y":1, "w":1.5}, + + {"label":"L20", "x":0, "y":2, "w":1.75}, + {"label":"L21", "x":1.75, "y":2}, + {"label":"L22", "x":2.75, "y":2}, + {"label":"L23", "x":3.75, "y":2}, + {"label":"L24", "x":4.75, "y":2}, + {"label":"L25", "x":5.75, "y":2}, + + {"label":"R21", "x":7.75, "y":2}, + {"label":"R22", "x":8.75, "y":2}, + {"label":"R23", "x":9.75, "y":2}, + {"label":"R24", "x":10.75, "y":2}, + {"label":"R25", "x":11.75, "y":2}, + {"label":"R26", "x":12.75, "y":2}, + {"label":"R27", "x":13.75, "y":2, "w":2.25}, + + {"label":"L30", "x":0, "y":3, "w":1.25}, + {"label":"L31", "x":1.25, "y":3}, + {"label":"L32", "x":2.25, "y":3}, + {"label":"L33", "x":3.25, "y":3}, + {"label":"L34", "x":4.25, "y":3}, + {"label":"L35", "x":5.25, "y":3}, + {"label":"L36", "x":6.25, "y":3}, + + {"label":"R31", "x":8.25, "y":3}, + {"label":"R32", "x":9.25, "y":3}, + {"label":"R33", "x":10.25, "y":3}, + {"label":"R34", "x":11.25, "y":3}, + {"label":"R35", "x":12.25, "y":3}, + {"label":"R36", "x":13.25, "y":3, "w":1.75}, + {"label":"R37", "x":15, "y":3}, + + {"label":"L40", "x":0, "y":4, "w":1.25}, + {"label":"L41", "x":1.25, "y":4, "w":1.25}, + {"label":"L42", "x":2.5, "y":4, "w":1.25}, + {"label":"L43", "x":3.75, "y":4, "w":2.75}, + {"label":"L44", "x":6.5, "y":4, "w":1.25}, + + {"label":"R43", "x":8.75, "y":4, "w":1.25}, + {"label":"R44", "x":10, "y":4, "w":2}, + {"label":"R42", "x":12, "y":4}, + {"label":"R45", "x":13, "y":4}, + {"label":"R46", "x":14, "y":4}, + {"label":"R47", "x":15, "y":4} + ] + }, + + "LAYOUT_ansi_default": { "key_count": 64, "layout": [ {"label":"Esc", "x":0, "y":0}, @@ -16,13 +98,13 @@ {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, - {"label":"7", "x":7, "y":0}, - {"label":"8", "x":8, "y":0}, - {"label":"9", "x":9, "y":0}, - {"label":"0", "x":10, "y":0}, - {"label":"-", "x":11, "y":0}, - {"label":"=", "x":12, "y":0}, - {"label":"Backspace", "x":13, "y":0, "w":2.0}, + {"label":"7", "x":8, "y":0}, + {"label":"8", "x":9, "y":0}, + {"label":"9", "x":10, "y":0}, + {"label":"0", "x":11, "y":0}, + {"label":"-", "x":12, "y":0}, + {"label":"=", "x":13, "y":0}, + {"label":"Backspace", "x":14, "y":0, "w":2.0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, @@ -31,14 +113,14 @@ {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, - {"label":"Y", "x":6.5, "y":1}, - {"label":"U", "x":7.5, "y":1}, - {"label":"I", "x":8.5, "y":1}, - {"label":"O", "x":9.5, "y":1}, - {"label":"P", "x":10.5, "y":1}, - {"label":"[", "x":11.5, "y":1}, - {"label":"]", "x":12.5, "y":1}, - {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Y", "x":7.5, "y":1}, + {"label":"U", "x":8.5, "y":1}, + {"label":"I", "x":9.5, "y":1}, + {"label":"O", "x":10.5, "y":1}, + {"label":"P", "x":11.5, "y":1}, + {"label":"[", "x":12.5, "y":1}, + {"label":"]", "x":13.5, "y":1}, + {"label":"\\", "x":14.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, @@ -47,13 +129,13 @@ {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, - {"label":"H", "x":6.75, "y":2}, - {"label":"J", "x":7.75, "y":2}, - {"label":"K", "x":8.75, "y":2}, - {"label":"L", "x":9.75, "y":2}, - {"label":";", "x":10.75, "y":2}, - {"label":"'", "x":11.75, "y":2}, - {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"H", "x":7.75, "y":2}, + {"label":"J", "x":8.75, "y":2}, + {"label":"K", "x":9.75, "y":2}, + {"label":"L", "x":10.75, "y":2}, + {"label":";", "x":11.75, "y":2}, + {"label":"'", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, @@ -62,12 +144,12 @@ {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, - {"label":"N", "x":7.25, "y":3}, - {"label":"M", "x":8.25, "y":3}, - {"label":",", "x":9.25, "y":3}, - {"label":".", "x":10.25, "y":3}, - {"label":"/", "x":11.25, "y":3}, - {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"N", "x":8.25, "y":3}, + {"label":"M", "x":9.25, "y":3}, + {"label":",", "x":10.25, "y":3}, + {"label":".", "x":11.25, "y":3}, + {"label":"/", "x":12.25, "y":3}, + {"label":"Shift", "x":13.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, @@ -75,13 +157,483 @@ {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, - {"x":7.75, "y":4, "w":1.25}, - {"x":9, "y":4, "w":2.0}, - {"label":"Alt", "x":11, "y":4}, - {"label":"Win", "x":12, "y":4}, - {"label":"Menu", "x":13, "y":4}, - {"label":"Ctrl", "x":14, "y":4} + {"x":8.75, "y":4, "w":1.25}, + {"x":10, "y":4, "w":2.0}, + {"label":"Alt", "x":12, "y":4}, + {"label":"Win", "x":13, "y":4}, + {"label":"Menu", "x":14, "y":4}, + {"label":"Ctrl", "x":15, "y":4} + ] + }, + + "LAYOUT_ansi_alt": { + "key_count": 63, + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"L06", "x":6, "y":0}, + + {"label":"R00", "x":8, "y":0}, + {"label":"R01", "x":9, "y":0}, + {"label":"R02", "x":10, "y":0}, + {"label":"R03", "x":11, "y":0}, + {"label":"R04", "x":12, "y":0}, + {"label":"R05", "x":13, "y":0}, + {"label":"R07", "x":14, "y":0, "w":2}, + + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + + {"label":"R10", "x":7.5, "y":1}, + {"label":"R11", "x":8.5, "y":1}, + {"label":"R12", "x":9.5, "y":1}, + {"label":"R13", "x":10.5, "y":1}, + {"label":"R14", "x":11.5, "y":1}, + {"label":"R15", "x":12.5, "y":1}, + {"label":"R16", "x":13.5, "y":1}, + {"label":"R17", "x":14.5, "y":1, "w":1.5}, + + {"label":"L20", "x":0, "y":2, "w":1.75}, + {"label":"L21", "x":1.75, "y":2}, + {"label":"L22", "x":2.75, "y":2}, + {"label":"L23", "x":3.75, "y":2}, + {"label":"L24", "x":4.75, "y":2}, + {"label":"L25", "x":5.75, "y":2}, + + {"label":"R21", "x":7.75, "y":2}, + {"label":"R22", "x":8.75, "y":2}, + {"label":"R23", "x":9.75, "y":2}, + {"label":"R24", "x":10.75, "y":2}, + {"label":"R25", "x":11.75, "y":2}, + {"label":"R26", "x":12.75, "y":2}, + {"label":"R27", "x":13.75, "y":2, "w":2.25}, + + {"label":"L31", "x":0, "y":3, "w":2.25}, + {"label":"L32", "x":2.25, "y":3}, + {"label":"L33", "x":3.25, "y":3}, + {"label":"L34", "x":4.25, "y":3}, + {"label":"L35", "x":5.25, "y":3}, + {"label":"L36", "x":6.25, "y":3}, + + {"label":"R31", "x":8.25, "y":3}, + {"label":"R32", "x":9.25, "y":3}, + {"label":"R33", "x":10.25, "y":3}, + {"label":"R34", "x":11.25, "y":3}, + {"label":"R35", "x":12.25, "y":3}, + {"label":"R36", "x":13.25, "y":3, "w":2.75}, + + {"label":"L40", "x":0, "y":4, "w":1.5}, + {"label":"L41", "x":1.5, "y":4}, + {"label":"L42", "x":2.5, "y":4, "w":1.5}, + {"label":"L43", "x":4, "y":4, "w":2.75}, + {"label":"L44", "x":6.75, "y":4}, + + {"label":"R43", "x":8.75, "y":4}, + {"label":"R44", "x":9.75, "y":4, "w":2.25}, + {"label":"R45", "x":12, "y":4, "w":1.5}, + {"label":"R46", "x":13.5, "y":4}, + {"label":"R47", "x":14.5, "y":4, "w":1.5} + ] + }, + + "LAYOUT_iso_default": { + "key_count": 65, + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"L06", "x":6, "y":0}, + + {"label":"R00", "x":8, "y":0}, + {"label":"R01", "x":9, "y":0}, + {"label":"R02", "x":10, "y":0}, + {"label":"R03", "x":11, "y":0}, + {"label":"R04", "x":12, "y":0}, + {"label":"R05", "x":13, "y":0}, + {"label":"R07", "x":14, "y":0, "w":2}, + + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + + {"label":"R10", "x":7.5, "y":1}, + {"label":"R11", "x":8.5, "y":1}, + {"label":"R12", "x":9.5, "y":1}, + {"label":"R13", "x":10.5, "y":1}, + {"label":"R14", "x":11.5, "y":1}, + {"label":"R15", "x":12.5, "y":1}, + {"label":"R16", "x":13.5, "y":1}, + + {"label":"L20", "x":0, "y":2, "w":1.75}, + {"label":"L21", "x":1.75, "y":2}, + {"label":"L22", "x":2.75, "y":2}, + {"label":"L23", "x":3.75, "y":2}, + {"label":"L24", "x":4.75, "y":2}, + {"label":"L25", "x":5.75, "y":2}, + + {"label":"R21", "x":7.75, "y":2}, + {"label":"R22", "x":8.75, "y":2}, + {"label":"R23", "x":9.75, "y":2}, + {"label":"R24", "x":10.75, "y":2}, + {"label":"R25", "x":11.75, "y":2}, + {"label":"R26", "x":12.75, "y":2}, + {"label":"R17", "x":13.75, "y":2}, + {"label":"R27", "x":14.75, "y":1, "w":1.25, "h":2}, + + {"label":"L30", "x":0, "y":3, "w":1.25}, + {"label":"L31", "x":1.25, "y":3}, + {"label":"L32", "x":2.25, "y":3}, + {"label":"L33", "x":3.25, "y":3}, + {"label":"L34", "x":4.25, "y":3}, + {"label":"L35", "x":5.25, "y":3}, + {"label":"L36", "x":6.25, "y":3}, + + {"label":"R31", "x":8.25, "y":3}, + {"label":"R32", "x":9.25, "y":3}, + {"label":"R33", "x":10.25, "y":3}, + {"label":"R34", "x":11.25, "y":3}, + {"label":"R35", "x":12.25, "y":3}, + {"label":"R36", "x":13.25, "y":3, "w":2.75}, + + {"label":"L40", "x":0, "y":4, "w":1.25}, + {"label":"L41", "x":1.25, "y":4, "w":1.25}, + {"label":"L42", "x":2.5, "y":4, "w":1.25}, + {"label":"L43", "x":3.75, "y":4, "w":2.75}, + {"label":"L44", "x":6.5, "y":4, "w":1.25}, + + {"label":"R43", "x":8.75, "y":4, "w":1.25}, + {"label":"R44", "x":10, "y":4, "w":2}, + {"label":"R42", "x":12, "y":4}, + {"label":"R45", "x":13, "y":4}, + {"label":"R46", "x":14, "y":4}, + {"label":"R47", "x":15, "y":4} + ] + }, + + "LAYOUT_iso_alt": { + "key_count": 64, + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"L06", "x":6, "y":0}, + + {"label":"R00", "x":8, "y":0}, + {"label":"R01", "x":9, "y":0}, + {"label":"R02", "x":10, "y":0}, + {"label":"R03", "x":11, "y":0}, + {"label":"R04", "x":12, "y":0}, + {"label":"R05", "x":13, "y":0}, + {"label":"R07", "x":14, "y":0, "w":2}, + + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + + {"label":"R10", "x":7.5, "y":1}, + {"label":"R11", "x":8.5, "y":1}, + {"label":"R12", "x":9.5, "y":1}, + {"label":"R13", "x":10.5, "y":1}, + {"label":"R14", "x":11.5, "y":1}, + {"label":"R15", "x":12.5, "y":1}, + {"label":"R16", "x":13.5, "y":1}, + + {"label":"L20", "x":0, "y":2, "w":1.75}, + {"label":"L21", "x":1.75, "y":2}, + {"label":"L22", "x":2.75, "y":2}, + {"label":"L23", "x":3.75, "y":2}, + {"label":"L24", "x":4.75, "y":2}, + {"label":"L25", "x":5.75, "y":2}, + + {"label":"R21", "x":7.75, "y":2}, + {"label":"R22", "x":8.75, "y":2}, + {"label":"R23", "x":9.75, "y":2}, + {"label":"R24", "x":10.75, "y":2}, + {"label":"R25", "x":11.75, "y":2}, + {"label":"R26", "x":12.75, "y":2}, + {"label":"R17", "x":13.75, "y":2}, + {"label":"R27", "x":14.75, "y":1, "w":1.25, "h":2}, + + {"label":"L30", "x":0, "y":3, "w":1.25}, + {"label":"L31", "x":1.25, "y":3}, + {"label":"L32", "x":2.25, "y":3}, + {"label":"L33", "x":3.25, "y":3}, + {"label":"L34", "x":4.25, "y":3}, + {"label":"L35", "x":5.25, "y":3}, + {"label":"L36", "x":6.25, "y":3}, + + {"label":"R31", "x":8.25, "y":3}, + {"label":"R32", "x":9.25, "y":3}, + {"label":"R33", "x":10.25, "y":3}, + {"label":"R34", "x":11.25, "y":3}, + {"label":"R35", "x":12.25, "y":3}, + {"label":"R36", "x":13.25, "y":3, "w":2.75}, + + {"label":"L40", "x":0, "y":4, "w":1.5}, + {"label":"L41", "x":1.5, "y":4}, + {"label":"L42", "x":2.5, "y":4, "w":1.5}, + {"label":"L43", "x":4, "y":4, "w":2.75}, + {"label":"L44", "x":6.75, "y":4}, + + {"label":"R43", "x":8.75, "y":4}, + {"label":"R44", "x":9.75, "y":4, "w":2.25}, + {"label":"R45", "x":12, "y":4, "w":1.5}, + {"label":"R46", "x":13.5, "y":4}, + {"label":"R47", "x":14.5, "y":4, "w":1.5} + ] + }, + + "LAYOUT_hhkb_default": { + "key_count": 63, + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"L06", "x":6, "y":0}, + + {"label":"R00", "x":8, "y":0}, + {"label":"R01", "x":9, "y":0}, + {"label":"R02", "x":10, "y":0}, + {"label":"R03", "x":11, "y":0}, + {"label":"R04", "x":12, "y":0}, + {"label":"R05", "x":13, "y":0}, + {"label":"R06", "x":14, "y":0}, + {"label":"R07", "x":15, "y":0}, + + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + + {"label":"R10", "x":7.5, "y":1}, + {"label":"R11", "x":8.5, "y":1}, + {"label":"R12", "x":9.5, "y":1}, + {"label":"R13", "x":10.5, "y":1}, + {"label":"R14", "x":11.5, "y":1}, + {"label":"R15", "x":12.5, "y":1}, + {"label":"R16", "x":13.5, "y":1}, + {"label":"R17", "x":14.5, "y":1, "w":1.5}, + + {"label":"L20", "x":0, "y":2, "w":1.75}, + {"label":"L21", "x":1.75, "y":2}, + {"label":"L22", "x":2.75, "y":2}, + {"label":"L23", "x":3.75, "y":2}, + {"label":"L24", "x":4.75, "y":2}, + {"label":"L25", "x":5.75, "y":2}, + + {"label":"R21", "x":7.75, "y":2}, + {"label":"R22", "x":8.75, "y":2}, + {"label":"R23", "x":9.75, "y":2}, + {"label":"R24", "x":10.75, "y":2}, + {"label":"R25", "x":11.75, "y":2}, + {"label":"R26", "x":12.75, "y":2}, + {"label":"R27", "x":13.75, "y":2, "w":2.25}, + + {"label":"L31", "x":0, "y":3, "w":2.25}, + {"label":"L32", "x":2.25, "y":3}, + {"label":"L33", "x":3.25, "y":3}, + {"label":"L34", "x":4.25, "y":3}, + {"label":"L35", "x":5.25, "y":3}, + {"label":"L36", "x":6.25, "y":3}, + + {"label":"R31", "x":8.25, "y":3}, + {"label":"R32", "x":9.25, "y":3}, + {"label":"R33", "x":10.25, "y":3}, + {"label":"R34", "x":11.25, "y":3}, + {"label":"R35", "x":12.25, "y":3}, + {"label":"R36", "x":13.25, "y":3, "w":1.75}, + {"label":"R37", "x":15, "y":3}, + + {"label":"L41", "x":1.5, "y":4}, + {"label":"L42", "x":2.5, "y":4, "w":1.5}, + {"label":"L43", "x":4, "y":4, "w":2.75}, + {"label":"L44", "x":6.75, "y":4}, + + {"label":"R43", "x":8.75, "y":4}, + {"label":"R44", "x":9.75, "y":4, "w":2.25}, + {"label":"R45", "x":12, "y":4, "w":1.5}, + {"label":"R46", "x":13.5, "y":4} + ] + }, + + "LAYOUT_hhkb_split_lshift": { + "key_count": 64, + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"L06", "x":6, "y":0}, + + {"label":"R00", "x":8, "y":0}, + {"label":"R01", "x":9, "y":0}, + {"label":"R02", "x":10, "y":0}, + {"label":"R03", "x":11, "y":0}, + {"label":"R04", "x":12, "y":0}, + {"label":"R05", "x":13, "y":0}, + {"label":"R06", "x":14, "y":0}, + {"label":"R07", "x":15, "y":0}, + + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + + {"label":"R10", "x":7.5, "y":1}, + {"label":"R11", "x":8.5, "y":1}, + {"label":"R12", "x":9.5, "y":1}, + {"label":"R13", "x":10.5, "y":1}, + {"label":"R14", "x":11.5, "y":1}, + {"label":"R15", "x":12.5, "y":1}, + {"label":"R16", "x":13.5, "y":1}, + {"label":"R17", "x":14.5, "y":1, "w":1.5}, + + {"label":"L20", "x":0, "y":2, "w":1.75}, + {"label":"L21", "x":1.75, "y":2}, + {"label":"L22", "x":2.75, "y":2}, + {"label":"L23", "x":3.75, "y":2}, + {"label":"L24", "x":4.75, "y":2}, + {"label":"L25", "x":5.75, "y":2}, + + {"label":"R21", "x":7.75, "y":2}, + {"label":"R22", "x":8.75, "y":2}, + {"label":"R23", "x":9.75, "y":2}, + {"label":"R24", "x":10.75, "y":2}, + {"label":"R25", "x":11.75, "y":2}, + {"label":"R26", "x":12.75, "y":2}, + {"label":"R27", "x":13.75, "y":2, "w":2.25}, + + {"label":"L30", "x":0, "y":3, "w":1.25}, + {"label":"L31", "x":1.25, "y":3}, + {"label":"L32", "x":2.25, "y":3}, + {"label":"L33", "x":3.25, "y":3}, + {"label":"L34", "x":4.25, "y":3}, + {"label":"L35", "x":5.25, "y":3}, + {"label":"L36", "x":6.25, "y":3}, + + {"label":"R31", "x":8.25, "y":3}, + {"label":"R32", "x":9.25, "y":3}, + {"label":"R33", "x":10.25, "y":3}, + {"label":"R34", "x":11.25, "y":3}, + {"label":"R35", "x":12.25, "y":3}, + {"label":"R36", "x":13.25, "y":3, "w":1.75}, + {"label":"R37", "x":15, "y":3}, + + {"label":"L41", "x":1.5, "y":4}, + {"label":"L42", "x":2.5, "y":4, "w":1.5}, + {"label":"L43", "x":4, "y":4, "w":2.75}, + {"label":"L44", "x":6.75, "y":4}, + + {"label":"R43", "x":8.75, "y":4}, + {"label":"R44", "x":9.75, "y":4, "w":2.25}, + {"label":"R45", "x":12, "y":4, "w":1.5}, + {"label":"R46", "x":13.5, "y":4} + ] + }, + + "LAYOUT_wkl_default": { + "key_count": 61, + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"L06", "x":6, "y":0}, + + {"label":"R00", "x":8, "y":0}, + {"label":"R01", "x":9, "y":0}, + {"label":"R02", "x":10, "y":0}, + {"label":"R03", "x":11, "y":0}, + {"label":"R04", "x":12, "y":0}, + {"label":"R05", "x":13, "y":0}, + {"label":"R07", "x":14, "y":0, "w":2}, + + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + + {"label":"R10", "x":7.5, "y":1}, + {"label":"R11", "x":8.5, "y":1}, + {"label":"R12", "x":9.5, "y":1}, + {"label":"R13", "x":10.5, "y":1}, + {"label":"R14", "x":11.5, "y":1}, + {"label":"R15", "x":12.5, "y":1}, + {"label":"R16", "x":13.5, "y":1}, + {"label":"R17", "x":14.5, "y":1, "w":1.5}, + + {"label":"L20", "x":0, "y":2, "w":1.75}, + {"label":"L21", "x":1.75, "y":2}, + {"label":"L22", "x":2.75, "y":2}, + {"label":"L23", "x":3.75, "y":2}, + {"label":"L24", "x":4.75, "y":2}, + {"label":"L25", "x":5.75, "y":2}, + + {"label":"R21", "x":7.75, "y":2}, + {"label":"R22", "x":8.75, "y":2}, + {"label":"R23", "x":9.75, "y":2}, + {"label":"R24", "x":10.75, "y":2}, + {"label":"R25", "x":11.75, "y":2}, + {"label":"R26", "x":12.75, "y":2}, + {"label":"R27", "x":13.75, "y":2, "w":2.25}, + + {"label":"L31", "x":0, "y":3, "w":2.25}, + {"label":"L32", "x":2.25, "y":3}, + {"label":"L33", "x":3.25, "y":3}, + {"label":"L34", "x":4.25, "y":3}, + {"label":"L35", "x":5.25, "y":3}, + {"label":"L36", "x":6.25, "y":3}, + + {"label":"R31", "x":8.25, "y":3}, + {"label":"R32", "x":9.25, "y":3}, + {"label":"R33", "x":10.25, "y":3}, + {"label":"R34", "x":11.25, "y":3}, + {"label":"R35", "x":12.25, "y":3}, + {"label":"R36", "x":13.25, "y":3, "w":2.75}, + + {"label":"L40", "x":0, "y":4, "w":1.5}, + {"label":"L42", "x":2.5, "y":4, "w":1.5}, + {"label":"L43", "x":4, "y":4, "w":2.75}, + {"label":"L44", "x":6.75, "y":4}, + + {"label":"R43", "x":8.75, "y":4}, + {"label":"R44", "x":9.75, "y":4, "w":2.25}, + {"label":"R45", "x":12, "y":4, "w":1.5}, + {"label":"R47", "x":14.5, "y":4, "w":1.5} ] } } -} \ No newline at end of file +} diff --git a/keyboards/handwired/qc60/keymaps/default/keymap.c b/keyboards/handwired/qc60/keymaps/default/keymap.c index bafaf5058e3..88062d4ed49 100644 --- a/keyboards/handwired/qc60/keymaps/default/keymap.c +++ b/keyboards/handwired/qc60/keymaps/default/keymap.c @@ -24,9 +24,6 @@ extern keymap_config_t keymap_config; // entirely and just use numbers. #define _BASE 0 -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_ansi_default( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ diff --git a/keyboards/handwired/qc60/keymaps/wntrmln/keymap.c b/keyboards/handwired/qc60/keymaps/wntrmln/keymap.c index f99635d5316..f024ddb4b95 100644 --- a/keyboards/handwired/qc60/keymaps/wntrmln/keymap.c +++ b/keyboards/handwired/qc60/keymaps/wntrmln/keymap.c @@ -25,9 +25,6 @@ extern keymap_config_t keymap_config; #define _BASE 0 #define _FN 1 -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define FN MO(_FN) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/handwired/qc60/proto/proto.h b/keyboards/handwired/qc60/proto/proto.h index 191e8150a76..7e7755d0e2d 100644 --- a/keyboards/handwired/qc60/proto/proto.h +++ b/keyboards/handwired/qc60/proto/proto.h @@ -14,8 +14,7 @@ * along with this program. If not, see . */ -#ifndef PROTO_H -#define PROTO_H +#pragma once #include "qc60.h" @@ -26,10 +25,10 @@ /* Split Backspace * {R07, XXX, R05, R04, R03, R02, R01, R00} - * + * * Split Right Shift * {R37, R36, R35, R34, R33, R32, R31, XXX} - * + * * Split Left Shift * {L30, L31, L32, L33, L34, L35, L36, XXX} * @@ -101,14 +100,14 @@ L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R07, \ L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, \ L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R17, R27, \ - L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ + L30, L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ L40, L41, L42, L43, L44, R43, R44, R42, R45, R46, R47 \ ) \ { \ {L00, L01, L02, L03, L04, L05, L06, XXX}, \ {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ - {XXX, L31, L32, L33, L34, L35, L36, XXX}, \ + {L30, L31, L32, L33, L34, L35, L36, XXX}, \ {L40, L41, L42, L43, L44, XXX, XXX, XXX}, \ {R07, XXX, R05, R04, R03, R02, R01, R00}, \ {R17, R16, R15, R14, R13, R12, R11, R10}, \ @@ -118,17 +117,17 @@ } #define LAYOUT_iso_alt( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R07, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, R17, \ - L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27, \ - L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, R43, R44, R45, R46, R47 \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R17, R27, \ + L30, L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, R43, R44, R45, R46, R47 \ ) \ { \ {L00, L01, L02, L03, L04, L05, L06, XXX}, \ {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ - {XXX, L31, L32, L33, L34, L35, L36, XXX}, \ + {L30, L31, L32, L33, L34, L35, L36, XXX}, \ {L40, L41, L42, L43, L44, XXX, XXX, XXX}, \ {R07, XXX, R05, R04, R03, R02, R01, R00}, \ {R17, R16, R15, R14, R13, R12, R11, R10}, \ @@ -196,6 +195,3 @@ {XXX, R36, R35, R34, R33, R32, R31, XXX}, \ {R47, XXX, R45, R44, R43, XXX, XXX, XXX}, \ } - - -#endif diff --git a/keyboards/handwired/qc60/rules.mk b/keyboards/handwired/qc60/rules.mk index e61b18b00cc..b487dd96ecd 100644 --- a/keyboards/handwired/qc60/rules.mk +++ b/keyboards/handwired/qc60/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/reddot/config.h b/keyboards/handwired/reddot/config.h index 15f11429717..4d908041b15 100755 --- a/keyboards/handwired/reddot/config.h +++ b/keyboards/handwired/reddot/config.h @@ -46,7 +46,6 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B7, D0, D1, D2, D3, C6, C7, D5, D4, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 } #define UNUSED_PINS - /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW @@ -54,14 +53,12 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ @@ -100,11 +97,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/reddot/info.json b/keyboards/handwired/reddot/info.json new file mode 100644 index 00000000000..1fcc8677e86 --- /dev/null +++ b/keyboards/handwired/reddot/info.json @@ -0,0 +1,108 @@ +{ + "keyboard_name": "handwired/reddot", + "url": "", + "maintainer": "qmk", + "width": 20.5, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"k00 (Esc)", "x":0, "y":0}, + {"label":"k01 (F1)", "x":1, "y":0}, + {"label":"k02 (F2)", "x":2, "y":0}, + {"label":"k03 (F3)", "x":3, "y":0}, + {"label":"k04 (F4)", "x":4, "y":0}, + {"label":"k05 (F5)", "x":5, "y":0}, + {"label":"k06 (Tab)", "x":6, "y":0, "w":2}, + {"label":"k07 (Caps Lock)", "x":8, "y":0}, + {"label":"k08 (F6)", "x":9, "y":0}, + {"label":"k09 (F7)", "x":10, "y":0}, + {"label":"k0A (F8)", "x":11, "y":0}, + {"label":"k0B (F9)", "x":12, "y":0}, + {"label":"k0C (F10)", "x":13, "y":0}, + {"label":"k0D (F11)", "x":14, "y":0}, + {"label":"k0E (F12)", "x":15, "y":0}, + {"label":"k10 (Function)", "x":16.5, "y":0}, + {"label":"k11 (Keypad /)", "x":17.5, "y":0}, + {"label":"k12 (Keypad *)", "x":18.5, "y":0}, + {"label":"k13 (Keypad -)", "x":19.5, "y":0}, + + {"label":"k20 (Left Alt)", "x":0, "y":1}, + {"label":"k21 (1 / FR Ampersand)", "x":1, "y":1}, + {"label":"k22 (2 / FR É)", "x":2, "y":1}, + {"label":"k23 (3 / FR Quote)", "x":3, "y":1}, + {"label":"k24 (4 / FR Apostrophe)", "x":4, "y":1}, + {"label":"k25 (5 / FR Left Parenthesis)", "x":5, "y":1}, + {"label":"k26 (Backspace)", "x":6, "y":1, "w":2}, + {"label":"k27 (Delete)", "x":8, "y":1}, + {"label":"k28 (6 / FR Minus)", "x":9, "y":1}, + {"label":"k29 (7 / FR È)", "x":10, "y":1}, + {"label":"k2A (8 / FR Underscore)", "x":11, "y":1}, + {"label":"k2B (9 / FR Ç)", "x":12, "y":1}, + {"label":"k2C (0 / FR À)", "x":13, "y":1}, + {"label":"k2D (Minus / FR Right Parenthesis)", "x":14, "y":1}, + {"label":"k2E (Equals / FR Equals)", "x":15, "y":1}, + {"label":"k30 (Insert)", "x":16.5, "y":1}, + {"label":"k31 (Home)", "x":17.5, "y":1}, + {"label":"k32 (Page Up)", "x":18.5, "y":1}, + + {"label":"k40 (GUI)", "x":0, "y":2}, + {"label":"k41 (Q / FR A)", "x":1, "y":2}, + {"label":"k42 (W / FR Z)", "x":2, "y":2}, + {"label":"k43 (E)", "x":3, "y":2}, + {"label":"k44 (R)", "x":4, "y":2}, + {"label":"k45 (T)", "x":5, "y":2}, + {"label":"k46 (Shift)", "x":6, "y":2, "h":2}, + {"label":"k66 (Enter)", "x":7, "y":2, "h":2}, + {"label":"k47 (Enter)", "x":8, "y":2, "h":2}, + {"label":"k48 (Y)", "x":9, "y":2}, + {"label":"k49 (U)", "x":10, "y":2}, + {"label":"k4A (I)", "x":11, "y":2}, + {"label":"k4B (O)", "x":12, "y":2}, + {"label":"k4C (P)", "x":13, "y":2}, + {"label":"k4D (Left Bracket / FR Circumflex)", "x":14, "y":2}, + {"label":"k4E (Right Bracket / FR Dollar)", "x":15, "y":2}, + {"label":"k50 (Delete)", "x":16.5, "y":2}, + {"label":"k51 (End)", "x":17.5, "y":2}, + {"label":"k52 (Page Down)", "x":18.5, "y":2}, + {"label":"k53 (Keypad +)", "x":19.5, "y":1, "h":2}, + + {"label":"k60 (Ctrl)", "x":0, "y":3}, + {"label":"k61 (A / FR Q)", "x":1, "y":3}, + {"label":"k62 (S)", "x":2, "y":3}, + {"label":"k63 (D)", "x":3, "y":3}, + {"label":"k64 (F)", "x":4, "y":3}, + {"label":"k65 (G)", "x":5, "y":3}, + {"label":"k68 (H)", "x":9, "y":3}, + {"label":"k69 (J)", "x":10, "y":3}, + {"label":"k6A (K)", "x":11, "y":3}, + {"label":"k6B (L)", "x":12, "y":3}, + {"label":"k6C (Semicolon / FR M)", "x":13, "y":3}, + {"label":"k6D (Quote / FR Ù)", "x":14, "y":3}, + {"label":"k6E (ISO Hash / FR Asterisk)", "x":15, "y":3}, + {"label":"k70 (Keypad 1)", "x":16.5, "y":3}, + {"label":"k71 (Up)", "x":17.5, "y":3}, + {"label":"k72 (Keypad 3)", "x":18.5, "y":3}, + + {"label":"k80 (ISO Backslash / FR Less Than)", "x":0, "y":4}, + {"label":"k81 (Z / FR W)", "x":1, "y":4}, + {"label":"k82 (X)", "x":2, "y":4}, + {"label":"k83 (C)", "x":3, "y":4}, + {"label":"k84 (V)", "x":4, "y":4}, + {"label":"k85 (B)", "x":5, "y":4}, + {"label":"k86 (Space)", "x":6, "y":4, "w":2}, + {"label":"k88 (Space)", "x":8, "y":4, "w":2}, + {"label":"k89 (N)", "x":10, "y":4}, + {"label":"k8A (M / FR Comma)", "x":11, "y":4}, + {"label":"k8B (Comma / FR Semicolon)", "x":12, "y":4}, + {"label":"k8C (Period / Colon)", "x":13, "y":4}, + {"label":"k8D (Slash / FR Exclaim)", "x":14, "y":4}, + {"label":"k8E (Right Alt / FR AltGr)", "x":15, "y":4}, + {"label":"k90 (Left)", "x":16.5, "y":4}, + {"label":"k91 (Down)", "x":17.5, "y":4}, + {"label":"k92 (Right)", "x":18.5, "y":4}, + {"label":"k93 (Keypad Enter)", "x":19.5, "y":3, "h":2} + ] + } + } +} diff --git a/keyboards/handwired/reddot/keymaps/default/keymap.c b/keyboards/handwired/reddot/keymaps/default/keymap.c old mode 100755 new mode 100644 index 44ee2ce5105..246a03b4d79 --- a/keyboards/handwired/reddot/keymaps/default/keymap.c +++ b/keyboards/handwired/reddot/keymaps/default/keymap.c @@ -1,29 +1,22 @@ -#include "reddot.h" -#include "../../../../../quantum/keymap_extras/keymap_french.h" +#include QMK_KEYBOARD_H +#include "keymap_french.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_FN0, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS,\ - KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_INSERT, KC_HOME, KC_PGUP,\ - KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_DELETE, KC_END, KC_PGDOWN, KC_KP_PLUS,\ - KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_KP_1, KC_UP, KC_KP_3,\ - FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, NO_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), - - [1] = KEYMAP( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_FN0, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS,\ - KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_7, KC_8, KC_9,\ - KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_4, KC_5, KC_6, KC_KP_PLUS,\ - KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_1, KC_2, KC_3,\ - FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, NO_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), -}; + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TG(1), KC_PSLS, KC_PAST, KC_PMNS, \ + KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPC, KC_DEL, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_INS, KC_HOME, KC_PGUP, \ + KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_DEL, KC_END, KC_PGDN, KC_PPLS, \ + KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_P1, KC_UP, KC_P3, \ + FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPC, KC_SPC, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, KC_ALGR, KC_LEFT, KC_DOWN, KC_RGHT, KC_PENT \ + ), + [1] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPC, KC_DEL, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_7, KC_8, KC_9, \ + KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_4, KC_5, KC_6, KC_PPLS, \ + KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_1, KC_2, KC_3, \ + FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPC, KC_SPC, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, KC_ALGR, KC_LEFT, KC_DOWN, KC_RGHT, KC_PENT \ + ), -const uint16_t PROGMEM fn_actions[] = { - ACTION_LAYER_TOGGLE(1), }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; - diff --git a/keyboards/handwired/reddot/readme.md b/keyboards/handwired/reddot/readme.md index 8cdbb47d663..27c8b54d605 100755 --- a/keyboards/handwired/reddot/readme.md +++ b/keyboards/handwired/reddot/readme.md @@ -1,24 +1,14 @@ -## RedDot Specific Info ## +# RedDot +An ortholinear compact fullsize keyboard configured for French AZERTY layout. -## Quantum MK Firmware +- [Layout](http://www.keyboard-layout-editor.com/##@_plate:true%3B&@_sm=cherry&sb=cherry&st=MX1A-L1xx%3B&=Esc&=F1&=F2&=F3&=F4&=F5&_w:2%3B&=Tab&=Caps%20Lock&=F6&=F7&=F8&=F9&=F10&=F11&=F12&_x:0.5%3B&=Fn&=%2F%2F&=*&=-%3B&@=Alt&=1%0A%2F&&=2%0A%C3%A9%0A%0A~&=3%0A%22%0A%0A%23&=4%0A'%0A%0A%7B&=5%0A(%0A%0A%5B&_w:2%3B&=Back&=Del&=6%0A-%0A%0A%7C&=7%0A%C3%A8%0A%0A%60&=8%0A%2F_%0A%0A%5C&=9%0A%C3%A7%0A%0A%5E&=0%0A%C3%A0%0A%0A%2F@&=%C2%B0%0A)%0A%0A%5D&=+%0A%2F=%0A%0A%7D&_x:0.5%3B&=Insert&=Home&=Page%20Up&_h:2%3B&=+%3B&@=Win&=A&=Z&=E&=R&=T&_h:2%3B&=Shift&_h:2%3B&=Enter&_h:2%3B&=Enter&=Y&=U&=I&=O&=P&=%C2%A8%0A%5E&=%C2%A3%0A$&_x:0.5%3B&=Delete&=End&=Page%20Down%3B&@=Ctrl&=Q&=S&=D&=F&=G&_x:3%3B&=H&=J&=K&=L&=M&=%25%0A%C3%B9&=%C2%B5%0A*&_x:0.5%3B&=1%0AEnd&=Up&=3%0APgDn&_h:2%3B&=Enter%3B&@=%3E%0A%3C&=W&=X&=C&=V&=B&_w:2%3B&=Space&_w:2%3B&=Space&=N&=%3F%0A,&=.%0A%2F%3B&=%2F%2F%0A%2F:&=%C2%A7%0A!&=Alt%20Gr&_x:0.5%3B&=Left&=Down&=Right) -For the full Quantum feature list, see [the parent README.md](/readme.md). +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: RedDot handwired -## Building +Make example for this keyboard (after setting up your build environment): -Download or clone the whole firmware and navigate to the keyboard/reddot folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + make handwired/reddot:default -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default -To build with the default keymap, simply run `make`. - -### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top README.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: -``` -$ make KEYMAP=[default|jack|] -``` -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/reddot/reddot.h b/keyboards/handwired/reddot/reddot.h index f0c4be55718..a763f2ddc36 100755 --- a/keyboards/handwired/reddot/reddot.h +++ b/keyboards/handwired/reddot/reddot.h @@ -1,20 +1,17 @@ -#ifndef REDDOT_H -#define REDDOT_H +#pragma once #include "quantum.h" -#define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k10, k11, k12, k13, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k30, k31, k32, \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k50, k51, k52, k53, \ - k60, k61, k62, k63, k64, k65, k66, k68, k69, k6A, k6B, k6C, k6D, k6E, k70, k71, k72, \ - k80, k81, k82, k83, k84, k85, k86, k88, k89, k8A, k8B, k8C, k8D, k8E, k90, k91, k92, k93\ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k10, k11, k12, k13, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k30, k31, k32, \ + k40, k41, k42, k43, k44, k45, k46, k66, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k50, k51, k52, k53, \ + k60, k61, k62, k63, k64, k65, k68, k69, k6A, k6B, k6C, k6D, k6E, k70, k71, k72, \ + k80, k81, k82, k83, k84, k85, k86, k88, k89, k8A, k8B, k8C, k8D, k8E, k90, k91, k92, k93 \ ) { \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k10, k11, k12, k13 }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k30, k31, k32, KC_NO }, \ - { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k50, k51, k52, k53 }, \ - { k60, k61, k62, k63, k64, k65, k66, KC_NO, k68, k69, k6A, k6B, k6C, k6D, k6E, k70, k71, k72, KC_NO }, \ - { k80, k81, k82, k83, k84, k85, k86, KC_NO, k88, k89, k8A, k8B, k8C, k8D, k8E, k90, k91, k92, k93 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k10, k11, k12, k13 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k30, k31, k32, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k50, k51, k52, k53 }, \ + { k60, k61, k62, k63, k64, k65, k66, KC_NO, k68, k69, k6A, k6B, k6C, k6D, k6E, k70, k71, k72, KC_NO }, \ + { k80, k81, k82, k83, k84, k85, k86, KC_NO, k88, k89, k8A, k8B, k8C, k8D, k8E, k90, k91, k92, k93 } \ } - -#endif diff --git a/keyboards/handwired/reddot/rules.mk b/keyboards/handwired/reddot/rules.mk index 00ca06dd40e..8afe6fc63e8 100755 --- a/keyboards/handwired/reddot/rules.mk +++ b/keyboards/handwired/reddot/rules.mk @@ -1,5 +1,4 @@ - -#MCU = at90usb1287 +# MCU name MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/retro_refit/config.h b/keyboards/handwired/retro_refit/config.h index f2194e550cc..1d4f1e075f6 100644 --- a/keyboards/handwired/retro_refit/config.h +++ b/keyboards/handwired/retro_refit/config.h @@ -47,14 +47,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 0 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - /* Force NKRO Mode - If forced on, must be disabled via magic key (default = LShift+RShift+N) */ #define FORCE_NKRO @@ -64,11 +63,6 @@ along with this program. If not, see . * if your keyboard/keypad is missing keys and you want magic key support. */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/retro_refit/info.json b/keyboards/handwired/retro_refit/info.json new file mode 100644 index 00000000000..44ae97cd125 --- /dev/null +++ b/keyboards/handwired/retro_refit/info.json @@ -0,0 +1,95 @@ +{ + "keyboard_name": "handwired/retro_refit", + "url": "", + "maintainer": "qmk", + "width": 15.5, + "height": 6.5, + "layouts": { + "LAYOUT": { + "key_count": 81, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"Num Lock", "x":11.5, "y":0}, + {"label":"Scroll Lock", "x":12.5, "y":0}, + {"label":"Print Screen", "x":13.5, "y":0}, + {"label":"Pause", "x":14.5, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":1.5}, + {"label":"Home", "x":14.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"Page Up", "x":14.5, "y":2.5}, + {"label":"Ctrl", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":1.75}, + {"label":"Page Down", "x":14.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.25}, + {"label":"Up", "x":13.5, "y":4.5}, + {"label":"End", "x":14.5, "y":4.5}, + {"label":"Alt", "x":0, "y":5.5, "w":1.25}, + {"label":"Caps Lock", "x":1.25, "y":5.5, "w":1.25}, + {"label":"\\", "x":2.5, "y":5.5}, + {"label":"Space", "x":3.5, "y":5.5, "w":7}, + {"label":"Insert", "x":10.5, "y":5.5}, + {"label":"Delete", "x":11.5, "y":5.5}, + {"label":"Left", "x":12.5, "y":5.5}, + {"label":"Down", "x":13.5, "y":5.5}, + {"label":"Right", "x":14.5, "y":5.5} + ] + } + } +} diff --git a/keyboards/handwired/retro_refit/keymaps/default/keymap.c b/keyboards/handwired/retro_refit/keymaps/default/keymap.c index 598541a05be..2f9f28478ec 100644 --- a/keyboards/handwired/retro_refit/keymaps/default/keymap.c +++ b/keyboards/handwired/retro_refit/keymaps/default/keymap.c @@ -1,31 +1,12 @@ - -#include "retro_refit.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = - KEYMAP( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, NLCK, SLCK, PSCR, PAUS, \ - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, HOME, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, PGUP, \ - BSLS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, PGDN, \ - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, END, \ - LCTL, LGUI, LALT, SPC, INS, DEL, LEFT, DOWN, RGHT), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; + [0] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_SLCK, KC_PSCR, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGUP, \ + KC_BSLS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_INS, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), }; diff --git a/keyboards/handwired/retro_refit/readme.md b/keyboards/handwired/retro_refit/readme.md index 9f10edf9fc3..8dfca7b10b3 100644 --- a/keyboards/handwired/retro_refit/readme.md +++ b/keyboards/handwired/retro_refit/readme.md @@ -1,60 +1,42 @@ -retro_refit keyboard firmware -====================== - -## Keyboard Info +# retro_refit The retro refit keyboard used a Teensy to replace the original controller on a 386 "laptop". -http://imgur.com/a/08Fyj +[Image Gallery](https://imgur.com/a/08Fyj) -This keyboard uses a KEYMAP macro that is a great example of using a non-standard row-column matrix. The keyboard in question had 11 rows and 8 columns, but the rows were not all horizontal, and the columns were not all vertical. For example, row 2 contained "Print Screen", "N", "M", ",", ".", "/", "Right Shift", and"Left Alt". Column 0 contained "F6", "7", "O", "'", "Q", "D", "B", "Left Alt", "Up Arrow", and "Down Arrow". +This keyboard uses a LAYOUT macro that is a great example of using a non-standard row-column matrix. The keyboard in question had 11 rows and 8 columns, but the rows were not all horizontal, and the columns were not all vertical. For example, row 2 contained "Print Screen", "N", "M", ",", ".", "/", "Right Shift", and"Left Alt". Column 0 contained "F6", "7", "O", "'", "Q", "D", "B", "Left Alt", "Up Arrow", and "Down Arrow". -The macro makes programming the keys easier and in a more straight-forward manner because it realigns the keys into a 6x15 sensible keyboard layout instead of the obtuse 11x8 matrix. Each Kxy corrisponds to a key in row x column y. +The macro makes programming the keys easier and in a more straight-forward manner because it realigns the keys into a 6x15 sensible keyboard layout instead of the obtuse 11x8 matrix. Each Kxy corresponds to a key in row x column y. ``` -#define KEYMAP( \ - K77, K05, K04, K03, K02, K01, K00, KA7, KA6, KA5, KA4, KA3, KA2, K11, K94, \ - K27, K76, K75, K74, K73, K72, K71, K70, K67, K66, K65, K64, K63, K62, KA1, \ - K61, K60, K57, K56, K55, K54, K53, K52, K51, K50, K47, K46, K45, K97, \ - K43, K42, K41, K40, K37, K36, K35, K34, K33, K32, K31, K30, K44, K87, \ - K26, K24, K23, K22, K21, K20, K17, K16, K15, K14, K13, K12, KA0, K91, \ - K10, K06, K25, K07, K86, K85, K95, K90, K93 \ +#define LAYOUT( \ + K77, K05, K04, K03, K02, K01, K00, KA7, KA6, KA5, KA4, KA3, KA2, K11, K94, \ + K27, K76, K75, K74, K73, K72, K71, K70, K67, K66, K65, K64, K63, K62, KA1, \ + K61, K60, K57, K56, K55, K54, K53, K52, K51, K50, K47, K46, K45, K97, \ + K43, K42, K41, K40, K37, K36, K35, K34, K33, K32, K31, K30, K44, K87, \ + K26, K24, K23, K22, K21, K20, K17, K16, K15, K14, K13, K12, KA0, K91, \ + K10, K06, K25, K07, K86, K85, K95, K90, K93 \ ) { \ -{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, }, \ -{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, }, \ -{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, }, \ -{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, }, \ -{ KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, }, \ -{ KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, }, \ -{ KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, }, \ -{ KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77, }, \ -{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K85, KC_##K86, KC_##K87, }, \ -{ KC_##K90, KC_##K91, KC_NO, KC_##K93, KC_##K94, KC_##K95, KC_NO, KC_##K97, }, \ -{ KC_##KA0, KC_##KA1, KC_##KA2, KC_##KA3, KC_##KA4, KC_##KA5, KC_##KA6, KC_##KA7, } \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67 }, \ + { K70, K71, K72, K73, K74, K75, K76, K77 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K85, K86, K87 }, \ + { K90, K91, KC_NO, K93, K94, K95, KC_NO, K97 }, \ + { KA0, KA1, KA2, KA3, KA4, KA5, KA6, KA7 } \ } ``` -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/readme.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/retro_refit folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. - -Depending on which keymap you would like to use, you will have to compile slightly differently. +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: Leading Edge D3 386 keyboard, Teensy -### Default -To build with the default keymap, simply run `make default`. +Make example for this keyboard (after setting up your build environment): -### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with a keymap like this: - -``` -$ make [default|jack|] -``` + make handwired/retro_refit:default -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/retro_refit/retro_refit.h b/keyboards/handwired/retro_refit/retro_refit.h index 109acdc399e..ad1c567a843 100644 --- a/keyboards/handwired/retro_refit/retro_refit.h +++ b/keyboards/handwired/retro_refit/retro_refit.h @@ -1,38 +1,35 @@ -#ifndef RETRO_REFIT_H -#define RETRO_REFIT_H +#pragma once #include "quantum.h" -// This macro is an example of using a non-standard row-column matrix. The -// keyboard in question had 11 rows and 8 columns, but the rows were not all -// horizontal, and the columns were not all vertical. For example, row 2 +// This macro is an example of using a non-standard row-column matrix. The +// keyboard in question had 11 rows and 8 columns, but the rows were not all +// horizontal, and the columns were not all vertical. For example, row 2 // contained "Print Screen", "N", "M", ",", ".", "/", "Right Shift", and -// "Left Alt". Column 0 contained "F6", "7", "O", "'", "Q", "D", "B", +// "Left Alt". Column 0 contained "F6", "7", "O", "'", "Q", "D", "B", // "Left Alt", "Up Arrow", and "Down Arrow". // // The macro makes programming the keys easier and in a more straight-forward -// manner because it realigns the keys into a 6x15 sensible keyboard layout +// manner because it realigns the keys into a 6x15 sensible keyboard layout // instead of the obtuse 11x8 matrix. -#define KEYMAP( \ - K77, K05, K04, K03, K02, K01, K00, KA7, KA6, KA5, KA4, KA3, KA2, K11, K94, \ - K27, K76, K75, K74, K73, K72, K71, K70, K67, K66, K65, K64, K63, K62, KA1, \ - K61, K60, K57, K56, K55, K54, K53, K52, K51, K50, K47, K46, K45, K97, \ - K43, K42, K41, K40, K37, K36, K35, K34, K33, K32, K31, K30, K44, K87, \ - K26, K24, K23, K22, K21, K20, K17, K16, K15, K14, K13, K12, KA0, K91, \ - K10, K06, K25, K07, K86, K85, K95, K90, K93 \ +#define LAYOUT( \ + K77, K05, K04, K03, K02, K01, K00, KA7, KA6, KA5, KA4, KA3, KA2, K11, K94, \ + K27, K76, K75, K74, K73, K72, K71, K70, K67, K66, K65, K64, K63, K62, KA1, \ + K61, K60, K57, K56, K55, K54, K53, K52, K51, K50, K47, K46, K45, K97, \ + K43, K42, K41, K40, K37, K36, K35, K34, K33, K32, K31, K30, K44, K87, \ + K26, K24, K23, K22, K21, K20, K17, K16, K15, K14, K13, K12, KA0, K91, \ + K10, K06, K25, K07, K86, K85, K95, K90, K93 \ ) { \ -{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, }, \ -{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, }, \ -{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, }, \ -{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, }, \ -{ KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, }, \ -{ KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, }, \ -{ KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, }, \ -{ KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77, }, \ -{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K85, KC_##K86, KC_##K87, }, \ -{ KC_##K90, KC_##K91, KC_NO, KC_##K93, KC_##K94, KC_##K95, KC_NO, KC_##K97, }, \ -{ KC_##KA0, KC_##KA1, KC_##KA2, KC_##KA3, KC_##KA4, KC_##KA5, KC_##KA6, KC_##KA7, } \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67 }, \ + { K70, K71, K72, K73, K74, K75, K76, K77 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K85, K86, K87 }, \ + { K90, K91, KC_NO, K93, K94, K95, KC_NO, K97 }, \ + { KA0, KA1, KA2, KA3, KA4, KA5, KA6, KA7 } \ } - -#endif \ No newline at end of file diff --git a/keyboards/handwired/retro_refit/rules.mk b/keyboards/handwired/retro_refit/rules.mk index 98aa19e6b11..2884ef2cb09 100644 --- a/keyboards/handwired/retro_refit/rules.mk +++ b/keyboards/handwired/retro_refit/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/rs60/README.md b/keyboards/handwired/rs60/README.md new file mode 100644 index 00000000000..07c967e276b --- /dev/null +++ b/keyboards/handwired/rs60/README.md @@ -0,0 +1,27 @@ +# rs60: Handwired Slim Preonic Clone + +I wanted a preonic layout but with a very low profile. As Jack is still working on the Preonic PCB for Kailh Choc switches, I figured I could try to handwire one myself. It's my first custom keyboard, so I had a lot to learn. + +First I designed the case in fusion 360. I wanted to build it using acrylic, constrained myself to standard acrylic sheet thickness. + +![](https://imgur.com/NscS7Rd.jpg) + +You can download the model [here](https://a360.co/2OqiKLm). + +To test my design I 3D printed the parts. + +![](https://imgur.com/MSF7zLS.jpg) + +The result was encouraging, so I decided to build a prototype out of the printed plates using Kailh Choc brown switches. I tried to make the handwiring job as flat as possible so it can fit in my design. + +![](https://i.imgur.com/67yZx0V.jpg) +![](https://i.imgur.com/ft72Cgj.jpg) + +I designed switch plate and the middle plates so that they would be glued together. The middle plate has inserts to attach the bottom plate using m8 screws. + +![](https://i.imgur.com/GstTohI.jpg) + +The end result is not too bad, but there is a few things I would do differently. Gluing 3D printed plates wasn't a good idea. The switch layer is so thin, that it bends when all the switches are slotted. As a result, the keyboard is not entirely flat. I will replace the bottom plate by a metal one so I get more weight and rigidity. + +Even with acrylic, I think I will have the same issue. I might switch to screws + bolts that go all the way through. + diff --git a/keyboards/handwired/rs60/config.h b/keyboards/handwired/rs60/config.h new file mode 100644 index 00000000000..371150a79a8 --- /dev/null +++ b/keyboards/handwired/rs60/config.h @@ -0,0 +1,47 @@ +/* +Copyright 2018 QMK Contributors + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4260 +#define DEVICE_VER 0x0001 +#define MANUFACTURER rs +#define PRODUCT rs60 +#define DESCRIPTION Preonic clone based on pro micro + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B5, B6, B4, B2, E6 } +#define MATRIX_COL_PINS { C6, D4, D0, D1, D2, D3, F4, F5, F6, F7, B1, B3} +#define UNUSED_PINS { } + +#define QMK_ESC_OUTPUT C6 +#define QMK_ESC_INPUT B4 +#define QMK_LED B0 +// #define QMK_SPEAKER C6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* key combination for command */ +#define IS_COMMAND() ( \ + false \ +) diff --git a/keyboards/handwired/rs60/keymaps/default/keymap.c b/keyboards/handwired/rs60/keymaps/default/keymap.c new file mode 100644 index 00000000000..9fea769d05c --- /dev/null +++ b/keyboards/handwired/rs60/keymaps/default/keymap.c @@ -0,0 +1,207 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, \ + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/handwired/rs60/keymaps/default/readme.md b/keyboards/handwired/rs60/keymaps/default/readme.md new file mode 100644 index 00000000000..e911968dd96 --- /dev/null +++ b/keyboards/handwired/rs60/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default Preonic layout - largely based on the Planck's \ No newline at end of file diff --git a/keyboards/handwired/rs60/rs60.c b/keyboards/handwired/rs60/rs60.c new file mode 100644 index 00000000000..f748740cbe7 --- /dev/null +++ b/keyboards/handwired/rs60/rs60.c @@ -0,0 +1,18 @@ +/* +Copyright 2018 QMK Community + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "rs60.h" diff --git a/keyboards/handwired/rs60/rs60.h b/keyboards/handwired/rs60/rs60.h new file mode 100644 index 00000000000..f2113f05c3d --- /dev/null +++ b/keyboards/handwired/rs60/rs60.h @@ -0,0 +1,36 @@ +/* +Copyright 2018 QMK Community + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ +} + +#define LAYOUT_ortho_5x12 LAYOUT diff --git a/keyboards/handwired/rs60/rules.mk b/keyboards/handwired/rs60/rules.mk new file mode 100644 index 00000000000..7b4ec69d0d3 --- /dev/null +++ b/keyboards/handwired/rs60/rules.mk @@ -0,0 +1,61 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +BOOTLOADER = qmk-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +LAYOUTS = ortho_5x12 + +# Boot Section Size in *bytes* +#OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Custom backlighting code is used, so this should not be enabled +AUDIO_ENABLE = no # This can be enabled if a speaker is connected to the expansion port. Not compatible with RGBLIGHT below +RGBLIGHT_ENABLE = no # This can be enabled if a ws2812 strip is connected to the expansion port. + diff --git a/keyboards/handwired/space_oddity/config.h b/keyboards/handwired/space_oddity/config.h index 46d854099cb..09975cfc8f2 100644 --- a/keyboards/handwired/space_oddity/config.h +++ b/keyboards/handwired/space_oddity/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -36,7 +35,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -44,11 +43,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 @@ -56,5 +50,3 @@ #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #endif - -#endif diff --git a/keyboards/handwired/space_oddity/info.json b/keyboards/handwired/space_oddity/info.json new file mode 100644 index 00000000000..37e24b33c48 --- /dev/null +++ b/keyboards/handwired/space_oddity/info.json @@ -0,0 +1,78 @@ +{ + "keyboard_name": "Space Oddity", + "url": "", + "maintainer": "qmk", + "width": 14, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Macro 0", "x":0, "y":0, "w":2}, + {"label":"Macro 1", "x":2, "y":0, "w":2}, + {"label":"Macro 2", "x":4, "y":0, "w":2}, + {"label":"Macro 3", "x":6, "y":0, "w":2}, + {"label":"Macro 4", "x":8, "y":0, "w":2}, + {"label":"Dynamic Macro 1", "x":10, "y":0, "w":2}, + {"label":"Dynamic Macro 2", "x":12, "y":0, "w":2}, + {"label":"~", "x":0, "y":1, "w":2}, + {"label":"!", "x":2, "y":1}, + {"label":"@", "x":3, "y":1}, + {"label":"#", "x":4, "y":1}, + {"label":"$", "x":5, "y":1}, + {"label":"%", "x":6, "y":1}, + {"label":"^", "x":7, "y":1}, + {"label":"&", "x":8, "y":1}, + {"label":"*", "x":9, "y":1}, + {"label":"(", "x":10, "y":1}, + {"label":")", "x":11, "y":1}, + {"label":"Backspace", "x":12, "y":1, "w":2}, + {"label":"Tab", "x":0, "y":2, "w":2}, + {"label":"Q", "x":2, "y":2}, + {"label":"W", "x":3, "y":2}, + {"label":"E", "x":4, "y":2}, + {"label":"R", "x":5, "y":2}, + {"label":"T", "x":6, "y":2}, + {"label":"Y", "x":7, "y":2}, + {"label":"U", "x":8, "y":2}, + {"label":"I", "x":9, "y":2}, + {"label":"O", "x":10, "y":2}, + {"label":"P", "x":11, "y":2}, + {"label":"_", "x":12, "y":2, "w":2}, + {"label":"Esc (Ctrl)", "x":0, "y":3, "w":2}, + {"label":"A", "x":2, "y":3}, + {"label":"S", "x":3, "y":3}, + {"label":"D", "x":4, "y":3}, + {"label":"F", "x":5, "y":3}, + {"label":"G", "x":6, "y":3}, + {"label":"H", "x":7, "y":3}, + {"label":"J", "x":8, "y":3}, + {"label":"K", "x":9, "y":3}, + {"label":"L", "x":10, "y":3}, + {"label":":", "x":11, "y":3}, + {"label":"\"", "x":12, "y":3, "w":2}, + {"label":"Caps Lock (Shift)", "x":0.25, "y":4, "w":1.75}, + {"label":"Z", "x":2, "y":4}, + {"label":"X", "x":3, "y":4}, + {"label":"C", "x":4, "y":4}, + {"label":"V", "x":5, "y":4}, + {"label":"B", "x":6, "y":4}, + {"label":"N", "x":7, "y":4}, + {"label":"M", "x":8, "y":4}, + {"label":"<", "x":9, "y":4}, + {"label":">", "x":10, "y":4}, + {"label":"?", "x":11, "y":4}, + {"label":"Enter (Shift)", "x":12, "y":4, "w":1.75}, + {"label":"MO(2)", "x":1, "y":5}, + {"label":"MO(1)", "x":2, "y":5}, + {"label":"GUI", "x":3, "y":5}, + {"label":"Alt", "x":4, "y":5}, + {"label":"Ctrl", "x":5, "y":5, "w":2}, + {"label":"Space", "x":7, "y":5, "w":2}, + {"label":"Left (Alt)", "x":9, "y":5}, + {"label":"Right (Hyper)", "x":10, "y":5}, + {"label":"Up (MO(1))", "x":11, "y":5}, + {"label":"Down (MO(2))", "x":12, "y":5} + ] + } + } +} diff --git a/keyboards/handwired/space_oddity/keymaps/default/keymap.c b/keyboards/handwired/space_oddity/keymaps/default/keymap.c index 4230cdf8dbd..e7836353ecb 100644 --- a/keyboards/handwired/space_oddity/keymaps/default/keymap.c +++ b/keyboards/handwired/space_oddity/keymaps/default/keymap.c @@ -15,12 +15,16 @@ along with this program. If not, see . */ -#include "space_oddity.h" +#include QMK_KEYBOARD_H -// Planck keycodes needed for dynamic macros. -enum planck_keycodes { +// Custom keycodes needed for dynamic macros. +enum custom_keycodes { QWERTY = SAFE_RANGE, + PAIR_PR, + PAIR_BR, + PAIR_CB, + LAMBDA, DYNAMIC_MACRO_RANGE, }; @@ -34,15 +38,6 @@ enum { #include "dynamic_macro.h" -#define MOUSE_LAYER 2 - -// Toggle MOUSE_LAYER. Additional layers can be added for additional layouts or other special functions. -const uint16_t PROGMEM fn_actions[] = { - - [2] = ACTION_LAYER_TOGGLE(MOUSE_LAYER), - -}; - // Tap dance actions - double tap for Caps Lock. qk_tap_dance_action_t tap_dance_actions[] = { @@ -52,141 +47,105 @@ qk_tap_dance_action_t tap_dance_actions[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Here is an ASCII version of the base layout. Note that Dynamic Macros 1 and 2 are considered Macro 5 and Macro 6. - - ___________________________________________________________________________________ - | | | | | | Dynamic | Dynamic | - | Macro 0 | Macro 1 | Macro 2 | Macro 3 | Macro 4 | Macro 1 | Macro 2 | - |___________|___________|___________|___________|___________|___________|___________| - | | | | | | | | | | | | | - | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP | - |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| - | | | | | | | | | | | | | - | TAB | Q | W | E | R | T | Y | U | I | O | P | - | - |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| - | | | | | | | | | | | | | - |ESC (CTL_T)| A | S | D | F | G | H | J | K | L | ; | ' | - |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| - | | | | | | | | | | | | | - | SHFT | Z | X | C | V | B | N | M | , | . | / |SHFT(ENT)| - |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________| - | | | | | | | ALT | HYP | LT 1| LT 2| - | M2 | M1 | GUI | ALT | CTRL | SPC |(LFT)|(RGT)| (UP)|(DWN)| - |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____| - */ - - KEYMAP( - M(0), M(1), M(2), M(3), M(4), DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - TD(SFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), - MO(2), MO(1), KC_LGUI, KC_RALT, KC_LCTRL, KC_SPC, ALT_T(KC_LEFT), ALL_T(KC_RGHT), LT(1, KC_UP), LT(2, KC_DOWN)), - - /* Function layer. - Blank keys correspond to the KC_TRNS keycode. - - ___________________________________________________________________________________ - | | | | | | DYN REC | DYN REC | - | Macro 7 | | | | | 1 | 2 | - |___________|___________|___________|___________|___________|___________|___________| - | DYN REC | | | | | | | | | | | | - | STOP | F1 | F2 | F3 | F4 | F5 | [ | 7 | 8 | 9 | * | DEL | - |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| - | | | | | | | | | | | | | - | | F6 | F7 | F8 | F9 | F10 | ] | 4 | 5 | 6 | + | = | - |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| - | | | | | | | | | | | | | - | \ | F11 | F12 | F13 | F14 | F15 | { | 1 | 2 | 3 | - | | | - |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| - | | | | | | | | | | | | | - | | F16 | F17 | F18 | F19 | F20 | } | 0 | , | . | / | | - |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________| - | | | | | | | | | | | - | | | | | | | | | | | - |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____| - + /* Here is an ASCII version of the base layout. Note that Dynamic Macros 1 and 2 are considered Macro 5 and Macro 6. + * + * ___________________________________________________________________________________ + * | | | | | | Dynamic | Dynamic | + * | () | [] | {} | NO OP | NO OP | Macro 1 | Macro 2 | + * |___________|___________|___________|___________|___________|___________|___________| + * | | | | | | | | | | | | | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP | + * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| + * | | | | | | | | | | | | | + * | TAB | Q | W | E | R | T | Y | U | I | O | P | - | + * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| + * | | | | | | | | | | | | | + * |ESC (CTL_T)| A | S | D | F | G | H | J | K | L | ; | ' | + * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| + * | | | | | | | | | | | | | + * | SHFT | Z | X | C | V | B | N | M | , | . | / |SHFT(ENT)| + * |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________| + * | | | | | | | ALT | HYP | LT 1| LT 2| + * |MO(2)|MO(1)| GUI | ALT | CTRL | SPC |(LFT)|(RGT)| (UP)|(DWN)| + * |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____| */ - - KEYMAP( - M(7), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DYN_REC_START1, DYN_REC_START2, - DYN_REC_STOP, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LBRC, KC_P7, KC_P8, KC_P9, KC_ASTR, KC_DEL, - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_EQL, - KC_BSLS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_PIPE, - KC_TRNS, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_RCBR, KC_P0, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - /* Mouse layer. - - ___________________________________________________________________________________ - | | | | | | | | - | | | | | | | | - |___________|___________|___________|___________|___________|___________|___________| - | | | | MS | | | | | | | | | - | | | | UP | | | | | | | | | - |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| - | | | MS | MS | MS | | | | | | | | - | | | LFT | DWN | RGT | | | MS1 | MS3 | MS2 | | | - |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| - | | | | | | | | | | | | | - | | | | | | | | | | | | | - |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| - | | | | | | | | | | | | | - | |RESET| | | | | | | | | | | - |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________| - | | | | | | | | | | | - | | | | | | | | | | F(2)| - |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____| + [0] = LAYOUT( \ + PAIR_PR, PAIR_BR, PAIR_CB, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + TD(SFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \ + MO(2), MO(1), KC_LGUI, KC_RALT, KC_LCTL, KC_SPC, ALT_T(KC_LEFT), ALL_T(KC_RGHT), LT(1, KC_UP), LT(2, KC_DOWN) \ + ), + + /* Function layer. + * Blank keys correspond to the KC_TRNS keycode. + * + * ___________________________________________________________________________________ + * | | | | | | DYN REC | DYN REC | + * | LAMBDA | | | | | 1 | 2 | + * |___________|___________|___________|___________|___________|___________|___________| + * | DYN REC | | | | | | | | | | | | + * | STOP | F1 | F2 | F3 | F4 | F5 | [ | 7 | 8 | 9 | * | DEL | + * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| + * | | | | | | | | | | | | | + * | | F6 | F7 | F8 | F9 | F10 | ] | 4 | 5 | 6 | + | = | + * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| + * | | | | | | | | | | | | | + * | \ | F11 | F12 | F13 | F14 | F15 | { | 1 | 2 | 3 | - | | | + * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| + * | | | | | | | | | | | | | + * | | F16 | F17 | F18 | F19 | F20 | } | 0 | , | . | / | | + * |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________| + * | | | | | | | | | | | + * | | | | | | | | | | | + * |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____| + * */ - - KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_TRNS, KC_TRNS, KC_MS_BTN1, KC_MS_BTN3, KC_MS_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(2)) -}; -// Simple macro ideas follow. Each of them is designed to give you a quick way to create pairs of -// delimiters and then position the cursor between them, much like Emacs' ParEdit does. This way, -// you can have some convenient coding "helpers" even when not using Emacs. It is also nice for -// LaTeX editing. -// -// Customize to your heart's content! -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - switch (id) { - case 0: - if (record->event.pressed) { - SEND_STRING("()"SS_TAP(X_LEFT)); - } - break; - - case 1: - if (record->event.pressed) { - SEND_STRING("[]"SS_TAP(X_LEFT)); - } - break; - - case 2: - if (record->event.pressed) { - SEND_STRING("{}"SS_TAP(X_LEFT)); - } - break; - - // Probably something only Lisp users will appreciate... - case 7: - if (record->event.pressed) { - SEND_STRING("(lambda ())"SS_TAP(X_LEFT)SS_TAP(X_LEFT)); - } - break; - } + [1] = LAYOUT( \ + LAMBDA, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, \ + DYN_REC_STOP, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LBRC, KC_P7, KC_P8, KC_P9, KC_ASTR, KC_DEL, \ + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_EQL, \ + KC_BSLS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_PIPE, \ + _______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_RCBR, KC_P0, KC_COMM, KC_DOT, KC_SLSH, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* Mouse layer. + * + * ___________________________________________________________________________________ + * | | | | | | | | + * | | | | | | | | + * |___________|___________|___________|___________|___________|___________|___________| + * | | | | MS | | | | | | | | | + * | | | | UP | | | | | | | | | + * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| + * | | | MS | MS | MS | | | | | | | | + * | | | LFT | DWN | RGT | | | MS1 | MS3 | MS2 | | | + * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | + * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________| + * | | | | | | | | | | | | | + * | |RESET| | | | | | | | | | | + * |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________| + * | | | | | | | | | | | + * | | | | | | | | | | F(2)| + * |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____| + * + */ - return MACRO_NONE; - -} + [2] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, TG(2) \ + ) +}; void matrix_init_user(void) { } @@ -194,44 +153,79 @@ void matrix_init_user(void) { void matrix_scan_user(void) { } +// Simple macro ideas follow. Each of them is designed to give you a quick way to create pairs of +// delimiters and then position the cursor between them, much like Emacs' ParEdit does. This way, +// you can have some convenient coding "helpers" even when not using Emacs. It is also nice for +// LaTeX editing. +// +// Customize to your heart's content! bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_dynamic_macro(keycode, record)) { return false; } + + switch (keycode) { + + case PAIR_PR: + if (record->event.pressed) { + SEND_STRING("()"SS_TAP(X_LEFT)); + } + return false; + + case PAIR_BR: + if (record->event.pressed) { + SEND_STRING("[]"SS_TAP(X_LEFT)); + } + return false; + + case PAIR_CB: + if (record->event.pressed) { + SEND_STRING("{}"SS_TAP(X_LEFT)); + } + return false; + + // Probably something only Lisp users will appreciate... + case LAMBDA: + if (record->event.pressed) { + SEND_STRING("(lambda ())"SS_TAP(X_LEFT)SS_TAP(X_LEFT)); + } + return false; + } + return true; } void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } } diff --git a/keyboards/handwired/space_oddity/readme.md b/keyboards/handwired/space_oddity/readme.md index 07ec957faf4..2997833f098 100644 --- a/keyboards/handwired/space_oddity/readme.md +++ b/keyboards/handwired/space_oddity/readme.md @@ -1,5 +1,6 @@ -Space Oddity Keyboard -===================== +# Space Oddity Keyboard + +![Space Oddity](https://i.imgur.com/dE9Y4XK.jpg) This firmware is for an Emacs-focused handwired custom keyboard using an Arduino Pro Micro. @@ -7,7 +8,10 @@ As originally designed, the top row consists of 2u keys which are used for user- Some simple example macros are included. To add your own, just add the number of the macro you want in the appropriate section. -A picture of the finished product can be found here: https://imgur.com/dE9Y4XK +This design was conceived by James Taylor. Any requests for further information, suggestions, and/or tips for building your own are welcome! + +Keyboard Maintainer: [James Taylor](https://github.com/broken-username) +Hardware Supported: Arduino Pro Micro ## Pinout @@ -15,11 +19,16 @@ The following pins are used: - Columns 1-12: B2, B6, B5, B4, E6, D7, C6, D4, D0, D1, D2, D3 - Rows 1-6: F4, F5, F6, F7, B1, B3 -## Compiling and loading the firmware +## Flashing + +Make example for this keyboard (after setting up your build environment): -To build the firmware, run `make handwired/space_oddity` from the toplevel directory. + make handwired/space_oddity:default -On GNU/Linux, you can flash the default layout onto the microcontroller by using `avrdude -p atmega32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:handwired_space_oddity_default.hex`. Note that the device name under `/dev` may be different. +On GNU/Linux, you can flash the default layout onto the microcontroller by using + avrdude -p atmega32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:handwired_space_oddity_default.hex + +Note that the device name under `/dev` may be different. -This design was conceived by James Taylor. Any requests for further information, suggestions, and/or tips for building your own are welcome! \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/space_oddity/rules.mk b/keyboards/handwired/space_oddity/rules.mk index 4dc93fad9e3..b597ef2b095 100644 --- a/keyboards/handwired/space_oddity/rules.mk +++ b/keyboards/handwired/space_oddity/rules.mk @@ -35,7 +35,7 @@ F_USB = $(F_CPU) # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -45,14 +45,14 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -AUDIO_ENABLE ?= no -RGBLIGHT_ENABLE ?= no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no TAP_DANCE_ENABLE = yes diff --git a/keyboards/handwired/space_oddity/space_oddity.h b/keyboards/handwired/space_oddity/space_oddity.h index e9270d044e9..d35bfea5877 100644 --- a/keyboards/handwired/space_oddity/space_oddity.h +++ b/keyboards/handwired/space_oddity/space_oddity.h @@ -1,9 +1,8 @@ -#ifndef KB_H -#define KB_H +#pragma once #include "quantum.h" -#define KEYMAP( \ +#define LAYOUT( \ K000, K002, K004, K006, K008, K010, K011, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ @@ -18,5 +17,3 @@ { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 }, \ { K500, K501, K502, K503, KC_NO, K505, KC_NO, K507, K508, K509, K510, K511 } \ } - -#endif \ No newline at end of file diff --git a/keyboards/handwired/splittest/config.h b/keyboards/handwired/splittest/config.h new file mode 100644 index 00000000000..56574f75296 --- /dev/null +++ b/keyboards/handwired/splittest/config.h @@ -0,0 +1,68 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1111 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Split Tester +#define DESCRIPTION Split keyboard testing unit + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 2 +#define MATRIX_COLS 1 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLED_SPLIT { 6, 6 } + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/handwired/splittest/keymaps/default/config.h b/keyboards/handwired/splittest/keymaps/default/config.h new file mode 100644 index 00000000000..ecebd365891 --- /dev/null +++ b/keyboards/handwired/splittest/keymaps/default/config.h @@ -0,0 +1,23 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define USE_I2C diff --git a/keyboards/handwired/splittest/keymaps/default/keymap.c b/keyboards/handwired/splittest/keymaps/default/keymap.c new file mode 100644 index 00000000000..1c15f6f1dfa --- /dev/null +++ b/keyboards/handwired/splittest/keymaps/default/keymap.c @@ -0,0 +1,5 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT(RGB_MOD, RESET) +}; diff --git a/keyboards/handwired/splittest/promicro/config.h b/keyboards/handwired/splittest/promicro/config.h new file mode 100644 index 00000000000..c2a9c6002e6 --- /dev/null +++ b/keyboards/handwired/splittest/promicro/config.h @@ -0,0 +1,28 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +// wiring of each half +#define MATRIX_ROW_PINS { B3 } +#define MATRIX_COL_PINS { B6 } +#define SPLIT_HAND_PIN F6 +#define SOFT_SERIAL_PIN D1 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 diff --git a/keyboards/handwired/splittest/promicro/readme.md b/keyboards/handwired/splittest/promicro/readme.md new file mode 100644 index 00000000000..64a6f4c2494 --- /dev/null +++ b/keyboards/handwired/splittest/promicro/readme.md @@ -0,0 +1,11 @@ +# Pro Micro splittest + +To trigger keypress, short together pins *B3* and *B6* (marked on the PCB as *14* and *10*). + +## Wiring +- Add switches to both Pro Micros across B3 and B6 pins +- Add pull-up resistor to left side between VCC and F6 +- Add pull-down resistors to right side between GND and F6 +- Connect the following pins on both sides together: D0, D1, GND, VCC +- Add I2C 4.7kOhm resistors between D0 and VCC, and D1 and VCC +- Wire Di of RGB strip for each half to D3 diff --git a/keyboards/handwired/splittest/promicro/rules.mk b/keyboards/handwired/splittest/promicro/rules.mk new file mode 100644 index 00000000000..dc6f1962373 --- /dev/null +++ b/keyboards/handwired/splittest/promicro/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/handwired/splittest/readme.md b/keyboards/handwired/splittest/readme.md new file mode 100644 index 00000000000..33dbc6e805d --- /dev/null +++ b/keyboards/handwired/splittest/readme.md @@ -0,0 +1,20 @@ +Split Tester +============ + +A two-switch tester built using two Pro Micros, mainly intended to test RGB on split keyboards. Seen here: https://www.instagram.com/p/BvCPNzynwrV/ + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro, Teensy 2.0 +Hardware Availability: + +**See each individual board for pin infomation** + +Make example for this keyboard (after setting up your build environment): + + make handwired/splittest:default + +Example of flashing this keyboard: + + make handwired/splittest:default:avrdude + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/splittest/rules.mk b/keyboards/handwired/splittest/rules.mk new file mode 100644 index 00000000000..2aa484db0bb --- /dev/null +++ b/keyboards/handwired/splittest/rules.mk @@ -0,0 +1,23 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = handwired/splittest/promicro diff --git a/keyboards/handwired/splittest/splittest.c b/keyboards/handwired/splittest/splittest.c new file mode 100644 index 00000000000..3c919a565db --- /dev/null +++ b/keyboards/handwired/splittest/splittest.c @@ -0,0 +1 @@ +#include "splittest.h" diff --git a/keyboards/handwired/splittest/splittest.h b/keyboards/handwired/splittest/splittest.h new file mode 100644 index 00000000000..17b7081a027 --- /dev/null +++ b/keyboards/handwired/splittest/splittest.h @@ -0,0 +1,5 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT(L1, R1) {{L1}, {R1}} diff --git a/keyboards/handwired/splittest/teensy_2/config.h b/keyboards/handwired/splittest/teensy_2/config.h new file mode 100644 index 00000000000..3d0b0346edf --- /dev/null +++ b/keyboards/handwired/splittest/teensy_2/config.h @@ -0,0 +1,31 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +// wiring of each half +#define MATRIX_ROW_PINS { F5 } +#define MATRIX_COL_PINS { F7 } +#define SPLIT_HAND_PIN F0 +#define SOFT_SERIAL_PIN D1 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 + +// required for teensy slave otherwise it "locks up" during startup +#define NO_USB_STARTUP_CHECK diff --git a/keyboards/handwired/splittest/teensy_2/readme.md b/keyboards/handwired/splittest/teensy_2/readme.md new file mode 100644 index 00000000000..ed5f845d201 --- /dev/null +++ b/keyboards/handwired/splittest/teensy_2/readme.md @@ -0,0 +1,11 @@ +# Teensy 2.0 splittest + +To trigger keypress, short together pins *F5* and *F7* + +## Wiring +- Add switches to both Teensy 2s across F5 and F7 pins +- Add pull-up resistor to left side between VCC and F0 +- Add pull-down resistors to right side between GND and F0 +- Connect the following pins on both sides together: D0, D1, GND, VCC +- Add I2C 4.7kOhm resistors between D0 and VCC, and D1 and VCC +- Wire Di of RGB strip for each half to D3 diff --git a/keyboards/handwired/splittest/teensy_2/rules.mk b/keyboards/handwired/splittest/teensy_2/rules.mk new file mode 100644 index 00000000000..3fb7c7e5a7e --- /dev/null +++ b/keyboards/handwired/splittest/teensy_2/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/handwired/splittest/teensy_2/teensy_2.c b/keyboards/handwired/splittest/teensy_2/teensy_2.c new file mode 100644 index 00000000000..bcc2a437bdc --- /dev/null +++ b/keyboards/handwired/splittest/teensy_2/teensy_2.c @@ -0,0 +1,14 @@ +#include QMK_KEYBOARD_H + +bool is_keyboard_master(void) { + // TODO: replace this override once USB host detection is implemented + // SPLIT_HAND_PIN Combined with MASTER_LEFT or MASTER_RIGHT, gives a crude + // way to force teensy to run as slave/master + setPinInput(SPLIT_HAND_PIN); + +#if defined(MASTER_RIGHT) + return !readPin(SPLIT_HAND_PIN); +#else + return readPin(SPLIT_HAND_PIN); +#endif +} diff --git a/keyboards/handwired/tennie/config.h b/keyboards/handwired/tennie/config.h new file mode 100644 index 00000000000..20795b048cf --- /dev/null +++ b/keyboards/handwired/tennie/config.h @@ -0,0 +1,240 @@ +/* +Copyright 2018 Jack Hildebrandt + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x1EEE +#define PRODUCT_ID 0x1313 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Jsck +#define PRODUCT Tennie +#define DESCRIPTION Ten key macropad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C6, D4, D0} +#define MATRIX_COL_PINS { D7, E6, B4, B5 } +#define UNUSED_PINS { B1, B2, B3, B6, F4, F5, F6, F7 D1} + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 +#define RGBW +#define RGB_DI_PIN D1 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 1 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +//#define BOOTMAGIC_LITE_ROW 0 +//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/handwired/tennie/info.json b/keyboards/handwired/tennie/info.json new file mode 100644 index 00000000000..c0369979291 --- /dev/null +++ b/keyboards/handwired/tennie/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Tennie", + "url": "https://github.com/StoutIEEE/macropad-workshop", + "maintainer": "UW Stout IEEE, Jack Hildebrandt (onemorebyte)", + "width": 4, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [{"x":0.5, "y":0}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0.5, "y":2}, {"x":1.5, "y":2}, {"x":2.5, "y":2}] + } + } +} diff --git a/keyboards/handwired/tennie/keymaps/default/config.h b/keyboards/handwired/tennie/keymaps/default/config.h new file mode 100644 index 00000000000..4496c591006 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/handwired/tennie/keymaps/default/keymap.c b/keyboards/handwired/tennie/keymaps/default/keymap.c new file mode 100644 index 00000000000..3736841cbb9 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/default/keymap.c @@ -0,0 +1,95 @@ +/* Copyright 2018 Jack H. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define TAPPING_TOGGLE 2 + + +// Layer names +#define base 0 +#define shrek 1 +#define ogre 2 +#define tcp 3 + +// Layer Switches +#define KC_SHRK TT(shrek) +#define KC_OGRE TT(ogre) +#define KC_TCP TT(tcp) + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [base] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_DEL, KC_SPC, KC_ENT, + + // ├────────┼────────┼────────┼────────┼ + + KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, + + // ├────────┼────────┼────────┼────────┼ + + KC_SHRK, KC_OGRE, KC_TCP + + // └────────┴────────┴────────┘ + ), + [shrek] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_MPRV, KC_MPLY, KC_MNXT, + + // ├────────┼────────┼────────┼────────┼ + + KC_BRID, KC_VOLD, KC_VOLU, KC_BRIU, + + // ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + + // └────────┴────────┴────────┘ + ), + [ogre] = LAYOUT( + // ┌────────┬────────┬────────┐ + + RGB_MOD, RGB_TOG, RGB_RMOD, + + // ├────────┼────────┼────────┼────────┼ + + KC_F13, KC_F14, KC_F15, KC_F16, + + // ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + + // └────────┴────────┴────────┘ + ), + [tcp] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_WBAK, KC_WREF, KC_WFWD, + + // ├────────┼────────┼────────┼────────┼ + + XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, + + // ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + + // └────────┴────────┴────────┘ + ), +}; diff --git a/keyboards/handwired/tennie/keymaps/default/readme.md b/keyboards/handwired/tennie/keymaps/default/readme.md new file mode 100644 index 00000000000..1fbaa7f4635 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/default/readme.md @@ -0,0 +1,68 @@ +# Default keymap + +This keymap is to serve as an example of how you could make a multi-layer keymap. + +#### keymap + +``` +[base] = LAYOUT_kc( +// ┌────────┬────────┬────────┐ + + DEL , SPC , ENT , + +// ├────────┼────────┼────────┼────────┼ + + LEFT , DOWN , UP , RGHT , + +// ├────────┼────────┼────────┼────────┼ + + SHRK , OGRE , TCP + +// └────────┴────────┴────────┘ +), +[shrek] = LAYOUT_kc( +// ┌────────┬────────┬────────┐ + + MPRV , MPLY , MNXT , + +// ├────────┼────────┼────────┼────────┼ + + BRID , VOLD , VOLU , BRIU , + +// ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + +// └────────┴────────┴────────┘ +), +[ogre] = LAYOUT_kc( +// ┌────────┬────────┬────────┐ + + RGB_MOD, RGB_TOG, RGB_RMOD + +// ├────────┼────────┼────────┼────────┼ + + F13 , F14 , F15 , F16 , + +// ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + +// └────────┴────────┴────────┘ +), +[tcp] = LAYOUT_kc( +// ┌────────┬────────┬────────┐ + + WBAK , WREF , WFWD , + +// ├────────┼────────┼────────┼────────┼ + + XXXXXXX , PGDN , PGUP , XXXXXXX , + +// ├────────┼────────┼────────┼────────┼ + + _______, _______, _______ + +// └────────┴────────┴────────┘ +), +``` diff --git a/keyboards/handwired/tennie/keymaps/simple-numbpad/config.h b/keyboards/handwired/tennie/keymaps/simple-numbpad/config.h new file mode 100644 index 00000000000..a3c309bb290 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/simple-numbpad/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Jack Hildebrandt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/handwired/tennie/keymaps/simple-numbpad/keymap.c b/keyboards/handwired/tennie/keymaps/simple-numbpad/keymap.c new file mode 100644 index 00000000000..7cf29b11889 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/simple-numbpad/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2018 Jack Hildebrandt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Layer names +#define base 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [base] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_1 , KC_2 , KC_3 , + + // ├────────┼────────┼────────┼────────┼ + + KC_4 , KC_5 , KC_6 , KC_7 , + + // ├────────┼────────┼────────┼────────┼ + + KC_8 , KC_9 , KC_0 + + // └────────┴────────┴────────┘ + ), +}; diff --git a/keyboards/handwired/tennie/keymaps/simple-numbpad/readme.md b/keyboards/handwired/tennie/keymaps/simple-numbpad/readme.md new file mode 100644 index 00000000000..0b3f3075016 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/simple-numbpad/readme.md @@ -0,0 +1,18 @@ +# Simple numberpad keymap + +This keymap is to test the soldering work of workshop participants. It can also be used as a simple base for a macropad keymap. +``` +// ┌────────┬────────┬────────┐ + + 1 , 2 , 3 , + +// ├────────┼────────┼────────┼────────┼ + + 4 , 5 , 6 , 7 , + +// ├────────┼────────┼────────┼────────┼ + + 8 , 9 , 0 + +// └────────┴────────┴────────┘ +``` diff --git a/keyboards/handwired/tennie/keymaps/soundboard/config.h b/keyboards/handwired/tennie/keymaps/soundboard/config.h new file mode 100644 index 00000000000..5a1cba7b404 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/soundboard/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Jacob Hillebrand + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/handwired/tennie/keymaps/soundboard/keymap.c b/keyboards/handwired/tennie/keymaps/soundboard/keymap.c new file mode 100644 index 00000000000..3bceb1feac9 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/soundboard/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2018 Jacob Hillebrand + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Layer names +#define base 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [base] = LAYOUT( + // ┌────────┬────────┬────────┐ + + KC_F13 , KC_F14 , KC_F15 , + + // ├────────┼────────┼────────┼────────┼ + + KC_F16 , KC_F17 , KC_F18 , KC_F19 , + + // ├────────┼────────┼────────┼────────┼ + + KC_F20, KC_F21 , KC_F22 + + // └────────┴────────┴────────┘ + ), +}; diff --git a/keyboards/handwired/tennie/keymaps/soundboard/readme.md b/keyboards/handwired/tennie/keymaps/soundboard/readme.md new file mode 100644 index 00000000000..d05b7117c16 --- /dev/null +++ b/keyboards/handwired/tennie/keymaps/soundboard/readme.md @@ -0,0 +1,19 @@ +# Soundboard keymap + +This keymap binds all keys to function keys 13-22 for something like a +soundboard (ie:[Resanance](https://www.reddit.com/r/discordapp/comments/44ldc1/soundboard_for_discord/)) +``` +// ┌────────┬────────┬────────┐ + + F13 , F14 , F15 , + +// ├────────┼────────┼────────┼────────┼ + + F16 , F17 , F18 , F19 , + +// ├────────┼────────┼────────┼────────┼ + + F20 , F21 , F22 + +// └────────┴────────┴────────┘ +``` diff --git a/keyboards/handwired/tennie/readme.md b/keyboards/handwired/tennie/readme.md new file mode 100644 index 00000000000..bbdbc2b6011 --- /dev/null +++ b/keyboards/handwired/tennie/readme.md @@ -0,0 +1,15 @@ +# Tennie + +![tennie](https://raw.githubusercontent.com/StoutIEEE/macropad-workshop/master/images/macropad.jpg) + +A ten key macropad for a club workshop! More information, and build instructions can be found [here](https://github.com/StoutIEEE/macropad-workshop) + +Keyboard Maintainer: [Jack Hildebrandt](https://github.com/onemorebyte), [UW Stout IEEE](https://github.com/StoutIEEE) + +Hardware Supported: ProMicro + +Make example for this keyboard (after setting up your build environment): + + make handwired/tennie:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/tennie/rules.mk b/keyboards/handwired/tennie/rules.mk new file mode 100644 index 00000000000..0119dc6fb2f --- /dev/null +++ b/keyboards/handwired/tennie/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/handwired/tennie/tennie.c b/keyboards/handwired/tennie/tennie.c new file mode 100644 index 00000000000..e1ceaf153d7 --- /dev/null +++ b/keyboards/handwired/tennie/tennie.c @@ -0,0 +1,45 @@ +/* Copyright 2018 Jack Hildebrandt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "tennie.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void matrix_post_init(void) { + rgblight_enable_noeeprom(); + keyboard_post_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +//void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + +// led_set_user(usb_led); +//} diff --git a/keyboards/handwired/tennie/tennie.h b/keyboards/handwired/tennie/tennie.h new file mode 100644 index 00000000000..8ab0d04c528 --- /dev/null +++ b/keyboards/handwired/tennie/tennie.h @@ -0,0 +1,37 @@ +/* Copyright 2018 Jack Hildebrandt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, \ + K10, K11, K12, K13, \ + K20, K21, K22 \ +) \ +{ \ + { K00, K01, K02, KC_NO }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, KC_NO }, \ +} diff --git a/keyboards/handwired/terminus_mini/config.h b/keyboards/handwired/terminus_mini/config.h index ef9a26a19f5..a5a6736ba09 100644 --- a/keyboards/handwired/terminus_mini/config.h +++ b/keyboards/handwired/terminus_mini/config.h @@ -46,7 +46,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B0, D0, D5, B6, D4, C7, F7, F6, F5, F4, F1, F0 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 @@ -60,7 +60,7 @@ along with this program. If not, see . #define TAPPING_TERM 150 //reduce time required to register a held key /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -105,11 +105,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/terminus_mini/info.json b/keyboards/handwired/terminus_mini/info.json new file mode 100644 index 00000000000..9271b413eb7 --- /dev/null +++ b/keyboards/handwired/terminus_mini/info.json @@ -0,0 +1,59 @@ +{ + "keyboard_name": "handwired/terminus_mini", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Tab", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"Del", "x":11, "y":0}, + {"label":"Backspace", "x":0, "y":1}, + {"label":"A", "x":1, "y":1}, + {"label":"S", "x":2, "y":1}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1}, + {"label":"G", "x":5, "y":1}, + {"label":"H", "x":6, "y":1}, + {"label":"J", "x":7, "y":1}, + {"label":"K", "x":8, "y":1}, + {"label":"L", "x":9, "y":1}, + {"label":";", "x":10, "y":1}, + {"label":"'", "x":11, "y":1}, + {"label":"Left Shift / (", "x":0, "y":2}, + {"label":"Z", "x":1, "y":2}, + {"label":"X", "x":2, "y":2}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2}, + {"label":"B", "x":5, "y":2}, + {"label":"N", "x":6, "y":2}, + {"label":"M", "x":7, "y":2}, + {"label":",", "x":8, "y":2}, + {"label":".", "x":9, "y":2}, + {"label":"/", "x":10, "y":2}, + {"label":"Right Shift / )", "x":11, "y":2}, + {"label":"LCtrl", "x":0, "y":3}, + {"label":"GUI", "x":1, "y":3}, + {"label":"Lower", "x":2, "y":3}, + {"label":"LAlt", "x":3, "y":3}, + {"label":"Space / Lower", "x":4, "y":3, "w":2}, + {"label":"Enter / Raise", "x":6, "y":3, "w":2}, + {"label":"MO(_FUNCTION)", "x":8, "y":3}, + {"label":"MO(_MOUSE)", "x":9, "y":3}, + {"label":"App", "x":10, "y":3}, + {"label":"RCtrl", "x":11, "y":3} + ] + } + } +} diff --git a/keyboards/handwired/terminus_mini/keymaps/default/config.h b/keyboards/handwired/terminus_mini/keymaps/default/config.h index 34ef6720746..4817be25275 100644 --- a/keyboards/handwired/terminus_mini/keymaps/default/config.h +++ b/keyboards/handwired/terminus_mini/keymaps/default/config.h @@ -14,13 +14,8 @@ * along with this program. If not, see . */ -#define TAPPING_TERM 150 //reduce time required to register a held key - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here -#endif +#define TAPPING_TERM 150 //reduce time required to register a held key diff --git a/keyboards/handwired/terminus_mini/keymaps/default/keymap.c b/keyboards/handwired/terminus_mini/keymaps/default/keymap.c index 1c4af5f46a5..276475873ae 100644 --- a/keyboards/handwired/terminus_mini/keymaps/default/keymap.c +++ b/keyboards/handwired/terminus_mini/keymaps/default/keymap.c @@ -13,12 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "terminus_mini.h" -#include "action_layer.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -45,32 +40,14 @@ enum terminus_mini_keycodes { LOWER, RAISE, FUNCTION, - MOUSE -}; - -enum custom_macros { + MOUSE, + // Custom Macros R_PIPE, R_POINT }; - // Enable these functions using FUNC(n) macro. - const uint16_t PROGMEM fn_actions[] = { //ACTION_LAYER_TAP_TOGGLE requires that number of taps be defined in *config.h* - default set to 5 - [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), //Hold for momentary Lower layer, Tap for Space, - [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_ENT), //Hold for momentary Mouse layer, Tap for Enter, - [2] = ACTION_LAYER_MOMENTARY(_FUNCTION), //Hold for momentary Function - [3] = ACTION_LAYER_MOMENTARY(_MOUSE) //Hold for momentary MOUSE - }; -#define SPC_LW FUNC(0) -#define ENT_RS FUNC(1) -#define FNC FUNC(2) -#define MSE FUNC(3) -#define PIPE M(R_PIPE) -#define POINT M(R_POINT) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - +#define SPC_LW LT(_LOWER, KC_SPC) +#define ENT_RS LT(_RAISE, KC_ENT) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Colemak - @@ -85,10 +62,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `----------------------------------------------------------------------------------' */ [_COLEMAK] = LAYOUT( - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL , \ - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ - KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, ENT_RS, FNC, MSE, KC_APP, KC_RCTL \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, ENT_RS, MO(5), MO(6), KC_APP, KC_RCTL \ ), /* QWERTY - @@ -103,10 +80,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `----------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL , \ - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ - KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, ENT_RS, FNC, MSE, KC_APP, KC_RCTL \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, ENT_RS, MO(5), MO(6), KC_APP, KC_RCTL \ ), /* Dvorak @@ -121,10 +98,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_DVORAK] = LAYOUT( - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, \ - KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, ENT_RS, FNC, MSE, KC_APP, KC_RCTL \ + KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, ENT_RS, MO(5), MO(6), KC_APP, KC_RCTL \ ), /* Lower @@ -141,10 +118,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_LOWER] = LAYOUT( - KC_TAB, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_PSLS, KC_7, KC_8, KC_9, KC_PAST, XXXXXXX, _______, \ - _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_MINS, KC_4, KC_5, KC_6, KC_PPLS, XXXXXXX, _______, \ - _______, _______, _______, _______, _______, KC_EQL, KC_1, KC_2, KC_3, KC_PENT, XXXXXXX, _______, \ - _______, _______, _______, _______, _______, KC_0, KC_DOT, FNC, RAISE, _______ \ + KC_TAB, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_PSLS, KC_7, KC_8, KC_9, KC_PAST, XXXXXXX, _______, \ + _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_MINS, KC_4, KC_5, KC_6, KC_PPLS, XXXXXXX, _______, \ + _______, _______, _______, _______, _______, KC_EQL, KC_1, KC_2, KC_3, KC_PENT, XXXXXXX, _______, \ + _______, _______, _______, _______, _______, KC_0, KC_DOT, MO(5), RAISE, _______ \ ), /* Raise @@ -160,10 +137,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_RAISE] = LAYOUT( - KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, _______, \ - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ - _______, POINT, PIPE, KC_LCBR, KC_LBRC, KC_GRV, KC_BSLS, KC_RBRC, KC_RCBR, KC_DOT, KC_SLSH, _______, \ - _______, _______, XXXXXXX, _______, SPC_LW, ENT_RS, FNC, MSE, _______, _______ \ + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, _______, \ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, R_POINT, R_PIPE, KC_LCBR, KC_LBRC, KC_GRV, KC_BSLS, KC_RBRC, KC_RCBR, KC_DOT, KC_SLSH, _______, \ + _______, _______, XXXXXXX, _______, SPC_LW, ENT_RS, MO(5), MO(6), _______, _______ \ ), /*Function @@ -178,11 +155,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_FUNCTION] = LAYOUT( - _______, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS , \ - KC_CAPS, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, KC_SLCK, \ - _______, _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, XXXXXXX, KC_PAUS \ +[_FUNCTION] = LAYOUT( + _______, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, \ + KC_CAPS, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, KC_SLCK, \ + _______, _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, XXXXXXX, KC_PAUS \ ), /* MOUSE @@ -198,10 +175,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_MOUSE] = LAYOUT( - KC_ESC, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, XXXXXXX, XXXXXXX, KC_BTN3, KC_BTN4, KC_BTN5, XXXXXXX, XXXXXXX, \ - KC_BSPC, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSPC, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_ACL2, KC_ACL0, XXXXXXX, MSE, XXXXXXX, KC_RCTL \ + KC_ESC, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, XXXXXXX, XXXXXXX, KC_BTN3, KC_BTN4, KC_BTN5, XXXXXXX, XXXXXXX, \ + KC_BSPC, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSPC, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_ACL2, KC_ACL0, XXXXXXX, MO(6), XXXXXXX, KC_RCTL \ ), /* Adjust (Lower + Raise) @@ -217,10 +194,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = LAYOUT( - _______, _______, _______, _______, _______, RESET, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ - _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______, _______, RESET, _______, TERM_ON, TERM_OFF, _______, _______, KC_DEL, \ + _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) }; @@ -230,27 +207,6 @@ void persistant_default_layer_set(uint16_t default_layer) { default_layer_set(default_layer); } -// Macros to send R pointer & dplyr pipe -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - //R Pointer: <- - case R_POINT: - if (record->event.pressed) { // pointer - SEND_STRING("<- "); -// return MACRO(D(LSFT), T(COMM), U(LSFT), T(MINS), END); - } - break; - //dplyr pipe: %>% - case R_PIPE: - if (record->event.pressed) { // dplyr pipe - SEND_STRING("%>% "); -// return MACRO(D(LSFT), T(5), T(DOT), T(5), U(LSFT), END); - } - break; - } - return MACRO_NONE; -} - // Cases to switch default layer to QWERTY, COLEMAK or DVORAK and to access ADJUST layer bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { @@ -265,13 +221,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { set_single_persistent_default_layer(_COLEMAK); } return false; - break; + break; case DVORAK: if (record->event.pressed) { set_single_persistent_default_layer(_DVORAK); } return false; - break; + break; case LOWER: if (record->event.pressed) { layer_on(_LOWER); @@ -292,6 +248,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + // Macros to send R pointer & dplyr pipe + //R Pointer: <- + case R_POINT: + if (record->event.pressed) { // pointer + SEND_STRING("<- "); + //return MACRO(D(LSFT), T(COMM), U(LSFT), T(MINS), END); + } + break; + //dplyr pipe: %>% + case R_PIPE: + if (record->event.pressed) { // dplyr pipe + SEND_STRING("%>% "); + //return MACRO(D(LSFT), T(5), T(DOT), T(5), U(LSFT), END); + } + break; } return true; } diff --git a/keyboards/handwired/terminus_mini/readme.md b/keyboards/handwired/terminus_mini/readme.md index 94249d6a96e..a5fc8eee61f 100644 --- a/keyboards/handwired/terminus_mini/readme.md +++ b/keyboards/handwired/terminus_mini/readme.md @@ -1,13 +1,12 @@ # terminus_mini handwired -Custom handwired keyboard. +Custom handwired keyboard inspired by the UniKeyboard Terminus Mini 2. Keyboard Maintainer: [James Morgan](https://github.com/mogranjm) -Hardware Supported: Custom handwired keyboard -Hardware Availability: +Hardware Supported: Custom handwired keyboard Make example for this keyboard (after setting up your build environment): make handwired/terminus_mini:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/terminus_mini/rules.mk b/keyboards/handwired/terminus_mini/rules.mk index 9ecba25d80f..1093901c098 100644 --- a/keyboards/handwired/terminus_mini/rules.mk +++ b/keyboards/handwired/terminus_mini/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/handwired/terminus_mini/terminus_mini.h b/keyboards/handwired/terminus_mini/terminus_mini.h index 846c98e2c08..27fb4509815 100644 --- a/keyboards/handwired/terminus_mini/terminus_mini.h +++ b/keyboards/handwired/terminus_mini/terminus_mini.h @@ -23,16 +23,16 @@ // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array #define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k35, k37, k38, k39, k3a, k3b \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k35, k37, k38, k39, k3a, k3b \ ) \ { \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b } \ } #define KC_ KC_TRNS diff --git a/keyboards/handwired/trackpoint/README.md b/keyboards/handwired/trackpoint/README.md deleted file mode 100644 index bbfcaab0c3c..00000000000 --- a/keyboards/handwired/trackpoint/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# IBM Trackpoint demonstration - -This is just a simple demo to show how to integrate IBM Trackpoint in QMK. - -Wiring used in the demonstration: -![Wiring example](http://imgur.com/8ghG2U8) - -Some documentation: -* [How to wire IBM Trackpoint](https://github.com/alonswartz/trackpoint) -* [QMK documentation](https://docs.qmk.fm/) diff --git a/keyboards/handwired/trackpoint/config.h b/keyboards/handwired/trackpoint/config.h index 7558c03bf40..a1c12efb074 100644 --- a/keyboards/handwired/trackpoint/config.h +++ b/keyboards/handwired/trackpoint/config.h @@ -1,75 +1,67 @@ -#ifndef CONFIG_H - #define CONFIG_H +#pragma once - #include "config_common.h" +#include "config_common.h" - #define VENDOR_ID 0x1234 - #define PRODUCT_ID 0x5678 - #define DEVICE_VER 0x0001 - #define MANUFACTURER QMK - #define PRODUCT TRACKPOINT-DEMO - #define DESCRIPTION Simple demonstration for IBM Trackpoint integration +#define VENDOR_ID 0x1234 +#define PRODUCT_ID 0x5678 +#define DEVICE_VER 0x0001 +#define MANUFACTURER QMK +#define PRODUCT TRACKPOINT-DEMO +#define DESCRIPTION Simple demonstration for IBM Trackpoint integration - #define MATRIX_ROWS 1 - #define MATRIX_COLS 3 +#define MATRIX_ROWS 1 +#define MATRIX_COLS 3 - #ifdef PS2_USE_USART - #define PS2_CLOCK_PORT PORTD - #define PS2_CLOCK_PIN PIND - #define PS2_CLOCK_DDR DDRD - #define PS2_CLOCK_BIT 5 - #define PS2_DATA_PORT PORTD - #define PS2_DATA_PIN PIND - #define PS2_DATA_DDR DDRD - #define PS2_DATA_BIT 2 +#ifdef PS2_USE_USART + #define PS2_CLOCK_PORT PORTD + #define PS2_CLOCK_PIN PIND + #define PS2_CLOCK_DDR DDRD + #define PS2_CLOCK_BIT 5 + #define PS2_DATA_PORT PORTD + #define PS2_DATA_PIN PIND + #define PS2_DATA_DDR DDRD + #define PS2_DATA_BIT 2 - /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ - /* set DDR of CLOCK as input to be slave */ - #define PS2_USART_INIT() do { \ - PS2_CLOCK_DDR &= ~(1<mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ - ) +#define DEBOUNCE 5 -#endif +#define LOCKING_SUPPORT_ENABLE +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/handwired/trackpoint/keymaps/default/keymap.c b/keyboards/handwired/trackpoint/keymaps/default/keymap.c index 22e46d98a7c..60da300924e 100644 --- a/keyboards/handwired/trackpoint/keymaps/default/keymap.c +++ b/keyboards/handwired/trackpoint/keymaps/default/keymap.c @@ -1,7 +1,7 @@ -#include "trackpoint.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( + [0] = LAYOUT( KC_BTN1, KC_BTN3, KC_BTN2 \ ) }; diff --git a/keyboards/handwired/trackpoint/readme.md b/keyboards/handwired/trackpoint/readme.md new file mode 100644 index 00000000000..e1302fbb7fa --- /dev/null +++ b/keyboards/handwired/trackpoint/readme.md @@ -0,0 +1,19 @@ +# IBM Trackpoint demonstration + +This is just a simple demo to show how to integrate IBM Trackpoint in QMK. + +Wiring used in the demonstration: +![Wiring example](https://i.imgur.com/8ghG2U8.png) + +Some documentation: + +- [How to wire IBM Trackpoint](https://github.com/alonswartz/trackpoint) + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: Teensy + +Make example for this keyboard (after setting up your build environment): + + make handwired/trackpoint:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/trackpoint/trackpoint.h b/keyboards/handwired/trackpoint/trackpoint.h index b5d73d7db5f..a26000d521a 100644 --- a/keyboards/handwired/trackpoint/trackpoint.h +++ b/keyboards/handwired/trackpoint/trackpoint.h @@ -1,13 +1,10 @@ -#ifndef TRACKPOINT_H -#define TRACKPOINT_H +#pragma once #include "quantum.h" -#define KEYMAP( \ - k00, k01, k02 \ +#define LAYOUT( \ + k00, k01, k02 \ ) \ { \ - { k00, k01, k02} \ + { k00, k01, k02} \ } - -#endif diff --git a/keyboards/handwired/tradestation/config.h b/keyboards/handwired/tradestation/config.h new file mode 100644 index 00000000000..33c87548fbc --- /dev/null +++ b/keyboards/handwired/tradestation/config.h @@ -0,0 +1,46 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Flehrad +#define PRODUCT Trade Station + #define DESCRIPTION A Pro Micro-powered macropad layout by Didier Luximon. 1/8U gap space top two rows and 1/4U gap between 2U bottom two rows. + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, C6, D4, D0 } +#define MATRIX_COL_PINS { F7, B1, D7, E6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS + #define RGBLED_NUM 5 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/handwired/tradestation/info.json b/keyboards/handwired/tradestation/info.json new file mode 100644 index 00000000000..233eb6282ec --- /dev/null +++ b/keyboards/handwired/tradestation/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "Tradestation", + "url": "", + "maintainer": "Flehrad", + "width": 4.375, + "height": 4.5, + "layouts": { + "LAYOUT_tradestation": { + "layout": [{"x":0, "y":0},{"x":1.125, "y":0},{"x":2.25, "y":0},{"x":3.375, "y":0},{"x":0, "y":1.1},{"x":1.125, "y":1.1},{"x":2.25, "y":1.1},{"x":3.375, "y":1.1},{"x":0, "y":2.25, "w":2},{"x":2.25, "y":2.25, "w":2},{"x":0, "y":3.5, "w":2},{"x":2.25, "y":3.5, "w":2}] + }, + "LAYOUT_ortho_4x4": { + "layout": [{"x":0, "y":0},{"x":1.125, "y":0},{"x":2.25, "y":0},{"x":3.375, "y":0},{"x":0, "y":1.1},{"x":1.125, "y":1.1},{"x":2.25, "y":1.1},{"x":3.375, "y":1.1},{"x":0, "y":2.25},{"x":1.125, "y":2.25},{"x":2.25, "y":2.25},{"x":3.375, "y":2.25},{"x":0, "y":3.5},{"x":1.125, "y":3.5},{"x":2.25, "y":3.5},{"x":3.375, "y":3.5}] + } + } +} diff --git a/keyboards/handwired/tradestation/keymaps/default/keymap.c b/keyboards/handwired/tradestation/keymaps/default/keymap.c new file mode 100644 index 00000000000..3497dcb9411 --- /dev/null +++ b/keyboards/handwired/tradestation/keymaps/default/keymap.c @@ -0,0 +1,61 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ortho_4x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + LAYOUT_tradestation( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS), +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/handwired/tradestation/license b/keyboards/handwired/tradestation/license new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/keyboards/handwired/tradestation/license @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/keyboards/handwired/tradestation/readme.md b/keyboards/handwired/tradestation/readme.md new file mode 100644 index 00000000000..3a8c39e2632 --- /dev/null +++ b/keyboards/handwired/tradestation/readme.md @@ -0,0 +1,27 @@ +# Tradestation + +[Image Gallery](https://imgur.com/a/yxQJXMT) + +A 4x4 ortholinear macropad, with options for 2U keys on the bottom half. Can be built as single PCB with custom case, or as two-PCB style with standoffs. Requires a Pro Micro. + +This PCB supports an overall 4x4 matrix with unique spacing. + +* Top two rows are 1U keys with 1/8U spacing +* Bottom two rows are available with 4x2 1U as clusters of 2x1U or as 2x2 2U, spaced with 1/4U + +If you like this simple PCB and want to make a donation, you can do so at [paypal.me/theboardpodcast](https://paypal.me/theboardpodcast). + +- [The Board Podcast on YouTube](https://www.youtube.com/channel/UCg98oJZNffR9nDLJNkorjqw) +- [The Board Podcast on Libsyn](http://theboard.libsyn.com/) +- [The Board Podcast on Patreon](https://www.patreon.com/theboardpodcast) + +Designed by Didier Luximon. + +Keyboard Maintainer: [flehrad](https://github.com/flehrad) +Hardware Supported: Tradestation PCB, Pro Micro + +Make example for this keyboard (after setting up your build environment): + + make tradestation:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/tradestation/rules.mk b/keyboards/handwired/tradestation/rules.mk new file mode 100644 index 00000000000..649b63babf9 --- /dev/null +++ b/keyboards/handwired/tradestation/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + +# Boot Section Size in *bytes* +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no + +LAYOUTS = ortho_4x4 diff --git a/keyboards/handwired/tradestation/tradestation.c b/keyboards/handwired/tradestation/tradestation.c new file mode 100644 index 00000000000..a3285a2cc87 --- /dev/null +++ b/keyboards/handwired/tradestation/tradestation.c @@ -0,0 +1 @@ +#include "tradestation.h" diff --git a/keyboards/handwired/tradestation/tradestation.h b/keyboards/handwired/tradestation/tradestation.h new file mode 100644 index 00000000000..60b53b7ddf1 --- /dev/null +++ b/keyboards/handwired/tradestation/tradestation.h @@ -0,0 +1,27 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 } \ +} + +#define LAYOUT_tradestation( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K22, \ + K30, K32 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, KC_NO, K22, KC_NO }, \ + { K30, KC_NO, K32, KC_NO } \ +} diff --git a/keyboards/handwired/traveller/config.h b/keyboards/handwired/traveller/config.h index 2b82da447f0..3812ec61f38 100644 --- a/keyboards/handwired/traveller/config.h +++ b/keyboards/handwired/traveller/config.h @@ -55,7 +55,6 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 - /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW @@ -63,9 +62,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -111,11 +109,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/traveller/keymaps/default/keymap.c b/keyboards/handwired/traveller/keymaps/default/keymap.c index 13d889ab8b5..4802b053451 100644 --- a/keyboards/handwired/traveller/keymaps/default/keymap.c +++ b/keyboards/handwired/traveller/keymaps/default/keymap.c @@ -1,6 +1,5 @@ -#include "traveller.h" +#include QMK_KEYBOARD_H #include "mousekey.h" -#include "action_layer.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -9,20 +8,20 @@ #define _HI 2 #define _NAV 4 #define _CUR 5 -#define _FKEYS 6 +#define _FKEYS 6 #define _TRNS 8 // We do the same trick for functions #define RGBLED_TOGGLE 10 #define _HIOUT 15 #define _LWOUT 16 -// Macros -#define MDL 4 -#define MDR 5 -#define MUR 6 -#define MUL 3 - +enum custom_keycodes { + M_MUL = SAFE_RANGE, + M_MDL, + M_MDR, + M_MUR +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -35,17 +34,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+ // +------+------+------+------+------+------| * | Shift| Z | Del | GUI | Low | Bspc |/Enter| Spc | Hi | GUI | Alt | / |Shift | * `------------------------------------------------------------------------------------------' - * + * */ -[_QW] = KEYMAP( - F(_NAV), KC_GRV, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_MINS, KC_EQL, - KC_TAB, KC_Q, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_P, KC_BSLS, - CTL_T(KC_ESC), KC_A, KC_X, KC_C, KC_V, KC_B, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SCLN, KC_QUOT, +[_QW] = KEYMAP( + TG(_NAV), KC_GRV, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_MINS, KC_EQL, + KC_TAB, KC_Q, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_P, KC_BSLS, + CTL_T(KC_ESC), KC_A, KC_X, KC_C, KC_V, KC_B, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SCLN, KC_QUOT, KC_LSFT, KC_Z, KC_DEL, KC_LGUI, MO(_LW), KC_BSPC, KC_ENTER, KC_SPC, MO(_HI), KC_RGUI, KC_RALT, KC_SLSH, KC_RSFT ), /* LOW - numbers, missing or awkward programming keys - Doubled 1 key allows lazy reach with ring finger. + Doubled 1 key allows lazy reach with ring finger. * ,-----------------------------------------. .-----------------------------------------. * | FKeys| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |Ctrl-alt-del| * |------+------+------+------+------+------| +------+------+------+------+------+------| @@ -55,18 +54,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+ // +------+------+------+------+------+------| * | Shift| | | | Low | |/ | | Hi | | | |Shift | * `------------------------------------------------------------------------------------------' - * + * */ -[_LW] = KEYMAP( - F(_FKEYS), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LCTL(LALT(KC_DEL)) , +[_LW] = KEYMAP( + TG(_FKEYS), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LCTL(LALT(KC_DEL)) , KC_TRNS, KC_1, KC_RBRC, KC_LPRN, KC_RPRN, KC_NO, KC_ASTR, KC_LPRN, KC_RPRN, KC_LBRC, KC_NO, KC_NO, KC_CAPS, KC_LBRC, KC_NO, KC_LCBR, KC_RCBR, KC_TILD, KC_TRNS, KC_HASH, KC_LCBR, KC_RCBR, KC_NO, KC_RBRC, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -/* HI - Punctuation, shell and -url ://@.com row on bottom, && is opposite || ^$ are in regex order: ^.*$ +/* HI - Punctuation, shell and +url ://@.com row on bottom, && is opposite || ^$ are in regex order: ^.*$ Right hand nav keys work pretty well chorded with the Right hand Hi Key * ,-----------------------------------------. .-----------------------------------------. * |FKEYS | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + | @@ -77,19 +76,19 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key * |------+------+------+------+------+------+ // +------+------+------+------+------+------| * | | / | | | Low | |/ | | Hi | PgDn | Left| Down | Right | * `------------------------------------------------------------------------------------------' - * + * */ -[_HI] = KEYMAP( - F(_FKEYS), KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, - KC_TRNS, KC_EXLM, KC_AMPR, KC_PIPE, KC_DLR, KC_PERC, KC_VOLU, KC_MUTE, KC_NO, KC_NO, KC_NO, KC_NO, +[_HI] = KEYMAP( + TG(_FKEYS),KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, + KC_TRNS, KC_EXLM, KC_AMPR, KC_PIPE, KC_DLR, KC_PERC, KC_VOLU, KC_MUTE, KC_NO, KC_NO, KC_NO, KC_NO, KC_CAPS, KC_CIRC, KC_COLN, KC_DOT, KC_ASTR, KC_MINS, KC_TRNS, KC_VOLD, KC_PPLS, KC_PGUP, KC_HOME, KC_UP, KC_END, - KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS, F(_LW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT -), + KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS, TT(_LW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT +), /* NAV - mouse & navigation //gui left and right are line home/end, or fore & back in browser -// Mouse buttons are reversed for comfort - bigger stretch is to the right button. +// Mouse buttons are reversed for comfort - bigger stretch is to the right button. * ,-----------------------------------------. .-----------------------------------------. * | NAV | | | Up | |Gui-> | | MwU | MS_UL| MS_U |MS_UR | |Ms Norm| @@ -102,16 +101,16 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key * `------------------------------------------------------------------------------------------' */ -[_NAV] = KEYMAP( - F(_NAV), KC_NO, KC_NO, KC_UP, KC_NO, RGUI(KC_RIGHT), KC_WH_U, M(MUL), KC_MS_U, M(MUR), KC_NO, KC_ACL2, +[_NAV] = KEYMAP( + TG(_NAV), KC_NO, KC_NO, KC_UP, KC_NO, RGUI(KC_RIGHT), KC_WH_U, M_MUL, KC_MS_U, M_MUR, KC_NO, KC_ACL2, KC_TRNS, RGUI(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_E), KC_BTN3, KC_MS_L, KC_MS_U, KC_MS_R, KC_NO, KC_ACL1, - KC_TRNS, LCTL(KC_A), LGUI(KC_X),RGUI(KC_C), RGUI(KC_V),KC_NO, KC_ENTER, KC_WH_D, M(MDL), KC_MS_D, M(MDR), KC_UP, KC_ACL0, + KC_TRNS, LCTL(KC_A), LGUI(KC_X),RGUI(KC_C), RGUI(KC_V),KC_NO, KC_ENTER, KC_WH_D, M_MDL, KC_MS_D, M_MDR, KC_UP, KC_ACL0, KC_TRNS, RGUI(KC_Z), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN1, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT ), /* FKEYS - Funtion keys & mac stuff * ,-----------------------------------------. .-----------------------------------------. - * | FKEYS| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | Ctrl | + * | FKEYS| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | Ctrl | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | F11 | F12 | F13 | F14 | F15 | Alt | * |------+------+------+------+------+------|------+------+------+------+------+------+------| @@ -120,13 +119,13 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key * | . |RGBTog| . | | LO | Bspc |/ | | HI | | | | | * `------------------------------------------------------------------------------------------' * - */ - -[_FKEYS] = KEYMAP( - F(_FKEYS), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RCTL, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LALT , - F(_QW), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, - KC_TRNS, F(RGBLED_TOGGLE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + */ + +[_FKEYS] = KEYMAP( + TG(_FKEYS),KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RCTL, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LALT , + TO(_QW), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, + KC_TRNS, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -140,51 +139,23 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key * |------+------+------+------+------+------+ // +------+------+------+------+------+------| * | . | . | . | GUI | LO | . |/ | Spc | HI | GUI | M0 | / |LSFT | * `------------------------------------------------------------------------------------------' - * + * */ [_TRNS] = { {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} } }; - -const uint16_t PROGMEM fn_actions[] = { - [_QW] = ACTION_LAYER_ON(_QW,ON_RELEASE), // return to QWERTY layer - [_LW] = ACTION_LAYER_TAP_TOGGLE(_LW), // Turn on LW when holding, or tap 3 times to switch - [_HI] = ACTION_LAYER_TAP_TOGGLE(_HI), // Turn on LW when holding, or tap 3 times to switch - [_NAV] = ACTION_LAYER_TOGGLE(_NAV), - [_FKEYS] = ACTION_LAYER_TOGGLE(_FKEYS), - [_LWOUT] = ACTION_LAYER_OFF(_LW,ON_RELEASE), - [_HIOUT] = ACTION_LAYER_OFF(_HI,ON_RELEASE), - - // Functions - [RGBLED_TOGGLE] = ACTION_FUNCTION(RGBLED_TOGGLE), - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - break; - +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { // from algernon's ErgoDox EZ layout, - case MUL: + case M_MUL: if (record->event.pressed) { mousekey_on(KC_MS_UP); mousekey_on(KC_MS_LEFT); @@ -193,9 +164,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) mousekey_off(KC_MS_LEFT); } mousekey_send(); - break; + return false; - case MUR: + case M_MUR: if (record->event.pressed) { mousekey_on(KC_MS_UP); mousekey_on(KC_MS_RIGHT); @@ -204,9 +175,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) mousekey_off(KC_MS_RIGHT); } mousekey_send(); - break; + return false; - case MDL: + case M_MDL: if (record->event.pressed) { mousekey_on(KC_MS_DOWN); mousekey_on(KC_MS_LEFT); @@ -215,9 +186,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) mousekey_off(KC_MS_LEFT); } mousekey_send(); - break; + return false; - case MDR: + case M_MDR: if (record->event.pressed) { mousekey_on(KC_MS_DOWN); mousekey_on(KC_MS_RIGHT); @@ -226,28 +197,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) mousekey_off(KC_MS_RIGHT); } mousekey_send(); - break; - - + return false; + default: + return true; } - return MACRO_NONE; + return true; }; - - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case RGBLED_TOGGLE: - //led operations - if (record->event.pressed) { - rgblight_toggle(); - } - break; - } -} - - - void LayerLEDSet(uint8_t layr) { switch (layr) { @@ -256,12 +212,12 @@ void LayerLEDSet(uint8_t layr) { break; case _LW: // deep purple - rgblight_setrgb(20,0,35); - break; + rgblight_setrgb(20,0,35); + break; case _HI: // light blue - rgblight_setrgb(0,20,20); - break; + rgblight_setrgb(0,20,20); + break; case _NAV: // Yellowy orange rgblight_setrgb(25,20,0); // brighter @@ -269,14 +225,14 @@ void LayerLEDSet(uint8_t layr) { case _FKEYS: // RED rgblight_setrgb(20,0,0); // brighter - break; + break; default: rgblight_setrgb(20,2,20);//error break; } - + return; - + } void matrix_init_user(void) { @@ -293,13 +249,6 @@ void matrix_scan_user(void) { } } - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } - - diff --git a/keyboards/handwired/traveller/rules.mk b/keyboards/handwired/traveller/rules.mk index 8568def3542..03673fdd194 100644 --- a/keyboards/handwired/traveller/rules.mk +++ b/keyboards/handwired/traveller/rules.mk @@ -1,5 +1,4 @@ - -#MCU = at90usb1287 +# MCU name MCU = atmega32u4 # Processor frequency. @@ -58,8 +57,6 @@ endif OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# MCU name - # Boot Section Size in *bytes* # Teensy halfKay 512 # Teensy++ halfKay 1024 diff --git a/keyboards/handwired/tritium_numpad/config.h b/keyboards/handwired/tritium_numpad/config.h new file mode 100644 index 00000000000..83333c0fb7f --- /dev/null +++ b/keyboards/handwired/tritium_numpad/config.h @@ -0,0 +1,83 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Handwired +#define PRODUCT Tritium Numpad +#define DESCRIPTION QMK keyboard firmware for handwired numpad + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 4 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS { D1, D0, D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F4, F6, B1, B2 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 4 + +/* Underlight configuration + */ + +#define RGB_DI_PIN D2 +#define RGBLED_NUM 4 // Number of LEDs + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + diff --git a/keyboards/handwired/tritium_numpad/info.json b/keyboards/handwired/tritium_numpad/info.json new file mode 100644 index 00000000000..bc10efc8215 --- /dev/null +++ b/keyboards/handwired/tritium_numpad/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "Tritium_numpad", + "url": "https://www.thingiverse.com/thing:2855938", + "maintainer": "qmk", + "width": 4, + "height": 6, + "layouts": { + "LAYOUT_numpad_6x4": { + "key_count": 21, + "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k10", "x":0, "y":1}, {"label":"k11", "x":1, "y":1}, {"label":"k12", "x":2, "y":1}, {"label":"k13", "x":3, "y":1}, {"label":"k20", "x":0, "y":2}, {"label":"k21", "x":1, "y":2}, {"label":"k22", "x":2, "y":2}, {"label":"k30", "x":0, "y":3}, {"label":"k31", "x":1, "y":3}, {"label":"k32", "x":2, "y":3}, {"label":"k23", "x":3, "y":2, "h":2}, {"label":"k40", "x":0, "y":4}, {"label":"k41", "x":1, "y":4}, {"label":"k42", "x":2, "y":4}, {"label":"k50", "x":0, "y":5, "w":2}, {"label":"k52", "x":2, "y":5}, {"label":"k43", "x":3, "y":4, "h":2}] + }, + "LAYOUT_nontra_6x4": { + "key_count": 22, + "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k10", "x":0, "y":1}, {"label":"k11", "x":1, "y":1}, {"label":"k12", "x":2, "y":1}, {"label":"k13", "x":3, "y":1}, {"label":"k20", "x":0, "y":2}, {"label":"k21", "x":1, "y":2}, {"label":"k22", "x":2, "y":2}, {"label":"k23", "x":3, "y":2, "h":2}, {"label":"k30", "x":0, "y":3}, {"label":"k31", "x":1, "y":3}, {"label":"k32", "x":2, "y":3}, {"label":"k40", "x":0, "y":4}, {"label":"k41", "x":1, "y":4}, {"label":"k42", "x":2, "y":4}, {"label":"k43", "x":3, "y":4, "h":2}, {"label":"k50", "x":0, "y":5}, {"label":"k51", "x":1, "y":5}, {"label":"k52", "x":2, "y":5}] + }, + "LAYOUT_ortho_6x4": { + "key_count": 24, + "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k10", "x":0, "y":1}, {"label":"k11", "x":1, "y":1}, {"label":"k12", "x":2, "y":1}, {"label":"k13", "x":3, "y":1}, {"label":"k20", "x":0, "y":2}, {"label":"k21", "x":1, "y":2}, {"label":"k22", "x":2, "y":2}, {"label":"k23", "x":3, "y":2}, {"label":"k30", "x":0, "y":3}, {"label":"k31", "x":1, "y":3}, {"label":"k32", "x":2, "y":3}, {"label":"k33", "x":3, "y":3}, {"label":"k40", "x":0, "y":4}, {"label":"k41", "x":1, "y":4}, {"label":"k42", "x":2, "y":4}, {"label":"k43", "x":3, "y":4}, {"label":"k50", "x":0, "y":5}, {"label":"k51", "x":1, "y":5}, {"label":"k52", "x":2, "y":5}, {"label":"k53", "x":3, "y":5}] + } + } +} diff --git a/keyboards/handwired/tritium_numpad/keymaps/blu/keymap.c b/keyboards/handwired/tritium_numpad/keymaps/blu/keymap.c new file mode 100644 index 00000000000..958c17e4283 --- /dev/null +++ b/keyboards/handwired/tritium_numpad/keymaps/blu/keymap.c @@ -0,0 +1,40 @@ +#include QMK_KEYBOARD_H + +void keyboard_pre_init_user(void) +{ + // Set layer LED as an output + setPinOutput(B0); +} + +uint32_t layer_state_set_user(uint32_t state) +{ + // Switch layer LED accordingly + switch (biton32(state)) { + case 0: + writePinHigh(B0); + break; + case 1: + writePinLow(B0); + break; + } + return state; +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_6x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_BSPC, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_P0, KC_UP, KC_PDOT, TT(1), + KC_LEFT, KC_DOWN, KC_RGHT, BL_STEP + ), + [1] = LAYOUT_ortho_6x4( + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_K, KC_NO, KC_NO, + KC_H, KC_NO, KC_L, KC_NO, + KC_NO, KC_J, KC_NO, KC_NO, + KC_LSFT, KC_Z, KC_X, KC_TRNS, + KC_NO, KC_NO, KC_NO, KC_NO + ) +}; diff --git a/keyboards/handwired/tritium_numpad/keymaps/blu/layers.json b/keyboards/handwired/tritium_numpad/keymaps/blu/layers.json new file mode 100644 index 00000000000..5335c651fa8 --- /dev/null +++ b/keyboards/handwired/tritium_numpad/keymaps/blu/layers.json @@ -0,0 +1 @@ +[["KC_NLCK", "KC_PSLS", "KC_PAST", "KC_PMNS", "KC_P7", "KC_P8", "KC_P9", "KC_PPLS", "KC_P4", "KC_P5", "KC_P6", "KC_BSPC", "KC_P1", "KC_P2", "KC_P3", "KC_PENT", "KC_P0", "KC_UP", "KC_PDOT", "TT(1)", "KC_LEFT", "KC_DOWN", "KC_RGHT", "BL_STEP"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_K", "KC_NO", "KC_NO", "KC_H", "KC_NO", "KC_L", "KC_NO", "KC_NO", "KC_J", "KC_NO", "KC_NO", "KC_LSFT", "KC_Z", "KC_X", "KC_TRNS", "KC_NO", "KC_NO", "KC_NO", "KC_NO"]] \ No newline at end of file diff --git a/keyboards/handwired/tritium_numpad/keymaps/blu/readme.md b/keyboards/handwired/tritium_numpad/keymaps/blu/readme.md new file mode 100644 index 00000000000..fd07b155fb7 --- /dev/null +++ b/keyboards/handwired/tritium_numpad/keymaps/blu/readme.md @@ -0,0 +1,13 @@ +# Generated Keymap Layout + +This layout was generated by the QMK API. You can find the JSON data used to +generate this keymap in the file layers.json. + +To make use of this file you will need follow the following steps: + +* Download or Clone QMK Firmware: +* Extract QMK Firmware to a location on your hard drive +* Copy this folder into %s +* You are now ready to compile or use your keymap with the source + +More information can be found in the QMK docs: \ No newline at end of file diff --git a/keyboards/handwired/tritium_numpad/keymaps/default/keymap.c b/keyboards/handwired/tritium_numpad/keymaps/default/keymap.c new file mode 100644 index 00000000000..60430217b93 --- /dev/null +++ b/keyboards/handwired/tritium_numpad/keymaps/default/keymap.c @@ -0,0 +1,59 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-------------------. + * |Esc |TAB |BS | = | + * |----|----|----|----| + * | NL | / | * | - | + * |----|----|----|----| + * | 7 | 8 | 9 | | + * |----|----|----| + | + * | 4 | 5 | 6 | | + * |----|----|----|----| + * | 1 | 2 | 3 | | + * |----|----|----| En | + * | 0 |./FN| | + * `-------------------' + */ + + [_BL] = LAYOUT_numpad_6x4( + KC_ESC, KC_TAB, KC_BSPC, KC_PEQL, + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, + KC_P0, LT(_FL,KC_PDOT), KC_PENT + ), + + /* Keymap _FL: Function Layer + * ,-------------------. + * |Esc |TAB |BS | = | + * |----|----|----|----| + * | NL | / | * | - | + * |----|----|----|----| + * | 7 | 8 | 9 | | + * |----|----|----|RST | + * | 4 | 5 | 6 | | + * |----|----|----|----| + * | 1 | 2 | 3 | | + * |----|----|----| En | + * | 0 |./FN| | + * `-------------------' + */ + [_FL] = LAYOUT_numpad_6x4( + KC_ESC, KC_TAB, KC_BSPC, KC_PEQL, + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, RESET, + KC_P1, KC_P2, KC_P3, + KC_P0, LT(_FL,KC_PDOT), KC_PENT + ), +}; diff --git a/keyboards/handwired/tritium_numpad/keymaps/max/keymap.c b/keyboards/handwired/tritium_numpad/keymaps/max/keymap.c new file mode 100644 index 00000000000..bba5c43bbba --- /dev/null +++ b/keyboards/handwired/tritium_numpad/keymaps/max/keymap.c @@ -0,0 +1,59 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-------------------. + * |Esc |Setp| - | = | + * |----|----|----|----| + * | F1 | F2 | F3 | F4 | + * |----|----|----|----| + * | 7 | 8 | 9 | - | + * |----|----|----|----| + * | 4 | 5 | 6 | LF | + * |----|----|----|----| + * | 1 | 2 | 3 | \ | + * |----|----|----|----| + * |Left|Down| Up |Rght| + * `-------------------' + */ + + [_BL] = LAYOUT_ortho_6x4( + KC_ESC, KC_TAB, KC_MINS,KC_EQL, + KC_F1, KC_F2, KC_F3, KC_F4, + KC_P7, KC_P8, KC_P9, KC_PMNS, + KC_P4, KC_P5, KC_P6, KC_PENT, + KC_P1, KC_P2, KC_P3, KC_BSLS, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), + + /* Keymap _FL: Function Layer + * ,-------------------. + * |Esc |TAB |BS | = | + * |----|----|----|----| + * | NL | / | * | - | + * |----|----|----|----| + * | 7 | 8 | 9 | | + * |----|----|----|RST | + * | 4 | 5 | 6 | | + * |----|----|----|----| + * | 1 | 2 | 3 | | + * |----|----|----| En | + * | 0 |./FN| | + * `-------------------' + */ + [_FL] = LAYOUT_ortho_6x4( + KC_ESC, KC_TAB, KC_BSPC, KC_PEQL, + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, RESET, + KC_P4, KC_P5, KC_P6, KC_PENT, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), +}; diff --git a/keyboards/handwired/tritium_numpad/keymaps/ortho_left/keymap.c b/keyboards/handwired/tritium_numpad/keymaps/ortho_left/keymap.c new file mode 100644 index 00000000000..9d569f18a5b --- /dev/null +++ b/keyboards/handwired/tritium_numpad/keymaps/ortho_left/keymap.c @@ -0,0 +1,59 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-------------------. + * | T | G | B |Spac| + * |----|----|----|----| + * | R | F | V | Fn | + * |----|----|----|----| + * | E | D | C | OS | + * |----|----|----|----| + * | W | S | X | Alt| + * |----|----|----|----| + * | Q | A | Z | Ctl| + * |----|----|----|----| + * | Esc| Tab|Shft| Fn2| + * `-------------------' + */ + + [_BL] = LAYOUT_ortho_6x4( + KC_T, KC_G, KC_B, KC_SPACE, + KC_R, KC_F, KC_V, MO(1), + KC_E, KC_D, KC_C, KC_LGUI, + KC_W, KC_S, KC_X, KC_LALT, + KC_Q, KC_A, KC_Z, KC_LCTL, + KC_TAB, KC_ESC, KC_LSHIFT, MO(1) + ), + + /* Keymap _FL: Function Layer + * ,-------------------. + * | 5 | F5 | F11|Spac| + * |----|----|----|----| + * | 4 | F4 | F10| | + * |----|----|----|----| + * | 3 | F3 | F9 | OS | + * |----|----|----|----| + * | 2 | F2 | F8 | Alt| + * |----|----|----|----| + * | 1 | F1 | F7 | Ctl| + * |----|----|----|----| + * | ` | Del|Shft| | + * `-------------------' + */ + [_FL] = LAYOUT_ortho_6x4( + KC_5, KC_F5, KC_F11, _______, + KC_4, KC_F4, KC_F10, _______, + KC_3, KC_F3, KC_F9, _______, + KC_2, KC_F2, KC_F8, _______, + KC_1, KC_F1, KC_F7, _______, + KC_GRV,KC_DEL, _______, _______ + ), +}; diff --git a/keyboards/handwired/tritium_numpad/keymaps/ortho_right/keymap.c b/keyboards/handwired/tritium_numpad/keymaps/ortho_right/keymap.c new file mode 100644 index 00000000000..0dc2f81bc2b --- /dev/null +++ b/keyboards/handwired/tritium_numpad/keymaps/ortho_right/keymap.c @@ -0,0 +1,61 @@ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-------------------. + * |Spac| N | H | Y | + * |----|----|----|----| + * | Fn | M | J | U | + * |----|----|----|----| + * |Left| , | K | I | + * |----|----|----|----| + * |Down| . | L | O | + * |----|----|----|----| + * | Up | / | ; | P | + * |----|----|----|----| + * |Rght| Ret| " |Bspc| + * `-------------------' + */ + [_BL] = LAYOUT_ortho_6x4( + KC_SPACE, KC_N, KC_H, KC_Y, + MO(1), KC_M, KC_J, KC_U, + KC_LEFT, KC_COMM, KC_K, KC_I, + KC_DOWN, KC_DOT, KC_L, KC_O, + KC_UP, KC_SLASH, KC_SCLN, KC_P, + KC_RIGHT, KC_ENT, KC_QUOT, KC_BSPC + ), + + /* Keymap _FL: Function Layer + * ,-------------------. + * |Esc | F12| F6 | 6 | + * |----|----|----|----| + * | NL | M | - | 7 | + * |----|----|----|----| + * |Left| , | = | 8 | + * |----|----|----|----| + * |Down| . | [ | 9 | + * |----|----|----|----| + * | Up | / | ] | 0 | + * |----|----|----|----| + * |Rght| Ret| \ | Del| + * `-------------------' + */ + [_FL] = LAYOUT_ortho_6x4( + _______, KC_F12, KC_F6, KC_6, + _______, _______, KC_MINS, KC_7, + _______, _______, KC_EQL, KC_8, + _______, _______, KC_LBRC, KC_9, + _______, _______, KC_RBRC, KC_0, + _______, _______, KC_BSLS, KC_DEL + ), +}; diff --git a/keyboards/handwired/tritium_numpad/readme.md b/keyboards/handwired/tritium_numpad/readme.md new file mode 100644 index 00000000000..21acfe759c0 --- /dev/null +++ b/keyboards/handwired/tritium_numpad/readme.md @@ -0,0 +1,28 @@ +Tritium Numpad +=== + +Keyboard Maintainer: QMK Community +Hardware Supported: Handwired 6x4 numpads using promicro controller +Hardware Availability: https://www.thingiverse.com/thing:2855938 + +Wiring is accomplished on the Pro Micro board using the following pins as rows: +* D2 : Row 1 +* D3 : Row 2 +* D4 : Row 3 +* D5 : Row 4 +* D6 : Row 5 +* D7 : Row 6 + +and the following pins as columns: +* A3 : Col 1 +* A1 : Col 2 +* D15 : Col 3 +* D16 : Col 4 + +Make example for this keyboard (after setting up your build environment): + + make tritium_numpad:default + +Bootmagic is enabled. Press the key at 0,0 (usually escape or numlock in the top left corner) while plugging the keyboard in to jump to bootloader. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/handwired/tritium_numpad/rules.mk b/keyboards/handwired/tritium_numpad/rules.mk new file mode 100644 index 00000000000..c990a6ab14d --- /dev/null +++ b/keyboards/handwired/tritium_numpad/rules.mk @@ -0,0 +1,61 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Key at 0,0 makes the keyboard go into bootloader(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID + +LAYOUTS = numpad_6x4 ortho_6x4 nontra_6x4 diff --git a/keyboards/handwired/tritium_numpad/tritium_numpad.c b/keyboards/handwired/tritium_numpad/tritium_numpad.c new file mode 100644 index 00000000000..7193a934d60 --- /dev/null +++ b/keyboards/handwired/tritium_numpad/tritium_numpad.c @@ -0,0 +1,29 @@ +#include "tritium_numpad.h" +#include "led.h" + +void keyboard_pre_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + keyboard_pre_init_user(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + // * Set our LED pins as output + // Numlock LED + setPinOutput(D5); +} + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(D5); + } else { + writePinHigh(D5); + } +} diff --git a/keyboards/handwired/tritium_numpad/tritium_numpad.h b/keyboards/handwired/tritium_numpad/tritium_numpad.h new file mode 100644 index 00000000000..8d2e783296e --- /dev/null +++ b/keyboards/handwired/tritium_numpad/tritium_numpad.h @@ -0,0 +1,95 @@ +#pragma once + +#include "quantum.h" + +// readability +#define XXX KC_NO + +/* matrix layout + * ,-------------------. + * | 00 | 01 | 02 | 03 | + * |----|----|----|----| + * | 10 | 11 | 12 | 13 | + * |----|----|----|----| + * | 20 | 21 | 22 | | + * |----|----|----| 23 | + * | 30 | 31 | 32 | | + * |----|----|----|----| + * | 40 | 41 | 42 | | + * |----|----|----| 43 | + * | 50 | 52 | | + * `-------------------' + */ +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_numpad_6x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k23, \ + k40, k41, k42, \ + k50, k52, k43 \ +) \ +{ \ + {k00, k01, k02, k03}, \ + {k10, k11, k12, k13}, \ + {k20, k21, k22, k23}, \ + {k30, k31, k32, XXX}, \ + {k40, k41, k42, k43}, \ + {k50, XXX, k52, XXX} \ +} + +/* matrix layout + * ,-------------------. + * | 00 | 01 | 02 | 03 | + * |----|----|----|----| + * | 10 | 11 | 12 | 13 | + * |----|----|----|----| + * | 20 | 21 | 22 | | + * |----|----|----| 23 | + * | 30 | 31 | 32 | | + * |----|----|----|----| + * | 40 | 41 | 42 | | + * |----|----|----| 43 | + * | 50 | 51 | 52 | | + * `-------------------' + */ +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_nontra_6x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k23, \ + k40, k41, k42, \ + k50, k51, k52, k43 \ +) \ +{ \ + {k00, k01, k02, k03}, \ + {k10, k11, k12, k13}, \ + {k20, k21, k22, k23}, \ + {k30, k31, k32, xxx}, \ + {k40, k41, k42, k43}, \ + {k50, k51, k52, xxx} \ +} + +#define LAYOUT_ortho_6x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, k23, \ + k30, k31, k32, k33, \ + k40, k41, k42, k43, \ + k50, k51, k52, k53 \ +) \ +{ \ + {k00, k01, k02, k03}, \ + {k10, k11, k12, k13}, \ + {k20, k21, k22, k23}, \ + {k30, k31, k32, k33}, \ + {k40, k41, k42, k43}, \ + {k50, k51, k52, k53} \ +} + +void keyboard_pre_init_user(void); +void matrix_scan_user(void); + diff --git a/keyboards/handwired/woodpad/config.h b/keyboards/handwired/woodpad/config.h index b2eb7020fc4..d08c47387f9 100644 --- a/keyboards/handwired/woodpad/config.h +++ b/keyboards/handwired/woodpad/config.h @@ -46,7 +46,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B1, B3, B2, B6 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 @@ -54,7 +54,7 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -99,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/handwired/woodpad/keymaps/default/config.h b/keyboards/handwired/woodpad/keymaps/default/config.h index f52a97bbc86..a72596783dd 100644 --- a/keyboards/handwired/woodpad/keymaps/default/config.h +++ b/keyboards/handwired/woodpad/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/handwired/woodpad/keymaps/default/keymap.c b/keyboards/handwired/woodpad/keymaps/default/keymap.c index 1fa90ba919a..838c14ead55 100644 --- a/keyboards/handwired/woodpad/keymaps/default/keymap.c +++ b/keyboards/handwired/woodpad/keymaps/default/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "woodpad.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -24,10 +24,6 @@ #define _ALT 2 #define _ADJUST 3 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMLOCK] = KEYMAP( /* Base */ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,\ @@ -59,10 +55,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void numlock_led_on(void) { PORTF |= (1<<7); } @@ -94,7 +86,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_ADJUST); } numlock_down = false; - } + } return false; break; case KC_LALT: diff --git a/keyboards/handwired/woodpad/keymaps/default/rules.mk b/keyboards/handwired/woodpad/keymaps/default/rules.mk index f060db79c0b..fce19bfaa8f 100644 --- a/keyboards/handwired/woodpad/keymaps/default/rules.mk +++ b/keyboards/handwired/woodpad/keymaps/default/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/handwired/woodpad/keymaps/drashna/README.md b/keyboards/handwired/woodpad/keymaps/drashna/README.md deleted file mode 100644 index f24d2c48f6c..00000000000 --- a/keyboards/handwired/woodpad/keymaps/drashna/README.md +++ /dev/null @@ -1,25 +0,0 @@ -Overview -======== - -This is my personal Numpad (Woodpad) configuration, and my daily driver. - -Most of the code resides in my userspace, rather than here, as I have multiple keyboards. - -How to build ------------- -make handwired/woodpad:drashna:avrdude - -Layers ------- -* NUMLOCK: Num pad, locked to NUM LOCK enabled. -* NAV: Navigation codes without needing to enable numlock. -* DIABLO: This contains a Diablo 3 layout, that requires much less reaching or shifting. If Tap Dance is enabled, then it has a "spam" feature. See Userspace for details. -* MACROS: This layer contains a bunch of macros for spamming chat, with a toggle on what key to open up chat with. -* MEDIA: Media and RGB commands - -All layers have RGB specific indicators, so you can see what layer you're on by the underglow. - -Woodpad Specific Code ---------------------- - -Aside from my userspace code, this includes LED indications for numlock and macro mode. It also forces NUMLOCK to be enabled. diff --git a/keyboards/handwired/woodpad/keymaps/drashna/config.h b/keyboards/handwired/woodpad/keymaps/drashna/config.h deleted file mode 100644 index c4f28034c87..00000000000 --- a/keyboards/handwired/woodpad/keymaps/drashna/config.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H - -#if (defined(TAP_DANCE_ENABLE) && !defined(TAPPING_TERM)) -#define TAPPING_TERM 200 -#endif // TAP_DANCE_ENABLE - - -#define B5_AUDIO - - -#ifdef RGBLIGHT_ENABLE -#define RGB_DI_PIN D3 -#define RGBLED_NUM 14 // Number of LEDs -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 -#define RGBLIGHT_SLEEP -#endif // RGBLIGHT_ENABLE - -#define FORCE_NKRO - -#endif diff --git a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c deleted file mode 100644 index fd1ff005351..00000000000 --- a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "drashna.h" - - // Each layer gets a name for readability, which is then used in the keymap matrix below. - // The underscores don't mean anything - you can have a layer called STUFF or any other name. - // Layer names don't all need to be of the same length, obviously, and you can also skip them - // entirely and just use numbers. - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - - - - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_NUMLOCK] = KEYMAP( /* Base */ - TG(_NAV), TG(_DIABLO), TG(_MACROS), KC_PSLS,\ - KC_P7, KC_P8, KC_P9, KC_PAST, \ - KC_P4, KC_P5, KC_P6, KC_PMNS, \ - KC_P1, KC_P2, KC_P3, KC_PPLS, \ - LT(_MEDIA,KC_P0), KC_PDOT, KC_COLN, KC_PENT \ -), -[_NAV] = KEYMAP( /* Base */ - _______, _______, _______, _______,\ - KC_HOME, KC_UP, KC_PGUP, _______, \ - KC_LEFT, XXXXXXX, KC_RIGHT, _______, \ - KC_END, KC_DOWN, KC_PGDN, _______, \ - KC_INS, KC_DEL, _______, _______ \ -), -[_DIABLO] = KEYMAP( /* Base */ - KC_ESC, _______, XXXXXXX, _______,\ - KC_S, KC_I, KC_F, KC_M, \ - KC_1, KC_2, KC_3, KC_4, \ - KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, \ - XXXXXXX, KC_DIABLO_CLEAR, KC_Q, SFT_T(KC_SPACE) \ -), - -[_MACROS] = KEYMAP( /* Base */ - KC_OVERWATCH, XXXXXXX, _______, XXXXXXX,\ - KC_JUSTGAME, XXXXXXX, XXXXXXX, KC_C9, \ - XXXXXXX, XXXXXXX, KC_AIM, KC_GGEZ, \ - KC_SYMM, KC_TORB, XXXXXXX, KC_GOODGAME, \ - KC_SALT, KC_MORESALT, KC_SALTHARD, KC_GLHF \ -), -[_MEDIA] = KEYMAP( /* Base */ - KC_RESET, KC_MUTE, KC_VOLD, KC_VOLU,\ - KC_MAKE, _______, RGB_HUI, RGB_HUD, \ - KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, \ - RGB_TOG, RGB_SMOD, RGB_SAI, RGB_VAI, \ - _______, KC_RGB_T, RGB_SAD, RGB_VAD \ -), - -}; - - -void numlock_led_on(void) { - PORTF |= (1 << 7); -} - -void numlock_led_off(void) { - PORTF &= ~(1 << 7); -} - - - -void matrix_init_keymap(void) { - // set Numlock LED to output and low - DDRF |= (1 << 7); - PORTF &= ~(1 << 7); -} - -void matrix_scan_keymap(void) { - numlock_led_off(); - if ((is_overwatch && biton32(layer_state) == _MACROS) || (biton32(layer_state) == _NUMLOCK)) { - numlock_led_on(); - } - - // Run Diablo 3 macro checking code. -} - -void led_set_keymap(uint8_t usb_led) { - if (!(usb_led & (1<. #include "config_common.h" /* Use I2C or Serial, not both */ - -// #define USE_SERIAL #define USE_I2C -#define SCL_CLOCK 400000UL +#define SCL_CLOCK 800000UL /* Select hand configuration */ - #define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - //#define DEBUG_MATRIX_SCAN_RATE //Use this to determine scan-rate. #define FORCE_NKRO @@ -38,6 +32,7 @@ along with this program. If not, see . #define QMK_KEYS_PER_SCAN 4 //if we press four keys simultaneously, lets process them simultaneously... #define DIODE_DIRECTION COL2ROW + #ifdef AUDIO_ENABLE #define C6_AUDIO #define STARTUP_SONG SONG(STARTUP_SOUND) diff --git a/keyboards/handwired/xealous/keymaps/default/keymap.c b/keyboards/handwired/xealous/keymaps/default/keymap.c index a07e64fd707..4e691a0a76d 100644 --- a/keyboards/handwired/xealous/keymaps/default/keymap.c +++ b/keyboards/handwired/xealous/keymaps/default/keymap.c @@ -11,9 +11,6 @@ extern keymap_config_t keymap_config; #define _NUMPAD 1 #define _FN 2 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define FN MO(_FN) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/handwired/xealous/matrix.c b/keyboards/handwired/xealous/matrix.c index 27fad000832..e2d21993917 100644 --- a/keyboards/handwired/xealous/matrix.c +++ b/keyboards/handwired/xealous/matrix.c @@ -34,311 +34,21 @@ along with this program. If not, see . #include "matrix_scanrate.h" #endif - - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# error "only i2c supported" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; -static matrix_row_t* debouncing_matrix_hand_offsetted; //pointer to matrix_debouncing for our hand -static matrix_row_t* matrix_hand_offsetted; // pointer to matrix for our hand - -//Debouncing counters -typedef uint8_t debounce_counter_t; -#define DEBOUNCE_COUNTER_MODULO 250 -#define DEBOUNCE_COUNTER_INACTIVE 251 -static debounce_counter_t debounce_counters[MATRIX_ROWS * MATRIX_COLS]; -static debounce_counter_t *debounce_counters_hand_offsetted; - - -#if (DIODE_DIRECTION == ROW2COL) - error "Only Col2Row supported"; -#endif -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); -static void unselect_row(uint8_t row); -static matrix_row_t optimized_col_reader(void); - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -__attribute__ ((weak)) -void matrix_slave_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1<= (b) ? (a) - (b) : (max) - (b) + (a)) -void update_debounce_counters(uint8_t current_time) -{ - debounce_counter_t *debounce_pointer = debounce_counters_hand_offsetted; - for (uint8_t row = 0; row < ROWS_PER_HAND; row++) - { - for (uint8_t col = 0; col < MATRIX_COLS; col++) - { - if (*debounce_pointer != DEBOUNCE_COUNTER_INACTIVE) - { - if (TIMER_DIFF(current_time, *debounce_pointer, DEBOUNCE_COUNTER_MODULO) >= - DEBOUNCING_DELAY) { - *debounce_pointer = DEBOUNCE_COUNTER_INACTIVE; - } - } - debounce_pointer++; - } - } -} - -void transfer_matrix_values(uint8_t current_time) -{ - //upload from debounce_matrix to final matrix; - debounce_counter_t *debounce_pointer = debounce_counters_hand_offsetted; - for (uint8_t row = 0; row < ROWS_PER_HAND; row++) - { - matrix_row_t row_value = matrix_hand_offsetted[row]; - matrix_row_t debounce_value = debouncing_matrix_hand_offsetted[row]; - - for (uint8_t col = 0; col < MATRIX_COLS; col++) - { - bool final_value = debounce_value & (1 << col); - bool current_value = row_value & (1 << col); - if (*debounce_pointer == DEBOUNCE_COUNTER_INACTIVE - && (current_value != final_value)) - { - *debounce_pointer = current_time; - row_value ^= (1 << col); - } - debounce_pointer++; - } - matrix_hand_offsetted[row] = row_value; - } -} - -uint8_t _matrix_scan(void) -{ - uint8_t current_time = timer_read() % DEBOUNCE_COUNTER_MODULO; - - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { - select_row(current_row); - asm volatile ("nop"); asm volatile("nop"); - - debouncing_matrix_hand_offsetted[current_row] = optimized_col_reader(); - // Unselect row - unselect_row(current_row); - } - - update_debounce_counters(current_time); - transfer_matrix_values(current_time); - - return 1; -} - - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(I2C_KEYMAP_START); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -uint8_t matrix_scan(void) +void matrix_scan_user(void) { #ifdef DEBUG_MATRIX_SCAN_RATE matrix_check_scan_rate(); matrix_time_between_scans(); #endif - uint8_t ret = _matrix_scan(); - - if( i2c_transaction() ) { - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[I2C_KEYMAP_START+i] = matrix[offset+i]; - } - - matrix_slave_scan_user(); -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } + } -inline -static matrix_row_t optimized_col_reader(void) { +// Copy this code to split_common/matrix.c, +// and call it instead of the unoptimized col_reader. Scan-rate jumps from 1200->1920 +// Also remove the sleep_us(30), not necessary for this keyboard. +// In usb_descriptor.c, set .PollingIntervalMS = 0x01 +#define ROW_SHIFTER ((uint8_t)1) +inline static matrix_row_t optimized_col_reader(void) { //MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } return (PINB & (1 << 6) ? 0 : (ROW_SHIFTER << 0)) | (PINB & (1 << 2) ? 0 : (ROW_SHIFTER << 1)) | @@ -351,26 +61,3 @@ static matrix_row_t optimized_col_reader(void) { } -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - diff --git a/keyboards/handwired/xealous/readme.md b/keyboards/handwired/xealous/readme.md index 97bebbfe3a8..14947cc90c5 100644 --- a/keyboards/handwired/xealous/readme.md +++ b/keyboards/handwired/xealous/readme.md @@ -130,13 +130,13 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep" // or the equivalent in dfu-programmer ``` and similarly for right half ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-righthand.eep" // or the equivalent in dfu-programmer ``` diff --git a/keyboards/handwired/xealous/rev1/config.h b/keyboards/handwired/xealous/rev1/config.h index 6fc769b5f21..ab39dfbc1d9 100644 --- a/keyboards/handwired/xealous/rev1/config.h +++ b/keyboards/handwired/xealous/rev1/config.h @@ -62,12 +62,7 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +#define DEBOUNCE 5 /* * Feature disable options diff --git a/keyboards/handwired/xealous/rules.mk b/keyboards/handwired/xealous/rules.mk index eebd11d86ec..ef3357982ea 100644 --- a/keyboards/handwired/xealous/rules.mk +++ b/keyboards/handwired/xealous/rules.mk @@ -1,4 +1,4 @@ -SRC += matrix_scanrate.c matrix.c +SRC += matrix_scanrate.c matrix.c # MCU name MCU = atmega32u4 @@ -37,7 +37,7 @@ F_USB = $(F_CPU) # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -59,14 +59,14 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SPLIT_KEYBOARD = yes # Use shared split_common code SUBPROJECT_rev1 = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +DEBOUNCE_TYPE = eager_pk LAYOUTS = split60 diff --git a/keyboards/handwired/xealousbrown/README.md b/keyboards/handwired/xealousbrown/README.md new file mode 100644 index 00000000000..e6092ebb059 --- /dev/null +++ b/keyboards/handwired/xealousbrown/README.md @@ -0,0 +1,11 @@ +# XealouS Brown + +My first handwired keyboard. Originally used TMK, now ported in full glory to QMK. + +Build log at: +https://sites.google.com/site/xaelous/keyboards/handwired-keyboard + +Make example for this keyboard (after setting up your build environment): + + make handwired/xealous-brown:default + diff --git a/keyboards/handwired/xealousbrown/config.h b/keyboards/handwired/xealousbrown/config.h new file mode 100644 index 00000000000..17aa6c94ee5 --- /dev/null +++ b/keyboards/handwired/xealousbrown/config.h @@ -0,0 +1,48 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x606A +#define DEVICE_VER 0x0002 +#define MANUFACTURER XeaL +#define PRODUCT XeaLous Brown Keyboard +#define DESCRIPTION XeaLous Brown Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 13 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D2, D1, D0, D4 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 } +#define UNUSED_PINS { } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/handwired/xealousbrown/info.json b/keyboards/handwired/xealousbrown/info.json new file mode 100644 index 00000000000..c39e762178d --- /dev/null +++ b/keyboards/handwired/xealousbrown/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "Xealous-Brown", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/handwired/xealousbrown/keymaps/default/keymap.c b/keyboards/handwired/xealousbrown/keymaps/default/keymap.c new file mode 100644 index 00000000000..6597c56673e --- /dev/null +++ b/keyboards/handwired/xealousbrown/keymaps/default/keymap.c @@ -0,0 +1,18 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Main layer */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,\ + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENTER, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_BSLS, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_BSPC \ + ), + [1] = LAYOUT( /* FN_Layer */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK,KC_PAUS,\ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_DEL, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS,KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL \ + ) +}; diff --git a/keyboards/handwired/xealousbrown/rules.mk b/keyboards/handwired/xealousbrown/rules.mk new file mode 100644 index 00000000000..2bad9a1c6ec --- /dev/null +++ b/keyboards/handwired/xealousbrown/rules.mk @@ -0,0 +1,60 @@ + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = caterina +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + + diff --git a/keyboards/handwired/xealousbrown/xealousbrown.c b/keyboards/handwired/xealousbrown/xealousbrown.c new file mode 100644 index 00000000000..5c8e2fb18a5 --- /dev/null +++ b/keyboards/handwired/xealousbrown/xealousbrown.c @@ -0,0 +1,8 @@ +#include "xealousbrown.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} diff --git a/keyboards/handwired/xealousbrown/xealousbrown.h b/keyboards/handwired/xealousbrown/xealousbrown.h new file mode 100644 index 00000000000..ff449e43244 --- /dev/null +++ b/keyboards/handwired/xealousbrown/xealousbrown.h @@ -0,0 +1,20 @@ +#ifndef XEALOUSBROWN_H +#define XEALOUSBROWN_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K45, K46, K47, K48, K49, K4C \ + ) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, K46, K47, K48, K49, KC_NO, KC_NO, K4C } \ +} + +#endif diff --git a/keyboards/hecomi/alpha/config.h b/keyboards/hecomi/alpha/config.h new file mode 100644 index 00000000000..dbc94454f9b --- /dev/null +++ b/keyboards/hecomi/alpha/config.h @@ -0,0 +1,247 @@ +/* +Copyright 2018 takashiski + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER takashiski +#define PRODUCT hecomi_alpha +#define DESCRIPTION asymmetric split keyboard + +/* key matrix size */ +//#define MATRIX_ROWS 5 +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C6,D7,E6,B4,B5 } +#define MATRIX_COL_PINS { F4,F5,F6,F7,B1,B3,B2,B6 } +#define UNUSED_PINS +#define SOFT_SERIAL_PIN D1 // or D1, D2, D3, E6 +//#define USE_I2C + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, an3 define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + #define RGB_DI_PIN D4 + #ifdef RGB_DI_PIN + #define RGBLED_NUM 16 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING + #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 +// +/* +#define USE_I2C +#define MASTER_LEFT +#define EEHANDS +*/ +#define RGBLED_SPLIT {8,8} diff --git a/keyboards/hecomi/alpha/info.json b/keyboards/hecomi/alpha/info.json new file mode 100644 index 00000000000..49c8d4c467b --- /dev/null +++ b/keyboards/hecomi/alpha/info.json @@ -0,0 +1,364 @@ +{ + "keyboard_name": "hecomi/alpha", + "url": "https://skyhigh-works.hatenablog.com/entry/2019/02/25/221959", + "maintainer": "takashiski", + "width": 16.25, + "height": 5, + "key_count": 69, + "layouts": { + "LAYOUT": { + "layout": [ + { + "label": "Esc", + "x": 0, + "y": 0 + }, + { + "label": "!", + "x": 1, + "y": 0 + }, + { + "label": "@", + "x": 2, + "y": 0 + }, + { + "label": "#", + "x": 3, + "y": 0 + }, + { + "label": "$", + "x": 4, + "y": 0 + }, + { + "label": "%", + "x": 5, + "y": 0 + }, + { + "label": "^", + "x": 6, + "y": 0 + }, + { + "label": "&", + "x": 8.25, + "y": 0 + }, + { + "label": "*", + "x": 9.25, + "y": 0 + }, + { + "label": "(", + "x": 10.25, + "y": 0 + }, + { + "label": ")", + "x": 11.25, + "y": 0 + }, + { + "label": "_", + "x": 12.25, + "y": 0 + }, + { + "label": "+", + "x": 13.25, + "y": 0 + }, + { + "label": "|", + "x": 14.25, + "y": 0 + }, + { + "label": "~", + "x": 15.25, + "y": 0 + }, + { + "label": "Tab", + "x": 0, + "y": 1, + "w": 1.5 + }, + { + "label": "Q", + "x": 1.5, + "y": 1 + }, + { + "label": "W", + "x": 2.5, + "y": 1 + }, + { + "label": "E", + "x": 3.5, + "y": 1 + }, + { + "label": "R", + "x": 4.5, + "y": 1 + }, + { + "label": "T", + "x": 5.5, + "y": 1 + }, + { + "label": "Y", + "x": 6.5, + "y": 1 + }, + { + "label": "Y", + "x": 7.75, + "y": 1 + }, + { + "label": "U", + "x": 8.75, + "y": 1 + }, + { + "label": "I", + "x": 9.75, + "y": 1 + }, + { + "label": "O", + "x": 10.75, + "y": 1 + }, + { + "label": "P", + "x": 11.75, + "y": 1 + }, + { + "label": "{", + "x": 12.75, + "y": 1 + }, + { + "label": "}", + "x": 13.75, + "y": 1 + }, + { + "label": "Delete", + "x": 14.75, + "y": 1, + "w": 1.5 + }, + { + "label": "Control", + "x": 0, + "y": 2, + "w": 1.75 + }, + { + "label": "A", + "x": 1.75, + "y": 2 + }, + { + "label": "S", + "x": 2.75, + "y": 2 + }, + { + "label": "D", + "x": 3.75, + "y": 2 + }, + { + "label": "F", + "x": 4.75, + "y": 2 + }, + { + "label": "G", + "x": 5.75, + "y": 2 + }, + { + "label": "H", + "x": 8, + "y": 2 + }, + { + "label": "J", + "x": 9, + "y": 2 + }, + { + "label": "K", + "x": 10, + "y": 2 + }, + { + "label": "L", + "x": 11, + "y": 2 + }, + { + "label": ":", + "x": 12, + "y": 2 + }, + { + "label": "\"", + "x": 13, + "y": 2 + }, + { + "label": "Return", + "x": 14, + "y": 2, + "w": 2.25 + }, + { + "label": "Shift", + "x": 0, + "y": 3, + "w": 2.25 + }, + { + "label": "Z", + "x": 2.25, + "y": 3 + }, + { + "label": "X", + "x": 3.25, + "y": 3 + }, + { + "label": "C", + "x": 4.25, + "y": 3 + }, + { + "label": "V", + "x": 5.25, + "y": 3 + }, + { + "label": "B", + "x": 6.25, + "y": 3 + }, + { + "label": "B", + "x": 7.5, + "y": 3 + }, + { + "label": "N", + "x": 8.5, + "y": 3 + }, + { + "label": "M", + "x": 9.5, + "y": 3 + }, + { + "label": "<", + "x": 10.5, + "y": 3 + }, + { + "label": ">", + "x": 11.5, + "y": 3 + }, + { + "label": "?", + "x": 12.5, + "y": 3 + }, + { + "label": "Shift", + "x": 13.5, + "y": 3, + "w": 1.75 + }, + { + "label": "Fn", + "x": 15.25, + "y": 3 + }, + { + "x": 0, + "y": 4, + "w": 1.5 + }, + { + "label": "", + "x": 1.5, + "y": 4 + }, + { + "label": "GUI", + "x": 2.5, + "y": 4 + }, + { + "label": "無変換", + "x": 3.5, + "y": 4 + }, + { + "label": "tab", + "x": 4.5, + "y": 4 + }, + { + "x": 5.5, + "y": 4 + }, + { + "label": "Enter", + "x": 7.75, + "y": 4 + }, + { + "label": "BS", + "x": 8.75, + "y": 4 + }, + { + "label": "変換", + "x": 9.75, + "y": 4 + }, + { + "label": "GUI", + "x": 10.75, + "y": 4 + }, + { + "label": "Menu", + "x": 11.75, + "y": 4 + }, + { + "label": "", + "x": 12.75, + "y": 4 + } + ] + } + } +} diff --git a/keyboards/hecomi/alpha/readme.md b/keyboards/hecomi/alpha/readme.md new file mode 100644 index 00000000000..5b316245c30 --- /dev/null +++ b/keyboards/hecomi/alpha/readme.md @@ -0,0 +1,21 @@ +# hecomi_alpha + +![hecomi_alpha](https://imgur.com/a/5AwQw0r) + +This keyboard based on HHKB pro 2 and physical layout designed by @hecomi and @takashiski. + +This keyboard use 2 pro micro's, but you can use USB type-c. There are a bit tricky implementation. + +Keyboard Maintainer: [takashiski](https://github.com/takashiski) +Hardware Supported: hecomi_alpha, promicro +Hardware Availability: booth(@skyhigh_works) + +Make example for this keyboard (after setting up your build environment): + + make hecomi/alpha:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +and build guide is here. + +[build guide](https://skyhigh-works.hatenablog.com/entry/2019/02/25/221959) diff --git a/keyboards/hecomi/alpha/rules.mk b/keyboards/hecomi/alpha/rules.mk new file mode 100644 index 00000000000..06434e9621f --- /dev/null +++ b/keyboards/hecomi/alpha/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +SPLIT_KEYBOARD = yes diff --git a/keyboards/hecomi/hecomi.c b/keyboards/hecomi/hecomi.c new file mode 100644 index 00000000000..9d0d93fa173 --- /dev/null +++ b/keyboards/hecomi/hecomi.c @@ -0,0 +1,44 @@ +/* Copyright 2018 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "hecomi.h" +#include "split_util.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/hecomi/hecomi.h b/keyboards/hecomi/hecomi.h new file mode 100644 index 00000000000..ef90a8ead90 --- /dev/null +++ b/keyboards/hecomi/hecomi.h @@ -0,0 +1,89 @@ +/* Copyright 2018 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + + + +/* +Left hand : +7 +7 +6 +6 +6 + +32 + +Right hand: + +8 +8 +7 +8 +6 + +37 +*/ + +#define LAYOUT(\ + K00, K01, K02, K03, K04, K05, K06, K50, K51, K52, K53, K54, K55, K56, K57, \ + K10, K11, K12, K13, K14, K15, K16, K60, K61, K62, K63, K64, K65, K66, K67, \ + K20, K21, K22, K23, K24, K25, K71, K72, K73, K74, K75, K76, K77,\ + K30, K31, K32, K33, K34, K35, K80, K81, K82, K83, K84, K85, K86, K87, \ + K40, K41, K42, K43, K44, K45, K92, K93, K94, K95, K96, K97\ +) {\ + {K00, K01, K02, K03, K04, K05, K06, KC_NO},\ + {K10, K11, K12, K13, K14, K15, K16, KC_NO},\ + {K20, K21, K22, K23, K24, K25, KC_NO, KC_NO},\ + {K30, K31, K32, K33, K34, K35, KC_NO, KC_NO},\ + {K40, K41, K42, K43, K44, K45, KC_NO, KC_NO},\ + {K50, K51, K52, K53, K54, K55, K56, K57},\ + {K60, K61, K62, K63, K64, K65, K66, K67},\ + {KC_NO, K71, K72, K73, K74, K75, K76, K77},\ + {K80, K81, K82, K83, K84, K85, K86, K87},\ + {KC_NO, KC_NO, K92, K93, K94, K95, K96, K97}\ +} + +#define LAYOUT_kc(\ +K00, K01, K02, K03, K04, K05, K06, K50, K51, K52, K53, K54, K55, K56, K57, \ +K10, K11, K12, K13, K14, K15, K16, K60, K61, K62, K63, K64, K65, K66, K67, \ +K20, K21, K22, K23, K24, K25, K71, K72, K73, K74, K75, K76, K77,\ +K30, K31, K32, K33, K34, K35, K80, K81, K82, K83, K84, K85, K86, K87, \ + K40, K41, K42, K43, K44, K45, K92, K93, K94, K95, K96, K97\ +) {\ +{KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_NO},\ +{KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_NO},\ +{KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_NO, KC_NO},\ +{KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_NO, KC_NO},\ +{KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_NO, KC_NO},\ +{KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57},\ +{KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67},\ +{KC_NO, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77},\ +{KC_##K80, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86, KC_##K87},\ +{KC_NO, KC_NO, KC_##K92, KC_##K93, KC_##K94, KC_##K95, KC_##K96, KC_##K97}\ +} + diff --git a/keyboards/hecomi/keymaps/default/config.h b/keyboards/hecomi/keymaps/default/config.h new file mode 100644 index 00000000000..4496c591006 --- /dev/null +++ b/keyboards/hecomi/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/hecomi/keymaps/default/keymap.c b/keyboards/hecomi/keymaps/default/keymap.c new file mode 100644 index 00000000000..505966fbeb8 --- /dev/null +++ b/keyboards/hecomi/keymaps/default/keymap.c @@ -0,0 +1,105 @@ +/* Copyright 2018 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +//R1:7 + 8 = 15 +//R2:7 + 8 = 15 +//R3:6 + 7 = 13 +//R4:6 + 8 = 14 +//R5:6 + 6 = 12 +//total : 69 keys +// +enum layers{ + DF, + FN +}; + +#define KC_FN MO(FN) +#define KC_SFT(XXX) LSFT(XXX) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DF]=LAYOUT(\ + KC_ESC,KC_1,KC_2,KC_3,KC_4,KC_5,KC_6, KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_NUHS,KC_GRV,\ + KC_TAB ,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y, KC_Y,KC_U,KC_I,KC_O,KC_P,KC_LBRC,KC_RBRC,KC_BSPC,\ + KC_LCTRL ,KC_A,KC_S,KC_D,KC_F,KC_G, KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT,KC_ENT,\ + KC_LSFT ,KC_Z,KC_X,KC_C,KC_V,KC_B, KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_RSFT,KC_FN,\ + KC_LCTRL,KC_LGUI,KC_LALT,KC_MHEN,KC_BSPC,KC_SPC, KC_ENT,KC_ESC,KC_HENK,KC_RALT,KC_RGUI,KC_RCTRL\ + ), + [FN]=LAYOUT(\ + KC_ESC,KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_F6, KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_F12,KC_INS,KC_DEL,\ + KC_TAB ,KC_9,KC_7,KC_5,KC_3,KC_1,KC_Y, KC_Y,KC_U,KC_PSCR,KC_SLCK,KC_PAUSE,KC_UP,KC_RBRC,KC_BSPC,\ + KC_CAPS ,KC_8,KC_6,KC_4,KC_2,KC_0, KC_SFT(KC_8),KC_SLSH,KC_HOME,KC_PGUP,KC_LEFT,KC_RIGHT,KC_ENT,\ + KC_LSFT ,KC_Z,KC_X,KC_C,KC_V,KC_B, KC_B,KC_SFT(KC_EQL),KC_MINS,KC_END,KC_PGDN,KC_DOWN,KC_RSFT,KC_TRNS,\ + KC_LCTRL,KC_LGUI,KC_LALT,KC_MHEN,KC_BSPC,KC_SPC, KC_ENT,KC_ESC,KC_HENK,KC_RALT,KC_RGUI,KC_RCTRL\ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +uint32_t layer_state_set_user(uint32_t state) +{ + uint8_t layer=biton32(state); + switch(layer) + { + case DF: + rgblight_sethsv_noeeprom(180,255,255); + break; + case FN: + rgblight_sethsv_noeeprom(0,255,255); + break; + default: + break; + } + return state; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/hecomi/keymaps/default/readme.md b/keyboards/hecomi/keymaps/default/readme.md new file mode 100644 index 00000000000..e44f3d6f611 --- /dev/null +++ b/keyboards/hecomi/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for hecomi_alpha \ No newline at end of file diff --git a/keyboards/hecomi/keymaps/kakunpc/config.h b/keyboards/hecomi/keymaps/kakunpc/config.h new file mode 100644 index 00000000000..faf175a8f34 --- /dev/null +++ b/keyboards/hecomi/keymaps/kakunpc/config.h @@ -0,0 +1,23 @@ +/* Copyright 2018 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here +#define MASTER_RIGHT +#define RGBLIGHT_SLEEP +#define RGBLIGHT_SPLIT { 8, 8 } +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/hecomi/keymaps/kakunpc/keymap.c b/keyboards/hecomi/keymaps/kakunpc/keymap.c new file mode 100644 index 00000000000..d73bcd03f25 --- /dev/null +++ b/keyboards/hecomi/keymaps/kakunpc/keymap.c @@ -0,0 +1,98 @@ +/* Copyright 2018 takashiski + * Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +//R1:7 + 8 = 15 +//R2:7 + 8 = 15 +//R3:6 + 7 = 13 +//R4:6 + 8 = 14 +//R5:6 + 6 = 12 +//total : 69 keys +// +enum layers{ + DF, + LW, + FN +}; + +#define KC_FN MO(FN) +#define KC_LW MO(LW) +#define KC_SFT(XXX) LSFT(XXX) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DF]=LAYOUT(\ + KC_ESC,KC_GRV,KC_1,KC_2,KC_3,KC_4,KC_5, KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSPC, + KC_TAB ,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y, KC_Y,KC_U,KC_I,KC_O,KC_P,KC_LBRC,KC_RBRC,KC_BSLS, + KC_LCTRL ,KC_A,KC_S,KC_D,KC_F,KC_G, KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT,KC_ENT, + KC_LSFT ,KC_Z,KC_X,KC_C,KC_V,KC_B, KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_RSFT,KC_DEL, + KC_LGUI,KC_NO,KC_LALT,KC_LW,KC_FN,KC_SPC, KC_SPC,KC_FN,KC_LEFT,KC_UP,KC_DOWN,KC_RIGHT + ), + [LW]=LAYOUT(\ + KC_NO,KC_NO,RGB_VAD,RGB_VAI,RGB_HUI,RGB_HUD,KC_TRNS, RGB_MOD,RGB_RMOD,KC_TRNS,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, + KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, + KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, + KC_NO ,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, + KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO + ), + [FN]=LAYOUT(\ + KC_ESC,KC_GRV,KC_F1,KC_F2,KC_F3,KC_F4,KC_F5, KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_F12,KC_BSPC, + KC_TAB ,KC_NO,KC_UP,KC_NO,KC_NO,KC_NO,KC_NO, KC_7,KC_8,KC_0,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, + KC_LCTRL ,KC_LEFT,KC_DOWN,KC_RIGHT,KC_NO,KC_NO, KC_4,KC_5,KC_6,KC_NO,KC_NO,KC_NO,KC_NO, + KC_LSFT ,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, KC_1,KC_2,KC_3,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, + KC_LGUI,KC_NO,KC_LALT,KC_MHEN,KC_NO,KC_SPC, KC_0,KC_NO,KC_HOME,KC_PGUP,KC_PGDOWN,KC_END + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void keyboard_post_init_user(void) { + rgblight_enable_noeeprom(); +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/hecomi/keymaps/kakunpc/readme.md b/keyboards/hecomi/keymaps/kakunpc/readme.md new file mode 100644 index 00000000000..d5ccbbf824c --- /dev/null +++ b/keyboards/hecomi/keymaps/kakunpc/readme.md @@ -0,0 +1 @@ +# The kakunpc keymap for hecomi_alpha diff --git a/keyboards/hecomi/readme.md b/keyboards/hecomi/readme.md new file mode 100644 index 00000000000..79a80f35e53 --- /dev/null +++ b/keyboards/hecomi/readme.md @@ -0,0 +1,17 @@ +# hecomi + +![hecomi](https://imgur.com/a/5AwQw0r) + +This keyboard based on HHKB pro 2 and physical layout designed by @hecomi and @takashiski. + +This keyboard use 2 pro micro's, but you can use USB type-c. There are hand wiring . + +Keyboard Maintainer: [takashiski](https://github.com/takashiski) +Hardware Supported: hecomi_alpha, promicro +Hardware Availability: booth(@skyhigh_works) + +Make example for this keyboard (after setting up your build environment): + + make hecomi/alpha:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/hecomi/rules.mk b/keyboards/hecomi/rules.mk new file mode 100644 index 00000000000..5fddc13959f --- /dev/null +++ b/keyboards/hecomi/rules.mk @@ -0,0 +1,84 @@ +DEFAULT_FOLDER=hecomi/alpha +# +# +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +SPLIT_KEYBOARD = yes diff --git a/keyboards/helix/pico/config.h b/keyboards/helix/pico/config.h index b8822e2273a..b377332efa1 100644 --- a/keyboards/helix/pico/config.h +++ b/keyboards/helix/pico/config.h @@ -27,7 +27,6 @@ along with this program. If not, see . #define PRODUCT HelixPico #define DESCRIPTION A split keyboard for the cheap makers - #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 @@ -64,18 +63,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Audio */ #ifdef AUDIO_ENABLE #define B5_AUDIO @@ -145,5 +139,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - #endif diff --git a/keyboards/helix/pico/keymaps/biacco/keymap.c b/keyboards/helix/pico/keymaps/biacco/keymap.c index b4ee4fcaa9d..36ef4394dd8 100644 --- a/keyboards/helix/pico/keymaps/biacco/keymap.c +++ b/keyboards/helix/pico/keymaps/biacco/keymap.c @@ -31,9 +31,6 @@ enum layer_number { GAME }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO //Macros const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/helix/pico/keymaps/default/config.h b/keyboards/helix/pico/keymaps/default/config.h index 20dfc9f9858..7653185198b 100644 --- a/keyboards/helix/pico/keymaps/default/config.h +++ b/keyboards/helix/pico/keymaps/default/config.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once // place overrides here @@ -42,5 +41,3 @@ along with this program. If not, see . //#define RGBLIGHT_EFFECT_RGB_TEST //#define RGBLIGHT_EFFECT_ALTERNATING #endif - -#endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/pico/keymaps/default/keymap.c b/keyboards/helix/pico/keymaps/default/keymap.c index 4c587851792..c5ab84abe89 100644 --- a/keyboards/helix/pico/keymaps/default/keymap.c +++ b/keyboards/helix/pico/keymaps/default/keymap.c @@ -50,10 +50,6 @@ enum macro_keycodes { KC_SAMPLEMACRO, }; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO //Macros #define M_SAMPLE M(KC_SAMPLEMACRO) @@ -164,7 +160,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, AU_ON, AU_OFF, MU_TOG, MU_MOD, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, CK_TOGG, CK_RST, CK_UP, CK_DOWN, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; diff --git a/keyboards/helix/pico/keymaps/default/rules.mk b/keyboards/helix/pico/keymaps/default/rules.mk index c5ee8acb2ac..3b518ff8813 100644 --- a/keyboards/helix/pico/keymaps/default/rules.mk +++ b/keyboards/helix/pico/keymaps/default/rules.mk @@ -119,10 +119,6 @@ endif # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # Uncomment these for debugging # $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) # $(info -- OPT_DEFS=$(OPT_DEFS)) diff --git a/keyboards/helix/pico/keymaps/mtei/config.h b/keyboards/helix/pico/keymaps/mtei/config.h new file mode 100644 index 00000000000..c5812de8d79 --- /dev/null +++ b/keyboards/helix/pico/keymaps/mtei/config.h @@ -0,0 +1,52 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +// place overrides here + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(STARTUP_SOUND) + #define AUDIO_CLICKY +#endif + +#undef TAPPING_TERM +#define TAPPING_TERM 300 +#define PERMISSIVE_HOLD +/* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD. + see tmk_core/common/action_tapping.c */ + +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + //#define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + +#endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/pico/keymaps/mtei/keymap.c b/keyboards/helix/pico/keymaps/mtei/keymap.c new file mode 100644 index 00000000000..27bf0624339 --- /dev/null +++ b/keyboards/helix/pico/keymaps/mtei/keymap.c @@ -0,0 +1,496 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif +#ifdef CONSOLE_ENABLE + #include +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _DVORAK, + _EUCALYN, + _NUML, + _NUMR, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + EUCALYN, + NUML, + NUMR, + KC_xEISU, + KC_xKANA, + KC_ZERO2, + RGBRST +}; + +//Macros +#define KC_LOWER MO(_LOWER) +#define KC_NUML LT(_NUML,KC_SPC) +#define KC_NUMR LT(_NUMR,KC_SPC) +#define KC_RABS LT(_RAISE,KC_BSPC) +#define KC_RAEN LT(_RAISE,KC_ENT) +#define KC_____ _______ +#define KC_XXXX XXXXXXX +#define KC_ADJ MO(_ADJUST) +#define KC_LSMI LSFT(KC_MINS) +#define KC_LSEQ LSFT(KC_EQL) +#define KC_LSRB LSFT(KC_RBRC) +#define KC_LSLB LSFT(KC_LBRC) +#define KC_LSGR LSFT(KC_GRV) +#define KC_LSQT LSFT(KC_QUOT) +#define ___ _______ +#define KC_S0 LSFT(KC_0) +#define KC_S1 LSFT(KC_1) +#define KC_S2 LSFT(KC_2) +#define KC_S3 LSFT(KC_3) +#define KC_S4 LSFT(KC_4) +#define KC_S5 LSFT(KC_5) +#define KC_S6 LSFT(KC_6) +#define KC_S7 LSFT(KC_7) +#define KC_S8 LSFT(KC_8) +#define KC_S9 LSFT(KC_9) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_kc( \ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, RCTL, \ + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, \ + LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ + ), + + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | Q | W | F | P | G | | J | L | U | Y | ; | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | K | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | + * `-------------------------------------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT_kc( \ + ESC, Q, W, F, P, G, J, L, U, Y, SCLN, BSLS, \ + LCTL, A, R, S, T, D, H, N, E, I, O, RCTL, \ + LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, RSFT, \ + LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | ' | , | . | P | Y | | F | G | C | R | L | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | + * `-------------------------------------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT_kc( \ + ESC, QUOT, COMM, DOT, P, Y, F, G, C, R, L, BSLS, \ + LCTL, A, O, E, U, I, D, H, T, N, S, RCTL, \ + LSFT, SCLN, Q, J, K, X, B, M, W, V, Z, RSFT, \ + LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ + ), + + /* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | Q | W | , | . | ; | | M | R | D | Y | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | I | U | | G | T | K | S | N | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | F | | B | H | J | L | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | + * `-------------------------------------------------------------------------------------------------' + */ + [_EUCALYN] = LAYOUT_kc( \ + ESC, Q, W, COMM, DOT, SCLN, M, R, D, Y, P, BSLS, \ + LCTL, A, O, E, I, U, G, T, K, S, N, RCTL, \ + LSFT, Z, X, C, V, F, B, H, J, L, SLSH, RSFT, \ + LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ + ), + + /* Num + * ,-----------------------------------------. ,-----------------------------------------. + * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_NUML] = LAYOUT_kc( \ + ____, S1, S2, S3, S4, S5, S6, S7, S8, S9, S0, ____, \ + ____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \ + ____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \ + ____, ____, ____, ____, ____, ____, ____, ____, SPC, ____, ____, ____, ____, ____ \ + ), + + [_NUMR] = LAYOUT_kc( \ + ____, S1, S2, S3, S4, S5, S6, S7, S8, S9, S0, ____, \ + ____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \ + ____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \ + ____, ____, ____, ____, ____, SPC, ____, ____, ____, ____, ____, ____, ____, ____ \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | | |Pause | ScrLk| Ins | | | | Ins | ScrLk|Pause | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | PgUp | | Up |Delete| Home | | Home |Delete| Up | | PgUp | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | PgDn | Left | Down | Right| End | | End | Left | Down | Right| PgDn | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | PrtSc| | | |Adjust|Adjust| | | | PrtSc| | | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_kc( \ + XXXX, XXXX, PAUS, SLCK, INS, XXXX, XXXX, INS, SLCK, PAUS, XXXX, ____, \ + ____, HOME, XXXX, UP, DEL, PGUP, PGUP, DEL, UP, XXXX, HOME, ____, \ + ____, END, LEFT, DOWN, RGHT, PGDN, PGDN, LEFT, DOWN, RGHT, END, ____, \ + ____, ____, PSCR, ____, ____, ____, ADJ, ADJ, ____, ____, ____, PSCR, ____, ____ \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | TAB | | | | _ | - | | = | + | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | EISU | | | | { | [ | | ] | } | | | | KANA | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | ~ | ` | | ' | " | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_kc( \ + TAB, XXXX, XXXX, XXXX, LSMI, MINS, EQL, LSEQ, XXXX, XXXX, XXXX, XXXX, \ + xEISU, XXXX, XXXX, XXXX, LSLB, LBRC, RBRC, LSRB, XXXX, XXXX, XXXX, xKANA, \ + XXXX, XXXX, XXXX, XXXX, LSGR, GRV, QUOT, LSQT, XXXX, XXXX, XXXX, XXXX, \ + ADJ, ADJ, XXXX, ____, ____, XXXX, ____, ____, XXXX, ____, ____, XXXX, ADJ, ADJ \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset|RGBRST|RGB ON|Aud on| Win | | Win | |Qwerty|Euclyn|Colemk|Dvorak| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | HUE+ | SAT+ | VAL+ |RGB md|Audoff| Mac | | Mac | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | HUE- | SAT- | VAL- | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, XXXXXXX, QWERTY, EUCALYN, COLEMAK, DVORAK, \ + RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ___,___, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \ + ) +}; + +#ifdef AUDIO_ENABLE + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +static int current_default_layer; + +uint32_t default_layer_state_set_kb(uint32_t state) { + // 1<<_QWERTY - 1 == 1 - 1 == _QWERTY (=0) + // 1<<_COLEMAK - 1 == 2 - 1 == _COLEMAK (=1) + current_default_layer = state - 1; + // 1<<_DVORAK - 2 == 4 - 2 == _DVORAK (=2) + if ( current_default_layer == 3 ) current_default_layer -= 1; + // 1<<_EUCALYN - 5 == 8 - 5 == _EUCALYN (=3) + if ( current_default_layer == 7 ) current_default_layer -= 4; + return state; +} + +void update_base_layer(int base) +{ + if( current_default_layer != base ) { + eeconfig_update_default_layer(1UL<event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + update_base_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + update_base_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + update_base_layer(_DVORAK); + } + return false; + break; + case EUCALYN: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + update_base_layer(_EUCALYN); + } + return false; + break; + case KC_xEISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KC_xKANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(50); // gets rid of tick +} + +void shutdown_user() +{ + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_ANIMATIONS) + char buf[30]; + if(rgblight_config.enable) { + snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", + rgblight_config.mode, + rgblight_config.hue/RGBLIGHT_HUE_STEP, + rgblight_config.sat/RGBLIGHT_SAT_STEP, + rgblight_config.val/RGBLIGHT_VAL_STEP); + matrix_write(matrix, buf); + } +#endif + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + +static const char Qwerty_name[] PROGMEM = " Qwerty"; +static const char Colemak_name[] PROGMEM = " Colemak"; +static const char Dvorak_name[] PROGMEM = " Dvorak"; +static const char Eucalyn_name[] PROGMEM = " Eucalyn"; + +static const char NumL_name[] PROGMEM = ":NumL"; +static const char NumR_name[] PROGMEM = ":NumR"; +static const char Lower_name[] PROGMEM = ":Func"; +static const char Raise_name[] PROGMEM = ":Extra"; +static const char Adjust_name[] PROGMEM = ":Adjust"; + +static const char *layer_names[] = { + [_QWERTY] = Qwerty_name, + [_COLEMAK] = Colemak_name, + [_DVORAK] = Dvorak_name, + [_EUCALYN] = Eucalyn_name, + + [_NUML] = NumL_name, + [_NUMR] = NumR_name, + [_LOWER] = Lower_name, + [_RAISE] = Raise_name, + [_ADJUST] = Adjust_name +}; + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + int name_num; + uint32_t lstate; + matrix_write_P(matrix, layer_names[current_default_layer]); + matrix_write_P(matrix, PSTR("\n")); + for( lstate = layer_state, name_num = 0; + lstate && name_num < sizeof(layer_names)/sizeof(char *); + lstate >>=1, name_num++ ) { + if( (lstate & 1) != 0 ) { + if( layer_names[name_num] ) { + matrix_write_P(matrix, layer_names[name_num]); + } + } + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< helix:defualt +## option= oled | back | under | na | ios +## ex. +## make HELIX=oled helix:defualt +## make HELIX=oled,back helix:defualt +## make HELIX=oled,under helix:defualt +## make HELIX=oled,back,na helix:defualt +## make HELIX=oled,back,ios helix:defualt +## +ifneq ($(strip $(HELIX)),) + ifeq ($(findstring oled,$(HELIX)), oled) + OLED_ENABLE = yes + endif + ifeq ($(findstring back,$(HELIX)), back) + LED_BACK_ENABLE = yes + else ifeq ($(findstring under,$(HELIX)), under) + LED_UNDERGLOW_ENABLE = yes + endif + ifeq ($(findstring na,$(HELIX)), na) + LED_ANIMATIONS = no + endif + ifeq ($(findstring ios,$(HELIX)), ios) + IOS_DEVICE_ENABLE = yes + endif + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(info ) +endif + +# Uncomment these for checking +# jp: コンパイル時にカスタマイズの状態を表示したい時はコメントをはずします。 +# $(eval $(call HELIX_CUSTOMISE_MSG)) +# $(info ) + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +ifeq ($(strip $(AUDIO_ENABLE)),yes) + ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) + Link_Time_Optimization = yes + endif + ifeq ($(strip $(OLED_ENABLE)),yes) + Link_Time_Optimization = yes + endif +endif + +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) diff --git a/keyboards/helix/pico/pico.c b/keyboards/helix/pico/pico.c index 5e248ccffec..bb8ba9ca2b4 100644 --- a/keyboards/helix/pico/pico.c +++ b/keyboards/helix/pico/pico.c @@ -2,6 +2,12 @@ #ifdef SSD1306OLED +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +} + void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here //led_set_user(usb_led); diff --git a/keyboards/helix/pico/pico.h b/keyboards/helix/pico/pico.h index a3d658daa01..153132775ba 100644 --- a/keyboards/helix/pico/pico.h +++ b/keyboards/helix/pico/pico.h @@ -62,4 +62,18 @@ } #endif +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ + ) + + #endif diff --git a/keyboards/helix/pico/rules.mk b/keyboards/helix/pico/rules.mk index c994ac8deae..75bf0a5ef8c 100644 --- a/keyboards/helix/pico/rules.mk +++ b/keyboards/helix/pico/rules.mk @@ -1,3 +1,2 @@ -SRC += pico/matrix.c \ - pico/split_util.c \ - ws2812.c +SRC += pico/matrix.c +SRC += pico/split_util.c diff --git a/keyboards/helix/readme.md b/keyboards/helix/readme.md index 5ee233e8127..a535df05270 100644 --- a/keyboards/helix/readme.md +++ b/keyboards/helix/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make helix:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/helix/rev1/config.h b/keyboards/helix/rev1/config.h index 07b5c4f6f8b..454e8ee628a 100644 --- a/keyboards/helix/rev1/config.h +++ b/keyboards/helix/rev1/config.h @@ -60,18 +60,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 @@ -94,5 +89,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - #endif diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c b/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c index 9b81979ff42..6bee91786c3 100644 --- a/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c +++ b/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c @@ -41,19 +41,9 @@ enum custom_keycodes { RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL, + M_SAMPLE }; -enum macro_keycodes { - KC_SAMPLEMACRO, -}; - - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -//Macros -#define M_SAMPLE M(KC_SAMPLEMACRO) - #if HELIX_ROWS == 5 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -427,6 +417,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case M_SAMPLE: + if (record->event.pressed) { + SEND_STRING("hello world"); + } + return false; } return true; } @@ -474,23 +469,3 @@ void music_scale_user(void) } #endif - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - - switch (id) { - case KC_SAMPLEMACRO: - if (record->event.pressed){ - return MACRO (I(10), T(H), T(E), T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); - } - - } - - return MACRO_NONE; -} diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk index c56d6f37e04..1347d3a7daf 100644 --- a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk +++ b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk @@ -1,4 +1,3 @@ - # Build Options # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically @@ -19,7 +18,3 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/helix/rev1/keymaps/default/config.h b/keyboards/helix/rev1/keymaps/default/config.h index d95925d4e45..0f81f5f7bea 100644 --- a/keyboards/helix/rev1/keymaps/default/config.h +++ b/keyboards/helix/rev1/keymaps/default/config.h @@ -18,8 +18,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +// place overrides here /* Use I2C or Serial, not both */ @@ -31,5 +32,3 @@ along with this program. If not, see . #define MASTER_LEFT // #define _MASTER_RIGHT // #define EE_HANDS - -#endif diff --git a/keyboards/helix/rev1/keymaps/default/keymap.c b/keyboards/helix/rev1/keymaps/default/keymap.c index 7288cd752f6..43928a4185b 100644 --- a/keyboards/helix/rev1/keymaps/default/keymap.c +++ b/keyboards/helix/rev1/keymaps/default/keymap.c @@ -22,10 +22,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #if HELIX_ROWS == 5 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/helix/rev1/keymaps/default/rules.mk b/keyboards/helix/rev1/keymaps/default/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/helix/rev1/keymaps/default/rules.mk +++ b/keyboards/helix/rev1/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/helix/rev1/rev1.c b/keyboards/helix/rev1/rev1.c index d7ea9b72357..309cca010f1 100644 --- a/keyboards/helix/rev1/rev1.c +++ b/keyboards/helix/rev1/rev1.c @@ -2,6 +2,12 @@ #ifdef SSD1306OLED +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +} + void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here led_set_user(usb_led); diff --git a/keyboards/helix/rev2/config.h b/keyboards/helix/rev2/config.h index f7d35b37146..ec744585947 100644 --- a/keyboards/helix/rev2/config.h +++ b/keyboards/helix/rev2/config.h @@ -27,7 +27,6 @@ along with this program. If not, see . #define PRODUCT Helix Beta #define DESCRIPTION A split keyboard for the cheap makers - #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 @@ -73,18 +72,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 @@ -161,5 +155,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - #endif diff --git a/keyboards/helix/rev2/keymaps/default/config.h b/keyboards/helix/rev2/keymaps/default/config.h index ed376757942..b8c1041cdc7 100644 --- a/keyboards/helix/rev2/keymaps/default/config.h +++ b/keyboards/helix/rev2/keymaps/default/config.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once // place overrides here @@ -37,5 +36,3 @@ along with this program. If not, see . //#define RGBLIGHT_EFFECT_RGB_TEST //#define RGBLIGHT_EFFECT_ALTERNATING #endif - -#endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/default/keymap.c b/keyboards/helix/rev2/keymaps/default/keymap.c index 92393208ce6..a64eed3e72c 100644 --- a/keyboards/helix/rev2/keymaps/default/keymap.c +++ b/keyboards/helix/rev2/keymaps/default/keymap.c @@ -50,10 +50,6 @@ enum macro_keycodes { KC_SAMPLEMACRO, }; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO //Macros #define M_SAMPLE M(KC_SAMPLEMACRO) @@ -183,7 +179,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; @@ -296,7 +292,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; @@ -510,14 +506,7 @@ void music_scale_user(void) //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED -// hook point for 'led_test' keymap -// 'default' keymap's led_test_init() is empty function, do nothing -// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST); -__attribute__ ((weak)) -void led_test_init(void) {} - void matrix_scan_user(void) { - led_test_init(); iota_gfx_task(); // this is what updates the display continuously } diff --git a/keyboards/helix/rev2/keymaps/default/rules.mk b/keyboards/helix/rev2/keymaps/default/rules.mk index 3f84b895aaa..37ef8632dee 100644 --- a/keyboards/helix/rev2/keymaps/default/rules.mk +++ b/keyboards/helix/rev2/keymaps/default/rules.mk @@ -118,10 +118,6 @@ endif # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # Uncomment these for debugging # $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) # $(info -- OPT_DEFS=$(OPT_DEFS)) diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/config.h b/keyboards/helix/rev2/keymaps/edvorakjp/config.h index 643220383c5..cd0568f61e3 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/config.h +++ b/keyboards/helix/rev2/keymaps/edvorakjp/config.h @@ -1,20 +1,23 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H +#define SWAP_SCLN + #undef TAPPING_FORCE_HOLD #undef TAPPING_TERM -#define TAPPING_TERM 120 +#define TAPPING_TERM 300 +#define IGNORE_MOD_TAP_INTERRUPT // If you need more program area, try select and reduce rgblight modes to use. // Selection of RGBLIGHT MODE to use. #if defined(LED_ANIMATIONS) - #define RGBLIGHT_EFFECT_BREATHING - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_EFFECT_RAINBOW_SWIRL - #define RGBLIGHT_EFFECT_SNAKE - #define RGBLIGHT_EFFECT_KNIGHT - #define RGBLIGHT_EFFECT_CHRISTMAS + //#define RGBLIGHT_EFFECT_BREATHING + //#define RGBLIGHT_EFFECT_RAINBOW_MOOD + //#define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + //#define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS #define RGBLIGHT_EFFECT_STATIC_GRADIENT //#define RGBLIGHT_EFFECT_RGB_TEST //#define RGBLIGHT_EFFECT_ALTERNATING diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c index 22940f7cbe5..9fba5072c40 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c @@ -7,21 +7,6 @@ // keymaps definitions are moved to keymap_Xrows.c. -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case KC_LOCK: - if (record->event.pressed) { - if (edvorakjp_config.enable_kc_lang) { - SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) ); - } else { - SEND_STRING( SS_LGUI("l") ); - } - } - return false; - } - return true; -} - #ifdef SSD1306OLED void matrix_init_keymap(void) { //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h @@ -37,23 +22,15 @@ void matrix_scan_user(void) { uint32_t layer_state_set_keymap(uint32_t state) { rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); switch (biton32(state)) { - case _EDVORAKJ1: - case _EDVORAKJ2: - // _EDVORAKJ1 & J2 are same colored - rgblight_sethsv_noeeprom_white(); - break; case _LOWER: rgblight_sethsv_noeeprom_red(); break; case _RAISE: rgblight_sethsv_noeeprom_blue(); break; - case _ADJUST: - rgblight_sethsv_noeeprom_green(); - break; default: // for any other layers, or the default layer - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3); - rgblight_sethsv_noeeprom_red(); + rgblight_mode(RGBLIGHT_MODE_STATIC_GRADIENT + 3); + rgblight_sethsv_red(); break; } return state; diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c index d8257d81f8d..f2befc03b58 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c @@ -4,86 +4,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_EDVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - LBRC,RBRC,COMM,DOT , P , Y , F , G , R , W , Q ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , A , O , E , I , U , D , T , N , S , M ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - QUOT,SCLN, X , C , V , Z , B , H , J , K , L ,SLSH, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LEFT,DOWN, UP ,RGHT,TMB1,TMB2,TMB3, TMB6,TMB7,TMB8,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_EDVORAKJ1] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , Y , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_EDVORAKJ2] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , Y , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - EQL , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LBRC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RBRC, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,BSLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + GRV ,QUOT,COMM , DOT , Y , Q , F , G , R , W , P ,BSLS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + EQL , A ,LA(O),LG(E),LC(I), U , D ,RS(T),RG(N),RA(S), M ,MINS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + ESC ,SCLN, X , C , V , Z , H , J , K , L , B ,SLSH, + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + HOME,PGDN,PGUP , END ,TMB1 ,TMB2,TMB3, TMB4,TMB5,TMB6 ,LEFT ,DOWN , UP ,RGHT + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' ), [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F1 , F2 , F3 , F4 , F5 ,LCBR, RCBR, 7 , 8 , 9 ,MINS,SLSH, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F6 , F7 , F8 , F9 ,F10 ,LPRN, RPRN, 4 , 5 , 6 ,PLUS,ASTR, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F11 ,F12 ,PSCR,SLCK,PAUS,LBRC, RBRC, 1 , 2 , 3 , NO , NO , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - HOME,PGDN,PGUP,END , , , , ,ESC , 0 ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+------+------+------+----. ,----+------+------+-------+----+----. + , , LCBR , LBRC , LPRN , , , RPRN , RBRC , RCBR , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + F1 , F2 ,LA(F3),LG(F4),LC(F5), F6 , F7 ,RS(F8),RG(F9),RA(F10),F11 ,F12 , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + PSCR, , HOME , PGDN , PGUP ,END , LEFT, DOWN , UP , RGHT , , , + //|----+----+------+------+------+----+----. ,----+----+------+------+-------+----+----| + , , , , , , NO , MAC ,TMB7, , , , , + //`----+----+------+------+------+----+----/ \----+----+------+------+-------+----+----' ), [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, NO , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , NO , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - HOME,PGDN,PGUP,END ,TMB9,ESC , , , , ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , ,EXTOFF, , ,EXTON, , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RST ,DBUG,RTOG,WIN , , ,MAC ,QWER,EDJP, , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + , ,EXLM , AT ,HASH ,DLR , PERC,CIRC ,AMPR ,ASTR , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , 1 ,LA(2),LG(3),LC(4), 5 , 6 ,RS(7),RG(8),RA(9), 0 , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + PSCR, ,HOME ,PGDN ,PGUP ,END , LEFT,DOWN , UP ,RGHT , , , + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + , , , , , ,WIN , NO , , , , , , + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' ) }; diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c index 9116b39665a..642ba8c635b 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c @@ -4,100 +4,44 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_EDVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LBRC,RBRC,COMM,DOT , P , Y , F , G , R , W , Q ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , A , O , E , I , U , D , T , N , S , M ,MINS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - QUOT,SCLN, X , C , V , Z ,TMB4, TMB5, B , H , J , K , L ,SLSH, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - LEFT,DOWN, UP ,RGHT,TMB1,TMB2,TMB3, TMB6,TMB7,TMB8,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_EDVORAKJ1] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , Y , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_EDVORAKJ2] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , Y , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LBRC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - RBRC, Z , X , C , V , B , , , N , M ,COMM,DOT ,SLSH,BSLS, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + ESC ,EXLM, AT ,HASH , DLR ,PERC, CIRC,AMPR ,ASTR ,LPRN ,RPRN,BSPC, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + GRV ,QUOT,COMM , DOT , Y , Q , F , G , R , W , P ,BSLS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + EQL , A ,LA(O),LG(E),LC(I), U , D ,RS(T),RG(N),RA(S), M ,MINS, + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + TAB ,SCLN, X , C , V , Z , NO , NO , H , J , K , L , B ,SLSH, + //|----+----+-----+-----+-----+----+----| |----+----+-----+-----+-----+----+----| + HOME,PGDN,PGUP , END ,TMB1 ,TMB2,TMB3, TMB4,TMB5,TMB6 ,LEFT ,DOWN , UP ,RGHT + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' ), [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , ,SLSH,ASTR, , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F1 , F2 , F3 , F4 , F5 ,LCBR, RCBR, 7 , 8 , 9 ,MINS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F6 , F7 , F8 , F9 ,F10 ,LPRN, RPRN, 4 , 5 , 6 ,PLUS, , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - F11 ,F12 ,PSCR,SLCK,PAUS,LBRC,LOCK, ,RBRC, 1 , 2 , 3 , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - HOME,PGDN,PGUP,END ,TMB9, , , , , 0 ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+------+------+------+----. ,----+------+------+-------+----+----. + PSCR, , , , , , , , , , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + , , LCBR , LBRC , LPRN , , , RPRN , RBRC , RCBR , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + F1 , F2 ,LA(F3),LG(F4),LC(F5), F6 , F7 ,RS(F8),RG(F9),RA(F10),F11 ,F12 , + //|----+----+------+------+------+----+----. ,----+----+------+------+-------+----+----| + , , HOME , PGDN , PGUP ,END , , ,LEFT, DOWN , UP , RGHT , , , + //|----+----+------+------+------+----+----| |----+----+------+------+-------+----+----| + , , , , , , NO , MAC ,TMB7, , , , , + //`----+----+------+------+------+----+----/ \----+----+------+------+-------+----+----' ), [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , ,SLSH,ASTR, , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F1 , F2 , F3 , F4 , F5 ,LCBR, RCBR, 7 , 8 , 9 ,MINS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F6 , F7 , F8 , F9 ,F10 ,LPRN, RPRN, 4 , 5 , 6 ,PLUS, , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - F11 ,F12 ,PSCR,SLCK,PAUS,LBRC,LOCK, ,RBRC, 1 , 2 , 3 , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - HOME,PGDN,PGUP,END ,TMB9, , , , , 0 ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , ,EXTOFF, , ,EXTON, , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RST ,DBUG,RTOG,WIN , , ,MAC ,QWER,EDJP, , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + PSCR, , , , , , , , , , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , ,EXLM , AT ,HASH ,DLR , PERC,CIRC ,AMPR ,ASTR , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , 1 ,LA(2),LG(3),LC(4), 5 , 6 ,RS(7),RG(8),RA(9), 0 , , + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + , ,HOME ,PGDN ,PGUP ,END , , ,LEFT,DOWN , UP ,RGHT , , , + //|----+----+-----+-----+-----+----+----| |----+----+-----+-----+-----+----+----| + , , , , , ,WIN , NO , , , , , , + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' ) }; diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_xrows.h b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_xrows.h index 6a0e581024f..d9561d0b707 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_xrows.h +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_xrows.h @@ -2,27 +2,20 @@ #define KEYMAP_XROWS_H #include "edvorakjp.h" - -enum custom_keycodes { - KC_LOCK = NEW_SAFE_RANGE, -}; +/* + * enum custom_keycodes { + * KC_LOCK = NEW_SAFE_RANGE, + * }; + */ #define KC_ KC_TRNS -#define KC_TMB1 LGUI_T(KC_TAB) -#define KC_TMB2 LSFT_T(KC_SPC) -#define KC_TMB3 LOWER // act as LOWER when hold, as KC_LANG2(=English) when tapped -#define KC_TMB4 LCTL_T(KC_ESC) -#define KC_TMB5 RSFT_T(KC_DEL) -#define KC_TMB6 RAISE // act as RAISE when hold, as KC_LANG1(=Japanese) when tapped -#define KC_TMB7 RCTL_T(KC_BSPC) -#define KC_TMB8 RALT_T(KC_ENT) -#define KC_TMB9 LGUI(KC_TAB) - -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_EDJP EDVORAK -#define KC_QWER QWERTY +#define KC_TMB1 KC_LA(TAB) +#define KC_TMB2 KC_LS(SPC) +#define KC_TMB3 TD(TD_LOWER) // act as LOWER when hold, as KC_LANG2(=English) when tapped +#define KC_TMB4 TD(TD_RAISE) // act as RAISE when hold, as KC_LANG1(=Japanese) when tapped +#define KC_TMB5 KC_RC(BSPC) +#define KC_TMB6 KC_RG(ENT) +#define KC_TMB7 KC_RC(DEL) #endif diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c index 5ced1d4fad7..b931b72b7cc 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c @@ -23,15 +23,10 @@ void render_status(struct CharacterMatrix *matrix) { // Render to mode icon static char logo[][2][3] = {{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if (edvorakjp_config.enable_kc_lang) { - matrix_write(matrix, logo[0][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[0][1]); - } else { - matrix_write(matrix, logo[1][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[1][1]); - } + int mode_number = get_enable_kc_lang() ? 0 : 1; + matrix_write(matrix, logo[mode_number][0]); + matrix_write(matrix, "\n"); + matrix_write(matrix, logo[mode_number][1]); // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below char buf[40]; @@ -39,13 +34,7 @@ void render_status(struct CharacterMatrix *matrix) { matrix_write_P(matrix, PSTR("\nLayer: ")); switch (biton32(layer_state)) { case L_BASE: - matrix_write_P(matrix, - default_layer_state == 1UL<<_EDVORAK ? PSTR("EDVORAK") : PSTR("QWERTY") - ); - break; - case _EDVORAKJ1: - case _EDVORAKJ2: - matrix_write_P(matrix, PSTR("JP_EXT")); + matrix_write_P(matrix, PSTR("Default")); break; case _RAISE: matrix_write_P(matrix, PSTR("Raise")); @@ -53,17 +42,13 @@ void render_status(struct CharacterMatrix *matrix) { case _LOWER: matrix_write_P(matrix, PSTR("Lower")); break; - case _ADJUST: - matrix_write_P(matrix, PSTR("Adjust")); - break; default: matrix_write(matrix, buf); } // Host Keyboard LED Status char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s %s", - edvorakjp_config.enable_jp_extra_layer && japanese_mode ? "EXT" : " ", + snprintf(led, sizeof(led), "\n%s %s %s", (host_keyboard_leds() & (1<event.pressed) { SEND_STRING("00"); } return false; break; - case EISU: + case KC_xEISU: if (record->event.pressed) { if(keymap_config.swap_lalt_lgui==false){ register_code(KC_LANG2); @@ -418,7 +412,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case KANA: + case KC_xKANA: if (record->event.pressed) { if(keymap_config.swap_lalt_lgui==false){ register_code(KC_LANG1); diff --git a/keyboards/helix/rev2/keymaps/five_rows/rules.mk b/keyboards/helix/rev2/keymaps/five_rows/rules.mk index bd7130cfc66..a0bf21917b1 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows/rules.mk @@ -125,10 +125,6 @@ endif # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # Uncomment these for debugging # $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) # $(info -- OPT_DEFS=$(OPT_DEFS)) diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c index df00366e393..be76dffbe40 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c @@ -46,10 +46,6 @@ enum custom_keycodes { #endif }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Layer Mode aliases #define DL_BAS DF(_BASE) #define DL_BASE DF(_BAS_E) @@ -204,7 +200,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, RESET, RGBRST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, RGBRST, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, DL_BAS, DL_BASE, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, DL_BAS, DL_BASE, AG_NORM, AG_SWAP, XXXXXXX, \ XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, \ - XXXXXXX, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, \ + XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk index 3f84b895aaa..37ef8632dee 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk @@ -118,10 +118,6 @@ endif # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # Uncomment these for debugging # $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) # $(info -- OPT_DEFS=$(OPT_DEFS)) diff --git a/keyboards/helix/rev2/keymaps/froggy/keymap.c b/keyboards/helix/rev2/keymaps/froggy/keymap.c index 75c6f081142..c27c1320c4e 100644 --- a/keyboards/helix/rev2/keymaps/froggy/keymap.c +++ b/keyboards/helix/rev2/keymaps/froggy/keymap.c @@ -61,10 +61,6 @@ enum macro_keycodes { KC_SAMPLEMACRO, }; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO //Macros #define M_SAMPLE M(KC_SAMPLEMACRO) @@ -593,19 +589,39 @@ void matrix_scan_user(void) { if(!RGBAnimation){ switch (layer_state) { case L_BASE: - led_ripple_effect(0,112,127); + #ifdef RGBLED_BACK + led_ripple_effect(0,112,127); + #else + rgblight_setrgb(0,112,127); + #endif break; case L_OPT: - led_ripple_effect(127,0,100); + #ifdef RGBLED_BACK + led_ripple_effect(127,0,100); + #else + rgblight_setrgb(127,0,100); + #endif break; case L_NUM: - led_ripple_effect(127,23,0); + #ifdef RGBLED_BACK + led_ripple_effect(127,23,0); + #else + rgblight_setrgb(127,23,0); + #endif break; case L_SYM: - led_ripple_effect(0,127,0); + #ifdef RGBLED_BACK + led_ripple_effect(0,127,0); + #else + rgblight_setrgb(0,127,0); + #endif break; case L_FUNC: - led_ripple_effect(127,0,61); + #ifdef RGBLED_BACK + led_ripple_effect(127,0,61); + #else + rgblight_setrgb(127,0,61); + #endif break; } } diff --git a/keyboards/helix/rev2/keymaps/froggy/rules.mk b/keyboards/helix/rev2/keymaps/froggy/rules.mk index f4601707114..8cd0efdd4d9 100644 --- a/keyboards/helix/rev2/keymaps/froggy/rules.mk +++ b/keyboards/helix/rev2/keymaps/froggy/rules.mk @@ -118,10 +118,6 @@ endif # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # Uncomment these for debugging # $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) # $(info -- OPT_DEFS=$(OPT_DEFS)) diff --git a/keyboards/helix/rev2/keymaps/led_test/led_test_init.c b/keyboards/helix/rev2/keymaps/led_test/led_test_init.c index 85f5d1aa7ef..7f8813acdd8 100644 --- a/keyboards/helix/rev2/keymaps/led_test/led_test_init.c +++ b/keyboards/helix/rev2/keymaps/led_test/led_test_init.c @@ -1,20 +1,6 @@ #include QMK_KEYBOARD_H -#if 1 -void led_test_init(void) { - static int scan_count = 0; - if( scan_count == 2 ) { - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST); - } - if( scan_count < 3 ) scan_count ++; -} - -#else -// when qmk/qmk_firmware PullRequest #3113 available. -// can use this? -void startup_user(void) { +void keyboard_post_init_user(void) { rgblight_enable_noeeprom(); rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST); } -#endif diff --git a/keyboards/helix/rev2/keymaps/led_test/rules.mk b/keyboards/helix/rev2/keymaps/led_test/rules.mk index a9cd251bc5f..2062d348d1f 100644 --- a/keyboards/helix/rev2/keymaps/led_test/rules.mk +++ b/keyboards/helix/rev2/keymaps/led_test/rules.mk @@ -120,10 +120,6 @@ SRC += led_test_init.c # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # Uncomment these for debugging # $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) # $(info -- OPT_DEFS=$(OPT_DEFS)) diff --git a/keyboards/helix/rev2/keymaps/xulkal/keymap.c b/keyboards/helix/rev2/keymaps/xulkal/keymap.c new file mode 100644 index 00000000000..3fad64deac3 --- /dev/null +++ b/keyboards/helix/rev2/keymaps/xulkal/keymap.c @@ -0,0 +1,69 @@ +#include QMK_KEYBOARD_H +#include "xulkal.h" + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |FN(CAPS)| A | S | D | F | G | | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Sft[ | Z | X | C | V | B |RGBTOG|RGBRST| N | M | , | . | / | Sft] | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctl- | Win | LOWER| RAISE| Alt | Space|RGBRMOD|RGBMOD|Space| Left | Up | Down | Right| Ctl= | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = EXPAND_LAYOUT( \ + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, \ + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, \ + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, \ + _________________QWERTY_L4_________________, RGB_TOG, RGBRST, _________________QWERTY_R4_________________, \ + _________________QWERTY_L5_________________, RGB_RMOD, RGB_MOD, _________________QWERTY_R5_________________ \ + ), + +#ifndef GAMELAYER_DISABLE + [_GAME] = EXPAND_LAYOUT( \ + ___________________GAME_L1_________________, ___________________GAME_R1_________________, \ + ___________________GAME_L2_________________, ___________________GAME_R2_________________, \ + ___________________GAME_L3_________________, ___________________GAME_R3_________________, \ + ___________________GAME_L4_________________, RGB_TOG, RGBRST, ___________________GAME_R4_________________, \ + ___________________GAME_L5_________________, RGB_RMOD, RGB_MOD, ___________________GAME_R5_________________ \ + ), +#endif + + [_LOWER] = EXPAND_LAYOUT( \ + __________________LOWER_L1_________________, __________________LOWER_R1_________________, \ + __________________LOWER_L2_________________, __________________LOWER_R2_________________, \ + __________________LOWER_L3_________________, __________________LOWER_R3_________________, \ + __________________LOWER_L4_________________, _______, _______, __________________LOWER_R4_________________, \ + __________________LOWER_L5_________________, _______, _______, __________________LOWER_R5_________________ \ + ), + + [_RAISE] = EXPAND_LAYOUT( \ + __________________RAISE_L1_________________, __________________RAISE_R1_________________, \ + __________________RAISE_L2_________________, __________________RAISE_R2_________________, \ + __________________RAISE_L3_________________, __________________RAISE_R3_________________, \ + __________________RAISE_L4_________________, _______, _______, __________________RAISE_R4_________________, \ + __________________RAISE_L5_________________, _______, _______, __________________RAISE_R5_________________ \ + ), + +#ifdef TRILAYER_ENABLED + [_ADJUST] = EXPAND_LAYOUT( \ + _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, \ + _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, \ + _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, \ + _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, \ + _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________ \ + ), +#endif +}; diff --git a/keyboards/helix/rev2/keymaps/xulkal/rules.mk b/keyboards/helix/rev2/keymaps/xulkal/rules.mk new file mode 100644 index 00000000000..a636b2a619e --- /dev/null +++ b/keyboards/helix/rev2/keymaps/xulkal/rules.mk @@ -0,0 +1,11 @@ +RGBLIGHT_ENABLE = yes +# Enable RGBLIGHT Animations +OPT_DEFS += -DRGBLIGHT_ANIMATIONS +# Helix specific define for correct RGBLED_NUM +OPT_DEFS += -DRGBLED_BACK + +OLED_DRIVER_ENABLE = yes +# Helix specific font file +OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" +# Xulkal specific oled define +OPT_DEFS += -DOLED_90ROTATION diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c index 049a864c1ad..5240ac800cb 100644 --- a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c +++ b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c @@ -46,10 +46,6 @@ enum macro_keycodes { KC_SAMPLEMACRO, }; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO //Macros #define M_SAMPLE M(KC_SAMPLEMACRO) @@ -158,7 +154,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; @@ -253,7 +249,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; diff --git a/keyboards/helix/rev2/rev2.c b/keyboards/helix/rev2/rev2.c index 75765f1d357..abaa02cdb13 100644 --- a/keyboards/helix/rev2/rev2.c +++ b/keyboards/helix/rev2/rev2.c @@ -2,6 +2,12 @@ #ifdef SSD1306OLED +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +} + void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here //led_set_user(usb_led); diff --git a/keyboards/helix/rev2/rules.mk b/keyboards/helix/rev2/rules.mk index 4ea623c4368..5582a0f9c40 100644 --- a/keyboards/helix/rev2/rules.mk +++ b/keyboards/helix/rev2/rules.mk @@ -1,4 +1,3 @@ SRC += rev2/matrix.c SRC += rev2/split_util.c SRC += rev2/split_scomm.c -SRC += ws2812.c diff --git a/keyboards/helix/rules.mk b/keyboards/helix/rules.mk index be234e60ecc..b3eea4028e3 100644 --- a/keyboards/helix/rules.mk +++ b/keyboards/helix/rules.mk @@ -3,7 +3,6 @@ SRC += serial.c SRC += ssd1306.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c index 325c29a3f70..6006ebf1bdb 100644 --- a/keyboards/helix/serial.c +++ b/keyboards/helix/serial.c @@ -71,8 +71,8 @@ #endif //////////////// for backward compatibility //////////////////////////////// -#ifndef SERIAL_USE_MULTI_TRANSACTION -/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; #endif @@ -112,7 +112,7 @@ int serial_update_buffers() return result; } -#endif // end of Simple API (OLD API, compatible with let's split serial.c) +#endif // end of OLD API (compatible with let's split serial.c) //////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) diff --git a/keyboards/helix/serial.h b/keyboards/helix/serial.h index 7e0c0847a43..2e53928df2d 100644 --- a/keyboards/helix/serial.h +++ b/keyboards/helix/serial.h @@ -15,31 +15,36 @@ // // 4: about 26kbps // // 5: about 20kbps // -// //// USE Simple API (OLD API, compatible with let's split serial.c) +// //// USE OLD API (compatible with let's split serial.c) // ex. // #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 // #define SERIAL_MASTER_BUFFER_LENGTH 1 // -// //// USE flexible API (using multi-type transaction function) -// #define SERIAL_USE_MULTI_TRANSACTION +// //// USE NEW API +// //// USE simple API (using signle-type transaction function) +// #define SERIAL_USE_SINGLE_TRANSACTION +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION // // ///////////////////////////////////////////////////////////////// -#ifndef SERIAL_USE_MULTI_TRANSACTION -/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ -#if SERIAL_SLAVE_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -#endif -#if SERIAL_MASTER_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; -#endif +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + #endif -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); + void serial_master_init(void); + void serial_slave_init(void); + int serial_update_buffers(void); -#endif // USE Simple API +#endif // end of USE OLD API +//////////////////////////////////////////////////////////////////////////// // Soft Serial Transaction Descriptor typedef struct _SSTD_t { diff --git a/keyboards/helix/ssd1306.c b/keyboards/helix/ssd1306.c index b3e55a67c20..dd3290ba0cc 100644 --- a/keyboards/helix/ssd1306.c +++ b/keyboards/helix/ssd1306.c @@ -1,3 +1,4 @@ + #ifdef SSD1306OLED #include "ssd1306.h" @@ -27,12 +28,17 @@ //static uint16_t last_battery_update; //static uint32_t vbat; //#define BatteryUpdateInterval 10000 /* milliseconds */ -#define ScreenOffInterval 300000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ #if DEBUG_TO_SCREEN static uint8_t displaying; #endif static uint16_t last_flush; +static bool force_dirty = true; + // Write command sequence. // Returns true on success. static inline bool _send_cmd1(uint8_t cmd) { @@ -318,12 +324,19 @@ void iota_gfx_task_user(void) { void iota_gfx_task(void) { iota_gfx_task_user(); - if (display.dirty) { + if (display.dirty|| force_dirty) { iota_gfx_flush(); + force_dirty = false; } if (timer_elapsed(last_flush) > ScreenOffInterval) { iota_gfx_off(); } } + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + #endif diff --git a/keyboards/helix/ssd1306.h b/keyboards/helix/ssd1306.h index 77ce7c211a0..9cf6983b7e4 100644 --- a/keyboards/helix/ssd1306.h +++ b/keyboards/helix/ssd1306.h @@ -4,6 +4,7 @@ #include #include #include "pincontrol.h" +#include "action.h" enum ssd1306_cmds { DisplayOff = 0xAE, @@ -87,6 +88,6 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); - +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); #endif diff --git a/keyboards/hhkb/config.h b/keyboards/hhkb/config.h index af7ecc5e258..fc747a6e942 100644 --- a/keyboards/hhkb/config.h +++ b/keyboards/hhkb/config.h @@ -49,11 +49,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef HHKB_RN42_ENABLE // rn42 support -- acquired from the tmk repo. This is almost certainly not // integrated with qmk in the correct way. diff --git a/keyboards/hhkb/keymaps/bakingpy/keymap.c b/keyboards/hhkb/keymaps/bakingpy/keymap.c new file mode 100644 index 00000000000..04d79f9247a --- /dev/null +++ b/keyboards/hhkb/keymaps/bakingpy/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_JP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_BSLS, + MO(1), KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_BSPC, KC_RGUI, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_JP( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, + _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, KC_PENT, + _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______)}; diff --git a/keyboards/hhkb/keymaps/bakingpy/rules.mk b/keyboards/hhkb/keymaps/bakingpy/rules.mk new file mode 100644 index 00000000000..a7f700f019c --- /dev/null +++ b/keyboards/hhkb/keymaps/bakingpy/rules.mk @@ -0,0 +1 @@ +OPT_DEFS += -DHHKB_JP diff --git a/keyboards/hhkb/keymaps/cinaeco/keymap.c b/keyboards/hhkb/keymaps/cinaeco/keymap.c index f50f90a8437..c27e37d8a0a 100644 --- a/keyboards/hhkb/keymaps/cinaeco/keymap.c +++ b/keyboards/hhkb/keymaps/cinaeco/keymap.c @@ -162,10 +162,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; diff --git a/keyboards/hhkb/keymaps/cinaeco/rules.mk b/keyboards/hhkb/keymaps/cinaeco/rules.mk index efed95492f7..a85669aa2f2 100644 --- a/keyboards/hhkb/keymaps/cinaeco/rules.mk +++ b/keyboards/hhkb/keymaps/cinaeco/rules.mk @@ -18,6 +18,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/hhkb/keymaps/dbroqua/keymap.c b/keyboards/hhkb/keymaps/dbroqua/keymap.c index 666471a03b3..4da9b1d4abf 100644 --- a/keyboards/hhkb/keymaps/dbroqua/keymap.c +++ b/keyboards/hhkb/keymaps/dbroqua/keymap.c @@ -97,10 +97,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DEF, ALT, KC_TRNS, KC_TRNS, KC_TRNS)}; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/hhkb/keymaps/default/keymap.c b/keyboards/hhkb/keymaps/default/keymap.c index 3a01fd80205..c63ef6a579d 100644 --- a/keyboards/hhkb/keymaps/default/keymap.c +++ b/keyboards/hhkb/keymaps/default/keymap.c @@ -54,26 +54,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) - { - case 0: - if (record->event.pressed) - { - register_code(KC_RSFT); - } - else - { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/hhkb/keymaps/enoch_jp/keymap.c b/keyboards/hhkb/keymaps/enoch_jp/keymap.c index 60bf832a741..15dc29773bf 100644 --- a/keyboards/hhkb/keymaps/enoch_jp/keymap.c +++ b/keyboards/hhkb/keymaps/enoch_jp/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS /* Layer 0: HHKB JP * ,-----------------------------------------------------------. @@ -44,10 +43,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)}; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; diff --git a/keyboards/hhkb/keymaps/eric/keymap.c b/keyboards/hhkb/keymaps/eric/keymap.c index 0f3b4c7f361..bf788b2ffda 100644 --- a/keyboards/hhkb/keymaps/eric/keymap.c +++ b/keyboards/hhkb/keymaps/eric/keymap.c @@ -53,10 +53,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_UNDS, KC_PLUS, KC_LPRN, KC_RPRN, KC_PIPE, KC_TRNS, KC_TRNS, KC_PGDN, KC_END, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)}; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/hhkb/keymaps/jp/keymap.c b/keyboards/hhkb/keymaps/jp/keymap.c index 24e4a04a53d..6fd06638cec 100644 --- a/keyboards/hhkb/keymaps/jp/keymap.c +++ b/keyboards/hhkb/keymaps/jp/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS - /* Layer 0: HHKB JP * ,-----------------------------------------------------------. * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| -| =|Yen|Bsp| @@ -49,7 +47,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t macro_id, uint8_t o { return MACRO_NONE; } - -const uint16_t PROGMEM fn_actions[] = { - -}; diff --git a/keyboards/hhkb/keymaps/jp_mac/keymap.c b/keyboards/hhkb/keymaps/jp_mac/keymap.c index 326f22cd123..f3ef3d6af6d 100644 --- a/keyboards/hhkb/keymaps/jp_mac/keymap.c +++ b/keyboards/hhkb/keymaps/jp_mac/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS - /* Layer 0: HHKB JP * ,-----------------------------------------------------------. * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| -| =|Yen|Bsp| @@ -49,7 +47,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t macro_id, uint8_t o { return MACRO_NONE; } - -const uint16_t PROGMEM fn_actions[] = { - -}; diff --git a/keyboards/hhkb/keymaps/krusli/keymap.c b/keyboards/hhkb/keymaps/krusli/keymap.c index 3a01fd80205..af6102f1084 100644 --- a/keyboards/hhkb/keymaps/krusli/keymap.c +++ b/keyboards/hhkb/keymaps/krusli/keymap.c @@ -55,10 +55,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)}; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/hhkb/keymaps/mjt/config.h b/keyboards/hhkb/keymaps/mjt/config.h index d38611538f9..3b8f2e676c9 100644 --- a/keyboards/hhkb/keymaps/mjt/config.h +++ b/keyboards/hhkb/keymaps/mjt/config.h @@ -51,11 +51,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/hhkb/keymaps/mjt/keymap.c b/keyboards/hhkb/keymaps/mjt/keymap.c index d1725f5c75a..e51eb8bf922 100644 --- a/keyboards/hhkb/keymaps/mjt/keymap.c +++ b/keyboards/hhkb/keymaps/mjt/keymap.c @@ -82,10 +82,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DYN_REC_STOP, KC_TRNS, KC_TRNS)}; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/hhkb/keymaps/rdg_jp/keymap.c b/keyboards/hhkb/keymaps/rdg_jp/keymap.c index 2afac7a0b0e..f40df74e876 100644 --- a/keyboards/hhkb/keymaps/rdg_jp/keymap.c +++ b/keyboards/hhkb/keymaps/rdg_jp/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS - enum { ZER, @@ -55,7 +53,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t macro_id, uint8_t o { return MACRO_NONE; } - -const uint16_t PROGMEM fn_actions[] = { - -}; diff --git a/keyboards/hhkb/keymaps/schaeferdev/README.md b/keyboards/hhkb/keymaps/schaeferdev/README.md new file mode 100644 index 00000000000..15b87c498d3 --- /dev/null +++ b/keyboards/hhkb/keymaps/schaeferdev/README.md @@ -0,0 +1,36 @@ + # QMK HHKB Keymap: schaeferdev + +This is my QMK keymap for the Happy Hacking Keyboard Pro 2 alternate controller made by Hasu. + + +## Movement Layer + +The main difference from the Default layer is the introduction of a Movement layer than can be used by holding the right command button. This layer enables to move the mouse and scroll using Page up and Page down. Additionally it allows to use Arrow-keys in VIM-like fashion on hjkl. + +I prefer this movement to the default HHKB FN layer as it allows all my fingers to remain on the home row. + +## Minor Changes + +- swapped Y and Z (as I am German and used to the different order). +- changed position of Delete Key +- both ` and ~ + + +## Setup (for macOS) +```bash +brew tap osx-cross/avr +brew install avr-gcc +brew install dfu-programmer +``` + + +## Flashing + +```bash +make clean +make hhkb:schaeferdev:dfu +``` + + +## Troubleshooting +For some reason I ran into the issue that my CMD key no longer recognized. I am not entirely sure what caused this but the problem occured regardless of the layout I flashed (was also broken for the default hhkb layout). I was able to fix this issue by resetting EEPROM of the keyboard. The easiest way to do this is probably to use the QMK Toolbox. diff --git a/keyboards/hhkb/keymaps/schaeferdev/config.h b/keyboards/hhkb/keymaps/schaeferdev/config.h new file mode 100644 index 00000000000..b3c799bb82a --- /dev/null +++ b/keyboards/hhkb/keymaps/schaeferdev/config.h @@ -0,0 +1,9 @@ +// Based off of this section: +// https://github.com/qmk/qmk_firmware/blob/master/doc/BUILD_GUIDE.md#the-configh-file +#pragma once + +// Define mousekey settings +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 4 +#define MOUSEKEY_MAX_SPEED 1 +#define MOUSEKEY_TIME_TO_MAX 70 \ No newline at end of file diff --git a/keyboards/hhkb/keymaps/schaeferdev/keymap.c b/keyboards/hhkb/keymaps/schaeferdev/keymap.c new file mode 100644 index 00000000000..ea6da450cfa --- /dev/null +++ b/keyboards/hhkb/keymaps/schaeferdev/keymap.c @@ -0,0 +1,76 @@ +/* -*- eval: (turn-on-orgtbl); -*- + * default HHKB Layout + */ +#include QMK_KEYBOARD_H + +#define BASE 0 +#define HHKB 1 +#define MOVEMENT 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* BASE Level: Default Layer + |--------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+-----| + | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backs |Backs| + |--------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+-----| + | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | | + |--------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+-----| + |Ctrl/ESC| A | S | D | F | G | H | J | K | L | ; | ' | Ent | | | + |--------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+-----| + | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn0 | | | + |--------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+-----| + |------+------+-----------------------+------+------| + | LAlt | LGUI | ******* Space ******* | MOUSE| RAlt | + |------+------+-----------------------+------+------| + */ + + [BASE] = LAYOUT( // default layer + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), + KC_LALT, KC_LCMD, /* */ KC_SPC, /* */ MO(MOVEMENT), KC_RALT), + + /* Layer HHKB: HHKB mode (HHKB Fn) + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | DEL | + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + | Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | | + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + | | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | | + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + | | | | | | | + | - | End | PgD | Dow | | | | | + |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| + |------+------+----------------------+------+------+ + | **** | **** | ******************** | **** | **** | + |------+------+----------------------+------+------+ + */ + + [HHKB] = LAYOUT( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + /* Layer MOUSE: MOUSE mode (MOUSE Fn) + |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----| + | `~ |ACC1 |ACC2 |ACC3 | | | | | | | | | | DEL | DEL | + |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----| + | |MBTN2| | up | | PgU| | | | | | | | | | + |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----| + | |MBTN1|right|down |left| PgD| <- | down arrow | up arrow | -> | | | | | | + |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----| + | |MBTN3| | | | | | ~ (N) | | | | | | | | + |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----| + |------+------+----------------------+------+------+ + | **** | **** | ******************** | **** | **** | + |------+------+----------------------+------+------+ + */ + + [MOVEMENT] = LAYOUT( + KC_GRV, KC_ACL0, KC_ACL1, KC_ACL2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_BTN2, KC_TRNS, KC_MS_U, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_BTN1, KC_MS_L, KC_MS_D, KC_MS_R, KC_PGDN, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)}; \ No newline at end of file diff --git a/keyboards/hhkb/keymaps/schaeferdev/rules.mk b/keyboards/hhkb/keymaps/schaeferdev/rules.mk new file mode 100644 index 00000000000..35591533cc6 --- /dev/null +++ b/keyboards/hhkb/keymaps/schaeferdev/rules.mk @@ -0,0 +1 @@ +MOUSEKEY_ENABLE = yes \ No newline at end of file diff --git a/keyboards/hhkb/keymaps/sh_jp/keymap.c b/keyboards/hhkb/keymaps/sh_jp/keymap.c index 39710a65428..79515c5a6ef 100644 --- a/keyboards/hhkb/keymaps/sh_jp/keymap.c +++ b/keyboards/hhkb/keymaps/sh_jp/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS - enum { DVOR, @@ -50,7 +48,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t macro_id, uint8_t o { return MACRO_NONE; } - -const uint16_t PROGMEM fn_actions[] = { - -}; diff --git a/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c index 5664d4d2a54..a15f5e5e0b3 100644 --- a/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c +++ b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c @@ -1,4 +1,5 @@ #include "quantum.h" +#include "command.h" #include "action_pseudo_lut.h" static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE]; diff --git a/keyboards/hhkb/keymaps/smt/keymap.c b/keyboards/hhkb/keymaps/smt/keymap.c index 428861640fc..e1d8bae2e49 100644 --- a/keyboards/hhkb/keymaps/smt/keymap.c +++ b/keyboards/hhkb/keymaps/smt/keymap.c @@ -16,10 +16,6 @@ enum planck_keycodes HHKB }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift @@ -121,10 +117,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, QWERTY, COLEMAK, DVORAK, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, _______, _______, _______, _______)}; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/hhkb/readme.md b/keyboards/hhkb/readme.md index 8774a73f775..57eb8143910 100644 --- a/keyboards/hhkb/readme.md +++ b/keyboards/hhkb/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make hhkb:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/hhkb/rules.mk b/keyboards/hhkb/rules.mk index 3abd31c33a1..0483a2a8784 100644 --- a/keyboards/hhkb/rules.mk +++ b/keyboards/hhkb/rules.mk @@ -4,7 +4,6 @@ SRC = matrix.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/hid_liber/config.h b/keyboards/hid_liber/config.h index 0817db00127..c21307e1a2c 100755 --- a/keyboards/hid_liber/config.h +++ b/keyboards/hid_liber/config.h @@ -35,7 +35,7 @@ #define MATRIX_COLS 8 // HID Liberation Device uses custom matrix code to accomodate a 74HC238 3 to 8 decoder on pins B1, B2 and B3. -#define DIODE_DIRECTION CUSTOM_MATRIX +//#define DIODE_DIRECTION // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING @@ -45,7 +45,7 @@ //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -85,11 +85,6 @@ * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/hid_liber/keymaps/bakageta/keymap.c b/keyboards/hid_liber/keymaps/bakageta/keymap.c index 9754a70dfc3..dab702e1072 100755 --- a/keyboards/hid_liber/keymaps/bakageta/keymap.c +++ b/keyboards/hid_liber/keymaps/bakageta/keymap.c @@ -17,7 +17,6 @@ #include "hid_liber.h" // Helpful defines -#define _______ KC_TRNS #define FN_CAPS LT(_FL, KC_CAPSLOCK) // Each layer gets a name for readability, which is then used in the keymap matrix below. diff --git a/keyboards/hid_liber/keymaps/default/keymap.c b/keyboards/hid_liber/keymaps/default/keymap.c index 337b4829d2d..1102b0b96b7 100755 --- a/keyboards/hid_liber/keymaps/default/keymap.c +++ b/keyboards/hid_liber/keymaps/default/keymap.c @@ -14,10 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "hid_liber.h" - -// Helpful defines -#define _______ KC_TRNS +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -46,22 +43,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/hid_liber/readme.md b/keyboards/hid_liber/readme.md index 77ea1babb16..bc16c165bed 100755 --- a/keyboards/hid_liber/readme.md +++ b/keyboards/hid_liber/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make hid_liber:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/hid_liber/rules.mk b/keyboards/hid_liber/rules.mk index f28a4c6ae5d..8d43488494b 100755 --- a/keyboards/hid_liber/rules.mk +++ b/keyboards/hid_liber/rules.mk @@ -2,7 +2,6 @@ SRC = matrix.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/hifumi/config.h b/keyboards/hifumi/config.h new file mode 100644 index 00000000000..b4f192a7a73 --- /dev/null +++ b/keyboards/hifumi/config.h @@ -0,0 +1,56 @@ +/* +Copyright 2019 zk-phi + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER riconken +#define PRODUCT hifumi +#define DESCRIPTION A macropad with 6 keys + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6 } +#define MATRIX_COL_PINS { F4, F5, F6 } +#define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 6 +#define RGBLIGHT_LIMIT_VAL 255 +#define RGBLIGHT_HUE_STEP 5 +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/hifumi/hifumi.h b/keyboards/hifumi/hifumi.h new file mode 100644 index 00000000000..389ce206e0a --- /dev/null +++ b/keyboards/hifumi/hifumi.h @@ -0,0 +1,31 @@ +/* Copyright 2019 zk-phi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11, k12 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 } \ +} diff --git a/keyboards/hifumi/info.json b/keyboards/hifumi/info.json new file mode 100644 index 00000000000..2466838a048 --- /dev/null +++ b/keyboards/hifumi/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "hifumi", + "url": "https://github.com/zk-phi/1x2x3-keyboard", + "maintainer": "riconken", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [{"label":"F5", "x":0, "y":0}, {"label":"Up", "x":1, "y":0}, {"label":"PrSc", "x":2, "y":0}, {"label":"Left", "x":0, "y":1}, {"label":"Down", "x":1, "y":1}, {"label":"Right", "x":2, "y":1}] + } + } +} diff --git a/keyboards/hifumi/keymaps/default/keymap.c b/keyboards/hifumi/keymaps/default/keymap.c new file mode 100644 index 00000000000..9a4330398fc --- /dev/null +++ b/keyboards/hifumi/keymaps/default/keymap.c @@ -0,0 +1,47 @@ +/* Copyright 2019 zk-phi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +enum layers { + DEFAULT, + RAISE, + LOWER, + ADJUST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT] = LAYOUT( + LT(RAISE, KC_F5), KC_UP, LT(LOWER, KC_PSCR), + KC_LEFT, KC_DOWN, KC_RIGHT + ), + [RAISE] = LAYOUT( + _______, KC_PGUP, MO(ADJUST), + KC_HOME, KC_PGDN, KC_END + ), + [LOWER] = LAYOUT( + MO(ADJUST), _______, _______, + _______, _______, _______ + ), + [ADJUST] = LAYOUT( + _______, RGB_TOG, _______, + RGB_MODE_SNAKE, RGB_MODE_PLAIN, RGB_HUI + ) +}; diff --git a/keyboards/hifumi/keymaps/test/keymap.c b/keyboards/hifumi/keymaps/test/keymap.c new file mode 100644 index 00000000000..7aec009ebf7 --- /dev/null +++ b/keyboards/hifumi/keymaps/test/keymap.c @@ -0,0 +1,32 @@ +/* Copyright 2019 zk-phi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +enum layers { + DEFAULT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT] = LAYOUT( + KC_1, KC_2, KC_3, + KC_A, KC_B, KC_C + ) +}; diff --git a/keyboards/hifumi/readme.md b/keyboards/hifumi/readme.md new file mode 100644 index 00000000000..2911c124443 --- /dev/null +++ b/keyboards/hifumi/readme.md @@ -0,0 +1,13 @@ +# hifumi + +A macro pad with 6 keys. + +Keyboard Maintainer: riconken, [zk-phi](https://github.com/zk-phi) +Hardware Supported: hifumi PCB, Pro Micro +Hardware Availability: [PCB & Case Data](https://github.com/zk-phi/1x2x3-keyboard) + +Make example for this keyboard (after setting up your build environment): + + make hifumi:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/hifumi/rules.mk b/keyboards/hifumi/rules.mk new file mode 100644 index 00000000000..53be9fb8abf --- /dev/null +++ b/keyboards/hifumi/rules.mk @@ -0,0 +1,61 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing diff --git a/keyboards/hineybush/h87a/config.h b/keyboards/hineybush/h87a/config.h new file mode 100644 index 00000000000..245e6eda835 --- /dev/null +++ b/keyboards/hineybush/h87a/config.h @@ -0,0 +1,76 @@ +/* +Copyright 2018 Josh Hinnebusch + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER hineybush +#define PRODUCT h87a +#define DESCRIPTION QMK-programmable TKL PCB for custom keyboards + +#define CONFIG_H + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, D0, D1, B5, B6, D7, B4, D6, D4 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7, C6, D2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 24 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_SLEEP // RGB will turn off when PC is put to sleep +#endif diff --git a/keyboards/h87a/h87a.c b/keyboards/hineybush/h87a/h87a.c similarity index 100% rename from keyboards/h87a/h87a.c rename to keyboards/hineybush/h87a/h87a.c diff --git a/keyboards/hineybush/h87a/h87a.h b/keyboards/hineybush/h87a/h87a.h new file mode 100644 index 00000000000..437199b23ed --- /dev/null +++ b/keyboards/hineybush/h87a/h87a.h @@ -0,0 +1,90 @@ +/* Copyright 2018 Josh Hinnebusch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_all(\ + K000, K001, K011, K002, K012, K003, K013, K004, K014, K015, K006, K016, K007, K017, K008, K018, \ + K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K036, K027, K037, K028, K038, \ + K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K057, K048, K058, \ + K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K066, K076, \ + K080, K090, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K096, K088, \ + K100, K110, K101, K113, K105, K115, K106, K116, K117, K108, K118 \ +) { \ + { K000, K001, K002, K003, K004, KC_NO, K006, K007, K008 }, \ + { KC_NO, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, KC_NO, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, K066, KC_NO, KC_NO }, \ + { K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \ + { K080, K081, K082, K083, K084, K085, K086, KC_NO, K088 }, \ + { K090, K091, K092, K093, K094, K095, K096, KC_NO, KC_NO }, \ + { K100, K101, KC_NO, KC_NO, KC_NO, K105, K106, KC_NO, K108 }, \ + { K110, KC_NO, KC_NO, K113, KC_NO, K115, K116, K117, K118 } \ +} + + +#define LAYOUT_tkl_ansi(\ + K000, K001, K011, K002, K012, K003, K013, K004, K014, K015, K006, K016, K007, K017, K008, K018, \ + K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K027, K037, K028, K038, \ + K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K057, K048, K058, \ + K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K076, \ + K080, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K088, \ + K100, K110, K101, K113, K105, K115, K106, K116, K117, K108, K118 \ +) { \ + { K000, K001, K002, K003, K004, KC_NO, K006, K007, K008 }, \ + { KC_NO, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, KC_NO, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, KC_NO, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, KC_NO, KC_NO, KC_NO }, \ + { K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \ + { K080, K081, K082, K083, K084, K085, K086, KC_NO, K088 }, \ + {KC_NO, K091, K092, K093, K094, K095, KC_NO, KC_NO, KC_NO }, \ + { K100, K101, KC_NO, KC_NO, KC_NO, K105, K106, KC_NO, K108 }, \ + { K110, KC_NO, KC_NO, K113, KC_NO, K115, K116, K117, K118 } \ +} + +#define LAYOUT_tkl_ansi_wkl(\ + K000, K001, K011, K002, K012, K003, K013, K004, K014, K015, K006, K016, K007, K017, K008, K018, \ + K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K027, K037, K028, K038, \ + K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K057, K048, K058, \ + K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K076, \ + K080, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K088, \ + K100, K101, K113, K115, K116, K117, K108, K118 \ +) { \ + { K000, K001, K002, K003, K004, KC_NO, K006, K007, K008 }, \ + { KC_NO, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, KC_NO, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, KC_NO, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, KC_NO, KC_NO, KC_NO }, \ + { K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \ + { K080, K081, K082, K083, K084, K085, K086, KC_NO, K088 }, \ + {KC_NO, K091, K092, K093, K094, K095, KC_NO, KC_NO, KC_NO }, \ + { K100, K101, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, K108 }, \ + {KC_NO, KC_NO, KC_NO, K113, KC_NO, K115, K116, K117, K118 } \ +} + diff --git a/keyboards/hineybush/h87a/info.json b/keyboards/hineybush/h87a/info.json new file mode 100644 index 00000000000..57f68db0b7a --- /dev/null +++ b/keyboards/hineybush/h87a/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "h87a", + "url": "", + "maintainer": "hineybush", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"x":13, "y":1.5}, {"label":"Bksp", "x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + }, + + "LAYOUT_tkl_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Bksp", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + }, + "LAYOUT_tkl_ansi_wkl": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Bksp", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, {"x":4, "y":5.5, "w":7}, {"label":"Alt", "x":11, "y":5.5, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + } + } +} + diff --git a/keyboards/hineybush/h87a/keymaps/default/config.h b/keyboards/hineybush/h87a/keymaps/default/config.h new file mode 100644 index 00000000000..cef67bd4880 --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/default/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Josh Hinnebusch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + + +// place overrides here + diff --git a/keyboards/hineybush/h87a/keymaps/default/keymap.c b/keyboards/hineybush/h87a/keymaps/default/keymap.c new file mode 100644 index 00000000000..974a7e35bc3 --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/default/keymap.c @@ -0,0 +1,69 @@ +/* Copyright 2018 Josh Hinnebusch + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_init_ports(void) { + DDRD |= (1<<5); // OUT + DDRE |= (1<<6); // OUT +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRE |= (1 << 6); PORTE &= ~(1 << 6); + } else { + DDRE &= ~(1 << 6); PORTE &= ~(1 << 6); + } + +} diff --git a/keyboards/hineybush/h87a/keymaps/default/readme.md b/keyboards/hineybush/h87a/keymaps/default/readme.md new file mode 100644 index 00000000000..da22afc6ad3 --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for h87a \ No newline at end of file diff --git a/keyboards/hineybush/h87a/keymaps/gam3cat/config.h b/keyboards/hineybush/h87a/keymaps/gam3cat/config.h new file mode 100644 index 00000000000..334beb0ac2b --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/gam3cat/config.h @@ -0,0 +1,10 @@ +#pragma once + +//Force NKRO to be enabled. +#define FORCE_NKRO + +//GRAVE_ESC override for CTRL+SHIFT+ESC Windows task manager shortcut. +//#define GRAVE_ESC_CTRL_OVERRIDE + +//Delay matrix scan for tap dance, reduce to activate modifier keys faster. +//#define TAPPING_TERM 200 diff --git a/keyboards/hineybush/h87a/keymaps/gam3cat/keymap.c b/keyboards/hineybush/h87a/keymaps/gam3cat/keymap.c new file mode 100644 index 00000000000..fde2637154d --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/gam3cat/keymap.c @@ -0,0 +1,292 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +enum layers { + _BL = 0, // Base Layer + _WL, // Workman Layer + _NL, // Norman Layer + _DL, // Dvorak Layer + _CL, // Base Layer + _FL, // Function Layer + _AL, // Adjust Layer +}; + +enum custom_keycodes { + QMK_REV = SAFE_RANGE, + KC_WEB, + KC_SP4, + DYNAMIC_MACRO_RANGE +}; + +extern backlight_config_t backlight_config; + +#include "dynamic_macro.h" +#define FN_CAPS LT(_FL, KC_CAPS) +#define KC_DMR1 DYN_REC_START1 +#define KC_DMR2 DYN_REC_START2 +#define KC_DMP1 DYN_MACRO_PLAY1 +#define KC_DMP2 DYN_MACRO_PLAY2 +#define KC_DMRS DYN_REC_STOP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /*#### _BL: Base Layer - Standard TKL QWERTY layout. + * .-----------------------------------------------------------------------. + * |Esc|||||F1 |F2 |F3 |F4 |||F5 |F6 |F7 |F8 |||F9 |F10|F11|F12|PSc|SLk|Pau| + * |-----------------------------------------------------------|-----------| + * |~ |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backsp |Ins|Hom|PgU| + * |-----------------------------------------------------------|-----------| + * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del|End|PgD| + * |-----------------------------------------------------------|-----------| + * |Caps |A |S |D |F |G |H |J |K |L |; |' |Return | | + * |-----------------------------------------------------------|-----------| + * |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Fn | | Up| | + * |-----------------------------------------------------------|-----------| + * |Ctrl |Win|Alt | Space |RAlt |Fn |Ctrl |Lft|Dwn|Rgt| + * *-----------------------------------------------------------------------* + */ + [_BL] = LAYOUT_all( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FL), KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + /*#### _WL: Workman Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |S |H |T |G |Y |N |E |O |I |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |M |C |V |K |L |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* + */ + [_WL] = LAYOUT_all( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_Q , KC_D , KC_R , KC_W , KC_B , KC_J , KC_F , KC_U , KC_P , KC_SCLN, _______, _______, _______, _______, _______, _______, \ + _______, KC_A , KC_S , KC_H , KC_T , KC_G , KC_Y , KC_N , KC_E , KC_O , KC_I , _______, _______, _______, \ + _______, _______, KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /*#### _NL: Norman Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |S |E |T |G |Y |N |I |O |H |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |C |V |B |P |M |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* + */ + [_NL] = LAYOUT_all( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_Q , KC_W , KC_D , KC_F , KC_K , KC_J , KC_U , KC_R , KC_L , KC_SCLN, _______, _______, _______, _______, _______, _______, \ + _______, KC_A , KC_S , KC_E , KC_T , KC_G , KC_Y , KC_N , KC_I , KC_O , KC_H , _______, _______, _______, \ + _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_P , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /*#### _DL: Dvorak Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |[ |] | | | | | + * |-----------------------------------------------------------|-----------| + * | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |O |E |U |I |D |H |T |N |S |- | | | + * |-----------------------------------------------------------|-----------| + * | |; |Q |J |K |X |B |M |W |V |Z | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* + */ + [_DL] = LAYOUT_all( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______, \ + _______, KC_QUOT, KC_COMM, KC_DOT , KC_P , KC_Y , KC_F , KC_G , KC_C , KC_R , KC_L , KC_SLSH, KC_EQL , _______, _______, _______, _______, \ + _______, KC_A , KC_O , KC_E , KC_U , KC_I , KC_D , KC_H , KC_T , KC_N , KC_S , KC_MINS, _______, _______, \ + _______, _______, KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z , _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /*#### _CL: Colmak Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |R |S |T |D |H |N |E |I |O |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |C |V |B |K |M |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* + */ + [_CL] = LAYOUT_all( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, _______, _______, _______, _______, _______, _______, \ + _______, KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , _______, _______, _______, \ + _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /*#### _FL: Function Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | + * .-----------------------------------------------------------|-----------| + * |Web| | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * |Fn_AL| | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | |Lft|Dwn|Up |Rgt| | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | | |Fn | | | | + * |-----------------------------------------------------------|-----------| + * | | | | SP4 | |Fn | |WBk| |WFw| + * *-----------------------------------------------------------------------* + */ + [_FL] = LAYOUT_all( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_WEB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MO(_AL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_MENU, KC_SP4, XXXXXXX, _______, XXXXXXX, XXXXXXX, KC_WBAK, XXXXXXX, KC_WFWD \ + ), + /*#### _AL: Adjust Layer - Keymap select, LED backlight, and Dynamic Macro settings. + * .-----------------------------------------------------------------------. + * |Rst||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| + * |-----------------------------------------------------------|-----------| + * |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| + * |-----------------------------------------------------------|-----------| + * | | | |_DL| | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | |_CL| |_BL|_NL| | | | | |Fn | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | |Fn | | | | | + * *-----------------------------------------------------------------------* + */ + [_AL] = LAYOUT_all( \ + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + QMK_REV, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMR1, KC_DMP1, \ + _______, DF(_BL), DF(_WL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMRS, KC_DMR2, KC_DMP2, \ + XXXXXXX, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DF(_CL), XXXXXXX, DF(_BL), DF(_NL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMK_REV: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE); + } + return false; + break; + case KC_WEB: + if (record->event.pressed) { + SEND_STRING(SS_LGUI("r")); + wait_ms(100); + SEND_STRING("chrome.exe\n"); + } + return false; + break; + case KC_SP4: + if (record->event.pressed) { + SEND_STRING (" "); + } + return false; + break; + } + // Dynamic Macros. + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + return true; +} + +void custom_backlight_level(uint8_t level) { + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + backlight_config.level = level; + backlight_config.enable = !!backlight_config.level; + backlight_set(backlight_config.level); +} + +void matrix_init_user(void) { + #ifdef BACKLIGHT_ENABLE + custom_backlight_level(0); + #endif + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + rgblight_sethsv_noeeprom(180,100,100); + #endif +} + +void matrix_scan_user(void) { + +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _BL: + custom_backlight_level(0); + rgblight_sethsv_noeeprom(180,100,255); + break; + case _WL: + case _NL: + case _DL: + case _CL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(230,255,255); + break; + case _FL: + custom_backlight_level(2); + rgblight_sethsv_noeeprom(240,255,255); + break; + case _AL: + custom_backlight_level(3); + rgblight_sethsv_noeeprom(255,255,255); + break; + default: + custom_backlight_level(0); + rgblight_sethsv_noeeprom(180,100,100); + break; + } + return state; +} + +void led_init_ports(void) { + DDRD |= (1<<5); // OUT + DDRE |= (1<<6); // OUT +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRE |= (1 << 6); PORTE &= ~(1 << 6); + } else { + DDRE &= ~(1 << 6); PORTE &= ~(1 << 6); + } +} diff --git a/keyboards/hineybush/h87a/keymaps/gam3cat/readme.md b/keyboards/hineybush/h87a/keymaps/gam3cat/readme.md new file mode 100644 index 00000000000..5eb4c7d611e --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/gam3cat/readme.md @@ -0,0 +1,114 @@ +# Keymap Maintainer: Gam3cat +make h87a:gam3cat +## Layout Config: +2u backspace, 2.25u lshift/enter, [2.75u rshift] or [1.75u rshift, 1u Fn]. +[1.5u, 1u, 1.5u 1x7.0u, 1.5u, 1u, 1.5u, 3x1u] or [2x1.5u, 1x7.0u, 2x1.5u, 3x1u] bottom row. + +## Base Layer Selection: +(Fn+TAB+( )): (Q)WERTY, (W)orkman, (N)orman, (D)vorak, (C)olmak + +### Base Layer Options: +#### _BL: Base Layer - Standard TKL QWERTY layout. + .-----------------------------------------------------------------------. + |Esc|||||F1 |F2 |F3 |F4 |||F5 |F6 |F7 |F8 |||F9 |F10|F11|F12|PSc|SLk|Pau| + |-----------------------------------------------------------|-----------| + |~ |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backsp |Ins|Hom|PgU| + |-----------------------------------------------------------|-----------| + |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del|End|PgD| + |-----------------------------------------------------------|-----------| + |Caps |A |S |D |F |G |H |J |K |L |; |' |Return | | + |-----------------------------------------------------------|-----------| + |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Fn | | Up| | + |-----------------------------------------------------------|-----------| + |Ctrl |Win|Alt | Space |RAlt |Fn |Ctrl |Lft|Dwn|Rgt| + *-----------------------------------------------------------------------* + +#### _WL: Workman Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + | | | | | | | | | | | |- |= | | | | | + |-----------------------------------------------------------|-----------| + | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | | | + |-----------------------------------------------------------|-----------| + | |A |S |H |T |G |Y |N |E |O |I |' | | | + |-----------------------------------------------------------|-----------| + | |Z |X |M |C |V |K |L |, |. |/ | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | + *-----------------------------------------------------------------------* + +#### _NL: Norman Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + | | | | | | | | | | | |- |= | | | | | + |-----------------------------------------------------------|-----------| + | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | | | + |-----------------------------------------------------------|-----------| + | |A |S |E |T |G |Y |N |I |O |H |' | | | + |-----------------------------------------------------------|-----------| + | |Z |X |C |V |B |P |M |, |. |/ | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | + *-----------------------------------------------------------------------* + +#### _DL: Dvorak Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + | | | | | | | | | | | |[ |] | | | | | + |-----------------------------------------------------------|-----------| + | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | | | + |-----------------------------------------------------------|-----------| + | |A |O |E |U |I |D |H |T |N |S |- | | | + |-----------------------------------------------------------|-----------| + | |; |Q |J |K |X |B |M |W |V |Z | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | + *-----------------------------------------------------------------------* + +#### _CL: Colmak Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + | | | | | | | | | | | |- |= | | | | | + |-----------------------------------------------------------|-----------| + | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | | | + |-----------------------------------------------------------|-----------| + | |A |R |S |T |D |H |N |E |I |O |' | | | + |-----------------------------------------------------------|-----------| + | |Z |X |C |V |B |K |M |, |. |/ | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | + *-----------------------------------------------------------------------* + +#### _FL: Function Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | + .-----------------------------------------------------------|-----------| + |Web| | | | | | | | | | | | | | | | | + |-----------------------------------------------------------|-----------| + |Fn_AL| | | | | | | | | | | | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | |Lft|Dwn|Up |Rgt| | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | | |Fn | | | | + |-----------------------------------------------------------|-----------| + | | | | SP4 | |Fn | |WBk| |WFw| + *-----------------------------------------------------------------------* + +#### _AL: Adjust Layer - Keymap select, LED backlight, and Dynamic Macro settings. + .-----------------------------------------------------------------------. + |Rst||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| + |-----------------------------------------------------------|-----------| + |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| + |-----------------------------------------------------------|-----------| + | | | |_DL| | | | | | | | | | | + |-----------------------------------------------------------|-----------| + | | | |_CL| |_BL|_NL| | | | | |Fn | | | | + |-----------------------------------------------------------|-----------| + | | | | | |Fn | | | | | + *-----------------------------------------------------------------------* diff --git a/keyboards/hineybush/h87a/keymaps/gam3cat/rules.mk b/keyboards/hineybush/h87a/keymaps/gam3cat/rules.mk new file mode 100644 index 00000000000..85b2b41a6bc --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/gam3cat/rules.mk @@ -0,0 +1,24 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +TAP_DANCE_ENABLE = no # Enable TapDance functionality +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+1500) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # Nkey Rollover - If this doesn't work, add this to config.h: #define FORCE_NKRO +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = no # Enable extended unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Uses buzzer to emulate clicky switches. By default, uses the C6 pin, same as AUDIO_ENABLE. +#VARIABLE_TRACE = no # Use this to debug changes to variable values +API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings(+5390) +KEY_LOCK_ENABLE = no # This enables key lock(+260) +SPLIT_KEYBOARD = no # This enables split keyboard support and includes all necessary files located at quantum/split_common diff --git a/keyboards/hineybush/h87a/keymaps/wkl/config.h b/keyboards/hineybush/h87a/keymaps/wkl/config.h new file mode 100644 index 00000000000..cef67bd4880 --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/wkl/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Josh Hinnebusch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + + +// place overrides here + diff --git a/keyboards/hineybush/h87a/keymaps/wkl/keymap.c b/keyboards/hineybush/h87a/keymaps/wkl/keymap.c new file mode 100644 index 00000000000..72b4d4e44da --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/wkl/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2018 Josh Hinnebusch + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_tkl_ansi_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_tkl_ansi_wkl( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_init_ports(void) { + setPinOutput(D5); + setPinOutput(E6); +} + +void led_set_user(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + setPinOutput(D5); + writePinLow(D5); + } else { + setPinInput(D5); + writePinLow(D5); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + setPinOutput(E6); + writePinLow(E6); + } else { + setPinInput(E6); + writePinLow(E6); + } + +} diff --git a/keyboards/hineybush/h87a/keymaps/wkl/readme.md b/keyboards/hineybush/h87a/keymaps/wkl/readme.md new file mode 100644 index 00000000000..da22afc6ad3 --- /dev/null +++ b/keyboards/hineybush/h87a/keymaps/wkl/readme.md @@ -0,0 +1 @@ +# The default keymap for h87a \ No newline at end of file diff --git a/keyboards/hineybush/h87a/readme.md b/keyboards/hineybush/h87a/readme.md new file mode 100644 index 00000000000..90f513c45d1 --- /dev/null +++ b/keyboards/hineybush/h87a/readme.md @@ -0,0 +1,45 @@ +h87a +=== + +A QMK-powered replacement PCB for custom TKL keyboards. This PCB has the same size of the b.87 PCB, while using the USB port placement and spacebar stabilizer orientation as the a.87 PCB. + +Keyboard Maintainer: [hineybush](https://github.com/hineybush) +Hardware Supported: h87a ver. 1.5, ver. 1.6 (normal and thin), h87alps +Hardware Availability: hineybush.com + +Make example for this keyboard (after setting up your build environment): + + make hineybush/h87a:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## h87a hardware information + +Controller: Atmega32u4 + + /* Column pin configuration + * col: 0 1 2 3 4 5 6 7 8 + * pin: F0 F1 F4 F5 F6 F7 C7 C6 D2 + */ + + /* Row pin configuration + * row: 0 1 2 3 4 5 6 7 8 9 10 11 + * pin: B0 B1 B2 B3 D0 D1 B5 B6 D7 B4 D6 D4 (Rev 1) + */ + +The H87a PCB utilizes duplex matrix organization. + + Caps Lock LED: D5 + Scroll Lock LED: E6 + Num Lock LED: not supported + Backlight Pin: B7 + RGB Data Pin: D3 + + + +For ver 1.5 in-switch indicators: +To connect the Caps Lock LED to the main backlight matrix, jump the middle pad and the left pad on J1. To use the Caps Lock LED as an indicator, jump the middle pad and the right pad on J1. + +To connect the Scroll Lock LED to the main backlight matrix, jump the middle pad and the right pad on J2. To use the Scroll Lock LED as an indicator, jump the middle pad and the left pad on J2. + +Note: The different orientations of J1 and J2 was fixed with ver. 1.6. diff --git a/keyboards/hineybush/h87a/rules.mk b/keyboards/hineybush/h87a/rules.mk new file mode 100644 index 00000000000..50aac07ada8 --- /dev/null +++ b/keyboards/hineybush/h87a/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +EXTRAFLAGS += -flto diff --git a/keyboards/hineybush/hineyg80/config.h b/keyboards/hineybush/hineyg80/config.h new file mode 100644 index 00000000000..4072def2fbc --- /dev/null +++ b/keyboards/hineybush/hineyg80/config.h @@ -0,0 +1,46 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER hineybush +#define PRODUCT hineyG80 +#define DESCRIPTION QMK-powered PCB for Cherry G80/81-1800 Boards + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B2, B3, D0, B1, D2, D1, D5, D3, D6, D4, B4, D7 } +#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, F0, B7, B0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/hineybush/hineyg80/hineyg80.c b/keyboards/hineybush/hineyg80/hineyg80.c new file mode 100644 index 00000000000..236c646be75 --- /dev/null +++ b/keyboards/hineybush/hineyg80/hineyg80.c @@ -0,0 +1,63 @@ +/* Copyright 2019 Josh Hinnebusch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "hineyg80.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + // Turn numlock on + writePinHigh(C6); + } else { + // Turn numlock off + writePinLow(C6); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + // Turn capslock on + writePinHigh(B6); + } else { + // Turn capslock off + writePinLow(B6); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + // Turn scrolllock on + writePinHigh(B5); + } else { + // Turn scrolllock off + writePinLow(B5); + } + led_set_user(usb_led); +} diff --git a/keyboards/hineybush/hineyg80/hineyg80.h b/keyboards/hineybush/hineyg80/hineyg80.h new file mode 100644 index 00000000000..617c5166a94 --- /dev/null +++ b/keyboards/hineybush/hineyg80/hineyg80.h @@ -0,0 +1,89 @@ +/* Copyright 2019 Josh Hinnebusch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT_all( \ + K000,K010,K001,K011,K002,K012,K003,K013,K004,K014,K005,K015,K006, K007,K017,K008,K018, \ + K027,K016,K028,K038, \ + K020,K030,K021,K031,K022,K032,K023,K033,K024,K034,K025,K035,K026,K036,K037,K047,K057,K048,K058, \ + K040,K050,K041,K051,K042,K052,K043,K053,K044,K054,K045,K055,K046,K056, K067,K077,K068,K078, \ + K060,K070,K061,K071,K062,K072,K063,K073,K064,K074,K065,K075,K066,K076, K087,K097,K088,K098, \ + K080,K090,K081,K091,K082,K092,K083,K093,K084,K094,K085,K095,K086,K096, K106,K116,K108,K118, \ + K100,K110,K101, K102, K112,K103,K113,K104,K114, K105,K115,K117,K107 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, K066, K067, K068 }, \ + { K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, K083, K084, K085, K086, K087, K088 }, \ + { K090, K091, K092, K093, K094, K095, K096, K097, K098 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108 }, \ + { K110, KC_NO, K112, K113, K114, K115, K116, K117, K118 } \ +} + +/* 6U spacebar, 1U mods */ +#define LAYOUT_ansi_100u_mods( \ + K000,K010,K001,K011,K002,K012,K003,K013,K004,K014,K005,K015,K006, K007,K017,K008,K018, \ + K027,K016,K028,K038, \ + K020,K030,K021,K031,K022,K032,K023,K033,K024,K034,K025,K035,K026,K036,K047,K057,K048,K058, \ + K040,K050,K041,K051,K042,K052,K043,K053,K044,K054,K045,K055,K046,K056,K067,K077,K068,K078, \ + K060,K070,K061,K071,K062,K072,K063,K073,K064,K074,K065,K075, K076,K087,K097,K088,K098, \ + K080 ,K081,K091,K082,K092,K083,K093,K084,K094,K085,K095,K086,K096,K106,K116,K108,K118, \ + K100,K110,K101, K102, K112,K103,K113,K104,K114,K105,K115,K117,K107 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, KC_NO, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, KC_NO, K067, K068 }, \ + { K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, K083, K084, K085, K086, K087, K088 }, \ + {KC_NO, K091, K092, K093, K094, K095, K096, K097, K098 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108 }, \ + { K110, KC_NO, K112, K113, K114, K115, K116, K117, K118 } \ +} + +/* 7U spacebar, 1.5U mods */ +#define LAYOUT_ansi_150u_mods( \ + K000,K010,K001,K011,K002,K012,K003,K013,K004,K014,K005,K015,K006, K007,K017,K008,K018, \ + K027,K016,K028,K038, \ + K020,K030,K021,K031,K022,K032,K023,K033,K024,K034,K025,K035,K026,K036,K047,K057,K048,K058, \ + K040,K050,K041,K051,K042,K052,K043,K053,K044,K054,K045,K055,K046,K056,K067,K077,K068,K078, \ + K060,K070,K061,K071,K062,K072,K063,K073,K064,K074,K065,K075 ,K076,K087,K097,K088,K098, \ + K080 ,K081,K091,K082,K092,K083,K093,K084,K094,K085,K095,K086,K096,K106,K116,K108,K118, \ + K100, K101, K102, K103, K104,K114,K105,K115,K117,K107 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, KC_NO, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, KC_NO, K067, K068 }, \ + { K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, K083, K084, K085, K086, K087, K088 }, \ + {KC_NO, K091, K092, K093, K094, K095, K096, K097, K098 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, K114, K115, K116, K117, K118 } \ +} diff --git a/keyboards/hineybush/hineyg80/info.json b/keyboards/hineybush/hineyg80/info.json new file mode 100644 index 00000000000..07498b9bbdd --- /dev/null +++ b/keyboards/hineybush/hineyg80/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "hineyg80", + "url": "", + "maintainer": "hineybush", + "width": 19.5, + "height": 7.25, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Pause", "x":15.5, "y":0}, {"label":"Insert", "x":16.5, "y":0}, {"label":"Home", "x":17.5, "y":0}, {"label":"PgUp", "x":18.5, "y":0}, {"label":"Scroll Lock", "x":15.5, "y":1}, {"label":"Delete", "x":16.5, "y":1}, {"label":"End", "x":17.5, "y":1}, {"label":"PgDn", "x":18.5, "y":1}, {"label":"~", "x":0, "y":2}, {"label":"!", "x":1, "y":2}, {"label":"@", "x":2, "y":2}, {"label":"#", "x":3, "y":2}, {"label":"$", "x":4, "y":2}, {"label":"%", "x":5, "y":2}, {"label":"^", "x":6, "y":2}, {"label":"&", "x":7, "y":2}, {"label":"*", "x":8, "y":2}, {"label":"(", "x":9, "y":2}, {"label":")", "x":10, "y":2}, {"label":"_", "x":11, "y":2}, {"label":"+", "x":12, "y":2}, {"label":"Bksp", "x":13, "y":2}, {"x":14, "y":2}, {"label":"Num Lock", "x":15.5, "y":2}, {"label":"/", "x":16.5, "y":2}, {"label":"*", "x":17.5, "y":2}, {"label":"-", "x":18.5, "y":2}, {"label":"Tab", "x":0, "y":3, "w":1.5}, {"label":"Q", "x":1.5, "y":3}, {"label":"W", "x":2.5, "y":3}, {"label":"E", "x":3.5, "y":3}, {"label":"R", "x":4.5, "y":3}, {"label":"T", "x":5.5, "y":3}, {"label":"Y", "x":6.5, "y":3}, {"label":"U", "x":7.5, "y":3}, {"label":"I", "x":8.5, "y":3}, {"label":"O", "x":9.5, "y":3}, {"label":"P", "x":10.5, "y":3}, {"label":"{", "x":11.5, "y":3}, {"label":"}", "x":12.5, "y":3}, {"label":"|", "x":13.5, "y":3, "w":1.5}, {"label":"7", "x":15.5, "y":3}, {"label":"8", "x":16.5, "y":3}, {"label":"9", "x":17.5, "y":3}, {"label":"+", "x":18.5, "y":3}, {"label":"Caps Lock", "x":0, "y":4, "w":1.75}, {"label":"A", "x":1.75, "y":4}, {"label":"S", "x":2.75, "y":4}, {"label":"D", "x":3.75, "y":4}, {"label":"F", "x":4.75, "y":4}, {"label":"G", "x":5.75, "y":4}, {"label":"H", "x":6.75, "y":4}, {"label":"J", "x":7.75, "y":4}, {"label":"K", "x":8.75, "y":4}, {"label":"L", "x":9.75, "y":4}, {"label":":", "x":10.75, "y":4}, {"label":"\"", "x":11.75, "y":4}, {"x":12.75, "y":4}, {"label":"Enter", "x":13.75, "y":4, "w":1.25}, {"label":"4", "x":15.5, "y":4}, {"label":"5", "x":16.5, "y":4}, {"label":"6", "x":17.5, "y":4}, {"x":18.5, "y":4}, {"label":"Shift", "x":0, "y":5, "w":1.25}, {"x":1.25, "y":5}, {"label":"Z", "x":2.25, "y":5}, {"label":"X", "x":3.25, "y":5}, {"label":"C", "x":4.25, "y":5}, {"label":"V", "x":5.25, "y":5}, {"label":"B", "x":6.25, "y":5}, {"label":"N", "x":7.25, "y":5}, {"label":"M", "x":8.25, "y":5}, {"label":"<", "x":9.25, "y":5}, {"label":">", "x":10.25, "y":5}, {"label":"?", "x":11.25, "y":5}, {"label":"Shift", "x":12.25, "y":5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":5.25}, {"label":"1", "x":15.5, "y":5}, {"label":"2", "x":16.5, "y":5}, {"label":"3", "x":17.5, "y":5}, {"label":"Enter", "x":18.5, "y":5, "h":2}, {"label":"Ctrl", "x":0, "y":6}, {"label":"Win", "x":1, "y":6}, {"label":"Alt", "x":2, "y":6}, {"x":3, "y":6, "w":6}, {"label":"Alt", "x":9, "y":6}, {"label":"Win", "x":10, "y":6}, {"label":"Menu", "x":11, "y":6}, {"label":"Ctrl", "x":12, "y":6}, {"label":"\u2190", "x":13.25, "y":6.25}, {"label":"\u2193", "x":14.25, "y":6.25}, {"label":"\u2192", "x":15.25, "y":6.25}, {"label":"0", "x":16.5, "y":6}, {"label":".", "x":17.5, "y":6}] + }, + "LAYOUT_ansi_100u_mods": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Insert", "x":15.5, "y":0}, {"label":"Home", "x":16.5, "y":0}, {"label":"PgUp", "x":17.5, "y":0}, {"label":"Prt Sc", "x":18.5, "y":0}, {"label":"Delete", "x":15.5, "y":1}, {"label":"End", "x":16.5, "y":1}, {"label":"PgDn", "x":17.5, "y":1}, {"label":"Scroll", "x":18.5, "y":1}, {"label":"~", "x":0, "y":2}, {"label":"!", "x":1, "y":2}, {"label":"@", "x":2, "y":2}, {"label":"#", "x":3, "y":2}, {"label":"$", "x":4, "y":2}, {"label":"%", "x":5, "y":2}, {"label":"^", "x":6, "y":2}, {"label":"&", "x":7, "y":2}, {"label":"*", "x":8, "y":2}, {"label":"(", "x":9, "y":2}, {"label":")", "x":10, "y":2}, {"label":"_", "x":11, "y":2}, {"label":"+", "x":12, "y":2}, {"label":"Backspace", "x":13, "y":2, "w":2}, {"label":"Num Lock", "x":15.5, "y":2}, {"label":"/", "x":16.5, "y":2}, {"label":"*", "x":17.5, "y":2}, {"label":"Pause", "x":18.5, "y":2}, {"label":"Tab", "x":0, "y":3, "w":1.5}, {"label":"Q", "x":1.5, "y":3}, {"label":"W", "x":2.5, "y":3}, {"label":"E", "x":3.5, "y":3}, {"label":"R", "x":4.5, "y":3}, {"label":"T", "x":5.5, "y":3}, {"label":"Y", "x":6.5, "y":3}, {"label":"U", "x":7.5, "y":3}, {"label":"I", "x":8.5, "y":3}, {"label":"O", "x":9.5, "y":3}, {"label":"P", "x":10.5, "y":3}, {"label":"{", "x":11.5, "y":3}, {"label":"}", "x":12.5, "y":3}, {"label":"|", "x":13.5, "y":3, "w":1.5}, {"label":"7", "x":15.5, "y":3}, {"label":"8", "x":16.5, "y":3}, {"label":"9", "x":17.5, "y":3}, {"label":"-", "x":18.5, "y":3}, {"label":"Caps Lock", "x":0, "y":4, "w":1.75}, {"label":"A", "x":1.75, "y":4}, {"label":"S", "x":2.75, "y":4}, {"label":"D", "x":3.75, "y":4}, {"label":"F", "x":4.75, "y":4}, {"label":"G", "x":5.75, "y":4}, {"label":"H", "x":6.75, "y":4}, {"label":"J", "x":7.75, "y":4}, {"label":"K", "x":8.75, "y":4}, {"label":"L", "x":9.75, "y":4}, {"label":":", "x":10.75, "y":4}, {"label":"\"", "x":11.75, "y":4}, {"label":"Enter", "x":12.75, "y":4, "w":2.25}, {"label":"4", "x":15.5, "y":4}, {"label":"5", "x":16.5, "y":4}, {"label":"6", "x":17.5, "y":4}, {"label":"+", "x":18.5, "y":4}, {"label":"Shift", "x":0, "y":5, "w":2.25}, {"label":"Z", "x":2.25, "y":5}, {"label":"X", "x":3.25, "y":5}, {"label":"C", "x":4.25, "y":5}, {"label":"V", "x":5.25, "y":5}, {"label":"B", "x":6.25, "y":5}, {"label":"N", "x":7.25, "y":5}, {"label":"M", "x":8.25, "y":5}, {"label":"<", "x":9.25, "y":5}, {"label":">", "x":10.25, "y":5}, {"label":"?", "x":11.25, "y":5}, {"label":"Shift", "x":12.25, "y":5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":5.25}, {"label":"1", "x":15.5, "y":5}, {"label":"2", "x":16.5, "y":5}, {"label":"3", "x":17.5, "y":5}, {"label":"Enter", "x":18.5, "y":5, "h":2}, {"label":"Ctrl", "x":0, "y":6}, {"label":"Win", "x":1, "y":6}, {"label":"Alt", "x":2, "y":6}, {"x":3, "y":6, "w":6}, {"label":"Alt", "x":9, "y":6}, {"label":"Win", "x":10, "y":6}, {"label":"Menu", "x":11, "y":6}, {"label":"Ctrl", "x":12, "y":6}, {"label":"\u2190", "x":13.25, "y":6.25}, {"label":"\u2193", "x":14.25, "y":6.25}, {"label":"\u2192", "x":15.25, "y":6.25}, {"label":"0", "x":16.5, "y":6}, {"label":".", "x":17.5, "y":6}] + }, + "LAYOUT_ansi_150u_mods": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.25, "y":0}, {"label":"F2", "x":2.25, "y":0}, {"label":"F3", "x":3.25, "y":0}, {"label":"F4", "x":4.25, "y":0}, {"label":"F5", "x":5.5, "y":0}, {"label":"F6", "x":6.5, "y":0}, {"label":"F7", "x":7.5, "y":0}, {"label":"F8", "x":8.5, "y":0}, {"label":"F9", "x":9.75, "y":0}, {"label":"F10", "x":10.75, "y":0}, {"label":"F11", "x":11.75, "y":0}, {"label":"F12", "x":12.75, "y":0}, {"label":"Insert", "x":15.5, "y":0}, {"label":"Home", "x":16.5, "y":0}, {"label":"PgUp", "x":17.5, "y":0}, {"label":"Prt Sc", "x":18.5, "y":0}, {"label":"Delete", "x":15.5, "y":1}, {"label":"End", "x":16.5, "y":1}, {"label":"PgDn", "x":17.5, "y":1}, {"label":"Scroll", "x":18.5, "y":1}, {"label":"~", "x":0, "y":2}, {"label":"!", "x":1, "y":2}, {"label":"@", "x":2, "y":2}, {"label":"#", "x":3, "y":2}, {"label":"$", "x":4, "y":2}, {"label":"%", "x":5, "y":2}, {"label":"^", "x":6, "y":2}, {"label":"&", "x":7, "y":2}, {"label":"*", "x":8, "y":2}, {"label":"(", "x":9, "y":2}, {"label":")", "x":10, "y":2}, {"label":"_", "x":11, "y":2}, {"label":"+", "x":12, "y":2}, {"label":"Backspace", "x":13, "y":2, "w":2}, {"label":"Num Lock", "x":15.5, "y":2}, {"label":"/", "x":16.5, "y":2}, {"label":"*", "x":17.5, "y":2}, {"label":"Pause", "x":18.5, "y":2}, {"label":"Tab", "x":0, "y":3, "w":1.5}, {"label":"Q", "x":1.5, "y":3}, {"label":"W", "x":2.5, "y":3}, {"label":"E", "x":3.5, "y":3}, {"label":"R", "x":4.5, "y":3}, {"label":"T", "x":5.5, "y":3}, {"label":"Y", "x":6.5, "y":3}, {"label":"U", "x":7.5, "y":3}, {"label":"I", "x":8.5, "y":3}, {"label":"O", "x":9.5, "y":3}, {"label":"P", "x":10.5, "y":3}, {"label":"{", "x":11.5, "y":3}, {"label":"}", "x":12.5, "y":3}, {"label":"|", "x":13.5, "y":3, "w":1.5}, {"label":"7", "x":15.5, "y":3}, {"label":"8", "x":16.5, "y":3}, {"label":"9", "x":17.5, "y":3}, {"label":"-", "x":18.5, "y":3}, {"label":"Caps Lock", "x":0, "y":4, "w":1.75}, {"label":"A", "x":1.75, "y":4}, {"label":"S", "x":2.75, "y":4}, {"label":"D", "x":3.75, "y":4}, {"label":"F", "x":4.75, "y":4}, {"label":"G", "x":5.75, "y":4}, {"label":"H", "x":6.75, "y":4}, {"label":"J", "x":7.75, "y":4}, {"label":"K", "x":8.75, "y":4}, {"label":"L", "x":9.75, "y":4}, {"label":":", "x":10.75, "y":4}, {"label":"\"", "x":11.75, "y":4}, {"label":"Enter", "x":12.75, "y":4, "w":2.25}, {"label":"4", "x":15.5, "y":4}, {"label":"5", "x":16.5, "y":4}, {"label":"6", "x":17.5, "y":4}, {"label":"+", "x":18.5, "y":4}, {"label":"Shift", "x":0, "y":5, "w":2.25}, {"label":"Z", "x":2.25, "y":5}, {"label":"X", "x":3.25, "y":5}, {"label":"C", "x":4.25, "y":5}, {"label":"V", "x":5.25, "y":5}, {"label":"B", "x":6.25, "y":5}, {"label":"N", "x":7.25, "y":5}, {"label":"M", "x":8.25, "y":5}, {"label":"<", "x":9.25, "y":5}, {"label":">", "x":10.25, "y":5}, {"label":"?", "x":11.25, "y":5}, {"label":"Shift", "x":12.25, "y":5, "w":1.75}, {"label":"\u2191", "x":14.25, "y":5.25}, {"label":"1", "x":15.5, "y":5}, {"label":"2", "x":16.5, "y":5}, {"label":"3", "x":17.5, "y":5}, {"label":"Enter", "x":18.5, "y":5, "h":2}, {"label":"Ctrl", "x":0, "y":6, "w":1.5}, {"label":"Alt", "x":1.5, "y":6, "w":1.5}, {"x":3, "y":6, "w":7}, {"label":"Menu", "x":10, "y":6, "w":1.5}, {"label":"Ctrl", "x":11.5, "y":6, "w":1.5}, {"label":"\u2190", "x":13.25, "y":6.25}, {"label":"\u2193", "x":14.25, "y":6.25}, {"label":"\u2192", "x":15.25, "y":6.25}, {"label":"0", "x":16.5, "y":6}, {"label":".", "x":17.5, "y":6}] + } + } +} + diff --git a/keyboards/hineybush/hineyg80/keymaps/default/config.h b/keyboards/hineybush/hineyg80/keymaps/default/config.h new file mode 100644 index 00000000000..16e640d3060 --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Josh Hinnebusch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/hineybush/hineyg80/keymaps/default/keymap.c b/keyboards/hineybush/hineyg80/keymaps/default/keymap.c new file mode 100644 index 00000000000..13d0c895578 --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/default/keymap.c @@ -0,0 +1,58 @@ +/* Copyright 2019 Josh Hinnebusch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi_100u_mods( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, + KC_DEL, KC_END, KC_PGDN, KC_SLCK, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ), + [1] = LAYOUT_ansi_100u_mods( /* Fn */KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/hineybush/hineyg80/keymaps/default/readme.md b/keyboards/hineybush/hineyg80/keymaps/default/readme.md new file mode 100644 index 00000000000..3e0d8343c7f --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for hineyg80 \ No newline at end of file diff --git a/keyboards/hineybush/hineyg80/keymaps/wkl/config.h b/keyboards/hineybush/hineyg80/keymaps/wkl/config.h new file mode 100644 index 00000000000..16e640d3060 --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/wkl/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Josh Hinnebusch + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/hineybush/hineyg80/keymaps/wkl/keymap.c b/keyboards/hineybush/hineyg80/keymaps/wkl/keymap.c new file mode 100644 index 00000000000..a1255e9cc73 --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/wkl/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2019 %YOUR_NAME% + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL, + ______ = KC_TRNS, + XXXXXX = KC_NO +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi_150u_mods( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, + KC_DEL, KC_END, KC_PGDN, KC_SLCK, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ), + [1] = LAYOUT_ansi_150u_mods( /* Fn */______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, + ______, ______, ______, KC_VOLD, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_DEL, ______, ______, ______, ______, + ______, ______, ______, ______, RESET , ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + KC_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/hineybush/hineyg80/keymaps/wkl/readme.md b/keyboards/hineybush/hineyg80/keymaps/wkl/readme.md new file mode 100644 index 00000000000..3e0d8343c7f --- /dev/null +++ b/keyboards/hineybush/hineyg80/keymaps/wkl/readme.md @@ -0,0 +1 @@ +# The default keymap for hineyg80 \ No newline at end of file diff --git a/keyboards/hineybush/hineyg80/readme.md b/keyboards/hineybush/hineyg80/readme.md new file mode 100644 index 00000000000..b305049d649 --- /dev/null +++ b/keyboards/hineybush/hineyg80/readme.md @@ -0,0 +1,16 @@ +# hineyg80 + + +A small-batch PCB design to be a drop-in replacement for G80-1800 and G81-1800 boards. + +Keyboard Maintainer: [hineybush](https://github.com/hineybush) + +Hardware Supported: hiney g80 rev 2 + +Hardware Availability: https://geekhack.org/index.php?topic=92389.0 + +Make example for this keyboard (after setting up your build environment): + + make hineybush/hineyg80:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/hineybush/hineyg80/rules.mk b/keyboards/hineybush/hineyg80/rules.mk new file mode 100644 index 00000000000..bc370be0397 --- /dev/null +++ b/keyboards/hineybush/hineyg80/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/honeycomb/config.h b/keyboards/honeycomb/config.h new file mode 100755 index 00000000000..abc273c9772 --- /dev/null +++ b/keyboards/honeycomb/config.h @@ -0,0 +1,65 @@ +/* +Copyright 2019 @filoxo + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xACC8 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Keyhive +#define PRODUCT Honeycomb Macropad +#define DESCRIPTION QMK firmware for Honeycomb Macropad + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 16 + +#define ONESHOT_TIMEOUT 500 + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +//UART settings for communication with the RF microcontroller +#define SERIAL_UART_BAUD 1000000 +#define SERIAL_UART_DATA UDR1 +#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) +#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) +#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) +#define SERIAL_UART_INIT() do { \ + /* baud rate */ \ + UBRR1L = SERIAL_UART_UBRR; \ + /* baud rate */ \ + UBRR1H = SERIAL_UART_UBRR >> 8; \ + /* enable TX and RX */ \ + UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ + /* 8-bit data */ \ + UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ +} while(0) diff --git a/keyboards/honeycomb/honeycomb.c b/keyboards/honeycomb/honeycomb.c new file mode 100755 index 00000000000..add4af15365 --- /dev/null +++ b/keyboards/honeycomb/honeycomb.c @@ -0,0 +1,92 @@ +#include "honeycomb.h" +#include "pointing_device.h" +#include "report.h" + +void uart_init(void) { + SERIAL_UART_INIT(); +} + +void pointing_device_task(void){ + /*report_mouse_t currentReport = {}; + SERIAL_UART_INIT(); + uint32_t timeout = 0; + + //the m character requests the RF slave to send the mouse report + SERIAL_UART_DATA = 'm'; + + //trust the external inputs completely, erase old data + uint8_t uart_data[5] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 5; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while(!SERIAL_UART_RXD_PRESENT){ + timeout++; + if (timeout > 10000){ + xprintf("\r\nTIMED OUT"); + break; + } + } + xprintf("\r\nGOT DATA for %d",i); + uart_data[i] = SERIAL_UART_DATA; + } + + //check for the end packet, bytes 1-4 are movement and scroll + //but byte 5 has bits 0-3 for the scroll button state + //(1000 if pressed, 0000 if not) and bits 4-7 are always 1 + //We can use this to verify the report sent properly. + if (uart_data[4] == 0x0F || uart_data[4] == 0x8F) + { + xprintf("\r\nREQUESTED MOUSE, RECEIVED %i, %i, %i, %i, %i",uart_data[0],uart_data[1],uart_data[2],uart_data[3],uart_data[4]); + currentReport = pointing_device_get_report(); + //shifting and transferring the info to the mouse report varaible + //mouseReport.x = 127 max -127 min + currentReport.x = (int8_t) uart_data[0]; + //mouseReport.y = 127 max -127 min + currentReport.y = (int8_t) uart_data[1]; + //mouseReport.v = 127 max -127 min (scroll vertical) + currentReport.v = (int8_t) uart_data[2]; + //mouseReport.h = 127 max -127 min (scroll horizontal) + currentReport.h = (int8_t) uart_data[3]; + //mouseReport.buttons = 0x31 max (bitmask for mouse buttons 1-5) 0x00 min + //mouse buttons 1 and 2 are handled by the keymap, but not 3 + if (uart_data[4] == 0x0F) { //then 3 is not pressed + currentReport.buttons &= ~MOUSE_BTN3; //MOUSE_BTN3 is def in report.h + } else { //3 must be pressed + currentReport.buttons |= MOUSE_BTN3; + } + pointing_device_set_report(currentReport); + } else { + xprintf("\r\nRequested packet, data 4 was %d",uart_data[4]); + }*/ + pointing_device_send(); +} + +void led_init(void) { + setPinOutput(D1); + writePinHigh(D1); + setPinOutput(F4); + writePinHigh(F4); + setPinOutput(F5); + writePinHigh(F5); +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + uart_init(); + led_init(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +} + +void led_set_kb(uint8_t usb_led) { + +} diff --git a/keyboards/honeycomb/honeycomb.h b/keyboards/honeycomb/honeycomb.h new file mode 100755 index 00000000000..9374a02c5c6 --- /dev/null +++ b/keyboards/honeycomb/honeycomb.h @@ -0,0 +1,37 @@ +#pragma once + +#define HONEYCOMB_H + +#include "quantum.h" +#include "matrix.h" +#include "backlight.h" +#include + +#define RED_LED_OFF() writePinHigh(F6) +#define RED_LED_ON() writePinLow(F6) +#define BLU_LED_OFF() writePinHigh(F5) +#define BLU_LED_ON() writePinLow(F5) +#define GRN_LED_OFF() writePinHigh(D1) +#define GRN_LED_ON() writePinLow(D1) + +#define SET_LED_OFF (RED_LED_OFF(); GRN_LED_OFF(); BLU_LED_OFF(); ) +#define SET_LED_RED (RED_LED_ON(); GRN_LED_OFF(); BLU_LED_OFF(); ) +#define SET_LED_BLUE (RED_LED_OFF(); GRN_LED_OFF(); BLU_LED_ON(); ) +#define SET_LED_GREEN (RED_LED_OFF(); GRN_LED_ON(); BLU_LED_OFF(); ) +#define SET_LED_YELLOW (RED_LED_ON(); GRN_LED_ON(); BLU_LED_OFF(); ) +#define SET_LED_MAGENTA (RED_LED_ON(); GRN_LED_OFF(); BLU_LED_ON(); ) +#define SET_LED_CYAN (RED_LED_OFF(); GRN_LED_ON(); BLU_LED_ON(); ) +#define SET_LED_WHITE (RED_LED_ON(); GRN_LED_ON(); BLU_LED_ON(); ) + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k13, k14, k15, k16, \ + k09, k10, k11, k12, \ + k05, k06, k07, k08, \ + k01, k02, k03, k04 \ +) \ +{ \ + { k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16 } \ +} diff --git a/keyboards/honeycomb/keymaps/default/keymap.c b/keyboards/honeycomb/keymaps/default/keymap.c new file mode 100755 index 00000000000..d0a5961873a --- /dev/null +++ b/keyboards/honeycomb/keymaps/default/keymap.c @@ -0,0 +1,91 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum honeycomb_layers { + _BS, + _EN +}; + +// Macro definitions for readability +enum honeycomb_keycodes { + HW = SAFE_RANGE, + COPY, + PASTA +}; + +extern int8_t encoderValue; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BS] = LAYOUT( /* Base layout, put whatever defaults. */ + HW, COPY, PASTA, KC_MUTE, + KC_4, KC_5, KC_6, KC_7, + KC_8, KC_9, KC_A, KC_B, + KC_C, KC_D, KC_E, KC_F + ), + + [_EN] = LAYOUT( /* Alternate layer */ + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ) +}; + +report_mouse_t currentReport = {}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //uint8_t layer = biton32(layer_state); // get the current layer + + // Basic example functions + switch (keycode) { + case HW: + if (record->event.pressed) { + SEND_STRING("Hello, world!"); + } else { + SEND_STRING("Goodbye, cruel world!"); + } + break; + case COPY: + if (record->event.pressed) { + tap_code16(LCTL(KC_C)); // Replace with tap_code16(LCMD(KC_C)) to enable for Mac + } + break; + case PASTA: + if (record->event.pressed) { + tap_code16(LCTL(KC_V)); // Replace with tap_code16(LCMD(KC_V)) to enable for Mac + } + break; + return false; + } + return true; +}; + +void matrix_scan_user(void) { + /* Leaving some LED stuff in here in comment form so you can see how to use it. + if (shiftLED || capsLED){ + red_led_on; + } else { + red_led_off; + } + if (numLED){ + grn_led_on; + } else { + grn_led_off; + } + if (mouseLED){ + blu_led_on; + } else { + blu_led_off; + }*/ + while (encoderValue < 0){ + tap_code(KC_VOLD); + encoderValue++; + } + while (encoderValue > 0){ + tap_code(KC_VOLU); + encoderValue--; + } +}; diff --git a/keyboards/honeycomb/matrix.c b/keyboards/honeycomb/matrix.c new file mode 100755 index 00000000000..a06afb6d968 --- /dev/null +++ b/keyboards/honeycomb/matrix.c @@ -0,0 +1,202 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 Jack Humbert +Copyright 2019 @filoxo + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#if defined(__AVR__) +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" +#include "honeycomb.h" +#include "pointing_device.h" +#include "report.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +//extern int8_t encoderValue; +int8_t encoderValue = 0; + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +void matrix_init(void) { + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) +{ + SERIAL_UART_INIT(); + + uint32_t timeout = 0; + + // The 's' character requests the RF slave to send the matrix + SERIAL_UART_DATA = 's'; + + // Trust the external keystates entirely, erase the last data + uint8_t uart_data[4] = {0}; + + // There are 3 bytes corresponding to the data, and a checksum + for (uint8_t i = 0; i < 4; i++) { + // Wait for the serial data, timeout if it's been too long + // This only happened in testing with a loose wire, but does no + // harm to leave it in here + while(!SERIAL_UART_RXD_PRESENT){ + timeout++; + if (timeout > 10000){ + xprintf("\r\nTime out in keyboard."); + break; + } + } + uart_data[i] = SERIAL_UART_DATA; + } + + // Check for the end packet, it's our checksum. + // Will only be a match if the correct bytes were recieved + if (uart_data[3] == (uart_data[0] ^ uart_data[1] ^ uart_data[2])) { // This is an arbitrary checksum calculated by XORing all the data. + // Transferring the keystates to the QMK matrix variable + /* ASSUMING MSB FIRST */ + matrix[0] = ((uint16_t) uart_data[0] << 8) | ((uint16_t) uart_data[1]); + encoderValue += (int8_t) uart_data[2]; + if ((uart_data[0] | uart_data[1] | uart_data[2])!=0){ + xprintf("\r\n0x%0X%02X%02X",uart_data[0],uart_data[1], uart_data[2]); + } + /* OK, TURNS OUT THAT WAS A BAD ASSUMPTION */ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + // I've unpacked these into the mirror image of what QMK expects them to be, so... + matrix[i] = bitrev16(matrix[i]); + // So I'll reverse it, and this should be fine now. + } + + // A mouse report for scrolling would go here, but I don't plan on doing scrolling with the encoder. So. + + report_mouse_t currentReport = {}; +/* + currentReport = pointing_device_get_report(); + //mouseReport.x = 127 max -127 min + currentReport.x = (int8_t) uart_data[6]; + //mouseReport.y = 127 max -127 min + currentReport.y = (int8_t) uart_data[7]; + //mouseReport.v = 127 max -127 min (scroll vertical) + currentReport.v = (int8_t) uart_data[8]; + //mouseReport.h = 127 max -127 min (scroll horizontal) + currentReport.h = (int8_t) uart_data[9]; + */ + /* + currentReport.x = 0; + currentReport.y = 0; + currentReport.v = 0; + currentReport.h = 0;*/ + + pointing_device_set_report(currentReport); + } else { + xprintf("\r\nRequested packet, data 3 was %d",uart_data[3]); + } + + matrix_scan_quantum(); + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1 +#include + +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +void init_ergodox(void); + +inline void ergodox_board_led_on(void) { DDRB |= (1<event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } +}; diff --git a/keyboards/hotdox/keymaps/eozaki/keymap.c b/keyboards/hotdox/keymaps/eozaki/keymap.c new file mode 100644 index 00000000000..dc80e7a34e0 --- /dev/null +++ b/keyboards/hotdox/keymaps/eozaki/keymap.c @@ -0,0 +1,192 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + VRSN, + RGB_SLD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | ~ | | ' | 6 | 7 | 8 | 9 | 0 | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | ~ | | " | Y | U | I | O | P | - | + * |--------+------+------+------+------+------| ` | | |------+------+------+------+------+--------| + * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L | ; | \ | + * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| + * | LAlt | Z | X | C | V | B | [ | | ] | N | M | , | . | / | LShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LT-1 | F4 | F5 | F6 | F11 | | Left | Down | Up | Right| RAlt | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | L1 | Prev | | Vol+ | L2 | + * ,------|------|------| |------+--------+------. + * | | | Play | | Vol- | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | Next | | Mute | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_GRV), + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_GRV, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, + LT(SYMB, KC_F2), KC_F4, KC_F5, KC_F6, KC_F11, + TG(SYMB), KC_MPRV, + KC_MPLY, + KC_SPC,KC_BSPC,KC_MNXT, + // right hand + KC_QUOT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + LSFT(KC_QUOT), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_BSLS, + KC_RBRC, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_LSFT, + KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_RALT, + KC_VOLU, TG(MDIA), + KC_VOLD, + KC_MUTE,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | EEP_RST | | | | | | | . | 0 | = | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |Animat| | |Toggle|Solid | + * ,------|------|------| |------+------+------. + * |Bright|Bright| | | |Hue- |Hue+ | + * |ness- |ness+ |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox( + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + EEP_RST,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + RGB_MOD,KC_TRNS, + KC_TRNS, + RGB_VAD,RGB_VAI,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + RGB_TOG, RGB_SLD, + KC_TRNS, + KC_TRNS, RGB_HUD, RGB_HUI +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/hotdox/keymaps/kloki/keymap.c b/keyboards/hotdox/keymaps/kloki/keymap.c new file mode 100644 index 00000000000..f858effd540 --- /dev/null +++ b/keyboards/hotdox/keymaps/kloki/keymap.c @@ -0,0 +1,210 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +#define BASE 0 // default layer +#define QW 1 // qwerty +#define SYMB 2 // symbols +#define NUM 3 // media keys + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + VRSN, + RGB_SLD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | SHIFT| | SYM | 6 | 7 | 8 | 9 | 0 | Bck | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | D | R | W | B | `~ | | "' | J | F | U | P | : | \ | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Ctr/Es | A | S | H | T | G |------| |------| Y | N | E | O | I | Enter | + * |--------+------+------+------+------+------| = + | | -_ |------+------+------+------+------+--------| + * | LShift | Z | X | M | C | V | | | | K | L | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |MEH | Gui |AltShf| Left | Right| | DOWN | UP | [ | ] | ~SYM | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | ESC |Home | | PgUp | QW | + * ,------|------|------| |------+--------+------. + * | | ENT | End | | PgDn | | | + * | Space| WIN |------| |------| Tab |Back | + * | SYM | | SCTR | | SALT | SYM | | + * `--------------------' `----------------------' + */ + +[BASE] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LSFT, + KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_GRV, + CTL_T(KC_ESC), KC_A, KC_S, KC_H, KC_T, KC_G, + KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_EQL, + KC_MEH, KC_LGUI, KC_LALT, KC_LEFT,KC_RGHT, + KC_ESC, KC_HOME, + KC_END, + LT(SYMB, KC_SPC), LGUI_T(KC_ENT), S(KC_LGUI), + // right hand + TG(NUM), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_QUOT, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, + KC_Y, KC_N, KC_E, KC_O, KC_I , KC_ENT, + KC_MINS, KC_K, KC_L, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_DOWN,KC_UP, KC_LBRC,KC_RBRC, MO(SYMB), + KC_PGUP, TG(QW), + KC_PGDN, + S(KC_LALT),LT(SYMB, KC_TAB), KC_BSPC + ), + +[QW] = LAYOUT_ergodox( + _______, _______, _______, _______, _______, _______, _______, + _______, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, + _______, KC_A, KC_S, KC_D, KC_F, KC_G, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + // right hand + _______, _______, _______, _______, _______, _______, _______, + _______, KC_Y, KC_U, KC_I , KC_O, KC_P, _______, + KC_H, KC_J, KC_K , KC_L, KC_SCLN, _______, + _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), +/* Keymap 1: Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | DEL | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | * | | | | < | H | U | PU | * | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| > | L | D | R | + | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | E | D | PD | \ | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox( + // left hand + _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, + _______,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_ASTR,_______, + _______,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + _______,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,_______, + _______,_______,_______,_______,_______, + _______,_______, + _______, + _______,_______,_______, + // right hand + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + _______, KC_LABK, KC_HOME, KC_UP, KC_PGUP, KC_ASTR, _______, + KC_RABK, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PLUS, _______, + _______, KC_AMPR, KC_END, KC_DOWN, KC_PGDN, KC_BSLS, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | L | MsUp | R | | | | | | 4 | 5 | 6 | | TAB | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | 1 | 2 | 3 | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | 0 | 0 | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[NUM] = LAYOUT_ergodox( + _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + // right hand + _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_4, KC_5 , KC_6, _______, KC_TAB, + _______, KC_1, KC_2 , KC_3, _______, _______, + _______, _______, _______, KC_0, KC_0, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 1: + ergodox_board_led_on(); + break; + case 3: + ergodox_board_led_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/hotdox/left.c b/keyboards/hotdox/left.c new file mode 100644 index 00000000000..970d36f1b56 --- /dev/null +++ b/keyboards/hotdox/left.c @@ -0,0 +1,130 @@ +#include "action.h" +#include "left.h" +#include "wait.h" + +bool i2c_initialized = false; + +void left_config(void); +uint8_t left_write(uint8_t reg, uint8_t data); +uint8_t left_read(uint8_t reg, uint8_t *data); + +uint8_t init_mcp23017(void) +{ + i2c_initialized = false; + + if (i2c_initialized == 0) + { + i2c_init(); // on pins D(1,0) + _delay_ms(1000); + } + + return 0; +} +void left_init(void) +{ + init_mcp23017(); + left_scan(); +#if 0 + while (1) + { + print("wait\n"); + wait_us(1000000); + } +#endif +} + +void left_scan(void) +{ + uint8_t ret = i2c_start(I2C_ADDR_WRITE, HOTDOX_I2C_TIMEOUT); + + if (ret == 0) + { + i2c_stop(); + + if (!i2c_initialized) + { + i2c_initialized = true; + left_config(); + clear_keyboard(); + print("mcp23017 attached!!!\n"); + } + } + else + { + if (i2c_initialized) + { + i2c_initialized = false; + clear_keyboard(); + print("mcp23017 deattached!!!\n"); + } + } + + return; +} + +uint8_t left_read_cols(void) +{ + uint8_t data = 0; + + left_read(MCP23017_B0_GPIOA, &data); + + return data; +} + +void left_unselect_rows(void) +{ + left_write(MCP23017_B0_IODIRB, 0x3F); +} + +void left_select_row(uint8_t row) +{ + left_write(MCP23017_B0_IODIRB, ~(1 << row)); +} + +void left_config(void) +{ + left_write(MCP23017_B0_IODIRA, 0x7F); + left_write(MCP23017_B0_IPOLA, 0x7F); + left_write(MCP23017_B0_GPPUA, 0x7F); + + left_write(MCP23017_B0_IODIRB, 0xFF); + left_write(MCP23017_B0_GPIOB, 0xC0); +} + +uint8_t left_write(uint8_t reg, uint8_t data) +{ + if (!i2c_initialized) + { + return 0; + } + + uint8_t ret; + + ret = i2c_start(I2C_ADDR_WRITE, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + ret = i2c_write(reg, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + ret = i2c_write(data, HOTDOX_I2C_TIMEOUT); + +out: + i2c_stop(); + return ret; +} + +uint8_t left_read(uint8_t reg, uint8_t *data) +{ + if (!i2c_initialized) + { + return 0; + } + + uint8_t ret = 0; + + ret = i2c_start(I2C_ADDR_WRITE, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + ret = i2c_write(reg, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + ret = i2c_start(I2C_ADDR_READ, HOTDOX_I2C_TIMEOUT); if (ret) goto out; + + *data = i2c_read_nack(HOTDOX_I2C_TIMEOUT); + +out: + i2c_stop(); + return ret; +} diff --git a/keyboards/hotdox/left.h b/keyboards/hotdox/left.h new file mode 100644 index 00000000000..3d8b5a6ead8 --- /dev/null +++ b/keyboards/hotdox/left.h @@ -0,0 +1,57 @@ +#pragma once + +#include "quantum.h" +#include +#include "i2c_master.h" +#include + +#define MCP23017 +#define MCP23017_A0 0 +#define MCP23017_A1 0 +#define MCP23017_A2 0 + +#define I2C_ADDR (0x20) +#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE) +#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ) + + +#define MCP23017_B0_IODIRA 0x00 +#define MCP23017_B0_IODIRB 0x01 +#define MCP23017_B0_IPOLA 0x02 +#define MCP23017_B0_IPOLB 0x03 +#define MCP23017_B0_GPINTENA 0x04 +#define MCP23017_B0_GPINTENB 0x05 +#define MCP23017_B0_DEFVALA 0x06 +#define MCP23017_B0_DEFVALB 0x07 +#define MCP23017_B0_INTCONA 0x08 +#define MCP23017_B0_INTCONB 0x09 +#define MCP23017_B0_IOCONA 0x0A +#define MCP23017_B0_IOCONB 0x0B +#define MCP23017_B0_GPPUA 0x0C +#define MCP23017_B0_GPPUB 0x0D +#define MCP23017_B0_INTFA 0x0E +#define MCP23017_B0_INTFB 0x0F +#define MCP23017_B0_INTCAPA 0x10 +#define MCP23017_B0_INTCAPB 0x11 +#define MCP23017_B0_GPIOA 0x12 +#define MCP23017_B0_GPIOB 0x13 +#define MCP23017_B0_OLATA 0x14 +#define MCP23017_B0_OLATB 0x15 + +#define HOTDOX_I2C_TIMEOUT 100 + +typedef int16_t i2c_status_t; + +void left_init(void); +void left_scan(void); + +uint8_t left_read_cols(void); +uint8_t left_get_col(uint8_t col); + +matrix_row_t left_read_row(void); + +void left_unselect_rows(void); +void left_select_row(uint8_t row); + +uint8_t init_mcp23017(void); + diff --git a/keyboards/hotdox/matrix.c b/keyboards/hotdox/matrix.c new file mode 100644 index 00000000000..9d3a98db21a --- /dev/null +++ b/keyboards/hotdox/matrix.c @@ -0,0 +1,283 @@ +#include +#include +#include +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "hotdox.h" +#include "left.h" +#ifdef DEBUG_MATRIX_SCAN_RATE +#include "timer.h" +#endif + +/* + * This constant define not debouncing time in msecs, but amount of matrix + * scan loops which should be made to get stable debounced results. + * + * On Ergodox matrix scan rate is relatively low, because of slow I2C. + * Now it's only 317 scans/second, or about 3.15 msec/scan. + * According to Cherry specs, debouncing time is 5 msec. + * + * And so, there is no sense to have DEBOUNCE higher than 2. + */ + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; + +// Debouncing: store for each key the number of scans until it's eligible to +// change. When scanning the matrix, ignore any changes in keys that have +// already changed in the last DEBOUNCE scans. +static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // disable JTAG + MCUCR = (1<1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + matrix_print(); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t mask = debounce_mask(i); + matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask); + debounce_report(cols ^ matrix[i], i); + matrix[i] = cols; + + unselect_rows(); + } + + matrix_scan_quantum(); + + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<. #define QMK_ESC_OUTPUT B5 // usually COL #define QMK_ESC_INPUT B2 // usually ROW -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -102,11 +102,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -125,7 +120,6 @@ along with this program. If not, see . #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended -#define RGB_MATRIX_SKIP_FRAMES 0 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 215 #define DRIVER_ADDR_1 0b1110100 @@ -140,4 +134,4 @@ along with this program. If not, see . #define DRIVER_2_LED_TOTAL 32 #endif -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) diff --git a/keyboards/hs60/v1/keymaps/ansi/config.h b/keyboards/hs60/v1/keymaps/ansi/config.h index f51cc16d853..82cdc2689c6 100644 --- a/keyboards/hs60/v1/keymaps/ansi/config.h +++ b/keyboards/hs60/v1/keymaps/ansi/config.h @@ -18,4 +18,6 @@ along with this program. If not, see . /* Include overwrites for specific keymap */ -#define HS60_ANSI +#ifdef KEYBOARD_hs60 + #define HS60_ANSI +#endif diff --git a/keyboards/hs60/v1/readme.md b/keyboards/hs60/v1/readme.md index a77bbc25ca1..cbf5f4faaba 100644 --- a/keyboards/hs60/v1/readme.md +++ b/keyboards/hs60/v1/readme.md @@ -9,10 +9,14 @@ Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](http Hardware Supported: HS60 ISO and ANSI PCBs with Atmega 32u4 Hardware Availability: https://mechboards.co.uk/shop/all/hs60-pcb/ -Due to the RGB implementation, the HS60 is currently not compatible with community layouts. +If you're using the [community layouts feature](https://docs.qmk.fm/#/feature_layouts) and using the 60_ansi layout, you need to make sure that you include this on your config.h to ensure that the RGB Matrix is properly configured: + + #ifdef KEYBOARD_hs60 + #define HS60_ANSI + #endif Make example for this keyboard (after setting up your build environment): make hs60/v1:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/hs60/v1/rules.mk b/keyboards/hs60/v1/rules.mk index bff9659489b..f5bcb2b0a17 100644 --- a/keyboards/hs60/v1/rules.mk +++ b/keyboards/hs60/v1/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # project specific files @@ -68,6 +67,9 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches RGB_MATRIX_ENABLE = yes # Use RGB matrix +RAW_ENABLE = yes + +LAYOUTS = 60_ansi 60_iso # Experimental features for zealcmd please do no enable #RAW_ENABLE = yes diff --git a/keyboards/hs60/v1/v1.c b/keyboards/hs60/v1/v1.c index 882611030b6..70c1c2128eb 100644 --- a/keyboards/hs60/v1/v1.c +++ b/keyboards/hs60/v1/v1.c @@ -165,83 +165,37 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, -// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, A15, -// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, ---, A14, -// D3, ---, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, -// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | modifier - * | | | */ - {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 0}, - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{0|(7<<4)}, {119, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, - {{2|(13<<4)}, {224, 32}, 1}, - {{2|(12<<4)}, {224, 16}, 0}, - {{2|(11<<4)}, {197, 32}, 0}, - - {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(11<<4)}, {187, 48}, 0}, - {{3|(13<<4)}, {214, 48}, 1}, - {{4|(13<<4)}, {224, 64}, 1}, - {{4|(12<<4)}, {204, 64}, 1}, - {{4|(11<<4)}, {187, 64}, 1}, - {{4|(10<<4)}, {170, 64}, 1}, - - {{0|(6<<4)}, {102, 0}, 0}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 0}, - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(1<<4)}, { 17, 0}, 0}, - {{0|(0<<4)}, { 0, 0}, 1}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(6<<4)}, {102, 32}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, - - {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 - //D2 - {{3|(0<<4)}, { 10, 48}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(3<<4)}, {102, 64}, 0}, - {{4|(2<<4)}, { 34, 68}, 1}, - {{4|(1<<4)}, { 17, 68}, 1}, - {{4|(0<<4)}, { 0, 68}, 1} -}; +led_config_t g_led_config = { { + { 36, 35, 34, 33, 32, 31, 30, 6, 5, 4, 3, 2, 1, 0 }, + { 37, 38, 39, 40, 41, 42, 43, 7, 8, 9, 10, 11, 12, NO_LED }, + { 48, 49, 50, 51, 52, 45, 44, 20, 21, 22, 23, 15, 14, 13 }, + { 47, NO_LED, 46, 53, 54, 55, 56, 19, 18, 17, 16, 24, NO_LED, 25 }, + { 60, 59, 58, 57, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 29, 28, 27, 26 } +}, { + //A1-A16 + { 224, 0 }, { 204, 0 }, { 187, 0 }, { 170, 0 }, { 153, 0 }, { 136, 0 }, { 119, 0 }, { 119, 16 }, { 136, 16 }, { 153, 16 }, { 170, 16 }, { 187, 16 }, { 204, 16 }, { 224, 32 }, + { 224, 16 }, { 197, 32 }, + //B1-B14 + { 170, 48 }, { 153, 48 }, { 136, 48 }, { 119, 48 }, { 119, 32 }, { 136, 32 }, { 153, 32 }, { 170, 32 }, { 187, 48 }, { 214, 48 }, { 224, 64 }, { 204, 64 }, { 187, 64 }, { 170, 64 }, + //C1-C16 + { 102, 0 }, { 85, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 }, { 0, 16 }, { 17, 16 }, { 34, 16 }, { 51, 16 }, { 68, 16 }, { 85, 16 }, { 102, 16 }, + { 102, 32 }, { 85, 32 }, + //D1-D16 + { 32, 48 }, { 10, 48 }, { 0, 32 }, { 17, 32 }, { 34, 32 }, { 51, 32 }, { 68, 32 }, { 51, 48 }, { 68, 48 }, { 85, 48 }, { 102, 48 }, { 102, 64 }, { 34, 68 }, { 17, 68 }, + { 0, 68 } +}, { + //A1-A16 + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 4, 4, + //B1-B14 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, + //C1-C16 + 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, + 4, 4, + //D1-D16 + 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1 +} }; #else @@ -319,83 +273,37 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, -// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, ---, -// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, A15, A14, -// D3, D2, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, -// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | modifier - * | | | */ - {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 0}, - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{0|(7<<4)}, {119, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, - {{2|(13<<4)}, {224, 8}, 1}, - {{2|(12<<4)}, {204, 32}, 0}, - {{2|(11<<4)}, {187, 32}, 0}, - - {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(11<<4)}, {187, 48}, 0}, - {{3|(13<<4)}, {214, 48}, 1}, - {{4|(13<<4)}, {224, 64}, 1}, - {{4|(12<<4)}, {204, 64}, 1}, - {{4|(11<<4)}, {187, 64}, 1}, - {{4|(10<<4)}, {170, 64}, 1}, - - {{0|(6<<4)}, {102, 0}, 0}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 0}, - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(1<<4)}, { 17, 0}, 0}, - {{0|(0<<4)}, { 0, 0}, 1}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(6<<4)}, {102, 32}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, - - {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 - {{3|(1<<4)}, { 17, 48}, 0}, - {{3|(0<<4)}, { 0, 48}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(3<<4)}, {102, 64}, 0}, - {{4|(2<<4)}, { 34, 68}, 1}, - {{4|(1<<4)}, { 17, 68}, 1}, - {{4|(0<<4)}, { 0, 68}, 1} -}; +led_config_t g_led_config = { { + { 36, 35, 34, 33, 32, 31, 30, 6, 5, 4, 3, 2, 1, 0 }, + { 37, 38, 39, 40, 41, 42, 43, 7, 8, 9, 10, 11, 12, NO_LED }, + { 49, 50, 51, 52, 53, 45, 44, 20, 21, 22, 23, 15, 14, 13 }, + { 48, 47, 46, 54, 55, 56, 57, 19, 18, 17, 16, 24, NO_LED, 25 }, + { 61, 60, 59, 58, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 29, 28, 27, 26 } +}, { + //A1-A16 + { 224, 0 }, { 204, 0 }, { 187, 0 }, { 170, 0 }, { 153, 0 }, { 136, 0 }, { 119, 0 }, { 119, 16 }, { 136, 16 }, { 153, 16 }, { 170, 16 }, { 187, 16 }, { 204, 16 }, { 224, 8 }, + { 204, 32 }, { 187, 32 }, + //B1-B14 + { 170, 48 }, { 153, 48 }, { 136, 48 }, { 119, 48 }, { 119, 32 }, { 136, 32 }, { 153, 32 }, { 170, 32 }, { 187, 48 }, { 214, 48 }, { 224, 64 }, { 204, 64 }, { 187, 64 }, { 170, 64 }, + //C1-C16 + { 102, 0 }, { 85, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 }, { 0, 16 }, { 17, 16 }, { 34, 16 }, { 51, 16 }, { 68, 16 }, { 85, 16 }, { 102, 16 }, + { 102, 32 }, { 85, 32 }, + //D1-D16 + { 32, 48 }, { 17, 48 }, { 0, 48 }, { 0, 32 }, { 17, 32 }, { 34, 32 }, { 51, 32 }, { 68, 32 }, { 51, 48 }, { 68, 48 }, { 85, 48 }, { 102, 48 }, { 102, 64 }, { 34, 68 }, + { 17, 68 }, { 0, 68 } +}, { + //A1-A16 + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 4, 4, + //B1-B14 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, + //C1-C16 + 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, + 4, 4, + //D1-D16 + 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1 +} }; #endif @@ -407,7 +315,7 @@ void bootmagic_lite(void) // We need multiple scans because debouncing can't be turned off. matrix_scan(); - wait_ms(DEBOUNCING_DELAY); + wait_ms(DEBOUNCE); matrix_scan(); // If the Esc and space bar are held down on power up, @@ -492,4 +400,4 @@ void suspend_power_down_kb(void) void suspend_wakeup_init_kb(void) { rgb_matrix_set_suspend_state(false); -} \ No newline at end of file +} diff --git a/keyboards/hs60/v2/config.h b/keyboards/hs60/v2/config.h index 192f7d6f25d..7169d846ba3 100644 --- a/keyboards/hs60/v2/config.h +++ b/keyboards/hs60/v2/config.h @@ -20,9 +20,9 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0258 -#define DEVICE_VER 0x0001 +#define VENDOR_ID 0x8968 +#define PRODUCT_ID 0x4853 +#define DEVICE_VER 0x0002 #define MANUFACTURER Yiancar-Designs #define PRODUCT HS60 V2 #define DESCRIPTION GH60 compatible, tool free RGB keyboard @@ -35,11 +35,11 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A13, A10, A9, A14, A15, B8, B9, C13, C14, C15, A0, A1, A2, A3 } // To enable debugger set A13 A14 -> A5 A6 -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 0 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -82,36 +82,73 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +/* Backlight options */ -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ +#define RGB_BACKLIGHT_ENABLED 1 -/* disable debug print */ -//#define NO_DEBUG +#define RGB_BACKLIGHT_HS60 -/* disable print */ -//#define NO_PRINT +// they aren't really used if RGB_BACKLIGHT_HS60 defined +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 -/* Backlight options */ +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 -#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended -#define RGB_MATRIX_SKIP_FRAMES 3 +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 -#define DRIVER_ADDR_1 0b1010000 -#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 -#define DRIVER_COUNT 2 -#ifdef HS60_ANSI -#define DRIVER_1_LED_TOTAL 61 -#else -#define DRIVER_1_LED_TOTAL 62 -#endif +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 64 + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111 + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+32) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 67 +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +// Dynamic macro starts after dynamic keymaps (67+(4*5*14*2)) = (67+560) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 627 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/hs60/v2/info.json b/keyboards/hs60/v2/info.json index abafb69f99e..c42e9e9418f 100644 --- a/keyboards/hs60/v2/info.json +++ b/keyboards/hs60/v2/info.json @@ -1,6 +1,6 @@ { - "keyboard_name": "clueboard/60", - "maintainer": "skullydazed", + "keyboard_name": "HS60v2", + "maintainer": "yiancar", "url": "", "width": 15, "height": 5, diff --git a/keyboards/hs60/v2/keymaps/ansi/config.h b/keyboards/hs60/v2/keymaps/ansi/config.h index f51cc16d853..96adaf56884 100644 --- a/keyboards/hs60/v2/keymaps/ansi/config.h +++ b/keyboards/hs60/v2/keymaps/ansi/config.h @@ -19,3 +19,5 @@ along with this program. If not, see . /* Include overwrites for specific keymap */ #define HS60_ANSI +#undef PRODUCT_ID +#define PRODUCT_ID 0x4854 diff --git a/keyboards/hs60/v2/keymaps/ansi/keymap.c b/keyboards/hs60/v2/keymaps/ansi/keymap.c index 923af9e2ce0..ba649470b41 100644 --- a/keyboards/hs60/v2/keymaps/ansi/keymap.c +++ b/keyboards/hs60/v2/keymaps/ansi/keymap.c @@ -26,11 +26,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), [1] = LAYOUT_60_ansi( /* FN */ - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS,\ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS,\ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,\ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_TRNS,\ KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_60_ansi( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_60_ansi( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; void matrix_init_user(void) { diff --git a/keyboards/hs60/v2/keymaps/ansi/readme.md b/keyboards/hs60/v2/keymaps/ansi/readme.md index fa811319d38..3afd8afb33d 100644 --- a/keyboards/hs60/v2/keymaps/ansi/readme.md +++ b/keyboards/hs60/v2/keymaps/ansi/readme.md @@ -1,6 +1,6 @@ -The default keymap for ANSI HS60 -================================ +The default keymap for ANSI HS60 V2. VIA support disabled. +========================================================== -![Layout image](https://imgur.com/CSyPw0J.png) +![Layout image](https://i.imgur.com/m8t5CfE.png) -Default layer is normal ANSI and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file +Default layer is normal ANSI and Fn layer is used for RGB functions, Volume control and arrow cluster. \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/ansi_via/config.h b/keyboards/hs60/v2/keymaps/ansi_via/config.h new file mode 100644 index 00000000000..96adaf56884 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/ansi_via/config.h @@ -0,0 +1,23 @@ +/* +Copyright 2018 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +/* Include overwrites for specific keymap */ + +#define HS60_ANSI +#undef PRODUCT_ID +#define PRODUCT_ID 0x4854 diff --git a/keyboards/hs60/v2/keymaps/ansi_via/keymap.c b/keyboards/hs60/v2/keymaps/ansi_via/keymap.c new file mode 100644 index 00000000000..ba649470b41 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/ansi_via/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +//This is the ANSI version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_ansi( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,\ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), + +[1] = LAYOUT_60_ansi( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,\ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_TRNS,\ + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_60_ansi( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_60_ansi( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/ansi_via/readme.md b/keyboards/hs60/v2/keymaps/ansi_via/readme.md new file mode 100644 index 00000000000..a462da6619e --- /dev/null +++ b/keyboards/hs60/v2/keymaps/ansi_via/readme.md @@ -0,0 +1,6 @@ +The default keymap for ANSI HS60 V2. VIA support enabled. +========================================================= + +![Layout image](https://i.imgur.com/m8t5CfE.png) + +Default layer is normal ANSI and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/ansi_via/rules.mk b/keyboards/hs60/v2/keymaps/ansi_via/rules.mk new file mode 100644 index 00000000000..b8311f5e7f0 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/ansi_via/rules.mk @@ -0,0 +1,67 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/hs60/v2/keymaps/default/keymap.c b/keyboards/hs60/v2/keymaps/default/keymap.c index 2a5e823618c..c1e575769fe 100644 --- a/keyboards/hs60/v2/keymaps/default/keymap.c +++ b/keyboards/hs60/v2/keymaps/default/keymap.c @@ -26,11 +26,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), [1] = LAYOUT_60_iso( /* FN */ - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_TRNS,\ KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_60_iso( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_60_iso( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; void matrix_init_user(void) { diff --git a/keyboards/hs60/v2/keymaps/default/readme.md b/keyboards/hs60/v2/keymaps/default/readme.md index 9125cb349e8..9aa0a3a2b5a 100644 --- a/keyboards/hs60/v2/keymaps/default/readme.md +++ b/keyboards/hs60/v2/keymaps/default/readme.md @@ -1,6 +1,6 @@ -The default keymap for ISO HS60 -=============================== +The default keymap for ISO HS60 V2. VIA support disabled. +========================================================= -![Layout image](https://imgur.com/HXj4tYL.png) +![Layout image](https://imgur.com/6go4vQV.png) Default layer is normal ISO and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/default_via/keymap.c b/keyboards/hs60/v2/keymaps/default_via/keymap.c new file mode 100644 index 00000000000..c1e575769fe --- /dev/null +++ b/keyboards/hs60/v2/keymaps/default_via/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +//This is the ISO version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_iso( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), + +[1] = LAYOUT_60_iso( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_TRNS,\ + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_60_iso( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_60_iso( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/default_via/readme.md b/keyboards/hs60/v2/keymaps/default_via/readme.md new file mode 100644 index 00000000000..2a440f708c1 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/default_via/readme.md @@ -0,0 +1,6 @@ +The default keymap for ISO HS60 V2. VIA support enabled. +======================================================== + +![Layout image](https://imgur.com/6go4vQV.png) + +Default layer is normal ISO and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/default_via/rules.mk b/keyboards/hs60/v2/keymaps/default_via/rules.mk new file mode 100644 index 00000000000..b8311f5e7f0 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/default_via/rules.mk @@ -0,0 +1,67 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/hs60/v2/keymaps/goatmaster/config.h b/keyboards/hs60/v2/keymaps/goatmaster/config.h new file mode 100644 index 00000000000..f63c9035567 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/goatmaster/config.h @@ -0,0 +1,37 @@ +/* +Copyright 2018 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +/* Include overwrites for specific keymap */ + +#define HS60_HHKB +#undef PRODUCT_ID +#define PRODUCT_ID 0x4855 + +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111 + +#undef RGB_BACKLIGHT_CAPS_LOCK_INDICATOR +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 255 }, .index = 3-1 } //red diff --git a/keyboards/hs60/v2/keymaps/goatmaster/keymap.c b/keyboards/hs60/v2/keymaps/goatmaster/keymap.c new file mode 100644 index 00000000000..6273dbc646e --- /dev/null +++ b/keyboards/hs60/v2/keymaps/goatmaster/keymap.c @@ -0,0 +1,71 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +//This is the HHKB version of the PCB + +enum macro_keys { + KC_EML = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_hhkb( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSLS,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,\ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL ), + +[1] = LAYOUT_60_hhkb( /* FN */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS,\ + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_UP, KC_TRNS, KC_DEL, \ + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, \ + KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +[2] = LAYOUT_60_hhkb( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +[3] = LAYOUT_60_hhkb( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_EML: //use "KC_EML" as keycode in layers above to call macro + if (!record->event.pressed) { + send_string_with_delay_P(PSTR("example@email.com"), 10); //change email value here + } + break; + } + return true; +} diff --git a/keyboards/hs60/v2/keymaps/goatmaster/readme.md b/keyboards/hs60/v2/keymaps/goatmaster/readme.md new file mode 100644 index 00000000000..ea9803cc0bb --- /dev/null +++ b/keyboards/hs60/v2/keymaps/goatmaster/readme.md @@ -0,0 +1,6 @@ +The default keymap for HHKB HS60 V2. VIA support enabled. +========================================================= + +![Layout image](https://imgur.com/usbrQWL.png) + +Default layer is normal HHKB with 7U space. Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/goatmaster/rules.mk b/keyboards/hs60/v2/keymaps/goatmaster/rules.mk new file mode 100644 index 00000000000..b8311f5e7f0 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/goatmaster/rules.mk @@ -0,0 +1,67 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/hs60/v2/keymaps/hhkb/config.h b/keyboards/hs60/v2/keymaps/hhkb/config.h index 3db403ecc5c..fc1b6d8f47b 100644 --- a/keyboards/hs60/v2/keymaps/hhkb/config.h +++ b/keyboards/hs60/v2/keymaps/hhkb/config.h @@ -19,3 +19,16 @@ along with this program. If not, see . /* Include overwrites for specific keymap */ #define HS60_HHKB +#undef PRODUCT_ID +#define PRODUCT_ID 0x4855 + +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111 diff --git a/keyboards/hs60/v2/keymaps/hhkb/keymap.c b/keyboards/hs60/v2/keymaps/hhkb/keymap.c index d52fc4bac94..9641eedb492 100644 --- a/keyboards/hs60/v2/keymaps/hhkb/keymap.c +++ b/keyboards/hs60/v2/keymaps/hhkb/keymap.c @@ -19,18 +19,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_60_hhkb( /* Base */ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSLS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL ), + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSLS,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,\ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL ), [1] = LAYOUT_60_hhkb( /* FN */ - RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS,\ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_UP, KC_TRNS, KC_DEL, \ - KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ) + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS,\ + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_UP, KC_TRNS, KC_DEL, \ + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, \ + KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +[2] = LAYOUT_60_hhkb( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +[3] = LAYOUT_60_hhkb( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), }; void matrix_init_user(void) { diff --git a/keyboards/hs60/v2/keymaps/hhkb/readme.md b/keyboards/hs60/v2/keymaps/hhkb/readme.md new file mode 100644 index 00000000000..5259a584d20 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/hhkb/readme.md @@ -0,0 +1,6 @@ +The default keymap for HHKB HS60 V2. VIA support disabled. +========================================================== + +![Layout image](https://imgur.com/usbrQWL.png) + +Default layer is normal HHKB with 7U space. Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/hhkb_via/config.h b/keyboards/hs60/v2/keymaps/hhkb_via/config.h new file mode 100644 index 00000000000..fc1b6d8f47b --- /dev/null +++ b/keyboards/hs60/v2/keymaps/hhkb_via/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2018 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +/* Include overwrites for specific keymap */ + +#define HS60_HHKB +#undef PRODUCT_ID +#define PRODUCT_ID 0x4855 + +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111 diff --git a/keyboards/hs60/v2/keymaps/hhkb_via/keymap.c b/keyboards/hs60/v2/keymaps/hhkb_via/keymap.c new file mode 100644 index 00000000000..9641eedb492 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/hhkb_via/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +//This is the HHKB version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_hhkb( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSLS,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,\ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL ), + +[1] = LAYOUT_60_hhkb( /* FN */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS,\ + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_UP, KC_TRNS, KC_DEL, \ + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, \ + KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +[2] = LAYOUT_60_hhkb( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +[3] = LAYOUT_60_hhkb( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/hhkb_via/readme.md b/keyboards/hs60/v2/keymaps/hhkb_via/readme.md new file mode 100644 index 00000000000..ea9803cc0bb --- /dev/null +++ b/keyboards/hs60/v2/keymaps/hhkb_via/readme.md @@ -0,0 +1,6 @@ +The default keymap for HHKB HS60 V2. VIA support enabled. +========================================================= + +![Layout image](https://imgur.com/usbrQWL.png) + +Default layer is normal HHKB with 7U space. Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/hhkb_via/rules.mk b/keyboards/hs60/v2/keymaps/hhkb_via/rules.mk new file mode 100644 index 00000000000..b8311f5e7f0 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/hhkb_via/rules.mk @@ -0,0 +1,67 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/hs60/v2/keymaps/iso_andys8/keymap.c b/keyboards/hs60/v2/keymaps/iso_andys8/keymap.c new file mode 100644 index 00000000000..12272ee7980 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/iso_andys8/keymap.c @@ -0,0 +1,61 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// This is the ISO version of the PCB. With modifications by andys8 and an additional function layer. + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[0] = LAYOUT_60_iso( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(2) , KC_APP, KC_RCTL), + +[1] = LAYOUT_60_iso( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_PSCR, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_DEL, KC_NO, KC_NO, \ + KC_LSFT, KC_NO, KC_APP, KC_PAUS, KC_INS, KC_NO, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_RSFT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + +[2] = LAYOUT_60_iso( /* Light (Default FN) */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_TRNS,\ + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_60_iso( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/iso_andys8/readme.md b/keyboards/hs60/v2/keymaps/iso_andys8/readme.md new file mode 100644 index 00000000000..1b843feb92e --- /dev/null +++ b/keyboards/hs60/v2/keymaps/iso_andys8/readme.md @@ -0,0 +1,4 @@ +The andys8 keymap for ISO HS60 V2 +================================== + +Default iso layout with minor modifications and additional function layer. \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/iso_andys8/rules.mk b/keyboards/hs60/v2/keymaps/iso_andys8/rules.mk new file mode 100644 index 00000000000..b8311f5e7f0 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/iso_andys8/rules.mk @@ -0,0 +1,67 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/hs60/v2/keymaps/stanrc85/config.h b/keyboards/hs60/v2/keymaps/stanrc85/config.h new file mode 100644 index 00000000000..5aab3098c7d --- /dev/null +++ b/keyboards/hs60/v2/keymaps/stanrc85/config.h @@ -0,0 +1,41 @@ +#pragma once + +// Include overwrites for specific keymap +#define HS60_ANSI +#undef PRODUCT_ID +#define PRODUCT_ID 0x4854 + +// disable backlight after timeout in minutes, 0 = no timeout +#undef RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 10 + +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 +#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 + +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 //Setting \ key to "MOD" instead of "ALPHA" for lighting +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111 + +#undef RGB_BACKLIGHT_CAPS_LOCK_INDICATOR +#undef RGB_BACKLIGHT_LAYER_1_INDICATOR +#undef RGB_BACKLIGHT_LAYER_2_INDICATOR +#undef RGB_BACKLIGHT_LAYER_3_INDICATOR + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 200, .s = 255 }, .index = 3-1 } //purple +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 100, .s = 255 }, .index = 60-1 } //green +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 150, .s = 255 }, .index = 60-1 } //blue +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 60-1 } //white + +#undef RGB_BACKLIGHT_BRIGHTNESS +#define RGB_BACKLIGHT_BRIGHTNESS 175 + +#undef RGB_BACKLIGHT_COLOR_1 +#undef RGB_BACKLIGHT_COLOR_2 + +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 150, .s = 255 } diff --git a/keyboards/hs60/v2/keymaps/stanrc85/keymap.c b/keyboards/hs60/v2/keymaps/stanrc85/keymap.c new file mode 100644 index 00000000000..2e6a7048399 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/stanrc85/keymap.c @@ -0,0 +1,59 @@ +/* Copyright 2018 Stanrc85 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "stanrc85.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_60_ansi( + TD_TESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CTLE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, LT_SPCF, KC_RALT, TD_TWIN, MO(_FN2_60), TD_TCTL), + + [_DEFAULT] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1_60), MO(_FN2_60), KC_RCTL), + + [_FN1_60] = LAYOUT_60_ansi( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, _______, CA_QUOT, KC_VOLU, CA_SCLN, _______, _______, KC_HOME, KC_UP, KC_END, KC_PSCR, _______, _______, KC_INS, + KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_MPLY, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, + _______, KC_RDP, _______, _______, _______, _______, _______, _______, KC_WBAK, KC_WFWD, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______), + + [_FN2_60] = LAYOUT_60_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, + _______, EF_INC, ES_INC, S1_INC, H1_INC, S2_INC, H2_INC, BR_INC, _______, _______, _______, _______, _______, RESET, + _______, EF_DEC, ES_DEC, S1_DEC, H1_DEC, S2_DEC, H2_DEC, BR_DEC, _______, _______, _______, _______, KC_MAKE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, TG(_DEFAULT)) +}; + +// Backlight specific keys: +// EF_INC, EF_DEC, // next/previous backlight effect +// H1_INC, H1_DEC, // Color 1 hue increase/decrease +// S1_INC, S1_DEC, // Color 1 saturation increase/decrease +// H2_INC, H2_DEC, // Color 2 hue increase/decrease +// S2_INC, S2_DEC, // Color 2 saturation increase/decrease +// BR_INC, BR_DEC, // backlight brightness increase/decrease + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/hs60/v2/keymaps/stanrc85/readme.md b/keyboards/hs60/v2/keymaps/stanrc85/readme.md new file mode 100644 index 00000000000..430d363f376 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/stanrc85/readme.md @@ -0,0 +1,48 @@ + + +# Stanrc85's Standard ANSI 60% Layout + +## Keymap Notes +- Layer 0 is default QWERTY layout with additional custom features: + - SpaceFN to function layer 2 on `Space` + - `CTRL` when held and `ESC` when tapped on `CAPS LOCK` + - Tap Dance on `Fn1` for `CTRL+ALT+DEL` and `WIN+L` + - Tap Dance on `ESC` for `ESC` and ` ` ` + +![Base QWERTY Layer](https://imgur.com/lGcyLJx.png) + +- Layer 1 is default QWERTY with no custom features used mostly for gaming + - Enabled by `Fn2+CAPS` from base layer + +![Default ANSI Layer](https://imgur.com/M7T9PNT.png) + +- Layer 2 is Function layer: + - F keys + - Arrows + - Volume and Media controls + - AutoHotkey shortcuts based on [Speaker Control](https://github.com/stanrc85/Speaker-Control) script + - AHK Mic is used to mute/unmute microphone + - AHK Speaker switches audio output between headphones and speakers + +![Function Layer](https://imgur.com/YPl0JrU.png) + +- Layer 3 is Backlight control and RESET + - `Fn2+CAPS` used to toggle Default QWERTY layer on and off + +![RGB and RESET Layer](https://imgur.com/mMHoJPa.png) + +### Build +To build the firmware file associated with this keymap, simply run `make your_keyboard:stanrc85`. diff --git a/keyboards/hs60/v2/keymaps/stanrc85/rules.mk b/keyboards/hs60/v2/keymaps/stanrc85/rules.mk new file mode 100644 index 00000000000..69592d06c75 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/stanrc85/rules.mk @@ -0,0 +1,67 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/hs60/v2/keymaps/win_osx_dual/keymap.c b/keyboards/hs60/v2/keymaps/win_osx_dual/keymap.c new file mode 100644 index 00000000000..31d7ec1ed8e --- /dev/null +++ b/keyboards/hs60/v2/keymaps/win_osx_dual/keymap.c @@ -0,0 +1,97 @@ +/* Copyright 2018 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + + +#define _QWERTY 0 +#define _OSX 1 +#define _RAISE 2 +#define _SHIFTER 3 +#define _ADJUST 16 + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + OSX, + RAISE, + SHIFTER, +}; + +#define RAISE MO(_RAISE) + +#define OSX_SHIFT LM(_SHIFTER, MOD_LSFT) +#define OSX_ALT LM(_SHIFTER, MOD_LALT) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QWERTY] = LAYOUT_60_iso( /* Windows ISO layout */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,\ + KC_CAPS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, RAISE , KC_RCTL), + +[_OSX] = LAYOUT_60_iso( /* OSX ISO layout */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,\ + KC_CAPS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, A(KC_3), KC_ENT, \ + OSX_SHIFT, KC_NUHS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\ + KC_LCTL, OSX_ALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, RAISE , KC_RCTL), + +[_RAISE] = LAYOUT_60_iso( /* Configuration */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\ + KC_TRNS, QWERTY, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, OSX, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, EF_INC, H1_INC, S1_INC, H2_INC, S2_INC, BR_INC, ES_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_UP, EF_DEC, H1_DEC, S2_DEC, H2_DEC, S2_DEC, BR_DEC, ES_DEC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[_SHIFTER] = LAYOUT_60_iso( /* Shift Mods makes a keyboard with windows key layout work on OSX*/ + KC_TRNS, S(KC_1), S(KC_QUOT),S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), S(KC_MINS), S(KC_EQL), KC_DEL,\ + KC_TRNS, S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), S(KC_LBRC), S(KC_RBRC), \ + KC_TRNS, S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), S(KC_H), S(KC_J), S(KC_K), S(KC_L), S(KC_SCLN), S(KC_2), S(KC_NUBS), KC_TRNS, \ + KC_TRNS, S(KC_NUHS), S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), S(KC_N), S(KC_M), S(KC_COMM), S(KC_DOT), S(KC_SLSH), KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + + +}; + +void matrix_init_user(void) { + //user initialization +} + + +void matrix_scan_user(void) { + //user matrix +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case OSX: + if (record->event.pressed) { + set_single_persistent_default_layer(_OSX); + } + return false; + + } + return true; +} diff --git a/keyboards/hs60/v2/keymaps/win_osx_dual/readme.md b/keyboards/hs60/v2/keymaps/win_osx_dual/readme.md new file mode 100644 index 00000000000..c2e58bf6868 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/win_osx_dual/readme.md @@ -0,0 +1,6 @@ +The default keymap for ISO HS60 V2 +================================== + +![Layout image](https://i.imgur.com/NEtFQcV.png) + +Default layer is normal ISO for windows. Second layout is Windows ISO layout but for OSX, but with the keys corrected so you will get the correct shifted and alt'd keys on OSX (keyboard keys match OSX keys without having to change your keyboard type in system preferences). Layer three is configuration and other functions, and layer four is where the shifting magic happens. Also tab and caps lock have been swapped around. diff --git a/keyboards/hs60/v2/keymaps/win_osx_dual/rules.mk b/keyboards/hs60/v2/keymaps/win_osx_dual/rules.mk new file mode 100644 index 00000000000..1dc96d04be9 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/win_osx_dual/rules.mk @@ -0,0 +1,67 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/hs60/v2/mcuconf.h b/keyboards/hs60/v2/mcuconf.h index 226da48d593..ce608f904ed 100644 --- a/keyboards/hs60/v2/mcuconf.h +++ b/keyboards/hs60/v2/mcuconf.h @@ -139,7 +139,7 @@ #define STM32_GPT_USE_TIM1 FALSE #define STM32_GPT_USE_TIM2 FALSE #define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM4 TRUE #define STM32_GPT_USE_TIM6 TRUE #define STM32_GPT_USE_TIM7 TRUE #define STM32_GPT_USE_TIM8 TRUE diff --git a/keyboards/hs60/v2/readme.md b/keyboards/hs60/v2/readme.md index 50c91698da6..e838426a2d9 100644 --- a/keyboards/hs60/v2/readme.md +++ b/keyboards/hs60/v2/readme.md @@ -11,8 +11,27 @@ Hardware Availability: http://groupbuys.mechboards.co.uk/shop/hs60-hotswap-60-pc Due to the RGB implementation, the HS60 is currently not compatible with community layouts. +## Instructions + +### Build + Make example for this keyboard (after setting up your build environment): make hs60/v2:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +### Reset + +- Unplug +- Hold Escape +- Plug In +- Unplug +- Release Escape + +### Flash + +- Unplug +- Hold Escape +- Plug In +- Flash using QMK Toolbox or dfu-util (`make hs60/v2::dfu-util`) diff --git a/keyboards/hs60/v2/rules.mk b/keyboards/hs60/v2/rules.mk index 51e3cf0a3ec..c2b643ad108 100644 --- a/keyboards/hs60/v2/rules.mk +++ b/keyboards/hs60/v2/rules.mk @@ -1,4 +1,9 @@ # project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c ## chip/board settings # the next two should match the directories in @@ -40,19 +45,25 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. # -BACKLIGHT_ENABLE = no -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend NKRO_ENABLE = yes # USB Nkey Rollover -AUDIO_ENABLE = no -RGB_MATRIX_ENABLE = IS31FL3733 # Use RGB matrix +AUDIO_ENABLE = no # Audio output on port C6 NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in #SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = no +DYNAMIC_KEYMAP_ENABLE = no +CIE1931_CURVE = yes + +LAYOUTS = 60_ansi 60_iso diff --git a/keyboards/hs60/v2/v2.c b/keyboards/hs60/v2/v2.c index 4289c1fed5c..2e12538e9bb 100644 --- a/keyboards/hs60/v2/v2.c +++ b/keyboards/hs60/v2/v2.c @@ -13,623 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "v2.h" - -//#include "is31fl3733.h" - -// Please ignore this is for upcoming features -/*#ifdef RAW_ENABLE - -void raw_hid_receive( uint8_t *data, uint8_t length ) -{ - uint8_t command = data[0]; - switch ( command ) - { - case id_protocol_version: - { - msg_protocol_version *msg = (msg_protocol_version*)&data[1]; - msg->version = PROTOCOL_VERSION; - break; - } -#if USE_KEYMAPS_IN_EEPROM - case id_keymap_keycode_load: - { - msg_keymap_keycode_load *msg = (msg_keymap_keycode_load*)&data[1]; - msg->keycode = keymap_keycode_load( msg->layer, msg->row, msg->column ); - break; - } - case id_keymap_keycode_save: - { - msg_keymap_keycode_save *msg = (msg_keymap_keycode_save*)&data[1]; - keymap_keycode_save( msg->layer, msg->row, msg->column, msg->keycode); - break; - } - case id_keymap_default_save: - { - keymap_default_save(); - break; - } -#endif // USE_KEYMAPS_IN_EEPROM - case id_backlight_config_set_values: - { - msg_backlight_config_set_values *msg = (msg_backlight_config_set_values*)&data[1]; - backlight_config_set_values(msg); - backlight_config_save(); - break; - } - case id_backlight_config_set_alphas_mods: - { - msg_backlight_config_set_alphas_mods *msg = (msg_backlight_config_set_alphas_mods*)&data[1]; - backlight_config_set_alphas_mods( msg->alphas_mods ); - backlight_config_save(); - break; - } - case id_backlight_set_key_color: - { - msg_backlight_set_key_color *msg = (msg_backlight_set_key_color*)&data[1]; - backlight_set_key_color(msg->row, msg->column, msg->hsv); - break; - } - case id_system_get_state: - { - msg_system_state *msg = (msg_system_state*)&data[1]; - msg->value = backlight_get_tick(); - break; - } - default: - { - // Unhandled message. - data[0] = id_unhandled; - break; - } - } - - // Return same buffer with values changed - raw_hid_send( data, length ); - -} - -#endif*/ - -#ifdef HS60_ANSI - -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - {0, B_1, A_1, C_1}, //MX1 - {0, E_1, D_1, F_1}, //MX2 - {0, H_1, G_1, I_1}, //MX3 - {0, K_1, J_1, L_1}, //MX4 - {0, B_2, A_2, C_2}, //MX6 - {0, E_2, D_2, F_2}, //MX7 - {0, H_2, G_2, I_2}, //MX8 - {0, K_2, J_2, L_2}, //MX14 - {0, B_3, A_3, C_3}, //MX11 - {0, E_3, D_3, F_3}, //MX12 - {0, H_3, G_3, I_3}, //MX13 - {0, K_3, J_3, L_3}, //MX19 - {0, B_4, A_4, C_4}, //MX16 - {0, E_4, D_4, F_4}, //MX17 - {0, H_4, G_4, I_4}, //MX18 - {0, K_4, J_4, L_4}, //MX23 - {0, B_5, A_5, C_5}, //MX20 - {0, E_5, D_5, F_5}, //MX21 - {0, H_5, G_5, I_5}, //MX22 - {0, K_5, J_5, L_5}, //MX27 - {0, B_6, A_6, C_6}, //MX24 - {0, E_6, D_6, F_6}, //MX25 - {0, H_6, G_6, I_6}, //MX26 - {0, K_6, J_6, L_6}, //MX31 - {0, B_7, A_7, C_7}, //MX28 - {0, E_7, D_7, F_7}, //MX29 - {0, H_7, G_7, I_7}, //MX30 - {0, K_7, J_7, L_7}, //MX36 - {0, B_8, A_8, C_8}, //MX33 - {0, E_8, D_8, F_8}, //MX34 - {0, H_8, G_8, I_8}, //MX35 - {0, K_8, J_8, L_8}, //MX40 - {0, B_9, A_9, C_9}, //MX37 - {0, E_9, D_9, F_9}, //MX38 - {0, H_9, G_9, I_9}, //MX39 - {0, K_9, J_9, L_9}, //MX44 - {0, B_10, A_10, C_10}, //MX41 - {0, E_10, D_10, F_10}, //MX42 - {0, H_10, G_10, I_10}, //MX43 - {0, K_10, J_10, L_10}, //MX48 - {0, B_11, A_11, C_11}, //MX45 - {0, E_11, D_11, F_11}, //MX46 - {0, H_11, G_11, I_11}, //MX47 - {0, K_11, J_11, L_11}, //MX53 - {0, B_12, A_12, C_12}, //MX50 - {0, E_12, D_12, F_12}, //MX51 - {0, H_12, G_12, I_12}, //MX52 - - {0, B_13, A_13, C_13}, //MX55 - {0, E_13, D_13, F_13}, //MX56 - - {0, K_13, J_13, L_13}, //MX61 - {0, B_14, A_14, C_14}, //MX59 - {0, E_14, D_14, F_14}, //MX57 - {0, H_14, G_14, I_14}, //MX60 - {0, K_14, J_14, L_14}, //MX62 - {0, B_15, A_15, C_15}, //MX5 - {0, E_15, D_15, F_15}, //MX10 - {0, H_15, G_15, I_15}, //MX15 - {0, K_15, J_15, L_15}, //MX32 - - {0, E_16, D_16, F_16}, //MX49 - {0, H_16, G_16, I_16}, //MX54 - {0, K_16, J_16, L_16}, //MX58 -}; - -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// MX1, MX6, MX11, MX16, MX20, MX24, MX28, MX33, MX37, MX41, MX45, MX50, MX55, MX59, -// MX2, MX7, MX12, MX17, MX21, MX25, MX29, MX34, MX38, MX42, MX46, MX51, MX56, ---, -// MX3, MX8, MX13, MX18, MX22, MX26, MX30, MX35, MX39, MX43, MX47, MX52, MX57, MX60, -// MX4, ---, MX14, MX19, MX23, MX27, MX31, MX36, MX40, MX44, MX48, MX53, ---, MX61, -// MX5, MX10, MX15, ---, ---, ---, MX32, ---, ---, ---, MX49, MX54, MX58, MX62 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | modifier - * | | | */ - {{0|(0<<4)}, { 0, 0}, 1}, //MX1 - {{1|(0<<4)}, { 0, 16}, 1}, //MX2 - {{2|(0<<4)}, { 0, 32}, 1}, //MX3 - {{3|(0<<4)}, { 0, 48}, 1}, //MX4 - {{0|(1<<4)}, { 17, 0}, 0}, //MX6 - {{1|(1<<4)}, { 17, 16}, 0}, //MX7 - {{2|(1<<4)}, { 17, 32}, 0}, //MX8 - {{3|(2<<4)}, { 34, 48}, 0}, //MX14 - {{0|(2<<4)}, { 34, 0}, 0}, //MX11 - {{1|(2<<4)}, { 34, 16}, 0}, //MX12 - {{2|(2<<4)}, { 34, 32}, 0}, //MX13 - {{3|(3<<4)}, { 51, 48}, 0}, //MX19 - {{0|(3<<4)}, { 51, 0}, 0}, //MX16 - {{1|(3<<4)}, { 51, 16}, 0}, //MX17 - {{2|(3<<4)}, { 51, 32}, 0}, //MX18 - {{3|(4<<4)}, { 68, 48}, 0}, //MX23 - {{0|(4<<4)}, { 68, 0}, 0}, //MX20 - {{1|(4<<4)}, { 68, 16}, 0}, //MX21 - {{2|(4<<4)}, { 68, 32}, 0}, //MX22 - {{3|(5<<4)}, { 85, 48}, 0}, //MX27 - {{0|(5<<4)}, { 85, 0}, 0}, //MX24 - {{1|(5<<4)}, { 85, 16}, 0}, //MX25 - {{2|(5<<4)}, { 85, 32}, 0}, //MX26 - {{3|(6<<4)}, {102, 48}, 0}, //MX31 - {{0|(6<<4)}, {102, 0}, 0}, //MX28 - {{1|(6<<4)}, {102, 16}, 0}, //MX29 - {{2|(6<<4)}, {102, 32}, 0}, //MX30 - {{3|(7<<4)}, {119, 48}, 0}, //MX36 - {{0|(7<<4)}, {119, 0}, 0}, //MX33 - {{1|(7<<4)}, {119, 16}, 0}, //MX34 - {{2|(7<<4)}, {119, 32}, 0}, //MX35 - {{3|(8<<4)}, {136, 48}, 0}, //MX40 - {{0|(8<<4)}, {136, 0}, 0}, //MX37 - {{1|(8<<4)}, {136, 16}, 0}, //MX38 - {{2|(8<<4)}, {136, 32}, 0}, //MX39 - {{3|(9<<4)}, {153, 48}, 0}, //MX44 - {{0|(9<<4)}, {153, 0}, 0}, //MX41 - {{1|(9<<4)}, {153, 16}, 0}, //MX42 - {{2|(9<<4)}, {153, 32}, 0}, //MX43 - {{3|(10<<4)}, {170, 48}, 0}, //MX48 - {{0|(10<<4)}, {170, 0}, 0}, //MX45 - {{1|(10<<4)}, {170, 16}, 0}, //MX46 - {{2|(10<<4)}, {170, 32}, 0}, //MX47 - {{3|(11<<4)}, {187, 48}, 0}, //MX53 - {{0|(11<<4)}, {187, 0}, 0}, //MX50 - {{1|(11<<4)}, {187, 16}, 0}, //MX51 - {{2|(11<<4)}, {187, 32}, 0}, //MX52 - - {{0|(12<<4)}, {204, 0}, 0}, //MX55 - {{1|(12<<4)}, {204, 16}, 0}, //MX56 - - {{3|(13<<4)}, {221, 48}, 1}, //MX61 - {{0|(13<<4)}, {221, 0}, 1}, //MX59 - {{2|(12<<4)}, {221, 16}, 0}, //MX57 - {{2|(13<<4)}, {221, 32}, 1}, //MX60 - {{4|(13<<4)}, {221, 64}, 1}, //MX62 - {{4|(0<<4)}, { 0, 64}, 1}, //MX5 - {{4|(1<<4)}, { 17, 64}, 1}, //MX10 - {{4|(2<<4)}, { 34, 64}, 1}, //MX15 - {{4|(5<<4)}, {102, 64}, 0}, //MX32 - - {{4|(10<<4)}, {170, 64}, 1}, //MX49 - {{4|(11<<4)}, {187, 64}, 1}, //MX54 - {{4|(12<<4)}, {204, 64}, 1} //MX58 -}; - -#elif defined(HS60_HHKB) - -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - {0, B_1, A_1, C_1}, //MX1 - {0, E_1, D_1, F_1}, //MX2 - {0, H_1, G_1, I_1}, //MX3 - {0, K_1, J_1, L_1}, //MX4 - {0, B_2, A_2, C_2}, //MX6 - {0, E_2, D_2, F_2}, //MX7 - {0, H_2, G_2, I_2}, //MX8 - {0, K_2, J_2, L_2}, //MX14 - {0, B_3, A_3, C_3}, //MX11 - {0, E_3, D_3, F_3}, //MX12 - {0, H_3, G_3, I_3}, //MX13 - {0, K_3, J_3, L_3}, //MX19 - {0, B_4, A_4, C_4}, //MX16 - {0, E_4, D_4, F_4}, //MX17 - {0, H_4, G_4, I_4}, //MX18 - {0, K_4, J_4, L_4}, //MX23 - {0, B_5, A_5, C_5}, //MX20 - {0, E_5, D_5, F_5}, //MX21 - {0, H_5, G_5, I_5}, //MX22 - {0, K_5, J_5, L_5}, //MX27 - {0, B_6, A_6, C_6}, //MX24 - {0, E_6, D_6, F_6}, //MX25 - {0, H_6, G_6, I_6}, //MX26 - {0, K_6, J_6, L_6}, //MX31 - {0, B_7, A_7, C_7}, //MX28 - {0, E_7, D_7, F_7}, //MX29 - {0, H_7, G_7, I_7}, //MX30 - {0, K_7, J_7, L_7}, //MX36 - {0, B_8, A_8, C_8}, //MX33 - {0, E_8, D_8, F_8}, //MX34 - {0, H_8, G_8, I_8}, //MX35 - {0, K_8, J_8, L_8}, //MX40 - {0, B_9, A_9, C_9}, //MX37 - {0, E_9, D_9, F_9}, //MX38 - {0, H_9, G_9, I_9}, //MX39 - {0, K_9, J_9, L_9}, //MX44 - {0, B_10, A_10, C_10}, //MX41 - {0, E_10, D_10, F_10}, //MX42 - {0, H_10, G_10, I_10}, //MX43 - {0, K_10, J_10, L_10}, //MX48 - {0, B_11, A_11, C_11}, //MX45 - {0, E_11, D_11, F_11}, //MX46 - {0, H_11, G_11, I_11}, //MX47 - {0, K_11, J_11, L_11}, //MX53 - {0, B_12, A_12, C_12}, //MX50 - {0, E_12, D_12, F_12}, //MX51 - {0, H_12, G_12, I_12}, //MX52 - {0, K_12, J_12, L_12}, //MX64 - {0, B_13, A_13, C_13}, //MX55 - {0, E_13, D_13, F_13}, //MX56 - {0, H_13, G_13, I_13}, //MX63 - {0, K_13, J_13, L_13}, //MX61 - {0, B_14, A_14, C_14}, //MX59 - {0, E_14, D_14, F_14}, //MX57 - {0, H_14, G_14, I_14}, //MX60 - {0, K_14, J_14, L_14}, //MX62 - {0, B_15, A_15, C_15}, //MX5 - {0, E_15, D_15, F_15}, //MX10 - {0, H_15, G_15, I_15}, //MX15 - {0, K_15, J_15, L_15}, //MX32 - - - {0, H_16, G_16, I_16}, //MX54 - {0, K_16, J_16, L_16}, //MX58 -}; - -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// MX1, MX6, MX11, MX16, MX20, MX24, MX28, MX33, MX37, MX41, MX45, MX50, MX55, MX59, -// MX2, MX7, MX12, MX17, MX21, MX25, MX29, MX34, MX38, MX42, MX46, MX51, MX56, MX64, -// MX3, MX8, MX13, MX18, MX22, MX26, MX30, MX35, MX39, MX43, MX47, MX52, MX57, MX60, -// MX4, ----, MX14, MX19, MX23, MX27, MX31, MX36, MX40, MX44, MX48, MX53, MX63, MX61, -// MX5, MX10, MX15, ----, ----, ----, MX32, ----, ---, ----, ----, MX54, MX58, MX62 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | modifier - * | | | */ - {{0|(0<<4)}, { 0, 0}, 1}, //MX1 - {{1|(0<<4)}, { 0, 16}, 1}, //MX2 - {{2|(0<<4)}, { 0, 32}, 1}, //MX3 - {{3|(0<<4)}, { 0, 48}, 1}, //MX4 - {{0|(1<<4)}, { 17, 0}, 0}, //MX6 - {{1|(1<<4)}, { 17, 16}, 0}, //MX7 - {{2|(1<<4)}, { 17, 32}, 0}, //MX8 - {{3|(2<<4)}, { 34, 48}, 0}, //MX14 - {{0|(2<<4)}, { 34, 0}, 0}, //MX11 - {{1|(2<<4)}, { 34, 16}, 0}, //MX12 - {{2|(2<<4)}, { 34, 32}, 0}, //MX13 - {{3|(3<<4)}, { 51, 48}, 0}, //MX19 - {{0|(3<<4)}, { 51, 0}, 0}, //MX16 - {{1|(3<<4)}, { 51, 16}, 0}, //MX17 - {{2|(3<<4)}, { 51, 32}, 0}, //MX18 - {{3|(4<<4)}, { 68, 48}, 0}, //MX23 - {{0|(4<<4)}, { 68, 0}, 0}, //MX20 - {{1|(4<<4)}, { 68, 16}, 0}, //MX21 - {{2|(4<<4)}, { 68, 32}, 0}, //MX22 - {{3|(5<<4)}, { 85, 48}, 0}, //MX27 - {{0|(5<<4)}, { 85, 0}, 0}, //MX24 - {{1|(5<<4)}, { 85, 16}, 0}, //MX25 - {{2|(5<<4)}, { 85, 32}, 0}, //MX26 - {{3|(6<<4)}, {102, 48}, 0}, //MX31 - {{0|(6<<4)}, {102, 0}, 0}, //MX28 - {{1|(6<<4)}, {102, 16}, 0}, //MX29 - {{2|(6<<4)}, {102, 32}, 0}, //MX30 - {{3|(7<<4)}, {119, 48}, 0}, //MX36 - {{0|(7<<4)}, {119, 0}, 0}, //MX33 - {{1|(7<<4)}, {119, 16}, 0}, //MX34 - {{2|(7<<4)}, {119, 32}, 0}, //MX35 - {{3|(8<<4)}, {136, 48}, 0}, //MX40 - {{0|(8<<4)}, {136, 0}, 0}, //MX37 - {{1|(8<<4)}, {136, 16}, 0}, //MX38 - {{2|(8<<4)}, {136, 32}, 0}, //MX39 - {{3|(9<<4)}, {153, 48}, 0}, //MX44 - {{0|(9<<4)}, {153, 0}, 0}, //MX41 - {{1|(9<<4)}, {153, 16}, 0}, //MX42 - {{2|(9<<4)}, {153, 32}, 0}, //MX43 - {{3|(10<<4)}, {170, 48}, 0}, //MX48 - {{0|(10<<4)}, {170, 0}, 0}, //MX45 - {{1|(10<<4)}, {170, 16}, 0}, //MX46 - {{2|(10<<4)}, {170, 32}, 0}, //MX47 - {{3|(11<<4)}, {187, 48}, 0}, //MX53 - {{0|(11<<4)}, {187, 0}, 0}, //MX50 - {{1|(11<<4)}, {187, 16}, 0}, //MX51 - {{2|(11<<4)}, {187, 32}, 0}, //MX52 - {{1|(13<<4)}, {221, 0}, 1}, //MX64 - {{0|(12<<4)}, {204, 0}, 0}, //MX55 - {{1|(12<<4)}, {204, 16}, 0}, //MX56 - {{3|(12<<4)}, {204, 48}, 0}, //MX63 - {{3|(13<<4)}, {212, 48}, 1}, //MX61 - {{0|(13<<4)}, {221, 0}, 0}, //MX59 - {{2|(12<<4)}, {221, 16}, 0}, //MX57 - {{2|(13<<4)}, {221, 32}, 1}, //MX60 - {{4|(13<<4)}, {221, 64}, 1}, //MX62 - {{4|(0<<4)}, { 0, 64}, 1}, //MX5 - {{4|(1<<4)}, { 17, 64}, 1}, //MX10 - {{4|(2<<4)}, { 34, 64}, 1}, //MX15 - {{4|(5<<4)}, {102, 64}, 0}, //MX32 - - - {{4|(11<<4)}, {187, 64}, 1}, //MX54 - {{4|(12<<4)}, {204, 64}, 1} //MX58 -}; - -#else //ISO layout - -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - {0, B_1, A_1, C_1}, //MX1 - {0, E_1, D_1, F_1}, //MX2 - {0, H_1, G_1, I_1}, //MX3 - {0, K_1, J_1, L_1}, //MX4 - {0, B_2, A_2, C_2}, //MX6 - {0, E_2, D_2, F_2}, //MX7 - {0, H_2, G_2, I_2}, //MX8 - {0, K_2, J_2, L_2}, //MX14 - {0, B_3, A_3, C_3}, //MX11 - {0, E_3, D_3, F_3}, //MX12 - {0, H_3, G_3, I_3}, //MX13 - {0, K_3, J_3, L_3}, //MX19 - {0, B_4, A_4, C_4}, //MX16 - {0, E_4, D_4, F_4}, //MX17 - {0, H_4, G_4, I_4}, //MX18 - {0, K_4, J_4, L_4}, //MX23 - {0, B_5, A_5, C_5}, //MX20 - {0, E_5, D_5, F_5}, //MX21 - {0, H_5, G_5, I_5}, //MX22 - {0, K_5, J_5, L_5}, //MX27 - {0, B_6, A_6, C_6}, //MX24 - {0, E_6, D_6, F_6}, //MX25 - {0, H_6, G_6, I_6}, //MX26 - {0, K_6, J_6, L_6}, //MX31 - {0, B_7, A_7, C_7}, //MX28 - {0, E_7, D_7, F_7}, //MX29 - {0, H_7, G_7, I_7}, //MX30 - {0, K_7, J_7, L_7}, //MX36 - {0, B_8, A_8, C_8}, //MX33 - {0, E_8, D_8, F_8}, //MX34 - {0, H_8, G_8, I_8}, //MX35 - {0, K_8, J_8, L_8}, //MX40 - {0, B_9, A_9, C_9}, //MX37 - {0, E_9, D_9, F_9}, //MX38 - {0, H_9, G_9, I_9}, //MX39 - {0, K_9, J_9, L_9}, //MX44 - {0, B_10, A_10, C_10}, //MX41 - {0, E_10, D_10, F_10}, //MX42 - {0, H_10, G_10, I_10}, //MX43 - {0, K_10, J_10, L_10}, //MX48 - {0, B_11, A_11, C_11}, //MX45 - {0, E_11, D_11, F_11}, //MX46 - {0, H_11, G_11, I_11}, //MX47 - {0, K_11, J_11, L_11}, //MX53 - {0, B_12, A_12, C_12}, //MX50 - {0, E_12, D_12, F_12}, //MX51 - {0, H_12, G_12, I_12}, //MX52 - {0, K_12, J_12, L_12}, //MX9 - {0, B_13, A_13, C_13}, //MX55 - {0, E_13, D_13, F_13}, //MX56 - - {0, K_13, J_13, L_13}, //MX61 - {0, B_14, A_14, C_14}, //MX59 - {0, E_14, D_14, F_14}, //MX57 - {0, H_14, G_14, I_14}, //MX60 - {0, K_14, J_14, L_14}, //MX62 - {0, B_15, A_15, C_15}, //MX5 - {0, E_15, D_15, F_15}, //MX10 - {0, H_15, G_15, I_15}, //MX15 - {0, K_15, J_15, L_15}, //MX32 - - {0, E_16, D_16, F_16}, //MX49 - {0, H_16, G_16, I_16}, //MX54 - {0, K_16, J_16, L_16}, //MX58 -}; - -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// MX1, MX6, MX11, MX16, MX20, MX24, MX28, MX33, MX37, MX41, MX45, MX50, MX55, MX59, -// MX2, MX7, MX12, MX17, MX21, MX25, MX29, MX34, MX38, MX42, MX46, MX51, MX56, ---, -// MX3, MX8, MX13, MX18, MX22, MX26, MX30, MX35, MX39, MX43, MX47, MX52, MX57, MX60, -// MX4, ---, MX14, MX19, MX23, MX27, MX31, MX36, MX40, MX44, MX48, MX53, ---, MX61, -// MX5, MX10, MX15, ---, ---, ---, MX32, ---, ---, ---, MX49, MX54, MX58, MX62 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | modifier - * | | | */ - {{0|(0<<4)}, { 0, 0}, 1}, //MX1 - {{1|(0<<4)}, { 0, 16}, 1}, //MX2 - {{2|(0<<4)}, { 0, 32}, 1}, //MX3 - {{3|(0<<4)}, { 0, 48}, 1}, //MX4 - {{0|(1<<4)}, { 17, 0}, 0}, //MX6 - {{1|(1<<4)}, { 17, 16}, 0}, //MX7 - {{2|(1<<4)}, { 17, 32}, 0}, //MX8 - {{3|(2<<4)}, { 34, 48}, 0}, //MX14 - {{0|(2<<4)}, { 34, 0}, 0}, //MX11 - {{1|(2<<4)}, { 34, 16}, 0}, //MX12 - {{2|(2<<4)}, { 34, 32}, 0}, //MX13 - {{3|(3<<4)}, { 51, 48}, 0}, //MX19 - {{0|(3<<4)}, { 51, 0}, 0}, //MX16 - {{1|(3<<4)}, { 51, 16}, 0}, //MX17 - {{2|(3<<4)}, { 51, 32}, 0}, //MX18 - {{3|(4<<4)}, { 68, 48}, 0}, //MX23 - {{0|(4<<4)}, { 68, 0}, 0}, //MX20 - {{1|(4<<4)}, { 68, 16}, 0}, //MX21 - {{2|(4<<4)}, { 68, 32}, 0}, //MX22 - {{3|(5<<4)}, { 85, 48}, 0}, //MX27 - {{0|(5<<4)}, { 85, 0}, 0}, //MX24 - {{1|(5<<4)}, { 85, 16}, 0}, //MX25 - {{2|(5<<4)}, { 85, 32}, 0}, //MX26 - {{3|(6<<4)}, {102, 48}, 0}, //MX31 - {{0|(6<<4)}, {102, 0}, 0}, //MX28 - {{1|(6<<4)}, {102, 16}, 0}, //MX29 - {{2|(6<<4)}, {102, 32}, 0}, //MX30 - {{3|(7<<4)}, {119, 48}, 0}, //MX36 - {{0|(7<<4)}, {119, 0}, 0}, //MX33 - {{1|(7<<4)}, {119, 16}, 0}, //MX34 - {{2|(7<<4)}, {119, 32}, 0}, //MX35 - {{3|(8<<4)}, {136, 48}, 0}, //MX40 - {{0|(8<<4)}, {136, 0}, 0}, //MX37 - {{1|(8<<4)}, {136, 16}, 0}, //MX38 - {{2|(8<<4)}, {136, 32}, 0}, //MX39 - {{3|(9<<4)}, {153, 48}, 0}, //MX44 - {{0|(9<<4)}, {153, 0}, 0}, //MX41 - {{1|(9<<4)}, {153, 16}, 0}, //MX42 - {{2|(9<<4)}, {153, 32}, 0}, //MX43 - {{3|(10<<4)}, {170, 48}, 0}, //MX48 - {{0|(10<<4)}, {170, 0}, 0}, //MX45 - {{1|(10<<4)}, {170, 16}, 0}, //MX46 - {{2|(10<<4)}, {170, 32}, 0}, //MX47 - {{3|(11<<4)}, {187, 48}, 0}, //MX53 - {{0|(11<<4)}, {187, 0}, 0}, //MX50 - {{1|(11<<4)}, {187, 16}, 0}, //MX51 - {{2|(11<<4)}, {187, 32}, 0}, //MX52 - {{3|(2<<4)}, { 17, 32}, 1}, //MX9 - {{0|(12<<4)}, {204, 0}, 0}, //MX55 - {{1|(12<<4)}, {204, 16}, 0}, //MX56 - - {{3|(13<<4)}, {221, 48}, 1}, //MX61 - {{0|(13<<4)}, {221, 0}, 1}, //MX59 - {{2|(12<<4)}, {204, 32}, 0}, //MX57 - {{2|(13<<4)}, {221, 24}, 1}, //MX60 - {{4|(13<<4)}, {221, 64}, 1}, //MX62 - {{4|(0<<4)}, { 0, 64}, 1}, //MX5 - {{4|(1<<4)}, { 17, 64}, 1}, //MX10 - {{4|(2<<4)}, { 34, 64}, 1}, //MX15 - {{4|(5<<4)}, {102, 64}, 0}, //MX32 - - {{4|(10<<4)}, {170, 64}, 1}, //MX49 - {{4|(11<<4)}, {187, 64}, 1}, //MX54 - {{4|(12<<4)}, {204, 64}, 1} //MX58 -}; - +#ifndef RGB_BACKLIGHT_HS60 +#error RGB_BACKLIGHT_M60_A not defined, recheck config.h #endif - -void bootmagic_lite(void) -{ - // The lite version of TMK's bootmagic made by Wilba. - // 100% less potential for accidentally making the - // keyboard do stupid things. - - // We need multiple scans because debouncing can't be turned off. - matrix_scan(); - wait_ms(10); - matrix_scan(); - - // If the Esc and space bar are held down on power up, - // reset the EEPROM valid state and jump to bootloader. - // Assumes Esc is at [0,0] and spacebar is at [4,6]. - // This isn't very generalized, but we need something that doesn't - // rely on user's keymaps in firmware or EEPROM. - if ( ( matrix_get_row(0) & (1<<0) ) && - ( matrix_get_row(4) & (1<<6) ) ) - { - // Set the TMK/QMK EEPROM state as invalid. - eeconfig_disable(); - //eeprom_set_valid(false); - // Jump to bootloader. - bootloader_jump(); - } -} - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - bootmagic_lite(); - - // Please ignore this is for upcoming features - // If the EEPROM has the magic, the data is good. - // OK to load from EEPROM. - /*if (eeprom_is_valid()) - { - backlight_config_load(); - - // TODO: do something to "turn on" keymaps in EEPROM? - } - else - { - // If the EEPROM has not been saved before, or is out of date, - // save the default values to the EEPROM. Default values - // come from construction of the zeal_backlight_config instance. - backlight_config_save(); - - // Clear the LED colors stored in EEPROM - for ( int row=0; row < MATRIX_ROWS; row++ ) - { - HSV hsv; - for ( int column=0; column < MATRIX_COLS; column++ ) - { - hsv.h = rand() & 0xFF; - hsv.s = rand() & 0x7F; - hsv.v = 255; - backlight_set_key_color( row, column, hsv ); - } - } - #ifdef USE_KEYMAPS_IN_EEPROM - keymap_default_save(); - #endif - // Save the magic number last, in case saving was interrupted - eeprom_set_valid(true); - }*/ - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - //backlight_set_indicator_state(usb_led); -} \ No newline at end of file diff --git a/keyboards/hs60/v2/v2.h b/keyboards/hs60/v2/v2.h index 86aeb68a74b..da32c3026a8 100644 --- a/keyboards/hs60/v2/v2.h +++ b/keyboards/hs60/v2/v2.h @@ -13,12 +13,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef HS60_H -#define HS60_H +#pragma once #define XXX KC_NO #include "quantum.h" +#include "../../wilba_tech/wt_rgb_backlight_keycodes.h" +#include "../../wilba_tech/via_keycodes.h" // This a shortcut to help you visually see your layout. @@ -63,5 +64,3 @@ { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, XXX, K4B, K4C, K4D } \ } - -#endif \ No newline at end of file diff --git a/keyboards/idb_60/config.h b/keyboards/idb_60/config.h new file mode 100644 index 00000000000..b85eb14af9c --- /dev/null +++ b/keyboards/idb_60/config.h @@ -0,0 +1,170 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6060 // 24672 +#define PRODUCT_ID 0x6060 // 24672 +#define DEVICE_VER 0x0001 +#define MANUFACTURER pngu +#define PRODUCT idb 60 +#define DESCRIPTION QMK keyboard firmware for idb 60 + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C2, D0, D1, D2, D3, D4, D5, D6, B0, B1 } +#define MATRIX_COL_PINS { B2, B3, B4, C6, B6, B7, C7, B5 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 675 // **** CHANGE THIS BASED ON MATRIX_ROWS & MATRIX_COLS **** +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 349 // **** CHANGE THIS BASED ON 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR **** +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/idb_60/idb_60.c b/keyboards/idb_60/idb_60.c new file mode 100644 index 00000000000..d280f644b5c --- /dev/null +++ b/keyboards/idb_60/idb_60.c @@ -0,0 +1,23 @@ +#include "idb_60.h" + +extern inline void _idb_60_caps_led_on(void); +extern inline void _idb_60_esc_led_on(void); + +extern inline void _idb_60_caps_led_off(void); +extern inline void _idb_60_esc_led_off(void); + +void keyboard_pre_init_kb(void) { + setPinOutput(C4); + setPinOutput(C5); +} + +void led_set_kb(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + _idb_60_caps_led_on(); + } else { + _idb_60_caps_led_off(); + } + + led_set_user(usb_led); +} diff --git a/keyboards/idb_60/idb_60.h b/keyboards/idb_60/idb_60.h new file mode 100644 index 00000000000..e9045f66420 --- /dev/null +++ b/keyboards/idb_60/idb_60.h @@ -0,0 +1,38 @@ +#pragma once + +#include "quantum.h" + +inline void _idb_60_caps_led_on(void) { + writePinLow(C5); +} + +inline void _idb_60_esc_led_on(void) { + writePinLow(C4); +} + +inline void _idb_60_caps_led_off(void) { + writePinLow(C5); +} + +inline void _idb_60_esc_led_off(void) { + writePinLow(C4); +} + +#define LAYOUT( \ + K00, K10, K01, K11, K02, K12, K03, K13, K04, K14, K05, K15, K06, K16, K07,\ + K20, K30, K21, K31, K22, K32, K23, K33, K24, K34, K25, K35, K26, K36,\ + K40, K50, K41, K51, K42, K52, K43, K53, K44, K54, K45, K55, K56,\ + K60, K70, K61, K71, K62, K72, K63, K73, K64, K74, K65, K75, K66, K76,\ + K80, K90, K81, K93, K95, K86, K96\ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16 }, \ + { K20, K21, K22, K23, K24, K25, K26 }, \ + { K30, K31, K32, K33, K34, K35, K36 }, \ + { K40, K41, K42, K43, K44, K45, KC_NO }, \ + { K50, K51, K52, K53, K54, K55, K56 }, \ + { K60, K61, K62, K63, K64, K65, K66 }, \ + { K70, K71, K72, K73, K74, K75, K76 }, \ + { K80, K81, KC_NO, KC_NO, KC_NO, KC_NO, K86 }, \ + { K90, KC_NO, KC_NO, K93, KC_NO, K95, K96 } \ +} diff --git a/keyboards/idb_60/info.json b/keyboards/idb_60/info.json new file mode 100644 index 00000000000..9bbe580bf1f --- /dev/null +++ b/keyboards/idb_60/info.json @@ -0,0 +1,76 @@ +{ + "keyboard_name": "idb_60", + "url": "https://idb-keyboards.xyz/60", + "maintainer": "pngu", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc","x":0,"y":0}, + {"label":"!\n1","x":1,"y":0}, + {"label":"@\n2","x":2,"y":0}, + {"label":"#\n3","x":3,"y":0}, + {"label":"$\n4","x":4,"y":0}, + {"label":"%\n5","x":5,"y":0}, + {"label":"^\n6","x":6,"y":0}, + {"label":"&\n7","x":7,"y":0}, + {"label":"*\n8","x":8,"y":0}, + {"label":"(\n9","x":9,"y":0}, + {"label":")\n0","x":10,"y":0}, + {"label":"_\n-","x":11,"y":0}, + {"label":"+\n=","x":12,"y":0}, + {"label":"BS","x":13,"y":0}, + {"label":"~\n`","x":14,"y":0}, + {"label":"Tab","x":0,"y":1,"w":1.5}, + {"label":"Q","x":1.5,"y":1}, + {"label":"W","x":2.5,"y":1}, + {"label":"E","x":3.5,"y":1}, + {"label":"R","x":4.5,"y":1}, + {"label":"T","x":5.5,"y":1}, + {"label":"Y","x":6.5,"y":1}, + {"label":"U","x":7.5,"y":1}, + {"label":"I","x":8.5,"y":1}, + {"label":"O","x":9.5,"y":1}, + {"label":"P","x":10.5,"y":1}, + {"label":"{\n[","x":11.5,"y":1}, + {"label":"}\n]","x":12.5,"y":1}, + {"label":"|\n\\","x":13.5,"y":1,"w":1.5}, + {"label":"Caps Lock","x":0,"y":2,"w":1.75}, + {"label":"A","x":1.75,"y":2}, + {"label":"S","x":2.75,"y":2}, + {"label":"D","x":3.75,"y":2}, + {"label":"F","x":4.75,"y":2}, + {"label":"G","x":5.75,"y":2}, + {"label":"H","x":6.75,"y":2}, + {"label":"J","x":7.75,"y":2}, + {"label":"K","x":8.75,"y":2}, + {"label":"L","x":9.75,"y":2}, + {"label":":\n;","x":10.75,"y":2}, + {"label":"\"\n'","x":11.75,"y":2}, + {"label":"Enter","x":12.75,"y":2,"w":2.25}, + {"label":"Shift","x":0,"y":3,"w":1.25}, + {"label":">\n<\n\n|","x":1.25,"y":3}, + {"label":"Z","x":2.25,"y":3}, + {"label":"X","x":3.25,"y":3}, + {"label":"C","x":4.25,"y":3}, + {"label":"V","x":5.25,"y":3}, + {"label":"B","x":6.25,"y":3}, + {"label":"N","x":7.25,"y":3}, + {"label":"M","x":8.25,"y":3}, + {"label":"<\n,","x":9.25,"y":3}, + {"label":">\n.","x":10.25,"y":3}, + {"label":"?\n/","x":11.25,"y":3}, + {"label":"Shift","x":12.25,"y":3,"w":1.75}, + {"label":"Fn","x":14,"y":3}, + {"label":"Ctrl","x":0,"y":4,"w":1.5}, + {"label":"Win","x":1.5,"y":4}, + {"label":"Alt","x":2.5,"y":4,"w":1.5}, + {"label":"","x":4,"y":4,"w":7}, + {"label":"Alt","x":11,"y":4,"w":1.5}, + {"label":"Win","x":12.5,"y":4}, + {"label":"Ctrl","x":13.5,"y":4,"w":1.5} + ] + } + } +} diff --git a/keyboards/idb_60/keymaps/default/keymap.c b/keyboards/idb_60/keymaps/default/keymap.c new file mode 100644 index 00000000000..48c99877497 --- /dev/null +++ b/keyboards/idb_60/keymaps/default/keymap.c @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NO, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_MENU, KC_RCTL + ), + [1] = LAYOUT( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +// Layer LED indicators + +layer_state_t layer_state_set_user(layer_state_t state) { + if (layer_state_cmp(state, 1)) { + _idb_60_esc_led_on(); + } else { + _idb_60_esc_led_off(); + } + + return state; +} \ No newline at end of file diff --git a/keyboards/idb_60/keymaps/pngu/keymap.c b/keyboards/idb_60/keymaps/pngu/keymap.c new file mode 100644 index 00000000000..de336e5fa4d --- /dev/null +++ b/keyboards/idb_60/keymaps/pngu/keymap.c @@ -0,0 +1,39 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NO, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + LT(2, KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_MENU, MO(1) + ), + [1] = LAYOUT( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ), + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +// Layer LED indicators + +layer_state_t layer_state_set_user(layer_state_t state) { + if (layer_state_cmp(state, 1)) { + _idb_60_esc_led_on(); + } else { + _idb_60_esc_led_off(); + } + + return state; +} \ No newline at end of file diff --git a/keyboards/idb_60/readme.md b/keyboards/idb_60/readme.md new file mode 100644 index 00000000000..e6ed6822b6e --- /dev/null +++ b/keyboards/idb_60/readme.md @@ -0,0 +1,17 @@ +# idb 60 PCB + +Firmware for the idb 60 PCB + +Keyboard Maintainer: [/u/omgitspngu](https://github.com/itspngu) +Hardware Supported: idb 60 PCB +Hardware Availability: [/u/omgitspngu](https://www.reddit.com/user/omgitspngu/) + +Make example for this keyboard (after setting up your build environment): + + make idb_60:default + +Or to make and flash: + + make idb_60:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/idb_60/rules.mk b/keyboards/idb_60/rules.mk new file mode 100644 index 00000000000..b5c9413470d --- /dev/null +++ b/keyboards/idb_60/rules.mk @@ -0,0 +1,65 @@ +# MCU name +MCU = atmega32u2 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu + + +# Build Options +# comment out to disable the options. +# +# BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# CONSOLE_ENABLE = yes # Console for debug(+400) +# COMMAND_ENABLE = yes # Commands for debug and configuration +# KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +# MIDI_ENABLE = YES # MIDI controls +# UNICODE_ENABLE = YES # Unicode +# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID \ No newline at end of file diff --git a/keyboards/idobo/config.h b/keyboards/idobo/config.h new file mode 100644 index 00000000000..e1c08afae16 --- /dev/null +++ b/keyboards/idobo/config.h @@ -0,0 +1,222 @@ +/* +Copyright 2018 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT idobo +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B3, C7, B6, C6 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, E6, D5, D3, D2, D1, D0, D4, D6, D7, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/idobo/idobo.c b/keyboards/idobo/idobo.c new file mode 100644 index 00000000000..3f870835ed8 --- /dev/null +++ b/keyboards/idobo/idobo.c @@ -0,0 +1,43 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "idobo.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/idobo/idobo.h b/keyboards/idobo/idobo.h new file mode 100644 index 00000000000..386fcee1a94 --- /dev/null +++ b/keyboards/idobo/idobo.h @@ -0,0 +1,44 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef IDOBO_H +#define IDOBO_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_5x15( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ +} + +#endif diff --git a/keyboards/idobo/info.json b/keyboards/idobo/info.json new file mode 100644 index 00000000000..69c5e4e063d --- /dev/null +++ b/keyboards/idobo/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "IDOBO", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x15": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}] + } + } +} diff --git a/keyboards/idobo/keymaps/default/config.h b/keyboards/idobo/keymaps/default/config.h new file mode 100644 index 00000000000..a3ed4f762a6 --- /dev/null +++ b/keyboards/idobo/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/idobo/keymaps/default/keymap.c b/keyboards/idobo/keymaps/default/keymap.c new file mode 100644 index 00000000000..f54e3359bb2 --- /dev/null +++ b/keyboards/idobo/keymaps/default/keymap.c @@ -0,0 +1,66 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_5x15( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/idobo/keymaps/default/readme.md b/keyboards/idobo/keymaps/default/readme.md new file mode 100644 index 00000000000..577c62b51f8 --- /dev/null +++ b/keyboards/idobo/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for idobo diff --git a/keyboards/idobo/keymaps/default75/config.h b/keyboards/idobo/keymaps/default75/config.h new file mode 100644 index 00000000000..17c7addb385 --- /dev/null +++ b/keyboards/idobo/keymaps/default75/config.h @@ -0,0 +1,21 @@ +/* Copyright 2017 Benjamin Kesselring + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + + +// place overrides here + diff --git a/keyboards/idobo/keymaps/default75/keymap.c b/keyboards/idobo/keymaps/default75/keymap.c new file mode 100644 index 00000000000..d607e11f668 --- /dev/null +++ b/keyboards/idobo/keymaps/default75/keymap.c @@ -0,0 +1,67 @@ +/* Copyright 2018 Milton Griffin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Keyboard Layers +#define _QW 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | [ | \ | ] | Y | U | I | O | P | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | HOME | DEL | PG UP | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | END | UP | PG DN | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | LGUI | LALT | FN | SPACE | SPACE | LEFT | DOWN | RIGHT | SPACE | SPACE | FN | RALT | RGUI | RCTRL | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_5x15( /* QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL \ + ), + +/* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | NUM LK | P/ | P* | F7 | F8 | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SELECT | CALC | MYCOMP | MAIL | RGB HD | RGB HI | P7 | P8 | P9 | - | | | PR SCR | SCR LK | PAUSE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | PREV | PLAY | NEXT | STOP | RGB SD | RGB SI | P4 | P5 | P6 | + | | RESET | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | VOL- | MUTE | VOL+ | APP | RGB VD | RGB VI | P1 | P2 | P3 | PENT | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT_ortho_5x15( /* FUNCTION */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_MSEL, KC_CALC, KC_MYCM, KC_MAIL, RGB_HUD, RGB_HUI, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, RGB_SAD, RGB_SAI, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______, \ + KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, RGB_VAD, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, \ + _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ \ + ), +}; diff --git a/keyboards/idobo/keymaps/default75/readme.md b/keyboards/idobo/keymaps/default75/readme.md new file mode 100644 index 00000000000..a1c0236ed9c --- /dev/null +++ b/keyboards/idobo/keymaps/default75/readme.md @@ -0,0 +1 @@ +# The default keymap for xd75, with led controls \ No newline at end of file diff --git a/keyboards/idobo/keymaps/default75/rules.mk b/keyboards/idobo/keymaps/default75/rules.mk new file mode 100644 index 00000000000..7efceba50a8 --- /dev/null +++ b/keyboards/idobo/keymaps/default75/rules.mk @@ -0,0 +1,14 @@ +# Copyright 2013 Jun Wako +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . diff --git a/keyboards/idobo/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json b/keyboards/idobo/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json new file mode 100644 index 00000000000..19c0780463d --- /dev/null +++ b/keyboards/idobo/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json @@ -0,0 +1,190 @@ +[ + { + "name": "gsm-idobo", + "notes": "Massdrop xd75\n\nFront Legend = \"Adust\" layer (both lower and Raise)" + }, + [ + { + "a": 3 + }, + "Esc\n\n\n\nreset", + { + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "\nF1\n\n\n\n\n\n\n\n1 !", + "\nF2\n\n\n\n\n\n\n\n2 @", + "\nF3\n\n\n\n\n\n\n\n3 #", + "\nF4\n\n\n\n\n\n\n\n4 $", + "\nF5\n\n\n\n\n\n\n\n5 %", + { + "t": "#000000", + "a": 7 + }, + "= +", + "", + "- _", + { + "t": "#0000ff\n#ff0000", + "a": 0 + }, + "\nF6\n\n\nrgbplain\n\n\n\n\n6 ^", + "\nF7\n\n\nrgbtest\n\n\n\n\n7 &", + "\nF8\n\n\nrgbmode\n\n\n\n\n8 *", + { + "a": 4 + }, + "\nF9\n\n\n\n\n\n\n\n9 (", + "\nF10\n\n\n\n\n\n\n\n0 )", + { + "t": "#000000", + "a": 7 + }, + "Bksp" + ], + [ + "Tab", + "Q", + { + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "PgUp\nUP\n\n\n\n\n\n\n\nW", + { + "t": "#000000", + "a": 7 + }, + "E", + { + "a": 3 + }, + "R\n\n\n\nrgb_tog", + "T\n\n\n\nbl_tog", + { + "a": 7 + }, + "", + "", + "[ {", + "T", + "Y", + "I", + "O", + "P", + "]" + ], + [ + { + "c": "#0000ff", + "t": "#ffffff" + }, + "Raise", + { + "c": "#cccccc", + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "Home\nLEFT\n\n\n\n\n\n\n\nA", + { + "a": 0 + }, + "PgDwn\nDOWN\n\n\nrgb_hai\n\n\n\n\nS", + "End\nRIGHT\n\n\nrgb_sai\n\n\n\n\nD", + { + "t": "#000000", + "a": 3 + }, + "F\n\n\n\nrgb_vai", + "G\n\n\n\nbl_inc", + { + "a": 7 + }, + "", + "UP", + "PrtScr", + "H", + "J", + "K", + "L", + "; :", + "' \"" + ], + [ + { + "a": 3 + }, + "Shift\n\n\n\neep_rst", + { + "a": 7 + }, + "Z", + { + "a": 3 + }, + "X\n\n\n\nrgb_hud", + "C\n\n\n\nrgb_sad", + "V\n\n\n\nrgb_vad", + "B\n\n\n\nbl_dec", + { + "a": 7 + }, + "LEFT", + "DOWN", + "RIGHT", + "N", + "M", + ", <", + ". >", + "/ ?", + { + "a": 6 + }, + "Shift" + ], + [ + { + "a": 7 + }, + "` ~", + "\\ |", + "Alt", + "Ctrl", + { + "c": "#ff0000" + }, + "Lower", + { + "c": "#eb7c15" + }, + "Space", + { + "c": "#cccccc", + "t": "#0000ff\n#ff0000", + "a": 4 + }, + "\nApp\n\n\n\n\n\n\n\nOS", + { + "t": "#000000", + "a": 7 + }, + "Del", + "Enter", + { + "c": "#eb7c15" + }, + "Space", + { + "c": "#0000ff", + "t": "#ffffff" + }, + "Raise", + { + "c": "#cccccc", + "t": "#000000" + }, + "Left", + "Down", + "Up", + "Right" + ] +] \ No newline at end of file diff --git a/keyboards/idobo/keymaps/greenshadowmaker/keymap.c b/keyboards/idobo/keymaps/greenshadowmaker/keymap.c new file mode 100644 index 00000000000..d23bc7c7dfc --- /dev/null +++ b/keyboards/idobo/keymaps/greenshadowmaker/keymap.c @@ -0,0 +1,140 @@ +#include QMK_KEYBOARD_H + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, +}; + +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | = | | - | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | | | [ | Y | U | I | O | P | ] | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | RAISE | A | S | D | F | G | | UP | PrtScr | H | J | K | L | ; | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | LEFT | DOWN | RIGHT | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | ` | \ | LALT | LCTRL | LOWER | SPACE | LGUI | DEL | ENTER | SPACE | RAISE | LEFT | DOWN | UP | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_5x15( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, XXXXXXX, KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, + RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, KC_UP, KC_PSCR, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LEFT, KC_DOWN, KC_RGHT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_GRAVE, KC_BSLS, KC_LALT, KC_LCTL, LOWER, KC_SPC, KC_LGUI, KC_DEL, KC_ENT, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + +/* LOWER + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | UP | | | | | | | | | | PR SCR | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RAISE | LEFT | DOWN | RIGHT | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | LOWER | | APP | | | | RAISE | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_5x15( + XXXXXXX, KC_F1, KC_F2, KC_F3, XXXXXXX, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, + XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RAISE, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, KC_APP, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + + /* RAISE + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | pgup | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RAISE | home | pgdn | end | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | LOWER | | | | | | RAISE | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_5x15( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RAISE, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + + + /* ADJUST + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | RESET | | | | | | | | |rgbplain|rgbtest | rgbmode| | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | |rgb tog | bl_tog | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RAISE | | rgb hi | rgb sai|rgb vai | bl inc | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | EEP Rst| | rgb hd | rgb sad|rgb vad | bl dec | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | LOWER | | | | | | RAISE | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_5x15( + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_P, RGB_M_T, RGB_MOD, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, BL_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RAISE, XXXXXXX, RGB_HUI, RGB_SAI, RGB_VAI, BL_INC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + EEP_RST, XXXXXXX, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/idobo/keymaps/greenshadowmaker/readme.md b/keyboards/idobo/keymaps/greenshadowmaker/readme.md new file mode 100644 index 00000000000..7b6f654c71f --- /dev/null +++ b/keyboards/idobo/keymaps/greenshadowmaker/readme.md @@ -0,0 +1,5 @@ +# GreenShadowMaker keymap for idobo + +make idobo:greenshadowmaker:dfu + +Note: keyboard-layout-editor-gsm-idobo.json shoudl be the matching layout for http://www.keyboard-layout-editor.com diff --git a/keyboards/idobo/keymaps/greenshadowmaker/rules.mk b/keyboards/idobo/keymaps/greenshadowmaker/rules.mk new file mode 100644 index 00000000000..f6587a835e3 --- /dev/null +++ b/keyboards/idobo/keymaps/greenshadowmaker/rules.mk @@ -0,0 +1,3 @@ +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +COMMAND_ENABLE = no # Commands for debug and configuration +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow diff --git a/keyboards/idobo/keymaps/revok75/config.h b/keyboards/idobo/keymaps/revok75/config.h new file mode 100644 index 00000000000..f5c4659880a --- /dev/null +++ b/keyboards/idobo/keymaps/revok75/config.h @@ -0,0 +1,15 @@ +/* Copyright 2017 Benjamin Kesselring + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ diff --git a/keyboards/idobo/keymaps/revok75/keymap.c b/keyboards/idobo/keymaps/revok75/keymap.c new file mode 100644 index 00000000000..a3802403263 --- /dev/null +++ b/keyboards/idobo/keymaps/revok75/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2017 Wunder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW_M 0 +#define _QW_W 1 +#define _FN 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY-Mac + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | % | 6 | 7 | 8 | 9 | 0 | - | = | Cut | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | Copy | Paste | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | \ | RSHIFT| UP | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | ALFRED | FN-MO | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW_M] = LAYOUT_ortho_5x15( /* QWERTY MAC*/ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, LGUI(KC_X), KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCBR, KC_RCBR, LGUI(KC_C), LGUI(KC_V), \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LGUI(KC_R), KC_NO, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_RSFT, KC_UP, LGUI(KC_S), \ + KC_LCTL, KC_LALT, KC_LGUI, LGUI(KC_F), LGUI(KC_T), KC_SPC, KC_NO, LALT(KC_SPACE), MO(_FN), KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* QWERTY-Win + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | % | 6 | 7 | 8 | 9 | 0 | - | = | Cut | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | Copy | Paste | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | \ | RSHIFT | UP | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | START | FN-MO | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW_W] = LAYOUT_ortho_5x15( /* QWERTY WIN*/ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, LCTL(KC_X), KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCBR, KC_RCBR, LCTL(KC_C), LCTL(KC_V), \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LCTL(KC_R), KC_NO, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_RSFT, KC_UP, LCTL(KC_S), \ + KC_LCTL, KC_LALT, KC_LGUI, LCTL(KC_F), LCTL(KC_T), KC_SPC, KC_NO, LCTL(KC_GESC), MO(_FN), KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | VOLDN | VOLUP | MUTE | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | - | WIN | - | - | RGB_TOG| - | - | OPTION | RESET | - | [ | ] | - | - | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | MAC | RAINBOW| PLAIN | - | - | - | - | - | - | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | INC | DEC | HUE I | HUE D | SAT I | SAT D | - | - | . | / | \ | RSHIFT| HOME | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | ALFRED | FN-MO | RALT | RGUI | RCTRL | PGUP | END | PGDN | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT_ortho_5x15( /* OSLAYOUT + NUMPAD + MEDIA + LIGHTING */ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_VOLD, KC_VOLU, KC_MUTE, KC_DEL, \ + KC_TRNS, KC_NO, DF(_QW_W), KC_NO, KC_NO, RGB_TOG, KC_NO, KC_NO, KC_RALT, RESET, KC_NO, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, \ + KC_TRNS, DF(_QW_M), RGB_MODE_RAINBOW, RGB_MODE_PLAIN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_NO, KC_NO, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_END, KC_PGDN \ + ), +}; diff --git a/keyboards/idobo/keymaps/revok75/readme.md b/keyboards/idobo/keymaps/revok75/readme.md new file mode 100644 index 00000000000..780c5401c45 --- /dev/null +++ b/keyboards/idobo/keymaps/revok75/readme.md @@ -0,0 +1 @@ +# The default keymap for Revok 75 --idobo version diff --git a/keyboards/idobo/keymaps/revok75/rules.mk b/keyboards/idobo/keymaps/revok75/rules.mk new file mode 100644 index 00000000000..7efceba50a8 --- /dev/null +++ b/keyboards/idobo/keymaps/revok75/rules.mk @@ -0,0 +1,14 @@ +# Copyright 2013 Jun Wako +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/config.h b/keyboards/idobo/keymaps/xaceofspaidsx/config.h new file mode 100644 index 00000000000..a3ed4f762a6 --- /dev/null +++ b/keyboards/idobo/keymaps/xaceofspaidsx/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/keymap.c b/keyboards/idobo/keymaps/xaceofspaidsx/keymap.c new file mode 100644 index 00000000000..c157317e2de --- /dev/null +++ b/keyboards/idobo/keymaps/xaceofspaidsx/keymap.c @@ -0,0 +1,67 @@ +/* Copyright 2018 xAceOfSpaidsx + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY - based off xd75 default map with a couple modifications for my preference + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | F2 | ` | F5 | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | - | \ | = | Y | U | I | O | P | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | HOME | DEL | PG UP | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | END | UP | PG DN | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | LGUI | LALT | FN | SPACE | SPACE | LEFT | DOWN | RIGHT | [ | ] | FN | RALT | RGUI | RCTRL | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_5x15( /* QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F2, KC_GRV, KC_F5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_BSLS, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_LBRC, KC_RBRC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL \ + ), + +/* FUNCTION Layer - removed the rgb hue saturation and vibrance for audio controls and added some functionality I use from other boards. + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | NUM LK | P/ | P* | F7 | F8 | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SELECT | CALC | UP | | | NEXT | P7 | P8 | P9 | - | | | PR SCR | SCR LK | PAUSE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | PREV | LEFT | DOWN | RIGHT | DEL | PLAY | P4 | P5 | P6 | + | | RESET | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | VOL- | MUTE | VOL+ | APP | | STOP | P1 | P2 | P3 | PENT | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT_ortho_5x15( /* FUNCTION */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_MSEL, KC_CALC, KC_UP , _______, _______, KC_MNXT, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_MPRV, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL , KC_MPLY, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______, \ + KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, _______, KC_MSTP, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, \ + _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ \ + ), +}; diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/readme.md b/keyboards/idobo/keymaps/xaceofspaidsx/readme.md new file mode 100644 index 00000000000..ac6e74702c0 --- /dev/null +++ b/keyboards/idobo/keymaps/xaceofspaidsx/readme.md @@ -0,0 +1 @@ +# Updated the keymap, based off XD75 default, to meet my needs. Refer to rules.mk to enable or disable rgb and other features. diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/rules.mk b/keyboards/idobo/keymaps/xaceofspaidsx/rules.mk new file mode 100644 index 00000000000..b973e9d8b3d --- /dev/null +++ b/keyboards/idobo/keymaps/xaceofspaidsx/rules.mk @@ -0,0 +1,19 @@ +# Copyright 2013 Jun Wako +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#Had to disable the first 2 to get the firmware size down enough after enabling the rgb controls. +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +COMMAND_ENABLE = no # Commands for debug and configuration +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow diff --git a/keyboards/idobo/readme.md b/keyboards/idobo/readme.md new file mode 100644 index 00000000000..7f2c684464a --- /dev/null +++ b/keyboards/idobo/readme.md @@ -0,0 +1,17 @@ +# IDOBO + +![IDOBO](imgur.com image replace me!) + +75Keys Aluminum Mechanical Keyboard. + +Firmware here originally appeared on qmkeyboard.cn + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: IDOBO PCB +Hardware Availability: [IDOBO on Massdrop](https://www.massdrop.com/buy/xd75-aluminum-mechanical-keyboard) + +Make example for this keyboard (after setting up your build environment): + + make idobo:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/idobo/rules.mk b/keyboards/idobo/rules.mk new file mode 100644 index 00000000000..a5a86cc6a12 --- /dev/null +++ b/keyboards/idobo/rules.mk @@ -0,0 +1,83 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +EXTRAFLAGS += -flto # Use link time optimization + +LAYOUTS = ortho_5x15 diff --git a/keyboards/infinity60/config.h b/keyboards/infinity60/config.h index c1e9ec5b1f2..16272e4279c 100644 --- a/keyboards/infinity60/config.h +++ b/keyboards/infinity60/config.h @@ -39,11 +39,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Keymap for Infinity prototype */ //#define INFINITY_PROTOTYPE diff --git a/keyboards/infinity60/infinity60.h b/keyboards/infinity60/infinity60.h index 21b8eeba2da..a7192104513 100644 --- a/keyboards/infinity60/infinity60.h +++ b/keyboards/infinity60/infinity60.h @@ -14,16 +14,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H +#pragma once #include "quantum.h" -#define LAYOUT_60_ansi_split_bs_rshift KEYMAP - #ifdef INFINITY_PROTOTYPE + /* Infinity prototype */ -#define KEYMAP( \ +#define LAYOUT_60_ansi_split_bs_rshift( \ K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K86, \ K51, K61, K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, \ K13, K23, K33, K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, \ @@ -44,7 +42,7 @@ along with this program. If not, see . #else /* Infinity production */ -#define KEYMAP( \ +#define LAYOUT_60_ansi_split_bs_rshift( \ K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K51, \ K61, K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, K13, \ K23, K33, K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, K54, \ @@ -64,4 +62,3 @@ along with this program. If not, see . #endif -#endif diff --git a/keyboards/infinity60/info.json b/keyboards/infinity60/info.json new file mode 100644 index 00000000000..06df911e5a0 --- /dev/null +++ b/keyboards/infinity60/info.json @@ -0,0 +1,78 @@ +{ + "keyboard_name": "Infinity 60%", + "keyboard_folder": "infinity60", + "url": "https://input.club/devices/infinity-keyboard/", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi_split_bs_rshift": { + "key_count": 63, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"\\", "x":13, "y":0}, + {"label":"`", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Fn", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.5}, + {"label":"GUI", "x":1.5, "y":4}, + {"label":"Alt", "x":2.5, "y":4, "w":1.5}, + {"label":"Space", "x":4, "y":4, "w":6}, + {"label":"Alt", "x":10, "y":4, "w":1.5}, + {"label":"GUI", "x":11.5, "y":4}, + {"label":"Fn", "x":12.5, "y":4}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5} + ] + } + } +} diff --git a/keyboards/infinity60/keymaps/default/keymap.c b/keyboards/infinity60/keymaps/default/keymap.c index 8347c94b485..4882469c003 100644 --- a/keyboards/infinity60/keymaps/default/keymap.c +++ b/keyboards/infinity60/keymaps/default/keymap.c @@ -1,11 +1,11 @@ -#include "infinity60.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Bksp| * |-----------------------------------------------------------| * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | * |-----------------------------------------------------------| @@ -14,7 +14,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [0] = KEYMAP( + [0] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS, KC_GRV, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, \ KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, \ @@ -34,7 +34,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [1] = KEYMAP( + [1] = LAYOUT_60_ansi_split_bs_rshift( KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT, \ @@ -42,10 +42,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), }; -const uint16_t fn_actions[] = { - -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/keyboards/infinity60/keymaps/depariel/keymap.c b/keyboards/infinity60/keymaps/depariel/keymap.c index 57f9487f221..22d74b866bb 100755 --- a/keyboards/infinity60/keymaps/depariel/keymap.c +++ b/keyboards/infinity60/keymaps/depariel/keymap.c @@ -1,4 +1,4 @@ -#include "infinity60.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer @@ -14,7 +14,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Fn2 |Gui |Alt | Space |RAlt|Prv|PlPs|Next| * `-----------------------------------------------------------' */ - [0] = KEYMAP( + [0] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LT(5, KC_ENT), \ @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 1: "Toggle" off SpaceFn for League of Legends */ - [1] = KEYMAP( + [1] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 2: "Toggle" off SpaceFn for MapleRoyals */ - [2] = KEYMAP( + [2] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 3: FN layer 1 */ - [3] = KEYMAP( + [3] = LAYOUT_60_ansi_split_bs_rshift( KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, \ KC_NO, KC_BTN1, KC_MS_U, KC_BTN2, LALT(KC_F4), KC_HOME, KC_PGUP, KC_PSCR, KC_SLCK, KC_UP, KC_NO, KC_LPRN, KC_RPRN, KC_DEL, \ MO(6), KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_END, KC_PGDN, KC_TILD, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, \ @@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 4: FN layer 2 */ - [4] = KEYMAP( + [4] = LAYOUT_60_ansi_split_bs_rshift( KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PMNS, KC_PPLS, KC_PSLS, TG(2), \ KC_CAPS, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_NO, KC_P7, KC_P8, KC_P9, KC_PAST, KC_BSPC, \ KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P4, KC_P5, KC_P6, KC_PENT, \ @@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 5: FN layer 3 */ - [5] = KEYMAP( + [5] = LAYOUT_60_ansi_split_bs_rshift( KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_TAB , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F13, KC_F14, KC_F15, KC_F16, KC_NO, KC_TRNS, \ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F17, KC_F18, KC_F19, KC_F20, LT(5, KC_ENT), \ @@ -68,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 6: FN layer 4 */ - [6] = KEYMAP( + [6] = LAYOUT_60_ansi_split_bs_rshift( KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ LCTL(LSFT(KC_TAB)), KC_NO, LGUI(KC_UP), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ MO(6), LGUI(KC_LEFT), LGUI(KC_DOWN), LGUI(KC_RGHT), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ @@ -76,10 +76,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/keyboards/infinity60/keymaps/hasu/keymap.c b/keyboards/infinity60/keymaps/hasu/keymap.c index 9982078c19d..51def265691 100644 --- a/keyboards/infinity60/keymaps/hasu/keymap.c +++ b/keyboards/infinity60/keymaps/hasu/keymap.c @@ -1,4 +1,4 @@ -#include "infinity60.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer @@ -14,7 +14,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [0] = KEYMAP( + [0] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_GRV, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_SCLN), KC_QUOT,MT(KC_RCTL, KC_ENT), \ @@ -34,7 +34,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [1] = KEYMAP( + [1] = LAYOUT_60_ansi_split_bs_rshift( KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS,KC_BSPC, \ KC_LCTL,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_ENT, \ @@ -54,7 +54,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Gui|Alt | Space |Alt |Gui| * `-------------------------------------------' */ - [2] = KEYMAP( + [2] = LAYOUT_60_ansi_split_bs_rshift( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ KC_TAB, KC_HOME,KC_PGDN,KC_UP, KC_PGUP,KC_END, KC_HOME,KC_PGDN,KC_PGUP,KC_END, KC_NO, KC_NO, KC_NO, KC_BSPC, \ KC_LCTL,KC_NO, KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_NO, KC_NO, KC_ENT, \ @@ -75,7 +75,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------------------------------' * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel */ - [3] = KEYMAP( + [3] = LAYOUT_60_ansi_split_bs_rshift( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ LALT(KC_TAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_MS_U, KC_WH_U, KC_WH_R, ALT_T(KC_LEFT), ALT_T(KC_RGHT),LALT(KC_TAB), \ KC_LCTL, KC_ACL0,KC_ACL1,KC_ACL2,KC_ACL2,KC_NO, KC_NO, KC_MS_L,KC_MS_D, KC_MS_R, LT(3, KC_SCLN), KC_NO, KC_ENT, \ @@ -96,7 +96,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------------------------------' * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel */ - [4] = KEYMAP( + [4] = LAYOUT_60_ansi_split_bs_rshift( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ LALT(KC_TAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_MS_U, KC_WH_U, KC_WH_R,KC_BTN4,KC_BTN5,LALT(KC_TAB), \ KC_LCTL, KC_VOLD,KC_VOLU,KC_MUTE,KC_NO, KC_NO, KC_NO, KC_MS_L,KC_MS_D, KC_MS_R, KC_BTN1,KC_NO, KC_ENT, \ @@ -105,13 +105,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -/* - * Fn action definition - */ -const uint16_t fn_actions[] = { - -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/keyboards/infinity60/keymaps/jpetermans/config.h b/keyboards/infinity60/keymaps/jpetermans/config.h index 72a2ed0810f..1949a9ad9d7 100644 --- a/keyboards/infinity60/keymaps/jpetermans/config.h +++ b/keyboards/infinity60/keymaps/jpetermans/config.h @@ -1,11 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - - -#include "../../config.h" +#pragma once //overrides #undef TAPPING_TOGGLE #define TAPPING_TOGGLE 2 -#endif diff --git a/keyboards/infinity60/keymaps/jpetermans/keymap.c b/keyboards/infinity60/keymaps/jpetermans/keymap.c index 59249ff7284..c99b05e4c5c 100644 --- a/keyboards/infinity60/keymaps/jpetermans/keymap.c +++ b/keyboards/infinity60/keymaps/jpetermans/keymap.c @@ -1,9 +1,6 @@ -#include "infinity60.h" +#include QMK_KEYBOARD_H #include "led_controller.h" -//Helpful Defines -#define _______ KC_TRNS - //Define Layer Names #define _BASE 0 #define _NUMPAD 1 @@ -54,7 +51,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ /* default */ - [_BASE] = KEYMAP( \ + [_BASE] = LAYOUT_60_ansi_split_bs_rshift( \ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_NO,\ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, \ TT(_FNAV), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, \ @@ -63,7 +60,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* numpad */ - [_NUMPAD] = KEYMAP( \ + [_NUMPAD] = LAYOUT_60_ansi_split_bs_rshift( \ _______,_______,_______,_______,_______,_______,_______, KC_P7, KC_P8, KC_P9, KC_PSLS, _______,_______,_______,KC_NO,\ _______,_______,_______,_______,_______,_______,_______, KC_P4, KC_P5, KC_P6, KC_PAST, _______,_______,_______, \ MO(_FNAV),_______,_______,_______,_______,_______,_______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______,_______, \ @@ -72,7 +69,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* F-, arrow, and media keys */ - [_FNAV] = KEYMAP( \ + [_FNAV] = LAYOUT_60_ansi_split_bs_rshift( \ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_NO,\ KC_CAPS,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,_______,_______,KC_DEL, \ _______,_______,KC_BTN2,_______,_______,_______,KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_INS,_______,_______, \ @@ -81,7 +78,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* media */ - [_MEDIA] = KEYMAP( \ + [_MEDIA] = LAYOUT_60_ansi_split_bs_rshift( \ _______,F(MODE_SINGLE),F(MODE_PAGE),F(MODE_FLASH),_______,_______,_______, _______, _______, _______,KC_MUTE, KC_VOLD, KC_VOLU,_______,KC_NO,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,\ _______,_______,_______,_______,_______,F(GAME),_______, _______, _______, _______,_______, _______,_______, \ @@ -89,7 +86,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______, KC_MPLY, _______,_______, _______,_______ \ ), /* ~ */ - [_TILDE] = KEYMAP( \ + [_TILDE] = LAYOUT_60_ansi_split_bs_rshift( \ KC_GRV,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,KC_NO,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______, \ @@ -97,7 +94,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______, _______, _______,_______, _______,_______ \ ), /* template */ - [5] = KEYMAP( \ + [5] = LAYOUT_60_ansi_split_bs_rshift( \ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,KC_NO,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______, \ diff --git a/keyboards/infinity60/keymaps/jpetermans/rules.mk b/keyboards/infinity60/keymaps/jpetermans/rules.mk deleted file mode 100644 index df3d1e952fc..00000000000 --- a/keyboards/infinity60/keymaps/jpetermans/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/infinity60/matrix.c b/keyboards/infinity60/matrix.c index bf86591ccf8..ba16e690062 100644 --- a/keyboards/infinity60/matrix.c +++ b/keyboards/infinity60/matrix.c @@ -177,3 +177,22 @@ void matrix_print(void) xprintf("\n"); } } + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + diff --git a/keyboards/infinity60/readme.md b/keyboards/infinity60/readme.md index e77abca6427..01f3a8a2ff5 100644 --- a/keyboards/infinity60/readme.md +++ b/keyboards/infinity60/readme.md @@ -11,4 +11,5 @@ Make example for this keyboard (after setting up your build environment): make infinity60:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + diff --git a/keyboards/infinity60/rules.mk b/keyboards/infinity60/rules.mk index 8cb2b375595..1f02e05c84c 100644 --- a/keyboards/infinity60/rules.mk +++ b/keyboards/infinity60/rules.mk @@ -58,6 +58,7 @@ OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 # DFU_ARGS = -d 1c11:b007 +DFU_SUFFIX_ARGS = -p b007 -v 1c11 BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration ## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) diff --git a/keyboards/iris/info.json b/keyboards/iris/info.json deleted file mode 100644 index f7b017b97ac..00000000000 --- a/keyboards/iris/info.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "keyboard_name": "Iris", - "url": "https://keeb.io", - "maintainer": "Keebio", - "width": 14.5, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [ - {"x":0, "y":0.375}, {"x":1, "y":0.375}, {"x":2, "y":0.125}, {"x":3, "y":0}, {"x":4, "y":0.125}, {"x":5, "y":0.25}, - {"x":9, "y":0.25}, {"x":10, "y":0.125}, {"x":11, "y":0}, {"x":12, "y":0.125}, {"x":13, "y":0.375}, {"x":14, "y":0.375}, - {"x":0, "y":1.375}, {"x":1, "y":1.375}, {"x":2, "y":1.125}, {"x":3, "y":1}, {"x":4, "y":1.125}, {"x":5, "y":1.25}, - {"x":9, "y":1.25}, {"x":10, "y":1.125}, {"x":11, "y":1}, {"x":12, "y":1.125}, {"x":13, "y":1.375}, {"x":14, "y":1.375}, - {"x":0, "y":2.375}, {"x":1, "y":2.375}, {"x":2, "y":2.125}, {"x":3, "y":2}, {"x":4, "y":2.125}, {"x":5, "y":2.25}, - {"x":9, "y":2.25}, {"x":10, "y":2.125}, {"x":11, "y":2}, {"x":12, "y":2.125}, {"x":13, "y":2.375}, {"x":14, "y":2.375}, - {"x":0, "y":3.375}, {"x":1, "y":3.375}, {"x":2, "y":3.125}, {"x":3, "y":3}, {"x":4, "y":3.125}, {"x":5, "y":3.25}, - {"x":6.15, "y":3.75}, {"x":7.85, "y":3.75}, - {"x":9, "y":3.25}, {"x":10, "y":3.125}, {"x":11, "y":3}, {"x":12, "y":3.125}, {"x":13, "y":3.375}, {"x":14, "y":3.375}, - {"x":3.5, "y":4.25}, {"x":4.5, "y":4.375}, {"x":5.6, "y":4.75}, {"x":8.4, "y":4.75}, {"x":9.5, "y":4.375}, {"x":10.5, "y":4.25} - ] - } - } -} diff --git a/keyboards/iris/iris.h b/keyboards/iris/iris.h deleted file mode 100644 index afad9a0d6db..00000000000 --- a/keyboards/iris/iris.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#ifdef KEYBOARD_iris_rev1 - #include "rev1.h" -#elif KEYBOARD_iris_rev1_led - #include "rev1_led.h" -#elif KEYBOARD_iris_rev2 - #include "rev2.h" -#else - #include "rev3.h" -#endif - -#include "quantum.h" - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, LT4, RT4, R30, R31, R32, R33, R34, R35, \ - LT1, LT2, LT3, RT3, RT2, RT1 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##LT4, KC_##RT4, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ - KC_##LT1, KC_##LT2, KC_##LT3, KC_##RT3, KC_##RT2, KC_##RT1 \ - ) diff --git a/keyboards/iris/keymaps/broswen/keymap.c b/keyboards/iris/keymaps/broswen/keymap.c deleted file mode 100644 index 6d783142e40..00000000000 --- a/keyboards/iris/keymaps/broswen/keymap.c +++ /dev/null @@ -1,126 +0,0 @@ -#include QMK_KEYBOARD_H - - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_BL_S BL_STEP -#define KC_DBUG DEBUG - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , DEL, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,LBRC, RBRC , N , M ,COMM,DOT ,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LALT,LGUI,SPC, ENT ,LOWR,RASE - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , ,PGDN,PGUP, , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,TILD,PIPE,MINS,PLUS, , LEFT,DOWN, UP ,RGHT, , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , GRV,BSLS,UNDS, EQL, , , , , , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , ,F12 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , MUTE,VOLD,VOLU, , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT( - //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. - AU_TOG, CK_UP, CK_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' - _______, _______, _______, _______, _______, _______ - // `--------+--------+--------' `--------+--------+--------' - ) - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // case QWERTY: - // if (record->event.pressed) { - // persistent_default_layer_set(1UL<<_QWERTY); - // } - // return false; - // break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/davidrambo/config.h b/keyboards/iris/keymaps/davidrambo/config.h deleted file mode 100644 index 2cdff4213ba..00000000000 --- a/keyboards/iris/keymaps/davidrambo/config.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ -#define PERMISSIVE_HOLD -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS -/* -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -*/ -#define TAPPING_TERM 200 -#include "../../config.h" - -#endif diff --git a/keyboards/iris/keymaps/davidrambo/keymap.c b/keyboards/iris/keymaps/davidrambo/keymap.c deleted file mode 100644 index 40f0d014540..00000000000 --- a/keyboards/iris/keymaps/davidrambo/keymap.c +++ /dev/null @@ -1,158 +0,0 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -//keycode shorthands -#define KC____ KC_TRNS // three underscores "___" for transparent -#define KC_SYM MO(3) -#define KC_MAC TO(0) -#define KC_PC TO(1) -#define KC_GM TO(2) -#define KC_NAVMAC LT(4, KC_TAB) -#define KC_NAVPC LT(5, KC_TAB) - -//text editor shortcuts for NAV and NAVPC -#define KC_AL LALT(KC_LEFT) -#define KC_AR LALT(KC_RGHT) -#define KC_CL LCTL(KC_LEFT) -#define KC_CR LCTL(KC_RGHT) -#define KC_ABSPC LALT(KC_BSPC) -#define KC_CBSPC LCTL(KC_BSPC) - -//internet browser tab shortcuts and window swapping for Mac and Windows -#define KC_GSL LGUI(S(KC_LEFT)) -#define KC_GSR LGUI(S(KC_RGHT)) -#define KC_CPGD LCTL(KC_PGDN) -#define KC_CPGU LCTL(KC_PGUP) - -#define KC_CMBS GUI_T(KC_BSPC) -#define KC_CTBS CTL_T(KC_BSPC) -#define KC_C_TAB LCTL(KC_TAB) -#define KC_G_TAB LGUI(KC_TAB) -#define KC_A_TAB LALT(KC_TAB) - -//layer shorthands -#define _COLEMAK 0 -#define _PC 1 -#define _GAME 2 -#define _SYMBOL 3 -#define _NAVMAC 4 -#define _NAVPC 5 - -enum { -// SFT_LCK //tapdance declarations - COLEMAK = 0, - PC, - GAME, - SYMBOL, - NAV, //Navigation layer for Mac Colemak - NAVPC, //Navigation layer for PC Colemak - SFT_LCK //tapdance declaration -}; - -#define KC_SFLK TD(SFT_LCK) // alias for tapdance - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_COLEMAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - GRV , Q , W , F , P , G , J , L , U , Y ,SCLN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - NAVMAC, A , R , S , T , D , H , N , E , I , O ,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - SFLK, Z , X , C , V , B , PC , ENT , K , M ,COMM, DOT,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LCTL,LGUI,CMBS, SPC, SYM, LALT - // `----+----+----' `----+----+----' - ), - - [_PC] = LAYOUT_kc( - ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , - - ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , - - NAVPC,___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , - - ___ , ___ , ___ , ___ , ___ , ___ , GM, ___, ___ , ___ , ___ , ___ , ___ , ___ , - - LGUI , LCTL , CTBS , ___ , ___ , ___ - ), - - [_GAME] = LAYOUT_kc( - ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , - - ___ , T , Q , W , E , R , ___ , ___ , ___ , ___ , ___ , ___ , - - TAB , LSFT, A , S , D , F , ___ , ___ , ___ , ___ , ___ , ___ , - - I , LCTL, Z , X , C , V , M, P , ___, ___ , ___ , ___ , ___ , ___ , - - LALT , LALT , SPC, BSPC, MAC, ___ - ), - - [_SYMBOL] = LAYOUT_kc( - - ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , - - LBRC, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , RBRC, - - BSLS, EXLM, AT , HASH, DLR , PERC, CIRC, AMPR, ASTR, LPRN, RPRN, EQL , - - ___ , HOME, END , VOLD, VOLU, MPLY,___, ___,___, MINS, ___ , ___ , ___ , ___ , - - ___ , ___ , ___, ___, ___ , ___ - ), - - [_NAVMAC] = LAYOUT_kc( - - ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , - - ___ , ___ , ___ , ___ , ___ , ___ , C_TAB, AL , UP , AR , DEL , ___ , - - ___ , ___ , ___ , ___ , ___ , ___ , GSL , LEFT, DOWN, RGHT, GSR , ___ , - - ___ , ___ , ___ , ___ , ___ , ___ ,___, ___,G_TAB,ABSPC, ___ , ___ , ___ , ___ , - - ___ , ___ , ___ , ___ , ___ , ___ - ), - - [_NAVPC] = LAYOUT_kc( - - ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , - - ___ , ___ , ___ , ___ , ___ , ___ , C_TAB, CL , UP , CR , DEL , ___ , - - ___ , ___ , ___ , ___ , ___ , ___ , CPGU, LEFT, DOWN, RGHT, CPGD, ___ , - - ___ , ___ , ___ , ___ , ___ , ___ ,___, ___,A_TAB,CBSPC, ___ , ___ , ___ , ___ , - - ___ , ___ , ___ , ___ , ___ , ___ - ), - -}; - -// Shift vs. capslock function. From bbaserdem's Planck keymap. -void caps_tap (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_LSFT); - } else if (state->count == 2) { - unregister_code (KC_LSFT); - register_code (KC_CAPS); - } -} -void caps_tap_end (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_LSFT); - } else { - unregister_code (KC_CAPS); - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - //Tap once for Shift, twice for Caps Lock - [SFT_LCK] = ACTION_TAP_DANCE_FN_ADVANCED( caps_tap, NULL, caps_tap_end) -}; \ No newline at end of file diff --git a/keyboards/iris/keymaps/davidrambo/readme.md b/keyboards/iris/keymaps/davidrambo/readme.md deleted file mode 100644 index 4d21f37c091..00000000000 --- a/keyboards/iris/keymaps/davidrambo/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Colemak layout for Iris rev2.1 with Mac and Windows layers and a Gaming Layer. -# Symbol layer is based on my Planck layout, so it provides numbers, symbols, and volume controls. -# Two Navigation layers, for Mac and Windows Colemak layers respectively. \ No newline at end of file diff --git a/keyboards/iris/keymaps/davidrambo/rules.mk b/keyboards/iris/keymaps/davidrambo/rules.mk deleted file mode 100644 index 0b7e7b9057f..00000000000 --- a/keyboards/iris/keymaps/davidrambo/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -RGBLIGHT_ENABLE = no -BACKLIGHT_ENABLE = no -TAP_DANCE_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/dbroqua/keymap.c b/keyboards/iris/keymaps/dbroqua/keymap.c deleted file mode 100644 index 4cbb8af5405..00000000000 --- a/keyboards/iris/keymaps/dbroqua/keymap.c +++ /dev/null @@ -1,125 +0,0 @@ - -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_DBUG DEBUG - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - /* - * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ - * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | - * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ - * | TAB | Q | W | E | R | T | | Y | U | I | O | P | BSPC| - * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ - * | LCTL| A | S | D | F | G | | H | J | K | L | ; | ' | - * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ - * | LSFT| Z | X | C | V | B | / \ | N | M | , | . | / | RSFT| - * +-----+-----+-----+--+--+-----+-----+ SPC/ \ ENT+-----+-----+--+--+-----+-----+-----+ - * \ LGUI| LOWR| / \ | RASE| LALT/ - * `-----+-----+-----' `-----+-----+----' - */ - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , GRV, - TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC, - LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - LSFT, Z , X , C , V , B , , , N , M ,COMM,DOT ,SLSH,RSFT, - LGUI,LOWR, SPC , ENT ,RASE,LALT - ), - - [_LOWER] = LAYOUT_kc( - /* - * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ - * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BSPC| - * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ - * | RST | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | - * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ - * | DEL | | LEFT| RGHT| UP | [ | | ] | 4 | 5 | 6 | + | | | - * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ - * | | | | | DOWN| { | / \ | } | 1 | 2 | 3 | - | | - * +-----+-----+-----+--+--+-----+-----+ DEL/ \ DEL+-----+-----+--+--+-----+-----+-----+ - * \ | | / \ | | 0 / - * `-----+-----+-----' `-----+-----+----' - */ - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - , , , ,DOWN,LCBR, , ,RCBR, P1 , P2 , P3 ,MINS, , - , ,DEL , DEL , , P0 - ), - - [_RAISE] = LAYOUT_kc( - /* - * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ - * | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | - * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ - * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | - * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ - * | | Prev| Next| Vol+| PgUp| _ | | = | Home| | | + | \ | - * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ - * | Mute| Stop| Play| Vol-| PgDn| - | / \ | + | End | | | |Debug| - * +-----+-----+-----+--+--+-----+-----+ / \ +-----+-----+--+--+-----+-----+-----+ - * \ | | / \ | | 0 / - * `-----+-----+-----' `-----+-----+----' - */ - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , ,DBUG, - , , , , , - ) -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _QWERTY); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _QWERTY); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _QWERTY); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _QWERTY); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/default/keymap.c b/keyboards/iris/keymaps/default/keymap.c deleted file mode 100644 index 4644c3d9b55..00000000000 --- a/keyboards/iris/keymaps/default/keymap.c +++ /dev/null @@ -1,114 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_LALT - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_LOWER] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_DEL, _______, KC_LEFT, KC_RGHT, KC_UP, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_PIPE, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - BL_STEP, _______, _______, _______, KC_DOWN, KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_MINS, _______, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, KC_DEL, KC_DEL, _______, KC_P0 - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_RAISE] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - RGB_TOG, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - RGB_MOD, KC_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, KC_BSLS, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, KC_PGDN, KC_MINS, KC_LPRN, _______, KC_PLUS, KC_END, RGB_HUD, RGB_SAD, RGB_VAD, _______, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, _______, _______, _______, _______ - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_ADJUST] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, _______, _______, _______, _______ - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/drashna/config.h b/keyboards/iris/keymaps/drashna/config.h deleted file mode 100644 index dd247a42a7f..00000000000 --- a/keyboards/iris/keymaps/drashna/config.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -#undef USE_I2C - -/* Select hand configuration */ - -// #define MASTER_LEFT -// #define MASTER_RIGHT -#define EE_HANDS - -#ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 18 // Number of LEDs - -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 - -#define RGBLIGHT_LIMIT_VAL 225 -#endif // RGBLIGHT_ENABLE - -#ifdef AUDIO_ENABLE -#define C6_AUDIO -#ifdef RGBLIGHT_ENABLE -#define NO_MUSIC_MODE -#endif //RGBLIGHT_ENABLE -#endif //AUDIO_ENABLE - -#define QMK_ESC_OUTPUT F6 // usually COL -#define QMK_ESC_INPUT D7 // usually ROW -#define QMK_LED B0 -#define QMK_SPEAKER C6 - -#undef PRODUCT -#ifdef KEYBOARD_iris_rev2 -#define PRODUCT Drashna Hacked Iris Rev.2 -#endif - -#define SHFT_LED1 6 -#define SHFT_LED2 11 - -#define CTRL_LED1 7 -#define CTRL_LED2 10 - -#define ALT_LED1 8 -#define GUI_LED1 9 - -#define BOOTMAGIC_LITE_ROW 4 -#define BOOTMAGIC_LITE_COLUMN 3 diff --git a/keyboards/iris/keymaps/drashna/keymap.c b/keyboards/iris/keymaps/drashna/keymap.c deleted file mode 100644 index 21e3151c0fe..00000000000 --- a/keyboards/iris/keymaps/drashna/keymap.c +++ /dev/null @@ -1,97 +0,0 @@ - -#include QMK_KEYBOARD_H -#include "drashna.h" - - -#define LAYOUT_iris_base( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ - ) \ - LAYOUT_wrapper( \ - KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ - KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ - KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ - OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ - ) -#define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_iris_base_wrapper( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ - ), - - [_COLEMAK] = LAYOUT_iris_base_wrapper( - _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, - _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, - _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ - ), - - [_DVORAK] = LAYOUT_iris_base_wrapper( - _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, - _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, - _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ - ), - - [_WORKMAN] = LAYOUT_iris_base_wrapper( - _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, - _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, - _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ - ), - - [_MODS] = LAYOUT_wrapper( - _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, - _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, - _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, - KC_LSFT, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, KC_RSFT, - _______, _______, _______, _______, _______, _______ - ), - - [_GAMEPAD] = LAYOUT_wrapper( - KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_P, _______, _______, _______, _______, _______, _______, - KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, - KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, - KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, TG_GAME, _______, _______, _______, _______, _______, _______, _______, - LOWER, KC_V, KC_SPC, _______, _______, _______ - ), - - - [_LOWER] = LAYOUT_wrapper( - KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, - KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, _______, - _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_PIPE, - _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_RAISE] = LAYOUT_wrapper( - KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, - KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, - _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, - _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_ADJUST] = LAYOUT_wrapper( - KC_MAKE, _______, _______, _______, _______, _______, _________________ADJUST_R1_________________, KC_RST, - VRSN, _________________ADJUST_L1_________________, KC_NUKE, _______, _______, _______, _______, EPRM, - _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, - _______, _________________ADJUST_L3_________________, TG_GAME, _______, _________________ADJUST_R3_________________, KC_MPLY, - _______, _______, _______, _______, _______, _______ - ) - -}; - - -void matrix_init_keymap(void) { - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); - - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); -} diff --git a/keyboards/iris/keymaps/drashna/rules.mk b/keyboards/iris/keymaps/drashna/rules.mk deleted file mode 100644 index 89e568f3991..00000000000 --- a/keyboards/iris/keymaps/drashna/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -TAP_DANCE_ENABLE = no -RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = yes -NKRO_ENABLE = yes -BACKLIGHT_ENABLE = no -SWAP_HANDS_ENABLE = yes - -INDICATOR_LIGHTS = yes -MACROS_ENABLED = no -RGBLIGHT_TWINKLE = yes - -BOOTLOADER = qmk-dfu diff --git a/keyboards/iris/keymaps/drashna_old/config.h b/keyboards/iris/keymaps/drashna_old/config.h deleted file mode 100644 index b985c4dfc12..00000000000 --- a/keyboards/iris/keymaps/drashna_old/config.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -/* Use I2C or Serial, not both */ -#include "../drashna/config.h" - -#ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 16 // Number of LEDs -#endif - -#undef PRODUCT -#ifdef KEYBOARD_iris_rev2 -#define PRODUCT Drashna Hacked Iris Rev.2 (16 LED) -#endif - -#undef SHFT_LED1 -#define SHFT_LED1 5 -#undef SHFT_LED2 -#define SHFT_LED2 10 - -#undef CTRL_LED1 -#define CTRL_LED1 6 -#undef CTRL_LED2 -#define CTRL_LED2 9 - -#undef ALT_LED1 -#define ALT_LED1 7 -#undef GUI_LED1 -#define GUI_LED1 8 diff --git a/keyboards/iris/keymaps/dvp-zjpxshade/keymap.c b/keyboards/iris/keymaps/dvp-zjpxshade/keymap.c deleted file mode 100644 index 48402e964c4..00000000000 --- a/keyboards/iris/keymaps/dvp-zjpxshade/keymap.c +++ /dev/null @@ -1,139 +0,0 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_BL_S BL_STEP -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , ,COMM,DOT , P , Y , F , G , C , R , L ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, A , O , E , U , I , D , H , T , N , S ,INS , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LCTL,QUOT, Q , J , K , X ,HOME, END , B , M , W , V , Z ,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LGUI,LOWR,ENT , SPC ,RASE,LALT - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - BL_S, , , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , ,DEL , DEL , , P0 - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,DBUG,RHUD,RSAD,RVAD, , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - BL_S,RST , , , , , , , , , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ) - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/dvp-zjpxshade/rules.mk b/keyboards/iris/keymaps/dvp-zjpxshade/rules.mk deleted file mode 100644 index 22b6ec47662..00000000000 --- a/keyboards/iris/keymaps/dvp-zjpxshade/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/edvorakjp/config.h b/keyboards/iris/keymaps/edvorakjp/config.h deleted file mode 100644 index cc24ffc3122..00000000000 --- a/keyboards/iris/keymaps/edvorakjp/config.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 10 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_LIMIT_VAL 100 - -#define MOUSEKEY_WHEEL_MAX_SPEED 10 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 20 - -#define TAPPING_TERM 120 - -#endif diff --git a/keyboards/iris/keymaps/edvorakjp/keymap.c b/keyboards/iris/keymaps/edvorakjp/keymap.c deleted file mode 100644 index 74aff9131c7..00000000000 --- a/keyboards/iris/keymaps/edvorakjp/keymap.c +++ /dev/null @@ -1,169 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" - -#include "edvorakjp.h" - -enum custom_keycodes { - KC_LOCK = NEW_SAFE_RANGE, -}; - -#define KC_ KC_TRNS - -#define KC_TMB1 LGUI_T(KC_TAB) -#define KC_TMB2 LSFT_T(KC_SPC) -#define KC_TMB3 LOWER // act as LOWER when hold, as KC_LANG2(=English) when tapped -#define KC_TMB4 LCTL_T(KC_ESC) -#define KC_TMB5 RSFT_T(KC_DEL) -#define KC_TMB6 RAISE // act as RAISE when hold, as KC_LANG1(=Japanese) when tapped -#define KC_TMB7 RCTL_T(KC_BSPC) -#define KC_TMB8 RALT_T(KC_ENT) -#define KC_TMB9 LGUI(KC_TAB) - -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_EDJP EDVORAK -#define KC_QWER QWERTY - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_EDVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LBRC,RBRC,COMM,DOT , P , Y , F , G , R , W , Q ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , A , O , E , I , U , D , T , N , S , M ,MINS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - QUOT,SCLN, X , C , V , Z ,TMB4, TMB5, B , H , J , K , L ,SLSH, - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - TMB1,TMB2,TMB3, TMB6,TMB7,TMB8 - // `----+----+----' `----+----+----' - ), - - [_EDVORAKJ1] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , Y , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_EDVORAKJ2] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , Y , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LBRC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - RBRC, Z , X , C , V , B , , , N , M ,COMM,DOT ,SLSH,BSLS, - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , ,SLSH,ASTR, , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , ,BTN4,WH_U,BTN5, , , 7 , 8 , 9 ,MINS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , ,WH_L,WH_D,WH_R, , , 4 , 5 , 6 ,PLUS, , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , ,BTN1,BTN3,BTN2, , , , , 1 , 2 , 3 , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - , , , , 0 , - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F1 , F2 , F3 , F4 , F5 ,LCBR, RCBR, , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F6 , F7 , F8 , F9 ,F10 ,LPRN, RPRN,HOME,PGDN,PGUP,END , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - F11 ,F12 ,PSCR,SLCK,PAUS,LBRC,LOCK, ,RBRC,LEFT,DOWN, UP ,RGHT, , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - TMB9, , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , ,EXTOFF, , ,EXTON, , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RST ,DBUG,RTOG,WIN , , ,MAC ,QWER,EDJP, , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ) -}; - -void matrix_init_keymap() { -} - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case KC_LOCK: - if (record->event.pressed) { - if (edvorakjp_config.enable_kc_lang) { - SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) ); - } else { - SEND_STRING( SS_LGUI("l") ); - } - } - return false; - } - return true; -} - -uint32_t layer_state_set_keymap(uint32_t state) { - switch (biton32(state)) { - case _EDVORAKJ1: - case _EDVORAKJ2: - // _EDVORAKJ1 & J2 are same colored - rgblight_setrgb (0xFF, 0xFF, 0xFF); - break; - case _LOWER: - rgblight_setrgb (0xFF, 0x00, 0x00); - break; - case _RAISE: - rgblight_setrgb (0x00, 0x00, 0xFF); - break; - case _ADJUST: - rgblight_setrgb (0x00, 0xFF, 0x00); - break; - default: // for any other layers, or the default layer - rgblight_mode(28); - break; - } - return state; -} diff --git a/keyboards/iris/keymaps/edvorakjp/rules.mk b/keyboards/iris/keymaps/edvorakjp/rules.mk deleted file mode 100644 index 58d244c3895..00000000000 --- a/keyboards/iris/keymaps/edvorakjp/rules.mk +++ /dev/null @@ -1,16 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. diff --git a/keyboards/iris/keymaps/fabian/keymap.c b/keyboards/iris/keymaps/fabian/keymap.c deleted file mode 100644 index 383bacfa486..00000000000 --- a/keyboards/iris/keymaps/fabian/keymap.c +++ /dev/null @@ -1,180 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -enum custom_layers { - _COLEMAK, - _QWERTY, - _LOWER, - _RAISE, - _MOUSECURSOR, - _ADJUST, -}; - -enum custom_keycodes { - COLEMAK = SAFE_RANGE, - QWERTY, - LOWER, - RAISE, - MOUSECURSOR, - ADJUST, - DYNAMIC_MACRO_RANGE, -}; - -#include "dynamic_macro.h" - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_COLE COLEMAK -#define KC_LOWR LOWER -#define KC_QWER QWERTY -#define KC_RASE RAISE -#define KC_RECB DYN_REC_START1 -#define KC_RECE DYN_REC_STOP -#define KC_RECP DYN_MACRO_PLAY1 -#define KC_RSET RESET - -#define KC_CTLE CTL_T(KC_ESC) // Tap for Escape, hold for Control -#define KC_HTAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) -#define KC_SBSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift -#define KC_SENT KC_SFTENT // Tap for Enter, hold for Shift -#define KC_TGMC TG(_MOUSECURSOR) // Toggle MOUSECURSOR layer -#define KC_SPMC LT(_MOUSECURSOR, KC_SPC) // Tap for Space, hold for MOUSECURSOR layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - MEH , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,TGMC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - HTAB, Q , W , E , R , T , Y , U , I , O , P ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - CTLE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - SBSP, Z , X , C , V , B ,LALT, RALT, N , M ,COMM,DOT ,SLSH,SENT, - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - LGUI,LOWR,SPMC, HTAB,RASE,RGUI - // `----+----+----' `----+----+----' - ), - - [_COLEMAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - MEH , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,TGMC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - HTAB, Q , W , F , P , G , J , L , U , Y ,SCLN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - CTLE, A , R , S , T , D , H , N , E , I , O ,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - SBSP, Z , X , C , V , B ,LALT, RALT, K , M ,COMM,DOT ,SLSH,SENT, - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - LGUI,LOWR,SPMC, HTAB,RASE,RGUI - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - GRV , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR,PIPE, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , , ,F12 ,MS_L,MS_D,MS_U,MS_R,BTN1, - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TILD, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - GRV , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC,BSLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , , ,F12 ,LEFT,DOWN, UP ,RGHT,BTN2, - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_MOUSECURSOR] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , UP , , , WH_D,WH_R,MS_U,ACL0,ACL1,ACL2, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , ,LEFT,DOWN,RGHT, , WH_L,MS_L,MS_D,MS_R,BTN1,BTN2, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , ,WH_U,LEFT,DOWN, UP ,RGHT,BTN3, - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RSET, , , , , , , , ,RSET, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , ,QWER,COLE, , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , ,RECB,RECE,RECP,CAPS, - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_dynamic_macro(keycode, record)) { - return false; - } - - switch (keycode) { - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; - } diff --git a/keyboards/iris/keymaps/fate/keymap.c b/keyboards/iris/keymaps/fate/keymap.c deleted file mode 100644 index ca92b597877..00000000000 --- a/keyboards/iris/keymaps/fate/keymap.c +++ /dev/null @@ -1,126 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -enum iris_layers { - _QWERTY, - _LOWER, - _RAISE, - _ADJUST, - _NUMPAD -}; - -// Tap Dance Declarations -enum { - TD_LALT_LGUI = 0, - TD_RALT_RGUI -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR MO(_LOWER) -#define KC_RASE MO(_RAISE) -#define KC_NUM TG(_NUMPAD) -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_BL_S BL_STEP -#define KC_RTOG RGB_TOG -#define KC_RMD RGB_MOD -#define KC_RRMD RGB_RMOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - -#define KC_LAG TD(TD_LALT_LGUI) -#define KC_RAG TD(TD_RALT_RGUI) -#define KC_RSEN MT(MOD_RSFT, KC_ENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,ENT , ENT , N , M ,COMM,DOT ,SLSH,RSEN, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LAG ,LOWR,SPC , SPC ,RASE,RAG - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - CAPS, ,HOME, UP ,END ,PGUP, LEFT,DOWN, UP ,RGHT,INS ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,TILD,LEFT,DOWN,RGHT,PGDN, ,UNDS,PLUS,LCBR,RCBR,PIPE, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,MPLY,MPRV,MNXT,VOLD,VOLU, , ,HOME,PGDN,PGUP,END ,APP , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - CAPS, ,BTN1,MS_U,BTN2,WH_U, LEFT,DOWN, UP ,RGHT,INS ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,GRV ,MS_L,MS_D,MS_R,WH_D, ,MINS,EQL ,LBRC,RBRC,BSLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,MPLY,MPRV,MNXT,VOLD,VOLU, , ,HOME,PGDN,PGUP,END ,APP , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RMD ,RHUI,RSAI,RVAI,RTOG, ,PSCR,SLCK,PAUS, , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RRMD,RHUD,RSAD,RVAD,BL_S, LEFT,DOWN, UP ,RGHT, , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,DBUG, , , ,RST ,NUM , NUM ,HOME,PGDN,PGUP,END ,APP , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_NUMPAD] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , NLCK, P7 , P8 , P9 ,PSLS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , P4 , P5 , P6 ,PAST, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , P1 , P2 , P3 ,PPLS,ENT , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , P0 , P0 ,PDOT,PMNS, , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ) - -}; - -uint32_t layer_state_set_user(uint32_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -} - -// Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // Tap once for L-Alt, twice for L-GUI - [TD_LALT_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_LGUI), - // Tap once for R-Alt, twice for R-GUI - [TD_RALT_RGUI] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_RGUI) -}; diff --git a/keyboards/iris/keymaps/hag/keymap.c b/keyboards/iris/keymaps/hag/keymap.c deleted file mode 100644 index a690f8761a3..00000000000 --- a/keyboards/iris/keymaps/hag/keymap.c +++ /dev/null @@ -1,297 +0,0 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - - -//Heavily modified keymap. Some features: -//Multiple layouts, I use dvorak as main. -//Nordic(swedish) signs -//Symbols, numpad, arrows/navigation reachable under the alpas via the layers -//Mirrored ctl, alt and shift to be able to use both hands when doing commands -//Gaming layer, qwerty with space on left half. - -#define _QWERTY 2 -#define _DVORAK 0 -#define _COLEMAK 1 -#define _WORKMAN 3 -#define _GAMING 4 -#define _NUMPAD 5 -#define _LOWER 6 -#define _RAISE 7 - -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - DVORAK, - COLEMAK, - WORKMAN, - GAMING, - NUMPAD, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define KC_XXXX KC_NO - -#define KC_Sw2 RALT(KC_2) // Nordic @ -#define KC_Sw3 RALT(KC_3) // Nordic something -#define KC_Sw4 RALT(KC_4) // Nordic something -#define KC_Sw5 RALT(KC_5) // Nordic something -#define KC_Sw6 RALT(KC_6) // ... -#define KC_Sw7 RALT(KC_7) -#define KC_Sw8 RALT(KC_8) -#define KC_Sw9 RALT(KC_9) -#define KC_Sw0 RALT(KC_0) -#define KC_Tild RALT(KC_RBRC) -#define KC_Bsls RALT(KC_MINS) -#define KC_Bar RALT(KC_NUBS) -#define KC_Less S(KC_NUBS) -#define KC_CATDEL LCTL(LALT(KC_DEL)) // Ctrl alt del -#define KC_TSKMGR LCTL(S(KC_ESC)) // Ctrl shift esc -#define KC_NUMP TG(_NUMPAD) // Toggle layer NUMPAD for use in LAYOUT_kc -#define KC_Close RALT(KC_F4) // Alt F4 -#define KC_Great S(KC_NUBS) -#define KC_MEH1 MEH(KC_1) -#define KC_MEH2 MEH(KC_2) -#define KC_MEH3 MEH(KC_3) -#define KC_MEH4 MEH(KC_4) -#define KC_MEH5 MEH(KC_5) - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_BL_S BL_STEP - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,NUMP, ENT , N , M ,COMM,DOT ,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LALT,LOWR,BSPC, SPC ,RASE,LALT - // `----+----+----' `----+----+----' - ), - - [_GAMING] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,ESC , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LCTL, A , S , D , F , G , H , J , K , L ,SCLN,RCTL, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B , Y , ENT , N , M ,COMM,DOT ,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LALT,LOWR,SPC, BSPC ,RASE,LALT - // `----+----+----' `----+----+----' - ), - - [_DVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - DEL ,APP ,VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB ,LBRC,QUOT,SCLN, P , Y , F , G , C , R , L ,DEL, - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - LCTL, A , O , E , U , I , D , H , T , N , S ,RCTL, - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - LSFT,DOT , Q , J , K , X ,NUMP, ENT , B , M , W , V , Z ,RSFT, - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - LALT,LOWR,BSPC, SPC ,RASE,LALT - // `----+----+----' `----+----+----' - ), - - [_COLEMAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , F , P , G , J , L , U , Y ,LBRC,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LCTL, A , R , S , T , D , H , N , E , I , O ,SCLN, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,NUMP, ENT , K , M ,COMM, DOT,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LALT,LOWR,BSPC, SPC ,RASE,LALT - // `----+----+----' `----+----+----' - ), - -[_WORKMAN] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , R , W , B , J , F , U , P ,LBRC,SCLN, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LCTL, A , S , H , T , G , Y , N , E , O , I ,RCTL, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , M , C , V ,NUMP, ENT , K , L ,QUOT, DOT,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LALT,LOWR,BSPC, SPC ,RASE,LALT - // `----+----+----' `----+----+----' - ), - - [_NUMPAD] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,MEH1,BTN2,MS_U,BTN1,CATDEL, PIPE, P7 , P8 , P9 ,SLSH, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,MEH4,MS_L,MS_D,MS_R,TSKMGR, COMM, P4 , P5 , P6 ,MINS, , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,MEH5,ACL0,ACL1,ACL2,MEH3, , PENT,DOT , P1 , P2 , P3 , P0 , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LALT,LOWR,BSPC, , P0 ,NLCK - // `----+----+----' `----+----+----' - ), - - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,CAPS,PGUP, UP ,PGDN, ESC, RCBR,EXLM,ASTR,LPRN,UNDS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,HOME,LEFT,DOWN,RGHT, END, RPRN,QUES,Sw8 ,Sw9 ,LABK, , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , ENT, , , , DEL, , ,RABK,NUBS,Sw7 ,Sw0 ,Great, , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM,GRV ,EQL, DLR ,PERC, Sw3 ,Sw5 ,Sw6 ,Sw0 ,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,Bar ,Sw2 ,HASH, AT ,PERC, PIPE, 7 , 8 , 9 ,PMNS,PSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,Bsls,Tild,SLSH,AMPR,BSLS, COMM, 4 , 5 , 6 ,PPLS,PAST, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,PIPE,Sw4 ,PLUS,CIRC,TILD, , PENT,DOT , 1 , 2 , 3 , 0 ,PEQL, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , ,DEL , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT( - //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. - GAMING , DVORAK, WORKMAN, COLEMAK, QWERTY , KC_RST, _______, _______, _______, _______, KC_PWR, RESET, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, _______, _______,LGUI(KC_UP),_______,LALT(KC_F4), _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, _______,LGUI(KC_LEFT),LGUI(KC_DOWN),LGUI(KC_RGHT),_______, _______, DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, BL_STEP, - //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' - _______, _______, _______, _______, _______, _______ - // `--------+--------+--------' `--------+--------+--------' - ) - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE -// PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case NUMPAD: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE -// PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_NUMPAD); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE -// PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case WORKMAN: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE -// PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_WORKMAN); - } - return false; - break; - case GAMING: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE -// PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_GAMING); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/hag/rules.mk b/keyboards/iris/keymaps/hag/rules.mk deleted file mode 100644 index 22b6ec47662..00000000000 --- a/keyboards/iris/keymaps/hag/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/hexwire/config.h b/keyboards/iris/keymaps/hexwire/config.h deleted file mode 100644 index 53b00d24f50..00000000000 --- a/keyboards/iris/keymaps/hexwire/config.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#define TAPPING_TERM 150 - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/iris/keymaps/hexwire/keymap.c b/keyboards/iris/keymaps/hexwire/keymap.c deleted file mode 100644 index e9ab58bcda9..00000000000 --- a/keyboards/iris/keymaps/hexwire/keymap.c +++ /dev/null @@ -1,143 +0,0 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen -#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen -#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen -#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen -#define KC_ESCC MT(MOD_LCTL, KC_ESC) -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_BL_S BL_STEP -#define KC_ENTS MT(MOD_LSFT, KC_ENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ESCC, A , S , D , F , G , H , J , K , L ,SCLN,ENTS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,SPC , LCTL, N , M ,COMM,DOT ,SLSH,ENTS, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LGUI,LOWR,SPC , BSPC,RASE,LALT - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - BL_S,CPYP, , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , ,DEL , DEL , , P0 - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT( - //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' - _______, _______, _______, _______, _______, _______ - // `--------+--------+--------' `--------+--------+--------' - ) - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/hexwire/rules.mk b/keyboards/iris/keymaps/hexwire/rules.mk deleted file mode 100644 index 22b6ec47662..00000000000 --- a/keyboards/iris/keymaps/hexwire/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/impstyle/keymap.c b/keyboards/iris/keymaps/impstyle/keymap.c deleted file mode 100644 index 30b4bf2d920..00000000000 --- a/keyboards/iris/keymaps/impstyle/keymap.c +++ /dev/null @@ -1,111 +0,0 @@ -// iris qwerty layout with mouse layer. -// double tab to toggle is not working atm - -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _MOUSE 3 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - MOUSE, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define KC_LOWR MO(_LOWER) // Lower layer -#define KC_RASE MO(_RAISE) // Raise layer -#define KC_TGLW TG(_LOWER) // toggle lower -#define KC_TGRS TG(_RAISE) // toggle raise -#define KC_MOUS TT(_MOUSE) // double tab toggle mouse layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - // QUERTY LAYER - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - // ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - // TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - // LSFT, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - // LCTL, Z , X , C , V , B ,PLUS , MOUS , N , M ,COMM,DOT ,SLSH,BSLASH, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - // LGUI,RASE,SPC , ENT ,LOWR,LALT - // `----+----+----' `----+----+----' - - [_QWERTY] = LAYOUT( - KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, - KC_TAB , KC_Q , KC_W ,KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, - KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, - KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_PLUS, KC_MOUS,KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH, - KC_LGUI,KC_RASE,KC_SPC , KC_ENT ,KC_LOWR,KC_LALT - ), - - // LOWER Layer - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - // TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - // , , , , ,LBRC, RBRC, P7 , P8 , P9 , ,PLUS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - // ,HOME,PGUP,PGDN,END,LPRN, RPRN, P4 , P5 , P6 ,MINS,PIPE, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - // , , , , , , , , , P1 , P2 , P3 ,EQL ,UNDS , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - // , ,DEL , BSPC , , P0 - // `----+----+----' `----+----+----' - - [_LOWER] = LAYOUT( - KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, - _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS, - _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE, - _______,_______,_______,_______,_______,_______,_______, _______,_______, KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS , - _______ ,_______,KC_PSCR , _______,_______, KC_P0 -), - // RAISE LAYER - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - // F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - // , , , , ,LBRC, RBRC, ,NLCK,INS ,SLCK,MUTE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - // ,LEFT,UP ,DOWN,RGHT,LPRN, RPRN,MPRV,MPLY,MNXT, ,VOLU, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - // , , , , , , , PLUS , , , , , ,VOLD, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - // , , , EQL, , - // `----+----+----' `----+----+----' - - [_RAISE] = LAYOUT( - KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , - _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE, - _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, - _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,KC_VOLD, - _______ ,_______,_______, KC_EQL ,_______,_______ - ), - // MOUSE LAYER - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - // , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - // , , , , , , MS_WH_UP, , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - // ,,MS_LEFT,MS_UP,MS_DOWN,MS_RGHT,, MS_WH_DN,MS_BT1,MS_BT2,MS_BT3, , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - // , , , , , , , , , , ,MS_ACC0,MS_ACC1MS_ACC2 - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - // , , , , , - // `----+----+----' `----+----+----' - [_MOUSE] = LAYOUT( - _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______, KC_MS_WH_UP,_______,_______,_______,_______,_______, - _______,KC_MS_LEFT,KC_MS_UP,KC_MS_DOWN,KC_MS_RIGHT,_______, KC_MS_WH_DOWN,KC_MS_BTN1,KC_MS_BTN2,KC_MS_BTN3,_______,_______, - _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2, - _______,_______,_______, _______,_______,_______ - ), - -}; \ No newline at end of file diff --git a/keyboards/iris/keymaps/impstyle/rules.mk b/keyboards/iris/keymaps/impstyle/rules.mk deleted file mode 100644 index 4db5ef00d26..00000000000 --- a/keyboards/iris/keymaps/impstyle/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -RGBLIGHT_ENABLE = no -BACKLIGHT_ENABLE = no -TAP_DANCE_ENABLE = no -MOUSEKEY_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/jennetters/keymap.c b/keyboards/iris/keymaps/jennetters/keymap.c deleted file mode 100644 index 287dc9712df..00000000000 --- a/keyboards/iris/keymaps/jennetters/keymap.c +++ /dev/null @@ -1,207 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, - YUNO, - SHRG, - NOVY, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_YUNO YUNO -#define KC_SHRG SHRG -#define KC_NOVY NOVY -#define KC_RST RESET -#define KC_BL_S BL_STEP - -//Tap Dance Declartaions -enum { - ESC_GR = 0 -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT( - - // ,----+----+----+----+----+----. ,----+----+----+----+----+----. - // | ESC| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | - // |----+----+----+----+----+----| |----+----+----+----+----+----| - // | TAB| Q | W | E | R | T | | Y | U | I | O | P | BSP| - // |----+----+----+----+----+----| |----+----+----+----+----+----| - // | CAP| A | S | D | F | G | | H | J | K | L | ; | ' | - // |----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - // | SFT| Z | X | C | V | B | SPC| | SPC| N | M | , | . | / | ENT| - // `----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - // \ GUI| ALT| CTL / \RASE\ CTL | SFT / - // `----+----+----' `----+----+----' - - TD(ESC_GR), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC, KC_SPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ - KC_LGUI, KC_LALT, KC_LCTL, KC_RASE, KC_RCTL, KC_RSFT - ), - - [_LOWER] = LAYOUT_kc( - - // ,----+----+----+----+----+----. ,----+----+----+----+----+----. - // | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | DEL| - // |----+----+----+----+----+----| |----+----+----+----+----+----| - // | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | - // |----+----+----+----+----+----| |----+----+----+----+----+----| - // | | | | | | | | | | | | |PIPE| - // |----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - // | \ | | | | | [ | ( | | ) | ] | | | | - | | - // `----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - // \ | | DEL / \ DEL\ | / - // `----+----+----' `----+----+----' - - TILD, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, DEL, \ - , 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, , \ - , , , , , , , , , , ,PIPE, \ - BL_S, , , , , LCBR, LPRN, RPRN, RCBR, , , , MINS, , \ - , , DEL, DEL, , - ), - - [_RAISE] = LAYOUT_kc( - // ,----+----+----+----+----+----. ,----+----+----+----+----+----. - // | | F1 | F2 | | | | | | | | [ | ] | = | - // |----+----+----+----+----+----| |----+----+----+----+----+----| - // | | | UP | | | | | | | | { | } | DEL| - // |----+----+----+----+----+----| |----+----+----+----+----+----| - // | | LT | DN | RT | | | |SHRG| | | |PIPE| | - // |----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - // | | | | | | | | | | | | | | \ | | - // `----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - // \ | | / \ \ | / - // `----+----+----' `----+----+----' - - , F1, F2, , , , , , , LBRC, RBRC, EQL, \ - , , UP, , , , YUNO, NOVY, , LCBR, RCBR, DEL, \ - , LEFT, DOWN, RIGHT, , , SHRG, , , , PIPE, , \ - , , , , , , , , , , , , BSLS, , \ - , , , , , - ), - - [_ADJUST] = LAYOUT( - //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' - _______, _______, _______, _______, _______, _______ - // `--------+--------+--------' `--------+--------+--------' - ) - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void esc_gr_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_ESC); - } else if (state->count == 2) { - register_code (KC_GRV); - } else { - register_code (KC_LSFT); - register_code (KC_GRV); - } -} - -void esc_gr_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_ESC); - } else if (state->count == 2) { - unregister_code (KC_GRV); - } else { - unregister_code (KC_LSFT); - unregister_code (KC_GRV); - } -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - //Tap once for ESC, twice for `, thrice for ~ - [ESC_GR] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, esc_gr_finished, esc_gr_reset) - // Other declarations would go here, separated by commas, if you have them -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - case SHRG: - if (record->event.pressed) { - SEND_STRING("¯\\_(ツ)_/¯"); // I dunno. - return false; - } - /* Ignore for now - special characters not working with macros - } - case NOVY: - if (record->event.pressed) { - SEND_STRING("ლ(ಠ_ಠლ)"); // YUNO?! - return false; - } - */ - } - return true; -} \ No newline at end of file diff --git a/keyboards/iris/keymaps/krusli/keymap.c b/keyboards/iris/keymaps/krusli/keymap.c deleted file mode 100644 index 4aa076ab16a..00000000000 --- a/keyboards/iris/keymaps/krusli/keymap.c +++ /dev/null @@ -1,98 +0,0 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, - KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LALT - ), - - [_LOWER] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - _______, _______, _______, _______, _______, _______ - ), - - [_RAISE] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - _______, _______, _______, _______, _______, _______ - ), - - [_ADJUST] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, - _______, _______, RGB_HUD, RGB_SAD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, - BL_STEP, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______ - ), -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/krusli/rules.mk b/keyboards/iris/keymaps/krusli/rules.mk deleted file mode 100644 index c5e16f13695..00000000000 --- a/keyboards/iris/keymaps/krusli/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = no -BACKLIGHT_ENABLE = no - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/lewisridden/keymap.c b/keyboards/iris/keymaps/lewisridden/keymap.c deleted file mode 100644 index 331c0632ac4..00000000000 --- a/keyboards/iris/keymaps/lewisridden/keymap.c +++ /dev/null @@ -1,137 +0,0 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_BL_S BL_STEP - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RASE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,SPC , PSCR , N , M ,COMM,DOT ,SLSH,RGHT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LCTL,LOWR,SPC , ENT ,LGUI,LALT - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , ,PGUP, , ,LBRC, RBRC, P7 , P8 , P9 ,PLUS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,HOME,PGDN,END, ,LPRN, RPRN, P4 , P5 , P6 ,MINS,PIPE, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , P1 , P2 , P3 ,EQL ,UNDS , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , ,DEL , BSPC , , P0 - // `----+----+----' `----+----+----' - -), - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , UP , , ,LBRC, RBRC, ,NLCK,INS ,SLCK,MUTE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,LEFT,DOWN,RGHT, ,LPRN, RPRN,MPRV,MPLY,MNXT, ,VOLU, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , ,VOLD, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT( - //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| - BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' - _______, _______, _______, _______, _______, _______ - // `--------+--------+--------' `--------+--------+--------' - ) - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/lewisridden/rules.mk b/keyboards/iris/keymaps/lewisridden/rules.mk deleted file mode 100644 index 22b6ec47662..00000000000 --- a/keyboards/iris/keymaps/lewisridden/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/mtdjr/rules.mk b/keyboards/iris/keymaps/mtdjr/rules.mk deleted file mode 100644 index a1b884e4dea..00000000000 --- a/keyboards/iris/keymaps/mtdjr/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = no -BACKLIGHT_ENABLE = no -#AUDIO_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/rdhaene/keymap.c b/keyboards/iris/keymaps/rdhaene/keymap.c deleted file mode 100644 index 68b187aafb3..00000000000 --- a/keyboards/iris/keymaps/rdhaene/keymap.c +++ /dev/null @@ -1,146 +0,0 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_BL_S BL_STEP -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RASE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,SPC , ENT , N , M ,COMM,DOT ,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LCTL,LOWR,SPC , ENT ,LGUI,LALT - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - BL_S, , , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , ,DEL , DEL , , P0 - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,DBUG,RHUD,RSAD,RVAD, , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - BL_S,RST , , , , , , , , , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ) - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/rdhaene/rules.mk b/keyboards/iris/keymaps/rdhaene/rules.mk deleted file mode 100644 index d87ba791336..00000000000 --- a/keyboards/iris/keymaps/rdhaene/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = no -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/s1carii/keymap.c b/keyboards/iris/keymaps/s1carii/keymap.c deleted file mode 100644 index dd993a9bc62..00000000000 --- a/keyboards/iris/keymaps/s1carii/keymap.c +++ /dev/null @@ -1,145 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_DBUG DEBUG -//#define KC_DEV DEVLAYER - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LOWR, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,LGUI, RCMD, N , M ,COMM,DOT ,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' - RCTL,ENT ,SPC , SPC ,RASE,RALT - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. - GRV , , , , , , , , ,MINS,EQL ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , ,PGDN, UP ,PGUP,LBRC,RBRC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,VOLD,VOLU,MUTE, , , HOME,LEFT,DOWN,RGHT, , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, , , , , ,LGUI, RCMD,END , , , ,PSCR,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' - RCTL,ENT ,SPC , SPC , ,RALT - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , UP , , , , , P7 , P8 , P9 ,PSLS,PAST, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,LEFT,DOWN,RGHT, , , , P4 , P5 , P6 ,PMNS,PPLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , NLCK, , P1 , P2 , P3 ,PDOT,PENT, - //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' - RCTL,ENT ,SPC , SPC , , P0 - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. - , , , , ,RST , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , ,DBUG, , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ) - - /* - [_DEVLAYER] = LAYOUT_kc( - //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ) -*/ - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/s1carii/readme.md b/keyboards/iris/keymaps/s1carii/readme.md deleted file mode 100644 index 9b46e867023..00000000000 --- a/keyboards/iris/keymaps/s1carii/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -# Pok3r Based iris Keymap - -Pok3r was what got me into mechanical keyboards years ago and what has been my daily driver since, WhiteFox and the like being always on the periphery. As such, those keybinds are what is most natural and notably not in the default keymap configuration. - -Make example for this keymap (after setting up your build environment): - - make iris/rev2:s1carii:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/iris/keymaps/swedish/keymap.c b/keyboards/iris/keymaps/swedish/keymap.c deleted file mode 100644 index 015e26aec9e..00000000000 --- a/keyboards/iris/keymaps/swedish/keymap.c +++ /dev/null @@ -1,110 +0,0 @@ -#include "iris.h" -#include "keymap_swedish.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _EMPTY 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET - -#define KC_AA NO_AA -#define KC_AE NO_AE -#define KC_OE NO_OSLH - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P , AA , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, A , S , D , F , G , H , J , K , L , OE , AE , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LCTL, Z , X , C , V , B ,DEL , BSPC, N , M ,COMM,DOT ,SLSH,MINS, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LGUI,LOWR,SPC , ENT ,RASE,LALT - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT( - //,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------. - NO_TILD,KC_EXLM,NO_AT ,KC_HASH,NO_DLR ,KC_PERC, NO_CIRC,NO_AMPR,NO_ASTR,NO_SLSH,NO_LPRN,NO_RPRN, - //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| - NO_ACUT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,NO_PIPE,NO_LCBR,NO_RCBR, - //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,NO_BSLS, KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,NO_LBRC,NO_RBRC, - //|-------+-------+-------+-------+-------+-------+-------. ,-------|-------+-------+-------+-------+-------+-------| - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,NO_LESS,NO_GRTR, - //`-------+-------+-------+--+----+-------+-------+-------/ \-------+-------+-------+-------+-------+-------+-------' - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS - // `-------+-------+-------' `-------+-------+-------' - ), - - [_RAISE] = LAYOUT( - //,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------. - KC_F12 ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , - //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| - NO_GRV ,KC_7 ,KC_8 ,KC_9 ,NO_MINS,NO_ASTR, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,NO_PIPE, - //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| - KC_TRNS,KC_4 ,KC_5 ,KC_6 ,NO_PLUS,NO_SLSH, KC_HOME,KC_PGDN,KC_PGUP,KC_END ,KC_TRNS,NO_BSLS, - //|-------+-------+-------+-------+-------+-------+-------. ,-------|-------+-------+-------+-------+-------+-------| - KC_TRNS,KC_1 ,KC_2 ,KC_3 ,KC_0 ,NO_EQL ,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - //`-------+-------+-------+--+----+-------+-------+-------/ \-------+-------+-------+-------+-------+-------+-------' - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS - // `-------+-------+-------' `-------+-------+-------' - ) -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _EMPTY); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _EMPTY); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _EMPTY); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _EMPTY); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/swedish/rules.mk b/keyboards/iris/keymaps/swedish/rules.mk deleted file mode 100644 index 22b6ec47662..00000000000 --- a/keyboards/iris/keymaps/swedish/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/transmogrified/rules.mk b/keyboards/iris/keymaps/transmogrified/rules.mk deleted file mode 100644 index c248822b231..00000000000 --- a/keyboards/iris/keymaps/transmogrified/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -BACKLIGHT_ENABLE = yes -TAP_DANCE_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/keymaps/vyolle_steno/keymap.c b/keyboards/iris/keymaps/vyolle_steno/keymap.c deleted file mode 100644 index 3ad117655ae..00000000000 --- a/keyboards/iris/keymaps/vyolle_steno/keymap.c +++ /dev/null @@ -1,149 +0,0 @@ -#include QMK_KEYBOARD_H -#include "keymap_steno.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _PLOVER 3 -#define _ADJUST 4 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, - PLOVER, - EXT_PLV, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, PLOVER, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_RBRC, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_RSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LGUI, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - KC_LCTL, LOWER, KC_SPC, KC_BSPC, KC_ENT, KC_LALT - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_LOWER] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_DEL, KC_0, KC_9, KC_8, KC_7, KC_6, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_SCLN, KC_P, KC_O, KC_I, KC_U, KC_Y, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - _______, KC_QUOT, KC_L, KC_K, KC_J, KC_H, _______, KC_LEFT, KC_UP, KC_RGHT, KC_SCLN, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_ENT, KC_SLSH, KC_DOT, KC_COMM, KC_M, KC_N, KC_LALT, _______, _______, _______, KC_DOWN, _______, _______, _______, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, KC_LGUI, _______, _______, _______ - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_RAISE] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - _______, KC_VOLU, KC_LEFT, KC_UP, KC_RGHT, KC_INS, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_MUTE, KC_VOLD, KC_PGUP, KC_DOWN, KC_PGDN, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, KC_LALT, _______, _______, _______ - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_ADJUST] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_GRV, KC_HOME, KC_LBRC, KC_RBRC, KC_PIPE, KC_APP, KC_SLCK, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_PSCR, KC_END, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQL, KC_PAUS, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, KC_BSLS, KC_MINS, KC_UNDS, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, _______, _______, _______, _______ - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_PLOVER] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - STN_PWR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, EXT_PLV, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RE1, STN_RE2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - XXXXXXX, STN_A, STN_O, STN_E, STN_U, XXXXXXX - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ) -}; - - -void matrix_init_user() { - steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - case PLOVER: - if (!record->event.pressed) { - layer_on(_PLOVER); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - layer_off(_PLOVER); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/vyolle_steno/rules.mk b/keyboards/iris/keymaps/vyolle_steno/rules.mk deleted file mode 100644 index ebe1c86a0e7..00000000000 --- a/keyboards/iris/keymaps/vyolle_steno/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -EXTRAKEY_ENABLE = yes # Disable if you run out of usb endpoints. Media keys need this to work. -MOUSEKEY_ENABLE = no # Mouse keys(+4700) Uses extra usb endpoints. -STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER. -AUDIO_ENABLE = no # Audio output on port C6 -MIDI_ENABLE = no # MIDI controls -NKRO_ENABLE = yes -BOOTMAGIC_ENABLE = yes diff --git a/keyboards/iris/keymaps/yanfali/keymap.c b/keyboards/iris/keymaps/yanfali/keymap.c deleted file mode 100644 index bae09a62eaf..00000000000 --- a/keyboards/iris/keymaps/yanfali/keymap.c +++ /dev/null @@ -1,145 +0,0 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen -#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen -#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen -#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen -#define KC_ESCC MT(MOD_LCTL, KC_ESC) // Control (hold), Escape (tap) -#define KC_BACK LGUI(KC_LEFT) // Browser Back -#define KC_FORW LGUI(KC_RIGHT) // Browser Forward -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_BL_S BL_STEP -#define KC_ENTS MT(MOD_LSFT, KC_ENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,PLUS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,SPC , LALT, N , M ,COMM,DOT ,SLSH,DEL , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LGUI,LOWR,SPC , BSPC,ENTS,RASE - // `----+----+----' `----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - BL_S,CPYP, , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , ,DEL , DEL , , P0 - // `----+----+----' `----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,MPRV,BACK,FORW,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT( - //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' - _______, _______, _______, _______, _______, _______ - // `--------+--------+--------' `--------+--------+--------' - ) - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/yanfali/rules.mk b/keyboards/iris/keymaps/yanfali/rules.mk deleted file mode 100644 index 22b6ec47662..00000000000 --- a/keyboards/iris/keymaps/yanfali/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/iris/readme.md b/keyboards/iris/readme.md deleted file mode 100644 index 0a1eb1e1758..00000000000 --- a/keyboards/iris/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -Iris -==== - -A split ergo 4x6 keyboard with 3 or 4 thumb keys made and sold by Keebio. [More info at Keebio](https://keeb.io). - -Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make iris/rev2:default - -Example of flashing this keyboard: - - make iris/rev2:default:avrdude - -See [build environment setup](https://docs.qmk.fm/#/newbs_getting_started) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. - -A build guide for this keyboard can be found here: [Iris Build Guide](https://docs.keeb.io/iris-build-guide.html) diff --git a/keyboards/iris/rev1/config.h b/keyboards/iris/rev1/config.h deleted file mode 100644 index 7f76df54ba1..00000000000 --- a/keyboards/iris/rev1/config.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1256 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Iris Keyboard -#define DESCRIPTION Split 50 percent ergonomic keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define BACKLIGHT_PIN D2 -#define BACKLIGHT_LEVELS 5 - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLED_NUM 12 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION diff --git a/keyboards/iris/rev1/rev1.c b/keyboards/iris/rev1/rev1.c deleted file mode 100644 index fe91fa3ead1..00000000000 --- a/keyboards/iris/rev1/rev1.c +++ /dev/null @@ -1,41 +0,0 @@ -#include "rev1.h" - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; - - -#ifdef SWAP_HANDS_ENABLE -__attribute__ ((weak)) -// swap-hands action needs a matrix to define the swap -const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { - /* Left hand, matrix positions */ - {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, - {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, - {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, - {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, - {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, - /* Right hand, matrix positions */ - {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, - {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, - {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, - {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, - {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, -}; -#endif diff --git a/keyboards/iris/rev1_led/config.h b/keyboards/iris/rev1_led/config.h deleted file mode 100644 index b58b11836a1..00000000000 --- a/keyboards/iris/rev1_led/config.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1256 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Iris Keyboard -#define DESCRIPTION Split 50 percent ergonomic keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, F4 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define BACKLIGHT_PIN B6 -#define BACKLIGHT_LEVELS 5 - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLED_NUM 12 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION diff --git a/keyboards/iris/rev1_led/rev1_led.c b/keyboards/iris/rev1_led/rev1_led.c deleted file mode 100644 index d08eaea6621..00000000000 --- a/keyboards/iris/rev1_led/rev1_led.c +++ /dev/null @@ -1,41 +0,0 @@ -#include "rev1_led.h" - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; - - -#ifdef SWAP_HANDS_ENABLE -__attribute__ ((weak)) -// swap-hands action needs a matrix to define the swap -const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { - /* Left hand, matrix positions */ - {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, - {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, - {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, - {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, - {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, - /* Right hand, matrix positions */ - {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, - {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, - {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, - {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, - {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, -}; -#endif diff --git a/keyboards/iris/rev2/config.h b/keyboards/iris/rev2/config.h deleted file mode 100644 index 266c29b9c99..00000000000 --- a/keyboards/iris/rev2/config.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1256 -#define DEVICE_VER 0x0200 -#define MANUFACTURER Keebio -#define PRODUCT Iris Keyboard -#define DESCRIPTION Split 50 percent ergonomic keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D7, E6, B4, D2, D4 } -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_LEVELS 5 - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLED_NUM 12 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION diff --git a/keyboards/iris/rev2/rev2.c b/keyboards/iris/rev2/rev2.c deleted file mode 100644 index 133fce66ad0..00000000000 --- a/keyboards/iris/rev2/rev2.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "rev2.h" - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; - - -#ifdef SWAP_HANDS_ENABLE -__attribute__ ((weak)) -// swap-hands action needs a matrix to define the swap -const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { - /* Left hand, matrix positions */ - {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, - {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, - {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, - {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, - {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, - /* Right hand, matrix positions */ - {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, - {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, - {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, - {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, - {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, -}; -#endif - diff --git a/keyboards/iris/rev3/config.h b/keyboards/iris/rev3/config.h deleted file mode 100644 index 1032231d898..00000000000 --- a/keyboards/iris/rev3/config.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1256 -#define DEVICE_VER 0x0300 -#define MANUFACTURER Keebio -#define PRODUCT Iris Keyboard -#define DESCRIPTION Split 50 percent ergonomic keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D2, D3, D5, D7, D6 } -#define MATRIX_COL_PINS { F1, F4, F5, F6, D4, B4 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define BACKLIGHT_PIN B6 -#define BACKLIGHT_LEVELS 5 - -/* ws2812 RGB LED */ -#define RGB_DI_PIN F7 -#define RGBLED_NUM 12 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION diff --git a/keyboards/iris/rev3/rev3.c b/keyboards/iris/rev3/rev3.c deleted file mode 100644 index d8272db0f59..00000000000 --- a/keyboards/iris/rev3/rev3.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "rev3.h" - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; - - -#ifdef SWAP_HANDS_ENABLE -__attribute__ ((weak)) -// swap-hands action needs a matrix to define the swap -const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { - /* Left hand, matrix positions */ - {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, - {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, - {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, - {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, - {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, - /* Right hand, matrix positions */ - {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, - {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, - {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, - {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, - {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, -}; -#endif - diff --git a/keyboards/iris/rev3/rev3.h b/keyboards/iris/rev3/rev3.h deleted file mode 100644 index d44cef9a6ba..00000000000 --- a/keyboards/iris/rev3/rev3.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include "iris.h" -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -//void promicro_bootloader_jmp(bool program); - -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, LT4, RT4, R30, R31, R32, R33, R34, R35, \ - LT1, LT2, LT3, RT3, RT2, RT1 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { KC_NO, KC_NO, LT4, LT1, LT2, LT3 }, \ - { R05, R04, R03, R02, R01, R00 }, \ - { R15, R14, R13, R12, R11, R10 }, \ - { R25, R24, R23, R22, R21, R20 }, \ - { R35, R34, R33, R32, R31, R30 }, \ - { KC_NO, KC_NO, RT4, RT1, RT2, RT3 } \ - } diff --git a/keyboards/iris/rules.mk b/keyboards/iris/rules.mk deleted file mode 100644 index e93d7dae802..00000000000 --- a/keyboards/iris/rules.mk +++ /dev/null @@ -1,70 +0,0 @@ -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -ifeq ($(strip $(KEYBOARD)), iris/rev3) - BOOTLOADER = dfu -else - BOOTLOADER = caterina -endif - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -SPLIT_KEYBOARD = yes - -DEFAULT_FOLDER = iris/rev2 diff --git a/keyboards/ivy/config.h b/keyboards/ivy/config.h new file mode 100644 index 00000000000..1e6f5bc96e1 --- /dev/null +++ b/keyboards/ivy/config.h @@ -0,0 +1,67 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x1337 +#define PRODUCT_ID 0x6012 +#define MANUFACTURER Maple Computing +#define PRODUCT Ivy +#define DESCRIPTION A 3 key macro pad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 3 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define BACKLIGHT_PIN D2 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/ivy/ivy.c b/keyboards/ivy/ivy.c new file mode 100644 index 00000000000..007ef672532 --- /dev/null +++ b/keyboards/ivy/ivy.c @@ -0,0 +1 @@ +#include "ivy.h" diff --git a/keyboards/ivy/ivy.h b/keyboards/ivy/ivy.h new file mode 100644 index 00000000000..2cba5f49562 --- /dev/null +++ b/keyboards/ivy/ivy.h @@ -0,0 +1,7 @@ +#pragma once + +#ifdef KEYBOARD_ivy_rev1 + #include "rev1.h" +#endif + +#include "quantum.h" diff --git a/keyboards/ivy/keymaps/default/keymap.c b/keyboards/ivy/keymaps/default/keymap.c new file mode 100644 index 00000000000..9a95ba820e7 --- /dev/null +++ b/keyboards/ivy/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum pad_layers { + _L1, + _FUNC +}; + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Layer 1 + * ,------. + * | 1 | + * |------| + * | 2 | + * |------| + * | FN | + * `------' + */ +[_L1] = LAYOUT( \ + KC_1, \ + KC_2, \ + MO(_FUNC) \ +), + +[_FUNC] = LAYOUT( \ + CALTDEL, \ + TSKMGR, \ + _______ \ +) + +}; + +void matrix_init_user(void) { + +} diff --git a/keyboards/ivy/keymaps/default/rules.mk b/keyboards/ivy/keymaps/default/rules.mk new file mode 100644 index 00000000000..cd169fbfd25 --- /dev/null +++ b/keyboards/ivy/keymaps/default/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/ivy/readme.md b/keyboards/ivy/readme.md new file mode 100644 index 00000000000..f70630b52b2 --- /dev/null +++ b/keyboards/ivy/readme.md @@ -0,0 +1,15 @@ +IVY +=== + +![Ivy](https://i.imgur.com/fnVQet6.jpg) + +Make example for this keyboard (after setting up your build environment): + + make ivy/rev1:default + +Install examples: + + make ivy/rev1:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ivy/rev1/config.h b/keyboards/ivy/rev1/config.h new file mode 100644 index 00000000000..9b88b89e5e6 --- /dev/null +++ b/keyboards/ivy/rev1/config.h @@ -0,0 +1,27 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define DEVICE_VER 0x0001 + +/* Let's Macro V2 pin-out */ +#define MATRIX_ROW_PINS { F1, B2, D3 } +#define MATRIX_COL_PINS { F5, B3, D5 } +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/ivy/rev1/rev1.c b/keyboards/ivy/rev1/rev1.c new file mode 100644 index 00000000000..c099e32c497 --- /dev/null +++ b/keyboards/ivy/rev1/rev1.c @@ -0,0 +1,5 @@ +#include "ivy.h" + +void matrix_init_kb(void) { + matrix_init_user(); +}; diff --git a/keyboards/ivy/rev1/rev1.h b/keyboards/ivy/rev1/rev1.h new file mode 100644 index 00000000000..ac338368ed4 --- /dev/null +++ b/keyboards/ivy/rev1/rev1.h @@ -0,0 +1,14 @@ +#pragma once + +#include "ivy.h" + +#define LAYOUT( \ + K00, \ + K01, \ + K02 \ + ) \ + { \ + { K00, KC_NO, KC_NO }, \ + { KC_NO, K01, KC_NO }, \ + { KC_NO, KC_NO, K02 }, \ + } diff --git a/keyboards/ivy/rev1/rules.mk b/keyboards/ivy/rev1/rules.mk new file mode 100644 index 00000000000..f4043e2b799 --- /dev/null +++ b/keyboards/ivy/rev1/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = no +AUDIO_ENABLE = no \ No newline at end of file diff --git a/keyboards/ivy/rules.mk b/keyboards/ivy/rules.mk new file mode 100644 index 00000000000..b27739644f2 --- /dev/null +++ b/keyboards/ivy/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +DEFAULT_FOLDER = ivy/rev1 diff --git a/keyboards/jc65/v32a/config.h b/keyboards/jc65/v32a/config.h index 466cb7a28e4..e91f46aeb2d 100644 --- a/keyboards/jc65/v32a/config.h +++ b/keyboards/jc65/v32a/config.h @@ -28,7 +28,6 @@ along with this program. If not, see . #define MATRIX_ROWS 8 #define MATRIX_COLS 16 -#define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLED_NUM 16 #define RGBLIGHT_ANIMATIONS @@ -39,9 +38,5 @@ along with this program. If not, see . #define NO_UART 1 -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION - diff --git a/keyboards/jc65/v32a/keymaps/ptillemans/keymap.c b/keyboards/jc65/v32a/keymaps/ptillemans/keymap.c new file mode 100644 index 00000000000..c384d36d3fb --- /dev/null +++ b/keyboards/jc65/v32a/keymaps/ptillemans/keymap.c @@ -0,0 +1,54 @@ +#include QMK_KEYBOARD_H + + +#define _QWERTY 0 +#define _RAISE 1 + +#define KC_CTES LCTL_T(KC_ESC) +#define KC_RAIS MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSLS,KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC, KC_HASH,KC_PGUP, + KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT,KC_HASH, KC_ENT,KC_PGDN, + KC_LSFT,KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_RAIS,KC_LGUI,KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT,KC_RGUI,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT + ), + [_RAISE] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,KC_F12,KC_BSLS,KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O,KC_PSCR,KC_LBRC,KC_RBRC, RESET,KC_PGUP, + KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, RESET, KC_ENT,KC_PGDN, + KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP,KC_HOME, + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT,KC_RGUI,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT + ), +}; + +bool shift_pressed(void) { + return get_mods() & MOD_MASK_SHIFT; +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + static bool tilde_pressed = false; + + switch (keycode) { + case KC_HASH: + if (shift_pressed()) { + if (record->event.pressed) { + tilde_pressed = true; + register_code(KC_GRV); + return false; + } + else if (tilde_pressed) { + unregister_code(KC_GRV); + tilde_pressed = false; + return false; + } + } + return true; + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/jc65/v32a/keymaps/ptillemans/readme.md b/keyboards/jc65/v32a/keymaps/ptillemans/readme.md new file mode 100644 index 00000000000..61e55f3ce85 --- /dev/null +++ b/keyboards/jc65/v32a/keymaps/ptillemans/readme.md @@ -0,0 +1,10 @@ +Default Keymap +======= + +Default plain keymap with only a base layer. + +Keymap Maintainer: [Jason Barnachea](https://github.com/nautxx) + +Difference from base layout: None. + +Intended usage: Reference layout. diff --git a/keyboards/iris/keymaps/dbroqua/rules.mk b/keyboards/jc65/v32a/keymaps/ptillemans/rules.mk similarity index 100% rename from keyboards/iris/keymaps/dbroqua/rules.mk rename to keyboards/jc65/v32a/keymaps/ptillemans/rules.mk diff --git a/keyboards/jc65/v32a/readme.md b/keyboards/jc65/v32a/readme.md index b4d4f7e5042..5027f83613c 100644 --- a/keyboards/jc65/v32a/readme.md +++ b/keyboards/jc65/v32a/readme.md @@ -29,4 +29,4 @@ Flashing on Windows can be accomplished by downloading [HIDBootFlash](http://vus To put the PS2AVRGB board into reset, hold down the left control key while plugging in the keyboard. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/jc65/v32a/rules.mk b/keyboards/jc65/v32a/rules.mk index 5c8e63283db..fac85172ecc 100644 --- a/keyboards/jc65/v32a/rules.mk +++ b/keyboards/jc65/v32a/rules.mk @@ -31,8 +31,8 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes diff --git a/keyboards/jc65/v32a/v32a.c b/keyboards/jc65/v32a/v32a.c index 621789423f4..8176ade0a1c 100644 --- a/keyboards/jc65/v32a/v32a.c +++ b/keyboards/jc65/v32a/v32a.c @@ -29,6 +29,7 @@ along with this program. If not, see . #include "i2c.h" #include "quantum.h" +#ifdef RGBLIGHT_ENABLE extern rgblight_config_t rgblight_config; void rgblight_set(void) { @@ -43,12 +44,16 @@ void rgblight_set(void) { i2c_init(); i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); } +#endif __attribute__ ((weak)) void matrix_scan_user(void) { - rgblight_task(); +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif } +#ifdef BACKLIGHT_ENABLE void backlight_init_ports(void) { DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); @@ -62,4 +67,5 @@ void backlight_set(uint8_t level) { // Turn on the lights PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); } -} \ No newline at end of file +} +#endif diff --git a/keyboards/jc65/v32u4/config.h b/keyboards/jc65/v32u4/config.h index 6e1306b2763..8233dd1e8c4 100644 --- a/keyboards/jc65/v32u4/config.h +++ b/keyboards/jc65/v32u4/config.h @@ -52,12 +52,6 @@ along with this program. If not, see . #endif #define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 - -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ - ) - - +#define DEBOUNCE 5 #endif diff --git a/keyboards/jc65/v32u4/keymaps/dead_encryption/keymap.c b/keyboards/jc65/v32u4/keymaps/dead_encryption/keymap.c index 61386395a82..528bde8852a 100644 --- a/keyboards/jc65/v32u4/keymaps/dead_encryption/keymap.c +++ b/keyboards/jc65/v32u4/keymaps/dead_encryption/keymap.c @@ -15,7 +15,7 @@ const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31}; // These control which colors are selected for the gradient mode -const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; +const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( diff --git a/keyboards/jc65/v32u4/keymaps/default/config.h b/keyboards/jc65/v32u4/keymaps/default/config.h index a5568e400de..271f48d0011 100644 --- a/keyboards/jc65/v32u4/keymaps/default/config.h +++ b/keyboards/jc65/v32u4/keymaps/default/config.h @@ -1 +1,3 @@ -#include "../../config.h" +#pragma once + +// place overrides here diff --git a/keyboards/jc65/v32u4/keymaps/gam3cat/config.h b/keyboards/jc65/v32u4/keymaps/gam3cat/config.h index d86da86e40b..e4df94be701 100644 --- a/keyboards/jc65/v32u4/keymaps/gam3cat/config.h +++ b/keyboards/jc65/v32u4/keymaps/gam3cat/config.h @@ -1,4 +1,8 @@ -#include "../../config.h" +#pragma once + +//Force NKRO to be enabled. +#define FORCE_NKRO + //GRAVE_ESC override for CTRL+SHIFT+ESC Windows task manager shortcut. #define GRAVE_ESC_CTRL_OVERRIDE diff --git a/keyboards/jc65/v32u4/keymaps/gam3cat/keymap.c b/keyboards/jc65/v32u4/keymaps/gam3cat/keymap.c index af45fb608f1..2b13f63edfb 100644 --- a/keyboards/jc65/v32u4/keymaps/gam3cat/keymap.c +++ b/keyboards/jc65/v32u4/keymaps/gam3cat/keymap.c @@ -11,13 +11,16 @@ enum layers { _AL, // Adjust Layer }; -enum jc65_keycodes { - DYNAMIC_MACRO_RANGE = SAFE_RANGE, +enum custom_keycodes { + QMK_REV = SAFE_RANGE, + KC_WEB, + KC_SP4, + DYNAMIC_MACRO_RANGE }; +extern backlight_config_t backlight_config; + #include "dynamic_macro.h" -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define FN_CAPS LT(_FL, KC_CAPS) #define KC_DMR1 DYN_REC_START1 #define KC_DMR2 DYN_REC_START2 @@ -25,18 +28,16 @@ enum jc65_keycodes { #define KC_DMP2 DYN_MACRO_PLAY2 #define KC_DMRS DYN_REC_STOP -static uint8_t current_layer; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* _BL: Base Layer, mostly standard 65% QWERTY layout. + /*#### _BL: Base Layer - Mostly standard 65% QWERTY layout. * .---------------------------------------------------------------. - * |GrE| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Ins| + * |GrE|1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backsp |Ins| * |---------------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|Del| + * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del| * |---------------------------------------------------------------| - * |FnCaps| A| S| D| F| G| H| J| K| L| ;| '|Return |PgU| + * |FnCaps|A |S |D |F |G |H |J |K |L |; |' |Return |PgU| * |---------------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD| + * |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Up |PgD| * |---------------------------------------------------------------| * |Ctrl|Gui |Alt | Space |RAlt |Ctrl |Lft|Dwn|Rgt| * *---------------------------------------------------------------* @@ -48,16 +49,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - - /* _WL: Workman Layer. + /*#### _WL: Workman Layer. * .---------------------------------------------------------------. - * | | | | | | | | | | | | -| =| | | + * | | | | | | | | | | | |- |= | | | * |---------------------------------------------------------------| - * | | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| | + * | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | * |---------------------------------------------------------------| - * | | A| S| H| T| G| Y| N| E| O| I| '| | | + * | |A |S |H |T |G |Y |N |E |O |I |' | | | * |---------------------------------------------------------------| - * | | Z| X| M| C| V| K| L| ,| .| /| | | | + * | |Z |X |M |C |V |K |L |, |. |/ | | | | * |---------------------------------------------------------------| * | | | | | | | | | | * *---------------------------------------------------------------* @@ -69,16 +69,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - - /* _NL: Norman Layer. + /*#### _NL: Norman Layer. * .---------------------------------------------------------------. - * | | | | | | | | | | | | -| =| | | + * | | | | | | | | | | | |- |= | | | * |---------------------------------------------------------------| - * | | Q| W| D| F| K| J| U| R| L| ;| [| ]| \| | + * | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | * |---------------------------------------------------------------| - * | | A| S| E| T| G| Y| N| I| O| H| '| | | + * | |A |S |E |T |G |Y |N |I |O |H |' | | | * |---------------------------------------------------------------| - * | | Z| X| C| V| B| P| M| ,| .| /| | | | + * | |Z |X |C |V |B |P |M |, |. |/ | | | | * |---------------------------------------------------------------| * | | | | | | | | | | * *---------------------------------------------------------------* @@ -90,16 +89,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_P , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - - /* _DL: Dvorak Layer. + /*#### _DL: Dvorak Layer. * .---------------------------------------------------------------. - * | | | | | | | | | | | | [| ]| | | + * | | | | | | | | | | | |[ |] | | | * |---------------------------------------------------------------| - * | | '| ,| .| P| Y| F| G| C| R| L| /| =| \| | + * | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | * |---------------------------------------------------------------| - * | | A| O| E| U| I| D| H| T| N| S| -| | | + * | |A |O |E |U |I |D |H |T |N |S |- | | | * |---------------------------------------------------------------| - * | | ;| Q| J| K| X| B| M| W| V| Z| | | | + * | |; |Q |J |K |X |B |M |W |V |Z | | | | * |---------------------------------------------------------------| * | | | | | | | | | | * *---------------------------------------------------------------* @@ -111,16 +109,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - - /* _CL: Colmak Layer. + /*#### _CL: Colmak Layer. * .---------------------------------------------------------------. - * | | | | | | | | | | | | -| =| | | + * | | | | | | | | | | | |- |= | | | * |---------------------------------------------------------------| - * | | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| | + * | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | * |---------------------------------------------------------------| - * | | A| R| S| T| D| H| N| E| I| O| '| | | + * | |A |R |S |T |D |H |N |E |I |O |' | | | * |---------------------------------------------------------------| - * | | Z| X| C| V| B| K| M| ,| .| /| | | | + * | |Z |X |C |V |B |K |M |, |. |/ | | | | * |---------------------------------------------------------------| * | | | | | | | | | | * *---------------------------------------------------------------* @@ -132,11 +129,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - - /* _FL: Function Layer. - * M0 opens Chrome + /*#### _FL: Function Layer. * .---------------------------------------------------------------. - * |M0 | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|SLock |PSc| + * |Web|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|SLock |PSc| * |---------------------------------------------------------------| * |Fn_AL| | | | | | | | | | | | | |Pau| * |---------------------------------------------------------------| @@ -144,21 +139,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |---------------------------------------------------------------| * | | | | | | | | | | | |VlMute|VlU|End| * |---------------------------------------------------------------| - * | | |Menu| | | |WBk|VlD|WFw| + * | | |Menu| SP4 | | |WBk|VlD|WFw| * *---------------------------------------------------------------* */ [_FL] = LAYOUT( - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_SLCK, KC_PSCR, + KC_WEB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_SLCK, KC_PSCR, MO(_AL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLU, KC_END, - XXXXXXX, XXXXXXX, KC_MENU, M(1), M(1), M(1), XXXXXXX, XXXXXXX, XXXXXXX, KC_WBAK, KC_VOLD, KC_WFWD + XXXXXXX, XXXXXXX, KC_MENU, KC_SP4, KC_SP4, KC_SP4, XXXXXXX, XXXXXXX, XXXXXXX, KC_WBAK, KC_VOLD, KC_WFWD ), - - /* _AL: Adjust Layer. - * Default keymap, RGB Underglow, LED backlight, and Dynamic Macro settings. + /*#### _AL: Adjust Layer - Keymap select, RGB Underglow, LED backlight, and Dynamic Macro settings. * .---------------------------------------------------------------. - * |Ver|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| |MP1| + * |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| |MP1| * |---------------------------------------------------------------| * |Fn_AL|_BL|_WL| | | | | | | | | | | |MR1| * |---------------------------------------------------------------| @@ -170,7 +163,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * *---------------------------------------------------------------* */ [_AL] = LAYOUT( - F(0), RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMP1, + QMK_REV, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMP1, _______, DF(_BL), DF(_WL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMR1, _______, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMRS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DF(_CL), XXXXXXX, DF(_BL), DF(_NL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMR2, @@ -178,102 +171,96 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMK_REV: if (record->event.pressed) { - return MACRO(I(0), D(LGUI), T(R), U(LGUI), END); + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE); } - else { + return false; + break; + case KC_WEB: + if (record->event.pressed) { + SEND_STRING(SS_LGUI("r")); + wait_ms(100); SEND_STRING("chrome.exe https://geekhack.org/index.php?topic=86756.new;topicseen#new\n"); - return false; } - break; - case 1: + return false; + break; + case KC_SP4: if (record->event.pressed) { - return MACRO(I(0), T(SPC), T(SPC), T(SPC), T(SPC), END); + SEND_STRING (" "); } - else { - return false; - } - break; + return false; + break; } - return MACRO_NONE; -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(0), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case 0: - if (record->event.pressed) { - SEND_STRING ("[QMK:" QMK_KEYBOARD ":" QMK_KEYMAP ":" QMK_VERSION "]"); - } - break; + // Dynamic Macros. + if (!process_record_dynamic_macro(keycode, record)) { + return false; } + return true; +} + +void custom_backlight_level(uint8_t level) { + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + backlight_config.level = level; + backlight_config.enable = !!backlight_config.level; + backlight_set(backlight_config.level); } void matrix_init_user(void) { #ifdef BACKLIGHT_ENABLE - backlight_level(0); + custom_backlight_level(0); #endif #ifdef RGBLIGHT_ENABLE rgblight_mode(1); - rgblight_sethsv(180,100,100); + rgblight_sethsv_noeeprom(180,100,100); #endif } -// Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - if (current_layer == layer) { - } - else { - current_layer = layer; - switch (layer) { - case 0: - backlight_level(0); - rgblight_sethsv(180,100,255); - break; - case 1: - backlight_level(1); - rgblight_sethsv(180,95,240); - break; - case 2: - backlight_level(1); - rgblight_sethsv(180,90,225); - break; - case 3: - backlight_level(1); - rgblight_sethsv(180,85,210); - break; - case 4: - backlight_level(1); - rgblight_sethsv(180,80,195); - break; - case 5: - backlight_level(2); - rgblight_sethsv(230,255,255); - break; - case 6: - backlight_level(3); - rgblight_sethsv(350,255,255); - break; - default: - backlight_level(0); - rgblight_sethsv(180,100,100); - break; - } - } } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // Enable Dynamic Macros. - if (!process_record_dynamic_macro(keycode, record)) { - return false; +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _BL: + custom_backlight_level(0); + rgblight_sethsv_noeeprom(180,100,255); + break; + case _WL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(180,95,240); + break; + case _NL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(180,90,225); + break; + case _DL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(180,85,210); + break; + case _CL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(180,80,195); + break; + case _FL: + custom_backlight_level(2); + rgblight_sethsv_noeeprom(230,255,255); + break; + case _AL: + custom_backlight_level(3); + rgblight_sethsv_noeeprom(250,255,255); + break; + default: + custom_backlight_level(0); + rgblight_sethsv_noeeprom(180,100,100); + break; } - return true; + return state; +} + +void led_set_user(uint8_t usb_led) { + } diff --git a/keyboards/jc65/v32u4/keymaps/gam3cat/readme.md b/keyboards/jc65/v32u4/keymaps/gam3cat/readme.md index 88b65dbbb7b..e79ce4ff7fd 100644 --- a/keyboards/jc65/v32u4/keymaps/gam3cat/readme.md +++ b/keyboards/jc65/v32u4/keymaps/gam3cat/readme.md @@ -13,76 +13,74 @@ make jc65/v32u4:gam3cat (Caps+TAB+( )): (Q)WERTY, (W)orkman, (N)orman, (D)vorak, (C)olmak ### Base Layer Options: -#### _BL: Base Layer, mostly standard 65% QWERTY layout. +#### _BL: Base Layer - Mostly standard 65% QWERTY layout. .---------------------------------------------------------------. - |GrE| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Ins| + |GrE|1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backsp |Ins| |---------------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|Del| + |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del| |---------------------------------------------------------------| - |FnCaps| A| S| D| F| G| H| J| K| L| ;| '|Return |PgU| + |FnCaps|A |S |D |F |G |H |J |K |L |; |' |Return |PgU| |---------------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD| + |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Up |PgD| |---------------------------------------------------------------| |Ctrl|Gui |Alt | Space |RAlt |Ctrl |Lft|Dwn|Rgt| *---------------------------------------------------------------* #### _WL: Workman Layer. .---------------------------------------------------------------. - | | | | | | | | | | | | -| =| | | + | | | | | | | | | | | |- |= | | | |---------------------------------------------------------------| - | | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| | + | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | |---------------------------------------------------------------| - | | A| S| H| T| G| Y| N| E| O| I| '| | | + | |A |S |H |T |G |Y |N |E |O |I |' | | | |---------------------------------------------------------------| - | | Z| X| M| C| V| K| L| ,| .| /| | | | + | |Z |X |M |C |V |K |L |, |. |/ | | | | |---------------------------------------------------------------| | | | | | | | | | | *---------------------------------------------------------------* #### _NL: Norman Layer. .---------------------------------------------------------------. - | | | | | | | | | | | | -| =| | | + | | | | | | | | | | | |- |= | | | |---------------------------------------------------------------| - | | Q| W| D| F| K| J| U| R| L| ;| [| ]| \| | + | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | |---------------------------------------------------------------| - | | A| S| E| T| G| Y| N| I| O| H| '| | | + | |A |S |E |T |G |Y |N |I |O |H |' | | | |---------------------------------------------------------------| - | | Z| X| C| V| B| P| M| ,| .| /| | | | + | |Z |X |C |V |B |P |M |, |. |/ | | | | |---------------------------------------------------------------| | | | | | | | | | | *---------------------------------------------------------------* #### _DL: Dvorak Layer. .---------------------------------------------------------------. - | | | | | | | | | | | | [| ]| | | + | | | | | | | | | | | |[ |] | | | |---------------------------------------------------------------| - | | '| ,| .| P| Y| F| G| C| R| L| /| =| \| | + | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | |---------------------------------------------------------------| - | | A| O| E| U| I| D| H| T| N| S| -| | | + | |A |O |E |U |I |D |H |T |N |S |- | | | |---------------------------------------------------------------| - | | ;| Q| J| K| X| B| M| W| V| Z| | | | + | |; |Q |J |K |X |B |M |W |V |Z | | | | |---------------------------------------------------------------| | | | | | | | | | | *---------------------------------------------------------------* #### _CL: Colmak Layer. .---------------------------------------------------------------. - | | | | | | | | | | | | -| =| | | + | | | | | | | | | | | |- |= | | | |---------------------------------------------------------------| - | | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| | + | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | |---------------------------------------------------------------| - | | A| R| S| T| D| H| N| E| I| O| '| | | + | |A |R |S |T |D |H |N |E |I |O |' | | | |---------------------------------------------------------------| - | | Z| X| C| V| B| K| M| ,| .| /| | | | + | |Z |X |C |V |B |K |M |, |. |/ | | | | |---------------------------------------------------------------| | | | | | | | | | | *---------------------------------------------------------------* -### Function Layer: (hold Caps to access) - M0 opens Chrome #### _FL: Function Layer. .---------------------------------------------------------------. - |M0 | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|SLock |PSc| + |Web|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|SLock |PSc| |---------------------------------------------------------------| |Fn_AL| | | | | | | | | | | | | |Pau| |---------------------------------------------------------------| @@ -90,14 +88,12 @@ make jc65/v32u4:gam3cat |---------------------------------------------------------------| | | | | | | | | | | | |VlMute|VlU|End| |---------------------------------------------------------------| - | | |Menu| | | |WBk|VlD|WFw| + | | |Menu| SP4 | | |WBk|VlD|WFw| *---------------------------------------------------------------* -### Adjust Layer: (hold Caps+TAB to access) - Default keymap, RGB Underglow, LED backlight, and Dynamic Macro settings. -#### _AL: Adjust Layer. +#### _AL: Adjust Layer - Keymap select, RGB Underglow, LED backlight, and Dynamic Macro settings. .---------------------------------------------------------------. - |Ver|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| |MP1| + |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| |MP1| |---------------------------------------------------------------| |Fn_AL|_BL|_WL| | | | | | | | | | | |MR1| |---------------------------------------------------------------| diff --git a/keyboards/jc65/v32u4/keymaps/gam3cat/rules.mk b/keyboards/jc65/v32u4/keymaps/gam3cat/rules.mk index c0a3ac69c3a..85b2b41a6bc 100644 --- a/keyboards/jc65/v32u4/keymaps/gam3cat/rules.mk +++ b/keyboards/jc65/v32u4/keymaps/gam3cat/rules.mk @@ -1,6 +1,24 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -BACKLIGHT_ENABLE=yes -//TAP_DANCE_ENABLE=yes +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +TAP_DANCE_ENABLE = no # Enable TapDance functionality +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+1500) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # Nkey Rollover - If this doesn't work, add this to config.h: #define FORCE_NKRO +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = no # Enable extended unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Uses buzzer to emulate clicky switches. By default, uses the C6 pin, same as AUDIO_ENABLE. +#VARIABLE_TRACE = no # Use this to debug changes to variable values +API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings(+5390) +KEY_LOCK_ENABLE = no # This enables key lock(+260) +SPLIT_KEYBOARD = no # This enables split keyboard support and includes all necessary files located at quantum/split_common diff --git a/keyboards/jc65/v32u4/readme.md b/keyboards/jc65/v32u4/readme.md index 396c19e8db1..61ac70e28ef 100644 --- a/keyboards/jc65/v32u4/readme.md +++ b/keyboards/jc65/v32u4/readme.md @@ -19,4 +19,4 @@ Or to make and flash: make jc65/v32u4:default:dfu -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/jc65/v32u4/rules.mk b/keyboards/jc65/v32u4/rules.mk index c2c02b6147a..cc905fb185b 100644 --- a/keyboards/jc65/v32u4/rules.mk +++ b/keyboards/jc65/v32u4/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/jd40/config.h b/keyboards/jd40/config.h index 047be5707b0..c03bb3aecf4 100644 --- a/keyboards/jd40/config.h +++ b/keyboards/jd40/config.h @@ -50,7 +50,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -63,12 +63,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN D3 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 12 // Number of LEDs diff --git a/keyboards/jd40/keymaps/default/keymap.c b/keyboards/jd40/keymaps/default/keymap.c index b4ec0550530..ff31fd6f584 100644 --- a/keyboards/jd40/keymaps/default/keymap.c +++ b/keyboards/jd40/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" #define _BL 0 #define _AL 1 @@ -7,189 +6,48 @@ #define _UL 3 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BL] = LAYOUT_kc( - F12, Q, W, E, R, T, Y, U, I, O, P, BSPC, - TAB, A, S, D, F, G, H, J, K, L, ENT, - LSFT, Z, X, C, V, B, N, M, COMM, UP, DOT, - LCTL, LGUI, LALT, FN0, SPC, SPC, FN0, LEFT, DOWN, RIGHT), - - [_AL] = LAYOUT_kc( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, DEL, - CAPS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, SCLN, PGUP, QUOT, - TRNS, TRNS, TRNS, TRNS, FN3, FN3, TRNS, HOME, PGDN, END), - - [_FL] = LAYOUT_kc( - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), - - [_UL] = LAYOUT_kc( - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, FN4, FN5, FN11, FN10, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), -}; - -enum function_id -{ - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // Momentary Fn overlay - [1] = ACTION_LAYER_TOGGLE(2), // Toggle Arrow Layer overlay - [2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS), // Tap to toggle caps lock and hold to activate function layer - [3] = ACTION_LAYER_TOGGLE(3), // Toggle Underglow Layer overlay - [4] = ACTION_FUNCTION(RGBLED_TOGGLE), //Turn on/off underglow - [5] = ACTION_FUNCTION(RGBLED_STEP_MODE), // Change underglow mode - [6] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [7] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [8] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [9] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [10] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [11] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - [12] = ACTION_FUNCTION(SHIFT_ESC), + [_BL] = LAYOUT( + KC_F12, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_UP, KC_DOT, + KC_LCTL, KC_LGUI, KC_LALT, MO(_AL), KC_SPC, KC_SPC, MO(_AL), KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_AL] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + KC_CAPS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, KC_PGUP, KC_QUOT, + _______, _______, _______, _______, TG(_UL), TG(_UL), _______, KC_HOME, KC_PGDN, KC_END + ), + + [_FL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_UL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) - { - case 0: - if (record->event.pressed) - { - register_code(KC_RSFT); - } - else - { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -void matrix_scan_user(void) -{ - - // Layer LED indicators - // ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster - uint32_t layer = layer_state; - if (layer & (1 << 1)) - { - //gh60_wasd_leds_on(); - } - else - { - //gh60_wasd_leds_off(); - } - - if (layer & (1 << 2)) - { - //gh60_esc_led_on(); - } - else - { - //gh60_esc_led_off(); - } -}; - -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) - { - case RGBLED_TOGGLE: - //led operations - if (record->event.pressed) - { - rgblight_toggle(); - } - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) - { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) - { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) - { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) - { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) - { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) - { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) - { - rgblight_step(); - } - break; - static uint8_t shift_esc_shift_mask; - // Shift + ESC = ~ - case SHIFT_ESC: - shift_esc_shift_mask = get_mods() & MODS_CTRL_MASK; - if (record->event.pressed) - { - if (shift_esc_shift_mask) - { - add_key(KC_GRV); - send_keyboard_report(); - } - else - { - add_key(KC_ESC); - send_keyboard_report(); - } - } - else - { - if (shift_esc_shift_mask) - { - del_key(KC_GRV); - send_keyboard_report(); - } - else - { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } +void matrix_scan_user(void) { + // Layer LED indicators + // ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster + uint32_t layer = layer_state; + if (layer & (1 << 1)) { + //gh60_wasd_leds_on(); + } else { + //gh60_wasd_leds_off(); + } + + if (layer & (1 << 2)) { + //gh60_esc_led_on(); + } else { + //gh60_esc_led_off(); + } }; diff --git a/keyboards/jd40/keymaps/vanagon/rules.mk b/keyboards/jd40/keymaps/vanagon/rules.mk index 63aac4e597d..e69de29bb2d 100644 --- a/keyboards/jd40/keymaps/vanagon/rules.mk +++ b/keyboards/jd40/keymaps/vanagon/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/jd40/readme.md b/keyboards/jd40/readme.md index f70bd9107d3..3a92b8fb894 100644 --- a/keyboards/jd40/readme.md +++ b/keyboards/jd40/readme.md @@ -5,10 +5,10 @@ A compact 40% keyboard. Keyboard Maintainer: QMK Community Hardware Supported: JD40 PCB -Hardware Availability: [1up](https://1upkeyboards.com/jd40-mkii-1up-keyboards-logo-pcb.html) [mechanicalkeyboards.com](https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=2452) [originative](https://www.originativeco.com/products/jd40-pcb) +Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/jd40-mkii-1up-keyboards-logo-pcb/), [mechanicalkeyboards.com](https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=2452), [originative](https://www.originativeco.com/products/jd40-pcb) Make example for this keyboard (after setting up your build environment): make jd40:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/jd40/rules.mk b/keyboards/jd40/rules.mk index 2bce6d2a2d6..5fc0a45e4db 100644 --- a/keyboards/jd40/rules.mk +++ b/keyboards/jd40/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -66,4 +63,4 @@ NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https: # MIDI_ENABLE = YES # MIDI controls # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable RGB Underglow \ No newline at end of file +RGBLIGHT_ENABLE = yes # Enable RGB Underglow diff --git a/keyboards/jd45/config.h b/keyboards/jd45/config.h index 43d138f4eda..02968b44e44 100644 --- a/keyboards/jd45/config.h +++ b/keyboards/jd45/config.h @@ -49,18 +49,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/jd45/keymaps/mjt/config.h b/keyboards/jd45/keymaps/mjt/config.h index a8c8e9d17ef..da1adc9af6c 100644 --- a/keyboards/jd45/keymaps/mjt/config.h +++ b/keyboards/jd45/keymaps/mjt/config.h @@ -52,18 +52,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/jd45/keymaps/mjt/keymap.c b/keyboards/jd45/keymaps/mjt/keymap.c index f806de65d96..63563d6aaab 100644 --- a/keyboards/jd45/keymaps/mjt/keymap.c +++ b/keyboards/jd45/keymaps/mjt/keymap.c @@ -3,12 +3,14 @@ /* Mike's Layout for JD45 with backlight LEDs acting as layer indicator */ +#define KC_TT2 TT(2) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_kc( TAB, Q, W, E, R, T, Y, U, I, O, P, MINS, BSLS, FN1, A, S, D, F, G, H, J, K, L, QUOT, ENT, FN0, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, - NO, LCTL, LALT, LGUI, SPC, BSPC, APP, FN2, ESC, NO), + NO, LCTL, LALT, LGUI, SPC, BSPC, APP, TT2, ESC, NO), [1] = LAYOUT_kc( GRV, TRNS, UP, TRNS, 7, 8, 9, 0, MINS, EQL, PSCR, LBRC, RBRC, TRNS, LEFT, DOWN, RGHT, 4, 5, 6, INS, HOME, PGUP, SCLN, TRNS, @@ -35,9 +37,7 @@ enum macro_id const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_MODS_TAP_TOGGLE(MOD_LSFT), - // [1] = ACTION_LAYER_TAP_TOGGLE(1), [1] = ACTION_MACRO(M_LAYER1), - [2] = ACTION_LAYER_TAP_TOGGLE(2), [3] = ACTION_BACKLIGHT_STEP(), [4] = ACTION_BACKLIGHT_TOGGLE()}; diff --git a/keyboards/jd45/keymaps/mjt6u/rules.mk b/keyboards/jd45/keymaps/mjt6u/rules.mk index 1df8b9754b6..2cf0221ed77 100644 --- a/keyboards/jd45/keymaps/mjt6u/rules.mk +++ b/keyboards/jd45/keymaps/mjt6u/rules.mk @@ -18,6 +18,3 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend DEBUG_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/jd45/rules.mk b/keyboards/jd45/rules.mk index fe8354e9554..e7ccb632527 100644 --- a/keyboards/jd45/rules.mk +++ b/keyboards/jd45/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -64,4 +61,4 @@ COMMAND_ENABLE = yes # Commands for debug and configuration BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = YES # MIDI controls # UNICODE_ENABLE = YES # Unicode -BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID \ No newline at end of file +BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/jj40/README.md b/keyboards/jj40/README.md index 39e871d8735..7d3612554bc 100644 --- a/keyboards/jj40/README.md +++ b/keyboards/jj40/README.md @@ -12,7 +12,7 @@ Make example for this keyboard (after setting up your build environment): make jj40:default:program -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Note that this is a complete replacement for the firmware, so you won't be using Bootmapper Client to change any keyboard settings, since not all the @@ -36,7 +36,7 @@ $ make $ sudo cp bootloadHID /usr/bin ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `././util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` @@ -69,3 +69,16 @@ Windows sometimes doesn't recognize the jj40. The easiest way of flashing a new 3. If you get an error such as "Resource Unavailable" when attemting to flash on Linux, you may want to compile and run `tools/usb_detach.c`. See `tools/README.md` for more info. + +## Recovery +If you flash a bad hex (e.g. you have a V1 board without RGB and compile/flash blindly without editing your rules.mk), your jj40 is now semi-bricked and you're stuck unless you have access to an ISP. The [ISP Flashing Guide](https://docs.qmk.fm/#/isp_flashing_guide) contains very good (but somewhat generalized) information. However, the instructions below should get you up and running provided you have an Arduino or clone. + +### Arduino Setup +1. Upload the ArduinoISP sketch onto your Arduino board (https://www.arduino.cc/en/Tutorial/ArduinoISP). +2. Wire the Arduino to the jj40. Match the data pins on the Arduino to those on the jj40. "RST" usually goes to D10 on the Arduino. I didn't need a capacitor when using my Uno. +![Imgur](https://i.imgur.com/oLWJOkQ.jpg) +3. Get a working bootloader from https://blog.winkeyless.kr/m/152. The file is called "main.hex" from the archive called "ps2avrGB_bootloader_161215.zip" Copy "main.hex" to your qmk folder. +4. Burn the bootloader with the following command +` avrdude -b 19200 -c avrisp -p atmega32 -v -e -U hfuse:w:0xD0:m -U lfuse:w:0x0F:m -U flash:w:main.hex:i -P comPORT` +Change `comPORT` to whatever port is used by the Arduino (e.g. `com11` in Windows or `/dev/ttyACM0` in Linux). Use Device Manager in Windows to find the port being used. Use `ls /dev/tty*` in Linux. +5. If this process is successful, you should now be able to upload normally. diff --git a/keyboards/jj40/backlight.c b/keyboards/jj40/backlight.c deleted file mode 100644 index fbd241fa9de..00000000000 --- a/keyboards/jj40/backlight.c +++ /dev/null @@ -1,213 +0,0 @@ -/** - * Backlighting code for PS2AVRGB boards (ATMEGA32A) - * Kenneth A. (github.com/krusli | krusli.me) - */ - -#include "backlight.h" -#include "quantum.h" - -#include -#include - -#include "backlight_custom.h" -#include "breathing_custom.h" - -// DEBUG -#include -#include - -// Port D: digital pins of the AVR chipset -#define NUMLOCK_PORT (1 << 0) // D0 -#define CAPSLOCK_PORT (1 << 1) // D1 -#define BACKLIGHT_PORT (1 << 4) // D4 -#define SCROLLLOCK_PORT (1 << 6) // D6 - -#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 -#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default - -#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask - -#define PWM_MAX 0xFF -#define TIMER_TOP 255 // 8 bit PWM - -extern backlight_config_t backlight_config; - -/** - * References - * Port Registers: https://www.arduino.cc/en/Reference/PortManipulation - * TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b - * Timers: http://www.avrbeginners.net/architecture/timers/timers.html - * 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/ - * PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware - */ - -// @Override -// turn LEDs on and off depending on USB caps/num/scroll lock states. -__attribute__ ((weak)) -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - // turn on - DDRD |= NUMLOCK_PORT; - PORTD |= NUMLOCK_PORT; - } else { - // turn off - DDRD &= ~NUMLOCK_PORT; - PORTD &= ~NUMLOCK_PORT; - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRD |= CAPSLOCK_PORT; - PORTD |= CAPSLOCK_PORT; - } else { - DDRD &= ~CAPSLOCK_PORT; - PORTD &= ~CAPSLOCK_PORT; - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRD |= SCROLLLOCK_PORT; - PORTD |= SCROLLLOCK_PORT; - } else { - DDRD &= ~SCROLLLOCK_PORT; - PORTD &= ~SCROLLLOCK_PORT; - } -} - -#ifdef BACKLIGHT_ENABLE - -// sets up Timer 1 for 8-bit PWM -void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE - // default 8 bit mode - TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH - TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW - - // clear output compare value A - // outb(OCR1AH, 0); - // outb(OCR1AL, 0); - - // clear output comparator registers for B - OCR1BH = 0; // outb(OCR1BH, 0); - OCR1BL = 0; // outb(OCR1BL, 0); -} - -bool is_init = false; -void timer1Init(void) { - // timer1SetPrescaler(TIMER1PRESCALE) - // set to DIV/64 - (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE; - - // reset TCNT1 - TCNT1H = 0; // outb(TCNT1H, 0); - TCNT1L = 0; // outb(TCNT1L, 0); - - // TOIE1: Timer Overflow Interrupt Enable (Timer 1); - TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1); - - is_init = true; -} - -void timer1UnInit(void) { - // set prescaler back to NONE - (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP - - // disable timer overflow interrupt - TIMSK &= ~_BV(TOIE1); // overflow bit? - - setPWM(0); - - is_init = false; -} - - -// handle TCNT1 overflow -//! Interrupt handler for tcnt1 overflow interrupt -ISR(TIMER1_OVF_vect, ISR_NOBLOCK) -{ - // sei(); - // handle breathing here - #ifdef BACKLIGHT_BREATHING - if (is_breathing()) { - custom_breathing_handler(); - } - #endif - - // TODO call user defined function -} - -// enable timer 1 PWM -// timer1PWMBOn() -void timer1PWMBEnable(void) { - // turn on channel B (OC1B) PWM output - // set OC1B as non-inverted PWM - TCCR1A |= _BV(COM1B1); - TCCR1A &= ~_BV(COM1B0); -} - -// disable timer 1 PWM -// timer1PWMBOff() -void timer1PWMBDisable(void) { - TCCR1A &= ~_BV(COM1B1); - TCCR1A &= ~_BV(COM1B0); -} - -void enableBacklight(void) { - DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output - PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high -} - -void disableBacklight(void) { - // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input - PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low -} - -void startPWM(void) { - timer1Init(); - timer1PWMBEnable(); - enableBacklight(); -} - -void stopPWM(void) { - timer1UnInit(); - disableBacklight(); - timer1PWMBDisable(); -} - -void b_led_init_ports(void) { - /* turn backlight on/off depending on user preference */ - #if BACKLIGHT_ON_STATE == 0 - // DDRx register: sets the direction of Port D - // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input - PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low - #else - DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output - PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high - #endif - - timer1PWMSetup(); - startPWM(); - - #ifdef BACKLIGHT_BREATHING - breathing_enable(); - #endif -} - -void b_led_set(uint8_t level) { - if (level > BACKLIGHT_LEVELS) { - level = BACKLIGHT_LEVELS; - } - - setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS)); -} - -// called every matrix scan -void b_led_task(void) { - // do nothing for now -} - -void setPWM(uint16_t xValue) { - if (xValue > TIMER_TOP) { - xValue = TIMER_TOP; - } - OCR1B = xValue; // timer1PWMBSet(xValue); -} - -#endif // BACKLIGHT_ENABLE diff --git a/keyboards/jj40/backlight_custom.h b/keyboards/jj40/backlight_custom.h deleted file mode 100644 index 7210be840e0..00000000000 --- a/keyboards/jj40/backlight_custom.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Backlighting code for PS2AVRGB boards (ATMEGA32A) - * Kenneth A. (github.com/krusli | krusli.me) - */ - -#ifndef BACKLIGHT_CUSTOM_H -#define BACKLIGHT_CUSTOM_H - -#include -void b_led_init_ports(void); -void b_led_set(uint8_t level); -void b_led_task(void); -void setPWM(uint16_t xValue); - -#endif // BACKLIGHT_CUSTOM_H diff --git a/keyboards/jj40/config.h b/keyboards/jj40/config.h index 7fac1ed5b99..c068685a4ab 100644 --- a/keyboards/jj40/config.h +++ b/keyboards/jj40/config.h @@ -1,54 +1,55 @@ /* Copyright 2017 Luiz Ribeiro - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "config_common.h" +#pragma once -#ifndef CONFIG_H -#define CONFIG_H +#include "config_common.h" #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422D // TODO: share these strings with usbconfig.h // Edit usbconfig.h to change these. -#define MANUFACTURER winkeyless.kr +#define MANUFACTURER Kprepublic #define PRODUCT jj40 /* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 15 +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 +#define MATRIX_ROW_PINS { B0, B1, B3, B4 } +#define MATRIX_COL_PINS { C4, C5, C6, C7, A4, A5, A6, A7, A3, A2, A1, A0 } /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 12 -// #define BACKLIGHT_BREATHING // works, but BL_TOGG might not work - -#define TAPPING_TOGGLE 3 - -#define NO_UART 1 +// #define BACKLIGHT_BREATHING // Requires #4324 to enable hardware pwm for atmega32a /* RGB underglow */ -// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. -// The same pin is used on the JJ40, at least. +// NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0. #define RGBLED_NUM 5 -#define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0. #define RGBLIGHT_ANIMATIONS -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +#define NO_UART 1 + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) -#endif +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/jj40/i2c.c b/keyboards/jj40/i2c.c deleted file mode 100644 index c27f3e3d17e..00000000000 --- a/keyboards/jj40/i2c.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif diff --git a/keyboards/jj40/jj40.c b/keyboards/jj40/jj40.c index 51f5295f465..26cfa6c067e 100644 --- a/keyboards/jj40/jj40.c +++ b/keyboards/jj40/jj40.c @@ -18,53 +18,26 @@ along with this program. If not, see . #include "jj40.h" -#include - -#include "action_layer.h" -#include "quantum.h" +#ifdef RGBLIGHT_ENABLE -#include "i2c.h" +#include +#include "i2c_master.h" +#include "rgblight.h" -#include "backlight.h" -#include "backlight_custom.h" +extern rgblight_config_t rgblight_config; -// for keyboard subdirectory level init functions -// @Override void matrix_init_kb(void) { + i2c_init(); // call user level keymaps, if any matrix_init_user(); } - -#ifdef BACKLIGHT_ENABLE -/// Overrides functions in `quantum.c` -void backlight_init_ports(void) { - b_led_init_ports(); -} - -void backlight_task(void) { - b_led_task(); -} - -void backlight_set(uint8_t level) { - b_led_set(level); -} -#endif - -#ifdef RGBLIGHT_ENABLE -extern rgblight_config_t rgblight_config; - // custom RGB driver void rgblight_set(void) { if (!rgblight_config.enable) { - for (uint8_t i=0; i. */ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H +#pragma once #include "quantum.h" -#include "quantum_keycodes.h" -#include "keycode.h" -#include "action.h" - -void matrix_init_user(void); // TODO port this to other PS2AVRGB boards - -#define XXX KC_NO +#define ___ KC_NO #define LAYOUT_ortho_4x12( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \ - K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312 \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \ ) \ { \ - { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \ - { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \ - { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \ - { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \ - { K312, K311, K310, K39, K35, K36, K37, K38, K34, K33, K32, K31 } \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B } \ } #define LAYOUT_planck_mit( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \ - K31, K32, K33, K34, K35, K3X, K38, K39, K310, K311, K312 \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K3X, K37, K38, K39, K3A, K3B \ ) \ { \ - { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \ - { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \ - { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \ - { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \ - { K312, K311, K310, K39, K35, K3X, XXX, K38, K34, K33, K32, K31 } \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, K34, K3X, ___, K37, K38, K39, K3A, K3B } \ } #define LAYOUT_planck_1x2uR( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \ - K31, K32, K33, K34, K35, K36, K3X, K39, K310, K311, K312 \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K3X, K38, K39, K3A, K3B \ ) \ { \ - { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \ - { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \ - { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \ - { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \ - { K312, K311, K310, K39, K35, K36, K3X, XXX, K34, K33, K32, K31 } \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, K34, K35, K3X, ___, K38, K39, K3A, K3B } \ } #define LAYOUT_kc( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ - ) \ - LAYOUT_ortho_4x12( \ - KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ - KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ - KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ - KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ ) #define LAYOUT LAYOUT_planck_mit - #define LAYOUT_kc_ortho_4x12 LAYOUT_kc - -#endif +#define KC_LAYOUT_ortho_4x12 LAYOUT_kc diff --git a/keyboards/jj40/keymaps/ajp10304/keymap.c b/keyboards/jj40/keymaps/ajp10304/keymap.c index c0d0062c7bd..c34a7c29299 100644 --- a/keyboards/jj40/keymaps/ajp10304/keymap.c +++ b/keyboards/jj40/keymaps/ajp10304/keymap.c @@ -35,10 +35,6 @@ enum jj40_keycodes { #include "dynamic_macro.h" -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/jj40/keymaps/ajp10304/rules.mk b/keyboards/jj40/keymaps/ajp10304/rules.mk index dc6ab13e89f..4dee01cd5b1 100644 --- a/keyboards/jj40/keymaps/ajp10304/rules.mk +++ b/keyboards/jj40/keymaps/ajp10304/rules.mk @@ -1,6 +1,3 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - AUDIO_ENABLE = no MOUSEKEY_ENABLE = yes + diff --git a/keyboards/jj40/keymaps/cockpit/keymap.c b/keyboards/jj40/keymaps/cockpit/keymap.c index 12ed62b6b55..34c6c861e5f 100644 --- a/keyboards/jj40/keymaps/cockpit/keymap.c +++ b/keyboards/jj40/keymaps/cockpit/keymap.c @@ -120,11 +120,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | RGB | RGB | RGB | RGB | BL | BL | BL | | | | | - * | Caps | Togl | Hue+ | Sat+ | Brt+ | Togl |Breath| Brt+ | | | | Vol+ | + * | | RGB | RGB | RGB | RGB | BL | BL | BL | | Scr | | | + * | Caps | Togl | Hue+ | Sat+ | Brt+ | Togl |Breath| Brt+ | | Brt+ | | Vol+ | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | RGB | RGB | RGB | WWW | WWW | BL | | | | | - * |Shift | Term | Hue- | Sat- | Brt- | < | > | Brt- | | |PrScr | Vol- | + * | | | RGB | RGB | RGB | WWW | WWW | BL | | Scr | | | + * |Shift | Term | Hue- | Sat- | Brt- | < | > | Brt- | | Brt- |PrScr | Vol- | * |------+------+------+------+------+------+------+------+------+------+------+------| * | |||||||| RGB | | | | | | | | | * | Ctrl |||Fn||| Mode | Alt | | Space |MPrev |MStop |MNext |MPlay | Lock | @@ -132,8 +132,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FUNC] = LAYOUT_planck_mit( \ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - KC_CAPS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, BL_TOGG, BL_BRTG, BL_INC, _______, _______, _______, KC_VOLU, \ - KC_LSFT, KC_CALC, RGB_HUD, RGB_SAD, RGB_VAD, KC_WBAK, KC_WFWD, BL_DEC, _______, _______, KC_PSCR, KC_VOLD, \ + KC_CAPS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, BL_TOGG, BL_BRTG, BL_INC, _______, KC_BRIU, _______, KC_VOLU, \ + KC_LSFT, KC_CALC, RGB_HUD, RGB_SAD, RGB_VAD, KC_WBAK, KC_WFWD, BL_DEC, _______, KC_BRID, KC_PSCR, KC_VOLD, \ KC_LCTL, _______, RGB_MOD, KC_LALT, _______, KC_SPC, KC_MPRV, KC_MSTP, KC_MNXT, KC_MPLY, CP_LOCK \ ) }; diff --git a/keyboards/jj40/keymaps/cockpit/readme.md b/keyboards/jj40/keymaps/cockpit/readme.md index 37bd47b1d9a..766a3c93b24 100644 --- a/keyboards/jj40/keymaps/cockpit/readme.md +++ b/keyboards/jj40/keymaps/cockpit/readme.md @@ -18,32 +18,31 @@ | | | | | | | | | | | | | | :-------: | :----: | :----: | :----: | :-------: | :----: | :----: | :----: | :----: | :----: | :-----: | :------: | | ~
\` | Ą
ą | Č
č | Ę
ę | Ė
ė | Į
į | Š
š | Ų
ų | Ū
ū | Ž
ž | \_
- |
Bksp | -|
Tab |
! |
@ |
# |
$ |
% |
^ |
& |
\* |
( |
) |
Del | +|
Tab |
! |
@ |
# |
\$ |
% |
^ |
& |
\* |
( |
) |
Del | |
Shift |
= |
+ |
- |
\| | {
[ | }
] |
< |
> |
{ |
} |
Ins | | Ctrl | | | Alt | **Lower** | Sp | ace | | Home | PgDn | PgUp | End | ### Raise -| | | | | | | | | | | | | -| :-------: | :----: | :-----: | :----: | :----: | :----: | :----: | :-------: | :-----: | :----: | :----: | :-------: | -| ~
\` | !
1 | @
2 | #
3 | $
4 | %
5 | ^
6 | &
7 | \*
8 | (
9 | )
0 |
Bksp | -|
Tab | $
4 | %
5 | ^
6 | | | | | | | | \|
\ | -|
Shift | &
7 | \*
8 | (
9 | )
0 | | | | <
, | >
. | ?
/ |
Enter | -| Ctrl | | | Alt | | Sp | ace | **Raise** | Left | Down | Up | Right | +| | | | | | | | | | | | | +| :-------: | :-----: | :-----: | :----: | :-----: | :----: | :----: | :-------: | :-----: | :----: | :----: | :-------: | +| ~
\` | !
1 | @
2 | #
3 | \$
4 | %
5 | ^
6 | &
7 | \*
8 | (
9 | )
0 |
Bksp | +|
Tab | \$
4 | %
5 | ^
6 | | | | | | | | \|
\ | +|
Shift | &
7 | \*
8 | (
9 | )
0 | | | | <
, | >
. | ?
/ |
Enter | +| Ctrl | | | Alt | | Sp | ace | **Raise** | Left | Down | Up | Right | ### Function -* Caps does not work. Might be an issue with my laptop, not JJ40 specific. -* Backlight breathing does not work. -* **Term** button is bound to `Calculator`. I have set this button as a shortcut to open a terminal. -* **Lock** is a shortcut for `Alt + L` - -| | | | | | | | | | | | | -| :-------: | :---------: | :---------: | :---------: | :---------: | :--------: | :----------: | :--------: | :----: | :-----: | :-----: | :------: | -|
F1 |
F2 |
F3 |
F4 |
F5 |
F6 |
F7 |
F8 |
F9 |
F10 |
F11 |
F12 | -|
Caps | RGB
Togl | RGB
Hue+ | RGB
Sat+ | RGB
Brt+ | BL
Togl | BL
Breath | BL
Brt+ | | | |
Vol+ | -|
Shift |
Term | RGB
Hue- | RGB
Sat- | RGB
Brt- | WWW
< | WWW
> | BL
Brt- | | | PrScr |
Vol- | -| Ctrl | **Fn** | RGB
Mode | Alt | | Sp | ace | MPrev | MStop | MNext | MPlay | Lock | +- Backlight breathing does not work. +- **Term** button is bound to `Calculator`. I have set this button as a shortcut to open a terminal. +- **Lock** is a shortcut for `Alt + L` + +| | | | | | | | | | | | | +| :-------: | :---------: | :---------: | :---------: | :---------: | :--------: | :----------: | :--------: | :----: | :---------: | :-----: | :------: | +|
F1 |
F2 |
F3 |
F4 |
F5 |
F6 |
F7 |
F8 |
F9 |
F10 |
F11 |
F12 | +|
Caps | RGB
Togl | RGB
Hue+ | RGB
Sat+ | RGB
Brt+ | BL
Togl | BL
Breath | BL
Brt+ | | Scr
Brt+ | |
Vol+ | +|
Shift |
Term | RGB
Hue- | RGB
Sat- | RGB
Brt- | WWW
< | WWW
> | BL
Brt- | | Scr
Brt- | PrScr |
Vol- | +| Ctrl | **Fn** | RGB
Mode | Alt | | Sp | ace | MPrev | MStop | MNext | MPlay | Lock | ## Usage diff --git a/keyboards/jj40/keymaps/default/keymap.c b/keyboards/jj40/keymaps/default/keymap.c index d84b01b15a4..47c6bada689 100644 --- a/keyboards/jj40/keymaps/default/keymap.c +++ b/keyboards/jj40/keymaps/default/keymap.c @@ -1,16 +1,30 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include QMK_KEYBOARD_H - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, +enum layers { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST, }; +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. @@ -27,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - _______, KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower @@ -64,10 +78,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) }; -// Loop -void matrix_scan_user(void) { - // Empty -}; +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/jj40/keymaps/fun40/rules.mk b/keyboards/jj40/keymaps/fun40/rules.mk index 6fe3b051542..92f168a16d7 100644 --- a/keyboards/jj40/keymaps/fun40/rules.mk +++ b/keyboards/jj40/keymaps/fun40/rules.mk @@ -19,6 +19,3 @@ DISABLE_WS2812 = yes SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/jj40/keymaps/like_jis/keymap.c b/keyboards/jj40/keymaps/like_jis/keymap.c index 4724933eabe..24db9194720 100644 --- a/keyboards/jj40/keymaps/like_jis/keymap.c +++ b/keyboards/jj40/keymaps/like_jis/keymap.c @@ -30,7 +30,7 @@ enum custom_keycodes { #define KC_LSAD RGB_SAD #define KC_LVAI RGB_VAI #define KC_LVAD RGB_VAD -#define KC_LSMOD RGB_SMOD +#define KC_LMOD RGB_MOD #define KC_BTOG BL_TOGG #define KC_BINC BL_INC #define KC_BDEC BL_DEC @@ -90,7 +90,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|------+------+------+------+------+------|------+------+------+------+------+------| XXXXX, LTOG, LHUI, LSAI, LVAI, BTOG, BINC, WH_R, WH_D, END, PGDN, XXXXX,\ //|------+------+------+------+------+------|------+------+------+------+------+------| - XXXXX, LSMOD, LHUD, LSAD, LVAD, XXXXX, BDEC, XXXXX, BTN1, BTN2, MS_U, XXXXX,\ + XXXXX, LMOD, LHUD, LSAD, LVAD, XXXXX, BDEC, XXXXX, BTN1, BTN2, MS_U, XXXXX,\ //|------+------+------+------+------+-------------+------+------+------+------+------| _____, _____, _____, _____, _____, XXXXX, XXXXX, _____, _____, MS_L, MS_D, MS_R \ //|------+------+------+------+------+-------------+------+------+------+------+------| diff --git a/keyboards/jj40/keymaps/waples/keymap.c b/keyboards/jj40/keymaps/waples/keymap.c index 81416f98208..79acada28c0 100644 --- a/keyboards/jj40/keymaps/waples/keymap.c +++ b/keyboards/jj40/keymaps/waples/keymap.c @@ -21,8 +21,6 @@ enum jj40_keycodes { #define TG_NKRO MAGIC_TOGGLE_NKRO // Toggle NKRO #define CTLESC MT(MOD_LCTL, KC_ESC) // Hold for left Ctrl, tap for Esc #define SHFTENT MT(MOD_RSFT, KC_ENT) // Hold for right Shift, tap for Enter -#define _______ KC_TRNS -#define XXXXXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/jj40/rules.mk b/keyboards/jj40/rules.mk index 697e17a0141..3e496f97e95 100644 --- a/keyboards/jj40/rules.mk +++ b/keyboards/jj40/rules.mk @@ -30,29 +30,29 @@ F_CPU = 12000000 # automatically (+60). See bootloader.mk for all options. BOOTLOADER = bootloadHID -# build options -BOOTMAGIC_ENABLE = no -MOUSEKEY_ENABLE = no -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = no -COMMAND_ENABLE = yes - -BACKLIGHT_ENABLE = yes -BACKLIGHT_CUSTOM_DRIVER = yes - -RGBLIGHT_ENABLE = yes -RGBLIGHT_CUSTOM_DRIVER = yes - -KEY_LOCK_ENABLE = yes - +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -OPT_DEFS = -DDEBUG_LEVEL=0 - -# custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c backlight.c +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGBLIGHT_CUSTOM_DRIVER = yes +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SRC += i2c_master.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/jj40/tools/README.md b/keyboards/jj40/tools/README.md deleted file mode 100644 index 081984ed44b..00000000000 --- a/keyboards/jj40/tools/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# JJ40 Tools - -## usb_detach.c - -When trying to flash on Linux, you may encounter a "Resource Unavailable" error. This means that Linux's HID driver has taken exclusive control of the keyboard, and the program script can't flash it. -This program can force Linux to give up a device, so that the programming script can reset it. - -### To compile: -``` -gcc usb_detach.c -o usb_detach -``` - -### To run: -1. Use `lsusb` to discover the Bus and Device numbers for your keyboard. -2. Run the program: `sudo ./usb_detach /dev/bus/usb//`. -3. Build and program the firmware as normal. diff --git a/keyboards/jj40/tools/usb_detach.c b/keyboards/jj40/tools/usb_detach.c deleted file mode 100644 index c21e47a7a43..00000000000 --- a/keyboards/jj40/tools/usb_detach.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Found at https://www.linuxquestions.org/questions/linux-hardware-18/how-to-unclaim-usb-device-558138/#post3406986 */ -#include -#include -#include -#include -#include -#include - -int main(int argc, char**argv) -{ - struct usbdevfs_ioctl command; - int ret; - int fd; - int i; - if (argc>1) { - fd = open(argv[1],O_RDWR); - if (fd<1){ - perror("unable to open file"); - return 1; - } - for (i=0;i<255;i++){ // hack: should fetch how many interface there is. - command.ifno = i; - command.ioctl_code = USBDEVFS_DISCONNECT; - command.data = NULL; - ret = ioctl(fd, USBDEVFS_IOCTL, &command); - if(ret!=-1) - printf("un claimed interface %d %d\n",i,ret); - } - } else { - printf ("usage: %s /dev/bus/usb/BUS/DEVICE\n",argv[0]); - printf("Release all interfaces of this usb device for usage in virtualisation\n"); - } -} \ No newline at end of file diff --git a/keyboards/jj4x4/README.md b/keyboards/jj4x4/README.md new file mode 100644 index 00000000000..29dc2605de0 --- /dev/null +++ b/keyboards/jj4x4/README.md @@ -0,0 +1,71 @@ +# jj4x4 + +![jj4x4](https://cdn.shopify.com/s/files/1/2711/4238/products/JJ4x4case-1_1024x1024.jpg?v=1532325339) + +A 4x4 keypad kit made and KPRepublic on AliExpress. This is a chopped off version of the jj40 with rearranged keys. + +Keyboard Maintainer: [QMK Community](https://github.com/qmk) +Hardware Supported: Atmega32A +Hardware Availability: [AliExpress](https://www.aliexpress.com/item/jj4x4-jj4X4-16-keys-Custom-Mechanical-Keyboard-PCB-programmed-numpad-layouts-bface-firmware-with-rgb-bottom/32901955446.html?spm=2114.search0104.3.7.3ebf431ae1d9ic&ws_ab_test=searchweb0_0,searchweb201602_4_10065_10130_10068_10547_319_317_10548_10545_10696_453_10084_454_10083_433_10618_431_10307_537_536_10902_10059_10884_10887_321_322_10103,searchweb201603_6,ppcSwitch_0&algo_expid=9d1891dd-80af-4793-a889-5a62e1fdfdd8-1&algo_pvid=9d1891dd-80af-4793-a889-5a62e1fdfdd8&transAbTest=ae803_5) + +Make example for this keyboard (after setting up your build environment): + + make jj4x4:default:program + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +Note that this is a complete replacement for the firmware, so you won't be +using Bootmapper Client to change any keyboard settings, since not all the +USB report options are supported. + +In addition you may need the AVR toolchain and `bootloadHID` ([GitHub repo](https://github.com/whiteneon/bootloadHID)) for flashing: + +For macOS: +``` +$ brew cask install crosspack-avr +$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb +``` + +For Linux: +``` +$ sudo apt install libusb-dev +$ wget https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz +$ tar -xzf bootloadHID.2012-12-08.tar.gz +$ cd bootloadHID.2012-12-08/commandline +$ make +$ sudo cp bootloadHID /usr/bin +``` + +In order to use the `./util/atmega32a_program.py` script, which can reboot the board into +the bootloader, you'll need Python 2 with PyUSB installed: + +``` +$ pip install pyusb +``` + +If you prefer (or are having issues with a `program` flash), you can just build it (`make jj40:` and flash the firmware (`.hex` file) directly with +`bootloadHID` if you boot the board while holding down `8` (second from top, second from left, with usb plug is at the top) to keep it +in the bootloader: + +``` +$ make jj40 +$ bootloadHID -r jj4x4_default.hex +``` + +For Windows 10: +Windows sometimes doesn't recognize the jj4x4. The easiest way of flashing a new layout is probably using [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +1. Go to Windows Device Manager and find the keyboard (plug it in while holding down `8` (second from top, second from left, with usb plug is at the top)). It can be found under Human Interface Devices or under Keyboards. +2. Go to properties and the Details tab to find the hardware ID. You want the VID and the PID (code after the underscore). Plug them into HIDBootFlash and hit Find Device. +3. Use `make jj4x4:` to generate the .hex file in the qmk basis folder. Select the .hex file in HIDBootFlash and press Flash Device. + + +## Troubleshooting + +1. Try plugging the board in while pressing `8` (usb plug at top, second from top, second from left). This will force it + to boot only the bootloader without loading the firmware. Once this is + done, just reflash the board with the original firmware. +2. Sometimes USB hubs can act weird, so try connecting the board directly + to your computer or plugging/unplugging the USB hub. +3. If you get an error such as "Resource Unavailable" when attemting to flash + on Linux, you may want to compile and run `tools/usb_detach.c`. See `tools/README.md` + for more info. diff --git a/keyboards/jj4x4/config.h b/keyboards/jj4x4/config.h new file mode 100644 index 00000000000..80fa07d3bbb --- /dev/null +++ b/keyboards/jj4x4/config.h @@ -0,0 +1,58 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +// TODO: share these strings with usbconfig.h +// Edit usbconfig.h to change these. +#define MANUFACTURER Kprepublic +#define PRODUCT jj4x4 + +/* matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 +#define MATRIX_ROW_PINS { B5, B0, B3, B4 } +#define MATRIX_COL_PINS { A1, A0, A2, A3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN D4 +#define BACKLIGHT_LEVELS 12 +// #define BACKLIGHT_BREATHING // Requires #4324 to enable hardware pwm for atmega32a + +/* RGB underglow */ +// NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0. +#define RGBLED_NUM 4 +#define RGBLIGHT_ANIMATIONS + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +#define NO_UART 1 + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/jj4x4/info.json b/keyboards/jj4x4/info.json new file mode 100644 index 00000000000..602fdc90a37 --- /dev/null +++ b/keyboards/jj4x4/info.json @@ -0,0 +1,30 @@ +{ + "keyboard_name": "jj4x4", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "key_count": 16, + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":3, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2}, + {"x":3, "y":2}, + {"x":0, "y":3}, + {"x":1, "y":3}, + {"x":2, "y":3}, + {"x":3, "y":3} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/jj4x4/jj4x4.c b/keyboards/jj4x4/jj4x4.c new file mode 100644 index 00000000000..265508b2d5b --- /dev/null +++ b/keyboards/jj4x4/jj4x4.c @@ -0,0 +1,56 @@ +/* +Copyright 2017 Luiz Ribeiro +Modified 2018 Kenneth A. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "jj4x4.h" + +#ifdef RGBLIGHT_ENABLE + +#include +#include "i2c_master.h" +#include "rgblight.h" + +extern rgblight_config_t rgblight_config; + +void matrix_init_kb(void) { + i2c_init(); + // call user level keymaps, if any + matrix_init_user(); +} +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + memset(led, 0, 3 * RGBLED_NUM); + } + + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} + +bool rgb_init = false; + +void matrix_scan_kb(void) { + // if LEDs were previously on before poweroff, turn them back on + if (rgb_init == false && rgblight_config.enable) { + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + rgb_init = true; + } + + rgblight_task(); + matrix_scan_user(); +} + +#endif diff --git a/keyboards/jj4x4/jj4x4.h b/keyboards/jj4x4/jj4x4.h new file mode 100644 index 00000000000..7b8cb81835e --- /dev/null +++ b/keyboards/jj4x4/jj4x4.h @@ -0,0 +1,41 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_4x4( \ + K01, K02, K03, K04, \ + K11, K12, K13, K14, \ + K21, K22, K23, K24, \ + K31, K32, K33, K34 \ +) \ +{ \ + { K01, K02, K03, K04 }, \ + { K11, K12, K13, K14 }, \ + { K21, K22, K23, K24 }, \ + { K31, K32, K33, K34 } \ +} diff --git a/keyboards/jj4x4/keymaps/default/keymap.c b/keyboards/jj4x4/keymaps/default/keymap.c new file mode 100644 index 00000000000..a0b06ee92a3 --- /dev/null +++ b/keyboards/jj4x4/keymaps/default/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layers { + _BASE = 0, + _FN1, + _FN2, +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_ortho_4x4( + KC_PGUP, KC_HOME, KC_UP, KC_END , \ + KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, \ + MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV, \ + MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT \ + ), + [_FN1] = LAYOUT_ortho_4x4( + KC_ESC, KC_P7, KC_P8, KC_P9, \ + KC_TAB, KC_P4, KC_P5, KC_P6, \ + KC_ENT, KC_P1, KC_P2, KC_P3, \ + _______, KC_P0, KC_P0, KC_DOT \ + ), + [_FN2] = LAYOUT_ortho_4x4( + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \ + _______, _______, _______, RESET, \ + BL_STEP, _______, QMKBEST, QMKURL \ + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} diff --git a/keyboards/jj4x4/rules.mk b/keyboards/jj4x4/rules.mk new file mode 100644 index 00000000000..3ac2cc04329 --- /dev/null +++ b/keyboards/jj4x4/rules.mk @@ -0,0 +1,60 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGBLIGHT_CUSTOM_DRIVER = yes +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SRC += i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex + +LAYOUTS = ortho_4x4 diff --git a/keyboards/jj4x4/usbconfig.h b/keyboards/jj4x4/usbconfig.h new file mode 100644 index 00000000000..a7653bde86e --- /dev/null +++ b/keyboards/jj4x4/usbconfig.h @@ -0,0 +1,397 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +// max power draw with maxed white underglow measured at 120 mA (peaks) +#define USB_CFG_MAX_BUS_POWER 100 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'j', 'j', '4', 'x', '4' +#define USB_CFG_DEVICE_NAME_LEN 5 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/jj50/README.md b/keyboards/jj50/README.md index 2f04f036be5..f7b8acc641b 100644 --- a/keyboards/jj50/README.md +++ b/keyboards/jj50/README.md @@ -25,7 +25,7 @@ $ make jj50:default:program ``` It should detect the keyboard and set it to bootloader mode automatically, prior to flashing firmware. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Note that this is a complete replacement for the firmware, so you won't be using Bootmapper Client to change any keyboard settings, since not all the @@ -37,7 +37,7 @@ $ brew cask install crosspack-avr $ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `././util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` diff --git a/keyboards/jj50/config.h b/keyboards/jj50/config.h index 6aa7628837f..0f09f02ff87 100644 --- a/keyboards/jj50/config.h +++ b/keyboards/jj50/config.h @@ -48,7 +48,4 @@ along with this program. If not, see . #define NO_UART 1 #define BOOTLOADHID_BOOTLOADER 1 -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - #endif diff --git a/keyboards/jj50/keymaps/abstractkb/keymap.c b/keyboards/jj50/keymaps/abstractkb/keymap.c new file mode 100644 index 00000000000..456adeee4b2 --- /dev/null +++ b/keyboards/jj50/keymaps/abstractkb/keymap.c @@ -0,0 +1,135 @@ +/* +Base Copyright 2017 Luiz Ribeiro +Modified 2017 Andrew Novak +Modified 2018 Wayne Jones (WarmCatUK) +Modified 2019 AbstractKB + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public LicensezZZ +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +enum layers { + _DEFLT, + _RAISE, + _LOWER, + _FN +}; + +enum custom_keycodes { + MYRGB_TG = SAFE_RANGE +}; + +bool rgbinit = true; +bool rgbon = true; + +const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {1,5,5}; //only using the first one + +void keyboard_post_init_user(void) { + rgblight_enable_noeeprom(); + led_set_user(host_keyboard_leds()); +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _RAISE: + rgblight_sethsv_noeeprom(240,255,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + case _LOWER: + rgblight_sethsv_noeeprom(0,255,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + case _FN: + rgblight_sethsv_noeeprom(0,255,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); + break; + default: //_DEFLT + rgblight_sethsv_noeeprom(0,0,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + } + + return state; +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1<event.pressed) { + myrgb_toggle(); + } + return false; + default: + return true; + } +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_DEFLT] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, \ + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + MO(_FN), KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER),KC_SPC,KC_SPC,MO(_RAISE),KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + + [_RAISE] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, LCTL(LGUI(KC_LEFT)), LGUI(KC_L), LCTL(LGUI(KC_RGHT)), _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_CAPS, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + + [_LOWER] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, KC_GRV, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_BSLS, _______, \ + _______, _______, _______, KC_LBRC, KC_RBRC, S(KC_9),S(KC_0),S(KC_LBRC),S(KC_RBRC),_______,_______,_______, \ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + + [_FN] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MYRGB_TG \ + ) +}; diff --git a/keyboards/jj50/keymaps/abstractkb/readme.md b/keyboards/jj50/keymaps/abstractkb/readme.md new file mode 100644 index 00000000000..7ff7e0268a1 --- /dev/null +++ b/keyboards/jj50/keymaps/abstractkb/readme.md @@ -0,0 +1,6 @@ +# My personal layout for the JJ50 + +It is an approximation of a 60% layout with the alternate layers set up for programming, +with brackets and parenthesis on the homerow +Other things I changed were swapping around delete, backspace, and capslock around +It also uses layer based rgb underglow, and the underglow flashes when capslock is enabled \ No newline at end of file diff --git a/keyboards/jj50/keymaps/archetype/README.md b/keyboards/jj50/keymaps/archetype/README.md new file mode 100644 index 00000000000..a2ae4e9123f --- /dev/null +++ b/keyboards/jj50/keymaps/archetype/README.md @@ -0,0 +1,22 @@ +# archetype keymap for jj50 keyboards +A keymap that can be used with the jj50 ortholinear keyboard. + +## Features + +- `QWERTY` layout (Default) +- `COLEMAK` layout +- `FN` layout (various keys that are rarely needed) +- `FX` layout (Control lighting and audio) +- Use `Left Ctrl` and `Left Alt` to output `()`, `[]` and `{}` by tapping once, twice or thrice respectively. Hold them down for the regular keycode (LCtrl or LAlt) +- `Right Shift` when held or Enter when tapped +- Auto-Shift enabled (long press on alphas and numeric keys outputs shifted character) +- Full arrow keys available + + +## Feedback + +I made this keymap based on the existing default one. If you happen to use this keymap [drop me a line](mailto://idimitrakopoulos@gmail.com) about what could be improved etc + +Enjoy! + +Iason Dimitrakopoulos diff --git a/keyboards/jj50/keymaps/archetype/config.h b/keyboards/jj50/keymaps/archetype/config.h new file mode 100644 index 00000000000..a12e070b4fa --- /dev/null +++ b/keyboards/jj50/keymaps/archetype/config.h @@ -0,0 +1,9 @@ +#pragma once + +#undef AUTO_SHIFT_TIMEOUT +#undef TAPPING_TERM + +#define AUTO_SHIFT_TIMEOUT 150 +#define NO_AUTO_SHIFT_ALPHA +#define TAPPING_TERM 150 +//#define BOOTMAGIC_KEY_SALT KC_LCTL diff --git a/keyboards/jj50/keymaps/archetype/keymap.c b/keyboards/jj50/keymaps/archetype/keymap.c new file mode 100644 index 00000000000..82c615f135a --- /dev/null +++ b/keyboards/jj50/keymaps/archetype/keymap.c @@ -0,0 +1,277 @@ +/* +Base Copyright 2017 Luiz Ribeiro +Modified 2017 Andrew Novak +Modified 2018 Wayne Jones (WarmCatUK) +Modified 2019 Iason Dimitrakopoulos (idimitrakopoulos) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public LicensezZZ +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "rgblight.h" +#include "quantum.h" + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _FN 2 +#define _FX 3 + +enum { + TD_BSPC_DEL = 0, + TD_LCTL_LBRC = 1, + TD_LALT_RBRC = 2, + TD_ESC_LAYER = 3, +}; + + +void left_brackets(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (!state->pressed) { + register_code16(KC_LPRN); + } else { + register_code(KC_LCTL); + } + } else if (state->count == 2) { + register_code16(KC_LBRC); + } else if (state->count == 3) { + register_code16(KC_LCBR); + } +} + +void left_brackets_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code16(KC_LPRN); + } else if (state->count == 2) { + unregister_code16(KC_LBRC); + } else if (state->count == 3) { + unregister_code16(KC_LCBR); + } + + unregister_code(KC_LCTL); +} + +void right_brackets(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (!state->pressed) { + register_code16(KC_RPRN); + } else { + register_code(KC_LALT); + } + } else if (state->count == 2) { + register_code16(KC_RBRC); + } else if (state->count == 3) { + register_code16(KC_RCBR); + } +} + +void right_brackets_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code16(KC_RPRN); + } else if (state->count == 2) { + unregister_code16(KC_RBRC); + } else if (state->count == 3) { + unregister_code16(KC_RCBR); + } + + unregister_code(KC_LALT); +} + +typedef struct { + bool is_press_action; + int state; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, //send two single taps + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7, + TRIPLE_SINGLE_TAP = 8, //send three single taps +}; + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + + if (state->count == 3) { + if (state->interrupted) return TRIPLE_SINGLE_TAP; + else if (state->pressed) return TRIPLE_HOLD; + else return TRIPLE_TAP; + } + else return 9; //magic number. At some point this method will expand to work for more presses +} + +static tap tap_state = { + .is_press_action = true, + .state = 0 +}; + +void layer_switcher (qk_tap_dance_state_t *state, void *user_data) { + tap_state.state = cur_dance(state); + switch (tap_state.state) { + case SINGLE_TAP: register_code(KC_ESC); break; + case SINGLE_HOLD: register_code(KC_ESC); break; + case DOUBLE_TAP: register_code(KC_ESC); break; + case DOUBLE_HOLD: layer_on(_COLEMAK); break; + case DOUBLE_SINGLE_TAP: register_code(KC_ESC); unregister_code(KC_ESC); register_code(KC_ESC); break; + case TRIPLE_TAP: register_code(KC_ESC); break; + case TRIPLE_HOLD: layer_on(_FX); break; + case TRIPLE_SINGLE_TAP: register_code(KC_ESC); unregister_code(KC_ESC); register_code(KC_ESC); unregister_code(KC_ESC); register_code(KC_ESC); break; + //Last case is for fast typing. Assuming your key is `f`: + //For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`. + //In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms. + } +} + +void layer_switcher_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (tap_state.state) { + case SINGLE_TAP: unregister_code(KC_ESC); break; + case SINGLE_HOLD: unregister_code(KC_ESC); break; + case DOUBLE_TAP: unregister_code(KC_ESC); break; + case DOUBLE_HOLD: break; + case DOUBLE_SINGLE_TAP: unregister_code(KC_ESC); break; + case TRIPLE_TAP: unregister_code(KC_ESC); break; + case TRIPLE_HOLD: break; + case TRIPLE_SINGLE_TAP: unregister_code(KC_ESC); break; + } + tap_state.state = 0; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + // Single tap = Backspace | Double tap = Delete + [TD_BSPC_DEL] = ACTION_TAP_DANCE_DOUBLE(KC_BSPC, KC_DEL), + // Single tap = ( | Double tap = [ | Triple tap = { | Single hold = KC_LCTL + [TD_LCTL_LBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, left_brackets, left_brackets_reset), + // Single tap = ) | Double tap = ] | Triple tap = } | Single hold = KC_LALT + [TD_LALT_RBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, right_brackets, right_brackets_reset), + // Layer Switcher ESC + [TD_ESC_LAYER] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, layer_switcher, layer_switcher_reset, 100), +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( \ + + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+. + //| | | | | | | | | | | | | + TD(TD_ESC_LAYER), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_SLSH, KC_UP, SFT_T(KC_ENT), \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + TD(TD_LCTL_LBRC), KC_LGUI, TD(TD_LALT_RBRC), _______, _______, LT(_FN, KC_SPC), _______, LT(_FX, KC_SPC), KC_COMM, KC_LEFT, KC_DOWN, KC_RGHT \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+' + ), + + [_COLEMAK] = LAYOUT( \ + + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+. + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, KC_R, KC_S, KC_T, KC_D, _______, KC_N, KC_E, KC_I, KC_O, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, KC_K, _______, _______, _______, _______, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+' + ), + + [_FN] = LAYOUT( \ + + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+. + //| | | | | | | | | | | | | + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_EQUAL, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINUS, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+' + ), + + [_FX] = LAYOUT( \ + + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+. + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, _______, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUI, RGB_TOG, \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+| + //| | | | | | | | | | | | | + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, RGB_HUD, RGB_SAD \ + //| | | | | | | | | | | | | + //,----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+' + ), + + +}; diff --git a/keyboards/jj50/keymaps/archetype/rules.mk b/keyboards/jj50/keymaps/archetype/rules.mk new file mode 100644 index 00000000000..e32e8ce741e --- /dev/null +++ b/keyboards/jj50/keymaps/archetype/rules.mk @@ -0,0 +1,65 @@ +# Copyright 2017 Luiz Ribeiro +# Modified 2018 Wayne Jones (WarmCatUK) + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = lite +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes +NKRO_ENABLE = no +# Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +TAP_DANCE_ENABLE = yes +AUTO_SHIFT_ENABLE = yes + + +DISABLE_WS2812 = no + +KEY_LOCK_ENABLE = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + + +#OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c backlight.c + +# programming options +PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex + +LAYOUTS = ortho_5x12 diff --git a/keyboards/jj50/keymaps/default/keymap.c b/keyboards/jj50/keymaps/default/keymap.c index 9d753eb8e6e..d5334d4956b 100644 --- a/keyboards/jj50/keymaps/default/keymap.c +++ b/keyboards/jj50/keymaps/default/keymap.c @@ -18,8 +18,6 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "rgblight.h" #define ______ KC_TRNS #define _DEFLT 0 @@ -113,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \ BL_STEP, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ ), - + /* Fn * ,-----------------------------------------------------------------------------------. * | | | £ | | | | | | | | | | diff --git a/keyboards/jj50/program b/keyboards/jj50/program deleted file mode 100644 index a88d9cd9b04..00000000000 --- a/keyboards/jj50/program +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from __future__ import print_function - -import os -import sys -import time -import usb - -if len(sys.argv) < 2: - print('Usage: %s ' % sys.argv[0]) - sys.exit(1) - -print('Searching for ps2avrGB... ', end='') - -dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D) -if dev is None: - raise ValueError('Device not found') - -print('Found', end='\n\n') - -print('Device Information:') -print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) -print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) -print('Manufacturer: %s' % (dev.iManufacturer)) -print('Serial: %s' % (dev.iSerialNumber)) -print('Product: %s' % (dev.iProduct), end='\n\n') - -print('Transferring control to bootloader... ', end='') - -dev.set_configuration() - -request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - -USBRQ_HID_SET_REPORT = 0x09 -HID_REPORT_OPTION = 0x0301 - - -try: - dev.ctrl_transfer( - request_type, - USBRQ_HID_SET_REPORT, - HID_REPORT_OPTION, - 0, - [0, 0, 0xFF] + [0] * 5 - ) -except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - -# wait a bit until bootloader starts up -time.sleep(2) - -print('OK') -print('Programming...') -if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0: - print('\nDone!') diff --git a/keyboards/jj50/rules.mk b/keyboards/jj50/rules.mk index 4cc90185938..4ee5719185e 100644 --- a/keyboards/jj50/rules.mk +++ b/keyboards/jj50/rules.mk @@ -57,11 +57,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend CUSTOM_MATRIX = yes SRC = matrix.c i2c.c backlight.c -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # programming options -PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex LAYOUTS = ortho_5x12 diff --git a/keyboards/jm60/config.h b/keyboards/jm60/config.h index cb5c90bb193..0d2d0730e79 100644 --- a/keyboards/jm60/config.h +++ b/keyboards/jm60/config.h @@ -50,11 +50,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/jm60/keymaps/default/keymap.c b/keyboards/jm60/keymaps/default/keymap.c index 091a214f5b1..6ca04c50567 100644 --- a/keyboards/jm60/keymaps/default/keymap.c +++ b/keyboards/jm60/keymaps/default/keymap.c @@ -11,8 +11,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-----------------------------------------------------------. diff --git a/keyboards/jm60/keymaps/poker3/keymap.c b/keyboards/jm60/keymaps/poker3/keymap.c index 422ab302367..07f432dcd88 100644 --- a/keyboards/jm60/keymaps/poker3/keymap.c +++ b/keyboards/jm60/keymaps/poker3/keymap.c @@ -10,8 +10,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer */ diff --git a/keyboards/jm60/readme.md b/keyboards/jm60/readme.md index b513a2c4c0a..51473fc090b 100644 --- a/keyboards/jm60/readme.md +++ b/keyboards/jm60/readme.md @@ -11,7 +11,7 @@ Make example for this keyboard (after setting up your build environment): make jm60:default:bin -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Flashing Instructions diff --git a/keyboards/k_type/config.h b/keyboards/k_type/config.h index 4937d9ad99a..a841a571073 100644 --- a/keyboards/k_type/config.h +++ b/keyboards/k_type/config.h @@ -41,11 +41,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/k_type/keymaps/belak/keymap.c b/keyboards/k_type/keymaps/belak/keymap.c index 6bddeb13e18..ed9392a2a59 100644 --- a/keyboards/k_type/keymaps/belak/keymap.c +++ b/keyboards/k_type/keymaps/belak/keymap.c @@ -1,7 +1,5 @@ #include "k_type.h" -#define _______ KC_TRNS - #define _QW 0 #define _L1 1 @@ -22,10 +20,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), }; -const uint16_t fn_actions[] = { - -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/keyboards/k_type/keymaps/default/keymap.c b/keyboards/k_type/keymaps/default/keymap.c index 90b3ac7686f..331d3315527 100644 --- a/keyboards/k_type/keymaps/default/keymap.c +++ b/keyboards/k_type/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "k_type.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( @@ -10,10 +10,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), }; -const uint16_t fn_actions[] = { - -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/keyboards/k_type/readme.md b/keyboards/k_type/readme.md index ad4dd8ad84b..1118f8655eb 100644 --- a/keyboards/k_type/readme.md +++ b/keyboards/k_type/readme.md @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make k_type:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/k_type/rules.mk b/keyboards/k_type/rules.mk index a1c56903b5c..7762f186820 100644 --- a/keyboards/k_type/rules.mk +++ b/keyboards/k_type/rules.mk @@ -57,6 +57,7 @@ ARMV = 7 OPT_DEFS = DFU_ARGS = -d 1c11:b007 +DFU_SUFFIX_ARGS = -p b007 -v 1c11 # Build Options # comment out to disable the options. diff --git a/keyboards/kagamidget/config.h b/keyboards/kagamidget/config.h new file mode 100644 index 00000000000..7fe67ffd337 --- /dev/null +++ b/keyboards/kagamidget/config.h @@ -0,0 +1,217 @@ +/* +Copyright 2019 yynmt + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER yynmt +#define PRODUCT KagaMidget +#define DESCRIPTION 48 keys tiny keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D1, D0, F4, F5 } +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5, B6, B2, B3, B1, F7, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + + +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 4 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/kagamidget/info.json b/keyboards/kagamidget/info.json new file mode 100644 index 00000000000..a9e0dd1b8fe --- /dev/null +++ b/keyboards/kagamidget/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "KagaMidget", + "url": "http://yynmt.com", + "maintainer": "yynmt", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 48, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3} + ] + } + } +} diff --git a/keyboards/kagamidget/kagamidget.c b/keyboards/kagamidget/kagamidget.c new file mode 100644 index 00000000000..1f790c9e777 --- /dev/null +++ b/keyboards/kagamidget/kagamidget.c @@ -0,0 +1,43 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kagamidget.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/kagamidget/kagamidget.h b/keyboards/kagamidget/kagamidget.h new file mode 100644 index 00000000000..e0655a4e989 --- /dev/null +++ b/keyboards/kagamidget/kagamidget.h @@ -0,0 +1,39 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K01, K05, K09, K13, K17, K21, K25, K29, K33, K37, K41, K45, \ + K02, K06, K10, K14, K18, K22, K26, K30, K34, K38, K42, K46, \ + K03, K07, K11, K15, K19, K23, K27, K31, K35, K39, K43, K47, \ + K04, K08, K12, K16, K20, K24, K28, K32, K36, K40, K44, K48 \ +) \ +{ \ + { K01, K05, K09, K13, K17, K21, K25, K29, K33, K37, K41, K45 }, \ + { K02, K06, K10, K14, K18, K22, K26, K30, K34, K38, K42, K46 }, \ + { K03, K07, K11, K15, K19, K23, K27, K31, K35, K39, K43, K47 }, \ + { K04, K08, K12, K16, K20, K24, K28, K32, K36, K40, K44, K48 }, \ +} diff --git a/keyboards/kagamidget/keymaps/default/config.h b/keyboards/kagamidget/keymaps/default/config.h new file mode 100644 index 00000000000..bab59c67e07 --- /dev/null +++ b/keyboards/kagamidget/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kagamidget/keymaps/default/keymap.c b/keyboards/kagamidget/keymaps/default/keymap.c new file mode 100644 index 00000000000..3d9a9547008 --- /dev/null +++ b/keyboards/kagamidget/keymaps/default/keymap.c @@ -0,0 +1,118 @@ +/* Copyright 2019 yynmt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +enum layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_RSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| Debug|RGBTog|RGBMod|RGBHuI|RGBHuD|RGBSaI|RGBSaD|RGBVaI|RGBVaD| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kagamidget/keymaps/default/readme.md b/keyboards/kagamidget/keymaps/default/readme.md new file mode 100644 index 00000000000..9ce02fb09d3 --- /dev/null +++ b/keyboards/kagamidget/keymaps/default/readme.md @@ -0,0 +1,49 @@ +# The default keymap for KagaMidget +## Qwerty +``` +,-----------------------------------------------------------------------------------. +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Esc | A | S | D | F | G | H | J | K | L | ; | " | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Shift| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` +## Lower +``` +,-----------------------------------------------------------------------------------. +| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Next | Vol- | Vol+ | Play | +`-----------------------------------------------------------------------------------' + ``` +## Raise +``` +,-----------------------------------------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Next | Vol- | Vol+ | Play | +`-----------------------------------------------------------------------------------' +``` +## Adjust (Lower + Raise) +``` +,-----------------------------------------------------------------------------------. +| | Reset| Debug|RGBTog|RGBMod|RGBHuI|RGBHuD|RGBSaI|RGBSaD|RGBVaI|RGBVaD| Del | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/kagamidget/readme.md b/keyboards/kagamidget/readme.md new file mode 100644 index 00000000000..af38fdd8589 --- /dev/null +++ b/keyboards/kagamidget/readme.md @@ -0,0 +1,14 @@ +# KagaMidget + +![KagaMidget](https://raw.githubusercontent.com/yynmt/KagaMidget/master/images/main_image.jpg) + +KagaMidget is 40% tiny keyboard. + +Keyboard Maintainer: [yynmt](https://github.com/yynmt) +Hardware Supported: KagaMidget PCBs, ProMicro supported + +Make example for this keyboard (after setting up your build environment): + + make kagamidget:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kagamidget/rules.mk b/keyboards/kagamidget/rules.mk new file mode 100644 index 00000000000..e7445a6faf6 --- /dev/null +++ b/keyboards/kagamidget/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +RGBLIGHT_ENABLE = yes diff --git a/keyboards/katana60/config.h b/keyboards/katana60/config.h index aaf2b5d5447..3385ddb9cb7 100644 --- a/keyboards/katana60/config.h +++ b/keyboards/katana60/config.h @@ -46,16 +46,15 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B7, B3, B2, B1, B0, C7, D1, D2, C6, B6, B5, B4, D4, D6, D7 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -105,11 +104,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define TAPPING_TERM 200 /* control how magic key switches layers */ diff --git a/keyboards/katana60/keymaps/colemak/keymap.c b/keyboards/katana60/keymaps/colemak/keymap.c index 9a1af8d68ea..b0ed0418543 100644 --- a/keyboards/katana60/keymaps/colemak/keymap.c +++ b/keyboards/katana60/keymaps/colemak/keymap.c @@ -15,9 +15,6 @@ */ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Windows based definitions. #define K_SPCFN LT(SYMB, KC_SPACE) // Tap for space, hold for symbols layer #define K_PRVWD LCTL(KC_LEFT) // Previous word @@ -67,12 +64,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(CURS, KC_BSPC), - [1] = ACTION_LAYER_TAP_KEY(SYMB, KC_SPACE), -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/katana60/keymaps/default/config.h b/keyboards/katana60/keymaps/default/config.h index 08c51f6cb50..c4bea7eb031 100644 --- a/keyboards/katana60/keymaps/default/config.h +++ b/keyboards/katana60/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/katana60/keymaps/default/keymap.c b/keyboards/katana60/keymaps/default/keymap.c index abc018952a4..3e7e2191ffc 100644 --- a/keyboards/katana60/keymaps/default/keymap.c +++ b/keyboards/katana60/keymaps/default/keymap.c @@ -15,9 +15,6 @@ */ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Windows based definitions. #define K_SPCFN LT(SYMB, KC_SPACE) // Tap for space, hold for symbols layer #define K_PRVWD LCTL(KC_LEFT) // Previous word @@ -67,28 +64,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(CURS, KC_BSPC), - [1] = ACTION_LAYER_TAP_KEY(SYMB, KC_SPACE), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/katana60/keymaps/josefadamcik/config.h b/keyboards/katana60/keymaps/josefadamcik/config.h new file mode 100644 index 00000000000..0054f43e6bd --- /dev/null +++ b/keyboards/katana60/keymaps/josefadamcik/config.h @@ -0,0 +1,20 @@ +/* Copyright 2017 Baris Tosun + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here + diff --git a/keyboards/katana60/keymaps/josefadamcik/keymap.c b/keyboards/katana60/keymaps/josefadamcik/keymap.c new file mode 100644 index 00000000000..8556ee424c9 --- /dev/null +++ b/keyboards/katana60/keymaps/josefadamcik/keymap.c @@ -0,0 +1,163 @@ +/* Copyright 2019 Josef Adamcik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum katana_layers { + /* _M_XYZ = Mac Os, _W_XYZ = Win/Linux */ + _M_COLEMAK, + _M_QWERTY, + _W_COLEMAK, + _W_QWERTY, + _NUMB, + _SYMB, + _M_EXT, + _W_EXT +}; + +enum katana_keycodes { + M_COLEMAK = SAFE_RANGE, + M_QWERTY, + W_COLEMAK, + W_QWERTY +}; + +#define K_SPCFN LT(_SYMB, KC_SPACE) /* Tap for space, hold for symbols layer */ +#define K_BSPFN LT(_SYMB, KC_BSPC) /* Tap for backspace, hold for symbols layer */ +/* Linux/win variants */ +#define W_LEFT_MOD MT(MOD_RCTL, KC_LEFT) +#define W_DOWN_MOD MT(MOD_RALT, KC_DOWN) +#define W_UP_MOD MT(MOD_RGUI, KC_UP) +#define W_UNDO LCTL(KC_Z) +#define W_CUT LCTL(KC_X) +#define W_COPY LCTL(KC_C) +#define W_PASTE LCTL(KC_V) +#define W_PRVWD LCTL(KC_LEFT) +#define W_NXTWD LCTL(KC_RIGHT) +#define W_LSTRT KC_HOME +#define W_LEND KC_END +/* Mac variants */ +#define M_LEFT_MOD MT(MOD_RGUI, KC_LEFT) +#define M_DOWN_MOD MT(MOD_RALT, KC_DOWN) +#define M_UP_MOD MT(MOD_RCTL, KC_UP) +#define M_UNDO LGUI(KC_Z) +#define M_CUT LGUI(KC_X) +#define M_COPY LGUI(KC_C) +#define M_PASTE LGUI(KC_V) +#define M_PRVWD LALT(KC_LEFT) +#define M_NXTWD LALT(KC_RIGHT) +#define M_LSTRT LGUI(KC_LEFT) +#define M_LEND LGUI(KC_RIGHT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_M_COLEMAK] = LAYOUT( + KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_NUMB),KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LBRC, KC_RBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + MO(_M_EXT),KC_A, KC_R, KC_S, KC_T, KC_D, KC_MINS, KC_QUOT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_EQL, KC_DEL, KC_BSLS, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MO(_SYMB), KC_LCTL, KC_LALT, KC_LGUI, K_BSPFN, KC_ENT, KC_SPACE, M_LEFT_MOD,M_DOWN_MOD,M_UP_MOD, KC_RIGHT,MO(_SYMB) +), +[_M_QWERTY] = LAYOUT( + KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_NUMB),KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(_M_EXT),KC_A, KC_S, KC_D, KC_F, KC_G, KC_MINS, KC_QUOT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_EQL, KC_DEL, KC_BSLS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MO(_SYMB), KC_LCTL, KC_LALT, KC_LGUI, K_BSPFN, KC_ENT, KC_SPACE, M_LEFT_MOD,M_DOWN_MOD,M_UP_MOD, KC_RIGHT,MO(_SYMB) +), +[_W_COLEMAK] = LAYOUT( + KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_NUMB),KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LBRC, KC_RBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + MO(_W_EXT),KC_A, KC_R, KC_S, KC_T, KC_D, KC_MINS, KC_QUOT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_EQL, KC_DEL, KC_BSLS, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MO(_SYMB), KC_LGUI, KC_LALT, KC_LCTL, K_BSPFN, KC_ENT, KC_SPACE, W_LEFT_MOD,W_DOWN_MOD,W_UP_MOD, KC_RIGHT,MO(_SYMB) +), +[_W_QWERTY] = LAYOUT( + KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_NUMB),KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(_W_EXT),KC_A, KC_S, KC_D, KC_F, KC_G, KC_MINS, KC_QUOT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_EQL, KC_DEL, KC_BSLS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MO(_SYMB), KC_LGUI, KC_LALT, KC_LCTL, K_BSPFN, KC_ENT, KC_SPACE, W_LEFT_MOD,W_DOWN_MOD,W_UP_MOD, KC_RIGHT,MO(_SYMB) +), +[_NUMB] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, KC_PSLS, KC_PAST, KC_PMNS, _______, _______, + _______, _______, _______, KC_MS_U, _______, _______, _______, _______,_______, KC_7, KC_8, KC_9, KC_PPLS, _______, + _______, KC_BTN2, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______,_______, KC_4, KC_5, KC_6, KC_PPLS, _______, + _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______,_______, KC_1, KC_2, KC_3, KC_PENT, _______, + _______, _______, _______, _______, KC_BTN1, _______, KC_P0, KC_PDOT, _______, _______, _______, _______ +), +[_SYMB] = LAYOUT( + RESET, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_VOLD, KC_VOLU, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_PLUS, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_MPRV, KC_MPLY, KC_MNXT, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______, + _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______, _______ +), +[_M_EXT] = LAYOUT( + RESET ,M_COLEMAK,M_QWERTY,W_COLEMAK,W_QWERTY,_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, M_PRVWD, KC_UP, M_NXTWD, _______, _______, + _______, KC_LALT, KC_LCTL, KC_LSFT, _______, KC_CAPS, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, _______, + _______, M_UNDO, M_CUT, M_COPY, M_PASTE, _______, _______, _______, _______, _______, M_LSTRT, _______, M_LEND, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +[_W_EXT] = LAYOUT( + RESET ,M_COLEMAK,M_QWERTY,W_COLEMAK,W_QWERTY,_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, W_PRVWD, KC_UP, W_NXTWD, _______, _______, + _______, KC_LALT, KC_LCTL, KC_LSFT, _______, KC_CAPS, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, _______, + _______, W_UNDO, W_CUT, W_COPY, W_PASTE, _______, _______, _______, _______, _______, W_LSTRT, _______, W_LEND, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case M_QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_M_QWERTY); + } + return false; + break; + case M_COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_M_COLEMAK); + } + return false; + break; + case W_QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_W_QWERTY); + } + return false; + break; + case W_COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_W_COLEMAK); + } + return false; + break; + } + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/katana60/keymaps/josefadamcik/readme.md b/keyboards/katana60/keymaps/josefadamcik/readme.md new file mode 100644 index 00000000000..5d72b1defa0 --- /dev/null +++ b/keyboards/katana60/keymaps/josefadamcik/readme.md @@ -0,0 +1,23 @@ +![Multi OS Katana60 layout image](https://i.imgur.com/1w2OA1o.png) + +# Multi OS Katana60 layout + +Based on the default Katana60 layout, customized by [Josef Adamcik](https://josef-adamcik.cz) with several basic layers (Colemak vs Qwerty, Mac OS vs Linux/Win) + +- Supports 4 default layers: Colemak Mac, Qwerty Mac, Colemak Win/Linux, Qwerty Win/Linux. Switching between default layers is persisted. For more details about Mac vs Win/Linux see below. +- There are arrows mapped to the right side of the bottom row on Katana6O. I kept this mapping but modified it a bit - when you press and hold any of the first three arrow keys it acts as a modifier (CMD, OPT, CTRL). If you just tap it, it acts as an arrow. + +## Mac versus Win/Linux layers: + +- Modifiers are ordered differently. Mac version has (from the middle to the outside): CMD, ALT, CTRL, Win/Linux version has CTRL, ALT, CMD. It's meant to make switching between platforms easier. +- Extend layer is different, so the keys which represent shortcuts ("previous/next word" and "copy", "paste", "cut", "undo") work properly. + +## More details - reasons for some choices in this layout + +I use Mac for work and Ubuntu at home. So I would like to stay compatible with both systems. The main problem is the modifiers. Firstly, they tend to be ordered differently on Mac keyboards. Secondly, the main modifier on Mac is CMD (equivalent to WIn or SUPER on other keyboards). The same role is played by CTRL on Windows and Linux. Most of IDE’s or editors (Android Studio, VS Code, SublimeText) follow this habit in their OS-specific keymaps. + +I am a user of the Colemak layout. But I would like to have the ability to switch to qwerty. That would allow my other people to use my keyboard occasionally. + +I am a heavy user of keyboard shortcuts. So I need the layout to support my needs. Some keyboard layout has modifiers only on one side of the keyboard or they hide some of them (CMD) under a key combination. I tend to press the modifiers for a key shortcut with the opposite hand to the one which presses the letter. + +Layout in [keyboard-layout-editor.com](http://www.keyboard-layout-editor.com/#/gists/14d62ee67d36621c37888783fa29b107) diff --git a/keyboards/katana60/keymaps/msiu/config.h b/keyboards/katana60/keymaps/msiu/config.h new file mode 100644 index 00000000000..b57cc482ec7 --- /dev/null +++ b/keyboards/katana60/keymaps/msiu/config.h @@ -0,0 +1,21 @@ +/* Copyright 2017 Baris Tosun + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + + +// place overrides here + diff --git a/keyboards/katana60/keymaps/msiu/keymap.c b/keyboards/katana60/keymaps/msiu/keymap.c new file mode 100644 index 00000000000..72b795baa59 --- /dev/null +++ b/keyboards/katana60/keymaps/msiu/keymap.c @@ -0,0 +1,70 @@ +#include QMK_KEYBOARD_H + +// Mod-Tap keys for cleaner code +#define ESC_CTL LCTL_T(KC_ESC) +#define SPC_LW LT(2, KC_SPC) +#define ENT_FN LT(4, KC_ENT) + +#define _QW 0 +#define _DV 1 +#define _LW 2 +#define _RS 3 +#define _FN 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QW] = LAYOUT( /* Base */ + KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(1), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_PLUS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + ESC_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_DEL, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_HYPR, KC_LALT, KC_LGUI, SPC_LW, ENT_FN, KC_SPC, MO(3), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), +[_DV] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, _______, _______, KC_F, KC_G, KC_C, KC_R, KC_L, _______, + _______, KC_A, KC_O, KC_E, KC_U, KC_I, _______, _______, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, _______, _______, _______, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +[_LW] = LAYOUT( + _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +[_RS] = LAYOUT( + _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT + ), +[_FN] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + + + + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/katana60/keymaps/msiu/readme.md b/keyboards/katana60/keymaps/msiu/readme.md new file mode 100644 index 00000000000..e4f0ebdb6ec --- /dev/null +++ b/keyboards/katana60/keymaps/msiu/readme.md @@ -0,0 +1,3 @@ +# msiu's keymap for katana: standard QWERTY layout with planck like layers + +This layout take a standard QWERTY default layer, with raise and lower layers similar to planck. It is for me to easily transition between keyboards. I put a few nav keys in the 'tree' middle, but I have come to realise I rarely use them as I am used to the planck layering. Top of the tree is a toggle for Dvorak layer. diff --git a/keyboards/katana60/keymaps/rominronin/keymap.c b/keyboards/katana60/keymaps/rominronin/keymap.c index cb8427f10c8..7af9ab87f33 100644 --- a/keyboards/katana60/keymaps/rominronin/keymap.c +++ b/keyboards/katana60/keymaps/rominronin/keymap.c @@ -15,9 +15,6 @@ */ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // MacOS based definitions. #define K_SPCFN LT(SYMB, KC_SPACE) // Tap for space, hold for symbols layer #define K_PRVWD LALT(KC_LEFT) // Previous word diff --git a/keyboards/katana60/readme.md b/keyboards/katana60/readme.md index 918c9b99723..5e1c7d39060 100644 --- a/keyboards/katana60/readme.md +++ b/keyboards/katana60/readme.md @@ -12,6 +12,6 @@ Make example for this keyboard (after setting up your build environment): make katana60:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. There is also ongoing discussion for the extend layer, at the [Colemak Forum](https://forum.colemak.com/topic/2327-developing-an-extend-layer-for-the-katana60/) \ No newline at end of file diff --git a/keyboards/katana60/rules.mk b/keyboards/katana60/rules.mk index ca2a2a5f80b..d4ed1d08de6 100644 --- a/keyboards/katana60/rules.mk +++ b/keyboards/katana60/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/kbd19x/config.h b/keyboards/kbd19x/config.h deleted file mode 100644 index 47cfd7484a7..00000000000 --- a/keyboards/kbd19x/config.h +++ /dev/null @@ -1,224 +0,0 @@ -/* -Copyright 2018 Jeff Shufelt @jshuf - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER KBDFans -#define PRODUCT kbd19x -#define DESCRIPTION A compact-1800 keyboard kit. - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 13 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B7, B3, E6, F0, D5, D4, D6, C7 } -#define MATRIX_COL_PINS { C6, F1, F4, F5, F6, F7, D7, B4, B5, D0, D1, D2, D3 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B6 -// #define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - -#define RGB_DI_PIN E2 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 18 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - diff --git a/keyboards/kbd19x/info.json b/keyboards/kbd19x/info.json deleted file mode 100644 index 31f2f9cf57e..00000000000 --- a/keyboards/kbd19x/info.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "keyboard_name": "KBD19x", - "url": "https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbd19x", - "maintainer": "qmk", - "width": 19.5, - "height": 6.75, - "layouts": { - "LAYOUT_ansi": { - "key_count": 99, - "layout": [{"label":"Esc", "x":0, "y":0}, - {"label":"F1", "x":1.25, "y":0}, - {"label":"F2", "x":2.25, "y":0}, - {"label":"F3", "x":3.25, "y":0}, - {"label":"F4", "x":4.25, "y":0}, - {"label":"F5", "x":5.5, "y":0}, - {"label":"F6", "x":6.5, "y":0}, - {"label":"F7", "x":7.5, "y":0}, - {"label":"F8", "x":8.5, "y":0}, - {"label":"F9", "x":9.75, "y":0}, - {"label":"F10", "x":10.75, "y":0}, - {"label":"F11", "x":11.75, "y":0}, - {"label":"F12", "x":12.75, "y":0}, - {"label":"BkLgt Step", "x":14, "y":0}, - {"label":"Print Screen", "x":15.5, "y":0}, - {"label":"Scroll Lock", "x":16.5, "y":0}, - {"label":"Pause Break", "x":17.5, "y":0}, - {"label":"PgDn", "x":18.5, "y":0}, - {"label":"~", "x":0, "y":1.5}, - {"label":"!", "x":1, "y":1.5}, - {"label":"@", "x":2, "y":1.5}, - {"label":"#", "x":3, "y":1.5}, - {"label":"$", "x":4, "y":1.5}, - {"label":"%", "x":5, "y":1.5}, - {"label":"^", "x":6, "y":1.5}, - {"label":"&", "x":7, "y":1.5}, - {"label":"*", "x":8, "y":1.5}, - {"label":"(", "x":9, "y":1.5}, - {"label":")", "x":10, "y":1.5}, - {"label":"_", "x":11, "y":1.5}, - {"label":"+", "x":12, "y":1.5}, - {"label":"Backspace", "x":13, "y":1.5, "w":2}, - {"label":"Num Lock", "x":15.5, "y":1.5}, - {"label":"/", "x":16.5, "y":1.5}, - {"label":"*", "x":17.5, "y":1.5}, - {"label":"-", "x":18.5, "y":1.5}, - {"label":"Tab", "x":0, "y":2.5, "w":1.5}, - {"label":"Q", "x":1.5, "y":2.5}, - {"label":"W", "x":2.5, "y":2.5}, - {"label":"E", "x":3.5, "y":2.5}, - {"label":"R", "x":4.5, "y":2.5}, - {"label":"T", "x":5.5, "y":2.5}, - {"label":"Y", "x":6.5, "y":2.5}, - {"label":"U", "x":7.5, "y":2.5}, - {"label":"I", "x":8.5, "y":2.5}, - {"label":"O", "x":9.5, "y":2.5}, - {"label":"P", "x":10.5, "y":2.5}, - {"label":"{", "x":11.5, "y":2.5}, - {"label":"}", "x":12.5, "y":2.5}, - {"label":"|", "x":13.5, "y":2.5, "w":1.5}, - {"label":"7", "x":15.5, "y":2.5}, - {"label":"8", "x":16.5, "y":2.5}, - {"label":"9", "x":17.5, "y":2.5}, - {"label":"+", "x":18.5, "y":2.5, "h":2}, - {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, - {"label":"A", "x":1.75, "y":3.5}, - {"label":"S", "x":2.75, "y":3.5}, - {"label":"D", "x":3.75, "y":3.5}, - {"label":"F", "x":4.75, "y":3.5}, - {"label":"G", "x":5.75, "y":3.5}, - {"label":"H", "x":6.75, "y":3.5}, - {"label":"J", "x":7.75, "y":3.5}, - {"label":"K", "x":8.75, "y":3.5}, - {"label":"L", "x":9.75, "y":3.5}, - {"label":":", "x":10.75, "y":3.5}, - {"label":"\"", "x":11.75, "y":3.5}, - {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, - {"label":"4", "x":15.5, "y":3.5}, - {"label":"5", "x":16.5, "y":3.5}, - {"label":"6", "x":17.5, "y":3.5}, - {"label":"Shift", "x":0, "y":4.5, "w":2.25}, - {"label":"Z", "x":2.25, "y":4.5}, - {"label":"X", "x":3.25, "y":4.5}, - {"label":"C", "x":4.25, "y":4.5}, - {"label":"V", "x":5.25, "y":4.5}, - {"label":"B", "x":6.25, "y":4.5}, - {"label":"N", "x":7.25, "y":4.5}, - {"label":"M", "x":8.25, "y":4.5}, - {"label":"<", "x":9.25, "y":4.5}, - {"label":">", "x":10.25, "y":4.5}, - {"label":"?", "x":11.25, "y":4.5}, - {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, - {"label":"1", "x":15.5, "y":4.5}, - {"label":"2", "x":16.5, "y":4.5}, - {"label":"3", "x":17.5, "y":4.5}, - {"label":"Enter", "x":18.5, "y":4.5, "h":2}, - {"label":"\u2191", "x":14.25, "y":4.75}, - {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, - {"label":"Win", "x":1.25, "y":5.5}, - {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, - {"x":3.5, "y":5.5, "w":6.25}, - {"label":"Alt", "x":9.75, "y":5.5}, - {"label":"MO(1)", "x":10.75, "y":5.5}, - {"label":"Ctrl", "x":11.75, "y":5.5, "w":1.25}, - {"label":"0", "x":16.5, "y":5.5}, - {"label":".", "x":17.5, "y":5.5}, - {"label":"\u2190", "x":13.25, "y":5.75}, - {"label":"\u2193", "x":14.25, "y":5.75}, - {"label":"\u2192", "x":15.25, "y":5.75}] - }, - "LAYOUT_all": { - "key_count": 103, - "layout": [{"label":"Esc", "x":0, "y":0}, - {"label":"F1", "x":1.25, "y":0}, - {"label":"F2", "x":2.25, "y":0}, - {"label":"F3", "x":3.25, "y":0}, - {"label":"F4", "x":4.25, "y":0}, - {"label":"F5", "x":5.5, "y":0}, - {"label":"F6", "x":6.5, "y":0}, - {"label":"F7", "x":7.5, "y":0}, - {"label":"F8", "x":8.5, "y":0}, - {"label":"F9", "x":9.75, "y":0}, - {"label":"F10", "x":10.75, "y":0}, - {"label":"F11", "x":11.75, "y":0}, - {"label":"F12", "x":12.75, "y":0}, - {"label":"BkLgt Step", "x":14, "y":0}, - {"label":"Print Screen", "x":15.5, "y":0}, - {"label":"Scroll Lock", "x":16.5, "y":0}, - {"label":"Pause Break", "x":17.5, "y":0}, - {"label":"PgDn", "x":18.5, "y":0}, - {"label":"~", "x":0, "y":1.5}, - {"label":"!", "x":1, "y":1.5}, - {"label":"@", "x":2, "y":1.5}, - {"label":"#", "x":3, "y":1.5}, - {"label":"$", "x":4, "y":1.5}, - {"label":"%", "x":5, "y":1.5}, - {"label":"^", "x":6, "y":1.5}, - {"label":"&", "x":7, "y":1.5}, - {"label":"*", "x":8, "y":1.5}, - {"label":"(", "x":9, "y":1.5}, - {"label":")", "x":10, "y":1.5}, - {"label":"_", "x":11, "y":1.5}, - {"label":"+", "x":12, "y":1.5}, - {"x":13, "y":1.5}, - {"label":"BS", "x":14, "y":1.5}, - {"label":"Num Lock", "x":15.5, "y":1.5}, - {"label":"/", "x":16.5, "y":1.5}, - {"label":"*", "x":17.5, "y":1.5}, - {"label":"-", "x":18.5, "y":1.5}, - {"label":"Tab", "x":0, "y":2.5, "w":1.5}, - {"label":"Q", "x":1.5, "y":2.5}, - {"label":"W", "x":2.5, "y":2.5}, - {"label":"E", "x":3.5, "y":2.5}, - {"label":"R", "x":4.5, "y":2.5}, - {"label":"T", "x":5.5, "y":2.5}, - {"label":"Y", "x":6.5, "y":2.5}, - {"label":"U", "x":7.5, "y":2.5}, - {"label":"I", "x":8.5, "y":2.5}, - {"label":"O", "x":9.5, "y":2.5}, - {"label":"P", "x":10.5, "y":2.5}, - {"label":"{", "x":11.5, "y":2.5}, - {"label":"}", "x":12.5, "y":2.5}, - {"label":"|", "x":13.5, "y":2.5, "w":1.5}, - {"label":"7", "x":15.5, "y":2.5}, - {"label":"8", "x":16.5, "y":2.5}, - {"label":"9", "x":17.5, "y":2.5}, - {"label":"+", "x":18.5, "y":2.5}, - {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, - {"label":"A", "x":1.75, "y":3.5}, - {"label":"S", "x":2.75, "y":3.5}, - {"label":"D", "x":3.75, "y":3.5}, - {"label":"F", "x":4.75, "y":3.5}, - {"label":"G", "x":5.75, "y":3.5}, - {"label":"H", "x":6.75, "y":3.5}, - {"label":"J", "x":7.75, "y":3.5}, - {"label":"K", "x":8.75, "y":3.5}, - {"label":"L", "x":9.75, "y":3.5}, - {"label":":", "x":10.75, "y":3.5}, - {"label":"\"", "x":11.75, "y":3.5}, - {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, - {"label":"4", "x":15.5, "y":3.5}, - {"label":"5", "x":16.5, "y":3.5}, - {"label":"6", "x":17.5, "y":3.5}, - {"x":18.5, "y":3.5}, - {"label":"Shift", "x":0, "y":4.5, "w":1.25}, - {"x":1.25, "y":4.5}, - {"label":"Z", "x":2.25, "y":4.5}, - {"label":"X", "x":3.25, "y":4.5}, - {"label":"C", "x":4.25, "y":4.5}, - {"label":"V", "x":5.25, "y":4.5}, - {"label":"B", "x":6.25, "y":4.5}, - {"label":"N", "x":7.25, "y":4.5}, - {"label":"M", "x":8.25, "y":4.5}, - {"label":"<", "x":9.25, "y":4.5}, - {"label":">", "x":10.25, "y":4.5}, - {"label":"?", "x":11.25, "y":4.5}, - {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, - {"label":"1", "x":15.5, "y":4.5}, - {"label":"2", "x":16.5, "y":4.5}, - {"label":"3", "x":17.5, "y":4.5}, - {"label":"Enter", "x":18.5, "y":4.5}, - {"label":"\u2191", "x":14.25, "y":4.75}, - {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, - {"label":"Win", "x":1.25, "y":5.5}, - {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, - {"x":3.5, "y":5.5, "w":6.25}, - {"label":"Alt", "x":9.75, "y":5.5}, - {"label":"Menu", "x":10.75, "y":5.5}, - {"label":"Ctrl", "x":11.75, "y":5.5, "w":1.25}, - {"label":"0", "x":16.5, "y":5.5}, - {"label":".", "x":17.5, "y":5.5}, - {"x":18.5, "y":5.5}, - {"label":"\u2190", "x":13.25, "y":5.75}, - {"label":"\u2193", "x":14.25, "y":5.75}, - {"label":"\u2192", "x":15.25, "y":5.75}] - } - } -} - diff --git a/keyboards/kbd19x/kbd19x.c b/keyboards/kbd19x/kbd19x.c deleted file mode 100644 index 360345600d0..00000000000 --- a/keyboards/kbd19x/kbd19x.c +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2018 Jeff Shufelt @jshuf - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "kbd19x.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - if (usb_led & (1< @jshuf - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef KBD19X_H -#define KBD19X_H - -#include "quantum.h" -#include "led.h" - -inline void kbd19x_caps_led_on(void) { DDRB |= (1<<0); PORTB &= ~(1<<0); } -inline void kbd19x_caps_led_off(void) { DDRB &= ~(1<<0); PORTB &= ~(1<<0); } - -inline void kbd19x_sclk_led_on(void) { DDRB |= (1<<1); PORTB &= ~(1<<1); } -inline void kbd19x_sclk_led_off(void) { DDRB &= ~(1<<1); PORTB &= ~(1<<1); } - -inline void kbd19x_nmlk_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); } -inline void kbd19x_nmlk_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } - -// readability -#define XXX KC_NO - -/* This is a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ - -// 2u backspace: XXX, k1e -// split backspace: k1d, k1e - -// 2u numpad +: k2i, XXX -// split numpad +: k2i, k3i - -// 2u numpad enter: k4i, XXX -// split numpad enter: k4i, k5i - -// 2.25u lshift: k40, XXX -// split (1.25u, 1u) lshift: k40, k41 - -// ANSI enter or ISO enter: k3e -// backslash or NUHS: k2e - -// left winkey: k50, k51, k52 -// left WKL: k50, XXX, k52 - -// right winkey: k59, k5a, k5b -// right WKL: k59, XXX, k5b - -#define LAYOUT_all( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, k0f, k0g, k0h, k0i, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h, k1i, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, k2h, k2i, \ - k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, k3f, k3g, k3h, k3i, \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4e, k4f, k4g, k4h, k4i, \ - k50, k51, k52, k56, k59, k5a, k5b, k5d, k5e, k5f, k5g, k5h, k5i \ -)\ -{\ - {k00, k01, k02, k03, k04, k09, k0a, k0b, k0c, k0f, k0g, k0h, k0i},\ - {k10, k11, k12, k13, k14, k19, k1a, k1b, k1c, k1f, k1g, k1h, k1i},\ - {k20, k21, k22, k23, k24, k29, k2a, k2b, k2c, k2f, k2g, k2h, k2i},\ - {k30, k32, k33, k34, k35, k3a, k3b, k3c, k3e, k3f, k3g, k3h, k3i},\ - {k40, k41, k42, k43, k44, k49, k4a, k4b, k4c, k4f, k4g, k4h, k4i},\ - {k50, k51, k52, k5e, k5f, k59, k5a, k5b, k5d, k56, k5g, k5h, k5i},\ - {k05, k06, k07, k08, k15, k16, k17, k18, k25, k26, k27, k28, k36},\ - {k1d, k1e, k0e, k2e, k4e, k37, k38, k39, k45, k46, k47, k48, XXX},\ -} - -#define LAYOUT_ansi( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, k0f, k0g, k0h, k0i, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, k1g, k1h, k1i, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, k2h, k2i, \ - k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, k3f, k3g, k3h, \ - k40, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4e, k4f, k4g, k4h, k4i, \ - k50, k51, k52, k56, k59, k5a, k5b, k5d, k5e, k5f, k5g, k5h \ -)\ -{\ - {k00, k01, k02, k03, k04, k09, k0a, k0b, k0c, k0f, k0g, k0h, k0i},\ - {k10, k11, k12, k13, k14, k19, k1a, k1b, k1c, k1f, k1g, k1h, k1i},\ - {k20, k21, k22, k23, k24, k29, k2a, k2b, k2c, k2f, k2g, k2h, k2i},\ - {k30, k32, k33, k34, k35, k3a, k3b, k3c, k3e, k3f, k3g, k3h, XXX},\ - {k40, XXX, k42, k43, k44, k49, k4a, k4b, k4c, k4f, k4g, k4h, k4i},\ - {k50, k51, k52, k5e, k5f, k59, k5a, k5b, k5d, k56, k5g, k5h, XXX},\ - {k05, k06, k07, k08, k15, k16, k17, k18, k25, k26, k27, k28, k36},\ - {XXX, k1e, k0e, k2e, k4e, k37, k38, k39, k45, k46, k47, k48, XXX},\ -} -#endif diff --git a/keyboards/kbd19x/readme.md b/keyboards/kbd19x/readme.md deleted file mode 100644 index ee4969b00d5..00000000000 --- a/keyboards/kbd19x/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# kbd19x - -![kbd19x](https://i.imgur.com/0hWTEnh.jpg) - -**Layout possibilities for the KBD19x** - -![kbd19x](https://i.imgur.com/pVaR2zY.png) - -The KBD19x is a compact-1800 keyboard kit produced by KBDfans, offering a number of layout options. - -Keyboard Maintainer: [jshuf](https://github.com/jshuf) -Hardware Supported: KBD19x PCB -Hardware Availability: [KBDfans](https://kbdfans.cn) - -Make example for this keyboard (after setting up your build environment): - - make kbd19x:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbd19x/rules.mk b/keyboards/kbd19x/rules.mk deleted file mode 100644 index 8e50962afaf..00000000000 --- a/keyboards/kbd19x/rules.mk +++ /dev/null @@ -1,80 +0,0 @@ -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Bootloader selection -# Teensy halfkay -# Pro Micro caterina -# Atmel DFU atmel-dfu -# LUFA DFU lufa-dfu -# QMK DFU qmk-dfu -# atmega32a bootloadHID -BOOTLOADER = atmel-dfu - - -# If you don't know the bootloader type, then you can specify the -# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -# OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/kbd4x/config.h b/keyboards/kbd4x/config.h deleted file mode 100644 index b967ab8f756..00000000000 --- a/keyboards/kbd4x/config.h +++ /dev/null @@ -1,223 +0,0 @@ -/* -Copyright 2018 sevenseacat - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER KBDFans -#define PRODUCT KBD4x -#define DESCRIPTION A compact 40% (12x4) ortholinear keyboard kit. - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 12 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D0, D1, D2, D3 } -#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B3, B1, B0, D5, B7, C7 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B6 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - -#define RGB_DI_PIN E2 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ diff --git a/keyboards/kbd4x/info.json b/keyboards/kbd4x/info.json deleted file mode 100644 index f9952e79031..00000000000 --- a/keyboards/kbd4x/info.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "keyboard_name": "kbd4x", - "url": "", - "maintainer": "qmk", - "width": 14, - "height": 4, - "layouts": { - "LAYOUT_planck_mit": { - "layout": [ - {"label":"ESC", "x":0, "y":0}, - {"label":"Q", "x":1, "y":0}, - {"label":"W", "x":2, "y":0}, - {"label":"E", "x":3, "y":0}, - {"label":"R", "x":4, "y":0}, - {"label":"T", "x":5, "y":0}, - {"label":"Y", "x":6, "y":0}, - {"label":"U", "x":7, "y":0}, - {"label":"I", "x":8, "y":0}, - {"label":"O", "x":9, "y":0}, - {"label":"P", "x":10, "y":0}, - {"label":"BKSP", "x":11, "y":0}, - {"label":"TAB", "x":0, "y":1}, - {"label":"A", "x":1, "y":1}, - {"label":"S", "x":2, "y":1}, - {"label":"D", "x":3, "y":1}, - {"label":"F", "x":4, "y":1}, - {"label":"G", "x":5, "y":1}, - {"label":"H", "x":6, "y":1}, - {"label":"J", "x":7, "y":1}, - {"label":"K", "x":8, "y":1}, - {"label":"L", "x":9, "y":1}, - {"label":";", "x":10, "y":1}, - {"label":"'", "x":11, "y":1}, - {"label":"SHIFT", "x":0, "y":2}, - {"label":"Z", "x":1, "y":2}, - {"label":"X", "x":2, "y":2}, - {"label":"C", "x":3, "y":2}, - {"label":"V", "x":4, "y":2}, - {"label":"B", "x":5, "y":2}, - {"label":"N", "x":6, "y":2}, - {"label":"M", "x":7, "y":2}, - {"label":",", "x":8, "y":2}, - {"label":".", "x":9, "y":2}, - {"label":"UP", "x":10, "y":2}, - {"label":"ENTER", "x":11, "y":2}, - {"label":"LCTRL", "x":0, "y":3}, - {"label":"LGUI", "x":1, "y":3}, - {"label":"1", "x":2, "y":3}, - {"label":"2", "x":3, "y":3}, - {"label":"3", "x":4, "y":3}, - {"label":"SPACE", "x":5, "y":3, "w":2}, - {"label":"MO(1)", "x":7, "y":3}, - {"label":"/", "x":8, "y":3}, - {"label":"LEFT", "x":9, "y":3}, - {"label":"DOWN", "x":10, "y":3}, - {"label":"RIGHT", "x":11, "y":3} - ] - }, - "LAYOUT_ortho_4x12": { - "layout": [ - {"label":"ESC", "x":0, "y":0}, - {"label":"Q", "x":1, "y":0}, - {"label":"W", "x":2, "y":0}, - {"label":"E", "x":3, "y":0}, - {"label":"R", "x":4, "y":0}, - {"label":"T", "x":5, "y":0}, - {"label":"Y", "x":6, "y":0}, - {"label":"U", "x":7, "y":0}, - {"label":"I", "x":8, "y":0}, - {"label":"O", "x":9, "y":0}, - {"label":"P", "x":10, "y":0}, - {"label":"BKSP", "x":11, "y":0}, - {"label":"TAB", "x":0, "y":1}, - {"label":"A", "x":1, "y":1}, - {"label":"S", "x":2, "y":1}, - {"label":"D", "x":3, "y":1}, - {"label":"F", "x":4, "y":1}, - {"label":"G", "x":5, "y":1}, - {"label":"H", "x":6, "y":1}, - {"label":"J", "x":7, "y":1}, - {"label":"K", "x":8, "y":1}, - {"label":"L", "x":9, "y":1}, - {"label":";", "x":10, "y":1}, - {"label":"'", "x":11, "y":1}, - {"label":"SHIFT", "x":0, "y":2}, - {"label":"Z", "x":1, "y":2}, - {"label":"X", "x":2, "y":2}, - {"label":"C", "x":3, "y":2}, - {"label":"V", "x":4, "y":2}, - {"label":"B", "x":5, "y":2}, - {"label":"N", "x":6, "y":2}, - {"label":"M", "x":7, "y":2}, - {"label":",", "x":8, "y":2}, - {"label":".", "x":9, "y":2}, - {"label":"UP", "x":10, "y":2}, - {"label":"ENTER", "x":11, "y":2}, - {"label":"LCTRL", "x":0, "y":3}, - {"label":"LGUI", "x":1, "y":3}, - {"label":"1", "x":2, "y":3}, - {"label":"2", "x":3, "y":3}, - {"label":"3", "x":4, "y":3}, - {"label":"SPACE", "x":5, "y":3}, - {"label":"MO(2)", "x":6, "y":3}, - {"label":"MO(1)", "x":7, "y":3}, - {"label":"/", "x":8, "y":3}, - {"label":"LEFT", "x":9, "y":3}, - {"label":"DOWN", "x":10, "y":3}, - {"label":"RIGHT", "x":11, "y":3} - ] - } - } -} diff --git a/keyboards/kbd4x/kbd4x.h b/keyboards/kbd4x/kbd4x.h deleted file mode 100644 index d7a851e3ebd..00000000000 --- a/keyboards/kbd4x/kbd4x.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2018 sevenseacat - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef KBD4X_H -#define KBD4X_H - -#include "quantum.h" - -#define LAYOUT_planck_mit( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b } \ -} - -// The PCB does support a grid layout, but the case does not. -#define LAYOUT_ortho_4x12( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ -} - -#endif diff --git a/keyboards/kbd4x/readme.md b/keyboards/kbd4x/readme.md deleted file mode 100644 index 42dc450248c..00000000000 --- a/keyboards/kbd4x/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# KBD4x - -![KBD4x](https://cdn.shopify.com/s/files/1/1473/3902/products/1_ef8d3ad0-fc70-4d4f-9e36-8438c781a581_1800x1800.jpg) - -A compact 40% (12x4) ortholinear keyboard kit sold by KBDFans. - -Keyboard Maintainer: ![sevenseacat](https://github.com/sevenseacat) -Hardware Supported: KBD4x PCB -Hardware Availability: https://kbdfans.cn/collections/diy-kit/products/kbd4x-custom-mechanical-keyboard-hot-swap-diy-kit - -Make example for this keyboard (after setting up your build environment): - - make kbd4x:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbd4x/rules.mk b/keyboards/kbd4x/rules.mk deleted file mode 100644 index 6cfd92bc63b..00000000000 --- a/keyboards/kbd4x/rules.mk +++ /dev/null @@ -1,81 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Bootloader selection -# Teensy halfkay -# Pro Micro caterina -# Atmel DFU atmel-dfu -# LUFA DFU lufa-dfu -# QMK DFU qmk-dfu -# atmega32a bootloadHID -BOOTLOADER = atmel-dfu - - -# If you don't know the bootloader type, then you can specify the -# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -# OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/kbd66/config.h b/keyboards/kbd66/config.h deleted file mode 100644 index 1802a021966..00000000000 --- a/keyboards/kbd66/config.h +++ /dev/null @@ -1,191 +0,0 @@ -/* -Copyright 2018 Alex Peters - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xBD66 -#define DEVICE_VER 0x0001 -#define MANUFACTURER KBDFans -#define PRODUCT KBD66 -#define DESCRIPTION QMK keyboard firmware for KBD66 - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 16 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B0, B1, F0, F1, D4 } // From qmkeyboard.cn -#define MATRIX_COL_PINS { C6, C7, E2, F5, F6, F4, D3, D2, D5, D0, D1, B4, D7, D6, E6, B3 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B6 -#define BACKLIGHT_LEVELS 3 -#define BACKLIGHT_BREATHING -#define BREATHING_PERIOD 6 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/kbd66/kbd66.h b/keyboards/kbd66/kbd66.h deleted file mode 100644 index 6a4b99ec425..00000000000 --- a/keyboards/kbd66/kbd66.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2018 Alex Peters - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef KBD66_H -#define KBD66_H - -#include "quantum.h" - -// This a shortcut to help you visually see your layout. -#define LAYOUT_all( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D,k0E, k0F, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ - k40, k41, k42, k45, k48, k4A, k4B, k4C, k4D, k4E, k4F \ -) { \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F}, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO, k1F}, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, KC_NO, KC_NO}, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, KC_NO}, \ - { k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, k48, KC_NO, k4A, k4B, k4C, k4D, k4E, k4F}, \ -} - -#endif diff --git a/keyboards/kbd66/keymaps/ansi/keymap.c b/keyboards/kbd66/keymaps/ansi/keymap.c deleted file mode 100644 index f2275d9f634..00000000000 --- a/keyboards/kbd66/keymaps/ansi/keymap.c +++ /dev/null @@ -1,103 +0,0 @@ -/* Copyright 2018 Alex Peters - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -#define _____ KC_TRNS -#define XXXXX KC_NO -#define _L0 0 -#define _L1 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Layer 0 - * ,-----------------------------------------------------------. ,---. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BckSp | |INS| - * |-----------------------------------------------------------| |---| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |DEL| - * |-----------------------------------------------------------| `---' - * |Cap | A| S| D| F| G| H| J| K| L| ;| '| Enter | - * |---------------------------------------------------------------. - * | Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | UP| - * |-------------------------------------------------------------------. - * |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG| - * `-------------------------------------------------------------------' - */ -[_L0] = LAYOUT_all( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXX, KC_BSPC, KC_INS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, XXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXX, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT -), - - /* Layer 1 - * ,-----------------------------------------------------------. ,---. - * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |HOM| - * |-----------------------------------------------------------| |---| - * | | | | | | | | | | |PSc|VDn|VUp| Mute| |END| - * |-----------------------------------------------------------| `---' - * |RESET| | | | | | |PRV|PLY|NXT|STP| | | - * |---------------------------------------------------------------. - * | | | | | | | | |BLB|BLC|Slp| |PUp| - * |-------------------------------------------------------------------. - * | | | | | | | | |PDn|SLk| - * `-------------------------------------------------------------------' - */ -[_L1] = LAYOUT_all( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, _____, KC_HOME, - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, - RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____, - _____, _____, _____, _____, _____, _____, _____, _____, _____, BL_BRTG, BL_STEP, KC_SLEP, _____, _____, KC_PGUP, - _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PGDN, KC_SLCK -) - -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/kbd66/keymaps/default/keymap.c b/keyboards/kbd66/keymaps/default/keymap.c deleted file mode 100644 index 6a4c0b57f6a..00000000000 --- a/keyboards/kbd66/keymaps/default/keymap.c +++ /dev/null @@ -1,103 +0,0 @@ -/* Copyright 2018 Alex Peters - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -#define _____ KC_TRNS -#define XXXXX KC_NO -#define _L0 0 -#define _L1 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Layer 0 - * ,-----------------------------------------------------------. ,---. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `| BS| |INS| - * |-----------------------------------------------------------| |---| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |DEL| - * |-----------------------------------------------------------| `---' - * |Cap | A| S| D| F| G| H| J| K| L| ;| '| Enter | - * |---------------------------------------------------------------. - * |Shft| `| Z| X| C| V| B| N| M| ,| .| /| Shft |Fn | UP| - * |-------------------------------------------------------------------. - * |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG| - * `-------------------------------------------------------------------' - */ -[_L0] = LAYOUT_all( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_L1), KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT -), - - /* Layer 1 - * ,-----------------------------------------------------------. ,---. - * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | |HOM| - * |-----------------------------------------------------------| |---| - * | | | | | | | | | | |PSc|VDn|VUp| Mute| |END| - * |-----------------------------------------------------------| `---' - * |RESET| | | | | | |PRV|PLY|NXT|STP| | | - * |---------------------------------------------------------------. - * | | | | | | | | | |BLB|BLC|Slp| | |PUp| - * |-------------------------------------------------------------------. - * | | | | | | | | |PDn|SLk| - * `-------------------------------------------------------------------' - */ -[_L1] = LAYOUT_all( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, _____, KC_HOME, - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, - RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____, - _____, _____, _____, _____, _____, _____, _____, _____, _____, BL_BRTG, BL_STEP, KC_SLEP, _____, _____, KC_PGUP, - _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PGDN, KC_SLCK -) - -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/kbd66/keymaps/iso/keymap.c b/keyboards/kbd66/keymaps/iso/keymap.c deleted file mode 100644 index 4e304098497..00000000000 --- a/keyboards/kbd66/keymaps/iso/keymap.c +++ /dev/null @@ -1,103 +0,0 @@ -/* Copyright 2018 Alex Peters - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -#define _____ KC_TRNS -#define XXXXX KC_NO -#define _L0 0 -#define _L1 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Layer 0 - * ,-----------------------------------------------------------. ,---. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BckSp | |INS| - * |-----------------------------------------------------------| |---| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |DEL| - * |------------------------------------------------------|Ent | `---' - * |Cap | A| S| D| F| G| H| J| K| L| ;| '| #| | - * |---------------------------------------------------------------. - * |Shft| \| Z| X| C| V| B| N| M| ,| .| /| Shft |Fn | UP| - * |-------------------------------------------------------------------. - * |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG| - * `-------------------------------------------------------------------' - */ -[_L0] = LAYOUT_all( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NUHS, KC_DEL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_L1), KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT -), - - /* Layer 1 - * ,-----------------------------------------------------------. ,---. - * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | |HOM| - * |-----------------------------------------------------------| |---| - * | | | | | | | | | | |PSc|VDn|VUp| | |END| - * |------------------------------------------------------| | `---' - * |RESET | | | | | | |PRV|PLY|NXT|STP| |Mut| | - * |---------------------------------------------------------------. - * | | | | | | | | | |BLB|BLC|Slp| | |PUp| - * |-------------------------------------------------------------------. - * | | | | | | | | |PDn|SLk| - * `-------------------------------------------------------------------' - */ -[_L1] = LAYOUT_all( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, _____, KC_HOME, - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, - RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____, - _____, _____, _____, _____, _____, _____, _____, _____, _____, BL_BRTG, BL_STEP, KC_SLEP, _____, _____, KC_PGUP, - _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PGDN, KC_SLCK -) - -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/kbd66/keymaps/maartenwut/config.h b/keyboards/kbd66/keymaps/maartenwut/config.h deleted file mode 100755 index c7b3d6ecc33..00000000000 --- a/keyboards/kbd66/keymaps/maartenwut/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Alex Peters - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif diff --git a/keyboards/kbd66/readme.md b/keyboards/kbd66/readme.md deleted file mode 100644 index 71fe1f2e305..00000000000 --- a/keyboards/kbd66/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# KBD66 - -![KBD66](https://i.imgur.com/qtLuL2o.jpg) - -A 65% keyboard from KBDFans. - -Keyboard Maintainer: [Alex](https://github.com/allo-world) -Hardware Supported: KBD66, ATmega32U4 -Hardware Availability: [KBDFans](https://kbdfans.cn), [Massdrop](https://www.massdrop.com/buy/kbd66-mechanical-keyboard-kit?mode=guest_open) - -Make example for this keyboard (after setting up your build environment): - - make kbd66:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/kbd66/rules.mk b/keyboards/kbd66/rules.mk deleted file mode 100644 index 45eb6ee3766..00000000000 --- a/keyboards/kbd66/rules.mk +++ /dev/null @@ -1,68 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/kbd6x/config.h b/keyboards/kbd6x/config.h deleted file mode 100644 index 6a5ebf06242..00000000000 --- a/keyboards/kbd6x/config.h +++ /dev/null @@ -1,225 +0,0 @@ -/* -Copyright 2018 MechMerlin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER You -#define PRODUCT kbd6x -#define DESCRIPTION A custom keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 } -#define MATRIX_COL_PINS { F6, F5, F4, F1, E6, D0, D1, D2, D3, D5, D6, D7, B4, B5 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B7 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - -#define RGB_DI_PIN F0 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 14 -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#endif - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - diff --git a/keyboards/kbd6x/kbd6x.h b/keyboards/kbd6x/kbd6x.h deleted file mode 100644 index 3d0c70f77ab..00000000000 --- a/keyboards/kbd6x/kbd6x.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef KBD6X_H -#define KBD6X_H - -#include "quantum.h" - -#define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K4D,\ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K41, K42, K46, K4A, K4B, K4C \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ - { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D }, \ -} - -#endif diff --git a/keyboards/kbd6x/keymaps/default/keymap.c b/keyboards/kbd6x/keymaps/default/keymap.c deleted file mode 100644 index 00adbf8873b..00000000000 --- a/keyboards/kbd6x/keymaps/default/keymap.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_RCTL - ), - - [1] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - diff --git a/keyboards/kbd6x/readme.md b/keyboards/kbd6x/readme.md deleted file mode 100644 index b50646ace13..00000000000 --- a/keyboards/kbd6x/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# KBD6x - -A WKL Hot Swap Double USB C 60% - -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: KBD6x PCB -Hardware Availability: [KBDFans](https://kbdfans.cn/products/kbd6x-wkl-hot-swap-60-double-type-c-pcb) - -Make example for this keyboard (after setting up your build environment): - - make kbd6x:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/kbd6x/rules.mk b/keyboards/kbd6x/rules.mk deleted file mode 100644 index 5c7a3877eef..00000000000 --- a/keyboards/kbd6x/rules.mk +++ /dev/null @@ -1,70 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/kbd75/config.h b/keyboards/kbd75/config.h deleted file mode 100644 index 726afcaf6e7..00000000000 --- a/keyboards/kbd75/config.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER qmkbuilder -#define PRODUCT KBD75 -#define DESCRIPTION QMK keyboard firmware for KBD75 - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 16 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5, B7 } -#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, F5, D4, B1, B0, B5, B4, D7, D6, B3, F4, F6 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* number of backlight levels */ -#define BACKLIGHT_PIN B6 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 5 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define RGB_DI_PIN E2 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -#endif diff --git a/keyboards/kbd75/kbd75.h b/keyboards/kbd75/kbd75.h deleted file mode 100644 index 0798ad0996c..00000000000 --- a/keyboards/kbd75/kbd75.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef KBD75_H -#define KBD75_H - -#include "quantum.h" - -#ifdef KEYBOARD_kbd75_rev1 - #include "rev1.h" -#endif - -#ifdef KEYBOARD_kbd75_rev2 - #include "../rev1/rev1.h" - #include "rev2.h" -#endif - -#endif diff --git a/keyboards/kbd75/keymaps/adit/keymap.c b/keyboards/kbd75/keymaps/adit/keymap.c deleted file mode 100644 index 3c70d97864c..00000000000 --- a/keyboards/kbd75/keymaps/adit/keymap.c +++ /dev/null @@ -1,114 +0,0 @@ -#include QMK_KEYBOARD_H - -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, LT(1,KC_END), - KC_CAPS, KC_LALT, _______, _______, KC_SPC, _______, KC_RGUI, _______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - - [1] = LAYOUT( - RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - - switch (id) { - - } - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/kbd75/keymaps/default/keymap.c b/keyboards/kbd75/keymaps/default/keymap.c deleted file mode 100644 index 3074d869278..00000000000 --- a/keyboards/kbd75/keymaps/default/keymap.c +++ /dev/null @@ -1,33 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, MO(1), KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, MO(1), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - - [1] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), -}; - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } -} - diff --git a/keyboards/kbd75/keymaps/iso/keymap.c b/keyboards/kbd75/keymaps/iso/keymap.c deleted file mode 100644 index 230f1dd73a1..00000000000 --- a/keyboards/kbd75/keymaps/iso/keymap.c +++ /dev/null @@ -1,32 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, MO(1), KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - - [1] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } -} diff --git a/keyboards/kbd75/keymaps/smt/keymap.c b/keyboards/kbd75/keymaps/smt/keymap.c deleted file mode 100644 index a29a7e8a9fa..00000000000 --- a/keyboards/kbd75/keymaps/smt/keymap.c +++ /dev/null @@ -1,180 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _FL 3 -#define _CL 4 - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK -}; - -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: Qwerty layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │H_TAB│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BKSPC│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │C_ESC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 0: ANSI qwerty */ - [_QWERTY] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_INS, KC_HOME, \ - HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ - CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ - KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_END, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), - - /* 1: Colemak layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │H_TAB│ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │BKSPC│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │C_ESC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 1: ANSI colemak */ - [_COLEMAK] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_INS, KC_HOME, \ - HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ - CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGDN, \ - KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_END, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), - - /* 2: Dvorak layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │H_TAB│ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │BKSPC│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │C_ESC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │ END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 2: ANSI dvorak */ - [_DVORAK] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, \ - HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, KC_PGUP, \ - CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGDN, \ - KC_LSFT, _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_END, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), - - /* 3: Function layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │PG_UP│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ _FL │ │HOME │PG_DN│ END │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 3: ANSI Fn layer */ - [_FL] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, _______, _______, MO(_FL), _______, KC_HOME, KC_PGDN, KC_END), - - /* 4: Control layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ RGB │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │RESET│ │ │QWRTY│COLMK│DVORK│ │ │ │ │█████│RGBV+│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│RGBV-│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ _FL │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │RGBS+│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│RGB_M│█████│█████│█████│ │ _FL │ │RGBH-│RGBS-│RGBH+│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 4: ANSI control layer */ - [_CL] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, \ - _______, _______, _______, _______, RESET, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, RGB_VAI, \ - _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, \ - MO(_FL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, _______, \ - _______, _______, _______, _______, RGB_MOD, _______, _______, MO(_FL), _______, RGB_HUD, RGB_SAD, RGB_HUI), -}; - - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - } - return true; -} diff --git a/keyboards/kbd75/keymaps/spacemanspiff/keymap.c b/keyboards/kbd75/keymaps/spacemanspiff/keymap.c deleted file mode 100644 index 82a2ad9bec7..00000000000 --- a/keyboards/kbd75/keymaps/spacemanspiff/keymap.c +++ /dev/null @@ -1,50 +0,0 @@ -#include QMK_KEYBOARD_H - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -#define _BL 0 // Base Layer -#define _FN 1 // Function Layer -#define _CL 2 // Control+ Layer - -// Add names for complex momentary keys, to keep the keymap matrix aligned better. -#define CTL_ESC MT(MOD_LCTL,KC_ESC) -#define GUI_ENT MT(MOD_RGUI, KC_ENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_BL] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, MO(_FN), KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, MO(_FN), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - MO(_CL), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, GUI_ENT, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - - [_FN] = LAYOUT( - RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, - _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [_CL] = LAYOUT( - LCTL(KC_ESC), LCTL(KC_F1), LCTL(KC_F2), LCTL(KC_F3), LCTL(KC_F4), LCTL(KC_F5), LCTL(KC_F6), LCTL(KC_F7), LCTL(KC_F8), LCTL(KC_F9), LCTL(KC_F10), LCTL(KC_F11), LCTL(KC_F12), LCTL(KC_PSCR), _______, LCTL(KC_DEL), - KC_ESC, LCTL(KC_1), LCTL(KC_2), LCTL(KC_3), LCTL(KC_4), LCTL(KC_5), LCTL(KC_6), LCTL(KC_7), LCTL(KC_8), LCTL(KC_9), LCTL(KC_0), LCTL(KC_MINS), LCTL(KC_EQL), LCTL(KC_DEL), KC_DEL, LCTL(KC_HOME), - LCTL(KC_TAB), LCTL(KC_Q), LCTL(KC_W), LCTL(KC_E), LCTL(KC_R), LCTL(KC_T), LCTL(KC_Y), LCTL(KC_U), LCTL(KC_I), LCTL(KC_O), KC_PGUP, LCTL(KC_LBRC), LCTL(KC_RBRC), LCTL(KC_BSLS), LCTL(KC_PGUP), - CTL_ESC, LCTL(KC_A), LCTL(KC_S), LCTL(KC_D), LCTL(KC_F), LCTL(KC_G), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, LCTL(KC_SCLN), LCTL(KC_QUOT), LCTL(KC_ENT), LCTL(KC_PGDN), - LCTL(KC_LSFT), _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_B), KC_PGDN, LCTL(KC_M), LCTL(KC_COMM), LCTL(KC_DOT), LCTL(KC_SLSH), LCTL(KC_RSFT), LCTL(KC_UP), LCTL(KC_END), - _______, LCTL(KC_LALT), LCTL(KC_LGUI), LCTL(KC_SPC), LCTL(KC_SPC), LCTL(KC_SPC), LCTL(KC_RGUI), LCTL(KC_RALT), LCTL(KC_RCTL), LCTL(KC_LEFT), LCTL(KC_DOWN), LCTL(KC_RGHT) - ), - -}; - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } -} - diff --git a/keyboards/kbd75/readme.md b/keyboards/kbd75/readme.md deleted file mode 100644 index 0545eb66d83..00000000000 --- a/keyboards/kbd75/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -KBD75 -=== - -Keyboard Maintainer: QMK Community -Hardware Supported: KBD75 PCB rev 1 and 2 -Hardware Availability: https://kbdfans.myshopify.com/products/kbd75-keyboard-set?variant=35638534029 - -The KBD75 has two revisions. Revision 2 has a USB C port and allows a numpad layout. `.hex` files made -for KBD75 revision 1, will still work for revision 2. `.hex` files made for revision 2 (excluding the numpad) -will also still work on revision 1. Both revisions share the same switch matrix but have switch holes in -different areas. - -Make example for this keyboard (after setting up your build environment): - - make kbd75/rev1:default - make kbd75/rev2:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/kbd75/rev1/rev1.c b/keyboards/kbd75/rev1/rev1.c deleted file mode 100644 index 520a869e57b..00000000000 --- a/keyboards/kbd75/rev1/rev1.c +++ /dev/null @@ -1 +0,0 @@ -#include "rev1.h" diff --git a/keyboards/kbd75/rev2/rev2.c b/keyboards/kbd75/rev2/rev2.c deleted file mode 100644 index b1af81707d2..00000000000 --- a/keyboards/kbd75/rev2/rev2.c +++ /dev/null @@ -1 +0,0 @@ -#include "rev2.h" diff --git a/keyboards/kbd75/rules.mk b/keyboards/kbd75/rules.mk deleted file mode 100644 index ae49271ab36..00000000000 --- a/keyboards/kbd75/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kbd75/rev1 diff --git a/keyboards/kbd8x/config.h b/keyboards/kbd8x/config.h deleted file mode 100644 index 7749e04724b..00000000000 --- a/keyboards/kbd8x/config.h +++ /dev/null @@ -1,198 +0,0 @@ -/* -Copyright 2017 MechMerlin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER KBDFans -#define PRODUCT kbd8x -#define DESCRIPTION Custom TKL Keyboard - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 15 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { E6, B7, D4, F0, D6, D7 } -#define MATRIX_COL_PINS { D1, D0, F7, F6, F5, D5, D3, D2, C7, C6, B5, F4, F1, B4, B0 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B6 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - -#define RGB_DI_PIN E2 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 20 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - - diff --git a/keyboards/kbd8x/keymaps/default/keymap.c b/keyboards/kbd8x/keymaps/default/keymap.c deleted file mode 100644 index bfbc841d58f..00000000000 --- a/keyboards/kbd8x/keymaps/default/keymap.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright 2017 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_all( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/kbd8x/keymaps/default_backlighting/keymap.c b/keyboards/kbd8x/keymaps/default_backlighting/keymap.c deleted file mode 100644 index 6e3950e5004..00000000000 --- a/keyboards/kbd8x/keymaps/default_backlighting/keymap.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright 2017 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_all( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - - [1] = LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, RESET, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, BL_TOGG, BL_INC, BL_DEC, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/kbd8x/keymaps/default_backlighting/rules.mk b/keyboards/kbd8x/keymaps/default_backlighting/rules.mk deleted file mode 100644 index 07b9f81fd05..00000000000 --- a/keyboards/kbd8x/keymaps/default_backlighting/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -#Build Options - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/kbd8x/readme.md b/keyboards/kbd8x/readme.md deleted file mode 100644 index fe49819753b..00000000000 --- a/keyboards/kbd8x/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# KBD 8X - -![kbd8x](imgur.com image replace me!) - -TKL Keyboard from KBDFans - -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: kbd8x -Hardware Availability: [KBDFans](https://kbdfans.cn/blogs/updates/kbd-8x-update-40) - -Make example for this keyboard (after setting up your build environment): - - make kbd8x:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/kbd8x/rules.mk b/keyboards/kbd8x/rules.mk deleted file mode 100644 index e5925463ec5..00000000000 --- a/keyboards/kbd8x/rules.mk +++ /dev/null @@ -1,69 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE ?= yes # Enable keyboard RGB underglow -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/kbdfans/kbd19x/config.h b/keyboards/kbdfans/kbd19x/config.h new file mode 100644 index 00000000000..d722dc26152 --- /dev/null +++ b/keyboards/kbdfans/kbd19x/config.h @@ -0,0 +1,218 @@ +/* +Copyright 2018 Jeff Shufelt @jshuf + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT kbd19x +#define DESCRIPTION A compact-1800 keyboard kit. + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 13 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B7, B3, E6, F0, D5, D4, D6, C7 } +#define MATRIX_COL_PINS { C6, F1, F4, F5, F6, F7, D7, B4, B5, D0, D1, D2, D3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 18 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/kbdfans/kbd19x/info.json b/keyboards/kbdfans/kbd19x/info.json new file mode 100644 index 00000000000..c24ed9caa5c --- /dev/null +++ b/keyboards/kbdfans/kbd19x/info.json @@ -0,0 +1,221 @@ +{ + "keyboard_name": "KBD19x", + "url": "https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbdfans/kbd19x", + "maintainer": "qmk", + "width": 19.5, + "height": 6.75, + "layouts": { + "LAYOUT_ansi": { + "key_count": 99, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.25, "y":0}, + {"label":"F2", "x":2.25, "y":0}, + {"label":"F3", "x":3.25, "y":0}, + {"label":"F4", "x":4.25, "y":0}, + {"label":"F5", "x":5.5, "y":0}, + {"label":"F6", "x":6.5, "y":0}, + {"label":"F7", "x":7.5, "y":0}, + {"label":"F8", "x":8.5, "y":0}, + {"label":"F9", "x":9.75, "y":0}, + {"label":"F10", "x":10.75, "y":0}, + {"label":"F11", "x":11.75, "y":0}, + {"label":"F12", "x":12.75, "y":0}, + {"label":"Extra Esc", "x":14, "y":0}, + {"label":"PrtSc", "x":15.5, "y":0}, + {"label":"Pause", "x":16.5, "y":0}, + {"label":"Insert", "x":17.5, "y":0}, + {"label":"Home", "x":18.5, "y":0}, + {"label":"`~", "x":0, "y":1.5}, + {"label":"1!", "x":1, "y":1.5}, + {"label":"2@", "x":2, "y":1.5}, + {"label":"3#", "x":3, "y":1.5}, + {"label":"4$", "x":4, "y":1.5}, + {"label":"5%", "x":5, "y":1.5}, + {"label":"6^", "x":6, "y":1.5}, + {"label":"7&", "x":7, "y":1.5}, + {"label":"8*", "x":8, "y":1.5}, + {"label":"9(", "x":9, "y":1.5}, + {"label":"0)", "x":10, "y":1.5}, + {"label":"-_", "x":11, "y":1.5}, + {"label":"=+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Num Lock", "x":15.5, "y":1.5}, + {"label":"/", "x":16.5, "y":1.5}, + {"label":"*", "x":17.5, "y":1.5}, + {"label":"-", "x":18.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[{", "x":11.5, "y":2.5}, + {"label":"]}", "x":12.5, "y":2.5}, + {"label":"\\|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"7", "x":15.5, "y":2.5}, + {"label":"8", "x":16.5, "y":2.5}, + {"label":"9", "x":17.5, "y":2.5}, + {"label":"+", "x":18.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";:", "x":10.75, "y":3.5}, + {"label":"'\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":15.5, "y":3.5}, + {"label":"5", "x":16.5, "y":3.5}, + {"label":"6", "x":17.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",<", "x":9.25, "y":4.5}, + {"label":".>", "x":10.25, "y":4.5}, + {"label":"/?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Up", "x":14.25, "y":4.75}, + {"label":"1", "x":15.5, "y":4.5}, + {"label":"2", "x":16.5, "y":4.5}, + {"label":"3", "x":17.5, "y":4.5}, + {"label":"Enter", "x":18.5, "y":4.5, "h":2}, + {"label":"Control", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5}, + {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.5, "y":5.5, "w":6.25}, + {"label":"Alt", "x":9.75, "y":5.5}, + {"label":"Fn", "x":10.75, "y":5.5}, + {"label":"Control", "x":11.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":13.25, "y":5.75}, + {"label":"Right", "x":14.25, "y":5.75}, + {"label":"Down", "x":15.25, "y":5.75}, + {"label":"0", "x":16.5, "y":5.5}, + {"label":".", "x":17.5, "y":5.5} + ] + }, + "LAYOUT_all": { + "key_count": 103, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.25, "y":0}, + {"label":"F2", "x":2.25, "y":0}, + {"label":"F3", "x":3.25, "y":0}, + {"label":"F4", "x":4.25, "y":0}, + {"label":"F5", "x":5.5, "y":0}, + {"label":"F6", "x":6.5, "y":0}, + {"label":"F7", "x":7.5, "y":0}, + {"label":"F8", "x":8.5, "y":0}, + {"label":"F9", "x":9.75, "y":0}, + {"label":"F10", "x":10.75, "y":0}, + {"label":"F11", "x":11.75, "y":0}, + {"label":"F12", "x":12.75, "y":0}, + {"label":"Extra Esc", "x":14, "y":0}, + {"label":"PrtSc", "x":15.5, "y":0}, + {"label":"Pause", "x":16.5, "y":0}, + {"label":"Insert", "x":17.5, "y":0}, + {"label":"Home", "x":18.5, "y":0}, + {"label":"`~", "x":0, "y":1.5}, + {"label":"1!", "x":1, "y":1.5}, + {"label":"2@", "x":2, "y":1.5}, + {"label":"3#", "x":3, "y":1.5}, + {"label":"4$", "x":4, "y":1.5}, + {"label":"5%", "x":5, "y":1.5}, + {"label":"6^", "x":6, "y":1.5}, + {"label":"7&", "x":7, "y":1.5}, + {"label":"8*", "x":8, "y":1.5}, + {"label":"9(", "x":9, "y":1.5}, + {"label":"0)", "x":10, "y":1.5}, + {"label":"-_", "x":11, "y":1.5}, + {"label":"=+", "x":12, "y":1.5}, + {"label":"Split Backspace (Left)", "x":13, "y":1.5}, + {"label":"Split Backspace (Right)", "x":14, "y":1.5}, + {"label":"Num Lock", "x":15.5, "y":1.5}, + {"label":"/", "x":16.5, "y":1.5}, + {"label":"*", "x":17.5, "y":1.5}, + {"label":"-", "x":18.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[{", "x":11.5, "y":2.5}, + {"label":"]}", "x":12.5, "y":2.5}, + {"label":"\\|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"7", "x":15.5, "y":2.5}, + {"label":"8", "x":16.5, "y":2.5}, + {"label":"9", "x":17.5, "y":2.5}, + {"label":"Split + (Top)", "x":18.5, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";:", "x":10.75, "y":3.5}, + {"label":"'\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":15.5, "y":3.5}, + {"label":"5", "x":16.5, "y":3.5}, + {"label":"6", "x":17.5, "y":3.5}, + {"label":"Split + (Bottom)", "x":18.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO Backslash", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",<", "x":9.25, "y":4.5}, + {"label":".>", "x":10.25, "y":4.5}, + {"label":"/?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Up", "x":14.25, "y":4.75}, + {"label":"1", "x":15.5, "y":4.5}, + {"label":"2", "x":16.5, "y":4.5}, + {"label":"3", "x":17.5, "y":4.5}, + {"label":"Split Enter (Top)", "x":18.5, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5}, + {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.5, "y":5.5, "w":6.25}, + {"label":"Alt", "x":9.75, "y":5.5}, + {"label":"Fn", "x":10.75, "y":5.5}, + {"label":"Ctrl", "x":11.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":13.25, "y":5.75}, + {"label":"Down", "x":14.25, "y":5.75}, + {"label":"Right", "x":15.25, "y":5.75}, + {"label":"0", "x":16.5, "y":5.5}, + {"label":".", "x":17.5, "y":5.5}, + {"label":"Split Enter (Bottom)", "x":18.5, "y":5.5} + ] + } + } +} diff --git a/keyboards/kbdfans/kbd19x/kbd19x.c b/keyboards/kbdfans/kbd19x/kbd19x.c new file mode 100644 index 00000000000..e6cd77d656b --- /dev/null +++ b/keyboards/kbdfans/kbd19x/kbd19x.c @@ -0,0 +1,72 @@ +/* +Copyright 2018 Jeff Shufelt @jshuf + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "kbd19x.h" + +extern inline void kbd19x_caps_led_on(void); +extern inline void kbd19x_caps_led_off(void); + +extern inline void kbd19x_sclk_led_on(void); +extern inline void kbd19x_sclk_led_off(void); + +extern inline void kbd19x_nmlk_led_on(void); +extern inline void kbd19x_nmlk_led_off(void); + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (usb_led & (1< @jshuf + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" +#include "led.h" + +inline void kbd19x_caps_led_on(void) { DDRB |= (1<<0); PORTB &= ~(1<<0); } +inline void kbd19x_caps_led_off(void) { DDRB &= ~(1<<0); PORTB &= ~(1<<0); } + +inline void kbd19x_sclk_led_on(void) { DDRB |= (1<<1); PORTB &= ~(1<<1); } +inline void kbd19x_sclk_led_off(void) { DDRB &= ~(1<<1); PORTB &= ~(1<<1); } + +inline void kbd19x_nmlk_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); } +inline void kbd19x_nmlk_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } + +// readability +#define XXX KC_NO + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +// 2u backspace: XXX, k1e +// split backspace: k1d, k1e + +// 2u numpad +: k2i, XXX +// split numpad +: k2i, k3i + +// 2u numpad enter: k4i, XXX +// split numpad enter: k4i, k5i + +// 2.25u lshift: k40, XXX +// split (1.25u, 1u) lshift: k40, k41 + +// ANSI enter or ISO enter: k3e +// backslash or NUHS: k2e + +// left winkey: k50, k51, k52 +// left WKL: k50, XXX, k52 + +// right winkey: k59, k5a, k5b +// right WKL: k59, XXX, k5b + +#define LAYOUT_all( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, k0f, k0g, k0h, k0i, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h, k1i, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, k2h, k2i, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, k3f, k3g, k3h, k3i, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4e, k4f, k4g, k4h, k4i, \ + k50, k51, k52, k56, k59, k5a, k5b, k5d, k5e, k5f, k5g, k5h, k5i \ +)\ +{\ + {k00, k01, k02, k03, k04, k09, k0a, k0b, k0c, k0f, k0g, k0h, k0i},\ + {k10, k11, k12, k13, k14, k19, k1a, k1b, k1c, k1f, k1g, k1h, k1i},\ + {k20, k21, k22, k23, k24, k29, k2a, k2b, k2c, k2f, k2g, k2h, k2i},\ + {k30, k32, k33, k34, k35, k3a, k3b, k3c, k3e, k3f, k3g, k3h, k3i},\ + {k40, k41, k42, k43, k44, k49, k4a, k4b, k4c, k4f, k4g, k4h, k4i},\ + {k50, k51, k52, k5e, k5f, k59, k5a, k5b, k5d, k56, k5g, k5h, k5i},\ + {k05, k06, k07, k08, k15, k16, k17, k18, k25, k26, k27, k28, k36},\ + {k1d, k1e, k0e, k2e, k4e, k37, k38, k39, k45, k46, k47, k48, XXX},\ +} + +#define LAYOUT_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, k0f, k0g, k0h, k0i, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, k1g, k1h, k1i, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, k2h, k2i, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, k3f, k3g, k3h, \ + k40, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4e, k4f, k4g, k4h, k4i, \ + k50, k51, k52, k56, k59, k5a, k5b, k5d, k5e, k5f, k5g, k5h \ +)\ +{\ + {k00, k01, k02, k03, k04, k09, k0a, k0b, k0c, k0f, k0g, k0h, k0i},\ + {k10, k11, k12, k13, k14, k19, k1a, k1b, k1c, k1f, k1g, k1h, k1i},\ + {k20, k21, k22, k23, k24, k29, k2a, k2b, k2c, k2f, k2g, k2h, k2i},\ + {k30, k32, k33, k34, k35, k3a, k3b, k3c, k3e, k3f, k3g, k3h, XXX},\ + {k40, XXX, k42, k43, k44, k49, k4a, k4b, k4c, k4f, k4g, k4h, k4i},\ + {k50, k51, k52, k5e, k5f, k59, k5a, k5b, k5d, k56, k5g, k5h, XXX},\ + {k05, k06, k07, k08, k15, k16, k17, k18, k25, k26, k27, k28, k36},\ + {XXX, k1e, k0e, k2e, k4e, k37, k38, k39, k45, k46, k47, k48, XXX},\ +} diff --git a/keyboards/kbd19x/keymaps/default/config.h b/keyboards/kbdfans/kbd19x/keymaps/default/config.h similarity index 100% rename from keyboards/kbd19x/keymaps/default/config.h rename to keyboards/kbdfans/kbd19x/keymaps/default/config.h diff --git a/keyboards/kbd19x/keymaps/default/keymap.c b/keyboards/kbdfans/kbd19x/keymaps/default/keymap.c similarity index 100% rename from keyboards/kbd19x/keymaps/default/keymap.c rename to keyboards/kbdfans/kbd19x/keymaps/default/keymap.c diff --git a/keyboards/kbd19x/keymaps/default/readme.md b/keyboards/kbdfans/kbd19x/keymaps/default/readme.md similarity index 100% rename from keyboards/kbd19x/keymaps/default/readme.md rename to keyboards/kbdfans/kbd19x/keymaps/default/readme.md diff --git a/keyboards/kbdfans/kbd19x/readme.md b/keyboards/kbdfans/kbd19x/readme.md new file mode 100644 index 00000000000..50adfb77f0a --- /dev/null +++ b/keyboards/kbdfans/kbd19x/readme.md @@ -0,0 +1,21 @@ +# KBD19x + +![kbd19x](https://i.imgur.com/0hWTEnh.jpg) + +**Layout possibilities for the KBD19x** + +![kbd19x](https://i.imgur.com/pVaR2zY.png) + +The KBD19x is a compact-1800 keyboard kit produced by KBDfans, offering a number of layout options. + +**Reset Sequence:** Using this firmware sets `BOOTLOADER_ENABLE` to `lite`. While plugging in, hold the top left key, commonly programmed as `Esc` to put your board into bootloader mode. + +Keyboard Maintainer: [jshuf](https://github.com/jshuf) +Hardware Supported: KBD19x PCB +Hardware Availability: [KBDfans](https://kbdfans.cn) + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd19x:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd19x/rules.mk b/keyboards/kbdfans/kbd19x/rules.mk new file mode 100644 index 00000000000..b7a08f241c8 --- /dev/null +++ b/keyboards/kbdfans/kbd19x/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/kbdfans/kbd4x/config.h b/keyboards/kbdfans/kbd4x/config.h new file mode 100644 index 00000000000..07bc4b99010 --- /dev/null +++ b/keyboards/kbdfans/kbd4x/config.h @@ -0,0 +1,218 @@ +/* +Copyright 2018 sevenseacat + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT KBD4x +#define DESCRIPTION A compact 40% (12x4) ortholinear keyboard kit. + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B3, B1, B0, D5, B7, C7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/kbdfans/kbd4x/info.json b/keyboards/kbdfans/kbd4x/info.json new file mode 100644 index 00000000000..28883b265a0 --- /dev/null +++ b/keyboards/kbdfans/kbd4x/info.json @@ -0,0 +1,112 @@ +{ + "keyboard_name": "kbd4x", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_mit": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"BKSP", "x":11, "y":0}, + {"label":"TAB", "x":0, "y":1}, + {"label":"A", "x":1, "y":1}, + {"label":"S", "x":2, "y":1}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1}, + {"label":"G", "x":5, "y":1}, + {"label":"H", "x":6, "y":1}, + {"label":"J", "x":7, "y":1}, + {"label":"K", "x":8, "y":1}, + {"label":"L", "x":9, "y":1}, + {"label":";", "x":10, "y":1}, + {"label":"'", "x":11, "y":1}, + {"label":"SHIFT", "x":0, "y":2}, + {"label":"Z", "x":1, "y":2}, + {"label":"X", "x":2, "y":2}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2}, + {"label":"B", "x":5, "y":2}, + {"label":"N", "x":6, "y":2}, + {"label":"M", "x":7, "y":2}, + {"label":",", "x":8, "y":2}, + {"label":".", "x":9, "y":2}, + {"label":"UP", "x":10, "y":2}, + {"label":"ENTER", "x":11, "y":2}, + {"label":"LCTRL", "x":0, "y":3}, + {"label":"LGUI", "x":1, "y":3}, + {"label":"1", "x":2, "y":3}, + {"label":"2", "x":3, "y":3}, + {"label":"3", "x":4, "y":3}, + {"label":"SPACE", "x":5, "y":3, "w":2}, + {"label":"MO(1)", "x":7, "y":3}, + {"label":"/", "x":8, "y":3}, + {"label":"LEFT", "x":9, "y":3}, + {"label":"DOWN", "x":10, "y":3}, + {"label":"RIGHT", "x":11, "y":3} + ] + }, + "LAYOUT_ortho_4x12": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"BKSP", "x":11, "y":0}, + {"label":"TAB", "x":0, "y":1}, + {"label":"A", "x":1, "y":1}, + {"label":"S", "x":2, "y":1}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1}, + {"label":"G", "x":5, "y":1}, + {"label":"H", "x":6, "y":1}, + {"label":"J", "x":7, "y":1}, + {"label":"K", "x":8, "y":1}, + {"label":"L", "x":9, "y":1}, + {"label":";", "x":10, "y":1}, + {"label":"'", "x":11, "y":1}, + {"label":"SHIFT", "x":0, "y":2}, + {"label":"Z", "x":1, "y":2}, + {"label":"X", "x":2, "y":2}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2}, + {"label":"B", "x":5, "y":2}, + {"label":"N", "x":6, "y":2}, + {"label":"M", "x":7, "y":2}, + {"label":",", "x":8, "y":2}, + {"label":".", "x":9, "y":2}, + {"label":"UP", "x":10, "y":2}, + {"label":"ENTER", "x":11, "y":2}, + {"label":"LCTRL", "x":0, "y":3}, + {"label":"LGUI", "x":1, "y":3}, + {"label":"1", "x":2, "y":3}, + {"label":"2", "x":3, "y":3}, + {"label":"3", "x":4, "y":3}, + {"label":"SPACE", "x":5, "y":3}, + {"label":"MO(2)", "x":6, "y":3}, + {"label":"MO(1)", "x":7, "y":3}, + {"label":"/", "x":8, "y":3}, + {"label":"LEFT", "x":9, "y":3}, + {"label":"DOWN", "x":10, "y":3}, + {"label":"RIGHT", "x":11, "y":3} + ] + } + } +} diff --git a/keyboards/kbd4x/kbd4x.c b/keyboards/kbdfans/kbd4x/kbd4x.c similarity index 100% rename from keyboards/kbd4x/kbd4x.c rename to keyboards/kbdfans/kbd4x/kbd4x.c diff --git a/keyboards/kbdfans/kbd4x/kbd4x.h b/keyboards/kbdfans/kbd4x/kbd4x.h new file mode 100644 index 00000000000..ab31d3657f8 --- /dev/null +++ b/keyboards/kbdfans/kbd4x/kbd4x.h @@ -0,0 +1,58 @@ +/* Copyright 2018 sevenseacat + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT_planck_mit( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b } \ +} + +// The PCB does support a grid layout, but the case does not. +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_kc_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b }, \ + { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b }, \ + { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b }, \ + { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b } \ +} diff --git a/keyboards/kbd4x/keymaps/default/config.h b/keyboards/kbdfans/kbd4x/keymaps/default/config.h similarity index 100% rename from keyboards/kbd4x/keymaps/default/config.h rename to keyboards/kbdfans/kbd4x/keymaps/default/config.h diff --git a/keyboards/kbd4x/keymaps/default/keymap.c b/keyboards/kbdfans/kbd4x/keymaps/default/keymap.c similarity index 100% rename from keyboards/kbd4x/keymaps/default/keymap.c rename to keyboards/kbdfans/kbd4x/keymaps/default/keymap.c diff --git a/keyboards/kbd4x/keymaps/default/readme.md b/keyboards/kbdfans/kbd4x/keymaps/default/readme.md similarity index 100% rename from keyboards/kbd4x/keymaps/default/readme.md rename to keyboards/kbdfans/kbd4x/keymaps/default/readme.md diff --git a/keyboards/kbdfans/kbd4x/readme.md b/keyboards/kbdfans/kbd4x/readme.md new file mode 100644 index 00000000000..2e2a29290fa --- /dev/null +++ b/keyboards/kbdfans/kbd4x/readme.md @@ -0,0 +1,15 @@ +# KBD4x + +![KBD4x](https://cdn.shopify.com/s/files/1/1473/3902/products/1_ef8d3ad0-fc70-4d4f-9e36-8438c781a581_1800x1800.jpg) + +A compact 40% (12x4) ortholinear keyboard kit sold by KBDFans. + +Keyboard Maintainer: ![sevenseacat](https://github.com/sevenseacat) +Hardware Supported: KBD4x PCB +Hardware Availability: https://kbdfans.cn/collections/diy-kit/products/kbd4x-custom-mechanical-keyboard-hot-swap-diy-kit + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd4x:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd4x/rules.mk b/keyboards/kbdfans/kbd4x/rules.mk new file mode 100644 index 00000000000..7e9ea791270 --- /dev/null +++ b/keyboards/kbdfans/kbd4x/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_4x12 planck_mit diff --git a/keyboards/kbdfans/kbd66/config.h b/keyboards/kbdfans/kbd66/config.h new file mode 100644 index 00000000000..a2666a61975 --- /dev/null +++ b/keyboards/kbdfans/kbd66/config.h @@ -0,0 +1,182 @@ +/* +Copyright 2018 Alex Peters + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xBD66 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT KBD66 +#define DESCRIPTION QMK keyboard firmware for KBD66 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, F0, F1, D4 } // From qmkeyboard.cn +#define MATRIX_COL_PINS { C6, C7, E2, F5, F6, F4, D3, D2, D5, D0, D1, B4, D7, D6, E6, B3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 diff --git a/keyboards/kbd66/info.json b/keyboards/kbdfans/kbd66/info.json similarity index 100% rename from keyboards/kbd66/info.json rename to keyboards/kbdfans/kbd66/info.json diff --git a/keyboards/kbd66/kbd66.c b/keyboards/kbdfans/kbd66/kbd66.c similarity index 100% rename from keyboards/kbd66/kbd66.c rename to keyboards/kbdfans/kbd66/kbd66.c diff --git a/keyboards/kbdfans/kbd66/kbd66.h b/keyboards/kbdfans/kbd66/kbd66.h new file mode 100644 index 00000000000..797b331b0d7 --- /dev/null +++ b/keyboards/kbdfans/kbd66/kbd66.h @@ -0,0 +1,34 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +#define LAYOUT_all( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D,k0E, k0F, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ + k40, k41, k42, k45, k48, k4A, k4B, k4C, k4D, k4E, k4F \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F}, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO, k1F}, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, KC_NO, KC_NO}, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, KC_NO}, \ + { k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, k48, KC_NO, k4A, k4B, k4C, k4D, k4E, k4F}, \ +} + diff --git a/keyboards/kbd66/keymaps/ansi/config.h b/keyboards/kbdfans/kbd66/keymaps/ansi/config.h similarity index 100% rename from keyboards/kbd66/keymaps/ansi/config.h rename to keyboards/kbdfans/kbd66/keymaps/ansi/config.h diff --git a/keyboards/kbdfans/kbd66/keymaps/ansi/keymap.c b/keyboards/kbdfans/kbd66/keymaps/ansi/keymap.c new file mode 100644 index 00000000000..984d68971d2 --- /dev/null +++ b/keyboards/kbdfans/kbd66/keymaps/ansi/keymap.c @@ -0,0 +1,83 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _____ KC_TRNS +#define XXXXX KC_NO +#define _L0 0 +#define _L1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0 + * ,-----------------------------------------------------------. ,---. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BckSp | |INS| + * |-----------------------------------------------------------| |---| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |DEL| + * |-----------------------------------------------------------| `---' + * |Cap | A| S| D| F| G| H| J| K| L| ;| '| Enter | + * |---------------------------------------------------------------. + * | Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | UP| + * |-------------------------------------------------------------------. + * |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG| + * `-------------------------------------------------------------------' + */ +[_L0] = LAYOUT_all( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXX, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, XXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXX, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + + /* Layer 1 + * ,-----------------------------------------------------------. ,---. + * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |HOM| + * |-----------------------------------------------------------| |---| + * | | | | | | | | | | |PSc|VDn|VUp| Mute| |END| + * |-----------------------------------------------------------| `---' + * |RESET| | | | | | |PRV|PLY|NXT|STP| | | + * |---------------------------------------------------------------. + * | | | | | | | | |BLB|BLC|Slp| |PUp| + * |-------------------------------------------------------------------. + * | | | | | | | | |PDn|SLk| + * `-------------------------------------------------------------------' + */ +[_L1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, _____, KC_HOME, + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, + RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____, + _____, _____, _____, _____, _____, _____, _____, _____, _____, BL_BRTG, BL_STEP, KC_SLEP, _____, _____, KC_PGUP, + _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PGDN, KC_SLCK +) + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd66/keymaps/ansi/readme.md b/keyboards/kbdfans/kbd66/keymaps/ansi/readme.md similarity index 100% rename from keyboards/kbd66/keymaps/ansi/readme.md rename to keyboards/kbdfans/kbd66/keymaps/ansi/readme.md diff --git a/keyboards/kbdfans/kbd66/keymaps/default/config.h b/keyboards/kbdfans/kbd66/keymaps/default/config.h new file mode 100644 index 00000000000..6d42fc568a1 --- /dev/null +++ b/keyboards/kbdfans/kbd66/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kbdfans/kbd66/keymaps/default/keymap.c b/keyboards/kbdfans/kbd66/keymaps/default/keymap.c new file mode 100644 index 00000000000..60ef36390a2 --- /dev/null +++ b/keyboards/kbdfans/kbd66/keymaps/default/keymap.c @@ -0,0 +1,83 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _____ KC_TRNS +#define XXXXX KC_NO +#define _L0 0 +#define _L1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0 + * ,-----------------------------------------------------------. ,---. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `| BS| |INS| + * |-----------------------------------------------------------| |---| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |DEL| + * |-----------------------------------------------------------| `---' + * |Cap | A| S| D| F| G| H| J| K| L| ;| '| Enter | + * |---------------------------------------------------------------. + * |Shft| `| Z| X| C| V| B| N| M| ,| .| /| Shft |Fn | UP| + * |-------------------------------------------------------------------. + * |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG| + * `-------------------------------------------------------------------' + */ +[_L0] = LAYOUT_all( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_L1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + + /* Layer 1 + * ,-----------------------------------------------------------. ,---. + * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | |HOM| + * |-----------------------------------------------------------| |---| + * | | | | | | | | | | |PSc|VDn|VUp| Mute| |END| + * |-----------------------------------------------------------| `---' + * |RESET| | | | | | |PRV|PLY|NXT|STP| | | + * |---------------------------------------------------------------. + * | | | | | | | | | |BLB|BLC|Slp| | |PUp| + * |-------------------------------------------------------------------. + * | | | | | | | | |PDn|SLk| + * `-------------------------------------------------------------------' + */ +[_L1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, _____, KC_HOME, + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, + RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____, + _____, _____, _____, _____, _____, _____, _____, _____, _____, BL_BRTG, BL_STEP, KC_SLEP, _____, _____, KC_PGUP, + _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PGDN, KC_SLCK +) + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd66/keymaps/default/readme.md b/keyboards/kbdfans/kbd66/keymaps/default/readme.md similarity index 100% rename from keyboards/kbd66/keymaps/default/readme.md rename to keyboards/kbdfans/kbd66/keymaps/default/readme.md diff --git a/keyboards/kbd66/keymaps/default/config.h b/keyboards/kbdfans/kbd66/keymaps/iso/config.h similarity index 100% rename from keyboards/kbd66/keymaps/default/config.h rename to keyboards/kbdfans/kbd66/keymaps/iso/config.h diff --git a/keyboards/kbdfans/kbd66/keymaps/iso/keymap.c b/keyboards/kbdfans/kbd66/keymaps/iso/keymap.c new file mode 100644 index 00000000000..b330abaf9cb --- /dev/null +++ b/keyboards/kbdfans/kbd66/keymaps/iso/keymap.c @@ -0,0 +1,83 @@ +/* Copyright 2018 Alex Peters + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _____ KC_TRNS +#define XXXXX KC_NO +#define _L0 0 +#define _L1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0 + * ,-----------------------------------------------------------. ,---. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BckSp | |INS| + * |-----------------------------------------------------------| |---| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |DEL| + * |------------------------------------------------------|Ent | `---' + * |Cap | A| S| D| F| G| H| J| K| L| ;| '| #| | + * |---------------------------------------------------------------. + * |Shft| \| Z| X| C| V| B| N| M| ,| .| /| Shft |Fn | UP| + * |-------------------------------------------------------------------. + * |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG| + * `-------------------------------------------------------------------' + */ +[_L0] = LAYOUT_all( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NUHS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_L1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(_L1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + + /* Layer 1 + * ,-----------------------------------------------------------. ,---. + * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | |HOM| + * |-----------------------------------------------------------| |---| + * | | | | | | | | | | |PSc|VDn|VUp| | |END| + * |------------------------------------------------------| | `---' + * |RESET | | | | | | |PRV|PLY|NXT|STP| |Mut| | + * |---------------------------------------------------------------. + * | | | | | | | | | |BLB|BLC|Slp| | |PUp| + * |-------------------------------------------------------------------. + * | | | | | | | | |PDn|SLk| + * `-------------------------------------------------------------------' + */ +[_L1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _____, _____, KC_HOME, + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, + RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____, + _____, _____, _____, _____, _____, _____, _____, _____, _____, BL_BRTG, BL_STEP, KC_SLEP, _____, _____, KC_PGUP, + _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PGDN, KC_SLCK +) + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd66/keymaps/iso/readme.md b/keyboards/kbdfans/kbd66/keymaps/iso/readme.md similarity index 100% rename from keyboards/kbd66/keymaps/iso/readme.md rename to keyboards/kbdfans/kbd66/keymaps/iso/readme.md diff --git a/keyboards/kbd66/keymaps/iso/config.h b/keyboards/kbdfans/kbd66/keymaps/maartenwut/config.h similarity index 100% rename from keyboards/kbd66/keymaps/iso/config.h rename to keyboards/kbdfans/kbd66/keymaps/maartenwut/config.h diff --git a/keyboards/kbd66/keymaps/maartenwut/keymap.c b/keyboards/kbdfans/kbd66/keymaps/maartenwut/keymap.c similarity index 100% rename from keyboards/kbd66/keymaps/maartenwut/keymap.c rename to keyboards/kbdfans/kbd66/keymaps/maartenwut/keymap.c diff --git a/keyboards/kbd66/keymaps/maartenwut/readme.md b/keyboards/kbdfans/kbd66/keymaps/maartenwut/readme.md similarity index 100% rename from keyboards/kbd66/keymaps/maartenwut/readme.md rename to keyboards/kbdfans/kbd66/keymaps/maartenwut/readme.md diff --git a/keyboards/kbdfans/kbd66/readme.md b/keyboards/kbdfans/kbd66/readme.md new file mode 100644 index 00000000000..a2e5de0157f --- /dev/null +++ b/keyboards/kbdfans/kbd66/readme.md @@ -0,0 +1,15 @@ +# KBD66 + +![KBD66](https://i.imgur.com/qtLuL2o.jpg) + +A 65% keyboard from KBDFans. + +Keyboard Maintainer: [Alex](https://github.com/allo-world) +Hardware Supported: KBD66, ATmega32U4 +Hardware Availability: [KBDFans](https://kbdfans.cn), [Massdrop](https://www.massdrop.com/buy/kbd66-mechanical-keyboard-kit?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd66:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd66/rules.mk b/keyboards/kbdfans/kbd66/rules.mk new file mode 100644 index 00000000000..ffefc4bc87e --- /dev/null +++ b/keyboards/kbdfans/kbd66/rules.mk @@ -0,0 +1,67 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/kbdfans/kbd67/hotswap/config.h b/keyboards/kbdfans/kbd67/hotswap/config.h new file mode 100644 index 00000000000..fca9916ed92 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/config.h @@ -0,0 +1,240 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT KBD67 Hotswap +#define DESCRIPTION A custom 65% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 } +#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, E6, D1, D0, D2, D3, D5, D6, D7, C6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN B4 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 8 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + // #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/kbdfans/kbd67/hotswap/hotswap.c b/keyboards/kbdfans/kbd67/hotswap/hotswap.c new file mode 100644 index 00000000000..e6999f6af2b --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/hotswap.c @@ -0,0 +1,43 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "hotswap.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/kbdfans/kbd67/hotswap/hotswap.h b/keyboards/kbdfans/kbd67/hotswap/hotswap.h new file mode 100644 index 00000000000..57220050b62 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/hotswap.h @@ -0,0 +1,43 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2C, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3D, K3E, \ + K40, K41, K42, K45, K49, K4A, K4B, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E}, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, K3C, K3D, K3E}, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, KC_NO, K4D, K4E}, \ +} + diff --git a/keyboards/kbdfans/kbd67/hotswap/info.json b/keyboards/kbdfans/kbd67/hotswap/info.json new file mode 100644 index 00000000000..9f23a5f348b --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "kbd67 hotswap", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/keymap.c b/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/keymap.c new file mode 100644 index 00000000000..6cb6afaea66 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +enum layer { + LAYER_DEFAULT, + LAYER_FUNCTION, +}; + +/* Switch to function layer when held. */ +#define LY_FUNC MO(LAYER_FUNCTION) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Default layer: http://www.keyboard-layout-editor.com/#/gists/dd675b40cc4df2c7bb78847ac29f5988 */ + [LAYER_DEFAULT] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LY_FUNC, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Function layer: http://www.keyboard-layout-editor.com/#/gists/f29128427f674c43777f045e363d1b44 */ + [LAYER_FUNCTION] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, _______, + _______, KC_MPLY, KC_VOLU, KC_MSTP, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, + KC_CAPS, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_APP, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/readme.md b/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/readme.md new file mode 100644 index 00000000000..d1779152f8c --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/bcat/readme.md @@ -0,0 +1,13 @@ +# bcat's Quefrency 65% layout + +This is pretty much a stock 65% split keyboard layout, with an HHKB-style +(split) backspace and media keys in the function layer centered around the WASD +cluster. + +## Default layer + +![Default layer layout](https://i.imgur.com/stwELz3.png) + +## Function layer + +![Function layer layout](https://i.imgur.com/urDnuTC.png) diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/default/config.h b/keyboards/kbdfans/kbd67/hotswap/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/default/keymap.c b/keyboards/kbdfans/kbd67/hotswap/keymaps/default/keymap.c new file mode 100644 index 00000000000..53696301163 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/default/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_HOME, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + +[1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/default/readme.md b/keyboards/kbdfans/kbd67/hotswap/keymaps/default/readme.md new file mode 100644 index 00000000000..7e681294f2f --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for hotswap diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/stevanmilic/config.h b/keyboards/kbdfans/kbd67/hotswap/keymaps/stevanmilic/config.h new file mode 100644 index 00000000000..16497ddf0f8 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/stevanmilic/config.h @@ -0,0 +1,19 @@ +#pragma once + +#define FORCE_NKRO + +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 + +#define NO_ACTION_FUNCTION +#define NO_ACTION_MACRO +#define NO_ACTION_ONESHOT + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 +#define TAP_HOLD_CAPS_DELAY 50 diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/stevanmilic/keymap.c b/keyboards/kbdfans/kbd67/hotswap/keymaps/stevanmilic/keymap.c new file mode 100644 index 00000000000..7e36eb783da --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/stevanmilic/keymap.c @@ -0,0 +1,79 @@ +#include QMK_KEYBOARD_H + +#define FN MO(L_FN) +#define FN_CAPS LT(L_FN, KC_CAPS) +#define FN_ESC LT(L_FN, KC_ESC) +#define FN_FNLK TT(L_FN) + +#define MV_UP LCTL(KC_UP) +#define MV_DOWN LCTL(KC_DOWN) +#define MV_LEFT LCTL(KC_LEFT) +#define MV_RGHT LCTL(KC_RGHT) +#define TOP LCTL(KC_HOME) +#define BOTTOM LCTL(KC_END) + +enum keycodes { + CLEAR = SAFE_RANGE, +}; + +enum layers { + L_BASE, + L_FN, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case CLEAR: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + } + return false; + + default: + return true; + } +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │FnEsc │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │PgD│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │LCtl│LGui│LAlt│ Space │RAlt│FnLk│ │ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_BASE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_PSCR, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ + FN_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│NLk│SLk│Pau│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ │M2 │M↑ │M1 │M3 │ │ │ │ │Stp│Ply│Prv│Nxt│Clear│Ins│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │M← │M↓ │M→ │MW↑│ │ │Mv←│ ↓ │ ↑ │Mv→│ │ │Top│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │MA0│MA2│MW←│MW→│ │ │App│Vo-│Vo+│Mut│ │PgU│Btm│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_FN] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NLCK, KC_SLCK, KC_PAUS, \ + _______, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \ + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, MV_LEFT, KC_DOWN, KC_UP, MV_RGHT, _______, _______, _______, TOP, \ + _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, KC_APP, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, BOTTOM, \ + _______, _______, _______, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), +}; diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/stevanmilic/rules.mk b/keyboards/kbdfans/kbd67/hotswap/keymaps/stevanmilic/rules.mk new file mode 100644 index 00000000000..16eb6cb4489 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/stevanmilic/rules.mk @@ -0,0 +1,6 @@ +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/config.h b/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/config.h new file mode 100644 index 00000000000..cc06440e0dd --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/config.h @@ -0,0 +1,22 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// Enable cmd-option-escape on mac. +#define GRAVE_ESC_ALT_OVERRIDE + +// place overrides here diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/keymap.c b/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/keymap.c new file mode 100644 index 00000000000..0d542bf843e --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/keymap.c @@ -0,0 +1,176 @@ +/* Copyright 2019 Yonatan Zunger + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum custom_keycodes { + // Use this instead of RALT, so we can use it to switch layers but not trigger other alt-related + // behavior (like GRAVE_ESC_ALT_OVERRIDE). + MAGIC = SAFE_RANGE, +}; + +enum layers_keymap { + _QWERTY = 0, + _FUNCTION, + + _MAGIC, + _SHIFTMAGIC, +}; + +// This is so that H(xxxx) has the same width as _______, which makes the grids more legible. +#define H(x) UC(0x##x) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Del|Brk|Home| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |End | + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Alt |Win | Space |Alt| FN |||||Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BRK, KC_HOME, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, MAGIC, MO(_FUNCTION), KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer. Blank keys are deliberately NO, not TRNS. + * ,----------------------------------------------------------------. + * |Rst |F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|F13|PSc|PAUS| + * |----------------------------------------------------------------| + * |Debug| | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * |Ctrl | |Vo+| | | | | | | | | | | | + * |----------------------------------------------------------------| + * |Shift |REV|Vo-|FWD| | | | | | | | McL|MsU|McR | + * |----------------------------------------------------------------| + * |Ctrl|Alt |Win | |Alt| |||||MsL|MsD|MsR | + * `----------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_PSCR, KC_MPLY, \ + DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, _______, \ + _______, KC_NO, KC__VOLUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + _______, KC_MRWD, KC__VOLDOWN, KC_MFFD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_MS_U, KC_BTN2, \ + _______, _______, _______, KC_NO, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R), + + /* Mathematical lower layer. Blank keys are TRNS. + * Note that escape turns into grave here. This doesn't just generalize GRAVE_ESC; it means that + * magic+esc is a way to create backticks without a dedicated key. + * ,----------------------------------------------------------------. + * | ` | ¹| ² | ³ | ⁴ | ⁵ | ⁶ | ⁷ | ⁸ | ⁹ | ⁰ | ⁻ | ⁺ | ⊕ | ≠ | √ | + * |----------------------------------------------------------------| + * | | ± | ω | ε | ρ | τ | θ | υ | ι | ο | π | ∃ | ∀ | ℚ | ℝ | + * |----------------------------------------------------------------| + * | | α | σ | δ | φ | γ | η | ∅ | κ | λ | ∨ | ∧ | | ℕ | + * |----------------------------------------------------------------| + * | | ζ | ξ | χ | ψ | β | ν | μ | ≲ | ≳ | ∈ | | ↑ | ↔ | + * |----------------------------------------------------------------| + * | | | | | | ||||| ← | ↓ | → | + * `----------------------------------------------------------------' + */ +[_MAGIC] = LAYOUT( + KC_GRV, H(00b9), H(00b2), H(00b3), H(2074), H(2075), H(2076), H(2077), H(2078), H(2079), H(2070), H(207b), H(207a), H(2295), H(2260), H(221a), \ + _______, H(00b1), H(03c9), H(03b5), H(03c1), H(03c4), H(03b8), H(03c5), H(03b9), H(03bf), H(03c0), H(2203), H(2200), H(211a), H(211d), \ + _______, H(03b1), H(03c3), H(03b4), H(03c6), H(03b3), H(03b7), H(2205), H(03ba), H(03bb), H(2228), H(2227), _______, H(2115), \ + _______, H(03b6), H(03be), H(03c7), H(03c8), H(03b2), H(03bd), H(03bc), H(2272), H(2273), H(2208), _______, H(2191), H(2194), \ + _______, _______, _______, _______, _______, _______, H(2190), H(2193), H(2192)), + + /* Mathematical upper layer. Blank keys are TRNS. + * ,----------------------------------------------------------------. + * | ` | ₁| ₂ | ₃ | ₄ | ₅ | ₆ | ₇ | ₈ | ₉ | ₀ | ₋ | ₊ | ⊗ | ≈ | ∂ | + * |----------------------------------------------------------------| + * | | ∓ | Ω | Ε | Ρ | Τ | Θ | Υ | Ι | Ο | Π | ∄ | ∞ | ⊙ | ℂ | + * |----------------------------------------------------------------| + * | | Α | Σ | Δ | Φ | Γ | Η | ¬ | Κ | Λ | ∪ | ∩ | | ℤ | + * |----------------------------------------------------------------| + * | | Ζ | Ξ | Χ | Ψ | Β | Ν | Μ | ⊆ | ⊇ | ∉ | | ⇑ | ⇔ | + * |----------------------------------------------------------------| + * | | | | | | ||||| ⇐ | ⇓ | ⇒ | + * `----------------------------------------------------------------' + */ +[_SHIFTMAGIC] = LAYOUT( + KC_GRV, H(2081), H(2082), H(2083), H(2084), H(2085), H(2086), H(2087), H(2088), H(2089), H(2080), H(208b), H(208a), H(2297), H(2248), H(2202), \ + _______, H(2213), H(03a9), H(0395), H(03a1), H(03a4), H(0398), H(03a5), H(0399), H(039f), H(03a0), H(2204), H(221e), H(2299), H(2102), \ + _______, H(0391), H(03a3), H(0394), H(03a6), H(0393), H(0397), H(00ac), H(039a), H(039b), H(222a), H(2229), _______, H(2124), \ + _______, H(0396), H(039e), H(03a7), H(03a8), H(0392), H(039d), H(039c), H(2286), H(2287), H(2209), _______, H(21d1), H(21d4), \ + _______, _______, _______, _______, _______, _______, H(21d0), H(21d3), H(21d2)), +}; + +// Layer bitfields. +#define MAGIC_LAYER (1UL << _MAGIC) +#define SHIFTMAGIC_LAYER (1UL << _SHIFTMAGIC) +// The layers we don't touch. +#define LAYER_MASK ~(MAGIC_LAYER|SHIFTMAGIC_LAYER) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // Activate the appropriate magic layer: + // User is holding AltGr+Shift => _SHIFTMAGIC + // User is holding AltGr => _MAGIC + // Not holding AltGr => None + // We do this the efficient way, by grabbing the non-magic bits from the current layer bitmap, + // setting the appropriate magic or shiftmagic bit, and doing an absolute layer set. (Layer + // sets are nontrivial, so we don't want to do extras!) + + // We track shift and AltGr state on our own, because this function is called before get_mods is + // updated! + static bool shifted = false; + static bool magic = false; + + if (keycode == KC_LSHIFT || keycode == KC_RSHIFT) { + shifted = record->event.pressed; + } else if (keycode == MAGIC) { + magic = record->event.pressed; + } else if (keycode == RESET) { + // Safe reset: Only actually let this keycode through if shift is held as well. Since there's no + // right-shift in the function layer, this means that reset is Fn+LShift+Esc, something you're + // not likely to hit by accident. (Especially since AltGr+Esc is backtick!) + return (record->event.pressed && shifted); + } + + // Update the layer. + uint32_t new_layer_state = layer_state & LAYER_MASK; + if (magic) { + new_layer_state |= (shifted ? SHIFTMAGIC_LAYER : MAGIC_LAYER); + } + if (layer_state != new_layer_state) { + layer_state_set(new_layer_state); + } + + return true; +} + +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_OSX); +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/readme.md b/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/readme.md new file mode 100644 index 00000000000..923a4824a52 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/readme.md @@ -0,0 +1,27 @@ +* Custom keymap for kbd67, for those who need to both code and type math. +* Author: Yonatan Zunger (zunger@gmail.com) + +This keymap is presently rather Mac-centric, as it uses Mac media keys in its function layer and the +OS X Unicode input mode for the "magic" layers. + +*Layer 0 (Base QWERTY):* The layout has a few minor quirks: grave escape, Home/End/PgUp/PgDn in the +right-hand column (rather than the more common Home/PgUp/PgDn/End), and a pause key between +backspace and home -- this being something I use for screen lock, a necessity when one works with +and sits next to security engineers. (Using a heavier switch on the pause key greatly reduces the +risk of accidental triggering) In OS X style, alt and win are swapped on the left-hand side. + +The right-hand alt and gui keys take on a different meaning: right-alt lives up to its old name of +AltGr by invoking Greek (the "magic" layers, 2 and 3), and right-gui invokes the function layer. + +*Layer 1 (Functions):* This layer deliberately sets KC_NO for the keys it doesn't use. I realize +this isn't common, but I like to keep my functions quite distinct from all other layers. + +RESET can be accessed at Fn+Left Shift+Escape. + +*Layers 2 and 3*: These are invoked by the "magic" key (AltGr) and by magic+shift. The +letters mostly produce Greek; the numbers, superscripts (magic) and subscripts (magic+shift); and +the various other keys, mathematical symbols. There unfortunately aren't nearly enough keys for all +the symbols I'd like, so magic+alt and magic+alt+shift may end up existing as well, giving this a +proper Space Cadet effect; but that said, it's going to be hard to remember where all these symbols +are without some extremely custom keycaps. In the limit of arbitrarily complex layers, the keyboard +will probably start running LISP and turn into EMACS. diff --git a/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/rules.mk b/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/rules.mk new file mode 100644 index 00000000000..a61cfa33fa9 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/keymaps/zunger/rules.mk @@ -0,0 +1,2 @@ +# You need Unicode for this map. +UNICODE_ENABLE = yes # Unicode diff --git a/keyboards/kbdfans/kbd67/hotswap/readme.md b/keyboards/kbdfans/kbd67/hotswap/readme.md new file mode 100644 index 00000000000..bb64c03e3c1 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/readme.md @@ -0,0 +1,13 @@ +# KBD67 hotswap + +A 65% hot swap board with blocker and USB Type C port. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: KBD67 Hotswap +Hardware Availability: [KBDFans](https://kbdfans.cn/products/coming-soon-kbd67-mechanical-keyboard-diy-kit) + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd67/hotswap:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd67/hotswap/rules.mk b/keyboards/kbdfans/kbd67/hotswap/rules.mk new file mode 100644 index 00000000000..f8667d280f4 --- /dev/null +++ b/keyboards/kbdfans/kbd67/hotswap/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/kbdfans/kbd67/readme.md b/keyboards/kbdfans/kbd67/readme.md new file mode 100644 index 00000000000..1fa2458817b --- /dev/null +++ b/keyboards/kbdfans/kbd67/readme.md @@ -0,0 +1,22 @@ +# KBD67 + +A 65% keyboard sold in three variants. +1. Rev1: Typical keyboard that had to be soldered together, supporting multiple layouts. +2. HotSwap: Released in late 2018, Hotswap single layout keyboard. +3. Rev2: Released in April/May 2019, the Rev2 also needs to be soldered together and supports multiple layouts. + + **Firmware files are SPECIFIC to each board. Firmware files from one, will not work on the other.** Please use the `.hex` appropriate for your board. + +The rev1 PCB is sold under the name "KBD65". + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: KBD67 rev1, rev2, hotswap +Hardware Availability: KBDFans + +Make examples for this keyboard (after setting up your build environment): + + make kbdfans/kbd67/rev1:default + make kbdfans/kbd67/rev2:default + make kbdfans/kbd67/hotswap:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd67/rev1/config.h b/keyboards/kbdfans/kbd67/rev1/config.h new file mode 100644 index 00000000000..7a26192f4a5 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/config.h @@ -0,0 +1,235 @@ +/* +Copyright 2018 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER kbdfans +#define PRODUCT kbd67 +#define DESCRIPTION 65% Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4, F5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 20 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 180 /* The maximum brightness level */ + // #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ + // #define RGBLIGHT_EFFECT_BREATHING + // #define RGBLIGHT_EFFECT_RAINBOW_MOOD + // #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + // #define RGBLIGHT_EFFECT_SNAKE + // #define RGBLIGHT_EFFECT_KNIGHT + // #define RGBLIGHT_EFFECT_CHRISTMAS + // #define RGBLIGHT_EFFECT_STATIC_GRADIENT + // #define RGBLIGHT_EFFECT_RGB_TEST + // #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/kbdfans/kbd67/rev1/info.json b/keyboards/kbdfans/kbd67/rev1/info.json new file mode 100644 index 00000000000..70a926a7f19 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "kbd67", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + }, + + "LAYOUT_65_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/default/config.h b/keyboards/kbdfans/kbd67/rev1/keymaps/default/config.h new file mode 100644 index 00000000000..a3ed4f762a6 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/default/keymap.c b/keyboards/kbdfans/kbd67/rev1/keymaps/default/keymap.c new file mode 100644 index 00000000000..13a8a420d2f --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/default/keymap.c @@ -0,0 +1,99 @@ +/* Copyright 2018 'mechmerlin' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Home| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |PgUp| + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgDn| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|End | + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[0] = LAYOUT_65_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |~ `|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * |Caps | |Up | | | | | |PSc|SLk|Pau|Up | | | | + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig| | | | |Hom|PUp|Lef|Rig| | | + * |----------------------------------------------------------------| + * | | | | | | | | |End|PDn|Dow| |PUp| | + * |----------------------------------------------------------------| + * | | | | | | | |Hom|PDn|End | + * `----------------------------------------------------------------' + */ +[1] = LAYOUT_65_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,KC_INS, \ + KC_CAPS,_______, KC_UP,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP,_______, _______,_______, \ + _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,_______,_______,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT, _______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______, KC_END,KC_PGDN,KC_DOWN, _______,KC_PGUP,_______, \ + _______, _______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN, KC_END), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/default/readme.md b/keyboards/kbdfans/kbd67/rev1/keymaps/default/readme.md new file mode 100644 index 00000000000..391ea3b4101 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/default/readme.md @@ -0,0 +1,33 @@ +# The default keymap for kbd67 + +``` +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Home| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |PgUp| + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgDn| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|End | + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +``` + +``` + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |~ `|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * |Caps | |Up | | | | | |PSc|SLk|Pau|Up | | | | + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig| | | | |Hom|PUp|Lef|Rig| | | + * |----------------------------------------------------------------| + * | | | | | | | | |End|PDn|Dow| |PUp| | + * |----------------------------------------------------------------| + * | | | | | | | |Hom|PDn|End | + * `----------------------------------------------------------------' + */ +``` diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/koba/config.h b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/config.h new file mode 100644 index 00000000000..f4d7de06e5a --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/config.h @@ -0,0 +1,17 @@ +/* Copyright 2019 Daisuke Kobayashi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/koba/keymap.c b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/keymap.c new file mode 100644 index 00000000000..b00805e9e79 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/keymap.c @@ -0,0 +1,61 @@ +/* Copyright 2019 Daisuke Kobayashi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +#define RGB_RMO RGB_RMOD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| ^| \|BS |Del | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| @| [| Ent |PgUp| + * |------------------------------------------------------. |----| + * |H/Z | A| S| D| F| G| H| J| K| L| ;| :| ]| |PgDn| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PScr| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Fn | Space |Alt |Ctrl| |Lef|Dow|Rig | + * `------------------------------------------------' `------------' + */ +[0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, JP_CIRC, KC_JYEN, KC_BSPC, KC_DELT, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, JP_LBRC, JP_RBRC, KC_PGUP, \ + KC_ZKHK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, KC_ENT, KC_PGDN, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PSCR, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RCTL, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |Rst| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |Ins | + * |----------------------------------------------------------------| + * | |M- |M+ |RGB|H- |H+ | | |Prt|SLk|Pau| | | | | + * |------------------------------------------------------. |----| + * |Caps |Vo-|Vo+|Mut|S- |S+ | *| /|Hom|PUp| | | | | | + * |----------------------------------------------------------------| + * | |BL-|BL+|BL |V- |V+ | +| -|End|PDn| _| |PUp| | + * |----------------------------------------------------------------| + * | | | | Muhenkan | | Henkan |Kana|Menu| |Hom|PDn|End | + * `------------------------------------------------' `------------' + */ +[1] = LAYOUT_all( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX,_______,KC_INS, \ + _______, RGB_RMO,RGB_MOD,RGB_TOG,RGB_HUD,RGB_HUI,XXXXXXX,XXXXXXX,KC_PSCR,KC_SLCK,KC_PAUS,XXXXXXX,XXXXXXX,XXXXXXX, _______, \ + KC_CAPS, KC_VOLD,KC_VOLU,KC_MUTE,RGB_SAD,RGB_SAI,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,XXXXXXX,XXXXXXX, KC_PENT, _______, \ + _______,_______,BL_DEC, BL_INC, BL_TOGG,RGB_VAD,RGB_VAI,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,JP_UNDS,_______, KC_PGUP,_______, \ + _______,_______,_______, KC_MHEN, _______, KC_HENK, KC_KANA,KC_APP, _______,KC_HOME,KC_PGDN,KC_END), +}; diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/koba/readme.md b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/readme.md new file mode 100644 index 00000000000..b432436d405 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/koba/readme.md @@ -0,0 +1,7 @@ +# Koba's keymap for KBD67 + +![keyboard-layout](https://user-images.githubusercontent.com/1042121/54736578-244ffe80-4bef-11e9-9882-37611b4efdf4.png) + +- JIS layout. +- Fn layer is arranged like HHKB. +- 3 splitted space bar. (Space-Fn-Space) diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/config.h b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/config.h new file mode 100644 index 00000000000..a3ed4f762a6 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/keymap.c b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/keymap.c new file mode 100644 index 00000000000..839e28fae13 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/keymap.c @@ -0,0 +1,99 @@ +/* Copyright 2018 'mechmerlin' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | ~| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Del| + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[0] = LAYOUT_65_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRAVE, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DELETE,\ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |~ `|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * |Caps | |Up | | | | | |PSc|SLk|Pau|Up | | | | + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig| | | | |Hom|PUp|Lef|Rig| | | + * |----------------------------------------------------------------| + * | | | | | | | | |End|PDn|Dow| |PUp| | + * |----------------------------------------------------------------| + * | | | | | | | |Hom|PDn|End | + * `----------------------------------------------------------------' + */ +[1] = LAYOUT_65_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,KC_INS, \ + KC_CAPS,_______, KC_UP,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP,_______, _______,_______, \ + _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,_______,_______,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT, _______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______, KC_END,KC_PGDN,KC_DOWN, _______,KC_PGUP,_______, \ + _______, _______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN, KC_END), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/readme.md b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/readme.md new file mode 100644 index 00000000000..dfa800d17c2 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/keymaps/martinffx/readme.md @@ -0,0 +1,33 @@ +# The default keymap for kbd67 + +``` +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | ~| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Del| + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +``` + +``` + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |~ `|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * |Caps | |Up | | | | | |PSc|SLk|Pau|Up | | | | + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig| | | | |Hom|PUp|Lef|Rig| | | + * |----------------------------------------------------------------| + * | | | | | | | | |End|PDn|Dow| |PUp| | + * |----------------------------------------------------------------| + * | | | | | | | |Hom|PDn|End | + * `----------------------------------------------------------------' + */ +``` diff --git a/keyboards/kbdfans/kbd67/rev1/readme.md b/keyboards/kbdfans/kbd67/rev1/readme.md new file mode 100644 index 00000000000..1d92a41f7c4 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/readme.md @@ -0,0 +1,13 @@ +# KBD67 rev1 + +65% keyboard with blocker. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: KBD67 PCB (Sometimes sold under the name "KBD65") +Hardware Availability: KBDFans [Keyboard Kit](https://kbdfans.cn/products/coming-soon-kbd67-mechanical-keyboard-diy-kit), [PCB](https://kbdfans.cn/collections/65/products/kbd65-65-custom-mechanical-keyboard-pcb) + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd67/rev1:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd67/rev1/rev1.c b/keyboards/kbdfans/kbd67/rev1/rev1.c new file mode 100644 index 00000000000..94cb9e553b0 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/rev1.c @@ -0,0 +1,51 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev1.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); + PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); + PORTB &= ~(1 << 2); + } + + led_set_user(usb_led); +} diff --git a/keyboards/kbdfans/kbd67/rev1/rev1.h b/keyboards/kbdfans/kbd67/rev1/rev1.h new file mode 100644 index 00000000000..f27a00191a2 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/rev1.h @@ -0,0 +1,57 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \ + K40, K41, K43, K44, K46, K48, K4A, K4B, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E, K3F }, \ + { K40, K41, KC_NO, K43, K44, KC_NO, K46, KC_NO, K48, KC_NO, K4A, K4B, K4C, K4D, K4E, K4F }, \ +} + +#define LAYOUT_65_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \ + K40, K41, K43, K46, K4A, K4B, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E, K0F }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E, K3F }, \ + { K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E, K4F }, \ +} + diff --git a/keyboards/kbdfans/kbd67/rev1/rules.mk b/keyboards/kbdfans/kbd67/rev1/rules.mk new file mode 100644 index 00000000000..0d7c14ad453 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev1/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/kbdfans/kbd67/rev2/config.h b/keyboards/kbdfans/kbd67/rev2/config.h new file mode 100644 index 00000000000..d4e200fa8e5 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/config.h @@ -0,0 +1,64 @@ +/* +Copyright 2019 Vorror + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT KBD67v2 +#define DESCRIPTION 65% Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +#define MATRIX_ROW_PINS { B7, D0, F0, F1, F4 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, D1, D2, D3, D6, D7, B4, B6, C6, C7, F7, F6, F5 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_LIMIT_VAL 240 +#endif diff --git a/keyboards/kbdfans/kbd67/rev2/info.json b/keyboards/kbdfans/kbd67/rev2/info.json new file mode 100644 index 00000000000..4b7b5e8b3f7 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "kbd67v2", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + }, + + "LAYOUT_65_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/default/config.h b/keyboards/kbdfans/kbd67/rev2/keymaps/default/config.h new file mode 100644 index 00000000000..a3ed4f762a6 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/default/keymap.c b/keyboards/kbdfans/kbd67/rev2/keymaps/default/keymap.c new file mode 100644 index 00000000000..13a8a420d2f --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/default/keymap.c @@ -0,0 +1,99 @@ +/* Copyright 2018 'mechmerlin' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Home| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |PgUp| + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgDn| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|End | + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[0] = LAYOUT_65_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |~ `|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * |Caps | |Up | | | | | |PSc|SLk|Pau|Up | | | | + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig| | | | |Hom|PUp|Lef|Rig| | | + * |----------------------------------------------------------------| + * | | | | | | | | |End|PDn|Dow| |PUp| | + * |----------------------------------------------------------------| + * | | | | | | | |Hom|PDn|End | + * `----------------------------------------------------------------' + */ +[1] = LAYOUT_65_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,KC_INS, \ + KC_CAPS,_______, KC_UP,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP,_______, _______,_______, \ + _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,_______,_______,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT, _______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______, KC_END,KC_PGDN,KC_DOWN, _______,KC_PGUP,_______, \ + _______, _______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN, KC_END), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/default/readme.md b/keyboards/kbdfans/kbd67/rev2/keymaps/default/readme.md new file mode 100644 index 00000000000..2cb43c5e1a3 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for kbd67 diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/koba/config.h b/keyboards/kbdfans/kbd67/rev2/keymaps/koba/config.h new file mode 100644 index 00000000000..f4d7de06e5a --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/koba/config.h @@ -0,0 +1,17 @@ +/* Copyright 2019 Daisuke Kobayashi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/koba/keymap.c b/keyboards/kbdfans/kbd67/rev2/keymaps/koba/keymap.c new file mode 100644 index 00000000000..b00805e9e79 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/koba/keymap.c @@ -0,0 +1,61 @@ +/* Copyright 2019 Daisuke Kobayashi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +#define RGB_RMO RGB_RMOD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| ^| \|BS |Del | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| @| [| Ent |PgUp| + * |------------------------------------------------------. |----| + * |H/Z | A| S| D| F| G| H| J| K| L| ;| :| ]| |PgDn| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PScr| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Fn | Space |Alt |Ctrl| |Lef|Dow|Rig | + * `------------------------------------------------' `------------' + */ +[0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, JP_CIRC, KC_JYEN, KC_BSPC, KC_DELT, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, JP_LBRC, JP_RBRC, KC_PGUP, \ + KC_ZKHK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, KC_ENT, KC_PGDN, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PSCR, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RCTL, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * |Rst| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |Ins | + * |----------------------------------------------------------------| + * | |M- |M+ |RGB|H- |H+ | | |Prt|SLk|Pau| | | | | + * |------------------------------------------------------. |----| + * |Caps |Vo-|Vo+|Mut|S- |S+ | *| /|Hom|PUp| | | | | | + * |----------------------------------------------------------------| + * | |BL-|BL+|BL |V- |V+ | +| -|End|PDn| _| |PUp| | + * |----------------------------------------------------------------| + * | | | | Muhenkan | | Henkan |Kana|Menu| |Hom|PDn|End | + * `------------------------------------------------' `------------' + */ +[1] = LAYOUT_all( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX,_______,KC_INS, \ + _______, RGB_RMO,RGB_MOD,RGB_TOG,RGB_HUD,RGB_HUI,XXXXXXX,XXXXXXX,KC_PSCR,KC_SLCK,KC_PAUS,XXXXXXX,XXXXXXX,XXXXXXX, _______, \ + KC_CAPS, KC_VOLD,KC_VOLU,KC_MUTE,RGB_SAD,RGB_SAI,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,XXXXXXX,XXXXXXX, KC_PENT, _______, \ + _______,_______,BL_DEC, BL_INC, BL_TOGG,RGB_VAD,RGB_VAI,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,JP_UNDS,_______, KC_PGUP,_______, \ + _______,_______,_______, KC_MHEN, _______, KC_HENK, KC_KANA,KC_APP, _______,KC_HOME,KC_PGDN,KC_END), +}; diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/koba/readme.md b/keyboards/kbdfans/kbd67/rev2/keymaps/koba/readme.md new file mode 100644 index 00000000000..b432436d405 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/koba/readme.md @@ -0,0 +1,7 @@ +# Koba's keymap for KBD67 + +![keyboard-layout](https://user-images.githubusercontent.com/1042121/54736578-244ffe80-4bef-11e9-9882-37611b4efdf4.png) + +- JIS layout. +- Fn layer is arranged like HHKB. +- 3 splitted space bar. (Space-Fn-Space) diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/config.h b/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/config.h new file mode 100644 index 00000000000..4f5147e66fc --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/config.h @@ -0,0 +1,18 @@ +#pragma once + +#undef MANUFACTURER +#undef PRODUCT +#undef DESCRIPTION + +#define MANUFACTURER Potato Inc. +#define PRODUCT Qt3.14 +#define DESCRIPTION Look, a keyboard! + +/* send tap key if no layer key was used even after tap delay */ +#define TAPPING_TERM 50 +#define RETRO_TAPPING + +/* turn off RGB when computer sleeps */ +#ifdef RGB_DI_PIN +#define RGBLIGHT_SLEEP +#endif \ No newline at end of file diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/keymap.c b/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/keymap.c new file mode 100644 index 00000000000..7c6ef155b74 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/keymap.c @@ -0,0 +1,90 @@ +#include QMK_KEYBOARD_H + +enum layers { + _QWERTY, + _FUNC, + _NUM +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |ENu| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |Del | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| {| }| Ent |PgUp| + * |------------------------------------------------------. |----| + * |CapsFn| A| S| D| F| G| H| J| K| L| ;| '| #| |PgDn| + * |----------------------------------------------------------------| + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift |Up |Fn | + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Ctrl| |Lef|Dow|Rig | + * `------------------------------------------------' `------------' + */ + [_QWERTY] = LAYOUT_all( + LT(_NUM,KC_ESC),KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + LT(_FUNC,KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(_FUNC), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * | ` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Ins | + * |----------------------------------------------------------------| + * | |TOG|M+ |H+ |S+ |V+ |Sp+| |Prt|SLk|Pau| | | |Home| + * |------------------------------------------------------. |----| + * | |VLK|M- |H- |S- |V+ |Sp-| | | | | | | |End | + * |----------------------------------------------------------------| + * | |BL |BL-|BL+|BRTG| | | | | | | |PUp| | + * |----------------------------------------------------------------| + * |Sleep|Reset| | C+A+D |C+A+I|Menu| |Hom|PDn|End | + * `------------------------------------------------' `------------' + */ + [_FUNC] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,_______,KC_INS, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______,_______, KC_HOME, + _______, VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD,_______,_______,_______,_______,_______, _______, KC_END, + _______,_______,BL_TOGG, BL_DEC, BL_INC, BL_BRTG,_______,_______,_______,_______,_______,_______,_______, KC_PGUP,_______, + KC_SLEP,RESET ,_______, LCA(KC_DEL), LCA(KC_DEL), LCA(KC_DEL), LCA(KC_INS),KC_APP, _______,KC_HOME,KC_PGDN,KC_END), + + /* Keymap Numpad Layer + * ,----------------------------------------------------------------. + * | | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| /| | | | + * |----------------------------------------------------------------| + * | | | | | | | | 4| 5| 6| *| | | | | + * |------------------------------------------------------. |----| + * | | | | | | | | 1| 2| 3| -| | | | | + * |----------------------------------------------------------------| + * | | |NLk| | | | | | 0| | | +| | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `------------------------------------------------' `------------' + */ + [_NUM] = LAYOUT_all( + _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_0, KC_KP_SLASH, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_ASTERISK, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_MINUS, _______, _______, _______, + _______, _______, KC_NLCK, _______, _______, _______, _______, _______, KC_KP_0, _______, _______, KC_KP_PLUS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______), + }; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + rgblight_enable_noeeprom(); + } else { + rgblight_disable_noeeprom(); + } +} diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/readme.md b/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/readme.md new file mode 100644 index 00000000000..1404ceed5f4 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/readme.md @@ -0,0 +1,9 @@ +# TuCZnak's modified layout + +This layout is made for the ISO configuration of KBD67 (KBD65 v2 PCB). +It has a base layer, numpad on LT and a combined +configuration / macro / media layer. + +Since the plate and PCB leak some underglow and the KBD67 case has no use +for it otherwise, containing no translucent parts, I've used the RGB OLEDs +as a capslock indicator. diff --git a/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/rules.mk b/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/rules.mk new file mode 100644 index 00000000000..277af2b17b5 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/rules.mk @@ -0,0 +1,20 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/kbdfans/kbd67/rev2/readme.md b/keyboards/kbdfans/kbd67/rev2/readme.md new file mode 100644 index 00000000000..0909f781d06 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/readme.md @@ -0,0 +1,13 @@ +# KBD67 rev2 + +65% pcb with blocker. Revision 2 (Manufactured after 05/01/19). + +Keyboard Maintainer: [Vorror](https://github.com/vorror) +Hardware Supported: KBD67v2 PCB (Sometimes sold under the name "KBD65") +Hardware Availability: KBDFans [Keyboard Kit](https://kbdfans.cn/products/coming-soon-kbd67-mechanical-keyboard-diy-kit), [PCB](https://kbdfans.cn/collections/65/products/kbd65-65-custom-mechanical-keyboard-pcb) + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd67/rev2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd67/rev2/rev2.c b/keyboards/kbdfans/kbd67/rev2/rev2.c new file mode 100644 index 00000000000..8aa83f58614 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/rev2.c @@ -0,0 +1,42 @@ +/* Copyright 2019 Vorror + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev2.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} diff --git a/keyboards/kbdfans/kbd67/rev2/rev2.h b/keyboards/kbdfans/kbd67/rev2/rev2.h new file mode 100644 index 00000000000..f27a00191a2 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/rev2.h @@ -0,0 +1,57 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \ + K40, K41, K43, K44, K46, K48, K4A, K4B, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E, K3F }, \ + { K40, K41, KC_NO, K43, K44, KC_NO, K46, KC_NO, K48, KC_NO, K4A, K4B, K4C, K4D, K4E, K4F }, \ +} + +#define LAYOUT_65_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \ + K40, K41, K43, K46, K4A, K4B, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E, K0F }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E, K3F }, \ + { K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E, K4F }, \ +} + diff --git a/keyboards/kbdfans/kbd67/rev2/rules.mk b/keyboards/kbdfans/kbd67/rev2/rules.mk new file mode 100644 index 00000000000..5e874a041a3 --- /dev/null +++ b/keyboards/kbdfans/kbd67/rev2/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = 65_ansi diff --git a/keyboards/kbdfans/kbd6x/config.h b/keyboards/kbdfans/kbd6x/config.h new file mode 100644 index 00000000000..1ee31e56904 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/config.h @@ -0,0 +1,218 @@ +/* +Copyright 2018 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT kbd6x +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, E6, D0, D1, D2, D3, D5, D6, D7, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_VAL_STEP 12 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/kbd6x/info.json b/keyboards/kbdfans/kbd6x/info.json similarity index 100% rename from keyboards/kbd6x/info.json rename to keyboards/kbdfans/kbd6x/info.json diff --git a/keyboards/kbd6x/kbd6x.c b/keyboards/kbdfans/kbd6x/kbd6x.c similarity index 100% rename from keyboards/kbd6x/kbd6x.c rename to keyboards/kbdfans/kbd6x/kbd6x.c diff --git a/keyboards/kbdfans/kbd6x/kbd6x.h b/keyboards/kbdfans/kbd6x/kbd6x.h new file mode 100644 index 00000000000..46e3c246073 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/kbd6x.h @@ -0,0 +1,33 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K4D,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K46, K4A, K4B, K4C \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D }, \ +} diff --git a/keyboards/kbdfans/kbd6x/keymaps/default/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/default/keymap.c new file mode 100644 index 00000000000..e2e96fc6348 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_RCTL + ), + + [1] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + diff --git a/keyboards/kbd6x/keymaps/default/readme.md b/keyboards/kbdfans/kbd6x/keymaps/default/readme.md similarity index 100% rename from keyboards/kbd6x/keymaps/default/readme.md rename to keyboards/kbdfans/kbd6x/keymaps/default/readme.md diff --git a/keyboards/kbd6x/keymaps/hhkb-default-improved/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/hhkb-default-improved/keymap.c similarity index 100% rename from keyboards/kbd6x/keymaps/hhkb-default-improved/keymap.c rename to keyboards/kbdfans/kbd6x/keymaps/hhkb-default-improved/keymap.c diff --git a/keyboards/kbd6x/keymaps/hhkb-default-improved/readme.md b/keyboards/kbdfans/kbd6x/keymaps/hhkb-default-improved/readme.md similarity index 100% rename from keyboards/kbd6x/keymaps/hhkb-default-improved/readme.md rename to keyboards/kbdfans/kbd6x/keymaps/hhkb-default-improved/readme.md diff --git a/keyboards/kbd6x/keymaps/hhkb-default/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/hhkb-default/keymap.c similarity index 100% rename from keyboards/kbd6x/keymaps/hhkb-default/keymap.c rename to keyboards/kbdfans/kbd6x/keymaps/hhkb-default/keymap.c diff --git a/keyboards/kbd6x/keymaps/hhkb-default/readme.md b/keyboards/kbdfans/kbd6x/keymaps/hhkb-default/readme.md similarity index 100% rename from keyboards/kbd6x/keymaps/hhkb-default/readme.md rename to keyboards/kbdfans/kbd6x/keymaps/hhkb-default/readme.md diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h b/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h new file mode 100644 index 00000000000..4b511eb8484 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define LAYER_FN diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c new file mode 100644 index 00000000000..c5c8c09636a --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c @@ -0,0 +1,137 @@ +#include QMK_KEYBOARD_H +#include "konstantin.h" + +enum keycodes_keymap { + RCTRL = RANGE_KEYMAP, +}; + +enum layers_keymap { + L_RCTRL = L_RANGE_KEYMAP, +}; + +void eeconfig_init_keymap(void) { + rgblight_sethsv(MODERN_DOLCH_RED); + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RCTRL: + if (record->event.pressed) { + register_code(KC_RCTRL); + layer_on(L_RCTRL); + } else { + unregister_code(KC_RCTRL); + layer_off(L_RCTRL); + } + return false; + + default: + return true; + } +} + +static bool skip_caps = false; + +static void fn_light(uint32_t state) { + if (IS_LAYER_ON_STATE(state, L_FN)) { + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv_noeeprom(modern_dolch_red.h, modern_dolch_red.s, rgblight_get_val()); + skip_caps = true; + } else { + rgblight_config_t saved = { .raw = eeconfig_read_rgblight() }; + rgblight_sethsv_noeeprom(saved.hue, saved.sat, saved.val); + rgblight_mode_noeeprom(saved.mode); + } + // caps_light will be called automatically after this +} + +static void caps_light(uint8_t usb_led) { + if (skip_caps) { + skip_caps = false; + return; // Skip calls triggered by the Fn layer turning on + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv_noeeprom(modern_dolch_cyan.h, modern_dolch_cyan.s, rgblight_get_val()); + } else { + fn_light(layer_state); // Caps is off, check if Fn light should be on + } +} + +uint32_t layer_state_set_keymap(uint32_t state) { + static uint32_t prev_state = L_BASE; + if (IS_LAYER_ON_STATE(state, L_FN) != IS_LAYER_ON_STATE(prev_state, L_FN)) { + fn_light(state); // Fn state changed since last time + } + return prev_state = state; +} + +void led_set_keymap(uint8_t usb_led) { + caps_light(usb_led); +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │LCtCps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │LShiftFn│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│FnL│ + * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ + * │LGu│LAlt │ Space │RAlGu│RCt│ + * └───┴─────┴───────────────────────────┴─────┴───┘ + */ + [L_BASE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + LCT_CPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + LSFT_FN, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_FNLK, + XXXXXXX, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, RCTRL, XXXXXXX + ), + + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │Hom│ ↑ │End│PgU│ │ │ │ │M3 │M1 │M↑ │M2 │ Del │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ ← │ ↓ │ → │PgD│ │ │ │ │MW↑│M← │M→ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ │Mut│Vo-│Vo+│Ply│Prv│Nxt│App│MW←│MW→│M↓ │ │ │ + * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ + * │ │ │ MW↓ │MAcl2│ │ + * └───┴─────┴───────────────────────────┴─────┴───┘ + */ + [L_FN] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, + _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN3, KC_BTN1, KC_MS_U, KC_BTN2, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_R, _______, + _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_APP, KC_WH_L, KC_WH_R, KC_MS_D, _______, _______, + XXXXXXX, _______, _______, KC_WH_D, KC_ACL2, _______, XXXXXXX + ), + + /* RCtrl layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │Clr│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │Top│Mv↑│Btm│TPr│ │ │ │ │ │ │ │ │DelNx│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │Mv←│Mv↓│Mv→│TNx│ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ │RTg│RV-│RV+│RMd│ │ │ │M4 │M5 │ │ │ │ + * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ + * │DPR│DstNA│ │ │ │ + * └───┴─────┴───────────────────────────┴─────┴───┘ + */ + [L_RCTRL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLEAR, + _______, TOP, MV_UP, BOTTOM, TAB_PRV, _______, _______, _______, _______, _______, _______, _______, _______, DEL_NXT, + _______, MV_LEFT, MV_DOWN, MV_RGHT, TAB_NXT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_VAD, RGB_VAI, RGB_MOD, _______, _______, _______, KC_BTN4, KC_BTN5, _______, _______, _______, + XXXXXXX, DST_P_R, DST_N_A, _______, _______, _______, XXXXXXX + ), +}; diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk new file mode 100644 index 00000000000..7262c6db665 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk @@ -0,0 +1,11 @@ +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = yes +SPACE_CADET_ENABLE = no +TAP_DANCE_ENABLE = yes +UNICODEMAP_ENABLE = no diff --git a/keyboards/kbdfans/kbd6x/keymaps/othi/config.h b/keyboards/kbdfans/kbd6x/keymaps/othi/config.h new file mode 100644 index 00000000000..42f68b43582 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/othi/config.h @@ -0,0 +1,10 @@ +#pragma once +#define ONESHOT_TAP_TOOGLE 2 +#define ONESHOT_TIMEOUT 2000 +// tap dance configurations +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 +#define PERMISSIVE_HOLD +// Fix KC_GESC conflict with Cmd+Alt+Esc on macros +#define GRAVE_ESC_GUI_OVERRIDE + diff --git a/keyboards/kbdfans/kbd6x/keymaps/othi/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/othi/keymap.c new file mode 100644 index 00000000000..1e0fc8ad7ee --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/othi/keymap.c @@ -0,0 +1,190 @@ +/* Copyright 2018 Othi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// read README.md for rundown of what does what + +// #define BL 0 +#define CL 0 +#define NM_MODE 2 +#define VI_MODE 3 +#define FN3 4 +#define ACCENT 5 +#define ACCENT_CAP 6 + +//Unicode keymaps +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_LNX); +} +#define DE_AE UC(0x00E4) +#define DE_SS UC(0x00DF) +#define DE_OE UC(0x00F6) +#define DE_UE UC(0x00FC) +#define DE_AE_CAP UC(0x00C4) +#define DE_OE_CAP UC(0x00D6) +#define DE_UE_CAP UC(0x00DC) + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case NM_MODE: + rgblight_setrgb (0x00, 0x66, 0x00); + break; + case VI_MODE: + rgblight_setrgb (0x66, 0x66, 0x00); + break; + case ACCENT: + rgblight_setrgb (0x7A, 0x00, 0xFF); + break; + case ACCENT_CAP: + rgblight_setrgb (0x7A, 0xFF, 0xFF); + break; + default: // for any other layers, or the default layer + rgblight_setrgb (0xFF, 0x00, 0x00); + break; + } + return state; +} + +//Tap Dance Declarations +enum { + CTL_NM = 0, + ALT_NM = 1, + SFT_NM = 2, + GUI_NM = 3 +}; + +void dance_CTL_NM_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + set_oneshot_mods(MOD_LCTL); + } else { + register_code (KC_LCTL); + layer_on(NM_MODE); + } +} + +void dance_CTL_NM_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LCTL); + } else { + unregister_code (KC_LCTL); + layer_off(NM_MODE); + } +} + +void dance_GUI_NM_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LGUI); + } else { + register_code (KC_LGUI); + layer_on(NM_MODE); + } +} + +void dance_GUI_NM_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LGUI); + } else { + unregister_code (KC_LGUI); + layer_off(NM_MODE); + } +} + +void dance_ALT_NM_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LALT); + } else { + register_code (KC_LALT); + layer_on(NM_MODE); + } +} + +void dance_ALT_NM_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LALT); + } else { + unregister_code (KC_LALT); + layer_off(NM_MODE); + } +} + +void dance_SFT_NM_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LSFT); + set_oneshot_mods(MOD_LSFT); + } else { + register_code (KC_LSFT); + layer_on(NM_MODE); + } +} + +void dance_SFT_NM_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LSFT); + } else { + unregister_code (KC_LSFT); + layer_off(NM_MODE); + } +} + + +qk_tap_dance_action_t tap_dance_actions[] = { + [CTL_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_CTL_NM_finished, dance_CTL_NM_reset), + [GUI_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_GUI_NM_finished, dance_GUI_NM_reset), + [ALT_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_ALT_NM_finished, dance_ALT_NM_reset), + [SFT_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_SFT_NM_finished, dance_SFT_NM_reset) +}; + +// backup +// old R3 capslock, LT(NM_MODE,KC_BSPC), +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [CL] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + MT(MOD_LGUI,KC_TAB), LT(NM_MODE,KC_Q), KC_W, LT(ACCENT,KC_F), KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, + MT(MOD_LCTL,KC_BSPC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, + TD(SFT_NM), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, MT(MOD_LCTL,KC_COMM), MT(MOD_LSFT,KC_DOT), MT(MOD_LALT,KC_SLSH), LM(CL,MOD_LGUI|MOD_LSFT), TT(NM_MODE), + _______, TD(CTL_NM), TD(ALT_NM), KC_SPC, LM(CL,MOD_LGUI|MOD_LALT), OSL(ACCENT) , _______ + ), + [NM_MODE] = LAYOUT( + KC_GRV, KC_MPRV, KC_MNXT, KC_MPLY, KC_END, _______, _______, _______, _______, _______, KC_HOME, _______, _______, RESET, KC_INS, + LGUI(KC_TAB), _______, LCTL(KC_RGHT), _______, _______, _______, _______, KC_UP, KC_PGUP, _______, _______, _______, TG(CL), KC_DEL, + _______, KC_LEFT, _______, KC_RGHT, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_ENT, KC_QUOT, KC_LGUI, + KC_LSFT, _______, _______, _______, _______, LCTL(KC_LEFT), _______, _______, _______, _______, _______, TG(VI_MODE), TO(CL), + _______, TD(CTL_NM), TD(ALT_NM), KC_SPC, LM(CL,MOD_LGUI|MOD_LALT), OSL(ACCENT), _______ + ), + + [VI_MODE] = LAYOUT( + KC_GRV, KC_MPRV, KC_MNXT, KC_MPLY, LSFT(KC_END), KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, LSFT(KC_HOME), KC_F11, KC_F12, RESET, KC_INS, + LGUI(KC_TAB), _______, LSFT(LCTL(KC_RGHT)), _______, _______, _______, _______, LSFT(KC_UP), _______, _______, _______, _______, TG(CL), KC_BSPC, + _______, _______, _______, _______, _______, _______, LSFT(LCTL(KC_LEFT)), LSFT(KC_DOWN), LSFT(KC_RGHT), _______, KC_SCLN, KC_QUOT, KC_LGUI, + KC_LSFT, _______, _______, _______, _______, LSFT(LCTL(KC_LEFT)), _______, _______, _______, _______, KC_SLSH, OSM(MOD_LSFT), TO(CL), + _______, TD(CTL_NM), TD(ALT_NM), KC_SPC, LM(CL,MOD_LGUI|MOD_LALT), OSL(ACCENT), _______ + ), + [ACCENT] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, RGB_TOG, RGB_MODE_PLAIN, _______, _______, _______, _______, _______, DE_UE, _______, _______, _______, _______, _______, + _______, DE_AE, UC_Z, DE_SS, _______, _______, _______, _______, _______, _______, DE_OE, _______, _______, + OSL(ACCENT_CAP), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(CL), + _______, _______, _______, _______, _______, _______, _______ + ), + [ACCENT_CAP] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, DE_UE_CAP, _______, _______, _______, _______, _______, + _______, DE_AE_CAP, _______, DE_SS, _______, _______, _______, _______, _______, _______, DE_OE_CAP, _______, TO(CL), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ), +}; + diff --git a/keyboards/kbdfans/kbd6x/keymaps/othi/readme.md b/keyboards/kbdfans/kbd6x/keymaps/othi/readme.md new file mode 100644 index 00000000000..95be36d057d --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/othi/readme.md @@ -0,0 +1,56 @@ +## Othi's Universal HHKB keymap + +### Goals +- Colemak layout. If you don't use Colemak then you'll need to also change the arrow key bindigns in other layers + +- Vim-like navigation layer so you can use vim binding arrowkeys in non-vim environment + +- Good modifier support so you don't have to hold 14 modifier keys at the same time + +- RGB indicating layer change(only work with plain colors so far, don't put your rgb to pulsing or any non static animation) + +### Layers +- **CL:** + + The base layer, default is Colemak + +- **NM_MODE:** + + Vim-like arrowkeys in the home row, it's `LHNE` for *JENK Colemak* and `HJKL` for *QWERTY* + + Also `HOME`, `END` and next/prev word (`Ctrl + Left/Right`) in `0, 4, w, b` like in vim + +- **VI_MODE:** + + The same as `NM_MODE` but with `KC_LSFT` held down for mostly highlighting + +- **ACCENT + ACCENT_CAP:** + + Function row and Unicode characters + +### Modifiers and Tap Dance keys +**LHS:** + +- Any Tap Dance key with the format of `TD(XXX_NM)` act as normal XXX modifier upon hold, but will hold **and** put you to `NM_MODE` when double click hold(a tap before the hold)(eg you can produce `Alt + PgUp` by pressing `Alt + Alt + U`) + +- `KC_TAB` acts as both `KC_TAB` on tap and `KC_LGUI` on hold + +- R3 CapsLock acts as both `KC_BSPC` on tap and `KC_LCTL` on hold + +- Holding `KC_Q` also puts you into `NM_MODE` + +- Holding `KC_F` puts you into `VI_MODE` for fast function keys + +**RHS:** + +- 3 keys `KC_SCLN`, `KC_DOT` and `KC_SLSH` in `CL` layer can also be held down for respectively `KC_LCTL`, `KC_LSFT`, `KC_LALT` for easier 2-hand modifier holding + +- Right modifiers hold the selected modifier with `KC_LGUI` at the same time, mainly for i3wm, you can change this to whatever combination you want + +### Misc. functionalities + +**Unicode:** + +- In case the keyboard output the 4-digit codepoint instead of the actual unicode, you need to change the rewrite input mode of the keyboard into the EEPROM(you only have to do this if the EEPROM was cleared or your current machine use another unicode compose method other than IBus/Linux's `Ctrl + Shift + U`). Change the corresponding Input `void eeconfig_init_user(void)`. See [this](https://docs.qmk.fm/#/feature_unicode) for availble input modes. + +- **NOTE:** make sure to keep your qmk env up to date with upstream diff --git a/keyboards/kbdfans/kbd6x/keymaps/othi/rules.mk b/keyboards/kbdfans/kbd6x/keymaps/othi/rules.mk new file mode 100644 index 00000000000..9cda4109dda --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/othi/rules.mk @@ -0,0 +1,19 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +TAP_DANCE_ENABLE=yes + diff --git a/keyboards/kbdfans/kbd6x/keymaps/wanleg/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/wanleg/keymap.c new file mode 100644 index 00000000000..f3aa991f316 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/wanleg/keymap.c @@ -0,0 +1,82 @@ +/* Copyright 2018 wanleg + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "wanleg.h" + + +#define LAYOUT_kbd6x_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, KC_ENT, \ + KC_LSFT, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, KC_LSFT, FUNCTION, \ + KC_LCTL, KC_LGUI, KC_LALT, LT(gDIR,KC_SPC), KC_RALT, KC_RGUI, KC_RCTL \ + ) +#define LAYOUT_kbd6x_base_wrapper(...) LAYOUT_kbd6x_base(__VA_ARGS__) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[gGK] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_Row_0_______________, + _______________Gherkin_Row_1_______________, + _______________Gherkin_Row_2_______________ +), + +[gNUM] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________ +), + +[gDIR] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________ +), + +[gETC] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________ +), + +[_FN] = LAYOUT_kbd6x_base_wrapper( + _______________Gherkin_FN_0________________, + _______________Gherkin_FN_1________________, + _______________Gherkin_FN_2________________ +), + +//mac layout +[_QW] = LAYOUT_wrapper( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(ONE), + KC_LCTL, MO(ONE), KC_LGUI, KC_SPACE, KC_RGUI, KC_RALT, KC_RCTL + ), + +[ONE] = LAYOUT_wrapper( + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, BL_BRTG, BL_DEC, BL_INC, BL_TOGG, BL_STEP, BL_ON, KC_PGUP, KC_HOME, _______, _______, _______, _______, _______, + _______, RGB_M_B, RGB_VAD, RGB_VAI, RGB_TOG, RGB_MOD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, + _______, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, KC_PGDN, KC_END, _______, gGHERKIN,_______, _______, + _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/kbdfans/kbd6x/keymaps/wanleg/rules.mk b/keyboards/kbdfans/kbd6x/keymaps/wanleg/rules.mk new file mode 100644 index 00000000000..92cc41e2129 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/keymaps/wanleg/rules.mk @@ -0,0 +1,3 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) \ No newline at end of file diff --git a/keyboards/kbdfans/kbd6x/readme.md b/keyboards/kbdfans/kbd6x/readme.md new file mode 100644 index 00000000000..1728c8c21bf --- /dev/null +++ b/keyboards/kbdfans/kbd6x/readme.md @@ -0,0 +1,13 @@ +# KBD6x + +A WKL Hot Swap Double USB C 60% + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: KBD6x PCB +Hardware Availability: [KBDFans](https://kbdfans.cn/products/kbd6x-wkl-hot-swap-60-double-type-c-pcb) + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd6x:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd6x/rules.mk b/keyboards/kbdfans/kbd6x/rules.mk new file mode 100644 index 00000000000..72c52d3c6e6 --- /dev/null +++ b/keyboards/kbdfans/kbd6x/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/kbdfans/kbd75/config.h b/keyboards/kbdfans/kbd75/config.h new file mode 100644 index 00000000000..611e682e54c --- /dev/null +++ b/keyboards/kbdfans/kbd75/config.h @@ -0,0 +1,50 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER qmkbuilder +#define PRODUCT KBD75 +#define DESCRIPTION QMK keyboard firmware for KBD75 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5, B7 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, F5, D4, B1, B0, B5, B4, D7, D6, B3, F4, F6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 5 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/kbd75/kbd75.c b/keyboards/kbdfans/kbd75/kbd75.c similarity index 100% rename from keyboards/kbd75/kbd75.c rename to keyboards/kbdfans/kbd75/kbd75.c diff --git a/keyboards/kbdfans/kbd75/kbd75.h b/keyboards/kbdfans/kbd75/kbd75.h new file mode 100644 index 00000000000..ad8706ba97e --- /dev/null +++ b/keyboards/kbdfans/kbd75/kbd75.h @@ -0,0 +1,13 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_kbdfans_kbd75_rev1 + #include "rev1.h" +#endif + +#ifdef KEYBOARD_kbdfans_kbd75_rev2 + #include "../rev1/rev1.h" + #include "rev2.h" +#endif + diff --git a/keyboards/kbdfans/kbd75/keymaps/adit/keymap.c b/keyboards/kbdfans/kbd75/keymaps/adit/keymap.c new file mode 100644 index 00000000000..b7cae4810b5 --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/adit/keymap.c @@ -0,0 +1,78 @@ +#include QMK_KEYBOARD_H + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, LT(1,KC_END), + KC_CAPS, KC_LALT, _______, _______, KC_SPC, _______, KC_RGUI, _______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = LAYOUT( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/kbdfans/kbd75/keymaps/default/keymap.c b/keyboards/kbdfans/kbd75/keymaps/default/keymap.c new file mode 100644 index 00000000000..839030aaa9a --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/default/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, MO(1), KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, MO(1), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/kbdfans/kbd75/keymaps/digital/keymap.c b/keyboards/kbdfans/kbd75/keymaps/digital/keymap.c new file mode 100644 index 00000000000..cb43052c229 --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/digital/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MNXT, KC_MPLY, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = LAYOUT( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_INS, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______ + ) +}; diff --git a/keyboards/kbdfans/kbd75/keymaps/digital/readme.md b/keyboards/kbdfans/kbd75/keymaps/digital/readme.md new file mode 100644 index 00000000000..99c95a00ff9 --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/digital/readme.md @@ -0,0 +1,5 @@ +# digital KBD75 Keymap + +ISO KBD75 keymap. + +![KBD75 digital keymap](https://i.imgur.com/IMb7eML.png) diff --git a/keyboards/kbdfans/kbd75/keymaps/edulpn/README.md b/keyboards/kbdfans/kbd75/keymaps/edulpn/README.md new file mode 100644 index 00000000000..e35eb983f37 --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/edulpn/README.md @@ -0,0 +1,13 @@ +# Edulpn Keymap for the KBD75 PCB + +## Additional Notes +75% Keymap for KBD75 with default ANSI layout + default layer switching for Windows and Mac "modes" + custom Fn layers for each mode. + +### Windows Mode +![Edulpn Keymap for the KBD75 PCB Windows Mode](https://imgur.com/doI46vP.png) + +### Mac Mode +![Edulpn Keymap for the KBD75 PCB Mac Mode](https://i.imgur.com/t7oTjjc.png) + +## Build +To build the default keymap, simply run `make kbdfans/kbd75/rev2:edulpn`. diff --git a/keyboards/kbdfans/kbd75/keymaps/edulpn/keymap.c b/keyboards/kbdfans/kbd75/keymaps/edulpn/keymap.c new file mode 100644 index 00000000000..7e715a767c8 --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/edulpn/keymap.c @@ -0,0 +1,67 @@ +#include QMK_KEYBOARD_H + +#define WINDOWS_LAYER 0 +#define WINDOWS_FN_LAYER 1 +#define MAC_LAYER 2 +#define MAC_FN_LAYER 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [WINDOWS_LAYER] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, TG(MAC_LAYER), KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(WINDOWS_FN_LAYER), KC_TRNS, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [WINDOWS_FN_LAYER] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [MAC_LAYER] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, TG(WINDOWS_LAYER), KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LALT, KC_LCMD, KC_SPC, KC_SPC, KC_SPC, MO(MAC_FN_LAYER), KC_TRNS, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [MAC_FN_LAYER] = LAYOUT( + RESET, KC_BRID, KC_BRIU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MRWD, KC_MPLY, KC_MFFD, KC__MUTE, KC__VOLDOWN, KC__VOLUP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case WINDOWS_LAYER: + rgblight_setrgb_blue(); + break; + case WINDOWS_FN_LAYER: + rgblight_setrgb_blue(); + break; + case MAC_LAYER: + rgblight_setrgb_white(); + break; + case MAC_FN_LAYER: + rgblight_setrgb_white(); + break; + default: + rgblight_setrgb (0x00, 0xFF, 0xFF); + break; + } + return state; +} + diff --git a/keyboards/kbdfans/kbd75/keymaps/iso/keymap.c b/keyboards/kbdfans/kbd75/keymaps/iso/keymap.c new file mode 100644 index 00000000000..0b7c701a30d --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/iso/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, MO(1), KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/kbdfans/kbd75/keymaps/kingwangwong/keymap.c b/keyboards/kbdfans/kbd75/keymaps/kingwangwong/keymap.c new file mode 100644 index 00000000000..fb074e12104 --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/kingwangwong/keymap.c @@ -0,0 +1,145 @@ +#include QMK_KEYBOARD_H + +enum layer_names { + _QW, + _FO, + _FL, + _CL, + _DL +}; + + + + +// Custom macros +#define SPC_FUN LT(_FL, KC_SPC) +#define BSC_CON LT(_CL, KC_BSPC) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Qwerty layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │BSLS │ DEL │ END │ + * ├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴─────┼─────┤ + * │TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BSPC │PGUP │ + * ├────────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴────────┼─────┤ + * │CAPS │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ENTER │PGDN │ + * ├──────┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴───────┬─────┼─────┤ + * │LSHFT │LSHFT│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RSHFT │ UP │MO_CL│ + * ├──────┼─────┴─┬───┴──┬──┴─────┴────┬┴─────┼─────┴─────┴────┬┴────┬┴────┬┴────┬─────┼─────┼─────┤ + * │LCTRL │L_GUI │L_ALT │SPC │MO(_FL│BSPC │R_ALT│R_GUI│R_CTR│LEFT │DOWN │RIGHT│ + * └──────┴───────┴──────┴─────────────┴──────┴────────────────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: QWERTY */ + [_QW] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_HOME, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_END, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, + KC_CLCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(_CL), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FL), KC_BSPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 1: forty: this layer emulates a forty percent keyboard so I can transition to a forty percent :) + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴─────┼─────┤ + * │ESC │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ENT │ │ │ │ + * ├────────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴────────┼─────┤ + * │TAB │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ │ │ + * ├──────┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴───────┬─────┼─────┤ + * │LSHFT │LSHFT│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RSHFT │ │MO_CL│ + * ├──────┼─────┴─┬───┴──┬──┴─────┴────┬┴─────┼─────┴─────┴────┬┴────┬┴────┬┴────┬─────┼─────┼─────┤ + * │LCTRL │L_ALT │MO(DL)│SPCFUN │BSPC │MO(_CL) │R_ALT│R_GUI│R_CTR│ │ │ │ + * └──────┴───────┴──────┴─────────────┴──────┴────────────────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 1: FORTY */ + [_FO] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, XXXXXXX, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, MO(_CL), + KC_LCTL, KC_LALT, MO(_DL), SPC_FUN, KC_BSPC, MO(_CL), KC_RALT, KC_RGUI, KC_RCTL, XXXXXXX, XXXXXXX, XXXXXXX), + + + /* 2: Function layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴─────┼─────┤ + * │ │ │HOME │ UP │END │ │ │ │ │ │ │ │ │ │VOLUP│ + * ├────────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴────────┼─────┤ + * │ │ │LEFT │DOWN │RIGHT│ │ │ │ │ │ │ │ │VOLDN│ + * ├──────┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴───────┬─────┼─────┤ + * │ │ │ │ │PGDN │PGUP │ │ │ │ │ │ │ │ │ │ + * ├──────┼─────┴─┬───┴──┬──┴─────┴────┬┴─────┼─────┴─────┴────┬┴────┬┴────┬┴────┬─────┼─────┼─────┤ + * │ │ │ │ │ │ │VOLDN│VOLUP│ │ │ │ │ + * └──────┴───────┴──────┴─────────────┴──────┴────────────────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 2: ANSI Fn layer */ + [_FL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, + _______, _______, _______, KC_PGDN, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______, _______), + + /* 3: Control layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │RESET│QWERT│FORTY│ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴─────┼─────┤ + * │ ` │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ DEL │ │ │ │ + * ├────────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴────────┼─────┤ + * │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ \ │ │ │ + * ├──────┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴───────┬─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┼─────┴─┬───┴──┬──┴─────┴────┬┴─────┼─────┴─────┴────┬┴────┬┴────┬┴────┬─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * └──────┴───────┴──────┴─────────────┴──────┴────────────────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 3: Control layer */ + [_CL] = LAYOUT( + RESET, TO(_QW), TO(_FO), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, _______, _______, KC_VOLU, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, _______, KC_VOLD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, RGB_HUD, RGB_SAD, RGB_HUI), + + /* 4: Another layer for ease + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴─────┼─────┤ + * │ │ │ │ │ │ │ │ _ │ + │ { │ } │ | │ │ │ │ + * ├────────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴────────┼─────┤ + * │ │ │ │ │ │ │ │ - │ = │ [ │ ] │ \ │ │ │ + * ├──────┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴───────┬─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┼─────┴─┬───┴──┬──┴─────┴────┬┴─────┼─────┴─────┴────┬┴────┬┴────┬┴────┬─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * └──────┴───────┴──────┴─────────────┴──────┴────────────────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 3: D control layer */ + [_DL] = LAYOUT( + RESET, TO(_QW), TO(_FO), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, + _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, KC_VOLU, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, KC_VOLD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, RGB_HUD, RGB_SAD, RGB_HUI) +}; diff --git a/keyboards/kbdfans/kbd75/keymaps/smt/keymap.c b/keyboards/kbdfans/kbd75/keymaps/smt/keymap.c new file mode 100644 index 00000000000..edf01c854ed --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/smt/keymap.c @@ -0,0 +1,176 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _FL 3 +#define _CL 4 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK +}; + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Qwerty layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BKSPC│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_QWERTY] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_INS, KC_HOME, \ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 1: Colemak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │BKSPC│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 1: ANSI colemak */ + [_COLEMAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_INS, KC_HOME, \ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ + CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 2: Dvorak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │BKSPC│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 2: ANSI dvorak */ + [_DVORAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, \ + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, KC_PGUP, \ + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGDN, \ + KC_LSFT, _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 3: Function layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │PG_UP│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ _FL │ │HOME │PG_DN│ END │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 3: ANSI Fn layer */ + [_FL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, MO(_FL), _______, KC_HOME, KC_PGDN, KC_END), + + /* 4: Control layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ RGB │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │RESET│ │ │QWRTY│COLMK│DVORK│ │ │ │ │█████│RGBV+│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│RGBV-│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ _FL │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │RGBS+│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│RGB_M│█████│█████│█████│ │ _FL │ │RGBH-│RGBS-│RGBH+│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 4: ANSI control layer */ + [_CL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, \ + _______, _______, _______, _______, RESET, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, RGB_VAI, \ + _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, \ + MO(_FL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, _______, \ + _______, _______, _______, _______, RGB_MOD, _______, _______, MO(_FL), _______, RGB_HUD, RGB_SAD, RGB_HUI), +}; + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + } + return true; +} diff --git a/keyboards/kbdfans/kbd75/keymaps/spacemanspiff/keymap.c b/keyboards/kbdfans/kbd75/keymaps/spacemanspiff/keymap.c new file mode 100644 index 00000000000..05e7c567135 --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/spacemanspiff/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +#define _BL 0 // Base Layer +#define _FN 1 // Function Layer +#define _CL 2 // Control+ Layer + +// Add names for complex momentary keys, to keep the keymap matrix aligned better. +#define CTL_ESC MT(MOD_LCTL,KC_ESC) +#define GUI_ENT MT(MOD_RGUI, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, MO(_FN), KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, MO(_FN), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + MO(_CL), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, GUI_ENT, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN] = LAYOUT( + RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_CL] = LAYOUT( + LCTL(KC_ESC), LCTL(KC_F1), LCTL(KC_F2), LCTL(KC_F3), LCTL(KC_F4), LCTL(KC_F5), LCTL(KC_F6), LCTL(KC_F7), LCTL(KC_F8), LCTL(KC_F9), LCTL(KC_F10), LCTL(KC_F11), LCTL(KC_F12), LCTL(KC_PSCR), _______, LCTL(KC_DEL), + KC_ESC, LCTL(KC_1), LCTL(KC_2), LCTL(KC_3), LCTL(KC_4), LCTL(KC_5), LCTL(KC_6), LCTL(KC_7), LCTL(KC_8), LCTL(KC_9), LCTL(KC_0), LCTL(KC_MINS), LCTL(KC_EQL), LCTL(KC_DEL), KC_DEL, LCTL(KC_HOME), + LCTL(KC_TAB), LCTL(KC_Q), LCTL(KC_W), LCTL(KC_E), LCTL(KC_R), LCTL(KC_T), LCTL(KC_Y), LCTL(KC_U), LCTL(KC_I), LCTL(KC_O), KC_PGUP, LCTL(KC_LBRC), LCTL(KC_RBRC), LCTL(KC_BSLS), LCTL(KC_PGUP), + CTL_ESC, LCTL(KC_A), LCTL(KC_S), LCTL(KC_D), LCTL(KC_F), LCTL(KC_G), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, LCTL(KC_SCLN), LCTL(KC_QUOT), LCTL(KC_ENT), LCTL(KC_PGDN), + LCTL(KC_LSFT), _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_B), KC_PGDN, LCTL(KC_M), LCTL(KC_COMM), LCTL(KC_DOT), LCTL(KC_SLSH), LCTL(KC_RSFT), LCTL(KC_UP), LCTL(KC_END), + _______, LCTL(KC_LALT), LCTL(KC_LGUI), LCTL(KC_SPC), LCTL(KC_SPC), LCTL(KC_SPC), LCTL(KC_RGUI), LCTL(KC_RALT), LCTL(KC_RCTL), LCTL(KC_LEFT), LCTL(KC_DOWN), LCTL(KC_RGHT) + ), + +}; diff --git a/keyboards/kbd75/keymaps/spacemanspiff/readme.md b/keyboards/kbdfans/kbd75/keymaps/spacemanspiff/readme.md similarity index 100% rename from keyboards/kbd75/keymaps/spacemanspiff/readme.md rename to keyboards/kbdfans/kbd75/keymaps/spacemanspiff/readme.md diff --git a/keyboards/kbdfans/kbd75/keymaps/tucznak/config.h b/keyboards/kbdfans/kbd75/keymaps/tucznak/config.h new file mode 100644 index 00000000000..54960f7d1e6 --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/tucznak/config.h @@ -0,0 +1,26 @@ +#pragma once + +#undef MANUFACTURER +#undef PRODUCT +#undef DESCRIPTION + +#define MANUFACTURER Potato Inc. +#define PRODUCT Qt3.14 +#define DESCRIPTION Look, a keyboard! + +/* send tap key if no layer key was used even after tap delay */ +#define TAPPING_TERM 250 +#define RETRO_TAPPING + +/* turn off RGB when computer sleeps */ +#ifdef RGB_DI_PIN +#define RGBLIGHT_SLEEP +#endif + +/* number of backlight levels */ +#ifdef BACKLIGHT_LEVELS +#undef BACKLIGHT_LEVELS +#endif +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 8 +#endif diff --git a/keyboards/kbdfans/kbd75/keymaps/tucznak/keymap.c b/keyboards/kbdfans/kbd75/keymaps/tucznak/keymap.c new file mode 100644 index 00000000000..ad3b6f6c5ca --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/tucznak/keymap.c @@ -0,0 +1,90 @@ +#include QMK_KEYBOARD_H + +enum layers { + _QWERTY, + _FUNC, + _NUMPAD +}; + +enum keycodes { + QWERTY = SAFE_RANGE, + FUNC, + NUMPAD, + MACRO1, + MACRO2, + MACROTAB, + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_ansi_1u( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_PSCR, + LT(_NUMPAD, KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FUNC), KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [_FUNC] = LAYOUT_ansi_1u( + RESET, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLCK, KC_PAUS, + KC_TRNS, MACRO1, MACRO2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + MACROTAB, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NUBS, KC_TRNS, + KC_TRNS, VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, DYN_REC_START2, DYN_MACRO_PLAY2, KC_TRNS, KC_TRNS, + KC_TRNS, BL_TOGG, BL_DEC, BL_INC, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, DYN_REC_STOP, DYN_REC_START1, DYN_MACRO_PLAY1, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, LCA(KC_DEL), KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_NUMPAD] = LAYOUT_ansi_1u( + KC_NUMLOCK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_0, KC_KP_SLASH, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_ASTERISK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_MINUS, KC_TRNS, KC_KP_ENTER, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_COMM, KC_DOT, KC_KP_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + switch (keycode) { + case MACRO1: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("c") SS_DOWN(X_LALT) SS_TAP(X_TAB) SS_UP(X_LALT) SS_LCTRL("v") SS_TAP(X_TAB)); + _delay_ms(50); + SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_TAB) SS_UP(X_LALT) SS_TAP(X_TAB)); + } else { + + } + break; + case MACRO2: + if (record->event.pressed) { + SEND_STRING("GGWP"); + } else { + + } + break; + case MACROTAB: + if (record->event.pressed) { + SEND_STRING(" "); + } else { + + } + break; + } + + return true; +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + setPinOutput(B2); + writePinLow(B2); + } else { + setPinInput(B2); + writePinLow(B2); + } +} diff --git a/keyboards/kbdfans/kbd75/keymaps/tucznak/readme.md b/keyboards/kbdfans/kbd75/keymaps/tucznak/readme.md new file mode 100644 index 00000000000..96212584463 --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/tucznak/readme.md @@ -0,0 +1,5 @@ +# TuCZnak's modified layout + +This layout is made for the ANSI configuration of KBD75. +It has a base layer, numpad on LT and a combined +configuration / macro / media layer. diff --git a/keyboards/kbdfans/kbd75/keymaps/tucznak/rules.mk b/keyboards/kbdfans/kbd75/keymaps/tucznak/rules.mk new file mode 100644 index 00000000000..7d6400f97aa --- /dev/null +++ b/keyboards/kbdfans/kbd75/keymaps/tucznak/rules.mk @@ -0,0 +1,14 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +VELOCIKEY_ENABLE = yes # RGB memes for quickscoping teens +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/kbdfans/kbd75/readme.md b/keyboards/kbdfans/kbd75/readme.md new file mode 100644 index 00000000000..89fe2741618 --- /dev/null +++ b/keyboards/kbdfans/kbd75/readme.md @@ -0,0 +1,17 @@ +# KBD75 + +Keyboard Maintainer: QMK Community +Hardware Supported: KBD75 PCB rev 1 and 2 +Hardware Availability: https://kbdfans.myshopify.com/products/kbd75-keyboard-set?variant=35638534029 + +The KBD75 has two revisions. Revision 2 has a USB C port and allows a numpad layout. `.hex` files made +for KBD75 revision 1, will still work for revision 2. `.hex` files made for revision 2 (excluding the numpad) +will also still work on revision 1. Both revisions share the same switch matrix but have switch holes in +different areas. + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd75/rev1:default + make kbdfans/kbd75/rev2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbd75/rev1/info.json b/keyboards/kbdfans/kbd75/rev1/info.json similarity index 100% rename from keyboards/kbd75/rev1/info.json rename to keyboards/kbdfans/kbd75/rev1/info.json diff --git a/keyboards/kbdfans/kbd75/rev1/rev1.c b/keyboards/kbdfans/kbd75/rev1/rev1.c new file mode 100644 index 00000000000..151e395e3c4 --- /dev/null +++ b/keyboards/kbdfans/kbd75/rev1/rev1.c @@ -0,0 +1,17 @@ +#include "rev1.h" + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(B2); + } else { + writePinHigh(B2); + } + + led_set_user(usb_led); +} + +void matrix_init_kb(void) { + setPinOutput(B2); + matrix_init_user(); +} diff --git a/keyboards/kbd75/rev1/rev1.h b/keyboards/kbdfans/kbd75/rev1/rev1.h similarity index 100% rename from keyboards/kbd75/rev1/rev1.h rename to keyboards/kbdfans/kbd75/rev1/rev1.h diff --git a/keyboards/kbd75/rev1/rules.mk b/keyboards/kbdfans/kbd75/rev1/rules.mk similarity index 100% rename from keyboards/kbd75/rev1/rules.mk rename to keyboards/kbdfans/kbd75/rev1/rules.mk diff --git a/keyboards/kbd75/rev2/info.json b/keyboards/kbdfans/kbd75/rev2/info.json similarity index 100% rename from keyboards/kbd75/rev2/info.json rename to keyboards/kbdfans/kbd75/rev2/info.json diff --git a/keyboards/kbdfans/kbd75/rev2/rev2.c b/keyboards/kbdfans/kbd75/rev2/rev2.c new file mode 100644 index 00000000000..bf91d400921 --- /dev/null +++ b/keyboards/kbdfans/kbd75/rev2/rev2.c @@ -0,0 +1,17 @@ +#include "rev2.h" + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(B2); + } else { + writePinHigh(B2); + } + + led_set_user(usb_led); +} + +void matrix_init_kb(void) { + setPinOutput(B2); + matrix_init_user(); +} diff --git a/keyboards/kbd75/rev2/rev2.h b/keyboards/kbdfans/kbd75/rev2/rev2.h similarity index 100% rename from keyboards/kbd75/rev2/rev2.h rename to keyboards/kbdfans/kbd75/rev2/rev2.h diff --git a/keyboards/kbd75/rev2/rules.mk b/keyboards/kbdfans/kbd75/rev2/rules.mk similarity index 100% rename from keyboards/kbd75/rev2/rules.mk rename to keyboards/kbdfans/kbd75/rev2/rules.mk diff --git a/keyboards/kbdfans/kbd75/rules.mk b/keyboards/kbdfans/kbd75/rules.mk new file mode 100644 index 00000000000..5c461713161 --- /dev/null +++ b/keyboards/kbdfans/kbd75/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = kbdfans/kbd75/rev1 diff --git a/keyboards/kbdfans/kbd8x/config.h b/keyboards/kbdfans/kbd8x/config.h new file mode 100644 index 00000000000..bdd31044076 --- /dev/null +++ b/keyboards/kbdfans/kbd8x/config.h @@ -0,0 +1,190 @@ +/* +Copyright 2017 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT kbd8x +#define DESCRIPTION Custom TKL Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6, B7, D4, F0, D6, D7 } +#define MATRIX_COL_PINS { D1, D0, F7, F6, F5, D5, D3, D2, C7, C6, B5, F4, F1, B4, B0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 diff --git a/keyboards/kbd8x/info.json b/keyboards/kbdfans/kbd8x/info.json similarity index 100% rename from keyboards/kbd8x/info.json rename to keyboards/kbdfans/kbd8x/info.json diff --git a/keyboards/kbd8x/kbd8x.c b/keyboards/kbdfans/kbd8x/kbd8x.c similarity index 100% rename from keyboards/kbd8x/kbd8x.c rename to keyboards/kbdfans/kbd8x/kbd8x.c diff --git a/keyboards/kbd8x/kbd8x.h b/keyboards/kbdfans/kbd8x/kbd8x.h similarity index 100% rename from keyboards/kbd8x/kbd8x.h rename to keyboards/kbdfans/kbd8x/kbd8x.h diff --git a/keyboards/kbd8x/keymaps/default/config.h b/keyboards/kbdfans/kbd8x/keymaps/default/config.h similarity index 100% rename from keyboards/kbd8x/keymaps/default/config.h rename to keyboards/kbdfans/kbd8x/keymaps/default/config.h diff --git a/keyboards/kbdfans/kbd8x/keymaps/default/keymap.c b/keyboards/kbdfans/kbd8x/keymaps/default/keymap.c new file mode 100644 index 00000000000..6d87bc8893b --- /dev/null +++ b/keyboards/kbdfans/kbd8x/keymaps/default/keymap.c @@ -0,0 +1,52 @@ +/* Copyright 2017 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, RESET, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, BL_TOGG, BL_INC, BL_DEC, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd8x/keymaps/default/readme.md b/keyboards/kbdfans/kbd8x/keymaps/default/readme.md similarity index 100% rename from keyboards/kbd8x/keymaps/default/readme.md rename to keyboards/kbdfans/kbd8x/keymaps/default/readme.md diff --git a/keyboards/kbd8x/keymaps/default_backlighting/config.h b/keyboards/kbdfans/kbd8x/keymaps/default_backlighting/config.h similarity index 100% rename from keyboards/kbd8x/keymaps/default_backlighting/config.h rename to keyboards/kbdfans/kbd8x/keymaps/default_backlighting/config.h diff --git a/keyboards/kbdfans/kbd8x/keymaps/default_backlighting/keymap.c b/keyboards/kbdfans/kbd8x/keymaps/default_backlighting/keymap.c new file mode 100644 index 00000000000..69b09d0a03c --- /dev/null +++ b/keyboards/kbdfans/kbd8x/keymaps/default_backlighting/keymap.c @@ -0,0 +1,51 @@ +/* Copyright 2017 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, RESET, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, BL_TOGG, BL_INC, BL_DEC, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd8x/keymaps/default_backlighting/readme.md b/keyboards/kbdfans/kbd8x/keymaps/default_backlighting/readme.md similarity index 100% rename from keyboards/kbd8x/keymaps/default_backlighting/readme.md rename to keyboards/kbdfans/kbd8x/keymaps/default_backlighting/readme.md diff --git a/keyboards/kbdfans/kbd8x/keymaps/default_backlighting/rules.mk b/keyboards/kbdfans/kbd8x/keymaps/default_backlighting/rules.mk new file mode 100644 index 00000000000..d98bb1cb177 --- /dev/null +++ b/keyboards/kbdfans/kbd8x/keymaps/default_backlighting/rules.mk @@ -0,0 +1 @@ +#Build Options diff --git a/keyboards/kbdfans/kbd8x/readme.md b/keyboards/kbdfans/kbd8x/readme.md new file mode 100644 index 00000000000..9f8555560ab --- /dev/null +++ b/keyboards/kbdfans/kbd8x/readme.md @@ -0,0 +1,15 @@ +# KBD8X + +![kbd8x](imgur.com image replace me!) + +TKL Keyboard from KBDFans + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: kbd8x +Hardware Availability: [KBDFans](https://kbdfans.cn/blogs/updates/kbd-8x-update-40) + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd8x:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd8x/rules.mk b/keyboards/kbdfans/kbd8x/rules.mk new file mode 100644 index 00000000000..f6ed7729c3b --- /dev/null +++ b/keyboards/kbdfans/kbd8x/rules.mk @@ -0,0 +1,68 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/kbdfans/kbd8x_mk2/config.h b/keyboards/kbdfans/kbd8x_mk2/config.h new file mode 100644 index 00000000000..4c6900b6caf --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 Ryota Goto + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xA103 +#define PRODUCT_ID 0x0005 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDfans +#define PRODUCT KBD8X-MKII +#define DESCRIPTION TKL Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C6, B6, B5, B4, D7, D6, D4, D5, D3, D2, D1, D0 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7, B0, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN B3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 20 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 200 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/kbdfans/kbd8x_mk2/info.json b/keyboards/kbdfans/kbd8x_mk2/info.json new file mode 100644 index 00000000000..06d69efe8fa --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/info.json @@ -0,0 +1,103 @@ +{ + "keyboard_name": "kbd8x_mk2", + "url": "https://kb.ai03.me/projects/kbd8x-mkii.html", + "maintainer": "ai03", + "width": 18.25, + "height": 6.25, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.25}, + {"label":"!", "x":1, "y":1.25}, + {"label":"@", "x":2, "y":1.25}, + {"label":"#", "x":3, "y":1.25}, + {"label":"$", "x":4, "y":1.25}, + {"label":"%", "x":5, "y":1.25}, + {"label":"^", "x":6, "y":1.25}, + {"label":"&", "x":7, "y":1.25}, + {"label":"*", "x":8, "y":1.25}, + {"label":"(", "x":9, "y":1.25}, + {"label":")", "x":10, "y":1.25}, + {"label":"_", "x":11, "y":1.25}, + {"label":"+", "x":12, "y":1.25}, + {"label":"Back Space", "x":13, "y":1.25}, + {"label":"Delete", "x":14, "y":1.25}, + {"label":"Insert", "x":15.25, "y":1.25}, + {"label":"Home", "x":16.25, "y":1.25}, + {"label":"PgUp", "x":17.25, "y":1.25}, + {"label":"Tab", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"{", "x":11.5, "y":2.25}, + {"label":"}", "x":12.5, "y":2.25}, + {"label":"|", "x":13.5, "y":2.25, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.25}, + {"label":"End", "x":16.25, "y":2.25}, + {"label":"PgDn", "x":17.25, "y":2.25}, + {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":":", "x":10.75, "y":3.25}, + {"label":"\"", "x":11.75, "y":3.25}, + {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, + {"label":"Shift", "x":0, "y":4.25, "w":1.25}, + {"label":"|", "x":1.25, "y":4.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":"<", "x":9.25, "y":4.25}, + {"label":">", "x":10.25, "y":4.25}, + {"label":"?", "x":11.25, "y":4.25}, + {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, + {"label":"Fn", "x":14, "y":4.25}, + {"label":"\u2191", "x":16.25, "y":4.25}, + {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, + {"x":3.75, "y":5.25, "w":6.25}, + {"label":"Alt", "x":10, "y":5.25, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.25, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.25, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.25, "w":1.25}, + {"label":"\u2190", "x":15.25, "y":5.25}, + {"label":"\u2193", "x":16.25, "y":5.25}, + {"label":"\u2192", "x":17.25, "y":5.25} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/kbdfans/kbd8x_mk2/kbd8x_mk2.c b/keyboards/kbdfans/kbd8x_mk2/kbd8x_mk2.c new file mode 100644 index 00000000000..1472707234e --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/kbd8x_mk2.c @@ -0,0 +1,71 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kbd8x_mk2.h" + +void matrix_init_kb(void) { + + // Indicator pins + // B2 - Scroll Lock + // E6 - Caps Lock + // Sinking setup - 5V -> LED/Resistor -> Pin + + setPinOutput(B2); + setPinOutput(E6); + + matrix_init_user(); +} + +void led_set_kb(uint8_t usb_led) { + + // Toggle indicator LEDs + // Since they are a sinking setup, write HIGH to DISABLE, LOW to ENABLE + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(B2); + } else { + writePinHigh(B2); + } + + led_set_user(usb_led); +} + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +*/ diff --git a/keyboards/kbdfans/kbd8x_mk2/kbd8x_mk2.h b/keyboards/kbdfans/kbd8x_mk2/kbd8x_mk2.h new file mode 100644 index 00000000000..86d8b35ea3f --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/kbd8x_mk2.h @@ -0,0 +1,51 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K000, K001, K011, K002, K012, K003, K013, K004, K014, K005, K015, K006, K016, K007, K017, K008, \ + K020, K030, K021, K031, K022, K032, K023, K033, K024, K034, K025, K035, K026, K036, K066, K027, K037, K028, \ + K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K047, K057, K048, \ + K060, K070, K061, K071, K062, K072, K063, K073, K064, K074, K065, K075, K076, \ + K080, K090, K081, K091, K082, K092, K083, K093, K084, K094, K085, K095, K086, K096, K097, \ + K100, K110, K101, K103, K105, K115, K106, K116, K107, K117, K108 \ +) \ +{ \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { KC_NO, K011, K012, K013, K014, K015, K016, K017, KC_NO }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, KC_NO }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, KC_NO }, \ + { K060, K061, K062, K063, K064, K065, K066, KC_NO, KC_NO }, \ + { K070, K071, K072, K073, K074, K075, K076, KC_NO, KC_NO }, \ + { K080, K081, K082, K083, K084, K085, K086, KC_NO, KC_NO }, \ + { K090, K091, K092, K093, K094, K095, K096, K097, KC_NO }, \ + { K100, K101, KC_NO, K103, KC_NO, K105, K106, K107, K108 }, \ + { K110, KC_NO, KC_NO, KC_NO, KC_NO, K115, K116, K117, KC_NO } \ +} + + diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/ai03/keymap.c b/keyboards/kbdfans/kbd8x_mk2/keymaps/ai03/keymap.c new file mode 100644 index 00000000000..f651f2f0b27 --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/ai03/keymap.c @@ -0,0 +1,53 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_LGUI, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_GRV, BL_TOGG, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( /* Base */ + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, _______, _______, _______, \ + KC_CAPS, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, \ + _______, KC_HOME, KC_PGDN, KC_END, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, KC_PGUP, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/ai03/readme.md b/keyboards/kbdfans/kbd8x_mk2/keymaps/ai03/readme.md new file mode 100644 index 00000000000..d48343e70da --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/ai03/readme.md @@ -0,0 +1,4 @@ +# The ai03 keymap for KBD8X MKII + +A strange layout that focuses functionality into the alphanumerics cluster. +Fn row and further keys effectively become nothing more than decoration. \ No newline at end of file diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_625/keymap.c b/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_625/keymap.c new file mode 100644 index 00000000000..69d04852c98 --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_625/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_625/readme.md b/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_625/readme.md new file mode 100644 index 00000000000..87527897df9 --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_625/readme.md @@ -0,0 +1,3 @@ +# The ANSI 6.25U keymap for KBD8X MKII + +A typical setup for the 1.25/6.25U bottom row. \ No newline at end of file diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_7/keymap.c b/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_7/keymap.c new file mode 100644 index 00000000000..99496e21ffc --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_7/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_7/readme.md b/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_7/readme.md new file mode 100644 index 00000000000..c0f5b86294f --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/ansi_7/readme.md @@ -0,0 +1,3 @@ +# The ANSI WKL keymap for KBD8X MKII + +A typical setup for the 1.5/7U bottom row. \ No newline at end of file diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/default/keymap.c b/keyboards/kbdfans/kbd8x_mk2/keymaps/default/keymap.c new file mode 100644 index 00000000000..1064c141dba --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/default/readme.md b/keyboards/kbdfans/kbd8x_mk2/keymaps/default/readme.md new file mode 100644 index 00000000000..287ee702a0d --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/default/readme.md @@ -0,0 +1,4 @@ +# The default keymap for KBD8X MKII + +A typical setup. Nothing special. +A nice starting point for customizing. diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_625/keymap.c b/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_625/keymap.c new file mode 100644 index 00000000000..01c4a03af70 --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_625/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NUHS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_ALGR, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_625/readme.md b/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_625/readme.md new file mode 100644 index 00000000000..38760b7ad79 --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_625/readme.md @@ -0,0 +1,3 @@ +# The ISO 6.25U keymap for KBD8X MKII + +A typical setup for an ISO layout using 1.25/6.25U bottom row. \ No newline at end of file diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_7/keymap.c b/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_7/keymap.c new file mode 100644 index 00000000000..4087b59847d --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_7/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NUHS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_ALGR, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_7/readme.md b/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_7/readme.md new file mode 100644 index 00000000000..2f0eb196177 --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/iso_7/readme.md @@ -0,0 +1,3 @@ +# The ISO 7U keymap for KBD8X MKII + +A typical setup for an ISO layout using 1.5/7U bottom row. \ No newline at end of file diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/tester/keymap.c b/keyboards/kbdfans/kbd8x_mk2/keymaps/tester/keymap.c new file mode 100644 index 00000000000..dc742bcfaf8 --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/tester/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + + KC_ESC, KC_CAPS, KC_SLCK, BL_TOGG, BL_STEP, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbd8x_mk2/keymaps/tester/readme.md b/keyboards/kbdfans/kbd8x_mk2/keymaps/tester/readme.md new file mode 100644 index 00000000000..3de082bed95 --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/keymaps/tester/readme.md @@ -0,0 +1,18 @@ +# The tester keymap for KBD8X MKII + +Sets the fn row to LED toggling (caps lock, scroll lock, RGB underglow, backlight). + +F1 = Caps Lock +F2 = Scroll Lock +F3 = Backlight Toggle +F4 = Backlight Step + +F5 = RGB Toggle +F6 = RGB Mode Cycle +F7 = RGB Hue Increase +F8 = RGB Hue Decrease + +F9 = RGB Saturation Increase +F10 = RGB Saturation Decrease +F11 = RGB Value Increase +F12 = RGB Value Decrease \ No newline at end of file diff --git a/keyboards/kbdfans/kbd8x_mk2/readme.md b/keyboards/kbdfans/kbd8x_mk2/readme.md new file mode 100644 index 00000000000..3655ac1c75f --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/readme.md @@ -0,0 +1,15 @@ +# KBD8X MKII + +![Photo](https://cdn.shopify.com/s/files/1/1473/3902/products/9_e4262f46-0d69-4c6c-9cc6-b88a3e2483d7_1800x1800.jpg) + +A fairly typical TKL + +Keyboard Maintainer: [ai03](https://github.com/ai03-2725) / [KBDfans](https://kbdfans.cn/) +Hardware Supported: KBD8X MKII PCB/case +Hardware Availability: [KBDfans](https://kbdfans.cn/collections/new-arrival/products/coming-soon-kbd8x-mkii-custom-mechanical-keyboard-kit) + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbd8x_mk2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbd8x_mk2/rules.mk b/keyboards/kbdfans/kbd8x_mk2/rules.mk new file mode 100644 index 00000000000..43e0dcf40f0 --- /dev/null +++ b/keyboards/kbdfans/kbd8x_mk2/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/kbdfans/kbdpad_mk2/config.h b/keyboards/kbdfans/kbdpad_mk2/config.h new file mode 100644 index 00000000000..e3b91e1a1b0 --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 Ryota Goto + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xA103 +#define PRODUCT_ID 0x0006 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDfans +#define PRODUCT KBDPAD-MKII +#define DESCRIPTION Numpad + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D1, D2, C6, C7, B6 } +#define MATRIX_COL_PINS { C4, C5, B3, B2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +#define RGB_DI_PIN B5 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 16 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/kbdfans/kbdpad_mk2/info.json b/keyboards/kbdfans/kbdpad_mk2/info.json new file mode 100644 index 00000000000..50cfc871d8f --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/info.json @@ -0,0 +1,37 @@ +{ + "keyboard_name": "kbdpad_mk2", + "url": "https://kb.ai03.me/projects/kbdpad-mkii.html", + "maintainer": "ai03", + "width": 4, + "height": 6.25, + "layouts": { + "LAYOUT_ortho_6x4": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":0, "y":2.25}, + {"x":1, "y":2.25}, + {"x":2, "y":2.25}, + {"x":3, "y":2.25}, + {"x":0, "y":3.25}, + {"x":1, "y":3.25}, + {"x":2, "y":3.25}, + {"x":3, "y":3.25}, + {"x":0, "y":4.25}, + {"x":1, "y":4.25}, + {"x":2, "y":4.25}, + {"x":3, "y":4.25}, + {"x":0, "y":5.25}, + {"x":1, "y":5.25}, + {"x":2, "y":5.25}, + {"x":3, "y":5.25} + ] + } + } +} diff --git a/keyboards/kbdfans/kbdpad_mk2/kbdpad_mk2.c b/keyboards/kbdfans/kbdpad_mk2/kbdpad_mk2.c new file mode 100644 index 00000000000..3ca8e0c7355 --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/kbdpad_mk2.c @@ -0,0 +1,61 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kbdpad_mk2.h" + +void matrix_init_kb(void) { + + // Num Lock LED = B4 + // Sinking setup (5V -> LED/Res -> Pin) + + setPinOutput(B4); + + matrix_init_user(); +} + +void led_set_kb(uint8_t usb_led) { + + // Sinking setup. Write HIGH to turn OFF, LOW to turn ON. + + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(B4); + } else { + writePinHigh(B4); + } + + led_set_user(usb_led); +} + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +*/ diff --git a/keyboards/kbdfans/kbdpad_mk2/kbdpad_mk2.h b/keyboards/kbdfans/kbdpad_mk2/kbdpad_mk2.h new file mode 100644 index 00000000000..328aeaac9b5 --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/kbdpad_mk2.h @@ -0,0 +1,43 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_6x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33, \ + K40, K41, K42, K43, \ + K50, K51, K52, K53 \ +) \ +{ \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 }, \ + { K50, K51, K52, K53 } \ +} diff --git a/keyboards/kbdfans/kbdpad_mk2/keymaps/default/keymap.c b/keyboards/kbdfans/kbdpad_mk2/keymaps/default/keymap.c new file mode 100644 index 00000000000..841db90caa0 --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_6x4( /* Base */ + KC_ESC, KC_LCTL, KC_LALT, KC_BSPC, \ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_P0, KC_P0, KC_PDOT, KC_PENT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbdpad_mk2/keymaps/default/readme.md b/keyboards/kbdfans/kbdpad_mk2/keymaps/default/readme.md new file mode 100644 index 00000000000..71ff8e0025d --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default keymap for KBDPAD MKII + +Just a numpad. Top row from Cherry G80-3700 \ No newline at end of file diff --git a/keyboards/kbdfans/kbdpad_mk2/keymaps/tester/keymap.c b/keyboards/kbdfans/kbdpad_mk2/keymaps/tester/keymap.c new file mode 100644 index 00000000000..04c301feea6 --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/keymaps/tester/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_6x4( /* Base */ + BL_TOGG, BL_STEP, RGB_TOG, RGB_MOD, \ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_P0, KC_P0, KC_PDOT, KC_PENT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbdfans/kbdpad_mk2/keymaps/tester/readme.md b/keyboards/kbdfans/kbdpad_mk2/keymaps/tester/readme.md new file mode 100644 index 00000000000..3cd1e9b67b3 --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/keymaps/tester/readme.md @@ -0,0 +1,9 @@ +# The testing keymap for KBDPAD MKII + +Turns top row into LED tester. + +From left to right: +Backlight Toggle +Backlight Step +RGB Toggle +RGB Mode Cycle \ No newline at end of file diff --git a/keyboards/kbdfans/kbdpad_mk2/readme.md b/keyboards/kbdfans/kbdpad_mk2/readme.md new file mode 100644 index 00000000000..7736019bb5c --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/readme.md @@ -0,0 +1,15 @@ +# KBDPAD MKII + +![kbdpad_mk2](https://cdn.shopify.com/s/files/1/1473/3902/files/1_17ddc70a-87f6-406d-8a32-d63615c70773.jpg?v=1552119175) + +A simple numpad + +Keyboard Maintainer: [ai03](https://github.com/ai03-2725)/[KBDfans](https://kbdfans.cn/) +Hardware Supported: The KBDPAD MKII PCB/case +Hardware Availability: [KBDfans](https://kbdfans.cn/products/gb-kbdpad-mkii-mechanical-keyboard-kit) + +Make example for this keyboard (after setting up your build environment): + + make kbdfans/kbdpad_mk2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kbdfans/kbdpad_mk2/rules.mk b/keyboards/kbdfans/kbdpad_mk2/rules.mk new file mode 100644 index 00000000000..90614e94090 --- /dev/null +++ b/keyboards/kbdfans/kbdpad_mk2/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u2 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_6x4 diff --git a/keyboards/kbdfans/readme.md b/keyboards/kbdfans/readme.md new file mode 100644 index 00000000000..1ba5ed3d115 --- /dev/null +++ b/keyboards/kbdfans/readme.md @@ -0,0 +1,17 @@ +# KBDFans + +KBDfans is a keyboard retailer located in China. + +## Online Stores + +**Website:** https://kbdfans.cn/ +**AliExpress:** https://kbdfans.aliexpress.com/ +**eBay:** https://www.ebay.com/str/KBDfans/ +**Taobao:** https://yikewaishe.taobao.com/ + +## Social Media + +**Discord:** https://discord.gg/HMZKDhn +**Facebook:** https://www.facebook.com/KBDfanskeyboard/ +**Instagram:** https://www.instagram.com/kbdfans.cn/ + diff --git a/keyboards/kc60/config.h b/keyboards/kc60/config.h index 29695d0b9d7..7e9cdaa086f 100644 --- a/keyboards/kc60/config.h +++ b/keyboards/kc60/config.h @@ -56,7 +56,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -102,11 +102,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/kc60/keymaps/dbroqua/keymap.c b/keyboards/kc60/keymaps/dbroqua/keymap.c index f28e441b0af..a70e1017e26 100644 --- a/keyboards/kc60/keymaps/dbroqua/keymap.c +++ b/keyboards/kc60/keymaps/dbroqua/keymap.c @@ -7,7 +7,6 @@ // Fillers to make layering more clear #define ______ KC_TRNS -#define XXXXXXX KC_NO // Func macro definitions. #define S_LED FUNC(0) diff --git a/keyboards/kc60/keymaps/dbroqua_hhkb/keymap.c b/keyboards/kc60/keymaps/dbroqua_hhkb/keymap.c index 10e00650d1b..af758ae16ad 100644 --- a/keyboards/kc60/keymaps/dbroqua_hhkb/keymap.c +++ b/keyboards/kc60/keymaps/dbroqua_hhkb/keymap.c @@ -6,7 +6,6 @@ // Fillers to make layering more clear #define ______ KC_TRNS -#define XXXXXXX KC_NO // Func macro definitions. #define S_LED FUNC(0) diff --git a/keyboards/kc60/keymaps/default/keymap.c b/keyboards/kc60/keymaps/default/keymap.c index 045ab810f9e..a96b9d3770e 100644 --- a/keyboards/kc60/keymaps/default/keymap.c +++ b/keyboards/kc60/keymaps/default/keymap.c @@ -10,13 +10,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_NO, KC_RGUI, KC_RALT, KC_RCTL, RESET \ ), }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - return MACRO_NONE; -}; diff --git a/keyboards/kc60/keymaps/noroadsleft/keymap.c b/keyboards/kc60/keymaps/noroadsleft/keymap.c index f28f2144f0c..98d73535687 100644 --- a/keyboards/kc60/keymaps/noroadsleft/keymap.c +++ b/keyboards/kc60/keymaps/noroadsleft/keymap.c @@ -1,4 +1,5 @@ #include QMK_KEYBOARD_H +#include "version.h" #include //#include #include @@ -8,24 +9,24 @@ ** LAYER DEFINITIONS ** **********************/ enum layers_keymap { - // BASE LAYERS - _QWERTY = 0, - _DVORAK, - _COLEMAK, - _MAC, - _QUAKE2, - _QUAKE2_DVORAK, - _QUAKE2_CONSOLE, - - // FUNCTION LAYERS - _FUNCWIN, - _FUNCMAC, - _FUNCQ2, - - // OTHER LAYERS - _NUMPAD, - _MACROS, - _SYSTEM + // BASE LAYERS + _QWERTY = 0, + _DVORAK, + _COLEMAK, + _MAC, + _QUAKE2, + _QUAKE2_DVORAK, + _QUAKE2_CONSOLE, + + // FUNCTION LAYERS + _FUNCWIN, + _FUNCMAC, + _FUNCQ2, + + // OTHER LAYERS + _NUMPAD, + _MACROS, + _SYSTEM }; // LAYER SHORT CODES @@ -69,325 +70,342 @@ enum layers_keymap { // MACRO DEFINITIONS enum custom_keycodes { - F_CAPS = SAFE_RANGE, - T_L3DED, - G_PUSH, - G_FTCH, - G_COMM, - G_RST, - G_C10R, - G_BRCH, - SIGNA, - GO_Q2, - Q2_ON, - Q2_OFF, - Q2_ESC, - Q2_GRV, - MC_UNDO, - MC_PSTE + F_CAPS = SAFE_RANGE, + T_L3DED, + G_PUSH, + G_FTCH, + G_COMM, + G_RST, + G_C10R, + G_BRCH, + SIGNA, + GO_Q2, + Q2_ON, + Q2_OFF, + Q2_ESC, + Q2_GRV, + MC_UNDO, + MC_PSTE, + NUBS_Z, + VRSN }; -// define modifiers -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +/******************* +** MODIFIER MASKS ** +*******************/ +#define MOD_MASK_RALT (MOD_BIT(KC_RALT)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { - uint8_t modifiers = get_mods(); - switch(keycode) { - // these are our macros! - case F_CAPS: - /* - Objective: write a macro that checks the current layers that are - enabled, and activates the appropriate function layer. - */ - if ( biton32(layer_state) == _MAC ) { - if (record->event.pressed) { - layer_on(_FUNCMAC); - } else { - layer_off(_FUNCMAC); - } - } else { - if (record->event.pressed) { - layer_on(_FUNCWIN); - } else { - layer_off(_FUNCWIN); - } - }; - return false; - break; - case T_L3DED: - if (record->event.pressed) { - SEND_STRING("lavak3DED "); - }; - return false; - break; - case G_PUSH: - if (record->event.pressed) { - SEND_STRING("git push origin "); - }; - return false; - break; - case G_FTCH: - if (record->event.pressed) { - SEND_STRING("git fetch upstream"); - }; - return false; - break; - case G_COMM: - if (record->event.pressed) { - SEND_STRING("git commit -m \"\"" SS_TAP(X_LEFT)); - layer_off(_MACROS); - }; - return false; - break; - case G_RST: - if (record->event.pressed) { - SEND_STRING("git histt -n 10" SS_TAP(X_ENTER) "git reset --soft "); - layer_off(_MACROS); - }; - return false; - break; - case G_C10R: - if (record->event.pressed) { - SEND_STRING("cf/"); - layer_off(_MACROS); - }; - return false; - break; - case G_BRCH: - if (record->event.pressed) { - SEND_STRING("$(git branch-name)"); - layer_off(_MACROS); - }; - return false; - break; - case SIGNA: - if (record->event.pressed) { - SEND_STRING("\\- @noroadsleft" SS_TAP(X_ENTER)); - layer_off(_MACROS); - }; - return false; - break; - case GO_Q2: - if (record->event.pressed) { - //default_layer_set(_QWERTY); - layer_move(_QWERTY); // TO(_QWERTY); - layer_on(_QUAKE2); - //layer_off(_SYSTEM); - }; - return false; - break; - case Q2_ON: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_ENTER)); - layer_on(_DVORAK); - layer_on(_QUAKE2_DVORAK); - }; - return false; - break; - case Q2_OFF: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_ENTER)); - layer_move(_QWERTY); // TO(_QWERTY); - layer_on(_QUAKE2); - }; - return false; - break; - case Q2_ESC: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_ESCAPE)); - layer_move(_QWERTY); // TO(_QWERTY); - layer_on(_QUAKE2); - }; - return false; - break; - case Q2_GRV: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_GRAVE)); - layer_on(_DVORAK); - layer_on(_QUAKE2_DVORAK); - layer_on(_QUAKE2_CONSOLE); - }; - return false; - break; - case MC_UNDO: - if (record->event.pressed) { - if ( modifiers & MODS_SHIFT_MASK ) { - SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); - } else { - SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) ); - } - }; - return false; - break; - case MC_PSTE: - if (record->event.pressed) { - if ( modifiers & MODS_SHIFT_MASK ) { - SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_DOWN(X_LALT) SS_TAP(X_V) SS_UP(X_LALT) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); - } else { - SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_V) SS_UP(X_LGUI) ); - } - }; - return false; - break; - } // switch() - return true; + switch(keycode) { + // these are our macros! + case F_CAPS: + /* + * Objective: write a macro that checks the current layers that are + * enabled, and activates the appropriate function layer. + */ + if ( biton32(layer_state) == _MAC ) { + if (record->event.pressed) { + layer_on(_FUNCMAC); + } else { + layer_off(_FUNCMAC); + } + } else { + if (record->event.pressed) { + layer_on(_FUNCWIN); + } else { + layer_off(_FUNCWIN); + } + }; + return false; + case T_L3DED: + if (record->event.pressed) { + SEND_STRING("lavak3DED "); + }; + return false; + case G_PUSH: + if (record->event.pressed) { + SEND_STRING("git push origin "); + }; + return false; + case G_FTCH: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_SHIFT ) { + clear_mods(); + SEND_STRING("git pull upstream "); + } else { + SEND_STRING("git fetch upstream "); + } + }; + return false; + case G_COMM: + if (record->event.pressed) { + SEND_STRING("git commit -m \"\"" SS_TAP(X_LEFT)); + layer_off(_MACROS); + }; + return false; + case G_BRCH: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_SHIFT ) { + clear_mods(); + SEND_STRING("master"); + } else { + SEND_STRING("$(git branch-name)"); + } + layer_off(_MACROS); + }; + return false; + case SIGNA: + if (record->event.pressed) { + SEND_STRING("\\- @noroadsleft" SS_TAP(X_ENTER)); + layer_off(_MACROS); + }; + return false; + case GO_Q2: + if (record->event.pressed) { + //default_layer_set(_QWERTY); + layer_move(_QWERTY); // TO(_QWERTY); + layer_on(_QUAKE2); + //layer_off(_SYSTEM); + }; + return false; + case Q2_ON: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_ENTER)); + layer_on(_DVORAK); + layer_on(_QUAKE2_DVORAK); + }; + return false; + case Q2_OFF: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_ENTER)); + layer_move(_QWERTY); // TO(_QWERTY); + layer_on(_QUAKE2); + }; + return false; + case Q2_ESC: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_ESCAPE)); + layer_move(_QWERTY); // TO(_QWERTY); + layer_on(_QUAKE2); + }; + return false; + case Q2_GRV: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_GRAVE)); + layer_on(_DVORAK); + layer_on(_QUAKE2_DVORAK); + layer_on(_QUAKE2_CONSOLE); + }; + return false; + case MC_UNDO: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_SHIFT ) { + SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); + } else { + SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) ); + } + }; + return false; + case MC_PSTE: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_SHIFT ) { + SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_DOWN(X_LALT) SS_TAP(X_V) SS_UP(X_LALT) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); + } else { + SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_V) SS_UP(X_LGUI) ); + } + }; + return false; + case NUBS_Z: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_RALT ) { + SEND_STRING( SS_DOWN(X_NONUS_BSLASH) ); + } else { + SEND_STRING( SS_DOWN(X_Z) ); + } + } else { + if ( get_mods() & MOD_MASK_RALT ) { + SEND_STRING( SS_UP(X_NONUS_BSLASH) ); + } else { + SEND_STRING( SS_UP(X_Z) ); + } + }; + return false; + case VRSN: + if (record->event.pressed) { + SEND_STRING( QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ); + } + return false; + case KC_1 ... KC_0: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_RALT ) { + register_code( keycode + 0x3b ); + } else { + register_code( keycode ); + } + } else { + if ( get_mods() & MOD_MASK_RALT ) { + unregister_code( keycode + 0x3b ); + } else { + unregister_code( keycode ); + } + } + return false; + } // switch() + return true; }; // KEYMAPS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /**************** - ** BASE LAYERS ** - ****************/ - - /* QWERTY */ - [_QWERTY] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - FW_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ - ), - - /* Dvorak */ - [_DVORAK] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, \ - FW_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ - ), - - /* Colemak */ - [_COLEMAK] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \ - FW_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ - ), - - /**************** - ** OS OVERLAYS ** - ****************/ - - /* Mac */ - [_MAC] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - FM_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FM), _______ \ - ), - - /********************* - ** QUAKE 2 OVERLAYS ** - *********************/ - - /* Quake 2 */ - [_QUAKE2] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_ON, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ - ), - - [_QUAKE2_DVORAK] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_OFF, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ - ), - - [_QUAKE2_CONSOLE] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ - ), - - /******************** - ** FUNCTION LAYERS ** - ********************/ - - /* Windows Fn layer */ - [_FUNCWIN] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - _______, KC_CALC, KC_APP, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ - NO_CHNG, WN_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_PENT, \ - _______, WN_UNDO, WN_CUT, WN_COPY, WN_PSTE, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, TG(_SY), _______, \ - _______, _______, _______, TG(_NP), _______, TG(_MA), NO_CHNG, _______ \ - ), - - /* MacOS Fn layer */ - [_FUNCMAC] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - _______, _______, _______, _______, _______, _______, KC_INS, MC_HOME, KC_UP, MC_END, KC_PGUP, MC_PSCR, _______, _______, \ - NO_CHNG, MC_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, \ - _______, MC_UNDO, MC_CUT, MC_COPY, MC_PSTE, _______, _______, _______, _______, _______, TG(_SY), _______, \ - _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ - ), - - /* Quake 2 Fn layer */ - [_FUNCQ2] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - Q2_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ - NO_CHNG, _______, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_ENT, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TG(_SY), _______, \ - _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ - ), - - /***************** - ** OTHER LAYERS ** - *****************/ - - /* Numpad layer */ - [_NUMPAD] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, \ - _______, _______, _______, _______, KC_E, KC_F, _______, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PSLS, KC_PEQL, _______, \ - _______, _______, _______, _______, KC_C, KC_D, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PMNS, KC_PENT, \ - _______, _______, _______, _______, KC_A, KC_B, _______, KC_P0, _______, KC_PDOT, _______, _______, \ - _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ - ), - - /* Macro layer */ - [_MACROS] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - TG(_MA), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, G_RST, G_FTCH, G_COMM, _______, _______, _______, _______, T_L3DED, _______, _______, _______, \ - _______, _______, _______, G_C10R, _______, G_BRCH, SIGNA, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ - ), - - /* System layer */ - [_SYSTEM] = LAYOUT_60_ansi( - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - TG(_SY), TO(_QW), TO(_DV), TO(_CM), GO_Q2, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, TG(_MC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_CHNG, XXXXXXX \ - ), + /**************** + ** BASE LAYERS ** + ****************/ + + /* QWERTY */ + [_QWERTY] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + FW_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, NUBS_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ + ), + + /* Dvorak */ + [_DVORAK] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, \ + FW_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ + ), + + /* Colemak */ + [_COLEMAK] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \ + FW_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ + ), + + /**************** + ** OS OVERLAYS ** + ****************/ + + /* Mac */ + [_MAC] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + FM_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FM), _______ \ + ), + + /********************* + ** QUAKE 2 OVERLAYS ** + *********************/ + + /* Quake 2 */ + [_QUAKE2] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_ON, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ + ), + + [_QUAKE2_DVORAK] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_OFF, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ + ), + + [_QUAKE2_CONSOLE] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ + ), + + /******************** + ** FUNCTION LAYERS ** + ********************/ + + /* Windows Fn layer */ + [_FUNCWIN] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + _______, KC_CALC, KC_APP, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ + NO_CHNG, WN_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_PENT, \ + _______, WN_UNDO, WN_CUT, WN_COPY, WN_PSTE, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, TG(_SY), _______, \ + _______, _______, _______, TG(_NP), _______, TG(_MA), NO_CHNG, _______ \ + ), + + /* MacOS Fn layer */ + [_FUNCMAC] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + _______, _______, _______, _______, _______, _______, KC_INS, MC_HOME, KC_UP, MC_END, KC_PGUP, MC_PSCR, _______, _______, \ + NO_CHNG, MC_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, \ + _______, MC_UNDO, MC_CUT, MC_COPY, MC_PSTE, _______, _______, _______, _______, _______, TG(_SY), _______, \ + _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ + ), + + /* Quake 2 Fn layer */ + [_FUNCQ2] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + Q2_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ + NO_CHNG, _______, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TG(_SY), _______, \ + _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ + ), + + /***************** + ** OTHER LAYERS ** + *****************/ + + /* Numpad layer */ + [_NUMPAD] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_E, KC_F, _______, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PSLS, KC_PEQL, _______, \ + _______, _______, _______, _______, KC_C, KC_D, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PMNS, KC_PENT, \ + _______, _______, _______, _______, KC_A, KC_B, _______, KC_P0, _______, KC_PDOT, _______, _______, \ + _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ + ), + + /* Macro layer */ + [_MACROS] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + TG(_MA), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, G_FTCH, G_COMM, _______, _______, _______, _______, T_L3DED, _______, _______, _______, \ + _______, _______, _______, _______, _______, G_BRCH, SIGNA, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ + ), + + /* System layer */ + [_SYSTEM] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + TG(_SY), TO(_QW), TO(_DV), TO(_CM), GO_Q2, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, DEBUG, XXXXXXX, VRSN, XXXXXXX, \ + XXXXXXX, XXXXXXX, TG(_MC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_CHNG, XXXXXXX \ + ), }; diff --git a/keyboards/kc60/keymaps/noroadsleft/readme.md b/keyboards/kc60/keymaps/noroadsleft/readme.md index 737fdc06bbe..c9db4f8de20 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme.md @@ -1,6 +1,6 @@ # @noroadsleft's KC60 keymap -### Last updated: September 2, 2018, 1:03 PM UTC-0700 +### Last updated: April 7, 2019, 2:26 AM UTC-0700 ![](https://i.imgur.com/tzhXQYI.jpg) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md index bee0709f488..fff80760e5b 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md @@ -7,8 +7,6 @@ 4. [Function Layers](./readme_ch4.md) 5. [Other Layers](./readme_ch5.md) -### Last updated: September 2, 2018, 1:03 PM UTC-0700 - ---- diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md index 75a4fc52449..142fe302fda 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md @@ -7,8 +7,6 @@ 4. [Function Layers](./readme_ch4.md) 5. [Other Layers](./readme_ch5.md) -### Last updated: September 2, 2018, 1:03 PM UTC-0700 - ---- diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md index 80549ba5ce6..b9dc556e4e3 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md @@ -7,8 +7,6 @@ 4. [Function Layers](./readme_ch4.md) 5. [Other Layers](./readme_ch5.md) -### Last updated: September 2, 2018, 1:03 PM UTC-0700 - ---- @@ -18,9 +16,9 @@ These layers were born out of the confusion I have had trying to use the in-game chat and the console in [Quake 2](https://en.wikipedia.org/wiki/Quake_II). When Quake 2 came out, alternate keyboard layouts weren't really a thing. As a result, all in-game text input is hard-locked to US QWERTY, regardless of what the operating system is using for its input method. -I'm attempting to solve this by some creative use of QMK's macro feature. The keycode in the System layer that enables these layers, [`GO_Q2`](./keymap.c#L386), is a [macro](./keymap.c#L175-183) that sets the default layer to the QWERTY layer, then turns the Quake 2 layer `_Q2` on. The result is a partially-overwritten QWERTY layer, that has some keycodes with some creative layer switching. +I'm attempting to solve this by some creative use of QMK's macro feature. The keycode in the System layer that enables these layers, [`GO_Q2`](./keymap.c#L404), is a [macro](./keymap.c#L165-L172) that sets the default layer to the QWERTY layer, then turns the Quake 2 layer `_Q2` on. The result is a partially-overwritten QWERTY layer, that has some keycodes with some creative layer switching. -When I hit the `Enter` key (bound in-game to text chat), the [macro keycode](./keymap.c#L184-L191) I've created sends the keycode for `Enter`, then follows with enabling the Hardware Dvorak layer and its corresponding overlay. Now the game is in text chat mode, and my keyboard is in Dvorak. When I hit `Enter` again, another `Enter` [keycode macro](./keymap.c#L192-L199) is sent, which sends the message, then the macro brings me back to the standard QWERTY+Quake 2 setup. Hitting `Escape` instead runs a [macro](./keymap.c#L200-L207) that cancels the sending of the message, and undoes the layers. +When I hit the `Enter` key (bound in-game to text chat), the [macro keycode](./keymap.c#L173-L179) I've created sends the keycode for `Enter`, then follows with enabling the Hardware Dvorak layer and its corresponding overlay. Now the game is in text chat mode, and my keyboard is in Dvorak. When I hit `Enter` again, another `Enter` [keycode macro](./keymap.c#L180-L186) is sent, which sends the message, then the macro brings me back to the standard QWERTY+Quake 2 setup. Hitting `Escape` instead runs a [macro](./keymap.c#L187-L193) that cancels the sending of the message, and undoes the layers. I have been testing this configuration for a few months. Sometimes I end up still in Dvorak mode without any text input systems (in-game chat or the console) running, but it pretty much always happens when I'm focused on the game, so I don't know the cause yet. diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md index f1b50846d9a..00e6b781b47 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md @@ -7,8 +7,6 @@ 4. **Function Layers** 5. [Other Layers](./readme_ch5.md) -### Last updated: September 2, 2018, 1:03 PM UTC-0700 - ---- @@ -44,7 +42,7 @@ Based on the Windows function layer, but removes some functions that are pointle Keycode(s) Sent | Notes :-------------------------------- | :---- -[`Q2_GRV`](./keymap.c#L208-L216) | Sends `KC_GRV`, then enables the Dvorak, Quake 2 Dvorak, and Quake 2 Console layers. +[`Q2_GRV`](./keymap.c#L194-L201) | Sends `KC_GRV`, then enables the Dvorak, Quake 2 Dvorak, and Quake 2 Console layers. diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md index 64102eb88d2..a65b3acbeb4 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md @@ -7,8 +7,6 @@ 4. [Function Layers](./readme_ch4.md) 5. **Other Layers** -### Last updated: September 2, 2018, 1:03 PM UTC-0700 - ---- @@ -36,37 +34,83 @@ Tapping `Esc` exits the Macro layer, if the macro used doesn't do it automatical ### Macros -[![lavak3DED](https://static-cdn.jtvnw.net/emoticons/v1/821796/1.0)](./keymap.c#L122-L127) -Inputs: `lavak3DED ` -Twitch emote for [a streamer I watch a lot](https://www.twitch.tv/lavak3_). +#### [T_L3DED](./keymap.c#L122-L126) + +Output: `lavak3DED ` + +Twitch emote for [a streamer I watch a lot](https://www.twitch.tv/lavak3_). +![lavak3DED](https://static-cdn.jtvnw.net/emoticons/v1/821796/1.0) + +#### [G_PUSH](./keymap.c#L127-L131) + +Output: `git push origin ` -[G_PUSH](./keymap.c#L128-L133) -Inputs: `git push origin ` Everything from here down is related to Git or GitHub. -[G_FTCH](./keymap.c#L134-L139) -Inputs: `git fetch upstream` +#### [G_FTCH](./keymap.c#L132-L141) + +| Condition | Output | +| :-------- | :----- | +| If Shift is active | `git pull upstream ` | +| Otherwise | `git fetch upstream ` | + +#### [G_COMM](./keymap.c#L142-L147) + +Output: `git commit -m ""` Left -[G_COMM](./keymap.c#L140-L146) -Inputs: `git commit -m ""` `[Left]` Readies a `git commit` command, moves the cursor between the quotation marks, then disables the Macro layer. -[G_RST](./keymap.c#L147-L153) -Inputs: `git histt -n 10`, Enter, `git reset --soft ` -Runs a [git alias](./readme_git.md) that shows my last ten commits, then readies a `git reset --soft`. For when I commit something too soon. Disables the Macro layer when complete. +#### [G_BRCH](./keymap.c#L148-L158) + +| Condition | Output | +| :-------- | :----- | +| If Shift is active | `master` | +| Otherwise | `$(git branch-name)` | -[G_C10R](./keymap.c#L154-L160) -Inputs: `cf/` -A branch prefix I use for my current work in QMK. Disables the Macro layer when finished. +`$(git branch-name)` is a [git alias](./readme_git.md) that returns the name of the current branch. This macro disables the Macro layer when finished. -[G_BRCH](./keymap.c#L161-L167) -Inputs: `$(git branch-name)` -A [git alias](./readme_git.md) that returns the name of the current branch. Disables the Macro layer when finished. +#### [SIGNA](./keymap.c#L159-L164) + +Output: `\- @noroadsleft` Enter -[SIGNA](./keymap.c#L168-L174) -Inputs: `\- @noroadsleft` `[Enter]` Sometimes on GitHub, I sign my comments. Types my GitHub name in Markdown syntax, and then taps the `Enter` key. Disables the Macro layer when finished. +#### [MC_UNDO](./keymap.c#L202-L210) + +| Condition | Output | +| :-------- | :----- | +| If Shift is active | Shift + Command + Z | +| Otherwise | Command + Z | + +An Undo shortcut that turns to Redo if Shift is being held. I'm not sure that part is required to get that behavior, but it works as desired, so I'm not messing with it. + +#### [MC_PSTE](./keymap.c#L211-L219) + +| Condition | Output | +| :-------- | :----- | +| If Shift is active | Shift + Command + Option + V | +| Otherwise | Command + V | + +The program I use this in uses Shift + Command + Option + V to paste while maintaining formatting (typeface, text size, etc.). Sometimes I want this and sometimes I don't. Using Shift changes the behavior. + +#### [NUBS_Z](./keymap.c#L220-L234) + +| Condition | Output | +| :-------- | :----- | +| If Right Alt is active | `KC_NUBS` | +| Otherwise | `KC_Z` | + +Sometimes I type in languages from countries that use ISO layout, but my keyboard is ANSI, so I have one key fewer. This macro simulates the Non-US Backslash key if I use Right Alt + Z. + +#### [VRSN](./keymap.c#L235-L239) + +Outputs a string that tells me the Git commit from which my flashed firmware was built. Looks something like: + + kc60/noroadsleft @ 0.6.326-6-gae6d7b-dirty + +#### [Emulated Numeric Keypad](./keymap.c#L240-L254) + +If I hold the Right Alt key, the number row (`KC_1` through `KC_0`) will output numpad keycodes instead of number row keycodes, enabling quicker access to characters like ™ and °. ---- diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_git.md b/keyboards/kc60/keymaps/noroadsleft/readme_git.md index 585d9c8909c..b81bb9409dc 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme_git.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme_git.md @@ -4,46 +4,55 @@ ``` [alias] - # change branches + # Change branches co = checkout cob = checkout -b - # sync master - sync = "!f() { if [ $(git branch-name) != "master" ]; then git checkout master; fi; git pull upstream master; git push origin master; }; f" + # Cherry Pick + cp = cherry-pick + + # Check out a Pull Request + cop = "!f() { git fetch upstream pull/$1/head:pr/$1; git checkout pr/$1; }; f" + + # Sync master branch + sync = !git checkout master && git fetch upstream 2> /dev/null && git pull -n upstream master && git push origin master + + # Return the abbreviated SHA-1 of the last three commits, oldest to newest + rl = rev-list -n 3 --abbrev-commit --reverse HEAD + + # Add remote repo (for sending PRs to other forks, or checking out someone else's developments) + ar = "!f() { git remote add $1 https://github.com/$2/qmk_firmware.git; }; f" # Return the last five commits on the branch, in a more compact format - hist = log --pretty=format:\"%C(yellow)%h%Creset %Cgreen%ad%Creset%n %w(100,0,3)%s%d [%an]%n\" --graph --date=iso-local -n 5 - histm = log --pretty=format:\"%C(yellow)%h%Creset %w(100,0,3)%s%d [%an]\" --graph --date=iso-local -n 5 - histt = log --pretty=format:\"%C(yellow)%h%Creset %<(88,trunc)%s [%an]\" --graph --date=iso-local -n 5 - histb = log --reverse --pretty=format:\"- %<(98,trunc)%s [%an]\" --date=iso-local -n 5 + hist = log --pretty=format:\"%C(yellow)%h%Creset %Cgreen%ad%Creset %Cblue[%an%Cgreen% GK%Cblue]%C(yellow)%d%Creset%n %w(100,0,2)%s%n\" --graph --date=iso-local -n 5 + histt = log --pretty=format:\"* %C(yellow)%h%Creset %<(58,trunc)%s %Cblue%>(18,trunc)%an%Cgreen% G?%Creset @ %Cgreen%ad%Creset\" --date=iso-local -n 5 + histb = log --reverse --pretty=format:\"- %Cblue%>(20,trunc)%an %Creset%<(97,trunc)%s\" --date=iso-local -n 5 + + # Follow a file's filename history + follow = log --follow --name-only --pretty=format:\"%C(yellow)commit %H%Creset%d\nAuthor: %an <%ae>\nDate: %ad%n%n %s%n\" --date=iso-local # compact diff df = "diff --compact-summary" + # List all the files changed in a commit + dt = "diff-tree --no-commit-id --name-only -r" + # Short-form status - st = "!git status --short" + st = "!git status --short --untracked-files=no" # Returns the name of the current branch branch-name = "!git rev-parse --abbrev-ref HEAD" + bn = "!git branch-name" # short-form of the above - # short-form of the above - bn = "!git branch-name" + # Compare commit counts between current branch and QMK master + cc = "!f() { git fetch upstream; echo \"$(git branch-name) vs. upstream/master\"; git rev-list --left-right --count $(git branch-name)...upstream/master; }; f" - po = "push origin ($(git branch-name))" + # Push to origin repo + po = "push origin $(git branch-name)" # List the stashes sl = "stash list" - # Show the contents of a numbered stash - # Syntax: - # git st-show - st-show = "!f() { git stash show stash@{$1} -p; }; f" - - # Apply a stash, without deleting it from the list of stashes - # Syntax: - # git st-copy - st-copy = "!f() { git stash apply stash@{$1}; }; f" - # Unstage a file unstage = "reset HEAD" @@ -53,4 +62,15 @@ # Compare local master repo to its upstream branch. If anything is returned, local branch has diverged from upstream. cm = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master --compact-summary; }; f" cml = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master; }; f" + + # Delete a branch from local and remote + del-branch = "!f() { git branch -d $1; git push origin :$1; git fetch -p origin; }; f" + + # Rebase with signatures + rbv = rebase --exec 'git commit --amend --no-edit -n -S' -i + + # Force push without overwriting established history + pushf = push --force-with-lease + + ``` diff --git a/keyboards/kc60/keymaps/sgoodwin/keymap.c b/keyboards/kc60/keymaps/sgoodwin/keymap.c index 25870d0a78c..c78e3108f79 100644 --- a/keyboards/kc60/keymaps/sgoodwin/keymap.c +++ b/keyboards/kc60/keymaps/sgoodwin/keymap.c @@ -29,10 +29,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/kc60/keymaps/stanleylai/readme.md b/keyboards/kc60/keymaps/stanleylai/readme.md index 815649d987a..6f5953ded74 100644 --- a/keyboards/kc60/keymaps/stanleylai/readme.md +++ b/keyboards/kc60/keymaps/stanleylai/readme.md @@ -1,8 +1,6 @@ Stanley Lai's Split Right Shift with Dedicated Arrow Keys ====================== -![Image of KC60 with RGB Underglow](../ws2812/ws2812_example.jpg) - ## Quantum MK Firmware For the full Quantum feature list, see [the parent readme.md](/readme.md). @@ -20,7 +18,7 @@ For the full Quantum feature list, see [the parent readme.md](/readme.md). ![RGB Layer](http://imgur.com/ZWIfuPM) ## WS2812 Support -By default, it is now setup for 16 LEDs on the PF5 breakout pin. See [included image](../ws2812/ws2812_wiring.jpg) for wiring reference. +By default, it is now setup for 16 LEDs on the PF5 breakout pin. ### Build To build this keymap, simply run `make KEYMAP=stanleylai`. diff --git a/keyboards/kc60/keymaps/stanleylai/rules.mk b/keyboards/kc60/keymaps/stanleylai/rules.mk index 9a381d2e78f..a826c2bf269 100644 --- a/keyboards/kc60/keymaps/stanleylai/rules.mk +++ b/keyboards/kc60/keymaps/stanleylai/rules.mk @@ -20,6 +20,3 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kc60/keymaps/wigguno/keymap.c b/keyboards/kc60/keymaps/wigguno/keymap.c index a4a946f0dfa..aa730c22f9d 100644 --- a/keyboards/kc60/keymaps/wigguno/keymap.c +++ b/keyboards/kc60/keymaps/wigguno/keymap.c @@ -51,10 +51,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/kc60/keymaps/wigguno/rules.mk b/keyboards/kc60/keymaps/wigguno/rules.mk index 1f8d1506f82..db084a76a32 100644 --- a/keyboards/kc60/keymaps/wigguno/rules.mk +++ b/keyboards/kc60/keymaps/wigguno/rules.mk @@ -19,6 +19,3 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kc60/keymaps/ws2812/rules.mk b/keyboards/kc60/keymaps/ws2812/rules.mk index a8c93bcf595..5d5a6f8abec 100644 --- a/keyboards/kc60/keymaps/ws2812/rules.mk +++ b/keyboards/kc60/keymaps/ws2812/rules.mk @@ -20,6 +20,3 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = no # USB Nkey Rollover -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kc60/readme.md b/keyboards/kc60/readme.md index da84f6159af..e152824ccfc 100644 --- a/keyboards/kc60/readme.md +++ b/keyboards/kc60/readme.md @@ -24,7 +24,6 @@ $ make [default|jack|] Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. ## WS2812 Support -![Image of KC60 with RGB Underglow](keymaps/ws2812/ws2812_example.jpg) Build with WS2812 Support by running `make ws2812`. diff --git a/keyboards/kc60/rules.mk b/keyboards/kc60/rules.mk index e4f590b1b15..05cfe88daa3 100644 --- a/keyboards/kc60/rules.mk +++ b/keyboards/kc60/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -67,4 +66,4 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 -LAYOUTS = 60_ansi \ No newline at end of file +LAYOUTS = 60_ansi diff --git a/keyboards/kc60se/config.h b/keyboards/kc60se/config.h index 9f8b3e28aec..5fffe611451 100644 --- a/keyboards/kc60se/config.h +++ b/keyboards/kc60se/config.h @@ -39,16 +39,15 @@ along with this program. If not, see . #define UNUSED_PINS #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN F5 // #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 6 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -98,11 +97,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/kc60se/keymaps/default/config.h b/keyboards/kc60se/keymaps/default/config.h index 0f756350514..4496c591006 100644 --- a/keyboards/kc60se/keymaps/default/config.h +++ b/keyboards/kc60se/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/kc60se/readme.md b/keyboards/kc60se/readme.md index da004c40d20..d6edbdb351c 100644 --- a/keyboards/kc60se/readme.md +++ b/keyboards/kc60se/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make kc60se:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/kc60se/rules.mk b/keyboards/kc60se/rules.mk index c32a9b61090..f090f3ecbf1 100644 --- a/keyboards/kc60se/rules.mk +++ b/keyboards/kc60se/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/keebio/bdn9/bdn9.c b/keyboards/keebio/bdn9/bdn9.c new file mode 100644 index 00000000000..0ff55fd6d45 --- /dev/null +++ b/keyboards/keebio/bdn9/bdn9.c @@ -0,0 +1 @@ +#include "bdn9.h" diff --git a/keyboards/keebio/bdn9/bdn9.h b/keyboards/keebio/bdn9/bdn9.h new file mode 100644 index 00000000000..8a451132647 --- /dev/null +++ b/keyboards/keebio/bdn9/bdn9.h @@ -0,0 +1,37 @@ +/* Copyright 2019 Danny Nguyen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + KA1, KA2, KA3, \ + KB1, KB2, KB3, \ + KC1, KC2, KC3 \ +) \ +{ \ + { KA1, KA2, KA3 }, \ + { KB1, KB2, KB3 }, \ + { KC1, KC2, KC3 } \ +} diff --git a/keyboards/keebio/bdn9/config.h b/keyboards/keebio/bdn9/config.h new file mode 100644 index 00000000000..641dc573619 --- /dev/null +++ b/keyboards/keebio/bdn9/config.h @@ -0,0 +1,67 @@ +/* +Copyright 2019 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1133 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT BDN9 +#define DESCRIPTION 3x3 Macropad with Rotary Encoders + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 3 + +/* Keyboard Matrix Assignments */ +#define DIRECT_PINS { \ + { D2, D4, F4 }, \ + { D7, B1, B3 }, \ + { E6, B4, B2 } \ +} + +#define ENCODERS_PAD_A { D1, F5 } +#define ENCODERS_PAD_B { D0, F6 } + + +#define BACKLIGHT_PIN B5 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 7 + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 4 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ + /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/keebio/bdn9/info.json b/keyboards/keebio/bdn9/info.json new file mode 100644 index 00000000000..a985a05e04d --- /dev/null +++ b/keyboards/keebio/bdn9/info.json @@ -0,0 +1,22 @@ +{ + "keyboard_name": "Keeb.io BDN9", + "url": "", + "maintainer": "nooges", + "width": 3, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2} + ] + } + } +} diff --git a/keyboards/keebio/bdn9/keymaps/bcat/keymap.c b/keyboards/keebio/bdn9/keymaps/bcat/keymap.c new file mode 100644 index 00000000000..3507aaedec4 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/bcat/keymap.c @@ -0,0 +1,43 @@ +#include QMK_KEYBOARD_H + +enum layer { + LAYER_FIRST, + LAYER_SECOND, +}; + +/* Switch to second layer when held. */ +#define LY_SECND MO(LAYER_SECOND) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* First layer (F1-F6) */ + [LAYER_FIRST] = LAYOUT( + KC_MUTE, LY_SECND, BL_TOGG, + KC_F4, KC_F5, KC_F6, + KC_F1, KC_F2, KC_F3 + ), + + /* Second layer (F7-F12) */ + [LAYER_SECOND] = LAYOUT( + _______, _______, _______, + KC_F10, KC_F11, KC_F12, + KC_F7, KC_F8, KC_F9 + ), +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + switch (index) { + /* Top-left encoder (volume): */ + case 0: + tap_code(clockwise ? KC_VOLU : KC_VOLD); + break; + + /* Top-right encoder (backlight brightness): */ + case 1: + if (clockwise) { + backlight_increase(); + } else { + backlight_decrease(); + } + break; + } +} diff --git a/keyboards/keebio/bdn9/keymaps/bcat/readme.md b/keyboards/keebio/bdn9/keymaps/bcat/readme.md new file mode 100644 index 00000000000..277d9bfb18d --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/bcat/readme.md @@ -0,0 +1,7 @@ +# bcat's BDN9 layout + +This is a simple macropad with seven keys and two rotary encoders. We use one +encoder for volume and the other for backlight brightness. Six of the keys are +F keys (for gaming, since I use keyboards without function keys normally), with +the remaining key a layer toggle that switches the function keys between F1-F6 +and F7-F12. diff --git a/keyboards/keebio/bdn9/keymaps/default/keymap.c b/keyboards/keebio/bdn9/keymaps/default/keymap.c new file mode 100644 index 00000000000..c700019dc06 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/default/keymap.c @@ -0,0 +1,57 @@ +/* Copyright 2019 Danny Nguyen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + | Knob 1: Vol Dn/Up | | Knob 2: Page Dn/Up | + | Press: Mute | Home | Press: Play/Pause | + | Hold: Layer 2 | Up | RGB Mode | + | Left | Down | Right | + */ + [0] = LAYOUT( + KC_MUTE, KC_HOME, KC_MPLY, + MO(1) , KC_UP , RGB_MOD, + KC_LEFT, KC_DOWN, KC_RGHT + ), + /* + | RESET | N/A | Media Stop | + | Held: Layer 2 | Home | RGB Mode | + | Media Previous | End | Media Next | + */ + [1] = LAYOUT( + RESET , BL_STEP, KC_STOP, + _______, KC_HOME, RGB_MOD, + KC_MPRV, KC_END , KC_MNXT + ), +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if (index == 1) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } +} diff --git a/keyboards/keebio/bdn9/keymaps/mousepad/config.h b/keyboards/keebio/bdn9/keymaps/mousepad/config.h new file mode 100644 index 00000000000..a2eb1a95f00 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/mousepad/config.h @@ -0,0 +1,3 @@ +#define MK_3_SPEED +#define TERMINAL_HELP + diff --git a/keyboards/keebio/bdn9/keymaps/mousepad/keymap.c b/keyboards/keebio/bdn9/keymaps/mousepad/keymap.c new file mode 100644 index 00000000000..79ae56fd2ee --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/mousepad/keymap.c @@ -0,0 +1,81 @@ +/* Copyright 2019 Danny Nguyen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + + +bool is_alt_tab_active = false; // ADD this near the begining of keymap.c +uint16_t alt_tab_timer = 0; // we will be using them soon. + +enum custom_keycodes { // Make sure have the awesome keycode ready + ALT_TAB = SAFE_RANGE, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, + KC_WH_U, ALT_TAB, KC_WH_L, + KC_WH_D, TT(1), KC_WH_R + ), + [1] = LAYOUT( + RESET, KC_ACL0, KC_ACL1, + KC_VOLU, KC_ACL2, KC_BRIU, + KC_VOLD, TO(1), KC_BRID + ), +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_MS_LEFT); + } else { + tap_code(KC_MS_RIGHT); + } + } + else if (index == 1) { + if (clockwise) { + tap_code(KC_MS_U); + } else { + tap_code(KC_MS_D); + } + } +} +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { // This will do most of the grunt work with the keycodes. + case ALT_TAB: + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + register_code(KC_LALT); + } + alt_tab_timer = timer_read(); + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + } + return true; +} + +void matrix_scan_user(void) { // The very important timer. + if (is_alt_tab_active) { + if (timer_elapsed(alt_tab_timer) > 1000) { + unregister_code(KC_LALT); + is_alt_tab_active = false; + } + } +} diff --git a/keyboards/keebio/bdn9/keymaps/mousepad/readme.md b/keyboards/keebio/bdn9/keymaps/mousepad/readme.md new file mode 100644 index 00000000000..fc843929dbd --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/mousepad/readme.md @@ -0,0 +1,16 @@ +# Mousepad layout for BDN9 +##### 2 encoders required +Why use a movable mouse when you can "Etech-a-sketch" style mousepad. +The left encoder will move the X axis; leaving the right to handle the Y axis + +| | | | +|:-:|:-:|:-:| +| Left Click | Middle Click | Right Click | +| Scroll Up | Super ALT↯TAB | Scroll Left | +| Scroll Down | ADJUSTMENT Layer | Scroll Right| + +| | | | +|:-:|:-:|:-:| +| RESET | Mouse ACL0 | Mouse ACL1 | +| VOL UP | Mouse ACL2 | Brightness UP | +| VOL Down | Adjustment Layer OFF | Brightness Down | diff --git a/keyboards/keebio/bdn9/keymaps/mousepad/rule.mk b/keyboards/keebio/bdn9/keymaps/mousepad/rule.mk new file mode 100644 index 00000000000..ff752ab42ce --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/mousepad/rule.mk @@ -0,0 +1,2 @@ +MOUSEKEY_ENABLE = yes +TAPDANCE_ENABLE = yes diff --git a/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c b/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c new file mode 100644 index 00000000000..ca8679d5749 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/vosechu-browser/keymap.c @@ -0,0 +1,57 @@ +#include QMK_KEYBOARD_H + +// Macro keys for some apps +#define SLACKUP LALT(LSFT(KC_UP)) +#define SLACKDN LALT(LSFT(KC_DOWN)) +#define RELOAD LGUI(KC_R) + +enum custom_keycodes { + PAWFIVE = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + RESET , PAWFIVE, RELOAD , + SLACKUP, KC_UP , KC_PGUP, + SLACKDN, KC_DOWN, KC_PGDN + ), +}; + +void keyboard_post_init_user(void) { + // Call the post init code. + rgblight_enable_noeeprom(); // enables Rgb, without saving settings + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); // sets mode to Slow breathing without saving +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case PAWFIVE: + if (record->event.pressed) { + SEND_STRING("+:pawfive:\n"); + return false; + } + } + + return true; +} + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + // Tab right + tap_code16(LSFT(LGUI(KC_RBRC))); + } else { + // Tab left + tap_code16(LSFT(LGUI(KC_LBRC))); + } + } + else if (index == 1) { + if (clockwise) { + // History forward + tap_code16(LGUI(KC_RBRC)); + } else { + // History back + tap_code16(LGUI(KC_LBRC)); + } + } +} diff --git a/keyboards/keebio/bdn9/keymaps/vosechu-ksp/keymap.c b/keyboards/keebio/bdn9/keymaps/vosechu-ksp/keymap.c new file mode 100644 index 00000000000..7687ea2bfb5 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/vosechu-ksp/keymap.c @@ -0,0 +1,172 @@ +/* Copyright 2019 Chuck Lauer Vose + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// // Debugging +// #include + +#define BASE TO(_BASE) +#define PANIC TO(_PANIC) +#define FLIGHT TO(_FLIGHT) +#define RCS TO(_RCS) + +enum my_layers { + _BASE = 0, + _PANIC, + _FLIGHT, + _RCS +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_MUTE, PANIC , XXXXXXX, + FLIGHT , XXXXXXX, RCS , + XXXXXXX, XXXXXXX, XXXXXXX + ), + [_PANIC] = LAYOUT( + RESET , BASE , XXXXXXX, + _______, XXXXXXX, _______, + KC_F2 , KC_F5 , KC_F9 + ), + [_FLIGHT] = LAYOUT( + XXXXXXX, _______, KC_M , + BASE , KC_W , _______, + KC_A , KC_S , KC_D + ), + [_RCS] = LAYOUT( + XXXXXXX, _______, XXXXXXX, + _______, KC_I , BASE , + KC_J , KC_K , KC_L + ) +}; + +bool base_mode = false; +bool panic_mode = false; +bool flight_mode = false; +bool rcs_mode = false; + +uint32_t layer_state_set_user(uint32_t state) { + base_mode = false; + panic_mode = false; + flight_mode = false; + rcs_mode = false; + + switch (biton32(state)) { + case _PANIC: + panic_mode = true; // For use in encoder evaluation + rgblight_sethsv_noeeprom(HSV_RED); + break; + case _FLIGHT: + flight_mode = true; // For use in encoder evaluation + rgblight_sethsv_noeeprom(HSV_CYAN); + break; + case _RCS: + rcs_mode = true; // For use in encoder evaluation + rgblight_sethsv_noeeprom(HSV_BLUE); + break; + default: // for any other layers, or the default layer + base_mode = true; + rgblight_sethsv_noeeprom(HSV_SPRINGGREEN); + break; + } + return state; +} + +void keyboard_post_init_user(void) { + // Call the post init code. + rgblight_enable_noeeprom(); // enables Rgb, without saving settings + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 1); // sets mode to Slow breathing without saving + rgblight_sethsv_noeeprom(HSV_SPRINGGREEN); +} + +// bool process_record_user(uint16_t keycode, keyrecord_t *record) { +// switch (keycode) { +// uprintf("Keycode: %s\n", keycode); +// if (record->event.pressed) { +// print("pressed"); +// // Do something when pressed +// } else { +// print("unpressed"); +// // Do something else when release +// } +// } +// return true; +// } + +void encoder_update_user(uint8_t index, bool clockwise) { + if(base_mode == true) { + if (index == 0) { + if (clockwise) { + // Volume up + tap_code(KC_VOLU); + } else { + // Volume down + tap_code(KC_VOLD); + } + } + else if (index == 1) { + if (clockwise) { + // Time warp faster + tap_code(KC_DOT); + } else { + // Time warp slower + tap_code(KC_COMM); + } + } + } + + if(rcs_mode == true) { + if (index == 0) { + if (clockwise) { + // RCS Forward + tap_code(KC_H); + } else { + // RCS Backward + tap_code(KC_N); + } + } + else if (index == 1) { + if (clockwise) { + // RCS Rotate Left + tap_code(KC_Q); + } else { + // RCS Rotate Right + tap_code(KC_E); + } + } + } + + if(flight_mode == true) { + if (index == 0) { + if (clockwise) { + // Throttle up + tap_code(KC_LSFT); + } else { + // Throttle down + tap_code(KC_LCTL); + } + } + else if (index == 1) { + if (clockwise) { + // Trim left + tap_code16(LALT(KC_A)); + } else { + // Trim right + tap_code16(LALT(KC_D)); + } + } + } +} diff --git a/keyboards/keebio/bdn9/readme.md b/keyboards/keebio/bdn9/readme.md new file mode 100644 index 00000000000..ddbe7f144b6 --- /dev/null +++ b/keyboards/keebio/bdn9/readme.md @@ -0,0 +1,15 @@ +# BDN9 + +![BDN9](https://cdn.shopify.com/s/files/1/1851/5125/products/image_bd8d9423-950e-4aad-bea5-665d896f879a_530x@2x.jpg?v=1547909493) + +A 3x3 macropad with support for a rotary encoder at the upper two corners. + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro, Elite-C, Proton C +Hardware Availability: [Keebio - BDN9](https://keeb.io/products/bdn9-3x3-9-key-macropad-rotary-encoder-support) + +Make example for this keyboard (after setting up your build environment): + + make keebio/bdn9:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/keebio/bdn9/rules.mk b/keyboards/keebio/bdn9/rules.mk new file mode 100644 index 00000000000..3ab84910890 --- /dev/null +++ b/keyboards/keebio/bdn9/rules.mk @@ -0,0 +1,50 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +ENCODER_ENABLE = yes diff --git a/keyboards/bfo9000/bfo9000.c b/keyboards/keebio/bfo9000/bfo9000.c similarity index 100% rename from keyboards/bfo9000/bfo9000.c rename to keyboards/keebio/bfo9000/bfo9000.c diff --git a/keyboards/keebio/bfo9000/bfo9000.h b/keyboards/keebio/bfo9000/bfo9000.h new file mode 100644 index 00000000000..985c7f67f13 --- /dev/null +++ b/keyboards/keebio/bfo9000/bfo9000.h @@ -0,0 +1,26 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, L07, L08, R00, R01, R02, R03, R04, R05, R06, R07, R08, \ + L10, L11, L12, L13, L14, L15, L16, L17, L18, R10, R11, R12, R13, R14, R15, R16, R17, R18, \ + L20, L21, L22, L23, L24, L25, L26, L27, L28, R20, R21, R22, R23, R24, R25, R26, R27, R28, \ + L30, L31, L32, L33, L34, L35, L36, L37, L38, R30, R31, R32, R33, R34, R35, R36, R37, R38, \ + L40, L41, L42, L43, L44, L45, L46, L47, L48, R40, R41, R42, R43, R44, R45, R46, R47, R48, \ + L50, L51, L52, L53, L54, L55, L56, L57, L58, R50, R51, R52, R53, R54, R55, R56, R57, R58 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06, L07, L08 }, \ + { L10, L11, L12, L13, L14, L15, L16, L17, L18 }, \ + { L20, L21, L22, L23, L24, L25, L26, L27, L28 }, \ + { L30, L31, L32, L33, L34, L35, L36, L37, L38 }, \ + { L40, L41, L42, L43, L44, L45, L46, L47, L48 }, \ + { L50, L51, L52, L53, L54, L55, L56, L57, L58 }, \ + { R00, R01, R02, R03, R04, R05, R06, R07, R08 }, \ + { R10, R11, R12, R13, R14, R15, R16, R17, R18 }, \ + { R20, R21, R22, R23, R24, R25, R26, R27, R28 }, \ + { R30, R31, R32, R33, R34, R35, R36, R37, R38 }, \ + { R40, R41, R42, R43, R44, R45, R46, R47, R48 }, \ + { R50, R51, R52, R53, R54, R55, R56, R57, R58 } \ + } diff --git a/keyboards/keebio/bfo9000/config.h b/keyboards/keebio/bfo9000/config.h new file mode 100644 index 00000000000..b45ec9c2faf --- /dev/null +++ b/keyboards/keebio/bfo9000/config.h @@ -0,0 +1,71 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1169 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT BFO-9000 +#define DESCRIPTION Really big split ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +// wiring of each half +#define MATRIX_ROW_PINS { D3, D2, D4, C6, D7, E6 } +#define MATRIX_COL_PINS { B5, B6, B2, B3, B1, F7, F6, F5, F4 } + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B4 +#define RGBLED_NUM 20 // Number of LEDs + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/keebio/bfo9000/keymaps/abstractkb/config.h b/keyboards/keebio/bfo9000/keymaps/abstractkb/config.h new file mode 100644 index 00000000000..67c64fd8e87 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/abstractkb/config.h @@ -0,0 +1,37 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +(Modified) Copyright 2019 AbstractKB + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//my block------------ +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_SLEEP + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/keebio/bfo9000/keymaps/abstractkb/keymap.c b/keyboards/keebio/bfo9000/keymaps/abstractkb/keymap.c new file mode 100644 index 00000000000..a8348ecfb56 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/abstractkb/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +enum layers { + _BASE, + _LIST +}; + +enum my_keycodes { + MYRGB_TG = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_BASE] = LAYOUT( \ + KC_MPLY, KC_PSLS, KC_PAST, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MYRGB_TG, KC_PGUP, \ + KC_MUTE, KC_PPLS, KC_PMNS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_PGDN, \ + KC_P7, KC_P8, KC_P9, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, \ + KC_P4, KC_P5, KC_P6, KC_BSPACE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_CAPS, KC_PSCR, \ + KC_P1, KC_P2, KC_P3, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, XXXXXXX, KC_INS, \ + KC_P0, KC_PDOT, KC_PENT, TO(_LIST), KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, KC_SPC, KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX \ +), + +[_LIST] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, TO(_BASE), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +bool rgbinit = true; +bool rgbon = true; + +const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {1,5,5}; //only using the first one + +void matrix_post_init_user(void) { + rgblight_enable_noeeprom(); + led_set_user(host_keyboard_leds()); +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _LIST: + rgblight_sethsv_noeeprom(0,255,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); + break; + default: //_BASE + rgblight_sethsv_noeeprom(0,0,255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + } + + return state; +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1<event.pressed) { + myrgb_toggle(); + } + return false; + default: + return true; + } +} + + + diff --git a/keyboards/keebio/bfo9000/keymaps/abstractkb/readme.md b/keyboards/keebio/bfo9000/keymaps/abstractkb/readme.md new file mode 100644 index 00000000000..3ba56571fea --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/abstractkb/readme.md @@ -0,0 +1,5 @@ +# My personal layout for the BFO-9000 + +It is an approximation of a 96% layout with a left-hand number pad +Other things I changed were swapping around delete, backspace, and capslock +It also uses layer based rgb underglow, and the underglow flashes when capslock is enabled \ No newline at end of file diff --git a/keyboards/keebio/bfo9000/keymaps/abstractkb/rules.mk b/keyboards/keebio/bfo9000/keymaps/abstractkb/rules.mk new file mode 100644 index 00000000000..7ad666d1a38 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/abstractkb/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/bfo9000/keymaps/andylikescandy6x18/config.h b/keyboards/keebio/bfo9000/keymaps/andylikescandy6x18/config.h similarity index 100% rename from keyboards/bfo9000/keymaps/andylikescandy6x18/config.h rename to keyboards/keebio/bfo9000/keymaps/andylikescandy6x18/config.h diff --git a/keyboards/keebio/bfo9000/keymaps/andylikescandy6x18/keymap.c b/keyboards/keebio/bfo9000/keymaps/andylikescandy6x18/keymap.c new file mode 100644 index 00000000000..0aa1e780a74 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/andylikescandy6x18/keymap.c @@ -0,0 +1,82 @@ +#include QMK_KEYBOARD_H + +#include "action_layer.h" + + + +#define _BASE 0 +#define _QWERTY 1 +#define _RAISE 2 +#define _NAVIGATION 3 + +//Switch Layouts +#define SWBASE M(_BASE) +#define SWQWERTY M(_QWERTY) + +// layer access +#define RSESPC LT( 2, KC_SPC) +#define NAVSPC LT( 3, KC_SPC) + +// Key Combos +#define CTRLSFT LCTL(KC_LSFT) +#define CTLALTSFT LALT(LCTL(KC_LSFT)) +#define CTLALTDEL LALT(LCTL(KC_DEL)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_BASE] = LAYOUT( \ + CTLALTSFT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCREEN, KC_PAUSE, KC_CAPS, KC_INSERT, KC_EQL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_END, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_PGUP, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_DEL, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PGDN, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, SFT_T(KC_ENT), KC_P1, KC_P2, KC_P3, KC_UP, KC_BSLASH, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \ + KC_LCTL, CTRLSFT, KC_LGUI, KC_LALT, RSESPC, NAVSPC, KC_LCTL, KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT, NAVSPC, RSESPC, KC_RALT, KC_RGUI, KC_APPLICATION, KC_RCTL \ +), +[_QWERTY] = LAYOUT( \ + CTLALTSFT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCREEN, KC_PAUSE, KC_CAPS, KC_INSERT, KC_EQL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_END, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PGDN, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, SFT_T(KC_ENT), KC_P1, KC_P2, KC_P3, KC_UP, KC_BSLASH, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \ + KC_LCTL, CTRLSFT, KC_LGUI, KC_LALT, RSESPC, NAVSPC, KC_LCTL, KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT, NAVSPC, RSESPC, KC_RALT, KC_RGUI, KC_APPLICATION, KC_RCTL \ +), +[_RAISE] = LAYOUT( \ + CTLALTDEL, SWBASE, SWQWERTY, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, \ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, LCTL(KC_PGUP), KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, LCTL(KC_PGDN), KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, LSFT(KC_BSLASH), XXXXXXX, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), +[_NAVIGATION] = LAYOUT( \ + CTLALTDEL, SWBASE, SWQWERTY, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, LCTL(KC_PGUP), XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, \ + KC_DEL, _______, XXXXXXX, KC_LSFT, KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, LCTL(KC_PGDN), XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, LSFT(KC_BSLASH), XXXXXXX, XXXXXXX, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _BASE: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_BASE); + } + break; + case _QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/keebio/bfo9000/keymaps/default/config.h b/keyboards/keebio/bfo9000/keymaps/default/config.h new file mode 100644 index 00000000000..a9ae6791103 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/default/config.h @@ -0,0 +1,27 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C + +/* Select hand configuration */ +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/keebio/bfo9000/keymaps/default/keymap.c b/keyboards/keebio/bfo9000/keymaps/default/keymap.c new file mode 100644 index 00000000000..956e7b9efa7 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/default/keymap.c @@ -0,0 +1,15 @@ +#include QMK_KEYBOARD_H + +#define _BASE 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_BASE] = LAYOUT( \ + KC_ESC, KC_VOLU, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_HOME, KC_VOLD, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_END, KC_TAB, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_PGUP, KC_CAPS, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, \ + KC_PGDN, KC_UP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, XXXXXXX, \ + KC_LEFT, KC_DOWN, KC_RGHT, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_ENT, KC_BSPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ +) +}; diff --git a/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/config.h b/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/config.h new file mode 100644 index 00000000000..344634063c7 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/config.h @@ -0,0 +1,42 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM 150 +#define TAPPING_TOGGLE 2 + +// #undef RGBLED_NUM +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 12 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 \ No newline at end of file diff --git a/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/keymap.c b/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/keymap.c new file mode 100644 index 00000000000..d15569ee964 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/keymap.c @@ -0,0 +1,381 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum bfo9000_layers { + _COLEMAK, // Colemak (default layer) + _QWERTY, // Qwerty + _COLEMAKGM, // Colemak gaming/vanilla (limited dual-role keys with layer access) + _QWERTYGM, // QWERTY gaming/vanilla (limited dual-role keys with layer access) + _NUMBERS, // Numbers & Symbols + _NUMBERS2, // Numbers & Symbols 2 (identical as _NUMBERS; basically used for tri-layer access to _ADJUST) + _FUNCTION, // Function + _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows) + _NUMPAD, // Numpad + _ADJUST, // Adjust layer (accessed via tri-layer feature) + _ADJUST2 // Second Adjust layer (accessed outside of tri-layer feature) +}; + +enum bfo9000_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY, + COLEMAKGM, + QWERTYGM, + NUMPAD = TG(_NUMPAD), + ADJUST = MO(_ADJUST2), + SPCFN = LT(_FUNCTION, KC_SPC), + BSPCFN = LT(_FUNCTION2, KC_BSPC), + ENTNS = LT(_NUMBERS, KC_ENT), + DELNS = LT(_NUMBERS2, KC_DEL), + CTLESC = CTL_T(KC_ESC), + ALTAPP = ALT_T(KC_APP), + NKROTG = MAGIC_TOGGLE_NKRO +}; + +//Tap Dance Declarations +enum { + ADJ = 0, + LBCB, + RBCB, + EQPL, + PLEQ, + MNUN, + SLAS, + GVTL, + PPLEQ, + PMNUN, + PSLPAS +}; + +void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_on(_ADJUST2); + set_oneshot_layer(_ADJUST2, ONESHOT_START); + } +} +void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_off(_ADJUST2); + clear_oneshot_layer_state(ONESHOT_PRESSED); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { +[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer +[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap +[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap +[EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), // Plus sign on a single-tap, equal sign on a double-tap +[PLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQL), // Equal sign on a single-tap, plus sign on a double-tap +[MNUN] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), // Minus sign on a single-tap, underscore on a double-tap +[SLAS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ASTR), // Slash in a single-tap, asterisk in a double-tap +[GVTL] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), // Grave on a single-tap, tilde on a double-tap +[PPLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PPLS, KC_EQL), // Numpad plus sign on a single-tap, equal sign on a double-tap +[PMNUN] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_UNDS), // Numpad minus sign on a single-tap, underscore on a double-tap +[PSLPAS] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST) // Numpad slash on a single-tap, numpad asterisk on a double-tap +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Colemak + (Default layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) + ,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | | | | | Adjust| | F12 | F6 | F7 | F8 | F9 | F10 | F11 | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | = | 1 | 2 | 3 | 4 | 5 | | | | | Numpad| | | 6 | 7 | 8 | 9 | 0 | - | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Tab | Q | W | F | P | G | | | Home | | Pause | | | J | L | U | Y | ; | \ | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + |Esc/Ctl| A | R | S | T | D | | | PgUp | | ScrLck| | | H | N | E | I | O | ' | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + |SCShift| Z | X | C | V | B |Esc/Ctl|App/Alt| PgDn | | PrtScr| RAlt | RCtl | K | M | , | . | / |SCShift| + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Ins | ` | [ | ] |App/Alt| Spc/Fn| Ent/NS| Bspc | End | | | Enter |Del/NS2|Bsp/Fn2| RGUI | Left | Down | Up | Right | + `-----------------------------------------------------------------------' `-----------------------------------------------------------------------' +*/ +[_COLEMAK] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, _______, _______, KC_HOME, KC_PAUS, _______, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, _______, _______, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, CTLESC, ALTAPP, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, ENTNS, KC_BSPC, KC_END, _______, KC_ENT, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* QWERTY + (Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) + ,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | | | | | Adjust| | F12 | F6 | F7 | F8 | F9 | F10 | F11 | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | = | 1 | 2 | 3 | 4 | 5 | | | | | Numpad| | | 6 | 7 | 8 | 9 | 0 | - | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Tab | Q | W | E | R | T | | | Home | | Pause | | | Y | U | I | O | P | \ | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + |Esc/Ctl| A | S | D | F | G | | | PgUp | | ScrLck| | | H | J | K | L | ; | ' | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + |SCShift| Z | X | C | V | B |Esc/Ctl|App/Alt| PgDn | | PrtScr| RAlt | RCtl | N | M | , | . | / |SCShift| + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Ins | ` | [ | ] |App/Alt| Spc/Fn| Ent/NS| Bspc | End | | | Enter |Del/NS2|Bsp/Fn2| RGUI | Left | Down | Up | Right | + `-----------------------------------------------------------------------' `-----------------------------------------------------------------------' +*/ +[_QWERTY] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_HOME, KC_PAUS, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, CTLESC, ALTAPP, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, ENTNS, KC_BSPC, KC_END, _______, KC_ENT, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Numbers/Symbols layer + (Multiple characters: single-tap for first, double-tap for second) + ,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | F12 | F1 | F2 | F3 | F4 | F5 | | | | | | | | F6 | F7 | F8 | F9 | F10 | F12 | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | 6 | 7 | 8 | 9 | 0 | | | | | | | | ^ | & | * | ( | ) | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | 1 | 2 | 3 | 4 | 5 | | | | | | | | ! | @ | # | $ | % | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | . | / * | - _ | + = | | | | | | | | ` ~ | [ { | ] } | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | ( | ) | [ { | ] } | | | | | | | | | | | | | | | | + `-----------------------------------------------------------------------' `-----------------------------------------------------------------------' +*/ +[_NUMBERS] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), _______, _______, _______, _______, _______, _______, TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_NUMBERS2] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), _______, _______, _______, _______, _______, _______, TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Function layer + ,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | F12 | F1 | F2 | F3 | F4 | F5 | | | | | | | | F6 | F7 | F8 | F9 | F10 | F12 | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | Up | | | | | | | | | | | | Up | Ctrl+Y| | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | Ctrl+A| Left | Down | Right | C+A+Tb| | | | | | | | PgUp | Right | Down | Left | Home | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | Ctrl+Z| Ctrl+X| Ctrl+C| Ctrl+V| Bspc | | | | | | | | PgDn | Mute | Vol- | Vol+ | End | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | | | | | | | | | | | | Prev | Play | Next | Stop | + `-----------------------------------------------------------------------' `-----------------------------------------------------------------------' +*/ +[_FUNCTION] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, + _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), _______, _______, _______, _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP +), + +[_FUNCTION2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, + _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), _______, _______, _______, _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP +), + +/* Numpad layer + (Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout) + ,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | NumLk | | | | | | | | | | | Tab | NumLk | KP / | KP * | KP - | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | | | | | | | KP 7 | KP 8 | KP 9 | KP + | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | | | | | | | KP 4 | KP 5 | KP 6 | = | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | KP . |KP/ KP*| KP- _ | KP+ = | | | | | | | | KP 1 | KP 2 | KP 3 | KP Ent| | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | ( | ) | [ { | ] } | | | | | | | | | | | KP 0 | KP . | KP Ent| | | + `-----------------------------------------------------------------------' `-----------------------------------------------------------------------' +*/ +[_NUMPAD] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_NLCK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_TAB, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, + _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, + _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_EQL, _______, + _______, _______, KC_PDOT, TD(PSLPAS), TD(PMNUN), TD(PPLEQ), _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______ +), + +/* Colemak gaming/vanilla + (Limited access to Function or Numbers layers; mainly used for gaming; Ent/NS + Del/NS2 on right side to access Adjust layer) + ,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | | Adjust| | F12 | F6 | F7 | F8 | F9 | F10 | F11 | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | | Numpad| | | 6 | 7 | 8 | 9 | 0 | - | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Tab | Q | W | F | P | G | J | L | Home | | Pause | | | J | L | U | Y | ; | \ | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | LCtl | A | R | S | T | D | H | N | PgUp | | ScrLck| | | H | N | E | I | O | ' | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Shift | Z | X | C | V | B | Esc | LAlt | PgDn | | PrtScr| RAlt | RCtl | K | M | , | . | / | Shift | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Ins | ` | [ | ] | LAlt | Space | Enter | Bspc | End | | | Ent/NS|Del/NS2|Bsp/Fn2| RGUI | Left | Down | Up | Right | + `-----------------------------------------------------------------------' `-----------------------------------------------------------------------' +*/ +[_COLEMAKGM] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_HOME, KC_PAUS, _______, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_LALT, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_END, _______, ENTNS, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* QWERTY gaming/vanilla + (Limited access to Function or Numbers layers; mainly used for gaming; Ent/NS + Del/NS2 on right side to access Adjust layer) + ,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | | Adjust| | F12 | F6 | F7 | F8 | F9 | F10 | F11 | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | | Numpad| | | 6 | 7 | 8 | 9 | 0 | - | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Tab | Q | W | E | T | Y | U | I | Home | | Pause | | | Y | U | I | O | P | \ | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | LCtl | A | S | D | F | G | H | J | PgUp | | ScrLck| | | H | J | K | L | ; | ' | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Shift | Z | X | C | V | B | Esc | LAlt | PgDn | | PrtScr| RAlt | RCtl | N | M | , | . | / | Shift | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Ins | ` | [ | ] | LAlt | Space | Enter | Bspc | End | | | Ent/NS|Del/NS2|Bsp/Fn2| RGUI | Left | Down | Up | Right | + `-----------------------------------------------------------------------' `-----------------------------------------------------------------------' +*/ +[_QWERTYGM] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_HOME, KC_PAUS, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_LALT, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_END, _______, ENTNS, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Adjust layer + (Enter/Number + Delete/Number2 under non-gaming/vanilla layers or press & hold Adjust key on function row; Numpad is a toggle) + ,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | |Colemak| Qwerty| |ColmkGM| QWGM | | | | | | | | Numpad| | | | | RESET | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | | | | | | | | | | | | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | | | | | | | | | | | NKROTG| | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | | | | | | | | | | | | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | | | | | | | | | | | | | | | | + `-----------------------------------------------------------------------' `-----------------------------------------------------------------------' +*/ +[_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, COLEMAK, QWERTY, _______, COLEMAKGM, QWERTYGM, _______, _______, _______, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_ADJUST2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, COLEMAK, QWERTY, _______, COLEMAKGM, QWERTYGM, _______, _______, _______, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + default_layer_set(1UL << _COLEMAK); +// persistent_default_layer_set(1UL << _COLEMAK); + layer_off ( _QWERTY); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); + layer_off ( _COLEMAKGM); + layer_off ( _QWERTYGM); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + default_layer_set(1UL << _QWERTY); +// persistent_default_layer_set(1UL << _QWERTY); + layer_off ( _COLEMAK); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); + layer_off ( _COLEMAKGM); + layer_off ( _QWERTYGM); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; + case COLEMAKGM: + if (record->event.pressed) { + default_layer_set(1UL << _COLEMAKGM); + layer_off ( _QWERTY); + layer_off ( _COLEMAK); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); + layer_off ( _QWERTYGM); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; + case QWERTYGM: + if (record->event.pressed) { + default_layer_set(1UL << _QWERTYGM); + layer_off ( _QWERTY); + layer_off ( _COLEMAK); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); + layer_off ( _COLEMAKGM); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/readme.md b/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/readme.md new file mode 100644 index 00000000000..0a3bdc45fd1 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/readme.md @@ -0,0 +1 @@ +## I've changed my folder name to match my GitHub username. Please see https://github.com/qmk/qmk_firmware/tree/master/keyboards/keebio/bfo9000/keymaps/tuesdayjohn for my current keymap files. diff --git a/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/rules.mk b/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/rules.mk new file mode 100644 index 00000000000..cf63c44f4f0 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/insertsnideremarks/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Enable Tap Dancing function diff --git a/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/config.h b/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/config.h new file mode 100644 index 00000000000..344634063c7 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/config.h @@ -0,0 +1,42 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM 150 +#define TAPPING_TOGGLE 2 + +// #undef RGBLED_NUM +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 12 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 \ No newline at end of file diff --git a/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/keymap.c b/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/keymap.c new file mode 100644 index 00000000000..e42f6797e70 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/keymap.c @@ -0,0 +1,341 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum bfo9000_layers { + _COLEMAK, // Colemak (default layer) + _QWERTY, // Qwerty + _GAMING, // Gaming/vanilla toggle layer (limited dual-role keys and layer access) + _NUMBERS, // Numbers & Symbols + _NUMBERS2, // Numbers & Symbols 2 (identical as _NUMBERS; basically used for tri-layer access to _ADJUST) + _FUNCTION, // Function + _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows) + _NUMPAD, // Numpad + _ADJUST, // Adjust layer (accessed via tri-layer feature) + _ADJUST2 // Second Adjust layer (accessed outside of tri-layer feature) +}; + +enum bfo9000_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY, + GAMING +}; + +//Tap Dance Declarations +enum { + ADJ = 0, + LBCB, + RBCB, + EQPL, + PLEQ, + MNUN, + SLAS, + GVTL, + PPEQ, + PMUN, + PSPA +}; + +void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_on(_ADJUST2); + set_oneshot_layer(_ADJUST2, ONESHOT_START); + } +} +void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_off(_ADJUST2); + clear_oneshot_layer_state(ONESHOT_PRESSED); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { +[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer +[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap +[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap +[EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), // Plus sign on a single-tap, equal sign on a double-tap +[PLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQL), // Equal sign on a single-tap, plus sign on a double-tap +[MNUN] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), // Minus sign on a single-tap, underscore on a double-tap +[SLAS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ASTR), // Slash in a single-tap, asterisk in a double-tap +[GVTL] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), // Grave on a single-tap, tilde on a double-tap +[PPEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PPLS, KC_EQL), // Numpad plus sign on a single-tap, equal sign on a double-tap +[PMUN] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_UNDS), // Numpad minus sign on a single-tap, underscore on a double-tap +[PSPA] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST) // Numpad slash on a single-tap, numpad asterisk on a double-tap +}; + +//Aliases for longer keycodes +#define NUMPAD TG(_NUMPAD) +#define ADJUST MO(_ADJUST2) +#define SPCFN LT(_FUNCTION, KC_SPC) +#define BSPCFN LT(_FUNCTION2, KC_BSPC) +#define ENTNS LT(_NUMBERS, KC_ENT) +#define DELNS LT(_NUMBERS2, KC_DEL) +#define CTLESC CTL_T(KC_ESC) +#define ALTAPP ALT_T(KC_APP) +#define CTL_A LCTL(KC_A) +#define CTL_C LCTL(KC_C) +#define CTL_V LCTL(KC_V) +#define CTL_X LCTL(KC_X) +#define CTL_Z LCTL(KC_Z) +#define CTL_Y LCTL(KC_Y) +#define CA_TAB LCA(KC_TAB) +#define HYPER ALL_T(KC_NO) +#define TD_ADJ TD(ADJ) +#define TD_LBCB TD(LBCB) +#define TD_RBCB TD(RBCB) +#define TD_EQPL TD(EQPL) +#define TD_PLEQ TD(PLEQ) +#define TD_MNUN TD(MNUN) +#define TD_SLAS TD(SLAS) +#define TD_GVTL TD(GVTL) +#define TD_PPEQ TD(PPEQ) +#define TD_PMUN TD(PMUN) +#define TD_PSPA TD(PSPA) +#define NKROTG MAGIC_TOGGLE_NKRO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +Colemak +(Default layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) + ,--------------------------------------------------------------------------------. ,--------------------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | | | | | Adjust | | F12 | F6 | F7 | F8 | F9 | F10 | F11 | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | = | 1 | 2 | 3 | 4 | 5 | | | | | Numpad | | | 6 | 7 | 8 | 9 | 0 | - | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Tab | Q | W | F | P | G | | | Home | | Pause | | | J | L | U | Y | ; | \ | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Esc/Ctl| A | R | S | T | D | | | PgUp | | ScrLck | | | H | N | E | I | O | ' | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | SCShift| Z | X | C | V | B | Esc/Ctl| App/Alt| PgDn | | PrtScr | RAlt | RCtl | K | M | , | . | / | SCShift| + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ins | ` | [ | ] | App/Alt| Spc/Fn | Ent/NS | Bspc | End | | | Enter | Del/NS2| Bsp/Fn2| RGUI | Left | Down | Up | Right | + `--------------------------------------------------------------------------------' `--------------------------------------------------------------------------------' +*/ +[_COLEMAK] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, _______, _______, KC_HOME, KC_PAUS, _______, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, _______, _______, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, CTLESC, ALTAPP, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, ENTNS, KC_BSPC, KC_END, _______, KC_ENT, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* +QWERTY +(Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) + ,--------------------------------------------------------------------------------. ,--------------------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | | | | | Adjust | | F12 | F6 | F7 | F8 | F9 | F10 | F11 | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | = | 1 | 2 | 3 | 4 | 5 | | | | | Numpad | | | 6 | 7 | 8 | 9 | 0 | - | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Tab | Q | W | E | R | T | | | Home | | Pause | | | Y | U | I | O | P | \ | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Esc/Ctl| A | S | D | F | G | | | PgUp | | ScrLck | | | H | J | K | L | ; | ' | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | SCShift| Z | X | C | V | B | Esc/Ctl| App/Alt| PgDn | | PrtScr | RAlt | RCtl | N | M | , | . | / | SCShift| + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ins | ` | [ | ] | App/Alt| Spc/Fn | Ent/NS | Bspc | End | | | Enter | Del/NS2| Bsp/Fn2| RGUI | Left | Down | Up | Right | + `--------------------------------------------------------------------------------' `--------------------------------------------------------------------------------' +*/ +[_QWERTY] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_HOME, KC_PAUS, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, CTLESC, ALTAPP, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, ENTNS, KC_BSPC, KC_END, _______, KC_ENT, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* +Numbers/Symbols layer +(Multiple characters: single-tap for first, double-tap for second) + ,--------------------------------------------------------------------------------. ,--------------------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | F12 | F1 | F2 | F3 | F4 | F5 | | | | | | | | F6 | F7 | F8 | F9 | F10 | F12 | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | 6 | 7 | 8 | 9 | 0 | | | | | | | | ^ | & | * | ( | ) | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | 1 | 2 | 3 | 4 | 5 | | | | | | | | ! | @ | # | $ | % | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | . | / * | - _ | + = | | | | | | | | ` ~ | [ { | ] } | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | ( | ) | [ { | ] } | | | | | | | | | | | | | | | | + `--------------------------------------------------------------------------------' `--------------------------------------------------------------------------------' +*/ +[_NUMBERS] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD_SLAS, TD_MNUN, TD_PLEQ, _______, _______, _______, _______, _______, _______, TD_GVTL, TD_LBCB, TD_RBCB, _______, _______, _______, + KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_NUMBERS2] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD_SLAS, TD_MNUN, TD_PLEQ, _______, _______, _______, _______, _______, _______, TD_GVTL, TD_LBCB, TD_RBCB, _______, _______, _______, + KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* +Function layer + ,--------------------------------------------------------------------------------. ,--------------------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | F12 | F1 | F2 | F3 | F4 | F5 | | | | | | | | F6 | F7 | F8 | F9 | F10 | F12 | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | Up | | | | | | | | | | | | Up | Ctrl+Y | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | Ctrl+A | Left | Down | Right | C+A+Tb | | | | | | | | PgUp | Right | Down | Left | Home | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | Ctrl+Z | Ctrl+X | Ctrl+C | Ctrl+V | Bspc | | | | | | | | PgDn | Mute | Vol- | Vol+ | End | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | | | | | | | | | | | | | Prev | Play | Next | Stop | + `--------------------------------------------------------------------------------' `--------------------------------------------------------------------------------' +*/ +[_FUNCTION] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, CTL_Y, _______, _______, + _______, CTL_A, KC_LEFT, KC_DOWN, KC_RGHT, CA_TAB, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, CTL_Z, CTL_X, CTL_C, CTL_V, KC_BSPC, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP +), + +[_FUNCTION2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, CTL_Y, _______, _______, + _______, CTL_A, KC_LEFT, KC_DOWN, KC_RGHT, CA_TAB, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, CTL_Z, CTL_X, CTL_C, CTL_V, KC_BSPC, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP +), + +/* +Numpad layer +(Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout) + ,--------------------------------------------------------------------------------. ,--------------------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | NumLk | | | | | | | | | | | Tab | NumLk | KP / | KP * | KP - | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | | | | | | | KP 7 | KP 8 | KP 9 | KP + | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | | | | | | | KP 4 | KP 5 | KP 6 | = | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | KP . | KP/ KP*| KP- _ | KP+ = | | | | | | | | KP 1 | KP 2 | KP 3 | KP Ent | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | ( | ) | [ { | ] } | | | | | | | | | | | KP 0 | KP . | KP Ent | | | + `--------------------------------------------------------------------------------' `--------------------------------------------------------------------------------' +*/ +[_NUMPAD] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_NLCK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_TAB, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, + _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, + _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_EQL, _______, + _______, _______, KC_PDOT, TD_PSPA, TD_PMUN, TD_PPEQ, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, + KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______ +), + +/* +Gaming +(Toggle gaming layer with limited dual-role keys and layer access; NKRO turned on by default; Ent/NS + Delete/Numbers2 to access Adjust layer) + ,--------------------------------------------------------------------------------. ,--------------------------------------------------------------------------------. + | | | | | | | F6 | F7 | F8 | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | | | | 6 | 7 | 8 | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | | | | J | L | | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | LCtl | | | | | | H | N | | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Shift | | | | | | Esc | LAlt | | | | RAlt | RCtl | | | | | | Shift | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | | LAlt | Space | Enter | Bspc | | | | Ent/NS | Del/NS2| Bsp/Fn2| RGUI | | | | | + `--------------------------------------------------------------------------------' `--------------------------------------------------------------------------------' +*/ +[_GAMING] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_6, KC_7, KC_8, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_J, KC_L, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LCTL, _______, _______, _______, _______, _______, KC_H, KC_N, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, KC_ESC, KC_LALT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, + _______, _______, _______, _______, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, _______, _______, ENTNS, _______, _______, _______, _______, _______, _______, _______ +), + +/* +Adjust layer +(Press and hold Adjust key on the function row or Enter/Number + Delete/Number2 to access; Numpad and NKRO are on toggle) + ,--------------------------------------------------------------------------------. ,--------------------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | Colemak| Qwerty | | Gaming | | | | | | | | | Numpad | | | | | RESET | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | | | | | | | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | | | | | | | | | | | | NKROTG | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | | | | | | | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | | | | | | | | | | | | | | | | | + `--------------------------------------------------------------------------------' `--------------------------------------------------------------------------------' +*/ +[_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, COLEMAK, QWERTY, _______, GAMING, _______, _______, _______, _______, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_ADJUST2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, COLEMAK, QWERTY, _______, GAMING, _______, _______, _______, _______, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { +// persistent_default_layer_set(1UL << _COLEMAK); + default_layer_set(1UL << _COLEMAK); + layer_move (_COLEMAK); + keymap_config.nkro = 0; + } + return false; + break; + case QWERTY: + if (record->event.pressed) { +// persistent_default_layer_set(1UL << _QWERTY); + default_layer_set(1UL << _QWERTY); + layer_move (_QWERTY); + keymap_config.nkro = 0; + } + return false; + break; + case GAMING: + if (record->event.pressed) { + layer_invert (_GAMING); + layer_off (_NUMPAD); + keymap_config.nkro = 1; + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/rules.mk b/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/rules.mk new file mode 100644 index 00000000000..cf63c44f4f0 --- /dev/null +++ b/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Enable Tap Dancing function diff --git a/keyboards/keebio/bfo9000/readme.md b/keyboards/keebio/bfo9000/readme.md new file mode 100644 index 00000000000..059f2800a23 --- /dev/null +++ b/keyboards/keebio/bfo9000/readme.md @@ -0,0 +1,18 @@ +BFO-9000 +======== + +A split full-size ortholinear keyboard made and sold by Keebio. Each half is a 6x9 arrangement, with breakable pieces to allow the number of rows to be customized between 4 to 6, and the number of columns to be between 7 to 9. [More info at Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/bfo9000:default + +Example of flashing this keyboard: + + make keebio/bfo9000:default:avrdude + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/keebio/bfo9000/rules.mk b/keyboards/keebio/bfo9000/rules.mk new file mode 100644 index 00000000000..931a0f5e957 --- /dev/null +++ b/keyboards/keebio/bfo9000/rules.mk @@ -0,0 +1,64 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes diff --git a/keyboards/keebio/chocopad/README.md b/keyboards/keebio/chocopad/README.md new file mode 100644 index 00000000000..3cdb3b3b9c8 --- /dev/null +++ b/keyboards/keebio/chocopad/README.md @@ -0,0 +1,14 @@ +Chocopad +======== + +A 4x4 macropad keyboard using Kailh PG1350 Lower Profile Choc switches. + +Keyboard Maintainer: Keebio +Hardware Supported: Chocopad PCB, Arduino Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/chocopad:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/chocopad/chocopad.c b/keyboards/keebio/chocopad/chocopad.c similarity index 100% rename from keyboards/chocopad/chocopad.c rename to keyboards/keebio/chocopad/chocopad.c diff --git a/keyboards/keebio/chocopad/chocopad.h b/keyboards/keebio/chocopad/chocopad.h new file mode 100644 index 00000000000..d37aefc57e1 --- /dev/null +++ b/keyboards/keebio/chocopad/chocopad.h @@ -0,0 +1,29 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_4x4( \ + A1, A2, A3, A4, \ + B1, B2, B3, B4, \ + C1, C2, C3, C4, \ + D1, D2, D3, D4 \ +) { \ + { A1, A2, A3, A4 }, \ + { B1, B2, B3, B4 }, \ + { C1, C2, C3, C4 }, \ + { D1, D2, D3, D4 } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + A1, A2, A3, A4, \ + B1, B2, B3, B4, \ + C1, C2, C3, C4, \ + D1, D2, D3, D4 \ +) \ + LAYOUT_ortho_4x4( \ + KC_##A1, KC_##A2, KC_##A3, KC_##A4, \ + KC_##B1, KC_##B2, KC_##B3, KC_##B4, \ + KC_##C1, KC_##C2, KC_##C3, KC_##C4, \ + KC_##D1, KC_##D2, KC_##D3, KC_##D4 \ + ) diff --git a/keyboards/keebio/chocopad/config.h b/keyboards/keebio/chocopad/config.h new file mode 100644 index 00000000000..d8831556cf1 --- /dev/null +++ b/keyboards/keebio/chocopad/config.h @@ -0,0 +1,47 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1144 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Chocopad +#define DESCRIPTION 4x4 macropad using Kailh Choc low-profile switches + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D7, E6, B3, B2 } +#define MATRIX_COL_PINS { D2, D4, F6, F5 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 6 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif +#define RGB_DI_PIN D3 +#define RGBLED_NUM 4 + +#endif diff --git a/keyboards/chocopad/info.json b/keyboards/keebio/chocopad/info.json similarity index 100% rename from keyboards/chocopad/info.json rename to keyboards/keebio/chocopad/info.json diff --git a/keyboards/keebio/chocopad/keymaps/default/config.h b/keyboards/keebio/chocopad/keymaps/default/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/keebio/chocopad/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/keebio/chocopad/keymaps/default/keymap.c b/keyboards/keebio/chocopad/keymaps/default/keymap.c new file mode 100644 index 00000000000..7b4b752c9ca --- /dev/null +++ b/keyboards/keebio/chocopad/keymaps/default/keymap.c @@ -0,0 +1,28 @@ +#include QMK_KEYBOARD_H + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_ortho_4x4( + KC_PGUP, KC_HOME, KC_UP, KC_END , \ + KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, \ + MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV, \ + MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT \ + ), + [_FN1] = LAYOUT_ortho_4x4( + KC_ESC, KC_P7, KC_P8, KC_P9, \ + KC_TAB, KC_P4, KC_P5, KC_P6, \ + KC_ENT, KC_P1, KC_P2, KC_P3, \ + _______, KC_P0, KC_P0, KC_DOT \ + ), + [_FN2] = LAYOUT_ortho_4x4( + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \ + _______, _______, _______, RESET, \ + BL_STEP, _______, _______, _______ \ + ) + +}; diff --git a/keyboards/keebio/chocopad/keymaps/default/rules.mk b/keyboards/keebio/chocopad/keymaps/default/rules.mk new file mode 100644 index 00000000000..a81250cdf6d --- /dev/null +++ b/keyboards/keebio/chocopad/keymaps/default/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/chocopad/keymaps/default/config.h b/keyboards/keebio/chocopad/keymaps/khord/config.h similarity index 100% rename from keyboards/chocopad/keymaps/default/config.h rename to keyboards/keebio/chocopad/keymaps/khord/config.h diff --git a/keyboards/keebio/chocopad/keymaps/khord/keymap.c b/keyboards/keebio/chocopad/keymaps/khord/keymap.c new file mode 100644 index 00000000000..2c871c4e820 --- /dev/null +++ b/keyboards/keebio/chocopad/keymaps/khord/keymap.c @@ -0,0 +1,104 @@ +#include "chocopad.h" + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +// Fillers to make layering more clear +#define KC_ KC_TRNS +#define KC_XX KC_NO + +#define KC_L1 LT(1, KC_P0) +#define KC_L2 LT(2, KC_SPC) +#define KC_RST RESET +#define KC_BSTP BL_STEP +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD +#define KC_MAC1 ADMIN +#define KC_MAC2 SMSPC +#define KC_M192 M192 +#define KC_M255 M255 + +enum custom_keycodes { + NUMPAD = SAFE_RANGE, + ADMIN, + SMSPC, + M192, + M255 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_kc( + //,----+----+----+----. + P7 , P8 , P9 ,BSPC, + //|----+----+----+----| + P4 , P5 , P6 ,TAB , + //|----+----+----+----| + P1 , P2 , P3 ,PENT, + //|----+----+----+----| + L1 , L2 ,PDOT,PSLS + //`----+----+----+----' + ), + + [_FN1] = LAYOUT_kc( + //,----+----+----+----. + ESC ,MAC1,MAC2,DEL , + //|----+----+----+----| + LEFT,DOWN, UP ,RGHT, + //|----+----+----+----| + M192,M255, XX , XX , + //|----+----+----+----| + , XX , , XX + //`----+----+----+----' + ), + + [_FN2] = LAYOUT_kc( + //,----+----+----+----. + RST , XX , XX , XX , + //|----+----+----+----| + RTOG,RHUI,RSAI,RVAI, + //|----+----+----+----| + RMOD,RHUD,RSAD,RVAD, + //|----+----+----+----| + BSTP, , XX , XX + //`----+----+----+----' + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ADMIN: + if (record->event.pressed) { + SEND_STRING("Administrator"); + } + return false; + break; + case SMSPC: + if (record->event.pressed) { + SEND_STRING("Simspace1!"); + } + return false; + break; + case M192: + if (record->event.pressed) { + SEND_STRING("192.168."); + } + return false; + break; + case M255: + if (record->event.pressed) { + SEND_STRING("255"); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/keebio/chocopad/keymaps/khord/rules.mk b/keyboards/keebio/chocopad/keymaps/khord/rules.mk new file mode 100644 index 00000000000..a81250cdf6d --- /dev/null +++ b/keyboards/keebio/chocopad/keymaps/khord/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/chocopad/rules.mk b/keyboards/keebio/chocopad/rules.mk similarity index 100% rename from keyboards/chocopad/rules.mk rename to keyboards/keebio/chocopad/rules.mk diff --git a/keyboards/keebio/dilly/README.md b/keyboards/keebio/dilly/README.md new file mode 100644 index 00000000000..74139eaeaee --- /dev/null +++ b/keyboards/keebio/dilly/README.md @@ -0,0 +1,14 @@ +Dilly +===== + +A 3x10 ortholinear keyboard using Kailh PG1350 Lower Profile Choc switches. + +Keyboard Maintainer: Keebio +Hardware Supported: Dilly PCB, Arduino Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/dilly:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/keebio/dilly/config.h b/keyboards/keebio/dilly/config.h new file mode 100644 index 00000000000..e4d17df474e --- /dev/null +++ b/keyboards/keebio/dilly/config.h @@ -0,0 +1,51 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x113a +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Dilly +#define DESCRIPTION 30 percent ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 5 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D7, E6, B4, B1, B3, B2 } +#define MATRIX_COL_PINS { D2, D4, C6, F6, F5 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 10 + +#endif diff --git a/keyboards/dilly/dilly.c b/keyboards/keebio/dilly/dilly.c similarity index 100% rename from keyboards/dilly/dilly.c rename to keyboards/keebio/dilly/dilly.c diff --git a/keyboards/dilly/dilly.h b/keyboards/keebio/dilly/dilly.h similarity index 100% rename from keyboards/dilly/dilly.h rename to keyboards/keebio/dilly/dilly.h diff --git a/keyboards/dilly/info.json b/keyboards/keebio/dilly/info.json similarity index 100% rename from keyboards/dilly/info.json rename to keyboards/keebio/dilly/info.json diff --git a/keyboards/keebio/dilly/keymaps/bakingpy/config.h b/keyboards/keebio/dilly/keymaps/bakingpy/config.h new file mode 100644 index 00000000000..d141283ea4a --- /dev/null +++ b/keyboards/keebio/dilly/keymaps/bakingpy/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define TAPPING_TERM 150 diff --git a/keyboards/keebio/dilly/keymaps/bakingpy/keymap.c b/keyboards/keebio/dilly/keymaps/bakingpy/keymap.c new file mode 100644 index 00000000000..7b52d5ff74b --- /dev/null +++ b/keyboards/keebio/dilly/keymaps/bakingpy/keymap.c @@ -0,0 +1,106 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 +#define _FN3 3 +#define _FN4 4 +#define _FN5 5 + +#define KC_ KC_TRNS + +// Tap-Hold keys +#define KC_ASFT MT(MOD_LSFT, KC_A) +#define KC_F_L3 LT(_FN3, KC_F) +#define KC_ZCTL MT(MOD_LCTL, KC_Z) +#define KC_XALT MT(MOD_LALT, KC_X) +#define KC_CGUI MT(MOD_LGUI, KC_C) +#define KC_V_L4 LT(_FN4, KC_V) +#define KC_SPL2 LT(_FN2, KC_SPC) +#define KC_B_L1 LT(_FN1, KC_B) +#define KC_N_L5 LT(_FN5, KC_N) +#define KC_MALT MT(MOD_RALT, KC_M) +#define KC_BSCT MT(MOD_RCTL, KC_BSPC) +#define KC_ENTS MT(MOD_RSFT, KC_ENT) +#define KC_ESCS MT(MOD_RSFT, KC_ESC) +#define KC_SCNS MT(MOD_RSFT, KC_SCLN) + +#define KC_GUIC LGUI(KC_C) + +#define KC_RST RESET +#define KC_BL_S BL_STEP +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + Q , W , E , R , T , Y , U , I , O , P , + //|----+----+----+----+----+----+----+----+----+----| + ASFT, S , D ,F_L3, G , H , J , K , L ,ESCS, + //|----+----+----+----+----+----+----+----+----+----| + ZCTL,XALT,CGUI,V_L4,SPL2,B_L1,N_L5,MALT,BSCT,ENTS + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN1] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN, + //|----+----+----+----+----+----+----+----+----+----| + F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , + //|----+----+----+----+----+----+----+----+----+----| + , , , ,BSPC, , , , , + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN2] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , + //|----+----+----+----+----+----+----+----+----+----| + F11 ,F12 , , , ,LEFT,DOWN, UP ,RGHT,GRV , + //|----+----+----+----+----+----+----+----+----+----| + , , , , ,DEL , , , , + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN3] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + , , , , ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----+----+----+----+----| + TAB , , , , ,COMM,DOT ,SLSH,SCLN,QUOT, + //|----+----+----+----+----+----+----+----+----+----| + , , , ,BSPC, ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN4] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + , , , , ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----+----+----+----+----| + TAB , , , , , LT , GT ,QUES,COLN,DQUO, + //|----+----+----+----+----+----+----+----+----+----| + , ,GUIC, ,BSPC, ,HOME,PGDN,PGUP,END + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN5] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + RTOG,RMOD, ,RST ,RHUI,RSAI,RVAI, , , , + //|----+----+----+----+----+----+----+----+----+----| + , ,DBUG, ,RHUD,RSAD,RVAD, , , , + //|----+----+----+----+----+----+----+----+----+----| + BL_S, ,GUIC, , , , , , , + //`----+----+----+----+----+----+----+----+----+----' + ) + +}; diff --git a/keyboards/dilly/keymaps/delmo/rules.mk b/keyboards/keebio/dilly/keymaps/bakingpy/rules.mk similarity index 100% rename from keyboards/dilly/keymaps/delmo/rules.mk rename to keyboards/keebio/dilly/keymaps/bakingpy/rules.mk diff --git a/keyboards/keebio/dilly/keymaps/default/config.h b/keyboards/keebio/dilly/keymaps/default/config.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/keyboards/keebio/dilly/keymaps/default/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/keebio/dilly/keymaps/default/keymap.c b/keyboards/keebio/dilly/keymaps/default/keymap.c new file mode 100644 index 00000000000..dc92afbd0da --- /dev/null +++ b/keyboards/keebio/dilly/keymaps/default/keymap.c @@ -0,0 +1,67 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 +#define _FN3 3 +#define _FN4 4 +#define _FN5 5 + +// Tap-Hold keys +#define KC_ASFT MT(MOD_LSFT, KC_A) +#define KC_F_L3 LT(_FN3, KC_F) +#define KC_ZCTL MT(MOD_LCTL, KC_Z) +#define KC_XALT MT(MOD_LALT, KC_X) +#define KC_CGUI MT(MOD_LGUI, KC_C) +#define KC_V_L4 LT(_FN4, KC_V) +#define KC_SPL2 LT(_FN2, KC_SPC) +#define KC_B_L1 LT(_FN1, KC_B) +#define KC_N_L5 LT(_FN5, KC_N) +#define KC_MALT MT(MOD_RALT, KC_M) +#define KC_BSCT MT(MOD_RCTL, KC_BSPC) +#define KC_ENTS MT(MOD_RSFT, KC_ENT) +#define KC_ESCS MT(MOD_RSFT, KC_ESC) + +#define KC_GUIC LGUI(KC_C) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_ortho_3x10( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_ASFT, KC_S, KC_D, KC_F_L3, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESCS, + KC_ZCTL, KC_XALT, KC_CGUI, KC_V_L4, KC_SPL2, KC_B_L1, KC_N_L5, KC_MALT, KC_BSCT, KC_ENTS + ), + + [_FN1] = LAYOUT_ortho_3x10( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______ + ), + + [_FN2] = LAYOUT_ortho_3x10( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, KC_GRV, + _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______ + ), + + [_FN3] = LAYOUT_ortho_3x10( + _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TAB, _______, _______, _______, _______, KC_COMM, KC_DOT, KC_SLSH, KC_SCLN, KC_QUOT, + _______, _______, _______, _______, KC_BSPC, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + [_FN4] = LAYOUT_ortho_3x10( + _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_TAB, _______, _______, _______, _______, KC_LT, KC_GT, KC_QUES, KC_COLN, KC_DQUO, + _______, _______, KC_GUIC, _______, KC_BSPC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + ), + + [_FN5] = LAYOUT_ortho_3x10( + RGB_TOG, RGB_MOD, _______, RESET, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, + _______, _______, DEBUG, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, + BL_STEP, _______, KC_GUIC, _______, _______, _______, _______, _______, _______, _______ + ) + +}; diff --git a/keyboards/ut47/keymaps/rgb/rules.mk b/keyboards/keebio/dilly/keymaps/default/rules.mk similarity index 100% rename from keyboards/ut47/keymaps/rgb/rules.mk rename to keyboards/keebio/dilly/keymaps/default/rules.mk diff --git a/keyboards/dilly/keymaps/delmo/config.h b/keyboards/keebio/dilly/keymaps/delmo/config.h similarity index 100% rename from keyboards/dilly/keymaps/delmo/config.h rename to keyboards/keebio/dilly/keymaps/delmo/config.h diff --git a/keyboards/keebio/dilly/keymaps/delmo/keymap.c b/keyboards/keebio/dilly/keymaps/delmo/keymap.c new file mode 100644 index 00000000000..9d6c900ff41 --- /dev/null +++ b/keyboards/keebio/dilly/keymaps/delmo/keymap.c @@ -0,0 +1,105 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 +#define _FN3 3 +#define _FN4 4 +#define _FN5 5 + +#define KC_ KC_TRNS + +// Tap-Hold keys +//#define KC_ASFT MT(MOD_LSFT, KC_A) +#define KC_F_L3 LT(_FN3, KC_F) +#define KC_ZCTL MT(MOD_LCTL, KC_Z) +#define KC_XALT MT(MOD_LALT, KC_X) +//#define KC_CGUI MT(MOD_LGUI, KC_C) +#define KC_V_L4 LT(_FN4, KC_V) +#define KC_SPL2 LT(_FN2, KC_SPC) +#define KC_B_L1 LT(_FN1, KC_B) +#define KC_N_L5 LT(_FN5, KC_N) +//#define KC_MALT MT(MOD_RALT, KC_M) +//#define KC_BSCT MT(MOD_RCTL, KC_BSPC) +#define KC_ENTS MT(MOD_RSFT, KC_ENT) +#define KC_BSCS MT(MOD_RSFT, KC_BSPC) + +#define KC_GUIC LGUI(KC_C) + +#define KC_RST RESET +#define KC_BL_S BL_STEP +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + Q , W , E , R , T , Y , U , I , O , P , + //|----+----+----+----+----+----+----+----+----+----| + A , S , D ,F_L3, G , H , J , K , L ,BSCS, + //|----+----+----+----+----+----+----+----+----+----| + ZCTL,XALT,C ,V_L4,B_L1,SPL2,N_L5,M ,DOT ,ENTS + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN1] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , + //|----+----+----+----+----+----+----+----+----+----| + F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , + //|----+----+----+----+----+----+----+----+----+----| + , , , , ,BSPC, , , ,CAPS + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN2] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN, + //|----+----+----+----+----+----+----+----+----+----| + F11 ,F12 , , , , , , , ,GRV , + //|----+----+----+----+----+----+----+----+----+----| + , , , ,DEL , , , , , + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN3] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + ESC , , , , ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----+----+----+----+----| + TAB , , , , ,COMM,DOT ,SLSH,SCLN,QUOT, + //|----+----+----+----+----+----+----+----+----+----| + , , , ,BSPC, ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN4] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + , , , , ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----+----+----+----+----| + TAB , , , , , LT , GT ,QUES,COLN,DQUO, + //|----+----+----+----+----+----+----+----+----+----| + , ,GUIC, ,BSPC, ,HOME,PGDN,PGUP,END + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN5] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + RTOG,RMOD, ,RST ,RHUI,RSAI,RVAI, , , , + //|----+----+----+----+----+----+----+----+----+----| + , ,DBUG, ,RHUD,RSAD,RVAD, , , , + //|----+----+----+----+----+----+----+----+----+----| + BL_S, ,GUIC, , , , , , , + //`----+----+----+----+----+----+----+----+----+----' + ) + +}; diff --git a/keyboards/viterbi/keymaps/default/rules.mk b/keyboards/keebio/dilly/keymaps/delmo/rules.mk similarity index 100% rename from keyboards/viterbi/keymaps/default/rules.mk rename to keyboards/keebio/dilly/keymaps/delmo/rules.mk diff --git a/keyboards/dilly/keymaps/pletcher/config.h b/keyboards/keebio/dilly/keymaps/pletcher/config.h similarity index 100% rename from keyboards/dilly/keymaps/pletcher/config.h rename to keyboards/keebio/dilly/keymaps/pletcher/config.h diff --git a/keyboards/keebio/dilly/keymaps/pletcher/keymap.c b/keyboards/keebio/dilly/keymaps/pletcher/keymap.c new file mode 100644 index 00000000000..8bad575d6b5 --- /dev/null +++ b/keyboards/keebio/dilly/keymaps/pletcher/keymap.c @@ -0,0 +1,95 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 +#define _FN3 3 +#define _FN4 4 +#define _FN5 5 + +#define KC_ KC_TRNS + +// Tap-Hold keys +#define KC_F_L3 LT(_FN3, KC_F) +#define KC_ZCTL MT(MOD_LCTL, KC_Z) +#define KC_XALT MT(MOD_LALT, KC_X) +#define KC_CGUI MT(MOD_LGUI, KC_C) +#define KC_V_L4 LT(_FN4, KC_V) +#define KC_SPL2 LT(_FN2, KC_SPC) +#define KC_B_L1 LT(_FN1, KC_B) +#define KC_N_L5 LT(_FN5, KC_N) +#define KC_MALT MT(MOD_RALT, KC_M) +#define KC_BSCT MT(MOD_RCTL, KC_BSPC) +#define KC_ENTS MT(MOD_RSFT, KC_ENT) +#define KC_ESCS MT(MOD_RSFT, KC_ESC) + +#define KC_GUIC LGUI(KC_C) + +#define KC_RST RESET +#define KC_DBUG DEBUG + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + Q , W , E , R , T , Y , U , I , O , P , + //|----+----+----+----+----+----+----+----+----+----| + A , S , D ,F_L3, G , H , J , K , L ,ESCS, + //|----+----+----+----+----+----+----+----+----+----| + ZCTL,XALT,CGUI,V_L4,SPL2,B_L1,N_L5,MALT,BSCT,ENTS + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN1] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , + //|----+----+----+----+----+----+----+----+----+----| + F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , + //|----+----+----+----+----+----+----+----+----+----| + , , , ,BSPC, , , , , + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN2] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN, + //|----+----+----+----+----+----+----+----+----+----| + F11 ,F12 , , , , , , , ,GRV , + //|----+----+----+----+----+----+----+----+----+----| + , , , ,TAB , DEL, , , , + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN3] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + , , , , ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----+----+----+----+----| + TAB , , , , ,COMM,DOT ,SLSH,SCLN,QUOT, + //|----+----+----+----+----+----+----+----+----+----| + , , , ,BSPC, ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN4] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + , , , , ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----+----+----+----+----| + TAB , , , , , LT , GT ,QUES,COLN,DQUO, + //|----+----+----+----+----+----+----+----+----+----| + , ,GUIC, ,BSPC, ,HOME,PGDN,PGUP,END + //`----+----+----+----+----+----+----+----+----+----' + ), + + [_FN5] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----. + , , ,RST , , ,MSTP,VOLD,VOLU,MPLY, + //|----+----+----+----+----+----+----+----+----+----| + , ,DBUG, , , , ,ASDN,ASUP,ASRP, + //|----+----+----+----+----+----+----+----+----+----| + , ,GUIC, , , , , , ,ASTG + //`----+----+----+----+----+----+----+----+----+----' + ) + +}; diff --git a/keyboards/dilly/keymaps/pletcher/rules.mk b/keyboards/keebio/dilly/keymaps/pletcher/rules.mk similarity index 100% rename from keyboards/dilly/keymaps/pletcher/rules.mk rename to keyboards/keebio/dilly/keymaps/pletcher/rules.mk diff --git a/keyboards/dilly/rules.mk b/keyboards/keebio/dilly/rules.mk similarity index 100% rename from keyboards/dilly/rules.mk rename to keyboards/keebio/dilly/rules.mk diff --git a/keyboards/keebio/ergodicity/config.h b/keyboards/keebio/ergodicity/config.h new file mode 100644 index 00000000000..a743816276f --- /dev/null +++ b/keyboards/keebio/ergodicity/config.h @@ -0,0 +1,233 @@ +/* +Copyright 2019 Keebio + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x125F +#define DEVICE_VER 0x0001 +#define MANUFACTURER Keebio +#define PRODUCT Ergodicity +#define DESCRIPTION Low-profile ergo keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, C7, B6, B4 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, D7, D6, D4, D3, D2, D1, D0, B7, B3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 7 + +#define RGB_DI_PIN B2 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 12 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/keebio/ergodicity/ergodicity.c b/keyboards/keebio/ergodicity/ergodicity.c new file mode 100644 index 00000000000..0bbcf611784 --- /dev/null +++ b/keyboards/keebio/ergodicity/ergodicity.c @@ -0,0 +1,51 @@ +/* Copyright 2019 Keebio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "ergodicity.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/keebio/ergodicity/ergodicity.h b/keyboards/keebio/ergodicity/ergodicity.h new file mode 100644 index 00000000000..156ad828a37 --- /dev/null +++ b/keyboards/keebio/ergodicity/ergodicity.h @@ -0,0 +1,41 @@ +/* Copyright 2019 Keebio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + kA1, kA2, kA3, kE3, kA4, kA5, kA6, kA7, kA8, kA9, kA10, kA11, kA12, kA13, kA15, \ + kB1, kB2, kB3, kB4, kB5, kB6, kB7, kB8, kB9, kB10, kB11, kB12, kB13, kB14, kB15, \ + kC1, kC2, kC3, kC4, kC5, kC6, kC7, kC8, kC9, kC10, kC11, kC12, kC13, kC15, \ + kD2, kD3, kD4, kD5, kD6, kD7, kD8, kD9, kD10, kD11, kD12, kD13, kD14, kD15, \ + kE2, kE4, kE6, kE7, kE9, kE11, kE15 \ +) \ +{ \ + { kA1, kA2, kA3, kA4, kA5, kA6, kA7, kA8, kA9, kA10, kA11, kA12, kA13, KC_NO, kA15 }, \ + { kB1, kB2, kB3, kB4, kB5, kB6, kB7, kB8, kB9, kB10, kB11, kB12, kB13, kB14, kB15 }, \ + { kC1, kC2, kC3, kC4, kC5, kC6, kC7, kC8, kC9, kC10, kC11, kC12, kC13, KC_NO, kC15 }, \ + { KC_NO, kD2, kD3, kD4, kD5, kD6, kD7, kD8, kD9, kD10, kD11, kD12, kD13, kD14, kD15 }, \ + { KC_NO, kE2, kE3, kE4, KC_NO, kE6, kE7, KC_NO, kE9, KC_NO, kE11, KC_NO, KC_NO, kE15 } \ +} diff --git a/keyboards/keebio/ergodicity/info.json b/keyboards/keebio/ergodicity/info.json new file mode 100644 index 00000000000..b019da3aaec --- /dev/null +++ b/keyboards/keebio/ergodicity/info.json @@ -0,0 +1,82 @@ +{ + "keyboard_name": "Ergodicity", + "url": "https://keeb.io", + "maintainer": "Keebio", + "width": 19.5, + "height": 5.25, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0.5, "y":0}, + {"label":"`", "x":1.75, "y":0.25}, + {"label":"1", "x":2.75, "y":0.25}, + {"label":"2", "x":3.75, "y":0}, + {"label":"3", "x":4.75, "y":0.25}, + {"label":"4", "x":5.75, "y":0.25}, + {"label":"5", "x":6.75, "y":0.25}, + {"label":"6", "x":7.75, "y":0.25}, + {"label":"7", "x":11, "y":0.25}, + {"label":"8", "x":12, "y":0.25}, + {"label":"9", "x":13, "y":0.25}, + {"label":"0", "x":14, "y":0.25}, + {"label":"-", "x":15, "y":0}, + {"label":"=", "x":16, "y":0.25}, + {"label":"Backspace", "x":17, "y":0.25, "w":2}, + + {"label":"PgUp", "x":0.25, "y":1}, + {"label":"Tab", "x":1.5, "y":1.25, "w":1.5}, + {"label":"Q", "x":3, "y":1.25}, + {"label":"W", "x":4.25, "y":1.25}, + {"label":"E", "x":5.25, "y":1.25}, + {"label":"R", "x":6.25, "y":1.25}, + {"label":"T", "x":7.25, "y":1.25}, + {"label":"Y", "x":10.5, "y":1.25}, + {"label":"U", "x":11.5, "y":1.25}, + {"label":"I", "x":12.5, "y":1.25}, + {"label":"O", "x":13.5, "y":1.25}, + {"label":"P", "x":14.75, "y":1.25}, + {"label":"[", "x":15.75, "y":1.25}, + {"label":"]", "x":16.75, "y":1.25}, + {"label":"Backslash", "x":17.75, "y":1.25, "w":1.5}, + + {"label":"PgDn", "x":0, "y":2}, + {"label":"Caps Lock", "x":1.25, "y":2.25, "w":2}, + {"label":"A", "x":3.25, "y":2.25}, + {"label":"S", "x":4.5, "y":2.25}, + {"label":"D", "x":5.5, "y":2.25}, + {"label":"F", "x":6.5, "y":2.25}, + {"label":"G", "x":7.5, "y":2.25}, + {"label":"H", "x":10.75, "y":2.25}, + {"label":"J", "x":11.75, "y":2.25}, + {"label":"K", "x":12.75, "y":2.25}, + {"label":"L", "x":13.75, "y":2.25}, + {"label":";", "x":15.25, "y":2.25}, + {"label":"'", "x":16.25, "y":2.25}, + {"label":"Enter", "x":17.25, "y":2.25, "w":2}, + + {"label":"Shift", "x":1.25, "y":3.25, "w":2.5}, + {"label":"Z", "x":3.75, "y":3.25}, + {"label":"X", "x":5, "y":3.25}, + {"label":"C", "x":6, "y":3.25}, + {"label":"V", "x":7, "y":3.25}, + {"label":"B", "x":8, "y":3.25}, + {"label":"B", "x":10.25, "y":3.25}, + {"label":"N", "x":11.25, "y":3.25}, + {"label":"M", "x":12.25, "y":3.25}, + {"label":",", "x":13.25, "y":3.25}, + {"label":".", "x":14.75, "y":3.25}, + {"label":"/", "x":15.75, "y":3.25}, + {"label":"Shift", "x":16.75, "y":3.25, "w":1.5}, + {"label":"Fn", "x":18.25, "y":3.25}, + + {"label":"Alt", "x":1.25, "y":4.25, "w":1.5}, + {"label":"Gui", "x":5, "y":4.25, "w":1.5}, + {"label":"Space", "x":6.5, "y":4.25, "w":2}, + {"label":"Menu", "x":8.5, "y":4.25}, + {"label":"Space", "x":10.25, "y":4.25, "w":2.5}, + {"label":"Alt", "x":12.75, "y":4.25, "w":1.5}, + {"label":"Fn", "x":17.75, "y":4.25, "w":1.5} + ] + } + } +} diff --git a/keyboards/keebio/ergodicity/keymaps/default/config.h b/keyboards/keebio/ergodicity/keymaps/default/config.h new file mode 100644 index 00000000000..6079c0b0f3e --- /dev/null +++ b/keyboards/keebio/ergodicity/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Keebio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/keebio/ergodicity/keymaps/default/keymap.c b/keyboards/keebio/ergodicity/keymaps/default/keymap.c new file mode 100644 index 00000000000..b33031ca5ec --- /dev/null +++ b/keyboards/keebio/ergodicity/keymaps/default/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2019 Keebio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), \ + KC_LCTL, KC_LALT, KC_SPC, KC_LGUI, KC_SPC, KC_RALT, KC_RCTL \ + ), + [1] = LAYOUT( + _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + RGB_MOD, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_STEP, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/keebio/ergodicity/keymaps/default/readme.md b/keyboards/keebio/ergodicity/keymaps/default/readme.md new file mode 100644 index 00000000000..906b26c649d --- /dev/null +++ b/keyboards/keebio/ergodicity/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for ergodicity diff --git a/keyboards/keebio/ergodicity/readme.md b/keyboards/keebio/ergodicity/readme.md new file mode 100644 index 00000000000..0f841d6e3eb --- /dev/null +++ b/keyboards/keebio/ergodicity/readme.md @@ -0,0 +1,15 @@ +# Ergodicity + +![ergodicity](imgur.com image replace me!) + +A short description of the keyboard/project + +Keyboard Maintainer: [nooges/bakingpy](https://github.com/nooges) +Hardware Supported: Ergodicity PCB w/ATmega32u4 +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/ergodicity:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/keebio/ergodicity/rules.mk b/keyboards/keebio/ergodicity/rules.mk new file mode 100644 index 00000000000..974f75afdf2 --- /dev/null +++ b/keyboards/keebio/ergodicity/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/keebio/fourier/config.h b/keyboards/keebio/fourier/config.h new file mode 100644 index 00000000000..9ddc53a0c8e --- /dev/null +++ b/keyboards/keebio/fourier/config.h @@ -0,0 +1,83 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1247 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Fourier +#define DESCRIPTION Split 40 percent staggered keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { F4, D7, E6, B4 } +#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } + +#define QMK_ESC_OUTPUT F5 +#define QMK_ESC_INPUT F4 +#define QMK_LED B0 +#define QMK_SPEAKER C6 + +/* Split Defines */ +#define SPLIT_HAND_PIN D2 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 // Number of LEDs + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/fourier/fourier.c b/keyboards/keebio/fourier/fourier.c similarity index 100% rename from keyboards/fourier/fourier.c rename to keyboards/keebio/fourier/fourier.c diff --git a/keyboards/keebio/fourier/fourier.h b/keyboards/keebio/fourier/fourier.h new file mode 100644 index 00000000000..7505ad8b3e1 --- /dev/null +++ b/keyboards/keebio/fourier/fourier.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef KEYBOARD_fourier_rev1 + #include "rev1.h" +#endif + +#include "quantum.h" + +#define LAYOUT( \ + LA1, LA2, LA3, LA4, LA5, LA6, RA1, RA2, RA3, RA4, RA5, RA6, RA7, \ + LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB7, \ + LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC3, RC4, RC5, RC6, RC7, \ + LD1, LD2, LD3, LD4, LD5, RD1, RD4, RD5, RD6, RD7 \ + ) \ + { \ + { LA1, LA2, LA3, LA4, LA5, LA6, KC_NO}, \ + { LB1, LB2, LB3, LB4, LB5, LB6, KC_NO}, \ + { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO}, \ + { LD1, LD2, LD3, LD4, LD5, KC_NO, KC_NO}, \ + { RA1, RA2, RA3, RA4, RA5, RA6, RA7}, \ + { RB1, RB2, RB3, RB4, RB5, KC_NO, RB7}, \ + { RC1, KC_NO, RC3, RC4, RC5, RC6, RC7}, \ + { RD1, KC_NO, KC_NO, RD4, RD5, RD6, RD7} \ + } + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + LA1, LA2, LA3, LA4, LA5, LA6, RA1, RA2, RA3, RA4, RA5, RA6, RA7, \ + LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB7, \ + LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC3, RC4, RC5, RC6, RC7, \ + LD1, LD2, LD3, LD4, LD5, RD1, RD4, RD5, RD6, RD7 \ + ) \ + LAYOUT( \ + KC_##LA1, KC_##LA2, KC_##LA3, KC_##LA4, KC_##LA5, KC_##LA6, KC_##RA1, KC_##RA2, KC_##RA3, KC_##RA4, KC_##RA5, KC_##RA6, KC_##RA7, \ + KC_##LB1, KC_##LB2, KC_##LB3, KC_##LB4, KC_##LB5, KC_##LB6, KC_##RB1, KC_##RB2, KC_##RB3, KC_##RB4, KC_##RB5, KC_##RB7, \ + KC_##LC1, KC_##LC2, KC_##LC3, KC_##LC4, KC_##LC5, KC_##LC6, KC_##RC1, KC_##RC3, KC_##RC4, KC_##RC5, KC_##RC6, KC_##RC7, \ + KC_##LD1, KC_##LD2, KC_##LD3, KC_##LD4, KC_##LD5, KC_##RD1, KC_##RD4, KC_##RD5, KC_##RD6, KC_##RD7 \ + ) diff --git a/keyboards/fourier/info.json b/keyboards/keebio/fourier/info.json similarity index 100% rename from keyboards/fourier/info.json rename to keyboards/keebio/fourier/info.json diff --git a/keyboards/keebio/fourier/keymaps/default/config.h b/keyboards/keebio/fourier/keymaps/default/config.h new file mode 100644 index 00000000000..8cea3921816 --- /dev/null +++ b/keyboards/keebio/fourier/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +// #define USE_I2C diff --git a/keyboards/keebio/fourier/keymaps/default/keymap.c b/keyboards/keebio/fourier/keymaps/default/keymap.c new file mode 100644 index 00000000000..341bc99a7e8 --- /dev/null +++ b/keyboards/keebio/fourier/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define KC_FN1 MO(_FN1) +#define KC_FN2 MO(_FN2) +#define SPFN1 LT(_FN1, KC_SPACE) +#define BSFN2 LT(_FN2, KC_BSPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LALT, KC_LGUI, KC_FN1, SPFN1, BSFN2, KC_RGUI, KC_RALT, KC_FN2, KC_RCTL + ), + + [_FN1] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + RESET, RGB_HUI, RGB_SAI, RGB_VAI, KC_VOLU, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_SCLN, _______, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_VOLD, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, KC_UP, _______, + RGB_TOG, _______, _______, _______, _______, KC_DEL, KC_0, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN2] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, + _______, _______, _______, KC_INS, KC_PGUP, KC_HOME, _______, _______, _______, _______, KC_COLN, _______, + _______, _______, _______, KC_DEL, KC_PGDN, KC_END, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______ + ) + +}; diff --git a/keyboards/keebio/fourier/keymaps/default/rules.mk b/keyboards/keebio/fourier/keymaps/default/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/fourier/keymaps/jennetters/config.h b/keyboards/keebio/fourier/keymaps/jennetters/config.h similarity index 100% rename from keyboards/fourier/keymaps/jennetters/config.h rename to keyboards/keebio/fourier/keymaps/jennetters/config.h diff --git a/keyboards/keebio/fourier/keymaps/jennetters/keymap.c b/keyboards/keebio/fourier/keymaps/jennetters/keymap.c new file mode 100644 index 00000000000..a6ec95e1e3a --- /dev/null +++ b/keyboards/keebio/fourier/keymaps/jennetters/keymap.c @@ -0,0 +1,146 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define KC_ KC_TRNS +#define KC_FN1 MO(_FN1) +#define KC_FN2 MO(_FN2) +#define KC_SPFN1 LT(_FN1, KC_SPACE) +#define KC_SPFN2 LT(_FN2, KC_SPACE) +#define KC_BSFN1 LT(_FN1, KC_BSPC) +#define KC_BSFN2 LT(_FN2, KC_BSPC) +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +//Tap Dance Declarations +enum { + ESC_GR = 0, + Q_1, + W_2, + E_3, + R_4, + T_5, + Y_6, + U_7, + I_8, + O_9, + P_0, + MIN_LB, + EQL_RB, + SCL_QUO +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_BASE] = LAYOUT( + // ,----+----+----+----+----+----|----+----+----+----+----+----+----. + // |ESC | Q1 | W2 | E3 | R4 | T5 | Y6 | U7 | I8 | O9 | P0 | -[ | =] | + // |----`----`----`----`----`----|----`----`----`----`----`----`----| + // | TAB | A | S | D | F | G | H | H | J | K | L | BKSP | + // |-----`----`----`----`----`----|----`----`----`----`----`--------| + // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHFT | + // |-------`----`----`----`----`----|----`----`----`----`----`------| + // | CTL | SYS| ALT | SP SPACE | SPACE | FN1 | CTL | \ | ENT | + // `-----+----+-----+----+--------|--------+-----+------+----+------' + + TD(ESC_GR), TD(Q_1), TD(W_2), TD(E_3), TD(R_4), TD(T_5), TD(Y_6), TD(U_7), TD(I_8), TD(O_9), TD(P_0),TD(MIN_LB),TD(EQL_RB), \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD(SCL_QUO), KC_BSPC, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_FN1, KC_LCTL, KC_NUBS, KC_ENTER + ), + + [_FN1] = LAYOUT_kc( + // ,----+----+----+----+----+----|----+----+----+----+----+----+----. + // | | | UP | | | | | | | | | | | + // |----`----`----`----`----`----|----`----`----`----`----`----`----| + // | | LT | DN | RT | | | | | | | ' | DEL | + // |-----`----`----`----`----`----|----`----`----`----`----`--------| + // | | | | | | | | | | |PIPE| | + // |-------`----`----`----`----`----|----`----`----`----`----`------| + // | | | | | | | | | | | + // `-----+----+-----+----+--------|--------+-----+------+----+------' + + , , UP, , , , , , , , , , , \ + , LEFT, DOWN, RIGHT, , , , , , , QUOT, DEL, \ + , , , , , , , , , , NUBS, , \ + , , , , , , , , , + ), + + [_FN2] = LAYOUT_kc( + // ,----+----+----+----+----+----|----+----+----+----+----+----+----. + // | | | | | | | | | | | | | | + // |----`----`----`----`----`----|----`----`----`----`----`----`----| + // | | | | | | | | | | | | | + // |-----`----`----`----`----`----|----`----`----`----`----`--------| + // | | | | | | | | | | | | | + // |-------`----`----`----`----`----|----`----`----`----`----`------| + // | | | | | | | | | | | + // `-----+----+-----+----+--------|--------+-----+------+----+------' + + , , , , , , , , , , , , , \ + , , , , , , , , , , , , \ + , , , , , , , , , , , , \ + , , , , , , , , , + ) + +}; + +void esc_gr_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_ESC); + } else if (state->count == 2) { + register_code (KC_GRV); + } else { + register_code (KC_LSFT); + register_code (KC_GRV); + } +} + +void esc_gr_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_ESC); + } else if (state->count == 2) { + unregister_code (KC_GRV); + } else { + unregister_code (KC_LSFT); + unregister_code (KC_GRV); + } +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { +[ESC_GR] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, esc_gr_finished, esc_gr_reset), //Tap once for ESC, twice for `, thrice for ~ +[Q_1] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_1), //Tap once for Q, twice for 1/! +[W_2] = ACTION_TAP_DANCE_DOUBLE(KC_W, KC_2), //Tap once for W, twice for 2/@ +[E_3] = ACTION_TAP_DANCE_DOUBLE(KC_E, KC_3), //Tap once for E, twice for 3/# +[R_4] = ACTION_TAP_DANCE_DOUBLE(KC_R, KC_4), //Tap once for R, twice for 4/$ +[T_5] = ACTION_TAP_DANCE_DOUBLE(KC_T, KC_5), //Tap once for T, twice for 5/% +[Y_6] = ACTION_TAP_DANCE_DOUBLE(KC_Y, KC_6), //Tap once for Y, twice for 6/^ +[U_7] = ACTION_TAP_DANCE_DOUBLE(KC_U, KC_7), //Tap once for U, twice for 7/& +[I_8] = ACTION_TAP_DANCE_DOUBLE(KC_I, KC_8), //Tap once for I, twice for 8/* +[O_9] = ACTION_TAP_DANCE_DOUBLE(KC_O, KC_9), //Tap once for O, twice for 9/( +[P_0] = ACTION_TAP_DANCE_DOUBLE(KC_P, KC_0), //Tap once for P, twice for 0/) +[MIN_LB] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_LBRC), //Tap once for -, twice for [/{ +[EQL_RB] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_RBRC), //Tap once for =, twice for ]/} +[SCL_QUO] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT) //Tap once for ;, '/" +// Other declarations would go here, separated by commas, if you have them +}; diff --git a/keyboards/fourier/keymaps/jennetters/rules.mk b/keyboards/keebio/fourier/keymaps/jennetters/rules.mk similarity index 100% rename from keyboards/fourier/keymaps/jennetters/rules.mk rename to keyboards/keebio/fourier/keymaps/jennetters/rules.mk diff --git a/keyboards/keebio/fourier/keymaps/maxim/config.h b/keyboards/keebio/fourier/keymaps/maxim/config.h new file mode 100644 index 00000000000..fb13b56cdc7 --- /dev/null +++ b/keyboards/keebio/fourier/keymaps/maxim/config.h @@ -0,0 +1,29 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + diff --git a/keyboards/keebio/fourier/keymaps/maxim/keymap.c b/keyboards/keebio/fourier/keymaps/maxim/keymap.c new file mode 100644 index 00000000000..68bd649ecc2 --- /dev/null +++ b/keyboards/keebio/fourier/keymaps/maxim/keymap.c @@ -0,0 +1,45 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + + +#define FN1 MO(_FN1) +#define FN2 MO(_FN2) +#define SPFN1 LT(_FN1, KC_SPACE) +#define BSFN2 LT(_FN2, KC_BSPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + XXXXXXX, KC_LCTL, KC_LALT, XXXXXXX, KC_SPC, FN1, KC_RCTL, KC_RGUI, FN2, XXXXXXX + ), + + [_FN1] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + RESET, RGB_HUI, RGB_SAI, RGB_VAI, KC_VOLU, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_SCLN, _______, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_VOLD, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, KC_UP, _______, + RGB_TOG, _______, _______, _______, _______, KC_DEL, KC_0, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN2] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, + _______, _______, _______, KC_INS, KC_PGUP, KC_HOME, _______, _______, _______, _______, KC_COLN, _______, + _______, _______, _______, KC_DEL, KC_PGDN, KC_END, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______ + ) + +}; diff --git a/keyboards/fourier/keymaps/default/config.h b/keyboards/keebio/fourier/keymaps/valgrahf/config.h similarity index 100% rename from keyboards/fourier/keymaps/default/config.h rename to keyboards/keebio/fourier/keymaps/valgrahf/config.h diff --git a/keyboards/keebio/fourier/keymaps/valgrahf/keymap.c b/keyboards/keebio/fourier/keymaps/valgrahf/keymap.c new file mode 100644 index 00000000000..a31c884750c --- /dev/null +++ b/keyboards/keebio/fourier/keymaps/valgrahf/keymap.c @@ -0,0 +1,69 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define KC_ KC_TRNS +#define KC_FN1 LT(_FN1, KC_NO) +#define KC_FN2 LT(_FN2, KC_NO) +#define KC_SPFN LT(_FN1, KC_SPACE) +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_kc( + //,----+----+----+----+----+----|----+----+----+----+----+----+----. + TAB , Q , W , E , R , T , Y , U , I , O , P , DEL,BSPC, + //|----`----`----`----`----`----|----`----`----`----`----`----`----| + ESC , A , S , D , F , G , H , J , K , L ,QUOT, SCLN , + //|-----`----`----`----`----`----|----`----`----`----`----`--------| + LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, PGUP , + //|-------`----`----`----`----`----|----`----`----`----`----`------| + LCTL ,LALT, FN1, ,ENTER , SPACE , FN2 , HOME, END , PGDN + //`-----+----+-----+-------------|--------+-----+-----+-----+------' + ), + + [_FN1] = LAYOUT_kc( + //,----+----+----+----+----+----|----+----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , , + //|----`----`----`----`----`----|----`----`----`----`----`----`----| + DEL , F1 ,F2 , F3 , F4 , F5 , F6 ,MINS, EQL,LBRC,RBRC, BSLS , + //|-----`----`----`----`----`----|----`----`----`----`----`--------| + , F7 , F8 , F9 , F10, F11, F12, , , , UP , , + //|-------`----`----`----`----`----|----`----`----`----`----`------| + , , , , , ,RGUI,LEFT ,DOWN ,RIGHT + //`-----+----+-----+-------------|--------+-----+-----+-----+------' + ), + + [_FN2] = LAYOUT_kc( + //,----+----+----+----+----+----|----+----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN, , , + //|----`----`----`----`----`----|----`----`----`----`----`----`----| + DEL ,RHUI,RSAI,RVAI, , , ,UNDS,PLUS,LCBR,RCBR, PIPE , + //|-----`----`----`----`----`----|----`----`----`----`----`--------| + ,RHUD,RSAD,RVAD, , ,VOLU,VOLD, , , UP , , + //|-------`----`----`----`----`----|----`----`----`----`----`------| + ,RTOG,RMOD , , , , , LEFT, DOWN, RIGHT + //`-----+----+-----+-------------|--------+-----+-----+-----+------' + ) + +}; diff --git a/keyboards/keebio/fourier/keymaps/valgrahf/rules.mk b/keyboards/keebio/fourier/keymaps/valgrahf/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/fourier/keymaps/xyverz/config.h b/keyboards/keebio/fourier/keymaps/xyverz/config.h similarity index 100% rename from keyboards/fourier/keymaps/xyverz/config.h rename to keyboards/keebio/fourier/keymaps/xyverz/config.h diff --git a/keyboards/keebio/fourier/keymaps/xyverz/keymap.c b/keyboards/keebio/fourier/keymaps/xyverz/keymap.c new file mode 100644 index 00000000000..4e864cdef7e --- /dev/null +++ b/keyboards/keebio/fourier/keymaps/xyverz/keymap.c @@ -0,0 +1,84 @@ +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define KC_ KC_TRNS +#define KC_FN1 MO(_FN1) +#define KC_FN2 MO(_FN2) +#define KC_ESFN1 LT(_FN1, KC_ESC) +#define KC_SPFN1 LT(_FN1, KC_SPACE) +#define KC_SPFN2 LT(_FN2, KC_SPACE) +#define KC_BSFN1 LT(_FN1, KC_BSPC) +#define KC_BSFN2 LT(_FN2, KC_BSPC) +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_kc( + //,----+----+----+----+----+----|----+----+----+----+----+----+----. + TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH,MINS, + //|----`----`----`----`----`----|----`----`----`----`----`----`----| + ESC , A , O , E , U , I , D , H , T , N , S , ENTER , + //|-----`----`----`----`----`----|----`----`----`----`----`--------| + LSFT ,SCLN, Q , J , K , X , B , M , W , V , Z , RSFT , + //|-------`----`----`----`----`----|----`----`----`----`----`------| + LCTL ,LALT,LGUI ,FN2 , BSPC , SPC , FN1 ,RGUI ,RALT , RCTL + //`-----+----+-----+----+--------|--------+-----+-----+-----+------' + ), + + [_FN1] = LAYOUT_kc( + //,----+----+----+----+----+----|----+----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , + //|----`----`----`----`----`----|----`----`----`----`----`----`----| + CAPS ,RHUI,RSAI,RVAI,VOLU,LBRC,RBRC, , , ,SCLN, , + //|-----`----`----`----`----`----|----`----`----`----`----`--------| + RMOD ,RHUD,RSAD,RVAD,VOLD,LCBR,RCBR, , , , UP , , + //|-------`----`----`----`----`----|----`----`----`----`----`------| + RTOG , , , , DEL , INS , ,LEFT ,DOWN , RGHT + //`-----+----+-----+----+--------|--------+-----+-----+-----+------' + ), + + [_FN2] = LAYOUT_kc( + //,----+----+----+----+----+----|----+----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN,UNDS,PLUS, + //|----`----`----`----`----`----|----`----`----`----`----`----`----| + CAPS , , ,INS ,PGUP,HOME, F1 , F2 , F3 , F4 , F5 , F6 , + //|-----`----`----`----`----`----|----`----`----`----`----`--------| + , , ,DEL ,PGDN,END , F7 , F8 , F9 ,F10 ,F11 , F12 , + //|-------`----`----`----`----`----|----`----`----`----`----`------| + , , , , DEL , INS , , , , + //`-----+----+-----+----+--------|--------+-----+-----+-----+------' + ) + +}; + +void matrix_init_user(void) { + // This will disable the red LEDs on the ProMicros + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); +}; + diff --git a/keyboards/keebio/fourier/readme.md b/keyboards/keebio/fourier/readme.md new file mode 100644 index 00000000000..c18d1a7484a --- /dev/null +++ b/keyboards/keebio/fourier/readme.md @@ -0,0 +1,20 @@ +Fourier +======== + +A split 40% staggered keyboard made and sold by Keebio. [More info at Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io/collections/frontpage/products/fourier-40-split-staggered-keyboard) + +Make example for this keyboard (after setting up your build environment): + + make keebio/fourier:default + +Example of flashing this keyboard: + + make keebio/fourier:default:avrdude + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +A build guide for this keyboard can be found here: [Keebio Build Guides](https://docs.keeb.io) diff --git a/keyboards/keebio/fourier/rules.mk b/keyboards/keebio/fourier/rules.mk new file mode 100644 index 00000000000..9512c0f6482 --- /dev/null +++ b/keyboards/keebio/fourier/rules.mk @@ -0,0 +1,65 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes diff --git a/keyboards/iris/config.h b/keyboards/keebio/iris/config.h similarity index 100% rename from keyboards/iris/config.h rename to keyboards/keebio/iris/config.h diff --git a/keyboards/keebio/iris/info.json b/keyboards/keebio/iris/info.json new file mode 100644 index 00000000000..37806975f8e --- /dev/null +++ b/keyboards/keebio/iris/info.json @@ -0,0 +1,23 @@ +{ + "keyboard_name": "Iris", + "url": "https://keeb.io", + "maintainer": "Keebio", + "width": 15, + "height": 5.75, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0.375}, {"x":1, "y":0.375}, {"x":2, "y":0.125}, {"x":3, "y":0}, {"x":4, "y":0.125}, {"x":5, "y":0.25}, + {"x":9, "y":0.25}, {"x":10, "y":0.125}, {"x":11, "y":0}, {"x":12, "y":0.125}, {"x":13, "y":0.375}, {"x":14, "y":0.375}, + {"x":0, "y":1.375}, {"x":1, "y":1.375}, {"x":2, "y":1.125}, {"x":3, "y":1}, {"x":4, "y":1.125}, {"x":5, "y":1.25}, + {"x":9, "y":1.25}, {"x":10, "y":1.125}, {"x":11, "y":1}, {"x":12, "y":1.125}, {"x":13, "y":1.375}, {"x":14, "y":1.375}, + {"x":0, "y":2.375}, {"x":1, "y":2.375}, {"x":2, "y":2.125}, {"x":3, "y":2}, {"x":4, "y":2.125}, {"x":5, "y":2.25}, + {"x":9, "y":2.25}, {"x":10, "y":2.125}, {"x":11, "y":2}, {"x":12, "y":2.125}, {"x":13, "y":2.375}, {"x":14, "y":2.375}, + {"x":0, "y":3.375}, {"x":1, "y":3.375}, {"x":2, "y":3.125}, {"x":3, "y":3}, {"x":4, "y":3.125}, {"x":5, "y":3.25}, + {"x":6.15, "y":3.75}, {"x":7.85, "y":3.75}, + {"x":9, "y":3.25}, {"x":10, "y":3.125}, {"x":11, "y":3}, {"x":12, "y":3.125}, {"x":13, "y":3.375}, {"x":14, "y":3.375}, + {"x":3.5, "y":4.25}, {"x":4.5, "y":4.375}, {"x":5.6, "y":4.75}, {"x":8.4, "y":4.75}, {"x":9.5, "y":4.375}, {"x":10.5, "y":4.25} + ] + } + } +} diff --git a/keyboards/iris/iris.c b/keyboards/keebio/iris/iris.c similarity index 100% rename from keyboards/iris/iris.c rename to keyboards/keebio/iris/iris.c diff --git a/keyboards/keebio/iris/iris.h b/keyboards/keebio/iris/iris.h new file mode 100644 index 00000000000..949405d55fe --- /dev/null +++ b/keyboards/keebio/iris/iris.h @@ -0,0 +1,30 @@ +#pragma once + +#ifdef KEYBOARD_keebio_iris_rev1 + #include "rev1.h" +#elif KEYBOARD_keebio_iris_rev1_led + #include "rev1_led.h" +#elif KEYBOARD_keebio_iris_rev2 + #include "rev2.h" +#else + #include "rev3.h" +#endif + +#include "quantum.h" +#include "../../wilba_tech/via_keycodes.h" + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, LT4, RT4, R30, R31, R32, R33, R34, R35, \ + LT1, LT2, LT3, RT3, RT2, RT1 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##LT4, KC_##RT4, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ + KC_##LT1, KC_##LT2, KC_##LT3, KC_##RT3, KC_##RT2, KC_##RT1 \ + ) diff --git a/keyboards/keebio/iris/keymaps/333fred/config.h b/keyboards/keebio/iris/keymaps/333fred/config.h new file mode 100644 index 00000000000..8a866b826d8 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/333fred/config.h @@ -0,0 +1,14 @@ +#pragma once + +#include "333fred_config.h" + +#define USE_SERIAL +#define EE_HANDS +#define NO_ACTION_MACRO + +#undef TAPPING_TERM +#define TAPPING_TERM 200 + +#undef RGBLED_NUM +#define RGBLED_NUM 24 +#define RGBLIGHT_SLEEP diff --git a/keyboards/keebio/iris/keymaps/333fred/keymap.c b/keyboards/keebio/iris/keymaps/333fred/keymap.c new file mode 100644 index 00000000000..b8a65d7d291 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/333fred/keymap.c @@ -0,0 +1,54 @@ +#include QMK_KEYBOARD_H +#include "333fred.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE] = LAYOUT( + //┌──────────────┬────────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬──────────────┐ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + //├──────────────┼────────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼──────────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + //├──────────────┼────────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼──────────────┤ + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├──────────────┼────────────┼────────┼────────┼────────┼────────┼───────────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼──────────────┤ + OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_DOWN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_RSFT), + //└──────────────┴────────────┴────────┴────────┼────────┼────────┼───────────────┤ ├────────┼────────┼────────┼────────┴────────┴────────┴──────────────┘ + KC_LALT, KC_BSPC, TD(TD_SYM_VIM), KC_ENT, KC_SPC, KC_RGUI + // └────────┴────────┴───────────────┘ └────────┴────────┴────────┘ + ), + + + [SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PLUS, _______, KC_7, KC_8, KC_9, _______, KC_F12, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_EQL, _______, KC_4, KC_5, KC_6, _______, KC_VOLU, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_UP, KC_UP, KC_0, KC_1, KC_2, KC_3, _______, KC_VOLD, + //└────────┴────────┴────────┴───┬────┴───┬────┴───────┴─────┬───┴────┐ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, TD(TD_COPY_PASTE), _______, KC_MPRV, KC_MPLY, KC_MNXT + // └────────┴──────────────────┴────────┘ └────────┴────────┴────────┘ + ), + + + [VIM] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_process_keycode(keycode); + return !try_handle_macro(keycode, record); +} diff --git a/keyboards/keebio/iris/keymaps/333fred/rules.mk b/keyboards/keebio/iris/keymaps/333fred/rules.mk new file mode 100644 index 00000000000..2b5da5a22fb --- /dev/null +++ b/keyboards/keebio/iris/keymaps/333fred/rules.mk @@ -0,0 +1,7 @@ +NKRO_ENABLE = yes +KEY_LOCK_ENABLE = yes +TAP_DANCE_ENABLE = yes +CONSOLE_ENABLE = no +PERMISSIVE_HOLD = yes +EXTRAFLAGS += -flto + diff --git a/keyboards/keebio/iris/keymaps/ave-63/config.h b/keyboards/keebio/iris/keymaps/ave-63/config.h new file mode 100644 index 00000000000..381a494b758 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/ave-63/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_TERM 150 + +/* Select hand configuration */ +//#define MASTER_LEFT +#define MASTER_RIGHT +// #define EE_HANDS + +/*#undef RGBLED_NUMvbvbvbvbvbvbvtesting +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 1 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8*/ diff --git a/keyboards/keebio/iris/keymaps/ave-63/keymap.c b/keyboards/keebio/iris/keymaps/ave-63/keymap.c new file mode 100644 index 00000000000..3d393a71c7a --- /dev/null +++ b/keyboards/keebio/iris/keymaps/ave-63/keymap.c @@ -0,0 +1,120 @@ +/* Features of this keymap: + +--Lots of functionality on left hand for conjunction with mouse or pen in right hand +--_COMMAND layer ESDF arrow keys +--_MEH layer ESDF is super handy for switching tabs (SF) and apps (ED) +--_MEH layer other keys are linked with my AutoHotKey script +--macro for handling parentheses is very nice (credit: u/drashna) + +Some things are very non-standard, like position of number keys, etc. +Will require heavy modification for most people. +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +enum my_layers { + _QWERTY, + _SYMBOL, + _COMMAND, + _MEH +}; + +enum custom_keycodes { + KC_MPRN = SAFE_RANGE, + KC_MBRC, + KC_MCBR, + KC_MABK +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT( + KC_ESC, KC_GRV, KC_AT, KC_BSLS, KC_NO, TG(_SYMBOL), KC_NO, KC_LGUI, KC_MBRC, KC_RBRC, KC_NO, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MO(_SYMBOL), + KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(_MEH), KC_QUOT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_NO, KC_LSFT, MO(_COMMAND), KC_ENT, KC_SPC, KC_NO +), +[_SYMBOL] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_EQL, KC_9, KC_8, KC_7, KC_PLUS, KC_HASH, KC_UNDS, KC_MCBR, KC_RCBR, KC_TRNS, KC_TRNS, + KC_TRNS, KC_0, KC_6, KC_5, KC_4, KC_MINS, KC_CIRC, KC_AMPR, KC_MPRN, KC_RPRN, KC_RBRC, KC_TRNS, + KC_TRNS, KC_SLSH, KC_3, KC_2, KC_1, KC_ASTR, KC_TRNS, KC_TRNS, KC_EXLM, KC_DLR, KC_MABK, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), +[_COMMAND] = LAYOUT( + KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_VOLU, KC_SLCK, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_VOLD, KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), +[_MEH] = LAYOUT( + LALT(KC_F4), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, + KC_TRNS, MEH(KC_Q), LCTL(KC_W), LSFT(KC_TAB), KC_DEL, MEH(KC_T), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, MEH(KC_A),LSFT(LCTL(KC_TAB)),KC_TAB,LCTL(KC_TAB),MEH(KC_G), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,MEH(KC_Z),MEH(KC_X),MEH(KC_C),MEH(KC_V),MEH(KC_B),KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t code_timer; + switch (keycode) { + case KC_MCBR: + if(record->event.pressed){ + code_timer= timer_read(); + SEND_STRING("{"); + } else { + if (timer_elapsed(code_timer) > TAPPING_TERM) { + SEND_STRING("}" SS_TAP(X_LEFT)); + } + } + return false; + break; + case KC_MBRC: + if(record->event.pressed){ + code_timer= timer_read(); + SEND_STRING("["); + } else { + if (timer_elapsed(code_timer) > TAPPING_TERM) { + SEND_STRING("]" SS_TAP(X_LEFT)); + } + } + return false; + break; + case KC_MPRN: + if(record->event.pressed){ + code_timer= timer_read(); + SEND_STRING("("); + } else { + if (timer_elapsed(code_timer) > TAPPING_TERM) { + SEND_STRING(")" SS_TAP(X_LEFT)); + } + } + return false; + break; + case KC_MABK: + if(record->event.pressed){ + code_timer= timer_read(); + if (get_mods() & MODS_SHIFT_MASK){ + SEND_STRING("<"); + } else { + SEND_STRING(","); + } + } else { + if (timer_elapsed(code_timer) > TAPPING_TERM) { + if (get_mods() & MODS_SHIFT_MASK){ + SEND_STRING(">" SS_TAP(X_LEFT)); + } + } + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/iris/keymaps/bmoorey/config.h b/keyboards/keebio/iris/keymaps/bmoorey/config.h similarity index 100% rename from keyboards/iris/keymaps/bmoorey/config.h rename to keyboards/keebio/iris/keymaps/bmoorey/config.h diff --git a/keyboards/iris/keymaps/bmoorey/keymap.c b/keyboards/keebio/iris/keymaps/bmoorey/keymap.c similarity index 100% rename from keyboards/iris/keymaps/bmoorey/keymap.c rename to keyboards/keebio/iris/keymaps/bmoorey/keymap.c diff --git a/keyboards/iris/keymaps/bmoorey/readme.md b/keyboards/keebio/iris/keymaps/bmoorey/readme.md similarity index 100% rename from keyboards/iris/keymaps/bmoorey/readme.md rename to keyboards/keebio/iris/keymaps/bmoorey/readme.md diff --git a/keyboards/iris/keymaps/bmoorey/rules.mk b/keyboards/keebio/iris/keymaps/bmoorey/rules.mk similarity index 100% rename from keyboards/iris/keymaps/bmoorey/rules.mk rename to keyboards/keebio/iris/keymaps/bmoorey/rules.mk diff --git a/keyboards/iris/keymaps/broswen/config.h b/keyboards/keebio/iris/keymaps/broswen/config.h similarity index 100% rename from keyboards/iris/keymaps/broswen/config.h rename to keyboards/keebio/iris/keymaps/broswen/config.h diff --git a/keyboards/keebio/iris/keymaps/broswen/keymap.c b/keyboards/keebio/iris/keymaps/broswen/keymap.c new file mode 100644 index 00000000000..a64b03f5718 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/broswen/keymap.c @@ -0,0 +1,125 @@ +#include QMK_KEYBOARD_H + + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP +#define KC_DBUG DEBUG + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , DEL, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,LBRC, RBRC , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LGUI,SPC, ENT ,LOWR,RASE + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , ,PGDN,PGUP, , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,TILD,PIPE,MINS,PLUS, , LEFT,DOWN, UP ,RGHT, , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , GRV,BSLS,UNDS, EQL, , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , ,F12 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , MUTE,VOLD,VOLU, , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + AU_TOG, CK_UP, CK_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // case QWERTY: + // if (record->event.pressed) { + // persistent_default_layer_set(1UL<<_QWERTY); + // } + // return false; + // break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/broswen/rules.mk b/keyboards/keebio/iris/keymaps/broswen/rules.mk similarity index 100% rename from keyboards/iris/keymaps/broswen/rules.mk rename to keyboards/keebio/iris/keymaps/broswen/rules.mk diff --git a/keyboards/keebio/iris/keymaps/davidrambo/config.h b/keyboards/keebio/iris/keymaps/davidrambo/config.h new file mode 100644 index 00000000000..0c4bf8c8f4c --- /dev/null +++ b/keyboards/keebio/iris/keymaps/davidrambo/config.h @@ -0,0 +1,40 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ +#define PERMISSIVE_HOLD +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS +/* +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +*/ +#define TAPPING_TERM 200 + + diff --git a/keyboards/keebio/iris/keymaps/davidrambo/keymap.c b/keyboards/keebio/iris/keymaps/davidrambo/keymap.c new file mode 100644 index 00000000000..4d76d745d8d --- /dev/null +++ b/keyboards/keebio/iris/keymaps/davidrambo/keymap.c @@ -0,0 +1,156 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +//keycode shorthands +#define KC____ KC_TRNS // three underscores "___" for transparent +#define KC_SYM MO(3) +#define KC_MAC TO(0) +#define KC_PC TO(1) +#define KC_GM TO(2) +#define KC_NAVMAC LT(4, KC_TAB) +#define KC_NAVPC LT(5, KC_TAB) + +//text editor shortcuts for NAV and NAVPC +#define KC_AL LALT(KC_LEFT) +#define KC_AR LALT(KC_RGHT) +#define KC_CL LCTL(KC_LEFT) +#define KC_CR LCTL(KC_RGHT) +#define KC_ABSPC LALT(KC_BSPC) +#define KC_CBSPC LCTL(KC_BSPC) + +//internet browser tab shortcuts and window swapping for Mac and Windows +#define KC_GSL LGUI(S(KC_LEFT)) +#define KC_GSR LGUI(S(KC_RGHT)) +#define KC_CPGD LCTL(KC_PGDN) +#define KC_CPGU LCTL(KC_PGUP) + +#define KC_CMBS GUI_T(KC_BSPC) +#define KC_CTBS CTL_T(KC_BSPC) +#define KC_C_TAB LCTL(KC_TAB) +#define KC_G_TAB LGUI(KC_TAB) +#define KC_A_TAB LALT(KC_TAB) + +//layer shorthands +#define _COLEMAK 0 +#define _PC 1 +#define _GAME 2 +#define _SYMBOL 3 +#define _NAVMAC 4 +#define _NAVPC 5 + +enum { +// SFT_LCK //tapdance declarations + COLEMAK = 0, + PC, + GAME, + SYMBOL, + NAV, //Navigation layer for Mac Colemak + NAVPC, //Navigation layer for PC Colemak + SFT_LCK //tapdance declaration +}; + +#define KC_SFLK TD(SFT_LCK) // alias for tapdance + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + GRV , Q , W , F , P , G , J , L , U , Y ,SCLN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + NAVMAC, A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + SFLK, Z , X , C , V , B , PC , ENT , K , M ,COMM, DOT,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LCTL,LGUI,CMBS, SPC, SYM, LALT + // `----+----+----' `----+----+----' + ), + + [_PC] = LAYOUT_kc( + ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , + + ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , + + NAVPC,___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , + + ___ , ___ , ___ , ___ , ___ , ___ , GM, ___, ___ , ___ , ___ , ___ , ___ , ___ , + + LGUI , LCTL , CTBS , ___ , ___ , ___ + ), + + [_GAME] = LAYOUT_kc( + ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , + + B , T , Q , W , E , R , ___ , ___ , ___ , ___ , ___ , ___ , + + TAB , LSFT, A , S , D , F , ___ , ___ , ___ , ___ , ___ , ___ , + + LALT, LCTL, Z , X , C , V , M, P , ___, ___ , ___ , ___ , ___ , ___ , + + G , I , SPC, BSPC, MAC, ___ + ), + + [_SYMBOL] = LAYOUT_kc( + + ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , + + LBRC, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , RBRC, + + BSLS, EXLM, AT , HASH, DLR , PERC, CIRC, AMPR, ASTR, LPRN, RPRN, EQL , + + ___ , HOME, END , VOLD, VOLU, MPLY,___, ___,___, MINS, ___ , ___ , ___ , ___ , + + ___ , ___ , ___, ___, ___ , ___ + ), + + [_NAVMAC] = LAYOUT_kc( + + ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , + + ___ , ___ , ___ , ___ , ___ , ___ , C_TAB, AL , UP , AR , DEL , ___ , + + ___ , ___ , ___ , ___ , ___ , ___ , GSL , LEFT, DOWN, RGHT, GSR , ___ , + + ___ , ___ , ___ , ___ , ___ , ___ ,___, ___,G_TAB,ABSPC, ___ , ___ , ___ , ___ , + + ___ , ___ , ___ , ___ , ___ , ___ + ), + + [_NAVPC] = LAYOUT_kc( + + ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ , + + ___ , ___ , ___ , ___ , ___ , ___ , C_TAB, CL , UP , CR , DEL , ___ , + + ___ , ___ , ___ , ___ , ___ , ___ , CPGU, LEFT, DOWN, RGHT, CPGD, ___ , + + ___ , ___ , ___ , ___ , ___ , ___ ,___, ___,A_TAB,CBSPC, ___ , ___ , ___ , ___ , + + ___ , ___ , ___ , ___ , ___ , ___ + ), + +}; + +// Shift vs. capslock function. From bbaserdem's Planck keymap. +void caps_tap (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LSFT); + } else if (state->count == 2) { + unregister_code (KC_LSFT); + register_code (KC_CAPS); + } +} +void caps_tap_end (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LSFT); + } else { + unregister_code (KC_CAPS); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Shift, twice for Caps Lock + [SFT_LCK] = ACTION_TAP_DANCE_FN_ADVANCED( caps_tap, NULL, caps_tap_end) +}; \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/davidrambo/readme.md b/keyboards/keebio/iris/keymaps/davidrambo/readme.md new file mode 100644 index 00000000000..181ff97f364 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/davidrambo/readme.md @@ -0,0 +1,5 @@ +# Iris + +This is a simple Colemak layout for Iris rev2.1 with Mac and Windows layers and a Gaming Layer. +The Symbol layer is based on my Planck layout. It provides numbers, symbols, and volume controls. +There are two Navigation layers, for the Mac and Windows Colemak layers respectively. \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/davidrambo/rules.mk b/keyboards/keebio/iris/keymaps/davidrambo/rules.mk new file mode 100644 index 00000000000..1e3473a1af6 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/davidrambo/rules.mk @@ -0,0 +1,4 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no +TAP_DANCE_ENABLE = yes + diff --git a/keyboards/iris/keymaps/dbroqua/config.h b/keyboards/keebio/iris/keymaps/dbroqua/config.h similarity index 100% rename from keyboards/iris/keymaps/dbroqua/config.h rename to keyboards/keebio/iris/keymaps/dbroqua/config.h diff --git a/keyboards/keebio/iris/keymaps/dbroqua/keymap.c b/keyboards/keebio/iris/keymaps/dbroqua/keymap.c new file mode 100644 index 00000000000..fe19696e1bc --- /dev/null +++ b/keyboards/keebio/iris/keymaps/dbroqua/keymap.c @@ -0,0 +1,124 @@ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_DBUG DEBUG + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + /* + * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | + * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | TAB | Q | W | E | R | T | | Y | U | I | O | P | BSPC| + * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | LCTL| A | S | D | F | G | | H | J | K | L | ; | ' | + * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ + * | LSFT| Z | X | C | V | B | / \ | N | M | , | . | / | RSFT| + * +-----+-----+-----+--+--+-----+-----+ SPC/ \ ENT+-----+-----+--+--+-----+-----+-----+ + * \ LGUI| LOWR| / \ | RASE| LALT/ + * `-----+-----+-----' `-----+-----+----' + */ + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , GRV, + TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC, + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + LSFT, Z , X , C , V , B , , , N , M ,COMM,DOT ,SLSH,RSFT, + LGUI,LOWR, SPC , ENT ,RASE,LALT + ), + + [_LOWER] = LAYOUT_kc( + /* + * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BSPC| + * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | RST | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | DEL | | LEFT| RGHT| UP | [ | | ] | 4 | 5 | 6 | + | | | + * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ + * | | | | | DOWN| { | / \ | } | 1 | 2 | 3 | - | | + * +-----+-----+-----+--+--+-----+-----+ DEL/ \ DEL+-----+-----+--+--+-----+-----+-----+ + * \ | | / \ | | 0 / + * `-----+-----+-----' `-----+-----+----' + */ + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, + , , , ,DOWN,LCBR, , ,RCBR, P1 , P2 , P3 ,MINS, , + , ,DEL , DEL , , P0 + ), + + [_RAISE] = LAYOUT_kc( + /* + * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ + * | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | | Prev| Next| Vol+| PgUp| _ | | = | Home| | | + | \ | + * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ + * | Mute| Stop| Play| Vol-| PgDn| - | / \ | + | End | | | |Debug| + * +-----+-----+-----+--+--+-----+-----+ / \ +-----+-----+--+--+-----+-----+-----+ + * \ | | / \ | | 0 / + * `-----+-----+-----' `-----+-----+----' + */ + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , ,DBUG, + , , , , , + ) +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _QWERTY); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _QWERTY); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _QWERTY); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _QWERTY); + } + return false; + break; + } + return true; +} diff --git a/keyboards/levinson/keymaps/treadwell/rules.mk b/keyboards/keebio/iris/keymaps/dbroqua/rules.mk similarity index 100% rename from keyboards/levinson/keymaps/treadwell/rules.mk rename to keyboards/keebio/iris/keymaps/dbroqua/rules.mk diff --git a/keyboards/keebio/iris/keymaps/default/config.h b/keyboards/keebio/iris/keymaps/default/config.h new file mode 100644 index 00000000000..01bb31a6e14 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/default/config.h @@ -0,0 +1,28 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C +#define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/iris/keymaps/default/keymap.c b/keyboards/keebio/iris/keymaps/default/keymap.c new file mode 100644 index 00000000000..758b842f75b --- /dev/null +++ b/keyboards/keebio/iris/keymaps/default/keymap.c @@ -0,0 +1,114 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_RALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PGUP, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGDN, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_DEL, _______, KC_LEFT, KC_RGHT, KC_UP, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_HOME, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + BL_STEP, _______, _______, _______, KC_DOWN, KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_END, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_DEL, KC_DEL, _______, KC_P0 + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_TOG, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_MOD, KC_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, KC_PGDN, KC_MINS, KC_LPRN, _______, KC_PLUS, KC_END, RGB_HUD, RGB_SAD, RGB_VAD, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/default/rules.mk b/keyboards/keebio/iris/keymaps/default/rules.mk similarity index 100% rename from keyboards/iris/keymaps/default/rules.mk rename to keyboards/keebio/iris/keymaps/default/rules.mk diff --git a/keyboards/keebio/iris/keymaps/drashna/config.h b/keyboards/keebio/iris/keymaps/drashna/config.h new file mode 100644 index 00000000000..ee8ac8aff8b --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna/config.h @@ -0,0 +1,76 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#ifdef RGBLIGHT_ENABLE +# undef RGBLED_NUM +# define RGBLED_NUM 18 // Number of LEDs +# undef RGBLED_SPLIT +# define RGBLED_SPLIT { 9, 9 } +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 + +# define RGBLIGHT_LIMIT_VAL 225 +#endif // RGBLIGHT_ENABLE + +#ifdef AUDIO_ENABLE +# define C6_AUDIO +# ifdef RGBLIGHT_ENABLE +# define NO_MUSIC_MODE +# endif // RGBLIGHT_ENABLE +#endif // AUDIO_ENABLE + +#ifndef KEYBOARD_keebio_iris_rev3 +# define QMK_ESC_OUTPUT F6 // usually COL +# define QMK_ESC_INPUT D7 // usually ROW +# define QMK_LED B0 +# define QMK_SPEAKER C6 +#endif + +#undef PRODUCT +#ifdef KEYBOARD_keebio_iris_rev2 +# define PRODUCT Drashna Hacked Iris Rev .2 +#elif defined(KEYBOARD_keebio_iris_rev3) +# define PRODUCT Drashna Hacked Iris Rev .3 +#endif + +#define SHFT_LED1 6 +#define SHFT_LED2 11 + +#define CTRL_LED1 7 +#define CTRL_LED2 10 + +#define ALT_LED1 8 +#define GUI_LED1 9 + +#define BOOTMAGIC_LITE_ROW 4 +#define BOOTMAGIC_LITE_COLUMN 3 diff --git a/keyboards/keebio/iris/keymaps/drashna/keymap.c b/keyboards/keebio/iris/keymaps/drashna/keymap.c new file mode 100644 index 00000000000..fe10cb27510 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna/keymap.c @@ -0,0 +1,133 @@ + +#include QMK_KEYBOARD_H +#include "drashna.h" + +// clang-format off +#define LAYOUT_iris_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ + KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ + KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ + KC_GRV, KC_SPC, LT(_LOWER,KC_BSPC), LT(_RAISE,KC_DEL), KC_ENT, RAISE \ + ) +#define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_iris_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + + [_COLEMAK] = LAYOUT_iris_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DVORAK] = LAYOUT_iris_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + [_WORKMAN] = LAYOUT_iris_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), + + [_NORMAN] = LAYOUT_iris_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_iris_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_iris_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_iris_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + + [_MODS] = LAYOUT_wrapper( + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, KC_RSFT, + _______, _______, _______, _______, _______, _______ + ), + + [_GAMEPAD] = LAYOUT_wrapper( + KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_P, _______, _______, _______, _______, _______, _______, + KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, + KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, + KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, TG_GAME, _______, _______, _______, _______, _______, _______, _______, + LOWER, KC_V, KC_SPC, _______, _______, _______ + ), + + + [_LOWER] = LAYOUT_wrapper( + KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, + KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, _______, + _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_PIPE, + _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT_wrapper( + KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT_wrapper( + KC_MAKE, _______, _______, _______, _______, _______, _________________ADJUST_R1_________________, KC_RST, + VRSN, _________________ADJUST_L1_________________, KC_NUKE, _______, _______, _______, _______, EEP_RST, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, + _______, _________________ADJUST_L3_________________, TG_GAME, _______, _________________ADJUST_R3_________________, KC_MPLY, + _______, _______, _______, _______, _______, _______ + ) + +}; +// clang-format on + +void matrix_init_keymap(void) { +#ifndef CONVERT_TO_PROTON_C + setPinOutput(D5); + writePinHigh(D5); + + setPinOutput(B0); + writePinHigh(B0); +#endif +} + +void keyboard_post_init_keymap(void) { +#if BACKLIGHT_ENABLE + backlight_enable(); + backlight_level(5); +# ifdef BACKLIGHT_BREATHING + breathing_enable(); +# endif +#endif +} diff --git a/keyboards/keebio/iris/keymaps/drashna/rules.mk b/keyboards/keebio/iris/keymaps/drashna/rules.mk new file mode 100644 index 00000000000..17acd32be05 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna/rules.mk @@ -0,0 +1,19 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +TAP_DANCE_ENABLE = no +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = yes +NKRO_ENABLE = yes +BACKLIGHT_ENABLE = no +SWAP_HANDS_ENABLE = no +SPACE_CADET_ENABLE = no + +INDICATOR_LIGHTS = no +MACROS_ENABLED = no +RGBLIGHT_TWINKLE = no +RGBLIGHT_STARTUP_ANIMATION = no + +BOOTLOADER = qmk-dfu diff --git a/keyboards/keebio/iris/keymaps/drashna_lp/config.h b/keyboards/keebio/iris/keymaps/drashna_lp/config.h new file mode 100644 index 00000000000..d59890b46a3 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna_lp/config.h @@ -0,0 +1,48 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +#include "../drashna/config.h" + +#ifdef RGBLIGHT_ENABLE +# undef RGBLED_NUM +# define RGBLED_NUM 16 // Number of LEDs +# undef RGBLED_SPLIT +# define RGBLED_SPLIT { 8, 8 } +#endif + +#undef PRODUCT +#ifdef KEYBOARD_keebio_iris_rev2 +# define PRODUCT Drashna Hacked Iris LP Rev.2 (Backlit) +#endif + +#undef SHFT_LED1 +#define SHFT_LED1 5 +#undef SHFT_LED2 +#define SHFT_LED2 10 + +#undef CTRL_LED1 +#define CTRL_LED1 6 +#undef CTRL_LED2 +#define CTRL_LED2 9 + +#undef ALT_LED1 +#define ALT_LED1 7 +#undef GUI_LED1 +#define GUI_LED1 8 diff --git a/keyboards/iris/keymaps/drashna_old/keymap.c b/keyboards/keebio/iris/keymaps/drashna_lp/keymap.c similarity index 100% rename from keyboards/iris/keymaps/drashna_old/keymap.c rename to keyboards/keebio/iris/keymaps/drashna_lp/keymap.c diff --git a/keyboards/keebio/iris/keymaps/drashna_lp/rules.mk b/keyboards/keebio/iris/keymaps/drashna_lp/rules.mk new file mode 100644 index 00000000000..d3f6f5550f9 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna_lp/rules.mk @@ -0,0 +1,7 @@ +USER_NAME := drashna +SRC += ../drashna/keymap.c + +include $(KEYBOARD_PATH_2)/keymaps/drashna/rules.mk + +AUDIO_ENABLE = no +BACKLIGHT_ENABLE = yes diff --git a/keyboards/keebio/iris/keymaps/drashna_old/config.h b/keyboards/keebio/iris/keymaps/drashna_old/config.h new file mode 100644 index 00000000000..5adf014e356 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna_old/config.h @@ -0,0 +1,48 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +#include "../drashna/config.h" + +#ifdef RGBLIGHT_ENABLE +# undef RGBLED_NUM +# define RGBLED_NUM 16 // Number of LEDs +# undef RGBLED_SPLIT +# define RGBLED_SPLIT { 8, 8 } +#endif + +#undef PRODUCT +#ifdef KEYBOARD_keebio_iris_rev2 +# define PRODUCT Drashna Hacked Iris Rev.2 (16 LED) +#endif + +#undef SHFT_LED1 +#define SHFT_LED1 5 +#undef SHFT_LED2 +#define SHFT_LED2 10 + +#undef CTRL_LED1 +#define CTRL_LED1 6 +#undef CTRL_LED2 +#define CTRL_LED2 9 + +#undef ALT_LED1 +#define ALT_LED1 7 +#undef GUI_LED1 +#define GUI_LED1 8 diff --git a/keyboards/keebio/iris/keymaps/drashna_old/keymap.c b/keyboards/keebio/iris/keymaps/drashna_old/keymap.c new file mode 100644 index 00000000000..ff7bd09c0cf --- /dev/null +++ b/keyboards/keebio/iris/keymaps/drashna_old/keymap.c @@ -0,0 +1 @@ +// placeholder diff --git a/keyboards/iris/keymaps/drashna_old/rules.mk b/keyboards/keebio/iris/keymaps/drashna_old/rules.mk similarity index 100% rename from keyboards/iris/keymaps/drashna_old/rules.mk rename to keyboards/keebio/iris/keymaps/drashna_old/rules.mk diff --git a/keyboards/iris/keymaps/dvp-zjpxshade/config.h b/keyboards/keebio/iris/keymaps/dvp-zjpxshade/config.h similarity index 100% rename from keyboards/iris/keymaps/dvp-zjpxshade/config.h rename to keyboards/keebio/iris/keymaps/dvp-zjpxshade/config.h diff --git a/keyboards/keebio/iris/keymaps/dvp-zjpxshade/keymap.c b/keyboards/keebio/iris/keymaps/dvp-zjpxshade/keymap.c new file mode 100644 index 00000000000..12ac00cd789 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/dvp-zjpxshade/keymap.c @@ -0,0 +1,138 @@ +#include "iris.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , ,COMM,DOT , P , Y , F , G , C , R , L ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, A , O , E , U , I , D , H , T , N , S ,INS , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LCTL,QUOT, Q , J , K , X ,HOME, END , B , M , W , V , Z ,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,ENT , SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S, , , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DEL , DEL , , P0 + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,DBUG,RHUD,RSAD,RVAD, , , , , , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S,RST , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/dvp-zjpxshade/rules.mk b/keyboards/keebio/iris/keymaps/dvp-zjpxshade/rules.mk new file mode 100644 index 00000000000..73142a16803 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/dvp-zjpxshade/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + diff --git a/keyboards/keebio/iris/keymaps/edvorakjp/config.h b/keyboards/keebio/iris/keymaps/edvorakjp/config.h new file mode 100644 index 00000000000..954d0d3b99a --- /dev/null +++ b/keyboards/keebio/iris/keymaps/edvorakjp/config.h @@ -0,0 +1,26 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SWAP_SCLN +#define TAPPING_TERM 300 +#define IGNORE_MOD_TAP_INTERRUPT + +#undef RGBLED_NUM +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLED_NUM 10 +#define RGBLIGHT_LIMIT_VAL 100 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif // CONFIG_USER_H diff --git a/keyboards/keebio/iris/keymaps/edvorakjp/keymap.c b/keyboards/keebio/iris/keymaps/edvorakjp/keymap.c new file mode 100644 index 00000000000..be287390dd5 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/edvorakjp/keymap.c @@ -0,0 +1,85 @@ +#include QMK_KEYBOARD_H +#include "edvorakjp.h" + +/* + * enum custom_keycodes { + * KC_LOCK = NEW_SAFE_RANGE, + * }; + */ + +#define KC_ KC_TRNS + +#define KC_TMB1 KC_LA(TAB) +#define KC_TMB2 KC_LS(SPC) +#define KC_TMB3 TD(TD_LOWER) // act as LOWER when hold, as KC_LANG2(=English) when tapped +#define KC_TMB4 TD(TD_RAISE) // act as RAISE when hold, as KC_LANG1(=Japanese) when tapped +#define KC_TMB5 KC_RC(BSPC) +#define KC_TMB6 KC_RG(ENT) +#define KC_TMB7 KC_RC(DEL) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_EDVORAK] = LAYOUT_kc( + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + GRV ,EXLM, AT ,HASH , DLR ,PERC, CIRC,AMPR ,ASTR ,LPRN ,RPRN,BSPC, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + TAB ,QUOT,COMM , DOT , Y , Q , F , G , R , W , P ,BSLS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + EQL , A ,LA(O),LG(E),LC(I), U , D ,RS(T),RG(N),RA(S), M ,MINS, + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + ESC ,SCLN, X , C , V , Z , NO , NO , H , J , K , L , B ,SLSH, + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' + TMB1,TMB2,TMB3, TMB4,TMB5,TMB6 + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+------+------+------+----. ,----+------+------+-------+----+----. + , , , , , , , , , , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + , , LCBR , LBRC , LPRN , , , RPRN , RBRC , RCBR , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + F1 , F2 ,LA(F3),LG(F4),LC(F5), F6 , F7 ,RS(F8),RG(F9),RA(F10),F11 ,F12 , + //|----+----+------+------+------+----+----. ,----+----+------+------+-------+----+----| + PSCR, , HOME , PGDN , PGUP ,END , , ,LEFT, DOWN , UP , RGHT , , , + //`----+----+------+------+------+----+----/ \----+----+------+------+-------+----+----' + , , NO , MAC ,TMB7, + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + , , , , , , , , , , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , ,EXLM , AT ,HASH ,DLR , PERC,CIRC ,AMPR ,ASTR , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , 1 ,LA(2),LG(3),LC(4), 5 , 6 ,RS(7),RG(8),RA(9), 0 , , + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + PSCR, ,HOME ,PGDN ,PGUP ,END , , ,LEFT,DOWN , UP ,RGHT , , , + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' + , ,WIN , NO , , + // `----+----+----' `----+----+----' + ) +}; + +void matrix_init_keymap() { +} + +#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT +uint32_t layer_state_set_keymap(uint32_t state) { + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + switch (biton32(state)) { + case _LOWER: + rgblight_sethsv_noeeprom_red(); + break; + case _RAISE: + rgblight_sethsv_noeeprom_blue(); + break; + default: // for any other layers, or the default layer + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3); + get_japanese_mode() ? rgblight_sethsv_noeeprom_red() : rgblight_sethsv_noeeprom_green(); + break; + } + return state; +} +#endif diff --git a/keyboards/keebio/iris/keymaps/edvorakjp/readme.md b/keyboards/keebio/iris/keymaps/edvorakjp/readme.md new file mode 100644 index 00000000000..dd406523d24 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/edvorakjp/readme.md @@ -0,0 +1,21 @@ +# edvorakjp + +Epaew's Enhanced Dvorak layout for Japanese Programmer +see [here](/users/edvorakjp) for more informations. + +## License + +Copyright 2018 Ryo Maeda epaew.333@gmail.com @epaew + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/keyboards/keebio/iris/keymaps/edvorakjp/rules.mk b/keyboards/keebio/iris/keymaps/edvorakjp/rules.mk new file mode 100644 index 00000000000..4ee94a9832e --- /dev/null +++ b/keyboards/keebio/iris/keymaps/edvorakjp/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes diff --git a/keyboards/iris/keymaps/fabian/config.h b/keyboards/keebio/iris/keymaps/fabian/config.h similarity index 100% rename from keyboards/iris/keymaps/fabian/config.h rename to keyboards/keebio/iris/keymaps/fabian/config.h diff --git a/keyboards/keebio/iris/keymaps/fabian/keymap.c b/keyboards/keebio/iris/keymaps/fabian/keymap.c new file mode 100644 index 00000000000..d7d98fdc06b --- /dev/null +++ b/keyboards/keebio/iris/keymaps/fabian/keymap.c @@ -0,0 +1,179 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum custom_layers { + _COLEMAK, + _QWERTY, + _LOWER, + _RAISE, + _MOUSECURSOR, + _ADJUST, +}; + +enum custom_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY, + LOWER, + RAISE, + MOUSECURSOR, + ADJUST, + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +#define KC_ KC_TRNS + +#define KC_COLE COLEMAK +#define KC_LOWR LOWER +#define KC_QWER QWERTY +#define KC_RASE RAISE +#define KC_RECB DYN_REC_START1 +#define KC_RECE DYN_REC_STOP +#define KC_RECP DYN_MACRO_PLAY1 +#define KC_RSET RESET + +#define KC_CTLE CTL_T(KC_ESC) // Tap for Escape, hold for Control +#define KC_HTAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) +#define KC_SBSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift +#define KC_SENT KC_SFTENT // Tap for Enter, hold for Shift +#define KC_TGMC TG(_MOUSECURSOR) // Toggle MOUSECURSOR layer +#define KC_SPMC LT(_MOUSECURSOR, KC_SPC) // Tap for Space, hold for MOUSECURSOR layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + MEH , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,TGMC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + HTAB, Q , W , E , R , T , Y , U , I , O , P ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CTLE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + SBSP, Z , X , C , V , B ,LALT, RALT, N , M ,COMM,DOT ,SLSH,SENT, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,SPMC, HTAB,RASE,RGUI + // `----+----+----' `----+----+----' + ), + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + MEH , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,TGMC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + HTAB, Q , W , F , P , G , J , L , U , Y ,SCLN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CTLE, A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + SBSP, Z , X , C , V , B ,LALT, RALT, K , M ,COMM,DOT ,SLSH,SENT, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,SPMC, HTAB,RASE,RGUI + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + GRV , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , , ,F12 ,MS_L,MS_D,MS_U,MS_R,BTN1, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TILD, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + GRV , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , , ,F12 ,LEFT,DOWN, UP ,RGHT,BTN2, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_MOUSECURSOR] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , UP , , , WH_D,WH_R,MS_U,ACL0,ACL1,ACL2, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , ,LEFT,DOWN,RGHT, , WH_L,MS_L,MS_D,MS_R,BTN1,BTN2, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , ,WH_U,LEFT,DOWN, UP ,RGHT,BTN3, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RSET, , , , , , , , ,RSET, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , ,QWER,COLE, , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , ,RECB,RECE,RECP,CAPS, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; + } diff --git a/keyboards/iris/keymaps/fate/config.h b/keyboards/keebio/iris/keymaps/fate/config.h similarity index 100% rename from keyboards/iris/keymaps/fate/config.h rename to keyboards/keebio/iris/keymaps/fate/config.h diff --git a/keyboards/keebio/iris/keymaps/fate/keymap.c b/keyboards/keebio/iris/keymaps/fate/keymap.c new file mode 100644 index 00000000000..0e21944c797 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/fate/keymap.c @@ -0,0 +1,125 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum iris_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _NUMPAD +}; + +// Tap Dance Declarations +enum { + TD_LALT_LGUI = 0, + TD_RALT_RGUI +}; + +#define KC_ KC_TRNS + +#define KC_LOWR MO(_LOWER) +#define KC_RASE MO(_RAISE) +#define KC_NUM TG(_NUMPAD) +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_BL_S BL_STEP +#define KC_RTOG RGB_TOG +#define KC_RMD RGB_MOD +#define KC_RRMD RGB_RMOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +#define KC_LAG TD(TD_LALT_LGUI) +#define KC_RAG TD(TD_RALT_RGUI) +#define KC_RSEN MT(MOD_RSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,ENT , ENT , N , M ,COMM,DOT ,SLSH,RSEN, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LAG ,LOWR,SPC , SPC ,RASE,RAG + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CAPS, ,HOME, UP ,END ,PGUP, LEFT,DOWN, UP ,RGHT,INS ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,TILD,LEFT,DOWN,RGHT,PGDN, ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,MPLY,MPRV,MNXT,VOLD,VOLU, , ,HOME,PGDN,PGUP,END ,APP , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CAPS, ,BTN1,MS_U,BTN2,WH_U, LEFT,DOWN, UP ,RGHT,INS ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,GRV ,MS_L,MS_D,MS_R,WH_D, ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,MPLY,MPRV,MNXT,VOLD,VOLU, , ,HOME,PGDN,PGUP,END ,APP , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RMD ,RHUI,RSAI,RVAI,RTOG, ,PSCR,SLCK,PAUS, , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RRMD,RHUD,RSAD,RVAD,BL_S, LEFT,DOWN, UP ,RGHT, , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,DBUG, , , ,RST ,NUM , NUM ,HOME,PGDN,PGUP,END ,APP , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_NUMPAD] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , NLCK, P7 , P8 , P9 ,PSLS, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , P4 , P5 , P6 ,PAST, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , P1 , P2 , P3 ,PPLS,ENT , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , P0 , P0 ,PDOT,PMNS, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +// Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + // Tap once for L-Alt, twice for L-GUI + [TD_LALT_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_LGUI), + // Tap once for R-Alt, twice for R-GUI + [TD_RALT_RGUI] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_RGUI) +}; diff --git a/keyboards/iris/keymaps/fate/readme.md b/keyboards/keebio/iris/keymaps/fate/readme.md similarity index 100% rename from keyboards/iris/keymaps/fate/readme.md rename to keyboards/keebio/iris/keymaps/fate/readme.md diff --git a/keyboards/iris/keymaps/fate/rules.mk b/keyboards/keebio/iris/keymaps/fate/rules.mk similarity index 100% rename from keyboards/iris/keymaps/fate/rules.mk rename to keyboards/keebio/iris/keymaps/fate/rules.mk diff --git a/keyboards/iris/keymaps/gsigler/config.h b/keyboards/keebio/iris/keymaps/gsigler/config.h similarity index 100% rename from keyboards/iris/keymaps/gsigler/config.h rename to keyboards/keebio/iris/keymaps/gsigler/config.h diff --git a/keyboards/iris/keymaps/gsigler/keymap.c b/keyboards/keebio/iris/keymaps/gsigler/keymap.c similarity index 100% rename from keyboards/iris/keymaps/gsigler/keymap.c rename to keyboards/keebio/iris/keymaps/gsigler/keymap.c diff --git a/keyboards/iris/keymaps/gsigler/rules.mk b/keyboards/keebio/iris/keymaps/gsigler/rules.mk similarity index 100% rename from keyboards/iris/keymaps/gsigler/rules.mk rename to keyboards/keebio/iris/keymaps/gsigler/rules.mk diff --git a/keyboards/iris/keymaps/hag/config.h b/keyboards/keebio/iris/keymaps/hag/config.h similarity index 100% rename from keyboards/iris/keymaps/hag/config.h rename to keyboards/keebio/iris/keymaps/hag/config.h diff --git a/keyboards/keebio/iris/keymaps/hag/keymap.c b/keyboards/keebio/iris/keymaps/hag/keymap.c new file mode 100644 index 00000000000..222b68208f7 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/hag/keymap.c @@ -0,0 +1,295 @@ +#include "iris.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + + +//Heavily modified keymap. Some features: +//Multiple layouts, I use dvorak as main. +//Nordic(swedish) signs +//Symbols, numpad, arrows/navigation reachable under the alpas via the layers +//Mirrored ctl, alt and shift to be able to use both hands when doing commands +//Gaming layer, qwerty with space on left half. + +#define _QWERTY 2 +#define _DVORAK 0 +#define _COLEMAK 1 +#define _WORKMAN 3 +#define _GAMING 4 +#define _NUMPAD 5 +#define _LOWER 6 +#define _RAISE 7 + +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + COLEMAK, + WORKMAN, + GAMING, + NUMPAD, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_Sw2 RALT(KC_2) // Nordic @ +#define KC_Sw3 RALT(KC_3) // Nordic something +#define KC_Sw4 RALT(KC_4) // Nordic something +#define KC_Sw5 RALT(KC_5) // Nordic something +#define KC_Sw6 RALT(KC_6) // ... +#define KC_Sw7 RALT(KC_7) +#define KC_Sw8 RALT(KC_8) +#define KC_Sw9 RALT(KC_9) +#define KC_Sw0 RALT(KC_0) +#define KC_Tild RALT(KC_RBRC) +#define KC_Bsls RALT(KC_MINS) +#define KC_Bar RALT(KC_NUBS) +#define KC_Less S(KC_NUBS) +#define KC_CATDEL LCTL(LALT(KC_DEL)) // Ctrl alt del +#define KC_TSKMGR LCTL(S(KC_ESC)) // Ctrl shift esc +#define KC_NUMP TG(_NUMPAD) // Toggle layer NUMPAD for use in LAYOUT_kc +#define KC_Close RALT(KC_F4) // Alt F4 +#define KC_Great S(KC_NUBS) +#define KC_MEH1 MEH(KC_1) +#define KC_MEH2 MEH(KC_2) +#define KC_MEH3 MEH(KC_3) +#define KC_MEH4 MEH(KC_4) +#define KC_MEH5 MEH(KC_5) + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,NUMP, ENT , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_GAMING] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,RCTL, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B , Y , ENT , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,SPC, BSPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_DVORAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP ,VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB ,LBRC,QUOT,SCLN, P , Y , F , G , C , R , L ,DEL, + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + LCTL, A , O , E , U , I , D , H , T , N , S ,RCTL, + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + LSFT,DOT , Q , J , K , X ,NUMP, ENT , B , M , W , V , Z ,RSFT, + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , F , P , G , J , L , U , Y ,LBRC,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , R , S , T , D , H , N , E , I , O ,SCLN, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,NUMP, ENT , K , M ,COMM, DOT,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + +[_WORKMAN] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , R , W , B , J , F , U , P ,LBRC,SCLN, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , H , T , G , Y , N , E , O , I ,RCTL, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , M , C , V ,NUMP, ENT , K , L ,QUOT, DOT,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_NUMPAD] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MEH1,BTN2,MS_U,BTN1,CATDEL, PIPE, P7 , P8 , P9 ,SLSH, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MEH4,MS_L,MS_D,MS_R,TSKMGR, COMM, P4 , P5 , P6 ,MINS, , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,MEH5,ACL0,ACL1,ACL2,MEH3, , PENT,DOT , P1 , P2 , P3 , P0 , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, , P0 ,NLCK + // `----+----+----' `----+----+----' + ), + + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,CAPS,PGUP, UP ,PGDN, ESC, RCBR,EXLM,ASTR,LPRN,UNDS, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,HOME,LEFT,DOWN,RGHT, END, RPRN,QUES,Sw8 ,Sw9 ,LABK, , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , ENT, , , , DEL, , ,RABK,NUBS,Sw7 ,Sw0 ,Great, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM,GRV ,EQL, DLR ,PERC, Sw3 ,Sw5 ,Sw6 ,Sw0 ,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,Bar ,Sw2 ,HASH, AT ,PERC, PIPE, 7 , 8 , 9 ,PMNS,PSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,Bsls,Tild,SLSH,AMPR,BSLS, COMM, 4 , 5 , 6 ,PPLS,PAST, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,PIPE,Sw4 ,PLUS,CIRC,TILD, , PENT,DOT , 1 , 2 , 3 , 0 ,PEQL, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DEL , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + GAMING , DVORAK, WORKMAN, COLEMAK, QWERTY , KC_RST, _______, _______, _______, _______, KC_PWR, RESET, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______,LGUI(KC_UP),_______,LALT(KC_F4), _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______,LGUI(KC_LEFT),LGUI(KC_DOWN),LGUI(KC_RGHT),_______, _______, DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, BL_STEP, + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case NUMPAD: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_NUMPAD); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case WORKMAN: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_WORKMAN); + } + return false; + break; + case GAMING: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_GAMING); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/hag/rules.mk b/keyboards/keebio/iris/keymaps/hag/rules.mk new file mode 100644 index 00000000000..73142a16803 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/hag/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + diff --git a/keyboards/keebio/iris/keymaps/hexwire/config.h b/keyboards/keebio/iris/keymaps/hexwire/config.h new file mode 100644 index 00000000000..8166822d93f --- /dev/null +++ b/keyboards/keebio/iris/keymaps/hexwire/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +#define USE_I2C + +/* Select hand configuration */ +// #define MASTER_RIGHT +// #define EE_HANDS + +#define TAPPING_TERM 150 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif diff --git a/keyboards/keebio/iris/keymaps/hexwire/keymap.c b/keyboards/keebio/iris/keymaps/hexwire/keymap.c new file mode 100644 index 00000000000..33105c1c86a --- /dev/null +++ b/keyboards/keebio/iris/keymaps/hexwire/keymap.c @@ -0,0 +1,142 @@ +#include "iris.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen +#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen +#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen +#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen +#define KC_ESCC MT(MOD_LCTL, KC_ESC) +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP +#define KC_ENTS MT(MOD_LSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ESCC, A , S , D , F , G , H , J , K , L ,SCLN,ENTS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,SPC , LCTL, N , M ,COMM,DOT ,SLSH,ENTS, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,SPC , BSPC,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S,CPYP, , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DEL , DEL , , P0 + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/hexwire/rules.mk b/keyboards/keebio/iris/keymaps/hexwire/rules.mk new file mode 100644 index 00000000000..73142a16803 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/hexwire/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + diff --git a/keyboards/iris/keymaps/impstyle/README.md b/keyboards/keebio/iris/keymaps/impstyle/README.md similarity index 100% rename from keyboards/iris/keymaps/impstyle/README.md rename to keyboards/keebio/iris/keymaps/impstyle/README.md diff --git a/keyboards/iris/keymaps/impstyle/config.h b/keyboards/keebio/iris/keymaps/impstyle/config.h similarity index 100% rename from keyboards/iris/keymaps/impstyle/config.h rename to keyboards/keebio/iris/keymaps/impstyle/config.h diff --git a/keyboards/keebio/iris/keymaps/impstyle/keymap.c b/keyboards/keebio/iris/keymaps/impstyle/keymap.c new file mode 100644 index 00000000000..c1964f5e1ae --- /dev/null +++ b/keyboards/keebio/iris/keymaps/impstyle/keymap.c @@ -0,0 +1,110 @@ +// iris qwerty layout with mouse layer. +// double tab to toggle is not working atm + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _MOUSE 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + MOUSE, +}; + +#define KC_ KC_TRNS +#define KC_LOWR MO(_LOWER) // Lower layer +#define KC_RASE MO(_RAISE) // Raise layer +#define KC_TGLW TG(_LOWER) // toggle lower +#define KC_TGRS TG(_RAISE) // toggle raise +#define KC_MOUS TT(_MOUSE) // double tab toggle mouse layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // QUERTY LAYER + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + // ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + // TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + // LSFT, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // LCTL, Z , X , C , V , B ,PLUS , MOUS , N , M ,COMM,DOT ,SLSH,BSLASH, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // LGUI,RASE,SPC , ENT ,LOWR,LALT + // `----+----+----' `----+----+----' + + [_QWERTY] = LAYOUT( + KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, + KC_TAB , KC_Q , KC_W ,KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, + KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, + KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_PLUS, KC_MOUS,KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH, + KC_LGUI,KC_RASE,KC_SPC , KC_ENT ,KC_LOWR,KC_LALT + ), + + // LOWER Layer + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + // TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + // , , , , ,LBRC, RBRC, P7 , P8 , P9 , ,PLUS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + // ,HOME,PGUP,PGDN,END,LPRN, RPRN, P4 , P5 , P6 ,MINS,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // , , , , , , , , , P1 , P2 , P3 ,EQL ,UNDS , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // , ,DEL , BSPC , , P0 + // `----+----+----' `----+----+----' + + [_LOWER] = LAYOUT( + KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS, + _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE, + _______,_______,_______,_______,_______,_______,_______, _______,_______, KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS , + _______ ,_______,KC_PSCR , _______,_______, KC_P0 +), + // RAISE LAYER + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + // F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + // , , , , ,LBRC, RBRC, ,NLCK,INS ,SLCK,MUTE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + // ,LEFT,UP ,DOWN,RGHT,LPRN, RPRN,MPRV,MPLY,MNXT, ,VOLU, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // , , , , , , , PLUS , , , , , ,VOLD, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // , , , EQL, , + // `----+----+----' `----+----+----' + + [_RAISE] = LAYOUT( + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE, + _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,KC_VOLD, + _______ ,_______,_______, KC_EQL ,_______,_______ + ), + // MOUSE LAYER + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + // , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + // , , , , , , MS_WH_UP, , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + // ,,MS_LEFT,MS_UP,MS_DOWN,MS_RGHT,, MS_WH_DN,MS_BT1,MS_BT2,MS_BT3, , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // , , , , , , , , , , ,MS_ACC0,MS_ACC1MS_ACC2 + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // , , , , , + // `----+----+----' `----+----+----' + [_MOUSE] = LAYOUT( + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______,_______, KC_MS_WH_UP,_______,_______,_______,_______,_______, + _______,KC_MS_LEFT,KC_MS_UP,KC_MS_DOWN,KC_MS_RIGHT,_______, KC_MS_WH_DOWN,KC_MS_BTN1,KC_MS_BTN2,KC_MS_BTN3,_______,_______, + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2, + _______,_______,_______, _______,_______,_______ + ), + +}; diff --git a/keyboards/keebio/iris/keymaps/impstyle/rules.mk b/keyboards/keebio/iris/keymaps/impstyle/rules.mk new file mode 100644 index 00000000000..ef4a383d31c --- /dev/null +++ b/keyboards/keebio/iris/keymaps/impstyle/rules.mk @@ -0,0 +1,5 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no +TAP_DANCE_ENABLE = no +MOUSEKEY_ENABLE = yes + diff --git a/keyboards/iris/keymaps/default/config.h b/keyboards/keebio/iris/keymaps/isolike/config.h similarity index 100% rename from keyboards/iris/keymaps/default/config.h rename to keyboards/keebio/iris/keymaps/isolike/config.h diff --git a/keyboards/keebio/iris/keymaps/isolike/keymap.c b/keyboards/keebio/iris/keymaps/isolike/keymap.c new file mode 100644 index 00000000000..912be5e3902 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/isolike/keymap.c @@ -0,0 +1,42 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _RAISE 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + RAISE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_NUBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT, KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LCTL, MO(_RAISE),KC_SPC, KC_SPC, MO(_RAISE),KC_LALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_INS, KC_HOME, KC_UP, KC_END, _______, KC_PGUP, KC_WH_U, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_PGDN, KC_WH_D, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_NUHS, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, KC_LCTL, KC_LALT, KC_RALT, KC_RGUI, KC_RCTL, KC_GRV, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LGUI, _______, _______, _______, _______, KC_APP + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; diff --git a/keyboards/keebio/iris/keymaps/isolike/readme.md b/keyboards/keebio/iris/keymaps/isolike/readme.md new file mode 100644 index 00000000000..6e8244a0f25 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/isolike/readme.md @@ -0,0 +1,5 @@ +# isolike keymap + +Modelled on the ISO keyboard layout. Key positions should feel quite familiar to +ISO layout users. There is only two layers. The space, enter and raise keys are +mirrored on both hands to make it easier to remember and type on. diff --git a/keyboards/keebio/iris/keymaps/isolike/rules.mk b/keyboards/keebio/iris/keymaps/isolike/rules.mk new file mode 100644 index 00000000000..1d2d9e5a9c4 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/isolike/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no diff --git a/keyboards/keebio/iris/keymaps/jasondunsmore/config.h b/keyboards/keebio/iris/keymaps/jasondunsmore/config.h new file mode 100644 index 00000000000..8aa4be367f3 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/jasondunsmore/config.h @@ -0,0 +1,27 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT + +#define TAPPING_TERM 200 diff --git a/keyboards/keebio/iris/keymaps/jasondunsmore/keymap.c b/keyboards/keebio/iris/keymaps/jasondunsmore/keymap.c new file mode 100644 index 00000000000..5f930766313 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/jasondunsmore/keymap.c @@ -0,0 +1,147 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Layers +#define _QWERTY 0 // Base layer +#define _NUMB 1 +#define _NAVI 2 + +// Keys +#define KC_NUMB MO(_NUMB) +#define KC_NAVI MO(_NAVI) +#define KC_AGRV LALT_T(KC_GRAVE) +#define KC_GUIE LGUI_T(KC_ESC) +#define KC_REST RESET +#define KC_DBUG DEBUG + +// Tap Dance Declarations +enum { + TD_LALT_GRV_BSLS = 0, + TD_LSFT_LBRC, + TD_RSFT_RBRC, +}; + +void alt_grave_backslash(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (!state->pressed) { + register_code(KC_GRAVE); + } else { + register_code(KC_LALT); + } + } else if (state->count == 2) { + register_code(KC_BSLASH); + } +} + +void alt_grave_backslash_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code(KC_GRAVE); + unregister_code(KC_LALT); + } else if (state->count == 2) { + unregister_code(KC_BSLASH); + } +} + +void left_brackets(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (!state->pressed) { + register_code(KC_LSFT); + register_code(KC_9); + } else { + register_code(KC_LSFT); + } + } else if (state->count == 2) { + register_code(KC_LBRC); + } +} + +void left_brackets_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code(KC_LSFT); + unregister_code(KC_9); + } else if (state->count == 2) { + unregister_code(KC_LBRC); + } +} + +void right_brackets(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (!state->pressed) { + register_code(KC_RSFT); + register_code(KC_0); + } else { + register_code(KC_RSFT); + } + } else if (state->count == 2) { + register_code(KC_RBRC); + } +} + +void right_brackets_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code(KC_RSFT); + unregister_code(KC_0); + } else if (state->count == 2) { + unregister_code(KC_RBRC); + } +} + + +// Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + // Tap once for KC_SLSH, twice for KC_BSLS + [TD_LALT_GRV_BSLS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, alt_grave_backslash, alt_grave_backslash_reset), + [TD_LSFT_LBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, left_brackets, left_brackets_reset), + [TD_RSFT_RBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, right_brackets, right_brackets_reset) +}; + +// Tap Dance Keys +#define KC_AGRB TD(TD_LALT_GRV_BSLS) +#define KC_LSBK TD(TD_LSFT_LBRC) +#define KC_RSBK TD(TD_RSFT_RBRC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( +//,----+----+----+----+----+----. ,----+----+----+----+----+----. + GUIE, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, +//|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC, +//|----+----+----+----+----+----| |----+----+----+----+----+----| + AGRB, A, S, D, F, G, H, J, K, L, SCLN,QUOT, +//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSBK, Z, X, C, V, B, MINS, EQL, N, M, COMM,DOT, SLSH,RSBK, +//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + NUMB,LCTL,SPC, ENT, RCTL,NAVI +// `----+----+----' `----+----+----' + ), + + [_NUMB] = LAYOUT_kc( +//,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, +//|----+----+----+----+----+----| |----+----+----+----+----+----| + NO, F17, F18, F19, F20, NO, NO, 7, 8, 9, 0, TRNS, +//|----+----+----+----+----+----| |----+----+----+----+----+----| + TRNS,F13, F14, F15, F16, NO, ASTR, 4, 5, 6, PLUS,TRNS, +//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + TRNS,F21, F22, F23, F24, NO, TRNS, TRNS,SLSH, 1, 2, 3, MINS,TRNS, +//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + TRNS,TRNS,TRNS, TRNS,DOT, TRNS +// `----+----+----' `----+----+----' + ), + + [_NAVI] = LAYOUT_kc( +//,----+----+----+----+----+----. ,----+----+----+----+----+----. + PWR, MUTE,VOLD,VOLU,BRID,BRIU, REST,DBUG, NO, NO, NO, TRNS, +//|----+----+----+----+----+----| |----+----+----+----+----+----| + WAKE,HOME,PGUP, UP, PGDN,TRNS, NO, NO, NO, NO, NO, TRNS, +//|----+----+----+----+----+----| |----+----+----+----+----+----| + TRNS,END, LEFT,DOWN,RGHT,TRNS, PAUS,CAPS,PSCR,SLCK,INS, TRNS, +//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, NO, NO, NO, NO, NO, TRNS, +//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + TRNS,TRNS,TRNS, TRNS,TRNS,TRNS +// `----+----+----' `----+----+----' + ) +}; diff --git a/keyboards/keebio/iris/keymaps/jasondunsmore/readme.md b/keyboards/keebio/iris/keymaps/jasondunsmore/readme.md new file mode 100644 index 00000000000..0817b5e9b06 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/jasondunsmore/readme.md @@ -0,0 +1,7 @@ +# jasondunsmore's iris layout + +_QWERTY is the default layer, from which all letters, symbols and +numbers can be accessed. The _NUMB layer contains a numberpad, +operators, and function keys. The _NAVI layer contains navigation +keys, some hardware adjustment keys, lock keys, and RESET/DEBUG for +QMK. diff --git a/keyboards/keebio/iris/keymaps/jasondunsmore/rules.mk b/keyboards/keebio/iris/keymaps/jasondunsmore/rules.mk new file mode 100644 index 00000000000..d58c21f2b91 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/jasondunsmore/rules.mk @@ -0,0 +1,2 @@ +TAP_DANCE_ENABLE = yes +COMMAND_ENABLE = no diff --git a/keyboards/keebio/iris/keymaps/jasonkrasavage/config.h b/keyboards/keebio/iris/keymaps/jasonkrasavage/config.h new file mode 100644 index 00000000000..751acc6437c --- /dev/null +++ b/keyboards/keebio/iris/keymaps/jasonkrasavage/config.h @@ -0,0 +1,25 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C +#define EE_HANDS + +#undef RGBLED_NUM + +#define RGBLED_NUM 12 \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/jasonkrasavage/keymap.c b/keyboards/keebio/iris/keymaps/jasonkrasavage/keymap.c new file mode 100644 index 00000000000..6901d6db8d1 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/jasonkrasavage/keymap.c @@ -0,0 +1,44 @@ +#include QMK_KEYBOARD_H + + +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CAPSLOCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRACKET, KC_RBRACKET, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LALT, KC_LGUI, KC_ENT, MO(_LOWER), KC_SPC, KC_RALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_LPRN, _______, _______, KC_RPRN, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + diff --git a/keyboards/keebio/iris/keymaps/jasonkrasavage/rules.mk b/keyboards/keebio/iris/keymaps/jasonkrasavage/rules.mk new file mode 100644 index 00000000000..7ad666d1a38 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/jasonkrasavage/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/iris/keymaps/jennetters/config.h b/keyboards/keebio/iris/keymaps/jennetters/config.h similarity index 100% rename from keyboards/iris/keymaps/jennetters/config.h rename to keyboards/keebio/iris/keymaps/jennetters/config.h diff --git a/keyboards/keebio/iris/keymaps/jennetters/keymap.c b/keyboards/keebio/iris/keymaps/jennetters/keymap.c new file mode 100644 index 00000000000..c06079c9262 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/jennetters/keymap.c @@ -0,0 +1,206 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + YUNO, + SHRG, + NOVY, +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_YUNO YUNO +#define KC_SHRG SHRG +#define KC_NOVY NOVY +#define KC_RST RESET +#define KC_BL_S BL_STEP + +//Tap Dance Declartaions +enum { + ESC_GR = 0 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + + // ,----+----+----+----+----+----. ,----+----+----+----+----+----. + // | ESC| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | TAB| Q | W | E | R | T | | Y | U | I | O | P | BSP| + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | CAP| A | S | D | F | G | | H | J | K | L | ; | ' | + // |----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // | SFT| Z | X | C | V | B | SPC| | SPC| N | M | , | . | / | ENT| + // `----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // \ GUI| ALT| CTL / \RASE\ CTL | SFT / + // `----+----+----' `----+----+----' + + TD(ESC_GR), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC, KC_SPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LGUI, KC_LALT, KC_LCTL, KC_RASE, KC_RCTL, KC_RSFT + ), + + [_LOWER] = LAYOUT_kc( + + // ,----+----+----+----+----+----. ,----+----+----+----+----+----. + // | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | DEL| + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | | | | | | | | | | | |PIPE| + // |----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // | \ | | | | | [ | ( | | ) | ] | | | | - | | + // `----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // \ | | DEL / \ DEL\ | / + // `----+----+----' `----+----+----' + + TILD, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, DEL, \ + , 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, , \ + , , , , , , , , , , ,PIPE, \ + BL_S, , , , , LCBR, LPRN, RPRN, RCBR, , , , MINS, , \ + , , DEL, DEL, , + ), + + [_RAISE] = LAYOUT_kc( + // ,----+----+----+----+----+----. ,----+----+----+----+----+----. + // | | F1 | F2 | | | | | | | | [ | ] | = | + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | | UP | | | | | | | | { | } | DEL| + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | LT | DN | RT | | | |SHRG| | | |PIPE| | + // |----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // | | | | | | | | | | | | | | \ | | + // `----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // \ | | / \ \ | / + // `----+----+----' `----+----+----' + + , F1, F2, , , , , , , LBRC, RBRC, EQL, \ + , , UP, , , , YUNO, NOVY, , LCBR, RCBR, DEL, \ + , LEFT, DOWN, RIGHT, , , SHRG, , , , PIPE, , \ + , , , , , , , , , , , , BSLS, , \ + , , , , , + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void esc_gr_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_ESC); + } else if (state->count == 2) { + register_code (KC_GRV); + } else { + register_code (KC_LSFT); + register_code (KC_GRV); + } +} + +void esc_gr_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_ESC); + } else if (state->count == 2) { + unregister_code (KC_GRV); + } else { + unregister_code (KC_LSFT); + unregister_code (KC_GRV); + } +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for ESC, twice for `, thrice for ~ + [ESC_GR] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, esc_gr_finished, esc_gr_reset) + // Other declarations would go here, separated by commas, if you have them +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case SHRG: + if (record->event.pressed) { + SEND_STRING("¯\\_(ツ)_/¯"); // I dunno. + return false; + } + /* Ignore for now - special characters not working with macros + } + case NOVY: + if (record->event.pressed) { + SEND_STRING("ლ(ಠ_ಠლ)"); // YUNO?! + return false; + } + */ + } + return true; +} diff --git a/keyboards/iris/keymaps/jennetters/readme.md b/keyboards/keebio/iris/keymaps/jennetters/readme.md similarity index 100% rename from keyboards/iris/keymaps/jennetters/readme.md rename to keyboards/keebio/iris/keymaps/jennetters/readme.md diff --git a/keyboards/iris/keymaps/jennetters/rules.mk b/keyboards/keebio/iris/keymaps/jennetters/rules.mk similarity index 100% rename from keyboards/iris/keymaps/jennetters/rules.mk rename to keyboards/keebio/iris/keymaps/jennetters/rules.mk diff --git a/keyboards/iris/keymaps/khord/config.h b/keyboards/keebio/iris/keymaps/khord/config.h similarity index 100% rename from keyboards/iris/keymaps/khord/config.h rename to keyboards/keebio/iris/keymaps/khord/config.h diff --git a/keyboards/iris/keymaps/khord/keymap.c b/keyboards/keebio/iris/keymaps/khord/keymap.c similarity index 100% rename from keyboards/iris/keymaps/khord/keymap.c rename to keyboards/keebio/iris/keymaps/khord/keymap.c diff --git a/keyboards/iris/keymaps/khord/rules.mk b/keyboards/keebio/iris/keymaps/khord/rules.mk similarity index 100% rename from keyboards/iris/keymaps/khord/rules.mk rename to keyboards/keebio/iris/keymaps/khord/rules.mk diff --git a/keyboards/iris/keymaps/krusli/README.md b/keyboards/keebio/iris/keymaps/krusli/README.md similarity index 100% rename from keyboards/iris/keymaps/krusli/README.md rename to keyboards/keebio/iris/keymaps/krusli/README.md diff --git a/keyboards/iris/keymaps/krusli/config.h b/keyboards/keebio/iris/keymaps/krusli/config.h similarity index 100% rename from keyboards/iris/keymaps/krusli/config.h rename to keyboards/keebio/iris/keymaps/krusli/config.h diff --git a/keyboards/keebio/iris/keymaps/krusli/keymap.c b/keyboards/keebio/iris/keymaps/krusli/keymap.c new file mode 100644 index 00000000000..095716621d1 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/krusli/keymap.c @@ -0,0 +1,96 @@ +#include "iris.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LALT + ), + + [_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + _______, _______, _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + _______, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_HUD, RGB_SAD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, + BL_STEP, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ), +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/krusli/rules.mk b/keyboards/keebio/iris/keymaps/krusli/rules.mk new file mode 100644 index 00000000000..b0e37ec2f4a --- /dev/null +++ b/keyboards/keebio/iris/keymaps/krusli/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no + diff --git a/keyboards/iris/keymaps/lewisridden/config.h b/keyboards/keebio/iris/keymaps/lewisridden/config.h similarity index 100% rename from keyboards/iris/keymaps/lewisridden/config.h rename to keyboards/keebio/iris/keymaps/lewisridden/config.h diff --git a/keyboards/keebio/iris/keymaps/lewisridden/keymap.c b/keyboards/keebio/iris/keymaps/lewisridden/keymap.c new file mode 100644 index 00000000000..e5d12ebd11a --- /dev/null +++ b/keyboards/keebio/iris/keymaps/lewisridden/keymap.c @@ -0,0 +1,136 @@ +#include "iris.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RASE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,SPC , PSCR , N , M ,COMM,DOT ,SLSH,RGHT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LCTL,LOWR,SPC , ENT ,LGUI,LALT + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , ,PGUP, , ,LBRC, RBRC, P7 , P8 , P9 ,PLUS, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,HOME,PGDN,END, ,LPRN, RPRN, P4 , P5 , P6 ,MINS,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , P1 , P2 , P3 ,EQL ,UNDS , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DEL , BSPC , , P0 + // `----+----+----' `----+----+----' + +), + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , UP , , ,LBRC, RBRC, ,NLCK,INS ,SLCK,MUTE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,LEFT,DOWN,RGHT, ,LPRN, RPRN,MPRV,MPLY,MNXT, ,VOLU, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , , , , ,VOLD, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/lewisridden/rules.mk b/keyboards/keebio/iris/keymaps/lewisridden/rules.mk new file mode 100644 index 00000000000..73142a16803 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/lewisridden/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + diff --git a/keyboards/keebio/iris/keymaps/mattly/config.h b/keyboards/keebio/iris/keymaps/mattly/config.h new file mode 100644 index 00000000000..01bb31a6e14 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/mattly/config.h @@ -0,0 +1,28 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C +#define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/iris/keymaps/mattly/keymap.c b/keyboards/keebio/iris/keymaps/mattly/keymap.c new file mode 100644 index 00000000000..4f4ff225ee7 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/mattly/keymap.c @@ -0,0 +1,50 @@ +#include QMK_KEYBOARD_H +#include "mattly.h" + +// extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SCLN, + KC_CAPS, A_CTRL, S_ALT, D_GUI, F_SHFT, KC_G, KC_H, J_SHFT, K_GUI, L_ALT, MINSCTL, KC_QUOT, + XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, SPC_SFT, BSP_NUM, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + ESC_HYP, BSP_NUM, ENT_SFT, SPC_SFT, TAB_SYM, DEL_WRP + ), + + [_SYMBOL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_AMPR, KC_GRV, KC_TILD, KC_LBRC, KC_RBRC, KC_LABK, KC_RABK, KC_PLUS, KC_ASTR, XXXXXXX, _______, + _______, KC_DLR, KC_PERC, KC_EQL, KC_LPRN, KC_RPRN, KC_SCLN, KC_COLN, KC_EXLM, KC_AT, KC_UNDS, _______, + RESET, XXXXXXX, KC_CIRC, KC_HASH, KC_LCBR, KC_RCBR, _______, _______, KC_QUOT, KC_DQUO, KC_PIPE, KC_BSLS, KC_QUES, _______, + _______, _______, _______, _______, _______, _______ + ), + + [_NAVNUM] = LAYOUT( + XNOTIFY, XXXXXXX, XPRVSPC, NWIN, XNXTSPC, XXXXXXX, XXXXXXX, KC_SLSH, KC_ASTR, KC_MINS, KC_PLUS, XXXXXXX, + XALLWIN, NAVFWD, BWORD, KC_UP, FWORD, KC_PGUP, KC_DLR, KC_P7, KC_P8, KC_P9, KC_DOT, XXXXXXX, + XDESKTP, NAVBACK, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_PERC, KC_P4, KC_P5, KC_P6, KC_EQL, XXXXXXX, + RESET, PTAB, KC_HOME, PWIN, KC_END, NTAB, _______, _______, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_ENT, XXXXXXX, + _______, _______, _______, _______, _______, KC_P0 + ), + + [_FUNCT] = LAYOUT( + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + RESET, XALLWIN, XPRVSPC, NWIN, XNXTSPC, XDESKTP, XXXXXXX, RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_K, RESET, + DEBUG, XNOTIFY, PTAB, PWIN, NTAB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, KC_MPLY, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______ + ) +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_MS_WH_UP); + } else { + tap_code(KC_MS_WH_DOWN); + } + } +} + diff --git a/keyboards/keebio/iris/keymaps/mattly/readme.md b/keyboards/keebio/iris/keymaps/mattly/readme.md new file mode 100644 index 00000000000..4e8c7f17c6b --- /dev/null +++ b/keyboards/keebio/iris/keymaps/mattly/readme.md @@ -0,0 +1 @@ +See my readme in [users/mattly](../../../../../users/mattly/readme.md) \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/mattly/rules.mk b/keyboards/keebio/iris/keymaps/mattly/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/keebio/iris/keymaps/moonfall/config.h b/keyboards/keebio/iris/keymaps/moonfall/config.h new file mode 100644 index 00000000000..7986b504162 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/moonfall/config.h @@ -0,0 +1,36 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/iris/keymaps/moonfall/keymap.c b/keyboards/keebio/iris/keymaps/moonfall/keymap.c new file mode 100644 index 00000000000..0b6cde45e8b --- /dev/null +++ b/keyboards/keebio/iris/keymaps/moonfall/keymap.c @@ -0,0 +1,114 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + LOWER, KC_LALT, KC_BSPC, KC_SPC, KC_LGUI, KC_LCTL + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_EQL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_EQL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, KC_UP, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_TILD, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_UP, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, KC_GRV, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_GRV, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_END, KC_PGDN, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_EQL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_EQL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, KC_UP, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_TILD, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_UP, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, KC_GRV, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_GRV, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_END, KC_PGDN, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/moonfall/rules.mk b/keyboards/keebio/iris/keymaps/moonfall/rules.mk new file mode 100644 index 00000000000..db925dd2b6d --- /dev/null +++ b/keyboards/keebio/iris/keymaps/moonfall/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = no diff --git a/keyboards/iris/keymaps/mtdjr/config.h b/keyboards/keebio/iris/keymaps/mtdjr/config.h similarity index 100% rename from keyboards/iris/keymaps/mtdjr/config.h rename to keyboards/keebio/iris/keymaps/mtdjr/config.h diff --git a/keyboards/iris/keymaps/mtdjr/keymap.c b/keyboards/keebio/iris/keymaps/mtdjr/keymap.c similarity index 100% rename from keyboards/iris/keymaps/mtdjr/keymap.c rename to keyboards/keebio/iris/keymaps/mtdjr/keymap.c diff --git a/keyboards/keebio/iris/keymaps/mtdjr/rules.mk b/keyboards/keebio/iris/keymaps/mtdjr/rules.mk new file mode 100644 index 00000000000..7f8c630d8b1 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/mtdjr/rules.mk @@ -0,0 +1,4 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no +#AUDIO_ENABLE = yes + diff --git a/keyboards/keebio/iris/keymaps/nstickney/README.md b/keyboards/keebio/iris/keymaps/nstickney/README.md new file mode 100644 index 00000000000..8124fe1cd69 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/nstickney/README.md @@ -0,0 +1,47 @@ +# nstickney's Iris Layout + + > Familiar layout for users who regularly switch between Iris and more standard layouts. + +[![Keymap](https://i.imgur.com/hKs7fYr.jpg)](http://www.keyboard-layout-editor.com/#/gists/aa6093ea2eb9c750ab941b92adae7036) + +[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme) + +## Install + +For instructions on building and installing this keymap, see the [docs](https://docs.qmk.fm/#/getting_started_make_guide). Below is the command for me; it may be different for you. + +```sh +$ make keebio/iris/rev2:nstickney:avrdude +``` + +## Usage + +0. QWERTY `BASE` layer. + * `/`, `\`, ` `, `[ENTER]`, `-`, and `=` on the thumb clusters. + * `CAPSLOCK` replaced by `ESC`; hold it down for `CTRL`. `'` can also be held for `CTRL`. + * [Space-Cadet Shift](https://docs.qmk.fm/#/feature_space_cadet_shift) is enabled, so the `SHIFT` keys send `(` and `)` when tapped. + * Hold down `/` or `=` for `ALT`. + * Hold down `\` or `-` to access the functions layer. + * Upper-center thumb keys are `GUI` and `MENU`. + * Tapping `GUI` 2, 3, or 4 times will toggle `NUMLOCK`, `CAPSLOCK`, or `SCROLLLOCK`, respectively. + * Tapping `MENU` 2, 3, or 4 times will toggle the `NUMP`, `SYMB`, and `SYSH` layers, respectively. +0. Unicode-input symbols on `SYMB` and `SYSH` layers. Based (loosely) on US-International layout. +0. `NUMP` layer has number pads on each hand. Number pad `7`-`8`-`9` align with QWERTY `7`-`8`-`9` on right hand. +0. Function, arrow, media, and miscellaneous keys on `FCTN` layer. + * `F1` through `F10` on `1`-`10`. `F11` is on `GUI` and `F12` is on `MENU`. + * Brackets (`[` and `]`) available on `U` and `I`; braces (`{` and `}`) on `O` and `P`. + * Arrow keys on `ESDF` and `HJKL`; familiar for both Vim users and FPS gamers. + * `W` is `HOME`; `R` is `END`. `T` is `PAGE UP` and `G` is `PAGE DOWN`. + * Music controls on lower row of left hand. + * Volume and screen brightness on lower row of right hand. + * `PRINT SCREEN`, `PAUSE`, `SYSREQ`, `INSERT`, and `CLEAR` also mapped, as intelligently as possible. + * `A` toggles the RGB underglow (which changes color to indicate active layer). + * `Q` toggles the Unicode input through Linux, WinCompose, and MacOS. + +## Contribute + +If you are using this layout and think you've found a better way to do something, I'd appreciate an [issue](https://github.com/nstickney/qmk_firmware/issues), or better yet a [pull request](https://github.com/nstickney/qmk_firmware/pulls). + +## License + +Copyright © 2016-2019 @nstickney. Released under [GPL-2.0](/LICENSE). diff --git a/keyboards/keebio/iris/keymaps/nstickney/config.h b/keyboards/keebio/iris/keymaps/nstickney/config.h new file mode 100644 index 00000000000..f4899781e50 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/nstickney/config.h @@ -0,0 +1,36 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// #undef RGBLED_NUM +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 12 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/nstickney/keymap.c b/keyboards/keebio/iris/keymaps/nstickney/keymap.c new file mode 100644 index 00000000000..16b2d0de333 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/nstickney/keymap.c @@ -0,0 +1,99 @@ +#include "nstickney.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE] = LAYOUT( +// ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + CC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CC_QUOT, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┐ ┌──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, TD(LOCKS), TD(LAYERS),KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, +// └──────────┴──────────┴──────────┴────┬─────┴────┬─────┴────┬─────┴────┬─────┘ └────┬─────┴────┬─────┴────┬─────┴────┬─────┴──────────┴──────────┴──────────┘ + AC_SLSH, FC_BSLS, KC_SPC, KC_ENT, FC_MINS, AC_EQL +// └──────────┴──────────┴──────────┘ └──────────┴──────────┴──────────┘ + ), + + [SYMB] = LAYOUT( +// ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ + UC(0x00EF),UC(0x00A1),UC(0x00B2),UC(0x00B3),UC(0x00A4),UC(0x20AC), UC(0x00BC),UC(0x00BD),UC(0x00BE),UC(0x2018),UC(0x2019),_______, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, UC(0x00E4),UC(0x00E5),UC(0x00E9),UC(0x00AE),UC(0x00FE), UC(0x00FC),UC(0x00FA),UC(0x00ED),UC(0x00F3),UC(0x00F6),_______, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, UC(0x00E1),UC(0x00DF),UC(0x00F0),UC(0x00EC),UC(0x00ED), UC(0x00EE),UC(0x00E0),UC(0x00E2),UC(0x00F8),UC(0x00B6),UC(0x00B4), +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┐ ┌──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, UC(0x00E6),UC(0x00E8),UC(0x00A9),UC(0x00EA),UC(0x00EB),_______, _______, UC(0x00F1),UC(0x00FD),UC(0x00E7),UC(0x00F4),UC(0x00BF),_______, +// └──────────┴──────────┴──────────┴────┬─────┴────┬─────┴────┬─────┴────┬─────┘ └────┬─────┴────┬─────┴────┬─────┴────┬─────┴──────────┴──────────┴──────────┘ + UC(0x00BF),_______, UC(0x00AC), UC(0x00B1),_______, UC(0x00D7) +// └──────────┴──────────┴──────────┘ └──────────┴──────────┴──────────┘ + ), + + [SYSH] = LAYOUT( +// ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ + UC(0x00CF),UC(0x00B9),UC(0x2200),UC(0x2201),UC(0x00A3),UC(0x00A5), UC(0x00B5),UC(0x00AB),UC(0x00BB),UC(0x201C),UC(0x201D),_______, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, UC(0x00C4),UC(0x00C5),UC(0x00C9),UC(0x2122),UC(0x00DE), UC(0x00DC),UC(0x00DA),UC(0x00CD),UC(0x00D3),UC(0x00D6),_______, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, UC(0x00C1),UC(0x00A7),UC(0x00D0),UC(0x00CC),UC(0x00CD), UC(0x00CE),UC(0x00C1),UC(0x00C2),UC(0x00D8),UC(0x00B0),UC(0x00A8), +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┐ ┌──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, UC(0x00C6),UC(0x00C8),UC(0x00A2),UC(0x00CA),UC(0x00CB),_______, _______, UC(0x00D1),UC(0x00DD),UC(0x00C7),UC(0x00D4),UC(0x203D),_______, +// └──────────┴──────────┴──────────┴────┬─────┴────┬─────┴────┬─────┴────┬─────┘ └────┬─────┴────┬─────┴────┬─────┴────┬─────┴──────────┴──────────┴──────────┘ + UC(0x203D),_______, UC(0x00A6), UC(0x00AA),_______, UC(0x00F7) +// └──────────┴──────────┴──────────┘ └──────────┴──────────┴──────────┘ + ), + + [NUMP] = LAYOUT( +// ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ + _______, _______, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, _______, KC_P4, KC_P5, KC_P6, KC_PAST, _______, KC_P4, KC_P5, KC_P6, KC_PAST, _______, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┐ ┌──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, _______, KC_P0, KC_PCMM, KC_PDOT, KC_PPLS, _______, _______, _______, KC_P0, KC_PCMM, KC_PDOT, KC_PPLS, _______, +// └──────────┴──────────┴──────────┴────┬─────┴────┬─────┴────┬─────┴────┬─────┘ └────┬─────┴────┬─────┴────┬─────┴────┬─────┴──────────┴──────────┴──────────┘ + _______, _______, _______, KC_PENT, _______, _______ +// └──────────┴──────────┴──────────┘ └──────────┴──────────┴──────────┘ + ), + + [FCTN] = LAYOUT( +// ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ ┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_SYSREQ, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + KC_PSCR, UC_MOD, KC_HOME, KC_UP, KC_END, KC_PGUP, UC(0x2014),KC_LBRC, KC_RBRC, S(KC_LBRC),S(KC_RBRC),KC_INS, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + KC_PAUS, RGB_TOG, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_BRIU, KC_CLR, +// ├──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┐ ┌──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤ + _______, KC_MPRV, KC_MRWD, KC_MPLY, KC_MFFD, KC_MNXT, KC_F11, KC_F12, KC_MSTP, KC_MUTE, KC_VOLD, KC_VOLU, KC_BRID, _______, +// └──────────┴──────────┴──────────┴────┬─────┴────┬─────┴────┬─────┴────┬─────┘ └────┬─────┴────┬─────┴────┬─────┴────┬─────┴──────────┴──────────┴──────────┘ + _______, _______, _______, _______, _______, _______ +// └──────────┴──────────┴──────────┘ └──────────┴──────────┴──────────┘ + ) +}; + +// Initialize rgblight +void keyboard_post_init_user(void) { + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + layer_state_set_user(layer_state); + uint16_t user_hue = rgblight_get_hue(); + for (uint16_t i = 0; i < 256; ++i) { + rgblight_sethsv_noeeprom( (i + user_hue) % 256, 255, 255); + wait_ms(5); + } + layer_state_set_user(layer_state); +}; + +// Turn on RGB underglow according to active layer +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case FCTN: rgblight_sethsv_noeeprom(96, 255, 255); break; + case NUMP: rgblight_sethsv_noeeprom(162, 255, 255); break; + case SYMB: + case SYSH: rgblight_sethsv_noeeprom(227, 255, 255); break; + default: rgblight_sethsv_noeeprom(13, 255, 255); break; + } + return state; +}; diff --git a/keyboards/keebio/iris/keymaps/nstickney/rules.mk b/keyboards/keebio/iris/keymaps/nstickney/rules.mk new file mode 100644 index 00000000000..7ad666d1a38 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/nstickney/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/iris/keymaps/olligranlund_nordic/config.h b/keyboards/keebio/iris/keymaps/olligranlund_nordic/config.h similarity index 100% rename from keyboards/iris/keymaps/olligranlund_nordic/config.h rename to keyboards/keebio/iris/keymaps/olligranlund_nordic/config.h diff --git a/keyboards/iris/keymaps/olligranlund_nordic/keymap.c b/keyboards/keebio/iris/keymaps/olligranlund_nordic/keymap.c similarity index 100% rename from keyboards/iris/keymaps/olligranlund_nordic/keymap.c rename to keyboards/keebio/iris/keymaps/olligranlund_nordic/keymap.c diff --git a/keyboards/iris/keymaps/olligranlund_nordic/readme.md b/keyboards/keebio/iris/keymaps/olligranlund_nordic/readme.md similarity index 100% rename from keyboards/iris/keymaps/olligranlund_nordic/readme.md rename to keyboards/keebio/iris/keymaps/olligranlund_nordic/readme.md diff --git a/keyboards/iris/keymaps/olligranlund_nordic/rules.mk b/keyboards/keebio/iris/keymaps/olligranlund_nordic/rules.mk similarity index 100% rename from keyboards/iris/keymaps/olligranlund_nordic/rules.mk rename to keyboards/keebio/iris/keymaps/olligranlund_nordic/rules.mk diff --git a/keyboards/keebio/iris/keymaps/omgvee/config.h b/keyboards/keebio/iris/keymaps/omgvee/config.h new file mode 100644 index 00000000000..c5899f45f09 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/omgvee/config.h @@ -0,0 +1,56 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 15 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +//tap dance shenanigans +#define TAPPING_TERM 200 + +//force n-key rollover to be enabled every boot +#define FORCE_NKRO + +//some mouse keys tweaking, as it is generally too slow by default +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + +////Leader key timeout +//#define LEADER_TIMEOUT 500 +//#define LEADER_PER_KEY_TIMING 200 + +#undef PRODUCT +#define PRODUCT "Vee's Home IRIS choc keeb" diff --git a/keyboards/keebio/iris/keymaps/omgvee/keymap.c b/keyboards/keebio/iris/keymaps/omgvee/keymap.c new file mode 100644 index 00000000000..6f29ccecd34 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/omgvee/keymap.c @@ -0,0 +1,206 @@ +#include QMK_KEYBOARD_H +#include + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _MOUSE 3 +#define _ADJUST 4 +#define _HWCT 5 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + MOUSE, + ADJUST, + HWCT, +}; + +#define KC_MOUS TT(_MOUSE) // double tab toggle mouse layer +#define KC_HWCT TT(_HWCT) // double tab toggle hardware control layer +#define MS_L KC_MS_LEFT +#define MS_R KC_MS_RIGHT +#define MS_U KC_MS_UP +#define MS_D KC_MS_DOWN +#define MS_B1 KC_MS_BTN1 +#define MS_B2 KC_MS_BTN2 +#define MW_U KC_MS_WH_UP +#define MW_D KC_MS_WH_DOWN +#define MW_L KC_MS_WH_LEFT +#define MW_R KC_MS_WH_RIGHT + +//// only uncomment the below line when you enable leader key in rules.mk +//LEADER_EXTERNS(); + +//Tap Dance Declarations +enum { + TD_SCL = 0 +}; +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Shift, twice for Caps Lock + [TD_SCL] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), +}; +enum { + TD_EBT = 0 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MOUS, KC_HWCT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,TD(TD_SCL), + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_LALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, KC_HOME, KC_END, KC_LBRC, KC_RBRC, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,_______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, _______, _______, KC_LT, KC_LCBR, KC_LBRC, KC_LPRN, KC_RPRN, KC_RBRC, KC_RCBR, KC_GT, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, KC_DEL, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, KC_INS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, KC_PGDN, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_MENU, KC_PENT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_MINS, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_VOLD, KC_VOLU, KC_PSCR, KC_EJCT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_MOUSE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, MS_B1, MS_U, MS_B2, MW_U, _______, _______, MS_B1, MS_B2, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, MS_L, MS_D, MS_R, MW_D, _______, MS_L, MS_D , MS_U, MS_R ,_______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, MW_L, MW_R, _______, _______, _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, KC_MUTE, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + BL_BRTG, _______, _______, _______, DEBUG, RESET, RESET, DEBUG, _______, RGB_HUI, RGB_SAI, RGB_VAI, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + BL_INC, _______, _______, _______, _______, EEP_RST, EEP_RST, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + BL_DEC, KC_MPRV, KC_MNXT, KC_MFFD, KC_MRWD, KC_MPLY, KC_MPRV, KC_MNXT, KC_MFFD, KC_MRWD, KC_MPLY, RGB_MOD, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + BL_TOGG, _______, _______, _______, _______, _______, _______, _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, KC_MUTE, RGB_TOG, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_HWCT] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + BL_BRTG, _______, _______, _______, _______, RESET, RESET, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + BL_DEC, KC_MPRV, KC_MNXT, KC_MFFD, KC_MRWD, KC_MPLY, KC_MPRV, KC_MNXT, KC_MFFD, KC_MRWD, KC_MPLY, RGB_MOD, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + BL_TOGG, _______, _______, _______, _______, _______, KC_EJCT, _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, KC_MUTE, RGB_TOG, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + dprintf("Got on layer %s ", LOWER); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } else { + layer_off(_LOWER); + dprintf("Got off layer %s ", LOWER); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + dprintf("Got on layer %s ", RAISE); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } else { + layer_off(_RAISE); + dprintf("Got off layer %s ", RAISE); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } + return false; + break; + case MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + dprintf("Got on layer %s ", MOUSE); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } else { + layer_off(_MOUSE); + dprintf("Got off layer %s ", MOUSE); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } + return false; + break; + case HWCT: + if (record->event.pressed) { + layer_on(_HWCT); + dprintf("Got on layer %s ", HWCT); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } else { + layer_off(_HWCT); + dprintf("Got off layer %s ", HWCT); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } + return false; + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/omgvee/readme.md b/keyboards/keebio/iris/keymaps/omgvee/readme.md new file mode 100644 index 00000000000..275d270fa31 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/omgvee/readme.md @@ -0,0 +1,23 @@ +# Reade.md for what I want from an Iris perfect layout +====================================================== + + +![My beloved IRIS keeb](https://i.imgur.com/wgsb37e.jpg) + +![My beloved choc IRIS keeb](https://i.imgur.com/BgbxViq.jpg) +======= + + +- mouse keys +- media keys and media controls +- in-switch LED intensity controls (+/-) +- underglow RGB hue/color controls +- underglow RGB intensity controls +- familiar key arrangement with Enter and symbols on the usual keys (to the right hand side) +- navigation keys should be the vim ones really, and same ones used for mouse; +- also have alternates on the same layer, in the form of AWSD, as well as HJKL (keep in mind the order is Left, Up, Down, Right) +- arrow keys on one layer, however with another modifier key, they become left=home, right=end, up=page up, down=page Down + + +See keymap.c for layouts + diff --git a/keyboards/keebio/iris/keymaps/omgvee/rules.mk b/keyboards/keebio/iris/keymaps/omgvee/rules.mk new file mode 100644 index 00000000000..897c6069c5c --- /dev/null +++ b/keyboards/keebio/iris/keymaps/omgvee/rules.mk @@ -0,0 +1,9 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes +MOUSEKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +TAP_DANCE_ENABLE = yes +NKRO_ENABLE = yes +LEADER_ENABLE = no +UNICODE_ENABLE = no diff --git a/keyboards/keebio/iris/keymaps/osiris/config.h b/keyboards/keebio/iris/keymaps/osiris/config.h new file mode 100644 index 00000000000..45d92578c48 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/osiris/config.h @@ -0,0 +1,33 @@ +/* +Copyright 2019 Khader Syed + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define USE_I2C +#define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +// #undef PERMISSIVE_HOLD +//#define TAPPING_FORCE_HOLD +//#define RETRO_TAPPING +#define PERMISSIVE_HOLD \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/osiris/keymap.c b/keyboards/keebio/iris/keymaps/osiris/keymap.c new file mode 100644 index 00000000000..a777c8a351e --- /dev/null +++ b/keyboards/keebio/iris/keymaps/osiris/keymap.c @@ -0,0 +1,137 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum layer_names { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LOWER, + RAISE +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP + +// left shift as a left key too - makes perfect sense +#define KC_LESF LSFT_T(KC_LEFT) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GESC, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LESF, Z , X , C , V , B ,LBRC, RBRC, N , M ,COMM,DOT ,SLSH,RGHT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,ENT , SPC ,RASE,RALT + // `----+----+----' `----+----+----' + ), + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GESC, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LESF, Z , X , C , V , B ,LBRC, RBRC, K , M ,COMM,DOT ,SLSH,RGHT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,ENT , SPC ,RASE,RALT + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , ,BTN1, , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , MS_L,MS_D,MS_U,MS_R, , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , UP , , ,DOWN, , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + +), + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , ,VOLU, , ,LBRC, RBRC,UNDS,PLUS, , ,MUTE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MPLY,VOLD,MNXT, ,LPRN, RPRN,MINS,EQL , , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT( + //,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------. + _______,_______,_______,_______,_______, QWERTY, COLEMAK,_______,_______,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI, _______,_______,_______,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + RESET ,DEBUG ,_______,RGB_HUD,RGB_SAD,RGB_VAD, _______,_______,_______,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------. ,-------|-------+-------+-------+-------+-------+-------| + BL_STEP,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______, + //`--------+-------+-------+----+--+-------+-------+-------/ \-------+-------+-------+---+---+-------+-------+-------' + _______,_______,_______, _______,_______,_______ + // `-------+-------+-------' `-------+-------+-------' + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/osiris/readme.md b/keyboards/keebio/iris/keymaps/osiris/readme.md new file mode 100644 index 00000000000..58469ef164b --- /dev/null +++ b/keyboards/keebio/iris/keymaps/osiris/readme.md @@ -0,0 +1,12 @@ +# My Iris Layout + +![My Iris Rev3](https://i.imgur.com/7oXacel.jpg) + +- mouse keys enabled +- includes a QWERTY and a COLEMAK layout now +- keys that I need, while removing keys that I don't +- more updates with the layout coming soon + - the enter needs to move elsewhere, not yet sure where +- support for VIA Configurator + +See keymap.c for layouts diff --git a/keyboards/keebio/iris/keymaps/osiris/rules.mk b/keyboards/keebio/iris/keymaps/osiris/rules.mk new file mode 100644 index 00000000000..f2788b5f751 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/osiris/rules.mk @@ -0,0 +1,8 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes +MOUSEKEY_ENABLE = yes + +# VIA Support - Comment these 3 lines out to disable +# RAW_ENABLE = yes +# DYNAMIC_KEYMAP_ENABLE = yes +# SRC += keyboards/wilba_tech/wt_main.c \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/pvinis/config.h b/keyboards/keebio/iris/keymaps/pvinis/config.h new file mode 100644 index 00000000000..b2fb43be917 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/pvinis/config.h @@ -0,0 +1,24 @@ +#pragma once + + +#ifdef PRODUCT + #undef PRODUCT + #define PRODUCT Iris Keyboard - pvinis +#endif + + +// Use I2C or Serial, not both +#define USE_SERIAL +// #define USE_I2C + + +// Select hand configuration +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + + +// choose pin to use for audio. c6 is the one iris uses. +#ifdef AUDIO_ENABLE + #define C6_AUDIO +#endif diff --git a/keyboards/keebio/iris/keymaps/pvinis/keymap.c b/keyboards/keebio/iris/keymaps/pvinis/keymap.c new file mode 100644 index 00000000000..2f6d5a6b47c --- /dev/null +++ b/keyboards/keebio/iris/keymaps/pvinis/keymap.c @@ -0,0 +1,120 @@ +// pvinis iris +// ,-----------------------------. ,-----------------------------. +// | | | | | | | | | | | | | | +// |----+----+----+----+----+----| |----+----+----+----+----+----| +// | | | | | | | | | | | | | | +// |----+----+----+----x----x----| |----x----x----+----+----+----| +// | | | | | | | | | | | | | | +// |----+----+----+----x----x----+----. ,----|----x----x----+----+----+----| +// | | | | | | | | | | | | | | | | +// `-------------------+----+----+----/ \----+----+----+-------------------' +// | | | | | | | | +// `----+---------' `--------------' + + +#include QMK_KEYBOARD_H +#include "pvinis.h" +//#include "iris.h" +//#include "action_layer.h" +//#include "eeconfig.h" + +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +#ifdef AUDIO_ENABLE + // #define STARTUP_SONG SONG(SONIC_RING) +#endif + +#ifdef AUDIO_ENABLE + float tone_sonic[][2] = SONG(IN_LIKE_FLINT); + float tone_1[][2] = SONG(QWERTY_SOUND); + float tone_2[][2] = SONG(OLD_SPICE); + float tone_3[][2] = SONG(OVERWATCH_THEME); + float tone_4[][2] = SONG(QWERTY_SOUND); +#endif + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // ,-----------------------------. ,-----------------------------. + // | | | | | |QWER| | | | | | | | + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // |Tab | | | | |CARP| | | | | | |Del | + // |----+----+----+----x----x----| |----x----x----+----+----+----| + // |EscC| | | | | | | | | | | |Ent | + // |----+----+----+----x----x----+----. ,----|----x----x----+----+----+----| + // |LSft| | | | | |Home| |End | | | | | |Rsft| + // `-------------------+----+----+----/ \----+----+----+-------------------' + // |Cmd |LOWR|Bspc| |Spc |RASE|RAlt| + // `----+---------' `--------------' + [LR_BASE] = LAYOUT_wrapper( + _______, _______, _______, _______, _______, QWERTY , _______, _______, _______, _______, _______, _______, + KC_TAB , _______, _______, _______, _______, CARPALX, _______, _______, _______, _______, _______, KC_DEL , + PV_ESCC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT , + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, + KC_LGUI, SYMBOL , KC_BSPC, KC_SPC , SYSCTL , KC_RALT + ), + + // ,-----------------------------. ,-----------------------------. + // | | NUMBERS_L | | NUMBERS_R | | + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | | | | | + // |----+ | | +----| + // | | QWERTY_L | | QWERTY_R | | + // |----+ +----. ,----| +----| + // | | | | | | | | + // `-------------------+----+----+----/ \----+----+----+-------------------' + // | | | | | | | | + // `----+---------' `--------------' + [LR_QWERTY] = LAYOUT_wrapper( + _______, ________________NUMBERS_L__________________, ________________NUMBERS_R__________________, _______, + _______, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, _______, + _______, _____________MOD_QWERTY_L2_________________, _____________MOD_QWERTY_R2_________________, _______, + _______, _________________QWERTY_L3_________________, _______, _______, _________________QWERTY_R3_________________, _______, + _______, _______, _______, _______, _______, _______ + ), + + // ,-----------------------------. ,-----------------------------. + // | | NUMBERS_L | | NUMBERS_R | | + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | | | | | + // |----+ | | +----| + // | | CARPALX_L | | CARPALX_R | | + // |----+ +----. ,----| +----| + // | | | | | | | | + // `-------------------+----+----+----/ \----+----+----+-------------------' + // | | | | | | | | + // `----+---------' `--------------' + [LR_CARPALX] = LAYOUT_wrapper( + _______, ________________NUMBERS_L__________________, ________________NUMBERS_R__________________, _______, + _______, ________________CARPALX_L1_________________, ________________CARPALX_R1_________________, _______, + _______, ________________CARPALX_L2_________________, ________________CARPALX_R2_________________, _______, + _______, ________________CARPALX_L3_________________, _______, _______, ________________CARPALX_R3_________________, _______, + _______, _______, _______, _______, _______, _______ + ), + + [LR_SYMBOL] = LAYOUT_wrapper( + KC_F12 , ______________________F_L__________________, ______________________F_R__________________, KC_F11 , + _______, _________________SYMBOL_L1_________________, _________________SYMBOL_R1_________________, _______, + _______, _________________SYMBOL_L2_________________, _________________SYMBOL_R2_________________, _______, + _______, _________________SYMBOL_L3_________________, _______, _______, _________________SYMBOL_R3_________________, _______, + _______, _______, _______, _______, _______, _______ + ), + + [LR_SYSCTL] = LAYOUT_wrapper( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _________________SYSCTL_R1_________________, _______, + _______, _______, _______, _______, _______, _______, _________________SYSCTL_R2_________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _________________SYSCTL_R3_________________, _______, + _______, _______, _______, _______, _______, _______ + ), + + [LR_KBCTL] = LAYOUT_wrapper( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, __________________KBCTL_L1_________________, __________________KBCTL_R1_________________, XXXXXXX, + XXXXXXX, __________________KBCTL_L2_________________, __________________KBCTL_R2_________________, XXXXXXX, + BASE , __________________KBCTL_L3_________________, XXXXXXX, XXXXXXX, __________________KBCTL_R3_________________, XXXXXXX, + XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX + ) +}; diff --git a/keyboards/keebio/iris/keymaps/pvinis/rules.mk b/keyboards/keebio/iris/keymaps/pvinis/rules.mk new file mode 100644 index 00000000000..899312894b0 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/pvinis/rules.mk @@ -0,0 +1,2 @@ +AUDIO_ENABLE = no # off for now +RGBLIGHT_ENABLE = no # off for now diff --git a/keyboards/iris/keymaps/rdhaene/config.h b/keyboards/keebio/iris/keymaps/rdhaene/config.h similarity index 100% rename from keyboards/iris/keymaps/rdhaene/config.h rename to keyboards/keebio/iris/keymaps/rdhaene/config.h diff --git a/keyboards/keebio/iris/keymaps/rdhaene/keymap.c b/keyboards/keebio/iris/keymaps/rdhaene/keymap.c new file mode 100644 index 00000000000..7a153346c56 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/rdhaene/keymap.c @@ -0,0 +1,145 @@ +#include "iris.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RASE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,SPC , ENT , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LCTL,LOWR,SPC , ENT ,LGUI,LALT + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S, , , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DEL , DEL , , P0 + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,DBUG,RHUD,RSAD,RVAD, , , , , , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S,RST , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/rdhaene/rules.mk b/keyboards/keebio/iris/keymaps/rdhaene/rules.mk new file mode 100644 index 00000000000..4bfbfb2ae26 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/rdhaene/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = yes + diff --git a/keyboards/keebio/iris/keymaps/rs/config.h b/keyboards/keebio/iris/keymaps/rs/config.h new file mode 100644 index 00000000000..412862c8724 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/rs/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define TAPPING_TERM 150 + +#undef RGBLED_NUM +#define RGBLED_NUM 6 +#define RGBLIGHT_SLEEP +#define RGBLIGHT_HUE_STEP 1 +#define RGBLIGHT_SAT_STEP 1 +#define RGBLIGHT_VAL_STEP 1 diff --git a/keyboards/keebio/iris/keymaps/rs/keymap.c b/keyboards/keebio/iris/keymaps/rs/keymap.c new file mode 100644 index 00000000000..0e254ea190b --- /dev/null +++ b/keyboards/keebio/iris/keymaps/rs/keymap.c @@ -0,0 +1,45 @@ +#include QMK_KEYBOARD_H +#include "rs.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,EQL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,SPC, BSPC, N , M ,COMM,DOT ,SLSH,ENTS, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LGUI,SPC , BSPC,CODE,FN + // `----+----+----' `+---+----+----' + ), + [_CODE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + GRV ,EXLM, AT ,HASH, DLR,PERC, CIRC,LPLT,ASTR,RPGT,NEQL, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , 1 , 2 , 3 , 4 , 5 , MINS,LBRC, UP ,RBRC, ,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , 6 , 7 , 8 , 9 , 0 , , ,AMPR,LEFT,DOWN,RGHT, ,PIPE, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , DOT, , , + // `----+----+----' `----+----+----' + ), + [_FN] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10, F11, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + BLTG,BLUP, , , ,BRMU, , ,PGUP, , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,BLDN, , ,RST ,BRMD, , VOLU, ,CTRA,PGDN,CTRE, , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , VOLD,MUTE, + // `----+----+----' `----+----+----' + ), +}; + diff --git a/keyboards/keebio/iris/keymaps/rs/readme.md b/keyboards/keebio/iris/keymaps/rs/readme.md new file mode 100644 index 00000000000..d23ab66877a --- /dev/null +++ b/keyboards/keebio/iris/keymaps/rs/readme.md @@ -0,0 +1 @@ +See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/keyboards/keebio/iris/keymaps/rs/rules.mk b/keyboards/keebio/iris/keymaps/rs/rules.mk new file mode 100644 index 00000000000..b4f058b4b90 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/rs/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = yes +BOOTLOADER = atmel-dfu diff --git a/keyboards/iris/keymaps/s1carii/config.h b/keyboards/keebio/iris/keymaps/s1carii/config.h similarity index 100% rename from keyboards/iris/keymaps/s1carii/config.h rename to keyboards/keebio/iris/keymaps/s1carii/config.h diff --git a/keyboards/keebio/iris/keymaps/s1carii/keymap.c b/keyboards/keebio/iris/keymaps/s1carii/keymap.c new file mode 100644 index 00000000000..4655bb1ad95 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/s1carii/keymap.c @@ -0,0 +1,144 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_DBUG DEBUG +//#define KC_DEV DEVLAYER + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LOWR, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,LGUI, RCMD, N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' + RCTL,ENT ,SPC , SPC ,RASE,RALT + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. + GRV , , , , , , , , ,MINS,EQL ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , ,PGDN, UP ,PGUP,LBRC,RBRC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,VOLD,VOLU,MUTE, , , HOME,LEFT,DOWN,RGHT, , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, , , , , ,LGUI, RCMD,END , , , ,PSCR,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' + RCTL,ENT ,SPC , SPC , ,RALT + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , UP , , , , , P7 , P8 , P9 ,PSLS,PAST, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,LEFT,DOWN,RGHT, , , , P4 , P5 , P6 ,PMNS,PPLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , NLCK, , P1 , P2 , P3 ,PDOT,PENT, + //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' + RCTL,ENT ,SPC , SPC , , P0 + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT_kc( + //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. + , , , , ,RST , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , ,DBUG, , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) + + /* + [_DEVLAYER] = LAYOUT_kc( + //,----+----+----+--+-+----+----. ,----+----+-+--+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+-+--+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) +*/ + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/s1carii/readme.md b/keyboards/keebio/iris/keymaps/s1carii/readme.md new file mode 100644 index 00000000000..6d94b6c877c --- /dev/null +++ b/keyboards/keebio/iris/keymaps/s1carii/readme.md @@ -0,0 +1,9 @@ +# Pok3r Based iris Keymap + +Pok3r was what got me into mechanical keyboards years ago and what has been my daily driver since, WhiteFox and the like being always on the periphery. As such, those keybinds are what is most natural and notably not in the default keymap configuration. + +Make example for this keymap (after setting up your build environment): + + make iris/rev2:s1carii:avrdude + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/iris/keymaps/s1carii/rules.mk b/keyboards/keebio/iris/keymaps/s1carii/rules.mk similarity index 100% rename from keyboards/iris/keymaps/s1carii/rules.mk rename to keyboards/keebio/iris/keymaps/s1carii/rules.mk diff --git a/keyboards/iris/keymaps/saviof/config.h b/keyboards/keebio/iris/keymaps/saviof/config.h similarity index 100% rename from keyboards/iris/keymaps/saviof/config.h rename to keyboards/keebio/iris/keymaps/saviof/config.h diff --git a/keyboards/iris/keymaps/saviof/keymap.c b/keyboards/keebio/iris/keymaps/saviof/keymap.c similarity index 100% rename from keyboards/iris/keymaps/saviof/keymap.c rename to keyboards/keebio/iris/keymaps/saviof/keymap.c diff --git a/keyboards/iris/keymaps/saviof/rules.mk b/keyboards/keebio/iris/keymaps/saviof/rules.mk similarity index 100% rename from keyboards/iris/keymaps/saviof/rules.mk rename to keyboards/keebio/iris/keymaps/saviof/rules.mk diff --git a/keyboards/iris/keymaps/swedish/config.h b/keyboards/keebio/iris/keymaps/swedish/config.h similarity index 100% rename from keyboards/iris/keymaps/swedish/config.h rename to keyboards/keebio/iris/keymaps/swedish/config.h diff --git a/keyboards/keebio/iris/keymaps/swedish/keymap.c b/keyboards/keebio/iris/keymaps/swedish/keymap.c new file mode 100644 index 00000000000..26e28479e8d --- /dev/null +++ b/keyboards/keebio/iris/keymaps/swedish/keymap.c @@ -0,0 +1,109 @@ +#include "iris.h" +#include "keymap_swedish.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _EMPTY 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET + +#define KC_AA NO_AA +#define KC_AE NO_AE +#define KC_OE NO_OSLH + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P , AA , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, A , S , D , F , G , H , J , K , L , OE , AE , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LCTL, Z , X , C , V , B ,DEL , BSPC, N , M ,COMM,DOT ,SLSH,MINS, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,SPC , ENT ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT( + //,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------. + NO_TILD,KC_EXLM,NO_AT ,KC_HASH,NO_DLR ,KC_PERC, NO_CIRC,NO_AMPR,NO_ASTR,NO_SLSH,NO_LPRN,NO_RPRN, + //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + NO_ACUT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,NO_PIPE,NO_LCBR,NO_RCBR, + //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,NO_BSLS, KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,NO_LBRC,NO_RBRC, + //|-------+-------+-------+-------+-------+-------+-------. ,-------|-------+-------+-------+-------+-------+-------| + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,NO_LESS,NO_GRTR, + //`-------+-------+-------+--+----+-------+-------+-------/ \-------+-------+-------+-------+-------+-------+-------' + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS + // `-------+-------+-------' `-------+-------+-------' + ), + + [_RAISE] = LAYOUT( + //,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------. + KC_F12 ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + NO_GRV ,KC_7 ,KC_8 ,KC_9 ,NO_MINS,NO_ASTR, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,NO_PIPE, + //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| + KC_TRNS,KC_4 ,KC_5 ,KC_6 ,NO_PLUS,NO_SLSH, KC_HOME,KC_PGDN,KC_PGUP,KC_END ,KC_TRNS,NO_BSLS, + //|-------+-------+-------+-------+-------+-------+-------. ,-------|-------+-------+-------+-------+-------+-------| + KC_TRNS,KC_1 ,KC_2 ,KC_3 ,KC_0 ,NO_EQL ,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + //`-------+-------+-------+--+----+-------+-------+-------/ \-------+-------+-------+-------+-------+-------+-------' + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS + // `-------+-------+-------' `-------+-------+-------' + ) +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _EMPTY); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _EMPTY); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _EMPTY); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _EMPTY); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/swedish/rules.mk b/keyboards/keebio/iris/keymaps/swedish/rules.mk new file mode 100644 index 00000000000..73142a16803 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/swedish/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + diff --git a/keyboards/iris/keymaps/transmogrified/Readme.md b/keyboards/keebio/iris/keymaps/transmogrified/Readme.md similarity index 100% rename from keyboards/iris/keymaps/transmogrified/Readme.md rename to keyboards/keebio/iris/keymaps/transmogrified/Readme.md diff --git a/keyboards/iris/keymaps/transmogrified/config.h b/keyboards/keebio/iris/keymaps/transmogrified/config.h similarity index 100% rename from keyboards/iris/keymaps/transmogrified/config.h rename to keyboards/keebio/iris/keymaps/transmogrified/config.h diff --git a/keyboards/iris/keymaps/transmogrified/keymap.c b/keyboards/keebio/iris/keymaps/transmogrified/keymap.c similarity index 100% rename from keyboards/iris/keymaps/transmogrified/keymap.c rename to keyboards/keebio/iris/keymaps/transmogrified/keymap.c diff --git a/keyboards/keebio/iris/keymaps/transmogrified/rules.mk b/keyboards/keebio/iris/keymaps/transmogrified/rules.mk new file mode 100644 index 00000000000..444fa38a932 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/transmogrified/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = yes + diff --git a/keyboards/keebio/iris/keymaps/via/config.h b/keyboards/keebio/iris/keymaps/via/config.h new file mode 100644 index 00000000000..f2498e5927e --- /dev/null +++ b/keyboards/keebio/iris/keymaps/via/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/keebio/iris/keymaps/via/keymap.c b/keyboards/keebio/iris/keymaps/via/keymap.c new file mode 100644 index 00000000000..c861ae845fe --- /dev/null +++ b/keyboards/keebio/iris/keymaps/via/keymap.c @@ -0,0 +1,77 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _MAIN 0 +#define _FN1 1 +#define _FN2 2 +#define _FN3 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_MAIN] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LGUI, FN_MO13, KC_ENT, KC_SPC, FN_MO23, KC_LALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_FN1] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_DEL, _______, KC_LEFT, KC_RGHT, KC_UP, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_PIPE, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + BL_STEP, _______, _______, _______, KC_DOWN, KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_MINS, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_DEL, KC_DEL, _______, KC_P0 + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_FN2] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_TOG, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_MOD, KC_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, KC_PGDN, KC_MINS, KC_LPRN, _______, KC_PLUS, KC_END, RGB_HUD, RGB_SAD, RGB_VAD, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_FN3] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } +} diff --git a/keyboards/keebio/iris/keymaps/via/rules.mk b/keyboards/keebio/iris/keymaps/via/rules.mk new file mode 100644 index 00000000000..ca2680325e1 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/via/rules.mk @@ -0,0 +1,7 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + +# VIA Support - Comment these 3 lines out to disable +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +SRC += keyboards/wilba_tech/wt_main.c diff --git a/keyboards/keebio/iris/keymaps/vyolle/config.h b/keyboards/keebio/iris/keymaps/vyolle/config.h new file mode 100644 index 00000000000..1adbd65b5a3 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/vyolle/config.h @@ -0,0 +1,44 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_I2C +// #define USE_SERIAL + + +#define FORCE_NKRO //Cause it's suprisingly handy. + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + + +#define MOUSEKEY_INTERVAL 16 + +#define MOUSEKEY_DELAY 0 + +#define MOUSEKEY_TIME_TO_MAX 60 + +#define MOUSEKEY_MAX_SPEED 7 + +#define MOUSEKEY_WHEEL_DELAY 0 + diff --git a/keyboards/keebio/iris/keymaps/vyolle/keymap.c b/keyboards/keebio/iris/keymaps/vyolle/keymap.c new file mode 100644 index 00000000000..431def355ee --- /dev/null +++ b/keyboards/keebio/iris/keymaps/vyolle/keymap.c @@ -0,0 +1,115 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 4 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RGUI, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RCTL + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_7, KC_8, KC_9, KC_PLUS, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSLS, KC_4, KC_5, KC_6, KC_MINUS, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_VOLU, KC_HOME, KC_LEFT, KC_UP, KC_RGHT, KC_PGUP, KC_PAST, KC_1, KC_2, KC_3, KC_EQL, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_VOLD, KC_END, KC_INS, KC_DOWN, KC_DEL, KC_PGDN, KC_MUTE, _______, _______, KC_0, KC_COMM, KC_DOT, KC_ENT, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_GRAVE, KC_TILD, KC_UNDS, KC_EQL, KC_PIPE, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_BSLASH,KC_LCBR, KC_RCBR, KC_MINUS, KC_LBRC, KC_RBRC, _______, KC_LEFT, KC_UP, KC_RGHT, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_COLN, KC_LT, KC_GT, KC_PLUS, KC_LPRN, KC_RPRN, _______, _______, _______, _______, KC_DOWN, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, KC_CAPS, KC_MENU, KC_APP, KC_PSCR, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_SLCK, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/iris/keymaps/vyolle/rules.mk b/keyboards/keebio/iris/keymaps/vyolle/rules.mk new file mode 100644 index 00000000000..e7cbfb83d89 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/vyolle/rules.mk @@ -0,0 +1,7 @@ +EXTRAKEY_ENABLE = yes # Disable if you run out of usb endpoints. Media keys need this to work. +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) Uses extra usb endpoints. +STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER. +AUDIO_ENABLE = no # Audio output on port C6 +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = yes +BOOTMAGIC_ENABLE = yes diff --git a/keyboards/keebio/iris/keymaps/wanleg/config.h b/keyboards/keebio/iris/keymaps/wanleg/config.h new file mode 100644 index 00000000000..9b900076884 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/wanleg/config.h @@ -0,0 +1,33 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +#undef USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#define QMK_ESC_OUTPUT F6 // usually COL +#define QMK_ESC_INPUT D7 // usually ROW +#define QMK_LED B0 diff --git a/keyboards/keebio/iris/keymaps/wanleg/keymap.c b/keyboards/keebio/iris/keymaps/wanleg/keymap.c new file mode 100644 index 00000000000..6f8ff90661f --- /dev/null +++ b/keyboards/keebio/iris/keymaps/wanleg/keymap.c @@ -0,0 +1,76 @@ + +#include QMK_KEYBOARD_H +#include "wanleg.h" + + +#define LAYOUT_iris_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \ + ) \ + LAYOUT_wrapper( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K31, K32, K33, K34, K35, K36, _______, _______, K37, K38, K39, K3A, K3B, K3C, \ + _______, _______, _______, _______, _______, _______ \ + ) +#define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_GK] = LAYOUT_iris_base_wrapper( + _______________GherkinLike_0_______________, + _______________GherkinLike_1_______________, + _______________GherkinLike_2_______________, + _______________GherkinLike_3_OneHand_______ + ), + [ONE] = LAYOUT_wrapper( + _______________Qwerty_Row__0_______________, + _______________Qwerty_Row__1_______________, + _______________Qwerty_Row__2_______________, + KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), _______, _______, SH_T(KC_SPC), SUPRA, KC_RGUI, KC_RALT, GHERKIN, KC_RCTL, + _______, _______, _______, _______, _______, _______ + ), + [SUP] = LAYOUT_iris_base_wrapper( + ________________SUPRA_Row_0________________, + ________________SUPRA_Row_1________________, + ________________SUPRA_Row_2________________, + ________________SUPRA_Row_3________________ + ), + [SUB] = LAYOUT_iris_base_wrapper( + _______________SUBTER_Row__0_______________, + _______________SUBTER_Row__1_______________, + _______________SUBTER_Row__2_______________, + _______________SUBTER_Row__3_______________ + ), + [NUM] = LAYOUT_iris_base_wrapper( + _______________NUMBERS_Row_0_______________, + _______________NUMBERS_Row_1_______________, + _______________NUMBERS_Row_2_______________, + _______________NUMBERS_Row_3_______________ + ), + [DIR] = LAYOUT_iris_base_wrapper( + _____________DIRECTIONS_Row__0_____________, + _____________DIRECTIONS_Row__1_____________, + _____________DIRECTIONS_Row__2_____________, + _______, _______, ONEHAND, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [ETC] = LAYOUT_iris_base_wrapper( + ______________ETCETERA_Row__0______________, + ______________ETCETERA_Row__1______________, + ______________ETCETERA_Row__2______________, + ______________ETCETERA_Row__3______________ + ) + +}; + + +void matrix_init_keymap(void) { + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); +} diff --git a/keyboards/keebio/iris/keymaps/wanleg/rules.mk b/keyboards/keebio/iris/keymaps/wanleg/rules.mk new file mode 100644 index 00000000000..bbb05a5b488 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/wanleg/rules.mk @@ -0,0 +1,5 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no + +SWAP_HANDS_ENABLE = yes +BOOTLOADER = qmk-dfu diff --git a/keyboards/iris/keymaps/xyverz/config.h b/keyboards/keebio/iris/keymaps/xyverz/config.h similarity index 100% rename from keyboards/iris/keymaps/xyverz/config.h rename to keyboards/keebio/iris/keymaps/xyverz/config.h diff --git a/keyboards/iris/keymaps/xyverz/keymap.c b/keyboards/keebio/iris/keymaps/xyverz/keymap.c similarity index 100% rename from keyboards/iris/keymaps/xyverz/keymap.c rename to keyboards/keebio/iris/keymaps/xyverz/keymap.c diff --git a/keyboards/iris/keymaps/xyverz/rules.mk b/keyboards/keebio/iris/keymaps/xyverz/rules.mk similarity index 100% rename from keyboards/iris/keymaps/xyverz/rules.mk rename to keyboards/keebio/iris/keymaps/xyverz/rules.mk diff --git a/keyboards/iris/keymaps/yanfali/config.h b/keyboards/keebio/iris/keymaps/yanfali/config.h similarity index 100% rename from keyboards/iris/keymaps/yanfali/config.h rename to keyboards/keebio/iris/keymaps/yanfali/config.h diff --git a/keyboards/keebio/iris/keymaps/yanfali/keymap.c b/keyboards/keebio/iris/keymaps/yanfali/keymap.c new file mode 100644 index 00000000000..92117bd6dec --- /dev/null +++ b/keyboards/keebio/iris/keymaps/yanfali/keymap.c @@ -0,0 +1,144 @@ +#include "iris.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen +#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen +#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen +#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen +#define KC_ESCC MT(MOD_LCTL, KC_ESC) // Control (hold), Escape (tap) +#define KC_BACK LGUI(KC_LEFT) // Browser Back +#define KC_FORW LGUI(KC_RIGHT) // Browser Forward +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP +#define KC_ENTS MT(MOD_LSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,PLUS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,SPC , LALT, N , M ,COMM,DOT ,SLSH,DEL , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,SPC , BSPC,ENTS,RASE + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S,CPYP, , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DEL , DEL , , P0 + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL ,MPRV,BACK,FORW,PGUP,UNDS, EQL ,HOME, , , ,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/yanfali/readme.md b/keyboards/keebio/iris/keymaps/yanfali/readme.md similarity index 100% rename from keyboards/iris/keymaps/yanfali/readme.md rename to keyboards/keebio/iris/keymaps/yanfali/readme.md diff --git a/keyboards/keebio/iris/keymaps/yanfali/rules.mk b/keyboards/keebio/iris/keymaps/yanfali/rules.mk new file mode 100644 index 00000000000..73142a16803 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/yanfali/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + diff --git a/keyboards/keebio/iris/readme.md b/keyboards/keebio/iris/readme.md new file mode 100644 index 00000000000..6d166e7564a --- /dev/null +++ b/keyboards/keebio/iris/readme.md @@ -0,0 +1,20 @@ +Iris +==== + +A split ergo 4x6 keyboard with 3 or 4 thumb keys made and sold by Keebio. [More info at Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/iris/rev2:default + +Example of flashing this keyboard: + + make keebio/iris/rev2:default:avrdude + +See [build environment setup](https://docs.qmk.fm/#/newbs_getting_started) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +A build guide for this keyboard can be found here: [Iris Build Guide](https://docs.keeb.io/iris-build-guide.html) diff --git a/keyboards/keebio/iris/rev1/config.h b/keyboards/keebio/iris/rev1/config.h new file mode 100644 index 00000000000..2a21861a1cd --- /dev/null +++ b/keyboards/keebio/iris/rev1/config.h @@ -0,0 +1,84 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Iris Keyboard +#define DESCRIPTION Split 50 percent ergonomic keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define BACKLIGHT_PIN D2 +#define BACKLIGHT_LEVELS 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 // Number of LEDs + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 515 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 509 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/keebio/iris/rev1/rev1.c b/keyboards/keebio/iris/rev1/rev1.c new file mode 100644 index 00000000000..9694d122df1 --- /dev/null +++ b/keyboards/keebio/iris/rev1/rev1.c @@ -0,0 +1,27 @@ +#include "rev1.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +// swap-hands action needs a matrix to define the swap +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + /* Left hand, matrix positions */ + {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, + {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, + {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, + {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, + {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, + /* Right hand, matrix positions */ + {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, + {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, + {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, + {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, + {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, +}; +#endif diff --git a/keyboards/iris/rev1/rev1.h b/keyboards/keebio/iris/rev1/rev1.h similarity index 100% rename from keyboards/iris/rev1/rev1.h rename to keyboards/keebio/iris/rev1/rev1.h diff --git a/keyboards/iris/rev1/rules.mk b/keyboards/keebio/iris/rev1/rules.mk similarity index 100% rename from keyboards/iris/rev1/rules.mk rename to keyboards/keebio/iris/rev1/rules.mk diff --git a/keyboards/keebio/iris/rev1_led/config.h b/keyboards/keebio/iris/rev1_led/config.h new file mode 100644 index 00000000000..b3629354e9f --- /dev/null +++ b/keyboards/keebio/iris/rev1_led/config.h @@ -0,0 +1,84 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Iris Keyboard +#define DESCRIPTION Split 50 percent ergonomic keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, F4 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 // Number of LEDs + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 515 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 509 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/keebio/iris/rev1_led/rev1_led.c b/keyboards/keebio/iris/rev1_led/rev1_led.c new file mode 100644 index 00000000000..af5fc9440be --- /dev/null +++ b/keyboards/keebio/iris/rev1_led/rev1_led.c @@ -0,0 +1,27 @@ +#include "rev1_led.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +// swap-hands action needs a matrix to define the swap +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + /* Left hand, matrix positions */ + {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, + {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, + {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, + {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, + {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, + /* Right hand, matrix positions */ + {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, + {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, + {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, + {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, + {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, +}; +#endif diff --git a/keyboards/iris/rev1_led/rev1_led.h b/keyboards/keebio/iris/rev1_led/rev1_led.h similarity index 100% rename from keyboards/iris/rev1_led/rev1_led.h rename to keyboards/keebio/iris/rev1_led/rev1_led.h diff --git a/keyboards/iris/rev1_led/rules.mk b/keyboards/keebio/iris/rev1_led/rules.mk similarity index 100% rename from keyboards/iris/rev1_led/rules.mk rename to keyboards/keebio/iris/rev1_led/rules.mk diff --git a/keyboards/keebio/iris/rev2/config.h b/keyboards/keebio/iris/rev2/config.h new file mode 100644 index 00000000000..a46328b94bc --- /dev/null +++ b/keyboards/keebio/iris/rev2/config.h @@ -0,0 +1,84 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0200 +#define MANUFACTURER Keebio +#define PRODUCT Iris Keyboard +#define DESCRIPTION Split 50 percent ergonomic keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D7, E6, B4, D2, D4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 // Number of LEDs + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 515 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 509 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/keebio/iris/rev2/rev2.c b/keyboards/keebio/iris/rev2/rev2.c new file mode 100644 index 00000000000..8575243f0d2 --- /dev/null +++ b/keyboards/keebio/iris/rev2/rev2.c @@ -0,0 +1,28 @@ +#include "rev2.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +// swap-hands action needs a matrix to define the swap +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + /* Left hand, matrix positions */ + {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, + {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, + {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, + {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, + {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, + /* Right hand, matrix positions */ + {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, + {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, + {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, + {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, + {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, +}; +#endif + diff --git a/keyboards/iris/rev2/rev2.h b/keyboards/keebio/iris/rev2/rev2.h similarity index 100% rename from keyboards/iris/rev2/rev2.h rename to keyboards/keebio/iris/rev2/rev2.h diff --git a/keyboards/iris/rev2/rules.mk b/keyboards/keebio/iris/rev2/rules.mk similarity index 100% rename from keyboards/iris/rev2/rules.mk rename to keyboards/keebio/iris/rev2/rules.mk diff --git a/keyboards/keebio/iris/rev3/config.h b/keyboards/keebio/iris/rev3/config.h new file mode 100644 index 00000000000..9653625437f --- /dev/null +++ b/keyboards/keebio/iris/rev3/config.h @@ -0,0 +1,93 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0300 +#define MANUFACTURER Keebio +#define PRODUCT Iris Keyboard +#define DESCRIPTION Split 50 percent ergonomic keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D2, D3, D5, D7, D6 } +#define MATRIX_COL_PINS { F1, F4, F5, F6, D4, B4 } +#define SPLIT_HAND_PIN F0 +#define QMK_ESC_OUTPUT F1 +#define QMK_ESC_INPUT D2 +#define QMK_LED B0 +#define QMK_SPEAKER C6 + +#define ENCODERS_PAD_A { B5 } +#define ENCODERS_PAD_B { B7 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN F7 +#define RGBLED_NUM 12 // Number of LEDs +#define RGBLED_SPLIT { 6, 6 } + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 515 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 509 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/keebio/iris/rev3/rev3.c b/keyboards/keebio/iris/rev3/rev3.c new file mode 100644 index 00000000000..7e49330c1da --- /dev/null +++ b/keyboards/keebio/iris/rev3/rev3.c @@ -0,0 +1,27 @@ +#include "rev3.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +// swap-hands action needs a matrix to define the swap +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + /* Left hand, matrix positions */ + {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, + {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, + {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, + {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, + {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, + /* Right hand, matrix positions */ + {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, + {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, + {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, + {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, + {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, +}; +#endif diff --git a/keyboards/keebio/iris/rev3/rev3.h b/keyboards/keebio/iris/rev3/rev3.h new file mode 100644 index 00000000000..da9da844030 --- /dev/null +++ b/keyboards/keebio/iris/rev3/rev3.h @@ -0,0 +1,33 @@ +#pragma once + +#include "iris.h" +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, LT4, RT4, R30, R31, R32, R33, R34, R35, \ + LT1, LT2, LT3, RT3, RT2, RT1 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, LT4, LT1, LT2, LT3 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { KC_NO, KC_NO, RT4, RT1, RT2, RT3 } \ + } diff --git a/keyboards/keebio/iris/rev3/rules.mk b/keyboards/keebio/iris/rev3/rules.mk new file mode 100644 index 00000000000..d7e0da93675 --- /dev/null +++ b/keyboards/keebio/iris/rev3/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes +ENCODER_ENABLE = yes diff --git a/keyboards/keebio/iris/rules.mk b/keyboards/keebio/iris/rules.mk new file mode 100644 index 00000000000..b0012e16114 --- /dev/null +++ b/keyboards/keebio/iris/rules.mk @@ -0,0 +1,41 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +ifneq (, $(findstring rev3, $(KEYBOARD))) + BOOTLOADER = qmk-dfu +else + BOOTLOADER = caterina +endif + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = keebio/iris/rev2 diff --git a/keyboards/keebio/laplace/config.h b/keyboards/keebio/laplace/config.h new file mode 100644 index 00000000000..cce642526fa --- /dev/null +++ b/keyboards/keebio/laplace/config.h @@ -0,0 +1,46 @@ +/* +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1147 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Laplace +#define DESCRIPTION 40 percent staggered keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 7 + +/* key matrix pins */ +#define MATRIX_ROW_PINS {D3, F4, D2, F5, D7, B4, C6, E6} +#define MATRIX_COL_PINS {D1, F6, F7, B1, B3, B2, B6} + +/* WS2812 RGB LED */ +#define RGB_DI_PIN D4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define TAPPING_TERM 200 diff --git a/keyboards/laplace/info.json b/keyboards/keebio/laplace/info.json similarity index 100% rename from keyboards/laplace/info.json rename to keyboards/keebio/laplace/info.json diff --git a/keyboards/keebio/laplace/keymaps/bakingpy/keymap.c b/keyboards/keebio/laplace/keymaps/bakingpy/keymap.c new file mode 100644 index 00000000000..97fb70af5e5 --- /dev/null +++ b/keyboards/keebio/laplace/keymaps/bakingpy/keymap.c @@ -0,0 +1,61 @@ +#include QMK_KEYBOARD_H + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +#define KC_ KC_TRNS +#define KC_FN1 MO(_FN1) +#define KC_FN2 MO(_FN2) +#define KC_SPFN1 LT(_FN1, KC_SPACE) +#define KC_SPFN2 LT(_FN2, KC_SPACE) +#define KC_BSFN1 LT(_FN1, KC_BSPC) +#define KC_BSFN2 LT(_FN2, KC_BSPC) +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----+----+----+----. + ESC , Q , W , E , R , T , Y , U , I , O , P ,DEL ,BSPC, + //|----`----`----`----`----`----`----`----`----`----`----`----`----+ + TAB , A , S , D , F , G , H , J , K , L ,QUOT, ENTER , + //|-----`----`----`----`----`----`----`----`----`----`----`--------+ + LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , + //|-------`----`----`----`----`----`----`----`----`----`----`------+ + GRV ,LCTL,LALT ,LGUI, SPFN1 , BSFN2 , FN2 ,RALT ,RCTL , FN1 + //`-----+----+-----+----+--------+--------+-----+-----+-----+------' + ), + + [_FN1] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , + //|----`----`----`----`----`----`----`----`----`----`----`----`----+ + RST ,RHUI,RSAI,RVAI,VOLU,LBRC,RBRC, 4 , 5 , 6 ,SCLN, , + //|-----`----`----`----`----`----`----`----`----`----`----`--------+ + RMOD ,RHUD,RSAD,RVAD,VOLD,LCBR,RCBR, 1 , 2 , 3 , UP , , + //|-------`----`----`----`----`----`----`----`----`----`----`------+ + RTOG , , , , , DEL , 0 ,LEFT ,DOWN , RGHT + //`-----+----+-----+----+--------+--------+-----+-----+-----+------' + ), + + [_FN2] = LAYOUT_kc( + //,----+----+----+----+----+----+----+----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN,UNDS,PLUS, + //|----`----`----`----`----`----`----`----`----`----`----`----`----+ + , , ,INS ,PGUP,HOME, , , , ,COLN, , + //|-----`----`----`----`----`----`----`----`----`----`----`--------+ + , , ,DEL ,PGDN,END , , , , , , , + //|-------`----`----`----`----`----`----`----`----`----`----`------+ + , , , , DEL , , , , , + //`-----+----+-----+----+--------+--------+-----+-----+-----+------' + ) +}; diff --git a/keyboards/keebio/laplace/keymaps/bakingpy/rules.mk b/keyboards/keebio/laplace/keymaps/bakingpy/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/keebio/laplace/keymaps/default/keymap.c b/keyboards/keebio/laplace/keymaps/default/keymap.c new file mode 100644 index 00000000000..053bfb7ad61 --- /dev/null +++ b/keyboards/keebio/laplace/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +#include QMK_KEYBOARD_H + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +#define FN1 MO(_FN1) +#define FN2 MO(_FN2) +#define SP_FN1 LT(_FN1, KC_SPACE) +#define SP_FN2 LT(_FN2, KC_SPACE) +#define BS_FN1 LT(_FN1, KC_BSPC) +#define BS_FN2 LT(_FN2, KC_BSPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LALT, KC_LGUI, FN1, SP_FN1, BS_FN2, KC_RGUI, KC_RALT, FN2, KC_RCTL + ), + + [_FN1] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + RESET, RGB_HUI, RGB_SAI, RGB_VAI, KC_VOLU, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_SCLN, _______, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_VOLD, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, KC_UP, _______, + RGB_TOG, _______, _______, _______, _______, KC_DEL, KC_0, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN2] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, + _______, _______, _______, KC_INS, KC_PGUP, KC_HOME, _______, _______, _______, _______, KC_COLN, _______, + _______, _______, _______, KC_DEL, KC_PGDN, KC_END, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/keebio/laplace/keymaps/default/rules.mk b/keyboards/keebio/laplace/keymaps/default/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/laplace/laplace.c b/keyboards/keebio/laplace/laplace.c similarity index 100% rename from keyboards/laplace/laplace.c rename to keyboards/keebio/laplace/laplace.c diff --git a/keyboards/keebio/laplace/laplace.h b/keyboards/keebio/laplace/laplace.h new file mode 100644 index 00000000000..fc0510fe589 --- /dev/null +++ b/keyboards/keebio/laplace/laplace.h @@ -0,0 +1,33 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, \ + B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B13, \ + C1, C2, C3, C4, C5, C6, C7, C9, C10, C11, C12, C13, \ + D1, D2, D3, D4, D5, D7, D10, D11, D12, D13 \ + ) { \ + {A1, A2, A3, A4, A5, A6, A7}, \ + {KC_NO, A13, A12, A11, A10, A9, A8}, \ + {B1, B2, B3, B4, B5, B6, B7}, \ + {KC_NO, B13, KC_NO, B11, B10, B9, B8}, \ + {C1, C2, C3, C4, C5, C6, C7}, \ + {KC_NO, C13, C12, C11, C10, C9, KC_NO}, \ + {D1, D2, D3, D4, D5, KC_NO, D7}, \ + {KC_NO, D13, D12, D11, D10, KC_NO, KC_NO} \ + } + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, \ + B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B13, \ + C1, C2, C3, C4, C5, C6, C7, C9, C10, C11, C12, C13, \ + D1, D2, D3, D4, D5, D7, D10, D11, D12, D13 \ + ) \ + LAYOUT( \ + KC_##A1, KC_##A2, KC_##A3, KC_##A4, KC_##A5, KC_##A6, KC_##A7, KC_##A8, KC_##A9, KC_##A10, KC_##A11, KC_##A12, KC_##A13, \ + KC_##B1, KC_##B2, KC_##B3, KC_##B4, KC_##B5, KC_##B6, KC_##B7, KC_##B8, KC_##B9, KC_##B10, KC_##B11, KC_##B13, \ + KC_##C1, KC_##C2, KC_##C3, KC_##C4, KC_##C5, KC_##C6, KC_##C7, KC_##C9, KC_##C10, KC_##C11, KC_##C12, KC_##C13, \ + KC_##D1, KC_##D2, KC_##D3, KC_##D4, KC_##D5, KC_##D7, KC_##D10, KC_##D11, KC_##D12, KC_##D13 \ + ) diff --git a/keyboards/keebio/laplace/readme.md b/keyboards/keebio/laplace/readme.md new file mode 100644 index 00000000000..4292483bc82 --- /dev/null +++ b/keyboards/keebio/laplace/readme.md @@ -0,0 +1,20 @@ +Laplace +======= + +A 40% staggered keyboard made and sold by Keebio. [More info at Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/laplace:default + +Example of flashing this keyboard: + + make keebio/laplace:default:avrdude + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +A build guide for this keyboard can be found here: [Keebio Build Guides](https://docs.keeb.io) diff --git a/keyboards/keebio/laplace/rules.mk b/keyboards/keebio/laplace/rules.mk new file mode 100644 index 00000000000..7f896e1bd5b --- /dev/null +++ b/keyboards/keebio/laplace/rules.mk @@ -0,0 +1,63 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. diff --git a/keyboards/levinson/config.h b/keyboards/keebio/levinson/config.h similarity index 100% rename from keyboards/levinson/config.h rename to keyboards/keebio/levinson/config.h diff --git a/keyboards/levinson/info.json b/keyboards/keebio/levinson/info.json similarity index 100% rename from keyboards/levinson/info.json rename to keyboards/keebio/levinson/info.json diff --git a/keyboards/levinson/keymaps/atreus/config.h b/keyboards/keebio/levinson/keymaps/atreus/config.h similarity index 100% rename from keyboards/levinson/keymaps/atreus/config.h rename to keyboards/keebio/levinson/keymaps/atreus/config.h diff --git a/keyboards/levinson/keymaps/atreus/keymap.c b/keyboards/keebio/levinson/keymaps/atreus/keymap.c similarity index 100% rename from keyboards/levinson/keymaps/atreus/keymap.c rename to keyboards/keebio/levinson/keymaps/atreus/keymap.c diff --git a/keyboards/levinson/keymaps/atreus/readme.md b/keyboards/keebio/levinson/keymaps/atreus/readme.md similarity index 100% rename from keyboards/levinson/keymaps/atreus/readme.md rename to keyboards/keebio/levinson/keymaps/atreus/readme.md diff --git a/keyboards/levinson/keymaps/bakingpy2u/config.h b/keyboards/keebio/levinson/keymaps/bakingpy2u/config.h similarity index 100% rename from keyboards/levinson/keymaps/bakingpy2u/config.h rename to keyboards/keebio/levinson/keymaps/bakingpy2u/config.h diff --git a/keyboards/keebio/levinson/keymaps/bakingpy2u/keymap.c b/keyboards/keebio/levinson/keymaps/bakingpy2u/keymap.c new file mode 100644 index 00000000000..6a6ab496abc --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/bakingpy2u/keymap.c @@ -0,0 +1,203 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _FN3 5 +#define _FN4 6 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + FN3, + FN4, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen +#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen +#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen +#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen +#define KC_X0 MT(MOD_LCTL, KC_ESC) +#define KC_X1 LOWER +#define KC_X2 RAISE +#define KC_X3 LT(_FN3, KC_GRV) +#define KC_X4 MT(MOD_LSFT, KC_ENT) +#define KC_X5 BL_STEP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL, X1 ,LGUI,SPC ,SPC , BSPC,BSPC, X2 ,RALT, UP ,RGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL, X1 ,LGUI,SPC ,SPC , BSPC,BSPC, X2 ,RALT, UP ,RGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_DVORAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , O , E , U , I , D , H , T , N , S ,SLSH, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL, X1 ,LGUI,SPC ,SPC , BSPC,BSPC, X2 ,RALT, UP ,RGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + X5 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , ,DEL , DEL , , P0 ,PDOT, , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_FN3] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/rev3/rules.mk b/keyboards/keebio/levinson/keymaps/bakingpy2u/rules.mk similarity index 100% rename from keyboards/iris/rev3/rules.mk rename to keyboards/keebio/levinson/keymaps/bakingpy2u/rules.mk diff --git a/keyboards/keebio/levinson/keymaps/dcompact/config.h b/keyboards/keebio/levinson/keymaps/dcompact/config.h new file mode 100644 index 00000000000..be2d71e8f02 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/dcompact/config.h @@ -0,0 +1,28 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C + +/* Select hand configuration */ +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/keebio/levinson/keymaps/dcompact/keymap.c b/keyboards/keebio/levinson/keymaps/dcompact/keymap.c new file mode 100644 index 00000000000..a0556c09b4f --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/dcompact/keymap.c @@ -0,0 +1,238 @@ +#include QMK_KEYBOARD_H + +#include "keymap_steno.h" + +// Custom Keycodes and Combinations Used +#define DEL_SHF SFT_T(KC_DEL) +#define QUAKE LCTL(KC_GRV) + +#define WKSP_L LALT(LCTL(KC_LEFT)) +#define WKSP_D LALT(LCTL(KC_DOWN)) +#define WKSP_U LALT(LCTL(KC_UP)) +#define WKSP_R LALT(LCTL(KC_RGHT)) + + +extern keymap_config_t keymap_config; + +enum planck_layers { + _BASE, + _LOWER, + _RAISE, + _FUNC, + _PLOVER, + _ADJUST, + _MOUSE +}; + +enum planck_keycodes { + BASE = SAFE_RANGE, + PLOVER, + LOWER, + RAISE, + FUNC, + MOUSE, + ADJUST, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base + * ,-----------------------------------------------------------------------------------. + * | Tab | " ' | < , | > . | P | Y | F | G | C | R | L | ? / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | _ - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Del/Sf| : ; | Q | J | K | X | B | M | W | V | Z | Bspc | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Plover| GUI | Alt |Lower |Shift |Space |Raise | Alt | GUI | Fn |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_BASE] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ + DEL_SHF, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_BSPC, \ + KC_LCTL, PLOVER, KC_LGUI, KC_LALT, LOWER, KC_LSFT, KC_SPC, RAISE, KC_RALT, KC_RGUI, FUNC, KC_ENT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | Home |PgDwn | PgUp | End | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |PrScr | Menu | | | | | Left | Down | Up |Right | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |CapsLk|NumLck| Ins | | | |WkLeft|WkDown| WkUp |WkRigh| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Raise | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, \ + XXXXXXX, KC_PSCR, KC_MENU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, \ + XXXXXXX, KC_CAPS, KC_LNUM, KC_INS, XXXXXXX, XXXXXXX, XXXXXXX, WKSP_L, WKSP_D, WKSP_U, WKSP_R, XXXXXXX, \ + _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * |Quake | ` | ~ | \ | | | ( | ) | 7 | 8 | 9 | / | = | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ! | @ | # | $ | { | } | 4 | 5 | 6 | * | + | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | % | ^ | & | * | [ | ] | 1 | 2 | 3 | - |Bkspc | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | < | > | | 0 | . | , | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + QUAKE, KC_GRV, KC_TILD, KC_BSLS, KC_PIPE, KC_LPRN, KC_RPRN, KC_7, KC_8, KC_9, KC_SLSH, KC_EQL, \ + XXXXXXX, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_4, KC_5, KC_6, KC_ASTR, KC_PLUS, \ + XXXXXXX, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LBRC, KC_RBRC, KC_1, KC_2, KC_3, KC_MINS, KC_BSPC, \ + _______, XXXXXXX, _______, _______, _______, KC_LABK, KC_RABK, _______, KC_0, KC_DOT, KC_COMM, XXXXXXX \ +), + +/* Func + * ,-----------------------------------------------------------------------------------. + * | |Sleep |Prev-W|Ply/Ps|Next-W| | | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Wake | Mute | Vol- | Vol+ | | | F5 | F6 | F7 | F8 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Power |Prev-M|Ply/Ps|Next-M| | | F1 | F2 | F3 | F4 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = LAYOUT_ortho_4x12( \ + XXXXXXX, KC_SLEP, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, \ + XXXXXXX, KC_WAKE, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, \ + XXXXXXX, KC_PWR, KC_MRWD, KC_MPLY, KC_MFFD, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, \ + _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX \ +), + +/* Mouse (Not Reachable on Planck) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | |Click1|Click3|Click2| | |MouseL|MouseD|MouseU|MouseR| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | |Accel0|Accel1|Accel2| | |ScrllL|ScrllD|ScrllU|ScrllR| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_MOUSE] = LAYOUT_ortho_4x12( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN3, KC_BTN2, XXXXXXX, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, XXXXXXX, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, XXXXXXX, \ + _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX \ +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | FN | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | | E | U | PWR | RES1 | RES2 | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_ortho_4x12( \ + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC , \ + STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , \ + XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , \ + EXT_PLV, XXXXXXX, XXXXXXX, STN_A, STN_O, XXXXXXX, XXXXXXX, STN_E, STN_U, STN_PWR, STN_RE1, STN_RE2 \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|RGBTog|RGBMod| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|Light-|Light+| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, RGB_TOG, RGB_MOD, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_VAD, RGB_VAI, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + case PLOVER: + if (!record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_on(_PLOVER); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + } else { + layer_off(_MOUSE); + } + return false; + break; + } + return true; +} + +void keyboard_post_init_user(void) { + steno_set_mode(STENO_MODE_GEMINI); +} diff --git a/keyboards/keebio/levinson/keymaps/dcompact/readme.md b/keyboards/keebio/levinson/keymaps/dcompact/readme.md new file mode 100644 index 00000000000..cd88c3fed34 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/dcompact/readme.md @@ -0,0 +1,45 @@ +# DCompact Layout + +**Dvorak, Layered, Mouse-Enabled, Compact -- now with Plover~** + +_See [the layout source](keymap.c) for the actual layout_ + +## Goals + +The following are the goals kept in mind when designing the DCompact +layout: + +- Provide minimal travel distance when typing English or coding +- Consistent muscle memory translation from standard QWERTY +- Stateless typing experience +- OS-agnostic features, macros, and key placement +- Minimize dependence on mouse usage + +These are generally all met or balanced within reason. This layout is +not intended at all to be a familiar layout for much of anyone (except +maybe those who already type in Dvorak) -- this is meant to amplify the +best parts of having limited, ortholinear keys with layering. + +## As Reference Material + +If you're reading this hoping to find reference material to implement +your own layout, then please feel free to copy over this layout and +make edits where you see fit. I removed a lot of the features I felt +extraneous to my usage and simplified style where I felt needed. This +would hopefully mean that my code should feel like a good base to +develop from for those new to QMK. + +_Remember that settings defined in the layout directory override and +merge with those in the keyboard folder_ + +## Relevant Links + +- [Online Dvorak Layout Trainer](https://learn.dvorak.nl/) +- [Dvorak Wikipedia Page](https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard) +- [QMK Docs](https://docs.qmk.fm/#/) +- [QMK KeyCode Reference](https://docs.qmk.fm/#/keycodes) + +## Contact + +Maintainer: [Dan](https://github.com/loksonarius) + diff --git a/keyboards/keebio/levinson/keymaps/dcompact/rules.mk b/keyboards/keebio/levinson/keymaps/dcompact/rules.mk new file mode 100644 index 00000000000..cd031e0d36a --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/dcompact/rules.mk @@ -0,0 +1,13 @@ +# https://beta.docs.qmk.fm/reference/config-options#feature-options +# Features Specifically Wanted +EXTRAKEY_ENABLE = yes +STENO_ENABLE = yes +NKRO_ENABLE = yes +AUDIO_ENABLE = yes + +# Features taking up space +MOUSEKEY_ENABLE = no +MIDI_ENABLE = no +CONSOLE_ENABLE = no +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no diff --git a/keyboards/keebio/levinson/keymaps/default/config.h b/keyboards/keebio/levinson/keymaps/default/config.h new file mode 100644 index 00000000000..be2d71e8f02 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/default/config.h @@ -0,0 +1,28 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C + +/* Select hand configuration */ +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/keebio/levinson/keymaps/default/keymap.c b/keyboards/keebio/levinson/keymaps/default/keymap.c new file mode 100644 index 00000000000..abf253380b2 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/default/keymap.c @@ -0,0 +1,208 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + BL_STEP, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/levinson/keymaps/bakingpy2u/rules.mk b/keyboards/keebio/levinson/keymaps/default/rules.mk similarity index 100% rename from keyboards/levinson/keymaps/bakingpy2u/rules.mk rename to keyboards/keebio/levinson/keymaps/default/rules.mk diff --git a/keyboards/keebio/levinson/keymaps/drogglbecher/config.h b/keyboards/keebio/levinson/keymaps/drogglbecher/config.h new file mode 100644 index 00000000000..ef96ff00b14 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/drogglbecher/config.h @@ -0,0 +1,17 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +/* #define USE_I2C */ + +/* Select hand configuration */ + +#define MASTER_LEFT +/* #define _MASTER_RIGHT */ +/* #define EE_HANDS */ + +#endif diff --git a/keyboards/keebio/levinson/keymaps/drogglbecher/keymap.c b/keyboards/keebio/levinson/keymaps/drogglbecher/keymap.c new file mode 100644 index 00000000000..b8d2dc59496 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/drogglbecher/keymap.c @@ -0,0 +1,76 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _FN0 0 +#define _FN1 1 +#define _FN2 2 + +#define KC_X1 MO(_FN1) +#define KC_X2 MO(_FN2) + +#define KC_LPRN LSFT(KC_9) // ( +#define KC_RPRN LSFT(KC_0) // ) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* ┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ + * │ ESC │ q │ w │ e │ r │ t │ │ y │ u │ i │ o │ p │ BS │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ CTRL │ a │ s │ d │ f │ g │ │ h │ j │ k │ l │ " ' │ RET │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ SHFT │ z │ x │ c │ v │ b │ │ n │ m │ [ { │ ] } │ ; : │ SHFT │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ L1 │ ALT │ L2 │ TAB | SPC │ SPC │ │ SPC │ SPC │ , < │ . > │ - _ │ / ? │ + * └──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ + */ + + [_FN0] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LBRC, KC_RBRC, KC_SCLN, KC_RSFT, \ + KC_X1, KC_LALT, KC_X2, KC_TAB, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_COMM, KC_DOT, KC_MINS, KC_SLSH \ + ), + + /* ┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ + * │ │ 1 │ 2 │ 3 │ 4 │ 5 │ │ 6 │ 7 │ 8 │ 9 │ 0 │ DEL │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ │ ä │ ö │ ü │ ß │ │ │ LEFT │ DOWN │ UP │ RGT │ │ │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ │ Ä │ Ö │ Ü │ € │ │ │ │ │ ( │ ) │ │ │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ | │ │ | SPC │ SPC │ │ SPC │ SPC │ │ │ │ \ | │ + * └──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ + */ + + [_FN1] = LAYOUT_ortho_4x12( \ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, UC(L'ä'), UC(L'ö'), UC(L'ü'), UC(L'ß'), _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_PIPE, \ + _______, UC(L'Ä'), UC(L'Ö'), UC(L'Ü'), UC(L'€'), _______, _______, _______, KC_LPRN, KC_RPRN, _______, _______, \ + _______, _______, _______, KC_TAB, KC_SPC, KC_SPC, KC_SPC, KC_SPC, _______, _______, _______, KC_BSLS \ + ), + + /* ┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ + * │ ` │ ! │ @ │ # │ $ │ % │ │ ^ │ & │ * │ ~ │ + │ = │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ │ │ │ │ │ │ │ HOME │ PGDN │ PGUP │ END │ │ │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ │ │ │ │ SPC │ SPC │ │ SPC │ SPC │ │ VOL+ │ VOL- │ MUTE │ + * └──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ + */ + + [_FN2] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_TILD, KC_PLUS, KC_PEQL, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, _______, _______, _______, KC_SPC, KC_SPC, KC_SPC, KC_SPC, _______, KC_VOLD, KC_VOLU, KC_MUTE \ + ) + +}; + +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; diff --git a/keyboards/keebio/levinson/keymaps/drogglbecher/rules.mk b/keyboards/keebio/levinson/keymaps/drogglbecher/rules.mk new file mode 100644 index 00000000000..b2a5451c82d --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/drogglbecher/rules.mk @@ -0,0 +1,7 @@ +AUTO_SHIFT_ENABLE = no +AUTO_SHIFT_MODIFIERS = no +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no +UNICODE_ENABLE = yes +DEFAULT_FOLDER = levinson/rev2 + diff --git a/keyboards/levinson/keymaps/jyh/config.h b/keyboards/keebio/levinson/keymaps/jyh/config.h similarity index 100% rename from keyboards/levinson/keymaps/jyh/config.h rename to keyboards/keebio/levinson/keymaps/jyh/config.h diff --git a/keyboards/levinson/keymaps/jyh/keymap.c b/keyboards/keebio/levinson/keymaps/jyh/keymap.c similarity index 100% rename from keyboards/levinson/keymaps/jyh/keymap.c rename to keyboards/keebio/levinson/keymaps/jyh/keymap.c diff --git a/keyboards/levinson/keymaps/jyh/readme.md b/keyboards/keebio/levinson/keymaps/jyh/readme.md similarity index 100% rename from keyboards/levinson/keymaps/jyh/readme.md rename to keyboards/keebio/levinson/keymaps/jyh/readme.md diff --git a/keyboards/levinson/keymaps/jyh/rules.mk b/keyboards/keebio/levinson/keymaps/jyh/rules.mk similarity index 100% rename from keyboards/levinson/keymaps/jyh/rules.mk rename to keyboards/keebio/levinson/keymaps/jyh/rules.mk diff --git a/keyboards/levinson/keymaps/jyh2/config.h b/keyboards/keebio/levinson/keymaps/jyh2/config.h similarity index 100% rename from keyboards/levinson/keymaps/jyh2/config.h rename to keyboards/keebio/levinson/keymaps/jyh2/config.h diff --git a/keyboards/levinson/keymaps/jyh2/keymap.c b/keyboards/keebio/levinson/keymaps/jyh2/keymap.c similarity index 100% rename from keyboards/levinson/keymaps/jyh2/keymap.c rename to keyboards/keebio/levinson/keymaps/jyh2/keymap.c diff --git a/keyboards/levinson/keymaps/jyh2/readme.md b/keyboards/keebio/levinson/keymaps/jyh2/readme.md similarity index 100% rename from keyboards/levinson/keymaps/jyh2/readme.md rename to keyboards/keebio/levinson/keymaps/jyh2/readme.md diff --git a/keyboards/levinson/keymaps/jyh2/rules.mk b/keyboards/keebio/levinson/keymaps/jyh2/rules.mk similarity index 100% rename from keyboards/levinson/keymaps/jyh2/rules.mk rename to keyboards/keebio/levinson/keymaps/jyh2/rules.mk diff --git a/keyboards/levinson/keymaps/losinggeneration/README.md b/keyboards/keebio/levinson/keymaps/losinggeneration/README.md similarity index 100% rename from keyboards/levinson/keymaps/losinggeneration/README.md rename to keyboards/keebio/levinson/keymaps/losinggeneration/README.md diff --git a/keyboards/levinson/keymaps/losinggeneration/config.h b/keyboards/keebio/levinson/keymaps/losinggeneration/config.h similarity index 100% rename from keyboards/levinson/keymaps/losinggeneration/config.h rename to keyboards/keebio/levinson/keymaps/losinggeneration/config.h diff --git a/keyboards/levinson/keymaps/losinggeneration/keymap.c b/keyboards/keebio/levinson/keymaps/losinggeneration/keymap.c similarity index 100% rename from keyboards/levinson/keymaps/losinggeneration/keymap.c rename to keyboards/keebio/levinson/keymaps/losinggeneration/keymap.c diff --git a/keyboards/keebio/levinson/keymaps/losinggeneration/rules.mk b/keyboards/keebio/levinson/keymaps/losinggeneration/rules.mk new file mode 100644 index 00000000000..ee3ea67f7d8 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/losinggeneration/rules.mk @@ -0,0 +1,14 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +AUDIO_ENABLE = no # Audio output on port C6 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +COMMAND_ENABLE = no # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + diff --git a/keyboards/levinson/keymaps/mmacdougall/README.md b/keyboards/keebio/levinson/keymaps/mmacdougall/README.md similarity index 100% rename from keyboards/levinson/keymaps/mmacdougall/README.md rename to keyboards/keebio/levinson/keymaps/mmacdougall/README.md diff --git a/keyboards/levinson/keymaps/mmacdougall/config.h b/keyboards/keebio/levinson/keymaps/mmacdougall/config.h similarity index 100% rename from keyboards/levinson/keymaps/mmacdougall/config.h rename to keyboards/keebio/levinson/keymaps/mmacdougall/config.h diff --git a/keyboards/keebio/levinson/keymaps/mmacdougall/keymap.c b/keyboards/keebio/levinson/keymaps/mmacdougall/keymap.c new file mode 100644 index 00000000000..76d9c729980 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/mmacdougall/keymap.c @@ -0,0 +1,197 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |B Step|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + BL_STEP, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/levinson/keymaps/default/rules.mk b/keyboards/keebio/levinson/keymaps/mmacdougall/rules.mk similarity index 100% rename from keyboards/levinson/keymaps/default/rules.mk rename to keyboards/keebio/levinson/keymaps/mmacdougall/rules.mk diff --git a/keyboards/keebio/levinson/keymaps/omgvee/config.h b/keyboards/keebio/levinson/keymaps/omgvee/config.h new file mode 100644 index 00000000000..ba005c0b25b --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/omgvee/config.h @@ -0,0 +1,26 @@ +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define TAPPING_TERM 150 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#undef PRODUCT +#define PRODUCT "Vee's hotswappable LEVINSON purely ortholinear keeb" + diff --git a/keyboards/keebio/levinson/keymaps/omgvee/keymap.c b/keyboards/keebio/levinson/keymaps/omgvee/keymap.c new file mode 100644 index 00000000000..8dab1c2745c --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/omgvee/keymap.c @@ -0,0 +1,185 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _FN3 5 +#define _FN4 6 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + FN3, + FN4, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen +#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen +#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen +#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen +#define KC_X0 MT(MOD_LCTL, KC_ESC) +#define KC_SCAP SFT_T(KC_CAPS) +#define KC_LOW LOWER +#define KC_RAIS RAISE +#define KC_X3 LT(_FN3, KC_GRV) +#define KC_SENT MT(MOD_LSFT, KC_ENT) +#define KC_X5 BL_STEP +#define KC_CTB CTL_T(KC_TAB) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GESC, Q , W , E , R , T , Y , U , I , O , P ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + SCAP, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CTB, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,SENT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI,LOW ,ENT , SPC,RAIS,RALT, , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + SCAP, NO ,HOME,PGDN,PGUP, END, LEFT,DOWN, UP ,RGHT, INS, DEL, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CTB , F1 , F2 , F3 , F4 , F5 , F6, F7 , F8 , F9 , F10, F11, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, LOW, ENT, SPC,RAIS,RALT, , , F12 + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB, EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, DEL, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + SCAP, , , , , , MINS, EQL, ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CTB, , , , , , UNDS,PLUS,VOLD,VOLU,MUTE,SENT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, LOW, ENT, SPC,RAIS,RALT, , , NO + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GESC, Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + SCAP, A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CTB, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH,SENT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, LOW, ENT, SPC,RAIS,RALT, , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_DVORAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , O , E , U , I , D , H , T , N , S ,SLSH, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT,SCLN, Q , J , K , X , B , M , W , V , Z ,SENT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, LOW, ENT, SPC,RAIS,RALT, , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_FN3] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , MS_L,MS_D,MS_U,MS_R,WH_L,WH_R, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , BTN1,WH_D,WH_U,BTN2, , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + RESET, QWERTY, COLEMAK, DVORAK, _______, EEP_RST, KC_MNXT, KC_MPRV, KC_MFFD, KC_MRWD, DVORAK, KC_EJCT, \ + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, KC_PGUP, KC_HOME, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, CK_UP, CK_DOWN, \ + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_PGDN, KC_END, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, \ + BL_TOGG, BL_INC, BL_DEC, BL_BRTG, _______, _______, CK_RST, _______, CK_TOGG, MU_MOD, MU_TOG, AU_TOG \ + ) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/levinson/keymaps/omgvee/readme.md b/keyboards/keebio/levinson/keymaps/omgvee/readme.md new file mode 100644 index 00000000000..f882c98b0bf --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/omgvee/readme.md @@ -0,0 +1,21 @@ +# What I want from my LEVINSON (Let's Split on steroids) keymap +==================================================================================================== + + +![My indigo Levinson keeb](https://i.imgur.com/sPfzSTk.jpg) + +- media keys and media controls, including Eject, for however rare those computers with OSX *and* bloody optical drives might be +- in-switch LED intensity controls (+/-) +- underglow RGB hue/color controls +- underglow RGB intensity controls +- familiar key arrangement with Enter and symbols on the usual keys (to the right hand side, on some layer, pref RAISE for one-handed operation) +- navigation keys should be the vim ones really; +- arrow keys on one layer(most likely on the ADJUST one, but also on LOWER, as per my usual other split keebs) +- mouse keys too +- hardware reset for the ProMicro to put it bootloader mode, sounds, eeprom reset, backlights and rgb controls reset, etc. + +See keymap.c for layouts +See config.h for various toggles and flags + + +P.S> this is my first fully and purely ortholinear keyboard, as opposed to my [Iris](https://github.com/qmk/qmk_firmware/tree/master/keyboards/keebio/iris/keymaps/omgvee "Vee's Iris keeb"), [Helidox](https://github.com/qmk/qmk_firmware/tree/master/keyboards/crkbd/keymaps/omgvee "Vee's beloved Helidox keeb"), MiniDox, etc., which are mildly staggered, but on the vertical side, which seems better imho than this... but we'll see how I get on with it over time... diff --git a/keyboards/keebio/levinson/keymaps/omgvee/rules.mk b/keyboards/keebio/levinson/keymaps/omgvee/rules.mk new file mode 100644 index 00000000000..3540947ac5a --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/omgvee/rules.mk @@ -0,0 +1,11 @@ +EXTRAFLAGS += -flto +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes +MOUSEKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +TAP_DANCE_ENABLE = no +NKRO_ENABLE = yes +LEADER_ENABLE = no +UNICODE_ENABLE = yes +AUDIO_ENABLE = yes diff --git a/keyboards/iris/keymaps/vyolle_steno/config.h b/keyboards/keebio/levinson/keymaps/steno/config.h similarity index 100% rename from keyboards/iris/keymaps/vyolle_steno/config.h rename to keyboards/keebio/levinson/keymaps/steno/config.h diff --git a/keyboards/keebio/levinson/keymaps/steno/keymap.c b/keyboards/keebio/levinson/keymaps/steno/keymap.c new file mode 100644 index 00000000000..cd7493467a7 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/steno/keymap.c @@ -0,0 +1,148 @@ +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +extern keymap_config_t keymap_config; + +#define _PLOVER 0 +#define _QWERTY 1 +#define _LOWER 2 +#define _RAISE 3 +#define _ADJUST 4 + +enum custom_keycodes +{ + PLOVER = SAFE_RANGE, + QWERTY, + LOWER, + RAISE, + ADJUST, + EXT_QWE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = +{ + + [_PLOVER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + STN_PWR, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + STN_FN, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, STN_RE1, STN_RE2, XXXXXXX, STN_A, STN_O, STN_E, STN_U, XXXXXXX, XXXXXXX, QWERTY, XXXXXXX + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RSFT, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LGUI, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LALT, KC_MINUS, KC_TAB, KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RCTL, KC_RGUI, EXT_QWE, KC_RALT + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_7, KC_8, KC_9, KC_PLUS, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_F7, KC_F8, KC_LEFT, KC_UP, KC_RGHT, KC_F9, KC_PSLS, KC_4, KC_5, KC_6, KC_MINUS, KC_MUTE, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_F10, KC_F11, KC_DOWN, KC_F11, KC_F12, KC_PAST, KC_1, KC_2, KC_3, KC_EQL, KC_VOLU, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, KC_0, _______, KC_COMM, KC_DOT, KC_ENT, KC_VOLD + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRAVE, KC_TILD, KC_UNDS, KC_EQL, KC_PIPE, _______, KC_HOME, KC_DEL, _______, KC_INS, KC_PGUP, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_BSLASH,KC_LCBR, KC_RCBR, KC_MINUS, KC_LBRC, KC_RBRC, KC_END, KC_LEFT, KC_UP, KC_RGHT, KC_PGDN, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_COLN, KC_LT, KC_GT, KC_PLUS, KC_LPRN, KC_RPRN, _______, _______, KC_DOWN, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, KC_CAPS, KC_MENU, KC_APP, KC_PSCR, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______,_______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_SLCK, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + +}; + + +void matrix_init_user() { + steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case PLOVER: + if (record->event.pressed) { + set_single_persistent_default_layer(_PLOVER); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case QWERTY: + if (!record->event.pressed) { + layer_on(_QWERTY); + } + return false; + break; + case EXT_QWE: + if (record->event.pressed) { + layer_off(_QWERTY); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/levinson/keymaps/steno/rules.mk b/keyboards/keebio/levinson/keymaps/steno/rules.mk new file mode 100644 index 00000000000..9c31e590ee6 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/steno/rules.mk @@ -0,0 +1,7 @@ +EXTRAKEY_ENABLE = no # Disable if you run out of usb endpoints. Media keys need this to work. +MOUSEKEY_ENABLE = no # Mouse keys(+4700) Uses extra usb enpoints. +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER. +AUDIO_ENABLE = no # Audio output on port C6 +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = yes +BOOTMAGIC_ENABLE = yes diff --git a/keyboards/levinson/keymaps/treadwell/config.h b/keyboards/keebio/levinson/keymaps/treadwell/config.h similarity index 100% rename from keyboards/levinson/keymaps/treadwell/config.h rename to keyboards/keebio/levinson/keymaps/treadwell/config.h diff --git a/keyboards/keebio/levinson/keymaps/treadwell/keymap.c b/keyboards/keebio/levinson/keymaps/treadwell/keymap.c new file mode 100644 index 00000000000..2f0da0f525c --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/treadwell/keymap.c @@ -0,0 +1,177 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _GAME 2 +#define _NUMB 3 +#define _CODE 4 +#define _SYS 5 +#define _FN4 6 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + GAME, + NUMB, + CODE, + SYS, + FN4, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_X1 CODE +#define KC_X2 NUMB +#define KC_X3 MO(_SYS) +#define KC_X4 MT(MOD_LSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + BSPC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, X1 ,LALT, SPC , X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + BSPC, A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, X1 ,LALT, SPC , X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_GAME] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, X2 , SPC, SPC , X1 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_NUMB] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, DEL, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,UNDS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , ,MPRV,MNXT,MPLY, , ,VOLD,VOLU,MUTE, , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , ,LALT, , , , , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_CODE] = LAYOUT_kc( + //,----+------+----+----+----+----. ,----+----+----+----+----+----. + ESC , , , UP , , , PGUP,HOME,LPRN,RPRN,BSLS,PIPE, + //|----+------+----+----+----+----| |----+----+----+----+----+----| + CAPS,SELECT,LEFT,DOWN,RGHT,DEL , PGDN, END,LBRC,RBRC,MINS,UNDS, + //|----+------+----+----+----+----| |----+----+----+----+----+----| + LSFT, UNDO ,CUT ,COPY,PASTE, , LEFT,RGHT,LCBR,RCBR,PLUS,PEQL, + //|----+------+----+----+----+----| |----+----+----+----+----+----| + , , , , ,LALT, , , , , , + //`----+------+----+----+----+----' `----+----+----+----+----+----' + ), + + [_SYS] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, GAME , _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case GAME: + if (record->event.pressed) { + set_single_persistent_default_layer(_GAME); + } + return false; + break; + case NUMB: + if (record->event.pressed) { + layer_on(_NUMB); + update_tri_layer(_NUMB, _CODE, _ADJUST); + } else { + layer_off(_NUMB); + update_tri_layer(_NUMB, _CODE, _ADJUST); + } + return false; + break; + case CODE: + if (record->event.pressed) { + layer_on(_CODE); + update_tri_layer(_NUMB, _CODE, _ADJUST); + } else { + layer_off(_CODE); + update_tri_layer(_NUMB, _CODE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/levinson/keymaps/treadwell/rules.mk b/keyboards/keebio/levinson/keymaps/treadwell/rules.mk new file mode 100644 index 00000000000..1d2d9e5a9c4 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/treadwell/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no diff --git a/keyboards/levinson/keymaps/valgrahf/config.h b/keyboards/keebio/levinson/keymaps/valgrahf/config.h similarity index 100% rename from keyboards/levinson/keymaps/valgrahf/config.h rename to keyboards/keebio/levinson/keymaps/valgrahf/config.h diff --git a/keyboards/keebio/levinson/keymaps/valgrahf/keymap.c b/keyboards/keebio/levinson/keymaps/valgrahf/keymap.c new file mode 100644 index 00000000000..cbe86db3735 --- /dev/null +++ b/keyboards/keebio/levinson/keymaps/valgrahf/keymap.c @@ -0,0 +1,63 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +#define KC_ KC_TRNS +#define KC_FN1 LT(_FN1, KC_NO) +#define KC_FN2 LT(_FN2, KC_NO) +#define KC_SPFN LT(_FN1, KC_SPACE) +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_kc_ortho_4x12( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB, Q , W , E , R , T , Y , U , I , O , P ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ESC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM, DOT,SLSH,PGUP, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL,LGUI,LALT, FN1, ENT, ENT, SPC, SPC, FN2,HOME, END,PGDN + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_FN1] = LAYOUT_kc_ortho_4x12( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL, F1, F2, F3, F4, F5, F6,MINS, EQL,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , F7, F8, F9, F10, F11, F12, , , , UP, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , ,LEFT,DOWN,RIGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_FN2] = LAYOUT_kc_ortho_4x12( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL,RHUI,RSAI,RVAI, , , ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RHUD,RSAD,RVAD, , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RTOG,RMOD, , , , , , , , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + +}; diff --git a/keyboards/levinson/keymaps/valgrahf/rules.mk b/keyboards/keebio/levinson/keymaps/valgrahf/rules.mk similarity index 100% rename from keyboards/levinson/keymaps/valgrahf/rules.mk rename to keyboards/keebio/levinson/keymaps/valgrahf/rules.mk diff --git a/keyboards/levinson/keymaps/xtonhasvim/config.h b/keyboards/keebio/levinson/keymaps/xtonhasvim/config.h similarity index 100% rename from keyboards/levinson/keymaps/xtonhasvim/config.h rename to keyboards/keebio/levinson/keymaps/xtonhasvim/config.h diff --git a/keyboards/levinson/keymaps/xtonhasvim/keymap.c b/keyboards/keebio/levinson/keymaps/xtonhasvim/keymap.c similarity index 100% rename from keyboards/levinson/keymaps/xtonhasvim/keymap.c rename to keyboards/keebio/levinson/keymaps/xtonhasvim/keymap.c diff --git a/keyboards/levinson/keymaps/xtonhasvim/readme.md b/keyboards/keebio/levinson/keymaps/xtonhasvim/readme.md similarity index 100% rename from keyboards/levinson/keymaps/xtonhasvim/readme.md rename to keyboards/keebio/levinson/keymaps/xtonhasvim/readme.md diff --git a/keyboards/levinson/keymaps/xtonhasvim/rules.mk b/keyboards/keebio/levinson/keymaps/xtonhasvim/rules.mk similarity index 100% rename from keyboards/levinson/keymaps/xtonhasvim/rules.mk rename to keyboards/keebio/levinson/keymaps/xtonhasvim/rules.mk diff --git a/keyboards/levinson/levinson.c b/keyboards/keebio/levinson/levinson.c similarity index 100% rename from keyboards/levinson/levinson.c rename to keyboards/keebio/levinson/levinson.c diff --git a/keyboards/keebio/levinson/levinson.h b/keyboards/keebio/levinson/levinson.h new file mode 100644 index 00000000000..503b1f0fd87 --- /dev/null +++ b/keyboards/keebio/levinson/levinson.h @@ -0,0 +1,27 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_keebio_levinson_rev1 + #include "rev1.h" +#elif KEYBOARD_keebio_levinson_rev2 + #include "rev2.h" +#elif KEYBOARD_keebio_levinson_rev3 + #include "rev3.h" +#endif + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ + ) + +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc diff --git a/keyboards/keebio/levinson/readme.md b/keyboards/keebio/levinson/readme.md new file mode 100644 index 00000000000..8cb4ff1cf79 --- /dev/null +++ b/keyboards/keebio/levinson/readme.md @@ -0,0 +1,28 @@ +Levinson +======== + +A split 40% split 4x12 ortholinear keyboard made and sold by Keebio. It's essentially a Let's Split with LED backlight support and 2u thumb key support. [More info at Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro, Elite-C +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make levinson/rev2:default + +Example of flashing this keyboard with Pro micro: + + make levinson/rev2:default:avrdude + +Example of flashing this keyboard with Elite-C: + +You'll need to add `BOOTLOADER = atmel-dfu` to your `rules.mk` to ensure that resetting the board works properly. + +Hold the reset button on the Elite-C board, or the reset button on the keyboard if already assembled, then release the button and run: + + make levinson/rev2:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +A build guide for this keyboard can be found here: [Levinson Build Guide](https://docs.keeb.io) diff --git a/keyboards/keebio/levinson/rev1/config.h b/keyboards/keebio/levinson/rev1/config.h new file mode 100644 index 00000000000..52cf7baf7a1 --- /dev/null +++ b/keyboards/keebio/levinson/rev1/config.h @@ -0,0 +1,59 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1146 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Levinson +#define DESCRIPTION Split 40 percent ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 12 // Number of LEDs + +/* Backlight LEDs */ +#define BACKLIGHT_PIN C6 +#define BACKLIGHT_LEVELS 7 diff --git a/keyboards/levinson/rev1/rev1.c b/keyboards/keebio/levinson/rev1/rev1.c similarity index 100% rename from keyboards/levinson/rev1/rev1.c rename to keyboards/keebio/levinson/rev1/rev1.c diff --git a/keyboards/levinson/rev1/rev1.h b/keyboards/keebio/levinson/rev1/rev1.h similarity index 100% rename from keyboards/levinson/rev1/rev1.h rename to keyboards/keebio/levinson/rev1/rev1.h diff --git a/keyboards/levinson/rev1/rules.mk b/keyboards/keebio/levinson/rev1/rules.mk similarity index 100% rename from keyboards/levinson/rev1/rules.mk rename to keyboards/keebio/levinson/rev1/rules.mk diff --git a/keyboards/keebio/levinson/rev2/config.h b/keyboards/keebio/levinson/rev2/config.h new file mode 100644 index 00000000000..1365ae792c1 --- /dev/null +++ b/keyboards/keebio/levinson/rev2/config.h @@ -0,0 +1,59 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1146 +#define DEVICE_VER 0x0200 +#define MANUFACTURER Keebio +#define PRODUCT Levinson +#define DESCRIPTION Split 40 percent ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, D7, E6, B4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 12 // Number of LEDs + +/* Backlight LEDs */ +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 7 diff --git a/keyboards/levinson/rev2/rev2.c b/keyboards/keebio/levinson/rev2/rev2.c similarity index 100% rename from keyboards/levinson/rev2/rev2.c rename to keyboards/keebio/levinson/rev2/rev2.c diff --git a/keyboards/levinson/rev2/rev2.h b/keyboards/keebio/levinson/rev2/rev2.h similarity index 100% rename from keyboards/levinson/rev2/rev2.h rename to keyboards/keebio/levinson/rev2/rev2.h diff --git a/keyboards/levinson/rev2/rules.mk b/keyboards/keebio/levinson/rev2/rules.mk similarity index 100% rename from keyboards/levinson/rev2/rules.mk rename to keyboards/keebio/levinson/rev2/rules.mk diff --git a/keyboards/keebio/levinson/rev3/config.h b/keyboards/keebio/levinson/rev3/config.h new file mode 100644 index 00000000000..3e45b9d422b --- /dev/null +++ b/keyboards/keebio/levinson/rev3/config.h @@ -0,0 +1,61 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1146 +#define DEVICE_VER 0x0300 +#define MANUFACTURER Keebio +#define PRODUCT Levinson +#define DESCRIPTION Split 40 percent ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, E6, B4, B5 } +#define MATRIX_COL_PINS { D3, F4, F7, B1, B3, B2 } +#define MATRIX_ROW_PINS_RIGHT { D4, B2, B3, B1 } +#define MATRIX_COL_PINS_RIGHT { F4, F7, D3, B5, B4, E6 } +#define SPLIT_HAND_PIN D2 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D7 +#define RGBLED_NUM 12 // Number of LEDs +#define RGBLED_SPLIT { 6, 6 } + +/* Backlight LEDs */ +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 7 diff --git a/keyboards/keebio/levinson/rev3/rev3.c b/keyboards/keebio/levinson/rev3/rev3.c new file mode 100644 index 00000000000..573fa787baa --- /dev/null +++ b/keyboards/keebio/levinson/rev3/rev3.c @@ -0,0 +1,22 @@ +#include "levinson.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/keebio/levinson/rev3/rev3.h b/keyboards/keebio/levinson/rev3/rev3.h new file mode 100644 index 00000000000..a31bfd15c35 --- /dev/null +++ b/keyboards/keebio/levinson/rev3/rev3.h @@ -0,0 +1,34 @@ +#pragma once + +#include "levinson.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 } \ + } + +#define LAYOUT_ortho_4x12 LAYOUT diff --git a/keyboards/nyquist/rev2/rules.mk b/keyboards/keebio/levinson/rev3/rules.mk similarity index 100% rename from keyboards/nyquist/rev2/rules.mk rename to keyboards/keebio/levinson/rev3/rules.mk diff --git a/keyboards/keebio/levinson/rules.mk b/keyboards/keebio/levinson/rules.mk new file mode 100644 index 00000000000..cdaef48890f --- /dev/null +++ b/keyboards/keebio/levinson/rules.mk @@ -0,0 +1,33 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +LAYOUTS = ortho_4x12 +DEFAULT_FOLDER = keebio/levinson/rev2 diff --git a/keyboards/keebio/nyquist/config.h b/keyboards/keebio/nyquist/config.h new file mode 100644 index 00000000000..6868dc13541 --- /dev/null +++ b/keyboards/keebio/nyquist/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" diff --git a/keyboards/keebio/nyquist/info.json b/keyboards/keebio/nyquist/info.json new file mode 100644 index 00000000000..295864cfc98 --- /dev/null +++ b/keyboards/keebio/nyquist/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "Nyquist", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}] + }, + "LAYOUT_ortho_5x12": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}] + } + } +} diff --git a/keyboards/nyquist/keymaps/DivergeJM/README.md b/keyboards/keebio/nyquist/keymaps/DivergeJM/README.md similarity index 100% rename from keyboards/nyquist/keymaps/DivergeJM/README.md rename to keyboards/keebio/nyquist/keymaps/DivergeJM/README.md diff --git a/keyboards/nyquist/keymaps/DivergeJM/config.h b/keyboards/keebio/nyquist/keymaps/DivergeJM/config.h similarity index 100% rename from keyboards/nyquist/keymaps/DivergeJM/config.h rename to keyboards/keebio/nyquist/keymaps/DivergeJM/config.h diff --git a/keyboards/keebio/nyquist/keymaps/DivergeJM/keymap.c b/keyboards/keebio/nyquist/keymaps/DivergeJM/keymap.c new file mode 100644 index 00000000000..c0c1760cd16 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/DivergeJM/keymap.c @@ -0,0 +1,310 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum custom_layers { + _COLEMAK, + _QWERTY, + _DVORAK, + _LOWER, + _RAISE, + _FUNCTION, + _MOUSE, + _ADJUST +}; + +enum custom_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY, + DVORAK, + LOWER, + RAISE, + FUNCTION, + MOUSE, + ADJUST +}; + +enum custom_macros { + R_PIPE, + R_POINT +}; +/* +// Tap Dance Declarations +enum { + TD_ZERO_ENT = 0 +}; + +// Tap Dance Definitions + qk_tap_dance_action_t tap_dance_actions[] = { + [TD_ZERO_ENT] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_ENT) +}; +*/ + // Enable these functions using FUNC(n) macro. + const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), //Hold for momentary Lower layer, Tap for Space, + [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_ENT), //Hold for momentary Mouse layer, Tap for Enter, + [2] = ACTION_LAYER_MOMENTARY(_FUNCTION), //Hold for momentary Function + [3] = ACTION_LAYER_MOMENTARY(_MOUSE) //Hold for momentary MOUSE + }; +#define SPC_LW FUNC(0) +#define ENT_RS FUNC(1) +#define FNC FUNC(2) +#define MSE FUNC(3) +#define PIPE M(R_PIPE) +#define POINT M(R_POINT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak + * .----------------------------------------. .-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | BS | A | R | S | T | D | | H | N | E | I | O | " | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | LSPO| Z | X | C | V | B | | K | M | , | . | / | RSPC | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl| LGUI | Lower| LAlt | Space/Lower | | Enter/Raise | Fn | Mouse| Menu | Ctrl | + * `----------------------------------------' `-----------------------------------------' + */ +[_COLEMAK] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, \ + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, SPC_LW, ENT_RS, ENT_RS, FNC, MSE, KC_APP, KC_RCTL \ + ), + +/* QWERTY - + * .----------------------------------------. .-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | BS | A | S | D | F | G | | H | J | K | L | ; | " | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | LSPO| Z | X | C | V | B | | N | M | , | . | / | RSPC | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl| LGUI | Lower| LAlt | Space/Lower | | Enter/Raise | Fn | Mouse| Menu | Ctrl | + * `----------------------------------------' '-----------------------------------------' + */ + +[_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, SPC_LW, ENT_RS, ENT_RS, FNC, MSE, KC_APP, KC_RCTL \ + ), + +/* Dvorak + * .----------------------------------------. .-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-----| |------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | | F | G | C | R | L | \ | + * |------+------+------+------+------+-----| |------+------+------+------+------+------| + * | BS | A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+-----| |------+------+------+------+------+------| + * | LSPO | ; | Q | J | K | X | | B | M | W | V | Z | RSPC | + * |------+------+------+------+------+-----| |------+------+------+------+------+------| + * | Ctrl | LGUI | Lower| LAlt | Space/Lower| | Enter/Raise | Fn | Mouse| Menu | Ctrl | + * `----------------------------------------' '-----------------------------------------' + */ + +[_DVORAK] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, \ + KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, \ + KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, SPC_LW, ENT_RS, ENT_RS, FNC, MSE, KC_APP, KC_RCTL \ +), + +/* Lower + * ,-----------------------------------------. .-----------------------------------------. + * | Esc | | | | | | | = | / | * | - | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | PgUp | Home | Up | End | | | 7 | 8 | 9 | + | | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | BS | PgDn | Left | Down |Right | | | 4 | 5 | 6 | Enter| | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | LSPO | Z | X | C | V | | | 1 | 2 | 3 | Enter| | RSPC | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | LGUI | Lower| LAlt | Space/Lower | | 0 | . | Fn |ADJUST| Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ +[_LOWER] = LAYOUT( \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PEQL, KC_PSLS, KC_PAST, KC_MINS, XXXXXXX, _______, \ + _______, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_7, KC_8, KC_9, KC_PPLS, XXXXXXX, _______,\ + _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, KC_4, KC_5, KC_6, KC_PENT, XXXXXXX, _______,\ + _______, _______, _______, _______, _______, XXXXXXX, KC_1, KC_2, KC_3, KC_PENT, XXXXXXX, _______,\ + _______, _______, _______, _______, _______, _______, KC_0, KC_0, KC_DOT, FNC, RAISE, _______ \ +), + +/* Raise + * ,-----------------------------------------. .-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | ! | @ | # | $ | % | | ^ | & | * | - | + | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | BS | | | | | | | | | | | | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | LSBO | <- | %>% | { | [ | ` | | | | ] | } | . | ? | RSBC | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | LGUI | | LAlt | Space/Lower | | Enter/Raise | Fn | Mouse| Menu | Ctrl | + * `-----------------------------------------' `-----------------------------------------' +*/ +[_RAISE] = LAYOUT( \ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, \ + _______, POINT, PIPE, KC_LCBR, KC_LBRC, KC_GRV, KC_PIPE, KC_RBRC, KC_RCBR, KC_DOT, KC_SLSH, _______, \ + _______, _______, XXXXXXX, _______, _______, _______, ENT_RS, ENT_RS, FNC, MSE, _______, _______ \ + ), + + +/*Function + * ,-----------------------------------------. .-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | Mute | Vol- | Vol+ | | | | | | | | | Ins | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Caps | Stop | |<< | >/|| | >>| | | | | | | | |PrtSc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | LSOB | | | | | | | | | | | |ScrLk | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | LGUI | | LAlt | Space/Lower | | Enter/Raise | Fn | Mouse| |PsBrk | + * `-----------------------------------------' `-----------------------------------------' + */ + +[_FUNCTION] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS , \ + KC_CAPS, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, \ + _______, _______, _______, _______, _______, _______, _______, _______, FNC, _______, _______, KC_PAUS \ + ), + +/* MOUSE + * ,----------------------------------------. .----------------------------------------. + * | Esc | | | | | | | | | | | | Del | + * |------+------+------+------+------+-----| |-----+------+------+------+------+------| + * | Tab | WhlU | WhlL | MsUp | WhlR | | | | M1 | M2 | M3 | | | + * |------+------+------+------+------+-----| |-----+------+------+------+------+------| + * | | WhlD | MsL | MsDn | MsR | | | |LClick|RClick| | | | + * |------+------+------+------+------+-----| |-----+------+------+------+------+------| + * | LSPO | | | | | | | | | | | | RSCB | + * |------+------+------+------+------+-----| |-----+------+------+------+------+------| + * | Ctrl | | | |Sensitivity | | Sensitivity| |MOUSE | | Ctrl | + * `----------------------------------------' `----------------------------------------' + */ + +[_MOUSE] = LAYOUT( + KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, \ + KC_TAB, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, XXXXXXX, XXXXXXX, KC_BTN3, KC_BTN4, KC_BTN5, XXXXXXX, XXXXXXX, \ + KC_BSPC, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSPC, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_ACL1, KC_ACL1, KC_ACL0, KC_ACL0, XXXXXXX, MSE, XXXXXXX, KC_RCTL \ + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------. ,----------------------------------------. + * | | | | | |RESET | | | | | | | | + * |------+------+------+------+------+------| |-----+------+------+------+------+------| + * | | | | | | | | |TermOn|TermOf| | | Del | + * |------+------+------+------+------+------| |-----+------+------+------+------+------| + * | | | | | | | | |Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------| |-----+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |-----+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------' `----------------------------------------' + */ + +[_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ + _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + +}; + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Macros to send R pointer & dplyr pipe +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + //R Pointer: <- + case R_POINT: + if (record->event.pressed) { // Pointer <- + SEND_STRING("<- "); +// return MACRO(D(LSFT), T(COMM), U(LSFT), T(MINS), END); + + } + break; + //dplyr pipe: %>% + case R_PIPE: + if (record->event.pressed) { // dplyr pipe %>% + SEND_STRING("%>% "); +// return MACRO(D(LSFT), T(5), T(DOT), T(5), U(LSFT), END); + } + break; + } + return MACRO_NONE; +} + +/* Cases to switch default layer to QWERTY, COLEMAK or DVORAK + and to access ADJUST layer to access the switch keys */ +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/nyquist/keymaps/DivergeJM/rules.mk b/keyboards/keebio/nyquist/keymaps/DivergeJM/rules.mk similarity index 100% rename from keyboards/nyquist/keymaps/DivergeJM/rules.mk rename to keyboards/keebio/nyquist/keymaps/DivergeJM/rules.mk diff --git a/keyboards/nyquist/keymaps/hexwire/README.md b/keyboards/keebio/nyquist/keymaps/bakingpy/README.md similarity index 100% rename from keyboards/nyquist/keymaps/hexwire/README.md rename to keyboards/keebio/nyquist/keymaps/bakingpy/README.md diff --git a/keyboards/nyquist/keymaps/hexwire/Underglow Pinouts.md b/keyboards/keebio/nyquist/keymaps/bakingpy/Underglow Pinouts.md similarity index 100% rename from keyboards/nyquist/keymaps/hexwire/Underglow Pinouts.md rename to keyboards/keebio/nyquist/keymaps/bakingpy/Underglow Pinouts.md diff --git a/keyboards/keebio/nyquist/keymaps/bakingpy/config.h b/keyboards/keebio/nyquist/keymaps/bakingpy/config.h new file mode 100644 index 00000000000..eecff3dd51c --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/bakingpy/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +// #define USE_I2C + +/* Select hand configuration */ +// #define MASTER_RIGHT +// #define EE_HANDS + +#define TAPPING_TERM 150 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/nyquist/keymaps/bakingpy/keymap.c b/keyboards/keebio/nyquist/keymaps/bakingpy/keymap.c new file mode 100644 index 00000000000..38c13f3baa6 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/bakingpy/keymap.c @@ -0,0 +1,216 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _FN3 5 +#define _FN4 6 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + FN3, + FN4, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen +#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen +#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen +#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen +#define KC_X0 MT(MOD_LCTL, KC_ESC) +#define KC_X1 LOWER +#define KC_X2 RAISE +#define KC_X3 LT(_FN3, KC_GRV) +#define KC_X4 MT(MOD_LSFT, KC_ENT) +#define KC_BL_S BL_STEP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_DVORAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , O , E , U , I , D , H , T , N , S ,SLSH, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + BL_S, , , , , , DEL , , P0 ,PDOT, , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_FN3] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , + //`----+----+----+----+----+----' `----+----+----+----+----+----' + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/nyquist/keymaps/hexwire/keymap_converter.py b/keyboards/keebio/nyquist/keymaps/bakingpy/keymap_converter.py similarity index 100% rename from keyboards/nyquist/keymaps/hexwire/keymap_converter.py rename to keyboards/keebio/nyquist/keymaps/bakingpy/keymap_converter.py diff --git a/keyboards/nyquist/keymaps/hexwire/keymap_to_readme.rb b/keyboards/keebio/nyquist/keymaps/bakingpy/keymap_to_readme.rb similarity index 100% rename from keyboards/nyquist/keymaps/hexwire/keymap_to_readme.rb rename to keyboards/keebio/nyquist/keymaps/bakingpy/keymap_to_readme.rb diff --git a/keyboards/keebio/nyquist/keymaps/bakingpy/rules.mk b/keyboards/keebio/nyquist/keymaps/bakingpy/rules.mk new file mode 100644 index 00000000000..a81250cdf6d --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/bakingpy/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/nyquist/keymaps/bramver/README.md b/keyboards/keebio/nyquist/keymaps/bramver/README.md similarity index 100% rename from keyboards/nyquist/keymaps/bramver/README.md rename to keyboards/keebio/nyquist/keymaps/bramver/README.md diff --git a/keyboards/nyquist/keymaps/bramver/config.h b/keyboards/keebio/nyquist/keymaps/bramver/config.h similarity index 100% rename from keyboards/nyquist/keymaps/bramver/config.h rename to keyboards/keebio/nyquist/keymaps/bramver/config.h diff --git a/keyboards/keebio/nyquist/keymaps/bramver/keymap.c b/keyboards/keebio/nyquist/keymaps/bramver/keymap.c new file mode 100644 index 00000000000..c671b7798c1 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/bramver/keymap.c @@ -0,0 +1,268 @@ +/* Copyright 2018 darm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _LOWER 1 +#define _RAISE 2 +#define _LMOUSE 3 +#define _RMOUSE 4 +#define _EMOJI 5 + +enum emoji_map { + UNAM, // unamused 😒 + HEYE, // smiling face with heart shaped eyes 😍 + OK, // ok hand sign 👌 + SMIR, // smirk 😏 + PRAY, // pray 🙏 + CELE, // celebration 🙌 + COOL, // smile with sunglasses 😎 + EYES, // eyes + THNK, // BIG THONK + NAIL, // Nailcare + SOS, // Vuile sos + REDB, // Red B + HNDR, // 100 + MONY, + FIRE, + CAR, + BUTT, + BNIS, + CUM, + CLAP, + TRIU, // Fart from nose + SCRM, + VOMI, + DTIV, // Detective + EXPL, // Brainsplosion + HAIR, // Haircut + DANC, // Salsa dancer + STRN, // Stronk + LEFT, // Point Left + RGHT, // Point Right +}; + +const uint32_t PROGMEM unicode_map[] = { + [UNAM] = 0x1F612, + [HEYE] = 0x1f60d, + [OK] = 0x1F44C, + [SMIR] = 0x1F60F, + [PRAY] = 0x1F64F, + [CELE] = 0x1F64C, + [COOL] = 0x1F60E, + [EYES] = 0x1F440, + [THNK] = 0x1F914, + [NAIL] = 0x1F485, + [SOS] = 0x1F198, + [REDB] = 0x1F171, + [HNDR] = 0x1F4AF, + [MONY] = 0x1F480, + [FIRE] = 0x1F525, + [CAR] = 0x1F697, + [BUTT] = 0x1F351, + [BNIS] = 0x1F346, + [CUM] = 0x1F4A6, + [CLAP] = 0x1F44F, + [TRIU] = 0x1F624, + [SCRM] = 0x1F631, + [VOMI] = 0x1F92E, + [DTIV] = 0x1F575, + [EXPL] = 0x1F92F, + [HAIR] = 0x2640, + [DANC] = 0x1F483, + [STRN] = 0x1F4AA, + [LEFT] = 0x1F448, + [RGHT] = 0x1F449, +}; + +enum custom_keycodes { + CTRL_Z = SAFE_RANGE, + CTRL_X, + CTRL_C, + CTRL_V +}; + +#define SP_LMS LT(_LMOUSE, KC_SPC) +#define SP_RMS LT(_RMOUSE, KC_SPC) +#define LOW TT(_LOWER) +#define RAI TT(_RAISE) +#define EMO TT(_EMOJI) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base + * ,-----------------------------------------. ,-----------------------------------------. + * | GEsc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | LOW | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | Z | X | C | V | B | | N | M | , | . | / | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | EMO | Alt | GUI | SPCE |SP_LMS| |SP_RMS|SP_RMS| GUI | Alt | RAI | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + [_BASE] = LAYOUT( \ + KC_GESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , /**/ KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC , \ + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , /**/ KC_Y , KC_U , KC_I , KC_O , KC_P , KC_ENT , \ + LOW , KC_A , KC_S , KC_D , KC_F , KC_G , /**/ KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT , \ + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , /**/ KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT , \ + KC_LCTL , EMO , KC_LALT , KC_LGUI , KC_SPC , SP_LMS , /**/ SP_RMS , KC_SPC , KC_RGUI , KC_RALT , RAI , KC_RCTL \ + ), + + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | \ | - | = | [ | ] | | [ | ] | - | = | \ | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | ^Z | ^X | ^C | ^V | | | Play | Vol+ | Vol- | Mute | Next | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT( \ + TO(0) , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , /**/ KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , \ + _______ , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , /**/ KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , \ + _______ , KC_RCBR , KC_MINS , KC_EQL , KC_LBRC , KC_RBRC , /**/ KC_LBRC , KC_RBRC , KC_MINS , KC_EQL , KC_BSLS , KC_DEL , \ + _______ , CTRL_Z , CTRL_X , CTRL_C , CTRL_V , XXXXXXX , /**/ KC_MPLY , KC_VOLU , KC_VOLD , KC_MUTE , KC_MNXT , _______ , \ + _______ , XXXXXXX , _______ , _______ , _______ , XXXXXXX , /**/ XXXXXXX , _______ , _______ , _______ , XXXXXXX , _______ \ + ), + + /* Raise + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | | | | | | | | = | / | * | - | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | F9 | F10 | F11 | F12 | | | | 7 | 8 | 9 | + | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | | | 4 | 5 | 6 | , | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | F1 | F2 | F3 | F4 | | | | 1 | 2 | 3 | . | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | 0 | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + [_RAISE] = LAYOUT( \ + TO(0) , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ XXXXXXX , KC_EQL , KC_SLSH , KC_ASTR , KC_MINS , _______ , \ + _______ , KC_F9 , KC_F10 , KC_F11 , KC_F12 , XXXXXXX , /**/ XXXXXXX , KC_7 , KC_8 , KC_9 , KC_PLUS , _______ , \ + XXXXXXX , KC_F5 , KC_F6 , KC_F7 , KC_F8 , XXXXXXX , /**/ XXXXXXX , KC_4 , KC_5 , KC_6 , KC_COMM , KC_DEL , \ + _______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , XXXXXXX , /**/ XXXXXXX , KC_1 , KC_2 , KC_3 , KC_DOT , _______ , \ + _______ , XXXXXXX , _______ , _______ , _______ , XXXXXXX , /**/ XXXXXXX , KC_0 , _______ , _______ , _______ , _______ \ + ), + + /* LMOUSE (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | Home | End | PGUP | PGDN | | | | | | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | WH_L | BTN1 | MS_U | BTN2 | WH_U | | | | | | | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | WH_R | MS_L | MS_D | MS_R | WH_D | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | LEFT | DOWN | UP |RIGHT | | | | | | | | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + [_LMOUSE] = LAYOUT( \ + TO(0) , XXXXXXX , KC_HOME , KC_END , KC_PGUP , KC_PGDN , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ + _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ + XXXXXXX , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_DEL , \ + _______ , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , XXXXXXX , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ + _______ , XXXXXXX , _______ , _______ , _______ , _______ , /**/ XXXXXXX , _______ , _______ , _______ , XXXXXXX , _______ \ + ), + + /* RMOUSE (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | | | | | | PGUP | PGDN | Home | End | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | | | | | | | WH_U | BTN1 | MS_U | BTN2 | WH_L | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | WH_D | MS_L | MS_D | MS_R | WH_R | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | | | | | | | | LEFT | DOWN | UP |RIGHT | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + [_RMOUSE] = LAYOUT( \ + TO(0) , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ KC_PGUP , KC_PGDN , KC_HOME , KC_END , XXXXXXX , _______ , \ + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ , \ + XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , KC_DEL , \ + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ XXXXXXX , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , _______ , \ + _______ , XXXXXXX , _______ , _______ , _______ , XXXXXXX , /**/ _______ , _______ , _______ , _______ , XXXXXXX , _______ \ + ), + + /* Emojis + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | | | | | | RSET | | | | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | CLAP | CUM | BNIS | BUTT | CAR | | FIRE | REDB | MONY | 100 | SOS | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | CELE | PRAY | NAIL | OK | THNK | | UNAM | HEYE | COOL | EYES | SMIR | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | TRIU | SCRM | VOMI | DTIV | EXPL | | HAIR | DANC | STRN | LEFT | RGHT | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + [_EMOJI] = LAYOUT( \ + TO(0) , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ RESET , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ + _______ , X(CLAP) , X(CUM) , X(BNIS) , X(BUTT) , X(CAR) , /**/ X(FIRE) , X(REDB) , X(MONY) , X(HNDR) , X(SOS) , _______ , \ + XXXXXXX , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , /**/ X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , KC_DEL , \ + _______ , X(TRIU) , X(SCRM) , X(VOMI) , X(DTIV) , X(EXPL) , /**/ X(HAIR) , X(DANC) , X(STRN) , X(LEFT) , X(RGHT) , _______ , \ + _______ , _______ , _______ , _______ , _______ , XXXXXXX , /**/ XXXXXXX , _______ , _______ , _______ , XXXXXXX , _______ \ + ), + +}; + +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + if (record->event.pressed) { + switch(keycode) { + case CTRL_Z: + SEND_STRING(SS_LCTRL("z")); + return false; + case CTRL_X: + SEND_STRING(SS_LCTRL("x")); + return false; + case CTRL_C: + SEND_STRING(SS_LCTRL("c")); + return false; + case CTRL_V: + SEND_STRING(SS_LCTRL("v")); + return false; + } + } + + return true; +} diff --git a/keyboards/nyquist/keymaps/bramver/rules.mk b/keyboards/keebio/nyquist/keymaps/bramver/rules.mk similarity index 100% rename from keyboards/nyquist/keymaps/bramver/rules.mk rename to keyboards/keebio/nyquist/keymaps/bramver/rules.mk diff --git a/keyboards/nyquist/keymaps/danielhklein/config.h b/keyboards/keebio/nyquist/keymaps/danielhklein/config.h similarity index 100% rename from keyboards/nyquist/keymaps/danielhklein/config.h rename to keyboards/keebio/nyquist/keymaps/danielhklein/config.h diff --git a/keyboards/keebio/nyquist/keymaps/danielhklein/keymap.c b/keyboards/keebio/nyquist/keymaps/danielhklein/keymap.c new file mode 100644 index 00000000000..14428812f2b --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/danielhklein/keymap.c @@ -0,0 +1,173 @@ +#include QMK_KEYBOARD_H + +/* + Keymap is loosely based on DivergeJM's Nyquist keymap + Major changes made: + - DVORAK, COLEMAK, FUNCTION, MOUSE, and ADJUST layers have been removed + - right 2u key performs backspace, not enter + - LOWER layer controls function keys, media controls, and underglow + - ARROW layer uses JKLI for arrow keys + - Bootmagic enabled and bootmagic initialization key changed from space to enter +*/ + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum custom_layers { + _QWERTY, + _LOWER, + _RAISE, + _ARROW +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ARROW +}; + + // Enable these functions using FUNC(n) macro. + const uint16_t PROGMEM fn_actions[] = { + [0] = LT(_LOWER, KC_SPC), //Hold for momentary Lower layer, Tap for Backspace, + [1] = LT(_RAISE, KC_BSPC), //Hold for momentary Raise layer, Tap for Space, + [2] = MO(_ARROW), //Hold for momentary Arrow + }; + +#define SPC_LWR FUNC(0) +#define BSP_RSE FUNC(1) +#define ARW FUNC(2) + +// Underglow setup +#define RGBLIGHT_SLEEP +#define RGBLIGHT_ANIMATIONS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .----------------------------------------. .-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P |Enter | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * | Caps| A | S | D | F | G | | H | J | K | L | ; | " | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * |Lshft| Z | X | C | V | B | | N | M | , | . | / |Rshft | + * |-----+------+------+------+------+------| |------+------+------+------+------+------| + * |Arrow| LCtrl| LAlt | LGui | Bspc/Raise | | Spc/Lower | RGui | RAlt | RCtrl| Del | + * `----------------------------------------' '-----------------------------------------' + */ + +[_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + ARW, KC_LCTL, KC_LALT, KC_LGUI, BSP_RSE, BSP_RSE, SPC_LWR, SPC_LWR, KC_RGUI, KC_RALT, KC_RCTL, KC_DEL + ), + +/* Raise + * ,-----------------------------------------. .-----------------------------------------. + * | | | | | | | | = | / | * | - | \ | ` | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | 7 | 8 | 9 | + | [ | ] | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | 4 | 5 | 6 | Enter| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Lshft| | | | | | | 1 | 2 | 3 | Space| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | LGui | | | 0 | . | Bspc | | | + * `-----------------------------------------' `-----------------------------------------' + */ + +[_RAISE] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PEQL, KC_PSLS, KC_PAST, KC_MINS, KC_BSLS, KC_GRV, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, KC_PPLS, KC_LBRC, KC_RBRC, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_PENT, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_SPC, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, KC_0, KC_0, KC_DOT, KC_BSPC, XXXXXXX, XXXXXXX +), + +/* Lower + * ,-----------------------------------------. .-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | >/|| | Mute | Vol- | Vol+ | |<< | >>| | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |RGB IO|RGB >>|RGB <<|Hue++ |Hue-- | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Sat++ |Sat-- |Val++ |Val-- | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' +*/ + +[_LOWER] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_TOG, RGB_MOD, RGB_RMOD, RGB_HUI, RGB_HUD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + +/* Arrow + * ,-----------------------------------------. ,----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |-----+------+------+------+------+------| + * | | | | | | | | | | Up | | | | + * |------+------+------+------+------+------| |-----+------+------+------+------+------| + * | | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------| |-----+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |-----+------+------+------+------+------| + * | | | | Gui | | | | | | | | + * `-----------------------------------------' `----------------------------------------' + */ + +[_ARROW] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +/* Cases to switch default layer to QWERTY, COLEMAK or DVORAK + and to access ADJUST layer to access the switch keys */ +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + } + return true; +} diff --git a/keyboards/nyquist/keymaps/danielhklein/rules.mk b/keyboards/keebio/nyquist/keymaps/danielhklein/rules.mk similarity index 100% rename from keyboards/nyquist/keymaps/danielhklein/rules.mk rename to keyboards/keebio/nyquist/keymaps/danielhklein/rules.mk diff --git a/keyboards/keebio/nyquist/keymaps/default/config.h b/keyboards/keebio/nyquist/keymaps/default/config.h new file mode 100644 index 00000000000..ef1c4a51ab9 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/default/config.h @@ -0,0 +1,31 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C + +/* Select hand configuration */ +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/nyquist/keymaps/default/keymap.c b/keyboards/keebio/nyquist/keymaps/default/keymap.c new file mode 100644 index 00000000000..ecaad49bb2b --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/default/keymap.c @@ -0,0 +1,226 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/viterbi/keymaps/dwallace/rules.mk b/keyboards/keebio/nyquist/keymaps/default/rules.mk similarity index 100% rename from keyboards/viterbi/keymaps/dwallace/rules.mk rename to keyboards/keebio/nyquist/keymaps/default/rules.mk diff --git a/keyboards/keebio/nyquist/keymaps/georgepetri/config.h b/keyboards/keebio/nyquist/keymaps/georgepetri/config.h new file mode 100644 index 00000000000..bc7fed826dc --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/georgepetri/config.h @@ -0,0 +1,27 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C + +/* Select hand configuration */ +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLED_NUM 12 diff --git a/keyboards/keebio/nyquist/keymaps/georgepetri/keymap.c b/keyboards/keebio/nyquist/keymaps/georgepetri/keymap.c new file mode 100644 index 00000000000..6564e2a7f40 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/georgepetri/keymap.c @@ -0,0 +1,91 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _L 1 +#define _R 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE +}; + +#define KC_TL LCTL(KC_PGUP) +#define KC_TR LCTL(KC_PGDN) +#define KC_TC LCTL(KC_W) +#define KC_TRO LCTL(LSFT(KC_T)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_BASE] = LAYOUT( +//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_DEL , +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_ENT , +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CAPS, KC_LCTL, KC_LGUI, KC_LALT, MO(_L) , KC_SPC , KC_SPC , TG(_R) , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT +//└────────┴────────┴────────┴────────┴────────┴────────┘ └────────┴────────┴────────┴────────┴────────┴────────┘ + ), + + [_L] = LAYOUT( +//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , _______, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_F11 , KC_F12 , _______, _______, _______, _______, _______, _______, _______, _______, _______, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_BSLS, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_PGUP, KC_HOME, KC_END , _______, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +//└────────┴────────┴────────┴────────┴────────┴────────┘ └────────┴────────┴────────┴────────┴────────┴────────┘ + ), + + [_R] = LAYOUT( +//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_TL , KC_TR , KC_TC , KC_TRO , _______, _______, KC_TL , KC_TR , KC_TC , KC_TRO , _______, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, _______, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_PGDN, KC_PGUP, KC_HOME, KC_END , _______, _______, KC_PGDN, KC_PGUP, KC_HOME, KC_END , _______, +//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +//└────────┴────────┴────────┴────────┴────────┴────────┘ └────────┴────────┴────────┴────────┴────────┴────────┘ + ) +}; + +void keyboard_post_init_user(void) { + rgblight_sethsv_noeeprom(HSV_BLUE); +} + +void update_led(void) { + switch (biton32(layer_state)) { + case _BASE: + rgblight_sethsv_noeeprom(HSV_BLUE); + break; + case _L: + rgblight_sethsv_noeeprom(HSV_CORAL); + break; + case _R: + rgblight_sethsv_noeeprom(HSV_MAGENTA); + break; + } + if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { + rgblight_sethsv_range(HSV_WHITE,0,3); + rgblight_sethsv_range(HSV_WHITE,9,12); + } +} + +uint32_t layer_state_set_user(uint32_t state) { + update_led(); + return state; +} + +void led_set_user(uint8_t usb_led) { + update_led(); +} diff --git a/keyboards/keebio/nyquist/keymaps/georgepetri/readme.md b/keyboards/keebio/nyquist/keymaps/georgepetri/readme.md new file mode 100644 index 00000000000..a773c989472 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/georgepetri/readme.md @@ -0,0 +1,52 @@ +# George Petri's Nyquist layout + +``` +make keebio/nyquist/rev2:georgepetri +``` + +Features a dedicated navigation layer on rise and current layer status on rgb underglow. + +### Base Layer +``` +┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ +│ GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ │ 6 │ 7 │ 8 │ 9 │ 0 │ BSPC │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ TAB │ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │ DEL │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ ESC │ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ SCLN│ QUOT │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ LSFT│ Z │ X │ C │ V │ B │ │ N │ M │ COMM │ DOT │ SLSH│ ENT │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ CAPS│ LCTL│ LGUI │ LALT │MO(_L)│ SPC │ │ SPC │MO(_R)│ LEFT │ DOWN│ UP │ RGHT │ +└──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ +``` + +### Lower +``` +┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ +│ │ F1 │ F2 │ F3 │ F4 │ F5 │ │ F6 │ F7 │ F8 │ F9 │ F10 │ │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ F11 │ F12 │ │ │ │ │ │ │ │ │ │ │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ │ │ │ │ │ │ │ MINS│ EQL │ LBRC│ RBRC│ BSLS │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ │ │ │ │ │ │ │ PGDN│ PGUP │ HOME│ END │ │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +└──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ +``` + +### Rise +``` +┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ TAB_L│ TAB_R│ TAB_C│ TAB_R│ │ │ │ TAB_L│ TAB_R│ TAB_C│ TAB_R│ │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ LEFT │ DOWN │ UP │ RGHT │ │ │ LEFT │ DOWN │ UP │ RGHT │ │ │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ PGDN │ PGUP │ HOME│ END │ │ │ │ PGDN │ PGUP │ HOME│ END │ │ +├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +└──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ +``` diff --git a/keyboards/keebio/nyquist/keymaps/georgepetri/rules.mk b/keyboards/keebio/nyquist/keymaps/georgepetri/rules.mk new file mode 100644 index 00000000000..2e145d5a881 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/georgepetri/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +MOUSEKEY_ENABLE = no +COMMAND_ENABLE = no diff --git a/keyboards/nyquist/keymaps/jojiichan/config.h b/keyboards/keebio/nyquist/keymaps/jojiichan/config.h similarity index 100% rename from keyboards/nyquist/keymaps/jojiichan/config.h rename to keyboards/keebio/nyquist/keymaps/jojiichan/config.h diff --git a/keyboards/keebio/nyquist/keymaps/jojiichan/keymap.c b/keyboards/keebio/nyquist/keymaps/jojiichan/keymap.c new file mode 100644 index 00000000000..a0d8c464750 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/jojiichan/keymap.c @@ -0,0 +1,46 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, TG(4), MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_RGHT, KC_UP, KC_DOWN), + + LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_PAUS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_END, KC_PGDN), + + LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_PIPE, + KC_UNDS, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + LAYOUT( + LALT(KC_F4), LSFT(KC_EXLM), LSFT(KC_AT), LSFT(KC_HASH), LSFT(KC_DLR), LSFT(KC_PERC), LSFT(KC_CIRC), LSFT(KC_AMPR), LSFT(KC_ASTR), LSFT(KC_LPRN), LSFT(KC_RPRN), LSFT(KC_DEL), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_COLN), LSFT(KC_DQUO), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_LABK), LSFT(KC_RABK), LSFT(KC_QUES), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + LAYOUT( + KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_PGDN, KC_SLSH, KC_ASTR, KC_MINS, + KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_O, KC_7, KC_8, KC_9, KC_PLUS, + KC_TRNS, KC_A, KC_S, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_PLUS, + KC_LSFT, KC_TRNS, KC_X, KC_C, KC_TRNS, KC_TRNS, KC_N, KC_TRNS, KC_1, KC_2, KC_3, KC_ENT, + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_0, KC_0, KC_DOT, KC_ENT) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/keebio/nyquist/keymaps/jojiichan/rules.mk b/keyboards/keebio/nyquist/keymaps/jojiichan/rules.mk new file mode 100644 index 00000000000..a81250cdf6d --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/jojiichan/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/nyquist/keymaps/kim-kim/config.h b/keyboards/keebio/nyquist/keymaps/kim-kim/config.h similarity index 100% rename from keyboards/nyquist/keymaps/kim-kim/config.h rename to keyboards/keebio/nyquist/keymaps/kim-kim/config.h diff --git a/keyboards/keebio/nyquist/keymaps/kim-kim/keymap.c b/keyboards/keebio/nyquist/keymaps/kim-kim/keymap.c new file mode 100644 index 00000000000..79e485f003b --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/kim-kim/keymap.c @@ -0,0 +1,79 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QW 0 +#define _LW 1 +#define _RS 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* SPLIT QWERTY + * .-----------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ` | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | BSPACE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | LCTRL | A | S | D | F | G | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | < | > | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+-----------------+--------+--------| + * | LALT | RAISE | RAISE | LGUI | SPACE | SPACE | SPACE | SPACE | RGUI | LOWER | LOWER | RALT | + * '-----------------------------------------------------------------------------------------------------------' + */ + [_QW] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LALT, MO(_RS), MO(_RS), KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(_LW), MO(_LW), KC_RALT \ + ), + +/* Lower + * .-----------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | PREV | NEXT | VOLUP | RGBTOG | F11 | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | PLAY | STOP | VOLDWN | RGBMOD | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | MUTE | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ +[_LW] = LAYOUT( \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, \ + _______, KC_MPRV, KC_MNXT, KC_VOLU, RGB_TOG, KC_F11, _______, _______, _______, _______, _______, _______, \ + _______, KC_MPLY, KC_MSTP, KC_VOLD, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Raise + * .-----------------------------------------------------------------------------------------------------------. + * | | | | | | | F6 | F7 | F8 | F9 | F10 | DELETE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | F12 | [ | ] | - | = | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | PRTSCR | LEFT | DOWN | UP | RIGHT | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | HOME | PGDN | PGUP | END | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ +[_RS] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, \ + _______, _______, _______, _______, _______, _______, KC_F12, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_BSLS, \ + _______, _______, _______, _______, _______, _______, KC_PSCR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; diff --git a/keyboards/keebio/nyquist/keymaps/kim-kim/rules.mk b/keyboards/keebio/nyquist/keymaps/kim-kim/rules.mk new file mode 100644 index 00000000000..a81250cdf6d --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/kim-kim/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/nyquist/keymaps/losinggeneration/README.md b/keyboards/keebio/nyquist/keymaps/losinggeneration/README.md similarity index 100% rename from keyboards/nyquist/keymaps/losinggeneration/README.md rename to keyboards/keebio/nyquist/keymaps/losinggeneration/README.md diff --git a/keyboards/nyquist/keymaps/losinggeneration/config.h b/keyboards/keebio/nyquist/keymaps/losinggeneration/config.h similarity index 100% rename from keyboards/nyquist/keymaps/losinggeneration/config.h rename to keyboards/keebio/nyquist/keymaps/losinggeneration/config.h diff --git a/keyboards/nyquist/keymaps/losinggeneration/keymap.c b/keyboards/keebio/nyquist/keymaps/losinggeneration/keymap.c similarity index 100% rename from keyboards/nyquist/keymaps/losinggeneration/keymap.c rename to keyboards/keebio/nyquist/keymaps/losinggeneration/keymap.c diff --git a/keyboards/keebio/nyquist/keymaps/losinggeneration/rules.mk b/keyboards/keebio/nyquist/keymaps/losinggeneration/rules.mk new file mode 100644 index 00000000000..17ef684830f --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/losinggeneration/rules.mk @@ -0,0 +1,14 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +AUDIO_ENABLE = no # Audio output on port C6 +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +COMMAND_ENABLE = no # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + diff --git a/keyboards/nyquist/keymaps/mtdjr/config.h b/keyboards/keebio/nyquist/keymaps/mtdjr/config.h similarity index 100% rename from keyboards/nyquist/keymaps/mtdjr/config.h rename to keyboards/keebio/nyquist/keymaps/mtdjr/config.h diff --git a/keyboards/nyquist/keymaps/mtdjr/keymap.c b/keyboards/keebio/nyquist/keymaps/mtdjr/keymap.c similarity index 100% rename from keyboards/nyquist/keymaps/mtdjr/keymap.c rename to keyboards/keebio/nyquist/keymaps/mtdjr/keymap.c diff --git a/keyboards/levinson/keymaps/mmacdougall/rules.mk b/keyboards/keebio/nyquist/keymaps/mtdjr/rules.mk similarity index 100% rename from keyboards/levinson/keymaps/mmacdougall/rules.mk rename to keyboards/keebio/nyquist/keymaps/mtdjr/rules.mk diff --git a/keyboards/nyquist/keymaps/pitty/README.md b/keyboards/keebio/nyquist/keymaps/pitty/README.md similarity index 100% rename from keyboards/nyquist/keymaps/pitty/README.md rename to keyboards/keebio/nyquist/keymaps/pitty/README.md diff --git a/keyboards/nyquist/keymaps/pitty/config.h b/keyboards/keebio/nyquist/keymaps/pitty/config.h similarity index 100% rename from keyboards/nyquist/keymaps/pitty/config.h rename to keyboards/keebio/nyquist/keymaps/pitty/config.h diff --git a/keyboards/keebio/nyquist/keymaps/pitty/keymap.c b/keyboards/keebio/nyquist/keymaps/pitty/keymap.c new file mode 100644 index 00000000000..4dec42b8537 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/pitty/keymap.c @@ -0,0 +1,168 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _GAME 1 +#define _LOWER 2 +#define _VIM 3 + + +enum custom_macros { + DLEFT, + DRIGHT, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | 0(') | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Ö(0) | Ü(-) | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Z(Y)| U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | É(;)| Á(") | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Í/Shft| Y(Z) | X | C | V | B | N | M | , | . | -(/)| Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |LOWER | Spc | Spc | Bksp | Ent | Alt | =(&) | GAME | Del | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + MT(MOD_LSFT, KC_NUBS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, TT(_LOWER), LT(_VIM, KC_SPC), LT(_VIM, KC_SPC), KC_BSPC, KC_ENT, KC_RALT, KC_AMPERSAND, TG(_GAME), KC_DEL \ +), + +/* Gaming mode + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | |QWERTY| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | Spc | Spc | | | Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' + */ +[_GAME] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | Up | | | | | 7 | 8 | 9 | / | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Left | Down | Right| | | | 4 | 5 | 6 | * | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| | | | | | | 1 | 2 | 3 | - | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 0 | . | = | + | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, _______, KC_UP, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_KP_SLASH, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_4, KC_5, KC_6, KC_KP_ASTERISK, _______, \ + KC_LSFT, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_KP_MINUS, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_GRV, KC_KP_DOT, KC_KP_EQUAL, KC_KP_PLUS, _______ \ +), + + +/* Vim Movement (Hold down SPACE) + * ,-----------------------------------------------------------------------------------. + * | Ins | Home | PGUP | |DM_stp| | | | | | Ő | Ű | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | End | PGDN | |DM_REC| | | Ú | Í | Ó | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | DLeft|DRight| LCTRL| | | Left | Down | Up | Right| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | LShft| | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_VIM] = LAYOUT( \ + KC_INS, KC_HOME, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_NUHS, \ + KC_DEL, KC_END, KC_PGDN, _______, _______, _______, _______, KC_RBRC, KC_NUBS, KC_EQL , _______, _______, \ + _______, M(DLEFT), M(DRIGHT), KC_LCTL, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + case DLEFT: + if (record->event.pressed) { // Windows move desktop left + return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); + } + break; + case DRIGHT: + if (record->event.pressed) { // Windows move desktop right + return MACRO(D(LCTL), D(LGUI), T(RIGHT), U(LGUI), U(LCTL), END); + } + break; + } + return MACRO_NONE; +} + +#ifdef RGBLIGHT_ENABLE +bool rgb_layer_change = true; +#endif + +#define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); +#define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF); +#define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); +#define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); +#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); +#define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); +#define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF); +#define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); +#define rgblight_set_white rgblight_sethsv (0x00, 0x00, 0xFF); +#define rgblight_set_black rgblight_sethsv (0x00, 0x00, 0x00); + +uint32_t layer_state_set_user(uint32_t state) { +#ifdef RGBLIGHT_ENABLE + uint8_t default_layer = eeconfig_read_default_layer(); + if (rgb_layer_change) { + switch (biton32(state)) { + case _LOWER: + rgblight_set_purple; + rgblight_mode(5); + break; + case _VIM: + rgblight_set_green; + rgblight_mode(23); + break; + case _GAME: + rgblight_mode(8); + break; + default: + if (default_layer & (1UL << _GAME)) { + } + else + rgblight_mode(14); + break; + } + } +#endif + return state; +} diff --git a/keyboards/keebio/nyquist/keymaps/pitty/rules.mk b/keyboards/keebio/nyquist/keymaps/pitty/rules.mk new file mode 100644 index 00000000000..53a426157e8 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/pitty/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +NKRO_ENABLE = yes + diff --git a/keyboards/keebio/nyquist/keymaps/shovelpaw/config.h b/keyboards/keebio/nyquist/keymaps/shovelpaw/config.h new file mode 100644 index 00000000000..d0adbfe0c8a --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/shovelpaw/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +// Mouse specific settings +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 6 +#define MOUSEKEY_WHEEL_DELAY 0 diff --git a/keyboards/keebio/nyquist/keymaps/shovelpaw/keymap.c b/keyboards/keebio/nyquist/keymaps/shovelpaw/keymap.c new file mode 100644 index 00000000000..87e44ff0436 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/shovelpaw/keymap.c @@ -0,0 +1,156 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _MIDI 3 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + MIDI, + ADJUST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------| |-------------------------------------------. + * | GEsc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+-------+------+------+------+-------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Del | + * |------+------+------+------+------+------| |------+-------+------+------+------+-------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+-------+------+------+------+-------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / | Enter | + * |------+------+------+------+------+------| |------+-------+------+------+------+-------| + * | Ctrl |Adjust| GUI | Alt |Lower |Space | | Space |Raise | Left | Up | Down | Right | + * `-----------------------------------------| |-------------------------------------------| + */ + +[_QWERTY] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_LCTL, MO(_ADJUST), KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------| |------------------------------------------. + * | ` | F1 | F2 | F3 | | | | - | = | ( | ) | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+-------| + * | ~ | F4 | F5 | F6 | | | | & | * | { | } | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+-------| + * | Del | F7 | F8 | F9 | | | | _ | + | [ | ] | | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+-------| + * | | F10 | F11 | F12 | | | | | | | F5 | Up | Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+-------| + * | | | | | | Home | | End | | | Left | Down | Right | + * `-----------------------------------------| |------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_GRV, KC_F1, KC_F2, KC_F3, _______, _______, KC_MINS, KC_EQL, _______, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_F4, KC_F5, KC_F6, _______, _______, KC_AMPR, KC_ASTR, _______, KC_LCBR, KC_RCBR, KC_DEL, \ + KC_DEL, KC_F7, KC_F8, KC_F9, _______, _______, KC_UNDS, KC_PLUS, _______, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_F5, KC_UP, _______, \ + _______, _______, _______, _______, _______, KC_HOME, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT \ +), + +/* Raise + * ,-----------------------------------------| |-----------------------------------------. + * | Back | m0 | m1 | m2 | | | | | 7 | 8 | 9 | - | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | For | sD | mU | sU | | | | | 4 | 5 | 6 | + | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Del | mL | mD | mR | | | | | 1 | 2 | 3 | * | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | 0 | mB1 | mB1 | mB2 | | | | 0 | . | = | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | MIDI | | | | | | | | | Mute | Vol- | Vol+ | Play | + * `-----------------------------------------| |-----------------------------------------' + */ +[_RAISE] = LAYOUT( \ + LALT(KC_LEFT), KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, KC_7, KC_8, KC_9, KC_MINS, KC_BSPC, \ + LALT(KC_RIGHT), KC_MS_WH_DOWN, KC_MS_UP, KC_MS_WH_UP, _______, _______, _______, KC_4, KC_5, KC_6, KC_PLUS, KC_DEL, \ + KC_DEL, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______, _______, KC_1, KC_2, KC_3, KC_ASTR, KC_BSLS, \ + _______, KC_P0, KC_MS_BTN1, KC_MS_BTN1, KC_MS_BTN2, _______, _______, KC_0, KC_DOT, KC_EQL, KC_SLSH, _______, \ + MO(_MIDI), _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* + * MIDI + */ + +[_MIDI] = LAYOUT( \ + QWERTY, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_C_2, MI_C_3, QWERTY, \ + MI_A_3, MI_As_3, MI_B_3, MI_C_3, MI_Cs_3, MI_D_3, MI_Ds_3, MI_E_3, MI_F_3, MI_Fs_3, MI_G_3, MI_Gs_3, \ + MI_A_2, MI_As_2, MI_B_2, MI_C_2, MI_Cs_2, MI_D_2, MI_Ds_2, MI_E_2, MI_F_2, MI_Fs_2, MI_G_2, MI_Gs_2, \ + MI_A_1, MI_As_1, MI_B_1, MI_C_1, MI_Cs_1, MI_D_1, MI_Ds_1, MI_E_1, MI_F_1, MI_Fs_1, MI_G_1, MI_Gs_1, \ + MI_A, MI_As, MI_B, MI_C, MI_Cs, MI_D, MI_Ds, MI_E, MI_F, MI_Fs, MI_G, MI_Gs \ +), + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------| |-----------------------------------------. + * |QWERTY| F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn| |Sat Up| 7 | 8 | 9 | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm| |AGswap| 6 | 5 | 4 | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | [ | | ] | 1 | 2 | 3 | | | + * |------+------+------+------+------+------+ |------+------+------+------+------+------| + * | | | | | | { | | } | 0 | . | | | | + * `-----------------------------------------| |-----------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + QWERTY, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, KC_7, KC_8, KC_9, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, KC_6, KC_5, KC_4, _______, _______, \ + _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_1, KC_2, KC_3, _______, _______, \ + _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_0, KC_DOT, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/nyquist/keymaps/shovelpaw/rules.mk b/keyboards/keebio/nyquist/keymaps/shovelpaw/rules.mk new file mode 100644 index 00000000000..44ca075c340 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/shovelpaw/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +MIDI_ENABLE = yes # MIDI support (+2400 to 4200, depending on config) + diff --git a/keyboards/keebio/nyquist/keymaps/skug/config.h b/keyboards/keebio/nyquist/keymaps/skug/config.h new file mode 100644 index 00000000000..c3668632947 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/skug/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + + +#undef LSPO_KEY +#undef RSPC_KEY +#define LSPO_KEY KC_8 // Nordic Left SpaceCadet +#define RSPC_KEY KC_9 // Nordic Right SpaceCadet + + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/nyquist/keymaps/skug/keymap.c b/keyboards/keebio/nyquist/keymaps/skug/keymap.c new file mode 100644 index 00000000000..2d511fee3c7 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/skug/keymap.c @@ -0,0 +1,170 @@ +/* Copyright 2019 Christoffer Holmberg + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "keymap_swedish.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define BASE 0 +#define SYMB 1 +#define MDIA 2 +#define ARRW 3 +#define _ADJUST 16 + +#define CT_APOS CTL_T(NO_APOS) +#define CT_TILD CTL_T(NO_TILD) +#define MD_OSLH LT(MDIA, NO_OSLH) +#define SM_AE LT(SYMB, NO_AE) +#define NO_LT NO_LESS +#define NO_GT LSFT(NO_LESS) + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, + ADJUST, + DVORAK, + COLEMAK, + QWERTY +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base layer + * ,-----------------------------------------. .-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | + | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Å | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ARRW | A | S | D | F | G | | H | J | K | L | Ö | Ä | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift(| Z | X | C | V | B | | N | M | , | . | - |)Shift| + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * |'/Ctrl| ´ | Alt | Bsp |Space | Win | | Entr | Space| Bsb | AlGr | * |Ctrl/¨| + * `-----------------------------------------' '-----------------------------------------' + */ +[BASE] = LAYOUT( \ + // LEFT HAND RIGHT HAND + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, \ + MO(ARRW), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, MD_OSLH, SM_AE, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC, \ + CT_APOS, NO_ACUT, KC_LALT, KC_BSPC, KC_SPC, KC_LGUI, KC_ENT, KC_SPC, KC_BSPC, KC_ALGR, NO_ASTR, CT_TILD \ +), + +/* Symbols layer + * ,-----------------------------------------. .-----------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | ! | @ | { | } | | | | Up | 7 | 8 | 9 | * | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | # | $ | ( | ) | ` | | Down | 4 | 5 | 6 | + | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | % | ^ | [ | ] | ~ | | & | 1 | 2 | 3 | - | | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | | | < | > | | | | | . | 0 | = | | + * `-----------------------------------------' '-----------------------------------------' + */ +[SYMB] = LAYOUT( \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ + _______, KC_EXLM, NO_AT, NO_LCBR, NO_RCBR, NO_PIPE, KC_UP, KC_7, KC_8, KC_9, NO_ASTR, KC_F12, \ + _______, KC_HASH, NO_DLR, NO_LPRN, NO_RPRN, NO_GRV, KC_DOWN, KC_4, KC_5, KC_6, NO_PLUS, _______, \ + _______, KC_PERC, NO_CIRC, NO_LBRC, NO_RBRC, NO_TILD, NO_AMPR, KC_1, KC_2, KC_3, NO_MINS, _______, \ + _______, _______, _______, NO_LT, NO_GT, _______, _______, _______, KC_DOT, KC_0, NO_EQL, _______ \ +), + +/* Media layer + * ,-----------------------------------------. .-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' '-----------------------------------------' + */ +[MDIA] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Arrow layer + * ,-----------------------------------------. .-----------------------------------------. + * | §/½ | | | | | | | | | | Ins | Home | PgUp | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | | Up | | | | | | | | Del | End | PgDn | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Left | Down | Right| | Back | | Fwd | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | | | Del | | | | | | | | | | + * `-----------------------------------------' '-----------------------------------------' + */ +[ARRW] = LAYOUT( \ + NO_HALF, _______, _______, _______ , _______, _______, _______, _______, _______, KC_INS , KC_HOME, KC_PGUP, \ + _______, _______, KC_UP , _______ , _______, _______, _______, _______, _______, KC_DEL , KC_END , KC_PGDN, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, KC_WBAK, KC_WFWD, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_DEL , _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Adjust () + * ,-----------------------------------------. .-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn| |Sat Up|Sat Dn|Val Up|Val Dn| | | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' '-----------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/nyquist/keymaps/skug/rules.mk b/keyboards/keebio/nyquist/keymaps/skug/rules.mk new file mode 100644 index 00000000000..e0ed6f0c2d6 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/skug/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no diff --git a/keyboards/keebio/nyquist/keymaps/tester/config.h b/keyboards/keebio/nyquist/keymaps/tester/config.h new file mode 100644 index 00000000000..4f5f10cebcf --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/tester/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define USE_I2C diff --git a/keyboards/keebio/nyquist/keymaps/tester/keymap.c b/keyboards/keebio/nyquist/keymaps/tester/keymap.c new file mode 100644 index 00000000000..f1e19327107 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/tester/keymap.c @@ -0,0 +1,226 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + BL_STEP, KC_Q, KC_W, KC_E, KC_R, KC_T, BL_STEP, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + RGB_MOD, KC_A, KC_S, KC_D, KC_F, KC_G, RGB_MOD, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/viterbi/keymaps/fido/rules.mk b/keyboards/keebio/nyquist/keymaps/tester/rules.mk similarity index 100% rename from keyboards/viterbi/keymaps/fido/rules.mk rename to keyboards/keebio/nyquist/keymaps/tester/rules.mk diff --git a/keyboards/nyquist/keymaps/yshrsmz/config.h b/keyboards/keebio/nyquist/keymaps/yshrsmz/config.h similarity index 100% rename from keyboards/nyquist/keymaps/yshrsmz/config.h rename to keyboards/keebio/nyquist/keymaps/yshrsmz/config.h diff --git a/keyboards/keebio/nyquist/keymaps/yshrsmz/keymap.c b/keyboards/keebio/nyquist/keymaps/yshrsmz/keymap.c new file mode 100644 index 00000000000..d4c2d4ba233 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/yshrsmz/keymap.c @@ -0,0 +1,191 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _FUNC 3 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + FUNC, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | GUI |Shift |Adjust| Fn | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + FUNC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_RGUI, KC_RSFT, ADJUST, FUNC \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* FUNC + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | F1 | F2 | F3 | F4 | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F5 | F6 | F7 | F8 | | LEFT | DOWN | UP |RIGHT | PGUP | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | | HOME | END |Alt+← |Alt+→ | PGDN | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \ + _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_HOME, KC_END, LALT(KC_LEFT),LALT(KC_RGHT), KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/nyquist/keymaps/yshrsmz/rules.mk b/keyboards/keebio/nyquist/keymaps/yshrsmz/rules.mk new file mode 100644 index 00000000000..c9383ab8db8 --- /dev/null +++ b/keyboards/keebio/nyquist/keymaps/yshrsmz/rules.mk @@ -0,0 +1 @@ +AUTO_SHIFT_ENABLE = yes diff --git a/keyboards/nyquist/nyquist.c b/keyboards/keebio/nyquist/nyquist.c similarity index 100% rename from keyboards/nyquist/nyquist.c rename to keyboards/keebio/nyquist/nyquist.c diff --git a/keyboards/keebio/nyquist/nyquist.h b/keyboards/keebio/nyquist/nyquist.h new file mode 100644 index 00000000000..7b0ecf54237 --- /dev/null +++ b/keyboards/keebio/nyquist/nyquist.h @@ -0,0 +1,31 @@ +#pragma once + +#ifdef KEYBOARD_keebio_nyquist_rev1 + #include "rev1.h" +#endif +#ifdef KEYBOARD_keebio_nyquist_rev2 + #include "rev2.h" +#endif +#ifdef KEYBOARD_keebio_nyquist_rev3 + #include "rev3.h" +#endif + +#include "quantum.h" + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45 \ + ) + +#define LAYOUT_kc_ortho_5x12 LAYOUT_kc diff --git a/keyboards/keebio/nyquist/readme.md b/keyboards/keebio/nyquist/readme.md new file mode 100644 index 00000000000..9fa7259d877 --- /dev/null +++ b/keyboards/keebio/nyquist/readme.md @@ -0,0 +1,20 @@ +Nyquist +======= + +A split 60% split 5x12 ortholinear keyboard made and sold by Keebio. [More info at Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/nyquist/rev2:default + +Example of flashing this keyboard: + + make keebio/nyquist/rev2:default:avrdude + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +A build guide for this keyboard can be found here: [Nyquist Build Guide](https://docs.keeb.io) diff --git a/keyboards/keebio/nyquist/rev1/config.h b/keyboards/keebio/nyquist/rev1/config.h new file mode 100644 index 00000000000..75fa43b5874 --- /dev/null +++ b/keyboards/keebio/nyquist/rev1/config.h @@ -0,0 +1,78 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1156 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT The Nyquist Keyboard +#define DESCRIPTION Split 60 percent ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 16 // Number of LEDs + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/nyquist/rev1/rev1.c b/keyboards/keebio/nyquist/rev1/rev1.c similarity index 100% rename from keyboards/nyquist/rev1/rev1.c rename to keyboards/keebio/nyquist/rev1/rev1.c diff --git a/keyboards/keebio/nyquist/rev1/rev1.h b/keyboards/keebio/nyquist/rev1/rev1.h new file mode 100644 index 00000000000..6d3a23383bf --- /dev/null +++ b/keyboards/keebio/nyquist/rev1/rev1.h @@ -0,0 +1,65 @@ +#pragma once + +#include "nyquist.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#ifndef FLIP_HALF +// Standard Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { R45, R44, R43, R42, R41, R40 } \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 } \ + } +#endif + +#define LAYOUT_ortho_5x12 LAYOUT diff --git a/keyboards/nyquist/rev1/rules.mk b/keyboards/keebio/nyquist/rev1/rules.mk similarity index 100% rename from keyboards/nyquist/rev1/rules.mk rename to keyboards/keebio/nyquist/rev1/rules.mk diff --git a/keyboards/keebio/nyquist/rev2/config.h b/keyboards/keebio/nyquist/rev2/config.h new file mode 100644 index 00000000000..9775113c631 --- /dev/null +++ b/keyboards/keebio/nyquist/rev2/config.h @@ -0,0 +1,79 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1156 +#define DEVICE_VER 0x0200 +#define MANUFACTURER Keebio +#define PRODUCT The Nyquist Keyboard +#define DESCRIPTION Split 60 percent ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { D2, F5, F6, F7, B1, B3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 + +#define RGBLED_NUM 16 // Number of LEDs + +/* Backlight LEDs */ +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 7 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/nyquist/rev2/rev2.c b/keyboards/keebio/nyquist/rev2/rev2.c similarity index 100% rename from keyboards/nyquist/rev2/rev2.c rename to keyboards/keebio/nyquist/rev2/rev2.c diff --git a/keyboards/keebio/nyquist/rev2/rev2.h b/keyboards/keebio/nyquist/rev2/rev2.h new file mode 100644 index 00000000000..6d3a23383bf --- /dev/null +++ b/keyboards/keebio/nyquist/rev2/rev2.h @@ -0,0 +1,65 @@ +#pragma once + +#include "nyquist.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#ifndef FLIP_HALF +// Standard Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { R45, R44, R43, R42, R41, R40 } \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 } \ + } +#endif + +#define LAYOUT_ortho_5x12 LAYOUT diff --git a/keyboards/rorschach/rev1/rules.mk b/keyboards/keebio/nyquist/rev2/rules.mk similarity index 100% rename from keyboards/rorschach/rev1/rules.mk rename to keyboards/keebio/nyquist/rev2/rules.mk diff --git a/keyboards/keebio/nyquist/rev3/config.h b/keyboards/keebio/nyquist/rev3/config.h new file mode 100644 index 00000000000..b2573d1dc3e --- /dev/null +++ b/keyboards/keebio/nyquist/rev3/config.h @@ -0,0 +1,81 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1156 +#define DEVICE_VER 0x0300 +#define MANUFACTURER Keebio +#define PRODUCT The Nyquist Keyboard +#define DESCRIPTION Split 60 percent ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { F0, F5, D7, F6, F7 } +#define MATRIX_COL_PINS { F1, F4, B7, D2, D3, D4 } +#define SPLIT_HAND_PIN D5 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLED_SPLIT { 6, 6 } + +/* Backlight LEDs */ +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 7 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/keebio/nyquist/rev3/rev3.c b/keyboards/keebio/nyquist/rev3/rev3.c new file mode 100644 index 00000000000..34500fb104d --- /dev/null +++ b/keyboards/keebio/nyquist/rev3/rev3.c @@ -0,0 +1,21 @@ +#include "rev3.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; diff --git a/keyboards/keebio/nyquist/rev3/rev3.h b/keyboards/keebio/nyquist/rev3/rev3.h new file mode 100644 index 00000000000..274b83926b5 --- /dev/null +++ b/keyboards/keebio/nyquist/rev3/rev3.h @@ -0,0 +1,34 @@ +#pragma once + +#include "nyquist.h" +#include "quantum.h" + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 } \ + } + +#define LAYOUT_ortho_5x12 LAYOUT diff --git a/keyboards/keebio/nyquist/rev3/rules.mk b/keyboards/keebio/nyquist/rev3/rules.mk new file mode 100644 index 00000000000..31077066a36 --- /dev/null +++ b/keyboards/keebio/nyquist/rev3/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes diff --git a/keyboards/keebio/nyquist/rules.mk b/keyboards/keebio/nyquist/rules.mk new file mode 100644 index 00000000000..4ad4eddf901 --- /dev/null +++ b/keyboards/keebio/nyquist/rules.mk @@ -0,0 +1,70 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +ifneq (, $(findstring rev3, $(KEYBOARD))) + BOOTLOADER = qmk-dfu +else + BOOTLOADER = caterina +endif + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes +LAYOUTS = ortho_5x12 +DEFAULT_FOLDER = keebio/nyquist/rev2 diff --git a/keyboards/keebio/quefrency/config.h b/keyboards/keebio/quefrency/config.h new file mode 100644 index 00000000000..cfb6bf4ffcc --- /dev/null +++ b/keyboards/keebio/quefrency/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" diff --git a/keyboards/keebio/quefrency/info.json b/keyboards/keebio/quefrency/info.json new file mode 100644 index 00000000000..1b50ccbe50e --- /dev/null +++ b/keyboards/keebio/quefrency/info.json @@ -0,0 +1,369 @@ +{ + "keyboard_name": "Quefrency", + "url": "https://keeb.io", + "maintainer": "nooges", + "width": 17, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + + {"label":"7", "x":8, "y":0}, + {"label":"8", "x":9, "y":0}, + {"label":"9", "x":10, "y":0}, + {"label":"0", "x":11, "y":0}, + {"label":"-", "x":12, "y":0}, + {"label":"=", "x":13, "y":0}, + {"label":"Del", "x":14, "y":0}, + {"label":"Bksp", "x":15, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + + {"label":"Y", "x":7.5, "y":1}, + {"label":"U", "x":8.5, "y":1}, + {"label":"I", "x":9.5, "y":1}, + {"label":"O", "x":10.5, "y":1}, + {"label":"P", "x":11.5, "y":1}, + {"label":"[", "x":12.5, "y":1}, + {"label":"]", "x":13.5, "y":1}, + {"label":"Backslash", "x":14.5, "y":1, "w":1.5}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + + {"label":"H", "x":7.75, "y":2}, + {"label":"J", "x":8.75, "y":2}, + {"label":"K", "x":9.75, "y":2}, + {"label":"L", "x":10.75, "y":2}, + {"label":";", "x":11.75, "y":2}, + {"label":"'", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":2.25}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + + {"label":"N", "x":8.25, "y":3}, + {"label":"M", "x":9.25, "y":3}, + {"label":",", "x":10.25, "y":3}, + {"label":".", "x":11.25, "y":3}, + {"label":"/", "x":12.25, "y":3}, + {"label":"Shift", "x":13.25, "y":3, "w":1.75}, + {"label":"Up", "x":15, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Alt", "x":1.25, "y":4, "w":1.25}, + {"label":"Win", "x":2.5, "y":4, "w":1.25}, + {"label":"Fn", "x":3.75, "y":4, "w":1.25}, + {"label":"Space", "x":5, "y":4, "w":2.25}, + + {"label":"Fn", "x":8.25, "y":4, "w":1.25}, + {"label":"Space", "x":9.5, "y":4, "w":1.5}, + {"label":"Alt", "x":11, "y":4}, + {"label":"Ctrl", "x":12, "y":4}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4} + ] + }, + "LAYOUT_65": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + + {"label":"7", "x":8, "y":0}, + {"label":"8", "x":9, "y":0}, + {"label":"9", "x":10, "y":0}, + {"label":"0", "x":11, "y":0}, + {"label":"-", "x":12, "y":0}, + {"label":"=", "x":13, "y":0}, + {"label":"Del", "x":14, "y":0}, + {"label":"Bksp", "x":15, "y":0}, + {"label":"Home", "x":16, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + + {"label":"Y", "x":7.5, "y":1}, + {"label":"U", "x":8.5, "y":1}, + {"label":"I", "x":9.5, "y":1}, + {"label":"O", "x":10.5, "y":1}, + {"label":"P", "x":11.5, "y":1}, + {"label":"[", "x":12.5, "y":1}, + {"label":"]", "x":13.5, "y":1}, + {"label":"Backslash", "x":14.5, "y":1, "w":1.5}, + {"label":"End", "x":16, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + + {"label":"H", "x":7.75, "y":2}, + {"label":"J", "x":8.75, "y":2}, + {"label":"K", "x":9.75, "y":2}, + {"label":"L", "x":10.75, "y":2}, + {"label":";", "x":11.75, "y":2}, + {"label":"'", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":2.25}, + {"label":"Page Up", "x":16, "y":2}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + + {"label":"N", "x":8.25, "y":3}, + {"label":"M", "x":9.25, "y":3}, + {"label":",", "x":10.25, "y":3}, + {"label":".", "x":11.25, "y":3}, + {"label":"/", "x":12.25, "y":3}, + {"label":"Shift", "x":13.25, "y":3, "w":1.75}, + {"label":"Up", "x":15, "y":3}, + {"label":"Page Down", "x":16, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Alt", "x":1.25, "y":4, "w":1.25}, + {"label":"Win", "x":2.5, "y":4, "w":1.25}, + {"label":"Fn", "x":3.75, "y":4, "w":1.25}, + {"label":"Space", "x":5, "y":4, "w":2.25}, + + {"label":"Fn", "x":8.25, "y":4, "w":1.25}, + {"label":"Space", "x":9.5, "y":4, "w":1.5}, + {"label":"Alt", "x":11, "y":4}, + {"label":"Ctrl", "x":12, "y":4}, + {"label":"Win", "x":13, "y":4}, + {"label":"Left", "x":14, "y":4}, + {"label":"Down", "x":15, "y":4}, + {"label":"Right", "x":16, "y":4} + ] + }, + "LAYOUT_60_with_macro": { + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F6", "x":1, "y":0}, + + {"label":"Esc", "x":2.25, "y":0}, + {"label":"1", "x":3.25, "y":0}, + {"label":"2", "x":4.25, "y":0}, + {"label":"3", "x":5.25, "y":0}, + {"label":"4", "x":6.25, "y":0}, + {"label":"5", "x":7.25, "y":0}, + {"label":"6", "x":8.25, "y":0}, + + {"label":"7", "x":10.25, "y":0}, + {"label":"8", "x":11.25, "y":0}, + {"label":"9", "x":12.25, "y":0}, + {"label":"0", "x":13.25, "y":0}, + {"label":"-", "x":14.25, "y":0}, + {"label":"=", "x":15.25, "y":0}, + {"label":"Del", "x":16.25, "y":0}, + {"label":"Bksp", "x":17.25, "y":0}, + + {"label":"F2", "x":0, "y":1}, + {"label":"F7", "x":1, "y":1}, + + {"label":"Tab", "x":2.25, "y":1, "w":1.5}, + {"label":"Q", "x":3.75, "y":1}, + {"label":"W", "x":4.75, "y":1}, + {"label":"E", "x":5.75, "y":1}, + {"label":"R", "x":6.75, "y":1}, + {"label":"T", "x":7.75, "y":1}, + + {"label":"Y", "x":9.75, "y":1}, + {"label":"U", "x":10.75, "y":1}, + {"label":"I", "x":11.75, "y":1}, + {"label":"O", "x":12.75, "y":1}, + {"label":"P", "x":13.75, "y":1}, + {"label":"{", "x":14.75, "y":1}, + {"label":"}", "x":15.75, "y":1}, + {"label":"Backslash", "x":16.75, "y":1, "w":1.5}, + + {"label":"F3", "x":0, "y":2}, + {"label":"F8", "x":1, "y":2}, + + {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, + {"label":"A", "x":4, "y":2}, + {"label":"S", "x":5, "y":2}, + {"label":"D", "x":6, "y":2}, + {"label":"F", "x":7, "y":2}, + {"label":"G", "x":8, "y":2}, + + {"label":"H", "x":10, "y":2}, + {"label":"J", "x":11, "y":2}, + {"label":"K", "x":12, "y":2}, + {"label":"L", "x":13, "y":2}, + {"label":":", "x":14, "y":2}, + {"label":"\"", "x":15, "y":2}, + {"label":"Enter", "x":16, "y":2, "w":2.25}, + + {"label":"F4", "x":0, "y":3}, + {"label":"F9", "x":1, "y":3}, + + {"label":"Shift", "x":2.25, "y":3, "w":2.25}, + {"label":"Z", "x":4.5, "y":3}, + {"label":"X", "x":5.5, "y":3}, + {"label":"C", "x":6.5, "y":3}, + {"label":"V", "x":7.5, "y":3}, + {"label":"B", "x":8.5, "y":3}, + + {"label":"N", "x":10.5, "y":3}, + {"label":"M", "x":11.5, "y":3}, + {"label":",", "x":12.5, "y":3}, + {"label":".", "x":13.5, "y":3}, + {"label":"/", "x":14.5, "y":3}, + {"label":"Shift", "x":15.5, "y":3, "w":1.75}, + {"label":"Fn", "x":17.25, "y":3}, + + {"label":"F5", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + + {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, + {"label":"Win", "x":3.5, "y":4, "w":1.25}, + {"label":"Alt", "x":4.75, "y":4, "w":1.25}, + {"label":"Fn", "x":6, "y":4, "w":1.25}, + {"label":"Space", "x":7.25, "y":4, "w":2.25}, + + {"label":"Fn", "x":10.5, "y":4, "w":1.25}, + {"label":"Space", "x":11.75, "y":4, "w":1.5}, + {"label":"Alt", "x":13.25, "y":4}, + {"label":"Ctrl", "x":14.25, "y":4}, + {"label":"Left", "x":15.25, "y":4}, + {"label":"Down", "x":16.25, "y":4}, + {"label":"Right", "x":17.25, "y":4} + ] + }, + "LAYOUT_65_with_macro": { + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F6", "x":1, "y":0}, + + {"label":"Esc", "x":2.25, "y":0}, + {"label":"1", "x":3.25, "y":0}, + {"label":"2", "x":4.25, "y":0}, + {"label":"3", "x":5.25, "y":0}, + {"label":"4", "x":6.25, "y":0}, + {"label":"5", "x":7.25, "y":0}, + {"label":"6", "x":8.25, "y":0}, + + {"label":"7", "x":10.25, "y":0}, + {"label":"8", "x":11.25, "y":0}, + {"label":"9", "x":12.25, "y":0}, + {"label":"0", "x":13.25, "y":0}, + {"label":"-", "x":14.25, "y":0}, + {"label":"=", "x":15.25, "y":0}, + {"label":"=", "x":16.25, "y":0}, + {"label":"Bksp", "x":17.25, "y":0}, + {"label":"Home", "x":18.25, "y":0}, + + {"label":"F2", "x":0, "y":1}, + {"label":"F7", "x":1, "y":1}, + + {"label":"Tab", "x":2.25, "y":1, "w":1.5}, + {"label":"Q", "x":3.75, "y":1}, + {"label":"W", "x":4.75, "y":1}, + {"label":"E", "x":5.75, "y":1}, + {"label":"R", "x":6.75, "y":1}, + {"label":"T", "x":7.75, "y":1}, + + {"label":"Y", "x":9.75, "y":1}, + {"label":"U", "x":10.75, "y":1}, + {"label":"I", "x":11.75, "y":1}, + {"label":"O", "x":12.75, "y":1}, + {"label":"P", "x":13.75, "y":1}, + {"label":"{", "x":14.75, "y":1}, + {"label":"}", "x":15.75, "y":1}, + {"label":"|", "x":16.75, "y":1, "w":1.5}, + {"label":"PgUp", "x":18.25, "y":1}, + + {"label":"F3", "x":0, "y":2}, + {"label":"F8", "x":1, "y":2}, + + {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, + {"label":"A", "x":4, "y":2}, + {"label":"S", "x":5, "y":2}, + {"label":"D", "x":6, "y":2}, + {"label":"F", "x":7, "y":2}, + {"label":"G", "x":8, "y":2}, + + {"label":"H", "x":10, "y":2}, + {"label":"J", "x":11, "y":2}, + {"label":"K", "x":12, "y":2}, + {"label":"L", "x":13, "y":2}, + {"label":":", "x":14, "y":2}, + {"label":"\"", "x":15, "y":2}, + {"label":"Enter", "x":16, "y":2, "w":2.25}, + {"label":"PgDn", "x":18.25, "y":2}, + + {"label":"F4", "x":0, "y":3}, + {"label":"F9", "x":1, "y":3}, + + {"label":"Shift", "x":2.25, "y":3, "w":2.25}, + {"label":"Z", "x":4.5, "y":3}, + {"label":"X", "x":5.5, "y":3}, + {"label":"C", "x":6.5, "y":3}, + {"label":"V", "x":7.5, "y":3}, + {"label":"B", "x":8.5, "y":3}, + + {"label":"N", "x":10.5, "y":3}, + {"label":"M", "x":11.5, "y":3}, + {"label":",", "x":12.5, "y":3}, + {"label":".", "x":13.5, "y":3}, + {"label":"/", "x":14.5, "y":3}, + {"label":"Shift", "x":15.5, "y":3, "w":1.75}, + {"label":"Up", "x":17.25, "y":3}, + {"label":"End", "x":18.25, "y":3}, + + {"label":"F5", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + + {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, + {"label":"Win", "x":3.5, "y":4, "w":1.25}, + {"label":"Alt", "x":4.75, "y":4, "w":1.25}, + {"label":"Fn", "x":6, "y":4, "w":1.25}, + {"label":"Space", "x":7.25, "y":4, "w":2.25}, + + {"label":"Fn", "x":10.5, "y":4, "w":1.25}, + {"label":"Space", "x":11.75, "y":4, "w":1.5}, + {"label":"Alt", "x":13.25, "y":4}, + {"label":"Ctrl", "x":14.25, "y":4}, + {"label":"Win", "x":15.25, "y":4}, + {"label":"Left", "x":16.25, "y":4}, + {"label":"Down", "x":17.25, "y":4}, + {"label":"Right", "x":18.25, "y":4} + ] + } + } +} diff --git a/keyboards/keebio/quefrency/keymaps/bcat/config.h b/keyboards/keebio/quefrency/keymaps/bcat/config.h new file mode 100644 index 00000000000..c9e836597a2 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bcat/config.h @@ -0,0 +1,22 @@ +#pragma once + +/* + * I2C seems to randomly drop keystrokes. Not sure why. It seems a bit like + * https://github.com/qmk/qmk_firmware/issues/5037, but that issue is closed, + * and our problems happen even with underglow disabled. + * + * This issue occurs with multiple TRRS cables of different lengths from + * different companies, so it's most likely not a cable issue. It may be that + * we are running into issues with long I2C runs, in which case stronger + * pull-up resistors might help: + * https://hackaday.com/2017/02/08/taking-the-leap-off-board-an-introduction-to-i2c-over-long-wires/. + * For now, just don't use I2C. + */ +#define USE_SERIAL + +/* Use an extra LED on the right side since it's wider on the 65% PCB. */ +#undef RGBLED_NUM +#define RGBLED_NUM 17 + +/* Set up RGB lighting so it works with either side as master. */ +#define RGBLED_SPLIT { 8, 9 } diff --git a/keyboards/keebio/quefrency/keymaps/bcat/keymap.c b/keyboards/keebio/quefrency/keymaps/bcat/keymap.c new file mode 100644 index 00000000000..9dc98f5a1d5 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bcat/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +enum layer { + LAYER_DEFAULT, + LAYER_FUNCTION, +}; + +/* Switch to function layer when held. */ +#define LY_FUNC MO(LAYER_FUNCTION) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Default layer: http://www.keyboard-layout-editor.com/#/gists/60a262432bb340b37d364a4424f3037b */ + [LAYER_DEFAULT] = LAYOUT_65( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, LY_FUNC, KC_SPC, KC_SPC, XXXXXXX, KC_RALT, LY_FUNC, KC_APP, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Function layer: http://www.keyboard-layout-editor.com/#/gists/59636898946da51f91fb290f8e078b4d */ + [LAYER_FUNCTION] = LAYOUT_65( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, RGB_HUI, + _______, KC_MPLY, KC_VOLU, KC_MSTP, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, RGB_SAI, + KC_CAPS, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_SAD, + _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_HUD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD + ), +}; diff --git a/keyboards/keebio/quefrency/keymaps/bcat/readme.md b/keyboards/keebio/quefrency/keymaps/bcat/readme.md new file mode 100644 index 00000000000..793e8833a46 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bcat/readme.md @@ -0,0 +1,13 @@ +# bcat's Quefrency 65% layout + +This is pretty much a stock 65% split keyboard layout, with an HHKB-style +(split) backspace, media keys in the function layer centered around the WASD +cluster, and RGB controls in the function layer on the arrow/nav keys. + +## Default layer + +![Default layer layout](https://i.imgur.com/CU2fxDg.png) + +## Function layer + +![Function layer layout](https://i.imgur.com/4R1F72M.png) diff --git a/keyboards/keebio/quefrency/keymaps/bcat/rules.mk b/keyboards/keebio/quefrency/keymaps/bcat/rules.mk new file mode 100644 index 00000000000..c87b447c1e3 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bcat/rules.mk @@ -0,0 +1 @@ +BOOTLOADER = atmel-dfu # Elite-C diff --git a/keyboards/keebio/quefrency/keymaps/bjohnson/config.h b/keyboards/keebio/quefrency/keymaps/bjohnson/config.h new file mode 100644 index 00000000000..37c6d6672df --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bjohnson/config.h @@ -0,0 +1,41 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +#define TAPPING_TERM 500 + +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define FORCE_NKRO +#define RETRO_TAPPING + +#define TAPPING_TOGGLE 1 + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#define RGBLIGHT_SLEEP diff --git a/keyboards/keebio/quefrency/keymaps/bjohnson/keymap.c b/keyboards/keebio/quefrency/keymaps/bjohnson/keymap.c new file mode 100644 index 00000000000..434a0a30581 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bjohnson/keymap.c @@ -0,0 +1,33 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_65( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_HOME, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_DEL, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_INS, \ + KC_LCTL, KC_LGUI, KC_LALT, LT(_FN1,KC_SPC),KC_SPC, KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, XXXXXXX, KC_APP, KC_RCTL, TT(_FN1) + ), + + [_FN1] = LAYOUT_65( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_BSPC, KC_PGUP, \ + _______, _______, KC_UP, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, KC_PGDN, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, \ + _______, RGB_MOD, RGB_HUI, RGB_HUD, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_P0, XXXXXXX, _______, _______, XXXXXXX, _______, _______, _______ + ) +}; diff --git a/keyboards/keebio/quefrency/keymaps/bjohnson/rules.mk b/keyboards/keebio/quefrency/keymaps/bjohnson/rules.mk new file mode 100644 index 00000000000..70fa7110092 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bjohnson/rules.mk @@ -0,0 +1,22 @@ +BOOTLOADER = atmel-dfu + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes diff --git a/keyboards/quefrency/keymaps/bramver/README.md b/keyboards/keebio/quefrency/keymaps/bramver/README.md similarity index 100% rename from keyboards/quefrency/keymaps/bramver/README.md rename to keyboards/keebio/quefrency/keymaps/bramver/README.md diff --git a/keyboards/quefrency/keymaps/bramver/config.h b/keyboards/keebio/quefrency/keymaps/bramver/config.h similarity index 100% rename from keyboards/quefrency/keymaps/bramver/config.h rename to keyboards/keebio/quefrency/keymaps/bramver/config.h diff --git a/keyboards/keebio/quefrency/keymaps/bramver/keymap.c b/keyboards/keebio/quefrency/keymaps/bramver/keymap.c new file mode 100644 index 00000000000..f995f9bfab4 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/bramver/keymap.c @@ -0,0 +1,131 @@ +#include QMK_KEYBOARD_H + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define _BASE 0 +#define _LMSE 1 +#define _RMSE 2 +#define _SYMB 3 +#define _EMOJ 4 + +#define SP_LMS LT(_LMSE, KC_SPC) +#define SP_RMS LT(_RMSE, KC_SPC) +#define MO_SYMB TT(_SYMB) +#define MO_EMOJ TT(_EMOJ) + + +enum emoji_map { + UNAM, // unamused 😒 + HEYE, // smiling face with heart shaped eyes 😍 + OK, // ok hand sign 👌 + SMIR, // smirk 😏 + PRAY, // pray 🙏 + CELE, // celebration 🙌 + COOL, // smile with sunglasses 😎 + EYES, // eyes + THNK, // BIG THONK + NAIL, // Nailcare + SOS, // Vuile sos + REDB, // Red B + HNDR, // 100 + MONY, + FIRE, + CAR, + BUTT, + BNIS, + CUM, + CLAP, + TRIU, // Fart from nose + SCRM, + VOMI, + DTIV, // Detective + EXPL, // Brainsplosion + HAIR, // Haircut + DANC, // Salsa dancer + STRN, // Stronk + LEFT, // Point Left + RGHT, // Point Right +}; + +const uint32_t PROGMEM unicode_map[] = { + [UNAM] = 0x1F612, + [HEYE] = 0x1f60d, + [OK] = 0x1F44C, + [SMIR] = 0x1F60F, + [PRAY] = 0x1F64F, + [CELE] = 0x1F64C, + [COOL] = 0x1F60E, + [EYES] = 0x1F440, + [THNK] = 0x1F914, + [NAIL] = 0x1F485, + [SOS] = 0x1F198, + [REDB] = 0x1F171, + [HNDR] = 0x1F4AF, + [MONY] = 0x1F480, + [FIRE] = 0x1F525, + [CAR] = 0x1F697, + [BUTT] = 0x1F351, + [BNIS] = 0x1F346, + [CUM] = 0x1F4A6, + [CLAP] = 0x1F44F, + [TRIU] = 0x1F624, + [SCRM] = 0x1F631, + [VOMI] = 0x1F92E, + [DTIV] = 0x1F575, + [EXPL] = 0x1F92F, + [HAIR] = 0x2640, + [DANC] = 0x1F483, + [STRN] = 0x1F4AA, + [LEFT] = 0x1F448, + [RGHT] = 0x1F449, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_GESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS , KC_EQL , KC_DEL , KC_BSPC , \ + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC , KC_RBRC , KC_BSLS , \ + MO_EMOJ , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT , KC_ENT , \ + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT , KC_UP , \ + KC_LCTL , KC_LALT , KC_LGUI , MO_SYMB , SP_LMS , SP_RMS , KC_BSPC , KC_RGUI , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT + ), + + [_LMSE] = LAYOUT( + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , _______ , _______ , _______ , _______ , _______ , _______ , _______ ,\ + _______ , _______ , KC_PGDN , KC_PGUP , KC_END , KC_HOME , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [_RMSE] = LAYOUT( + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , _______ , _______ ,\ + _______ , _______ , _______ , _______ , _______ , _______ , KC_HOME , KC_END , KC_PGUP , KC_PGDN , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [_SYMB] = LAYOUT( + KC_GESC , KC_F1 , KC_F12 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_DEL , KC_BSPC , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , _______ ,\ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [_EMOJ] = LAYOUT( + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , X(CLAP) , X(CUM) , X(BNIS) , X(BUTT) , X(CAR) , X(FIRE) , X(REDB) , X(MONY) , X(HNDR) , X(SOS) , _______ , _______ , _______ , \ + _______ , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , _______ , _______ ,\ + _______ , X(TRIU) , X(SCRM) , X(VOMI) , X(DTIV) , X(EXPL) , X(HAIR) , X(DANC) , X(STRN) , X(LEFT) , X(RGHT) , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + +}; + +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; diff --git a/keyboards/quefrency/keymaps/bramver/rules.mk b/keyboards/keebio/quefrency/keymaps/bramver/rules.mk similarity index 100% rename from keyboards/quefrency/keymaps/bramver/rules.mk rename to keyboards/keebio/quefrency/keymaps/bramver/rules.mk diff --git a/keyboards/quefrency/keymaps/default/config.h b/keyboards/keebio/quefrency/keymaps/default/config.h similarity index 100% rename from keyboards/quefrency/keymaps/default/config.h rename to keyboards/keebio/quefrency/keymaps/default/config.h diff --git a/keyboards/keebio/quefrency/keymaps/default/keymap.c b/keyboards/keebio/quefrency/keymaps/default/keymap.c new file mode 100644 index 00000000000..744a8d32a4e --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/default/keymap.c @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_BSPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN1] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, \ + RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/keebio/quefrency/keymaps/default/rules.mk b/keyboards/keebio/quefrency/keymaps/default/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/quefrency/keymaps/default65/config.h b/keyboards/keebio/quefrency/keymaps/default65/config.h similarity index 100% rename from keyboards/quefrency/keymaps/default65/config.h rename to keyboards/keebio/quefrency/keymaps/default65/config.h diff --git a/keyboards/keebio/quefrency/keymaps/default65/keymap.c b/keyboards/keebio/quefrency/keymaps/default65/keymap.c new file mode 100644 index 00000000000..3e77731671d --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/default65/keymap.c @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_65( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_SPC, KC_RALT, KC_RCTL, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN1] = LAYOUT_65( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, _______, \ + RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/keebio/quefrency/keymaps/default65/rules.mk b/keyboards/keebio/quefrency/keymaps/default65/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/keebio/quefrency/keymaps/default65macro/config.h b/keyboards/keebio/quefrency/keymaps/default65macro/config.h new file mode 100644 index 00000000000..53bf8fb933d --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/default65macro/config.h @@ -0,0 +1,24 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C diff --git a/keyboards/keebio/quefrency/keymaps/default65macro/keymap.c b/keyboards/keebio/quefrency/keymaps/default65macro/keymap.c new file mode 100644 index 00000000000..4503291d28f --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/default65macro/keymap.c @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_65_with_macro( + KC_F1, KC_F2, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, \ + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_F9, KC_F10, KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_SPC, KC_RALT, KC_RCTL, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN1] = LAYOUT_65_with_macro( + _______, _______, KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, _______, \ + _______, _______, RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/keebio/quefrency/keymaps/georgepetri/config.h b/keyboards/keebio/quefrency/keymaps/georgepetri/config.h new file mode 100644 index 00000000000..c3063d6da6b --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/georgepetri/config.h @@ -0,0 +1,24 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#undef RGBLIGHT_ANIMATIONS diff --git a/keyboards/keebio/quefrency/keymaps/georgepetri/keymap.c b/keyboards/keebio/quefrency/keymaps/georgepetri/keymap.c new file mode 100644 index 00000000000..9ee3eb81022 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/georgepetri/keymap.c @@ -0,0 +1,91 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _L 1 +#define _R 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define KC_TL LCTL(KC_PGUP) +#define KC_TR LCTL(KC_PGDN) +#define KC_TC LCTL(KC_W) +#define KC_TRO LCTL(LSFT(KC_T)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_65( +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 , KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_BSPC ,KC_DEL ,KC_MINS ,KC_EQL ,KC_HOME, +// ├────────┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┘ ┌───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T , KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC ,KC_RBRC ,KC_BSLS ,KC_END , +// ├─────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┐ └─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┼────────┤ + KC_ESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G , KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_QUOT ,KC_ENT ,KC_PGUP , +// ├───────────────┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┐ └─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴───────────────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT, _______ ,KC_PGDN , +// ├──────────┬──────────┴┬───────┴──┬─────┴─────┬──┴────────┴────────┤ ├────────┴────────┴────┬───┴────┬───┴────┬───┴────┬────────┬────────┼────────┤ + KC_CAPS ,KC_LCTL ,KC_LALT ,MO(_L) ,KC_SPC , KC_SPC ,_______ ,KC_LGUI ,TG(_R) ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT +// └──────────┴───────────┴──────────┴───────────┴────────────────────┘ └──────────────────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ), + + [_L] = LAYOUT_65( +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 , KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,_______ ,_______ ,_______ ,_______ ,KC_INS , +// ├────────┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┘ ┌───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────────┼────────┤ + _______ ,KC_F11 ,KC_F12 ,_______ ,_______ ,_______ , _______ ,KC_MINS ,KC_EQL ,_______ ,_______ ,_______ ,_______ ,_______, KC_PAUS , +// ├─────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┐ └─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT ,_______ ,_______ ,_______ ,_______ , +// ├───────────────┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┐ └─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴───────────────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,KC_PGDN ,KC_PGUP ,KC_HOME ,KC_END ,_______ ,_______ ,_______ , +// ├──────────┬──────────┴┬───────┴──┬─────┴─────┬──┴────────┴────────┤ ├────────┴────────┴────┬───┴────┬───┴────┬───┴────┬────────┬────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ +// └──────────┴───────────┴──────────┴───────────┴────────────────────┘ └──────────────────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ), + + [_R] = LAYOUT_65( +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +// ├────────┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┘ ┌───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────┬───┴────────┼────────┤ + _______ ,KC_TL ,KC_TR ,KC_TC ,KC_TRO ,_______ , _______ ,KC_TL , KC_TR , KC_TC , KC_TRO ,_______ ,_______ ,_______, _______ , +// ├─────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┐ └─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┼────────┤ + _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT ,_______ , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT ,_______ ,_______ ,_______ ,_______ , +// ├───────────────┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┐ └─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴─────┬──┴───────────────────┼────────┤ + _______ ,KC_PGDN ,KC_PGUP ,KC_HOME ,KC_END ,_______ , _______ ,KC_PGDN ,KC_PGUP ,KC_HOME ,KC_END ,_______ ,_______ ,_______ , +// ├──────────┬──────────┴┬───────┴──┬─────┴─────┬──┴────────┴────────┤ ├────────┴────────┴────┬───┴────┬───┴────┬───┴────┬────────┬────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ +// └──────────┴───────────┴──────────┴───────────┴────────────────────┘ └──────────────────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ) +}; + +void keyboard_post_init_user(void) { + rgblight_sethsv_noeeprom(HSV_BLUE); +} + +void update_led(void) { + switch (biton32(layer_state)) { + case _BASE: + rgblight_sethsv_noeeprom(HSV_BLUE); + break; + case _L: + rgblight_sethsv_noeeprom(HSV_CORAL); + break; + case _R: + rgblight_sethsv_noeeprom(HSV_MAGENTA); + break; + } + if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { + rgblight_sethsv_range(HSV_WHITE,0,4); + rgblight_sethsv_range(HSV_WHITE,12,16); + } +} + +uint32_t layer_state_set_user(uint32_t state) { + update_led(); + return state; +} + +void led_set_user(uint8_t usb_led) { + update_led(); +} diff --git a/keyboards/keebio/quefrency/keymaps/georgepetri/readme.md b/keyboards/keebio/quefrency/keymaps/georgepetri/readme.md new file mode 100644 index 00000000000..bb4e75c27bd --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/georgepetri/readme.md @@ -0,0 +1,64 @@ +# George Petri's Quefrency 65 layout + +``` +make keebio/quefrency/rev1:georgepetri +``` + +Querty layout with minor changes and dedicated navigation layer. + +### Base Layer +``` +┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ GRV ││ 1 ││ 2 ││ 3 ││ 4 ││ 5 ││ 6 │ │ 7 ││ 8 ││ 9 ││ 0 ││ BSPC││ DEL ││ MINS││ EQL ││ HOME│ +└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +┌──────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────────┐┌──────┐ +│ TAB ││ Q ││ W ││ E ││ R ││ T │ │ Y ││ U ││ I ││ O ││ P ││ LBRC││ RBRC││ BSLS ││ END │ +└──────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────────┘└──────┘ +┌────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────┐┌──────┐ +│ ESC ││ A ││ S ││ D ││ F ││ G │ │ H ││ J ││ K ││ L ││ SCLN││ QUOT││ ENT ││ PGUP│ +└────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└────────────────┘└──────┘ +┌────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────────┐┌──────┐ +│ LSFT ││ Z ││ X ││ C ││ V ││ B │ │ N ││ M ││ COMM││ DOT ││ SLSH││ RSFT ││ PGDN│ +└────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└────────────────────┘└──────┘ +┌────────┐┌────────┐┌────────┐┌────────┐┌────────────────┐ ┌────────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ CAPS ││ LCTL ││ LALT ││MO(_L) ││ SPC │ │ SPC ││ LGUI││TG(_R)││ LEFT││ DOWN││ UP ││ RGHT│ +└────────┘└────────┘└────────┘└────────┘└────────────────┘ └────────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +``` + +### Raise +``` +┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ ││ F1 ││ F2 ││ F3 ││ F4 ││ F5 ││ F6 │ │ F7 ││ F8 ││ F9 ││ F10 ││ F11 ││ F12 ││ BSPC││ DEL ││ INS │ +└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +┌──────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────────┐┌──────┐ +│ ││ F1 ││ F12 ││ ││ ││ │ │ ││ MINS││ EQL ││ ││ ││ ││ ││ ││ PAUS│ +└──────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────────┘└──────┘ +┌────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────┐┌──────┐ +│ ││ ││ ││ ││ ││ │ │ LEFT││ DOWN││ UP ││ RGHT││ ││ ││ ││ │ +└────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└────────────────┘└──────┘ +┌────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────────┐┌──────┐ +│ ││ ││ ││ ││ ││ │ │ ││ PGDN││ PGUP││ HOME││ END ││ ││ │ +└────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└────────────────────┘└──────┘ +┌────────┐┌────────┐┌────────┐┌────────┐┌────────────────┐ ┌────────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ ││ ││ ││ ││ │ │ ││ ││ ││ ││ ││ ││ │ +└────────┘└────────┘└────────┘└────────┘└────────────────┘ └────────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +``` + +### Lower +``` +┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ ││ ││ ││ ││ ││ ││ │ │ ││ ││ ││ ││ ││ ││ ││ ││ │ +└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +┌──────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────────┐┌──────┐ +│ ││ TAB_L││ TAB_R││ TAB_C││ TAB_R││ │ │ ││ TAB_L││ TAB_R││ TAB_C││ TAB_R││ ││ ││ ││ │ +└──────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────────┘└──────┘ +┌────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────┐┌──────┐ +│ ││ LEFT││ DOWN││ UP ││ RGHT││ │ │ LEFT││ DOWN││ UP ││ RGHT││ ││ ││ ││ │ +└────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└──────┘└────────────────┘└──────┘ +┌────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ ┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌────────────────────┐┌──────┐ +│ ││ PGDN││ PGUP││ HOME││ END ││ │ │ ││ PGDN││ PGUP││ HOME││ END ││ ││ │ +└────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘ └──────┘└──────┘└──────┘└──────┘└──────┘└────────────────────┘└──────┘ +┌────────┐┌────────┐┌────────┐┌────────┐┌────────────────┐ ┌────────────────────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐ +│ ││ ││ ││ ││ │ │ ││ ││ ││ ││ ││ ││ │ +└────────┘└────────┘└────────┘└────────┘└────────────────┘ └────────────────────┘└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘ +``` diff --git a/keyboards/keebio/quefrency/keymaps/georgepetri/rules.mk b/keyboards/keebio/quefrency/keymaps/georgepetri/rules.mk new file mode 100644 index 00000000000..5bc0b70454b --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/georgepetri/rules.mk @@ -0,0 +1 @@ +EXTRAKEY_ENABLE = no diff --git a/keyboards/keebio/quefrency/keymaps/kingwangwong/config.h b/keyboards/keebio/quefrency/keymaps/kingwangwong/config.h new file mode 100644 index 00000000000..bf632842e9c --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/kingwangwong/config.h @@ -0,0 +1,31 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +//#define USE_I2C +#define USB_MAX_POWER_CONSUMPTION 50 + + +// #define USB_MAX_POWER_CONSUMPTION 100 diff --git a/keyboards/keebio/quefrency/keymaps/kingwangwong/keymap.c b/keyboards/keebio/quefrency/keymaps/kingwangwong/keymap.c new file mode 100644 index 00000000000..7bdc115ab97 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/kingwangwong/keymap.c @@ -0,0 +1,40 @@ +#include QMK_KEYBOARD_H + +enum layer_names { + _BASE, + _FN1 +}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ │ 7 │ 8 │ 9 │ 0 │ - │ = │BSLS │ DEL │ + * ├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┘ ┌──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴─────┤ + * │TAB │ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │ [ │ ] │BSPC │ + * ├────────┴┬────┴┬────┴┬────┴┬────┴┬────┴┐ └┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴────────┤ + * │CAPS │ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ; │ ' │ENTER │ + * ├─────────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┐ └──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴───────┬─────┤ + * │LSHFT │ Z │ X │ C │ V │ B │ │ N │ M │ , │ . │ / │RSHFT │ UP │ + * ├──────┬─────┴─┬───┴──┬──┴─────┴────┬┴─────┤ ├─────┴┬────┴────┬┴────┬┴────┬┴────┬─────┼─────┤ + * │LCTRL │L_GUI │L_ALT │SPC │FN1 │ │SPC │BSPC │R_ALT│R_CTR│LEFT │DOWN │RIGHT│ + * └──────┴───────┴──────┴─────────────┴──────┘ └──────┴─────────┴─────┴─────┴─────┴─────┴─────┘ + */ + [_BASE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN1), KC_BSPC, KC_BSPC, KC_RALT, KC_RCTL, KC_LEFT, KC_RGHT, KC_DOWN + ), + + [_FN1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, + _______, _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MINS, KC_EQL, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + + ) +}; diff --git a/keyboards/keebio/quefrency/keymaps/unausgeschlafen/config.h b/keyboards/keebio/quefrency/keymaps/unausgeschlafen/config.h new file mode 100644 index 00000000000..f9efe78c5b5 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/unausgeschlafen/config.h @@ -0,0 +1,27 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C diff --git a/keyboards/keebio/quefrency/keymaps/unausgeschlafen/keymap.c b/keyboards/keebio/quefrency/keymaps/unausgeschlafen/keymap.c new file mode 100644 index 00000000000..e42c8651cd0 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/unausgeschlafen/keymap.c @@ -0,0 +1,62 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Keymap _BL: (Base Layer) Default Layer + * +-------------------------------------------------------------------------+ + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP | + * +-------------------------------------------------------------------------+ + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * +-------------------------------------------------------------------------+ + * | FN | A | S | D | F | G | H | J | K | L | ; | ' | RETURN | + * +-------------------------------------------------------------------------+ + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | FN | + * +-------------------------------------------------------------------------+ + * |LALT|LMETA|RCTRL| SPACE | FN | SPACE | RALT| MENU| RWIN|RCTRL| + * +-------------------------------------------------------------------------+ + */ + + [_BASE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + MO(_FN1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN1), \ + KC_LALT, KC_LGUI, KC_LCTL, KC_SPC, MO(_FN1), KC_SPC, _______, KC_RALT, KC_APP, _______, KC_RGUI, KC_RCTL + ), + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | ~ | F1| F2| F3| F4| F5| F6| F7| F8| F9| F0|F11|F12| DEL | + * |-----------------------------------------------------------| + * | | | UP| | MSL|MSD|MSU|MSR| | |PRT|PGD|PGU|PAUS | + * |-----------------------------------------------------------| + * | | LE| DN| RE| | | LE| DN| UP| RE| | | | + * |-----------------------------------------------------------| + * | |HOM|END| | |PRE|NXT|MUT|VOD|VOU| /|Shift | FN| + * |-----------------------------------------------------------| + * | | | | | PLAY | PLAY | | | | | + * `-----------------------------------------------------------' + */ + + [_FN1] = LAYOUT( + KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, \ + _______, _______, KC_UP, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, KC_PSCR, KC_PGUP, KC_PGDN, KC_PAUS, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, \ + _______, KC_HOME, KC_END, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, \ + _______, _______, _______, KC_MPLY, _______, KC_MPLY, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/keebio/quefrency/keymaps/unausgeschlafen/readme.md b/keyboards/keebio/quefrency/keymaps/unausgeschlafen/readme.md new file mode 100644 index 00000000000..a8d0efed0c2 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/unausgeschlafen/readme.md @@ -0,0 +1,26 @@ +## UNAUSGESCHLAFEN'S QUEFRENCY + +This is the keymap that goes with [unausgeschlafen's Quefrency](https://www.reddit.com/r/MechanicalKeyboards/comments/aquefb/my_daily_driver_quefrency/) + +If you are using Ardoinos, comment this line in `rules.mk`: +```make +BOOTLOADER = atmel-dfu # comment this line if you use arduinos +``` + +Although QMK offers one-shot build and flash, I personally build and flash separately (for the Elite C). +I used the QMK default for the Arduino Pro Micros. +However, I do not own them anymore. +Hence, only the instructions for the Elite C are provided. + +Build with: +```sh +make keebio/quefrency:unausgeschlafen +``` + +Flash with: + +```sh +sudo dfu-programmer atmega32u4 erase +sudo dfu-programmer atmega32u4 flash keebio_quefrency_rev1_unausgeschlafen.hex +sudo dfu-programmer atmega32u4 reset +``` diff --git a/keyboards/keebio/quefrency/keymaps/unausgeschlafen/rules.mk b/keyboards/keebio/quefrency/keymaps/unausgeschlafen/rules.mk new file mode 100644 index 00000000000..98956243cd2 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/unausgeschlafen/rules.mk @@ -0,0 +1 @@ +BOOTLOADER = atmel-dfu # comment this line if you use arduinos diff --git a/keyboards/quefrency/quefrency.c b/keyboards/keebio/quefrency/quefrency.c similarity index 100% rename from keyboards/quefrency/quefrency.c rename to keyboards/keebio/quefrency/quefrency.c diff --git a/keyboards/keebio/quefrency/quefrency.h b/keyboards/keebio/quefrency/quefrency.h new file mode 100644 index 00000000000..0c387a6d5de --- /dev/null +++ b/keyboards/keebio/quefrency/quefrency.h @@ -0,0 +1,21 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_keebio_quefrency_rev1 + #include "rev1.h" +#endif + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + LA1, LA2, LA3, LA4, LA5, LA6, RA1, RA2, RA3, RA4, RA5, RA6, RA7, \ + LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB7, \ + LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC3, RC4, RC5, RC6, RC7, \ + LD1, LD2, LD3, LD4, LD5, RD1, RD4, RD5, RD6, RD7 \ + ) \ + LAYOUT( \ + KC_##LA1, KC_##LA2, KC_##LA3, KC_##LA4, KC_##LA5, KC_##LA6, KC_##RA1, KC_##RA2, KC_##RA3, KC_##RA4, KC_##RA5, KC_##RA6, KC_##RA7, \ + KC_##LB1, KC_##LB2, KC_##LB3, KC_##LB4, KC_##LB5, KC_##LB6, KC_##RB1, KC_##RB2, KC_##RB3, KC_##RB4, KC_##RB5, KC_##RB7, \ + KC_##LC1, KC_##LC2, KC_##LC3, KC_##LC4, KC_##LC5, KC_##LC6, KC_##RC1, KC_##RC3, KC_##RC4, KC_##RC5, KC_##RC6, KC_##RC7, \ + KC_##LD1, KC_##LD2, KC_##LD3, KC_##LD4, KC_##LD5, KC_##RD1, KC_##RD4, KC_##RD5, KC_##RD6, KC_##RD7 \ + ) diff --git a/keyboards/keebio/quefrency/readme.md b/keyboards/keebio/quefrency/readme.md new file mode 100644 index 00000000000..3f0e7d98e70 --- /dev/null +++ b/keyboards/keebio/quefrency/readme.md @@ -0,0 +1,22 @@ +Quefrency +========= + +A split 60% staggered keyboard made and sold by Keebio. [More info at Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io/) + +Make example for this keyboard (after setting up your build environment): + + make keebio/quefrency/rev1:default + +Example of flashing this keyboard: + + make keebio/quefrency/rev1:default:avrdude + +Handedness detection is already hardwired onto the PCB, so no need to deal with `EE_HANDS` or flashing .eep files. + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +A build guide for this keyboard can be found here: [Keebio Build Guides](https://docs.keeb.io) diff --git a/keyboards/keebio/quefrency/rev1/config.h b/keyboards/keebio/quefrency/rev1/config.h new file mode 100644 index 00000000000..9778ef47095 --- /dev/null +++ b/keyboards/keebio/quefrency/rev1/config.h @@ -0,0 +1,57 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1257 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Quefrency +#define DESCRIPTION Split 60/65 percent staggered keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_COLS 8 + +// wiring of each half +#define MATRIX_ROW_PINS { F4, D4, D7, E6, B4, C6 } +#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6, B5 } +#define MATRIX_ROW_PINS_RIGHT { F4, D4, D7, E6, B4, B5 } +#define MATRIX_COL_PINS_RIGHT { F5, F6, F7, B1, B3, B2, B6, C6 } +#define SPLIT_HAND_PIN D2 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 // Number of LEDs diff --git a/keyboards/quefrency/rev1/rev1.c b/keyboards/keebio/quefrency/rev1/rev1.c similarity index 100% rename from keyboards/quefrency/rev1/rev1.c rename to keyboards/keebio/quefrency/rev1/rev1.c diff --git a/keyboards/keebio/quefrency/rev1/rev1.h b/keyboards/keebio/quefrency/rev1/rev1.h new file mode 100644 index 00000000000..137aa41c2f7 --- /dev/null +++ b/keyboards/keebio/quefrency/rev1/rev1.h @@ -0,0 +1,103 @@ +#pragma once + +#include "quefrency.h" + +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +#define LAYOUT( \ + LA1, LA2, LA3, LA4, LA5, LA6, LA7, RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8, \ + LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, \ + LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, \ + LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, \ + LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8 \ + ) \ + { \ + { LA1, LA2, LA3, LA4, LA5, LA6, LA7, KC_NO }, \ + { LB1, LB2, LB3, LB4, LB5, LB6, KC_NO, KC_NO }, \ + { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO, KC_NO }, \ + { LD1, KC_NO, LD3, LD4, LD5, LD6, LD7, KC_NO }, \ + { LE1, LE2, LE3, KC_NO, LE5, KC_NO, LE7, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \ + { RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \ + { RC1, RC2, RC3, RC4, RC5, RC6, KC_NO, RC8 }, \ + { RD1, RD2, RD3, RD4, KC_NO, RD6, RD7, RD8 }, \ + { RE1, RE2, KC_NO, RE4, RE5, RE6, RE7, RE8 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ + } + +#define LAYOUT_65( \ + LA1, LA2, LA3, LA4, LA5, LA6, LA7, RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8, RA9, \ + LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, RB9, \ + LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, RC9, \ + LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, RD9, \ + LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8, RE9 \ + ) \ + { \ + { LA1, LA2, LA3, LA4, LA5, LA6, LA7, KC_NO }, \ + { LB1, LB2, LB3, LB4, LB5, LB6, KC_NO, KC_NO }, \ + { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO, KC_NO }, \ + { LD1, KC_NO, LD3, LD4, LD5, LD6, LD7, KC_NO }, \ + { LE1, LE2, LE3, KC_NO, LE5, KC_NO, LE7, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \ + { RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \ + { RC1, RC2, RC3, RC4, RC5, RC6, RC9, RC8 }, \ + { RD1, RD2, RD3, RD4, RD9, RD6, RD7, RD8 }, \ + { RE1, RE2, RE9, RE4, RE5, RE6, RE7, RE8 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RA9, RB9 } \ + } + +#define LAYOUT_60_with_macro( \ + LA9, LA8, LA1, LA2, LA3, LA4, LA5, LA6, LA7, RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8, \ + LB9, LB8, LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, \ + LC9, LC8, LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, \ + LD9, LD8, LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, \ + LE9, LE8, LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8 \ + ) \ + { \ + { LA1, LA2, LA3, LA4, LA5, LA6, LA7, LA8 }, \ + { LB1, LB2, LB3, LB4, LB5, LB6, LB9, LB8 }, \ + { LC1, LC2, LC3, LC4, LC5, LC6, LC9, LC8 }, \ + { LD1, LD9, LD3, LD4, LD5, LD6, LD7, LD8 }, \ + { LE1, LE2, LE3, LA9, LE5, LE9, LE7, LE8 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \ + { RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \ + { RC1, RC2, RC3, RC4, RC5, RC6, KC_NO, RC8 }, \ + { RD1, RD2, RD3, RD4, KC_NO, RD6, RD7, RD8 }, \ + { RE1, RE2, KC_NO, RE4, RE5, RE6, RE7, RE8 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ + } + + +#define LAYOUT_65_with_macro( \ + LA9, LA8, LA1, LA2, LA3, LA4, LA5, LA6, LA7, RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8, RA9, \ + LB9, LB8, LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, RB9, \ + LC9, LC8, LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, RC9, \ + LD9, LD8, LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, RD9, \ + LE9, LE8, LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8, RE9 \ + ) \ + { \ + { LA1, LA2, LA3, LA4, LA5, LA6, LA7, LA8 }, \ + { LB1, LB2, LB3, LB4, LB5, LB6, LB9, LB8 }, \ + { LC1, LC2, LC3, LC4, LC5, LC6, LC9, LC8 }, \ + { LD1, LD9, LD3, LD4, LD5, LD6, LD7, LD8 }, \ + { LE1, LE2, LE3, LA9, LE5, LE9, LE7, LE8 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \ + { RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \ + { RC1, RC2, RC3, RC4, RC5, RC6, RC9, RC8 }, \ + { RD1, RD2, RD3, RD4, RD9, RD6, RD7, RD8 }, \ + { RE1, RE2, RE9, RE4, RE5, RE6, RE7, RE8 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RA9, RB9 } \ + } diff --git a/keyboards/keebio/quefrency/rev1/rules.mk b/keyboards/keebio/quefrency/rev1/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/keebio/quefrency/rules.mk b/keyboards/keebio/quefrency/rules.mk new file mode 100644 index 00000000000..c28696c08e6 --- /dev/null +++ b/keyboards/keebio/quefrency/rules.mk @@ -0,0 +1,31 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = keebio/quefrency/rev1 diff --git a/keyboards/keebio/rorschach/config.h b/keyboards/keebio/rorschach/config.h new file mode 100644 index 00000000000..769330e3999 --- /dev/null +++ b/keyboards/keebio/rorschach/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" diff --git a/keyboards/rorschach/info.json b/keyboards/keebio/rorschach/info.json similarity index 100% rename from keyboards/rorschach/info.json rename to keyboards/keebio/rorschach/info.json diff --git a/keyboards/keebio/rorschach/keymaps/default/config.h b/keyboards/keebio/rorschach/keymaps/default/config.h new file mode 100644 index 00000000000..da32daebb3e --- /dev/null +++ b/keyboards/keebio/rorschach/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C + +/* Select hand configuration */ +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/rorschach/keymaps/default/keymap.c b/keyboards/keebio/rorschach/keymaps/default/keymap.c similarity index 100% rename from keyboards/rorschach/keymaps/default/keymap.c rename to keyboards/keebio/rorschach/keymaps/default/keymap.c diff --git a/keyboards/keebio/rorschach/keymaps/insertsnideremarks/config.h b/keyboards/keebio/rorschach/keymaps/insertsnideremarks/config.h new file mode 100644 index 00000000000..ed948a4b3bb --- /dev/null +++ b/keyboards/keebio/rorschach/keymaps/insertsnideremarks/config.h @@ -0,0 +1,23 @@ +#pragma once + +/* Use I2C or Serial, not both */ + +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM 150 +#define TAPPING_TOGGLE 2 + +// #undef RGBLED_NUM +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 12 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/rorschach/keymaps/insertsnideremarks/keymap.c b/keyboards/keebio/rorschach/keymaps/insertsnideremarks/keymap.c new file mode 100644 index 00000000000..e345ce4a383 --- /dev/null +++ b/keyboards/keebio/rorschach/keymaps/insertsnideremarks/keymap.c @@ -0,0 +1,281 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum rorschach_layers { + _COLEMAK, // Colemak (default layer) + _QWERTY, // Qwerty + _NUMBERS, // Numbers & Symbols + _NUMBERS2, // Numbers & Function Keys (similar to _NUMBERS; used with _NUMBERS for tri-layer access to _ADJUST) + _FUNCTION, // Function + _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows) + _NUMPAD, // Numpad + _ADJUST, // Adjust layer, accessed via tri-layer feature) + _ADJUST2 // Second Adjust layer, accessed outside of tri-layer feature) +}; + +enum rorschach_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY, + NUMPAD = TG(_NUMPAD), + ADJUST = MO(_ADJUST2), + SPCFN = LT(_FUNCTION, KC_SPC), + BSPCFN = LT(_FUNCTION2, KC_BSPC), + ENTNS = LT(_NUMBERS, KC_ENT), + DELNS = LT(_NUMBERS2, KC_DEL), + CTLESC = CTL_T(KC_ESC), + ALTAPP = ALT_T(KC_APP), + NKROTG = MAGIC_TOGGLE_NKRO, +}; + +//Tap Dance Declarations +enum { + ADJ = 0, + LBCB, + RBCB, + EQPL, + PLEQ, + MNUN, + SLAS, + GVTL, + PPLEQ, + PMNUN, + PSLPAS +}; + +void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_on(_ADJUST2); + set_oneshot_layer(_ADJUST2, ONESHOT_START); + } +} +void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_off(_ADJUST2); + clear_oneshot_layer_state(ONESHOT_PRESSED); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { +[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer +[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap +[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap +[EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), // Plus sign on a single-tap, equal sign on a double-tap +[PLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQL), // Equal sign on a single-tap, plus sign on a double-tap +[MNUN] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), // Minus sign on a single-tap, underscore on a double-tap +[SLAS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ASTR), // Slash in a single-tap, asterisk in a double-tap +[GVTL] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), // Grave on a single-tap, tilde on a double-tap +[PPLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PPLS, KC_EQL), // Numpad plus sign on a single-tap, equal sign on a double-tap +[PMNUN] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_UNDS), // Numpad minus sign on a single-tap, underscore on a double-tap +[PSLPAS] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST) // Numpad slash on a single-tap, numpad asterisk on a double-tap +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Colemak +* (Defauit layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* |Esc/Ctl| A | R | S | T | D | | H | N | E | I | O | ' | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | SC Sft| Z | X | C | V | B | | K | M | , | . | / | SC Sft| +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | Ins | ` | [ | ] |App/Alt| Spc/FN| |Bsp/Fn2| RGUI | Left | Down | Up | Right | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | Ent/NS| Bspc | | Enter |Del/NS2| +* `---------------' `---------------' +*/ +[_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + ENTNS, KC_BSPC, KC_ENT, DELNS +), + +/* QWERTY +* (Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* |Esc/Ctl| A | S | D | F | G | | H | J | K | L | ; | ' | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | SC Sft| Z | X | C | V | B | | N | M | , | . | / | SC Sft| +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | Ins | ` | [ | ] |App/Alt| Spc/FN| |Bsp/Fn2| RGUI | Left | Down | Up | Right | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | Ent/NS| Bspc | | Enter |Del/NS2| +* `---------------' `---------------' +*/ +[_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + ENTNS, KC_BSPC, KC_ENT, DELNS +), + +/* Number/symbol layer +* (Multiple characters: single-tap for first, double-tap for second) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | | 6 | 7 | 8 | 9 | 0 | | ^ | & | * | ( | ) | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | 1 | 2 | 3 | 4 | 5 | | ! | @ | # | $ | % | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | ( | ) | [ { | ] } | | | | | | | | | | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | | | +* `---------------' `---------------' +*/ +[_NUMBERS] = LAYOUT( + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +), + +/* Number/Function Key layer +* (Multiple characters: single-tap for first, double-tap for second) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | | 6 | 7 | 8 | 9 | 0 | | F7 | F8 | F9 | F10 | F11 | F12 | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | 1 | 2 | 3 | 4 | 5 | | F1 | F2 | F3 | F4 | F5 | F6 | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | ( | ) | [ { | ] } | | | | | | | | | | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | | | +* `---------------' `---------------' +*/ +[_NUMBERS2] = LAYOUT( + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +), + +/* Function layer +* ,-----------------------------------------------. ,-----------------------------------------------. +* | | | | Up | | | | | | Up | Ctrl+Y| | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | Ctrl+A| Left | Down | Right |C+A+Tab| | PgUp | Right | Down | Left | Home | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | Ctrl+Z| Ctrl+X| Ctrl+C| Ctrl+V| Bspc | | PgDn | Mute | Vol- | Vol+ | End | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | | | | | | | | | | Prev | Play | Next | Stop | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | | | +* `---------------' `---------------' +*/ +[_FUNCTION] = LAYOUT( + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, + _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______ +), + +[_FUNCTION2] = LAYOUT( + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, + _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______ +), + +/* Numpad layer +* (Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | NumLk | KP 7 | KP 8 | KP 9 | KP / | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | Tab | KP 4 | KP 5 | KP 6 | KP * | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | NumLk | KP . |KP/ KP*| KP- _ | KP+ = | | | KP 1 | KP 2 | KP 3 | KP - | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | ( | ) | [ { | ] } | | | | | KP 0 | = | KP . | KP + | | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | KP Ent| | +* `---------------' `---------------' +*/ +[_NUMPAD] = LAYOUT( + _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, + _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_TAB, KC_P4, KC_P5, KC_P6, KC_PAST, _______, + _______, KC_NLCK, KC_PDOT, TD(PSLPAS), TD(PMNUN), TD(PPLEQ), _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, KC_P0, KC_EQL, KC_PDOT, KC_PPLS, _______, + _______, _______, KC_PENT, _______ +), + +/* Adjust layer +* (Enter/Number + Delete/Number2 to access; Numpad is a toggle) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | |Colemak| Qwerty| | | | | Numpad| | | Ctrl+Y| | RESET | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | | | | | | | |NKROTog| | | | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | | | | | | | | | | | | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | | | | | | | | | | | | | | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | | | +* `---------------' `---------------' +*/ +[_ADJUST] = LAYOUT( + _______, COLEMAK, QWERTY, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +), + +[_ADJUST2] = LAYOUT( + _______, COLEMAK, QWERTY, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + default_layer_set(1UL << _COLEMAK); + layer_off ( _QWERTY); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + default_layer_set(1UL << _QWERTY); + layer_off ( _COLEMAK); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/rorschach/keymaps/insertsnideremarks/readme.md b/keyboards/keebio/rorschach/keymaps/insertsnideremarks/readme.md new file mode 100644 index 00000000000..152c8ba01af --- /dev/null +++ b/keyboards/keebio/rorschach/keymaps/insertsnideremarks/readme.md @@ -0,0 +1 @@ +## I've changed my folder name to match my GitHub username. Please see https://github.com/qmk/qmk_firmware/tree/master/keyboards/keebio/rorschach/keymaps/tuesdayjohn for my current keymap files. diff --git a/keyboards/keebio/rorschach/keymaps/insertsnideremarks/rules.mk b/keyboards/keebio/rorschach/keymaps/insertsnideremarks/rules.mk new file mode 100644 index 00000000000..cf63c44f4f0 --- /dev/null +++ b/keyboards/keebio/rorschach/keymaps/insertsnideremarks/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Enable Tap Dancing function diff --git a/keyboards/rorschach/keymaps/insertsnideremarks/config.h b/keyboards/keebio/rorschach/keymaps/tuesdayjohn/config.h similarity index 100% rename from keyboards/rorschach/keymaps/insertsnideremarks/config.h rename to keyboards/keebio/rorschach/keymaps/tuesdayjohn/config.h diff --git a/keyboards/keebio/rorschach/keymaps/tuesdayjohn/keymap.c b/keyboards/keebio/rorschach/keymaps/tuesdayjohn/keymap.c new file mode 100644 index 00000000000..19de124f87b --- /dev/null +++ b/keyboards/keebio/rorschach/keymaps/tuesdayjohn/keymap.c @@ -0,0 +1,296 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum rorschach_layers { + _COLEMAK, // Colemak (default layer) + _QWERTY, // Qwerty + _NUMBERS, // Numbers & Symbols + _NUMBERS2, // Numbers & Function Keys (similar to _NUMBERS; used with _NUMBERS for tri-layer access to _ADJUST) + _FUNCTION, // Function + _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows) + _NUMPAD, // Numpad + _ADJUST, // Adjust layer, accessed via tri-layer feature) + _ADJUST2 // Second Adjust layer, accessed outside of tri-layer feature) +}; + +enum rorschach_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY +}; + +//Tap Dance Declarations +enum { + ADJ = 0, + LBCB, + RBCB, + EQPL, + PLEQ, + MNUN, + SLAS, + GVTL, + PPEQ, + PMUN, + PSPA +}; + +void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_on(_ADJUST2); + set_oneshot_layer(_ADJUST2, ONESHOT_START); + } +} +void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_off(_ADJUST2); + clear_oneshot_layer_state(ONESHOT_PRESSED); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { +[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer +[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap +[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap +[EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), // Plus sign on a single-tap, equal sign on a double-tap +[PLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQL), // Equal sign on a single-tap, plus sign on a double-tap +[MNUN] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), // Minus sign on a single-tap, underscore on a double-tap +[SLAS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ASTR), // Slash in a single-tap, asterisk in a double-tap +[GVTL] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), // Grave on a single-tap, tilde on a double-tap +[PPEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PPLS, KC_EQL), // Numpad plus sign on a single-tap, equal sign on a double-tap +[PMUN] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_UNDS), // Numpad minus sign on a single-tap, underscore on a double-tap +[PSPA] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST) // Numpad slash on a single-tap, numpad asterisk on a double-tap +}; + +//Aliases for longer keycodes +#define NUMPAD TG(_NUMPAD) +#define ADJUST MO(_ADJUST2) +#define SPCFN LT(_FUNCTION, KC_SPC) +#define BSPCFN LT(_FUNCTION2, KC_BSPC) +#define ENTNS LT(_NUMBERS, KC_ENT) +#define DELNS LT(_NUMBERS2, KC_DEL) +#define CTLESC CTL_T(KC_ESC) +#define ALTAPP ALT_T(KC_APP) +#define CTL_A LCTL(KC_A) +#define CTL_C LCTL(KC_C) +#define CTL_V LCTL(KC_V) +#define CTL_X LCTL(KC_X) +#define CTL_Z LCTL(KC_Z) +#define CTL_Y LCTL(KC_Y) +#define CA_TAB LCA(KC_TAB) +#define HYPER ALL_T(KC_NO) +#define TD_ADJ TD(ADJ) +#define TD_LBCB TD(LBCB) +#define TD_RBCB TD(RBCB) +#define TD_EQPL TD(EQPL) +#define TD_PLEQ TD(PLEQ) +#define TD_MNUN TD(MNUN) +#define TD_SLAS TD(SLAS) +#define TD_GVTL TD(GVTL) +#define TD_PPEQ TD(PPEQ) +#define TD_PMUN TD(PMUN) +#define TD_PSPA TD(PSPA) +#define NKROTG MAGIC_TOGGLE_NKRO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +Colemak +(Defauit layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) + ,-----------------------------------------------------. ,-----------------------------------------------------. + | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | Esc/Ctl| A | R | S | T | D | | H | N | E | I | O | ' | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + |SC Shift| Z | X | C | V | B | | K | M | , | . | / |SC Shift| + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------' + | Ins | ` | [ | ] | App/Alt| Spc/FN | | Bsp/Fn2| RGUI | Left | Down | Up | Right | + `--------------------------------------------+--------+--------. ,--------+--------+--------------------------------------------' + | Ent/NS | Bspc | | Enter | Del/NS2| + `-----------------' `-----------------' +*/ +[_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + ENTNS, KC_BSPC, KC_ENT, DELNS +), + +/* +QWERTY +(Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) + ,-----------------------------------------------------. ,-----------------------------------------------------. + | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | Esc/Ctl| A | S | D | F | G | | H | J | K | L | ; | ' | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + |SC Shift| Z | X | C | V | B | | N | M | , | . | / |SC Shift| + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------' + | Ins | ` | [ | ] | App/Alt| Spc/FN | | Bsp/Fn2| RGUI | Left | Down | Up | Right | + `--------------------------------------------+--------+--------. ,--------+--------+--------------------------------------------' + | Ent/NS | Bspc | | Enter | Del/NS2| + `-----------------' `-----------------' +*/ +[_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + ENTNS, KC_BSPC, KC_ENT, DELNS +), + +/* +Number/symbol layer +(Multiple characters: single-tap for first, double-tap for second) + ,-----------------------------------------------------. ,-----------------------------------------------------. + | | 6 | 7 | 8 | 9 | 0 | | ^ | & | * | ( | ) | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | 1 | 2 | 3 | 4 | 5 | | ! | @ | # | $ | % | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | ( | ) | [ { | ] } | | | | | | | | | | + `--------------------------------------------+--------+--------. ,--------+--------+--------------------------------------------' + | | | | | | + `-----------------' `-----------------' +*/ +[_NUMBERS] = LAYOUT( + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD_SLAS, TD_MNUN, TD_PLEQ, TD_GVTL, TD_LBCB, TD_RBCB, _______, _______, _______, + KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +), + +/* +Number/Function Key layer +(Multiple characters: single-tap for first, double-tap for second) + ,-----------------------------------------------------. ,-----------------------------------------------------. + | | 6 | 7 | 8 | 9 | 0 | | F7 | F8 | F9 | F10 | F11 | F12 | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | 1 | 2 | 3 | 4 | 5 | | F1 | F2 | F3 | F4 | F5 | F6 | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | ( | ) | [ { | ] } | | | | | | | | | | + `--------------------------------------------+--------+--------. ,--------+--------+--------------------------------------------' + | | | | | | + `-----------------' `-----------------' +*/ +[_NUMBERS2] = LAYOUT( + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + _______, _______, KC_DOT, TD_SLAS, TD_MNUN, TD_PLEQ, TD_GVTL, TD_LBCB, TD_RBCB, _______, _______, _______, + KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +), + +/* +Function layer + ,-----------------------------------------------------. ,-----------------------------------------------------. + | | | | Up | | | | | | Up | Ctrl+Y | | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | Ctrl+A | Left | Down | Right | C+A+Tab| | PgUp | Right | Down | Left | Home | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | Ctrl+Z | Ctrl+X | Ctrl+C | Ctrl+V | Bspc | | PgDn | Mute | Vol- | Vol+ | End | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | | | | | | | | | Prev | Play | Next | Stop | + `--------------------------------------------+--------+--------. ,--------+--------+--------------------------------------------' + | | | | | | + `-----------------' `-----------------' +*/ +[_FUNCTION] = LAYOUT( + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, CTL_Y, _______, _______, + _______, CTL_A, KC_LEFT, KC_DOWN, KC_RGHT, CA_TAB, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, CTL_Z, CTL_X, CTL_C, CTL_V, KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______ +), + +[_FUNCTION2] = LAYOUT( + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, CTL_Y, _______, _______, + _______, CTL_A, KC_LEFT, KC_DOWN, KC_RGHT, CA_TAB, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, CTL_Z, CTL_X, CTL_C, CTL_V, KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______ +), + +/* +Numpad layer +(Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout) + ,-----------------------------------------------------. ,-----------------------------------------------------. + | | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | NumLk | KP 7 | KP 8 | KP 9 | KP / | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | Tab | KP 4 | KP 5 | KP 6 | KP * | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | NumLk | KP . | KP/ KP*| KP- _ | KP+ = | | | KP 1 | KP 2 | KP 3 | KP - | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | ( | ) | [ { | ] } | | | | | KP 0 | = | KP . | KP + | | + `--------------------------------------------+--------+--------. ,--------+--------+--------------------------------------------' + | | | | KP Ent | | + `-----------------' `-----------------' +*/ +[_NUMPAD] = LAYOUT( + _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, + _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_TAB, KC_P4, KC_P5, KC_P6, KC_PAST, _______, + _______, KC_NLCK, KC_PDOT, TD_PSPA, TD_PMUN, TD_PPEQ, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, + KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, KC_P0, KC_EQL, KC_PDOT, KC_PPLS, _______, + _______, _______, KC_PENT, _______ +), + +/* +Adjust layer +(Enter/Number + Delete/Number2 to access; Numpad is a toggle) + ,-----------------------------------------------------. ,-----------------------------------------------------. + | | Colemak| Qwerty | | | | | Numpad | | | | | RESET | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | | | | | | | |NKRO Tog| | | | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | | | | | | | | | | | | | + |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + | | | | | | | | | | | | | | + `--------------------------------------------+--------+--------. ,--------+--------+--------------------------------------------' + | | | | | | + `-----------------' `-----------------' +*/ +[_ADJUST] = LAYOUT( + _______, COLEMAK, QWERTY, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +), + +[_ADJUST2] = LAYOUT( + _______, COLEMAK, QWERTY, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + default_layer_set(1UL << _COLEMAK); + layer_move (_COLEMAK); + + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + default_layer_set(1UL << _QWERTY); + layer_move (_QWERTY); + } + return false; + break; + } + return true; +} diff --git a/keyboards/keebio/rorschach/keymaps/tuesdayjohn/rules.mk b/keyboards/keebio/rorschach/keymaps/tuesdayjohn/rules.mk new file mode 100644 index 00000000000..cf63c44f4f0 --- /dev/null +++ b/keyboards/keebio/rorschach/keymaps/tuesdayjohn/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Enable Tap Dancing function diff --git a/keyboards/keebio/rorschach/readme.md b/keyboards/keebio/rorschach/readme.md new file mode 100644 index 00000000000..1a623a53531 --- /dev/null +++ b/keyboards/keebio/rorschach/readme.md @@ -0,0 +1,20 @@ +Rorschach +========= + +A split ortholinear 4x6 keyboard with 2 additional thumb keys and sold by Keebio. [More info at Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/rorschach/rev1:default + +Example of flashing this keyboard: + + make keebio/rorschach/rev1:default:avrdude + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +A build guide for this keyboard can be found here: [Iris Build Guide](https://docs.keeb.io/iris-build-guide.html) diff --git a/keyboards/keebio/rorschach/rev1/config.h b/keyboards/keebio/rorschach/rev1/config.h new file mode 100644 index 00000000000..bcfce2bee8e --- /dev/null +++ b/keyboards/keebio/rorschach/rev1/config.h @@ -0,0 +1,62 @@ +/* +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1246 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Rorschach Keyboard +#define DESCRIPTION Split 45 percent ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D7, E6, B4, D2, D4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 5 + +/* WS2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/rorschach/rev1/rev1.c b/keyboards/keebio/rorschach/rev1/rev1.c similarity index 100% rename from keyboards/rorschach/rev1/rev1.c rename to keyboards/keebio/rorschach/rev1/rev1.c diff --git a/keyboards/rorschach/rev1/rev1.h b/keyboards/keebio/rorschach/rev1/rev1.h similarity index 100% rename from keyboards/rorschach/rev1/rev1.h rename to keyboards/keebio/rorschach/rev1/rev1.h diff --git a/keyboards/keebio/rorschach/rev1/rules.mk b/keyboards/keebio/rorschach/rev1/rules.mk new file mode 100644 index 00000000000..bd518d8f273 --- /dev/null +++ b/keyboards/keebio/rorschach/rev1/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = yes diff --git a/keyboards/rorschach/rorschach.c b/keyboards/keebio/rorschach/rorschach.c similarity index 100% rename from keyboards/rorschach/rorschach.c rename to keyboards/keebio/rorschach/rorschach.c diff --git a/keyboards/keebio/rorschach/rorschach.h b/keyboards/keebio/rorschach/rorschach.h new file mode 100644 index 00000000000..45e64587f45 --- /dev/null +++ b/keyboards/keebio/rorschach/rorschach.h @@ -0,0 +1,23 @@ +#pragma once + +#ifdef KEYBOARD_keebio_rorschach_rev1 + #include "rev1.h" +#endif + +#include "quantum.h" + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + LT1, LT2, RT2, RT1 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ + KC_##LT1, KC_##LT2, KC_##RT2, KC_##RT1 \ + ) diff --git a/keyboards/keebio/rorschach/rules.mk b/keyboards/keebio/rorschach/rules.mk new file mode 100644 index 00000000000..b5007405227 --- /dev/null +++ b/keyboards/keebio/rorschach/rules.mk @@ -0,0 +1,26 @@ +# MCU name +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +BOOTLOADER = caterina +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = keebio/rorschach/rev1 diff --git a/keyboards/keebio/tragicforce68/README.md b/keyboards/keebio/tragicforce68/README.md new file mode 100644 index 00000000000..c3ea92d7ad8 --- /dev/null +++ b/keyboards/keebio/tragicforce68/README.md @@ -0,0 +1,18 @@ +Tragicforce 68 +=============== + +Magicforce 68 with [Tragicforce 68 replacement PCB](https://keeb.io/products/mf68-magicforce-68-pcb-replacement-kit) from Keebio. + +Keyboard Maintainer: [Keebio](https://keeb.io) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/tragicforce68:default + +Example of flashing this keyboard: + + make keebio/tragicforce68:default:avrdude + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/keebio/tragicforce68/config.h b/keyboards/keebio/tragicforce68/config.h new file mode 100644 index 00000000000..4a1b6378c5b --- /dev/null +++ b/keyboards/keebio/tragicforce68/config.h @@ -0,0 +1,61 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x0510 +#define DEVICE_VER 0x0101 +#define MANUFACTURER Keebio +#define PRODUCT Tragicforce 68 +#define DESCRIPTION Programmable PCB replacement for Magicforce 68 + +/* key matrix size */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D2, D1, D0, B4, E6, C6, D7, D4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 7 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/keebio/tragicforce68/info.json b/keyboards/keebio/tragicforce68/info.json new file mode 100644 index 00000000000..550040a3a1f --- /dev/null +++ b/keyboards/keebio/tragicforce68/info.json @@ -0,0 +1,242 @@ +{ + "keyboard_name": "Tragicforce 68", + "url": "https://keeb.io", + "maintainer": "Keebio", + "width": 17.25, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":" {", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"x":15.25, "y":1}, + {"x":16.25, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"x":15.25, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"x":14.25, "y":4}, + {"x":15.25, "y":4}, + {"x":16.25, "y":4} + ] + }, + "LAYOUT_split_space": { + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":" {", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"x":15.25, "y":1}, + {"x":16.25, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"x":15.25, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":2.25}, + {"x":6, "y":4, "w":1.75}, + {"x":7.75, "y":4, "w":2.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"x":14.25, "y":4}, + {"x":15.25, "y":4}, + {"x":16.25, "y":4} + ] + }, + "LAYOUT_split_space_and_backspace": { + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Del", "x":13, "y":0}, + {"label":"Backspace", "x":14, "y":0}, + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":" {", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"x":15.25, "y":1}, + {"x":16.25, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"x":15.25, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":2.25}, + {"x":6, "y":4, "w":1.75}, + {"x":7.75, "y":4, "w":2.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"x":14.25, "y":4}, + {"x":15.25, "y":4}, + {"x":16.25, "y":4} + ] + } + } +} diff --git a/keyboards/keebio/tragicforce68/keymaps/buswerks/keymap.c b/keyboards/keebio/tragicforce68/keymaps/buswerks/keymap.c new file mode 100644 index 00000000000..d74c0186d61 --- /dev/null +++ b/keyboards/keebio/tragicforce68/keymaps/buswerks/keymap.c @@ -0,0 +1,60 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _FN1 2 + +#define WORD_L LALT(KC_LEFT) +#define WORD_R LALT(KC_RGHT) +#define LINE_L LGUI(KC_LEFT) +#define LINE_R LGUI(KC_RGHT) + +#define DESK_L LCTL(KC_LEFT) +#define DESK_R LCTL(KC_RGHT) +#define MSN_CTL LCTL(KC_UP) + +#define LT_FN LT(_FN1, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────────────┐ ┌────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_PGUP, + //├────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────────────┤ ├────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + //├────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┤ └────────┴────────┘ + LT_FN, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENTER, + //├──────────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───────────────────┤ ┌────────┐ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, + //├──────────┬───────┴──┬─────┴────┬───┴────────┴────────┴────────┴────────┴────────┴──────┬─┴────────┼────────┴─┬──────────┬────┬──────┴─┬────────┼────────┐ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_CAPS, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + //└──────────┴──────────┴──────────┴───────────────────────────────────────────────────────┴──────────┴──────────┴──────────┘ └────────┴────────┴────────┘ + ), + + [_COLEMAK] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────────────┐ ┌────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_PGUP, + //├────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────────────┤ ├────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + //├────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┤ └────────┴────────┘ + LT_FN, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENTER, + //├──────────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───────────────────┤ ┌────────┐ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, + //├──────────┬───────┴──┬─────┴────┬───┴────────┴────────┴────────┴────────┴────────┴──────┬─┴────────┼────────┴─┬──────────┬────┬──────┴─┬────────┼────────┐ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_CAPS, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + //└──────────┴──────────┴──────────┴───────────────────────────────────────────────────────┴──────────┴──────────┴──────────┘ └────────┴────────┴────────┘ + ), + + [_FN1] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────────────┐ ┌────────┬────────┐ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RESET, KC_HOME, + //├────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────────────┤ ├────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, + //├────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┤ └────────┴────────┘ + _______, DESK_L, MSN_CTL, DESK_R, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, + //├──────────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───────────────────┤ ┌────────┐ + _______, _______, _______, _______, _______, _______, LINE_L, WORD_L, WORD_R, LINE_R, _______, _______, BL_INC, + //├──────────┬───────┴──┬─────┴────┬───┴────────┴────────┴────────┴────────┴────────┴──────┬─┴────────┼────────┴─┬──────────┬────┬──────┴─┬────────┼────────┐ + _______, _______, _______, KC_BSPC, _______, _______, KC_MENU, BL_BRTG, BL_DEC, BL_TOGG + //└──────────┴──────────┴──────────┴───────────────────────────────────────────────────────┴──────────┴──────────┴──────────┘ └────────┴────────┴────────┘ + ) +}; \ No newline at end of file diff --git a/keyboards/tragicforce68/keymaps/default/keymap.c b/keyboards/keebio/tragicforce68/keymaps/default/keymap.c similarity index 100% rename from keyboards/tragicforce68/keymaps/default/keymap.c rename to keyboards/keebio/tragicforce68/keymaps/default/keymap.c diff --git a/keyboards/tragicforce68/rules.mk b/keyboards/keebio/tragicforce68/rules.mk similarity index 100% rename from keyboards/tragicforce68/rules.mk rename to keyboards/keebio/tragicforce68/rules.mk diff --git a/keyboards/tragicforce68/tragicforce68.c b/keyboards/keebio/tragicforce68/tragicforce68.c similarity index 100% rename from keyboards/tragicforce68/tragicforce68.c rename to keyboards/keebio/tragicforce68/tragicforce68.c diff --git a/keyboards/keebio/tragicforce68/tragicforce68.h b/keyboards/keebio/tragicforce68/tragicforce68.h new file mode 100644 index 00000000000..a63ce50a5ec --- /dev/null +++ b/keyboards/keebio/tragicforce68/tragicforce68.h @@ -0,0 +1,74 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + A1, A2, A3, A4, A5, A6, A7, A8, E1, E2, E3, E4, E5, E6, E7, E8, \ + B1, B2, B3, B4, B5, B6, B7, B8, F1, F2, F3, F4, F5, F6, F7, F8, \ + C1, C2, C3, C4, C5, C6, C7, C8, G1, G2, G3, G4, G5, \ + D1, D2, D3, D4, D5, D6, D7, D8, H1, H2, H3, H4, H5, \ + J1, J2, J3, J5, J7, J8, H6, G6, G7, G8 \ +) { \ + { A1, A2, A3, A4, A5, A6, A7, A8 }, \ + { B1, B2, B3, B4, B5, B6, B7, B8 }, \ + { C1, C2, C3, C4, C5, C6, C7, C8 }, \ + { D1, D2, D3, D4, D5, D6, D7, D8 }, \ + { E1, E2, E3, E4, E5, E6, E7, E8 }, \ + { F1, F2, F3, F4, F5, F6, F7, F8 }, \ + { G1, G2, G3, G4, G5, G6, G7, G8 }, \ + { H1, H2, H3, H4, H5, H6, KC_NO, KC_NO }, \ + { J1, J2, J3, KC_NO, J5, KC_NO, J7, J8 } \ +} + +#define LAYOUT_split_space( \ + A1, A2, A3, A4, A5, A6, A7, A8, E1, E2, E3, E4, E5, E6, E7, E8, \ + B1, B2, B3, B4, B5, B6, B7, B8, F1, F2, F3, F4, F5, F6, F7, F8, \ + C1, C2, C3, C4, C5, C6, C7, C8, G1, G2, G3, G4, G5, \ + D1, D2, D3, D4, D5, D6, D7, D8, H1, H2, H3, H4, H5, \ + J1, J2, J3, J4, J5, J6, J7, J8, H6, G6, G7, G8 \ +) { \ + { A1, A2, A3, A4, A5, A6, A7, A8 }, \ + { B1, B2, B3, B4, B5, B6, B7, B8 }, \ + { C1, C2, C3, C4, C5, C6, C7, C8 }, \ + { D1, D2, D3, D4, D5, D6, D7, D8 }, \ + { E1, E2, E3, E4, E5, E6, E7, E8 }, \ + { F1, F2, F3, F4, F5, F6, F7, F8 }, \ + { G1, G2, G3, G4, G5, G6, G7, G8 }, \ + { H1, H2, H3, H4, H5, H6, KC_NO, KC_NO }, \ + { J1, J2, J3, J4, J5, J6, J7, J8 } \ +} + +#define LAYOUT_split_space_and_backspace( \ + A1, A2, A3, A4, A5, A6, A7, A8, E1, E2, E3, E4, E5, E6, H7, E7, E8, \ + B1, B2, B3, B4, B5, B6, B7, B8, F1, F2, F3, F4, F5, F6, F7, F8, \ + C1, C2, C3, C4, C5, C6, C7, C8, G1, G2, G3, G4, G5, \ + D1, D2, D3, D4, D5, D6, D7, D8, H1, H2, H3, H4, H5, \ + J1, J2, J3, J4, J5, J6, J7, J8, H6, G6, G7, G8 \ +) { \ + { A1, A2, A3, A4, A5, A6, A7, A8 }, \ + { B1, B2, B3, B4, B5, B6, B7, B8 }, \ + { C1, C2, C3, C4, C5, C6, C7, C8 }, \ + { D1, D2, D3, D4, D5, D6, D7, D8 }, \ + { E1, E2, E3, E4, E5, E6, E7, E8 }, \ + { F1, F2, F3, F4, F5, F6, F7, F8 }, \ + { G1, G2, G3, G4, G5, G6, G7, G8 }, \ + { H1, H2, H3, H4, H5, H6, H7, KC_NO }, \ + { J1, J2, J3, J4, J5, J6, J7, J8 } \ +} + +#define LAYOUT_kc( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ + K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ + K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ + K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ +) LAYOUT( \ + KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ + KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ + KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ + KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ + KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ + KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ + KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ + KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ +) diff --git a/keyboards/keebio/viterbi/config.h b/keyboards/keebio/viterbi/config.h new file mode 100644 index 00000000000..b628c83c855 --- /dev/null +++ b/keyboards/keebio/viterbi/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2019 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" diff --git a/keyboards/viterbi/keymaps/hexwire/README.md b/keyboards/keebio/viterbi/keymaps/bakingpy/README.md similarity index 100% rename from keyboards/viterbi/keymaps/hexwire/README.md rename to keyboards/keebio/viterbi/keymaps/bakingpy/README.md diff --git a/keyboards/keebio/viterbi/keymaps/bakingpy/config.h b/keyboards/keebio/viterbi/keymaps/bakingpy/config.h new file mode 100644 index 00000000000..7d01468e8de --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/bakingpy/config.h @@ -0,0 +1,33 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C + +/* Select hand configuration */ +// #define MASTER_RIGHT +// #define EE_HANDS + +#define TAPPING_TERM 150 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/viterbi/keymaps/bakingpy/keymap.c b/keyboards/keebio/viterbi/keymaps/bakingpy/keymap.c new file mode 100644 index 00000000000..f0122bef05a --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/bakingpy/keymap.c @@ -0,0 +1,215 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _FN3 5 +#define _FN4 6 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + FN3, + FN4, + ADJUST, +}; + +#define KC_ KC_TRNS + +#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen +#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen +#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen +#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen +#define KC_X0 MT(MOD_LCTL, KC_ESC) +#define KC_X1 LOWER +#define KC_X2 RAISE +#define KC_X3 LT(_FN3, KC_GRV) +#define KC_X4 MT(MOD_LSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , , 6 , 7 , 8 , 9 , 0 ,BSPC, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + TAB , Q , W , E , R , T , , Y , U , I , O , P ,MINS, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + X0 , A , S , D , F , G , , H , J , K , L ,SCLN,QUOT, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + LSFT, Z , X , C , V , B , , N , M ,COMM,DOT ,SLSH, X4 , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, X1 ,SPC , , BSPC, X2 ,LEFT,DOWN, UP ,RGHT, + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , , 6 , 7 , 8 , 9 , 0 ,BSPC, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + TAB , Q , W , F , P , G , , J , L , U , Y ,SCLN,MINS, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + X0 , A , R , S , T , D , , H , N , E , I , O ,QUOT, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + LSFT, Z , X , C , V , B , , K , M ,COMM,DOT ,SLSH, X4 , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, X1 ,SPC , , BSPC, X2 ,LEFT,DOWN, UP ,RGHT, + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_DVORAK] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , , 6 , 7 , 8 , 9 , 0 ,BSPC, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + TAB ,QUOT,COMM,DOT , P , Y , , F , G , C , R , L ,MINS, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + X0 , A , O , E , U , I , , D , H , T , N , S ,SLSH, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + LSFT,SCLN, Q , J , K , X , , B , M , W , V , Z , X4 , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + X3 ,LCTL,LALT,LGUI, X1 ,SPC , , BSPC, X2 ,LEFT,DOWN, UP ,RGHT, + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, , CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , 1 , 2 , 3 , 4 , 5 , , 6 , 7 , 8 , 9 , 0 , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + DEL ,CAPP,LEFT,RGHT, UP ,LBRC, , RBRC, P4 , P5 , P6 ,PLUS,PIPE, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,CPYP, , ,DOWN,LCBR, , RCBR, P1 , P2 , P3 ,MINS, , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , DEL , , P0 ,PDOT, , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, , CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,EXLM, AT ,HASH,DLR ,PERC, , CIRC,AMPR,ASTR,LPRN,RPRN, , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, , EQL ,HOME, , , ,BSLS, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , PLUS,END , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_FN3] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , , F6 , F7 , F8 , F9 ,F10 ,F11 , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/viterbi/keymaps/hexwire/rules.mk b/keyboards/keebio/viterbi/keymaps/bakingpy/rules.mk similarity index 100% rename from keyboards/viterbi/keymaps/hexwire/rules.mk rename to keyboards/keebio/viterbi/keymaps/bakingpy/rules.mk diff --git a/keyboards/keebio/viterbi/keymaps/default/config.h b/keyboards/keebio/viterbi/keymaps/default/config.h new file mode 100644 index 00000000000..a841066f4d0 --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/default/config.h @@ -0,0 +1,32 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C + +/* Select hand configuration */ + +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/viterbi/keymaps/default/keymap.c b/keyboards/keebio/viterbi/keymaps/default/keymap.c new file mode 100644 index 00000000000..c4ae0a5987d --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/default/keymap.c @@ -0,0 +1,136 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,------------------------------------------------. ,------------------------------------------------. + * | Ins | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | Del | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | - | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | = | Esc | A | S | D | F | G | | H | J | K | L | ; | " |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Pg Up| Shift| Z | X | C | V | B | | N | M | , | . | / | Home | End | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Pg Dn|Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up | Right| \ | + * `------------------------------------------------' `------------------------------------------------' + */ + [_QWERTY] = LAYOUT_ortho_5x14( + KC_INS, KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC, KC_DEL , + KC_MINS, KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, + KC_EQL, KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , + KC_PGUP, KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_HOME, KC_END , + KC_PGDN, ADJUST , KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RAISE , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, KC_BSLS + ), + +/* Lower + * ,------------------------------------------------. ,------------------------------------------------. + * | | ~ | F1 | F3 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | _ | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | { | } | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | + | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | | + * `------------------------------------------------' `------------------------------------------------' + */ + [_LOWER] = LAYOUT_ortho_5x14( + _______, KC_TILD, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + KC_UNDS, _______, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR, + KC_PLUS, _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, + _______, _______, KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, KC_MUTE + ), + +/* Raise + * ,------------------------------------------------. ,------------------------------------------------. + * | | ~ | F1 | F3 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | _ | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | { | } | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | + | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | F7 | F8 | F9 | F10 | F11 | | F12 |ISO # |ISO / | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | | + * `------------------------------------------------' `------------------------------------------------' + */ + [_RAISE] = LAYOUT_ortho_5x14( + _______, KC_TILD, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + KC_UNDS, _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_LCBR, KC_RCBR, + KC_PLUS, _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, _______, _______, + _______, _______, KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_NUHS, KC_NUBS, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, KC_MUTE + ), + + [_ADJUST] = LAYOUT_ortho_5x14( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, _______, + _______, _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/viterbi/keymaps/mike808/rules.mk b/keyboards/keebio/viterbi/keymaps/default/rules.mk similarity index 100% rename from keyboards/viterbi/keymaps/mike808/rules.mk rename to keyboards/keebio/viterbi/keymaps/default/rules.mk diff --git a/keyboards/keebio/viterbi/keymaps/drashna/config.h b/keyboards/keebio/viterbi/keymaps/drashna/config.h new file mode 100644 index 00000000000..201c02e4199 --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/drashna/config.h @@ -0,0 +1,63 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#undef MATRIX_ROWS +#define MATRIX_ROWS 5 + +#ifdef RGBLIGHT_ENABLE +# undef RGBLED_NUM +# define RGBLED_NUM 16 + +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#endif // RGBLIGHT_ENABLE + + + + +#undef PRODUCT +#define PRODUCT Drashnas Viterbi Macro Pad + +#ifdef AUDIO_ENABLE +# define C6_AUDIO +# define NO_MUSIC_MODE +#endif + +#define LAYOUT_ortho_5x7( \ + L00, L01, L02, L03, L04, L05, L06, \ + L10, L11, L12, L13, L14, L15, L16, \ + L20, L21, L22, L23, L24, L25, L26, \ + L30, L31, L32, L33, L34, L35, L36, \ + L40, L41, L42, L43, L44, L45, L46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + } + +#define QMK_ESC_OUTPUT F5 // usually COL +#define QMK_ESC_INPUT D4 // usually ROW +#define QMK_LED B0 +#define QMK_SPEAKER C6 diff --git a/keyboards/keebio/viterbi/keymaps/drashna/keymap.c b/keyboards/keebio/viterbi/keymaps/drashna/keymap.c new file mode 100644 index 00000000000..1afc59fb90d --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/drashna/keymap.c @@ -0,0 +1,96 @@ +#include QMK_KEYBOARD_H +#include "drashna.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + + +// Fillers to make layering more clear +#define LMACRO OSL(_MACROS) +#define DIABLO TG(_DIABLO) +#define GAMEPAD TG(_GAMEPAD) +#define MEDIA TT(_MEDIA) + + +//enum more_custom_keycodes { +// KC_P00 = NEW_SAFE_RANGE +//}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_NUMLOCK] = LAYOUT_ortho_5x7( + LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, + MEDIA, KC_CALC, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PAST, + KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, + KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, + KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_COLN, KC_PENT + ), + + [_DIABLO] = LAYOUT_ortho_5x7( + KC_ESC, DIABLO, KC_V, KC_D, XXXXXXX, XXXXXXX, KC_L, + KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_J, + KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, KC_F, + KC_LCTL, KC_D3_3, KC_D3_3, KC_D3_3, KC_D3_3, KC_Z, KC_DIABLO_CLEAR, + KC_LALT, KC_F4, KC_F5, KC_F8, KC_F9, KC_F10, SFT_T(KC_SPACE) + ), + + [_GAMEPAD] = LAYOUT_ortho_5x7( // Game pad layout designed primarily for Overwatch + LMACRO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, + MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, + KC_F1, KC_U, KC_I, KC_Y, KC_V, KC_SPC, KC_V + ), + + [_MACROS] = LAYOUT_ortho_5x7( + LMACRO, KC_OVERWATCH,GAMEPAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_C9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_SYMM, KC_TORB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_GLHF, KC_GOODGAME, KC_GGEZ, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_SALT, KC_MORESALT, KC_SALTHARD, KC_JUSTGAME, KC_AIM, XXXXXXX, KC_PENT + ), + + + [_MEDIA] = LAYOUT_ortho_5x7( + KC_MAKE, KC_RESET,MU_TOG, AU_ON, AU_OFF, CK_TOGG, RGB_SAD, + MEDIA, EEP_RST, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI, + RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_HUD, + KC_MPLY, KC_MPRV, KC_MNXT, RGB_M_X, RGB_M_G, RGB_M_P, RGB_HUI, + KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, RGB_VAD, RGB_VAI + ) + + +}; + + + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + + //switch (keycode) { + //case KC_P00: + // if (!record->event.pressed) { + // tap(KC_KP_0); + // tap(KC_KP_0); + // } + // return false; + // break; + //} + return true; +} + + + + +void matrix_init_keymap(void) { + #ifndef CONVERT_TO_PROTON_C + setPinOutput(D5); + writePinHigh(D5); + + setPinOutput(B0); + writePinHigh(B0); + #endif +} diff --git a/keyboards/keebio/viterbi/keymaps/drashna/rules.mk b/keyboards/keebio/viterbi/keymaps/drashna/rules.mk new file mode 100644 index 00000000000..f42e065d51e --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/drashna/rules.mk @@ -0,0 +1,26 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +TAP_DANCE_ENABLE = no +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = yes +NKRO_ENABLE = yes +SPLIT_KEYBOARD = no +SPACE_CADET_ENABLE = no + +NO_SECRETS = yes +MACROS_ENABLED = yes +INDICATOR_LIGHTS = no +RGBLIGHT_TWINKLE = no +LAYOUTS = ortho_5x7 + +# SRC := $(filter-out serial.c matrix.c i2c.c split_util.c,$(SRC)) +# SRC := $(filter-out serial.c,$(SRC)) +# SRC := $(filter-out matrix.c,$(SRC)) +# SRC := $(filter-out i2c.c,$(SRC)) +# SRC := $(filter-out split_util.c,$(SRC)) +# SRC += quantum/matrix.c + +BOOTLOADER = qmk-dfu diff --git a/keyboards/keebio/viterbi/keymaps/drashna_old/config.h b/keyboards/keebio/viterbi/keymaps/drashna_old/config.h new file mode 100644 index 00000000000..5697f7f1109 --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/drashna_old/config.h @@ -0,0 +1,25 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "../drashna/config.h" + +#ifdef RGBLIGHT_ENABLE +# undef RGBLED_NUM +# define RGBLED_NUM 12 +#endif diff --git a/keyboards/viterbi/keymaps/drashna_old/keymap.c b/keyboards/keebio/viterbi/keymaps/drashna_old/keymap.c similarity index 100% rename from keyboards/viterbi/keymaps/drashna_old/keymap.c rename to keyboards/keebio/viterbi/keymaps/drashna_old/keymap.c diff --git a/keyboards/keebio/viterbi/keymaps/drashna_old/rules.mk b/keyboards/keebio/viterbi/keymaps/drashna_old/rules.mk new file mode 100644 index 00000000000..73f37c6c558 --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/drashna_old/rules.mk @@ -0,0 +1,4 @@ +USER_NAME := drashna +SRC += ../drashna/keymap.c + +include $(KEYBOARD_PATH_2)/keymaps/drashna/rules.mk diff --git a/keyboards/viterbi/keymaps/dwallace/config.h b/keyboards/keebio/viterbi/keymaps/dwallace/config.h similarity index 100% rename from keyboards/viterbi/keymaps/dwallace/config.h rename to keyboards/keebio/viterbi/keymaps/dwallace/config.h diff --git a/keyboards/keebio/viterbi/keymaps/dwallace/keymap.c b/keyboards/keebio/viterbi/keymaps/dwallace/keymap.c new file mode 100644 index 00000000000..5a797cb0bd0 --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/dwallace/keymap.c @@ -0,0 +1,223 @@ +#include "viterbi.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _FN 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + STK_SHIFT, + STK_CTRL, + STK_ALT, + STK_GUI, + STK_META, + STK_CLEAR, + RGB_LEVEL_UP, + RGB_LEVEL_DOWN, +}; + +#define KC_ KC_TRNS + +#define KC_SWIN LGUI(KC_TILD) // Switch between windows +#define KC_SAPP LGUI(KC_TAB) // Switch between applications +#define KC_FN1 MO(_FN) +#define KC_LCAG LCAG(KC_NO) +#define KC_RTOG RGB_TOG +#define KC_RGUP RGB_LEVEL_UP +#define KC_RGDN RGB_LEVEL_DOWN +#define KC_RST RESET +#define KC_SSFT STK_SHIFT +#define KC_SCTL STK_CTRL +#define KC_SALT STK_ALT +#define KC_SGUI STK_GUI +#define KC_SMTA STK_META +#define KC_SCLR STK_CLEAR + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL ,BSPC, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + TAB , Q , W , E , R , T ,LBRC, Y , U , I , O , P ,BSLS,PGUP, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ESC , A , S , D , F , G ,RBRC, H , J , K , L ,SCLN,QUOT,ENT , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + SSFT, Z , X , C , V , B ,SWIN, N , M ,COMM,DOT , UP ,SLSH,RSFT, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + SCTL,SMTA,SALT,SGUI,SPC ,SCLR,SAPP, FN1 ,SPC ,RGUI,LEFT,DOWN,RGHT,PGDN + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_FN] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , ,RST , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , RTOG, ,RGDN,RGUP, , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , ,MUTE,VOLD,VOLU, , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool modifier_already_applied = false; +uint8_t physically_held_modifiers = 0; +uint8_t last_mods = 0xFF; +uint8_t rgb_dimming = 0; +#define SET_LED_RGB(val, led_num) setrgb(((val >> 16) & 0xFF) >> rgb_dimming, ((val >> 8) & 0xFF) >> rgb_dimming, (val & 0xFF) >> rgb_dimming, (LED_TYPE *)&led[led_num]) + +void update_underglow_level(void) { + if (get_mods() == last_mods) + return; + + last_mods = get_mods(); + + if (get_mods() == 0) { + uint8_t level = 0x10 >> rgb_dimming; + rgblight_setrgb(level, level, level); + return; + } + + uint32_t mod_colors[4] = {0}; + uint8_t mod_count = 0; + rgblight_setrgb(0x00, 0x00, 0x00); + + if (get_mods() & MOD_BIT(KC_LSFT)) + mod_colors[mod_count++] = 0xFF0000; + if (get_mods() & MOD_BIT(KC_LCTL)) + mod_colors[mod_count++] = 0x00FF00; + if (get_mods() & MOD_BIT(KC_LALT)) + mod_colors[mod_count++] = 0x0000FF; + if (get_mods() & MOD_BIT(KC_LGUI)) + mod_colors[mod_count++] = 0xFFFF00; + + uint8_t led_num = 0; + for (int m = 0; m < mod_count; m++) { + for (; led_num < RGBLED_NUM*(m+1)/mod_count; led_num++) { + SET_LED_RGB(mod_colors[m], led_num); + } + } + rgblight_set(); +} + +void add_sticky_modifier(uint16_t keycode) { + add_mods(MOD_BIT(keycode)); + register_code(keycode); + modifier_already_applied = false; +} + +void clear_sticky_modifiers(void) { + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + unregister_code(KC_LALT); + unregister_code(KC_LGUI); + update_underglow_level(); +} + +void handle_sticky_modifier_event(uint16_t keycode, bool pressed) { + if (pressed) { + add_sticky_modifier(keycode); + physically_held_modifiers |= MOD_BIT(keycode); + } else { + del_mods(MOD_BIT(keycode)); + physically_held_modifiers &= ~MOD_BIT(keycode); + if (modifier_already_applied) { + clear_sticky_modifiers(); + } else { + add_sticky_modifier(keycode); + } + } + update_underglow_level(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case STK_SHIFT: + handle_sticky_modifier_event(KC_LSFT, record->event.pressed); + return false; + break; + case STK_CTRL: + handle_sticky_modifier_event(KC_LCTL, record->event.pressed); + return false; + break; + case STK_ALT: + handle_sticky_modifier_event(KC_LALT, record->event.pressed); + return false; + break; + case STK_GUI: + handle_sticky_modifier_event(KC_LGUI, record->event.pressed); + return false; + break; + case STK_META: + handle_sticky_modifier_event(KC_LCTL, record->event.pressed); + handle_sticky_modifier_event(KC_LALT, record->event.pressed); + handle_sticky_modifier_event(KC_LGUI, record->event.pressed); + return false; + break; + case STK_CLEAR: + if (record->event.pressed) { + clear_sticky_modifiers(); + } + return false; + break; + case RGB_LEVEL_DOWN: + if (record->event.pressed && rgb_dimming < 8) { + rgb_dimming++; + } + return false; + break; + case RGB_LEVEL_UP: + if (record->event.pressed && rgb_dimming > 0) { + rgb_dimming--; + } + return false; + break; + } + if (!record->event.pressed && IS_KEY(keycode)) { + modifier_already_applied = true; + if (physically_held_modifiers == 0) + clear_sticky_modifiers(); + } + return true; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + #endif //RGBLIGHT_ENABLE +} + +void matrix_scan_user(void) { + #ifdef RGBLIGHT_ENABLE + update_underglow_level(); + #endif //RGBLIGHT_ENABLE +} diff --git a/keyboards/keebio/viterbi/keymaps/dwallace/rules.mk b/keyboards/keebio/viterbi/keymaps/dwallace/rules.mk new file mode 100644 index 00000000000..1e3cebb1451 --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/dwallace/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/viterbi/keymaps/fido/config.h b/keyboards/keebio/viterbi/keymaps/fido/config.h similarity index 100% rename from keyboards/viterbi/keymaps/fido/config.h rename to keyboards/keebio/viterbi/keymaps/fido/config.h diff --git a/keyboards/keebio/viterbi/keymaps/fido/keymap.c b/keyboards/keebio/viterbi/keymaps/fido/keymap.c new file mode 100644 index 00000000000..cd6c8d087f1 --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/fido/keymap.c @@ -0,0 +1,73 @@ +#include "viterbi.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _FN 1 + +#define KC_ KC_TRNS + +#define KC_FN1 MO(_FN) +#define KC_WD_L LCTL(KC_LEFT) +#define KC_WD_R LCTL(KC_RGHT) +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD +#define KC_RST RESET +#define KC_CTLZ LCTL(KC_Z) +#define KC_CTLX LCTL(KC_X) +#define KC_CTLC LCTL(KC_C) +#define KC_CTLV LCTL(KC_V) +#define KC_ATAB LALT(KC_TAB) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + 1 , 2 , 3 , 4 , 5 , 6 ,ESC , DEL , 7 , 8 , 9 , 0 ,MINS,EQL , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + RBRC, Q , W , E , R , T ,TAB , BSPC, Y , U , I , O , P ,LBRC, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + GRV , A , S , D , F , G ,LALT, CAPS, H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + BSLS, Z , X , C , V , B ,LSFT, RSFT, N , M ,COMM,DOT ,SLSH,ENT , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + INS ,PSCR,MENU,LGUI,LCTL,SPC ,FN1 , FN1 ,SPC ,RCTL,RALT, , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_FN] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + F1 , F2 , F3 , F4 , F5 , F6 , , , F7 , F8 , F9 ,F10 ,F11 ,F12 , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,PGUP,WD_L, UP ,WD_R, ,ATAB, ,RMOD,RHUI,RSAI,RVAI, , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,HOME,LEFT,DOWN,RGHT, , , , ,RHUD,RSAD,RVAD, , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,CTLZ,CTLX,CTLC,CTLV, , , ,MUTE,VOLD,VOLU, , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ) + +}; + +void led_set_user(uint8_t usb_led) { + #ifdef RGBLIGHT_ENABLE + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + rgblight_enable(); + } else { + rgblight_disable(); + } + #endif //RGBLIGHT_ENABLE +} diff --git a/keyboards/keebio/viterbi/keymaps/fido/rules.mk b/keyboards/keebio/viterbi/keymaps/fido/rules.mk new file mode 100644 index 00000000000..1e3cebb1451 --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/fido/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/viterbi/keymaps/mike808/config.h b/keyboards/keebio/viterbi/keymaps/mike808/config.h similarity index 100% rename from keyboards/viterbi/keymaps/mike808/config.h rename to keyboards/keebio/viterbi/keymaps/mike808/config.h diff --git a/keyboards/keebio/viterbi/keymaps/mike808/keymap.c b/keyboards/keebio/viterbi/keymaps/mike808/keymap.c new file mode 100644 index 00000000000..e1dc91d2b2b --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/mike808/keymap.c @@ -0,0 +1,157 @@ +#include QMK_KEYBOARD_H + +#define _DVORAK 0 +#define _QWERTY 1 +#define _FN1 2 +#define _MOUSE 3 + +enum custom_keycodes { + DVORAK = SAFE_RANGE, + QWERTY, +}; + +#define KC_ KC_TRNS + +#define KC_DVOR DVORAK +#define KC_QWER QWERTY +#define KC_FN1 MO(_FN1) + +// Tap-Hold keys (QWERTY) +#define KC_S_C MT(MOD_LCTL, KC_S) +#define KC_D_A MT(MOD_LALT, KC_D) +#define KC_F_G MT(MOD_LGUI, KC_F) +#define KC_J_G MT(MOD_RGUI, KC_J) +#define KC_K_A MT(MOD_RALT, KC_K) +#define KC_L_C MT(MOD_RCTL, KC_L) + +// Tap-Hold keys (Dvorak) +#define KC_O_C MT(MOD_LCTL, KC_O) +#define KC_E_A MT(MOD_LALT, KC_E) +#define KC_U_G MT(MOD_LGUI, KC_U) +#define KC_H_G MT(MOD_RGUI, KC_H) +#define KC_T_A MT(MOD_RALT, KC_T) +#define KC_N_C MT(MOD_RCTL, KC_N) + +#define KC_G_A LGUI(KC_A) +#define KC_G_C LGUI(KC_C) +#define KC_G_V LGUI(KC_V) +#define KC_G_X LGUI(KC_X) +#define KC_G_Z LGUI(KC_Z) +#define KC_G_BL LGUI(KC_BSLS) +#define KC_G_TB LGUI(KC_TAB) +#define KC_G_SP LGUI(KC_SPC) + +#define KC_ENTM LT(_MOUSE, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + DVOR,ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,PGUP, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_A ,TAB , Q , W , E , R , T , Y , U , I , O , P ,BSLS,PGDN, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_X ,CAPS, A ,S_C ,D_A ,F_G , G , H ,J_G ,K_A ,L_C ,SCLN,QUOT, UP , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_C ,LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,RSFT,DOWN, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_V ,FN1 ,G_TB,G_SP,BSPC,SPC ,SPC , ENTM,ENTM,G_Z ,GRV ,EQL ,LEFT,RGHT + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_DVORAK] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + QWER,ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,EQL ,PGUP, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_A ,TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH,PGDN, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_X ,CAPS, A ,O_C ,E_A ,U_G , I , D ,H_G ,T_A ,N_C , S ,MINS, UP , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_C ,LSFT,SCLN, Q , J , K , X , B , M , W , V , Z ,RSFT,DOWN, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_V ,FN1 ,G_TB,G_SP,BSPC,SPC ,SPC , ENTM,ENTM,G_Z ,GRV ,BSLS,LEFT,RGHT + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_FN1] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , ,EXLM, AT ,LCBR,RCBR,PIPE, , P7 , P8 , P9 ,ASTR,F12 , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , ,HASH,DLR ,LPRN,RPRN,GRV , , P4 , P5 , P6 ,PLUS,MINS, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , ,PERC,CIRC,LBRC,RBRC,TILD, AMPR, P1 , P2 , P3 ,SLSH, , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , ,PDOT, P0 ,EQL , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_MOUSE] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , ,MS_U, , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , ,MS_L,MS_D,MS_R, , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , ,BTN1,BTN2, , , , , , , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ) +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +#endif + +void update_rgblight(uint16_t layer) { + if (layer & (1UL << _DVORAK)) { + rgblight_sethsv_green(); + } else if (layer & (1UL << _QWERTY)) { + rgblight_sethsv_goldenrod(); + } +} + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); + #ifdef RGBLIGHT_ENABLE + update_rgblight(default_layer); + #endif // RGBLIGHT_ENABLE +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistent_default_layer_set(1UL << _QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistent_default_layer_set(1UL << _DVORAK); + } + return false; + break; + } + return true; +} + + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + uint8_t default_layer = eeconfig_read_default_layer(); + update_rgblight(default_layer); + #endif +} diff --git a/keyboards/keebio/viterbi/keymaps/mike808/rules.mk b/keyboards/keebio/viterbi/keymaps/mike808/rules.mk new file mode 100644 index 00000000000..1e3cebb1451 --- /dev/null +++ b/keyboards/keebio/viterbi/keymaps/mike808/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/keebio/viterbi/readme.md b/keyboards/keebio/viterbi/readme.md new file mode 100644 index 00000000000..2e475100b6f --- /dev/null +++ b/keyboards/keebio/viterbi/readme.md @@ -0,0 +1,21 @@ +Viterbi +======= + +A split 5x14 ortholinear keyboard kit made and sold by Keebio. [More info at Keebio](https://keeb.io) + +Keyboard Maintainer: [Bakingpy](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/viterbi/rev1:default + + +Example of flashing this keyboard: + + make keebio/viterbi/rev1:default:avrdude + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +A build guide for this keyboard can be found here: [Viterbi Build Guide](https://docs.keeb.io) diff --git a/keyboards/keebio/viterbi/rev1/config.h b/keyboards/keebio/viterbi/rev1/config.h new file mode 100644 index 00000000000..12a61448d16 --- /dev/null +++ b/keyboards/keebio/viterbi/rev1/config.h @@ -0,0 +1,53 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1157 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT The Viterbi Keyboard +#define DESCRIPTION Split 5x14 ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } +#define SOFT_SERIAL_PIN D0 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 14 diff --git a/keyboards/viterbi/viterbi.c b/keyboards/keebio/viterbi/rev1/rev1.c similarity index 100% rename from keyboards/viterbi/viterbi.c rename to keyboards/keebio/viterbi/rev1/rev1.c diff --git a/keyboards/keebio/viterbi/rev1/rev1.h b/keyboards/keebio/viterbi/rev1/rev1.h new file mode 100644 index 00000000000..f31373f02e0 --- /dev/null +++ b/keyboards/keebio/viterbi/rev1/rev1.h @@ -0,0 +1,63 @@ +#pragma once + +#include "viterbi.h" +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#ifndef FLIP_HALF +// Standard Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 }, \ + { R46, R45, R44, R43, R42, R41, R40 } \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R00, R01, R02, R03, R04, R05, R06 }, \ + { R10, R11, R12, R13, R14, R15, R16 }, \ + { R20, R21, R22, R23, R24, R25, R26 }, \ + { R30, R31, R32, R33, R34, R35, R36 }, \ + { R40, R41, R42, R43, R44, R45, R46 } \ + } +#endif + +#define LAYOUT_ortho_5x14 LAYOUT diff --git a/keyboards/viterbi/rev1/rules.mk b/keyboards/keebio/viterbi/rev1/rules.mk similarity index 100% rename from keyboards/viterbi/rev1/rules.mk rename to keyboards/keebio/viterbi/rev1/rules.mk diff --git a/keyboards/keebio/viterbi/rev2/config.h b/keyboards/keebio/viterbi/rev2/config.h new file mode 100644 index 00000000000..0b78604d8f7 --- /dev/null +++ b/keyboards/keebio/viterbi/rev2/config.h @@ -0,0 +1,56 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1157 +#define DEVICE_VER 0x0200 +#define MANUFACTURER Keebio +#define PRODUCT The Viterbi Keyboard +#define DESCRIPTION Split 5x14 ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +#define SPLIT_HAND_PIN D2 +#define SOFT_SERIAL_PIN D0 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 14 + +/* Backlight LEDs */ +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 7 diff --git a/keyboards/keebio/viterbi/rev2/rev2.c b/keyboards/keebio/viterbi/rev2/rev2.c new file mode 100644 index 00000000000..509e42dc515 --- /dev/null +++ b/keyboards/keebio/viterbi/rev2/rev2.c @@ -0,0 +1 @@ +#include "viterbi.h" diff --git a/keyboards/keebio/viterbi/rev2/rev2.h b/keyboards/keebio/viterbi/rev2/rev2.h new file mode 100644 index 00000000000..599e6415a3b --- /dev/null +++ b/keyboards/keebio/viterbi/rev2/rev2.h @@ -0,0 +1,35 @@ +#pragma once + +#include "viterbi.h" +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 }, \ + { R46, R45, R44, R43, R42, R41, R40 } \ + } + +#define LAYOUT_ortho_5x14 LAYOUT diff --git a/keyboards/keebio/viterbi/rev2/rules.mk b/keyboards/keebio/viterbi/rev2/rules.mk new file mode 100644 index 00000000000..f95e7ae6a4a --- /dev/null +++ b/keyboards/keebio/viterbi/rev2/rules.mk @@ -0,0 +1,3 @@ +BACKLIGHT_ENABLE = yes + +LAYOUTS = ortho_5x14 diff --git a/keyboards/keebio/viterbi/rules.mk b/keyboards/keebio/viterbi/rules.mk new file mode 100644 index 00000000000..811f57fdbcb --- /dev/null +++ b/keyboards/keebio/viterbi/rules.mk @@ -0,0 +1,32 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = keebio/viterbi/rev2 +LAYOUTS = ortho_5x14 diff --git a/keyboards/keebio/viterbi/viterbi.c b/keyboards/keebio/viterbi/viterbi.c new file mode 100644 index 00000000000..509e42dc515 --- /dev/null +++ b/keyboards/keebio/viterbi/viterbi.c @@ -0,0 +1 @@ +#include "viterbi.h" diff --git a/keyboards/keebio/viterbi/viterbi.h b/keyboards/keebio/viterbi/viterbi.h new file mode 100644 index 00000000000..186892d57a9 --- /dev/null +++ b/keyboards/keebio/viterbi/viterbi.h @@ -0,0 +1,28 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_keebio_viterbi_rev1 + #include "rev1.h" +#elif KEYBOARD_keebio_viterbi_rev2 + #include "rev2.h" +#endif + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \ + ) + +#define LAYOUT_ortho_5x14 LAYOUT + diff --git a/keyboards/keebio/wavelet/config.h b/keyboards/keebio/wavelet/config.h new file mode 100644 index 00000000000..6f67fdbaf53 --- /dev/null +++ b/keyboards/keebio/wavelet/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1046 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Wavelet +#define DESCRIPTION 40 percent ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { F4, F5, F7, B3, D2, D1, D4, D7 } +#define MATRIX_COL_PINS { F6, B1, B2, B6, B4, E6 } + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 // Number of LEDs + +/* Backlight LEDs */ +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 7 diff --git a/keyboards/wavelet/info.json b/keyboards/keebio/wavelet/info.json similarity index 100% rename from keyboards/wavelet/info.json rename to keyboards/keebio/wavelet/info.json diff --git a/keyboards/keebio/wavelet/keymaps/default/keymap.c b/keyboards/keebio/wavelet/keymaps/default/keymap.c new file mode 100644 index 00000000000..abf253380b2 --- /dev/null +++ b/keyboards/keebio/wavelet/keymaps/default/keymap.c @@ -0,0 +1,208 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + BL_STEP, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/nyquist/keymaps/mtdjr/rules.mk b/keyboards/keebio/wavelet/keymaps/default/rules.mk similarity index 100% rename from keyboards/nyquist/keymaps/mtdjr/rules.mk rename to keyboards/keebio/wavelet/keymaps/default/rules.mk diff --git a/keyboards/keebio/wavelet/readme.md b/keyboards/keebio/wavelet/readme.md new file mode 100644 index 00000000000..a107289bb41 --- /dev/null +++ b/keyboards/keebio/wavelet/readme.md @@ -0,0 +1,20 @@ +Wavelet +======= + +A 4x12 ortholinear keyboard using Kailh Choc Low-Profile switches made and sold by [Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make keebio/wavelet:default + +Example of flashing this keyboard: + + make keebio/wavelet:default:avrdude + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +A build guide for this keyboard can be found here: [Levinson Build Guide](https://docs.keeb.io) diff --git a/keyboards/wavelet/rules.mk b/keyboards/keebio/wavelet/rules.mk similarity index 100% rename from keyboards/wavelet/rules.mk rename to keyboards/keebio/wavelet/rules.mk diff --git a/keyboards/wavelet/wavelet.c b/keyboards/keebio/wavelet/wavelet.c similarity index 100% rename from keyboards/wavelet/wavelet.c rename to keyboards/keebio/wavelet/wavelet.c diff --git a/keyboards/wavelet/wavelet.h b/keyboards/keebio/wavelet/wavelet.h similarity index 100% rename from keyboards/wavelet/wavelet.h rename to keyboards/keebio/wavelet/wavelet.h diff --git a/keyboards/keycapsss/o4l_5x12/config.h b/keyboards/keycapsss/o4l_5x12/config.h new file mode 100644 index 00000000000..67bde35cf24 --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/config.h @@ -0,0 +1,43 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x7983 +#define PRODUCT_ID 0x0512 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Keycapsss +#define PRODUCT O4L:5x12 +#define DESCRIPTION A 60 key ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { B5, B4, E6, D7, C6, D4, D0, D1, D2, F6, F5, F4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* WS2812 RGB LED */ +#define RGB_DI_PIN D3 + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 // Number of LEDs +#define RGBLIGHT_HUE_STEP 4 +#define RGBLIGHT_SAT_STEP 4 +#define RGBLIGHT_VAL_STEP 4 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/keycapsss/o4l_5x12/info.json b/keyboards/keycapsss/o4l_5x12/info.json new file mode 100644 index 00000000000..7dba0dab56e --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/info.json @@ -0,0 +1,202 @@ +{ + "keyboard_name": "O4L 5x12", + "keyboard_folder": "keycapsss/o4l_5x12", + "url": "https://github.com/qmk/qmk_firmware/tree/master/keyboards/keycapsss/o4l_5x12", + "maintainer": "BenRoe", + "width": 12, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x12": { + "key_count": 60, + "layout": [ + {"w": 1, "x": 0, "y": 0}, + {"w": 1, "x": 1, "y": 0}, + {"w": 1, "x": 2, "y": 0}, + {"w": 1, "x": 3, "y": 0}, + {"w": 1, "x": 4, "y": 0}, + {"w": 1, "x": 5, "y": 0}, + {"w": 1, "x": 6, "y": 0}, + {"w": 1, "x": 7, "y": 0}, + {"w": 1, "x": 8, "y": 0}, + {"w": 1, "x": 9, "y": 0}, + {"w": 1, "x": 10, "y": 0}, + {"w": 1, "x": 11, "y": 0}, + {"w": 1, "x": 0, "y": 1}, + {"w": 1, "x": 1, "y": 1}, + {"w": 1, "x": 2, "y": 1}, + {"w": 1, "x": 3, "y": 1}, + {"w": 1, "x": 4, "y": 1}, + {"w": 1, "x": 5, "y": 1}, + {"w": 1, "x": 6, "y": 1}, + {"w": 1, "x": 7, "y": 1}, + {"w": 1, "x": 8, "y": 1}, + {"w": 1, "x": 9, "y": 1}, + {"w": 1, "x": 10, "y": 1}, + {"w": 1, "x": 11, "y": 1}, + {"w": 1, "x": 0, "y": 2}, + {"w": 1, "x": 1, "y": 2}, + {"w": 1, "x": 2, "y": 2}, + {"w": 1, "x": 3, "y": 2}, + {"w": 1, "x": 4, "y": 2}, + {"w": 1, "x": 5, "y": 2}, + {"w": 1, "x": 6, "y": 2}, + {"w": 1, "x": 7, "y": 2}, + {"w": 1, "x": 8, "y": 2}, + {"w": 1, "x": 9, "y": 2}, + {"w": 1, "x": 10, "y": 2}, + {"w": 1, "x": 11, "y": 2}, + {"w": 1, "x": 0, "y": 3}, + {"w": 1, "x": 1, "y": 3}, + {"w": 1, "x": 2, "y": 3}, + {"w": 1, "x": 3, "y": 3}, + {"w": 1, "x": 4, "y": 3}, + {"w": 1, "x": 5, "y": 3}, + {"w": 1, "x": 6, "y": 3}, + {"w": 1, "x": 7, "y": 3}, + {"w": 1, "x": 8, "y": 3}, + {"w": 1, "x": 9, "y": 3}, + {"w": 1, "x": 10, "y": 3}, + {"w": 1, "x": 11, "y": 3}, + {"w": 1, "x": 0, "y": 4}, + {"w": 1, "x": 1, "y": 4}, + {"w": 1, "x": 2, "y": 4}, + {"w": 1, "x": 3, "y": 4}, + {"w": 1, "x": 4, "y": 4}, + {"w": 1, "x": 5, "y": 4}, + {"w": 1, "x": 6, "y": 4}, + {"w": 1, "x": 7, "y": 4}, + {"w": 1, "x": 8, "y": 4}, + {"w": 1, "x": 9, "y": 4}, + {"w": 1, "x": 10, "y": 4}, + {"w": 1, "x": 11, "y": 4} + ] + }, + "LAYOUT_ortho_5x12_1x2uC": { + "key_count": 59, + "layout": [ + {"w": 1, "x": 0, "y": 0}, + {"w": 1, "x": 1, "y": 0}, + {"w": 1, "x": 2, "y": 0}, + {"w": 1, "x": 3, "y": 0}, + {"w": 1, "x": 4, "y": 0}, + {"w": 1, "x": 5, "y": 0}, + {"w": 1, "x": 6, "y": 0}, + {"w": 1, "x": 7, "y": 0}, + {"w": 1, "x": 8, "y": 0}, + {"w": 1, "x": 9, "y": 0}, + {"w": 1, "x": 10, "y": 0}, + {"w": 1, "x": 11, "y": 0}, + {"w": 1, "x": 0, "y": 1}, + {"w": 1, "x": 1, "y": 1}, + {"w": 1, "x": 2, "y": 1}, + {"w": 1, "x": 3, "y": 1}, + {"w": 1, "x": 4, "y": 1}, + {"w": 1, "x": 5, "y": 1}, + {"w": 1, "x": 6, "y": 1}, + {"w": 1, "x": 7, "y": 1}, + {"w": 1, "x": 8, "y": 1}, + {"w": 1, "x": 9, "y": 1}, + {"w": 1, "x": 10, "y": 1}, + {"w": 1, "x": 11, "y": 1}, + {"w": 1, "x": 0, "y": 2}, + {"w": 1, "x": 1, "y": 2}, + {"w": 1, "x": 2, "y": 2}, + {"w": 1, "x": 3, "y": 2}, + {"w": 1, "x": 4, "y": 2}, + {"w": 1, "x": 5, "y": 2}, + {"w": 1, "x": 6, "y": 2}, + {"w": 1, "x": 7, "y": 2}, + {"w": 1, "x": 8, "y": 2}, + {"w": 1, "x": 9, "y": 2}, + {"w": 1, "x": 10, "y": 2}, + {"w": 1, "x": 11, "y": 2}, + {"w": 1, "x": 0, "y": 3}, + {"w": 1, "x": 1, "y": 3}, + {"w": 1, "x": 2, "y": 3}, + {"w": 1, "x": 3, "y": 3}, + {"w": 1, "x": 4, "y": 3}, + {"w": 1, "x": 5, "y": 3}, + {"w": 1, "x": 6, "y": 3}, + {"w": 1, "x": 7, "y": 3}, + {"w": 1, "x": 8, "y": 3}, + {"w": 1, "x": 9, "y": 3}, + {"w": 1, "x": 10, "y": 3}, + {"w": 1, "x": 11, "y": 3}, + {"w": 1, "x": 0, "y": 4}, + {"w": 1, "x": 1, "y": 4}, + {"w": 1, "x": 2, "y": 4}, + {"w": 1, "x": 3, "y": 4}, + {"w": 1, "x": 4, "y": 4}, + {"w": 2, "x": 5, "y": 4}, + {"w": 1, "x": 7, "y": 4}, + {"w": 1, "x": 8, "y": 4}, + {"w": 1, "x": 9, "y": 4}, + {"w": 1, "x": 10, "y": 4}, + {"w": 1, "x": 11, "y": 4} + ] + }, + "LAYOUT_ortho_5x12_2x2u": { + "key_count": 58, + "layout": [ + {"w": 1, "x": 0, "y": 0}, + {"w": 1, "x": 1, "y": 0}, + {"w": 1, "x": 2, "y": 0}, + {"w": 1, "x": 3, "y": 0}, + {"w": 1, "x": 4, "y": 0}, + {"w": 1, "x": 5, "y": 0}, + {"w": 1, "x": 6, "y": 0}, + {"w": 1, "x": 7, "y": 0}, + {"w": 1, "x": 8, "y": 0}, + {"w": 1, "x": 9, "y": 0}, + {"w": 1, "x": 10, "y": 0}, + {"w": 1, "x": 11, "y": 0}, + {"w": 1, "x": 0, "y": 1}, + {"w": 1, "x": 1, "y": 1}, + {"w": 1, "x": 2, "y": 1}, + {"w": 1, "x": 3, "y": 1}, + {"w": 1, "x": 4, "y": 1}, + {"w": 1, "x": 5, "y": 1}, + {"w": 1, "x": 6, "y": 1}, + {"w": 1, "x": 7, "y": 1}, + {"w": 1, "x": 8, "y": 1}, + {"w": 1, "x": 9, "y": 1}, + {"w": 1, "x": 10, "y": 1}, + {"w": 1, "x": 11, "y": 1}, + {"w": 1, "x": 0, "y": 2}, + {"w": 1, "x": 1, "y": 2}, + {"w": 1, "x": 2, "y": 2}, + {"w": 1, "x": 3, "y": 2}, + {"w": 1, "x": 4, "y": 2}, + {"w": 1, "x": 5, "y": 2}, + {"w": 1, "x": 6, "y": 2}, + {"w": 1, "x": 7, "y": 2}, + {"w": 1, "x": 8, "y": 2}, + {"w": 1, "x": 9, "y": 2}, + {"w": 1, "x": 10, "y": 2}, + {"w": 1, "x": 11, "y": 2}, + {"w": 1, "x": 0, "y": 3}, + {"w": 1, "x": 1, "y": 3}, + {"w": 1, "x": 2, "y": 3}, + {"w": 1, "x": 3, "y": 3}, + {"w": 1, "x": 4, "y": 3}, + {"w": 1, "x": 5, "y": 3}, + {"w": 1, "x": 6, "y": 3}, + {"w": 1, "x": 7, "y": 3}, + {"w": 1, "x": 8, "y": 3}, + {"w": 1, "x": 9, "y": 3}, + {"w": 1, "x": 10, "y": 3}, + {"w": 1, "x": 11, "y": 3}, + {"w": 1, "x": 0, "y": 4}, + {"w": 1, "x": 1, "y": 4}, + {"w": 1, "x": 2, "y": 4}, + {"w": 1, "x": 3, "y": 4}, + {"w": 2, "x": 4, "y": 4}, + {"w": 2, "x": 6, "y": 4}, + {"w": 1, "x": 8, "y": 4}, + {"w": 1, "x": 9, "y": 4}, + {"w": 1, "x": 10, "y": 4}, + {"w": 1, "x": 11, "y": 4} + ] + } + } +} diff --git a/keyboards/keycapsss/o4l_5x12/keymaps/2x2u/config.h b/keyboards/keycapsss/o4l_5x12/keymaps/2x2u/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/keymaps/2x2u/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/keycapsss/o4l_5x12/keymaps/2x2u/keymap.c b/keyboards/keycapsss/o4l_5x12/keymaps/2x2u/keymap.c new file mode 100644 index 00000000000..00aec245ef9 --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/keymaps/2x2u/keymap.c @@ -0,0 +1,83 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum o4l5x12_layers { + _QWERTY, + _LOWER +}; + +// Layers get their own keys. These are defined to make them not mess up +// the grid. +enum o4l5x12_keycodes { + QWERTY = SAFE_RANGE, + LOWER +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ESC | Q | W | E | R | T | Y | U | I | O | P | BSPC | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI |Lower | Enter | Space | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_5x12_2x2u( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_ENT, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |RGBPLA| { | [ | ( | | | ) | ] | } | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |RGBMOD| | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |UGlow | Reset| | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_5x12_2x2u( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_DEL, + RGB_M_P, KC_LCBR, KC_LBRC, KC_LPRN, KC_SLSH, KC_BSLS, KC_RPRN, KC_RBRC, KC_RCBR, _______, _______, KC_PIPE, + RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RESET, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/keycapsss/o4l_5x12/keymaps/default/config.h b/keyboards/keycapsss/o4l_5x12/keymaps/default/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/keycapsss/o4l_5x12/keymaps/default/keymap.c b/keyboards/keycapsss/o4l_5x12/keymaps/default/keymap.c new file mode 100644 index 00000000000..3e9dc335d7e --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/keymaps/default/keymap.c @@ -0,0 +1,140 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum preonic_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +// Layers get their own keys. These are defined to make them not mess up +// the grid. +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty (Preonic Layer Style) + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_5x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + RGB_TOG, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower (Preonic Layer Style) + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_5x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise (Preonic Layer Style) + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_5x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) (Preonic Layer Style) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_5x12( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/keycapsss/o4l_5x12/o4l_5x12.c b/keyboards/keycapsss/o4l_5x12/o4l_5x12.c new file mode 100644 index 00000000000..78267062c36 --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/o4l_5x12.c @@ -0,0 +1 @@ +#include "o4l_5x12.h" diff --git a/keyboards/keycapsss/o4l_5x12/o4l_5x12.h b/keyboards/keycapsss/o4l_5x12/o4l_5x12.h new file mode 100644 index 00000000000..2061d477b92 --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/o4l_5x12.h @@ -0,0 +1,50 @@ +#pragma once + +#include "quantum.h" + +#define XXX KC_NO + + #define LAYOUT_ortho_5x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ + } + + #define LAYOUT_ortho_5x12_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, }, \ + { k40, k41, k42, k43, k44, k45, XXX, k47, k48, k49, k4a, k4b } \ + } + + #define LAYOUT_ortho_5x12_2x2u( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k46, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, }, \ + { k40, k41, k42, k43, k44, XXX, k46, XXX, k48, k49, k4a, k4b } \ + } diff --git a/keyboards/keycapsss/o4l_5x12/readme.md b/keyboards/keycapsss/o4l_5x12/readme.md new file mode 100644 index 00000000000..4b1ebb6c7c3 --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/readme.md @@ -0,0 +1,31 @@ +# O4L 5x12 + +A ortholinear 5x12 keyboard made and sold by Keycapsss. [More info at Keycapsss.com](https://keycapsss.com). + + + +## Features: + +- MX and Choc switch support +- RGB Underglow (12x SK6812MINI) +- USB-C +- PCB shape, reset button and mounting holes position same as Preonic Rev3 +- Pro Micro as controller + +--- + +- Keyboard Maintainer: BenRoe [Github](https://github.com/BenRoe) / [Twitter](https://twitter.com/ben_roe) +- Hardware Supported: Pro Micro +- Hardware Availability: [Keycapsss.com](https://keycapsss.com) + + + +Make firmware .hex for this keyboard (after setting up your build environment): + + make keycapsss/o4l_5x12:default + +Example of flashing this keyboard (or use [QMK Toolbox](https://github.com/qmk/qmk_toolbox)): + + make keycapsss/o4l_5x12:default:avrdude + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/keycapsss/o4l_5x12/rules.mk b/keyboards/keycapsss/o4l_5x12/rules.mk new file mode 100644 index 00000000000..36c30f309f2 --- /dev/null +++ b/keyboards/keycapsss/o4l_5x12/rules.mk @@ -0,0 +1,73 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +LAYOUTS = ortho_5x12 diff --git a/keyboards/keyhive/maypad/config.h b/keyboards/keyhive/maypad/config.h new file mode 100644 index 00000000000..4fce7ffa0c8 --- /dev/null +++ b/keyboards/keyhive/maypad/config.h @@ -0,0 +1,246 @@ +/* +Copyright 2019 codybender +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KeyHive +#define PRODUCT maypad +#define DESCRIPTION Budget-friendly numpad + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F6, F7, B1, B3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/keyhive/maypad/info.json b/keyboards/keyhive/maypad/info.json new file mode 100644 index 00000000000..89367173109 --- /dev/null +++ b/keyboards/keyhive/maypad/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "maypad", + "url": "https://keyhive.xyz/shop/may-pad", + "maintainer": "codybender", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT_numpad_5x4": { + "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "y":1, "h":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"0", "x":0, "y":4, "w":2}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":3, "h":2}] + }, + "LAYOUT_ortho_5x4": { + "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "y":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"Enter", "x":3, "y":3}, {"label":"0", "x":0, "y":4}, {"label":"00", "x":1, "y":4}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}] + } + + } +} diff --git a/keyboards/keyhive/maypad/keymaps/default/config.h b/keyboards/keyhive/maypad/keymaps/default/config.h new file mode 100644 index 00000000000..867ac3066fa --- /dev/null +++ b/keyboards/keyhive/maypad/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 codybender + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/keyhive/maypad/keymaps/default/keymap.c b/keyboards/keyhive/maypad/keymaps/default/keymap.c new file mode 100644 index 00000000000..466a13f41b6 --- /dev/null +++ b/keyboards/keyhive/maypad/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +/* Copyright 2019 codybender + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_numpad_5x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, + KC_P0, KC_PDOT, KC_PENT + ), +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/keyhive/maypad/keymaps/default/readme.md b/keyboards/keyhive/maypad/keymaps/default/readme.md new file mode 100644 index 00000000000..fbd112d92d1 --- /dev/null +++ b/keyboards/keyhive/maypad/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for maypad \ No newline at end of file diff --git a/keyboards/keyhive/maypad/maypad.c b/keyboards/keyhive/maypad/maypad.c new file mode 100644 index 00000000000..825d8c4a5d5 --- /dev/null +++ b/keyboards/keyhive/maypad/maypad.c @@ -0,0 +1,51 @@ +/* Copyright 2019 codybender + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "maypad.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/keyhive/maypad/maypad.h b/keyboards/keyhive/maypad/maypad.h new file mode 100644 index 00000000000..42c71f41638 --- /dev/null +++ b/keyboards/keyhive/maypad/maypad.h @@ -0,0 +1,61 @@ +/* Copyright 2019 codybender + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* maypad numpad layout + * .-------------------. + * |NLCK| /| *| -| + * |-------------------| + * | 7| 8| 9| | + * |--------------| | + * | 4| 5| 6| +| + * |-------------------| + * | 1| 2| 3| | + * |--------------| | + * | 0| .| Ent| + * '-------------------' + */ +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_numpad_5x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, \ + k20, k21, k22, k23, \ + k30, k31, k32, \ + k41, k42, k43 \ +) { \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, KC_NO }, \ + { k20, k21, k22, k23 }, \ + { k30, k31, k32, KC_NO }, \ + { KC_NO, k41, k42, k43 } \ +} + +#define LAYOUT_ortho_5x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, k23, \ + k30, k31, k32, k33, \ + k40, k41, k42, k43 \ +) { \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, k23 }, \ + { k30, k31, k32, k33 }, \ + { k40, k41, k42, k43 } \ +} diff --git a/keyboards/keyhive/maypad/readme.md b/keyboards/keyhive/maypad/readme.md new file mode 100644 index 00000000000..3467827b6d6 --- /dev/null +++ b/keyboards/keyhive/maypad/readme.md @@ -0,0 +1,13 @@ +# KeyHive Maypad + +![Maypad Layout](https://i.imgur.com/B7WXcfy.png) + +A budget-friendly, exposed-component numpad from [KeyHive](https://www.keyhive.xyz) + +Keyboard Maintainer: [Cody Bender](https://github.com/codybender) + +Make example for this keyboard (after setting up your build environment): + + make keyhive/maypad:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/keyhive/maypad/rules.mk b/keyboards/keyhive/maypad/rules.mk new file mode 100644 index 00000000000..d34236a16ec --- /dev/null +++ b/keyboards/keyhive/maypad/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_5x4 numpad_5x4 diff --git a/keyboards/kinesis/config.h b/keyboards/kinesis/config.h index a4e06b6ebb2..368037d8b2b 100644 --- a/keyboards/kinesis/config.h +++ b/keyboards/kinesis/config.h @@ -36,7 +36,7 @@ along with this program. If not, see . #define MOUSEKEY_WHEEL_TIME_TO_MAX 1 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -76,11 +76,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -135,8 +130,6 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - - #ifdef SUBPROJECT_alvicstep #include "alvicstep/config.h" #endif diff --git a/keyboards/kinesis/keymaps/carpalx/keymap.c b/keyboards/kinesis/keymaps/carpalx/keymap.c index c00c5327b32..2e56946e766 100644 --- a/keyboards/kinesis/keymaps/carpalx/keymap.c +++ b/keyboards/kinesis/keymaps/carpalx/keymap.c @@ -11,10 +11,6 @@ extern keymap_config_t keymap_config; #define QWERTY M(_QW) #define COLEMAK M(_CM) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - /* Function Keys on All Layers (Keypad toggles): @@ -168,11 +164,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/keyboards/kinesis/keymaps/carpalx/rules.mk b/keyboards/kinesis/keymaps/carpalx/rules.mk index c7753fae05f..63f52ac18e7 100644 --- a/keyboards/kinesis/keymaps/carpalx/rules.mk +++ b/keyboards/kinesis/keymaps/carpalx/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kinesis/keymaps/default/config.h b/keyboards/kinesis/keymaps/default/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/kinesis/keymaps/default/config.h +++ b/keyboards/kinesis/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/kinesis/keymaps/default/keymap.c b/keyboards/kinesis/keymaps/default/keymap.c index f36d6dd1ddc..dd85cdbe28b 100644 --- a/keyboards/kinesis/keymaps/default/keymap.c +++ b/keyboards/kinesis/keymaps/default/keymap.c @@ -52,27 +52,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/kinesis/keymaps/default/rules.mk b/keyboards/kinesis/keymaps/default/rules.mk index 93f927c7d0a..7a331cd530c 100644 --- a/keyboards/kinesis/keymaps/default/rules.mk +++ b/keyboards/kinesis/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kinesis/keymaps/default_pretty/keymap.c b/keyboards/kinesis/keymaps/default_pretty/keymap.c index 58d749074dc..3d2a538a2e8 100644 --- a/keyboards/kinesis/keymaps/default_pretty/keymap.c +++ b/keyboards/kinesis/keymaps/default_pretty/keymap.c @@ -45,27 +45,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/kinesis/keymaps/default_pretty/rules.mk b/keyboards/kinesis/keymaps/default_pretty/rules.mk index 93f927c7d0a..7a331cd530c 100644 --- a/keyboards/kinesis/keymaps/default_pretty/rules.mk +++ b/keyboards/kinesis/keymaps/default_pretty/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kinesis/keymaps/dvorak/keymap.c b/keyboards/kinesis/keymaps/dvorak/keymap.c index 5d9739866c2..9e44c10ce50 100644 --- a/keyboards/kinesis/keymaps/dvorak/keymap.c +++ b/keyboards/kinesis/keymaps/dvorak/keymap.c @@ -55,11 +55,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/kinesis/keymaps/dvorak/rules.mk b/keyboards/kinesis/keymaps/dvorak/rules.mk index 93f927c7d0a..7a331cd530c 100644 --- a/keyboards/kinesis/keymaps/dvorak/rules.mk +++ b/keyboards/kinesis/keymaps/dvorak/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/config.h b/keyboards/kinesis/keymaps/insertsnideremarks/config.h index 9ce094be516..053a291b7c6 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/config.h +++ b/keyboards/kinesis/keymaps/insertsnideremarks/config.h @@ -6,7 +6,7 @@ // place overrides here #define IGNORE_MOD_TAP_INTERRUPT -#define TAPPING_TERM 175 +#define TAPPING_TERM 150 #define TAPPING_TOGGLE 2 diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c b/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c index 78defea2375..10b0c2cb73d 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c +++ b/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c @@ -1,4 +1,4 @@ -#include QMK_KEYBOARD_H +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -32,9 +32,6 @@ enum kinesis_keycodes { NKROTG = MAGIC_TOGGLE_NKRO }; -#define _______ KC_TRNS -#define XXXXXXX KC_NO - //Tap Dance Declarations enum { ADJ = 0, @@ -150,7 +147,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { SPCFN, ENTNS, KC_BSPC, KC_ENT, DELNS, BSPCFN ), -/* Number/symbol layer +/* Numbers/Symbols layer (Multiple characters: single-tap for first, double-tap for second) ,-----------------------------------------------------------------------------------------------------------. | | | | | | | | | | | | | | | | | | | @@ -259,7 +256,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |--------+------+------+------+------+------| |------+------+------+------+------+--------| | | | KP . |KP/KP*| KP- _| KP+ =| | | KP 1 | KP 2 | KP 3 |KP Ent| | `--------+------+------+------+------+------' `------+------+------+------+------+--------' - | ( | ) | [ { | ] } | | KP 0 | , | KP . |KP Ent| + | ( | ) | [ { | ] } | | | KP 0 | KP . |KP Ent| `---------------------------' `---------------------------' ,---------------. ,---------------. | | | | | | @@ -275,14 +272,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, _______, KC_P4, KC_P5, KC_P6, KC_EQL, _______, _______, _______, KC_PDOT, TD(PSLPAS), TD(PMNUN), TD(PPLEQ), _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, - KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), KC_P0, KC_COMM, KC_PDOT, KC_PENT, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Colemak gaming/vanilla - (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) + (Limited access to Function or Numbers layers; mainly used for gaming; Ent/NS + Delete/Numbers2 to access Adjust layer) ,-----------------------------------------------------------------------------------------------------------. | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| `-----------------------------------------------------------------------------------------------------------' @@ -291,18 +288,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |--------+------+------+------+------+------| |------+------+------+------+------+--------| | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | |--------+------+------+------+------+------| |------+------+------+------+------+--------| - | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + | LCtrl | A | R | S | T | D | | H | N | E | I | O | ' | |--------+------+------+------+------+------| |------+------+------+------+------+--------| | Shift | Z | X | C | V | B | | K | M | , | . | / | Shift | `--------+------+------+------+------+------' `------+------+------+------+------+--------' | Ins | ` | [ | ] | | Left | Down | Up | Right| `---------------------------' `---------------------------' ,---------------. ,---------------. - |Esc/Ctl|TD(ADJ)| | RAlt | RCtl | + | Esc | | | RAlt | RCtl | ,-------|-------|-------| |-------+-------+-------. - | | | LAlt | | RGUI | | | - | Space | Enter |-------| |-------| Delete| Bspc | - | | |Bspc/FN| | Ent/NS| | | + | | | LAlt | | RGUI | Delete| Bspc | + | Space | Enter |-------| |-------| / | / | + | | | Bspc | | Ent/NS|Number2| Fn2 | `-----------------------' `-----------------------' */ [_COLEMAKGM] = LAYOUT_pretty( @@ -312,13 +309,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - CTLESC, TD(ADJ), KC_RALT, KC_RCTL, + KC_ESC, XXXXXXX, KC_RALT, KC_RCTL, KC_LALT, KC_RGUI, - KC_SPC, KC_ENT, BSPCFN, ENTNS, KC_DEL, KC_BSPC + KC_SPC, KC_ENT, KC_BSPC, ENTNS, DELNS, BSPCFN ), /* QWERTY gaming/vanilla - (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) + (Limited access to Function or Numbers layers; mainly used for gaming; Ent/NS + Delete/Numbers2 to access Adjust layer) ,-----------------------------------------------------------------------------------------------------------. | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| `-----------------------------------------------------------------------------------------------------------' @@ -327,18 +324,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |--------+------+------+------+------+------| |------+------+------+------+------+--------| | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | |--------+------+------+------+------+------| |------+------+------+------+------+--------| - | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + | LCtrl | A | S | D | F | G | | H | J | K | L | ; | ' | |--------+------+------+------+------+------| |------+------+------+------+------+--------| | Shift | Z | X | C | V | B | | N | M | , | . | / | Shift | `--------+------+------+------+------+------' `------+------+------+------+------+--------' | Ins | ` | [ | ] | | Left | Down | Up | Right| `---------------------------' `---------------------------' ,---------------. ,---------------. - |Esc/Ctl|TD(ADJ)| | RAlt | RCtl | + | Esc | | | RAlt | RCtl | ,-------|-------|-------| |-------+-------+-------. - | | | LAlt | | RGUI | | | - | Space | Enter |-------| |-------| Delete| Bspc | - | | |Bspc/FN| | Ent/NS| | | + | | | LAlt | | RGUI | Delete| Bspc | + | Space | Enter |-------| |-------| / | / | + | | | Bspc | | Ent/NS|Number2| Fn2 | `-----------------------' `-----------------------' */ [_QWERTYGM] = LAYOUT_pretty( @@ -348,9 +345,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - CTLESC, TD(ADJ), KC_RALT, KC_RCTL, + KC_ESC, XXXXXXX, KC_RALT, KC_RCTL, KC_LALT, KC_RGUI, - KC_SPC, KC_ENT, BSPCFN, ENTNS, KC_DEL, KC_BSPC + KC_SPC, KC_ENT, KC_BSPC, ENTNS, DELNS, BSPCFN ), /* Adjust layer @@ -407,11 +404,6 @@ uint32_t layer_state_set_user(uint32_t state) { return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST); } -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case COLEMAK: @@ -482,4 +474,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/readme.md b/keyboards/kinesis/keymaps/insertsnideremarks/readme.md index 7a146c7a292..783c188185d 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/readme.md +++ b/keyboards/kinesis/keymaps/insertsnideremarks/readme.md @@ -1,6 +1,8 @@ -# insertsnideremarks' Kinesis Keymap +## I've changed my folder name to match my GitHub username. Please see https://github.com/qmk/qmk_firmware/tree/master/keyboards/kinesis/keymaps/tuesdayjohn for my current keymap files. -These layouts are derived from what I was using on my Kinesis Contoured keyboards with Hasu's TMK converters. With the move to QMK via Stapelberg replacement controller, I've cleaned up the layouts a bit while adding more functions and layers. +## insertsnideremarks' Kinesis Keymap + +These layouts are derived from what I was using on my Kinesis Contoured keyboards with Hasu's USB-USB TMK converters. With the move to QMK via Stapelberg replacement controller, I've cleaned up the layouts a bit while adding more functions and layers. There are minor changes in the base keywell layout of non-alpha keys (e.g., CapsLock is ESC/Ctl, arrow clusters on one side), while the thumb clusters deviate more from the default layout. @@ -10,36 +12,36 @@ Changes to the thumb clusters include: * Backspace have been duplicated on both clusters. * The 2u keys serve dual function as momentary layer switchers. -I've largely left the function keys untouched, with the intension of not using them. They are neither easy to use nor reach due to their locations and size, and, prior to Advantage2, particularly terrible rubber domes were used. They have since updated the keys with Cherry ML switches on Advantage2, but did not resolve the issues of size or location. Additionally, leaving the function keys unused here makes it easier for me to adapt the keymaps to my other keyboards, most of which do not have physical function keys. +I've largely left the function keys untouched, with the intension of not using them. They are neither easy to use nor reach due to their locations and size, and the rubber domes used were terrible. They have since replaced the keys with Cherry ML switches on Advantage2, but did not resolve the issues of size or location. Additionally, leaving the function keys unused here makes it easier for me to adapt the keymaps to my other keyboards, most of which do not have physical function keys. I use Colemak as my default layout. I've included QWERTY here as well. -Additionally, I've added gaming/vanilla version of Colemak and QWERTY layouts. These layouts have limited access to the Function or Numbers layers, and are mainly used for gaming. +Additionally, I've added gaming/vanilla version of Colemak and QWERTY layouts. These layouts have limited access to the Function or Numbers/Symbols layers, and are mainly used for gaming. Persistent default layer has been enabled for Colemak and QWERTY. The gaming/vanilla Colemak and QWERTY can be set as default layer, but will not be persistent. ## Future plans -* Add status LEDs to the Stapelberg PCB (usually used for Caps Lock, Num Lock, and Scroll Lock). May configure it as layer indicator. +* Add status LEDs to the Stapelberg PCB (usually used for Caps Lock, Num Lock, and Scroll Lock) to use as layer indicators. * Add a speaker now that QMK supports additional pins for audio use. -* Utilize the leftover spots on the key matrix, as well as unused pins on Teensy to run macropad and/or foot pedals. +* Utilize the leftover spots on the key matrix, as well as unused pins on Teensy++ 2.0 to run macropad and/or foot pedals. ### Colemak - (Default layer, keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) - ,-----------------------------------------------------------------------------------------------------------. - | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| - `-----------------------------------------------------------------------------------------------------------' - ,-------------------------------------------. ,-------------------------------------------. - | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | - |--------+------+------+------+------+------| |------+------+------+------+------+--------| - | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | - |--------+------+------+------+------+------| |------+------+------+------+------+--------| - |Esc/Ctrl| A | R | S | T | D | | H | N | E | I | O | ' | - |--------+------+------+------+------+------| |------+------+------+------+------+--------| - |SC Shift| Z | X | C | V | B | | K | M | , | . | / |SC Shift| - `--------+------+------+------+------+------' `------+------+------+------+------+--------' - | Ins | ` | [ | ] | | Left | Down | Up | Right| + (Default layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) + ,-----------------------------------------------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| + `-----------------------------------------------------------------------------------------------------------' + ,-------------------------------------------. ,-------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + |Esc/Ctrl| A | R | S | T | D | | H | N | E | I | O | ' | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + |SC Shift| Z | X | C | V | B | | K | M | , | . | / |SC Shift| + `--------+------+------+------+------+------' `------+------+------+------+------+--------' + | Ins | ` | [ | ] | | Left | Down | Up | Right| `---------------------------' `---------------------------' ,---------------. ,---------------. |Esc/Ctl| Hyper | | RAlt | RCtl | @@ -150,7 +152,7 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va ### Colemak gaming/vanilla - (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) + (Limited access to Function or Numbers layers; mainly used for gaming; Ent/NS + Delete/Numbers2 to access Adjust layer) ,-----------------------------------------------------------------------------------------------------------. | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| `-----------------------------------------------------------------------------------------------------------' @@ -159,23 +161,23 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va |--------+------+------+------+------+------| |------+------+------+------+------+--------| | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | |--------+------+------+------+------+------| |------+------+------+------+------+--------| - | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + | LCtrl | A | R | S | T | D | | H | N | E | I | O | ' | |--------+------+------+------+------+------| |------+------+------+------+------+--------| | Shift | Z | X | C | V | B | | K | M | , | . | / | Shift | `--------+------+------+------+------+------' `------+------+------+------+------+--------' | Ins | ` | [ | ] | | Left | Down | Up | Right| `---------------------------' `---------------------------' ,---------------. ,---------------. - |Esc/Ctl|TD(ADJ)| | RAlt | RCtl | + | Esc | | | RAlt | RCtl | ,-------|-------|-------| |-------+-------+-------. - | | | LAlt | | RGUI | | | - | Space | Enter |-------| |-------| Delete| Bspc | - | | |Bspc/FN| | Ent/NS| | | + | | | LAlt | | RGUI | Delete| Bspc | + | Space | Enter |-------| |-------| / | / | + | | | Bspc | | Ent/NS|Number2| Fn2 | `-----------------------' `-----------------------' ### QWERTY gaming/vanilla - (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) + (Limited access to Function or Numbers layers; mainly used for gaming; Ent/NS + Delete/Numbers2 to access Adjust layer) ,-----------------------------------------------------------------------------------------------------------. | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| `-----------------------------------------------------------------------------------------------------------' @@ -184,18 +186,18 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va |--------+------+------+------+------+------| |------+------+------+------+------+--------| | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | |--------+------+------+------+------+------| |------+------+------+------+------+--------| - | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + | LCtrl | A | S | D | F | G | | H | J | K | L | ; | ' | |--------+------+------+------+------+------| |------+------+------+------+------+--------| | Shift | Z | X | C | V | B | | N | M | , | . | / | Shift | `--------+------+------+------+------+------' `------+------+------+------+------+--------' | Ins | ` | [ | ] | | Left | Down | Up | Right| `---------------------------' `---------------------------' ,---------------. ,---------------. - |Esc/Ctl|TD(ADJ)| | RAlt | RCtl | + | Esc | | | RAlt | RCtl | ,-------|-------|-------| |-------+-------+-------. - | | | LAlt | | RGUI | | | - | Space | Enter |-------| |-------| Delete| Bspc | - | | |Bspc/FN| | Ent/NS| | | + | | | LAlt | | RGUI | Delete| Bspc | + | Space | Enter |-------| |-------| / | / | + | | | Bspc | | Ent/NS|Number2| Fn2 | `-----------------------' `-----------------------' ### Adjust layer @@ -221,4 +223,4 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va | | |-------| |-------| | | | | | | | | | | `-----------------------' `-----------------------' - \ No newline at end of file + diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk b/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk index 24b16ba9b76..d2e362886a5 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk +++ b/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk @@ -19,6 +19,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Enable Tap Dancing function -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kinesis/keymaps/milestogo/keymap.c b/keyboards/kinesis/keymaps/milestogo/keymap.c index 1ae7d9082a8..f3eb24eb057 100644 --- a/keyboards/kinesis/keymaps/milestogo/keymap.c +++ b/keyboards/kinesis/keymaps/milestogo/keymap.c @@ -7,10 +7,6 @@ #define _TRANS 3// #define _SYMB2 4// old symbol level, more ergodox like -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - /* Macros */ enum { NONE = 0, @@ -54,13 +50,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8, KC_GRAVE, KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_TAB, KC_Q ,KC_W ,KC_E ,KC_R ,KC_T , - KC_FN0 ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G , + TT(_MOUSE) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G , KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , KC_GRAVE, KC_ESC, KC_FN4, KC_FN5, KC_LCTL,KC_LALT, KC_DEL, - KC_BSPC, KC_DEL ,KC_FN0 , - KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_FN0 ,KC_FN1 ,KC_FN2, KC_NO, RESET, + KC_BSPC, KC_DEL ,TT(_MOUSE) , + KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,TT(_MOUSE) ,KC_FN1 ,TT(_SYMB), KC_NO, RESET, KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS, KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_BSLS, KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT, @@ -109,7 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, RESET, - _______, _______, _______, _______, _______, _______, _______, KC_FN0, KC_2, + _______, _______, _______, _______, _______, _______, _______, TT(_MOUSE), KC_2, _______, _______, _______, _______, _______, _______, KC_AMPR, KC_LBRC, KC_LPRN, KC_RPRN, KC_UNDS, _______, KC_ASTR, KC_PLUS, KC_1, KC_MINS, KC_RBRC, KC_GRV, @@ -157,7 +153,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, RESET, - _______, _______, _______, _______, _______, _______, _______, KC_FN0, KC_2, + _______, _______, _______, _______, _______, _______, _______, TT(_MOUSE), KC_2, _______, _______, _______, KC_ASTR, _______, _______, _______, _______, KC_PLUS, KC_MINS, _______, _______, _______, _______, KC_EQL, KC_PIPE, _______, _______, @@ -202,7 +198,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_FN0,RESET, + _______, _______, _______, _______, _______, _______, _______, TT(_MOUSE),RESET, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_ACL2, KC_WH_U, M(A_MUL), KC_MS_U, M(A_MUR), KC_NO, KC_ACL1, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_ACL0, @@ -251,7 +247,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_FN0, KC_2, + _______, _______, _______, _______, _______, _______, _______, TT(_MOUSE), KC_2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -268,9 +264,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_TOGGLE(_MOUSE) , [1] = ACTION_LAYER_TOGGLE(_MOUSE) , - [2] = ACTION_LAYER_TAP_TOGGLE(_SYMB) , [5]= ACTION_LAYER_TAP_KEY(_SYMB,KC_RIGHT), [4]= ACTION_MODS_TAP_KEY(MOD_LGUI,KC_LEFT), [6]= ACTION_LAYER_TAP_KEY(_SYMB,KC_UP), diff --git a/keyboards/kinesis/keymaps/milestogo/rules.mk b/keyboards/kinesis/keymaps/milestogo/rules.mk index 93f927c7d0a..7a331cd530c 100644 --- a/keyboards/kinesis/keymaps/milestogo/rules.mk +++ b/keyboards/kinesis/keymaps/milestogo/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kinesis/keymaps/tuesdayjohn/config.h b/keyboards/kinesis/keymaps/tuesdayjohn/config.h new file mode 100644 index 00000000000..ebed17fedef --- /dev/null +++ b/keyboards/kinesis/keymaps/tuesdayjohn/config.h @@ -0,0 +1,6 @@ +#pragma once + +// place overrides here +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM 175 +#define TAPPING_TOGGLE 2 diff --git a/keyboards/kinesis/keymaps/tuesdayjohn/keymap.c b/keyboards/kinesis/keymaps/tuesdayjohn/keymap.c new file mode 100644 index 00000000000..0cdb7d584dc --- /dev/null +++ b/keyboards/kinesis/keymaps/tuesdayjohn/keymap.c @@ -0,0 +1,427 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum kinesis_layers { + _COLEMAK, // Colemak (default layer) + _QWERTY, // QWERTY + _GAMING, // Gaming/vanilla toggle layer (limited dual-role keys and layer access) + _NUMBERS, // Numbers & Symbols + _NUMBERS2, // Numbers & Symbols 2 (identical as _NUMBERS; basically used for tri-layer access to _ADJUST) + _FUNCTION, // Function + _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows) + _NUMPAD, // Numpad + _ADJUST, // Adjust layer (accessed via tri-layer feature) + _ADJUST2 // Second Adjust layer (accessed outside of tri-layer feature) +}; + +enum kinesis_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY, + GAMING +}; + +//Tap Dance Declarations +enum { + ADJ = 0, + LBCB, + RBCB, + EQPL, + PLEQ, + MNUN, + SLAS, + GVTL, + PPEQ, + PMUN, + PSPA +}; + +void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_on(_ADJUST2); + set_oneshot_layer(_ADJUST2, ONESHOT_START); + } +} +void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_off(_ADJUST2); + clear_oneshot_layer_state(ONESHOT_PRESSED); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { +[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer +[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap +[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap +[EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), // Plus sign on a single-tap, equal sign on a double-tap +[PLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQL), // Equal sign on a single-tap, plus sign on a double-tap +[MNUN] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), // Minus sign on a single-tap, underscore on a double-tap +[SLAS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ASTR), // Slash in a single-tap, asterisk in a double-tap +[GVTL] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), // Grave on a single-tap, tilde on a double-tap +[PPEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PPLS, KC_EQL), // Numpad plus sign on a single-tap, equal sign on a double-tap +[PMUN] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_UNDS), // Numpad minus sign on a single-tap, underscore on a double-tap +[PSPA] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST) // Numpad slash on a single-tap, numpad asterisk on a double-tap +}; + +//Aliases for longer keycodes +#define NUMPAD TG(_NUMPAD) +#define ADJUST MO(_ADJUST2) +#define SPCFN LT(_FUNCTION, KC_SPC) +#define BSPCFN LT(_FUNCTION2, KC_BSPC) +#define ENTNS LT(_NUMBERS, KC_ENT) +#define DELNS LT(_NUMBERS2, KC_DEL) +#define CTLESC CTL_T(KC_ESC) +#define ALTAPP ALT_T(KC_APP) +#define CTL_A LCTL(KC_A) +#define CTL_C LCTL(KC_C) +#define CTL_V LCTL(KC_V) +#define CTL_X LCTL(KC_X) +#define CTL_Z LCTL(KC_Z) +#define CTL_Y LCTL(KC_Y) +#define CA_TAB LCA(KC_TAB) +#define HYPER ALL_T(KC_NO) +#define TD_ADJ TD(ADJ) +#define TD_LBCB TD(LBCB) +#define TD_RBCB TD(RBCB) +#define TD_EQPL TD(EQPL) +#define TD_PLEQ TD(PLEQ) +#define TD_MNUN TD(MNUN) +#define TD_SLAS TD(SLAS) +#define TD_GVTL TD(GVTL) +#define TD_PPEQ TD(PPEQ) +#define TD_PMUN TD(PMUN) +#define TD_PSPA TD(PSPA) +#define NKROTG MAGIC_TOGGLE_NKRO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +Colemak +(Default layer; keys separated by "/" tap for first, hold for second; uses Space Cadet Shifts) +,--------------------------------------------------------------. ,--------------------------------------------------------------. +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | | F9 | F10 | F11 | F12 |PrtScr|ScrLck| Pause|Numpad|Adjust| +`--------------------------------------------------------------' `--------------------------------------------------------------' +,------------------------------------------------------. ,------------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| ESC/Ctrl| A | R | S | T | D | | H | N | E | I | O | ' | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| SC Shift| Z | X | C | V | B | | K | M | , | . | / | SC Shift| +`---------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+---------' + | Ins | ` | [ | ] | | Left | Down | Up | Right | + `-----------------------------------' `-----------------------------------' + ,-----------------. ,-----------------. + | ESC/Ctl| Hyper | | RAlt | RCtl | + ,--------+--------+--------| |--------+--------+--------. + | Space | Enter | App/Alt| | RGUI | Delete | Bspc | + | / | / |--------| |--------| / | / | + | Fn | Number | Bspc | | Enter | Number2| Fn2 | + `--------------------------' `--------------------------' +*/ +[_COLEMAK] = LAYOUT_pretty( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, NUMPAD, ADJUST, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + CTLESC, HYPER, KC_RALT, KC_RCTL, + ALTAPP, KC_RGUI, + SPCFN, ENTNS, KC_BSPC, KC_ENT, DELNS, BSPCFN +), + +/* +QWERTY +(Keys separated by "/" tap for first, hold for second; uses Space Cadet Shifts) +,--------------------------------------------------------------. ,--------------------------------------------------------------. +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | | F9 | F10 | F11 | F12 |PrtScr|ScrLck| Pause|Numpad|Adjust| +`--------------------------------------------------------------' `--------------------------------------------------------------' +,------------------------------------------------------. ,------------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| ESC/Ctrl| A | S | D | F | G | | H | J | K | L | ; | ' | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| SC Shift| Z | X | C | V | B | | N | M | , | . | / | SC Shift| +`---------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+---------' + | Ins | ` | [ | ] | | Left | Down | Up | Right | + `-----------------------------------' `-----------------------------------' + ,-----------------. ,-----------------. + | ESC/Ctl| Hyper | | RAlt | RCtl | + ,--------+--------+--------| |--------+--------+--------. + | Space | Enter | App/Alt| | RGUI | Delete | Bspc | + | / | / |--------| |--------| / | / | + | Fn | Number | Bspc | | Enter | Number2| Fn2 | + `--------------------------' `--------------------------' +*/ +[_QWERTY] = LAYOUT_pretty( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, NUMPAD, ADJUST, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + CTLESC, HYPER, KC_RALT, KC_RCTL, + ALTAPP, KC_RGUI, + SPCFN, ENTNS, KC_BSPC, KC_ENT, DELNS, BSPCFN +), + +/* +Numbers/Symbols layer +(Multiple characters: single-tap for first, double-tap for second) +,--------------------------------------------------------------. ,--------------------------------------------------------------. +| | | | | | | | | | | | | | | | | | | | +`--------------------------------------------------------------' `--------------------------------------------------------------' +,------------------------------------------------------. ,------------------------------------------------------. +| F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | 6 | 7 | 8 | 9 | 0 | | ^ | & | * | ( | ) | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | 1 | 2 | 3 | 4 | 5 | | ! | @ | # | $ | % | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | +`---------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+---------' + | ( | ) | [ { | ] } | | | | | | + `-----------------------------------' `-----------------------------------' + ,-----------------. ,-----------------. + | | | | | | + ,--------+--------+--------| |--------+--------+--------. + | | | | | | | | + | | |--------| |--------| | | + | | | | | | | | + `--------------------------' `--------------------------' +*/ +[_NUMBERS] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD_SLAS, TD_MNUN, TD_PLEQ, TD_GVTL, TD_LBCB, TD_RBCB, _______, _______, _______, + KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ +), + +[_NUMBERS2] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD_SLAS, TD_MNUN, TD_PLEQ, TD_GVTL, TD_LBCB, TD_RBCB, _______, _______, _______, + KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ +), + +/* +Function layer +,--------------------------------------------------------------. ,--------------------------------------------------------------. +| | | | | | | | | | | | | | | | | | | | +`--------------------------------------------------------------' `--------------------------------------------------------------' +,------------------------------------------------------. ,------------------------------------------------------. +| F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | | | Up | | | | | | Up | Ctrl+Y | | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | Ctrl+A | Left | Down | Right | C+A+Tab| | PgUp | Left | Down | Right | Home | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | Ctrl+Z | Ctrl+X | Ctrl+C | Ctrl+V | Bspc | | PgDn | Mute | Vol- | Vol+ | End | | +`---------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+---------' + | | | | | | Prev | Play | Next | Stop | + `-----------------------------------' `-----------------------------------' + ,-----------------. ,-----------------. + | | | | | | + ,--------+--------+--------| |--------+--------+--------. + | | | | | | | | + | | |--------| |--------| | | + | | | | | | | | + `--------------------------' `--------------------------' +*/ +[_FUNCTION] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, CTL_Y, _______, _______, + _______, CTL_A, KC_LEFT, KC_DOWN, KC_RGHT, CA_TAB, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, CTL_Z, CTL_X, CTL_C, CTL_V, KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ +), + +[_FUNCTION2] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, CTL_Y, _______, _______, + _______, CTL_A, KC_LEFT, KC_DOWN, KC_RGHT, CA_TAB, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, CTL_Z, CTL_X, CTL_C, CTL_V, KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ +), + +/* +Numpad layer +(Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout) +,--------------------------------------------------------------. ,--------------------------------------------------------------. +| | | | | | | | | | | | | | | | | | | | +`--------------------------------------------------------------' `--------------------------------------------------------------' +,------------------------------------------------------. ,------------------------------------------------------. +| | NumLock| | | | | | Tab | NumLock| KP / | KP * | KP - | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | | KP 7 | KP 8 | KP 9 | KP + | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | | KP 4 | KP 5 | KP 6 | = | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | | KP . | KP/KP* | KP- _ | KP+ = | | | KP 1 | KP 2 | KP 3 | KP Ent | | +`---------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+---------' + | ( | ) | [ { | ] } | | | KP 0 | KP . | KP Ent | + `-----------------------------------' `-----------------------------------' + ,-----------------. ,-----------------. + | | | | | | + ,--------+--------+--------| |--------+--------+--------. + | | | | | | | | + | | |--------| |--------| | | + | | | | | | | | + `--------------------------' `--------------------------' +*/ +[_NUMPAD] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_NLCK, _______, _______, _______, _______, KC_TAB, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, + _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, + _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, _______, KC_P4, KC_P5, KC_P6, KC_EQL, _______, + _______, _______, KC_PDOT, TD_PSPA, TD_MNUN, TD_PPEQ, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, + KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, KC_P0, KC_PDOT, KC_PENT, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ +), + +/* +Gaming +(Toggle gaming layer with limited dual-role keys and layer access; NKRO turned on by default; Ent/NS + Delete/Numbers2 to access Adjust layer) +,--------------------------------------------------------------. ,--------------------------------------------------------------. +| | | | | | | | | | | | | | | | | | | | +`--------------------------------------------------------------' `--------------------------------------------------------------' +,------------------------------------------------------. ,------------------------------------------------------. +| | | | | | | | | | | | | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | | | | | | | | | | | | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| LCtrl | | | | | | | | | | | | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| Shift | | | | | | | | | | | | Shift | +`---------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+---------' + | | | | | | | | | | + `-----------------------------------' `-----------------------------------' + ,-----------------. ,-----------------. + | ESC |xxxxxxxx| | RAlt | RCtl | + ,--------+--------+--------| |--------+--------+--------. + | | | LAlt | | RGUI | Delete | Bspc | + | Space | Enter |--------| |--------| / | / | + | | | Bspc | |Enter/NS| Number2| Fn2 | + `--------------------------' `--------------------------' +*/ +[_GAMING] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, + _______, _______, _______, _______, _______, _______, _______, _______, + KC_ESC, XXXXXXX, _______, _______, + KC_LALT, _______, + KC_SPC, KC_ENT, _______, ENTNS, _______, _______ +), + +/* +Adjust layer +(Press and hold Adjust key on the function row or Enter/Number + Delete/Number2 to access; Numpad and NKRO are on toggle) +,--------------------------------------------------------------. ,--------------------------------------------------------------. +| | | | | | | | | | | | | | | | | | | | +`--------------------------------------------------------------' `--------------------------------------------------------------' +,------------------------------------------------------. ,------------------------------------------------------. +| | Colemak| QWERTY | | Gaming | | | Numpad | | | | | RESET | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | | | | | | | | | | | | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | | | | | | | | NKRO | | | | | +|---------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+---------| +| | | | | | | | | | | | | | +`---------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+---------' + | | | | | | | | | | + `-----------------------------------' `-----------------------------------' + ,-----------------. ,-----------------. + | | | | | | + ,--------+--------+--------| |--------+--------+--------. + | | | | | | | | + | | |--------| |--------| | | + | | | | | | | | + `--------------------------' `--------------------------' +*/ +[_ADJUST] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, COLEMAK, QWERTY, _______, GAMING, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ +), + +[_ADJUST2] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, COLEMAK, QWERTY, _______, GAMING, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { +// persistent_default_layer_set(1UL << _COLEMAK); + default_layer_set(1UL << _COLEMAK); + layer_move (_COLEMAK); + keymap_config.nkro = 0; + } + return false; + break; + case QWERTY: + if (record->event.pressed) { +// persistent_default_layer_set(1UL << _QWERTY); + default_layer_set(1UL << _QWERTY); + layer_move (_QWERTY); + keymap_config.nkro = 0; + } + return false; + break; + case GAMING: + if (record->event.pressed) { + layer_invert (_GAMING); + layer_off (_NUMPAD); + keymap_config.nkro = 1; + } + return false; + break; + } + return true; +} diff --git a/keyboards/kinesis/keymaps/tuesdayjohn/readme.md b/keyboards/kinesis/keymaps/tuesdayjohn/readme.md new file mode 100644 index 00000000000..88af87e88bd --- /dev/null +++ b/keyboards/kinesis/keymaps/tuesdayjohn/readme.md @@ -0,0 +1,219 @@ +# TuesdayJohn's Kinesis Keymap + +These layouts are derived from what I was using on my Kinesis Contoured keyboards with Hasu's USB-USB TMK converters. With the move to QMK via Stapelberg replacement controller, I've cleaned up the layouts a bit while adding more functions and layers. + +There are minor changes in the base keywell layout of non-alpha keys (e.g., CapsLock is ESC/Ctl, arrow clusters on one side), while the thumb clusters deviate more from the default layout. + +Changes to the thumb clusters include: +* The navigations keys moved to function layers. +* The function of 2u keys have been reversed - I've always used space with my left thumb, and I find it more helpful to have quick and easy access to Space and Enter while using my mouse/trackball. +* Backspace have been duplicated on both clusters. As with Space and Backspace, I find it helpful to have quick and easy access to Backspace while using my mouse/trackball. +* The 2u keys serve dual function as momentary layer switchers. + +I've largely left the function keys untouched, with the intension of not using them often. They are neither easy to use nor reach due to their locations and size, and Kinesis used not-so-great rubber dome switches for them (Advantage model and earlier). Kinesis have since replaced the keys with Cherry ML switches on Advantage2, but did not resolve the issues of size or location. Additionally, leaving the function keys unused here makes it easier for me to adapt the keymaps to my other keyboards, most of which do not have physical function keys. + +I use Colemak as my default layout. I've included QWERTY here as well. + +Additionally, there is a gaming layer on toggle. This layer is turned top of either Colemak or QWERTY and have limited access to the Function or Numbers/Symbols layers. Additionally, NKRO is turned on when the layer is turned on. + +Persistent default layer has been enabled for Colemak and QWERTY. The gaming/vanilla Colemak and QWERTY can be set as default layer, but will not be persistent. + +## Future plans + +* Add status LEDs to the Stapelberg PCB (usually used for Caps Lock, Num Lock, and Scroll Lock) to use as layer indicators. +* Add a speaker now that QMK supports additional pins for audio use. +* Utilize the leftover spots on the key matrix, as well as unused pins on Teensy++ 2.0 to run macropad and/or foot pedals. + + +## Layers + +### Function Keys on all layers +- 'Numpd' toggles the Numpad layer +- 'Adjst' is a momentary layer key to access the Adjust layer + +``` +,-----------------------------------------------------. ,----------------------------------------------------. +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| +`-----------------------------------------------------' `----------------------------------------------------' +``` + +### Colemak +- Default layer +- Keys separated by "/" tap for first, hold for second +- Uses [Space Cadet Shifts](https://beta.docs.qmk.fm/features/feature_space_cadet) + +``` +,------------------------------------------------. ,------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +|ESC/Ctrl| A | R | S | T | D | | H | N | E | I | O | ' | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +|SC Shift| Z | X | C | V | B | | K | M | , | . | / |SC Shift| +`--------+-------+-------+-------+-------+-------' `-------+-------+-------+-------+-------+--------' + | Ins | ` | [ | ] | | Left | Down | Up | Right | + `-------------------------------' `-------------------------------' + ,---------------. ,---------------. + |ESC/Ctl| Hyper | | RAlt | RCtl | + ,-------+-------+-------| |-------+-------+-------. + | Space | Enter |App/Alt| | RGUI | Delete| Bspc | + | / | / |-------| |-------| / | / | + | Fn | Number| Bspc | | Enter |Number2| Fn2 | + `-----------------------' `-----------------------' +``` + +### QWERTY +- Keys separated by "/" tap for first, hold for second +- Uses [Space Cadet Shifts](https://beta.docs.qmk.fm/features/feature_space_cadet) + +``` +,------------------------------------------------. ,------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +|ESC/Ctrl| A | S | D | F | G | | H | J | K | L | ; | ' | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +|SC Shift| Z | X | C | V | B | | N | M | , | . | / |SC Shift| +`--------+-------+-------+-------+-------+-------' `-------+-------+-------+-------+-------+--------' + | Ins | ` | [ | ] | | Left | Down | Up | Right | + `-------------------------------' `-------------------------------' + ,---------------. ,---------------. + |ESC/Ctl| Hyper | | RAlt | RCtl | + ,-------+-------+-------| |-------+-------+-------. + | Space | Enter |App/Alt| | RGUI | Delete| Bspc | + | / | / |-------| |-------| / | / | + | Fn | Number| Bspc | | Enter |Number2| Fn2 | + `-----------------------' `-----------------------' +``` + +### Numbers & Symbols layer +- Momentary layer +- Multiple characters: Single-tap for first, double-tap for second + +``` +,------------------------------------------------. ,------------------------------------------------. +| F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | 6 | 7 | 8 | 9 | 0 | | ^ | & | * | ( | ) | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | 1 | 2 | 3 | 4 | 5 | | ! | @ | # | $ | % | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | +`--------+-------+-------+-------+-------+-------' `-------+-------+-------+-------+-------+--------' + | ( | ) | [ { | ] } | | | | | | + `-------------------------------' `-------------------------------' + ,---------------. ,---------------. + | | | | | | + ,-------+-------+-------| |-------+-------+-------. + | | | | | | | | + | | |-------| |-------| | | + | | | | | | | | + `-----------------------' `-----------------------' +``` + +### Function layer +- Momentary layer + +``` +,------------------------------------------------. ,------------------------------------------------. +| F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | | | Up | | | | | | Up | Ctrl+Y| | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | Ctrl+A| Left | Down | Right | C+A+Tb| | PgUp | Left | Down | Right | Home | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | Ctrl+Z| Ctrl+X| Ctrl+C| Ctrl+V| Bspc | | PgDn | Mute | Vol- | Vol+ | End | | +`--------+-------+-------+-------+-------+-------' `-------+-------+-------+-------+-------+--------' + | | | | | | Prev | Play | Next | Stop | + `-------------------------------' `-------------------------------' + ,---------------. ,---------------. + | | | | | | + ,-------+-------+-------| |-------+-------+-------. + | | | | | | | | + | | |-------| |-------| | | + | | | | | | | | + `-----------------------' `-----------------------' +``` + +### Numpad layer +- Toggle layer +- Left side duplicates layout from the Numbers layer, just with numpad output +- Right side layout close to PC numpad layout +- Multiple characters: Single-tap for first, double-tap for second + +``` +,------------------------------------------------. ,------------------------------------------------. +| | NumLk | | | | | | Tab | NumLk | KP / | KP * | KP - | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | | KP 7 | KP 8 | KP 9 | KP + | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | | KP 4 | KP 5 | KP 6 | = | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | | KP . | KP/KP*| KP- _ | KP+ = | | | KP 1 | KP 2 | KP 3 | KP Ent| | +`--------+-------+-------+-------+-------+-------' `-------+-------+-------+-------+-------+--------' + | ( | ) | [ { | ] } | | KP 0 | , | KP . | KP Ent| + `-------------------------------' `-------------------------------' + ,---------------. ,---------------. + | | | | | | + ,-------+-------+-------| |-------+-------+-------. + | | | | | | | | + | | |-------| |-------| | | + | | | | | | | | + `-----------------------' `-----------------------' +``` + +### Gaming +- Toggle layer with limited access to Function or Numbers layers +- Mainly used for gaming +- NKRO turned on by default +- Press and hold Ent/NS + Delete/Numbers2 to access Adjust layer + +``` +,------------------------------------------------. ,------------------------------------------------. +| | | | | | | | | | | | | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | | | | | | | | | | | | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| LCtrl | | | | | | | | | | | | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| Shift | | | | | | | | | | | | Shift | +`--------+-------+-------+-------+-------+-------' `-------+-------+-------+-------+-------+--------' + | | | | | | | | | | + `-------------------------------' `-------------------------------' + ,---------------. ,---------------. + | ESC |xxxxxxx| | RAlt | RCtl | + ,-------+-------+-------| |-------+-------+-------. + | | | LAlt | | RGUI | Delete| Bspc | + | Space | Enter |-------| |-------| / | / | + | | | Bspc | | Ent/NS|Number2| Fn2 | + `-----------------------' `-----------------------' +``` + +### Adjust layer +- Momentary layer +- Press and hold Adjust key on the function row or Enter/Number + Delete/Number2 to access +- Gaming, Numpad, and NKRO are on toggle + +``` +,------------------------------------------------. ,------------------------------------------------. +| |Colemak| QWERTY| | Gaming| | | Numpad| | | | | RESET | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | | | | | | | | | | | | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | | | | | | | | NKRO | | | | | +|--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+--------| +| | | | | | | | | | | | | | +`--------+-------+-------+-------+-------+-------' `-------+-------+-------+-------+-------+--------' + | | | | | | | | | | + `-------------------------------' `-------------------------------' + ,---------------. ,---------------. + | | | | | | + ,-------+-------+-------| |-------+-------+-------. + | | | | | | | | + | | |-------| |-------| | | + | | | | | | | | + `-----------------------' `-----------------------' + ``` + diff --git a/keyboards/kinesis/keymaps/tuesdayjohn/rules.mk b/keyboards/kinesis/keymaps/tuesdayjohn/rules.mk new file mode 100644 index 00000000000..cf63c44f4f0 --- /dev/null +++ b/keyboards/kinesis/keymaps/tuesdayjohn/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Enable Tap Dancing function diff --git a/keyboards/kinesis/keymaps/tw1t611/config.h b/keyboards/kinesis/keymaps/tw1t611/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/kinesis/keymaps/tw1t611/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/kinesis/keymaps/tw1t611/keymap.c b/keyboards/kinesis/keymaps/tw1t611/keymap.c new file mode 100644 index 00000000000..afeaf771148 --- /dev/null +++ b/keyboards/kinesis/keymaps/tw1t611/keymap.c @@ -0,0 +1,64 @@ +#include QMK_KEYBOARD_H +#include "keymap_german.h" + +#define QWERTZ 0 +#define MOD 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[QWERTZ] = LAYOUT( + _______,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8, + _______,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , + KC_ESC ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T , + KC_TAB ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G , + DE_PIPE,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , + _______,_______,_______,_______, + KC_RCTL,KC_LALT, + KC_HOME, + KC_SPC ,KC_LSFT,KC_BSPC , + KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR,KC_SLCK,KC_PAUS,KC_FN0 ,RESET, + KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,DE_SS , + KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,DE_AE , + KC_H ,KC_J ,KC_K ,KC_L ,DE_SLSH,DE_OE , + KC_N ,KC_M ,DE_COMM,DE_DOT ,DE_MINS,DE_UE , + _______,_______,_______,_______, + KC_LGUI,KC_LCTL, + KC_END , + KC_DEL,MO(MOD),KC_ENTER + ), +[MOD] = LAYOUT( + _______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______,_______, + DE_CIRC,DE_QUOT,DE_DQOT,DE_LCBR,DE_RCBR,DE_GRV , + DE_TILD,DE_EXLM,DE_DLR ,DE_LPRN,DE_RPRN,DE_AMPR, + DE_BSLS,DE_HASH,DE_LESS,DE_LBRC,DE_RBRC,DE_MORE, + _______,_______,_______,_______, + _______,_______, + _______, + _______,_______,_______, + _______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______,_______, + KC_HOME,KC_PGDN,KC_PGUP,KC_END ,DE_EQL ,DE_PERC, + KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,DE_QST ,DE_ASTR, + DE_AT ,DE_EURO,DE_SCLN,DE_COLN,DE_UNDS,DE_PLUS, + _______,_______,_______,_______, + _______,_______, + _______, + _______,_______ ,_______ + ) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kinesis/keymaps/tw1t611/readme.md b/keyboards/kinesis/keymaps/tw1t611/readme.md new file mode 100644 index 00000000000..41b0caa7e2e --- /dev/null +++ b/keyboards/kinesis/keymaps/tw1t611/readme.md @@ -0,0 +1 @@ +This is a german keymap for the Kinesis Advantage. diff --git a/keyboards/kinesis/keymaps/tw1t611/rules.mk b/keyboards/kinesis/keymaps/tw1t611/rules.mk new file mode 100644 index 00000000000..7a331cd530c --- /dev/null +++ b/keyboards/kinesis/keymaps/tw1t611/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/kinesis/keymaps/xyverz/keymap.c b/keyboards/kinesis/keymaps/xyverz/keymap.c index 2eab62a2bcc..842645d9050 100644 --- a/keyboards/kinesis/keymaps/xyverz/keymap.c +++ b/keyboards/kinesis/keymaps/xyverz/keymap.c @@ -16,10 +16,6 @@ enum custom_keycodes { KEYPAD }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Aliases to make the keymap more uniform #define GUI_END GUI_T(KC_END) #define MED_DEL LT(_MEDIA, KC_DEL) @@ -270,11 +266,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/keyboards/kinesis/keymaps/xyverz/rules.mk b/keyboards/kinesis/keymaps/xyverz/rules.mk index 94dc4cdfeae..f21a27feaca 100644 --- a/keyboards/kinesis/keymaps/xyverz/rules.mk +++ b/keyboards/kinesis/keymaps/xyverz/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kinesis/rules.mk b/keyboards/kinesis/rules.mk index c8646449bd0..b3a6b84d637 100644 --- a/keyboards/kinesis/rules.mk +++ b/keyboards/kinesis/rules.mk @@ -5,7 +5,6 @@ SRC= matrix.c # MCU name MCU = at90usb1286 -#MCU = atmega32u4 # Processor frequency. # This will define a symbol, F_CPU, in all source code files equal to the @@ -72,4 +71,4 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming CUSTOM_MATRIX=yes # need to do our own thing with the matrix -DEFAULT_FOLDER = kinesis/alvicstep \ No newline at end of file +DEFAULT_FOLDER = kinesis/alvicstep diff --git a/keyboards/kinesis/stapelberg/config.h b/keyboards/kinesis/stapelberg/config.h index 0677e0adebf..992480195fd 100644 --- a/keyboards/kinesis/stapelberg/config.h +++ b/keyboards/kinesis/stapelberg/config.h @@ -30,7 +30,7 @@ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* don't know if this should be defined at the board or top level. Assuming board #define MOUSEKEY_DELAY 100 @@ -41,10 +41,4 @@ #define IGNORE_MOD_TAP_INTERRUPT -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - #endif diff --git a/keyboards/kira75/config.h b/keyboards/kira75/config.h index e75ac342c43..15be87d26b5 100644 --- a/keyboards/kira75/config.h +++ b/keyboards/kira75/config.h @@ -46,7 +46,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F6, F7, C7, C6, B6, B5, B4, F5, F4, F1, F0, E6, B3, B2, B1, B0 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 @@ -60,9 +60,8 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -112,11 +111,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/kira75/keymaps/default/config.h b/keyboards/kira75/keymaps/default/config.h index 2c852d18199..a3ed4f762a6 100644 --- a/keyboards/kira75/keymaps/default/config.h +++ b/keyboards/kira75/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/kira75/keymaps/default/keymap.c b/keyboards/kira75/keymaps/default/keymap.c index cba4ca9927f..74fa1ed8449 100644 --- a/keyboards/kira75/keymaps/default/keymap.c +++ b/keyboards/kira75/keymaps/default/keymap.c @@ -26,26 +26,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/kira75/readme.md b/keyboards/kira75/readme.md index f2c0f3228b4..5ab0b3f2cc9 100644 --- a/keyboards/kira75/readme.md +++ b/keyboards/kira75/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make kira75:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/kira75/rules.mk b/keyboards/kira75/rules.mk index 45eb6ee3766..21822109225 100644 --- a/keyboards/kira75/rules.mk +++ b/keyboards/kira75/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -52,7 +51,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration @@ -60,7 +59,8 @@ COMMAND_ENABLE = yes # Commands for debug and configuration SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/kmac/config.h b/keyboards/kmac/config.h index 5c164bfc179..652263d2b76 100644 --- a/keyboards/kmac/config.h +++ b/keyboards/kmac/config.h @@ -15,17 +15,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 -#define MANUFACTURER KBDMania -#define PRODUCT KMAC +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER KBDMania +#define PRODUCT KMAC #define DESCRIPTION QMK keyboard firmware for KMAC /* key matrix size */ @@ -36,13 +35,15 @@ along with this program. If not, see . * Keyboard Matrix Assignments * The KMAC uses demultiplexers for the cols, they are only included here as documentation. * See matrix.c for more details. -*/ -#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5, B7 } -#define MATRIX_COL_PINS { C6, B6, F0, F1, C7, B5 } + */ +#define MATRIX_ROW_PINS \ + { D0, D1, D2, D3, D5, B7 } +#define MATRIX_COL_PINS \ + { B6, C6, C7, F1, F0, B5 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION CUSTOM_MATRIX +/* COL2ROW, ROW2COL*/ +//#define DIODE_DIRECTION /* number of backlight levels */ #define BACKLIGHT_LEVELS 3 @@ -50,7 +51,7 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -93,11 +94,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -174,5 +170,3 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/kmac/info.json b/keyboards/kmac/info.json index f86cfdde59d..2fe0ef2697a 100644 --- a/keyboards/kmac/info.json +++ b/keyboards/kmac/info.json @@ -6,7 +6,8 @@ "width": 18.25, "height": 6.5, "layouts": { - "LAYOUT": { + "LAYOUT_tkl_ansi": { + "key_count": 87, "layout": [ { "label": "Esc", "x": 0, "y": 0 }, { "label": "F1", "x": 2, "y": 0 }, @@ -97,8 +98,8 @@ { "label": "\u2192", "x": 17.25, "y": 5.5 } ] }, - - "LAYOUT_WKL": { + "LAYOUT_tkl_ansi_wkl": { + "key_count": 84, "layout": [ { "label": "Esc", "x": 0, "y": 0 }, { "label": "F1", "x": 2, "y": 0 }, @@ -177,11 +178,9 @@ { "label": "Shift", "x": 12.25, "y": 4.5, "w": 2.75 }, { "label": "\u2191", "x": 16.25, "y": 4.5 }, { "label": "Ctrl", "x": 0, "y": 5.5, "w": 1.5 }, - { "label": "Win", "x": 1.5, "y": 5.5 }, { "label": "Alt", "x": 2.5, "y": 5.5, "w": 1.5 }, { "x": 4, "y": 5.5, "w": 7 }, { "label": "Alt", "x": 11, "y": 5.5, "w": 1.5 }, - { "label": "Win", "x": 12.5, "y": 5.5 }, { "label": "Ctrl", "x": 13.5, "y": 5.5, "w": 1.5 }, { "label": "\u2190", "x": 15.25, "y": 5.5 }, { "label": "\u2193", "x": 16.25, "y": 5.5 }, diff --git a/keyboards/kmac/keymaps/default/config.h b/keyboards/kmac/keymaps/default/config.h index a3828f7d5d6..14b43132a72 100644 --- a/keyboards/kmac/keymaps/default/config.h +++ b/keyboards/kmac/keymaps/default/config.h @@ -1,4 +1,4 @@ -/* Copyright 2017 Mathias Andersson +/* Copyright 2019 Mathias Andersson * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/kmac/keymaps/default/keymap.c b/keyboards/kmac/keymaps/default/keymap.c index 8ae8627a06f..05ccd1bcb1f 100644 --- a/keyboards/kmac/keymaps/default/keymap.c +++ b/keyboards/kmac/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2017 Mathias Andersson +/* Copyright 2017-2019 Mathias Andersson * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,86 +15,73 @@ */ #include QMK_KEYBOARD_H -// Helpful defines -#define _______ KC_TRNS +enum layer_names { + _QW, + _FN, +}; -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BL 0 -#define _FL 1 +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MCR_01 = SAFE_RANGE, + MCR_02, + MCR_03, + MCR_04, + MCR_05, + MCR_06, + MCR_07, + MCR_08, + MCR_09, + MCR_10, + MCR_11, +}; +// clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BL] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [_FL] = LAYOUT( - BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, + [_QW] = LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + [_FN] = LAYOUT_tkl_ansi( + BL_STEP, MCR_01, MCR_02, MCR_03, MCR_03, MCR_04, MCR_05, MCR_06, MCR_07, MCR_08, MCR_09, MCR_10, MCR_11, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), -}; - -const uint16_t PROGMEM fn_actions[] = { - + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), }; +// clang-format on -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) - { - case 0: - if (record->event.pressed) - { - SEND_STRING("The"); - return false; - } - break; - case 1: - if (record->event.pressed) - { - SEND_STRING("Custom"); - return false; - } - break; - case 2: - if (record->event.pressed) - { - SEND_STRING("Keyboard"); - return false; - } - break; - case 3: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END); - } - break; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MCR_01: + if (record->event.pressed) { + SEND_STRING("The"); + } + break; + case MCR_02: + if (record->event.pressed) { + SEND_STRING("Custom"); + } + break; + case MCR_03: + if (record->event.pressed) { + SEND_STRING("Keyboard"); + } + break; + case MCR_04: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("c") SS_TAP(X_RIGHT) SS_LCTRL("v")); + } + break; } - return MACRO_NONE; + return true; }; -void matrix_init_user(void) -{ -} +void matrix_init_user(void) {} -void matrix_scan_user(void) -{ -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - return true; -} +void matrix_scan_user(void) {} -void led_set_user(uint8_t usb_led) -{ -} +void led_set_user(uint8_t usb_led) {} diff --git a/keyboards/kmac/keymaps/default/readme.md b/keyboards/kmac/keymaps/default/readme.md index aaa6f9bf255..a6084037530 100644 --- a/keyboards/kmac/keymaps/default/readme.md +++ b/keyboards/kmac/keymaps/default/readme.md @@ -2,8 +2,6 @@ This is the default keymap for the winkey version of the PCB. It implements the same features as the official default KMAC firmware. -See [keymap.c](keymap.c) for details. - ## Layers The keymap have two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key. @@ -50,7 +48,3 @@ These are mostly useless and serve more like examples I guess. | 2 | Types `Custom` | | 3 | Types `Keyboard` | | 4 | Inputs `` `` `` | - -## Building - -To build the firmware with the default keymap, run `make default`. diff --git a/keyboards/kmac/keymaps/default/rules.mk b/keyboards/kmac/keymaps/default/rules.mk deleted file mode 100644 index 8e2d011b342..00000000000 --- a/keyboards/kmac/keymaps/default/rules.mk +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2013 Jun Wako -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# QMK Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kmac/keymaps/default_tkl_ansi/config.h b/keyboards/kmac/keymaps/default_tkl_ansi/config.h new file mode 100644 index 00000000000..14b43132a72 --- /dev/null +++ b/keyboards/kmac/keymaps/default_tkl_ansi/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kmac/keymaps/default_tkl_ansi/keymap.c b/keyboards/kmac/keymaps/default_tkl_ansi/keymap.c new file mode 100644 index 00000000000..05ccd1bcb1f --- /dev/null +++ b/keyboards/kmac/keymaps/default_tkl_ansi/keymap.c @@ -0,0 +1,87 @@ +/* Copyright 2017-2019 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layer_names { + _QW, + _FN, +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MCR_01 = SAFE_RANGE, + MCR_02, + MCR_03, + MCR_04, + MCR_05, + MCR_06, + MCR_07, + MCR_08, + MCR_09, + MCR_10, + MCR_11, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + [_FN] = LAYOUT_tkl_ansi( + BL_STEP, MCR_01, MCR_02, MCR_03, MCR_03, MCR_04, MCR_05, MCR_06, MCR_07, MCR_08, MCR_09, MCR_10, MCR_11, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; +// clang-format on + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MCR_01: + if (record->event.pressed) { + SEND_STRING("The"); + } + break; + case MCR_02: + if (record->event.pressed) { + SEND_STRING("Custom"); + } + break; + case MCR_03: + if (record->event.pressed) { + SEND_STRING("Keyboard"); + } + break; + case MCR_04: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("c") SS_TAP(X_RIGHT) SS_LCTRL("v")); + } + break; + } + return true; +}; + +void matrix_init_user(void) {} + +void matrix_scan_user(void) {} + +void led_set_user(uint8_t usb_led) {} diff --git a/keyboards/kmac/keymaps/default_tkl_ansi/readme.md b/keyboards/kmac/keymaps/default_tkl_ansi/readme.md new file mode 100644 index 00000000000..a6084037530 --- /dev/null +++ b/keyboards/kmac/keymaps/default_tkl_ansi/readme.md @@ -0,0 +1,50 @@ +# Keymap for the winkey version of KMAC + +This is the default keymap for the winkey version of the PCB. It implements the same features as the official default KMAC firmware. + +## Layers + +The keymap have two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key. + +### Layer 1: Default Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + |-----------------------------------------------------------| |-----------| + |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + |-----------------------------------------------------------| '-----------' + |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | + |-----------------------------------------------------------| ,---. + |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + |-----------------------------------------------------------| ,-----------. + |Ctl|Gui|Alt| Space |Alt|Gui|Fn |Ctl| |Lef|Dow|Rig| + `-----------------------------------------------------------' `-----------' + +### Layer 2: Function Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + |Led| |M1 |M2 |M3 |M4 | |M5 |M6 |M7 |M8 | |M9 |M10|M11|M12| | | | | + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| |-----------| + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| '-----------' + | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,---. + | | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,-----------. + | | | | | | | | | | | | | + `-----------------------------------------------------------' `-----------' + +## Macros + +These are mostly useless and serve more like examples I guess. + +| Macro | Action | +|:-----:| -------------------------------------- | +| 1 | Types `The` | +| 2 | Types `Custom` | +| 3 | Types `Keyboard` | +| 4 | Inputs `` `` `` | diff --git a/keyboards/kmac/keymaps/default_tkl_ansi_wkl/config.h b/keyboards/kmac/keymaps/default_tkl_ansi_wkl/config.h new file mode 100644 index 00000000000..14b43132a72 --- /dev/null +++ b/keyboards/kmac/keymaps/default_tkl_ansi_wkl/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/kmac/keymaps/default_tkl_ansi_wkl/keymap.c b/keyboards/kmac/keymaps/default_tkl_ansi_wkl/keymap.c new file mode 100644 index 00000000000..42be547649c --- /dev/null +++ b/keyboards/kmac/keymaps/default_tkl_ansi_wkl/keymap.c @@ -0,0 +1,87 @@ +/* Copyright 2017-2019 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layer_names { + _QW, + _FN, +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MCR_01 = SAFE_RANGE, + MCR_02, + MCR_03, + MCR_04, + MCR_05, + MCR_06, + MCR_07, + MCR_08, + MCR_09, + MCR_10, + MCR_11, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_tkl_ansi_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + [_FN] = LAYOUT_tkl_ansi_wkl( + BL_STEP, MCR_01, MCR_02, MCR_03, MCR_03, MCR_04, MCR_05, MCR_06, MCR_07, MCR_08, MCR_09, MCR_10, MCR_11, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______), +}; +// clang-format on + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MCR_01: + if (record->event.pressed) { + SEND_STRING("The"); + } + break; + case MCR_02: + if (record->event.pressed) { + SEND_STRING("Custom"); + } + break; + case MCR_03: + if (record->event.pressed) { + SEND_STRING("Keyboard"); + } + break; + case MCR_04: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("c") SS_TAP(X_RIGHT) SS_LCTRL("v")); + } + break; + } + return true; +}; + +void matrix_init_user(void) {} + +void matrix_scan_user(void) {} + +void led_set_user(uint8_t usb_led) {} diff --git a/keyboards/kmac/keymaps/default_tkl_ansi_wkl/readme.md b/keyboards/kmac/keymaps/default_tkl_ansi_wkl/readme.md new file mode 100644 index 00000000000..a66ed10902b --- /dev/null +++ b/keyboards/kmac/keymaps/default_tkl_ansi_wkl/readme.md @@ -0,0 +1,50 @@ +# Keymap for the winkeyless version of KMAC + +This is the default keymap for the winkeyless version of the PCB. It implements the same features as the official default KMAC firmware. + +## Layers + +The keymap have two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key. + +### Layer 1: Default Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + |-----------------------------------------------------------| |-----------| + |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + |-----------------------------------------------------------| '-----------' + |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | + |-----------------------------------------------------------| ,---. + |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + |-----------------------------------------------------------| ,-----------. + |Ctl | |Alt | Space |Fn | |Ctl | |Lef|Dow|Rig| + `----' `-----------------------------------------' `----' `-----------' + +### Layer 2: Function Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + |Led| |M1 |M2 |M3 |M4 | |M5 |M6 |M7 |M8 | |M9 |M10|M11|M12| | | | | + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| |-----------| + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| '-----------' + | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,---. + | | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,-----------. + | | | | | | | | | | | | + `----' `-----------------------------------------' `----' `-----------' + +## Macros + +These are mostly useless and serve more like examples I guess. + +| Macro | Action | +|:-----:| -------------------------------------- | +| 1 | Types `The` | +| 2 | Types `Custom` | +| 3 | Types `Keyboard` | +| 4 | Inputs `` `` `` | diff --git a/keyboards/kmac/keymaps/winkeyless/config.h b/keyboards/kmac/keymaps/winkeyless/config.h deleted file mode 100644 index a3828f7d5d6..00000000000 --- a/keyboards/kmac/keymaps/winkeyless/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2017 Mathias Andersson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/kmac/keymaps/winkeyless/keymap.c b/keyboards/kmac/keymaps/winkeyless/keymap.c deleted file mode 100644 index 985d5a89fb2..00000000000 --- a/keyboards/kmac/keymaps/winkeyless/keymap.c +++ /dev/null @@ -1,100 +0,0 @@ -/* Copyright 2017 Mathias Andersson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -// Helpful defines -#define _______ KC_TRNS - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BL 0 -#define _FL 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BL] = LAYOUT_WKL( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [_FL] = LAYOUT_WKL( - BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) - { - case 0: - if (record->event.pressed) - { - SEND_STRING("The"); - return false; - } - break; - case 1: - if (record->event.pressed) - { - SEND_STRING("Custom"); - return false; - } - break; - case 2: - if (record->event.pressed) - { - SEND_STRING("Keyboard"); - return false; - } - break; - case 3: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END); - } - break; - } - return MACRO_NONE; -}; - -void matrix_init_user(void) -{ -} - -void matrix_scan_user(void) -{ -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - return true; -} - -void led_set_user(uint8_t usb_led) -{ -} diff --git a/keyboards/kmac/keymaps/winkeyless/readme.md b/keyboards/kmac/keymaps/winkeyless/readme.md deleted file mode 100644 index 9c579e9f530..00000000000 --- a/keyboards/kmac/keymaps/winkeyless/readme.md +++ /dev/null @@ -1,57 +0,0 @@ -# Keymap for the winkeyless version of KMAC - -This is the default keymap for the winkeyless version of the PCB. It implements the same features as the official default KMAC firmware. - - -See [keymap.c](keymap.c) for details. - -## Layers - -The keymap have two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key. - -### Layer 1: Default Layer - ,---. ,---------------. ,---------------. ,---------------. ,-----------. - |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| - `---' `---------------' `---------------' `---------------' `-----------' - ,-----------------------------------------------------------. ,-----------. - |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| - |-----------------------------------------------------------| |-----------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| - |-----------------------------------------------------------| '-----------' - |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | - |-----------------------------------------------------------| ,---. - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | - |-----------------------------------------------------------| ,-----------. - |Ctl|Gui|Alt| Space |Alt|Fn |Ctl| |Lef|Dow|Rig| - `-----------------------------------------------------------' `-----------' - -### Layer 2: Function Layer - ,---. ,---------------. ,---------------. ,---------------. ,-----------. - |Led| |M1 |M2 |M3 |M4 | |M5 |M6 |M7 |M8 | |M9 |M10|M11|M12| | | | | - `---' `---------------' `---------------' `---------------' `-----------' - ,-----------------------------------------------------------. ,-----------. - | | | | | | | | | | | | | | | | | | | - |-----------------------------------------------------------| |-----------| - | | | | | | | | | | | | | | | | | | | - |-----------------------------------------------------------| '-----------' - | | | | | | | | | | | | | | - |-----------------------------------------------------------| ,---. - | | | | | | | | | | | | | | | - |-----------------------------------------------------------| ,-----------. - | | | | | | | | | | | | - `-----------------------------------------------------------' `-----------' - -## Macros - -These are mostly useless and serve more like examples I guess. - -| Macro | Action | -|:-----:| -------------------------------------- | -| 1 | Types `The` | -| 2 | Types `Custom` | -| 3 | Types `Keyboard` | -| 4 | Inputs `` `` `` | - -## Building - -To build the firmware with the keymap for the winkeyless version, run `make winkeyless`. diff --git a/keyboards/kmac/keymaps/winkeyless/rules.mk b/keyboards/kmac/keymaps/winkeyless/rules.mk deleted file mode 100644 index 8e2d011b342..00000000000 --- a/keyboards/kmac/keymaps/winkeyless/rules.mk +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2013 Jun Wako -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# QMK Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kmac/kmac.c b/keyboards/kmac/kmac.c index 6b54294b4b1..dcbbc2f1796 100644 --- a/keyboards/kmac/kmac.c +++ b/keyboards/kmac/kmac.c @@ -1,4 +1,4 @@ -/* Copyright 2017 Mathias Andersson +/* Copyright 2017-2019 Mathias Andersson * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,61 +15,68 @@ */ #include "kmac.h" +#define CAPS_PIN B0 +#define SCROLL_PIN E6 +#define F_ROW_MASK 0b01 +#define WASD_MASK 0b10 + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up - led_init_ports(); + setPinOutput(CAPS_PIN); + setPinOutput(SCROLL_PIN); + matrix_init_user(); } +/* + void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) + // put your looping keyboard code here + // runs every cycle (a lot) - matrix_scan_user(); + matrix_scan_user(); } bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware - return process_record_user(keycode, record); + return process_record_user(keycode, record); } -void led_init_ports(void) { - DDRB |= (1<<0); // OUT - DDRE |= (1<<6); // OUT -} +*/ /* LED pin configuration * Scroll Lock: Low PE6 * Caps Lock: Low PB0 */ void led_set_kb(uint8_t usb_led) { - if (usb_led & (1< +/* Copyright 2017-2019 Mathias Andersson * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,41 +13,44 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef KMAC_H -#define KMAC_H +#pragma once #include "quantum.h" -// Keymap for the winkey version of the PCB. -#define LAYOUT( \ - K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4D, K4F, \ - K50, K51, K52, K55, K58, K5A, K5C, K5D, K5E, K5F, K5G) \ - { \ - /* 0 1 2 3 4 5 6 7 8 9 A B C D E F G */ \ - /* 0 */ {K00, KC_NO, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G}, \ - /* 1 */ {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G}, \ - /* 2 */ {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G}, \ - /* 3 */ {K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, KC_NO, KC_NO, KC_NO}, \ - /* 4 */ {K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, KC_NO, KC_NO, K4D, KC_NO, K4F, KC_NO}, \ - /* 5 */ { K50, K51, K52, KC_NO, KC_NO, K55, KC_NO, KC_NO, K58, KC_NO, K5A, KC_NO, K5C, K5D, K5E, K5F, K5G } \ - } +// clang-format off +#define LAYOUT_tkl_ansi( \ + k00, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, k2G, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4D, k4F, \ + k50, k51, k52, k55, k58, k5A, k5C, k5D, k5E, k5F, k5G \ +) \ +{ \ + {k00, KC_NO, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, k2G}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, KC_NO, k3D, KC_NO, KC_NO, KC_NO}, \ + {k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, KC_NO, KC_NO, k4D, KC_NO, k4F, KC_NO}, \ + {k50, k51, k52, KC_NO, KC_NO, k55, KC_NO, KC_NO, k58, KC_NO, k5A, KC_NO, k5C, k5D, k5E, k5F, k5G } \ +} +// clang-format on -// Keymap for the winkeyless version of the PCB. -#define LAYOUT_WKL( \ - K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4D, K4F, \ - K50, K51, K52, K55, K58, K5A, K5D, K5E, K5F, K5G) LAYOUT(K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4D, K4F, \ - K50, K51, K52, K55, K58, K5A, KC_NO, K5D, K5E, K5F, K5G) - -#endif +// clang-format off +#define LAYOUT_tkl_ansi_wkl( \ + k00, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, k2G, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4D, k4F, \ + k50, k52, k55, k58, k5D, k5E, k5F, k5G \ +) \ +{ \ + {k00, KC_NO, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, k2G}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, KC_NO, k3D, KC_NO, KC_NO, KC_NO}, \ + {k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, KC_NO, KC_NO, k4D, KC_NO, k4F, KC_NO}, \ + {k50, KC_NO, k52, KC_NO, KC_NO, k55, KC_NO, KC_NO, k58, KC_NO, KC_NO, KC_NO, KC_NO, k5D, k5E, k5F, k5G } \ +} +// clang-format on diff --git a/keyboards/kmac/matrix.c b/keyboards/kmac/matrix.c index cfafa90e661..2212ee076b4 100644 --- a/keyboards/kmac/matrix.c +++ b/keyboards/kmac/matrix.c @@ -1,5 +1,5 @@ /* -Copyright 2017 Mathias Andersson +Copyright 2017-2019 Mathias Andersson This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,118 +16,137 @@ along with this program. If not, see . */ #include #include -#if defined(__AVR__) -#include -#endif #include "wait.h" #include "print.h" #include "debug.h" #include "util.h" #include "matrix.h" -#include "timer.h" - - -/* Set 0 if debouncing isn't needed */ -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#include "debounce.h" +#include "quantum.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) #endif -#define COL_SHIFTER ((uint32_t)1) - -static uint16_t debouncing_time; -static bool debouncing = false; - - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; /* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; +static matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values +static matrix_row_t matrix[MATRIX_ROWS]; // debounced values -static void init_rows(void); -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); -static void unselect_cols(void); -static void select_col(uint8_t col); +__attribute__((weak)) void matrix_init_quantum(void) { matrix_init_kb(); } -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} +__attribute__((weak)) void matrix_scan_quantum(void) { matrix_scan_kb(); } -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } -void matrix_init(void) { - unselect_cols(); - init_rows(); +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } +__attribute__((weak)) void matrix_init_user(void) {} - matrix_init_quantum(); -} +__attribute__((weak)) void matrix_scan_user(void) {} -uint8_t matrix_scan(void) -{ - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { - bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - } - - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - debouncing = false; - } +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } - matrix_scan_quantum(); - return 1; -} +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1> 4) & _BV(E2 & 0xF)) == 0) - { + if (readPin(E2) == 0) { // Pin LO, set col bit - current_matrix[row_index] |= (COL_SHIFTER << current_col); - } - else - { + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } else { // Pin HI, clear col bit - current_matrix[row_index] &= ~(COL_SHIFTER << current_col); + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); } - } - else { - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF))) - { - // Pin HI, set col bit - current_matrix[row_index] |= (COL_SHIFTER << current_col); - } - else - { - // Pin LO, clear col bit - current_matrix[row_index] &= ~(COL_SHIFTER << current_col); + } else { + if (readPin(row_pins[row_index]) == 0) { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } else { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); } } // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) { matrix_changed = true; } } @@ -181,131 +190,31 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) return matrix_changed; } -/* Row pin configuration - * row: 0 1 2 3 4 5 - * pin: D0 D1 D2 D3 D5 B7 - * - * Caps lock uses its own pin E2 - */ -static void init_rows(void) -{ - DDRD &= ~((1<<0)| (1<<1) | (1<<2) | (1<<3) | (1<<5)); // IN - PORTD &= ~((1<<0)| (1<<1) | (1<<2) | (1<<3) | (1<<5)); // LO - DDRB &= ~(1<<7); // IN - PORTB &= ~(1<<7); // LO - - DDRE &= ~(1<<2); // IN - PORTE |= (1<<2); // HI -} +void matrix_init(void) { + // initialize key pins + init_pins(); -/* Columns 0 - 15 - * These columns uses two 74HC237D 3 to 8 bit demultiplexers. - * col / pin: PC6 PB6 PF0 PF1 PC7 - * 0: 1 0 0 0 0 - * 1: 1 0 1 0 0 - * 2: 1 0 0 1 0 - * 3: 1 0 1 1 0 - * 4: 1 0 0 0 1 - * 5: 1 0 1 0 1 - * 6: 1 0 0 1 1 - * 7: 1 0 1 1 1 - * 8: 0 1 0 0 0 - * 9: 0 1 1 0 0 - * 10: 0 1 0 1 0 - * 11: 0 1 1 1 0 - * 12: 0 1 0 0 1 - * 13: 0 1 1 0 1 - * 14: 0 1 0 1 1 - * 15: 0 1 1 1 1 - * - * col: 16 - * pin: PB5 - */ -static void unselect_cols(void) -{ - DDRB |= (1<<5) | (1<<6); // OUT - PORTB &= ~((1<<5) | (1<<6)); // LO + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + raw_matrix[i] = 0; + matrix[i] = 0; + } - DDRC |= (1<<6) | (1<<7); // OUT - PORTC &= ~((1<<6) | (1<<7)); // LO + debounce_init(MATRIX_ROWS); - DDRF |= (1<<0) | (1<<1); // OUT - PORTF &= ~((1<<0) | (1<<1)); // LO + matrix_init_quantum(); } -static void select_col(uint8_t col) -{ - switch (col) { - case 0: - PORTC |= (1<<6); // HI - break; - case 1: - PORTC |= (1<<6); // HI - PORTF |= (1<<0); // HI - break; - case 2: - PORTC |= (1<<6); // HI - PORTF |= (1<<1); // HI - break; - case 3: - PORTC |= (1<<6); // HI - PORTF |= (1<<0) | (1<<1); // HI - break; - case 4: - PORTC |= (1<<6); // HI - PORTC |= (1<<7); // HI - break; - case 5: - PORTC |= (1<<6); // HI - PORTF |= (1<<0); // HI - PORTC |= (1<<7); // HI - break; - case 6: - PORTC |= (1<<6); // HI - PORTF |= (1<<1); // HI - PORTC |= (1<<7); // HI - break; - case 7: - PORTC |= (1<<6); // HI - PORTF |= (1<<0) | (1<<1); // HI - PORTC |= (1<<7); // HI - break; - case 8: - PORTB |= (1<<6); // HI - break; - case 9: - PORTB |= (1<<6); // HI - PORTF |= (1<<0); // HI - break; - case 10: - PORTB |= (1<<6); // HI - PORTF |= (1<<1); // HI - break; - case 11: - PORTB |= (1<<6); // HI - PORTF |= (1<<0) | (1<<1); // HI - break; - case 12: - PORTB |= (1<<6); // HI - PORTC |= (1<<7); // HI - break; - case 13: - PORTB |= (1<<6); // HI - PORTF |= (1<<0); // HI - PORTC |= (1<<7); // HI - break; - case 14: - PORTB |= (1<<6); // HI - PORTF |= (1<<1); // HI - PORTC |= (1<<7); // HI - break; - case 15: - PORTB |= (1<<6); // HI - PORTF |= (1<<0) | (1<<1); // HI - PORTC |= (1<<7); // HI - break; - case 16: - PORTB |= (1<<5); // HI - break; +uint8_t matrix_scan(void) { + bool changed = false; + + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { + changed |= read_rows_on_col(raw_matrix, current_col); } + + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + + matrix_scan_quantum(); + + return (uint8_t)changed; } diff --git a/keyboards/kmac/readme.md b/keyboards/kmac/readme.md index ec36c0a5c9b..47dbaa847f6 100644 --- a/keyboards/kmac/readme.md +++ b/keyboards/kmac/readme.md @@ -1,44 +1,21 @@ -# KMAC keyboard firmware +# KMAC A Korean custom keyboard designed by Byungho Kim and the KBDMania community. -## Supported models +Keyboard Maintainer: [Mathias Andersson](https://github.com/wraul) +Hardware Supported: KMAC & KMAC 2 +Hardware Availability: http://www.kbdmania.net/xe/news/5232321 -All the tenkeyless models should be supported. +Make example for this keyboard (after setting up your build environment): -## Bootloader - -The PCB is hardwired to run the bootloader if the key at the `Caps Lock` position is held down when connecting the keyboard. + make kmac:default -It is also possible to use Boot Magic and Command to access the bootloader. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). -## Quantum MK Firmware +## Bootloader -For the full Quantum feature list, see the [documentation](https://docs.qmk.fm). +The PCB is hardwired to run the bootloader if the key at the `Caps Lock` position is held down when connecting the keyboard. -## Building +## PCB versions The KMAC are available with two different PCB layouts, a winkey version and a winkeyless version. A default keymap are provided for each versions of the PCB. - -Depending on which PCB and keymap you would like to use, you will have to compile the firmware slightly differently. All of the commands should be run in the [keyboards/kmac](/keyboards/kmac) folder. - -### Winkey keymap - -The [default keymap](keymaps/default) are designed for the winkey version of the PCB. - -### Winkeyless Keymap - -A [keymap](keymaps/winkeyless) for the winkeyless version of the PCB are also provided. - -### Custom keymaps - -To define your own keymap, copy one of the [existing keymap](keymaps) folders and give it the name of your keymap. Then check the [keymap documentation](https://docs.qmk.fm/faq_keymap.html) for details on how to modify the keymap. - -To make it easy to define keymaps for the different versions of the PCB two macros are provided. - -| PCB | Macro | -| -------------- | -------------- | -| Winkey PCB | `LAYOUT()` | -| Winkeyless PCB | `LAYOUT_WKL()` | - -To build the firmware with a custom keymap, run `make ` diff --git a/keyboards/kmac/rules.mk b/keyboards/kmac/rules.mk index 41b16979d69..33e5e43f7a2 100644 --- a/keyboards/kmac/rules.mk +++ b/keyboards/kmac/rules.mk @@ -1,8 +1,7 @@ # Project specific files -SRC = matrix.c +SRC += matrix.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -42,15 +41,19 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu +# Supported layouts +LAYOUTS = tkl_ansi + # Build Options # change yes to no to disable # diff --git a/keyboards/kmini/config.h b/keyboards/kmini/config.h index 567a7544290..b5460c9dea1 100755 --- a/keyboards/kmini/config.h +++ b/keyboards/kmini/config.h @@ -39,8 +39,8 @@ #define MATRIX_COL_PINS { } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION CUSTOM_MATRIX +/* COL2ROW, ROW2COL*/ +//#define DIODE_DIRECTION /* number of backlight levels */ #define BACKLIGHT_LEVELS 3 @@ -48,11 +48,6 @@ // #define BACKLIGHT_BREATHING /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +#define DEBOUNCE 5 #endif diff --git a/keyboards/kmini/matrix.c b/keyboards/kmini/matrix.c index 5f9bfe3d7fa..9888f1a7659 100755 --- a/keyboards/kmini/matrix.c +++ b/keyboards/kmini/matrix.c @@ -27,8 +27,8 @@ /* Set 0 if debouncing isn't needed */ -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif #define COL_SHIFTER ((uint32_t)1) @@ -98,7 +98,7 @@ uint8_t matrix_scan(void) } } - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } @@ -112,7 +112,7 @@ uint8_t matrix_scan(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1. #define MATRIX_COL_PINS { F7, F6, F5, F4, F1, F0 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -105,11 +104,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c b/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c index e35b8ec0805..68c96fc192c 100644 --- a/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c +++ b/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c @@ -1,5 +1,10 @@ #include QMK_KEYBOARD_H +enum custom_keycodes { + M_TGLHF = SAFE_RANGE, + M_TGG +}; + /* * Copy of knopps mini default May 16,2018 * Added comments in code to more easilly understand it. @@ -41,16 +46,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * Layer 1 * _____ _____ _____ * | | | | | | -* ESC Macro3 Macro4 +* ESC Ctl+Z CSf+Z * |_____| |_____| |_____| * _____ _____ _____ * | | | | | | -* Macro5 Macro6 Macro7 +* Ctl+X Ctl+C Ctl+V * |_____| |_____| |_____| * */ LAYOUT( - LT(3, KC_ESC), M(3), M(4), M(5), M(6), M(7)), + LT(3, KC_ESC), C(KC_Z), C(S(KC_Z)), C(KC_X), C(KC_C), C(KC_V)), /* * Layer 2 @@ -65,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * */ LAYOUT( - LT(3, KC_1), KC_2, KC_3, KC_4, M(0), M(1)), + LT(3, KC_1), KC_2, KC_3, KC_4, M_TGLHF, M_TGG), /* * Layer 3 Key Layout @@ -126,91 +131,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -// Older way of Macros found here: https://docs.qmk.fm/features/macros - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - //keyevent_t event = record->event; - - switch (id) { - case 0: - if (record->event.pressed) { - /* - * This is Macro 0 - * Content: tglhf - */ - return MACRO( T(T), T(G), T(L), T(H), T(F), T(ENT), END ); - } - break; - case 1: - if (record->event.pressed) { - /* - * This is Macro 1 - * Content: tgg - */ - return MACRO( T(T), T(G), T(G), T(ENT), END ); - } - break; - case 2: - if (record->event.pressed) { - /* - * This is Macro 2 - * Content: Press and hold "no" , type "l", release "no" - * I haven't found what this "NO" key maps to - */ - return MACRO( D(NO), T(L), U(NO), END ); - } - break; - case 3: - if (record->event.pressed) { - /* - * This is Macro 3 - * Content: press/hold LCTRL, type "2", release LCTRL - */ - return MACRO( D(LCTL), T(Z), U(LCTL), END ); - } - break; - case 4: - if (record->event.pressed) { - /* - * This is Macro 4 - * Content: press/hold LCTRL, type "2", release LCTRL - */ - return MACRO( D(LCTL), D(LSFT), T(Z), U(LSFT), U(LCTL), END ); - } - break; - case 5: - if (record->event.pressed) { - /* - * This is Macro 5 - * Content: press/hold LCTRL, type "x", release LCTRL - */ - return MACRO( D(LCTL), T(X), U(LCTL), END ); - } - break; - case 6: - if (record->event.pressed) { - /* - * This is Macro 6 - * Content: press/hold LCTRL, type "c", release LCTRL - */ - return MACRO( D(LCTL), T(C), U(LCTL), END ); - } - break; - case 7: - if (record->event.pressed) { - /* - * This is Macro 7 - * Content: press/hold LCTRL, type "v", release LCTRL - */ - return MACRO( D(LCTL), T(V), U(LCTL), END ); - } - break; - } - return MACRO_NONE; -} - - - void set_switch_led(int ledId, bool state) { if(state) { switch(ledId) { @@ -480,6 +400,17 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) { led_set_layer(2); } break; + case M_TGLHF: + if (record->event.pressed) { + SEND_STRING("tglhf"); + tap_code(KC_ENT); + } + case M_TGG: + if (record->event.pressed) { + SEND_STRING("tgg"); + tap_code(KC_ENT); + } + return false; } return true; } diff --git a/keyboards/knops/mini/keymaps/default/config.h b/keyboards/knops/mini/keymaps/default/config.h index 999d8876c2b..6775ba671ef 100644 --- a/keyboards/knops/mini/keymaps/default/config.h +++ b/keyboards/knops/mini/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/knops/mini/keymaps/default/keymap.c b/keyboards/knops/mini/keymaps/default/keymap.c index a5a701c88d7..859f07aa075 100644 --- a/keyboards/knops/mini/keymaps/default/keymap.c +++ b/keyboards/knops/mini/keymaps/default/keymap.c @@ -1,15 +1,20 @@ #include QMK_KEYBOARD_H +enum custom_keycodes { + M_TGLHF = SAFE_RANGE, + M_TGG +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( LT(3, KC_MSTP), KC_VOLU, KC_MPLY, KC_MPRV, KC_VOLD, KC_MNXT), LAYOUT( - LT(3, KC_ESC), M(3), M(4), M(5), M(6), M(7)), + LT(3, KC_ESC), C(KC_Z), C(S(KC_Z)), C(KC_X), C(KC_C), C(KC_V)), LAYOUT( - LT(3, KC_1), KC_2, KC_3, KC_4, M(0), M(1)), + LT(3, KC_1), KC_2, KC_3, KC_4, M_TGLHF, M_TGG), LAYOUT( KC_TRNS, KC_TRNS, RESET, TO(0), TO(1), TO(2)), @@ -52,54 +57,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - //keyevent_t event = record->event; - - switch (id) { - case 0: - if (record->event.pressed) { - return MACRO( T(T), T(G), T(L), T(H), T(F), T(ENT), END ); - } - break; - case 1: - if (record->event.pressed) { - return MACRO( T(T), T(G), T(G), T(ENT), END ); - } - break; - case 2: - if (record->event.pressed) { - return MACRO( D(NO), T(L), U(NO), END ); - } - break; - case 3: - if (record->event.pressed) { - return MACRO( D(LCTL), T(Z), U(LCTL), END ); - } - break; - case 4: - if (record->event.pressed) { - return MACRO( D(LCTL), D(LSFT), T(Z), U(LSFT), U(LCTL), END ); - } - break; - case 5: - if (record->event.pressed) { - return MACRO( D(LCTL), T(X), U(LCTL), END ); - } - break; - case 6: - if (record->event.pressed) { - return MACRO( D(LCTL), T(C), U(LCTL), END ); - } - break; - case 7: - if (record->event.pressed) { - return MACRO( D(LCTL), T(V), U(LCTL), END ); - } - break; - } - return MACRO_NONE; -} - void set_switch_led(int ledId, bool state) { if(state) { switch(ledId) { @@ -369,6 +326,18 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) { led_set_layer(2); } break; + case M_TGLHF: + if (record->event.pressed) { + SEND_STRING("tglhf"); + tap_code(KC_ENT); + } + return false; + case M_TGG: + if (record->event.pressed) { + SEND_STRING("tgg"); + tap_code(KC_ENT); + } + return false; } return true; -} \ No newline at end of file +} diff --git a/keyboards/knops/mini/readme.md b/keyboards/knops/mini/readme.md index 86cff4a61f0..4df6c207a4b 100644 --- a/keyboards/knops/mini/readme.md +++ b/keyboards/knops/mini/readme.md @@ -18,4 +18,4 @@ Make example for this keyboard (after setting up your build environment): make knops/mini:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/knops/mini/rules.mk b/keyboards/knops/mini/rules.mk index ca2a2a5f80b..d4ed1d08de6 100644 --- a/keyboards/knops/mini/rules.mk +++ b/keyboards/knops/mini/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/knops/readme.md b/keyboards/knops/readme.md index 563099b6d3e..115e4d7c642 100644 --- a/keyboards/knops/readme.md +++ b/keyboards/knops/readme.md @@ -7,4 +7,4 @@ * Maintainer: [Pawnerd](https://github.com/pawnerd) * Hardware Supported: * [`Mini`](mini/): Knops Mini -* Hardware Availability: [knops.io](https://www.knops.io/) \ No newline at end of file +* Hardware Availability: [knops.io](http://www.knops.io/) \ No newline at end of file diff --git a/keyboards/kona_classic/README.md b/keyboards/kona_classic/README.md index bd818ed92cc..0ea5b00ea39 100644 --- a/keyboards/kona_classic/README.md +++ b/keyboards/kona_classic/README.md @@ -44,4 +44,4 @@ Make example for this keyboard (after setting up your build environment): make kona_classic:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/kona_classic/config.h b/keyboards/kona_classic/config.h index fecf64c041c..affd572b793 100644 --- a/keyboards/kona_classic/config.h +++ b/keyboards/kona_classic/config.h @@ -61,7 +61,7 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -101,11 +101,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/kona_classic/keymaps/ansi/keymap.c b/keyboards/kona_classic/keymaps/ansi/keymap.c index 3d2061e80d6..e6ae4ce4760 100644 --- a/keyboards/kona_classic/keymaps/ansi/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi/keymap.c @@ -15,12 +15,12 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; #define _DEFAULT 0 #define _FN 1 @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_ansi( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/ansi/rules.mk b/keyboards/kona_classic/keymaps/ansi/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/ansi/rules.mk +++ b/keyboards/kona_classic/keymaps/ansi/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kona_classic/keymaps/ansi_arrows/keymap.c b/keyboards/kona_classic/keymaps/ansi_arrows/keymap.c index 6e281f9511f..021cce832d8 100644 --- a/keyboards/kona_classic/keymaps/ansi_arrows/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi_arrows/keymap.c @@ -15,12 +15,12 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; #define _DEFAULT 0 #define _FN 1 @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_ansi_arrows( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FN), \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/ansi_arrows/rules.mk b/keyboards/kona_classic/keymaps/ansi_arrows/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/ansi_arrows/rules.mk +++ b/keyboards/kona_classic/keymaps/ansi_arrows/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kona_classic/keymaps/ansi_arrows_lcap/keymap.c b/keyboards/kona_classic/keymaps/ansi_arrows_lcap/keymap.c index b74a6c3d709..fde23ba94c3 100644 --- a/keyboards/kona_classic/keymaps/ansi_arrows_lcap/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi_arrows_lcap/keymap.c @@ -15,12 +15,12 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; #define _DEFAULT 0 #define _FN 1 @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_ansi_arrows( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_F5, KC_F6, KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FN), \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/ansi_arrows_lcap/rules.mk b/keyboards/kona_classic/keymaps/ansi_arrows_lcap/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/ansi_arrows_lcap/rules.mk +++ b/keyboards/kona_classic/keymaps/ansi_arrows_lcap/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kona_classic/keymaps/ansi_split/keymap.c b/keyboards/kona_classic/keymaps/ansi_split/keymap.c index d60e162f6ba..01e049c7bcb 100644 --- a/keyboards/kona_classic/keymaps/ansi_split/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi_split/keymap.c @@ -15,21 +15,21 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define _DEFAULT 0 #define _FN 1 +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; + //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_ansi_split( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/ansi_split/rules.mk b/keyboards/kona_classic/keymaps/ansi_split/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/ansi_split/rules.mk +++ b/keyboards/kona_classic/keymaps/ansi_split/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kona_classic/keymaps/ansi_split_arrows/keymap.c b/keyboards/kona_classic/keymaps/ansi_split_arrows/keymap.c index 181f2f14cc2..eba565bb44d 100644 --- a/keyboards/kona_classic/keymaps/ansi_split_arrows/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi_split_arrows/keymap.c @@ -15,21 +15,21 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define _DEFAULT 0 #define _FN 1 +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; + //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_ansi_split_arrows( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FN), \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/ansi_split_arrows/rules.mk b/keyboards/kona_classic/keymaps/ansi_split_arrows/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/ansi_split_arrows/rules.mk +++ b/keyboards/kona_classic/keymaps/ansi_split_arrows/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kona_classic/keymaps/default/config.h b/keyboards/kona_classic/keymaps/default/config.h index a3828f7d5d6..09b8f1bc73a 100644 --- a/keyboards/kona_classic/keymaps/default/config.h +++ b/keyboards/kona_classic/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/kona_classic/keymaps/default/keymap.c b/keyboards/kona_classic/keymaps/default/keymap.c index 84a2f9cbd73..a42e9368038 100644 --- a/keyboards/kona_classic/keymaps/default/keymap.c +++ b/keyboards/kona_classic/keymaps/default/keymap.c @@ -15,12 +15,12 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; #define _DEFAULT 0 #define _FN 1 @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_all( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_F5, KC_F6, MO(_FN), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_F7, KC_F8, KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FN), \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/default/rules.mk b/keyboards/kona_classic/keymaps/default/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/default/rules.mk +++ b/keyboards/kona_classic/keymaps/default/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kona_classic/keymaps/iso/keymap.c b/keyboards/kona_classic/keymaps/iso/keymap.c index ff9d3dcb8f5..1486a8b7553 100644 --- a/keyboards/kona_classic/keymaps/iso/keymap.c +++ b/keyboards/kona_classic/keymaps/iso/keymap.c @@ -15,21 +15,21 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define _DEFAULT 0 #define _FN 1 +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; + //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_iso( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, \ KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, \ KC_F7, KC_F8, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/iso/rules.mk b/keyboards/kona_classic/keymaps/iso/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/iso/rules.mk +++ b/keyboards/kona_classic/keymaps/iso/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kona_classic/keymaps/iso_arrows/keymap.c b/keyboards/kona_classic/keymaps/iso_arrows/keymap.c index 79e52360cae..96adc348270 100644 --- a/keyboards/kona_classic/keymaps/iso_arrows/keymap.c +++ b/keyboards/kona_classic/keymaps/iso_arrows/keymap.c @@ -15,21 +15,21 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define _DEFAULT 0 #define _FN 1 +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; + //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_iso_arrows( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, \ KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, \ KC_F7, KC_F8, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FN), \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/iso_arrows/rules.mk b/keyboards/kona_classic/keymaps/iso_arrows/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/iso_arrows/rules.mk +++ b/keyboards/kona_classic/keymaps/iso_arrows/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kona_classic/keymaps/iso_split/keymap.c b/keyboards/kona_classic/keymaps/iso_split/keymap.c index 51d3297736e..278b4cd32db 100644 --- a/keyboards/kona_classic/keymaps/iso_split/keymap.c +++ b/keyboards/kona_classic/keymaps/iso_split/keymap.c @@ -15,21 +15,21 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define _DEFAULT 0 #define _FN 1 +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; + //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_iso_split( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, \ KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, \ KC_F7, KC_F8, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/iso_split/rules.mk b/keyboards/kona_classic/keymaps/iso_split/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/iso_split/rules.mk +++ b/keyboards/kona_classic/keymaps/iso_split/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/kona_classic/keymaps/iso_split_arrows/keymap.c b/keyboards/kona_classic/keymaps/iso_split_arrows/keymap.c index ea81de4bcc2..1e8bc041867 100644 --- a/keyboards/kona_classic/keymaps/iso_split_arrows/keymap.c +++ b/keyboards/kona_classic/keymaps/iso_split_arrows/keymap.c @@ -15,21 +15,21 @@ */ #include QMK_KEYBOARD_H -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define _DEFAULT 0 #define _FN 1 +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; + //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT] = LAYOUT_iso_split_arrows( - KC_F1, KC_F2, F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_F1, KC_F2, SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, \ KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, \ KC_F7, KC_F8, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FN), \ @@ -44,9 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - - void matrix_init_user(void) { } @@ -55,29 +52,15 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } -enum function_id { - ESCAPE, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(ESCAPE), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case ESCAPE: - shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -85,7 +68,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_GUI_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -93,6 +76,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/kona_classic/keymaps/iso_split_arrows/rules.mk b/keyboards/kona_classic/keymaps/iso_split_arrows/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/kona_classic/keymaps/iso_split_arrows/rules.mk +++ b/keyboards/kona_classic/keymaps/iso_split_arrows/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/laplace/config.h b/keyboards/laplace/config.h deleted file mode 100644 index b4a52436894..00000000000 --- a/keyboards/laplace/config.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2018 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCB10 -#define PRODUCT_ID 0x1147 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Laplace -#define DESCRIPTION 40 percent staggered keyboard - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 7 - -/* key matrix pins */ -#define MATRIX_ROW_PINS {D3, F4, D2, F5, D7, B4, C6, E6} -#define MATRIX_COL_PINS {D1, F6, F7, B1, B3, B2, B6} - -/* WS2812 RGB LED */ -#define RGB_DI_PIN D4 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 14 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -#define TAPPING_TERM 200 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#endif diff --git a/keyboards/laplace/keymaps/bakingpy/keymap.c b/keyboards/laplace/keymaps/bakingpy/keymap.c deleted file mode 100644 index 2cad24fa077..00000000000 --- a/keyboards/laplace/keymaps/bakingpy/keymap.c +++ /dev/null @@ -1,63 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 - -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_FN1 MO(_FN1) -#define KC_FN2 MO(_FN2) -#define KC_SPFN1 LT(_FN1, KC_SPACE) -#define KC_SPFN2 LT(_FN2, KC_SPACE) -#define KC_BSFN1 LT(_FN1, KC_BSPC) -#define KC_BSFN2 LT(_FN2, KC_BSPC) -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----+----+----+----. - ESC , Q , W , E , R , T , Y , U , I , O , P ,DEL ,BSPC, - //|----`----`----`----`----`----`----`----`----`----`----`----`----+ - TAB , A , S , D , F , G , H , J , K , L ,QUOT, ENTER , - //|-----`----`----`----`----`----`----`----`----`----`----`--------+ - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , - //|-------`----`----`----`----`----`----`----`----`----`----`------+ - GRV ,LCTL,LALT ,LGUI, SPFN1 , BSFN2 , FN2 ,RALT ,RCTL , FN1 - //`-----+----+-----+----+--------+--------+-----+-----+-----+------' - ), - - [_FN1] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , - //|----`----`----`----`----`----`----`----`----`----`----`----`----+ - RST ,RHUI,RSAI,RVAI,VOLU,LBRC,RBRC, 4 , 5 , 6 ,SCLN, , - //|-----`----`----`----`----`----`----`----`----`----`----`--------+ - RMOD ,RHUD,RSAD,RVAD,VOLD,LCBR,RCBR, 1 , 2 , 3 , UP , , - //|-------`----`----`----`----`----`----`----`----`----`----`------+ - RTOG , , , , , DEL , 0 ,LEFT ,DOWN , RGHT - //`-----+----+-----+----+--------+--------+-----+-----+-----+------' - ), - - [_FN2] = LAYOUT_kc( - //,----+----+----+----+----+----+----+----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC,CIRC,AMPR,ASTR,LPRN,RPRN,UNDS,PLUS, - //|----`----`----`----`----`----`----`----`----`----`----`----`----+ - , , ,INS ,PGUP,HOME, , , , ,COLN, , - //|-----`----`----`----`----`----`----`----`----`----`----`--------+ - , , ,DEL ,PGDN,END , , , , , , , - //|-------`----`----`----`----`----`----`----`----`----`----`------+ - , , , , DEL , , , , , - //`-----+----+-----+----+--------+--------+-----+-----+-----+------' - ) -}; diff --git a/keyboards/laplace/keymaps/bakingpy/rules.mk b/keyboards/laplace/keymaps/bakingpy/rules.mk deleted file mode 100644 index 457a3d01d4a..00000000000 --- a/keyboards/laplace/keymaps/bakingpy/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/laplace/keymaps/default/keymap.c b/keyboards/laplace/keymaps/default/keymap.c deleted file mode 100644 index 03b7c9b15bd..00000000000 --- a/keyboards/laplace/keymaps/default/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -#define FN1 MO(_FN1) -#define FN2 MO(_FN2) -#define SP_FN1 LT(_FN1, KC_SPACE) -#define SP_FN2 LT(_FN2, KC_SPACE) -#define BS_FN1 LT(_FN1, KC_BSPC) -#define BS_FN2 LT(_FN2, KC_BSPC) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_BASE] = LAYOUT( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LALT, KC_LGUI, FN1, SP_FN1, BS_FN2, KC_RGUI, KC_RALT, FN2, KC_RCTL - ), - - [_FN1] = LAYOUT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, - RESET, RGB_HUI, RGB_SAI, RGB_VAI, KC_VOLU, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_SCLN, _______, - RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_VOLD, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, KC_UP, _______, - RGB_TOG, _______, _______, _______, _______, KC_DEL, KC_0, KC_LEFT, KC_DOWN, KC_RGHT - ), - - [_FN2] = LAYOUT( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, - _______, _______, _______, KC_INS, KC_PGUP, KC_HOME, _______, _______, _______, _______, KC_COLN, _______, - _______, _______, _______, KC_DEL, KC_PGDN, KC_END, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______ - ) -}; diff --git a/keyboards/laplace/keymaps/default/rules.mk b/keyboards/laplace/keymaps/default/rules.mk deleted file mode 100644 index 457a3d01d4a..00000000000 --- a/keyboards/laplace/keymaps/default/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/laplace/laplace.h b/keyboards/laplace/laplace.h deleted file mode 100644 index 17f928f344a..00000000000 --- a/keyboards/laplace/laplace.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef LAPLACE_H -#define LAPLACE_H - -#include "quantum.h" - -#define LAYOUT( \ - A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, \ - B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B13, \ - C1, C2, C3, C4, C5, C6, C7, C9, C10, C11, C12, C13, \ - D1, D2, D3, D4, D5, D7, D10, D11, D12, D13 \ - ) { \ - {A1, A2, A3, A4, A5, A6, A7}, \ - {KC_NO, A13, A12, A11, A10, A9, A8}, \ - {B1, B2, B3, B4, B5, B6, B7}, \ - {KC_NO, B13, KC_NO, B11, B10, B9, B8}, \ - {C1, C2, C3, C4, C5, C6, C7}, \ - {KC_NO, C13, C12, C11, C10, C9, KC_NO}, \ - {D1, D2, D3, D4, D5, KC_NO, D7}, \ - {KC_NO, D13, D12, D11, D10, KC_NO, KC_NO} \ - } - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, \ - B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B13, \ - C1, C2, C3, C4, C5, C6, C7, C9, C10, C11, C12, C13, \ - D1, D2, D3, D4, D5, D7, D10, D11, D12, D13 \ - ) \ - LAYOUT( \ - KC_##A1, KC_##A2, KC_##A3, KC_##A4, KC_##A5, KC_##A6, KC_##A7, KC_##A8, KC_##A9, KC_##A10, KC_##A11, KC_##A12, KC_##A13, \ - KC_##B1, KC_##B2, KC_##B3, KC_##B4, KC_##B5, KC_##B6, KC_##B7, KC_##B8, KC_##B9, KC_##B10, KC_##B11, KC_##B13, \ - KC_##C1, KC_##C2, KC_##C3, KC_##C4, KC_##C5, KC_##C6, KC_##C7, KC_##C9, KC_##C10, KC_##C11, KC_##C12, KC_##C13, \ - KC_##D1, KC_##D2, KC_##D3, KC_##D4, KC_##D5, KC_##D7, KC_##D10, KC_##D11, KC_##D12, KC_##D13 \ - ) -#endif diff --git a/keyboards/laplace/readme.md b/keyboards/laplace/readme.md deleted file mode 100644 index 71b3280082b..00000000000 --- a/keyboards/laplace/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -Laplace -======= - -A 40% staggered keyboard made and sold by Keebio. [More info at Keebio](https://keeb.io). - -Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make laplace:default - -Example of flashing this keyboard: - - make laplace:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -A build guide for this keyboard can be found here: [Keebio Build Guides](https://docs.keeb.io) diff --git a/keyboards/laplace/rules.mk b/keyboards/laplace/rules.mk deleted file mode 100644 index fe22161cb9c..00000000000 --- a/keyboards/laplace/rules.mk +++ /dev/null @@ -1,64 +0,0 @@ -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. diff --git a/keyboards/laptreus/config.h b/keyboards/laptreus/config.h new file mode 100644 index 00000000000..675d7b00790 --- /dev/null +++ b/keyboards/laptreus/config.h @@ -0,0 +1,72 @@ +/* +Copyright 2019 Chuck "@vosechu" Lauer Vose + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ + +#define VENDOR_ID 0x1209 // pid.codes Vendor ID +#define PRODUCT_ID 0xA1F1 // FIXME: Need to send PR to pid.codes to make this official +#define DEVICE_VER 0x0001 +#define MANUFACTURER Vosechu +#define PRODUCT Laptreus +#define DESCRIPTION keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 10 + +#define MATRIX_ROW_PINS { F7, F6, F5, F1, F4 } +#define MATRIX_COL_PINS { D6, B7, B6, D7, C6, D1, D0, D3, D2, F0 } +#define UNUSED_PINS { } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +// #define NO_ACTION_LAYER +// #define NO_ACTION_TAPPING +// #define NO_ACTION_ONESHOT +// #define NO_ACTION_MACRO +// #define NO_ACTION_FUNCTION diff --git a/keyboards/laptreus/keymaps/debug/keymap.c b/keyboards/laptreus/keymaps/debug/keymap.c new file mode 100644 index 00000000000..8ffb06fa253 --- /dev/null +++ b/keyboards/laptreus/keymaps/debug/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* ============================= DEBUG LAYER ============================= */ + [0] = LAYOUT( + KC_A, KC_1, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, + KC_A, KC_2, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, + KC_A, KC_3, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, + KC_A, KC_4, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L + ) +}; diff --git a/keyboards/laptreus/keymaps/debug/readme.md b/keyboards/laptreus/keymaps/debug/readme.md new file mode 100644 index 00000000000..fa4a27eda89 --- /dev/null +++ b/keyboards/laptreus/keymaps/debug/readme.md @@ -0,0 +1,81 @@ +# Debug layout + +This layout is expressly for debugging to see if your keys are working. + +## Flashing + +**NOTE**: Make sure you don't have a second QMK keyboard plugged in when you do this! + +To compile and flash to the board: + + make laptreus:debug:avrdude + +To just compile: + + make laptreus:debug + +Then use QMK toolbox to write the file + +# Testing + +Now that you've got the image flashed, do the following: + +* Open a new text document +* Click each key in order and hit enter (with the other keyboard) between each line +* For any keys that don't register, hit space (with the other keyboard) and continue on +* You'll end up with something looking like this: + + a1bcdefghijkl + a2bcdefghijkl + a3bcdefghijkl + a4bcdefghijkl + +But almost certainly it won't be perfect, so lets go through some scenarios: + +## Step 1: Get all the letters to output _something_ + +For lines that look like this: + + a1bc efg ijkl + +* Option 1: Bent pin - Pull out the switch in those spots, probably the pin got bent when you inserted it into the hotswap socket. Gently bend the pin straight and re-insert. +* Option 2: Broken joint on hotswap - If the pin looks okay, try connecting the two metal plated holes underneath the hotswap holes to see if the letter comes out. If it does, reflow (aka, apply some flux to both pads and reheat) the solder joint. +* Option 3: Diode is backwards - If connecting the two metal pins didn't work, double check that the diode is the right direction. This may also need to be reflowed. +* Option 4: ??? - Hop in [the discord]() and let's chat! + +## Step 2: Correct double letters + +Once you have all the keys outputting _anything_, flash the default layout and do the same thing. If everything is working, your layout will look something like this: + + qwertyuiop + asdfghjkl;' + zxcvbnm,./ + +**Note**: Don't worry about hitting the backspace or command keys + +### Duplicate letters + +For lines that look like this: + + qwertyyuiop (double y) + +* Option 1: Bent pin - Pull out the switch in those spots, probably the pin got bent when you inserted it into the hotswap socket. Gently bend the pin straight and re-insert. +* Option 2: Switch is broken - Try connecting the two metal plated holes underneath the hotswap holes to see if the letter comes out just once. If it does, the switch is broken and should be replaced. If you don't have another switch, you _may_ be able to unbend the leaf inside the switch, but it's really tricky. + +### Second letter sent (same row) + +For lines that look like this: + + qwertyyuiop (t sent t AND y) + +* Option 1: ??? - I can't imagine how this would happen with this layout, but let me know if it does! + +### Second letter sent (same column) + +For lines that look like this: + + qwertgyuiop (t sent t AND g) + qwertgbyuiop (t sent t AND g AND b) + +* Option 1: Diodes are backwards - Some of the diodes on this column are backwards, you can use a diode tester to confirm the direction, or just check them with a magnifying glass and switch them if needed. +* Option 2: ??? diff --git a/keyboards/laptreus/keymaps/default/keymap.c b/keyboards/laptreus/keymaps/default/keymap.c new file mode 100644 index 00000000000..b0e1c9f023a --- /dev/null +++ b/keyboards/laptreus/keymaps/default/keymap.c @@ -0,0 +1,74 @@ +#include QMK_KEYBOARD_H + +enum layer_names { + _QWERTY = 0, + _DVORAK, + _LOWER, + _RAISE, + _LIFT +}; + +// Fillers to make layering more clear +#define _LAYER_ KC_TRNS + +// Adding macros to make the keymaps below much easier to read. +#define CTL_ESC CTL_T(KC_ESC) +#define CTL_GRV CTL_T(KC_GRV) +#define ALT_TAB ALT_T(KC_TAB) +#define SFT_SPC SFT_T(KC_SPC) + +// Extended alpha key layers +#define RSE_J LT(_RAISE, KC_J) +#define LWR_F LT(_LOWER, KC_F) +#define RSE_H LT(_RAISE, KC_H) +#define LWR_U LT(_LOWER, KC_U) +#define LFT_BK LT(_LIFT, KC_BSPC) +#define LFT_ENT LT(_LIFT, KC_ENT) + +// Macro keys for some apps +#define SLACKUP LALT(LSFT(KC_UP)) +#define SLACKDN LALT(LSFT(KC_DOWN)) +#define TAB_LFT LGUI(LSFT(KC_LBRC)) +#define TAB_RGT LGUI(LSFT(KC_RBRC)) +#define BWSR_BK LGUI(KC_LBRC) +#define BWSR_FW LGUI(KC_RBRC) +#define SCR_LFT HYPR(KC_LEFT) +#define SCR_RGT HYPR(KC_RGHT) +#define SCR_FUL HYPR(KC_F) + +// Layer toggles +#define TO_QW TO(_QWERTY) +#define TO_DV TO(_DVORAK) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC , + KC_ESC , KC_A , KC_S , KC_D , LWR_F , KC_G , KC_H , RSE_J , KC_K , KC_L , KC_SCLN , KC_QUOT , + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_ENT , + KC_HYPR , CTL_GRV , ALT_TAB , KC_LGUI , LFT_BK , SFT_SPC , KC_SPC , LFT_ENT , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT + ), + [_DVORAK] = LAYOUT( + KC_TAB , KC_QUOT , KC_COMM , KC_DOT , KC_P , KC_Y , KC_F , KC_G , KC_C , KC_R , KC_L , KC_BSPC , + KC_ESC , KC_A , KC_O , KC_E , LWR_U , KC_I , KC_D , RSE_H , KC_T , KC_N , KC_S , KC_SLSH , + KC_LSFT , KC_SCLN , KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z , KC_ENT , + KC_HYPR , CTL_GRV , ALT_TAB , KC_LGUI , LFT_BK , SFT_SPC , KC_SPC , LFT_ENT , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT + ), + [_LOWER] = LAYOUT( + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_7 , KC_8 , KC_9 , XXXXXXX , _______ , + _______ , XXXXXXX , XXXXXXX , XXXXXXX , _LAYER_ , XXXXXXX , XXXXXXX , KC_4 , KC_5 , KC_6 , XXXXXXX , _______ , + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_1 , KC_2 , KC_3 , XXXXXXX , _______ , + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , KC_0 , KC_DOT , _______ , _______ + ), + [_RAISE] = LAYOUT( + _______ , KC_LABK , KC_RABK , KC_LCBR , KC_RCBR , KC_EQL , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , + _______ , KC_LPRN , KC_RPRN , KC_LBRC , KC_RBRC , KC_MINS , XXXXXXX , _LAYER_ , XXXXXXX , XXXXXXX , XXXXXXX , _______ , + _______ , XXXXXXX , XXXXXXX , XXXXXXX , KC_BSLS , KC_SLSH , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + [_LIFT] = LAYOUT( + _______ , BWSR_BK , TAB_LFT , KC_UP , TAB_RGT , BWSR_FW , KC_MUTE , XXXXXXX , SCR_LFT , SCR_FUL , SCR_RGT , _______ , + _______ , XXXXXXX , KC_LEFT , KC_DOWN , KC_RGHT , KC_PGUP , KC_VOLU , SLACKUP , XXXXXXX , XXXXXXX , TO_QW , _______ , + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_PGDN , KC_VOLD , SLACKDN , XXXXXXX , XXXXXXX , TO_DV , _______ , + _______ , RESET , _______ , _______ , _LAYER_ , KC_BSPC , _______ , KC_LSFT , KC_LGUI , KC_LALT , KC_LCTL , _______ + ) +}; diff --git a/keyboards/laptreus/keymaps/default/readme.md b/keyboards/laptreus/keymaps/default/readme.md new file mode 100644 index 00000000000..0124ab9a9f8 --- /dev/null +++ b/keyboards/laptreus/keymaps/default/readme.md @@ -0,0 +1,79 @@ +# Default layout + +This is the default layout for the Laptreus + +## Layout + +Some special things: + +* Lower/Raise are on the F/J keys. Tap to type the character, hold to activate the layer +* Enter and Backspace also activate the Lift layer. +* -- To get repeated backspace, hold BkLft and then press Shift + +### Qwerty + + ,-----------------------------------------------------------------------------------. + | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Esc | A | S | D | Lwr/F| G | H | Rse/J| K | L | ; | " | + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| Z | X | C | V | B | N | M | , | . | / | Enter| + |------+------+------+------+------+------+------+------+------+------+------+------| + | Hyper|Ctrl/~|AltTab| Cmd | BkLft| Shift| Space|EntLft| Left | Down | Up | Right| + `-----------------------------------------------------------------------------------' + +### Dvorak + + ,-----------------------------------------------------------------------------------. + | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Esc | A | O | E | Lwr/U| I | D | Rse/H| T | N | S | / | + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| ; | Q | J | K | X | B | M | W | V | Z | Enter| + |------+------+------+------+------+------+------+------+------+------+------+------| + | Hyper|Ctrl/~|AltTab| Cmd | BkLft| Shift| Space|EntLft| Left | Down | Up | Right| + `-----------------------------------------------------------------------------------' + +### Raise + + ,-----------------------------------------------------------------------------------. + | | < | > | { | } | | | | | | | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | ( | ) | [ | ] | | | | | | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | BkLft| Shift| Space|EntLft| | | | | + `-----------------------------------------------------------------------------------' + +### Lower + + ,-----------------------------------------------------------------------------------. + | | | | | | | | 7 | 8 | 9 | | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | | | | | | 4 | 5 | 6 | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | | | | | | 1 | 2 | 3 | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | BkLft| Shift| Space| 0 | 0 | . | | | + `-----------------------------------------------------------------------------------' + +### Lift + + ,-----------------------------------------------------------------------------------. + | |Hist ←| Tab ←| ↑ | Tab →|Hist →| Mute | |ScrLft|ScrFul|ScrRgt| | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | ← | ↓ | → | Pg Up|Vol up|Slk up| | |Qwerty| | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | | | | Pg Dn|Vol dn|Slk dn| | |Dvorak| | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | Reset| | | | Bksp | | Shift| Cmd | Opt | Ctrl | | + `-----------------------------------------------------------------------------------' + +Special things: + +* Hist: Back button in your browser +* Tab: Move one tab left/right in most mac apps +* Slk: Go to the previous/next unread conversation in Slack +* Scr: Make this app fill the left/right side of your monitor (or full screen) +* Since arrows are on this layer, the command keys are moved to the right side diff --git a/keyboards/laptreus/keymaps/vosechu/keymap.c b/keyboards/laptreus/keymaps/vosechu/keymap.c new file mode 100644 index 00000000000..8bb08a87328 --- /dev/null +++ b/keyboards/laptreus/keymaps/vosechu/keymap.c @@ -0,0 +1,36 @@ +#include QMK_KEYBOARD_H + +#include "vosechu.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DV] = LAYOUT( + PAWFIVE , KC_QUOT , KC_COMM , KC_DOT , KC_P , KC_Y , KC_F , KC_G , KC_C , KC_R , KC_L , RESET , + KC_ESC , KC_A , KC_O , KC_E , LWR_U , KC_I , KC_D , RSE_H , KC_T , KC_N , KC_S , XXXXXXX , + XXXXXXX , KC_SCLN , KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z , KC_ENT , + XXXXXXX , CTL_GRV , ALT_TAB , KC_LGUI , LFT_BK , SFT_SPC , KC_SPC , LFT_ENT , KC_MINS , KC_EQL , KC_SLSH , KC_BSLS + ), + [QW] = LAYOUT( + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC , + KC_ESC , KC_A , KC_S , KC_D , LWR_F , KC_G , KC_H , RSE_J , KC_K , KC_L , KC_SCLN , KC_QUOT , + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_ENT , + KC_HYPR , CTL_GRV , ALT_TAB , KC_LGUI , LFT_BK , SFT_SPC , KC_SPC , LFT_ENT , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT + ), + [LWR] = LAYOUT( + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_7 , KC_8 , KC_9 , XXXXXXX , _______ , + _______ , XXXXXXX , XXXXXXX , XXXXXXX , _LAYER_ , XXXXXXX , XXXXXXX , KC_4 , KC_5 , KC_6 , XXXXXXX , _______ , + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_1 , KC_2 , KC_3 , XXXXXXX , _______ , + _______ , _______ , _______ , _______ , _______ , _______ , _______ , KC_0 , KC_0 , KC_DOT , _______ , _______ + ), + [RSE] = LAYOUT( + _______ , KC_LABK , KC_RABK , KC_LCBR , KC_RCBR , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , + _______ , KC_LPRN , KC_RPRN , KC_LBRC , KC_RBRC , XXXXXXX , XXXXXXX , _LAYER_ , XXXXXXX , XXXXXXX , XXXXXXX , _______ , + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + [LFT] = LAYOUT( + _______ , BWSR_BK , TAB_LFT , KC_UP , TAB_RGT , BWSR_FW , KC_MUTE , XXXXXXX , SCR_LFT , SCR_FUL , SCR_RGT , _______ , + _______ , XXXXXXX , KC_LEFT , KC_DOWN , KC_RGHT , KC_PGUP , KC_VOLU , SLACKUP , XXXXXXX , XXXXXXX , TO(QW) , _______ , + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_PGDN , KC_VOLD , SLACKDN , XXXXXXX , XXXXXXX , TO(DV) , _______ , + _______ , RESET , _______ , _______ , _LAYER_ , KC_BSPC , _______ , KC_LSFT , KC_LGUI , KC_LALT , KC_LCTL , _______ + ) +}; diff --git a/keyboards/laptreus/keymaps/vosechu/readme.md b/keyboards/laptreus/keymaps/vosechu/readme.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/laptreus/laptreus.c b/keyboards/laptreus/laptreus.c new file mode 100644 index 00000000000..2e59ffd622f --- /dev/null +++ b/keyboards/laptreus/laptreus.c @@ -0,0 +1,6 @@ +#include "laptreus.h" + +void matrix_init_kb() { + // auto detect output on init + set_output(OUTPUT_AUTO); +} diff --git a/keyboards/laptreus/laptreus.h b/keyboards/laptreus/laptreus.h new file mode 100644 index 00000000000..305d4127480 --- /dev/null +++ b/keyboards/laptreus/laptreus.h @@ -0,0 +1,41 @@ +#ifndef LAPTREUS_H +#define LAPTREUS_H + +#include "quantum.h" +#include "outputselect.h" + +/* +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +*/ +#define LAYOUT( \ + A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, \ + B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, \ + C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, \ + D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 \ +) \ +{ \ + {A2, A3, A4, A5, A6, A7, A8, A9, A10, A11}, \ + {B2, B3, B4, B5, B6, B7, B8, B9, B10, B11}, \ + {C2, C3, C4, C5, C6, C7, C8, C9, C10, C11}, \ + {D2, D3, D4, D5, D6, D7, D8, D9, D10, D11}, \ + {A1, B1, C1, D1, KC_NO, KC_NO, D12, C12, B12, A12} \ +} + +#define LAYOUT_kc( \ + A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, \ + B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, \ + C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, \ + D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 \ +) \ +{ \ + LAYOUT( \ + KC_##A1, KC_##A2, KC_##A3, KC_##A4, KC_##A5, KC_##A6, KC_##A7, KC_##A8, KC_##A9, KC_##A10, KC_##A11, KC_##A12, \ + KC_##B1, KC_##B2, KC_##B3, KC_##B4, KC_##B5, KC_##B6, KC_##B7, KC_##B8, KC_##B9, KC_##B10, KC_##B11, KC_##B12, \ + KC_##C1, KC_##C2, KC_##C3, KC_##C4, KC_##C5, KC_##C6, KC_##C7, KC_##C8, KC_##C9, KC_##C10, KC_##C11, KC_##C12, \ + KC_##D1, KC_##D2, KC_##D3, KC_##D4, KC_##D5, KC_##D6, KC_##D7, KC_##D8, KC_##D9, KC_##D10, KC_##D11, KC_##D12 \ + ) \ +} + +#endif diff --git a/keyboards/laptreus/readme.md b/keyboards/laptreus/readme.md new file mode 100644 index 00000000000..e27c206048e --- /dev/null +++ b/keyboards/laptreus/readme.md @@ -0,0 +1,35 @@ +# Laptreus + +TODO: Insert cool photo + +Laptreus is a 40% bluetooth keyboard in the style of the Atreus, which is specifically designed to sit atop your laptop keyboard. + +Maintainer: [Chuck Lauer Vose](https://github.com/vosechu) +MCU: Adafruit Feather 32u4 BLE +Purchase link: GB coming soon +Case link: GB coming soon +Case design files: TODO + +## Flashing + +**NOTE**: Make sure you don't have a second QMK keyboard plugged in when you do this! + +[Default layout documentation](https://github.com/qmk/qmk_firmware/tree/master/keyboards/laptreus/keymaps/default) + +To compile and flash to the board: + + make laptreus:default:avrdude + +To just compile: + + make laptreus:default + +Then use QMK toolbox to write the file + +## Changelog + +v1.2: Mostly working, but JST connector is a little too tight and the reset switch is not connected. + +## Build log + +TODO diff --git a/keyboards/laptreus/rules.mk b/keyboards/laptreus/rules.mk new file mode 100644 index 00000000000..01401ab3856 --- /dev/null +++ b/keyboards/laptreus/rules.mk @@ -0,0 +1,65 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 8000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = catarina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +#BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +#MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +KEY_LOCK_ENABLE = no +TAP_DANCE_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +BLUETOOTH_ENABLE = no # Legacy bluetooth support +BLUETOOTH = AdafruitBLE diff --git a/keyboards/launchpad/config.h b/keyboards/launchpad/config.h index 9d1e310d3ec..d93fe65d2d7 100644 --- a/keyboards/launchpad/config.h +++ b/keyboards/launchpad/config.h @@ -38,18 +38,13 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/launchpad/keymaps/default/keymap.c b/keyboards/launchpad/keymaps/default/keymap.c index 67103576d97..c793349a5d7 100644 --- a/keyboards/launchpad/keymaps/default/keymap.c +++ b/keyboards/launchpad/keymaps/default/keymap.c @@ -1,7 +1,5 @@ // Below layout is based upon /u/That-Canadian's planck layout -#include "launchpad.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -13,10 +11,6 @@ extern keymap_config_t keymap_config; #define _FUNC 15 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) @@ -25,9 +19,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-------------. - * | 1 | 2 | + * | 1 | 2 | * |------+------| - * | 3 | 4 | + * | 3 | 4 | * |------+------| * | 5 | 6 | * |------+------| @@ -43,9 +37,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Function * ,-------------. - * | Q |CALDEL| + * | Q |CALDEL| * |------+------| - * | A |TSKMGR| + * | A |TSKMGR| * |------+------| * | Z | X | * |------+------| @@ -62,5 +56,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; void matrix_init_user(void) { - + } diff --git a/keyboards/launchpad/keymaps/default/rules.mk b/keyboards/launchpad/keymaps/default/rules.mk index 9bf35a59d09..d1fa27f41ef 100644 --- a/keyboards/launchpad/keymaps/default/rules.mk +++ b/keyboards/launchpad/keymaps/default/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/launchpad/keymaps/default_rgb/config.h b/keyboards/launchpad/keymaps/default_rgb/config.h new file mode 100644 index 00000000000..cae1450c15b --- /dev/null +++ b/keyboards/launchpad/keymaps/default_rgb/config.h @@ -0,0 +1,9 @@ +#pragma once + +/* Underlight Configuration */ +#define RGB_DI_PIN F4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 2 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 \ No newline at end of file diff --git a/keyboards/launchpad/keymaps/default_rgb/keymap.c b/keyboards/launchpad/keymaps/default_rgb/keymap.c new file mode 100644 index 00000000000..50fef532c03 --- /dev/null +++ b/keyboards/launchpad/keymaps/default_rgb/keymap.c @@ -0,0 +1,76 @@ +// Below layout is based upon /u/That-Canadian's planck layout +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _RGB 1 +#define _FUNC 15 + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-------------. + * | 1 | 2 | + * |------+------| + * | 3 | 4 | + * |------+------| + * | 5 | 6 | + * |------+------| + * | FUNC | RGB | + * `-------------' + */ + [_QWERTY] = LAYOUT( \ + KC_1, KC_2, \ + KC_3, KC_4, \ + KC_5, KC_6, \ + MO(_FUNC), TG(_RGB) \ + ), + + /* RGB + * ,-------------. + * | Mode-| Mode+| + * |------+------| + * | HUE- | HUE+ | + * |------+------| + * | SAT- | SAT+ | + * |------+------| + * |RGBTOG| | + * `-------------' + */ + [_RGB] = LAYOUT( \ + RGB_RMOD, RGB_MOD, \ + RGB_HUD, RGB_HUI, \ + RGB_SAD, RGB_SAI, \ + RGB_TOG, KC_TRNS \ + ), + + /* Function + * ,-------------. + * | Q |CALDEL| + * |------+------| + * | A |TSKMGR| + * |------+------| + * | Z | X | + * |------+------| + * | | C | + * `-------------' + */ + [_FUNC] = LAYOUT( \ + KC_Q, CALTDEL, \ + KC_A, TSKMGR, \ + KC_Z, KC_X, \ + _______, KC_C \ + ) + +}; + +void matrix_init_user(void) {} diff --git a/keyboards/launchpad/keymaps/default_rgb/readme.md b/keyboards/launchpad/keymaps/default_rgb/readme.md new file mode 100644 index 00000000000..3f15ff9bc39 --- /dev/null +++ b/keyboards/launchpad/keymaps/default_rgb/readme.md @@ -0,0 +1,41 @@ +# Launch Pad + +![Launch Pad](https://i.imgur.com/WVTe0Ku.png) + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +A budget-minded, 4-8 key macro-pad with built in legs, plate & case. + +Supports MX & Alps switches. 2x 1u or 1x 2u supported for each row. + +Supports 2u PCB-Mount stabilizers. + +Runs off of 1x Pro Micro & 8x diodes (1n4148). + +Optional "Reset" switch can be used on the PCB. + +A fantastic project for beginners to learn to solder, veteran's of the hobby who want to add an easy macro-pad to their collection, and everyone in between. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +Make example for this keyboard (after setting up your build environment): + + make launchpad/rev1:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +# Under Glow + +![Underglow](https://i.imgur.com/3zFIOmu.jpg) + +SpaceCat now provides an underglow add-on kit. Please refer to the picture above for wiring. + +Make example for this keyboard (after setting up your build environment): + + make launchpad/rev1:default_rgb + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +Due to PCB tolerance issues outside of our control, the snap-apart legs included on the PCB may need extra padding to prevent a small amount of wobbling once placed properly. We have included small, clear, and semi-permanent "glue dots" in each order (PCB Only -and- Full Kit) to help with this. You may also use plastic wrap, tape, Elmer's glue, hot glue, rubber cement, etc. We advise against using anything more "permanent" in case you wish to make changes to your Launch Pad in the future. It is also best to attach legs after all of your soldering and building is finished, to get the most accurate feel for your Launch Pad. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/keyboards/launchpad/keymaps/default_rgb/rules.mk b/keyboards/launchpad/keymaps/default_rgb/rules.mk new file mode 100644 index 00000000000..164232f3398 --- /dev/null +++ b/keyboards/launchpad/keymaps/default_rgb/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. \ No newline at end of file diff --git a/keyboards/launchpad/readme.md b/keyboards/launchpad/readme.md index 80b5de32191..81281219467 100644 --- a/keyboards/launchpad/readme.md +++ b/keyboards/launchpad/readme.md @@ -23,7 +23,7 @@ Make example for this keyboard (after setting up your build environment): make launchpad/rev1:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/keyboards/launchpad/rules.mk b/keyboards/launchpad/rules.mk index 2f9349a9b8d..b2c64db7a27 100644 --- a/keyboards/launchpad/rules.mk +++ b/keyboards/launchpad/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -64,4 +63,4 @@ API_SYSEX_ENABLE = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -DEFAULT_FOLDER = launchpad/rev1 \ No newline at end of file +DEFAULT_FOLDER = launchpad/rev1 diff --git a/keyboards/lazydesigners/dimple/config.h b/keyboards/lazydesigners/dimple/config.h new file mode 100644 index 00000000000..9814d1050ca --- /dev/null +++ b/keyboards/lazydesigners/dimple/config.h @@ -0,0 +1,66 @@ +/* +Copyright 2019 Erovia + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0040 +#define DEVICE_VER 0x0001 +#define MANUFACTURER LazyDesigners +#define PRODUCT Dimple +#define DESCRIPTION A 40% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* RBG underglow */ +#define RGB_DI_PIN B7 +#ifdef RGB_DI_PIN + #define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_SLEEP + #define RGBLED_NUM 50 + /* #define RGBLIGHT_HUE_STEP 8 */ + /* #define RGBLIGHT_SAT_STEP 8 */ + /* #define RGBLIGHT_VAL_STEP 8 */ +#endif + +/* CapsLock LED */ +#define BACKLIGHT_PIN E6 +#ifdef BACKLIGHT_PIN + #define BACKLIGHT_LEVELS 6 +#endif diff --git a/keyboards/lazydesigners/dimple/dimple.c b/keyboards/lazydesigners/dimple/dimple.c new file mode 100644 index 00000000000..69fb2253fc0 --- /dev/null +++ b/keyboards/lazydesigners/dimple/dimple.c @@ -0,0 +1,30 @@ +/* Copyright 2019 Erovia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "dimple.h" + +void dimple_led_on() { + writePinHigh(E6); +} + +void dimple_led_off() { + writePinLow(E6); +} + +void keyboard_pre_init_kb(void) { + // Initialize Caps Lock LED + setPinOutput(E6); + keyboard_pre_init_user(); +} diff --git a/keyboards/lazydesigners/dimple/dimple.h b/keyboards/lazydesigners/dimple/dimple.h new file mode 100644 index 00000000000..ba8a413ed66 --- /dev/null +++ b/keyboards/lazydesigners/dimple/dimple.h @@ -0,0 +1,46 @@ +/* Copyright 2019 Erovia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* + * ,---------------------------------------------------------------. + * | | | | | | | | | | | | | + * |---------------------------------------------------------------| + * | | | | | | | | | | | | | + * |---------------------------------------------------------------| + * | | | | | | | | | | | | + * |---------------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------' + */ + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, \ + K300, K302, K303, K304, K306, K307, K308, K309 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, KC_NO, K306, K307, K308, K309, KC_NO, KC_NO } \ +} + + +void dimple_led_on(void); +void dimple_led_off(void); diff --git a/keyboards/lazydesigners/dimple/info.json b/keyboards/lazydesigners/dimple/info.json new file mode 100644 index 00000000000..db5137e1f85 --- /dev/null +++ b/keyboards/lazydesigners/dimple/info.json @@ -0,0 +1,56 @@ +{ + "keyboard_name": "Dimple", + "url": "http://lazydesigners.cn", + "maintainer": "Erovia", + "width": 12.5, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"Back
Space", "x":11, "y":0, "w":1.5}, + {"label":"Tab", "x":0, "y":1, "w":1.25}, + {"label":"A", "x":1.25, "y":1}, + {"label":"S", "x":2.25, "y":1}, + {"label":"D", "x":3.25, "y":1}, + {"label":"F", "x":4.25, "y":1}, + {"label":"G", "x":5.25, "y":1}, + {"label":"H", "x":6.25, "y":1}, + {"label":"J", "x":7.25, "y":1}, + {"label":"K", "x":8.25, "y":1}, + {"label":"L", "x":9.25, "y":1}, + {"label":"'", "x":10.25, "y":1}, + {"label":"Enter", "x":11.25, "y":1, "w":1.25}, + {"label":"Shift", "x":0, "y":2, "w":1.75}, + {"label":"Z", "x":1.75, "y":2}, + {"label":"X", "x":2.75, "y":2}, + {"label":"C", "x":3.75, "y":2}, + {"label":"V", "x":4.75, "y":2}, + {"label":"B", "x":5.75, "y":2}, + {"label":"N", "x":6.75, "y":2}, + {"label":"M", "x":7.75, "y":2}, + {"label":",", "x":8.75, "y":2}, + {"label":"Up", "x":9.75, "y":2}, + {"label":".", "x":10.75, "y":2, "w":1.75}, + {"label":"Ctrl", "x":0.75, "y":3}, + {"label":"Gui", "x":1.75, "y":3}, + {"label":"Alt", "x":2.75, "y":3}, + {"label":"Space", "x":3.75, "y":3, "w":2.25}, + {"label":"Space", "x":6, "y":3, "w":2.75}, + {"label":"Left", "x":8.75, "y":3}, + {"label":"Down", "x":9.75, "y":3}, + {"label":"Right", "x":10.75, "y":3} + ] + } + } +} diff --git a/keyboards/lazydesigners/dimple/keymaps/default/keymap.c b/keyboards/lazydesigners/dimple/keymaps/default/keymap.c new file mode 100644 index 00000000000..e5a9c8466ac --- /dev/null +++ b/keyboards/lazydesigners/dimple/keymaps/default/keymap.c @@ -0,0 +1,136 @@ +/* Copyright 2019 Erovia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum custom_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +// Act as Shift on hold and as CapsLock on tap +#define SFT_CPS LSFT_T(KC_CAPS) +// Left space on tap, LOWER on hold +#define SPC_LOW LT(_LOWER, KC_SPC) +// Left space on tap, UPPER on hold +#define SPC_UPR LT(_RAISE, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* + * ,---------------------------------------------------------------. + * |Esc | Q | W | E | R | T | Y | U | I | O | P | Bspc | + * |---------------------------------------------------------------| + * | Tab | A | S | D | F | G | H | J | K | L | ' |Enter | + * |---------------------------------------------------------------| + * | Shift | Z | X | C | V | B | N | M | , | Up | . | + * |---------------------------------------------------------------| + * |Ctrl|Gui |Alt | Spc/Lwr | Spc/Rse |Left|Down|Rght| + * `-----------------------------------------------------' + */ + + [_QWERTY] = LAYOUT( + KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + SFT_CPS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_UP, KC_DOT, + KC_LCTL, KC_LGUI, KC_LALT, SPC_LOW, SPC_UPR, KC_LEFT, KC_DOWN, KC_RGHT + ), + +/* + * ,---------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |---------------------------------------------------------------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |---------------------------------------------------------------| + * | | F7 | F8 | F9 |F10 |F11 |F12 | | ; |PgUp| / | + * |---------------------------------------------------------------| + * | | | | | |Home|PgDn|End | + * `-----------------------------------------------------' + */ + + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_NO, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_NO, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_SCLN, KC_PGUP, KC_SLSH, + KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END + ), + +/* + * ,---------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |---------------------------------------------------------------| + * | Ins | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |---------------------------------------------------------------| + * | | F7 | F8 | F9 |F10 |F11 |F12 | | | | | + * |---------------------------------------------------------------| + * |VolD|Mute|VolU| | | | | | + * `-----------------------------------------------------' + */ + + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, + KC_INS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_NO, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, KC_NO, KC_NO, + KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO + ), + +/* + * ,---------------------------------------------------------------. + * |EEPR|RST | | | | | | | | | | | + * |---------------------------------------------------------------| + * | | | | | | | | | | | | | + * |---------------------------------------------------------------| + * | | | | | | | | | | | | + * |---------------------------------------------------------------| + * |RGB-|RGB |RGB+| | | | | | + * `-----------------------------------------------------' + */ + + [_ADJUST] = LAYOUT( + EEP_RST, RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + RGB_VAD, RGB_TOG, RGB_VAI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ), +}; + +void led_set_user(uint8_t usb_led) { +if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + dimple_led_on(); + } else { + dimple_led_off(); + } +} + +uint32_t layer_state_set_user(uint32_t state) { + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + switch (biton32(state)) { + case _LOWER: + rgblight_sethsv_noeeprom(HSV_GREEN); + break; + case _RAISE: + rgblight_sethsv_noeeprom(HSV_GOLD); + break; + case _ADJUST: + rgblight_sethsv_noeeprom(HSV_RED); + break; + default: + rgblight_sethsv_noeeprom(HSV_WHITE); + break; + } + return state; +} diff --git a/keyboards/lazydesigners/dimple/keymaps/default/readme.md b/keyboards/lazydesigners/dimple/keymaps/default/readme.md new file mode 100644 index 00000000000..c334b6c3675 --- /dev/null +++ b/keyboards/lazydesigners/dimple/keymaps/default/readme.md @@ -0,0 +1,60 @@ +# The default keymap for Dimple + +**Features** + +* Shift acts as CapsLock when tapped +* Left space: space on tap, Lower layer on hold +* Right space: space on tap, Raise layer on hold +* Both space: Adjust layer on hold + +## QWERTY (Normal) Layer +``` + ,---------------------------------------------------------------. + |Esc | Q | W | E | R | T | Y | U | I | O | P | Bspc | + |---------------------------------------------------------------| + | Tab | A | S | D | F | G | H | J | K | L | ' |Enter | + |---------------------------------------------------------------| + | Shift | Z | X | C | V | B | N | M | , | Up | . | + |---------------------------------------------------------------| + |Ctrl|Gui |Alt | Spc/Lwr | Spc/Rse |Left|Down|Rght| + `-----------------------------------------------------' +``` + +## Lower Layer +``` + ,---------------------------------------------------------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + |---------------------------------------------------------------| + | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + |---------------------------------------------------------------| + | | F7 | F8 | F9 |F10 |F11 |F12 | | ; |PgUp| / | + |---------------------------------------------------------------| + | | | | | |Home|PgDn|End | + `-----------------------------------------------------' +``` + +## Raise Layer +``` + ,---------------------------------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + |---------------------------------------------------------------| + | Ins | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + |---------------------------------------------------------------| + | | F7 | F8 | F9 |F10 |F11 |F12 | | | | | + |---------------------------------------------------------------| + |VolD|Mute|VolU| | | | | | + `-----------------------------------------------------' +``` + +## Adjust Layer +``` +,---------------------------------------------------------------. + |EEPR|RST | | | | | | | | | | | + |---------------------------------------------------------------| + | | | | | | | | | | | | | + |---------------------------------------------------------------| + | | | | | | | | | | | | + |---------------------------------------------------------------| + |RGB-|RGB |RGB+| | | | | | + `-----------------------------------------------------' +``` diff --git a/keyboards/lazydesigners/dimple/readme.md b/keyboards/lazydesigners/dimple/readme.md new file mode 100644 index 00000000000..04b4b438d62 --- /dev/null +++ b/keyboards/lazydesigners/dimple/readme.md @@ -0,0 +1,17 @@ +# Dimple + +![dimple](https://i.loli.net/2019/03/29/5c9daf903cad9.jpg) + +A 40% custom keyboard designed and produced by [LazyDesigners](http://lazydesigners.cn). + +Keyboard Maintainer: [Erovia](https://github.com/Erovia) +Hardware Supported: Dimple +Hardware Availability: Check for GBs on [Geekhack](https://geekhack.org) and on [LazyDesigner's homepage.](http://lazydesigners.cn) + +Make example for this keyboard (after setting up your build environment): + + make lazydesigners/dimple:default:dfu + +To enter the bootloader, either short the pins on the PCB or the RESET button on the FN layer. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/lazydesigners/dimple/rules.mk b/keyboards/lazydesigners/dimple/rules.mk new file mode 100644 index 00000000000..a818e871c69 --- /dev/null +++ b/keyboards/lazydesigners/dimple/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow diff --git a/keyboards/lazydesigners/the50/config.h b/keyboards/lazydesigners/the50/config.h new file mode 100644 index 00000000000..72246eabac5 --- /dev/null +++ b/keyboards/lazydesigners/the50/config.h @@ -0,0 +1,44 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0050 +#define DEVICE_VER 0x0001 +#define MANUFACTURER LazyDesigners +#define PRODUCT THE50 +#define DESCRIPTION A 50% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, B1, B2, B3 } +#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 6 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN E6 +#ifdef RGB_DI_PIN +#define RGBLED_NUM 1 +#define RGBLIGHT_SLEEP +#endif diff --git a/keyboards/lazydesigners/the50/info.json b/keyboards/lazydesigners/the50/info.json new file mode 100644 index 00000000000..16e751dac32 --- /dev/null +++ b/keyboards/lazydesigners/the50/info.json @@ -0,0 +1,67 @@ +{ + "keyboard_name": "THE50", + "url": "http://lazydesigners.cn", + "maintainer": "qmk", + "width": 15.25, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 54, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"Back
Space", "x":11, "y":0}, + {"label":"7", "x":12.25, "y":0}, + {"label":"8", "x":13.25, "y":0}, + {"label":"9", "x":14.25, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.25}, + {"label":"A", "x":1.25, "y":1}, + {"label":"S", "x":2.25, "y":1}, + {"label":"D", "x":3.25, "y":1}, + {"label":"F", "x":4.25, "y":1}, + {"label":"G", "x":5.25, "y":1}, + {"label":"H", "x":6.25, "y":1}, + {"label":"J", "x":7.25, "y":1}, + {"label":"K", "x":8.25, "y":1}, + {"label":"L", "x":9.25, "y":1}, + {"label":"Enter", "x":10.25, "y":1, "w":1.75}, + {"label":"4", "x":12.25, "y":1}, + {"label":"5", "x":13.25, "y":1}, + {"label":"6", "x":14.25, "y":1}, + {"label":"Shift", "x":0, "y":2, "w":1.75}, + {"label":"Z", "x":1.75, "y":2}, + {"label":"X", "x":2.75, "y":2}, + {"label":"C", "x":3.75, "y":2}, + {"label":"V", "x":4.75, "y":2}, + {"label":"B", "x":5.75, "y":2}, + {"label":"N", "x":6.75, "y":2}, + {"label":"M", "x":7.75, "y":2}, + {"label":"<", "x":8.75, "y":2}, + {"label":">", "x":9.75, "y":2}, + {"label":"Fn", "x":10.75, "y":2, "w":1.25}, + {"label":"1", "x":12.25, "y":2}, + {"label":"2", "x":13.25, "y":2}, + {"label":"3", "x":14.25, "y":2}, + {"label":"Hyper", "x":0, "y":3, "w":1.25}, + {"label":"Super", "x":1.25, "y":3}, + {"label":"Meta", "x":2.25, "y":3, "w":1.25}, + {"label":"Space", "x":3.5, "y":3, "w":2.25}, + {"label":"Space", "x":5.75, "y":3, "w":2.75}, + {"label":"Meta", "x":8.5, "y":3, "w":1.25}, + {"label":"Super", "x":9.75, "y":3}, + {"label":"Hyper", "x":10.75, "y":3, "w":1.25}, + {"label":"0", "x":12.25, "y":3}, + {"label":".", "x":13.25, "y":3}, + {"label":"Enter", "x":14.25, "y":3}] + } + } +} diff --git a/keyboards/lazydesigners/the50/keymaps/default/keymap.c b/keyboards/lazydesigners/the50/keymaps/default/keymap.c new file mode 100644 index 00000000000..cba582cab2d --- /dev/null +++ b/keyboards/lazydesigners/the50/keymaps/default/keymap.c @@ -0,0 +1,59 @@ +#include QMK_KEYBOARD_H + +enum custom_layers { + _QWERTY, + _FN +}; + +// Act as Shift on hold and as CapsLock on tap +#define SFT_CPS LSFT_T(KC_CAPS) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------. ,--------------. + * |Esc | Q | W | E | R | T | Y | U | I | O | P |Bspc| | 7 | 8 | 9 | + * |-----------------------------------------------------------| |--------------| + * | Tab | A | S | D | F | G | H | J | K | L | Enter | | 4 | 5 | 6 | + * |-----------------------------------------------------------| |--------------| + * | Shift | Z | X | C | V | B | N | M | , | . | FN | | 1 | 2 | 3 | + * |-----------------------------------------------------------| |--------------| + * | Ctrl |Gui | Alt | Space | Space | RAlt |RGui|RCtrl| | 0 | . |Entr| + * `-----------------------------------------------------------' `--------------' + */ + +[_QWERTY] = LAYOUT( +KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_7, KC_8, KC_9, +KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_4, KC_5, KC_6, +SFT_CPS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MO(_FN), KC_1, KC_2, KC_3, +KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_0, KC_DOT, KC_ENT +), + +/* FN + * ,-----------------------------------------------------------. ,--------------. + * |RST | | | | | | | | | |Ins |Del | |Home|PgUp| | + * |-----------------------------------------------------------| |--------------| + * | |Prev|Play|Next| | | |VolD|Mute|VolU| | |End |PgDn| | + * |-----------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| |--------------| + * |EEPRST| | | | | | | | | | | | + * `-----------------------------------------------------------' `--------------' + */ + +[_FN] = LAYOUT( +RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, KC_HOME, KC_PGUP, _______, +_______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_END, KC_PGDN, _______, +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +EEP_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + +void led_set_user(uint8_t usb_led) { + // Turn LED On/Off for Caps Lock + if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { + the50_led_on(); + } else { + the50_led_off(); + } +} diff --git a/keyboards/lazydesigners/the50/keymaps/default/readme.md b/keyboards/lazydesigners/the50/keymaps/default/readme.md new file mode 100644 index 00000000000..09b9351f99c --- /dev/null +++ b/keyboards/lazydesigners/the50/keymaps/default/readme.md @@ -0,0 +1,31 @@ +# Default keymap for THE50 + +**Features** + +* Shift acts as CapsLock when tapped + +## QWERTY (Normal) Layer +``` + ,-----------------------------------------------------------. ,--------------. + |Esc | Q | W | E | R | T | Y | U | I | O | P |Bspc| | 7 | 8 | 9 | + |-----------------------------------------------------------| |--------------| + | Tab | A | S | D | F | G | H | J | K | L | Enter | | 4 | 5 | 6 | + |-----------------------------------------------------------| |--------------| + | Shift | Z | X | C | V | B | N | M | , | . | FN | | 1 | 2 | 3 | + |-----------------------------------------------------------| |--------------| + | Ctrl |Gui | Alt | Space | Space | RAlt |RGui|RCtrl| | 0 | . |Entr| + `-----------------------------------------------------------' `--------------' +``` + +## FN Layer +``` + ,-----------------------------------------------------------. ,--------------. + |RST | | | | | | | | | |Ins |Del | |Home|PgUp| | + |-----------------------------------------------------------| |--------------| + | |Prev|Play|Next| | | |VolD|Mute|VolU| | |End |PgDn| | + |-----------------------------------------------------------| |--------------| + | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| |--------------| + |EEPRST| | | | | | | | | | | | + `-----------------------------------------------------------' `--------------' +``` diff --git a/keyboards/lazydesigners/the50/keymaps/mikethetiger/keymap.c b/keyboards/lazydesigners/the50/keymaps/mikethetiger/keymap.c new file mode 100644 index 00000000000..a792d34fbd3 --- /dev/null +++ b/keyboards/lazydesigners/the50/keymaps/mikethetiger/keymap.c @@ -0,0 +1,79 @@ +#include QMK_KEYBOARD_H + +enum custom_layers { + _QWERTY, + _L1, + _L2 +}; + +// Act as Shift on hold and as CapsLock on tap +#define SFT_CPS LSFT_T(KC_CAPS) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------. ,--------------. + * |Esc | Q | W | E | R | T | Y | U | I | O | P |Bspc| | 7 | 8 | 9 | + * |-----------------------------------------------------------| |--------------| + * | Tab | A | S | D | F | G | H | J | K | L | Enter | | 4 | 5 | 6 | + * |-----------------------------------------------------------| |--------------| + * | Shift | Z | X | C | V | B | N | M | , | . | L2 | | 1 | 2 | 3 | + * |-----------------------------------------------------------| |--------------| + * | Ctrl |Gui | Alt | Space | Space | RAlt |RCtrl| L1 | | 0 | . |Entr| + * `-----------------------------------------------------------' `--------------' + */ + +[_QWERTY] = LAYOUT( +KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_P7, KC_P8, KC_P9, +KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_P4, KC_P5, KC_P6, +SFT_CPS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MO(_L2), KC_P1, KC_P2, KC_P3, +KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, MO(_L1), KC_0, KC_PDOT, KC_PENT +), + +/* L1 + * ,-----------------------------------------------------------. ,--------------. + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |Del | |NMLK| | / | + * |-----------------------------------------------------------| |--------------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | | [ | ] | \ | | - | = | * | + * |-----------------------------------------------------------| |--------------| + * | | F7 | F8 | F9 |F10 |F11 |F12 | , | . | / | | | | | - | + * |-----------------------------------------------------------| |--------------| + * | | | | | | ; | ' | | | | | + | + * `-----------------------------------------------------------' `--------------' + */ + +[_L1] = LAYOUT( +KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_NUMLOCK, _______, KC_PSLS, +_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_LBRC, KC_RBRC, KC_BSLASH, KC_MINS, KC_EQL, KC_PAST, +_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, KC_PMNS, +_______, _______, _______, _______, _______, KC_SCLN, KC_QUOT, _______, _______, _______, KC_PPLS +), + +/* L2 + * ,-----------------------------------------------------------. ,--------------. + * |RST | | | | | | | | | |Ins |Del | |Home|PgUp| | + * |-----------------------------------------------------------| |--------------| + * | |Prev|Play|Next| | | |VolD|Mute|VolU| | |End |PgDn| | + * |-----------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | up | | + * |-----------------------------------------------------------| |--------------| + * |EEPRST| | | | | | | | |left|down| rt | + * `-----------------------------------------------------------' `--------------' + */ + +[_L2] = LAYOUT( +RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, KC_HOME, KC_PGUP, _______, +_______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_END, KC_PGDN, _______, +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, +EEP_RST, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT +) +}; + +void led_set_user(uint8_t usb_led) { + // Turn LED On/Off for Caps Lock + if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { + the50_led_on(); + } else { + the50_led_off(); + } +} diff --git a/keyboards/lazydesigners/the50/readme.md b/keyboards/lazydesigners/the50/readme.md new file mode 100644 index 00000000000..d90dc59de6d --- /dev/null +++ b/keyboards/lazydesigners/the50/readme.md @@ -0,0 +1,17 @@ +# THE50 + +![THE50](https://i.loli.net/2018/11/13/5beac9464d402.jpg) + +A 50% custom keyboard designed and produced by [LazyDesigners](http://lazydesigners.cn). + +Keyboard Maintainer: QMK Community +Hardware Supported: THE50 +Hardware Availability: Check for GBs on [Geekhack](https://geekhack.org) and on [LazyDesigner's homepage.](http://lazydesigners.cn) + +Make example for this keyboard (after setting up your build environment): + + make lazydesigners/the50:default:dfu + +To enter the bootloader, either short the pins on the PCB or the RESET button on the FN layer. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/lazydesigners/the50/rules.mk b/keyboards/lazydesigners/the50/rules.mk new file mode 100644 index 00000000000..ae211ec66e8 --- /dev/null +++ b/keyboards/lazydesigners/the50/rules.mk @@ -0,0 +1,52 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality diff --git a/keyboards/lazydesigners/the50/the50.c b/keyboards/lazydesigners/the50/the50.c new file mode 100644 index 00000000000..4ceb3da6ab2 --- /dev/null +++ b/keyboards/lazydesigners/the50/the50.c @@ -0,0 +1,9 @@ +#include "the50.h" + +void the50_led_on() { + DDRB |= (1 << 7); PORTB &= ~(1 << 7); +} + +void the50_led_off() { + DDRB &= ~(1 << 7); PORTB &= ~(1 << 7); +} diff --git a/keyboards/lazydesigners/the50/the50.h b/keyboards/lazydesigners/the50/the50.h new file mode 100644 index 00000000000..1cf613aada9 --- /dev/null +++ b/keyboards/lazydesigners/the50/the50.h @@ -0,0 +1,32 @@ +#pragma once + +#include "quantum.h" + +#define XXXX KC_NO + +/* + * ,-----------------------------------------------------------. ,--------------. + * | | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------' `--------------' + */ + +#define LAYOUT( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K111, K112, K113, K114, \ +K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ +K300, K301, K302, K304, K307, K309, K310, K311, K312, K313, K314 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, XXXX, K111, K112, K113, K114 }, \ +{ K200, XXXX, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ +{ K300, K301, K302, XXXX, K304, XXXX, XXXX, K307, XXXX, K309, K310, K311, K312, K313, K314 } \ +} + +void the50_led_on(void); +void the50_led_off(void); diff --git a/keyboards/lazydesigners/the60/config.h b/keyboards/lazydesigners/the60/config.h new file mode 100644 index 00000000000..d6bd2205c6e --- /dev/null +++ b/keyboards/lazydesigners/the60/config.h @@ -0,0 +1,38 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER LazyDesigners +#define PRODUCT THE60 +#define DESCRIPTION A 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } +#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 6 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/lazydesigners/the60/info.json b/keyboards/lazydesigners/the60/info.json new file mode 100644 index 00000000000..4fef5a098c4 --- /dev/null +++ b/keyboards/lazydesigners/the60/info.json @@ -0,0 +1,79 @@ +{ + "keyboard_name": "THE60", + "url": "http://lazydesigners.cn", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_split_spc_split_bspc": { + "key_count": 66, + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Home", "x":13, "y":0}, + {"label":"Del", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"|", "x":11.5, "y":1, "w":1.5}, + {"label":"}", "x":13, "y":1}, + {"label":"{", "x":14, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":"Enter", "x":10.75, "y":2, "w":2.25}, + {"label":":", "x":13, "y":2}, + {"label":"\"", "x":14, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"Shift", "x":11.25, "y":3, "w":1.75}, + {"label":"Up", "x":13, "y":3}, + {"label":"/", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":2.25}, + {"x":6, "y":4, "w":2.75}, + {"label":"Alt", "x":8.75, "y":4, "w":1.25}, + {"label":"Menu", "x":10, "y":4}, + {"label":"Fn", "x":11, "y":4}, + {"label":"Left", "x":12, "y":4}, + {"label":"Down", "x":13, "y":4}, + {"label":"Right", "x":14, "y":4}] + } + } +} diff --git a/keyboards/lazydesigners/the60/keymaps/default/keymap.c b/keyboards/lazydesigners/the60/keymaps/default/keymap.c new file mode 100644 index 00000000000..8a95b447489 --- /dev/null +++ b/keyboards/lazydesigners/the60/keymaps/default/keymap.c @@ -0,0 +1,54 @@ +#include QMK_KEYBOARD_H + +enum custom_layers { + _QWERTY, + _FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,--------------------------------------------------------------------------. + * |Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Home|Del | + * |--------------------------------------------------------------------------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | BsPc | [ | ] | + * |--------------------------------------------------------------------------| + * |CapsLock | A | S | D | F | G | H | J | K | L | Enter | ; | ' | + * |--------------------------------------------------------------------------| + * | Shift | Z | X | C | V | B | N | M | , | . | Shift | Up | / | + * |--------------------------------------------------------------------------| + * | Ctrl | Gui | Alt | Space | Space | Alt |Menu| Fn |Left|Down|Rght| + * `--------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT_split_spc_split_bspc( +KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_HOME, KC_DEL, +KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_LBRC, KC_RBRC, +KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_SCLN, KC_QUOT, +KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, +KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_RALT, KC_APP, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT +), + +/* FN + * ,--------------------------------------------------------------------------. + * |RST | | | | | | | | | | | | |End |Ins | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | |PgUp|PgDn| + * |--------------------------------------------------------------------------| + * | | |Prev|Play|Next| |VolD|Mute|VolU| | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * |EEPRST| | | | | | | | | | | + * `--------------------------------------------------------------------------' + */ + +[_FN] = LAYOUT_split_spc_split_bspc( +RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_END, KC_INS, +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, +XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, +XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, +EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +) +}; + diff --git a/keyboards/lazydesigners/the60/keymaps/default/readme.md b/keyboards/lazydesigners/the60/keymaps/default/readme.md new file mode 100644 index 00000000000..7a5a10a34ac --- /dev/null +++ b/keyboards/lazydesigners/the60/keymaps/default/readme.md @@ -0,0 +1,32 @@ +# Default keymap for THE60 + + +## QWERTY (Normal) Layer +``` + ,--------------------------------------------------------------------------. + |Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Home|Del | + |--------------------------------------------------------------------------| + | Tab | Q | W | E | R | T | Y | U | I | O | P | BsPc | [ | ] | + |--------------------------------------------------------------------------| + |CapsLock | A | S | D | F | G | H | J | K | L | Enter | ; | ' | + |--------------------------------------------------------------------------| + | Shift | Z | X | C | V | B | N | M | , | . | Shift | Up | / | + |--------------------------------------------------------------------------| + | Ctrl | Gui | Alt | Space | Space | Alt |Menu| Fn |Left|Down|Rght| + `--------------------------------------------------------------------------' +``` + +## FN layer +``` + ,--------------------------------------------------------------------------. + |RST | | | | | | | | | | | | |End |Ins | + |--------------------------------------------------------------------------| + | | | | | | | | | | | | |PgUp|PgDn| + |--------------------------------------------------------------------------| + | | |Prev|Play|Next| |VolD|Mute|VolU| | | | | + |--------------------------------------------------------------------------| + | | | | | | | | | | | | | | + |--------------------------------------------------------------------------| + |EEPRST| | | | | | | | | | | + `--------------------------------------------------------------------------' +``` diff --git a/keyboards/lazydesigners/the60/readme.md b/keyboards/lazydesigners/the60/readme.md new file mode 100644 index 00000000000..bf7cc771af3 --- /dev/null +++ b/keyboards/lazydesigners/the60/readme.md @@ -0,0 +1,18 @@ +# THE60 + +![THE60](https://cdn.discordapp.com/attachments/536190211240099840/549506683064287243/image0.jpg) + +A 60% custom PCB and case designed and produced by [LazyDesigners](http://lazydesigners.cn). +The PCB allows one to test a 40% layout in a 60% case. + +Keyboard Maintainer: QMK Community +Hardware Supported: THE60 PCB +Hardware Availability: Check for GBs on [Geekhack](https://geekhack.org) and on [LazyDesigner's homepage.](http://lazydesigners.cn) + +Make example for this keyboard (after setting up your build environment): + + make lazydesigners/the60:default:dfu + +To enter the bootloader, either short the pins on the PCB, use the RESET button on the FN layer or hold the Esc key while plugging in your keyboard. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/lazydesigners/the60/rules.mk b/keyboards/lazydesigners/the60/rules.mk new file mode 100644 index 00000000000..76fb44b2c88 --- /dev/null +++ b/keyboards/lazydesigners/the60/rules.mk @@ -0,0 +1,51 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/lazydesigners/the60/the60.c b/keyboards/lazydesigners/the60/the60.c new file mode 100644 index 00000000000..09eeb63cf00 --- /dev/null +++ b/keyboards/lazydesigners/the60/the60.c @@ -0,0 +1,2 @@ +#include "the60.h" + diff --git a/keyboards/lazydesigners/the60/the60.h b/keyboards/lazydesigners/the60/the60.h new file mode 100644 index 00000000000..e3708461c4e --- /dev/null +++ b/keyboards/lazydesigners/the60/the60.h @@ -0,0 +1,32 @@ +#pragma once + +#include "quantum.h" + +/* + * ,--------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `--------------------------------------------------------------------------' + */ + +#define LAYOUT_split_spc_split_bspc( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K402, K403, K404, K407, K409, K410, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, KC_NO, KC_NO, K407, KC_NO, K409, K410, K411, K412, K413, K414 } \ +} + diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index c910d8f24f0..cfb6bf4ffcc 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h @@ -16,9 +16,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" - -#endif diff --git a/keyboards/lets_split/eeprom-lefthand.eep b/keyboards/lets_split/eeprom-lefthand.eep deleted file mode 100644 index bda23cdb6e9..00000000000 --- a/keyboards/lets_split/eeprom-lefthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0F000000000000000000000000000000000001F0 -:00000001FF diff --git a/keyboards/lets_split/eeprom-righthand.eep b/keyboards/lets_split/eeprom-righthand.eep deleted file mode 100644 index 549cd1ef0aa..00000000000 --- a/keyboards/lets_split/eeprom-righthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0F000000000000000000000000000000000000F1 -:00000001FF diff --git a/keyboards/lets_split/i2c.c b/keyboards/lets_split/i2c.c deleted file mode 100644 index 084c890c405..00000000000 --- a/keyboards/lets_split/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/lets_split/keymaps/DE_simple/keymap.c b/keyboards/lets_split/keymaps/DE_simple/keymap.c index d329bea4c04..32383ec67b3 100644 --- a/keyboards/lets_split/keymaps/DE_simple/keymap.c +++ b/keyboards/lets_split/keymaps/DE_simple/keymap.c @@ -19,10 +19,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwertz @@ -40,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, DE_Q, DE_W, DE_E, DE_R, DE_T, DE_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, \ KC_TAB, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, DE_PLUS, DE_HASH, \ KC_LSFT, DE_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, DE_COMM, DE_DOT, DE_MINS, KC_ENT , \ - KC_LCTL, KC_LALT, DE_ALGR, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_LCTL, KC_LALT, KC_ALGR, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower diff --git a/keyboards/lets_split/keymaps/DE_simple/readme.md b/keyboards/lets_split/keymaps/DE_simple/readme.md index 972cd6c398f..c5576d6233d 100644 --- a/keyboards/lets_split/keymaps/DE_simple/readme.md +++ b/keyboards/lets_split/keymaps/DE_simple/readme.md @@ -21,15 +21,15 @@ Layout `-----------------------------------------------------------------------------------' - Qwerty + Lower ,-----------------------------------------------------------------------------------. - | Esc | Q | W | E | R | T | Z | U | I | O | P | Bksp | + | ° | ! | " | § | $ | % | & | / | ( | ) | = | Bksp | |------+------+------+------+------+-------------+------+------+------+------+------| - | Tab | A | S | D | F | G | H | J | K | L | + | # | + | Del | F1 | F2 | F3 | F4 | F5 | F6 | @ | € | ü | ? | ´ | |------+------+------+------+------+------|------+------+------+------+------+------| - | Shift| Y | X | C | V | B | N | M | , | . | - |Enter | + | Shift| F7 | F8 | F9 | F10 | F11 | F12 | | | ö | ä | |Enter | |------+------+------+------+------+------+------+------+------+------+------+------| - | Ctrl | Alt | AltGr| GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + | | | | | | | | Next | Vol- | Vol+ | Play | `-----------------------------------------------------------------------------------' diff --git a/keyboards/lets_split/keymaps/OLED_sample/keymap.c b/keyboards/lets_split/keymaps/OLED_sample/keymap.c index 5eccbcf1ac3..0cf3503e439 100644 --- a/keyboards/lets_split/keymaps/OLED_sample/keymap.c +++ b/keyboards/lets_split/keymaps/OLED_sample/keymap.c @@ -37,19 +37,9 @@ enum custom_keycodes { RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL, + M_SAMPLE }; -enum macro_keycodes { - KC_SAMPLEMACRO, -}; - - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -//Macros -#define M_SAMPLE M(KC_SAMPLEMACRO) - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -282,6 +272,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case M_SAMPLE: + if (record->event.pressed){ + SEND_STRING("hello world"); + } + return false; } return true; } @@ -332,27 +327,6 @@ void music_scale_user(void) #endif -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - - switch (id) { - case KC_SAMPLEMACRO: - if (record->event.pressed){ - return MACRO (I(10), T(H), T(E), T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); - } - - } - - return MACRO_NONE; -} - - void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { if (memcmp(dest->display, source->display, sizeof(dest->display))) { diff --git a/keyboards/lets_split/keymaps/OLED_sample/rules.mk b/keyboards/lets_split/keymaps/OLED_sample/rules.mk index a14e84d4e5c..89ad61fbe81 100644 --- a/keyboards/lets_split/keymaps/OLED_sample/rules.mk +++ b/keyboards/lets_split/keymaps/OLED_sample/rules.mk @@ -1,25 +1,22 @@ +SRC += ssd1306.c # Build Options # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SWAP_HANDS_ENABLE = no # Enable one-hand typing +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/lets_split/keymaps/adam/keymap.c b/keyboards/lets_split/keymaps/adam/keymap.c index b986ab780bd..a5ad8e32e8b 100644 --- a/keyboards/lets_split/keymaps/adam/keymap.c +++ b/keyboards/lets_split/keymaps/adam/keymap.c @@ -11,10 +11,6 @@ extern keymap_config_t keymap_config; #define FLOCK 1 // symbols arrows and F keys on F held down #define JLOCK 2 // same as Flock but with fall thru J and mapped to J held down -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/bbaserdem/rules.mk b/keyboards/lets_split/keymaps/bbaserdem/rules.mk index 4159db3fee5..7a37e989d87 100755 --- a/keyboards/lets_split/keymaps/bbaserdem/rules.mk +++ b/keyboards/lets_split/keymaps/bbaserdem/rules.mk @@ -6,6 +6,3 @@ RGBLIGHT_ENABLE = yes # LED strips TAP_DANCE_ENABLE = no # Use multi-tap features AUDIO_ENABLE = no # Audio stuff -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk b/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk index 36b4b8fc255..d0b69206105 100755 --- a/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk +++ b/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk @@ -21,6 +21,3 @@ KEY_LOCK_ENABLE = no # Allows locking any key. Not used UNICODE_ENABLE = no # Used for unicode character emulation EXTRAKEY_ENABLE = no # OS signals like volume control -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/cpeters1982/keymap.c b/keyboards/lets_split/keymaps/cpeters1982/keymap.c index 9c3eb947521..8fa2bf6c042 100644 --- a/keyboards/lets_split/keymaps/cpeters1982/keymap.c +++ b/keyboards/lets_split/keymaps/cpeters1982/keymap.c @@ -37,12 +37,6 @@ qk_tap_dance_action_t tap_dance_actions[] = { }; */ - - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/cpeters1982/rules.mk b/keyboards/lets_split/keymaps/cpeters1982/rules.mk index f2fde785d4e..87136eef03e 100644 --- a/keyboards/lets_split/keymaps/cpeters1982/rules.mk +++ b/keyboards/lets_split/keymaps/cpeters1982/rules.mk @@ -1,8 +1,3 @@ +AUTO_SHIFT_ENABLE = yes +RGBLIGHT_ENABLE = yes - - -ifndef QUANTUM_DIR - include ../../../../Makefile - AUTO_SHIFT_ENABLE = yes - RGBLIGHT_ENABLE = yes -endif diff --git a/keyboards/lets_split/keymaps/default/config.h b/keyboards/lets_split/keymaps/default/config.h index 5a6261c4f7c..60e23f816d2 100644 --- a/keyboards/lets_split/keymaps/default/config.h +++ b/keyboards/lets_split/keymaps/default/config.h @@ -18,20 +18,19 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" + // place overrides here +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } /* Use I2C or Serial, not both */ - #define USE_SERIAL // #define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - -#endif diff --git a/keyboards/lets_split/keymaps/default/keymap.c b/keyboards/lets_split/keymaps/default/keymap.c index f782781843d..05f9bda8d8b 100644 --- a/keyboards/lets_split/keymaps/default/keymap.c +++ b/keyboards/lets_split/keymaps/default/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -extern keymap_config_t keymap_config; - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -16,15 +14,12 @@ extern keymap_config_t keymap_config; enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, + DVORAK }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -138,74 +133,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); } return false; - break; case COLEMAK: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); + set_single_persistent_default_layer(_COLEMAK); } return false; - break; case DVORAK: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); + set_single_persistent_default_layer(_DVORAK); } return false; - break; } return true; } diff --git a/keyboards/lets_split/keymaps/default/rules.mk b/keyboards/lets_split/keymaps/default/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/lets_split/keymaps/default/rules.mk +++ b/keyboards/lets_split/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/dlaroe/keymap.c b/keyboards/lets_split/keymaps/dlaroe/keymap.c index b2282e0fe8c..65dad2d3d81 100644 --- a/keyboards/lets_split/keymaps/dlaroe/keymap.c +++ b/keyboards/lets_split/keymaps/dlaroe/keymap.c @@ -31,10 +31,6 @@ enum custom_keycodes { EXT_PLV }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/fabian/keymap.c b/keyboards/lets_split/keymaps/fabian/keymap.c index 37053a8e4bf..518eb0e7311 100644 --- a/keyboards/lets_split/keymaps/fabian/keymap.c +++ b/keyboards/lets_split/keymaps/fabian/keymap.c @@ -40,9 +40,6 @@ enum custom_keycodes { EXT_PLV, }; -#define XXXXXXX KC_NO -#define _______ KC_TRNS - #define CTL_ESC CTL_T(KC_ESC) // Tap for Escape, hold for Control #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) #define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) diff --git a/keyboards/lets_split/keymaps/fabian/rules.mk b/keyboards/lets_split/keymaps/fabian/rules.mk index b8c82cb99d3..316a4b9cbf4 100644 --- a/keyboards/lets_split/keymaps/fabian/rules.mk +++ b/keyboards/lets_split/keymaps/fabian/rules.mk @@ -4,6 +4,3 @@ # # UNICODE_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/heartrobotninja/rules.mk b/keyboards/lets_split/keymaps/heartrobotninja/rules.mk index 36f5e5b6d55..21aae31dbab 100644 --- a/keyboards/lets_split/keymaps/heartrobotninja/rules.mk +++ b/keyboards/lets_split/keymaps/heartrobotninja/rules.mk @@ -20,6 +20,3 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/henxing/keymap.c b/keyboards/lets_split/keymaps/henxing/keymap.c index aab75dc543a..e3d7885cb87 100644 --- a/keyboards/lets_split/keymaps/henxing/keymap.c +++ b/keyboards/lets_split/keymaps/henxing/keymap.c @@ -17,10 +17,6 @@ enum custom_keycodes { RAISE }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* diff --git a/keyboards/lets_split/keymaps/khord/keymap.c b/keyboards/lets_split/keymaps/khord/keymap.c index 41042065d63..4209efabed7 100644 --- a/keyboards/lets_split/keymaps/khord/keymap.c +++ b/keyboards/lets_split/keymaps/khord/keymap.c @@ -17,10 +17,6 @@ enum custom_keycodes { SMSPC1 }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Tap Dance Declarations enum { SFT_CAP = 0 diff --git a/keyboards/lets_split/keymaps/khord/rules.mk b/keyboards/lets_split/keymaps/khord/rules.mk index c90523e5d64..32b6edc121a 100644 --- a/keyboards/lets_split/keymaps/khord/rules.mk +++ b/keyboards/lets_split/keymaps/khord/rules.mk @@ -2,6 +2,3 @@ TAP_DANCE_ENABLE = yes RGBLIGHT_ENABLE = yes USE_I2C = no -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/kris/keymap.c b/keyboards/lets_split/keymaps/kris/keymap.c index 34d2e86da03..ee47d7999a0 100644 --- a/keyboards/lets_split/keymaps/kris/keymap.c +++ b/keyboards/lets_split/keymaps/kris/keymap.c @@ -23,10 +23,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/krusli/keymap.c b/keyboards/lets_split/keymaps/krusli/keymap.c index 9b49bab3b41..002d22d302d 100644 --- a/keyboards/lets_split/keymaps/krusli/keymap.c +++ b/keyboards/lets_split/keymaps/krusli/keymap.c @@ -25,10 +25,6 @@ enum custom_keycodes { NUMPAD }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/mbsurfer/keymap.c b/keyboards/lets_split/keymaps/mbsurfer/keymap.c index 5f6589337f8..da49f0c7aaf 100644 --- a/keyboards/lets_split/keymaps/mbsurfer/keymap.c +++ b/keyboards/lets_split/keymaps/mbsurfer/keymap.c @@ -24,10 +24,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Tap Dance Declarations enum { SFT_CAP = 0, diff --git a/keyboards/lets_split/keymaps/mbsurfer/rules.mk b/keyboards/lets_split/keymaps/mbsurfer/rules.mk index c90523e5d64..32b6edc121a 100644 --- a/keyboards/lets_split/keymaps/mbsurfer/rules.mk +++ b/keyboards/lets_split/keymaps/mbsurfer/rules.mk @@ -2,6 +2,3 @@ TAP_DANCE_ENABLE = yes RGBLIGHT_ENABLE = yes USE_I2C = no -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/mjt/keymap.c b/keyboards/lets_split/keymaps/mjt/keymap.c index 2c61cce3bc2..b0394659cc5 100644 --- a/keyboards/lets_split/keymaps/mjt/keymap.c +++ b/keyboards/lets_split/keymaps/mjt/keymap.c @@ -23,10 +23,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/mjt/rules.mk b/keyboards/lets_split/keymaps/mjt/rules.mk index a14e84d4e5c..a43a9a1daa0 100644 --- a/keyboards/lets_split/keymaps/mjt/rules.mk +++ b/keyboards/lets_split/keymaps/mjt/rules.mk @@ -20,6 +20,3 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/lets_split/keymaps/mtdjr/rules.mk b/keyboards/lets_split/keymaps/mtdjr/rules.mk index 75e9c6503e8..a81250cdf6d 100644 --- a/keyboards/lets_split/keymaps/mtdjr/rules.mk +++ b/keyboards/lets_split/keymaps/mtdjr/rules.mk @@ -1,5 +1,2 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - RGBLIGHT_ENABLE = yes + diff --git a/keyboards/lets_split/keymaps/normacos/keymap.c b/keyboards/lets_split/keymaps/normacos/keymap.c index 8902b7b56f5..b6b6b1c141b 100644 --- a/keyboards/lets_split/keymaps/normacos/keymap.c +++ b/keyboards/lets_split/keymaps/normacos/keymap.c @@ -26,10 +26,6 @@ enum custom_keycodes { CHROME }; -// Fillers (to make layering more clear) -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Mod taps #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift #define CTL_ESC CTL_T(KC_ESC) // Tap for Escape, hold for Control diff --git a/keyboards/lets_split/keymaps/piemod/README.md b/keyboards/lets_split/keymaps/piemod/README.md index f2a051da14e..6bae7e76d94 100644 --- a/keyboards/lets_split/keymaps/piemod/README.md +++ b/keyboards/lets_split/keymaps/piemod/README.md @@ -17,9 +17,6 @@ A keymap for users that need: Still a work-in-progress. Suggestions welcome @ https://github.com/dwrz/piemod. -### Keymap - -![PieMod Keymap](./keymap.png) ### TODO diff --git a/keyboards/lets_split/keymaps/pitty/keymap.c b/keyboards/lets_split/keymaps/pitty/keymap.c index 0fd4c1384f1..d723e0c026d 100644 --- a/keyboards/lets_split/keymaps/pitty/keymap.c +++ b/keyboards/lets_split/keymaps/pitty/keymap.c @@ -20,11 +20,6 @@ enum custom_keycodes { VIM, }; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/pitty/rules.mk b/keyboards/lets_split/keymaps/pitty/rules.mk index 8ebc85a44b4..53a426157e8 100644 --- a/keyboards/lets_split/keymaps/pitty/rules.mk +++ b/keyboards/lets_split/keymaps/pitty/rules.mk @@ -1,6 +1,3 @@ RGBLIGHT_ENABLE = yes NKRO_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/poker/keymap.c b/keyboards/lets_split/keymaps/poker/keymap.c index cce0ca47411..7b202409e30 100644 --- a/keyboards/lets_split/keymaps/poker/keymap.c +++ b/keyboards/lets_split/keymaps/poker/keymap.c @@ -25,10 +25,6 @@ enum custom_keycodes { ADJUST }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/poker/rules.mk b/keyboards/lets_split/keymaps/poker/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/lets_split/keymaps/poker/rules.mk +++ b/keyboards/lets_split/keymaps/poker/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/pyrol/keymap.c b/keyboards/lets_split/keymaps/pyrol/keymap.c index 23d779232fb..1a6cd758663 100644 --- a/keyboards/lets_split/keymaps/pyrol/keymap.c +++ b/keyboards/lets_split/keymaps/pyrol/keymap.c @@ -1,4 +1,4 @@ -#include QMK_KEYBOARD_h +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -24,10 +24,6 @@ enum custom_keycodes { GAME, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/smt/keymap.c b/keyboards/lets_split/keymaps/smt/keymap.c index 090cf78b7cb..1b9b448008e 100644 --- a/keyboards/lets_split/keymaps/smt/keymap.c +++ b/keyboards/lets_split/keymaps/smt/keymap.c @@ -23,10 +23,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift diff --git a/keyboards/lets_split/keymaps/that_canadian/keymap.c b/keyboards/lets_split/keymaps/that_canadian/keymap.c index 239a8d3beee..07a165ad89f 100644 --- a/keyboards/lets_split/keymaps/that_canadian/keymap.c +++ b/keyboards/lets_split/keymaps/that_canadian/keymap.c @@ -22,10 +22,6 @@ enum custom_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -160,4 +156,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/lets_split/keymaps/tylerwince/config.h b/keyboards/lets_split/keymaps/tylerwince/config.h new file mode 100644 index 00000000000..6fff5478da9 --- /dev/null +++ b/keyboards/lets_split/keymaps/tylerwince/config.h @@ -0,0 +1,40 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +//#define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLED_NUM 12 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + diff --git a/keyboards/lets_split/keymaps/tylerwince/keymap.c b/keyboards/lets_split/keymaps/tylerwince/keymap.c new file mode 100644 index 00000000000..c781513c485 --- /dev/null +++ b/keyboards/lets_split/keymaps/tylerwince/keymap.c @@ -0,0 +1,239 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum layer_names { + _QWERTY = 0, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + SH_GOUP, +}; + +//Tap Dance Declarations +enum { + TD_SEMI_COLON, +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SEMI_COLON] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLN), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,------------------------------------------ ------------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | BSPC | + * |------+------+------+------+------+------- -------+------+------+------+------+------| + * |CTL/Es| A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * |Things|1PASS | alt | CMD |Lower |Space | |Space |Raise | Next | Vol- | Vol+ | Play | + * `------------------------------------------ ------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD(TD_SEMI_COLON), KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + RALT(KC_SPC), RGUI(KC_BSLS), KC_LALT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Colemak + * ,------------------------------------------ ------------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------- -------+------+------+------+------+------| + * |CTL/Es| A | R | S | T | D | | H | N | E | I | O | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * |Things|1PASS | alt | CMD |Lower |Space | |Space |Raise | Next | Vol- | Vol+ | Play | + * `------------------------------------------ ------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, TD(TD_SEMI_COLON), KC_BSPC, + CTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + RALT(KC_SPC), RGUI(KC_BSLS), KC_LALT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Dvorak + * ,------------------------------------------ ------------------------------------------. + * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------- -------+------+------+------+------+------| + * |CTL/Es| A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | ; | Q | J | K | X | | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * |Things|1PASS | alt | CMD |Lower |Space | |Space |Raise | Next | Vol- | Vol+ | Play | + * `------------------------------------------ ------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, TD(TD_SEMI_COLON), KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + RALT(KC_SPC), RGUI(KC_BSLS), KC_LALT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Lower + * ,------------------------------------------ ------------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------- -------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | | | _ | + | { | } | | | + * +------+------+------+------+------|------+ |------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | | - | = | [ | ] | | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * |Things|1PASS | alt | CMD |Lower |Space | |Space |Raise | Next | Vol- | Vol+ | Play | + * `------------------------------------------ ------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + RALT(KC_SPC), RGUI(KC_BSLS), KC_LALT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,------------------------------------------ ------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------- -------+------+------+------+------+------| + * | Del | | | | | | | LEFT | DOWN | UP |RIGHT | | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * |Things|1PASS | alt | CMD |Lower |Space | |Space |Raise | Next | Vol- | Vol+ | Play | + * `------------------------------------------ ------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RALT(KC_SPC), RGUI(KC_BSLS), KC_LALT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,------------------------------------------ ------------------------------------------. + * | | Reset| | | | | | |Qwerty|Colemk|Dvorak|WTLEFT|WTRGHT| + * |------+------+------+------+------+------- -------+------+------+------+------+------| + * | | |Aud on|Audoff|AGnorm|AGswap| |WLEFT |WDOWN | WUP |WRGHT |WBLEFT|WBRGHT| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | |RGBsUP|RGBsDN|RGBvUP|RGBvDN|WFULL | + * |------+------+------+------+------+------+ +------+------+------+------+------+------| + * | | | | | | | | | |RGBwav|RGBfla|RGBtog| | + * `------------------------------------------ ------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( + _______, RESET, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, LCA(KC_7), LCA(KC_8), + _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, LCA(KC_H), LCA(KC_J), LCA(KC_K), LCA(KC_L), LCA(KC_U), LCA(KC_I), + _______, _______, _______, _______, _______, _______, _______, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, LCA(KC_ENT), + _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_K, RGB_M_B, RGB_TOG, _______ +) + + +}; + +void keyboard_post_init_user(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + layer_state_set_user(layer_state); + #endif +} +void set_qwerty(void){ + rgblight_sethsv_noeeprom(255, 0, 160); +} +void set_lower(void){ + rgblight_sethsv_master(255, 255, 255); + rgblight_sethsv_slave(255, 0, 160); +} +void set_raise(void){ + rgblight_sethsv_slave(35, 255, 255); + rgblight_sethsv_master(255, 0, 160); +} +void set_adjust(void){ + rgblight_sethsv_slave(35, 255, 255); + rgblight_sethsv_master(255, 255, 255); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + set_qwerty(); + #endif + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + set_single_persistent_default_layer(_DVORAK); + } + return false; + case LOWER: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + set_lower(); + #endif + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + set_qwerty(); + #endif + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + set_raise(); + #endif + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + set_qwerty(); + #endif + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case ADJUST: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + set_adjust(); + #endif + layer_on(_ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + set_qwerty(); + #endif + layer_off(_ADJUST); + } + return false; + } + return true; +} + diff --git a/keyboards/lets_split/keymaps/tylerwince/rules.mk b/keyboards/lets_split/keymaps/tylerwince/rules.mk new file mode 100644 index 00000000000..3cfa539f362 --- /dev/null +++ b/keyboards/lets_split/keymaps/tylerwince/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE=yes +TAP_DANCE_ENABLE=yes diff --git a/keyboards/lets_split/keymaps/vim-mode/config.h b/keyboards/lets_split/keymaps/vim-mode/config.h new file mode 100644 index 00000000000..25512a5c97c --- /dev/null +++ b/keyboards/lets_split/keymaps/vim-mode/config.h @@ -0,0 +1,39 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// comment the following lines if sounds are not desired +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + diff --git a/keyboards/lets_split/keymaps/vim-mode/keymap.c b/keyboards/lets_split/keymaps/vim-mode/keymap.c new file mode 100644 index 00000000000..4b25aa5dc75 --- /dev/null +++ b/keyboards/lets_split/keymaps/vim-mode/keymap.c @@ -0,0 +1,196 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_names { + _QWERTY = 0, + _COLEMAK = 1, + _DVORAK = 2, + _LOWER = 3, + _RAISE = 4, + _ADJUST = 16 +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear + +// keys in multiple locations: +// - parenteses in both raise and lower +// - asterix in raise and twice on lower (normal and numpad) +// - minus/plus twice on lower (normal and numpad) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| PrtSc| GUI | Alt |Lower | Tab |Space |Raise | VolDn| VolUp| Pl/Ps| Next | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12 ( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTRL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_PSCR, KC_LGUI, KC_LALT, LOWER, KC_TAB, KC_SPC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MNXT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| PrtSc| GUI | Alt |Lower | Tab |Space |Raise | VolDn| VolUp| Pl/Ps| Next | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_PSCR, KC_LGUI, KC_LALT, LOWER, KC_TAB, KC_SPC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MNXT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Esc | ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| PrtSc| GUI | Alt |Lower | Tab |Space |Raise | VolDn| VolUp| Pl/Ps| Next | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_PSCR, KC_LGUI, KC_LALT, LOWER, KC_TAB, KC_SPC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MNXT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | | * | ( | ) | | | 7 | 8 | 9 | * | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | _ | + | { | } | | | 4 | 5 | 6 | - | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | - | = | [ | ] | | | 1 | 2 | 3 | + | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Alt | | | | 0 | . | Enter| | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_GRAVE,_______, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, KC_7, KC_8, KC_9, KC_ASTR, _______, \ + KC_DEL, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, KC_4, KC_5, KC_6, KC_MINS, KC_BSLS, \ + KC_NLCK, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______, KC_1, KC_2, KC_3, KC_PLUS, _______, \ + _______, _______, _______, KC_LALT, _______, _______, _______, _______, KC_0, KC_DOT, KC_ENT, _______ \ +), + +/* Raise: featuring vim-style hjkl arrow keys + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | Left | Down | Up |Right | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F6 | F7 | F8 | F9 | F10 | Home | PgDn | PgUp | End | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F11 | F12 | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, KC_PIPE, \ + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ + _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| |QWERTY|Colemk|Dvorak| | Prev | Pl/Ps| Next | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Mute | VolDn| VolUp| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, QWERTY, COLEMAK, DVORAK, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_DEL, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/lets_split/keymaps/vim-mode/readme.md b/keyboards/lets_split/keymaps/vim-mode/readme.md new file mode 100644 index 00000000000..9bb6131b1c4 --- /dev/null +++ b/keyboards/lets_split/keymaps/vim-mode/readme.md @@ -0,0 +1,22 @@ +# Vim-mode Keymap + +This layout is designed with the vim philosophy in mind: You should be able to do your work without lifting your hands off the keyboard. Some movement keys (like the arrow keys) have been directly borrowed from vim, and other keys (like the numpad) have been placed in easy-to-reach areas, following the vim philosophy. + +Based on the default keymap. + +## Features: + +* Vim-like `hjkl` arrow keys in raise layer. +* Right-hand numpad in lower layer. +* All brackets and the most frequently used operators are intuitively handled in the lower layer for easy access. +* Ctrl is just to the left of the left-hand pinky. +* The raise layer provides the symbol bar on the first row that you're used to. +* Media keys available in adjust layer (complete) and in the bottom-right corner of the default layer (frequently used). +* The two keys that are traditionally the keys for `space` behave differently. The right-hand key inserts a space. The left-hand key inserts a tab. This is intuitive: Both keys that would normally make up the spacebar are increasing the space, but in different manners. + + +## Some things to look out for: + +* Page up, page down, home, and end have been placed directly under the `hjkl` arrow keys, and each key moves the same direction as the key above it. (for instance, `h` moves left. Home has therefore been placed on `n`). You may ask why this was done instead of placing page down on `f` and page up on `b`. Here's why: + * In short, `f` and `b` are in prime locations for other types of keys, and using those keys for page down and page up would interrupt the space available for other keys. Using vim-style `f` and `b` would require either divide up the list of function keys with unrelated keys, which is unintuitive, or move all the function keys to another later, requiring restructuring that does not lend itself to an intuitive layout. +* Audio is not tested. If it doesn't work, please open an issue. diff --git a/keyboards/lets_split/keymaps/vim-mode/rules.mk b/keyboards/lets_split/keymaps/vim-mode/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/lets_split/keymaps/waples/keymap.c b/keyboards/lets_split/keymaps/waples/keymap.c index 7b25bc51f54..42b86aad2a3 100644 --- a/keyboards/lets_split/keymaps/waples/keymap.c +++ b/keyboards/lets_split/keymaps/waples/keymap.c @@ -25,8 +25,6 @@ enum letssplit_keycodes { #define TG_NKRO MAGIC_TOGGLE_NKRO // Toggle NKRO #define CTLESC MT(MOD_LCTL, KC_ESC) // Hold for left Ctrl, tap for Esc #define SHFTENT MT(MOD_RSFT, KC_ENT) // Hold for right Shift, tap for Enter -#define _______ KC_TRNS -#define XXXXXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/lets_split/keymaps/waples/rules.mk b/keyboards/lets_split/keymaps/waples/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/lets_split/keymaps/waples/rules.mk +++ b/keyboards/lets_split/keymaps/waples/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/xk/keymap.c b/keyboards/lets_split/keymaps/xk/keymap.c index c032b865aac..89197beb07c 100755 --- a/keyboards/lets_split/keymaps/xk/keymap.c +++ b/keyboards/lets_split/keymaps/xk/keymap.c @@ -60,9 +60,6 @@ WINSH, OSX, }; -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // action-TAP for key/mod behavior LT(layer, KC) #define XK_TAB LT(_FNCTION, KC_TAB) #define XK_BSP LT(_KAMELOC, KC_BSPC) diff --git a/keyboards/lets_split/keymaps/xk/rules.mk b/keyboards/lets_split/keymaps/xk/rules.mk index 195f0157789..8aafefa64f2 100644 --- a/keyboards/lets_split/keymaps/xk/rules.mk +++ b/keyboards/lets_split/keymaps/xk/rules.mk @@ -14,6 +14,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/keymaps/yshrsmz/keymap.c b/keyboards/lets_split/keymaps/yshrsmz/keymap.c index 52a0d2b8341..ccb3557b4a9 100644 --- a/keyboards/lets_split/keymaps/yshrsmz/keymap.c +++ b/keyboards/lets_split/keymaps/yshrsmz/keymap.c @@ -20,10 +20,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/lets_split/keymaps/zer09/keymap.c b/keyboards/lets_split/keymaps/zer09/keymap.c index 8d0eaf14116..cb6744433a4 100644 --- a/keyboards/lets_split/keymaps/zer09/keymap.c +++ b/keyboards/lets_split/keymaps/zer09/keymap.c @@ -9,8 +9,15 @@ extern keymap_config_t keymap_config; TD(DA_UPLY), MO(_VL), KC_TAB, KC_BSPACE, KC_ESC, /**/KC_INS, KC_HOME, KC_PGUP, MO(_VL), TD(DA_UPLY), \ TD(DA_DWLY), TD(DA_LCTL), KC_SPC, TD(DA_LSPR), LSFT_T(KC_CAPS),/**/SFT_T(KC_CAPS), TD(DA_RALT), KC_ENT, TD(DA_RCTL), TD(DA_DWLY)) +#define _GMLayer LAYOUT( \ + KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, /**/KC_F, KC_G, KC_C, KC_R, KC_L, \ + KC_A, KC_O, KC_E, KC_U, KC_I, /**/KC_D, KC_H, ALT_T(KC_T), SFT_T(KC_N), CTL_T(KC_S), \ + KC_SCOLON, KC_Q, KC_J, KC_K, KC_X, /**/KC_B, KC_M, KC_W, KC_V, KC_Z, \ + TD(DA_UPLY), MO(_VL), KC_TAB, KC_BSPACE, KC_ESC, /**/KC_INS, KC_HOME, KC_PGUP, MO(_VL), TD(DA_UPLY), \ + TD(DA_DWLY), TD(DA_LCTL), KC_SPC, TD(DA_LSPR), LSFT_T(KC_CAPS),/**/SFT_T(KC_CAPS), TD(DA_RALT), KC_ENT, TD(DA_RCTL), TD(DA_DWLY)) + #define _upLayer LAYOUT( \ - KC_4, KC_5, KC_6, _______, _______,/**/ _______, KC_RBRC, _______, _______, _______, \ + KC_4, KC_5, KC_6, KC_YREG, _______,/**/ _______, KC_RBRC, _______, _______, _______, \ LCTL_T(KC_1), LSFT_T(KC_2), LALT_T(KC_3), _______, _______,/**/ KC_LBRC, KC_BSLS, _______, _______, _______, \ KC_7, KC_8, KC_9, KC_0, KC_GRV, /**/ KC_SLSH, _______, _______, _______, _______, \ _______, _______, _______, _______, _______,/**/ KC_DEL, KC_END, KC_PGDN, _______, _______, \ @@ -35,4 +42,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_UL] = _upLayer, [_DL] = _downLayer, [_VL] = _upLayer, - [_AL] = _astdLayer}; + [_AL] = _astdLayer, + [_GM] = _GMLayer}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch (keycode) { + case YREG: + SEND_STRING("\"0p"); + return false; + } + } + + return true; +} diff --git a/keyboards/lets_split/keymaps/zer09/rules.mk b/keyboards/lets_split/keymaps/zer09/rules.mk index d8adc708826..d2259fe9d5b 100644 --- a/keyboards/lets_split/keymaps/zer09/rules.mk +++ b/keyboards/lets_split/keymaps/zer09/rules.mk @@ -1,6 +1,3 @@ RGBLIGHT_ENABLE = yes TAP_DANCE_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split/lets_split.h b/keyboards/lets_split/lets_split.h index bce0ecb1992..9c46f382d19 100644 --- a/keyboards/lets_split/lets_split.h +++ b/keyboards/lets_split/lets_split.h @@ -1,5 +1,4 @@ -#ifndef LETS_SPLIT_H -#define LETS_SPLIT_H +#pragma once #include "quantum.h" @@ -27,5 +26,3 @@ ) #define LAYOUT_kc_ortho_4x12 LAYOUT_kc - -#endif diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c deleted file mode 100644 index f753d234a19..00000000000 --- a/keyboards/lets_split/matrix.c +++ /dev/null @@ -1,470 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -__attribute__ ((weak)) -void matrix_slave_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif - matrix_slave_scan_user(); -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/lets_split/readme.md b/keyboards/lets_split/readme.md index 80fe08b93c9..2a2b95c0971 100644 --- a/keyboards/lets_split/readme.md +++ b/keyboards/lets_split/readme.md @@ -151,13 +151,13 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep" // or the equivalent in dfu-programmer ``` and similarly for right half ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-righthand.eep" // or the equivalent in dfu-programmer ``` diff --git a/keyboards/lets_split/rev1/config.h b/keyboards/lets_split/rev1/config.h index c0e4d1fbce4..c6e7f6479ec 100644 --- a/keyboards/lets_split/rev1/config.h +++ b/keyboards/lets_split/rev1/config.h @@ -16,10 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include "config_common.h" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -46,18 +43,16 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 @@ -80,5 +75,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/lets_split/rev1/rev1.h b/keyboards/lets_split/rev1/rev1.h index 073d83ef347..a43d4a25ba0 100644 --- a/keyboards/lets_split/rev1/rev1.h +++ b/keyboards/lets_split/rev1/rev1.h @@ -1,5 +1,4 @@ -#ifndef REV1_H -#define REV1_H +#pragma once #include "lets_split.h" @@ -26,5 +25,3 @@ } #define LAYOUT_ortho_4x12 LAYOUT - -#endif diff --git a/keyboards/lets_split/rev2/config.h b/keyboards/lets_split/rev2/config.h index 1ff25cd480a..2481ce0413e 100644 --- a/keyboards/lets_split/rev2/config.h +++ b/keyboards/lets_split/rev2/config.h @@ -16,10 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV2_CONFIG_H -#define REV2_CONFIG_H - -#include "config_common.h" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -46,18 +43,16 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 @@ -80,6 +75,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - - -#endif diff --git a/keyboards/lets_split/rev2/rev2.h b/keyboards/lets_split/rev2/rev2.h index bf25ee85688..34e64e89f1f 100644 --- a/keyboards/lets_split/rev2/rev2.h +++ b/keyboards/lets_split/rev2/rev2.h @@ -1,5 +1,4 @@ -#ifndef REV2_H -#define REV2_H +#pragma once #include "lets_split.h" @@ -58,5 +57,3 @@ #endif #define LAYOUT_ortho_4x12 LAYOUT - -#endif diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk index 4cd972786f4..f9d1a0dadb4 100644 --- a/keyboards/lets_split/rules.mk +++ b/keyboards/lets_split/rules.mk @@ -1,11 +1,4 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c \ - ssd1306.c - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -42,7 +35,7 @@ F_USB = $(F_CPU) # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -64,13 +57,12 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes LAYOUTS = ortho_4x12 diff --git a/keyboards/lets_split/serial.c b/keyboards/lets_split/serial.c deleted file mode 100644 index 74bcbb6bf6e..00000000000 --- a/keyboards/lets_split/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/lets_split/serial.h b/keyboards/lets_split/serial.h deleted file mode 100644 index 15fe4db7b4c..00000000000 --- a/keyboards/lets_split/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/lets_split/sockets/config.h b/keyboards/lets_split/sockets/config.h index a45cdd13bb3..2d3e68610e9 100644 --- a/keyboards/lets_split/sockets/config.h +++ b/keyboards/lets_split/sockets/config.h @@ -16,10 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef SOCKETS_CONFIG_H -#define SOCKETS_CONFIG_H - -#include "config_common.h" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xBEE5 @@ -46,18 +43,16 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D4 @@ -86,5 +81,11 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION +#ifdef USE_Link_Time_Optimization + // LTO has issues with macros (action_get_macro) and "functions" (fn_actions), + // so just disable them + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION -#endif + #define DISABLE_LEADER +#endif // USE_Link_Time_Optimization \ No newline at end of file diff --git a/keyboards/lets_split/sockets/rules.mk b/keyboards/lets_split/sockets/rules.mk index e14d18d8de4..da04decf403 100644 --- a/keyboards/lets_split/sockets/rules.mk +++ b/keyboards/lets_split/sockets/rules.mk @@ -1,3 +1,5 @@ BACKLIGHT_ENABLE = no AUDIO_ENABLE = yes RGBLIGHT_ENABLE = yes #Don't enable this along with I2C + +EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization diff --git a/keyboards/lets_split/sockets/sockets.h b/keyboards/lets_split/sockets/sockets.h index bd1019263ce..a79770bac6f 100644 --- a/keyboards/lets_split/sockets/sockets.h +++ b/keyboards/lets_split/sockets/sockets.h @@ -1,5 +1,4 @@ -#ifndef SOCKETS_H -#define SOCKETS_H +#pragma once #define DISABLE_JTAG // The keyboard uses PF4 and PF7, which are used by JTAG. #include "lets_split.h" @@ -59,5 +58,3 @@ #endif #define LAYOUT_ortho_4x12 LAYOUT - -#endif diff --git a/keyboards/lets_split/split_util.c b/keyboards/lets_split/split_util.c deleted file mode 100644 index 346cbc90894..00000000000 --- a/keyboards/lets_split/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/lets_split_eh/README.md b/keyboards/lets_split_eh/README.md index 185e74dab0a..180cb33d73d 100644 --- a/keyboards/lets_split_eh/README.md +++ b/keyboards/lets_split_eh/README.md @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make lets_split_eh/eh:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/lets_split_eh/config.h b/keyboards/lets_split_eh/config.h index b8fe95ea2bc..655d35e1ab2 100644 --- a/keyboards/lets_split_eh/config.h +++ b/keyboards/lets_split_eh/config.h @@ -34,11 +34,9 @@ along with this program. If not, see . #define MATRIX_COLS 6 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +/* serial.c configuration for split keyboard */ +//#define SOFT_SERIAL_PIN D0 #endif diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk b/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk index 4159db3fee5..7a37e989d87 100755 --- a/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk +++ b/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk @@ -6,6 +6,3 @@ RGBLIGHT_ENABLE = yes # LED strips TAP_DANCE_ENABLE = no # Use multi-tap features AUDIO_ENABLE = no # Audio stuff -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split_eh/keymaps/default/config.h b/keyboards/lets_split_eh/keymaps/default/config.h index a1df337bd92..c535299e74a 100644 --- a/keyboards/lets_split_eh/keymaps/default/config.h +++ b/keyboards/lets_split_eh/keymaps/default/config.h @@ -18,9 +18,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif \ No newline at end of file + // place overrides here diff --git a/keyboards/lets_split_eh/keymaps/default/keymap.c b/keyboards/lets_split_eh/keymaps/default/keymap.c index 8ef97357495..1983459f683 100644 --- a/keyboards/lets_split_eh/keymaps/default/keymap.c +++ b/keyboards/lets_split_eh/keymaps/default/keymap.c @@ -1,30 +1,19 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. #define _QWERTY 0 - #define _LOWER 3 #define _RAISE 4 #define _FUNCTION 15 #define _ADJUST 16 -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FUNCTION MO(_FUNCTION) +#define ADJUST MO(_ADJUST) // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) @@ -45,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = LAYOUT( \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + FUNCTION, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, \ KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), @@ -90,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * |Taskmg| | | | | | | |RGBVAI|RGBSAI|RGBHUI|caltde| * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | |Qwerty|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * | | | | | | | | |RGBVAD|RGBSAD|RGBHUD|RGBTOG| * |------+------+------+------+------+------|------+------+------+------+------+------| * | | | | | | | | | | | |BLSTEP| * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -99,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = LAYOUT( \ TSKMGR, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAI, RGB_HUI, CALTDEL, \ - _______, _______, _______, _______, _______, _______, _______, QWERTY, RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, \ + _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ ), @@ -124,47 +113,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } return true; -} \ No newline at end of file +} diff --git a/keyboards/lets_split_eh/keymaps/default/rules.mk b/keyboards/lets_split_eh/keymaps/default/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/lets_split_eh/keymaps/default/rules.mk +++ b/keyboards/lets_split_eh/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c b/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c index 8976081542d..721312623e3 100644 --- a/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c +++ b/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c @@ -1,6 +1,4 @@ -#include "eeconfig.h" - -extern keymap_config_t keymap_config; +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/lets_split_eh/keymaps/msiu/config.h b/keyboards/lets_split_eh/keymaps/msiu/config.h new file mode 100644 index 00000000000..526c0837c72 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/msiu/config.h @@ -0,0 +1,21 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once diff --git a/keyboards/lets_split_eh/keymaps/msiu/keymap.c b/keyboards/lets_split_eh/keymaps/msiu/keymap.c new file mode 100644 index 00000000000..af5c98241a4 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/msiu/keymap.c @@ -0,0 +1,195 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _DVORAK 1 + +#define _LOWER 3 +#define _RAISE 4 + +#define _NUMB 14 +#define _FUNC 15 +#define _ADJUST 16 + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + LOWER, + RAISE, + ADJUST +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Hyper | Alt | GUI |Lower | Func |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + LT(_NUMB, KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_HYPR, KC_LALT, KC_LGUI, LOWER, MO(_FUNC), KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +// Dvorak +[_DVORAK] = LAYOUT( \ + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, \ + _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______ , \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Esc | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Mute | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, \ + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | , | 0 | . |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, \ + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Taskmg| | | | | | | |RGBVAI|RGBSAI|RGBHUI|caltde| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |Qwerty|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | |BLSTEP| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | RESET| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + RGB_TOG, RGB_VAI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_MOD, RGB_VAD, RGB_SAD, RGB_HUD, _______, _______, _______, QWERTY, DVORAK, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ +), + +/* FUNC + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_PSCR, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +// Numpad +[_NUMB] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, KC_BSPC, \ + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______, _______ \ +) + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // case QWERTY: + // if (record->event.pressed) { + // persistent_default_layer_set(1UL<<_QWERTY); + // } + // return false; + // break; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/lets_split_eh/keymaps/resfury/config.h b/keyboards/lets_split_eh/keymaps/resfury/config.h new file mode 100644 index 00000000000..0055bbf459d --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/resfury/config.h @@ -0,0 +1,23 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define EE_HANDS \ No newline at end of file diff --git a/keyboards/lets_split_eh/keymaps/resfury/keymap.c b/keyboards/lets_split_eh/keymaps/resfury/keymap.c new file mode 100644 index 00000000000..17f790675bd --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/resfury/keymap.c @@ -0,0 +1,189 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum resfury_layers { + _COLEMAK, + _DVORAK, + _QWERTY +}; + +enum resfury_keycodes { + COLEMAK = SAFE_RANGE, + DVORAK, + QWERTY, +}; + +#define _LOWER 3 +#define _RAISE 4 +#define _FUNCTION 15 +#define _ADJUST 16 + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FUNCTION MO(_FUNCTION) +#define ADJUST MO(_ADJUST) + + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | F | P | G | J | L | U | Y | ; | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |F/TAB | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | Ent |Lower | Bksp | Spc | Raise| Left | Up | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT( \ + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, \ + LT(_FUNCTION,KC_TAB), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_RSFT), \ + KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \ +), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Esc | ' | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |F/TAB | A | O | E | U | I | D | H | T | R | L | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | Ent |Lower | Bksp | Spc | Raise| Left | Up | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT( \ + KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ + LT(_FUNCTION,KC_TAB), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ + OSM(MOD_LSFT), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, OSM(MOD_RSFT), \ + KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \ +), + + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |F/TAB | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | Ent |Lower | Bksp | Spc | Raise| Left | Up | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + LT(_FUNCTION,KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_RSFT), \ + KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Esc | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | ~ | ` | Mute | Ctl/ | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | Bksp | Spc |Adjust| Play | Vol+ | Vol- | Next | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), KC_GRV, KC_MUTE, RCTL(KC_BSLS), KC_PIPE, \ + _______, _______, _______, _______, _______, KC_BSPC, KC_SPC, ADJUST, KC_MPLY, KC_VOLU, KC_VOLD, KC_MNXT \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | - | + | - | = | [ | ] |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | 7 | 8 | 9 | * | / | * | / | . | Mute | Ctl/ | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | , | 0 | . |Adjust| Bksp | Spc |Raise | Play | Vol+ | Vol- | Next | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_MINS, KC_PLUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, \ + _______, KC_7, KC_8, KC_9, KC_ASTR, KC_SLSH, KC_ASTR, KC_SLSH, KC_DOT, KC_MUTE, RCTL(KC_BSLS), KC_BSLS, \ + _______, KC_COMM, KC_0, KC_DOT, ADJUST, KC_BSPC, KC_SPC, _______, KC_MPLY, KC_VOLU, KC_VOLD, KC_MNXT \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Taskmg| | | | | | | |RGBVAI|RGBSAI|RGBHUI|caltde| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |_COLEMAK| | | | | | | |RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |_DVORAK| | | | | | | | | |RGBMOD|BLSTEP| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |_QWERTY| | | | | | | | | | | RESET| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + TSKMGR, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAI, RGB_HUI, CALTDEL, \ + DF(_COLEMAK), _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, \ + DF(_DVORAK), _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, BL_STEP, \ + DF(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ +), + +/* Function + * ,-----------------------------------------------------------------------------------. + * | Caps | | | | | | S(Hm)| Home | Up | End |S(End)| | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Ctrl | Shift| Alt | | | | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT( \ + KC_CAPS, _______, _______, _______, _______, _______, S(KC_HOME), KC_HOME, KC_UP, KC_END, S(KC_END), _______, \ + _______, KC_LCTL, KC_LSFT, KC_LALT, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + } + return true; +} diff --git a/keyboards/lets_split_eh/keymaps/resfury/readme.md b/keyboards/lets_split_eh/keymaps/resfury/readme.md new file mode 100644 index 00000000000..6a882307b7e --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/resfury/readme.md @@ -0,0 +1,7 @@ +![Let's Split Eh?](https://imgur.com/a/riUxwpl) + +# ResFury Let's Split, Eh Layout + +This layout specializes the Let's Split, Eh for Colevrak users that occasionally let others play with their toys. Adjust layer allows swapping to Colemak/Dvorak/Qwerty alphas. Heavily influenced by the default planck layout, but with up/down switched, a left hand 10-key, remapped backspace, and a few convenience keys. + +Master set by EE_HANDS method. \ No newline at end of file diff --git a/keyboards/lets_split_eh/keymaps/resfury/rules.mk b/keyboards/lets_split_eh/keymaps/resfury/rules.mk new file mode 100644 index 00000000000..7ad666d1a38 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/resfury/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/lets_split_eh/keymaps/that_canadian/keymap.c b/keyboards/lets_split_eh/keymaps/that_canadian/keymap.c index 8ef97357495..bba9a02c8ce 100644 --- a/keyboards/lets_split_eh/keymaps/that_canadian/keymap.c +++ b/keyboards/lets_split_eh/keymaps/that_canadian/keymap.c @@ -22,10 +22,6 @@ enum custom_keycodes { ADJUST }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) @@ -167,4 +163,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/lets_split_eh/keymaps/that_canadian/rules.mk b/keyboards/lets_split_eh/keymaps/that_canadian/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/lets_split_eh/keymaps/that_canadian/rules.mk +++ b/keyboards/lets_split_eh/keymaps/that_canadian/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/lets_split_eh/lets_split_eh.c b/keyboards/lets_split_eh/lets_split_eh.c index d5a312085d1..7249f54cf26 100644 --- a/keyboards/lets_split_eh/lets_split_eh.c +++ b/keyboards/lets_split_eh/lets_split_eh.c @@ -1 +1,16 @@ #include "lets_split_eh.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + + {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}}, + {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}}, + {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}, + {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}}, + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}}, +}; +#endif diff --git a/keyboards/lets_split_eh/rules.mk b/keyboards/lets_split_eh/rules.mk index dffeb9fa3c0..27661cebb4e 100644 --- a/keyboards/lets_split_eh/rules.mk +++ b/keyboards/lets_split_eh/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -67,4 +66,6 @@ SPLIT_KEYBOARD = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +LAYOUTS = ortho_4x12 + DEFAULT_FOLDER = lets_split_eh/eh diff --git a/keyboards/levinson/keymaps/bakingpy2u/keymap.c b/keyboards/levinson/keymaps/bakingpy2u/keymap.c deleted file mode 100644 index 219e3468fbc..00000000000 --- a/keyboards/levinson/keymaps/bakingpy2u/keymap.c +++ /dev/null @@ -1,204 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _FN3 5 -#define _FN4 6 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - FN3, - FN4, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen -#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen -#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen -#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen -#define KC_X0 MT(MOD_LCTL, KC_ESC) -#define KC_X1 LOWER -#define KC_X2 RAISE -#define KC_X3 LT(_FN3, KC_GRV) -#define KC_X4 MT(MOD_LSFT, KC_ENT) -#define KC_X5 BL_STEP - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL, X1 ,LGUI,SPC ,SPC , BSPC,BSPC, X2 ,RALT, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_COLEMAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL, X1 ,LGUI,SPC ,SPC , BSPC,BSPC, X2 ,RALT, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_DVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , O , E , U , I , D , H , T , N , S ,SLSH, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL, X1 ,LGUI,SPC ,SPC , BSPC,BSPC, X2 ,RALT, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - X5 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , ,DEL , DEL , , P0 ,PDOT, , - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_FN3] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT( \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) - - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/levinson/keymaps/default/config.h b/keyboards/levinson/keymaps/default/config.h deleted file mode 100644 index e710d6e4aab..00000000000 --- a/keyboards/levinson/keymaps/default/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert -Copyright 2018 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS diff --git a/keyboards/levinson/keymaps/default/keymap.c b/keyboards/levinson/keymaps/default/keymap.c deleted file mode 100644 index dac8068a42a..00000000000 --- a/keyboards/levinson/keymaps/default/keymap.c +++ /dev/null @@ -1,212 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - BL_STEP, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/levinson/keymaps/losinggeneration/rules.mk b/keyboards/levinson/keymaps/losinggeneration/rules.mk deleted file mode 100644 index c8eef2cb3f1..00000000000 --- a/keyboards/levinson/keymaps/losinggeneration/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -AUDIO_ENABLE = no # Audio output on port C6 -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -COMMAND_ENABLE = no # Commands for debug and configuration -CONSOLE_ENABLE = no # Console for debug(+400) -MIDI_ENABLE = no # MIDI controls -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/levinson/keymaps/mmacdougall/keymap.c b/keyboards/levinson/keymaps/mmacdougall/keymap.c deleted file mode 100644 index dec47a7616e..00000000000 --- a/keyboards/levinson/keymaps/mmacdougall/keymap.c +++ /dev/null @@ -1,201 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |B Step|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - BL_STEP, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/levinson/keymaps/treadwell/keymap.c b/keyboards/levinson/keymaps/treadwell/keymap.c deleted file mode 100644 index bcc744a6ddf..00000000000 --- a/keyboards/levinson/keymaps/treadwell/keymap.c +++ /dev/null @@ -1,178 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _COLEMAK 1 -#define _GAME 2 -#define _NUMB 3 -#define _CODE 4 -#define _SYS 5 -#define _FN4 6 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - GAME, - NUMB, - CODE, - SYS, - FN4, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_X1 CODE -#define KC_X2 NUMB -#define KC_X3 MO(_SYS) -#define KC_X4 MT(MOD_LSFT, KC_ENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - BSPC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X1 ,LALT, SPC , X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_COLEMAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - BSPC, A , R , S , T , D , H , N , E , I , O ,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X1 ,LALT, SPC , X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_GAME] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X2 , SPC, SPC , X1 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_NUMB] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, DEL, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,UNDS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , ,MPRV,MNXT,MPLY, , ,VOLD,VOLU,MUTE, , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , ,LALT, , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_CODE] = LAYOUT_kc( - //,----+------+----+----+----+----. ,----+----+----+----+----+----. - ESC , , , UP , , , PGUP,HOME,LPRN,RPRN,BSLS,PIPE, - //|----+------+----+----+----+----| |----+----+----+----+----+----| - CAPS,SELECT,LEFT,DOWN,RGHT,DEL , PGDN, END,LBRC,RBRC,MINS,UNDS, - //|----+------+----+----+----+----| |----+----+----+----+----+----| - LSFT, UNDO ,CUT ,COPY,PASTE, , LEFT,RGHT,LCBR,RCBR,PLUS,PEQL, - //|----+------+----+----+----+----| |----+----+----+----+----+----| - , , , , ,LALT, , , , , , - //`----+------+----+----+----+----' `----+----+----+----+----+----' - ), - - [_SYS] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT_ortho_4x12( \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, GAME , _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) - - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case GAME: - if (record->event.pressed) { - set_single_persistent_default_layer(_GAME); - } - return false; - break; - case NUMB: - if (record->event.pressed) { - layer_on(_NUMB); - update_tri_layer(_NUMB, _CODE, _ADJUST); - } else { - layer_off(_NUMB); - update_tri_layer(_NUMB, _CODE, _ADJUST); - } - return false; - break; - case CODE: - if (record->event.pressed) { - layer_on(_CODE); - update_tri_layer(_NUMB, _CODE, _ADJUST); - } else { - layer_off(_CODE); - update_tri_layer(_NUMB, _CODE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/levinson/keymaps/valgrahf/keymap.c b/keyboards/levinson/keymaps/valgrahf/keymap.c deleted file mode 100644 index 7b3df539dbb..00000000000 --- a/keyboards/levinson/keymaps/valgrahf/keymap.c +++ /dev/null @@ -1,65 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _BASE 0 -#define _FN1 1 -#define _FN2 2 - -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_FN1 LT(_FN1, KC_NO) -#define KC_FN2 LT(_FN2, KC_NO) -#define KC_SPFN LT(_FN1, KC_SPACE) -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_BASE] = LAYOUT_kc_ortho_4x12( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB, Q , W , E , R , T , Y , U , I , O , P ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ESC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM, DOT,SLSH,PGUP, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LCTL,LGUI,LALT, FN1, ENT, ENT, SPC, SPC, FN2,HOME, END,PGDN - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_FN1] = LAYOUT_kc_ortho_4x12( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL, F1, F2, F3, F4, F5, F6,MINS, EQL,LBRC,RBRC,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7, F8, F9, F10, F11, F12, , , , UP, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , ,LEFT,DOWN,RIGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_FN2] = LAYOUT_kc_ortho_4x12( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL,RHUI,RSAI,RVAI, , , ,UNDS,PLUS,LCBR,RCBR,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RHUD,RSAD,RVAD, , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RTOG,RMOD, , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - -}; diff --git a/keyboards/levinson/levinson.h b/keyboards/levinson/levinson.h deleted file mode 100644 index 2106bc0e37c..00000000000 --- a/keyboards/levinson/levinson.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "quantum.h" - -#ifdef KEYBOARD_levinson_rev1 - #include "rev1.h" -#else - #include "rev2.h" -#endif - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ - ) - -#define LAYOUT_kc_ortho_4x12 LAYOUT_kc diff --git a/keyboards/levinson/readme.md b/keyboards/levinson/readme.md deleted file mode 100644 index 79e64d332e6..00000000000 --- a/keyboards/levinson/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -Levinson -======== - -A split 40% split 4x12 ortholinear keyboard made and sold by Keebio. It's essentially a Let's Split with LED backlight support and 2u thumb key support. [More info at Keebio](https://keeb.io). - -Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make levinson/rev2:default - -Example of flashing this keyboard: - - make levinson/rev2:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -A build guide for this keyboard can be found here: [Levinson Build Guide](https://docs.keeb.io) diff --git a/keyboards/levinson/rev1/config.h b/keyboards/levinson/rev1/config.h deleted file mode 100644 index 8161b4e32f9..00000000000 --- a/keyboards/levinson/rev1/config.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert -Copyright 2018 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1146 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Levinson -#define DESCRIPTION Split 40 percent ortholinear keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 8 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D7, E6, B4, B5 } -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, F4 } - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 12 // Number of LEDs - -/* Backlight LEDs */ -#define BACKLIGHT_PIN B6 -#define BACKLIGHT_LEVELS 7 diff --git a/keyboards/levinson/rev2/config.h b/keyboards/levinson/rev2/config.h deleted file mode 100644 index 03b98b45c1e..00000000000 --- a/keyboards/levinson/rev2/config.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert -Copyright 2018 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1146 -#define DEVICE_VER 0x0200 -#define MANUFACTURER Keebio -#define PRODUCT Levinson -#define DESCRIPTION Split 40 percent ortholinear keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 8 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D4, D7, E6, B4 } -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 12 // Number of LEDs - -/* Backlight LEDs */ -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_LEVELS 7 diff --git a/keyboards/levinson/rules.mk b/keyboards/levinson/rules.mk deleted file mode 100644 index 8f1fa130fa6..00000000000 --- a/keyboards/levinson/rules.mk +++ /dev/null @@ -1,33 +0,0 @@ -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -SPLIT_KEYBOARD = yes - -LAYOUTS = ortho_4x12 -DEFAULT_FOLDER = levinson/rev2 diff --git a/keyboards/lfkeyboards/lfk65_hs/config.h b/keyboards/lfkeyboards/lfk65_hs/config.h index ffbd1de9b68..f448419d4bc 100644 --- a/keyboards/lfkeyboards/lfk65_hs/config.h +++ b/keyboards/lfkeyboards/lfk65_hs/config.h @@ -34,7 +34,7 @@ #define RGBLIGHT_VAL_STEP 17 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -79,11 +79,6 @@ * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c index 0985debdff3..87c9358624d 100644 --- a/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c @@ -53,15 +53,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/lfkeyboards/lfk65_hs/readme.md b/keyboards/lfkeyboards/lfk65_hs/readme.md index 382538c68bc..8824804d773 100644 --- a/keyboards/lfkeyboards/lfk65_hs/readme.md +++ b/keyboards/lfkeyboards/lfk65_hs/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make lfkeyboards/lfk65_hs:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/lfkeyboards/lfk78/config.h b/keyboards/lfkeyboards/lfk78/config.h index 32f4455dae2..44b55b50e0c 100644 --- a/keyboards/lfkeyboards/lfk78/config.h +++ b/keyboards/lfkeyboards/lfk78/config.h @@ -65,7 +65,7 @@ along with this program. If not, see . #define TAPPING_TERM 200 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -110,11 +110,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/lfkeyboards/lfk78/keymaps/ca178858/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/ca178858/keymap.c index 5bb50afaffa..5461f718c80 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/ca178858/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/ca178858/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, // matches MF68 layout CS_GO, // 0x08 diff --git a/keyboards/lfkeyboards/lfk78/keymaps/ca178858/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/ca178858/rules.mk index 394c58b37ec..98e3d5a78b1 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/ca178858/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/ca178858/rules.mk @@ -23,19 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - - # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired # # # # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight diff --git a/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c index 06e2f344a53..81ab4338d1c 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, // matches MF68 layout FUNC, // 0x02 @@ -96,16 +92,6 @@ const uint16_t PROGMEM fn_actions[] = { ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if(eeconfig_read_default_layer() > 1){ diff --git a/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk index 555ad972304..1477c3ac77b 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no @@ -23,21 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install thi WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms CAPSLOCK_LED = no # Toggle back light LED of Caps Lock -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - -ifeq ($(strip $(CAPSLOCK_LED)), yes) - TMK_COMMON_DEFS += -DCAPSLOCK_LED -endif # Override the LFK78 hardware version: # diff --git a/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c index 95399fef69f..806f402e83a 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, // matches MF68 layout FUNC, // 0x02 @@ -96,16 +92,6 @@ const uint16_t PROGMEM fn_actions[] = { ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if(eeconfig_read_default_layer() > 1){ diff --git a/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk index 147e95bc878..3cfc994cb8e 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no @@ -23,18 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this mu WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired # # diff --git a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c index cf1949190ac..35d17805c33 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, // matches MF68 layout FUNC, // 0x02 @@ -96,16 +92,6 @@ const uint16_t PROGMEM fn_actions[] = { ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if(eeconfig_read_default_layer() > 1){ diff --git a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk index 555ad972304..f789b6866b4 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no @@ -23,22 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install thi WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms CAPSLOCK_LED = no # Toggle back light LED of Caps Lock -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - -ifeq ($(strip $(CAPSLOCK_LED)), yes) - TMK_COMMON_DEFS += -DCAPSLOCK_LED -endif - # Override the LFK78 hardware version: # # B - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight diff --git a/keyboards/lfkeyboards/lfk78/lfk78.c b/keyboards/lfkeyboards/lfk78/lfk78.c index e02739e4f5a..60b7ab4ce09 100644 --- a/keyboards/lfkeyboards/lfk78/lfk78.c +++ b/keyboards/lfkeyboards/lfk78/lfk78.c @@ -13,6 +13,15 @@ uint16_t click_hz = CLICK_HZ; uint16_t click_time = CLICK_MS; uint8_t click_toggle = CLICK_ENABLED; +__attribute__((weak)) +const Layer_Info layer_info[] = { + // Layer Mask Red Green Blue + {0x00000000, 0xFFFFFFFF, {0x0000, 0x0FFF, 0x0000}}, // base layer - green + {0x00000002, 0xFFFFFFFE, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue + {0x00000004, 0xFFFFFFFC, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta + {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white +}; + void matrix_init_kb(void) { matrix_init_user(); diff --git a/keyboards/lfkeyboards/lfk78/readme.md b/keyboards/lfkeyboards/lfk78/readme.md index 3ca0b2e04a4..7cef9735dcf 100644 --- a/keyboards/lfkeyboards/lfk78/readme.md +++ b/keyboards/lfkeyboards/lfk78/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make lfkeyboards/lfk78:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/lfkeyboards/lfk78/rules.mk b/keyboards/lfkeyboards/lfk78/rules.mk index 091cd77556f..cc314c97a2c 100644 --- a/keyboards/lfkeyboards/lfk78/rules.mk +++ b/keyboards/lfkeyboards/lfk78/rules.mk @@ -32,3 +32,52 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = no + +ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled +WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms +CAPSLOCK_LED = no # Toggle back light LED of Caps Lock + + +ifeq ($(strip $(ISSI_ENABLE)), yes) + TMK_COMMON_DEFS += -DISSI_ENABLE +endif + +ifeq ($(strip $(WATCHDOG_ENABLE)), yes) + TMK_COMMON_DEFS += -DWATCHDOG_ENABLE +endif + +ifeq ($(strip $(CAPSLOCK_LED)), yes) + TMK_COMMON_DEFS += -DCAPSLOCK_LED +endif + +# # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired +# # +# # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight +# # RevC/D - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB +# # +# # Set to B, C or D +# LFK_REV = D + +# ifeq ($(LFK_REV), B) +# MCU = atmega32u4 +# else +# MCU = at90usb1286 +# endif +# OPT_DEFS += -DLFK_REV_$(LFK_REV) +# OPT_DEFS += -DUSB_PRODUCT=\"LFK_Rev$(LFK_REV)\" diff --git a/keyboards/lfkeyboards/lfk87/config.h b/keyboards/lfkeyboards/lfk87/config.h index 84357450b38..00df4e9113a 100644 --- a/keyboards/lfkeyboards/lfk87/config.h +++ b/keyboards/lfkeyboards/lfk87/config.h @@ -29,7 +29,6 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW - #ifdef LFK_TKL_REV_A /* RevB Matrix config */ #define MATRIX_ROWS 6 @@ -66,7 +65,7 @@ along with this program. If not, see . #define TAPPING_TERM 200 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -111,11 +110,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c index 99757ac724f..59ee51c25ed 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, // matches MF68 layout DEFAULT_WKL, // 0x02 Function in CapsLock location, gui key disabled diff --git a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/rules.mk b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/rules.mk index 9819cdbee24..f28ec80ea72 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/rules.mk +++ b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/rules.mk @@ -23,17 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired diff --git a/keyboards/lfkeyboards/lfk87/keymaps/default/config.h b/keyboards/lfkeyboards/lfk87/keymaps/default/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/default/config.h +++ b/keyboards/lfkeyboards/lfk87/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c index e215033a2d1..f35826880ba 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, // matches MF68 layout FUNC, // 0x08 @@ -89,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \ MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, \ - AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ + AU_TOG, KC_FN1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, \ XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI \ ), @@ -104,16 +100,6 @@ const uint16_t PROGMEM fn_actions[] = { ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if(eeconfig_read_default_layer() > 1){ diff --git a/keyboards/lfkeyboards/lfk87/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfk87/keymaps/default/rules.mk index c1f1070fd60..c079c264ed7 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/lfk87/keymaps/default/rules.mk @@ -23,17 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif # Override the LFK87 hardware version. diff --git a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c index 5e3310c0d72..89c5d8f8dbf 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, // matches MF68 layout FUNC, // 0x08 diff --git a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/rules.mk b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/rules.mk index c1f1070fd60..f7b39455b49 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/rules.mk +++ b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/rules.mk @@ -23,19 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - - # Override the LFK87 hardware version. # # A - Green PCB. at90usb1286 Only 3 exist diff --git a/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c index ec8bedbb0c5..b86c99a41e1 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, FUNC, // 0x02 @@ -96,28 +92,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape - ACTION_FUNCTION(LFK_LED_TEST), // FN2 - cycle through LEDs for testing - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN3 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN4 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN5 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN6 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN7 - Toggle audio click - ACTION_FUNCTION(LFK_LED_TEST), // FN8 - cycle through LEDs for testing - ACTION_FUNCTION(LFK_DEBUG_SETTINGS), // FN9 - prints LED and click settings to HID + [0] = ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers + [3] = ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN3 - Increase Freq of audio click + [4] = ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN4 - Decrease Freq of audio click + [5] = ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN5 - Increase length of audio click + [6] = ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN6 - Decrease length of audio click + [7] = ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN7 - Toggle audio click }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if(eeconfig_read_default_layer() > 1){ diff --git a/keyboards/lfkeyboards/lfk87/keymaps/iso/rules.mk b/keyboards/lfkeyboards/lfk87/keymaps/iso/rules.mk index 68e200a5de1..7823dea7874 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/iso/rules.mk +++ b/keyboards/lfkeyboards/lfk87/keymaps/iso/rules.mk @@ -23,17 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install thi WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired diff --git a/keyboards/lfkeyboards/lfk87/lfk87.c b/keyboards/lfkeyboards/lfk87/lfk87.c index e9f184e36f9..4b34fcef7e1 100644 --- a/keyboards/lfkeyboards/lfk87/lfk87.c +++ b/keyboards/lfkeyboards/lfk87/lfk87.c @@ -14,6 +14,15 @@ uint16_t click_hz = CLICK_HZ; uint16_t click_time = CLICK_MS; uint8_t click_toggle = CLICK_ENABLED; +__attribute__((weak)) +const Layer_Info layer_info[] = { + // Layer Mask Red Green Blue + {0x00000000, 0xFFFFFFFF, {0x00, 0xFF, 0x00}}, // base layers - green + {0x00000002, 0xFFFFFFFE, {0x00, 0x00, 0xFF}}, // function layer - blue + {0x00000004, 0xFFFFFFFC, {0xFF, 0x00, 0xFF}}, // settings layer - magenta + {0xFFFFFFFF, 0xFFFFFFFF, {0xFF, 0xFF, 0xFF}}, // unknown layer - REQUIRED - white +}; + void matrix_init_kb(void) { // put your keyboard start-up code here diff --git a/keyboards/lfkeyboards/lfk87/readme.md b/keyboards/lfkeyboards/lfk87/readme.md index 15e55171035..44a36c479fc 100644 --- a/keyboards/lfkeyboards/lfk87/readme.md +++ b/keyboards/lfkeyboards/lfk87/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make lfkeyboards/lfk87:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/lfkeyboards/lfk87/rules.mk b/keyboards/lfkeyboards/lfk87/rules.mk index 19b41de0962..c10f4730657 100644 --- a/keyboards/lfkeyboards/lfk87/rules.mk +++ b/keyboards/lfkeyboards/lfk87/rules.mk @@ -31,3 +31,37 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT LAYOUTS = tkl_ansi tkl_iso + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable RGB underlight +RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not WS2812 +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = no + +ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled +WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms + + + +ifeq ($(strip $(ISSI_ENABLE)), yes) + OPT_DEFS += -DISSI_ENABLE +endif + +ifeq ($(strip $(WATCHDOG_ENABLE)), yes) + OPT_DEFS += -DWATCHDOG_ENABLE +endif diff --git a/keyboards/lfkeyboards/lfkpad/config.h b/keyboards/lfkeyboards/lfkpad/config.h index ea85f670cf5..1d8de837dae 100644 --- a/keyboards/lfkeyboards/lfkpad/config.h +++ b/keyboards/lfkeyboards/lfkpad/config.h @@ -44,7 +44,7 @@ along with this program. If not, see . #define TAPPING_TERM 200 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -89,11 +89,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/lfkeyboards/lfkpad/keymaps/default/config.h b/keyboards/lfkeyboards/lfkpad/keymaps/default/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/lfkeyboards/lfkpad/keymaps/default/config.h +++ b/keyboards/lfkeyboards/lfkpad/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/lfkeyboards/lfkpad/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfkpad/keymaps/default/keymap.c index e8fae1dde00..3e131b24144 100644 --- a/keyboards/lfkeyboards/lfkpad/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfkpad/keymaps/default/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_numpad_6x4( /* Base */ KC_ESC, KC_TAB, KC_PEQL, MO(1), \ @@ -24,16 +20,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if(eeconfig_read_default_layer() > 1){ diff --git a/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk index 1653f4e3023..cc21b32dce3 100644 --- a/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no @@ -23,17 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this mu WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired diff --git a/keyboards/lfkeyboards/lfkpad/rules.mk b/keyboards/lfkeyboards/lfkpad/rules.mk index e28e398cc88..83553f64cb3 100644 --- a/keyboards/lfkeyboards/lfkpad/rules.mk +++ b/keyboards/lfkeyboards/lfkpad/rules.mk @@ -11,3 +11,31 @@ ARCH = AVR8 OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT LAYOUTS = numpad_6x4 + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = no + +ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled +WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms + + +ifeq ($(strip $(ISSI_ENABLE)), yes) + TMK_COMMON_DEFS += -DISSI_ENABLE +endif + +ifeq ($(strip $(WATCHDOG_ENABLE)), yes) + TMK_COMMON_DEFS += -DWATCHDOG_ENABLE +endif diff --git a/keyboards/lfkeyboards/mini1800/config.h b/keyboards/lfkeyboards/mini1800/config.h index 8389e8b3f5e..214f5f45ab4 100644 --- a/keyboards/lfkeyboards/mini1800/config.h +++ b/keyboards/lfkeyboards/mini1800/config.h @@ -52,7 +52,7 @@ along with this program. If not, see . #define TAPPING_TERM 200 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -97,11 +97,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c index 16cc93e40c2..eadc6eb5960 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c +++ b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, // matches MF68 layout FUNC, // 0x08 diff --git a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/rules.mk b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/rules.mk index 16452df677d..2c6035d583f 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/rules.mk +++ b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/rules.mk @@ -23,9 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif ifeq ($(strip $(ISSI_ENABLE)), yes) TMK_COMMON_DEFS += -DISSI_ENABLE diff --git a/keyboards/lfkeyboards/mini1800/keymaps/default/config.h b/keyboards/lfkeyboards/mini1800/keymaps/default/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/default/config.h +++ b/keyboards/lfkeyboards/mini1800/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c b/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c index 443064748d4..303fa9bb4c6 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c @@ -85,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [SETTINGS] = LAYOUT( KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, \ MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, XXXXXXX, \ - AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + AU_TOG, KC_FN1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX \ ), @@ -100,16 +100,6 @@ const uint16_t PROGMEM fn_actions[] = { ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if(eeconfig_read_default_layer() > 1){ diff --git a/keyboards/lfkeyboards/mini1800/keymaps/default/rules.mk b/keyboards/lfkeyboards/mini1800/keymaps/default/rules.mk index d6e35e35373..1598173f36b 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/mini1800/keymaps/default/rules.mk @@ -23,10 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - ifeq ($(strip $(ISSI_ENABLE)), yes) TMK_COMMON_DEFS += -DISSI_ENABLE endif diff --git a/keyboards/lfkeyboards/mini1800/mini1800.c b/keyboards/lfkeyboards/mini1800/mini1800.c index f0692d46c76..d5f4193c1da 100644 --- a/keyboards/lfkeyboards/mini1800/mini1800.c +++ b/keyboards/lfkeyboards/mini1800/mini1800.c @@ -17,6 +17,16 @@ uint16_t click_time = CLICK_MS; uint8_t click_toggle = CLICK_ENABLED; float my_song[][2] = SONG(ZELDA_PUZZLE); +// Colors of the layer indicator LED +// This list needs to define layer 0xFFFFFFFF, it is the end of the list, and the unknown layer +__attribute__((weak)) +const Layer_Info layer_info[] = { + // Layer Mask Red Green Blue + {0x00000000, 0xFFFFFFFF, {0x00, 0xFF, 0x00}}, // base layers - green + {0x00000002, 0xFFFFFFFE, {0x00, 0x00, 0xFF}}, // function layer - blue + {0x00000004, 0xFFFFFFFC, {0xFF, 0x00, 0xFF}}, // settings layer - magenta + {0xFFFFFFFF, 0xFFFFFFFF, {0xFF, 0xFF, 0xFF}}, // unknown layer - REQUIRED - white +}; void matrix_init_kb(void) { diff --git a/keyboards/lfkeyboards/mini1800/readme.md b/keyboards/lfkeyboards/mini1800/readme.md index 96de85df1da..e2839275ccc 100644 --- a/keyboards/lfkeyboards/mini1800/readme.md +++ b/keyboards/lfkeyboards/mini1800/readme.md @@ -9,4 +9,4 @@ Make example for this keyboard (after setting up your build environment): make lfkeyboards/mini1800:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/lfkeyboards/mini1800/rules.mk b/keyboards/lfkeyboards/mini1800/rules.mk index 022b21924fb..a1e52aae94a 100644 --- a/keyboards/lfkeyboards/mini1800/rules.mk +++ b/keyboards/lfkeyboards/mini1800/rules.mk @@ -52,10 +52,8 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# ifndef QUANTUM_DIR -# include ../../Makefile -# endif - +# Extra source files for IS3731 lighting +SRC = TWIlib.c issi.c lighting.c ifeq ($(strip $(ISSI_ENABLE)), yes) # TMK_COMMON_DEFS += -DISSI_ENABLE diff --git a/keyboards/lfkeyboards/readme.md b/keyboards/lfkeyboards/readme.md index 0fd05adefdd..0c262f30b02 100644 --- a/keyboards/lfkeyboards/readme.md +++ b/keyboards/lfkeyboards/readme.md @@ -5,4 +5,4 @@ This is the parent directory for all LFKeyboard keyboards. Keyboard Maintainer: [LFKeyboards](https://github.com/lfkeyboards) Hardware Availability: [LFKeyboards.com](https://www.lfkeyboards.com/) -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/lfkeyboards/rules.mk b/keyboards/lfkeyboards/rules.mk deleted file mode 100644 index 5cf759a2fcc..00000000000 --- a/keyboards/lfkeyboards/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC = TWIlib.c issi.c lighting.c diff --git a/keyboards/lfkeyboards/smk65/config.h b/keyboards/lfkeyboards/smk65/config.h index 78626416c8d..deca087bc24 100644 --- a/keyboards/lfkeyboards/smk65/config.h +++ b/keyboards/lfkeyboards/smk65/config.h @@ -61,7 +61,7 @@ along with this program. If not, see . #define RGBLIGHT_VAL_STEP 17 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -106,11 +106,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/lfkeyboards/smk65/keymaps/default/config.h b/keyboards/lfkeyboards/smk65/keymaps/default/config.h index 8893d122e04..271f48d0011 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/default/config.h +++ b/keyboards/lfkeyboards/smk65/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c b/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c index 26430a81b9e..9c8ebdb63e8 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, FUNC, @@ -56,24 +52,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click + [1] = ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click + [2] = ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click + [3] = ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click + [4] = ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click + [5] = ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/lfkeyboards/smk65/keymaps/default/rules.mk b/keyboards/lfkeyboards/smk65/keymaps/default/rules.mk index 14ceebb77c4..b5310da58d3 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/smk65/keymaps/default/rules.mk @@ -23,10 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install thi WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - ifeq ($(strip $(ISSI_ENABLE)), yes) TMK_COMMON_DEFS += -DISSI_ENABLE endif @@ -34,3 +30,4 @@ endif ifeq ($(strip $(WATCHDOG_ENABLE)), yes) TMK_COMMON_DEFS += -DWATCHDOG_ENABLE endif + diff --git a/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c b/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c index 9adf722fd91..ebf085122c3 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c +++ b/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum keymap_layout { VANILLA = 0, FUNC, @@ -56,24 +52,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click + [1] = ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click + [2] = ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click + [3] = ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click + [4] = ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click + [5] = ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/lfkeyboards/smk65/keymaps/iso/rules.mk b/keyboards/lfkeyboards/smk65/keymaps/iso/rules.mk index f8b4d556897..f1814cf4852 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/iso/rules.mk +++ b/keyboards/lfkeyboards/smk65/keymaps/iso/rules.mk @@ -23,10 +23,6 @@ ISSI_ENABLE = no # If the I2C pullup resistors aren't install this WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - ifeq ($(strip $(ISSI_ENABLE)), yes) TMK_COMMON_DEFS += -DISSI_ENABLE endif @@ -51,3 +47,4 @@ endif # endif # OPT_DEFS += -DLFK_REV_$(LFK_REV) # OPT_DEFS += -DUSB_PRODUCT=\"LFK_Rev$(LFK_REV)\" + diff --git a/keyboards/lfkeyboards/smk65/readme.md b/keyboards/lfkeyboards/smk65/readme.md index 8265e36e680..0d04ac5f77e 100644 --- a/keyboards/lfkeyboards/smk65/readme.md +++ b/keyboards/lfkeyboards/smk65/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make lfkeyboards/smk65:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/lily58/config.h b/keyboards/lily58/config.h index db4844c9106..fb1cdf3962a 100644 --- a/keyboards/lily58/config.h +++ b/keyboards/lily58/config.h @@ -18,4 +18,11 @@ along with this program. If not, see . #pragma once -#include "serial_config.h" \ No newline at end of file +#include "config_common.h" +#include + +#define USE_I2C +#define USE_SERIAL + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/lily58/i2c.c b/keyboards/lily58/i2c.c old mode 100644 new mode 100755 index 084c890c405..4bee5c63982 --- a/keyboards/lily58/i2c.c +++ b/keyboards/lily58/i2c.c @@ -34,7 +34,7 @@ void i2c_delay(void) { // _delay_us(100); } -// Setup twi to run at 100kHz +// Setup twi to run at 100kHz or 400kHz (see ./i2c.h SCL_CLOCK) void i2c_master_init(void) { // no prescaler TWSR = 0; diff --git a/keyboards/lily58/i2c.h b/keyboards/lily58/i2c.h old mode 100644 new mode 100755 index c15b6bc5065..710662c7abd --- a/keyboards/lily58/i2c.h +++ b/keyboards/lily58/i2c.h @@ -1,5 +1,4 @@ -#ifndef I2C_H -#define I2C_H +#pragma once #include @@ -15,7 +14,7 @@ #define SLAVE_BUFFER_SIZE 0x10 -// i2c SCL clock frequency +// i2c SCL clock frequency 400kHz #define SCL_CLOCK 400000L extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; @@ -45,5 +44,3 @@ extern unsigned char i2c_readNak(void); extern unsigned char i2c_read(unsigned char ack); #define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/lily58/keymaps/default/config.h b/keyboards/lily58/keymaps/default/config.h index fd097855936..58bbdc5e9d0 100644 --- a/keyboards/lily58/keymaps/default/config.h +++ b/keyboards/lily58/keymaps/default/config.h @@ -17,12 +17,10 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#pragma once -/* Use I2C or Serial, not both */ +#pragma once -#define USE_SERIAL -// #define USE_I2C +//#define USE_MATRIX_I2C /* Select hand configuration */ @@ -30,6 +28,21 @@ along with this program. If not, see . // #define MASTER_RIGHT // #define EE_HANDS +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + // Underglow /* #undef RGBLED_NUM diff --git a/keyboards/lily58/keymaps/default/keymap.c b/keyboards/lily58/keymaps/default/keymap.c index 8d770581293..b8dda17d535 100644 --- a/keyboards/lily58/keymaps/default/keymap.c +++ b/keyboards/lily58/keymaps/default/keymap.c @@ -1,11 +1,27 @@ #include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + + extern keymap_config_t keymap_config; +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + #define _QWERTY 0 #define _LOWER 1 #define _RAISE 2 -#define _ADJUST 16 +#define _ADJUST 3 enum custom_keycodes { QWERTY = SAFE_RANGE, @@ -88,28 +104,103 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | |-------. ,-------| | | | | | | + * | | | | | | |-------. ,-------| | |RGB ON| HUE+ | SAT+ | VAL+ | * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * | | | | | | |-------| |-------| | | | | | | + * | | | | | | |-------| |-------| | | MODE | HUE- | SAT- | VAL- | * `-----------------------------------------/ / \ \-----------------------------------------' * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | | | |/ / \ \ | | | | * `----------------------------' '------''--------------------' - */ + */ [_ADJUST] = LAYOUT( \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD,\ _______, _______, _______, _______, _______, _______, _______, _______ \ ) }; +int RGB_current_mode; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + switch (keycode) { case QWERTY: - if (record->event.pressed) { + if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } return false; @@ -117,31 +208,31 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case LOWER: if (record->event.pressed) { layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } else { layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } return false; break; case RAISE: if (record->event.pressed) { layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } else { layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } return false; break; case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/lily58/keymaps/default/rules.mk b/keyboards/lily58/keymaps/default/rules.mk index 3d2d3c9e0f6..922fac6b69f 100644 --- a/keyboards/lily58/keymaps/default/rules.mk +++ b/keyboards/lily58/keymaps/default/rules.mk @@ -1,21 +1,30 @@ - # Build Options # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # - -RGBLIGHT_ENABLE = no - BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -ONEHAND_ENABLE = no # Enable one-hand typing +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/lily58/keymaps/yuchi/config.h b/keyboards/lily58/keymaps/yuchi/config.h index fd097855936..58bbdc5e9d0 100644 --- a/keyboards/lily58/keymaps/yuchi/config.h +++ b/keyboards/lily58/keymaps/yuchi/config.h @@ -17,12 +17,10 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#pragma once -/* Use I2C or Serial, not both */ +#pragma once -#define USE_SERIAL -// #define USE_I2C +//#define USE_MATRIX_I2C /* Select hand configuration */ @@ -30,6 +28,21 @@ along with this program. If not, see . // #define MASTER_RIGHT // #define EE_HANDS +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + // Underglow /* #undef RGBLED_NUM diff --git a/keyboards/lily58/keymaps/yuchi/keymap.c b/keyboards/lily58/keymaps/yuchi/keymap.c index d708dbec766..13b6cb1687e 100644 --- a/keyboards/lily58/keymaps/yuchi/keymap.c +++ b/keyboards/lily58/keymaps/yuchi/keymap.c @@ -1,7 +1,23 @@ #include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + + extern keymap_config_t keymap_config; +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + #define _QWERTY 0 #define _LOWER 1 #define _RAISE 2 @@ -89,28 +105,103 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | |-------. ,-------| | | | | | | + * | | | | | | |-------. ,-------| | |RGB ON| HUE+ | SAT+ | VAL+ | * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * | | | | | | |-------| |-------| | | | | | | + * | | | | | | |-------| |-------| | | MODE | HUE- | SAT- | VAL- | * `-----------------------------------------/ / \ \-----------------------------------------' * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | * | | | |/ / \ \ | | | | - * `-------------------''-------' '------''--------------------' + * `----------------------------' '------''--------------------' */ [_ADJUST] = LAYOUT( \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD,\ _______, _______, _______, _______, _______, _______, _______, _______ \ ) }; +int RGB_current_mode; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef SSD1306OLED + set_keylog(keycode, record); +#endif + // set_timelog(); + } + switch (keycode) { case QWERTY: - if (record->event.pressed) { + if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } return false; @@ -118,31 +209,31 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case LOWER: if (record->event.pressed) { layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } else { layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } return false; break; case RAISE: if (record->event.pressed) { layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } else { layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); } return false; break; case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; } return true; } \ No newline at end of file diff --git a/keyboards/lily58/keymaps/yuchi/rules.mk b/keyboards/lily58/keymaps/yuchi/rules.mk index 73777a1b785..922fac6b69f 100644 --- a/keyboards/lily58/keymaps/yuchi/rules.mk +++ b/keyboards/lily58/keymaps/yuchi/rules.mk @@ -1,22 +1,30 @@ - # Build Options # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # - -OLED_ENABLE = no -RGBLIGHT_ENABLE = no - BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -ONEHAND_ENABLE = no # Enable one-hand typing +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/lily58/lib/glcdfont.c b/keyboards/lily58/lib/glcdfont.c new file mode 100644 index 00000000000..c691ea9d0be --- /dev/null +++ b/keyboards/lily58/lib/glcdfont.c @@ -0,0 +1,243 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0xE0, 0x70, 0x18, + 0x0C, 0x18, 0x30, 0xE0, 0x80, 0x00, + 0x00, 0x10, 0xF8, 0x90, 0x10, 0x30, + 0x78, 0x30, 0x10, 0xB8, 0xFC, 0x38, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xF8, 0xFC, 0xF8, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, + 0x9C, 0x1C, 0x00, 0x00, 0x00, 0x00, + 0xF8, 0xFC, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1C, 0xFC, 0xF8, + 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xE0, 0xF8, 0x7C, 0x1C, + 0x00, 0x00, 0x00, 0xF0, 0xFC, 0xFC, + 0xFC, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xC0, 0xF0, 0xF8, + 0x38, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x3C, 0xF8, 0xF0, 0xE0, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, + 0xBC, 0xE0, 0x81, 0x81, 0x81, 0x83, + 0x83, 0x82, 0x87, 0x0C, 0x18, 0x30, + 0x60, 0xC0, 0x00, 0x00, 0x1F, 0xFE, + 0x90, 0xB9, 0xFF, 0xBB, 0x91, 0x98, + 0x3C, 0x18, 0x11, 0x13, 0x3F, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x0F, 0x7F, 0xF8, 0xE0, 0x80, 0xF0, + 0xFC, 0x3F, 0x0F, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3F, 0x3F, 0x3F, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x3C, + 0x78, 0xF8, 0xF0, 0xE0, 0x80, 0x00, + 0x00, 0x00, 0x00, 0xC3, 0xE7, 0xFF, + 0x7E, 0x3C, 0x38, 0x78, 0x78, 0x70, + 0x70, 0xF8, 0xFF, 0xDF, 0x87, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x3C, 0x24, 0x66, 0x63, 0x41, + 0xC1, 0x81, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x81, 0xC1, 0x41, 0x62, + 0x38, 0x6C, 0x4C, 0xC6, 0x81, 0x81, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, + 0xC1, 0x43, 0x62, 0x36, 0x1C, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xC0, 0xC0, + 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, + 0xC0, 0x80, 0x00, 0x00, 0x00, 0x7F, + 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, + 0x7F, 0xFF, 0xFF, 0xC0, 0x80, 0x00, + 0x00, 0x00, 0xE0, 0xE0, 0xC0, 0xC0, + 0xC0, 0xE0, 0xF9, 0x7F, 0x1F, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x70, 0xF0, 0xE0, + 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, + 0xF0, 0xF8, 0x7F, 0x3F, 0x0F, 0x00, + 0x00, 0x00, 0x0F, 0x3F, 0x7F, 0xF9, + 0xE0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, + 0xC0, 0xE0, 0xF9, 0x7F, 0x3F, 0x1F, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +#endif // FONT5X7_H diff --git a/keyboards/lily58/lib/host_led_state_reader.c b/keyboards/lily58/lib/host_led_state_reader.c new file mode 100644 index 00000000000..0e22173b1d8 --- /dev/null +++ b/keyboards/lily58/lib/host_led_state_reader.c @@ -0,0 +1,15 @@ +#include +#include "lily58.h" + +char host_led_state_str[24]; + +const char *read_host_led_state(void) +{ + uint8_t leds = host_keyboard_leds(); + snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", + (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "); + + return host_led_state_str; +} diff --git a/keyboards/lily58/lib/keylogger.c b/keyboards/lily58/lib/keylogger.c new file mode 100644 index 00000000000..a1bd476d20b --- /dev/null +++ b/keyboards/lily58/lib/keylogger.c @@ -0,0 +1,45 @@ +#include +#include "lily58.h" + +char keylog_str[24] = {}; +char keylogs_str[21] = {}; +int keylogs_str_idx = 0; + +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void set_keylog(uint16_t keycode, keyrecord_t *record) { + char name = ' '; + if (keycode < 60) { + name = code_to_name[keycode]; + } + + // update keylog + snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", + record->event.key.row, record->event.key.col, + keycode, name); + + // update keylogs + if (keylogs_str_idx == sizeof(keylogs_str) - 1) { + keylogs_str_idx = 0; + for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { + keylogs_str[i] = ' '; + } + } + + keylogs_str[keylogs_str_idx] = name; + keylogs_str_idx++; +} + +const char *read_keylog(void) { + return keylog_str; +} + +const char *read_keylogs(void) { + return keylogs_str; +} diff --git a/keyboards/lily58/lib/layer_state_reader.c b/keyboards/lily58/lib/layer_state_reader.c new file mode 100644 index 00000000000..48674b0673a --- /dev/null +++ b/keyboards/lily58/lib/layer_state_reader.c @@ -0,0 +1,35 @@ + +#include QMK_KEYBOARD_H +#include +#include "lily58.h" + +#define L_BASE 0 +#define L_LOWER 2 +#define L_RAISE 4 +#define L_ADJUST 8 +#define L_ADJUST_TRI 14 + +char layer_state_str[24]; + +const char *read_layer_state(void) { + switch (layer_state) + { + case L_BASE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default"); + break; + case L_RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case L_LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case L_ADJUST: + case L_ADJUST_TRI: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); + } + + return layer_state_str; +} diff --git a/keyboards/lily58/lib/logo_reader.c b/keyboards/lily58/lib/logo_reader.c new file mode 100644 index 00000000000..9f8adb84667 --- /dev/null +++ b/keyboards/lily58/lib/logo_reader.c @@ -0,0 +1,11 @@ +#include "lily58.h" + +const char *read_logo(void) { + static char logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0}; + + return logo; +} diff --git a/keyboards/lily58/lib/mode_icon_reader.c b/keyboards/lily58/lib/mode_icon_reader.c new file mode 100644 index 00000000000..2bce4a71b0e --- /dev/null +++ b/keyboards/lily58/lib/mode_icon_reader.c @@ -0,0 +1,15 @@ +#include +#include "lily58.h" + +char mode_icon[24]; + +const char *read_mode_icon(bool swap) { + static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; + if (swap == false) { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]); + } else { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]); + } + + return mode_icon; +} diff --git a/keyboards/lily58/lib/rgb_state_reader.c b/keyboards/lily58/lib/rgb_state_reader.c new file mode 100644 index 00000000000..e0efe2e5288 --- /dev/null +++ b/keyboards/lily58/lib/rgb_state_reader.c @@ -0,0 +1,15 @@ +#ifdef RGBLIGHT_ENABLE + +#include QMK_KEYBOARD_H +#include + +extern rgblight_config_t rgblight_config; +char rbf_info_str[24]; +const char *read_rgb_info(void) { + + snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d", + rgblight_config.enable ? "on" : "- ", rgblight_config.mode, + rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + return rbf_info_str; +} +#endif diff --git a/keyboards/lily58/lib/timelogger.c b/keyboards/lily58/lib/timelogger.c new file mode 100644 index 00000000000..bfbfbe8a214 --- /dev/null +++ b/keyboards/lily58/lib/timelogger.c @@ -0,0 +1,16 @@ +#include +#include "lily58.h" + +char timelog_str[24] = {}; +int last_time = 0; +int elapsed_time = 0; + +void set_timelog(void) { + elapsed_time = timer_elapsed(last_time); + last_time = timer_read(); + snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); +} + +const char *read_timelog(void) { + return timelog_str; +} diff --git a/keyboards/lily58/lily58.c b/keyboards/lily58/lily58.c index 697e3820c69..eacd90a82de 100644 --- a/keyboards/lily58/lily58.c +++ b/keyboards/lily58/lily58.c @@ -1 +1,10 @@ - #include "lily58.h" +#include "lily58.h" +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { +#ifdef SSD1306OLED + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +#else + return process_record_user(keycode, record); +#endif +} \ No newline at end of file diff --git a/keyboards/lily58/lily58.h b/keyboards/lily58/lily58.h index 1d64dd7b2a7..064f847dd25 100644 --- a/keyboards/lily58/lily58.h +++ b/keyboards/lily58/lily58.h @@ -1,28 +1,5 @@ -#ifndef LILY58_H -#define LILY58_H - -#include "quantum.h" +#pragma once #ifdef KEYBOARD_lily58_rev1 #include "rev1.h" #endif - - - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, L45, R40, R30, R31, R32, R33, R34, R35, \ - L41, L42, L43, L44, R41, R42, R43, R44 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L45, KC_##R40, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ - KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##R41, KC_##R42, KC_##R43, KC_##R44 \ - ) - -#endif diff --git a/keyboards/lily58/matrix.c b/keyboards/lily58/matrix.c index fc42dd14d9d..328d16c77bf 100644 --- a/keyboards/lily58/matrix.c +++ b/keyboards/lily58/matrix.c @@ -37,11 +37,11 @@ along with this program. If not, see . # include "serial.h" #endif -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -145,7 +145,7 @@ uint8_t _matrix_scan(void) #if (DIODE_DIRECTION == COL2ROW) // Set row, read cols for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); if (matrix_changed) { @@ -162,7 +162,7 @@ uint8_t _matrix_scan(void) #elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); if (matrix_changed) { debouncing = true; @@ -175,8 +175,8 @@ uint8_t _matrix_scan(void) } #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { matrix[i+offset] = matrix_debouncing[i+offset]; } diff --git a/keyboards/lily58/readme.md b/keyboards/lily58/readme.md index c71365e46ba..cbf0c1eeb02 100644 --- a/keyboards/lily58/readme.md +++ b/keyboards/lily58/readme.md @@ -2,16 +2,14 @@ Lily58 is 6×4+5keys column-staggered split keyboard. -![Lily58_01](https://user-images.githubusercontent.com/6285554/45210815-92744a00-b2cb-11e8-977a-8c1a93584f17.jpg) - -![Lily58_02](https://user-images.githubusercontent.com/6285554/45337733-7b33a600-b5c4-11e8-85b0-35f1cc9bf946.png) - +![Lily58_01](https://user-images.githubusercontent.com/6285554/50394214-72479880-079f-11e9-9d91-33fdbf1d7715.jpg) +![2018-12-24 17 39 58](https://user-images.githubusercontent.com/6285554/50394779-05360200-07a3-11e9-82b5-066fd8907ecf.png) Keyboard Maintainer: [Naoki Katahira](https://github.com/kata0510/) [Twitter:@F_YUUCHI](https://twitter.com/F_YUUCHI) Hardware Supported: Lily58 PCB, ProMicro Hardware Availability: [PCB & Case Data](https://github.com/kata0510/Lily58) Make example for this keyboard (after setting up your build environment): - make lily58:default + sudo make lily58:default See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/lily58/rev1/config.h b/keyboards/lily58/rev1/config.h index a991e88322c..8fd42070e02 100644 --- a/keyboards/lily58/rev1/config.h +++ b/keyboards/lily58/rev1/config.h @@ -19,12 +19,9 @@ along with this program. If not, see . #pragma once -//#include QMK_KEYBOARD_CONFIG_H -#include "config_common.h" - /* USB Device descriptor parameter */ #define VENDOR_ID 0xFC51 -#define PRODUCT_ID 0x0058 +#define PRODUCT_ID 0x0058 #define DEVICE_VER 0x0100 #define MANUFACTURER F_YUUCHI #define PRODUCT Lily58 @@ -48,22 +45,16 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE +//#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +//#define LOCKING_RESYNC_ENABLE /* ws2812 RGB LED */ #define RGB_DI_PIN D3 - -#define RGBLED_NUM 14 // Number of LEDs +#define RGBLED_NUM 12 // Number of LEDs /* * Feature disable options @@ -81,4 +72,4 @@ along with this program. If not, see . //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION +//#define NO_ACTION_FUNCTION \ No newline at end of file diff --git a/keyboards/lily58/rev1/info.json b/keyboards/lily58/rev1/info.json new file mode 100644 index 00000000000..4a3568c3e20 --- /dev/null +++ b/keyboards/lily58/rev1/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "Lily58", + "url": "", + "maintainer": "F_YUUCHI", + "width": 16.5, + "height": 5.25, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0.5}, {"x":1, "y":0.375}, {"x":2, "y":0.125}, {"x":3, "y":0}, {"x":4, "y":0.125}, {"x":5, "y":0.25}, {"x":10.5, "y":0.25}, {"x":11.5, "y":0.125}, {"x":12.5, "y":0}, {"x":13.5, "y":0.125}, {"x":14.5, "y":0.375}, {"x":15.5, "y":0.5}, + {"x":0, "y":1.5}, {"x":1, "y":1.375}, {"x":2, "y":1.125}, {"x":3, "y":1}, {"x":4, "y":1.125}, {"x":5, "y":1.25}, {"x":10.5, "y":1.25}, {"x":11.5, "y":1.125}, {"x":12.5, "y":1}, {"x":13.5, "y":1.125}, {"x":14.5, "y":1.375}, {"x":15.5, "y":1.5}, + {"x":0, "y":2.5}, {"x":1, "y":2.375}, {"x":2, "y":2.125}, {"x":3, "y":2}, {"x":4, "y":2.125}, {"x":5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.125}, {"x":12.5, "y":2}, {"x":13.5, "y":2.125}, {"x":14.5, "y":2.375}, {"x":15.5, "y":2.5}, + {"x":0, "y":3.5}, {"x":1, "y":3.375}, {"x":2, "y":3.125}, {"x":3, "y":3}, {"x":4, "y":3.125}, {"x":5, "y":3.25}, {"x":6, "y":2.75}, {"x":9.5, "y":2.75}, {"x":10.5, "y":3.25}, {"x":11.5, "y":3.125}, {"x":12.5, "y":3}, {"x":13.5, "y":3.125}, {"x":14.5, "y":3.375}, {"x":15.5, "y":3.5}, + {"x":2.5, "y":4.125}, {"x":3.5, "y":4.15}, {"x":4.5, "y":4.25}, {"x":6, "y":4.25, "h":1.5}, {"x":9.5, "y":4.25, "h":1.5}, {"x":11, "y":4.25}, {"x":12, "y":4.15}, {"x":13, "y":4.15} + ] + } + } +} diff --git a/keyboards/lily58/rev1/matrix.c b/keyboards/lily58/rev1/matrix.c new file mode 100755 index 00000000000..718cc574481 --- /dev/null +++ b/keyboards/lily58/rev1/matrix.c @@ -0,0 +1,357 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "split_scomm.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + TXLED0; + RXLED0; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(int master_changed) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else + int ret=serial_update_buffers(); +#endif + if (ret ) { + if(ret==2) RXLED1; + return 1; + } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH); + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + int mchanged = 1; + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction(mchanged) ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif + for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif + serial_slave_buffer[i] = matrix[offset+i]; + } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/lily58/rev1/rev1.c b/keyboards/lily58/rev1/rev1.c index 4c54d7717c3..e78f2ccfa5f 100644 --- a/keyboards/lily58/rev1/rev1.c +++ b/keyboards/lily58/rev1/rev1.c @@ -1,14 +1,8 @@ #include "lily58.h" -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; \ No newline at end of file +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif \ No newline at end of file diff --git a/keyboards/lily58/rev1/rev1.h b/keyboards/lily58/rev1/rev1.h index a8304635822..4949bf5372d 100644 --- a/keyboards/lily58/rev1/rev1.h +++ b/keyboards/lily58/rev1/rev1.h @@ -5,6 +5,10 @@ //void promicro_bootloader_jmp(bool program); #include "quantum.h" +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif #ifdef USE_I2C #include diff --git a/keyboards/lily58/rev1/rules.mk b/keyboards/lily58/rev1/rules.mk index f845616741c..7fc101bf2b0 100644 --- a/keyboards/lily58/rev1/rules.mk +++ b/keyboards/lily58/rev1/rules.mk @@ -1 +1,3 @@ -BACKLIGHT_ENABLE = no \ No newline at end of file +SRC += rev1/matrix.c +SRC += rev1/split_util.c +SRC += rev1/split_scomm.c \ No newline at end of file diff --git a/keyboards/lily58/rev1/serial_config.h b/keyboards/lily58/rev1/serial_config.h new file mode 100755 index 00000000000..4fab8e8ddfc --- /dev/null +++ b/keyboards/lily58/rev1/serial_config.h @@ -0,0 +1,4 @@ +#ifndef SOFT_SERIAL_PIN +#define SOFT_SERIAL_PIN D2 +#define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/lily58/rev1/split_scomm.c b/keyboards/lily58/rev1/split_scomm.c new file mode 100755 index 00000000000..a1fe6ba5b82 --- /dev/null +++ b/keyboards/lily58/rev1/split_scomm.c @@ -0,0 +1,91 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include +#include +#include +#include +#include "serial.h" +#ifdef CONSOLE_ENABLE + #include +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status, smatstatus; + static int need_retry = 0; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3]); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; + } + return smatstatus; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/lily58/rev1/split_scomm.h b/keyboards/lily58/rev1/split_scomm.h new file mode 100755 index 00000000000..873d8939d81 --- /dev/null +++ b/keyboards/lily58/rev1/split_scomm.h @@ -0,0 +1,24 @@ +#ifndef SPLIT_COMM_H +#define SPLIT_COMM_H + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif + +#endif /* SPLIT_COMM_H */ diff --git a/keyboards/lily58/rev1/split_util.c b/keyboards/lily58/rev1/split_util.c new file mode 100755 index 00000000000..e1ff8b4379d --- /dev/null +++ b/keyboards/lily58/rev1/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "split_scomm.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/lily58/rules.mk b/keyboards/lily58/rules.mk index ad8ad585e9a..0ef951872ee 100644 --- a/keyboards/lily58/rules.mk +++ b/keyboards/lily58/rules.mk @@ -1,9 +1,11 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c +SRC += i2c.c +SRC += serial.c +SRC += ssd1306.c + +# if firmware size over limit, try this option +# CFLAGS += -flto + # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -38,16 +40,15 @@ ARCH = AVR8 # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. F_USB = $(F_CPU) -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of # different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + # Build Options # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically @@ -63,9 +64,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = no -USE_I2C = no +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/lily58/serial.c b/keyboards/lily58/serial.c old mode 100644 new mode 100755 index f85dc28dc34..325c29a3f70 --- a/keyboards/lily58/serial.c +++ b/keyboards/lily58/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU @@ -14,9 +19,58 @@ #include "serial.h" //#include -#ifdef USE_SERIAL -//#ifndef USE_SERIAL_PD2 +#ifdef SOFT_SERIAL_PIN +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 @@ -43,56 +97,118 @@ SSTD_t transactions[] = { }; void serial_master_init(void) -{ soft_serial_initiator_init(transactions); } +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } void serial_slave_init(void) -{ soft_serial_target_init(transactions); } +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error // 1 => slave did not respond // 2 => checksum error int serial_update_buffers() -{ return soft_serial_transaction(); } +{ + int result; + result = soft_serial_transaction(); + return result; +} -#endif // Simple API (OLD API, compatible with let's split serial.c) +#endif // end of Simple API (OLD API, compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) #define NO_INLINE __attribute__((noinline)) #define _delay_sub_us(x) __builtin_avr_delay_cycles(x) -// Serial pulse period in microseconds. -#define TID_SEND_ADJUST 14 +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif -#define SELECT_SERIAL_SPEED 1 -#if SELECT_SERIAL_SPEED == 0 +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 1 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 2 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 3 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 4 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed - #define SERIAL_DELAY 50 // micro sec + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #else -#error Illegal Serial Speed -#endif - +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) @@ -106,17 +222,21 @@ int serial_update_buffers() #endif static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); } +inline static void serial_delay_half2(void) ALWAYS_INLINE; inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); @@ -136,6 +256,7 @@ void serial_input_with_pullup(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); @@ -153,30 +274,28 @@ void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void soft_serial_initiator_init(SSTD_t *sstd_table) +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_output(); serial_high(); } -void soft_serial_target_init(SSTD_t *sstd_table) +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_input_with_pullup(); -#if SERIAL_PIN_MASK == _BV(PD0) - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -#elif SERIAL_PIN_MASK == _BV(PD2) - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; #else - #error unknown SERIAL_PIN_MASK value + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; #endif } @@ -192,7 +311,7 @@ void sync_recv(void) { } // Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void)NO_INLINE; +static void sync_send(void) NO_INLINE; static void sync_send(void) { serial_low(); @@ -206,12 +325,12 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { uint8_t byte, i, p, pb; _delay_sub_us(READ_WRITE_START_ADJUST); - for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { serial_delay_half1(); // read the middle of pulses if( serial_read_pin() ) { - byte = (byte << 1) | 1; p ^= 1; + byte = (byte << 1) | 1; p ^= 1; } else { - byte = (byte << 1) | 0; p ^= 0; + byte = (byte << 1) | 0; p ^= 0; } _delay_sub_us(READ_WRITE_WIDTH_ADJUST); serial_delay_half2(); @@ -231,13 +350,13 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; void serial_write_chunk(uint8_t data, uint8_t bit) { uint8_t b, p; - for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { - if(data & b) { - serial_high(); p ^= 1; - } else { - serial_low(); p ^= 0; - } - serial_delay(); + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } /* send parity bit */ if(p & 1) { serial_high(); } @@ -289,6 +408,13 @@ void change_reciver2sender(void) { serial_delay_half1(); //4 } +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + // interrupt handle to be used by the target device ISR(SERIAL_PIN_INTERRUPT) { @@ -298,12 +424,15 @@ ISR(SERIAL_PIN_INTERRUPT) { SSTD_t *trans = Transaction_table; #else // recive transaction table index - uint8_t tid; + uint8_t tid, bits; uint8_t pecount = 0; sync_recv(); - tid = serial_read_chunk(&pecount,4); - if(pecount> 0) + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { return; + } serial_delay_half1(); serial_high(); // response step1 low->high @@ -316,17 +445,17 @@ ISR(SERIAL_PIN_INTERRUPT) { // target send phase if( trans->target2initiator_buffer_size > 0 ) serial_send_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size); + trans->target2initiator_buffer_size); // target switch to input change_sender2reciver(); // target recive phase if( trans->initiator2target_buffer_size > 0 ) { if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size) ) { - *trans->status = TRANSACTION_ACCEPTED; + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; } else { - *trans->status = TRANSACTION_DATA_ERROR; + *trans->status = TRANSACTION_DATA_ERROR; } } else { *trans->status = TRANSACTION_ACCEPTED; @@ -350,6 +479,8 @@ int soft_serial_transaction(void) { SSTD_t *trans = Transaction_table; #else int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; SSTD_t *trans = &Transaction_table[sstd_index]; #endif cli(); @@ -376,9 +507,10 @@ int soft_serial_transaction(int sstd_index) { #else // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); sync_send(); _delay_sub_us(TID_SEND_ADJUST); - serial_write_chunk(sstd_index, 4); + serial_write_chunk(tid, 7); serial_delay_half1(); // wait for the target response (step1 low->high) @@ -390,12 +522,12 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; } _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } @@ -405,12 +537,12 @@ int soft_serial_transaction(int sstd_index) { // if the target is present syncronize with it if( trans->target2initiator_buffer_size > 0 ) { if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size) ) { - serial_output(); - serial_high(); - *trans->status = TRANSACTION_DATA_ERROR; - sei(); - return TRANSACTION_DATA_ERROR; + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; } } @@ -420,7 +552,7 @@ int soft_serial_transaction(int sstd_index) { // initiator send phase if( trans->initiator2target_buffer_size > 0 ) { serial_send_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size); + trans->initiator2target_buffer_size); } // always, release the line when not in use @@ -443,3 +575,16 @@ int soft_serial_get_and_clean_status(int sstd_index) { #endif #endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/lily58/serial.h b/keyboards/lily58/serial.h old mode 100644 new mode 100755 index d2b7fd8e60b..7e0c0847a43 --- a/keyboards/lily58/serial.h +++ b/keyboards/lily58/serial.h @@ -4,14 +4,16 @@ #include // ///////////////////////////////////////////////////////////////// -// Need Soft Serial defines in serial_config.h +// Need Soft Serial defines in config.h // ///////////////////////////////////////////////////////////////// // ex. -// #define SERIAL_PIN_DDR DDRD -// #define SERIAL_PIN_PORT PORTD -// #define SERIAL_PIN_INPUT PIND -// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 -// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps // // //// USE Simple API (OLD API, compatible with let's split serial.c) // ex. @@ -47,16 +49,18 @@ typedef struct _SSTD_t { uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) // initiator is transaction start side -void soft_serial_initiator_init(SSTD_t *sstd_table); +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); // target is interrupt accept side -void soft_serial_target_init(SSTD_t *sstd_table); +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); // initiator resullt #define TRANSACTION_END 0 #define TRANSACTION_NO_RESPONSE 0x1 #define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 #ifndef SERIAL_USE_MULTI_TRANSACTION int soft_serial_transaction(void); #else @@ -72,7 +76,7 @@ int soft_serial_transaction(int sstd_index); // target: // TRANSACTION_DATA_ERROR // or TRANSACTION_ACCEPTED -#define TRANSACTION_ACCEPTED 0x4 +#define TRANSACTION_ACCEPTED 0x8 #ifdef SERIAL_USE_MULTI_TRANSACTION int soft_serial_get_and_clean_status(int sstd_index); #endif diff --git a/keyboards/lily58/serial_config.h b/keyboards/lily58/serial_config.h index fef689038e7..4fab8e8ddfc 100644 --- a/keyboards/lily58/serial_config.h +++ b/keyboards/lily58/serial_config.h @@ -1,8 +1,4 @@ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 \ No newline at end of file +#ifndef SOFT_SERIAL_PIN +#define SOFT_SERIAL_PIN D2 +#define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/lily58/ssd1306.c b/keyboards/lily58/ssd1306.c new file mode 100755 index 00000000000..20c2738db77 --- /dev/null +++ b/keyboards/lily58/ssd1306.c @@ -0,0 +1,344 @@ +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include +#include "print.h" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +extern const unsigned char font[] PROGMEM; + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +static bool force_dirty = true; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + i2c_master_init(); + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data) { + char data_ln[strlen(data)+2]; + snprintf(data_ln, sizeof(data_ln), "%s\n", data); + matrix_write(matrix, data_ln); +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty|| force_dirty) { + iota_gfx_flush(); + force_dirty = false; + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + +#endif diff --git a/keyboards/lily58/ssd1306.h b/keyboards/lily58/ssd1306.h new file mode 100755 index 00000000000..ea8c9232805 --- /dev/null +++ b/keyboards/lily58/ssd1306.h @@ -0,0 +1,91 @@ +#pragma once + +#include +#include +#include "pincontrol.h" +#include "action.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); \ No newline at end of file diff --git a/keyboards/luddite/README.md b/keyboards/luddite/README.md deleted file mode 100644 index 72666dda5fd..00000000000 --- a/keyboards/luddite/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Luddite - -Luddite 60% keyboard with backlight and RGB underglow. - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/luddite) - -Keyboard Maintainer: QMK Community -Hardware Supported: Luddite PCB -Hardware Availability: [Luddite project on 40% Keyboards](http://www.40percent.club/search/label/luddite) - -Make example for this keyboard (after setting up your build environment): - - make luddite:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). - -First pass at adding support for the luddite keyboard. Compiles but completely -untested. Intended to kick-start development. diff --git a/keyboards/luddite/config.h b/keyboards/luddite/config.h deleted file mode 100644 index 62ff72bb03d..00000000000 --- a/keyboards/luddite/config.h +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x1001 -#define MANUFACTURER di0ib -#define PRODUCT Luddite -#define DESCRIPTION Luddite Keyboard - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 8 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D3, D2, D1, D0, D4, C6, D7, E6 } -#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } -#define UNUSED_PINS - -/* number of backlight levels */ -#define BACKLIGHT_PIN B5 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 4 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN B4 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 // Number of LEDs -// #define RGBLIGHT_HUE_STEP 10 -// #define RGBLIGHT_SAT_STEP 17 -// #define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/luddite/keymaps/default/keymap.c b/keyboards/luddite/keymaps/default/keymap.c deleted file mode 100644 index 4d6ae0d524e..00000000000 --- a/keyboards/luddite/keymaps/default/keymap.c +++ /dev/null @@ -1,32 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BASE 0 -#define _FN1 1 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_60_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_RALT , KC_RGUI , MO(_FN1) , KC_RCTL - ), - - [_FN1] = LAYOUT_60_ansi( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, \ - RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_GRV, _______, _______, _______, _______, _______, _______, _______ - ) -}; diff --git a/keyboards/luddite/luddite.h b/keyboards/luddite/luddite.h deleted file mode 100644 index 1ba743e9e77..00000000000 --- a/keyboards/luddite/luddite.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "quantum.h" - -#define LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K10, K11, K12, K13, K14, K15, \ - K16, K17, K20, K21, K22, K23, K24, K25, K26, K27, K30, K31, K32, K33, \ - K34, K35, K36, K37, K40, K41, K42, K43, K44, K45, K46, K47, K50, \ - K51, K52, K53, K54, K55, K56, K57, K60, K61, K62, K63, K64, \ - K65, K66, K67, K70, K71, K72, K73, K74\ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07 }, \ - { K10, K11, K12, K13, K14, K15, K16, K17 }, \ - { K20, K21, K22, K23, K24, K25, K26, K27 }, \ - { K30, K31, K32, K33, K34, K35, K36, K37 }, \ - { K40, K41, K42, K43, K44, K45, K46, K47 }, \ - { K50, K51, K52, K53, K54, K55, K56, K57 }, \ - { K60, K61, K62, K63, K64, K65, K66, K67 }, \ - { K70, K71, K72, K73, K74 }, \ -} - diff --git a/keyboards/luddite/rules.mk b/keyboards/luddite/rules.mk deleted file mode 100644 index 2f7d847bf06..00000000000 --- a/keyboards/luddite/rules.mk +++ /dev/null @@ -1,59 +0,0 @@ -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes - -LAYOUTS = 60_ansi diff --git a/keyboards/m0lly/README.md b/keyboards/m0lly/README.md new file mode 100644 index 00000000000..e0c8b45d95f --- /dev/null +++ b/keyboards/m0lly/README.md @@ -0,0 +1,17 @@ +The Key Company M0LLY + +[TKC M0LLY](https://cdn.shopify.com/s/files/1/1679/2319/files/Molly_Terminal_1024x1024.jpg?v=1529067702) + + +The Key Company's M0LLY keyboard is inspired by the Apple Macintosh M0110A, and utilizes the AT90USB1286 microcontroller. + +Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/) +Hardware Supported: TKC M0LLY +Hardware Availability: [TheKey.Company](https://thekey.company) + + +Make example for this keyboard (after setting up your build environment): + + make m0lly:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/m0lly/config.h b/keyboards/m0lly/config.h new file mode 100644 index 00000000000..010833ac80a --- /dev/null +++ b/keyboards/m0lly/config.h @@ -0,0 +1,178 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0003 +#define MANUFACTURER The Key Company +#define PRODUCT M0lly +#define DESCRIPTION QMK keyboard firmware for M0lly + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 19 + +// ROWS: Top to bottom, COLS: Left to right +/* Row pin configuration +*/ +#define MATRIX_ROW_PINS { F2, F1, F0, E1, E0 } +/* Column pin configuration + */ +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, C1, C0, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +/* Underlight configuration + */ +#define RGB_DI_PIN D7 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 30 // Number of LEDs +#define RGBLIGHT_HUE_STEP 5 +#define RGBLIGHT_SAT_STEP 10 +#define RGBLIGHT_VAL_STEP 10 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 diff --git a/keyboards/m0lly/i2c.c b/keyboards/m0lly/i2c.c new file mode 100644 index 00000000000..cd2b835d501 --- /dev/null +++ b/keyboards/m0lly/i2c.c @@ -0,0 +1,166 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency +#define SCL_CLOCK 800000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/m0lly/info.json b/keyboards/m0lly/info.json new file mode 100644 index 00000000000..f2ac456b16e --- /dev/null +++ b/keyboards/m0lly/info.json @@ -0,0 +1,97 @@ +{ + "keyboard_name": "TKC M0LLY", + "url": "", + "maintainer": "qmk", + "width": 19.5, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Bksp", "x":13, "y":0}, + {"x":14, "y":0}, + {"label":"Num", "x":15.5, "y":0}, + {"label":"/", "x":16.5, "y":0}, + {"label":"*", "x":17.5, "y":0}, + {"label":"-", "x":18.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"7", "x":15.5, "y":1}, + {"label":"8", "x":16.5, "y":1}, + {"label":"9", "x":17.5, "y":1}, + {"x":18.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"ISO ~", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":1.25}, + {"label":"4", "x":15.5, "y":2}, + {"label":"5", "x":16.5, "y":2}, + {"label":"6", "x":17.5, "y":2}, + {"label":"+", "x":18.5, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"label":"1", "x":15.5, "y":3}, + {"label":"2", "x":16.5, "y":3}, + {"label":"3", "x":17.5, "y":3}, + {"x":18.5, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"FN", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}, + {"label":"0", "x":15.5, "y":4}, + {"x":16.5, "y":4}, + {"label":".", "x":17.5, "y":4}, + {"label":"Ent", "x":18.5, "y":4}] + } + } +} diff --git a/keyboards/m0lly/keymaps/default/config.h b/keyboards/m0lly/keymaps/default/config.h new file mode 100644 index 00000000000..ee142927f3a --- /dev/null +++ b/keyboards/m0lly/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define USE_I2C +#define SSD1306OLED +//#define OLED_ROTATE180 +#define SSD1306_ADDRESS 0x3C + +// place overrides here diff --git a/keyboards/m0lly/keymaps/default/keymap.c b/keyboards/m0lly/keymaps/default/keymap.c new file mode 100644 index 00000000000..784deb04a72 --- /dev/null +++ b/keyboards/m0lly/keymaps/default/keymap.c @@ -0,0 +1,149 @@ +/* Copyright 2017 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "LUFA/Drivers/Peripheral/TWI.h" +#include "i2c.h" +#include "ssd1306.h" + + +//Layers + +enum { + BASE = 0, + FUNCTION, +}; + +bool screenWorks = 0; + +//13 characters max without re-writing the "Layer: " format in iota_gfx_task_user() +static char layer_lookup[][14] = {"Base","Function"}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap BASE: (Base Layer) Default Layer + * + * ,-----------------------------------------------------------. .-------------------. + * | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |NumL| / | * | - | + * |-----------------------------------------------------------| |-------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | 7 | 8 | 9 | | + * |-----------------------------------------------------------| |--------------| + | + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | | 4 | 5 | 6 | | + * |-----------------------------------------------------------| |-------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | 1 | 2 | 3 | Ent| + * |-----------------------------------------------------------| |--------------| | + * |Ctrl|Gui |Alt | Space | Alt | Win |FN |Ctr | | 0 | . | | + * `-----------------------------------------------------------' '-------------------' + */ + [BASE] = LAYOUT_all( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, XXXXXXX, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RWIN, MO(FUNCTION), KC_RCTL, KC_P0, XXXXXXX, KC_PDOT, KC_PENT \ + ), + /* Keymap FUNCTION: (Function Layer) + * + * ,-----------------------------------------------------------. .-------------------. + * | | | | | | | | | | | | | | RESET | | | | | | + * |-----------------------------------------------------------| |-------------------| + * | | | | | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| |-------------------| + * | | | | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| |-------------------| + * | |Tog|Mod|Hu+|Hu-|Sa+|Sa-|Va+|Va-|Stp| | | | | | | | + * |-----------------------------------------------------------| |--------------| | + * | | | | | | | | | | | | | + * `-----------------------------------------------------------' '-------------------' + */ + [FUNCTION] = LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, \ + _______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, XXXXXXX, _______, _______, _______, XXXXXXX, \ + _______, _______, _______, _______, _______, _______, MO(FUNCTION), _______, _______, XXXXXXX, _______, _______ \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} + +void matrix_init_user(void) { + #ifdef USE_I2C + i2c_master_init(); + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + if ( iota_gfx_init() ) { // turns on the display + screenWorks = 1; + } + #endif + #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +void matrix_scan_user(void) { + #ifdef SSD1306OLED + if ( screenWorks ) { + iota_gfx_task(); // this is what updates the display continuously + }; + #endif +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif + + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + matrix_write_P(&matrix, PSTR("TKC M0LLY")); + + uint8_t layer = biton32(layer_state); + + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%d", layer); + matrix_write_P(&matrix, PSTR("\nLayer: ")); + matrix_write(&matrix, layer_lookup[layer]); + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n\n%s %s %s", + (host_keyboard_leds() & (1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "m0lly.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + led_init_ports(); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_init_ports(void) { + DDRD |= (1<<2) | (1<<3) | (1<<4); // OUT + DDRB |= (1<<7); // OUT + PORTB |= (1<<7); +} + +void led_set_kb(uint8_t usb_led) { +// led_set_user(usb_led); + if (usb_led & (1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1F, K1G, K1H, K1I, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, K2G, K2H, K2I, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, K3G, K3H, K3I, \ + K40, K41, K42, K45, K49, K4B, K4C, K4D, K4F, K4G, K4H, K4I \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO, K1F, K1G, K1H, K1I }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F, K2G, K2H, K2I }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F, K3G, K3H, K3I }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, KC_NO, K4B, K4C, K4D, KC_NO, K4F, K4G, K4H, K4I } \ +} diff --git a/keyboards/m0lly/rules.mk b/keyboards/m0lly/rules.mk new file mode 100644 index 00000000000..ae6cdcb5350 --- /dev/null +++ b/keyboards/m0lly/rules.mk @@ -0,0 +1,72 @@ + +# MCU name +MCU = at90usb1286 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + +SRC = i2c.c \ + ssd1306.c diff --git a/keyboards/m10a/config.h b/keyboards/m10a/config.h index f052ab62974..f2e6e45e73e 100644 --- a/keyboards/m10a/config.h +++ b/keyboards/m10a/config.h @@ -49,18 +49,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 6 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/m10a/keymaps/default/keymap.c b/keyboards/m10a/keymaps/default/keymap.c index bbf58302fc7..23223960998 100644 --- a/keyboards/m10a/keymaps/default/keymap.c +++ b/keyboards/m10a/keymaps/default/keymap.c @@ -1,7 +1,4 @@ - -#include "m10a.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -23,10 +20,6 @@ enum layers { _LAYER9 }; -// // Fillers to make layering more clear -// #define _______ KC_TRNS -// #define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LAYER0] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}}, [_LAYER1] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}}, diff --git a/keyboards/m10a/keymaps/default/rules.mk b/keyboards/m10a/keymaps/default/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/m10a/keymaps/default/rules.mk +++ b/keyboards/m10a/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/m10a/keymaps/gam3cat/keymap.c b/keyboards/m10a/keymaps/gam3cat/keymap.c index 8f4c878da5e..2d79007fe15 100644 --- a/keyboards/m10a/keymaps/gam3cat/keymap.c +++ b/keyboards/m10a/keymaps/gam3cat/keymap.c @@ -1,6 +1,4 @@ -#include "m10a.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H #include "version.h" extern keymap_config_t keymap_config; @@ -18,46 +16,48 @@ enum layers { _L9 }; -enum m10a_keycodes { - DYNAMIC_MACRO_RANGE = SAFE_RANGE, +enum custom_keycodes { + QMK_REV = SAFE_RANGE, + KC_WEB, + KC_WCLS, + DYNAMIC_MACRO_RANGE }; +extern backlight_config_t backlight_config; + #include "dynamic_macro.h" -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define FN_ZERO LT(_L9, KC_0) +#define FN_ZERO LT(_L9, KC_KP_0) #define KC_DMR1 DYN_REC_START1 #define KC_DMR2 DYN_REC_START2 #define KC_DMP1 DYN_MACRO_PLAY1 #define KC_DMP2 DYN_MACRO_PLAY2 #define KC_DMRS DYN_REC_STOP -static uint8_t current_layer; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* .-----------. .-----------. .-----------. .-----------. .-----------. - * | 7| 8| 9| | +| -| *| | ^| &| !| |VLU|Ver|WFD| |VLU|NXT|FFD| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * | 4| 5| 6| | /| %| ,| | D| E| F| |MUT|C-W|CHR| |MUT|STP|PLY| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * | 1| 2| 3| | .| =|Ent| | A| B| C| |VLD|CMP|WBK| |VLD|PRV|RWD| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * |L0 | _L9/0| |L1 | _L9 | |L2 | _L9 | |L3 | _L9 | |L4 | _L9 | - * *-----------* *-----------* *-----------* *-----------* *-----------* - * .-----------. .-----------. .-----------. .-----------. .-----------. - * | | | | | | | | |MP1| |MP2| | | |RST| |_L6|_L7|_L8| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * | | | | | | | | | |MRS| | | | | | |_L3|_L4|_L5| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * | | | | | | | | |MR1| |MR2| | | | | |_L0|_L1|_L2| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * |L5 | _L9 | |L6 | _L9 | |L7 | _L9 | |L8 | _L9 | |L9 | | - * *-----------* *-----------* *-----------* *-----------* *-----------* + /*## Layout Config: + * .-----------. .-----------. .-----------. .-----------. .-----------. + * |7 |8 |9 | |+ |- |* | |^ |& |! | |VLU|Ver|WFD| |VLU|NXT|FFD| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * |4 |5 |6 | |/ |% |, | |D |E |F | |MUT|C-W|CHR| |MUT|STP|PLY| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * |1 |2 |3 | |. |= |Ent| |A |B |C | |VLD|CMP|WBK| |VLD|PRV|RWD| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * |#L0|_L9/0 | |#L1|_L9 | |#L2|_L9 | |#L3|_L9 | |#L4|_L9 | + * *-----------* *-----------* *-----------* *-----------* *-----------* + * .-----------. .-----------. .-----------. .-----------. .-----------. + * | | | | | | | | |MP1| |MP2| | | |RST| |_L6|_L7|_L8| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * | | | | | | | | | |MRS| | | | | | |_L3|_L4|_L5| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * | | | | | | | | |MR1| |MR2| | | | | |_L0|_L1|_L2| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * |#L5|_L9 | |#L6|_L9 | |#L7|_L9 | |#L8|_L9 | |#L9| | + * *-----------* *-----------* *-----------* *-----------* *-----------* */ - [_L0] = {{KC_7, KC_8, KC_9 }, {KC_4, KC_5, KC_6 }, {KC_1, KC_2, KC_3 }, {XXXXXXX, XXXXXXX, FN_ZERO}}, + [_L0] = {{KC_KP_7, KC_KP_8, KC_KP_9}, {KC_KP_4, KC_KP_5, KC_KP_6}, {KC_KP_1, KC_KP_2, KC_KP_3}, {XXXXXXX, XXXXXXX, FN_ZERO}}, [_L1] = {{KC_PPLS, KC_PMNS, KC_PAST}, {KC_PSLS, KC_PERC, KC_COMM}, {KC_PDOT, KC_EQL, KC_PENT}, {XXXXXXX, XXXXXXX, MO(_L9)}}, [_L2] = {{KC_CIRC, KC_AMPR, KC_EXLM}, {S(KC_D), S(KC_E), S(KC_F)}, {S(KC_A), S(KC_B), S(KC_C)}, {XXXXXXX, XXXXXXX, MO(_L9)}}, - [_L3] = {{KC_VOLU, F(0), KC_WFWD}, {KC_MUTE, M(1), M(0) }, {KC_VOLD, KC_MYCM, KC_WBAK}, {XXXXXXX, XXXXXXX, MO(_L9)}}, + [_L3] = {{KC_VOLU, QMK_REV, KC_WFWD}, {KC_MUTE, KC_WCLS, KC_WEB }, {KC_VOLD, KC_MYCM, KC_WBAK}, {XXXXXXX, XXXXXXX, MO(_L9)}}, [_L4] = {{KC_VOLU, KC_MNXT, KC_MFFD}, {KC_MUTE, KC_MSTP, KC_MPLY}, {KC_VOLD, KC_MPRV, KC_MRWD}, {XXXXXXX, XXXXXXX, MO(_L9)}}, [_L5] = {{_______, _______, _______}, {_______, _______, _______}, {_______, _______, _______}, {XXXXXXX, XXXXXXX, MO(_L9)}}, [_L6] = {{_______, _______, _______}, {_______, _______, _______}, {_______, _______, _______}, {XXXXXXX, XXXXXXX, MO(_L9)}}, @@ -66,96 +66,93 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_L9] = {{DF(_L6), DF(_L7), DF(_L8)}, {DF(_L3), DF(_L4), DF(_L5)}, {DF(_L0), DF(_L1), DF(_L2)}, {XXXXXXX, XXXXXXX, _______}}, }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMK_REV: if (record->event.pressed) { - return MACRO(I(10), D(LGUI), T(R), U(LGUI), END); + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE); } - else { + return false; + break; + case KC_WEB: + if (record->event.pressed) { + SEND_STRING(SS_LGUI("r")); + wait_ms(100); SEND_STRING("chrome.exe\n"); - return false; } - break; - case 1: + return false; + break; + case KC_WCLS: if (record->event.pressed) { - return MACRO(I(10), D(LCTL), T(W), U(LCTL), END); + SEND_STRING (SS_LCTRL("w")); } - break; + return false; + break; } - return MACRO_NONE; -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(0), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case 0: - if (record->event.pressed) { - SEND_STRING ("[Keyboard: " QMK_KEYBOARD "] -- [QMK Version: " QMK_VERSION "] -- [Keymap: " QMK_KEYMAP "]"); - } - break; + // Dynamic Macros. + if (!process_record_dynamic_macro(keycode, record)) { + return false; } + return true; +} + +void custom_backlight_level(uint8_t level) { + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + backlight_config.level = level; + backlight_config.enable = !!backlight_config.level; + backlight_set(backlight_config.level); } void matrix_init_user(void) { #ifdef BACKLIGHT_ENABLE - backlight_level(0); + custom_backlight_level(0); #endif } -// Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - if (current_layer == layer) { - } - else { - current_layer = layer; - switch (layer) { - case 0: - backlight_level(0); - break; - case 1: - backlight_level(1); - break; - case 2: - backlight_level(2); - break; - case 3: - backlight_level(3); - break; - case 4: - backlight_level(4); - break; - case 5: - backlight_level(5); - break; - case 6: - backlight_level(6); - break; - case 7: - backlight_level(6); - break; - case 8: - backlight_level(6); - break; - case 9: - backlight_level(0); - break; - default: - backlight_level(0); - break; - } - } } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // Enable Dynamic Macros. - if (!process_record_dynamic_macro(keycode, record)) { - return false; +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _L0: + custom_backlight_level(0); + break; + case _L1: + custom_backlight_level(1); + break; + case _L2: + custom_backlight_level(2); + break; + case _L3: + custom_backlight_level(3); + break; + case _L4: + custom_backlight_level(4); + break; + case _L5: + custom_backlight_level(5); + break; + case _L6: + custom_backlight_level(6); + break; + case _L7: + custom_backlight_level(6); + break; + case _L8: + custom_backlight_level(6); + break; + case _L9: + custom_backlight_level(0); + break; + default: + custom_backlight_level(0); + break; } - return true; + return state; +} + +void led_set_user(uint8_t usb_led) { + } diff --git a/keyboards/m10a/keymaps/gam3cat/readme.md b/keyboards/m10a/keymaps/gam3cat/readme.md index 879a6c5a377..5c68e8c8936 100644 --- a/keyboards/m10a/keymaps/gam3cat/readme.md +++ b/keyboards/m10a/keymaps/gam3cat/readme.md @@ -2,13 +2,13 @@ make m10a:gam3cat ## Layout Config: .-----------. .-----------. .-----------. .-----------. .-----------. - | 7| 8| 9| | +| -| *| | ^| &| !| |VLU|Ver|WFD| |VLU|NXT|FFD| + |7 |8 |9 | |+ |- |* | |^ |& |! | |VLU|Ver|WFD| |VLU|NXT|FFD| |-----------| |-----------| |-----------| |-----------| |-----------| - | 4| 5| 6| | /| %| ,| | D| E| F| |MUT|C-W|CHR| |MUT|STP|PLY| + |4 |5 |6 | |/ |% |, | |D |E |F | |MUT|C-W|CHR| |MUT|STP|PLY| |-----------| |-----------| |-----------| |-----------| |-----------| - | 1| 2| 3| | .| =|Ent| | A| B| C| |VLD|CMP|WBK| |VLD|PRV|RWD| + |1 |2 |3 | |. |= |Ent| |A |B |C | |VLD|CMP|WBK| |VLD|PRV|RWD| |-----------| |-----------| |-----------| |-----------| |-----------| - |L0 | _L9/0| |L1 | _L9 | |L2 | _L9 | |L3 | _L9 | |L4 | _L9 | + |#L0|_L9/0 | |#L1|_L9 | |#L2|_L9 | |#L3|_L9 | |#L4|_L9 | *-----------* *-----------* *-----------* *-----------* *-----------* .-----------. .-----------. .-----------. .-----------. .-----------. | | | | | | | | |MP1| |MP2| | | |RST| |_L6|_L7|_L8| @@ -17,5 +17,5 @@ make m10a:gam3cat |-----------| |-----------| |-----------| |-----------| |-----------| | | | | | | | | |MR1| |MR2| | | | | |_L0|_L1|_L2| |-----------| |-----------| |-----------| |-----------| |-----------| - |L5 | _L9 | |L6 | _L9 | |L7 | _L9 | |L8 | _L9 | |L9 | | + |#L5|_L9 | |#L6|_L9 | |#L7|_L9 | |#L8|_L9 | |#L9| | *-----------* *-----------* *-----------* *-----------* *-----------* diff --git a/keyboards/m10a/keymaps/gam3cat/rules.mk b/keyboards/m10a/keymaps/gam3cat/rules.mk index 457a3d01d4a..00515a31e9e 100644 --- a/keyboards/m10a/keymaps/gam3cat/rules.mk +++ b/keyboards/m10a/keymaps/gam3cat/rules.mk @@ -1,3 +1,24 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +TAP_DANCE_ENABLE = no # Enable TapDance functionality +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+1500) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # Nkey Rollover - If this doesn't work, add this to config.h: #define FORCE_NKRO +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = no # Enable extended unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Uses buzzer to emulate clicky switches. By default, uses the C6 pin, same as AUDIO_ENABLE. +#VARIABLE_TRACE = no # Use this to debug changes to variable values +API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings(+5390) +KEY_LOCK_ENABLE = no # This enables key lock(+260) +SPLIT_KEYBOARD = no # This enables split keyboard support and includes all necessary files located at quantum/split_common diff --git a/keyboards/m10a/readme.md b/keyboards/m10a/readme.md index 6e48b228571..7123e6462e7 100644 --- a/keyboards/m10a/readme.md +++ b/keyboards/m10a/readme.md @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make m10a:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/m10a/rules.mk b/keyboards/m10a/rules.mk index 0a00c7ccb38..905babacb99 100644 --- a/keyboards/m10a/rules.mk +++ b/keyboards/m10a/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/massdrop/alt/config.h b/keyboards/massdrop/alt/config.h index a486f34a0c4..d8389fc0093 100644 --- a/keyboards/massdrop/alt/config.h +++ b/keyboards/massdrop/alt/config.h @@ -32,31 +32,73 @@ along with this program. If not, see . #define MATRIX_ROWS 5 #define MATRIX_COLS 15 +/* MCU Port name definitions */ #define PA 0 #define PB 1 +/* Port and Pin definition of key row hardware configuration */ #define MATRIX_ROW_PORTS PA, PA, PA, PA, PA #define MATRIX_ROW_PINS 0, 1, 2, 3, 4 +/* Port and Pin definition of key column hardware configuration */ #define MATRIX_COL_PORTS PB, PB, PB, PB, PB, PB, PB, PB, PB, PB, PA, PA, PA, PA, PA #define MATRIX_COL_PINS 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 10, 11 -/* Print boot debug codes using debug LED when M28 and M30 shorted */ -#define DEBUG_BOOT_TRACING +/* This Shift Register expands available hardware output lines to control additional peripherals */ +/* It uses four lines from the MCU to provide 16 output lines */ +/* Shift Register Clock configuration (MCU to ShiftRegister.RCLK) */ +#define SR_EXP_RCLK_PORT PB +#define SR_EXP_RCLK_PIN 14 +/* Shift Register Output Enable configuration (MCU to ShiftRegister.OE_N) */ +#define SR_EXP_OE_N_PORT PB +#define SR_EXP_OE_N_PIN 15 +/* SERCOM port to use for Shift Register SPI */ +/* DATAOUT and SCLK must be configured to use hardware pins of this port */ +#define SR_EXP_SERCOM SERCOM2 +/* Shift Register SPI Data Out configuration (MCU.SERCOMx.PAD[0] to ShiftRegister.SER) */ +#define SR_EXP_DATAOUT_PORT PA +#define SR_EXP_DATAOUT_PIN 12 +#define SR_EXP_DATAOUT_MUX 2 +/* Shift Register SPI Serial Clock configuration (MCU.SERCOMx.PAD[1] to ShiftRegister.SRCLK) */ +#define SR_EXP_SCLK_PORT PA +#define SR_EXP_SCLK_PIN 13 +#define SR_EXP_SCLK_MUX 2 + +/* Debug LED (Small LED Located near MCU) */ +#define DEBUG_LED_ENABLE 1 +#define DEBUG_LED_PORT PA +#define DEBUG_LED_PIN 27 + +/* Additional debugging ports */ +/* PCB M21 */ +#define DEBUG_PORT1_ENABLE 1 +#define DEBUG_PORT1_PORT PB +#define DEBUG_PORT1_PIN 3 +/* PCB M23 */ +#define DEBUG_PORT2_ENABLE 1 +#define DEBUG_PORT2_PORT PB +#define DEBUG_PORT2_PIN 17 +/* PCB M25 */ +#define DEBUG_PORT3_ENABLE 1 +#define DEBUG_PORT3_PORT PA +#define DEBUG_PORT3_PIN 20 + +/* Debug Boot Tracing - During boot sequence, ground this pin to halt and display debug code using Debug LED */ +/* This is useful in determining which hardware device may have malfunctioned or is improperly configured */ +/* Feature is automatically disabled after successful boot */ +/* PCB M27 */ +#define DEBUG_BOOT_TRACING_ENABLE 1 +#define DEBUG_BOOT_TRACING_PORT PB +#define DEBUG_BOOT_TRACING_PIN 23 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Force boot in NKRO mode */ //#define FORCE_NKRO @@ -77,3 +119,9 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION + +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_LED_PROCESS_LIMIT 15 +#define RGB_MATRIX_LED_FLUSH_LIMIT 10 + +#include "config_led.h" diff --git a/keyboards/massdrop/alt/config_led.c b/keyboards/massdrop/alt/config_led.c new file mode 100644 index 00000000000..42d4d1474bb --- /dev/null +++ b/keyboards/massdrop/alt/config_led.c @@ -0,0 +1,59 @@ +#ifdef RGB_MATRIX_ENABLE +#include "alt.h" + +#include "led_matrix.h" +#include "rgb_matrix.h" +#include "config_led.h" + +// This table can be almost-automatically derived from ISSI3733_LED_MAP that is +// defined in config_led.h + +// You can calculate the (0-244, 0-64) x/y values from the x/y values defined in +// ISSI3733_LED_MAP with the following formula: +// uint8_t rgb_x = ((ISSI3733_LED_MAP[i].x - MIN_X) / (MAX_X - MIN_X)) * 224; +// uint8_t rgb_y = ((ISSI3733_LED_MAP[i].y - MIN_Y) / (MAX_Y - MIN_Y)) * 64; +// Where the min/max vars are the minimum and maximum "bounds" of x/y values +// present in ISSI3733_LED_MAP +// +// The row/col values need to be manually tweaked though, compensating for the +// "empty" cells that are a product of larger keys +// +// There is a quick-and-dirty implementation of this under ledvis.html + +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 }, + { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 66 } +}, { + { 8, 56 }, { 22, 56 }, { 35, 56 }, { 49, 56 }, { 63, 56 }, { 77, 56 }, { 91, 56 }, { 105, 56 }, { 118, 56 }, { 132, 56 }, { 146, 56 }, { 160, 56 }, { 174, 56 }, { 195, 56 }, { 215, 56 }, + { 11, 44 }, { 28, 44 }, { 42, 44 }, { 56, 44 }, { 70, 44 }, { 84, 44 }, { 98, 44 }, { 112, 44 }, { 125, 44 }, { 139, 44 }, { 153, 44 }, { 167, 44 }, { 181, 44 }, { 198, 44 }, { 215, 44 }, + { 13, 32 }, { 32, 32 }, { 46, 32 }, { 60, 32 }, { 73, 32 }, { 87, 32 }, { 101, 32 }, { 115, 32 }, { 129, 32 }, { 143, 32 }, { 156, 32 }, { 170, 32 }, { 193, 32 }, { 215, 32 }, { 16, 19 }, + { 39, 19 }, { 53, 19 }, { 67, 19 }, { 80, 19 }, { 94, 19 }, { 108, 19 }, { 122, 19 }, { 136, 19 }, { 150, 19 }, { 163, 19 }, { 182, 19 }, { 201, 19 }, { 215, 19 }, { 9, 7 }, { 27, 7 }, + { 44, 7 }, { 96, 7 }, { 148, 7 }, { 165, 7 }, { 188, 7 }, { 201, 7 }, { 215, 7 }, + // Underglow LEDs + { 1, 1 }, { 15, 0 }, { 31, 0 }, { 47, 0 }, { 63, 0 }, { 79, 0 }, { 95, 0 }, { 112, 0 }, { 128, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 208, 0 }, { 222, 1 }, + { 224, 13 }, { 224, 25 }, { 224, 38 }, { 224, 50 }, { 222, 62 }, { 191, 64 }, { 179, 64 }, { 167, 64 }, { 153, 64 }, { 139, 64 }, { 125, 64 }, { 112, 64 }, { 98, 64 }, { 84, 64 }, { 70, 64 }, + { 56, 64 }, { 42, 64 }, { 28, 64 }, { 1, 62 }, { 0, 50 }, { 0, 38 }, { 0, 25 }, { 0, 13 } +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, + // Underglow LEDs + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2 +} }; + + +#ifdef USB_LED_INDICATOR_ENABLE +void rgb_matrix_indicators_kb(void) +{ + led_matrix_indicators(); +} +#endif // USB_LED_INDICATOR_ENABLE + +#endif diff --git a/keyboards/massdrop/alt/config_led.h b/keyboards/massdrop/alt/config_led.h index a049e38179a..82117b33279 100644 --- a/keyboards/massdrop/alt/config_led.h +++ b/keyboards/massdrop/alt/config_led.h @@ -15,11 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _config_led_h_ -#define _config_led_h_ +#pragma once //Define number of ISSI3733 drivers being used (1...16) #define ISSI3733_DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL ISSI3733_LED_COUNT //Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) #define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } @@ -30,21 +30,24 @@ along with this program. If not, see . //Count of LED bodies #define ISSI3733_LED_COUNT 105 -//Default Global Current Register value (Default brightness 0 - 255) -#define ISSI3733_GCR_DEFAULT 128 - #define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus #define LED_GCR_STEP 10 //GCR increment/decrement value -//Automatic power rollback and recovery -#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) -#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) -#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) - +#ifdef USE_MASSDROP_CONFIGURATOR #define ANIMATION_SPEED_STEP 1 +#define BREATHE_STEP 1 #define BREATHE_MIN_STEP 0 #define BREATHE_MAX_STEP 255 +#endif + +//Default Global Current Register value (Default brightness 0 - 255) +#define ISSI3733_GCR_DEFAULT LED_GCR_MAX + +//Automatic power rollback and recovery +#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) +#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) +#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) //LED Mapping - More practically generated from a spreadsheet program //id: ID of the LED (Sync with PCB callouts) @@ -174,5 +177,3 @@ along with this program. If not, see . #define USB_LED_COMPOSE_SCANCODE 255 #define USB_LED_KANA_SCANCODE 255 #endif //USB_LED_INDICATOR_ENABLE - -#endif //_config_led_h_ diff --git a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c new file mode 100644 index 00000000000..f6f79ad91ef --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c @@ -0,0 +1,127 @@ +#include QMK_KEYBOARD_H + +enum alt_keycodes { + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MUTE, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} diff --git a/keyboards/massdrop/alt/keymaps/default/keymap.c b/keyboards/massdrop/alt/keymaps/default/keymap.c index a5c443ffcde..f6f79ad91ef 100644 --- a/keyboards/massdrop/alt/keymaps/default/keymap.c +++ b/keyboards/massdrop/alt/keymaps/default/keymap.c @@ -1,25 +1,13 @@ #include QMK_KEYBOARD_H enum alt_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints - MD_BOOT, //Restart into bootloader after hold timeout + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -35,27 +23,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_MUTE, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_END, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MUTE, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), /* [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), */ }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { }; @@ -64,90 +48,14 @@ void matrix_init_user(void) { void matrix_scan_user(void) { }; -#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) -#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint32_t key_timer; switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); @@ -187,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/alt/keymaps/default_md/keymap.c b/keyboards/massdrop/alt/keymaps/default_md/keymap.c new file mode 100644 index 00000000000..7969583df4b --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/default_md/keymap.c @@ -0,0 +1,223 @@ +#include QMK_KEYBOARD_H + +enum alt_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase //Working + L_BRD, //LED Brightness Decrease //Working + L_PTN, //LED Pattern Select Next //Working + L_PTP, //LED Pattern Select Previous //Working + L_PSI, //LED Pattern Speed Increase //Working + L_PSD, //LED Pattern Speed Decrease //Working + L_T_MD, //LED Toggle Mode //Working + L_T_ONF, //LED Toggle On / Off //Broken + L_ON, //LED On //Broken + L_OFF, //LED Off //Broken + L_T_BR, //LED Toggle Breath Effect //Working + L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working + U_T_AGCR, //USB Toggle Automatic GCR control //Working + DBG_TOG, //DEBUG Toggle On / Off // + DBG_MTRX, //DEBUG Toggle Matrix Prints // + DBG_KBD, //DEBUG Toggle Keyboard Prints // + DBG_MOU, //DEBUG Toggle Mouse Prints // + MD_BOOT //Restart into bootloader after hold timeout //Working +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MUTE, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} + +led_instruction_t led_instructions[] = { + //LEDs are normally inactive, no processing is performed on them + //Flags are used in matching criteria for an LED to be active and indicate how to color it + //Flags can be found in tmk_core/protocol/arm_atsam/led_matrix.h (prefixed with LED_FLAG_) + //LED IDs can be found in config_led.h in the keyboard's directory + //Examples are below + + //All LEDs use the user's selected pattern (this is the factory default) + { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + + //Specific LEDs use the user's selected pattern while all others are off + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN, .id0 = 0xFFFFFFFF, .id1 = 0xAAAAAAAA, .id2 = 0x55555555, .id3 = 0x11111111 }, + + //Specific LEDs use specified RGB values while all others are off + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFF, .id1 = 0x00FF, .id2 = 0x0000FF00, .id3 = 0xFF000000, .r = 75, .g = 150, .b = 225 }, + + //All LEDs use the user's selected pattern + //On layer 1, all key LEDs (except the top row which keeps active pattern) are red while all edge LEDs are green + //When layer 1 is active, key LEDs use red (id0 32 - 16: 1111 1111 1111 1111 1000 0000 0000 0000 = 0xFFFF8000) (except top row 15 - 1) + //When layer 1 is active, key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //When layer 1 is active, key LEDs use red (id2 67 - 65: 0000 0000 0000 0000 0000 0000 0000 0111 = 0x00000007) + //When layer 1 is active, edge LEDs use green (id2 95 - 68: 1111 1111 1111 1111 1111 1111 1111 1000 = 0xFFFFFFF8) + //When layer 1 is active, edge LEDs use green (id3 105 - 96: 0000 0000 0000 0000 0000 0011 1111 1111 = 0x000003FF) + // { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id0 = 0xFFFF8000, .id1 = 0xFFFFFFFF, .id2 = 0x00000007, .r = 255, .layer = 1 }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id2 = 0xFFFFFFF8, .id3 = 0x000003FF, .g = 127, .layer = 1 }, + + //All key LEDs use red while edge LEDs use the active pattern + //All key LEDs use red (id0 32 - 1: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //All key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //All key LEDs use red (id2 67 - 65: 0000 0000 0000 0000 0000 0000 0000 0111 = 0x00000007) + //Edge uses active pattern (id2 95 - 68: 1111 1111 1111 1111 1111 1111 1111 1000 = 0xFFFFFFF8) + //Edge uses active pattern (id3 105 - 96: 0000 0000 0000 0000 0000 0011 1111 1111 = 0x000003FF) + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFFFFFFFF, .id1 = 0xFFFFFFFF, .id2 = 0x00000007, .r = 255 }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN , .id2 = 0xFFFFFFF8, .id3 = 0x000003FF }, + + //end must be set to 1 to indicate end of instruction set + { .end = 1 } +}; diff --git a/keyboards/massdrop/alt/keymaps/default_md/rules.mk b/keyboards/massdrop/alt/keymaps/default_md/rules.mk new file mode 100644 index 00000000000..064a6f54c1f --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/default_md/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/alt/keymaps/mac/keymap.c b/keyboards/massdrop/alt/keymaps/mac/keymap.c index d6978fd8012..222d7e2c504 100644 --- a/keyboards/massdrop/alt/keymaps/mac/keymap.c +++ b/keyboards/massdrop/alt/keymaps/mac/keymap.c @@ -1,25 +1,13 @@ #include QMK_KEYBOARD_H enum alt_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints - MD_BOOT, //Restart into bootloader after hold timeout + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -35,27 +23,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_MUTE, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_END, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MUTE, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), /* [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), */ }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { }; @@ -64,90 +48,14 @@ void matrix_init_user(void) { void matrix_scan_user(void) { }; -#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) -#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint32_t key_timer; switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); @@ -187,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/alt/keymaps/mac_md/keymap.c b/keyboards/massdrop/alt/keymaps/mac_md/keymap.c new file mode 100644 index 00000000000..8a052cc250e --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/mac_md/keymap.c @@ -0,0 +1,193 @@ +#include QMK_KEYBOARD_H + +enum alt_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase //Working + L_BRD, //LED Brightness Decrease //Working + L_PTN, //LED Pattern Select Next //Working + L_PTP, //LED Pattern Select Previous //Working + L_PSI, //LED Pattern Speed Increase //Working + L_PSD, //LED Pattern Speed Decrease //Working + L_T_MD, //LED Toggle Mode //Working + L_T_ONF, //LED Toggle On / Off //Broken + L_ON, //LED On //Broken + L_OFF, //LED Off //Broken + L_T_BR, //LED Toggle Breath Effect //Working + L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working + U_T_AGCR, //USB Toggle Automatic GCR control //Working + DBG_TOG, //DEBUG Toggle On / Off // + DBG_MTRX, //DEBUG Toggle Matrix Prints // + DBG_KBD, //DEBUG Toggle Keyboard Prints // + DBG_MOU, //DEBUG Toggle Mouse Prints // + MD_BOOT //Restart into bootloader after hold timeout //Working +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MUTE, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} + +led_instruction_t led_instructions[] = { + //Please see ../default_md/keymap.c for examples + + //All LEDs use the user's selected pattern (this is the factory default) + { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + + //end must be set to 1 to indicate end of instruction set + { .end = 1 } +}; diff --git a/keyboards/massdrop/alt/keymaps/mac_md/rules.mk b/keyboards/massdrop/alt/keymaps/mac_md/rules.mk new file mode 100644 index 00000000000..064a6f54c1f --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/mac_md/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/alt/keymaps/reywood/README.md b/keyboards/massdrop/alt/keymaps/reywood/README.md new file mode 100644 index 00000000000..5ee630dfb80 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/README.md @@ -0,0 +1,5 @@ +# THIS KEYMAP IS BROKEN + +The CTRL and ALT have both been switched to using the QMK RGB Matrix system, +rendering any custom effects that used the old, custom Massdrop lighting system, +BROKEN. diff --git a/keyboards/massdrop/alt/keymaps/reywood/keymap.c b/keyboards/massdrop/alt/keymaps/reywood/keymap.c new file mode 100644 index 00000000000..cf60acfe66c --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/keymap.c @@ -0,0 +1,191 @@ +#include QMK_KEYBOARD_H +#include "rgb_matrix_user.h" + +enum alt_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode +#define ______ KC_TRNS + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MUTE, \ + _______, _______, _______, KC_UP, _______, _______, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, KC_MPLY, MO(2), _______, KC_MRWD, KC_VOLD, KC_MFFD \ + ), + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, L_T_MD, L_T_ONF, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + rgb_matrix_record_key_press(record); + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} diff --git a/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.c b/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.c new file mode 100644 index 00000000000..36131e20209 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.c @@ -0,0 +1,193 @@ +#include "quantum.h" +#include "led_matrix.h" + +extern issi3733_led_t *led_cur; +extern uint8_t led_per_run; +extern issi3733_led_t *lede; +extern issi3733_led_t led_map[]; + +static uint16_t last_boost_update; +static uint8_t led_boosts[ISSI3733_LED_COUNT]; +static uint8_t led_boost_index; +static uint8_t led_cur_index; + +#define LED_BOOST_REFRESH_INTERVAL_IN_MS 40 +#define LED_BOOST_DECAY 0.7 +#define LED_BOOST_PROPAGATE 0.5 +#define LED_BOOST_PEAK 100 + +#define MIN_RGB 0x050008 +#define MIN_R (MIN_RGB >> 16 & 0xff) +#define MIN_G (MIN_RGB >> 8 & 0xff) +#define MIN_B (MIN_RGB & 0xff) + +#define MAX_RGB 0xc26eff +#define MAX_R (MAX_RGB >> 16 & 0xff) +#define MAX_G (MAX_RGB >> 8 & 0xff) +#define MAX_B (MAX_RGB & 0xff) + +#define UNDERGLOW_RGB 0x4f002e +#define UNDERGLOW_R (UNDERGLOW_RGB >> 16 & 0xff) +#define UNDERGLOW_G (UNDERGLOW_RGB >> 8 & 0xff) +#define UNDERGLOW_B (UNDERGLOW_RGB & 0xff) + +#define UNDERGLOW_SCAN_CODE 255 + +#define max(a, b) (((a) > (b)) ? (a) : (b)) + +#define __ -1 +static const uint8_t KEY_TO_LED_MAP[MATRIX_ROWS][MATRIX_COLS] = { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, + {15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29}, + {30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, __, 42, 43}, + {44, __, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57}, + {58, 59, 60, __, __, __, 61, __, __, __, 62, 63, 64, 65, 66}, +}; + +#define KEY_LED_COUNT 67 +#define KP(c, r) { .col = c, .row = r } // shorthand for keypos_t +static const keypos_t LED_TO_KEY_MAP[KEY_LED_COUNT] = { + KP(0, 0), KP(1, 0), KP(2, 0), KP(3, 0), KP(4, 0), KP(5, 0), KP(6, 0), KP(7, 0), KP(8, 0), KP(9, 0), KP(10, 0), KP(11, 0), KP(12, 0), KP(13, 0), KP(14, 0), + KP(0, 1), KP(1, 1), KP(2, 1), KP(3, 1), KP(4, 1), KP(5, 1), KP(6, 1), KP(7, 1), KP(8, 1), KP(9, 1), KP(10, 1), KP(11, 1), KP(12, 1), KP(13, 1), KP(14, 1), + KP(0, 2), KP(1, 2), KP(2, 2), KP(3, 2), KP(4, 2), KP(5, 2), KP(6, 2), KP(7, 2), KP(8, 2), KP(9, 2), KP(10, 2), KP(11, 2), KP(13, 2), KP(14, 2), + KP(0, 3), KP(2, 3), KP(3, 3), KP(4, 3), KP(5, 3), KP(6, 3), KP(7, 3), KP(8, 3), KP(9, 3), KP(10, 3), KP(11, 3), KP(12, 3), KP(13, 3), KP(14, 3), + KP(0, 4), KP(1, 4), KP(2, 4), KP(6, 4), KP(10, 4), KP(11, 4), KP(12, 4), KP(13, 4), KP(14, 4), +}; + + +static void update_led_boosts(void); +static void update_led_cur_rgb_values(void); +static void set_nearest_led_to_max(uint8_t col, uint8_t row); +static uint8_t calculate_new_color_component_value(uint8_t max, uint8_t min); +static void calculate_new_led_boosts(uint8_t new_led_boosts[]); +static uint8_t calculate_new_led_boost_at(int index); +static uint8_t get_propagated_boost_from_neighbors(int led_position); +static uint8_t get_led_boost_at_keypos(uint8_t row, uint8_t col); +static void set_new_led_boosts(uint8_t* new_led_boosts); +static uint8_t map_key_position_to_led_index(uint8_t col, uint8_t row); + + +void rgb_matrix_init_user(void) { + for (int i = 0; i < ISSI3733_LED_COUNT; i++) { + led_boosts[i] = 0; + } + last_boost_update = timer_read(); + led_boost_index = 0; + led_cur_index = 0; +} + +void led_matrix_run(void) { + uint8_t led_this_run = 0; + + if (led_cur == 0) { //Denotes start of new processing cycle in the case of chunked processing + led_cur = led_map; + led_cur_index = 0; + } + update_led_boosts(); + + while (led_cur < lede && led_this_run < led_per_run) { + update_led_cur_rgb_values(); + + led_cur++; + led_cur_index++; + led_this_run++; + } +} + +void rgb_matrix_record_key_press(keyrecord_t *record) { + if (record->event.pressed) { + keypos_t key = record->event.key; + set_nearest_led_to_max(key.col, key.row); + } +} + + +static void update_led_boosts(void) { + if (timer_elapsed(last_boost_update) > LED_BOOST_REFRESH_INTERVAL_IN_MS) { + last_boost_update = timer_read(); + + uint8_t new_led_boosts[ISSI3733_LED_COUNT]; + calculate_new_led_boosts(new_led_boosts); + set_new_led_boosts(new_led_boosts); + } +} + +static void update_led_cur_rgb_values(void) { + if (led_cur->scan == UNDERGLOW_SCAN_CODE) { + *led_cur->rgb.r = UNDERGLOW_R; + *led_cur->rgb.g = UNDERGLOW_G; + *led_cur->rgb.b = UNDERGLOW_B; + } else { + *led_cur->rgb.r = calculate_new_color_component_value(MAX_R, MIN_R); + *led_cur->rgb.g = calculate_new_color_component_value(MAX_G, MIN_G); + *led_cur->rgb.b = calculate_new_color_component_value(MAX_B, MIN_B); + } +} + +static void set_nearest_led_to_max(uint8_t col, uint8_t row) { + uint8_t led_index = map_key_position_to_led_index(col, row); + if (led_index >= 0 && led_index < ISSI3733_LED_COUNT) { + led_boosts[led_index] = LED_BOOST_PEAK; + } +} + +static uint8_t calculate_new_color_component_value(uint8_t max, uint8_t min) { + uint8_t current_boost = led_boosts[led_cur_index]; + return (float)(max - min) * current_boost / LED_BOOST_PEAK + min; +} + +static void calculate_new_led_boosts(uint8_t new_led_boosts[]) { + for (int i = 0; i < ISSI3733_LED_COUNT; i++) { + new_led_boosts[i] = calculate_new_led_boost_at(i); + } +} + +static uint8_t calculate_new_led_boost_at(int index) { + uint8_t decayed_boost = led_boosts[index] * LED_BOOST_DECAY; + uint8_t propagated_boost = get_propagated_boost_from_neighbors(index); + uint8_t new_boost = (propagated_boost > decayed_boost) ? propagated_boost : decayed_boost; + if (new_boost > LED_BOOST_PEAK) { + new_boost = LED_BOOST_PEAK; + } + return new_boost; +} + +static uint8_t get_propagated_boost_from_neighbors(int led_position) { + if (led_position < 0 || led_position >= KEY_LED_COUNT) { + return 0; + } + keypos_t led_keypos = LED_TO_KEY_MAP[led_position]; + uint8_t top_boost = get_led_boost_at_keypos(led_keypos.row - 1, led_keypos.col); + uint8_t bottom_boost = get_led_boost_at_keypos(led_keypos.row + 1, led_keypos.col); + uint8_t left_boost = get_led_boost_at_keypos(led_keypos.row, led_keypos.col - 1); + uint8_t right_boost = get_led_boost_at_keypos(led_keypos.row, led_keypos.col + 1); + uint8_t max_boost = max(max(top_boost, bottom_boost), max(left_boost, right_boost)); + if (max_boost > LED_BOOST_PEAK) { + max_boost = LED_BOOST_PEAK; + } + return max_boost * LED_BOOST_PROPAGATE; +} + +static uint8_t get_led_boost_at_keypos(uint8_t row, uint8_t col) { + if (row < 0 || row >= MATRIX_ROWS || col < 0 || col >= MATRIX_COLS) { + return 0; + } + uint8_t led_index = KEY_TO_LED_MAP[row][col]; + if (led_index < 0) { + return 0; + } + return led_boosts[led_index]; +} + +static void set_new_led_boosts(uint8_t* new_led_boosts) { + for (int i = 0; i < ISSI3733_LED_COUNT; i++) { + led_boosts[i] = new_led_boosts[i]; + } +} + +static uint8_t map_key_position_to_led_index(uint8_t col, uint8_t row) { + if (row >= 0 && row < MATRIX_ROWS && col >= 0 && col < MATRIX_COLS) { + return KEY_TO_LED_MAP[row][col]; + } + return -1; +} diff --git a/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.h b/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.h new file mode 100644 index 00000000000..4ffd202e9b8 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.h @@ -0,0 +1,3 @@ +#pragma once + +void rgb_matrix_record_key_press(keyrecord_t *record); diff --git a/keyboards/massdrop/alt/keymaps/reywood/rules.mk b/keyboards/massdrop/alt/keymaps/reywood/rules.mk new file mode 100644 index 00000000000..956d1c700c2 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/rules.mk @@ -0,0 +1,35 @@ +# project specific files +SRC += rgb_matrix_user.c + +#For platform and packs +ARM_ATSAM = SAMD51J18A +MCU = cortex-m4 + +CUSTOM_MATRIX = yes + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +VIRTSER_ENABLE = no # USB Serial Driver +RAW_ENABLE = no # Raw device +AUTO_SHIFT_ENABLE = no # Auto Shift + +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/alt/led_programs.c b/keyboards/massdrop/alt/led_programs.c deleted file mode 100644 index b3b7a7e90e7..00000000000 --- a/keyboards/massdrop/alt/led_programs.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "alt.h" -#include "led_matrix.h" - -//Teal <-> Salmon -led_setup_t leds_teal_salmon[] = { - { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, - { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, - { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Yellow -led_setup_t leds_yellow[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Off -led_setup_t leds_off[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Red -led_setup_t leds_red[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Green -led_setup_t leds_green[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Blue -led_setup_t leds_blue[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White -led_setup_t leds_white[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White with moving red stripe -led_setup_t leds_white_with_red_stripe[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, - { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, - { .end = 1 }, -}; - -//Black with moving red stripe -led_setup_t leds_black_with_red_stripe[] = { - { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .end = 1 }, -}; - -//Rainbow no scrolling -led_setup_t leds_rainbow_ns[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, - { .end = 1 }, -}; - -//Rainbow scrolling -led_setup_t leds_rainbow_s[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .end = 1 }, -}; - -//Add new LED animations here using one from above as example -//The last entry must be { .end = 1 } -//Add the new animation name to the list below following its format - -void *led_setups[] = { - leds_rainbow_s, - leds_rainbow_ns, - leds_teal_salmon, - leds_yellow, - leds_red, - leds_green, - leds_blue, - leds_white, - leds_white_with_red_stripe, - leds_black_with_red_stripe, - leds_off -}; - -const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/massdrop/alt/matrix.c b/keyboards/massdrop/alt/matrix.c index 75a4d62b994..3141155712a 100644 --- a/keyboards/massdrop/alt/matrix.c +++ b/keyboards/massdrop/alt/matrix.c @@ -75,12 +75,10 @@ void matrix_init(void) PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low } - + matrix_init_quantum(); } -#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) - uint64_t mdebouncing = 0; uint8_t matrix_scan(void) { @@ -89,9 +87,7 @@ uint8_t matrix_scan(void) uint8_t col; uint32_t scans[2]; //PA PB - if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active - - //m15_off; //Profiling scans + if (timer_read64() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer @@ -99,7 +95,7 @@ uint8_t matrix_scan(void) { PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output - CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output + wait_us(1); //Delay for output scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data @@ -132,11 +128,9 @@ uint8_t matrix_scan(void) else { //Begin or extend debounce on change - mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; + mdebouncing = timer_read64() + DEBOUNCE; } - //m15_on; //Profiling scans - matrix_scan_quantum(); return 1; diff --git a/keyboards/massdrop/alt/rules.mk b/keyboards/massdrop/alt/rules.mk index c5539158f58..aa45c68056d 100644 --- a/keyboards/massdrop/alt/rules.mk +++ b/keyboards/massdrop/alt/rules.mk @@ -1,6 +1,6 @@ # project specific files -SRC = led_programs.c -SRC += matrix.c +SRC = matrix.c +SRC += config_led.c #For platform and packs ARM_ATSAM = SAMD51J18A @@ -31,3 +31,6 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) VIRTSER_ENABLE = no # USB Serial Driver RAW_ENABLE = no # Raw device AUTO_SHIFT_ENABLE = no # Auto Shift + +# Custom RGB matrix handling +RGB_MATRIX_ENABLE = custom diff --git a/keyboards/massdrop/ctrl/config.h b/keyboards/massdrop/ctrl/config.h index 1ab7f93cddc..215a2e1b19b 100644 --- a/keyboards/massdrop/ctrl/config.h +++ b/keyboards/massdrop/ctrl/config.h @@ -32,31 +32,73 @@ along with this program. If not, see . #define MATRIX_ROWS 11 #define MATRIX_COLS 8 +/* MCU Port name definitions */ #define PA 0 #define PB 1 +/* Port and Pin definition of key row hardware configuration */ #define MATRIX_ROW_PORTS PB, PB, PB, PB, PB, PB, PA, PA, PB, PB, PB #define MATRIX_ROW_PINS 4, 5, 6, 7, 8, 9, 10, 11, 10, 11, 12 +/* Port and Pin definition of key column hardware configuration */ #define MATRIX_COL_PORTS PA, PA, PA, PA, PA, PA, PA, PA #define MATRIX_COL_PINS 0, 1, 2, 3, 4, 5, 6, 7 -/* Print boot debug codes using debug LED when M28 and M30 shorted */ -#define DEBUG_BOOT_TRACING +/* This Shift Register expands available hardware output lines to control additional peripherals */ +/* It uses four lines from the MCU to provide 16 output lines */ +/* Shift Register Clock configuration (MCU to ShiftRegister.RCLK) */ +#define SR_EXP_RCLK_PORT PB +#define SR_EXP_RCLK_PIN 14 +/* Shift Register Output Enable configuration (MCU to ShiftRegister.OE_N) */ +#define SR_EXP_OE_N_PORT PB +#define SR_EXP_OE_N_PIN 15 +/* SERCOM port to use for Shift Register SPI */ +/* DATAOUT and SCLK must be configured to use hardware pins of this port */ +#define SR_EXP_SERCOM SERCOM2 +/* Shift Register SPI Data Out configuration (MCU.SERCOMx.PAD[0] to ShiftRegister.SER) */ +#define SR_EXP_DATAOUT_PORT PA +#define SR_EXP_DATAOUT_PIN 12 +#define SR_EXP_DATAOUT_MUX 2 +/* Shift Register SPI Serial Clock configuration (MCU.SERCOMx.PAD[1] to ShiftRegister.SRCLK) */ +#define SR_EXP_SCLK_PORT PA +#define SR_EXP_SCLK_PIN 13 +#define SR_EXP_SCLK_MUX 2 + +/* Debug LED (Small LED Located near MCU) */ +#define DEBUG_LED_ENABLE 1 +#define DEBUG_LED_PORT PA +#define DEBUG_LED_PIN 27 + +/* Additional debugging ports */ +/* PCB M21 */ +#define DEBUG_PORT1_ENABLE 1 +#define DEBUG_PORT1_PORT PB +#define DEBUG_PORT1_PIN 3 +/* PCB M23 */ +#define DEBUG_PORT2_ENABLE 1 +#define DEBUG_PORT2_PORT PB +#define DEBUG_PORT2_PIN 17 +/* PCB M25 */ +#define DEBUG_PORT3_ENABLE 1 +#define DEBUG_PORT3_PORT PA +#define DEBUG_PORT3_PIN 20 + +/* Debug Boot Tracing - During boot sequence, ground this pin to halt and display debug code using Debug LED */ +/* This is useful in determining which hardware device may have malfunctioned or is improperly configured */ +/* Feature is automatically disabled after successful boot */ +/* PCB M27 */ +#define DEBUG_BOOT_TRACING_ENABLE 1 +#define DEBUG_BOOT_TRACING_PORT PB +#define DEBUG_BOOT_TRACING_PIN 23 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Force boot in NKRO mode */ //#define FORCE_NKRO @@ -77,3 +119,9 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION + +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_LED_PROCESS_LIMIT 15 +#define RGB_MATRIX_LED_FLUSH_LIMIT 10 + +#include "config_led.h" diff --git a/keyboards/massdrop/ctrl/config_led.c b/keyboards/massdrop/ctrl/config_led.c new file mode 100644 index 00000000000..448793cf5d9 --- /dev/null +++ b/keyboards/massdrop/ctrl/config_led.c @@ -0,0 +1,82 @@ +#ifdef RGB_MATRIX_ENABLE +#include "ctrl.h" + +#include "led_matrix.h" +#include "rgb_matrix.h" +#include "config_led.h" + +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 16, 17, 18, 19, 20, 21, 22, 23 }, + { 33, 34, 35, 36, 37, 38, 39, 40 }, + { 50, 51, 52, 53, 54, 55, 56, 57 }, + { 63, 64, 65, 66, 67, 68, 69, 70 }, + { 76, 77, 78, 79, 80, 81, 82, 83 }, + { 8, 9, 10, 11, 12, 13, 14, 15 }, + { 24, 25, 26, 27, 28, 29, 30, 31 }, + { 41, 42, 43, 44, 45, 46, 47, 48 }, + { 58, 59, 60, 61, 62, 75, 49, 32 }, + { 71, 72, 73, 74, 84, 85, 86, NO_LED } +}, { + // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS + { 7, 5 }, { 31, 5 }, { 43, 5 }, { 55, 5 }, { 67, 5 }, { 85, 5 }, { 97, 5 }, { 109, 5 }, + { 121, 5 }, { 139, 5 }, { 151, 5 }, { 163, 5 }, { 175, 5 }, { 193, 5 }, { 205, 5 }, { 217, 5 }, + // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP + { 7, 20 }, { 19, 20 }, { 31, 20 }, { 43, 20 }, { 55, 20 }, { 67, 20 }, { 79, 20 }, { 91, 20 }, + { 103, 20 }, { 115, 20 }, { 127, 20 }, { 139, 20 }, { 151, 20 }, { 169, 20 }, { 193, 20 }, { 205, 20 }, + { 217, 20 }, + // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN + { 10, 30 }, { 25, 30 }, { 37, 30 }, { 49, 30 }, { 61, 30 }, { 73, 30 }, { 85, 30 }, { 97, 30 }, + { 109, 30 }, { 121, 30 }, { 133, 30 }, { 145, 30 }, { 157, 30 }, { 172, 30 }, { 193, 30 }, { 205, 30 }, + { 217, 30 }, + // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT + { 11, 39 }, { 28, 39 }, { 40, 39 }, { 52, 39 }, { 64, 39 }, { 76, 39 }, { 88, 39 }, { 100, 39 }, + { 112, 39 }, { 124, 39 }, { 136, 39 }, { 148, 39 }, { 168, 39 }, + // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP + { 14, 49 }, { 34, 49 }, { 46, 49 }, { 58, 49 }, { 70, 49 }, { 82, 49 }, { 94, 49 }, { 106, 49 }, + { 118, 49 }, { 130, 49 }, { 142, 49 }, { 165, 49 }, { 205, 49 }, + // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + { 8, 59 }, { 23, 59 }, { 38, 59 }, { 83, 59 }, { 129, 59 }, { 144, 59 }, { 159, 59 }, { 174, 59 }, + { 193, 59 }, { 205, 59 }, { 217, 59 }, + // Underglow / Border + { 224, 64 }, { 204, 64 }, { 186, 64 }, { 167, 64 }, { 149, 64 }, { 130, 64 }, { 112, 64 }, { 94, 64 }, + { 75, 64 }, { 57, 64 }, { 38, 64 }, { 20, 64 }, { 0, 64 }, { 0, 47 }, { 0, 32 }, { 0, 17 }, + { 0, 0 }, { 20, 0 }, { 38, 0 }, { 57, 0 }, { 75, 0 }, { 94, 0 }, { 112, 0 }, { 130, 0 }, + { 149, 0 }, { 167, 0 }, { 186, 0 }, { 204, 0 }, { 224, 0 }, { 224, 17 }, { 224, 32 }, { 224, 47 } +}, { + // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS + 1, 4, 4, 4, 4, 1, 1, 1, + 1, 4, 4, 4, 4, 1, 1, 1, + // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 1, + 1, + // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 1, 1, + 1, + // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 1, + // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, + // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + 1, 1, 1, 4, 1, 1, 1, 1, + 1, 1, 1, + // Underglow / Border + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2 +} }; + + +#ifdef USB_LED_INDICATOR_ENABLE +void rgb_matrix_indicators_kb(void) +{ + led_matrix_indicators(); +} +#endif // USB_LED_INDICATOR_ENABLE + +#endif diff --git a/keyboards/massdrop/ctrl/config_led.h b/keyboards/massdrop/ctrl/config_led.h index 471ab7007d1..0c91a0c80ba 100644 --- a/keyboards/massdrop/ctrl/config_led.h +++ b/keyboards/massdrop/ctrl/config_led.h @@ -15,11 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _config_led_h_ -#define _config_led_h_ +#pragma once //Define number of ISSI3733 drivers being used (1...16) #define ISSI3733_DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL ISSI3733_LED_COUNT //Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) #define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } @@ -30,21 +30,24 @@ along with this program. If not, see . //Count of LED bodies #define ISSI3733_LED_COUNT 119 -//Default Global Current Register value (Default brightness 0 - 255) -#define ISSI3733_GCR_DEFAULT 128 - #define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus #define LED_GCR_STEP 10 //GCR increment/decrement value -//Automatic power rollback and recovery -#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) -#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) -#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) - +#ifdef USE_MASSDROP_CONFIGURATOR #define ANIMATION_SPEED_STEP 1 +#define BREATHE_STEP 1 #define BREATHE_MIN_STEP 0 #define BREATHE_MAX_STEP 255 +#endif + +//Default Global Current Register value (Default brightness 0 - 255) +#define ISSI3733_GCR_DEFAULT LED_GCR_MAX + +//Automatic power rollback and recovery +#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) +#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) +#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) //LED Mapping - More practically generated from a spreadsheet program //id: ID of the LED (Sync with PCB callouts) @@ -187,5 +190,3 @@ along with this program. If not, see . #define USB_LED_COMPOSE_SCANCODE 255 #define USB_LED_KANA_SCANCODE 255 #endif //USB_LED_INDICATOR_ENABLE - -#endif //_config_led_h_ diff --git a/keyboards/massdrop/ctrl/keymaps/default/keymap.c b/keyboards/massdrop/ctrl/keymaps/default/keymap.c index 88c1ac31239..39122ee49cc 100644 --- a/keyboards/massdrop/ctrl/keymaps/default/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/default/keymap.c @@ -1,25 +1,13 @@ #include QMK_KEYBOARD_H enum ctrl_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints - MD_BOOT, //Restart into bootloader after hold timeout + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -36,29 +24,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), /* [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), */ }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { }; @@ -67,90 +51,14 @@ void matrix_init_user(void) { void matrix_scan_user(void) { }; -#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) -#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint32_t key_timer; switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); @@ -190,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c b/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c new file mode 100644 index 00000000000..16f88ffe1dc --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c @@ -0,0 +1,226 @@ +#include QMK_KEYBOARD_H + +enum ctrl_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase //Working + L_BRD, //LED Brightness Decrease //Working + L_PTN, //LED Pattern Select Next //Working + L_PTP, //LED Pattern Select Previous //Working + L_PSI, //LED Pattern Speed Increase //Working + L_PSD, //LED Pattern Speed Decrease //Working + L_T_MD, //LED Toggle Mode //Working + L_T_ONF, //LED Toggle On / Off //Broken + L_ON, //LED On //Broken + L_OFF, //LED Off //Broken + L_T_BR, //LED Toggle Breath Effect //Working + L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working + U_T_AGCR, //USB Toggle Automatic GCR control //Working + DBG_TOG, //DEBUG Toggle On / Off // + DBG_MTRX, //DEBUG Toggle Matrix Prints // + DBG_KBD, //DEBUG Toggle Keyboard Prints // + DBG_MOU, //DEBUG Toggle Mouse Prints // + MD_BOOT //Restart into bootloader after hold timeout //Working +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} + +led_instruction_t led_instructions[] = { + //LEDs are normally inactive, no processing is performed on them + //Flags are used in matching criteria for an LED to be active and indicate how to color it + //Flags can be found in tmk_core/protocol/arm_atsam/led_matrix.h (prefixed with LED_FLAG_) + //LED IDs can be found in config_led.h in the keyboard's directory + //Examples are below + + //All LEDs use the user's selected pattern (this is the factory default) + { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + + //Specific LEDs use the user's selected pattern while all others are off + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN, .id0 = 0xFFFFFFFF, .id1 = 0xAAAAAAAA, .id2 = 0x55555555, .id3 = 0x11111111 }, + + //Specific LEDs use specified RGB values while all others are off + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFF, .id1 = 0x00FF, .id2 = 0x0000FF00, .id3 = 0xFF000000, .r = 75, .g = 150, .b = 225 }, + + //All LEDs use the user's selected pattern + //On layer 1, all key LEDs (except the top row which keeps active pattern) are red while all edge LEDs are green + //When layer 1 is active, key LEDs use red (id0 32 - 17: 1111 1111 1111 1111 0000 0000 0000 0000 = 0xFFFF0000) (except top row 16 - 1) + //When layer 1 is active, key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //When layer 1 is active, key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF) + //When layer 1 is active, edge LEDs use green (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000) + //When layer 1 is active, edge LEDs use green (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF) + // { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id0 = 0xFFFF0000, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255, .layer = 1 }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id2 = 0xFF800000, .id3 = 0x00FFFFFF, .g = 127, .layer = 1 }, + + //All key LEDs use red while edge LEDs use the active pattern + //All key LEDs use red (id0 32 - 1: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //All key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF) + //All key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF) + //Edge uses active pattern (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000) + //Edge uses active pattern (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF) + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFFFFFFFF, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255 }, + // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN , .id2 = 0xFF800000, .id3 = 0x00FFFFFF }, + + //end must be set to 1 to indicate end of instruction set + { .end = 1 } +}; diff --git a/keyboards/massdrop/ctrl/keymaps/default_md/rules.mk b/keyboards/massdrop/ctrl/keymaps/default_md/rules.mk new file mode 100644 index 00000000000..064a6f54c1f --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/default_md/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c index 6c5dfe19c02..79fe7388af6 100644 --- a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c @@ -1,25 +1,13 @@ #include QMK_KEYBOARD_H enum ctrl_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints - MD_BOOT, //Restart into bootloader after hold timeout + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -36,29 +24,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), /* [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), */ }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { }; @@ -67,90 +51,14 @@ void matrix_init_user(void) { void matrix_scan_user(void) { }; -#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) -#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint32_t key_timer; switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); @@ -190,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c new file mode 100644 index 00000000000..6dfc2137862 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c @@ -0,0 +1,196 @@ +#include QMK_KEYBOARD_H + +enum ctrl_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase //Working + L_BRD, //LED Brightness Decrease //Working + L_PTN, //LED Pattern Select Next //Working + L_PTP, //LED Pattern Select Previous //Working + L_PSI, //LED Pattern Speed Increase //Working + L_PSD, //LED Pattern Speed Decrease //Working + L_T_MD, //LED Toggle Mode //Working + L_T_ONF, //LED Toggle On / Off //Broken + L_ON, //LED On //Broken + L_OFF, //LED Off //Broken + L_T_BR, //LED Toggle Breath Effect //Working + L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working + U_T_AGCR, //USB Toggle Automatic GCR control //Working + DBG_TOG, //DEBUG Toggle On / Off // + DBG_MTRX, //DEBUG Toggle Matrix Prints // + DBG_KBD, //DEBUG Toggle Keyboard Prints // + DBG_MOU, //DEBUG Toggle Mouse Prints // + MD_BOOT //Restart into bootloader after hold timeout //Working +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} + +led_instruction_t led_instructions[] = { + //Please see ../default_md/keymap.c for examples + + //All LEDs use the user's selected pattern (this is the factory default) + { .flags = LED_FLAG_USE_ROTATE_PATTERN }, + + //end must be set to 1 to indicate end of instruction set + { .end = 1 } +}; diff --git a/keyboards/massdrop/ctrl/keymaps/mac_md/rules.mk b/keyboards/massdrop/ctrl/keymaps/mac_md/rules.mk new file mode 100644 index 00000000000..064a6f54c1f --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/mac_md/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h new file mode 100644 index 00000000000..b7a469208dd --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h @@ -0,0 +1,67 @@ +#pragma once + +#define FORCE_NKRO + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 + +#define TAP_HOLD_CAPS_DELAY 0 + +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS + +// #define DISABLE_RGB_MATRIX_SOLID_COLOR +// #define DISABLE_RGB_MATRIX_ALPHAS_MODS +// #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// #define DISABLE_RGB_MATRIX_BREATHING +#define DISABLE_RGB_MATRIX_BAND_SAT +// #define DISABLE_RGB_MATRIX_BAND_VAL +#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define DISABLE_RGB_MATRIX_CYCLE_ALL +#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN +#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL +// #define DISABLE_RGB_MATRIX_CYCLE_SPIRAL +#define DISABLE_RGB_MATRIX_DUAL_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define DISABLE_RGB_MATRIX_RAINDROPS +#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +// #define DISABLE_RGB_MATRIX_TYPING_HEATMAP +#define DISABLE_RGB_MATRIX_DIGITAL_RAIN +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +// #define DISABLE_RGB_MATRIX_SPLASH +// #define DISABLE_RGB_MATRIX_MULTISPLASH +// #define DISABLE_RGB_MATRIX_SOLID_SPLASH +// #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define QMK_KEYS_PER_SCAN 4 + +// #define RGB_MATRIX_KEYRELEASES + +// some speed shit +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#ifndef NO_DEBUG +#define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif // !NO_PRINT + +#define NO_ACTION_ONESHOT +#define TAPPING_FORCE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/config_led.c b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config_led.c new file mode 100644 index 00000000000..448793cf5d9 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config_led.c @@ -0,0 +1,82 @@ +#ifdef RGB_MATRIX_ENABLE +#include "ctrl.h" + +#include "led_matrix.h" +#include "rgb_matrix.h" +#include "config_led.h" + +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 16, 17, 18, 19, 20, 21, 22, 23 }, + { 33, 34, 35, 36, 37, 38, 39, 40 }, + { 50, 51, 52, 53, 54, 55, 56, 57 }, + { 63, 64, 65, 66, 67, 68, 69, 70 }, + { 76, 77, 78, 79, 80, 81, 82, 83 }, + { 8, 9, 10, 11, 12, 13, 14, 15 }, + { 24, 25, 26, 27, 28, 29, 30, 31 }, + { 41, 42, 43, 44, 45, 46, 47, 48 }, + { 58, 59, 60, 61, 62, 75, 49, 32 }, + { 71, 72, 73, 74, 84, 85, 86, NO_LED } +}, { + // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS + { 7, 5 }, { 31, 5 }, { 43, 5 }, { 55, 5 }, { 67, 5 }, { 85, 5 }, { 97, 5 }, { 109, 5 }, + { 121, 5 }, { 139, 5 }, { 151, 5 }, { 163, 5 }, { 175, 5 }, { 193, 5 }, { 205, 5 }, { 217, 5 }, + // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP + { 7, 20 }, { 19, 20 }, { 31, 20 }, { 43, 20 }, { 55, 20 }, { 67, 20 }, { 79, 20 }, { 91, 20 }, + { 103, 20 }, { 115, 20 }, { 127, 20 }, { 139, 20 }, { 151, 20 }, { 169, 20 }, { 193, 20 }, { 205, 20 }, + { 217, 20 }, + // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN + { 10, 30 }, { 25, 30 }, { 37, 30 }, { 49, 30 }, { 61, 30 }, { 73, 30 }, { 85, 30 }, { 97, 30 }, + { 109, 30 }, { 121, 30 }, { 133, 30 }, { 145, 30 }, { 157, 30 }, { 172, 30 }, { 193, 30 }, { 205, 30 }, + { 217, 30 }, + // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT + { 11, 39 }, { 28, 39 }, { 40, 39 }, { 52, 39 }, { 64, 39 }, { 76, 39 }, { 88, 39 }, { 100, 39 }, + { 112, 39 }, { 124, 39 }, { 136, 39 }, { 148, 39 }, { 168, 39 }, + // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP + { 14, 49 }, { 34, 49 }, { 46, 49 }, { 58, 49 }, { 70, 49 }, { 82, 49 }, { 94, 49 }, { 106, 49 }, + { 118, 49 }, { 130, 49 }, { 142, 49 }, { 165, 49 }, { 205, 49 }, + // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + { 8, 59 }, { 23, 59 }, { 38, 59 }, { 83, 59 }, { 129, 59 }, { 144, 59 }, { 159, 59 }, { 174, 59 }, + { 193, 59 }, { 205, 59 }, { 217, 59 }, + // Underglow / Border + { 224, 64 }, { 204, 64 }, { 186, 64 }, { 167, 64 }, { 149, 64 }, { 130, 64 }, { 112, 64 }, { 94, 64 }, + { 75, 64 }, { 57, 64 }, { 38, 64 }, { 20, 64 }, { 0, 64 }, { 0, 47 }, { 0, 32 }, { 0, 17 }, + { 0, 0 }, { 20, 0 }, { 38, 0 }, { 57, 0 }, { 75, 0 }, { 94, 0 }, { 112, 0 }, { 130, 0 }, + { 149, 0 }, { 167, 0 }, { 186, 0 }, { 204, 0 }, { 224, 0 }, { 224, 17 }, { 224, 32 }, { 224, 47 } +}, { + // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS + 1, 4, 4, 4, 4, 1, 1, 1, + 1, 4, 4, 4, 4, 1, 1, 1, + // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 1, + 1, + // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 1, 1, + 1, + // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 1, + // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, + // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + 1, 1, 1, 4, 1, 1, 1, 1, + 1, 1, 1, + // Underglow / Border + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2 +} }; + + +#ifdef USB_LED_INDICATOR_ENABLE +void rgb_matrix_indicators_kb(void) +{ + led_matrix_indicators(); +} +#endif // USB_LED_INDICATOR_ENABLE + +#endif diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c new file mode 100644 index 00000000000..447b0aca1a2 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c @@ -0,0 +1,396 @@ +#include QMK_KEYBOARD_H + +enum ctrl_layers { + _QWERTY, + _NAV, + _FNC +}; + +enum ctrl_keycodes { + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout + MAS_TOG, + MAS_CRM, + MAS_PRP, + MAS_RED, + MAS_GRN, + MAS_BLU, + MAS_CYN, + MAS_MGT, + MAS_YEL, + MAS_KEY, + MAS_WHT, +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode +#define LT_CAPS LT(_NAV, KC_CAPS) +#define _V_V_V_ KC_TRNS +extern bool autoshift_enabled; + + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + LT_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FNC), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_NAV] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PMNS, KC_PPLS, _______, _______, _______, _______, \ + _______, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, _______, KC_P4, KC_P5, KC_P6, KC_PSLS, _______, _______, KC_EQL, _______, _______, _______, \ + _V_V_V_, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PPLS, _______, \ + _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, KC_P0, KC_PDOT, KC_PSLS, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [_FNC] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_MSEL, KC_ASTG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_VOLU, \ + _______, RGB_MOD, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, MAS_MGT, MAS_BLU, MAS_WHT, RGB_RMOD, RGB_MOD, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + _______, RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______, MAS_RED, MAS_KEY, MAS_CYN, MAS_PRP, _______, _______, \ + MAS_TOG, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, MAS_YEL, MAS_GRN, MAS_CRM, _______, _______, RGB_VAI, \ + _______, _______, _______, _______, _______, _V_V_V_, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [X] = LAYOUT( + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \ + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, \ + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \ + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, \ + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, \ + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 \ + ), + */ +}; + + +void rgb_matrix_indicators_user(void) +{ + uint8_t this_led = host_keyboard_leds(); + + if (!g_suspend_state && rgb_matrix_config.enable) { + switch (biton32(layer_state)) { + case _NAV: + if (this_led & (1 << USB_LED_NUM_LOCK)) { + rgb_matrix_set_color(41, 0xFF, 0x00, 0x00); + } else { + rgb_matrix_set_color(41, 0x00, 0x00, 0x00); + } + + // layer indicator + rgb_matrix_set_color(50, 0xFF, 0xFF, 0xFF); + rgb_matrix_set_color(101, 0xFF, 0xFF, 0xFF); + // ESDF + rgb_matrix_set_color(36, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(52, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(53, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(54, 0xFF, 0x00, 0x00); + // home/end + rgb_matrix_set_color(35, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(37, 0x00, 0xFF, 0x00); + // pgup/dn + rgb_matrix_set_color(34, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(51, 0x00, 0x00, 0xFF); + // numpad + rgb_matrix_set_color(23, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(24, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(25, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(40, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(42, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(57, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(58, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(59, 0xFF, 0xFF, 0x00); + // zero + rgb_matrix_set_color(69, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(70, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(71, 0xFF, 0x00, 0x00); + // dot + rgb_matrix_set_color(72, 0x00, 0x00, 0xFF); + // math shit + rgb_matrix_set_color(26, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(27, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(28, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(43, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(46, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(60, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(61, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(73, 0x00, 0x00, 0xFF); + break; + + case _FNC: { + HSV hsv = { rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v }; + HSV hui = hsv; + HSV hud = hsv; + HSV sai = hsv; + HSV sad = hsv; + HSV vai = hsv; + HSV vad = hsv; + hui.h = hsv.h + 8; + hud.h = hsv.h - 8; + sai.s = hsv.s + 16 > 255 ? 255u : hsv.s + 16; + sad.s = hsv.s - 16 < 0 ? 0 : hsv.s - 16; + vai.v = hsv.v + 16 > 255 ? 255 : hsv.v + 16; + vad.v = hsv.v - 16 < 0 ? 0 : hsv.v - 16; + RGB rgb = hsv_to_rgb(hsv); + RGB rgbHUI = hsv_to_rgb(hui); + RGB rgbHUD = hsv_to_rgb(hud); + RGB rgbSAI = hsv_to_rgb(sai); + RGB rgbSAD = hsv_to_rgb(sad); + RGB rgbVAI = hsv_to_rgb(vai); + RGB rgbVAD = hsv_to_rgb(vad); + rgb_matrix_set_color(81, 0xFF, 0xFF, 0xFF); // layer indicator + rgb_matrix_set_color(91, 0xFF, 0xFF, 0xFF); + rgb_matrix_set_color(93, 0x00, 0x00, 0x00); + rgb_matrix_set_color(94, rgb.r, rgb.g, rgb.b); + rgb_matrix_set_color(95, rgb.r, rgb.g, rgb.b); + rgb_matrix_set_color(96, 0x00, 0x00, 0x00); + rgb_matrix_set_color(68, 0xFF, 0x00, 0x00); // MD_BOOT + rgb_matrix_set_color(69, 0xFF, 0x00, 0x40); // TG_NKRO + rgb_matrix_set_color(32, 0x00, 0x80, 0xFF); // KC_VOLU + rgb_matrix_set_color(49, 0x00, 0x80, 0xFF); + rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); // KC_MUTE + rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // KC_MSTP + rgb_matrix_set_color(47, 0xFF, 0x40, 0x00); // KC_MPRV + rgb_matrix_set_color(48, 0xFF, 0x40, 0x00); + rgb_matrix_set_color(14, 0x00, 0xFF, 0x00); // KC_MSEL + rgb_matrix_set_color(31, 0x00, 0xFF, 0x00); // KC_MPLY + + if (this_led & (1 << !autoshift_enabled)) { + rgb_matrix_set_color(15, 0xFF, 0x00, 0x00); // KC_ASTG + } else { + rgb_matrix_set_color(15, 0xFF, 0xFF, 0x00); + } + + rgb_matrix_set_color(44, 0xFF, 0x80, 0x00); //RGB_MOD + rgb_matrix_set_color(45, 0xFF, 0x80, 0x00); + rgb_matrix_set_color(34, 0xFF, 0x80, 0x00); //RGB_MOD + rgb_matrix_set_color(51, 0xFF, 0x80, 0x00); + rgb_matrix_set_color(63, 0xFF, 0x40, 0x00); //RGB_TOG + rgb_matrix_set_color(64, rgb.r, rgb.g, rgb.b); //MAS_TOG + rgb_matrix_set_color(36, rgbHUI.r, rgbHUI.g, rgbHUI.b); //RGB_HUI + rgb_matrix_set_color(53, rgbHUD.r, rgbHUD.g, rgbHUD.b); + rgb_matrix_set_color(37, rgbSAI.r, rgbSAI.g, rgbSAI.b); //RGB_SAI + rgb_matrix_set_color(54, rgbSAD.r, rgbSAD.g, rgbSAD.b); + rgb_matrix_set_color(38, rgbVAI.r, rgbVAI.g, rgbVAI.b); //RGB_VAI + rgb_matrix_set_color(55, rgbVAD.r, rgbVAD.g, rgbVAD.b); + rgb_matrix_set_color(79, rgb.r, rgb.g, rgb.b); // config display + rgb_matrix_set_color(75, rgbVAI.r, rgbVAI.g, rgbVAI.b); //RGB_VAI + rgb_matrix_set_color(85, rgbVAD.r, rgbVAD.g, rgbVAD.b); + rgb_matrix_set_color(35, 0x80, 0x80, 0x80); //RGB_SPI + rgb_matrix_set_color(52, 0x80, 0x80, 0x80); + rgb_matrix_set_color(84, 0x80, 0x80, 0x80); //RGB_SPI + rgb_matrix_set_color(86, 0x80, 0x80, 0x80); + rgb_matrix_set_color(41, 0xF0, 0x00, 0xFF); //MAS_MGT + rgb_matrix_set_color(42, 0x00, 0x02, 0xFF); //MAS_BLU + rgb_matrix_set_color(57, 0xFF, 0x00, 0x00); //MAS_RED + rgb_matrix_set_color(58, 0x00, 0x00, 0x00); //MAS_KEY + rgb_matrix_set_color(59, 0x00, 0xFF, 0xF7); //MAS_CYN + rgb_matrix_set_color(70, 0xFF, 0xDA, 0x00); //MAS_YEL + rgb_matrix_set_color(71, 0x00, 0xFF, 0x01); //MAS_GRN + rgb_matrix_set_color(72, 0xFF, 0xA5, 0x18); //MAS_CRM + rgb_matrix_set_color(60, 0x81, 0x3C, 0xFF); //MAS_PRP + rgb_matrix_set_color(43, 0xFF, 0xFF, 0xFF); //MAS_WHT + } + break; + } + } +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) +{ + autoshift_disable(); + rgb_matrix_sethsv(128, 255, 255); + // rgb_matrix_sethsv(192, 112, 255); + // rgb_matrix_mode(4); +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) +{ +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t* record) +{ + static uint32_t key_timer; + + switch (keycode) { + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); + } + + return false; + + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + + return false; + + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + + return false; + + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + + return false; + + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + + return false; + + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + + return false; + + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + + return false; + + case MAS_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + } + break; + } + } + + return false; + + case MAS_CRM: + if (record->event.pressed) { + rgb_matrix_sethsv(32, 160, 255); + } + + return false; + + case MAS_PRP: + if (record->event.pressed) { + rgb_matrix_sethsv(192, 112, 255); + } + + return false; + + case MAS_RED: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 255, 255); + } + + return false; + + case MAS_GRN: + if (record->event.pressed) { + rgb_matrix_sethsv(88, 255, 255); + } + + return false; + + case MAS_BLU: + if (record->event.pressed) { + rgb_matrix_sethsv(168, 255, 255); + } + + return false; + + case MAS_CYN: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 255, 255); + } + + return false; + + case MAS_MGT: + if (record->event.pressed) { + rgb_matrix_sethsv(216, 255, 255); + } + + return false; + + case MAS_YEL: + if (record->event.pressed) { + rgb_matrix_sethsv(40, 255, 255); + } + + return false; + + case MAS_KEY: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 0, 0); + } + + return false; + + case MAS_WHT: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 0, 255); + } + + return false; + + default: + return true; //Process all other keycodes normally + } +} + diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk new file mode 100644 index 00000000000..063d135a063 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk @@ -0,0 +1,3 @@ +NKRO_ENABLE = yes # USB Nkey Rollover +AUTO_SHIFT_ENABLE = yes # Auto Shift +SRC += config_led.c diff --git a/keyboards/massdrop/ctrl/keymaps/responsive_pattern/README.md b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/README.md new file mode 100644 index 00000000000..5ee630dfb80 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/README.md @@ -0,0 +1,5 @@ +# THIS KEYMAP IS BROKEN + +The CTRL and ALT have both been switched to using the QMK RGB Matrix system, +rendering any custom effects that used the old, custom Massdrop lighting system, +BROKEN. diff --git a/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c new file mode 100644 index 00000000000..58911aa7574 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c @@ -0,0 +1,936 @@ +#include QMK_KEYBOARD_H + +// uint8_t keyboard_leds(void) +#include + + +#if ISSI3733_LED_COUNT == 119 +# define KEY_LED_COUNT 87 +#elif ISSI3733_LED_COUNT == 105 +# define KEY_LED_COUNT 67 +#endif + +#define min(x, y) (x < y ? x : y) + + +extern issi3733_led_t *lede; +extern issi3733_led_t led_map[]; + +enum ctrl_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout + + L_SP_PR, //LED Splash Pattern Select Previous + L_SP_NE, //LED Splash Pattern Select Next + + L_SP_WD, //LED Splash Widen Wavefront width + L_SP_NW, //LED Splash Narrow Wavefront width + + L_SP_FA, //LED Splash wave travel speed faster (shorter period) + L_SP_SL, //LED Splash wave travel speed slower (longer period) + + L_CP_PR, //LED Color Pattern Select Previous + L_CP_NX, //LEB Color Pattern Select Next +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode +#define ______ KC_TRNS + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, U_T_AUTO,U_T_AGCR,_______, MO(2), _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + L_CP_NX, L_SP_SL, L_SP_WD, L_SP_FA, _______, _______, L_CP_NX, L_SP_SL, L_SP_WD, L_SP_FA, _______, _______, _______, _______, _______, _______, _______, \ + L_CP_PR, L_SP_PR, L_SP_NW, L_SP_NE, _______, _______, L_CP_PR, L_SP_PR, L_SP_NW, L_SP_NE, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +// see: /tmk_core/common/keycode.h +uint8_t KEYCODE_TO_LED_ID[256]; +uint8_t DISTANCE_MAP[KEY_LED_COUNT+1][KEY_LED_COUNT+1]; +struct user_led_t { + uint8_t state; + uint8_t r; + uint8_t g; + uint8_t b; +} USER_LED[KEY_LED_COUNT] = { + +}; + +struct { + uint8_t PATTERN_INDEX; + uint8_t WAVE_FRONT_WIDTH; + uint16_t WAVE_PERIOD; + uint8_t COLOR_PATTERN_INDEX; + uint8_t TRAVEL_DISTANCE; +} USER_CONFIG = { + .PATTERN_INDEX = 1, + .WAVE_FRONT_WIDTH = 3, + .WAVE_PERIOD = 50, + .COLOR_PATTERN_INDEX = 0, + .TRAVEL_DISTANCE = 25, +}; + +uint8_t ktli(uint16_t keycode){ + if(keycode < 256){ + // the array is initialized in `matrix_init_user()` + return KEYCODE_TO_LED_ID[keycode]; + } + switch(keycode){ + // definition of MO(layer): quantum/quantum_keycodes.h: line 614 + case MO(1): return 82; + } + return 0; +}; + +// Runs just one time when the keyboard initializes. +static void init_keycode_to_led_map(void){ + uint16_t LED_MAP[MATRIX_ROWS][MATRIX_COLS] = LAYOUT( + 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, + 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35, + 36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51, + 52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67, +#if KEY_LED_COUNT >= 87 + 68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87 +#endif + ); + + uint16_t key = 0; + for(uint8_t y = 0; y < MATRIX_ROWS; ++y){ + for(uint8_t x = 0; x < MATRIX_COLS; ++x){ + key = keymaps[0][y][x]; + if(key < 256){ + KEYCODE_TO_LED_ID[key] = LED_MAP[y][x]; + } + } + } +} +// https://docs.qmk.fm/#/feature_terminal +#define KEY_POSITION_MAP_ROWS 6 +#define KEY_POSITION_MAP_COLUMNS 20 +static void init_distance_map(void){ + uint16_t KEY_POSITION_MAP[KEY_POSITION_MAP_ROWS][KEY_POSITION_MAP_COLUMNS] = { + { KC_NO, KC_ESC, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_NO, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, }, + // { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, + { KC_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_NO, KC_INS, KC_HOME, KC_PGUP, }, + { KC_NO, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_BSLS, KC_NO, KC_DEL, KC_END, KC_PGDN, }, + { KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, KC_ENT, KC_NO, KC_NO, KC_NO, KC_NO, }, + { KC_NO, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_RSFT, KC_RSFT, KC_NO, KC_NO, KC_UP, KC_NO, }, + { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_NO, MO(1), KC_APP, KC_RCTL, KC_RCTL, KC_RCTL, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, }, + }; + uint8_t columns = KEY_POSITION_MAP_COLUMNS; + uint8_t rows = KEY_POSITION_MAP_ROWS; + + for(uint8_t y = 0; y < rows; ++y){ + for(uint8_t x = 0; x < columns; ++x){ + uint8_t id1 = ktli(KEY_POSITION_MAP[y][x]); + + for(uint8_t j = y; j < rows; ++j){ + for(uint8_t i = 0; i < columns; ++i){ + uint8_t id2 = ktli(KEY_POSITION_MAP[j][i]); + + if(id1 == id2) continue; + + uint8_t dx = abs(i - x); + uint8_t dy = abs(j - y); + uint8_t dis = dx + dy; + if(i < x && j > y){ + dis -= min(dx, dy); + } + + uint8_t _dis = DISTANCE_MAP[id1][id2]; + if(_dis && _dis <= dis) continue; + DISTANCE_MAP[id1][id2] = dis; + DISTANCE_MAP[id2][id1] = dis; + } + } + } + } +} +void matrix_init_user(void) { + init_keycode_to_led_map(); + init_distance_map(); +}; + +// /tmk_core/protocol/arm_atsam/led_matrix.c: line 244 +uint8_t led_enabled; +float led_animation_speed; +uint8_t led_animation_direction; +uint8_t led_animation_orientation; +uint8_t led_animation_breathing; +uint8_t led_animation_breathe_cur; +uint8_t breathe_step; +uint8_t breathe_dir; +uint64_t led_next_run; + +uint8_t led_animation_id; +uint8_t led_lighting_mode; + +issi3733_led_t *led_cur; +uint8_t led_per_run; +float breathe_mult; + +// overrided /tmk_core/protocol/arm_atsam/led_matrix.c: line 484 +void rgb_matrix_init_user(void){ + led_animation_speed = ANIMATION_SPEED_STEP * 15; + led_per_run = 15; +} + +// overrided /tmk_core/protocol/arm_atsam/led_matrix.c: line 262 +void led_matrix_run(void) +{ + float ro; + float go; + float bo; + float po; + uint8_t led_this_run = 0; + led_setup_t *f = (led_setup_t*)led_setups[led_animation_id]; + + if (led_cur == 0) //Denotes start of new processing cycle in the case of chunked processing + { + led_cur = led_map; + + breathe_mult = 1; + + if (led_animation_breathing) + { + led_animation_breathe_cur += breathe_step * breathe_dir; + + if (led_animation_breathe_cur >= BREATHE_MAX_STEP) + breathe_dir = -1; + else if (led_animation_breathe_cur <= BREATHE_MIN_STEP) + breathe_dir = 1; + + //Brightness curve created for 256 steps, 0 - ~98% + breathe_mult = 0.000015 * led_animation_breathe_cur * led_animation_breathe_cur; + if (breathe_mult > 1) breathe_mult = 1; + else if (breathe_mult < 0) breathe_mult = 0; + } + } + + uint8_t fcur = 0; + uint8_t fmax = 0; + + //Frames setup + while (f[fcur].end != 1) + { + fcur++; //Count frames + } + + fmax = fcur; //Store total frames count + + struct user_led_t user_led_cur; + while (led_cur < lede && led_this_run < led_per_run) + { + ro = 0; + go = 0; + bo = 0; + + uint8_t led_index = led_cur - led_map; // only this part differs from the original function. + if(led_index < KEY_LED_COUNT){ // + user_led_cur = USER_LED[led_index]; // `struct user_led_t USER_LED[]` is stored globally. + } // + // + if(led_index < KEY_LED_COUNT && user_led_cur.state){ // `user_led_cur` is just for convenience + ro = user_led_cur.r; // + go = user_led_cur.g; // + bo = user_led_cur.b; // + } // + else if (led_lighting_mode == LED_MODE_KEYS_ONLY && led_cur->scan == 255) + { + //Do not act on this LED + } + else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && led_cur->scan != 255) + { + //Do not act on this LED + } + else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) + { + //Do not act on this LED (Only show indicators) + } + else + { + //Act on LED + for (fcur = 0; fcur < fmax; fcur++) + { + + if (led_animation_orientation) + { + po = led_cur->py; + } + else + { + po = led_cur->px; + } + + float pomod; + pomod = (float)(g_tick % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed; + + //Add in any moving effects + if ((!led_animation_direction && f[fcur].ef & EF_SCR_R) || (led_animation_direction && (f[fcur].ef & EF_SCR_L))) + { + pomod *= 100.0f; + pomod = (uint32_t)pomod % 10000; + pomod /= 100.0f; + + po -= pomod; + + if (po > 100) po -= 100; + else if (po < 0) po += 100; + } + else if ((!led_animation_direction && f[fcur].ef & EF_SCR_L) || (led_animation_direction && (f[fcur].ef & EF_SCR_R))) + { + pomod *= 100.0f; + pomod = (uint32_t)pomod % 10000; + pomod /= 100.0f; + po += pomod; + + if (po > 100) po -= 100; + else if (po < 0) po += 100; + } + + //Check if LED's po is in current frame + if (po < f[fcur].hs) continue; + if (po > f[fcur].he) continue; + //note: < 0 or > 100 continue + + //Calculate the po within the start-stop percentage for color blending + po = (po - f[fcur].hs) / (f[fcur].he - f[fcur].hs); + + //Add in any color effects + if (f[fcur].ef & EF_OVER) + { + ro = (po * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; + go = (po * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; + bo = (po * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; + } + else if (f[fcur].ef & EF_SUBTRACT) + { + ro -= (po * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; + go -= (po * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; + bo -= (po * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; + } + else + { + ro += (po * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; + go += (po * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; + bo += (po * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; + } + } + } + + //Clamp values 0-255 + if (ro > 255) ro = 255; else if (ro < 0) ro = 0; + if (go > 255) go = 255; else if (go < 0) go = 0; + if (bo > 255) bo = 255; else if (bo < 0) bo = 0; + + if (led_animation_breathing) + { + ro *= breathe_mult; + go *= breathe_mult; + bo *= breathe_mult; + } + + *led_cur->rgb.r = (uint8_t)ro; + *led_cur->rgb.g = (uint8_t)go; + *led_cur->rgb.b = (uint8_t)bo; + +#ifdef USB_LED_INDICATOR_ENABLE + if (keyboard_leds()) + { + uint8_t kbled = keyboard_leds(); + if ( + #if USB_LED_NUM_LOCK_SCANCODE != 255 + (led_cur->scan == USB_LED_NUM_LOCK_SCANCODE && kbled & (1<scan == USB_LED_CAPS_LOCK_SCANCODE && kbled & (1<scan == USB_LED_SCROLL_LOCK_SCANCODE && kbled & (1<scan == USB_LED_COMPOSE_SCANCODE && kbled & (1<scan == USB_LED_KANA_SCANCODE && kbled & (1<rgb.r > 127) *led_cur->rgb.r = 0; + else *led_cur->rgb.r = 255; + if (*led_cur->rgb.g > 127) *led_cur->rgb.g = 0; + else *led_cur->rgb.g = 255; + if (*led_cur->rgb.b > 127) *led_cur->rgb.b = 0; + else *led_cur->rgb.b = 255; + } + } +#endif //USB_LED_INDICATOR_ENABLE + + led_cur++; + led_this_run++; + } +} + +#define KEY_STROKES_LENGTH 20 +struct { + bool alive; + uint8_t led_id; + uint32_t time; +} KEY_STROKES[KEY_STROKES_LENGTH] = {{}}; + + + + +void set_led_rgb(uint8_t led_id, uint8_t r, uint8_t g, uint8_t b){ + issi3733_led_t *target_led = (led_map + led_id); + *target_led->rgb.r = r; + *target_led->rgb.g = g; + *target_led->rgb.b = b; +} + + +uint8_t DISTANCE_FROM_LAST_KEYSTROKE[KEY_LED_COUNT+1]; +void calculate_keystroke_distance(void){ + bool alive; + uint8_t led_id, period_passed; + uint32_t t; + + + for(uint8_t i = 0; i <= KEY_LED_COUNT; ++i){ + DISTANCE_FROM_LAST_KEYSTROKE[i] = 0; + } + + for(uint8_t i = 0; i < KEY_STROKES_LENGTH; ++i){ + if(KEY_STROKES[i].alive){ + t = timer_elapsed32(KEY_STROKES[i].time); + alive = 0; + led_id = KEY_STROKES[i].led_id; + period_passed = t / USER_CONFIG.WAVE_PERIOD; + + uint8_t delta_period; + for(uint8_t j = 1; j <= KEY_LED_COUNT; ++j){ + delta_period = period_passed - DISTANCE_MAP[led_id][j]; + if(( delta_period < USER_CONFIG.WAVE_FRONT_WIDTH) && ( + DISTANCE_MAP[led_id][j] <= USER_CONFIG.TRAVEL_DISTANCE + )){ + switch(USER_CONFIG.PATTERN_INDEX){ + case 3: + case 4: + case 5: + case 6: + DISTANCE_FROM_LAST_KEYSTROKE[j] += delta_period; + break; + default: + DISTANCE_FROM_LAST_KEYSTROKE[j] = 1; + break; + } + alive = 1; + } + } + KEY_STROKES[i].alive = alive; + } + } +} + +#define COLOR_PATTERN_RGB_COUNT 18 +static uint8_t COLOR_PATTERNS[][COLOR_PATTERN_RGB_COUNT][3] = { + { // default rainbow color + {255, 0, 0}, {255, 0, 0}, {255, 127, 0}, + {255, 127, 0}, {255, 255, 0}, {255, 255, 0}, + {120, 255, 0}, {120, 255, 0}, { 0, 255, 0}, + { 0, 255, 0}, { 0, 255, 120}, { 0, 255, 120}, + { 0, 0, 255}, { 0, 0, 255}, { 75, 0, 130}, + { 75, 0, 130}, { 43, 0, 130}, { 43, 0, 130}, + }, { // light rainbow color + {248, 12, 18}, {238, 17, 0}, {255, 51, 17}, + {255, 68, 32}, {255, 102, 68}, {255, 153, 51}, + {254, 174, 45}, {204, 187, 51}, {208, 195, 16}, + {170, 204, 34}, {105, 208, 37}, { 34, 204, 170}, + { 18, 189, 185}, { 17, 170, 187}, { 68, 68, 221}, + { 51, 17, 187}, { 59, 12, 189}, { 68, 34, 153}, + }, { // white flat + {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, + {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, + {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, + {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, + {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, + {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, + }, { // white fade, cos curve + {255, 255, 255}, {255, 255, 255}, {252, 252, 252}, + {247, 247, 247}, {240, 240, 240}, {232, 232, 232}, + {221, 221, 221}, {209, 209, 209}, {196, 196, 196}, + {181, 181, 181}, {164, 164, 164}, {147, 147, 147}, + {128, 128, 128}, {108, 108, 108}, { 88, 88, 88}, + { 66, 66, 66}, { 45, 45, 45}, { 23, 23, 23}, + }, +}; +static const uint8_t COLOR_PATTERNS_COUNT = ( + sizeof(COLOR_PATTERNS) / sizeof(COLOR_PATTERNS[0])); + +void set_user_led_rgb(uint8_t i, uint8_t r, uint8_t g, uint8_t b){ + USER_LED[i-1].state = 1; + USER_LED[i-1].r = r; + USER_LED[i-1].g = g; + USER_LED[i-1].b = b; +} +void unset_user_led_rgb(uint8_t i){ + USER_LED[i-1].state = 0; +} +void set_indicator_led_rgb(uint8_t i, + uint8_t layer, uint8_t r, uint8_t g, uint8_t b){ + USER_LED[i-1].state |= 1 << layer; + USER_LED[i-1].r = r; + USER_LED[i-1].g = g; + USER_LED[i-1].b = b; +} +void unset_indicator_led_rgb(uint8_t i, uint8_t layer){ + USER_LED[i-1].state &= ~(1 << layer); +} + +void refresh_pattern_indicators(void){ + static uint8_t GRV_123456[] = { + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, + }; + + if(layer_state >= 0x04){ + for(uint8_t i = 0; i < 7; ++i){ + if(i == USER_CONFIG.PATTERN_INDEX){ + set_indicator_led_rgb(ktli(GRV_123456[i]), 2, 0, 0, 255); + } else{ + set_indicator_led_rgb(ktli(GRV_123456[i]), 2, 0, 255, 0); + } + } + } else{ + for(uint8_t i = 0; i < 7; ++i){ + unset_indicator_led_rgb(ktli(GRV_123456[i]), 2); + } + } +} +void refresh_color_pattern_indicators(void){ + static uint8_t ZXCVBNM_COMM_DOT[] = { + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, + }; + + if(layer_state >= 0x04){ + uint8_t (*c)[3] = &COLOR_PATTERNS[USER_CONFIG.COLOR_PATTERN_INDEX][0]; + for(uint8_t i = 0; i < 9; ++i){ + set_indicator_led_rgb(ktli(ZXCVBNM_COMM_DOT[i]), + 2, c[i][0], c[i][1], c[i][2]); + } + } else{ + for(uint8_t i = 0; i < 9; ++i){ + unset_indicator_led_rgb(ktli(ZXCVBNM_COMM_DOT[i]), 2); + } + } +} + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + static uint32_t scan_timer = 0; + static uint8_t last_layer = 0; + + uint8_t layer = 0; + if(layer_state >= 0x04){ + layer = 2; + } else if(layer_state >= 0x02){ + layer = 1; + } + + calculate_keystroke_distance(); + + + #define USE_PATTERN 0 + #define BLACK_RGB 1 + #define COLOR_RGB 2 + uint8_t ci; // color index + uint8_t *rgb; + uint8_t handle_type; + uint8_t distance; + for(uint8_t i = 1; i <= KEY_LED_COUNT; ++i){ + if(USER_LED[i-1].state >= 2) continue; + + handle_type = USE_PATTERN; + distance = DISTANCE_FROM_LAST_KEYSTROKE[i]; + + switch(USER_CONFIG.PATTERN_INDEX){ + case 0: handle_type = USE_PATTERN; break; + case 1: handle_type = distance ? USE_PATTERN : BLACK_RGB; break; + case 2: handle_type = distance ? BLACK_RGB : USE_PATTERN; break; + case 3: handle_type = distance ? COLOR_RGB : BLACK_RGB; break; + case 4: handle_type = distance ? COLOR_RGB : USE_PATTERN; break; + case 5: + case 6: handle_type = distance ? COLOR_RGB : USE_PATTERN; break; + } + switch(handle_type){ + case USE_PATTERN: unset_user_led_rgb(i); break; + case BLACK_RGB: set_user_led_rgb(i, 0, 0, 0); break; + case COLOR_RGB: + ci = (DISTANCE_FROM_LAST_KEYSTROKE[i] * COLOR_PATTERN_RGB_COUNT / + USER_CONFIG.WAVE_FRONT_WIDTH) % COLOR_PATTERN_RGB_COUNT; + rgb = &COLOR_PATTERNS[USER_CONFIG.COLOR_PATTERN_INDEX][ci][0]; + + set_user_led_rgb(i, rgb[0], rgb[1], rgb[2]); + break; + } + } + + + // could be moved to process_record_user() + if(layer != last_layer){ + + static uint8_t QWEASDP[] = { + KC_Q, KC_W, KC_E, KC_A, KC_S, KC_D, KC_P, + }; + static uint8_t YUIOHJKL[] = { + KC_Y, KC_U, KC_I, KC_O, KC_H, KC_J, KC_K, KC_L, + }; + + switch(last_layer){ + case 1: + for(uint8_t i = 0; i < 7; ++i){ + unset_indicator_led_rgb(ktli(QWEASDP[i]), 1); + } + break; + case 2: + for(uint8_t i = 0; i < 6; ++i){ + unset_indicator_led_rgb(ktli(QWEASDP[i]), 2); + } + for(uint8_t i = 0; i < 8; ++i){ + unset_indicator_led_rgb(ktli(YUIOHJKL[i]), 2); + } + unset_indicator_led_rgb(ktli(KC_TAB), 2); + unset_indicator_led_rgb(ktli(KC_CAPS), 2); + break; + } + + + switch(layer){ + case 1: + for(uint8_t i = 0; i < 7; ++i){ + set_indicator_led_rgb(ktli(QWEASDP[i]), 1, 255, 0, 0); + } + break; + case 2: + for(uint8_t i = 0; i < 6; ++i){ + set_indicator_led_rgb(ktli(QWEASDP[i]), 2, 0, 255, 0); + } + for(uint8_t i = 0; i < 8; ++i){ + set_indicator_led_rgb(ktli(YUIOHJKL[i]), 2, 0, 255, 0); + } + set_indicator_led_rgb(ktli(KC_TAB), 2, 0, 255, 0); + set_indicator_led_rgb(ktli(KC_CAPS), 2, 0, 255, 0); + break; + } + + refresh_pattern_indicators(); + refresh_color_pattern_indicators(); + last_layer = layer; + } + + + switch(layer){ + case 0: + if(timer_elapsed32(scan_timer) > 2000){ + scan_timer = timer_read32(); + } else if(timer_elapsed32(scan_timer) > 1000){ + // set_user_led_rgb(ktli(KC_F5), 255, 255, 255); + } + break; + case 1: + break; + case 2: + break; + } + +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + + + + + + + + + + + + + + + + + + case L_SP_PR: // previous dripple pattern + case L_SP_NE: // next dripple pattern + if (record->event.pressed) { +#define PATTERN_COUNT 7 + uint8_t incre = keycode == L_SP_PR ? PATTERN_COUNT-1 : 1; + USER_CONFIG.PATTERN_INDEX += incre; + USER_CONFIG.PATTERN_INDEX %= PATTERN_COUNT; + + if(USER_CONFIG.PATTERN_INDEX <= 4){ + USER_CONFIG.TRAVEL_DISTANCE = 25; + USER_CONFIG.COLOR_PATTERN_INDEX = 0; + USER_CONFIG.WAVE_PERIOD = 50; + } + + switch(USER_CONFIG.PATTERN_INDEX){ + case 0: // None + break; + case 1: // background off, wave on + USER_CONFIG.WAVE_FRONT_WIDTH = 2; + break; + case 2: // background on, wave off + USER_CONFIG.WAVE_FRONT_WIDTH = 5; + break; + case 3: // background off, rainbow wave + USER_CONFIG.WAVE_FRONT_WIDTH = 10; + break; + case 4: // background on, rainbow wave + USER_CONFIG.WAVE_FRONT_WIDTH = 10; + break; + case 5: + USER_CONFIG.WAVE_FRONT_WIDTH = 10; + + USER_CONFIG.COLOR_PATTERN_INDEX = 2; + USER_CONFIG.TRAVEL_DISTANCE = 0; + USER_CONFIG.WAVE_PERIOD = 100; + break; + case 6: + USER_CONFIG.WAVE_FRONT_WIDTH = 25; + + USER_CONFIG.COLOR_PATTERN_INDEX = 3; + USER_CONFIG.TRAVEL_DISTANCE = 2; + USER_CONFIG.WAVE_PERIOD = 10; + break; + } + + // remove effect after changing pattern + for(int i = 0; i < KEY_STROKES_LENGTH; ++i){ + KEY_STROKES[i].alive = 0; + } + refresh_pattern_indicators(); + refresh_color_pattern_indicators(); + } + return false; + case L_SP_WD: + case L_SP_NW: + if(record->event.pressed){ + short incre = keycode == L_SP_WD ? 1 : -1; + USER_CONFIG.WAVE_FRONT_WIDTH += incre; + if(USER_CONFIG.WAVE_FRONT_WIDTH < 1){ + USER_CONFIG.WAVE_FRONT_WIDTH = 1; + } + } + return false; + case L_SP_FA: + case L_SP_SL: + if(record->event.pressed){ + short incre = keycode == L_SP_FA ? -1 : 1; + + USER_CONFIG.WAVE_PERIOD += 10 * incre; + if(USER_CONFIG.WAVE_PERIOD < 10){ + USER_CONFIG.WAVE_PERIOD = 10; + } + } + return false; + // these are the keys not in range 0x04 - 0x52 + case L_CP_PR: + case L_CP_NX: + if(record->event.pressed){ + uint8_t incre = keycode == L_CP_PR ? COLOR_PATTERNS_COUNT - 1 : 1; + USER_CONFIG.COLOR_PATTERN_INDEX += incre; + USER_CONFIG.COLOR_PATTERN_INDEX %= COLOR_PATTERNS_COUNT; + refresh_color_pattern_indicators(); + } + return false; + default: + if (record->event.pressed){ + uint8_t led_id = ktli(keycode); + if(led_id){ + for(int i = 0; i < KEY_STROKES_LENGTH; ++i){ + if(!KEY_STROKES[i].alive){ + KEY_STROKES[i].alive = 1; + KEY_STROKES[i].led_id = led_id; + KEY_STROKES[i].time = timer_read32(); + break; + } + } + } + } + return true; //Process all other keycodes normally + } +} diff --git a/keyboards/massdrop/ctrl/keymaps/responsive_pattern/rules.mk b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/rules.mk new file mode 100644 index 00000000000..064a6f54c1f --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/rules.mk @@ -0,0 +1,2 @@ +# This keymap requires Massdrop Configurator support +OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR diff --git a/keyboards/massdrop/ctrl/keymaps/xulkal/config.h b/keyboards/massdrop/ctrl/keymaps/xulkal/config.h new file mode 100644 index 00000000000..a078fece0f7 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/xulkal/config.h @@ -0,0 +1,23 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define RGB_MATRIX_TOG_LAYERS diff --git a/keyboards/massdrop/ctrl/keymaps/xulkal/keymap.c b/keyboards/massdrop/ctrl/keymaps/xulkal/keymap.c new file mode 100644 index 00000000000..debfa3b478b --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/xulkal/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H +#include "xulkal.h" + +enum ctrl_keycodes { + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, TD_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, TD_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TD_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, \ + KC_LCPO, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LOWER, KC_APP, KC_RCPC, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + +#ifndef GAMELAYER_DISABLE + [_GAME] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LOWER, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +#endif + + [_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ + _______, RGB_RMOD,RGB_MOD, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ + RGB_SPI, RGB_SAI, RGB_VAI, RGB_HUI, RESET, QWERTY, _______, U_T_AUTO,U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + RGB_SPD, RGB_SAD, RGB_VAD, RGB_HUD, RGBRST, GAME, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + */ +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) { + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + return false; + case DBG_TOG: + if (record->event.pressed) + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + return false; + case DBG_MTRX: + if (record->event.pressed) + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + return false; + case DBG_KBD: + if (record->event.pressed) + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + return false; + case DBG_MOU: + if (record->event.pressed) + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + return false; + } + + return true; +} diff --git a/keyboards/massdrop/ctrl/keymaps/xulkal/rules.mk b/keyboards/massdrop/ctrl/keymaps/xulkal/rules.mk new file mode 100644 index 00000000000..f78fb3237b9 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/xulkal/rules.mk @@ -0,0 +1 @@ +DISABLE_LTO = yes diff --git a/keyboards/massdrop/ctrl/led_programs.c b/keyboards/massdrop/ctrl/led_programs.c deleted file mode 100644 index ca27016454d..00000000000 --- a/keyboards/massdrop/ctrl/led_programs.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "ctrl.h" -#include "led_matrix.h" - -//Teal <-> Salmon -led_setup_t leds_teal_salmon[] = { - { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, - { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, - { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Yellow -led_setup_t leds_yellow[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Off -led_setup_t leds_off[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Red -led_setup_t leds_red[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Green -led_setup_t leds_green[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Blue -led_setup_t leds_blue[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White -led_setup_t leds_white[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White with moving red stripe -led_setup_t leds_white_with_red_stripe[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, - { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, - { .end = 1 }, -}; - -//Black with moving red stripe -led_setup_t leds_black_with_red_stripe[] = { - { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .end = 1 }, -}; - -//Rainbow no scrolling -led_setup_t leds_rainbow_ns[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, - { .end = 1 }, -}; - -//Rainbow scrolling -led_setup_t leds_rainbow_s[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .end = 1 }, -}; - -//Add new LED animations here using one from above as example -//The last entry must be { .end = 1 } -//Add the new animation name to the list below following its format - -void *led_setups[] = { - leds_rainbow_s, - leds_rainbow_ns, - leds_teal_salmon, - leds_yellow, - leds_red, - leds_green, - leds_blue, - leds_white, - leds_white_with_red_stripe, - leds_black_with_red_stripe, - leds_off -}; - -const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/massdrop/ctrl/matrix.c b/keyboards/massdrop/ctrl/matrix.c index 6f306962e61..f3529fe72a9 100644 --- a/keyboards/massdrop/ctrl/matrix.c +++ b/keyboards/massdrop/ctrl/matrix.c @@ -75,12 +75,10 @@ void matrix_init(void) PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low } - + matrix_init_quantum(); } -#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) - uint64_t mdebouncing = 0; uint8_t matrix_scan(void) { @@ -89,9 +87,7 @@ uint8_t matrix_scan(void) uint8_t col; uint32_t scans[2]; //PA PB - if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active - - //m15_off; //Profiling scans + if (timer_read64() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer @@ -99,7 +95,7 @@ uint8_t matrix_scan(void) { PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output - CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output + wait_us(1); //Delay for output scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data @@ -132,11 +128,9 @@ uint8_t matrix_scan(void) else { //Begin or extend debounce on change - mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; + mdebouncing = timer_read64() + DEBOUNCE; } - //m15_on; //Profiling scans - matrix_scan_quantum(); return 1; diff --git a/keyboards/massdrop/ctrl/rules.mk b/keyboards/massdrop/ctrl/rules.mk index c5539158f58..aa45c68056d 100644 --- a/keyboards/massdrop/ctrl/rules.mk +++ b/keyboards/massdrop/ctrl/rules.mk @@ -1,6 +1,6 @@ # project specific files -SRC = led_programs.c -SRC += matrix.c +SRC = matrix.c +SRC += config_led.c #For platform and packs ARM_ATSAM = SAMD51J18A @@ -31,3 +31,6 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) VIRTSER_ENABLE = no # USB Serial Driver RAW_ENABLE = no # Raw device AUTO_SHIFT_ENABLE = no # Auto Shift + +# Custom RGB matrix handling +RGB_MATRIX_ENABLE = custom diff --git a/keyboards/maxipad/config.h b/keyboards/maxipad/config.h index d7a5ef5646a..50496c16b76 100644 --- a/keyboards/maxipad/config.h +++ b/keyboards/maxipad/config.h @@ -1,22 +1,19 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once #include "config_common.h" @@ -28,52 +25,20 @@ along with this program. If not, see . #define PRODUCT maxipad #define DESCRIPTION A custom keyboard -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 6 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -//Pro micro pinout - #define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } - #define MATRIX_COL_PINS { F4, C6, D7, F5, B4, B5 } - #define UNUSED_PINS -//Teensy 2 pinout - //#define MATRIX_ROW_PINS { B6, F7, B2, B3, B1 } - //#define MATRIX_COL_PINS { F6, C6, D7, F5, B4, B5 } - //#define UNUSED_PINS - - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ +/* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST /* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 +//#define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -92,4 +57,6 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#endif +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/maxipad/info.json b/keyboards/maxipad/info.json index 3ee4830c47b..84daa5aba4a 100644 --- a/keyboards/maxipad/info.json +++ b/keyboards/maxipad/info.json @@ -5,8 +5,11 @@ "width": 6, "height": 5, "layouts": { - "LAYOUT": { + "LAYOUT_grid": { "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}] - } + }, + "LAYOUT_1x2uC": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"w": 2, "x":4, "y":4}] + } } } diff --git a/keyboards/maxipad/keymaps/default/config.h b/keyboards/maxipad/keymaps/default/config.h new file mode 100644 index 00000000000..08c234aee2b --- /dev/null +++ b/keyboards/maxipad/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/maxipad/keymaps/default/keymap.c b/keyboards/maxipad/keymaps/default/keymap.c index e730200a203..0971569319a 100644 --- a/keyboards/maxipad/keymaps/default/keymap.c +++ b/keyboards/maxipad/keymaps/default/keymap.c @@ -1,26 +1,33 @@ -#include "maxipad.h" +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT( /* Base */ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, \ - MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, \ - KC_LCTL, KC_LALT, MO(1), KC_ENT,KC_GRV,KC_SPC \ -), -[1] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, \ - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC \ -), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // MACRODOWN only works in this function -{ - return MACRO_NONE; + [0] = LAYOUT( /* Base */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, \ + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, \ + KC_LCTL, KC_LALT, MO(1), KC_ENT, KC_GRV, KC_SPC \ + ), + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, \ + _______, _______, KC_UP, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, \ + _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______ \ + ), }; diff --git a/keyboards/maxipad/keymaps/default/readme.md b/keyboards/maxipad/keymaps/default/readme.md new file mode 100644 index 00000000000..a6c0d4a3f04 --- /dev/null +++ b/keyboards/maxipad/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for maxipad \ No newline at end of file diff --git a/keyboards/maxipad/maxipad.c b/keyboards/maxipad/maxipad.c index a193b112b91..44a0c2b7428 100644 --- a/keyboards/maxipad/maxipad.c +++ b/keyboards/maxipad/maxipad.c @@ -1 +1,16 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "maxipad.h" \ No newline at end of file diff --git a/keyboards/maxipad/maxipad.h b/keyboards/maxipad/maxipad.h index 613f7df22e3..e2a08050538 100644 --- a/keyboards/maxipad/maxipad.h +++ b/keyboards/maxipad/maxipad.h @@ -1,13 +1,39 @@ -#ifndef MAXIPAD_H -#define MAXIPAD_H +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once #include "quantum.h" -// This a shortcut to help you visually see your layout. -// The following is an example using the Planck MIT layout -// The first section contains all of the arguements -// The second converts the arguments into a two-dimensional array -#define LAYOUT( \ +#define ___ KC_NO + +#ifdef KEYBOARD_maxipad_promicro + #include "promicro.h" +#elif KEYBOARD_maxipad_teensy2 + #include "teensy2.h" +#endif + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_grid( \ k00, k01, k02, k03, k04, k05, \ k10, k11, k12, k13, k14, k15, \ k20, k21, k22, k23, k24, k25, \ @@ -22,4 +48,20 @@ { k40, k41, k42, k43, k44, k45 } \ } -#endif +#define LAYOUT_1x2uC( \ + k00, k01, k02, k03, k04, k05, \ + k10, k11, k12, k13, k14, k15, \ + k20, k21, k22, k23, k24, k25, \ + k30, k31, k32, k33, k34, k35, \ + k40, k41, k42, k43, k44 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k40, k41, k42, k43, ___, k44 } \ +} + +#define LAYOUT LAYOUT_grid +#define LAYOUT_ortho_5x6 LAYOUT_grid diff --git a/keyboards/maxipad/promicro/config.h b/keyboards/maxipad/promicro/config.h new file mode 100644 index 00000000000..008e7929cbb --- /dev/null +++ b/keyboards/maxipad/promicro/config.h @@ -0,0 +1,39 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } +#define MATRIX_COL_PINS { F4, C6, D7, F5, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/maxipad/promicro/promicro.c b/keyboards/maxipad/promicro/promicro.c new file mode 100644 index 00000000000..4ecd9746452 --- /dev/null +++ b/keyboards/maxipad/promicro/promicro.c @@ -0,0 +1,16 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "maxipad.h" diff --git a/keyboards/maxipad/promicro/promicro.h b/keyboards/maxipad/promicro/promicro.h new file mode 100644 index 00000000000..8f1419c9d7d --- /dev/null +++ b/keyboards/maxipad/promicro/promicro.h @@ -0,0 +1,20 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "maxipad.h" +#include "quantum.h" + diff --git a/keyboards/maxipad/promicro/rules.mk b/keyboards/maxipad/promicro/rules.mk new file mode 100644 index 00000000000..dc6f1962373 --- /dev/null +++ b/keyboards/maxipad/promicro/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/maxipad/readme.md b/keyboards/maxipad/readme.md index b62afdf3431..65661b065b3 100644 --- a/keyboards/maxipad/readme.md +++ b/keyboards/maxipad/readme.md @@ -1,17 +1,27 @@ # Maxipad -## Quantum MK Firmware +![Maxipad](https://images.bigcartel.com/product_images/193297217/product_image.jpg) -For the full Quantum feature list, see [the parent readme.md](/readme.md). +5 x 6 Gamepad/Macropad PCBs from /u/wootpatoot -If you are using a pro micro then make sure to enable USE_PRO_MICRO in the makefile -Change the config.h pinout to match your mcu!! +- Multiple layouts supported + - Full-grid + - 2u thumb-key (the 2u only works in the bottom right position). +- Multiple controllers supported + - Pro Micro + - PJRC Teensy 2.0 -Depending on which keymap you would like to use, you will have to compile slightly differently. +Keyboard Maintainer: QMK Community +Hardware Supported: Maxipad PCB +Hardware Availability: [switchtop](http://www.switchtop.com/product/gamepad-macropad-pcbs) -### Default +Make example for this keyboard (after setting up your build environment): -To build with the default keymap, simply run `make maxipad:default`. + make maxipad:default -### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. +If you would like to use one of the alternative controllers: + + make maxipad/promicro:default + make maxipad/teensy2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/maxipad/rules.mk b/keyboards/maxipad/rules.mk index 31be1924fad..735c7af26d6 100644 --- a/keyboards/maxipad/rules.mk +++ b/keyboards/maxipad/rules.mk @@ -1,76 +1,22 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - # Build Options -# comment out to disable the options. +# change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# MIDI_ENABLE = YES # MIDI controls -# UNICODE_ENABLE = YES # Unicode -# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -USE_PRO_MICRO = yes SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI controls +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +DEFAULT_FOLDER = maxipad/promicro diff --git a/keyboards/maxipad/teensy2/config.h b/keyboards/maxipad/teensy2/config.h new file mode 100644 index 00000000000..4e43920d5af --- /dev/null +++ b/keyboards/maxipad/teensy2/config.h @@ -0,0 +1,39 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B6, F7, B2, B3, B1 } +#define MATRIX_COL_PINS { F6, C6, D7, F5, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/maxipad/teensy2/rules.mk b/keyboards/maxipad/teensy2/rules.mk new file mode 100644 index 00000000000..3fb7c7e5a7e --- /dev/null +++ b/keyboards/maxipad/teensy2/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 diff --git a/keyboards/maxipad/teensy2/teensy2.c b/keyboards/maxipad/teensy2/teensy2.c new file mode 100644 index 00000000000..4ecd9746452 --- /dev/null +++ b/keyboards/maxipad/teensy2/teensy2.c @@ -0,0 +1,16 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "maxipad.h" diff --git a/keyboards/maxipad/teensy2/teensy2.h b/keyboards/maxipad/teensy2/teensy2.h new file mode 100644 index 00000000000..acb213acc8b --- /dev/null +++ b/keyboards/maxipad/teensy2/teensy2.h @@ -0,0 +1,19 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "maxipad.h" +#include "quantum.h" diff --git a/keyboards/maxr1998/pulse4k/config.h b/keyboards/maxr1998/pulse4k/config.h new file mode 100644 index 00000000000..d1bfaf30063 --- /dev/null +++ b/keyboards/maxr1998/pulse4k/config.h @@ -0,0 +1,75 @@ +/* +Copyright (C) 2012-2019 Jun Wako , Maxr1998 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Maxr1998 +#define PRODUCT Pulse 4k +#define DESCRIPTION A four-key macropad + +/* Key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +/* Matrix pins */ +#define MATRIX_ROW_PINS { B4, E6 } +#define MATRIX_COL_PINS { B7, B3, F0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Rotary encoders */ +#define ENCODERS_PAD_A { D2, F6 } +#define ENCODERS_PAD_B { D3, F5 } +#define ENCODER_RESOLUTION 4 + +/* Combo setup */ +#define COMBO_COUNT 1 +#define COMBO_TERM 150 + +/* RGB LED Setup */ +#define RGB_DI_PIN F7 // pin the DI on the WS2812B is hooked-up to +#define RGBLIGHT_ANIMATIONS // run RGB animations +#define RGBLED_NUM 2 // number of LEDs + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/maxr1998/pulse4k/info.json b/keyboards/maxr1998/pulse4k/info.json new file mode 100644 index 00000000000..0ac4f063c05 --- /dev/null +++ b/keyboards/maxr1998/pulse4k/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "Pulse 4k", + "keyboard_folder": "maxr1998/pulse4k", + "url": "https://github.com/Maxr1998/Pulse_4k", + "maintainer": "Maxr1998", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT_pulse4k": { + "key_count": 6, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 } ] + } + } +} diff --git a/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c new file mode 100644 index 00000000000..873c87d1f9e --- /dev/null +++ b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright (C) 2019 Maxr1998 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +enum layers { + DEFAULT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT] = { + { KC_END, KC_UP, KC_MUTE }, + { KC_LEFT, KC_DOWN, KC_RGHT } + } +}; + +void matrix_init_user(void) { +} + +void encoder_one_update(bool clockwise) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } +} + +void encoder_two_update(bool clockwise) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } +} diff --git a/keyboards/maxr1998/pulse4k/keymaps/default/rules.mk b/keyboards/maxr1998/pulse4k/keymaps/default/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/maxr1998/pulse4k/pulse4k.c b/keyboards/maxr1998/pulse4k/pulse4k.c new file mode 100644 index 00000000000..ee3d41ccd1d --- /dev/null +++ b/keyboards/maxr1998/pulse4k/pulse4k.c @@ -0,0 +1,61 @@ +/* +Copyright (C) 2019 Maxr1998 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "pulse4k.h" +#include "rgblight.h" + +enum combo_events { + LED_ADJUST +}; + +const uint16_t PROGMEM led_adjust_combo[] = {KC_LEFT, KC_RGHT, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + [LED_ADJUST] = COMBO_ACTION(led_adjust_combo) +}; + +bool led_adjust_active = false; + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void process_combo_event(uint8_t combo_index, bool pressed) { + if (combo_index == LED_ADJUST) { + led_adjust_active = pressed; + } +} + +void encoder_update_kb(uint8_t index, bool clockwise) { + if (index == 0) { + if (led_adjust_active) { + if (clockwise) { + rgblight_increase_val(); + } else { + rgblight_decrease_val(); + } + } else encoder_one_update(clockwise); + } else if (index == 1) { + if (led_adjust_active) { + if (clockwise) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + } else encoder_two_update(clockwise); + } +} diff --git a/keyboards/maxr1998/pulse4k/pulse4k.h b/keyboards/maxr1998/pulse4k/pulse4k.h new file mode 100644 index 00000000000..7c34870d698 --- /dev/null +++ b/keyboards/maxr1998/pulse4k/pulse4k.h @@ -0,0 +1,33 @@ +/* +Copyright (C) 2019 Maxr1998 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11, k12 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 }, \ +} + +void encoder_one_update(bool clockwise); + +void encoder_two_update(bool clockwise); diff --git a/keyboards/maxr1998/pulse4k/readme.md b/keyboards/maxr1998/pulse4k/readme.md new file mode 100644 index 00000000000..3a552188dff --- /dev/null +++ b/keyboards/maxr1998/pulse4k/readme.md @@ -0,0 +1,11 @@ +# Pulse 4k +A four-key macropad with two rotary encoders, developed by Maxr1998, [fully open-source](https://github.com/Maxr1998/Pulse_4k). + +Keyboard Maintainer: [Maxr1998](https://github.com/Maxr1998) +Hardware Availability: DIY from the [open-source design files](https://github.com/Maxr1998/Pulse_4k), potential official distribution in the future + +Make example for this keyboard (after setting up your build environment): + + make maxr1998/pulse4k:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/maxr1998/pulse4k/rules.mk b/keyboards/maxr1998/pulse4k/rules.mk new file mode 100644 index 00000000000..64466622153 --- /dev/null +++ b/keyboards/maxr1998/pulse4k/rules.mk @@ -0,0 +1,33 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +ENCODER_ENABLE = yes # Rotary encoders +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +COMBO_ENABLE = yes # Key combo feature +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/mechkeys/mk60/config.h b/keyboards/mechkeys/mk60/config.h new file mode 100644 index 00000000000..9fccd8a8b0e --- /dev/null +++ b/keyboards/mechkeys/mk60/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Mechkeys +#define PRODUCT mechkeys mk60 +#define DESCRIPTION A custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } +#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 6 + +#define RGB_DI_PIN E6 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 12 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/mechkeys/mk60/info.json b/keyboards/mechkeys/mk60/info.json new file mode 100644 index 00000000000..06ed337260c --- /dev/null +++ b/keyboards/mechkeys/mk60/info.json @@ -0,0 +1,83 @@ +{ + "keyboard_name": "MK60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 68, + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K07", "x":7, "y":0}, + {"label":"K08", "x":8, "y":0}, + {"label":"K09", "x":9, "y":0}, + {"label":"K0A", "x":10, "y":0}, + {"label":"K0B", "x":11, "y":0}, + {"label":"K0C", "x":12, "y":0}, + {"label":"K0D", "x":13, "y":0}, + {"label":"K0E", "x":14, "y":0}, + {"label":"K10", "x":0, "y":1, "w":1.5}, + {"label":"K12", "x":1.5, "y":1}, + {"label":"K13", "x":2.5, "y":1}, + {"label":"K14", "x":3.5, "y":1}, + {"label":"K15", "x":4.5, "y":1}, + {"label":"K16", "x":5.5, "y":1}, + {"label":"K17", "x":6.5, "y":1}, + {"label":"K18", "x":7.5, "y":1}, + {"label":"K19", "x":8.5, "y":1}, + {"label":"K1A", "x":9.5, "y":1}, + {"label":"K1B", "x":10.5, "y":1}, + {"label":"K1C", "x":11.5, "y":1}, + {"label":"K1D", "x":12.5, "y":1}, + {"label":"K1E", "x":13.5, "y":1, "w":1.5}, + {"label":"K20", "x":0, "y":2, "w":1.75}, + {"label":"K22", "x":1.75, "y":2}, + {"label":"K23", "x":2.75, "y":2}, + {"label":"K24", "x":3.75, "y":2}, + {"label":"K25", "x":4.75, "y":2}, + {"label":"K26", "x":5.75, "y":2}, + {"label":"K27", "x":6.75, "y":2}, + {"label":"K28", "x":7.75, "y":2}, + {"label":"K29", "x":8.75, "y":2}, + {"label":"K2A", "x":9.75, "y":2}, + {"label":"K2B", "x":10.75, "y":2}, + {"label":"K2C", "x":11.75, "y":2}, + {"label":"K2D", "x":12.75, "y":2, "w":2.25}, + {"label":"K30", "x":0, "y":3}, + {"label":"K31", "x":1, "y":3}, + {"label":"K32", "x":2, "y":3}, + {"label":"K33", "x":3, "y":3}, + {"label":"K34", "x":4, "y":3}, + {"label":"K35", "x":5, "y":3}, + {"label":"K36", "x":6, "y":3}, + {"label":"K37", "x":7, "y":3}, + {"label":"K38", "x":8, "y":3}, + {"label":"K39", "x":9, "y":3}, + {"label":"K3A", "x":10, "y":3}, + {"label":"K3B", "x":11, "y":3}, + {"label":"K3C", "x":12, "y":3}, + {"label":"K3D", "x":13, "y":3}, + {"label":"K3E", "x":14, "y":3}, + {"label":"K40", "x":0, "y":4, "w":1.75}, + {"label":"K42", "x":1.75, "y":4, "w":1.25}, + {"label":"K43", "x":3, "y":4, "w":1.25}, + {"label":"K44", "x":4.25, "y":4, "w":1.25}, + {"label":"K47", "x":5.5, "y":4, "w":3}, + {"label":"K49", "x":8.5, "y":4, "w":1.5}, + {"label":"K4A", "x":10, "y":4}, + {"label":"K4B", "x":11, "y":4}, + {"label":"K4C", "x":12, "y":4}, + {"label":"K4D", "x":13, "y":4}, + {"label":"K4E", "x":14, "y":4} + ] + } + } + } + \ No newline at end of file diff --git a/keyboards/mechkeys/mk60/keymaps/default/config.h b/keyboards/mechkeys/mk60/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/mechkeys/mk60/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/mechkeys/mk60/keymaps/default/keymap.c b/keyboards/mechkeys/mk60/keymaps/default/keymap.c new file mode 100644 index 00000000000..ea566d4b557 --- /dev/null +++ b/keyboards/mechkeys/mk60/keymaps/default/keymap.c @@ -0,0 +1,74 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_NO, KC_Z, \ + KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_DEL, KC_LCTL, KC_LGUI, KC_LALT, \ + MO(1), KC_SPC, KC_RALT, KC_PGUP, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( \ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS, \ + BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, \ + RGB_MOD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/mechkeys/mk60/keymaps/default/readme.md b/keyboards/mechkeys/mk60/keymaps/default/readme.md new file mode 100644 index 00000000000..8a01d9475e8 --- /dev/null +++ b/keyboards/mechkeys/mk60/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for mk60 diff --git a/keyboards/mechkeys/mk60/mk60.c b/keyboards/mechkeys/mk60/mk60.c new file mode 100644 index 00000000000..4c6a059f4cf --- /dev/null +++ b/keyboards/mechkeys/mk60/mk60.c @@ -0,0 +1,50 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "mk60.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(B7); + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if(IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)){ + writePinLow(B7); + }else { + writePinHigh(B7); + } + + led_set_user(usb_led); +} diff --git a/keyboards/mechkeys/mk60/mk60.h b/keyboards/mechkeys/mk60/mk60.h new file mode 100644 index 00000000000..66eb416a6fa --- /dev/null +++ b/keyboards/mechkeys/mk60/mk60.h @@ -0,0 +1,41 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ + k40, k42, k43, k44, k47, k49, k4A, k4B, k4C, k4D, k4E \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E}, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E}, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO}, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E}, \ + { k40, KC_NO, k42, k43, k44, KC_NO, KC_NO, k47, KC_NO, k49, k4A, k4B, k4C, k4D, k4E}, \ +} diff --git a/keyboards/mechkeys/mk60/readme.md b/keyboards/mechkeys/mk60/readme.md new file mode 100644 index 00000000000..d3093349a17 --- /dev/null +++ b/keyboards/mechkeys/mk60/readme.md @@ -0,0 +1,13 @@ +# mechkeys mk60 + +60% keyboard with RGB underglow and backlights + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: MK60 +Hardware Availability: The MK60 was discontinued by [mechkeys.ca](https://mechkeys.ca/) + +Make example for this keyboard (after setting up your build environment): + + make mk60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/mechkeys/mk60/rules.mk b/keyboards/mechkeys/mk60/rules.mk new file mode 100644 index 00000000000..f1513f2996a --- /dev/null +++ b/keyboards/mechkeys/mk60/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/mechllama/g35/config.h b/keyboards/mechllama/g35/config.h new file mode 100644 index 00000000000..61400fe9c0c --- /dev/null +++ b/keyboards/mechllama/g35/config.h @@ -0,0 +1,39 @@ +/* +Copyright 2019 Kaylyn Bogle + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x0035 +#define MANUFACTURER kaylynb +#define PRODUCT MechLlama G35 +#define DESCRIPTION 35 key macropad + +#define MATRIX_ROWS 5 +#define MATRIX_COLS 7 + +#define DIODE_DIRECTION COL2ROW + +#define QMK_ESC_OUTPUT D6 +#define QMK_ESC_INPUT F5 +#define QMK_SPEAKER D2 + +#define RGB_DI_PIN F7 + +#define FORCE_NKRO diff --git a/keyboards/mechllama/g35/g35.c b/keyboards/mechllama/g35/g35.c new file mode 100644 index 00000000000..e3925674fe6 --- /dev/null +++ b/keyboards/mechllama/g35/g35.c @@ -0,0 +1,16 @@ +/* Copyright 2019 Kaylyn Bogle + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "g35.h" diff --git a/keyboards/mechllama/g35/g35.h b/keyboards/mechllama/g35/g35.h new file mode 100644 index 00000000000..2275272452e --- /dev/null +++ b/keyboards/mechllama/g35/g35.h @@ -0,0 +1,33 @@ +/* Copyright 2019 Kaylyn Bogle + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, \ + K10, K11, K12, K13, K14, K15, K16, \ + K20, K21, K22, K23, K24, K25, K26, \ + K30, K31, K32, K33, K34, K35, K36, \ + K40, K41, K42, K43, K44, K45, K46 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, }, \ + { K10, K11, K12, K13, K14, K15, K16, }, \ + { K20, K21, K22, K23, K24, K25, K26, }, \ + { K30, K31, K32, K33, K34, K35, K36, }, \ + { K40, K41, K42, K43, K44, K45, K46 } \ +} diff --git a/keyboards/mechllama/g35/info.json b/keyboards/mechllama/g35/info.json new file mode 100644 index 00000000000..6fcc2412db3 --- /dev/null +++ b/keyboards/mechllama/g35/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "G35", + "url": "https://github.com/kaylynb/MechLlama-G35", + "maintainer": "kaylynb", + "width": 7, + "height": 5.75, + "key_count": 35, + "layouts": { + "LAYOUT": { + "layout": [{"label":"F1", "x":0, "y":0.5}, {"label":"Esc", "x":1, "y":0.5}, {"label":"1", "x":2, "y":0}, {"label":"2", "x":3, "y":0.15}, {"label":"3", "x":4, "y":0}, {"label":"4", "x":5, "y":0}, {"label":"5", "x":6, "y":0}, {"label":"F2", "x":0, "y":1.5}, {"label":"Tab", "x":1, "y":1.5}, {"label":"Q", "x":2, "y":1}, {"label":"W", "x":3, "y":1.15}, {"label":"E", "x":4, "y":1}, {"label":"R", "x":5, "y":1}, {"label":"T", "x":6, "y":1}, {"label":"F3", "x":0, "y":2.5}, {"label":"Shift", "x":1, "y":2.5}, {"label":"A", "x":2, "y":2}, {"label":"S", "x":3, "y":2.15}, {"label":"D", "x":4, "y":2}, {"label":"F", "x":5, "y":2}, {"label":"G", "x":6, "y":2}, {"label":"F4", "x":0, "y":3.5}, {"label":"Ctrl", "x":1, "y":3.5}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3.15}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"F5", "x":0, "y":4.5}, {"label":"Super", "x":1, "y":4.5}, {"label":"Alt", "x":2, "y":4, "h":1.5}, {"label":"Bksp", "x":3, "y":4.25, "h":1.25}, {"label":"Enter", "x":4, "y":4, "h":1.5}, {"label":"Space", "x":5, "y":4, "h":1.75}, {"label":"Fn", "x":6, "y":4, "h":1.75}] + } + } +} diff --git a/keyboards/mechllama/g35/keymaps/default/keymap.c b/keyboards/mechllama/g35/keymaps/default/keymap.c new file mode 100644 index 00000000000..4b7bf76516b --- /dev/null +++ b/keyboards/mechllama/g35/keymaps/default/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2019 Kaylyn Bogle + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layers { + _BASE = 0, + _ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F1, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_F2, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_F3, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_F4, KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + // + MO(_ADJUST),KC_LGUI, KC_LALT, KC_BSPC, KC_ENT, KC_SPC, KC_MINUS + //└────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ), + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + RGB_TOG,TO(_BASE),XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_M_K, XXXXXXX, RGB_RMOD,RGB_HUI, RGB_MOD, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼ + XXXXXXX, XXXXXXX, RGB_VAD, XXXXXXX, RGB_VAI, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼ + // + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + //└────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ), +}; + +#if defined(OLED_DRIVER_ENABLE) +const char* get_layer_name(uint8_t layer) { + switch (layer) { + case _BASE: + return PSTR("Default"); + break; + case _ADJUST: + return PSTR("Adjust"); + break; + default: + return PSTR("Unknown"); + break; + } +} + +void oled_task_user(void) { + oled_write_ln_P(get_layer_name(biton32(layer_state)), false); +} +#endif diff --git a/keyboards/mechllama/g35/keymaps/default/readme.md b/keyboards/mechllama/g35/keymaps/default/readme.md new file mode 100644 index 00000000000..200a42f1943 --- /dev/null +++ b/keyboards/mechllama/g35/keymaps/default/readme.md @@ -0,0 +1,4 @@ +![G35 Layout Image](https://i.imgur.com/fDlRAN9.png) +# Default G35 Layout + +This is the default layout for the G35. diff --git a/keyboards/mechllama/g35/readme.md b/keyboards/mechllama/g35/readme.md new file mode 100644 index 00000000000..e0d895b4ef1 --- /dev/null +++ b/keyboards/mechllama/g35/readme.md @@ -0,0 +1,15 @@ +# MechLlama G35 + +![Photo](https://i.imgur.com/EvIA4t0.jpg) + +A 35 key left-handed columnar layout macropad. + +Keyboard Maintainer: [Kaylyn Bogle](https://github.com/kaylynb/) +Hardware Supported: G35 v1 & v2 +Hardware Availability: [KiCad and Gerbers](https://github.com/kaylynb/MechLlama-G35) + +Make example for this keyboard (after setting up your build environment): + + make mechllama/g35/v2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/mechllama/g35/rules.mk b/keyboards/mechllama/g35/rules.mk new file mode 100644 index 00000000000..1e1487513a7 --- /dev/null +++ b/keyboards/mechllama/g35/rules.mk @@ -0,0 +1,14 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) + +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = atmel-dfu + +NKRO_ENABLE = yes +OLED_DRIVER_ENABLE = yes +RGBLIGHT_ENABLE = yes + +DEFAULT_FOLDER = mechllama/g35/v2 diff --git a/keyboards/mechllama/g35/v1/config.h b/keyboards/mechllama/g35/v1/config.h new file mode 100644 index 00000000000..9e7be98ea17 --- /dev/null +++ b/keyboards/mechllama/g35/v1/config.h @@ -0,0 +1,25 @@ +/* +Copyright 2019 Kaylyn Bogle + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define DEVICE_VER 0x0001 + +#define MATRIX_ROW_PINS { F5, F6, F4, F1, D4 } +#define MATRIX_COL_PINS { D6, D7, B4, B5, B6, F0, D5 } + +#define RGBLED_NUM 41 diff --git a/keyboards/mechllama/g35/v1/rules.mk b/keyboards/mechllama/g35/v1/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/mechllama/g35/v2/config.h b/keyboards/mechllama/g35/v2/config.h new file mode 100644 index 00000000000..09d5f607d29 --- /dev/null +++ b/keyboards/mechllama/g35/v2/config.h @@ -0,0 +1,25 @@ +/* +Copyright 2019 Kaylyn Bogle + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define DEVICE_VER 0x0002 + +#define MATRIX_ROW_PINS { F5, F4, F1, F0, D4 } +#define MATRIX_COL_PINS { D6, D7, B4, B5, B6, F6, D5 } + +#define RGBLED_NUM 6 diff --git a/keyboards/mechllama/g35/v2/rules.mk b/keyboards/mechllama/g35/v2/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/mechmini/readme.md b/keyboards/mechmini/readme.md index 427cbbd03ba..fc43eb12484 100644 --- a/keyboards/mechmini/readme.md +++ b/keyboards/mechmini/readme.md @@ -19,7 +19,7 @@ Make example for this keyboard (after setting up your build environment), this w make mechmini:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Mechmini Notes diff --git a/keyboards/mechmini/v1/README.md b/keyboards/mechmini/v1/README.md index 9f44a9c2cd5..315349803a0 100644 --- a/keyboards/mechmini/v1/README.md +++ b/keyboards/mechmini/v1/README.md @@ -11,7 +11,7 @@ Make example for this keyboard (after setting up your build environment): make mechmini/v1:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Mechmini Notes @@ -29,7 +29,7 @@ $ brew cask install crosspack-avr $ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `./util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` diff --git a/keyboards/mechmini/v1/config.h b/keyboards/mechmini/v1/config.h index 1f46451f99a..9355a6dc33c 100644 --- a/keyboards/mechmini/v1/config.h +++ b/keyboards/mechmini/v1/config.h @@ -42,7 +42,4 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS #define RGB_DI_PIN E2 -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - #endif diff --git a/keyboards/mechmini/v1/keymaps/default/keymap.c b/keyboards/mechmini/v1/keymaps/default/keymap.c index 4a0a4dc0a69..f9e446064a5 100644 --- a/keyboards/mechmini/v1/keymaps/default/keymap.c +++ b/keyboards/mechmini/v1/keymaps/default/keymap.c @@ -13,8 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "mechmini.h" -#include "quantum.h" +#include QMK_KEYBOARD_H #define _BL 0 // base layer #define _FN1 1 // function layer 1 diff --git a/keyboards/mechmini/v2/README.md b/keyboards/mechmini/v2/README.md index a43afc6740b..fdc9fef9bf2 100644 --- a/keyboards/mechmini/v2/README.md +++ b/keyboards/mechmini/v2/README.md @@ -15,7 +15,7 @@ Make example for this keyboard (after setting up your build environment), this w make mechmini/v2:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Mechmini Notes diff --git a/keyboards/mechmini/v2/config.h b/keyboards/mechmini/v2/config.h index e0922bb7e22..9da3e5f0ad6 100755 --- a/keyboards/mechmini/v2/config.h +++ b/keyboards/mechmini/v2/config.h @@ -17,7 +17,6 @@ #include "config_common.h" - /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0xCA40 @@ -49,7 +48,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -57,11 +56,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/mechmini/v2/keymaps/arkag/keymap.c b/keyboards/mechmini/v2/keymaps/arkag/keymap.c index 29e125394bc..4f4cbda3f37 100644 --- a/keyboards/mechmini/v2/keymaps/arkag/keymap.c +++ b/keyboards/mechmini/v2/keymaps/arkag/keymap.c @@ -7,33 +7,47 @@ */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_2u_space_ortho( - KC_LEAD, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, QUOTE, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, - M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, KC_SLSH, KC_BSLS, KC_LEFT, KC_DOWN, KC_RGHT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, MEDIA, FUNCT, XXXXXXX, GAME , KC_LEAD), [_RAISE] = LAYOUT_2u_space_ortho( - GRAVE, KC_1, KC_2, THREE, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + GRAVE, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, OBRACK, CBRACK, KC_EQL, HYPHEN, _______, _______, KC_4, KC_5, KC_6, _______, KC_NLCK, - _______, _______, _______, CEDILLA, _______, KC_COMM, KC_PDOT, KC_1, KC_2, KC_3, KC_PPLS, KC_PENT, - _______, _______, _______, KEEB, _______, _______, _______, M_OS, KC_PSLS, KC_PMNS, KC_PAST), + _______, _______, _______, CEDILLA, _______, KC_COMM, KC_PDOT, KC_1, KC_2, KC_3, KC_BSLS, KC_PENT, + _______, _______, _______, KEEB, _______, _______, KC_0, KC_PSLS, KC_PMNS, KC_PPLS, KC_PAST), [_LOWER] = LAYOUT_2u_space_ortho( - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, M_P_B, M_C_A_D, + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_CAPS, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), + _______, LRALT, _______, _______, _______, _______, _______, _______, _______, _______, _______), - [_KEEB] = LAYOUT_2u_space_ortho( + [_MEDIA] = LAYOUT_2u_space_ortho( + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, _______, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, _______, _______), + + [_FUNCT] = LAYOUT_2u_space_ortho( KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, M_SFT, M_SPC, M_OS ), + + [_KEEB] = LAYOUT_2u_space_ortho( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, BL_BRTG, _______, _______, _______, _______, _______, _______, RGB_M_P, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - [_LAZY] = LAYOUT_2u_space_ortho( - _______, _______, _______, _______, _______, M_TM, _______, M_SNIPT, M_SHRUG, _______, _______, KC_MUTE, - _______, _______, _______, _______, _______, M_GGT, _______, M_UF, M_LOD, M_REPO, _______, _______, - _______, _______, _______, _______, _______, _______, _______, M_TF, M_LENNY, _______, KC_VOLU, KC_MPLY, - _______, _______, _______, _______, _______, _______, M_CALC, _______, KC_MPRV, KC_VOLD, KC_MNXT), + [_GAMING] = LAYOUT_2u_space_ortho( + KC_ESC, KC_F13, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_TAB, KC_F14, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LSFT, KC_F15, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LCTL, KC_F16, KC_Z, KC_X, KC_C, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, GAME, XXXXXXX), + }; diff --git a/keyboards/mechmini/v2/keymaps/arkag/rules.mk b/keyboards/mechmini/v2/keymaps/arkag/rules.mk index c1d5afa1eba..64f65f7062e 100644 --- a/keyboards/mechmini/v2/keymaps/arkag/rules.mk +++ b/keyboards/mechmini/v2/keymaps/arkag/rules.mk @@ -1,4 +1,4 @@ -BOOTMAGIC_ENABLE = no +BOOTMAGIC_ENABLE = lite MOUSEKEY_ENABLE = no STENO_ENABLE = no EXTRAKEY_ENABLE = yes @@ -6,7 +6,7 @@ CONSOLE_ENABLE = no COMMAND_ENABLE = no SLEEP_LED_ENABLE = no NKRO_ENABLE = yes -BACKLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = no AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes TAP_DANCE_ENABLE = yes diff --git a/keyboards/mechmini/v2/keymaps/default/keymap.c b/keyboards/mechmini/v2/keymaps/default/keymap.c index e35f25ee401..b0701ed58e2 100755 --- a/keyboards/mechmini/v2/keymaps/default/keymap.c +++ b/keyboards/mechmini/v2/keymaps/default/keymap.c @@ -4,11 +4,15 @@ #define _FN1 1 #define _FN2 2 -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +enum custom_keycodes { + SFT_ESC +}; + +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BL] = LAYOUT_split_space( - F(0), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + SFT_ESC,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_RSFT, KC_DOT, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_RCTL, MO(1), MO(2)), @@ -27,25 +31,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - - switch (id) { - - } - return MACRO_NONE; -} - void matrix_init_user(void) { } void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { if (usb_led & (1 << USB_LED_NUM_LOCK)) { @@ -80,21 +71,11 @@ void led_set_user(uint8_t usb_led) { } -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -102,7 +83,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -110,6 +91,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c b/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c index 40bfc42de0f..fba582e1b78 100755 --- a/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c +++ b/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c @@ -4,6 +4,7 @@ #define _FN1 2 #define _FN2 3 #define _WIN 1 +#define _FN3 4 //Tap Dance Declarations enum { @@ -22,10 +23,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LT(OSL(2), KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, GUI_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_ENT), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TD(TD_DOTCOM), OSL(2), OSM(MOD_RSFT), - KC_ESC, KC_LALT, KC_LCTL, KC_SPC, KC_RGUI, RGB_TOG), + KC_ESC, KC_LALT, KC_LCTL, KC_SPC, KC_RGUI, MO(4)), [_WIN] = LAYOUT_625_space( LT(OSL(2), KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_ENT), + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(4, KC_ENT), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TD(TD_DOTCOM), OSL(2), OSM(MOD_RSFT), KC_ESC, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, RGB_TOG), [_FN1] = LAYOUT_625_space( @@ -35,14 +36,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_FN2] = LAYOUT_625_space( + KC_PWR, KC_BRID, KC_BRIU, KC_NO, KC_NO, KC_NO, KC_NO, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, RESET, + MT(KC_LGUI, KC_ESC), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(1), KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_625_space( KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET, MT(KC_LGUI, KC_ESC), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(1), KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; - - - - - diff --git a/keyboards/mechmini/v2/keymaps/spacebarracecar/config.h b/keyboards/mechmini/v2/keymaps/spacebarracecar/config.h new file mode 100644 index 00000000000..45dcbb04b58 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/spacebarracecar/config.h @@ -0,0 +1,3 @@ +#pragma once + + diff --git a/keyboards/mechmini/v2/keymaps/spacebarracecar/keymap.c b/keyboards/mechmini/v2/keymaps/spacebarracecar/keymap.c new file mode 100644 index 00000000000..a7e06c6043e --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/spacebarracecar/keymap.c @@ -0,0 +1,139 @@ +#include QMK_KEYBOARD_H +#include "spacebarracecar.h" + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +enum layers { + _BASE, + _RAISE, + _LOWER, + _MUSICMODE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base +,-----------------------------------------------------------------------------------------------------------------------. +|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Shift |Y |X |C |V |B |N |M |, |. |/ |Shift | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|LCtrl | |Win |Alt |Lower |Space |Enter |Raise |AltGr |Win |Menu |RCtrl | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_BASE] = LAYOUT_ortho( + KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, + CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, + CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, CTLENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Lower +,-----------------------------------------------------------------------------------------------------------------------. +|~ |! |" |# |$ |% |^ |& |* |( |) | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |? | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_ortho( + DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, + _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise +,-----------------------------------------------------------------------------------------------------------------------. +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT_ortho( + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Deadkey +,-----------------------------------------------------------------------------------------------------------------------. +| | | | | | | |Ü | |Ö | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Ä |ß | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | |" |" | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_DEADKEY] = LAYOUT_ortho( + KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, KC_BSPC, + CU_NAV, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, + CU_LSFT, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_RSFT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, CU_DDQ, CU_DDQ, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Navigation +,-----------------------------------------------------------------------------------------------------------------------. +|ALT F4 |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|RESET |ESCT | | | | | | | | | |Game | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_NAV] = LAYOUT_ortho( + _______, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, EMOJI, KC_ENT, + _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, RGB_TOG, RGB_MOD, RGB_HUI, CU_RGBV, _______, + RESET, CU_ESCT, ALTF4, _______, _______, KC_SPC, CTLENT, RGB_M_P, _______, _______, _______, CU_GAME +) + +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { +switch (keycode) { + case MO(_LOWER): + if (game){ + if(record->event.pressed) { + register_code(KC_SPC); + } else { + unregister_code(KC_SPC); + } + return false; + } else { + return true; + } + case KC_LALT: + if (game) { + if (record->event.pressed){ + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + } else { + return true; + } + default: + return true; + } +} diff --git a/keyboards/mechmini/v2/keymaps/spacebarracecar/readme.md b/keyboards/mechmini/v2/keymaps/spacebarracecar/readme.md new file mode 100644 index 00000000000..d4039713a51 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/spacebarracecar/readme.md @@ -0,0 +1,5 @@ +# SpacebarRacecar US-International Mechmini 2 Keymap for German PCs + +This keymap emulates most keys of the US-International layout on PCs that have German set as input language. +This allows the use of the keyboard on any PC in Germany without the need to change any settings. +The keymap is mostly based on the Planck default layout but adds essential features for german input, like access to Ä, Ö, Ü, ß. diff --git a/keyboards/mechmini/v2/keymaps/spacebarracecar/rules.mk b/keyboards/mechmini/v2/keymaps/spacebarracecar/rules.mk new file mode 100644 index 00000000000..cade68ac984 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/spacebarracecar/rules.mk @@ -0,0 +1,22 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Userspace defines +GERMAN_ENABLE = yes # Enable Custom US Ansi Keycodes for PC with German set as input language diff --git a/keyboards/mechmini/v2/keymaps/wsturgiss/config.h b/keyboards/mechmini/v2/keymaps/wsturgiss/config.h new file mode 100755 index 00000000000..262c423cc41 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/wsturgiss/config.h @@ -0,0 +1,11 @@ +/* tapdance */ +#define TAPPING_TERM 180 + +/* space cadet stuff */ +#define LSPO_KEY KC_9 +#define RSPC_KEY KC_0 +#define DISABLE_SPACE_CADET_ROLLOVER + +/* leader stuff */ +#define LEADER_TIMEOUT 400 +#define LEADER_PER_KEY_TIMING 300 diff --git a/keyboards/mechmini/v2/keymaps/wsturgiss/keymap.c b/keyboards/mechmini/v2/keymaps/wsturgiss/keymap.c new file mode 100644 index 00000000000..f6f10872041 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/wsturgiss/keymap.c @@ -0,0 +1,106 @@ +#include QMK_KEYBOARD_H + +#define base 0 +#define raise 1 +#define lower 2 + +//Tap Dance Declarations +enum { + TD_SEMI_QUOT = 0, + TD_COMM_MINUS = 1, + TD_DOT_EQUAL = 2, + TD_SLASH_BACKSLASH = 3 +}; + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for ;, twice for ' -not using this currently + [TD_SEMI_QUOT] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), + //Tap once for , twice for - + [TD_COMM_MINUS] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_MINUS), + //Tap once for . twice for = + [TD_DOT_EQUAL] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_EQUAL), + //Tap once for / twice for '\' + [TD_SLASH_BACKSLASH] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS) +}; + +#define CTRL_ESC CTL_T(KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [base] = LAYOUT_2u_space_ortho( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTRL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TD(1), TD(2), TD(3), KC_RSPC, + KC_LCTL, KC_LEAD, KC_LALT, KC_LGUI, MO(1), KC_SPC, MO(2), KC_VOLD, KC_MPLY, KC_VOLU, KC_GRV), + + [raise] = LAYOUT_2u_space_ortho( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_QUOT, _______, + _______, KC_HOME, KC_END, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, _______, KC_MNXT, EEP_RST), + + [lower] = LAYOUT_2u_space_ortho( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, _______, _______, KC_4, KC_5, KC_6, KC_KP_PLUS, _______, + _______, RGB_SAI, RGB_SAD, RGB_HUI, RGB_HUD, _______, _______, KC_1, KC_2, KC_3, KC_KP_MINUS, _______, + _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______) + + +}; + +//Leader maps + + +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY(KC_F) { + // Anything you can do in a macro. + SEND_STRING("QMK is awesome."); + } + //tableflip (LEADER - TF) + SEQ_TWO_KEYS(KC_T, KC_F) { + set_unicode_input_mode(UC_OSX); + send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); + } + //screencap (LEADER - SC) + SEQ_TWO_KEYS(KC_S, KC_C) { + SEND_STRING(SS_LGUI(SS_LSFT(SS_TAP(X_4)))); + } + //screencap (LEADER - TM) + SEQ_TWO_KEYS(KC_T, KC_M) { + set_unicode_input_mode(UC_OSX); + send_unicode_hex_string("2122"); + } + /* + SEQ_THREE_KEYS(KC_D, KC_D, KC_S) { + SEND_STRING("https://start.duckduckgo.com"SS_TAP(X_ENTER)); + } + */ + } +} + +//change colors and rgb modes on layer change +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case raise: + rgblight_mode_noeeprom(1); + rgblight_setrgb(0xc7, 0x00, 0xf4); + break; + case lower: + rgblight_mode_noeeprom(1); + rgblight_setrgb(0x00, 0xa3, 0x0d); + break; + default: // for any other layers, or the default layer + rgblight_mode_noeeprom(5); + rgblight_setrgb(0xFF, 0xB6, 0x00); + break; + } + return state; +}; + diff --git a/keyboards/mechmini/v2/keymaps/wsturgiss/rules.mk b/keyboards/mechmini/v2/keymaps/wsturgiss/rules.mk new file mode 100755 index 00000000000..a2c78f8db05 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/wsturgiss/rules.mk @@ -0,0 +1,11 @@ +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes +LEADER_ENABLE = yes diff --git a/keyboards/mehkee96/config.h b/keyboards/mehkee96/config.h index 70ca273c36b..334358aad1c 100644 --- a/keyboards/mehkee96/config.h +++ b/keyboards/mehkee96/config.h @@ -15,4 +15,3 @@ #define RGBLED_NUM 16 #define RGBLIGHT_ANIMATIONS /* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/mehkee96/program b/keyboards/mehkee96/program deleted file mode 100644 index b777b911066..00000000000 --- a/keyboards/mehkee96/program +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro , Sebastian Kaim -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from __future__ import print_function - -import os -import sys -import time -import usb - - -def checkForKeyboardInNormalMode(): - """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" - return usb.core.find(idVendor=0x20A0, idProduct=0x422D) - -def checkForKeyboardInBootloaderMode(): - """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" - return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) - -def flashKeyboard(firmware_file): - """Calls bootloadHID to flash the given file to the device.""" - print('Flashing firmware to device ...') - if os.system('bootloadHID -r "%s"' % firmware_file) == 0: - print('\nDone!') - else: - print('\nbootloadHID returned an error.') - -def printDeviceInfo(dev): - """Prints all infos for a given USB device""" - print('Device Information:') - print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) - print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) - print('Manufacturer: %s' % (dev.iManufacturer)) - print('Serial: %s' % (dev.iSerialNumber)) - print('Product: %s' % (dev.iProduct), end='\n\n') - -def sendDeviceToBootloaderMode(dev): - """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" - try: - dev.set_configuration() - - request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - - USBRQ_HID_SET_REPORT = 0x09 - HID_REPORT_OPTION = 0x0301 - - dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5) - except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - - -if len(sys.argv) < 2: - print('Usage: %s ' % sys.argv[0]) - sys.exit(1) - -kb = checkForKeyboardInNormalMode() - -if kb is not None: - print('Found a keyboard in normal mode. Attempting to send it to bootloader mode ...', end='') - sendDeviceToBootloaderMode(kb) - print(' done.') - print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") - print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") - -attempts = 12 # 60 seconds -found = False -for attempt in range(1, attempts + 1): - print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') - - if checkForKeyboardInBootloaderMode(): - print('Found', end='\n\n') - flashKeyboard(sys.argv[1]) - found = True - break - else: - print('Nothing.', end='') - - if attempt != attempts: # no need to wait on the last attempt - print(' Sleeping 5 seconds.', end='') - time.sleep(5) - - # print a newline - print() - -if not found: - print("Couldn't find a flashable keyboard. Aborting.") - sys.exit(2) - diff --git a/keyboards/mehkee96/readme.md b/keyboards/mehkee96/readme.md index 9dfad2a79eb..a06f2e33e6a 100644 --- a/keyboards/mehkee96/readme.md +++ b/keyboards/mehkee96/readme.md @@ -12,5 +12,35 @@ Make example for this keyboard (after setting up your build environment): make mehkee96:default -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/mehkee96/rules.mk b/keyboards/mehkee96/rules.mk index e6e7d4a5883..f7fb397e259 100644 --- a/keyboards/mehkee96/rules.mk +++ b/keyboards/mehkee96/rules.mk @@ -32,4 +32,4 @@ CUSTOM_MATRIX = yes SRC = matrix.c i2c.c # programming options -PROGRAM_CMD = ./keyboards/mehkee96/program $(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/meira/config.h b/keyboards/meira/config.h index ff39f90eb72..8cbd82f01d3 100644 --- a/keyboards/meira/config.h +++ b/keyboards/meira/config.h @@ -32,8 +32,8 @@ along with this program. If not, see . #define MATRIX_ROWS 4 #define MATRIX_COLS 12 -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION CUSTOM_MATRIX +/* COL2ROW, ROW2COL*/ +//#define DIODE_DIRECTION #ifdef BACKLIGHT_ENABLE #define BACKLIGHT_LEVELS 10 diff --git a/keyboards/meira/featherble/config.h b/keyboards/meira/featherble/config.h index b7cdfe8bdb8..fb24c607953 100644 --- a/keyboards/meira/featherble/config.h +++ b/keyboards/meira/featherble/config.h @@ -47,9 +47,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING //#define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -94,11 +93,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/meira/keymaps/cole/keymap.c b/keyboards/meira/keymaps/cole/keymap.c index b1c230d9264..71c8d9711dc 100644 --- a/keyboards/meira/keymaps/cole/keymap.c +++ b/keyboards/meira/keymaps/cole/keymap.c @@ -118,10 +118,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // Setting ADJUST layer RGB back to default void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { diff --git a/keyboards/meira/keymaps/default/config.h b/keyboards/meira/keymaps/default/config.h index 5f5844a70a1..e3776d2eff1 100644 --- a/keyboards/meira/keymaps/default/config.h +++ b/keyboards/meira/keymaps/default/config.h @@ -14,10 +14,9 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here // place overrides here #define MUSIC_MASK (keycode != KC_NO) @@ -30,5 +29,3 @@ SONG(DVORAK_SOUND) \ } #endif - -#endif diff --git a/keyboards/meira/keymaps/default/keymap.c b/keyboards/meira/keymaps/default/keymap.c index 4bbd014cb79..9bcd771c421 100644 --- a/keyboards/meira/keymaps/default/keymap.c +++ b/keyboards/meira/keymaps/default/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "meira.h" +#include QMK_KEYBOARD_H #include "lighting.h" #ifdef RGBLIGHT_ENABLE @@ -162,10 +162,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // Setting ADJUST layer RGB back to default void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { @@ -178,22 +174,6 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { } } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/meira/keymaps/grahampheath/keymap.c b/keyboards/meira/keymaps/grahampheath/keymap.c index 69815ef9754..cd02137877b 100644 --- a/keyboards/meira/keymaps/grahampheath/keymap.c +++ b/keyboards/meira/keymaps/grahampheath/keymap.c @@ -204,10 +204,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/meira/keymaps/takmiya/keymap.c b/keyboards/meira/keymaps/takmiya/keymap.c index 48602dfaf4c..12dad6d6901 100644 --- a/keyboards/meira/keymaps/takmiya/keymap.c +++ b/keyboards/meira/keymaps/takmiya/keymap.c @@ -112,10 +112,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // Setting ADJUST layer RGB back to default void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { diff --git a/keyboards/meira/matrix.c b/keyboards/meira/matrix.c index c1952f35fb1..030c91332d0 100644 --- a/keyboards/meira/matrix.c +++ b/keyboards/meira/matrix.c @@ -33,11 +33,11 @@ along with this program. If not, see . #include "config.h" #include "timer.h" -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -132,7 +132,7 @@ uint8_t _matrix_scan(void) { // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); if (matrix_changed) { debouncing = true; @@ -144,8 +144,8 @@ uint8_t _matrix_scan(void) } -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } @@ -276,5 +276,3 @@ static void unselect_cols(void) _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW } } - - diff --git a/keyboards/meira/meira.c b/keyboards/meira/meira.c index 3ff62a080b9..1d0db5e9972 100644 --- a/keyboards/meira/meira.c +++ b/keyboards/meira/meira.c @@ -89,32 +89,6 @@ void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); } -//void action_function(keyrecord_t *event, uint8_t id, uint8_t opt) -//{ -//#ifdef AUDIO_ENABLE -// int8_t sign = 1; -//#endif -// if(id == LFK_ESC_TILDE){ -// // Send ~ on shift-esc -// void (*method)(uint8_t) = (event->event.pressed) ? &add_key : &del_key; -// uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); -// method(shifted ? KC_GRAVE : KC_ESCAPE); -// send_keyboard_report(); -// }else if(event->event.pressed){ -// switch(id){ -// case LFK_CLEAR: -// // Go back to default layer -// layer_clear(); -// break; -//#ifdef ISSI_ENABLE -// case LFK_LED_TEST: -// led_test(); -// break; -//#endif -// } -// } -//} - void reset_keyboard_kb(){ #ifdef WATCHDOG_ENABLE MCUSR = 0; diff --git a/keyboards/meira/promicro/config.h b/keyboards/meira/promicro/config.h index 0c4e8f17f50..67e5ca06d18 100644 --- a/keyboards/meira/promicro/config.h +++ b/keyboards/meira/promicro/config.h @@ -20,7 +20,6 @@ along with this program. If not, see . #include "config_common.h" - /* * Keyboard Matrix Assignments * @@ -40,7 +39,7 @@ along with this program. If not, see . #define CATERINA_BOOTLOADER /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -83,11 +82,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/meira/readme.md b/keyboards/meira/readme.md index 6d5d9b55351..10c27ee94e2 100644 --- a/keyboards/meira/readme.md +++ b/keyboards/meira/readme.md @@ -18,7 +18,7 @@ or make meira/featherble:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information on generic QMK configuration and setup. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information on generic QMK configuration and setup. Both the Pro Micro and the Feather BLE use the Catalina bootloader, which is typically programmed using avrdude. diff --git a/keyboards/meira/rules.mk b/keyboards/meira/rules.mk index 6c2472f4336..2796335b6a9 100644 --- a/keyboards/meira/rules.mk +++ b/keyboards/meira/rules.mk @@ -1,7 +1,6 @@ SRC += matrix.c TWIlib.c issi.c lighting.c # MCU name -#MCU = at90usb1286 MCU = atmega32u4 diff --git a/keyboards/meishi/config.h b/keyboards/meishi/config.h new file mode 100644 index 00000000000..3393610c79b --- /dev/null +++ b/keyboards/meishi/config.h @@ -0,0 +1,182 @@ +/* +Copyright 2019 Biacco42 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xBC42 +#define PRODUCT_ID 0x0002 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Biacco42 +#define PRODUCT meishi +#define DESCRIPTION The micro macro keyboard + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B5 } +#define MATRIX_COL_PINS { B1, B3, B2, B6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 diff --git a/keyboards/meishi/keymaps/default/keymap.c b/keyboards/meishi/keymaps/default/keymap.c new file mode 100644 index 00000000000..528beb168b7 --- /dev/null +++ b/keyboards/meishi/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +/* Copyright 2017 Biacco42 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT( /* Base */ + LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V) \ +), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/meishi/keymaps/default/readme.md b/keyboards/meishi/keymaps/default/readme.md new file mode 100644 index 00000000000..a9eb4e9cd80 --- /dev/null +++ b/keyboards/meishi/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for meishi \ No newline at end of file diff --git a/keyboards/meishi/meishi.c b/keyboards/meishi/meishi.c new file mode 100644 index 00000000000..92c5194d5f7 --- /dev/null +++ b/keyboards/meishi/meishi.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Biacco42 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "meishi.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/meishi/meishi.h b/keyboards/meishi/meishi.h new file mode 100644 index 00000000000..61b9f628dbc --- /dev/null +++ b/keyboards/meishi/meishi.h @@ -0,0 +1,31 @@ +/* Copyright 2019 Biacco42 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, k03\ +) \ +{ \ + { k00, k01, k02, k03 }\ +} + diff --git a/keyboards/meishi/readme.md b/keyboards/meishi/readme.md new file mode 100644 index 00000000000..99421ed8d33 --- /dev/null +++ b/keyboards/meishi/readme.md @@ -0,0 +1,19 @@ +# Meishi - The micro macro keyboard + +_Meishi_ means name cards. + +![meishi](https://raw.githubusercontent.com/Biacco42/meishi/readme/readme_image/P1210037.JPG) + +Only four keys keyboard for self made keyboard beginners. + +Keyboard Maintainer: [Biacco42](https://github.com/biacco42) +Hardware Supported: [Meishi keyboard PCB](https://github.com/Biacco42/meishi), Pro Micro supported +Hardware Availability: [Tanoshi life - Booth](https://biacco42.booth.pm/) + +Make example for this keyboard (after setting up your build environment): + +``` +$ make meishi:default:avrdude +``` + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/meishi/rules.mk b/keyboards/meishi/rules.mk new file mode 100644 index 00000000000..6cba6b6b869 --- /dev/null +++ b/keyboards/meishi/rules.mk @@ -0,0 +1,67 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/meishi2/config.h b/keyboards/meishi2/config.h new file mode 100644 index 00000000000..f681eb50067 --- /dev/null +++ b/keyboards/meishi2/config.h @@ -0,0 +1,250 @@ +/* +Copyright 2019 Biacco42 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xBC42 +#define PRODUCT_ID 0x0003 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Biacco42 +#define PRODUCT meishi2 +#define DESCRIPTION The better micro macro keyboard + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 2 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, E6 } +#define MATRIX_COL_PINS { F5, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +//#define LCD_LINES 2 //< number of visible lines of the display +//#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display +//#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/meishi2/info.json b/keyboards/meishi2/info.json new file mode 100644 index 00000000000..11e18e9f478 --- /dev/null +++ b/keyboards/meishi2/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "meishi2", + "url": "", + "maintainer": "biacco42", + "width": 4, + "height": 1, + "layouts": { + "LAYOUT": { + "key_count": 4, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 } + ] + } + } +} diff --git a/keyboards/meishi2/keymaps/default/config.h b/keyboards/meishi2/keymaps/default/config.h new file mode 100644 index 00000000000..4e23fe7b141 --- /dev/null +++ b/keyboards/meishi2/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Biacco42 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/meishi2/keymaps/default/keymap.c b/keyboards/meishi2/keymaps/default/keymap.c new file mode 100644 index 00000000000..6eb3b5a9ffd --- /dev/null +++ b/keyboards/meishi2/keymaps/default/keymap.c @@ -0,0 +1,35 @@ +/* Copyright 2019 Biacco42 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V) \ + ) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} + diff --git a/keyboards/meishi2/keymaps/default/readme.md b/keyboards/meishi2/keymaps/default/readme.md new file mode 100644 index 00000000000..e03642d2225 --- /dev/null +++ b/keyboards/meishi2/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for meishi2 \ No newline at end of file diff --git a/keyboards/meishi2/meishi2.c b/keyboards/meishi2/meishi2.c new file mode 100644 index 00000000000..a74e6d3e639 --- /dev/null +++ b/keyboards/meishi2/meishi2.c @@ -0,0 +1,51 @@ +/* Copyright 2019 Biacco42 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "meishi2.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/meishi2/meishi2.h b/keyboards/meishi2/meishi2.h new file mode 100644 index 00000000000..776e0b0e1d6 --- /dev/null +++ b/keyboards/meishi2/meishi2.h @@ -0,0 +1,34 @@ +/* Copyright 2019 Biacco42 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03 \ +) \ +{ \ + { k00, k01 }, \ + { k02, k03 } \ +} diff --git a/keyboards/meishi2/readme.md b/keyboards/meishi2/readme.md new file mode 100644 index 00000000000..d80ec44184a --- /dev/null +++ b/keyboards/meishi2/readme.md @@ -0,0 +1,15 @@ +# meishi2 + +![meishi2](https://i.imgur.com/lG5iI3m.jpg) + +meishi2 - The better micro macro keyboard + +Keyboard Maintainer: [Biacco42](https://github.com/Biacco42) +Hardware Supported: The PCBs, controllers supported +Hardware Availability: [links to where you can find this hardware](https://github.com/Biacco42/meishi2) + +Make example for this keyboard (after setting up your build environment): + + make meishi2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/meishi2/rules.mk b/keyboards/meishi2/rules.mk new file mode 100644 index 00000000000..bc370be0397 --- /dev/null +++ b/keyboards/meishi2/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/melody96/config.h b/keyboards/melody96/config.h index 67123a7e524..8ab88653f3f 100644 --- a/keyboards/melody96/config.h +++ b/keyboards/melody96/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -30,7 +29,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +37,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS @@ -51,5 +45,3 @@ #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #endif - -#endif diff --git a/keyboards/melody96/info.json b/keyboards/melody96/info.json index e2a31c9f34a..f69ae267909 100644 --- a/keyboards/melody96/info.json +++ b/keyboards/melody96/info.json @@ -7,6 +7,12 @@ "layouts": { "LAYOUT": { "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Scroll Lock", "x":14, "y":0}, {"label":"Pause", "x":15, "y":0}, {"label":"Insert", "x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"PgUp", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"+", "x":18, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}, {"x":18, "y":5}] + }, + "LAYOUT_hotswap": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Home", "x":13, "y":0}, {"label":"End", "x":14, "y":0}, {"label":"PgUp", "x":15, "y":0}, {"label":"PgDn", "x":16, "y":0}, {"label":"Media Play", "x":17, "y":0}, {"label":"Pause", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "y":2, "h":2}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"Up", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"GUI", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"label":"Space", "x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"Left", "x":13, "y":5}, {"label":"Down", "x":14, "y":5}, {"label":"Right", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}, {"label":"Enter", "x":18, "y":4, "h":2}] + }, + "LAYOUT_std60_split_num0": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15, "y":0}, {"label":"PgUp", "x":16, "y":0}, {"label":"PgDn", "x":17, "y":0}, {"label":"Delete", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "y":2, "h":2}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":2.75}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"GUI", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"label":"Space", "x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.25}, {"label":"Fn", "x":11.25, "y":5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5, "w":1.25}, {"label":"0", "x":15, "y":5}, {"label":"00", "x":16, "y":5}, {"label":".", "x":17, "y":5}, {"label":"Enter", "x":18, "y":4, "h":2}] } } -} \ No newline at end of file +} diff --git a/keyboards/melody96/keymaps/crilith/keymap.c b/keyboards/melody96/keymaps/crilith/keymap.c index ca65b5ad1b2..4c5e27668cc 100644 --- a/keyboards/melody96/keymaps/crilith/keymap.c +++ b/keyboards/melody96/keymaps/crilith/keymap.c @@ -7,7 +7,6 @@ enum custom_keycodes { #include "dynamic_macro.h" -#define _______ KC_TRNS #define KC_REC DYN_REC_START1 #define KC_DONE DYN_REC_STOP #define KC_PLAY DYN_MACRO_PLAY1 @@ -17,16 +16,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_DEL, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, TT(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), LAYOUT( RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_TOG, _______, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, - BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CALC, _______, _______, _______, + _______, RGB_TOG, _______, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, KC_TAB, + BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_TAB, _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PLAY, _______, KC_REC, KC_DONE, _______, _______, _______, _______, _______, _______), }; diff --git a/keyboards/melody96/keymaps/default/keymap.c b/keyboards/melody96/keymaps/default/keymap.c index 16f4561b587..ba73cbce835 100644 --- a/keyboards/melody96/keymaps/default/keymap.c +++ b/keyboards/melody96/keymaps/default/keymap.c @@ -69,10 +69,6 @@ BL_TOGG, BL_DEC, BL_INC changes the in-switch LEDs _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } diff --git a/keyboards/melody96/keymaps/default_std60_split_num0/keymap.c b/keyboards/melody96/keymaps/default_std60_split_num0/keymap.c new file mode 100644 index 00000000000..25881d3f80e --- /dev/null +++ b/keyboards/melody96/keymaps/default_std60_split_num0/keymap.c @@ -0,0 +1,40 @@ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + KC_P00 = SAFE_RANGE +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_std60_split_num0( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_P1, KC_P2, KC_P3, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_P0, KC_P00, KC_PDOT, KC_PENT + ), + + [0] = LAYOUT_std60_split_num0( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, _______, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_P00: + if (record->event.pressed) { + SEND_STRING("00"); + } + break; + } + return true; +} diff --git a/keyboards/melody96/keymaps/default_std60_split_num0/readme.md b/keyboards/melody96/keymaps/default_std60_split_num0/readme.md new file mode 100644 index 00000000000..d20a179aa94 --- /dev/null +++ b/keyboards/melody96/keymaps/default_std60_split_num0/readme.md @@ -0,0 +1,39 @@ +# default_std60_split_num0 + +A modified default keymap for use with the LAYOUT_std60_split_num0 macro. + +## Base Layer + +``` +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│Esc│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Prt│Hm │End│PUp│PDn│Del│ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┼───┼───┼───┤ +│` ~│1 !│2 @│3 #│4 $│5 %│6 ^│7 &│8 *│9 (│0 )│- _│= +│ Bksp │NLk│ / │ * │ - │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┼───┼───┼───┤ +│ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │[ {│] }│ \ | │7 │8 │9 │ + │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤ │ +│CapsLk│ A │ S │ D │ F │ G │ H │ J │ K │ L │; :│' "│ Enter │4 │5 │6 │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┼───┼───┼───┼───┤ +│ Shift │ Z │ X │ C │ V │ B │ N │ M │, <│. >│/ ?│ Shift │1 │2 │3 │Ent│ +├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┼───┼───┼───┤ │ +│Ctrl│GUI │Alt │Space │Alt │Fn │Menu│Ctrl│0 │00 │ . │ │ +└────┴────┴────┴────────────────────────┴────┴────┴────┴────┴───┴───┴───┴───┘ +``` + +## Function Layer + +``` +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│RST│ │ │ │ │ │ │ │ │ │ │ │ │Mut│VDn│VUp│ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┼───┼───┼───┤ +│ │RTg│ │RMd│RH+│RH-│RS+│RS-│RV+│RV-│ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤ │ +│BLTogg│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┼───┼───┼───┼───┤ +│ │ │ │BL-│BTg│BL+│ │ │ │ │ │ │ │ │ │ │ +├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┼───┼───┼───┤ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────────────────────────┴────┴────┴────┴────┴───┴───┴───┴───┘ +``` diff --git a/keyboards/melody96/keymaps/konstantin/config.h b/keyboards/melody96/keymaps/konstantin/config.h new file mode 100644 index 00000000000..4b511eb8484 --- /dev/null +++ b/keyboards/melody96/keymaps/konstantin/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define LAYER_FN diff --git a/keyboards/melody96/keymaps/konstantin/keymap.c b/keyboards/melody96/keymaps/konstantin/keymap.c new file mode 100644 index 00000000000..e02ba0f85ec --- /dev/null +++ b/keyboards/melody96/keymaps/konstantin/keymap.c @@ -0,0 +1,78 @@ +#include QMK_KEYBOARD_H +#include "konstantin.h" + +static const HSV *colors[] = { &godspeed_blue, &godspeed_yellow }; +static const size_t cnum = sizeof colors / sizeof *colors; +static size_t cidx = 0; + +enum keycodes_keymap { + RGB_SET = RANGE_KEYMAP, +}; + +void eeconfig_init_keymap(void) { + rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGB_SET: + if (record->event.pressed) { + cidx = (cidx + 1) % cnum; + rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); + } + return false; + + default: + return true; + } +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│Hom│End│PgU│PgD│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │Del│NLk│P/ │P* │P- │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │P7 │P8 │P9 │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤P+ │ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │P4 │P5 │P6 │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ + * │LSft│RAG│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RSfRCt│ ↑ │P1 │P2 │P3 │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┴┬──┴──┬───┼───┼───┼───┼───┤PEn│ + * │LCtl│LGui│LAlt│ Space │RAlGu│FnLk │ ← │ ↓ │ → │P0 │P. │ │ + * └────┴────┴────┴────────────────────────┴─────┴─────┴───┴───┴───┴───┴───┴───┘ + */ + [L_BASE] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_HOME, KC_END, KC_PGUP, KC_PGDN, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, XXXXXXX, + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, RAL_RGU, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSF_RCT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, XXXXXXX, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), + + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │Sys│SLk│Pau│Brk│Top│Btm│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │RTg│ ÷ │ × │ − │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│RH+│RS+│RV+│ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤RSt│ + * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │RH-│RS-│RV-│ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ + * │ │ │MA0│MA2│MW←│MW→│ │ │App│Vo-│Vo+│Mut│ │PgU│RMR│RMS│RMB│ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┼───┼───┤RMP│ + * │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│RM-│RM+│ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ + */ + [L_FN] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SYSR, KC_SLCK, KC_PAUS, KC_BRK, TOP, BOTTOM, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_TOG, DIVIDE, TIMES, MINUS, + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SET, + _______, _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, KC_APP, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, RGB_M_R, RGB_M_SN,RGB_M_B, XXXXXXX, + _______, DST_P_R, DST_N_A, KC_WH_D, _______, XXXXXXX, _______, KC_HOME, KC_PGDN, KC_END, RGB_RMOD,RGB_MOD, RGB_M_P + ), +}; diff --git a/keyboards/melody96/keymaps/konstantin/rules.mk b/keyboards/melody96/keymaps/konstantin/rules.mk new file mode 100644 index 00000000000..995402cb053 --- /dev/null +++ b/keyboards/melody96/keymaps/konstantin/rules.mk @@ -0,0 +1,11 @@ +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = no +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = yes +SPACE_CADET_ENABLE = no +TAP_DANCE_ENABLE = yes +UNICODEMAP_ENABLE = yes diff --git a/keyboards/melody96/keymaps/zunger/config.h b/keyboards/melody96/keymaps/zunger/config.h new file mode 100644 index 00000000000..cc06440e0dd --- /dev/null +++ b/keyboards/melody96/keymaps/zunger/config.h @@ -0,0 +1,22 @@ +/* Copyright 2018 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// Enable cmd-option-escape on mac. +#define GRAVE_ESC_ALT_OVERRIDE + +// place overrides here diff --git a/keyboards/melody96/keymaps/zunger/keymap.c b/keyboards/melody96/keymaps/zunger/keymap.c new file mode 100644 index 00000000000..9031447cd20 --- /dev/null +++ b/keyboards/melody96/keymaps/zunger/keymap.c @@ -0,0 +1,250 @@ +/* Copyright 2019 Yonatan Zunger + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum custom_keycodes { + // We provide special layer management keys: + // GREEK triggers the Greek (aka "Front") layer, or the SHIFTGREEK layer when shift is held. + // (Because we use Unicode, we need to implement shift-handling at the firmware level, + // rather than the OS level like we do in the QWERTY layer) + // CADET or GREEK+ALT triggers the Cadet (aka "Top") layer, or the SHIFTCADET layer when + // shift is held. + // LAYER_LOCK locks the "base" layer (i.e., QWERTY, GREEK, or CADET) to the value which is + // pressed at the moment that it is being released. When a layer lock is set, the + // analogous layer modifier key is reversed; e.g., if you lock the GREEK layer, then the + // GREEK button bounces you back to QWERTY. + // + // We also parse the shift, alt, and caps lock keys to provide management of those which is + // compatible with these various layers. + KC_GREEK = SAFE_RANGE, + KC_CADET, + KC_LAYER_LOCK, +}; + +enum layers_keymap { + _QWERTY = 0, + _FUNCTION, + + _GREEK, + _SHIFTGREEK, + _CADET, + _SHIFTCADET, +}; + +// This is so that H(xxxx) has the same width as _______, which makes the grids more legible. +#define H(x) UC(0x##x) +#define MO_FN MO(_FUNCTION) +#define KC_LLCK KC_LAYER_LOCK + +// TODO: To generalize this, we want some #defines that let us specify how each key on the base +// layer should map to the four special layers, and then use that plus the base layer definition to +// autogenerate the keymaps for the other layers. +// TODO: It would also be nice to be able to put the actual code points in here, rather than +// numbers. +// TODO: Also add checkmark and dengir. + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* The diagram below shows five rows for each key: from top to bottom, the QWERTY layer, the + * GREEK layer, the SHIFTGREEK layer, the CADET layer, and the SHIFTCADET layer. (The single + * diagram is to make it easier to see what goes where with this many layers!) + * + * ,---------------------------------------------------------------------------- + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|HOM|END|PGU|PGD|MUT|BRK| QWERTY + * | ` | ¹ | ² | ³ | ⁴ | ⁵ | ⁶ | ⁷ | ⁸ | ⁹ | ⁰ | ⁻ | ⁺ | ⁽ | ⁾ | | | | | GREEK + * | ` | ₁ | ₂ | ₃ | ₄ | ₅ | ₆ | ₇ | ₈ | ₉ | ₀ | ₋ | ₊ | ₍ | ₎ | | | | | SHIFTGREEK + * | ¬ | | | | | | | | | | | | | | | | | | | CADET + * | ∅ | | | | | | | | | | | | | | | | | | | SHIFTCADET + * |---------------------------------------------------------------------------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | BKSPC |LCK| / | * | - | + * | ` | | | | | | | | | | | ∝ | ∼ | BKSPC |LCK| ⊘ | ⊙ | ⊖ | + * | ` | | | | | | | | | | | | ≁ | BKSPC |LCK| | ⊗ | | + * | | | | | | | | | | | | | ± | BKSPC |LCK| | | | + * | | | | | | | | | | | | | ∓ | BKSPC |LCK| | | | + * |---------------------------------------------------------------------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | 7 | 8 | 9 | | + * | | θ | ω | ε | ρ | τ | ψ | υ | ι | ο | π | | | | | | | | + * | | Θ | Ω | Ε | Ρ | Τ | Ψ | Υ | Ι | Ο | Π | | | | | | | | + * | | ∧ | ∨ | ∩ | ∪ | ⊂ | ⊃ | ∀ | ∞ | ∃ | ∂ | ∈ | | | * | * | * | | [1] + * | | ℚ | | | ℝ | ⊆ | ⊇ | | ℵ | ∄ | | ∉ | | | * | * | * | | + * |-----------------------------------------------------------------------| + | + * | CTRL | A | S | D | F | G | H | J | K | L | ; | ' | RET | 4 | 5 | 6 | ⊕ | + * | CTRL | α | σ | δ | φ | γ | η | ϑ | κ | λ | ⋯ | ⋅ | RET | | | | | + * | CTRL | Α | Σ | Δ | Φ | Γ | Η | | Κ | Λ | … | ∴ | RET | | | | | + * | CTRL | ⟘ | ⊤ | ⊢ | ⊣ | ↑ | ↓ | ← | → | ↔ | | | RET | * | * | * | | [1] + * | CTRL | Å | | ∇ | | ⇑ | ⇓ | ⇐ | ⇒ | ⇔ | | | RET | * | * | * | | + * |-----------------------------------------------------------------------|---| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / |SHFT | ↑ | 1 | 2 | 3 | | + * | SHIFT | ζ | ξ | χ | ς | β | ν | μ | ≪ | ≫ | ∫ |SHFT | | | | | | + * | SHIFT | Ζ | Ξ | Χ | ✔ | Β | Ν | Μ | ≲ | ≳ | |SHFT | | | | | | + * | SHIFT | | | ≠ | ≈ | ≡ | ≤ | ≥ | | | ÷ |SHFT | | * | * | * | | [1] + * | SHIFT | ℤ | | ℂ | ≉ | ≢ | ℕ | | | | |SHFT | | * | * | * | | + * |-----------------------------------------------------------------------|ENT| + * | CTL | ALT| CMD| SPACE | α | β | γ | ← | ↓ | → | 0 | . | | [2] + * | CTL | ALT| CMD| SPACE | α | β | γ | | | | | | | + * | CTL | ALT| CMD| SPACE | α | β | γ | | | | | | | + * | CTL | ALT| CMD| SPACE | α | β | γ | | | | | | | + * | CTL | ALT| CMD| SPACE | α | β | γ | | | | | | | + * `---------------------------------------------------------------------------' + * + * [1] CADET + numpad moves the mouse. SHIFT+CADET+NUMPAD moves it more quickly. CADET+5 + * clicks the mouse, and SHIFT+CADET+FIVE right-clicks. + * [2] The Greek letters in this row are the three modifier keys (GREEK, CADET, FN), + * not the Unicode Greek letters. + */ + // NB: Using GESC for escape in the QWERTY layer as a temporary hack because I messed up the + // switch on the KC_GRV key; change back to KC_ESC once this is fixed. + [_QWERTY] = LAYOUT_hotswap( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_MPLY, KC_BRK, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_LLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_GREEK,KC_CADET,MO_FN, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + [_GREEK] = LAYOUT_hotswap( + KC_GRV, H(00b9), H(00b2), H(00b3), H(2074), H(2075), H(2076), H(2077), H(2078), H(2079), H(2070), H(207b), H(207a), H(207d), H(207e), XXXXXXX, XXXXXXX, XXXXXXX, _______, + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, H(221d), H(223c), _______, _______, H(2298), H(2299), H(2296), + _______, H(03b8), H(03c9), H(03b5), H(03c1), H(03c4), H(03c8), H(03c5), H(03b9), H(03bf), H(03c0), KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, + _______, H(03b1), H(03c3), H(03b4), H(03c6), H(03b3), H(03b7), H(03d1), H(03ba), H(03bb), H(22ef), H(22c5), _______, KC_P4, KC_P5, KC_P6, H(2295), + _______, H(03b6), H(03be), H(03c7), H(03c2), H(03b2), H(03bd), H(03bc), H(226a), H(226b), H(222b), _______, _______, KC_P1, KC_P2, KC_P3, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT), + [_SHIFTGREEK] = LAYOUT_hotswap( + KC_GRV, H(2081), H(2082), H(2083), H(2084), H(2085), H(2086), H(2087), H(2088), H(2089), H(2080), H(208b), H(208a), H(208d), H(208e), XXXXXXX, XXXXXXX, XXXXXXX, _______, + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, H(2241), _______, _______, XXXXXXX, H(2297), XXXXXXX, + _______, H(0398), H(03a9), H(0395), H(03a1), H(03a4), H(03a8), H(03a5), H(0399), H(039f), H(03a0), KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, + _______, H(0391), H(03a3), H(0394), H(03a6), H(0393), H(0397), XXXXXXX, H(039a), H(039b), H(2026), H(2234), _______, KC_P4, KC_P5, KC_P6, H(2295), + _______, H(0396), H(039e), H(03a7), H(2714), H(0392), H(039d), H(039c), H(2272), H(2273), XXXXXXX, _______, _______, KC_P1, KC_P2, KC_P3, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT), + // TODO: Add mouse keys to keypad. + [_CADET] = LAYOUT_hotswap( + H(00AC), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, H(00b1), _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, + _______, H(2227), H(2228), H(2229), H(222a), H(2282), H(2283), H(2200), H(221e), H(2203), H(2202), H(2208), XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, + _______, H(22a5), H(22a4), H(22a2), H(22a3), H(2191), H(2193), H(2190), H(2192), H(2194), XXXXXXX, XXXXXXX, _______, KC_P4, KC_P5, KC_P6, XXXXXXX, + _______, XXXXXXX, XXXXXXX, H(2260), H(2248), H(2261), H(2264), H(2265), XXXXXXX, XXXXXXX, H(00f7), _______, _______, KC_P1, KC_P2, KC_P3, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT), + [_SHIFTCADET] = LAYOUT_hotswap( + H(2205), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, H(2213), _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, + _______, H(211a), XXXXXXX, XXXXXXX, H(211d), H(2286), H(2287), XXXXXXX, H(2135), H(2204), XXXXXXX, H(2209), XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, + _______, H(212b), XXXXXXX, H(2207), XXXXXXX, H(21d1), H(21d3), H(21d0), H(21d2), H(21d4), XXXXXXX, XXXXXXX, _______, KC_P4, KC_P5, KC_P6, XXXXXXX, + _______, H(2124), XXXXXXX, H(2102), H(2249), H(2262), H(2115), XXXXXXX, XXXXXXX, XXXXXXX, H(00f7), _______, _______, KC_P1, KC_P2, KC_P3, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT), + + // Function layer is mostly for keyboard meta-control operations. Lots of this is just from the + // default layout; TODO make it nicer, add Unicode mode switchers. + [_FUNCTION] = LAYOUT_hotswap( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, _______, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, _______, _______, UC_M_OS, UC_M_LN, UC_M_WI, UC_M_BS, UC_M_WC, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +// Layer bitfields. +#define GREEK_LAYER (1UL << _GREEK) +#define SHIFTGREEK_LAYER (1UL << _SHIFTGREEK) +#define CADET_LAYER (1UL << _CADET) +#define SHIFTCADET_LAYER (1UL << _SHIFTCADET) +// The layers we don't touch. +#define LAYER_MASK ~(GREEK_LAYER|SHIFTGREEK_LAYER|CADET_LAYER|SHIFTCADET_LAYER) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // We track these persistent globals and manage them on our own, rather than trying to rely on + // get_mods or the like, because this function is called *before* that's updated! + static bool shift_held = false; + static bool alt_held = false; + static bool greek_held = false; + static bool cadet_held = false; + + // These are where we remember the values of lock states. + static bool shift_lock = false; + static int layer_lock = _QWERTY; + + // Process any modifier key presses. + if (keycode == KC_LSHIFT || keycode == KC_RSHIFT) { + shift_held = record->event.pressed; + } else if (keycode == KC_LALT || keycode == KC_RALT) { + alt_held = record->event.pressed; + } else if (keycode == KC_GREEK) { + greek_held = record->event.pressed; + } else if (keycode == KC_CADET) { + cadet_held = record->event.pressed; + } + + // Now let's transform these into the "cadet request" and "greek request." + const bool greek_request = (greek_held && !alt_held); + const bool cadet_request = (cadet_held || (greek_held && alt_held)); + + // Now, handle the lock keys. We store next_layer_lock in a local variable so that we can + // determine the layer to pick right now before we update layer_lock. + int next_layer_lock = layer_lock; + if (keycode == KC_CAPS) { + // If we're in QWERTY mode, caps lock is already going to be managed by the host OS, but by + // tracking it ourselves we can also usefully apply it to the GREEK and CADET layers. + if (record->event.pressed) { + shift_lock = !shift_lock; + } + } else if (keycode == KC_LAYER_LOCK) { + if (record->event.pressed) { + if (cadet_request) { + next_layer_lock = _CADET; + } else if (greek_request) { + next_layer_lock = _GREEK; + } else { + next_layer_lock = _QWERTY; + } + } + } + + // OK! Now we know which buttons are being held, and the current and upcoming states of the locks. + // We can compute our new base layer. Remember that the CADET and GREEK keys act as their own + // antonyms if they match the layer lock -- e.g., if you have CADET locked, then CADET+X generates + // QWERTY-X. + int base_layer; + if (cadet_request) { + base_layer = (layer_lock == _CADET ? _QWERTY : _CADET); + } else if (greek_request) { + base_layer = (layer_lock == _GREEK ? _QWERTY : _GREEK); + } else { + base_layer = layer_lock; + } + + const bool shifted = (shift_held != shift_lock); + int actual_layer; + if (base_layer == _CADET) { + actual_layer = (shifted ? _SHIFTCADET : _CADET); + } else if (base_layer == _GREEK) { + actual_layer = (shifted ? _SHIFTGREEK : _GREEK); + } else { + // We don't do shifting for the QWERTY layer, since for that we emit USB HID codes and shifting + // is managed by the host OS. + actual_layer = _QWERTY; + } + + // And now we can update the layer lock and the actual firmware layer selector. + layer_lock = next_layer_lock; + layer_state_t new_layer_state = (layer_state & LAYER_MASK) | (1UL << actual_layer); + if (new_layer_state != layer_state) { + layer_state_set(new_layer_state); + } + + // TODO: We can update LED states based on shift_lock (caps), layer_lock (layer lock), and + // base_layer (base layer). + + return true; +} diff --git a/keyboards/melody96/keymaps/zunger/readme.md b/keyboards/melody96/keymaps/zunger/readme.md new file mode 100644 index 00000000000..3eb64a2e739 --- /dev/null +++ b/keyboards/melody96/keymaps/zunger/readme.md @@ -0,0 +1,78 @@ +* The "Cadet-Style" keymap for the melody96. +* Author: Yonatan Zunger (zunger@gmail.com) + +This is an experimental keymap being used both for practical reasons (as my daily driver) and to +work out the ideas of a "space-cadet-style" keyboard which can type text and mathematical symbols +with equal ease. It's designed for anyone who frequently needs to do this outside of a LaTeX +environment, or for anyone who loves the old "Space Cadet" keyboard! And it works at its best when +you have actual Cadet keycaps (like SA Symbolics) installed, because those keycaps will actually +show what you get. + +The core idea of this keyboard is that, in addition to a QWERTY base layer and a function layer, it +supports two additional base layers -- the GREEK layer (the analogue of the Space Cadet "Greek," or +"Front," keys) and the CADET layer (the analogue of the Space Cadet "Top" keys). These layers use +Unicode to generate all of the mathematical symbols you can find on a traditional Space Cadet +layout, plus a bunch of extras. + +Because Unicode can't be encoded using the traditional USB HID protocol, QMK does some clever but +horrifying things to fool your OS. One consequence of this is that the shift key needs to be handled +by the keyboard firmware, not the host OS. To handle this, we have two additional layers -- +SHIFTGREEK and SHIFTCADET -- and handle the flipping between all of these layers here in the +firmware. + +*The simple bit: Using this layout on a Melody96* + +At the core of this layout are three special modifier keys and two special lock keys: + +* The GREEK key, to the right of the spacebar, activates the GREEK layer. GREEK+SHIFT activates + SHIFTGREEK. These keys generate Greek letters on the letter keys (thus the name), and a few + mathematical symbols on other keys. They correspond to the notations on the front of traditional + Space Cadet keys; if your capset doesn't include those (alas, most don't), they're the "pretty + obvious" mappings. +* The CADET key, to the right of GREEK, activates the CADET layer. These are the symbols above the + letters on a Space Cadet layout. CADET+SHIFT activates the SHIFTCADET layer, with even more + symbols. +* The FUNCTION key, to the right of CADET, activates the function layer. This is where you have a + reset mechanism, a selector for which Unicode input type you want, and so on. + +Additionally, GREEK+ALT is equivalent to CADET. This is handy for other keyboards where you don't +have room for this many modifiers. + +The lock keys are: + +* Caps lock, if you use it, will also act as a "shift lock" for the Greek and Cadet layers. Shift + lock is slightly different, in that while it is engaged shift will _dis_engage it; that's actually + pretty useful when typing math. +* An additional "layer lock" key, by default where "num lock" usually goes, will lock the choice of + base layer. To use it, hold down any invocation of the GREEK or CADET layers, or none at all, and + hit lock; it will then put you in that layer. The corresponding modifier key will then toggle you + back to the QWERTY layer. (So for example, if you hit GREEK+LAYER_LOCK and release them, you're + now typing in Greek; the GREEK modifier would cause you to type QWERTY momentarily. To go back to + ordinary QWERTY mode, you'd just hit LAYER_LOCK again with no modifiers held) + +To see the full layout, check out the big comment in keymap.c. + +*A less-simple bit: Adapting this to other keyboards* + +This is really a canary for generic Cadet implementations. Before this can be made generic, a few +things will have to happen: + +(1) Instead of a fixed keymap, this has to be refactored into some kind of array showing the +mappings of QWERTY-layer keys onto the appropriate code points in the GREEK and CADET layers, and +some preprocessor magic needs to auto-transform this plus a traditional keymap for the QWERTY layer +into keymaps for all five of the core layers. (Function layers would presumably be handled on a +per-keyboard basis) + +(2) The standard mapping of those should have some #define's to control things like whether there +are physical F-keys (you would probably want to move superscript and subscripts onto the numbers if +there weren't, and figure out what to do with the non-numeric super/sub keys), whether you actually +want to enable GREEK+ALT=CADET, and so on; + +(3) There should be support for controlling indicator LEDs based on the base layer selection, +caps/shift lock state, and layer lock state, as well as for triggering audio on transitions; + +(4) All the core fancy logic in process_record_user which implements the layer handling should be +factored out into its own function, so that keyboards can easily reuse that, too. + +This is a lovely TODO for future work, and could be particularly fun to go along with new releases +of SA Symbolics and the like. Anyone interested in such things, ping me! diff --git a/keyboards/melody96/keymaps/zunger/rules.mk b/keyboards/melody96/keymaps/zunger/rules.mk new file mode 100644 index 00000000000..a61cfa33fa9 --- /dev/null +++ b/keyboards/melody96/keymaps/zunger/rules.mk @@ -0,0 +1,2 @@ +# You need Unicode for this map. +UNICODE_ENABLE = yes # Unicode diff --git a/keyboards/melody96/melody96.c b/keyboards/melody96/melody96.c index 2d313bc1e1e..2fe274ee471 100644 --- a/keyboards/melody96/melody96.c +++ b/keyboards/melody96/melody96.c @@ -1,7 +1,6 @@ #include "melody96.h" -void led_set_user(uint8_t usb_led) { - +void led_set_kb(uint8_t usb_led) { if (usb_led & (1 << USB_LED_NUM_LOCK)) { DDRC |= (1 << 6); PORTC &= ~(1 << 6); } else { @@ -19,4 +18,6 @@ void led_set_user(uint8_t usb_led) { } else { DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); } -} \ No newline at end of file + + led_set_user(usb_led); +} diff --git a/keyboards/melody96/melody96.h b/keyboards/melody96/melody96.h index f60f054caee..37a6a85b09d 100644 --- a/keyboards/melody96/melody96.h +++ b/keyboards/melody96/melody96.h @@ -1,5 +1,4 @@ -#ifndef MELODY96_H -#define MELODY96_H +#pragma once #include "quantum.h" @@ -25,4 +24,78 @@ { K110, K111, K112, K113, K114, K115, K116, K117, K118 } \ } -#endif +/* + * The layout macro for the layout of hotswap keyboards, with illustrative grid of a typical + * assignment. + * ,--------------------------------------------------------------------------- + * |ESC|F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|PSC|HOM|END|PGU|PGD|DEL| + * ,--------------------------------------------------------------------------| + * | ` |1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | BKSPC |NLK| / | * | - | + * |--------------------------------------------------------------------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | 7 | 8 | 9 | | + * |----------------------------------------------------------------------| + | + * | CTRL | A | S | D | F | G | H | J | K | L | ; | ' | RET | 4 | 5 | 6 | | + * |----------------------------------------------------------------------|---| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / |RSHFT| ↑ | 1 | 2 | 3 | | + * |----------------------------------------------------------------------|ENT| + * |LCTL|LWIN|LALT| SPACE |CTL|ALT|FN | ← | ↓ | → | 0 | . | | + * `--------------------------------------------------------------------------- + */ +#define LAYOUT_hotswap( \ + K050, K051, K052, K053, K054, K055, K056, K057, K058, K118, K117, K115, K114, K113, K116, K112, K111, K110, K063, \ + K040, K041, K042, K043, K044, K045, K046, K047, K048, K108, K107, K105, K104, K106, K102, K101, K100, K064, \ + K030, K031, K032, K033, K034, K035, K036, K037, K038, K098, K097, K095, K094, K093, K096, K092, K091, \ + K020, K021, K022, K023, K024, K025, K026, K027, K028, K088, K087, K085, K084, K086, K082, K081, K080, \ + K010, K012, K013, K014, K015, K016, K017, K018, K078, K077, K075, K074, K073, K076, K072, K071, \ + K000, K001, K002, K006, K008, K007, K005, K004, K003, K066, K062, K061, K060 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { K010, KC_NO, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, KC_NO, K066, KC_NO, KC_NO }, \ + { KC_NO, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, KC_NO, K084, K085, K086, K087, K088 }, \ + { KC_NO, K091, K092, K093, K094, K095, K096, K097, K098 }, \ + { K100, K101, K102, KC_NO, K104, K105, K106, K107, K108 }, \ + { K110, K111, K112, K113, K114, K115, K116, K117, K118 } \ +} + +/* LAYOUT_std60_split_num0 + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Prt│Pau│Hm │End│PUp│PDn│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┼───┼───┼───┤ + * │` ~│1 !│2 @│3 #│4 $│5 %│6 ^│7 &│8 *│9 (│0 )│- _│= +│ Bksp │NLk│ / │ * │ - │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │[ {│] }│ \ | │7 │8 │9 │ + │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤ │ + * │CapsLk│ A │ S │ D │ F │ G │ H │ J │ K │ L │; :│' "│ Enter │4 │5 │6 │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┼───┼───┼───┼───┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │, <│. >│/ ?│ Shift │1 │2 │3 │Ent│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┼───┼───┼───┤ │ + * │Ctrl│GUI │Alt │Space │Alt │GUI │Menu│Ctrl│0 │00 │ . │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┴───┴───┴───┴───┘ + */ +#define LAYOUT_std60_split_num0( \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, KB8, KB7, KB5, KB4, KB3, KB6, KB2, KB1, KB0, K63, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, KA8, KA7, KA5, KA4, KA6, KA2, KA1, KA0, K64, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K98, K97, K95, K94, K84, K96, K92, K91, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K88, K87, K85, K93, K86, K82, K81, K80, \ + K10, K12, K13, K14, K15, K16, K17, K18, K78, K77, K75, K74, K76, K72, K71, \ + K00, K01, K02, K06, K08, K07, K04, K03, K66, K62, K61, K60 \ +) { \ + { K00, K01, K02, K03, K04, KC_NO, K06, K07, K08 }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, K64, KC_NO, K66, KC_NO, KC_NO }, \ + { KC_NO, K71, K72, KC_NO, K74, K75, K76, K77, K78 }, \ + { K80, K81, K82, KC_NO, K84, K85, K86, K87, K88 }, \ + { KC_NO, K91, K92, K93, K94, K95, K96, K97, K98 }, \ + { KA0, KA1, KA2, KC_NO, KA4, KA5, KA6, KA7, KA8 }, \ + { KB0, KB1, KB2, KB3, KB4, KB5, KB6, KB7, KB8 } \ +} diff --git a/keyboards/melody96/readme.md b/keyboards/melody96/readme.md index b43398dd358..2d472b32769 100644 --- a/keyboards/melody96/readme.md +++ b/keyboards/melody96/readme.md @@ -2,14 +2,14 @@ ![melody96](https://i.imgur.com/9o0a6XF.png) -96-key Keyboard from YMDK +96-key Keyboard from YMDK. The PCB for this board is also commonly used in the NYM96. Keyboard Maintainer: [superuser41](https://github.com/kaylanm) Hardware Supported: melody96 -Hardware Availability: [YMDK, group buy closed](https://geekhack.org/index.php?topic=93614.0) +Hardware Availability: [YMDK on Geekhack, group buy closed](https://geekhack.org/index.php?topic=93614.0), [NYM96 on Massdrop](https://www.massdrop.com/buy/nym96-aluminum-mechanical-keyboard?mode=guest_open) Make example for this keyboard (after setting up your build environment): make melody96:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/meme/config.h b/keyboards/meme/config.h index d1e3d27a185..e06b0e4efe7 100644 --- a/keyboards/meme/config.h +++ b/keyboards/meme/config.h @@ -46,16 +46,15 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D3, D2, B5, B6, C7, C6, C5, C4 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 #define BACKLIGHT_BREATHING #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -105,11 +104,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/meme/keymaps/default/config.h b/keyboards/meme/keymaps/default/config.h index 2c852d18199..a3ed4f762a6 100644 --- a/keyboards/meme/keymaps/default/config.h +++ b/keyboards/meme/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/meme/readme.md b/keyboards/meme/readme.md index 9d3bce94855..94b55d746ef 100644 --- a/keyboards/meme/readme.md +++ b/keyboards/meme/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make meme:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/meme/rules.mk b/keyboards/meme/rules.mk index 339bb5f6a28..c9f2bd450a4 100644 --- a/keyboards/meme/rules.mk +++ b/keyboards/meme/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u2 # Processor frequency. diff --git a/keyboards/mf68/README.md b/keyboards/mf68/README.md deleted file mode 100644 index 7dd3a900a54..00000000000 --- a/keyboards/mf68/README.md +++ /dev/null @@ -1,18 +0,0 @@ -MF68 -==== - -Magicforce 68 with [replacement PCB](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) designed by [di0ib](https://github.com/di0ib). - -Keyboard Maintainer: [di0ib](http://www.40percent.club) -Hardware Supported: Pro Micro -Hardware Availability: [PCB files](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68/pcb) - -Make example for this keyboard (after setting up your build environment): - - make mf68:default - -Example of flashing this keyboard: - - make mf68:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/mf68/config.h b/keyboards/mf68/config.h deleted file mode 100644 index 07d787eacfa..00000000000 --- a/keyboards/mf68/config.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x0510 -#define DEVICE_VER 0x0101 -#define MANUFACTURER di0ib -#define PRODUCT MF68 -#define DESCRIPTION Magicforce 68 with programmable PCB replacement - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 9 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } -#define MATRIX_COL_PINS { D3, D2, D1, D0, D4, C6, D7, E6, B4 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/mf68/keymaps/default/keymap.c b/keyboards/mf68/keymaps/default/keymap.c deleted file mode 100644 index 73045f3107a..00000000000 --- a/keyboards/mf68/keymaps/default/keymap.c +++ /dev/null @@ -1,68 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _QWERTY 0 -#define _FN1 1 -#define _FN2 2 -#define KC_ KC_TRNS -#define KC_X0 LT(_FN2, KC_GRV) -#define KC_X1 MO(_FN1) -#define KC_X2 BL_STEP - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ - LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT - /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ - ), - - [_FN1] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , , , , , , X2 , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , , , , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , ,MUTE, , , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ), - - [_FN2] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , 0 , 1 , 2 , 3 , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/mf68/keymaps/factory/keymap.c b/keyboards/mf68/keymaps/factory/keymap.c deleted file mode 100644 index 0c5305e5191..00000000000 --- a/keyboards/mf68/keymaps/factory/keymap.c +++ /dev/null @@ -1,74 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _QWERTY 0 -#define _FN1 1 -#define _FN2 2 -#define KC_ KC_TRNS -#define KC_X0 LT(_FN2, KC_CAPS) -#define KC_X1 MO(_FN1) -#define KC_X2 BL_STEP -#define KC_X3 BL_BRTG -#define KC_X4 BL_TOGG -#define KC_X5 BL_INC -#define KC_X6 BL_DEC - - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ - LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT - /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ - ), - - [_FN1] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , ,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , UP , , , , , , ,PSCR,SLCK,PAUS, X2 , , ,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - X0 ,LEFT,DOWN,RGHT, , X6 , X5 , X4 , X3 , X2 ,HOME, , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , ,MPLY,MSTP,MPRV,MNXT,VOLD,VOLU,MUTE, ,END , , X5 , - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , X3 , X6 , X4 - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ), - - [_FN2] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , 0 , 1 , 2 , 3 , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/mf68/mf68.h b/keyboards/mf68/mf68.h deleted file mode 100644 index a55c1d60b07..00000000000 --- a/keyboards/mf68/mf68.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef MF68_H -#define MF68_H - -#include "quantum.h" - -#define LAYOUT_68_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ - { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ - { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ - { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ - { K70, K71, K72, K73, K74 } \ -} - -#define LAYOUT_kc( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) LAYOUT_68_ansi( \ - KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ - KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ - KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ - KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ - KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ - KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ - KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ - KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ -) - -#endif diff --git a/keyboards/mf68/rules.mk b/keyboards/mf68/rules.mk deleted file mode 100644 index 9f6445686d5..00000000000 --- a/keyboards/mf68/rules.mk +++ /dev/null @@ -1,68 +0,0 @@ - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -LAYOUTS = 68_ansi \ No newline at end of file diff --git a/keyboards/mf68_ble/README.md b/keyboards/mf68_ble/README.md deleted file mode 100644 index 3829c8fd7de..00000000000 --- a/keyboards/mf68_ble/README.md +++ /dev/null @@ -1,27 +0,0 @@ -MF68 -==== - -Magicforce 68 with [replacement PCB](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) designed by [di0ib](https://github.com/di0ib). - -Keyboard Maintainer: [di0ib](http://www.40percent.club) -Hardware Supported: [Feather 32u4 Bluefruit](https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/) -Please note: This is 32u4 and not M0 -Hardware Availability: [PCB files](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68/pcb) -[MF68 thicc case files](https://github.com/harshitgoel96/mf68-case-thicc) -Story ------ - -The story and the idea behind this mod is available on [my reddit post](https://www.reddit.com/r/MechanicalKeyboards/comments/7eiiht/guide_i_built_a_bluetooth_enabled_magicforce68_no/) - -Wiring ------- - -Below is how you wire the Feather to PCB - -![wire map](https://i.imgur.com/zYOjlTA.png) - -Make example for this keyboard (after setting up your build environment): - - make mf68_ble:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/mf68_ble/config.h b/keyboards/mf68_ble/config.h deleted file mode 100644 index 83c0a7a5ac9..00000000000 --- a/keyboards/mf68_ble/config.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x0510 -#define DEVICE_VER 0x0101 -#define MANUFACTURER di0ib -#define PRODUCT MF68 -#define DESCRIPTION Magicforce 68 BLE - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 9 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D1, D0, C6, D7, B5, B6, B7, D6 } -#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, F0, D2, D3 } -#define UNUSED_PINS {B5} - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW -/* -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 -*/ - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/mf68_ble/info.json b/keyboards/mf68_ble/info.json deleted file mode 100644 index 4cd9b2c83c8..00000000000 --- a/keyboards/mf68_ble/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "MF68 BLE", - "url": "", - "maintainer": "qmk", - "width": 17.25, - "height": 5, - "layouts": { - "LAYOUT_68_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] - } - } -} diff --git a/keyboards/mf68_ble/keymaps/default/keymap.c b/keyboards/mf68_ble/keymaps/default/keymap.c deleted file mode 100644 index 73045f3107a..00000000000 --- a/keyboards/mf68_ble/keymaps/default/keymap.c +++ /dev/null @@ -1,68 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _QWERTY 0 -#define _FN1 1 -#define _FN2 2 -#define KC_ KC_TRNS -#define KC_X0 LT(_FN2, KC_GRV) -#define KC_X1 MO(_FN1) -#define KC_X2 BL_STEP - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ - LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT - /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ - ), - - [_FN1] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , , , , , , X2 , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , , , , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , ,MUTE, , , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ), - - [_FN2] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , 0 , 1 , 2 , 3 , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/mf68_ble/mf68_ble.c b/keyboards/mf68_ble/mf68_ble.c deleted file mode 100644 index 95f8592f8f1..00000000000 --- a/keyboards/mf68_ble/mf68_ble.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "mf68_ble.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} diff --git a/keyboards/mf68_ble/mf68_ble.h b/keyboards/mf68_ble/mf68_ble.h deleted file mode 100644 index 8ef14c98d44..00000000000 --- a/keyboards/mf68_ble/mf68_ble.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef MF68_BLE_H -#define MF68_BLE_H - -#include "quantum.h" - -#define LAYOUT_68_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ - { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ - { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ - { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ - { K70, K71, K72, K73, K74 } \ -} - -#define LAYOUT_kc( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) LAYOUT_68_ansi( \ - KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ - KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ - KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ - KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ - KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ - KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ - KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ - KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ -) - -#endif diff --git a/keyboards/mf68_ble/rules.mk b/keyboards/mf68_ble/rules.mk deleted file mode 100644 index 07b59d7853d..00000000000 --- a/keyboards/mf68_ble/rules.mk +++ /dev/null @@ -1,67 +0,0 @@ - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 8000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -BLUETOOTH = AdafruitBLE \ No newline at end of file diff --git a/keyboards/miniaxe/config.h b/keyboards/miniaxe/config.h index 13608feab25..db850971772 100644 --- a/keyboards/miniaxe/config.h +++ b/keyboards/miniaxe/config.h @@ -44,8 +44,7 @@ along with this program. If not, see . */ // #define MATRIX_ROW_PINS { D0, D5 } // #define MATRIX_COL_PINS { F1, F0, B0 } -#define NO_PIN 0xFF -#define MATRIX_ROW_COL_PINS { \ +#define DIRECT_PINS { \ { F1, E6, B0, B2, B3 }, \ { F5, F0, B1, B7, D2 }, \ { F6, F7, C7, D5, D3 }, \ @@ -53,8 +52,8 @@ along with this program. If not, see . } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION CUSTOM_MATRIX +/* COL2ROW, ROW2COL*/ +////#define DIODE_DIRECTION // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING @@ -71,7 +70,7 @@ along with this program. If not, see . #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -121,11 +120,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -237,9 +231,11 @@ along with this program. If not, see . /* Serial settings */ #define USE_SERIAL +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + //#define EE_HANDS #define I2C_MASTER_LEFT //#define I2C_MASTER_RIGHT #define DISABLE_JTAG - diff --git a/keyboards/miniaxe/keymaps/wanleg/config.h b/keyboards/miniaxe/keymaps/wanleg/config.h new file mode 100644 index 00000000000..0f20ea455f0 --- /dev/null +++ b/keyboards/miniaxe/keymaps/wanleg/config.h @@ -0,0 +1,11 @@ +#pragma once + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +//#define QMK_ESC_OUTPUT F1 // usually COL +//#define QMK_ESC_INPUT D6 // usually ROW // connected to nothing on the miniaxe +//#define QMK_LED D7 //connected to nothing on the miniaxe diff --git a/keyboards/miniaxe/keymaps/wanleg/keymap.c b/keyboards/miniaxe/keymaps/wanleg/keymap.c new file mode 100644 index 00000000000..69233741ba5 --- /dev/null +++ b/keyboards/miniaxe/keymaps/wanleg/keymap.c @@ -0,0 +1,49 @@ +#include QMK_KEYBOARD_H +#include "wanleg.h" + +#define LAYOUT_miniaxe_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + _______, NUMBER, ETCETERA, KC_SPC, DIRECTION, KC_RGUI \ + ) +#define LAYOUT_miniaxe_base_wrapper(...) LAYOUT_miniaxe_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_GK] = LAYOUT_miniaxe_base_wrapper( + _______________Gherkin_Row_0_______________, + _______________Gherkin_Row_1_______________, + SFT_T(KC_Z), KC_X, KC_C, LT(NUM,KC_V), LT(ETC,KC_B), LT(_FN,KC_N), LT(DIR,KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) +), + +[NUM] = LAYOUT_wrapper( + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________, + _______, _______, _______, KC_ENT, KC_RSFT, _______ +), + +[DIR] = LAYOUT_miniaxe_base_wrapper( + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________ +), + +[ETC] = LAYOUT_wrapper( + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________, + _______, NUMBER, ETCETERA, LALT(LCTL(KC_DEL)), DIRECTION, KC_RGUI +), + +[_FN] = LAYOUT_miniaxe_base_wrapper( + _______________Gherkin_FN_0________________, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +}; \ No newline at end of file diff --git a/keyboards/miniaxe/keymaps/wanleg/rules.mk b/keyboards/miniaxe/keymaps/wanleg/rules.mk new file mode 100644 index 00000000000..ae5ae549cc3 --- /dev/null +++ b/keyboards/miniaxe/keymaps/wanleg/rules.mk @@ -0,0 +1,18 @@ +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +#BOOTLOADER = qmk-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 \ No newline at end of file diff --git a/keyboards/miniaxe/matrix.c b/keyboards/miniaxe/matrix.c deleted file mode 100644 index 55c458e1fb7..00000000000 --- a/keyboards/miniaxe/matrix.c +++ /dev/null @@ -1,596 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" -#include "split_flags.h" - -#ifdef RGBLIGHT_ENABLE -# include "rgblight.h" -#endif -#ifdef BACKLIGHT_ENABLE -# include "backlight.h" - extern backlight_config_t backlight_config; -#endif - -#if defined(USE_I2C) || defined(EH) -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -#if ((DIODE_DIRECTION == COL2ROW) || (DIODE_DIRECTION == ROW2COL)) -static uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; -#elif (DIODE_DIRECTION == CUSTOM_MATRIX) -static uint8_t row_col_pins[MATRIX_ROWS][MATRIX_COLS] = MATRIX_ROW_COL_PINS; -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#elif (DIODE_DIRECTION == CUSTOM_MATRIX) - static void init_cols_rows(void); - static bool read_cols(matrix_row_t current_matrix[], uint8_t current_row); -#endif - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -__attribute__ ((weak)) -void matrix_slave_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } - -#elif (DIODE_DIRECTION == CUSTOM_MATRIX) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols(matrix_debouncing+offset, current_row); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_cols(matrix+offset, current_row); -# endif - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#if defined(USE_I2C) || defined(EH) - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int err = 0; - - // write backlight info - #ifdef BACKLIGHT_ENABLE - if (BACKLIT_DIRTY) { - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // Backlight location - err = i2c_master_write(I2C_BACKLIT_START); - if (err) goto i2c_error; - - // Write backlight - i2c_master_write(get_backlight_level()); - - BACKLIT_DIRTY = false; - } - #endif - - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at I2C_KEYMAP_START - err = i2c_master_write(I2C_KEYMAP_START); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - #ifdef RGBLIGHT_ENABLE - if (RGB_DIRTY) { - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // RGB Location - err = i2c_master_write(I2C_RGB_START); - if (err) goto i2c_error; - - uint32_t dword = eeconfig_read_rgblight(); - - // Write RGB - err = i2c_master_write_data(&dword, 4); - if (err) goto i2c_error; - - RGB_DIRTY = false; - i2c_master_stop(); - } - #endif - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - - #ifdef RGBLIGHT_ENABLE - // Code to send RGB over serial goes here (not implemented yet) - #endif - - #ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_BACKLIT_START] = backlight_config.enable ? backlight_config.level : 0; - #endif - - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#if defined(USE_I2C) || defined(EH) - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#if defined(USE_I2C) || defined(EH) - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[I2C_KEYMAP_START+i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif - matrix_slave_scan_user(); -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == CUSTOM_MATRIX) - -static void init_cols_rows(void) -{ - for(int row = 0; row < MATRIX_ROWS; row++) { - for(int col = 0; col < MATRIX_COLS; col++) { - uint8_t pin = row_col_pins[row][col]; - if(pin == NO_PIN) { - continue; - } - // DDxn set 0 for input - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); - // PORTxn set 1 for input/pullup - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); - } - } -} - -static bool read_cols(matrix_row_t current_matrix[], uint8_t current_row) -{ - matrix_row_t last_row_value = current_matrix[current_row]; - current_matrix[current_row] = 0; - - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - uint8_t pin = row_col_pins[current_row][col_index]; - if(pin == NO_PIN) { - current_matrix[current_row] |= 0; - } - else { - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - } - - return (last_row_value != current_matrix[current_row]); -} - -#endif diff --git a/keyboards/miniaxe/rules.mk b/keyboards/miniaxe/rules.mk index 96e27686b8d..3f5f699ff6c 100644 --- a/keyboards/miniaxe/rules.mk +++ b/keyboards/miniaxe/rules.mk @@ -1,7 +1,4 @@ -SRC += matrix.c - # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -83,6 +80,6 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) DEBUG_ENABLE = no -CUSTOM_MATRIX = yes # Use custom matrix code +CUSTOM_MATRIX = no # Use custom matrix code SPLIT_KEYBOARD = yes # Use shared split_common code diff --git a/keyboards/minidox/config.h b/keyboards/minidox/config.h index 306a486cb96..7502983b6b7 100644 --- a/keyboards/minidox/config.h +++ b/keyboards/minidox/config.h @@ -42,18 +42,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* disable debug print */ //#define NO_DEBUG diff --git a/keyboards/minidox/keymaps/alairock/keymap.c b/keyboards/minidox/keymaps/alairock/keymap.c index 9faf6309688..c592b1a6a91 100644 --- a/keyboards/minidox/keymaps/alairock/keymap.c +++ b/keyboards/minidox/keymaps/alairock/keymap.c @@ -21,10 +21,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/keyboards/minidox/keymaps/default/keymap.c b/keyboards/minidox/keymaps/default/keymap.c index 521db63aab3..6cc78cce1d1 100644 --- a/keyboards/minidox/keymaps/default/keymap.c +++ b/keyboards/minidox/keymaps/default/keymap.c @@ -18,10 +18,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/keyboards/minidox/keymaps/dustypomerleau/README.md b/keyboards/minidox/keymaps/dustypomerleau/README.md new file mode 100644 index 00000000000..b2ec771257e --- /dev/null +++ b/keyboards/minidox/keymaps/dustypomerleau/README.md @@ -0,0 +1,28 @@ +## dustypomerleau, Minidox layout + +The rationale behind my layout can be summarized as follows: + +- Symmetry is important because use-cases are hard to predict. Whenever possible, modifiers and layer keys should be available from either hand. +- Inward rolls should be leveraged not just for alphas (Colemak DHm), but also for coding/symbols. +- Number order—like alpha order—should be designed to favor use of the strongest fingers. +- One-shot keys can greatly reduce the strain of typing, and should be leveraged. + +Some aspects of my layout are optimized for macOS (order of modifiers, manner of producing en and em dashes, coding of micro-volume adjustments, etc.), but can be easily tweaked for the OS of your choice. + +Shift can be a tricky modifier when used in `MT()` combinations, particularly for fast typists on split boards using serial. This can be partially mitigated with options in `config.h`, but still requires a relatively strict typing style/accuracy from the fast typist. The tendency is for faster typists to combat mod/tap mistakes by using very short intervals for `TAPPING_TERM`, but this can introduce its own set of complications. Shift is also one of the highest-yield opportunities to use `OSM()`. For these reasons, I pulled Shift onto dedicated keys in the thumbs for use during regular typing (the home row Shifts have been left in place for use during selection and keycuts). + +The tapdance code that I used to create mod/tap keys inside my symbol layer allows up to 2 consecutive symbols within `TAPPING_TERM`. If you think you will need to quickly nest more than that, feel free to add more `case`s. + +### Special thanks + +- Everyone on the QMK Discord, for helping me work out the code for mod/tap keys using shifted symbols. +- Everyone on the Colemak Discord, for their initial feedback on the layout. +- @stevep and @DreymaR, for their work on Colemak DH(m), a truly awesome typing experience (and of course Shai Coleman, for starting it all off!). +- @ckofy, for offering a dramatic improvement on Dvorak's original number order. +- u/That-Canadian, for designing this awesome keyboard. + +### Questions or comments? + +- GitHub @dustypomerleau +- Twitter @duspom +- Discord @dusty#8897 diff --git a/keyboards/minidox/keymaps/dustypomerleau/config.h b/keyboards/minidox/keymaps/dustypomerleau/config.h new file mode 100644 index 00000000000..b2169947b7a --- /dev/null +++ b/keyboards/minidox/keymaps/dustypomerleau/config.h @@ -0,0 +1,25 @@ +// dustypomerleau, Minidox config + +#pragma once + +#define EE_HANDS +#define IGNORE_MOD_TAP_INTERRUPT +#define ONESHOT_TIMEOUT 1000 +#define TAPPING_TERM 200 +#define USE_SERIAL + +// optional configuration: + +// #define CONVERT_TO_PROTON_C +// #define ONESHOT_TAP_TOGGLE 2 // not compatible with TAPPING_FORCE_HOLD +// #define PERMISSIVE_HOLD +// #define TAPPING_FORCE_HOLD // allows rapid mod use after tap event, but sacrifices double-tap to repeat + +// #define MOUSEKEY_DELAY 0 // delay before cursor movement (high feels sluggish, low makes fine movement difficult) +// #define MOUSEKEY_INTERVAL 20 // time between movement reports - low settings feel like high mouse speed +// #define MOUSEKEY_MAX_SPEED 10 +// #define MOUSEKEY_TIME_TO_MAX 60 +// #define MOUSEKEY_WHEEL_DELAY 0 +// #define MOUSEKEY_WHEEL_MAX_SPEED 8 +// #define MOUSEKEY_WHEEL_TIME_TO_MAX 4 + diff --git a/keyboards/minidox/keymaps/dustypomerleau/keymap.c b/keyboards/minidox/keymaps/dustypomerleau/keymap.c new file mode 100644 index 00000000000..e93a09f64a6 --- /dev/null +++ b/keyboards/minidox/keymaps/dustypomerleau/keymap.c @@ -0,0 +1,434 @@ +// Minidox keymap by dustypomerleau +// Thanks for checking out my keymap. The rationale behind the layout is described in the README. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum my_layers { + _CMK_DHM, + _QWERTY, + _SYS, + _NAV, + _NUM_E, + _NUM_N, + _SYM +}; + +enum my_keycodes { + CMK_DHM = SAFE_RANGE, + QWERTY, + SYS, + NAV, + NUM_E, + NUM_N, + SYM +}; + +enum td_keycodes { + ALT_LP, + CTL_RCB, + GUI_RP, + SFT_LCB, + SFT_PLS +}; + +typedef enum { + SINGLE_TAP, + SINGLE_HOLD, + DOUBLE_SINGLE_TAP +} td_state_t; + +static td_state_t td_state; +int cur_dance (qk_tap_dance_state_t *state); +void altlp_finished (qk_tap_dance_state_t *state, void *user_data); +void altlp_reset (qk_tap_dance_state_t *state, void *user_data); +void ctlrcb_finished (qk_tap_dance_state_t *state, void *user_data); +void ctlrcb_reset (qk_tap_dance_state_t *state, void *user_data); +void guirp_finished (qk_tap_dance_state_t *state, void *user_data); +void guirp_reset (qk_tap_dance_state_t *state, void *user_data); +void sftlcb_finished (qk_tap_dance_state_t *state, void *user_data); +void sftlcb_reset (qk_tap_dance_state_t *state, void *user_data); +void sftpls_finished (qk_tap_dance_state_t *state, void *user_data); +void sftpls_reset (qk_tap_dance_state_t *state, void *user_data); + +#define ALT_2 LALT_T(KC_2) +#define ALT_3 LALT_T(KC_3) +#define ALT_8 LALT_T(KC_8) +#define ALT_D LALT_T(KC_D) +#define ALT_E LALT_T(KC_E) +#define ALT_K LALT_T(KC_K) +#define ALT_LB LALT_T(KC_LBRC) +#define ALT_S LALT_T(KC_S) +#define CTRL_2 LCTL_T(KC_2) +#define CTRL_4 LCTL_T(KC_4) +#define CTRL_5 LCTL_T(KC_5) +#define CTRL_9 LCTL_T(KC_9) +#define CTRL_EQ LCTL_T(KC_EQL) +#define CTRL_I LCTL_T(KC_I) +#define CTRL_L LCTL_T(KC_L) +#define CTRL_R LCTL_T(KC_R) +#define CTRL_S LCTL_T(KC_S) +#define GUI_0 LGUI_T(KC_0) +#define GUI_1 LGUI_T(KC_1) +#define GUI_4 LGUI_T(KC_4) +#define GUI_7 LGUI_T(KC_7) +#define GUI_RB LGUI_T(KC_RBRC) +#define GUI_F LGUI_T(KC_F) +#define GUI_J LGUI_T(KC_J) +#define GUI_N LGUI_T(KC_N) +#define GUI_TEA LGUI_T(KC_T) +#define MAC_EM S(LALT(KC_MINS)) +#define MAC_EN LALT(KC_MINS) +#define NAV_BK LT(_NAV, KC_BSPC) +#define NAV_LK TG(_NAV) +#define NUME_SPC LT(_NUM_E, KC_SPC) +#define NUMLK_E TG(_NUM_E) +#define NUMLK_N TG(_NUM_N) +#define NUMN_SPC LT(_NUM_N, KC_SPC) +#define SFT_0 LSFT_T(KC_0) +#define SFT_1 LSFT_T(KC_1) +#define SFT_6 LSFT_T(KC_6) +#define SFT_7 LSFT_T(KC_7) +#define SFT_A LSFT_T(KC_A) +#define SFT_O LSFT_T(KC_O) +#define SFT_OS OSM(MOD_LSFT) +#define SFT_QOT LSFT_T(KC_QUOT) +#define SYM_OS OSL(_SYM) +#define SYS_Z LT(_SYS, KC_Z) +#define VOL_DN S(LALT(KC__VOLDOWN)) +#define VOL_UP S(LALT(KC__VOLUP)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak DHm + * + * ,----------------------------------. ,----------------------------------. + * | Q | W | F | P | B | | J | L | U | Y | ' | + * |------+------+------+------+------| |------+------+------+------+------| + * | SFT/A| CTL/R| ALT/S| GUI/T| G | | M | GUI/N| ALT/E| CTL/I| SFT/O| + * |------+------+------+------+------| |------+------+------+------+------| + * | SYS/Z| X | C | D | V | | K | H | , | . | ; | + * `----------------------------------' `----------------------------------' + * ,--------------------. ,--------------------. + * |SFT/OS|NAV/BK| | | |NUM/SP|SFT/OS| + * `------+------|SYM/OS| |SYM/OS|------+------' + * | | | | + * `------' `------' + */ +[_CMK_DHM] = LAYOUT( \ + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, \ + SFT_A, CTRL_R, ALT_S, GUI_TEA, KC_G, KC_M, GUI_N, ALT_E, CTRL_I, SFT_O, \ + SYS_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SCLN, \ + SFT_OS, NAV_BK, SYM_OS, SYM_OS, NUME_SPC, SFT_OS \ +), + +/* QWERTY + * + * ,----------------------------------. ,----------------------------------. + * | Q | W | E | R | T | | Y | U | I | O | P | + * |------+------+------+------+------| |------+------+------+------+------| + * | SFT/A| CTL/S| ALT/D| GUI/F| G | | H | GUI/J| ALT/K| CTL/L| SFT/'| + * |------+------+------+------+------| |------+------+------+------+------| + * | SYS/Z| X | C | V | B | | N | M | , | . | ; | + * `----------------------------------' `----------------------------------' + * ,--------------------. ,--------------------. + * |SFT/OS|NAV/BK| | | |NUM/SP|SFT/OS| + * `------+------|SYM/OS| |SYM/OS|------+------' + * | | | | + * `------' `------' + */ +[_QWERTY] = LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + SFT_A, CTRL_S, ALT_D, GUI_F, KC_G, KC_H, GUI_J, ALT_K, CTRL_L, SFT_QOT, \ + SYS_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SCLN, \ + SFT_OS, NAV_BK, SYM_OS, SYM_OS, NUMN_SPC, SFT_OS \ +), + +/* System, media, and layer lock keys + * If you use QWERTY + the Vanilla numbers primarily, change NUMLK_E to NUMLK_N here. + * + * ,----------------------------------. ,----------------------------------. + * | RESET|DEBUG |QWERTY|CMKDHM| | | | VOL--| VOL++|BRITE-|BRITE+| + * |------+------+------+------+------| |------+------+------+------+------| + * | SHIFT| CTRL | ALT | GUI |NAV LK| | POWER| VOL- | VOL+ | MUTE | MPLY | + * |------+------+------+------+------| |------+------+------+------+------| + * | | |AU OFF| AU ON| | | |NUM LK| MRWD | MFFD | | + * `----------------------------------' `----------------------------------' + * ,--------------------. ,------,-------------. + * | | | | | | | | + * `-------------| | | |------+------. + * | | | | + * `------' `------' + */ +[_SYS] = LAYOUT( \ + RESET, DEBUG, QWERTY, CMK_DHM, _______, _______, KC_VOLD, KC_VOLU, KC_BRID, KC_BRIU, \ + KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, NAV_LK, KC_POWER, VOL_DN, VOL_UP, KC__MUTE, KC_MPLY, \ + _______, _______, AU_OFF, AU_ON, _______, _______, NUMLK_E, KC_MRWD, KC_MFFD, _______, \ + _______, _______, _______, _______, _______, _______ \ +), + +/* Navigation + mouse keys + * + * ,----------------------------------. ,----------------------------------. + * | PSCR | | WH U | WH D | | | BSPC | PGDN | PGUP | HOME | END | + * |------+------+------+------+------| |------+------+------+------+------| + * | SHIFT| CTRL | ALT | GUI |NAV LK| | CAPS | LEFT | DOWN | UP | RIGHT| + * |------+------+------+------+------| |------+------+------+------+------| + * | | ACL0 | ACL1 | ACL2 | BTN2 | | BTN1 | MS L | MS D | MS U | MS R | + * `----------------------------------' `----------------------------------' + * ,--------------------. ,--------------------. + * | | | | | | ENTER| | + * `------+------| ESC | | DEL |------+------' + * | | | | + * `------' `------' + */ +[_NAV] = LAYOUT( \ + KC_PSCR, _______, KC_WH_U, KC_WH_D, _______, KC_BSPC, KC_PGDN, KC_PGUP, KC_HOME, KC_END, \ + KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, NAV_LK, KC_CAPS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, \ + _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_BTN2, KC_BTN1, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, \ + _______, _______, KC_ESC, KC_DEL, KC_ENT, _______ \ +), + +/* Number + function keys (ergonomic number order - default pairing with Colemak) + * + * ,----------------------------------. ,----------------------------------. + * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * |------+------+------+------+------| |------+------+------+------+------| + * | SFT/7| CTL/5| ALT/3| GUI/1| 9 | | 8 | GUI/0| ALT/2| CTL/4| SFT/6| + * |------+------+------+------+------| |------+------+------+------+------| + * | F11 | F12 | - | SPACE| BSPC | | DEL |NUM LK| | | / | + * `----------------------------------' `----------------------------------' + * ,--------------------. ,--------------------. + * | | TAB | | | | | | + * `------+------| ESC | | |------+------' + * | | | | + * `------' `------' + */ +[_NUM_E] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ + SFT_7, CTRL_5, ALT_3, GUI_1, KC_9, KC_8, GUI_0, ALT_2, CTRL_4, SFT_6, \ + KC_F11, KC_F12, KC_MINS, KC_SPC, KC_BSPC, KC_DEL, NUMLK_E, _______, _______, KC_SLSH, \ + _______, KC_TAB, KC_ESC, _______, _______, _______ \ +), + +/* Number + function keys (numeric number order - default pairing with QWERTY) + * + * ,----------------------------------. ,----------------------------------. + * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * |------+------+------+------+------| |------+------+------+------+------| + * | SFT/1| CTL/2| ALT/3| GUI/4| 5 | | 6 | GUI/7| ALT/8| CTL/9| SFT/0| + * |------+------+------+------+------| |------+------+------+------+------| + * | F11 | F12 | - | SPACE| BSPC | | DEL |NUM LK| | | / | + * `----------------------------------' `----------------------------------' + * ,--------------------. ,--------------------. + * | | TAB | | | | | | + * `------+------| ESC | | |------+------' + * | | | | + * `------' `------' + */ +[_NUM_N] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ + SFT_1, CTRL_2, ALT_3, GUI_4, KC_5, KC_6, GUI_7, ALT_8, CTRL_9, SFT_0, \ + KC_F11, KC_F12, KC_MINS, KC_SPC, KC_BSPC, KC_DEL, NUMLK_N, _______, _______, KC_SLSH, \ + _______, KC_TAB, KC_ESC, _______, _______, _______ \ +), + + +/* Symbols + * + * ,----------------------------------. ,----------------------------------. + * | ! | @ | # | $ | % | | ^ | & | * | ? | ' | + * |------+------+------+------+------| |------+------+------+------+------| + * | SFT/+| CTL/=| ALT/(| GUI/)| " | | : | GUI/]| ALT/[| CTL/}| SFT/{| + * |------+------+------+------+------| |------+------+------+------+------| + * | < | | | - | > | \ | | ` | _ | / | ~ | ; | + * `----------------------------------' `----------------------------------' + * ,--------------------. ,--------------------. + * | |ENDASH| | | |EMDASH| | + * `------+------| | | |------+------' + * | | | | + * `------' `------' + */ +[_SYM] = LAYOUT( \ + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_QUES, KC_QUOT, \ + TD(SFT_PLS), CTRL_EQ, TD(ALT_LP), TD(GUI_RP), KC_DQT, KC_COLN, GUI_RB, ALT_LB, TD(CTL_RCB), TD(SFT_LCB), \ + KC_LT, KC_PIPE, KC_MINS, KC_GT, KC_BSLS, KC_GRV, KC_UNDS, KC_SLSH, KC_TILD, KC_SCLN, \ + _______, MAC_EN, _______, _______, MAC_EM, _______ \ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case CMK_DHM: + if (record->event.pressed) { + set_single_persistent_default_layer(_CMK_DHM); + } + return false; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + default: + return true; + } +}; + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + if (state->count == 2) return DOUBLE_SINGLE_TAP; + else return 3; +} + +void altlp_finished (qk_tap_dance_state_t *state, void *user_data) { + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + register_code16(KC_LPRN); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_LALT)); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_LPRN); + register_code16(KC_LPRN); + } +} + +void altlp_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (td_state) { + case SINGLE_TAP: + unregister_code16(KC_LPRN); + break; + case SINGLE_HOLD: + unregister_mods(MOD_BIT(KC_LALT)); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_LPRN); + } +} + +void ctlrcb_finished (qk_tap_dance_state_t *state, void *user_data) { + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + register_code16(KC_RCBR); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_LCTL)); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_RCBR); + register_code16(KC_RCBR); + } +} + +void ctlrcb_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (td_state) { + case SINGLE_TAP: + unregister_code16(KC_RCBR); + break; + case SINGLE_HOLD: + unregister_mods(MOD_BIT(KC_LCTL)); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_RCBR); + } +} + +void guirp_finished (qk_tap_dance_state_t *state, void *user_data) { + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + register_code16(KC_RPRN); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_LGUI)); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_RPRN); + register_code16(KC_RPRN); + } +} + +void guirp_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (td_state) { + case SINGLE_TAP: + unregister_code16(KC_RPRN); + break; + case SINGLE_HOLD: + unregister_mods(MOD_BIT(KC_LGUI)); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_RPRN); + } +} + +void sftlcb_finished (qk_tap_dance_state_t *state, void *user_data) { + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + register_code16(KC_LCBR); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_LSFT)); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_LCBR); + register_code16(KC_LCBR); + } +} + +void sftlcb_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (td_state) { + case SINGLE_TAP: + unregister_code16(KC_LCBR); + break; + case SINGLE_HOLD: + unregister_mods(MOD_BIT(KC_LSFT)); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_LCBR); + } +} + +void sftpls_finished (qk_tap_dance_state_t *state, void *user_data) { + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + register_code16(KC_PLUS); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_LSFT)); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_PLUS); + register_code16(KC_PLUS); + } +} + +void sftpls_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (td_state) { + case SINGLE_TAP: + unregister_code16(KC_PLUS); + break; + case SINGLE_HOLD: + unregister_mods(MOD_BIT(KC_LSFT)); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_PLUS); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [ALT_LP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altlp_finished, altlp_reset), + [CTL_RCB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctlrcb_finished, ctlrcb_reset), + [GUI_RP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, guirp_finished, guirp_reset), + [SFT_LCB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, sftlcb_finished, sftlcb_reset), + [SFT_PLS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, sftpls_finished, sftpls_reset) +}; diff --git a/keyboards/minidox/keymaps/dustypomerleau/rules.mk b/keyboards/minidox/keymaps/dustypomerleau/rules.mk new file mode 100644 index 00000000000..2a74d95536b --- /dev/null +++ b/keyboards/minidox/keymaps/dustypomerleau/rules.mk @@ -0,0 +1,5 @@ +# dustypomerleau, Minidox rules + +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +TAP_DANCE_ENABLE = yes diff --git a/keyboards/minidox/keymaps/haegin/keymap.c b/keyboards/minidox/keymaps/haegin/keymap.c index 221427b28af..d95243f10bb 100644 --- a/keyboards/minidox/keymaps/haegin/keymap.c +++ b/keyboards/minidox/keymaps/haegin/keymap.c @@ -10,10 +10,6 @@ extern keymap_config_t keymap_config; #define SYMBOLS 1 #define MEDIA 2 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/minidox/keymaps/khitsule/keymap.c b/keyboards/minidox/keymaps/khitsule/keymap.c index 750510579cf..1c6b6749f30 100644 --- a/keyboards/minidox/keymaps/khitsule/keymap.c +++ b/keyboards/minidox/keymaps/khitsule/keymap.c @@ -18,10 +18,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/keyboards/minidox/keymaps/norman/config.h b/keyboards/minidox/keymaps/norman/config.h new file mode 100644 index 00000000000..0d3542a03e3 --- /dev/null +++ b/keyboards/minidox/keymaps/norman/config.h @@ -0,0 +1,5 @@ +#pragma once + +#define PERMISSIVE_HOLD +#define QMK_KEYS_PER_SCAN 4 +#define TAPPING_TERM 160 diff --git a/keyboards/minidox/keymaps/norman/keymap.c b/keyboards/minidox/keymaps/norman/keymap.c new file mode 100644 index 00000000000..2786b7dd930 --- /dev/null +++ b/keyboards/minidox/keymaps/norman/keymap.c @@ -0,0 +1,69 @@ +#include QMK_KEYBOARD_H + +#include + + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layers { + _NORMAN, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST +}; + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) +#define DSK_LFT LGUI(LCTL(KC_LEFT)) +#define DSK_RT LGUI(LCTL(KC_RIGHT)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +[_NORMAN] = LAYOUT( \ + NM_Q, NM_W, NM_D, NM_F, NM_K, NM_J, NM_U, NM_R, NM_L, NM_SCLN, \ + NM_A, NM_S, NM_E, NM_T, NM_G, NM_Y, NM_N, NM_I, NM_O, NM_H, \ + NM_Z, NM_X, NM_C, NM_V, NM_B, NM_P, NM_M, NM_COMM, NM_DOT, NM_SLSH, \ + LGUI_T(KC_ENT), LT(_RAISE, KC_ESC), SFT_T(KC_BSPC), CTL_T(KC_SPC), LT(_LOWER, KC_TAB), ALT_T(KC_ENT) \ +), + +[_RAISE] = LAYOUT( \ + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_PLUS, KC_7, KC_8, KC_9, KC_0, \ + KC_CIRC, KC_AMPR, KC_TILD, KC_PIPE, KC_BSLS, KC_MINUS, KC_4, KC_5, KC_6, KC_EQL, \ + KC_DQT, KC_QUOT, KC_UNDS, KC_GRV, _______, KC_ASTR, KC_1, KC_2, KC_3, _______, \ + _______, _______, _______, _______, MO(_ADJUST), _______ \ +), + + +[_LOWER] = LAYOUT( \ + KC_ESC, KC_HOME, KC_UP, KC_END, _______, _______, KC_LPRN, KC_RPRN, _______, _______, + KC_VOLU, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGUP, _______, KC_LBRC, KC_RBRC, _______, _______, \ + KC_VOLD, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGDN, _______, KC_LCBR, KC_RCBR, _______, _______, \ + _______, MO(_ADJUST), _______, _______, _______, _______ \ +), + +[_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ + _______, DSK_LFT, _______, DSK_RT, _______, TSKMGR, CALTDEL, _______, KC_F11, KC_F12, \ + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______ \ +) + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} diff --git a/keyboards/minidox/keymaps/norman/readme.md b/keyboards/minidox/keymaps/norman/readme.md new file mode 100644 index 00000000000..018e4363227 --- /dev/null +++ b/keyboards/minidox/keymaps/norman/readme.md @@ -0,0 +1,56 @@ +# Minidox Norman Layout by LeHoff +Based on the QWERTY layout created by Khitsule. +![lehoff](https://i.imgur.com/rKTdymp.png) + +[KLE link](http://www.keyboard-layout-editor.com/#/gists/86ec49f9f820a8b9b36f6e0d2ef8fff7) + +## Layers +| Layer | Legend | +| ----- | ------ | +| Base | Top left (black) | +| Lower | Bottom right (red) | +| Raise | Top right (orange) | +| Adjust | Front print | + +## Features +* Raise/lower layers focus first on one-handed use +* Numpad on right hand with raise layer +* Navigation on left hand with lower layer (ESDF) + * D refers to desktop left/right on Win 10 (win+ctrl+left/right) +* Heavy use of hold/tap dual function keys - from left to right: + * Cmd/Enter + * Raise/Esc + * Shift/Backspace + * Ctrl/Space + * Lower/Tab + * Alt/Enter + + +## Modifier Placement Rationale + +There are several major driving forces at play: + +* I use MacOS. +* I'm Danish so the Alt and Shift-Alt layers in MacOS simply have to work. +* I use Vim for coding. +* I use org-mode in Emacs to keep track of my time. + +* Space is on the right hand side because I almost exclusively use my right hand thumb for + space. +* Cmd is on the left since I often use Cmd+click to open a link in a new tab in Safari. +* Due to my usage of Vim Esc got a spot on the modifier row. +* Tab is on the right to enable easy navigation between winows with Cmd+Tab. +* Shift is on the left since org-mode uses Ctrl+arrows to manipulate task state quickly, + and since the arrow keys are activated using Lower (which has been moved to the right) and S, E, T, + and D, it works well that way. +* Ctrl is on the right since Ctrl+<0-9> is used in MacOS to switch between spaces. +* Enter is on both sides since Enter is often used together with all of the modifiers. E.g., + Cmd+Enter to send mails in most situations, but Ctrl+Enter is used in Emacs to create a + new task in org-mode. + +This means that arrows and digits are being modified from the other hand, which could be +bad for gaming, so if you're into that you might want to re-think a few things, but in +that case you are probably using a Windows machine and then there are other constraints +you have to deal with. + + diff --git a/keyboards/minidox/keymaps/that_canadian/keymap.c b/keyboards/minidox/keymaps/that_canadian/keymap.c index 9d81283b675..78ddca30e80 100644 --- a/keyboards/minidox/keymaps/that_canadian/keymap.c +++ b/keyboards/minidox/keymaps/that_canadian/keymap.c @@ -18,10 +18,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/keyboards/minidox/keymaps/that_canadian/rules.mk b/keyboards/minidox/keymaps/that_canadian/rules.mk index 7637dfc09a9..f1ef68387f4 100644 --- a/keyboards/minidox/keymaps/that_canadian/rules.mk +++ b/keyboards/minidox/keymaps/that_canadian/rules.mk @@ -1,5 +1,2 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/minidox/keymaps/tw1t611/keymap.c b/keyboards/minidox/keymaps/tw1t611/keymap.c new file mode 100644 index 00000000000..e94625516e9 --- /dev/null +++ b/keyboards/minidox/keymaps/tw1t611/keymap.c @@ -0,0 +1,59 @@ +#include QMK_KEYBOARD_H +#include "keymap_german.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTZ 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +// macro keys +#define CALTDEL LCTL(LALT(KC_DEL)) // ctrl-alt-del +#define CALTESC LCTL(LSFT(KC_ESC)) // ctrl-alt-esc +#define CALT LCTL(KC_LALT) // ctrl-alt + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTZ] = LAYOUT( \ + DE_Q, DE_W, DE_E, DE_R, DE_T, DE_Z, DE_U, DE_I, DE_O, DE_P, \ + DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, KC_SPC, \ + DE_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, DE_COMM, DE_DOT, DE_MINS, \ + KC_LCTRL, MO(_LOWER), MO(_RAISE), KC_LGUI, KC_LSFT, KC_LALT \ +), + +[_RAISE] = LAYOUT( \ + DE_EXLM, DE_QST, DE_PARA, DE_DLR, DE_HASH, DE_PLUS, DE_7, DE_8, DE_9, DE_0, \ + DE_CIRC, DE_QUOT, DE_DQOT, DE_GRV, DE_AMPR, DE_ASTR, DE_4, DE_5, DE_6, DE_EQL, \ + DE_SLSH, DE_PIPE, DE_BSLS, DE_AT, DE_EURO, DE_PERC, DE_1, DE_2, DE_3, KC_TAB, \ + _______, _______, _______, _______, _______, _______ \ +), + +[_LOWER] = LAYOUT( \ + KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, DE_LBRC, DE_RBRC, KC_AUDIO_VOL_UP, KC_HOME, KC_PGDOWN, KC_PGUP, KC_END, DE_TILD, \ + KC_ESC, DE_LESS, DE_LPRN, DE_RPRN, DE_MORE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_ENT, \ + KC_BSPC, KC_DEL, DE_LCBR, DE_RCBR, KC_PSCR, _______, DE_AE, DE_OE, DE_UE, DE_SS, \ + _______, _______, _______, _______, MO(_ADJUST), _______ \ +), + +[_ADJUST] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, \ + CALTESC, CALTDEL, _______, CALT, _______, _______, KC_F4, KC_F5, KC_F6, KC_F11, \ + RESET, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F12, \ + _______, _______, _______, _______, _______, _______ \ +)}; + +void matrix_init_user(void) { + set_single_persistent_default_layer(_QWERTZ); +}; diff --git a/keyboards/minidox/keymaps/tw1t611/readme.md b/keyboards/minidox/keymaps/tw1t611/readme.md new file mode 100644 index 00000000000..7ab4526fbc4 --- /dev/null +++ b/keyboards/minidox/keymaps/tw1t611/readme.md @@ -0,0 +1,23 @@ +# Minidox Layout by tw1t611 +![](https://imgur.com/M95KSke.png) + +This is a german layout with support for umlauts and the euro sign. +You need to set your system layout to german. + +[keyboard-layout-editor.com](http://www.keyboard-layout-editor.com/#/gists/d58a82d8017d0c0cca044ef385def165) + +## Layers +| Layer | Legend | +| ----- | ------ | +| Base | Top left (white) | +| Lower | Top right (organge) | +| Raise | Bottom right (blue) | +| Adjust | Front print (orange + shift) | + +## Features +* German layout with support for umlauts and the euro sign +* Raise/lower layers focus first on one-handed use +* Numpad on right hand with raise layer +* Vim optimized + * Easy reachable Esc + * arrow keys on h, j, k, l diff --git a/keyboards/minidox/keymaps/tw1t611/rules.mk b/keyboards/minidox/keymaps/tw1t611/rules.mk new file mode 100644 index 00000000000..fcfd2225bcf --- /dev/null +++ b/keyboards/minidox/keymaps/tw1t611/rules.mk @@ -0,0 +1 @@ +EXTRAKEY_ENABLE = yes diff --git a/keyboards/minidox/keymaps/xyverz/keymap.c b/keyboards/minidox/keymaps/xyverz/keymap.c index 3e62815655c..4863f4f922b 100644 --- a/keyboards/minidox/keymaps/xyverz/keymap.c +++ b/keyboards/minidox/keymaps/xyverz/keymap.c @@ -39,10 +39,6 @@ enum planck_keycodes { #define ALTCOMM ALT_T(KC_COMM) //#define GUIBSPC GUI_T(KC_BSPC) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Dvorak diff --git a/keyboards/minidox/readme.md b/keyboards/minidox/readme.md index 859504a43dd..74afedc18b6 100644 --- a/keyboards/minidox/readme.md +++ b/keyboards/minidox/readme.md @@ -12,7 +12,7 @@ Make example for this keyboard (after setting up your build environment): make minidox/rev1:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Build Guide @@ -54,13 +54,13 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep" // or the equivalent in dfu-programmer ``` and similarly for right half ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-righthand.eep" // or the equivalent in dfu-programmer ``` diff --git a/keyboards/minidox/rules.mk b/keyboards/minidox/rules.mk index 861976e15bd..bcd74bcde28 100644 --- a/keyboards/minidox/rules.mk +++ b/keyboards/minidox/rules.mk @@ -4,7 +4,6 @@ SRC += matrix.c \ serial.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -70,4 +69,4 @@ SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend CUSTOM_MATRIX = yes -DEFAULT_FOLDER = minidox/rev1 \ No newline at end of file +DEFAULT_FOLDER = minidox/rev1 diff --git a/keyboards/mint60/config.h b/keyboards/mint60/config.h index a762c5ffea8..c98b9c1af8a 100644 --- a/keyboards/mint60/config.h +++ b/keyboards/mint60/config.h @@ -20,7 +20,6 @@ along with this program. If not, see . #include "config_common.h" #include - /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0000 @@ -32,6 +31,8 @@ along with this program. If not, see . #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 +#define USE_SERIAL + /* key matrix size */ #define MATRIX_ROWS 10 #define MATRIX_COLS 8 @@ -50,16 +51,15 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D4, B3, B1, F7, B2, B6, F6, F5 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -109,11 +109,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -160,8 +155,6 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS - - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/mint60/keymaps/default/config.h b/keyboards/mint60/keymaps/default/config.h index 0195c61dffb..9af2f45cfb4 100644 --- a/keyboards/mint60/keymaps/default/config.h +++ b/keyboards/mint60/keymaps/default/config.h @@ -17,7 +17,7 @@ #pragma once /* Use I2C or Serial, not both */ -#define USE_SERIAL +// #define USE_SERIAL // #define USE_I2C // #define MASTER_RIGHT diff --git a/keyboards/mint60/keymaps/default/keymap.c b/keyboards/mint60/keymaps/default/keymap.c index 36895cb4741..fde64d8defa 100644 --- a/keyboards/mint60/keymaps/default/keymap.c +++ b/keyboards/mint60/keymaps/default/keymap.c @@ -26,10 +26,6 @@ extern keymap_config_t keymap_config; extern rgblight_config_t rgblight_config; #endif -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum custom_keycodes { RGBRST = SAFE_RANGE }; @@ -52,30 +48,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // define variables for reactive RGB bool TOG_STATUS = false; int RGB_current_mode; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case RGBRST: diff --git a/keyboards/mint60/keymaps/eucalyn/config.h b/keyboards/mint60/keymaps/eucalyn/config.h index 0195c61dffb..9af2f45cfb4 100644 --- a/keyboards/mint60/keymaps/eucalyn/config.h +++ b/keyboards/mint60/keymaps/eucalyn/config.h @@ -17,7 +17,7 @@ #pragma once /* Use I2C or Serial, not both */ -#define USE_SERIAL +// #define USE_SERIAL // #define USE_I2C // #define MASTER_RIGHT diff --git a/keyboards/mint60/keymaps/eucalyn/keymap.c b/keyboards/mint60/keymaps/eucalyn/keymap.c index 566d734a523..93979a13124 100644 --- a/keyboards/mint60/keymaps/eucalyn/keymap.c +++ b/keyboards/mint60/keymaps/eucalyn/keymap.c @@ -26,10 +26,6 @@ extern keymap_config_t keymap_config; extern rgblight_config_t rgblight_config; #endif -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum custom_keycodes { RGBRST = SAFE_RANGE }; @@ -52,10 +48,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - // define variables for reactive RGB bool TOG_STATUS = false; int RGB_current_mode; diff --git a/keyboards/mint60/rules.mk b/keyboards/mint60/rules.mk index b4472153bc8..21efa65cf4d 100644 --- a/keyboards/mint60/rules.mk +++ b/keyboards/mint60/rules.mk @@ -4,7 +4,6 @@ SRC += i2c.c \ split_util.c \ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/mitosis/config.h b/keyboards/mitosis/config.h index 5cfd2e4b122..f2220278eca 100644 --- a/keyboards/mitosis/config.h +++ b/keyboards/mitosis/config.h @@ -41,12 +41,6 @@ along with this program. If not, see . #define ONESHOT_TIMEOUT 500 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/mitosis/keymaps/carvac_dv/keymap.c b/keyboards/mitosis/keymaps/carvac_dv/keymap.c index d97cb600eea..c67f2e387cb 100644 --- a/keyboards/mitosis/keymaps/carvac_dv/keymap.c +++ b/keyboards/mitosis/keymaps/carvac_dv/keymap.c @@ -21,10 +21,6 @@ enum mitosis_layers #define MOUSEKEY_WHEEL_MAX_SPEED 8 #define MOUSEKEY_WHEEL_TIME_TO_MAX 40 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY diff --git a/keyboards/mitosis/keymaps/datagrok/config.h b/keyboards/mitosis/keymaps/datagrok/config.h index 1c70a3791a5..0e82b628b4d 100644 --- a/keyboards/mitosis/keymaps/datagrok/config.h +++ b/keyboards/mitosis/keymaps/datagrok/config.h @@ -27,13 +27,13 @@ //#define NO_ACTION_FUNCTION #ifdef AUDIO_ENABLE -#define STARTUP_SONG SONG(MARIO_MUSHROOM) -#define DEFAULT_LAYER_SONGS { \ - SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND), \ - SONG(ZELDA_TREASURE), \ - } +#define STARTUP_SONG SONG(STARTUP_SOUND) +#define DEFAULT_LAYER_SONGS { \ + SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND), \ + SONG(WORKMAN_SOUND), \ + } #define AUDIO_VOICES #define AUDIO_CLICKY #define C6_AUDIO diff --git a/keyboards/mitosis/keymaps/datagrok/keymap.c b/keyboards/mitosis/keymaps/datagrok/keymap.c index d8c20bc4391..220c140af07 100644 --- a/keyboards/mitosis/keymaps/datagrok/keymap.c +++ b/keyboards/mitosis/keymaps/datagrok/keymap.c @@ -30,9 +30,6 @@ enum mitosis_keycodes #define LAYOUT LAYOUT_bottomspace #endif -// Fillers to make layering more clear -#define _______ KC_TRNS // Transparent - // I don't use Japanese myself, but I've placed henkan 変換 and muhenkan 無変換 // in my layout to act as left and right HYPER diff --git a/keyboards/mitosis/keymaps/default/keymap.c b/keyboards/mitosis/keymaps/default/keymap.c index 99f57c55fd6..6132ad6f78d 100644 --- a/keyboards/mitosis/keymaps/default/keymap.c +++ b/keyboards/mitosis/keymaps/default/keymap.c @@ -18,33 +18,23 @@ enum mitosis_layers enum mitosis_keycodes { FNKEY = SAFE_RANGE, - SHIFT -}; - - -// Macro definitions for readability -enum mitosis_macros -{ - VOLU, - VOLD, - ESCM + SHIFT, + M_VOLU, + M_VOLD, + M_ESCM }; #define LONGPRESS_DELAY 150 #define LAYER_TOGGLE_DELAY 300 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MALT] = LAYOUT( /* Malt Layout, customised for reduced columns (ex: quote and shift locations) */ KC_Q, KC_P, KC_Y, KC_C, KC_B, KC_V, KC_M, KC_U, KC_Z, KC_L, KC_A, KC_N, KC_I, KC_S, KC_F, KC_D, KC_T, KC_H, KC_O, KC_R, KC_COMM, KC_DOT, KC_J, KC_G, KC_SLSH, KC_SCLN, KC_W, KC_K, KC_QUOT, KC_X, - M(VOLU), M(ESCM), KC_TAB, KC_LCTL, KC_LALT, KC_ENT, KC_DEL, KC_PGUP, - M(VOLD), KC_LGUI, KC_E, FNKEY, SHIFT, KC_SPC, KC_BSPC, KC_PGDN + M_VOLU, M_ESCM, KC_TAB, KC_LCTL, KC_LALT, KC_ENT, KC_DEL, KC_PGUP, + M_VOLD, KC_LGUI, KC_E, FNKEY, SHIFT, KC_SPC, KC_BSPC, KC_PGDN ), @@ -80,62 +70,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - static uint16_t key_timer; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - - //switch multiplexing for media, short tap for volume up, long press for play/pause - case VOLU: - if (record->event.pressed) { - key_timer = timer_read(); // if the key is being pressed, we start the timer. - } else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down"). - if (timer_elapsed(key_timer) > LONGPRESS_DELAY) { // LONGPRESS_DELAY being 150ms, the threshhold we pick for counting something as a tap. - return MACRO(T(MPLY), END); - } else { - return MACRO(T(VOLU), END); - } - } - break; - - //switch multiplexing for media, short tap for volume down, long press for next track - case VOLD: - if (record->event.pressed) { - key_timer = timer_read(); - } else { - if (timer_elapsed(key_timer) > LONGPRESS_DELAY) { - return MACRO(T(MNXT), END); - } else { - return MACRO(T(VOLD), END); - } - } - break; - - //switch multiplexing for escape, short tap for escape, long press for context menu - case ESCM: - if (record->event.pressed) { - key_timer = timer_read(); - } else { - if (timer_elapsed(key_timer) > LONGPRESS_DELAY) { - return MACRO(T(APP), END); - } else { - return MACRO(T(ESC), END); - } - } - break; - - break; - } - return MACRO_NONE; -}; - static bool singular_key = false; bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -174,6 +110,44 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { update_tri_layer(_FUNCTION, _SHIFTED, _FUNCSHIFT); return false; break; + //switch multiplexing for media, short tap for volume up, long press for play/pause + case M_VOLU: + if (record->event.pressed) { + key_timer = timer_read(); // if the key is being pressed, we start the timer. + } else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down"). + if (timer_elapsed(key_timer) > LONGPRESS_DELAY) { // LONGPRESS_DELAY being 150ms, the threshhold we pick for counting something as a tap. + tap_code(KC_MPLY); + } else { + tap_code(KC_VOLU); + } + } + return false; + + //switch multiplexing for media, short tap for volume down, long press for next track + case M_VOLD: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) > LONGPRESS_DELAY) { + tap_code(KC_MNXT); + } else { + tap_code(KC_VOLD); + } + } + return false; + + //switch multiplexing for escape, short tap for escape, long press for context menu + case M_ESCM: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) > LONGPRESS_DELAY) { + tap_code(KC_APP); + } else { + tap_code(KC_ESC); + } + } + return false; //If any other key was pressed during the layer mod hold period, //then the layer mod was used momentarily, and should block latching diff --git a/keyboards/mitosis/keymaps/mjt/keymap.c b/keyboards/mitosis/keymaps/mjt/keymap.c index 260fa133f0c..f00bf59556b 100644 --- a/keyboards/mitosis/keymaps/mjt/keymap.c +++ b/keyboards/mitosis/keymaps/mjt/keymap.c @@ -47,9 +47,7 @@ enum mitosis_macros #define LAYER_TOGGLE_DELAY 900 // Fillers to make layering more clear -#define _______ KC_TRNS #define __MOD__ KC_TRNS -#define XXXXXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( /* QWERTY adapted to this crazy thing */ @@ -119,9 +117,6 @@ float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float tone_goodbye[][2] = SONG(GOODBYE_SOUND); #endif -const uint16_t PROGMEM fn_actions[] = { - -}; static uint16_t function_layer = _FUNCTIONMAC; static uint16_t key_timer; diff --git a/keyboards/mitosis/keymaps/mjt/rules.mk b/keyboards/mitosis/keymaps/mjt/rules.mk index a4137ad00e6..0259657677b 100644 --- a/keyboards/mitosis/keymaps/mjt/rules.mk +++ b/keyboards/mitosis/keymaps/mjt/rules.mk @@ -12,6 +12,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = no -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/mitosis/keymaps/nzen/keymap.c b/keyboards/mitosis/keymaps/nzen/keymap.c index 7a276cade44..d9fd3641bc6 100644 --- a/keyboards/mitosis/keymaps/nzen/keymap.c +++ b/keyboards/mitosis/keymaps/nzen/keymap.c @@ -25,7 +25,6 @@ enum mitosis_layers #define MOUSEKEY_WHEEL_TIME_TO_MAX 40 // Fillers to make layering more clear -#define _______ KC_TRNS #define XXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/mitosis/matrix.c b/keyboards/mitosis/matrix.c index 4b87242b916..e149b68bd7d 100644 --- a/keyboards/mitosis/matrix.c +++ b/keyboards/mitosis/matrix.c @@ -103,7 +103,7 @@ uint8_t matrix_scan(void) if (timeout > 10000){ break; } - } + } uart_data[i] = SERIAL_UART_DATA; } @@ -125,7 +125,7 @@ uint8_t matrix_scan(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1. // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -159,9 +153,8 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - #define RGB_DI_PIN D0 // The pin your RGB strip is wired to -#define RGBLED_NUM 7 // Number of LEDs +#define RGBLED_NUM 17 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/miuni32/keymaps/adam-lee/keymap.c b/keyboards/miuni32/keymaps/adam-lee/keymap.c index e128b24b1d6..754c20f7d33 100644 --- a/keyboards/miuni32/keymaps/adam-lee/keymap.c +++ b/keyboards/miuni32/keymaps/adam-lee/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Level 0: Default Layer * ,---------------------------------------------------------------------------------------. diff --git a/keyboards/miuni32/keymaps/adam-lee/rules.mk b/keyboards/miuni32/keymaps/adam-lee/rules.mk index 3138ab57f73..3a741d20a7c 100644 --- a/keyboards/miuni32/keymaps/adam-lee/rules.mk +++ b/keyboards/miuni32/keymaps/adam-lee/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/miuni32/keymaps/default/config.h b/keyboards/miuni32/keymaps/default/config.h index df06a262062..271f48d0011 100644 --- a/keyboards/miuni32/keymaps/default/config.h +++ b/keyboards/miuni32/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/miuni32/keymaps/default/keymap.c b/keyboards/miuni32/keymaps/default/keymap.c index e128b24b1d6..ae58f80a24b 100644 --- a/keyboards/miuni32/keymaps/default/keymap.c +++ b/keyboards/miuni32/keymaps/default/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Level 0: Default Layer * ,---------------------------------------------------------------------------------------. @@ -62,21 +59,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - void matrix_init_user(void) { } diff --git a/keyboards/miuni32/keymaps/default/rules.mk b/keyboards/miuni32/keymaps/default/rules.mk index 3138ab57f73..3a741d20a7c 100644 --- a/keyboards/miuni32/keymaps/default/rules.mk +++ b/keyboards/miuni32/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/miuni32/keymaps/ht_156/keymap.c b/keyboards/miuni32/keymaps/ht_156/keymap.c index d68edad8597..54e4bcf52d6 100644 --- a/keyboards/miuni32/keymaps/ht_156/keymap.c +++ b/keyboards/miuni32/keymaps/ht_156/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Keyboard layer definitions #define BASE 0 #define NUMBERS 1 diff --git a/keyboards/miuni32/keymaps/ht_156/rules.mk b/keyboards/miuni32/keymaps/ht_156/rules.mk index 3138ab57f73..3a741d20a7c 100644 --- a/keyboards/miuni32/keymaps/ht_156/rules.mk +++ b/keyboards/miuni32/keymaps/ht_156/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/miuni32/keymaps/ki/keymap.c b/keyboards/miuni32/keymaps/ki/keymap.c index 77140d6a9a0..59d2e285cbc 100644 --- a/keyboards/miuni32/keymaps/ki/keymap.c +++ b/keyboards/miuni32/keymaps/ki/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum miuni32_layers { _BEAKL, _LOWER, diff --git a/keyboards/miuni32/keymaps/ki/rules.mk b/keyboards/miuni32/keymaps/ki/rules.mk index 7639c2b3f14..15d3cfff2ca 100644 --- a/keyboards/miuni32/keymaps/ki/rules.mk +++ b/keyboards/miuni32/keymaps/ki/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/miuni32/readme.md b/keyboards/miuni32/readme.md index 050ec8ecd76..359424151d2 100644 --- a/keyboards/miuni32/readme.md +++ b/keyboards/miuni32/readme.md @@ -5,10 +5,10 @@ A compact 30% keyboard. Keyboard Maintainer: QMK Community Hardware Supported: miuni32 PCB -Hardware Availability: https://zealpc.net/products/miuni32 +Hardware Availability: https://bigtuna.io Make example for this keyboard (after setting up your build environment): make miuni32-default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/miuni32/rules.mk b/keyboards/miuni32/rules.mk index 1092e50d8cf..91cb2221ecf 100644 --- a/keyboards/miuni32/rules.mk +++ b/keyboards/miuni32/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/model01/config.h b/keyboards/model01/config.h index 167310731f8..c2160979cdd 100644 --- a/keyboards/model01/config.h +++ b/keyboards/model01/config.h @@ -32,7 +32,7 @@ along with this program. If not, see . #define MATRIX_COLS 8 /* The scanners already debounce for us */ -#define DEBOUNCING_DELAY 0 +#define DEBOUNCE 0 /* RGB matrix constants */ #define DRIVER_LED_TOTAL 64 diff --git a/keyboards/model01/info.json b/keyboards/model01/info.json index daf51492dbe..60c914d5c04 100644 --- a/keyboards/model01/info.json +++ b/keyboards/model01/info.json @@ -1,4 +1,87 @@ { "keyboard_name": "model01", - "url": "https://keyboard.io" + "keyboard_folder": "model01", + "url": "https://keyboard.io", + "maintainer": "qmk", + "width": 18.5, + "height": 7.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"PROG", "x":0, "y":0.4, "h":1.3}, + {"label":"1", "x":1, "y":0.2, "h":1.5}, + {"label":"2", "x":2, "y":0.1, "h":1.1}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0.1}, + {"label":"5", "x":5, "y":0.3}, + + {"label":"6", "x":12.5, "y":0.3}, + {"label":"7", "x":13.5, "y":0.1}, + {"label":"8", "x":14.5, "y":0}, + {"label":"9", "x":15.5, "y":0.1, "h":1.1}, + {"label":"0", "x":16.5, "y":0.2, "h":1.5}, + {"label":"NUM", "x":17.5, "y":0.4, "h":1.3}, + + {"label":"GRAVE", "x":0, "y":1.7}, + {"label":"Q", "x":1, "y":1.7}, + {"label":"W", "x":2, "y":1.2}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1.1}, + {"label":"T", "x":5, "y":1.3}, + {"label":"LED", "x":6, "y":0.6, "h":1.5}, + + {"label":"ANY", "x":11.5, "y":0.6, "h":1.5}, + {"label":"Y", "x":12.5, "y":1.3}, + {"label":"U", "x":13.5, "y":1.1}, + {"label":"I", "x":14.5, "y":1}, + {"label":"O", "x":15.5, "y":1.2}, + {"label":"P", "x":16.5, "y":1.7}, + {"label":"EQUAL", "x":17.5, "y":1.7}, + + {"label":"PAGEUP", "x":0, "y":2.7}, + {"label":"A", "x":1, "y":2.7}, + {"label":"S", "x":2, "y":2.2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2.1}, + {"label":"G", "x":5, "y":2.3}, + {"label":"TAB", "x":6, "y":2.1, "h":1.3}, + + {"label":"ENTER", "x":11.5, "y":2.1, "h":1.3}, + {"label":"H", "x":12.5, "y":2.3}, + {"label":"J", "x":13.5, "y":2.1}, + {"label":"K", "x":14.5, "y":2}, + {"label":"L", "x":15.5, "y":2.2}, + {"label":"SEMICOLON", "x":16.5, "y":2.7}, + {"label":"QUOTE", "x":17.5, "y":2.7}, + + {"label":"PAGEDOWN", "x":0, "y":3.7, "h":1.2}, + {"label":"Z", "x":1, "y":3.7}, + {"label":"X", "x":2, "y":3.2, "h":1.15}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3.1}, + {"label":"B", "x":5, "y":3.3}, + {"label":"ESC", "x":6, "y":3.4, "h":1.1}, + + {"label":"BUTTERFLY", "x":11.5, "y":3.4, "h":1.1}, + {"label":"N", "x":12.5, "y":3.3}, + {"label":"M", "x":13.5, "y":3.1}, + {"label":"COMMA", "x":14.5, "y":3}, + {"label":"DOT", "x":15.5, "y":3.2, "h":1.15}, + {"label":"SLASH", "x":16.5, "y":3.7}, + {"label":"MINS", "x":17.5, "y":3.7, "h":1.2}, + + {"label":"LCTL", "x":4.75, "y":4.3}, + {"label":"RCTL", "x":12.75, "y":4.3}, + {"label":"BACKSPACE", "x":5.75, "y":4.5}, + {"label":"SPACE", "x":11.75, "y":4.5}, + {"label":"LGUI", "x":6.75, "y":4.7}, + {"label":"RALT", "x":10.75, "y":4.7}, + {"label":"LSHIFT", "x":7.75, "y":5.1}, + {"label":"RSHIFT", "x":9.75, "y":5.1}, + + {"label":"FN", "x":6.25, "y":6.1, "h":1.4}, + {"label":"FN", "x":11.25, "y":6.1, "h":1.4} + ] + } + } } diff --git a/keyboards/model01/keymaps/tw1t611/config.h b/keyboards/model01/keymaps/tw1t611/config.h new file mode 100644 index 00000000000..8ab9d8b025a --- /dev/null +++ b/keyboards/model01/keymaps/tw1t611/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 James Laird-Wah + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* place overrides here */ diff --git a/keyboards/model01/keymaps/tw1t611/keymap.c b/keyboards/model01/keymaps/tw1t611/keymap.c new file mode 100644 index 00000000000..b4bd53e3fe2 --- /dev/null +++ b/keyboards/model01/keymaps/tw1t611/keymap.c @@ -0,0 +1,50 @@ +#include QMK_KEYBOARD_H +#include "keymap_german.h" + +/* layer constants */ +enum { + DEF = 0, + MOD, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[DEF] = LAYOUT( + _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , DE_SS , + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , RGB_MOD, KC_MUTE, KC_Y , KC_U , KC_I , KC_O , KC_P , DE_AE , + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , DE_PARA, _______, KC_H , KC_J , KC_K , KC_L , DE_SLSH, DE_OE , + DE_PIPE, KC_Z , KC_X , KC_C , KC_V , KC_B , _______, _______, KC_N , KC_M , DE_COMM, DE_DOT , DE_MINS, DE_UE , + KC_LALT, KC_LGUI, + KC_SPC , KC_ENT , + KC_LSFT, MO(MOD), + KC_BSPC, KC_DEL , + KC_LCTL, KC_RCTL + ), +[MOD] = LAYOUT( + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , + DE_CIRC, DE_QUOT, DE_DQOT, DE_LCBR, DE_RCBR, DE_GRV , RGB_TOG, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END , DE_EQL , DE_PERC, + DE_TILD, DE_EXLM, DE_DLR , DE_LPRN, DE_RPRN, DE_AMPR, _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, DE_QST , DE_ASTR, + DE_BSLS, DE_HASH, DE_LESS, DE_LBRC, DE_RBRC, DE_MORE, _______, RESET , DE_AT , DE_EURO, DE_SCLN, DE_COLN, DE_UNDS, DE_PLUS, + _______, _______, + _______, _______, + _______, _______, + _______, _______, + _______, _______ + ) +}; + +/* template for new layouts: +LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, + _______, _______, + _______, _______ + ) +*/ + +/* vim: set ts=2 sw=2 et: */ diff --git a/keyboards/model01/keymaps/tw1t611/readme.md b/keyboards/model01/keymaps/tw1t611/readme.md new file mode 100644 index 00000000000..b9d728831ce --- /dev/null +++ b/keyboards/model01/keymaps/tw1t611/readme.md @@ -0,0 +1,5 @@ +# Keymap for Keyboardio's Model01 by tw1t611 + +Features: +- german keymap +- vim optimized diff --git a/keyboards/model01/leds.c b/keyboards/model01/leds.c index 7a62c7424c6..b21c1a5c8a2 100644 --- a/keyboards/model01/leds.c +++ b/keyboards/model01/leds.c @@ -46,72 +46,35 @@ void set_led_to(int led, uint8_t r, uint8_t g, uint8_t b) { #ifdef RGB_MATRIX_ENABLE __attribute__ ((weak)) -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0x73}, { 3, 35}, 0}, - {{0x72}, { 0, 26}, 0}, - {{0x71}, { 0, 17}, 0}, - {{0x70}, { 0, 6}, 0}, - {{0x60}, { 14, 5}, 0}, - {{0x61}, { 15, 16}, 0}, - {{0x62}, { 16, 25}, 0}, - {{0x63}, { 17, 34}, 0}, - {{0x53}, { 31, 29}, 0}, - {{0x52}, { 31, 19}, 0}, - {{0x51}, { 30, 11}, 0}, - {{0x50}, { 30, 1}, 0}, - {{0x40}, { 45, 0}, 0}, - {{0x41}, { 45, 8}, 0}, - {{0x42}, { 46, 17}, 0}, - {{0x43}, { 46, 27}, 0}, - {{0x33}, { 60, 27}, 0}, - {{0x32}, { 60, 18}, 0}, - {{0x31}, { 60, 9}, 0}, - {{0x30}, { 60, 0}, 0}, - {{0x20}, { 74, 2}, 0}, - {{0x21}, { 74, 11}, 0}, - {{0x22}, { 75, 20}, 0}, - {{0x23}, { 74, 28}, 0}, - {{0x12}, { 89, 30}, 0}, - {{0x11}, { 89, 19}, 0}, - {{0x10}, { 89, 7}, 0}, - {{0x00}, { 70, 38}, 1}, - {{0x01}, { 82, 41}, 1}, - {{0x02}, { 93, 45}, 1}, - {{0x03}, {104, 50}, 1}, - {{0x13}, { 74, 64}, 1}, - {{0x67}, {149, 64}, 1}, - {{0x77}, {119, 50}, 1}, - {{0x76}, {130, 45}, 1}, - {{0x75}, {141, 41}, 1}, - {{0x74}, {153, 38}, 1}, - {{0x64}, {134, 7}, 0}, - {{0x65}, {134, 19}, 0}, - {{0x66}, {134, 30}, 0}, - {{0x57}, {149, 28}, 0}, - {{0x56}, {148, 20}, 0}, - {{0x55}, {149, 11}, 0}, - {{0x54}, {149, 2}, 0}, - {{0x44}, {163, 0}, 0}, - {{0x45}, {163, 9}, 0}, - {{0x46}, {163, 18}, 0}, - {{0x47}, {163, 27}, 0}, - {{0x37}, {177, 27}, 0}, - {{0x36}, {177, 17}, 0}, - {{0x35}, {178, 8}, 0}, - {{0x34}, {178, 0}, 0}, - {{0x24}, {193, 1}, 0}, - {{0x25}, {193, 11}, 0}, - {{0x26}, {192, 19}, 0}, - {{0x27}, {192, 29}, 0}, - {{0x17}, {206, 34}, 0}, - {{0x16}, {207, 25}, 0}, - {{0x15}, {208, 16}, 0}, - {{0x14}, {209, 5}, 0}, - {{0x04}, {224, 6}, 0}, - {{0x05}, {223, 17}, 0}, - {{0x06}, {223, 26}, 0}, - {{0x07}, {220, 35}, 0}, -}; +led_config_t g_led_config = { { + { 27, 26, 20, 19, 12, 11, 4, 3 }, + { 28, 25, 21, 18, 13, 10, 5, 2 }, + { 29, 24, 22, 17, 14, 9, 6, 1 }, + { 30, 31, 23, 16, 15, 8, 7, 0 }, + { 60, 59, 52, 51, 44, 43, 37, 36 }, + { 61, 58, 53, 50, 45, 42, 38, 35 }, + { 62, 57, 54, 49, 46, 41, 39, 34 }, + { 63, 56, 55, 48, 47, 40, 32, 33 } +}, { + { 3, 35 }, { 0, 26 }, { 0, 17 }, { 0, 6 }, { 14, 5 }, { 15, 16 }, { 16, 25 }, { 17, 34 }, + { 31, 29 }, { 31, 19 }, { 30, 11 }, { 30, 1 }, { 45, 0 }, { 45, 8 }, { 46, 17 }, { 46, 27 }, + { 60, 27 }, { 60, 18 }, { 60, 9 }, { 60, 0 }, { 74, 2 }, { 74, 11 }, { 75, 20 }, { 74, 28 }, + { 89, 30 }, { 89, 19 }, { 89, 7 }, { 70, 38 }, { 82, 41 }, { 93, 45 }, { 104, 50 }, { 74, 64 }, + { 149, 64 }, { 119, 50 }, { 130, 45 }, { 141, 41 }, { 153, 38 }, { 134, 7 }, { 134, 19 }, { 134, 30 }, + { 149, 28 }, { 148, 20 }, { 149, 11 }, { 149, 2 }, { 163, 0 }, { 163, 9 }, { 163, 18 }, { 163, 27 }, + { 177, 27 }, { 177, 17 }, { 178, 8 }, { 178, 0 }, { 193, 1 }, { 193, 11 }, { 192, 19 }, { 192, 29 }, + { 206, 34 }, { 207, 25 }, { 208, 16 }, { 209, 5 }, { 224, 6 }, { 223, 17 }, { 223, 26 }, { 220, 35 } +}, { + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4 +} }; + static struct { uint8_t b; diff --git a/keyboards/model01/rules.mk b/keyboards/model01/rules.mk index 49ab981d148..4345027f417 100644 --- a/keyboards/model01/rules.mk +++ b/keyboards/model01/rules.mk @@ -1,5 +1,5 @@ -SRC += i2c_master.c \ - leds.c \ +QUANTUM_LIB_SRC += i2c_master.c +SRC += leds.c \ matrix.c # MCU name diff --git a/keyboards/moon/config.h b/keyboards/moon/config.h new file mode 100644 index 00000000000..a02cfdba166 --- /dev/null +++ b/keyboards/moon/config.h @@ -0,0 +1,44 @@ +/* +Copyright 2019 Mathias Andersson + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xFCB8 +#define DEVICE_VER 0x0001 +#define MANUFACTURER EVE +#define PRODUCT Moon +#define DESCRIPTION A tenkeyless keyboard with astonishing curves + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 11 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Backlight */ +#define BACKLIGHT_PIN C6 +#define BACKLIGHT_LEVELS 3 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/moon/info.json b/keyboards/moon/info.json new file mode 100644 index 00000000000..d7182ee367d --- /dev/null +++ b/keyboards/moon/info.json @@ -0,0 +1,467 @@ +{ + "keyboard_name": "Moon", + "url": "https://geekhack.org/index.php?topic=90379.0", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "key_count": 88, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi": { + "key_count": 87, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi_wkl": { + "key_count": 84, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, + {"label":"Space", "x":4, "y":5.5, "w":7}, + {"label":"Alt", "x":11, "y":5.5, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_iso": { + "key_count": 88, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"\u00ac", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"\"", "x":2, "y":1.5}, + {"label":"\u00a3", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"@", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_iso_wkl": { + "key_count": 85, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"\u00ac", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"\"", "x":2, "y":1.5}, + {"label":"\u00a3", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"@", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, + {"label":"Space", "x":4, "y":5.5, "w":7}, + {"label":"AltGr", "x":11, "y":5.5, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + } + } +} + diff --git a/keyboards/moon/keymaps/default/config.h b/keyboards/moon/keymaps/default/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/moon/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/moon/keymaps/default/keymap.c b/keyboards/moon/keymaps/default/keymap.c new file mode 100644 index 00000000000..7ab5a25f335 --- /dev/null +++ b/keyboards/moon/keymaps/default/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS , KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) +}; +// clang-format on diff --git a/keyboards/moon/keymaps/default/readme.md b/keyboards/moon/keymaps/default/readme.md new file mode 100644 index 00000000000..3a1a937828c --- /dev/null +++ b/keyboards/moon/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for the Moon diff --git a/keyboards/moon/keymaps/default_tkl_ansi/config.h b/keyboards/moon/keymaps/default_tkl_ansi/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_ansi/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/moon/keymaps/default_tkl_ansi/keymap.c b/keyboards/moon/keymaps/default_tkl_ansi/keymap.c new file mode 100644 index 00000000000..2eb006f6a12 --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_ansi/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS , KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) +}; +// clang-format on diff --git a/keyboards/moon/keymaps/default_tkl_ansi/readme.md b/keyboards/moon/keymaps/default_tkl_ansi/readme.md new file mode 100644 index 00000000000..bf1e2ac77aa --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_ansi/readme.md @@ -0,0 +1 @@ +# The default ANSI keymap for the Moon diff --git a/keyboards/moon/keymaps/default_tkl_ansi_wkl/config.h b/keyboards/moon/keymaps/default_tkl_ansi_wkl/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_ansi_wkl/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/moon/keymaps/default_tkl_ansi_wkl/keymap.c b/keyboards/moon/keymaps/default_tkl_ansi_wkl/keymap.c new file mode 100644 index 00000000000..ce3bcd713c9 --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_ansi_wkl/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_tkl_ansi_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS , KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) +}; +// clang-format on diff --git a/keyboards/moon/keymaps/default_tkl_ansi_wkl/readme.md b/keyboards/moon/keymaps/default_tkl_ansi_wkl/readme.md new file mode 100644 index 00000000000..f284c1b3cac --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_ansi_wkl/readme.md @@ -0,0 +1 @@ +# The default winkeyless ANSI keymap for the Moon diff --git a/keyboards/moon/keymaps/default_tkl_iso/config.h b/keyboards/moon/keymaps/default_tkl_iso/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_iso/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/moon/keymaps/default_tkl_iso/keymap.c b/keyboards/moon/keymaps/default_tkl_iso/keymap.c new file mode 100644 index 00000000000..868f68b1ad9 --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_iso/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_tkl_iso( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS , KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL , KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) +}; +// clang-format on diff --git a/keyboards/moon/keymaps/default_tkl_iso/readme.md b/keyboards/moon/keymaps/default_tkl_iso/readme.md new file mode 100644 index 00000000000..9dd1e2c252f --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_iso/readme.md @@ -0,0 +1 @@ +# The default ISO keymap for the Moon diff --git a/keyboards/moon/keymaps/default_tkl_iso_wkl/config.h b/keyboards/moon/keymaps/default_tkl_iso_wkl/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_iso_wkl/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/moon/keymaps/default_tkl_iso_wkl/keymap.c b/keyboards/moon/keymaps/default_tkl_iso_wkl/keymap.c new file mode 100644 index 00000000000..6e1e1d57058 --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_iso_wkl/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_tkl_iso_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS , KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL , KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) +}; +// clang-format on diff --git a/keyboards/moon/keymaps/default_tkl_iso_wkl/readme.md b/keyboards/moon/keymaps/default_tkl_iso_wkl/readme.md new file mode 100644 index 00000000000..fabba452b3b --- /dev/null +++ b/keyboards/moon/keymaps/default_tkl_iso_wkl/readme.md @@ -0,0 +1 @@ +# The default winkeyless ISO keymap for the Moon diff --git a/keyboards/moon/matrix.c b/keyboards/moon/matrix.c new file mode 100644 index 00000000000..c74c70f8977 --- /dev/null +++ b/keyboards/moon/matrix.c @@ -0,0 +1,218 @@ +/* +Copyright 2012-2019 Jun Wako, Jack Humbert, Yiancar, Mathias Andersson + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" +#include "pca9555.h" + +/* + * IC1 (PCA9555) IC2 (PCA9555) + * ,----------. ,----------. + * SDA --| SDA P00 |-- P1 SDA --| SDA P00 |-- P17 + * SCL --| SCL P01 |-- P2 SCL --| SCL P01 |-- P18 + * INT --| INT P02 |-- P3 INT --| INT P02 |-- P19 + * | P03 |-- P4 | P03 |-- P20 + * GND --| A0 P04 |-- P5 VCC --| A0 P04 |-- P21 + * SJ1 --| A1 P05 |-- P6 SJ1 --| A1 P05 |-- P22 + * GND --| A2 P06 |-- P7 GND --| A2 P06 |-- P23 + * | P07 |-- P8 | P07 |-- P24 + * | | | | + * | P10 |-- P9 | P10 |-- P25 + * | P11 |-- P10 | P11 |-- P26 + * | P12 |-- P11 | P12 |-- P27 + * | P13 |-- P12 | P13 |-- P28 + * | P14 |-- P13 | P14 |-- P29 + * | P15 |-- P14 | P15 |-- P30 + * | P16 |-- P15 | P16 |-- P31 + * | P17 |-- P16 | P17 |-- P32 + * `----------' `----------' + */ + +/* + * | Row | Pin | | Col | Pin | + * | --- | --- | | --- | --- | + * | 0 | P1 | | 0 | P25 | + * | 1 | P2 | | 1 | P26 | + * | 2 | P3 | | 2 | P27 | + * | 3 | P4 | | 3 | P28 | + * | 4 | P5 | | 4 | P29 | + * | 5 | P6 | | 5 | P30 | + * | 6 | P7 | | 6 | P20 | + * | 7 | P8 | | 7 | P21 | + * | 8 | P22 | + * | 9 | P23 | + * | A | P24 | + */ + +// PCA9555 slave addresses +#define IC1 0x20 +#define IC2 0x21 + +// PCA9555 column pin masks +#define PORT0_COLS_MASK 0b11111000 +#define PORT1_COLS_MASK 0b00111111 +#define COLS_MASK 0b0000011111111111 + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values +static matrix_row_t matrix[MATRIX_ROWS]; // debounced values + +__attribute__((weak)) void matrix_init_quantum(void) { matrix_init_kb(); } + +__attribute__((weak)) void matrix_scan_quantum(void) { matrix_scan_kb(); } + +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } + +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } + +__attribute__((weak)) void matrix_init_user(void) {} + +__attribute__((weak)) void matrix_scan_user(void) {} + +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } + +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } + +inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } + +inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } + +void matrix_print(void) { + print_matrix_header(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); + print(": "); + print_matrix_row(row); + print("\n"); + } +} + +uint8_t matrix_key_count(void) { + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += matrix_bitpop(i); + } + return count; +} + +static void init_i2c(void) { + pca9555_init(IC1); + pca9555_init(IC2); +} + +static void init_pins(void) { + // init cols - IC2 port0 & IC2 port1 input + pca9555_set_config(IC2, PCA9555_PORT0, ALL_INPUT); + pca9555_set_config(IC2, PCA9555_PORT1, ALL_INPUT); + + // init rows - IC1 port0 output + pca9555_set_config(IC1, PCA9555_PORT0, ALL_OUTPUT); + pca9555_set_output(IC1, PCA9555_PORT0, ALL_HIGH); +} + +static void select_row(uint8_t row) { + // All rows are on the same IC and port + uint8_t mask = 1 << row; + + // set active row low : 0 + // set other rows hi-Z : 1 + pca9555_set_output(IC1, PCA9555_PORT0, ALL_HIGH & (~mask)); +} + +static uint16_t read_cols(void) { + uint16_t state_1 = pca9555_readPins(IC2, PCA9555_PORT0); + uint16_t state_2 = pca9555_readPins(IC2, PCA9555_PORT1); + + uint16_t state = ((state_1 & PORT0_COLS_MASK) << 3) | ((state_2 & PORT1_COLS_MASK)); + + // A low pin indicates an active column + return (~state) & COLS_MASK; +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + current_matrix[current_row] |= read_cols(); + + // No need to unselect as `select_row` sets all the pins. + + return (last_row_value != current_matrix[current_row]); +} + +void matrix_init(void) { + // initialize i2c + init_i2c(); + + // initialize key pins + init_pins(); + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + raw_matrix[i] = 0; + matrix[i] = 0; + } + + debounce_init(MATRIX_ROWS); + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + bool changed = false; + + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + changed |= read_cols_on_row(raw_matrix, current_row); + } + + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + + matrix_scan_quantum(); + + return (uint8_t)changed; +} diff --git a/keyboards/moon/moon.c b/keyboards/moon/moon.c new file mode 100644 index 00000000000..c218bf5ef15 --- /dev/null +++ b/keyboards/moon/moon.c @@ -0,0 +1,69 @@ +/* Copyright 2019 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "moon.h" + +#define CAPS_PIN B5 +#define SCROLL_PIN B6 + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + setPinOutput(CAPS_PIN); + setPinOutput(SCROLL_PIN); + + matrix_init_user(); +} + +/* + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +*/ + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(CAPS_PIN); + } else { + writePinLow(CAPS_PIN); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(SCROLL_PIN); + } else { + writePinLow(SCROLL_PIN); + } + + led_set_user(usb_led); +} diff --git a/keyboards/moon/moon.h b/keyboards/moon/moon.h new file mode 100644 index 00000000000..8599aded1be --- /dev/null +++ b/keyboards/moon/moon.h @@ -0,0 +1,121 @@ +/* Copyright 2019 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all( \ + k06, k07, k08, k09, k0A, k00, k01, k02, k03, k04, k05, k66, k67, k68, k69, k6A, \ + k16, k17, k18, k19, k1A, k10, k11, k12, k13, k14, k15, k60, k61, k62, k63, k64, k65, \ + k26, k27, k28, k29, k2A, k20, k21, k22, k23, k24, k25, k76, k77, k78, k79, k7A, k70, \ + k36, k37, k38, k39, k3A, k30, k31, k32, k33, k34, k35, k71, k72, \ + k46, k47, k48, k49, k4A, k40, k41, k42, k43, k44, k45, k73, k75, k74, \ + k56, k57, k58, k59, k5A, k50, k51, k52, k53, k54, k55 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A }, \ + { k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7A }, \ +} + +#define LAYOUT_tkl_ansi( \ + k06, k07, k08, k09, k0A, k00, k01, k02, k03, k04, k05, k66, k67, k68, k69, k6A, \ + k16, k17, k18, k19, k1A, k10, k11, k12, k13, k14, k15, k60, k61, k62, k63, k64, k65, \ + k26, k27, k28, k29, k2A, k20, k21, k22, k23, k24, k25, k76, k77, k78, k79, k7A, k70, \ + k36, k37, k38, k39, k3A, k30, k31, k32, k33, k34, k35, k71, k72, \ + k46, k48, k49, k4A, k40, k41, k42, k43, k44, k45, k73, k75, k74, \ + k56, k57, k58, k59, k5A, k50, k51, k52, k53, k54, k55 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A }, \ + { k40, k41, k42, k43, k44, k45, k46, KC_NO, k48, k49, k4A }, \ + { k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7A }, \ +} + +#define LAYOUT_tkl_ansi_wkl( \ + k06, k07, k08, k09, k0A, k00, k01, k02, k03, k04, k05, k66, k67, k68, k69, k6A, \ + k16, k17, k18, k19, k1A, k10, k11, k12, k13, k14, k15, k60, k61, k62, k63, k64, k65, \ + k26, k27, k28, k29, k2A, k20, k21, k22, k23, k24, k25, k76, k77, k78, k79, k7A, k70, \ + k36, k37, k38, k39, k3A, k30, k31, k32, k33, k34, k35, k71, k72, \ + k46, k48, k49, k4A, k40, k41, k42, k43, k44, k45, k73, k75, k74, \ + k56, k58, k59, k50, k52, k53, k54, k55 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A }, \ + { k40, k41, k42, k43, k44, k45, k46, KC_NO, k48, k49, k4A }, \ + { k50, KC_NO, k52, k53, k54, k55, k56, KC_NO, k58, k59, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7A }, \ +} + +#define LAYOUT_tkl_iso( \ + k06, k07, k08, k09, k0A, k00, k01, k02, k03, k04, k05, k66, k67, k68, k69, k6A, \ + k16, k17, k18, k19, k1A, k10, k11, k12, k13, k14, k15, k60, k61, k62, k63, k64, k65, \ + k26, k27, k28, k29, k2A, k20, k21, k22, k23, k24, k25, k76, k77, k79, k7A, k70, \ + k36, k37, k38, k39, k3A, k30, k31, k32, k33, k34, k35, k71, k78, k72, \ + k46, k47, k48, k49, k4A, k40, k41, k42, k43, k44, k45, k73, k75, k74, \ + k56, k57, k58, k59, k5A, k50, k51, k52, k53, k54, k55 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A }, \ + { k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7A }, \ +} + +#define LAYOUT_tkl_iso_wkl( \ + k06, k07, k08, k09, k0A, k00, k01, k02, k03, k04, k05, k66, k67, k68, k69, k6A, \ + k16, k17, k18, k19, k1A, k10, k11, k12, k13, k14, k15, k60, k61, k62, k63, k64, k65, \ + k26, k27, k28, k29, k2A, k20, k21, k22, k23, k24, k25, k76, k77, k79, k7A, k70, \ + k36, k37, k38, k39, k3A, k30, k31, k32, k33, k34, k35, k71, k78, k72, \ + k46, k47, k48, k49, k4A, k40, k41, k42, k43, k44, k45, k73, k75, k74, \ + k56, k58, k59, k50, k52, k53, k54, k55 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A }, \ + { k50, KC_NO, k52, k53, k54, k55, k56, KC_NO, k58, k59, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A }, \ + { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7A }, \ +} diff --git a/keyboards/moon/pca9555.c b/keyboards/moon/pca9555.c new file mode 100644 index 00000000000..b0e542d8def --- /dev/null +++ b/keyboards/moon/pca9555.c @@ -0,0 +1,78 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "i2c_master.h" +#include "pca9555.h" + +#include "debug.h" + +#define SLAVE_TO_ADDR(n) (n << 1) +#define TIMEOUT 100 + +enum { + CMD_INPUT_0 = 0, + CMD_INPUT_1, + CMD_OUTPUT_0, + CMD_OUTPUT_1, + CMD_INVERSION_0, + CMD_INVERSION_1, + CMD_CONFIG_0, + CMD_CONFIG_1, +}; + +void pca9555_init(uint8_t slave_addr) { + static uint8_t s_init = 0; + if (!s_init) { + i2c_init(); + + s_init = 1; + } + + // TODO: could check device connected + // i2c_start(SLAVE_TO_ADDR(slave) | I2C_WRITE); + // i2c_stop(); +} + +void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_CONFIG_1 : CMD_CONFIG_0; + + i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_set_config::FAILED\n"); + } +} + +void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_OUTPUT_1 : CMD_OUTPUT_0; + + i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_set_output::FAILED\n"); + } +} + +uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_INPUT_1 : CMD_INPUT_0; + + uint8_t data = 0; + i2c_status_t ret = i2c_readReg(addr, cmd, &data, sizeof(data), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_readPins::FAILED\n"); + } + return data; +} diff --git a/keyboards/moon/pca9555.h b/keyboards/moon/pca9555.h new file mode 100644 index 00000000000..ebb97e2f301 --- /dev/null +++ b/keyboards/moon/pca9555.h @@ -0,0 +1,55 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +/* + PCA9555 + ,----------. + SDA --| SDA P00 |-- P00 + SCL --| SCL P01 |-- P01 + INT --| INT P02 |-- P02 + | P03 |-- P03 + A0 --| A0 P04 |-- P04 + A1 --| A1 P05 |-- P05 + A2 --| A2 P06 |-- P06 + | P07 |-- P07 + | | + | P10 |-- P10 + | P11 |-- P11 + | P12 |-- P12 + | P13 |-- P13 + | P14 |-- P14 + | P15 |-- P15 + | P16 |-- P16 + | P17 |-- P17 + `----------' +*/ + +#define PCA9555_PORT0 0 +#define PCA9555_PORT1 1 + +#define ALL_OUTPUT 0 +#define ALL_INPUT 0xFF +#define ALL_LOW 0 +#define ALL_HIGH 0xFF + +void pca9555_init(uint8_t slave_addr); + +void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf); + +void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf); + +uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port); diff --git a/keyboards/moon/readme.md b/keyboards/moon/readme.md new file mode 100644 index 00000000000..6ba38826e2d --- /dev/null +++ b/keyboards/moon/readme.md @@ -0,0 +1,17 @@ +# Moon + +![moon](https://i.imgur.com/hQeOBMs.jpg) + +A tenkeyless keyboard with astonishing curves. Designed and manufactured by EVE. + +The PCB uses the [Kimera core](https://github.com/kairyu/kimera) controller. + +Keyboard Maintainer: [Mathias Andersson](https://github.com/wraul) +Hardware Supported: Moon (only the initial black PCB with Kimera core). +Hardware Availability: https://geekhack.org/index.php?topic=90379.0 + +Make example for this keyboard (after setting up your build environment): + + make moon:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/moon/rules.mk b/keyboards/moon/rules.mk new file mode 100644 index 00000000000..699fc339570 --- /dev/null +++ b/keyboards/moon/rules.mk @@ -0,0 +1,77 @@ +# Project specific files +SRC += i2c_master.c pca9555.c matrix.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# Supported layouts +LAYOUTS = tkl_ansi tkl_iso + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +CUSTOM_MATRIX = yes diff --git a/keyboards/mt40/config.h b/keyboards/mt40/config.h index cf3326d7bf6..48f707f71fd 100644 --- a/keyboards/mt40/config.h +++ b/keyboards/mt40/config.h @@ -35,7 +35,6 @@ along with this program. If not, see . #define MATRIX_ROWS 8 #define MATRIX_COLS 15 - #define NO_UART 1 #define RGB_DI_PIN C0 @@ -60,7 +59,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C2, C3, C4, C5, C6, C7, D7 } /* #define UNUSED_PINS */ -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ /* #define DIODE_DIRECTION COL2ROW */ #define BACKLIGHT_PIN D2 @@ -69,12 +68,11 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -/* #define DEBOUNCING_DELAY 5 */ +/* #define DEBOUNCE 5 */ /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ /* #define LOCKING_SUPPORT_ENABLE */ /* Locking resynchronize hack */ @@ -118,9 +116,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/mt40/keymaps/default/config.h b/keyboards/mt40/keymaps/default/config.h index 9f9a9fc1079..6c3e30ef7b5 100644 --- a/keyboards/mt40/keymaps/default/config.h +++ b/keyboards/mt40/keymaps/default/config.h @@ -1,5 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +// place overrides here #define TAPPING_TERM 200 @@ -7,5 +8,3 @@ #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 15 #define RGBLIGHT_VAL_STEP 18 - -#endif diff --git a/keyboards/mt40/keymaps/default/keymap.c b/keyboards/mt40/keymaps/default/keymap.c index 645f58e8a63..29a2b414b1b 100644 --- a/keyboards/mt40/keymaps/default/keymap.c +++ b/keyboards/mt40/keymaps/default/keymap.c @@ -15,8 +15,6 @@ */ #include QMK_KEYBOARD_H - -#define _______ KC_TRNS #define OOOOOOO KC_TRNS #define C_LCTL MT(MOD_LCTL, KC_QUOT) diff --git a/keyboards/mt980/config.h b/keyboards/mt980/config.h new file mode 100644 index 00000000000..6b8b9529527 --- /dev/null +++ b/keyboards/mt980/config.h @@ -0,0 +1,52 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Wheat Field Peripherals +#define PRODUCT MT980 +#define DESCRIPTION Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0, E6, F0, F1, F4, F5, F6, F7 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 24 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_LIMIT_VAL 185 +#endif + +/* Place bootmagic key on Esc */ +#define BOOTMAGIC_LITE_ROW 5 +#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/mt980/info.json b/keyboards/mt980/info.json new file mode 100644 index 00000000000..f71d0228564 --- /dev/null +++ b/keyboards/mt980/info.json @@ -0,0 +1,117 @@ +{ + "keyboard_name": "mt980", + "url": "https://shop110310565.taobao.com", + "maintainer": "walkerstop", + "width": 19.5, + "height": 6.75, + "layouts": { + "LAYOUT": { + "key_count": 103, + "layout": [ + {"label":"K50", "x":0, "y":0}, + {"label":"K52", "x":1.25, "y":0}, + {"label":"K53", "x":2.25, "y":0}, + {"label":"K54", "x":3.25, "y":0}, + {"label":"K55", "x":4.25, "y":0}, + {"label":"K57", "x":5.5, "y":0}, + {"label":"K58", "x":6.5, "y":0}, + {"label":"KB8", "x":7.5, "y":0}, + {"label":"KB7", "x":8.5, "y":0}, + {"label":"KB5", "x":9.75, "y":0}, + {"label":"KB4", "x":10.75, "y":0}, + {"label":"KB3", "x":11.75, "y":0}, + {"label":"KB6", "x":12.75, "y":0}, + {"label":"K51", "x":14, "y":0}, + {"label":"KB2", "x":15.5, "y":0}, + {"label":"KB1", "x":16.5, "y":0}, + {"label":"KB0", "x":17.5, "y":0}, + {"label":"K63", "x":18.5, "y":0}, + {"label":"K40", "x":0, "y":1.5}, + {"label":"K41", "x":1, "y":1.5}, + {"label":"K42", "x":2, "y":1.5}, + {"label":"K43", "x":3, "y":1.5}, + {"label":"K44", "x":4, "y":1.5}, + {"label":"K45", "x":5, "y":1.5}, + {"label":"K46", "x":6, "y":1.5}, + {"label":"K47", "x":7, "y":1.5}, + {"label":"K48", "x":8, "y":1.5}, + {"label":"KA8", "x":9, "y":1.5}, + {"label":"KA7", "x":10, "y":1.5}, + {"label":"KA5", "x":11, "y":1.5}, + {"label":"KA4", "x":12, "y":1.5}, + {"label":"KA3", "x":13, "y":1.5}, + {"label":"KA6", "x":14, "y":1.5}, + {"label":"KA2", "x":15.5, "y":1.5}, + {"label":"KA1", "x":16.5, "y":1.5}, + {"label":"KA0", "x":17.5, "y":1.5}, + {"label":"K64", "x":18.5, "y":1.5}, + {"label":"K30", "x":0, "y":2.5, "w":1.5}, + {"label":"K31", "x":1.5, "y":2.5}, + {"label":"K32", "x":2.5, "y":2.5}, + {"label":"K33", "x":3.5, "y":2.5}, + {"label":"K34", "x":4.5, "y":2.5}, + {"label":"K35", "x":5.5, "y":2.5}, + {"label":"K36", "x":6.5, "y":2.5}, + {"label":"K37", "x":7.5, "y":2.5}, + {"label":"K38", "x":8.5, "y":2.5}, + {"label":"K98", "x":9.5, "y":2.5}, + {"label":"K97", "x":10.5, "y":2.5}, + {"label":"K95", "x":11.5, "y":2.5}, + {"label":"K94", "x":12.5, "y":2.5}, + {"label":"K84", "x":13.5, "y":2.5, "w":1.5}, + {"label":"K96", "x":15.5, "y":2.5}, + {"label":"K92", "x":16.5, "y":2.5}, + {"label":"K91", "x":17.5, "y":2.5}, + {"label":"K90", "x":18.5, "y":2.5}, + {"label":"K20", "x":0, "y":3.5, "w":1.75}, + {"label":"K21", "x":1.75, "y":3.5}, + {"label":"K22", "x":2.75, "y":3.5}, + {"label":"K23", "x":3.75, "y":3.5}, + {"label":"K24", "x":4.75, "y":3.5}, + {"label":"K25", "x":5.75, "y":3.5}, + {"label":"K26", "x":6.75, "y":3.5}, + {"label":"K27", "x":7.75, "y":3.5}, + {"label":"K28", "x":8.75, "y":3.5}, + {"label":"K88", "x":9.75, "y":3.5}, + {"label":"K87", "x":10.75, "y":3.5}, + {"label":"K85", "x":11.75, "y":3.5}, + {"label":"K93", "x":12.75, "y":3.5, "w":2.25}, + {"label":"K86", "x":15.5, "y":3.5}, + {"label":"K82", "x":16.5, "y":3.5}, + {"label":"K81", "x":17.5, "y":3.5}, + {"label":"K80", "x":18.5, "y":3.5}, + {"label":"K10", "x":0, "y":4.5, "w":1.25}, + {"label":"K11", "x":1.25, "y":4.5}, + {"label":"K12", "x":2.25, "y":4.5}, + {"label":"K13", "x":3.25, "y":4.5}, + {"label":"K14", "x":4.25, "y":4.5}, + {"label":"K15", "x":5.25, "y":4.5}, + {"label":"K16", "x":6.25, "y":4.5}, + {"label":"K17", "x":7.25, "y":4.5}, + {"label":"K18", "x":8.25, "y":4.5}, + {"label":"K78", "x":9.25, "y":4.5}, + {"label":"K77", "x":10.25, "y":4.5}, + {"label":"K75", "x":11.25, "y":4.5}, + {"label":"K74", "x":12.25, "y":4.5, "w":1.75}, + {"label":"K73", "x":14.25, "y":4.75}, + {"label":"K76", "x":15.5, "y":4.5}, + {"label":"K72", "x":16.5, "y":4.5}, + {"label":"K71", "x":17.5, "y":4.5}, + {"label":"K70", "x":18.5, "y":4.5}, + {"label":"K00", "x":0, "y":5.5, "w":1.25}, + {"label":"K01", "x":1.25, "y":5.5}, + {"label":"K02", "x":2.25, "y":5.5, "w":1.25}, + {"label":"K06", "x":3.5, "y":5.5, "w":6.25}, + {"label":"K08", "x":9.75, "y":5.5}, + {"label":"K07", "x":10.75, "y":5.5}, + {"label":"K05", "x":11.75, "y":5.5, "w":1.25}, + {"label":"K04", "x":13.25, "y":5.75}, + {"label":"K03", "x":14.25, "y":5.75}, + {"label":"K66", "x":15.25, "y":5.75}, + {"label":"K62", "x":16.5, "y":5.5}, + {"label":"K61", "x":17.5, "y":5.5}, + {"label":"K60", "x":18.5, "y":5.5} + ] + } + } +} diff --git a/keyboards/mt980/keymaps/default/keymap.c b/keyboards/mt980/keymaps/default/keymap.c new file mode 100644 index 00000000000..504233a9831 --- /dev/null +++ b/keyboards/mt980/keymaps/default/keymap.c @@ -0,0 +1,21 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_INS, KC_PSCR, KC_PGUP, KC_PGDN, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + + [1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_SLCK, KC_HOME, KC_END, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS) + +}; diff --git a/keyboards/mt980/keymaps/walker/config.h b/keyboards/mt980/keymaps/walker/config.h new file mode 100644 index 00000000000..0bd39599381 --- /dev/null +++ b/keyboards/mt980/keymaps/walker/config.h @@ -0,0 +1,5 @@ +#pragma once + +#define TAPPING_TERM 200 +#define ONESHOT_TAP_TOGGLE 5 +#define ONESHOT_TIMEOUT 5000 diff --git a/keyboards/mt980/keymaps/walker/keymap.c b/keyboards/mt980/keymaps/walker/keymap.c new file mode 100644 index 00000000000..83a3fb8167d --- /dev/null +++ b/keyboards/mt980/keymaps/walker/keymap.c @@ -0,0 +1,168 @@ +#include "mt980.h" + +bool numlock_on = true; + +typedef struct { + bool is_press_action; + int state; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + TRIPLE_TAP = 5, + TRIPLE_HOLD = 6 +}; + +enum { + ALT_L1 = 0 +}; + +int cur_dance (qk_tap_dance_state_t *state); +void alt_finished (qk_tap_dance_state_t *state, void *user_data); +void alt_reset (qk_tap_dance_state_t *state, void *user_data); + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_INS, KC_PSCR, KC_PGUP, KC_PGDN, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, TD(ALT_L1), KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + + [1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_SLCK, KC_HOME, KC_END, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RGB_TOG, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS) + +}; + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->pressed) return SINGLE_HOLD; + else return SINGLE_TAP; + } + else if (state->count == 2) { + if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else if (state->count == 3) { + if (state->interrupted || !state->pressed) return TRIPLE_TAP; + else return TRIPLE_HOLD; + } + else return 8; +} + +static tap alttap_state = { + .is_press_action = true, + .state = 0 +}; + +void alt_finished (qk_tap_dance_state_t *state, void *user_data) { + alttap_state.state = cur_dance(state); + switch (alttap_state.state) { + case SINGLE_TAP: set_oneshot_layer(1, ONESHOT_START); clear_oneshot_layer_state(ONESHOT_PRESSED); break; + case SINGLE_HOLD: register_code(KC_LALT); break; + case DOUBLE_TAP: set_oneshot_layer(1, ONESHOT_START); set_oneshot_layer(1, ONESHOT_PRESSED); break; + case DOUBLE_HOLD: register_code(KC_LALT); layer_on(1); break; + } +} + +void alt_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (alttap_state.state) { + case SINGLE_TAP: break; + case SINGLE_HOLD: unregister_code(KC_LALT); break; + case DOUBLE_TAP: break; + case DOUBLE_HOLD: layer_off(1); unregister_code(KC_LALT); break; + } + alttap_state.state = 0; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [ALT_L1] = ACTION_TAP_DANCE_FN_ADVANCED(NULL,alt_finished, alt_reset) +}; + +void led_set_keymap(uint8_t usb_led) { + if (usb_led & (1<event.pressed && is_oneshot_layer_active()) + clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); + return true; + case RESET: + /* Don't allow reset from oneshot layer state */ + if (record->event.pressed && is_oneshot_layer_active()) { + clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); + return false; + } + return true; + case KC_PPLS: + if (!numlock_on) { + if (is_oneshot_layer_active() || layer_state & 0x2) { + if (record->event.pressed) + register_code(KC_HOME); + else + unregister_code(KC_HOME); + clear_oneshot_layer_state(ONESHOT_START); + } + else { + if (record->event.pressed) + register_code(KC_PGUP); + else + unregister_code(KC_PGUP); + } + return false; + } + return true; + case KC_PENT: + if (!numlock_on) { + if (is_oneshot_layer_active() || layer_state & 0x2) { + if (record->event.pressed) + register_code(KC_END); + else + unregister_code(KC_END); + clear_oneshot_layer_state(ONESHOT_START); + } + else { + if (record->event.pressed) + register_code(KC_PGDN); + else + unregister_code(KC_PGDN); + } + return false; + } + return true; + case KC_NLCK: + /* Shift + NumLock will be treated as shift-Insert */ + if ((keyboard_report->mods & MOD_BIT (KC_LSFT)) || (keyboard_report->mods & MOD_BIT (KC_RSFT))) { + if (record->event.pressed) { + register_code(KC_INS); + unregister_code(KC_INS); + } + return false; + } + else + return true; + default: + return true; + } + return true; +} diff --git a/keyboards/mt980/keymaps/walker/rules.mk b/keyboards/mt980/keymaps/walker/rules.mk new file mode 100644 index 00000000000..e5ddcae8d92 --- /dev/null +++ b/keyboards/mt980/keymaps/walker/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/mt980/mt980.c b/keyboards/mt980/mt980.c new file mode 100644 index 00000000000..5461a3b21ff --- /dev/null +++ b/keyboards/mt980/mt980.c @@ -0,0 +1,65 @@ +#include "mt980.h" + +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} +__attribute__ ((weak)) +void led_set_keymap(uint8_t usb_led) {} + +void matrix_init_user(void) { + matrix_init_keymap(); +} + +void matrix_scan_user(void) { + matrix_scan_keymap(); +} + +void keyboard_pre_init_user(void) { + /* Set NUMLOCK indicator pin as output */ + setPinOutput(C6); + /* Set CAPSLOCK indicator pin as output */ + setPinOutput(C7); + /* Set SCROLLOCK indicator pin as output */ + setPinOutput(B5); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return process_record_keymap(keycode, record); +} + +void led_set_user(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(C6); + } + else { + writePinHigh(C6); + } + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(C7); + } + else { + writePinHigh(C7); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(B5); + } + else { + writePinHigh(B5); + } + + led_set_keymap(usb_led); +} diff --git a/keyboards/mt980/mt980.h b/keyboards/mt980/mt980.h new file mode 100644 index 00000000000..d9804b33926 --- /dev/null +++ b/keyboards/mt980/mt980.h @@ -0,0 +1,25 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K050, K052, K053, K054, K055, K057, K058, K118, K117, K115, K114, K113, K116, K051, K112, K111, K110, K063, \ + K040, K041, K042, K043, K044, K045, K046, K047, K048, K108, K107, K105, K104, K103, K106, K102, K101, K100, K064, \ + K030, K031, K032, K033, K034, K035, K036, K037, K038, K098, K097, K095, K094, K084, K096, K092, K091, K090, \ + K020, K021, K022, K023, K024, K025, K026, K027, K028, K088, K087, K085, K093, K086, K082, K081, K080, \ + K010, K011, K012, K013, K014, K015, K016, K017, K018, K078, K077, K075, K074, K073, K076, K072, K071, K070, \ + K000, K001, K002, K006, K008, K007, K005, K004, K003, K066, K062, K061, K060 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008 }, \ + { K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, KC_NO, K057, K058 }, \ + { K060, K061, K062, K063, K064, KC_NO, K066, KC_NO, KC_NO}, \ + { K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, KC_NO, K084, K085, K086, K087, K088 }, \ + { K090, K091, K092, K093, K094, K095, K096, K097, K098 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108 }, \ + { K110, K111, K112, K113, K114, K115, K116, K117, K118 } \ +} diff --git a/keyboards/mt980/readme.md b/keyboards/mt980/readme.md new file mode 100644 index 00000000000..7bc27c93a5f --- /dev/null +++ b/keyboards/mt980/readme.md @@ -0,0 +1,14 @@ +# mt980 + +A mechanical keyboard PCB in the same layout as the Leopold FC980M, sold by Wheat Field Peripherals on Taobao. This PCB requires soldering, except for the arrow cluster and the Escape key switches, which use Kailh hot swap sockets. + +Keyboard Maintainer: [walkerstop](https://github.com/walkerstop) +Hardware Supported: mt980 +Hardware Availability: Taobao store https://shop110310565.taobao.com + +Make example for this keyboard (after setting up your build environment): + + make mt980:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + diff --git a/keyboards/mt980/rules.mk b/keyboards/mt980/rules.mk new file mode 100644 index 00000000000..9a7718aadba --- /dev/null +++ b/keyboards/mt980/rules.mk @@ -0,0 +1,55 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# + +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +KEY_LOCK_ENABLE = no diff --git a/keyboards/mxss/config.h b/keyboards/mxss/config.h index 8be64e0b387..812f301d6fe 100644 --- a/keyboards/mxss/config.h +++ b/keyboards/mxss/config.h @@ -37,11 +37,11 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D7, D6, D4, D0, C6, B6, D1, B5, D2, B4, D3, D5, B0, B2, B3 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Basic RGB configuration */ #define RGB_DI_PIN C7 @@ -94,11 +94,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/mxss/keymaps/default/config.h b/keyboards/mxss/keymaps/default/config.h index 9f862257994..bfbdb62297d 100644 --- a/keyboards/mxss/keymaps/default/config.h +++ b/keyboards/mxss/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/mxss/keymaps/default/keymap.c b/keyboards/mxss/keymaps/default/keymap.c index 47983c90c6c..17cebe0c8f9 100644 --- a/keyboards/mxss/keymaps/default/keymap.c +++ b/keyboards/mxss/keymaps/default/keymap.c @@ -51,27 +51,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/mxss/readme.md b/keyboards/mxss/readme.md index 54e07e27b0c..181b6366a09 100644 --- a/keyboards/mxss/readme.md +++ b/keyboards/mxss/readme.md @@ -29,7 +29,7 @@ Make example for this keyboard (after setting up your build environment): make mxss:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. # Front LED Operation diff --git a/keyboards/mxss/rgblight.c b/keyboards/mxss/rgblight.c index da7959c6a85..73f94f3ab0a 100644 --- a/keyboards/mxss/rgblight.c +++ b/keyboards/mxss/rgblight.c @@ -234,7 +234,7 @@ void rgblight_step_reverse(void) { rgblight_mode(mode); } -uint32_t rgblight_get_mode(void) { +uint8_t rgblight_get_mode(void) { if (!rgblight_config.enable) { return false; } diff --git a/keyboards/mxss/rgblight.h b/keyboards/mxss/rgblight.h new file mode 100644 index 00000000000..0013a34386e --- /dev/null +++ b/keyboards/mxss/rgblight.h @@ -0,0 +1,166 @@ +/* Copyright 2017 Yang Liu + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef RGBLIGHT_H +#define RGBLIGHT_H + +#ifdef RGBLIGHT_ANIMATIONS + #define RGBLIGHT_MODES 35 +#else + #define RGBLIGHT_MODES 1 +#endif + +#ifndef RGBLIGHT_EFFECT_BREATHE_CENTER +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1-2.7 +#endif + +#ifndef RGBLIGHT_EFFECT_BREATHE_MAX +#define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0-255 +#endif + +#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 +#endif + +#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 +#endif + +#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0 +#endif + +#ifndef RGBLIGHT_EFFECT_KNIGHT_LED_NUM +#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM +#endif + +#ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL +#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000 +#endif + +#ifndef RGBLIGHT_EFFECT_CHRISTMAS_STEP +#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2 +#endif + +#ifndef RGBLIGHT_HUE_STEP +#define RGBLIGHT_HUE_STEP 10 +#endif +#ifndef RGBLIGHT_SAT_STEP +#define RGBLIGHT_SAT_STEP 17 +#endif +#ifndef RGBLIGHT_VAL_STEP +#define RGBLIGHT_VAL_STEP 17 +#endif + +#define RGBLED_TIMER_TOP F_CPU/(256*64) +// #define RGBLED_TIMER_TOP 0xFF10 + +#include +#include +#include "eeconfig.h" +#ifndef RGBLIGHT_CUSTOM_DRIVER +#include "ws2812.h" +#endif +#include "color.h" +#include "rgblight_list.h" + +extern LED_TYPE led[RGBLED_NUM]; + +extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM; +extern const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[3] PROGMEM; +extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM; +extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM; +extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM; +extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM; + +typedef union { + uint32_t raw; + struct { + bool enable :1; + uint8_t mode :6; + uint16_t hue :9; + uint8_t sat :8; + uint8_t val :8; + uint8_t speed :8;//EECONFIG needs to be increased to support this + }; +} rgblight_config_t; + +void rgblight_init(void); +void rgblight_increase(void); +void rgblight_decrease(void); +void rgblight_toggle(void); +void rgblight_enable(void); +void rgblight_disable(void); +void rgblight_step(void); +void rgblight_step_reverse(void); +uint8_t rgblight_get_mode(void); +void rgblight_mode(uint8_t mode); +void rgblight_set(void); +void rgblight_update_dword(uint32_t dword); +void rgblight_increase_hue(void); +void rgblight_decrease_hue(void); +void rgblight_increase_sat(void); +void rgblight_decrease_sat(void); +void rgblight_increase_val(void); +void rgblight_decrease_val(void); +void rgblight_increase_speed(void); +void rgblight_decrease_speed(void); +void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); +uint16_t rgblight_get_hue(void); +uint8_t rgblight_get_sat(void); +uint8_t rgblight_get_val(void); +void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); +void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index); +void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index); + +uint32_t eeconfig_read_rgblight(void); +void eeconfig_update_rgblight(uint32_t val); +void eeconfig_update_rgblight_default(void); +void eeconfig_debug_rgblight(void); + +void rgb_matrix_increase(void); +void rgb_matrix_decrease(void); + +void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); +void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); + +void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); +void rgblight_mode_noeeprom(uint8_t mode); +void rgblight_toggle_noeeprom(void); +void rgblight_enable_noeeprom(void); +void rgblight_disable_noeeprom(void); + +void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); +void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); + + +#define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) +void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); + +void rgblight_task(void); + +void rgblight_timer_init(void); +void rgblight_timer_enable(void); +void rgblight_timer_disable(void); +void rgblight_timer_toggle(void); +void rgblight_effect_breathing(uint8_t interval); +void rgblight_effect_rainbow_mood(uint8_t interval); +void rgblight_effect_rainbow_swirl(uint8_t interval); +void rgblight_effect_snake(uint8_t interval); +void rgblight_effect_knight(uint8_t interval); +void rgblight_effect_christmas(void); +void rgblight_effect_rgbtest(void); + +#endif diff --git a/keyboards/mxss/rules.mk b/keyboards/mxss/rules.mk index f46ae637430..ac7a1ee8f4d 100644 --- a/keyboards/mxss/rules.mk +++ b/keyboards/mxss/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/mxss/templates/keymap.c b/keyboards/mxss/templates/keymap.c index 86a0f231d8b..13dbb7206c3 100644 --- a/keyboards/mxss/templates/keymap.c +++ b/keyboards/mxss/templates/keymap.c @@ -16,9 +16,6 @@ #include QMK_KEYBOARD_H #include "mxss_frontled.h" -// Helpful defines -#define _______ KC_TRNS - // Predefined colors for layers // Format: {hue, saturation} // {0, 0} to turn off the LED @@ -39,4 +36,4 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { __KEYMAP_GOES_HERE__ -}; \ No newline at end of file +}; diff --git a/keyboards/naked48/config.h b/keyboards/naked48/config.h new file mode 100644 index 00000000000..b37d1022110 --- /dev/null +++ b/keyboards/naked48/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +// GCC include 'config.h" sequence in qmk_firmware/keyboards/naked48/ +// -include keyboards/naked48/config.h +// -include keyboards/naked48/rev?/config.h +// -include keyboards/naked48/rev?/keymaps/MAPNAME/config.h +// XXXX.c + +#include + +// GCC include search path in qmk_firmare/keyboards/naked48/ +// #include "..." search starts here: +// #include <...> search starts here: +// keyboards/naked48/rev?/keymaps/MAPNAME +// keyboards/naked48 +// keyboards/naked48/rev? +// . +// ./tmk_core +// ...... + +// MACRO and FUNCTION are features that are depreciated. +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/naked48/info.json b/keyboards/naked48/info.json new file mode 100644 index 00000000000..362fc9f5e05 --- /dev/null +++ b/keyboards/naked48/info.json @@ -0,0 +1,251 @@ +{ + "keyboard_name": "Naked48", + "url": "https://salicylic-acid3.hatenablog.com/", + "maintainer": "Salicylic_acid3", + "width": 14, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + { + "label":"Tab", + "x":0, + "y":0 + }, + { + "label":"Q", + "x":1, + "y":0 + }, + { + "label":"W", + "x":2, + "y":0 + }, + { + "label":"E", + "x":3, + "y":0 + }, + { + "label":"R", + "x":4, + "y":0 + }, + { + "label":"T", + "x":5, + "y":0 + }, + { + "label":"Y", + "x":8, + "y":0 + }, + { + "label":"U", + "x":9, + "y":0 + }, + { + "label":"I", + "x":10, + "y":0 + }, + { + "label":"O", + "x":11, + "y":0 + }, + { + "label":"P", + "x":12, + "y":0 + }, + { + "label":"Back Space", + "x":13, + "y":0 + }, + { + "label":"Esc", + "x":0, + "y":1 + }, + { + "label":"A", + "x":1, + "y":1 + }, + { + "label":"S", + "x":2, + "y":1 + }, + { + "label":"D", + "x":3, + "y":1 + }, + { + "label":"F", + "x":4, + "y":1 + }, + { + "label":"G", + "x":5, + "y":1 + }, + { + "label":"H", + "x":8, + "y":1 + }, + { + "label":"J", + "x":9, + "y":1 + }, + { + "label":"K", + "x":10, + "y":1 + }, + { + "label":"L", + "x":11, + "y":1 + }, + { + "label":";", + "x":12, + "y":1 + }, + { + "label":"'", + "x":13, + "y":1 + }, + { + "label":"Shift", + "x":0, + "y":2 + }, + { + "label":"Z", + "x":1, + "y":2 + }, + { + "label":"X", + "x":2, + "y":2 + }, + { + "label":"C", + "x":3, + "y":2 + }, + { + "label":"V", + "x":4, + "y":2 + }, + { + "label":"B", + "x":5, + "y":2 + }, + { + "label":"N", + "x":8, + "y":2 + }, + { + "label":"M", + "x":9, + "y":2 + }, + { + "label":",", + "x":10, + "y":2 + }, + { + "label":".", + "x":11, + "y":2 + }, + { + "label":"/", + "x":12, + "y":2 + }, + { + "label":"Enter", + "x":13, + "y":2 + }, + { + "label":"Adjust", + "x":1, + "y":3 + }, + { + "label":"Ctrl", + "x":2, + "y":3 + }, + { + "label":"Alt", + "x":3, + "y":3 + }, + { + "label":"GUI", + "x":4, + "y":3 + }, + { + "label":"⇓", + "x":5, + "y":3 + }, + { + "x":6, + "y":3 + }, + { + "x":7, + "y":3 + }, + { + "label":"⇑", + "x":8, + "y":3 + }, + { + "label":"←", + "x":9, + "y":3 + }, + { + "label":"↓", + "x":10, + "y":3 + }, + { + "label":"↑", + "x":11, + "y":3 + }, + { + "label":"→", + "x":12, + "y":3 + } + ] + } + } +} \ No newline at end of file diff --git a/keyboards/naked48/keymaps/default/config.h b/keyboards/naked48/keymaps/default/config.h new file mode 100644 index 00000000000..ad417f7f026 --- /dev/null +++ b/keyboards/naked48/keymaps/default/config.h @@ -0,0 +1,41 @@ +/* Copyright 2018 Salicylic_acid3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 180 + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif \ No newline at end of file diff --git a/keyboards/naked48/keymaps/default/keymap.c b/keyboards/naked48/keymaps/default/keymap.c new file mode 100644 index 00000000000..3229f74ecaf --- /dev/null +++ b/keyboards/naked48/keymaps/default/keymap.c @@ -0,0 +1,135 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + RGBRST +}; + +// Layer Mode aliases +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_SNUBS S(KC_NUBS) +#define KC_SNUHS S(KC_NUHS) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + //,-----------------------------------------------------| |-----------------------------------------------------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + ADJUST,KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT + //`------------------------------------------------------------------------------------------------------------' + ), + + + [_LOWER] = LAYOUT( + //,-----------------------------------------------------| |-----------------------------------------------------. + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR,KC_LPRN, KC_RPRN, KC_DEL, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _____, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,KC_SNUHS,KC_SNUBS, _____, _____, _____, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, _____, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + //`------------------------------------------------------------------------------------------------------------' + ), + + + [_RAISE] = LAYOUT( + //,-----------------------------------------------------| |-----------------------------------------------------. + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _____, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _____, _____, _____, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ), + + + [_ADJUST] = LAYOUT( /* Base */ + //,-----------------------------------------------------| |-----------------------------------------------------. + _____, RESET, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, _____, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, RGB_TOG, RGB_MOD, XXXXX,LCA(KC_DEL),LALT(KC_PSCR),KC_PSCR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ) +}; + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/naked48/keymaps/default/readme.md b/keyboards/naked48/keymaps/default/readme.md new file mode 100644 index 00000000000..431a57340ef --- /dev/null +++ b/keyboards/naked48/keymaps/default/readme.md @@ -0,0 +1,45 @@ +# The default keymap for naked48 + +Default + //,-----------------------------------------| |-----------------------------------------. + TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + ESC, A, S, D, F, G, H, J, K, L, ;, :, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, Z, X, C, V, B, N, M, ,, ., /, ENT, + //|------+------+------+------+------+------|------+------+------+------+------+------+------| + ADJUST, LCTRL, LALT, LGUI, LOWER, SPC, SPC, RAISE, LEFT, DOWN, UP, RIGHT + //`----------------------------------------------------------------------------------' + +Lower + //,-----------------------------------------| |-----------------------------------------. + ~, !, @, #, $, %, ^, &, *, (, ), DEL, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + DEL, F1, F2, F3, F4, F5, F6, _, +, {, }, |, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, F7, F8, F9, F10, F11, F12, ~, |, ,, ., ENT, + //|------+------+------+------+------+------|------+------+------+------+------+------+------| + ADJUST, LCTRL, LALT, LGUI, LOWER, SPC, SPC, RAISE, MNXT, VOLD, VOLU, MPLY + //`----------------------------------------------------------------------------------' + +Raise + //,-----------------------------------------| |-----------------------------------------. + ~, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + DEL, F1, F2, F3, F4, F5, F6, -, =, [, ], BSLS, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, F7, F8, F9, F10, F11, F12, #, \, ,, ., ENT, + //|------+------+------+------+------+------|------+------+------+------+------+------+------| + ADJUST, LCTRL, LALT, LGUI, LOWER, SPC, SPC, RAISE, MNXT, VOLD, VOLU, MPLY + //`----------------------------------------------------------------------------------' + +Adjust + //,-----------------------------------------| |----------------------------------------------. + ~, RST, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, DEL, + //|------+------+------+------+------+------| |------+-------+-------+-------+-------+-------| + DEL, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, LED ON/Off,LED MOD, XXXXX, C+A+D,Alt+PSCR, PSCR, + //|------+------+------+------+------+------| |------+-------+-------+-------+-------+-------| + LSFT, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, LED VAD,LED VAI,LED HUD,LED HUI,LED SAD,LED SAI, + //|------+------+------+------+------+------|------+------+------+-------+-------+-------+-------+-------| + ADJUST, LCTRL, LALT, LGUI, LOWER, SPC, SPC, RAISE, MNXT, VOLD, VOLU, MPLY + //`--------------------------------------------------------------------------------------' \ No newline at end of file diff --git a/keyboards/naked48/keymaps/default/rules.mk b/keyboards/naked48/keymaps/default/rules.mk new file mode 100644 index 00000000000..ee538432e90 --- /dev/null +++ b/keyboards/naked48/keymaps/default/rules.mk @@ -0,0 +1,29 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# If your custom naked48 pcb, you can rewrite to yes. +LED_ANIMATIONS = yes # LED animations + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/naked48/keymaps/default_with_nafuda/config.h b/keyboards/naked48/keymaps/default_with_nafuda/config.h new file mode 100644 index 00000000000..a55856b2403 --- /dev/null +++ b/keyboards/naked48/keymaps/default_with_nafuda/config.h @@ -0,0 +1,64 @@ +/* Copyright 2018 Salicylic_acid3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 180 + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + +#define MK_3_SPEED + +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 0 + +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 150 + +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 3 + +#undef MOUSEKEY_MOVE_DELTA +#define MOUSEKEY_MOVE_DELTA 5 + +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 0 + +#undef MOUSEKEY_WHEEL_MAX_SPEED +#define MOUSEKEY_WHEEL_MAX_SPEED 1 + +#undef MOUSEKEY_WHEEL_TIME_TO_MAX +#define MOUSEKEY_WHEEL_TIME_TO_MAX 0 diff --git a/keyboards/naked48/keymaps/default_with_nafuda/keymap.c b/keyboards/naked48/keymaps/default_with_nafuda/keymap.c new file mode 100644 index 00000000000..c1a9056a98a --- /dev/null +++ b/keyboards/naked48/keymaps/default_with_nafuda/keymap.c @@ -0,0 +1,173 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _MOUSE, + _BROWSER, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + MOUSE = SAFE_RANGE, + BROWSER, + LOWER, + RAISE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_CAD LCA(KC_DEL) +#define KC_APSCR LALT(KC_PSCR) + +#define KC_SNUBS S(KC_NUBS) +#define KC_SNUHS S(KC_NUHS) + +#define KC_RTAB LCTL(KC_TAB) +#define KC_LTAB LCTL(LSFT(KC_TAB)) +#define KC_CTAB LCTL(KC_W) +#define KC_RETAB LCTL(LSFT(KC_T)) + +#define KC_TGMO TG(_MOUSE) +#define KC_TGBR TG(_BROWSER) +#define KC_BSAD LT(_ADJUST, KC_BSPC) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TGMO, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSAD, KC_UP, KC_TGBR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_LEFT, KC_DOWN,KC_RIGHT, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + ADJUST,KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT + //`------------------------------------------------------------------------------------------------------------' + ), + + [_MOUSE] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TGMO, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BTN1, KC_MS_U, KC_BTN2, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_MS_L, KC_MS_D, KC_MS_R, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + ADJUST,KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT + //`------------------------------------------------------------------------------------------------------------' + ), + + [_BROWSER] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_CTAB, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_RETAB, KC_WH_U, KC_TGBR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_LTAB, KC_WH_D, KC_RTAB, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + ADJUST,KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT + //`------------------------------------------------------------------------------------------------------------' + ), + + [_LOWER] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR,KC_LPRN, KC_RPRN, KC_DEL, KC_TGMO, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_BSAD, KC_UP, KC_TGBR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + _____, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,KC_SNUHS,KC_SNUBS, _____, _____, _____, KC_LEFT, KC_DOWN,KC_RIGHT, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + _____, _____, _____, _____, _____, _____, _____, _____, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + //`------------------------------------------------------------------------------------------------------------' + ), + + [_RAISE] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_TGMO, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_BSAD, KC_UP, KC_TGBR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + _____, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _____, _____, _____, KC_LEFT, KC_DOWN,KC_RIGHT, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ), + + [_ADJUST] = LAYOUT_with_nafuda( /* Base */ + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + _____, RESET, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, _____, RGB_VAD, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, RGB_TOG, RGB_MOD, XXXXX,LCA(KC_DEL),LALT(KC_PSCR),KC_PSCR, ADJUST, RGB_SAD, RGB_VAI, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + _____, _____, _____, _____, _____, _____, RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_MOD, RGB_TOG, RGB_SAI, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ) +}; + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/naked48/keymaps/default_with_nafuda/readme.md b/keyboards/naked48/keymaps/default_with_nafuda/readme.md new file mode 100644 index 00000000000..780481be2e2 --- /dev/null +++ b/keyboards/naked48/keymaps/default_with_nafuda/readme.md @@ -0,0 +1,39 @@ +# The default_with_nafuda keymap for naked48 + +Add Nafuda maps to the default layout. + +Default + //|--------------------| + Mouse, + //|------+------+------| + BS + Ad, UP,Browser, + //|------+------+------| + LEFT, DOWN, RIGHT + //|--------------------| + +Mouse + //|--------------------| + Default, + //|------+------+------| + BTN1, MS_U, BTN2, + //|------+------+------| + MS_L, MS_D, MS_R + //|--------------------| + +Browser + //|--------------------| + CloseTAB, + //|------+------+------| + ReOpenTAB, WH_U,Default, + //|------+------+------| + LTAB, WH_D, RTAB + //|--------------------| + +Adjust + //|------------------------| + LED VAD, + //|------+----------+------| + Default, LED HUD,LED VAI, + //|------+----------+------| + LED MOD,LED ON/Off,LED HUI + //|------------------------| diff --git a/keyboards/naked48/keymaps/default_with_nafuda/rules.mk b/keyboards/naked48/keymaps/default_with_nafuda/rules.mk new file mode 100644 index 00000000000..dd471767a7f --- /dev/null +++ b/keyboards/naked48/keymaps/default_with_nafuda/rules.mk @@ -0,0 +1,29 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# If your custom naked48 pcb, you can rewrite to yes. +LED_ANIMATIONS = yes # LED animations + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/naked48/keymaps/default_with_setta21/config.h b/keyboards/naked48/keymaps/default_with_setta21/config.h new file mode 100644 index 00000000000..ad417f7f026 --- /dev/null +++ b/keyboards/naked48/keymaps/default_with_setta21/config.h @@ -0,0 +1,41 @@ +/* Copyright 2018 Salicylic_acid3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 180 + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif \ No newline at end of file diff --git a/keyboards/naked48/keymaps/default_with_setta21/keymap.c b/keyboards/naked48/keymaps/default_with_setta21/keymap.c new file mode 100644 index 00000000000..32d56a508d4 --- /dev/null +++ b/keyboards/naked48/keymaps/default_with_setta21/keymap.c @@ -0,0 +1,174 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + KANJI, + RGBRST, + SEND_SUM, + SEND_AVERAGE, + SEND_COUNTIF, + SEND_MAX, + SEND_MIN +}; + +// Fillers to make layering more clear +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_SNUBS S(KC_NUBS) +#define KC_SNUHS S(KC_NUHS) + +#define KC_SSUM SEND_SUM +#define KC_SAVE SEND_AVERAGE +#define KC_SCOU SEND_COUNTIF +#define KC_SMAX SEND_MAX +#define KC_SMIN SEND_MIN + +#define KC_RADO LT(_RAISE, KC_PDOT) +#define KC_LOP0 LT(_LOWER, KC_P0) +#define KC_ADNL LT(_ADJUST, KC_NLCK) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_with_setta21( + //,-----------------------------------------------------| |-----------------------------------------------------. |-----------------------------------------------| + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_LOP0, KC_P1, KC_P4, KC_P7,KC_ADNL, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_P2, KC_P5, KC_P8,KC_PSLS, KC_F2, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_RADO, KC_P3, KC_P6, KC_P9,KC_PAST, KC_EQL, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |---------------+---------------+-------+-------| + ADJUST,KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, KC_PENT, KC_PPLS,KC_PMNS, KC_DEL + //`------------------------------------------------------------------------------------------------------------' |-----------------------------------------------| + ), + + [_LOWER] = LAYOUT_with_setta21( + //,-----------------------------------------------------| |-----------------------------------------------------. |-----------------------------------------------| + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR,KC_LPRN, KC_RPRN, KC_DEL, LOWER, XXXXX,KC_LEFT, XXXXX, XXXXX, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_DOWN,KC_DOWN, KC_UP,KC_PSLS, KC_F2, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + _____, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,KC_SNUHS,KC_SNUBS, _____, _____, _____, RAISE, XXXXX,KC_RIGHT, XXXXX,KC_PAST, KC_EQL, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |---------------+---------------+-------+-------| + _____, _____, _____, _____, _____, _____, _____, _____, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, KC_PENT, KC_PPLS,KC_PMNS, KC_DEL + //`------------------------------------------------------------------------------------------------------------' |-----------------------------------------------| + ), + + + [_RAISE] = LAYOUT_with_setta21( + //,-----------------------------------------------------| |-----------------------------------------------------. |-----------------------------------------------| + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, LOWER, KC_F11, KC_F4, KC_F7,KC_SMIN, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_F12, KC_F5, KC_F8,KC_SMAX, KC_F2, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + _____, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _____, _____, _____, RAISE, KC_F3, KC_F6, KC_F9,KC_SCOU, KC_EQL, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |---------------+---------------+-------+-------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_RPRN, KC_SSUM,KC_SAVE, KC_DEL + //`------------------------------------------------------------------------------------------------------------' |-----------------------------------------------| + ), + + [_ADJUST] = LAYOUT_with_setta21( /* Base */ + //,-----------------------------------------------------| |-----------------------------------------------------. |-----------------------------------------------| + _____, RESET, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, _____, LOWER,RGB_VAD,RGB_HUD,RGB_SAD, ADJUST,RGB_TOG, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, RGB_TOG, RGB_MOD, XXXXX,LCA(KC_DEL),LALT(KC_PSCR),KC_PSCR, RGB_VAI,RGB_HUI,RGB_SAI, XXXXX, _____, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RAISE, XXXXX, XXXXX, XXXXX, XXXXX, _____, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |---------------+---------------+-------+-------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, RGB_MOD, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' |-----------------------------------------------| + ) +}; + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case SEND_SUM: + if (record->event.pressed) { + SEND_STRING("=SUM("); + } + break; + case SEND_AVERAGE: + if (record->event.pressed) { + SEND_STRING("=AVERAGE("); + } + break; + case SEND_COUNTIF: + if (record->event.pressed) { + SEND_STRING("=COUNTIF("); + } + break; + case SEND_MAX: + if (record->event.pressed) { + SEND_STRING("=MAX("); + } + break; + case SEND_MIN: + if (record->event.pressed) { + SEND_STRING("=MIN("); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/naked48/keymaps/default_with_setta21/readme.md b/keyboards/naked48/keymaps/default_with_setta21/readme.md new file mode 100644 index 00000000000..921c1e49500 --- /dev/null +++ b/keyboards/naked48/keymaps/default_with_setta21/readme.md @@ -0,0 +1,47 @@ +# The default_with_setta21 keymap for naked48 + +Add Setta21 maps to the default layout. + +Default + //|-----------------------------------------| + Rai+0, 1, 4, 7,Ad+Num, ESC, + //|------+------+------+------+------+------| + 2, 5, 8, /, F2, + //|------+------+------+------+------+------| + Low+., 3, 6, 9, *, =, + //|-------------+-------------+------+------| + ENT, +, -, DEL + //|-----------------------------------------| + +Lower + //|-----------------------------------------| + RAISE, F11, F4, F7, "=MIN(", ESC, + //|------+------+------+------+-----------+------| + F12, F5, F8, "=MAX(", F2, + //|------+------+------+------+-----------+------| + LOWER, F3, F6, F9,"=COUNTIF(", =, + //|-------------+-------------+-----------+------| + ), "=SUM(","=AVERAGE(", DEL + //|-----------------------------------------| + +Raise + //|-----------------------------------------| + RAISE, XXXXX, LEFT, XXXXX, XXXXX, ESC, + //|------+------+------+------+------+------| + DOWN, DOWN, UP, /, F2, + //|------+------+------+------+------+------| + LOWER, XXXXX, RIGHT, XXXXX, *, =, + //|-------------+-------------+------+------| + ENT, +, -, DEL + //|-----------------------------------------| + +Adjust + //|------------------------------------------------| + LED ON/Off,LED VAD,LED HUD,LED SAD, ADJUST, ESC, + //|--------+-------+-------+-------+-------+-------| + LED VAI,LED HUI,LED SAI, XXXXX, F2, + //|--------+-------+-------+-------+-------+-------| + XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, =, + //|----------------+---------------+-------+-------| + LED MOD, +, -, DEL + //|------------------------------------------------| diff --git a/keyboards/naked48/keymaps/default_with_setta21/rules.mk b/keyboards/naked48/keymaps/default_with_setta21/rules.mk new file mode 100644 index 00000000000..ee538432e90 --- /dev/null +++ b/keyboards/naked48/keymaps/default_with_setta21/rules.mk @@ -0,0 +1,29 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# If your custom naked48 pcb, you can rewrite to yes. +LED_ANIMATIONS = yes # LED animations + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/naked48/keymaps/salicylic/config.h b/keyboards/naked48/keymaps/salicylic/config.h new file mode 100644 index 00000000000..ad417f7f026 --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic/config.h @@ -0,0 +1,41 @@ +/* Copyright 2018 Salicylic_acid3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 180 + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif \ No newline at end of file diff --git a/keyboards/naked48/keymaps/salicylic/keymap.c b/keyboards/naked48/keymaps/salicylic/keymap.c new file mode 100644 index 00000000000..99c95cb0215 --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic/keymap.c @@ -0,0 +1,149 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + KANJI, + RGBRST +}; + +// Fillers to make layering more clear +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_CT11 LCTL_T(KC_F11) +#define KC_SF12 SFT_T(KC_F12) +#define KC_LOEN LT(_LOWER, KC_ENT) +#define KC_RASP LT(_RAISE, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + //,-----------------------------------------------------| |-----------------------------------------------------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_LBRC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_MINS, JP_RBRC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM, JP_DOT, JP_SLSH, JP_BSLS, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_LEFT,KC_RIGHT, KC_LGUI, KC_MHEN, KC_LOEN, KC_BSPC, KC_DEL, KC_RASP, KC_HENK, KC_LALT, KC_DOWN, KC_UP + //`------------------------------------------------------------------------------------------------------------' + ), + + + [_LOWER] = LAYOUT( + //,-----------------------------------------------------| |-----------------------------------------------------. + KC_ESC, JP_EXLM, JP_QUES, JP_LBRC, JP_RBRC, JP_TILD, KC_6, KC_7, KC_8, KC_9, JP_ASTR, JP_SLSH, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + JP_QUOT, JP_HASH, JP_DQT, JP_LPRN, JP_RPRN, JP_AT, XXXXX, KC_4, KC_5, KC_6, JP_MINS, JP_EQL, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + JP_CIRC, JP_PERC, JP_AMPR, JP_SCLN, JP_COLN, JP_PIPE, KC_0, KC_1, KC_2, KC_3, JP_PLUS, KC_ENT, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, KC_ZKHK, LOWER, _____, _____, RAISE, KC_0, JP_DOT, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ), + + + [_RAISE] = LAYOUT( + //,-----------------------------------------------------| |-----------------------------------------------------. + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, XXXXX, KC_UP, XXXXX, KC_PGUP, KC_DEL, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_CT11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXX, KC_LEFT, KC_DOWN,KC_RIGHT, KC_LSFT, KC_ENT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_SF12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, XXXXX, XXXXX, KC_PGDN, XXXXX, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ), + + [_ADJUST] = LAYOUT( /* Base */ + //,-----------------------------------------------------| |-----------------------------------------------------. + _____, _____, _____, _____, _____, _____, _____, KC_7, KC_8, KC_9, KC_0, _____, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, RGB_TOG, RGB_MOD, XXXXX,LCA(KC_DEL),LALT(KC_PSCR),KC_PSCR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ) +}; + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/naked48/keymaps/salicylic/readme.md b/keyboards/naked48/keymaps/salicylic/readme.md new file mode 100644 index 00000000000..cd5e6e7296f --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic/readme.md @@ -0,0 +1,46 @@ +# The salicylic keymap for naked48 + +Default + //,-----------------------------------------| |-----------------------------------------. + TAB, Q, W, E, R, T, Y, U, I, O, P, [, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LSFT, A, S, D, F, G, H, J, K, L, -, ], + //|------+------+------+------+------+------| |------+------+------+------+------+------| + LCTRL, Z, X, C, V, B, N, M, ,, ., /, \, + //|------+------+------+------+------+-------|------+-----+-------+-----+------+------+------| + LEFT, RIGHT, LGUI, MHEN,Low+Ent, BSPC, DEL,Rai+SPC, HENK, LALT, UP, DOWN + //`----------------------------------------------------------------------------------' + +Lower + //,-----------------------------------------| |-----------------------------------------. + ESC, EXLM, JQUES, JLBRC, JRBRC, JTILD, 6, 7, 8, 9, *, /, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + JQUOT, HASH, JDQUO, JLPRN, JRPRN, JAT, XXXXX, 4, 5, 6, -, =, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + JHAT, PERC, JAMPR, SCLN, JCLON, JPIPE, 0, 1, 2, 3, +, ENT, + //|------+------+------+------+------+------|------+------+------+------+------+------+------| + LEFT, RIGHT, LGUI, ZKHK, LOWER, BSPC, DEL, RAISE, 0, DOT, UP, DOWN + //`----------------------------------------------------------------------------------' + +Raise + //,-----------------------------------------| |-----------------------------------------. + ESC, 1, 2, 3, 4, 5, 6, XXXXX, UP, XXXXX, PGUP, BSPC, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + Ctrl F11, F1, F2, F3, F4, F5, XXXXX, LEFT, DOWN, RIGHT, LSFT, ENT, + //|------+------+------+------+------+------| |------+------+------+------+------+------| + Shift F12, F6, F7, F8, F9, F10, XXXXX, XXXXX, XXXXX, XXXXX, PGDN, XXXXX, + //|------+------+------+------+------+------|------+------+------+------+------+------+------| + LEFT, RIGHT, LGUI, ZKHK, LOWER, BSPC, DEL, RAISE, 0, DOT, UP, DOWN + //`----------------------------------------------------------------------------------' + +Adjust + //,-----------------------------------------| |----------------------------------------------. + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, + //|------+------+------+------+------+------| |------+-------+-------+-------+-------+-------| + Ctrl F11, F1, F2, F3, F4, F5, LED ON/Off,LED MOD, XXXXX, C+A+D,Alt+PSCR, PSCR, + //|------+------+------+------+------+------| |------+-------+-------+-------+-------+-------| + Shift F12, F6, F7, F8, F9, F10, LED VAD,LED VAI,LED HUD,LED HUI,LED SAD,LED SAI, + //|------+------+------+------+------+------|------+------+------+-------+-------+-------+-------| + LEFT, RIGHT, LGUI, ZKHK, LOWER, BSPC, DEL, RAISE, 0, DOT, UP, DOWN + //`--------------------------------------------------------------------------------------' + ) \ No newline at end of file diff --git a/keyboards/naked48/keymaps/salicylic/rules.mk b/keyboards/naked48/keymaps/salicylic/rules.mk new file mode 100644 index 00000000000..ee538432e90 --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic/rules.mk @@ -0,0 +1,29 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# If your custom naked48 pcb, you can rewrite to yes. +LED_ANIMATIONS = yes # LED animations + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/naked48/keymaps/salicylic_with_nafuda/config.h b/keyboards/naked48/keymaps/salicylic_with_nafuda/config.h new file mode 100644 index 00000000000..a55856b2403 --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic_with_nafuda/config.h @@ -0,0 +1,64 @@ +/* Copyright 2018 Salicylic_acid3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 180 + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + +#define MK_3_SPEED + +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 0 + +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 150 + +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 3 + +#undef MOUSEKEY_MOVE_DELTA +#define MOUSEKEY_MOVE_DELTA 5 + +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 0 + +#undef MOUSEKEY_WHEEL_MAX_SPEED +#define MOUSEKEY_WHEEL_MAX_SPEED 1 + +#undef MOUSEKEY_WHEEL_TIME_TO_MAX +#define MOUSEKEY_WHEEL_TIME_TO_MAX 0 diff --git a/keyboards/naked48/keymaps/salicylic_with_nafuda/keymap.c b/keyboards/naked48/keymaps/salicylic_with_nafuda/keymap.c new file mode 100644 index 00000000000..1551b82631b --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic_with_nafuda/keymap.c @@ -0,0 +1,188 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _MOUSE, + _BROWSER, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + MOUSE = SAFE_RANGE, + BROWSER, + LOWER, + RAISE, + ADJUST, + KANJI, + RGBRST +}; + +// Fillers to make layering more clear +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_CT11 LCTL_T(KC_F11) +#define KC_SF12 SFT_T(KC_F12) + +#define KC_LOEN LT(_LOWER, KC_ENT) +#define KC_RASP LT(_RAISE, KC_SPC) +#define KC_CAD LCA(KC_DEL) +#define KC_APSCR LALT(KC_PSCR) + +#define KC_RTAB LCTL(KC_TAB) +#define KC_LTAB LCTL(LSFT(KC_TAB)) +#define KC_CTAB LCTL(KC_W) +#define KC_RETAB LCTL(LSFT(KC_T)) + +#define KC_TGMO TG(_MOUSE) +#define KC_TGBR TG(_BROWSER) +#define KC_BSAD LT(_ADJUST, KC_BSPC) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_LBRC, KC_TGMO, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_MINS, JP_RBRC, KC_BSAD, KC_UP, KC_TGBR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM, JP_DOT, JP_SLSH, JP_BSLS, KC_LEFT, KC_DOWN,KC_RIGHT, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + KC_LEFT,KC_RIGHT, KC_LGUI, KC_MHEN, KC_LOEN, KC_BSPC, KC_DEL, KC_RASP, KC_HENK, KC_LALT, KC_DOWN, KC_UP + //`------------------------------------------------------------------------------------------------------------' + ), + + [_MOUSE] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_LBRC, KC_TGMO, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_MINS, JP_RBRC, KC_BTN1, KC_MS_U, KC_BTN2, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM, JP_DOT, JP_SLSH, JP_BSLS, KC_MS_L, KC_MS_D, KC_MS_R, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + KC_LEFT,KC_RIGHT, KC_LGUI, KC_MHEN, KC_LOEN, KC_BSPC, KC_DEL, KC_RASP, KC_HENK, KC_LALT, KC_DOWN, KC_UP + //`------------------------------------------------------------------------------------------------------------' + ), + + [_BROWSER] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_LBRC, KC_CTAB, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_MINS, JP_RBRC, KC_RETAB, KC_WH_U, KC_TGBR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM, JP_DOT, JP_SLSH, JP_BSLS, KC_LTAB, KC_WH_D, KC_RTAB, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + KC_LEFT,KC_RIGHT, KC_LGUI, KC_MHEN, KC_LOEN, KC_BSPC, KC_DEL, KC_RASP, KC_HENK, KC_LALT, KC_DOWN, KC_UP + //`------------------------------------------------------------------------------------------------------------' + ), + + [_LOWER] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_ESC, JP_EXLM, JP_QUES, JP_LBRC, JP_RBRC, JP_TILD, KC_6, KC_7, KC_8, KC_9, JP_ASTR, JP_SLSH, KC_TGMO, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + JP_QUOT, JP_HASH, JP_DQT, JP_LPRN, JP_RPRN, JP_AT, XXXXX, KC_4, KC_5, KC_6, JP_MINS, JP_EQL, KC_BSAD, KC_UP, KC_TGBR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + JP_CIRC, JP_PERC, JP_AMPR, JP_SCLN, JP_COLN, JP_PIPE, KC_0, KC_1, KC_2, KC_3, JP_PLUS, KC_ENT, KC_LEFT, KC_DOWN,KC_RIGHT, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + _____, _____, _____, KC_ZKHK, LOWER, _____, _____, RAISE, KC_0, JP_DOT, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ), + + [_RAISE] = LAYOUT_with_nafuda( + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + KC_ESC, JP_EXLM, JP_QUES, JP_LBRC, JP_RBRC, JP_TILD, KC_6, KC_7, KC_8, KC_9, JP_ASTR, JP_SLSH, KC_TGMO, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_CT11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXX, KC_LEFT, KC_DOWN,KC_RIGHT, KC_LSFT, KC_ENT, KC_BSAD, KC_UP, KC_TGBR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + KC_SF12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, XXXXX, XXXXX, KC_PGDN, XXXXX, KC_LEFT, KC_DOWN,KC_RIGHT, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ), + + [_ADJUST] = LAYOUT_with_nafuda( /* Base */ + //,-----------------------------------------------------| |-----------------------------------------------------. |--------------------------| + _____, _____, _____, _____, _____, _____, _____, KC_7, KC_8, KC_9, KC_0, _____, RGB_VAD, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + _____, _____, _____, _____, _____, _____, RGB_TOG, RGB_MOD, XXXXX,LCA(KC_DEL),LALT(KC_PSCR),KC_PSCR, ADJUST, RGB_SAD, RGB_VAI, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |--------+--------+--------| + _____, _____, _____, _____, _____, _____, RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_MOD, RGB_TOG, RGB_SAI, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------------------------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' + ) +}; + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/naked48/keymaps/salicylic_with_nafuda/readme.md b/keyboards/naked48/keymaps/salicylic_with_nafuda/readme.md new file mode 100644 index 00000000000..2f9f3802df0 --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic_with_nafuda/readme.md @@ -0,0 +1,39 @@ +# The salicylic_with_nafuda keymap for naked48 + +Add Nafuda maps to the salicylic layout. + +Default + //|--------------------| + Mouse, + //|------+------+------| + BS + Ad, UP,Browser, + //|------+------+------| + LEFT, DOWN, RIGHT + //|--------------------| + +Mouse + //|--------------------| + Default, + //|------+------+------| + BTN1, MS_U, BTN2, + //|------+------+------| + MS_L, MS_D, MS_R + //|--------------------| + +Browser + //|--------------------| + CloseTAB, + //|------+------+------| + ReOpenTAB, WH_U,Default, + //|------+------+------| + LTAB, WH_D, RTAB + //|--------------------| + +Adjust + //|------------------------| + LED VAD, + //|------+----------+------| + Default, LED HUD,LED VAI, + //|------+----------+------| + LED MOD,LED ON/Off,LED HUI + //|------------------------| diff --git a/keyboards/naked48/keymaps/salicylic_with_nafuda/rules.mk b/keyboards/naked48/keymaps/salicylic_with_nafuda/rules.mk new file mode 100644 index 00000000000..dd471767a7f --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic_with_nafuda/rules.mk @@ -0,0 +1,29 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# If your custom naked48 pcb, you can rewrite to yes. +LED_ANIMATIONS = yes # LED animations + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/naked48/keymaps/salicylic_with_setta21/config.h b/keyboards/naked48/keymaps/salicylic_with_setta21/config.h new file mode 100644 index 00000000000..ad417f7f026 --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic_with_setta21/config.h @@ -0,0 +1,41 @@ +/* Copyright 2018 Salicylic_acid3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 180 + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif \ No newline at end of file diff --git a/keyboards/naked48/keymaps/salicylic_with_setta21/keymap.c b/keyboards/naked48/keymaps/salicylic_with_setta21/keymap.c new file mode 100644 index 00000000000..18293e63eae --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic_with_setta21/keymap.c @@ -0,0 +1,187 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + KANJI, + RGBRST, + SEND_SUM, + SEND_AVERAGE, + SEND_COUNTIF, + SEND_MAX, + SEND_MIN +}; + +// Fillers to make layering more clear +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_CT11 LCTL_T(KC_F11) +#define KC_SF12 SFT_T(KC_F12) +#define KC_LOEN LT(_LOWER, KC_ENT) +#define KC_RASP LT(_RAISE, KC_SPC) + +#define KC_SSUM SEND_SUM +#define KC_SAVE SEND_AVERAGE +#define KC_SCOU SEND_COUNTIF +#define KC_SMAX SEND_MAX +#define KC_SMIN SEND_MIN + +#define KC_RADO LT(_RAISE, KC_PDOT) +#define KC_LOP0 LT(_LOWER, KC_P0) +#define KC_ADNL LT(_ADJUST, KC_NLCK) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_with_setta21( + //,-----------------------------------------------------| |-----------------------------------------------------. |-----------------------------------------------| + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_LBRC, KC_LOP0, KC_P1, KC_P4, KC_P7,KC_ADNL, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_MINS, JP_RBRC, KC_P2, KC_P5, KC_P8,KC_PSLS, KC_F2, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM, JP_DOT, JP_SLSH, JP_BSLS, KC_RADO, KC_P3, KC_P6, KC_P9,KC_PAST, JP_EQL, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |---------------+---------------+-------+-------| + KC_LEFT,KC_RIGHT, KC_LGUI, KC_MHEN, KC_LOEN, KC_BSPC, KC_DEL, KC_RASP, KC_HENK, KC_LALT, KC_DOWN, KC_UP, KC_PENT, KC_PPLS,KC_PMNS, KC_DEL + //`------------------------------------------------------------------------------------------------------------' |-----------------------------------------------| + ), + + [_LOWER] = LAYOUT_with_setta21( + //,-----------------------------------------------------| |-----------------------------------------------------. |-----------------------------------------------| + KC_ESC, JP_EXLM, JP_QUES, JP_LBRC, JP_RBRC, JP_TILD, KC_6, KC_7, KC_8, KC_9, JP_ASTR, JP_SLSH, LOWER, XXXXX,KC_LEFT, XXXXX, XXXXX, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + JP_QUOT, JP_HASH, JP_DQT, JP_LPRN, JP_RPRN, JP_AT, XXXXX, KC_4, KC_5, KC_6, JP_MINS, JP_EQL, KC_DOWN,KC_DOWN, KC_UP,KC_PSLS, KC_F2, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + JP_CIRC, JP_PERC, JP_AMPR, JP_SCLN, JP_COLN, JP_PIPE, KC_0, KC_1, KC_2, KC_3, JP_PLUS, KC_ENT, RAISE, XXXXX,KC_RIGHT, XXXXX,KC_PAST, JP_EQL, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |---------------+---------------+-------+-------| + _____, _____, _____, KC_ZKHK, LOWER, _____, _____, RAISE, KC_0, JP_DOT, _____, _____, KC_PENT, KC_PPLS,KC_PMNS, KC_DEL + //`------------------------------------------------------------------------------------------------------------' |-----------------------------------------------| + ), + + [_RAISE] = LAYOUT_with_setta21( + //,-----------------------------------------------------| |-----------------------------------------------------. |-----------------------------------------------| + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, XXXXX, KC_UP, XXXXX, KC_PGUP, KC_DEL, LOWER, KC_F11, KC_F4, KC_F7,KC_SMIN, KC_ESC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + KC_CT11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXX, KC_LEFT, KC_DOWN,KC_RIGHT, KC_LSFT, KC_ENT, KC_F12, KC_F5, KC_F8,KC_SMAX, KC_F2, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + KC_SF12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, XXXXX, XXXXX, KC_PGDN, XXXXX, RAISE, KC_F3, KC_F6, KC_F9,KC_SCOU, JP_EQL, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |---------------+---------------+-------+-------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, JP_RPRN, KC_SSUM,KC_SAVE, KC_DEL + //`------------------------------------------------------------------------------------------------------------' |-----------------------------------------------| + ), + + [_ADJUST] = LAYOUT_with_setta21( /* Base */ + //,-----------------------------------------------------| |-----------------------------------------------------. |-----------------------------------------------| + _____, _____, _____, _____, _____, _____, _____, KC_7, KC_8, KC_9, KC_0, _____, LOWER,RGB_VAD,RGB_HUD,RGB_SAD, ADJUST,RGB_TOG, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + _____, _____, _____, _____, _____, _____, RGB_TOG, RGB_MOD, XXXXX,LCA(KC_DEL),LALT(KC_PSCR),KC_PSCR, RGB_VAI,RGB_HUI,RGB_SAI, XXXXX, _____, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| |-------+-------+-------+-------+-------+-------| + _____, _____, _____, _____, _____, _____, RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RAISE, XXXXX, XXXXX, XXXXX, XXXXX, _____, + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |---------------+---------------+-------+-------| + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, RGB_MOD, _____, _____, _____ + //`------------------------------------------------------------------------------------------------------------' |-----------------------------------------------| + ) +}; + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + case SEND_SUM: + if (record->event.pressed) { + SEND_STRING("_SUM*"); + } + break; + case SEND_AVERAGE: + if (record->event.pressed) { + SEND_STRING("_AVERAGE*"); + } + break; + case SEND_COUNTIF: + if (record->event.pressed) { + SEND_STRING("_COUNTIF*"); + } + break; + case SEND_MAX: + if (record->event.pressed) { + SEND_STRING("_MAX*"); + } + break; + case SEND_MIN: + if (record->event.pressed) { + SEND_STRING("_MIN*"); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/naked48/keymaps/salicylic_with_setta21/readme.md b/keyboards/naked48/keymaps/salicylic_with_setta21/readme.md new file mode 100644 index 00000000000..fa7ece5d9a2 --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic_with_setta21/readme.md @@ -0,0 +1,47 @@ +# The salicylic_with_setta21 keymap for naked48 + +Add Setta21 maps to the salicylic layout. + +Default + //|-----------------------------------------| + Rai+0, 1, 4, 7,Ad+Num, ESC, + //|------+------+------+------+------+------| + 2, 5, 8, /, F2, + //|------+------+------+------+------+------| + Low+., 3, 6, 9, *, =, + //|-------------+-------------+------+------| + ENT, +, -, DEL + //|-----------------------------------------| + +Lower + //|-----------------------------------------| + RAISE, F11, F4, F7, "=MIN(", ESC, + //|------+------+------+------+-----------+------| + F12, F5, F8, "=MAX(", F2, + //|------+------+------+------+-----------+------| + LOWER, F3, F6, F9,"=COUNTIF(", =, + //|-------------+-------------+-----------+------| + ), "=SUM(","=AVERAGE(", DEL + //|-----------------------------------------| + +Raise + //|-----------------------------------------| + RAISE, XXXXX, LEFT, XXXXX, XXXXX, ESC, + //|------+------+------+------+------+------| + DOWN, DOWN, UP, /, F2, + //|------+------+------+------+------+------| + LOWER, XXXXX, RIGHT, XXXXX, *, =, + //|-------------+-------------+------+------| + ENT, +, -, DEL + //|-----------------------------------------| + +Adjust + //|------------------------------------------------| + LED ON/Off,LED VAD,LED HUD,LED SAD, ADJUST, ESC, + //|--------+-------+-------+-------+-------+-------| + LED VAI,LED HUI,LED SAI, XXXXX, F2, + //|--------+-------+-------+-------+-------+-------| + XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, =, + //|----------------+---------------+-------+-------| + LED MOD, +, -, DEL + //|------------------------------------------------| diff --git a/keyboards/naked48/keymaps/salicylic_with_setta21/rules.mk b/keyboards/naked48/keymaps/salicylic_with_setta21/rules.mk new file mode 100644 index 00000000000..ee538432e90 --- /dev/null +++ b/keyboards/naked48/keymaps/salicylic_with_setta21/rules.mk @@ -0,0 +1,29 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# If your custom naked48 pcb, you can rewrite to yes. +LED_ANIMATIONS = yes # LED animations + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/naked48/naked48.c b/keyboards/naked48/naked48.c new file mode 100644 index 00000000000..dbb77f21d61 --- /dev/null +++ b/keyboards/naked48/naked48.c @@ -0,0 +1 @@ +#include "naked48.h" diff --git a/keyboards/naked48/naked48.h b/keyboards/naked48/naked48.h new file mode 100644 index 00000000000..891f9301ee9 --- /dev/null +++ b/keyboards/naked48/naked48.h @@ -0,0 +1,12 @@ +#pragma once + +#ifdef KEYBOARD_naked48_rev1 + #include "rev1.h" +#endif + +#include "quantum.h" + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif diff --git a/keyboards/naked48/readme.md b/keyboards/naked48/readme.md new file mode 100644 index 00000000000..a6946d9093f --- /dev/null +++ b/keyboards/naked48/readme.md @@ -0,0 +1,18 @@ +# naked48 + +![naked48](https://cdn-ak.f.st-hatena.com/images/fotolife/S/Salicylic_acid3/20190326/20190326015949.jpg) + +This is 48 keys modification Ortholinear keyboard. + +Keyboard Maintainer: [Salicylic_acid3](https://github.com/Salicylic-acid3) +Hardware Supported: The PCBs, controllers supported +Hardware Availability: links to where you can find this hardware + +Make example for this keyboard (after setting up your build environment): + + make naked48:default:avrdude + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +[Build guide](https://salicylic-acid3.hatenablog.com/entry/naked48led-build-guide) +[Firmware](https://github.com/Salicylic-acid3/qmk_firmware/tree/master/keyboards/naked48) diff --git a/keyboards/naked48/rev1/config.h b/keyboards/naked48/rev1/config.h new file mode 100644 index 00000000000..5d1c28d090b --- /dev/null +++ b/keyboards/naked48/rev1/config.h @@ -0,0 +1,121 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Salicylic_Acid +#define PRODUCT naked48 +#define DESCRIPTION Ortholinear 48 Keys Keyboard + +/* Use I2C or Serial */ +//#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// OLED support +// see ./rules.mk: OLED_ENABLE=yes or no +#ifdef OLED_ENABLE + #define SSD1306OLED +#endif + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 14 + +// Rows are doubled-up +#define MATRIX_ROW_PINS { D1, D0, D4, C6 } + +// wiring of each half +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, D7, E6, B4, B5 } +// #define MATRIX_COL_PINS { B5, B4, E6, D7, D6, B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +// naked48 keyboard RGB LED support +//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no +// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes +#define RGBLED_NUM 48 + +#ifndef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 180 + #define RGBLIGHT_VAL_STEP 17 +#else + #define RGBLIGHT_LIMIT_VAL 50 + #define RGBLIGHT_VAL_STEP 4 +#endif +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for naked48 keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/naked48/rev1/matrix.c b/keyboards/naked48/rev1/matrix.c new file mode 100644 index 00000000000..8685a8125e4 --- /dev/null +++ b/keyboards/naked48/rev1/matrix.c @@ -0,0 +1,357 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "split_scomm.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + TXLED0; + RXLED0; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(int master_changed) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else + int ret=serial_update_buffers(); +#endif + if (ret ) { + if(ret==2) RXLED1; + return 1; + } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, sizeof(serial_master_buffer)); + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + int mchanged = 1; + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction(mchanged) ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif + for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif + serial_slave_buffer[i] = matrix[offset+i]; + } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/naked48/rev1/rev1.c b/keyboards/naked48/rev1/rev1.c new file mode 100644 index 00000000000..b5f6532b2e6 --- /dev/null +++ b/keyboards/naked48/rev1/rev1.c @@ -0,0 +1,15 @@ +#include "naked48.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + matrix_init_user(); +}; + diff --git a/keyboards/naked48/rev1/rev1.h b/keyboards/naked48/rev1/rev1.h new file mode 100644 index 00000000000..45878dc5052 --- /dev/null +++ b/keyboards/naked48/rev1/rev1.h @@ -0,0 +1,88 @@ +#pragma once + +#include "naked48.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +//void promicro_bootloader_jmp(bool program); + +////////////////////////////////////////////////////////////////////////////// +// When only use Naked48. +////////////////////////////////////////////////////////////////////////////// +/* + * ,------------------------------------ ------------------------------------. + * | L00 | L01 | L02 | L03 | L04 | L05 | | L06 | L07 | L08 | L09 | L0A | L0B | + * |------------------------------------ ------------------------------------+ + * | L10 | L11 | L12 | L13 | L14 | L15 | | L16 | L17 | L18 | L19 | L1A | L1B | + * |------------------------------------ ------------------------------------+ + * | L20 | L21 | L22 | L23 | L24 | L25 | | L26 | L17 | L28 | L29 | L2A | L2B | + * |-----------------------------------------------------------------------------------+ + * | L30 | L32 | L33 | L34 | L35 | L36 | L37 | L38 | L39 | L3A | L3B | L3D | + * |-----------------------------------------------------------------------' + */ + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, L0A, L0B, \ + L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L1A, L1B, \ + L20, L21, L22, L23, L24, L25, L26, L27, L28, L29, L2A, L2B, \ + L30, L31, L32, L33, L34, L35, L36, L37, L38, L39, L3A, L3B \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, L0A, L0B }, \ + { L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L1A, L1B }, \ + { L20, L21, L22, L23, L24, L25, L26, L27, L28, L29, L2A, L2B }, \ + { L30, L31, L32, L33, L34, L35, L36, L37, L38, L39, L3A, L3B }, \ + {KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO }, \ + {KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO }, \ + {KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO }, \ + {KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO } \ + } + +////////////////////////////////////////////////////////////////////////////// +// When connecting Setta21 to Naked48. +////////////////////////////////////////////////////////////////////////////// + +#define LAYOUT_with_setta21( \ + L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, L0A, L0B, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L1A, L1B, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, L26, L27, L28, L29, L2A, L2B, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, L37, L38, L39, L3A, L3B, R30, R32, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, L0A, L0B,KC_NO,KC_NO }, \ + { L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L1A, L1B,KC_NO,KC_NO }, \ + { L20, L21, L22, L23, L24, L25, L26, L27, L28, L29, L2A, L2B,KC_NO,KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36, L37, L38, L39, L3A, L3B,KC_NO,KC_NO }, \ + { R00, R01, R02, R03, R04, R05,KC_NO,KC_NO,KC_NO, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25,KC_NO,KC_NO, R30,KC_NO, R32,KC_NO, R34, R35 }, \ + {KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO }, \ + {KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO } \ + } + +////////////////////////////////////////////////////////////////////////////// +// When connecting Nafuda to Naked48. +////////////////////////////////////////////////////////////////////////////// + +#define LAYOUT_with_nafuda( \ + L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, L0A, L0B, R01, \ + L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L1A, L1B, R10, R11, R12, \ + L20, L21, L22, L23, L24, L25, L26, L27, L28, L29, L2A, L2B, R20, R21, R22, \ + L30, L31, L32, L33, L34, L35, L36, L37, L38, L39, L3A, L3B \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, L0A, L0B,KC_NO,KC_NO }, \ + { L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L1A, L1B,KC_NO,KC_NO }, \ + { L20, L21, L22, L23, L24, L25, L26, L27, L28, L29, L2A, L2B,KC_NO,KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36, L37, L38, L39, L3A, L3B,KC_NO,KC_NO }, \ + {KC_NO, R01,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, R10, R11, R12,KC_NO,KC_NO,KC_NO }, \ + { R20, R21, R22,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO }, \ + {KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO }, \ + {KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO } \ + } + diff --git a/keyboards/naked48/rev1/rules.mk b/keyboards/naked48/rev1/rules.mk new file mode 100644 index 00000000000..a7118103338 --- /dev/null +++ b/keyboards/naked48/rev1/rules.mk @@ -0,0 +1,3 @@ +SRC += matrix.c \ + split_util.c \ + split_scomm.c diff --git a/keyboards/naked48/rev1/serial_config.h b/keyboards/naked48/rev1/serial_config.h new file mode 100644 index 00000000000..37135213d55 --- /dev/null +++ b/keyboards/naked48/rev1/serial_config.h @@ -0,0 +1,8 @@ +//// #error rev2 serial config + +#ifndef SOFT_SERIAL_PIN +/* Soft Serial defines */ +#define SOFT_SERIAL_PIN D2 + +#define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/naked48/rev1/serial_config_simpleapi.h b/keyboards/naked48/rev1/serial_config_simpleapi.h new file mode 100644 index 00000000000..e2d22a41e7b --- /dev/null +++ b/keyboards/naked48/rev1/serial_config_simpleapi.h @@ -0,0 +1,8 @@ +#ifndef SERIAL_CONFIG_SIMPLEAPI_H +#define SERIAL_CONFIG_SIMPLEAPI_H + +#undef SERIAL_USE_MULTI_TRANSACTION +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +#endif // SERIAL_CONFIG_SIMPLEAPI_H diff --git a/keyboards/naked48/rev1/split_scomm.c b/keyboards/naked48/rev1/split_scomm.c new file mode 100644 index 00000000000..ada7867960b --- /dev/null +++ b/keyboards/naked48/rev1/split_scomm.c @@ -0,0 +1,92 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include +#include +#include +#include +#include "serial.h" +#ifdef CONSOLE_ENABLE + #include +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status, smatstatus; + static int need_retry = 0; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3], + serial_slave_buffer[4] ); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; + } + return smatstatus; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/naked48/rev1/split_scomm.h b/keyboards/naked48/rev1/split_scomm.h new file mode 100644 index 00000000000..537ec408082 --- /dev/null +++ b/keyboards/naked48/rev1/split_scomm.h @@ -0,0 +1,22 @@ +#pragma once + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif + diff --git a/keyboards/naked48/rev1/split_util.c b/keyboards/naked48/rev1/split_util.c new file mode 100644 index 00000000000..e1ff8b4379d --- /dev/null +++ b/keyboards/naked48/rev1/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "split_scomm.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); diff --git a/keyboards/naked48/rules.mk b/keyboards/naked48/rules.mk new file mode 100644 index 00000000000..02a7d9ab2a0 --- /dev/null +++ b/keyboards/naked48/rules.mk @@ -0,0 +1,73 @@ +# SRC += i2c.c +QUANTUM_LIB_SRC += serial.c +# SRC += ssd1306.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SUBPROJECT_rev1 = no +USE_I2C = no +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = naked48/rev1 diff --git a/keyboards/naked48/serial.c b/keyboards/naked48/serial.c new file mode 100644 index 00000000000..6006ebf1bdb --- /dev/null +++ b/keyboards/naked48/serial.c @@ -0,0 +1,590 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include +#include "serial.h" +//#include + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ + int result; + result = soft_serial_transaction(); + return result; +} + +#endif // end of OLD API (compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static void serial_delay(void) ALWAYS_INLINE; +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; + } + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/naked48/serial.h b/keyboards/naked48/serial.h new file mode 100644 index 00000000000..5deaf789e30 --- /dev/null +++ b/keyboards/naked48/serial.h @@ -0,0 +1,86 @@ +#pragma once + +#include + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE OLD API (compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE NEW API +// //// USE simple API (using signle-type transaction function) +// #define SERIAL_USE_SINGLE_TRANSACTION +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + + +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + #endif + + void serial_master_init(void); + void serial_slave_init(void); + int serial_update_buffers(void); + +#endif // end of USE OLD API +//////////////////////////////////////////////////////////////////////////// + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif diff --git a/keyboards/namecard2x4/config.h b/keyboards/namecard2x4/config.h deleted file mode 100644 index d0c26193c4b..00000000000 --- a/keyboards/namecard2x4/config.h +++ /dev/null @@ -1,223 +0,0 @@ -/* -Copyright 2018 takashiski - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER takashiski -#define PRODUCT namecard2x4 -#define DESCRIPTION A custom keyboard - -/* key matrix size */ -#define MATRIX_ROWS 2 -#define MATRIX_COLS 4 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B4,B5 } -#define MATRIX_COL_PINS { E6,D7,C6,D4 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define RGB_DI_PIN F4 -#define RGBLED_NUM 4 -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 10 -#define RGBLIGHT_VAL_STEP 10 - -//#define BACKLIGHT_PIN F4 -//#define BACKLIGHT_BREATHING -//#define BACKLIGHT_LEVELS 1 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - diff --git a/keyboards/namecard2x4/keymaps/brainfuck/config.h b/keyboards/namecard2x4/keymaps/brainfuck/config.h new file mode 100644 index 00000000000..dbacdcce580 --- /dev/null +++ b/keyboards/namecard2x4/keymaps/brainfuck/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/namecard2x4/keymaps/brainfuck/keymap.c b/keyboards/namecard2x4/keymaps/brainfuck/keymap.c new file mode 100644 index 00000000000..287e011def4 --- /dev/null +++ b/keyboards/namecard2x4/keymaps/brainfuck/keymap.c @@ -0,0 +1,59 @@ +/* Copyright 2018 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +enum Layer +{ + JP, + EN, + CONFIG +}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[JP] = LAYOUT( + JP_LT,JP_GT,JP_PLUS,JP_MINS,\ + LT(CONFIG,JP_DOT),JP_COMM,JP_LBRC,LT(CONFIG,JP_RBRC)\ + ), +[EN] = LAYOUT( + KC_LT,KC_GT,KC_PLUS,KC_MINS,\ + LT(CONFIG,KC_DOT),KC_COMM,KC_LBRC,LT(CONFIG,KC_RBRC)\ + ), +[CONFIG]= LAYOUT( + KC_NO,DF(JP),DF(JP),KC_NO,\ + KC_TRNS,DF(EN),DF(JP),KC_TRNS\ + ) + +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/namecard2x4/keymaps/brainfuck/readme.md b/keyboards/namecard2x4/keymaps/brainfuck/readme.md new file mode 100644 index 00000000000..7fee17acd9c --- /dev/null +++ b/keyboards/namecard2x4/keymaps/brainfuck/readme.md @@ -0,0 +1,12 @@ +# keymap for brainfuck + + This keymap is specialized for the brainfuck programming language. + +| < | > | + | - | +| . | , | [ | ] | + +and when you hold . or ], change config layer. + +default layer is for JP keyboard(logical pairing). +you can choose EN keyboard(typewrite pairing). + diff --git a/keyboards/namecard2x4/rev1/config.h b/keyboards/namecard2x4/rev1/config.h new file mode 100644 index 00000000000..9286afa698c --- /dev/null +++ b/keyboards/namecard2x4/rev1/config.h @@ -0,0 +1,216 @@ +/* +Copyright 2018 takashiski + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER takashiski +#define PRODUCT namecard2x4 +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B4,B5 } +#define MATRIX_COL_PINS { E6,D7,C6,D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define RGB_DI_PIN F4 +#define RGBLED_NUM 4 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 10 +#define RGBLIGHT_VAL_STEP 10 + +//#define BACKLIGHT_PIN F4 +//#define BACKLIGHT_BREATHING +//#define BACKLIGHT_LEVELS 1 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/namecard2x4/rev1/rules.mk b/keyboards/namecard2x4/rev1/rules.mk new file mode 100644 index 00000000000..407298e9007 --- /dev/null +++ b/keyboards/namecard2x4/rev1/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +#UNICODEMAP_ENABLE = yes # for emoji user +#RGBLIGHT_ENABLE = yes # uncomment if you want addressable led strips diff --git a/keyboards/namecard2x4/rev2/config.h b/keyboards/namecard2x4/rev2/config.h new file mode 100644 index 00000000000..f2cf053d23b --- /dev/null +++ b/keyboards/namecard2x4/rev2/config.h @@ -0,0 +1,216 @@ +/* +Copyright 2018 takashiski + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER takashiski +#define PRODUCT namecard2x4 +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B2,B6 } +#define MATRIX_COL_PINS { D7,E6,B4,B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +//#define DIODE_DIRECTION COL2ROW +#define DIODE_DIRECTION ROW2COL +#define RGB_DI_PIN D4 +#define RGBLED_NUM 8 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 10 +#define RGBLIGHT_VAL_STEP 10 + +//#define BACKLIGHT_PIN F4 +//#define BACKLIGHT_BREATHING +//#define BACKLIGHT_LEVELS 1 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/namecard2x4/rev2/rules.mk b/keyboards/namecard2x4/rev2/rules.mk new file mode 100644 index 00000000000..407298e9007 --- /dev/null +++ b/keyboards/namecard2x4/rev2/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +#UNICODEMAP_ENABLE = yes # for emoji user +#RGBLIGHT_ENABLE = yes # uncomment if you want addressable led strips diff --git a/keyboards/namecard2x4/rules.mk b/keyboards/namecard2x4/rules.mk deleted file mode 100644 index 51d2cbcb2e8..00000000000 --- a/keyboards/namecard2x4/rules.mk +++ /dev/null @@ -1,81 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -# OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Bootloader selection -# Teensy halfkay -# Pro Micro caterina -# Atmel DFU atmel-dfu -# LUFA DFU lufa-dfu -# QMK DFU qmk-dfu -# atmega32a bootloadHID -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) - -#UNICODEMAP_ENABLE = yes # for emoji user -#RGBLIGHT_ENABLE = yes # uncomment if you want addressable led strips diff --git a/keyboards/nano/config.h b/keyboards/nano/config.h deleted file mode 100644 index 088fafcaa5f..00000000000 --- a/keyboards/nano/config.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x0007 -#define DEVICE_VER 0x0001 -#define MANUFACTURER di0ib -#define PRODUCT Nano -#define DESCRIPTION 8 key microswitch board - -/* key matrix size */ -#define MATRIX_ROWS 2 -#define MATRIX_COLS 4 - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 6 // Number of LEDs - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -#define TAPPING_TERM 200 - -#endif diff --git a/keyboards/nano/keymaps/default/keymap.c b/keyboards/nano/keymaps/default/keymap.c deleted file mode 100644 index cd9d4549de3..00000000000 --- a/keyboards/nano/keymaps/default/keymap.c +++ /dev/null @@ -1,19 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _MAIN 0 -#define _FN 1 - -#define _______ KC_TRNS -#define KC_X0 LT(_FN, KC_ESC) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_MAIN] = LAYOUT( - KC_VOLU, KC_MPLY, KC_MPRV, KC_PGUP, - KC_VOLD, KC_MUTE, KC_MNXT, KC_PGDN - ), - - [_FN] = LAYOUT( - KC_F, _______, RGB_HUI, _______, - RGB_TOG, RGB_MOD, RGB_HUD, _______ - ) -}; diff --git a/keyboards/nano/keymaps/spooka/keymap.c b/keyboards/nano/keymaps/spooka/keymap.c deleted file mode 100644 index 63b90da09ff..00000000000 --- a/keyboards/nano/keymaps/spooka/keymap.c +++ /dev/null @@ -1,12 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _MAIN 0 - -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_MAIN] = LAYOUT( - RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, - RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD - ) -}; diff --git a/keyboards/nano/matrix.c b/keyboards/nano/matrix.c deleted file mode 100644 index fa2461af5fe..00000000000 --- a/keyboards/nano/matrix.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - -Note for ErgoDox EZ customizers: Here be dragons! -This is not a file you want to be messing with. -All of the interesting stuff for you is under keymaps/ :) -Love, Erez - -Copyright 2013 Oleg Kostyuk - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "action_layer.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "nano.h" -#include - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_stage[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static uint16_t debouncing_time; -static bool debouncing = false; - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - - DDRF &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); - PORTF |= (1<<4 | 1<<5 | 1<<6 | 1<<7); - DDRC &= ~(1<<6); - PORTC |= (1<<6); - DDRD &= ~(1<<0 | 1<<1 | 1<<4); - PORTD |= (1<<0 | 1<<1 | 1<<4); - - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - matrix_stage[i] = 0; - } - - matrix_init_quantum(); - -} - -uint8_t matrix_scan(void) -{ - matrix_stage[0] = - (PINF&(1<<4) ? 0 : (1<<0)) | - (PINF&(1<<5) ? 0 : (1<<1)) | - (PINF&(1<<6) ? 0 : (1<<2)) | - (PINF&(1<<7) ? 0 : (1<<3)); - matrix_stage[1] = - (PIND&(1<<1) ? 0 : (1<<0)) | - (PIND&(1<<0) ? 0 : (1<<1)) | - (PIND&(1<<4) ? 0 : (1<<2)) | - (PINC&(1<<6) ? 0 : (1<<3)); - - if (memcmp(matrix_debouncing, matrix_stage, sizeof(matrix)) != 0) { - debouncing = true; - debouncing_time = timer_read(); - } - - matrix_debouncing[0] = matrix_stage[0]; - matrix_debouncing[1] = matrix_stage[1]; - - if (debouncing && (timer_elapsed(debouncing_time) > 20)) { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - debouncing = false; - } - - matrix_scan_quantum(); - - return 1; -} - -bool matrix_is_modified(void) -{ - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<. +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER miker +#define PRODUCT nek_type_a +#define DESCRIPTION NEK Type A + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 18 + +/* left columns are all onboard, right columns all on expander */ +#define COL_EXPANDED { false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true} +#define MATRIX_COL_PINS { C6, D7, B5, B6, B7, D6, D3, GPA0, GPA1, GPA2, GPA3, GPA4, GPA5, GPA6, GPA7, GPB0, GPB1, GPB2 } +#define MATRIX_ROW_PINS { F7, F6, F5, F4, F1, F0 } + +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/nek_type_a/info.json b/keyboards/nek_type_a/info.json new file mode 100644 index 00000000000..7387fe27f95 --- /dev/null +++ b/keyboards/nek_type_a/info.json @@ -0,0 +1,101 @@ +{ + "keyboard_name": "NEK Type A", + "url": "", + "maintainer": "ecopoesis", + "width": 19.75, + "height": 6.25, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0.5, "y":0, "w":1.75}, + {"label":"F1", "x":2.75, "y":0}, + {"label":"F2", "x":3.75, "y":0}, + {"label":"F3", "x":4.75, "y":0}, + {"label":"F4", "x":5.75, "y":0}, + {"label":"F5", "x":8.25, "y":0}, + {"label":"F6", "x":9.25, "y":0}, + {"label":"F7", "x":10.25, "y":0}, + {"label":"F8", "x":11.25, "y":0}, + {"label":"F9", "x":12.5, "y":0}, + {"label":"F10", "x":13.5, "y":0}, + {"label":"F11", "x":14.5, "y":0}, + {"label":"F12", "x":15.5, "y":0}, + {"label":"Mute", "x":16.75, "y":0}, + {"label":"Volume Down", "x":17.75, "y":0}, + {"label":"Volume Up", "x":18.75, "y":0}, + {"label":"`", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":8, "y":1.25, "w":1.5}, + {"label":"8", "x":9.5, "y":1.25}, + {"label":"9", "x":10.5, "y":1.25}, + {"label":"0", "x":11.5, "y":1.25}, + {"label":"-", "x":12.5, "y":1.25}, + {"label":"=", "x":13.5, "y":1.25}, + {"label":"Backspace", "x":14.5, "y":1.25, "w":2}, + {"label":"Insert", "x":16.75, "y":1.25}, + {"label":"Home", "x":17.75, "y":1.25}, + {"label":"Page Up", "x":18.75, "y":1.25}, + {"label":"Tab", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25, "w":1.5}, + {"label":"Y", "x":8, "y":2.25}, + {"label":"U", "x":9, "y":2.25}, + {"label":"I", "x":10, "y":2.25}, + {"label":"O", "x":11, "y":2.25}, + {"label":"P", "x":12, "y":2.25}, + {"label":"[", "x":13, "y":2.25}, + {"label":"]", "x":14, "y":2.25}, + {"label":"\\", "x":15, "y":2.25, "w":1.5}, + {"label":"Delete", "x":16.75, "y":2.25}, + {"label":"End", "x":17.75, "y":2.25}, + {"label":"Page Down", "x":18.75, "y":2.25}, + {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25, "w":1.25}, + {"label":"H", "x":8, "y":3.25, "w":1.25}, + {"label":"J", "x":9.25, "y":3.25}, + {"label":"K", "x":10.25, "y":3.25}, + {"label":"L", "x":11.25, "y":3.25}, + {"label":";", "x":12.25, "y":3.25}, + {"label":"'", "x":13.25, "y":3.25}, + {"label":"Enter", "x":14.25, "y":3.25, "w":2.25}, + {"label":"Shift", "x":0, "y":4.25, "w":2}, + {"label":"Z", "x":2, "y":4.25}, + {"label":"X", "x":3, "y":4.25}, + {"label":"C", "x":4, "y":4.25}, + {"label":"V", "x":5, "y":4.25}, + {"label":"B", "x":6, "y":4.25}, + {"label":"N", "x":8, "y":4.25, "w":1.5}, + {"label":"M", "x":9.5, "y":4.25}, + {"label":",", "x":10.5, "y":4.25}, + {"label":".", "x":11.5, "y":4.25}, + {"label":"/", "x":12.5, "y":4.25}, + {"label":"Shift", "x":13.5, "y":4.25, "w":2.75}, + {"label":"Up", "x":17.75, "y":3.75}, + {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, + {"label":"Alt", "x":1.5, "y":5.25, "w":1.25}, + {"label":"Cmd", "x":2.75, "y":5.25, "w":1.5}, + {"label":"Space", "x":4.25, "y":5.25, "w":2.75}, + {"label":"Space", "x":8, "y":5.25, "w":2.75}, + {"label":"Cmd", "x":10.75, "y":5.25, "w":1.5}, + {"label":"Alt", "x":12.25, "y":5.25, "w":1.25}, + {"label":"Ctrl", "x":13.5, "y":5.25, "w":1.5}, + {"label":"Menu", "x":15, "y":5.25, "w":1.25}, + {"label":"Left", "x":16.75, "y":4.75}, + {"label":"Down", "x":17.75, "y":4.75}, + {"label":"Right", "x":18.75, "y":4.75} + ] + } + } +} diff --git a/keyboards/nek_type_a/keymaps/default/config.h b/keyboards/nek_type_a/keymaps/default/config.h new file mode 100644 index 00000000000..5c2aaa2f31a --- /dev/null +++ b/keyboards/nek_type_a/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Mike Roberts + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/nek_type_a/keymaps/default/keymap.c b/keyboards/nek_type_a/keymaps/default/keymap.c new file mode 100644 index 00000000000..627aa459006 --- /dev/null +++ b/keyboards/nek_type_a/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2018 Mike Roberts + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC__MUTE, KC__VOLDOWN, KC__VOLUP, \ + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPACE, KC_INSERT, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRACKET, KC_RBRACKET, KC_BSLASH, KC_DELETE, KC_END, KC_PGDOWN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, KC_ENTER, \ + KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSHIFT, KC_UP, \ + KC_LCTRL, KC_LALT, KC_LCMD, KC_SPC, KC_SPC, KC_RCMD, KC_RALT, KC_RCTRL, KC_APP, KC_LEFT, KC_DOWN, KC_RIGHT \ + ), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/nek_type_a/keymaps/default/readme.md b/keyboards/nek_type_a/keymaps/default/readme.md new file mode 100644 index 00000000000..763125cea54 --- /dev/null +++ b/keyboards/nek_type_a/keymaps/default/readme.md @@ -0,0 +1,3 @@ +![NEK Type A Layout](https://i.imgur.com/ElEVvze.png) + +# Default NEK Type A Keymap diff --git a/keyboards/nek_type_a/matrix.c b/keyboards/nek_type_a/matrix.c new file mode 100644 index 00000000000..a3c0155e1a3 --- /dev/null +++ b/keyboards/nek_type_a/matrix.c @@ -0,0 +1,412 @@ +/* +Copyright 2012-2018 Jun Wako, Jack Humbert, Mike Roberts + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * This matrix.c has been hacked up to support some columns being on an ex pander in ROW2COL mode. + * The columns are only ever selected and unselected, never read. Unselecting a single column via the expander is not + * implemented because updating one column costs the same as updating all the columns in a bank. Currently both banks + * are unselected but two i2c transactions could be removed if we only unselect the the proper half. + */ + +#include +#include +#if defined(__AVR__) +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" +#include "mcp23017.h" +#include "outputselect.h" + +/* Set 0 if debouncing isn't needed */ + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#if (DEBOUNCE > 0) + static uint16_t debouncing_time; + static bool debouncing = false; +#endif + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +static const bool col_expanded[MATRIX_COLS] = COL_EXPANDED; +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; + +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + + +#if (DIODE_DIRECTION == COL2ROW) + static void init_cols(void); + static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); + static void unselect_rows(void); + static void select_row(uint8_t row); + static void unselect_row(uint8_t row); +#elif (DIODE_DIRECTION == ROW2COL) + static void init_rows(void); + static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); + static void unselect_cols(void); + static void unselect_col(uint8_t col); + static void select_col(uint8_t col); +#endif + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + expander_init(); + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +void matrix_init(void) { + // initialize row and col +#if (DIODE_DIRECTION == COL2ROW) + unselect_rows(); + init_cols(); +#elif (DIODE_DIRECTION == ROW2COL) + unselect_cols(); + init_rows(); +#endif + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); + set_output(OUTPUT_AUTO); +} + +uint8_t matrix_scan(void) +{ + +#if (DIODE_DIRECTION == COL2ROW) + + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { +# if (DEBOUNCE > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + +# else + read_cols_on_row(matrix, current_row); +# endif + + } + +#elif (DIODE_DIRECTION == ROW2COL) + + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { +# if (DEBOUNCE > 0) + bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix, current_col); +# endif + + } + +#endif + +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + debouncing = false; + } +# endif + + matrix_scan_quantum(); + return 1; +} + +bool matrix_is_modified(void) +{ +#if (DEBOUNCE > 0) + if (debouncing) return false; +#endif + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) +{ + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + + // Select the col pin to read (active low) + uint8_t pin = col_pins[col_index]; + uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +static void select_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_rows(void) +{ + for(uint8_t x = 0; x < MATRIX_ROWS; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#elif (DIODE_DIRECTION == ROW2COL) + +static void init_rows(void) +{ + for(uint8_t x = 0; x < MATRIX_ROWS; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) +{ + bool matrix_changed = false; + + // Select col and wait for col selecton to stabilize + select_col(current_col); + wait_us(30); + + // For each row... + for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) + { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[row_index]; + + // Check row pin state + if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) + { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } + else + { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } + + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) + { + matrix_changed = true; + } + } + + // Unselect col + unselect_col(current_col); + + return matrix_changed; +} + +static void select_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + if (col_expanded[col]) + { + expander_select(pin); + } + else + { + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } +} + + +static void unselect_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + if (col_expanded[col]) + { + expander_unselect_all(); + } + else + { + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static void unselect_cols(void) +{ + expander_unselect_all(); + + for(uint8_t col = 0; col < MATRIX_COLS; col++) { + uint8_t pin = col_pins[col]; + if (!col_expanded[col]) + { + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } + } +} + +#endif diff --git a/keyboards/nek_type_a/mcp23017.c b/keyboards/nek_type_a/mcp23017.c new file mode 100644 index 00000000000..e2423168041 --- /dev/null +++ b/keyboards/nek_type_a/mcp23017.c @@ -0,0 +1,107 @@ +/* Copyright 2018 Mike Roberts + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include "action.h" +#include "lib/lufa/LUFA/Drivers/Peripheral/TWI.h" +#include "lib/lufa/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c" +#include "mcp23017.h" +#include "debug.h" +#include "wait.h" + +uint8_t bit_for_pin(uint8_t pin); + +uint8_t expander_write(uint8_t reg, uint8_t data); + +uint8_t expander_read(uint8_t reg, uint8_t *data); + +void expander_config(void); + +static const char *twi_err_str(uint8_t res) { + switch (res) { + case TWI_ERROR_NoError: + return "OK"; + case TWI_ERROR_BusFault: + return "BUSFAULT"; + case TWI_ERROR_BusCaptureTimeout: + return "BUSTIMEOUT"; + case TWI_ERROR_SlaveResponseTimeout: + return "SLAVETIMEOUT"; + case TWI_ERROR_SlaveNotReady: + return "SLAVENOTREADY"; + case TWI_ERROR_SlaveNAK: + return "SLAVENAK"; + default: + return "UNKNOWN"; + } +} + +void expander_init(void) { + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 400000)); +} + +// set IN and HI +void expander_unselect_all() { + expander_write(EXPANDER_REG_IODIRA, 0xff); + expander_write(EXPANDER_REG_IODIRB, 0xff); + expander_write(EXPANDER_REG_OLATA, 0xff); + expander_write(EXPANDER_REG_OLATB, 0xff); + wait_us(EXPANDER_PAUSE); +} + +// set OUT and LOW +void expander_select(uint8_t pin) { + const uint8_t mask = 0xff & ~(1 << bit_for_pin(pin)); + if (pin < 8) { + expander_write(EXPANDER_REG_IODIRA, mask); + expander_write(EXPANDER_REG_OLATA, mask); + } else { + expander_write(EXPANDER_REG_IODIRB, mask); + expander_write(EXPANDER_REG_OLATB, mask); + } + wait_us(EXPANDER_PAUSE); +} + +void expander_config() { + // set everything to input + expander_write(EXPANDER_REG_IODIRA, 0xff); + expander_write(EXPANDER_REG_IODIRB, 0xff); + + // turn on pull-ups + expander_write(EXPANDER_REG_GPPUA, 0xff); + expander_write(EXPANDER_REG_GPPUB, 0xff); + + // disable interrupts + expander_write(EXPANDER_REG_GPINTENA, 0x0); + expander_write(EXPANDER_REG_GPINTENB, 0x0); + + // polarity + expander_write(EXPANDER_REG_IPOLA, 0x0); + expander_write(EXPANDER_REG_IPOLB, 0x0); +} + +uint8_t bit_for_pin(uint8_t pin) { + return pin % 8; +} + +uint8_t expander_write(uint8_t reg, unsigned char val) { + uint8_t addr = reg; + uint8_t result = TWI_WritePacket(EXPANDER_ADDR << 1, I2C_TIMEOUT, &addr, sizeof(addr), &val, sizeof(val)); + if (result) { + xprintf("mcp: set_register %d = %d failed: %s\n", reg, val, twi_err_str(result)); + } + return result == 0; +} + diff --git a/keyboards/nek_type_a/mcp23017.h b/keyboards/nek_type_a/mcp23017.h new file mode 100644 index 00000000000..41c747beab2 --- /dev/null +++ b/keyboards/nek_type_a/mcp23017.h @@ -0,0 +1,71 @@ +/* Copyright 2018 Mike Roberts + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef MAP23017_H +#define MAP23017_H + +#define EXPANDER_ADDR 0x27 +#define I2C_TIMEOUT 200 // milliseconds +#define EXPANDER_PAUSE 0 // microseconds + +enum EXPANDER_REGISTERS { + EXPANDER_REG_IODIRA = 0x00, + EXPANDER_REG_IODIRB = 0x01, + EXPANDER_REG_IPOLA = 0x02, + EXPANDER_REG_IPOLB = 0x03, + EXPANDER_REG_GPINTENA = 0x04, + EXPANDER_REG_GPINTENB = 0x05, + EXPANDER_REG_DEFVALA = 0x06, + EXPANDER_REG_DEFVALB = 0x07, + EXPANDER_REG_INTCONA = 0x08, + EXPANDER_REG_INTCONB = 0x09, + EXPANDER_REG_IOCONA = 0x0A, + EXPANDER_REG_IOCONB = 0x0B, + EXPANDER_REG_GPPUA = 0x0C, + EXPANDER_REG_GPPUB = 0x0D, + EXPANDER_REG_INTFA = 0x0E, + EXPANDER_REG_INTFB = 0x0F, + EXPANDER_REG_INTCAPA = 0x10, + EXPANDER_REG_INTCAPB = 0x11, + EXPANDER_REG_GPIOA = 0x12, + EXPANDER_REG_GPIOB = 0x13, + EXPANDER_REG_OLATA = 0x14, + EXPANDER_REG_OLATB = 0x15 +}; + +#define GPA0 0x0 +#define GPA1 0x1 +#define GPA2 0x2 +#define GPA3 0x3 +#define GPA4 0x4 +#define GPA5 0x5 +#define GPA6 0x6 +#define GPA7 0x7 +#define GPB0 0x8 +#define GPB1 0x9 +#define GPB2 0xA +#define GPB3 0xB +#define GPB4 0xC +#define GPB5 0xD +#define GPB6 0xE +#define GPB7 0xF + + +void expander_init(void); +void expander_select(uint8_t pin); +void expander_unselect(uint8_t pin); +void expander_unselect_all(void); + +#endif \ No newline at end of file diff --git a/keyboards/nek_type_a/nek_type_a.c b/keyboards/nek_type_a/nek_type_a.c new file mode 100644 index 00000000000..ec76a209b1a --- /dev/null +++ b/keyboards/nek_type_a/nek_type_a.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Mike Roberts + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "nek_type_a.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/nek_type_a/nek_type_a.h b/keyboards/nek_type_a/nek_type_a.h new file mode 100644 index 00000000000..9bf6028cb99 --- /dev/null +++ b/keyboards/nek_type_a/nek_type_a.h @@ -0,0 +1,58 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef NEK_TYPE_A_H +#define NEK_TYPE_A_H + +#include "quantum.h" +#include +#include +#include + +#define I2C_ADDR 0b0100000 +#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) +#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +extern uint8_t expander_status; +extern uint8_t expander_input_pin_mask; +extern bool i2c_initialized; + +void init_expander(void); + +#define LAYOUT( \ + L12, L14, L15, L16, L17, R11, R12, R13, R14, R15, R16, R17, R18, R19, R1A, R1B, \ + L21, L22, L23, L24, L25, L26, L27, R21, R22, R23, R24, R25, R26, R28, R29, R2A, R2B, \ + L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, R37, R38, R39, R3A, R3B, \ + L41, L42, L43, L44, L45, L46, R41, R42, R43, R44, R45, R46, R48, \ + L51, L52, L53, L54, L55, L56, R51, R52, R53, R54, R55, R58, R5A, \ + L61, L62, L63, L65, R61, R63, R65, R66, R68, R69, R6A, R6B \ +) \ +{ \ + { KC_NO, L12, KC_NO, L14, L15, L16, L17, R11, R12, R13, R14, R15, R16, R17, R18, R19, R1A, R1B }, \ + { L21, L22, L23, L24, L25, L26, L27, R21, R22, R23, R24, R25, R26, KC_NO, R28, R29, R2A, R2B }, \ + { L31, L32, L33, L34, L35, L36, KC_NO, R31, R32, R33, R34, R35, R36, R37, R38, R39, R3A, R3B }, \ + { L41, L42, L43, L44, L45, L46, KC_NO, R41, R42, R43, R44, R45, R46, KC_NO, R48, KC_NO, KC_NO, KC_NO }, \ + { L51, L52, L53, L54, L55, L56, KC_NO, R51, R52, R53, R54, R55, KC_NO, KC_NO, R58, KC_NO, R5A, KC_NO }, \ + { L61, L62, L63, KC_NO, L65, KC_NO, KC_NO, R61, KC_NO, R63, KC_NO, R65, R66, KC_NO, R68, R69, R6A, R6B }, \ +} +#endif diff --git a/keyboards/nek_type_a/readme.md b/keyboards/nek_type_a/readme.md new file mode 100644 index 00000000000..49f4a465998 --- /dev/null +++ b/keyboards/nek_type_a/readme.md @@ -0,0 +1,30 @@ +# nek_type_a + +![NEK Type A Keyboard](https://i.imgur.com/XFnjlQ9.jpg) + +Natural Ergonomic Keyboard, Type A + +Keyboard Maintainer: [Mike Roberts](https://github.com/ecopoesis) +Hardware Supported: Custom PCBs from https://github.com/ecopoesis/nek-type-a +Hardware Availability: https://github.com/ecopoesis/nek-type-a + +## Design + +This is a column-driven split keyboard using three custom PCBs connected with ribbon cables. The left and right PCBs are +passive: they only have the diodes and switches needed to make the matrix. The center PCB has an Adafruit Feather 32u4 and +MCP23017 expander. + +The left matrix has its rows and columns directly connected to the Feather. The right matrix has its rows connect to the +Feather (using the same pins as the left matrix) and its columns connected to the expander. The expander uses the LUFA +hardware TWI driver. + +Bluetooth is enabled. + +## Building + +Make and install this keyboard (after setting up your build environment): +``` +make nek_type_a:default:avrdude +``` + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/nek_type_a/rules.mk b/keyboards/nek_type_a/rules.mk new file mode 100644 index 00000000000..6f172a9cea1 --- /dev/null +++ b/keyboards/nek_type_a/rules.mk @@ -0,0 +1,33 @@ +SRC = matrix.c mcp23017.c + +MCU = atmega32u4 +F_CPU = 8000000 + +ARCH = AVR8 +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = caterina + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +CUSTOM_MATRIX = yes +DEBUG_ENABLE = yes +BLUETOOTH = AdafruitBLE \ No newline at end of file diff --git a/keyboards/newgame40/config.h b/keyboards/newgame40/config.h new file mode 100644 index 00000000000..01c9142f771 --- /dev/null +++ b/keyboards/newgame40/config.h @@ -0,0 +1,75 @@ +/* +Copyright 2018 Go Takigawa + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER GoTakigawa +#define PRODUCT NEWGAME40 +#define DESCRIPTION 4x10key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 10 + +/* pin-out */ +#define MATRIX_ROW_PINS { F7, B1, B3, B2 } +#define MATRIX_COL_PINS { D3, D2, D1, D0, D4, C6, D7, E6, B4, B5 } +#define UNUSED_PINS + +/* ws2812 RGB LED */ +#define RGB_DI_PIN F6 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 25 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#ifndef IOS_DEVICE_ENABLE + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 255 + #else + #define RGBLIGHT_LIMIT_VAL 130 + #endif + #define RGBLIGHT_VAL_STEP 17 +#else + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 90 + #else + #define RGBLIGHT_LIMIT_VAL 45 + #endif + #define RGBLIGHT_VAL_STEP 4 +#endif +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define TAPPING_TERM 200 + diff --git a/keyboards/newgame40/info.json b/keyboards/newgame40/info.json new file mode 100644 index 00000000000..0239614082b --- /dev/null +++ b/keyboards/newgame40/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "NEWGAME40", + "url": "", + "maintainer": "qmk", + "width": 10, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x10": { + "key_count": 40, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}] + } + } +} diff --git a/keyboards/newgame40/keymaps/default/config.h b/keyboards/newgame40/keymaps/default/config.h new file mode 100644 index 00000000000..d533d806c90 --- /dev/null +++ b/keyboards/newgame40/keymaps/default/config.h @@ -0,0 +1,5 @@ + + +#pragma once + +// place overrides here diff --git a/keyboards/newgame40/keymaps/default/keymap.c b/keyboards/newgame40/keymaps/default/keymap.c new file mode 100644 index 00000000000..f3588751fa8 --- /dev/null +++ b/keyboards/newgame40/keymaps/default/keymap.c @@ -0,0 +1,207 @@ +/* Copyright 2018 GoTakigawa + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #include QMK_KEYBOARD_H + + extern keymap_config_t keymap_config; + +enum layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _EUCALYN, + _LOWER, + _RAISE, + _ADJUST, +}; + + enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + EUCALYN, + ADJUST, + }; + + #define LOWER MO(_LOWER) + #define RAISE MO(_RAISE) + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,---------------------------------------------------------------------. + * | Q | W | E | R | T | Y | U | I | O | P | + * |------+------+------+------+------+------|------+------+------+------| + * | A | S | D | F | G | H | J | K | L | - | + * |------+------+------+------+------+------+-------------+------+------| + * | Z | X | C | V | B | N | M | , | . | / | + * |-------------+------+------+------+------+------+------+------+------' + * |Shift | GUI |Lower | Ctrl |Space | Bksp |Enter |Raise | Left |Right | + * `---------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_ortho_4x10( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_MINS, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ + KC_LSFT, KC_LGUI, LT(_LOWER,KC_LANG2), KC_LCTL, KC_SPC, KC_BSPC, KC_ENT, LT(_RAISE,KC_LANG1), KC_LEFT, KC_RGHT\ + ), + + /* Colemak + * ,---------------------------------------------------------------------. + * | Q | W | F | P | G | J | L | U | Y | - | + * |------+------+------+------+------+------|------+------+------+------| + * | A | R | S | T | D | H | N | E | I | O | + * |------+------+------+------+------+------+-------------+------+------| + * | Z | X | C | V | B | K | M | , | . | / | + * |-------------+------+------+------+------+------+------+------+------' + * |Shift | GUI |Lower | Ctrl |Space | Bksp |Enter |Raise | Left |Right | + * `---------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT_ortho_4x10( \ + KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_MINS, \ + KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ + KC_LSFT, KC_LGUI, LT(_LOWER,KC_LANG2), KC_LCTL, KC_SPC, KC_BSPC, KC_ENT, LT(_RAISE,KC_LANG1), KC_LEFT, KC_RGHT\ + ), + + /* Dvorak + * ,---------------------------------------------------------------------. + * | " | , | . | P | Y | F | G | C | R | L | + * |------+------+------+------+------+------|------+------+------+------| + * | A | O | E | U | I | D | H | T | N | S | + * |------+------+------+------+------+------+-------------+------+------| + * | ; | Q | J | K | X | B | M | W | V | Z | + * |-------------+------+------+------+------+------+------+------+------' + * |Shift | GUI |Lower | Ctrl |Space | Bksp |Enter |Raise | Left |Right | + * `---------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT_ortho_4x10( \ + KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, \ + KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, \ + KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, \ + KC_LSFT, KC_LGUI, LT(_LOWER,KC_LANG2), KC_LCTL, KC_SPC, KC_BSPC, KC_ENT, LT(_RAISE,KC_LANG1), KC_LEFT, KC_RGHT\ + ), + + /* Lower + * ,---------------------------------------------------------------------. + * | Esc | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------| + * | | | | | | | | | | | + * |------+------+------+------+------+------+-------------+------+------| + * | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | + * |-------------+------+------+------+------+------+------+------+------' + * | F1 | F2 | | F3 | F4 | F5 | F6 | | F7 | F8 | + * `---------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_ortho_4x10( \ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, \ + KC_F1, KC_F2, _______, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_F7, KC_F8 \ + ), + + /* Raise + * ,---------------------------------------------------------------------. + * | 1 | 2 |  3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + * |------+------+------+------+------+------|------+------+------+------| + * | ! | " | # | $ | % | & | ' | (  | ) | _ | + * |------+------+------+------+------+------+-------------+------+------| + * | = | ¥ | { | } | * | ~ | | | < | > | ? | + * |-------------+------+------+------+------+------+------+------+------' + * | F1 | Alt | | [ | ] | ; | : | | \ | / | + * `---------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_ortho_4x10( \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_EXLM, KC_DQT, KC_HASH, KC_DLR, KC_PERC, KC_AMPR, KC_QUOT, KC_LPRN, KC_RPRN, KC_UNDS, \ + KC_EQL, KC_JYEN, KC_LCBR, KC_RCBR, KC_ASTR, KC_TILD, KC_PIPE, KC_LABK, KC_RABK, KC_QUES, \ + KC_F1, KC_LALT, _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, _______, KC_BSLS, KC_SLSH \ + ), + + /* EUCALYN + * ,---------------------------------------------------------------------. + * | Q | W | , | . | ; | M | R | D | Y | P | + * |------+------+------+------+------+------|------+------+------+------| + * | A | O | E | I | U | G | T | K | S | N | + * |------+------+------+------+------+------+-------------+------+------| + * | Z | X | C | V | F | B | H | J | L | / | + * `-------------+------+------+------+------+------+------+-------------' + * |Shift | GUI |Lower | Ctrl |Space | Bksp |Enter |Raise | Left |Right | + * `---------------------------------------------------------------------' + */ + [_EUCALYN] = LAYOUT_ortho_4x10( \ + KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN, KC_M, KC_R, KC_D, KC_Y, KC_P, \ + KC_A, KC_O, KC_E, KC_I, KC_U, KC_G, KC_T, KC_K, KC_S, KC_N, \ + KC_Z, KC_X, KC_C, KC_V, KC_F, KC_B, KC_H, KC_J, KC_L, KC_SLSH, \ + KC_LSFT, KC_LGUI, LT(_LOWER,KC_LANG2), KC_LCTL, KC_SPC, KC_BSPC, KC_ENT, LT(_RAISE,KC_LANG1), KC_LEFT, KC_RGHT\ + ), + + /* Adjust (Lower + Raise) + * ,---------------------------------------------------------------------. + * | |RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | + * |------+------+------+------+------+------.------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| |BL TOG|BL STP| + * |------+------+------+------+------+------+------+------+------+------| + * |Qwerty|Colemk|Dvorak|Eucalyn| | | | | | | + * |------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | + * `---------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_ortho_4x10( \ + _______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, BL_TOGG, BL_STEP, \ + QWERTY, COLEMAK, DVORAK, EUCALYN, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + + + }; + + uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + } + + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case EUCALYN: + if (record->event.pressed) { + set_single_persistent_default_layer(_EUCALYN); + } + return false; + break; + } + return true; + } diff --git a/keyboards/newgame40/newgame40.c b/keyboards/newgame40/newgame40.c new file mode 100644 index 00000000000..e55b25b3d0d --- /dev/null +++ b/keyboards/newgame40/newgame40.c @@ -0,0 +1,5 @@ +#include "newgame40.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} diff --git a/keyboards/newgame40/newgame40.h b/keyboards/newgame40/newgame40.h new file mode 100644 index 00000000000..6044f376574 --- /dev/null +++ b/keyboards/newgame40/newgame40.h @@ -0,0 +1,19 @@ +#ifndef NEWGAME40_H +#define NEWGAME40_H + +#include "quantum.h" + +#define LAYOUT_ortho_4x10( \ + k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, \ + k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, \ + k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, \ + k401, k402, k403, k404, k405, k406, k407, k408, k409, k410 \ +) \ +{ \ + {k101, k102, k103, k104, k105, k106, k107, k108, k109, k110}, \ + {k201, k202, k203, k204, k205, k206, k207, k208, k209, k210}, \ + {k301, k302, k303, k304, k305, k306, k307, k308, k309, k310}, \ + {k401, k402, k403, k404, k405, k406, k407, k408, k409, k410} \ +} + +#endif diff --git a/keyboards/newgame40/readme.md b/keyboards/newgame40/readme.md new file mode 100644 index 00000000000..2aa568cfb09 --- /dev/null +++ b/keyboards/newgame40/readme.md @@ -0,0 +1,17 @@ +# NEWGAME40 + +![NEWGAME40](https://i.imgur.com/HtujXda.jpg) + +40% (4x10) ortholinear keyboard. + +Keyboard Maintainer: +[GoTakigawa](https://github.com/GoTakigawa) +[@Go_Drums](https://twitter.com/Go_Drums) +Hardware Supported: The NEWGAME40 PCBs, ProMicro supported +Hardware Availability: Group buy soon + +Make example for this keyboard (after setting up your build environment): + + make newgame40:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/newgame40/rules.mk b/keyboards/newgame40/rules.mk new file mode 100644 index 00000000000..e92cde758af --- /dev/null +++ b/keyboards/newgame40/rules.mk @@ -0,0 +1,73 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = caterina + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +IOS_DEVICE_ENABLE = no # connect to IOS Device + + ifeq ($(strip $(IOS_DEVICE_ENABLE )), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE + endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_4x10 diff --git a/keyboards/niu_mini/config.h b/keyboards/niu_mini/config.h index b9d3ed4e9dd..2c202a8e466 100644 --- a/keyboards/niu_mini/config.h +++ b/keyboards/niu_mini/config.h @@ -51,7 +51,7 @@ along with this program. If not, see . #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -59,11 +59,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/niu_mini/keymaps/abhixec/keymap.c b/keyboards/niu_mini/keymaps/abhixec/keymap.c new file mode 100644 index 00000000000..6d3ff8a3768 --- /dev/null +++ b/keyboards/niu_mini/keymaps/abhixec/keymap.c @@ -0,0 +1,183 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum layers { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_mit( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_mit( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_mit( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_mit( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | |AG_NRM|AG_SWP|Qwerty|Colemk| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_mit( + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL , + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} diff --git a/keyboards/niu_mini/keymaps/abhixec/readme.md b/keyboards/niu_mini/keymaps/abhixec/readme.md new file mode 100644 index 00000000000..1bc312a0393 --- /dev/null +++ b/keyboards/niu_mini/keymaps/abhixec/readme.md @@ -0,0 +1,5 @@ +# Abhixec's Layout + +This is inspired by planck but removed most of the unwanted and extra features of planck that is not there in this keyboard. + + diff --git a/keyboards/niu_mini/keymaps/abhixec/rules.mk b/keyboards/niu_mini/keymaps/abhixec/rules.mk new file mode 100644 index 00000000000..3bf3f273145 --- /dev/null +++ b/keyboards/niu_mini/keymaps/abhixec/rules.mk @@ -0,0 +1 @@ +AUDIO_ENABLE = no diff --git a/keyboards/niu_mini/keymaps/default/keymap.c b/keyboards/niu_mini/keymaps/default/keymap.c index 91f8bc8cde4..5c7dc7fc0d4 100644 --- a/keyboards/niu_mini/keymaps/default/keymap.c +++ b/keyboards/niu_mini/keymaps/default/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0 diff --git a/keyboards/niu_mini/keymaps/planck/rules.mk b/keyboards/niu_mini/keymaps/planck/rules.mk index 457a3d01d4a..8b137891791 100644 --- a/keyboards/niu_mini/keymaps/planck/rules.mk +++ b/keyboards/niu_mini/keymaps/planck/rules.mk @@ -1,3 +1 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif + diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c b/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c deleted file mode 100644 index c3f6fb09a10..00000000000 --- a/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c +++ /dev/null @@ -1,127 +0,0 @@ -#include QMK_KEYBOARD_H -#include "spacebarracecar.h" - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) - -enum layers { - _BASE, - _LOWER, - _RAISE -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Base -,-----------------------------------------------------------------------------------------------------------------------. -|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Shift |Y |X |C |V |B |N |M |, |. |/ |Shift | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|LCtrl | |Win |Alt |Lower |Space |Enter |Raise |AltGr |Win |Menu |RCtrl | -`-----------------------------------------------------------------------------------------------------------------------' -*/ - -[_BASE] = LAYOUT_ortho_4x12( - KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, - CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, - CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, - KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL -), - -/* Lower -,-----------------------------------------------------------------------------------------------------------------------. -|~ |! |" |# |$ |% |^ |& |* |( |) | | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |? | | | | | | | | | | | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | | | | -`-----------------------------------------------------------------------------------------------------------------------' -*/ -[_LOWER] = LAYOUT_ortho_4x12( - DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, - _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, - _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Raise -,-----------------------------------------------------------------------------------------------------------------------. -|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | | | | -`-----------------------------------------------------------------------------------------------------------------------' -*/ - -[_RAISE] = LAYOUT_ortho_4x12( - CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Deadkey -,-----------------------------------------------------------------------------------------------------------------------. -| | | | | | | |Ü | |Ö | | | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |Ä |ß | | | | | | | | | | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | | | | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | |" |" | | | | | | -`-----------------------------------------------------------------------------------------------------------------------' -*/ - -[_DEADKEY] = LAYOUT_ortho_4x12( - KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, - _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, - _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, - _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______ -), - -/* Navigation -,-----------------------------------------------------------------------------------------------------------------------. -|ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | -|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|RESET | | | | | | | | | | |Game | -`-----------------------------------------------------------------------------------------------------------------------' -*/ - -[_NAV] = LAYOUT_ortho_4x12( - CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, RGB_M_P, KC_ENT, - _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, RGB_TOG, RGB_MOD, RGB_HUI, CU_RGBV, _______, - RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME -) - -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { -switch (keycode) { - case MO(_LOWER): - if (game){ - if(record->event.pressed) { - register_code(KC_SPC); - } else { - unregister_code(KC_SPC); - } - return false; - } else { - return true; - } - default: - return true; - } -} diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/readme.md b/keyboards/niu_mini/keymaps/spacebarracecar/readme.md deleted file mode 100644 index 96727438167..00000000000 --- a/keyboards/niu_mini/keymaps/spacebarracecar/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# SpacebarRacecar US-International NIU Mini Keymap for German PCs - -This keymap emulates most keys of the US-International layout on PCs that have German set as input language. -This allows the use of the keyboard on any PC in Germany without the need to change any settings. -The keymap is mostly based on the Planck default layout but adds essential features for german input, like access to Ä, Ö, Ü, ß. diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk b/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk deleted file mode 100644 index 124de79deb8..00000000000 --- a/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -# Userspace defines -GERMAN_ENABLE = yes # Enable Custom US Ansi Keycodes for PC with German set as input language diff --git a/keyboards/niu_mini/keymaps/tucznak/config.h b/keyboards/niu_mini/keymaps/tucznak/config.h new file mode 100644 index 00000000000..5d8842ee20d --- /dev/null +++ b/keyboards/niu_mini/keymaps/tucznak/config.h @@ -0,0 +1,18 @@ +#pragma once + +#undef MANUFACTURER +#undef PRODUCT +#undef DESCRIPTION + +#define MANUFACTURER Potato Inc. +#define PRODUCT Qt3.14 +#define DESCRIPTION Look, a keyboard! + +/* turn off RGB when computer sleeps */ +#ifdef RGB_DI_PIN +#define RGBLIGHT_SLEEP +#endif + +/* send tap key if no layer key was used even after tap delay */ +#define TAPPING_TERM 50 +#define RETRO_TAPPING \ No newline at end of file diff --git a/keyboards/niu_mini/keymaps/tucznak/keymap.c b/keyboards/niu_mini/keymaps/tucznak/keymap.c new file mode 100644 index 00000000000..94743fe2c82 --- /dev/null +++ b/keyboards/niu_mini/keymaps/tucznak/keymap.c @@ -0,0 +1,133 @@ +#include QMK_KEYBOARD_H + +enum layers { + _BASE, + _LOWER, + _RAISE, + _NUM, + _FN +}; + +enum keycodes { + QWERTY = SAFE_RANGE, + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base layer (0) + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |Esc/Fn| A | S | D | F | G | H | J | K | L | ; | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | \| |Lower |Sp/Num|Space |Raise |AltGr | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ + [_BASE] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT(_FN, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DEL, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_NUBS, MO(_LOWER), LT(_NUM, KC_SPC), KC_SPC, MO(_RAISE), KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Lower layer (1) + * Function keys, navigation + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | Ins | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |CapsLk| |PrtSc |ScrLk |Pause | | | | | PgUp | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Menu | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_ortho_4x12( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, KC_CAPS, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_APP, KC_HOME, KC_PGDN, KC_END + ), + + /* Raise layer (2) + * National characters, special characters + * ,-----------------------------------------------------------------------------------. + * | +1 | ě2 | š3 | č4 | ř5 | ž6 | ý7 | á8 | í9 | é0 | ´ | ˇ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ;° | | | | | | ( | ) | § | ! | ú | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | % | = | ¨ | ' | - | _ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_ortho_4x12( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, LSFT(KC_EQL), + KC_GRV, _______, _______, _______, _______, _______, LSFT(KC_RBRC), KC_RBRC, KC_QUOT, LSFT(KC_QUOT), KC_LBRC, LSFT(KC_LBRC), + _______, _______, _______, _______, _______, _______, LSFT(KC_MINS), KC_MINS, KC_BSLS, LSFT(KC_BSLS), KC_SLSH, LSFT(KC_SLSH), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Numbers layer - numpad (3) + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | 4 | 5 | 6 | / | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |NumLk | | | | | | 1 | 2 | 3 | * | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | . | 0 | + | - | | + * `-----------------------------------------------------------------------------------' + */ + [_NUM] = LAYOUT_ortho_4x12( + _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_0, _______, + _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PSLS, _______, + _______, KC_NLCK, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PAST, _______, + _______, _______, _______, _______, _______, _______, _______, KC_DOT, KC_KP_0, KC_PPLS, KC_PMNS, _______ + ), + + /* Function layer (4) + * Backlighting, keyboard controls, etc. + * m_ - music, r_ - RGB + backlight, f_ - macro + * ,-----------------------------------------------------------------------------------. + * | | r_BL | |Sleep | | | |f_Rec1|f_Pla1|f_Stop| |m_Vol+| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |r_VLK |r_Mod+|r_Hue+|r_Sat+|r_Bri+| |f_Rec2|f_Pla2| | |m_Vol-| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |r_TOG |r_Mod-|r_Hue-|r_Sat-|r_Bri-| | | | |m_Stop|m_Mute| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Reset| | | | |C+A+D |C+A+I | | |m_Prev|m_Paus|m_Next| + * `-----------------------------------------------------------------------------------' + */ + [_FN] = LAYOUT_ortho_4x12( + _______, BL_STEP, _______, KC_SLEP, _______, _______, _______, DYN_REC_START1, DYN_MACRO_PLAY1, DYN_REC_STOP, _______, KC_VOLU, + _______, VLK_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, KC_VOLD, + _______, RGB_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, KC_MSTP, KC_MUTE, + RESET, _______, _______, _______, _______, LCA(KC_DEL), LCA(KC_INS), _______, _______, KC_MPRV, KC_MPLY, KC_MNXT + ) +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/niu_mini/keymaps/tucznak/readme.md b/keyboards/niu_mini/keymaps/tucznak/readme.md new file mode 100644 index 00000000000..95180bc392a --- /dev/null +++ b/keyboards/niu_mini/keymaps/tucznak/readme.md @@ -0,0 +1,5 @@ +# TuCZnak's modified layout + +This layout is optimized for Czech national QWERTZ keymap. +It includes separated layers for numbers, national characters, +special characters and configuration. diff --git a/keyboards/niu_mini/keymaps/tucznak/rules.mk b/keyboards/niu_mini/keymaps/tucznak/rules.mk new file mode 100644 index 00000000000..bf5a36886ef --- /dev/null +++ b/keyboards/niu_mini/keymaps/tucznak/rules.mk @@ -0,0 +1,22 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Userspace defines +VELOCIKEY_ENABLE = yes +LAYOUTS_HAS_RGB = no \ No newline at end of file diff --git a/keyboards/niu_mini/keymaps/xtonhasvim/rules.mk b/keyboards/niu_mini/keymaps/xtonhasvim/rules.mk index 359f94f1e46..00946ff227e 100644 --- a/keyboards/niu_mini/keymaps/xtonhasvim/rules.mk +++ b/keyboards/niu_mini/keymaps/xtonhasvim/rules.mk @@ -1,8 +1,5 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - MOUSEKEY_ENABLE = yes BACKLIGHT_ENABLE = no AUDIO_ENABLE = no CONSOLE_ENABLE = no # Console for debug(+400) + diff --git a/keyboards/niu_mini/keymaps/yttyx/README.md b/keyboards/niu_mini/keymaps/yttyx/README.md new file mode 100644 index 00000000000..a48bdcca35f --- /dev/null +++ b/keyboards/niu_mini/keymaps/yttyx/README.md @@ -0,0 +1,92 @@ +# Overview + +This layout is based on Balance Twelve (mirror variant) by Sasha Viminitz. Please see [this page](https://mathematicalmulticore.wordpress.com/the-keyboard-layout-project/) +for more information. It's designed for left-handers who use their right hand for the mouse. + +## To build + +``` +make niu_mini:yttyx +``` + +## To flash (example) + +``` +sudo dfu-programmer atmega32u4 erase +sudo dfu-programmer atmega32u4 flash niu_mini_yttyx.hex --debug 6 +sudo dfu-programmer atmega32u4 launch +``` + +## Layers + +### Base: + + .--------.-------.-------.-------.--------. .-------.-------.-------.-------.------. + | P | L | C | D | W | | U | O | Y | K | Q | + |--------+-------+-------+-------+--------| |-------+-------+-------+-------+------| + | N | R | S | T | M | | A | E | I | H | V | + |--------+-------+-------+-------+--------| |-------+-------+-------+-------+------| + | Z Sft | J Ctl | F Alt | G | B | | , | . Alt | ; Ctl | X Sft | Sup | + '--------'-------'-------+-------+--------+-----. .-----+-------+-------+-------'-------'------' + | BS P1 | Spc P2 | P3 | | | Sft | | + '-------'--------'-----' '-----'-------'-------' + +### P1: Punctuation (1) + + .--------.-------.-------.-------.-------. .------.-------.-------.-------.------. + | Esc | | | | | | | | / | ^ | | ~ | + |--------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Tab | | | | | | & | \ | ` | $ | Ent | + |--------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | | | % | Alt | Ctl | Sft | Sup | + '--------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------' + | P1 | | | | | Sft | | + '-------'-------'-----' '-----'------'-------' + +### P2: Punctuation (2) + + .-------.-------.-------.-------.-------. .-------.-------.-------.-------.------. + | Esc | | NC | FV | | | ( | ) | " | ? | | + |-------+-------+-------+-------+-------| |-------+-------+-------+-------+------| + | Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | { | } | ' | ! | Ent | + |-------+-------+-------+-------+-------| |-------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | Ent | | # | Alt | Ctl | Sft | Sup | + '-------'-------'-------+-------+-------+-----. .-----+-------+-------+-------'-------'------' + | BS | P2 | | | | Sft | | + '-------'-------'-----' '-----'-------'-------' + +### P3: Punctuation (3) + + .-------.-------.-------.-------.-------. .------.-------.-------.-------.------. + | Esc | | Break | Pscr | ScLk | | < | > | + | _ | = | + |-------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Tab | | | Caps | | | [ | ] | * | - | Ent | + |-------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | | | @ | Alt | Ctl | Sft | Sup | + '-------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------' + | BS | | P3 | | | Sft | | + '-------'-------'-----' '-----'------'-------' + +### Numerals / Cursor control + + .-------.-------.-------.------.-------. .------.-------.-------.------.------. + | 1 | 2 | 3 | 4 | 5 | | Home | Up | End | PgUp | | + |-------+-------+-------+------+-------| |------+-------+-------+------+------| + | 6 | 7 | 8 | 9 | 0 | | Left | Down | Right | PgDn | | + |-------+-------+-------+------+-------| |------+-------+-------+------+------| + | Sft | Ctl | Alt | Del | . | | Ins | Alt | Ctl | Sft | Sup | + '-------'-------'-------+------+-------+-----. .-----+------+-------+-------'------'------' + | BS | BA | | | | Sft | | + '------'-------'-----' '-----'------'-------' + +### FV: Function keys / Cursor control (Vim) + + .-------.------.-------.-----.-------. .------.-------.-----.-------.------. + | F1 | F2 | F3 | F4 | F5 | | 0 | K | $ | Ctl-B | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | F6 | F7 | F8 | F9 | F10 | | H | J | L | Ctl-F | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | Sft | Ctl | Alt | F11 | F12 | | | Alt | Ctl | Sft | Sup | + '-------'------'-------+-----+-------+-----. .-----+------+-------+-----'-------'------' + | BS | BA | | | | Sft | | + '-----'-------'-----' '-----'------'-------' diff --git a/keyboards/niu_mini/keymaps/yttyx/config.h b/keyboards/niu_mini/keymaps/yttyx/config.h new file mode 100644 index 00000000000..b9e113ec0bb --- /dev/null +++ b/keyboards/niu_mini/keymaps/yttyx/config.h @@ -0,0 +1,4 @@ +#pragma once +#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/niu_mini/keymaps/yttyx/keymap.c b/keyboards/niu_mini/keymaps/yttyx/keymap.c new file mode 100644 index 00000000000..e299a53b484 --- /dev/null +++ b/keyboards/niu_mini/keymaps/yttyx/keymap.c @@ -0,0 +1,141 @@ + +#include QMK_KEYBOARD_H + +enum layers { + BA, // Base (Balance Twelve mirror variant) + P1, // Punctuation (1) + P2, // Punctuation (2) + P3, // Punctuation (2) + NC, // Numerals / Cursor control + FV // Function keys / Cursor control (Vim) +}; + +// Abbreviations - base +#define KX_P1_BSPC LT(P1, KC_BSPC) +#define KX_P2_SPC LT(P2, KC_SPC) + +#define KX_SFT_Z MT(MOD_LSFT, KC_Z) +#define KX_CTL_J MT(MOD_LCTL, KC_J) +#define KX_ALT_F MT(MOD_LALT, KC_F) + +#define KX_ALT_DOT MT(MOD_LALT, KC_DOT) +#define KX_CTL_SCLN MT(MOD_LCTL, KC_SCLN) +#define KX_SFT_X MT(MOD_LSFT, KC_X) + +#define KX_AT LSFT(KC_QUOT) +#define KX_DQUOT LSFT(KC_2) +#define KX_PIPE LSFT(KC_NUBS) +#define KX_TILDA LSFT(KC_NUHS) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + .--------.-------.-------.-------.--------. .-------.-------.-------.-------.------. + | P | L | C | D | W | | U | O | Y | K | Q | + |--------+-------+-------+-------+--------| |-------+-------+-------+-------+------| + | N | R | S | T | M | | A | E | I | H | V | + |--------+-------+-------+-------+--------| |-------+-------+-------+-------+------| + | Z Sft | J Ctl | F Alt | G | B | | , | . Alt | ; Ctl | X Sft | Sup | + '--------'-------'-------+-------+--------+-----. .-----+-------+-------+-------'-------'------' + | BS P1 | Spc P2 | P3 | | | Sft | | + '-------'--------'-----' '-----'-------'-------' + */ + [BA] = LAYOUT( + KC_P, KC_L, KC_C, KC_D, KC_W, XXXXXXX, XXXXXXX, KC_U, KC_O, KC_Y, KC_K, KC_Q, + KC_N, KC_R, KC_S, KC_T, KC_M, XXXXXXX, XXXXXXX, KC_A, KC_E, KC_I, KC_H, KC_V, + KX_SFT_Z, KX_CTL_J, KX_ALT_F, KC_G, KC_B, XXXXXXX, XXXXXXX, KC_COMM, KX_ALT_DOT, KX_CTL_SCLN, KX_SFT_X, KC_LGUI, + XXXXXXX, XXXXXXX, XXXXXXX, KX_P1_BSPC, KX_P2_SPC, MO(P3), XXXXXXX, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* P1: Punctuation (1) + .--------.-------.-------.-------.-------. .------.-------.-------.-------.------. + | Esc | | | | | | | | / | ^ | | ~ | + |--------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Tab | | | | | | & | \ | ` | $ | Ent | + |--------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | | | % | Alt | Ctl | Sft | Sup | + '--------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------' + | P1 | | | | | Sft | | + '-------'-------'-----' '-----'------'-------' + */ + [P1] = LAYOUT( + KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KX_PIPE, KC_SLSH, KC_CIRC, KC_HASH, KX_TILDA, + KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_AMPR, KC_NUBS, KC_GRV, KC_DLR, KC_ENT, + KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_PERC, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* P2: Punctuation (2) + .-------.-------.-------.-------.-------. .-------.-------.-------.-------.------. + | Esc | | NC | FV | | | ( | ) | " | ? | | + |-------+-------+-------+-------+-------| |-------+-------+-------+-------+------| + | Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | { | } | ' | ! | Ent | + |-------+-------+-------+-------+-------| |-------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | Ent | | # | Alt | Ctl | Sft | Sup | + '-------'-------'-------+-------+-------+-----. .-----+-------+-------+-------'-------'------' + | BS | P2 | | | | Sft | | + '-------'-------'-----' '-----'-------'-------' + */ + [P2] = LAYOUT( + KC_ESC, XXXXXXX, TO(NC), TO(FV), XXXXXXX, XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN, KX_DQUOT, KC_QUES, XXXXXXX, + KC_TAB, LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_Z), XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, KC_QUOT, KC_EXLM, KC_ENT, + KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, KC_ENT, XXXXXXX, XXXXXXX, KC_NUHS, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* P3: Punctuation (3) + .-------.-------.-------.-------.-------. .------.-------.-------.-------.------. + | Esc | | Break | Pscr | ScLk | | < | > | + | _ | = | + |-------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Tab | | | Caps | | | [ | ] | * | - | Ent | + |-------+-------+-------+-------+-------| |------+-------+-------+-------+------| + | Sft | Ctl | Alt | Del | | | @ | Alt | Ctl | Sft | Sup | + '-------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------' + | BS | | P3 | | | Sft | | + '-------'-------'-----' '-----'------'-------' + */ + [P3] = LAYOUT( + KC_ESC, XXXXXXX, KC_BRK, KC_PSCR, KC_SLCK, XXXXXXX, XXXXXXX, KC_LABK, KC_RABK, KC_PLUS, KC_UNDS, KC_EQL, + KC_TAB, XXXXXXX, XXXXXXX, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_ASTR, KC_MINS, KC_ENT, + KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KX_AT, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* NC: Numerals / Cursor control + .-------.-------.-------.------.-------. .------.-------.-------.------.------. + | 1 | 2 | 3 | 4 | 5 | | Home | Up | End | PgUp | | + |-------+-------+-------+------+-------| |------+-------+-------+------+------| + | 6 | 7 | 8 | 9 | 0 | | Left | Down | Right | PgDn | | + |-------+-------+-------+------+-------| |------+-------+-------+------+------| + | Sft | Ctl | Alt | Del | . | | Ins | Alt | Ctl | Sft | Sup | + '-------'-------'-------+------+-------+-----. .-----+------+-------+-------'------'------' + | BS | BA | | | | Sft | | + '------'-------'-----' '-----'------'-------' + */ + [NC] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, + KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, + KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, KC_DOT, XXXXXXX, XXXXXXX, KC_INS, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, TO(BA), XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* FV: Function keys / Cursor control (Vim) + .-------.------.-------.-----.-------. .------.-------.-----.-------.------. + | F1 | F2 | F3 | F4 | F5 | | 0 | K | $ | Ctl-B | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | F6 | F7 | F8 | F9 | F10 | | H | J | L | Ctl-F | | + |-------+------+-------+-----+-------| |------+-------+-----+-------+------| + | Sft | Ctl | Alt | F11 | F12 | | | Alt | Ctl | Sft | Sup | + '-------'------'-------+-----+-------+-----. .-----+------+-------+-----'-------'------' + | BS | BA | | | | Sft | | + '-----'-------'-----' '-----'------'-------' + */ + [FV] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_0, KC_K, KC_DLR, LCTL(KC_B), XXXXXXX, + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_H, KC_J, KC_L, LCTL(KC_F), XXXXXXX, + KC_LSFT, KC_LCTL, KC_LALT, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_LCTL, KC_LSFT, _______, + XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, TO(BA), XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ) + +}; + diff --git a/keyboards/niu_mini/keymaps/yttyx/rules.mk b/keyboards/niu_mini/keymaps/yttyx/rules.mk new file mode 100644 index 00000000000..d8b21aa842d --- /dev/null +++ b/keyboards/niu_mini/keymaps/yttyx/rules.mk @@ -0,0 +1,10 @@ +# Build Options +AUDIO_ENABLE = no +CONSOLE_ENABLE = no +EXTRAKEY_ENABLE = no +MIDI_ENABLE = no +MOUSEKEY_ENABLE = no +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = no +STENO_ENABLE = no +VIRTSER_ENABLE = no diff --git a/keyboards/niu_mini/readme.md b/keyboards/niu_mini/readme.md index 91f0cd4b6c6..36e8c8458b6 100644 --- a/keyboards/niu_mini/readme.md +++ b/keyboards/niu_mini/readme.md @@ -11,6 +11,6 @@ Hardware Availability: [KBDFans](https://kbdfans.myshopify.com/products/niu-mini Make example for this keyboard (after setting up your build environment): - make niu_mini:default:avrdude + make niu_mini:default:dfu -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/niu_mini/rules.mk b/keyboards/niu_mini/rules.mk index b8d0ace97a4..9b772fcb808 100644 --- a/keyboards/niu_mini/rules.mk +++ b/keyboards/niu_mini/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -44,7 +43,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Atmel DFU loader 4096 # LUFA bootloader 4096 # USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +BOOTLOADER = atmel-dfu # Build Options # change to "no" to disable the options, or define them in the Makefile in @@ -58,7 +57,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 +AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. diff --git a/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.c b/keyboards/nk65/boards/GENERIC_STM32_F303XC/board.c old mode 100644 new mode 100755 similarity index 100% rename from keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.c rename to keyboards/nk65/boards/GENERIC_STM32_F303XC/board.c diff --git a/keyboards/nk65/boards/GENERIC_STM32_F303XC/board.h b/keyboards/nk65/boards/GENERIC_STM32_F303XC/board.h new file mode 100755 index 00000000000..54df72ea681 --- /dev/null +++ b/keyboards/nk65/boards/GENERIC_STM32_F303XC/board.h @@ -0,0 +1,1187 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for NK65 Keyboard + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F303XC +#define BOARD_NAME "NK65 PCB" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 8000000U +#endif + +// #define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F303xC + +/* + * IO pins assignments. + */ +#define GPIOA_PIN0 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_PIN13 13U +#define GPIOB_PIN14 14U +#define GPIOB_PIN15 15U + +#define GPIOC_PIN0 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_PIN6 6U +#define GPIOC_PIN7 7U +#define GPIOC_PIN8 8U +#define GPIOC_PIN9 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_PIN14 14U +#define GPIOC_PIN15 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_I2C2_SDA 0U +#define GPIOF_I2C2_SCL 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +#define GPIOG_PIN0 0U +#define GPIOG_PIN1 1U +#define GPIOG_PIN2 2U +#define GPIOG_PIN3 3U +#define GPIOG_PIN4 4U +#define GPIOG_PIN5 5U +#define GPIOG_PIN6 6U +#define GPIOG_PIN7 7U +#define GPIOG_PIN8 8U +#define GPIOG_PIN9 9U +#define GPIOG_PIN10 10U +#define GPIOG_PIN11 11U +#define GPIOG_PIN12 12U +#define GPIOG_PIN13 13U +#define GPIOG_PIN14 14U +#define GPIOG_PIN15 15U + +#define GPIOH_PIN0 0U +#define GPIOH_PIN1 1U +#define GPIOH_PIN2 2U +#define GPIOH_PIN3 3U +#define GPIOH_PIN4 4U +#define GPIOH_PIN5 5U +#define GPIOH_PIN6 6U +#define GPIOH_PIN7 7U +#define GPIOH_PIN8 8U +#define GPIOH_PIN9 9U +#define GPIOH_PIN10 10U +#define GPIOH_PIN11 11U +#define GPIOH_PIN12 12U +#define GPIOH_PIN13 13U +#define GPIOH_PIN14 14U +#define GPIOH_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_PIN6 PAL_LINE(GPIOF, 0U) +#define LINE_PIN7 PAL_LINE(GPIOF, 1U) + +#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) + + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - NC + * PA1 - NC + * PA2 - COL1 + * PA3 - COL2 + * PA4 - SPEAKER1 + * PA5 - SPEAKER2 + * PA6 - COL3 + * PA7 - COL8 + * PA8 - COL6 + * PA9 - COL7 + * PA10 - ROW5 + * PA11 - USB_DM (alternate 14). + * PA12 - USB_DP (alternate 14). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - ROW4 + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ + PIN_MODE_ALTERNATE(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ + PIN_AFIO_AF(GPIOA_PIN1, 1) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0) | \ + PIN_AFIO_AF(GPIOA_PIN5, 5) | \ + PIN_AFIO_AF(GPIOA_PIN6, 5) | \ + PIN_AFIO_AF(GPIOA_PIN7, 5)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (alternate 0). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). + * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - PIN13 (input pullup). + * PB14 - PIN14 (input pullup). + * PB15 - PIN15 (input pullup). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ + PIN_MODE_OUTPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_INPUT(GPIOB_PIN13) | \ + PIN_MODE_INPUT(GPIOB_PIN14) | \ + PIN_MODE_INPUT(GPIOB_PIN15)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ + PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN15)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_LOW(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_PIN13) | \ + PIN_ODR_HIGH(GPIOB_PIN14) | \ + PIN_ODR_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0) | \ + PIN_AFIO_AF(GPIOB_PIN6, 4) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0) | \ + PIN_AFIO_AF(GPIOB_PIN13, 0) | \ + PIN_AFIO_AF(GPIOB_PIN14, 0) | \ + PIN_AFIO_AF(GPIOB_PIN15, 0)) + +/* + * GPIOC setup: + * + * PC0 - PIN0 (input pullup). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - PIN6 (input pullup). + * PC7 - PIN7 (input pullup). + * PC8 - PIN8 (input pullup). + * PC9 - PIN9 (input pullup). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - PIN14 (input floating). + * PC15 - PIN15 (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_INPUT(GPIOC_PIN6) | \ + PIN_MODE_INPUT(GPIOC_PIN7) | \ + PIN_MODE_INPUT(GPIOC_PIN8) | \ + PIN_MODE_INPUT(GPIOC_PIN9) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_PIN14) | \ + PIN_MODE_INPUT(GPIOC_PIN15)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN15)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_HIGH(GPIOC_PIN6) | \ + PIN_ODR_HIGH(GPIOC_PIN7) | \ + PIN_ODR_HIGH(GPIOC_PIN8) | \ + PIN_ODR_HIGH(GPIOC_PIN9) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_PIN14) | \ + PIN_ODR_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0) | \ + PIN_AFIO_AF(GPIOC_PIN6, 0) | \ + PIN_AFIO_AF(GPIOC_PIN7, 0)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ + PIN_AFIO_AF(GPIOC_PIN9, 0) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0) | \ + PIN_AFIO_AF(GPIOC_PIN14, 0) | \ + PIN_AFIO_AF(GPIOC_PIN15, 0)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD11 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 L3GD20_CS (output pushpull maximum). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (output pushpull maximum). + * PE9 - PIN9 (output pushpull maximum). + * PE10 - PIN10 (output pushpull maximum). + * PE11 - PIN11 (output pushpull maximum). + * PE12 - PIN12 (output pushpull maximum). + * PE13 - PIN13 (output pushpull maximum). + * PE14 - PIN14 (output pushpull maximum). + * PE15 - PIN15 (output pushpull maximum). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) |\ + PIN_MODE_OUTPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) |\ + PIN_MODE_INPUT(GPIOE_PIN5) |\ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_OUTPUT(GPIOE_PIN8) | \ + PIN_MODE_OUTPUT(GPIOE_PIN9) | \ + PIN_MODE_OUTPUT(GPIOE_PIN10) | \ + PIN_MODE_OUTPUT(GPIOE_PIN11) | \ + PIN_MODE_OUTPUT(GPIOE_PIN12) | \ + PIN_MODE_OUTPUT(GPIOE_PIN13) | \ + PIN_MODE_OUTPUT(GPIOE_PIN14) | \ + PIN_MODE_OUTPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_LOW(GPIOE_PIN8) | \ + PIN_ODR_LOW(GPIOE_PIN9) | \ + PIN_ODR_LOW(GPIOE_PIN10) | \ + PIN_ODR_LOW(GPIOE_PIN11) | \ + PIN_ODR_LOW(GPIOE_PIN12) | \ + PIN_ODR_LOW(GPIOE_PIN13) | \ + PIN_ODR_LOW(GPIOE_PIN14) | \ + PIN_ODR_LOW(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0) |\ + PIN_AFIO_AF(GPIOE_PIN3, 0) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0) |\ + PIN_AFIO_AF(GPIOE_PIN5, 0) |\ + PIN_AFIO_AF(GPIOE_PIN6, 0) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0)) + +/* + * GPIOF setup: + * + * PF0 - I2C2_SDA (input floating). + * PF1 - I2C2_SCL (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ + PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ + PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ + PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ + PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ + PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ + PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0)) + +/* + * GPIOG setup: + * + * PG0 - PIN0 (input pullup). + * PG1 - PIN1 (input pullup). + * PG2 - PIN2 (input pullup). + * PG3 - PIN3 (input pullup). + * PG4 - PIN4 (input pullup). + * PG5 - PIN5 (input pullup). + * PG6 - PIN6 (input pullup). + * PG7 - PIN7 (input pullup). + * PG8 - PIN8 (input pullup). + * PG9 - PIN9 (input pullup). + * PG10 - PIN10 (input pullup). + * PG11 - PIN11 (input pullup). + * PG12 - PIN12 (input pullup). + * PG13 - PIN13 (input pullup). + * PG14 - PIN14 (input pullup). + * PG15 - PIN15 (input pullup). + */ +#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ + PIN_MODE_INPUT(GPIOG_PIN1) | \ + PIN_MODE_INPUT(GPIOG_PIN2) | \ + PIN_MODE_INPUT(GPIOG_PIN3) | \ + PIN_MODE_INPUT(GPIOG_PIN4) | \ + PIN_MODE_INPUT(GPIOG_PIN5) | \ + PIN_MODE_INPUT(GPIOG_PIN6) | \ + PIN_MODE_INPUT(GPIOG_PIN7) | \ + PIN_MODE_INPUT(GPIOG_PIN8) | \ + PIN_MODE_INPUT(GPIOG_PIN9) | \ + PIN_MODE_INPUT(GPIOG_PIN10) | \ + PIN_MODE_INPUT(GPIOG_PIN11) | \ + PIN_MODE_INPUT(GPIOG_PIN12) | \ + PIN_MODE_INPUT(GPIOG_PIN13) | \ + PIN_MODE_INPUT(GPIOG_PIN14) | \ + PIN_MODE_INPUT(GPIOG_PIN15)) +#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN15)) +#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN15)) +#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ + PIN_ODR_HIGH(GPIOG_PIN1) | \ + PIN_ODR_HIGH(GPIOG_PIN2) | \ + PIN_ODR_HIGH(GPIOG_PIN3) | \ + PIN_ODR_HIGH(GPIOG_PIN4) | \ + PIN_ODR_HIGH(GPIOG_PIN5) | \ + PIN_ODR_HIGH(GPIOG_PIN6) | \ + PIN_ODR_HIGH(GPIOG_PIN7) | \ + PIN_ODR_HIGH(GPIOG_PIN8) | \ + PIN_ODR_HIGH(GPIOG_PIN9) | \ + PIN_ODR_HIGH(GPIOG_PIN10) | \ + PIN_ODR_HIGH(GPIOG_PIN11) | \ + PIN_ODR_HIGH(GPIOG_PIN12) | \ + PIN_ODR_HIGH(GPIOG_PIN13) | \ + PIN_ODR_HIGH(GPIOG_PIN14) | \ + PIN_ODR_HIGH(GPIOG_PIN15)) +#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ + PIN_AFIO_AF(GPIOG_PIN1, 0) | \ + PIN_AFIO_AF(GPIOG_PIN2, 0) | \ + PIN_AFIO_AF(GPIOG_PIN3, 0) | \ + PIN_AFIO_AF(GPIOG_PIN4, 0) | \ + PIN_AFIO_AF(GPIOG_PIN5, 0) | \ + PIN_AFIO_AF(GPIOG_PIN6, 0) | \ + PIN_AFIO_AF(GPIOG_PIN7, 0)) +#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ + PIN_AFIO_AF(GPIOG_PIN9, 0) | \ + PIN_AFIO_AF(GPIOG_PIN10, 0) | \ + PIN_AFIO_AF(GPIOG_PIN11, 0) | \ + PIN_AFIO_AF(GPIOG_PIN12, 0) | \ + PIN_AFIO_AF(GPIOG_PIN13, 0) | \ + PIN_AFIO_AF(GPIOG_PIN14, 0) | \ + PIN_AFIO_AF(GPIOG_PIN15, 0)) + +/* + * GPIOH setup: + * + * PH0 - PIN0 (input pullup). + * PH1 - PIN1 (input pullup). + * PH2 - PIN2 (input pullup). + * PH3 - PIN3 (input pullup). + * PH4 - PIN4 (input pullup). + * PH5 - PIN5 (input pullup). + * PH6 - PIN6 (input pullup). + * PH7 - PIN7 (input pullup). + * PH8 - PIN8 (input pullup). + * PH9 - PIN9 (input pullup). + * PH10 - PIN10 (input pullup). + * PH11 - PIN11 (input pullup). + * PH12 - PIN12 (input pullup). + * PH13 - PIN13 (input pullup). + * PH14 - PIN14 (input pullup). + * PH15 - PIN15 (input pullup). + */ +#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ + PIN_MODE_INPUT(GPIOH_PIN1) | \ + PIN_MODE_INPUT(GPIOH_PIN2) | \ + PIN_MODE_INPUT(GPIOH_PIN3) | \ + PIN_MODE_INPUT(GPIOH_PIN4) | \ + PIN_MODE_INPUT(GPIOH_PIN5) | \ + PIN_MODE_INPUT(GPIOH_PIN6) | \ + PIN_MODE_INPUT(GPIOH_PIN7) | \ + PIN_MODE_INPUT(GPIOH_PIN8) | \ + PIN_MODE_INPUT(GPIOH_PIN9) | \ + PIN_MODE_INPUT(GPIOH_PIN10) | \ + PIN_MODE_INPUT(GPIOH_PIN11) | \ + PIN_MODE_INPUT(GPIOH_PIN12) | \ + PIN_MODE_INPUT(GPIOH_PIN13) | \ + PIN_MODE_INPUT(GPIOH_PIN14) | \ + PIN_MODE_INPUT(GPIOH_PIN15)) +#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) +#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN15)) +#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ + PIN_ODR_HIGH(GPIOH_PIN1) | \ + PIN_ODR_HIGH(GPIOH_PIN2) | \ + PIN_ODR_HIGH(GPIOH_PIN3) | \ + PIN_ODR_HIGH(GPIOH_PIN4) | \ + PIN_ODR_HIGH(GPIOH_PIN5) | \ + PIN_ODR_HIGH(GPIOH_PIN6) | \ + PIN_ODR_HIGH(GPIOH_PIN7) | \ + PIN_ODR_HIGH(GPIOH_PIN8) | \ + PIN_ODR_HIGH(GPIOH_PIN9) | \ + PIN_ODR_HIGH(GPIOH_PIN10) | \ + PIN_ODR_HIGH(GPIOH_PIN11) | \ + PIN_ODR_HIGH(GPIOH_PIN12) | \ + PIN_ODR_HIGH(GPIOH_PIN13) | \ + PIN_ODR_HIGH(GPIOH_PIN14) | \ + PIN_ODR_HIGH(GPIOH_PIN15)) +#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ + PIN_AFIO_AF(GPIOH_PIN1, 0) | \ + PIN_AFIO_AF(GPIOH_PIN2, 0) | \ + PIN_AFIO_AF(GPIOH_PIN3, 0) | \ + PIN_AFIO_AF(GPIOH_PIN4, 0) | \ + PIN_AFIO_AF(GPIOH_PIN5, 0) | \ + PIN_AFIO_AF(GPIOH_PIN6, 0) | \ + PIN_AFIO_AF(GPIOH_PIN7, 0)) +#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ + PIN_AFIO_AF(GPIOH_PIN9, 0) | \ + PIN_AFIO_AF(GPIOH_PIN10, 0) | \ + PIN_AFIO_AF(GPIOH_PIN11, 0) | \ + PIN_AFIO_AF(GPIOH_PIN12, 0) | \ + PIN_AFIO_AF(GPIOH_PIN13, 0) | \ + PIN_AFIO_AF(GPIOH_PIN14, 0) | \ + PIN_AFIO_AF(GPIOH_PIN15, 0)) + + +/* + * USB bus activation macro, required by the USB driver. + */ +// #define usb_lld_connect_bus(usbp) +#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) +// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) +/* + * USB bus de-activation macro, required by the USB driver. + */ +// #define usb_lld_disconnect_bus(usbp) +#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) +// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.mk b/keyboards/nk65/boards/GENERIC_STM32_F303XC/board.mk old mode 100644 new mode 100755 similarity index 100% rename from keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.mk rename to keyboards/nk65/boards/GENERIC_STM32_F303XC/board.mk diff --git a/keyboards/preonic/rev3/bootloader_defs.h b/keyboards/nk65/bootloader_defs.h old mode 100644 new mode 100755 similarity index 100% rename from keyboards/preonic/rev3/bootloader_defs.h rename to keyboards/nk65/bootloader_defs.h diff --git a/keyboards/nk65/chconf.h b/keyboards/nk65/chconf.h new file mode 100755 index 00000000000..1d9f12ff1f8 --- /dev/null +++ b/keyboards/nk65/chconf.h @@ -0,0 +1,520 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM TRUE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/nk65/config.h b/keyboards/nk65/config.h new file mode 100755 index 00000000000..791e4446898 --- /dev/null +++ b/keyboards/nk65/config.h @@ -0,0 +1,154 @@ +/* +Copyright 2019 Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x8968 +#define PRODUCT_ID 0x4E4B +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar-Designs +#define PRODUCT NK65 +#define DESCRIPTION A 65-percent, tool-free RGB keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define MATRIX_ROW_PINS { B3, B4, B5, A8, A4 } +#define MATRIX_COL_PINS { A13, A10, A9, A14, A15, B8, B9, C13, C14, C15, A0, A1, A2, A3, A5 } +// To enable debugger set A13 A14 -> A5 A7 + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* Backlight options */ + +#define RGB_BACKLIGHT_ENABLED 1 + +#define RGB_BACKLIGHT_NK65 + +// they aren't really used if RGB_BACKLIGHT_HS60 defined +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 128 + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0100000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111111000000111 + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+32) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 67 +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +// Dynamic macro starts after dynamic keymaps (67+(4*5*15*2)) = (67+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 667 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/nk65/halconf.h b/keyboards/nk65/halconf.h new file mode 100755 index 00000000000..c3e0cbb728c --- /dev/null +++ b/keyboards/nk65/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/keyboards/nk65/info.json b/keyboards/nk65/info.json new file mode 100755 index 00000000000..4edb13e8c02 --- /dev/null +++ b/keyboards/nk65/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "NK65", + "url": "", + "maintainer": "yiancar", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_65_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Page Up", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Page Down", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/nk65/keymaps/default/keymap.c b/keyboards/nk65/keymaps/default/keymap.c new file mode 100755 index 00000000000..a793a8bf412 --- /dev/null +++ b/keyboards/nk65/keymaps/default/keymap.c @@ -0,0 +1,58 @@ +/* Copyright 2019 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_65_ansi( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,\ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[1] = LAYOUT_65_ansi( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_65_ansi( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_65_ansi( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/nk65/keymaps/default/readme.md b/keyboards/nk65/keymaps/default/readme.md new file mode 100755 index 00000000000..27bcd0501d4 --- /dev/null +++ b/keyboards/nk65/keymaps/default/readme.md @@ -0,0 +1,6 @@ +The default keymap for NK65. VIA support disabled. +========================================================= + +![Layout image](https://i.imgur.com/DL0CjJO.png) + +Default layer is normal ANSI 65% \ No newline at end of file diff --git a/keyboards/nk65/keymaps/default_via/keymap.c b/keyboards/nk65/keymaps/default_via/keymap.c new file mode 100755 index 00000000000..a793a8bf412 --- /dev/null +++ b/keyboards/nk65/keymaps/default_via/keymap.c @@ -0,0 +1,58 @@ +/* Copyright 2019 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_65_ansi( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,\ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[1] = LAYOUT_65_ansi( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_65_ansi( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_65_ansi( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/nk65/keymaps/default_via/readme.md b/keyboards/nk65/keymaps/default_via/readme.md new file mode 100755 index 00000000000..6689191e4c1 --- /dev/null +++ b/keyboards/nk65/keymaps/default_via/readme.md @@ -0,0 +1,6 @@ +The default keymap for NK65. VIA support enabled. +========================================================= + +![Layout image](https://i.imgur.com/DL0CjJO.png) + +Default layer is normal ANSI 65% \ No newline at end of file diff --git a/keyboards/nk65/keymaps/default_via/rules.mk b/keyboards/nk65/keymaps/default_via/rules.mk new file mode 100755 index 00000000000..b8311f5e7f0 --- /dev/null +++ b/keyboards/nk65/keymaps/default_via/rules.mk @@ -0,0 +1,67 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/nk65/mcuconf.h b/keyboards/nk65/mcuconf.h new file mode 100755 index 00000000000..ce608f904ed --- /dev/null +++ b/keyboards/nk65/mcuconf.h @@ -0,0 +1,257 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32F3xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F3xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 +#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_USART2SW STM32_USART2SW_PCLK +#define STM32_USART3SW STM32_USART3SW_PCLK +#define STM32_UART4SW STM32_UART4SW_PCLK +#define STM32_UART5SW STM32_UART5SW_PCLK +#define STM32_I2C1SW STM32_I2C1SW_SYSCLK +#define STM32_I2C2SW STM32_I2C2SW_SYSCLK +#define STM32_TIM1SW STM32_TIM1SW_PCLK2 +#define STM32_TIM8SW STM32_TIM8SW_PCLK2 +#define STM32_RTCSEL STM32_RTCSEL_LSI +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 + +#undef STM32_HSE_BYPASS +// #error "oh no" +// #endif + +/* + * ADC driver system settings. + */ +#define STM32_ADC_DUAL_MODE FALSE +#define STM32_ADC_COMPACT_SAMPLES FALSE +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_USE_ADC2 FALSE +#define STM32_ADC_USE_ADC3 FALSE +#define STM32_ADC_USE_ADC4 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) +#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) +#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) +#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC2_DMA_PRIORITY 2 +#define STM32_ADC_ADC3_DMA_PRIORITY 2 +#define STM32_ADC_ADC4_DMA_PRIORITY 2 +#define STM32_ADC_ADC12_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 +#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE FALSE +#define STM32_DAC_USE_DAC1_CH1 TRUE +#define STM32_DAC_USE_DAC1_CH2 TRUE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 TRUE +#define STM32_GPT_USE_TIM6 TRUE +#define STM32_GPT_USE_TIM7 TRUE +#define STM32_GPT_USE_TIM8 TRUE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM6_IRQ_PRIORITY 7 +#define STM32_GPT_TIM7_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 10 +#define STM32_I2C_I2C2_IRQ_PRIORITY 10 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +#endif /* MCUCONF_H */ diff --git a/keyboards/nk65/nk65.c b/keyboards/nk65/nk65.c new file mode 100755 index 00000000000..49524621835 --- /dev/null +++ b/keyboards/nk65/nk65.c @@ -0,0 +1,18 @@ +/* Copyright 2019 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef RGB_BACKLIGHT_NK65 + #error RGB_BACKLIGHT_NK65 not defined, recheck config.h + #endif diff --git a/keyboards/nk65/nk65.h b/keyboards/nk65/nk65.h new file mode 100755 index 00000000000..49725a7e64e --- /dev/null +++ b/keyboards/nk65/nk65.h @@ -0,0 +1,38 @@ +/* Copyright 2019 Yiancar + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#define XXX KC_NO + +#include "quantum.h" +#include "../wilba_tech/wt_rgb_backlight_keycodes.h" +#include "../wilba_tech/via_keycodes.h" + +// This a shortcut to help you visually see your layout. + +#define LAYOUT_65_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, K49, K4A, K4B, K4C, K4D, K4E } \ +} diff --git a/keyboards/nk65/readme.md b/keyboards/nk65/readme.md new file mode 100755 index 00000000000..41f52615a74 --- /dev/null +++ b/keyboards/nk65/readme.md @@ -0,0 +1,37 @@ +NK65 +========= + +![NK65](https://i.imgur.com/EXNbVpL.jpg) + +This is a standard fixed layout 65% PCB. It supports VIA and full per-key RGB. + +Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) +Hardware Supported: A 65% keyboard with STM32F303CC +Hardware Availability: https://novelkeys.xyz/ + +Due to the RGB implementation, the NK65 is currently not compatible with community layouts. + +## Instructions + +### Build + +Make example for this keyboard (after setting up your build environment): + + make nk65:default_via + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +### Reset + +- Unplug +- Hold Escape +- Plug In +- Unplug +- Release Escape + +### Flash + +- Unplug +- Hold Escape +- Plug In +- Flash using QMK Toolbox or dfu-util (`make nk65::dfu-util`) diff --git a/keyboards/nk65/rules.mk b/keyboards/nk65/rules.mk new file mode 100755 index 00000000000..ca0a8e58557 --- /dev/null +++ b/keyboards/nk65/rules.mk @@ -0,0 +1,69 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + drivers/issi/is31fl3733.c \ + quantum/color.c \ + drivers/arm/i2c_master.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no # Audio output on port C6 +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes + +RAW_ENABLE = no +DYNAMIC_KEYMAP_ENABLE = no +CIE1931_CURVE = yes + +LAYOUTS = 65_ansi diff --git a/keyboards/nomu30/config.h b/keyboards/nomu30/config.h new file mode 100644 index 00000000000..13fae5af3aa --- /dev/null +++ b/keyboards/nomu30/config.h @@ -0,0 +1,49 @@ +/* +Copyright 2019 Naoto Takai + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC0C0 +#define PRODUCT_ID 0x3000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Naoto Takai +#define PRODUCT nomu30 +#define DESCRIPTION A 30% keyboard with ISO enter. + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D1, D0, D4 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, F4, F5, F6, F7, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/nomu30/info.json b/keyboards/nomu30/info.json new file mode 100644 index 00000000000..d0c18601693 --- /dev/null +++ b/keyboards/nomu30/info.json @@ -0,0 +1,172 @@ +{ + "keyboard_name": "Nomu30", + "url": "https://keys.recompile.net/projects/nomu30/", + "maintainer": "takai", + "width": 11.5, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + { + "label": "Q", + "x": 0.5, + "y": 0 + }, + { + "label": "W", + "x": 1.5, + "y": 0 + }, + { + "label": "E", + "x": 2.5, + "y": 0 + }, + { + "label": "R", + "x": 3.5, + "y": 0 + }, + { + "label": "T", + "x": 4.5, + "y": 0 + }, + { + "label": "Y", + "x": 5.5, + "y": 0 + }, + { + "label": "U", + "x": 6.5, + "y": 0 + }, + { + "label": "I", + "x": 7.5, + "y": 0 + }, + { + "label": "O", + "x": 8.5, + "y": 0 + }, + { + "label": "P", + "x": 9.5, + "y": 0 + }, + { + "label": "Del", + "x": 10.5, + "y": 0 + }, + { + "label": "|", + "x": 0, + "y": 1 + }, + { + "label": "A", + "x": 1, + "y": 1 + }, + { + "label": "S", + "x": 2, + "y": 1 + }, + { + "label": "D", + "x": 3, + "y": 1 + }, + { + "label": "F", + "x": 4, + "y": 1 + }, + { + "label": "G", + "x": 5, + "y": 1 + }, + { + "label": "H", + "x": 6, + "y": 1 + }, + { + "label": "J", + "x": 7, + "y": 1 + }, + { + "label": "K", + "x": 8, + "y": 1 + }, + { + "label": "L", + "x": 9, + "y": 1 + }, + { + "label": "Enter", + "x": 10.25, + "y": 1, + "w": 1.25, + "h": 2 + }, + { + "label": "Control", + "x": 0, + "y": 2, + "w": 1.5 + }, + { + "label": "Z", + "x": 1.5, + "y": 2 + }, + { + "label": "X", + "x": 2.5, + "y": 2 + }, + { + "label": "C", + "x": 3.5, + "y": 2 + }, + { + "label": "V", + "x": 4.5, + "y": 2 + }, + { + "label": "B", + "x": 5.5, + "y": 2 + }, + { + "label": "N", + "x": 6.5, + "y": 2 + }, + { + "label": "M", + "x": 7.5, + "y": 2 + }, + { + "label": "Shift", + "x": 8.5, + "y": 2, + "w": 1.75 + } + ] + } + } +} diff --git a/keyboards/nomu30/keymaps/center_sprit/config.h b/keyboards/nomu30/keymaps/center_sprit/config.h new file mode 100644 index 00000000000..8861dc53968 --- /dev/null +++ b/keyboards/nomu30/keymaps/center_sprit/config.h @@ -0,0 +1,66 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT + +#define TAPPING_LAYER_TERM 150 // Custom LT Tapping term +#define TAPPING_TERM_PER_KEY + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + +// LED Setting: if you have KUMO you can use RGBLIGHT_ENABLE = yes +#ifdef RGBLIGHT_ENABLE + #define RGB_DI_PIN B5 + #define RGBLIGHT_TIMER + + #define RGBLED_NUM 6 +#endif diff --git a/keyboards/nomu30/keymaps/center_sprit/keymap.c b/keyboards/nomu30/keymaps/center_sprit/keymap.c new file mode 100644 index 00000000000..8ef037f42b6 --- /dev/null +++ b/keyboards/nomu30/keymaps/center_sprit/keymap.c @@ -0,0 +1,159 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + RGBRST = SAFE_RANGE, + LOWER, + RAISE, + KANJI, +}; + +enum tapdances{ + TD_CODO = 0, + }; + +// Layer Mode aliases +#define KC_MLAD MO(_ADJUST) + +// Base layer mod tap +#define KC_SLSF LSFT_T(KC_SLSH) +#define KC_Z_CT LCTL_T(KC_Z) +#define KC_X_AL LALT_T(KC_X) +#define KC_C_GU LGUI_T(KC_C) +#define KC_ENSF LSFT_T(KC_ENT) +#define KC_M_CT LCTL_T(KC_M) + +// Lower layer mod tap +#define KC_F6SF LSFT_T(KC_F6) +#define KC_BSSF LSFT_T(KC_BSLS) +#define KC_11CT LCTL_T(KC_F11) +#define KC_12AL LALT_T(KC_F12) + +// Layer tap +#define KC_BSLO LT(_LOWER, KC_BSPC) +#define KC_SPRA LT(_RAISE, KC_SPC) + +// Tap dance +#define KC_CODO TD(TD_CODO) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT), + }; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + //,-------------------------------------------------------------------------------------------------------------. + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSLO, KC_Y, KC_U, KC_I, KC_O, KC_P, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_SLSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_Z_CT, KC_X_AL, KC_C_GU, KC_V, KC_B, KC_SPRA, KC_N, KC_M_CT, KC_CODO + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_LOWER] = LAYOUT( + //,-------------------------------------------------------------------------------------------------------------. + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUOT, KC_BSSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_11CT, KC_12AL, KC_ESC, KC_TAB, KANJI, KC_MLAD, XXXXXXX, KC_COMM, KC_DOT + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_RAISE] = LAYOUT( + //,-------------------------------------------------------------------------------------------------------------. + KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LSFT, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_SLSH, KC_RO + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_ADJUST] = LAYOUT( + //,-------------------------------------------------------------------------------------------------------------. + RESET, RGBRST, AG_NORM, AG_SWAP, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, _______, KC_BTN1, KC_BTN2, XXXXXXX + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ) +}; + +uint16_t get_tapping_term(uint16_t keycode) { + switch (keycode) { + case KC_BSLO: + return TAPPING_LAYER_TERM; + case KC_SPRA: + return TAPPING_LAYER_TERM; + default: + return TAPPING_TERM; + } +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void keyboard_post_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/nomu30/keymaps/center_sprit/readme.md b/keyboards/nomu30/keymaps/center_sprit/readme.md new file mode 100644 index 00000000000..754e37f46be --- /dev/null +++ b/keyboards/nomu30/keymaps/center_sprit/readme.md @@ -0,0 +1,68 @@ +# The center sprit (as known as treadstone/stonehenge style staggered like keymap) + +See [stonehenge30](https://github.com/marksard/qmk_firmware/tree/my_customize/keyboards/stonehenge30) + +A Nomu30 can use full color LED strip used by B5 pin. This keymap can use LED animation option. + +## Keymap Description + +- KC_SLSF ...... / key is one tap, Shift key is long push. +- KC_Z_CT ...... Z key is one tap, Ctrl key is long tap. +- KC_X_AL ...... X key is one tap, Alt key is long tap. +- KC_C_GU ...... C key is one tap, GUI key is long tap. +- KC_M_CT ...... M key is one tap, Ctrl key is long tap. +- KC_ENSF ...... Enter key is one tap, Ctrl key is long tap. +- KC_CODO ...... , key is one tap, . key is double tap. +- KC_BSLO ...... Backspace key is one tap, Move to Lower layer with long push. +- KC_SPRA ...... Space key is one tap, Move to Raise layer with. +- AG_NORM ...... If you use Mac set to mode. +- AG_SWAP ...... If you use Win set to mode. +- KANJI ...... Japanese IME toggle key. + +## How to move to Ajdust Layer + +At first, Move to Lower layer with long push. After that Adjust key with long push. Now you have into Adjust layer state. + +```c + + [_BASE] = LAYOUT( + //,-------------------------------------------------------------------------------------------------------------. + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSLO, KC_Y, KC_U, KC_I, KC_O, KC_P, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_SLSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_Z_CT, KC_X_AL, KC_C_GU, KC_V, KC_B, KC_SPRA, KC_N, KC_M_CT, KC_CODO + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_LOWER] = LAYOUT( + //,-------------------------------------------------------------------------------------------------------------. + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUOT, KC_BSSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_11CT, KC_12AL, KC_ESC, KC_TAB, KANJI, KC_MLAD, XXXXXXX, KC_COMM, KC_DOT + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_RAISE] = LAYOUT( + //,-------------------------------------------------------------------------------------------------------------. + KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LSFT, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_SLSH, KC_RO + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_ADJUST] = LAYOUT( + //,-------------------------------------------------------------------------------------------------------------. + RESET, RGBRST, AG_NORM, AG_SWAP, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, _______, KC_BTN1, KC_BTN2, XXXXXXX + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ) + +``` diff --git a/keyboards/nomu30/keymaps/center_sprit/rules.mk b/keyboards/nomu30/keymaps/center_sprit/rules.mk new file mode 100644 index 00000000000..1b0d208ced7 --- /dev/null +++ b/keyboards/nomu30/keymaps/center_sprit/rules.mk @@ -0,0 +1,26 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +TAP_DANCE_ENABLE = yes + +# If your custom treadstone32 pcb, you can rewrite to yes. +RGBLIGHT_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/nomu30/keymaps/default/config.h b/keyboards/nomu30/keymaps/default/config.h new file mode 100644 index 00000000000..fb21eed1bce --- /dev/null +++ b/keyboards/nomu30/keymaps/default/config.h @@ -0,0 +1,22 @@ +/* Copyright 2019 Naoto Takai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here + +#define TAPPING_TERM 200 +#define PERMISSIVE_HOLD diff --git a/keyboards/nomu30/keymaps/default/keymap.c b/keyboards/nomu30/keymaps/default/keymap.c new file mode 100644 index 00000000000..8878c3b1e85 --- /dev/null +++ b/keyboards/nomu30/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Naoto Takai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _BASE 0 +#define _NUMS 1 +#define _SYMS 2 +#define _FUNC 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + KC_LSFT, LALT_T(KC_Z), LGUI_T(KC_X), KC_C, LT(_SYMS, KC_V), LT(_FUNC, KC_B), LT(_NUMS, KC_N), KC_M, KC_SPC + ), + [_NUMS] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, + KC_TRNS, KC_LBRC, KC_RBRC, KC_SLSH, KC_BSLS, KC_TRNS, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_COMM, KC_DOT + ), + [_SYMS] = LAYOUT( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD, + KC_TRNS, KC_LCBR, KC_RCBR, KC_QUES, KC_PIPE, KC_TRNS, KC_UNDS, KC_PLUS, KC_COLN, KC_DQUO, KC_TRNS, + KC_TRNS, KC_LABK, KC_RABK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [_FUNC] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + KC_TAB, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, RESET, + KC_TRNS, KC_LALT, KC_LGUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/nomu30/keymaps/default/readme.md b/keyboards/nomu30/keymaps/default/readme.md new file mode 100644 index 00000000000..55bc4585010 --- /dev/null +++ b/keyboards/nomu30/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for nomu30 diff --git a/keyboards/nomu30/keymaps/like_jis/config.h b/keyboards/nomu30/keymaps/like_jis/config.h new file mode 100644 index 00000000000..8861dc53968 --- /dev/null +++ b/keyboards/nomu30/keymaps/like_jis/config.h @@ -0,0 +1,66 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT + +#define TAPPING_LAYER_TERM 150 // Custom LT Tapping term +#define TAPPING_TERM_PER_KEY + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + +// LED Setting: if you have KUMO you can use RGBLIGHT_ENABLE = yes +#ifdef RGBLIGHT_ENABLE + #define RGB_DI_PIN B5 + #define RGBLIGHT_TIMER + + #define RGBLED_NUM 6 +#endif diff --git a/keyboards/nomu30/keymaps/like_jis/keymap.c b/keyboards/nomu30/keymaps/like_jis/keymap.c new file mode 100644 index 00000000000..203d0a7a415 --- /dev/null +++ b/keyboards/nomu30/keymaps/like_jis/keymap.c @@ -0,0 +1,159 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + RGBRST = SAFE_RANGE, + LOWER, + RAISE, + KANJI, +}; + +// enum tapdances{ +// TD_CODO = 0, +// TD_SLRO, +// }; + +// Layer Mode aliases +#define KC_MLAD MO(_ADJUST) + +// Base layer mod tap +#define KC_CMSF LSFT_T(KC_COMM) +#define KC_DTCT LCTL_T(KC_DOT) +#define KC_Z_AL LALT_T(KC_Z) +#define KC_X_GU LGUI_T(KC_X) +#define KC_ENSF LSFT_T(KC_ENT) + +// Lower layer mod tap +#define KC_BSSF LSFT_T(KC_BSLS) +#define KC_11AL LALT_T(KC_F11) + +// Layer tap +#define KC_BSLO LT(_LOWER, KC_BSPC) +#define KC_SPRA LT(_RAISE, KC_SPC) + +// Tap dance +// #define KC_CODO TD(TD_CODO) +// #define KC_SLRO TD(TD_SLRO) + +// qk_tap_dance_action_t tap_dance_actions[] = { +// [TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT), +// [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO), +// }; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------------------. + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLO, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_CMSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_DTCT, KC_Z_AL, KC_X_GU, KC_C, KC_V, KC_B, KC_N, KC_M, KC_SPRA + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_LOWER] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------------------. + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, _______, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUOT, KC_BSSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, KC_11AL, KC_F12, KC_ESC, KC_TAB, KANJI, KC_COMM, KC_DOT, KC_MLAD + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_RAISE] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------------------. + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LSFT, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLSH, KC_RO, _______ + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_ADJUST] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------------------. + RESET, RGBRST, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ) +}; + +uint16_t get_tapping_term(uint16_t keycode) { + switch (keycode) { + case KC_BSLO: + return TAPPING_LAYER_TERM; + case KC_SPRA: + return TAPPING_LAYER_TERM; + default: + return TAPPING_TERM; + } +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void keyboard_post_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/nomu30/keymaps/like_jis/readme.md b/keyboards/nomu30/keymaps/like_jis/readme.md new file mode 100644 index 00000000000..ad64f06b157 --- /dev/null +++ b/keyboards/nomu30/keymaps/like_jis/readme.md @@ -0,0 +1,64 @@ +# The LikeJIS is Japanese Keyboard like keymap + +A Nomu30 can use full color LED strip used by B5 pin. This keymap can use LED animation option. + +## Keymap Description + +- KC_CMSF ...... , key is one tap, Shift key is long push. +- KC_DTCT ...... . key is one tap, Ctrl key is long tap. +- KC_ENSF ...... Enter key is one tap, Ctrl key is long tap. +- KC_Z_AL ...... Z key is one tap, Alt key is long tap. +- KC_X_GU ...... X key is one tap, GUI key is long tap. +- KC_BSLO ...... Backspace key is one tap, Move to Lower layer with long push. +- KC_SPRA ...... Space key is one tap, Move to Raise layer with. +- AG_NORM ...... If you use Mac set to mode. +- AG_SWAP ...... If you use Win set to mode. +- KANJI ...... Japanese IME toggle key. + +## How to move to Ajdust Layer + +At first, Move to Lower layer with long push. After that Adjust key with long push. Now you have into Adjust layer state. + +```c + + [_BASE] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------------------. + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLO, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_CMSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_DTCT, KC_Z_AL, KC_X_GU, KC_C, KC_V, KC_B, KC_N, KC_M, KC_SPRA + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_LOWER] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------------------. + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, _______, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUOT, KC_BSSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, KC_11AL, KC_F12, KC_ESC, KC_TAB, KANJI, KC_COMM, KC_DOT, KC_MLAD + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_RAISE] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------------------. + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LSFT, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLSH, KC_RO, _______ + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ), + + [_ADJUST] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------------------. + RESET, RGBRST, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX + //`---------+---------+---------+---------+---------+---------+---------+---------+---------' + ) + +``` diff --git a/keyboards/nomu30/keymaps/like_jis/rules.mk b/keyboards/nomu30/keymaps/like_jis/rules.mk new file mode 100644 index 00000000000..b1a6026c2ab --- /dev/null +++ b/keyboards/nomu30/keymaps/like_jis/rules.mk @@ -0,0 +1,26 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +TAP_DANCE_ENABLE = no + +# If your custom treadstone32 pcb, you can rewrite to yes. +RGBLIGHT_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/nomu30/nomu30.c b/keyboards/nomu30/nomu30.c new file mode 100644 index 00000000000..37a8614c11b --- /dev/null +++ b/keyboards/nomu30/nomu30.c @@ -0,0 +1,16 @@ +/* Copyright 2019 Naoto Takai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "nomu30.h" diff --git a/keyboards/nomu30/nomu30.h b/keyboards/nomu30/nomu30.h new file mode 100644 index 00000000000..e6c553bec52 --- /dev/null +++ b/keyboards/nomu30/nomu30.h @@ -0,0 +1,48 @@ +/* Copyright 2019 Naoto Takai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208 \ +) \ +{ \ + { KC_NO, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, KC_NO, KC_NO, KC_NO }, \ +} + +#define LAYOUT_kc( \ + K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208 \ +) \ +LAYOUT( \ + KC_##K001, KC_##K002, KC_##K003, KC_##K004, KC_##K005, KC_##K006, KC_##K007, KC_##K008, KC_##K009, KC_##K010, KC_##K011, \ + KC_##K100, KC_##K101, KC_##K102, KC_##K103, KC_##K104, KC_##K105, KC_##K106, KC_##K107, KC_##K108, KC_##K109, KC_##K110, \ + KC_##K200, KC_##K201, KC_##K202, KC_##K203, KC_##K204, KC_##K205, KC_##K206, KC_##K207, KC_##K208 \ +) diff --git a/keyboards/nomu30/readme.md b/keyboards/nomu30/readme.md new file mode 100644 index 00000000000..95577164a11 --- /dev/null +++ b/keyboards/nomu30/readme.md @@ -0,0 +1,15 @@ +# nomu30 + +![nomu30](https://keys.recompile.net/images/nomu30-main@600w.jpg) + +A 30% keyboard with ISO enter. + +Keyboard Maintainer: [Naoto Takai](https://github.com/takai) +Hardware Supported: The Nomu30 PCBs, ProMicro supported +Hardware Availability: https://keys.recompile.net/projects/nomu30/ + +Make example for this keyboard (after setting up your build environment): + + make nomu30:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/nomu30/rules.mk b/keyboards/nomu30/rules.mk new file mode 100644 index 00000000000..f51259b2910 --- /dev/null +++ b/keyboards/nomu30/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/novelpad/README.md b/keyboards/novelpad/README.md new file mode 100644 index 00000000000..5c73644a289 --- /dev/null +++ b/keyboards/novelpad/README.md @@ -0,0 +1,15 @@ +# NovelPad/NumChoc + +![NovelPad](https://i.imgur.com/vi4EdSh.jpg?1) + +A 5x4 macropad/numpad, sold by NovelKeys.xyz. There are two versions of the PCB, the NovelPad for MX switches and the NumChoc for Kailh Choc low profile switches. Both utilize the same firmware with no changes required. + +Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) / [Woodkeys.click](https://woodkeys.click) +Hardware Supported: NovelPad +Hardware Availability: [Novelkeys.xyz](https://novelkeys.xyz) + +Make example for this keyboard (after setting up your build environment): + + make novelpad:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/novelpad/config.h b/keyboards/novelpad/config.h index 3a47c0eb651..c9b6b91a595 100755 --- a/keyboards/novelpad/config.h +++ b/keyboards/novelpad/config.h @@ -40,7 +40,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE diff --git a/keyboards/novelpad/keymaps/0xdec/keymap.c b/keyboards/novelpad/keymaps/0xdec/keymap.c new file mode 100755 index 00000000000..429e6c5b3f8 --- /dev/null +++ b/keyboards/novelpad/keymaps/0xdec/keymap.c @@ -0,0 +1,59 @@ +/* +Copyright 2018 Jordi Pakey-Rodriguez + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + LT(1, KC_NLCK), KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_PEQL, + KC_P1, KC_P2, KC_P3, KC_TAB, + KC_PCMM, KC_P0, KC_PDOT, KC_PENT + ), + + [1] = LAYOUT( + _______, RESET, BL_STEP, RGB_TOG, + RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, + RGB_HUD, RGB_SAD, RGB_VAD, RGB_RMOD, + RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, + RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G + ), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +} + +void matrix_init_user(void) {} + +void matrix_scan_user(void) {} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) {} + return true; +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + // Illuminate the LED under the Num Lock key + rgblight_sethsv_at(0, 0, 127, 1); + } else { + rgblight_sethsv_at(0, 0, 0, 1); + } +} diff --git a/keyboards/novelpad/keymaps/default/keymap.c b/keyboards/novelpad/keymaps/default/keymap.c index 78cdff512e1..76e0937e6d2 100755 --- a/keyboards/novelpad/keymaps/default/keymap.c +++ b/keyboards/novelpad/keymaps/default/keymap.c @@ -16,8 +16,6 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H -#define _______ KC_TRNS - enum custom_keycodes { BL = SAFE_RANGE, WK_RED, @@ -45,10 +43,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - void matrix_init_user(void) { rgblight_setrgb(0,255,0); diff --git a/keyboards/novelpad/readme.md b/keyboards/novelpad/readme.md deleted file mode 100644 index 70bd6b6be72..00000000000 --- a/keyboards/novelpad/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# NovelPad/NumChoc - -![NovelPad](https://i.imgur.com/vi4EdSh.jpg?1) - -A 5x4 macropad/numpad, sold by NovelKeys.xyz. There are two versions of the PCB, the NovelPad for MX switches and the NumChoc for Kailh Choc low profile switches. Both utilize the same firmware with no changes required. - -Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) / [Woodkeys.click](https://woodkeys.click) -Hardware Supported: NovelPad -Hardware Availability: [Novelkeys.xyz](https://novelkeys.xyz) - -Make example for this keyboard (after setting up your build environment): - - make novelpad:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/noxary/220/220.c b/keyboards/noxary/220/220.c new file mode 100644 index 00000000000..e671e15a43a --- /dev/null +++ b/keyboards/noxary/220/220.c @@ -0,0 +1,62 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "220.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(C6); + matrix_init_user(); +} + + +/* + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(C6); + } else { + writePinHigh(C6); + } + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/noxary/220/220.h b/keyboards/noxary/220/220.h new file mode 100644 index 00000000000..3f1375e2a6a --- /dev/null +++ b/keyboards/noxary/220/220.h @@ -0,0 +1,42 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_6x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33, \ + K40, K41, K42, K43, \ + K50, K51, K52, K53 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 }, \ + { K50, K51, K52, K53 } \ +} diff --git a/keyboards/noxary/220/config.h b/keyboards/noxary/220/config.h new file mode 100644 index 00000000000..1242de61bc2 --- /dev/null +++ b/keyboards/noxary/220/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Noxary +#define PRODUCT 220 +#define DESCRIPTION A custom numpad + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C4, B0, D3, D4, D5, D6 } +#define MATRIX_COL_PINS { B4, C5, D2, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/220/info.json b/keyboards/noxary/220/info.json new file mode 100644 index 00000000000..252c824aa8e --- /dev/null +++ b/keyboards/noxary/220/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Noxary 220", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 6.5, + "layouts": { + "LAYOUT_ortho_6x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":0, "y":2.5}, {"x":1, "y":2.5}, {"x":2, "y":2.5}, {"x":3, "y":2.5}, {"x":0, "y":3.5}, {"x":1, "y":3.5}, {"x":2, "y":3.5}, {"x":3, "y":3.5}, {"x":0, "y":4.5}, {"x":1, "y":4.5}, {"x":2, "y":4.5}, {"x":3, "y":4.5}, {"x":0, "y":5.5}, {"x":1, "y":5.5}, {"x":2, "y":5.5}, {"x":3, "y":5.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/noxary/220/keymaps/default/config.h b/keyboards/noxary/220/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/noxary/220/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/noxary/220/keymaps/default/keymap.c b/keyboards/noxary/220/keymaps/default/keymap.c new file mode 100644 index 00000000000..a72841db546 --- /dev/null +++ b/keyboards/noxary/220/keymaps/default/keymap.c @@ -0,0 +1,76 @@ +/* Copyright 2019 Rozakiin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ortho_6x4( + KC_ESC, BL_TOGG, BL_DEC, BL_INC, + KC_NLCK, KC_SLSH, KC_ASTR, KC_PEQL, + KC_7, KC_8, KC_9, KC_PMNS, + KC_4, KC_5, KC_6, KC_PPLS, + KC_1, KC_2, KC_3, KC_PENT, + KC_0, KC_0, KC_DEL, KC_PENT), + + LAYOUT_ortho_6x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/noxary/220/keymaps/default/readme.md b/keyboards/noxary/220/keymaps/default/readme.md new file mode 100644 index 00000000000..bff7feda38a --- /dev/null +++ b/keyboards/noxary/220/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Noxary 220 \ No newline at end of file diff --git a/keyboards/noxary/220/readme.md b/keyboards/noxary/220/readme.md new file mode 100644 index 00000000000..1fcdfcc3c74 --- /dev/null +++ b/keyboards/noxary/220/readme.md @@ -0,0 +1,13 @@ +# Noxary 220 + +A fully customizable numpad + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Rozakiin](https://github.com/rozakiin) +Hardware Supported: Noxary 220 PCB +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=95660.0) + +Make example for this keyboard (after setting up your build environment): + + make noxary/220:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/noxary/220/rules.mk b/keyboards/noxary/220/rules.mk new file mode 100644 index 00000000000..af8b7d6839d --- /dev/null +++ b/keyboards/noxary/220/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_6x4 diff --git a/keyboards/noxary/260/260.c b/keyboards/noxary/260/260.c new file mode 100644 index 00000000000..9f577a2aee6 --- /dev/null +++ b/keyboards/noxary/260/260.c @@ -0,0 +1,61 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "260.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(B1); + matrix_init_user(); +} + +/* +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(B1); + } else { + writePinHigh(B1); + } + + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/noxary/260/260.h b/keyboards/noxary/260/260.h new file mode 100644 index 00000000000..2c62bd2a54d --- /dev/null +++ b/keyboards/noxary/260/260.h @@ -0,0 +1,40 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, \ + K400, K401, K402, K406, K410, K411, K412, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, KC_NO, K414 } \ +} diff --git a/keyboards/noxary/260/config.h b/keyboards/noxary/260/config.h new file mode 100644 index 00000000000..379dbbf78d8 --- /dev/null +++ b/keyboards/noxary/260/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4E58 +#define PRODUCT_ID 0x003C +#define DEVICE_VER 0x0001 +#define MANUFACTURER Noxary +#define PRODUCT 260 +#define DESCRIPTION A custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F7, F6, F5, F0, B5 } +#define MATRIX_COL_PINS { C7, C6, B6, F4, E6, D0, B4, D1, D2, D3, D7, D6, D4, F1, D5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/260/info.json b/keyboards/noxary/260/info.json new file mode 100644 index 00000000000..e5b449ff36f --- /dev/null +++ b/keyboards/noxary/260/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Noxary 260", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2}, {"x":13.75, "y":2, "w":1.25}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/noxary/260/keymaps/default/config.h b/keyboards/noxary/260/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/noxary/260/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/noxary/260/keymaps/default/keymap.c b/keyboards/noxary/260/keymaps/default/keymap.c new file mode 100644 index 00000000000..061e3d24073 --- /dev/null +++ b/keyboards/noxary/260/keymaps/default/keymap.c @@ -0,0 +1,87 @@ +/* Copyright 2019 Rozakiin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL1 1 +#define _FL2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* _BL: Base Layer(Default) - For ISO enter use ANSI enter + * ,-----------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|BSpc| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #| Ent| + * |-----------------------------------------------------------| + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift |Del| + * |-----------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Win |Mo(1) |Ctrl | + * `-----------------------------------------------------------' + */ + [_BL] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_RGUI, MO(_FL1), KC_RCTL), + /* _FL1: Function Layer 1 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | `|F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |PScr| | + * |----------------------------------------------------------------| + * | | | | |RST| | | | | | | | | | Ins| + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | |Home| + * |----------------------------------------------------------------| + * | | | | | | | | | |Bl-|Bl+| |Mute|Vol+| End| + * |----------------------------------------------------------------| + * | | | | BL_Toggle | | | | |Vol-| | + * `----------------------------------------------------------------' + */ + [_FL1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, + _______, KC_VOLU, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_VOLD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, _______, + _______, _______, _______, BL_TOGG, _______, _______, _______, _______), + /* _FL2: Function Layer 2 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ + [_FL2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______), + + +}; + diff --git a/keyboards/noxary/260/keymaps/default/readme.md b/keyboards/noxary/260/keymaps/default/readme.md new file mode 100644 index 00000000000..af0cd4ee276 --- /dev/null +++ b/keyboards/noxary/260/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Noxary 260 \ No newline at end of file diff --git a/keyboards/noxary/260/readme.md b/keyboards/noxary/260/readme.md new file mode 100644 index 00000000000..48cbbbf2297 --- /dev/null +++ b/keyboards/noxary/260/readme.md @@ -0,0 +1,15 @@ +Noxary 260 + +![260](https://cdn.discordapp.com/attachments/438429095303315456/489188948749451276/image0.jpg) + +A fully customizable 60% keyboard. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Rozakiin](https://github.com/rozakiin) +Hardware Supported: Noxary 260 PCB +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=93572.0) + +Make example for this keyboard (after setting up your build environment): + + make noxary/260:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/noxary/260/rules.mk b/keyboards/noxary/260/rules.mk new file mode 100644 index 00000000000..3a30930de6f --- /dev/null +++ b/keyboards/noxary/260/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/noxary/268/config.h b/keyboards/noxary/268/config.h index 7eec79a1bcd..8264b8019ee 100644 --- a/keyboards/noxary/268/config.h +++ b/keyboards/noxary/268/config.h @@ -47,7 +47,7 @@ along with this program. If not, see . #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -55,11 +55,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812b options */ #define RGB_DI_PIN B5 #ifdef RGB_DI_PIN diff --git a/keyboards/noxary/268/keymaps/ansi/keymap.c b/keyboards/noxary/268/keymaps/ansi/keymap.c index 20dddd884d7..ffe376b4e86 100644 --- a/keyboards/noxary/268/keymaps/ansi/keymap.c +++ b/keyboards/noxary/268/keymaps/ansi/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -// Helpful defines -#define _______ KC_TRNS - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them diff --git a/keyboards/noxary/268/keymaps/default/keymap.c b/keyboards/noxary/268/keymaps/default/keymap.c index 0a26d631375..a76509db8b1 100644 --- a/keyboards/noxary/268/keymaps/default/keymap.c +++ b/keyboards/noxary/268/keymaps/default/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -// Helpful defines -#define _______ KC_TRNS - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them diff --git a/keyboards/noxary/268/keymaps/iso/keymap.c b/keyboards/noxary/268/keymaps/iso/keymap.c index 5d6987ce76f..3d9ca2352f8 100644 --- a/keyboards/noxary/268/keymaps/iso/keymap.c +++ b/keyboards/noxary/268/keymaps/iso/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -// Helpful defines -#define _______ KC_TRNS - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them diff --git a/keyboards/noxary/268/keymaps/sixtyeight/keymap.c b/keyboards/noxary/268/keymaps/sixtyeight/keymap.c index 34dd3a6fa19..151ac1f73d4 100644 --- a/keyboards/noxary/268/keymaps/sixtyeight/keymap.c +++ b/keyboards/noxary/268/keymaps/sixtyeight/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -// Helpful defines -#define _______ KC_TRNS - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them diff --git a/keyboards/noxary/268/readme.md b/keyboards/noxary/268/readme.md index 68308a4752c..adc1add18db 100644 --- a/keyboards/noxary/268/readme.md +++ b/keyboards/noxary/268/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make noxary/268:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/noxary/268_2/268_2.c b/keyboards/noxary/268_2/268_2.c new file mode 100644 index 00000000000..9e2d822364c --- /dev/null +++ b/keyboards/noxary/268_2/268_2.c @@ -0,0 +1,28 @@ +/* Copyright 2018 Rozakiin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "268_2.h" + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + setPinOutput(B0); + writePinHigh(B0); + } else { + setPinInput(B0); + writePinLow(B0); + } + + led_set_user(usb_led); +} diff --git a/keyboards/noxary/268_2/268_2.h b/keyboards/noxary/268_2/268_2.h new file mode 100644 index 00000000000..71fd8441724 --- /dev/null +++ b/keyboards/noxary/268_2/268_2.h @@ -0,0 +1,82 @@ +/* Copyright 2018 Rozakiin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, \ + K400, K401, K402, K406, K409, K410, K412, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, KC_NO, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314, K315 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, K409, K410, KC_NO, K412, KC_NO, K414, K415 } \ +} + +#define LAYOUT_split_bs( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, \ + K400, K401, K402, K406, K409, K410, K412, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, KC_NO, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314, K315 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, K409, K410, KC_NO, K412, KC_NO, K414, K415 } \ +} + +#define LAYOUT_7u_space( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, \ + K400, K401, K402, K406, K410, K412, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, KC_NO, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314, K315 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, KC_NO, K412, KC_NO, K414, K415 } \ +} + +#define LAYOUT_7u_space_split_bs( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, \ + K400, K401, K402, K406, K410, K412, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, KC_NO, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314, K315 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, KC_NO, K412, KC_NO, K414, K415 } \ +} diff --git a/keyboards/noxary/268_2/config.h b/keyboards/noxary/268_2/config.h new file mode 100644 index 00000000000..fbfb97f02bf --- /dev/null +++ b/keyboards/noxary/268_2/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2018 Rozakiin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4E58 +#define PRODUCT_ID 0x0044 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Noxary +#define PRODUCT 268.2 +#define DESCRIPTION QMK keyboard firmware for 268.2 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F7, F6, F5, F0, B5 } +#define MATRIX_COL_PINS { C6, B6, C7, F4, E6, D0, D7, D1, D2, B4, D6, D4, D5, F1, D3, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +//define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/268_2/info.json b/keyboards/noxary/268_2/info.json new file mode 100644 index 00000000000..b47e2de9805 --- /dev/null +++ b/keyboards/noxary/268_2/info.json @@ -0,0 +1,293 @@ +{ + "keyboard_name": "Noxary 268.2", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0, "w":2}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, + {"x":1.25, "y":4, "w":1.25}, + {"x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"x":10, "y":4, "w":1.25}, + {"x":11.25, "y":4, "w":1.25}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + }, + "LAYOUT_split_bs": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.25}, + {"x":1.25, "y":4, "w":1.25}, + {"x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"x":10, "y":4, "w":1.25}, + {"x":11.25, "y":4, "w":1.25}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + }, + "LAYOUT_7u_space": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0, "w":2}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.5}, + {"x":1.5, "y":4}, + {"x":2.5, "y":4, "w":1.5}, + {"x":4, "y":4, "w":7}, + {"x":11, "y":4, "w":1.5}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + }, + "LAYOUT_7u_space_split_bs": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + {"x":15, "y":0}, + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + {"x":15, "y":1}, + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + {"x":15, "y":2}, + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + {"x":15, "y":3}, + {"x":0, "y":4, "w":1.5}, + {"x":1.5, "y":4}, + {"x":2.5, "y":4, "w":1.5}, + {"x":4, "y":4, "w":7}, + {"x":11, "y":4, "w":1.5}, + {"x":13, "y":4}, + {"x":14, "y":4}, + {"x":15, "y":4} + ] + } + } +} diff --git a/keyboards/noxary/268_2/keymaps/default/config.h b/keyboards/noxary/268_2/keymaps/default/config.h new file mode 100644 index 00000000000..9c4c2b63081 --- /dev/null +++ b/keyboards/noxary/268_2/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Rozakiin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/noxary/268_2/keymaps/default/keymap.c b/keyboards/noxary/268_2/keymaps/default/keymap.c new file mode 100644 index 00000000000..c22ec2b1d63 --- /dev/null +++ b/keyboards/noxary/268_2/keymaps/default/keymap.c @@ -0,0 +1,54 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_names { + _BL, + _FL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Bspc │ ` │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │Del│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │Shift │ ↑ │PgD│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │Ctrl│Win │Alt │ Space │Alt │ Fn │ │ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴────┴────┴─┴───┴───┴───┘ + */ + [_BL] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Function Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ PScr │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │ │ │ │RST│ │ │ │ │ │ │ │ │ │Ins│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │Hom│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │ │ │ │Bl-│Bl+│ Mute │Vl+│End│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ BL Toggle │ │ │ │ │Vl-│ │ + * └────┴────┴────┴────────────────────────┴────┴────┴─┴───┴───┴───┘ + */ + [_FL] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, KC_MUTE, KC_VOLU, KC_END, + _______, _______, _______, BL_TOGG, _______, _______, _______, KC_VOLD, _______ + ) +}; diff --git a/keyboards/noxary/268_2/keymaps/default/readme.md b/keyboards/noxary/268_2/keymaps/default/readme.md new file mode 100644 index 00000000000..c4c832cc645 --- /dev/null +++ b/keyboards/noxary/268_2/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for 268_2 diff --git a/keyboards/noxary/268_2/readme.md b/keyboards/noxary/268_2/readme.md new file mode 100644 index 00000000000..075a1d26c7d --- /dev/null +++ b/keyboards/noxary/268_2/readme.md @@ -0,0 +1,15 @@ +# Noxary 268.2 + +![268.2](https://www.keebtalk.com/uploads/db8059/original/2X/6/65b93c83cadd98bbf8e3b1d739621d54b682609a.jpg) + +A fully customizable 65% keyboard. + +Keyboard Maintainer: [Rozakiin](https://github.com/rozakiin) +Hardware Supported: 268.2 PCB +Hardware Availability: [Noxary](https://shop.noxary.co/collections/268-2/products/noxary-268-2-polycarbonate) + +Make example for this keyboard (after setting up your build environment): + + make noxary/268_2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/noxary/268_2/rules.mk b/keyboards/noxary/268_2/rules.mk new file mode 100644 index 00000000000..a89c930a143 --- /dev/null +++ b/keyboards/noxary/268_2/rules.mk @@ -0,0 +1,70 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/noxary/280/280.c b/keyboards/noxary/280/280.c new file mode 100644 index 00000000000..441f0ad84a7 --- /dev/null +++ b/keyboards/noxary/280/280.c @@ -0,0 +1,70 @@ +/* Copyright 2019 %YOUR_NAME% + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "280.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(D5); + setPinOutput(D0); + matrix_init_user(); +} + +/* +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ + + +void led_set_kb(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(D5); + } else { + writePinHigh(D5); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(D0); + } else { + writePinHigh(D0); + } + + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/noxary/280/280.h b/keyboards/noxary/280/280.h new file mode 100644 index 00000000000..1a93c8c6be7 --- /dev/null +++ b/keyboards/noxary/280/280.h @@ -0,0 +1,49 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT( \ + K000, K002, K103, K004, K105, K006, K107, K008, K109, K111, K012, K113, K014, K115, K016, K117, \ + K200, K301, K202, K303, K204, K305, K206, K307, K208, K309, K210, K311, K212, K313, K214, K315, K216, K317, \ + K400, K501, K402, K503, K404, K505, K406, K507, K408, K509, K410, K511, K412, K414, K515, K416, K517, \ + K600, K701, K602, K703, K604, K705, K606, K707, K608, K709, K610, K711, K612, K614, \ + K800, K901, K802, K903, K804, K905, K806, K907, K808, K909, K810, K911, K812, K814, K816, \ + K1000,K1101,K1002, K1006, K1010,K1111,K1012, K1014,K1115,K1016,K1117\ +) { \ + { K000, K002, K004, K006, K008, KC_NO, K012, K014, K016 },\ + { KC_NO, K103, K105, K107, K109, K111, K113, K115, K117 },\ + { K200, K202, K204, K206, K208, K210, K212, K214, K216 },\ + { K301, K303, K305, K307, K309, K311, K313, K315, K317 },\ + { K400, K402, K404, K406, K408, K410, K412, K414, K416 },\ + { K501, K503, K505, K507, K509, K511, KC_NO, K515, K517 },\ + { K600, K602, K604, K606, K608, K610, K612, K614, KC_NO },\ + { K701, K703, K705, K707, K709, K711, KC_NO, KC_NO, KC_NO },\ + { K800, K802, K804, K806, K808, K810, K812, K814, K816 },\ + { K901, K903, K905, K907, K909, K911, KC_NO, KC_NO, KC_NO },\ + { K1000, K1002, KC_NO, K1006, KC_NO, K1010, K1012, K1014, K1016 },\ + { K1101, KC_NO, KC_NO, KC_NO, KC_NO, K1111, KC_NO, K1115, K1117 }\ +} diff --git a/keyboards/noxary/280/config.h b/keyboards/noxary/280/config.h new file mode 100644 index 00000000000..d0a10866a92 --- /dev/null +++ b/keyboards/noxary/280/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4E58 +#define PRODUCT_ID 0x0050 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Noxary +#define PRODUCT 280 +#define DESCRIPTION A custom TKL + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, E6, D6, D4, F6, F5, F4, F1, B2, D3, D2, D1} +#define MATRIX_COL_PINS { F7, C7, C6, B6, B5, B4, D7, B0, B3} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/280/info.json b/keyboards/noxary/280/info.json new file mode 100644 index 00000000000..f75d276564d --- /dev/null +++ b/keyboards/noxary/280/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Noxary 280", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5}, {"x":14, "y":1.5}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.5, "y":2.5, "w":1.5}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"x":13.75, "y":3.5, "w":1.25}, {"x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5, "w":1.25}, {"x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"x":10, "y":5.5, "w":1.25}, {"x":11.25, "y":5.5, "w":1.25}, {"x":12.5, "y":5.5, "w":1.25}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/noxary/280/keymaps/default/config.h b/keyboards/noxary/280/keymaps/default/config.h new file mode 100644 index 00000000000..26c6d6ade10 --- /dev/null +++ b/keyboards/noxary/280/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/noxary/280/keymaps/default/keymap.c b/keyboards/noxary/280/keymaps/default/keymap.c new file mode 100644 index 00000000000..3d993e04253 --- /dev/null +++ b/keyboards/noxary/280/keymaps/default/keymap.c @@ -0,0 +1,102 @@ +/* Copyright 2019 Rozakin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL1 1 +#define _FL2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* _BL: Base Layer(Default) - For ISO enter use ANSI enter + * ,------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11| f12| |Prnt|ScLk|Paus| + * |------------------------------------------------------------| |--------------| + * | ~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|BSpc| | Ins|Home|PgUp| + * |------------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | Del| End|PgDn| + * |------------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #| Ent| + * |------------------------------------------------------------| ,----. + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift|Mo(1)| | Up | + * |------------------------------------------------------------| ,--------------. + * |Ctrl|Win |Alt | Space |Alt |Win |Mo(1) |Ctrl | |Left| Dn |Rght| + * `------------------------------------------------------------' `--------------' + */ + [_BL] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FL1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL1), KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT), + /* _FL1: Function Layer 1 - For ISO enter use ANSI enter + * ,------------------------------------------------------------. ,--------------. + * | | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| |--------------| + * | | | | |RST| | | | | | | | | | | | | | + * |------------------------------------------------------------| `--------------' + * | | | | | | | | | | | | | | | + * |------------------------------------------------------------| ,----. + * | | | | | | | | | |Bl-|Bl+| | Mute| | |Vol+| + * |------------------------------------------------------------| ,--------------. + * | | | | BL_Toggle | | | | | | |Vol-| | + * `------------------------------------------------------------' `--------------' + */ + [_FL1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, _______, KC_VOLU, + _______, _______, _______, BL_TOGG, _______, _______, _______, _______, _______, KC_VOLD, _______), + /* _FL2: Function Layer 2 - For ISO enter use ANSI enter + * ,------------------------------------------------------------. ,--------------. + * | | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| `--------------' + * | | | | | | | | | | | | | | | + * |------------------------------------------------------------| ,----. + * | | | | | | | | | | | | | | | | | + * |------------------------------------------------------------| ,--------------. + * | | | | | | | | | | | | | + * `------------------------------------------------------------' `--------------' + */ + [_FL2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + + }; + diff --git a/keyboards/noxary/280/keymaps/default/readme.md b/keyboards/noxary/280/keymaps/default/readme.md new file mode 100644 index 00000000000..e1a03dc002d --- /dev/null +++ b/keyboards/noxary/280/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Noxary 280 \ No newline at end of file diff --git a/keyboards/noxary/280/readme.md b/keyboards/noxary/280/readme.md new file mode 100644 index 00000000000..5af7441ddf7 --- /dev/null +++ b/keyboards/noxary/280/readme.md @@ -0,0 +1,13 @@ +Noxary 280 + +A fully customizable TKL keyboard. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Rozakin](https://github.com/rozakiin) +Hardware Supported: 280 PCB +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=95660.0) + +Make example for this keyboard (after setting up your build environment): + + make noxary/280:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/noxary/280/rules.mk b/keyboards/noxary/280/rules.mk new file mode 100644 index 00000000000..f99ee37b0d8 --- /dev/null +++ b/keyboards/noxary/280/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/noxary/README.md b/keyboards/noxary/README.md index 81e525506a3..8dbd85f7ef9 100644 --- a/keyboards/noxary/README.md +++ b/keyboards/noxary/README.md @@ -1,7 +1,11 @@ # Noxary Firmware -All files related to firmware of Noxary Keyboards designed by Rozakiin. +All files related to firmware of Noxary Keyboards designed by [Rozakiin](https://github.com/rozakiin). ### Keyboards -- [268](./268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin +- [268](./268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin + +- [268.2](./268_2/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin + +- [x268](./x268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin diff --git a/keyboards/noxary/x268/config.h b/keyboards/noxary/x268/config.h new file mode 100644 index 00000000000..0604f6529b3 --- /dev/null +++ b/keyboards/noxary/x268/config.h @@ -0,0 +1,225 @@ +/* +Copyright 2018 Rozakiin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4E58 +#define PRODUCT_ID 0x0044 +#define DEVICE_VER 0x00F2 +#define MANUFACTURER Noxary +#define PRODUCT x268 +#define DESCRIPTION QMK keyboard firmware for x268 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F7, F6, F5, F0, B4 } +#define MATRIX_COL_PINS { C6, B6, C7, F4, E6, B2, D6, D0, D1, D7, D4, D5, D3, F1, D2, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* ws2812b options */ +#define RGB_DI_PIN B5 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 16 +#define RGBLIGHT_SAT_STEP 16 +#define RGBLIGHT_VAL_STEP 16 +/*#define RGBLIGHT_LIMIT_VAL 255 */ +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/x268/info.json b/keyboards/noxary/x268/info.json new file mode 100644 index 00000000000..cac7559baf3 --- /dev/null +++ b/keyboards/noxary/x268/info.json @@ -0,0 +1,86 @@ +{ + "keyboard_name": "Noxary x268", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 71, + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"MINUS", "x":11, "y":0}, + {"label":"EQUAL", "x":12, "y":0}, + {"label":"BACKSLASH", "x":13, "y":0}, + {"label":"BACKSPACE", "x":14, "y":0}, + {"label":"GRAVE", "x":15, "y":0}, + {"label":"TAB", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"LBRACKET", "x":11.5, "y":1}, + {"label":"RBRACKET", "x":12.5, "y":1}, + {"label":"BACKSLASH", "x":13.5, "y":1, "w":1.5}, + {"label":"DELETE", "x":15, "y":1}, + {"label":"CAPS LOCK", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":"SEMICOLON", "x":10.75, "y":2}, + {"label":"QUOTE", "x":11.75, "y":2}, + {"label":"ISO HASH", "x":12.75, "y":2}, + {"label":"ENTER", "x":13.75, "y":2, "w":1.25}, + {"label":"PAGE UP", "x":15, "y":2}, + {"label":"LSHIFT", "x":0, "y":3, "w":1.25}, + {"label":"ISO BACKSLASH", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"COMMA", "x":9.25, "y":3}, + {"label":"PERIOD", "x":10.25, "y":3}, + {"label":"SLASH", "x":11.25, "y":3}, + {"label":"RSHIFT", "x":12.25, "y":3, "w":1.75}, + {"label":"UP", "x":14, "y":3}, + {"label":"PAGE DOWN", "x":15, "y":3}, + {"label":"LCTRL", "x":0, "y":4, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":4, "w":1.25}, + {"label":"LALT", "x":2.5, "y":4, "w":1.25}, + {"label":"SPACE", "x":3.75, "y":4, "w":6.25}, + {"label":"LALT", "x":10, "y":4}, + {"label":"FN", "x":11, "y":4}, + {"label":"RCTRL", "x":12, "y":4}, + {"label":"LEFT", "x":13, "y":4}, + {"label":"DOWN", "x":14, "y":4}, + {"label":"RIGHT", "x":15, "y":4} + ] + } + } +} + diff --git a/keyboards/noxary/x268/keymaps/default/config.h b/keyboards/noxary/x268/keymaps/default/config.h new file mode 100644 index 00000000000..9c4c2b63081 --- /dev/null +++ b/keyboards/noxary/x268/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Rozakiin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/noxary/x268/keymaps/default/keymap.c b/keyboards/noxary/x268/keymaps/default/keymap.c new file mode 100644 index 00000000000..ae07f5213d7 --- /dev/null +++ b/keyboards/noxary/x268/keymaps/default/keymap.c @@ -0,0 +1,83 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL1 1 +#define _FL2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* _BL: Base Layer(Default) - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|BSpc| Grv| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Del| + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #| Ent|PgUp| + * |----------------------------------------------------------------| + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt|Mo(1)|Ctrl|Lef|Dow|Rght| + * `----------------------------------------------------------------' + */ + [_BL] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(_FL1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + /* _FL1: Function Layer 1 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | `|F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |PScr| | + * |----------------------------------------------------------------| + * | | | | |RST| | | | | | | | | | Ins| + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | |Home| + * |----------------------------------------------------------------| + * | | | | | | | | | |Bl-|Bl+| |Mute|Vol+| End| + * |----------------------------------------------------------------| + * | | | | BL_Toggle | | | | |Vol-| | + * `----------------------------------------------------------------' + */ + [_FL1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, _______, + RGB_TOG, RGB_VAI, RGB_SAI, RGB_HUI, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, RGB_VAD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, KC_VOLU, KC_END, + _______, _______, _______, BL_TOGG, _______, _______, _______, _______, KC_VOLD, _______), + /* _FL2: Function Layer 2 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ + [_FL2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + diff --git a/keyboards/noxary/x268/keymaps/default/readme.md b/keyboards/noxary/x268/keymaps/default/readme.md new file mode 100644 index 00000000000..5d5bd69592c --- /dev/null +++ b/keyboards/noxary/x268/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for x268 diff --git a/keyboards/noxary/x268/readme.md b/keyboards/noxary/x268/readme.md new file mode 100644 index 00000000000..c1c05c34d58 --- /dev/null +++ b/keyboards/noxary/x268/readme.md @@ -0,0 +1,18 @@ +# Noxary x268 + +![x268](https://geekhack.org/index.php?action=dlattach;topic=96377.0;attach=198826;image) + +A fully customizable 65% keyboard. + +* Keyboard Maintainer: [Rozakiin](https://github.com/rozakiin) +* Hardware Supported: x268 PCB + * rev1 +* Hardware Availability: + * [Noxary - 268](https://geekhack.org/index.php?topic=92066.0) + * [LZ - CLS ms](https://geekhack.org/index.php?topic=96377) + +Make example for this keyboard (after setting up your build environment): + + make noxary/x268:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/noxary/x268/rules.mk b/keyboards/noxary/x268/rules.mk new file mode 100644 index 00000000000..3c4a26ad1aa --- /dev/null +++ b/keyboards/noxary/x268/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/noxary/x268/x268.c b/keyboards/noxary/x268/x268.c new file mode 100644 index 00000000000..3921270acc6 --- /dev/null +++ b/keyboards/noxary/x268/x268.c @@ -0,0 +1,53 @@ +/* Copyright 2018 Rozakiin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "x268.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 0); PORTB |= (1 << 0); + } + else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } +} diff --git a/keyboards/noxary/x268/x268.h b/keyboards/noxary/x268/x268.h new file mode 100644 index 00000000000..9961b7dfdb1 --- /dev/null +++ b/keyboards/noxary/x268/x268.h @@ -0,0 +1,35 @@ +/* Copyright 2018 Rozakiin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef X268_H +#define X268_H + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, \ + K400, K401, K402, K406, K409, K410, K411, K412, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314, K315 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, K409, K410, K411, K412, KC_NO, K414, K415 } \ +} + +#endif diff --git a/keyboards/nyquist/config.h b/keyboards/nyquist/config.h deleted file mode 100644 index 863722d7d04..00000000000 --- a/keyboards/nyquist/config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -#endif // CONFIG_H diff --git a/keyboards/nyquist/eeprom-lefthand.eep b/keyboards/nyquist/eeprom-lefthand.eep deleted file mode 100644 index b9666a74c01..00000000000 --- a/keyboards/nyquist/eeprom-lefthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0B0000000000000000000000000001F4 -:00000001FF diff --git a/keyboards/nyquist/eeprom-righthand.eep b/keyboards/nyquist/eeprom-righthand.eep deleted file mode 100644 index 94cc5be7fc6..00000000000 --- a/keyboards/nyquist/eeprom-righthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0B0000000000000000000000000000F5 -:00000001FF diff --git a/keyboards/nyquist/i2c.c b/keyboards/nyquist/i2c.c deleted file mode 100644 index 084c890c405..00000000000 --- a/keyboards/nyquist/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 100000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/nyquist/info.json b/keyboards/nyquist/info.json deleted file mode 100644 index 0a038f6dd2e..00000000000 --- a/keyboards/nyquist/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "Nyquist", - "url": "", - "maintainer": "qmk", - "width": 13, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}] - } - } -} diff --git a/keyboards/nyquist/keymaps/333fred/README.md b/keyboards/nyquist/keymaps/333fred/README.md deleted file mode 100644 index fa354bb4d3d..00000000000 --- a/keyboards/nyquist/keymaps/333fred/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# 333fred's Nyquist Layout - -This nyquist layout is based on my Ergodox Infinity Layout, which is [here](../../../../layouts/community/ergodox/333fred/README.md). It doesn't have all of my VS extensions, as I have my nyquist at home, not at work. - -## Layers - -### QWERTY -The shift modifiers on this layer all use OSM to allow for quick single capitalization. LwrVIM acts a combo one-shot toggle and momentary layer toggle. Tap once to make the next key be sent on the Lower. Hold to move to the Lower layer until release. Tap and hold (so press, release, press and hold) to move to the VIM layer until release. Game is a regular toggle layer. - -``` -Qwerty -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | E | R | T | Y | U | I | O | P | \ | -|------+------+------+------+------+-------------+------+------+------+------+------| -| Esc | A | S | D | F | G | H | J | K | L | ; | " | -|------+------+------+------+------+------|------+------+------+------+------+------| -| Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| -|------+------+------+------+------+------+------+------+------+------+------+------| -| Ctrl | Alt | F4 | GUI |LwrVIM| Bksp | Spc | Ent | Lock | = | RAlt | Del | -`-----------------------------------------------------------------------------------' -``` - -### Lower -My symbol and numpad layer. APscr is a macro that sends ALT+PRSC, to take a screenshot of the current application. - -``` -Lower -,-----------------------------------------------------------------------------------. -| Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | -|------+------+------+------+------+-------------+------+------+------+------+------| -| | ! | @ | ( | ) | | | 7 | 8 | 9 | * | ) | F12 | -|------+------+------+------+------+-------------+------+------+------+------+------| -| | # | $ | { | } | ` | 4 | 5 | 6 | + | } | | | -|------+------+------+------+------+------|------+------+------+------+------+------| -| APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Pscr | | | | | GAME | 0 | . | = | Prev | Next | Play | -`-----------------------------------------------------------------------------------' -``` - -### VIM Movement -Pressing and holding F moves to this layer, which turns hjkl into vim movement keys. a and d are macros which send WIN+Left and WIN+Right, respectively. Shift and CTRL have been remapped for ease of selecting text. -``` -Vim Movement (Hold down F) -,-----------------------------------------------------------------------------------. -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | DLeft|DRight| LCTRL| | | Left | Down | Up | Right| | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | LShft| | | | | | | | -`-----------------------------------------------------------------------------------' - ``` - -### Gaming -This layer is designed for playing games. All one-shot modification has been turned off, and the common game controls keys have been moved around for easier access. -``` -Gaming mode (Raise) -,-----------------------------------------------------------------------------------. -| ESC | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| CTRL | | | | F | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | | | | | | | | | | GUI | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY| -`-----------------------------------------------------------------------------------' -``` diff --git a/keyboards/nyquist/keymaps/333fred/config.h b/keyboards/nyquist/keymaps/333fred/config.h deleted file mode 100644 index 575ec9ac528..00000000000 --- a/keyboards/nyquist/keymaps/333fred/config.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "../../config.h" -#include "333fred_config.h" - -#define USE_SERIAL -#define MASTER_LEFT - -#undef TAPPING_TERM -#define TAPPING_TERM 150 diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c deleted file mode 100644 index c25bf1c5ff6..00000000000 --- a/keyboards/nyquist/keymaps/333fred/keymap.c +++ /dev/null @@ -1,134 +0,0 @@ -#include QMK_KEYBOARD_H -#include "333fred.h" - -extern keymap_config_t keymap_config; - -enum custom_macros { - DLEFT, - DRIGHT, - PSCREEN_APP -}; - -// Tap dance for layer transitions -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | F4 | GUI |Lwr/VM| Bksp | Spc | Ent | Lock | = | Alt | Del | - * `-----------------------------------------------------------------------------------' - */ -[BASE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ - KC_LCTL, KC_LALT, KC_F4, KC_LGUI, TD(TD_SYM_VIM), KC_BSPC, KC_SPC, KC_ENT, KC_LOCK, KC_EQL, KC_RALT, KC_DEL \ -), - -/* Symbols - * ,-----------------------------------------------------------------------------------. - * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | ! | @ | ( | ) | | | 7 | 8 | 9 | * | ) | F12 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | # | $ | { | } | ` | 4 | 5 | 6 | + | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Pscr | | | | | GAME | 0 | . | = | Prev | Next | Play | - * `-----------------------------------------------------------------------------------' - */ -[SYMB] = LAYOUT( \ - KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ - _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \ - _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \ - M(PSCREEN_APP), KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \ - KC_PSCR, _______, _______, _______, _______, TG(GAME), KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ -), - -/* Vim Movement (Hold down F) - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | LSHFT| | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | DLeft|DRight| LCTRL| LGUI | | Left | Down | Up | Right| | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[VIM] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), - -/* Gaming mode (Raise) - * All one-shot mods are disabled on this layer - * ,-----------------------------------------------------------------------------------. - * | ESC | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | CTRL | | | | F | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | | | | | | | | | | GUI | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY| - * `-----------------------------------------------------------------------------------' - */ -[GAME] = LAYOUT( \ - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \ - KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ - KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSL(SYMB), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ -) -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case DLEFT: - if (record->event.pressed) { // Windows move desktop left - return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); - } - break; - case DRIGHT: - if (record->event.pressed) { // Windows move desktop right - return MACRO(D(LCTL), D(LGUI), T(RIGHT), U(LGUI), U(LCTL), END); - } - break; - case PSCREEN_APP: - if (record->event.pressed) { - return MACRO(D(LALT), T(PSCR), U(LALT), END); - } - break; - } - return MACRO_NONE; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - tap_dance_process_record(keycode); - return true; -} diff --git a/keyboards/nyquist/keymaps/DivergeJM/keymap.c b/keyboards/nyquist/keymaps/DivergeJM/keymap.c deleted file mode 100644 index db802280636..00000000000 --- a/keyboards/nyquist/keymaps/DivergeJM/keymap.c +++ /dev/null @@ -1,314 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -enum custom_layers { - _COLEMAK, - _QWERTY, - _DVORAK, - _LOWER, - _RAISE, - _FUNCTION, - _MOUSE, - _ADJUST -}; - -enum custom_keycodes { - COLEMAK = SAFE_RANGE, - QWERTY, - DVORAK, - LOWER, - RAISE, - FUNCTION, - MOUSE, - ADJUST -}; - -enum custom_macros { - R_PIPE, - R_POINT -}; -/* -// Tap Dance Declarations -enum { - TD_ZERO_ENT = 0 -}; - -// Tap Dance Definitions - qk_tap_dance_action_t tap_dance_actions[] = { - [TD_ZERO_ENT] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_ENT) -}; -*/ - // Enable these functions using FUNC(n) macro. - const uint16_t PROGMEM fn_actions[] = { //ACTION_LAYER_TAP_TOGGLE requires that number of taps be defined in *config.h* - default set to 5 - [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), //Hold for momentary Lower layer, Tap for Space, - [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_ENT), //Hold for momentary Mouse layer, Tap for Enter, - [2] = ACTION_LAYER_MOMENTARY(_FUNCTION), //Hold for momentary Function - [3] = ACTION_LAYER_MOMENTARY(_MOUSE) //Hold for momentary MOUSE - }; -#define SPC_LW FUNC(0) -#define ENT_RS FUNC(1) -#define FNC FUNC(2) -#define MSE FUNC(3) -#define PIPE M(R_PIPE) -#define POINT M(R_POINT) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Colemak - * .----------------------------------------. .-----------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | BS | A | R | S | T | D | | H | N | E | I | O | " | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | LSPO| Z | X | C | V | B | | K | M | , | . | / | RSPC | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl| LGUI | Lower| LAlt | Space/Lower | | Enter/Raise | Fn | Mouse| Menu | Ctrl | - * `----------------------------------------' `-----------------------------------------' - */ -[_COLEMAK] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, \ - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ - KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, SPC_LW, ENT_RS, ENT_RS, FNC, MSE, KC_APP, KC_RCTL \ - ), - -/* QWERTY - - * .----------------------------------------. .-----------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | BS | A | S | D | F | G | | H | J | K | L | ; | " | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | LSPO| Z | X | C | V | B | | N | M | , | . | / | RSPC | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl| LGUI | Lower| LAlt | Space/Lower | | Enter/Raise | Fn | Mouse| Menu | Ctrl | - * `----------------------------------------' '-----------------------------------------' - */ - -[_QWERTY] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ - KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, SPC_LW, ENT_RS, ENT_RS, FNC, MSE, KC_APP, KC_RCTL \ - ), - -/* Dvorak - * .----------------------------------------. .-----------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-----| |------+------+------+------+------+------| - * | Tab | " | , | . | P | Y | | F | G | C | R | L | \ | - * |------+------+------+------+------+-----| |------+------+------+------+------+------| - * | BS | A | O | E | U | I | | D | H | T | N | S | / | - * |------+------+------+------+------+-----| |------+------+------+------+------+------| - * | LSPO | ; | Q | J | K | X | | B | M | W | V | Z | RSPC | - * |------+------+------+------+------+-----| |------+------+------+------+------+------| - * | Ctrl | LGUI | Lower| LAlt | Space/Lower| | Enter/Raise | Fn | Mouse| Menu | Ctrl | - * `----------------------------------------' '-----------------------------------------' - */ - -[_DVORAK] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, \ - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, \ - KC_LCTL, KC_LGUI, LOWER, KC_LALT, SPC_LW, SPC_LW, ENT_RS, ENT_RS, FNC, MSE, KC_APP, KC_RCTL \ -), - -/* Lower - * ,-----------------------------------------. .-----------------------------------------. - * | Esc | | | | | | | = | / | * | - | | Del | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | PgUp | Home | Up | End | | | 7 | 8 | 9 | + | | \ | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | BS | PgDn | Left | Down |Right | | | 4 | 5 | 6 | Enter| | ' | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | LSPO | Z | X | C | V | | | 1 | 2 | 3 | Enter| | RSPC | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl | LGUI | Lower| LAlt | Space/Lower | | 0 | . | Fn |ADJUST| Ctrl | - * `-----------------------------------------' `-----------------------------------------' - */ -[_LOWER] = LAYOUT( \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PEQL, KC_PSLS, KC_PAST, KC_MINS, XXXXXXX, _______, \ - _______, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_7, KC_8, KC_9, KC_PPLS, XXXXXXX, _______,\ - _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, KC_4, KC_5, KC_6, KC_PENT, XXXXXXX, _______,\ - _______, _______, _______, _______, _______, XXXXXXX, KC_1, KC_2, KC_3, KC_PENT, XXXXXXX, _______,\ - _______, _______, _______, _______, _______, _______, KC_0, KC_0, KC_DOT, FNC, RAISE, _______ \ -), - -/* Raise - * ,-----------------------------------------. .-----------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | ! | @ | # | $ | % | | ^ | & | * | - | + | \ | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | BS | | | | | | | | | | | | " | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | LSBO | <- | %>% | { | [ | ` | | | | ] | } | . | ? | RSBC | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl | LGUI | | LAlt | Space/Lower | | Enter/Raise | Fn | Mouse| Menu | Ctrl | - * `-----------------------------------------' `-----------------------------------------' -*/ -[_RAISE] = LAYOUT( \ - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ - _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, \ - _______, POINT, PIPE, KC_LCBR, KC_LBRC, KC_GRV, KC_PIPE, KC_RBRC, KC_RCBR, KC_DOT, KC_SLSH, _______, \ - _______, _______, XXXXXXX, _______, _______, _______, ENT_RS, ENT_RS, FNC, MSE, _______, _______ \ - ), - - -/*Function - * ,-----------------------------------------. .-----------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Esc | Mute | Vol- | Vol+ | | | | | | | | | Ins | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Caps | Stop | |<< | >/|| | >>| | | | | | | | |PrtSc | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | LSOB | | | | | | | | | | | |ScrLk | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl | LGUI | | LAlt | Space/Lower | | Enter/Raise | Fn | Mouse| |PsBrk | - * `-----------------------------------------' `-----------------------------------------' - */ - -[_FUNCTION] = LAYOUT( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS , \ - KC_CAPS, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, \ - _______, _______, _______, _______, _______, _______, _______, _______, FNC, _______, _______, KC_PAUS \ - ), - -/* MOUSE - * ,----------------------------------------. .----------------------------------------. - * | Esc | | | | | | | | | | | | Del | - * |------+------+------+------+------+-----| |-----+------+------+------+------+------| - * | Tab | WhlU | WhlL | MsUp | WhlR | | | | M1 | M2 | M3 | | | - * |------+------+------+------+------+-----| |-----+------+------+------+------+------| - * | | WhlD | MsL | MsDn | MsR | | | |LClick|RClick| | | | - * |------+------+------+------+------+-----| |-----+------+------+------+------+------| - * | LSPO | | | | | | | | | | | | RSCB | - * |------+------+------+------+------+-----| |-----+------+------+------+------+------| - * | Ctrl | | | |Sensitivity | | Sensitivity| |MOUSE | | Ctrl | - * `----------------------------------------' `----------------------------------------' - */ - -[_MOUSE] = LAYOUT( - KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, \ - KC_TAB, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, XXXXXXX, XXXXXXX, KC_BTN3, KC_BTN4, KC_BTN5, XXXXXXX, XXXXXXX, \ - KC_BSPC, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSPC, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_ACL1, KC_ACL1, KC_ACL0, KC_ACL0, XXXXXXX, MSE, XXXXXXX, KC_RCTL \ - ), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------. ,----------------------------------------. - * | | | | | |RESET | | | | | | | | - * |------+------+------+------+------+------| |-----+------+------+------+------+------| - * | | | | | | | | |TermOn|TermOf| | | Del | - * |------+------+------+------+------+------| |-----+------+------+------+------+------| - * | | | | | | | | |Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------| |-----+------+------+------+------+------| - * | | | | | | | | | | | | | | - * |------+------+------+------+------+------| |-----+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------' `----------------------------------------' - */ - -[_ADJUST] = LAYOUT( - _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ - _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) - -}; - - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -// Macros to send R pointer & dplyr pipe -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - //R Pointer: <- - case R_POINT: - if (record->event.pressed) { // Pointer <- - SEND_STRING("<- "); -// return MACRO(D(LSFT), T(COMM), U(LSFT), T(MINS), END); - - } - break; - //dplyr pipe: %>% - case R_PIPE: - if (record->event.pressed) { // dplyr pipe %>% - SEND_STRING("%>% "); -// return MACRO(D(LSFT), T(5), T(DOT), T(5), U(LSFT), END); - } - break; - } - return MACRO_NONE; -} - -/* Cases to switch default layer to QWERTY, COLEMAK or DVORAK - and to access ADJUST layer to access the switch keys */ -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/nyquist/keymaps/bramver/keymap.c b/keyboards/nyquist/keymaps/bramver/keymap.c deleted file mode 100644 index c5eac853ccf..00000000000 --- a/keyboards/nyquist/keymaps/bramver/keymap.c +++ /dev/null @@ -1,281 +0,0 @@ -/* Copyright 2018 darm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BASE 0 -#define _LOWER 1 -#define _RAISE 2 -#define _LMOUSE 3 -#define _RMOUSE 4 -#define _EMOJI 5 - -enum emoji_map { - UNAM, // unamused 😒 - HEYE, // smiling face with heart shaped eyes 😍 - OK, // ok hand sign 👌 - SMIR, // smirk 😏 - PRAY, // pray 🙏 - CELE, // celebration 🙌 - COOL, // smile with sunglasses 😎 - EYES, // eyes - THNK, // BIG THONK - NAIL, // Nailcare - SOS, // Vuile sos - REDB, // Red B - HNDR, // 100 - MONY, - FIRE, - CAR, - BUTT, - BNIS, - CUM, - CLAP, - TRIU, // Fart from nose - SCRM, - VOMI, - DTIV, // Detective - EXPL, // Brainsplosion - HAIR, // Haircut - DANC, // Salsa dancer - STRN, // Stronk - LEFT, // Point Left - RGHT, // Point Right -}; - -const uint32_t PROGMEM unicode_map[] = { - [UNAM] = 0x1F612, - [HEYE] = 0x1f60d, - [OK] = 0x1F44C, - [SMIR] = 0x1F60F, - [PRAY] = 0x1F64F, - [CELE] = 0x1F64C, - [COOL] = 0x1F60E, - [EYES] = 0x1F440, - [THNK] = 0x1F914, - [NAIL] = 0x1F485, - [SOS] = 0x1F198, - [REDB] = 0x1F171, - [HNDR] = 0x1F4AF, - [MONY] = 0x1F480, - [FIRE] = 0x1F525, - [CAR] = 0x1F697, - [BUTT] = 0x1F351, - [BNIS] = 0x1F346, - [CUM] = 0x1F4A6, - [CLAP] = 0x1F44F, - [TRIU] = 0x1F624, - [SCRM] = 0x1F631, - [VOMI] = 0x1F92E, - [DTIV] = 0x1F575, - [EXPL] = 0x1F92F, - [HAIR] = 0x2640, - [DANC] = 0x1F483, - [STRN] = 0x1F4AA, - [LEFT] = 0x1F448, - [RGHT] = 0x1F449, -}; - -enum custom_keycodes { - CTRL_Z = SAFE_RANGE, - CTRL_X, - CTRL_C, - CTRL_V -}; - -// Enable these functions using FUNC(n) macro. -// const uint16_t PROGMEM fn_actions[] = { //ACTION_LAYER_TAP_TOGGLE requires that number of taps be defined in *config.h* - default set to 5 -// [0] = , //Hold for momentary LMouse layer, Tap for Space, -// [1] = , //Hold for momentary RMouse layer, Tap for Space, -// [2] = , //Hold for momentary Lower -// [3] = , //Hold for momentary Raise -// [4] = , //Hold for momentary Emoji -// }; - -#define SP_LMS LT(_LMOUSE, KC_SPC) -#define SP_RMS LT(_RMOUSE, KC_SPC) -#define LOW TT(_LOWER) -#define RAI TT(_RAISE) -#define EMO TT(_EMOJI) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Base - * ,-----------------------------------------. ,-----------------------------------------. - * | GEsc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Entr | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | LOW | A | S | D | F | G | | H | J | K | L | ; | " | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shft | Z | X | C | V | B | | N | M | , | . | / | Shft | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl | EMO | Alt | GUI | SPCE |SP_LMS| |SP_RMS|SP_RMS| GUI | Alt | RAI | Ctrl | - * `-----------------------------------------' `-----------------------------------------' - */ - [_BASE] = LAYOUT( \ - KC_GESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , /**/ KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC , \ - KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , /**/ KC_Y , KC_U , KC_I , KC_O , KC_P , KC_ENT , \ - LOW , KC_A , KC_S , KC_D , KC_F , KC_G , /**/ KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT , \ - KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , /**/ KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT , \ - KC_LCTL , EMO , KC_LALT , KC_LGUI , KC_SPC , SP_LMS , /**/ SP_RMS , KC_SPC , KC_RGUI , KC_RALT , RAI , KC_RCTL \ - ), - - - /* Lower - * ,-----------------------------------------. ,-----------------------------------------. - * | GESC | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Entr | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | \ | - | = | [ | ] | | [ | ] | - | = | \ | Del | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shft | ^Z | ^X | ^C | ^V | | | Play | Vol+ | Vol- | Mute | Next | Shft | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | - * `-----------------------------------------' `-----------------------------------------' - */ - [_LOWER] = LAYOUT( \ - TO(0) , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , /**/ KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , \ - _______ , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , /**/ KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , \ - _______ , KC_RCBR , KC_MINS , KC_EQL , KC_LBRC , KC_RBRC , /**/ KC_LBRC , KC_RBRC , KC_MINS , KC_EQL , KC_BSLS , KC_DEL , \ - _______ , CTRL_Z , CTRL_X , CTRL_C , CTRL_V , XXXXXXX , /**/ KC_MPLY , KC_VOLU , KC_VOLD , KC_MUTE , KC_MNXT , _______ , \ - _______ , XXXXXXX , _______ , _______ , _______ , XXXXXXX , /**/ XXXXXXX , _______ , _______ , _______ , XXXXXXX , _______ \ - ), - - /* Raise - * ,-----------------------------------------. .-----------------------------------------. - * | GESC | | | | | | | | = | / | * | - | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | F9 | F10 | F11 | F12 | | | | 7 | 8 | 9 | + | Entr | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | F5 | F6 | F7 | F8 | | | | 4 | 5 | 6 | , | Del | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shft | F1 | F2 | F3 | F4 | | | | 1 | 2 | 3 | . | Shft | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl | | Alt | GUI | | | | | 0 | GUI | Alt | | Ctrl | - * `-----------------------------------------' `-----------------------------------------' - */ - - [_RAISE] = LAYOUT( \ - TO(0) , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ XXXXXXX , KC_EQL , KC_SLSH , KC_ASTR , KC_MINS , _______ , \ - _______ , KC_F9 , KC_F10 , KC_F11 , KC_F12 , XXXXXXX , /**/ XXXXXXX , KC_7 , KC_8 , KC_9 , KC_PLUS , _______ , \ - XXXXXXX , KC_F5 , KC_F6 , KC_F7 , KC_F8 , XXXXXXX , /**/ XXXXXXX , KC_4 , KC_5 , KC_6 , KC_COMM , KC_DEL , \ - _______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , XXXXXXX , /**/ XXXXXXX , KC_1 , KC_2 , KC_3 , KC_DOT , _______ , \ - _______ , XXXXXXX , _______ , _______ , _______ , XXXXXXX , /**/ XXXXXXX , KC_0 , _______ , _______ , _______ , _______ \ - ), - - /* LMOUSE (Lower + Raise) - * ,-----------------------------------------. ,-----------------------------------------. - * | GESC | | Home | End | PGUP | PGDN | | | | | | | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | WH_L | BTN1 | MS_U | BTN2 | WH_U | | | | | | | Entr | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | WH_R | MS_L | MS_D | MS_R | WH_D | | | | | | | Del | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shft | LEFT | DOWN | UP |RIGHT | | | | | | | | Shft | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | - * `-----------------------------------------' `-----------------------------------------' - */ - - [_LMOUSE] = LAYOUT( \ - TO(0) , XXXXXXX , KC_HOME , KC_END , KC_PGUP , KC_PGDN , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ - _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ - XXXXXXX , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_DEL , \ - _______ , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , XXXXXXX , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ - _______ , XXXXXXX , _______ , _______ , _______ , _______ , /**/ XXXXXXX , _______ , _______ , _______ , XXXXXXX , _______ \ - ), - - /* RMOUSE (Lower + Raise) - * ,-----------------------------------------. ,-----------------------------------------. - * | GESC | | | | | | | PGUP | PGDN | Home | End | | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | | | | | | | WH_U | BTN1 | MS_U | BTN2 | WH_L | Entr | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | WH_D | MS_L | MS_D | MS_R | WH_R | Del | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shft | | | | | | | | LEFT | DOWN | UP |RIGHT | Shft | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | - * `-----------------------------------------' `-----------------------------------------' - */ - - [_RMOUSE] = LAYOUT( \ - TO(0) , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ KC_PGUP , KC_PGDN , KC_HOME , KC_END , XXXXXXX , _______ , \ - _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ , \ - XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , KC_DEL , \ - _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ XXXXXXX , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , _______ , \ - _______ , XXXXXXX , _______ , _______ , _______ , XXXXXXX , /**/ _______ , _______ , _______ , _______ , XXXXXXX , _______ \ - ), - - /* Emojis - * ,-----------------------------------------. ,-----------------------------------------. - * | GESC | | | | | | | RSET | | | | | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | CLAP | CUM | BNIS | BUTT | CAR | | FIRE | REDB | MONY | 100 | SOS | Entr | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | CELE | PRAY | NAIL | OK | THNK | | UNAM | HEYE | COOL | EYES | SMIR | Del | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shft | TRIU | SCRM | VOMI | DTIV | EXPL | | HAIR | DANC | STRN | LEFT | RGHT | Shft | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | - * `-----------------------------------------' `-----------------------------------------' - */ - - [_EMOJI] = LAYOUT( \ - TO(0) , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ RESET , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ - _______ , X(CLAP) , X(CUM) , X(BNIS) , X(BUTT) , X(CAR) , /**/ X(FIRE) , X(REDB) , X(MONY) , X(HNDR) , X(SOS) , _______ , \ - XXXXXXX , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , /**/ X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , KC_DEL , \ - _______ , X(TRIU) , X(SCRM) , X(VOMI) , X(DTIV) , X(EXPL) , /**/ X(HAIR) , X(DANC) , X(STRN) , X(LEFT) , X(RGHT) , _______ , \ - _______ , _______ , _______ , _______ , _______ , XXXXXXX , /**/ XXXXXXX , _______ , _______ , _______ , XXXXXXX , _______ \ - ), - -}; - -void matrix_init_user(void) { - set_unicode_input_mode(UC_LNX); -}; - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - if (record->event.pressed) { - switch(keycode) { - case CTRL_Z: - SEND_STRING(SS_LCTRL("z")); - return false; - case CTRL_X: - SEND_STRING(SS_LCTRL("x")); - return false; - case CTRL_C: - SEND_STRING(SS_LCTRL("c")); - return false; - case CTRL_V: - SEND_STRING(SS_LCTRL("v")); - return false; - } - } - - return true; -} diff --git a/keyboards/nyquist/keymaps/danielhklein/keymap.c b/keyboards/nyquist/keymaps/danielhklein/keymap.c deleted file mode 100644 index e072527b1e8..00000000000 --- a/keyboards/nyquist/keymaps/danielhklein/keymap.c +++ /dev/null @@ -1,177 +0,0 @@ -#include QMK_KEYBOARD_H - -/* - Keymap is loosely based on DivergeJM's Nyquist keymap - Major changes made: - - DVORAK, COLEMAK, FUNCTION, MOUSE, and ADJUST layers have been removed - - right 2u key performs backspace, not enter - - LOWER layer controls function keys, media controls, and underglow - - ARROW layer uses JKLI for arrow keys - - Bootmagic enabled and bootmagic initialization key changed from space to enter -*/ - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -enum custom_layers { - _QWERTY, - _LOWER, - _RAISE, - _ARROW -}; - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ARROW -}; - - // Enable these functions using FUNC(n) macro. - const uint16_t PROGMEM fn_actions[] = { //ACTION_LAYER_TAP_TOGGLE requires that number of taps be defined in *config.h* - default set to 5 - [0] = LT(_LOWER, KC_SPC), //Hold for momentary Lower layer, Tap for Backspace, - [1] = LT(_RAISE, KC_BSPC), //Hold for momentary Raise layer, Tap for Space, - [2] = MO(_ARROW), //Hold for momentary Arrow - }; - -#define SPC_LWR FUNC(0) -#define BSP_RSE FUNC(1) -#define ARW FUNC(2) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// Underglow setup -#define RGBLIGHT_SLEEP -#define RGBLIGHT_ANIMATIONS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* QWERTY - * .----------------------------------------. .-----------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P |Enter | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * | Caps| A | S | D | F | G | | H | J | K | L | ; | " | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * |Lshft| Z | X | C | V | B | | N | M | , | . | / |Rshft | - * |-----+------+------+------+------+------| |------+------+------+------+------+------| - * |Arrow| LCtrl| LAlt | LGui | Bspc/Raise | | Spc/Lower | RGui | RAlt | RCtrl| Del | - * `----------------------------------------' '-----------------------------------------' - */ - -[_QWERTY] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - ARW, KC_LCTL, KC_LALT, KC_LGUI, BSP_RSE, BSP_RSE, SPC_LWR, SPC_LWR, KC_RGUI, KC_RALT, KC_RCTL, KC_DEL - ), - -/* Raise - * ,-----------------------------------------. .-----------------------------------------. - * | | | | | | | | = | / | * | - | \ | ` | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | 7 | 8 | 9 | + | [ | ] | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | 4 | 5 | 6 | Enter| | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Lshft| | | | | | | 1 | 2 | 3 | Space| | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | LGui | | | 0 | . | Bspc | | | - * `-----------------------------------------' `-----------------------------------------' - */ - -[_RAISE] = LAYOUT( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PEQL, KC_PSLS, KC_PAST, KC_MINS, KC_BSLS, KC_GRV, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, KC_PPLS, KC_LBRC, KC_RBRC, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_PENT, XXXXXXX, XXXXXXX, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_SPC, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, KC_0, KC_0, KC_DOT, KC_BSPC, XXXXXXX, XXXXXXX -), - -/* Lower - * ,-----------------------------------------. .-----------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | >/|| | Mute | Vol- | Vol+ | |<< | >>| | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |RGB IO|RGB >>|RGB <<|Hue++ |Hue-- | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |Sat++ |Sat-- |Val++ |Val-- | | | | | | | | - * `-----------------------------------------' `-----------------------------------------' -*/ - -[_LOWER] = LAYOUT( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - RGB_TOG, RGB_MOD, RGB_RMOD, RGB_HUI, RGB_HUD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - ), - -/* Arrow - * ,-----------------------------------------. ,----------------------------------------. - * | | | | | | | | | | | | | | - * |------+------+------+------+------+------| |-----+------+------+------+------+------| - * | | | | | | | | | | Up | | | | - * |------+------+------+------+------+------| |-----+------+------+------+------+------| - * | | | | | | | | | Left | Down |Right | | | - * |------+------+------+------+------+------| |-----+------+------+------+------+------| - * | | | | | | | | | | | | | | - * |------+------+------+------+------+------| |-----+------+------+------+------+------| - * | | | | Gui | | | | | | | | - * `-----------------------------------------' `----------------------------------------' - */ - -[_ARROW] = LAYOUT( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX -), - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -/* Cases to switch default layer to QWERTY, COLEMAK or DVORAK - and to access ADJUST layer to access the switch keys */ -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - } else { - layer_off(_LOWER); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - } else { - layer_off(_RAISE); - } - return false; - break; - } - return true; -} diff --git a/keyboards/nyquist/keymaps/default/config.h b/keyboards/nyquist/keymaps/default/config.h deleted file mode 100644 index c4604af436f..00000000000 --- a/keyboards/nyquist/keymaps/default/config.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/nyquist/keymaps/default/keymap.c b/keyboards/nyquist/keymaps/default/keymap.c deleted file mode 100644 index 0e3a1b9ab82..00000000000 --- a/keyboards/nyquist/keymaps/default/keymap.c +++ /dev/null @@ -1,230 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/nyquist/keymaps/default/rules.mk b/keyboards/nyquist/keymaps/default/rules.mk deleted file mode 100644 index 1e576127880..00000000000 --- a/keyboards/nyquist/keymaps/default/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/nyquist/keymaps/hexwire/config.h b/keyboards/nyquist/keymaps/hexwire/config.h deleted file mode 100644 index 8b9c3ea2bdf..00000000000 --- a/keyboards/nyquist/keymaps/hexwire/config.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#define TAPPING_TERM 150 - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/nyquist/keymaps/hexwire/keymap.c b/keyboards/nyquist/keymaps/hexwire/keymap.c deleted file mode 100644 index c030cd3b6af..00000000000 --- a/keyboards/nyquist/keymaps/hexwire/keymap.c +++ /dev/null @@ -1,217 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _FN3 5 -#define _FN4 6 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - FN3, - FN4, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen -#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen -#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen -#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen -#define KC_X0 MT(MOD_LCTL, KC_ESC) -#define KC_X1 LOWER -#define KC_X2 RAISE -#define KC_X3 LT(_FN3, KC_GRV) -#define KC_X4 MT(MOD_LSFT, KC_ENT) -#define KC_BL_S BL_STEP - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_COLEMAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_DVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , O , E , U , I , D , H , T , N , S ,SLSH, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - BL_S, , , , , , DEL , , P0 ,PDOT, , - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - - [_FN3] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' - ), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) - - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/nyquist/keymaps/hexwire/rules.mk b/keyboards/nyquist/keymaps/hexwire/rules.mk deleted file mode 100644 index 1e576127880..00000000000 --- a/keyboards/nyquist/keymaps/hexwire/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/nyquist/keymaps/jojiichan/keymap.c b/keyboards/nyquist/keymaps/jojiichan/keymap.c deleted file mode 100644 index e8f92f37d74..00000000000 --- a/keyboards/nyquist/keymaps/jojiichan/keymap.c +++ /dev/null @@ -1,51 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, - KC_LCTL, KC_LGUI, KC_LALT, TG(4), MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_RGHT, KC_UP, KC_DOWN), - - LAYOUT( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - KC_PAUS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_END, KC_PGDN), - - LAYOUT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, - KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_PIPE, - KC_UNDS, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_BSLS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - LAYOUT( - LALT(KC_F4), LSFT(KC_EXLM), LSFT(KC_AT), LSFT(KC_HASH), LSFT(KC_DLR), LSFT(KC_PERC), LSFT(KC_CIRC), LSFT(KC_AMPR), LSFT(KC_ASTR), LSFT(KC_LPRN), LSFT(KC_RPRN), LSFT(KC_DEL), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_COLN), LSFT(KC_DQUO), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_LABK), LSFT(KC_RABK), LSFT(KC_QUES), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - LAYOUT( - KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_PGDN, KC_SLSH, KC_ASTR, KC_MINS, - KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_O, KC_7, KC_8, KC_9, KC_PLUS, - KC_TRNS, KC_A, KC_S, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_PLUS, - KC_LSFT, KC_TRNS, KC_X, KC_C, KC_TRNS, KC_TRNS, KC_N, KC_TRNS, KC_1, KC_2, KC_3, KC_ENT, - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_0, KC_0, KC_DOT, KC_ENT) - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} diff --git a/keyboards/nyquist/keymaps/jojiichan/rules.mk b/keyboards/nyquist/keymaps/jojiichan/rules.mk deleted file mode 100644 index 1e576127880..00000000000 --- a/keyboards/nyquist/keymaps/jojiichan/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/nyquist/keymaps/kim-kim/keymap.c b/keyboards/nyquist/keymaps/kim-kim/keymap.c deleted file mode 100644 index c8b081b25f7..00000000000 --- a/keyboards/nyquist/keymaps/kim-kim/keymap.c +++ /dev/null @@ -1,83 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QW 0 -#define _LW 1 -#define _RS 2 - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* SPLIT QWERTY - * .-----------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ` | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| - * | TAB | Q | W | E | R | T | Y | U | I | O | P | BSPACE | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| - * | LCTRL | A | S | D | F | G | H | J | K | L | ; | ENTER | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| - * | LSHIFT | Z | X | C | V | B | N | M | < | > | / | RSHIFT | - * |--------+--------+--------+--------+--------+-----------------+--------+-----------------+--------+--------| - * | LALT | RAISE | RAISE | LGUI | SPACE | SPACE | SPACE | SPACE | RGUI | LOWER | LOWER | RALT | - * '-----------------------------------------------------------------------------------------------------------' - */ - [_QW] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ - KC_LALT, MO(_RS), MO(_RS), KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(_LW), MO(_LW), KC_RALT \ - ), - -/* Lower - * .-----------------------------------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | PREV | NEXT | VOLUP | RGBTOG | F11 | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | PLAY | STOP | VOLDWN | RGBMOD | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | MUTE | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | - * '-----------------------------------------------------------------------------------------------------------' - */ -[_LW] = LAYOUT( \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, \ - _______, KC_MPRV, KC_MNXT, KC_VOLU, RGB_TOG, KC_F11, _______, _______, _______, _______, _______, _______, \ - _______, KC_MPLY, KC_MSTP, KC_VOLD, RGB_SMOD, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), - -/* Raise - * .-----------------------------------------------------------------------------------------------------------. - * | | | | | | | F6 | F7 | F8 | F9 | F10 | DELETE | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | F12 | [ | ] | - | = | \ | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | PRTSCR | LEFT | DOWN | UP | RIGHT | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | | HOME | PGDN | PGUP | END | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | - * '-----------------------------------------------------------------------------------------------------------' - */ -[_RS] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, \ - _______, _______, _______, _______, _______, _______, KC_F12, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_BSLS, \ - _______, _______, _______, _______, _______, _______, KC_PSCR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; diff --git a/keyboards/nyquist/keymaps/kim-kim/rules.mk b/keyboards/nyquist/keymaps/kim-kim/rules.mk deleted file mode 100644 index 1e576127880..00000000000 --- a/keyboards/nyquist/keymaps/kim-kim/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/nyquist/keymaps/losinggeneration/rules.mk b/keyboards/nyquist/keymaps/losinggeneration/rules.mk deleted file mode 100644 index ea2b7165d9b..00000000000 --- a/keyboards/nyquist/keymaps/losinggeneration/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -AUDIO_ENABLE = no # Audio output on port C6 -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -COMMAND_ENABLE = no # Commands for debug and configuration -CONSOLE_ENABLE = no # Console for debug(+400) -MIDI_ENABLE = no # MIDI controls -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/nyquist/keymaps/pitty/keymap.c b/keyboards/nyquist/keymaps/pitty/keymap.c deleted file mode 100644 index dea317d2ae8..00000000000 --- a/keyboards/nyquist/keymaps/pitty/keymap.c +++ /dev/null @@ -1,173 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _GAME 1 -#define _LOWER 2 -#define _VIM 3 - - -enum custom_macros { - DLEFT, - DRIGHT, -}; - - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | 0(') | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Ö(0) | Ü(-) | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Z(Y)| U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | É(;)| Á(") | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |Í/Shft| Y(Z) | X | C | V | B | N | M | , | . | -(/)| Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt |LOWER | Spc | Spc | Bksp | Ent | Alt | =(&) | GAME | Del | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - MT(MOD_LSFT, KC_NUBS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, TT(_LOWER), LT(_VIM, KC_SPC), LT(_VIM, KC_SPC), KC_BSPC, KC_ENT, KC_RALT, KC_AMPERSAND, TG(_GAME), KC_DEL \ -), - -/* Gaming mode - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | |QWERTY| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | Spc | Spc | | | Left | Down | Up | Right| - * `-----------------------------------------------------------------------------------' - */ -[_GAME] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | Up | | | | | 7 | 8 | 9 | / | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | Left | Down | Right| | | | 4 | 5 | 6 | * | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| | | | | | | 1 | 2 | 3 | - | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | 0 | . | = | + | | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, _______, KC_UP, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_KP_SLASH, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_4, KC_5, KC_6, KC_KP_ASTERISK, _______, \ - KC_LSFT, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_KP_MINUS, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_GRV, KC_KP_DOT, KC_KP_EQUAL, KC_KP_PLUS, _______ \ -), - - -/* Vim Movement (Hold down SPACE) - * ,-----------------------------------------------------------------------------------. - * | Ins | Home | PGUP | |DM_stp| | | | | | Ő | Ű | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | End | PGDN | |DM_REC| | | Ú | Í | Ó | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | DLeft|DRight| LCTRL| | | Left | Down | Up | Right| | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | LShft| | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_VIM] = LAYOUT( \ - KC_INS, KC_HOME, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_NUHS, \ - KC_DEL, KC_END, KC_PGDN, _______, _______, _______, _______, KC_RBRC, KC_NUBS, KC_EQL , _______, _______, \ - _______, M(DLEFT), M(DRIGHT), KC_LCTL, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case DLEFT: - if (record->event.pressed) { // Windows move desktop left - return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); - } - break; - case DRIGHT: - if (record->event.pressed) { // Windows move desktop right - return MACRO(D(LCTL), D(LGUI), T(RIGHT), U(LGUI), U(LCTL), END); - } - break; - } - return MACRO_NONE; -} - -#ifdef RGBLIGHT_ENABLE -bool rgb_layer_change = true; -#endif - -#define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); -#define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF); -#define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); -#define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); -#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); -#define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); -#define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF); -#define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); -#define rgblight_set_white rgblight_sethsv (0x00, 0x00, 0xFF); -#define rgblight_set_black rgblight_sethsv (0x00, 0x00, 0x00); - -uint32_t layer_state_set_user(uint32_t state) { -#ifdef RGBLIGHT_ENABLE - uint8_t default_layer = eeconfig_read_default_layer(); - if (rgb_layer_change) { - switch (biton32(state)) { - case _LOWER: - rgblight_set_purple; - rgblight_mode(5); - break; - case _VIM: - rgblight_set_green; - rgblight_mode(23); - break; - case _GAME: - rgblight_mode(8); - break; - default: - if (default_layer & (1UL << _GAME)) { - } - else - rgblight_mode(14); - break; - } - } -#endif - return state; -} diff --git a/keyboards/nyquist/keymaps/pitty/rules.mk b/keyboards/nyquist/keymaps/pitty/rules.mk deleted file mode 100644 index 8ebc85a44b4..00000000000 --- a/keyboards/nyquist/keymaps/pitty/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -NKRO_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/nyquist/keymaps/yshrsmz/keymap.c b/keyboards/nyquist/keymaps/yshrsmz/keymap.c deleted file mode 100644 index 78070279d1f..00000000000 --- a/keyboards/nyquist/keymaps/yshrsmz/keymap.c +++ /dev/null @@ -1,195 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _FUNC 3 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - FUNC, - ADJUST, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | GUI |Shift |Adjust| Fn | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - FUNC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_RGUI, KC_RSFT, ADJUST, FUNC \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* FUNC - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | F1 | F2 | F3 | F4 | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F5 | F6 | F7 | F8 | | LEFT | DOWN | UP |RIGHT | PGUP | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F9 | F10 | F11 | F12 | | HOME | END |Alt+← |Alt+→ | PGDN | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_FUNC] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \ - _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_HOME, KC_END, LALT(KC_LEFT),LALT(KC_RGHT), KC_PGDN, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case FUNC: - if (record->event.pressed) { - layer_on(_FUNC); - } else { - layer_off(_FUNC); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/nyquist/matrix.c b/keyboards/nyquist/matrix.c deleted file mode 100644 index 3cdad4adb8e..00000000000 --- a/keyboards/nyquist/matrix.c +++ /dev/null @@ -1,497 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" - -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" - extern backlight_config_t backlight_config; -#endif - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define SERIAL_LED_ADDR 0x00 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0); -#else - // Write zero, so our byte index is the same - err = i2c_master_write(0x00); -#endif - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_LED_ADDR] = backlight_config.enable ? backlight_config.level : 0; -#endif - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(i2c_slave_buffer[0]); -#endif - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i+1] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); -#endif -#endif -} - -bool matrix_is_modified(void) -{ -#if (DEBOUNCING_DELAY > 0) - if (debouncing) return false; -#endif - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/nyquist/nyquist.h b/keyboards/nyquist/nyquist.h deleted file mode 100644 index d401a45f78f..00000000000 --- a/keyboards/nyquist/nyquist.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef NYQUIST_H -#define NYQUIST_H - -#ifdef KEYBOARD_nyquist_rev1 - #include "rev1.h" -#endif -#ifdef KEYBOARD_nyquist_rev2 - #include "rev2.h" -#endif - -#include "quantum.h" - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ - KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45 \ - ) - -#endif diff --git a/keyboards/nyquist/readme.md b/keyboards/nyquist/readme.md deleted file mode 100644 index 1b417a65884..00000000000 --- a/keyboards/nyquist/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -Nyquist -======= - -A split 60% split 5x12 ortholinear keyboard made and sold by Keebio. [More info at Keebio](https://keeb.io). - -Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make nyquist/rev1:default - -Example of flashing this keyboard: - - make nyquist/rev1:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -A build guide for this keyboard can be found here: [Nyquist Build Guide](https://docs.keeb.io) diff --git a/keyboards/nyquist/rev1/config.h b/keyboards/nyquist/rev1/config.h deleted file mode 100644 index eec084eccd2..00000000000 --- a/keyboards/nyquist/rev1/config.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCB10 -#define PRODUCT_ID 0x1156 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT The Nyquist Keyboard -#define DESCRIPTION Split 60 percent ortholinear keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 16 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/nyquist/rev1/rev1.h b/keyboards/nyquist/rev1/rev1.h deleted file mode 100644 index 2d4c9f73ee4..00000000000 --- a/keyboards/nyquist/rev1/rev1.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef REV1_H -#define REV1_H - -#include "nyquist.h" - -//void promicro_bootloader_jmp(bool program); -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -//void promicro_bootloader_jmp(bool program); - -#ifndef FLIP_HALF -// Standard Keymap -// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { L40, L41, L42, L43, L44, L45 }, \ - { R05, R04, R03, R02, R01, R00 }, \ - { R15, R14, R13, R12, R11, R10 }, \ - { R25, R24, R23, R22, R21, R20 }, \ - { R35, R34, R33, R32, R31, R30 }, \ - { R45, R44, R43, R42, R41, R40 } \ - } -#else -// Keymap with right side flipped -// (TRRS jack on both halves are to the right) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { L40, L41, L42, L43, L44, L45 }, \ - { R00, R01, R02, R03, R04, R05 }, \ - { R10, R11, R12, R13, R14, R15 }, \ - { R20, R21, R22, R23, R24, R25 }, \ - { R30, R31, R32, R33, R34, R35 }, \ - { R40, R41, R42, R43, R44, R45 } \ - } -#endif - -#define LAYOUT_ortho_5x12 LAYOUT - -#endif diff --git a/keyboards/nyquist/rev2/config.h b/keyboards/nyquist/rev2/config.h deleted file mode 100644 index ab062c9209c..00000000000 --- a/keyboards/nyquist/rev2/config.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef REV2_CONFIG_H -#define REV2_CONFIG_H - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCB10 -#define PRODUCT_ID 0x1156 -#define DEVICE_VER 0x0200 -#define MANUFACTURER Keebio -#define PRODUCT The Nyquist Keyboard -#define DESCRIPTION Split 60 percent ortholinear keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } -#define MATRIX_COL_PINS { D2, F5, F6, F7, B1, B3 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 16 // Number of LEDs - -/* Backlight LEDs */ -#define BACKLIGHT_PIN B6 -#define BACKLIGHT_LEVELS 7 - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/nyquist/rev2/rev2.h b/keyboards/nyquist/rev2/rev2.h deleted file mode 100644 index 1eec5d2beb8..00000000000 --- a/keyboards/nyquist/rev2/rev2.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef REV2_H -#define REV2_H - -#include "nyquist.h" - -//void promicro_bootloader_jmp(bool program); -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -//void promicro_bootloader_jmp(bool program); - -#ifndef FLIP_HALF -// Standard Keymap -// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { L40, L41, L42, L43, L44, L45 }, \ - { R05, R04, R03, R02, R01, R00 }, \ - { R15, R14, R13, R12, R11, R10 }, \ - { R25, R24, R23, R22, R21, R20 }, \ - { R35, R34, R33, R32, R31, R30 }, \ - { R45, R44, R43, R42, R41, R40 } \ - } -#else -// Keymap with right side flipped -// (TRRS jack on both halves are to the right) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { L40, L41, L42, L43, L44, L45 }, \ - { R00, R01, R02, R03, R04, R05 }, \ - { R10, R11, R12, R13, R14, R15 }, \ - { R20, R21, R22, R23, R24, R25 }, \ - { R30, R31, R32, R33, R34, R35 }, \ - { R40, R41, R42, R43, R44, R45 } \ - } -#endif - -#define LAYOUT_ortho_5x12 LAYOUT - -#endif diff --git a/keyboards/nyquist/rules.mk b/keyboards/nyquist/rules.mk deleted file mode 100644 index 74d5625f855..00000000000 --- a/keyboards/nyquist/rules.mk +++ /dev/null @@ -1,75 +0,0 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -USE_I2C = yes -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -CUSTOM_MATRIX = yes - -LAYOUTS = ortho_5x12 - -DEFAULT_FOLDER = nyquist/rev2 diff --git a/keyboards/nyquist/serial.c b/keyboards/nyquist/serial.c deleted file mode 100644 index 74bcbb6bf6e..00000000000 --- a/keyboards/nyquist/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/nyquist/serial.h b/keyboards/nyquist/serial.h deleted file mode 100644 index 15fe4db7b4c..00000000000 --- a/keyboards/nyquist/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/nyquist/split_util.c b/keyboards/nyquist/split_util.c deleted file mode 100644 index 346cbc90894..00000000000 --- a/keyboards/nyquist/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/ok60/config.h b/keyboards/ok60/config.h index db7b74e5872..cc056a489cc 100644 --- a/keyboards/ok60/config.h +++ b/keyboards/ok60/config.h @@ -52,7 +52,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -66,11 +66,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN F6 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 10 diff --git a/keyboards/ok60/keymaps/default/keymap.c b/keyboards/ok60/keymaps/default/keymap.c index 1cc2232a130..c51510c646e 100644 --- a/keyboards/ok60/keymaps/default/keymap.c +++ b/keyboards/ok60/keymaps/default/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_60_ansi( @@ -9,7 +7,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_MENU, KC_LCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL ), [1] = LAYOUT_60_ansi( diff --git a/keyboards/ok60/keymaps/ebrowncross/keymap.c b/keyboards/ok60/keymaps/ebrowncross/keymap.c index 87921791077..e2dbc8429a7 100644 --- a/keyboards/ok60/keymaps/ebrowncross/keymap.c +++ b/keyboards/ok60/keymaps/ebrowncross/keymap.c @@ -2,8 +2,6 @@ // An ISO UK keymap -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_60_iso( diff --git a/keyboards/ok60/keymaps/ptillemans/keymap.c b/keyboards/ok60/keymaps/ptillemans/keymap.c new file mode 100644 index 00000000000..ff777847f63 --- /dev/null +++ b/keyboards/ok60/keymaps/ptillemans/keymap.c @@ -0,0 +1,20 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_60_iso( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_GRAVE, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT,KC_UP), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), MT(MOD_RALT,KC_LEFT), MT(MOD_RGUI,KC_DOWN), MT(MOD_RCTL,KC_RGHT) + ), + + [1] = LAYOUT_60_iso( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_PSCR, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/ok60/readme.md b/keyboards/ok60/readme.md index de67ab628f7..014c3042611 100644 --- a/keyboards/ok60/readme.md +++ b/keyboards/ok60/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make ok60:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/omnikey_blackheart/config.h b/keyboards/omnikey_blackheart/config.h index 94412cfa673..6c9be77b6bf 100644 --- a/keyboards/omnikey_blackheart/config.h +++ b/keyboards/omnikey_blackheart/config.h @@ -29,7 +29,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -37,11 +37,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* force n-key rollover*/ #define FORCE_NKRO diff --git a/keyboards/omnikey_blackheart/readme.md b/keyboards/omnikey_blackheart/readme.md index e375d53f90b..04bb49818c1 100644 --- a/keyboards/omnikey_blackheart/readme.md +++ b/keyboards/omnikey_blackheart/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make omnikey_blackheart:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/omnikeyish/config.h b/keyboards/omnikeyish/config.h new file mode 100644 index 00000000000..d510c64c9b9 --- /dev/null +++ b/keyboards/omnikeyish/config.h @@ -0,0 +1,63 @@ +#pragma once + +#include "config_common.h" + +#define KEYBOARD_PCB_REV 11 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0666 +#define DEVICE_VER 0x1337 +#define MANUFACTURER Henrik O. Sørensen +#define PRODUCT Omnikey(-ish) Keyboard +#define DESCRIPTION Replacement PCB for Omnikey keyboards + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 23 + +/* key matrix pins */ +#if KEYBOARD_PCB_REV == 10 +#define MATRIX_ROW_PINS { D2, D3, D4, D5, D6, D7 } +#else +#define MATRIX_ROW_PINS { D2, D3, D4, D5, E6, D7 } +#endif +#define MATRIX_COL_PINS { F0, F1, F2, F3, F4, F5, F6, F7, C7, C6, C5, C4, C3, C2, C1, C0, B0, B1, B2, B3, B4, B5, B6 } + +#define NUMLOCKLEDPIN E0 +#define CAPSLOCKLEDPIN E1 +#define SCROLLLOCKLEDPIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* number of backlight levels */ +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 0 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* force n-key rollover*/ +#define FORCE_NKRO + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#define DYNAMIC_MACRO_COUNT 12 +#define DYNAMIC_MACRO_SIZE 48 +#define DYNAMIC_MACRO_EEPROM_STORAGE +#define DYNAMIC_MACRO_EEPROM_MAGIC_ADDR (uint16_t*)32 +#define DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR (uint8_t*)34 diff --git a/keyboards/omnikeyish/dynamic_macro.c b/keyboards/omnikeyish/dynamic_macro.c new file mode 100644 index 00000000000..c359b0bdd02 --- /dev/null +++ b/keyboards/omnikeyish/dynamic_macro.c @@ -0,0 +1,252 @@ +#include QMK_KEYBOARD_H +#include + +void dynamic_macro_init(void) { + /* zero out macro blocks */ + memset(&dynamic_macros, 0, DYNAMIC_MACRO_COUNT * sizeof(dynamic_macro_t)); +} + +/* Blink the LEDs to notify the user about some event. */ +void dynamic_macro_led_blink(void) { +#ifdef BACKLIGHT_ENABLE + backlight_toggle(); + wait_ms(100); + backlight_toggle(); +#else + led_set(host_keyboard_leds() ^ 0xFF); + wait_ms(100); + led_set(host_keyboard_leds()); +#endif +} + +/** + * Start recording of the dynamic macro. + * + * @param macro_id[in] The id of macro to be recorded + */ +void dynamic_macro_record_start(uint8_t macro_id) { + dprintf("dynamic macro recording: started for slot %d\n", macro_id); + + dynamic_macro_led_blink(); + + clear_keyboard(); + layer_clear(); + + dynamic_macros[macro_id].length = 0; +} + +/** + * Play the dynamic macro. + * + * @param macro_id[in] The id of macro to be played + */ +void dynamic_macro_play(uint8_t macro_id) { + dprintf("dynamic macro: slot %d playback, length %d\n", macro_id, dynamic_macros[macro_id].length); + + uint32_t saved_layer_state = layer_state; + + clear_keyboard(); + layer_clear(); + + for (uint8_t i = 0; i < dynamic_macros[macro_id].length; ++i) { + process_record(&dynamic_macros[macro_id].events[i]); + } + + clear_keyboard(); + + layer_state = saved_layer_state; +} + +/** + * Record a single key in a dynamic macro. + * + * @param macro_id[in] The start of the used macro buffer. + * @param record[in] The current keypress. + */ +void dynamic_macro_record_key(uint8_t macro_id, keyrecord_t* record) { + dynamic_macro_t* macro = &dynamic_macros[macro_id]; + uint8_t length = macro->length; + + /* If we've just started recording, ignore all the key releases. */ + if (!record->event.pressed && length == 0) { + dprintln("dynamic macro: ignoring a leading key-up event"); + return; + } + + if (length < DYNAMIC_MACRO_SIZE) { + macro->events[length] = *record; + macro->length = ++length; + } else { + dynamic_macro_led_blink(); + } + + dprintf("dynamic macro: slot %d length: %d/%d\n", macro_id, length, DYNAMIC_MACRO_SIZE); +} + +/** + * End recording of the dynamic macro. Essentially just update the + * pointer to the end of the macro. + */ +void dynamic_macro_record_end(uint8_t macro_id) { + dynamic_macro_led_blink(); + + dynamic_macro_t* macro = &dynamic_macros[macro_id]; + uint8_t length = macro->length; + + keyrecord_t* events_begin = &(macro->events[0]); + keyrecord_t* events_pointer = &(macro->events[length - 1]); + + dprintf("dynamic_macro: macro length before trimming: %d\n", macro->length); + while (events_pointer != events_begin && (events_pointer)->event.pressed) { + dprintln("dynamic macro: trimming a trailing key-down event"); + --(macro->length); + --events_pointer; + } + +#ifdef DYNAMIC_MACRO_EEPROM_STORAGE + macro->checksum = dynamic_macro_calc_crc(macro); + dynamic_macro_save_eeprom(macro_id); +#endif + + dprintf("dynamic macro: slot %d saved, length: %d\n", macro_id, length); +} + +/* Handle the key events related to the dynamic macros. Should be + * called from process_record_user() like this: + * + * bool process_record_user(uint16_t keycode, keyrecord_t *record) { + * if (!process_record_dynamic_macro(keycode, record)) { + * return false; + * } + * <...THE REST OF THE FUNCTION...> + * } + */ +bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t* record) { + /* 0 to DYNAMIC_MACRO_COUNT -1 - macro macro_id is being recorded */ + static uint8_t macro_id = 255; + static uint8_t recording_state = STATE_NOT_RECORDING; + + if (STATE_NOT_RECORDING == recording_state) { + /* Program key pressed to request programming mode */ + if (keycode == DYN_MACRO_PROG && record->event.pressed) { + dynamic_macro_led_blink(); + + recording_state = STATE_RECORD_KEY_PRESSED; + dprintf("dynamic macro: programming key pressed, waiting for macro slot selection. %d\n", recording_state); + + return false; + } + /* Macro key pressed to request macro playback */ + if (keycode >= DYN_MACRO_KEY1 && keycode <= DYN_MACRO_KEY12 && record->event.pressed) { + dynamic_macro_play(keycode - DYN_MACRO_KEY1); + + return false; + } + + /* Non-dynamic macro key, process it elsewhere. */ + return true; + } else if (STATE_RECORD_KEY_PRESSED == recording_state) { + /* Program key pressed again before a macro selector key, cancel macro recording. + Blink leds to indicate cancelation. */ + if (keycode == DYN_MACRO_PROG && record->event.pressed) { + dynamic_macro_led_blink(); + + recording_state = STATE_NOT_RECORDING; + dprintf("dynamic macro: programming key pressed, programming mode canceled. %d\n", recording_state); + + return false; + } else if (keycode >= DYN_MACRO_KEY1 && keycode <= DYN_MACRO_KEY12 && record->event.pressed) { + macro_id = keycode - DYN_MACRO_KEY1; + + /* Macro slot selected, enter recording state. */ + recording_state = STATE_CURRENTLY_RECORDING; + dynamic_macro_record_start(macro_id); + + return false; + } + /* Ignore any non-macro key press while in RECORD_KEY_PRESSED state. */ + return false; + } else if (STATE_CURRENTLY_RECORDING == recording_state) { + /* Program key pressed to request end of macro recording. */ + if (keycode == DYN_MACRO_PROG && record->event.pressed) { + dynamic_macro_record_end(macro_id); + recording_state = STATE_NOT_RECORDING; + + return false; + } + /* Don't record other macro key presses. */ + else if (keycode >= DYN_MACRO_KEY1 && keycode <= DYN_MACRO_KEY12 && record->event.pressed) { + dprintln("dynamic macro: playback key ignored in programming mode."); + return false; + } + /* Non-macro keypress that should be recorded */ + else { + dynamic_macro_record_key(macro_id, record); + + /* Don't output recorded keypress. */ + return false; + } + } + + return true; +} + +#ifdef __AVR__ +# include +uint16_t dynamic_macro_calc_crc(dynamic_macro_t* macro) { + uint16_t crc = 0; + uint8_t* data = (uint8_t*)macro; + + for (uint16_t i = 0; i < DYNAMIC_MACRO_CRC_LENGTH; ++i) { + crc = _crc16_update(crc, *(data++)); + } + return crc; +} +#endif /* __AVR__ */ + +inline void* dynamic_macro_eeprom_macro_addr(uint8_t macro_id) { + return DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR + sizeof(dynamic_macro_t) * macro_id; +} + +bool dynamic_macro_header_correct(void) { + return eeprom_read_word(DYNAMIC_MACRO_EEPROM_MAGIC_ADDR) == DYNAMIC_MACRO_EEPROM_MAGIC; +} + +void dynamic_macro_load_eeprom_all(void) { + if (!dynamic_macro_header_correct()) { + dprintf("dynamic_macro: eeprom header not valid, not restoring macros.\n"); + return; + } + + for (uint8_t i = 0; i < DYNAMIC_MACRO_COUNT; ++i) { + dynamic_macro_load_eeprom(i); + } +} + +void dynamic_macro_load_eeprom(uint8_t macro_id) { + dynamic_macro_t* dst = &dynamic_macros[macro_id]; + + eeprom_read_block(dst, dynamic_macro_eeprom_macro_addr(macro_id), sizeof(dynamic_macro_t)); + + /* Validate checksum, ifchecksum is NOT valid for macro, set its length to 0 to prevent its use. */ + if (dynamic_macro_calc_crc(dst) != dst->checksum) { + dprintf("dynamic macro: slot %d not loaded, checksum mismatch\n", macro_id); + dst->length = 0; + + return; + } + + dprintf("dynamic macro: slot %d loaded from eeprom, checksum okay\n", macro_id); +} + +void dynamic_macro_save_eeprom(uint8_t macro_id) { + if (!dynamic_macro_header_correct()) { + eeprom_write_word(DYNAMIC_MACRO_EEPROM_MAGIC_ADDR, DYNAMIC_MACRO_EEPROM_MAGIC); + dprintf("dynamic macro: writing magic eeprom header\n"); + } + + dynamic_macro_t* src = &dynamic_macros[macro_id]; + + eeprom_update_block(src, dynamic_macro_eeprom_macro_addr(macro_id), sizeof(dynamic_macro_t)); + dprintf("dynamic macro: slot %d saved to eeprom\n", macro_id); +} diff --git a/keyboards/omnikeyish/dynamic_macro.h b/keyboards/omnikeyish/dynamic_macro.h new file mode 100644 index 00000000000..87665c443bc --- /dev/null +++ b/keyboards/omnikeyish/dynamic_macro.h @@ -0,0 +1,95 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */ +#pragma once + +#include "action.h" +#include "action_layer.h" + +#ifndef DYNAMIC_MACRO_COUNT +#define DYNAMIC_MACRO_COUNT 2 +#endif + +#ifndef DYNAMIC_MACRO_SIZE +/* May be overridden with a custom value. Be aware that the effective + * macro length is half of this value: each keypress is recorded twice + * because of the down-event and up-event. This is not a bug, it's the + * intended behavior. + * + * Usually it should be fine to set the macro size to at least 256 but + * there have been reports of it being too much in some users' cases, + * so 128 is considered a safe default. + */ +#define DYNAMIC_MACRO_SIZE 64 +#endif + +#ifndef DYNAMIC_MACRO_EEPROM_STORAGE +#define DYNAMIC_MACRO_EEPROM_STORAGE +#endif + +/* DYNAMIC_MACRO_RANGE must be set as the last element of user's + * "planck_keycodes" enum prior to including this header. This allows + * us to 'extend' it. + */ +enum dynamic_macro_keycodes { + DYN_MACRO_PROG = DYNAMIC_MACRO_RANGE, + + /* Requirement: DYN_MACRO_KEYs are in sequence in the enum. */ + DYN_MACRO_KEY1, + DYN_MACRO_KEY2, + DYN_MACRO_KEY3, + DYN_MACRO_KEY4, + DYN_MACRO_KEY5, + DYN_MACRO_KEY6, + DYN_MACRO_KEY7, + DYN_MACRO_KEY8, + DYN_MACRO_KEY9, + DYN_MACRO_KEY10, + DYN_MACRO_KEY11, + DYN_MACRO_KEY12 +}; + +enum dynamic_macro_recording_state { STATE_NOT_RECORDING, STATE_RECORD_KEY_PRESSED, STATE_CURRENTLY_RECORDING }; + +typedef struct { + keyrecord_t events[DYNAMIC_MACRO_SIZE]; + uint8_t length; + uint16_t checksum; +} dynamic_macro_t; + +dynamic_macro_t dynamic_macros[DYNAMIC_MACRO_COUNT]; + +void dynamic_macro_init(void); +void dynamic_macro_led_blink(void); +void dynamic_macro_record_start(uint8_t macro_id); +void dynamic_macro_play(uint8_t macro_id); +void dynamic_macro_record_key(uint8_t macro_id, keyrecord_t* record); +void dynamic_macro_record_end(uint8_t macro_id); +bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t* record); + +#define DYNAMIC_MACRO_CRC_LENGTH (sizeof(dynamic_macro_t) - sizeof(uint16_t)) + +#ifdef DYNAMIC_MACRO_EEPROM_STORAGE +#define DYNAMIC_MACRO_EEPROM_MAGIC (uint16_t)0xDEAD + +uint16_t dynamic_macro_calc_crc(dynamic_macro_t* macro); +void dynamic_macro_load_eeprom_all(void); +void dynamic_macro_load_eeprom(uint8_t macro_id); +void dynamic_macro_save_eeprom(uint8_t macro_id); +bool dynamic_macro_header_correct(void); +#endif + diff --git a/keyboards/omnikeyish/info.json b/keyboards/omnikeyish/info.json new file mode 100644 index 00000000000..4a9e86d4cd6 --- /dev/null +++ b/keyboards/omnikeyish/info.json @@ -0,0 +1,84 @@ +{ + "keyboard_name": "Omnikey-(ish)", + "url": "https://github.com/henrikosorensen/keyboard_pcbs/tree/master/omnikeyish_pcb", + "maintainer": "qmk", + "width": 25.6667, + "height": 7, + "layouts": { + "LAYOUT_all": { + "layout": [ {"label":"P11", "x":0, "y":0}, {"label":"P12", "x":1, "y":0}, {"label":"Esc", "x":2.6667, "y":0}, {"label":"F1", "x":4.6667, "y":0}, {"label":"F2", "x":5.6667, "y":0}, {"label":"F3", "x":6.6667, "y":0}, {"label":"F4", "x":7.6667, "y":0}, {"label":"F5", "x":9.1667, "y":0}, {"label":"F6", "x":10.1667, "y":0}, {"label":"F7", "x":11.1667, "y":0}, {"label":"F8", "x":12.1667, "y":0}, {"label":"F9", "x":13.6667, "y":0}, {"label":"F10", "x":14.6667, "y":0}, {"label":"F11", "x":15.6667, "y":0}, {"label":"F12", "x":16.6667, "y":0}, {"label":"PrtSc", "x":18.1667, "y":0}, {"label":"Scroll Lock", "x":19.1667, "y":0}, {"label":"Pause", "x":20.1667, "y":0}, {"x":21.6667, "y":0}, {"x":22.6667, "y":0}, {"x":23.6667, "y":0}, {"x":24.6667, "y":0}, + {"label":"P1", "x":0, "y":2}, {"label":"P2", "x":1, "y":2}, {"label":"~", "x":2.6667, "y":2}, {"label":"!", "x":3.6667, "y":2}, {"label":"@", "x":4.6667, "y":2}, {"label":"#", "x":5.6667, "y":2}, {"label":"$", "x":6.6667, "y":2}, {"label":"%", "x":7.6667, "y":2}, {"label":"^", "x":8.6667, "y":2}, {"label":"&", "x":9.6667, "y":2}, {"label":"*", "x":10.6667, "y":2}, {"label":"(", "x":11.6667, "y":2}, {"label":")", "x":12.6667, "y":2}, {"label":"_", "x":13.6667, "y":2}, {"label":"+", "x":14.6667, "y":2}, {"label":"Back Space", "x":15.6667, "y":2, "w":2}, {"label":"Insert", "x":18.1667, "y":2}, {"label":"Home", "x":19.1667, "y":2}, {"label":"PgUp", "x":20.1667, "y":2}, {"label":"Num Lock", "x":21.6667, "y":2}, {"label":"/", "x":22.6667, "y":2}, {"label":"*", "x":23.6667, "y":2}, {"label":"-", "x":24.6667, "y":2}, + {"label":"P3", "x":0, "y":3}, {"label":"P4", "x":1, "y":3}, {"label":"Tab", "x":2.6667, "y":3, "w":1.5}, {"label":"Q", "x":4.1667, "y":3}, {"label":"W", "x":5.1667, "y":3}, {"label":"E", "x":6.1667, "y":3}, {"label":"R", "x":7.1667, "y":3}, {"label":"T", "x":8.1667, "y":3}, {"label":"Y", "x":9.1667, "y":3}, {"label":"U", "x":10.1667, "y":3}, {"label":"I", "x":11.1667, "y":3}, {"label":"O", "x":12.1667, "y":3}, {"label":"P", "x":13.1667, "y":3}, {"label":"{", "x":14.1667, "y":3}, {"label":"}", "x":15.1667, "y":3}, {"label":"|", "x":16.1667, "y":3, "w":1.5}, {"label":"Delete", "x":18.1667, "y":3}, {"label":"End", "x":19.1667, "y":3}, {"label":"PgDn", "x":20.1667, "y":3}, {"label":"7", "x":21.6667, "y":3}, {"label":"8", "x":22.6667, "y":3}, {"label":"9", "x":23.6667, "y":3}, {"label":"+", "x":24.6667, "y":3}, + {"label":"P5", "x":0, "y":4}, {"label":"P6", "x":1, "y":4}, {"label":"Caps Lock", "x":2.6667, "y":4, "w":1.75}, {"label":"A", "x":4.4167, "y":4}, {"label":"S", "x":5.4167, "y":4}, {"label":"D", "x":6.4167, "y":4}, {"label":"F", "x":7.4167, "y":4}, {"label":"G", "x":8.4167, "y":4}, {"label":"H", "x":9.4167, "y":4}, {"label":"J", "x":10.4167, "y":4}, {"label":"K", "x":11.4167, "y":4}, {"label":"L", "x":12.4167, "y":4}, {"label":":", "x":13.4167, "y":4}, {"label":"\"", "x":14.4167, "y":4}, {"label":"~", "x":15.4167, "y":4}, {"label":"Enter", "x":16.4167, "y":4, "w":1.25}, {"x":18.1667, "y":4}, {"x":19.1667, "y":4}, {"x":20.1667, "y":4}, {"label":"4", "x":21.6667, "y":4}, {"label":"5", "x":22.6667, "y":4}, {"label":"6", "x":23.6667, "y":4}, {"label":"=", "x":24.6667, "y":4}, + {"label":"P7", "x":0, "y":5}, {"label":"P8", "x":1, "y":5}, {"label":"Shift", "x":2.6667, "y":5, "w":1.25}, {"label":"|", "x":3.9167, "y":5}, {"label":"Z", "x":4.9167, "y":5}, {"label":"X", "x":5.9167, "y":5}, {"label":"C", "x":6.9167, "y":5}, {"label":"V", "x":7.9167, "y":5}, {"label":"B", "x":8.9167, "y":5}, {"label":"N", "x":9.9167, "y":5}, {"label":"M", "x":10.9167, "y":5}, {"label":"<", "x":11.9167, "y":5}, {"label":">", "x":12.9167, "y":5}, {"label":"?", "x":13.9167, "y":5}, {"label":"Shift", "x":14.9167, "y":5, "w":1.75}, {"label":"|", "x":16.6667, "y":5}, {"x":18.1667, "y":5}, {"label":"\u2191", "x":19.1667, "y":5}, {"x":20.1667, "y":5}, {"label":"1", "x":21.6667, "y":5}, {"label":"2", "x":22.6667, "y":5}, {"label":"3", "x":23.6667, "y":5}, {"label":"Enter", "x":24.6667, "y":5, "h":2}, + {"label":"P9", "x":0, "y":6}, {"label":"P10", "x":1, "y":6}, {"label":"Ctrl", "x":2.6667, "y":6, "w":1.25}, {"label":"Win", "x":3.9167, "y":6, "w":1.25}, {"label":"Alt", "x":5.1667, "y":6, "w":1.25}, {"x":6.4167, "y":6, "w":6.25}, {"label":"Alt Gr", "x":12.6667, "y":6, "w":1.25}, {"label":"Win", "x":13.9167, "y":6, "w":1.25}, {"label":"Compose", "x":15.1667, "y":6, "w":1.25}, {"label":"Ctrl", "x":16.4167, "y":6, "w":1.25}, {"label":"\u2190", "x":18.1667, "y":6}, {"label":"\u2193", "x":19.1667, "y":6}, {"label":"\u2192", "x":20.1667, "y":6}, {"label":"0", "x":21.6667, "y":6, "w":2}, {"label":".", "x":23.6667, "y":6}] + }, + "LAYOUT_101": { + "layout": [ {"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, {"x":4, "y":5.5, "w":7}, {"label":"Alt", "x":11, "y":5.5, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] + }, + "LAYOUT_ultra_t": { + "layout": [ {"label":"P11", "x":0, "y":0}, {"label":"P12", "x":1, "y":0}, {"label":"Esc", "x":2.6667, "y":0}, {"label":"F1", "x":4.6667, "y":0}, {"label":"F2", "x":5.6667, "y":0}, {"label":"F3", "x":6.6667, "y":0}, {"label":"F4", "x":7.6667, "y":0}, {"label":"F5", "x":9.1667, "y":0}, {"label":"F6", "x":10.1667, "y":0}, {"label":"F7", "x":11.1667, "y":0}, {"label":"F8", "x":12.1667, "y":0}, {"label":"F9", "x":13.6667, "y":0}, {"label":"F10", "x":14.6667, "y":0}, {"label":"F11", "x":15.6667, "y":0}, {"label":"F12", "x":16.6667, "y":0}, {"label":"PrtSc", "x":18.1667, "y":0}, {"label":"Scroll Lock", "x":19.1667, "y":0}, {"label":"Pause", "x":20.1667, "y":0}, + {"label":"P1", "x":0, "y":2}, {"label":"P2", "x":1, "y":2}, {"label":"~", "x":2.6667, "y":2}, {"label":"!", "x":3.6667, "y":2}, {"label":"@", "x":4.6667, "y":2}, {"label":"#", "x":5.6667, "y":2}, {"label":"$", "x":6.6667, "y":2}, {"label":"%", "x":7.6667, "y":2}, {"label":"^", "x":8.6667, "y":2}, {"label":"&", "x":9.6667, "y":2}, {"label":"*", "x":10.6667, "y":2}, {"label":"(", "x":11.6667, "y":2}, {"label":")", "x":12.6667, "y":2}, {"label":"_", "x":13.6667, "y":2}, {"label":"+", "x":14.6667, "y":2}, {"label":"Back Space", "x":15.6667, "y":2, "w":2}, {"label":"Insert", "x":18.1667, "y":2}, {"label":"Home", "x":19.1667, "y":2}, {"label":"PgUp", "x":20.1667, "y":2}, {"label":"Num Lock", "x":21.6667, "y":2}, {"label":"/", "x":22.6667, "y":2}, {"label":"*", "x":23.6667, "y":2}, {"label":"-", "x":24.6667, "y":2}, + {"label":"P3", "x":0, "y":3}, {"label":"P4", "x":1, "y":3}, {"label":"Tab", "x":2.6667, "y":3, "w":1.5}, {"label":"Q", "x":4.1667, "y":3}, {"label":"W", "x":5.1667, "y":3}, {"label":"E", "x":6.1667, "y":3}, {"label":"R", "x":7.1667, "y":3}, {"label":"T", "x":8.1667, "y":3}, {"label":"Y", "x":9.1667, "y":3}, {"label":"U", "x":10.1667, "y":3}, {"label":"I", "x":11.1667, "y":3}, {"label":"O", "x":12.1667, "y":3}, {"label":"P", "x":13.1667, "y":3}, {"label":"{", "x":14.1667, "y":3}, {"label":"}", "x":15.1667, "y":3}, {"label":"Enter", "x":16.1667, "y":3, "w":1.5, "h":2}, {"label":"Delete", "x":18.1667, "y":3}, {"label":"End", "x":19.1667, "y":3}, {"label":"PgDn", "x":20.1667, "y":3}, {"label":"7", "x":21.6667, "y":3}, {"label":"8", "x":22.6667, "y":3}, {"label":"9", "x":23.6667, "y":3}, {"label":"+", "x":24.6667, "y":3}, + {"label":"P5", "x":0, "y":4}, {"label":"P6", "x":1, "y":4}, {"label":"Caps Lock", "x":2.6667, "y":4, "w":1.75}, {"label":"A", "x":4.4167, "y":4}, {"label":"S", "x":5.4167, "y":4}, {"label":"D", "x":6.4167, "y":4}, {"label":"F", "x":7.4167, "y":4}, {"label":"G", "x":8.4167, "y":4}, {"label":"H", "x":9.4167, "y":4}, {"label":"J", "x":10.4167, "y":4}, {"label":"K", "x":11.4167, "y":4}, {"label":"L", "x":12.4167, "y":4}, {"label":":", "x":13.4167, "y":4}, {"label":"\"", "x":14.4167, "y":4}, {"label":"4", "x":21.6667, "y":4}, {"label":"5", "x":22.6667, "y":4}, {"label":"6", "x":23.6667, "y":4}, {"label":"=", "x":24.6667, "y":4}, + {"label":"P7", "x":0, "y":5}, {"label":"P8", "x":1, "y":5}, {"label":"Shift", "x":2.6667, "y":5, "w":2.25}, {"label":"Z", "x":4.9167, "y":5}, {"label":"X", "x":5.9167, "y":5}, {"label":"C", "x":6.9167, "y":5}, {"label":"V", "x":7.9167, "y":5}, {"label":"B", "x":8.9167, "y":5}, {"label":"N", "x":9.9167, "y":5}, {"label":"M", "x":10.9167, "y":5}, {"label":"<", "x":11.9167, "y":5}, {"label":">", "x":12.9167, "y":5}, {"label":"?", "x":13.9167, "y":5}, {"label":"Shift", "x":14.9167, "y":5, "w":1.75}, {"label":"|", "x":16.6667, "y":5}, {"label":"\u2191", "x":19.1667, "y":5}, {"label":"1", "x":21.6667, "y":5}, {"label":"2", "x":22.6667, "y":5}, {"label":"3", "x":23.6667, "y":5}, {"label":"Enter", "x":24.6667, "y":5, "h":2}, + {"label":"P9", "x":0, "y":6}, {"label":"P10", "x":1, "y":6}, {"label":"Ctrl", "x":2.6667, "y":6, "w":1.5}, {"label":"Win", "x":4.1667, "y":6}, {"label":"Alt", "x":5.1667, "y":6, "w":1.5}, {"x":6.6667, "y":6, "w":7}, {"label":"Alt Gr", "x":13.6667, "y":6, "w":1.5}, {"label":"*", "x":15.1667, "y":6}, {"label":"Ctrl", "x":16.1667, "y":6, "w":1.5}, {"label":"\u2190", "x":18.1667, "y":6}, {"label":"\u2193", "x":19.1667, "y":6}, {"label":"\u2192", "x":20.1667, "y":6}, {"label":"0", "x":21.6667, "y":6, "w":2}, {"label":".", "x":23.6667, "y":6}] + + + }, + "LAYOUT_ultra_rev1": { + "layout": [ {"label":"P11", "x":0, "y":0}, {"label":"P12", "x":1, "y":0}, {"label":"F1", "x":2.6667, "y":0}, {"label":"F2", "x":3.6667, "y":0}, {"label":"F3", "x":4.6667, "y":0}, {"label":"F4", "x":5.6667, "y":0}, {"label":"F5", "x":8.1667, "y":0}, {"label":"F6", "x":9.1667, "y":0}, {"label":"F7", "x":10.1667, "y":0}, {"label":"F8", "x":11.1667, "y":0}, {"label":"F9", "x":13.6667, "y":0}, {"label":"F10", "x":14.6667, "y":0}, {"label":"F11", "x":15.6667, "y":0}, {"label":"F12", "x":16.6667, "y":0}, {"label":"PrtSc", "x":18.1667, "y":0}, {"label":"Scroll Lock", "x":19.1667, "y":0}, {"label":"Pause", "x":20.1667, "y":0}, + {"label":"P1", "x":0, "y":2}, {"label":"P2", "x":1, "y":2}, {"label":"Esc", "x":2.6667, "y":2}, {"label":"!", "x":3.6667, "y":2}, {"label":"@", "x":4.6667, "y":2}, {"label":"#", "x":5.6667, "y":2}, {"label":"$", "x":6.6667, "y":2}, {"label":"%", "x":7.6667, "y":2}, {"label":"^", "x":8.6667, "y":2}, {"label":"&", "x":9.6667, "y":2}, {"label":"*", "x":10.6667, "y":2}, {"label":"(", "x":11.6667, "y":2}, {"label":")", "x":12.6667, "y":2}, {"label":"_", "x":13.6667, "y":2}, {"label":"+", "x":14.6667, "y":2}, {"label":"Back Space", "x":15.6667, "y":2, "w":2}, {"label":"Insert", "x":18.1667, "y":2}, {"label":"Home", "x":19.1667, "y":2}, {"label":"PgUp", "x":20.1667, "y":2}, {"label":"Num Lock", "x":21.6667, "y":2}, {"label":"/", "x":22.6667, "y":2}, {"label":"*", "x":23.6667, "y":2}, {"label":"-", "x":24.6667, "y":2}, + {"label":"P3", "x":0, "y":3}, {"label":"P4", "x":1, "y":3}, {"label":"Tab", "x":2.6667, "y":3, "w":1.5}, {"label":"Q", "x":4.1667, "y":3}, {"label":"W", "x":5.1667, "y":3}, {"label":"E", "x":6.1667, "y":3}, {"label":"R", "x":7.1667, "y":3}, {"label":"T", "x":8.1667, "y":3}, {"label":"Y", "x":9.1667, "y":3}, {"label":"U", "x":10.1667, "y":3}, {"label":"I", "x":11.1667, "y":3}, {"label":"O", "x":12.1667, "y":3}, {"label":"P", "x":13.1667, "y":3}, {"label":"{", "x":14.1667, "y":3}, {"label":"}", "x":15.1667, "y":3}, {"label":"Enter", "x":16.1667, "y":3, "w":1.5, "h":2}, {"label":"Delete", "x":18.1667, "y":3}, {"label":"End", "x":19.1667, "y":3}, {"label":"PgDn", "x":20.1667, "y":3}, {"label":"7", "x":21.6667, "y":3}, {"label":"8", "x":22.6667, "y":3}, {"label":"9", "x":23.6667, "y":3}, {"label":"+", "x":24.6667, "y":3}, + {"label":"P5", "x":0, "y":4}, {"label":"P6", "x":1, "y":4}, {"label":"Caps Lock", "x":2.6667, "y":4, "w":1.75}, {"label":"A", "x":4.4167, "y":4}, {"label":"S", "x":5.4167, "y":4}, {"label":"D", "x":6.4167, "y":4}, {"label":"F", "x":7.4167, "y":4}, {"label":"G", "x":8.4167, "y":4}, {"label":"H", "x":9.4167, "y":4}, {"label":"J", "x":10.4167, "y":4}, {"label":"K", "x":11.4167, "y":4}, {"label":"L", "x":12.4167, "y":4}, {"label":":", "x":13.4167, "y":4}, {"label":"\"", "x":14.4167, "y":4}, {"x":18.1667, "y":4}, {"label":"\u2191", "x":19.1667, "y":4}, {"x":20.1667, "y":4}, {"label":"4", "x":21.6667, "y":4}, {"label":"5", "x":22.6667, "y":4}, {"label":"6", "x":23.6667, "y":4}, {"label":"=", "x":24.6667, "y":4}, + {"label":"P7", "x":0, "y":5}, {"label":"P8", "x":1, "y":5}, {"label":"Shift", "x":2.6667, "y":5, "w":2.25}, {"label":"Z", "x":4.9167, "y":5}, {"label":"X", "x":5.9167, "y":5}, {"label":"C", "x":6.9167, "y":5}, {"label":"V", "x":7.9167, "y":5}, {"label":"B", "x":8.9167, "y":5}, {"label":"N", "x":9.9167, "y":5}, {"label":"M", "x":10.9167, "y":5}, {"label":"<", "x":11.9167, "y":5}, {"label":">", "x":12.9167, "y":5}, {"label":"?", "x":13.9167, "y":5}, {"label":"Shift", "x":14.9167, "y":5, "w":1.75}, {"label":"|", "x":16.6667, "y":5}, {"label":"\u2190", "x":18.1667, "y":5}, {"label":"\u2193", "x":19.1667, "y":5}, {"label":"\u2192", "x":20.1667, "y":5}, {"label":"1", "x":21.6667, "y":5}, {"label":"2", "x":22.6667, "y":5}, {"label":"3", "x":23.6667, "y":5}, {"label":"Enter", "x":24.6667, "y":5, "h":2}, + {"label":"P9", "x":0, "y":6}, {"label":"P10", "x":1, "y":6}, {"label":"Ctrl", "x":2.6667, "y":6, "w":1.5}, {"label":"Win", "x":4.1667, "y":6}, {"label":"Alt", "x":5.1667, "y":6, "w":1.5}, {"x":6.6667, "y":6, "w":7}, {"label":"Alt Gr", "x":13.6667, "y":6, "w":1.5}, {"label":"~", "x":15.1667, "y":6}, {"label":"Ctrl", "x":16.1667, "y":6, "w":1.5}, {"label":"Insert", "x":18.1667, "y":6, "w":1.5}, {"label":"Delete", "x":19.6667, "y":6, "w":1.5}, {"label":"0", "x":21.6667, "y":6, "w":2}, {"label":".", "x":23.6667, "y":6}] + }, + "LAYOUT_ultra_rev3": { + "layout": [ {"label":"P11", "x":0, "y":0}, {"label":"P12", "x":1, "y":0}, {"label":"Esc", "x":2.6667, "y":0}, {"label":"F1", "x":4.6667, "y":0}, {"label":"F2", "x":5.6667, "y":0}, {"label":"F3", "x":6.6667, "y":0}, {"label":"F4", "x":7.6667, "y":0}, {"label":"F5", "x":9.1667, "y":0}, {"label":"F6", "x":10.1667, "y":0}, {"label":"F7", "x":11.1667, "y":0}, {"label":"F8", "x":12.1667, "y":0}, {"label":"F9", "x":13.6667, "y":0}, {"label":"F10", "x":14.6667, "y":0}, {"label":"F11", "x":15.6667, "y":0}, {"label":"F12", "x":16.6667, "y":0}, {"label":"PrtSc", "x":18.1667, "y":0}, {"label":"Scroll Lock", "x":19.1667, "y":0}, {"label":"Pause", "x":20.1667, "y":0}, + {"label":"P1", "x":0, "y":2}, {"label":"P2", "x":1, "y":2}, {"label":"~", "x":2.6667, "y":2}, {"label":"!", "x":3.6667, "y":2}, {"label":"@", "x":4.6667, "y":2}, {"label":"#", "x":5.6667, "y":2}, {"label":"$", "x":6.6667, "y":2}, {"label":"%", "x":7.6667, "y":2}, {"label":"^", "x":8.6667, "y":2}, {"label":"&", "x":9.6667, "y":2}, {"label":"*", "x":10.6667, "y":2}, {"label":"(", "x":11.6667, "y":2}, {"label":")", "x":12.6667, "y":2}, {"label":"_", "x":13.6667, "y":2}, {"label":"+", "x":14.6667, "y":2}, {"label":"Back Space", "x":15.6667, "y":2, "w":2}, {"label":"Insert", "x":18.1667, "y":2}, {"label":"Home", "x":19.1667, "y":2}, {"label":"PgUp", "x":20.1667, "y":2}, {"label":"Num Lock", "x":21.6667, "y":2}, {"label":"/", "x":22.6667, "y":2}, {"label":"*", "x":23.6667, "y":2}, {"label":"-", "x":24.6667, "y":2}, + {"label":"P3", "x":0, "y":3}, {"label":"P4", "x":1, "y":3}, {"label":"Tab", "x":2.6667, "y":3, "w":1.5}, {"label":"Q", "x":4.1667, "y":3}, {"label":"W", "x":5.1667, "y":3}, {"label":"E", "x":6.1667, "y":3}, {"label":"R", "x":7.1667, "y":3}, {"label":"T", "x":8.1667, "y":3}, {"label":"Y", "x":9.1667, "y":3}, {"label":"U", "x":10.1667, "y":3}, {"label":"I", "x":11.1667, "y":3}, {"label":"O", "x":12.1667, "y":3}, {"label":"P", "x":13.1667, "y":3}, {"label":"{", "x":14.1667, "y":3}, {"label":"}", "x":15.1667, "y":3}, {"label":"Enter", "x":16.1667, "y":3, "w":1.5, "h":2}, {"label":"Delete", "x":18.1667, "y":3}, {"label":"End", "x":19.1667, "y":3}, {"label":"PgDn", "x":20.1667, "y":3}, {"label":"7", "x":21.6667, "y":3}, {"label":"8", "x":22.6667, "y":3}, {"label":"9", "x":23.6667, "y":3}, {"label":"+", "x":24.6667, "y":3}, + {"label":"P5", "x":0, "y":4}, {"label":"P6", "x":1, "y":4}, {"label":"Caps Lock", "x":2.6667, "y":4, "w":1.75}, {"label":"A", "x":4.4167, "y":4}, {"label":"S", "x":5.4167, "y":4}, {"label":"D", "x":6.4167, "y":4}, {"label":"F", "x":7.4167, "y":4}, {"label":"G", "x":8.4167, "y":4}, {"label":"H", "x":9.4167, "y":4}, {"label":"J", "x":10.4167, "y":4}, {"label":"K", "x":11.4167, "y":4}, {"label":"L", "x":12.4167, "y":4}, {"label":":", "x":13.4167, "y":4}, {"label":"\"", "x":14.4167, "y":4}, {"x":18.1667, "y":4}, {"label":"\u2191", "x":19.1667, "y":4}, {"x":20.1667, "y":4}, {"label":"4", "x":21.6667, "y":4}, {"label":"5", "x":22.6667, "y":4}, {"label":"6", "x":23.6667, "y":4}, {"label":"=", "x":24.6667, "y":4}, + {"label":"P7", "x":0, "y":5}, {"label":"P8", "x":1, "y":5}, {"label":"Shift", "x":2.6667, "y":5, "w":2.25}, {"label":"Z", "x":4.9167, "y":5}, {"label":"X", "x":5.9167, "y":5}, {"label":"C", "x":6.9167, "y":5}, {"label":"V", "x":7.9167, "y":5}, {"label":"B", "x":8.9167, "y":5}, {"label":"N", "x":9.9167, "y":5}, {"label":"M", "x":10.9167, "y":5}, {"label":"<", "x":11.9167, "y":5}, {"label":">", "x":12.9167, "y":5}, {"label":"?", "x":13.9167, "y":5}, {"label":"Shift", "x":14.9167, "y":5, "w":1.75}, {"label":"|", "x":16.6667, "y":5}, {"label":"\u2190", "x":18.1667, "y":5}, {"label":"\u2193", "x":19.1667, "y":5}, {"label":"\u2192", "x":20.1667, "y":5}, {"label":"1", "x":21.6667, "y":5}, {"label":"2", "x":22.6667, "y":5}, {"label":"3", "x":23.6667, "y":5}, {"label":"Enter", "x":24.6667, "y":5, "h":2}, + {"label":"P9", "x":0, "y":6}, {"label":"P10", "x":1, "y":6}, {"label":"Ctrl", "x":2.6667, "y":6, "w":1.5}, {"label":"Win", "x":4.1667, "y":6}, {"label":"Alt", "x":5.1667, "y":6, "w":1.5}, {"x":6.6667, "y":6, "w":7}, {"label":"Alt Gr", "x":13.6667, "y":6, "w":1.5}, {"label":"Compose", "x":15.1667, "y":6}, {"label":"Ctrl", "x":16.1667, "y":6, "w":1.5}, {"label":"Insert", "x":18.1667, "y":6, "w":1.5}, {"label":"Delete", "x":19.6667, "y":6, "w":1.5}, {"label":"0", "x":21.6667, "y":6, "w":2}, {"label":".", "x":23.6667, "y":6}] + }, + "LAYOUT_plus_rev3": { + "layout": [ {"label":"F11", "x":0, "y":0}, {"label":"F12", "x":1, "y":0}, {"label":"Esc", "x":2.6667, "y":0}, {"label":"PrtSc", "x":18.1667, "y":0}, {"label":"Scroll Lock", "x":19.1667, "y":0}, {"label":"Pause", "x":20.1667, "y":0}, + {"label":"F1", "x":0, "y":2}, {"label":"F2", "x":1, "y":2}, {"label":"~", "x":2.6667, "y":2}, {"label":"!", "x":3.6667, "y":2}, {"label":"@", "x":4.6667, "y":2}, {"label":"#", "x":5.6667, "y":2}, {"label":"$", "x":6.6667, "y":2}, {"label":"%", "x":7.6667, "y":2}, {"label":"^", "x":8.6667, "y":2}, {"label":"&", "x":9.6667, "y":2}, {"label":"*", "x":10.6667, "y":2}, {"label":"(", "x":11.6667, "y":2}, {"label":")", "x":12.6667, "y":2}, {"label":"_", "x":13.6667, "y":2}, {"label":"+", "x":14.6667, "y":2}, {"label":"Back Space", "x":15.6667, "y":2, "w":2}, {"label":"Insert", "x":18.1667, "y":2}, {"label":"Home", "x":19.1667, "y":2}, {"label":"PgUp", "x":20.1667, "y":2}, {"label":"Num Lock", "x":21.6667, "y":2}, {"label":"/", "x":22.6667, "y":2}, {"label":"*", "x":23.6667, "y":2}, {"label":"-", "x":24.6667, "y":2}, + {"label":"F3", "x":0, "y":3}, {"label":"F4", "x":1, "y":3}, {"label":"Tab", "x":2.6667, "y":3, "w":1.5}, {"label":"Q", "x":4.1667, "y":3}, {"label":"W", "x":5.1667, "y":3}, {"label":"E", "x":6.1667, "y":3}, {"label":"R", "x":7.1667, "y":3}, {"label":"T", "x":8.1667, "y":3}, {"label":"Y", "x":9.1667, "y":3}, {"label":"U", "x":10.1667, "y":3}, {"label":"I", "x":11.1667, "y":3}, {"label":"O", "x":12.1667, "y":3}, {"label":"P", "x":13.1667, "y":3}, {"label":"{", "x":14.1667, "y":3}, {"label":"}", "x":15.1667, "y":3}, {"label":"Enter", "x":16.1667, "y":3, "w":1.5, "h":2}, {"label":"Delete", "x":18.1667, "y":3}, {"label":"End", "x":19.1667, "y":3}, {"label":"PgDn", "x":20.1667, "y":3}, {"label":"7", "x":21.6667, "y":3}, {"label":"8", "x":22.6667, "y":3}, {"label":"9", "x":23.6667, "y":3}, {"label":"+", "x":24.6667, "y":3}, + {"label":"F5", "x":0, "y":4}, {"label":"F6", "x":1, "y":4}, {"label":"Caps Lock", "x":2.6667, "y":4, "w":1.75}, {"label":"A", "x":4.4167, "y":4}, {"label":"S", "x":5.4167, "y":4}, {"label":"D", "x":6.4167, "y":4}, {"label":"F", "x":7.4167, "y":4}, {"label":"G", "x":8.4167, "y":4}, {"label":"H", "x":9.4167, "y":4}, {"label":"J", "x":10.4167, "y":4}, {"label":"K", "x":11.4167, "y":4}, {"label":"L", "x":12.4167, "y":4}, {"label":":", "x":13.4167, "y":4}, {"label":"\"", "x":14.4167, "y":4}, {"x":18.1667, "y":4}, {"label":"\u2191", "x":19.1667, "y":4}, {"x":20.1667, "y":4}, {"label":"4", "x":21.6667, "y":4}, {"label":"5", "x":22.6667, "y":4}, {"label":"6", "x":23.6667, "y":4}, {"label":"=", "x":24.6667, "y":4}, + {"label":"F7", "x":0, "y":5}, {"label":"F8", "x":1, "y":5}, {"label":"Shift", "x":2.6667, "y":5, "w":2.25}, {"label":"Z", "x":4.9167, "y":5}, {"label":"X", "x":5.9167, "y":5}, {"label":"C", "x":6.9167, "y":5}, {"label":"V", "x":7.9167, "y":5}, {"label":"B", "x":8.9167, "y":5}, {"label":"N", "x":9.9167, "y":5}, {"label":"M", "x":10.9167, "y":5}, {"label":"<", "x":11.9167, "y":5}, {"label":">", "x":12.9167, "y":5}, {"label":"?", "x":13.9167, "y":5}, {"label":"Shift", "x":14.9167, "y":5, "w":1.75}, {"label":"|", "x":16.6667, "y":5}, {"label":"\u2190", "x":18.1667, "y":5}, {"label":"\u2193", "x":19.1667, "y":5}, {"label":"\u2192", "x":20.1667, "y":5}, {"label":"1", "x":21.6667, "y":5}, {"label":"2", "x":22.6667, "y":5}, {"label":"3", "x":23.6667, "y":5}, {"label":"Enter", "x":24.6667, "y":5, "h":2}, + {"label":"F9", "x":0, "y":6}, {"label":"F10", "x":1, "y":6}, {"label":"Ctrl", "x":2.6667, "y":6, "w":1.5}, {"label":"Win", "x":4.1667, "y":6}, {"label":"Alt", "x":5.1667, "y":6, "w":1.5}, {"x":6.6667, "y":6, "w":7}, {"label":"Alt Gr", "x":13.6667, "y":6, "w":1.5}, {"label":"Compose", "x":15.1667, "y":6}, {"label":"Ctrl", "x":16.1667, "y":6, "w":1.5}, {"label":"Insert", "x":18.1667, "y":6, "w":1.5}, {"label":"Delete", "x":19.6667, "y":6, "w":1.5}, {"label":"0", "x":21.6667, "y":6, "w":2}, {"label":".", "x":23.6667, "y":6}] + }, + "LAYOUT_plus_rev1": { + "layout": [ {"label":"F11", "x":0, "y":0}, {"label":"F12", "x":1, "y":0}, {"label":"PrtSc", "x":18.1667, "y":0}, {"label":"Scroll Lock", "x":19.1667, "y":0}, {"label":"Pause", "x":20.1667, "y":0}, + {"label":"F1", "x":0, "y":2}, {"label":"F2", "x":1, "y":2}, {"label":"Esc", "x":2.6667, "y":2}, {"label":"!", "x":3.6667, "y":2}, {"label":"@", "x":4.6667, "y":2}, {"label":"#", "x":5.6667, "y":2}, {"label":"$", "x":6.6667, "y":2}, {"label":"%", "x":7.6667, "y":2}, {"label":"^", "x":8.6667, "y":2}, {"label":"&", "x":9.6667, "y":2}, {"label":"*", "x":10.6667, "y":2}, {"label":"(", "x":11.6667, "y":2}, {"label":")", "x":12.6667, "y":2}, {"label":"_", "x":13.6667, "y":2}, {"label":"+", "x":14.6667, "y":2}, {"label":"Back Space", "x":15.6667, "y":2, "w":2}, {"label":"Insert", "x":18.1667, "y":2}, {"label":"Home", "x":19.1667, "y":2}, {"label":"PgUp", "x":20.1667, "y":2}, {"label":"Num Lock", "x":21.6667, "y":2}, {"label":"/", "x":22.6667, "y":2}, {"label":"*", "x":23.6667, "y":2}, {"label":"-", "x":24.6667, "y":2}, + {"label":"F3", "x":0, "y":3}, {"label":"F4", "x":1, "y":3}, {"label":"Tab", "x":2.6667, "y":3, "w":1.5}, {"label":"Q", "x":4.1667, "y":3}, {"label":"W", "x":5.1667, "y":3}, {"label":"E", "x":6.1667, "y":3}, {"label":"R", "x":7.1667, "y":3}, {"label":"T", "x":8.1667, "y":3}, {"label":"Y", "x":9.1667, "y":3}, {"label":"U", "x":10.1667, "y":3}, {"label":"I", "x":11.1667, "y":3}, {"label":"O", "x":12.1667, "y":3}, {"label":"P", "x":13.1667, "y":3}, {"label":"{", "x":14.1667, "y":3}, {"label":"}", "x":15.1667, "y":3}, {"label":"Enter", "x":16.1667, "y":3, "w":1.5, "h":2}, {"label":"Delete", "x":18.1667, "y":3}, {"label":"End", "x":19.1667, "y":3}, {"label":"PgDn", "x":20.1667, "y":3}, {"label":"7", "x":21.6667, "y":3}, {"label":"8", "x":22.6667, "y":3}, {"label":"9", "x":23.6667, "y":3}, {"label":"+", "x":24.6667, "y":3}, + {"label":"F5", "x":0, "y":4}, {"label":"F6", "x":1, "y":4}, {"label":"Caps Lock", "x":2.6667, "y":4, "w":1.75}, {"label":"A", "x":4.4167, "y":4}, {"label":"S", "x":5.4167, "y":4}, {"label":"D", "x":6.4167, "y":4}, {"label":"F", "x":7.4167, "y":4}, {"label":"G", "x":8.4167, "y":4}, {"label":"H", "x":9.4167, "y":4}, {"label":"J", "x":10.4167, "y":4}, {"label":"K", "x":11.4167, "y":4}, {"label":"L", "x":12.4167, "y":4}, {"label":":", "x":13.4167, "y":4}, {"label":"\"", "x":14.4167, "y":4}, {"x":18.1667, "y":4}, {"label":"\u2191", "x":19.1667, "y":4}, {"x":20.1667, "y":4}, {"label":"4", "x":21.6667, "y":4}, {"label":"5", "x":22.6667, "y":4}, {"label":"6", "x":23.6667, "y":4}, {"label":"=", "x":24.6667, "y":4}, + {"label":"F7", "x":0, "y":5}, {"label":"F8", "x":1, "y":5}, {"label":"Shift", "x":2.6667, "y":5, "w":2.25}, {"label":"Z", "x":4.9167, "y":5}, {"label":"X", "x":5.9167, "y":5}, {"label":"C", "x":6.9167, "y":5}, {"label":"V", "x":7.9167, "y":5}, {"label":"B", "x":8.9167, "y":5}, {"label":"N", "x":9.9167, "y":5}, {"label":"M", "x":10.9167, "y":5}, {"label":"<", "x":11.9167, "y":5}, {"label":">", "x":12.9167, "y":5}, {"label":"?", "x":13.9167, "y":5}, {"label":"Shift", "x":14.9167, "y":5, "w":1.75}, {"label":"|", "x":16.6667, "y":5}, {"label":"\u2190", "x":18.1667, "y":5}, {"label":"\u2193", "x":19.1667, "y":5}, {"label":"\u2192", "x":20.1667, "y":5}, {"label":"1", "x":21.6667, "y":5}, {"label":"2", "x":22.6667, "y":5}, {"label":"3", "x":23.6667, "y":5}, {"label":"Enter", "x":24.6667, "y":5, "h":2}, + {"label":"F9", "x":0, "y":6}, {"label":"F10", "x":1, "y":6}, {"label":"Ctrl", "x":2.6667, "y":6, "w":1.5}, {"label":"Win", "x":4.1667, "y":6}, {"label":"Alt", "x":5.1667, "y":6, "w":1.5}, {"x":6.6667, "y":6, "w":7}, {"label":"Alt Gr", "x":13.6667, "y":6, "w":1.5}, {"label":"~", "x":15.1667, "y":6}, {"label":"Ctrl", "x":16.1667, "y":6, "w":1.5}, {"label":"Insert", "x":18.1667, "y":6, "w":1.5}, {"label":"Delete", "x":19.6667, "y":6, "w":1.5}, {"label":"0", "x":21.6667, "y":6, "w":2}, {"label":".", "x":23.6667, "y":6}] + }, + "LAYOUT_102_rev1": { + "layout": [ {"label":"F11", "x":0, "y":0}, {"label":"F12", "x":1, "y":0}, {"label":"PrtSc", "x":18.1667, "y":0}, {"label":"Scroll Lock", "x":19.1667, "y":0}, {"label":"Pause", "x":20.1667, "y":0}, + {"label":"F1", "x":0, "y":2}, {"label":"F2", "x":1, "y":2},{"label":"Esc", "x":2.6667, "y":2}, {"label":"!", "x":3.6667, "y":2}, {"label":"@", "x":4.6667, "y":2}, {"label":"#", "x":5.6667, "y":2}, {"label":"$", "x":6.6667, "y":2}, {"label":"%", "x":7.6667, "y":2}, {"label":"^", "x":8.6667, "y":2}, {"label":"&", "x":9.6667, "y":2}, {"label":"*", "x":10.6667, "y":2}, {"label":"(", "x":11.6667, "y":2}, {"label":")", "x":12.6667, "y":2}, {"label":"_", "x":13.6667, "y":2}, {"label":"+", "x":14.6667, "y":2}, {"label":"Back Space", "x":15.6667, "y":2, "w":2}, {"label":"Insert", "x":18.1667, "y":2}, {"label":"Home", "x":19.1667, "y":2}, {"label":"PgUp", "x":20.1667, "y":2}, {"label":"Num Lock", "x":21.6667, "y":2}, {"label":"/", "x":22.6667, "y":2}, {"label":"*", "x":23.6667, "y":2}, {"label":"-", "x":24.6667, "y":2}, + {"label":"F3", "x":0, "y":3}, {"label":"F4", "x":1, "y":3}, {"label":"Tab", "x":2.6667, "y":3, "w":1.5}, {"label":"Q", "x":4.1667, "y":3}, {"label":"W", "x":5.1667, "y":3}, {"label":"E", "x":6.1667, "y":3}, {"label":"R", "x":7.1667, "y":3}, {"label":"T", "x":8.1667, "y":3}, {"label":"Y", "x":9.1667, "y":3}, {"label":"U", "x":10.1667, "y":3}, {"label":"I", "x":11.1667, "y":3}, {"label":"O", "x":12.1667, "y":3}, {"label":"P", "x":13.1667, "y":3}, {"label":"{", "x":14.1667, "y":3}, {"label":"}", "x":15.1667, "y":3}, {"label":"Enter", "x":16.1667, "y":3, "w":1.5, "h":2}, {"label":"Delete", "x":18.1667, "y":3}, {"label":"End", "x":19.1667, "y":3}, {"label":"PgDn", "x":20.1667, "y":3}, {"label":"7", "x":21.6667, "y":3}, {"label":"8", "x":22.6667, "y":3}, {"label":"9", "x":23.6667, "y":3}, {"label":"+", "x":24.6667, "y":3}, + {"label":"F5", "x":0, "y":4}, {"label":"F6", "x":1, "y":4}, {"label":"Caps Lock", "x":2.6667, "y":4, "w":1.75}, {"label":"A", "x":4.4167, "y":4}, {"label":"S", "x":5.4167, "y":4}, {"label":"D", "x":6.4167, "y":4}, {"label":"F", "x":7.4167, "y":4}, {"label":"G", "x":8.4167, "y":4}, {"label":"H", "x":9.4167, "y":4}, {"label":"J", "x":10.4167, "y":4}, {"label":"K", "x":11.4167, "y":4}, {"label":"L", "x":12.4167, "y":4}, {"label":":", "x":13.4167, "y":4}, {"label":"\"", "x":14.4167, "y":4}, {"label":"4", "x":21.6667, "y":4}, {"label":"5", "x":22.6667, "y":4}, {"label":"6", "x":23.6667, "y":4}, {"label":"=", "x":24.6667, "y":4}, + {"label":"F7", "x":0, "y":5}, {"label":"F8", "x":1, "y":5}, {"label":"Shift", "x":2.6667, "y":5, "w":2.25}, {"label":"Z", "x":4.9167, "y":5}, {"label":"X", "x":5.9167, "y":5}, {"label":"C", "x":6.9167, "y":5}, {"label":"V", "x":7.9167, "y":5}, {"label":"B", "x":8.9167, "y":5}, {"label":"N", "x":9.9167, "y":5}, {"label":"M", "x":10.9167, "y":5}, {"label":"<", "x":11.9167, "y":5}, {"label":">", "x":12.9167, "y":5}, {"label":"?", "x":13.9167, "y":5}, {"label":"Shift", "x":14.9167, "y":5, "w":1.75}, {"label":"|", "x":16.6667, "y":5}, {"label":"\u2191", "x":19.1667, "y":5}, {"label":"1", "x":21.6667, "y":5}, {"label":"2", "x":22.6667, "y":5}, {"label":"3", "x":23.6667, "y":5}, {"label":"Enter", "x":24.6667, "y":5, "h":2}, + {"label":"F9", "x":0, "y":6}, {"label":"F10", "x":1, "y":6}, {"label":"Ctrl", "x":2.6667, "y":6, "w":1.5}, {"label":"Win", "x":4.1667, "y":6}, {"label":"Alt", "x":5.1667, "y":6, "w":1.5}, {"x":6.6667, "y":6, "w":7}, {"label":"Alt Gr", "x":13.6667, "y":6, "w":1.5}, {"label":"~", "x":15.1667, "y":6}, {"label":"Ctrl", "x":16.1667, "y":6, "w":1.5}, {"label":"\u2190", "x":18.1667, "y":6}, {"label":"\u2193", "x":19.1667, "y":6}, {"label":"\u2192", "x":20.1667, "y":6}, {"label":"0", "x":21.6667, "y":6, "w":2}, {"label":".", "x":23.6667, "y":6}] + }, + "LAYOUT_102_rev3": { + "layout": [ {"label":"F11", "x":0, "y":0}, {"label":"F12", "x":1, "y":0}, {"label":"Esc", "x":2.6667, "y":0}, {"label":"PrtSc", "x":18.1667, "y":0}, {"label":"Scroll Lock", "x":19.1667, "y":0}, {"label":"Pause", "x":20.1667, "y":0}, + {"label":"F1", "x":0, "y":2}, {"label":"F2", "x":1, "y":2}, {"label":"~", "x":2.6667, "y":2}, {"label":"!", "x":3.6667, "y":2}, {"label":"@", "x":4.6667, "y":2}, {"label":"#", "x":5.6667, "y":2}, {"label":"$", "x":6.6667, "y":2}, {"label":"%", "x":7.6667, "y":2}, {"label":"^", "x":8.6667, "y":2}, {"label":"&", "x":9.6667, "y":2}, {"label":"*", "x":10.6667, "y":2}, {"label":"(", "x":11.6667, "y":2}, {"label":")", "x":12.6667, "y":2}, {"label":"_", "x":13.6667, "y":2}, {"label":"+", "x":14.6667, "y":2}, {"label":"Back Space", "x":15.6667, "y":2, "w":2}, {"label":"Insert", "x":18.1667, "y":2}, {"label":"Home", "x":19.1667, "y":2}, {"label":"PgUp", "x":20.1667, "y":2}, {"label":"Num Lock", "x":21.6667, "y":2}, {"label":"/", "x":22.6667, "y":2}, {"label":"*", "x":23.6667, "y":2}, {"label":"-", "x":24.6667, "y":2}, + {"label":"F3", "x":0, "y":3}, {"label":"F4", "x":1, "y":3}, {"label":"Tab", "x":2.6667, "y":3, "w":1.5}, {"label":"Q", "x":4.1667, "y":3}, {"label":"W", "x":5.1667, "y":3}, {"label":"E", "x":6.1667, "y":3}, {"label":"R", "x":7.1667, "y":3}, {"label":"T", "x":8.1667, "y":3}, {"label":"Y", "x":9.1667, "y":3}, {"label":"U", "x":10.1667, "y":3}, {"label":"I", "x":11.1667, "y":3}, {"label":"O", "x":12.1667, "y":3}, {"label":"P", "x":13.1667, "y":3}, {"label":"{", "x":14.1667, "y":3}, {"label":"}", "x":15.1667, "y":3}, {"label":"Enter", "x":16.1667, "y":3, "w":1.5, "h":2}, {"label":"Delete", "x":18.1667, "y":3}, {"label":"End", "x":19.1667, "y":3}, {"label":"PgDn", "x":20.1667, "y":3}, {"label":"7", "x":21.6667, "y":3}, {"label":"8", "x":22.6667, "y":3}, {"label":"9", "x":23.6667, "y":3}, {"label":"+", "x":24.6667, "y":3}, + {"label":"F5", "x":0, "y":4}, {"label":"F6", "x":1, "y":4}, {"label":"Caps Lock", "x":2.6667, "y":4, "w":1.75}, {"label":"A", "x":4.4167, "y":4}, {"label":"S", "x":5.4167, "y":4}, {"label":"D", "x":6.4167, "y":4}, {"label":"F", "x":7.4167, "y":4}, {"label":"G", "x":8.4167, "y":4}, {"label":"H", "x":9.4167, "y":4}, {"label":"J", "x":10.4167, "y":4}, {"label":"K", "x":11.4167, "y":4}, {"label":"L", "x":12.4167, "y":4}, {"label":":", "x":13.4167, "y":4}, {"label":"\"", "x":14.4167, "y":4}, {"label":"4", "x":21.6667, "y":4}, {"label":"5", "x":22.6667, "y":4}, {"label":"6", "x":23.6667, "y":4}, {"label":"=", "x":24.6667, "y":4}, + {"label":"F7", "x":0, "y":5}, {"label":"F8", "x":1, "y":5}, {"label":"Shift", "x":2.6667, "y":5, "w":2.25}, {"label":"Z", "x":4.9167, "y":5}, {"label":"X", "x":5.9167, "y":5}, {"label":"C", "x":6.9167, "y":5}, {"label":"V", "x":7.9167, "y":5}, {"label":"B", "x":8.9167, "y":5}, {"label":"N", "x":9.9167, "y":5}, {"label":"M", "x":10.9167, "y":5}, {"label":"<", "x":11.9167, "y":5}, {"label":">", "x":12.9167, "y":5}, {"label":"?", "x":13.9167, "y":5}, {"label":"Shift", "x":14.9167, "y":5, "w":1.75}, {"label":"|", "x":16.6667, "y":5}, {"label":"\u2191", "x":19.1667, "y":5}, {"label":"1", "x":21.6667, "y":5}, {"label":"2", "x":22.6667, "y":5}, {"label":"3", "x":23.6667, "y":5}, {"label":"Enter", "x":24.6667, "y":5, "h":2}, + {"label":"F9", "x":0, "y":6}, {"label":"F10", "x":1, "y":6}, {"label":"Ctrl", "x":2.6667, "y":6, "w":1.5}, {"label":"Win", "x":4.1667, "y":6}, {"label":"Alt", "x":5.1667, "y":6, "w":1.5}, {"x":6.6667, "y":6, "w":7}, {"label":"Alt Gr", "x":13.6667, "y":6, "w":1.5}, {"label":"*", "x":15.1667, "y":6}, {"label":"Ctrl", "x":16.1667, "y":6, "w":1.5}, {"label":"\u2190", "x":18.1667, "y":6}, {"label":"\u2193", "x":19.1667, "y":6}, {"label":"\u2192", "x":20.1667, "y":6}, {"label":"0", "x":21.6667, "y":6, "w":2}, {"label":".", "x":23.6667, "y":6}] + } + + } +} \ No newline at end of file diff --git a/keyboards/omnikeyish/keymaps/default/keymap.c b/keyboards/omnikeyish/keymaps/default/keymap.c new file mode 100644 index 00000000000..fd434b535dd --- /dev/null +++ b/keyboards/omnikeyish/keymaps/default/keymap.c @@ -0,0 +1,14 @@ +#include QMK_KEYBOARD_H + +#define M_PROG DYN_MACRO_PROG + +/* COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 COL9 COL10 COL11 COL12 COL13 COL14 COL15 COL16 COL17 COL18 COL19 COL20 COL21 COL22 COL23 */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_all( + DYN_MACRO_KEY11, DYN_MACRO_KEY12, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + DYN_MACRO_KEY1, DYN_MACRO_KEY2, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, M_PROG, KC_PSLS, KC_PAST, KC_PMNS, + DYN_MACRO_KEY3, DYN_MACRO_KEY4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + DYN_MACRO_KEY5, DYN_MACRO_KEY6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_MPRV, KC_MPLY, KC_MNXT, KC_P4, KC_P5, KC_P6, KC_PEQL, + DYN_MACRO_KEY7, DYN_MACRO_KEY8, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_BSLS, DEBUG, KC_UP, RESET, KC_P1, KC_P2, KC_P3, KC_PENT, + DYN_MACRO_KEY9, DYN_MACRO_KEY10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT) +}; diff --git a/keyboards/omnikeyish/keymaps/default_101/keymap.c b/keyboards/omnikeyish/keymaps/default_101/keymap.c new file mode 100644 index 00000000000..6e5e41cd11a --- /dev/null +++ b/keyboards/omnikeyish/keymaps/default_101/keymap.c @@ -0,0 +1,14 @@ +#include QMK_KEYBOARD_H + +#define M_PROG DYN_MACRO_PROG + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_101( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, M_PROG, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ) +}; diff --git a/keyboards/omnikeyish/omnikeyish.c b/keyboards/omnikeyish/omnikeyish.c new file mode 100644 index 00000000000..d7b68d41aba --- /dev/null +++ b/keyboards/omnikeyish/omnikeyish.c @@ -0,0 +1,55 @@ +#include "omnikeyish.h" + +void keyboard_pre_init_user(void) { + /* Configure LED driving pins as output pins */ + setPinOutput(NUMLOCKLEDPIN); + setPinOutput(CAPSLOCKLEDPIN); + setPinOutput(SCROLLLOCKLEDPIN); + + dynamic_macro_init(); +} + +void keyboard_post_init_user(void) { + /* Customise these values to desired behaviour */ + //debug_enable = true; + //debug_matrix=true; + //debug_keyboard=true; + //debug_mouse=true; + +#ifdef DYNAMIC_MACRO_EEPROM_STORAGE + /* Restore macros from eeprom */ + dynamic_macro_load_eeprom_all(); +#endif + + /* Send numlock keycode to attempt to force numlock back on. */ + register_code(KC_NUMLOCK); + unregister_code(KC_NUMLOCK); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + return true; +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(NUMLOCKLEDPIN); + } else { + writePinLow(NUMLOCKLEDPIN); + } + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(CAPSLOCKLEDPIN); + } else { + writePinLow(CAPSLOCKLEDPIN); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(SCROLLLOCKLEDPIN); + } else { + writePinLow(SCROLLLOCKLEDPIN); + } +} \ No newline at end of file diff --git a/keyboards/omnikeyish/omnikeyish.h b/keyboards/omnikeyish/omnikeyish.h new file mode 100644 index 00000000000..8f3e69bc37d --- /dev/null +++ b/keyboards/omnikeyish/omnikeyish.h @@ -0,0 +1,159 @@ +#pragma once + +#include "quantum.h" + +enum keycodes { + QWERTY = SAFE_RANGE, + DYNAMIC_MACRO_RANGE +}; + +#include "dynamic_macro.h" + +#define ____ KC_NO + +/* Every possible switch positions on the PCB. Depending on plate and keycap choice, some of these positions will be blocked by other keys. */ +#define LAYOUT_all( \ + K101, K102, K103, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, K120, K121, K122, K123, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, K319, K320, K321, K322, K323, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K415, K416, K417, K418, K419, K420, K421, K422, K423, \ + K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523, \ + K601, K602, K603, K604, K605, K610, K613, K614, K615, K616, K617, K618, K619, K620, K622 \ +) { \ + { K101, K102, K103, ____, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, K120, K121, K122, K123 }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, K319, K320, K321, K322, K323 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K415, K416, K417, K418, K419, K420, K421, K422, K423 }, \ + { K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523 }, \ + { K601, K602, K603, K604, K605, ____, ____, ____, ____, K610, ____, ____, K613, K614, K615, K616, K617, K618, K619, K620, ____, K622, ____ } \ +} + +/* Northgate Factory Plates. Most are based on internet research, user beware. */ +#define LAYOUT_101( \ + K103, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ + K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223, \ + K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, K319, K320, K321, K322, K323, \ + K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K416, K420, K421, K422, \ + K503, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K518, K520, K521, K522, K523, \ + K603, K605, K610, K613, K616, K617, K618, K619, K620, K622 \ +) { \ + { ____, ____, K103, ____, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, ____, ____, ____, ____ }, \ + { ____, ____, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223 }, \ + { ____, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, K319, K320, K321, K322, K323 }, \ + { ____, ____, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, ____, K416, ____, ____, ____, K420, K421, K422, ____ }, \ + { ____, ____, K503, ____, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, ____, ____, K518, ____, K520, K521, K522, K523 }, \ + { ____, ____, K603, ____, K605, ____, ____, ____, ____, K610, ____, ____, K613, ____, ____, K616, K617, K618, K619, K620, ____, K622, ____ } \ +} + +#define LAYOUT_102_rev1( \ + K101, K102, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K317, K318, K319, K320, K321, K322, K323, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K416, K420, K421, K422, K423, \ + K501, K502, K503, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K518, K520, K521, K522, K523, \ + K601, K602, K603, K604, K605, K610, K613, K614, K616, K617, K618, K619, K620, K622 \ +) { \ + { K101, K102, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, K117, K118, K119, ____, ____, ____, ____ }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, ____, K317, K318, K319, K320, K321, K322, K323 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, ____, K416, ____, ____, ____, K420, K421, K422, K423 }, \ + { K501, K502, K503, ____, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, ____, K518, ____, K520, K521, K522, K523 }, \ + { K601, K602, K603, K604, K605, ____, ____, ____, ____, K610, ____, ____, K613, K614, ____, K616, K617, K618, K619, K620, ____, K622, ____ } \ +} + +#define LAYOUT_102_rev3( \ + K101, K102, K103, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K317, K318, K319, K320, K321, K322, K323, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K416, K420, K421, K422, K423, \ + K501, K502, K503, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K518, K520, K521, K522, K523, \ + K601, K602, K603, K604, K605, K610, K613, K614, K616, K617, K618, K619, K620, K622 \ +) { \ + { K101, K102, K103, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, K117, K118, K119, ____, ____, ____, ____ }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, ____, K317, K318, K319, K320, K321, K322, K323 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, ____, K416, ____, ____, ____, K420, K421, K422, K423 }, \ + { K501, K502, K503, ____, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, ____, K518, ____, K520, K521, K522, K523 }, \ + { K601, K602, K603, K604, K605, ____, ____, ____, ____, K610, ____, ____, K613, K614, ____, K616, K617, K618, K619, K620, ____, K622, ____ } \ +} + +#define LAYOUT_plus_rev1( \ + K101, K102, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K317, K318, K319, K320, K321, K322, K323, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K416, K417, K418, K419, K420, K421, K422, K423, \ + K501, K502, K503, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523, \ + K601, K602, K603, K604, K605, K610, K613, K614, K616, K617, K619, K620, K622 \ +) { \ + { K101, K102, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, K117, K118, K119, ____, ____, ____, ____ }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, ____, K317, K318, K319, K320, K321, K322, K323 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, ____, K416, K417, K418, K419, K420, K421, K422, K423 }, \ + { K501, K502, K503, ____, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523 }, \ + { K601, K602, K603, K604, K605, ____, ____, ____, ____, K610, ____, ____, K613, K614, ____, K616, K617, ____, K619, K620, ____, K622, ____ } \ +} + +#define LAYOUT_plus_rev3( \ + K101, K102, K103, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K317, K318, K319, K320, K321, K322, K323, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K416, K417, K418, K419, K420, K421, K422, K423, \ + K501, K502, K503, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523, \ + K601, K602, K603, K604, K605, K610, K613, K614, K616, K617, K619, K620, K622 \ +) { \ + { K101, K102, K103, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, K117, K118, K119, ____, ____, ____, ____ }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, ____, K317, K318, K319, K320, K321, K322, K323 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, ____, K416, K417, K418, K419, K420, K421, K422, K423 }, \ + { K501, K502, K503, ____, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523 }, \ + { K601, K602, K603, K604, K605, ____, ____, ____, ____, K610, ____, ____, K613, K614, ____, K616, K617, ____, K619, K620, ____, K622, ____ } \ +} + +#define LAYOUT_ultra_rev1( \ + K101, K102, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K317, K318, K319, K320, K321, K322, K323, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K416, K417, K418, K419, K420, K421, K422, K423, \ + K501, K502, K503, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523, \ + K601, K602, K603, K604, K605, K610, K613, K614, K616, K617, K619, K620, K622 \ +) { \ + { K101, K102, ____, ____, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, ____, ____, ____, ____ }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, ____, K317, K318, K319, K320, K321, K322, K323 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, ____, K416, K417, K418, K419, K420, K421, K422, K423 }, \ + { K501, K502, K503, ____, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523 }, \ + { K601, K602, K603, K604, K605, ____, ____, ____, ____, K610, ____, ____, K613, K614, ____, K616, K617, ____, K619, K620, ____, K622, ____ } \ +} + +#define LAYOUT_ultra_rev3( \ + K101, K102, K103, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K317, K318, K319, K320, K321, K322, K323, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K416, K417, K418, K419, K420, K421, K422, K423, \ + K501, K502, K503, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523, \ + K601, K602, K603, K604, K605, K610, K613, K614, K616, K617, K619, K620, K622 \ +) { \ + { K101, K102, K103, ____, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, ____, ____, ____, ____ }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, ____, K317, K318, K319, K320, K321, K322, K323 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, ____, K416, K417, K418, K419, K420, K421, K422, K423 }, \ + { K501, K502, K503, ____, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K517, K518, K519, K520, K521, K522, K523 }, \ + { K601, K602, K603, K604, K605, ____, ____, ____, ____, K610, ____, ____, K613, K614, ____, K616, K617, ____, K619, K620, ____, K622, ____ } \ +} + +#define LAYOUT_ultra_t( \ + K101, K102, K103, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K317, K318, K319, K320, K321, K322, K323, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K416, K420, K421, K422, K423, \ + K501, K502, K503, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, K518, K520, K521, K522, K523, \ + K601, K602, K603, K604, K605, K610, K613, K614, K616, K617, K618, K619, K620, K622 \ +) { \ + { K101, K102, K103, ____, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, ____, ____, ____, ____ }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, K218, K219, K220, K221, K222, K223 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, ____, K317, K318, K319, K320, K321, K322, K323 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, ____, K416, ____, ____, ____, K420, K421, K422, K423 }, \ + { K501, K502, K503, ____, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514, K515, K516, ____, K518, ____, K520, K521, K522, K523 }, \ + { K601, K602, K603, K604, K605, ____, ____, ____, ____, K610, ____, ____, K613, K614, ____, K616, K617, K618, K619, K620, ____, K622, ____ } \ +} + diff --git a/keyboards/omnikeyish/readme.md b/keyboards/omnikeyish/readme.md new file mode 100644 index 00000000000..31387bb8afa --- /dev/null +++ b/keyboards/omnikeyish/readme.md @@ -0,0 +1,14 @@ +Omnikey(-ish) +=== + +A replacement PCB for Omnikey keyboards. (In theory) supports 101, 102, Plus, Ultra T, Ultra, Prime and Stellar, as well as customs. + +Keyboard Maintainer: QMK Community and Henrik O. Sørensen +Hardware Supported: Omnikey(-ish) PCB +Hardware Availability: https://github.com/henrikosorensen/keyboard_pcbs/tree/master/omnikeyish_pcb + +Make example for this keyboard (after setting up your build environment): + + make omnikeyish:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/omnikeyish/rules.mk b/keyboards/omnikeyish/rules.mk new file mode 100644 index 00000000000..38d50425fbd --- /dev/null +++ b/keyboards/omnikeyish/rules.mk @@ -0,0 +1,65 @@ +# keyboard specific files +SRC += dynamic_macro.c + +# MCU name +MCU = at90usb1286 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/orange75/config.h b/keyboards/orange75/config.h index 7d1b497be0f..35399cc6000 100644 --- a/keyboards/orange75/config.h +++ b/keyboards/orange75/config.h @@ -26,7 +26,7 @@ /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE diff --git a/keyboards/org60/config.h b/keyboards/org60/config.h index 62b3b69a0ed..f455fea2a2f 100644 --- a/keyboards/org60/config.h +++ b/keyboards/org60/config.h @@ -55,7 +55,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* RGB Underglow * F6 PIN for Org60 that has pre-soldered WS2812 LEDs @@ -72,11 +72,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define TAPPING_TERM 200 #endif diff --git a/keyboards/org60/keymaps/boardy/rules.mk b/keyboards/org60/keymaps/boardy/rules.mk index 0755d500937..88ac79ecad5 100644 --- a/keyboards/org60/keymaps/boardy/rules.mk +++ b/keyboards/org60/keymaps/boardy/rules.mk @@ -8,8 +8,3 @@ COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = no # Tap Dance skills UNICODE_ENABLE = no # Unicode -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - - diff --git a/keyboards/org60/keymaps/default/keymap.c b/keyboards/org60/keymaps/default/keymap.c index ebb377d1dd8..1c209a72d26 100644 --- a/keyboards/org60/keymaps/default/keymap.c +++ b/keyboards/org60/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -9,7 +8,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_NO, KC_RSFT ,KC_UP, KC_DEL, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT), // 1: Function Layer LAYOUT( @@ -17,30 +16,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_WH_U, KC_UP, KC_WH_D, KC_BSPC,KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \ KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP,KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_RSFT, KC_NO ,KC_PGUP, KC_INS, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_HOME, KC_PGDOWN,KC_END), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, MO(1), KC_HOME, KC_PGDOWN,KC_END), }; -// Custom Actions -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay -}; - -// Macros -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { register_code(KC_RSFT); } - else { unregister_code(KC_RSFT); } - break; - } - - return MACRO_NONE; -}; - // Loop void matrix_scan_user(void) { // Empty -}; \ No newline at end of file +}; diff --git a/keyboards/org60/keymaps/jarred/keymap.c b/keyboards/org60/keymaps/jarred/keymap.c new file mode 100644 index 00000000000..3397a1909cd --- /dev/null +++ b/keyboards/org60/keymaps/jarred/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +#define _QW 0 +#define _NV 1 + +// HHKB Layout +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QW] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + MO(_NV), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, KC_ENT, \ + XXXXXXX, KC_LCTL, KC_LGUI, KC_SPC, XXXXXXX, KC_RALT, XXXXXXX, KC_RCTL, XXXXXXX), + + [_NV] = LAYOUT( + KC_GRV , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ + _______, _______, _______, _______, KC_DEL ,KC_BSPC,_______,KC_HOME,KC_UP ,KC_END , KC_INS , _______, _______, _______, \ + _______, _______, _______, KC_LSFT,KC_LCTL, KC_ENT, _______,KC_LEFT,KC_DOWN,KC_RGHT, KC_DEL , KC_DEL , _______, _______, \ + _______, _______, _______, _______, _______,_______,_______,_______,KC_PGUP,KC_PGDN, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, RESET, _______), + +}; + + diff --git a/keyboards/orthodox/config.h b/keyboards/orthodox/config.h deleted file mode 100644 index 821cd7e29f2..00000000000 --- a/keyboards/orthodox/config.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -This is the c configuration file for the keyboard - -Copyright 2012 Jun Wako -Copyright 2017 Jack Humbert -Copyright 2017 Art Ortenburger - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -#endif diff --git a/keyboards/orthodox/i2c.c b/keyboards/orthodox/i2c.c deleted file mode 100644 index 084c890c405..00000000000 --- a/keyboards/orthodox/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< -#include "matrix.h" - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 100000UL - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/orthodox/keymaps/default/config.h b/keyboards/orthodox/keymaps/default/config.h index 3df957b84c5..ce4538b08a2 100644 --- a/keyboards/orthodox/keymaps/default/config.h +++ b/keyboards/orthodox/keymaps/default/config.h @@ -19,10 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -44,6 +41,3 @@ along with this program. If not, see . SONG(DVORAK_SOUND) \ } #endif - - -#endif diff --git a/keyboards/orthodox/keymaps/default/keymap.c b/keyboards/orthodox/keymaps/default/keymap.c index c7a48d82d0b..b1c86da6c0a 100644 --- a/keyboards/orthodox/keymaps/default/keymap.c +++ b/keyboards/orthodox/keymaps/default/keymap.c @@ -38,10 +38,6 @@ enum custom_keycodes { DVORAK }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define LS__SPC MT(MOD_LSFT, KC_SPC) #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index 09df12d9ed9..4719c22696c 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -23,8 +23,8 @@ along with this program. If not, see . /* Use I2C or Serial, not both */ -#define USE_SERIAL -#undef USE_I2C +// #define USE_SERIAL +#define USE_I2C /* Select hand configuration */ @@ -32,52 +32,47 @@ along with this program. If not, see . // #define MASTER_RIGHT #define EE_HANDS - -/* key combination for command */ -#ifdef IS_COMMAND +/* key combination for magic key command */ #undef IS_COMMAND -#endif #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT)) \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT)) \ ) - #ifdef RGBLIGHT_ENABLE -#define RGB_DI_PIN D3 -#define RGBLED_NUM 16 // Number of LEDs - -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +# define RGB_DI_PIN D3 +# define RGBLED_NUM 16 // Number of LEDs +# define RGBLED_SPLIT { 8, 8 } + +# define RGBLIGHT_HUE_STEP 12 +# define RGBLIGHT_SAT_STEP 12 +# define RGBLIGHT_VAL_STEP 12 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 #endif // RGBLIGHT_ENABLE #ifdef AUDIO_ENABLE -#define C6_AUDIO -#ifdef RGBLIGHT_ENABLE -#define NO_MUSIC_MODE -#endif +# define C6_AUDIO +# ifdef RGBLIGHT_ENABLE +# define NO_MUSIC_MODE +# endif #endif //AUDIO_ENABLE #undef PRODUCT #ifdef KEYBOARD_orthodox_rev1 -#define PRODUCT Drashna Hacked Orthodox Rev.1 +# define PRODUCT Drashna Hacked Orthodox Rev.1 #elif KEYBOARD_orthodox_rev3 -#define PRODUCT Drashna Hacked Orthodox Rev.3 +# define PRODUCT Drashna Hacked Orthodox Rev.3 #endif #define QMK_ESC_OUTPUT D7 // usually COL #ifdef KEYBOARD_orthodox_rev1 -#define QMK_ESC_INPUT D4 // usually ROW +# define QMK_ESC_INPUT D4 // usually ROW #else -#define QMK_ESC_INPUT D2 // usually ROW +# define QMK_ESC_INPUT D2 // usually ROW #endif #define QMK_LED B0 #define QMK_SPEAKER C6 - #define SHFT_LED1 5 #define SHFT_LED2 10 @@ -86,4 +81,3 @@ along with this program. If not, see . #define GUI_LED1 8 #define ALT_LED1 7 - diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 545ad25dcd3..56799ae2c01 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -30,7 +30,7 @@ uint8_t last_led; uint8_t last_osm; #endif - +// clang-format off #define LAYOUT_orthodox_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ @@ -38,8 +38,8 @@ uint8_t last_osm; ) \ LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, OS_RGUI, K16, K17, K18, K19, K1A, KC_QUOT, \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF \ + KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF \ ) #define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) @@ -47,59 +47,88 @@ uint8_t last_osm; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = LAYOUT_orthodox_base_wrapper( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ -), - -[_COLEMAK] = LAYOUT_orthodox_base_wrapper( - _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, - _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, - _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ -), - -[_DVORAK] = LAYOUT_orthodox_base_wrapper( - _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, - _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, - _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ -), - -[_WORKMAN] = LAYOUT_orthodox_base_wrapper( - _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, - _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, - _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ -), - -[_MODS] = LAYOUT_wrapper(\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -[_LOWER] = LAYOUT_wrapper(\ - KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, - KC_F11, _________________LOWER_L2__________________, _______, _______, _______, _______, _________________LOWER_R2__________________, KC_PIPE, - KC_F12, _________________LOWER_L3__________________, _______, _______, _______, _______, _______, _______, _________________LOWER_R3__________________, _______ -), - -[_RAISE] = LAYOUT_wrapper(\ - KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, - _______, _________________RAISE_L2__________________, _______, _______, _______, _______, _________________RAISE_R2__________________, KC_BSLS, - _______, _________________RAISE_L3__________________, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________, _______ -), - -[_ADJUST] = LAYOUT_wrapper(\ - KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, - VRSN, _________________ADJUST_L2_________________, _______, _______, _______, KC_NUKE, _________________ADJUST_R2_________________, EPRM, - TG_MODS, _________________ADJUST_L3_________________, _______, _______, _______, _______, _______, _______, _________________ADJUST_R3_________________, KC_MPLY -) + [_QWERTY] = LAYOUT_orthodox_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + + [_COLEMAK] = LAYOUT_orthodox_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DVORAK] = LAYOUT_orthodox_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + [_WORKMAN] = LAYOUT_orthodox_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), + + [_NORMAN] = LAYOUT_orthodox_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_orthodox_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_orthodox_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_orthodox_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + + + [_MODS] = LAYOUT_wrapper(\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_LOWER] = LAYOUT_wrapper(\ + KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, + KC_F11, _________________LOWER_L2__________________, _______, _______, _______, _______, _________________LOWER_R2__________________, KC_PIPE, + KC_F12, _________________LOWER_L3__________________, _______, _______, _______, _______, _______, _______, _________________LOWER_R3__________________, _______ + ), + + [_RAISE] = LAYOUT_wrapper(\ + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, + _______, _________________RAISE_L2__________________, _______, _______, _______, _______, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________, _______ + ), + + [_ADJUST] = LAYOUT_wrapper(\ + KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, + VRSN, _________________ADJUST_L2_________________, _______, _______, _______, KC_NUKE, _________________ADJUST_R2_________________, EEP_RST, + TG_MODS, _________________ADJUST_L3_________________, _______, _______, _______, _______, _______, _______, _________________ADJUST_R3_________________, KC_MPLY + ) + }; +// clang-format on void matrix_init_keymap(void) { - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); +#ifndef CONVERT_TO_PROTON_C + setPinOutput(D5); + writePinHigh(D5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); + setPinOutput(B0); + writePinHigh(B0); +#endif } diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index f870c3a7d65..a122b9e0f15 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -5,11 +5,14 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = no RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = yes +AUDIO_ENABLE = no NKRO_ENABLE = yes +SPACE_CADET_ENABLE = no INDICATOR_LIGHTS = yes MACROS_ENABLED = no -RGBLIGHT_TWINKLE = yes +RGBLIGHT_TWINKLE = no +RGBLIGHT_STARTUP_ANIMATION = yes + BOOTLOADER = qmk-dfu diff --git a/keyboards/orthodox/keymaps/oscillope/keymap.c b/keyboards/orthodox/keymaps/oscillope/keymap.c index ad07b3ed431..1f4aefca902 100644 --- a/keyboards/orthodox/keymaps/oscillope/keymap.c +++ b/keyboards/orthodox/keymaps/oscillope/keymap.c @@ -42,10 +42,6 @@ enum custom_keycodes { CC_CBR, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define NAV_TAP LT(_NAV, KC_SPC) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/orthodox/keymaps/rfvizarra/keymap.c b/keyboards/orthodox/keymaps/rfvizarra/keymap.c index 55f0fa016bf..4de7e39509f 100644 --- a/keyboards/orthodox/keymaps/rfvizarra/keymap.c +++ b/keyboards/orthodox/keymaps/rfvizarra/keymap.c @@ -43,10 +43,6 @@ enum custom_keycodes { DVORAK }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( \ diff --git a/keyboards/orthodox/keymaps/xyverz/keymap.c b/keyboards/orthodox/keymaps/xyverz/keymap.c index 2b6551e199c..df66e0fc558 100644 --- a/keyboards/orthodox/keymaps/xyverz/keymap.c +++ b/keyboards/orthodox/keymaps/xyverz/keymap.c @@ -45,10 +45,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DVORAK] = LAYOUT ( \ diff --git a/keyboards/orthodox/matrix.c b/keyboards/orthodox/matrix.c deleted file mode 100644 index 2ca5f4d87ab..00000000000 --- a/keyboards/orthodox/matrix.c +++ /dev/null @@ -1,342 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#ifdef USE_I2C -// provides memcpy for copying TWI slave buffer -// #include -#endif -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -static uint8_t debouncing = DEBOUNCE; -static const int ROWS_PER_HAND = MATRIX_ROWS/2; -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) -{ - // Right hand is stored after the left in the matrix so, we need to offset it - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); - - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i+offset] != cols) { - matrix_debouncing[i+offset] = cols; - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - } - } - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - /* - // read from TWI byte-by-byte into matrix_row_t memory space - size_t i; - for (i = 0; i < SLAVE_BUFFER_SIZE-1; ++i) { - *((uint8_t*)&matrix[slaveOffset]+i) = i2c_master_read(I2C_ACK); - } - // last byte to be read / end of chunk - *((uint8_t*)&matrix[slaveOffset]+i) = i2c_master_read(I2C_NACK); - */ - - // kludge for column #9: unpack bits for keys (2,9) and (3,9) from (1,7) and (1,8) - // i2c_master_read(I2C_ACK); - matrix[slaveOffset+0] = i2c_master_read(I2C_ACK); - // i2c_master_read(I2C_ACK); - matrix[slaveOffset+1] = (matrix_row_t)i2c_master_read(I2C_ACK)\ - | (matrix[slaveOffset+0]&0x40U)<<2; - // i2c_master_read(I2C_ACK); - matrix[slaveOffset+2] = (matrix_row_t)i2c_master_read(I2C_NACK)\ - | (matrix[slaveOffset+0]&0x80U)<<1; - // clear highest two bits on row 1, where the col9 bits were transported - matrix[slaveOffset+0] &= 0x3F; - - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnected, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - int ret = _matrix_scan(); - - - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - // SLAVE_BUFFER_SIZE is from i2c.h - // (MATRIX_ROWS/2*sizeof(matrix_row_t)) - // memcpy((void*)i2c_slave_buffer, (const void*)&matrix[offset], (ROWS_PER_HAND*sizeof(matrix_row_t))); - - // kludge for column #9: put bits for keys (2,9) and (3,9) into (1,7) and (1,8) - i2c_slave_buffer[0] = (uint8_t)(matrix[offset+0])\ - | (matrix[offset+1]&0x100U)>>2\ - | (matrix[offset+2]&0x100U)>>1; - i2c_slave_buffer[1] = (uint8_t)(matrix[offset+1]); - i2c_slave_buffer[2] = (uint8_t)(matrix[offset+2]); - // note: looks like a possible operator-precedence bug here, in last version? - /* - i2c_slave_buffer[1] = (uint8_t)matrix[offset+0]; - i2c_slave_buffer[2] = (uint8_t)(matrix[offset+1]>>8); - i2c_slave_buffer[3] = (uint8_t)(matrix[offset+1]>>8); - i2c_slave_buffer[4] = (uint8_t)(matrix[offset+2]>>8); - i2c_slave_buffer[5] = (uint8_t)matrix[offset+2]; - */ -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); - _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); - } -} - -static matrix_row_t read_cols(void) -{ - matrix_row_t result = 0; - for(int x = 0; x < MATRIX_COLS; x++) { - result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); - } - return result; -} - -static void unselect_rows(void) -{ - for(int x = 0; x < ROWS_PER_HAND; x++) { - _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); - _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); - } -} - -static void select_row(uint8_t row) -{ - _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); - _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); -} diff --git a/keyboards/orthodox/orthodox.h b/keyboards/orthodox/orthodox.h index 51c52455278..6f8dad60acb 100644 --- a/keyboards/orthodox/orthodox.h +++ b/keyboards/orthodox/orthodox.h @@ -1,5 +1,6 @@ -#ifndef ORTHODOX_H -#define ORTHODOX_H +#pragma once + +#include "quantum.h" #ifdef KEYBOARD_orthodox_rev1 #include "rev1.h" @@ -25,7 +26,3 @@ { KC_##LR18, KC_##LR17, KC_##LR16, KC_##LR15, KC_##LR14, KC_##LR13, KC_##LR12, KC_NO, KC_##LR10 }, \ { KC_##LR28, KC_##LR27, KC_##LR26, KC_##LR25, KC_##LR24, KC_##LR23, KC_##LR22, KC_##LR21, KC_##LR20 } \ } - -#include "quantum.h" - -#endif diff --git a/keyboards/orthodox/readme.md b/keyboards/orthodox/readme.md index 0c47dd9c439..8bf60a9bdda 100644 --- a/keyboards/orthodox/readme.md +++ b/keyboards/orthodox/readme.md @@ -125,7 +125,7 @@ EEPROM for the left and right halves. The EEPROM is used to store whether the half is left handed or right handed. This makes it so that the same firmware -file will run on both hands instead of having to flash [left](../lets_split/eeprom-lefthand.eep) and [right](../lets_split/eeprom-righthand.eep) handed +file will run on both hands instead of having to flash [left](../../quantum/split_common/eeprom-lefthand.eep) and [right](../../quantum/split_common/eeprom-righthand.eep) handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` diff --git a/keyboards/orthodox/rev1/config.h b/keyboards/orthodox/rev1/config.h index 03936e737fd..89e36dce7b9 100644 --- a/keyboards/orthodox/rev1/config.h +++ b/keyboards/orthodox/rev1/config.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once #include "config_common.h" @@ -49,6 +48,8 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define SOFT_SERIAL_PIN D0 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -56,7 +57,7 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ // #define LOCKING_SUPPORT_ENABLE @@ -65,7 +66,7 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LGUI)) \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LGUI)) \ ) /* ws2812 RGB LED */ @@ -89,5 +90,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/orthodox/rev1/info.json b/keyboards/orthodox/rev1/info.json index 0a8442cf4b1..83180aa15e5 100644 --- a/keyboards/orthodox/rev1/info.json +++ b/keyboards/orthodox/rev1/info.json @@ -1,8 +1,8 @@ { "keyboard_name": "Monkeebs Orthodox Rev.1", "maintainer": "drashna", - "width": 17, - "height": 17.24, + "width": 19, + "height": 5, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/orthodox/rev1/rev1.h b/keyboards/orthodox/rev1/rev1.h index e73263fb687..783dfb34b95 100644 --- a/keyboards/orthodox/rev1/rev1.h +++ b/keyboards/orthodox/rev1/rev1.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_H -#define REV1_H +#pragma once #include "orthodox.h" @@ -42,7 +41,3 @@ along with this program. If not, see . { R18, R17, R16, R15, R14, R13, R12, KC_NO, R10 }, \ { R28, R27, R26, R25, R24, R23, R22, R21, R20 } \ } - -#endif - - diff --git a/keyboards/orthodox/rev3/config.h b/keyboards/orthodox/rev3/config.h index 2e4018e91bf..ad3437a6262 100644 --- a/keyboards/orthodox/rev3/config.h +++ b/keyboards/orthodox/rev3/config.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV3_CONFIG_H -#define REV3_CONFIG_H +#pragma once #include "config_common.h" @@ -54,6 +53,8 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define SOFT_SERIAL_PIN D0 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -61,7 +62,7 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ // #define LOCKING_SUPPORT_ENABLE @@ -70,7 +71,7 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LGUI)) \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LGUI)) \ ) /* ws2812 RGB LED */ @@ -95,5 +96,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/orthodox/rev3/info.json b/keyboards/orthodox/rev3/info.json index 289169d72b7..c98c9f232d7 100644 --- a/keyboards/orthodox/rev3/info.json +++ b/keyboards/orthodox/rev3/info.json @@ -1,8 +1,8 @@ { "keyboard_name": "Monkeebs Orthodox Rev.3", "maintainer": "drashna", - "width": 17, - "height": 17.24, + "width": 19, + "height": 5, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/orthodox/rev3/rev3.h b/keyboards/orthodox/rev3/rev3.h index 2be9b9605ce..783dfb34b95 100644 --- a/keyboards/orthodox/rev3/rev3.h +++ b/keyboards/orthodox/rev3/rev3.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV3_H -#define REV3_H +#pragma once #include "orthodox.h" @@ -42,6 +41,3 @@ along with this program. If not, see . { R18, R17, R16, R15, R14, R13, R12, KC_NO, R10 }, \ { R28, R27, R26, R25, R24, R23, R22, R21, R20 } \ } - -#endif - diff --git a/keyboards/orthodox/rev3_teensy/config.h b/keyboards/orthodox/rev3_teensy/config.h index e2e693079c9..c26e15dee74 100644 --- a/keyboards/orthodox/rev3_teensy/config.h +++ b/keyboards/orthodox/rev3_teensy/config.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV3_TEENSY_CONFIG_H -#define REV3_TEENSY_CONFIG_H +#pragma once #include "config_common.h" @@ -46,6 +45,8 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW +#define SOFT_SERIAL_PIN D0 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -53,7 +54,7 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ // #define LOCKING_SUPPORT_ENABLE @@ -62,7 +63,7 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LGUI)) \ + get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LGUI)) \ ) /* ws2812 RGB LED */ @@ -87,5 +88,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/orthodox/rev3_teensy/info.json b/keyboards/orthodox/rev3_teensy/info.json index d578a413408..5781c08f8e2 100644 --- a/keyboards/orthodox/rev3_teensy/info.json +++ b/keyboards/orthodox/rev3_teensy/info.json @@ -1,8 +1,8 @@ { "keyboard_name": "Monkeebs Orthodox Rev.3 (Teensy)", "maintainer": "drashna", - "width": 17, - "height": 17.24, + "width": 19, + "height": 5, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/orthodox/rev3_teensy/rev3_teensy.h b/keyboards/orthodox/rev3_teensy/rev3_teensy.h index 0081a0df011..783dfb34b95 100644 --- a/keyboards/orthodox/rev3_teensy/rev3_teensy.h +++ b/keyboards/orthodox/rev3_teensy/rev3_teensy.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV3_TEENSY_H -#define REV3_TEENSY_H +#pragma once #include "orthodox.h" @@ -42,6 +41,3 @@ along with this program. If not, see . { R18, R17, R16, R15, R14, R13, R12, KC_NO, R10 }, \ { R28, R27, R26, R25, R24, R23, R22, R21, R20 } \ } - -#endif - diff --git a/keyboards/orthodox/rules.mk b/keyboards/orthodox/rules.mk index 715f25c3a00..61878ea83c3 100644 --- a/keyboards/orthodox/rules.mk +++ b/keyboards/orthodox/rules.mk @@ -1,8 +1,3 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - # MCU name MCU = atmega32u4 @@ -40,7 +35,7 @@ F_USB = $(F_CPU) # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. # Interrupt driven control endpoint task(+60) @@ -61,12 +56,10 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes DEFAULT_FOLDER = orthodox/rev3 diff --git a/keyboards/orthodox/serial.c b/keyboards/orthodox/serial.c deleted file mode 100644 index fea57b65101..00000000000 --- a/keyboards/orthodox/serial.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -matrix_row_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -matrix_row_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define ROW_MASK (((matrix_row_t)0-1)>>(8*sizeof(matrix_row_t)-MATRIX_COLS)) - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -matrix_row_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -matrix_row_t serial_read_byte(void) { - matrix_row_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < MATRIX_COLS; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(matrix_row_t data) { - matrix_row_t b = MATRIX_COLS; - serial_output(); - while( b-- ) { - if(data & (1UL << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - matrix_row_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += ROW_MASK & serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - matrix_row_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += ROW_MASK & serial_master_buffer[i]; - } - matrix_row_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - matrix_row_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += ROW_MASK & serial_slave_buffer[i]; - } - matrix_row_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - matrix_row_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += ROW_MASK & serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/orthodox/serial.h b/keyboards/orthodox/serial.h deleted file mode 100644 index a46a98c9472..00000000000 --- a/keyboards/orthodox/serial.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include -#include "matrix.h" - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile matrix_row_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile matrix_row_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/orthodox/split_util.c b/keyboards/orthodox/split_util.c deleted file mode 100644 index 39639c3b4bd..00000000000 --- a/keyboards/orthodox/split_util.c +++ /dev/null @@ -1,84 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/otaku_split/rev0/config.h b/keyboards/otaku_split/rev0/config.h new file mode 100644 index 00000000000..5e1bfaacd1d --- /dev/null +++ b/keyboards/otaku_split/rev0/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 takashiski + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER takashiski +#define PRODUCT otaku_split +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B5,B4,E6,D7,C6 } +#define MATRIX_COL_PINS { B6,B2,B3,B1,F7,F6,F5,F4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/otaku_split/rev0/info.json b/keyboards/otaku_split/rev0/info.json new file mode 100644 index 00000000000..b5608cb492c --- /dev/null +++ b/keyboards/otaku_split/rev0/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Otaku split rev.0", + "url": "", + "maintainer": "takashiski", + "width": 17.75, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"\u534a\u89d2", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":9.75, "y":0}, {"label":"*", "x":10.75, "y":0}, {"label":"(", "x":11.75, "y":0}, {"label":")", "x":12.75, "y":0}, {"label":"=", "x":13.75, "y":0}, {"label":"~", "x":14.75, "y":0}, {"label":"|", "x":15.75, "y":0}, {"label":"Backspace", "x":16.75, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"7", "x":6.5, "y":1}, {"label":"Y", "x":9.25, "y":1}, {"label":"U", "x":10.25, "y":1}, {"label":"I", "x":11.25, "y":1}, {"label":"O", "x":12.25, "y":1}, {"label":"P", "x":13.25, "y":1}, {"label":"`", "x":14.25, "y":1}, {"label":"{", "x":15.25, "y":1}, {"label":"Enter", "x":16.5, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":9.5, "y":2}, {"label":"J", "x":10.5, "y":2}, {"label":"K", "x":11.5, "y":2}, {"label":"L", "x":12.5, "y":2}, {"label":"+", "x":13.5, "y":2}, {"label":"*", "x":14.5, "y":2}, {"label":"}", "x":15.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"1", "x":9, "y":3}, {"label":"N", "x":10, "y":3}, {"label":"M", "x":11, "y":3}, {"label":"<", "x":12, "y":3}, {"label":">", "x":13, "y":3}, {"label":"?", "x":14, "y":3}, {"label":"_", "x":15, "y":3}, {"label":"Shift", "x":16, "y":3, "w":1.75}, {"x":0, "y":4, "w":2}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Alt", "x":3.25, "y":4, "w":1.25}, {"label":"\u7121\u5909\u63db", "x":4.5, "y":4}, {"label":"\u2190", "x":5.5, "y":4}, {"label":"\u2193", "x":6.5, "y":4}, {"label":"\u2191", "x":8.75, "y":4}, {"label":"\u2192", "x":9.75, "y":4}, {"label":".", "x":10.75, "y":4}, {"label":"Menu", "x":11.75, "y":4}, {"label":"\u5909\u63db", "x":12.75, "y":4, "w":1.25}, {"label":"\u30ab\u30bf\u30ab\u30ca", "x":14, "y":4, "w":1.25}, {"label":"Alt", "x":15.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":16.5, "y":4, "w":1.25}] + } + } +} diff --git a/keyboards/otaku_split/rev0/keymaps/default/config.h b/keyboards/otaku_split/rev0/keymaps/default/config.h new file mode 100644 index 00000000000..25cddc6bb78 --- /dev/null +++ b/keyboards/otaku_split/rev0/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/otaku_split/rev0/keymaps/default/keymap.c b/keyboards/otaku_split/rev0/keymaps/default/keymap.c new file mode 100644 index 00000000000..844e9c50ec8 --- /dev/null +++ b/keyboards/otaku_split/rev0/keymaps/default/keymap.c @@ -0,0 +1,49 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS ,KC_EQL,KC_JYEN,KC_BSPC,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_ENT, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,KC_NUHS, + KC_LSHIFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH,KC_RO,KC_RSHIFT, + KC_LCTRL, KC_LGUI,KC_LALT,KC_MHEN,KC_TAB,KC_SPC, KC_ENT,KC_BSPC,KC_HENK,KC_KANA,KC_RALT,KC_RGUI,KC_APP,KC_RCTRL + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/otaku_split/rev0/keymaps/default/readme.md b/keyboards/otaku_split/rev0/keymaps/default/readme.md new file mode 100644 index 00000000000..dbaaa2eb8ef --- /dev/null +++ b/keyboards/otaku_split/rev0/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for otaku_split \ No newline at end of file diff --git a/keyboards/otaku_split/rev0/keymaps/sample/config.h b/keyboards/otaku_split/rev0/keymaps/sample/config.h new file mode 100644 index 00000000000..25cddc6bb78 --- /dev/null +++ b/keyboards/otaku_split/rev0/keymaps/sample/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/otaku_split/rev0/keymaps/sample/keymap.c b/keyboards/otaku_split/rev0/keymaps/sample/keymap.c new file mode 100644 index 00000000000..b1df2cef060 --- /dev/null +++ b/keyboards/otaku_split/rev0/keymaps/sample/keymap.c @@ -0,0 +1,79 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + +#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 +#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_wrapper(\ + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS ,KC_EQL,KC_JYEN,KC_BSPC,\ + KC_TAB, _________________QWERTY_L1_________________,KC_Y, _________________QWERTY_R1_________________,KC_LBRC,KC_RBRC,KC_ENT,\ + KC_CAPS, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,KC_QUOT,KC_NUHS,\ + KC_LSHIFT,_________________QWERTY_L3_________________, KC_B,_________________QWERTY_R3_________________,KC_RO,KC_RSHIFT,\ + KC_LCTRL, KC_LGUI,KC_LALT,KC_MHEN,KC_TAB,KC_SPC, KC_ENT,KC_BSPC,KC_HENK,KC_KANA,KC_RALT,KC_RGUI,KC_APP,KC_RCTRL\ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/otaku_split/rev0/keymaps/sample/readme.md b/keyboards/otaku_split/rev0/keymaps/sample/readme.md new file mode 100644 index 00000000000..dbaaa2eb8ef --- /dev/null +++ b/keyboards/otaku_split/rev0/keymaps/sample/readme.md @@ -0,0 +1 @@ +# The default keymap for otaku_split \ No newline at end of file diff --git a/keyboards/otaku_split/rev0/readme.md b/keyboards/otaku_split/rev0/readme.md new file mode 100644 index 00000000000..9103843d5df --- /dev/null +++ b/keyboards/otaku_split/rev0/readme.md @@ -0,0 +1,16 @@ +# Otaku Split rev.0 + +![otaku_split](https://booth.pximg.net/c/620x620/4394ec37-d0ff-4c92-8f78-5c08d0566da6/i/1365150/9953f612-d35f-4f31-873d-2323c7b2f622_base_resized.jpg) + +Otaku Split is Japanese layout based keyboard. +rev.0 is prototype. it has MDF color plate Iron Black and Ayanami blue. + +Keyboard Maintainer: [takashiski](https://github.com/takashiski) +Hardware Supported: promicro(atmega32u4) +Hardware Availability: https://skyhigh-works.booth.pm/items/1365150 + +Make example for this keyboard (after setting up your build environment): + + make otaku_split/rev0:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/otaku_split/rev0/rev0.c b/keyboards/otaku_split/rev0/rev0.c new file mode 100644 index 00000000000..75c24b584f5 --- /dev/null +++ b/keyboards/otaku_split/rev0/rev0.c @@ -0,0 +1,51 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev0.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/otaku_split/rev0/rev0.h b/keyboards/otaku_split/rev0/rev0.h new file mode 100644 index 00000000000..c3040d23325 --- /dev/null +++ b/keyboards/otaku_split/rev0/rev0.h @@ -0,0 +1,48 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT(\ +L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06,R07,\ +L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16,R17,\ +L20,L21,L22,L23,L24,L25, R20,R21,R22,R23,R24,R25,R26, \ +L30,L31,L32,L33,L34,L35, R30,R31,R32,R33,R34,R35,R36,R37,\ +L40,L41,L42,L43,L44,L45, R40,R41,R42,R43,R44,R45,R46,R47\ +) {\ +{L00,L01,L02,L03,L04,L05,L06,KC_NO},\ +{L10,L11,L12,L13,L14,L15,L16,KC_NO},\ +{L20,L21,L22,L23,L24,L25,KC_NO,KC_NO},\ +{L30,L31,L32,L33,L34,L35,KC_NO,KC_NO},\ +{L40,L41,L42,L43,L44,L45,KC_NO,KC_NO},\ +{R00,R01,R02,R03,R04,R05,R06,R07},\ +{R10,R11,R12,R13,R14,R15,R16,R17},\ +{R20,R21,R22,R23,R24,R25,R26,KC_NO},\ +{R30,R31,R32,R33,R34,R35,R36,R37},\ +{R40,R41,R42,R43,R44,R45,R46,R47}\ +} + + diff --git a/keyboards/otaku_split/rev0/rules.mk b/keyboards/otaku_split/rev0/rules.mk new file mode 100644 index 00000000000..04e0aacb167 --- /dev/null +++ b/keyboards/otaku_split/rev0/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +SPLIT_KEYBOARD=yes diff --git a/keyboards/otaku_split/rev1/config.h b/keyboards/otaku_split/rev1/config.h new file mode 100644 index 00000000000..e15ae40d391 --- /dev/null +++ b/keyboards/otaku_split/rev1/config.h @@ -0,0 +1,255 @@ +/* +Copyright 2019 takashiski + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER takashiski +#define PRODUCT otaku_split +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C6,D7,E6,B4,B5 } +#define MATRIX_COL_PINS { F4,F5,F6,F7,B1,B3,B2,B6 } +#define MATRIX_ROW_PINS_RIGHT { B5,B4,E6,D7,C6 } +#define MATRIX_COL_PINS_RIGHT { B6,B2,B3,B1,F7,F6,F5,F4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define SPLIT_HAND_PIN D2 //fix pin. HIGH is left, LOW is right + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/otaku_split/rev1/info.json b/keyboards/otaku_split/rev1/info.json new file mode 100644 index 00000000000..9ee27337549 --- /dev/null +++ b/keyboards/otaku_split/rev1/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "otaku split rev.1", + "url": "http", + "maintainer": "takashiski", + "width": 17.75, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"\u534a\u89d2", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"Insert", "x":8.75, "y":0}, {"label":"&", "x":9.75, "y":0}, {"label":"*", "x":10.75, "y":0}, {"label":"(", "x":11.75, "y":0}, {"label":")", "x":12.75, "y":0}, {"label":"=", "x":13.75, "y":0}, {"label":"~", "x":14.75, "y":0}, {"label":"|", "x":15.75, "y":0}, {"label":"Backspace", "x":16.75, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"7", "x":6.5, "y":1}, {"label":"Y", "x":9.25, "y":1}, {"label":"U", "x":10.25, "y":1}, {"label":"I", "x":11.25, "y":1}, {"label":"O", "x":12.25, "y":1}, {"label":"P", "x":13.25, "y":1}, {"label":"`", "x":14.25, "y":1}, {"label":"{", "x":15.25, "y":1}, {"label":"Enter", "x":16.5, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":9.5, "y":2}, {"label":"J", "x":10.5, "y":2}, {"label":"K", "x":11.5, "y":2}, {"label":"L", "x":12.5, "y":2}, {"label":"+", "x":13.5, "y":2}, {"label":"*", "x":14.5, "y":2}, {"label":"}", "x":15.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"1", "x":9, "y":3}, {"label":"N", "x":10, "y":3}, {"label":"M", "x":11, "y":3}, {"label":"<", "x":12, "y":3}, {"label":">", "x":13, "y":3}, {"label":"?", "x":14, "y":3}, {"label":"_", "x":15, "y":3}, {"label":"Shift", "x":16, "y":3, "w":1.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4}, {"label":"Alt", "x":2.25, "y":4, "w":1.25}, {"label":"\u7121\u5909\u63db", "x":3.5, "y":4}, {"label":"2", "x":4.5, "y":4}, {"label":"\u2190", "x":5.5, "y":4}, {"label":"\u2193", "x":6.5, "y":4}, {"label":"\u2191", "x":8.75, "y":4}, {"label":"\u2192", "x":9.75, "y":4}, {"label":".", "x":10.75, "y":4}, {"label":"\u5909\u63db", "x":11.75, "y":4, "w":1.25}, {"label":"\u30ab\u30bf\u30ab\u30ca", "x":13, "y":4, "w":1.25}, {"label":"Alt", "x":14.25, "y":4, "w":1.25}, {"label":"Menu", "x":15.5, "y":4}, {"label":"Ctrl", "x":16.5, "y":4, "w":1.25}] + } + } +} diff --git a/keyboards/otaku_split/rev1/keymaps/default/config.h b/keyboards/otaku_split/rev1/keymaps/default/config.h new file mode 100644 index 00000000000..25cddc6bb78 --- /dev/null +++ b/keyboards/otaku_split/rev1/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/otaku_split/rev1/keymaps/default/keymap.c b/keyboards/otaku_split/rev1/keymaps/default/keymap.c new file mode 100644 index 00000000000..c708e53eb29 --- /dev/null +++ b/keyboards/otaku_split/rev1/keymaps/default/keymap.c @@ -0,0 +1,58 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + BASE=0, + CURSOR +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT( + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS ,KC_EQL,KC_JYEN,KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_ENT, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,KC_NUHS, + KC_LSHIFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH,KC_RO,KC_RSHIFT, + KC_LCTRL, KC_LGUI,KC_LALT,KC_MHEN,LT(CURSOR,KC_TAB),KC_SPC,KC_SPC, LT(CURSOR,KC_SPC),KC_ENT,KC_BSPC,KC_HENK,LT(CURSOR,KC_KANA),KC_RALT,KC_APP,KC_RCTRL + ), + [CURSOR] = LAYOUT( + KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_JYEN,KC_DEL, + KC_TAB, KC_Q, KC_UP, KC_E, KC_R, KC_T, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_PSCR, + KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_F, KC_G, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_SCLN, KC_QUOT,KC_NUHS, + KC_LSHIFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_END,KC_UP,KC_HOME, + KC_LCTRL, KC_LGUI,KC_LALT,KC_MHEN,KC_TRNS,KC_SPC,KC_SPC, KC_TRNS,KC_ENT,KC_BSPC,KC_HENK,KC_TRNS,KC_LEFT,KC_DOWN,KC_RIGHT + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/otaku_split/rev1/keymaps/default/readme.md b/keyboards/otaku_split/rev1/keymaps/default/readme.md new file mode 100644 index 00000000000..dbaaa2eb8ef --- /dev/null +++ b/keyboards/otaku_split/rev1/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for otaku_split \ No newline at end of file diff --git a/keyboards/otaku_split/rev1/keymaps/sample/config.h b/keyboards/otaku_split/rev1/keymaps/sample/config.h new file mode 100644 index 00000000000..25cddc6bb78 --- /dev/null +++ b/keyboards/otaku_split/rev1/keymaps/sample/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/otaku_split/rev1/keymaps/sample/keymap.c b/keyboards/otaku_split/rev1/keymaps/sample/keymap.c new file mode 100644 index 00000000000..6875f462f4a --- /dev/null +++ b/keyboards/otaku_split/rev1/keymaps/sample/keymap.c @@ -0,0 +1,85 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +// Defines the keycodes used by our macros in process_record_user + +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + +#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 +#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +enum layers{ + BASE=0 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_wrapper(\ + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS ,KC_EQL,KC_JYEN,KC_BSPC,\ + KC_TAB, _________________QWERTY_L1_________________,KC_Y, _________________QWERTY_R1_________________,KC_LBRC,KC_RBRC,KC_ENT,\ + KC_CAPS, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,KC_QUOT,KC_NUHS,\ + KC_LSHIFT,_________________QWERTY_L3_________________, KC_B,_________________QWERTY_R3_________________,KC_RO,KC_RSHIFT,\ + KC_LCTRL, KC_LGUI,KC_LALT,KC_MHEN,KC_TAB,KC_SPC,KC_SPC, KC_SPC,KC_ENT,KC_BSPC,KC_HENK,KC_KANA,KC_RALT,KC_APP,KC_RCTRL\ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/otaku_split/rev1/keymaps/sample/readme.md b/keyboards/otaku_split/rev1/keymaps/sample/readme.md new file mode 100644 index 00000000000..dbaaa2eb8ef --- /dev/null +++ b/keyboards/otaku_split/rev1/keymaps/sample/readme.md @@ -0,0 +1 @@ +# The default keymap for otaku_split \ No newline at end of file diff --git a/keyboards/otaku_split/rev1/readme.md b/keyboards/otaku_split/rev1/readme.md new file mode 100644 index 00000000000..592c82641e4 --- /dev/null +++ b/keyboards/otaku_split/rev1/readme.md @@ -0,0 +1,19 @@ +# otaku_split + +![otaku_split](https://booth.pximg.net/c/620x620/4394ec37-d0ff-4c92-8f78-5c08d0566da6/i/1398595/511647ef-43e4-4f50-b56d-a0166c090fae_base_resized.jpg) +![otaku_split_bottom](https://booth.pximg.net/c/620x620/4394ec37-d0ff-4c92-8f78-5c08d0566da6/i/1398595/cc9eb113-46a9-42fa-aaed-c4007efbe45e_base_resized.jpg) + + +This is JP layout based split keyboards. + + + +Keyboard Maintainer: [takashiski](https://github.com/takashiski) +Hardware Supported: promicro(atmega32u4) on Otaku Split rev.1 PCB +Hardware Availability: https://skyhigh-works.booth.pm/items/1398595 + +Make example for this keyboard (after setting up your build environment): + + make otaku_split/rev1:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/otaku_split/rev1/rev1.c b/keyboards/otaku_split/rev1/rev1.c new file mode 100644 index 00000000000..88b42eb95d3 --- /dev/null +++ b/keyboards/otaku_split/rev1/rev1.c @@ -0,0 +1,51 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev1.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/otaku_split/rev1/rev1.h b/keyboards/otaku_split/rev1/rev1.h new file mode 100644 index 00000000000..a1f71f03385 --- /dev/null +++ b/keyboards/otaku_split/rev1/rev1.h @@ -0,0 +1,47 @@ +/* Copyright 2019 takashiski + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT(\ +L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06,R07,R17,\ +L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16,R27,\ +L20,L21,L22,L23,L24,L25, R20,R21,R22,R23,R24,R25,R26, \ +L30,L31,L32,L33,L34,L35, R30,R31,R32,R33,R34,R35,R36,R37,\ +L40,L41,L42,L43,L44,L45,L46, R40,R41,R42,R43,R44,R45,R46,R47\ +) {\ +{L00,L01,L02,L03,L04,L05,L06,KC_NO},\ +{L10,L11,L12,L13,L14,L15,L16,KC_NO},\ +{L20,L21,L22,L23,L24,L25,KC_NO,KC_NO},\ +{L30,L31,L32,L33,L34,L35,KC_NO,KC_NO},\ +{L40,L41,L42,L43,L44,L45,L46,KC_NO},\ +{R00,R01,R02,R03,R04,R05,R06,R07},\ +{R10,R11,R12,R13,R14,R15,R16,R17},\ +{R20,R21,R22,R23,R24,R25,R26,R27},\ +{R30,R31,R32,R33,R34,R35,R36,R37},\ +{R40,R41,R42,R43,R44,R45,R46,R47}\ +} + diff --git a/keyboards/otaku_split/rev1/rules.mk b/keyboards/otaku_split/rev1/rules.mk new file mode 100644 index 00000000000..04e0aacb167 --- /dev/null +++ b/keyboards/otaku_split/rev1/rules.mk @@ -0,0 +1,81 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +SPLIT_KEYBOARD=yes diff --git a/keyboards/paladin64/config.h b/keyboards/paladin64/config.h index a5280f4d48b..8d7cef24837 100755 --- a/keyboards/paladin64/config.h +++ b/keyboards/paladin64/config.h @@ -97,7 +97,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -105,11 +105,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN D0 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/paladin64/keymaps/default/keymap.c b/keyboards/paladin64/keymaps/default/keymap.c index 8a3f57c0bf2..63c1f1f0b38 100755 --- a/keyboards/paladin64/keymaps/default/keymap.c +++ b/keyboards/paladin64/keymaps/default/keymap.c @@ -1,6 +1,5 @@ #include QMK_KEYBOARD_H -const uint16_t PROGMEM fn_actions[] = {}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY */ @@ -45,15 +44,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // keyevent_t event = record->event; - - switch (id) { - - } - return MACRO_NONE; -} - void matrix_init_user(void) { } diff --git a/keyboards/paladin64/readme.md b/keyboards/paladin64/readme.md index 41f66e2ac0b..8d62bb6b717 100644 --- a/keyboards/paladin64/readme.md +++ b/keyboards/paladin64/readme.md @@ -16,4 +16,4 @@ Or to make and flash: make paladin64:default:dfu -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/panc60/config.h b/keyboards/panc60/config.h index 703141bebfe..921d8da303a 100644 --- a/keyboards/panc60/config.h +++ b/keyboards/panc60/config.h @@ -34,13 +34,7 @@ along with this program. If not, see . #define UNUSED_PINS #define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 -#define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/panc60/i2c.c b/keyboards/panc60/i2c.c deleted file mode 100644 index e8c4455ad1b..00000000000 --- a/keyboards/panc60/i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#include -#include - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif diff --git a/keyboards/panc60/matrix.c b/keyboards/panc60/matrix.c deleted file mode 100644 index cf0f63837b9..00000000000 --- a/keyboards/panc60/matrix.c +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2018 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "matrix.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { } - -__attribute__ ((weak)) -void matrix_scan_user(void) { } - -// #define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } -// #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_init(void) { - - // disables JTAG so we can use them as columns - MCUCSR = (1< #include "action_layer.h" -#include "i2c.h" +#include "i2c_master.h" #include "quantum.h" __attribute__ ((weak)) @@ -44,7 +44,7 @@ void rgblight_set(void) { } i2c_init(); - i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); } #endif diff --git a/keyboards/panc60/panc60.h b/keyboards/panc60/panc60.h index 95dcb1f90be..ee4569c615c 100644 --- a/keyboards/panc60/panc60.h +++ b/keyboards/panc60/panc60.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef PANC60_H -#define PANC60_H +#pragma once #include "quantum.h" @@ -67,5 +66,3 @@ { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ { KC_NO, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, K4A, KC_NO, K4C, KC_NO, KC_NO } \ } - -#endif diff --git a/keyboards/panc60/readme.md b/keyboards/panc60/readme.md index 05ac3d72bee..3312a07ce73 100644 --- a/keyboards/panc60/readme.md +++ b/keyboards/panc60/readme.md @@ -14,6 +14,8 @@ Make example for this keyboard (after setting up your build environment): Flashing +**Reset Key:** Hold down the key located at `K40`, commonly programmed as left control while plugging in the keyboard. + ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. To put the panc60 into reset, hold left control while plugging in. @@ -36,9 +38,9 @@ macOS: ``` 3. Install the following packages: ``` - brew install python - brew install pyusb - brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb 4. Place your keyboard into reset. 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. diff --git a/keyboards/panc60/rules.mk b/keyboards/panc60/rules.mk index 588562a95b4..5531807f185 100644 --- a/keyboards/panc60/rules.mk +++ b/keyboards/panc60/rules.mk @@ -31,7 +31,7 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes +BOOTMAGIC_ENABLE = no MOUSEKEY_ENABLE = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes @@ -43,8 +43,7 @@ RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 # custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c +SRC = i2c_master.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/panc60/usbconfig.h b/keyboards/panc60/usbconfig.h index d2d848fcdc8..54a7d20f142 100644 --- a/keyboards/panc60/usbconfig.h +++ b/keyboards/panc60/usbconfig.h @@ -8,8 +8,7 @@ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -392,5 +391,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/pdxkbc/config.h b/keyboards/pdxkbc/config.h new file mode 100644 index 00000000000..c547bb0908f --- /dev/null +++ b/keyboards/pdxkbc/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 Franklin Harding + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Franklin Harding +#define PRODUCT pdxkbc +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 2 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F7, B6, F4 } +#define MATRIX_COL_PINS { D1, E6 } +#define UNUSED_PINS { D0, D4, C6, D7, B4, B5, F5, F6, B1, B3, B2 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/pdxkbc/info.json b/keyboards/pdxkbc/info.json new file mode 100644 index 00000000000..6c32ea75371 --- /dev/null +++ b/keyboards/pdxkbc/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "pdxkbc", + "url": "", + "maintainer": "qmk", + "width": 2, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [{"label":"reddit", "x":0, "y":0}, {"label":"discord", "x":1, "y":0}, {"label":"badge", "x":0, "y":1}, {"label":"hack", "x":1, "y":1}, {"label":"volu", "x":0, "y":2}, {"label":"vold", "x":1, "y":2}] + } + } +} \ No newline at end of file diff --git a/keyboards/pdxkbc/keymaps/default/config.h b/keyboards/pdxkbc/keymaps/default/config.h new file mode 100644 index 00000000000..355f2db5272 --- /dev/null +++ b/keyboards/pdxkbc/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Franklin Harding + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/pdxkbc/keymaps/default/keymap.c b/keyboards/pdxkbc/keymaps/default/keymap.c new file mode 100644 index 00000000000..feb34470498 --- /dev/null +++ b/keyboards/pdxkbc/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2019 Franklin Harding + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + PDXKBCREDDIT = SAFE_RANGE, + PDXKBCDISCORD, + BADGELIFE, + HACKTHEPLANET +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + PDXKBCREDDIT, PDXKBCDISCORD, + BADGELIFE, HACKTHEPLANET, + KC_VOLU, KC_VOLD + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case PDXKBCREDDIT: + if (record->event.pressed) { + SEND_STRING("https://reddit.com/r/pdxkbc" SS_TAP(X_ENTER)); + } + break; + case PDXKBCDISCORD: + if (record->event.pressed) { + SEND_STRING("https://discordapp.com/invite/bHwjHXh" SS_TAP(X_ENTER)); + } + break; + case BADGELIFE: + if (record->event.pressed) { + SEND_STRING("#badgelife" SS_TAP(X_ENTER)); + } + break; + case HACKTHEPLANET: + if (record->event.pressed) { + SEND_STRING("HACK THE PLANET!" SS_TAP(X_ENTER)); + } + break; + } + + return true; +} + +void matrix_init_user(void) {} + +void matrix_scan_user(void) {} + +void led_set_user(uint8_t usb_led) {} diff --git a/keyboards/pdxkbc/keymaps/default/readme.md b/keyboards/pdxkbc/keymaps/default/readme.md new file mode 100644 index 00000000000..1371be84896 --- /dev/null +++ b/keyboards/pdxkbc/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for pdxkbc \ No newline at end of file diff --git a/keyboards/pdxkbc/pdxkbc.c b/keyboards/pdxkbc/pdxkbc.c new file mode 100644 index 00000000000..26c2d2fe4fd --- /dev/null +++ b/keyboards/pdxkbc/pdxkbc.c @@ -0,0 +1,51 @@ +/* Copyright 2019 Franklin Harding + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "pdxkbc.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/pdxkbc/pdxkbc.h b/keyboards/pdxkbc/pdxkbc.h new file mode 100644 index 00000000000..4700252a66d --- /dev/null +++ b/keyboards/pdxkbc/pdxkbc.h @@ -0,0 +1,37 @@ +/* Copyright 2019 Franklin Harding + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, \ + k10, k11, \ + k20, k21 \ +) \ +{ \ + { k00, k01 }, \ + { k10, k11 }, \ + { k20, k21 }, \ +} diff --git a/keyboards/pdxkbc/readme.md b/keyboards/pdxkbc/readme.md new file mode 100644 index 00000000000..cb2307465a2 --- /dev/null +++ b/keyboards/pdxkbc/readme.md @@ -0,0 +1,17 @@ +# pdxkbc + +![pdxkbc](https://i.imgur.com/GgNvZcW.jpg) + +A macropad made for the Portland Keyboard Club and DEF CON + +Keyboard Maintainer: [Franklin Harding](https://github.com/fharding1) + +Hardware Supported: https://github.com/fharding1/pdxkbc-badge + +Hardware Availability: https://github.com/fharding1/pdxkbc-badge + +Make example for this keyboard (after setting up your build environment): + + make pdxkbc:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/pdxkbc/rules.mk b/keyboards/pdxkbc/rules.mk new file mode 100644 index 00000000000..bc370be0397 --- /dev/null +++ b/keyboards/pdxkbc/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/pearl/README.md b/keyboards/pearl/README.md deleted file mode 100644 index ec54ba80f50..00000000000 --- a/keyboards/pearl/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# Pearl 40% - -Pearl 40% is a keyboard designed by Koobaczech. It uses an Atmel -ATMEGA32A MCU. - -## Compiling and flashing - -These instructions are for building and flashing your Pearl 40% without -Bootmapper Client. - -### Requirements - -#### Windows - -(to be written, help needed) - -#### Mac - -Apart from regular QMK and AVR dependencies you need to install -`bootloadHID`. You can install it with `homebrew` as follows: - - $ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb - -If you don't use `homebrew` you can try following the compiling -instructions defined below in the Linux section. - -#### Linux - -For Linux you require all regular QMK dependencies, but make sure you're -using `gcc-avr` version 4.9 or higher. 4.8 and lower do not contain the -proper definitions for ATMEGA32A MCUs and QMK will fail while attempting -to compile a HEX for Pearl 40%. - -E.g. you cannot compile Pearl 40% HEX on a regular Ubuntu 14.04 as -`gcc-avr` version is maxed to 4.8 on it. - -Additionally you need an operational `bootloadHID` binary. - -You can install `bootloadHID` by taking the following steps: - - $ git clone https://github.com/robertgzr/bootloadHID ~/tmp/bootloadHIDsrc - $ cd ~/tmp/bootloadHIDsrc/commandline - $ make VENDORID=0x16c0 PRODUCTID=0x05DF # vid and pid for atmega32a - $ chmod +x bootloadHID && cp bootloadHID /usr/bin/bootloadHID - -Running `which bootloadHID` should return `/usr/bin/bootloadHID`. - -### Compiling - -Enter the QMK root directory and compile a keymap with the following -command: - - $ make pearl: - -where `` is a layout directory under the `pearl` directory. - -QMK should compile a HEX (called `pearl_.hex`) for you, which -you can flash using `bootloadHID`. - -### Flashing - -To enable Pearl 40% bootloading mode, unplug the keyboard, then plug it -in while holding `Esc` at the same time (the top-leftmost switch on the -PCB, next to the USB connector). Once the board is in bootload mode, -issue the following command (you might require `sudo` to perform the -command): - - # assuming we're still in the QMK root dir where you compiled a HEX into - $ bootloadHID -r ./pearl_.hex - -You should see something similar to - - > Page size = - > Device size = ; remaining - > Uploading bytes starting at 0 (0x0) - > ... - -where `` should be slowly increasing as the HEX is being -flashed to the board. If there is some warning about `resource busy` it -should still work OK. - -Once done the board underglow should turn red and the new firmware has -been flashed. If you can't type on the board try plugging it in again -(without holding any keys to prevent accidentally setting it into -bootload mode again). diff --git a/keyboards/pearl/config.h b/keyboards/pearl/config.h index c0594bf91ab..3dbe5ee0306 100644 --- a/keyboards/pearl/config.h +++ b/keyboards/pearl/config.h @@ -35,16 +35,12 @@ along with this program. If not, see . #define MATRIX_ROWS 4 #define MATRIX_COLS 13 -#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } -#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6} +#define MATRIX_ROW_PINS { B0, B1, B2, B3 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3} #define UNUSED_PINS #define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) +#define DEBOUNCE 5 #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION - diff --git a/keyboards/pearl/i2c.c b/keyboards/pearl/i2c.c deleted file mode 100644 index a4f95213524..00000000000 --- a/keyboards/pearl/i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#include -#include - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif diff --git a/keyboards/pearl/keymaps/jetpacktuxedo/keymap.c b/keyboards/pearl/keymaps/jetpacktuxedo/keymap.c index b94fb673ff8..759c6fdc7d2 100644 --- a/keyboards/pearl/keymaps/jetpacktuxedo/keymap.c +++ b/keyboards/pearl/keymaps/jetpacktuxedo/keymap.c @@ -10,7 +10,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [1] = LAYOUT_all( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_QUOT, KC_TRNS, - KC_TRNS, RGB_TOG, RGB_SMOD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [2] = LAYOUT_all( diff --git a/keyboards/pearl/matrix.c b/keyboards/pearl/matrix.c deleted file mode 100644 index 57aa36b5ff7..00000000000 --- a/keyboards/pearl/matrix.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include - -#include "matrix.h" - -#ifndef DEBOUNCE -#define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_init(void) { - // all outputs for rows high - DDRB = 0xFF; - PORTB = 0xFF; - // all inputs for columns - DDRA = 0x00; - DDRC &= ~(0x111111<<2); - DDRD &= ~(1<> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x; -} - -uint8_t matrix_scan(void) { - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - matrix_set_row_status(row); - _delay_us(5); - - matrix_row_t cols = ( - // cols 0..7, PORTA 0 -> 7 - (~PINA) & 0xFF - ) | ( - // cols 8..13, PORTC 7 -> 0 - bit_reverse((~PINC) & 0xFF) << 8 - ) | ( - // col 14, PORTD 7 - ((~PIND) & (1 << PIND7)) << 7 - ); - - if (matrix_debouncing[row] != cols) { - matrix_debouncing[row] = cols; - debouncing = DEBOUNCE; - } - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_user(); - - return 1; -} - -inline matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - -void matrix_print(void) { -} diff --git a/keyboards/pearl/pearl.c b/keyboards/pearl/pearl.c index 3bbadb0a7fc..c8cd8a8609c 100644 --- a/keyboards/pearl/pearl.c +++ b/keyboards/pearl/pearl.c @@ -15,16 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "pearl.h" #include "rgblight.h" -#include "backlight.h" - -#include - -#include "action_layer.h" -#include "i2c.h" +#include "i2c_master.h" #include "quantum.h" +#ifdef RGBLIGHT_ENABLE extern rgblight_config_t rgblight_config; void rgblight_set(void) { @@ -37,23 +32,59 @@ void rgblight_set(void) { } i2c_init(); - i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); } +#endif -void backlight_init_ports(void) { - DDRD |= (1<<4); - PORTD &= ~(1<<4); +void matrix_init_kb(void) { +#ifdef RGBLIGHT_ENABLE + if (rgblight_config.enable) { + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + } +#endif + // call user level keymaps, if any + matrix_init_user(); } -void backlight_set(uint8_t level) { - if (level > 0) { - PORTD |= (1<<4); - } else { - PORTD &= ~(1<<4); - } +void matrix_scan_kb(void) { +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif + matrix_scan_user(); + /* Nothing else for now. */ } __attribute__ ((weak)) void matrix_scan_user(void) { - rgblight_task(); } + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // turn backlight LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} \ No newline at end of file diff --git a/keyboards/pearl/pearl.h b/keyboards/pearl/pearl.h index 6f5fbce5dbf..72df1595def 100644 --- a/keyboards/pearl/pearl.h +++ b/keyboards/pearl/pearl.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef PEARL_H -#define PEARL_H +#pragma once #include "quantum.h" #include "pearl.h" @@ -56,6 +55,3 @@ along with this program. If not, see . { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO}, \ { K30, K31, KC_NO, KC_NO, KC_NO, K35, KC_NO, KC_NO, KC_NO, K39, K3A, KC_NO, KC_NO}, \ } - - -#endif diff --git a/keyboards/pearl/readme.md b/keyboards/pearl/readme.md new file mode 100644 index 00000000000..c39d86cf3d0 --- /dev/null +++ b/keyboards/pearl/readme.md @@ -0,0 +1,47 @@ +# Pearl 40% + +Pearl 40% is a keyboard designed by Koobaczech. It uses an Atmel +ATMEGA32A MCU. + +Keyboard Maintainer: [Ethan Madden](https://github.com/jetpacktuxedo) +Hardware Supported: Pearl +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=92259.0) + +Make example for this keyboard (after setting up your build environment): + + make pearl:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +**Reset Key:** Hold down the key located at `K00`. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +**Please Note:** You will need to use the `EEP_RST` keycode first, followed by unplugging/replugging the board to get RGB underglow effects to work. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/pearl/rules.mk b/keyboards/pearl/rules.mk index c5b61c6d392..4db92d1219c 100644 --- a/keyboards/pearl/rules.mk +++ b/keyboards/pearl/rules.mk @@ -26,13 +26,13 @@ F_CPU = 12000000 # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes @@ -43,8 +43,7 @@ RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 # custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c +SRC = i2c_master.c # programming options -PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex \ No newline at end of file +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/pearl/usbconfig.h b/keyboards/pearl/usbconfig.h index d2d848fcdc8..54a7d20f142 100644 --- a/keyboards/pearl/usbconfig.h +++ b/keyboards/pearl/usbconfig.h @@ -8,8 +8,7 @@ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -392,5 +391,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/peiorisboards/ixora/boards/GENERIC_STM32_F042X6/board.c b/keyboards/peiorisboards/ixora/boards/GENERIC_STM32_F042X6/board.c new file mode 100644 index 00000000000..19adfb933e5 --- /dev/null +++ b/keyboards/peiorisboards/ixora/boards/GENERIC_STM32_F042X6/board.c @@ -0,0 +1,101 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/peiorisboards/ixora/boards/GENERIC_STM32_F042X6/board.h b/keyboards/peiorisboards/ixora/boards/GENERIC_STM32_F042X6/board.h new file mode 100644 index 00000000000..ee9d31e04ad --- /dev/null +++ b/keyboards/peiorisboards/ixora/boards/GENERIC_STM32_F042X6/board.h @@ -0,0 +1,896 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +#ifndef _BOARD_H +#define _BOARD_H + +/* + * Setup for STMicroelectronics STM32 Nucleo32-F042K6 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F042X6 +#define BOARD_NAME "Generic STM32F042 PCB" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +/* + * MCU type as defined in the ST header. + */ +#define STM32F042x6 + +/* + * IO pins assignments. + */ +#define GPIOA_PIN0 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_PIN11 11U +#define GPIOA_PIN12 12U +#define GPIOA_PIN13 13U +#define GPIOA_PIN14 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_PIN13 13U +#define GPIOB_PIN14 14U +#define GPIOB_PIN15 15U + +#define GPIOC_PIN0 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_PIN6 6U +#define GPIOC_PIN7 7U +#define GPIOC_PIN8 8U +#define GPIOC_PIN9 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_PIN14 14U +#define GPIOC_PIN15 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_PIN0 0U +#define GPIOF_PIN1 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ + +#define LINE_BOOT0 PAL_LINE(GPIOB, 8U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - COL5 + * PA1 - COL4 + * PA2 - COL3 + * PA3 - COL2 + * PA4 - COL1 + * PA5 - COL0 + * PA6 - ROW4 + * PA7 - ROW3 + * PA8 - NC + * PA9 - ROW1 + * PA10 - ROW0 + * PA11 - USB_DM + * PA12 - USB_DP + * PA13 - COL15/SWDIO (for now, COL15) + * PA14 - COL14/SWCLK (for now, COL14) + * PA15 - COL13 + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_PIN11) | \ + PIN_MODE_INPUT(GPIOA_PIN12) | \ + PIN_MODE_INPUT(GPIOA_PIN13) | \ + PIN_MODE_INPUT(GPIOA_PIN14) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN11) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_PIN11) | \ + PIN_ODR_HIGH(GPIOA_PIN12) | \ + PIN_ODR_HIGH(GPIOA_PIN13) | \ + PIN_ODR_HIGH(GPIOA_PIN14) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - ROW2 + * PB1 - RGB_D + * PB2 - PIN2 (input pullup). + * PB3 - COL12 + * PB4 - COL11 + * PB5 - COL10 + * PB6 - COL9 + * PB7 - COL8 + * PB8 - BOOT0 (set as output for STM32F042) + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - PIN13 (input pullup). + * PB14 - PIN14 (input pullup). + * PB15 - PIN15 (input pullup). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_OUTPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_OUTPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_INPUT(GPIOB_PIN13) | \ + PIN_MODE_INPUT(GPIOB_PIN14) | \ + PIN_MODE_INPUT(GPIOB_PIN15)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLDOWN(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN15)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_PIN13) | \ + PIN_ODR_HIGH(GPIOB_PIN14) | \ + PIN_ODR_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN15, 0U)) + +/* + * GPIOC setup: + * + * PC0 - PIN0 (input pullup). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - PIN6 (input pullup). + * PC7 - PIN7 (input pullup). + * PC8 - PIN8 (input pullup). + * PC9 - PIN9 (input pullup). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - PIN14 (input pullup). + * PC15 - PIN15 (input pullup). + */ +#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_INPUT(GPIOC_PIN6) | \ + PIN_MODE_INPUT(GPIOC_PIN7) | \ + PIN_MODE_INPUT(GPIOC_PIN8) | \ + PIN_MODE_INPUT(GPIOC_PIN9) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_PIN14) | \ + PIN_MODE_INPUT(GPIOC_PIN15)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN15)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_HIGH(GPIOC_PIN6) | \ + PIN_ODR_HIGH(GPIOC_PIN7) | \ + PIN_ODR_HIGH(GPIOC_PIN8) | \ + PIN_ODR_HIGH(GPIOC_PIN9) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_PIN14) | \ + PIN_ODR_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN7, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN15, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - COL7 + * PF1 - COL6 + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_PIN0) | \ + PIN_MODE_INPUT(GPIOF_PIN1) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \ + PIN_ODR_HIGH(GPIOF_PIN1) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H */ diff --git a/keyboards/peiorisboards/ixora/boards/GENERIC_STM32_F042X6/board.mk b/keyboards/peiorisboards/ixora/boards/GENERIC_STM32_F042X6/board.mk new file mode 100644 index 00000000000..bbeb5bbff72 --- /dev/null +++ b/keyboards/peiorisboards/ixora/boards/GENERIC_STM32_F042X6/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F042X6/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F042X6 diff --git a/keyboards/peiorisboards/ixora/bootloader_defs.h b/keyboards/peiorisboards/ixora/bootloader_defs.h new file mode 100644 index 00000000000..4994be9c24c --- /dev/null +++ b/keyboards/peiorisboards/ixora/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC400 \ No newline at end of file diff --git a/keyboards/peiorisboards/ixora/chconf.h b/keyboards/peiorisboards/ixora/chconf.h new file mode 100644 index 00000000000..b836a3b99cd --- /dev/null +++ b/keyboards/peiorisboards/ixora/chconf.h @@ -0,0 +1,521 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ \ No newline at end of file diff --git a/keyboards/peiorisboards/ixora/config.h b/keyboards/peiorisboards/ixora/config.h new file mode 100644 index 00000000000..bf74b13cc1c --- /dev/null +++ b/keyboards/peiorisboards/ixora/config.h @@ -0,0 +1,24 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0C61 +#define DEVICE_VER 0x00C6 +#define MANUFACTURER PeiorisBoards +#define PRODUCT Ixora Rev1 +#define DESCRIPTION 6key Macropad + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 6 + +#define MATRIX_ROW_PINS { A0 } +#define MATRIX_COL_PINS { B4, A15, B3, A1, B6, B5 } + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 0 diff --git a/keyboards/peiorisboards/ixora/halconf.h b/keyboards/peiorisboards/ixora/halconf.h new file mode 100644 index 00000000000..bc2b66f2e1e --- /dev/null +++ b/keyboards/peiorisboards/ixora/halconf.h @@ -0,0 +1,350 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 256 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ \ No newline at end of file diff --git a/keyboards/peiorisboards/ixora/info.json b/keyboards/peiorisboards/ixora/info.json new file mode 100644 index 00000000000..a1818632cb8 --- /dev/null +++ b/keyboards/peiorisboards/ixora/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "Ixora", + "url": "", + "maintainer": "Peioris", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT_full": { + "layout": [{"label":"1", "x":0, "y":0}, {"label":"2", "x":1, "y":0}, {"label":"3", "x":2, "y":0}, {"label":"Caps Lock", "x":0, "y":1}, {"label":"Num Lock", "x":1, "y":1}, {"label":"Scroll Lock", "x":2, "y":1}] + }, + "LAYOUT_blocker_right": { + "layout": [{"label":"1", "x":0, "y":0}, {"label":"2", "x":1, "y":0}, {"label":"Caps Lock", "x":0, "y":1}, {"label":"Num Lock", "x":1, "y":1}, {"label":"Scroll Lock", "x":2, "y":1}] + }, + "LAYOUT_blocker_left": { + "layout": [{"label":"2", "x":1, "y":0}, {"label":"3", "x":2, "y":0}, {"label":"Caps Lock", "x":0, "y":1}, {"label":"Num Lock", "x":1, "y":1}, {"label":"Scroll Lock", "x":2, "y":1}] + }, + "LAYOUT_arrows": { + "layout": [{"label":"\u2191", "x":1, "y":0}, {"label":"\u2190", "x":0, "y":1}, {"label":"\u2193", "x":1, "y":1}, {"label":"\u2192", "x":2, "y":1}] + } + } + } diff --git a/keyboards/peiorisboards/ixora/ixora.c b/keyboards/peiorisboards/ixora/ixora.c new file mode 100644 index 00000000000..7996db629f2 --- /dev/null +++ b/keyboards/peiorisboards/ixora/ixora.c @@ -0,0 +1,43 @@ +#include "ixora.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(A8); + setPinOutput(A9); + setPinOutput(A10); + writePinLow(A8); + writePinLow(A9); + writePinLow(A10); + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(A10); + } else { + writePinLow(A10); + } + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(A9); + } else { + writePinLow(A9); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(A8); + } else { + writePinLow(A8); + } + led_set_user(usb_led); +} diff --git a/keyboards/peiorisboards/ixora/ixora.h b/keyboards/peiorisboards/ixora/ixora.h new file mode 100644 index 00000000000..92cf6586a69 --- /dev/null +++ b/keyboards/peiorisboards/ixora/ixora.h @@ -0,0 +1,40 @@ +#pragma once + +#define XXX KC_NO + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. + +#define LAYOUT_full( \ + K00, K01, K02, \ + K03, K04, K05 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05 } \ +} + +#define LAYOUT_blocker_right( \ + K00, K01, \ + K03, K04, K05 \ +) \ +{ \ + { K00, K01, XXX, K03, K04, K05 } \ +} + +#define LAYOUT_blocker_left( \ + K01, K02, \ + K03, K04, K05 \ +) \ +{ \ + { XXX, K01, K02, K03, K04, K05 } \ +} + +#define LAYOUT_arrows( \ + K01, \ + K03, K04, K05 \ +) \ +{ \ + { XXX, K01, XXX, K03, K04, K05 } \ +} + diff --git a/keyboards/peiorisboards/ixora/keymaps/default/keymap.c b/keyboards/peiorisboards/ixora/keymaps/default/keymap.c new file mode 100644 index 00000000000..85a64685155 --- /dev/null +++ b/keyboards/peiorisboards/ixora/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +/* Copyright 2018 Peioris + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------. + * |RESET| 2 | 3 | + * |-----------------| + * |Caps |NmLk |ScLk | + * `-----------------' + */ +[0] = LAYOUT_full( + RESET, KC_2, KC_3, + KC_CAPS, KC_NLCK, KC_SLCK) +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/peiorisboards/ixora/keymaps/wntrmln/keymap.c b/keyboards/peiorisboards/ixora/keymaps/wntrmln/keymap.c new file mode 100644 index 00000000000..3e08c78015c --- /dev/null +++ b/keyboards/peiorisboards/ixora/keymaps/wntrmln/keymap.c @@ -0,0 +1,26 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------. + * |RESET| 2 | 3 | + * |-----------------| + * |Caps |NmLk |ScLk | + * `-----------------' + */ +[0] = LAYOUT_full( + KC_PSCR, KC_MUTE, LGUI(KC_1), + KC_MPRV, KC_MPLY, KC_MNXT) +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/peiorisboards/ixora/mcuconf.h b/keyboards/peiorisboards/ixora/mcuconf.h new file mode 100644 index 00000000000..4643e9f92e8 --- /dev/null +++ b/keyboards/peiorisboards/ixora/mcuconf.h @@ -0,0 +1,168 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ \ No newline at end of file diff --git a/keyboards/peiorisboards/ixora/readme.md b/keyboards/peiorisboards/ixora/readme.md new file mode 100644 index 00000000000..1a011ba9ad8 --- /dev/null +++ b/keyboards/peiorisboards/ixora/readme.md @@ -0,0 +1,22 @@ +Ixora +========= + +[Ixora](https://i.imgur.com/GqDk3XY.png) + + +Ixora is an ARM-powered 6-key macropad with a USB connector, hotswap sockets, and indicator LEDs. + +Keyboard Maintainer: [Peioris](https://github.com/coarse) +Hardware Supported: Ixora PCB +Hardware Availability: [Peioris](https://github.com/coarse) + +Make example for this keyboard (after setting up your build environment): + + make peiorisboards/ixora:default:dfu-util + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +#### Developer's Note + +STM32F042xx chips does not allow jumping to bootloader without BOOT0 being set to high, therefore it is impossible to enter the bootloader from sending a `RESET` keycode nor using bootmagic or bootmagic lite. +The only way to enter bootloader is to hold the BOOT0 button while the keyboard is powering up or after a power reset (done by pressing the reset switch or sending a `RESET` keycode). diff --git a/keyboards/peiorisboards/ixora/rules.mk b/keyboards/peiorisboards/ixora/rules.mk new file mode 100644 index 00000000000..9d89d966363 --- /dev/null +++ b/keyboards/peiorisboards/ixora/rules.mk @@ -0,0 +1,47 @@ +# project specific files + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F042x6 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F042X6 + +# Cortex version +MCU = cortex-m0 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +#OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in diff --git a/keyboards/phantom/config.h b/keyboards/phantom/config.h index 5b7fa62ff50..4ca731f2d7c 100644 --- a/keyboards/phantom/config.h +++ b/keyboards/phantom/config.h @@ -61,7 +61,7 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -101,11 +101,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/phantom/keymaps/default/config.h b/keyboards/phantom/keymaps/default/config.h index a3828f7d5d6..09b8f1bc73a 100644 --- a/keyboards/phantom/keymaps/default/config.h +++ b/keyboards/phantom/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/phantom/keymaps/default/keymap.c b/keyboards/phantom/keymaps/default/keymap.c index 61882281670..d7001f06639 100644 --- a/keyboards/phantom/keymaps/default/keymap.c +++ b/keyboards/phantom/keymaps/default/keymap.c @@ -15,9 +15,6 @@ */ #include QMK_KEYBOARD_H -// Helpful defines -#define _______ KC_TRNS - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -44,22 +41,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/phantom/keymaps/default/rules.mk b/keyboards/phantom/keymaps/default/rules.mk index 555ac79fa71..597d4046a13 100644 --- a/keyboards/phantom/keymaps/default/rules.mk +++ b/keyboards/phantom/keymaps/default/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/phantom/keymaps/iso_uk/keymap.c b/keyboards/phantom/keymaps/iso_uk/keymap.c index bcd23a7641e..43a7e55fb37 100644 --- a/keyboards/phantom/keymaps/iso_uk/keymap.c +++ b/keyboards/phantom/keymaps/iso_uk/keymap.c @@ -15,9 +15,6 @@ */ #include QMK_KEYBOARD_H -// Helpful defines -#define _______ KC_TRNS - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them diff --git a/keyboards/phantom/keymaps/rgbmod/keymap.c b/keyboards/phantom/keymaps/rgbmod/keymap.c index 372590772f5..e3a6792394d 100644 --- a/keyboards/phantom/keymaps/rgbmod/keymap.c +++ b/keyboards/phantom/keymaps/rgbmod/keymap.c @@ -15,9 +15,6 @@ */ #include QMK_KEYBOARD_H -// Helpful defines -#define _______ KC_TRNS - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them diff --git a/keyboards/phantom/keymaps/rgbmod/rules.mk b/keyboards/phantom/keymaps/rgbmod/rules.mk index 38c23a1b897..2892bb424dc 100644 --- a/keyboards/phantom/keymaps/rgbmod/rules.mk +++ b/keyboards/phantom/keymaps/rgbmod/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/phantom/keymaps/xyverz/keymap.c b/keyboards/phantom/keymaps/xyverz/keymap.c index f47a7ad623d..07a743c164f 100644 --- a/keyboards/phantom/keymaps/xyverz/keymap.c +++ b/keyboards/phantom/keymaps/xyverz/keymap.c @@ -20,10 +20,6 @@ extern keymap_config_t keymap_config; #define DVORAK M(_DV) #define COLEMAK M(_CM) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QW] = LAYOUT_tkl_ansi( /* Layer 0: Qwerty */ \ @@ -68,11 +64,6 @@ enum function_id { SHIFT_ESC, }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/keyboards/phantom/readme.md b/keyboards/phantom/readme.md index c0cb3bc20dc..b25630958bc 100644 --- a/keyboards/phantom/readme.md +++ b/keyboards/phantom/readme.md @@ -13,4 +13,4 @@ Make example for this keyboard (after setting up your build environment): make phantom:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/phantom/rules.mk b/keyboards/phantom/rules.mk index 9ce9fd2444f..c4d5f57592e 100644 --- a/keyboards/phantom/rules.mk +++ b/keyboards/phantom/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/pinky/3/3.c b/keyboards/pinky/3/3.c new file mode 100644 index 00000000000..200510d0aa2 --- /dev/null +++ b/keyboards/pinky/3/3.c @@ -0,0 +1 @@ +#include "pinky.h" diff --git a/keyboards/pinky/3/3.h b/keyboards/pinky/3/3.h new file mode 100644 index 00000000000..ca1109d262a --- /dev/null +++ b/keyboards/pinky/3/3.h @@ -0,0 +1,46 @@ +#pragma once + +#include "../pinky.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, R30, R31, R32, R33 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { KC_NO, KC_NO, KC_NO, L30, L31, L32, L33 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { KC_NO, KC_NO, KC_NO, R33, R32, R31, R30 } \ + } + +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, R30, R31, R32, R33 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##R30, KC_##R31, KC_##R32, KC_##R33 \ + ) diff --git a/keyboards/pinky/3/config.h b/keyboards/pinky/3/config.h new file mode 100644 index 00000000000..8a3f53a1757 --- /dev/null +++ b/keyboards/pinky/3/config.h @@ -0,0 +1,241 @@ +/* Copyright 2018 'Masayuki Sunahara' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER tamanishi +#define PRODUCT Pinky +#define DESCRIPTION A split keyboard with 3 or 4 x7 vertically staggered keys and 4 thumb keys + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 7 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } + +// wiring of each half +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } + +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D2 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +// #define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +// #define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/pinky/3/keymaps/default/config.h b/keyboards/pinky/3/keymaps/default/config.h new file mode 100644 index 00000000000..db797767299 --- /dev/null +++ b/keyboards/pinky/3/keymaps/default/config.h @@ -0,0 +1,31 @@ +/* Copyright 2018 'Masayuki Sunahara' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 200 +#define RETRO_TAPPPING diff --git a/keyboards/pinky/3/keymaps/default/keymap.c b/keyboards/pinky/3/keymaps/default/keymap.c new file mode 100644 index 00000000000..94ed82b02ed --- /dev/null +++ b/keyboards/pinky/3/keymaps/default/keymap.c @@ -0,0 +1,134 @@ +/* Copyright 2018 'Masayuki Sunahara' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST +}; + +#define ________ KC_TRNS +#define XXXXXXXX KC_NO +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_ADJ ADJUST +#define KC_CTLTB CTL_T(KC_TAB) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + //,---------------------------------------------------------------------. ,---------------------------------------------------------------------. + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LPRN, KC_RPRN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + KC_CTLTB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LBRC, KC_RBRC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ADJ, KC_ADJ, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + KC_LALT, KC_LOWER, KC_LGUI, KC_SPC, KC_SPC, KC_RGUI, KC_RAISE, KC_RALT \ + //`---------------------------------------' `---------------------------------------' + ), + + [_LOWER] = LAYOUT( \ + //,---------------------------------------------------------------------. ,---------------------------------------------------------------------. + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, ________, ________, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, KC_MINS, KC_EQL, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________ \ + //`---------------------------------------' `---------------------------------------' + ), + + [_RAISE] = LAYOUT( \ + //,---------------------------------------------------------------------. ,---------------------------------------------------------------------. + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, ________, ________, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, KC_MINS, KC_EQL, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________ \ + //`---------------------------------------' `---------------------------------------' + ), + + [_ADJUST] = LAYOUT( \ + //,---------------------------------------------------------------------. ,---------------------------------------------------------------------. + ________, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, KC_F11, KC_F12, ________, ________, ________, KC_LCBR, KC_RCBR, KC_HOME, KC_PGDN, KC_PGUP, KC_END, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________ \ + //`---------------------------------------' `---------------------------------------' + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + // set_timelog(); + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} + diff --git a/keyboards/pinky/3/keymaps/default/rules.mk b/keyboards/pinky/3/keymaps/default/rules.mk new file mode 100644 index 00000000000..17686980935 --- /dev/null +++ b/keyboards/pinky/3/keymaps/default/rules.mk @@ -0,0 +1,18 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing diff --git a/keyboards/pinky/3/rules.mk b/keyboards/pinky/3/rules.mk new file mode 100644 index 00000000000..1bb8bf6d7fd --- /dev/null +++ b/keyboards/pinky/3/rules.mk @@ -0,0 +1 @@ +# empty diff --git a/keyboards/pinky/4/4.c b/keyboards/pinky/4/4.c new file mode 100644 index 00000000000..200510d0aa2 --- /dev/null +++ b/keyboards/pinky/4/4.c @@ -0,0 +1 @@ +#include "pinky.h" diff --git a/keyboards/pinky/4/4.h b/keyboards/pinky/4/4.h new file mode 100644 index 00000000000..ad105ce7fc5 --- /dev/null +++ b/keyboards/pinky/4/4.h @@ -0,0 +1,51 @@ +#pragma once + +#include "../pinky.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, R40, R41, R42, R43 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { KC_NO, KC_NO, KC_NO, L40, L41, L42, L43 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 }, \ + { KC_NO, KC_NO, KC_NO, R43, R42, R41, R40 } \ + } + +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, R40, R41, R42, R43 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##R40, KC_##R41, KC_##R42, KC_##R43 \ + ) diff --git a/keyboards/pinky/4/config.h b/keyboards/pinky/4/config.h new file mode 100644 index 00000000000..a1544bc4869 --- /dev/null +++ b/keyboards/pinky/4/config.h @@ -0,0 +1,241 @@ +/* Copyright 2018 'Masayuki Sunahara' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER tamanishi +#define PRODUCT Pinky +#define DESCRIPTION A split keyboard with 3 or 4 x7 vertically staggered keys and 4 thumb keys + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } + +// wiring of each half +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } + +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D2 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +// #define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +// #define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/pinky/4/keymaps/default/config.h b/keyboards/pinky/4/keymaps/default/config.h new file mode 100644 index 00000000000..db797767299 --- /dev/null +++ b/keyboards/pinky/4/keymaps/default/config.h @@ -0,0 +1,31 @@ +/* Copyright 2018 'Masayuki Sunahara' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define USE_SERIAL_PD2 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 200 +#define RETRO_TAPPPING diff --git a/keyboards/pinky/4/keymaps/default/keymap.c b/keyboards/pinky/4/keymaps/default/keymap.c new file mode 100644 index 00000000000..ee43194dd8b --- /dev/null +++ b/keyboards/pinky/4/keymaps/default/keymap.c @@ -0,0 +1,154 @@ +/* Copyright 2018 'Masayuki Sunahara' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST +}; + +#define ________ KC_TRNS +#define XXXXXXXX KC_NO +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_ADJ ADJUST +#define KC_CTLTB CTL_T(KC_TAB) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( \ + //,---------------------------------------------------------------------. ,---------------------------------------------------------------------. + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LPRN, KC_RPRN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + KC_CTLTB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LCBR, KC_RCBR, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ADJ, KC_ADJ, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + KC_LALT, KC_LOWER, KC_LGUI, KC_SPC, KC_SPC, KC_RGUI, KC_RAISE, KC_RALT \ + //`---------------------------------------' `---------------------------------------' + ), + + [_LOWER] = LAYOUT( \ + //,---------------------------------------------------------------------. ,---------------------------------------------------------------------. + KC_GRV, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, KC_MINS, KC_EQL, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________ \ + //`---------------------------------------' `---------------------------------------' + ), + + [_RAISE] = LAYOUT( \ + //,---------------------------------------------------------------------. ,---------------------------------------------------------------------. + KC_GRV, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, KC_MINS, KC_EQL, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________ \ + //`---------------------------------------' `---------------------------------------' + ), + + [_ADJUST] = LAYOUT( \ + //,---------------------------------------------------------------------. ,---------------------------------------------------------------------. + ________, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, ________, ________, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, KC_F11, KC_F12, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, KC_HOME, KC_PGDN, KC_PGUP, KC_END, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________,\ + //|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------| + ________, ________, ________, ________, ________, ________, ________, ________ \ + //`---------------------------------------' `---------------------------------------' + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + // set_timelog(); + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/pinky/4/keymaps/default/rules.mk b/keyboards/pinky/4/keymaps/default/rules.mk new file mode 100644 index 00000000000..17686980935 --- /dev/null +++ b/keyboards/pinky/4/keymaps/default/rules.mk @@ -0,0 +1,18 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing diff --git a/keyboards/pinky/4/rules.mk b/keyboards/pinky/4/rules.mk new file mode 100644 index 00000000000..1bb8bf6d7fd --- /dev/null +++ b/keyboards/pinky/4/rules.mk @@ -0,0 +1 @@ +# empty diff --git a/keyboards/pinky/config.h b/keyboards/pinky/config.h new file mode 100644 index 00000000000..7f0c3c10ea9 --- /dev/null +++ b/keyboards/pinky/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2018 'Masayuki Sunahara' + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" diff --git a/keyboards/pinky/pinky.c b/keyboards/pinky/pinky.c new file mode 100644 index 00000000000..9b98ea85d3f --- /dev/null +++ b/keyboards/pinky/pinky.c @@ -0,0 +1,43 @@ +/* Copyright 2018 'Masayuki Sunahara' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "pinky.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/pinky/pinky.h b/keyboards/pinky/pinky.h new file mode 100644 index 00000000000..9cc5d8d5898 --- /dev/null +++ b/keyboards/pinky/pinky.h @@ -0,0 +1,29 @@ +/* Copyright 2018 'Masayuki Sunahara' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef PINKY_H +#define PINKY_H + +#include "quantum.h" + +#ifdef KEYBOARD_pinky_3 + #include "3.h" +#endif + +#ifdef KEYBOARD_pinky_4 + #include "4.h" +#endif + +#endif diff --git a/keyboards/pinky/readme.md b/keyboards/pinky/readme.md new file mode 100644 index 00000000000..f9eb6ee2b85 --- /dev/null +++ b/keyboards/pinky/readme.md @@ -0,0 +1,25 @@ +Pinky +=== + +A split keyboard with 3 or 4 x7 vertically staggered keys and 4 thumb keys. +An idea is inspired from [crkbd](https://github.com/foostan/crkbd), [Lily58](https://github.com/kata0510/Lily58), [Ergo42](https://github.com/Biacco42/Ergo42) and [Helix](https://github.com/MakotoKurauchi/helix). + +Keyboard Maintainer: [Masayuki Sunahara](https://github.com/tamanishi/) [@tamanishi](https://twitter.com/tamanishi) +Hardware Supported: Pinky3(3rows) or Pinky4(4rows) PCB, Pro Micro +Hardware Availability: [Pinky3 PCB & Case Data](https://github.com/tamanishi/Pinky3), [Pinky4 PCB & Case Data](https://github.com/tamanishi/Pinky4) + +Make example for pinky(3rows) keyboard (after setting up your build environment): + + make pinky:default + or + make pinky/3:default + +Make example for pinky(4rows) keyboard (after setting up your build environment): + + make pinky/4:default + +Install example for pinky(3rows) keyboard: + + make pinky:default:avrdude + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/pinky/rules.mk b/keyboards/pinky/rules.mk new file mode 100644 index 00000000000..14af0703abf --- /dev/null +++ b/keyboards/pinky/rules.mk @@ -0,0 +1,84 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = pinky/3 diff --git a/keyboards/plaid/config.h b/keyboards/plaid/config.h new file mode 100644 index 00000000000..9da31d700ff --- /dev/null +++ b/keyboards/plaid/config.h @@ -0,0 +1,248 @@ +/* +Copyright 2019 Takuya Urakawa (dm9records.com) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +/* VID & PID from vusb project, see tmk_core/protocol/vusb/USB-IDs-for-free.txt"*/ +#define VENDOR_ID 0x16c0 +#define PRODUCT_ID 0x27db +#define DEVICE_VER 0x0002 +#define MANUFACTURER dm9records +#define PRODUCT plaid +#define DESCRIPTION 12x4 ortholinear keyboard with through hole components + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS { B4, B5, B3, D4 } +#define MATRIX_COL_PINS { B0, D7, D6, D5, B2, B1, C0, C1, C2, C3, D1, D0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define NO_UART 1 + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/plaid/info.json b/keyboards/plaid/info.json new file mode 100644 index 00000000000..13bd05c149e --- /dev/null +++ b/keyboards/plaid/info.json @@ -0,0 +1,113 @@ +{ + "keyboard_name": "Plaid // Through Hole", + "keyboard_folder": "planid", + "url": "https://github.com/hsgw/plaid", + "maintainer": "hsgw", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_plaid_mit": { + "key_count": 47, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 4, "y": 0 }, + { "w": 1, "x": 5, "y": 0 }, + { "w": 1, "x": 6, "y": 0 }, + { "w": 1, "x": 7, "y": 0 }, + { "w": 1, "x": 8, "y": 0 }, + { "w": 1, "x": 9, "y": 0 }, + { "w": 1, "x": 10, "y": 0 }, + { "w": 1, "x": 11, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 4, "y": 1 }, + { "w": 1, "x": 5, "y": 1 }, + { "w": 1, "x": 6, "y": 1 }, + { "w": 1, "x": 7, "y": 1 }, + { "w": 1, "x": 8, "y": 1 }, + { "w": 1, "x": 9, "y": 1 }, + { "w": 1, "x": 10, "y": 1 }, + { "w": 1, "x": 11, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 4, "y": 2 }, + { "w": 1, "x": 5, "y": 2 }, + { "w": 1, "x": 6, "y": 2 }, + { "w": 1, "x": 7, "y": 2 }, + { "w": 1, "x": 8, "y": 2 }, + { "w": 1, "x": 9, "y": 2 }, + { "w": 1, "x": 10, "y": 2 }, + { "w": 1, "x": 11, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 }, + { "w": 1, "x": 4, "y": 3 }, + { "w": 2, "x": 5, "y": 3 }, + { "w": 1, "x": 7, "y": 3 }, + { "w": 1, "x": 8, "y": 3 }, + { "w": 1, "x": 9, "y": 3 }, + { "w": 1, "x": 10, "y": 3 }, + { "w": 1, "x": 11, "y": 3 } ] + }, + "LAYOUT_plaid_grid": { + "key_count": 48, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 4, "y": 0 }, + { "w": 1, "x": 5, "y": 0 }, + { "w": 1, "x": 6, "y": 0 }, + { "w": 1, "x": 7, "y": 0 }, + { "w": 1, "x": 8, "y": 0 }, + { "w": 1, "x": 9, "y": 0 }, + { "w": 1, "x": 10, "y": 0 }, + { "w": 1, "x": 11, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 4, "y": 1 }, + { "w": 1, "x": 5, "y": 1 }, + { "w": 1, "x": 6, "y": 1 }, + { "w": 1, "x": 7, "y": 1 }, + { "w": 1, "x": 8, "y": 1 }, + { "w": 1, "x": 9, "y": 1 }, + { "w": 1, "x": 10, "y": 1 }, + { "w": 1, "x": 11, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 4, "y": 2 }, + { "w": 1, "x": 5, "y": 2 }, + { "w": 1, "x": 6, "y": 2 }, + { "w": 1, "x": 7, "y": 2 }, + { "w": 1, "x": 8, "y": 2 }, + { "w": 1, "x": 9, "y": 2 }, + { "w": 1, "x": 10, "y": 2 }, + { "w": 1, "x": 11, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 }, + { "w": 1, "x": 4, "y": 3 }, + { "w": 1, "x": 5, "y": 3 }, + { "w": 1, "x": 6, "y": 3 }, + { "w": 1, "x": 7, "y": 3 }, + { "w": 1, "x": 8, "y": 3 }, + { "w": 1, "x": 9, "y": 3 }, + { "w": 1, "x": 10, "y": 3 }, + { "w": 1, "x": 11, "y": 3 } ] + } + } +} diff --git a/keyboards/plaid/keymaps/brickbots/config.h b/keyboards/plaid/keymaps/brickbots/config.h new file mode 100644 index 00000000000..5733b9e4b04 --- /dev/null +++ b/keyboards/plaid/keymaps/brickbots/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/plaid/keymaps/brickbots/keymap.c b/keyboards/plaid/keymaps/brickbots/keymap.c new file mode 100644 index 00000000000..20b6eac6825 --- /dev/null +++ b/keyboards/plaid/keymaps/brickbots/keymap.c @@ -0,0 +1,411 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum plaid_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum plaid_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + EXT_PLV, + LED_1, + LED_2, + LED_3, + LED_4, + LED_5, + LED_6, + LED_7, + LED_8, + LED_9, + LED_0 +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +// array of keys considered modifiers for led purposes +const uint16_t modifiers[] = { + KC_LCTL, + KC_RCTL, + KC_LALT, + KC_RALT, + KC_LSFT, + KC_RSFT, + KC_LGUI, + KC_RGUI, + LOWER, + RAISE +}; + +//Setup consts for LED modes +#define LEDMODE_ON 1 //always on +#define LEDMODE_OFF 0 //always off +#define LEDMODE_MODS 2 //On with modifiers +#define LEDMODE_BLINKIN 3 //blinkinlights - % chance toggle on keypress +#define LEDMODE_KEY 4 //On with any keypress, off with key release +#define LEDMODE_ENTER 5 // On with enter key + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ltrl | Rctl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_plaid_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_RCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_plaid_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_plaid_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_plaid_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_plaid_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_plaid_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Reset | | | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_plaid_grid( + RESET,LED_1, LED_2, LED_3, LED_4, LED_5,LED_6, LED_7, LED_8, LED_9, LED_0,KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +//Setup config struct for LED +typedef union { + uint32_t raw; + struct { + uint8_t red_mode :8; + uint8_t green_mode :8; + }; +} led_config_t; +led_config_t led_config; + +//Set leds to saved state during powerup +void keyboard_post_init_user(void) { + // Call the post init code. + led_config.raw = eeconfig_read_user(); + + if(led_config.red_mode == LEDMODE_ON) { + writePinHigh(LED_RED); + } + + if(led_config.green_mode == LEDMODE_ON) { + writePinHigh(LED_GREEN); + } +} + +void eeconfig_init_user(void) { // EEPROM is getting reset! + led_config.raw = 0; + led_config.red_mode = LEDMODE_ON; + led_config.green_mode = LEDMODE_MODS; + eeconfig_update_user(led_config.raw); + eeconfig_update_user(led_config.raw); +} + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +void led_keypress_update(uint8_t led, uint8_t led_mode, uint16_t keycode, keyrecord_t *record) { + switch (led_mode) { + case LEDMODE_MODS: + for (int i=0;ievent.pressed) { + writePinHigh(led); + } + else { + writePinLow(led); + } + } + } + break; + case LEDMODE_BLINKIN: + if (record->event.pressed) { + if(rand() % 2 == 1) { + if(rand() % 2 == 0) { + writePinLow(led); + } + else { + writePinHigh(led); + } + } + } + break; + case LEDMODE_KEY: + if (record->event.pressed) { + writePinHigh(led); + return; + } + else { + writePinLow(led); + return; + } + break; + case LEDMODE_ENTER: + if (keycode==KC_ENT) { + writePinHigh(led); + } + else { + writePinLow(led); + } + break; + + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + /* If the either led mode is keypressed based, call the led updater + then let it fall through the keypress handlers. Just to keep + the logic out of this procedure */ + if (led_config.red_mode >= LEDMODE_MODS && led_config.red_mode <= LEDMODE_ENTER) { + led_keypress_update(LED_RED, led_config.red_mode, keycode, record); + } + if (led_config.green_mode >= LEDMODE_MODS && led_config.green_mode <= LEDMODE_ENTER) { + led_keypress_update(LED_GREEN, led_config.green_mode, keycode, record); + } + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + layer_off(_PLOVER); + } + return false; + break; + case LED_1: + if (record->event.pressed) { + if (led_config.red_mode==LEDMODE_ON) { + led_config.red_mode=LEDMODE_OFF; + writePinLow(LED_RED); + } + else { + led_config.red_mode=LEDMODE_ON; + writePinHigh(LED_RED); + } + } + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_2: + if (record->event.pressed) { + if (led_config.green_mode==LEDMODE_ON) { + led_config.green_mode=LEDMODE_OFF; + writePinLow(LED_GREEN); + } + else { + led_config.green_mode=LEDMODE_ON; + writePinHigh(LED_GREEN); + } + } + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_3: + led_config.red_mode=LEDMODE_MODS; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_4: + led_config.green_mode=LEDMODE_MODS; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_5: + led_config.red_mode=LEDMODE_BLINKIN; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_6: + led_config.green_mode=LEDMODE_BLINKIN; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_7: + led_config.red_mode=LEDMODE_KEY; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_8: + led_config.green_mode=LEDMODE_KEY; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_9: + led_config.red_mode=LEDMODE_ENTER; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_0: + led_config.green_mode=LEDMODE_ENTER; + eeconfig_update_user(led_config.raw); + return false; + break; + } + return true; +} diff --git a/keyboards/plaid/keymaps/brickbots/readme.md b/keyboards/plaid/keymaps/brickbots/readme.md new file mode 100644 index 00000000000..48a12fa8bbe --- /dev/null +++ b/keyboards/plaid/keymaps/brickbots/readme.md @@ -0,0 +1,36 @@ +# Brickbots keymap for plaid +Original copyright 2019 Takuya Urakawa (dm9records.com) +LED Support added by Richard Sutherland (rich@brickbots.com) + +This layout is based on the Planck layout, with esc/tab swapped and an extra +ctrl key in the bottom left corner. It includes an adjust layer (6) +accessible by holding the lower and raise modifiers (MO3 and MO4) together. +The adjustment layer is used to set the behavior of the two LEDs: + +**Modifier Mode:** +Activates when any modifier (shift, alt, os, MO) key is held +down. LED turns off when key is release + +**Blinkinlights Mode:** +Random chance of state change on each keystroke. + +**Keypress Mode:** +On for any keypress as long as the key is pressed + +**Carriage Mode:** +Turns on when enter is pressed, turns off when any next key is pressed + +To set the behavior of an LED, and save it to eeprom, hold the +raise/lower keys together to access the adjust layer, then use +the keys indicated below to set the behaviors + +* q = Toggle Red LED state, deactivates any other modes +* w = Toggle Green LED state, deactivates any other modes +* e = Set RED LED to modifier mode +* r = Set GREEN LED to modifier mode +* t = Set RED LED to Blinkinlights mode +* y = set GREEN LED to Blinkinlights mode +* u = set RED LED to Keypress mode +* i = set GREEN LED to Keypress mode +* o = set RED LED to Carriage mode +* p = set GREEN LED to Carriage mode diff --git a/keyboards/plaid/keymaps/default/config.h b/keyboards/plaid/keymaps/default/config.h new file mode 100644 index 00000000000..5733b9e4b04 --- /dev/null +++ b/keyboards/plaid/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/plaid/keymaps/default/keymap.c b/keyboards/plaid/keymaps/default/keymap.c new file mode 100644 index 00000000000..35c22b49831 --- /dev/null +++ b/keyboards/plaid/keymaps/default/keymap.c @@ -0,0 +1,411 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum plaid_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum plaid_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + EXT_PLV, + LED_1, + LED_2, + LED_3, + LED_4, + LED_5, + LED_6, + LED_7, + LED_8, + LED_9, + LED_0 +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +// array of keys considered modifiers for led purposes +const uint16_t modifiers[] = { + KC_LCTL, + KC_RCTL, + KC_LALT, + KC_RALT, + KC_LSFT, + KC_RSFT, + KC_LGUI, + KC_RGUI, + LOWER, + RAISE +}; + +//Setup consts for LED modes +#define LEDMODE_ON 1 //always on +#define LEDMODE_OFF 0 //always off +#define LEDMODE_MODS 2 //On with modifiers +#define LEDMODE_BLINKIN 3 //blinkinlights - % chance toggle on keypress +#define LEDMODE_KEY 4 //On with any keypress, off with key release +#define LEDMODE_ENTER 5 // On with enter key + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_plaid_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_plaid_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_plaid_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_plaid_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_plaid_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_plaid_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Reset | | | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_plaid_grid( + RESET,LED_1, LED_2, LED_3, LED_4, LED_5,LED_6, LED_7, LED_8, LED_9, LED_0,KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +//Setup config struct for LED +typedef union { + uint32_t raw; + struct { + uint8_t red_mode :8; + uint8_t green_mode :8; + }; +} led_config_t; +led_config_t led_config; + +//Set leds to saved state during powerup +void keyboard_post_init_user(void) { + // Call the post init code. + led_config.raw = eeconfig_read_user(); + + if(led_config.red_mode == LEDMODE_ON) { + writePinHigh(LED_RED); + } + + if(led_config.green_mode == LEDMODE_ON) { + writePinHigh(LED_GREEN); + } +} + +void eeconfig_init_user(void) { // EEPROM is getting reset! + led_config.raw = 0; + led_config.red_mode = LEDMODE_ON; + led_config.green_mode = LEDMODE_MODS; + eeconfig_update_user(led_config.raw); + eeconfig_update_user(led_config.raw); +} + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +void led_keypress_update(uint8_t led, uint8_t led_mode, uint16_t keycode, keyrecord_t *record) { + switch (led_mode) { + case LEDMODE_MODS: + for (int i=0;ievent.pressed) { + writePinHigh(led); + } + else { + writePinLow(led); + } + } + } + break; + case LEDMODE_BLINKIN: + if (record->event.pressed) { + if(rand() % 2 == 1) { + if(rand() % 2 == 0) { + writePinLow(led); + } + else { + writePinHigh(led); + } + } + } + break; + case LEDMODE_KEY: + if (record->event.pressed) { + writePinHigh(led); + return; + } + else { + writePinLow(led); + return; + } + break; + case LEDMODE_ENTER: + if (keycode==KC_ENT) { + writePinHigh(led); + } + else { + writePinLow(led); + } + break; + + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + /* If the either led mode is keypressed based, call the led updater + then let it fall through the keypress handlers. Just to keep + the logic out of this procedure */ + if (led_config.red_mode >= LEDMODE_MODS && led_config.red_mode <= LEDMODE_ENTER) { + led_keypress_update(LED_RED, led_config.red_mode, keycode, record); + } + if (led_config.green_mode >= LEDMODE_MODS && led_config.green_mode <= LEDMODE_ENTER) { + led_keypress_update(LED_GREEN, led_config.green_mode, keycode, record); + } + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + layer_off(_PLOVER); + } + return false; + break; + case LED_1: + if (record->event.pressed) { + if (led_config.red_mode==LEDMODE_ON) { + led_config.red_mode=LEDMODE_OFF; + writePinLow(LED_RED); + } + else { + led_config.red_mode=LEDMODE_ON; + writePinHigh(LED_RED); + } + } + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_2: + if (record->event.pressed) { + if (led_config.green_mode==LEDMODE_ON) { + led_config.green_mode=LEDMODE_OFF; + writePinLow(LED_GREEN); + } + else { + led_config.green_mode=LEDMODE_ON; + writePinHigh(LED_GREEN); + } + } + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_3: + led_config.red_mode=LEDMODE_MODS; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_4: + led_config.green_mode=LEDMODE_MODS; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_5: + led_config.red_mode=LEDMODE_BLINKIN; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_6: + led_config.green_mode=LEDMODE_BLINKIN; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_7: + led_config.red_mode=LEDMODE_KEY; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_8: + led_config.green_mode=LEDMODE_KEY; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_9: + led_config.red_mode=LEDMODE_ENTER; + eeconfig_update_user(led_config.raw); + return false; + break; + case LED_0: + led_config.green_mode=LEDMODE_ENTER; + eeconfig_update_user(led_config.raw); + return false; + break; + } + return true; +} diff --git a/keyboards/plaid/keymaps/default/readme.md b/keyboards/plaid/keymaps/default/readme.md new file mode 100644 index 00000000000..5a08a1fff3f --- /dev/null +++ b/keyboards/plaid/keymaps/default/readme.md @@ -0,0 +1,35 @@ +# The default keymap for plaid +Original copyright 2019 Takuya Urakawa (dm9records.com) +LED Support added by Richard Sutherland (rich@brickbots.com) + +This layout is based on the Planck layout, and includes an adjust layer (6) +accessible by holding the lower and raise modifiers (MO3 and MO4) together. +The adjustment layer is used to set the behavior of the two LEDs: + +**Modifier Mode:** +Activates when any modifier (shift, alt, os, MO) key is held +down. LED turns off when key is release + +**Blinkinlights Mode:** +Random chance of state change on each keystroke. + +**Keypress Mode:** +On for any keypress as long as the key is pressed + +**Carriage Mode:** +Turns on when enter is pressed, turns off when any next key is pressed + +To set the behavior of an LED, and save it to eeprom, hold the +raise/lower keys together to access the adjust layer, then use +the keys indicated below to set the behaviors + +* q = Toggle Red LED state, deactivates any other modes +* w = Toggle Green LED state, deactivates any other modes +* e = Set RED LED to modifier mode +* r = Set GREEN LED to modifier mode +* t = Set RED LED to Blinkinlights mode +* y = set GREEN LED to Blinkinlights mode +* u = set RED LED to Keypress mode +* i = set GREEN LED to Keypress mode +* o = set RED LED to Carriage mode +* p = set GREEN LED to Carriage mode diff --git a/keyboards/plaid/plaid.c b/keyboards/plaid/plaid.c new file mode 100644 index 00000000000..28f56d7f93c --- /dev/null +++ b/keyboards/plaid/plaid.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "plaid.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/plaid/plaid.h b/keyboards/plaid/plaid.h new file mode 100644 index 00000000000..d791cf7c005 --- /dev/null +++ b/keyboards/plaid/plaid.h @@ -0,0 +1,68 @@ +/* Copyright 2019 Takuya Urakawa (dm9records.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define LAYOUT_plaid_mit( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_plaid_grid( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define KC_KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ + ) \ + LAYOUT_plaid_grid( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ + ) + +#define KEYMAP LAYOUT_plaid_grid +#define LAYOUT_ortho_4x12 LAYOUT_plaid_grid +#define LAYOUT_planck_mit LAYOUT_plaid_mit +#define LAYOUT_kc_ortho_4x12 KC_KEYMAP +#define KC_LAYOUT_ortho_4x12 KC_KEYMAP + +#define LED_RED C5 +#define LED_GREEN C4 diff --git a/keyboards/plaid/readme.md b/keyboards/plaid/readme.md new file mode 100644 index 00000000000..dd49ecbdf53 --- /dev/null +++ b/keyboards/plaid/readme.md @@ -0,0 +1,23 @@ +# plaid // Through Hole + +![plaid](https://i.imgur.com/tTi9yR9h.jpg) + +12x4 ortholinear keyboard with only through hole components. + +Keyboard Maintainer: [hsgw](https://github.com/hsgw) +Hardware Supported: ATMEGA328p with vusb [PCB](https://github.com/hsgw/plaid) +Hardware Availability: Group buy in r/mk + +Make example for this keyboard (after setting up your build environment): + make plaid:default + +Flash firmware: + // In bootloader mode + make plaid:default:program + +## Bootloader +use usbasploader in my repository. +https://github.com/hsgw/USBaspLoader/tree/plaid + + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/plaid/rules.mk b/keyboards/plaid/rules.mk new file mode 100644 index 00000000000..c54b1ea5849 --- /dev/null +++ b/keyboards/plaid/rules.mk @@ -0,0 +1,100 @@ +# MCU name +MCU = atmega328p +PROTOCOL = VUSB + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +# +# This uses usbaspbootloader +# BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 +OPT_DEFS += -DBOOTLOADER_SIZE=2048 + +# Flash program via avrdude, but default command is not suitable. +# You can use plaid:default:program +PROGRAM_CMD = avrdude -c usbasp -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex + + +# disable debug code +OPT_DEFS = -DDEBUG_LEVEL=0 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/plaid/usbconfig.h b/keyboards/plaid/usbconfig.h new file mode 100644 index 00000000000..ea9fdd8ea6f --- /dev/null +++ b/keyboards/plaid/usbconfig.h @@ -0,0 +1,397 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +// max power draw with maxed white underglow measured at 120 mA (peaks) +#define USB_CFG_MAX_BUS_POWER 100 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 0 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x01 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'd','m','9','r','e','c','o','r','d','s' +#define USB_CFG_VENDOR_NAME_LEN 10 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'P', 'l', 'a', 'i', 'd' +#define USB_CFG_DEVICE_NAME_LEN 5 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +#define USB_CFG_SERIAL_NUMBER 'd','m','9','r','e','c','o','r','d','s','.','c','o','m',':','p','1' +#define USB_CFG_SERIAL_NUMBER_LEN 17 +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +// #define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +// /* #define USB_INTR_CFG_CLR 0 */ +// /* #define USB_INTR_ENABLE EIMSK */ +// #define USB_INTR_ENABLE_BIT INT1 +// /* #define USB_INTR_PENDING EIFR */ +// #define USB_INTR_PENDING_BIT INTF1 +// #define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/plain60/config.h b/keyboards/plain60/config.h new file mode 100644 index 00000000000..a86c2358717 --- /dev/null +++ b/keyboards/plain60/config.h @@ -0,0 +1,70 @@ +/* +Copyright 2019 Maarten Dekkers + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4705 +#define PRODUCT_ID 0x0160 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Maartenwut +#define PRODUCT Plain60 +#define DESCRIPTION A plain 60% PCB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS {B4,D7,D6,D4,E6} +#define MATRIX_COL_PINS {D2,D1,D0,D3,D5,B5,F0,B6,C6,C7,F1,F4,F5,F6,F7} + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +#define QMK_ESC_OUTPUT D2 // usually COL +#define QMK_ESC_INPUT B4 // usually ROW + +//VIA +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 635 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 389 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/plain60/info.json b/keyboards/plain60/info.json new file mode 100644 index 00000000000..91eab457a87 --- /dev/null +++ b/keyboards/plain60/info.json @@ -0,0 +1,414 @@ +{ + "keyboard_name": "Plain60", + "url": "", + "maintainer": "maartenwut", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 65, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k0c", "x":12, "y":0}, + {"label":"k0d", "x":13, "y":0}, + {"label":"k0e", "x":14, "y":0}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k1a", "x":10.5, "y":1}, + {"label":"k1b", "x":11.5, "y":1}, + {"label":"k1c", "x":12.5, "y":1}, + {"label":"k1d", "x":13.5, "y":1, "w":1.5}, + {"label":"k20", "x":0, "y":2, "w":1.75}, + {"label":"k21", "x":1.75, "y":2}, + {"label":"k22", "x":2.75, "y":2}, + {"label":"k23", "x":3.75, "y":2}, + {"label":"k24", "x":4.75, "y":2}, + {"label":"k25", "x":5.75, "y":2}, + {"label":"k26", "x":6.75, "y":2}, + {"label":"k27", "x":7.75, "y":2}, + {"label":"k28", "x":8.75, "y":2}, + {"label":"k29", "x":9.75, "y":2}, + {"label":"k2a", "x":10.75, "y":2}, + {"label":"k2b", "x":11.75, "y":2}, + {"label":"k2c", "x":12.75, "y":2}, + {"label":"k2d", "x":13.75, "y":2, "w":1.25}, + {"label":"k30", "x":0, "y":3, "w":1.25}, + {"label":"k31", "x":1.25, "y":3}, + {"label":"k32", "x":2.25, "y":3}, + {"label":"k33", "x":3.25, "y":3}, + {"label":"k34", "x":4.25, "y":3}, + {"label":"k35", "x":5.25, "y":3}, + {"label":"k36", "x":6.25, "y":3}, + {"label":"k37", "x":7.25, "y":3}, + {"label":"k38", "x":8.25, "y":3}, + {"label":"k39", "x":9.25, "y":3}, + {"label":"k3a", "x":10.25, "y":3}, + {"label":"k3b", "x":11.25, "y":3}, + {"label":"k3c", "x":12.25, "y":3, "w":1.75}, + {"label":"k3d", "x":14, "y":3}, + {"label":"k40", "x":0, "y":4, "w":1.25}, + {"label":"k41", "x":1.25, "y":4, "w":1.25}, + {"label":"k42", "x":2.5, "y":4, "w":1.25}, + {"label":"k46", "x":3.75, "y":4, "w":6.25}, + {"label":"k4a", "x":10, "y":4, "w":1.25}, + {"label":"k4b", "x":11.25, "y":4, "w":1.25}, + {"label":"k4c", "x":12.5, "y":4, "w":1.25}, + {"label":"k4d", "x":13.75, "y":4, "w":1.25} + ] + }, + "LAYOUT_60_ansi": { + "key_count": 61, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k0c", "x":12, "y":0}, + {"label":"k0e", "x":13, "y":0, "w":2}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k1a", "x":10.5, "y":1}, + {"label":"k1b", "x":11.5, "y":1}, + {"label":"k1c", "x":12.5, "y":1}, + {"label":"k1d", "x":13.5, "y":1, "w":1.5}, + {"label":"k20", "x":0, "y":2, "w":1.75}, + {"label":"k21", "x":1.75, "y":2}, + {"label":"k22", "x":2.75, "y":2}, + {"label":"k23", "x":3.75, "y":2}, + {"label":"k24", "x":4.75, "y":2}, + {"label":"k25", "x":5.75, "y":2}, + {"label":"k26", "x":6.75, "y":2}, + {"label":"k27", "x":7.75, "y":2}, + {"label":"k28", "x":8.75, "y":2}, + {"label":"k29", "x":9.75, "y":2}, + {"label":"k2a", "x":10.75, "y":2}, + {"label":"k2b", "x":11.75, "y":2}, + {"label":"k2d", "x":12.75, "y":2, "w":2.25}, + {"label":"k30", "x":0, "y":3, "w":2.25}, + {"label":"k32", "x":2.25, "y":3}, + {"label":"k33", "x":3.25, "y":3}, + {"label":"k34", "x":4.25, "y":3}, + {"label":"k35", "x":5.25, "y":3}, + {"label":"k36", "x":6.25, "y":3}, + {"label":"k37", "x":7.25, "y":3}, + {"label":"k38", "x":8.25, "y":3}, + {"label":"k39", "x":9.25, "y":3}, + {"label":"k3a", "x":10.25, "y":3}, + {"label":"k3b", "x":11.25, "y":3}, + {"label":"k3c", "x":12.25, "y":3, "w":2.75}, + {"label":"k40", "x":0, "y":4, "w":1.25}, + {"label":"k41", "x":1.25, "y":4, "w":1.25}, + {"label":"k42", "x":2.5, "y":4, "w":1.25}, + {"label":"k46", "x":3.75, "y":4, "w":6.25}, + {"label":"k4a", "x":10, "y":4, "w":1.25}, + {"label":"k4b", "x":11.25, "y":4, "w":1.25}, + {"label":"k4c", "x":12.5, "y":4, "w":1.25}, + {"label":"k4d", "x":13.75, "y":4, "w":1.25} + ] + }, + "LAYOUT_60_ansi_split_bs_rshift": { + "key_count": 63, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k0c", "x":12, "y":0}, + {"label":"k0d", "x":13, "y":0}, + {"label":"k0e", "x":14, "y":0}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k1a", "x":10.5, "y":1}, + {"label":"k1b", "x":11.5, "y":1}, + {"label":"k1c", "x":12.5, "y":1}, + {"label":"k1d", "x":13.5, "y":1, "w":1.5}, + {"label":"k20", "x":0, "y":2, "w":1.75}, + {"label":"k21", "x":1.75, "y":2}, + {"label":"k22", "x":2.75, "y":2}, + {"label":"k23", "x":3.75, "y":2}, + {"label":"k24", "x":4.75, "y":2}, + {"label":"k25", "x":5.75, "y":2}, + {"label":"k26", "x":6.75, "y":2}, + {"label":"k27", "x":7.75, "y":2}, + {"label":"k28", "x":8.75, "y":2}, + {"label":"k29", "x":9.75, "y":2}, + {"label":"k2a", "x":10.75, "y":2}, + {"label":"k2b", "x":11.75, "y":2}, + {"label":"k2d", "x":12.75, "y":2, "w":2.25}, + {"label":"k30", "x":0, "y":3, "w":2.25}, + {"label":"k32", "x":2.25, "y":3}, + {"label":"k33", "x":3.25, "y":3}, + {"label":"k34", "x":4.25, "y":3}, + {"label":"k35", "x":5.25, "y":3}, + {"label":"k36", "x":6.25, "y":3}, + {"label":"k37", "x":7.25, "y":3}, + {"label":"k38", "x":8.25, "y":3}, + {"label":"k39", "x":9.25, "y":3}, + {"label":"k3a", "x":10.25, "y":3}, + {"label":"k3b", "x":11.25, "y":3}, + {"label":"k3c", "x":12.25, "y":3, "w":1.75}, + {"label":"k3d", "x":14, "y":3}, + {"label":"k40", "x":0, "y":4, "w":1.25}, + {"label":"k41", "x":1.25, "y":4, "w":1.25}, + {"label":"k42", "x":2.5, "y":4, "w":1.25}, + {"label":"k46", "x":3.75, "y":4, "w":6.25}, + {"label":"k4a", "x":10, "y":4, "w":1.25}, + {"label":"k4b", "x":11.25, "y":4, "w":1.25}, + {"label":"k4c", "x":12.5, "y":4, "w":1.25}, + {"label":"k4d", "x":13.75, "y":4, "w":1.25} + ] + }, + "LAYOUT_60_hhkb": { + "key_count": 60, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k0c", "x":12, "y":0}, + {"label":"k0d", "x":13, "y":0}, + {"label":"k0e", "x":14, "y":0}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k1a", "x":10.5, "y":1}, + {"label":"k1b", "x":11.5, "y":1}, + {"label":"k1c", "x":12.5, "y":1}, + {"label":"k1d", "x":13.5, "y":1, "w":1.5}, + {"label":"k20", "x":0, "y":2, "w":1.75}, + {"label":"k21", "x":1.75, "y":2}, + {"label":"k22", "x":2.75, "y":2}, + {"label":"k23", "x":3.75, "y":2}, + {"label":"k24", "x":4.75, "y":2}, + {"label":"k25", "x":5.75, "y":2}, + {"label":"k26", "x":6.75, "y":2}, + {"label":"k27", "x":7.75, "y":2}, + {"label":"k28", "x":8.75, "y":2}, + {"label":"k29", "x":9.75, "y":2}, + {"label":"k2a", "x":10.75, "y":2}, + {"label":"k2b", "x":11.75, "y":2}, + {"label":"k2d", "x":12.75, "y":2, "w":2.25}, + {"label":"k30", "x":0, "y":3, "w":2.25}, + {"label":"k32", "x":2.25, "y":3}, + {"label":"k33", "x":3.25, "y":3}, + {"label":"k34", "x":4.25, "y":3}, + {"label":"k35", "x":5.25, "y":3}, + {"label":"k36", "x":6.25, "y":3}, + {"label":"k37", "x":7.25, "y":3}, + {"label":"k38", "x":8.25, "y":3}, + {"label":"k39", "x":9.25, "y":3}, + {"label":"k3a", "x":10.25, "y":3}, + {"label":"k3b", "x":11.25, "y":3}, + {"label":"k3c", "x":12.25, "y":3, "w":1.75}, + {"label":"k3d", "x":14, "y":3}, + {"label":"k41", "x":1.5, "y":4}, + {"label":"k42", "x":2.5, "y":4, "w":1.5}, + {"label":"k46", "x":4, "y":4, "w":7}, + {"label":"k4b", "x":11, "y":4, "w":1.5}, + {"label":"k4c", "x":12.5, "y":4} + ] + }, + "LAYOUT_60_iso": { + "key_count": 62, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k0c", "x":12, "y":0}, + {"label":"k0e", "x":13, "y":0, "w":2}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k1a", "x":10.5, "y":1}, + {"label":"k1b", "x":11.5, "y":1}, + {"label":"k1c", "x":12.5, "y":1}, + {"label":"k20", "x":0, "y":2, "w":1.75}, + {"label":"k21", "x":1.75, "y":2}, + {"label":"k22", "x":2.75, "y":2}, + {"label":"k23", "x":3.75, "y":2}, + {"label":"k24", "x":4.75, "y":2}, + {"label":"k25", "x":5.75, "y":2}, + {"label":"k26", "x":6.75, "y":2}, + {"label":"k27", "x":7.75, "y":2}, + {"label":"k28", "x":8.75, "y":2}, + {"label":"k29", "x":9.75, "y":2}, + {"label":"k2a", "x":10.75, "y":2}, + {"label":"k2b", "x":11.75, "y":2}, + {"label":"k2c", "x":12.75, "y":2}, + {"label":"k2d", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"k30", "x":0, "y":3, "w":1.25}, + {"label":"k31", "x":1.25, "y":3}, + {"label":"k32", "x":2.25, "y":3}, + {"label":"k33", "x":3.25, "y":3}, + {"label":"k34", "x":4.25, "y":3}, + {"label":"k35", "x":5.25, "y":3}, + {"label":"k36", "x":6.25, "y":3}, + {"label":"k37", "x":7.25, "y":3}, + {"label":"k38", "x":8.25, "y":3}, + {"label":"k39", "x":9.25, "y":3}, + {"label":"k3a", "x":10.25, "y":3}, + {"label":"k3b", "x":11.25, "y":3}, + {"label":"k3c", "x":12.25, "y":3, "w":2.75}, + {"label":"k40", "x":0, "y":4, "w":1.25}, + {"label":"k41", "x":1.25, "y":4, "w":1.25}, + {"label":"k42", "x":2.5, "y":4, "w":1.25}, + {"label":"k46", "x":3.75, "y":4, "w":6.25}, + {"label":"k4a", "x":10, "y":4, "w":1.25}, + {"label":"k4b", "x":11.25, "y":4, "w":1.25}, + {"label":"k4c", "x":12.5, "y":4, "w":1.25}, + {"label":"k4d", "x":13.75, "y":4, "w":1.25} + ] + }, + "LAYOUT_60_iso_split_bs_rshift": { + "key_count": 64, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k0c", "x":12, "y":0}, + {"label":"k0d", "x":13, "y":0}, + {"label":"k0e", "x":14, "y":0}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k11", "x":1.5, "y":1}, + {"label":"k12", "x":2.5, "y":1}, + {"label":"k13", "x":3.5, "y":1}, + {"label":"k14", "x":4.5, "y":1}, + {"label":"k15", "x":5.5, "y":1}, + {"label":"k16", "x":6.5, "y":1}, + {"label":"k17", "x":7.5, "y":1}, + {"label":"k18", "x":8.5, "y":1}, + {"label":"k19", "x":9.5, "y":1}, + {"label":"k1a", "x":10.5, "y":1}, + {"label":"k1b", "x":11.5, "y":1}, + {"label":"k1c", "x":12.5, "y":1}, + {"label":"k20", "x":0, "y":2, "w":1.75}, + {"label":"k21", "x":1.75, "y":2}, + {"label":"k22", "x":2.75, "y":2}, + {"label":"k23", "x":3.75, "y":2}, + {"label":"k24", "x":4.75, "y":2}, + {"label":"k25", "x":5.75, "y":2}, + {"label":"k26", "x":6.75, "y":2}, + {"label":"k27", "x":7.75, "y":2}, + {"label":"k28", "x":8.75, "y":2}, + {"label":"k29", "x":9.75, "y":2}, + {"label":"k2a", "x":10.75, "y":2}, + {"label":"k2b", "x":11.75, "y":2}, + {"label":"k2c", "x":12.75, "y":2}, + {"label":"k2d", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"k30", "x":0, "y":3, "w":1.25}, + {"label":"k31", "x":1.25, "y":3}, + {"label":"k32", "x":2.25, "y":3}, + {"label":"k33", "x":3.25, "y":3}, + {"label":"k34", "x":4.25, "y":3}, + {"label":"k35", "x":5.25, "y":3}, + {"label":"k36", "x":6.25, "y":3}, + {"label":"k37", "x":7.25, "y":3}, + {"label":"k38", "x":8.25, "y":3}, + {"label":"k39", "x":9.25, "y":3}, + {"label":"k3a", "x":10.25, "y":3}, + {"label":"k3b", "x":11.25, "y":3}, + {"label":"k3c", "x":12.25, "y":3, "w":1.75}, + {"label":"k3d", "x":14, "y":3}, + {"label":"k40", "x":0, "y":4, "w":1.25}, + {"label":"k41", "x":1.25, "y":4, "w":1.25}, + {"label":"k42", "x":2.5, "y":4, "w":1.25}, + {"label":"k46", "x":3.75, "y":4, "w":6.25}, + {"label":"k4a", "x":10, "y":4, "w":1.25}, + {"label":"k4b", "x":11.25, "y":4, "w":1.25}, + {"label":"k4c", "x":12.5, "y":4, "w":1.25}, + {"label":"k4d", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/plain60/keymaps/RGB/config.h b/keyboards/plain60/keymaps/RGB/config.h new file mode 100644 index 00000000000..5fadcf821a4 --- /dev/null +++ b/keyboards/plain60/keymaps/RGB/config.h @@ -0,0 +1,26 @@ +/* +Copyright 2019 Sebastian Spindler + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* RGB Underglow */ +#define RGB_DI_PIN B7 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 30 // Number of LEDs +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/plain60/keymaps/RGB/keymap.c b/keyboards/plain60/keymaps/RGB/keymap.c new file mode 100644 index 00000000000..25370823dfa --- /dev/null +++ b/keyboards/plain60/keymaps/RGB/keymap.c @@ -0,0 +1,57 @@ +/* +Copyright 2019 Sebastian Spindler + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +#include "keymap_extras/keymap_german.h" + +//Layer renaming +#define _DL 0 //default +#define _FUN 1 //function layer +#define _LED 2 //LED configurations + +//Keymapping renaming +#define ______ KC_TRNS //renaming KC_TRNS for readability in keymaps +#define RGB_MI RGB_MODE_FORWARD //increase RGB mode +#define RGB_MD RGB_MODE_REVERSE //decrease RGB mode +#define RGB_ST RGB_M_P //rgb static +#define MONKEY LCTL(LALT(KC_DEL)) //ctrl+alt+del == monkey grip +#define SPECIAL LT(_FUN, DE_CIRC) // + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_DL] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DE_SS, DE_ACUT, ______, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, DE_PLUS, ______, \ + SPECIAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_OE, DE_AE, DE_HASH, KC_ENT, \ + KC_LSFT, DE_LESS, DE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, MONKEY, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , ______, KC_ALGR, TG(_LED), KC_RCTL ), + + [_FUN] = LAYOUT( + ______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ______, KC_DEL, \ + ______, KC_PGUP, KC_UP, KC_PGDN, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_HOME, ______, ______, KC_END, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_UP, ______, \ + ______, ______, ______, ______ , ______, KC_LEFT, KC_DOWN, KC_RIGHT ), + + [_LED] = LAYOUT( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ + ______, RGB_TOG, RGB_MI, RGB_MD, RGB_ST, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______ , ______, ______, TG(_LED), ______ ), +}; diff --git a/keyboards/plain60/keymaps/RGB/rules.mk b/keyboards/plain60/keymaps/RGB/rules.mk new file mode 100644 index 00000000000..793bd869ae9 --- /dev/null +++ b/keyboards/plain60/keymaps/RGB/rules.mk @@ -0,0 +1,23 @@ +#Copyright 2019 Sebastian Spindler + +#This program is free software: you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation, either version 2 of the License, or +#(at your option) any later version. + +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. + +#You should have received a copy of the GNU General Public License +#along with this program. If not, see . + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +RAW_ENABLE = no +DYNAMIC_KEYMAP_ENABLE = no diff --git a/keyboards/plain60/keymaps/default/keymap.c b/keyboards/plain60/keymaps/default/keymap.c new file mode 100644 index 00000000000..7e8cfff3541 --- /dev/null +++ b/keyboards/plain60/keymaps/default/keymap.c @@ -0,0 +1,17 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _MA 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTRL) +}; diff --git a/keyboards/plain60/keymaps/yanfali/keymap.c b/keyboards/plain60/keymaps/yanfali/keymap.c new file mode 100644 index 00000000000..3a0bc634f33 --- /dev/null +++ b/keyboards/plain60/keymaps/yanfali/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _MA 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_FN] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______), + +[_MA] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN) , \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_NO, KC_RGUI, KC_RALT, KC_RCTRL) +}; diff --git a/keyboards/plain60/keymaps/yanfali/readme.md b/keyboards/plain60/keymaps/yanfali/readme.md new file mode 100644 index 00000000000..790f3af5d9c --- /dev/null +++ b/keyboards/plain60/keymaps/yanfali/readme.md @@ -0,0 +1,9 @@ +- Disable VIA +- Tsangan bottom row +- Split Backspace +- Split Right shift +- RESET, F keys, and Cursors (WASD), DEL, Capslock on layer +- Capslock -> LCTL_T(KC_ESC) +- Bootmagic lite +- Command enabled +- Console enabled diff --git a/keyboards/plain60/keymaps/yanfali/rules.mk b/keyboards/plain60/keymaps/yanfali/rules.mk new file mode 100644 index 00000000000..3d1f67763ea --- /dev/null +++ b/keyboards/plain60/keymaps/yanfali/rules.mk @@ -0,0 +1,4 @@ +BOOTMAGIC = lite +DYNAMIC_KEYMAP_ENABLE = no +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes diff --git a/keyboards/plain60/plain60.c b/keyboards/plain60/plain60.c new file mode 100644 index 00000000000..d8160641042 --- /dev/null +++ b/keyboards/plain60/plain60.c @@ -0,0 +1 @@ +#include "plain60.h" diff --git a/keyboards/plain60/plain60.h b/keyboards/plain60/plain60.h new file mode 100644 index 00000000000..4893e7ad796 --- /dev/null +++ b/keyboards/plain60/plain60.h @@ -0,0 +1,99 @@ +#pragma once + +#include "quantum.h" + +// readability +#define XXX KC_NO + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k41, k42, k46, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, XXX}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, XXX}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, XXX}, \ + {k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, k4a, k4b, k4c, k4d, XXX} \ +} + +#define LAYOUT_60_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ + k40, k41, k42, k46, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, XXX, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, XXX}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, XXX}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, XXX, XXX}, \ + {k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, k4a, k4b, k4c, k4d, XXX} \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k41, k42, k46, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, XXX}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, XXX}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, XXX, XXX}, \ + {k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, k4a, k4b, k4c, k4d, XXX} \ +} + +#define LAYOUT_60_hhkb( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k41, k42, k46, k4b, k4c \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, XXX}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, XXX}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, XXX, XXX}, \ + {XXX, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, XXX, k4b, k4c, XXX, XXX} \ +} + +#define LAYOUT_60_iso( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ + k40, k41, k42, k46, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, XXX, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, XXX, XXX}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, XXX}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, XXX, XXX}, \ + {k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, k4a, k4b, k4c, k4d, XXX} \ +} + +#define LAYOUT_60_iso_split_bs_rshift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k41, k42, k46, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, XXX, XXX}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, XXX}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, XXX}, \ + {k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, XXX, k4a, k4b, k4c, k4d, XXX} \ +} + +void matrix_init_user(void); +void matrix_scan_user(void); diff --git a/keyboards/plain60/readme.md b/keyboards/plain60/readme.md new file mode 100644 index 00000000000..5e8b17a965d --- /dev/null +++ b/keyboards/plain60/readme.md @@ -0,0 +1,14 @@ +Plain60-C and Plain60-B +====== + +A plain 60% PCB with USB-C. + +Keyboard Maintainer: Maartenwut +Hardware Supported: Plain60-C and Plain60-B +Hardware Availability: https://github.com/Maartenwut/plain60-c + +Make example for this keyboard (after setting up your build environment): + + make plain60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/plain60/rules.mk b/keyboards/plain60/rules.mk new file mode 100644 index 00000000000..da9cb9fbd45 --- /dev/null +++ b/keyboards/plain60/rules.mk @@ -0,0 +1,68 @@ +SRC += keyboards/wilba_tech/wt_main.c +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes + +LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_hhkb 60_iso diff --git a/keyboards/planck/config.h b/keyboards/planck/config.h index 452a99d7463..e0839a175f0 100644 --- a/keyboards/planck/config.h +++ b/keyboards/planck/config.h @@ -56,18 +56,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h new file mode 100644 index 00000000000..d007873bbaa --- /dev/null +++ b/keyboards/planck/ez/config.h @@ -0,0 +1,151 @@ +/* + * Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x0000 + +#undef MATRIX_ROWS +#undef MATRIX_COLS +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS + +#define MATRIX_ROW_PINS { A10, A9, A8, B15, C13, C14, C15, A2 } +#define MATRIX_COL_PINS { B11, B10, B2, B1, A7, B0 } + +#define ENCODERS_PAD_A { B12 } +#define ENCODERS_PAD_B { B13 } + +#define MUSIC_MAP +#undef AUDIO_VOICES +#undef C6_AUDIO + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +// #define DEBOUNCE 6 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +// #define WS2812_LED_N 2 +// #define RGBLED_NUM WS2812_LED_N +// #define WS2812_TIM_N 2 +// #define WS2812_TIM_CH 2 +// #define PORT_WS2812 GPIOA +// #define PIN_WS2812 1 +// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) +//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP +//#define WS2812_EXTERNAL_PULLUP + +#define DRIVER_ADDR_1 0b1010000 +#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. + +#define DRIVER_COUNT 1 +#define DRIVER_1_LED_TOTAL 47 +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS + +#define IGNORE_MOD_TAP_INTERRUPT + +#define TAPPING_TOGGLE 1 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c new file mode 100644 index 00000000000..e739b90b8c9 --- /dev/null +++ b/keyboards/planck/ez/ez.c @@ -0,0 +1,150 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "ez.h" + +#ifdef RGB_MATRIX_ENABLE +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, B_12, A_12, C_12}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_7, A_7, C_7}, + + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, + + {0, B_6, A_6, C_6}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1}, + + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, + + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, + + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, + + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, + + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, + +}; + +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5 }, + { 12, 13, 14, 15, 16, 17 }, + { 24, 25, 26, 27, 28, 29 }, + { 36, 37, 38, 45, 46, NO_LED }, + { 6, 7, 8, 9, 10, 11 }, + { 18, 19, 20, 21, 22, 23 }, + { 30, 31, 32, 33, 34, 35 }, + { 42, 43, 44, 39, 40, 41 } +}, { + { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 }, + { 0, 21 }, { 20, 21 }, { 40, 21 }, { 61, 21 }, { 81, 21 }, { 101, 21 }, { 122, 21 }, { 142, 21 }, { 162, 21 }, { 183, 21 }, { 203, 21 }, { 223, 21 }, + { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, + { 0, 63 }, { 20, 63 }, { 40, 63 }, { 61, 63 }, { 81, 63 }, { 111, 63 }, { 142, 63 }, { 162, 63 }, { 183, 63 }, { 203, 63 }, { 223, 63 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1 +} }; + +void suspend_power_down_kb(void) { + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + + void suspend_wakeup_init_kb(void) { + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} +#endif + +void matrix_init_kb(void) { + matrix_init_user(); + + palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 9, PAL_MODE_OUTPUT_PUSHPULL); + + palClearPad(GPIOB, 8); + palClearPad(GPIOB, 9); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +uint32_t layer_state_set_kb(uint32_t state) { + + palClearPad(GPIOB, 8); + palClearPad(GPIOB, 9); + state = layer_state_set_user(state); + uint8_t layer = biton32(state); + switch (layer) { + case 3: + palSetPad(GPIOB, 9); + break; + case 4: + palSetPad(GPIOB, 8); + break; + case 6: + palSetPad(GPIOB, 9); + palSetPad(GPIOB, 8); + break; + default: + break; + } + return state; +} diff --git a/keyboards/planck/ez/ez.h b/keyboards/planck/ez/ez.h new file mode 100644 index 00000000000..55c4032422a --- /dev/null +++ b/keyboards/planck/ez/ez.h @@ -0,0 +1,52 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "planck.h" + +#define LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k3a, k3b, KC_NO }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k37, k38, k39, k33, k34, k35 } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) + +#define KEYMAP LAYOUT_ortho_4x12 +#define LAYOUT_planck_mit LAYOUT_planck_1x2uC +#define LAYOUT_planck_grid LAYOUT_ortho_4x12 diff --git a/keyboards/planck/ez/info.json b/keyboards/planck/ez/info.json new file mode 100644 index 00000000000..b8382bfe0a4 --- /dev/null +++ b/keyboards/planck/ez/info.json @@ -0,0 +1,115 @@ +{ + "keyboard_name": "Planck EZ", + "keyboard_folder": "planck/ez", + "url": "https://ergodox-ez.com/pages/planck", + "maintainer": "jackhumbert", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_1x2uC": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3, "w": 2 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/planck/ez/readme.md b/keyboards/planck/ez/readme.md new file mode 100644 index 00000000000..9bd161abdfe --- /dev/null +++ b/keyboards/planck/ez/readme.md @@ -0,0 +1,15 @@ +# Planck EZ + +![Planck EZ](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/planck/ez/neat-planck-banner.png) + +A variant of the Planck featuring a 2u spacebar and per-key RGB backlighting. + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck EZ +Hardware Availability: [ergodox-ez.com](https://ergodox-ez.com/pages/planck) + +Make example for this keyboard (after setting up your build environment): + + make planck/ez:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/ez/rules.mk b/keyboards/planck/ez/rules.mk new file mode 100644 index 00000000000..4aa431fdaa5 --- /dev/null +++ b/keyboards/planck/ez/rules.mk @@ -0,0 +1,36 @@ +# Cortex version +MCU = STM32F303 + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = no # Custom matrix file +# SERIAL_LINK_ENABLE = yes +ENCODER_ENABLE = yes +RGB_MATRIX_ENABLE = IS31FL3737 + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/keymaps/ab/rules.mk b/keyboards/planck/keymaps/ab/rules.mk index 0b025a2313e..c4dc26dc2b3 100644 --- a/keyboards/planck/keymaps/ab/rules.mk +++ b/keyboards/planck/keymaps/ab/rules.mk @@ -58,6 +58,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/ajp10304/keymap.c b/keyboards/planck/keymaps/ajp10304/keymap.c index ebc4e0b97a7..49346f7b958 100644 --- a/keyboards/planck/keymaps/ajp10304/keymap.c +++ b/keyboards/planck/keymaps/ajp10304/keymap.c @@ -1,4 +1,3 @@ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" @@ -38,10 +37,6 @@ enum planck_keycodes { #include "dynamic_macro.h" -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -55,12 +50,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, - {MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT) }, - {KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT }, - {MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC2) } -}, +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT), + KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT, + MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC2) +), /* Function * ,-----------------------------------------------------------------------------------. @@ -73,12 +68,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn | * `-----------------------------------------------------------------------------------' */ -[_FUNC] = { - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, - {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT }, - {KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) }, - {_______, _______, _______, _______, _______, _______, _______, MO(_MOUSE), _______, _______, _______, _______ } -}, +[_FUNC] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT, + KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT), + _______, _______, _______, _______, _______, _______, _______, MO(_MOUSE), _______, _______, _______, _______ +), /* Lower * ,-----------------------------------------------------------------------------------. @@ -91,12 +86,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC }, - {LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC) }, - {KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) }, - {_______, _______, _______, _______, _______, KC_DEL, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY } -}, +[_LOWER] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC, + LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC), + KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT), + _______, _______, _______, _______, _______, KC_DEL, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), /* Raise * ,-----------------------------------------------------------------------------------. @@ -109,12 +104,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Mouse| | | | | Alt | Enter|Raise | | | | | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN }, - {KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) }, - {_______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) }, - {MO(_MOUSE), _______, _______, _______, _______, KC_LALT, KC_ENT, _______, XXXXXXX, _______, _______, _______ } -}, +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN, + KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)), + _______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS), + MO(_MOUSE), _______, _______, _______, _______, KC_LALT, KC_ENT, _______, XXXXXXX, _______, _______, _______ +), /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. @@ -127,12 +122,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = { - {M(0), RESET, QWERTY, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL }, - {KC_CAPS, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ }, - {TG(_MAC), _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } -}, +[_ADJUST] = LAYOUT_planck_grid( + M(0), RESET, QWERTY, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL, + KC_CAPS, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______, + TG(_MAC), _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* Mouse * ,-----------------------------------------------------------------------------------. @@ -145,12 +140,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_MOUSE] = { - {KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______ }, - {KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } -}, +[_MOUSE] = LAYOUT_planck_grid( + KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______, + KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* Function 2 (Right hand side) * ,-----------------------------------------------------------------------------------. @@ -163,47 +158,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_FUNC2] = { - {_______, _______, M(1), _______, _______, _______, M(5), _______, _______, _______, _______, _______}, - {_______, _______, M(3), M(7), _______, _______, _______, M(10), _______, _______, _______, _______}, - {_______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M(98) }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, - -[_MAC] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {MFNC, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, MFNC2 } -}, - -[_MLWR] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, - -[_MRSE] = { - {_______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL) }, - {_______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } -}, - -[_MFNC]= { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } -}, - -[_MFNC2] = { - {_______, _______, M(2), _______, _______, _______, M(6), _______, _______, _______, _______, _______}, - {_______, _______, M(4), M(8), _______, _______, _______, M(10), _______, _______, _______, _______}, - {_______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M(99) }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, -}, +[_FUNC2] = LAYOUT_planck_grid( + _______, _______, M(1), _______, _______, _______, M(5), _______, _______, _______, _______, _______, + _______, _______, M(3), M(7), _______, _______, _______, M(10), _______, _______, _______, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M(98) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MAC] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + MFNC, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, MFNC2 +), + +[_MLWR] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MRSE] = LAYOUT_planck_grid( + _______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL), + _______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MFNC]= LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MFNC2] = LAYOUT_planck_grid( + _______, _______, M(2), _______, _______, _______, M(6), _______, _______, _______, _______, _______, + _______, _______, M(4), M(8), _______, _______, _______, M(10), _______, _______, _______, _______, + _______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M(99) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) }; diff --git a/keyboards/planck/keymaps/ajp10304/readme.md b/keyboards/planck/keymaps/ajp10304/readme.md index 978f5a19e13..6573266db15 100644 --- a/keyboards/planck/keymaps/ajp10304/readme.md +++ b/keyboards/planck/keymaps/ajp10304/readme.md @@ -6,6 +6,10 @@ the second is the output when shift is applied. **Note:** The below tables assume a UK layout. +####Flashing +Rev <=5: sudo make planck:ajp10304:dfu +Rev 6: sudo make planck/rev6:ajp10304:dfu-util + ##### Main Qwerty Layer * Tab: when held, operates as shift. diff --git a/keyboards/planck/keymaps/ajp10304/rules.mk b/keyboards/planck/keymaps/ajp10304/rules.mk index dc6ab13e89f..4dee01cd5b1 100644 --- a/keyboards/planck/keymaps/ajp10304/rules.mk +++ b/keyboards/planck/keymaps/ajp10304/rules.mk @@ -1,6 +1,3 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - AUDIO_ENABLE = no MOUSEKEY_ENABLE = yes + diff --git a/keyboards/planck/keymaps/alexey/keymap.c b/keyboards/planck/keymaps/alexey/keymap.c index f3ddc8a8a70..90bdd2c37f0 100644 --- a/keyboards/planck/keymaps/alexey/keymap.c +++ b/keyboards/planck/keymaps/alexey/keymap.c @@ -30,10 +30,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/planck/keymaps/alexey/rules.mk b/keyboards/planck/keymaps/alexey/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/alexey/rules.mk +++ b/keyboards/planck/keymaps/alexey/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/altgr/keymap.c b/keyboards/planck/keymaps/altgr/keymap.c index c4eacbd47fa..5f4d1fdfdbe 100644 --- a/keyboards/planck/keymaps/altgr/keymap.c +++ b/keyboards/planck/keymaps/altgr/keymap.c @@ -188,9 +188,7 @@ enum planck_keycodes { // keycodes #define ___x___ KC_TRNS #define ___fn__ KC_TRNS -#ifdef _______ -#undef _______ -#endif +#undef _______ #define _______ KC_NO #define COPY LCTL(KC_C) diff --git a/keyboards/planck/keymaps/altgr/rules.mk b/keyboards/planck/keymaps/altgr/rules.mk index 40f153844c1..a722766296d 100644 --- a/keyboards/planck/keymaps/altgr/rules.mk +++ b/keyboards/planck/keymaps/altgr/rules.mk @@ -21,6 +21,3 @@ SLEEP_LED_ENABLE = no # breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # enable double tap completion of (),[],{} -ifndef QUANTUM_DIR -include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/angerthosenear/rules.mk b/keyboards/planck/keymaps/angerthosenear/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/angerthosenear/rules.mk +++ b/keyboards/planck/keymaps/angerthosenear/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/austin/rules.mk b/keyboards/planck/keymaps/austin/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/austin/rules.mk +++ b/keyboards/planck/keymaps/austin/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/aviator/keymap.c b/keyboards/planck/keymaps/aviator/keymap.c index faece94381c..ca11be8255a 100644 --- a/keyboards/planck/keymaps/aviator/keymap.c +++ b/keyboards/planck/keymaps/aviator/keymap.c @@ -26,7 +26,6 @@ BACKLIT }; -#define _______ KC_TRNS #define ___x___ KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/planck/keymaps/basic/keymap.c b/keyboards/planck/keymaps/basic/keymap.c index f34291323c4..4458c32a762 100644 --- a/keyboards/planck/keymaps/basic/keymap.c +++ b/keyboards/planck/keymaps/basic/keymap.c @@ -6,10 +6,6 @@ // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -27,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {KC_RSFT, KC_LCTL, KC_LALT, KC_LGUI, M(1), KC_SPC, KC_SPC, M(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_RSFT, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Lower @@ -68,28 +64,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 1: - if (record->event.pressed) { - layer_on(1); - } else { - layer_off(1); - } - break; - case 2: - if (record->event.pressed) { - layer_on(2); - } else { - layer_off(2); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/planck/keymaps/basic/rules.mk b/keyboards/planck/keymaps/basic/rules.mk index 6f88a28d508..a31025bc33d 100644 --- a/keyboards/planck/keymaps/basic/rules.mk +++ b/keyboards/planck/keymaps/basic/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/bone2planck/keymap.c b/keyboards/planck/keymaps/bone2planck/keymap.c index ce862ef9a8e..263c4102df5 100644 --- a/keyboards/planck/keymaps/bone2planck/keymap.c +++ b/keyboards/planck/keymaps/bone2planck/keymap.c @@ -11,10 +11,6 @@ #include "..\..\..\..\tmk_core\common\keycode.h" */ - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - /* This Layout tries to emulate the Bone2 Variant of Neo2, and is intended to be used with a German QWERTZ Softwarelayout. It has "üäöß" as it is optimized for a mix of German & English. My favourite features are the placement of the special characters often used for programming right on the home row @@ -142,11 +138,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/planck/keymaps/bone2planck/rules.mk b/keyboards/planck/keymaps/bone2planck/rules.mk index 699726948df..fc0bbe9e749 100644 --- a/keyboards/planck/keymaps/bone2planck/rules.mk +++ b/keyboards/planck/keymaps/bone2planck/rules.mk @@ -18,6 +18,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/brandon/keymap.c b/keyboards/planck/keymaps/brandon/keymap.c index 2d5e05affc2..47eb338a6e4 100644 --- a/keyboards/planck/keymaps/brandon/keymap.c +++ b/keyboards/planck/keymaps/brandon/keymap.c @@ -20,7 +20,6 @@ enum planck_layers { }; // Key aliases for legibility -#define _______ KC_TRNS #define ___x___ KC_NO // Macros diff --git a/keyboards/planck/keymaps/brandon/rules.mk b/keyboards/planck/keymaps/brandon/rules.mk index 6df206578c4..30275cf1f6e 100644 --- a/keyboards/planck/keymaps/brandon/rules.mk +++ b/keyboards/planck/keymaps/brandon/rules.mk @@ -10,6 +10,3 @@ MOUSEKEY_ENABLE = yes CONSOLE_ENABLE = no BACKLIGHT_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/buhearns/config.h b/keyboards/planck/keymaps/buhearns/config.h new file mode 100644 index 00000000000..b8f3c18430f --- /dev/null +++ b/keyboards/planck/keymaps/buhearns/config.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(MARIO_MUSHROOM) + #define UNICODE_SONG_OSX SONG(COIN_SOUND) + #define UNICODE_SONG_LNX SONG(UNICODE_LINUX) + #define UNICODE_SONG_WIN SONG(UNICODE_WINDOWS) + #define UNICODE_SONG_WINC SONG(UNICODE_WINDOWS) +#endif + +#define ENCODER_RESOLUTION 4 +#define MOUSEKEY_DELAY 300 +#define MOUSEKEY_INTERVAL 50 +#define MOUSEKEY_MAX_SPEED 8 +#define MOUSEKEY_TIME_TO_MAX 20 diff --git a/keyboards/planck/keymaps/buhearns/keymap.c b/keyboards/planck/keymaps/buhearns/keymap.c new file mode 100644 index 00000000000..4821ece5713 --- /dev/null +++ b/keyboards/planck/keymaps/buhearns/keymap.c @@ -0,0 +1,99 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum custom_keycodes { + B_UPD = SAFE_RANGE, + B_SSH, + B_SSHK, + B_USR, + B_X11, + B_X12, + B_X13 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[0] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT(5,KC_TAB),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(4,KC_BSLS), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT,KC_ENT), + KC_LCTL, KC_LGUI, KC_LALT, MO(3), MO(2), KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[1] = LAYOUT_planck_grid( + KC_TRNS, B_UPD, B_USR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_DEL, + KC_TRNS, B_SSH, B_SSHK, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_4, KC_5, KC_6, KC_TRNS, + KC_TRNS, B_X11, B_X12, B_X13, KC_NO, KC_NO, KC_NO, KC_NO, KC_1, KC_2, KC_3, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_PDOT, KC_PPLS, KC_PMNS +), + +[2] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLSH, KC_QUOT, KC_MINS, KC_LCBR, KC_RCBR, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DQUO, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UNDS, KC_LT, KC_GT, KC_NO +), + +[3] = LAYOUT_planck_grid( + KC_TRNS, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_PGUP, KC_MS_U, KC_PGDN, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_HOME, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_BTN3, KC_END +), + +[4] = LAYOUT_planck_grid( + KC_TRNS, RESET, DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, MU_MOD, MUV_IN, MU_ON, AU_ON, KC_EJCT, + KC_TRNS, EEP_RST, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, MUV_DE, MU_OFF, AU_OFF, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_MPRV, KC_MNXT, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_VOLD, KC_VOLU, KC_MPLY +), + +[5] = LAYOUT_planck_grid( + UC(0xB0), UC(0xB9), UC(0xB2), UC(0xB3), UC(0xDF), UC(0x20AC), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, UC(0xC4), UC(0xD6), UC(0xDC), UC(0xBB), UC(0xAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, UC(0xE4), UC(0xF6), UC(0xFC), UC(0x2022), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, UC_M_OS, UC_M_LN, UC_M_WI, UC_M_WC +)}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case B_UPD: + if (record->event.pressed) { + SEND_STRING("sudo apt update && sudo apt full-upgrade -yyy" SS_TAP(X_ENTER)); + } + break; + case B_SSH: + if (record->event.pressed) { + SEND_STRING("cd /etc/ssh" SS_TAP(X_ENTER) "sudo shasum ssh_host_*" SS_TAP(X_ENTER) "sudo rm ssh_host_*" SS_TAP(X_ENTER) "sudo dpkg-reconfigure openssh-server" SS_TAP(X_ENTER)); + } + break; + case B_SSHK: + if (record->event.pressed) { + SEND_STRING("ssh-keygen -t ed25519" SS_TAP(X_ENTER) SS_TAP(X_ENTER) SS_TAP(X_ENTER) SS_TAP(X_ENTER)); + } + break; + case B_USR: + if (record->event.pressed) { + SEND_STRING("useradd -m user" SS_TAP(X_ENTER) "usermod -a -G sudo user" SS_TAP(X_ENTER) "chsh -s /bin/bash user" SS_TAP(X_ENTER) "passwd user" SS_TAP(X_ENTER)); + } + break; + case B_X11: + if (record->event.pressed) { + SEND_STRING("sudo x11vnc -storepasswd /etc/x11vnc.pass" SS_TAP(X_ENTER)); + } + break; + case B_X12: + if (record->event.pressed) { + SEND_STRING("sudo nano /lib/systemd/system/x11vnc.service" SS_TAP(X_ENTER) "[Unit]" SS_TAP(X_ENTER) "Description=Start X11VNC" SS_TAP(X_ENTER) "After=multi-user.target" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "[Service]" SS_TAP(X_ENTER) "Type=simple" SS_TAP(X_ENTER) "ExecStart=/usr/bin/x11vnc -display :0 -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared -localhost -o /var/log/x11vnc.log" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "[Install]" SS_TAP(X_ENTER) "WantedBy=multi-user.target"); + } + break; + case B_X13: + if (record->event.pressed) { + SEND_STRING("sudo systemctl enable x11vnc.service" SS_TAP(X_ENTER)); + } + break; + } + return true; +}; diff --git a/keyboards/planck/keymaps/buhearns/readme.md b/keyboards/planck/keymaps/buhearns/readme.md new file mode 100644 index 00000000000..4dcf4f05dbb --- /dev/null +++ b/keyboards/planck/keymaps/buhearns/readme.md @@ -0,0 +1,20 @@ +Buhearns Keymap (February 12th, 2019) +===================================== + +Simple QWERTY keymap with german Unicode umlauts, special characters and several Linux commands. Intended to be working with ENGLISH layout. + + +## Buhearns base layer +``` + ,-----------------------------------------------------------------------------------. + | GESC | Q | W | E | R | T | Y | U | I | O | P | BKSP | + |------+------+------+------+------+-------------+------+------+------+------+------| + |M5/TAB| A | S | D | F | G | H | J | K | L | ; |M4/BSL| hold: M5, tap: TAB // hold: M4, tap: Backslash + |------+------+------+------+------+------|------+------+------+------+------+------| + |LSHIFT| Z | X | C | V | B | N | M | , | . | / |ST/ENT| hold: RSHIFT, tap: Enter + |------+------+------+------+------+------+------+------+------+------+------+------| + | CTRL | LGUI | LALT | M3 | M2 | SPACE | M1 | LEFT | DOWN | UP | RIGHT| + `-----------------------------------------------------------------------------------' +``` + +## Other layers are a WIP and being tested (DON'T WAIT FOR UPDATES!) diff --git a/keyboards/planck/keymaps/buhearns/rules.mk b/keyboards/planck/keymaps/buhearns/rules.mk new file mode 100644 index 00000000000..5c11b51a28e --- /dev/null +++ b/keyboards/planck/keymaps/buhearns/rules.mk @@ -0,0 +1,13 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/callum/config.h b/keyboards/planck/keymaps/callum/config.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 1cffe15d465..2a7a53d38df 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -1,323 +1,259 @@ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" -extern keymap_config_t keymap_config; +#define a KC_A +#define b KC_B +#define c KC_C +#define d KC_D +#define e KC_E +#define f KC_F +#define g KC_G +#define h KC_H +#define i KC_I +#define j KC_J +#define k KC_K +#define l KC_L +#define m KC_M +#define n KC_N +#define o KC_O +#define p KC_P +#define q KC_Q +#define r KC_R +#define s KC_S +#define t KC_T +#define u KC_U +#define v KC_V +#define w KC_W +#define x KC_X +#define y KC_Y +#define z KC_Z -#define G(X) LGUI(X) -#define A(X) LALT(X) -#define C(X) LCTL(X) -#define AC(X) A(C(X)) -#define SC(X) S(C(X)) -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#define lalt KC_LALT +#define lctl KC_LCTL +#define lsft KC_LSFT +#define ralt KC_RALT +#define rctl KC_RCTL +#define rsft KC_RSFT -enum planck_layers { - _COLEMAK, - _QWERTY, - _SYMB, - _MOVE, - _FUNC, -}; +#define n0 KC_0 +#define n1 KC_1 +#define n2 KC_2 +#define n3 KC_3 +#define n4 KC_4 +#define n5 KC_5 +#define n6 KC_6 +#define n7 KC_7 +#define n8 KC_8 +#define n9 KC_9 -enum planck_keycodes { - COLEMAK = SAFE_RANGE, - QWERTY, +#define bspc KC_BSPC +#define caps KC_CAPS +#define comm KC_COMM +#define dash A(KC_MINS) +#define scln KC_SCLN +#define slsh KC_SLSH +#define spc KC_SPC +#define tab KC_TAB +#define del KC_DEL +#define dot KC_DOT +#define ent KC_ENT +#define mins KC_MINS +#define quot KC_QUOT +#define esc KC_ESC +#define gbp A(KC_3) + +#define down KC_DOWN +#define home KC_HOME +#define end KC_END +#define up KC_UP +#define pgdn KC_PGDN +#define pgup KC_PGUP +#define left KC_LEFT +#define rght KC_RGHT + +#define tabl S(C(KC_TAB)) +#define tabr C(KC_TAB) +#define fwd G(KC_RBRC) +#define back G(KC_LBRC) +#define dtl C(KC_LEFT) +#define dtr C(KC_RGHT) +#define slup S(A(KC_UP)) +#define sldn S(A(KC_DOWN)) + +#define f1 KC_F1 +#define f2 KC_F2 +#define f3 KC_F3 +#define f4 KC_F4 +#define f5 KC_F5 +#define f6 KC_F6 +#define f7 KC_F7 +#define f8 KC_F8 +#define f9 KC_F9 +#define f10 KC_F10 +#define f11 KC_F11 +#define f12 KC_F12 +#define f13 KC_F13 +#define f14 KC_F14 +#define f15 KC_F15 +#define f16 KC_F16 +#define f17 KC_F17 +#define f18 KC_F18 +#define f19 KC_F19 +#define f20 KC_F20 + +#define mute KC_MUTE +#define next KC_MNXT +#define play KC_MPLY +#define prev KC_MPRV +#define vold KC_F11 +#define volu KC_F12 + +#define symb MO(SYMB) +#define move MO(MOVE) +#define func MO(FUNC) + +#define rset RESET +#define powr KC_POWER + +#define ____ KC_TRNS +#define xxxx KC_NO + +extern keymap_config_t keymap_config; + +enum planck_layers { + BASE, SYMB, MOVE, FUNC, }; -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +enum planck_keycodes { + ampr = SAFE_RANGE, + astr, + at, + bsls, + circ, + dlr, + eql, + exlm, + grv, + hash, + lbrc, + lcbr, + lprn, + perc, + pipe, + plus, + rbrc, + rcbr, + rprn, + tild, - /* COLEMAK - * ,-----------------------------------------------------------------------. - * |Tab | Q | W | F | P | G | J | L | U | Y | ; | - | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Bksp | A | R | S | T | D | H | N | E | I | O | ' | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Shift| Z | X | C | V | B | K | M | , | . | / |Shift| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Func |Ctrl | Alt |Super|Symb |Enter|Space|Move |Super| Alt |Ctrl |Func | - * `-----------------------------------------------------------------------' - */ - [_COLEMAK] = { - { - KC_TAB, KC_Q, KC_W, KC_F, - KC_P, KC_G, KC_J, KC_L, - KC_U, KC_Y, KC_SCLN, KC_MINS - }, - { - KC_BSPC, KC_A, KC_R, KC_S, - KC_T, KC_D, KC_H, KC_N, - KC_E, KC_I, KC_O, KC_QUOT - }, - { - KC_LSFT, KC_Z, KC_X, KC_C, - KC_V, KC_B, KC_K, KC_M, - KC_COMM, KC_DOT, KC_SLSH, KC_RSFT - }, - { - FUNC, KC_LCTL, KC_LALT, KC_LGUI, - SYMB, KC_ENT, KC_SPC, MOVE, - KC_RGUI, KC_RALT, KC_RCTL, FUNC - } - }, + cmd, +}; - /* QWERTY - * ,-----------------------------------------------------------------------. - * |Tab | Q | W | E | R | T | Y | U | I | O | P | - | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Bksp | A | S | D | F | G | H | J | K | L | ; | ' | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Shift| Z | X | C | V | B | N | M | , | . | / |Shift| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Func |Ctrl | Alt |Super|Symb |Enter|Space|Move |Super| Alt |Ctrl |Func | - * `-----------------------------------------------------------------------' - */ - [_QWERTY] = { - { - KC_TAB, KC_Q, KC_W, KC_E, - KC_R, KC_T, KC_Y, KC_U, - KC_I, KC_O, KC_P, KC_MINS - }, - { - KC_BSPC, KC_A, KC_S, KC_D, - KC_F, KC_G, KC_H, KC_J, - KC_K, KC_L, KC_SCLN, KC_QUOT - }, - { - KC_LSFT, KC_Z, KC_X, KC_C, - KC_V, KC_B, KC_N, KC_M, - KC_COMM, KC_DOT, KC_SLSH, KC_RSFT - }, - { - FUNC, KC_LCTL, KC_LALT, KC_LGUI, - SYMB, KC_ENT, KC_SPC, MOVE, - KC_RGUI, KC_RALT, KC_RCTL, FUNC - } - }, +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_planck_grid( + tab, q, w, f, p, g, j, l, u, y, scln, mins, + bspc, a, r, s, t, d, h, n, e, i, o, quot, + lsft, z, x, c, v, b, k, m, comm, dot, slsh, rsft, + func, lctl, lalt, cmd, move, ent, spc, symb, cmd, ralt, rctl, func + ), - /* SYMB - * ,-----------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ - [_SYMB] = { - { - KC_ESC, KC_1, KC_2, KC_3, - KC_4, KC_5, KC_6, KC_7, - KC_8, KC_9, KC_0, _______ - }, - { - KC_DEL, KC_EXLM, KC_AT, KC_HASH, - KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, - KC_ASTR, KC_LPRN, KC_RPRN, _______ - }, - { - _______, KC_TILD, KC_GRV, KC_PLUS, - KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, - KC_RBRC, KC_LCBR, KC_RCBR, _______ - }, - { - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______ - } - }, + [SYMB] = LAYOUT_planck_grid( + esc, n7, n5, n3, n1, n9, n8, n0, n2, n4, n6, dash, + del, bsls, hash, astr, eql, pipe, at, rprn, lprn, dlr, ampr, gbp, + caps, grv, exlm, lbrc, rbrc, circ, tild, rcbr, lcbr, plus, perc, caps, + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ + ), - /* MOVE - * ,-----------------------------------------------------------------------. - * | | | | | | | |Home | Up | End | | Esc | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |Left |Down |Right|Caps | Del | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |PgDn |PgUp |TabL |TabR | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ - [_MOVE] = { - { - AC(KC_A), AC(KC_B), AC(KC_C), AC(KC_D), - AC(KC_E), AC(KC_F), XXXXXXX, KC_HOME, - KC_UP, KC_END, XXXXXXX, KC_ESC - }, - { - AC(KC_G), AC(KC_H), AC(KC_I), AC(KC_J), - AC(KC_K), AC(KC_L), XXXXXXX, KC_LEFT, - KC_DOWN, KC_RGHT, KC_CAPS, KC_DEL - }, - { - _______, AC(KC_M), AC(KC_N), AC(KC_O), - AC(KC_P), AC(KC_Q), XXXXXXX, KC_PGDN, - KC_PGUP, SC(KC_TAB), C(KC_TAB), _______ - }, - { - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______ - } - }, + [MOVE] = LAYOUT_planck_grid( + esc, xxxx, slup, dtl, dtr, xxxx, xxxx, home, up, end, xxxx, xxxx, + del, xxxx, sldn, tabl, tabr, xxxx, xxxx, left, down, rght, xxxx, xxxx, + ____, xxxx, xxxx, back, fwd, xxxx, xxxx, pgdn, pgup, xxxx, xxxx, ____, + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ + ), - /* FUNC - * ,-----------------------------------------------------------------------. - * |Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |VolUp| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Power| F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 |VolDn| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | |TabL |TabR | | | | |Clmak|Qwrty| | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | |Prev |Mute |Play |Next | | | | | - * `-----------------------------------------------------------------------' - */ - [_FUNC] = { - { - RESET, KC_F1, KC_F2, KC_F3, - KC_F4, KC_F5, KC_F6, KC_F7, - KC_F8, KC_F9, KC_F10, KC_VOLU - }, - { - KC_POWER, KC_F11, KC_F12, KC_F13, - KC_F14, KC_F15, KC_F16, KC_F17, - KC_F18, KC_F19, KC_F20, KC_VOLD - }, - { - _______, XXXXXXX, XXXXXXX, SC(KC_TAB), - C(KC_TAB), XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, COLEMAK, QWERTY, _______ - }, - { - _______, _______, _______, _______, - KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT, - _______, _______, _______, _______ - } - } + [FUNC] = LAYOUT_planck_grid( + rset, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, volu, + powr, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, vold, + ____, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, ____, + ____, ____, ____, ____, prev, mute, play, next, ____, ____, ____, ____ + ), }; -#ifdef AUDIO_ENABLE -float colemak_song[][2] = SONG(COLEMAK_SOUND); -float qwerty_song[][2] = SONG(QWERTY_SOUND); -#endif - -void set_colemak(void) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(colemak_song); -#endif - set_single_persistent_default_layer(_COLEMAK); +bool send_string_if_keydown(keyrecord_t *record, const char *s) { + if (record->event.pressed) { + send_string(s); + } + return true; } -void set_qwerty(void) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(qwerty_song); -#endif - set_single_persistent_default_layer(_QWERTY); -} +int cmd_keys_down = 0; bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case COLEMAK: - if (record->event.pressed) { - set_colemak(); - } - return false; - case QWERTY: - if (record->event.pressed) { - set_qwerty(); - } - return false; - case SYMB: - if (record->event.pressed) { - layer_on(_SYMB); - } else { - layer_off(_SYMB); - } - return false; - case MOVE: - if (record->event.pressed) { - layer_on(_MOVE); - } else { - layer_off(_MOVE); - } - return false; - case FUNC: + // Override the defualt auto shifted symbols to use SEND_STRING See + // https://github.com/qmk/qmk_firmware/issues/4072 + case ampr: + return send_string_if_keydown(record, "&"); + case astr: + return send_string_if_keydown(record, "*"); + case at: + return send_string_if_keydown(record, "@"); + case bsls: + return send_string_if_keydown(record, "\\"); + case circ: + return send_string_if_keydown(record, "^"); + case dlr: + return send_string_if_keydown(record, "$"); + case eql: + return send_string_if_keydown(record, "="); + case exlm: + return send_string_if_keydown(record, "!"); + case grv: + return send_string_if_keydown(record, "`"); + case hash: + return send_string_if_keydown(record, "#"); + case lbrc: + return send_string_if_keydown(record, "["); + case lcbr: + return send_string_if_keydown(record, "{"); + case lprn: + return send_string_if_keydown(record, "("); + case perc: + return send_string_if_keydown(record, "%"); + case pipe: + return send_string_if_keydown(record, "|"); + case plus: + return send_string_if_keydown(record, "+"); + case rbrc: + return send_string_if_keydown(record, "]"); + case rcbr: + return send_string_if_keydown(record, "}"); + case rprn: + return send_string_if_keydown(record, ")"); + case tild: + return send_string_if_keydown(record, "~"); + + // cmd + cmd -> cmd + ctl + case cmd: if (record->event.pressed) { - layer_on(_FUNC); + if (cmd_keys_down == 0) { + register_code(KC_LCMD); + } else { + register_code(KC_LCTL); + } + cmd_keys_down++; } else { - layer_off(_FUNC); + if (cmd_keys_down == 1) { + unregister_code(KC_LCMD); + } else { + unregister_code(KC_LCTL); + } + cmd_keys_down--; } - return false; - - // Override the defualt auto shifted symbols to use SEND_STRING - // See https://github.com/qmk/qmk_firmware/issues/4072 - case KC_EXLM: - if (record->event.pressed) { SEND_STRING("!"); } - return false; - case KC_AT: - if (record->event.pressed) { SEND_STRING("@"); } - return false; - case KC_HASH: - if (record->event.pressed) { SEND_STRING("#"); } - return false; - case KC_DLR: - if (record->event.pressed) { SEND_STRING("$"); } - return false; - case KC_PERC: - if (record->event.pressed) { SEND_STRING("%"); } - return false; - case KC_CIRC: - if (record->event.pressed) { SEND_STRING("^"); } - return false; - case KC_AMPR: - if (record->event.pressed) { SEND_STRING("&"); } - return false; - case KC_ASTR: - if (record->event.pressed) { SEND_STRING("*"); } - return false; - case KC_LPRN: - if (record->event.pressed) { SEND_STRING("("); } - return false; - case KC_RPRN: - if (record->event.pressed) { SEND_STRING(")"); } - return false; - case KC_TILD: - if (record->event.pressed) { SEND_STRING("~"); } - return false; - case KC_GRV: - if (record->event.pressed) { SEND_STRING("`"); } - return false; - case KC_PLUS: - if (record->event.pressed) { SEND_STRING("+"); } - return false; - case KC_EQL: - if (record->event.pressed) { SEND_STRING("="); } - return false; - case KC_PIPE: - if (record->event.pressed) { SEND_STRING("|"); } - return false; - case KC_BSLS: - if (record->event.pressed) { SEND_STRING("\\"); } - return false; - case KC_LBRC: - if (record->event.pressed) { SEND_STRING("["); } - return false; - case KC_RBRC: - if (record->event.pressed) { SEND_STRING("]"); } - return false; - case KC_LCBR: - if (record->event.pressed) { SEND_STRING("{"); } - return false; - case KC_RCBR: - if (record->event.pressed) { SEND_STRING("}"); } - return false; + return true; } return true; } diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md index 176211cd4bc..190c2b23a55 100644 --- a/keyboards/planck/keymaps/callum/readme.md +++ b/keyboards/planck/keymaps/callum/readme.md @@ -1,11 +1,11 @@ -# callum’s planck layout +# callum's planck layout This is a layout for the grid planck, built with a few ideals in mind: - Consistent and minimal response times should be maintained. Keys that react differently depending on whether they are tapped or held, keys that react - differently if they are double tapped, etc. should be avoided -- they - inevitably send their keycode later than a normal key -- interrupting the + differently if they are double tapped, etc. should be avoided – they + inevitably send their keycode later than a normal key – interrupting the immediate feedback from the screen. Therefore we restrict ourselves to chording as our only means of getting more than one symbol out of a single physical key. @@ -17,68 +17,22 @@ This is a layout for the grid planck, built with a few ideals in mind: - There should be two of every modifier (one on each side), otherwise certain long key combinations become hard to make. -Keys are arranged as follows. Blank keys below may actually contain -undocumented shortcuts specific to my workflow. The base layer can be set to -colemak or qwerty (from the function layer). +- It should be possible to do things you might want to do while using the mouse + with only the left hand (e.g. change tabs, navigate back or forwards in + browser history). -``` -/* COLEMAK - * ,-----------------------------------------------------------------------. - * |Tab | Q | W | F | P | G | J | L | U | Y | ; | - | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Bksp | A | R | S | T | D | H | N | E | I | O | ' | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Shift| Z | X | C | V | B | K | M | , | . | / |Shift| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |FUNC |Super| Alt |Ctrl |SYMB |Enter|Space|MOVE |Ctrl | Alt |Super|FUNC | - * `-----------------------------------------------------------------------' - */ +- Symbols should be arranged so that the most frequently used are easiest to + reach. This includes numbers, and lower numbers are more commonly used than + higher ones. (number arrangement borrowed from [dustypomeleau's minidox + layout][]. -/* QWERTY - * ,-----------------------------------------------------------------------. - * |Tab | Q | W | E | R | T | Y | U | I | O | P | - | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Bksp | A | S | D | F | G | H | J | K | L | ; | ' | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Shift| Z | X | C | V | B | N | M | , | . | / |Shift| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |FUNC |Super| Alt |Ctrl |SYMB |Enter|Space|MOVE |Ctrl | Alt |Super|FUNC | - * `-----------------------------------------------------------------------' - */ +Layout rendered with [keyboard-layout-editor.com][]: -/* SYMB - * ,-----------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ +![](https://callum-oakley.github.io/images/keymap.png) -/* MOVE - * ,-----------------------------------------------------------------------. - * | | | | | | | |Home | Up | End | | Esc | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |Left |Down |Right|Caps | Del | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | |PgDn |PgUp | | | | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ +The only behaviour not captured in this graphic is: pressing both cmd keys will +send cmd+ctrl. See [keymap.c][] for details. -/* FUNC - * ,-----------------------------------------------------------------------. - * |Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |VolUp| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Power| F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 |VolDn| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | F21 | F22 | F23 | F24 | | | | |COLMK|QWRTY| | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | | | |Prev |Mute |Play |Next | | | | | - * `-----------------------------------------------------------------------' - */ - ``` +[dustypomeleau's minidox layout]: https://github.com/qmk/qmk_firmware/tree/master/keyboards/minidox/keymaps/dustypomerleau +[keyboard-layout-editor.com]: http://www.keyboard-layout-editor.com +[keymap.c]: keymap.c diff --git a/keyboards/planck/keymaps/callum/rules.mk b/keyboards/planck/keymaps/callum/rules.mk index 67fe8d284d5..db87d5ecec7 100644 --- a/keyboards/planck/keymaps/callum/rules.mk +++ b/keyboards/planck/keymaps/callum/rules.mk @@ -3,7 +3,7 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration @@ -17,7 +17,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/cbbrowne/config.h b/keyboards/planck/keymaps/cbbrowne/config.h index 0bb508385c6..4ec7d081ba8 100644 --- a/keyboards/planck/keymaps/cbbrowne/config.h +++ b/keyboards/planck/keymaps/cbbrowne/config.h @@ -41,7 +41,6 @@ /* Filler to make layering a bit clearer * * borrowed from basic keymap */ -#define _______ KC_TRNS #define _____ KC_NO #endif diff --git a/keyboards/planck/keymaps/cbbrowne/keymap.c b/keyboards/planck/keymaps/cbbrowne/keymap.c index 8fdbcf1a7d4..f5e9cdbcd8c 100644 --- a/keyboards/planck/keymaps/cbbrowne/keymap.c +++ b/keyboards/planck/keymaps/cbbrowne/keymap.c @@ -153,11 +153,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; - -/* What is fn_actions actually used for??? */ -const uint16_t PROGMEM fn_actions[] = { -}; - /* This bit of logic seeds a wee linear congruential random number generator */ /* lots of prime numbers everywhere... */ static uint16_t random_value = 157; diff --git a/keyboards/planck/keymaps/cbbrowne/readme.md b/keyboards/planck/keymaps/cbbrowne/readme.md deleted file mode 100644 index e55b130efff..00000000000 --- a/keyboards/planck/keymaps/cbbrowne/readme.md +++ /dev/null @@ -1,122 +0,0 @@ -cbbrowne custom keyboard -============================== - -Due to cbbrowne@acm.org -Christopher Browne - -This was originally based on the default keyboard map, but I have been -doing sundry experimentation: - -1. Useful Experiments ----------------------------------------- - - * It made sense to mess around some with keyboard maps. - - I added a keypad, originally based on keymaps/numpad.c, but - mighty substantially revised, as that one seems to be rotated 90 - degrees from usual conventions for number pads - * The keypad layer also includes some sample "hacks" of cool things, - all using actions attached in using the function action_get_macro() - - Key [1][2] aka "q" types out my name, cbbrowne, as a fun example - of a key generating a bunch of keystrokes. The keystroke is - sufficiently inconvenient that it isn't terribly practical for me - to use it, but hey, it shows how others might use this facility - in a more useful context. - - Key [2][2] aka "a" uses a random number generator to select a digit 0-9 at random - - Key [3][2] aka "z" uses a random number generator to select a letter a-z at random - - Key [1][3] aka "e" spits out the keymap version number - * Trying out sgoodwin's "hold Enter down to get Shift" - - Liking this Quite Well Enough... - - Applied this to both Shift and Quote - - It seems likely that Alt should get a right-hand-side, akin to this... - - Alt needs to move, and get a RHS - - Hence ALTRIGHT, and shifted ROT_LED over - - Emacs likes this!!! :-) - - I'm suspicious that I'll want to shift ROT_LED another location over, - so some modifier can replace the OS/KC_LGUI key - * I have added an alternate ADJUST layer that is activated via update_tri_layer() - - e.g. - LOWER+RAISE simultaneously - - This seems entirely more useful for handling my "special keys" - like the random numbers, user name, and such, than the keypad layer - * The _ADJUST layer provides a good place to have RESET - - But this isn't strictly enough; I want RESET somewhat accessible from - main layer lest an error hide that layer - - I never use the OS/KC_LGUI key (that's Command on MacOS, Windows - Key on Windows), so that's a good place to have it as a chord of - some sort - - -2. Some code structure ideas ---------------------------------------------------- - - Each layer is given a name to aid in readability, which is then - used in the keymap matrix below. The underscores do not denote - anything - you can have a layer called STUFF or any other name. - - Layer names don't all need to be of the same length, obviously, and - you could also skip them entirely and just use numbers, though that - means needing to manage the numbers. - - It is preferable to keep the symbols short so that a line worth of - key mappings fits compactly onto a line of code. It might be an - interesting idea to express the maps rotated 90%, so that you - only need to fit 4 symbols onto each line, rather than 12. - - I use enums to manage layer IDs and macro IDs so that I don't need - to care (beyond "start at 0", and arguably even that's not needed) - about their values. - -3. Things I did not like about the default mapping ---------------------------------------------------------- - - * I found control too hard to get to. I use it more than Tab, so - switched it there. - * Having dash on [lower-j] is a bit nonintuitive, but may be OK - * I switched ESC/TAB/M(0) around - * I'm suspicious that I want to shift M(0) from [4][1] to [4][2], - and shift ESC off the first column so KC_LCTL and KC_LALT can - be on the first column. - * I needed to swap ' and ENTER - -4. Unuseful experiments ---------------------------------------------------------- - -I have tried some things out that didn't turn out particularly well. -I'll note some of these for posterity, hopefully helpful in not doing -unwise things again... - - * I tried added Workman alongside Dvorak and Colemak - - Boy, oh boy, these don't help!!! - - I have done 30 years of learning of Emacs key mappings, and - these alternative keyboards massively mess me up - - * Space Cadet Shift; switching L_SHIFT to KC_LSP0, so that when I - just hit SHIFT, I get a left parens. In principle, this is great - for Lisping. - - Unfortunately, there are times when mouse interfaces use SHIFT - to allow selecting multiple items, and this really interferes - with that - -5. TODO ---------------------------------------------------------- - - * I use tmux quite a lot; the mollat keymap seems to have some - interesting helpers. It might be interesting to add a "tmux - layer," or to have a few keys in a layer oriented towards that - - Keys for... - - Picking windows 0 thru 8 - - next/prev/new window - * The mollat tmux layer also suggests some thoughts about Emacs - helpers. - * I do not presently have anything that handles X11 screen - switching, as with Control-Alt-various - * I ought to probably look into KC_LEAD, to have some key combos - that do not need to be concurrent - * The jeebak keymap seems to have some neat ideas: - - Number layer which is aggressive about having numbers in several places - - TouchCursor layer seems interesting - - It sets up a layer with cursor keys on the home keys - * The jeremy-dev keymap has some very interesting concepts - - Shift hands outwards; the special keys go in the center - - Symbol layer has some compound keys for C operators like /=, *=, -=, +=, ... - - This is likely what I'll use for my XD75re, and maybe I'll fork a - planck keymap for similar diff --git a/keyboards/planck/keymaps/cbbrowne/readme.org b/keyboards/planck/keymaps/cbbrowne/readme.org new file mode 100644 index 00000000000..2b100585843 --- /dev/null +++ b/keyboards/planck/keymaps/cbbrowne/readme.org @@ -0,0 +1,117 @@ +* cbbrowne custom keyboard + + Due to cbbrowne@acm.org + Christopher Browne + + This was originally based on the default keyboard map, but I have + been doing sundry experimentation: + +** Useful Experiments + + - It made sense to mess around some with keyboard maps. + - I added a keypad, originally based on keymaps/numpad.c, but + mighty substantially revised, as that one seems to be rotated 90 + degrees from usual conventions for number pads + - The keypad layer also includes some sample "hacks" of cool things, + all using actions attached in using the function action_get_macro() + - Key [1][2] aka "q" types out my name, cbbrowne, as a fun example + of a key generating a bunch of keystrokes. The keystroke is + sufficiently inconvenient that it isn't terribly practical for me + to use it, but hey, it shows how others might use this facility + in a more useful context. + - Key [2][2] aka "a" uses a random number generator to select a digit 0-9 at random + - Key [3][2] aka "z" uses a random number generator to select a letter a-z at random + - Key [1][3] aka "e" spits out the keymap version number + - Trying out sgoodwin's "hold Enter down to get Shift" + - Liking this Quite Well Enough... + - Applied this to both Shift and Quote + - It seems likely that Alt should get a right-hand-side, akin to this... + - Alt needs to move, and get a RHS + - Hence ALTRIGHT, and shifted ROT_LED over + - Emacs likes this!!! :-) + - I'm suspicious that I'll want to shift ROT_LED another location over, + so some modifier can replace the OS/KC_LGUI key + - I have added an alternate ADJUST layer that is activated via update_tri_layer() + - e.g. - LOWER+RAISE simultaneously + - This seems entirely more useful for handling my "special keys" + like the random numbers, user name, and such, than the keypad layer + - The _ADJUST layer provides a good place to have RESET + - But this isn't strictly enough; I want RESET somewhat accessible from + main layer lest an error hide that layer + - I never use the OS/KC_LGUI key (that's Command on MacOS, Windows + Key on Windows), so that's a good place to have it as a chord of + some sort + + +** Some code structure ideas + + Each layer is given a name to aid in readability, which is then + used in the keymap matrix below. The underscores do not denote + anything - you can have a layer called STUFF or any other name. + + Layer names don't all need to be of the same length, obviously, and + you could also skip them entirely and just use numbers, though that + means needing to manage the numbers. + + It is preferable to keep the symbols short so that a line worth of + key mappings fits compactly onto a line of code. It might be an + interesting idea to express the maps rotated 90%, so that you + only need to fit 4 symbols onto each line, rather than 12. + + I use enums to manage layer IDs and macro IDs so that I don't need + to care (beyond "start at 0", and arguably even that's not needed) + about their values. + +** Things I did not like about the default mapping + + + - I found control too hard to get to. I use it more than Tab, so + switched it there. + - Having dash on [lower-j] is a bit nonintuitive, but may be OK + - I switched ESC/TAB/M(0) around + - I'm suspicious that I want to shift M(0) from [4][1] to [4][2], + and shift ESC off the first column so KC_LCTL and KC_LALT can + be on the first column. + - I needed to swap ' and ENTER + +** Unuseful experiments + +I have tried some things out that didn't turn out particularly well. +I'll note some of these for posterity, hopefully helpful in not doing +unwise things again... + + - I tried added Workman alongside Dvorak and Colemak + - Boy, oh boy, these don't help!!! + - I have done 30 years of learning of Emacs key mappings, and + these alternative keyboards massively mess me up + + - Space Cadet Shift; switching L_SHIFT to KC_LSP0, so that when I + just hit SHIFT, I get a left parens. In principle, this is great + for Lisping. + - Unfortunately, there are times when mouse interfaces use SHIFT + to allow selecting multiple items, and this really interferes + with that + +** TODO + + - I use tmux quite a lot; the mollat keymap seems to have some + interesting helpers. It might be interesting to add a "tmux + layer," or to have a few keys in a layer oriented towards that + - Keys for... + - Picking windows 0 thru 8 + - next/prev/new window + - The mollat tmux layer also suggests some thoughts about Emacs + helpers. + - I do not presently have anything that handles X11 screen + switching, as with Control-Alt-various + - I ought to probably look into KC_LEAD, to have some key combos + that do not need to be concurrent + - The jeebak keymap seems to have some neat ideas: + - Number layer which is aggressive about having numbers in several places + - TouchCursor layer seems interesting + - It sets up a layer with cursor keys on the home keys + - The jeremy-dev keymap has some very interesting concepts + - Shift hands outwards; the special keys go in the center + - Symbol layer has some compound keys for C operators like /=, *=, -=, +=, ... + - This is likely what I'll use for my XD75re, and maybe I'll fork a + planck keymap for similar diff --git a/keyboards/planck/keymaps/cbbrowne/rules.mk b/keyboards/planck/keymaps/cbbrowne/rules.mk index c7cef55a9af..45d6837399a 100644 --- a/keyboards/planck/keymaps/cbbrowne/rules.mk +++ b/keyboards/planck/keymaps/cbbrowne/rules.mk @@ -19,6 +19,3 @@ API_SYSEX_ENABLE = no # Enable SYSEX API (+5390) # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/chance/keymap.c b/keyboards/planck/keymaps/chance/keymap.c index e769ed84eb1..df57d5828b2 100644 --- a/keyboards/planck/keymaps/chance/keymap.c +++ b/keyboards/planck/keymaps/chance/keymap.c @@ -38,10 +38,6 @@ enum planck_keycodes { EXT_PLV }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/planck/keymaps/chance/rules.mk b/keyboards/planck/keymaps/chance/rules.mk index 5c9798a5726..2febfd96992 100644 --- a/keyboards/planck/keymaps/chance/rules.mk +++ b/keyboards/planck/keymaps/chance/rules.mk @@ -1,6 +1,3 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. AUDIO_ENABLE = no -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/charlie/rules.mk b/keyboards/planck/keymaps/charlie/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/charlie/rules.mk +++ b/keyboards/planck/keymaps/charlie/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/circuit/keymap.c b/keyboards/planck/keymaps/circuit/keymap.c index 35f41c3872b..c2399bf3053 100644 --- a/keyboards/planck/keymaps/circuit/keymap.c +++ b/keyboards/planck/keymaps/circuit/keymap.c @@ -32,8 +32,6 @@ enum planck_keycodes { #define SFT_ENT FUNC(0) // Tap for enter, hold for right shift #define LOCK FUNC(1) #define KC_PSTE KC_PASTE -#define _______ KC_TRNS -#define XXXXXXX KC_NO #ifdef TAP_DANCE_ENABLE #define SFT_CAP TD(0) // Left shift, double tap for caps diff --git a/keyboards/planck/keymaps/circuit/rules.mk b/keyboards/planck/keymaps/circuit/rules.mk index e9a02e31e20..b527d82971d 100644 --- a/keyboards/planck/keymaps/circuit/rules.mk +++ b/keyboards/planck/keymaps/circuit/rules.mk @@ -20,6 +20,3 @@ TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/coloneljesus/rules.mk b/keyboards/planck/keymaps/coloneljesus/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/planck/keymaps/coloneljesus/rules.mk +++ b/keyboards/planck/keymaps/coloneljesus/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/daniel/rules.mk b/keyboards/planck/keymaps/daniel/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/daniel/rules.mk +++ b/keyboards/planck/keymaps/daniel/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/danielhklein/keymap.c b/keyboards/planck/keymaps/danielhklein/keymap.c index b5ab1354c57..25463cf17c8 100644 --- a/keyboards/planck/keymaps/danielhklein/keymap.c +++ b/keyboards/planck/keymaps/danielhklein/keymap.c @@ -22,10 +22,6 @@ enum custom_keycodes { ARROW }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY diff --git a/keyboards/planck/keymaps/david/rules.mk b/keyboards/planck/keymaps/david/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/david/rules.mk +++ b/keyboards/planck/keymaps/david/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/davidrambo/config.h b/keyboards/planck/keymaps/davidrambo/config.h index 2decb3dc8de..ccb18de3dd8 100644 --- a/keyboards/planck/keymaps/davidrambo/config.h +++ b/keyboards/planck/keymaps/davidrambo/config.h @@ -1,8 +1,6 @@ -#ifndef CONFIG_USER_H +#pragma once -#define CONFIG_USER_H #define TAPPING_TERM 200 -#include "../../config.h" #define PERMISSIVE_HOLD -#endif + diff --git a/keyboards/planck/keymaps/davidrambo/keymap.c b/keyboards/planck/keymaps/davidrambo/keymap.c index 5ce808aa445..b8279119442 100644 --- a/keyboards/planck/keymaps/davidrambo/keymap.c +++ b/keyboards/planck/keymaps/davidrambo/keymap.c @@ -1,8 +1,5 @@ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" +#include QMK_KEYBOARD_H -//alias for clarity in layering -#define _______ KC_TRNS #define A_BSPC LALT(KC_BSPC) #define A_LEFT LALT(KC_LEFT) #define A_RGHT LALT(KC_RGHT) @@ -10,7 +7,7 @@ #define GSL LGUI(S(KC_LEFT)) #define GSR LGUI(S(KC_RGHT)) #define G_TAB LGUI(KC_TAB) -#define G_GRV LGUI(KC_GRV) // MAC: switch between windows within an application +#define G_GRV LGUI(KC_GRV) #define SftEnt SFT_T(KC_ENT) #define NAV LT(2, KC_TAB) @@ -23,8 +20,7 @@ enum { SFT_LCK }; -//alias for tapdance -#define SftLck TD(SFT_LCK) +#define SftLck TD(SFT_LCK) /* alias for tapdance */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -40,12 +36,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = { - {KC_GESC, KC_Q , KC_W , KC_F , KC_P , KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {NAV , KC_A , KC_R , KC_S , KC_T , KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {SftLck , KC_Z , KC_X , KC_C , KC_V , KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt }, - {KC_DEL , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - }, +[_COLEMAK] = LAYOUT_planck_grid( + KC_GESC, KC_Q , KC_W , KC_F , KC_P , KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + NAV , KC_A , KC_R , KC_S , KC_T , KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + SftLck , KC_Z , KC_X , KC_C , KC_V , KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt , + KC_DEL , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), /* Symbol * ,-----------------------------------------------------------------------------------. @@ -53,26 +49,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | \| | ! | @ | # | $ | % | ^ | & | * | ( | ) | =+ | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Home | End | ScUp | ScDn | F1 | F2 | -_ |Pg Up | | / | | + * | | Home | End | ScUp | ScDn | BRMD | BRMU | -_ |Pg Up | | / | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | `~ | | | |Alt(Bk)| | |Pg Dn | Vol- | Vol+ | | * `-----------------------------------------------------------------------------------' */ -[_SYMBOL] = { - {KC_LBRC, KC_1, KC_2, KC_3, KC_4 , KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC}, - {KC_BSLS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_EQL }, - {_______, KC_HOME, KC_END, KC_WH_U, KC_WH_D,KC_F1 , KC_F2 , KC_MINS, KC_PGUP, _______, _______, _______}, - {KC_GRV, _______, _______, _______, A_BSPC, _______, _______, _______, KC_PGDN, KC_VOLD, KC_VOLU, KC_MUTE} - }, +[_SYMBOL] = LAYOUT_planck_grid( + KC_LBRC, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_RBRC, + KC_BSLS, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_EQL , + _______, KC_HOME, KC_END , _______, _______, KC_BRMD, KC_BRMU, KC_MINS, KC_PGUP, _______, _______, _______, + KC_GRV, _______, _______, _______, A_BSPC , _______, _______, _______, KC_PGDN, KC_VOLD, KC_VOLU, KC_MUTE + ), /* Navigation*/ -[_NAVIGATION] = { - {_______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______}, - {_______, _______, _______, _______, _______, _______, GSL , KC_LEFT, KC_DOWN, KC_RGHT, GSR , _______}, - {_______, _______, _______, _______, _______, _______, G_TAB , KC_HOME, _______, KC_END, G_GRV , _______}, - {RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -} +[_NAVIGATION] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______, + _______, _______, _______, _______, _______, _______, GSL , KC_LEFT, KC_DOWN, KC_RGHT, GSR , _______, + _______, _______, _______, _______, _______, _______, G_TAB , KC_HOME, _______, KC_END, G_GRV , _______, + RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) }; // Shift vs capslock function. From bbaserdem's Planck keymap. diff --git a/keyboards/planck/keymaps/davidrambo/rules.mk b/keyboards/planck/keymaps/davidrambo/rules.mk index ffa9b870afe..4272493950e 100644 --- a/keyboards/planck/keymaps/davidrambo/rules.mk +++ b/keyboards/planck/keymaps/davidrambo/rules.mk @@ -1,6 +1,3 @@ TAP_DANCE_ENABLE = yes -MOUSEKEY_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file + diff --git a/keyboards/planck/keymaps/dbroqua/keymap.c b/keyboards/planck/keymaps/dbroqua/keymap.c index 8bfd7d022a5..256e6c4a0f1 100644 --- a/keyboards/planck/keymaps/dbroqua/keymap.c +++ b/keyboards/planck/keymaps/dbroqua/keymap.c @@ -26,10 +26,6 @@ enum planck_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Func macro definitions. #define SFT_TAB FUNC(0) // Tap for Enter, hold for Shift diff --git a/keyboards/planck/keymaps/dc/rules.mk b/keyboards/planck/keymaps/dc/rules.mk index ea4341b4fd2..07da5f19442 100644 --- a/keyboards/planck/keymaps/dc/rules.mk +++ b/keyboards/planck/keymaps/dc/rules.mk @@ -1,7 +1,3 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # Build Options # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically @@ -21,4 +17,5 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. TAP_DANCE_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/dcompact/README.md b/keyboards/planck/keymaps/dcompact/README.md deleted file mode 100644 index d3e4c7a62d4..00000000000 --- a/keyboards/planck/keymaps/dcompact/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# DCompact Layout - -**Dvorak, Layered, Mouse-Enabled, Compact -- now with Plover~** - -_See [the layout source](keymap.c) for the actual layout_ - -## Goals - -The following are the goals kept in mind when designing the DCompact -layout: - -- Provide minimal travel distance when typing English or coding -- Consistent muscle memory translation from standard QWERTY -- Stateless typing experience -- OS-agnostic features, macros, and key placement -- Minimize dependence on mouse usage - -These are generally all met or balanced within reason. This layout is -not intended at all to be a familiar layout for much of anyone (except -maybe those who already type in Dvorak) -- this is meant to amplify the -best parts of having limited, ortholinear keys with layering. - -## As Reference Material - -If you're reading this hoping to find reference material to implement -your own layout, then please feel free to copy over this layout and -make edits where you see fit. I removed a lot of the features I felt -extraneous to my usage and simplified style where I felt needed. This -would hopefully mean that my code should feel like a good base to -develop from for those new to QMK. - -_Remember that settings defined in the layout directory override and -merge with those in the keyboard folder_ - -## Relevant Links - -- ![Online Dvorak Layout Trainer](https://learn.dvorak.nl/) -- ![Dvorak Wikipedia Page](https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard) -- ![QMK Docs](https://docs.qmk.fm/#/) -- ![QMK KeyCode Reference](https://docs.qmk.fm/#/keycodes) - -## Contact - -Maintainer: [Dan](https://github.com/loksonarius) - diff --git a/keyboards/planck/keymaps/dcompact/keymap.c b/keyboards/planck/keymaps/dcompact/keymap.c index 79c9831509a..0893059a0d4 100644 --- a/keyboards/planck/keymaps/dcompact/keymap.c +++ b/keyboards/planck/keymaps/dcompact/keymap.c @@ -68,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, { KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, { DEL_SHF, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_BSPC}, - { KC_LCTL, PLOVER, KC_LGUI, KC_LALT, LOWER, KC_LSFT, KC_SPC, RAISE, KC_RALT, KC_RGUI, FUNC, KC_ENT} + { KC_LCTL, PLOVER, KC_LGUI, KC_LALT, LOWER, KC_LSFT, KC_SPC, RAISE, KC_RALT, KC_RGUI, FUNC, KC_ENT} }, /* Lower diff --git a/keyboards/planck/keymaps/dcompact/readme.md b/keyboards/planck/keymaps/dcompact/readme.md new file mode 100644 index 00000000000..cd88c3fed34 --- /dev/null +++ b/keyboards/planck/keymaps/dcompact/readme.md @@ -0,0 +1,45 @@ +# DCompact Layout + +**Dvorak, Layered, Mouse-Enabled, Compact -- now with Plover~** + +_See [the layout source](keymap.c) for the actual layout_ + +## Goals + +The following are the goals kept in mind when designing the DCompact +layout: + +- Provide minimal travel distance when typing English or coding +- Consistent muscle memory translation from standard QWERTY +- Stateless typing experience +- OS-agnostic features, macros, and key placement +- Minimize dependence on mouse usage + +These are generally all met or balanced within reason. This layout is +not intended at all to be a familiar layout for much of anyone (except +maybe those who already type in Dvorak) -- this is meant to amplify the +best parts of having limited, ortholinear keys with layering. + +## As Reference Material + +If you're reading this hoping to find reference material to implement +your own layout, then please feel free to copy over this layout and +make edits where you see fit. I removed a lot of the features I felt +extraneous to my usage and simplified style where I felt needed. This +would hopefully mean that my code should feel like a good base to +develop from for those new to QMK. + +_Remember that settings defined in the layout directory override and +merge with those in the keyboard folder_ + +## Relevant Links + +- [Online Dvorak Layout Trainer](https://learn.dvorak.nl/) +- [Dvorak Wikipedia Page](https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard) +- [QMK Docs](https://docs.qmk.fm/#/) +- [QMK KeyCode Reference](https://docs.qmk.fm/#/keycodes) + +## Contact + +Maintainer: [Dan](https://github.com/loksonarius) + diff --git a/keyboards/planck/keymaps/dcompact/rules.mk b/keyboards/planck/keymaps/dcompact/rules.mk index d7eff1adc6f..12b4e44c2b7 100644 --- a/keyboards/planck/keymaps/dcompact/rules.mk +++ b/keyboards/planck/keymaps/dcompact/rules.mk @@ -1,7 +1,3 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # https://beta.docs.qmk.fm/reference/config-options#feature-options # Features Specifically Wanted EXTRAKEY_ENABLE = yes @@ -13,3 +9,4 @@ AUDIO_ENABLE = yes MOUSEKEY_ENABLE = no MIDI_ENABLE = no CONSOLE_ENABLE = no + diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c index 9e692d4ee0f..f61ae4025c5 100644 --- a/keyboards/planck/keymaps/default/keymap.c +++ b/keyboards/planck/keymaps/default/keymap.c @@ -46,9 +46,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | @@ -64,9 +64,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Colemak * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | @@ -82,9 +82,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Dvorak * ,-----------------------------------------------------------------------------------. * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | @@ -100,9 +100,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Lower * ,-----------------------------------------------------------------------------------. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | Next | Vol- | Vol+ | Play | @@ -118,9 +118,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Raise * ,-----------------------------------------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | Next | Vol- | Vol+ | Play | @@ -136,15 +136,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Plover layer (http://opensteno.org) * ,-----------------------------------------------------------------------------------. * | # | # | # | # | # | # | # | # | # | # | # | # | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | S | T | P | H | * | * | F | P | L | T | D | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | S | K | W | R | * | * | R | B | G | S | Z | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Exit | | | A | O | | E | U | | | | * `-----------------------------------------------------------------------------------' */ - [_PLOVER] = LAYOUT_planck_grid( KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, @@ -155,22 +154,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT_planck_grid( - _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) - }; #ifdef AUDIO_ENABLE @@ -274,24 +272,18 @@ void encoder_update_user(uint8_t index, bool clockwise) { } } } else { - if (index == 0) { - if (clockwise) { - #ifdef MOUSEKEY_ENABLE - register_code(KC_MS_WH_DOWN); - unregister_code(KC_MS_WH_DOWN); - #else - register_code(KC_PGDN); - unregister_code(KC_PGDN); - #endif - } else { - #ifdef MOUSEKEY_ENABLE - register_code(KC_MS_WH_UP); - unregister_code(KC_MS_WH_UP); - #else - register_code(KC_PGUP); - unregister_code(KC_PGUP); - #endif - } + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif } } } diff --git a/keyboards/planck/keymaps/deft/config.h b/keyboards/planck/keymaps/deft/config.h new file mode 100644 index 00000000000..6fa31cc8a76 --- /dev/null +++ b/keyboards/planck/keymaps/deft/config.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/deft/deft-plank.json b/keyboards/planck/keymaps/deft/deft-plank.json new file mode 100644 index 00000000000..49dc57c3e55 --- /dev/null +++ b/keyboards/planck/keymaps/deft/deft-plank.json @@ -0,0 +1,141 @@ +[ + { + "backcolor": "#ffffff", + "name": "Deft Plank", + "author": "Michael Speiserß", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea", + "plate": true, + "pcb": true + }, + [ + { + "c": "#ba0000", + "sb": "gateron", + "st": "KS-3-Tea", + "a": 5 + }, + "\nDel\n\n\n\n\nEsc", + { + "c": "#cccccc", + "a": 4 + }, + "\n\n!\n\n\n\n\n\n1\nQ\nAlt 1", + "\n\n@\n\n\n\n\n\n2\nW\nAlt 2", + "\n\n#\n\n\n\n\n\n3\nE\nAlt 3", + "\n\n$\n\n\n\n\n\n4\nR\nAlt 4", + "\n\n%\n\n\n\n\n\n5\nT\n(", + "\n\n^\n\n\n\n\n\n6\nY\n)", + "\n\n&\n\n\n\n\n\n7\nU\nNum 7", + "\n\n*\n\n\n\n\n\n8\nI\nNum 8", + "\n\n(\n\n\n\n\n\n9\nO\nNum 9", + "\n\n)\n\n\n\n\n\n0\nP\nNum 0", + { + "c": "#ba0000", + "a": 7 + }, + "Bksp" + ], + [ + { + "c": "#365eff" + }, + "Tab", + { + "c": "#cccccc", + "a": 4 + }, + "\n\n\n~\n\n\n\n\nF1\nA\n`", + "\n\n\n|\n\n\n\n\nF2\nS\n\\", + "\n\n\n+\n\n\n\n\nF3\nD\n=", + { + "n": true + }, + "\n\n\n_\n\n\n\n\nF4\nF\n-", + { + "a": 5 + }, + "F5\n<\n\n\n\n\nG", + "F6\n>\n\n\n\n\nH", + { + "n": true + }, + "F7\nNum 4\n\n\n\n\nJ", + "F8\nNum 5\n\n\n\n\nK", + "F9\nNum 6\n\n\n\n\nL", + { + "a": 4 + }, + "\n\n\n\n\n\n\n:\nF10\n;\nNum .", + "\n\n\n\n\n\n\n\"\n\n'\nNumLk" + ], + [ + { + "c": "#365eff", + "a": 7 + }, + "Shift", + { + "c": "#cccccc", + "a": 5 + }, + "F11\nNum /\n\n\n\n\nZ", + "F12\nNum *\n\n\n\n\nX", + "F13\nNum -\n\n\n\n\nC", + "F14\nNum +\n\n\n\n\nV", + "F15\n[\n\n\n\n\nB", + "F16\n]\n\n\n\n\nN", + "F17\nNum 1\n\n\n\n\nM", + { + "a": 4 + }, + "\n\n\n\n\n\n\n<\nF18\n,\nNum 2", + "\n\n\n\n\n\n\n>\nF19\n.\nNum 3", + { + "c": "#365eff", + "a": 5 + }, + "Vol+\nPgup\n\n\n\n\n↑", + { + "c": "#cccccc", + "a": 4 + }, + "\n\n\n\n\n\n\n?\n\n/\nNum =" + ], + [ + { + "c": "#365eff", + "a": 7 + }, + "Ctrl", + { + "a": 5 + }, + "\nOption\n\n\n\n\nAlt", + "\n⌘\n\n\n\n\nWin", + "Cut\nPaste\n\n\n\n\nCopy", + { + "c": "#3f8f00", + "a": 7 + }, + "Lower", + { + "c": "#cccccc", + "w": 2 + }, + "", + { + "c": "#3f8f00" + }, + "Raise", + { + "c": "#365eff", + "a": 5 + }, + "\nNumE\n\n\n\n\nReturn", + "Play\nHome\n\n\n\n\n←", + "Vol -\nPgdn\n\n\n\n\n↓", + "Next\nEnd\n\n\n\n\n→" + ] +] \ No newline at end of file diff --git a/keyboards/planck/keymaps/deft/keymap.c b/keyboards/planck/keymaps/deft/keymap.c new file mode 100644 index 00000000000..25a0a9f4460 --- /dev/null +++ b/keyboards/planck/keymaps/deft/keymap.c @@ -0,0 +1,138 @@ +/* + * The Deft layout for the Planck Keyboard + * Version 1.0 + * + * A keyboard layout designed for efficiency in programming and transferability between ortholinear boards. + * Deft is currently supported on the following boards: + * Planck (12x4) + * + * The Deft keyboard layout was designed by Michael Speiser. You can find other Deft layouts at my Github: + * https://github.com/Speiserm + * + * For questions, issues, or feedback, feel free to email me at Speiserm@pm.me. + * + * + * Flashing: + * + * Rev 5 or earlier: + * make planck/revX:deft:dfu + * + * Rev 6: + * make planck/rev6:deft:dfu-util + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * Follow my cat: + * https://twitter.com/CatBucha + * https://www.instagram.com/buchathecat/ + * + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | N | M | , | . | Up | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | Copy |Lower | Space |Raise |Enter | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_SLSH, + KC_LCTL, KC_LALT, KC_LGUI, C(KC_C), LOWER, KC_SPC, KC_SPC, RAISE, KC_ENT, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Del | Alt1 | Alt2 | Alt3 | Alt4 | ( | ) | Num7 | Num8 | Num9 | Num0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ` | \ | = | - | < | > | Num4 | Num5 | Num6 | Num. | NumL | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Num/ | Num* | Num- | Num+ | [ | ] | Num1 | Num2 | Num3 | Pgup | Num= | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Paste | | | | NumE | Home | Pgdn | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_DEL, A(KC_1), A(KC_2), A(KC_3), A(KC_4), S(KC_9), S(KC_0), KC_P7, KC_P8, KC_P9, KC_P0, _______, + _______, KC_GRV,KC_BSLS,KC_EQL, KC_MINS,S(KC_COMM),S(KC_DOT), KC_P4, KC_P5, KC_P6, KC_PDOT, KC_NLCK, + _______, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_LBRC, KC_RBRC, KC_P1, KC_P2, KC_P3, KC_PGUP, KC_PEQL, + _______, _______, _______, C(KC_V), _______, _______, _______, _______, KC_PENT, KC_HOME,KC_PGDOWN, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Cut | | | | | Play | Vol- | Next | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_VOLU, _______, + _______, _______, _______, C(KC_X), _______, _______, _______, _______, _______, KC_MPLY, KC_VOLD, KC_MNXT +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Reset | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/deft/readme.md b/keyboards/planck/keymaps/deft/readme.md new file mode 100644 index 00000000000..715ab37965b --- /dev/null +++ b/keyboards/planck/keymaps/deft/readme.md @@ -0,0 +1,73 @@ +# The Deft Planck Layout + +![Deft layout for the Planck keyboard](https://i.imgur.com/VtUkAyh.png) + +The Deft Planck layout is designed for efficiency in programming and transferability between ortholinear boards. It features a fairly standard default layer with properly placed arrow keys, a lower layer with a usable numpad and symbols, and a raise layer for numbers, f-keys, and music controls. The code is also cut down to only what you need. The result is a very usable Planck that can easily replace fullsize layouts. + +The strangely placed Enter key is meant to be closer to your thumb and moving it allows for proper arrow key placement without disturbing our layout too much. I wanted to separate the enter key from the forward slash key anyway, as I was commonly pressing enter when I meant to type a question mark. You get used to it pretty fast. + +Follow my cat: + +https://twitter.com/CatBucha + +https://www.instagram.com/buchathecat/ + + +## Flashing: +| Rev 5 or earlier: | Rev 6: | +|-|-| +| `make planck/revX:deft:dfu` | `make planck/rev6:deft:dfu-util` | + +## Layout: + +### QWERTY layer +``` +,-----------------------------------------------------------------------------------. +| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Tab | A | S | D | F | G | H | J | K | L | ; | ' | +|------+------+------+------+------+------|------+------+------+------+------+------| +|Shift | Z | X | C | V | B | N | M | , | . | Up | / | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | Alt | GUI | Copy |Lower | Space |Raise |Enter | Left | Down |Right | +`-----------------------------------------------------------------------------------' +``` + +### Lower layer +``` +,-----------------------------------------------------------------------------------. +| Del | Alt1 | Alt2 | Alt3 | Alt4 | ( | ) | Num7 | Num8 | Num9 | Num0 | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | ` | \ | = | - | < | > | Num4 | Num5 | Num6 | Num. | NumL | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | Num/ | Num* | Num- | Num+ | [ | ] | Num1 | Num2 | Num3 | Pgup | Num= | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | |Paste | | | | NumE | Home | Pgdn | End | +`-----------------------------------------------------------------------------------' +``` + +### Raise layer +``` +,-----------------------------------------------------------------------------------. +| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | Vol+ | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | Cut | | | | | Play | Vol- | Next | +`-----------------------------------------------------------------------------------' +``` + +### Adjust layer +``` +,-----------------------------------------------------------------------------------. +|Reset | | | | | | | | | | | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/deft/rules.mk b/keyboards/planck/keymaps/deft/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/planck/keymaps/deft/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/dlaroe/keymap.c b/keyboards/planck/keymaps/dlaroe/keymap.c index d9dab4f527f..28d2ec1f626 100644 --- a/keyboards/planck/keymaps/dlaroe/keymap.c +++ b/keyboards/planck/keymaps/dlaroe/keymap.c @@ -34,10 +34,6 @@ enum planck_keycodes { EXT_PLV }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/planck/keymaps/dlaroe/rules.mk b/keyboards/planck/keymaps/dlaroe/rules.mk index 0064f622b76..7ff90237a78 100644 --- a/keyboards/planck/keymaps/dlaroe/rules.mk +++ b/keyboards/planck/keymaps/dlaroe/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/dodger/config.h b/keyboards/planck/keymaps/dodger/config.h index c70acfdc994..f6aaec155a1 100644 --- a/keyboards/planck/keymaps/dodger/config.h +++ b/keyboards/planck/keymaps/dodger/config.h @@ -56,18 +56,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 15 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/planck/keymaps/dodger/rules.mk b/keyboards/planck/keymaps/dodger/rules.mk index 981a3e82be9..032f5af6895 100644 --- a/keyboards/planck/keymaps/dodger/rules.mk +++ b/keyboards/planck/keymaps/dodger/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/planck/keymaps/dr_notsokind/Readme.md b/keyboards/planck/keymaps/dr_notsokind/Readme.md index e7e29cb7dd2..a336de2f356 100644 --- a/keyboards/planck/keymaps/dr_notsokind/Readme.md +++ b/keyboards/planck/keymaps/dr_notsokind/Readme.md @@ -70,7 +70,7 @@ When you are done, press `Media` and `Enter`. You will finally hear a tune confi Press `Media` and the key where you stored your Macro, either `;` or `'`. The Macro will play. -![Imgur](https://i.imgur.com/ri4lEcl.png) +![Imgur](https://i.imgur.com/TcVyNag.png) http://www.keyboard-layout-editor.com/#/gists/4cfb26f84bbb4fabe5e6c7cc22c85e24 diff --git a/keyboards/planck/keymaps/dr_notsokind/keymap.c b/keyboards/planck/keymaps/dr_notsokind/keymap.c index f43fc37bc42..a244da2e422 100644 --- a/keyboards/planck/keymaps/dr_notsokind/keymap.c +++ b/keyboards/planck/keymaps/dr_notsokind/keymap.c @@ -1,8 +1,6 @@ // Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6 -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H #ifdef AUDIO_ENABLE #include "audio.h" #endif @@ -39,8 +37,6 @@ enum planck_keycodes { #define SFT_ENT FUNC(0) // Tap for enter, hold for right shift #define LOCK FUNC(1) #define KC_PSTE KC_PASTE -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define ZOOM_IN LCTL(KC_EQL) #define ZOOM_OUT LCTL(KC_MINS) #define ZOOM_NML LCTL(KC_0) @@ -79,12 +75,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | GUI | Alt | Mute | Lower| Space | Raise| / | Left | Down | Right| * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, - {KC_LCTL, KC_LGUI, KC_LALT, MEDIA, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} -}, +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT, + KC_LCTL, KC_LGUI, KC_LALT, MEDIA, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), /* NUMPAD * ,-----------------------------------------------------------------------------------. @@ -97,12 +93,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | 0 | . | , | = | * `-----------------------------------------------------------------------------------' */ -[_NUMPAD] = { - {QWERTY, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS}, - {_______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS}, - {_______, KC_NLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, KC_P1, KC_P2, KC_P3, KC_PENT}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PCMM, KC_PEQL} -}, +[_NUMPAD] = LAYOUT_planck_grid( + QWERTY, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, + _______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS, + _______, KC_NLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, KC_P1, KC_P2, KC_P3, KC_PENT, + _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PCMM, KC_PEQL +), /* LOCK * ,-----------------------------------------------------------------------------------. @@ -115,30 +111,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | NULL | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_LOCKED] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT}, - {_______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, +[_LOCKED] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, + _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* RAISE * ,-----------------------------------------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | | - | = | [ | ] | \ | + * | Del | F11 | F12 | F13 | F14 | F15 | | - | = | [ | ] | \ | * |------+------+------+------+------+------+------+------+------+------+------+------| - * |LShift| F6 | F7 | F8 | F9 | F10 | |ISO # |ISO / | NULL | PgUp | Enter| + * |LShift| F16 | F17 | F18 | F19 | F20 | |ISO # |ISO / | NULL | PgUp | Enter| * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | F11 | | F12 | | | Home | PgDn | End | + * | | | | | | | | | Home | PgDn | End | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL}, - {KC_DEL , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, KC_NUHS, KC_NUBS, XXXXXXX, KC_PGUP, KC_ENT }, - {_______, _______, _______, KC_F11, _______, KC_F12, KC_F12, _______, _______, KC_HOME, KC_PGDN, KC_END } -}, +[_RAISE] = LAYOUT_planck_grid( + KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL , KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LSFT, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, KC_NUHS, KC_NUBS, XXXXXXX, KC_PGUP, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), /* LOWER * ,-----------------------------------------------------------------------------------. @@ -148,15 +144,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * |LShift| F6 | F7 | F8 | F9 | F10 | |ISO ~ |ISO | | NULL | PgUp | Enter| * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | F11 | | F12 | | | Home | PgDn | End | + * | | | | | | | | | Home | PgDn | End | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, - {KC_DEL , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, S(KC_NUHS), S(KC_NUBS), XXXXXXX, KC_PGUP, KC_ENT }, - {_______, _______, _______, KC_F11, _______, KC_F12, KC_F12, _______, _______, KC_HOME, KC_PGDN, KC_END } -}, +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , + KC_DEL , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, S(KC_NUHS), S(KC_NUBS), XXXXXXX, KC_PGUP, KC_ENT , + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), /* MEDIA AND COMMANDS * ,-----------------------------------------------------------------------------------. @@ -169,12 +165,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |ONESHT| NULL | NULL | | Vol- | Mute | Vol+ |Zoom 0| Stop | Next | Play | * `-----------------------------------------------------------------------------------' */ -[_MEDIA] = { - {XXXXXXX, XXXXXXX, KC_WHOM, XXXXXXX, XXXXXXX, XXXXXXX, KC_AGAIN, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, XXXXXXX}, - {XXXXXXX, XXXXXXX, KC_WSCH, XXXXXXX, KC_FIND, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2 }, - {KC_LSFT, XXXXXXX, XXXXXXX, KC_CALC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ZOOM_OUT, ZOOM_IN, KC_MPRV, DYN_REC_STOP }, - {ONESHOT, XXXXXXX, XXXXXXX, _______, KC_VOLD, KC_MUTE, KC_MUTE, KC_VOLU, ZOOM_NML, KC_MSTP, KC_MNXT, KC_MPLY } -}, +[_MEDIA] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, KC_WHOM, XXXXXXX, XXXXXXX, XXXXXXX, KC_AGAIN, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, XXXXXXX, + XXXXXXX, XXXXXXX, KC_WSCH, XXXXXXX, KC_FIND, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, + KC_LSFT, XXXXXXX, XXXXXXX, KC_CALC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ZOOM_OUT, ZOOM_IN, KC_MPRV, DYN_REC_STOP, + ONESHOT, XXXXXXX, XXXXXXX, _______, KC_VOLD, KC_MUTE, KC_MUTE, KC_VOLU, ZOOM_NML, KC_MSTP, KC_MNXT, KC_MPLY +), /* ONESHOT * ,-----------------------------------------------------------------------------------. @@ -187,12 +183,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ONESHOT] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, +[_ONESHOT] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* FUNCTIONS * ,-----------------------------------------------------------------------------------. @@ -205,12 +201,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Reset| NULL | LOCK | NULL | | NULL | | NULL |AGNorm|Voice-|AGSwap| * `-----------------------------------------------------------------------------------' */ -[_FUNCTN] = { - {KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PWR }, - {KC_WAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX }, - {XXXXXXX, XXXXXXX, XXXXXXX, AU_OFF, MU_OFF, QWERTY, NUMPAD, MU_ON, AU_ON, XXXXXXX, MUV_IN, KC_SYSREQ}, - {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, AG_NORM, MUV_DE, AG_SWAP} -} +[_FUNCTN] = LAYOUT_planck_grid( + KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PWR, + KC_WAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, AU_OFF, MU_OFF, QWERTY, NUMPAD, MU_ON, AU_ON, XXXXXXX, MUV_IN, KC_SYSREQ, + RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, AG_NORM, MUV_DE, AG_SWAP +) }; diff --git a/keyboards/planck/keymaps/dr_notsokind/rules.mk b/keyboards/planck/keymaps/dr_notsokind/rules.mk index eea90f8e6a4..91156b6b465 100644 --- a/keyboards/planck/keymaps/dr_notsokind/rules.mk +++ b/keyboards/planck/keymaps/dr_notsokind/rules.mk @@ -20,6 +20,3 @@ TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/dsanchezseco/config.h b/keyboards/planck/keymaps/dsanchezseco/config.h new file mode 100644 index 00000000000..3ed041f3bd8 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/config.h @@ -0,0 +1,5 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(DVORAK_SOUND) +#endif diff --git a/keyboards/planck/keymaps/dsanchezseco/keymap.c b/keyboards/planck/keymaps/dsanchezseco/keymap.c new file mode 100644 index 00000000000..df560b46c55 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/keymap.c @@ -0,0 +1,98 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + DVORAK, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | AltGr| Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_SFTENT, + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Del | | Play | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, KC_DEL, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Del | | Play | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, KC_DEL, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT +), + +/* Adjust (Lower + Raise) + * ,----------------------------------------------------------------------------------- + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/dsanchezseco/readme.md b/keyboards/planck/keymaps/dsanchezseco/readme.md new file mode 100644 index 00000000000..de9680b4985 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/dsanchezseco/rules.mk b/keyboards/planck/keymaps/dsanchezseco/rules.mk new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/rules.mk @@ -0,0 +1 @@ + diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h index 63434f60ca6..7f9cf746728 100644 --- a/keyboards/planck/keymaps/dshields/config.h +++ b/keyboards/planck/keymaps/dshields/config.h @@ -5,6 +5,7 @@ #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 #define ONESHOT_TIMEOUT 3000 +#define RETRO_TAPPING #define MOUSEKEY_INTERVAL 20 #define MOUSEKEY_DELAY 0 diff --git a/keyboards/planck/keymaps/dshields/rules.mk b/keyboards/planck/keymaps/dshields/rules.mk index 300a8279041..a2bec433576 100644 --- a/keyboards/planck/keymaps/dshields/rules.mk +++ b/keyboards/planck/keymaps/dshields/rules.mk @@ -1,7 +1,3 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - MOUSEKEY_ENABLE = yes # Mouse keys(+4700) COMMAND_ENABLE = no # Commands for debug and configuration CONSOLE_ENABLE = no # Console for debug(+400) @@ -16,7 +12,7 @@ ifeq ($(strip $(KEYBOARD)), planck/rev3) endif ifeq ($(strip $(KEYBOARD)), planck/rev6) EXTRALDFLAGS = -Wl,--build-id=none - AUDIO_ENABLE = yes + AUDIO_ENABLE = no BACKLIGHT_ENABLE = no RGB_MATRIX_ENABLE = no endif diff --git a/keyboards/planck/keymaps/dudeofawesome/rules.mk b/keyboards/planck/keymaps/dudeofawesome/rules.mk index edeab164393..eeee270d5e0 100644 --- a/keyboards/planck/keymaps/dudeofawesome/rules.mk +++ b/keyboards/planck/keymaps/dudeofawesome/rules.mk @@ -1,10 +1,7 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - AUDIO_ENABLE = yes # Audio output on port C6 CONSOLE_ENABLE = no # Console for debug(+400) MIDI_ENABLE = no # MIDI controls MOUSEKEY_ENABLE = no # Mouse keys(+4700) NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + diff --git a/keyboards/planck/keymaps/dvorak2space/config.h b/keyboards/planck/keymaps/dvorak2space/config.h new file mode 100644 index 00000000000..0927fa016e1 --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/config.h @@ -0,0 +1,3 @@ +#pragma once +#define TAPPING_TOGGLE 1 +#define PERMISSIVE_HOLD diff --git a/keyboards/planck/keymaps/dvorak2space/keymap.c b/keyboards/planck/keymaps/dvorak2space/keymap.c new file mode 100644 index 00000000000..4b07759452b --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/keymap.c @@ -0,0 +1,242 @@ +#include QMK_KEYBOARD_H +#include "passwords.c" //Instead of extern just to cut down on compile time. Holds a single array. +#define MOUSEL KC_BTN1 +#define MOUSER KC_BTN2 +#define CTRLL LCTL(KC_LEFT) +#define CTRLR LCTL(KC_RGHT) +#define CAD LCTL(LALT(KC_DEL)) + +#define BASE_L 0 +#define SHFT_L 1 +#define MOD_L 2 +#define NAV_L 3 +#define AHK_L 4 +#define LOCK_L 5 +#define PASS_L 6 + +static host_driver_t *host_driver = 0; + +enum { + HK_SLP = SAFE_RANGE, + HK_IF, + HK_ELSE, + HK_COSL +}; + +enum { + FB = 0, + LPN, + RPN, + BCK, + DSH +}; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, //Distinguishes between double tapping and typing, "tapping", for example. Not sure how accurate it is, and I have no need, so avoiding it at the moment. + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Base + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | p | y | f | g | c | r | l | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Nav | a | o | e | u | i | d | h | t | n | s | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shft | ; | q | j | k | x | b | m | w | v | z | Shft | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | RClk | LClk | Ctrl | Space | Modifier | GUI | VolD | VolU |Macros| + * `-----------------------------------------------------------------------------------' + */ + [0] = LAYOUT_planck_2x2u( + KC_TAB, KC_QUOT,KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, TD(BCK), + MO(NAV_L),KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, + KC_LSFT, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_ESC, MOUSER, MOUSEL, KC_LCTL, KC_SPC, MO(MOD_L), KC_LGUI, KC_VOLD, KC_VOLU, OSL(AHK_L) + ), +/* Custom Shifts + * ,-----------------------------------------------------------------------------------. + * | | | ? | ! | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [1] = LAYOUT_planck_2x2u( + KC_TRNS,KC_TRNS,KC_SLSH,KC_1, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_NO, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ), +/* Modifier + * ,-----------------------------------------------------------------------------------. + * | Tab | + | - | * | / \ | if | else | ( [ | ) ] | { | } | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | ` | < | > | & | | | _ | $ | @ | # | % | ^ | ~ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | Space | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [2] = LAYOUT_planck_2x2u( + KC_TRNS,KC_PLUS,TD(DSH),KC_ASTR,TD(FB), HK_IF, HK_ELSE,TD(LPN),TD(RPN),KC_LCBR,KC_RCBR,KC_TRNS, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_GRV, KC_LT, KC_GT, KC_AMPR,KC_PIPE,KC_UNDS,KC_DLR, KC_AT, KC_HASH,KC_PERC,KC_CIRC,LSFT(KC_GRV), + KC_NO, KC_NO, KC_NO, KC_NO, KC_SPC, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO + ), +//Nav + [3] = LAYOUT_planck_2x2u( + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME,KC_UP, KC_END, KC_NO, KC_TRNS, + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, CTRLL, KC_LEFT,KC_DOWN,KC_RGHT, CTRLR, KC_TRNS, + KC_LSFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_SPC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ), +//AHK-Bindable Macros + [4] = LAYOUT_planck_2x2u( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + LCTL(KC_F13),LCTL(KC_F14),LCTL(KC_F15),LCTL(KC_F16),LCTL(KC_F17),LCTL(KC_F18),LCTL(KC_F19),LCTL(KC_F20),LCTL(KC_F21),LCTL(KC_F22),LCTL(KC_F23),LCTL(KC_F24), + LSFT(KC_F13),LSFT(KC_F14),LSFT(KC_F15),LSFT(KC_F16),LSFT(KC_F17),LSFT(KC_F18),LSFT(KC_F19),LSFT(KC_F20),LSFT(KC_F21),LSFT(KC_F22),LSFT(KC_F23),LSFT(KC_F24), + RESET, LALT(KC_F14),LALT(KC_F15),OSL(PASS_L), CAD, LALT(KC_F19), LALT(KC_F21),LALT(KC_F22),HK_SLP, HK_COSL + ), +//Locked Screen + [5] = LAYOUT_planck_2x2u( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, HK_SLP, KC_NO + ), +//Passwords (by first letter of service name, at least better than just one) + [6] = LAYOUT_planck_2x2u( + KC_NO, KC_NO, KC_NO, KC_NO, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_NO, + KC_NO, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_NO, + KC_NO, KC_NO, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_NO, + KC_NO, KC_NO, KC_NO, HK_COSL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { //X_KEY doesn't support aliases + switch(keycode) { + //if shift pressed and not shift layer or released and other shift not pressed + //in separate things because MOD_BIT (probably?) isn't toggled until after this returns true and shift is actually toggled + case KC_LSFT: //if pressed and not shift layer or released and other shift not pressed + if((record->event.pressed && IS_LAYER_OFF(SHFT_L)) || (!record->event.pressed && !(get_mods() & MOD_BIT(KC_RSFT)))) { layer_invert(SHFT_L); } + break; + case KC_RSFT: + if((record->event.pressed && IS_LAYER_OFF(SHFT_L)) || (!record->event.pressed && !(get_mods() & MOD_BIT(KC_LSFT)))) { layer_invert(SHFT_L); } + break; + case KC_ENT: //won't repeat on hold and I can't find a solution other than hardcoding timers but I kinda prefer it anyway. Swaps enter and shift enter + if(record->event.pressed) { + (IS_LAYER_ON(SHFT_L)) //if shifted release correct shift, send, and press same shift, else send shift enter + ? (get_mods() & MOD_BIT(KC_LSFT)) + ? SEND_STRING(SS_UP(X_LSHIFT) SS_TAP(X_ENTER) SS_DOWN(X_LSHIFT)) + : SEND_STRING(SS_UP(X_RSHIFT) SS_TAP(X_ENTER) SS_DOWN(X_RSHIFT)) + : SEND_STRING(SS_LSFT(SS_TAP(X_ENTER))); + } + return false; + case HK_IF: + if(record->event.pressed) { SEND_STRING("if"); } + break; + case HK_ELSE: + if(record->event.pressed) { SEND_STRING("else"); } + break; + case HK_COSL: + clear_keyboard(); + break; + case HK_SLP: + if(record->event.pressed) { + if(IS_LAYER_OFF(LOCK_L)) { + host_driver = host_get_driver(); + SEND_STRING(SS_LALT(SS_TAP(X_F23))); + host_set_driver(0); + } + else { + host_set_driver(host_driver); + SEND_STRING(SS_LALT(SS_TAP(X_F24))); + } + return false; + } + layer_invert(LOCK_L); + if(IS_LAYER_ON(AHK_L)) + layer_invert(AHK_L); + break; + default: + if(IS_LAYER_ON(PASS_L) && keycode <= KC_Z) { + SEND_STRING(passwords[keycode - KC_A]); + layer_invert(PASS_L); + return false; + } + } + return true; +}; + +//tapdance state evaluation +int cur_dance(qk_tap_dance_state_t *state) { + int press = 0; + switch(state->count) { + case 1: + press = (state->interrupted || !state->pressed) + ? SINGLE_TAP + : SINGLE_HOLD; + break; + case 2: + press = DOUBLE_TAP; + break; + case 3: + press = TRIPLE_TAP; + } + return press; +} + +void back_tap(qk_tap_dance_state_t *state, void *user_data) { tap_code(KC_BSPACE); } + +void back_finished(qk_tap_dance_state_t *state, void *user_data) { if(!(state->interrupted || !state->pressed)) tap_code16(LCTL(KC_BSPACE)); } + +void slash_finished(qk_tap_dance_state_t *state, void *user_data) { + int td_state = cur_dance(state); + switch(td_state) { + case SINGLE_TAP: + clear_mods(); + clear_weak_mods(); + tap_code(KC_SLSH); + break; + case DOUBLE_TAP: + tap_code(KC_NUBS); + } +} + +void dash_finished(qk_tap_dance_state_t *state, void *user_data) { + int td_state = cur_dance(state); + switch(td_state) { + case SINGLE_TAP: + tap_code(KC_PMNS); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_LALT)); + tap_code(KC_KP_0); + tap_code(KC_KP_1); + tap_code(KC_KP_5); + tap_code(KC_KP_1); + unregister_mods(MOD_BIT(KC_LALT)); + break; + case DOUBLE_TAP: + tap_code(KC_PMNS); + tap_code(KC_PMNS); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [LPN] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_LBRC), + [RPN] = ACTION_TAP_DANCE_DOUBLE(KC_RPRN, KC_RBRC), + [FB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, slash_finished, NULL), + [BCK] = ACTION_TAP_DANCE_FN_ADVANCED(back_tap, back_finished, NULL), //each tap, on finished, and reset. Normally register_code on press unregister on reset so keys can be held down. + [DSH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dash_finished, NULL) +}; diff --git a/keyboards/planck/keymaps/dvorak2space/passwords.c b/keyboards/planck/keymaps/dvorak2space/passwords.c new file mode 100644 index 00000000000..161c564dd5c --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/passwords.c @@ -0,0 +1,28 @@ +char *passwords[26] = { + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" +}; diff --git a/keyboards/planck/keymaps/dvorak2space/readme.md b/keyboards/planck/keymaps/dvorak2space/readme.md new file mode 100644 index 00000000000..1844a57f373 --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/readme.md @@ -0,0 +1,5 @@ +![Keyboard Layout](https://i.imgur.com/9jYjllM.png) + +# IsaacElenbaas's Planck Layout + +Split spacebar, Dvorak. Bottom right button leads to layer with lots of things to be mapped in AutoHotkey. The ones I use (of which the best are sleep, which turns off the monitors and locks all inputs, rebinding keyboard-only mouse inputs, and redirecting media keys to a specific player) can be found [here.](https://github.com/IsaacElenbaas/personal_scripts/blob/master/Keyboard.ahk) Capslock goes to a right-hand navigation layer, there is a custom layer when holding shift, holding dash gives an em dash, holding backspace deletes a word, and I have a obfuscation-based password system you probably shouldn't use, but the rest is pretty standard. diff --git a/keyboards/planck/keymaps/dvorak2space/rules.mk b/keyboards/planck/keymaps/dvorak2space/rules.mk new file mode 100644 index 00000000000..59f9f1dff21 --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/rules.mk @@ -0,0 +1,20 @@ +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work. Can make windows not recognize device. +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no +TAP_DANCE_ENABLE = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/keymaps/dzobert/rules.mk b/keyboards/planck/keymaps/dzobert/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/dzobert/rules.mk +++ b/keyboards/planck/keymaps/dzobert/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/emiller/config.h b/keyboards/planck/keymaps/emiller/config.h new file mode 100644 index 00000000000..5fdfe80b392 --- /dev/null +++ b/keyboards/planck/keymaps/emiller/config.h @@ -0,0 +1,39 @@ +#pragma once + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + diff --git a/keyboards/planck/keymaps/emiller/keymap.c b/keyboards/planck/keymaps/emiller/keymap.c new file mode 100644 index 00000000000..7dcd99d3b72 --- /dev/null +++ b/keyboards/planck/keymaps/emiller/keymap.c @@ -0,0 +1,307 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _VIM, + _NUM +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + VIM, + NUM +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | VIM | Lower| Space |Raise | NUM | Vol- | Vol+ | Del | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid ( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_LGUI, KC_LALT, MO(_VIM), LOWER, KC_SPC, KC_SPC, RAISE, TT(NUM), KC_VOLD, KC_VOLU, KC_RSFT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Prev | | | | Next | BL- | BL+ |Print | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, KC_MPRV, _______, _______, _______, _______, KC_MNXT, BL_DEC, BL_INC, KC_PSCREEN +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, KC_MPRV, _______, _______, _______, _______, KC_MNXT, BL_DEC, BL_INC, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +/* VIM + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | Copy | Undo | | Paste| | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | Cut | | | | Left | Down | Up | Right | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | Del | |Select| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_VIM] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_COPY, KC_UNDO, _______, KC_PASTE, _______, + _______, _______, _______, KC_CUT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + _______, _______, KC_DEL, _______, KC_SELECT, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +/* NUM + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | 7 | 8 | 9 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | 4 | 5 | 6 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | 1 | 2 | 3 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | 0 | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUM] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______ +), +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case NUM: + if (record->event.pressed) { + layer_on(_NUM); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_NUM); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/emiller/readme.md b/keyboards/planck/keymaps/emiller/readme.md new file mode 100644 index 00000000000..de9680b4985 --- /dev/null +++ b/keyboards/planck/keymaps/emiller/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/emiller/rules.mk b/keyboards/planck/keymaps/emiller/rules.mk new file mode 100644 index 00000000000..509cf9fd565 --- /dev/null +++ b/keyboards/planck/keymaps/emiller/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/planck/keymaps/emilyh/keymap.c b/keyboards/planck/keymaps/emilyh/keymap.c index 28bee6243c6..e8a1d437a99 100644 --- a/keyboards/planck/keymaps/emilyh/keymap.c +++ b/keyboards/planck/keymaps/emilyh/keymap.c @@ -37,10 +37,6 @@ enum planck_keycodes { EXT_PLV }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/planck/keymaps/espynn/rules.mk b/keyboards/planck/keymaps/espynn/rules.mk index 0b025a2313e..c4dc26dc2b3 100644 --- a/keyboards/planck/keymaps/espynn/rules.mk +++ b/keyboards/planck/keymaps/espynn/rules.mk @@ -58,6 +58,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/experimental/keymap.c b/keyboards/planck/keymaps/experimental/keymap.c index 86ce3a29342..0c592ce6e60 100644 --- a/keyboards/planck/keymaps/experimental/keymap.c +++ b/keyboards/planck/keymaps/experimental/keymap.c @@ -43,9 +43,6 @@ enum planck_keycodes { RGBLED_DECREASE_VAL, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define SW_SPC SH_T(KC_SPC) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/planck/keymaps/experimental/rules.mk b/keyboards/planck/keymaps/experimental/rules.mk index 721e887b98c..e5db0554369 100644 --- a/keyboards/planck/keymaps/experimental/rules.mk +++ b/keyboards/planck/keymaps/experimental/rules.mk @@ -23,6 +23,3 @@ LEADER_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/fabian/keymap.c b/keyboards/planck/keymaps/fabian/keymap.c index 50bade14da3..5be91772d76 100644 --- a/keyboards/planck/keymaps/fabian/keymap.c +++ b/keyboards/planck/keymaps/fabian/keymap.c @@ -38,9 +38,6 @@ enum planck_keycodes { EXT_PLV }; -#define XXXXXXX KC_NO -#define _______ KC_TRNS - #define CTL_ESC CTL_T(KC_ESC) // Tap for Escape, hold for Control #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) #define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) diff --git a/keyboards/planck/keymaps/fsck/config.h b/keyboards/planck/keymaps/fsck/config.h new file mode 100644 index 00000000000..bf25da3a6fc --- /dev/null +++ b/keyboards/planck/keymaps/fsck/config.h @@ -0,0 +1,28 @@ +#pragma once + +#define USB_MAX_POWER_CONSUMPTION 100 + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC diff --git a/keyboards/planck/keymaps/fsck/keymap.c b/keyboards/planck/keymaps/fsck/keymap.c new file mode 100644 index 00000000000..cac5d554ec4 --- /dev/null +++ b/keyboards/planck/keymaps/fsck/keymap.c @@ -0,0 +1,154 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Brite | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, BACKLIT, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | ALTGr| | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_VOLD, KC_VOLU, _______, + _______, _______, _______, KC_RALT, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | ALTGr| | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_VOLD, KC_VOLU, _______, + _______, _______, _______, KC_RALT, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + } + return true; +} diff --git a/keyboards/planck/keymaps/fsck/readme.md b/keyboards/planck/keymaps/fsck/readme.md new file mode 100644 index 00000000000..755da3e219c --- /dev/null +++ b/keyboards/planck/keymaps/fsck/readme.md @@ -0,0 +1,5 @@ +![preonic:fsck Layout Image](https://i.imgur.com/GOLyPGP.png) + +# fsck's Planck Layout + +This is largely based on the default planck layout. \ No newline at end of file diff --git a/keyboards/planck/keymaps/fsck/rules.mk b/keyboards/planck/keymaps/fsck/rules.mk new file mode 100644 index 00000000000..bd0181d620e --- /dev/null +++ b/keyboards/planck/keymaps/fsck/rules.mk @@ -0,0 +1,3 @@ +#pragma once +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality \ No newline at end of file diff --git a/keyboards/planck/keymaps/gabriel/keymap.c b/keyboards/planck/keymaps/gabriel/keymap.c index cbb44f68aef..96e4a17ee61 100644 --- a/keyboards/planck/keymaps/gabriel/keymap.c +++ b/keyboards/planck/keymaps/gabriel/keymap.c @@ -88,10 +88,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/planck/keymaps/gabriel/rules.mk b/keyboards/planck/keymaps/gabriel/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/gabriel/rules.mk +++ b/keyboards/planck/keymaps/gabriel/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/grahampheath/rules.mk b/keyboards/planck/keymaps/grahampheath/rules.mk index 2ff606255ed..e84f6d5e6da 100644 --- a/keyboards/planck/keymaps/grahampheath/rules.mk +++ b/keyboards/planck/keymaps/grahampheath/rules.mk @@ -1,9 +1,7 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality NKRO_ENABLE = yes # N-Key rollover. # MOUSEKEY_ENABLE = yes # Mouse mode. TAP_DANCE_ENABLE = no # Tap dance enabled. UNICODEMAP_ENABLE = no # Unicode keymap (sucks on osx). AUDIO_ENABLE = yes # Audio output on port C6 + diff --git a/keyboards/planck/keymaps/gunp/rules.mk b/keyboards/planck/keymaps/gunp/rules.mk index 7d03482abc6..ec69d6e78f3 100644 --- a/keyboards/planck/keymaps/gunp/rules.mk +++ b/keyboards/planck/keymaps/gunp/rules.mk @@ -18,6 +18,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/handwired_binaryplease/keymap.c b/keyboards/planck/keymaps/handwired_binaryplease/keymap.c index 704c65638c6..a4d1f7cb09b 100644 --- a/keyboards/planck/keymaps/handwired_binaryplease/keymap.c +++ b/keyboards/planck/keymaps/handwired_binaryplease/keymap.c @@ -35,10 +35,6 @@ enum planck_keycodes { /*EXT_PLV*/ }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/planck/keymaps/handwired_binaryplease/rules.mk b/keyboards/planck/keymaps/handwired_binaryplease/rules.mk index 248fe2bb74a..cf37fa6f3bb 100644 --- a/keyboards/planck/keymaps/handwired_binaryplease/rules.mk +++ b/keyboards/planck/keymaps/handwired_binaryplease/rules.mk @@ -1,11 +1,4 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -72,3 +65,4 @@ API_SYSEX_ENABLE = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/hiea/keymap.c b/keyboards/planck/keymaps/hiea/keymap.c index 2bc54b7a6da..c09fd41f20b 100644 --- a/keyboards/planck/keymaps/hiea/keymap.c +++ b/keyboards/planck/keymaps/hiea/keymap.c @@ -171,9 +171,7 @@ enum planck_keycodes { // keycodes #define ___x___ KC_TRNS #define ___fn__ KC_TRNS -#ifdef _______ -#undef _______ -#endif +#undef _______ #define _______ KC_NO #define COPY LCTL(KC_C) diff --git a/keyboards/planck/keymaps/hiea/rules.mk b/keyboards/planck/keymaps/hiea/rules.mk index 40f153844c1..a722766296d 100644 --- a/keyboards/planck/keymaps/hiea/rules.mk +++ b/keyboards/planck/keymaps/hiea/rules.mk @@ -21,6 +21,3 @@ SLEEP_LED_ENABLE = no # breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # enable double tap completion of (),[],{} -ifndef QUANTUM_DIR -include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/hieax/keymap.c b/keyboards/planck/keymaps/hieax/keymap.c index 3f86695875e..2b08506f25f 100644 --- a/keyboards/planck/keymaps/hieax/keymap.c +++ b/keyboards/planck/keymaps/hieax/keymap.c @@ -176,9 +176,7 @@ enum planck_keycodes { // keycodes #define ___x___ KC_TRNS #define ___fn__ KC_TRNS -#ifdef _______ -#undef _______ -#endif +#undef _______ #define _______ KC_NO #define COPY LCTL(KC_C) diff --git a/keyboards/planck/keymaps/hieax/rules.mk b/keyboards/planck/keymaps/hieax/rules.mk index 40f153844c1..a722766296d 100644 --- a/keyboards/planck/keymaps/hieax/rules.mk +++ b/keyboards/planck/keymaps/hieax/rules.mk @@ -21,6 +21,3 @@ SLEEP_LED_ENABLE = no # breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # enable double tap completion of (),[],{} -ifndef QUANTUM_DIR -include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/impossible/keymap.c b/keyboards/planck/keymaps/impossible/keymap.c index 119e547da4e..b53023dd96f 100644 --- a/keyboards/planck/keymaps/impossible/keymap.c +++ b/keyboards/planck/keymaps/impossible/keymap.c @@ -27,10 +27,6 @@ enum planck_keycodes { PLOVER }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Workman Alpha-numeric diff --git a/keyboards/planck/keymaps/ishtob/keymap.c b/keyboards/planck/keymaps/ishtob/keymap.c index 86c5555da30..e036d8a5a33 100644 --- a/keyboards/planck/keymaps/ishtob/keymap.c +++ b/keyboards/planck/keymaps/ishtob/keymap.c @@ -24,10 +24,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Esc | Caps | Alt | GUI |Lower | Space |Raise |NumLay| RAlt | Men | Del | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_planck_grid( - LT_FN(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT_MC(KC_SCLN), CTL_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS), +[_QWERTY] = LAYOUT_ortho_4x12_wrapper( + LT_FN(KC_TAB), _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, + KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, CTL_ENT, + KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, LT_RAI(KC_MINS), KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), @@ -42,11 +42,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = LAYOUT_planck_grid( - LT_FN(KC_TAB), KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O), KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS), - KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL +[_COLEMAK] = LAYOUT_ortho_4x12_wrapper( + LT_FN(KC_TAB), _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, + KC_LCTL, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_ENT, + KC_LSFT, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________, LT_RAI(KC_MINS), + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), /* Dvorak @@ -60,11 +60,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = LAYOUT_planck_grid( - LT_FN(KC_TAB), KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S), KC_ENT, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, LT_RAI(KC_MINS), - KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL +[_DVORAK] = LAYOUT_ortho_4x12_wrapper( + LT_FN(KC_TAB), _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, + KC_LCTL, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_ENT, + KC_LSFT, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________, LT_RAI(KC_MINS), + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), /* Lower @@ -78,10 +78,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = LAYOUT_planck_grid( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_BSLS, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, +[_LOWER] = LAYOUT_ortho_4x12_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_GRV, KC_BSLS, + _______, __________________LONG_FUNC_LEFT___________________, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, + _______, __________________LONG_FUNC_RIGHT__________________,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), @@ -96,8 +96,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | 0 | | Left | Down | Right| NumLk| * `-----------------------------------------------------------------------------------' */ -[_RAISE] = LAYOUT_planck_grid( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS, KC_BSLS, +[_RAISE] = LAYOUT_ortho_4x12_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_PLUS, KC_BSLS, _______, KC_A, KC_UP, KC_D, KC_PSCR, KC_VOLU, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, _______, KC_LEFT, KC_DOWN, KC_RIGHT,KC__MUTE, KC_VOLD, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, _______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NLCK @@ -115,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_PLOVER] = LAYOUT_planck_grid( +[_PLOVER] = LAYOUT_ortho_4x12_wrapper( KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, @@ -133,10 +133,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_FNLAYER] = LAYOUT_planck_grid( +[_FNLAYER] = LAYOUT_ortho_4x12_wrapper( _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, + _______, __________________LONG_FUNC_LEFT___________________, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, + _______, __________________LONG_FUNC_RIGHT__________________,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), @@ -151,7 +151,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | 0 | . | Exit | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_NUMLAY] = LAYOUT_planck_grid( +[_NUMLAY] = LAYOUT_ortho_4x12_wrapper( _______, KC_Q, KC_UP, KC_H, XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_MINS, KC_PLUS, KC_BSPC, _______, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PAST, KC_COLN, KC_ENT, _______, KC_Z, KC_X, KC_C, KC_V, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PSLS, _______, @@ -170,7 +170,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_MOUSECURSOR] = LAYOUT_planck_grid( +[_MOUSECURSOR] = LAYOUT_ortho_4x12_wrapper( KC_ACL0, KC_ACL1, KC_ACL2, M_EMAIL,M_EMAIL2, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, P_MPASS, P_META, _______, XXXXXXX, XXXXXXX, XXXXXXX, O_RTQ6H, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, O_DAYRN, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, @@ -188,7 +188,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = LAYOUT_planck_grid( +[_ADJUST] = LAYOUT_ortho_4x12_wrapper( DFU, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_DEL, _______, MAGIC_TOGGLE_NKRO, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, diff --git a/keyboards/planck/keymaps/ishtob/rule.mk b/keyboards/planck/keymaps/ishtob/rule.mk index c0d38aaa14a..0f71be62b73 100755 --- a/keyboards/planck/keymaps/ishtob/rule.mk +++ b/keyboards/planck/keymaps/ishtob/rule.mk @@ -18,6 +18,3 @@ ENCODER_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jacob/keymap.c b/keyboards/planck/keymaps/jacob/keymap.c index f44faff743f..5d823157bbe 100644 --- a/keyboards/planck/keymaps/jacob/keymap.c +++ b/keyboards/planck/keymaps/jacob/keymap.c @@ -34,10 +34,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/planck/keymaps/jacob/rules.mk b/keyboards/planck/keymaps/jacob/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/jacob/rules.mk +++ b/keyboards/planck/keymaps/jacob/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jarred/keymap.c b/keyboards/planck/keymaps/jarred/keymap.c deleted file mode 100644 index 6697c4ea482..00000000000 --- a/keyboards/planck/keymaps/jarred/keymap.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2018 Jarred Steenvoorden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "planck.h" -#include "jarred.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QW] = LAYOUT_planck_grid_wrapper(QWERTY_4x12), - [_LW] = LAYOUT_planck_grid_wrapper(LOWER_4x12), - [_NV] = LAYOUT_planck_grid_wrapper(NAV_4x12), - [_NP] = LAYOUT_planck_grid_wrapper(NUMPAD_4x12), - [_MS] = LAYOUT_planck_grid_wrapper(MOUSE_4x12) -}; - -#ifdef RGB_MATRIX_H -void rgb_matrix_indicators_user(void) { - // Disable light in middle of 2U position - rgb_matrix_set_color(42, 0, 0, 0); -} -#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jarred/readme.md b/keyboards/planck/keymaps/jarred/readme.md deleted file mode 100644 index e6be5641226..00000000000 --- a/keyboards/planck/keymaps/jarred/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -# Jarred's Planck Layout - -Check out [user space readme](../../../../users/jarred/readme.md) for more info - -# Build - -``` -make planck/rev4:jarred:dfu -``` diff --git a/keyboards/planck/keymaps/jasperla/keymap.c b/keyboards/planck/keymaps/jasperla/keymap.c index 14f445d0f20..b9eb72b073c 100644 --- a/keyboards/planck/keymaps/jasperla/keymap.c +++ b/keyboards/planck/keymaps/jasperla/keymap.c @@ -46,14 +46,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | | LGUI | Alt |Lower | SPC | Enter|Raise |Point.| | LOCK | | + * | Ctrl | | LGUI | Alt |Lower | SPC | Enter|Raise |Point.| | LOCK | Ctrl | * `-----------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT_planck_grid( KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT , - KC_LCTL, _______, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, PT, _______, LOCK, _______ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, _______, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, PT, _______, LOCK, KC_RCTL ), /* Lower diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index d035728355e..86a2c4c76ad 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -53,10 +53,6 @@ enum macro_keycodes { KC_AG_TAB_R, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift diff --git a/keyboards/planck/keymaps/jhenahan/keymap.c b/keyboards/planck/keymaps/jhenahan/keymap.c index 3e0e185d33c..ea7a536102d 100644 --- a/keyboards/planck/keymaps/jhenahan/keymap.c +++ b/keyboards/planck/keymaps/jhenahan/keymap.c @@ -32,10 +32,6 @@ enum planck_keycodes { TOG_PLV }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/planck/keymaps/jirgn/keymap.c b/keyboards/planck/keymaps/jirgn/keymap.c index 13c673799e3..3917355a871 100644 --- a/keyboards/planck/keymaps/jirgn/keymap.c +++ b/keyboards/planck/keymaps/jirgn/keymap.c @@ -38,7 +38,6 @@ enum planck_keycodes { }; // keycode aliases -#define _______ KC_TRNS #define ___x___ KC_NO #define KC_EUR LALT(S(KC_2)) #define KC_SEC LALT(KC_6) diff --git a/keyboards/planck/keymaps/jirgn/rules.mk b/keyboards/planck/keymaps/jirgn/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/planck/keymaps/jirgn/rules.mk +++ b/keyboards/planck/keymaps/jirgn/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/johannes/keymap.c b/keyboards/planck/keymaps/johannes/keymap.c index 86748daf2e6..b0636d3147d 100644 --- a/keyboards/planck/keymaps/johannes/keymap.c +++ b/keyboards/planck/keymaps/johannes/keymap.c @@ -6,9 +6,6 @@ // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define QWERTY 0 #define LOWER 1 #define RAISE 2 @@ -90,10 +87,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; diff --git a/keyboards/planck/keymaps/johannes/rules.mk b/keyboards/planck/keymaps/johannes/rules.mk index 6f88a28d508..a31025bc33d 100644 --- a/keyboards/planck/keymaps/johannes/rules.mk +++ b/keyboards/planck/keymaps/johannes/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/juno/config.h b/keyboards/planck/keymaps/juno/config.h new file mode 100644 index 00000000000..eae636c57e8 --- /dev/null +++ b/keyboards/planck/keymaps/juno/config.h @@ -0,0 +1,41 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +// Reduce power consumption for iOS compatibility +#define USB_MAX_POWER_CONSUMPTION 100 \ No newline at end of file diff --git a/keyboards/planck/keymaps/juno/keymap.c b/keyboards/planck/keymaps/juno/keymap.c new file mode 100644 index 00000000000..a34a9e9480d --- /dev/null +++ b/keyboards/planck/keymaps/juno/keymap.c @@ -0,0 +1,444 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + + _FN1, + _DPAD, + _DPADNUM +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV, + + FN1, + DP_ON, + DP_OFF +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ESC | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | App | Ctrl | GUI | Alt |Lower | SpaceFn |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), + KC_APP, KC_LCTL, KC_LGUI, KC_LALT, LOWER, LT(_FN1, KC_SPC), + LT(_FN1, KC_SPC), RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +// Two personal additional layers below + +/* Personal custom Fn layer + * ,-----------------------------------------------------------------------------------. + * | | Vol+ | PgUp | Up | PdDn | Ins | | | Up | | PScr | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Vol- | Left | Down | Right| Home | | Left | Down |Right | | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Prev | Play | Next | Brite| End | | | Vol- | Vol+ | Mute | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | | | | | Space | | DP_ON| | | | + * `-----------------------------------------------------------------------------------' + */ +[_FN1] = LAYOUT_planck_grid( + _______, KC_VOLU, KC_PGUP, KC_UP, KC_PGDN, KC_INS, _______, _______, KC_UP, _______, KC_PSCR, _______, + _______, KC_VOLD, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_DEL , + _______, KC_MPRV, KC_MPLY, KC_MNXT, BACKLIT, KC_END, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, DP_ON, _______, _______, _______ +), + +/* DPAD layer, to activate arrow cluster at the bottom right corner + + * ,-----------------------------------------------------------------------------------. + * | ESC | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | |DNUM | Space | |DP_OFF| Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ + +[_DPAD] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT , + KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, MO(_DPADNUM), + KC_SPC, KC_SPC, LOWER, DP_OFF, KC_LEFT, KC_DOWN, KC_RGHT +), + +// Extended layer for weapon switching + +[_DPADNUM] = LAYOUT_planck_grid( + XXXXXXX, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, _______, _______, XXXXXXX, MO(_DPADNUM), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); + + // Borrowing audio from unused audio + // Caps Lock on and off sound too similar + + float caps_song_on[][2] = SONG(NUM_LOCK_ON_SOUND); + float caps_song_off[][2] = SONG(SCROLL_LOCK_ON_SOUND); + + float dpad_song_on[][2] = SONG(ZELDA_PUZZLE); + float dpad_song_off[][2] = SONG(SONIC_RING); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + + // LED control, lighting up when Fn layer is activated + + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + + switch (biton32(state)) { + case _QWERTY: + backlight_set(0); + break; + case _FN1: + backlight_set(3); + break; + case _DPAD: + backlight_set(3); + break; + } + + return state; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + + +// Play audio upon switching Caps Lock and custom layers + + case KC_CAPS: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + if (host_keyboard_leds() & (1<event.pressed) { + + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(dpad_song_on); + #endif + + layer_off(_FN1); + layer_on(_DPAD); + } + + case DP_OFF: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(dpad_song_off); + #endif + + layer_off(_DPAD); + } + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} \ No newline at end of file diff --git a/keyboards/planck/keymaps/juno/readme.md b/keyboards/planck/keymaps/juno/readme.md new file mode 100644 index 00000000000..a93a0643d55 --- /dev/null +++ b/keyboards/planck/keymaps/juno/readme.md @@ -0,0 +1,8 @@ +# Juno Layout +created by Juno Nguyen +juno.ngx@gmail.com + +## Feature: +* Pok3r-inspired functional layer. +* Rearranged numerics for maximum efficiency. + diff --git a/keyboards/planck/keymaps/juno/rules.mk b/keyboards/planck/keymaps/juno/rules.mk new file mode 100644 index 00000000000..e9f1b133606 --- /dev/null +++ b/keyboards/planck/keymaps/juno/rules.mk @@ -0,0 +1,10 @@ +BACKLIGHT_ENABLE = yes + +SRC += muse.c + +MIDI_ENABLE=no +RGBLIGHT_ENABLE = no +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration \ No newline at end of file diff --git a/keyboards/planck/keymaps/khord/rules.mk b/keyboards/planck/keymaps/khord/rules.mk index c248822b231..444fa38a932 100644 --- a/keyboards/planck/keymaps/khord/rules.mk +++ b/keyboards/planck/keymaps/khord/rules.mk @@ -1,6 +1,3 @@ BACKLIGHT_ENABLE = yes TAP_DANCE_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/kloki/rules.mk b/keyboards/planck/keymaps/kloki/rules.mk index 195ad328be9..02926bffa6d 100644 --- a/keyboards/planck/keymaps/kloki/rules.mk +++ b/keyboards/planck/keymaps/kloki/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/planck/keymaps/kmontag42/rules.mk b/keyboards/planck/keymaps/kmontag42/rules.mk index 0c100076bea..5712a735d1e 100644 --- a/keyboards/planck/keymaps/kmontag42/rules.mk +++ b/keyboards/planck/keymaps/kmontag42/rules.mk @@ -1,6 +1,3 @@ UNICODE_ENABLE = yes LEADER_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/kyle/rules.mk b/keyboards/planck/keymaps/kyle/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/kyle/rules.mk +++ b/keyboards/planck/keymaps/kyle/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/lae3/keymap.c b/keyboards/planck/keymaps/lae3/keymap.c index d43c682c6c1..59bb36038bd 100644 --- a/keyboards/planck/keymaps/lae3/keymap.c +++ b/keyboards/planck/keymaps/lae3/keymap.c @@ -32,10 +32,6 @@ enum planck_keycodes { RAISE, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define KC_MUP KC_MS_UP #define KC_MDN KC_MS_DOWN #define KC_MLFT KC_MS_LEFT diff --git a/keyboards/planck/keymaps/lae3/rules.mk b/keyboards/planck/keymaps/lae3/rules.mk index 89b147f8191..4d91a120c66 100644 --- a/keyboards/planck/keymaps/lae3/rules.mk +++ b/keyboards/planck/keymaps/lae3/rules.mk @@ -18,6 +18,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/lukas/keymap.c b/keyboards/planck/keymaps/lukas/keymap.c index d7702ad09fb..7adb6a3dd0e 100644 --- a/keyboards/planck/keymaps/lukas/keymap.c +++ b/keyboards/planck/keymaps/lukas/keymap.c @@ -33,10 +33,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/planck/keymaps/lukas/rules.mk b/keyboards/planck/keymaps/lukas/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/lukas/rules.mk +++ b/keyboards/planck/keymaps/lukas/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/luke/keymap.c b/keyboards/planck/keymaps/luke/keymap.c index 5fc89580341..2ee8a5072e3 100644 --- a/keyboards/planck/keymaps/luke/keymap.c +++ b/keyboards/planck/keymaps/luke/keymap.c @@ -44,10 +44,6 @@ #pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - // Layers #define _COLEMAK 0 #define _QWERTY 1 @@ -274,10 +270,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { -}; - - void matrix_init_user(){ set_unicode_input_mode(UC_LNX); } diff --git a/keyboards/planck/keymaps/luke/rules.mk b/keyboards/planck/keymaps/luke/rules.mk index 76ed281c11e..e04815e2caf 100644 --- a/keyboards/planck/keymaps/luke/rules.mk +++ b/keyboards/planck/keymaps/luke/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/mattly/config.h b/keyboards/planck/keymaps/mattly/config.h new file mode 100644 index 00000000000..52e39ec7f42 --- /dev/null +++ b/keyboards/planck/keymaps/mattly/config.h @@ -0,0 +1,43 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define TAPPING_TOGGLE 2 +#define TAPPING_TERM 200 diff --git a/keyboards/planck/keymaps/mattly/keymap.c b/keyboards/planck/keymaps/mattly/keymap.c new file mode 100644 index 00000000000..52ade864321 --- /dev/null +++ b/keyboards/planck/keymaps/mattly/keymap.c @@ -0,0 +1,34 @@ +#include QMK_KEYBOARD_H +#include "mattly.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_planck_grid( + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SCLN, + KC_CAPS, A_CTRL, S_ALT, D_GUI, F_SHFT, KC_G, KC_H, J_SHFT, K_GUI, L_ALT, MINSCTL, KC_QUOT, + XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + XXXXXXX, NAVLOCK, XXXXXXX, ESC_HYP, BSP_NUM, ENT_SFT, SPC_SFT, TAB_SYM, DEL_WRP, XXXXXXX, SYMLOCK, XXXXXXX + ), + + [_SYMBOL] = LAYOUT_planck_grid( + _______, KC_AMPR, KC_GRV, KC_TILD, KC_LBRC, KC_RBRC, KC_LABK, KC_RABK, KC_PLUS, KC_ASTR, XXXXXXX, _______, + _______, KC_DLR, KC_PERC, KC_EQL, KC_LPRN, KC_RPRN, KC_SCLN, KC_COLN, KC_EXLM, KC_AT, KC_UNDS, _______, + _______, XXXXXXX, KC_CIRC, KC_HASH, KC_LCBR, KC_RCBR, KC_QUOT, KC_DQUO, KC_PIPE, KC_BSLS, KC_QUES, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +[_NAVNUM] = LAYOUT_planck_grid( + _______, XXXXXXX, BWORD, KC_UP, FWORD, KC_PGUP, KC_DOT, KC_7, KC_8, KC_9, KC_PLUS, KC_ASTR, + _______, KC_ENT, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_0, KC_4, KC_5, KC_6, KC_MINS, KC_SLSH, + _______, KC_BSPC, KC_HOME, KC_TAB, KC_END, KC_DEL, KC_COMM, KC_1, KC_2, KC_3, KC_EQL, KC_PERC, + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_COLN, KC_DLR, _______ +), + +[_FUNCT] = LAYOUT_planck_grid( + RESET, XALLWIN, XPRVSPC, NWIN, XNXTSPC, XDESKTP, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F13, + DEBUG, XNOTIFY, PTAB, PWIN, NTAB, NAVBACK, NAVFWD, KC_F4, KC_F5, KC_F6, KC_F11, KC_F14, + KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, KC_MPLY, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F12, KC_F15, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + + diff --git a/keyboards/planck/keymaps/mattly/readme.md b/keyboards/planck/keymaps/mattly/readme.md new file mode 100644 index 00000000000..4e8c7f17c6b --- /dev/null +++ b/keyboards/planck/keymaps/mattly/readme.md @@ -0,0 +1 @@ +See my readme in [users/mattly](../../../../../users/mattly/readme.md) \ No newline at end of file diff --git a/keyboards/planck/keymaps/mattly/rules.mk b/keyboards/planck/keymaps/mattly/rules.mk new file mode 100644 index 00000000000..7210cf34f0d --- /dev/null +++ b/keyboards/planck/keymaps/mattly/rules.mk @@ -0,0 +1,2 @@ +AUDIO_ENABLE = yes +SRC += muse.c diff --git a/keyboards/planck/keymaps/max/rules.mk b/keyboards/planck/keymaps/max/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/max/rules.mk +++ b/keyboards/planck/keymaps/max/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/mgalisa/config.h b/keyboards/planck/keymaps/mgalisa/config.h new file mode 100644 index 00000000000..6fa31cc8a76 --- /dev/null +++ b/keyboards/planck/keymaps/mgalisa/config.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/mgalisa/keymap.c b/keyboards/planck/keymaps/mgalisa/keymap.c new file mode 100644 index 00000000000..09acceb4c03 --- /dev/null +++ b/keyboards/planck/keymaps/mgalisa/keymap.c @@ -0,0 +1,403 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _EMOJI, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV, + AUTO_SQ, + AUTO_PA, + AUTO_CB, + SHRUG, + F4R +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT(_EMOJI,KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + LT(_EMOJI,KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + LT(_EMOJI,KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +/* [_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), */ + +/* Raise - new + * ,-----------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | {} | 7 | 8 | 9 | - | * | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F5 | F6 | F7 | F8 | () | 4 | 5 | 6 | + | / | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | [] | 1 | 2 | 3 |Vol - |Vol + | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | 0 | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, AUTO_CB, KC_7, KC_8, KC_9, KC_MINS, KC_ASTR, KC_BSPC, + KC_DEL, KC_F5, KC_F6, KC_F7, KC_F8, AUTO_PA, KC_4, KC_5, KC_6, KC_PLUS, KC_SLSH, KC_BSLS, + _______, KC_F9, KC_F10, KC_F11, KC_F12, AUTO_SQ, KC_1, KC_2, KC_3, KC_PGUP, KC_VOLU, _______, + _______, _______, _______, _______, _______, KC_0, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +[_EMOJI] = LAYOUT_planck_grid( + _______, _______, _______, F4R, _______, _______, _______, _______, _______, _______, _______, _______, + KC_TRNS, _______, _______, SHRUG, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case AUTO_SQ: + if (record->event.pressed) { + SEND_STRING("[]SS_TAP(X_LEFT)"); + } + return false; + break; + case AUTO_CB: + if (record->event.pressed) { + SEND_STRING("{}SS_TAP(X_LEFT)"); + } + return false; + break; + case AUTO_PA: + if (record->event.pressed) { + SEND_STRING("()SS_TAP(X_LEFT)"); + } + return false; + break; + case SHRUG: + if (record->event.pressed) { + SEND_STRING("/shrugSS_TAP(X_ENT)"); + } + return false; + break; + case F4R: + if (record->event.pressed) { + SEND_STRING(":f-for-respects:"); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/mgalisa/readme.md b/keyboards/planck/keymaps/mgalisa/readme.md new file mode 100644 index 00000000000..9d5b596016d --- /dev/null +++ b/keyboards/planck/keymaps/mgalisa/readme.md @@ -0,0 +1,15 @@ +# @mgalisa's Planck keymap + +A minor (so far) update to the default keymap. Probably more to come. + +## Raise layer + +![Raise layer](https://i.imgur.com/n0f4275.png) + +* Moved F-keys and number keys into 4x3 and 3x3 grid patterns for pseudo-numpad like effect +* Added macros to the middle column that insert bracket/brace/paren pairs and moves the cursor inbetween +* Minor adjustments + +## Emoji layer + +Activate by holding the Esc key from QWERTY/Dvorak/Colemak. Holds macros primarily for annoying coworkers via Slack. diff --git a/keyboards/planck/keymaps/mgalisa/rules.mk b/keyboards/planck/keymaps/mgalisa/rules.mk new file mode 100644 index 00000000000..2afe5904385 --- /dev/null +++ b/keyboards/planck/keymaps/mgalisa/rules.mk @@ -0,0 +1,6 @@ +SRC += muse.c +EXTRAKEY_ENABLE = yes +# RGBLIGHT_ENABLE = yes +## I bought the WS2812s... +## just need the main branch to be updated. +# Uncomment to make build fail. diff --git a/keyboards/planck/keymaps/mikethetiger/config.h b/keyboards/planck/keymaps/mikethetiger/config.h new file mode 100644 index 00000000000..6fa31cc8a76 --- /dev/null +++ b/keyboards/planck/keymaps/mikethetiger/config.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/mikethetiger/keymap.c b/keyboards/planck/keymaps/mikethetiger/keymap.c new file mode 100644 index 00000000000..bc36825e2ed --- /dev/null +++ b/keyboards/planck/keymaps/mikethetiger/keymap.c @@ -0,0 +1,346 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/mikethetiger/readme.md b/keyboards/planck/keymaps/mikethetiger/readme.md new file mode 100644 index 00000000000..ed039529658 --- /dev/null +++ b/keyboards/planck/keymaps/mikethetiger/readme.md @@ -0,0 +1,2 @@ +# mikethetiger Planck Layout + diff --git a/keyboards/planck/keymaps/mikethetiger/rules.mk b/keyboards/planck/keymaps/mikethetiger/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/planck/keymaps/mikethetiger/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/mitch/keymap.c b/keyboards/planck/keymaps/mitch/keymap.c index 79b5204f072..3887881a9ce 100644 --- a/keyboards/planck/keymaps/mitch/keymap.c +++ b/keyboards/planck/keymaps/mitch/keymap.c @@ -5,9 +5,6 @@ #define LOWER 1 #define RAISE 2 -// Alias to make layering more clear -#define _______ KC_TRNS - // In MacOS, switch between windows within an application #define GUI_GRV LGUI(KC_GRV) diff --git a/keyboards/planck/keymaps/mitch/rules.mk b/keyboards/planck/keymaps/mitch/rules.mk index 7955003d47e..32dc2acc676 100644 --- a/keyboards/planck/keymaps/mitch/rules.mk +++ b/keyboards/planck/keymaps/mitch/rules.mk @@ -1,5 +1,2 @@ SUBPROJECT = rev3 -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/mjt/keymap.c b/keyboards/planck/keymaps/mjt/keymap.c index 00251b82fa3..8179f4ab648 100644 --- a/keyboards/planck/keymaps/mjt/keymap.c +++ b/keyboards/planck/keymaps/mjt/keymap.c @@ -37,10 +37,6 @@ enum planck_keycodes { #include "dynamic_macro.h" -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/planck/keymaps/mjt/rules.mk b/keyboards/planck/keymaps/mjt/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/planck/keymaps/mjt/rules.mk +++ b/keyboards/planck/keymaps/mjt/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/mjtnumsym/keymap.c b/keyboards/planck/keymaps/mjtnumsym/keymap.c index 30e6e5304f3..af72699a501 100644 --- a/keyboards/planck/keymaps/mjtnumsym/keymap.c +++ b/keyboards/planck/keymaps/mjtnumsym/keymap.c @@ -36,10 +36,6 @@ enum planck_keycodes { #include "dynamic_macro.h" -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/planck/keymaps/mjtnumsym/rules.mk b/keyboards/planck/keymaps/mjtnumsym/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/planck/keymaps/mjtnumsym/rules.mk +++ b/keyboards/planck/keymaps/mjtnumsym/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/motform/config.h b/keyboards/planck/keymaps/motform/config.h new file mode 100644 index 00000000000..6fa31cc8a76 --- /dev/null +++ b/keyboards/planck/keymaps/motform/config.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/motform/keymap.c b/keyboards/planck/keymaps/motform/keymap.c new file mode 100644 index 00000000000..15f0e05fb60 --- /dev/null +++ b/keyboards/planck/keymaps/motform/keymap.c @@ -0,0 +1,211 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" +#include "keymap_swedish.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +/* These definitions can be removed once keymap_swe is properly vetted against MacOS */ +#define NO_DLR_MAC_V ALGR(LALT(KC_4)) +#define NO_AT_MAC_V ALGR(LALT(KC_2)) + +/* Esc when pressed, ctrl when used as a modifier */ +#define KC_ECTL MT(MOD_LCTL, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak_se + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | Ö | Å | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ECTR | A | R | S | T | D | H | N | E | I | O | Ä | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | SCSHE| Z | X | C | V | B | K | M | , | . | - |SCSHE | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | esc | CTRL | Alt | CMD |Lower |Space |Bksp |Raise | CMD | RALT | HYPER| MEH | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid +( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, NO_OSLH, NO_AA, + KC_ECTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, NO_AE, + KC_SFTENT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_SFTENT, + KC_ESC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_RGUI, KC_RALT, KC_HYPR, KC_MEH + ), + +/* Lower +* ,-----------------------------------------------------------------------------------. +* | | PIPE | ' | @ | & | | DOWN | | RIGHT| ` | ´ | ~ | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | | ! | " | # | ? | % | LEFT | / | \ | = | + | * | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | | | | [ | { | | UP | } | ] | | | | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | DEL | | Next | Vol- | Vol+ | Play | +* `-----------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_planck_grid +( + _______, NO_PIPE_MAC, NO_APOS, NO_AT_MAC_V, NO_AMPR, _______, KC_DOWN, KC_NO, KC_RGHT, NO_GRV, NO_GRV, NO_TILD, + _______, KC_EXLM, NO_QUO2, KC_HASH, NO_QUES, KC_PERC, KC_LEFT, NO_SLSH, NO_BSLS_MAC, NO_EQL, KC_PPLS, KC_PAST, + _______, KC_NO, KC_NO, NO_LBRC, NO_LCBR_MAC, KC_NO, KC_UP, NO_RCBR_MAC, NO_RBRC, KC_NO, KC_NO, _______, + _______, _______, _______, _______, _______, _______, KC_DEL, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + +/* Raise +* ,-----------------------------------------------------------------------------------. +* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | $ | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | | | | < | ( | | | ) | > |Pg Up |Pg Dn | | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | | Next | Vol- | Vol+ | Play | +* `-----------------------------------------------------------------------------------' +*/ +[_RAISE] = LAYOUT_planck_grid +( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + NO_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_DLR_MAC_V, + _______, KC_NO, KC_NO, NO_LESS_MAC, NO_LPRN, KC_NO, KC_NO, NO_RPRN, NO_GRTR_MAC, KC_PGUP, KC_PGDN, KC_NO, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| Debug| | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TRMon |TRMoff| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid +( + _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/motform/readme.md b/keyboards/planck/keymaps/motform/readme.md new file mode 100644 index 00000000000..47091c0aa8a --- /dev/null +++ b/keyboards/planck/keymaps/motform/readme.md @@ -0,0 +1,11 @@ +# Motform Planck Layout + +This layout is based off the [colemak-se](github.com/motform/colemak-se) +layout and features many tweaks to make working with Emacs and +evil-mode more ergonomi. As with the colemak layout itself, the idea +is to concentrate as much movement as possible to the home row. + +To properly use the layout in Emacs, set Super to LGUI and Meta to RGUI. +Unless you are running a permutation of the MacOS Swedish QWERTY-layout, +modifiers will probably not work. For future develoment, I’m planning +to add support for MS Windows SE-QWERTY in the form of a secondary layer. diff --git a/keyboards/planck/keymaps/motform/rules.mk b/keyboards/planck/keymaps/motform/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/planck/keymaps/motform/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/msiu/config.h b/keyboards/planck/keymaps/msiu/config.h new file mode 100644 index 00000000000..40e399a6759 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/config.h @@ -0,0 +1,40 @@ +#pragma once + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/msiu/keymap.c b/keyboards/planck/keymaps/msiu/keymap.c new file mode 100644 index 00000000000..aea59e8d779 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/keymap.c @@ -0,0 +1,208 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _DVORAK, + _LOWER, + _RAISE, + _NUMB, + _FUNC, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_planck_grid( + LT(_NUMB, KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_HYPR, KC_LALT, KC_LGUI, LOWER, MO(_FUNC), KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[_DVORAK] = LAYOUT_planck_grid( + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, + _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +[_ADJUST] = LAYOUT_planck_grid( + _______, _______, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, DVORAK, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF,_______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET +), + +[_FUNC] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_NUMB] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/msiu/readme.md b/keyboards/planck/keymaps/msiu/readme.md new file mode 100644 index 00000000000..de9680b4985 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/msiu/rules.mk b/keyboards/planck/keymaps/msiu/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/muzfuz/config.h b/keyboards/planck/keymaps/muzfuz/config.h new file mode 100644 index 00000000000..fe44b5aa2b9 --- /dev/null +++ b/keyboards/planck/keymaps/muzfuz/config.h @@ -0,0 +1,40 @@ +#pragma once + +#ifdef AUDIO_ENABLE +#define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +#define DEFAULT_LAYER_SONGS \ + { \ + SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/muzfuz/keymap.c b/keyboards/planck/keymaps/muzfuz/keymap.c new file mode 100644 index 00000000000..84452a3f178 --- /dev/null +++ b/keyboards/planck/keymaps/muzfuz/keymap.c @@ -0,0 +1,297 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers +{ + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes +{ + QWERTY = SAFE_RANGE, + BACKLIT, + EXT_PLV, + HASHRKT, + CLNEQLS +}; + +#define RSE_ENT LT(_RAISE, KC_ENT) +#define LWR_SPC LT(_LOWER, KC_SPC) +#define ESC_CTL CTL_T(KC_ESCAPE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI | Enter | Space | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + ESC_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, KC_NO, RSE_ENT, KC_NO, LWR_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |ESCCTL| := | | { | } | ( | ) | - | = | \ | ~ | GUI | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | => | | [ | ] | | | _ | + | | | Home | End | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + + [_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + ESC_CTL, CLNEQLS, _______, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_MINS, KC_EQL, KC_BSLS, KC_TILD, KC_RGUI, + _______, HASHRKT, _______, KC_LBRC, KC_RBRC, _______, _______, KC_UNDS, KC_PLUS, KC_PIPE, KC_HOME, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | | | Up | | | | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |ESCCTL| | Left | Down | Right | | | 4 | 5 | 6 | | GUI | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | 1 | 2 | 3 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + KC_GRV, _______, _______, KC_UP, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + ESC_CTL, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_4, KC_5, KC_6, _______, KC_RGUI, + _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + _______, _______, MU_MOD, AU_ON, AU_OFF, _______, _______, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + +}; + +#ifdef AUDIO_ENABLE +float plover_song[][2] = SONG(PLOVER_SOUND); +float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) +{ + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { + case HASHRKT: + if (record->event.pressed) + { + SEND_STRING("=>"); + } + break; + case CLNEQLS: + if (record->event.pressed) + { + SEND_STRING(":="); + } + break; + case QWERTY: + if (record->event.pressed) + { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) + { + register_code(KC_RSFT); +#ifdef BACKLIGHT_ENABLE + backlight_step(); +#endif +#ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1 << 6); +#endif + } + else + { + unregister_code(KC_RSFT); +#ifdef KEYBOARD_planck_rev5 + PORTE |= (1 << 6); +#endif + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) +{ + if (muse_mode) + { + if (IS_LAYER_ON(_RAISE)) + { + if (clockwise) + { + muse_offset++; + } + else + { + muse_offset--; + } + } + else + { + if (clockwise) + { + muse_tempo += 1; + } + else + { + muse_tempo -= 1; + } + } + } + else + { + if (clockwise) + { +#ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); +#else + register_code(KC_PGDN); + unregister_code(KC_PGDN); +#endif + } + else + { +#ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); +#else + register_code(KC_PGUP); + unregister_code(KC_PGUP); +#endif + } + } +} + +void dip_update(uint8_t index, bool active) +{ + switch (index) + { + case 0: + if (active) + { +#ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); +#endif + layer_on(_ADJUST); + } + else + { +#ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); +#endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) + { + muse_mode = true; + } + else + { + muse_mode = false; +#ifdef AUDIO_ENABLE + stop_all_notes(); +#endif + } + } +} + +void matrix_scan_user(void) +{ +#ifdef AUDIO_ENABLE + if (muse_mode) + { + if (muse_counter == 0) + { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) + { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } +#endif +} + +bool music_mask_user(uint16_t keycode) +{ + switch (keycode) + { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/muzfuz/readme.md b/keyboards/planck/keymaps/muzfuz/readme.md new file mode 100644 index 00000000000..6f78284d70d --- /dev/null +++ b/keyboards/planck/keymaps/muzfuz/readme.md @@ -0,0 +1,5 @@ +# The muzfuz Planck Layout + +```shell +make planck/rev6:muzfuz:dfu-util +``` diff --git a/keyboards/planck/keymaps/muzfuz/rules.mk b/keyboards/planck/keymaps/muzfuz/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/planck/keymaps/muzfuz/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/mwpeterson/keymap.c b/keyboards/planck/keymaps/mwpeterson/keymap.c index bfb015c7a8b..961b8394bcc 100644 --- a/keyboards/planck/keymaps/mwpeterson/keymap.c +++ b/keyboards/planck/keymaps/mwpeterson/keymap.c @@ -35,6 +35,19 @@ enum planck_layers { #define WM_W LALT(LGUI(KC_LEFT)) #define WM_CNTR LALT(LGUI(KC_C)) +#define SFT_INS LSFT(KC_INS) + +// Unicode +#ifdef UNICODEMAP_ENABLE +enum unicode_name { + IBANG // ‽ +}; + +const uint32_t PROGMEM unicode_map[] = { + [IBANG] = 0x0203D // ‽ +}; +#endif // UNICODEMAP_ENABLE + // Custom key codes enum planck_keycodes { QWERTY = SAFE_RANGE, @@ -81,7 +94,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * window ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ * switcher │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ - │ + │ ` │ | │ : │ │ │ , │ . │ \ │ │ + * │ │ - │ + │ ` │SFTIN│ : │ | │ ‽ │ , │ . │ \ │ │ * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ * │ │ │ │ │ │ Backspace │ │ │ │ │ │ * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ @@ -89,8 +102,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LOWER_LAYER] = LAYOUT_planck_grid( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, S(KC_3), _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - _______, KC_MINS, KC_PLUS, KC_GRV, KC_PIPE, KC_COLN, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_BSLS, _______, - _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, _______, _______, _______, _______ + _______, KC_MINS, KC_PLUS, KC_GRV, SFT_INS, KC_COLN, KC_PIPE, X(IBANG), KC_COMM, KC_DOT, KC_BSLS, _______, + _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, _______, _______, _______, _______ ), /* Symbol layer @@ -99,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ * │ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ' │ " │ │ \ * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ |-- Mostly shifted version - * │ │ _ │ = │ ~ │ | │ : │ │ │ , │ . │ / │ │ / of lower layer + * │ │ _ │ = │ ~ │SFTIN│ : │ | │ │ , │ . │ / │ │ / of lower layer * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ * │ │ │ │ │ │ Delete │ │ │ │ │ │ * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ @@ -107,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [RAISE_LAYER] = LAYOUT_planck_grid( S(KC_GRV), KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, S(KC_3), _______, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), KC_QUOT, S(KC_QUOT), _______, - _______, KC_UNDS, KC_EQL, KC_TILD, KC_PIPE, KC_COLN, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, KC_UNDS, KC_EQL, KC_TILD, SFT_INS, KC_COLN, KC_PIPE, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, _______, _______, _______, _______, _______, _______, KC_DEL, KC_DEL, _______, _______, _______, _______, _______ ), @@ -241,6 +254,10 @@ void plover_lookup(void) { unregister_code(PV_RG); } +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; + uint32_t layer_state_set_user(uint32_t state) { return update_tri_layer_state(state, LOWER_LAYER, RAISE_LAYER, ADJUST_LAYER); } diff --git a/keyboards/planck/keymaps/mwpeterson/rules.mk b/keyboards/planck/keymaps/mwpeterson/rules.mk index de8aa389c4a..e8261702813 100644 --- a/keyboards/planck/keymaps/mwpeterson/rules.mk +++ b/keyboards/planck/keymaps/mwpeterson/rules.mk @@ -1,6 +1,7 @@ -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Disable shift combination, which conflicts with shift-parens -MOUSEKEY_ENABLE = yes # Mouse keys (disabled to save space) -NKRO_ENABLE = no # N-key rollover required for use as a steno board -AUDIO_ENABLE = yes # Audio output on port C6 +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Disable shift combination, which conflicts with shift-parens +MOUSEKEY_ENABLE = yes # Mouse keys (disabled to save space) +NKRO_ENABLE = no # N-key rollover required for use as a steno board +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODEMAP_ENABLE = yes # Enable extended unicode diff --git a/keyboards/planck/keymaps/myoung34/rules.mk b/keyboards/planck/keymaps/myoung34/rules.mk index b1aaafd3a4d..0560de1dc4b 100644 --- a/keyboards/planck/keymaps/myoung34/rules.mk +++ b/keyboards/planck/keymaps/myoung34/rules.mk @@ -1,7 +1,3 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - AUDIO_ENABLE = yes # Audio output on port C6 CONSOLE_ENABLE = no # Console for debug(+400) MIDI_ENABLE = no # MIDI controls @@ -9,3 +5,4 @@ MOUSEKEY_ENABLE = no # Mouse keys(+4700) NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. BACKLIGHT_ENABLE = yes + diff --git a/keyboards/planck/keymaps/narze/keymap.c b/keyboards/planck/keymaps/narze/keymap.c index 71e9cccb2da..8f6cb062630 100644 --- a/keyboards/planck/keymaps/narze/keymap.c +++ b/keyboards/planck/keymaps/narze/keymap.c @@ -52,10 +52,6 @@ enum functions { static uint16_t m_gui_unds_timer; static uint16_t m_sft_po_timer; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Narze : Custom Macros #define HPR_ESC ALL_T(KC_ESC) #define SFT_ENT SFT_T(KC_ENT) diff --git a/keyboards/planck/keymaps/navi/config.h b/keyboards/planck/keymaps/navi/config.h index 694053c6a48..087ebb54e79 100644 --- a/keyboards/planck/keymaps/navi/config.h +++ b/keyboards/planck/keymaps/navi/config.h @@ -1,7 +1,14 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "config_common.h" +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif /* * MIDI options @@ -13,7 +20,7 @@ /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ - + #define MIDI_BASIC /* enable advanced MIDI features: @@ -27,4 +34,18 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#endif \ No newline at end of file +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define MOUSEKEY_INTERVAL 16 + +#define MOUSEKEY_DELAY 0 + +#define MOUSEKEY_TIME_TO_MAX 60 + +#define MOUSEKEY_MAX_SPEED 7 + +#define MOUSEKEY_WHEEL_DELAY 0 + +#define TAPPING_TERM 80 +#define TAPPING_TOGGLE 2 diff --git a/keyboards/planck/keymaps/navi/keymap.c b/keyboards/planck/keymaps/navi/keymap.c index 0f0e48ad8d5..bbf7d510f98 100644 --- a/keyboards/planck/keymaps/navi/keymap.c +++ b/keyboards/planck/keymaps/navi/keymap.c @@ -9,42 +9,35 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * cd /c/qmk_firmware - * make planck/rev4:navi + * cd /c/qmk_firmware-master... make planck/rev6:navi * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" -#include "action_layer.h" -#ifdef AUDIO_ENABLE - #include "audio.h" - #include "song_list.h" -#endif +#include QMK_KEYBOARD_H + extern keymap_config_t keymap_config; enum planck_layers { _QWERTY, - _COLEMAK, - _PLOVER, _LOWER, _RAISE, - _ADJUST, - _FUNCTION + _FUNCTION, + _ADJUST + }; enum planck_keycodes { QWERTY = SAFE_RANGE, - COLEMAK, - PLOVER, LOWER, RAISE, - EXT_PLV, FUNCTION }; +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -59,51 +52,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' * CtlSE = Control+shift+esc/ * CtlE = Control when held, esc when tapped - */ -[_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {FUNCTION, C_S_T(KC_ESC), KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | CtlE | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | FN |CtlSE | GUI | Alt |Lower | Space | Raise| Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = { - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {LCTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {FUNCTION, C_S_T(KC_ESC), KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, - -/* Plover layer (http://opensteno.org) - * ,-----------------------------------------------------------------------------------. - * | # | # | # | # | # | # | # | # | # | # | # | # | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | S | T | P | H | * | * | F | P | L | T | D | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | S | K | W | R | * | * | R | B | G | S | Z | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Exit | | | A | O | | E | U | | | | - * `-----------------------------------------------------------------------------------' + * FN takes two taps to have it stay as FN */ - -[_PLOVER] = { - {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, - {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, - {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} -}, - +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + TT(_FUNCTION), LCTL(LALT(KC_DEL)), KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), /* Lower * ,-----------------------------------------------------------------------------------. @@ -116,12 +72,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | |Pg DN | Pg UP| | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {KC_LSHIFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_END, KC_HOME, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______} -}, +[_LOWER] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_LSHIFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_END, KC_HOME, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______ +), /* Raise * ,-----------------------------------------------------------------------------------. @@ -129,89 +85,54 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | * |------+------+------+------+------+------|------+------+------+------+------+------| - * |Shift | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | End | Home | | + * |Shift | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | End | Home | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | |Pg DN |Pg UP | | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_LSHIFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_END, KC_HOME, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______} -}, +[_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LSHIFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_END, KC_HOME, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______ +), -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | |MU_MOD|Aud on|Audoff| | |Qwerty|Colemk|Plover| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |Caps |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | Caps | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = { - {_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL }, - {_______, _______, MU_MOD, AU_ON, AU_OFF, _______, _______, QWERTY, COLEMAK, PLOVER,_______, _______}, - {KC_CAPS, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, KC_CAPS}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, /* Function * ,-----------------------------------------------------------------------------------. - * | Esc | | Prev | Play | Next | | | | 7 | 8 | 9 | Bksp | + * | Vol- | Mute | Vol+ | | | | | # | 7 | 8 | 9 | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | Vol- | Mute | Vol+ | | | + | 4 | 5 | 6 | - | + * | Prev | Play | Next | | | | | + | 4 | 5 | 6 | - | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | CALC | | | | | | | $ | 1 | 2 | 3 | Enter| + * | CALC | MWU | M1 |MouseU| M2 | | | $ | 1 | 2 | 3 | Enter| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | |Prntsc| | | | * | 0 | . |Numlck| / | + * | | MWD |MouseL|MouseD|MouseR| | * | 0 | . |Numlck| / | * `-----------------------------------------------------------------------------------' */ -[_FUNCTION] = { - {KC_ESC , _______, KC_MPRV, KC_MPLY, KC_MNXT, _______,_______,_______, KC_KP_7, KC_KP_8, KC_KP_9,KC_BSPC}, - {_______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_PPLS, KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS}, - {KC_CALC, _______, _______, _______, _______, _______, _______, KC_DLR, KC_KP_1, KC_KP_2, KC_KP_3, KC_ENT}, - {_______, _______, KC_PSCR, _______, _______ , _______, _______, KC_PAST, KC_KP_0, KC_KP_DOT,KC_NUMLOCK, KC_PSLS} -} +[_FUNCTION] = LAYOUT_planck_grid( + KC_VOLD, KC_MUTE, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_HASH, KC_KP_7, KC_KP_8, KC_KP_9, KC_BSPC, + KC_MPRV, KC_MPLY, KC_MNXT, AU_ON, AU_OFF, MU_ON, MU_OFF, KC_PPLS, KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, + KC_CALC, KC_WH_U, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_DLR, KC_KP_1, KC_KP_2, KC_KP_3, KC_ENTER, + KC_TRNS, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_PAST, KC_KP_0, KC_KP_DOT,KC_NUMLOCK, KC_PSLS +) }; -#ifdef AUDIO_ENABLE -float tone_startup[][2] = SONG(ZELDA_PUZZLE); -float tone_qwerty[][2] = SONG(ZELDA_TREASURE); -float plover_song[][2] = SONG(PLOVER_SOUND); -float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); -float tone_colemak[][2] = SONG(VIOLIN_SOUND); -float tone_music_on[][2] = SONG(ONE_UP_SOUND); -float tone_music_off[][2] = SONG(ROCK_A_BYE_BABY); -#endif /* AUDIO_ENABLE */ +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); - set_single_persistent_default_layer(_QWERTY); - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); } return false; break; - case LOWER: + case LOWER: if (record->event.pressed) { layer_on(_LOWER); update_tri_layer(_LOWER, _RAISE, _ADJUST); @@ -238,62 +159,59 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_FUNCTION); } return false; - break; - case PLOVER: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(plover_song); - #endif - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(plover_gb_song); - #endif - layer_off(_PLOVER); - } - return false; - break; + break; } return true; } -void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); -} - -void music_on_user(void) -{ - PLAY_SONG(tone_music_on); +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } } -void music_off_user(void) -{ - PLAY_SONG(tone_music_off); +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } } -#endif - - diff --git a/keyboards/planck/keymaps/navi/rules.mk b/keyboards/planck/keymaps/navi/rules.mk index 628167ff668..4852442b36b 100644 --- a/keyboards/planck/keymaps/navi/rules.mk +++ b/keyboards/planck/keymaps/navi/rules.mk @@ -1 +1,4 @@ -AUDIO_ENABLE = yes \ No newline at end of file +AUDIO_ENABLE = yes +MOUSEKEY_ENABLE = yes + +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave \ No newline at end of file diff --git a/keyboards/planck/keymaps/neo2planck/keymap.c b/keyboards/planck/keymaps/neo2planck/keymap.c index 1ecc800595f..7b9d459fa27 100644 --- a/keyboards/planck/keymaps/neo2planck/keymap.c +++ b/keyboards/planck/keymaps/neo2planck/keymap.c @@ -11,10 +11,6 @@ #include "..\..\..\..\tmk_core\common\keycode.h" */ - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - /* This layout tries to emulate Neo2, and is intended to be used with a German QWERTZ softwarelayout. It has "üäöß" as it is optimized for a mix of German & English. @@ -97,10 +93,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/planck/keymaps/neo2planck/rules.mk b/keyboards/planck/keymaps/neo2planck/rules.mk index cedf3095e61..6846e9c164f 100644 --- a/keyboards/planck/keymaps/neo2planck/rules.mk +++ b/keyboards/planck/keymaps/neo2planck/rules.mk @@ -18,6 +18,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/nick/config.h b/keyboards/planck/keymaps/nick/config.h new file mode 100644 index 00000000000..3b8eff7513b --- /dev/null +++ b/keyboards/planck/keymaps/nick/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define TAP_CODE_DELAY 10 +#define ENCODER_RESOLUTION 2 diff --git a/keyboards/planck/keymaps/nick/keymap.c b/keyboards/planck/keymaps/nick/keymap.c new file mode 100644 index 00000000000..f100594d6f7 --- /dev/null +++ b/keyboards/planck/keymaps/nick/keymap.c @@ -0,0 +1,122 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Adjust| Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_MPLY, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +void encoder_update(bool clockwise) { + if (clockwise && !IS_LAYER_ON(_RAISE)) { + tap_code(KC_MS_WH_DOWN); + } else if (!clockwise && !IS_LAYER_ON(_RAISE)) { + tap_code(KC_MS_WH_UP); + } else if (clockwise && IS_LAYER_ON(_RAISE)) { + tap_code(KC_VOLU); + } else if (!clockwise && IS_LAYER_ON(_RAISE)) { + tap_code(KC_VOLD); + } +} diff --git a/keyboards/planck/keymaps/nick/readme.md b/keyboards/planck/keymaps/nick/readme.md new file mode 100644 index 00000000000..da7d3861ac6 --- /dev/null +++ b/keyboards/planck/keymaps/nick/readme.md @@ -0,0 +1,6 @@ +# Nick's Planck Layout + +Similar to default layout with some minor changes: +- scroll and volume control knob +- added rule to remove audio +- encoder resolution altered to suit [this model](https://au.element14.com/alps/ec11e15244g1/encoder-vertical-11mm-30det-15ppr/dp/2064986?ost=EC11E15244G1&ddkey=https%3Aen-AU%2FElement14_Australia%2Fsearch) diff --git a/keyboards/planck/keymaps/nick/rules.mk b/keyboards/planck/keymaps/nick/rules.mk new file mode 100644 index 00000000000..3bf3f273145 --- /dev/null +++ b/keyboards/planck/keymaps/nick/rules.mk @@ -0,0 +1 @@ +AUDIO_ENABLE = no diff --git a/keyboards/planck/keymaps/not-quite-neo/rules.mk b/keyboards/planck/keymaps/not-quite-neo/rules.mk index 90e6353f65b..5ba0cefb41b 100644 --- a/keyboards/planck/keymaps/not-quite-neo/rules.mk +++ b/keyboards/planck/keymaps/not-quite-neo/rules.mk @@ -24,6 +24,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/oeywil/.gitignore b/keyboards/planck/keymaps/oeywil/.gitignore new file mode 100644 index 00000000000..03b2b466681 --- /dev/null +++ b/keyboards/planck/keymaps/oeywil/.gitignore @@ -0,0 +1 @@ +secrets.h diff --git a/keyboards/planck/keymaps/oeywil/config.h b/keyboards/planck/keymaps/oeywil/config.h new file mode 100644 index 00000000000..09b22e193e8 --- /dev/null +++ b/keyboards/planck/keymaps/oeywil/config.h @@ -0,0 +1,37 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Leader Key +#define LEADER_TIMEOUT 250 +#define LEADER_PER_KEY_TIMING + +// Tap dance +#define TAPPING_TERM 200 diff --git a/keyboards/planck/keymaps/oeywil/keymap.c b/keyboards/planck/keymaps/oeywil/keymap.c new file mode 100644 index 00000000000..59e76cab12b --- /dev/null +++ b/keyboards/planck/keymaps/oeywil/keymap.c @@ -0,0 +1,392 @@ +#include QMK_KEYBOARD_H +#include "no_keycodes.h" + +#if __has_include("secrets.h") +# include "secrets.h" +#else +# define mail_str "" +# define pwd_str "" +#endif + +// layer definitions +enum planck_layers { + _DEFAULT, + _LOWER, + _RAISE, + _GAME, + _GLOW +}; + +// sounds +#ifdef AUDIO_ENABLE + float gamesong[][2] = SONG(MARIO_MUSHROOM); + float defsong[][2] = SONG(PLOVER_GOODBYE_SOUND); + float failed[][2] = SONG(TERMINAL_SOUND); +#endif + +// leader key +bool leader_succeed; +bool leader_layer_game; +bool leader_layer_def; +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leader_succeed = leading = false; + leader_layer_game = false; + leader_layer_def = false; + + SEQ_TWO_KEYS(KC_P, KC_P) { + SEND_STRING(pwd_str); + leader_succeed = true; + } + SEQ_TWO_KEYS(KC_P, KC_M) { + SEND_STRING(mail_str); + leader_succeed = true; + } + SEQ_TWO_KEYS(KC_B, KC_B) { + SEND_STRING("build"SS_TAP(X_ENTER)); + leader_succeed = true; + } + SEQ_TWO_KEYS(KC_B, KC_F) { + SEND_STRING("flash"SS_TAP(X_ENTER)); + reset_keyboard(); + leader_succeed = true; + } + SEQ_TWO_KEYS(KC_L, KC_G) { + layer_on(_GAME); + leader_layer_game = true; + } + SEQ_TWO_KEYS(KC_L, KC_D) { + layer_off(_GAME); + leader_layer_def = true; + } + leader_end(); + } +} + +void leader_end(void) { + if (leader_succeed) { + // do nothing + } else if (leader_layer_game) { + #ifdef AUDIO_ENABLE + PLAY_SONG(gamesong); + #endif + } else if (leader_layer_def) { + #ifdef AUDIO_ENABLE + PLAY_SONG(defsong); + #endif + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(failed); + #endif + } +} + +// tap dance definitions +typedef struct { + bool is_press_action; + int state; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7 +}; + +enum { + TD_LSFT = 0, + TD_LCTL, + TD_RSFT, + TD_RCTL +}; + +int cur_dance (qk_tap_dance_state_t *state); +void lsft_finished (qk_tap_dance_state_t *state, void *user_data); +void lsft_reset (qk_tap_dance_state_t *state, void *user_data); +void rsft_finished (qk_tap_dance_state_t *state, void *user_data); +void rsft_reset (qk_tap_dance_state_t *state, void *user_data); +void lctl_finished (qk_tap_dance_state_t *state, void *user_data); +void lctl_reset (qk_tap_dance_state_t *state, void *user_data); +void rctl_finished (qk_tap_dance_state_t *state, void *user_data); +void rctl_reset (qk_tap_dance_state_t *state, void *user_data); + +// layer declarations +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Default + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | Å | BkSp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | Ø | Æ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | P | , | . | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Lead | Win | Alt | Lower| Space| Enter| Raise| AltGr| App | Lead | Ctrl | + * `-----------------------------------------------------------------------------------' + */ + [_DEFAULT] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, NO_AA, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_OE, NO_AE, + TD(TD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_P, KC_COMM, KC_DOT, TD(TD_RSFT), + TD(TD_LCTL), KC_LEAD, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, KC_ENT, MO(_RAISE), KC_ALGR, KC_APP, KC_LEAD, TD(TD_RCTL) + ), + /* Lower + * ,-----------------------------------------------------------------------------------. + * | Tab | | PgUp | | | | F7 | F8 | F9 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | BkSp | Left | Down | Right| PgDn | | | | F4 | F5 | F6 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Home | | End | | | | | F1 | F2 | F3 | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | | Win | Alt | Lower| M_PP |M_Next| | | Mute | VolD | VolUp| + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + KC_TRNS, LCTL(KC_LEFT), KC_UP, LCTL(KC_RIGHT), KC_PGUP, KC_NO, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_DEL, + KC_BSPC, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, KC_NO, KC_NO, KC_NO, KC_F4, KC_F5, KC_F6, KC_NO, + KC_TRNS, KC_HOME, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F2, KC_F3, KC_TRNS, + KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU + ), + /* Raise + * ,-----------------------------------------------------------------------------------. + * | Tab | ! | ? | # | * | | | = | / | 7 | 8 | 9 | Ins | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | BkSp | @ | & | $ | % | ~ | + | \ | 4 | 5 | 6 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ' | " | ¨ | | | - | 0 | 1 | 2 | 3 | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | | Win | Alt | | Space| Enter| Raise| AltGr| | | | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + KC_TRNS, NO_EXCL, NO_QEST, NO_HASH, NO_ASTE, NO_PIPE, NO_EQUA, NO_FSLS, KC_7, KC_8, KC_9, KC_INS, + KC_BSPC, NO_ALFA, NO_AMPE, NO_USDO, NO_PERC, NO_TILD, NO_PLUS, NO_BSLS, KC_4, KC_5, KC_6, KC_NO, + KC_TRNS, NO_APOS, NO_QUOT, NO_UMLA, KC_NO, KC_NO, NO_DASH, KC_0, KC_1, KC_2, KC_3, KC_TRNS, + KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO + ), + /* Game + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | | BkSp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | P | , | . | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Lead | | Alt | Lower| Space| Enter| Lower| | | Lead | | + * `-----------------------------------------------------------------------------------' + */ + [_GAME] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_NO, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_NO, KC_NO, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_P, KC_COMM, KC_DOT, KC_NO, + KC_LCTL, KC_LEAD, KC_NO, KC_LALT, MO(_GLOW), KC_SPC, KC_ENT, MO(_GLOW), KC_NO, KC_NO, KC_LEAD, KC_NO + ), + /* Game lower + * ,-----------------------------------------------------------------------------------. + * | Tab | 1 | 2 | 3 | | | | | | | | Steam| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | 4 | 5 | 6 | | | | | | | | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| 7 | 8 | 9 | 0 | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | | | Alt | | PlyPa| Next | | | Mute | VolD | VolUp| + * `-----------------------------------------------------------------------------------' + */ + [_GLOW] = LAYOUT_planck_grid( + KC_TRNS, KC_1, KC_2, KC_3, KC_PPLS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LSFT(KC_F7), + KC_TRNS, KC_4, KC_5, KC_6, KC_PMNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F12, + KC_TRNS, KC_7, KC_8, KC_9, KC_0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_NO, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU + ) +}; + +// tap dance declarations +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + if (state->count == 3) { + if (state->interrupted || !state->pressed) return TRIPLE_TAP; + else return TRIPLE_HOLD; + } + else return 8; +} + +static tap xtap_state = { + .is_press_action = true, + .state = 0 +}; + +void lsft_finished (qk_tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: + register_code16(LSFT(KC_8)); + break; + case SINGLE_HOLD: + register_code(KC_LSFT); + break; + case DOUBLE_TAP: + register_code(KC_NUBS); + break; + case DOUBLE_SINGLE_TAP: + register_code(KC_NUBS); + break; + } +} + +void lsft_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: + unregister_code16(LSFT(KC_8)); + break; + case SINGLE_HOLD: + unregister_code(KC_LSFT); + break; + case DOUBLE_TAP: + unregister_code(KC_NUBS); + break; + case DOUBLE_SINGLE_TAP: + unregister_code(KC_NUBS); + break; + } + xtap_state.state = 0; +} + +void rsft_finished (qk_tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: + register_code16(LSFT(KC_9)); + break; + case SINGLE_HOLD: + register_code(KC_RSFT); + break; + case DOUBLE_TAP: + register_code16(LSFT(KC_NUBS)); + break; + case DOUBLE_SINGLE_TAP: + register_code16(LSFT(KC_NUBS)); + break; + } +} + +void rsft_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: + unregister_code16(LSFT(KC_9)); + break; + case SINGLE_HOLD: + unregister_code(KC_RSFT); + break; + case DOUBLE_TAP: + unregister_code16(LSFT(KC_NUBS)); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(LSFT(KC_NUBS)); + break; + } + xtap_state.state = 0; +} + +void lctl_finished (qk_tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: + register_mods(MOD_BIT(KC_ALGR)); + register_code(KC_7); + break; + case SINGLE_HOLD: + register_code(KC_LCTL); + break; + case DOUBLE_TAP: + register_mods(MOD_BIT(KC_ALGR)); + register_code(KC_8); + break; + case DOUBLE_SINGLE_TAP: + register_mods(MOD_BIT(KC_ALGR)); + register_code(KC_8); +break; + } +} + +void lctl_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: + unregister_code(KC_7); + unregister_mods(MOD_BIT(KC_ALGR)); + break; + case SINGLE_HOLD: + unregister_code(KC_LCTL); + break; + case DOUBLE_TAP: + unregister_code(KC_8); + unregister_mods(MOD_BIT(KC_ALGR)); + break; + case DOUBLE_SINGLE_TAP: + unregister_code(KC_8); + unregister_mods(MOD_BIT(KC_ALGR)); +break; + } + xtap_state.state = 0; +} + +void rctl_finished (qk_tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: + register_mods(MOD_BIT(KC_ALGR)); + register_code(KC_0); + break; + case SINGLE_HOLD: + register_code(KC_RCTL); + break; + case DOUBLE_TAP: + register_mods(MOD_BIT(KC_ALGR)); + register_code(KC_9); + break; + case DOUBLE_SINGLE_TAP: + register_mods(MOD_BIT(KC_ALGR)); + register_code(KC_9); + break; + } +} + +void rctl_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: + unregister_code(KC_0); + unregister_mods(MOD_BIT(KC_ALGR)); + break; + case SINGLE_HOLD: + unregister_code(KC_RCTL); + break; + case DOUBLE_TAP: + unregister_code(KC_9); + unregister_mods(MOD_BIT(KC_ALGR)); + break; + case DOUBLE_SINGLE_TAP: + unregister_code(KC_9); + unregister_mods(MOD_BIT(KC_ALGR)); + break; + } + xtap_state.state = 0; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LSFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lsft_finished, lsft_reset), + [TD_RSFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rsft_finished, rsft_reset), + [TD_LCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lctl_finished, lctl_reset), + [TD_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rctl_finished, rctl_reset), +}; diff --git a/keyboards/planck/keymaps/oeywil/no_keycodes.h b/keyboards/planck/keymaps/oeywil/no_keycodes.h new file mode 100644 index 00000000000..c412c35d81b --- /dev/null +++ b/keyboards/planck/keymaps/oeywil/no_keycodes.h @@ -0,0 +1,28 @@ +// øæå +#define NO_OE KC_SCLN +#define NO_AE KC_QUOT +#define NO_AA KC_LBRC +// rename +#define NO_ANBR KC_NUBS +#define NO_APOS KC_BSLS +#define NO_BSLS KC_EQL +#define NO_DASH KC_SLSH +#define NO_PLUS KC_MINS +#define NO_UMLA KC_RBRC +#define NO_PIPE KC_GRV +// shifted +#define NO_EXCL LSFT(KC_1) +#define NO_QUOT LSFT(KC_2) +#define NO_HASH LSFT(KC_3) +#define NO_PERC LSFT(KC_5) +#define NO_AMPE LSFT(KC_6) +#define NO_FSLS LSFT(KC_7) +#define NO_LPAR LSFT(KC_8) +#define NO_RPAR LSFT(KC_9) +#define NO_EQUA LSFT(KC_0) +#define NO_QEST LSFT(KC_MINS) +#define NO_ASTE LSFT(KC_BSLS) +// altgr +#define NO_ALFA ALGR(KC_2) +#define NO_USDO ALGR(KC_4) +#define NO_TILD ALGR(KC_RBRC) diff --git a/keyboards/planck/keymaps/oeywil/readme.md b/keyboards/planck/keymaps/oeywil/readme.md new file mode 100644 index 00000000000..364f9422c71 --- /dev/null +++ b/keyboards/planck/keymaps/oeywil/readme.md @@ -0,0 +1,4 @@ +About +------ + +A simple Norwegian grid layout using Leader Key, Tap Dance and audio. diff --git a/keyboards/planck/keymaps/oeywil/rules.mk b/keyboards/planck/keymaps/oeywil/rules.mk new file mode 100644 index 00000000000..23b2611735b --- /dev/null +++ b/keyboards/planck/keymaps/oeywil/rules.mk @@ -0,0 +1,11 @@ +SRC += muse.c + +# Build Options +NKRO_ENABLE = yes +EXTRAKEY_ENABLE = yes +LEADER_ENABLE = yes +TAP_DANCE_ENABLE = yes +AUDIO_ENABLE = yes +COMMAND_ENABLE = no +CONSOLE_ENABLE = no +MOUSEKEY_ENABLE = no diff --git a/keyboards/planck/keymaps/originerd/keymap.c b/keyboards/planck/keymaps/originerd/keymap.c index 4248ad9e7b7..27aa9d93cbb 100644 --- a/keyboards/planck/keymaps/originerd/keymap.c +++ b/keyboards/planck/keymaps/originerd/keymap.c @@ -27,10 +27,6 @@ enum planck_keycodes { RAISE }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* NERD diff --git a/keyboards/planck/keymaps/originerd/rules.mk b/keyboards/planck/keymaps/originerd/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/planck/keymaps/originerd/rules.mk +++ b/keyboards/planck/keymaps/originerd/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/paget/rules.mk b/keyboards/planck/keymaps/paget/rules.mk index 457a3d01d4a..e69de29bb2d 100755 --- a/keyboards/planck/keymaps/paget/rules.mk +++ b/keyboards/planck/keymaps/paget/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/palleiko/keymap.c b/keyboards/planck/keymaps/palleiko/keymap.c index c844191d1d9..a980939388d 100644 --- a/keyboards/planck/keymaps/palleiko/keymap.c +++ b/keyboards/planck/keymaps/palleiko/keymap.c @@ -57,8 +57,6 @@ enum planck_keycodes { #define WM_9 LALT(KC_9) #define WM_0 LALT(KC_0) -// Transparent Key -#define _______ KC_TRNS // NOP #define ___x___ KC_NO diff --git a/keyboards/planck/keymaps/pete/keymap.c b/keyboards/planck/keymaps/pete/keymap.c index de5c50cd1c6..2a9b66c42d8 100644 --- a/keyboards/planck/keymaps/pete/keymap.c +++ b/keyboards/planck/keymaps/pete/keymap.c @@ -48,10 +48,6 @@ extern keymap_config_t keymap_config; #define MACSLEEP LSFT(LCTL(KC_POWER)) #define WINSLEEP KC_SLEP -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = { @@ -117,9 +113,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; int currentOs = _MAC; -const uint16_t PROGMEM fn_actions[] = { - -}; #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/pete/rules.mk b/keyboards/planck/keymaps/pete/rules.mk index 20bba3f4915..8a328f6b6cb 100644 --- a/keyboards/planck/keymaps/pete/rules.mk +++ b/keyboards/planck/keymaps/pete/rules.mk @@ -10,6 +10,3 @@ NKRO_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/pevecyan/keymap.c b/keyboards/planck/keymaps/pevecyan/keymap.c index 4d76f09b0a5..57f9f0e7f9c 100644 --- a/keyboards/planck/keymaps/pevecyan/keymap.c +++ b/keyboards/planck/keymaps/pevecyan/keymap.c @@ -20,6 +20,8 @@ #include "muse.h" #include "keymap_slovenian.h" +#define ALTG(kc) ALGR(kc) // FIXME: Remove this + extern keymap_config_t keymap_config; enum planck_layers { diff --git a/keyboards/planck/keymaps/phreed/readme.md b/keyboards/planck/keymaps/phreed/readme.md index c8fd9324387..963740058b9 100644 --- a/keyboards/planck/keymaps/phreed/readme.md +++ b/keyboards/planck/keymaps/phreed/readme.md @@ -34,5 +34,5 @@ To flash the keyboard make planck/rev3:phreed:dfu -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the -[make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the +[make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/planck/keymaps/phreed/rules.mk b/keyboards/planck/keymaps/phreed/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/planck/keymaps/phreed/rules.mk +++ b/keyboards/planck/keymaps/phreed/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/piemod/README.md b/keyboards/planck/keymaps/piemod/README.md index f2a051da14e..9c29e75db34 100644 --- a/keyboards/planck/keymaps/piemod/README.md +++ b/keyboards/planck/keymaps/piemod/README.md @@ -17,10 +17,6 @@ A keymap for users that need: Still a work-in-progress. Suggestions welcome @ https://github.com/dwrz/piemod. -### Keymap - -![PieMod Keymap](./keymap.png) - ### TODO - [ ] Add Emacs layer. diff --git a/keyboards/planck/keymaps/piemod/rules.mk b/keyboards/planck/keymaps/piemod/rules.mk index 84cb02bd760..0eabfdfc19e 100644 --- a/keyboards/planck/keymaps/piemod/rules.mk +++ b/keyboards/planck/keymaps/piemod/rules.mk @@ -13,6 +13,3 @@ else BLUETOOTH_ENABLE = yes endif -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/premek/keymap.c b/keyboards/planck/keymaps/premek/keymap.c index e5a73ba7ec4..28fc8f3ad1f 100644 --- a/keyboards/planck/keymaps/premek/keymap.c +++ b/keyboards/planck/keymaps/premek/keymap.c @@ -32,10 +32,6 @@ enum planck_keycodes { EXT_PLV }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = { diff --git a/keyboards/planck/keymaps/priyadi/config.h b/keyboards/planck/keymaps/priyadi/config.h index 876d057bf2a..c85e8656e6f 100644 --- a/keyboards/planck/keymaps/priyadi/config.h +++ b/keyboards/planck/keymaps/priyadi/config.h @@ -21,7 +21,8 @@ #define DOUBLESPACE_LAYER_ENABLE // #define TOLELOT_ENABLE -#define KEYMAP_CUSTOM( \ +#ifdef __AVR__ +#define LAYOUT( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ @@ -34,5 +35,24 @@ {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c}, \ {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c} \ } +#elif KEYBOARD_planck_rev6 +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + tp1, tp2, tp3 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} +#endif #endif diff --git a/keyboards/planck/keymaps/priyadi/rules.mk b/keyboards/planck/keymaps/priyadi/rules.mk index 282c047eec4..17617b0b7cb 100644 --- a/keyboards/planck/keymaps/priyadi/rules.mk +++ b/keyboards/planck/keymaps/priyadi/rules.mk @@ -8,19 +8,23 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes # Unicode map BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = no + +ifeq ($(strip $(KEYBOARD)), planck/rev4) FAUXCLICKY_ENABLE = yes +BACKLIGHT_ENABLE = yes +AUDIO_ENABLE = no +endif + +ifeq ($(strip $(KEYBOARD)), planck/rev6) +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +endif # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/ptillemans/config.h b/keyboards/planck/keymaps/ptillemans/config.h new file mode 100644 index 00000000000..d9be4c017e4 --- /dev/null +++ b/keyboards/planck/keymaps/ptillemans/config.h @@ -0,0 +1,43 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + + +// setup double tapping to lock layers +#define TAPPING_TERM 175 +#define TAPPING_TOGGLE 2 diff --git a/keyboards/planck/keymaps/ptillemans/keymap.c b/keyboards/planck/keymaps/ptillemans/keymap.c new file mode 100644 index 00000000000..c1f847e2f32 --- /dev/null +++ b/keyboards/planck/keymaps/ptillemans/keymap.c @@ -0,0 +1,322 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +#define MY_SHEN MT(MOD_LSFT, KC_ENT) +#define MY_CTES MT(MOD_LCTL, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Q | W | E | R | T | PgUp | Up | Y | U | I | O | P | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | A | S | D | F | G | PgDn | Down | H | J | K | L | ; | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Z | X | C | V | B | Home | End | N | M | , | . | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Raise| Tab | super| Alt | BS | Ctrl/Esc |Spc/Alt| Lower| ' | \ |Sh/Ent| + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_PGUP, KC_UP, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_PGDN, KC_DOWN, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + LOWER, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, MY_CTES, MY_CTES, KC_SPC, RAISE, KC_QUOT,KC_MINUS, MY_SHEN +), +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB , KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + MY_CTES, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MY_SHEN , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Ins | Home | Up | End | PgUp | | | | F7 | F8 | F9 | F10 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | Left | Down |Right | PgDn | | | | F4 | F5 | F6 | F11 | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Vol+ | | | | | | | F1 | F2 | F3 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Vol- | | | Next | | | |PrtScr| Lock | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PERC, KC_CIRC, KC_AMPR, KC_F7, KC_F8, KC_F9, KC_F10, + KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_F4, KC_F5, KC_F6, KC_F11, + _______, KC_VOLU, _______, _______, _______, _______, _______, KC_TILD, KC_F1, KC_F2, KC_F3, KC_F12, + _______, KC_VOLD, _______, _______, KC_MNXT, _______, _______, _______, TO(_QWERTY), KC_PSCR, KC_SLCK, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ! | @ | Up | _ | + | | | PgUp | 7 | 8 | 9 | * | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | # | Left | Down |Right | $ | | | PgDn | 4 | 5 | 6 | + +| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | [ | ] | ( | ) | & | | | ` | 1 | 2 | 3 | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | . | 0 | = | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_EXLM, KC_AT, KC_UP, KC_UNDS, KC_PLUS, _______, _______, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR, + KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DLR, _______, _______, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS, + KC_MINS, KC_EQL, KC_LPRN, KC_RPRN, KC_AMPR, _______, _______, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), KC_DOT, KC_0, KC_RBRC +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| |Qwerty|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, QWERTY, DVORAK, PLOVER, _______, + BACKLIT, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/ptillemans/readme.md b/keyboards/planck/keymaps/ptillemans/readme.md new file mode 100644 index 00000000000..de9680b4985 --- /dev/null +++ b/keyboards/planck/keymaps/ptillemans/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/ptillemans/rules.mk b/keyboards/planck/keymaps/ptillemans/rules.mk new file mode 100644 index 00000000000..c329d16ff8a --- /dev/null +++ b/keyboards/planck/keymaps/ptillemans/rules.mk @@ -0,0 +1,2 @@ +SRC += muse.c +BACKLIGHT_ENABLE = yes diff --git a/keyboards/planck/keymaps/pvc/keymap.c b/keyboards/planck/keymaps/pvc/keymap.c index 14e1041f49e..a6ecf16115f 100644 --- a/keyboards/planck/keymaps/pvc/keymap.c +++ b/keyboards/planck/keymaps/pvc/keymap.c @@ -105,8 +105,6 @@ enum keyboard_macros { #define TG_NKRO MAGIC_TOGGLE_NKRO #define OS_SHFT KC_FN0 -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define ________________ _______, _______ #define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX diff --git a/keyboards/planck/keymaps/rai-suta/keymap.c b/keyboards/planck/keymaps/rai-suta/keymap.c index 59fe34b1e45..e4934dbc459 100644 --- a/keyboards/planck/keymaps/rai-suta/keymap.c +++ b/keyboards/planck/keymaps/rai-suta/keymap.c @@ -6,10 +6,6 @@ #include "sendstring_jis.h" -// Keycode defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define C(kc) LCTL(kc) // JIS keyboard #define JK_CIRC KC_EQL // ^ #define JK_AT KC_LBRC // @ diff --git a/keyboards/planck/keymaps/rai-suta/rules.mk b/keyboards/planck/keymaps/rai-suta/rules.mk index ce13befd906..88915dcd3c6 100644 --- a/keyboards/planck/keymaps/rai-suta/rules.mk +++ b/keyboards/planck/keymaps/rai-suta/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/rjhilgefort/config.h b/keyboards/planck/keymaps/rjhilgefort/config.h new file mode 100644 index 00000000000..e8c13caac59 --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/config.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/rjhilgefort/keymap.c b/keyboards/planck/keymaps/rjhilgefort/keymap.c new file mode 100644 index 00000000000..33319153112 --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/keymap.c @@ -0,0 +1,154 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +#define CTRL_ESC MT(MOD_LCTL, KC_ESC) +#define HYPER LCTL(LALT(QK_LGUI)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty +* ,-------------------------------------------------------------------------------------------------------. +* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +* |--------+--------+--------+--------+--------+-------+-------+------+--------+--------+--------+--------| +* | Ct/Esc | A | S | D | F | G | H | J | K | L | ; | " | +* |--------+--------+--------+--------+--------+-------+-------+------+--------+--------+--------+--------| +* | Shift | Z | X | C | V | B | N | M | , | . | / | Enter | +* |--------+--------+--------+--------+--------+-------+-------+------+--------+--------+--------+--------| +* | | Ctrl | Raise | Alt | GUI | Space | Lowr | Hyper | | | Raise | +* `-------------------------------------------------------------------------------------------------------' +*/ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTRL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + _______, KC_LCTL, RAISE, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, LOWER, HYPER, _______, _______, RAISE +), + +/* Lower +* ,-----------------------------------------------------------------------------------------------------------. +* | | \ | / | [ | ] | ~ | | | = | + | - | _ | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+---------+--------+--------| +* | | { | } | ( | ) | ` | ← | ↓ | ↑ | → | Alt | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+---------+--------+--------| +* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+---------+--------+--------| +* | | | | | | | | | | | | +* `-----------------------------------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_planck_grid( + _______, KC_BSLS, KC_SLSH, KC_LBRC, KC_RBRC, KC_TILD, KC_PIPE, KC_EQL, KC_PLUS, KC_MINS, KC_UNDS, _______, + _______, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_GRV, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_LALT, _______, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise +* ,----------------------------------------------------------------------------------------------------------. +* | | | | | | | | 7 | 8 | 9 | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | VolMte | Vol - | Vol + | Ply/Pse| | | 4 | 5 | 6 | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | Trak ← | Trak → | Scrn - | Scrn + | | | 1 | 2 | 3 | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | | | | | | | 0 | . | | | +* `----------------------------------------------------------------------------------------------------------' +*/ +[_RAISE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, + _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, KC_4, KC_5, KC_6, _______, _______, + _______, KC_MRWD, KC_MFFD, KC_SLCK, KC_PAUS, _______, _______, KC_1, KC_2, KC_3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, KC_DOT, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,----------------------------------------------------------------------------------------------------------. + * | | Reset | | | | | | | | | | Del | + * |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | MuMod | AudOn | AudOff | | | Qwerty | | | | | + * |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | Voice- | Voice+ | MusOn | Musoff | MIDIon | MIDIof | TermOn | TermOff| | | | + * |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | + * `----------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, MU_MOD, AU_ON, AU_OFF, _______, _______, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +/* +* Example +* ,----------------------------------------------------------------------------------------------------------. +* | | | | | | | | | | | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | | | | | | | | | | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | | | | | | | | | | | | +* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +* | | | | | | | | | | | | +* `----------------------------------------------------------------------------------------------------------' +* +[_EXAMPLE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +*/ diff --git a/keyboards/planck/keymaps/rjhilgefort/readme.md b/keyboards/planck/keymaps/rjhilgefort/readme.md new file mode 100644 index 00000000000..f446a76194e --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/readme.md @@ -0,0 +1,63 @@ +# [🐦 @rjhilgefort](https://twitter.com/rjhilgefort) Planck Layout + +A simple and practical layout featuring: + +- Hyper Key === CTRL + ALT + GUI +- Ctrl/Esc key that is CTRL when held and ESC when tapped +- Symbols layer that focuses on coding +- Numpad + media layer + +![Imgur](https://i.imgur.com/elygxAb.jpg) + + +## Main +``` +,-------------------------------------------------------------------------------------------------------. +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|--------|--------|--------|--------|--------|-------|-------|------|--------|--------|--------|--------| +| Ct/Esc | A | S | D | F | G | H | J | K | L | ; | " | +|--------|--------|--------|--------|--------|-------|-------|------|--------|--------|--------|--------| +| Shift | Z | X | C | V | B | N | M | , | . | / | Enter | +|--------|--------|--------|--------|--------|-------|-------|------|--------|--------|--------|--------| +| | Ctrl | Raise | Alt | GUI | Space | Lowr | Hyper | | | Raise | +`-------------------------------------------------------------------------------------------------------' +``` + +## Lower +``` +,-----------------------------------------------------------------------------------------------------------. +| | \ | / | [ | ] | ~ | | | = | + | - | _ | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|---------|--------|--------| +| | { | } | ( | ) | ` | ← | ↓ | ↑ | → | Alt | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|---------|--------|--------| +| | ! | @ | # | $ | % | ^ | & | * | ( | ) | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|---------|--------|--------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------' +``` + +## Raise +``` +,----------------------------------------------------------------------------------------------------------. +| | | | | | | | 7 | 8 | 9 | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | VolMte | Vol - | Vol + | Ply/Pse| | | 4 | 5 | 6 | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | Trak ← | Trak → | Scrn - | Scrn + | | | 1 | 2 | 3 | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | | | | | | | 0 | . | | | +`----------------------------------------------------------------------------------------------------------' +``` + +## Adjust (Lower + Raise) +``` +,----------------------------------------------------------------------------------------------------------. +| | Reset | | | | | | | | | | Del | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | | MuMod | AudOn | AudOff | | | Qwerty | | | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | Voice- | Voice+ | MusOn | Musoff | MIDIon | MIDIof | TermOn | TermOff| | | | +|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------| +| | | | | | | | | | | | +`----------------------------------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/rjhilgefort/rules.mk b/keyboards/planck/keymaps/rjhilgefort/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/roguepullrequest/config.h b/keyboards/planck/keymaps/roguepullrequest/config.h new file mode 100644 index 00000000000..13d3a6370f7 --- /dev/null +++ b/keyboards/planck/keymaps/roguepullrequest/config.h @@ -0,0 +1,8 @@ +#pragma once + + + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(RICK_ROLL) +#endif diff --git a/keyboards/planck/keymaps/roguepullrequest/keymap.c b/keyboards/planck/keymaps/roguepullrequest/keymap.c new file mode 100644 index 00000000000..177cb2b671f --- /dev/null +++ b/keyboards/planck/keymaps/roguepullrequest/keymap.c @@ -0,0 +1,254 @@ +#include QMK_KEYBOARD_H + +#ifdef AUDIO_ENABLE + float mushroom[][2] = SONG(MARIO_MUSHROOM); +#endif + + +extern keymap_config_t keymap_config; + +// Complex Tapdance hoopla +typedef struct { + bool is_press_action; + int state; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + TRIPLE_TAP = 5, + TRIPLE_HOLD = 6, +}; + +// Tap dance enums +enum { + X_AT_FUN = 0, + RSHIFT, + LSHIFT, + TD_S, + SLASH +}; + +int cur_dance (qk_tap_dance_state_t *state); + +void x_finished (qk_tap_dance_state_t *state, void *user_data); +void x_reset (qk_tap_dance_state_t *state, void *user_data); +void lshift_finished (qk_tap_dance_state_t *state, void *user_data); +void lshift_reset(qk_tap_dance_state_t *state, void *user_data); + + +bool is_alt_tab_active = false; +uint16_t alt_tab_timer = 0; + +// Modified Programmer Dvorak enums + +enum planck_layers { + _PDVORAK, + _UPPER, + _LOWER, + _FUNCTION, +}; + +enum custom_keycodes { + PDVK = SAFE_RANGE, + KC_LAST, + ALT_TAB +}; + +// For getting the last arg in shell line (SUPER THANKS to Drashna over on Discord) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t macro_timer; + + switch (keycode) { + case ALT_TAB: + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + register_code(KC_LALT); + } + alt_tab_timer = timer_read(); + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + } + + switch (keycode){ + case KC_LAST: + if(record->event.pressed){ + macro_timer = timer_read(); + register_mods(MOD_BIT(KC_LCTRL)); + } else { + unregister_mods(MOD_BIT(KC_LCTRL)); + if (timer_elapsed(macro_timer) < 150) { + SEND_STRING("!$"); + } + } + return false; + } + return true; +} + +void matrix_scan_user(void) { + if (is_alt_tab_active) { + if (timer_elapsed(alt_tab_timer) > 1000) { + unregister_code16(KC_LALT); + is_alt_tab_active = false; + } + } +} + +#define PDVORAK MO(_PDVORAK) +#define LOWER MO(_LOWER) +#define UPPER MO(_UPPER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + /* Programmer Dvorak */ + [_PDVORAK] = LAYOUT_planck_grid( + KC_GESC, KC_SCOLON, KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_LAST, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, TD(TD_S), TD(SLASH), + TD(LSHIFT), KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, TD(RSHIFT), + TD(X_AT_FUN), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, ALT_TAB, KC_SPACE, KC_ENTER, MT(MOD_LCTL | MOD_LSFT, KC_LGUI), KC_PGUP, KC_PGDN, LT(_LOWER, KC_PLUS) + ), + + [_UPPER] = LAYOUT_planck_grid( + KC_GRAVE, KC_AMPR, KC_PERC, KC_NO, KC_NO, KC_EQL, KC_ASTR, KC_NO, KC_NO, KC_EXLM, KC_HASH, KC_TRNS, + KC_PLUS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BSLASH, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS + ), + + [_LOWER] = LAYOUT_planck_grid( + KC_DLR, KC_7, KC_5, KC_3, KC_1, KC_9, KC_0, KC_2, KC_4, KC_6, KC_8, KC_TRNS, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, CK_DOWN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS + ), + + [_FUNCTION] = LAYOUT_planck_grid( + KC_F11, KC_F7, KC_F5, KC_F3, KC_F1, KC_F9, KC_F12, KC_F2, KC_F4, KC_F6, KC_F8, RESET, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS + ), +}; + + +// Super crazy tap dancing stuff - see quad dance in feature_tap_dance.md + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return SINGLE_TAP; + // key not interrupted, but still held sends 'HOLD' + else return SINGLE_HOLD; + } + else if (state->count == 2) { + if (state->interrupted || !state->pressed) return DOUBLE_TAP; + else return DOUBLE_HOLD; + } + else if (state->count == 3) { + if (state->interrupted || !state->pressed)return TRIPLE_TAP; + else return TRIPLE_HOLD; + } + else return 8; // magic number that i dont believe works. +} + +// instance of tap for the 'X' dance. +static tap xtap_state = { + .is_press_action = true, + .state = 0 +}; + +// registering keypresses +void x_finished (qk_tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: register_code16(KC_AT); break; + case SINGLE_HOLD: set_oneshot_layer(_UPPER, ONESHOT_START); break; + case DOUBLE_TAP: set_oneshot_layer(_FUNCTION, ONESHOT_START); break; + case DOUBLE_HOLD: reset_keyboard(); break; + } +} + +void lshift_finished (qk_tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: register_code16(KC_LSFT); register_code16(KC_9); break; + case SINGLE_HOLD: register_code16(KC_LSFT); break; + case DOUBLE_TAP: register_code16(KC_LBRC); break; + case TRIPLE_TAP: register_code16(KC_LSFT); register_code16(KC_LBRC); break; + } +} +void s_finished (qk_tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: register_code16(KC_S); break; + case DOUBLE_TAP: register_code16(KC_MINUS); break; + case TRIPLE_TAP: register_code16(KC_LSFT); register_code16(KC_MINUS); break; + } +} + +void rshift_finished (qk_tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: register_code16(KC_LSFT); register_code16(KC_0); break; + case SINGLE_HOLD: register_code16(KC_RSFT); break; + case DOUBLE_TAP: register_code16(KC_RBRC); break; + case TRIPLE_TAP: register_code16(KC_LSFT); register_code16(KC_RBRC); break; + } +} + +// forgetting keypresses + +void x_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: unregister_code16(KC_AT); break; + case SINGLE_HOLD: clear_oneshot_layer_state(ONESHOT_PRESSED); break; + case DOUBLE_TAP: clear_oneshot_layer_state(ONESHOT_PRESSED); break; + case DOUBLE_HOLD: reset_keyboard(); break; + } + xtap_state.state = 0; +} +void lshift_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: unregister_code16(KC_9); unregister_code16(KC_LSFT); break; + case SINGLE_HOLD: unregister_code16(KC_LSFT); break; + case DOUBLE_TAP: unregister_code16(KC_LBRC); break; + case TRIPLE_TAP: unregister_code16(KC_LBRC); unregister_code16(KC_LSFT); break; + } + xtap_state.state = 0; +} + +void rshift_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: unregister_code16(KC_0); unregister_code16(KC_LSFT); break; + case SINGLE_HOLD: unregister_code16(KC_RSFT); break; + case DOUBLE_TAP: unregister_code16(KC_RBRC); break; + case TRIPLE_TAP: unregister_code16(KC_RBRC); unregister_code16(KC_LSFT); break; + } + xtap_state.state = 0; +} +void s_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: unregister_code16(KC_S); break; + case DOUBLE_TAP: unregister_code16(KC_MINUS); break; + case TRIPLE_TAP: unregister_code16(KC_MINUS); unregister_code16(KC_LSFT); break; + } + xtap_state.state = 0; +} +qk_tap_dance_action_t tap_dance_actions[] = { + [X_AT_FUN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset), + [LSHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lshift_finished, lshift_reset), + [RSHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rshift_finished, rshift_reset), + [TD_S] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, s_finished, s_reset), + [SLASH] = ACTION_TAP_DANCE_DOUBLE(KC_SLASH, KC_BSLASH), + +}; + +void shutdown_user(void) { clear_keyboard(); } diff --git a/keyboards/planck/keymaps/roguepullrequest/readme.md b/keyboards/planck/keymaps/roguepullrequest/readme.md new file mode 100644 index 00000000000..687a65fc932 --- /dev/null +++ b/keyboards/planck/keymaps/roguepullrequest/readme.md @@ -0,0 +1,20 @@ +# Programmer Dvorak for the Planck (Light) + + +| | | | | | | | | | | | | +|----------|---------|-------|-----|------|-------|-------|------|------|------|------|------| +| GRAVE_ESC | ; [u]; [l]7 | , [u]% [l]5 | . [l]3 | p [l]1 | y [u]= [l]9 | f [u]* [l]0 | g [l]2 | c [l]4 | r [u]! [l]6 | l [u]# [l]8 | BKSP | +| LCTRL [TD]!$ | a | o | e | u | i | d | h | t | n | s [TD]- _ | / [TD]\ | +| LSHFT [TD]( [ { | ' | q | j | k | x | b | m | w | v | z | LSHFT [TD]) ] } | +| @ [TD]UPPER FUN RESET | LEFT | DOWN | UP | RIGHT | ALT_TAB | SPACE | ENTER | LGUI | PGUP | PGDOWN | = [TD]LOWER | + +# Layout notes +- [u] = UPPER symbol +- [l] = LOWER symbol +- [TD] = Tap Dances +- ALT_TAB = cycle through windows as long as you keep tapping it keeps alt tabbing +- LAST = "!$" = is useful for using the last parm in bash/zsh +- More to come + + +# Dvorak base Layer diff --git a/keyboards/planck/keymaps/roguepullrequest/rules.mk b/keyboards/planck/keymaps/roguepullrequest/rules.mk new file mode 100644 index 00000000000..9394c96e5b7 --- /dev/null +++ b/keyboards/planck/keymaps/roguepullrequest/rules.mk @@ -0,0 +1,4 @@ +AUDIO_ENABLE = yes +COMMAND_ENABLE = no +TERMINAL_ENABLE = no +TAP_DANCE_ENABLE = yes diff --git a/keyboards/planck/keymaps/samuel/README.org b/keyboards/planck/keymaps/samuel/README.org new file mode 100644 index 00000000000..3c0f08a9d90 --- /dev/null +++ b/keyboards/planck/keymaps/samuel/README.org @@ -0,0 +1,622 @@ +#+Title: Samuel's Literate QMK Config +#+PROPERTY: header-args :tangle ~/qmk_firmware/keyboards/planck/keymaps/samuel/keymap.c + +This is my qmk firmware for my keyboard. I grew tired of organizing the keycode +array in plain text so I made it a literate .org file. I've never done this +before, so bear with me. + +* Layers + +#+BEGIN_COMMENT +#+NAME: empty-layer +| <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +| - | - | - | - | - | - | - | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +#+END_COMMENT + +This is my "pretty" org mode organized table for my main dvorak layer. If you +don't use org mode, it won't be that exciting, but if you enjoy working in org +mode, you can edit this table directly, and this file is tangled to the actual +keymap. No more organizing spaces or converting to and from comments. + +#+NAME: home-layer +|--------+--------+------+------+------+-----+-----+-----+------+-------+--------+--------| +| T_LRSE | QUOT | COMM | DOT | P | Y | F | G | C | R | L | T_RRSE | +| T_LSFT | A | O | E | U | I | D | H | T | N | S | T_RSFT | +| T_LCTL | SCLN | Q | J | K | X | B | M | W | V | Z | T_RCTL | +| T_LGUI | T_LALT | UP | DOWN | BSPC | TAB | ENT | SPC | LEFT | RIGHT | T_RALT | T_RGUI | +|--------+--------+------+------+------+-----+-----+-----+------+-------+--------+--------| + +This qwerty layout is just so normal people can try out the board. Tap keys +would need to be customized I think, more on that later. I also put another +dvorak key here because I have nightmares of getting trapped in this forsaken +layout. + +#+NAME: qwerty-layer +|--------+--------+----+------+------+-----+-----+-----+------+-------+--------+--------| +| T_LRSE | Q | W | E | R | T | Y | U | I | O | P | T_RRSE | +| T_LSFT | A | S | D | F | G | H | J | K | L | SCLN | T_RSFT | +| T_LCTL | Z | X | C | V | B | N | M | COMM | DOT | QUOT | T_RCTL | +| T_LGUI | T_LALT | UP | DOWN | BSPC | TAB | ENT | SPC | LEFT | RIGHT | T_RALT | DVORAK | +|--------+--------+----+------+------+-----+-----+-----+------+-------+--------+--------| + +I tried to keep my layout bare bones, just what would be available on a normal +keyboard, minus some keys I never used. This one secondary layer should cover a +majority of the keys not found on the home layer. The bottom left copies a normal +keyboards symbols from shifted numbers, and the rest is placed where convenient, +with some considerations for one handed use, hence the shortcuts in the top +left. + +#+NAME: secondary-layer +|--------+--------+--------+--------+--------+------+------+-----+--------+--------+-------+--------| +| -- | EZUNDO | EZCOPY | EZCUT | EZPSTE | INS | EQL | 7 | 8 | 9 | -- | -- | +| EZSHFT | ESC | CAPS | PGUP | PGDN | HOME | ASTR | 4 | 5 | 6 | 0 | EZSHFT | +| EZCTRL | EXLM | AT | HASH | DLR | PERC | CIRC | 1 | 2 | 3 | COM | EZCTRL | +| EZGUI | EZALT | EZUP | EZDOWN | SPC | AMPR | PIPE | END | EZLEFT | EZRGHT | EZALT | EZGUI | +|--------+--------+--------+--------+--------+------+------+-----+--------+--------+-------+--------| + +Basic command layer for one-shot macros and function keys. + +#+NAME: command-layer +|----+-----+-----+-----+-----+--------+--------+------+-------+------+-----+----| +| -- | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | -- | +| -- | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | -- | +| -- | F21 | F22 | F23 | F24 | QWERTY | DVORAK | USER | EMAIL | NAME | -- | -- | +| -- | -- | -- | -- | -- | -- | -- | DIR | -- | -- | -- | -- | +|----+-----+-----+-----+-----+--------+--------+------+-------+------+-----+----| + +But wait, we are missing several important keys? well, yes, but the modifier keys +all do other keys when tapped. More about that in the keymap section. + +* Keymap Conversion in Python + +This python can convert that table into the array needed for the keymap file. It +simply prepends every key with "KC_". I used to use a dictionary to convert some +keys from the table into qmk keycodes, but the double convertion was +unneccessary so I just prepended all my macros with KC and moved all the +implementation to the `process-user-input` function. + +#+NAME:layer-to-array +#+BEGIN_SRC python :var keys=secondary-layer :tangle no +results = "{" +row = 0 +while row < len(keys): + results += '{ ' + key = 0 + while key < len(keys[row]): + keyName = str(keys[row][key]) + if keyName == '--': + keyName = 'TRANSPARENT' + results += 'KC_' + keyName + if key != 11: + results += ', ' + key+=1 + results += '}' + if row != 3: + results += ',' + results += '\n' + row+=1 +results += '},\n' +return results +#+END_SRC + +* keymap.c + +Now that we laid out our layout, lets lay out our kemap file. + +#+BEGIN_SRC C :noweb yes +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#+END_SRC + +** Keycodes + +#+BEGIN_SRC C :noweb yes +// where the 'T_' communicates how the key does something different when tapped. +enum planck_keycodes { +//DVORAK = SAFE_RANGE, +KC_T_LALT = SAFE_RANGE, +KC_T_RALT, +KC_T_LGUI, +KC_T_RGUI, +KC_T_LCTL, +KC_T_RCTL, +KC_T_LSFT, +KC_T_RSFT, +KC_T_LRSE, +KC_T_RRSE, +KC_EZRGHT, +KC_EZLEFT, +KC_EZUP, +KC_EZDOWN, +KC_EZUNDO, +KC_EZCOPY, +KC_EZCUT, +KC_EZPSTE, +KC_EZSHFT, +KC_EZCTRL, +KC_EZGUI, +KC_EZALT, +KC_DVORAK, +KC_QWERTY, +KC_USER, +KC_EMAIL, +KC_NAME, +KC_DIR, +KC_COM +}; + +#+END_SRC + +** Import Key table + +#+BEGIN_SRC C :noweb yes +enum planck_layers { +_DVORAK, +_QWERTY, +_RISE, +_COMMAND +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +[_DVORAK] = + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +<> + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +[_QWERTY] = + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +<> + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +[_RISE] = + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +<> + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +[_COMMAND] = + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +<> + +#+END_SRC + +#+BEGIN_SRC C :noweb yes +}; + +#+END_SRC + +** Tap Keys + +I don't like tap keys coming out on release. When modified, I often let go of +the modifier too early because the tap button doesn't come out untill release. I +guess you could save the state of the board on press and then apply it after the +timer, but what I really want is the keys to come out on press when they can and +when it is most useful. For me, that is when they are modified a single time. So +I kind "locked" the board into only doing single modifiers, making them faster. +Disadvantages are double modified keys must be done with one shot keys (its +actually not that bad, it feels like emacs!) and triple modified keys are +impossible at the moment. + +#+BEGIN_SRC C :noweb yes + +static uint16_t tap_timer = 0; +char last_mod = 10; + +void mod_press(uint16_t tap_code, uint16_t hold_code, int id) { + // this first if body makes double modified keys impossible, but stops the + // delay when modifying a tap key which would result in the tap key not + // getting modified. + if (last_mod != id && last_mod != 10) { + tap_code16(tap_code); + last_mod = 10; + } else { + tap_timer = timer_read(); + last_mod = id; + register_code(hold_code); + } +} + +void mod_lift(uint16_t tap_code, uint16_t hold_code, int id) { + unregister_code(hold_code); + if (last_mod == id && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(tap_code); + last_mod = 10; + } +} + +#+END_SRC + +** Process User Input + +#+BEGIN_SRC C :noweb yes +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { +#+END_SRC + +** Layouts + +Set Dvorak layout + +#+BEGIN_SRC C :noweb yes +case KC_DVORAK: +if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); +} +return true; +break; + +#+END_SRC + +Set Qwerty layout. + +#+BEGIN_SRC C :noweb yes +case KC_QWERTY: +if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); +} +return true; +break; + +#+END_SRC + +** Alt and () + +Left and right alt are ( and ) when tapped. I put them on alt instead of a more +conveniant key like control because parentheses do not need to be shift modified +ever, unlike some other tap keys seen in the next sections. + +#+BEGIN_SRC C :noweb yes +case KC_T_LALT: +if (record->event.pressed) { + mod_press(S(KC_9), KC_LALT, 0); +} else { + mod_lift(S(KC_9), KC_LALT, 0); +} +return false; +break; +case KC_T_RALT: +if (record->event.pressed) { + mod_press(S(KC_0), KC_RALT, 1); +} else { + mod_lift(S(KC_0), KC_RALT, 1); +} +return false; +break; + +#+END_SRC + +** Gui and `\ + +I place gui in the bottom corner because I believe it is the hardest key to +reach, so gui seemed like a good fit for a dedicated key that I never want to +have to spam. For tap keys, I used equally unused keys that are not apart of the +number pad or shifted number keys. + +#+BEGIN_SRC C :noweb yes +case KC_T_LGUI: +if (record->event.pressed) { + mod_press(KC_GRAVE, KC_LGUI, 2); +} else { + mod_lift(KC_GRAVE, KC_LGUI, 2); +} +return false; +break; +case KC_T_RGUI: +if (record->event.pressed) { + mod_press(KC_BSLASH, KC_RGUI, 3); +} else { + mod_lift(KC_BSLASH, KC_RGUI, 3); +} +return false; +break; + +#+END_SRC + +** Ctrl and [] + +Left and right control are [] respectively when they are tapped, making { and } +also very convenient. + +#+BEGIN_SRC C :noweb yes +case KC_T_LCTL: +if (record->event.pressed) { + mod_press(KC_LBRACKET, KC_LCTL, 4); +} else { + mod_lift(KC_LBRACKET, KC_LCTL, 4); +} +return false; +break; +case KC_T_RCTL: +if (record->event.pressed) { + mod_press(KC_RBRACKET, KC_RCTL, 5); +} else { + mod_lift(KC_RBRACKET, KC_RCTL, 5); +} +return false; +break; + +#+END_SRC + +** Shft and =- + +I place shift on the home row, so having '-' right of my pinkie is standard, and +it only felt natural to put its opposite, '=/+' on the other side. I put an +extra one on the right side in the secondary layer for the num pad. + +#+BEGIN_SRC C :noweb yes +case KC_T_LSFT: +if (record->event.pressed) { + mod_press(KC_EQUAL, KC_LSFT, 6); +} else { + mod_lift(KC_EQUAL, KC_LSFT, 6); +} +return false; +break; +case KC_T_RSFT: +if (record->event.pressed) { + mod_press(KC_MINUS, KC_RSFT, 7); +} else { + mod_lift(KC_MINUS, KC_RSFT, 7); +} +return false; +break; + +#+END_SRC + +** Rise, DEL, and / + +I use the top corners as rise because I decided that I do not like using layers +with my thumbs. It feels uncomfortable to hold keys down with the side of my +thumb, and backspace, tab, enter, and spacebar keep them satisfied. My pinky is +for holding modifiers, so it makes sense to put the layer key with the other +modifiers. Both my left and right layer keys activate the same layer which also +makes sense to me. You wouldn't want left and right shift to do different things + +I used to have escape in the top left, but I use delete a lot more, and putting +escape under a layer has not been a problem at all. I put / in the top right +corner again mimicing a standard dvorak keyboard. + +#+BEGIN_SRC C :noweb yes +case KC_T_LRSE: +if (record->event.pressed) { + tap_timer = timer_read(); + last_mod = 8; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 8 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_DELETE); + last_mod = 10; + } +} +return false; +break; +case KC_T_RRSE: +if (record->event.pressed) { + tap_timer = timer_read(); + last_mod = 9; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 9 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_SLASH); + last_mod = 10; + } +} +return false; +break; + +#+END_SRC + +** EZ Keys + +EZ or "easy" keys do things that can already be done on the board, but I want an +easier way of doing them. + +*** One Shot Keys + +Since I made modified tap keys occur on press instead of release, I need one +shot keys to press any key with more than one modifier. + +#+BEGIN_SRC C :noweb yes +case KC_EZSHFT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LSFT); + last_mod = 10; +} +return false; +break; +case KC_EZCTRL: +if (record->event.pressed) { + set_oneshot_mods(MOD_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZALT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LALT); + last_mod = 10; +} +return false; +break; +case KC_EZGUI: +if (record->event.pressed) { + set_oneshot_mods(MOD_LGUI); + last_mod = 10; +} +return false; +break; + +#+END_SRC + +*** Arrows + +I use ctrl+shift+arrows keys a lot, so when the layer key is pressed they became +lazy versions of themselves with control and shift already pressed. + +I also added undo, copy, paste, and cut to be easily available with only the +left hand like on a qwerty or colemek keyboard. + +#+BEGIN_SRC C :noweb yes +case KC_EZRGHT: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_RGHT)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZLEFT: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_LEFT)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZDOWN: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_DOWN)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZUP: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_UP)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +#+END_SRC + +*** Undo, Copy, Cut, Paste + +#+BEGIN_SRC C :noweb yes +case KC_EZUNDO: +if (record->event.pressed) { + tap_code16(C(KC_Z)); + last_mod = 10; +} +return false; +break; +case KC_EZCOPY: +if (record->event.pressed) { + tap_code16(C(KC_C)); + last_mod = 10; +} +return false; +break; +case KC_EZCUT: +if (record->event.pressed) { + tap_code16(C(KC_X)); + last_mod = 10; +} +return false; +break; +case KC_EZPSTE: +if (record->event.pressed) { + tap_code16(C(KC_V)); + last_mod = 10; +} +return false; +break; +#+END_SRC + +** Commands + +Start command layer one shot + +#+BEGIN_SRC C :noweb yes +case KC_COM: +if (record->event.pressed) { + layer_on(_COMMAND); + set_oneshot_layer(_COMMAND, ONESHOT_START); + last_mod = 10; +} else { + clear_oneshot_layer_state (ONESHOT_PRESSED); +} +return false; +break; +#+END_SRC + +Just some strings I notice that I type a lot. + +#+BEGIN_SRC C :noweb yes +case KC_USER: +if (record->event.pressed) { + send_string("mhostley"); + last_mod = 10; +} +return true; +break; +case KC_EMAIL: +if (record->event.pressed) { + send_string("mhostley@gmail.com"); + last_mod = 10; +} +return true; +break; +case KC_NAME: +if (record->event.pressed) { + send_string("Samuel Jahnke"); + last_mod = 10; +} +return true; +break; +case KC_DIR: +if (record->event.pressed) { + send_string("home/mhostley/"); + last_mod = 10; +} +return true; +break; + +#+END_SRC + +** Standard inputs interupt tap + +Finally, if just a standard key is tapped, set the interupted flag. +Keep this last. + +#+BEGIN_SRC C :noweb yes +} +last_mod = 10; +return true; +} +#+END_SRC diff --git a/keyboards/planck/keymaps/samuel/config.h b/keyboards/planck/keymaps/samuel/config.h new file mode 100644 index 00000000000..95bfdd36fef --- /dev/null +++ b/keyboards/planck/keymaps/samuel/config.h @@ -0,0 +1 @@ +#define TAPPING_TERM 250 diff --git a/keyboards/planck/keymaps/samuel/keymap.c b/keyboards/planck/keymaps/samuel/keymap.c new file mode 100644 index 00000000000..ff1424489fc --- /dev/null +++ b/keyboards/planck/keymaps/samuel/keymap.c @@ -0,0 +1,359 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// where the 'T_' communicates how the key does something different when tapped. +enum planck_keycodes { +//DVORAK = SAFE_RANGE, +KC_T_LALT = SAFE_RANGE, +KC_T_RALT, +KC_T_LGUI, +KC_T_RGUI, +KC_T_LCTL, +KC_T_RCTL, +KC_T_LSFT, +KC_T_RSFT, +KC_T_LRSE, +KC_T_RRSE, +KC_EZRGHT, +KC_EZLEFT, +KC_EZUP, +KC_EZDOWN, +KC_EZUNDO, +KC_EZCOPY, +KC_EZCUT, +KC_EZPSTE, +KC_EZSHFT, +KC_EZCTRL, +KC_EZGUI, +KC_EZALT, +KC_DVORAK, +KC_QWERTY, +KC_USER, +KC_EMAIL, +KC_NAME, +KC_DIR, +KC_COM +}; + +enum planck_layers { +_DVORAK, +_QWERTY, +_RISE, +_COMMAND +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_DVORAK] = + +{{ KC_T_LRSE, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_T_RRSE}, +{ KC_T_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_T_RSFT}, +{ KC_T_LCTL, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_T_RCTL}, +{ KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_BSPC, KC_TAB, KC_ENT, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_T_RGUI} +}, + +[_QWERTY] = + +{{ KC_T_LRSE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_T_RRSE}, +{ KC_T_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_T_RSFT}, +{ KC_T_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, KC_T_RCTL}, +{ KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_BSPC, KC_TAB, KC_ENT, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_DVORAK} +}, + +[_RISE] = + +{{ KC_TRANSPARENT, KC_EZUNDO, KC_EZCOPY, KC_EZCUT, KC_EZPSTE, KC_INS, KC_EQL, KC_7, KC_8, KC_9, KC_TRANSPARENT, KC_TRANSPARENT}, +{ KC_EZSHFT, KC_ESC, KC_CAPS, KC_PGUP, KC_PGDN, KC_HOME, KC_ASTR, KC_4, KC_5, KC_6, KC_0, KC_EZSHFT}, +{ KC_EZCTRL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_1, KC_2, KC_3, KC_COM, KC_EZCTRL}, +{ KC_EZGUI, KC_EZALT, KC_EZUP, KC_EZDOWN, KC_SPC, KC_AMPR, KC_PIPE, KC_END, KC_EZLEFT, KC_EZRGHT, KC_EZALT, KC_EZGUI} +}, + +[_COMMAND] = + +{{ KC_TRANSPARENT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRANSPARENT}, +{ KC_TRANSPARENT, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRANSPARENT}, +{ KC_TRANSPARENT, KC_F21, KC_F22, KC_F23, KC_F24, KC_QWERTY, KC_DVORAK, KC_USER, KC_EMAIL, KC_NAME, KC_TRANSPARENT, KC_TRANSPARENT}, +{ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_DIR, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT} +}, + +}; + +static uint16_t tap_timer = 0; +char last_mod = 10; + +void mod_press(uint16_t tap_code, uint16_t hold_code, int id) { + // this first if body makes double modified keys impossible, but stops the + // delay when modifying a tap key which would result in the tap key not + // getting modified. + if (last_mod != id && last_mod != 10) { + tap_code16(tap_code); + last_mod = 10; + } else { + tap_timer = timer_read(); + last_mod = id; + register_code(hold_code); + } +} + +void mod_lift(uint16_t tap_code, uint16_t hold_code, int id) { + unregister_code(hold_code); + if (last_mod == id && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(tap_code); + last_mod = 10; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + +case KC_DVORAK: +if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); +} +return true; +break; + +case KC_QWERTY: +if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); +} +return true; +break; + +case KC_T_LALT: +if (record->event.pressed) { + mod_press(S(KC_9), KC_LALT, 0); +} else { + mod_lift(S(KC_9), KC_LALT, 0); +} +return false; +break; +case KC_T_RALT: +if (record->event.pressed) { + mod_press(S(KC_0), KC_RALT, 1); +} else { + mod_lift(S(KC_0), KC_RALT, 1); +} +return false; +break; + +case KC_T_LGUI: +if (record->event.pressed) { + mod_press(KC_GRAVE, KC_LGUI, 2); +} else { + mod_lift(KC_GRAVE, KC_LGUI, 2); +} +return false; +break; +case KC_T_RGUI: +if (record->event.pressed) { + mod_press(KC_BSLASH, KC_RGUI, 3); +} else { + mod_lift(KC_BSLASH, KC_RGUI, 3); +} +return false; +break; + +case KC_T_LCTL: +if (record->event.pressed) { + mod_press(KC_LBRACKET, KC_LCTL, 4); +} else { + mod_lift(KC_LBRACKET, KC_LCTL, 4); +} +return false; +break; +case KC_T_RCTL: +if (record->event.pressed) { + mod_press(KC_RBRACKET, KC_RCTL, 5); +} else { + mod_lift(KC_RBRACKET, KC_RCTL, 5); +} +return false; +break; + +case KC_T_LSFT: +if (record->event.pressed) { + mod_press(KC_EQUAL, KC_LSFT, 6); +} else { + mod_lift(KC_EQUAL, KC_LSFT, 6); +} +return false; +break; +case KC_T_RSFT: +if (record->event.pressed) { + mod_press(KC_MINUS, KC_RSFT, 7); +} else { + mod_lift(KC_MINUS, KC_RSFT, 7); +} +return false; +break; + +case KC_T_LRSE: +if (record->event.pressed) { + tap_timer = timer_read(); + last_mod = 8; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 8 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_DELETE); + last_mod = 10; + } +} +return false; +break; +case KC_T_RRSE: +if (record->event.pressed) { + tap_timer = timer_read(); + last_mod = 9; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 9 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_SLASH); + last_mod = 10; + } +} +return false; +break; + +case KC_EZSHFT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LSFT); + last_mod = 10; +} +return false; +break; +case KC_EZCTRL: +if (record->event.pressed) { + set_oneshot_mods(MOD_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZALT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LALT); + last_mod = 10; +} +return false; +break; +case KC_EZGUI: +if (record->event.pressed) { + set_oneshot_mods(MOD_LGUI); + last_mod = 10; +} +return false; +break; + +case KC_EZRGHT: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_RGHT)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZLEFT: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_LEFT)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZDOWN: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_DOWN)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZUP: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_UP)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; + +case KC_EZUNDO: +if (record->event.pressed) { + tap_code16(C(KC_Z)); + last_mod = 10; +} +return false; +break; +case KC_EZCOPY: +if (record->event.pressed) { + tap_code16(C(KC_C)); + last_mod = 10; +} +return false; +break; +case KC_EZCUT: +if (record->event.pressed) { + tap_code16(C(KC_X)); + last_mod = 10; +} +return false; +break; +case KC_EZPSTE: +if (record->event.pressed) { + tap_code16(C(KC_V)); + last_mod = 10; +} +return false; +break; + +case KC_COM: +if (record->event.pressed) { + layer_on(_COMMAND); + set_oneshot_layer(_COMMAND, ONESHOT_START); + last_mod = 10; +} else { + clear_oneshot_layer_state (ONESHOT_PRESSED); +} +return false; +break; + +case KC_USER: +if (record->event.pressed) { + send_string("mhostley"); + last_mod = 10; +} +return true; +break; +case KC_EMAIL: +if (record->event.pressed) { + send_string("mhostley@gmail.com"); + last_mod = 10; +} +return true; +break; +case KC_NAME: +if (record->event.pressed) { + send_string("Samuel Jahnke"); + last_mod = 10; +} +return true; +break; +case KC_DIR: +if (record->event.pressed) { + send_string("home/mhostley/"); + last_mod = 10; +} +return true; +break; + +} +last_mod = 10; +return true; +} diff --git a/keyboards/planck/keymaps/sascha/keymap.c b/keyboards/planck/keymaps/sascha/keymap.c index 93787599c8e..684b61f3668 100644 --- a/keyboards/planck/keymaps/sascha/keymap.c +++ b/keyboards/planck/keymaps/sascha/keymap.c @@ -26,13 +26,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ * │ SINS │ ♥ │ ≈ │ ✓ │ ✗ │ ← │ → │ € │ ß │ Ü │ Ö │ Ä │ * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ - * │ Powr │ Rset │ BLSt │ Home │ End │ PgUp │ PgDn │ Left │ Down │ Up │ Rght │ │ + * │ Rset │ BLSt │ F1 │ Home │ End │ PgUp │ PgDn │ Left │ Down │ Up │ Rght │ │ * └──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘ */ KC_TILD , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL, KC_GRV , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , UC(L'ü') , UC(L'ö') , UC(L'ä'), S(KC_INS) , UC(L'♥') , UC(L'≈') , UC(L'✓') , UC(L'✗') , UC(L'←') , UC(L'→') , UC(L'€') , UC(L'ß') , UC(L'Ü') , UC(L'Ö') , UC(L'Ä'), - KC_PWR , RESET , BL_STEP , KC_HOME , KC_END , KC_PGUP , KC_PGDN , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_TRNS + RESET , BL_STEP , KC_F1 , KC_HOME , KC_END , KC_PGUP , KC_PGDN , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_TRNS ) }; diff --git a/keyboards/planck/keymaps/sascha/rules.mk b/keyboards/planck/keymaps/sascha/rules.mk index d3918164df0..276b71daa8b 100644 --- a/keyboards/planck/keymaps/sascha/rules.mk +++ b/keyboards/planck/keymaps/sascha/rules.mk @@ -1,5 +1,14 @@ AUTO_SHIFT_ENABLE = yes AUTO_SHIFT_MODIFIERS = yes +UNICODE_ENABLE = yes + +ifeq ($(strip $(KEYBOARD)), planck/rev5) BACKLIGHT_ENABLE = yes +CONSOLE_ENABLE = no +endif +ifeq ($(strip $(KEYBOARD)), planck/rev6) +BACKLIGHT_ENABLE = no +CONSOLE_ENABLE = yes +EXTRALDFLAGS = -Wl,--build-id=none UNICODE_ENABLE = yes -DEFAULT_FOLDER = planck/rev5 +endif diff --git a/keyboards/planck/keymaps/sdothum/keymap.c b/keyboards/planck/keymaps/sdothum/keymap.c index 1b8a7b717b7..59a4a25e32a 100644 --- a/keyboards/planck/keymaps/sdothum/keymap.c +++ b/keyboards/planck/keymaps/sdothum/keymap.c @@ -186,9 +186,7 @@ enum planck_keycodes { // keycodes #define ___x___ KC_TRNS #define ___fn__ KC_TRNS -#ifdef _______ -#undef _______ -#endif +#undef _______ #define _______ KC_NO #define COPY LCTL(KC_C) diff --git a/keyboards/planck/keymaps/sdothum/rules.mk b/keyboards/planck/keymaps/sdothum/rules.mk index 40f153844c1..a722766296d 100644 --- a/keyboards/planck/keymaps/sdothum/rules.mk +++ b/keyboards/planck/keymaps/sdothum/rules.mk @@ -21,6 +21,3 @@ SLEEP_LED_ENABLE = no # breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # enable double tap completion of (),[],{} -ifndef QUANTUM_DIR -include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/sean/mymappings.h b/keyboards/planck/keymaps/sean/mymappings.h index cbb016e38dc..676cf018ebb 100644 --- a/keyboards/planck/keymaps/sean/mymappings.h +++ b/keyboards/planck/keymaps/sean/mymappings.h @@ -33,7 +33,3 @@ #define KC_MB5 KC_MS_BTN5 #define KC_MWUP KC_MS_WH_UP #define KC_MWDN KC_MS_WH_DOWN - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO diff --git a/keyboards/planck/keymaps/sebas/keymap.c b/keyboards/planck/keymaps/sebas/keymap.c new file mode 100644 index 00000000000..1076531f13e --- /dev/null +++ b/keyboards/planck/keymaps/sebas/keymap.c @@ -0,0 +1,90 @@ +#include QMK_KEYBOARD_H +enum planck_layers { + _DEFAULT, + _LOWER, + _RAISE, + _FN +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FN MO(_FN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Default + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | " | ; | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | FN | Lower| Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DEFAULT] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_SCLN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT , + KC_LCTL, KC_LALT, KC_LGUI, FN, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | _ | + | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | { | } | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | ? | | Vol- | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, _______, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_QUES, _______, KC_VOLD, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | - | = | | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | [ | ] | Vol- | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | Vol+ | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, _______ +), + + /* FN + * ,-----------------------------------------------------------------------------------. + * | Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | F11 | F12 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | TRNS | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FN] = LAYOUT_planck_grid( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F11, KC_F12, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +}; + diff --git a/keyboards/planck/keymaps/sebas/readme.md b/keyboards/planck/keymaps/sebas/readme.md new file mode 100644 index 00000000000..4a0ad84fb69 --- /dev/null +++ b/keyboards/planck/keymaps/sebas/readme.md @@ -0,0 +1,3 @@ + +# Sebas Planck layout +My personal layout diff --git a/keyboards/planck/keymaps/sgoodwin/keymap.c b/keyboards/planck/keymaps/sgoodwin/keymap.c index a7f9c6c1d34..f5efeef4597 100644 --- a/keyboards/planck/keymaps/sgoodwin/keymap.c +++ b/keyboards/planck/keymaps/sgoodwin/keymap.c @@ -30,10 +30,6 @@ enum planck_keycodes { BACKLIT, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Colemak diff --git a/keyboards/planck/keymaps/skank/keymap.c b/keyboards/planck/keymaps/skank/keymap.c new file mode 100644 index 00000000000..e36d84d1849 --- /dev/null +++ b/keyboards/planck/keymaps/skank/keymap.c @@ -0,0 +1,162 @@ +/* Copyright 2019 Khader Syed + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum skank_layers { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum skank_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LOWER, + RAISE, + ADJUST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | |Lower | Enter|Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_GESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_BSLS, + KC_LCTL, KC_LALT, KC_LGUI, _______, LOWER, KC_ENT, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | |Lower | Enter|Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_GESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_UP, KC_BSLS, + KC_LCTL, KC_LALT, KC_LGUI, _______, LOWER, KC_ENT, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | _ | + |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_PLUS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | _ | + | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_PLUS, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|Qwerty|Colemk| | | | | Reset| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, AU_ON, AU_OFF, QWERTY, COLEMAK, _______, _______, _______, _______, RESET, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + } + return true; +} \ No newline at end of file diff --git a/keyboards/planck/keymaps/skank/readme.md b/keyboards/planck/keymaps/skank/readme.md new file mode 100644 index 00000000000..673956aca19 --- /dev/null +++ b/keyboards/planck/keymaps/skank/readme.md @@ -0,0 +1,8 @@ +# My planck layout + +These are my changes: + +- add a colemak layout +- keep it clean +- add option to enable mouse keys +- and just enable some sound diff --git a/keyboards/planck/keymaps/skank/rules.mk b/keyboards/planck/keymaps/skank/rules.mk new file mode 100644 index 00000000000..4c65d4af1e3 --- /dev/null +++ b/keyboards/planck/keymaps/skank/rules.mk @@ -0,0 +1,2 @@ +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) + diff --git a/keyboards/planck/keymaps/skug/keymap.c b/keyboards/planck/keymaps/skug/keymap.c index 29324a09e49..86a1de767b1 100644 --- a/keyboards/planck/keymaps/skug/keymap.c +++ b/keyboards/planck/keymaps/skug/keymap.c @@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , NO_AA , UTILITY, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , NO_OSLH, NO_AE , KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , NO_MINS, KC_RSPC, - LFT_CTR, KC_LALT, KC_LGUI, NO_AT , ESC_LOW, KC_ENT , KC_SPC , BSP_RAI, _______, NO_ALGR, NO_ASTR, RGT_CTR + LFT_CTR, KC_LALT, KC_LGUI, NO_AT , ESC_LOW, KC_ENT , KC_SPC , BSP_RAI, _______, KC_ALGR, NO_ASTR, RGT_CTR ), /* Raise diff --git a/keyboards/planck/keymaps/smt/keymap.c b/keyboards/planck/keymaps/smt/keymap.c index 895a4bf0598..1426b62a687 100644 --- a/keyboards/planck/keymaps/smt/keymap.c +++ b/keyboards/planck/keymaps/smt/keymap.c @@ -28,10 +28,6 @@ enum planck_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift diff --git a/keyboards/planck/keymaps/smt/rules.mk b/keyboards/planck/keymaps/smt/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/planck/keymaps/smt/rules.mk +++ b/keyboards/planck/keymaps/smt/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/snowkuma/config.h b/keyboards/planck/keymaps/snowkuma/config.h new file mode 100644 index 00000000000..b41ead838dd --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/config.h @@ -0,0 +1,46 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +// Settings for homerow mods +#define TAPPING_TERM 250 +#define IGNORE_MOD_TAP_INTERRUPT + + +// Add the leader key feature +#define LEADER_TIMEOUT 300 diff --git a/keyboards/planck/keymaps/snowkuma/custom_keycodes.h b/keyboards/planck/keymaps/snowkuma/custom_keycodes.h new file mode 100644 index 00000000000..5e4353c049a --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/custom_keycodes.h @@ -0,0 +1,60 @@ +// These definitions are for convenience. +// It is not wise to put sensitive information here such as passwords +// as anyone with access to your keyboard will be able to use them! + +// magnet keycodes +#define M_LEFT LCA(KC_LEFT) +#define M_TOP LCA(KC_UP) +#define M_BOTT LCA(KC_DOWN) +#define M_RGHT LCA(KC_RGHT) + +#define M_TOPL LCA(KC_U) +#define M_TOPR LCA(KC_I) +#define M_BOTL LCA(KC_J) +#define M_BOTR LCA(KC_K) + +#define M_L13 LCA(KC_D) +#define M_L23 LCA(KC_E) +#define M_C13 LCA(KC_F) +#define M_R23 LCA(KC_T) +#define M_R13 LCA(KC_G) + +#define M_NEXT LCAG(KC_RGHT) +#define M_PREV LCAG(KC_LEFT) + +#define M_MAX LCA(KC_ENT) +#define M_CEN LCA(KC_C) +#define M_REST LCA(KC_BSPC) + +// Shortcuts +#define INPUT_L LCAG(KC_SPC) +#define TXT_PLS LGUI(KC_PLUS) +#define TXT_MIN LGUI(KC_MINS) +#define SC_CAPF LGUI(LSFT(KC_3)) // Capture the full screen to file +#define SC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen to file + +// Special Layer keycodes +#define ESC_NUM LT(_NUMBER, KC_ESC) +#define BSP_REG LT(_REGEX, KC_BSPC) +#define DEL_REG LT(_REGEX, KC_DEL) +#define MIN_ARR LT(_ARRANGE, KC_MINS) +#define TAB_SFT LSFT_T(KC_TAB) +#define SPC_SYM LT(_SYMBOL, KC_SPC) +#define ENT_THU LT(_THUMB, KC_ENT) +#define FUN_L MO(_FUNCTION) + +// HOMEROW SHIFT +#define T_SFT LSFT_T(KC_T) +#define N_SFT RSFT_T(KC_N) + +// Special Characters +#define GBP LALT(KC_3) +#define EURO LALT(S(KC_2)) + +// Modifier tap holds +#define Q_CTL LCTL_T(KC_Q) +#define W_ALT LALT_T(KC_W) +#define F_GUI LGUI_T(KC_F) +#define U_GUI LGUI_T(KC_U) +#define Y_ALT LALT_T(KC_Y) +#define SCL_CTL LCTL_T(KC_SCLN) diff --git a/keyboards/planck/keymaps/snowkuma/keymap.c b/keyboards/planck/keymaps/snowkuma/keymap.c new file mode 100644 index 00000000000..eee8e11701f --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/keymap.c @@ -0,0 +1,373 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* _ + * ___ _ __ ___ __ __ | | __ _ _ _ __ ___ __ _ + * / __| | '_ \ / _ \ \ \ /\ / / | |/ / | | | | | '_ ` _ \ / _` | + * \__ \ | | | | | (_) | \ V V / | < | |_| | | | | | | | | (_| | + * |___/ |_| |_| \___/ \_/\_/ |_|\_\ \__,_| |_| |_| |_| \__,_| + * + * https://github.com/snowkuma + * + * version 0.1 +*/ + +#include QMK_KEYBOARD_H +#include "muse.h" +#include "custom_keycodes.h" +#include "my_strings.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _COLEMAK = 0, + _SYMBOL, + _SFT_NAV, + _REGEX, + _NUMBER, + _ARRANGE, + _FUNCTION, + _MOUSE, + _THUMB +}; + +enum planck_keycodes { + EMAIL = SAFE_RANGE, + EMOJI, + EXT_PLV, + ITERM, + LESSON, + TYPE_FU, + VS_CODE, + VIM +}; + + +// Tap Dance Declarations +enum { + TD_RESET = 0, + TD_TILD +}; + +// Tap Dance Definitions +void safe_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >=3) { + // Reset the keyboard if you tap the key more than three times + reset_keyboard(); + reset_tap_dance(state); + } +}; void tilde_home(qk_tap_dance_state_t *state, void *user_data) { + if (state->count > 2) { + register_code(KC_LSFT); + register_code(KC_GRV); + } + else { + register_code(KC_LSFT); + register_code(KC_GRV); + if (state->count > 1) { + // Outputs ~/ if tilde tapped twice + unregister_code(KC_GRV); + unregister_code(KC_LSFT); + register_code(KC_SLSH); + } + } +} + +void tilde_reset(qk_tap_dance_state_t *state, void *user_data) +{ + if (state->count == 2) { + unregister_code(KC_SLSH); + } else { + unregister_code(KC_GRV); + unregister_code(KC_LSFT); + } +} + + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_RESET] = ACTION_TAP_DANCE_FN (safe_reset), + [TD_TILD] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, tilde_home, tilde_reset) +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* COLEMAK + * + * Base layer + * ,-----------------------------------------------------------------------------------------------------------. + * | q | w | f | p | g | | | j | l | u | y | ; | + * | CTRL | ALT | GUI | | | | | | | GUI | ALT | CTRL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | a | r | s | t | d | | | h | n | e | i | o | + * | | | | Shift | | | | | Shift | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | z | x | c | v | b | | | k | m | , | . | ' | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | Esc | BkSp | - | Tab | Space | Enter | | | + * | | | | Num | Regex | Arrange| Shift | Sym | Thumb | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + Q_CTL, W_ALT, F_GUI, KC_P, KC_G, _______, _______, KC_J, KC_L, U_GUI, Y_ALT, SCL_CTL, + KC_A, KC_R, KC_S, T_SFT, KC_D, _______, _______, KC_H, N_SFT, KC_E, KC_I, KC_O, + KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_K, KC_M, KC_COMM, KC_DOT, KC_QUOT, + _______, _______, _______, ESC_NUM, BSP_REG, MIN_ARR, TAB_SFT, SPC_SYM, ENT_THU, _______, _______, _______ +), + +/* Symbol & Cursor Nav layer + * ,-----------------------------------------------------------------------------------------------------------. + * | ! | @ | € | & | | | | | | Home | Up | End | PgUp | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ~ | < | % | > | + | | | | Left | Down | Right | PgDn | + * | 2x ~/ | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | | £ | = | - | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | _ | Del | - | | f() | | | | | + * | | | | | Mouse | | | Sym |Function| | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' + */ +[_SYMBOL] = LAYOUT_planck_grid( + KC_EXLM, KC_AT, EURO, KC_AMPR, KC_PIPE, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + TD(TD_TILD), KC_LT, KC_PERC, KC_GT, KC_PLUS, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + KC_GRV, _______, GBP, KC_EQL, KC_MINS, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_UNDS, DEL_REG, KC_MINS, _______, _______, _______, _______, _______, _______ +), + +/* Regex layer + * ,-----------------------------------------------------------------------------------------------------------. + * | | | | | | | | * | [ | ^ | ] | : | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | ? | ( | $ | ) | / | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | { | # | } | \ | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | f() | | | Space | | | | + * | | | | | Regex | | | Mouse | Enter | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' + */ +[_REGEX] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_ASTR, KC_LBRC, KC_CIRC, KC_RBRC, KC_COLN, + _______, _______, _______, _______, _______, _______, _______, KC_QUES, KC_LPRN, KC_DLR, KC_RPRN, KC_SLSH, + _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_LCBR, KC_HASH, KC_RCBR, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______ +), + +/* Number Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | : | F | E | D | G | | | * | 7 | 8 | 9 | 0 | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | # | C | B | A | + | | | . | 4 | 5 | 6 | / | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | € | x | £ | = | - | | | , | 1 | 2 | 3 | \ | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | f() | | | | | | | | | + * | | | | Number | | | | Space | Enter | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +* +*/ +[_NUMBER] = LAYOUT_planck_grid( + KC_COLN, S(KC_F), S(KC_E), S(KC_D), S(KC_G), _______, _______, KC_ASTR, KC_7, KC_8, KC_9, KC_0, + KC_HASH, S(KC_C), S(KC_B), S(KC_A), KC_PLUS, _______, _______, KC_DOT, KC_4, KC_5, KC_6, KC_SLSH, + EURO, KC_X, GBP, KC_EQL, KC_MINS, _______, _______, KC_COMM, KC_1, KC_2, KC_3, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Mouse Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | Ctrl | Alt | GUI | | | | | | | Up | | wUp | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Btn3 | Btn2 | Btn1 | Shift | | | | | Left | Down | Right | wDn | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | f() | | | f() | | | | + * | | | | | Mouse | | | Mouse | | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +*/ +[_MOUSE] = LAYOUT_planck_grid( + KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, _______, _______, _______, KC_MS_U, _______, KC_WH_U, + KC_BTN3, KC_BTN2, KC_BTN1, KC_LSFT, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Thumb Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | Reset | | SC_CAPF| SC_CAPP| | | | |Input L | | | | + * | (3x) | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | TypeFu | CMD + | | | | Caps | emoji | iterm | | + * | | | | | | | | | Lock | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | VS_Code| Vim | CMD - | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | f() | | | | + * | | | | | | | | | Thumb | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' + */ +[_THUMB] = LAYOUT_planck_grid( + TD(TD_RESET), _______, SC_CAPF, SC_CAPP, _______, _______, _______, _______, INPUT_L, _______, _______, _______, + _______, _______, _______, TYPE_FU, TXT_PLS, _______, _______, _______, KC_CAPS, EMOJI, ITERM, _______, + _______, _______, VS_CODE, VIM, TXT_MIN, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Arrange Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | | | Full | | | | | | Top L | Top | Top R | | + * | | | Screen | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | L 1/3 | L 2/3 | C 1/3 | R 2/3 | R 1/3 | | | Prev | Left | Bottom | Right | Next | + * | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Restore| | Center | | | | | | Bottom | | Bottom | | + * | | | | | | | | | Left | | Right | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | f() | | | | | | + * | | | | | | Arrange| | | | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +*/ +[_ARRANGE] = LAYOUT_planck_grid( + _______, _______, M_MAX, _______, _______, _______, _______, _______, M_TOPL, M_TOP, M_TOPR, _______, + M_L13, M_L23, M_C13, M_R23, M_R13, _______, _______, M_PREV, M_LEFT, M_BOTT, M_RGHT, M_NEXT, + M_REST, _______, M_CEN, _______, _______, _______, _______, _______, M_BOTL, _______, M_BOTR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Function Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | Ctrl | Alt | GUI | | | | | | F7 | F8 | F9 | F10 | + * | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | Shift | | | | | F4 | F5 | F6 | F11 | + * | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | F1 | F2 | F3 | F12 | + * | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | f() | f() | | | | + * | | | | | | | |Function|Function| | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +*/ +[_FUNCTION] = LAYOUT_planck_grid( + KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, _______, KC_F13, KC_F7, KC_F8, KC_F9, KC_F10, + _______, _______, _______, KC_LSFT, _______, _______, _______, KC_F14, KC_F4, KC_F5, KC_F6, KC_F11, + _______, _______, _______, _______, _______, _______, _______, KC_F15, KC_F1, KC_F2, KC_F3, KC_F12, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + state = update_tri_layer_state(state, _SYMBOL, _THUMB, _FUNCTION); + state = update_tri_layer_state(state, _SYMBOL, _REGEX, _MOUSE); + return state; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case EMAIL: + if (record->event.pressed) { + SEND_STRING(MY_EMAIL); + } + return false; + break; + case ITERM: + if (record->event.pressed) { + SEND_STRING(SS_LGUI(" ")); + SEND_STRING("iterm" SS_TAP(X_ENTER)); + } + return false; + break; + case TYPE_FU: + if (record->event.pressed) { + SEND_STRING(SS_LGUI(" ")); + SEND_STRING("type fu" SS_TAP(X_ENTER)); + } + return false; + break; + case VIM: + if (record->event.pressed) { + SEND_STRING(SS_LGUI(" ")); + SEND_STRING("macvim.app" SS_TAP(X_ENTER)); + } + return false; + break; + case VS_CODE: + if (record->event.pressed) { + SEND_STRING(SS_LGUI(" ")); + SEND_STRING("visual studio code" SS_TAP(X_ENTER)); + } + return false; + break; + case EMOJI: + if (record->event.pressed) { + register_code(KC_LGUI); + register_code(KC_LCTL); + register_code(KC_SPC); + unregister_code(KC_LGUI); + unregister_code(KC_LCTL); + unregister_code(KC_SPC); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +void matrix_init_user(void) { + set_unicode_input_mode(UC_OSX); +} diff --git a/keyboards/planck/keymaps/snowkuma/my_strings.h b/keyboards/planck/keymaps/snowkuma/my_strings.h new file mode 100644 index 00000000000..4e2ee6f770f --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/my_strings.h @@ -0,0 +1,4 @@ +// Email address +#define MY_EMAIL "myname@email.com" +// Canned responses +#define CANNED_1 "A canned response / template for emails." diff --git a/keyboards/planck/keymaps/snowkuma/readme.md b/keyboards/planck/keymaps/snowkuma/readme.md new file mode 100644 index 00000000000..b1d5ff9c925 --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/readme.md @@ -0,0 +1,14 @@ +# Snowkuma's Planck Layout v.0.1 + +Wide colemak planck layout. Heavily influenced by the ideas of sdothum and his blog. + +Aims to minimize key usage to minimal set and have hands in a comfortable position. + +![Colemak](https://i.imgur.com/4B3HdCE.png) +![Symbol](https://i.imgur.com/WYxIJqv.png) +![Regex](https://i.imgur.com/PxTCT6P.png) +![Number](https://i.imgur.com/NzhW26R.png) +![Arrange](https://i.imgur.com/BlTJjyW.png) +![Shortcuts](https://i.imgur.com/p2ooSrC.png) +![Function](https://i.imgur.com/U1F5J3R.png) +![Mouse](https://i.imgur.com/nCHabXV.png) diff --git a/keyboards/planck/keymaps/snowkuma/rules.mk b/keyboards/planck/keymaps/snowkuma/rules.mk new file mode 100644 index 00000000000..4a172d28681 --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/rules.mk @@ -0,0 +1,19 @@ +SRC += muse.c + +AUDIO_ENABLE = yes +BACKLIGHT_ENABLE = no +BLUETOOTH_ENABLE = no +BOOTMAGIC_ENABLE = no +COMBO_ENABLE = no +COMMAND_ENABLE = no +CONSOLE_ENABLE = no +EXTRAKEY_ENABLE = yes +LEADER_ENABLE = yes +MIDI_ENABLE = no +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes # nkey rollover +RGBLIGHT_ENABLE = no +SLEEP_LED_ENABLE = no +STENO_ENABLE = yes +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes diff --git a/keyboards/planck/keymaps/spacebarracecar/keymap.c b/keyboards/planck/keymaps/spacebarracecar/keymap.c index db91231bf72..71f44c996e2 100644 --- a/keyboards/planck/keymaps/spacebarracecar/keymap.c +++ b/keyboards/planck/keymaps/spacebarracecar/keymap.c @@ -6,8 +6,8 @@ enum layers { _BASE, - _LOWER, _RAISE, + _LOWER, _MUSICMODE }; @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, - KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, CTLENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL ), /* Lower @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT_ortho_4x12( DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, - _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT_ortho_4x12( CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -97,21 +97,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Navigation ,-----------------------------------------------------------------------------------------------------------------------. -|ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|ALT F4 |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|RESET | | | | | | | | | | |Game | +|RESET |ESCT | | | | | | | | | |Game | `-----------------------------------------------------------------------------------------------------------------------' */ [_NAV] = LAYOUT_ortho_4x12( - CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, + _______, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, EMOJI, KC_ENT, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, MU_ON, XXXXXXX, XXXXXXX, XXXXXXX, _______, - RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME + RESET, CU_ESCT, ALTF4, _______, _______, KC_SPC, CTLENT, _______, _______, _______, _______, CU_GAME ) }; @@ -129,6 +129,17 @@ switch (keycode) { } else { return true; } + case KC_LALT: + if (game) { + if (record->event.pressed){ + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + } else { + return true; + } case MU_ON: if(record->event.pressed) { layer_off(_LOWER); diff --git a/keyboards/planck/keymaps/steno/rules.mk b/keyboards/planck/keymaps/steno/rules.mk index 634a1c8878a..b2fd63a893d 100644 --- a/keyboards/planck/keymaps/steno/rules.mk +++ b/keyboards/planck/keymaps/steno/rules.mk @@ -1,9 +1,6 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - EXTRAKEY_ENABLE = no MOUSEKEY_ENABLE = no # Mouse keys(+4700) STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER AUDIO_ENABLE = no # Audio output on port C6 MIDI_ENABLE = no # MIDI controls + diff --git a/keyboards/planck/keymaps/tak3over/keymap.c b/keyboards/planck/keymaps/tak3over/keymap.c index f8fb0fb37d7..8b26520bf9b 100644 --- a/keyboards/planck/keymaps/tak3over/keymap.c +++ b/keyboards/planck/keymaps/tak3over/keymap.c @@ -106,10 +106,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/planck/keymaps/tehwalris/rules.mk b/keyboards/planck/keymaps/tehwalris/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/planck/keymaps/tehwalris/rules.mk +++ b/keyboards/planck/keymaps/tehwalris/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/that_canadian/keymap.c b/keyboards/planck/keymaps/that_canadian/keymap.c index 512fc6bd4a5..131bf4108a2 100644 --- a/keyboards/planck/keymaps/that_canadian/keymap.c +++ b/keyboards/planck/keymaps/that_canadian/keymap.c @@ -29,10 +29,6 @@ enum planck_keycodes { RAISE }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/keyboards/planck/keymaps/thermal_printer/keymap.c b/keyboards/planck/keymaps/thermal_printer/keymap.c index 2b05f2b08e8..e43e13cd278 100644 --- a/keyboards/planck/keymaps/thermal_printer/keymap.c +++ b/keyboards/planck/keymaps/thermal_printer/keymap.c @@ -32,10 +32,6 @@ enum planck_keycodes { EXT_PLV }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/planck/keymaps/tom/config.h b/keyboards/planck/keymaps/tom/config.h new file mode 100644 index 00000000000..6fa31cc8a76 --- /dev/null +++ b/keyboards/planck/keymaps/tom/config.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/tom/keymap.c b/keyboards/planck/keymaps/tom/keymap.c new file mode 100644 index 00000000000..e6a1411ee8b --- /dev/null +++ b/keyboards/planck/keymaps/tom/keymap.c @@ -0,0 +1,261 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + BACKLIT +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Vol- | Vol+ |Brite-|Brite+| + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUOT, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_BRMD, KC_BRMU +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Vol- | Vol+ |Brite-|Brite+| + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_BRMD, KC_BRMU +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + C(G(S(KC_4))), RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +void rgb_matrix_indicators_user(void) { + #ifdef RGB_MATRIX_ENABLE + switch (biton32(layer_state)) { + case _RAISE: + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color(i, 0x6B, 0x00, 0x80); + } else { + rgb_matrix_set_color(i, 0x00, 0xFF, 0x00); + } + } + break; + + case _LOWER: + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00); + } else { + rgb_matrix_set_color(i, 0x00, 0x67, 0xC7); + } + } + break; + + case _ADJUST: + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + rgb_matrix_set_color(i, 0xFF, 0x99, 0x00); + } + rgb_matrix_set_color(1, 0xFF, 0x00, 0x00); + break; + + default: + break; + } + #endif +} diff --git a/keyboards/planck/keymaps/tom/readme.md b/keyboards/planck/keymaps/tom/readme.md new file mode 100644 index 00000000000..8326cc13d85 --- /dev/null +++ b/keyboards/planck/keymaps/tom/readme.md @@ -0,0 +1,35 @@ +# tomholford's layout + +This layout is data-driven: I installed [WhatPulse](https://whatpulse.org/) a few months ago and generated a heatmap of the most frequently used keys. I also optimized for my most-used programming languages, and muscle memory. + +## Changes from Default + +### QWERTY + +- swap escape and tab +- rearrange arrows in original layout +- swap rshift and Enter +- map / to original location of left arrow key + +### RAISE + +- move backslash to backspace +- map quote to original location from qwerty layer +- map brightness up / down to original location of left and up arrows +- map volume up / down to original location of down and right arrows + +### LOWER + +- move pipe to backspace +- map quote to original location from qwerty layer +- map brightness up / down to original location of left and up arrows +- map volume up / down to original location of down and right arrows + +### ADJUST + +- map to esc key: screenshot region to clipboard - an alias for ctrl + cmd + shift + 4 + + +## RGB LED + +- Illuminate when pressing RAISE, LOWER, or ADJUST ([source](https://www.reddit.com/r/olkb/comments/8wvk8s/custom_rgb_configuration_by_keycodelayer/)) diff --git a/keyboards/planck/keymaps/tom/rules.mk b/keyboards/planck/keymaps/tom/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/planck/keymaps/tom/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/tong92/keymap.c b/keyboards/planck/keymaps/tong92/keymap.c index b9cd24c0115..d85bd6e8821 100644 --- a/keyboards/planck/keymaps/tong92/keymap.c +++ b/keyboards/planck/keymaps/tong92/keymap.c @@ -23,9 +23,6 @@ enum planck_keycodes { EXT_MOUSE }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define LOWER M(1) #define RAISE M(2) #define WINDOW_SHORTCUT MO(_WINDOW_SHORTCUT) diff --git a/keyboards/planck/keymaps/tong92/rules.mk b/keyboards/planck/keymaps/tong92/rules.mk index df9e7918ca3..88ad1e98285 100644 --- a/keyboards/planck/keymaps/tong92/rules.mk +++ b/keyboards/planck/keymaps/tong92/rules.mk @@ -57,6 +57,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/tylerwince/config.h b/keyboards/planck/keymaps/tylerwince/config.h new file mode 100644 index 00000000000..24adad94f3b --- /dev/null +++ b/keyboards/planck/keymaps/tylerwince/config.h @@ -0,0 +1,18 @@ +#pragma once + +#ifdef AUDIO_ENABLE +#define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +#define MIDI_BASIC + +#define ENCODER_RESOLUTION 4 + +/* + Set any config.h overrides for your specific keymap here. + See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file +*/ +#define TAPPING_FORCE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT + +#define EECONFIG_RGB_MATRIX (uint32_t *)16 diff --git a/keyboards/planck/keymaps/tylerwince/keymap.c b/keyboards/planck/keymaps/tylerwince/keymap.c new file mode 100644 index 00000000000..30412e9db51 --- /dev/null +++ b/keyboards/planck/keymaps/tylerwince/keymap.c @@ -0,0 +1,294 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +enum planck_keycodes { + RGB_SLD = SAFE_RANGE, + TOGGLE_LAYER_COLOR, +}; + +enum planck_layers { + _BASE, + _LOWER, + _RAISE, + _ADJUST, + _LAYER4, +}; + +//Tap Dance Declarations +enum { + TD_SEMI_COLON, +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SEMI_COLON] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLN), +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_planck_grid( + /* _BASE + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |CtlEsc| A | O | E | U | I | D | H | T | N | S | Bksp | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |LOWER | Shift/Space | RAISE| | | | | + * `-----------------------------------------------------------------------------------' + */ + KC_TAB, KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, + LCTL_T(KC_ESCAPE), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_BSPACE, + _______, TD(TD_SEMI_COLON), KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENTER, + _______, KC_LCTRL, KC_LALT, KC_LGUI, LOWER, LSFT_T(KC_SPACE), KC_NO, RAISE, _______, _______, _______, _______ + ), + + [_LOWER] = LAYOUT_planck_grid( + /* _LOWER + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | _ | + | { | } |Delete| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |LOWER | Shift/Space | RAISE| | [ | ] | | + * `-----------------------------------------------------------------------------------' + */ + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLASH, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_DELETE, + _______, KC_LCTRL, KC_LALT, KC_LGUI, _______, _______, KC_NO, _______, _______, KC_LBRACKET, KC_RBRACKET, _______ + ), + + [_RAISE] = LAYOUT_planck_grid( + /* _RAISE + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | |RIGHT | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | LEFT | | | |Delete| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | DOWN | UP | | | - | = | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |THINGS|1PASS | | |LOWER | Shift/Space | RAISE| | | | | + * `-----------------------------------------------------------------------------------' + */ + + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, KC_RIGHT, _______, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_LEFT, _______, _______, _______, KC_DELETE, + _______, _______, _______, KC_DOWN, KC_UP, _______, _______, KC_MINUS, KC_EQUAL, _______, _______, _______, + LALT(KC_SPACE), LGUI(KC_BSLASH), _______, _______, _______, _______, KC_NO, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT_planck_grid( + /* _LOWER + * ,-----------------------------------------------------------------------------------. + * |Reset | | | | |WIN-TL|WIN-TR| | | |WIN-R | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | |WIN-BL|WIN-BR|WIN-L | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | |WIN-B |WIN-T | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | BASE |LAYER4| | |LOWER | Shift/Space | RAISE|VOL-DN| BR-DN|BR-UP |VOL-UP| + * `-----------------------------------------------------------------------------------' + */ + + RESET, _______, _______, _______, _______, LALT(LCTL(KC_7)), LALT(LCTL(KC_8)), _______, _______, _______, LALT(LCTL(KC_L)), _______, + _______, _______, _______, _______, _______, LALT(LCTL(KC_U)), LALT(LCTL(KC_I)), LALT(LCTL(KC_H)), _______, _______, _______, _______, + _______, _______, _______, LALT(LCTL(KC_J)), LALT(LCTL(KC_K)), _______, _______, _______, _______, _______, _______, LALT(LCTL(KC_ENTER)), + TO(0), TO(4), _______, _______, _______, _______, KC_NO, _______, KC_AUDIO_VOL_DOWN, KC_F14, KC_F15, KC_AUDIO_VOL_UP + ), + + [_LAYER4] = LAYOUT_planck_grid( + /* _LOWER + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | ' | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |CtlEsc| A | S | D | F | G | H | J | K | L | ; | Bksp | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |LOWER | Shift/Space | RAISE| | | | | + * `-----------------------------------------------------------------------------------' + */ + + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOTE, + LCTL_T(KC_ESCAPE), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_BSPACE, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_ENTER, + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LSFT_T(KC_SPACE), KC_NO, RAISE, _______, _______, _______, _______ + ), + +}; + +extern bool g_suspend_state; +extern rgb_config_t rgb_matrix_config; +bool disable_layer_color = 0; + +void keyboard_post_init_user(void) { + rgb_matrix_enable(); +} + +const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { + [0] = { {32,255,234}, {32,255,234}, {12,225,241}, {12,225,241}, {0,204,255}, {0,204,255}, {169,120,255}, {169,120,255}, {169,120,255}, {146,224,255}, {146,224,255}, {146,224,255}, + {32,255,234}, {32,255,234}, {12,225,241}, {12,225,241}, {0,204,255}, {0,204,255}, {169,120,255}, {169,120,255}, {169,120,255}, {146,224,255}, {146,224,255}, {146,224,255}, + {32,255,234}, {32,255,234}, {12,225,241}, {12,225,241}, {0,204,255}, {0,204,255}, {169,120,255}, {169,120,255}, {169,120,255}, {146,224,255}, {146,224,255}, {146,224,255}, + {32,255,234}, {32,255,234}, {12,225,241}, {12,225,241}, {0,204,255}, {0,0,0}, {169,120,255}, {169,120,255}, {146,224,255}, {146,224,255}, {146,224,255} }, + + [1] = { {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, + {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, + {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, + {0,0,0}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,204,255}, {0,204,255}, {0,0,0} }, + + [2] = { {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {169,120,255}, {0,0,0}, + {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {0,0,0}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, {169,120,255}, + {0,0,0}, {0,0,0}, {0,0,0}, {169,120,255}, {169,120,255}, {0,0,0}, {0,0,0}, {169,120,255}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, + {169,120,255}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} }, + + [4] = { {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255} }, + +}; + +void set_layer_color(int layer) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + HSV hsv = { + .h = pgm_read_byte(&ledmap[layer][i][0]), + .s = pgm_read_byte(&ledmap[layer][i][1]), + .v = pgm_read_byte(&ledmap[layer][i][2]), + }; + if (!hsv.h && !hsv.s && !hsv.v) { + rgb_matrix_set_color( i, 0, 0, 0 ); + } else { + RGB rgb = hsv_to_rgb( hsv ); + rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); + } + } +} + +void rgb_matrix_indicators_user(void) { + if (g_suspend_state || disable_layer_color) { return; } + switch (biton32(layer_state)) { + case 0: + set_layer_color(0); + break; + case 1: + set_layer_color(1); + break; + case 2: + set_layer_color(2); + break; + case 4: + set_layer_color(4); + break; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGB_SLD: + if (record->event.pressed) { + rgblight_mode(1); + } + return false; + case RGB_TOG: + if (record->event.pressed) { + if (rgb_matrix_config.val) { + rgb_matrix_sethsv(rgb_matrix_config.hue, rgb_matrix_config.sat, 0); + } else { + rgb_matrix_sethsv(rgb_matrix_config.hue, rgb_matrix_config.sat, 255); + } + } + return false; + case TOGGLE_LAYER_COLOR: + if (record->event.pressed) { + disable_layer_color ^= 1; + } + return false; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} +uint32_t layer_state_set_user(uint32_t state) { + palClearPad(GPIOB, 8); + palClearPad(GPIOB, 9); + uint8_t layer = biton32(state); + switch (layer) { + case _LOWER: + palSetPad(GPIOB, 9); + break; + case _RAISE: + palSetPad(GPIOB, 8); + break; + case _ADJUST: + palSetPad(GPIOB, 9); + palSetPad(GPIOB, 8); + break; + default: + break; + } + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/tylerwince/rules.mk b/keyboards/planck/keymaps/tylerwince/rules.mk new file mode 100644 index 00000000000..a4f1a0b84f8 --- /dev/null +++ b/keyboards/planck/keymaps/tylerwince/rules.mk @@ -0,0 +1,7 @@ +SRC += muse.c +# Set any rules.mk overrides for your specific keymap here. +# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file +LINK_TIME_OPTIMIZATION_ENABLE = yes +COMMAND_ENABLE = no +MOUSEKEY_ENABLE = no +TAP_DANCE_ENABLE=yes diff --git a/keyboards/planck/keymaps/unicode/keymap.c b/keyboards/planck/keymaps/unicode/keymap.c index d869eedd4fb..bc9e5326a3e 100644 --- a/keyboards/planck/keymaps/unicode/keymap.c +++ b/keyboards/planck/keymaps/unicode/keymap.c @@ -54,11 +54,6 @@ extern keymap_config_t keymap_config; #define EXT_PLV M(13) #define TOG_OUT M(14) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -189,10 +184,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } -}; - -const uint16_t PROGMEM fn_actions[] = { - }; #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/unicode/rules.mk b/keyboards/planck/keymaps/unicode/rules.mk index 110af7501cc..70866cb8bb2 100644 --- a/keyboards/planck/keymaps/unicode/rules.mk +++ b/keyboards/planck/keymaps/unicode/rules.mk @@ -6,6 +6,3 @@ # UNICODE_ENABLE = yes # Unicode -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/vaire/rules.mk b/keyboards/planck/keymaps/vaire/rules.mk index 22e4bd93415..f9dfeb72637 100644 --- a/keyboards/planck/keymaps/vaire/rules.mk +++ b/keyboards/planck/keymaps/vaire/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/planck/keymaps/vifon/rules.mk b/keyboards/planck/keymaps/vifon/rules.mk index 5caec1afa8f..527e63d3821 100644 --- a/keyboards/planck/keymaps/vifon/rules.mk +++ b/keyboards/planck/keymaps/vifon/rules.mk @@ -22,6 +22,3 @@ KEY_LOCK_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/vxid/config.h b/keyboards/planck/keymaps/vxid/config.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/keyboards/planck/keymaps/vxid/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/planck/keymaps/vxid/keymap.c b/keyboards/planck/keymaps/vxid/keymap.c new file mode 100644 index 00000000000..51d1daa70a0 --- /dev/null +++ b/keyboards/planck/keymaps/vxid/keymap.c @@ -0,0 +1,49 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, + KC_LCTL, KC_LGUI, KC_LALT, LOWER, RAISE, KC_MINS, KC_SPC, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, KC_GRV +), + +[_LOWER] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_RAISE] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_ADJUST] = LAYOUT_planck_grid( + RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/vxid/readme.md b/keyboards/planck/keymaps/vxid/readme.md new file mode 100644 index 00000000000..9e0ae33423b --- /dev/null +++ b/keyboards/planck/keymaps/vxid/readme.md @@ -0,0 +1,13 @@ +# vxid planck layout + +## Layout + +This planck layout aims at proviging most symbols on the base layer while remaining usable. +The minus and space keys become alt and gui modifiers when pressed. +Arrow keys are located on hjkl on the lower layer. + +## Building + +``` + make planck/rev6:vxid:dfu-util +``` diff --git a/keyboards/planck/keymaps/yale/keymap.c b/keyboards/planck/keymaps/yale/keymap.c index bbecc66fbce..f6ece4d1e78 100644 --- a/keyboards/planck/keymaps/yale/keymap.c +++ b/keyboards/planck/keymaps/yale/keymap.c @@ -15,10 +15,6 @@ #define _FUNC 6 #define _NAV 7 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* _QWERTY @@ -84,10 +80,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/planck/keymaps/yale/rules.mk b/keyboards/planck/keymaps/yale/rules.mk index caff043c582..5dda6ad67ba 100644 --- a/keyboards/planck/keymaps/yale/rules.mk +++ b/keyboards/planck/keymaps/yale/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/yang/keymap.c b/keyboards/planck/keymaps/yang/keymap.c index e4a7a3312dc..477eb503122 100644 --- a/keyboards/planck/keymaps/yang/keymap.c +++ b/keyboards/planck/keymaps/yang/keymap.c @@ -56,10 +56,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; -/*enum function_id { - -};*/ - const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_TAP_KEY(_RGB, KC_SPC), }; @@ -81,9 +77,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - - } -} diff --git a/keyboards/planck/keymaps/yang/rules.mk b/keyboards/planck/keymaps/yang/rules.mk index 173fe29893b..05f0fb04aa3 100644 --- a/keyboards/planck/keymaps/yang/rules.mk +++ b/keyboards/planck/keymaps/yang/rules.mk @@ -5,6 +5,3 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. AUDIO_ENABLE = no -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/yttyx/config.h b/keyboards/planck/keymaps/yttyx/config.h new file mode 100644 index 00000000000..88d0c07e93b --- /dev/null +++ b/keyboards/planck/keymaps/yttyx/config.h @@ -0,0 +1,5 @@ +#pragma once +#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +#define TAPPING_TOGGLE 2 diff --git a/keyboards/planck/keymaps/yttyx/keymap.c b/keyboards/planck/keymaps/yttyx/keymap.c new file mode 100644 index 00000000000..0fcbae89237 --- /dev/null +++ b/keyboards/planck/keymaps/yttyx/keymap.c @@ -0,0 +1,146 @@ + +#include QMK_KEYBOARD_H +#include + +enum planck_layers { + _BA, // Base (Balance Twelve mirror variant) + _PL, // Plover (http://opensteno.org) + _NP, // Numeric/punctuation + _FC // Function/cursor +}; + +enum planck_keycodes { + BA = SAFE_RANGE, + PL +}; + + +// Abbreviations +#define KX_SFT_Z MT(MOD_LSFT, KC_Z) +#define KX_SFT_X MT(MOD_RSFT, KC_X) +#define LT_ESC_FC LT(_FC, KC_ESC) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* BA + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | P | L | C | D | W | | | U | O | Y | K | Q | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | N | R | S | T | M | | BS | A | E | I | H | V | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Z Sft | J | F | G | B | | Ent | ' @ | , < | . > | X Sft | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ctl | Alt | Sup | NP | Spc | Esc/FC | Sft | Sft | Sup | Alt | Ctl | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + */ + [_BA] = LAYOUT_planck_grid( + KC_P, KC_L, KC_C, KC_D, KC_W, XXXXXXX, XXXXXXX, KC_U, KC_O, KC_Y, KC_K, KC_Q, + KC_N, KC_R, KC_S, KC_T, KC_M, XXXXXXX, KC_BSPC, KC_A, KC_E, KC_I, KC_H, KC_V, + KX_SFT_Z, KC_J, KC_F, KC_G, KC_B, XXXXXXX, KC_ENT, KC_QUOT, KC_COMM, KC_DOT, KX_SFT_X, XXXXXXX, + KC_LCTL, KC_LALT, KC_LGUI, MO(_NP), KC_SPC, LT_ESC_FC, KC_LSFT, KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, XXXXXXX + ), + + /* Plover + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | # | # | # | # | # | BA | # | # | # | # | # | # | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | S | T | P | H | * | | * | F | P | L | T | D | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | S | K | W | R | * | | * | R | B | G | S | Z | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | A | O | | E | U | | | | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + */ + [_PL] = LAYOUT_planck_grid( + STN_NUM, STN_NUM, STN_NUM, STN_NUM, STN_NUM, BA, STN_NUM, STN_NUM, STN_NUM, STN_NUM, STN_NUM, STN_NUM, + STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, XXXXXXX, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, XXXXXXX, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + XXXXXXX, XXXXXXX, XXXXXXX, STN_A, STN_O, XXXXXXX, STN_E, STN_U, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* Numeric/punctuation + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | 1 ! | 2 " | 3 | 4 $ | 5 % | PL | | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | BS | [ { | ] } | - _ | ; : | \ | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Sft | | | Del | Ins | | | / ? | = + | # ~ | ` | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ctl | Alt | Sup | NP | Spc | | Sft | Sft | Sup | Alt | Ctl | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + */ + [_NP] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, PL, XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_TAB, C(KC_X), C(KC_C), C(KC_V), C(KC_Z), XXXXXXX, _______, KC_LBRC, KC_RBRC, KC_MINS, KC_SCLN, KC_NUBS, + KC_LSFT, XXXXXXX, XXXXXXX, KC_DEL, KC_INS, XXXXXXX, XXXXXXX, KC_SLSH, KC_EQL, KC_NUHS, KC_GRV, XXXXXXX, + _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, XXXXXXX + ), + + /* Function/cursor + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | F1 | F2 | F3 | F4 | F5 | | | Home | Up | End | PgUp | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | F6 | F7 | F8 | F9 | F10 | | | Left | Down | Right | PgDn | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Sft | | | F11 | F12 | | | PScr | Break | ScLk | Caps | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ctl | Alt | Sup | | Spc | | Sft | Sft | Sup | Alt | Ctl | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + */ + [_FC] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, + _______, XXXXXXX, XXXXXXX, KC_F11, KC_F12, XXXXXXX, XXXXXXX, KC_PSCR, KC_BRK, KC_SLCK, KC_CAPS, XXXXXXX, + _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, XXXXXXX + ) + +}; + + +#ifdef AUDIO_ENABLE + float plover_on[][2] = SONG(PLOVER_SOUND); + float plover_off[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case PL: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_on); + #endif + + layer_off(_NP); + layer_off(_FC); + layer_on(_PL); + + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + case BA: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_off); + #endif + + layer_off(_NP); + layer_off(_PL); + layer_off(_FC); + } + return false; + } + return true; +} + +void matrix_init_user() { + steno_set_mode(STENO_MODE_GEMINI); +} + diff --git a/keyboards/planck/keymaps/yttyx/readme.md b/keyboards/planck/keymaps/yttyx/readme.md new file mode 100644 index 00000000000..6661c317046 --- /dev/null +++ b/keyboards/planck/keymaps/yttyx/readme.md @@ -0,0 +1,68 @@ +# Overview + +* Base layer uses the Balance Twelve layout ([reference](https://mathematicalmulticore.wordpress.com/the-keyboard-layout-project/)) +* Plover layer uses the same home position as the base layer ([reference](http://www.openstenoproject.org/)) + +## To build + +``` +make planck/rev6:yttyx +``` + +## To build and flash + +``` +make planck/rev6:yttyx:dfu-util +``` + +## Layers + +### Base + + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | P | L | C | D | W | | | U | O | Y | K | Q | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | N | R | S | T | M | | BS | A | E | I | H | V | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Z Sft | J | F | G | B | | Ent | ' @ | , < | . > | X Sft | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ctl | Alt | Sup | NP | Spc | Esc/FC | Sft | Sft | Sup | Alt | Ctl | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + +### Plover + + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | # | # | # | # | # | BA | # | # | # | # | # | # | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | S | T | P | H | * | | * | F | P | L | T | D | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | S | K | W | R | * | | * | R | B | G | S | Z | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | A | O | | E | U | | | | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + +### Numeric/Punctuation + + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | 1 ! | 2 " | 3 £ | 4 $ | 5 % | PL | | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | BS | [ { | ] } | - _ | ; : | \ | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Sft | | | Del | Ins | | | / ? | = + | # ~ | ` | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ctl | Alt | Sup | NP | Spc | | Sft | Sft | Sup | Alt | Ctl | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + +### Function + + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | F1 | F2 | F3 | F4 | F5 | | | Home | Up | End | PgUp | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | F6 | F7 | F8 | F9 | F10 | | | Left | Down | Right | PgDn | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Sft | | | F11 | F12 | | | PScr | Break | ScLk | Caps | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ctl | Alt | Sup | | Spc | | Sft | Sft | Sup | Alt | Ctl | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + + diff --git a/keyboards/planck/keymaps/yttyx/rules.mk b/keyboards/planck/keymaps/yttyx/rules.mk new file mode 100644 index 00000000000..27dac6d4da7 --- /dev/null +++ b/keyboards/planck/keymaps/yttyx/rules.mk @@ -0,0 +1,11 @@ +# Build Options +AUDIO_ENABLE = yes +CONSOLE_ENABLE = no +EXTRAKEY_ENABLE = no +MIDI_ENABLE = no +MOUSEKEY_ENABLE = no +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = no +STENO_ENABLE = yes +VIRTSER_ENABLE = yes + diff --git a/keyboards/planck/keymaps/zach/config.h b/keyboards/planck/keymaps/zach/config.h index dc79bad064e..35b28da2369 100644 --- a/keyboards/planck/keymaps/zach/config.h +++ b/keyboards/planck/keymaps/zach/config.h @@ -33,11 +33,6 @@ //#define LOCKING_RESYNC_ENABLE #undef LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/planck/keymaps/zach/rules.mk b/keyboards/planck/keymaps/zach/rules.mk index ca24b47929a..b3dfb88d74e 100644 --- a/keyboards/planck/keymaps/zach/rules.mk +++ b/keyboards/planck/keymaps/zach/rules.mk @@ -24,6 +24,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/keymaps/zach/zach_common_functions.c b/keyboards/planck/keymaps/zach/zach_common_functions.c index e6aeaa50a31..5de64de955d 100644 --- a/keyboards/planck/keymaps/zach/zach_common_functions.c +++ b/keyboards/planck/keymaps/zach/zach_common_functions.c @@ -5,9 +5,7 @@ #include "keymap_colemak.h" extern keymap_config_t keymap_config; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#undef C #define C(n) RCTL(n) #define CADKEY RCTL(RALT(KC_DEL)) diff --git a/keyboards/planck/keymaps/zrichard/keymap.c b/keyboards/planck/keymaps/zrichard/keymap.c index 151ec877b2b..a792560bd4e 100755 --- a/keyboards/planck/keymaps/zrichard/keymap.c +++ b/keyboards/planck/keymaps/zrichard/keymap.c @@ -113,8 +113,6 @@ enum { #define TG_NKRO MAGIC_TOGGLE_NKRO #define OS_SHFT KC_FN0 -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define ________________ _______, _______ #define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX diff --git a/keyboards/planck/keymaps/zrichard/rules.mk b/keyboards/planck/keymaps/zrichard/rules.mk index 7b17f58ce13..0475875a3b3 100755 --- a/keyboards/planck/keymaps/zrichard/rules.mk +++ b/keyboards/planck/keymaps/zrichard/rules.mk @@ -25,6 +25,3 @@ TAP_DANCE_ENABLE = no # Enable double or n tap macros # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/planck/light/config.h b/keyboards/planck/light/config.h index 17c015ed0fd..c7bc9cb1a38 100644 --- a/keyboards/planck/light/config.h +++ b/keyboards/planck/light/config.h @@ -39,7 +39,7 @@ #define DRIVER_COUNT 2 #define DRIVER_1_LED_TOTAL 25 #define DRIVER_2_LED_TOTAL 24 -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) #endif diff --git a/keyboards/planck/light/info.json b/keyboards/planck/light/info.json index 34566f85d3c..fa8f4c43bea 100644 --- a/keyboards/planck/light/info.json +++ b/keyboards/planck/light/info.json @@ -1,4 +1,115 @@ { "keyboard_name": "Planck Light", - "keyboard_folder": "planck/light" + "keyboard_folder": "planck/light", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_1x2uC": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3, "w": 2 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + } + } } diff --git a/keyboards/planck/light/light.c b/keyboards/planck/light/light.c index f463090dd0b..896ec44587c 100644 --- a/keyboards/planck/light/light.c +++ b/keyboards/planck/light/light.c @@ -77,65 +77,24 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_14, C8_14, C7_14} }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - - /*{row | col << 4} - | {x=0..224, y=0..64} - | | modifier - | | | */ - {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 0}, - {{0|(2<<4)}, {20.36*2, 21.33*0}, 0}, - {{0|(3<<4)}, {20.36*3, 21.33*0}, 0}, - {{0|(4<<4)}, {20.36*4, 21.33*0}, 0}, - {{0|(5<<4)}, {20.36*5, 21.33*0}, 0}, - {{0|(6<<4)}, {20.36*6, 21.33*0}, 0}, - {{0|(7<<4)}, {20.36*7, 21.33*0}, 0}, - {{0|(8<<4)}, {20.36*8, 21.33*0}, 0}, - {{0|(9<<4)}, {20.36*9, 21.33*0}, 0}, - {{0|(10<<4)}, {20.36*10,21.33*0}, 0}, - {{0|(11<<4)}, {20.36*11,21.33*0}, 1}, - - {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, - {{1|(1<<4)}, {20.36*1, 21.33*1}, 0}, - {{1|(2<<4)}, {20.36*2, 21.33*1}, 0}, - {{1|(3<<4)}, {20.36*3, 21.33*1}, 0}, - {{1|(4<<4)}, {20.36*4, 21.33*1}, 0}, - {{1|(5<<4)}, {20.36*5, 21.33*1}, 0}, - {{1|(6<<4)}, {20.36*6, 21.33*1}, 0}, - {{1|(7<<4)}, {20.36*7, 21.33*1}, 0}, - {{1|(8<<4)}, {20.36*8, 21.33*1}, 0}, - {{1|(9<<4)}, {20.36*9, 21.33*1}, 0}, - {{1|(10<<4)}, {20.36*10,21.33*1}, 0}, - {{1|(11<<4)}, {20.36*11,21.33*1}, 1}, - - {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, - {{2|(1<<4)}, {20.36*1, 21.33*2}, 0}, - {{2|(2<<4)}, {20.36*2, 21.33*2}, 0}, - {{2|(3<<4)}, {20.36*3, 21.33*2}, 0}, - {{2|(4<<4)}, {20.36*4, 21.33*2}, 0}, - {{2|(5<<4)}, {20.36*5, 21.33*2}, 0}, - {{2|(6<<4)}, {20.36*6, 21.33*2}, 0}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, - {{2|(10<<4)}, {20.36*10,21.33*2}, 0}, - {{2|(11<<4)}, {20.36*11,21.33*2}, 1}, - - {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, - {{3|(1<<4)}, {20.36*1, 21.33*3}, 1}, - {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, - {{3|(3<<4)}, {20.36*3, 21.33*3}, 1}, - {{3|(4<<4)}, {20.36*4, 21.33*3}, 1}, - {{3|(5<<4)}, {20.36*5, 21.33*3}, 0}, - {{3|(5<<4)}, {20.36*5.5,21.33*3}, 0}, - {{3|(6<<4)}, {20.36*6, 21.33*3}, 0}, - {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, - {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, - {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, - {{3|(10<<4)}, {20.36*10,21.33*3}, 1}, - {{3|(11<<4)}, {20.36*11,21.33*3}, 1} -}; +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, + { 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 }, + { 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48 } +}, { + { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 }, + { 0, 21 }, { 20, 21 }, { 40, 21 }, { 61, 21 }, { 81, 21 }, { 101, 21 }, { 122, 21 }, { 142, 21 }, { 162, 21 }, { 183, 21 }, { 203, 21 }, { 223, 21 }, + { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, + { 0, 63 }, { 20, 63 }, { 40, 63 }, { 61, 63 }, { 81, 63 }, { 101, 63 }, { 111, 63 }, { 122, 63 }, { 142, 63 }, { 162, 63 }, { 183, 63 }, { 203, 63 }, + { 223, 63 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 1, + 1 +} }; void matrix_init_kb(void) { @@ -151,6 +110,16 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) return process_record_user(keycode, record); } +uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { + // Spacebar has 2 leds 41 & 42, so add 42 to the array here, and 41 will be added + // by the default lookup code that runs after this + if (row == 3 && column == 5) { + led_i[0] = 42; + return 1; + } + return 0; +} + void matrix_scan_kb(void) { matrix_scan_user(); diff --git a/keyboards/planck/light/light.h b/keyboards/planck/light/light.h index a395f30e887..2cf46c2a276 100644 --- a/keyboards/planck/light/light.h +++ b/keyboards/planck/light/light.h @@ -20,4 +20,50 @@ #include "planck.h" #include "rgb_matrix.h" +#define LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ +) + +#define KEYMAP LAYOUT_ortho_4x12 +#define LAYOUT_planck_mit LAYOUT_planck_1x2uC +#define LAYOUT_planck_grid LAYOUT_ortho_4x12 +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc +#define KC_KEYMAP LAYOUT_kc + #endif \ No newline at end of file diff --git a/keyboards/planck/light/readme.md b/keyboards/planck/light/readme.md new file mode 100644 index 00000000000..f372e1fcc22 --- /dev/null +++ b/keyboards/planck/light/readme.md @@ -0,0 +1,15 @@ +# Planck Light + +![Planck Light](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/planck/light/planck_light.jpg) + +A Planck variant sold by Massdrop. Designed for Kailh PG1350 "Choc" switches, the Planck Light Features per-key RGB backlighting and a dual-channel speaker. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck Light +Hardware Availability: [Massdrop](https://www.massdrop.com/buy/massdrop-x-olkb-planck-light-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/light:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/light/rules.mk b/keyboards/planck/light/rules.mk index c10b8fd1da5..b621a9abb0f 100644 --- a/keyboards/planck/light/rules.mk +++ b/keyboards/planck/light/rules.mk @@ -1,5 +1,36 @@ -MIDI_ENABLE = yes +# MCU name +MCU = at90usb1286 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = yes # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. RGB_MATRIX_ENABLE = yes +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -MCU = at90usb1286 \ No newline at end of file +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/planck.h b/keyboards/planck/planck.h index d908d80ec4a..1beafa7764a 100644 --- a/keyboards/planck/planck.h +++ b/keyboards/planck/planck.h @@ -5,142 +5,22 @@ #define encoder_update(clockwise) encoder_update_user(uint8_t index, clockwise) -#ifdef __AVR__ -#define LAYOUT_planck_mit( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ -} - -#define LAYOUT_planck_grid( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ -} - -// Used to create a keymap using only KC_ prefixed keys -#define KC_KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ - ) \ - LAYOUT_planck_grid( \ - KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ - KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ - KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ - KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ - ) - -#define KEYMAP LAYOUT_planck_grid -#define LAYOUT_ortho_4x12 LAYOUT_planck_grid -#define KC_LAYOUT_ortho_4x12 KC_KEYMAP - -#else - - #define LAYOUT_planck_1x2uC( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k39, k3a, k3b }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k33, k34, k35 } \ -} - -#define LAYOUT_planck_1x2uR( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k39, k3a, k3b }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k33, k34, k35 } \ -} - -#define LAYOUT_planck_1x2uL( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k39, k3a, k3b }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k33, k34, k35 } \ -} - -#define LAYOUT_planck_2x2u( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k36, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k39, k3a, k3b }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k33, k34, k35 } \ -} - -#define LAYOUT_planck_grid( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k39, k3a, k3b }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k33, k34, k35 } \ -} - -#define KEYMAP LAYOUT_planck_grid -#define LAYOUT_ortho_4x12 LAYOUT_planck_grid -#define KC_LAYOUT_ortho_4x12 KC_KEYMAP - -#endif +#if defined(KEYBOARD_planck_ez) + #include "ez.h" +#elif defined(KEYBOARD_planck_light) + #include "light.h" +#elif defined(KEYBOARD_planck_rev1) + #include "rev1.h" +#elif defined(KEYBOARD_planck_rev2) + #include "rev2.h" +#elif defined(KEYBOARD_planck_rev3) + #include "rev3.h" +#elif defined(KEYBOARD_planck_rev4) + #include "rev4.h" +#elif defined(KEYBOARD_planck_rev5) + #include "rev5.h" +#elif defined(KEYBOARD_planck_rev6) + #include "rev6.h" +#endif // Planck revisions #endif diff --git a/keyboards/planck/readme.md b/keyboards/planck/readme.md index 083279e8a62..0d836563c41 100644 --- a/keyboards/planck/readme.md +++ b/keyboards/planck/readme.md @@ -6,7 +6,7 @@ Planck A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) -Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, Teensy 2.0 +Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, rev5, rev6; Planck Light, Planck EZ Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) Make example for this keyboard (after setting up your build environment): @@ -15,6 +15,7 @@ Make example for this keyboard (after setting up your build environment): Install examples: - make planck/rev6:default:dfu-util + make planck/rev5:default:dfu # For Planck rev5 or earlier and Planck Light + make planck/rev6:default:dfu-util # For Planck rev6 -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev1/config.h b/keyboards/planck/rev1/config.h new file mode 100644 index 00000000000..397887a73f3 --- /dev/null +++ b/keyboards/planck/rev1/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define DEVICE_VER 0x0001 diff --git a/keyboards/planck/rev1/info.json b/keyboards/planck/rev1/info.json new file mode 100644 index 00000000000..c64cdbfde85 --- /dev/null +++ b/keyboards/planck/rev1/info.json @@ -0,0 +1,115 @@ +{ + "keyboard_name": "Planck rev 1", + "keyboard_folder": "planck/rev1", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_1x2uC": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3, "w": 2 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/planck/rev1/readme.md b/keyboards/planck/rev1/readme.md new file mode 100644 index 00000000000..b5561fc1a76 --- /dev/null +++ b/keyboards/planck/rev1/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev1 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev1:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev1/rev1.h b/keyboards/planck/rev1/rev1.h new file mode 100644 index 00000000000..f81b36b316a --- /dev/null +++ b/keyboards/planck/rev1/rev1.h @@ -0,0 +1,49 @@ +#pragma once + +#include "planck.h" + +#define LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ +) + +#define KEYMAP LAYOUT_ortho_4x12 +#define LAYOUT_planck_mit LAYOUT_planck_1x2uC +#define LAYOUT_planck_grid LAYOUT_ortho_4x12 +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc +#define KC_KEYMAP LAYOUT_kc diff --git a/keyboards/planck/rev1/rules.mk b/keyboards/planck/rev1/rules.mk new file mode 100644 index 00000000000..be03e4515ef --- /dev/null +++ b/keyboards/planck/rev1/rules.mk @@ -0,0 +1,29 @@ +# MCU name +MCU = atmega32u4 + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev2/config.h b/keyboards/planck/rev2/config.h new file mode 100644 index 00000000000..bed78bca3f0 --- /dev/null +++ b/keyboards/planck/rev2/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define DEVICE_VER 0x0002 diff --git a/keyboards/planck/rev2/info.json b/keyboards/planck/rev2/info.json new file mode 100644 index 00000000000..68f89f601b5 --- /dev/null +++ b/keyboards/planck/rev2/info.json @@ -0,0 +1,115 @@ +{ + "keyboard_name": "Planck rev 2", + "keyboard_folder": "planck/rev2", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_1x2uC": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3, "w": 2 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/planck/rev2/readme.md b/keyboards/planck/rev2/readme.md new file mode 100644 index 00000000000..16fa8b7fd25 --- /dev/null +++ b/keyboards/planck/rev2/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev2 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev2/rev2.h b/keyboards/planck/rev2/rev2.h new file mode 100644 index 00000000000..f81b36b316a --- /dev/null +++ b/keyboards/planck/rev2/rev2.h @@ -0,0 +1,49 @@ +#pragma once + +#include "planck.h" + +#define LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ +) + +#define KEYMAP LAYOUT_ortho_4x12 +#define LAYOUT_planck_mit LAYOUT_planck_1x2uC +#define LAYOUT_planck_grid LAYOUT_ortho_4x12 +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc +#define KC_KEYMAP LAYOUT_kc diff --git a/keyboards/planck/rev2/rules.mk b/keyboards/planck/rev2/rules.mk new file mode 100644 index 00000000000..be03e4515ef --- /dev/null +++ b/keyboards/planck/rev2/rules.mk @@ -0,0 +1,29 @@ +# MCU name +MCU = atmega32u4 + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev3/config.h b/keyboards/planck/rev3/config.h index 45e60962ba5..fd6f0460e56 100644 --- a/keyboards/planck/rev3/config.h +++ b/keyboards/planck/rev3/config.h @@ -1,8 +1,3 @@ -#ifndef REV3_CONFIG_H -#define REV3_CONFIG_H - -#include "config_common.h" +#pragma once #define DEVICE_VER 0x0003 - -#endif diff --git a/keyboards/planck/rev3/info.json b/keyboards/planck/rev3/info.json new file mode 100644 index 00000000000..65e59adc839 --- /dev/null +++ b/keyboards/planck/rev3/info.json @@ -0,0 +1,115 @@ +{ + "keyboard_name": "Planck rev 3", + "keyboard_folder": "planck/rev3", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_1x2uC": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3, "w": 2 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/planck/rev3/readme.md b/keyboards/planck/rev3/readme.md new file mode 100644 index 00000000000..26ef898311d --- /dev/null +++ b/keyboards/planck/rev3/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev3 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev3:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev3/rev3.h b/keyboards/planck/rev3/rev3.h new file mode 100644 index 00000000000..f81b36b316a --- /dev/null +++ b/keyboards/planck/rev3/rev3.h @@ -0,0 +1,49 @@ +#pragma once + +#include "planck.h" + +#define LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ +) + +#define KEYMAP LAYOUT_ortho_4x12 +#define LAYOUT_planck_mit LAYOUT_planck_1x2uC +#define LAYOUT_planck_grid LAYOUT_ortho_4x12 +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc +#define KC_KEYMAP LAYOUT_kc diff --git a/keyboards/planck/rev3/rules.mk b/keyboards/planck/rev3/rules.mk index e51af55c668..3de40a66c58 100644 --- a/keyboards/planck/rev3/rules.mk +++ b/keyboards/planck/rev3/rules.mk @@ -1 +1,35 @@ -AUDIO_ENABLE = no # Audio output on port C6 +# MCU name +MCU = atmega32u4 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev4/config.h b/keyboards/planck/rev4/config.h index 4ff7649fb58..572852bbf0c 100644 --- a/keyboards/planck/rev4/config.h +++ b/keyboards/planck/rev4/config.h @@ -1,8 +1,3 @@ -#ifndef REV4_CONFIG_H -#define REV4_CONFIG_H - -#include "config_common.h" +#pragma once #define DEVICE_VER 0x0004 - -#endif \ No newline at end of file diff --git a/keyboards/planck/rev4/info.json b/keyboards/planck/rev4/info.json new file mode 100644 index 00000000000..ad135b6cb3e --- /dev/null +++ b/keyboards/planck/rev4/info.json @@ -0,0 +1,115 @@ +{ + "keyboard_name": "Planck rev 4", + "keyboard_folder": "planck/rev4", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_1x2uC": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3, "w": 2 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/planck/rev4/readme.md b/keyboards/planck/rev4/readme.md new file mode 100644 index 00000000000..4cf6e8cf2d5 --- /dev/null +++ b/keyboards/planck/rev4/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. The first revision of the Planck to support Audio. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev4 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev4:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev4/rev4.h b/keyboards/planck/rev4/rev4.h new file mode 100644 index 00000000000..f81b36b316a --- /dev/null +++ b/keyboards/planck/rev4/rev4.h @@ -0,0 +1,49 @@ +#pragma once + +#include "planck.h" + +#define LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ +) + +#define KEYMAP LAYOUT_ortho_4x12 +#define LAYOUT_planck_mit LAYOUT_planck_1x2uC +#define LAYOUT_planck_grid LAYOUT_ortho_4x12 +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc +#define KC_KEYMAP LAYOUT_kc diff --git a/keyboards/planck/rev4/rules.mk b/keyboards/planck/rev4/rules.mk index 7e64e7edc4f..390f5824948 100644 --- a/keyboards/planck/rev4/rules.mk +++ b/keyboards/planck/rev4/rules.mk @@ -1 +1,35 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev5/config.h b/keyboards/planck/rev5/config.h index 696eda73bce..93692207805 100644 --- a/keyboards/planck/rev5/config.h +++ b/keyboards/planck/rev5/config.h @@ -1,8 +1,3 @@ -#ifndef REV5_CONFIG_H -#define REV5_CONFIG_H - -#include "config_common.h" +#pragma once #define DEVICE_VER 0x0005 - -#endif \ No newline at end of file diff --git a/keyboards/planck/rev5/info.json b/keyboards/planck/rev5/info.json new file mode 100644 index 00000000000..6f31472f5af --- /dev/null +++ b/keyboards/planck/rev5/info.json @@ -0,0 +1,115 @@ +{ + "keyboard_name": "Planck rev 5", + "keyboard_folder": "planck/rev5", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_1x2uC": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3, "w": 2 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/planck/rev5/readme.md b/keyboards/planck/rev5/readme.md new file mode 100644 index 00000000000..fed975a3903 --- /dev/null +++ b/keyboards/planck/rev5/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev5 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev5:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev5/rev5.h b/keyboards/planck/rev5/rev5.h new file mode 100644 index 00000000000..f81b36b316a --- /dev/null +++ b/keyboards/planck/rev5/rev5.h @@ -0,0 +1,49 @@ +#pragma once + +#include "planck.h" + +#define LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ +) + +#define KEYMAP LAYOUT_ortho_4x12 +#define LAYOUT_planck_mit LAYOUT_planck_1x2uC +#define LAYOUT_planck_grid LAYOUT_ortho_4x12 +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc +#define KC_KEYMAP LAYOUT_kc diff --git a/keyboards/planck/rev5/rules.mk b/keyboards/planck/rev5/rules.mk index 7e64e7edc4f..ca63b39acf5 100644 --- a/keyboards/planck/rev5/rules.mk +++ b/keyboards/planck/rev5/rules.mk @@ -1 +1,35 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = qmk-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev6/config.h b/keyboards/planck/rev6/config.h index c0fbb412ee1..3354c3f80f7 100644 --- a/keyboards/planck/rev6/config.h +++ b/keyboards/planck/rev6/config.h @@ -43,7 +43,6 @@ * #define UNUSED_PINS */ -#define NUMBER_OF_ENCODERS 1 #define ENCODERS_PAD_A { B12 } #define ENCODERS_PAD_B { B13 } @@ -52,7 +51,7 @@ #undef C6_AUDIO /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 6 +// #define DEBOUNCE 6 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE @@ -80,11 +79,6 @@ */ //#define FORCE_NKRO -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/planck/rev6/halconf.h b/keyboards/planck/rev6/halconf.h deleted file mode 100644 index 8fe8e0c6f58..00000000000 --- a/keyboards/planck/rev6/halconf.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef HALCONF_H -#define HALCONF_H - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC TRUE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT TRUE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the QSPI subsystem. - */ -#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) -#define HAL_USE_QSPI FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB TRUE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 16 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 256 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 1 -#endif - -/** - * @brief Serial over USB number of buffers. - * @note The default is 2 buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_NUMBER 2 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* UART driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) -#define UART_USE_WAIT FALSE -#endif - -/** - * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define UART_USE_MUTUAL_EXCLUSION FALSE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* HALCONF_H */ - -/** @} */ diff --git a/keyboards/planck/rev6/info.json b/keyboards/planck/rev6/info.json new file mode 100644 index 00000000000..66dd8f575a6 --- /dev/null +++ b/keyboards/planck/rev6/info.json @@ -0,0 +1,270 @@ +{ + "keyboard_name": "Planck rev 6", + "keyboard_folder": "planck/rev6", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_1x2uC": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3, "w": 2 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_1x2uL": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3, "w": 2 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_1x2uR": { + "key_count": 47, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3, "w": 2 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_2x2u": { + "key_count": 46, + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3, "w": 2 }, + { "x": 6, "y": 3, "w": 2 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/planck/rev6/mcuconf.h b/keyboards/planck/rev6/mcuconf.h deleted file mode 100644 index 7c3c6e570ce..00000000000 --- a/keyboards/planck/rev6/mcuconf.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef MCUCONF_H -#define MCUCONF_H - -/* - * STM32F3xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F3xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PREDIV_VALUE 1 -#define STM32_PLLMUL_VALUE 9 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 -#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 -#define STM32_USART1SW STM32_USART1SW_PCLK -#define STM32_USART2SW STM32_USART2SW_PCLK -#define STM32_USART3SW STM32_USART3SW_PCLK -#define STM32_UART4SW STM32_UART4SW_PCLK -#define STM32_UART5SW STM32_UART5SW_PCLK -#define STM32_I2C1SW STM32_I2C1SW_SYSCLK -#define STM32_I2C2SW STM32_I2C2SW_SYSCLK -#define STM32_TIM1SW STM32_TIM1SW_PCLK2 -#define STM32_TIM8SW STM32_TIM8SW_PCLK2 -#define STM32_RTCSEL STM32_RTCSEL_LSI -#define STM32_USB_CLOCK_REQUIRED TRUE -#define STM32_USBPRE STM32_USBPRE_DIV1P5 - -#undef STM32_HSE_BYPASS -// #error "oh no" -// #endif - -/* - * ADC driver system settings. - */ -#define STM32_ADC_DUAL_MODE FALSE -#define STM32_ADC_COMPACT_SAMPLES FALSE -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_USE_ADC2 FALSE -#define STM32_ADC_USE_ADC3 FALSE -#define STM32_ADC_USE_ADC4 FALSE -#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) -#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) -#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) -#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC2_DMA_PRIORITY 2 -#define STM32_ADC_ADC3_DMA_PRIORITY 2 -#define STM32_ADC_ADC4_DMA_PRIORITY 2 -#define STM32_ADC_ADC12_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 -#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * DAC driver system settings. - */ -#define STM32_DAC_DUAL_MODE FALSE -#define STM32_DAC_USE_DAC1_CH1 TRUE -#define STM32_DAC_USE_DAC1_CH2 TRUE -#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM6 TRUE -#define STM32_GPT_USE_TIM7 TRUE -#define STM32_GPT_USE_TIM8 TRUE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM6_IRQ_PRIORITY 7 -#define STM32_GPT_TIM7_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 10 -#define STM32_I2C_I2C2_IRQ_PRIORITY 10 -#define STM32_I2C_USE_DMA TRUE -#define STM32_I2C_I2C1_DMA_PRIORITY 1 -#define STM32_I2C_I2C2_DMA_PRIORITY 1 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 TRUE -#define STM32_PWM_USE_TIM3 TRUE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_USB1 TRUE -#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 -#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 - -/* - * WDG driver system settings. - */ -#define STM32_WDG_USE_IWDG FALSE - -#endif /* MCUCONF_H */ diff --git a/keyboards/planck/rev6/readme.md b/keyboards/planck/rev6/readme.md new file mode 100644 index 00000000000..1034eb9d7a0 --- /dev/null +++ b/keyboards/planck/rev6/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. A complete hardware rework of the Planck, sporting a faster and more powerful STM32 ARM Cortex-M4 microcontroller, with support for rotary encoders and three additional layouts. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev6 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev6:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev6/rev6.h b/keyboards/planck/rev6/rev6.h index 75c2904c5c9..601e347f5e1 100644 --- a/keyboards/planck/rev6/rev6.h +++ b/keyboards/planck/rev6/rev6.h @@ -18,4 +18,110 @@ #include "planck.h" +#define LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, KC_NO } \ +} + +#define LAYOUT_planck_1x2uR( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { KC_NO, k37, k38, k33, k34, k35 } \ +} + +#define LAYOUT_planck_1x2uL( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, KC_NO, k35 } \ +} + +#define LAYOUT_planck_2x2u( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { KC_NO, k37, k38, k33, KC_NO, k35 } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} + + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ +) + +#define KEYMAP LAYOUT_ortho_4x12 +#define LAYOUT_planck_mit LAYOUT_planck_1x2uC +#define LAYOUT_planck_grid LAYOUT_ortho_4x12 +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc +#define KC_KEYMAP LAYOUT_kc + #endif diff --git a/keyboards/planck/rev6/rules.mk b/keyboards/planck/rev6/rules.mk index dce683a7fff..c582750025c 100644 --- a/keyboards/planck/rev6/rules.mk +++ b/keyboards/planck/rev6/rules.mk @@ -2,56 +2,38 @@ SRC = matrix.c LAYOUTS += ortho_4x12 -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F3xx - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -MCU_LDSCRIPT = STM32F303xC - -# Startup code to use -# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f3xx - -# Board: it should exist either in /os/hal/boards/ -# or /boards -BOARD = GENERIC_STM32_F303XC - # Cortex version -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -ARMV = 7 +MCU = STM32F303 -USE_FPU = yes - -# Vector table for application -# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ -# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB -# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 -OPT_DEFS = - -# Options to pass to dfu-util when flashing -DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Build Options -# comment out to disable the options. +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically # -BACKLIGHT_ENABLE = no -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) ## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover + CUSTOM_MATRIX = yes # Custom matrix file -AUDIO_ENABLE = yes -RGBLIGHT_ENABLE = no # SERIAL_LINK_ENABLE = yes ENCODER_ENABLE = yes + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rules.mk b/keyboards/planck/rules.mk deleted file mode 100644 index e194dcd5111..00000000000 --- a/keyboards/planck/rules.mk +++ /dev/null @@ -1,81 +0,0 @@ -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -ifeq ($(strip $(KEYBOARD)), planck/rev3) - BOOTLOADER = atmel-dfu -endif -ifeq ($(strip $(KEYBOARD)), planck/rev4) - BOOTLOADER = atmel-dfu -endif -ifeq ($(strip $(KEYBOARD)), planck/rev5) - BOOTLOADER = qmk-dfu -endif -ifeq ($(strip $(KEYBOARD)), planck/light) - BOOTLOADER = atmel-dfu -endif - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -API_SYSEX_ENABLE = no - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -LAYOUTS = ortho_4x12 planck_mit planck_grid -LAYOUTS_HAS_RGB = no - -DEFAULT_FOLDER = planck/rev5 diff --git a/keyboards/playkbtw/ca66/ca66.c b/keyboards/playkbtw/ca66/ca66.c index 6f24a895f5d..5f61df64e50 100644 --- a/keyboards/playkbtw/ca66/ca66.c +++ b/keyboards/playkbtw/ca66/ca66.c @@ -9,7 +9,7 @@ void bootmagic_lite(void) // We need multiple scans because debouncing can't be turned off. matrix_scan(); - wait_ms(DEBOUNCING_DELAY); + wait_ms(DEBOUNCE); matrix_scan(); // If the Esc (matrix 0,0) is held down on power up, diff --git a/keyboards/playkbtw/ca66/config.h b/keyboards/playkbtw/ca66/config.h index 53bbe95e3a6..b4c0e623418 100644 --- a/keyboards/playkbtw/ca66/config.h +++ b/keyboards/playkbtw/ca66/config.h @@ -29,7 +29,7 @@ #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -37,12 +37,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - #define RGB_DI_PIN B1 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/playkbtw/ca66/keymaps/kelorean/keymap.c b/keyboards/playkbtw/ca66/keymaps/kelorean/keymap.c index 3506efe8049..a3450118a15 100644 --- a/keyboards/playkbtw/ca66/keymaps/kelorean/keymap.c +++ b/keyboards/playkbtw/ca66/keymaps/kelorean/keymap.c @@ -11,9 +11,6 @@ #include QMK_KEYBOARD_H -// Helpful defines -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //Base Layer [0] = LAYOUT( diff --git a/keyboards/playkbtw/ca66/keymaps/olivia/keymap.c b/keyboards/playkbtw/ca66/keymaps/olivia/keymap.c index f27824e57aa..ed3d625e47f 100644 --- a/keyboards/playkbtw/ca66/keymaps/olivia/keymap.c +++ b/keyboards/playkbtw/ca66/keymaps/olivia/keymap.c @@ -11,7 +11,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, RESET, - KC_CAPS, RGB_RMOD,RGB_SMOD,RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_TOG, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, RGB_RMOD,RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_TOG, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), diff --git a/keyboards/playkbtw/ca66/readme.md b/keyboards/playkbtw/ca66/readme.md index 9e1ff7397e2..c415efd5f7a 100644 --- a/keyboards/playkbtw/ca66/readme.md +++ b/keyboards/playkbtw/ca66/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make playkbtw/ca66:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/playkbtw/pk60/config.h b/keyboards/playkbtw/pk60/config.h index 601e3c8a5c6..93e29951e9f 100644 --- a/keyboards/playkbtw/pk60/config.h +++ b/keyboards/playkbtw/pk60/config.h @@ -30,7 +30,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +38,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/playkbtw/pk60/keymaps/default/keymap.c b/keyboards/playkbtw/pk60/keymaps/default/keymap.c index 67969b25deb..d0fbc619f5b 100644 --- a/keyboards/playkbtw/pk60/keymaps/default/keymap.c +++ b/keyboards/playkbtw/pk60/keymaps/default/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_all( \ @@ -60,4 +58,4 @@ void led_set_user(uint8_t usb_led) { } -} \ No newline at end of file +} diff --git a/keyboards/playkbtw/pk60/keymaps/rfvizarra/keymap.c b/keyboards/playkbtw/pk60/keymaps/rfvizarra/keymap.c new file mode 100644 index 00000000000..e439d4462e4 --- /dev/null +++ b/keyboards/playkbtw/pk60/keymaps/rfvizarra/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_minila( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRAVE, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_DEL, + KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, MO(2), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT + ), + + [1] = LAYOUT_minila( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, RGB_TOG, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, + _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_MPLY + ), + + [2] = LAYOUT_minila( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, RGB_TOG, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, + _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), +}; diff --git a/keyboards/playkbtw/pk60/keymaps/rfvizarra/readme.md b/keyboards/playkbtw/pk60/keymaps/rfvizarra/readme.md new file mode 100644 index 00000000000..cd9a2210879 --- /dev/null +++ b/keyboards/playkbtw/pk60/keymaps/rfvizarra/readme.md @@ -0,0 +1,11 @@ +# A personal keymap for Play Keyboard60 based on the minila layout + +![Mininla layout](https://i.imgur.com/K7ONE1k.jpg) + +To build the firmware use + + make playkbtw/pk60:rfvizarra + +or if you prefer to use docker + + util/docker_build.sh playkbtw/pk60:rfvizarra diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h index 739e38555b1..7ed4814faba 100644 --- a/keyboards/preonic/config.h +++ b/keyboards/preonic/config.h @@ -56,18 +56,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/preonic/info.json b/keyboards/preonic/info.json index 3e5670cfaf0..cb0798b545a 100644 --- a/keyboards/preonic/info.json +++ b/keyboards/preonic/info.json @@ -6,7 +6,7 @@ "width": 12, "height": 5, "layouts": { - "KEYMAP": { + "LAYOUT_preonic_1x2uC": { "key_count": 59, "layout": [ { "w": 1, "x": 0, "y": 0 }, @@ -69,7 +69,7 @@ { "w": 1, "x": 10, "y": 4 }, { "w": 1, "x": 11, "y": 4 } ] }, - "LAYOUT_preonic_grid": { + "LAYOUT_ortho_5x12": { "key_count": 60, "layout": [ { "w": 1, "x": 0, "y": 0 }, diff --git a/keyboards/preonic/keymaps/0xdec/keymap.c b/keyboards/preonic/keymaps/0xdec/keymap.c index 5f82087b017..28277bd5f4c 100644 --- a/keyboards/preonic/keymaps/0xdec/keymap.c +++ b/keyboards/preonic/keymaps/0xdec/keymap.c @@ -11,10 +11,6 @@ enum preonic_keycodes { RAISE }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Colemak diff --git a/keyboards/preonic/keymaps/0xdec/rules.mk b/keyboards/preonic/keymaps/0xdec/rules.mk index 6600e368936..0c8a6dc4110 100644 --- a/keyboards/preonic/keymaps/0xdec/rules.mk +++ b/keyboards/preonic/keymaps/0xdec/rules.mk @@ -16,6 +16,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c index 590a8dc8a75..a5727707885 100644 --- a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c +++ b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c @@ -25,10 +25,6 @@ #define RAISE M(_RAISE) #define M_BL 5 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -199,10 +195,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) -}; - -const uint16_t PROGMEM fn_actions[] = { - }; #ifdef AUDIO_ENABLE diff --git a/keyboards/preonic/keymaps/boy314/keymap.c b/keyboards/preonic/keymaps/boy314/keymap.c index 67292bdb3e3..04404f69f9a 100644 --- a/keyboards/preonic/keymaps/boy314/keymap.c +++ b/keyboards/preonic/keymaps/boy314/keymap.c @@ -21,7 +21,7 @@ // define layers #define _QWERTY 0 #define _DVORAK 1 -#define _OSU 2 +#define _ARROWS 2 #define _LOWER 10 #define _RAISE 11 #define _ADJUST 12 @@ -29,12 +29,9 @@ // macro shortcuts #define QWERTY TO(_QWERTY) #define DVORAK TO(_DVORAK) -#define OSU TO(_OSU) #define LOWER M(_LOWER) #define RAISE M(_RAISE) - -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#define ARROWS TO(_ARROWS) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -48,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Del | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | Del | Alt | GUI |Lower | Raise| Space | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ @@ -57,7 +54,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ - KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ + KC_LCTL, KC_DEL, KC_LGUI, KC_LALT, LOWER, RAISE, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ ), /* Dvorak @@ -70,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Del | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | Del | Alt | GUI |Lower | Raise| Space | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ @@ -79,7 +76,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, \ KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, \ - KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ + KC_LCTL, KC_DEL, KC_LGUI, KC_LALT, LOWER, RAISE, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ +), + +/* ARROWS + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_ARROWS] = LAYOUT_preonic_grid( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT,_______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), /* Lower @@ -117,13 +136,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_GRV, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, - {KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_PGUP, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, [_RAISE] = LAYOUT_preonic_grid( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ @@ -143,7 +155,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff|Dvorak| | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | OSU | | | | | | | | | | + * | |ARROWS| | | | | | | | | | * `-----------------------------------------------------------------------------------' */ @@ -152,7 +164,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, DVORAK, _______, _______, _______, _______, \ - _______, OSU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, ARROWS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) }; @@ -175,10 +187,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) } return false; break; - case OSU: + case ARROWS: if (record->event.pressed) { - set_single_persistent_default_layer(_OSU); + set_single_persistent_default_layer(_ARROWS); } return false; break; diff --git a/keyboards/preonic/keymaps/bucktooth/keymap.c b/keyboards/preonic/keymaps/bucktooth/keymap.c index d3bcf66efa5..f03e469d709 100644 --- a/keyboards/preonic/keymaps/bucktooth/keymap.c +++ b/keyboards/preonic/keymaps/bucktooth/keymap.c @@ -4,10 +4,6 @@ #define L_QWERTSPLITLY 0 #define L_FN 1 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for Mac specific key accelerators used in map. Some of these are very awkward to type. // These are the default bindings for Mac, some of which may be turned off or changed, check your // settings in System Preferences @@ -32,32 +28,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QwertSplitly * ,-----------------------------------------------------------------------------------. - * | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | + * | 1 | 2 | 3 | 4 | 5 | = | ` | 6 | 7 | 8 | 9 | 0 | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Q | W | E | R | T | [ | ] | Y | U | I | O | P | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | A | S | D | F | G | ` | ' | H | J | K | L | ; | + * | A | S | D | F | G | - | ' | H | J | K | L | ; | * |------+------+------+------+------+------|------+------+------+------+------+------| - * |LShift| Z | X | C | V | B | \ | / | N | M | , |./RSft| + * |LShift| Z | X | C | V | \ | / | B | N | M | , |./RSft| * |------+------+------+------+------+------+------+------+------+------+------+------| * |ESC/fn|LCtrl | LOpt | LCmd |Space | Tab | BkSp |Space |En/Cmd|<-/fn |CRSR v|CRSR->| * `-----------------------------------------------------------------------------------' */ [L_QWERTSPLITLY] = LAYOUT_preonic_grid( \ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINUS,KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL ,KC_GRAVE,KC_6, KC_7, KC_8, KC_9, KC_0, \ KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, \ - KC_A, KC_S, KC_D, KC_F, KC_G, KC_GRAVE,KC_QUOTE,KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSLS, KC_SLASH,KC_N, KC_M, KC_COMM, MT_RSDOT,\ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_MINUS,KC_QUOTE,KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_BSLS, KC_SLASH,KC_B, KC_N, KC_M, KC_COMM, MT_RSDOT,\ LT_FNESC,KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_TAB, KC_BSPC, KC_SPC, MT_RGENT,LT_FNLFT,KC_DOWN, KC_RIGHT \ ), /* Fn * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | Vol- | Vol+ | F6 | F7 | F8 | F9 | F10 | + * | F1 | F2 | F3 | F4 | F5 | Vol+ | Mute | F6 | F7 | F8 | F9 | F10 | * |------+------+------+------+------+------+------+------+------+------+------+------| * | F11 | F12 | F13 | F14 | F15 |Track-|Track+|M:WhUp|M:Lclk| M:Up |M:Rclk| PgUp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps |^LPad |^DashB|^Help |^Drawr| Mute | |>|| |M:WhDn|M:Left|M:Down|M:Rght| PgDn | + * | Caps |^LPad |^DashB|^Help |^Drawr| Vol- | |>|| |M:WhDn|M:Left|M:Down|M:Rght| PgDn | * |------+------+------+------+------+------|------+------+------+------+------+------| * |RShift|^Menu |^SMenu|^Dock |^Tools|^Notif| Ins |M:Slow|M:Norm|M:Fast| Home | End | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -65,9 +61,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [L_FN] = LAYOUT_preonic_grid( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_VOLD, KC_VOLU, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_VOLU, KC_MUTE, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_MRWD, KC_MFFD, KC_WH_U, KC_BTN1, KC_MS_U, KC_BTN2, KC_PGUP, \ - KC_CAPS, MF_LPAD, MF_DASH, MF_HELP, MF_DRWR, KC_MUTE, KC_MPLY, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_PGDN, \ + KC_CAPS, MF_LPAD, MF_DASH, MF_HELP, MF_DRWR, KC_VOLD, KC_MPLY, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_PGDN, \ KC_RSFT, MF_MENU, MF_STAT, MF_DOCK, MF_TOOL, MF_NOTI, KC_INS, KC_ACL0, KC_ACL1, KC_ACL2, KC_HOME, KC_END, \ _______, KC_RCTL, KC_RALT, KC_RGUI, _______, LS_TAB, KC_DEL, _______, KC_PENT, _______, KC_UP, KC_LEFT \ ) @@ -97,14 +93,12 @@ void matrix_init_user(void) { void startup_user() { - _delay_ms(20); // gets rid of tick PLAY_SONG(tone_startup); } void shutdown_user() { PLAY_SONG(tone_goodbye); - _delay_ms(150); stop_all_notes(); } diff --git a/keyboards/preonic/keymaps/bucktooth/readme.md b/keyboards/preonic/keymaps/bucktooth/readme.md index a1bda9f6a2b..4c1c6272114 100644 --- a/keyboards/preonic/keymaps/bucktooth/readme.md +++ b/keyboards/preonic/keymaps/bucktooth/readme.md @@ -1,4 +1,4 @@ -# Bucktooth v1.0 (Mac) +# Bucktooth v2.0 (Mac) Bucktooth is an alternate layout that pushes the letters to the edges and puts most punctuation in the center. It's derived in part from my experience with Ergodox boards. I call the main layer layout QWERTSplitlY, you may notice the right side punctuation moving to the center and the control keys missing from the left. @@ -6,13 +6,13 @@ Bucktooth is an alternate layout that pushes the letters to the edges and puts m QwertSplitly ,-----------------------------------------------------------------------------------. - | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | + | 1 | 2 | 3 | 4 | 5 | + | ` | 6 | 7 | 8 | 9 | 0 | |------+------+------+------+------+------+------+------+------+------+------+------| | Q | W | E | R | T | [ | ] | Y | U | I | O | P | |------+------+------+------+------+-------------+------+------+------+------+------| - | A | S | D | F | G | ` | ' | H | J | K | L | ; | + | A | S | D | F | G | - | ' | H | J | K | L | ; | |------+------+------+------+------+------|------+------+------+------+------+------| - |LShift| Z | X | C | V | B | \ | / | N | M | , |./RSft| + |LShift| Z | X | C | V | \ | / | B | N | M | , |./RSft| |------+------+------+------+------+------+------+------+------+------+------+------| |ESC/fn|LCtrl | LOpt | LCmd |Space | Tab | BkSp |Space |En/Cmd|<-/fn |CRSR v|CRSR->| `-----------------------------------------------------------------------------------' @@ -24,6 +24,12 @@ That left shift is the only control or modifier key on the top four rows. All th With all control keys on the bottom row, the ESC key now lives in the bottom left and on my keyboard I actually put a very heavy keyswitch in that space to keep me from hitting it accidentally instead of ctrl. Hold it down and it becomes fn. I usually hit it with my whole hand since it is in the corner, without moving my fingers down to it. +## Revision 2 Changes + +The move of B to the right side of the keyboard may be controversial but has felt more and more comfortable to me. Again if you split a staggered layout keyboard down a straight line B has more in common with Y than T. I don't understand breaking the board into left and right on anything but a vertical line despite the long history of bringing the staggered layout slewing left. + +Revision 2 also changes the positions of -, =, and ~ for better compatibility with sculpted profile keysets which offer a Dvorak set option that provides the middle row dash because a middle row backtick/tilde is not found anywhere. + ## Function Layer There are no raise and lower or multiple function pages. The Preonic has enough keys to avoid more than a single function page, and I prefer to have spacebars for both thumbs so the "Bucktooth" name comes from the typical keyset with darker function keys and lighter alphas and space keys giving the keyboard fang-like appearance where the two spaces are. @@ -31,11 +37,11 @@ There are no raise and lower or multiple function pages. The Preonic has enough Fn ,-----------------------------------------------------------------------------------. - | F1 | F2 | F3 | F4 | F5 | Vol- | Vol+ | F6 | F7 | F8 | F9 | F10 | + | F1 | F2 | F3 | F4 | F5 | Vol+ | Mute | F6 | F7 | F8 | F9 | F10 | |------+------+------+------+------+------+------+------+------+------+------+------| | F11 | F12 | F13 | F14 | F15 |Track-|Track+|M:WhUp|M:Lclk| M:Up |M:Rclk| PgUp | |------+------+------+------+------+-------------+------+------+------+------+------| - | Caps |^LPad |^DashB|^Help |^Drawr| Mute | |>|| |M:WhDn|M:Left|M:Down|M:Rght| PgDn | + | Caps |^LPad |^DashB|^Help |^Drawr| Vol- | |>|| |M:WhDn|M:Left|M:Down|M:Rght| PgDn | |------+------+------+------+------+------|------+------+------+------+------+------| |RShift|^Menu |^SMenu|^Dock |^Tools|^Notif| Ins |M:Slow|M:Norm|M:Fast| Home | End | |------+------+------+------+------+------+------+------+------+------+------+------| @@ -50,6 +56,6 @@ The cursor keys are a design I stole from the old Commodore computers which had On Fn layer ZXCVB and SDFG keys I have set up the default key bindings for Mac OS Keyboard Focus keys since they are obscure and require FKeys mostly. They are pretty convenient for using the keyboard to search the menus, go to the dock, etc. Some like the one to jump to a window's toolbar and the one to jump to a window's accessory drawer are less commonly used. -___ +--- -Contributed to QMK and released with the QMK license by J. Eric Mason, 3/16/2018 +Contributed to QMK and released with the QMK license by Jeri C. Mason, 3/16/2018 - Revision 2 2/26/2019 diff --git a/keyboards/preonic/keymaps/bucktooth/rules.mk b/keyboards/preonic/keymaps/bucktooth/rules.mk index 9dbdfcbd3ba..8f226afd905 100644 --- a/keyboards/preonic/keymaps/bucktooth/rules.mk +++ b/keyboards/preonic/keymaps/bucktooth/rules.mk @@ -15,6 +15,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/preonic/keymaps/default/config.h b/keyboards/preonic/keymaps/default/config.h index 20535125826..40a9524b469 100644 --- a/keyboards/preonic/keymaps/default/config.h +++ b/keyboards/preonic/keymaps/default/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PREONIC_SOUND) @@ -38,5 +35,3 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/default/keymap.c b/keyboards/preonic/keymaps/default/keymap.c index 33ca90f99b7..d37882eabc6 100644 --- a/keyboards/preonic/keymaps/default/keymap.c +++ b/keyboards/preonic/keymaps/default/keymap.c @@ -233,7 +233,7 @@ uint16_t muse_counter = 0; uint8_t muse_offset = 70; uint16_t muse_tempo = 50; -void encoder_update(bool clockwise) { +void encoder_update_user(uint8_t index, bool clockwise) { if (muse_mode) { if (IS_LAYER_ON(_RAISE)) { if (clockwise) { diff --git a/keyboards/preonic/keymaps/dlaroe/keymap.c b/keyboards/preonic/keymaps/dlaroe/keymap.c index 77a2a44cfb8..888a21c063f 100644 --- a/keyboards/preonic/keymaps/dlaroe/keymap.c +++ b/keyboards/preonic/keymaps/dlaroe/keymap.c @@ -24,10 +24,6 @@ enum preonic_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/preonic/keymaps/dlaroe/rules.mk b/keyboards/preonic/keymaps/dlaroe/rules.mk index eea31684972..68f78de6e0a 100644 --- a/keyboards/preonic/keymaps/dlaroe/rules.mk +++ b/keyboards/preonic/keymaps/dlaroe/rules.mk @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/preonic/keymaps/fsck/config.h b/keyboards/preonic/keymaps/fsck/config.h new file mode 100644 index 00000000000..b06980c5b0d --- /dev/null +++ b/keyboards/preonic/keymaps/fsck/config.h @@ -0,0 +1,26 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PREONIC_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC diff --git a/keyboards/preonic/keymaps/fsck/keymap.c b/keyboards/preonic/keymaps/fsck/keymap.c new file mode 100644 index 00000000000..97a0ed60897 --- /dev/null +++ b/keyboards/preonic/keymaps/fsck/keymap.c @@ -0,0 +1,249 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +enum preonic_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + BACKLIT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Brite | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_preonic_grid( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, BACKLIT, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | ALTGr| | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_preonic_grid( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_VOLD,KC_VOLU,_______, \ + _______, _______, _______, KC_RALT, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | ALTGr| | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_preonic_grid( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_VOLD, KC_VOLU, _______, + _______, _______, _______, KC_RALT, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_preonic_grid( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef __AVR__ + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef __AVR__ + PORTE |= (1<<6); + #endif + } + return false; + break; + } + return true; +}; + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/preonic/keymaps/fsck/readme.md b/keyboards/preonic/keymaps/fsck/readme.md new file mode 100644 index 00000000000..e459884eb6a --- /dev/null +++ b/keyboards/preonic/keymaps/fsck/readme.md @@ -0,0 +1,5 @@ +![preonic:fsck Layout Image](https://i.imgur.com/nI8fBco.png) + +# fsck's Preonic Layout + +This is based on the fsck layout for the Planck keyboard and similar to the Preonic default layout. \ No newline at end of file diff --git a/keyboards/preonic/keymaps/fsck/rules.mk b/keyboards/preonic/keymaps/fsck/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/preonic/keymaps/fsck/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/preonic/keymaps/jacwib/keymap.c b/keyboards/preonic/keymaps/jacwib/keymap.c index 0b63abce171..e4cd76b84d3 100644 --- a/keyboards/preonic/keymaps/jacwib/keymap.c +++ b/keyboards/preonic/keymaps/jacwib/keymap.c @@ -22,10 +22,6 @@ enum preonic_keycodes { MRAISE }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -46,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH, \ KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS, \ - KC_LCTL, KC_LALT, KC_LGUI, NO_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_LCTL, KC_LALT, KC_LGUI, KC_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower @@ -109,7 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH, \ KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS, \ - KC_LCTL, KC_LALT, KC_LGUI, NO_ALGR, MLOWER, KC_SPC, KC_ENT, MRAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_LCTL, KC_LALT, KC_LGUI, KC_ALGR, MLOWER, KC_SPC, KC_ENT, MRAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Mac Lower diff --git a/keyboards/preonic/keymaps/jacwib/rules.mk b/keyboards/preonic/keymaps/jacwib/rules.mk index 9dbdfcbd3ba..8f226afd905 100644 --- a/keyboards/preonic/keymaps/jacwib/rules.mk +++ b/keyboards/preonic/keymaps/jacwib/rules.mk @@ -15,6 +15,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/preonic/keymaps/juno/config.h b/keyboards/preonic/keymaps/juno/config.h new file mode 100644 index 00000000000..6387debbb17 --- /dev/null +++ b/keyboards/preonic/keymaps/juno/config.h @@ -0,0 +1,37 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PREONIC_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 \ No newline at end of file diff --git a/keyboards/preonic/keymaps/juno/keymap.c b/keyboards/preonic/keymaps/juno/keymap.c new file mode 100644 index 00000000000..2e3152d299d --- /dev/null +++ b/keyboards/preonic/keymaps/juno/keymap.c @@ -0,0 +1,313 @@ +/* Juno's Preonic Layout */ + +#include QMK_KEYBOARD_H + +enum preonic_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST, + + _FN1, + _DPAD +}; + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT, + + FN1, + DP_ON, + DP_OFF +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | FN1 | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_preonic_grid( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + MO(_FN1),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_preonic_grid( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_preonic_grid( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_preonic_grid( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_preonic_grid( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_ADJUST] = LAYOUT_preonic_grid( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Function (personal function layer) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Vol- | | Vol+ | | | | PgUp | Up | PgDn | PScr | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | Home | Left | Down |Right | Ins | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Prev | Play | Next | Brite| | End | | Vol- | Vol+ | Mute | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | Caps | | Space | | DP_ON| | | | + * `-----------------------------------------------------------------------------------' + */ +[_FN1] = LAYOUT_preonic_grid( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_VOLD, _______, KC_VOLU, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_DEL , \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_DEL , \ + KC_LSFT, KC_MPRV, KC_MPLY, KC_MNXT, BACKLIT, _______, KC_END, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_CAPS, _______, KC_SPC, KC_SPC, _______, DP_ON, _______, _______, _______ \ +), + +/* DPAD layer, for active arrow cluster at the bottom right corner + * Use TG() to enable, but FUNC() to disable (defined at end of file) + * All layers clearing required + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | |Lower | Space |Raise |DP_OFF| Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DPAD] = LAYOUT_preonic_grid( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT , \ + KC_LCTL, KC_LGUI, KC_LALT, _______, LOWER, KC_SPC, KC_SPC, RAISE, DP_OFF, KC_LEFT, KC_DOWN, KC_RGHT \ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); + + float caps_song_on[][2] = SONG(NUM_LOCK_ON_SOUND); + float caps_song_off[][2] = SONG(SCROLL_LOCK_ON_SOUND); + + float dpad_song_on[][2] = SONG(ZELDA_PUZZLE); + float dpad_song_off[][2] = SONG(SONIC_RING); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; + + + + // Additional personal custom functions + + case KC_CAPS: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + if (host_keyboard_leds() & (1<event.pressed) { + + } else { + // activated upon release + #ifdef AUDIO_ENABLE + PLAY_SONG(dpad_song_on); + #endif + + layer_off(_FN1); + layer_on(_DPAD); + } + + case DP_OFF: + if (record->event.pressed) { + // deactivated upon pressdown + #ifdef AUDIO_ENABLE + PLAY_SONG(dpad_song_off); + #endif + + //layer_off(_FN1); // do not put in this line + layer_off(_DPAD); + } + + } + return true; +}; diff --git a/keyboards/preonic/keymaps/juno/readme.md b/keyboards/preonic/keymaps/juno/readme.md new file mode 100644 index 00000000000..e911968dd96 --- /dev/null +++ b/keyboards/preonic/keymaps/juno/readme.md @@ -0,0 +1 @@ +# The default Preonic layout - largely based on the Planck's \ No newline at end of file diff --git a/keyboards/preonic/keymaps/juno/rules.mk b/keyboards/preonic/keymaps/juno/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/preonic/keymaps/kinesis/config.h b/keyboards/preonic/keymaps/kinesis/config.h index e6099ceb82c..fd934726bb8 100644 --- a/keyboards/preonic/keymaps/kinesis/config.h +++ b/keyboards/preonic/keymaps/kinesis/config.h @@ -49,18 +49,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D1 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/preonic/keymaps/kinesis/keymap.c b/keyboards/preonic/keymaps/kinesis/keymap.c index 93fd9916358..44d51da4a08 100644 --- a/keyboards/preonic/keymaps/kinesis/keymap.c +++ b/keyboards/preonic/keymaps/kinesis/keymap.c @@ -8,9 +8,6 @@ #define _FN 1 #define _ULCK 2 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define HYP_TIC ALL_T(KC_GRV) #define EQ_LOCK TD(TD_EQ_LOCK) #define MIN_ULK TD(TD_MIN_ULOCK) diff --git a/keyboards/preonic/keymaps/kinesis/rules.mk b/keyboards/preonic/keymaps/kinesis/rules.mk index f37fe433891..94d02c8b773 100644 --- a/keyboards/preonic/keymaps/kinesis/rules.mk +++ b/keyboards/preonic/keymaps/kinesis/rules.mk @@ -22,6 +22,3 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/preonic/keymaps/kuatsure/keymap.c b/keyboards/preonic/keymaps/kuatsure/keymap.c index 63c3937fcad..907360d0cfa 100644 --- a/keyboards/preonic/keymaps/kuatsure/keymap.c +++ b/keyboards/preonic/keymaps/kuatsure/keymap.c @@ -20,16 +20,14 @@ enum preonic_layers { _QWERTY, _GAME, - _GAME_MOD, _LOWER, _RAISE, _ADJUST, }; enum preonic_keycodes { - QWERTY = SAFE_RANGE, + QWERTY = USER_SAFE_RANGE, GAME, - GAME_MOD, LOWER, RAISE, }; @@ -38,11 +36,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * | Tab/M| Q | W | E | R | T | Y | U | I | O | P | \ | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | + * | Esc/C| A | S | D | F | G | H | J | K | L | ; | ' | * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -50,121 +48,104 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT_preonic_grid_wrapper( \ - KC_ESC, _________________NUMBER_L1_________________, _________________NUMBER_R1_________________, KC_BSPC, \ - KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, \ - KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, \ + KC_GRV, _________________NUMBER_L1_________________, _________________NUMBER_R1_________________, KC_BSPC, \ + KT_MTAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, \ + KT_CESC, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, \ KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT, \ KC_LEAD, GAME, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Game - * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Leader|Qwerty| Alt | Spc |Game+ | Space |Game+ | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_GAME] = LAYOUT_preonic_grid_wrapper( \ - KC_ESC, _________________NUMBER_L1_________________, _________________NUMBER_R1_________________, KC_BSPC, \ - KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, \ - KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, \ - KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT, \ - KC_LEAD, QWERTY, KC_LALT, KC_SPC, GAME_MOD, KC_SPC, KC_SPC, GAME_MOD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Game Modifiers + * + * Mostly transparent, but wanted to disable gui key. + * Also give a key to get back to qwerty layout. + * * ,-----------------------------------------------------------------------------------. * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F9 | F10 | F11 | F12 | ` | | 7 | 8 | 9 | | | + * | | | | | | | | | | | | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F5 | F6 | F7 | F8 | ~ | | 4 | 5 | 6 | | | + * | | | | | | | | | | | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * |Shift | F1 | F2 | F3 | F4 | | | 1 | 2 | 3 | | | + * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | 0 | 0 | | | + * | |Qwerty| | Spc | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GAME_MOD] = LAYOUT_preonic_grid_wrapper( \ +[_GAME] = LAYOUT_preonic_grid_wrapper( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, ____________FUNCTION_3____________, KC_GRV, _______, KC_7, KC_8, KC_9, _______, _______, \ - _______, ____________FUNCTION_2____________, KC_TILD, _______, KC_4, KC_5, KC_6, _______, _______, \ - KC_LSFT, ____________FUNCTION_1____________, _______, _______, KC_1, KC_2, KC_3, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______ \ + _______, QWERTY, _______, KC_SPC, _______, _______, _______, _______, _______, _______, _______, _______ \ ), /* Lower * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | < | > | | | | + * | E`~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | Up | | ` | | { | } | _ | | | | + * | | | | Up | | ` | < | { | } | _ | | | | * |------+------+------+------+------+-------------+------+------+------+------+------| * | | Del | Left | Down | Right| ~ | = | ( | ) | + | : | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Vol- | Prev | Play | Next | Vol+ | - | [ | ] | | ? | | + * | | Vol- | Prev | Play | Next | Vol+ | - | [ | ] | > | ? | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Mute | | | | Esc | | Home | PgUp | PgDwn| End | + * | | Mute | | | | | | Home | PgDn | PgUp | End | * `-----------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT_preonic_grid_wrapper( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_LT, KC_GT, _______, _______, _______, \ - _______, _______, _______, KC_UP, _______, KC_GRV, _______, KC_LCBR, KC_RCBR, KC_UNDS, _______, KC_PIPE, \ - _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TILD, KC_EQL, KC_LPRN, KC_RPRN, KC_PLUS, KC_COLN, KC_DQT , \ - _______, KC_VOLD, KC_MRWD, KC_MPLY, KC_MFFD, KC_VOLU, KC_MINS, KC_LBRC, KC_RBRC, _______, KC_QUES, _______, \ - _______, KC_MUTE, _______, _______, _______, KC_ESC, KC_ESC, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END \ + KC_GESC, _________________SYMBOL_L1_________________, _________________SYMBOL_R1_________________, _______, \ + _______, _______, _______, KC_UP, _______, KC_GRV, _______, ____CRBRACES____, KC_UNDS, _______, KC_PIPE, \ + _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TILD, KC_EQL, _____PARENS_____, KC_PLUS, KC_COLN, KC_DQT , \ + _______, KC_VOLD, KC_MRWD, KC_MPLY, KC_MFFD, KC_VOLU, KC_MINS, ___SQBRACKETS___, _______, KC_QUES, _______, \ + _______, KC_MUTE, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ ), /* Raise * ,-----------------------------------------------------------------------------------. - * | E`~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F9 | F10 | F11 | F12 | | | | | | | Bksp | + * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F5 | F6 | F7 | F8 | | | | | | | | + * | | F9 | F10 | F11 | F12 | | * | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | = | 4 | 5 | 6 | + | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | | | | | | | | + * | | F1 | F2 | F3 | F4 | | - | 1 | 2 | 3 | / | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | Enter | | Home | PgUp | PgDwn| End | + * | | | | | | | | 0 | 0 | | | * `-----------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT_preonic_grid_wrapper( \ - KC_GESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - _______, ____________FUNCTION_3____________, _______, _______, _______, _______, _______, _______, KC_BSPC, \ - _______, ____________FUNCTION_2____________, _______, _______, _______, _______, _______, _______, _______, \ - _______, ____________FUNCTION_1____________, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, ____________FUNCTION_3____________, _______, KC_ASTR, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, ____________FUNCTION_2____________, _______, KC_EQL, KC_4, KC_5, KC_6, KC_PLUS, _______, \ + _______, ____________FUNCTION_1____________, _______, KC_MINS, KC_1, KC_2, KC_3, KC_SLASH, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______ \ ), /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset| Debug| | | | | | | | | Del | + * | | MAKE | FLSH | | | | | | | | | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | |Aud on|AudOff| | | | | | + * | | RESET| DEBUG| | |Aud on|AudOff| | | | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | |MusMod|Mus on|MusOff| | | | | | + * | | VRSN | | |MusMod|Mus on|MusOff| | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | |Qwerty| Game | | | * `-----------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT_preonic_grid_wrapper( \ ____________FUNCTION_1____________, ____________FUNCTION_2____________, ____________FUNCTION_3____________, \ - _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, _______, _______, AU_ON, AU_OFF, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, MU_MOD, MU_ON, MU_OFF, _______, _______, _______, _______, _______, \ + _______, KB_MAKE, KB_FLSH, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, RESET, DEBUG, _______, _______, AU_ON, AU_OFF, _______, _______, _______, _______, _______, \ + _______, KB_VRSN, _______, _______, MU_MOD, MU_ON, MU_OFF, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, QWERTY, GAME, _______, _______ \ ), }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { @@ -180,15 +161,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; - case GAME_MOD: - if (record->event.pressed) { - layer_on(_GAME_MOD); - } else { - layer_off(_GAME_MOD); - } - return false; - break; - case LOWER: if (record->event.pressed) { layer_on(_LOWER); diff --git a/keyboards/preonic/keymaps/mikethetiger/config.h b/keyboards/preonic/keymaps/mikethetiger/config.h new file mode 100644 index 00000000000..9e5eb83a64e --- /dev/null +++ b/keyboards/preonic/keymaps/mikethetiger/config.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PREONIC_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC +#define TAP_CODE_DELAY 10 + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/preonic/keymaps/mikethetiger/keymap.c b/keyboards/preonic/keymaps/mikethetiger/keymap.c new file mode 100644 index 00000000000..2f3963f7152 --- /dev/null +++ b/keyboards/preonic/keymaps/mikethetiger/keymap.c @@ -0,0 +1,289 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +enum preonic_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_preonic_grid( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_preonic_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_preonic_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, \ + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_preonic_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_preonic_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_preonic_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef __AVR__ + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef __AVR__ + PORTE |= (1<<6); + #endif + } + return false; + break; + } + return true; +}; + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/preonic/keymaps/mikethetiger/readme.md b/keyboards/preonic/keymaps/mikethetiger/readme.md new file mode 100644 index 00000000000..6da54ebbb54 --- /dev/null +++ b/keyboards/preonic/keymaps/mikethetiger/readme.md @@ -0,0 +1 @@ +# mikethetiger's Preonic layout - largely based on the Planck's \ No newline at end of file diff --git a/keyboards/preonic/keymaps/mikethetiger/rules.mk b/keyboards/preonic/keymaps/mikethetiger/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/preonic/keymaps/mikethetiger/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/preonic/keymaps/muzfuz/config.h b/keyboards/preonic/keymaps/muzfuz/config.h new file mode 100644 index 00000000000..40a9524b469 --- /dev/null +++ b/keyboards/preonic/keymaps/muzfuz/config.h @@ -0,0 +1,37 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PREONIC_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/preonic/keymaps/muzfuz/keymap.c b/keyboards/preonic/keymaps/muzfuz/keymap.c new file mode 100644 index 00000000000..a0a4b34fa94 --- /dev/null +++ b/keyboards/preonic/keymaps/muzfuz/keymap.c @@ -0,0 +1,271 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +enum preonic_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum preonic_keycodes +{ + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + BACKLIT, + HASHRKT, + CLNEQLS +}; + +#define RSE_ENT LT(_RAISE, KC_ENT) +#define LWR_SPC LT(_LOWER, KC_SPC) +#define ESC_CTL CTL_T(KC_ESCAPE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ESCCTL | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Enter|Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_preonic_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + ESC_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, KC_NO, RSE_ENT, KC_NO, LWR_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * ,-----------------------------------------------------------------------------------. + * | | => | | [ | ] | | | _ | + | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |ESCCTL| := | | { | } | ( | ) | - | = | \ | ~ | GUI | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | [ | ] | | | | | | Home | End | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_preonic_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, HASHRKT, _______, KC_LBRC, KC_RBRC, _______, _______, KC_UNDS, KC_PLUS, KC_PIPE, _______, _______, + ESC_CTL, CLNEQLS, _______, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_MINS, KC_EQL, KC_BSLS, KC_TILD, KC_RGUI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * ,-----------------------------------------------------------------------------------. + * | | | | Up | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |ESCCTL| | Left | Down | Right | | | | | | | GUI | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_preonic_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, + ESC_CTL, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, KC_RGUI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_preonic_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + _______, _______, MU_MOD, AU_ON, AU_OFF, _______, _______, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case HASHRKT: + if (record->event.pressed) + { + SEND_STRING("=>"); + } + break; + case CLNEQLS: + if (record->event.pressed) + { + SEND_STRING(":="); + } + break; + case QWERTY: + if (record->event.pressed) + { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) + { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + else + { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) + { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + else + { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) + { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef __AVR__ + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef __AVR__ + PORTE |= (1<<6); + #endif + } + return false; + break; + } + return true; +}; + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/preonic/keymaps/muzfuz/readme.md b/keyboards/preonic/keymaps/muzfuz/readme.md new file mode 100644 index 00000000000..a709d5c946e --- /dev/null +++ b/keyboards/preonic/keymaps/muzfuz/readme.md @@ -0,0 +1,5 @@ +# The muzfuz Preonic layout - largely based on the Planck's + +```shell +make preonic/rev3:muzfuz:dfu-util +``` diff --git a/keyboards/preonic/keymaps/muzfuz/rules.mk b/keyboards/preonic/keymaps/muzfuz/rules.mk new file mode 100644 index 00000000000..dcf16bef399 --- /dev/null +++ b/keyboards/preonic/keymaps/muzfuz/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/preonic/keymaps/nikchi/keymap.c b/keyboards/preonic/keymaps/nikchi/keymap.c index bb7be876c24..34d837cd648 100644 --- a/keyboards/preonic/keymaps/nikchi/keymap.c +++ b/keyboards/preonic/keymaps/nikchi/keymap.c @@ -21,10 +21,6 @@ enum preonic_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/preonic/keymaps/nikchi/rules.mk b/keyboards/preonic/keymaps/nikchi/rules.mk index 3d4659ceb9a..e69de29bb2d 100644 --- a/keyboards/preonic/keymaps/nikchi/rules.mk +++ b/keyboards/preonic/keymaps/nikchi/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/seph/keymap.c b/keyboards/preonic/keymaps/seph/keymap.c index 3d260600676..1584d2cb981 100644 --- a/keyboards/preonic/keymaps/seph/keymap.c +++ b/keyboards/preonic/keymaps/seph/keymap.c @@ -8,9 +8,6 @@ #define _LO 1 #define _RA 2 -// Fillers to make layering more clear -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/preonic/keymaps/smt/keymap.c b/keyboards/preonic/keymaps/smt/keymap.c index 3c703f47320..bb561a72cff 100644 --- a/keyboards/preonic/keymaps/smt/keymap.c +++ b/keyboards/preonic/keymaps/smt/keymap.c @@ -20,10 +20,6 @@ enum preonic_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift diff --git a/keyboards/preonic/keymaps/smt/rules.mk b/keyboards/preonic/keymaps/smt/rules.mk index 3d4659ceb9a..e69de29bb2d 100644 --- a/keyboards/preonic/keymaps/smt/rules.mk +++ b/keyboards/preonic/keymaps/smt/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/that_canadian/Makefile b/keyboards/preonic/keymaps/that_canadian/Makefile index 507bd77d2d1..773e5c45dad 100644 --- a/keyboards/preonic/keymaps/that_canadian/Makefile +++ b/keyboards/preonic/keymaps/that_canadian/Makefile @@ -20,6 +20,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/that_canadian/keymap.c b/keyboards/preonic/keymaps/that_canadian/keymap.c index 968b2ae25b7..bf9e89e1f2a 100644 --- a/keyboards/preonic/keymaps/that_canadian/keymap.c +++ b/keyboards/preonic/keymaps/that_canadian/keymap.c @@ -20,10 +20,6 @@ enum preonic_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/keyboards/preonic/keymaps/xulkal/keymap.c b/keyboards/preonic/keymaps/xulkal/keymap.c new file mode 100644 index 00000000000..967cd5a0aba --- /dev/null +++ b/keyboards/preonic/keymaps/xulkal/keymap.c @@ -0,0 +1,148 @@ +#include QMK_KEYBOARD_H +#include "xulkal.h" + +#include "muse.h" + +#define EXPAND_LAYOUT(...) LAYOUT_preonic_grid(__VA_ARGS__) + +// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty Layout + * ,------------------------------------------------. ,------------------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * |FN(CAPS)| A | S | D | F | G | ` | | ' | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Sft[ | Z | X | C | V | B | RGB | |RGBRST| N | M | , | . | / | Sft] | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | LOWER| RAISE| Alt | Space|RGBRMOD| |RGBMOD| Space| Left | Up | Down | Right| Ctrl | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Space| DEL | | Enter| Space| + * `-------------' `-------------' + */ + [_QWERTY] = EXPAND_LAYOUT( \ + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, \ + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, \ + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, \ + _________________QWERTY_L4_________________, _________________QWERTY_R4_________________, \ + _________________QWERTY_L5_________________, _________________QWERTY_R5_________________ \ + ), + +#ifndef GAMELAYER_DISABLE + [_GAME] = EXPAND_LAYOUT( \ + ___________________GAME_L1_________________, ___________________GAME_R1_________________, \ + ___________________GAME_L2_________________, ___________________GAME_R2_________________, \ + ___________________GAME_L3_________________, ___________________GAME_R3_________________, \ + ___________________GAME_L4_________________, ___________________GAME_R4_________________, \ + ___________________GAME_L5_________________, ___________________GAME_R5_________________ \ + ), +#endif + + [_LOWER] = EXPAND_LAYOUT( \ + __________________LOWER_L1_________________, __________________LOWER_R1_________________, \ + __________________LOWER_L2_________________, __________________LOWER_R2_________________, \ + __________________LOWER_L3_________________, __________________LOWER_R3_________________, \ + __________________LOWER_L4_________________, __________________LOWER_R4_________________, \ + __________________LOWER_L5_________________, __________________LOWER_R5_________________ \ + ), + + [_RAISE] = EXPAND_LAYOUT( \ + __________________RAISE_L1_________________, __________________RAISE_R1_________________, \ + __________________RAISE_L2_________________, __________________RAISE_R2_________________, \ + __________________RAISE_L3_________________, __________________RAISE_R3_________________, \ + __________________RAISE_L4_________________, __________________RAISE_R4_________________, \ + __________________RAISE_L5_________________, __________________RAISE_R5_________________ \ + ), + +#ifdef TRILAYER_ENABLED + [_ADJUST] = EXPAND_LAYOUT( \ + _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, \ + _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, \ + _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, \ + _________________ADJUST_L4_________________, _________________ADJUST_R4_________________, \ + _________________ADJUST_L5_________________, _________________ADJUST_R5_________________ \ + ), +#endif +}; + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/preonic/keymaps/xulkal/rules.mk b/keyboards/preonic/keymaps/xulkal/rules.mk new file mode 100644 index 00000000000..f7e76252cd0 --- /dev/null +++ b/keyboards/preonic/keymaps/xulkal/rules.mk @@ -0,0 +1,6 @@ +SRC += muse.c + +ENCODER_ENABLE = no + +OPT_DEFS += -DTRILAYER_ENABLED +OPT_DEFS += -DAUDIO_CLICKY diff --git a/keyboards/preonic/keymaps/zach/config.h b/keyboards/preonic/keymaps/zach/config.h index 25f88afdc15..66e6b087f42 100644 --- a/keyboards/preonic/keymaps/zach/config.h +++ b/keyboards/preonic/keymaps/zach/config.h @@ -45,24 +45,18 @@ along with this program. If not, see . /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST - #define BACKLIGHT_BREATHING // LED breathing /* number of backlight levels */ #define BACKLIGHT_LEVELS 5 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ //#define RGB_DI_PIN D1 @@ -90,5 +84,4 @@ along with this program. If not, see . //#define DYNAMIC_MACRO_ENABLE // Enable if you need to use the macro functionality //#define SPACE_CADET // Parenthesis on L/R shift - #endif diff --git a/keyboards/preonic/keymaps/zach/rules.mk b/keyboards/preonic/keymaps/zach/rules.mk index f00af43961e..77efcf3832f 100644 --- a/keyboards/preonic/keymaps/zach/rules.mk +++ b/keyboards/preonic/keymaps/zach/rules.mk @@ -24,6 +24,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/preonic/keymaps/zach/zach_common_functions.c b/keyboards/preonic/keymaps/zach/zach_common_functions.c index e6aeaa50a31..5de64de955d 100644 --- a/keyboards/preonic/keymaps/zach/zach_common_functions.c +++ b/keyboards/preonic/keymaps/zach/zach_common_functions.c @@ -5,9 +5,7 @@ #include "keymap_colemak.h" extern keymap_config_t keymap_config; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#undef C #define C(n) RCTL(n) #define CADKEY RCTL(RALT(KC_DEL)) diff --git a/keyboards/preonic/preonic.h b/keyboards/preonic/preonic.h index 8d7b577a97f..e2aa1545c19 100644 --- a/keyboards/preonic/preonic.h +++ b/keyboards/preonic/preonic.h @@ -1,149 +1,26 @@ -#ifndef PREONIC_H -#define PREONIC_H +#pragma once #include "quantum.h" -#ifdef __AVR__ - -#define LAYOUT_preonic_1x2uC( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k43, k44, k45, k45, k47, k48, k49, k4a, k4b } \ -} - -#define LAYOUT_preonic_grid( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ -} - -#define KEYMAP LAYOUT_preonic_1x2uC -#define LAYOUT_ortho_5x12 LAYOUT_preonic_grid - -#else - -#define LAYOUT_preonic_1x2uC( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} - -#define LAYOUT_preonic_1x2uR( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} -#define LAYOUT_preonic_1x2uL( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k46, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} - -#define LAYOUT_preonic_2x2u( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k46, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} +/************************************************** +** Include headers specific to keyboard revision ** +***************************************************/ +#ifdef KEYBOARD_preonic_rev1 + #include "rev1.h" +#endif -#define LAYOUT_preonic_grid( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} +#ifdef KEYBOARD_preonic_rev2 + #include "rev2.h" +#endif -#define KEYMAP LAYOUT_preonic_grid -#define LAYOUT_ortho_4x12 LAYOUT_preonic_grid -#define KC_LAYOUT_ortho_4x12 KC_KEYMAP +#ifdef KEYBOARD_preonic_rev3 + #include "rev3.h" +#endif -#endif +/************************************************** +** Layout macros aliases common to all revisions ** -#endif + Name of Alias Matrix Name: + ----------------- ------------------- ****/ +#define LAYOUT_ortho_5x12 LAYOUT_preonic_grid diff --git a/keyboards/preonic/readme.md b/keyboards/preonic/readme.md index e116021fdd4..85adf635d74 100644 --- a/keyboards/preonic/readme.md +++ b/keyboards/preonic/readme.md @@ -6,11 +6,16 @@ Preonic A compact 50% (12x5) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/preonic/) Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) -Hardware Supported: Preonic PCB rev1, Teensy 2.0 +Hardware Supported: Preonic PCB rev1, rev2, rev3 Hardware Availability: [OLKB.com](https://olkb.com/preonic/), [Massdrop](https://www.massdrop.com/buy/preonic-mechanical-keyboard?mode=guest_open) Make example for this keyboard (after setting up your build environment): - make preonic:default + make preonic/rev2:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +Install examples: + + make preonic/rev2:default:dfu # For Preonic rev1 or rev2 + make preonic/rev3:default:dfu-util # For Preonic rev3 + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/preonic/rev1/rev1.h b/keyboards/preonic/rev1/rev1.h index 6705b725918..6ca4afd3e2f 100644 --- a/keyboards/preonic/rev1/rev1.h +++ b/keyboards/preonic/rev1/rev1.h @@ -13,4 +13,41 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "preonic.h" \ No newline at end of file + +#pragma once + +#include "preonic.h" + +#ifdef __AVR__ // Preonic revs. 1 & 2 + + #define LAYOUT_preonic_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k45, k47, k48, k49, k4a, k4b } \ + } + + #define LAYOUT_preonic_grid( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ + } + +#endif diff --git a/keyboards/preonic/rev1/rules.mk b/keyboards/preonic/rev1/rules.mk index e69de29bb2d..128deb0c851 100644 --- a/keyboards/preonic/rev1/rules.mk +++ b/keyboards/preonic/rev1/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_5x12 diff --git a/keyboards/preonic/rev2/rev2.h b/keyboards/preonic/rev2/rev2.h index 51172145986..6ca4afd3e2f 100644 --- a/keyboards/preonic/rev2/rev2.h +++ b/keyboards/preonic/rev2/rev2.h @@ -14,4 +14,40 @@ * along with this program. If not, see . */ +#pragma once + #include "preonic.h" + +#ifdef __AVR__ // Preonic revs. 1 & 2 + + #define LAYOUT_preonic_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k45, k47, k48, k49, k4a, k4b } \ + } + + #define LAYOUT_preonic_grid( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ + } + +#endif diff --git a/keyboards/preonic/rev2/rules.mk b/keyboards/preonic/rev2/rules.mk index e69de29bb2d..53411647dda 100644 --- a/keyboards/preonic/rev2/rules.mk +++ b/keyboards/preonic/rev2/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = qmk-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_5x12 diff --git a/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.h b/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.h deleted file mode 100644 index ec26557f3a6..00000000000 --- a/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.h +++ /dev/null @@ -1,1187 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for Clueboard 60% Keyboard - */ - -/* - * Board identifier. - */ -#define BOARD_GENERIC_STM32_F303XC -#define BOARD_NAME "Planck PCB" - -/* - * Board oscillators-related settings. - * NOTE: LSE not fitted. - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 0U -#endif - -#define STM32_LSEDRV (3U << 3U) - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 8000000U -#endif - -// #define STM32_HSE_BYPASS - -/* - * MCU type as defined in the ST header. - */ -#define STM32F303xC - -/* - * IO pins assignments. - */ -#define GPIOA_PIN0 0U -#define GPIOA_PIN1 1U -#define GPIOA_PIN2 2U -#define GPIOA_PIN3 3U -#define GPIOA_PIN4 4U -#define GPIOA_PIN5 5U -#define GPIOA_PIN6 6U -#define GPIOA_PIN7 7U -#define GPIOA_PIN8 8U -#define GPIOA_PIN9 9U -#define GPIOA_PIN10 10U -#define GPIOA_USB_DM 11U -#define GPIOA_USB_DP 12U -#define GPIOA_SWDIO 13U -#define GPIOA_SWCLK 14U -#define GPIOA_PIN15 15U - -#define GPIOB_PIN0 0U -#define GPIOB_PIN1 1U -#define GPIOB_PIN2 2U -#define GPIOB_PIN3 3U -#define GPIOB_PIN4 4U -#define GPIOB_PIN5 5U -#define GPIOB_PIN6 6U -#define GPIOB_PIN7 7U -#define GPIOB_PIN8 8U -#define GPIOB_PIN9 9U -#define GPIOB_PIN10 10U -#define GPIOB_PIN11 11U -#define GPIOB_PIN12 12U -#define GPIOB_PIN13 13U -#define GPIOB_PIN14 14U -#define GPIOB_PIN15 15U - -#define GPIOC_PIN0 0U -#define GPIOC_PIN1 1U -#define GPIOC_PIN2 2U -#define GPIOC_PIN3 3U -#define GPIOC_PIN4 4U -#define GPIOC_PIN5 5U -#define GPIOC_PIN6 6U -#define GPIOC_PIN7 7U -#define GPIOC_PIN8 8U -#define GPIOC_PIN9 9U -#define GPIOC_PIN10 10U -#define GPIOC_PIN11 11U -#define GPIOC_PIN12 12U -#define GPIOC_PIN13 13U -#define GPIOC_PIN14 14U -#define GPIOC_PIN15 15U - -#define GPIOD_PIN0 0U -#define GPIOD_PIN1 1U -#define GPIOD_PIN2 2U -#define GPIOD_PIN3 3U -#define GPIOD_PIN4 4U -#define GPIOD_PIN5 5U -#define GPIOD_PIN6 6U -#define GPIOD_PIN7 7U -#define GPIOD_PIN8 8U -#define GPIOD_PIN9 9U -#define GPIOD_PIN10 10U -#define GPIOD_PIN11 11U -#define GPIOD_PIN12 12U -#define GPIOD_PIN13 13U -#define GPIOD_PIN14 14U -#define GPIOD_PIN15 15U - -#define GPIOE_PIN0 0U -#define GPIOE_PIN1 1U -#define GPIOE_PIN2 2U -#define GPIOE_PIN3 3U -#define GPIOE_PIN4 4U -#define GPIOE_PIN5 5U -#define GPIOE_PIN6 6U -#define GPIOE_PIN7 7U -#define GPIOE_PIN8 8U -#define GPIOE_PIN9 9U -#define GPIOE_PIN10 10U -#define GPIOE_PIN11 11U -#define GPIOE_PIN12 12U -#define GPIOE_PIN13 13U -#define GPIOE_PIN14 14U -#define GPIOE_PIN15 15U - -#define GPIOF_I2C2_SDA 0U -#define GPIOF_I2C2_SCL 1U -#define GPIOF_PIN2 2U -#define GPIOF_PIN3 3U -#define GPIOF_PIN4 4U -#define GPIOF_PIN5 5U -#define GPIOF_PIN6 6U -#define GPIOF_PIN7 7U -#define GPIOF_PIN8 8U -#define GPIOF_PIN9 9U -#define GPIOF_PIN10 10U -#define GPIOF_PIN11 11U -#define GPIOF_PIN12 12U -#define GPIOF_PIN13 13U -#define GPIOF_PIN14 14U -#define GPIOF_PIN15 15U - -#define GPIOG_PIN0 0U -#define GPIOG_PIN1 1U -#define GPIOG_PIN2 2U -#define GPIOG_PIN3 3U -#define GPIOG_PIN4 4U -#define GPIOG_PIN5 5U -#define GPIOG_PIN6 6U -#define GPIOG_PIN7 7U -#define GPIOG_PIN8 8U -#define GPIOG_PIN9 9U -#define GPIOG_PIN10 10U -#define GPIOG_PIN11 11U -#define GPIOG_PIN12 12U -#define GPIOG_PIN13 13U -#define GPIOG_PIN14 14U -#define GPIOG_PIN15 15U - -#define GPIOH_PIN0 0U -#define GPIOH_PIN1 1U -#define GPIOH_PIN2 2U -#define GPIOH_PIN3 3U -#define GPIOH_PIN4 4U -#define GPIOH_PIN5 5U -#define GPIOH_PIN6 6U -#define GPIOH_PIN7 7U -#define GPIOH_PIN8 8U -#define GPIOH_PIN9 9U -#define GPIOH_PIN10 10U -#define GPIOH_PIN11 11U -#define GPIOH_PIN12 12U -#define GPIOH_PIN13 13U -#define GPIOH_PIN14 14U -#define GPIOH_PIN15 15U - -/* - * IO lines assignments. - */ -#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) -#define LINE_USB_DM PAL_LINE(GPIOA, 11U) -#define LINE_USB_DP PAL_LINE(GPIOA, 12U) -#define LINE_SWDIO PAL_LINE(GPIOA, 13U) -#define LINE_SWCLK PAL_LINE(GPIOA, 14U) - -#define LINE_PIN6 PAL_LINE(GPIOF, 0U) -#define LINE_PIN7 PAL_LINE(GPIOF, 1U) - -#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) - - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) - -/* - * GPIOA setup: - * - * PA0 - NC - * PA1 - NC - * PA2 - COL1 - * PA3 - COL2 - * PA4 - SPEAKER1 - * PA5 - SPEAKER2 - * PA6 - COL3 - * PA7 - COL8 - * PA8 - COL6 - * PA9 - COL7 - * PA10 - ROW5 - * PA11 - USB_DM (alternate 14). - * PA12 - USB_DP (alternate 14). - * PA13 - SWDIO (alternate 0). - * PA14 - SWCLK (alternate 0). - * PA15 - ROW4 - */ -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ - PIN_MODE_ALTERNATE(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_PIN2) | \ - PIN_MODE_INPUT(GPIOA_PIN3) | \ - PIN_MODE_INPUT(GPIOA_PIN4) | \ - PIN_MODE_INPUT(GPIOA_PIN5) | \ - PIN_MODE_INPUT(GPIOA_PIN6) | \ - PIN_MODE_INPUT(GPIOA_PIN7) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_PIN9) | \ - PIN_MODE_INPUT(GPIOA_PIN10) | \ - PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ - PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ - PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ - PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ - PIN_MODE_INPUT(GPIOA_PIN15)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ - PIN_OSPEED_HIGH(GPIOA_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ - PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ - PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ - PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ - PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN15)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ - PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ - PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN15)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_PIN2) | \ - PIN_ODR_HIGH(GPIOA_PIN3) | \ - PIN_ODR_HIGH(GPIOA_PIN4) | \ - PIN_ODR_HIGH(GPIOA_PIN5) | \ - PIN_ODR_HIGH(GPIOA_PIN6) | \ - PIN_ODR_HIGH(GPIOA_PIN7) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_PIN9) | \ - PIN_ODR_HIGH(GPIOA_PIN10) | \ - PIN_ODR_HIGH(GPIOA_USB_DM) | \ - PIN_ODR_HIGH(GPIOA_USB_DP) | \ - PIN_ODR_HIGH(GPIOA_SWDIO) | \ - PIN_ODR_HIGH(GPIOA_SWCLK) | \ - PIN_ODR_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ - PIN_AFIO_AF(GPIOA_PIN1, 1) | \ - PIN_AFIO_AF(GPIOA_PIN2, 0) | \ - PIN_AFIO_AF(GPIOA_PIN3, 0) | \ - PIN_AFIO_AF(GPIOA_PIN4, 0) | \ - PIN_AFIO_AF(GPIOA_PIN5, 5) | \ - PIN_AFIO_AF(GPIOA_PIN6, 5) | \ - PIN_AFIO_AF(GPIOA_PIN7, 5)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ - PIN_AFIO_AF(GPIOA_PIN9, 0) | \ - PIN_AFIO_AF(GPIOA_PIN10, 0) | \ - PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ - PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ - PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ - PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ - PIN_AFIO_AF(GPIOA_PIN15, 0)) - -/* - * GPIOB setup: - * - * PB0 - PIN0 (input pullup). - * PB1 - PIN1 (input pullup). - * PB2 - PIN2 (input pullup). - * PB3 - PIN3 (alternate 0). - * PB4 - PIN4 (input pullup). - * PB5 - PIN5 (input pullup). - * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). - * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). - * PB8 - PIN8 (input pullup). - * PB9 - PIN9 (input pullup). - * PB10 - PIN10 (input pullup). - * PB11 - PIN11 (input pullup). - * PB12 - PIN12 (input pullup). - * PB13 - PIN13 (input pullup). - * PB14 - PIN14 (input pullup). - * PB15 - PIN15 (input pullup). - */ -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ - PIN_MODE_INPUT(GPIOB_PIN1) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ - PIN_MODE_INPUT(GPIOB_PIN4) | \ - PIN_MODE_INPUT(GPIOB_PIN5) | \ - PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ - PIN_MODE_OUTPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_INPUT(GPIOB_PIN9) | \ - PIN_MODE_INPUT(GPIOB_PIN10) | \ - PIN_MODE_INPUT(GPIOB_PIN11) | \ - PIN_MODE_INPUT(GPIOB_PIN12) | \ - PIN_MODE_INPUT(GPIOB_PIN13) | \ - PIN_MODE_INPUT(GPIOB_PIN14) | \ - PIN_MODE_INPUT(GPIOB_PIN15)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ - PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ - PIN_OSPEED_HIGH(GPIOB_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ - PIN_OSPEED_HIGH(GPIOB_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN15)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ - PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN15)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ - PIN_ODR_HIGH(GPIOB_PIN1) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_PIN3) | \ - PIN_ODR_HIGH(GPIOB_PIN4) | \ - PIN_ODR_HIGH(GPIOB_PIN5) | \ - PIN_ODR_HIGH(GPIOB_PIN6) | \ - PIN_ODR_LOW(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_PIN9) | \ - PIN_ODR_HIGH(GPIOB_PIN10) | \ - PIN_ODR_HIGH(GPIOB_PIN11) | \ - PIN_ODR_HIGH(GPIOB_PIN12) | \ - PIN_ODR_HIGH(GPIOB_PIN13) | \ - PIN_ODR_HIGH(GPIOB_PIN14) | \ - PIN_ODR_HIGH(GPIOB_PIN15)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ - PIN_AFIO_AF(GPIOB_PIN1, 0) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0) | \ - PIN_AFIO_AF(GPIOB_PIN3, 0) | \ - PIN_AFIO_AF(GPIOB_PIN4, 0) | \ - PIN_AFIO_AF(GPIOB_PIN5, 0) | \ - PIN_AFIO_AF(GPIOB_PIN6, 4) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ - PIN_AFIO_AF(GPIOB_PIN9, 0) | \ - PIN_AFIO_AF(GPIOB_PIN10, 0) | \ - PIN_AFIO_AF(GPIOB_PIN11, 0) | \ - PIN_AFIO_AF(GPIOB_PIN12, 0) | \ - PIN_AFIO_AF(GPIOB_PIN13, 0) | \ - PIN_AFIO_AF(GPIOB_PIN14, 0) | \ - PIN_AFIO_AF(GPIOB_PIN15, 0)) - -/* - * GPIOC setup: - * - * PC0 - PIN0 (input pullup). - * PC1 - PIN1 (input pullup). - * PC2 - PIN2 (input pullup). - * PC3 - PIN3 (input pullup). - * PC4 - PIN4 (input pullup). - * PC5 - PIN5 (input pullup). - * PC6 - PIN6 (input pullup). - * PC7 - PIN7 (input pullup). - * PC8 - PIN8 (input pullup). - * PC9 - PIN9 (input pullup). - * PC10 - PIN10 (input pullup). - * PC11 - PIN11 (input pullup). - * PC12 - PIN12 (input pullup). - * PC13 - PIN13 (input pullup). - * PC14 - PIN14 (input floating). - * PC15 - PIN15 (input floating). - */ -#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ - PIN_MODE_INPUT(GPIOC_PIN1) | \ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PIN3) | \ - PIN_MODE_INPUT(GPIOC_PIN4) | \ - PIN_MODE_INPUT(GPIOC_PIN5) | \ - PIN_MODE_INPUT(GPIOC_PIN6) | \ - PIN_MODE_INPUT(GPIOC_PIN7) | \ - PIN_MODE_INPUT(GPIOC_PIN8) | \ - PIN_MODE_INPUT(GPIOC_PIN9) | \ - PIN_MODE_INPUT(GPIOC_PIN10) | \ - PIN_MODE_INPUT(GPIOC_PIN11) | \ - PIN_MODE_INPUT(GPIOC_PIN12) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_PIN14) | \ - PIN_MODE_INPUT(GPIOC_PIN15)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ - PIN_OSPEED_HIGH(GPIOC_PIN14) | \ - PIN_OSPEED_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN15)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ - PIN_ODR_HIGH(GPIOC_PIN1) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PIN3) | \ - PIN_ODR_HIGH(GPIOC_PIN4) | \ - PIN_ODR_HIGH(GPIOC_PIN5) | \ - PIN_ODR_HIGH(GPIOC_PIN6) | \ - PIN_ODR_HIGH(GPIOC_PIN7) | \ - PIN_ODR_HIGH(GPIOC_PIN8) | \ - PIN_ODR_HIGH(GPIOC_PIN9) | \ - PIN_ODR_HIGH(GPIOC_PIN10) | \ - PIN_ODR_HIGH(GPIOC_PIN11) | \ - PIN_ODR_HIGH(GPIOC_PIN12) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_PIN14) | \ - PIN_ODR_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ - PIN_AFIO_AF(GPIOC_PIN1, 0) | \ - PIN_AFIO_AF(GPIOC_PIN2, 0) | \ - PIN_AFIO_AF(GPIOC_PIN3, 0) | \ - PIN_AFIO_AF(GPIOC_PIN4, 0) | \ - PIN_AFIO_AF(GPIOC_PIN5, 0) | \ - PIN_AFIO_AF(GPIOC_PIN6, 0) | \ - PIN_AFIO_AF(GPIOC_PIN7, 0)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ - PIN_AFIO_AF(GPIOC_PIN9, 0) | \ - PIN_AFIO_AF(GPIOC_PIN10, 0) | \ - PIN_AFIO_AF(GPIOC_PIN11, 0) | \ - PIN_AFIO_AF(GPIOC_PIN12, 0) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0) | \ - PIN_AFIO_AF(GPIOC_PIN14, 0) | \ - PIN_AFIO_AF(GPIOC_PIN15, 0)) - -/* - * GPIOD setup: - * - * PD0 - PIN0 (input pullup). - * PD1 - PIN1 (input pullup). - * PD2 - PIN2 (input pullup). - * PD3 - PIN3 (input pullup). - * PD4 - PIN4 (input pullup). - * PD5 - PIN5 (input pullup). - * PD6 - PIN6 (input pullup). - * PD7 - PIN7 (input pullup). - * PD8 - PIN8 (input pullup). - * PD9 - PIN9 (input pullup). - * PD11 - PIN10 (input pullup). - * PD11 - PIN11 (input pullup). - * PD12 - PIN12 (input pullup). - * PD13 - PIN13 (input pullup). - * PD14 - PIN14 (input pullup). - * PD15 - PIN15 (input pullup). - */ -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ - PIN_MODE_INPUT(GPIOD_PIN1) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_INPUT(GPIOD_PIN4) | \ - PIN_MODE_INPUT(GPIOD_PIN5) | \ - PIN_MODE_INPUT(GPIOD_PIN6) | \ - PIN_MODE_INPUT(GPIOD_PIN7) | \ - PIN_MODE_INPUT(GPIOD_PIN8) | \ - PIN_MODE_INPUT(GPIOD_PIN9) | \ - PIN_MODE_INPUT(GPIOD_PIN10) | \ - PIN_MODE_INPUT(GPIOD_PIN11) | \ - PIN_MODE_INPUT(GPIOD_PIN12) | \ - PIN_MODE_INPUT(GPIOD_PIN13) | \ - PIN_MODE_INPUT(GPIOD_PIN14) | \ - PIN_MODE_INPUT(GPIOD_PIN15)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN15)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN15)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ - PIN_ODR_HIGH(GPIOD_PIN1) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_PIN4) | \ - PIN_ODR_HIGH(GPIOD_PIN5) | \ - PIN_ODR_HIGH(GPIOD_PIN6) | \ - PIN_ODR_HIGH(GPIOD_PIN7) | \ - PIN_ODR_HIGH(GPIOD_PIN8) | \ - PIN_ODR_HIGH(GPIOD_PIN9) | \ - PIN_ODR_HIGH(GPIOD_PIN10) | \ - PIN_ODR_HIGH(GPIOD_PIN11) | \ - PIN_ODR_HIGH(GPIOD_PIN12) | \ - PIN_ODR_HIGH(GPIOD_PIN13) | \ - PIN_ODR_HIGH(GPIOD_PIN14) | \ - PIN_ODR_HIGH(GPIOD_PIN15)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ - PIN_AFIO_AF(GPIOD_PIN1, 0) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0) | \ - PIN_AFIO_AF(GPIOD_PIN4, 0) | \ - PIN_AFIO_AF(GPIOD_PIN5, 0) | \ - PIN_AFIO_AF(GPIOD_PIN6, 0) | \ - PIN_AFIO_AF(GPIOD_PIN7, 0)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ - PIN_AFIO_AF(GPIOD_PIN9, 0) | \ - PIN_AFIO_AF(GPIOD_PIN10, 0) | \ - PIN_AFIO_AF(GPIOD_PIN11, 0) | \ - PIN_AFIO_AF(GPIOD_PIN12, 0) | \ - PIN_AFIO_AF(GPIOD_PIN13, 0) | \ - PIN_AFIO_AF(GPIOD_PIN14, 0) | \ - PIN_AFIO_AF(GPIOD_PIN15, 0)) - -/* - * GPIOE setup: - * - * PE0 - PIN0 (input pullup). - * PE1 - PIN1 (input pullup). - * PE2 - PIN2 (input pullup). - * PE3 - PIN3 L3GD20_CS (output pushpull maximum). - * PE4 - PIN4 (input pullup). - * PE5 - PIN5 (input pullup). - * PE6 - PIN6 (input pullup). - * PE7 - PIN7 (input pullup). - * PE8 - PIN8 (output pushpull maximum). - * PE9 - PIN9 (output pushpull maximum). - * PE10 - PIN10 (output pushpull maximum). - * PE11 - PIN11 (output pushpull maximum). - * PE12 - PIN12 (output pushpull maximum). - * PE13 - PIN13 (output pushpull maximum). - * PE14 - PIN14 (output pushpull maximum). - * PE15 - PIN15 (output pushpull maximum). - */ -#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ - PIN_MODE_INPUT(GPIOE_PIN1) | \ - PIN_MODE_INPUT(GPIOE_PIN2) |\ - PIN_MODE_OUTPUT(GPIOE_PIN3) | \ - PIN_MODE_INPUT(GPIOE_PIN4) |\ - PIN_MODE_INPUT(GPIOE_PIN5) |\ - PIN_MODE_INPUT(GPIOE_PIN6) | \ - PIN_MODE_INPUT(GPIOE_PIN7) | \ - PIN_MODE_OUTPUT(GPIOE_PIN8) | \ - PIN_MODE_OUTPUT(GPIOE_PIN9) | \ - PIN_MODE_OUTPUT(GPIOE_PIN10) | \ - PIN_MODE_OUTPUT(GPIOE_PIN11) | \ - PIN_MODE_OUTPUT(GPIOE_PIN12) | \ - PIN_MODE_OUTPUT(GPIOE_PIN13) | \ - PIN_MODE_OUTPUT(GPIOE_PIN14) | \ - PIN_MODE_OUTPUT(GPIOE_PIN15)) -#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ - PIN_OSPEED_HIGH(GPIOE_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ - PIN_OSPEED_HIGH(GPIOE_PIN8) | \ - PIN_OSPEED_HIGH(GPIOE_PIN9) | \ - PIN_OSPEED_HIGH(GPIOE_PIN10) | \ - PIN_OSPEED_HIGH(GPIOE_PIN11) | \ - PIN_OSPEED_HIGH(GPIOE_PIN12) | \ - PIN_OSPEED_HIGH(GPIOE_PIN13) | \ - PIN_OSPEED_HIGH(GPIOE_PIN14) | \ - PIN_OSPEED_HIGH(GPIOE_PIN15)) -#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ - PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ - PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ - PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ - PIN_PUPDR_FLOATING(GPIOE_PIN15)) -#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ - PIN_ODR_HIGH(GPIOE_PIN1) | \ - PIN_ODR_HIGH(GPIOE_PIN2) | \ - PIN_ODR_HIGH(GPIOE_PIN3) | \ - PIN_ODR_HIGH(GPIOE_PIN4) | \ - PIN_ODR_HIGH(GPIOE_PIN5) | \ - PIN_ODR_HIGH(GPIOE_PIN6) | \ - PIN_ODR_HIGH(GPIOE_PIN7) | \ - PIN_ODR_LOW(GPIOE_PIN8) | \ - PIN_ODR_LOW(GPIOE_PIN9) | \ - PIN_ODR_LOW(GPIOE_PIN10) | \ - PIN_ODR_LOW(GPIOE_PIN11) | \ - PIN_ODR_LOW(GPIOE_PIN12) | \ - PIN_ODR_LOW(GPIOE_PIN13) | \ - PIN_ODR_LOW(GPIOE_PIN14) | \ - PIN_ODR_LOW(GPIOE_PIN15)) -#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ - PIN_AFIO_AF(GPIOE_PIN1, 0) | \ - PIN_AFIO_AF(GPIOE_PIN2, 0) |\ - PIN_AFIO_AF(GPIOE_PIN3, 0) | \ - PIN_AFIO_AF(GPIOE_PIN4, 0) |\ - PIN_AFIO_AF(GPIOE_PIN5, 0) |\ - PIN_AFIO_AF(GPIOE_PIN6, 0) | \ - PIN_AFIO_AF(GPIOE_PIN7, 0)) -#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ - PIN_AFIO_AF(GPIOE_PIN9, 0) | \ - PIN_AFIO_AF(GPIOE_PIN10, 0) | \ - PIN_AFIO_AF(GPIOE_PIN11, 0) | \ - PIN_AFIO_AF(GPIOE_PIN12, 0) | \ - PIN_AFIO_AF(GPIOE_PIN13, 0) | \ - PIN_AFIO_AF(GPIOE_PIN14, 0) | \ - PIN_AFIO_AF(GPIOE_PIN15, 0)) - -/* - * GPIOF setup: - * - * PF0 - I2C2_SDA (input floating). - * PF1 - I2C2_SCL (input floating). - * PF2 - PIN2 (input pullup). - * PF3 - PIN3 (input pullup). - * PF4 - PIN4 (input pullup). - * PF5 - PIN5 (input pullup). - * PF6 - PIN6 (input pullup). - * PF7 - PIN7 (input pullup). - * PF8 - PIN8 (input pullup). - * PF9 - PIN9 (input pullup). - * PF10 - PIN10 (input pullup). - * PF11 - PIN11 (input pullup). - * PF12 - PIN12 (input pullup). - * PF13 - PIN13 (input pullup). - * PF14 - PIN14 (input pullup). - * PF15 - PIN15 (input pullup). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ - PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_PIN7) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ - PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ - PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ - PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ - PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_PIN7) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ - PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0) | \ - PIN_AFIO_AF(GPIOF_PIN7, 0)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0)) - -/* - * GPIOG setup: - * - * PG0 - PIN0 (input pullup). - * PG1 - PIN1 (input pullup). - * PG2 - PIN2 (input pullup). - * PG3 - PIN3 (input pullup). - * PG4 - PIN4 (input pullup). - * PG5 - PIN5 (input pullup). - * PG6 - PIN6 (input pullup). - * PG7 - PIN7 (input pullup). - * PG8 - PIN8 (input pullup). - * PG9 - PIN9 (input pullup). - * PG10 - PIN10 (input pullup). - * PG11 - PIN11 (input pullup). - * PG12 - PIN12 (input pullup). - * PG13 - PIN13 (input pullup). - * PG14 - PIN14 (input pullup). - * PG15 - PIN15 (input pullup). - */ -#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ - PIN_MODE_INPUT(GPIOG_PIN1) | \ - PIN_MODE_INPUT(GPIOG_PIN2) | \ - PIN_MODE_INPUT(GPIOG_PIN3) | \ - PIN_MODE_INPUT(GPIOG_PIN4) | \ - PIN_MODE_INPUT(GPIOG_PIN5) | \ - PIN_MODE_INPUT(GPIOG_PIN6) | \ - PIN_MODE_INPUT(GPIOG_PIN7) | \ - PIN_MODE_INPUT(GPIOG_PIN8) | \ - PIN_MODE_INPUT(GPIOG_PIN9) | \ - PIN_MODE_INPUT(GPIOG_PIN10) | \ - PIN_MODE_INPUT(GPIOG_PIN11) | \ - PIN_MODE_INPUT(GPIOG_PIN12) | \ - PIN_MODE_INPUT(GPIOG_PIN13) | \ - PIN_MODE_INPUT(GPIOG_PIN14) | \ - PIN_MODE_INPUT(GPIOG_PIN15)) -#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN15)) -#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN15)) -#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ - PIN_ODR_HIGH(GPIOG_PIN1) | \ - PIN_ODR_HIGH(GPIOG_PIN2) | \ - PIN_ODR_HIGH(GPIOG_PIN3) | \ - PIN_ODR_HIGH(GPIOG_PIN4) | \ - PIN_ODR_HIGH(GPIOG_PIN5) | \ - PIN_ODR_HIGH(GPIOG_PIN6) | \ - PIN_ODR_HIGH(GPIOG_PIN7) | \ - PIN_ODR_HIGH(GPIOG_PIN8) | \ - PIN_ODR_HIGH(GPIOG_PIN9) | \ - PIN_ODR_HIGH(GPIOG_PIN10) | \ - PIN_ODR_HIGH(GPIOG_PIN11) | \ - PIN_ODR_HIGH(GPIOG_PIN12) | \ - PIN_ODR_HIGH(GPIOG_PIN13) | \ - PIN_ODR_HIGH(GPIOG_PIN14) | \ - PIN_ODR_HIGH(GPIOG_PIN15)) -#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ - PIN_AFIO_AF(GPIOG_PIN1, 0) | \ - PIN_AFIO_AF(GPIOG_PIN2, 0) | \ - PIN_AFIO_AF(GPIOG_PIN3, 0) | \ - PIN_AFIO_AF(GPIOG_PIN4, 0) | \ - PIN_AFIO_AF(GPIOG_PIN5, 0) | \ - PIN_AFIO_AF(GPIOG_PIN6, 0) | \ - PIN_AFIO_AF(GPIOG_PIN7, 0)) -#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ - PIN_AFIO_AF(GPIOG_PIN9, 0) | \ - PIN_AFIO_AF(GPIOG_PIN10, 0) | \ - PIN_AFIO_AF(GPIOG_PIN11, 0) | \ - PIN_AFIO_AF(GPIOG_PIN12, 0) | \ - PIN_AFIO_AF(GPIOG_PIN13, 0) | \ - PIN_AFIO_AF(GPIOG_PIN14, 0) | \ - PIN_AFIO_AF(GPIOG_PIN15, 0)) - -/* - * GPIOH setup: - * - * PH0 - PIN0 (input pullup). - * PH1 - PIN1 (input pullup). - * PH2 - PIN2 (input pullup). - * PH3 - PIN3 (input pullup). - * PH4 - PIN4 (input pullup). - * PH5 - PIN5 (input pullup). - * PH6 - PIN6 (input pullup). - * PH7 - PIN7 (input pullup). - * PH8 - PIN8 (input pullup). - * PH9 - PIN9 (input pullup). - * PH10 - PIN10 (input pullup). - * PH11 - PIN11 (input pullup). - * PH12 - PIN12 (input pullup). - * PH13 - PIN13 (input pullup). - * PH14 - PIN14 (input pullup). - * PH15 - PIN15 (input pullup). - */ -#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ - PIN_MODE_INPUT(GPIOH_PIN1) | \ - PIN_MODE_INPUT(GPIOH_PIN2) | \ - PIN_MODE_INPUT(GPIOH_PIN3) | \ - PIN_MODE_INPUT(GPIOH_PIN4) | \ - PIN_MODE_INPUT(GPIOH_PIN5) | \ - PIN_MODE_INPUT(GPIOH_PIN6) | \ - PIN_MODE_INPUT(GPIOH_PIN7) | \ - PIN_MODE_INPUT(GPIOH_PIN8) | \ - PIN_MODE_INPUT(GPIOH_PIN9) | \ - PIN_MODE_INPUT(GPIOH_PIN10) | \ - PIN_MODE_INPUT(GPIOH_PIN11) | \ - PIN_MODE_INPUT(GPIOH_PIN12) | \ - PIN_MODE_INPUT(GPIOH_PIN13) | \ - PIN_MODE_INPUT(GPIOH_PIN14) | \ - PIN_MODE_INPUT(GPIOH_PIN15)) -#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN15)) -#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN15)) -#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ - PIN_ODR_HIGH(GPIOH_PIN1) | \ - PIN_ODR_HIGH(GPIOH_PIN2) | \ - PIN_ODR_HIGH(GPIOH_PIN3) | \ - PIN_ODR_HIGH(GPIOH_PIN4) | \ - PIN_ODR_HIGH(GPIOH_PIN5) | \ - PIN_ODR_HIGH(GPIOH_PIN6) | \ - PIN_ODR_HIGH(GPIOH_PIN7) | \ - PIN_ODR_HIGH(GPIOH_PIN8) | \ - PIN_ODR_HIGH(GPIOH_PIN9) | \ - PIN_ODR_HIGH(GPIOH_PIN10) | \ - PIN_ODR_HIGH(GPIOH_PIN11) | \ - PIN_ODR_HIGH(GPIOH_PIN12) | \ - PIN_ODR_HIGH(GPIOH_PIN13) | \ - PIN_ODR_HIGH(GPIOH_PIN14) | \ - PIN_ODR_HIGH(GPIOH_PIN15)) -#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ - PIN_AFIO_AF(GPIOH_PIN1, 0) | \ - PIN_AFIO_AF(GPIOH_PIN2, 0) | \ - PIN_AFIO_AF(GPIOH_PIN3, 0) | \ - PIN_AFIO_AF(GPIOH_PIN4, 0) | \ - PIN_AFIO_AF(GPIOH_PIN5, 0) | \ - PIN_AFIO_AF(GPIOH_PIN6, 0) | \ - PIN_AFIO_AF(GPIOH_PIN7, 0)) -#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ - PIN_AFIO_AF(GPIOH_PIN9, 0) | \ - PIN_AFIO_AF(GPIOH_PIN10, 0) | \ - PIN_AFIO_AF(GPIOH_PIN11, 0) | \ - PIN_AFIO_AF(GPIOH_PIN12, 0) | \ - PIN_AFIO_AF(GPIOH_PIN13, 0) | \ - PIN_AFIO_AF(GPIOH_PIN14, 0) | \ - PIN_AFIO_AF(GPIOH_PIN15, 0)) - - -/* - * USB bus activation macro, required by the USB driver. - */ -// #define usb_lld_connect_bus(usbp) -#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) -// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) -/* - * USB bus de-activation macro, required by the USB driver. - */ -// #define usb_lld_disconnect_bus(usbp) -#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) -// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/keyboards/preonic/rev3/chconf.h b/keyboards/preonic/rev3/chconf.h deleted file mode 100644 index b52ca7d2c87..00000000000 --- a/keyboards/preonic/rev3/chconf.h +++ /dev/null @@ -1,520 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 16 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 10000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 0 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM TRUE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY TRUE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief Trace buffer entries. - * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - * different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE 128 - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK TRUE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ - /* IRQ prologue code here.*/ \ -} - -/** - * @brief ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ - /* IRQ epilogue code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ - /* Idle-enter code here.*/ \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ - /* Idle-leave code here.*/ \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** - * @brief Trace hook. - * @details This hook is invoked each time a new record is written in the - * trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) { \ - /* Trace code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* CHCONF_H */ - -/** @} */ diff --git a/keyboards/preonic/rev3/config.h b/keyboards/preonic/rev3/config.h index 98899dc6ac7..2d299345535 100644 --- a/keyboards/preonic/rev3/config.h +++ b/keyboards/preonic/rev3/config.h @@ -43,12 +43,15 @@ * #define UNUSED_PINS */ +#define ENCODERS_PAD_A { B12 } +#define ENCODERS_PAD_B { B13 } + #define MUSIC_MAP #undef AUDIO_VOICES #undef C6_AUDIO /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 6 +// #define DEBOUNCE 6 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE @@ -76,11 +79,6 @@ */ //#define FORCE_NKRO -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/preonic/rev3/info.json b/keyboards/preonic/rev3/info.json new file mode 100644 index 00000000000..b1ad1227e1a --- /dev/null +++ b/keyboards/preonic/rev3/info.json @@ -0,0 +1,330 @@ +{ + "keyboard_name": "Preonic rev. 3", + "keyboard_folder": "preonic/rev3", + "url": "https://olkb.com/preonic", + "maintainer": "jackhumbert", + "width": 12, + "height": 5, + "layouts": { + "LAYOUT_preonic_1x2uC": { + "key_count": 59, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4}, + {"label":"k45", "x":5, "y":4, "w":2}, + {"label":"k47", "x":7, "y":4}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + }, + "LAYOUT_preonic_1x2uR": { + "key_count": 59, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4}, + {"label":"k45", "x":5, "y":4}, + {"label":"k47", "x":6, "y":4, "w":2}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + }, + "LAYOUT_preonic_1x2uL": { + "key_count": 59, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4, "w":2}, + {"label":"k46", "x":6, "y":4}, + {"label":"k47", "x":7, "y":4}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + }, + "LAYOUT_preonic_2x2u": { + "key_count": 58, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4, "w":2}, + {"label":"k46", "x":6, "y":4, "w":2}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + }, + "LAYOUT_ortho_5x12": { + "key_count": 60, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4}, + {"label":"k45", "x":5, "y":4}, + {"label":"k46", "x":6, "y":4}, + {"label":"k47", "x":7, "y":4}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + } + } +} diff --git a/keyboards/preonic/rev3/matrix.c b/keyboards/preonic/rev3/matrix.c index 05f6da71b67..db7a4f2a3a6 100644 --- a/keyboards/preonic/rev3/matrix.c +++ b/keyboards/preonic/rev3/matrix.c @@ -21,10 +21,6 @@ static matrix_col_t matrix_debouncing[MATRIX_COLS]; static bool debouncing = false; static uint16_t debouncing_time = 0; -static uint8_t encoder_state = 0; -static int8_t encoder_value = 0; -static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; - static bool dip_switch[4] = {0, 0, 0, 0}; __attribute__ ((weak)) @@ -53,12 +49,6 @@ void matrix_init(void) { palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOB, 9, PAL_MODE_INPUT_PULLUP); - // encoder setup - palSetPadMode(GPIOB, 12, PAL_MODE_INPUT_PULLUP); - palSetPadMode(GPIOB, 13, PAL_MODE_INPUT_PULLUP); - - encoder_state = (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1); - // actual matrix setup palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL); @@ -110,18 +100,6 @@ uint8_t matrix_scan(void) { } memcpy(last_dip_switch, dip_switch, sizeof(&dip_switch)); - // encoder on B12 and B13 - encoder_state <<= 2; - encoder_state |= (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1); - encoder_value += encoder_LUT[encoder_state & 0xF]; - if (encoder_value >= ENCODER_RESOLUTION) { - encoder_update(0); - } - if (encoder_value <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise - encoder_update(1); - } - encoder_value %= ENCODER_RESOLUTION; - // actual matrix for (int col = 0; col < MATRIX_COLS; col++) { matrix_col_t data = 0; diff --git a/keyboards/preonic/rev3/mcuconf.h b/keyboards/preonic/rev3/mcuconf.h deleted file mode 100644 index 2d27bee4e6c..00000000000 --- a/keyboards/preonic/rev3/mcuconf.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef MCUCONF_H -#define MCUCONF_H - -/* - * STM32F3xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F3xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PREDIV_VALUE 1 -#define STM32_PLLMUL_VALUE 9 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 -#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 -#define STM32_USART1SW STM32_USART1SW_PCLK -#define STM32_USART2SW STM32_USART2SW_PCLK -#define STM32_USART3SW STM32_USART3SW_PCLK -#define STM32_UART4SW STM32_UART4SW_PCLK -#define STM32_UART5SW STM32_UART5SW_PCLK -#define STM32_I2C1SW STM32_I2C1SW_SYSCLK -#define STM32_I2C2SW STM32_I2C2SW_SYSCLK -#define STM32_TIM1SW STM32_TIM1SW_PCLK2 -#define STM32_TIM8SW STM32_TIM8SW_PCLK2 -#define STM32_RTCSEL STM32_RTCSEL_LSI -#define STM32_USB_CLOCK_REQUIRED TRUE -#define STM32_USBPRE STM32_USBPRE_DIV1P5 - -#undef STM32_HSE_BYPASS -// #error "oh no" -// #endif - -/* - * ADC driver system settings. - */ -#define STM32_ADC_DUAL_MODE FALSE -#define STM32_ADC_COMPACT_SAMPLES FALSE -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_USE_ADC2 FALSE -#define STM32_ADC_USE_ADC3 FALSE -#define STM32_ADC_USE_ADC4 FALSE -#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) -#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) -#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) -#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC2_DMA_PRIORITY 2 -#define STM32_ADC_ADC3_DMA_PRIORITY 2 -#define STM32_ADC_ADC4_DMA_PRIORITY 2 -#define STM32_ADC_ADC12_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 -#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * DAC driver system settings. - */ -#define STM32_DAC_DUAL_MODE FALSE -#define STM32_DAC_USE_DAC1_CH1 TRUE -#define STM32_DAC_USE_DAC1_CH2 TRUE -#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM6 TRUE -#define STM32_GPT_USE_TIM7 TRUE -#define STM32_GPT_USE_TIM8 TRUE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM6_IRQ_PRIORITY 7 -#define STM32_GPT_TIM7_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 10 -#define STM32_I2C_I2C2_IRQ_PRIORITY 10 -#define STM32_I2C_USE_DMA TRUE -#define STM32_I2C_I2C1_DMA_PRIORITY 1 -#define STM32_I2C_I2C2_DMA_PRIORITY 1 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 TRUE -#define STM32_PWM_USE_TIM3 TRUE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 4 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_USB1 TRUE -#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 -#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 - -/* - * WDG driver system settings. - */ -#define STM32_WDG_USE_IWDG FALSE - -#endif /* MCUCONF_H */ diff --git a/keyboards/preonic/rev3/rev3.h b/keyboards/preonic/rev3/rev3.h index 7c274ae2705..af97239fd11 100644 --- a/keyboards/preonic/rev3/rev3.h +++ b/keyboards/preonic/rev3/rev3.h @@ -13,9 +13,111 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef REV3_H -#define REV3_H + +#pragma once #include "preonic.h" +#ifndef __AVR__ // Preonic rev. 3 and later + + #define LAYOUT_preonic_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k45, k47, k48, k43, k44, k45 } \ + } + + #define LAYOUT_preonic_1x2uR( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k47, k47, k48, k43, k44, k45 } \ + } + + #define LAYOUT_preonic_1x2uL( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k46, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k44 } \ + } + + #define LAYOUT_preonic_2x2u( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k46, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k46, k48, k43, k44, k44 } \ + } + + #define LAYOUT_preonic_grid( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k45 } \ + } + #endif diff --git a/keyboards/preonic/rev3/rules.mk b/keyboards/preonic/rev3/rules.mk index 7c40d514d26..39e69872c9a 100644 --- a/keyboards/preonic/rev3/rules.mk +++ b/keyboards/preonic/rev3/rules.mk @@ -1,56 +1,34 @@ # project specific files -SRC = matrix.c -LAYOUTS += ortho_5x12 - -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F3xx - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -MCU_LDSCRIPT = STM32F303xC - -# Startup code to use -# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f3xx - -# Board: it should exist either in /os/hal/boards/ -# or /boards -BOARD = GENERIC_STM32_F303XC +SRC = matrix.c # Cortex version -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -ARMV = 7 - -USE_FPU = yes - -# Vector table for application -# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ -# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB -# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 -OPT_DEFS = - -# Options to pass to dfu-util when flashing -DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +MCU = STM32F303 # Build Options -# comment out to disable the options. +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically # -BACKLIGHT_ENABLE = no -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) ## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +#SLEEP_LED_ENABLE = yes + CUSTOM_MATRIX = yes # Custom matrix file -AUDIO_ENABLE = yes -RGBLIGHT_ENABLE = no # SERIAL_LINK_ENABLE = yes +ENCODER_ENABLE = yes + +LAYOUTS = ortho_5x12 diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk deleted file mode 100644 index d5b21388af5..00000000000 --- a/keyboards/preonic/rules.mk +++ /dev/null @@ -1,76 +0,0 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -ifeq ($(strip $(KEYBOARD)), preonic/rev1) - BOOTLOADER = atmel-dfu -endif -ifeq ($(strip $(KEYBOARD)), preonic/rev2) - BOOTLOADER = qmk-dfu -endif - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -API_SYSEX_ENABLE = no - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -LAYOUTS = ortho_5x12 - -DEFAULT_FOLDER = preonic/rev2 \ No newline at end of file diff --git a/keyboards/primekb/prime_e/config.h b/keyboards/primekb/prime_e/config.h new file mode 100644 index 00000000000..9ef4edd88a4 --- /dev/null +++ b/keyboards/primekb/prime_e/config.h @@ -0,0 +1,72 @@ +/* +Copyright 2019 Holten Campbell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5052 +#define PRODUCT_ID 0x0051 +#define DEVICE_VER 0x0001 +#define MANUFACTURER PrimeKB +#define PRODUCT Prime_E +#define DESCRIPTION Ergo_45 + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +/* Keyboard Matrix Assignments */ +#define MATRIX_ROW_PINS { E6, C7, B5, B4 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, D6, D4, D5, D3, D2, D1, D0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 5 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*13*4*2)) = (35+416) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 451 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 573 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/primekb/prime_e/info.json b/keyboards/primekb/prime_e/info.json new file mode 100644 index 00000000000..0cca27565cd --- /dev/null +++ b/keyboards/primekb/prime_e/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Prime_E", + "url": "https://www.primekb.com", + "maintainer": "holtenc", + "width": 13, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"x":0,"y":0,"w":1,"h":1}, {"x":1,"y":0,"w":1,"h":1}, {"x":2,"y":0,"w":1,"h":1}, {"x":3,"y":0,"w":1,"h":1}, {"x":4,"y":0,"w":1,"h":1}, {"x":5,"y":0,"w":1,"h":1}, {"x":7,"y":0,"w":1,"h":1}, {"x":8,"y":0,"w":1,"h":1}, {"x":9,"y":0,"w":1,"h":1}, {"x":10,"y":0,"w":1,"h":1}, {"x":11,"y":0,"w":1,"h":1}, {"x":12,"y":0,"w":1,"h":1}, {"x":13,"y":0,"w":1,"h":1}, + {"x":0,"y":1,"w":1.25,"h":1}, {"x":1.25,"y":1,"w":1,"h":1}, {"x":2.25,"y":1,"w":1,"h":1}, {"x":3.25,"y":1,"w":1,"h":1}, {"x":4.25,"y":1,"w":1,"h":1}, {"x":5.25,"y":1,"w":1,"h":1}, {"x":7.25,"y":1,"w":1,"h":1}, {"x":8.25,"y":1,"w":1,"h":1}, {"x":9.25,"y":1,"w":1,"h":1}, {"x":10.25,"y":1,"w":1,"h":1}, {"x":11.25,"y":1,"w":1,"h":1}, {"x":12.25,"y":1,"w":1.75,"h":1}, + {"x":0,"y":2,"w":1.75,"h":1}, {"x":1.75,"y":2,"w":1,"h":1}, {"x":2.75,"y":2,"w":1,"h":1}, {"x":3.75,"y":2,"w":1,"h":1}, {"x":4.75,"y":2,"w":1,"h":1}, {"x":5.75,"y":2,"w":1,"h":1}, {"x":6.75,"y":2,"w":1,"h":1}, {"x":7.75,"y":2,"w":1,"h":1}, {"x":8.75,"y":2,"w":1,"h":1}, {"x":9.75,"y":2,"w":1,"h":1}, {"x":10.75,"y":2,"w":1,"h":1}, {"x":11.75,"y":2,"w":1,"h":1}, {"x":12.75,"y":2,"w":1.25,"h":1}, + {"x":0,"y":3,"w":1.25,"h":1}, {"x":1.25,"y":3,"w":1.25,"h":1}, {"x":3.5,"y":3,"w":1.25,"h":1}, {"x":4.75,"y":3,"w":2,"h":1}, {"x":6.75,"y":3,"w":2.25,"h":1}, {"x":9,"y":3,"w":1.25,"h":1}, {"x":11.5,"y":3,"w":1.25,"h":1}, {"x":12.75,"y":3,"w":1.25,"h":1} + ] + } + } +} diff --git a/keyboards/primekb/prime_e/keymaps/default/keymap.c b/keyboards/primekb/prime_e/keymaps/default/keymap.c new file mode 100644 index 00000000000..5a09cb9694c --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/default/keymap.c @@ -0,0 +1,94 @@ +/* Copyright 2018 Holten Campbell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(3), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_LCTL, KC_LALT, MO(2), MO(1), KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + + LAYOUT( + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_SCLN, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + LAYOUT( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_LBRC, KC_RBRC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PENT, KC_PDOT, KC_TRNS, KC_TRNS + ), + + LAYOUT( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +void matrix_init_user(void) { + // set CapsLock LED to output and low + setPinOutput(B1); + writePinLow(B1); + // set NumLock LED to output and low + setPinOutput(B2); + writePinLow(B2); + // set ScrollLock LED to output and low + setPinOutput(B3); + writePinLow(B3); +} + +void matrix_scan_user(void) { + +} + + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(B2); + } else { + writePinLow(B2); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(B1); + } else { + writePinLow(B1); + } +/* + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(B3); + } else { + writePinLow(B3); + }*/ + +} + +//function for layer indicator LED +uint32_t layer_state_set_user(uint32_t state) +{ + if (biton32(state) == 1) { + writePinHigh(B3); + } else { + writePinLow(B3); + } + return state; +} diff --git a/keyboards/primekb/prime_e/keymaps/default/readme.md b/keyboards/primekb/prime_e/keymaps/default/readme.md new file mode 100644 index 00000000000..5266526eec9 --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The default keymap for Prime_E +This is the default keymap for Prime_E. \ No newline at end of file diff --git a/keyboards/primekb/prime_e/keymaps/jetpacktuxedo/keymap.c b/keyboards/primekb/prime_e/keymaps/jetpacktuxedo/keymap.c new file mode 100644 index 00000000000..134d09c6bef --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/jetpacktuxedo/keymap.c @@ -0,0 +1,79 @@ +/* Copyright 2018 Holten Campbell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_DEL, + LT(2, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(2, KC_ENT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, LT(3, KC_B), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, LT(1, KC_SPC), LT(1, KC_SPC), KC_RALT, KC_RGUI, KC_RCTL + ), + + [1] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_TRNS, + KC_TRNS, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_QUOT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [2] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, KC_TRNS, + KC_TRNS, KC_UNDS, KC_PLUS, KC_COLN, KC_DQUO, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_DQUO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [3] = LAYOUT( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +void matrix_init_user(void) { + // set CapsLock LED to output and low + setPinOutput(B1); + writePinLow(B1); + // set NumLock LED to output and low + setPinOutput(B2); + writePinLow(B2); + // set ScrollLock LED to output and low + setPinOutput(B3); + writePinLow(B3); +} + +//function for layer indicator LED +uint32_t layer_state_set_user(uint32_t state) +{ + if (state & (1<<1)) { + writePinHigh(B1); + } else { + writePinLow(B1); + } + if (state & (1<<2)) { + writePinHigh(B2); + } else { + writePinLow(B2); + } + if (state & (1<<3)) { + writePinHigh(B3); + } else { + writePinLow(B3); + } + return state; +} diff --git a/keyboards/primekb/prime_e/keymaps/via/keymap.c b/keyboards/primekb/prime_e/keymaps/via/keymap.c new file mode 100644 index 00000000000..5a09cb9694c --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/via/keymap.c @@ -0,0 +1,94 @@ +/* Copyright 2018 Holten Campbell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(3), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_LCTL, KC_LALT, MO(2), MO(1), KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + + LAYOUT( + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_SCLN, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + LAYOUT( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_LBRC, KC_RBRC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PENT, KC_PDOT, KC_TRNS, KC_TRNS + ), + + LAYOUT( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +void matrix_init_user(void) { + // set CapsLock LED to output and low + setPinOutput(B1); + writePinLow(B1); + // set NumLock LED to output and low + setPinOutput(B2); + writePinLow(B2); + // set ScrollLock LED to output and low + setPinOutput(B3); + writePinLow(B3); +} + +void matrix_scan_user(void) { + +} + + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(B2); + } else { + writePinLow(B2); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(B1); + } else { + writePinLow(B1); + } +/* + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(B3); + } else { + writePinLow(B3); + }*/ + +} + +//function for layer indicator LED +uint32_t layer_state_set_user(uint32_t state) +{ + if (biton32(state) == 1) { + writePinHigh(B3); + } else { + writePinLow(B3); + } + return state; +} diff --git a/keyboards/primekb/prime_e/keymaps/via/readme.md b/keyboards/primekb/prime_e/keymaps/via/readme.md new file mode 100644 index 00000000000..bbd56c0cc71 --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/via/readme.md @@ -0,0 +1,2 @@ +# The VIA keymap for Prime_E +This keymap is for compatibility with the VIA configurator. \ No newline at end of file diff --git a/keyboards/primekb/prime_e/keymaps/via/rules.mk b/keyboards/primekb/prime_e/keymaps/via/rules.mk new file mode 100644 index 00000000000..c981a2f2614 --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/via/rules.mk @@ -0,0 +1,85 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# This is the VIA magic +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +SRC += keyboards/wilba_tech/wt_main.c \ No newline at end of file diff --git a/keyboards/primekb/prime_e/prime_e.c b/keyboards/primekb/prime_e/prime_e.c new file mode 100644 index 00000000000..bd51ce0087e --- /dev/null +++ b/keyboards/primekb/prime_e/prime_e.c @@ -0,0 +1,22 @@ +/* Copyright 2019 Holten Campbell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "prime_e.h" + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/primekb/prime_e/prime_e.h b/keyboards/primekb/prime_e/prime_e.h new file mode 100644 index 00000000000..4af70fbe177 --- /dev/null +++ b/keyboards/primekb/prime_e/prime_e.h @@ -0,0 +1,34 @@ +/* Copyright 2019 Holten Campbell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#pragma once + +#include "quantum.h" + + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K112, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K301, K303, K304, K306, K308, K311, K312 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, KC_NO, K112 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212 }, \ + { K300, K301, KC_NO, K303, K304, KC_NO, K306, KC_NO, K308, KC_NO, KC_NO, K311, K312 } \ +} + diff --git a/keyboards/primekb/prime_e/readme.md b/keyboards/primekb/prime_e/readme.md new file mode 100644 index 00000000000..6abe0bed019 --- /dev/null +++ b/keyboards/primekb/prime_e/readme.md @@ -0,0 +1,16 @@ +# Prime_E + +![Prime_E](https://imgur.com/7Rl4JOA.jpg) + +An ergonomic 45%. + +Keyboard Maintainer: [Holtenc](https://github.com/holtenc/) +Hardware Supported: Prime_E PCB, ATMega32u4 +Hardware Availability: Group Buy, Retail + +Make example for this keyboard (after setting up your build environment): + + make prime_e:default + make prime_e:via (when using VIA configurator) + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/primekb/prime_e/rules.mk b/keyboards/primekb/prime_e/rules.mk new file mode 100644 index 00000000000..579ddd11eb1 --- /dev/null +++ b/keyboards/primekb/prime_e/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) \ No newline at end of file diff --git a/keyboards/primekb/prime_l/config.h b/keyboards/primekb/prime_l/config.h index 8e245781666..786ceb59cda 100644 --- a/keyboards/primekb/prime_l/config.h +++ b/keyboards/primekb/prime_l/config.h @@ -36,7 +36,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D2, D3, D5, D4, D6, D7, B4, B5, C7, C6, F7, F6, F5, F4, F1, F0 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B6 @@ -44,14 +44,9 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 4 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) diff --git a/keyboards/primekb/prime_m/config.h b/keyboards/primekb/prime_m/config.h index 366504375e5..75731abf78f 100644 --- a/keyboards/primekb/prime_m/config.h +++ b/keyboards/primekb/prime_m/config.h @@ -36,7 +36,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B3, C7, C6, D2, D1, D0 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 @@ -44,14 +44,9 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 4 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) diff --git a/keyboards/primekb/prime_m/info.json b/keyboards/primekb/prime_m/info.json index 5332522022a..822823e62a9 100644 --- a/keyboards/primekb/prime_m/info.json +++ b/keyboards/primekb/prime_m/info.json @@ -1,3 +1,4 @@ + { "keyboard_name": "Prime_M", "url": "https://www.primekb.com", @@ -5,8 +6,43 @@ "width": 6, "height": 5, "layouts": { - "LAYOUT": { + "LAYOUT_ortho_5x6": { "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}] + }, + "LAYOUT_numpad_5x6": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":3, "y":1}, + {"x":4, "y":1}, + + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2}, + {"x":3, "y":2}, + {"x":4, "y":2}, + {"x":5, "y":1, "h":2}, + + {"x":0, "y":3}, + {"x":1, "y":3}, + {"x":2, "y":3}, + {"x":3, "y":3}, + {"x":4, "y":3}, + + {"x":0, "y":4}, + {"x":1, "y":4}, + {"x":2, "y":4, "w":2}, + {"x":4, "y":4}, + {"x":5, "y":3, "h":2} + ] } - } +} } diff --git a/keyboards/primekb/prime_m/keymaps/default/keymap.c b/keyboards/primekb/prime_m/keymaps/default/keymap.c index d230439d08e..6834624d83c 100644 --- a/keyboards/primekb/prime_m/keymaps/default/keymap.c +++ b/keyboards/primekb/prime_m/keymaps/default/keymap.c @@ -22,28 +22,28 @@ enum custom_keycodes { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( - KC_ESC, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, LT(2, KC_BSPC), - KC_F1, KC_F2, KC_P7, KC_P8, KC_P9, KC_DEL, - KC_F3, KC_F4, KC_P4, KC_P5, KC_P6, KC_PMNS, - KC_F5, KC_F6, KC_P1, KC_P2, KC_P3, KC_PPLS, - KC_LCTL, KC_LALT, TO(1), KC_P0, KC_PDOT, KC_ENT + [0] = LAYOUT_ortho_5x6( + KC_ESC, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, LT(2, KC_BSPC), + KC_F1, KC_F2, KC_P7, KC_P8, KC_P9, KC_DEL, + KC_F3, KC_F4, KC_P4, KC_P5, KC_P6, KC_PMNS, + KC_F5, KC_F6, KC_P1, KC_P2, KC_P3, KC_PPLS, + KC_LCTL, KC_LALT, TO(1), KC_P0, KC_PDOT, KC_PENT ), - [1] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, LT(2, KC_F9), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, - KC_LCTL, KC_LALT, TO(0), KC_P, KC_H, KC_SPC + [1] = LAYOUT_ortho_5x6( + KC_ESC, KC_1, KC_2, KC_3, KC_4, LT(2, KC_F9), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, + KC_LCTL, KC_LALT, TO(0), KC_P, KC_H, KC_SPC ), - - [2] = LAYOUT( - BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD + + [2] = LAYOUT_ortho_5x6( + BL_TOGG, BL_STEP, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_VOLU, + _______, _______, _______, _______, KC_MUTE, KC_VOLD ) }; diff --git a/keyboards/primekb/prime_m/keymaps/numpad/config.h b/keyboards/primekb/prime_m/keymaps/numpad/config.h new file mode 100644 index 00000000000..95917a65cd4 --- /dev/null +++ b/keyboards/primekb/prime_m/keymaps/numpad/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Jumail Mundekkat + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/primekb/prime_m/keymaps/numpad/keymap.c b/keyboards/primekb/prime_m/keymaps/numpad/keymap.c new file mode 100644 index 00000000000..35ff30a0c84 --- /dev/null +++ b/keyboards/primekb/prime_m/keymaps/numpad/keymap.c @@ -0,0 +1,33 @@ +/* Copyright 2018 Jumail Mundekkat + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_numpad_5x6( + KC_ESC, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, KC_PMNS, + KC_A, KC_B, KC_P7, KC_P8, KC_P9, + KC_C, KC_D, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_E, KC_F, KC_P1, KC_P2, KC_P3, + KC_LCTL, TG(1), KC_P0, KC_PDOT, KC_PENT + ), + [1] = LAYOUT_numpad_5x6( + RESET, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, KC_PMNS, + KC_A, KC_B, KC_HOME, KC_UP, KC_PGUP, + KC_C, KC_D, KC_LEFT, KC_NO, KC_RGHT, KC_PPLS, + KC_E, KC_F, KC_END, KC_DOWN, KC_PGDN, + KC_LCTL, _______, KC_INS, KC_DEL, KC_PENT + ), +}; diff --git a/keyboards/primekb/prime_m/keymaps/numpad/readme.md b/keyboards/primekb/prime_m/keymaps/numpad/readme.md new file mode 100644 index 00000000000..5654918abb2 --- /dev/null +++ b/keyboards/primekb/prime_m/keymaps/numpad/readme.md @@ -0,0 +1 @@ +# The default keymap for prime_m \ No newline at end of file diff --git a/keyboards/primekb/prime_m/prime_m.h b/keyboards/primekb/prime_m/prime_m.h index 0449a66d9b9..58d17eb6f68 100644 --- a/keyboards/primekb/prime_m/prime_m.h +++ b/keyboards/primekb/prime_m/prime_m.h @@ -13,12 +13,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef PRIME_M_H -#define PRIME_M_H +#pragma once #include "quantum.h" +#define ___ KC_NO -#define LAYOUT( \ +#define LAYOUT_ortho_5x6( \ K00, K01, K02, K03, K04, K05, \ K10, K11, K12, K13, K14, K15, \ K20, K21, K22, K23, K24, K25, \ @@ -32,4 +32,16 @@ { K40, K41, K42, K43, K44, K45 } \ } -#endif +#define LAYOUT_numpad_5x6( \ + K00, K01, K02, K03, K04, K05, \ + K10, K11, K12, K13, K14, \ + K20, K21, K22, K23, K24, K15, \ + K30, K31, K32, K33, K34, \ + K40, K41, K42, K44, K35 \ +) { \ + { K00, K01, K02, K03, K04, K05 }, \ + { K10, K11, K12, K13, K14, K15 }, \ + { K20, K21, K22, K23, K24, ___ }, \ + { K30, K31, K32, K33, K34, K35 }, \ + { K40, K41, K42, ___, K44, ___ } \ +} diff --git a/keyboards/primekb/prime_m/rules.mk b/keyboards/primekb/prime_m/rules.mk index 8d3b835f188..72ad8325d30 100644 --- a/keyboards/primekb/prime_m/rules.mk +++ b/keyboards/primekb/prime_m/rules.mk @@ -78,3 +78,5 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = ortho_5x6 numpad_5x6 diff --git a/keyboards/primekb/prime_o/config.h b/keyboards/primekb/prime_o/config.h index eb897ef8fa3..36de49b9e53 100644 --- a/keyboards/primekb/prime_o/config.h +++ b/keyboards/primekb/prime_o/config.h @@ -36,7 +36,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B6, B5, C7, C6, D2, D1, D0, C2 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 @@ -44,14 +44,9 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 4 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) diff --git a/keyboards/primekb/prime_o/keymaps/reasonsandreasons/config.h b/keyboards/primekb/prime_o/keymaps/reasonsandreasons/config.h new file mode 100644 index 00000000000..4bcfa2ce5c6 --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/reasonsandreasons/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Jumail Mundekkat + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define TAPPING_TERM 200 + +// place overrides here diff --git a/keyboards/primekb/prime_o/keymaps/reasonsandreasons/keymap.c b/keyboards/primekb/prime_o/keymaps/reasonsandreasons/keymap.c new file mode 100644 index 00000000000..2a320aecf2e --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/reasonsandreasons/keymap.c @@ -0,0 +1,186 @@ +/* Copyright 2018 Jumail Mundekkat + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#define L1BS LT(2, KC_BSPC) +#define LSUP LSFT_T(KC_UP) +#define CTLL LCTL_T(KC_LEFT) +#define ECTL LCTL_T(KC_ESC) +#define ALLM ALL_T(KC_MINS) +#define SCLS LT(3, KC_SCLN) + +// Establishes tap dance keys +enum { + TD_SPC_ENT = 0 +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SPC_ENT] = ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT) + +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BASE + * ,---------------------------------------------------------------------------------------------------------------, + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | NMLK | / | * | - | + * | | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | 7 | 8 | 9 | + | + * | | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | = | + * | Ctrl | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | Z | X | C | V | B | N | M | , | . | / | Up | 1 | 2 | 3 | | + * | Shift| | | | | | | | | | | Shift| | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+ Enter| + * | - | | | | Backspace | Space | | | Left | Down | Right| 0 | . | | + * | ALL | Ctrl | Alt | GUI | Fn1 | | GUI | Alt | Ctrl | | | | | | + * `---------------------------------------------------------------------------------------------------------------' + */ + + [0] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_7, KC_8, KC_9, KC_PPLS, + ECTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SCLS, KC_QUOT, KC_4, KC_5, KC_6, KC_PEQL, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LSUP, KC_1, KC_2, KC_3, KC_ENT, + ALLM, KC_LCTL, KC_LALT, KC_LGUI, L1BS, L1BS, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, CTLL, KC_DOWN, KC_RIGHT, KC_0, KC_PDOT, KC_ENT + ), + +/* GAME + * ,---------------------------------------------------------------------------------------------------------------, + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | NMLK | / | * | - | + * | ` | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | ' | 7 | 8 | 9 | + | + * | | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | A | S | D | F | G | H | J | K | L | ; | Rtrn | 4 | 5 | 6 | = | + * | | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | Z | X | C | V | B | N | M | , | . | / | Up | 1 | 2 | 3 | | + * | Shift| | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+ Enter| + * | | | | | Space | Backspace | | | Left | Down | Right| 0 | . | | + * | Fn1 | Ctrl | Alt | Alt | | | GUI | DF(0)| | | | | | | + * `---------------------------------------------------------------------------------------------------------------' + */ + + [1] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, KC_7, KC_8, KC_9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, KC_4, KC_5, KC_6, KC_PEQL, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_1, KC_2, KC_3, KC_ENT, + MO(2), KC_LCTL, KC_LALT, KC_LALT, KC_SPC, KC_SPC, KC_BSPC, KC_BSPC, KC_RGUI, DF(0), KC_LEFT, KC_DOWN, KC_RIGHT, KC_0, KC_PDOT, KC_ENT + ), + +/* SYMBOL + * ,---------------------------------------------------------------------------------------------------------------, + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | | | + * | | | | | | | | | | | | | | | | | + * |------+-------------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | # | [ | < | > | ] | _ | | | | | | | | | + * | | | | | | | | | | | | | | | | | + * |------+------|------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | ~ | ( | { | } | ) | @ | - | | | | | | | + * | | | | | | | | | | | | | | | | | + * |------+------|------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | | + * | | | | | | | | | | | | | | | | | + * |------+------|------+------+------+------+------+------+------+------+------+------+------+------+------+ | + * | | | | | | Enter | | | | | | | | | + * | | | | | | | | | | | | | | | + * `---------------------------------------------------------------------------------------------------------------' + */ + + [2] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, + _______, _______, _______, KC_HASH, KC_LBRC, KC_LT, KC_GT, KC_RBRC, KC_UNDS, KC_PIPE, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_TILD, KC_LPRN, KC_LCBR, KC_RCBR, KC_RPRN, KC_AT, KC_MINS, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* SYSTEM + * ,---------------------------------------------------------------------------------------------------------------, + * | | | | | | | | | | | | | | | | | + * | | | | | | | | | | | | | | | | | + * |------+-------------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | PgUp | Home | Up | End | | | Vol- | Vol+ | Mute | | | | | | | + * | | | | | | | | | | | | | | | | | + * |------+------|------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | PgDn | Left | Down |Right | | | Play | Prev | Next | | | | | | RESET| + * | | | | | | | | | | | | | | | | | + * |------+------|------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | | + * | | | | | | | | | | | | | | | | | + * |------+------|------+------+------+------+------+------+------+------+------+------+------+------+------+ BL | + * | | | | | | | | | | | | | BL | TGGL | + * | GAME | | | | | | | | | | | | STEP | | + * `---------------------------------------------------------------------------------------------------------------' + */ + + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, _______, KC__VOLDOWN, KC__VOLUP, KC__MUTE, _______, _______, _______, _______, _______, _______, + _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MPLY, KC_MRWD, KC_MFFD, _______, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, + DF(1), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, BL_TOGG + ), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/primekb/prime_o/keymaps/reasonsandreasons/readme.md b/keyboards/primekb/prime_o/keymaps/reasonsandreasons/readme.md new file mode 100644 index 00000000000..e14e989e322 --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/reasonsandreasons/readme.md @@ -0,0 +1,5 @@ +![reasonsandreasons Layout Image](https://imgur.com/a/xIpn2U5) + +# reasonsandreasons's Prime_O Layout + +This is a relatively simple layout for the Prime_O, designed for mostly typing use and occasional gaming. I'm still testing it and there will likely be minor changes, but most of the bones of it will likely stay the same. diff --git a/keyboards/primekb/prime_o/keymaps/reasonsandreasons/rules.mk b/keyboards/primekb/prime_o/keymaps/reasonsandreasons/rules.mk new file mode 100644 index 00000000000..b6c57629e9f --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/reasonsandreasons/rules.mk @@ -0,0 +1,20 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +TAP_DANCE_ENABLE=yes # Enable Tap Dance + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c b/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c index d38ff0d1d60..244b165f166 100644 --- a/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c +++ b/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c @@ -8,122 +8,244 @@ enum layers { _BASE, - _LOWER, _RAISE, + _LOWER, _GAME = _NAV+1 }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -#ifndef LEFTNUM +#ifdef LEFTNUM + /* Base ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ |Numlock |/ |* |= | +|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace|7 |8 |9 |- | +|+ |7 |8 |9 |Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 |Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' |4 |5 |6 |+ | +|Backspace|1 |2 |3 |(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |. |0 |00 |RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_BASE] = LAYOUT( + KC_PMNS, KC_PAST, KC_PSLS, KC_NLCK, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, + KC_PPLS, KC_P7, KC_P8, KC_P9, KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, + CU_EQL, KC_P4, KC_P5, KC_P6, CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, + KC_BSPC, KC_P1, KC_P2, KC_P3, CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, + KC_PENT, KC_PDOT, KC_P0, KC_P00, KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, CTLENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Lower +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 |~ |! |" |# |$ |% |^ |& |* |( |) | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|1 |2 |3 | |? | | | | | | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |. |0 |00 | | | | | | | | | | | | | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, + _______, _______, _______, _______, _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, _______, _______, _______, _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|1 |2 |3 | |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |. |0 |00 | | | | | | | | | | | | | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, + _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, + _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Deadkey +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock | | | | | | | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift |1 |2 |3 |Enter | +|+ |7 |8 |9 | | | | | | | |Ü | |Ö | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |Ä |ß | | | | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl |00 |0 |. |Tab | +|Backspace|1 |2 |3 | | | | | | | | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |. |0 |00 | | | | | |" |" | | | | | | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_DEADKEY] = LAYOUT( + _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, + _______, _______, _______, _______, KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, + _______, _______, _______, _______, _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, + _______, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______ +), + +/* Navigation +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |Escape | | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 |ALT F4 |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|1 |2 |3 | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |. |0 |00 |RESET |ESCT | | | | | | | | | |Game | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_NAV] = LAYOUT( + _______, _______, _______, _______, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, EMOJI, KC_ENT, + _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, RESET, ALTF4, _______, _______, _______, KC_SPC, CTLENT, _______, _______, _______, _______, CU_GAME +), + +// Can be used to place macros on the numpad +[_GAME] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +#elif defined CENTERNUM + +/* Base +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|` |1 |2 |3 |4 |5 |Numlock |/ |* |= |6 |7 |8 |9 |0 |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Tab |Q |W |E |R |T |7 |8 |9 |- |Z |U |I |O |P |Backspace| +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Esc/Nav |A |S |D |F |G |4 |5 |6 |+ |H |J |K |L |; |' | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|(/LShift |Y |X |C |V |B |1 |2 |3 |Tab |N |M |, |. |/ |)/RShift | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|RCtrl | |Alt |Win |Lower |Space |00 |0 |. |Enter |Enter |Raise |Win |AltGr | |LCtrl | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_BASE] = LAYOUT( - CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PPLS, - CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, KC_P4, KC_P5, KC_P6, KC_PEQL, - CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_P00, KC_P0, KC_PDOT, KC_TAB + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, + KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, KC_P7, KC_P8, KC_P9, KC_PPLS, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, + CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, KC_P4, KC_P5, KC_P6, CU_EQL, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, + CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, KC_P1, KC_P2, KC_P3, KC_TAB, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P00, KC_P0, KC_PDOT, KC_PENT, CTLENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL ), /* Lower ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | +|` |1 |2 |3 |4 |5 |Numlock |/ |* |- |6 |7 |8 |9 |0 | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|~ |! |" |# |$ |% |^ |& |* |( |) | |7 |8 |9 |+ | +|~ |! |" |# |$ |% |7 |8 |9 |+ |^ |& |* |( |) | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || |4 |5 |6 |= | +| |@ |Strg+X |Strg+C |Strg+V | |4 |5 |6 |= | |_ |+ |{ |} || | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |? | | | | | | | | | | |1 |2 |3 |Enter | +| |? | | | | |1 |2 |3 |Tab | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | | | |00 |0 |. |Tab | +| | | | | | |00 |0 |. |Enter | | | | | | | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, _______, _______, _______, _______, - _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, _______, _______, _______, _______, - _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, + DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, _______, _______, _______, _______, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, + _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, _______, _______, _______, _______, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Raise ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | +|` |1 |2 |3 |4 |5 |Numlock |/ |* |- |6 |7 |8 |9 |0 | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |7 |8 |9 |+ | +|` |1 |2 |3 |4 |5 |7 |8 |9 |+ |6 |7 |8 |9 |0 | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ |4 |5 |6 |= | +| |F1 |F2 |F3 |F4 |F5 |4 |5 |6 |= |F6 |- |= |[ |] |\ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | |1 |2 |3 |Enter | +| |F7 |F8 |F9 |F10 |F11 |1 |2 |3 |Tab |F12 | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | | | |00 |0 |. |Tab | +| | | | | | |00 |0 |. |Enter | | | | | | | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, _______, _______, _______, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, _______, _______, _______, _______, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, _______, _______, _______, _______, CU_6, CU_7, CU_8, CU_9, CU_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, _______, KC_F12, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Deadkey ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -| | | | | | | | | | | | |Numlock |/ |* |- | +| | | | | | |Numlock |/ |* |- | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | |Ü | |Ö | | |7 |8 |9 |+ | +| | | | | | |7 |8 |9 |+ | |Ü | |Ö | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |Ä |ß | | | | | | | | | |4 |5 |6 |= | +| |Ä |ß | | | |4 |5 |6 |= | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | | | |1 |2 |3 |Enter | +| | | | | | |1 |2 |3 |Tab | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | |" |" | | | | | |00 |0 |. |Tab | +| | | | | |" |00 |0 |. |Enter |" | | | | | | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_DEADKEY] = LAYOUT( - CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, - KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, _______, _______, _______, _______, - _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, _______, _______, _______, _______, - _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______, _______, _______, _______, _______ + CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, + KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, + _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, + _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, + _______, _______, _______, _______, _______, CU_DDQ, _______, _______, _______, _______, CU_DDQ, _______, _______, _______, _______, _______ ), /* Navigation ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|Escape | | | | | | | | | | | |Numlock |/ |* |- | +|Escape | | | | | |Numlock |/ |* |- | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del |7 |8 |9 |+ | +|ALT F4 |PageDown |Up |PageUp |Home | |7 |8 |9 |+ | | |Win+Up | | |Del | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter |4 |5 |6 |= | +| |Left |Down |Right |End | |4 |5 |6 |= | |Win+Left |Win+Down |Win+Right| |Enter | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | |1 |2 |3 |Enter | +| |Prev |Pause |Next |LowerVol |RaiseVol |1 |2 |3 |Tab |Mute | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|RESET | | | | | | | | | | |Game |00 |0 |. |Tab | +|RESET |ESCT | | | | |00 |0 |. |Enter | | | | | |Game | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_NAV] = LAYOUT( - KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, - CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, _______, _______, _______, _______, - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, _______, _______, _______, _______, - _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, - RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME, _______, _______, _______, _______ + KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, _______, _______, _______, _______, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, _______, _______, _______, _______, XXXXXXX, GUIL, GUID, GUIR, EMOJI, KC_ENT, + _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, _______, _______, _______, _______, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + RESET, CU_ESCT, ALTF4, _______, _______, KC_SPC, _______, _______, _______, _______, CTLENT, _______, _______, _______, _______, CU_GAME ), // Can be used to place macros on the numpad @@ -134,117 +256,117 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) -#endif -#ifdef LEFTNUM +#else + /* Base ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ | +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ |Numlock |/ |* |= | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 |Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 |Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | +|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace|7 |8 |9 |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 |(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 |RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl | +|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' |4 |5 |6 |+ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift |1 |2 |3 |Tab | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+ +|RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl |00 |0 |. |Enter | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_BASE] = LAYOUT( - KC_PMNS, KC_PAST, KC_PSLS, KC_NLCK, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, - KC_PPLS, KC_P7, KC_P8, KC_P9, KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, - KC_PEQL, KC_P4, KC_P5, KC_P6, CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, - KC_PENT, KC_P1, KC_P2, KC_P3, CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, - KC_BSPC, KC_PDOT, KC_P0, KC_P00, KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PPLS, + CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, KC_P4, KC_P5, KC_P6, CU_EQL, + CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, KC_P1, KC_P2, KC_P3, KC_TAB, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, CTLENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_P00, KC_P0, KC_PDOT, KC_PENT ), /* Lower ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 |~ |! |" |# |$ |% |^ |& |* |( |) | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 | |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | +|~ |! |" |# |$ |% |^ |& |* |( |) | |7 |8 |9 |+ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 | |? | | | | | | | | | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 | | | | | | | | | | | | | +| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |? | | | | | | | | | | |1 |2 |3 |Tab | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| | | | | | | | | | | | |00 |0 |. |Enter | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, - _______, _______, _______, _______, _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, - _______, _______, _______, _______, _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, _______, _______, _______, _______, + _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, _______, _______, _______, _______, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Raise ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 | |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |7 |8 |9 |+ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 | |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 | | | | | | | | | | | | | +| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | |1 |2 |3 |Tab | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| | | | | | | | | | | | |00 |0 |. |Enter | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, - _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, - _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, _______, _______, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Deadkey ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock | | | | | | | | | | | | | +| | | | | | | | | | | | |Numlock |/ |* |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 | | | | | | | |Ü | |Ö | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 | |Ä |ß | | | | | | | | | | +| | | | | | | |Ü | |Ö | | |7 |8 |9 |+ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 | | | | | | | | | | | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 | | | | | |" |" | | | | | | +| |Ä |ß | | | | | | | | | |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | |1 |2 |3 |Tab | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| | | | | |" |" | | | | | |00 |0 |. |Enter | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_DEADKEY] = LAYOUT( - _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, - _______, _______, _______, _______, KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, - _______, _______, _______, _______, _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, - _______, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______ + CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, + KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, _______, _______, _______, _______, + _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, _______, _______, _______, _______, + _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Navigation ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock |Escape | | | | | | | | | | | | +|Escape | | | | | | | | | | | |Numlock |/ |* |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 |ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | +|ALT F4 |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del |7 |8 |9 |+ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 |RESET | | | | | | | | | | |Game | +| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | |1 |2 |3 |Tab | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+ +|RESET |ESCT | | | | | | | | | |Game |00 |0 |. |Enter | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_NAV] = LAYOUT( - _______, _______, _______, _______, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, _______, _______, _______, CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, - _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, - _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - _______, _______, _______, _______, RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME + KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, EMOJI, KC_ENT, _______, _______, _______, _______, + _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, + RESET, CU_ESCT, ALTF4, _______, _______, KC_SPC, CTLENT, _______, _______, _______, _______, CU_GAME, _______, _______, _______, _______ ), // Can be used to place macros on the numpad @@ -255,6 +377,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) + #endif }; @@ -272,6 +395,17 @@ switch (keycode) { } else { return true; } + case KC_LALT: + if (game) { + if (record->event.pressed){ + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + } else { + return true; + } case CU_GAME: if(record->event.pressed) { if (game) diff --git a/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md b/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md index eb8da3fa78f..7e78330f07a 100644 --- a/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md +++ b/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md @@ -3,4 +3,4 @@ This keymap emulates most keys of the US-International layout on PCs that have German set as input language. This allows the use of the keyboard on any PC in Germany without the need to change any settings. The keymap is mostly based on the Planck default layout but adds essential features for german input, like access to Ä, Ö, Ü, ß. -Righthand Numpad is enabled by default, enable lefthand Numpad with #define LEFTNUM. +Righthand numpad is enabled by default, enable lefthand numpad with #define LEFTNUM and center numpad with #define CENTERNUM. diff --git a/keyboards/primekb/prime_r/config.h b/keyboards/primekb/prime_r/config.h index ad92199a22a..942eced325a 100644 --- a/keyboards/primekb/prime_r/config.h +++ b/keyboards/primekb/prime_r/config.h @@ -47,7 +47,7 @@ along with this program. If not, see . #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -55,11 +55,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/primekb/prime_r/keymaps/default/config.h b/keyboards/primekb/prime_r/keymaps/default/config.h index e7ffd3aa201..a70a6b37265 100644 --- a/keyboards/primekb/prime_r/keymaps/default/config.h +++ b/keyboards/primekb/prime_r/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/primekb/prime_r/keymaps/default/keymap.c b/keyboards/primekb/prime_r/keymaps/default/keymap.c index a39d197e273..afff0d7dadb 100644 --- a/keyboards/primekb/prime_r/keymaps/default/keymap.c +++ b/keyboards/primekb/prime_r/keymaps/default/keymap.c @@ -19,10 +19,6 @@ #include QMK_KEYBOARD_H -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* (Base Layer) Default Layer * ,---------------------------------------------------------------. @@ -57,14 +53,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - switch (id) { - - } - return MACRO_NONE; -} - void matrix_init_user(void) { } diff --git a/keyboards/primekb/prime_r/keymaps/rooski/keymap.c b/keyboards/primekb/prime_r/keymaps/rooski/keymap.c index 3fadc6c6bc2..40c73e7c16d 100644 --- a/keyboards/primekb/prime_r/keymaps/rooski/keymap.c +++ b/keyboards/primekb/prime_r/keymaps/rooski/keymap.c @@ -18,10 +18,6 @@ #include QMK_KEYBOARD_H -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - //Arrow Cluster Toggle static bool arrow_toggle = false; diff --git a/keyboards/projectkb/alice/alice.c b/keyboards/projectkb/alice/alice.c new file mode 100644 index 00000000000..fada4368110 --- /dev/null +++ b/keyboards/projectkb/alice/alice.c @@ -0,0 +1,27 @@ +#include "alice.h" + +void matrix_init_board(void){ + setPinOutput(A0); + setPinOutput(A1); + setPinOutput(A2); +} + + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(A0); + } else { + writePinHigh(A0); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(A1); + } else { + writePinHigh(A1); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(A2); + } else { + writePinHigh(A2); + } + led_set_user(usb_led); +} diff --git a/keyboards/projectkb/alice/alice.h b/keyboards/projectkb/alice/alice.h new file mode 100644 index 00000000000..907f020e41a --- /dev/null +++ b/keyboards/projectkb/alice/alice.h @@ -0,0 +1,19 @@ +#pragma once + +#include "quantum.h" + +#define KNO KC_NO + +#define LAYOUT_default( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K28, K29, K2A, K2B, K2C, K2D, K2F, \ + K31, K32, K33, K34, K35, K36, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, \ + K41, K43, K44, K46, K49, K4B, K4F \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, KNO, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, KNO, K28, K29, K2A, K2B, K2C, K2D, KNO, K2F }, \ + { KNO, K31, K32, K33, K34, K35, K36, KNO, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \ + { KNO, K41, KNO, K43, K44, KNO, K46, KNO, KNO, K49, KNO, K4B, KNO, KNO, KNO, K4F } \ +} diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c new file mode 100644 index 00000000000..9d10fbd754d --- /dev/null +++ b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c @@ -0,0 +1,109 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h new file mode 100644 index 00000000000..de3a93d1ceb --- /dev/null +++ b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h @@ -0,0 +1,922 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#ifndef BOARD_H +#define BOARD_H + +/* + * Setup for ST STM32F072B-Discovery board. + */ + +/* + * Board identifier. + */ +#define BOARD_ST_STM32F072B_DISCOVERY +#define BOARD_NAME "ST STM32F072B-Discovery" + +/* + * Board oscillators-related settings. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 32768 +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +#define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F072xB + +/* + * IO pins assignments. + */ +#define GPIOA_BUTTON 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_SPI2_SCK 13U +#define GPIOB_SPI2_MISO 14U +#define GPIOB_SPI2_MOSI 15U + +#define GPIOC_MEMS_CS 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_LED_RED 6U +#define GPIOC_LED_BLUE 7U +#define GPIOC_LED_ORANGE 8U +#define GPIOC_LED_GREEN 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_OSC32_IN 14U +#define GPIOC_OSC32_OUT 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_OSC_IN 0U +#define GPIOF_OSC_OUT 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) +#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) + +#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) +#define LINE_LED_RED PAL_LINE(GPIOC, 6U) +#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) +#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) +#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - BUTTON (input floating). + * PA1 - PIN1 (input pullup). + * PA2 - PIN2 (input pullup). + * PA3 - PIN3 (input pullup). + * PA4 - PIN4 (input pullup). + * PA5 - PIN5 (input pullup). + * PA6 - PIN6 (input pullup). + * PA7 - PIN7 (input pullup). + * PA8 - PIN8 (input pullup). + * PA9 - PIN9 (input pullup). + * PA10 - PIN10 (input pullup). + * PA11 - USB_DM (input floating). + * PA12 - USB_DP (input floating). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - PIN15 (input pullup). + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_USB_DM) | \ + PIN_MODE_INPUT(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (input pullup). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 (input pullup). + * PB7 - PIN7 (input pullup). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - SPI2_SCK (alternate 0). + * PB14 - SPI2_MISO (alternate 0). + * PB15 - SPI2_MOSI (alternate 0). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) + +/* + * GPIOC setup: + * + * PC0 - MEMS_CS (output pushpull maximum). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - LED_RED (output pushpull maximum). + * PC7 - LED_BLUE (output pushpull maximum). + * PC8 - LED_ORANGE (output pushpull maximum). + * PC9 - LED_GREEN (output pushpull maximum). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - OSC32_IN (input floating). + * PC15 - OSC32_OUT (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ + PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ + PIN_MODE_INPUT(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ + PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_LOW(GPIOC_LED_RED) | \ + PIN_ODR_LOW(GPIOC_LED_BLUE) | \ + PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ + PIN_ODR_LOW(GPIOC_LED_GREEN) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ + PIN_ODR_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - OSC_IN (input floating). + * PF1 - OSC_OUT (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ + PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ + PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ + PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ + PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* BOARD_H */ diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk new file mode 100644 index 00000000000..b98dcdd26c6 --- /dev/null +++ b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg new file mode 100644 index 00000000000..9c7cf4fd76a --- /dev/null +++ b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg @@ -0,0 +1,703 @@ + + + + + resources/gencfg/processors/boards/stm32f0xx/templates + .. + 3.0.x + + ST STM32F072B-Discovery + ST_STM32F072B_DISCOVERY + + STM32F072xB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/keyboards/projectkb/alice/bootloader_defs.h b/keyboards/projectkb/alice/bootloader_defs.h new file mode 100644 index 00000000000..02c48c4e6dc --- /dev/null +++ b/keyboards/projectkb/alice/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/projectkb/alice/chconf.h b/keyboards/projectkb/alice/chconf.h new file mode 100644 index 00000000000..99fa8ce3982 --- /dev/null +++ b/keyboards/projectkb/alice/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE FALSE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP FALSE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/projectkb/alice/config.h b/keyboards/projectkb/alice/config.h new file mode 100644 index 00000000000..2a6e81f1d7f --- /dev/null +++ b/keyboards/projectkb/alice/config.h @@ -0,0 +1,92 @@ +/* +Copyright 2015 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x0159 +#define PRODUCT_ID 0xA71C +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER ProjectKB +#define PRODUCT Alice +#define DESCRIPTION ProjectKB Alice + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +#define MATRIX_COL_PINS { B2, B10, B11, A9, A15, B3, B4, B5, B6, B7, B8, B9, C13, C14, C15, B12 } +#define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 6 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGBLIGHT_ANIMATIONS + +#define WS2812_LED_N 14 +#define RGBLED_NUM WS2812_LED_N +#define PORT_WS2812 GPIOB +#define PIN_WS2812 15 +#define WS2812_SPI SPID2 + + +// EEPROM usage +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x01 +#define EEPROM_VERSION_ADDR 34 + +#define EEPROM_CUSTOM_BACKLIGHT 804 + + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/projectkb/alice/halconf.h b/keyboards/projectkb/alice/halconf.h new file mode 100644 index 00000000000..da08cdbae2c --- /dev/null +++ b/keyboards/projectkb/alice/halconf.h @@ -0,0 +1,351 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#pragma once + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +/** @} */ diff --git a/keyboards/projectkb/alice/info.json b/keyboards/projectkb/alice/info.json new file mode 100644 index 00000000000..fbeef50cc31 --- /dev/null +++ b/keyboards/projectkb/alice/info.json @@ -0,0 +1,83 @@ +{ + "keyboard_name": "Alice", + "url": "https://store.projectkeyboard.com/", + "maintainer": "qmk", + "width": 19.75, + "height": 5.25, + "layouts": { + "LAYOUT_default": { + "layout": [ + {"label":"Esc", "x":0.5, "y":0}, + {"label":"`", "x":1.75, "y":0.25}, + {"label":"1", "x":2.75, "y":0.25}, + {"label":"2", "x":3.75, "y":0}, + {"label":"3", "x":4.75, "y":0.25}, + {"label":"4", "x":5.75, "y":0.25}, + {"label":"5", "x":6.75, "y":0.25}, + {"label":"6", "x":7.75, "y":0.25}, + {"label":"7", "x":11, "y":0.25}, + {"label":"8", "x":12, "y":0.25}, + {"label":"9", "x":13, "y":0.25}, + {"label":"0", "x":14, "y":0.25}, + {"label":"-", "x":15, "y":0}, + {"label":"=", "x":16, "y":0.25}, + {"label":"Del", "x":17, "y":0.25}, + {"label":"Backspace", "x":18, "y":0.25}, + + {"label":"PgUp", "x":0.25, "y":1}, + {"label":"Tab", "x":1.5, "y":1.25, "w":1.5}, + {"label":"Q", "x":3, "y":1.25}, + {"label":"W", "x":4.25, "y":1.25}, + {"label":"E", "x":5.25, "y":1.25}, + {"label":"R", "x":6.25, "y":1.25}, + {"label":"T", "x":7.25, "y":1.25}, + {"label":"Y", "x":10.5, "y":1.25}, + {"label":"U", "x":11.5, "y":1.25}, + {"label":"I", "x":12.5, "y":1.25}, + {"label":"O", "x":13.5, "y":1.25}, + {"label":"P", "x":14.75, "y":1.25}, + {"label":"{", "x":15.75, "y":1.25}, + {"label":"}", "x":16.75, "y":1.25}, + {"label":"|", "x":17.75, "y":1.25, "w":1.5}, + + {"label":"PgDn", "x":0, "y":2}, + {"label":"Caps Lock", "x":1.5, "y":2.25, "w":1.75}, + {"label":"A", "x":3.25, "y":2.25}, + {"label":"S", "x":4.5, "y":2.25}, + {"label":"D", "x":5.5, "y":2.25}, + {"label":"F", "x":6.5, "y":2.25}, + {"label":"G", "x":7.5, "y":2.25}, + {"label":"H", "x":10.75, "y":2.25}, + {"label":"J", "x":11.75, "y":2.25}, + {"label":"K", "x":12.75, "y":2.25}, + {"label":"L", "x":13.75, "y":2.25}, + {"label":":", "x":15.25, "y":2.25}, + {"label":"\"", "x":16.25, "y":2.25}, + {"label":"Enter", "x":17.25, "y":2.25, "w":2.25}, + + {"label":"Shift", "x":1.5, "y":3.25, "w":2.25}, + {"label":"Z", "x":3.75, "y":3.25}, + {"label":"X", "x":5, "y":3.25}, + {"label":"C", "x":6, "y":3.25}, + {"label":"V", "x":7, "y":3.25}, + {"label":"B", "x":8, "y":3.25}, + {"label":"Fn", "x":10.25, "y":3.25}, + {"label":"N", "x":11.25, "y":3.25}, + {"label":"M", "x":12.25, "y":3.25}, + {"label":"<", "x":13.25, "y":3.25}, + {"label":">", "x":15, "y":3.25}, + {"label":"?", "x":16, "y":3.25}, + {"label":"Shift", "x":17, "y":3.25, "w":1.75}, + {"label":"Fn", "x":18.75, "y":3.25}, + + {"label":"Ctrl", "x":1.5, "y":4.25, "w":1.5}, + {"label":"Alt", "x":5, "y":4.25, "w":1.5}, + {"label":"Space", "x":6.5, "y":4.25, "w":2}, + {"label":"Menu", "x":8.5, "y":4.25}, + {"label":"Space", "x":10.25, "y":4.25, "w":2.25}, + {"label":"Alt", "x":12.5, "y":4.25, "w":1.5}, + {"label":"Ctrl", "x":18, "y":4.25, "w":1.5} + ] + } + } +} diff --git a/keyboards/projectkb/alice/keymaps/default/keymap.c b/keyboards/projectkb/alice/keymaps/default/keymap.c new file mode 100644 index 00000000000..bad22f9ae44 --- /dev/null +++ b/keyboards/projectkb/alice/keymaps/default/keymap.c @@ -0,0 +1,45 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_default( + KC_ESC, KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, + KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RGUI, + KC_LCTL, KC_LALT, KC_SPC, MO(_FN1), KC_SPC, KC_RALT, KC_RCTL + ), + + [_FN1] = LAYOUT_default( + RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, + RGB_MOD, _______, _______, KC_UP, _______, _______, _______, RGB_SAI, RGB_HUI, RGB_VAI, _______, _______, _______, _______, _______, + RGB_RMOD, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, _______, _______, _______, _______, + _______, BL_INC, BL_DEC, BL_TOGG, BL_BRTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RESET + ) +}; + diff --git a/keyboards/projectkb/alice/mcuconf.h b/keyboards/projectkb/alice/mcuconf.h new file mode 100644 index 00000000000..048eb4df650 --- /dev/null +++ b/keyboards/projectkb/alice/mcuconf.h @@ -0,0 +1,176 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF +// #define STM32F070xB + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 TRUE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/projectkb/alice/readme.md b/keyboards/projectkb/alice/readme.md new file mode 100644 index 00000000000..cc9f22685b0 --- /dev/null +++ b/keyboards/projectkb/alice/readme.md @@ -0,0 +1,12 @@ +# ProjectKeyboard Alice PCB + +ProjectKeyboard Alice Keyboard Replacement PCB + +Keyboard Maintainer: onefiftynine + +Hardware Supported: STM32F072CBT6 +Make example for this keyboard (after setting up your build environment): + + make projectkb/alice:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/projectkb/alice/rules.mk b/keyboards/projectkb/alice/rules.mk new file mode 100644 index 00000000000..cd366c76aa7 --- /dev/null +++ b/keyboards/projectkb/alice/rules.mk @@ -0,0 +1,56 @@ +# project specific files +# SRC = ssd1306.c +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F072xB +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx +# it should exist either in /os/hal/boards/ +# or /boards +BOARD = ST_STM32F072B_DISCOVERY +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m0 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# + +# project specific files +VPATH += keyboards/cannonkeys/stm32f072 +SRC = keyboard.c \ + led.c + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file +# BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason +RGBLIGHT_ENABLE = yes + +# RAW_ENABLE = yes +# DYNAMIC_KEYMAP_ENABLE = yes + diff --git a/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.c b/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.c deleted file mode 100644 index 4331155df4b..00000000000 --- a/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = { -#if STM32_HAS_GPIOA - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, -#endif -#if STM32_HAS_GPIOB - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, -#endif -#if STM32_HAS_GPIOC - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, -#endif -#if STM32_HAS_GPIOD - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, -#endif -#if STM32_HAS_GPIOE - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, -#endif -#if STM32_HAS_GPIOF - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, -#endif -#if STM32_HAS_GPIOG - {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, - VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, -#endif -#if STM32_HAS_GPIOH - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, -#endif -#if STM32_HAS_GPIOI - {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, - VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} -#endif -}; -#endif - -void enter_bootloader_mode_if_requested(void); - -/** - * @brief Early initialization code. - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - enter_bootloader_mode_if_requested(); - stm32_clock_init(); -} - -#if HAL_USE_SDC || defined(__DOXYGEN__) -/** - * @brief SDC card detection. - */ -bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief SDC card write protection detection. - */ -bool sdc_lld_is_write_protected(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif /* HAL_USE_SDC */ - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool mmc_lld_is_write_protected(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.h b/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.h deleted file mode 100644 index ec26557f3a6..00000000000 --- a/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.h +++ /dev/null @@ -1,1187 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for Clueboard 60% Keyboard - */ - -/* - * Board identifier. - */ -#define BOARD_GENERIC_STM32_F303XC -#define BOARD_NAME "Planck PCB" - -/* - * Board oscillators-related settings. - * NOTE: LSE not fitted. - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 0U -#endif - -#define STM32_LSEDRV (3U << 3U) - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 8000000U -#endif - -// #define STM32_HSE_BYPASS - -/* - * MCU type as defined in the ST header. - */ -#define STM32F303xC - -/* - * IO pins assignments. - */ -#define GPIOA_PIN0 0U -#define GPIOA_PIN1 1U -#define GPIOA_PIN2 2U -#define GPIOA_PIN3 3U -#define GPIOA_PIN4 4U -#define GPIOA_PIN5 5U -#define GPIOA_PIN6 6U -#define GPIOA_PIN7 7U -#define GPIOA_PIN8 8U -#define GPIOA_PIN9 9U -#define GPIOA_PIN10 10U -#define GPIOA_USB_DM 11U -#define GPIOA_USB_DP 12U -#define GPIOA_SWDIO 13U -#define GPIOA_SWCLK 14U -#define GPIOA_PIN15 15U - -#define GPIOB_PIN0 0U -#define GPIOB_PIN1 1U -#define GPIOB_PIN2 2U -#define GPIOB_PIN3 3U -#define GPIOB_PIN4 4U -#define GPIOB_PIN5 5U -#define GPIOB_PIN6 6U -#define GPIOB_PIN7 7U -#define GPIOB_PIN8 8U -#define GPIOB_PIN9 9U -#define GPIOB_PIN10 10U -#define GPIOB_PIN11 11U -#define GPIOB_PIN12 12U -#define GPIOB_PIN13 13U -#define GPIOB_PIN14 14U -#define GPIOB_PIN15 15U - -#define GPIOC_PIN0 0U -#define GPIOC_PIN1 1U -#define GPIOC_PIN2 2U -#define GPIOC_PIN3 3U -#define GPIOC_PIN4 4U -#define GPIOC_PIN5 5U -#define GPIOC_PIN6 6U -#define GPIOC_PIN7 7U -#define GPIOC_PIN8 8U -#define GPIOC_PIN9 9U -#define GPIOC_PIN10 10U -#define GPIOC_PIN11 11U -#define GPIOC_PIN12 12U -#define GPIOC_PIN13 13U -#define GPIOC_PIN14 14U -#define GPIOC_PIN15 15U - -#define GPIOD_PIN0 0U -#define GPIOD_PIN1 1U -#define GPIOD_PIN2 2U -#define GPIOD_PIN3 3U -#define GPIOD_PIN4 4U -#define GPIOD_PIN5 5U -#define GPIOD_PIN6 6U -#define GPIOD_PIN7 7U -#define GPIOD_PIN8 8U -#define GPIOD_PIN9 9U -#define GPIOD_PIN10 10U -#define GPIOD_PIN11 11U -#define GPIOD_PIN12 12U -#define GPIOD_PIN13 13U -#define GPIOD_PIN14 14U -#define GPIOD_PIN15 15U - -#define GPIOE_PIN0 0U -#define GPIOE_PIN1 1U -#define GPIOE_PIN2 2U -#define GPIOE_PIN3 3U -#define GPIOE_PIN4 4U -#define GPIOE_PIN5 5U -#define GPIOE_PIN6 6U -#define GPIOE_PIN7 7U -#define GPIOE_PIN8 8U -#define GPIOE_PIN9 9U -#define GPIOE_PIN10 10U -#define GPIOE_PIN11 11U -#define GPIOE_PIN12 12U -#define GPIOE_PIN13 13U -#define GPIOE_PIN14 14U -#define GPIOE_PIN15 15U - -#define GPIOF_I2C2_SDA 0U -#define GPIOF_I2C2_SCL 1U -#define GPIOF_PIN2 2U -#define GPIOF_PIN3 3U -#define GPIOF_PIN4 4U -#define GPIOF_PIN5 5U -#define GPIOF_PIN6 6U -#define GPIOF_PIN7 7U -#define GPIOF_PIN8 8U -#define GPIOF_PIN9 9U -#define GPIOF_PIN10 10U -#define GPIOF_PIN11 11U -#define GPIOF_PIN12 12U -#define GPIOF_PIN13 13U -#define GPIOF_PIN14 14U -#define GPIOF_PIN15 15U - -#define GPIOG_PIN0 0U -#define GPIOG_PIN1 1U -#define GPIOG_PIN2 2U -#define GPIOG_PIN3 3U -#define GPIOG_PIN4 4U -#define GPIOG_PIN5 5U -#define GPIOG_PIN6 6U -#define GPIOG_PIN7 7U -#define GPIOG_PIN8 8U -#define GPIOG_PIN9 9U -#define GPIOG_PIN10 10U -#define GPIOG_PIN11 11U -#define GPIOG_PIN12 12U -#define GPIOG_PIN13 13U -#define GPIOG_PIN14 14U -#define GPIOG_PIN15 15U - -#define GPIOH_PIN0 0U -#define GPIOH_PIN1 1U -#define GPIOH_PIN2 2U -#define GPIOH_PIN3 3U -#define GPIOH_PIN4 4U -#define GPIOH_PIN5 5U -#define GPIOH_PIN6 6U -#define GPIOH_PIN7 7U -#define GPIOH_PIN8 8U -#define GPIOH_PIN9 9U -#define GPIOH_PIN10 10U -#define GPIOH_PIN11 11U -#define GPIOH_PIN12 12U -#define GPIOH_PIN13 13U -#define GPIOH_PIN14 14U -#define GPIOH_PIN15 15U - -/* - * IO lines assignments. - */ -#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) -#define LINE_USB_DM PAL_LINE(GPIOA, 11U) -#define LINE_USB_DP PAL_LINE(GPIOA, 12U) -#define LINE_SWDIO PAL_LINE(GPIOA, 13U) -#define LINE_SWCLK PAL_LINE(GPIOA, 14U) - -#define LINE_PIN6 PAL_LINE(GPIOF, 0U) -#define LINE_PIN7 PAL_LINE(GPIOF, 1U) - -#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) - - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) - -/* - * GPIOA setup: - * - * PA0 - NC - * PA1 - NC - * PA2 - COL1 - * PA3 - COL2 - * PA4 - SPEAKER1 - * PA5 - SPEAKER2 - * PA6 - COL3 - * PA7 - COL8 - * PA8 - COL6 - * PA9 - COL7 - * PA10 - ROW5 - * PA11 - USB_DM (alternate 14). - * PA12 - USB_DP (alternate 14). - * PA13 - SWDIO (alternate 0). - * PA14 - SWCLK (alternate 0). - * PA15 - ROW4 - */ -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ - PIN_MODE_ALTERNATE(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_PIN2) | \ - PIN_MODE_INPUT(GPIOA_PIN3) | \ - PIN_MODE_INPUT(GPIOA_PIN4) | \ - PIN_MODE_INPUT(GPIOA_PIN5) | \ - PIN_MODE_INPUT(GPIOA_PIN6) | \ - PIN_MODE_INPUT(GPIOA_PIN7) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_PIN9) | \ - PIN_MODE_INPUT(GPIOA_PIN10) | \ - PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ - PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ - PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ - PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ - PIN_MODE_INPUT(GPIOA_PIN15)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ - PIN_OSPEED_HIGH(GPIOA_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ - PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ - PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ - PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ - PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN15)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ - PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ - PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN15)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_PIN2) | \ - PIN_ODR_HIGH(GPIOA_PIN3) | \ - PIN_ODR_HIGH(GPIOA_PIN4) | \ - PIN_ODR_HIGH(GPIOA_PIN5) | \ - PIN_ODR_HIGH(GPIOA_PIN6) | \ - PIN_ODR_HIGH(GPIOA_PIN7) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_PIN9) | \ - PIN_ODR_HIGH(GPIOA_PIN10) | \ - PIN_ODR_HIGH(GPIOA_USB_DM) | \ - PIN_ODR_HIGH(GPIOA_USB_DP) | \ - PIN_ODR_HIGH(GPIOA_SWDIO) | \ - PIN_ODR_HIGH(GPIOA_SWCLK) | \ - PIN_ODR_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ - PIN_AFIO_AF(GPIOA_PIN1, 1) | \ - PIN_AFIO_AF(GPIOA_PIN2, 0) | \ - PIN_AFIO_AF(GPIOA_PIN3, 0) | \ - PIN_AFIO_AF(GPIOA_PIN4, 0) | \ - PIN_AFIO_AF(GPIOA_PIN5, 5) | \ - PIN_AFIO_AF(GPIOA_PIN6, 5) | \ - PIN_AFIO_AF(GPIOA_PIN7, 5)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ - PIN_AFIO_AF(GPIOA_PIN9, 0) | \ - PIN_AFIO_AF(GPIOA_PIN10, 0) | \ - PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ - PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ - PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ - PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ - PIN_AFIO_AF(GPIOA_PIN15, 0)) - -/* - * GPIOB setup: - * - * PB0 - PIN0 (input pullup). - * PB1 - PIN1 (input pullup). - * PB2 - PIN2 (input pullup). - * PB3 - PIN3 (alternate 0). - * PB4 - PIN4 (input pullup). - * PB5 - PIN5 (input pullup). - * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). - * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). - * PB8 - PIN8 (input pullup). - * PB9 - PIN9 (input pullup). - * PB10 - PIN10 (input pullup). - * PB11 - PIN11 (input pullup). - * PB12 - PIN12 (input pullup). - * PB13 - PIN13 (input pullup). - * PB14 - PIN14 (input pullup). - * PB15 - PIN15 (input pullup). - */ -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ - PIN_MODE_INPUT(GPIOB_PIN1) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ - PIN_MODE_INPUT(GPIOB_PIN4) | \ - PIN_MODE_INPUT(GPIOB_PIN5) | \ - PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ - PIN_MODE_OUTPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_INPUT(GPIOB_PIN9) | \ - PIN_MODE_INPUT(GPIOB_PIN10) | \ - PIN_MODE_INPUT(GPIOB_PIN11) | \ - PIN_MODE_INPUT(GPIOB_PIN12) | \ - PIN_MODE_INPUT(GPIOB_PIN13) | \ - PIN_MODE_INPUT(GPIOB_PIN14) | \ - PIN_MODE_INPUT(GPIOB_PIN15)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ - PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ - PIN_OSPEED_HIGH(GPIOB_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ - PIN_OSPEED_HIGH(GPIOB_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN15)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ - PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN15)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ - PIN_ODR_HIGH(GPIOB_PIN1) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_PIN3) | \ - PIN_ODR_HIGH(GPIOB_PIN4) | \ - PIN_ODR_HIGH(GPIOB_PIN5) | \ - PIN_ODR_HIGH(GPIOB_PIN6) | \ - PIN_ODR_LOW(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_PIN9) | \ - PIN_ODR_HIGH(GPIOB_PIN10) | \ - PIN_ODR_HIGH(GPIOB_PIN11) | \ - PIN_ODR_HIGH(GPIOB_PIN12) | \ - PIN_ODR_HIGH(GPIOB_PIN13) | \ - PIN_ODR_HIGH(GPIOB_PIN14) | \ - PIN_ODR_HIGH(GPIOB_PIN15)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ - PIN_AFIO_AF(GPIOB_PIN1, 0) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0) | \ - PIN_AFIO_AF(GPIOB_PIN3, 0) | \ - PIN_AFIO_AF(GPIOB_PIN4, 0) | \ - PIN_AFIO_AF(GPIOB_PIN5, 0) | \ - PIN_AFIO_AF(GPIOB_PIN6, 4) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ - PIN_AFIO_AF(GPIOB_PIN9, 0) | \ - PIN_AFIO_AF(GPIOB_PIN10, 0) | \ - PIN_AFIO_AF(GPIOB_PIN11, 0) | \ - PIN_AFIO_AF(GPIOB_PIN12, 0) | \ - PIN_AFIO_AF(GPIOB_PIN13, 0) | \ - PIN_AFIO_AF(GPIOB_PIN14, 0) | \ - PIN_AFIO_AF(GPIOB_PIN15, 0)) - -/* - * GPIOC setup: - * - * PC0 - PIN0 (input pullup). - * PC1 - PIN1 (input pullup). - * PC2 - PIN2 (input pullup). - * PC3 - PIN3 (input pullup). - * PC4 - PIN4 (input pullup). - * PC5 - PIN5 (input pullup). - * PC6 - PIN6 (input pullup). - * PC7 - PIN7 (input pullup). - * PC8 - PIN8 (input pullup). - * PC9 - PIN9 (input pullup). - * PC10 - PIN10 (input pullup). - * PC11 - PIN11 (input pullup). - * PC12 - PIN12 (input pullup). - * PC13 - PIN13 (input pullup). - * PC14 - PIN14 (input floating). - * PC15 - PIN15 (input floating). - */ -#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ - PIN_MODE_INPUT(GPIOC_PIN1) | \ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PIN3) | \ - PIN_MODE_INPUT(GPIOC_PIN4) | \ - PIN_MODE_INPUT(GPIOC_PIN5) | \ - PIN_MODE_INPUT(GPIOC_PIN6) | \ - PIN_MODE_INPUT(GPIOC_PIN7) | \ - PIN_MODE_INPUT(GPIOC_PIN8) | \ - PIN_MODE_INPUT(GPIOC_PIN9) | \ - PIN_MODE_INPUT(GPIOC_PIN10) | \ - PIN_MODE_INPUT(GPIOC_PIN11) | \ - PIN_MODE_INPUT(GPIOC_PIN12) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_PIN14) | \ - PIN_MODE_INPUT(GPIOC_PIN15)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ - PIN_OSPEED_HIGH(GPIOC_PIN14) | \ - PIN_OSPEED_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN15)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ - PIN_ODR_HIGH(GPIOC_PIN1) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PIN3) | \ - PIN_ODR_HIGH(GPIOC_PIN4) | \ - PIN_ODR_HIGH(GPIOC_PIN5) | \ - PIN_ODR_HIGH(GPIOC_PIN6) | \ - PIN_ODR_HIGH(GPIOC_PIN7) | \ - PIN_ODR_HIGH(GPIOC_PIN8) | \ - PIN_ODR_HIGH(GPIOC_PIN9) | \ - PIN_ODR_HIGH(GPIOC_PIN10) | \ - PIN_ODR_HIGH(GPIOC_PIN11) | \ - PIN_ODR_HIGH(GPIOC_PIN12) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_PIN14) | \ - PIN_ODR_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ - PIN_AFIO_AF(GPIOC_PIN1, 0) | \ - PIN_AFIO_AF(GPIOC_PIN2, 0) | \ - PIN_AFIO_AF(GPIOC_PIN3, 0) | \ - PIN_AFIO_AF(GPIOC_PIN4, 0) | \ - PIN_AFIO_AF(GPIOC_PIN5, 0) | \ - PIN_AFIO_AF(GPIOC_PIN6, 0) | \ - PIN_AFIO_AF(GPIOC_PIN7, 0)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ - PIN_AFIO_AF(GPIOC_PIN9, 0) | \ - PIN_AFIO_AF(GPIOC_PIN10, 0) | \ - PIN_AFIO_AF(GPIOC_PIN11, 0) | \ - PIN_AFIO_AF(GPIOC_PIN12, 0) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0) | \ - PIN_AFIO_AF(GPIOC_PIN14, 0) | \ - PIN_AFIO_AF(GPIOC_PIN15, 0)) - -/* - * GPIOD setup: - * - * PD0 - PIN0 (input pullup). - * PD1 - PIN1 (input pullup). - * PD2 - PIN2 (input pullup). - * PD3 - PIN3 (input pullup). - * PD4 - PIN4 (input pullup). - * PD5 - PIN5 (input pullup). - * PD6 - PIN6 (input pullup). - * PD7 - PIN7 (input pullup). - * PD8 - PIN8 (input pullup). - * PD9 - PIN9 (input pullup). - * PD11 - PIN10 (input pullup). - * PD11 - PIN11 (input pullup). - * PD12 - PIN12 (input pullup). - * PD13 - PIN13 (input pullup). - * PD14 - PIN14 (input pullup). - * PD15 - PIN15 (input pullup). - */ -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ - PIN_MODE_INPUT(GPIOD_PIN1) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_INPUT(GPIOD_PIN4) | \ - PIN_MODE_INPUT(GPIOD_PIN5) | \ - PIN_MODE_INPUT(GPIOD_PIN6) | \ - PIN_MODE_INPUT(GPIOD_PIN7) | \ - PIN_MODE_INPUT(GPIOD_PIN8) | \ - PIN_MODE_INPUT(GPIOD_PIN9) | \ - PIN_MODE_INPUT(GPIOD_PIN10) | \ - PIN_MODE_INPUT(GPIOD_PIN11) | \ - PIN_MODE_INPUT(GPIOD_PIN12) | \ - PIN_MODE_INPUT(GPIOD_PIN13) | \ - PIN_MODE_INPUT(GPIOD_PIN14) | \ - PIN_MODE_INPUT(GPIOD_PIN15)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN15)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN15)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ - PIN_ODR_HIGH(GPIOD_PIN1) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_PIN4) | \ - PIN_ODR_HIGH(GPIOD_PIN5) | \ - PIN_ODR_HIGH(GPIOD_PIN6) | \ - PIN_ODR_HIGH(GPIOD_PIN7) | \ - PIN_ODR_HIGH(GPIOD_PIN8) | \ - PIN_ODR_HIGH(GPIOD_PIN9) | \ - PIN_ODR_HIGH(GPIOD_PIN10) | \ - PIN_ODR_HIGH(GPIOD_PIN11) | \ - PIN_ODR_HIGH(GPIOD_PIN12) | \ - PIN_ODR_HIGH(GPIOD_PIN13) | \ - PIN_ODR_HIGH(GPIOD_PIN14) | \ - PIN_ODR_HIGH(GPIOD_PIN15)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ - PIN_AFIO_AF(GPIOD_PIN1, 0) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0) | \ - PIN_AFIO_AF(GPIOD_PIN4, 0) | \ - PIN_AFIO_AF(GPIOD_PIN5, 0) | \ - PIN_AFIO_AF(GPIOD_PIN6, 0) | \ - PIN_AFIO_AF(GPIOD_PIN7, 0)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ - PIN_AFIO_AF(GPIOD_PIN9, 0) | \ - PIN_AFIO_AF(GPIOD_PIN10, 0) | \ - PIN_AFIO_AF(GPIOD_PIN11, 0) | \ - PIN_AFIO_AF(GPIOD_PIN12, 0) | \ - PIN_AFIO_AF(GPIOD_PIN13, 0) | \ - PIN_AFIO_AF(GPIOD_PIN14, 0) | \ - PIN_AFIO_AF(GPIOD_PIN15, 0)) - -/* - * GPIOE setup: - * - * PE0 - PIN0 (input pullup). - * PE1 - PIN1 (input pullup). - * PE2 - PIN2 (input pullup). - * PE3 - PIN3 L3GD20_CS (output pushpull maximum). - * PE4 - PIN4 (input pullup). - * PE5 - PIN5 (input pullup). - * PE6 - PIN6 (input pullup). - * PE7 - PIN7 (input pullup). - * PE8 - PIN8 (output pushpull maximum). - * PE9 - PIN9 (output pushpull maximum). - * PE10 - PIN10 (output pushpull maximum). - * PE11 - PIN11 (output pushpull maximum). - * PE12 - PIN12 (output pushpull maximum). - * PE13 - PIN13 (output pushpull maximum). - * PE14 - PIN14 (output pushpull maximum). - * PE15 - PIN15 (output pushpull maximum). - */ -#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ - PIN_MODE_INPUT(GPIOE_PIN1) | \ - PIN_MODE_INPUT(GPIOE_PIN2) |\ - PIN_MODE_OUTPUT(GPIOE_PIN3) | \ - PIN_MODE_INPUT(GPIOE_PIN4) |\ - PIN_MODE_INPUT(GPIOE_PIN5) |\ - PIN_MODE_INPUT(GPIOE_PIN6) | \ - PIN_MODE_INPUT(GPIOE_PIN7) | \ - PIN_MODE_OUTPUT(GPIOE_PIN8) | \ - PIN_MODE_OUTPUT(GPIOE_PIN9) | \ - PIN_MODE_OUTPUT(GPIOE_PIN10) | \ - PIN_MODE_OUTPUT(GPIOE_PIN11) | \ - PIN_MODE_OUTPUT(GPIOE_PIN12) | \ - PIN_MODE_OUTPUT(GPIOE_PIN13) | \ - PIN_MODE_OUTPUT(GPIOE_PIN14) | \ - PIN_MODE_OUTPUT(GPIOE_PIN15)) -#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ - PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ - PIN_OSPEED_HIGH(GPIOE_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ - PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ - PIN_OSPEED_HIGH(GPIOE_PIN8) | \ - PIN_OSPEED_HIGH(GPIOE_PIN9) | \ - PIN_OSPEED_HIGH(GPIOE_PIN10) | \ - PIN_OSPEED_HIGH(GPIOE_PIN11) | \ - PIN_OSPEED_HIGH(GPIOE_PIN12) | \ - PIN_OSPEED_HIGH(GPIOE_PIN13) | \ - PIN_OSPEED_HIGH(GPIOE_PIN14) | \ - PIN_OSPEED_HIGH(GPIOE_PIN15)) -#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ - PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ - PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ - PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ - PIN_PUPDR_FLOATING(GPIOE_PIN15)) -#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ - PIN_ODR_HIGH(GPIOE_PIN1) | \ - PIN_ODR_HIGH(GPIOE_PIN2) | \ - PIN_ODR_HIGH(GPIOE_PIN3) | \ - PIN_ODR_HIGH(GPIOE_PIN4) | \ - PIN_ODR_HIGH(GPIOE_PIN5) | \ - PIN_ODR_HIGH(GPIOE_PIN6) | \ - PIN_ODR_HIGH(GPIOE_PIN7) | \ - PIN_ODR_LOW(GPIOE_PIN8) | \ - PIN_ODR_LOW(GPIOE_PIN9) | \ - PIN_ODR_LOW(GPIOE_PIN10) | \ - PIN_ODR_LOW(GPIOE_PIN11) | \ - PIN_ODR_LOW(GPIOE_PIN12) | \ - PIN_ODR_LOW(GPIOE_PIN13) | \ - PIN_ODR_LOW(GPIOE_PIN14) | \ - PIN_ODR_LOW(GPIOE_PIN15)) -#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ - PIN_AFIO_AF(GPIOE_PIN1, 0) | \ - PIN_AFIO_AF(GPIOE_PIN2, 0) |\ - PIN_AFIO_AF(GPIOE_PIN3, 0) | \ - PIN_AFIO_AF(GPIOE_PIN4, 0) |\ - PIN_AFIO_AF(GPIOE_PIN5, 0) |\ - PIN_AFIO_AF(GPIOE_PIN6, 0) | \ - PIN_AFIO_AF(GPIOE_PIN7, 0)) -#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ - PIN_AFIO_AF(GPIOE_PIN9, 0) | \ - PIN_AFIO_AF(GPIOE_PIN10, 0) | \ - PIN_AFIO_AF(GPIOE_PIN11, 0) | \ - PIN_AFIO_AF(GPIOE_PIN12, 0) | \ - PIN_AFIO_AF(GPIOE_PIN13, 0) | \ - PIN_AFIO_AF(GPIOE_PIN14, 0) | \ - PIN_AFIO_AF(GPIOE_PIN15, 0)) - -/* - * GPIOF setup: - * - * PF0 - I2C2_SDA (input floating). - * PF1 - I2C2_SCL (input floating). - * PF2 - PIN2 (input pullup). - * PF3 - PIN3 (input pullup). - * PF4 - PIN4 (input pullup). - * PF5 - PIN5 (input pullup). - * PF6 - PIN6 (input pullup). - * PF7 - PIN7 (input pullup). - * PF8 - PIN8 (input pullup). - * PF9 - PIN9 (input pullup). - * PF10 - PIN10 (input pullup). - * PF11 - PIN11 (input pullup). - * PF12 - PIN12 (input pullup). - * PF13 - PIN13 (input pullup). - * PF14 - PIN14 (input pullup). - * PF15 - PIN15 (input pullup). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ - PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_PIN7) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ - PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ - PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ - PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ - PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_PIN7) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ - PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0) | \ - PIN_AFIO_AF(GPIOF_PIN7, 0)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0)) - -/* - * GPIOG setup: - * - * PG0 - PIN0 (input pullup). - * PG1 - PIN1 (input pullup). - * PG2 - PIN2 (input pullup). - * PG3 - PIN3 (input pullup). - * PG4 - PIN4 (input pullup). - * PG5 - PIN5 (input pullup). - * PG6 - PIN6 (input pullup). - * PG7 - PIN7 (input pullup). - * PG8 - PIN8 (input pullup). - * PG9 - PIN9 (input pullup). - * PG10 - PIN10 (input pullup). - * PG11 - PIN11 (input pullup). - * PG12 - PIN12 (input pullup). - * PG13 - PIN13 (input pullup). - * PG14 - PIN14 (input pullup). - * PG15 - PIN15 (input pullup). - */ -#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ - PIN_MODE_INPUT(GPIOG_PIN1) | \ - PIN_MODE_INPUT(GPIOG_PIN2) | \ - PIN_MODE_INPUT(GPIOG_PIN3) | \ - PIN_MODE_INPUT(GPIOG_PIN4) | \ - PIN_MODE_INPUT(GPIOG_PIN5) | \ - PIN_MODE_INPUT(GPIOG_PIN6) | \ - PIN_MODE_INPUT(GPIOG_PIN7) | \ - PIN_MODE_INPUT(GPIOG_PIN8) | \ - PIN_MODE_INPUT(GPIOG_PIN9) | \ - PIN_MODE_INPUT(GPIOG_PIN10) | \ - PIN_MODE_INPUT(GPIOG_PIN11) | \ - PIN_MODE_INPUT(GPIOG_PIN12) | \ - PIN_MODE_INPUT(GPIOG_PIN13) | \ - PIN_MODE_INPUT(GPIOG_PIN14) | \ - PIN_MODE_INPUT(GPIOG_PIN15)) -#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOG_PIN15)) -#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOG_PIN15)) -#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ - PIN_ODR_HIGH(GPIOG_PIN1) | \ - PIN_ODR_HIGH(GPIOG_PIN2) | \ - PIN_ODR_HIGH(GPIOG_PIN3) | \ - PIN_ODR_HIGH(GPIOG_PIN4) | \ - PIN_ODR_HIGH(GPIOG_PIN5) | \ - PIN_ODR_HIGH(GPIOG_PIN6) | \ - PIN_ODR_HIGH(GPIOG_PIN7) | \ - PIN_ODR_HIGH(GPIOG_PIN8) | \ - PIN_ODR_HIGH(GPIOG_PIN9) | \ - PIN_ODR_HIGH(GPIOG_PIN10) | \ - PIN_ODR_HIGH(GPIOG_PIN11) | \ - PIN_ODR_HIGH(GPIOG_PIN12) | \ - PIN_ODR_HIGH(GPIOG_PIN13) | \ - PIN_ODR_HIGH(GPIOG_PIN14) | \ - PIN_ODR_HIGH(GPIOG_PIN15)) -#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ - PIN_AFIO_AF(GPIOG_PIN1, 0) | \ - PIN_AFIO_AF(GPIOG_PIN2, 0) | \ - PIN_AFIO_AF(GPIOG_PIN3, 0) | \ - PIN_AFIO_AF(GPIOG_PIN4, 0) | \ - PIN_AFIO_AF(GPIOG_PIN5, 0) | \ - PIN_AFIO_AF(GPIOG_PIN6, 0) | \ - PIN_AFIO_AF(GPIOG_PIN7, 0)) -#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ - PIN_AFIO_AF(GPIOG_PIN9, 0) | \ - PIN_AFIO_AF(GPIOG_PIN10, 0) | \ - PIN_AFIO_AF(GPIOG_PIN11, 0) | \ - PIN_AFIO_AF(GPIOG_PIN12, 0) | \ - PIN_AFIO_AF(GPIOG_PIN13, 0) | \ - PIN_AFIO_AF(GPIOG_PIN14, 0) | \ - PIN_AFIO_AF(GPIOG_PIN15, 0)) - -/* - * GPIOH setup: - * - * PH0 - PIN0 (input pullup). - * PH1 - PIN1 (input pullup). - * PH2 - PIN2 (input pullup). - * PH3 - PIN3 (input pullup). - * PH4 - PIN4 (input pullup). - * PH5 - PIN5 (input pullup). - * PH6 - PIN6 (input pullup). - * PH7 - PIN7 (input pullup). - * PH8 - PIN8 (input pullup). - * PH9 - PIN9 (input pullup). - * PH10 - PIN10 (input pullup). - * PH11 - PIN11 (input pullup). - * PH12 - PIN12 (input pullup). - * PH13 - PIN13 (input pullup). - * PH14 - PIN14 (input pullup). - * PH15 - PIN15 (input pullup). - */ -#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ - PIN_MODE_INPUT(GPIOH_PIN1) | \ - PIN_MODE_INPUT(GPIOH_PIN2) | \ - PIN_MODE_INPUT(GPIOH_PIN3) | \ - PIN_MODE_INPUT(GPIOH_PIN4) | \ - PIN_MODE_INPUT(GPIOH_PIN5) | \ - PIN_MODE_INPUT(GPIOH_PIN6) | \ - PIN_MODE_INPUT(GPIOH_PIN7) | \ - PIN_MODE_INPUT(GPIOH_PIN8) | \ - PIN_MODE_INPUT(GPIOH_PIN9) | \ - PIN_MODE_INPUT(GPIOH_PIN10) | \ - PIN_MODE_INPUT(GPIOH_PIN11) | \ - PIN_MODE_INPUT(GPIOH_PIN12) | \ - PIN_MODE_INPUT(GPIOH_PIN13) | \ - PIN_MODE_INPUT(GPIOH_PIN14) | \ - PIN_MODE_INPUT(GPIOH_PIN15)) -#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOH_PIN15)) -#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOH_PIN15)) -#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ - PIN_ODR_HIGH(GPIOH_PIN1) | \ - PIN_ODR_HIGH(GPIOH_PIN2) | \ - PIN_ODR_HIGH(GPIOH_PIN3) | \ - PIN_ODR_HIGH(GPIOH_PIN4) | \ - PIN_ODR_HIGH(GPIOH_PIN5) | \ - PIN_ODR_HIGH(GPIOH_PIN6) | \ - PIN_ODR_HIGH(GPIOH_PIN7) | \ - PIN_ODR_HIGH(GPIOH_PIN8) | \ - PIN_ODR_HIGH(GPIOH_PIN9) | \ - PIN_ODR_HIGH(GPIOH_PIN10) | \ - PIN_ODR_HIGH(GPIOH_PIN11) | \ - PIN_ODR_HIGH(GPIOH_PIN12) | \ - PIN_ODR_HIGH(GPIOH_PIN13) | \ - PIN_ODR_HIGH(GPIOH_PIN14) | \ - PIN_ODR_HIGH(GPIOH_PIN15)) -#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ - PIN_AFIO_AF(GPIOH_PIN1, 0) | \ - PIN_AFIO_AF(GPIOH_PIN2, 0) | \ - PIN_AFIO_AF(GPIOH_PIN3, 0) | \ - PIN_AFIO_AF(GPIOH_PIN4, 0) | \ - PIN_AFIO_AF(GPIOH_PIN5, 0) | \ - PIN_AFIO_AF(GPIOH_PIN6, 0) | \ - PIN_AFIO_AF(GPIOH_PIN7, 0)) -#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ - PIN_AFIO_AF(GPIOH_PIN9, 0) | \ - PIN_AFIO_AF(GPIOH_PIN10, 0) | \ - PIN_AFIO_AF(GPIOH_PIN11, 0) | \ - PIN_AFIO_AF(GPIOH_PIN12, 0) | \ - PIN_AFIO_AF(GPIOH_PIN13, 0) | \ - PIN_AFIO_AF(GPIOH_PIN14, 0) | \ - PIN_AFIO_AF(GPIOH_PIN15, 0)) - - -/* - * USB bus activation macro, required by the USB driver. - */ -// #define usb_lld_connect_bus(usbp) -#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) -// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) -/* - * USB bus de-activation macro, required by the USB driver. - */ -// #define usb_lld_disconnect_bus(usbp) -#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) -// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.mk b/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.mk deleted file mode 100644 index 43377629a3c..00000000000 --- a/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List of all the board related files. -BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC/board.c - -# Required include directories -BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC diff --git a/keyboards/proton_c/bootloader_defs.h b/keyboards/proton_c/bootloader_defs.h deleted file mode 100644 index 3b0e9d20a6a..00000000000 --- a/keyboards/proton_c/bootloader_defs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/keyboards/proton_c/config.h b/keyboards/proton_c/config.h index 1a2346d415d..5ebd17f99ed 100644 --- a/keyboards/proton_c/config.h +++ b/keyboards/proton_c/config.h @@ -33,7 +33,6 @@ #define MATRIX_ROW_PINS { B9 } #define MATRIX_COL_PINS { B0 } - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 6 @@ -63,11 +62,6 @@ */ //#define FORCE_NKRO -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -118,4 +112,3 @@ // #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) //#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP //#define WS2812_EXTERNAL_PULLUP - diff --git a/keyboards/proton_c/halconf.h b/keyboards/proton_c/halconf.h deleted file mode 100644 index 8fe8e0c6f58..00000000000 --- a/keyboards/proton_c/halconf.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef HALCONF_H -#define HALCONF_H - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC TRUE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT TRUE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the QSPI subsystem. - */ -#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) -#define HAL_USE_QSPI FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB TRUE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 16 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 256 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 1 -#endif - -/** - * @brief Serial over USB number of buffers. - * @note The default is 2 buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_NUMBER 2 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* UART driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) -#define UART_USE_WAIT FALSE -#endif - -/** - * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define UART_USE_MUTUAL_EXCLUSION FALSE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* HALCONF_H */ - -/** @} */ diff --git a/keyboards/proton_c/mcuconf.h b/keyboards/proton_c/mcuconf.h deleted file mode 100644 index 7c3c6e570ce..00000000000 --- a/keyboards/proton_c/mcuconf.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef MCUCONF_H -#define MCUCONF_H - -/* - * STM32F3xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F3xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PREDIV_VALUE 1 -#define STM32_PLLMUL_VALUE 9 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 -#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 -#define STM32_USART1SW STM32_USART1SW_PCLK -#define STM32_USART2SW STM32_USART2SW_PCLK -#define STM32_USART3SW STM32_USART3SW_PCLK -#define STM32_UART4SW STM32_UART4SW_PCLK -#define STM32_UART5SW STM32_UART5SW_PCLK -#define STM32_I2C1SW STM32_I2C1SW_SYSCLK -#define STM32_I2C2SW STM32_I2C2SW_SYSCLK -#define STM32_TIM1SW STM32_TIM1SW_PCLK2 -#define STM32_TIM8SW STM32_TIM8SW_PCLK2 -#define STM32_RTCSEL STM32_RTCSEL_LSI -#define STM32_USB_CLOCK_REQUIRED TRUE -#define STM32_USBPRE STM32_USBPRE_DIV1P5 - -#undef STM32_HSE_BYPASS -// #error "oh no" -// #endif - -/* - * ADC driver system settings. - */ -#define STM32_ADC_DUAL_MODE FALSE -#define STM32_ADC_COMPACT_SAMPLES FALSE -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_USE_ADC2 FALSE -#define STM32_ADC_USE_ADC3 FALSE -#define STM32_ADC_USE_ADC4 FALSE -#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) -#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) -#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) -#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC2_DMA_PRIORITY 2 -#define STM32_ADC_ADC3_DMA_PRIORITY 2 -#define STM32_ADC_ADC4_DMA_PRIORITY 2 -#define STM32_ADC_ADC12_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_IRQ_PRIORITY 5 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 -#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 -#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * DAC driver system settings. - */ -#define STM32_DAC_DUAL_MODE FALSE -#define STM32_DAC_USE_DAC1_CH1 TRUE -#define STM32_DAC_USE_DAC1_CH2 TRUE -#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM6 TRUE -#define STM32_GPT_USE_TIM7 TRUE -#define STM32_GPT_USE_TIM8 TRUE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM6_IRQ_PRIORITY 7 -#define STM32_GPT_TIM7_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 10 -#define STM32_I2C_I2C2_IRQ_PRIORITY 10 -#define STM32_I2C_USE_DMA TRUE -#define STM32_I2C_I2C1_DMA_PRIORITY 1 -#define STM32_I2C_I2C2_DMA_PRIORITY 1 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 TRUE -#define STM32_PWM_USE_TIM3 TRUE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_USB1 TRUE -#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 -#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 - -/* - * WDG driver system settings. - */ -#define STM32_WDG_USE_IWDG FALSE - -#endif /* MCUCONF_H */ diff --git a/keyboards/proton_c/rules.mk b/keyboards/proton_c/rules.mk index f682c1fd6b0..4edc75929eb 100644 --- a/keyboards/proton_c/rules.mk +++ b/keyboards/proton_c/rules.mk @@ -1,38 +1,4 @@ -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F3xx - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -MCU_LDSCRIPT = STM32F303xC - -# Startup code to use -# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f3xx - -# Board: it should exist either in /os/hal/boards/ -# or /boards -BOARD = GENERIC_STM32_F303XC - -# Cortex version -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -ARMV = 7 - -USE_FPU = yes - -# Vector table for application -# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ -# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB -# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 -OPT_DEFS = - -# Options to pass to dfu-util when flashing -DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +MCU = STM32F303 # Build Options # comment out to disable the options. diff --git a/keyboards/ps2avrGB/README.md b/keyboards/ps2avrGB/README.md deleted file mode 100644 index 8399dff029e..00000000000 --- a/keyboards/ps2avrGB/README.md +++ /dev/null @@ -1,78 +0,0 @@ -ps2avrGB keyboard firmware -========================== - -This is a port of the QMK firmware for boards that are based on the -ps2avrGB firmware, like the [ps2avrGB -keyboard](https://www.keyclack.com/product/gb-ps2avrgb/) or the ones sold -by [Winkeyless](http://winkeyless.kr/product/ps2avrgb-parts/). - -Note that this is a complete replacement for the firmware, so you won't be -using Bootmapper Client to change any keyboard settings, since not all the -USB report options are supported. - -This is an example based on the b.mini keyboard for making other keyboards -compatible with QMK; fully supported boards have their own directory. - -## Supported Boards - -- [b.fake](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bfake) -- [b.mini](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bmini) -- [b.face](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bface) -- [pearl](https://github.com/qmk/qmk_firmware/tree/master/keyboards/pearl) - -## Installing - -First, install the requirements. These commands are for OSX, but all you -need is the AVR toolchain and `bootloadHID` for flashing: - -``` -$ brew cask install crosspack-avr -$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb -``` - -In order to use the `./program` script, which can reboot the board into -the bootloader, you'll need Python 2 with PyUSB installed: - -``` -$ pip install pyusb -``` - -Then, with the keyboard plugged in, simply run this command from the -`qmk_firmware` directory: - -``` -$ make ps2avrGB:program -``` - -If you prefer, you can just build it and flash the firmware directly with -`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it -in the bootloader: - -``` -$ make ps2avrGB -$ bootloadHID -r ps2avrGB_default.hex -``` - -## Setting the board to bootloader mode - -If you're lucky, the programming script does this automagically for you. If -however this doesn't work for you, you need to enter the bootloader mode manually -by plugging the keyboard in while holding the bootloader key. If you did this -correctly the LEDs will blink and you'll be able to flash your firmware. - -The bootloader key is the top left key of your matrix. For a standard board -from winkeyless.kr this is `L_Ctrl`, but for some custom boards running ps2avrGB -this might be different. For the Pearl it's `Esc`, for a b.fake it is `q`. If -you're unsure you should be able to see the key in the bootmapper client. - - -## Troubleshooting - -From my experience, it's really hard to brick these boards. But these -tricks have been useful when it got stuck in a weird scenario. - -1. Try plugging the board in while holding the bootloader key. This will force - it to boot only the bootloader without loading the firmware. Once this is - done, just reflash the board with the original firmware. -2. Sometimes USB hubs can act weird, so try connecting the board directly - to your computer or plugging/unplugging the USB hub. diff --git a/keyboards/ps2avrGB/bmini.h b/keyboards/ps2avrGB/bmini.h deleted file mode 100644 index 65ffbe94797..00000000000 --- a/keyboards/ps2avrGB/bmini.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef BMINI_H -#define BMINI_H - -#include "quantum.h" - -#define KEYMAP( \ - K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \ - K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \ - K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \ - K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \ - K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \ - K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \ -){ \ - { K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB0, KC0, KD0, KE0 }, \ - { K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \ - { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC_NO, KD2, KE2 }, \ - { K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ - { K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \ - { K05, KC_NO, K25, K35, K45, K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB5, KC5, KD5, KE5 }, \ - { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \ - { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ -} - -#define KC_KEYMAP( \ - K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \ - K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \ - K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \ - K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \ - K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \ - K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \ -) \ -{ \ - { KC_##K00, KC_##K10, KC_##K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB0, KC_##KC0, KC_##KD0, KC_##KE0 }, \ - { KC_##K01, KC_##K11, KC_##K21, KC_##K31, KC_##K41, KC_##K51, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA1, KC_##KB1, KC_NO, KC_##KD1, KC_##KE1 }, \ - { KC_##K02, KC_##K12, KC_##K22, KC_##K32, KC_##K42, KC_##K52, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA2, KC_##KB2, KC_NO, KC_##KD2, KC_##KE2 }, \ - { KC_##K03, KC_##K13, KC_##K23, KC_##K33, KC_##K43, KC_##K53, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA3, KC_##KB3, KC_##KC3, KC_##KD3, KC_NO }, \ - { KC_##K04, KC_##K14, KC_##K24, KC_##K34, KC_##K44, KC_##K54, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA4, KC_##KB4, KC_##KC4, KC_NO, KC_##KE4 }, \ - { KC_##K05, KC_NO, KC_##K25, KC_##K35, KC_##K45, KC_##K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB5, KC_##KC5, KC_##KD5, KC_##KE5 }, \ - { KC_##K06, KC_##K16, KC_##K26, KC_##K36, KC_##K46, KC_##K56, KC_##K66, KC_##K76, KC_##K86, KC_##K96, KC_##KA6, KC_##KB6, KC_##KC6, KC_##KD6, KC_##KE6 }, \ - { KC_##K07, KC_##K17, KC_##K27, KC_##K37, KC_##K47, KC_##K57, KC_##K67, KC_##K77, KC_NO, KC_NO, KC_##KA7, KC_##KB7, KC_##KC7, KC_##KD7, KC_##KE7 } \ -} - -#endif diff --git a/keyboards/ps2avrGB/config.h b/keyboards/ps2avrGB/config.h deleted file mode 100644 index fc17b5d5e2e..00000000000 --- a/keyboards/ps2avrGB/config.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#define VENDOR_ID 0x20A0 -#define PRODUCT_ID 0x422D -// TODO: share these strings with usbconfig.h -// Edit usbconfig.h to change these. -#define MANUFACTURER winkeyless.kr -#define PRODUCT ps2avrGB - -/* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 15 - -#define RGBLED_NUM 16 -#define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 -#define BOOTLOADHID_BOOTLOADER 1 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - -#endif diff --git a/keyboards/ps2avrGB/i2c.c b/keyboards/ps2avrGB/i2c.c deleted file mode 100644 index a4f95213524..00000000000 --- a/keyboards/ps2avrGB/i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#include -#include - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif diff --git a/keyboards/ps2avrGB/keymaps/default/keymap.c b/keyboards/ps2avrGB/keymaps/default/keymap.c deleted file mode 100644 index 5c52e1d9b68..00000000000 --- a/keyboards/ps2avrGB/keymaps/default/keymap.c +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "bmini.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_HOME,KC_END, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_DEL, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_INS, - MO(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, KC_PGUP, - KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL,KC_LALT,KC_LGUI, KC_SPC, KC_RGUI,KC_RALT,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT - ), - [1] = KEYMAP( - KC_TRNS,RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI,RGB_HUD,RGB_SAD,RGB_VAD,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_END, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_DEL, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_INS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_RGHT - ), -}; diff --git a/keyboards/ps2avrGB/matrix.c b/keyboards/ps2avrGB/matrix.c deleted file mode 100644 index 245813dfd2d..00000000000 --- a/keyboards/ps2avrGB/matrix.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include - -#include "matrix.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_set_row_status(uint8_t row); -uint8_t bit_reverse(uint8_t x); - -void matrix_init(void) { - // all outputs for rows high - DDRB = 0xFF; - PORTB = 0xFF; - // all inputs for columns - DDRA = 0x00; - DDRC &= ~(0x111111<<2); - DDRD &= ~(1< 7 - (~PINA) & 0xFF - ) | ( - // cols 8..13, PORTC 7 -> 0 - bit_reverse((~PINC) & 0xFF) << 8 - ) | ( - // col 14, PORTD 7 - ((~PIND) & (1 << PIND7)) << 7 - ); - - if (matrix_debouncing[row] != cols) { - matrix_debouncing[row] = cols; - debouncing = DEBOUNCE; - } - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_quantum(); - - return 1; -} - -// declarations -void matrix_set_row_status(uint8_t row) { - DDRB = (1 << row); - PORTB = ~(1 << row); -} - -uint8_t bit_reverse(uint8_t x) { - x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x; -} - -inline matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - -void matrix_print(void) { -} diff --git a/keyboards/ps2avrGB/program b/keyboards/ps2avrGB/program deleted file mode 100755 index b777b911066..00000000000 --- a/keyboards/ps2avrGB/program +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro , Sebastian Kaim -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from __future__ import print_function - -import os -import sys -import time -import usb - - -def checkForKeyboardInNormalMode(): - """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" - return usb.core.find(idVendor=0x20A0, idProduct=0x422D) - -def checkForKeyboardInBootloaderMode(): - """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" - return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) - -def flashKeyboard(firmware_file): - """Calls bootloadHID to flash the given file to the device.""" - print('Flashing firmware to device ...') - if os.system('bootloadHID -r "%s"' % firmware_file) == 0: - print('\nDone!') - else: - print('\nbootloadHID returned an error.') - -def printDeviceInfo(dev): - """Prints all infos for a given USB device""" - print('Device Information:') - print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) - print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) - print('Manufacturer: %s' % (dev.iManufacturer)) - print('Serial: %s' % (dev.iSerialNumber)) - print('Product: %s' % (dev.iProduct), end='\n\n') - -def sendDeviceToBootloaderMode(dev): - """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" - try: - dev.set_configuration() - - request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - - USBRQ_HID_SET_REPORT = 0x09 - HID_REPORT_OPTION = 0x0301 - - dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5) - except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - - -if len(sys.argv) < 2: - print('Usage: %s ' % sys.argv[0]) - sys.exit(1) - -kb = checkForKeyboardInNormalMode() - -if kb is not None: - print('Found a keyboard in normal mode. Attempting to send it to bootloader mode ...', end='') - sendDeviceToBootloaderMode(kb) - print(' done.') - print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") - print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") - -attempts = 12 # 60 seconds -found = False -for attempt in range(1, attempts + 1): - print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') - - if checkForKeyboardInBootloaderMode(): - print('Found', end='\n\n') - flashKeyboard(sys.argv[1]) - found = True - break - else: - print('Nothing.', end='') - - if attempt != attempts: # no need to wait on the last attempt - print(' Sleeping 5 seconds.', end='') - time.sleep(5) - - # print a newline - print() - -if not found: - print("Couldn't find a flashable keyboard. Aborting.") - sys.exit(2) - diff --git a/keyboards/ps2avrGB/ps2avrGB.c b/keyboards/ps2avrGB/ps2avrGB.c deleted file mode 100644 index 45ba37bffe7..00000000000 --- a/keyboards/ps2avrGB/ps2avrGB.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "ps2avrGB.h" -#include "rgblight.h" - -#include - -#include "action_layer.h" -#include "i2c.h" -#include "quantum.h" - -// for keyboard subdirectory level init functions -// @Override -void matrix_init_kb(void) { - // call user level keymaps, if any - matrix_init_user(); -} - -#ifdef RGBLIGHT_ENABLE -extern rgblight_config_t rgblight_config; - -// custom RGB driver -void rgblight_set(void) { - if (!rgblight_config.enable) { - for (uint8_t i=0; i - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include "quantum.h" - -#ifdef KEYBOARD_ps2avrGB_bfake - #include "bfake.h" -#endif - -#ifdef KEYBOARD_ps2avrGB_bmini_x2 - #include "bmini_x2.h" -#endif - -#endif diff --git a/keyboards/ps2avrGB/rules.mk b/keyboards/ps2avrGB/rules.mk deleted file mode 100644 index c7c12dcf17e..00000000000 --- a/keyboards/ps2avrGB/rules.mk +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2017 Luiz Ribeiro -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# MCU name -MCU = atmega32a -PROTOCOL = VUSB - -# unsupported features for now -NO_UART = yes -NO_SUSPEND_POWER_DOWN = yes - -# processor frequency -F_CPU = 12000000 - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = atmel-dfu - -# build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = yes -COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes -RGBLIGHT_CUSTOM_DRIVER = yes - -OPT_DEFS = -DDEBUG_LEVEL=0 - -# custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c - -# programming options -PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex diff --git a/keyboards/ps2avrGB/usbconfig.h b/keyboards/ps2avrGB/usbconfig.h deleted file mode 100644 index d2d848fcdc8..00000000000 --- a/keyboards/ps2avrGB/usbconfig.h +++ /dev/null @@ -1,396 +0,0 @@ -/* Name: usbconfig.h - * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers - * Author: Christian Starkjohann - * Creation Date: 2005-04-01 - * Tabsize: 4 - * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ - */ - -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ - -#include "config.h" - -/* -General Description: -This file is an example configuration (with inline documentation) for the USB -driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is -also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may -wire the lines to any other port, as long as D+ is also wired to INT0 (or any -other hardware interrupt, as long as it is the highest level interrupt, see -section at the end of this file). -*/ - -/* ---------------------------- Hardware Config ---------------------------- */ - -#define USB_CFG_IOPORTNAME D -/* This is the port where the USB bus is connected. When you configure it to - * "B", the registers PORTB, PINB and DDRB will be used. - */ -#define USB_CFG_DMINUS_BIT 3 -/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. - * This may be any bit in the port. - */ -#define USB_CFG_DPLUS_BIT 2 -/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. - * This may be any bit in the port. Please note that D+ must also be connected - * to interrupt pin INT0! [You can also use other interrupts, see section - * "Optional MCU Description" below, or you can connect D- to the interrupt, as - * it is required if you use the USB_COUNT_SOF feature. If you use D- for the - * interrupt, the USB interrupt will also be triggered at Start-Of-Frame - * markers every millisecond.] - */ -#define USB_CFG_CLOCK_KHZ (F_CPU/1000) -/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, - * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code - * require no crystal, they tolerate +/- 1% deviation from the nominal - * frequency. All other rates require a precision of 2000 ppm and thus a - * crystal! - * Since F_CPU should be defined to your actual clock rate anyway, you should - * not need to modify this setting. - */ -#define USB_CFG_CHECK_CRC 0 -/* Define this to 1 if you want that the driver checks integrity of incoming - * data packets (CRC checks). CRC checks cost quite a bit of code size and are - * currently only available for 18 MHz crystal clock. You must choose - * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. - */ - -/* ----------------------- Optional Hardware Config ------------------------ */ - -/* #define USB_CFG_PULLUP_IOPORTNAME D */ -/* If you connect the 1.5k pullup resistor from D- to a port pin instead of - * V+, you can connect and disconnect the device from firmware by calling - * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). - * This constant defines the port on which the pullup resistor is connected. - */ -/* #define USB_CFG_PULLUP_BIT 4 */ -/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined - * above) where the 1.5k pullup resistor is connected. See description - * above for details. - */ - -/* --------------------------- Functional Range ---------------------------- */ - -#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 -/* Define this to 1 if you want to compile a version with two endpoints: The - * default control endpoint 0 and an interrupt-in endpoint (any other endpoint - * number). - */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 -/* Define this to 1 if you want to compile a version with three endpoints: The - * default control endpoint 0, an interrupt-in endpoint 3 (or the number - * configured below) and a catch-all default interrupt-in endpoint as above. - * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. - */ -#define USB_CFG_EP3_NUMBER 3 -/* If the so-called endpoint 3 is used, it can now be configured to any other - * endpoint number (except 0) with this macro. Default if undefined is 3. - */ -/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ -/* The above macro defines the startup condition for data toggling on the - * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. - * Since the token is toggled BEFORE sending any data, the first packet is - * sent with the oposite value of this configuration! - */ -#define USB_CFG_IMPLEMENT_HALT 0 -/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature - * for endpoint 1 (interrupt endpoint). Although you may not need this feature, - * it is required by the standard. We have made it a config option because it - * bloats the code considerably. - */ -#define USB_CFG_SUPPRESS_INTR_CODE 0 -/* Define this to 1 if you want to declare interrupt-in endpoints, but don't - * want to send any data over them. If this macro is defined to 1, functions - * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if - * you need the interrupt-in endpoints in order to comply to an interface - * (e.g. HID), but never want to send any data. This option saves a couple - * of bytes in flash memory and the transmit buffers in RAM. - */ -#define USB_CFG_INTR_POLL_INTERVAL 1 -/* If you compile a version with endpoint 1 (interrupt-in), this is the poll - * interval. The value is in milliseconds and must not be less than 10 ms for - * low speed devices. - */ -#define USB_CFG_IS_SELF_POWERED 0 -/* Define this to 1 if the device has its own power supply. Set it to 0 if the - * device is powered from the USB bus. - */ -#define USB_CFG_MAX_BUS_POWER 500 -/* Set this variable to the maximum USB bus power consumption of your device. - * The value is in milliamperes. [It will be divided by two since USB - * communicates power requirements in units of 2 mA.] - */ -#define USB_CFG_IMPLEMENT_FN_WRITE 1 -/* Set this to 1 if you want usbFunctionWrite() to be called for control-out - * transfers. Set it to 0 if you don't need it and want to save a couple of - * bytes. - */ -#define USB_CFG_IMPLEMENT_FN_READ 0 -/* Set this to 1 if you need to send control replies which are generated - * "on the fly" when usbFunctionRead() is called. If you only want to send - * data from a static buffer, set it to 0 and return the data from - * usbFunctionSetup(). This saves a couple of bytes. - */ -#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 -/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. - * You must implement the function usbFunctionWriteOut() which receives all - * interrupt/bulk data sent to any endpoint other than 0. The endpoint number - * can be found in 'usbRxToken'. - */ -#define USB_CFG_HAVE_FLOWCONTROL 0 -/* Define this to 1 if you want flowcontrol over USB data. See the definition - * of the macros usbDisableAllRequests() and usbEnableAllRequests() in - * usbdrv.h. - */ -#define USB_CFG_DRIVER_FLASH_PAGE 0 -/* If the device has more than 64 kBytes of flash, define this to the 64 k page - * where the driver's constants (descriptors) are located. Or in other words: - * Define this to 1 for boot loaders on the ATMega128. - */ -#define USB_CFG_LONG_TRANSFERS 0 -/* Define this to 1 if you want to send/receive blocks of more than 254 bytes - * in a single control-in or control-out transfer. Note that the capability - * for long transfers increases the driver size. - */ -/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ -/* This macro is a hook if you want to do unconventional things. If it is - * defined, it's inserted at the beginning of received message processing. - * If you eat the received message and don't want default processing to - * proceed, do a return after doing your things. One possible application - * (besides debugging) is to flash a status LED on each packet. - */ -/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ -/* This macro is a hook if you need to know when an USB RESET occurs. It has - * one parameter which distinguishes between the start of RESET state and its - * end. - */ -/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ -/* This macro (if defined) is executed when a USB SET_ADDRESS request was - * received. - */ -#define USB_COUNT_SOF 1 -/* define this macro to 1 if you need the global variable "usbSofCount" which - * counts SOF packets. This feature requires that the hardware interrupt is - * connected to D- instead of D+. - */ -/* #ifdef __ASSEMBLER__ - * macro myAssemblerMacro - * in YL, TCNT0 - * sts timer0Snapshot, YL - * endm - * #endif - * #define USB_SOF_HOOK myAssemblerMacro - * This macro (if defined) is executed in the assembler module when a - * Start Of Frame condition is detected. It is recommended to define it to - * the name of an assembler macro which is defined here as well so that more - * than one assembler instruction can be used. The macro may use the register - * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages - * immediately after an SOF pulse may be lost and must be retried by the host. - * What can you do with this hook? Since the SOF signal occurs exactly every - * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in - * designs running on the internal RC oscillator. - * Please note that Start Of Frame detection works only if D- is wired to the - * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! - */ -#define USB_CFG_CHECK_DATA_TOGGLING 0 -/* define this macro to 1 if you want to filter out duplicate data packets - * sent by the host. Duplicates occur only as a consequence of communication - * errors, when the host does not receive an ACK. Please note that you need to - * implement the filtering yourself in usbFunctionWriteOut() and - * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable - * for each control- and out-endpoint to check for duplicate packets. - */ -#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 -/* define this macro to 1 if you want the function usbMeasureFrameLength() - * compiled in. This function can be used to calibrate the AVR's RC oscillator. - */ -#define USB_USE_FAST_CRC 0 -/* The assembler module has two implementations for the CRC algorithm. One is - * faster, the other is smaller. This CRC routine is only used for transmitted - * messages where timing is not critical. The faster routine needs 31 cycles - * per byte while the smaller one needs 61 to 69 cycles. The faster routine - * may be worth the 32 bytes bigger code size if you transmit lots of data and - * run the AVR close to its limit. - */ - -/* -------------------------- Device Description --------------------------- */ - -#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) -/* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you may use one of obdev's free - * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) -/* This is the ID of the product, low byte first. It is interpreted in the - * scope of the vendor ID. If you have registered your own VID with usb.org - * or if you have licensed a PID from somebody else, define it here. Otherwise - * you may use one of obdev's free shared VID/PID pairs. See the file - * USB-IDs-for-free.txt for details! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_VERSION 0x00, 0x02 -/* Version number of the device: Minor number first, then major number. - */ -#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' -#define USB_CFG_VENDOR_NAME_LEN 13 -/* These two values define the vendor name returned by the USB device. The name - * must be given as a list of characters under single quotes. The characters - * are interpreted as Unicode (UTF-16) entities. - * If you don't want a vendor name string, undefine these macros. - * ALWAYS define a vendor name containing your Internet domain name if you use - * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for - * details. - */ -#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' -#define USB_CFG_DEVICE_NAME_LEN 8 -/* Same as above for the device name. If you don't want a device name, undefine - * the macros. See the file USB-IDs-for-free.txt before you assign a name if - * you use a shared VID/PID. - */ -/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ -/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ -/* Same as above for the serial number. If you don't want a serial number, - * undefine the macros. - * It may be useful to provide the serial number through other means than at - * compile time. See the section about descriptor properties below for how - * to fine tune control over USB descriptors such as the string descriptor - * for the serial number. - */ -#define USB_CFG_DEVICE_CLASS 0 -#define USB_CFG_DEVICE_SUBCLASS 0 -/* See USB specification if you want to conform to an existing device class. - * Class 0xff is "vendor specific". - */ -#define USB_CFG_INTERFACE_CLASS 3 /* HID */ -#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ -#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ -/* See USB specification if you want to conform to an existing device class or - * protocol. The following classes must be set at interface level: - * HID class is 3, no subclass and protocol required (but may be useful!) - * CDC class is 2, use subclass 2 and protocol 1 for ACM - */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 -/* Define this to the length of the HID report descriptor, if you implement - * an HID device. Otherwise don't define it or define it to 0. - * If you use this define, you must add a PROGMEM character array named - * "usbHidReportDescriptor" to your code which contains the report descriptor. - * Don't forget to keep the array and this define in sync! - */ - -/* #define USB_PUBLIC static */ -/* Use the define above if you #include usbdrv.c instead of linking against it. - * This technique saves a couple of bytes in flash memory. - */ - -/* ------------------- Fine Control over USB Descriptors ------------------- */ -/* If you don't want to use the driver's default USB descriptors, you can - * provide our own. These can be provided as (1) fixed length static data in - * flash memory, (2) fixed length static data in RAM or (3) dynamically at - * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more - * information about this function. - * Descriptor handling is configured through the descriptor's properties. If - * no properties are defined or if they are 0, the default descriptor is used. - * Possible properties are: - * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched - * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is - * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if - * you want RAM pointers. - * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found - * in static memory is in RAM, not in flash memory. - * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), - * the driver must know the descriptor's length. The descriptor itself is - * found at the address of a well known identifier (see below). - * List of static descriptor names (must be declared PROGMEM if in flash): - * char usbDescriptorDevice[]; - * char usbDescriptorConfiguration[]; - * char usbDescriptorHidReport[]; - * char usbDescriptorString0[]; - * int usbDescriptorStringVendor[]; - * int usbDescriptorStringDevice[]; - * int usbDescriptorStringSerialNumber[]; - * Other descriptors can't be provided statically, they must be provided - * dynamically at runtime. - * - * Descriptor properties are or-ed or added together, e.g.: - * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) - * - * The following descriptors are defined: - * USB_CFG_DESCR_PROPS_DEVICE - * USB_CFG_DESCR_PROPS_CONFIGURATION - * USB_CFG_DESCR_PROPS_STRINGS - * USB_CFG_DESCR_PROPS_STRING_0 - * USB_CFG_DESCR_PROPS_STRING_VENDOR - * USB_CFG_DESCR_PROPS_STRING_PRODUCT - * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER - * USB_CFG_DESCR_PROPS_HID - * USB_CFG_DESCR_PROPS_HID_REPORT - * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) - * - * Note about string descriptors: String descriptors are not just strings, they - * are Unicode strings prefixed with a 2 byte header. Example: - * int serialNumberDescriptor[] = { - * USB_STRING_DESCRIPTOR_HEADER(6), - * 'S', 'e', 'r', 'i', 'a', 'l' - * }; - */ - -#define USB_CFG_DESCR_PROPS_DEVICE 0 -#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 -#define USB_CFG_DESCR_PROPS_STRINGS 0 -#define USB_CFG_DESCR_PROPS_STRING_0 0 -#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 -#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 -#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 -#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID 0 -#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 -#define USB_CFG_DESCR_PROPS_UNKNOWN 0 - -#define usbMsgPtr_t unsigned short -/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to - * a scalar type here because gcc generates slightly shorter code for scalar - * arithmetics than for pointer arithmetics. Remove this define for backward - * type compatibility or define it to an 8 bit type if you use data in RAM only - * and all RAM is below 256 bytes (tiny memory model in IAR CC). - */ - -/* ----------------------- Optional MCU Description ------------------------ */ - -/* The following configurations have working defaults in usbdrv.h. You - * usually don't need to set them explicitly. Only if you want to run - * the driver on a device which is not yet supported or with a compiler - * which is not fully supported (such as IAR C) or if you use a differnt - * interrupt than INT0, you may have to define some of these. - */ -/* #define USB_INTR_CFG MCUCR */ -/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE GIMSK */ -/* #define USB_INTR_ENABLE_BIT INT0 */ -/* #define USB_INTR_PENDING GIFR */ -/* #define USB_INTR_PENDING_BIT INTF0 */ -/* #define USB_INTR_VECTOR INT0_vect */ - -/* Set INT1 for D- falling edge to count SOF */ -/* #define USB_INTR_CFG EICRA */ -#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE EIMSK */ -#define USB_INTR_ENABLE_BIT INT1 -/* #define USB_INTR_PENDING EIFR */ -#define USB_INTR_PENDING_BIT INTF1 -#define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/puck/config.h b/keyboards/puck/config.h new file mode 100644 index 00000000000..3eaa8cd2641 --- /dev/null +++ b/keyboards/puck/config.h @@ -0,0 +1,31 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER OkKeebs LLC +#define PRODUCT Puck +#define DESCRIPTION 4x3 macropad + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 3 + +#define MATRIX_ROW_PINS { D2, D3, C6, C7 } +#define MATRIX_COL_PINS { B4, D7, D6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/puck/info.json b/keyboards/puck/info.json new file mode 100644 index 00000000000..e8d03a43fd1 --- /dev/null +++ b/keyboards/puck/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "Puck", + "url": "", + "maintainer": "john-pettigrew", + "width": 3, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"SW1", "x":0, "y":0}, + {"label":"SW2", "x":1, "y":0}, + {"label":"SW3", "x":2, "y":0}, + {"label":"SW4", "x":0, "y":1}, + {"label":"SW5", "x":1, "y":1}, + {"label":"SW6", "x":2, "y":1}, + {"label":"SW7", "x":0, "y":2}, + {"label":"SW8", "x":1, "y":2}, + {"label":"SW9", "x":2, "y":2}, + {"label":"SW10", "x":0, "y":3}, + {"label":"SW11", "x":1, "y":3}, + {"label":"SW12", "x":2, "y":3} + ] + } + } +} diff --git a/keyboards/puck/keymaps/default/keymap.c b/keyboards/puck/keymaps/default/keymap.c new file mode 100644 index 00000000000..6ba70a88bb5 --- /dev/null +++ b/keyboards/puck/keymaps/default/keymap.c @@ -0,0 +1,64 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _HL 1 +#define _LL 2 + +enum keycodes { + LOW, + HIGH +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * Base Layer (Numbers) + */ + [_BL] = LAYOUT( + KC_KP_7, KC_KP_8, KC_KP_9, + KC_KP_4, KC_KP_5, KC_KP_6, + KC_KP_1, KC_KP_2, KC_KP_3, + LOW, KC_KP_0, HIGH + ), + /* + * High Layer (Work) + */ + [_HL] = LAYOUT( + KC_NUMLOCK, KC_PAST, KC_NO, + KC_PMNS, KC_PENT, KC_PPLS, + KC_NO, KC_PSLS, KC_NO, + KC_NO, KC_PDOT, KC_NO + ), + /* + * Low Layer (Media) + */ + [_LL] = LAYOUT( + KC_NO, KC_VOLU, KC_NO, + KC_MPRV, KC_MPLY, KC_MNXT, + KC_NO, KC_VOLD, KC_NO, + KC_NO, KC_NO, KC_NO + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case HIGH: + if (record->event.pressed) { + layer_on(_HL); + }else{ + layer_off(_HL); + layer_off(_LL); + } + return false; + break; + case LOW: + if (record->event.pressed) { + layer_on(_LL); + }else{ + layer_off(_LL); + layer_off(_HL); + } + return false; + break; + } + return true; +} diff --git a/keyboards/puck/puck.c b/keyboards/puck/puck.c new file mode 100644 index 00000000000..0e26b9c3cd8 --- /dev/null +++ b/keyboards/puck/puck.c @@ -0,0 +1 @@ +#include "puck.h" diff --git a/keyboards/puck/puck.h b/keyboards/puck/puck.h new file mode 100644 index 00000000000..0f2a284a67f --- /dev/null +++ b/keyboards/puck/puck.h @@ -0,0 +1,18 @@ +#ifndef PUCK_H +#define PUCK_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, \ + K03, K04, K05, \ + K06, K07, K08, \ + K09, K0A, K0B \ +) { \ + { K00, K01, K02 }, \ + { K03, K04, K05 }, \ + { K06, K07, K08 }, \ + { K09, K0A, K0B }, \ +} + +#endif diff --git a/keyboards/puck/readme.md b/keyboards/puck/readme.md new file mode 100644 index 00000000000..fe1bd1668f6 --- /dev/null +++ b/keyboards/puck/readme.md @@ -0,0 +1,13 @@ +# Puck + +A 4x3 macropad. + +Keyboard Maintainer: [John Pettigrew](https://github.com/john-pettigrew) +Hardware Supported: Puck PCB +Hardware Availability: [OKKeebs.com](https://okkeebs.com/products/puck-pcb) + +Make example for this keyboard (after setting up your build environment): + + make puck:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/puck/rules.mk b/keyboards/puck/rules.mk new file mode 100644 index 00000000000..48144534d47 --- /dev/null +++ b/keyboards/puck/rules.mk @@ -0,0 +1,68 @@ + + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = halfkay + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/quantrik/kyuu/config.h b/keyboards/quantrik/kyuu/config.h new file mode 100644 index 00000000000..b40ce64cc90 --- /dev/null +++ b/keyboards/quantrik/kyuu/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 mechmerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Quantrik +#define PRODUCT Kyuu +#define DESCRIPTION A 65% keyboard with blocker + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B6, B5, B4, D7, D6 } +#define MATRIX_COL_PINS { F1, F4, F5, F6, F7, C7, C6, F0, B7, D0, D5, D3, D2, D1, B3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/quantrik/kyuu/info.json b/keyboards/quantrik/kyuu/info.json new file mode 100644 index 00000000000..05c1b40b95b --- /dev/null +++ b/keyboards/quantrik/kyuu/info.json @@ -0,0 +1,82 @@ +{ + "keyboard_name": "Kyuu", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 67, + "layout": [ + {"label":"K00 (B6,F1)", "x":0, "y":0}, + {"label":"K01 (B6,F4)", "x":1, "y":0}, + {"label":"K02 (B6,F5)", "x":2, "y":0}, + {"label":"K03 (B6,F6)", "x":3, "y":0}, + {"label":"K04 (B6,F7)", "x":4, "y":0}, + {"label":"K05 (B6,C7)", "x":5, "y":0}, + {"label":"K06 (B6,C6)", "x":6, "y":0}, + {"label":"K07 (B6,F0)", "x":7, "y":0}, + {"label":"K08 (B6,B7)", "x":8, "y":0}, + {"label":"K09 (B6,D0)", "x":9, "y":0}, + {"label":"K0A (B6,D5)", "x":10, "y":0}, + {"label":"K0B (B6,D3)", "x":11, "y":0}, + {"label":"K0C (B6,D2)", "x":12, "y":0}, + {"label":"K0D (B6,D1)", "x":13, "y":0}, + {"label":"K0E (B6,B3)", "x":14, "y":0}, + {"label":"K2E (B4,B3)", "x":15, "y":0}, + {"label":"K10 (B5,F1)", "x":0, "y":1, "w":1.5}, + {"label":"K11 (B5,F4)", "x":1.5, "y":1}, + {"label":"K12 (B5,F5)", "x":2.5, "y":1}, + {"label":"K13 (B5,F6)", "x":3.5, "y":1}, + {"label":"K14 (B5,F7)", "x":4.5, "y":1}, + {"label":"K15 (B5,C7)", "x":5.5, "y":1}, + {"label":"K16 (B5,C6)", "x":6.5, "y":1}, + {"label":"K17 (B5,F0)", "x":7.5, "y":1}, + {"label":"K18 (B5,B7)", "x":8.5, "y":1}, + {"label":"K19 (B5,D0)", "x":9.5, "y":1}, + {"label":"K1A (B5,D5)", "x":10.5, "y":1}, + {"label":"K1B (B5,D3)", "x":11.5, "y":1}, + {"label":"K1C (B5,D2)", "x":12.5, "y":1}, + {"label":"K1D (B5,D1)", "x":13.5, "y":1, "w":1.5}, + {"label":"K1E (B5,B3)", "x":15, "y":1}, + {"label":"K20 (B4,F1)", "x":0, "y":2, "w":1.75}, + {"label":"K21 (B4,F4)", "x":1.75, "y":2}, + {"label":"K22 (B4,F5)", "x":2.75, "y":2}, + {"label":"K23 (B4,F6)", "x":3.75, "y":2}, + {"label":"K24 (B4,F7)", "x":4.75, "y":2}, + {"label":"K25 (B4,C7)", "x":5.75, "y":2}, + {"label":"K26 (B4,C6)", "x":6.75, "y":2}, + {"label":"K27 (B4,F0)", "x":7.75, "y":2}, + {"label":"K28 (B4,B7)", "x":8.75, "y":2}, + {"label":"K29 (B4,D0)", "x":9.75, "y":2}, + {"label":"K2A (B4,D5)", "x":10.75, "y":2}, + {"label":"K2B (B4,D3)", "x":11.75, "y":2}, + {"label":"K2C (B4,D2)", "x":12.75, "y":2, "w":2.25}, + {"label":"K2D (B4,D1)", "x":15, "y":2}, + {"label":"K30 (D7,F1)", "x":0, "y":3, "w":2.25}, + {"label":"K31 (D7,F4)", "x":2.25, "y":3}, + {"label":"K32 (D7,F5)", "x":3.25, "y":3}, + {"label":"K33 (D7,F6)", "x":4.25, "y":3}, + {"label":"K34 (D7,F7)", "x":5.25, "y":3}, + {"label":"K35 (D7,C7)", "x":6.25, "y":3}, + {"label":"K36 (D7,C6)", "x":7.25, "y":3}, + {"label":"K37 (D7,F0)", "x":8.25, "y":3}, + {"label":"K38 (D7,B7)", "x":9.25, "y":3}, + {"label":"K39 (D7,D0)", "x":10.25, "y":3}, + {"label":"K3A (D7,D5)", "x":11.25, "y":3}, + {"label":"K3B (D7,D3)", "x":12.25, "y":3, "w":1.75}, + {"label":"K3C (D7,D2)", "x":14, "y":3}, + {"label":"K3D (D7,D1)", "x":15, "y":3}, + {"label":"K40 (D6,F1)", "x":0, "y":4, "w":1.5}, + {"label":"K41 (D6,F4)", "x":1.5, "y":4}, + {"label":"K42 (D6,F5)", "x":2.5, "y":4, "w":1.5}, + {"label":"K46 (D6,C6)", "x":4, "y":4, "w":7}, + {"label":"K4A (D6,D5)", "x":11, "y":4, "w":1.5}, + {"label":"K4B (D6,D3)", "x":13, "y":4}, + {"label":"K4C (D6,D2)", "x":14, "y":4}, + {"label":"K4D (D6,D1)", "x":15, "y":4} + ] + } + } + } + \ No newline at end of file diff --git a/keyboards/quantrik/kyuu/keymaps/default/config.h b/keyboards/quantrik/kyuu/keymaps/default/config.h new file mode 100644 index 00000000000..60dd02a9d0e --- /dev/null +++ b/keyboards/quantrik/kyuu/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 mechmerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/quantrik/kyuu/keymaps/default/keymap.c b/keyboards/quantrik/kyuu/keymaps/default/keymap.c new file mode 100644 index 00000000000..077d7ac5a64 --- /dev/null +++ b/keyboards/quantrik/kyuu/keymaps/default/keymap.c @@ -0,0 +1,74 @@ +/* Copyright 2019 mechmerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_HOME, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, QMKBEST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/quantrik/kyuu/keymaps/default/readme.md b/keyboards/quantrik/kyuu/keymaps/default/readme.md new file mode 100644 index 00000000000..f87ce36e38e --- /dev/null +++ b/keyboards/quantrik/kyuu/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Kyuu diff --git a/keyboards/quantrik/kyuu/kyuu.c b/keyboards/quantrik/kyuu/kyuu.c new file mode 100644 index 00000000000..e9a72a5749a --- /dev/null +++ b/keyboards/quantrik/kyuu/kyuu.c @@ -0,0 +1,43 @@ +/* Copyright 2019 mechmerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kyuu.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/quantrik/kyuu/kyuu.h b/keyboards/quantrik/kyuu/kyuu.h new file mode 100644 index 00000000000..25d9d86dd55 --- /dev/null +++ b/keyboards/quantrik/kyuu/kyuu.h @@ -0,0 +1,41 @@ +/* Copyright 2019 mechmerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k2E, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \ + k40, k41, k42, k46, k4A, k4B, k4C, k4D \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \ + { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4A, k4B, k4C, k4D, KC_NO }, \ +} diff --git a/keyboards/quantrik/kyuu/readme.md b/keyboards/quantrik/kyuu/readme.md new file mode 100644 index 00000000000..2b331409800 --- /dev/null +++ b/keyboards/quantrik/kyuu/readme.md @@ -0,0 +1,13 @@ +# kyuu + +Kyuu is a 65% keyboard inspired by the TGR 910's top right blocker. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Quantrik 65% PCB +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=97810.0), [quantrik.com](https://www.quantrik.com/collections/frontpage/products/kyuu-keyboard) + +Make example for this keyboard (after setting up your build environment): + + make quantrik/kyuu:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/quantrik/kyuu/rules.mk b/keyboards/quantrik/kyuu/rules.mk new file mode 100644 index 00000000000..f8667d280f4 --- /dev/null +++ b/keyboards/quantrik/kyuu/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/quefrency/config.h b/keyboards/quefrency/config.h deleted file mode 100644 index 8f0524f9726..00000000000 --- a/keyboards/quefrency/config.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -#ifdef SUBPROJECT_rev1 - #include "rev1/config.h" -#endif - -#endif diff --git a/keyboards/quefrency/info.json b/keyboards/quefrency/info.json deleted file mode 100644 index 160e7896bbd..00000000000 --- a/keyboards/quefrency/info.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "keyboard_name": "Quefrency", - "url": "https://keeb.io", - "maintainer": "nooges", - "width": 17, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [ - {"label":"Esc", "x":0, "y":0}, - {"label":"1", "x":1, "y":0}, - {"label":"2", "x":2, "y":0}, - {"label":"3", "x":3, "y":0}, - {"label":"4", "x":4, "y":0}, - {"label":"5", "x":5, "y":0}, - {"label":"6", "x":6, "y":0}, - - {"label":"7", "x":8, "y":0}, - {"label":"8", "x":9, "y":0}, - {"label":"9", "x":10, "y":0}, - {"label":"0", "x":11, "y":0}, - {"label":"-", "x":12, "y":0}, - {"label":"=", "x":13, "y":0}, - {"label":"Del", "x":14, "y":0}, - {"label":"Bksp", "x":15, "y":0}, - - {"label":"Tab", "x":0, "y":1, "w":1.5}, - {"label":"Q", "x":1.5, "y":1}, - {"label":"W", "x":2.5, "y":1}, - {"label":"E", "x":3.5, "y":1}, - {"label":"R", "x":4.5, "y":1}, - {"label":"T", "x":5.5, "y":1}, - - {"label":"Y", "x":7.5, "y":1}, - {"label":"U", "x":8.5, "y":1}, - {"label":"I", "x":9.5, "y":1}, - {"label":"O", "x":10.5, "y":1}, - {"label":"P", "x":11.5, "y":1}, - {"label":"[", "x":12.5, "y":1}, - {"label":"]", "x":13.5, "y":1}, - {"label":"Backslash", "x":14.5, "y":1, "w":1.5}, - - {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, - {"label":"A", "x":1.75, "y":2}, - {"label":"S", "x":2.75, "y":2}, - {"label":"D", "x":3.75, "y":2}, - {"label":"F", "x":4.75, "y":2}, - {"label":"G", "x":5.75, "y":2}, - - {"label":"H", "x":7.75, "y":2}, - {"label":"J", "x":8.75, "y":2}, - {"label":"K", "x":9.75, "y":2}, - {"label":"L", "x":10.75, "y":2}, - {"label":";", "x":11.75, "y":2}, - {"label":"'", "x":12.75, "y":2}, - {"label":"Enter", "x":13.75, "y":2, "w":2.25}, - - {"label":"Shift", "x":0, "y":3, "w":2.25}, - {"label":"Z", "x":2.25, "y":3}, - {"label":"X", "x":3.25, "y":3}, - {"label":"C", "x":4.25, "y":3}, - {"label":"V", "x":5.25, "y":3}, - {"label":"B", "x":6.25, "y":3}, - - {"label":"N", "x":8.25, "y":3}, - {"label":"M", "x":9.25, "y":3}, - {"label":",", "x":10.25, "y":3}, - {"label":".", "x":11.25, "y":3}, - {"label":"/", "x":12.25, "y":3}, - {"label":"Shift", "x":13.25, "y":3, "w":1.75}, - {"label":"Up", "x":15, "y":3}, - - {"label":"Ctrl", "x":0, "y":4, "w":1.25}, - {"label":"Alt", "x":1.25, "y":4, "w":1.25}, - {"label":"Win", "x":2.5, "y":4, "w":1.25}, - {"label":"Fn", "x":3.75, "y":4, "w":1.25}, - {"label":"Space", "x":5, "y":4, "w":2.25}, - - {"label":"Fn", "x":8.25, "y":4, "w":1.25}, - {"label":"Space", "x":9.5, "y":4, "w":1.5}, - {"label":"Alt", "x":11, "y":4}, - {"label":"Ctrl", "x":12, "y":4}, - {"label":"Left", "x":13, "y":4}, - {"label":"Down", "x":14, "y":4}, - {"label":"Right", "x":15, "y":4} - ] - }, - "LAYOUT_65": { - "layout": [ - {"label":"Esc", "x":0, "y":0}, - {"label":"1", "x":1, "y":0}, - {"label":"2", "x":2, "y":0}, - {"label":"3", "x":3, "y":0}, - {"label":"4", "x":4, "y":0}, - {"label":"5", "x":5, "y":0}, - {"label":"6", "x":6, "y":0}, - - {"label":"7", "x":8, "y":0}, - {"label":"8", "x":9, "y":0}, - {"label":"9", "x":10, "y":0}, - {"label":"0", "x":11, "y":0}, - {"label":"-", "x":12, "y":0}, - {"label":"=", "x":13, "y":0}, - {"label":"Del", "x":14, "y":0}, - {"label":"Bksp", "x":15, "y":0}, - {"label":"Home", "x":16, "y":0}, - - {"label":"Tab", "x":0, "y":1, "w":1.5}, - {"label":"Q", "x":1.5, "y":1}, - {"label":"W", "x":2.5, "y":1}, - {"label":"E", "x":3.5, "y":1}, - {"label":"R", "x":4.5, "y":1}, - {"label":"T", "x":5.5, "y":1}, - - {"label":"Y", "x":7.5, "y":1}, - {"label":"U", "x":8.5, "y":1}, - {"label":"I", "x":9.5, "y":1}, - {"label":"O", "x":10.5, "y":1}, - {"label":"P", "x":11.5, "y":1}, - {"label":"[", "x":12.5, "y":1}, - {"label":"]", "x":13.5, "y":1}, - {"label":"Backslash", "x":14.5, "y":1, "w":1.5}, - {"label":"End", "x":16, "y":1}, - - {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, - {"label":"A", "x":1.75, "y":2}, - {"label":"S", "x":2.75, "y":2}, - {"label":"D", "x":3.75, "y":2}, - {"label":"F", "x":4.75, "y":2}, - {"label":"G", "x":5.75, "y":2}, - - {"label":"H", "x":7.75, "y":2}, - {"label":"J", "x":8.75, "y":2}, - {"label":"K", "x":9.75, "y":2}, - {"label":"L", "x":10.75, "y":2}, - {"label":";", "x":11.75, "y":2}, - {"label":"'", "x":12.75, "y":2}, - {"label":"Enter", "x":13.75, "y":2, "w":2.25}, - {"label":"Page Up", "x":16, "y":2}, - - {"label":"Shift", "x":0, "y":3, "w":2.25}, - {"label":"Z", "x":2.25, "y":3}, - {"label":"X", "x":3.25, "y":3}, - {"label":"C", "x":4.25, "y":3}, - {"label":"V", "x":5.25, "y":3}, - {"label":"B", "x":6.25, "y":3}, - - {"label":"N", "x":8.25, "y":3}, - {"label":"M", "x":9.25, "y":3}, - {"label":",", "x":10.25, "y":3}, - {"label":".", "x":11.25, "y":3}, - {"label":"/", "x":12.25, "y":3}, - {"label":"Shift", "x":13.25, "y":3, "w":1.75}, - {"label":"Up", "x":15, "y":3}, - {"label":"Page Down", "x":16, "y":3}, - - {"label":"Ctrl", "x":0, "y":4, "w":1.25}, - {"label":"Alt", "x":1.25, "y":4, "w":1.25}, - {"label":"Win", "x":2.5, "y":4, "w":1.25}, - {"label":"Fn", "x":3.75, "y":4, "w":1.25}, - {"label":"Space", "x":5, "y":4, "w":2.25}, - - {"label":"Fn", "x":8.25, "y":4, "w":1.25}, - {"label":"Space", "x":9.5, "y":4, "w":1.5}, - {"label":"Alt", "x":11, "y":4}, - {"label":"Ctrl", "x":12, "y":4}, - {"label":"Win", "x":13, "y":4}, - {"label":"Left", "x":14, "y":4}, - {"label":"Down", "x":15, "y":4}, - {"label":"Right", "x":16, "y":4} - ] - } - } -} diff --git a/keyboards/quefrency/keymaps/bramver/keymap.c b/keyboards/quefrency/keymaps/bramver/keymap.c deleted file mode 100644 index 527f5de0474..00000000000 --- a/keyboards/quefrency/keymaps/bramver/keymap.c +++ /dev/null @@ -1,134 +0,0 @@ -#include QMK_KEYBOARD_H - -enum custom_keycodes { - QWERTY = SAFE_RANGE, -}; - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -#define _BASE 0 -#define _LMSE 1 -#define _RMSE 2 -#define _SYMB 3 -#define _EMOJ 4 - -#define SP_LMS LT(_LMSE, KC_SPC) -#define SP_RMS LT(_RMSE, KC_SPC) -#define MO_SYMB TT(_SYMB) -#define MO_EMOJ TT(_EMOJ) - - -enum emoji_map { - UNAM, // unamused 😒 - HEYE, // smiling face with heart shaped eyes 😍 - OK, // ok hand sign 👌 - SMIR, // smirk 😏 - PRAY, // pray 🙏 - CELE, // celebration 🙌 - COOL, // smile with sunglasses 😎 - EYES, // eyes - THNK, // BIG THONK - NAIL, // Nailcare - SOS, // Vuile sos - REDB, // Red B - HNDR, // 100 - MONY, - FIRE, - CAR, - BUTT, - BNIS, - CUM, - CLAP, - TRIU, // Fart from nose - SCRM, - VOMI, - DTIV, // Detective - EXPL, // Brainsplosion - HAIR, // Haircut - DANC, // Salsa dancer - STRN, // Stronk - LEFT, // Point Left - RGHT, // Point Right -}; - -const uint32_t PROGMEM unicode_map[] = { - [UNAM] = 0x1F612, - [HEYE] = 0x1f60d, - [OK] = 0x1F44C, - [SMIR] = 0x1F60F, - [PRAY] = 0x1F64F, - [CELE] = 0x1F64C, - [COOL] = 0x1F60E, - [EYES] = 0x1F440, - [THNK] = 0x1F914, - [NAIL] = 0x1F485, - [SOS] = 0x1F198, - [REDB] = 0x1F171, - [HNDR] = 0x1F4AF, - [MONY] = 0x1F480, - [FIRE] = 0x1F525, - [CAR] = 0x1F697, - [BUTT] = 0x1F351, - [BNIS] = 0x1F346, - [CUM] = 0x1F4A6, - [CLAP] = 0x1F44F, - [TRIU] = 0x1F624, - [SCRM] = 0x1F631, - [VOMI] = 0x1F92E, - [DTIV] = 0x1F575, - [EXPL] = 0x1F92F, - [HAIR] = 0x2640, - [DANC] = 0x1F483, - [STRN] = 0x1F4AA, - [LEFT] = 0x1F448, - [RGHT] = 0x1F449, -}; - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT( - KC_GESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS , KC_EQL , KC_DEL , KC_BSPC , \ - KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC , KC_RBRC , KC_BSLS , \ - MO_EMOJ , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT , KC_ENT , \ - KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT , KC_UP , \ - KC_LCTL , KC_LALT , KC_LGUI , MO_SYMB , SP_LMS , SP_RMS , KC_BSPC , KC_RGUI , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT - ), - - [_LMSE] = LAYOUT( - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ - _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ - _______ , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , _______ , _______ , _______ , _______ , _______ , _______ , _______ ,\ - _______ , _______ , KC_PGDN , KC_PGUP , KC_END , KC_HOME , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ - ), - - [_RMSE] = LAYOUT( - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ - _______ , _______ , _______ , _______ , _______ , _______ , KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ , _______ , _______ , \ - _______ , _______ , _______ , _______ , _______ , _______ , KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , _______ , _______ ,\ - _______ , _______ , _______ , _______ , _______ , _______ , KC_HOME , KC_END , KC_PGUP , KC_PGDN , _______ , _______ , _______ , \ - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ - ), - - [_SYMB] = LAYOUT( - KC_GESC , KC_F1 , KC_F12 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_DEL , KC_BSPC , \ - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ - _______ , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , _______ ,\ - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ - ), - - [_EMOJ] = LAYOUT( - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ - _______ , X(CLAP) , X(CUM) , X(BNIS) , X(BUTT) , X(CAR) , X(FIRE) , X(REDB) , X(MONY) , X(HNDR) , X(SOS) , _______ , _______ , _______ , \ - _______ , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , _______ , _______ ,\ - _______ , X(TRIU) , X(SCRM) , X(VOMI) , X(DTIV) , X(EXPL) , X(HAIR) , X(DANC) , X(STRN) , X(LEFT) , X(RGHT) , _______ , _______ , \ - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ - ), - -}; - -void matrix_init_user(void) { - set_unicode_input_mode(UC_LNX); -}; diff --git a/keyboards/quefrency/keymaps/default/keymap.c b/keyboards/quefrency/keymaps/default/keymap.c deleted file mode 100644 index 964a997dd9d..00000000000 --- a/keyboards/quefrency/keymaps/default/keymap.c +++ /dev/null @@ -1,35 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BASE 0 -#define _FN1 1 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, -}; - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_BSPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - - [_FN1] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, \ - RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; diff --git a/keyboards/quefrency/keymaps/default65/keymap.c b/keyboards/quefrency/keymaps/default65/keymap.c deleted file mode 100644 index 4b07949b069..00000000000 --- a/keyboards/quefrency/keymaps/default65/keymap.c +++ /dev/null @@ -1,35 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BASE 0 -#define _FN1 1 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, -}; - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_65( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_SPC, KC_RALT, KC_RCTL, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT - ), - - [_FN1] = LAYOUT_65( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, _______, \ - RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; diff --git a/keyboards/quefrency/quefrency.h b/keyboards/quefrency/quefrency.h deleted file mode 100644 index 7a791230df4..00000000000 --- a/keyboards/quefrency/quefrency.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef QUEFRENCY_H -#define QUEFRENCY_H - -#include "quantum.h" - -#ifdef KEYBOARD_quefrency_rev1 - #include "rev1.h" -#endif - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - LA1, LA2, LA3, LA4, LA5, LA6, RA1, RA2, RA3, RA4, RA5, RA6, RA7, \ - LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB7, \ - LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC3, RC4, RC5, RC6, RC7, \ - LD1, LD2, LD3, LD4, LD5, RD1, RD4, RD5, RD6, RD7 \ - ) \ - LAYOUT( \ - KC_##LA1, KC_##LA2, KC_##LA3, KC_##LA4, KC_##LA5, KC_##LA6, KC_##RA1, KC_##RA2, KC_##RA3, KC_##RA4, KC_##RA5, KC_##RA6, KC_##RA7, \ - KC_##LB1, KC_##LB2, KC_##LB3, KC_##LB4, KC_##LB5, KC_##LB6, KC_##RB1, KC_##RB2, KC_##RB3, KC_##RB4, KC_##RB5, KC_##RB7, \ - KC_##LC1, KC_##LC2, KC_##LC3, KC_##LC4, KC_##LC5, KC_##LC6, KC_##RC1, KC_##RC3, KC_##RC4, KC_##RC5, KC_##RC6, KC_##RC7, \ - KC_##LD1, KC_##LD2, KC_##LD3, KC_##LD4, KC_##LD5, KC_##RD1, KC_##RD4, KC_##RD5, KC_##RD6, KC_##RD7 \ - ) -#endif diff --git a/keyboards/quefrency/readme.md b/keyboards/quefrency/readme.md deleted file mode 100644 index 8fb1c6bc185..00000000000 --- a/keyboards/quefrency/readme.md +++ /dev/null @@ -1,22 +0,0 @@ -Quefrency -========= - -A split 60% staggered keyboard made and sold by Keebio. [More info at Keebio](https://keeb.io). - -Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io/) - -Make example for this keyboard (after setting up your build environment): - - make quefrency/rev1:default - -Example of flashing this keyboard: - - make quefrency/rev1:default:avrdude - -Handedness detection is already hardwired onto the PCB, so no need to deal with `EE_HANDS` or flashing .eep files. - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -A build guide for this keyboard can be found here: [Keebio Build Guides](https://docs.keeb.io) diff --git a/keyboards/quefrency/rev1/config.h b/keyboards/quefrency/rev1/config.h deleted file mode 100644 index 1074590ff55..00000000000 --- a/keyboards/quefrency/rev1/config.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCB10 -#define PRODUCT_ID 0x1257 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Quefrency -#define DESCRIPTION Split 60/65 percent staggered keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 12 -#define MATRIX_COLS 8 - -// wiring of each half -#define MATRIX_ROW_PINS { F4, D4, D7, E6, B4, B5 } -#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6, C6 } -#define SPLIT_HAND_PIN D2 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 // Number of LEDs diff --git a/keyboards/quefrency/rev1/rev1.h b/keyboards/quefrency/rev1/rev1.h deleted file mode 100644 index c7dcaa9fe34..00000000000 --- a/keyboards/quefrency/rev1/rev1.h +++ /dev/null @@ -1,58 +0,0 @@ -#pragma once - -#include "quefrency.h" - -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -#define LAYOUT( \ - LA1, LA2, LA3, LA4, LA5, LA6, LA7, RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8, \ - LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, \ - LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, \ - LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, \ - LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8 \ - ) \ - { \ - { LA1, LA2, LA3, LA4, LA5, LA6, LA7, KC_NO }, \ - { LB1, LB2, LB3, LB4, LB5, LB6, KC_NO, KC_NO }, \ - { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO, KC_NO }, \ - { LD1, KC_NO, LD3, LD4, LD5, LD6, LD7, KC_NO }, \ - { LE1, LE2, LE3, KC_NO, LE5, KC_NO, LE7, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \ - { RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \ - { RC1, RC2, RC3, RC4, RC5, RC6, KC_NO, RC8 }, \ - { RD1, RD2, RD3, RD4, KC_NO, RD6, RD7, RD8 }, \ - { RE1, RE2, KC_NO, RE4, RE5, RE6, RE7, RE8 }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ - } - -#define LAYOUT_65( \ - LA1, LA2, LA3, LA4, LA5, LA6, LA7, RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8, RA9, \ - LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, RB9, \ - LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, RC9, \ - LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, RD9, \ - LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8, RE9 \ - ) \ - { \ - { LA1, LA2, LA3, LA4, LA5, LA6, LA7, KC_NO }, \ - { LB1, LB2, LB3, LB4, LB5, LB6, KC_NO, KC_NO }, \ - { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO, KC_NO }, \ - { LD1, KC_NO, LD3, LD4, LD5, LD6, LD7, KC_NO }, \ - { LE1, LE2, LE3, KC_NO, LE5, KC_NO, LE7, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \ - { RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \ - { RC1, RC2, RC3, RC4, RC5, RC6, RC9, RC8 }, \ - { RD1, RD2, RD3, RD4, RD9, RD6, RD7, RD8 }, \ - { RE1, RE2, RE9, RE4, RE5, RE6, RE7, RE8 }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RA9, RB9 } \ - } diff --git a/keyboards/quefrency/rules.mk b/keyboards/quefrency/rules.mk deleted file mode 100644 index 3ec04fbf1f3..00000000000 --- a/keyboards/quefrency/rules.mk +++ /dev/null @@ -1,33 +0,0 @@ -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -SPLIT_KEYBOARD = yes - -DEFAULT_FOLDER = quefrency/rev1 diff --git a/keyboards/qwertyydox/config.h b/keyboards/qwertyydox/config.h index b22ca534e3e..67f5d3c16a0 100644 --- a/keyboards/qwertyydox/config.h +++ b/keyboards/qwertyydox/config.h @@ -47,18 +47,16 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define BACKLIGHT_PIN E6 #define BACKLIGHT_LEVELS 5 diff --git a/keyboards/qwertyydox/info.json b/keyboards/qwertyydox/info.json index 0b762388ec5..3dd6b3ec738 100644 --- a/keyboards/qwertyydox/info.json +++ b/keyboards/qwertyydox/info.json @@ -5,8 +5,8 @@ "url": "", "maintainer": "qmk", "processor": "atmega32u4", - "width": 14, - "height": 4, + "width": 16, + "height": 5, "layouts": { "LAYOUT": { "key_count": 53, diff --git a/keyboards/qwertyydox/readme.md b/keyboards/qwertyydox/readme.md index 1fa984e0319..2314aac47e2 100644 --- a/keyboards/qwertyydox/readme.md +++ b/keyboards/qwertyydox/readme.md @@ -23,5 +23,5 @@ Example of flashing this keyboard: make qwertyydox/rev1:default:avrdude -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/qwertyydox/rev1/config.h b/keyboards/qwertyydox/rev1/config.h index 3d4c9b0d000..703d62de750 100644 --- a/keyboards/qwertyydox/rev1/config.h +++ b/keyboards/qwertyydox/rev1/config.h @@ -47,18 +47,16 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define BACKLIGHT_PIN E6 #define BACKLIGHT_LEVELS 5 @@ -67,7 +65,6 @@ along with this program. If not, see . #define RGBLED_NUM 12 // Number of LEDs - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/qwertyydox/rules.mk b/keyboards/qwertyydox/rules.mk index d04a4b9f300..7cc070ba598 100644 --- a/keyboards/qwertyydox/rules.mk +++ b/keyboards/qwertyydox/rules.mk @@ -1,69 +1,68 @@ -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes # I2C is used between the sides -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -SPLIT_KEYBOARD = yes - -DEFAULT_FOLDER = qwertyydox/rev1 +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SUBPROJECT_rev1 = yes +USE_I2C = yes # I2C is used between the sides +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = qwertyydox/rev1 diff --git a/keyboards/rama/m10_b/config.h b/keyboards/rama/m10_b/config.h deleted file mode 100644 index de626dba539..00000000000 --- a/keyboards/rama/m10_b/config.h +++ /dev/null @@ -1,189 +0,0 @@ -/* -Copyright 2018 Wilba - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x5241 // "RW" -#define PRODUCT_ID 0x00AB // 10-B -#define DEVICE_VER 0x0001 -#define MANUFACTURER RAMA.WORKS -#define PRODUCT RAMA M10-B -#define DESCRIPTION RAMA M10-B Macropad - -/* key matrix size */ -#define MATRIX_ROWS 1 -#define MATRIX_COLS 10 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { E6 } -#define MATRIX_COL_PINS { D7, B6, F0, D6, B5, F1, D4, B4, F4, F5 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN C6 -//#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/rama/m10_b/info.json b/keyboards/rama/m10_b/info.json deleted file mode 100644 index fb144030d0f..00000000000 --- a/keyboards/rama/m10_b/info.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "keyboard_name": "m10-b", - "url": "", - "maintainer": "qmk", - "width": 3, - "height": 4, - "layouts": { - "LAYOUT": { - "layout": [ - { "x": 0, "y": 0 }, - { "x": 1, "y": 0 }, - { "x": 2, "y": 0 }, - { "x": 0, "y": 1 }, - { "x": 1, "y": 1 }, - { "x": 2, "y": 1 }, - { "x": 0, "y": 2 }, - { "x": 1, "y": 2 }, - { "x": 2, "y": 2 }, - { "x": 1, "y": 3, "w": 2.0 } - ] - } - } -} diff --git a/keyboards/rama/m10_b/keymaps/default/config.h b/keyboards/rama/m10_b/keymaps/default/config.h deleted file mode 100644 index d150575c1a7..00000000000 --- a/keyboards/rama/m10_b/keymaps/default/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Wilba - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/rama/m10_b/keymaps/default/keymap.c b/keyboards/rama/m10_b/keymaps/default/keymap.c deleted file mode 100644 index 8002b8c7cda..00000000000 --- a/keyboards/rama/m10_b/keymaps/default/keymap.c +++ /dev/null @@ -1,26 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT( - KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_0 ) - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -} - -void matrix_init_user(void) -{ -} - -void matrix_scan_user(void) -{ -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - return true; -} diff --git a/keyboards/rama/m10_b/keymaps/knops/config.h b/keyboards/rama/m10_b/keymaps/knops/config.h deleted file mode 100644 index d150575c1a7..00000000000 --- a/keyboards/rama/m10_b/keymaps/knops/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Wilba - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/rama/m10_b/m10_b.c b/keyboards/rama/m10_b/m10_b.c deleted file mode 100644 index f43f6e2a19a..00000000000 --- a/keyboards/rama/m10_b/m10_b.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright 2018 Wilba - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "m10_b.h" -/* -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} -*/ diff --git a/keyboards/rama/m10_b/readme.md b/keyboards/rama/m10_b/readme.md deleted file mode 100644 index 6fb04c6042a..00000000000 --- a/keyboards/rama/m10_b/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# RAMA M10-B - -![RAMA M10-B](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/5b4997390e2e72d65f7a8e83/5b499748352f534ffb40392b/1531549522790/RAMA-M10-B-04.572.jpg?format=1500w) - -Mechanical Mini Pad. [More info at Massdrop](https://www.massdrop.com/buy/rama-m10-a) - -Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) -Hardware Supported: RAMA M10-B PCB -Hardware Availability: [Massdrop](https://www.massdrop.com/buy/rama-m10-a) - -Make example for this keyboard (after setting up your build environment): - - make rama/m10_b:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/rama/m10_b/rules.mk b/keyboards/rama/m10_b/rules.mk deleted file mode 100644 index 24df4632dd0..00000000000 --- a/keyboards/rama/m10_b/rules.mk +++ /dev/null @@ -1,68 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches diff --git a/keyboards/rama/m60_a/config.h b/keyboards/rama/m60_a/config.h deleted file mode 100644 index 03794965fcf..00000000000 --- a/keyboards/rama/m60_a/config.h +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "config_common.h" - -// USB Device descriptor parameter -#define VENDOR_ID 0x5241 // "RW" -#define PRODUCT_ID 0x060A // 60-A -#define DEVICE_VER 0x0001 -#define MANUFACTURER RAMA.WORKS -#define PRODUCT RAMA M60-A -#define DESCRIPTION RAMA M60-A Keyboard - - - -// key matrix size -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -// Zeal60 PCB default pin-out -#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } -#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } -#define UNUSED_PINS - -// IS31FL3731 driver -#define DRIVER_COUNT 2 -#define DRIVER_LED_TOTAL 72 - -// COL2ROW or ROW2COL -#define DIODE_DIRECTION COL2ROW - -// Set 0 if debouncing isn't needed -#define DEBOUNCING_DELAY 5 - -// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap -#define LOCKING_SUPPORT_ENABLE -// Locking resynchronize hack -#define LOCKING_RESYNC_ENABLE - -// key combination for command -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -// disable debug print -//#define NO_DEBUG - -// disable print -//#define NO_PRINT - -// disable action features -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#define RGB_BACKLIGHT_ENABLED 1 - -// This conditionally compiles the backlight code for M60-A specifics -#define RGB_BACKLIGHT_M60_A - -// enable/disable LEDs based on layout -// they aren't really used if RGB_BACKLIGHT_M60_A defined -#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 -#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 -#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 -#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 -#define RGB_BACKLIGHT_USE_ISO_ENTER 0 -#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1 - -// disable backlight when USB suspended (PC sleep/hibernate/shutdown) -#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 - -// disable backlight after timeout in minutes, 0 = no timeout -#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 - -// the default effect (RGB test) -#define RGB_BACKLIGHT_EFFECT 255 - -// These define which keys in the matrix are alphas/mods -// Used for backlight effects so colors are different for -// alphas vs. mods -// Each value is for a row, bit 0 is column 0 -// Alpha=0 Mod=1 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0010000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111 - -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 - -// EEPROM usage - -// TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F -#define EEPROM_MAGIC_ADDR 32 -// Bump this every time we change what we store -// This will automatically reset the EEPROM with defaults -// and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 -#define EEPROM_VERSION_ADDR 34 - -// Backlight config starts after EEPROM version -#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 - diff --git a/keyboards/rama/m60_a/info.json b/keyboards/rama/m60_a/info.json deleted file mode 100644 index 577becd2196..00000000000 --- a/keyboards/rama/m60_a/info.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "keyboard_name": "M60-A", - "url": "", - "maintainer": "Wilba", - "bootloader": "DFU", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT_60_hhkb": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] - } - } -} \ No newline at end of file diff --git a/keyboards/rama/m60_a/m60_a.h b/keyboards/rama/m60_a/m60_a.h deleted file mode 100644 index 3caab6ac0f0..00000000000 --- a/keyboards/rama/m60_a/m60_a.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "quantum.h" -#include "../../zeal60/rgb_backlight_keycodes.h" -#include "../../zeal60/zeal60_keycodes.h" - -#define XXX KC_NO - -#define LAYOUT_60_hhkb( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K41, K42, K47, K4B, K4C \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { XXX, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, XXX, K4B, K4C, XXX } \ -} - diff --git a/keyboards/rama/m60_a/readme.md b/keyboards/rama/m60_a/readme.md deleted file mode 100644 index fe54f0163a1..00000000000 --- a/keyboards/rama/m60_a/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# RAMA M60-A - -![RAMA M60-A](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/5aafa6a20e2e7254480b21bf/1535873164793/RAMA-M60-A-03.688.jpg?format=1500w) - -The M60-A represents the benchmark and equilibrium between function and design for us at Rama Works. The gently exaggerated design of the frame is not understated, but rather provocative. Inspiration and evolution from previous models are evident in the beautifully articulated design and the well defined aesthetic, the fingerprint of our 'Industrial Modern' designs. The M60-A offers a unique contender in the traditional 60% form factor. [More info at RAMA WORKS](https://rama.works/m60-a/) - -Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) -Hardware Supported: RAMA M60-A PCB -Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) - -Make example for this keyboard (after setting up your build environment): - - make rama/m60_a:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk deleted file mode 100644 index 7ab1b7d3ba9..00000000000 --- a/keyboards/rama/m60_a/rules.mk +++ /dev/null @@ -1,78 +0,0 @@ - - -# project specific files -SRC = ../zeal60/zeal60.c \ - ../zeal60/rgb_backlight.c \ - quantum/color.c \ - drivers/issi/is31fl3731.c \ - drivers/avr/i2c_master.c - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Boot Section -BOOTLOADER = atmel-dfu - -# Do not put the microcontroller into power saving mode -# when we get USB suspend event. We want it to keep updating -# backlight effects. -OPT_DEFS += -DNO_SUSPEND_POWER_DOWN - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -RAW_ENABLE = yes -DYNAMIC_KEYMAP_ENABLE = yes -CIE1931_CURVE = yes diff --git a/keyboards/rama/m6_a/config.h b/keyboards/rama/m6_a/config.h deleted file mode 100644 index 8d77f5339d5..00000000000 --- a/keyboards/rama/m6_a/config.h +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2018 Wilba - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x5241 // "RW" -#define PRODUCT_ID 0x006A // 6-A -#define DEVICE_VER 0x0001 -#define MANUFACTURER RAMA.WORKS -#define PRODUCT RAMA M6-A -#define DESCRIPTION RAMA M6-A Macropad - -/* key matrix size */ -#define MATRIX_ROWS 1 -#define MATRIX_COLS 6 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { E6 } -#define MATRIX_COL_PINS { D4, B5, F4, D7, C6, F6 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#define RGB_BACKLIGHT_ENABLED 0 - -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 - - -// EEPROM usage - -// TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F -#define EEPROM_MAGIC_ADDR 32 -// Bump this every time we change what we store -// This will automatically reset the EEPROM with defaults -// and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 -#define EEPROM_VERSION_ADDR 34 - -// Backlight config starts after EEPROM version -#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 diff --git a/keyboards/rama/m6_a/info.json b/keyboards/rama/m6_a/info.json deleted file mode 100644 index 28dd733dac2..00000000000 --- a/keyboards/rama/m6_a/info.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "keyboard_name": "m6-a", - "url": "", - "maintainer": "qmk", - "width": 3, - "height": 2, - "layouts": { - "LAYOUT": { - "layout": [ - { "x": 0, "y": 0 }, - { "x": 1, "y": 0 }, - { "x": 2, "y": 0 }, - { "x": 0, "y": 1 }, - { "x": 1, "y": 1 }, - { "x": 2, "y": 1 } - ] - } - } -} diff --git a/keyboards/rama/m6_a/keymaps/krusli/keymap.c b/keyboards/rama/m6_a/keymaps/krusli/keymap.c deleted file mode 100644 index c8775f4eae5..00000000000 --- a/keyboards/rama/m6_a/keymaps/krusli/keymap.c +++ /dev/null @@ -1,74 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. - -enum layers -{ - _LAYER0, - _LAYER1, - _LAYER2 -}; - -enum custom_keycodes -{ - GIT_ADD = SAFE_RANGE, - GIT_COMMIT, - GIT_PUSH, - MUTE, - DEAFEN -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - if (record->event.pressed) - { - switch (keycode) - { - case GIT_ADD: - SEND_STRING("git add ." SS_TAP(X_ENTER)); - break; - case GIT_COMMIT: - SEND_STRING("git commit -m " SS_DOWN(X_LSHIFT) SS_TAP(X_QUOTE) SS_UP(X_LSHIFT)); - break; - case GIT_PUSH: - SEND_STRING("git push" SS_TAP(X_ENTER)); - break; - case MUTE: - SEND_STRING(SS_LGUI(SS_LSFT("M"))); - break; - case DEAFEN: - SEND_STRING(SS_LGUI(SS_LSFT("D"))); - break; - return false; - } - } - return true; -}; - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_LAYER0] = LAYOUT( - MUTE, DEAFEN, TO(_LAYER1), - GIT_ADD, GIT_COMMIT, GIT_PUSH), - [_LAYER1] = LAYOUT( - KC_VOLD, KC_VOLU, TO(_LAYER2), - KC_MRWD, KC_MPLY, KC_MNXT), - [_LAYER2] = LAYOUT( - KC_ESC, KC_UP, TO(_LAYER0), - KC_Z, KC_X, KC_SPACE)}; - -void matrix_init_user(void) -{ -#ifdef BACKLIGHT_ENABLE - backlight_level(0); -#endif -} diff --git a/keyboards/rama/m6_a/readme.md b/keyboards/rama/m6_a/readme.md deleted file mode 100644 index ceaf6a88de2..00000000000 --- a/keyboards/rama/m6_a/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# RAMA M6-A - -![RAMA M6-A](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/59fc7b1053450adf5bf9a852/1515932239307/RAMA-RAMA-M6-DSA-XO-CAPS.73-3_1.jpg?format=1500w) - -A 6-key companion keyboard. [More info at RAMA WORKS](https://rama.works/m6a) - -Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) -Hardware Supported: RAMA M6-A PCB -Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) - -Make example for this keyboard (after setting up your build environment): - - make rama/m6_a:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/rama/m6_a/rules.mk b/keyboards/rama/m6_a/rules.mk deleted file mode 100644 index ed85ac36d0c..00000000000 --- a/keyboards/rama/m6_a/rules.mk +++ /dev/null @@ -1,66 +0,0 @@ -# project specific files -SRC = keyboards/rama/m6_b/m6_b.c - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Boot Section -BOOTLOADER = atmel-dfu - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - -RAW_ENABLE = yes -DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h deleted file mode 100644 index 1adaad3f9ed..00000000000 --- a/keyboards/rama/m6_b/config.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright 2018 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x5241 // "RW" -#define PRODUCT_ID 0x006B // 6-B -#define DEVICE_VER 0x0001 -#define MANUFACTURER RAMA.WORKS -#define PRODUCT RAMA M6-B -#define DESCRIPTION RAMA M6-B Macropad - -/* key matrix size */ -#define MATRIX_ROWS 1 -#define MATRIX_COLS 6 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { E6 } -#define MATRIX_COL_PINS { D4, B5, F4, D7, C6, F6 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define RGB_BACKLIGHT_ENABLED 1 - -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 - - -// EEPROM usage - -// TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F -#define EEPROM_MAGIC_ADDR 32 -// Bump this every time we change what we store -// This will automatically reset the EEPROM with defaults -// and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 -#define EEPROM_VERSION_ADDR 34 - -// Backlight config starts after EEPROM version -#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 diff --git a/keyboards/rama/m6_b/info.json b/keyboards/rama/m6_b/info.json deleted file mode 100644 index c88a3cc6185..00000000000 --- a/keyboards/rama/m6_b/info.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "keyboard_name": "m6-b", - "url": "", - "maintainer": "qmk", - "width": 3, - "height": 2, - "layouts": { - "LAYOUT": { - "layout": [ - { "x": 0, "y": 0 }, - { "x": 1, "y": 0 }, - { "x": 2, "y": 0 }, - { "x": 0, "y": 1 }, - { "x": 1, "y": 1 }, - { "x": 2, "y": 1 } - ] - } - } -} diff --git a/keyboards/rama/m6_b/m6_b.c b/keyboards/rama/m6_b/m6_b.c deleted file mode 100644 index e7cd2f62872..00000000000 --- a/keyboards/rama/m6_b/m6_b.c +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright 2018 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "m6_b.h" -#include "m6_b_api.h" - -// Check that no backlight functions are called -#if RGB_BACKLIGHT_ENABLED -#include "rgb_backlight.h" -#endif // RGB_BACKLIGHT_ENABLED - -#include "raw_hid.h" -#include "dynamic_keymap.h" -#include "timer.h" -#include "tmk_core/common/eeprom.h" - -bool eeprom_is_valid(void) -{ - return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && - eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); -} - -void eeprom_set_valid(bool valid) -{ - eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); - eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); -} - -void eeprom_reset(void) -{ - // Set the keyboard-specific EEPROM state as invalid. - eeprom_set_valid(false); - // Set the TMK/QMK EEPROM state as invalid. - eeconfig_disable(); -} - -#ifdef RAW_ENABLE - -void raw_hid_receive( uint8_t *data, uint8_t length ) -{ - uint8_t *command_id = &(data[0]); - uint8_t *command_data = &(data[1]); - switch ( *command_id ) - { - case id_get_protocol_version: - { - command_data[0] = PROTOCOL_VERSION >> 8; - command_data[1] = PROTOCOL_VERSION & 0xFF; - break; - } - case id_get_keyboard_value: - { - if ( command_data[0] == id_uptime ) - { - uint32_t value = timer_read32(); - command_data[1] = (value >> 24 ) & 0xFF; - command_data[2] = (value >> 16 ) & 0xFF; - command_data[3] = (value >> 8 ) & 0xFF; - command_data[4] = value & 0xFF; - } - else - { - *command_id = id_unhandled; - } - break; - } -#ifdef DYNAMIC_KEYMAP_ENABLE - case id_dynamic_keymap_get_keycode: - { - uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); - command_data[3] = keycode >> 8; - command_data[4] = keycode & 0xFF; - break; - } - case id_dynamic_keymap_set_keycode: - { - dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); - break; - } - case id_dynamic_keymap_reset: - { - dynamic_keymap_reset(); - break; - } -#endif // DYNAMIC_KEYMAP_ENABLE -#if RGB_BACKLIGHT_ENABLED - case id_backlight_config_set_value: - { - //backlight_config_set_value(command_data); - break; - } - case id_backlight_config_get_value: - { - //backlight_config_get_value(command_data); - break; - } - case id_backlight_config_save: - { - //backlight_config_save(); - break; - } -#endif // RGB_BACKLIGHT_ENABLED - case id_eeprom_reset: - { - eeprom_reset(); - break; - } - case id_bootloader_jump: - { - // Need to send data back before the jump - // Informs host that the command is handled - raw_hid_send( data, length ); - // Give host time to read it - wait_ms(100); - bootloader_jump(); - break; - } - default: - { - // Unhandled message. - *command_id = id_unhandled; - break; - } - } - - // Return same buffer with values changed - raw_hid_send( data, length ); - -} - -#endif - -void main_init(void) -{ - // If the EEPROM has the magic, the data is good. - // OK to load from EEPROM. - if (eeprom_is_valid()) { -#if RGB_BACKLIGHT_ENABLED - //backlight_config_load(); -#endif // RGB_BACKLIGHT_ENABLED - } else { -#if RGB_BACKLIGHT_ENABLED - // If the EEPROM has not been saved before, or is out of date, - // save the default values to the EEPROM. Default values - // come from construction of the zeal_backlight_config instance. - //backlight_config_save(); -#endif // RGB_BACKLIGHT_ENABLED -#ifdef DYNAMIC_KEYMAP_ENABLE - // This resets the keymaps in EEPROM to what is in flash. - dynamic_keymap_reset(); -#endif - // Save the magic number last, in case saving was interrupted - eeprom_set_valid(true); - } -#if RGB_BACKLIGHT_ENABLED - // Initialize LED drivers for backlight. - backlight_init_drivers(); - - backlight_timer_init(); - backlight_timer_enable(); -#endif // RGB_BACKLIGHT_ENABLED -} - -void bootmagic_lite(void) -{ - // The lite version of TMK's bootmagic. - // 100% less potential for accidentally making the - // keyboard do stupid things. - - // We need multiple scans because debouncing can't be turned off. - matrix_scan(); - wait_ms(DEBOUNCING_DELAY); - wait_ms(DEBOUNCING_DELAY); - matrix_scan(); - - // If the Esc (matrix 0,0) is held down on power up, - // reset the EEPROM valid state and jump to bootloader. - if ( matrix_get_row(0) & (1<<0) ) { - eeprom_reset(); - bootloader_jump(); - } -} - -void matrix_init_kb(void) { - bootmagic_lite(); - main_init(); - matrix_init_user(); -} - -void matrix_scan_kb(void) { -#if RGB_BACKLIGHT_ENABLED - // This only updates the LED driver buffers if something has changed. - backlight_update_pwm_buffers(); -#endif // BACKLIGHT_ENABLED - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - led_set_user(usb_led); -} - -void suspend_power_down_kb(void) -{ -#if RGB_BACKLIGHT_ENABLED - //backlight_set_suspend_state(true); -#endif // BACKLIGHT_ENABLED -} - -void suspend_wakeup_init_kb(void) -{ -#if RGB_BACKLIGHT_ENABLED - //backlight_set_suspend_state(false); -#endif // BACKLIGHT_ENABLED -} diff --git a/keyboards/rama/m6_b/m6_b_api.h b/keyboards/rama/m6_b/m6_b_api.h deleted file mode 100644 index 041fd6e6eed..00000000000 --- a/keyboards/rama/m6_b/m6_b_api.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#define PROTOCOL_VERSION 0x0001 - -enum m6_b_command_id -{ - id_get_protocol_version = 0x01, // always 0x01 - id_get_keyboard_value, - id_set_keyboard_value, - id_dynamic_keymap_get_keycode, - id_dynamic_keymap_set_keycode, - id_dynamic_keymap_reset, - id_backlight_config_set_value, - id_backlight_config_get_value, - id_backlight_config_save, - id_eeprom_reset, - id_bootloader_jump, - id_unhandled = 0xFF, -}; - -enum m6_b_keyboard_value_id -{ - id_uptime = 0x01 -}; diff --git a/keyboards/rama/m6_b/readme.md b/keyboards/rama/m6_b/readme.md deleted file mode 100644 index d6bdd0c4c20..00000000000 --- a/keyboards/rama/m6_b/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# RAMA M6-B - -![RAMA M6-B](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/59fc7b1053450adf5bf9a852/1515932239307/RAMA-RAMA-M6-DSA-XO-CAPS.73-3_1.jpg?format=1500w) - -A 6-key companion keyboard. [More info at RAMA WORKS](https://rama.works/m6a) - -Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) -Hardware Supported: RAMA M6-B PCB -Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) - -Make example for this keyboard (after setting up your build environment): - - make rama/m6_b:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/rama/m6_b/rgb_backlight.c b/keyboards/rama/m6_b/rgb_backlight.c deleted file mode 100644 index 8f7ac06303e..00000000000 --- a/keyboards/rama/m6_b/rgb_backlight.c +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright 2018 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#if RGB_BACKLIGHT_ENABLED - -#include "rgb_backlight.h" -//#include "rgb_backlight_api.h" - -#include -#include -#include -#include "progmem.h" - -#include "quantum/color.h" -#include "drivers/avr/i2c_master.h" -#include "drivers/issi/is31fl3218.h" - -bool g_suspend_state = false; - -// Global tick at 20 Hz -uint32_t g_tick = 0; -uint8_t g_config_effect_speed = 0; -uint8_t g_config_brightness = 255; - -void backlight_update_pwm_buffers(void) -{ - IS31FL3218_update_pwm_buffers(); -} - -void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) -{ - IS31FL3218_set_color( index, red, green, blue ); -} - -void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) -{ - IS31FL3218_set_color_all( red, green, blue ); -} - - -// This is (F_CPU/1024) / 20 Hz -// = 15625 Hz / 20 Hz -// = 781 -#define TIMER3_TOP 260 - -void backlight_timer_init(void) -{ - static uint8_t backlight_timer_is_init = 0; - if ( backlight_timer_is_init ) - { - return; - } - backlight_timer_is_init = 1; - - // Timer 3 setup - TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP - _BV(CS32) | _BV(CS30); // prescale by /1024 - // Set TOP value - uint8_t sreg = SREG; - cli(); - - OCR3AH = (TIMER3_TOP >> 8) & 0xff; - OCR3AL = TIMER3_TOP & 0xff; - SREG = sreg; -} - -void backlight_timer_enable(void) -{ - TIMSK3 |= _BV(OCIE3A); -} - -void backlight_timer_disable(void) -{ - TIMSK3 &= ~_BV(OCIE3A); -} - -void backlight_set_suspend_state(bool state) -{ - g_suspend_state = state; -} - -void backlight_effect_cycle_all(void) -{ - uint8_t hueOffset = ( g_tick << g_config_effect_speed ) & 0xFF; - uint8_t satOffset = 127; - // Relies on hue being 8-bit and wrapping - for ( int i=0; i<6; i++ ) - { - HSV hsv = { .h = hueOffset, .s = satOffset, .v = g_config_brightness }; - RGB rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -ISR(TIMER3_COMPA_vect) -{ - // delay 1 second before driving LEDs or doing anything else - static uint8_t startup_tick = 0; - if ( startup_tick < 20 ) - { - startup_tick++; - return; - } - - g_tick++; - - if ( g_suspend_state ) - { - backlight_set_color_all( 0, 0, 0 ); - } - else - { - //HSV hsv = { .h = 240, .s = 255, .v = g_config_brightness }; - //RGB rgb = hsv_to_rgb( hsv ); - //backlight_set_color_all( rgb.r, rgb.g, rgb.b ); - backlight_effect_cycle_all(); - } -} - -void backlight_init_drivers(void) -{ - // Initialize I2C - i2c_init(); - IS31FL3218_init(); -} - -#endif // RGB_BACKLIGHT_ENABLED diff --git a/keyboards/rama/m6_b/rgb_backlight.h b/keyboards/rama/m6_b/rgb_backlight.h deleted file mode 100644 index bbf605284b8..00000000000 --- a/keyboards/rama/m6_b/rgb_backlight.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2018 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#if RGB_BACKLIGHT_ENABLED -#else -#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0 -#endif // RGB_BACKLIGHT_ENABLED - -#include -#include - -#include "quantum/color.h" - -void backlight_init_drivers(void); -void backlight_update_pwm_buffers(void); -void backlight_timer_init(void); -void backlight_timer_enable(void); -void backlight_timer_disable(void); -void backlight_set_suspend_state(bool state); - diff --git a/keyboards/rama/m6_b/rules.mk b/keyboards/rama/m6_b/rules.mk deleted file mode 100644 index 8226debd456..00000000000 --- a/keyboards/rama/m6_b/rules.mk +++ /dev/null @@ -1,77 +0,0 @@ -# project specific files -SRC = rgb_backlight.c \ - quantum/color.c \ - drivers/issi/is31fl3218.c \ - drivers/avr/i2c_master.c - - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Boot Section -BOOTLOADER = atmel-dfu - -# Do not put the microcontroller into power saving mode -# when we get USB suspend event. We want it to keep updating -# backlight effects. -OPT_DEFS += -DNO_SUSPEND_POWER_DOWN - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - -RAW_ENABLE = yes -DYNAMIC_KEYMAP_ENABLE = yes -CIE1931_CURVE = yes diff --git a/keyboards/rama/readme.md b/keyboards/rama/readme.md deleted file mode 100644 index c7ddf6d111d..00000000000 --- a/keyboards/rama/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -# RAMA - -Firmware for keyboards designed by [RAMA WORKS](https://rama.works) - -[RAMA M6-A](https://rama.works/m6a) - -[RAMA M60-A](https://rama.works/#/m60-a/) - -[RAMA U80-A](https://rama.works/#/tkl-a/) - -[RAMA M10-B](https://www.massdrop.com/buy/rama-m10-a?mode=guest_open) diff --git a/keyboards/rama/u80_a/config.h b/keyboards/rama/u80_a/config.h deleted file mode 100644 index bfd97282836..00000000000 --- a/keyboards/rama/u80_a/config.h +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright 2018 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x5241 // "RW" -#define PRODUCT_ID 0x080A // 80-A -#define DEVICE_VER 0x0001 -#define MANUFACTURER RAMA.WORKS -#define PRODUCT RAMA U80-A -#define DESCRIPTION RAMA U80-A Keyboard - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 17 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { F1, F0, E6, F4, F6, F7 } -#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4, B7, B0 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION ROW2COL - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - diff --git a/keyboards/rama/u80_a/info.json b/keyboards/rama/u80_a/info.json deleted file mode 100644 index cb61c89b881..00000000000 --- a/keyboards/rama/u80_a/info.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "keyboard_name": "RAMA U80-A", - "url": "https://rama.works/#/tkl-a/", - "maintainer": "Wilba", - "bootloader": "atmel-dfu", - "width": 18.25, - "height": 6.5, - "layouts": { - "LAYOUT_all": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5}, {"x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] - } - } -} diff --git a/keyboards/rama/u80_a/keymaps/default/keymap.c b/keyboards/rama/u80_a/keymaps/default/keymap.c deleted file mode 100644 index cf9225e3e5a..00000000000 --- a/keyboards/rama/u80_a/keymaps/default/keymap.c +++ /dev/null @@ -1,22 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_all( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - - [1] = LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - -}; - diff --git a/keyboards/rama/u80_a/readme.md b/keyboards/rama/u80_a/readme.md deleted file mode 100644 index c98d00cb6b4..00000000000 --- a/keyboards/rama/u80_a/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# RAMA U80-A - -![RAMA U80-A](https://something.com/something.jpg) - -A TKL keyboard. [More info at RAMA WORKS](https://rama.works/#/tkl-a/) - -Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) -Hardware Supported: RAMA U80-A PCB -Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) - -Make example for this keyboard (after setting up your build environment): - - make rama/u80_a:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/rama/u80_a/rules.mk b/keyboards/rama/u80_a/rules.mk deleted file mode 100644 index 99224c247cd..00000000000 --- a/keyboards/rama/u80_a/rules.mk +++ /dev/null @@ -1,68 +0,0 @@ -# project specific files -SRC = drivers/issi/is31fl3736.c \ - drivers/avr/i2c_master.c \ - keyboards/wilba_tech/wt_mono_backlight.c \ - keyboards/wilba_tech/wt_main.c - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/rama/u80_a/u80_a.h b/keyboards/rama/u80_a/u80_a.h deleted file mode 100644 index 26403ef3475..00000000000 --- a/keyboards/rama/u80_a/u80_a.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2018 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -#define ____ KC_NO - -// Right switch of split backspace is at 3,13 and is the only switch -// whose physical position doesn't match switch matrix position :-( -// However, it also makes no sense to view the physical as 18 columns, -// so the numbering goes 00 to 16. Deal with it. - -#define LAYOUT_all( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K313, K114, K115, K116, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ - K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ - K500, K501, K502, K506, K510, K511, K512, K513, K514, K515, K516 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, K015, K016 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, ____, ____, ____ }, \ - { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, ____, K415, ____ }, \ - { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, K514, K515, K516 } \ -} - diff --git a/keyboards/readme.md b/keyboards/readme.md index 5ba98c6c452..db2a18cc932 100644 --- a/keyboards/readme.md +++ b/keyboards/readme.md @@ -3,8 +3,6 @@ QMK runs on a diverse range of keyboards. Some of these keyboards are officially ## Official QMK Keyboards -These keyboards are manufactured by the maintainers of QMK. - ### Ortholinear Keyboards - Jack Humbert What makes OLKB keyboards shine is a combo of lean aesthetics, compact size, and killer tactile feel. These are available through [olkb.com](http://olkb.com) as well as through [Massdrop](http://massdrop.com) from time to time, as easy to assemble kits. @@ -13,12 +11,6 @@ What makes OLKB keyboards shine is a combo of lean aesthetics, compact size, and * [Preonic](/keyboards/preonic/) — Like the Planck, but bigger. 50%. * [Atomic](/keyboards/atomic/) — Imagine the size of the Planck. Now imagine the size of the Preonic. Now imagine _bigger_. That is the Atomic. A 60% keyboard. -### ErgoDox EZ - Erez Zukerman - -Made in Taiwan using advanced robotic manufacturing, the ErgoDox EZ is a fully-assembled, premium ergonomic keyboard. Its split design allows you to place both halves shoulder width, and its custom-made wrist rests and tilt/tent kit make for incredibly comfortable typing. Available on [ergodox-ez.com](https://ergodox-ez.com). - -* [ErgoDox EZ](/keyboards/ergodox_ez/) — Our one and only product. Yes, it's that awesome. Comes with either printed or blank keycaps, and 7 different keyswitch types. - ### Clueboard - Zach White Designed and built in Felton, CA, Clueboards keyboard emphasize quality and locally sourced components, available on [clueboard.co](http://clueboard.co) @@ -27,6 +19,13 @@ Designed and built in Felton, CA, Clueboards keyboard emphasize quality and loca * [Cluecard](/keyboards/clueboard/card/) — A small board to help you hack on QMK. * [Cluepad](/keyboards/clueboard/17/) — A mechanical numpad with QMK superpowers. +### ErgoDox EZ and Planck EZ - ZSA Technology Labs + +[ZSA Technology Labs](https://ergodox-ez.com) maintains its own [fork of QMK](https://github.com/zsa/qmk_firmware) which feeds its [configurator](https://configure.ergodox-ez.com), for stability and legal purposes. The ZSA boards are: + +* [ErgoDox EZ](/keyboards/ergodox_ez/) — A powerful split mechanical keyboard. +* [Planck EZ](/keyboards/planck/ez) — A 40% DIY powerhouse of customizability and modification capability. It's a lean, mean, typing machine, which ships fully assembled with a two-year warranty. + ## Community-supported QMK Keyboards @@ -35,9 +34,10 @@ These keyboards are part of the QMK repository, but their manufacturers are not * [9key](/keyboards/9key) — A 9-key minipad sold by Bishop Keyboards. * [Alps64](/keyboards/alps64) — A 60% keyboard for Alps keyswitches. * [AMJ60](/keyboards/amj60) — DIY/Assembled compact 60% keyboard. -* [Arrow Pad](/keyboards/arrow_pad) — A custom creation by IBNobody. +* [Arrow Pad](/keyboards/handwired/arrow_pad) — A custom creation by IBNobody. * [Atreus](/keyboards/atreus) — Made by Technomancy. * [Bantam44](/keyboards/bantam44) — It is a 44-key 40% staggered keyboard. +* [DataHand](/keyboards/handwired/datahand) — DataHand keyboard converted to use a Teensy board. * [Ergodox Infinity](/keyboards/ergodox_infinity) - Ergonomic Split Keyboard by Input Club. * [GH60](/keyboards/gh60) — A 60% Geekhack community-driven project. * [GON NerD](/keyboards/gonnerd) — Korean custom 60% PCB @@ -52,12 +52,13 @@ These keyboards are part of the QMK repository, but their manufacturers are not * [The Kitten Paw](/keyboards/kitten_paw) — A replacement controller (2016 revision) for the Filco Majestouch by [Bathroom Epiphanies](https://github.com/BathroomEpiphanies). * [Lets Split](/keyboards/lets_split) - Split ortholinear 40% keyboard. * [Phantom](/keyboards/phantom) — A tenkeyless kit by Teel, also from Geekhack. -* [Retro Refit](/keyboards/retro_refit) — Another creation by IBNobody. +* [Retro Refit](/keyboards/handwired/retro_refit) — Another creation by IBNobody. * [S60-x](/keyboards/s60_x) — DIY compact keyboard designed by VinnyCordeiro for Sentraq. * [Satan](/keyboards/satan) — A GH60 variant. * [SixKeyBoard](/keyboards/sixkeyboard) — A 6-key keyboard made by TechKeys. * [TheVan 44](/keyboards/tv44) — A 44-key staggered keybard by Evangs. * [WhiteFox](/keyboards/whitefox) — A 65% keyboard designed as a partnership by matt3o, Massdrop and Input Club * [Vision Division](/keyboards/vision_division) — Full Size / Split Linear Keyboard by IBNobody. +* [XD004](/keyboards/xd004) — 1x4 macro keyboard sold by KPrepublic. * [XD75](/keyboards/xd75) — 15x5 ortholinear keyboard by XIUDI. * [YMDK NP21](/keyboards/ymdk_np21) — ps2avrGB based number pad (numpad) sold by YMDK on Aliexpress. diff --git a/keyboards/redox/info.json b/keyboards/redox/info.json index f75d88a6bee..f91017365a2 100644 --- a/keyboards/redox/info.json +++ b/keyboards/redox/info.json @@ -6,7 +6,92 @@ "height": 6.25, "layouts": { "LAYOUT": { - "layout": [{"label":"[L2] `", "x":0, "y":0.375, "w":1.25}, {"label":"!", "x":1.25, "y":0.375}, {"label":"@", "x":2.25, "y":0.125}, {"label":"#", "x":3.25, "y":0}, {"label":"$", "x":4.25, "y":0.125}, {"label":"%", "x":5.25, "y":0.25}, {"label":"[L1]", "x":6.25, "y":0.75}, {"label":"[L1]", "x":11.25, "y":0.75}, {"label":"^", "x":12.25, "y":0.25}, {"label":"&", "x":13.25, "y":0.125}, {"label":"*", "x":14.25, "y":0}, {"label":"(", "x":15.25, "y":0.125}, {"label":")", "x":16.25, "y":0.375}, {"label":"[L2] -", "x":17.25, "y":0.375, "w":1.25}, {"label":"Tab", "x":0, "y":1.375, "w":1.25}, {"label":"Q", "x":1.25, "y":1.375}, {"label":"W", "x":2.25, "y":1.125}, {"label":"E", "x":3.25, "y":1}, {"label":"R", "x":4.25, "y":1.125}, {"label":"T", "x":5.25, "y":1.25}, {"label":"[", "x":6.25, "y":1.75, "h":1.5}, {"label":"]", "x":11.25, "y":1.75, "h":1.5}, {"label":"Y", "x":12.25, "y":1.25}, {"label":"U", "x":13.25, "y":1.125}, {"label":"I", "x":14.25, "y":1}, {"label":"O", "x":15.25, "y":1.125}, {"label":"P", "x":16.25, "y":1.375}, {"label":"=", "x":17.25, "y":1.375, "w":1.25}, {"label":"Esc", "x":0, "y":2.375, "w":1.25}, {"label":"A", "x":1.25, "y":2.375}, {"label":"S", "x":2.25, "y":2.125}, {"label":"D", "x":3.25, "y":2}, {"label":"F", "x":4.25, "y":2.125}, {"label":"G", "x":5.25, "y":2.25}, {"label":"PgUp", "x":6.75, "y":3.75}, {"label":"End", "x":10.75, "y":3.75}, {"label":"H", "x":12.25, "y":2.25}, {"label":"J", "x":13.25, "y":2.125}, {"label":"K", "x":14.25, "y":2}, {"label":"L", "x":15.25, "y":2.125}, {"label":":", "x":16.25, "y":2.375}, {"label":"'", "x":17.25, "y":2.375, "w":1.25}, {"label":"Shift", "x":0, "y":3.375, "w":1.25}, {"label":"Z", "x":1.25, "y":3.375}, {"label":"X", "x":2.25, "y":3.125}, {"label":"C", "x":3.25, "y":3}, {"label":"V", "x":4.25, "y":3.125}, {"label":"B", "x":5.25, "y":3.25}, {"label":"PgDn", "x":7.75, "y":3.75}, {"label":"Home", "x":9.75, "y":3.75}, {"label":"N", "x":12.25, "y":3.25}, {"label":"M", "x":13.25, "y":3.125}, {"label":"<", "x":14.25, "y":3}, {"label":">", "x":15.25, "y":3.125}, {"label":"?", "x":16.25, "y":3.375}, {"label":"Shift", "x":17.25, "y":3.375, "w":1.25}, {"label":"GUI", "x":0.25, "y":4.375}, {"label":"+", "x":1.25, "y":4.375}, {"label":"-", "x":2.25, "y":4.125}, {"label":"[Alt] *", "x":3.25, "y":4}, {"label":"[Ctrl] /", "x":5.5, "y":5.25, "w":1.25}, {"label":"Backspace", "x":6.75, "y":4.75, "h":1.5}, {"label":"Del", "x":7.75, "y":4.75, "h":1.5}, {"label":"Enter", "x":9.75, "y":4.75, "h":1.5}, {"label":"Space", "x":10.75, "y":4.75, "h":1.5}, {"label":"Alt", "x":11.75, "y":5.25, "w":1.25}, {"label":"Left", "x":14.25, "y":4}, {"label":"Down", "x":15.25, "y":4.125}, {"label":"Up", "x":16.25, "y":4.375}, {"label":"Right", "x":17.25, "y":4.375}] + "layout": [ + {"label":"_Nav || `", "x":0, "y":0.375, "w":1.25}, + {"label":"1", "x":1.25, "y":0.375}, + {"label":"2", "x":2.25, "y":0.125}, + {"label":"3", "x":3.25, "y":0}, + {"label":"4", "x":4.25, "y":0.125}, + {"label":"5", "x":5.25, "y":0.25}, + + {"label":"6", "x":12.25, "y":0.25}, + {"label":"7", "x":13.25, "y":0.125}, + {"label":"8", "x":14.25, "y":0}, + {"label":"9", "x":15.25, "y":0.125}, + {"label":"0", "x":16.25, "y":0.375}, + {"label":"_Nav || -", "x":17.25, "y":0.375, "w":1.25}, + + {"label":"Tab", "x":0, "y":1.375, "w":1.25}, + {"label":"Q", "x":1.25, "y":1.375}, + {"label":"W", "x":2.25, "y":1.125}, + {"label":"E", "x":3.25, "y":1}, + {"label":"R", "x":4.25, "y":1.125}, + {"label":"T", "x":5.25, "y":1.25}, + {"label":"MO(_SYMB)", "x":6.25, "y":0.75}, + + {"label":"MO(_SYMB)", "x":11.25, "y":0.75}, + {"label":"Y", "x":12.25, "y":1.25}, + {"label":"U", "x":13.25, "y":1.125}, + {"label":"I", "x":14.25, "y":1}, + {"label":"O", "x":15.25, "y":1.125}, + {"label":"P", "x":16.25, "y":1.375}, + {"label":"=", "x":17.25, "y":1.375, "w":1.25}, + + {"label":"Esc", "x":0, "y":2.375, "w":1.25}, + {"label":"A", "x":1.25, "y":2.375}, + {"label":"S", "x":2.25, "y":2.125}, + {"label":"D", "x":3.25, "y":2}, + {"label":"F", "x":4.25, "y":2.125}, + {"label":"G", "x":5.25, "y":2.25}, + {"label":"[", "x":6.25, "y":1.75, "h":1.5}, + + {"label":"]", "x":11.25, "y":1.75, "h":1.5}, + {"label":"H", "x":12.25, "y":2.25}, + {"label":"J", "x":13.25, "y":2.125}, + {"label":"K", "x":14.25, "y":2}, + {"label":"L", "x":15.25, "y":2.125}, + {"label":";", "x":16.25, "y":2.375}, + {"label":"'", "x":17.25, "y":2.375, "w":1.25}, + + {"label":"Shift", "x":0, "y":3.375, "w":1.25}, + {"label":"Z", "x":1.25, "y":3.375}, + {"label":"X", "x":2.25, "y":3.125}, + {"label":"C", "x":3.25, "y":3}, + {"label":"V", "x":4.25, "y":3.125}, + {"label":"B", "x":5.25, "y":3.25}, + + {"label":"_Adjust/Page Up", "x":6.75, "y":3.75}, + {"label":"Page Down", "x":7.75, "y":3.75}, + + {"label":"Home", "x":9.75, "y":3.75}, + {"label":"_Adjust/End", "x":10.75, "y":3.75}, + + {"label":"N", "x":12.25, "y":3.25}, + {"label":"M", "x":13.25, "y":3.125}, + {"label":",", "x":14.25, "y":3}, + {"label":",", "x":15.25, "y":3.125}, + {"label":"\\", "x":16.25, "y":3.375}, + {"label":"Shift", "x":17.25, "y":3.375, "w":1.25}, + + {"label":"LGUI", "x":0.25, "y":4.375}, + {"label":"P+", "x":1.25, "y":4.375}, + {"label":"P-", "x":2.25, "y":4.125}, + {"label":"LAlt || P*", "x":3.25, "y":4}, + + {"label":"LCtrl || P/", "x":5.5, "y":5.25, "w":1.25}, + {"label":"Backspace", "x":6.75, "y":4.75, "h":1.5}, + {"label":"Delete", "x":7.75, "y":4.75, "h":1.5}, + + {"label":"Enter", "x":9.75, "y":4.75, "h":1.5}, + {"label":"Space", "x":10.75, "y":4.75, "h":1.5}, + {"label":"RAlt", "x":11.75, "y":5.25, "w":1.25}, + + {"label":"Left", "x":14.25, "y":4}, + {"label":"Down", "x":15.25, "y":4.125}, + {"label":"Up", "x":16.25, "y":4.375}, + {"label":"Right", "x":17.25, "y":4.375} + ] } } } + diff --git a/keyboards/redox/keymaps/default/config.h b/keyboards/redox/keymaps/default/config.h index 0670bf294fb..a3ef209a05d 100644 --- a/keyboards/redox/keymaps/default/config.h +++ b/keyboards/redox/keymaps/default/config.h @@ -18,12 +18,10 @@ along with this program. If not, see . #pragma once /* Use I2C or Serial, not both */ - -// #define USE_SERIAL -#define USE_I2C +#define USE_SERIAL +// #define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS diff --git a/keyboards/redox/keymaps/default/rules.mk b/keyboards/redox/keymaps/default/rules.mk index 1e576127880..a81250cdf6d 100644 --- a/keyboards/redox/keymaps/default/rules.mk +++ b/keyboards/redox/keymaps/default/rules.mk @@ -1,5 +1,2 @@ RGBLIGHT_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/redox/keymaps/fculpo/config.h b/keyboards/redox/keymaps/fculpo/config.h new file mode 100644 index 00000000000..bff76aef264 --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2018 Mattia Dal Ben + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/redox/keymaps/fculpo/keymap.c b/keyboards/redox/keymaps/fculpo/keymap.c new file mode 100644 index 00000000000..b5aeca99dd2 --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _SYMB 1 +#define _NAV 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SYMB, + NAV, + ADJUST, +}; + +// Shortcut to make keymap more readable +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTES LCTL_T(KC_ESC) +#define KC_CTQU RCTL_T(KC_QUOT) + +#define KC_NAGR LT(_NAV, KC_GRV) +#define KC_NAMI LT(_NAV, KC_MINS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CTES ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_CTQU , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_BSLS ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_LGUI , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , KC_RALT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,KC_F6 , KC_F7 ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_HASH ,KC_DLR ,KC_LBRC ,KC_RBRC ,KC_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PERC ,KC_CIRC ,KC_LPRN ,KC_RPRN ,KC_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_NAV] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,KC_F12 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; diff --git a/keyboards/redox/keymaps/fculpo/keymap.json b/keyboards/redox/keymaps/fculpo/keymap.json new file mode 100644 index 00000000000..ca7905b1695 --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/keymap.json @@ -0,0 +1,399 @@ +[ + { + "name": "Redox/rev1", + "author": "Fabien Culpo", + "switchMount": "cherry", + "plate": false, + "pcb": false + }, + [ + { + "x": 3.5 + }, + "#\n3", + { + "x": 10.5 + }, + "*\n8" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "@\n2", + { + "x": 1 + }, + "$\n4", + { + "x": 8.5 + }, + "&\n7", + { + "x": 1 + }, + "(\n9" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "%\n5", + { + "x": 6.5 + }, + "^\n6" + ], + [ + { + "y": -0.875, + "x": 0.25, + "a": 5, + "w": 1.25 + }, + "`\nLayer 2\n\n\n\n\n~", + { + "a": 4 + }, + "!\n1", + { + "x": 14.5 + }, + ")\n0", + { + "a": 5, + "w": 1.25 + }, + "_\nLayer 2\n\n\n\n\n-" + ], + [ + { + "y": -0.625, + "x": 6.5 + }, + "Layer 1", + { + "x": 4.5 + }, + "Layer 1" + ], + [ + { + "y": -0.75, + "x": 3.5, + "a": 4 + }, + "E", + { + "x": 10.5 + }, + "I" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "W", + { + "x": 1 + }, + "R", + { + "x": 8.5 + }, + "U", + { + "x": 1 + }, + "O" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "T", + { + "x": 6.5 + }, + "Y" + ], + [ + { + "y": -0.875, + "x": 0.25, + "a": 7, + "w": 1.25 + }, + "TAB", + { + "a": 4 + }, + "Q", + { + "x": 14.5 + }, + "P", + { + "a": 5, + "w": 1.25 + }, + "+\n=" + ], + [ + { + "y": -0.625, + "x": 6.5, + "a": 7, + "h": 1.5 + }, + "[", + { + "x": 4.5, + "h": 1.5 + }, + "]" + ], + [ + { + "y": -0.75, + "x": 3.5, + "a": 4 + }, + "D", + { + "x": 10.5 + }, + "K" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "S", + { + "x": 1, + "n": true + }, + "F", + { + "x": 8.5, + "n": true + }, + "J", + { + "x": 1 + }, + "L" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "G", + { + "x": 6.5 + }, + "H" + ], + [ + { + "y": -0.875, + "x": 0.25, + "a": 5, + "w": 1.25 + }, + "ESC\nCTRL", + { + "a": 4 + }, + "A", + { + "x": 14.5 + }, + ":\n;", + { + "a": 5, + "w": 1.25 + }, + "'\nCTRL" + ], + [ + { + "y": -0.375, + "x": 3.5, + "a": 4 + }, + "C", + { + "x": 10.5 + }, + "<\n," + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "X", + { + "x": 1 + }, + "V", + { + "x": 8.5 + }, + "M", + { + "x": 1 + }, + ">\n." + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "B", + { + "x": 6.5 + }, + "N" + ], + [ + { + "y": -0.875, + "x": 0.25, + "a": 5, + "w": 1.25 + }, + "SHIFT", + { + "a": 4 + }, + "Z", + { + "x": 14.5 + }, + "?\n/", + { + "a": 5, + "w": 1.25 + }, + "SHIFT" + ], + [ + { + "y": -0.375, + "x": 3.5 + }, + "*\nALT", + { + "x": 10.5 + }, + "Left" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "-", + { + "x": 12.5 + }, + "Down" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "|\n\n\n\n\n\n\\", + "+", + { + "x": 14.5 + }, + "Up", + { + "sb": "cherry", + "st": "MX1A-21xx" + }, + "Right" + ], + [ + { + "r": 15, + "y": -2.625, + "x": 5.75, + "a": 7, + "w": 1.25 + }, + "SUPER" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "a": 5 + }, + "PgUp\nLay. 3", + { + "a": 7 + }, + "PgDn" + ], + [ + { + "h": 1.5 + }, + "Bksp", + { + "h": 1.5 + }, + "Del" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -2 + }, + "Home", + { + "a": 5 + }, + "End\nLay. 3" + ], + [ + { + "x": -2, + "a": 7, + "h": 1.5 + }, + "Enter", + { + "h": 1.5 + }, + "Space" + ], + [ + { + "r": -15, + "rx": 0, + "ry": 0, + "y": 7.75, + "x": 11.75, + "w": 1.25 + }, + "ALT" + ] +] diff --git a/keyboards/redox/keymaps/fculpo/readme.md b/keyboards/redox/keymaps/fculpo/readme.md new file mode 100644 index 00000000000..1250e47b9c9 --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/readme.md @@ -0,0 +1,18 @@ +# A tweaked keymap for Redox + +This keymap modifies the [default keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/redox) for the awesome [Redox keyboard](https://github.com/mattdibi/redox-keyboard) designed by Mattia Dal Ben. + +Also heavily inspired by nrichers layout. + +![fculpo Layout Image](https://i.imgur.com/OXT8boJ.png) + +## Changes to the default keymap + +These keymap changes are meant to improve the usability of the layout in everyday use: + +- Move `GUI` (`SUPER`) key to where default left `CTRL` is +- Move `/?` into usual location next to right `SHIFT` - the default flash from Falbatech put `\|` here (might not be the Redox default?), which felt unintuitive +- Put `\|` into bottom-left spot where `GUI` (`SUPER`) was - had to go somewhere and this bottom-left placement sort of balances with the almost bottom-right `/?` +- Change default `ESC` into `ESC` on tap, `CTRL` on hold - Love the UNIX-ey `CTRL` key location and wanted to keep `ESC` in the original position +- Change default `'` above right `SHIFT` into `'` on tap, `CTRL` on hold - Love the UNIX-ey CTRL key location, but it can give you 'left claw hand', which a second, mirrored `CTRL` key fixes +- Add `F11` and `F12` keys to two layers - needed on macOS if you want to control volume up and down from your keyboard (not shown, on a different layer)S diff --git a/keyboards/redox/keymaps/fculpo/rules.mk b/keyboards/redox/keymaps/fculpo/rules.mk new file mode 100644 index 00000000000..a81250cdf6d --- /dev/null +++ b/keyboards/redox/keymaps/fculpo/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/redox/keymaps/finex/config.h b/keyboards/redox/keymaps/finex/config.h new file mode 100644 index 00000000000..8852a4cc872 --- /dev/null +++ b/keyboards/redox/keymaps/finex/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2018 Leonardo (FiNeX) Finetti + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +// #define PERMISSIVE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM 200 diff --git a/keyboards/redox/keymaps/finex/keymap.c b/keyboards/redox/keymaps/finex/keymap.c new file mode 100644 index 00000000000..5a508815b2d --- /dev/null +++ b/keyboards/redox/keymaps/finex/keymap.c @@ -0,0 +1,386 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Layer names +enum{ + // - Base layers: + _COLEMAKDHMK, + _COLEMAKDHMK_MAC, + _QWERTY, + _QWERTY_MAC, + // - Symbols, numbers, functions and custom shifts: + _SYMB, + _NUMB, + _FUNC, + _RHSH, // Righ hand shifted keycodes + _LHSH, // Left hand shifted keycodes + // - Adjust layer: + _ADJUST +}; + +// Custom keycodes +enum custom_keycodes { + COLEMAKDHMK = SAFE_RANGE, + COLEMAKDHMK_MAC, + QWERTY, + QWERTY_MAC, + ASC_SAR, + ASC_DAR, + ASC_SQT, + ASC_DQT, + ASC_CIRC, + ASC_TILD, + ASC_HAP, + ASC_SAD, + ASC_BKT, + ASC_CBRL, + ASC_CBRR +}; + +// Tap dance keycodes +enum tap_dance{ + TD_SCLN, // ;; -> : + TD_LBRC, // [[ -> { + TD_RBRC, // ]] -> } + TD_QMRK // // -> ? +}; + +// Semicolon to Colon +void dance_scln_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_SCLN); + } else { + register_code (KC_RSFT); + register_code (KC_SCLN); + } +} +void dance_scln_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_SCLN); + } else { + unregister_code (KC_RSFT); + unregister_code (KC_SCLN); + } +} + +// Square braket to curly bracket (left) +void dance_lbrc_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LBRC); + } else { + register_code (KC_RSFT); + register_code (KC_LBRC); + } +} +void dance_lbrc_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LBRC); + } else { + unregister_code (KC_RSFT); + unregister_code (KC_LBRC); + } +} + +// Square braket to curly bracket (right) +void dance_rbrc_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_RBRC); + } else { + register_code (KC_RSFT); + register_code (KC_RBRC); + } +} +void dance_rbrc_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_RBRC); + } else { + unregister_code (KC_RSFT); + unregister_code (KC_RBRC); + } +} + + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCLN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_scln_finished, dance_scln_reset), + [TD_LBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_lbrc_finished, dance_lbrc_reset), + [TD_RBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_rbrc_finished, dance_rbrc_reset) +}; + + +// Shortcut to make keymap more readable + +// - Adjustment Layer: +#define KC_ADEN LT(_ADJUST, KC_END) // End / _ADJUST layer +#define KC_ADPU LT(_ADJUST, KC_PGUP) // Page Up / _ADJUST layer + +// - Custom layers: +#define KC_SYSP LT(_SYMB, KC_SPC) // Space / _symbols +#define KC_NUES LT(_NUMB, KC_ESC) // Esc / _numbers +#define KC_FUTA LT(_FUNC, KC_TAB) // Tab / _functions +#define KC_N_SH LT(_LHSH, KC_N) // Pressing N key, enable shifted keys on other half (the left one) +#define KC_T_SH LT(_RHSH, KC_T) // Pressing T key, enable shifted keys on other half (the right one) + +// - Custom keys/modifiers: +#define KC_ATAB RALT_T(KC_TAB) // - Tab / Alt Gr +#define KC_CESC LCTL_T(KC_ESC) // - Esc / Left Ctrl +#define KC_GSPC LGUI_T(KC_SPC) // - Space / Left GUI +#define KC_CBSP LCTL_T(KC_BSPC) // - Backspace / Left Ctrl + +// -- Mac os mode: +#define KC_CSPC LCTL_T(KC_SPC) // - Space / Left Ctrl +#define KC_GBSP LGUI_T(KC_BSPC) // - Backspace / Left GUI + + +#define KC_AEQL LALT_T(KC_EQL) // - Equals / Alt (left alt) +#define KC_CMIN RCTL_T(KC_MINUS) // - Minus / Right Ctrl +#define KC_ADEL RALT_T(KC_DEL) // - Del / Alt Gr +#define KC_RSEN RSFT_T(KC_ENT) // - Enter / Right Shift (standard shift) +#define KC_LAEN LALT_T(KC_ENT) // - Enter / Left Alt + +// Home row mod tap keys: +// - Left hand +#define KC_CT_A CTL_T(KC_A) // A / Left Ctrl +#define KC_AL_S ALT_T(KC_S) // S / Left Alt +// - Right hand +#define KC_AL_E ALT_T(KC_E) // E / Left Alt +#define KC_CT_O CTL_T(KC_O) // O / Left Ctrl + +// - Tap dance: +#define KC_TDSC TD(TD_SCLN) // ;; -> : +#define KC_TDLB TD(TD_LBRC) // [[ -> { +#define KC_TDRB TD(TD_RBRC) // ]] -> } + +// - Keyboard base maps: +#define LR1 COLEMAKDHMK +#define LR2 COLEMAKDHMK_MAC +#define LR3 QWERTY +#define LR4 QWERTY_MAC + + +// Send custom strings or change default base layer +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case ASC_SAR: + SEND_STRING("->"); + return false; + case ASC_DAR: + SEND_STRING("=>"); + return false; + case ASC_SQT: + // SS_RALT(): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT("'")); + return false; + case ASC_DQT: + // SS_RALT(SS_LSFT()): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT(SS_LSFT("\""))); + return false; + case ASC_CIRC: + // SS_RALT(): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT("^")); + return false; + case ASC_TILD: + // SS_RALT(SS_LSFT()): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT(SS_LSFT("~"))); + return false; + case ASC_HAP: + SEND_STRING(":-) "); + return false; + case ASC_SAD: + SEND_STRING(":-( "); + return false; + case ASC_BKT: + // SS_RALT(): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT("`")); + return false; + case ASC_CBRL: + SEND_STRING("{"); + return false; + case ASC_CBRR: + SEND_STRING("}"); + return false; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAKDHMK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAKDHMK); + } + return false; + break; + case QWERTY_MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY_MAC); + } + return false; + break; + case COLEMAKDHMK_MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAKDHMK_MAC); + } + return false; + break; + } + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Colemak DM-MK Mod + [_COLEMAKDHMK] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_ESC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ATAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,XXXXXXX , XXXXXXX ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_TDSC ,KC_AEQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_R ,KC_AL_S ,KC_T_SH ,KC_G ,KC_TDLB , KC_TDRB ,KC_M ,KC_N_SH ,KC_AL_E ,KC_I ,KC_O ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_D ,KC_V ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_K ,KC_H ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_GSPC ,KC_HYPR ,KC_MEH ,XXXXXXX , KC_NUES , KC_CBSP ,KC_FUTA , KC_LAEN ,KC_SYSP , KC_ADEL , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // Colemak DM-MK Mod, Mac version (CTRL and GUI are swapped) + [_COLEMAKDHMK_MAC] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_ESC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ATAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,XXXXXXX , XXXXXXX ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_TDSC ,KC_AEQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_R ,KC_AL_S ,KC_T_SH ,KC_G ,KC_TDLB , KC_TDRB ,KC_M ,KC_N_SH ,KC_AL_E ,KC_I ,KC_O ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_D ,KC_V ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_K ,KC_H ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_CSPC ,KC_HYPR ,KC_MEH ,XXXXXXX , KC_NUES , KC_GBSP ,KC_FUTA , KC_LAEN ,KC_SYSP , KC_ADEL , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // QWERTY + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_ESC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ATAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,XXXXXXX , XXXXXXX ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_AEQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_TDLB , KC_TDRB ,KC_H ,KC_J ,KC_K ,KC_L ,KC_TDSC ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_GSPC ,KC_HYPR ,KC_MEH ,XXXXXXX , KC_NUES , KC_CBSP ,KC_FUTA , KC_LAEN ,KC_SYSP , KC_ADEL , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // QWERTY, Mac version (CTRL and GUI are swapped) + [_QWERTY_MAC] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_ESC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ATAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,XXXXXXX , XXXXXXX ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_AEQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_TDLB , KC_TDRB ,KC_H ,KC_J ,KC_K ,KC_L ,KC_TDSC ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_CSPC ,KC_HYPR ,KC_MEH ,XXXXXXX , KC_NUES , KC_GBSP ,KC_FUTA , KC_LAEN ,KC_SYSP , KC_ADEL , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // Symbols, home row arrows, function keys and macros layer + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC ,_______ , _______ ,ASC_CIRC,KC_AMPR ,KC_ASTR ,KC_PLUS ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PIPE ,KC_PMNS ,ASC_SQT ,ASC_DQT ,KC_GRV ,ASC_SAR , ASC_DAR ,KC_QUOT ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_BSLS ,KC_UNDS ,KC_COLN ,ASC_TILD,KC_EQL ,ASC_SAD ,ASC_HAP , _______ ,_______ ,ASC_BKT ,KC_PGUP ,KC_PGDN ,KC_HOME ,KC_END ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // Numeric keypad layer + [_NUMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,KC_PAST ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,KC_PPLS ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,KC_PMNS ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,KC_PSLS ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , XXXXXXX , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // Function layer and some extra keys on right hand + [_FUNC] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F12 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F11 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PSCR ,KC_NLCK ,KC_INS ,KC_CAPS ,KC_APP ,_______ ,_______ , _______ ,_______ ,_______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F10 ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + + // Left hand shifted keycodes + [_LHSH] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,S(KC_Q) ,S(KC_W) ,S(KC_F) ,S(KC_P) ,S(KC_B) ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,S(KC_A) ,S(KC_R) ,S(KC_S) ,S(KC_T) ,S(KC_G) ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,S(KC_Z) ,S(KC_X) ,S(KC_C) ,S(KC_D) ,S(KC_V) ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , KC_TAB ,KC_BSPC , KC_ESC , _______ ,_______ ,_______ ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // Right hand shifted keycodes + [_RHSH] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,S(KC_J) ,S(KC_L) ,S(KC_U) ,S(KC_Y) ,KC_COLN ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,S(KC_M) ,S(KC_N) ,S(KC_E) ,S(KC_I) ,S(KC_O) ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,S(KC_K) ,S(KC_H) ,KC_LABK ,KC_RABK ,KC_QUES ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , KC_DEL , KC_SPC ,KC_ENT , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + // Adjust layer (RGB, Reset and base layer switch) + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,LR1 ,LR2 ,LR3 ,LR4 ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,RGB_M_B ,RGB_M_R ,RGB_M_SW,RGB_M_SN,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,RGB_M_K ,RGB_M_X ,RGB_M_G ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; diff --git a/keyboards/redox/keymaps/finex/readme.md b/keyboards/redox/keymaps/finex/readme.md new file mode 100644 index 00000000000..9b88469a133 --- /dev/null +++ b/keyboards/redox/keymaps/finex/readme.md @@ -0,0 +1,70 @@ +# Customized keymap for Redox by Leonardo (FiNeX) Finetti. + + +## Features + +- Enabled USE_SERIAL for Falba.Tech Redox keyboards. +- PC Layouts: Colemak Mod DH-MK, Qwerty. +- Mac Layouts: same as above with CTRL-GUI keys inverted. +- Added redundant `Space`, `Esc`, `Ctrl` and `Enter` keys. I like to have this + keys on both halves. +- Added macro to print `->` and `=>` strings. +- Added macro to print `:-( ` and `:-) ` strings. +- Added more arrows. +- Added `(` and `)` on Shifts keys. +- Tapdance: `:` (`;` × 2), `{` (`[` × 2), `}` (`]` × 2). +- Removed Mouse and media support. +- Added missing "Print Screen" and "Menu" keys. +- Added missing "F11" and "F12" keys. +- Added `Alt` modifier on home row. +- Added `Shift other half` on home keys: this allows to shift the right half +pressing `t` on the left (or `f` using Qwerty), and the opposite pressing `n` +(or `j` for Qwerty layout). + + +## Description + +This keymap use the default one with some changes to suit my needs. Mainly +having most used symbol on a separated layer copying the common symbols on the +number keys on the second row and adding other symbols and ``|´` dead keys for +accents. + + +## Main Keyboard Layout + +[TODO] + + +## Changelog + +- 2018/11/13 + First public release. +- 2018/12/04 + Added Caps Lock, Num Lock and Insert on Symbols Layout. Inverted KC_GRV and + KC_QUOT on Symbols Layout. Added "Toggle Symbols Layout" and "Momentarily + activates Symbols Layout" on bottom row. Added Space/Control on left bottom + corner: now both halves contains Enter and Space keys. +- 2018/12/23 + Moved around modifiers key. + Added MEH and HYPER keys. + Improved symbols layout. + Rearranged layers. +- 2019/01/04 + Added new layer with numeric keypad and rearranged symbols. +- 2019/01/26 + Added curly brackets on own keys (normally unused). + Added tap dance for testing purpose. + Minor fixes. +- 2019/02/25 + Major layouts upgrade, partially inspired by Steven Hum's Beakl layouts. +- 2019/03/17 + Aligned qwerty and mac to main layout. + + +## TODO + +- Bring back mouse and multimedia keys. +- Add default Colemak Mod DH layout. +- Improve top corner keys. +- Improve bottom row keys. +- Improve README.md diff --git a/keyboards/redox/keymaps/finex/rules.mk b/keyboards/redox/keymaps/finex/rules.mk new file mode 100644 index 00000000000..f248688fb49 --- /dev/null +++ b/keyboards/redox/keymaps/finex/rules.mk @@ -0,0 +1,4 @@ +RGBLIGHT_ENABLE = yes +COMMAND_ENABLE = no +KEY_LOCK_ENABLE = yes +TAP_DANCE_ENABLE=yes diff --git a/keyboards/redox/keymaps/german/config.h b/keyboards/redox/keymaps/german/config.h index 0eb19ab1ef3..a3ef209a05d 100644 --- a/keyboards/redox/keymaps/german/config.h +++ b/keyboards/redox/keymaps/german/config.h @@ -18,14 +18,12 @@ along with this program. If not, see . #pragma once /* Use I2C or Serial, not both */ - -// #define USE_SERIAL -#define USE_I2C +#define USE_SERIAL +// #define USE_I2C /* Select hand configuration */ - -// #define MASTER_LEFT #define MASTER_LEFT +// #define MASTER_RIGHT // #define EE_HANDS #undef RGBLED_NUM diff --git a/keyboards/redox/keymaps/italian/config.h b/keyboards/redox/keymaps/italian/config.h index 0670bf294fb..a3ef209a05d 100644 --- a/keyboards/redox/keymaps/italian/config.h +++ b/keyboards/redox/keymaps/italian/config.h @@ -18,12 +18,10 @@ along with this program. If not, see . #pragma once /* Use I2C or Serial, not both */ - -// #define USE_SERIAL -#define USE_I2C +#define USE_SERIAL +// #define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS diff --git a/keyboards/redox/keymaps/italian/rules.mk b/keyboards/redox/keymaps/italian/rules.mk index 1e576127880..a81250cdf6d 100644 --- a/keyboards/redox/keymaps/italian/rules.mk +++ b/keyboards/redox/keymaps/italian/rules.mk @@ -1,5 +1,2 @@ RGBLIGHT_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/redox/keymaps/jeherve/config.h b/keyboards/redox/keymaps/jeherve/config.h index 939d0c8d83d..b9b67c999f6 100644 --- a/keyboards/redox/keymaps/jeherve/config.h +++ b/keyboards/redox/keymaps/jeherve/config.h @@ -17,16 +17,14 @@ along with this program. If not, see . #pragma once -/* Use I2C or Serial, not both */ - /* Change the default tapping toggle value (normally 5) */ #define TAPPING_TOGGLE 2 +/* Use I2C or Serial, not both */ #define USE_SERIAL //#define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS diff --git a/keyboards/redox/keymaps/jeherve/keymap.c b/keyboards/redox/keymaps/jeherve/keymap.c index f8dfc4854c6..f39b5a438a4 100644 --- a/keyboards/redox/keymaps/jeherve/keymap.c +++ b/keyboards/redox/keymaps/jeherve/keymap.c @@ -25,14 +25,11 @@ enum custom_keycodes { WAVE, YOSHI, THUMB_UP, - NBSP + NBSP, + INV_1P, + ALFRED }; -// Make macros a bit simpler with this shortcut. -#define TAP_ONCE(code) \ - register_code (code); \ - unregister_code (code) - // Is shift being held? Let's store this in a bool. static bool shift_held = false; @@ -40,16 +37,22 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch(keycode) { case SHRUG: if (record->event.pressed) { - unicode_input_start(); register_hex(0xaf); unicode_input_finish(); - TAP_ONCE (KC_BSLS); - register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); - register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); - TAP_ONCE (KC_SLSH); - unicode_input_start (); register_hex(0xaf); unicode_input_finish(); + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); } return false; break; + case INV_1P: + if (record->event.pressed) { + SEND_STRING(SS_DOWN(X_LGUI)SS_DOWN(X_LALT)SS_TAP(X_BSLASH)SS_UP(X_LGUI)SS_UP(X_LALT)); + } + return false; + break; + case ALFRED: + if (record->event.pressed) { + SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_SPACE)SS_UP(X_LALT)); + } + return false; + break; case YOSHI: if (record->event.pressed) { SEND_STRING(":yellow_yoshi:"); @@ -125,7 +128,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { }; // Shortcut to make keymap more readable -#define KC_CTDN LCTL(KC_DOWN) #define KC_SYQT LT(_SYMB,KC_QUOT) #define SYM_L MO(_SYMB) #define MO_INTR MO(_INTER) @@ -152,13 +154,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_EQL , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_G ,KC_ESC , KC_CTDN ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_BSLS , + KC_TAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_G ,KC_ESC , INV_1P ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_BSLS , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ SYM_L ,KC_A ,KC_R ,KC_S ,KC_T ,KC_D ,M_BRACKET_LEFT, M_BRACKET_RIGHT ,KC_H ,KC_N ,KC_E ,KC_I ,KC_O ,KC_SYQT , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,TT(_NAV),TT(_SYMB), TT(_SYMB),TT(_NAV),KC_K ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - MO_INTR ,KC_LCTL ,KC_HYPR ,KC_LALT , KC_LCMD , KC_BSPC ,KC_LCTL , KC_ENT ,KC_SPC , KC_RCMD , TT_ADJ ,KC_HYPR ,KC_RCTL ,MO_INTR + MO_INTR ,KC_LCTL ,KC_HYPR ,KC_LALT , KC_LCMD , KC_BSPC ,KC_LCTL , KC_ENT ,KC_SPC , ALFRED , TT_ADJ ,KC_HYPR ,KC_RCTL ,MO_INTR //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), @@ -166,13 +168,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______ ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_LCBR , KC_RCBR ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,_______ , + _______ ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,_______ , _______ ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,_______ , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______ ,KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC ,_______ , _______ ,KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_MINS ,KC_UNDS ,_______ , + _______ ,KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC ,KC_LCBR , KC_RCBR ,KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_MINS ,KC_UNDS ,_______ , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , + _______ ,_______ ,_______ ,KC_TILD ,KC_GRV , _______ ,_______ ,_______ , _______ ,_______ ,_______ ,KC_EQL ,KC_PLUS ,_______ ,_______ ,_______ , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), @@ -184,9 +186,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ XXXXXXX ,XXXXXXX ,KC_VOLD ,KC_VOLU ,KC_MUTE ,XXXXXXX ,_______ , _______ ,XXXXXXX ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ + _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), @@ -200,7 +202,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ XXXXXXX ,UC_00E2 ,XXXXXXX ,UC_00E7 ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,UC_0171 ,UC_00EA ,XXXXXXX ,UC_0151 ,XXXXXXX , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,NBSP , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ + _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,NBSP , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), @@ -214,7 +216,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ + _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ) @@ -230,8 +232,8 @@ void persistent_default_layer_set(uint16_t default_layer) { } // Set unicode in Mac OS. -void matrix_init_user(void) { - set_unicode_input_mode(UC_OSX); +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_OSX); }; // Change LED colors depending on the layer. diff --git a/keyboards/redox/keymaps/jeherve/readme.md b/keyboards/redox/keymaps/jeherve/readme.md index 5afad5530a7..515dcbd6226 100644 --- a/keyboards/redox/keymaps/jeherve/readme.md +++ b/keyboards/redox/keymaps/jeherve/readme.md @@ -1,7 +1,7 @@ # A Colemak keymap for the Redox keyboard ---- -![jeherve-redox-layout-3](https://user-images.githubusercontent.com/426388/45171716-69888200-b203-11e8-822d-7bc91f9f6c07.jpg) +![jeherve-redox-layout-4](https://user-images.githubusercontent.com/426388/50276398-2664be80-0442-11e9-86b9-fbd0f4275354.png) ---- @@ -25,6 +25,11 @@ My keymap uses 5 layers: ## Changelog +- 2018.12.20 + - 2 new Macro keys, to invoke [Alfred](https://www.alfredapp.com/) and [1Password](https://1password.com/). + - No more Right Command key or Expose key, I didn't use those much. + - Updates to use newer QMK function to call ¯\_(ツ)_/¯ + - Fix: you can now move back to the base layer when double tapping the thumb keys to switch to the Nav layer. 👍 - 2018.09.06 - Initial submission to QMK. It's alive! ⌨️ diff --git a/keyboards/redox/keymaps/nrichers/config.h b/keyboards/redox/keymaps/nrichers/config.h new file mode 100755 index 00000000000..a3ef209a05d --- /dev/null +++ b/keyboards/redox/keymaps/nrichers/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2018 Mattia Dal Ben + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/redox/keymaps/nrichers/keymap.c b/keyboards/redox/keymaps/nrichers/keymap.c new file mode 100755 index 00000000000..7434b436829 --- /dev/null +++ b/keyboards/redox/keymaps/nrichers/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _SYMB 1 +#define _NAV 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SYMB, + NAV, + ADJUST, +}; + +// Shortcut to make keymap more readable +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTES LCTL_T(KC_ESC) +#define KC_CTQU RCTL_T(KC_QUOT) + +#define KC_NAGR LT(_NAV, KC_GRV) +#define KC_NAMI LT(_NAV, KC_MINS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CTES ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_CTQU , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_BSLS ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_LGUI , KC_SPC ,KC_BSPC , KC_DEL ,KC_ENT , KC_RGUI , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,KC_F12 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_HASH ,KC_DLR ,KC_LBRC ,KC_RBRC ,KC_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PERC ,KC_CIRC ,KC_LPRN ,KC_RPRN ,KC_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_NAV] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,KC_F12 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; diff --git a/keyboards/redox/keymaps/nrichers/keymap.png b/keyboards/redox/keymaps/nrichers/keymap.png new file mode 100644 index 00000000000..8ef3fe4eaa5 Binary files /dev/null and b/keyboards/redox/keymaps/nrichers/keymap.png differ diff --git a/keyboards/redox/keymaps/nrichers/readme.md b/keyboards/redox/keymaps/nrichers/readme.md new file mode 100755 index 00000000000..6189e8e9b26 --- /dev/null +++ b/keyboards/redox/keymaps/nrichers/readme.md @@ -0,0 +1,28 @@ +# A tweaked keymap for Redox + +This keymap modifies the [default keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/redox) for the awesome [Redox keyboard](https://github.com/mattdibi/redox-keyboard) designed by Mattia Dal Ben. + +![Modified Redox keymap](https://github.com/nrichers/qmk_firmware/blob/master/keyboards/redox/keymaps/nrichers/keymap.png) + +## Changes to the default keymap ![#99fcbe](https://placehold.it/15/99fcbe/000000?text=+) + +These keymap changes are meant to improve the usability of the layout in everyday use: + +- Move `GUI` (`SUPER`) key to where default left `CTRL` and right `ALT` are - gives you two frequently used `CMD` keys on macOS where my brain expects them +- Move `/?` into usual location next to right `SHIFT` - the default flash from Falbatech put `\|` here (might not be the Redox default?), which felt unintuitive +- Put `\|` into bottom-left spot where `GUI` (`SUPER`) was - had to go somewhere and this bottom-left placement sort of balances with the almost bottom-right `/?` +- Change default `ESC` into `ESC` on tap, `CTRL` on hold - Love the UNIX-ey `CTRL` key location and wanted to keep `ESC` in the original position +- Change default `'` above right `SHIFT` into `'` on tap, `CTRL` on hold - Love the UNIX-ey CTRL key location, but it can give you 'left claw hand', which a second, mirrored `CTRL` key fixes +- Add `F11` and `F12` keys to two layers - needed on macOS if you want to control volume up and down from your keyboard (not shown, on a different layer) +- On thumb clusters: + - Left: Move `SPACE` closest to left thumb and move `BACKSPACE` to the right of that - put the key for 'getting it right' closest to your thumb and reduce usage of my right hand (purely personal preference) + - Right: Move `ENTER` closest to right thumb and move `DEL` to the left of that - put the key for 'getting it right' closest to your thumb + +## Changes to the Redox layout ![#99e6fc](https://placehold.it/15/99e6fc/000000?text=+) + +These are physical keycap changes on the board that make reaching the `Layer 1` keys easier and that, subjectively, look more balanced visually: + +- Increase the `Layer 1` key sizes from 1U to 1.25U +- Decrease the 1.5 U key size for `[` and `]` to 1.25U + +You could even make `[` and `]` 1U so that you can use keycaps from a standard ANSI key set and also increase the size of the `Layer 2` keys to 1.5U. diff --git a/keyboards/redox/keymaps/nrichers/rules.mk b/keyboards/redox/keymaps/nrichers/rules.mk new file mode 100755 index 00000000000..a81250cdf6d --- /dev/null +++ b/keyboards/redox/keymaps/nrichers/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/redox/keymaps/ptillemans/config.h b/keyboards/redox/keymaps/ptillemans/config.h new file mode 100644 index 00000000000..a3ef209a05d --- /dev/null +++ b/keyboards/redox/keymaps/ptillemans/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2018 Mattia Dal Ben + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/redox/keymaps/ptillemans/keymap.c b/keyboards/redox/keymaps/ptillemans/keymap.c new file mode 100644 index 00000000000..3d9b90be5bd --- /dev/null +++ b/keyboards/redox/keymaps/ptillemans/keymap.c @@ -0,0 +1,97 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _SYMB 1 +#define _NAV 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SYMB, + NAV, + ADJUST, +}; + +// Shortcut to make keymap more readable +#define KC_BKSL KC_BSLASH +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTES LCTL_T(KC_ESC) + +#define KC_NAGR LT(_NAV, KC_GRV) +#define KC_NAMI LT(_NAV, KC_MINS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) + +#define KC_LBRS LT(_SYMB, KC_LBRC) +#define KC_RBRS LT(_SYMB, KC_RBRC) +#define KC_RSEN RSFT_T(KC_ENT) +#define KC_RCQU RCTL_T(KC_QUOT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_PSCR , KC_EQL ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_BKSL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CTES ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_RCQU , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSEN , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_LGUI ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_LGUI , KC_BSPC , KC_SPC , KC_SPC ,KC_ENT , KC_RALT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_HASH ,KC_DLR ,KC_LBRC ,KC_RBRC ,KC_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PERC ,KC_CIRC ,KC_LPRN ,KC_RPRN ,KC_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_NAV] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; diff --git a/keyboards/redox/keymaps/ptillemans/readme.md b/keyboards/redox/keymaps/ptillemans/readme.md new file mode 100644 index 00000000000..8fa8ddf5cea --- /dev/null +++ b/keyboards/redox/keymaps/ptillemans/readme.md @@ -0,0 +1 @@ +# The default keymap for Redox diff --git a/keyboards/redox/keymaps/ptillemans/rules.mk b/keyboards/redox/keymaps/ptillemans/rules.mk new file mode 100644 index 00000000000..a81250cdf6d --- /dev/null +++ b/keyboards/redox/keymaps/ptillemans/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes + diff --git a/keyboards/redox/rev1/config.h b/keyboards/redox/rev1/config.h index f4ccbd2fd52..72ca94b7914 100644 --- a/keyboards/redox/rev1/config.h +++ b/keyboards/redox/rev1/config.h @@ -47,18 +47,16 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 + +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 diff --git a/keyboards/redox/rules.mk b/keyboards/redox/rules.mk index 748d89dcfbd..81c0694e09a 100644 --- a/keyboards/redox/rules.mk +++ b/keyboards/redox/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -66,9 +65,7 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SPLIT_KEYBOARD = yes diff --git a/keyboards/redox_w/config.h b/keyboards/redox_w/config.h index 810a236d9a5..349185ed30a 100644 --- a/keyboards/redox_w/config.h +++ b/keyboards/redox_w/config.h @@ -39,12 +39,6 @@ #define ONESHOT_TIMEOUT 500 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/redox_w/info.json b/keyboards/redox_w/info.json index 5bc65b5d98d..b7694a2bbd5 100644 --- a/keyboards/redox_w/info.json +++ b/keyboards/redox_w/info.json @@ -6,7 +6,91 @@ "height": 6.25, "layouts": { "LAYOUT": { - "layout": [{"label":"[L2] `", "x":0, "y":0.375, "w":1.25}, {"label":"!", "x":1.25, "y":0.375}, {"label":"@", "x":2.25, "y":0.125}, {"label":"#", "x":3.25, "y":0}, {"label":"$", "x":4.25, "y":0.125}, {"label":"%", "x":5.25, "y":0.25}, {"label":"[L1]", "x":6.25, "y":0.75}, {"label":"[L1]", "x":11.25, "y":0.75}, {"label":"^", "x":12.25, "y":0.25}, {"label":"&", "x":13.25, "y":0.125}, {"label":"*", "x":14.25, "y":0}, {"label":"(", "x":15.25, "y":0.125}, {"label":")", "x":16.25, "y":0.375}, {"label":"[L2] -", "x":17.25, "y":0.375, "w":1.25}, {"label":"Tab", "x":0, "y":1.375, "w":1.25}, {"label":"Q", "x":1.25, "y":1.375}, {"label":"W", "x":2.25, "y":1.125}, {"label":"E", "x":3.25, "y":1}, {"label":"R", "x":4.25, "y":1.125}, {"label":"T", "x":5.25, "y":1.25}, {"label":"[", "x":6.25, "y":1.75, "h":1.5}, {"label":"]", "x":11.25, "y":1.75, "h":1.5}, {"label":"Y", "x":12.25, "y":1.25}, {"label":"U", "x":13.25, "y":1.125}, {"label":"I", "x":14.25, "y":1}, {"label":"O", "x":15.25, "y":1.125}, {"label":"P", "x":16.25, "y":1.375}, {"label":"=", "x":17.25, "y":1.375, "w":1.25}, {"label":"Esc", "x":0, "y":2.375, "w":1.25}, {"label":"A", "x":1.25, "y":2.375}, {"label":"S", "x":2.25, "y":2.125}, {"label":"D", "x":3.25, "y":2}, {"label":"F", "x":4.25, "y":2.125}, {"label":"G", "x":5.25, "y":2.25}, {"label":"PgUp", "x":6.75, "y":3.75}, {"label":"End", "x":10.75, "y":3.75}, {"label":"H", "x":12.25, "y":2.25}, {"label":"J", "x":13.25, "y":2.125}, {"label":"K", "x":14.25, "y":2}, {"label":"L", "x":15.25, "y":2.125}, {"label":":", "x":16.25, "y":2.375}, {"label":"'", "x":17.25, "y":2.375, "w":1.25}, {"label":"Shift", "x":0, "y":3.375, "w":1.25}, {"label":"Z", "x":1.25, "y":3.375}, {"label":"X", "x":2.25, "y":3.125}, {"label":"C", "x":3.25, "y":3}, {"label":"V", "x":4.25, "y":3.125}, {"label":"B", "x":5.25, "y":3.25}, {"label":"PgDn", "x":7.75, "y":3.75}, {"label":"Home", "x":9.75, "y":3.75}, {"label":"N", "x":12.25, "y":3.25}, {"label":"M", "x":13.25, "y":3.125}, {"label":"<", "x":14.25, "y":3}, {"label":">", "x":15.25, "y":3.125}, {"label":"?", "x":16.25, "y":3.375}, {"label":"Shift", "x":17.25, "y":3.375, "w":1.25}, {"label":"GUI", "x":0.25, "y":4.375}, {"label":"+", "x":1.25, "y":4.375}, {"label":"-", "x":2.25, "y":4.125}, {"label":"[Alt] *", "x":3.25, "y":4}, {"label":"[Ctrl] /", "x":5.5, "y":5.25, "w":1.25}, {"label":"Backspace", "x":6.75, "y":4.75, "h":1.5}, {"label":"Del", "x":7.75, "y":4.75, "h":1.5}, {"label":"Enter", "x":9.75, "y":4.75, "h":1.5}, {"label":"Space", "x":10.75, "y":4.75, "h":1.5}, {"label":"Alt", "x":11.75, "y":5.25, "w":1.25}, {"label":"Left", "x":14.25, "y":4}, {"label":"Down", "x":15.25, "y":4.125}, {"label":"Up", "x":16.25, "y":4.375}, {"label":"Right", "x":17.25, "y":4.375}] + "layout": [ + {"label":"_Nav || `", "x":0, "y":0.375, "w":1.25}, + {"label":"1", "x":1.25, "y":0.375}, + {"label":"2", "x":2.25, "y":0.125}, + {"label":"3", "x":3.25, "y":0}, + {"label":"4", "x":4.25, "y":0.125}, + {"label":"5", "x":5.25, "y":0.25}, + + {"label":"6", "x":12.25, "y":0.25}, + {"label":"7", "x":13.25, "y":0.125}, + {"label":"8", "x":14.25, "y":0}, + {"label":"9", "x":15.25, "y":0.125}, + {"label":"0", "x":16.25, "y":0.375}, + {"label":"_Nav || -", "x":17.25, "y":0.375, "w":1.25}, + + {"label":"Tab", "x":0, "y":1.375, "w":1.25}, + {"label":"Q", "x":1.25, "y":1.375}, + {"label":"W", "x":2.25, "y":1.125}, + {"label":"E", "x":3.25, "y":1}, + {"label":"R", "x":4.25, "y":1.125}, + {"label":"T", "x":5.25, "y":1.25}, + {"label":"MO(_SYMB)", "x":6.25, "y":0.75}, + + {"label":"MO(_SYMB)", "x":11.25, "y":0.75}, + {"label":"Y", "x":12.25, "y":1.25}, + {"label":"U", "x":13.25, "y":1.125}, + {"label":"I", "x":14.25, "y":1}, + {"label":"O", "x":15.25, "y":1.125}, + {"label":"P", "x":16.25, "y":1.375}, + {"label":"=", "x":17.25, "y":1.375, "w":1.25}, + + {"label":"Esc", "x":0, "y":2.375, "w":1.25}, + {"label":"A", "x":1.25, "y":2.375}, + {"label":"S", "x":2.25, "y":2.125}, + {"label":"D", "x":3.25, "y":2}, + {"label":"F", "x":4.25, "y":2.125}, + {"label":"G", "x":5.25, "y":2.25}, + {"label":"[", "x":6.25, "y":1.75, "h":1.5}, + + {"label":"]", "x":11.25, "y":1.75, "h":1.5}, + {"label":"H", "x":12.25, "y":2.25}, + {"label":"J", "x":13.25, "y":2.125}, + {"label":"K", "x":14.25, "y":2}, + {"label":"L", "x":15.25, "y":2.125}, + {"label":";", "x":16.25, "y":2.375}, + {"label":"'", "x":17.25, "y":2.375, "w":1.25}, + + {"label":"Shift", "x":0, "y":3.375, "w":1.25}, + {"label":"Z", "x":1.25, "y":3.375}, + {"label":"X", "x":2.25, "y":3.125}, + {"label":"C", "x":3.25, "y":3}, + {"label":"V", "x":4.25, "y":3.125}, + {"label":"B", "x":5.25, "y":3.25}, + + {"label":"_Adjust/Page Up", "x":6.75, "y":3.75}, + {"label":"Page Down", "x":7.75, "y":3.75}, + + {"label":"Home", "x":9.75, "y":3.75}, + {"label":"_Adjust/End", "x":10.75, "y":3.75}, + + {"label":"N", "x":12.25, "y":3.25}, + {"label":"M", "x":13.25, "y":3.125}, + {"label":",", "x":14.25, "y":3}, + {"label":",", "x":15.25, "y":3.125}, + {"label":"\\", "x":16.25, "y":3.375}, + {"label":"Shift", "x":17.25, "y":3.375, "w":1.25}, + + {"label":"LGUI", "x":0.25, "y":4.375}, + {"label":"P+", "x":1.25, "y":4.375}, + {"label":"P-", "x":2.25, "y":4.125}, + {"label":"LAlt || P*", "x":3.25, "y":4}, + + {"label":"LCtrl || P/", "x":5.5, "y":5.25, "w":1.25}, + {"label":"Backspace", "x":6.75, "y":4.75, "h":1.5}, + {"label":"Delete", "x":7.75, "y":4.75, "h":1.5}, + + {"label":"Enter", "x":9.75, "y":4.75, "h":1.5}, + {"label":"Space", "x":10.75, "y":4.75, "h":1.5}, + {"label":"RAlt", "x":11.75, "y":5.25, "w":1.25}, + + {"label":"Left", "x":14.25, "y":4}, + {"label":"Down", "x":15.25, "y":4.125}, + {"label":"Up", "x":16.25, "y":4.375}, + {"label":"Right", "x":17.25, "y":4.375} + ] } } } diff --git a/keyboards/redox_w/matrix.c b/keyboards/redox_w/matrix.c index 5e61103f201..31233af1018 100644 --- a/keyboards/redox_w/matrix.c +++ b/keyboards/redox_w/matrix.c @@ -1,15 +1,15 @@ /* Copyright 2017 Mattia Dal Ben - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -132,7 +132,7 @@ uint8_t matrix_scan(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER RedScarf +#define PRODUCT RedScarfII+ +#define DESCRIPTION QMK Firmware for the RedScarf II+ + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { } +#define MATRIX_COL_PINS { F4, F1, F0, B3, D0, D1, D4, D5, D6, D7, F7, F6, D2, D3, B6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/redscarf_iiplus/verb/info.json b/keyboards/redscarf_iiplus/verb/info.json new file mode 100644 index 00000000000..8466063fcf0 --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Red Scarf II+ Ver.B (RS78)", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 5, + "layouts": { + "LAYOUT_78_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2.25, "y":0}, {"x":3.25, "y":0}, {"x":4.25, "y":0}, {"x":5.25, "y":0}, {"x":6.25, "y":0}, {"x":7.25, "y":0}, {"x":8.25, "y":0}, {"x":9.25, "y":0}, {"x":10.25, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2.25, "y":1, "w":1.5}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":7.75, "y":1}, {"x":8.75, "y":1}, {"x":9.75, "y":1}, {"x":10.75, "y":1}, {"x":11.75, "y":1}, {"x":12.75, "y":1}, {"x":13.75, "y":1}, {"x":14.75, "y":1}, {"x":15.75, "y":1, "w":1.5}, {"x":17.25, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2.25, "y":2, "w":1.75}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":15, "y":2, "w":2.25}, {"x":17.25, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2.25, "y":3, "w":2.25}, {"x":4.5, "y":3}, {"x":5.5, "y":3}, {"x":6.5, "y":3}, {"x":7.5, "y":3}, {"x":8.5, "y":3}, {"x":9.5, "y":3}, {"x":10.5, "y":3}, {"x":11.5, "y":3}, {"x":12.5, "y":3}, {"x":13.5, "y":3}, {"x":14.5, "y":3, "w":1.75}, {"x":16.25, "y":3}, {"x":17.25, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2.25, "y":4, "w":1.25}, {"x":3.5, "y":4, "w":1.25}, {"x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"x":12.25, "y":4}, {"x":13.25, "y":4}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}, {"x":17.25, "y":4}] + }, + + "LAYOUT_78_iso": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2.25, "y":0}, {"x":3.25, "y":0}, {"x":4.25, "y":0}, {"x":5.25, "y":0}, {"x":6.25, "y":0}, {"x":7.25, "y":0}, {"x":8.25, "y":0}, {"x":9.25, "y":0}, {"x":10.25, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2.25, "y":1, "w":1.5}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":7.75, "y":1}, {"x":8.75, "y":1}, {"x":9.75, "y":1}, {"x":10.75, "y":1}, {"x":11.75, "y":1}, {"x":12.75, "y":1}, {"x":13.75, "y":1}, {"x":14.75, "y":1}, {"x":16, "y":1, "w":1.25, "h":2}, {"x":17.25, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2.25, "y":2, "w":1.75}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":15, "y":2}, {"x":17.25, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2.25, "y":3, "w":1.25}, {"x":3.5, "y":3}, {"x":4.5, "y":3}, {"x":5.5, "y":3}, {"x":6.5, "y":3}, {"x":7.5, "y":3}, {"x":8.5, "y":3}, {"x":9.5, "y":3}, {"x":10.5, "y":3}, {"x":11.5, "y":3}, {"x":12.5, "y":3}, {"x":13.5, "y":3}, {"x":14.5, "y":3, "w":1.75}, {"x":16.25, "y":3}, {"x":17.25, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2.25, "y":4, "w":1.25}, {"x":3.5, "y":4, "w":1.25}, {"x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"x":12.25, "y":4}, {"x":13.25, "y":4}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}, {"x":17.25, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/redscarf_iiplus/verb/keymaps/default/keymap.c b/keyboards/redscarf_iiplus/verb/keymaps/default/keymap.c new file mode 100755 index 00000000000..eea39a33b1b --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/keymaps/default/keymap.c @@ -0,0 +1,27 @@ +/* Copyright 2019 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_78_ansi( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, KC_INS, + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_F9, RESET, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT + ) +}; diff --git a/keyboards/redscarf_iiplus/verb/keymaps/default/readme.md b/keyboards/redscarf_iiplus/verb/keymaps/default/readme.md new file mode 100755 index 00000000000..b7324c5180c --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for the Red Scarf II+ ver B. \ No newline at end of file diff --git a/keyboards/redscarf_iiplus/verb/matrix.c b/keyboards/redscarf_iiplus/verb/matrix.c new file mode 100755 index 00000000000..54b0f3a9a10 --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/matrix.c @@ -0,0 +1,391 @@ +/* +Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#ifdef DIRECT_PINS +static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; +#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +// static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values +static matrix_row_t matrix[MATRIX_ROWS]; //debounced values + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +//Deprecated. +bool matrix_is_modified(void) +{ + if (debounce_active()) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "verb.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); + led_init_ports(); +} + +void led_init_ports(void) { + setPinOutput(C7); + setPinOutput(E6); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(C7); + } else { + writePinHigh(C7); + } + + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + + led_set_user(usb_led); +} diff --git a/keyboards/redscarf_iiplus/verb/verb.h b/keyboards/redscarf_iiplus/verb/verb.h new file mode 100755 index 00000000000..d86a6c4c61e --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/verb.h @@ -0,0 +1,59 @@ +/* Copyright 2019 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define XXX KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_78_ansi( \ + K51, K52, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2C, K0E, \ + K53, K54, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K55, K56, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K57, K58, K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K59, K5A, K40, K41, K42, K49, K4A, K4B, K47, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, K49, K4A, K4B, K4C, K4D, K4E }, \ + { XXX, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, XXX, XXX, XXX, XXX } \ +} +#define LAYOUT_78_iso( \ + K51, K52, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2C, K0E, \ + K53, K54, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K55, K56, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2D, K2E, \ + K57, K58, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K59, K5A, K40, K41, K42, K49, K4A, K4B, K47, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, K49, K4A, K4B, K4C, K4D, K4E }, \ + { XXX, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, XXX, XXX, XXX, XXX } \ +} diff --git a/keyboards/redscarf_iiplus/verc/config.h b/keyboards/redscarf_iiplus/verc/config.h new file mode 100755 index 00000000000..3fecdcac3bc --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/config.h @@ -0,0 +1,252 @@ +/* +Copyright 2019 Maarten Dekkers + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER RedScarf +#define PRODUCT RedScarfII+ +#define DESCRIPTION QMK Firmware for the RedScarf II+ + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { } +#define MATRIX_COL_PINS { F4, F1, F0, B3, D0, D1, D4, D5, D6, D7, F7, F6, D2, D3, B6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/redscarf_iiplus/verc/info.json b/keyboards/redscarf_iiplus/verc/info.json new file mode 100644 index 00000000000..210b399ba76 --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Red Scarf II+ Ver.C (RS68)", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_65_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + }, + + "LAYOUT_65_iso": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.75, "y":1, "w":1.25, "h":2}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/redscarf_iiplus/verc/keymaps/default/keymap.c b/keyboards/redscarf_iiplus/verc/keymaps/default/keymap.c new file mode 100755 index 00000000000..aad19132882 --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/keymaps/default/keymap.c @@ -0,0 +1,35 @@ +/* Copyright 2019 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_65_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT + ), + + [1] = LAYOUT_65_ansi( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/redscarf_iiplus/verc/keymaps/default/readme.md b/keyboards/redscarf_iiplus/verc/keymaps/default/readme.md new file mode 100755 index 00000000000..c792f1d1204 --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for the Red Scarf II+ ver C \ No newline at end of file diff --git a/keyboards/redscarf_iiplus/verc/matrix.c b/keyboards/redscarf_iiplus/verc/matrix.c new file mode 100755 index 00000000000..54b0f3a9a10 --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/matrix.c @@ -0,0 +1,391 @@ +/* +Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#ifdef DIRECT_PINS +static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; +#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +// static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values +static matrix_row_t matrix[MATRIX_ROWS]; //debounced values + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +//Deprecated. +bool matrix_is_modified(void) +{ + if (debounce_active()) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "verc.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); + led_init_ports(); +} + +void led_init_ports(void) { + setPinOutput(C7); + setPinOutput(E6); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(C7); + } else { + writePinHigh(C7); + } + + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + + led_set_user(usb_led); +} diff --git a/keyboards/redscarf_iiplus/verc/verc.h b/keyboards/redscarf_iiplus/verc/verc.h new file mode 100755 index 00000000000..6da76134dfc --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/verc.h @@ -0,0 +1,61 @@ +/* Copyright 2019 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define XXX KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_65_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K49, K4A, K4B, K47, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, K49, K4A, K4B, K4C, K4D, K4E }, \ + { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX } \ +} + +#define LAYOUT_65_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K49, K4A, K4B, K47, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, K49, K4A, K4B, K4C, K4D, K4E }, \ + { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX } \ +} + diff --git a/keyboards/rgbkb/sol/common/glcdfont.c b/keyboards/rgbkb/sol/common/glcdfont.c new file mode 100644 index 00000000000..61b40c092ef --- /dev/null +++ b/keyboards/rgbkb/sol/common/glcdfont.c @@ -0,0 +1,240 @@ +#pragma once + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Helidox 8x6 font with RGBKB SOL Logo +// Online editor: http://teripom.x0.com/ + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x0C, 0x90, + 0xB0, 0xE0, 0x72, 0x31, 0x9B, 0xDE, + 0xCE, 0xEC, 0xEE, 0xE9, 0xE9, 0xEC, + 0xCF, 0xDA, 0x99, 0x3E, 0x62, 0xE4, + 0xC4, 0x70, 0x10, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, + 0xC0, 0xC0, 0x80, 0x80, 0x02, 0x85, + 0x85, 0x87, 0x85, 0x89, 0x89, 0x92, + 0xEA, 0xC6, 0xC4, 0x48, 0x50, 0x60, + 0x40, 0x40, 0x40, 0x40, 0xC0, 0xE0, + 0x50, 0x28, 0x10, 0x10, 0x60, 0xC0, + 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, + 0x80, 0x80, 0x80, 0xE0, 0xF8, 0xFC, + 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0x00, 0x00, 0xF0, 0xF4, 0xEC, 0xDE, + 0xDE, 0xBE, 0x3E, 0x3E, 0x3F, 0x3F, + 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x3F, + 0x3F, 0x3E, 0x3E, 0xBE, 0xDE, 0xDE, + 0xEC, 0xF4, 0xF0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7F, 0x80, 0x80, + 0x80, 0x70, 0x0F, 0x00, 0x00, 0x80, + 0x7F, 0x00, 0x00, 0x7F, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x7F, + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x21, 0x33, 0x3B, 0x7B, + 0xFF, 0x00, 0x7C, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0x01, + 0xFF, 0xDE, 0x8C, 0x04, 0x0C, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x01, 0x7F, 0x80, + 0x80, 0xBE, 0xBE, 0x80, 0x80, 0x80, + 0xC1, 0xFF, 0x80, 0x04, 0x32, 0x5E, + 0x1C, 0x3D, 0x26, 0x10, 0xC1, 0xFF, + 0x3E, 0x00, 0x00, 0x08, 0x36, 0xC1, + 0x08, 0x08, 0x14, 0x77, 0x94, 0x94, + 0x94, 0xF7, 0x94, 0xF7, 0x9C, 0x9C, + 0xFF, 0xFF, 0x1E, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x00, 0x00, 0x01, 0x0F, 0x3F, 0xFF, + 0xFF, 0xFF, 0xFC, 0xE0, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xE0, 0xFC, 0xFF, 0xFF, 0xFF, + 0x3F, 0x0F, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x02, 0x06, + 0x4D, 0x4F, 0x8C, 0xF9, 0x73, 0x37, + 0x27, 0x2F, 0x2F, 0xAF, 0xEF, 0x6F, + 0x77, 0x17, 0x33, 0x79, 0xCC, 0x1F, + 0x31, 0x20, 0x21, 0x02, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0xE0, + 0xA0, 0xA0, 0xD0, 0x90, 0x48, 0x48, + 0x25, 0x2B, 0x11, 0x09, 0x05, 0x03, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x03, 0x02, 0x04, 0x03, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, + 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, + 0xFE, 0xFC, 0x00, 0xFC, 0xFE, 0x7F, + 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/rgbkb/sol/config.h b/keyboards/rgbkb/sol/config.h new file mode 100644 index 00000000000..9b136db0584 --- /dev/null +++ b/keyboards/rgbkb/sol/config.h @@ -0,0 +1,84 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define TAPPING_TERM 150 + +/* Select hand configuration */ +#define SOFT_SERIAL_PIN D3 +#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_ROW_PINS { C6, B6, B5, B4, D7, E6} + +// wiring of each half +#define MATRIX_COLS 7 +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 } + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +#ifdef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 40 +#elif RGBLIGHT_FULL_POWER + #define RGBLIGHT_LIMIT_VAL 255 +#else + #define RGBLIGHT_LIMIT_VAL 120 +#endif +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS RGBLIGHT_LIMIT_VAL + +#define LED_HITS_TO_REMEMBER 5 + +#define RGBLIGHT_ANIMATIONS + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for Helix keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 500 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/rgbkb/sol/keymaps/brianweyer/config.h b/keyboards/rgbkb/sol/keymaps/brianweyer/config.h new file mode 100644 index 00000000000..452cdda8235 --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/brianweyer/config.h @@ -0,0 +1,25 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + + +// place overrides here + diff --git a/keyboards/rgbkb/sol/keymaps/brianweyer/keymap.c b/keyboards/rgbkb/sol/keymaps/brianweyer/keymap.c new file mode 100644 index 00000000000..3ba52081d25 --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/brianweyer/keymap.c @@ -0,0 +1,269 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _FN, + _ADJ +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + FN, + ADJ, + RGBRST +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* QWERTY + * ,------------------------------------------------. ,------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Bspc | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | | | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Alt | FN | LGui | RGB | Spc | Del | | Bspc | Spc | Adj | LGui | FN | Alt | Ctrl | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Spc | Ent | | Ent | Spc | + * `-------------' `-------------' + */ + [_QWERTY] = LAYOUT_kc( \ + //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+ + GRV, 1, 2, 3, 4, 5, MINS, EQL, 6, 7, 8, 9, 0, BSPC, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + TAB, Q, W, E, R, T, LBRC, RBRC, Y, U, I, O, P, BSLS, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + ESC, A, S, D, F, G, _______, _______, H, J, K, L, SCLN, QUOT, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + LSPO, Z, X, C, V, B, _______, _______, N, M, COMM, DOT, SLSH, RSPC, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + LCTL, LALT, FN, LGUI, RGB_MOD, SPC, DEL, BSPC, SPC, ADJ, LGUI, FN, LALT, LCTL, + //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------| + SPC, ENT, ENT, SPC + // |--------+--------| |--------+-----------+ + ), + + /* FN + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | | | Up | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | | Left | Down | Right| | | | | Play | Next | Mute | V-Up |V-Down| | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | + * `-------------' `-------------' + */ + [_FN] = LAYOUT_kc( \ + //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+ + F1, F2, F3, F4, F5, F6, _______, _______, F7, F8, F9, F10, F11, F12, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, LEFT, DOWN, RGHT, _______, _______, _______, MPLY, MNXT, MUTE, VOLD, VOLU, _______, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______ + // |--------+--------| |--------+-----------+ + ), + + /* ADJ + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Sat+ | Val+ | Hue+ |Speed+|Toggle| | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Sat- | Val- | Hue- |Speed-|Reset | | | | |QWERTY| COLE | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | + * `-------------' `-------------' + */ + + [_ADJ] = LAYOUT( \ + //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+ + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, RGB_SAI, RGB_VAI, RGB_HUI, RGB_SPI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, RGB_SAD, RGB_VAD, RGB_HUD, RGB_SPD, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--------+--+--------+--------+--------+--------+--------| + _______, _______, _______, _______ \ + // |--------+--------| |--------+--------+ + ) +}; + + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder*/ + if (clockwise) { + tap_code(KC_UP); + } else { + tap_code(KC_DOWN); + } + } +} +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case FN: + if (record->event.pressed) { + layer_on(_FN); + } else { + layer_off(_FN); + } + return false; + break; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { +#ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; +#endif +} + + +// OLED Driver Logic +#ifdef OLED_DRIVER_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) + return OLED_ROTATION_180; // flip 180 for offhand + return rotation; +} + +static void render_logo(void) { + static const char PROGMEM sol_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + + oled_write_P(sol_logo, false); +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_FN (1<<_FN) +#define L_ADJ (1<<_ADJ) +#define L_ADJ_TRI (L_ADJ|L_FN) + +static void render_status(void) { + // Render to mode icon + static const char PROGMEM mode_logo[4][4] = { + {0x95,0x96,0x0a,0}, + {0xb5,0xb6,0x0a,0}, + {0x97,0x98,0x0a,0}, + {0xb7,0xb8,0x0a,0} }; + + if (keymap_config.swap_lalt_lgui != false) { + oled_write_P(mode_logo[0], false); + oled_write_P(mode_logo[1], false); + } else { + oled_write_P(mode_logo[2], false); + oled_write_P(mode_logo[3], false); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + + oled_write_P(PSTR("Layer: "), false); + switch (layer_state) { + case L_BASE: + oled_write_P(PSTR("Laser \n"), false); + break; + case L_FN: + oled_write_P(PSTR("Function \n"), false); + break; + case L_ADJ: + case L_ADJ_TRI: + oled_write_P(PSTR("Adjustment\n"), false); + break; + default: + oled_write_P(PSTR("Undefined \n"), false); + } + + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(led_usb_state & (1< +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + + +// place overrides here + diff --git a/keyboards/rgbkb/sol/keymaps/danielhklein/keymap.c b/keyboards/rgbkb/sol/keymaps/danielhklein/keymap.c new file mode 100644 index 00000000000..860361e810b --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/danielhklein/keymap.c @@ -0,0 +1,333 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _FN, + _ADJ +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + FN, + ADJ, + BACKLIT, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns + /* Base Layout + * ,------------------------------------------------. ,------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | | | | | | [ | | ] | | | | | | Enter| + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Caps | | | | | | { | | } | | | | | | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | | | | | | ` | | \ | | | | | |Shift | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Left | Down | Ctrl | Alt | Gui | Bspc | FN | | ADJ | Space| Gui | Alt | Ctrl | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Bspc | FN | | ADJ | Space| + * `-------------' `-------------' + */ +#define BASE_LAYOUT( \ + _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \ + _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, _29 \ +) \ +LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, _00, _01, _02, _03, _04, KC_LBRC, KC_RBRC, _05, _06, _07, _08, _09, KC_ENT, \ + KC_CAPS, _10, _11, _12, _13, _14, KC_LCBR, KC_RCBR, _15, _16, _17, _18, _19, KC_QUOT, \ + KC_LSFT, _20, _21, _22, _23, _24, KC_GRV, KC_BSLS, _25, _26, _27, _28, _29, KC_RSFT, \ + KC_LEFT, KC_DOWN, KC_LCTRL, KC_LALT, KC_LGUI, KC_BSPC, FN, ADJ, KC_SPC, KC_RGUI, KC_RALT, KC_RCTRL, KC_UP, KC_RIGHT, \ + KC_BSPC, FN, ADJ, KC_SPC \ +) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | E | R | T | | | | Y | U | I | O | P | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | S | D | F | G | | | | H | J | K | L | ; | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | V | B | | | | N | M | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + [_QWERTY] = BASE_LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH \ + ), + + /* Colemak + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | F | P | G | | | | J | L | U | Y | ; | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | R | S | T | D | | | | H | N | E | I | O | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | V | B | | | | K | M | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `--------=----' + */ + [_COLEMAK] = BASE_LAYOUT( \ + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, \ + KC_A, KC_R, KC_S, KC_T, KC_G, KC_K, KC_N, KC_E, KC_I, KC_O, \ + KC_Z, KC_X, KC_C, KC_D, KC_V, KC_M, KC_H, KC_COMM, KC_DOT, KC_SLSH \ + ), + + + /* FN + * ,------------------------------------------------. ,------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | | | | | | | | | | PGDN | UP | PGUP | PRINT| HOME | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | | | | | | | | | | LEFT | DOWN | RIGHT|INSERT| END | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | | | | | | | | | PLAY | MUTE | VOL- | VOL+ | LAST | NEXT | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | Gui | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + [_FN] = LAYOUT( \ + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, KC_UP, KC_PGUP, KC_PSCR, KC_HOME, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, _______, XXXXXXX, XXXXXXX \ + ), + + /* ADJ + * ,------------------------------------------------. ,------------------------------------------------. + * |RESET | F1 | F2 | F3 | F4 | F5 | F6 | | | = | / | * | - | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | 7 | 8 | 9 | + | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | HUI | VAI | SAI | | |COLEMK| | | 4 | 5 | 6 | Enter| | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | HUD | VAD | SAD | | |QWERTY| | | 1 | 2 | 3 | Space| | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | |RGBRST|RGBTOG|RGBMOD|RGBSMD| | | | | | 0 | . | Bspc | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + + [_ADJ] = LAYOUT( \ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_PEQL, KC_PSLS, KC_PAST, KC_PMNS, XXXXXXX, XXXXXXX, \ + XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PPLS, XXXXXXX, XXXXXXX, \ + XXXXXXX, RGB_SAD, RGB_VAI, RGB_SAI, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PENT, XXXXXXX, XXXXXXX, \ + XXXXXXX, RGB_HUD, RGB_VAD, RGB_HUI, XXXXXXX, XXXXXXX, QWERTY, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_SPC, XXXXXXX, XXXXXXX, \ + XXXXXXX, RGBRST, RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_P0, KC_PDOT, KC_BSPC, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, _______, XXXXXXX \ + ) +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder*/ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } +} +#endif + +// Setting ADJ layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if(record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case FN: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(15); + #endif + } + layer_on(_FN); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_FN); + TOG_STATUS = false; + } + return false; + break; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { +#ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; +#endif +} + + +// OLED Driver Logic +#ifdef OLED_DRIVER_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!has_usb()) + return OLED_ROTATION_180; // flip 180 for offhand + return rotation; +} + +static void render_logo(void) { + static const char PROGMEM sol_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + + oled_write_P(sol_logo, false); +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_FN (1<<_FN) +#define L_ADJ (1<<_ADJ) +#define L_ADJ_TRI (L_ADJ|L_FN) + +static void render_status(void) { + // Render to mode icon + static const char PROGMEM mode_logo[4][4] = { + {0x95,0x96,0x0a,0}, + {0xb5,0xb6,0x0a,0}, + {0x97,0x98,0x0a,0}, + {0xb7,0xb8,0x0a,0} }; + + if (keymap_config.swap_lalt_lgui != false) { + oled_write_P(mode_logo[0], false); + oled_write_P(mode_logo[1], false); + } else { + oled_write_P(mode_logo[2], false); + oled_write_P(mode_logo[3], false); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + oled_write_P(PSTR("Layer: "), false); + switch (layer_state) { + case L_BASE: + oled_write_P(PSTR("Default\n"), false); + break; + case L_FN: + oled_write_P(PSTR("FN \n"), false); + break; + case L_ADJ: + case L_ADJ_TRI: + oled_write_P(PSTR("ADJ \n"), false); + break; + default: + oled_write_P(PSTR("UNDEF \n"), false); + } + + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(led_usb_state & (1< +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + + +// place overrides here + diff --git a/keyboards/rgbkb/sol/keymaps/default/keymap.c b/keyboards/rgbkb/sol/keymaps/default/keymap.c new file mode 100644 index 00000000000..1fae6cc971a --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/default/keymap.c @@ -0,0 +1,371 @@ +#include QMK_KEYBOARD_H + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _FN, + _ADJ +}; + +// Keycode defines for layers +#define QWERTY DF(_QWERTY) +#define COLEMAK DF(_COLEMAK) +#define FN MO(_FN) +#define ADJ MO(_ADJ) + +enum custom_keycodes { + RGBRST = SAFE_RANGE, + RGB_MENU +}; + +#define FN_ESC LT(_FN, KC_ESC) +#define FN_CAPS LT(_FN, KC_CAPS) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,------------------------------------------------. ,------------------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * |FN(CAPS)| A | S | D | F | G | ( | | ) | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | { | | } | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| DEL | | Enter| Space| FN | Left | Down | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Space| DEL | | Enter| Space| + * `-------------' `-------------' + */ + [_QWERTY] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LPRN, KC_RPRN, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_DEL, KC_ENT, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, \ + KC_SPC, KC_DEL, KC_ENT, KC_SPC \ + ), + + /* Colemak + * ,------------------------------------------------. ,------------------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | Q | W | F | P | B | [ | | ] | J | L | U | Y | ; | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * |FN(CAPS)| A | R | S | T | G | ( | | ) | K | N | E | I | O | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | Z | X | C | D | V | { | | } | M | H | , | . | / |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| DEL | | Enter| Space| FN | Left | Down | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Space| DEL | | Enter| Space| + * `-------------' `-------------' + */ + [_COLEMAK] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LBRC, KC_RBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, \ + FN_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_LPRN, KC_RPRN, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_DEL, KC_ENT, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, \ + KC_SPC, KC_DEL, KC_ENT, KC_SPC \ + ), + + /* FN + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | PGDN | UP | PGUP | | | | | | | PGDN | UP | PGUP | PRINT| HOME | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | | | | | LEFT | DOWN | RIGHT|INSERT| END | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |RGBMOD| | | | | | | PLAY | NEXT | MUTE | VOL- | VOL+ | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + [_FN] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, KC_PGDN, KC_UP, KC_PGUP, _______, _______, _______, KC_SLCK, _______, KC_PGDN, KC_UP, KC_PGUP, KC_PSCR, KC_HOME, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_NLCK, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, \ + _______, _______, _______, _______ \ + ), + + /* ADJ + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | SAD | VAI | SAI | RESET| | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | HUD | VAD | HUI |RGBRST| | | | | |QWERTY|COLEMK| | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | |RGBTOG| HUI | SAI | VAI | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |RGBMOD(| | | | | | | |RGBRMOD| HUD | SAD | VAD | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + + [_ADJ] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, \ + _______, RGB_SPD, _______, RGB_SPI, _______, _______, _______, _______, _______, RGB_SPI, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, RGB_SPD, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, \ + _______, _______, _______, _______ \ + ) +}; + +// For RGBRST Keycode +#if defined(RGB_MATRIX_ENABLE) +void rgb_matrix_increase_flags(void) +{ + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } +} + +void rgb_matrix_decrease_flags(void) +{ + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_enable_noeeprom(); + } + break; + } +} +#endif + +#ifdef RGB_OLED_MENU +uint8_t rgb_encoder_state = 4; + +typedef void (*rgb_matrix_f)(void); + +const rgb_matrix_f rgb_matrix_functions[6][2] = { + { rgb_matrix_increase_hue, rgb_matrix_decrease_hue }, + { rgb_matrix_increase_sat, rgb_matrix_decrease_sat }, + { rgb_matrix_increase_val, rgb_matrix_decrease_val }, + { rgb_matrix_increase_speed, rgb_matrix_decrease_speed }, + { rgb_matrix_step, rgb_matrix_step_reverse }, + { rgb_matrix_increase_flags, rgb_matrix_decrease_flags } +}; +#endif + +#ifdef ENCODER_ENABLE + +static pin_t encoders_pad_a[] = ENCODERS_PAD_A; +#define NUMBER_OF_ENCODERS (sizeof(encoders_pad_a)/sizeof(pin_t)) + +const uint16_t PROGMEM encoders[][NUMBER_OF_ENCODERS * 2][2] = { + [_QWERTY] = ENCODER_LAYOUT( \ + KC_VOLU, KC_VOLD, + KC_VOLU, KC_VOLD + ), + [_COLEMAK] = ENCODER_LAYOUT( \ + _______, _______, + _______, _______ + ), + [_FN] = ENCODER_LAYOUT( \ + _______, _______, + _______, _______ + ), + [_ADJ] = ENCODER_LAYOUT( \ + _______, _______, + _______, _______ + ) +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (!is_keyboard_master()) + return; + +#ifdef RGB_OLED_MENU + if (index == RGB_OLED_MENU) { + (*rgb_matrix_functions[rgb_encoder_state][clockwise])(); + } else +#endif + { + uint8_t layer = biton32(layer_state); + uint16_t keycode = encoders[layer][index][clockwise]; + while (keycode == KC_TRANSPARENT && layer > 0) + { + layer--; + if ((layer_state & (1 << layer)) != 0) + keycode = encoders[layer][index][clockwise]; + } + if (keycode != KC_TRANSPARENT) + tap_code16(keycode); + } +} +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t reset_timer; + switch (keycode) { + case RGBRST: +#if defined(RGBLIGHT_ENABLE) + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } +#elif defined(RGB_MATRIX_ENABLE) + if (record->event.pressed) { + eeconfig_update_rgb_matrix_default(); + } +#endif + return false; + case RESET: + if (record->event.pressed) { + reset_timer = timer_read(); + } else { + if (timer_elapsed(reset_timer) >= 500) { + reset_keyboard(); + } + } + return false; +#if defined(RGB_MATRIX_ENABLE) && defined(KEYBOARD_rgbkb_sol_rev2) + case RGB_TOG: + if (record->event.pressed) { + rgb_matrix_increase_flags(); + } + return false; +#endif + case RGB_MENU: +#ifdef RGB_OLED_MENU + if (record->event.pressed) { + if (get_mods() & MOD_MASK_SHIFT) { + rgb_encoder_state = (rgb_encoder_state - 1); + if (rgb_encoder_state > 5) { + rgb_encoder_state = 5; + } + } else { + rgb_encoder_state = (rgb_encoder_state + 1) % 6; + } + } +#endif + return false; + } + return true; +} + +// OLED Driver Logic +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_keyboard_master()) + return OLED_ROTATION_90; + return rotation; +} + +static void render_logo(void) { + static const char PROGMEM sol_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0 + }; + oled_write_P(sol_logo, false); +} + +static void render_status(void) { + // Render to mode icon + static const char PROGMEM sol_icon[] = { + 0x9b,0x9c,0x9d,0x9e,0x9f, + 0xbb,0xbc,0xbd,0xbe,0xbf, + 0xdb,0xdc,0xdd,0xde,0xdf,0 + }; + oled_write_P(sol_icon, false); + + // Define layers here + oled_write_P(PSTR("Layer"), false); + uint8_t layer = layer_state ? biton(layer_state) : biton32(default_layer_state); + switch (layer) { + case _QWERTY: + oled_write_P(PSTR("BASE "), false); + break; + case _COLEMAK: + oled_write_P(PSTR("CLMK "), false); + break; + case _FN: + oled_write_P(PSTR("FN "), false); + break; + case _ADJ: + oled_write_P(PSTR("ADJ "), false); + break; + default: + oled_write_P(PSTR("UNDEF"), false); + } + + // Host Keyboard LED Status + uint8_t led_state = host_keyboard_leds(); + oled_write_P(PSTR("-----"), false); + oled_write_P(IS_LED_ON(led_state, USB_LED_NUM_LOCK) ? PSTR("NUMLK") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLK") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLK") : PSTR(" "), false); + +#ifdef RGB_OLED_MENU + static char buffer[31] = { 0 }; + snprintf(buffer, sizeof(buffer), "h%3d s%3d v%3d s%3d m%3d e%3d ", rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, rgb_matrix_config.speed, rgb_matrix_config.mode, rgb_matrix_get_flags()); + buffer[4 + rgb_encoder_state * 5] = '<'; + + oled_write_P(PSTR("-----"), false); + oled_write(buffer, false); +#endif +} + +void oled_task_user(void) { + if (is_keyboard_master()) { + render_status(); + } else { + render_logo(); + oled_scroll_left(); + } +} + +#endif diff --git a/keyboards/rgbkb/sol/keymaps/default/readme.md b/keyboards/rgbkb/sol/keymaps/default/readme.md new file mode 100644 index 00000000000..4a97a7babef --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/default/readme.md @@ -0,0 +1,115 @@ +# The Default Sol Layout +## Layout + +### Qwerty layout +``` + * ,------------------------------------------------. ,------------------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * |FN(CAPS)| A | S | D | F | G | ( | | ) | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | { | | } | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| DEL | | Enter| Space| FN | Left | Down | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Space| DEL | | Enter| Space| + * `-------------' `-------------' +``` + +### Colemak layout +``` + * ,------------------------------------------------. ,------------------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | Q | W | F | P | B | [ | | ] | J | L | U | Y | ; | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * |FN(CAPS)| A | R | S | T | G | ( | | ) | K | N | E | I | O | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | Z | X | C | D | V | { | | } | M | H | , | . | / |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| DEL | | Enter| Space| FN | Left | Down | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Space| DEL | | Enter| Space| + * `-------------' `-------------' +``` + +### Function (FN) +``` + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | PGDN | UP | PGUP | | | | | | | PGDN | UP | PGUP | PRINT| HOME | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | | | | | LEFT | DOWN | RIGHT|INSERT| END | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |RGBMOD| | | | | | | PLAY | NEXT | MUTE | VOL- | VOL+ | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' +``` + +### Adjust (ADJ) +``` + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | SAD | VAI | SAI | RESET| | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | HUD | VAD | HUI |RGBRST| | | | | |QWERTY|COLEMK| | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | |RGBTOG| HUI | SAI | VAI | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |RGBMOD| | | | | | | |RGBSMOD| HUD | SAD | VAD | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' +``` + +## Customize + +see `qmk_firmware/keyboards/sol/rev1/keymaps/default/rules.mk` + +``` + +# Variables you can set for SOL + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable global lighting effects. Do not enable with RGB Matrix +RGBLIGHT_ANIMATIONS = yes # LED animations +LED_MIRRORED = yes # Mirror LEDs across halves (enable DIP 1 on slave, and DIP 2 and 3 on master) +RGB_MATRIX_ENABLE = no # Enable per-key coordinate based RGB effects. Do not enable with RGBlight (+8500) +RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy (+1500) +RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port +UNICODE_ENABLE = no # Unicode +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +OLED_DRIVER_ENABLE = no # Enable the OLED Driver (+5000) +IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) + + +``` +## Compile + +go to qmk top directory. +``` +$ cd qmk_firmware +``` + +build +``` +$ make rgbkb/sol:default +``` + +After the initial flash with AVRdudess, you should be able to flash using this: +``` +$ make rgbkb/sol:default:dfu +``` diff --git a/keyboards/rgbkb/sol/keymaps/default/rules.mk b/keyboards/rgbkb/sol/keymaps/default/rules.mk new file mode 100644 index 00000000000..203d59c6a78 --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/default/rules.mk @@ -0,0 +1,16 @@ +# Default keymap does not have any overridden options from the rev1 / rev2 rules.mk files. +# Example: +# if you wanted to disable EXTRAKEY_ENABLE, you would copy the line from the rev1/rules.mk file +# and paste it in to this file, changing the yes to no. Like so: +# EXTRAKEY_ENABLE = no # Audio control and System control(+450) +# +# To keep things clean and tidy, as well as make upgrades easier, only place overrides from the defaults in this file. + + + + + +# Do not edit past here + +include keyboards/$(KEYBOARD)/post_rules.mk + diff --git a/keyboards/rgbkb/sol/keymaps/kageurufu/keymap.c b/keyboards/rgbkb/sol/keymaps/kageurufu/keymap.c new file mode 100644 index 00000000000..b587ef2b3d6 --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/kageurufu/keymap.c @@ -0,0 +1,97 @@ +#include QMK_KEYBOARD_H +#include "kageurufu.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +extern keymap_config_t keymap_config; +extern uint8_t is_master; + +/* Base Layout + * ,------------------------------------------------. ,------------------------------------------------. + * | ` | | | | | | | | | | | | | | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | | | | | | | | | | | | | | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Esc | | | | | | | | | | | | | | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Sft( | | | | | | | | | | | | | | Sft) | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Win | Alt | FN | Space| RGB | | FN | FN | - | = | Down | PgUp | PgDn | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Space| Bksp | | Enter| Space| + * `-------------' `--------=----' + */ +#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__) +#define _BASE_LAYOUT( \ + _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \ + _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, _29 \ +) \ +EXPAND_LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, RGB_MOD, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, _00, _01, _02, _03, _04, KC_LBRC, KC_RBRC, _05, _06, _07, _08, _09, KC_BSLS, \ + FN_ESC, _10, _11, _12, _13, _14, RGB_SAI, RGB_VAI, _15, _16, _17, _18, _19, KC_QUOT, \ + KC_LSPO, _20, _21, _22, _23, _24, RGB_SAD, RGB_VAD, _25, _26, _27, _28, _29, KC_RSPC, \ + KC_LCTL, KC_LGUI, KC_LGUI, KC_LALT, FN, KC_SPC, FN, FN, KC_SPC, KC_MINS, KC_EQL, KC_DOWN, KC_PGUP, KC_PGDN, \ + KC_SPC, KC_BSPC, KC_ENT, KC_SPC \ +) +#define BASE_LAYOUT(...) _BASE_LAYOUT(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = BASE_LAYOUT( \ + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, \ + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, \ + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ \ + ), + + [_COLEMAK] = BASE_LAYOUT( \ + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, \ + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, \ + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ \ + ), + + [_COLEMAK_DH] = BASE_LAYOUT( \ + ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, \ + ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, \ + ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________ \ + ), + + [_FN] = EXPAND_LAYOUT( \ + ________________FUNCTION_L1________________, _______, KC_PSCR, ________________FUNCTION_R1________________, \ + ________________FUNCTION_L2________________, _______, _______, ________________FUNCTION_R2________________, \ + ________________FUNCTION_L3________________, _______, _______, ________________FUNCTION_R3________________, \ + ________________FUNCTION_L4________________, _______, _______, ________________FUNCTION_R4________________, \ + ________________FUNCTION_L5________________, ADJ, ADJ, ________________FUNCTION_R5________________, \ + _______, KC_DEL, _______, _______ \ + ), + + [_ADJ] = EXPAND_LAYOUT( \ + _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, \ + _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, \ + _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, \ + _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, \ + _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________, \ + _______, _______, _______, _______ \ + ) +}; + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder*/ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } +} +#endif diff --git a/keyboards/rgbkb/sol/keymaps/kageurufu/rules.mk b/keyboards/rgbkb/sol/keymaps/kageurufu/rules.mk new file mode 100644 index 00000000000..056959a550d --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/kageurufu/rules.mk @@ -0,0 +1,21 @@ +# Overridden build options from rev1 & rev2 + +# Debug Options +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration + +# RGB Options +RGBLIGHT_ENABLE = no # Enable global lighting effects. Do not enable with RGB Matrix +RGBLIGHT_ANIMATIONS = no # LED animations +LED_MIRRORED = no # Mirror LEDs across halves (enable DIP 1 on slave, and DIP 2 and 3 on master) +RGB_MATRIX_ENABLE = WS2812 # Enable per-key coordinate based RGB effects. Do not enable with RGBlight + +# Userspace implements their own LTO +LINK_TIME_OPTIMIZATION_ENABLE = no + + + +# Do not edit past here + +include keyboards/$(KEYBOARD)/post_rules.mk + diff --git a/keyboards/rgbkb/sol/keymaps/xulkal/config.h b/keyboards/rgbkb/sol/keymaps/xulkal/config.h new file mode 100644 index 00000000000..a5c35cfae87 --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/xulkal/config.h @@ -0,0 +1,31 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// Xulkal custom stuff +#if KEYBOARD_rgbkb_sol_rev2 + #define OLED_90ROTATION + #define RGB_MATRIX_TOG_LAYERS + #define RGB_MATRIX_HUE_STEP 8 + #define RGB_MATRIX_SAT_STEP 8 + #define RGB_MATRIX_VAL_STEP 8 + #define RGB_MATRIX_SPD_STEP 8 +#endif diff --git a/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c b/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c new file mode 100644 index 00000000000..c508b0ca884 --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c @@ -0,0 +1,78 @@ +#include QMK_KEYBOARD_H +#include "xulkal.h" + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__) + +// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty Layout + * ,------------------------------------------------. ,------------------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * |FN(CAPS)| A | S | D | F | G | ` | | ' | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Sft[ | Z | X | C | V | B | RGB | |RGBRST| N | M | , | . | / | Sft] | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctl- | Win | LOWER| RAISE| Alt | Space| ENC1 | | ENC2 | Space| Left | Up | Down | Right| Ctl= | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Space| DEL | | Enter| Space| + * `-------------' `-------------' + */ + [_QWERTY] = EXPAND_LAYOUT( \ + _________________QWERTY_L1_________________, KC_MINS, KC_EQL, _________________QWERTY_R1_________________, \ + _________________QWERTY_L2_________________, KC_LBRC, KC_RBRC, _________________QWERTY_R2_________________, \ + _________________QWERTY_L3_________________, KC_GRV, KC_QUOT, _________________QWERTY_R3_________________, \ + _________________QWERTY_L4_________________, RGB_TOG, RGBRST, _________________QWERTY_R4_________________, \ + _________________QWERTY_L5_________________, KC_ENC1, KC_ENC2, _________________QWERTY_R5_________________, \ + KC_SPC, TD_DEL, KC_ENT, KC_SPC \ + ), + +#ifndef GAMELAYER_DISABLE + [_GAME] = EXPAND_LAYOUT( \ + ___________________GAME_L1_________________, KC_MINS, KC_EQL, ___________________GAME_R1_________________, \ + ___________________GAME_L2_________________, KC_LBRC, KC_RBRC, ___________________GAME_R2_________________, \ + ___________________GAME_L3_________________, KC_GRV, KC_QUOT, ___________________GAME_R3_________________, \ + ___________________GAME_L4_________________, RGB_TOG, RGBRST, ___________________GAME_R4_________________, \ + ___________________GAME_L5_________________, KC_ENC1, KC_ENC2, ___________________GAME_R5_________________, \ + KC_SPC, KC_DEL, KC_ENT, KC_SPC \ + ), +#endif + + [_LOWER] = EXPAND_LAYOUT( \ + __________________LOWER_L1_________________, KC_PMNS, KC_PPLS, __________________LOWER_R1_________________, \ + __________________LOWER_L2_________________, _______, _______, __________________LOWER_R2_________________, \ + __________________LOWER_L3_________________, _______, _______, __________________LOWER_R3_________________, \ + __________________LOWER_L4_________________, _______, _______, __________________LOWER_R4_________________, \ + __________________LOWER_L5_________________, _______, _______, __________________LOWER_R5_________________, \ + _______, _______, _______, _______ \ + ), + + [_RAISE] = EXPAND_LAYOUT( \ + __________________RAISE_L1_________________, _______, _______, __________________RAISE_R1_________________, \ + __________________RAISE_L2_________________, _______, _______, __________________RAISE_R2_________________, \ + __________________RAISE_L3_________________, _______, _______, __________________RAISE_R3_________________, \ + __________________RAISE_L4_________________, _______, _______, __________________RAISE_R4_________________, \ + __________________RAISE_L5_________________, _______, _______, __________________RAISE_R5_________________, \ + _______, _______, _______, _______ \ + ), + +#ifdef TRILAYER_ENABLED + [_ADJUST] = EXPAND_LAYOUT( \ + _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, \ + _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, \ + _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, \ + _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, \ + _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________, \ + _______, _______, _______, _______ \ + ), +#endif +}; + diff --git a/keyboards/rgbkb/sol/keymaps/xulkal/rules.mk b/keyboards/rgbkb/sol/keymaps/xulkal/rules.mk new file mode 100644 index 00000000000..6a14a99af5b --- /dev/null +++ b/keyboards/rgbkb/sol/keymaps/xulkal/rules.mk @@ -0,0 +1,25 @@ +# Overridden build options from rev1 & rev2 + +# RGB Options +RGBLIGHT_ENABLE = no # Enable global lighting effects. Do not enable with RGB Matrix +RGBLIGHT_ANIMATIONS = no # LED animations +LED_MIRRORED = no # Mirror LEDs across halves (enable DIP 1 on slave, and DIP 2 and 3 on master) +RGB_MATRIX_ENABLE = WS2812 # Enable per-key coordinate based RGB effects. Do not enable with RGBlight +FULLHAND_ENABLE = yes # Enables the additional 24 Full Hand LEDs + +# Misc +OLED_DRIVER_ENABLE = yes # Enable the OLED Driver + +# Not using the encoder for rev1 +ifeq ($(strip $(KEYBOARD)), rgbkb/sol/rev1) + ENCODER_ENABLE = no + RGB_OLED_MENU = no +else + ENCODER_ENABLE = yes + RGB_OLED_MENU = 0 +endif + +# Do not edit past here + +include keyboards/$(KEYBOARD)/post_rules.mk + diff --git a/keyboards/rgbkb/sol/readme.md b/keyboards/rgbkb/sol/readme.md new file mode 100644 index 00000000000..391189095c3 --- /dev/null +++ b/keyboards/rgbkb/sol/readme.md @@ -0,0 +1,15 @@ +# Sol + +![Sol](https://cdn.shopify.com/s/files/1/0008/8827/5005/products/CqdJAno_2048x2048.jpg?v=1533825028) + +Sol is a split ergonomic keyboard with ortholinear alphas and several modifier layouts. It can use up to 88 RGB LEDs, with per-key backlighting and underglow. The boards have presoldered components, including type C ports and ATmega32U4. Sol, when used with dual power supplies, is the brightest keyboard on earth. + +Keyboard Maintainer: [Legonut](https://github.com/Legonut) +Hardware Supported: Sol PCB R1.0, R1.1 +Hardware Availability: [RGBKB](https://www.rgbkb.net) + +Make example for this keyboard (after setting up your build environment): + + make rgbkb/sol:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/rgbkb/sol/rev1/config.h b/keyboards/rgbkb/sol/rev1/config.h new file mode 100644 index 00000000000..3cfc3eef945 --- /dev/null +++ b/keyboards/rgbkb/sol/rev1/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER RGBKB +#define PRODUCT Sol +#define DESCRIPTION "An RGB, split, ortho-esque keyboard" + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B3 + +#ifdef LED_MIRRORED + #define RGBLED_NUM 35 +#else + #define RGBLED_NUM 70 +#endif +#define DRIVER_LED_TOTAL RGBLED_NUM + +#define RGB_MATRIX_CENTER { 112, 35 } + +// Encoder support +#define ENCODERS_PAD_A { D2 } +#define ENCODERS_PAD_B { D6 } diff --git a/keyboards/rgbkb/sol/rev1/info.json b/keyboards/rgbkb/sol/rev1/info.json new file mode 100644 index 00000000000..e252ea2e2df --- /dev/null +++ b/keyboards/rgbkb/sol/rev1/info.json @@ -0,0 +1,87 @@ +{ + "keyboard_name": "Sol", + "url": "", + "maintainer": "Legonut", + "width": 17, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0, "w":1.5}, + {"label":"L01", "x":1.5, "y":0}, + {"label":"L02", "x":2.5, "y":0}, + {"label":"L03", "x":3.5, "y":0}, + {"label":"L04", "x":4.5, "y":0}, + {"label":"L05", "x":5.5, "y":0}, + {"label":"L06", "x":6.75, "y":0}, + {"label":"R06", "x":9.25, "y":0}, + {"label":"R00", "x":10.5, "y":0}, + {"label":"R01", "x":11.5, "y":0}, + {"label":"R02", "x":12.5, "y":0}, + {"label":"R03", "x":13.5, "y":0}, + {"label":"R04", "x":14.5, "y":0}, + {"label":"R05", "x":15.5, "y":0, "w":1.5}, + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + {"label":"L16", "x":6.75, "y":1}, + {"label":"R16", "x":9.25, "y":1}, + {"label":"R10", "x":10.5, "y":1}, + {"label":"R11", "x":11.5, "y":1}, + {"label":"R12", "x":12.5, "y":1}, + {"label":"R13", "x":13.5, "y":1}, + {"label":"R14", "x":14.5, "y":1}, + {"label":"R15", "x":15.5, "y":1, "w":1.5}, + {"label":"L20", "x":0, "y":2, "w":1.5}, + {"label":"L21", "x":1.5, "y":2}, + {"label":"L22", "x":2.5, "y":2}, + {"label":"L23", "x":3.5, "y":2}, + {"label":"L24", "x":4.5, "y":2}, + {"label":"L25", "x":5.5, "y":2}, + {"label":"L26", "x":6.75, "y":2}, + {"label":"R26", "x":9.25, "y":2}, + {"label":"R20", "x":10.5, "y":2}, + {"label":"R21", "x":11.5, "y":2}, + {"label":"R22", "x":12.5, "y":2}, + {"label":"R23", "x":13.5, "y":2}, + {"label":"R24", "x":14.5, "y":2}, + {"label":"R25", "x":15.5, "y":2, "w":1.5}, + {"label":"L30", "x":0, "y":3, "w":1.5}, + {"label":"L31", "x":1.5, "y":3}, + {"label":"L32", "x":2.5, "y":3}, + {"label":"L33", "x":3.5, "y":3}, + {"label":"L34", "x":4.5, "y":3}, + {"label":"L35", "x":5.5, "y":3}, + {"label":"L36", "x":6.75, "y":3}, + {"label":"R36", "x":9.25, "y":3}, + {"label":"R30", "x":10.5, "y":3}, + {"label":"R31", "x":11.5, "y":3}, + {"label":"R32", "x":12.5, "y":3}, + {"label":"R33", "x":13.5, "y":3}, + {"label":"R34", "x":14.5, "y":3}, + {"label":"R35", "x":15.5, "y":3, "w":1.5}, + {"label":"L40", "x":0, "y":4, "w":1.5}, + {"label":"L41", "x":1.5, "y":4}, + {"label":"L42", "x":2.5, "y":4}, + {"label":"L43", "x":3.5, "y":4}, + {"label":"L44", "x":4.5, "y":4}, + {"label":"L45", "x":6, "y":4.5}, + {"label":"L46", "x":7, "y":4.5}, + {"label":"R46", "x":9, "y":4.5}, + {"label":"R40", "x":10, "y":4.5}, + {"label":"R41", "x":11.5, "y":4}, + {"label":"R42", "x":12.5, "y":4}, + {"label":"R43", "x":13.5, "y":4}, + {"label":"R44", "x":14.5, "y":4}, + {"label":"R45", "x":15.5, "y":4, "w":1.5}, + {"label":"L55", "x":6, "y":5.5}, + {"label":"L56", "x":7, "y":5.5}, + {"label":"R56", "x":9, "y":5.5}, + {"label":"R50", "x":10, "y":5.5} + ] + } + } +} diff --git a/keyboards/rgbkb/sol/rev1/post_rules.mk b/keyboards/rgbkb/sol/rev1/post_rules.mk new file mode 100644 index 00000000000..ede37a1ad7b --- /dev/null +++ b/keyboards/rgbkb/sol/rev1/post_rules.mk @@ -0,0 +1,19 @@ +# As long as the users rules.mk has include $(KEYBOARD)/post_rules.mk this will be run after to properly setup any keyboard features and defines + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) + OPT_DEFS += -DRGBLIGHT_FULL_POWER +endif + +ifeq ($(strip $(RGB_MATRIX_KEYPRESSES)), yes) + OPT_DEFS += -DRGB_MATRIX_KEYPRESSES +endif + +ifeq ($(strip $(RGB_MATRIX_FRAMEBUFFER)), yes) + OPT_DEFS += -DRGB_MATRIX_FRAMEBUFFER_EFFECTS +endif + +ifeq ($(strip $(LED_MIRRORED)), yes) + OPT_DEFS += -DLED_MIRRORED +endif diff --git a/keyboards/rgbkb/sol/rev1/rev1.c b/keyboards/rgbkb/sol/rev1/rev1.c new file mode 100644 index 00000000000..21b4503ab9f --- /dev/null +++ b/keyboards/rgbkb/sol/rev1/rev1.c @@ -0,0 +1,46 @@ +#include "quantum.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6 }, + { 7, 8, 9, 10, 11, 12, 13 }, + { 14, 15, 16, 17, 18, 19, 20 }, + { 21, 22, 23, 24, 25, 26, 27 }, + { 28, 29, 30, 31, 32, 33, 34 }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 33, 34 }, + { 35, 36, 37, 38, 39, 40, 41 }, + { 42, 43, 44, 45, 46, 47, 48 }, + { 49, 50, 51, 52, 53, 54, 55 }, + { 56, 57, 58, 59, 60, 61, 62 }, + { 63, 64, 65, 66, 67, 68, 68 }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 68, 68 } +}, { + // Left Hand Mapped Left to Right + { 0, 0 }, { 21, 0 }, { 38, 0 }, { 56, 0 }, { 73, 0 }, { 91, 0 }, { 112, 0 }, + { 0, 18 }, { 21, 18 }, { 38, 18 }, { 56, 18 }, { 73, 18 }, { 91, 18 }, { 108, 13 }, + { 0, 35 }, { 21, 35 }, { 38, 35 }, { 56, 35 }, { 73, 35 }, { 91, 35 }, { 108, 31 }, + { 0, 52 }, { 21, 52 }, { 38, 52 }, { 56, 52 }, { 73, 52 }, { 91, 52 }, { 108, 48 }, + { 0, 70 }, { 21, 70 }, { 38, 70 }, { 56, 70 }, { 73, 70 }, { 89, 91 }, { 101, 103 }, + // Left Hand Mapped Right to Left + { 224, 0 }, { 203, 0 }, { 186, 0 }, { 168, 0 }, { 151, 0 }, { 133, 0 }, { 112, 0 }, + { 224, 18 }, { 203, 18 }, { 186, 18 }, { 168, 18 }, { 151, 18 }, { 133, 18 }, { 116, 13 }, + { 224, 35 }, { 203, 35 }, { 186, 35 }, { 168, 35 }, { 151, 35 }, { 133, 35 }, { 116, 31 }, + { 224, 52 }, { 203, 52 }, { 186, 52 }, { 168, 52 }, { 151, 52 }, { 133, 52 }, { 116, 48 }, + { 224, 70 }, { 203, 70 }, { 186, 70 }, { 168, 70 }, { 151, 70 }, { 135, 91 }, { 123, 103 }, +}, { + // Left Hand Mapped Left to Right + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1, + // Left Hand Mapped Right to Left + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1 +} }; + +#endif + diff --git a/keyboards/rgbkb/sol/rev1/rev1.h b/keyboards/rgbkb/sol/rev1/rev1.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/keyboards/rgbkb/sol/rev1/rev1.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/rgbkb/sol/rev1/rules.mk b/keyboards/rgbkb/sol/rev1/rules.mk new file mode 100644 index 00000000000..dd6d25eb984 --- /dev/null +++ b/keyboards/rgbkb/sol/rev1/rules.mk @@ -0,0 +1,28 @@ +# RGBKB Sol Rev1 Defaults + +# Keycode Options +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +UNICODE_ENABLE = no # Unicode keycodes +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work + +# Debug Options +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration + +# RGB Options +RGBLIGHT_ENABLE = yes # Enable global lighting effects. Do not enable with RGB Matrix +RGBLIGHT_ANIMATIONS = yes # LED animations +LED_MIRRORED = yes # Mirror LEDs across halves (enable DIP 1 on slave, and DIP 2 and 3 on master) + +RGB_MATRIX_ENABLE = no # Enable per-key coordinate based RGB effects. Do not enable with RGBlight +RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. +RGB_MATRIX_FRAMEBUFFER_EFFECTS = no # Enable frame buffer effects like the typing heatmap. + +RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness for RGBLIGHT or RGB_MATRIX. Otherwise, limited to a safe level for a normal USB-A port +IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) + +# Misc +OLED_DRIVER_ENABLE = no # Enable the OLED Driver +SWAP_HANDS_ENABLE = no # Enable one-hand typing diff --git a/keyboards/rgbkb/sol/rev2/config.h b/keyboards/rgbkb/sol/rev2/config.h new file mode 100644 index 00000000000..af74b7e46fb --- /dev/null +++ b/keyboards/rgbkb/sol/rev2/config.h @@ -0,0 +1,61 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0002 +#define MANUFACTURER RGBKB +#define PRODUCT Sol +#define DESCRIPTION "An RGB, split, ortho-esque keyboard" + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B7 + +#define BACKLIGHT_LEDS 124 + +#ifdef FULLHAND_ENABLE + #define FULLHAND_LEDS 24 +#else + #define FULLHAND_LEDS 0 +#endif + +// Underglow / DIY Tent Glow are parallel to the top row leds, no separate define + +#ifdef LED_MIRRORED + #define RGBLED_NUM ((BACKLIGHT_LEDS + FULLHAND_LEDS) / 2) +#else + #define RGBLED_NUM (BACKLIGHT_LEDS + FULLHAND_LEDS) +#endif +#define DRIVER_LED_TOTAL RGBLED_NUM + +#define RGB_MATRIX_CENTER { 112, 37 } + +// Encoder support +#ifndef EXTRA_ENCODERS_ENABLE +#define ENCODERS_PAD_A { D2 } +#define ENCODERS_PAD_B { D6 } +#else +#ifdef OLED_DRIVER_ENABLE + #error Extra encoders cannot be enabled at the same time as the OLED Driver as they use the same pins. +#endif +#define ENCODERS_PAD_A { D2, D1, B0 } +#define ENCODERS_PAD_B { D6, B1, D0 } +#endif diff --git a/keyboards/rgbkb/sol/rev2/info.json b/keyboards/rgbkb/sol/rev2/info.json new file mode 100644 index 00000000000..e252ea2e2df --- /dev/null +++ b/keyboards/rgbkb/sol/rev2/info.json @@ -0,0 +1,87 @@ +{ + "keyboard_name": "Sol", + "url": "", + "maintainer": "Legonut", + "width": 17, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0, "w":1.5}, + {"label":"L01", "x":1.5, "y":0}, + {"label":"L02", "x":2.5, "y":0}, + {"label":"L03", "x":3.5, "y":0}, + {"label":"L04", "x":4.5, "y":0}, + {"label":"L05", "x":5.5, "y":0}, + {"label":"L06", "x":6.75, "y":0}, + {"label":"R06", "x":9.25, "y":0}, + {"label":"R00", "x":10.5, "y":0}, + {"label":"R01", "x":11.5, "y":0}, + {"label":"R02", "x":12.5, "y":0}, + {"label":"R03", "x":13.5, "y":0}, + {"label":"R04", "x":14.5, "y":0}, + {"label":"R05", "x":15.5, "y":0, "w":1.5}, + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + {"label":"L16", "x":6.75, "y":1}, + {"label":"R16", "x":9.25, "y":1}, + {"label":"R10", "x":10.5, "y":1}, + {"label":"R11", "x":11.5, "y":1}, + {"label":"R12", "x":12.5, "y":1}, + {"label":"R13", "x":13.5, "y":1}, + {"label":"R14", "x":14.5, "y":1}, + {"label":"R15", "x":15.5, "y":1, "w":1.5}, + {"label":"L20", "x":0, "y":2, "w":1.5}, + {"label":"L21", "x":1.5, "y":2}, + {"label":"L22", "x":2.5, "y":2}, + {"label":"L23", "x":3.5, "y":2}, + {"label":"L24", "x":4.5, "y":2}, + {"label":"L25", "x":5.5, "y":2}, + {"label":"L26", "x":6.75, "y":2}, + {"label":"R26", "x":9.25, "y":2}, + {"label":"R20", "x":10.5, "y":2}, + {"label":"R21", "x":11.5, "y":2}, + {"label":"R22", "x":12.5, "y":2}, + {"label":"R23", "x":13.5, "y":2}, + {"label":"R24", "x":14.5, "y":2}, + {"label":"R25", "x":15.5, "y":2, "w":1.5}, + {"label":"L30", "x":0, "y":3, "w":1.5}, + {"label":"L31", "x":1.5, "y":3}, + {"label":"L32", "x":2.5, "y":3}, + {"label":"L33", "x":3.5, "y":3}, + {"label":"L34", "x":4.5, "y":3}, + {"label":"L35", "x":5.5, "y":3}, + {"label":"L36", "x":6.75, "y":3}, + {"label":"R36", "x":9.25, "y":3}, + {"label":"R30", "x":10.5, "y":3}, + {"label":"R31", "x":11.5, "y":3}, + {"label":"R32", "x":12.5, "y":3}, + {"label":"R33", "x":13.5, "y":3}, + {"label":"R34", "x":14.5, "y":3}, + {"label":"R35", "x":15.5, "y":3, "w":1.5}, + {"label":"L40", "x":0, "y":4, "w":1.5}, + {"label":"L41", "x":1.5, "y":4}, + {"label":"L42", "x":2.5, "y":4}, + {"label":"L43", "x":3.5, "y":4}, + {"label":"L44", "x":4.5, "y":4}, + {"label":"L45", "x":6, "y":4.5}, + {"label":"L46", "x":7, "y":4.5}, + {"label":"R46", "x":9, "y":4.5}, + {"label":"R40", "x":10, "y":4.5}, + {"label":"R41", "x":11.5, "y":4}, + {"label":"R42", "x":12.5, "y":4}, + {"label":"R43", "x":13.5, "y":4}, + {"label":"R44", "x":14.5, "y":4}, + {"label":"R45", "x":15.5, "y":4, "w":1.5}, + {"label":"L55", "x":6, "y":5.5}, + {"label":"L56", "x":7, "y":5.5}, + {"label":"R56", "x":9, "y":5.5}, + {"label":"R50", "x":10, "y":5.5} + ] + } + } +} diff --git a/keyboards/rgbkb/sol/rev2/post_rules.mk b/keyboards/rgbkb/sol/rev2/post_rules.mk new file mode 100644 index 00000000000..0cbf430ad3e --- /dev/null +++ b/keyboards/rgbkb/sol/rev2/post_rules.mk @@ -0,0 +1,37 @@ +# As long as the users rules.mk has include $(KEYBOARD)/post_rules.mk this will be run after to properly setup any keyboard features and defines + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) + OPT_DEFS += -DRGBLIGHT_FULL_POWER +endif + +ifeq ($(strip $(RGB_MATRIX_KEYPRESSES)), yes) + OPT_DEFS += -DRGB_MATRIX_KEYPRESSES +endif + +ifeq ($(strip $(RGB_MATRIX_FRAMEBUFFER)), yes) + OPT_DEFS += -DRGB_MATRIX_FRAMEBUFFER_EFFECTS +endif + +ifeq ($(strip $(LED_MIRRORED)), yes) + OPT_DEFS += -DLED_MIRRORED +endif + +ifeq ($(strip $(FULLHAND_ENABLE)), yes) + OPT_DEFS += -DFULLHAND_ENABLE +endif + +ifeq ($(strip $(EXTRA_ENCODERS_ENABLE)), yes) + OPT_DEFS += -DEXTRA_ENCODERS_ENABLE +endif + +ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) + ifeq ($(strip $(ENCODER_ENABLE)), yes) + ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) + ifneq ($(strip $(RGB_OLED_MENU)), no) + OPT_DEFS += -DRGB_OLED_MENU=$(strip $(RGB_OLED_MENU)) + endif + endif + endif +endif diff --git a/keyboards/rgbkb/sol/rev2/rev2.c b/keyboards/rgbkb/sol/rev2/rev2.c new file mode 100644 index 00000000000..467aa18e44f --- /dev/null +++ b/keyboards/rgbkb/sol/rev2/rev2.c @@ -0,0 +1,89 @@ +#include "quantum.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6 }, + { 7, 8, 9, 10, 11, 12, 13 }, + { 14, 15, 16, 17, 18, 19, 20 }, + { 21, 22, 23, 24, 25, 26, 27 }, + { 28, 29, 30, 31, 32, 33, 34 }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 33, 34 }, +// Need to shift Right hand indexes if full hand LEDs are enabled +#define LO (FULLHAND_LEDS / 2) + { LO+62, LO+63, LO+64, LO+65, LO+66, LO+67, LO+68 }, + { LO+69, LO+70, LO+71, LO+72, LO+73, LO+74, LO+75 }, + { LO+76, LO+77, LO+78, LO+79, LO+80, LO+81, LO+82 }, + { LO+83, LO+84, LO+85, LO+86, LO+87, LO+88, LO+89 }, + { LO+90, LO+91, LO+92, LO+93, LO+94, LO+95, LO+95 }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, LO+95, LO+95 } +#undef LO +}, { +// Left Hand Mapped Left to Right + { 11, 14 }, { 28, 14 }, { 42, 14 }, { 56, 14 }, { 70, 14 }, { 84, 14 }, { 102, 14 }, + { 11, 28 }, { 28, 28 }, { 42, 28 }, { 56, 28 }, { 70, 28 }, { 84, 28 }, { 98, 25 }, + { 11, 42 }, { 28, 42 }, { 42, 42 }, { 56, 42 }, { 70, 42 }, { 84, 42 }, { 98, 39 }, + { 11, 56 }, { 28, 56 }, { 42, 56 }, { 56, 56 }, { 70, 56 }, { 84, 56 }, { 98, 53 }, + { 11, 70 }, { 28, 70 }, { 42, 70 }, { 56, 70 }, { 70, 70 }, { 83, 87 }, { 93, 97 }, +// Edge Light Left + { 0, 66 }, { 0, 52 }, { 0, 38 }, { 0, 24 }, { 0, 10 }, { 31, 0 }, { 38, 0 }, + { 46, 0 }, { 54, 0 }, { 61, 0 }, { 69, 0 }, { 76, 0 }, { 84, 0 }, { 109, 11 }, + { 109, 24 }, { 109, 39 }, { 109, 53 }, { 110, 73 }, { 112, 85 }, { 106, 95 }, { 95, 98 }, + { 83, 91 }, { 71, 84 }, { 58, 77 }, { 42, 74 }, { 28, 74 }, { 14, 74 }, +// Full Hand Left +#ifdef FULLHAND_ENABLE + { 2, 88 }, { 2, 103 }, { 2, 117 }, { 2, 132 }, { 10, 145 }, { 25, 145 }, { 39, 145 }, + { 54, 145 }, { 69, 145 }, { 79, 136 }, { 87, 124 }, { 94, 111 }, +#endif +// Left Hand Mapped Right to Left + { 213, 14 }, { 196, 14 }, { 182, 14 }, { 168, 14 }, { 154, 14 }, { 140, 14 }, { 122, 14 }, + { 213, 28 }, { 196, 28 }, { 182, 28 }, { 168, 28 }, { 154, 28 }, { 140, 28 }, { 126, 25 }, + { 213, 42 }, { 196, 42 }, { 182, 42 }, { 168, 42 }, { 154, 42 }, { 140, 42 }, { 126, 39 }, + { 213, 56 }, { 196, 56 }, { 182, 56 }, { 168, 56 }, { 154, 56 }, { 140, 56 }, { 126, 53 }, + { 213, 70 }, { 196, 70 }, { 182, 70 }, { 168, 70 }, { 154, 70 }, { 141, 87 }, { 131, 97 }, +// Edge Light Right + { 224, 66 }, { 224, 52 }, { 224, 38 }, { 224, 24 }, { 224, 10 }, { 193, 0 }, { 186, 0 }, + { 178, 0 }, { 170, 0 }, { 163, 0 }, { 155, 0 }, { 148, 0 }, { 140, 0 }, { 115, 11 }, + { 115, 24 }, { 115, 39 }, { 115, 53 }, { 114, 73 }, { 112, 85 }, { 118, 95 }, { 129, 98 }, + { 141, 91 }, { 153, 84 }, { 166, 77 }, { 182, 74 }, { 196, 74 }, { 210, 74 } +// Full Hand Right +#ifdef FULLHAND_ENABLE + ,{ 222, 88 }, { 222, 103 }, { 222, 117 }, { 222, 132 }, { 214, 145 }, { 199, 145 }, { 185, 145 }, + { 170, 145 }, { 155, 145 }, { 145, 136 }, { 137, 124 }, { 130, 111 } +#endif +}, { +// Left Hand Mapped Left to Right + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1, +// Edge Light Left + 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, +// Full Hand Left +#ifdef FULLHAND_ENABLE + 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, +#endif +// Left Hand Mapped Right to Left + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1, +// Edge Light Right + 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2 +// Full Hand Right +#ifdef FULLHAND_ENABLE + ,2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2 +#endif +} }; + +#endif + diff --git a/keyboards/rgbkb/sol/rev2/rev2.h b/keyboards/rgbkb/sol/rev2/rev2.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/keyboards/rgbkb/sol/rev2/rev2.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/rgbkb/sol/rev2/rules.mk b/keyboards/rgbkb/sol/rev2/rules.mk new file mode 100644 index 00000000000..87b400fa14e --- /dev/null +++ b/keyboards/rgbkb/sol/rev2/rules.mk @@ -0,0 +1,35 @@ +# RGBKB Sol Rev2 Defaults + +# Keycode Options +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration( +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +UNICODE_ENABLE = no # Unicode keycodes +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work + +# Debug Options +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration + +# RGB Options +RGBLIGHT_ENABLE = no # Enable global lighting effects. Do not enable with RGB Matrix +RGBLIGHT_ANIMATIONS = no # LED animations +LED_MIRRORED = no # Mirror LEDs across halves (enable DIP 1 on slave, and DIP 2 and 3 on master) + +RGB_MATRIX_ENABLE = WS2812 # Enable per-key coordinate based RGB effects. Do not enable with RGBlight +RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. +RGB_MATRIX_FRAMEBUFFER_EFFECTS = no # Enable frame buffer effects like the typing heatmap. + +RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness for RGBLIGHT or RGB_MATRIX. Otherwise, limited to a safe level for a normal USB-A port +FULLHAND_ENABLE = no # Enables the additional 24 Full Hand LEDs +IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) + +# Misc +OLED_DRIVER_ENABLE = no # Enable the OLED Driver +EXTRA_ENCODERS_ENABLE = no # Enables 3 encoders per side (up from 1, not compatible with OLED_DRIVER_ENABLE) +SWAP_HANDS_ENABLE = no # Enable one-hand typing +LINK_TIME_OPTIMIZATION_ENABLE = yes # Enable Link Time Optimizations greatly reducing firmware size by disabling the old Macros and Functions features + +# Special RGB Matrix, OLED, & Encoder Control Menu! +RGB_OLED_MENU = no # Enabled by setting this to the encoder index (0-5) you wish to use to control the menu. + # Use the RGB_MENU keycode in the keymap for the encoder to advance the menu to the next option. diff --git a/keyboards/rgbkb/sol/rules.mk b/keyboards/rgbkb/sol/rules.mk new file mode 100644 index 00000000000..3be8f0b2291 --- /dev/null +++ b/keyboards/rgbkb/sol/rules.mk @@ -0,0 +1,25 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +F_CPU = 16000000 + +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +F_USB = $(F_CPU) + +# Bootloader +BOOTLOADER = qmk-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Custom local font file +OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" + +SPLIT_KEYBOARD = yes +ENCODER_ENABLE = yes + +DEFAULT_FOLDER = rgbkb/sol/rev2 diff --git a/keyboards/rgbkb/sol/sol.c b/keyboards/rgbkb/sol/sol.c new file mode 100644 index 00000000000..5945cc60a4f --- /dev/null +++ b/keyboards/rgbkb/sol/sol.c @@ -0,0 +1 @@ +#include "sol.h" diff --git a/keyboards/rgbkb/sol/sol.h b/keyboards/rgbkb/sol/sol.h new file mode 100644 index 00000000000..1bc87cb0aa4 --- /dev/null +++ b/keyboards/rgbkb/sol/sol.h @@ -0,0 +1,79 @@ +#pragma once + +#include "quantum.h" +#ifdef KEYBOARD_rgbkb_sol_rev1 +#include "rev1.h" +#else +#include "rev2.h" +#endif + + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R06, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, L16, R16, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, L26, R26, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, L46, R46, R40, R41, R42, R43, R44, R45, \ + L55, L56, R56, R50 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, L55, L56 }, \ + { R05, R04, R03, R02, R01, R00, R06 }, \ + { R15, R14, R13, R12, R11, R10, R16 }, \ + { R25, R24, R23, R22, R21, R20, R26 }, \ + { R35, R34, R33, R32, R31, R30, R36 }, \ + { R45, R44, R43, R42, R41, R40, R46 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, R50, R56 } \ + } + +#define ENCODER_LAYOUT( \ + E10, E11, \ + E20, E21 \ +) \ +{ \ + { E10, E11 }, \ + { E20, E21 } \ +} + +#define EXTRA_ENCODER_LAYOUT( \ + E10, E11, \ + E20, E21, \ + E30, E31, \ + E40, E41, \ + E50, E51, \ + E60, E61 \ +) \ +{ \ + { E10, E11 }, \ + { E20, E21 }, \ + { E30, E31 }, \ + { E40, E41 }, \ + { E50, E51 }, \ + { E60, E61 } \ +} + +#define KC________ KC_TRNS +#define KC_RGB_MOD RGB_MOD +#define KC_FN FN +#define KC_ADJ ADJ +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R06, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, L16, R16, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, L26, R26, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, L46, R46, R40, R41, R42, R43, R44, R45, \ + L55, L56, R56, R50 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, \ + KC_##L55, KC_##L56, KC_##R56, KC_##R50 \ + ) diff --git a/keyboards/rgbkb/zen/common/glcdfont.c b/keyboards/rgbkb/zen/common/glcdfont.c new file mode 100644 index 00000000000..3b4ccfa95c6 --- /dev/null +++ b/keyboards/rgbkb/zen/common/glcdfont.c @@ -0,0 +1,239 @@ +// This is the SOL 6x8 font + +#pragma once + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x0C, 0x90, + 0xB0, 0xE0, 0x72, 0x31, 0x9B, 0xDE, + 0xCE, 0xEC, 0xEE, 0xE9, 0xE9, 0xEC, + 0xCF, 0xDA, 0x99, 0x3E, 0x62, 0xE4, + 0xC4, 0x70, 0x10, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, + 0xC0, 0xC0, 0x80, 0x80, 0x02, 0x85, + 0x85, 0x87, 0x85, 0x89, 0x89, 0x92, + 0xEA, 0xC6, 0xC4, 0x48, 0x50, 0x60, + 0x40, 0x40, 0x40, 0x40, 0xC0, 0xE0, + 0x50, 0x28, 0x10, 0x10, 0x60, 0xC0, + 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, + 0x80, 0x80, 0x80, 0xE0, 0xF8, 0xFC, + 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0xE0, 0xEC, 0xDF, + 0xFC, 0xE0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7F, 0x80, 0x80, + 0x80, 0x70, 0x0F, 0x00, 0x00, 0x80, + 0x7F, 0x00, 0x00, 0x7F, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x7F, + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x21, 0x33, 0x3B, 0x7B, + 0xFF, 0x00, 0x7C, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0x01, + 0xFF, 0xDE, 0x8C, 0x04, 0x0C, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x01, 0x7F, 0x80, + 0x80, 0xBE, 0xBE, 0x80, 0x80, 0x80, + 0xC1, 0xFF, 0x80, 0x04, 0x32, 0x5E, + 0x1C, 0x3D, 0x26, 0x10, 0xC1, 0xFF, + 0x3E, 0x00, 0x00, 0x08, 0x36, 0xC1, + 0x08, 0x08, 0x14, 0x77, 0x94, 0x94, + 0x94, 0xF7, 0x94, 0xF7, 0x9C, 0x9C, + 0xFF, 0xFF, 0x1E, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x40, 0x7C, 0x3F, 0x3F, 0x23, 0x01, + 0x23, 0x3F, 0x37, 0x6C, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x02, 0x06, + 0x4D, 0x4F, 0x8C, 0xF9, 0x73, 0x37, + 0x27, 0x2F, 0x2F, 0xAF, 0xEF, 0x6F, + 0x77, 0x17, 0x33, 0x79, 0xCC, 0x1F, + 0x31, 0x20, 0x21, 0x02, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0xE0, + 0xA0, 0xA0, 0xD0, 0x90, 0x48, 0x48, + 0x25, 0x2B, 0x11, 0x09, 0x05, 0x03, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x03, 0x02, 0x04, 0x03, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, + 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/rgbkb/zen/config.h b/keyboards/rgbkb/zen/config.h new file mode 100644 index 00000000000..6868dc13541 --- /dev/null +++ b/keyboards/rgbkb/zen/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" diff --git a/keyboards/rgbkb/zen/readme.md b/keyboards/rgbkb/zen/readme.md new file mode 100644 index 00000000000..0a2f9e3edf7 --- /dev/null +++ b/keyboards/rgbkb/zen/readme.md @@ -0,0 +1,27 @@ +# Zen Keyboard + +A split ergo keyboard with a few goals in mind: + +- Be as thin as possible. Other split KBs (Let's Split, Nyquist, Iris) are 15.2mm thick. The Zen rev2 is only 13.2mm thick *including switches and caps* when using Kailh Choc low-profile switches, and 22.1mm using standard MX switches and DSA keycaps. +- Layout designed for gaming. 1.5u pinky keys, ortho alphas, and angled thumb keys. After trying Ortholinear, Atreus62, and Ergodox, this is the best layout for gaming and typing. +- Per-key RGB lighting. 34 WS2812b LEDs per side make it exceptionally bright +- Price. Using Arduino Pro Micro, SK6812 LEDs, and PCB FR4 for the case, the cost of each half without switches or caps can be reduced to under $20 when purchased at volume. +- Options. The Zen rev2 comes with rotary encoder support, SSD1306 OLED pinout, USB-C or TRRS interconnect, and jumpers to enable compatibility with the [QMK Proton-C](https://olkb.com/parts/qmk-proton-c) and the [Keeb.io Elite-C](https://keeb.io/products/elite-c-usb-c-pro-micro-replacement-arduino-compatible-atmega32u4) + +Keyboard Maintainer: [Legonut](https://github.com/Legonut) +Hardware Supported: Zen rev1, Zen rev2 +Hardware Availability: [RGBKB.net](https://www.rgbkb.net/) + +A build guide and more info for this keyboard can be found here: [Zen Build Guide](https://rgbkb.gitbook.io/sol-build-guide/zygomorph-build-guide/untitled). + +Make example for this keyboard (after setting up your build environment): + + make rgbkb/zen/rev2:default + +To build for a Proton-C: + + make rgbkb/zen/rev2:default CTPC=yes + +**Note:** The Proton-C does not have split keyboard, or encoder support. Also OLED driver support is untested. Will update as status changes. + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/rgbkb/zen/rev1/config.h b/keyboards/rgbkb/zen/rev1/config.h new file mode 100644 index 00000000000..4d81855a8b7 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/config.h @@ -0,0 +1,74 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Legonut +#define PRODUCT Project Zen +#define DESCRIPTION Split gaming keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { B2, B3, B1, F7, F6, D4, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define SOFT_SERIAL_PIN D0 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D1 + +#define RGBLED_NUM 16 // Number of LEDs + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/zen/info.json b/keyboards/rgbkb/zen/rev1/info.json similarity index 100% rename from keyboards/zen/info.json rename to keyboards/rgbkb/zen/rev1/info.json diff --git a/keyboards/zen/keymaps/333fred/config.h b/keyboards/rgbkb/zen/rev1/keymaps/333fred/config.h similarity index 100% rename from keyboards/zen/keymaps/333fred/config.h rename to keyboards/rgbkb/zen/rev1/keymaps/333fred/config.h diff --git a/keyboards/rgbkb/zen/rev1/keymaps/333fred/keymap.c b/keyboards/rgbkb/zen/rev1/keymaps/333fred/keymap.c new file mode 100644 index 00000000000..53756344fd9 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/333fred/keymap.c @@ -0,0 +1,123 @@ +#include QMK_KEYBOARD_H +#include "333fred.h" + +extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |SHIFT | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | F4 | F5 | GUI | Alt | Bksp |Lwr/VM||Enter|Space | NAV | - | = | Alt | Del | + * `------------------------------------------------''-----------------------------------------------' + */ +[BASE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_RSFT) , \ + KC_LCTL, KC_F4, KC_F5, KC_LGUI, KC_LALT, KC_BSPC, TD(TD_SYM_VIM), KC_ENT, KC_SPACE, OSL(VIM), KC_MINS, KC_EQL, KC_RALT, KC_DEL \ +), + +/* Symbols + * ,-----------------------------------------. .-----------------------------------------. + * | Caps | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | ! | @ | ( | ) | | | | 7 | 8 | 9 | * | ) | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | # | $ | { | } | ` | | 4 | 5 | 6 | + | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | APscr| % | ^ | [ | ] | ~ | | 1 | 2 | 3 | \ | Vol- | Vol+ | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | Pscr | | RESET| | | GAME | || | 0 | . | = | Prev | Next | Play | + * `------------------------------------------------- -------------------------------------------------' + */ +[SYMB] = LAYOUT( \ + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ + _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \ + _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \ + PSCREEN_APP, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \ + KC_PSCR, _______, RESET, _______, _______, TO(GAME), _______, _______, KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ +), + +/* Vim Movement + * ,-----------------------------------------. .-----------------------------------------. + * | | | | | | | | | | | | RESET| | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBSAI|RGBVAI|RGBSAD| LSFT | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | DLeft|DRight| LCTRL| LGUI | | | Left | Down | Up | Right| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBHUD|RGBVAD|RGBHUI| | | | | | | | | | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | | | | | | | || | | | | | | | + * `------------------------------------------------..------------------------------------------------' + */ +[VIM] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, \ + _______, RGB_SAI, RGB_VAI, RGB_SAD, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, \ + _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Gaming mode (Raise) + * All one-shot mods are disabled on this layer + * ,-----------------------------------------. .-----------------------------------------. + * | ESC | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | CTRL | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | | | | | | | | | | | GUI | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | Enter| | Lock | Bksp | Alt | Spc | RESET|| | Lower| Left | Up | Down | Right|QWERTY| + * `------------------------------------------------..-----------------------------------------------' + */ +[GAME] = LAYOUT( \ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ + KC_ENT, TG(GAME_ARROW), KC_LOCK, KC_BSPC, KC_F5, KC_LALT, KC_SPC, OSL(SYMB), KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ +), +/* Gaming Arrow mode (Raise) + * Turns wasd into arrows + * ,-----------------------------------------. .-----------------------------------------. + * | ESC | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | Up | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | CTRL | Left | Down | Right| | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | | | | | | | | | | | GUI | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | Enter| | Lock | Bksp | Alt | Spc | RESET|| | Lower| Left | Up | Down | Right|QWERTY| + * `------------------------------------------------..-----------------------------------------------' + */ +[GAME_ARROW] = LAYOUT( \ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ + KC_ENT, _______, KC_LOCK, KC_BSPC, KC_F5, KC_LALT, KC_SPC, OSL(SYMB), KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ +) +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_process_keycode(keycode); + return true; +} diff --git a/keyboards/rgbkb/zen/rev1/keymaps/333fred/rules.mk b/keyboards/rgbkb/zen/rev1/keymaps/333fred/rules.mk new file mode 100644 index 00000000000..1359e81c09f --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/333fred/rules.mk @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = yes +NKRO_ENABLE = yes +KEY_LOCK_ENABLE = yes +TAP_DANCE_ENABLE = yes +CONSOLE_ENABLE = no +EXTRAFLAGS += -flto diff --git a/keyboards/rgbkb/zen/rev1/keymaps/default/config.h b/keyboards/rgbkb/zen/rev1/keymaps/default/config.h new file mode 100644 index 00000000000..4a549c5b1f7 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/default/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/rgbkb/zen/rev1/keymaps/default/keymap.c b/keyboards/rgbkb/zen/rev1/keymaps/default/keymap.c new file mode 100644 index 00000000000..54462ec0ff1 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/default/keymap.c @@ -0,0 +1,99 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _NAV +}; + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + NAV, + +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBTOG| NAV |Space |Delete||Enter|Space | NAV | - | = | PGUP | PGDN | + * `------------------------------------------------''-----------------------------------------------' + */ + [_QWERTY] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + LT(_NAV, KC_CAPS),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, KC_PGUP, KC_PGDN \ + ), + + /* NAV + * ,-----------------------------------------. .-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBHUD|RGBVAD|RGBHUI| | | | | Left | Down | Right|Delete| End | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | | | | | | | NKRO | | | Pause| Back | Next | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBMOD| | | || | | | | Mute | VOLUP| VOLDN| + * `------------------------------------------------''-----------------------------------------------' + */ + [_NAV] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \ + KC_LSFT, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD \ + ), + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + //case COLEMAK: + //if (record->event.pressed) { + //#ifdef AUDIO_ENABLE + //PLAY_NOTE_ARRAY(tone_colemak, false, 0); + //#endif + //persistant_default_layer_set(1UL<<_COLEMAK); + //} + //return false; + //break; + } + return true; +} diff --git a/keyboards/rgbkb/zen/rev1/keymaps/default/rules.mk b/keyboards/rgbkb/zen/rev1/keymaps/default/rules.mk new file mode 100644 index 00000000000..1e3cebb1451 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/rgbkb/zen/rev1/keymaps/jwlawrence/config.h b/keyboards/rgbkb/zen/rev1/keymaps/jwlawrence/config.h new file mode 100644 index 00000000000..d813085e46d --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/jwlawrence/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/rgbkb/zen/rev1/keymaps/jwlawrence/keymap.c b/keyboards/rgbkb/zen/rev1/keymaps/jwlawrence/keymap.c new file mode 100644 index 00000000000..13edd0db8da --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/jwlawrence/keymap.c @@ -0,0 +1,97 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _NAV 2 + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + NAV, + +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | GUI | NAV |Space |Delete||Enter|Space | NAV | - | = |RGBTOG|Enter | + * `------------------------------------------------''-----------------------------------------------' + */ + [_QWERTY] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + LT(_NAV, KC_CAPS),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_LGUI, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, RGB_TOG, KC_ENT \ + ), + + /* NAV + * ,-----------------------------------------. .-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBHUD|RGBVAD|RGBHUI|RGBMOD| | | | Left | Down | Right|Delete| End | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | | | | | | | NKRO | | | Pause| Back | Next | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | | | | || | | | | Mute | VOLUP| VOLDN| + * `------------------------------------------------''-----------------------------------------------' + */ + [_NAV] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGB_MOD, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \ + KC_LSFT, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, \ + KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD \ + ), + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + //case COLEMAK: + //if (record->event.pressed) { + //#ifdef AUDIO_ENABLE + //PLAY_NOTE_ARRAY(tone_colemak, false, 0); + //#endif + //persistant_default_layer_set(1UL<<_COLEMAK); + //} + //return false; + //break; + } + return true; +} diff --git a/keyboards/rgbkb/zen/rev1/keymaps/jwlawrence/rules.mk b/keyboards/rgbkb/zen/rev1/keymaps/jwlawrence/rules.mk new file mode 100644 index 00000000000..1e3cebb1451 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/jwlawrence/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/rgbkb/zen/rev1/keymaps/kageurufu/keymap.c b/keyboards/rgbkb/zen/rev1/keymaps/kageurufu/keymap.c new file mode 100644 index 00000000000..75884635cdc --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/kageurufu/keymap.c @@ -0,0 +1,62 @@ +#include QMK_KEYBOARD_H +#include "kageurufu.h" +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif + +extern keymap_config_t keymap_config; +extern uint8_t is_master; + + +#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__) +#define _BASE_LAYOUT( \ + _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \ + _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, _29 \ +) \ +EXPAND_LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, KC_BSLS, \ + FN_ESC, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, KC_QUOT, \ + KC_LSPO, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, KC_RSPC, \ + KC_LCTL, KC_LGUI, KC_LGUI, KC_LALT, FN, KC_SPC, KC_BSPC, KC_ENT, KC_SPC, KC_MINS, KC_EQL, KC_DOWN, KC_PGUP, KC_PGDN \ +) +#define BASE_LAYOUT(...) _BASE_LAYOUT(__VA_ARGS__) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = BASE_LAYOUT( \ + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, \ + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, \ + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ \ + ), + + [_COLEMAK] = BASE_LAYOUT( \ + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, \ + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, \ + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ \ + ), + + [_COLEMAK_DH] = BASE_LAYOUT( \ + ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, \ + ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, \ + ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________ \ + ), + + [_FN] = EXPAND_LAYOUT( \ + ________________FUNCTION_L1________________, ________________FUNCTION_R1________________, \ + ________________FUNCTION_L2________________, ________________FUNCTION_R2________________, \ + ________________FUNCTION_L3________________, ________________FUNCTION_R3________________, \ + ________________FUNCTION_L4________________, ________________FUNCTION_R4________________, \ + ________________FUNCTION_L5________________, _______, KC_DEL, ________________FUNCTION_R5________________ \ + ), + + [_ADJ] = EXPAND_LAYOUT( \ + _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, \ + _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, \ + _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, \ + _________________ADJUST_L4_________________, _________________ADJUST_R4_________________, \ + _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________ \ + ) +}; diff --git a/keyboards/rgbkb/zen/rev1/keymaps/xyverz/config.h b/keyboards/rgbkb/zen/rev1/keymaps/xyverz/config.h new file mode 100644 index 00000000000..d3e21ea1726 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/xyverz/config.h @@ -0,0 +1,32 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +#define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/rgbkb/zen/rev1/keymaps/xyverz/keymap.c b/keyboards/rgbkb/zen/rev1/keymaps/xyverz/keymap.c new file mode 100644 index 00000000000..6250086ed9d --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/xyverz/keymap.c @@ -0,0 +1,172 @@ +/* This is the Zen keyboard layout by Xyverz aka u/Zrevyx on r/mk. + This is pretty much a direct port of my Atreus62 keymap. + + The bottom row is fairly Kinesis-ish since the Contour and Advantage + keyboards have been my daily drivers for the last 17 years. I hope + You can get some enjoyment out of this layout should you chose it! + +CHANGELOG: + + 0.1 - Initial commit. Based off of Profet's default keymap. + +TODO: + + * Figure out how to make the bottom row work best for me. + * Add legends in comments for each layer. Maybe. + +*/ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _DVORAK 0 +#define _QWERTY 1 +#define _COLEMAK 2 +#define _WOW 3 +#define _LOWER 4 +#define _RAISE 5 +#define _ADJUST 16 + +enum atreus52_keycodes { + DVORAK = SAFE_RANGE, + QWERTY, + COLEMAK, + WOW, + LOWER, + RAISE +}; + +// Aliases to make the keymap clearer. +#define CTLBSPC CTL_T(KC_BSPC) // CTRL when held, BSPC when tapped. +#define RGB_SWR RGB_M_SW // Swirl Animation alias +#define RGB_SNK RGB_M_SN // Snake Animation alias +#define ADJUST MO(_ADJUST) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_DVORAK] = LAYOUT( \ + KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ + LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ + ), + + [_QWERTY] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL , \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ + ), + + [_COLEMAK] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL , \ + KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ + ), + + [_WOW] = LAYOUT( \ + KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ + LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, CTLBSPC, KC_LALT, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ + ), + + [_LOWER] = LAYOUT( \ + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ + KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ + KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ + _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ + ), + + [_RAISE] = LAYOUT( \ + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ + KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ + KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_EQL, KC_LBRC, KC_RBRC, _______, \ + _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ + ), + + [_ADJUST] = LAYOUT( \ + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_SNK, _______, QWERTY, COLEMAK, DVORAK, WOW, _______, \ + RGB_TOG, RGB_MOD, RGB_SWR, RGB_M_K, RGB_M_G, RGB_HUI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + +}; + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +void matrix_init_user(void) { + // This will disable the red LEDs on the ProMicros + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DVORAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case WOW: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_WOW); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/rgbkb/zen/rev1/keymaps/xyverz/rules.mk b/keyboards/rgbkb/zen/rev1/keymaps/xyverz/rules.mk new file mode 100644 index 00000000000..1e3cebb1451 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/xyverz/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/zen/rev1/rev1.c b/keyboards/rgbkb/zen/rev1/rev1.c similarity index 100% rename from keyboards/zen/rev1/rev1.c rename to keyboards/rgbkb/zen/rev1/rev1.c diff --git a/keyboards/rgbkb/zen/rev1/rev1.h b/keyboards/rgbkb/zen/rev1/rev1.h new file mode 100644 index 00000000000..a12f2ea789a --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/rev1.h @@ -0,0 +1,37 @@ +#pragma once + +#include "zen.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k55, k54, k53, k52, k51, k50, \ + k10, k11, k12, k13, k14, k15, k65, k64, k63, k62, k61, k60, \ + k20, k21, k22, k23, k24, k25, k75, k74, k73, k72, k71, k70, \ + k30, k31, k32, k33, k34, k35, k85, k84, k83, k82, k81, k80, \ + k40, k41, k42, k43, k44, k45, k46, k96, k95, k94, k93, k92, k91, k90 \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46 }, \ + { k50, k51, k52, k53, k54, k55, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, KC_NO }, \ + { k70, k71, k72, k73, k74, k75, KC_NO }, \ + { k80, k81, k82, k83, k84, k85, KC_NO }, \ + { k90, k91, k92, k93, k94, k95, k96 } \ + } diff --git a/keyboards/rgbkb/zen/rev1/rules.mk b/keyboards/rgbkb/zen/rev1/rules.mk new file mode 100644 index 00000000000..58e9a76b230 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/rules.mk @@ -0,0 +1 @@ +BOOTLOADER = caterina diff --git a/keyboards/rgbkb/zen/rev2/config.h b/keyboards/rgbkb/zen/rev2/config.h new file mode 100644 index 00000000000..c2bb360bdb6 --- /dev/null +++ b/keyboards/rgbkb/zen/rev2/config.h @@ -0,0 +1,84 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3061 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Legonut +#define PRODUCT "Project Zen" +#define DESCRIPTION "Split gaming keyboard" + +/* key matrix size */ +// Rows are doubled-up + +// wiring of each half +#ifdef CONVERT_TO_PROTON_C + #define MATRIX_ROWS 5 + #define MATRIX_COLS 7 +#else + #define MATRIX_ROWS 10 + #define MATRIX_COLS 7 +#endif + +// Proton-C does pin conversion +#define MATRIX_ROW_PINS { C6, E6, B5, D7, B4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B3, B1, B2 } + +#define ENCODERS_PAD_A { D4 } +#define ENCODERS_PAD_B { D2 } + +#define RGB_DI_PIN B6 +#define SOFT_SERIAL_PIN D3 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGBLED_NUM 34 // Number of LEDs +#define RGBLIGHT_ANIMATIONS + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/rgbkb/zen/rev2/info.json b/keyboards/rgbkb/zen/rev2/info.json new file mode 100644 index 00000000000..8ed12de2b4f --- /dev/null +++ b/keyboards/rgbkb/zen/rev2/info.json @@ -0,0 +1,361 @@ +{ + "keyboard_name": "Zen", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + { + "label": "k00", + "x": 0.5, + "y": 0 + }, + { + "label": "k01", + "x": 1.5, + "y": 0 + }, + { + "label": "k02", + "x": 2.5, + "y": 0 + }, + { + "label": "k03", + "x": 3.5, + "y": 0 + }, + { + "label": "k04", + "x": 4.5, + "y": 0 + }, + { + "label": "k05", + "x": 5.5, + "y": 0 + }, + { + "label": "k55", + "x": 10.5, + "y": 0 + }, + { + "label": "k54", + "x": 11.5, + "y": 0 + }, + { + "label": "k53", + "x": 12.5, + "y": 0 + }, + { + "label": "k52", + "x": 13.5, + "y": 0 + }, + { + "label": "k51", + "x": 14.5, + "y": 0 + }, + { + "label": "k50", + "x": 15.5, + "y": 0 + }, + { + "label": "k10", + "x": 0, + "y": 1, + "w": 1.5 + }, + { + "label": "k11", + "x": 1.5, + "y": 1 + }, + { + "label": "k12", + "x": 2.5, + "y": 1 + }, + { + "label": "k13", + "x": 3.5, + "y": 1 + }, + { + "label": "k14", + "x": 4.5, + "y": 1 + }, + { + "label": "k15", + "x": 5.5, + "y": 1 + }, + { + "label": "k65", + "x": 10.5, + "y": 1 + }, + { + "label": "k64", + "x": 11.5, + "y": 1 + }, + { + "label": "k63", + "x": 12.5, + "y": 1 + }, + { + "label": "k62", + "x": 13.5, + "y": 1 + }, + { + "label": "k61", + "x": 14.5, + "y": 1 + }, + { + "label": "k60", + "x": 15.5, + "y": 1, + "w": 1.5 + }, + { + "label": "k20", + "x": 0, + "y": 2, + "w": 1.5 + }, + { + "label": "k21", + "x": 1.5, + "y": 2 + }, + { + "label": "k22", + "x": 2.5, + "y": 2 + }, + { + "label": "k23", + "x": 3.5, + "y": 2 + }, + { + "label": "k24", + "x": 4.5, + "y": 2 + }, + { + "label": "k25", + "x": 5.5, + "y": 2 + }, + { + "label": "k75", + "x": 10.5, + "y": 2 + }, + { + "label": "k74", + "x": 11.5, + "y": 2 + }, + { + "label": "k73", + "x": 12.5, + "y": 2 + }, + { + "label": "k72", + "x": 13.5, + "y": 2 + }, + { + "label": "k71", + "x": 14.5, + "y": 2 + }, + { + "label": "k70", + "x": 15.5, + "y": 2, + "w": 1.5 + }, + { + "label": "k30", + "x": 0, + "y": 3, + "w": 1.5 + }, + { + "label": "k31", + "x": 1.5, + "y": 3 + }, + { + "label": "k32", + "x": 2.5, + "y": 3 + }, + { + "label": "k33", + "x": 3.5, + "y": 3 + }, + { + "label": "k34", + "x": 4.5, + "y": 3 + }, + { + "label": "k35", + "x": 5.5, + "y": 3 + }, + { + "label": "k16", + "x": 6.5, + "y": 3 + }, + { + "label": "k66", + "x": 9.5, + "y": 3 + }, + { + "label": "k85", + "x": 10.5, + "y": 3 + }, + { + "label": "k84", + "x": 11.5, + "y": 3 + }, + { + "label": "k83", + "x": 12.5, + "y": 3 + }, + { + "label": "k82", + "x": 13.5, + "y": 3 + }, + { + "label": "k81", + "x": 14.5, + "y": 3 + }, + { + "label": "k80", + "x": 15.5, + "y": 3, + "w": 1.5 + }, + { + "label": "k40", + "x": 0, + "y": 4, + "w": 1.5 + }, + { + "label": "k41", + "x": 1.5, + "y": 4 + }, + { + "label": "k42", + "x": 2.5, + "y": 4 + }, + { + "label": "k43", + "x": 3.5, + "y": 4 + }, + { + "label": "k44", + "x": 4.5, + "y": 4 + }, + { + "label": "k36", + "x": 6, + "y": 4.5 + }, + { + "label": "k26", + "x": 7, + "y": 4.5 + }, + { + "label": "k76", + "x": 9, + "y": 4.5 + }, + { + "label": "k86", + "x": 10, + "y": 4.5 + }, + { + "label": "k94", + "x": 11.5, + "y": 4 + }, + { + "label": "k93", + "x": 12.5, + "y": 4 + }, + { + "label": "k92", + "x": 13.5, + "y": 4 + }, + { + "label": "k91", + "x": 14.5, + "y": 4 + }, + { + "label": "k90", + "x": 15.5, + "y": 4, + "w": 1.5 + }, + { + "label": "k45", + "x": 6, + "y": 5.5 + }, + { + "label": "k46", + "x": 7, + "y": 5.5 + }, + { + "label": "k96", + "x": 9, + "y": 5.5 + }, + { + "label": "k95", + "x": 10, + "y": 5.5 + } + ] + } + } + } diff --git a/keyboards/rgbkb/zen/rev2/keymaps/debug/keymap.c b/keyboards/rgbkb/zen/rev2/keymaps/debug/keymap.c new file mode 100644 index 00000000000..e2d3d6a3567 --- /dev/null +++ b/keyboards/rgbkb/zen/rev2/keymaps/debug/keymap.c @@ -0,0 +1,19 @@ +#include QMK_KEYBOARD_H +#include + +// extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { { KC_TRNS } } }; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static char buf[10] = " "; + + if (record->event.pressed) { + snprintf(buf, 10, "C%dR%d ", record->event.key.col, record->event.key.row); + + send_string(buf); + } + return false; + + return true; +} diff --git a/keyboards/rgbkb/zen/rev2/keymaps/default/keymap.c b/keyboards/rgbkb/zen/rev2/keymaps/default/keymap.c new file mode 100644 index 00000000000..dba4a2ddd85 --- /dev/null +++ b/keyboards/rgbkb/zen/rev2/keymaps/default/keymap.c @@ -0,0 +1,117 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _NAV +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + NAV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B |RGBPrv||RGBNxt| N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------||------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBTOG| NAV |Space |Delete||Enter |Space | NAV | - | = | PGUP | PGDN | + * `----------------------------------+-------------''------------------------------------------------' + * |Space |Delete||Enter |Space | + * '-------------''-------------' + */ + [_QWERTY] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + LT(_NAV, KC_CAPS),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, RGB_RMOD,RGB_MOD, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, KC_PGUP, KC_PGDN, \ + KC_SPC, KC_DEL, KC_ENT, KC_SPACE \ + ), + + /* NAV + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | || | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------||------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBTOG| NAV |Space |Delete||Enter |Space | NAV | - | = | PGUP | PGDN | + * `----------------------------------+-------------''------------------------------------------------' + * |Space |Delete||Enter |Space | + * '-------------''-------------' + */ + [_NAV] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \ + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD, \ + _______, _______, _______, _______ + ), + +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { /* Second encoder from slave */ + if (clockwise) { + tap_code(KC_UP); + } else { + tap_code(KC_DOWN); + } + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(1UL<<_QWERTY); + } + return false; + break; + //case COLEMAK: + //if (record->event.pressed) { + //set_single_persistent_default_layer(1UL<<_COLEMAK); + //} + //return false; + //break; + } + return true; +} + + +#if OLED_DRIVER_ENABLE +const char* layer_name_user(uint32_t layer) { + switch (layer) { + case _QWERTY: + return PSTR("QWRTY"); + case _NAV: + return PSTR("NAV\n"); + default: + return PSTR("UNDEF"); + } +} +#endif diff --git a/keyboards/rgbkb/zen/rev2/rev2.c b/keyboards/rgbkb/zen/rev2/rev2.c new file mode 100644 index 00000000000..28a5a9f203d --- /dev/null +++ b/keyboards/rgbkb/zen/rev2/rev2.c @@ -0,0 +1,66 @@ +#include "rev2.h" + +#ifdef OLED_DRIVER_ENABLE +#include "split_util.h" +#include "oled_driver.h" + +__attribute__((weak)) +void render_logo(void) { + static const char PROGMEM sol_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + + oled_write_P(sol_logo, false); +} + +__attribute__((weak)) +const char* layer_name_user(uint32_t layer) { + switch (layer) { + default: + return PSTR("UNDEF\n"); + } +} + +__attribute__((weak)) +void render_status(void) { + // Setup for 270 degree rendering because it's awesome! + // It can house 16 lines of text, with 5 letters each line + // Render to mode icon + static const char PROGMEM mode_logo[2][4] = { + {0x97,0x98,0x0a,0}, + {0xb7,0xb8,0x0a,0} }; + + oled_write_P(mode_logo[0], false); // Line 1 + oled_write_P(mode_logo[1], false); // Line 2 + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + oled_set_cursor(0, 3); // Line 3 + oled_write_P(PSTR("Layer"), false); // Line 4 + oled_write_P(layer_name_user(biton32(layer_state)), false); + + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_set_cursor(0, oled_max_lines() - 4); // Line 13 + oled_write_P(led_usb_state & (1< +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#ifdef CONVERT_TO_PROTON_C + #define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k55, k54, k53, k52, k51, k50, \ + k10, k11, k12, k13, k14, k15, k65, k64, k63, k62, k61, k60, \ + k20, k21, k22, k23, k24, k25, k75, k74, k73, k72, k71, k70, \ + k30, k31, k32, k33, k34, k35, k16, k66, k85, k84, k83, k82, k81, k80, \ + k40, k41, k42, k43, k44, k36, k26, k76, k86, k94, k93, k92, k91, k90, \ + k45, k46, k96, k95 \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, k16 }, \ + { k20, k21, k22, k23, k24, k25, k26 }, \ + { k30, k31, k32, k33, k34, k35, k36 }, \ + { k40, k41, k42, k43, k44, k45, k46 } \ + } +#else + #define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k55, k54, k53, k52, k51, k50, \ + k10, k11, k12, k13, k14, k15, k65, k64, k63, k62, k61, k60, \ + k20, k21, k22, k23, k24, k25, k75, k74, k73, k72, k71, k70, \ + k30, k31, k32, k33, k34, k35, k16, k66, k85, k84, k83, k82, k81, k80, \ + k40, k41, k42, k43, k44, k36, k26, k76, k86, k94, k93, k92, k91, k90, \ + k45, k46, k96, k95 \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, k16 }, \ + { k20, k21, k22, k23, k24, k25, k26 }, \ + { k30, k31, k32, k33, k34, k35, k36 }, \ + { k40, k41, k42, k43, k44, k45, k46 }, \ + { k50, k51, k52, k53, k54, k55, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66 }, \ + { k70, k71, k72, k73, k74, k75, k76 }, \ + { k80, k81, k82, k83, k84, k85, k86 }, \ + { k90, k91, k92, k93, k94, k95, k96 } \ + } +#endif diff --git a/keyboards/rgbkb/zen/rev2/rules.mk b/keyboards/rgbkb/zen/rev2/rules.mk new file mode 100644 index 00000000000..e9d19a69aa9 --- /dev/null +++ b/keyboards/rgbkb/zen/rev2/rules.mk @@ -0,0 +1,9 @@ +ENCODER_ENABLE = yes + +OLED_DRIVER_ENABLE = no + +# Setup so that OLED can be turned on/off easily +ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) + # Custom local font file + OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" +endif diff --git a/keyboards/rgbkb/zen/rules.mk b/keyboards/rgbkb/zen/rules.mk new file mode 100644 index 00000000000..7473b61cfc5 --- /dev/null +++ b/keyboards/rgbkb/zen/rules.mk @@ -0,0 +1,42 @@ +# Pro Micro or Elite-C +# Automagically converted to Proton-C +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +BOOTLOADER = dfu +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +ifeq ($(strip $(CTPC)), yes) + CONVERT_TO_PROTON_C=yes +endif + +ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes) + SPLIT_KEYBOARD = no # currently unsupported on ARM + RGBLIGHT_ENABLE = no # currently unsupported on ARM + + EXTRAFLAGS += -DUSE_PROTON_C +else + # Currently moved to Pro Micro only section because of lack of Proton-C support + SPLIT_KEYBOARD = yes + RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +endif + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID + +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +DEFAULT_FOLDER = rgbkb/zen/rev2 diff --git a/keyboards/zen/zen.c b/keyboards/rgbkb/zen/zen.c similarity index 100% rename from keyboards/zen/zen.c rename to keyboards/rgbkb/zen/zen.c diff --git a/keyboards/rgbkb/zen/zen.h b/keyboards/rgbkb/zen/zen.h new file mode 100644 index 00000000000..e51c3c831f7 --- /dev/null +++ b/keyboards/rgbkb/zen/zen.h @@ -0,0 +1,8 @@ +#pragma once + +#if KEYBOARD_rgbkb_zen_rev1 + #include "rev1.h" +#elif KEYBOARD_rgbkb_zen_rev2 + #include "rev2.h" +#endif +#include "quantum.h" diff --git a/keyboards/rgbkb/zygomorph/common/glcdfont.c b/keyboards/rgbkb/zygomorph/common/glcdfont.c new file mode 100644 index 00000000000..89665ba0743 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/common/glcdfont.c @@ -0,0 +1,244 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x03, 0x07, 0x1F, 0x7F, 0xFF, 0xFF, + 0xFE, 0xF8, 0xF0, 0xC0, 0x20, 0xF8, + 0xFE, 0xFF, 0xFE, 0x79, 0x27, 0x1F, + 0x7F, 0xFF, 0xFF, 0xFE, 0xF8, 0xF0, + 0xC0, 0x20, 0xF8, 0xFE, 0xFF, 0xFF, + 0x7F, 0x3F, 0x3F, 0x7F, 0xFF, 0xFE, + 0xF8, 0xF0, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x7F, 0x7F, 0x7F, + 0xBF, 0xBF, 0xC0, 0xC0, 0xC0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, + 0xF8, 0x78, 0x78, 0x7C, 0x3C, 0x3C, + 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0xBF, 0xBF, 0xDF, 0xDF, 0xEF, 0xEF, + 0x00, 0x03, 0x07, 0x1F, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFE, 0xF8, 0xE0, 0xC0, + 0xE0, 0xF8, 0xFE, 0xFF, 0xFF, 0xFF, + 0x7F, 0x1F, 0x07, 0x03, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC1, 0xF3, + 0xCF, 0xBF, 0x7F, 0xFF, 0xFF, 0xFC, + 0xFB, 0xE7, 0x81, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xE3, 0xCF, 0x3F, 0xFF, + 0xFF, 0xFF, 0xFC, 0xFB, 0xE7, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x81, 0xE7, + 0xFF, 0xFF, 0xFF, 0xFF, 0x3C, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF8, 0xF8, 0xFC, 0x7C, 0x7E, + 0x7E, 0x3E, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF7, 0xF7, 0xF7, 0xFB, + 0xFB, 0x7D, 0x7D, 0x7D, 0xBE, 0xBE, + 0xBE, 0xDF, 0xDF, 0xE0, 0xE0, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0xFC, 0xFC, 0x7C, 0x7E, 0x7E, + 0x3E, 0x3E, 0x1F, 0x1F, 0x1F, 0x0F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, + 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x70, 0x7C, 0x7F, 0x7F, 0x7F, + 0x7F, 0x1F, 0x06, 0x01, 0x03, 0x0F, + 0x3F, 0x7F, 0x7F, 0x7E, 0x7C, 0x7C, + 0x7E, 0x7F, 0x7F, 0x7F, 0x1F, 0x06, + 0x01, 0x07, 0x0F, 0x3F, 0x7F, 0x7F, + 0x7E, 0x7C, 0x7C, 0x7E, 0x7F, 0x7F, + 0x3F, 0x0F, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x7D, 0x7D, 0x3D, 0x3E, + 0x1E, 0x1F, 0x1F, 0x1F, 0x0F, 0x0F, + 0x07, 0x07, 0x07, 0x03, 0x03, 0x00, + 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, + 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x00, + 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x00, 0x40, 0x70, 0x78, 0x7E, 0x7F, + 0x7F, 0x7F, 0x3F, 0x0F, 0x03, 0x01, + 0x03, 0x0F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7E, 0x78, 0x70, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +#endif // FONT5X7_H diff --git a/keyboards/rgbkb/zygomorph/config.h b/keyboards/rgbkb/zygomorph/config.h new file mode 100644 index 00000000000..93fd2261b18 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/config.h @@ -0,0 +1,22 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + diff --git a/keyboards/rgbkb/zygomorph/keymaps/5x6pad/keymap.c b/keyboards/rgbkb/zygomorph/keymaps/5x6pad/keymap.c new file mode 100644 index 00000000000..c6138b43a3f --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/5x6pad/keymap.c @@ -0,0 +1,282 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "common/ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _MACROPAD, + _FN, + _ADJ +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + MACROPAD, + FN, + ADJ, + BACKLIT, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + + +#define FN_ESC LT(_FN, KC_ESC) +#define FN_CAPS LT(_FN, KC_CAPS) +// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns + +#define BASE_LAYOUT( \ + _00, _01, _02, _03, _04, \ + _10, _11, _12, _13, _14, \ + _20, _21, _22, _23, _24, \ + _30, _31, _32, _33, _34 \ +) \ +LAYOUT_ortho_5x6( \ + KC_GESC, _00, _01, _02, _03, _04, \ + KC_TAB, _10, _11, _12, _13, _14, \ + FN_CAPS, _20, _21, _22, _23, _24, \ + KC_LSFT, _30, _31, _32, _33, _34, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC \ +) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = BASE_LAYOUT( \ + KC_1, KC_2, KC_3, KC_4, KC_5, \ + KC_Q, KC_W, KC_E, KC_R, KC_T, \ + KC_A, KC_S, KC_D, KC_F, KC_G, \ + KC_Z, KC_X, KC_C, KC_V, KC_B \ + ), + + [_MACROPAD] = BASE_LAYOUT( \ + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, \ + KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, \ + KC_A, KC_S, KC_D, KC_F, KC_G, \ + KC_Z, KC_X, KC_C, KC_V, KC_B \ + ), + + [_FN] = LAYOUT_ortho_5x6( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, \ + _______, KC_PGDN, KC_UP, KC_PGUP, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, \ + _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, RGB_MOD, _______, _______ \ + ), + + [_ADJ] = LAYOUT_ortho_5x6( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, \ + _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______, \ + _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, RGB_MOD, _______, _______ \ + ) +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +// Setting ADJ layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case MACROPAD: + if(record->event.pressed) { + set_single_persistent_default_layer(_MACROPAD); + } + return false; + break; + case FN: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(15); + #endif + } + layer_on(_FN); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_FN); + TOG_STATUS = false; + } + return false; + break; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// hook point for 'led_test' keymap +// 'default' keymap's led_test_init() is empty function, do nothing +// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); +__attribute__ ((weak)) +void led_test_init(void) {} + +void matrix_scan_user(void) { + led_test_init(); + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_FN (1<<_FN) +#define L_ADJ (1<<_ADJ) + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + + + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(matrix, PSTR("\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, PSTR("Default")); + break; + case L_FN: + matrix_write_P(matrix, PSTR("FN")); + break; + case L_ADJ: + case L_ADJ_TRI: + matrix_write_P(matrix, PSTR("ADJ")); + break; + default: + matrix_write(matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + + +// place overrides here + diff --git a/keyboards/rgbkb/zygomorph/keymaps/default/keymap.c b/keyboards/rgbkb/zygomorph/keymaps/default/keymap.c new file mode 100644 index 00000000000..f236e20a438 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/default/keymap.c @@ -0,0 +1,167 @@ +#include QMK_KEYBOARD_H + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _FN, + _ADJ +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + FN, + ADJ, + RGBRST +}; + +#define FN_CAPS LT(_FN, KC_CAPS) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* / QWERTY \ + * /-----------------------------------------\ /-----------------------------------------\ + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |FNCAPS| A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| | Space| FN | Left | Down | Up |Right | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ + [_QWERTY] = LAYOUT_ortho_5x12( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT \ + ), + + /* / Colemak \ + * /-----------------------------------------\ /-----------------------------------------\ + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | F | P | B | | J | L | U | Y | ; | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |FNCAPS| A | R | S | T | G | | K | N | E | I | O | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | Z | X | C | D | V | | M | H | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| | Space| FN | Left | Down | Up |Right | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ + [_COLEMAK] = LAYOUT_ortho_5x12( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, \ + FN_CAPS, KC_A, KC_R, KC_S, KC_T, KC_G, KC_K, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_M, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT \ + ), + + /* / FN \ + * /-----------------------------------------\ /-----------------------------------------\ + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | PGDN | UP | PGUP | | | | | PGDN | UP | PGUP | PRINT| HOME | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | | | LEFT | DOWN | RIGHT|INSERT| END | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |RGBMOD| | | | | PLAY | NEXT | MUTE | VOL- | VOL+ | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ + [_FN] = LAYOUT_ortho_5x12( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, KC_PGDN, KC_UP, KC_PGUP, _______, _______, _______, KC_PGDN, KC_UP, KC_PGUP, KC_PSCR, KC_HOME, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, RGB_MOD, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU \ + ), + + /* / ADJ \ + * /-----------------------------------------\ /-----------------------------------------\ + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | SAD | VAI | SAI | RESET| | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | HUD | VAD | HUI |RGBRST| | | |QWERTY|COLEMK| | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | |RGBTOG| HUI | SAI | VAI | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |RGBNXT| | | | | |RGBPRV| HUD | SAD | VAD | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ + [_ADJ] = LAYOUT_ortho_5x12( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______, _______, QWERTY, COLEMAK, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, RGB_MOD, _______, _______, _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + ) +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { /* Second encoder from slave */ + if (clockwise) { + tap_code(KC_UP); + } else { + tap_code(KC_DOWN); + } + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if(record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case FN: + if (record->event.pressed) { + layer_on(_FN); + } else { + layer_off(_FN); + } + return false; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + case RGBRST: +#ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } +#endif + break; + } + return true; +} diff --git a/keyboards/rgbkb/zygomorph/keymaps/default/readme.md b/keyboards/rgbkb/zygomorph/keymaps/default/readme.md new file mode 100644 index 00000000000..e1d30b36b6a --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/default/readme.md @@ -0,0 +1,121 @@ +# The Default Zygomorph Layout +## Layout + +### Base modifier layout +``` + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | | | | | | | | | | | BkSp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | | | | | | | | | | | | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |FN(CAPS)| | | | | | | | | | | | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | | | | | | | | | | | |Shift | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| | Space| FN | Left | Down | Up |Right | + * `-----------------------------------------' `-----------------------------------------' +``` + +### Qwerty alphas +``` + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Q | W | E | R | T | | Y | U | I | O | P | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | A | S | D | F | G | | H | J | K | L | ; | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Z | X | C | V | B | | N | M | , | . | / | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' +``` + +### Colemak alphas +``` + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Q | W | F | P | G | | J | L | U | Y | ; | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | A | R | S | T | D | | H | N | E | I | O | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Z | X | C | V | B | | K | M | , | . | / | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' +``` + +### Function (FN) +``` + * ,-----------------------------------------. ,-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | PGDN | UP | PGUP | | | | | PGDN | UP | PGUP | PRINT| HOME | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | | | LEFT | DOWN | RIGHT|INSERT| END | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |RGBMOD| | | | | PLAY | NEXT | MUTE | VOL- | VOL+ | + * `-----------------------------------------' `-----------------------------------------' +``` + +### Adjust (ADJ) +``` + * ,-----------------------------------------. ,-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | SAD | VAI | SAI | RESET| | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | HUD | VAD | HUI |RGBRST| | | |QWERTY|COLEMK| | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | |RGBTOG| HUI | SAI | VAI | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |RGBMOD| | | | | |RGBRMOD| HUD | SAD | VAD | + * `-----------------------------------------' `-----------------------------------------' +``` + +## Customize + +see `qmk_firmware/keyboards/zygomorph/rev1/keymaps/default/rules.mk` + +``` + +# Variables you can set for Zygomorph + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable global lighting effects. Do not enable with RGB Matrix +RGBLIGHT_ANIMATIONS = yes # LED animations +RGB_MATRIX_ENABLE = no # Enable per-key coordinate based RGB effects. Do not enable with RGBlight (+8500) +RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy (+1500) +RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port +UNICODE_ENABLE = no # Unicode +SWAP_HANDS_ENABLE = no # Enable one-hand typing +ENCODER_ENABLE = yes # Enable rotary encoder (+90) +OLED_DRIVER_ENABLE = yes # Enable the OLED Driver (+5000) +IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) + + +``` +## Compile + +go to qmk top directory. +``` +$ cd qmk_firmware +``` + +build +``` +$ make rgbkb/zygomorph:default +``` + +After the initial flash with AVRdudess, you should be able to flash using this: +``` +$ make rgbkb/zygomorph:default:dfu +``` diff --git a/keyboards/rgbkb/zygomorph/keymaps/default/rules.mk b/keyboards/rgbkb/zygomorph/keymaps/default/rules.mk new file mode 100644 index 00000000000..55d52d58e57 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/default/rules.mk @@ -0,0 +1,42 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable global lighting effects. Do not enable with RGB Matrix +RGBLIGHT_ANIMATIONS = yes # LED animations +RGBLIGHT_SPLIT_ENABLE = no # Split RGBLight Support +RGB_MATRIX_ENABLE = no # Enable per-key coordinate based RGB effects. Do not enable with RGBlight +RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. +RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port +UNICODE_ENABLE = no # Unicode +SWAP_HANDS_ENABLE = no # Enable one-hand typing +ENCODER_ENABLE = yes # Enable rotary encoder +OLED_DRIVER_ENABLE = no # Enable the OLED Driver +IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) +LINK_TIME_OPTIMIZATION_ENABLE = no # Enable optimizations to reduce firmware size. Also disables action macros and functions. + +# Do not edit past here + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) + OPT_DEFS += -DRGBLIGHT_FULL_POWER +endif + +ifeq ($(strip $(RGB_MATRIX_KEYPRESSES)), yes) + OPT_DEFS += -DRGB_MATRIX_KEYPRESSES +endif + +ifeq ($(strip $(RGBLIGHT_ANIMATIONS)), yes) + OPT_DEFS += -DRGBLIGHT_ANIMATIONS +endif + +ifeq ($(strip $(RGBLIGHT_SPLIT_ENABLE)), yes) + OPT_DEFS += -DRGBLIGHT_SPLIT_ENABLE +endif diff --git a/keyboards/rgbkb/zygomorph/keymaps/default_oled/config.h b/keyboards/rgbkb/zygomorph/keymaps/default_oled/config.h new file mode 100644 index 00000000000..452cdda8235 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/default_oled/config.h @@ -0,0 +1,25 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + + +// place overrides here + diff --git a/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c b/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c new file mode 100644 index 00000000000..d313bec8b09 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c @@ -0,0 +1,233 @@ +#include QMK_KEYBOARD_H + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _FN, + _ADJ +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + FN, + ADJ, + RGBRST +}; + +#define FN_CAPS LT(_FN, KC_CAPS) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* / QWERTY \ + * /-----------------------------------------\ /-----------------------------------------\ + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | O | P | \ | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |FNCAPS| A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | | N | M | , | . | / |Shift | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| | Space| FN | Left | Down | Up |Right | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ + [_QWERTY] = LAYOUT_ortho_5x12( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT \ + ), + + /* / Colemak \ + * /-----------------------------------------\ /-----------------------------------------\ + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | F | P | B | | J | L | U | Y | ; | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |FNCAPS| A | R | S | T | G | | K | N | E | I | O | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | Z | X | C | D | V | | M | H | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| | Space| FN | Left | Down | Up |Right | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ + [_COLEMAK] = LAYOUT_ortho_5x12( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, \ + FN_CAPS, KC_A, KC_R, KC_S, KC_T, KC_G, KC_K, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_M, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT \ + ), + + /* / FN \ + * /-----------------------------------------\ /-----------------------------------------\ + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | PGDN | UP | PGUP | | | | | PGDN | UP | PGUP | PRINT| HOME | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | | | LEFT | DOWN | RIGHT|INSERT| END | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |RGBMOD| | | | | PLAY | NEXT | MUTE | VOL- | VOL+ | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ + [_FN] = LAYOUT_ortho_5x12( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, KC_PGDN, KC_UP, KC_PGUP, _______, _______, _______, KC_PGDN, KC_UP, KC_PGUP, KC_PSCR, KC_HOME, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, RGB_MOD, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU \ + ), + + /* / ADJ \ + * /-----------------------------------------\ /-----------------------------------------\ + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | SAD | VAI | SAI | RESET| | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | HUD | VAD | HUI |RGBRST| | | |QWERTY|COLEMK| | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | |RGBTOG| HUI | SAI | VAI | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |RGBNXT| | | | | |RGBPRV| HUD | SAD | VAD | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ + [_ADJ] = LAYOUT_ortho_5x12( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______, _______, QWERTY, COLEMAK, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, RGB_MOD, _______, _______, _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + ) +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { /* Second encoder from slave */ + if (clockwise) { + tap_code(KC_UP); + } else { + tap_code(KC_DOWN); + } + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if(record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case FN: + if (record->event.pressed) { + layer_on(_FN); + } else { + layer_off(_FN); + } + return false; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + case RGBRST: +#ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } +#endif + break; + } + return true; +} + + +// SSD1306 OLED driver logic +#ifdef OLED_DRIVER_ENABLE + +static void render_logo(void) { + static const char PROGMEM rgbkb_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + + oled_write_P(rgbkb_logo, false); +} + +static void render_status(void) { + // Render to mode icon + static const char PROGMEM mode_logo[4][4] = { + {0x95,0x96,0}, + {0xb5,0xb6,0}, + {0x97,0x98,0}, + {0xb7,0xb8,0} }; + + if (keymap_config.swap_lalt_lgui != false) { + oled_write_ln_P(mode_logo[0], false); + oled_write_ln_P(mode_logo[1], false); + } else { + oled_write_ln_P(mode_logo[2], false); + oled_write_ln_P(mode_logo[3], false); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + oled_write_P(PSTR("Layer: "), false); + switch (biton32(layer_state)) { + case _QWERTY: + oled_write_ln_P(PSTR("QWERTY"), false); + break; + case _COLEMAK: + oled_write_ln_P(PSTR("Colemak"), false); + break; + case _FN: + oled_write_ln_P(PSTR("Function"), false); + break; + case _ADJ: + oled_write_ln_P(PSTR("Adjust"), false); + break; + default: + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(led_usb_state & (1< +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here + diff --git a/keyboards/rgbkb/zygomorph/keymaps/kageurufu/keymap.c b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/keymap.c new file mode 100644 index 00000000000..29702b614ab --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/keymap.c @@ -0,0 +1,84 @@ +#include QMK_KEYBOARD_H +#include "kageurufu.h" + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +#define FN_CAPS LT(_FN, KC_CAPS) + +// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns + /* / Base Layout \ + * /-----------------------------------------\ /-----------------------------------------\ + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | | | | | | | | | | | | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |FNCAPS| | | | | | | | | | | | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | | | | | | | | | | | |Shift | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| | Space| FN | Left | Down | Up |Right | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ +#define EXPAND_LAYOUT(...) LAYOUT_ortho_5x12(__VA_ARGS__) +#define _BASE_LAYOUT( \ + _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \ + _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, _29 \ +) \ +EXPAND_LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, KC_BSLS, \ + FN_CAPS, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, KC_QUOT, \ + KC_LSFT, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ +) +#define BASE_LAYOUT(...) _BASE_LAYOUT(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = BASE_LAYOUT( \ + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, \ + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, \ + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ \ + ), + + [_COLEMAK] = BASE_LAYOUT( \ + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, \ + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, \ + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ \ + ), + + [_FN] = EXPAND_LAYOUT( \ + ________________FUNCTION_L1________________, ________________FUNCTION_R1________________, \ + ________________FUNCTION_L2________________, ________________FUNCTION_R2________________, \ + ________________FUNCTION_L3________________, ________________FUNCTION_R3________________, \ + ________________FUNCTION_L4________________, ________________FUNCTION_R4________________, \ + ________________FUNCTION_L5________________, ________________FUNCTION_R5________________ \ + ), + + [_ADJ] = EXPAND_LAYOUT( \ + _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, \ + _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, \ + _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, \ + _________________ADJUST_L4_________________, _________________ADJUST_R4_________________, \ + _________________ADJUST_L5_________________, _________________ADJUST_R5_________________ \ + ) +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { /* Second encoder from slave */ + if (clockwise) { + tap_code(KC_UP); + } else { + tap_code(KC_DOWN); + } + } +} diff --git a/keyboards/rgbkb/zygomorph/keymaps/kageurufu/readme.md b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/readme.md new file mode 100644 index 00000000000..77e88a078fe --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/readme.md @@ -0,0 +1,132 @@ +# The Default Zygomorph Layout +## Layout + +### Base modifier layout +``` + * ,------------------------------------------------. ,------------------------------------------------. + * | GESC | | | | | | - | | = | | | | | | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | | | | | | [ | | ] | | | | | | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * |FN(CAPS)| | | | | | ( | | ) | | | | | | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | | | | | | { | | } | | | | | |Shift | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| DEL | | Enter| Space| FN | Left | Down | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Space| DEL | | Enter| Space| + * `-------------' `-------------' +``` + +### Qwerty alphas +``` + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | E | R | T | | | | Y | U | I | O | P | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | S | D | F | G | | | | H | J | K | L | ; | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | V | B | | | | N | M | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' +``` + +### Colemak alphas +``` + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | F | P | B | | | | J | L | U | Y | ; | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | R | S | T | G | | | | K | N | E | I | O | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | D | V | | | | M | H | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' +``` + +### Function (FN) +``` + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | PGDN | UP | PGUP | | | | | | | PGDN | UP | PGUP | PRINT| HOME | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | | | | | LEFT | DOWN | RIGHT|INSERT| END | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |RGBMOD| | | | | | | PLAY | NEXT | MUTE | VOL- | VOL+ | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' +``` + +### Adjust (ADJ) +``` + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | SAD | VAI | SAI | RESET| | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | HUD | VAD | HUI |RGBRST| | | | | |QWERTY|COLEMK| | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | |RGBTOG| HUI | SAI | VAI | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |RGBMOD| | | | | | | |RGBSMOD| HUD | SAD | VAD | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' +``` + +## Customize + +see `qmk_firmware/keyboards/sol/rev1/keymaps/default/rules.mk` + +``` + +# Variables you can set for SOL + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable global lighting effects. Do not enable with RGB Matrix +LED_ANIMATIONS = yes # LED animations +RGB_MATRIX_ENABLE = no # Enable per-key coordinate based RGB effects. Do not enable with RGBlight (+8500) +RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy (+1500) +RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port +UNICODE_ENABLE = no # Unicode +SWAP_HANDS_ENABLE = no # Enable one-hand typing +ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) + +OLED_ENABLE = no # OLED_ENABLE (+5000) +IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) + + +``` +## Compile + +go to qmk top directory. +``` +$ cd qmk_firmware +``` + +build +``` +$ make rgbkb/sol:default +``` + +After the initial flash with AVRdudess, you should be able to flash using this: +``` +$ make rgbkb/sol:default:dfu +``` diff --git a/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk new file mode 100644 index 00000000000..61c7a07d6eb --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk @@ -0,0 +1,44 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable global lighting effects. Do not enable with RGB Matrix +RGBLIGHT_ANIMATIONS = yes # LED animations +RGBLIGHT_SPLIT_ENABLE = no # Split RGBLight Support +RGB_MATRIX_ENABLE = no # Enable per-key coordinate based RGB effects. Do not enable with RGBlight +RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. +RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port +UNICODE_ENABLE = no # Unicode +SWAP_HANDS_ENABLE = no # Enable one-hand typing +ENCODER_ENABLE = yes # Enable rotary encoder +OLED_DRIVER_ENABLE = no # Enable the OLED Driver +IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) + +# Do not edit past here + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) + OPT_DEFS += -DRGBLIGHT_FULL_POWER +endif + +ifeq ($(strip $(RGB_MATRIX_KEYPRESSES)), yes) + OPT_DEFS += -DRGB_MATRIX_KEYPRESSES +endif + +ifeq ($(strip $(RGBLIGHT_ANIMATIONS)), yes) + OPT_DEFS += -DRGBLIGHT_ANIMATIONS +endif + +ifeq ($(strip $(RGBLIGHT_SPLIT_ENABLE)), yes) + OPT_DEFS += -DRGBLIGHT_SPLIT_ENABLE +endif + +# Link time optimization, should save on firmware size +EXTRAFLAGS += -flto diff --git a/keyboards/rgbkb/zygomorph/keymaps/xulkal/keymap.c b/keyboards/rgbkb/zygomorph/keymaps/xulkal/keymap.c new file mode 100644 index 00000000000..70155e1cdca --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/xulkal/keymap.c @@ -0,0 +1,69 @@ +#include QMK_KEYBOARD_H +#include "xulkal.h" + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +#define EXPAND_LAYOUT(...) LAYOUT_ortho_5x12(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* / QWERTY \ + * /-----------------------------------------\ /-----------------------------------------\ + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |FN(CAPS)| A | S | D | F | G | | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Sft[ | Z | X | C | V | B | | N | M | , | . | / | Sft] | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctl- | Win | LOWER| RAISE| Alt | Space| | Space| Left | Up | Down | Right| Ctl= | + * \------+------+------+------+------+------/ \------+------+------+------+------+------/ + */ + [_QWERTY] = EXPAND_LAYOUT( \ + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, \ + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, \ + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, \ + _________________QWERTY_L4_________________, _________________QWERTY_R4_________________, \ + _________________QWERTY_L5_________________, _________________QWERTY_R5_________________ \ + ), + +#ifndef GAMELAYER_DISABLE + [_GAME] = EXPAND_LAYOUT( \ + ___________________GAME_L1_________________, ___________________GAME_R1_________________, \ + ___________________GAME_L2_________________, ___________________GAME_R2_________________, \ + ___________________GAME_L3_________________, ___________________GAME_R3_________________, \ + ___________________GAME_L4_________________, ___________________GAME_R4_________________, \ + ___________________GAME_L5_________________, ___________________GAME_R5_________________ \ + ), +#endif + + [_LOWER] = EXPAND_LAYOUT( \ + __________________LOWER_L1_________________, __________________LOWER_R1_________________, \ + __________________LOWER_L2_________________, __________________LOWER_R2_________________, \ + __________________LOWER_L3_________________, __________________LOWER_R3_________________, \ + __________________LOWER_L4_________________, __________________LOWER_R4_________________, \ + __________________LOWER_L5_________________, __________________LOWER_R5_________________ \ + ), + + [_RAISE] = EXPAND_LAYOUT( \ + __________________RAISE_L1_________________, __________________RAISE_R1_________________, \ + __________________RAISE_L2_________________, __________________RAISE_R2_________________, \ + __________________RAISE_L3_________________, __________________RAISE_R3_________________, \ + __________________RAISE_L4_________________, __________________RAISE_R4_________________, \ + __________________RAISE_L5_________________, __________________RAISE_R5_________________ \ + ), + +#ifdef TRILAYER_ENABLED + [_ADJUST] = EXPAND_LAYOUT( \ + _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, \ + _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, \ + _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, \ + _________________ADJUST_L4_________________, _________________ADJUST_R4_________________, \ + _________________ADJUST_L5_________________, _________________ADJUST_R5_________________ \ + ), +#endif +}; diff --git a/keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk b/keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk new file mode 100644 index 00000000000..dc687cbbd34 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk @@ -0,0 +1,42 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# + +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable global lighting effects. Do not enable with RGB Matrix +RGBLIGHT_ANIMATIONS = yes # LED animations +RGBLIGHT_SPLIT_ENABLE = yes # Split RGBLight Support +RGB_MATRIX_ENABLE = no # Enable per-key coordinate based RGB effects. Do not enable with RGBlight +RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. +RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port +UNICODE_ENABLE = no # Unicode +SWAP_HANDS_ENABLE = no # Enable one-hand typing +ENCODER_ENABLE = no # Enable rotary encoder +OLED_DRIVER_ENABLE = no # Enable the OLED Driver +IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) +LINK_TIME_OPTIMIZATION_ENABLE = no # Enable optimizations to reduce firmware size. Also disables action macros and functions. + +# Do not edit past here + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) + OPT_DEFS += -DRGBLIGHT_FULL_POWER +endif + +ifeq ($(strip $(RGB_MATRIX_KEYPRESSES)), yes) + OPT_DEFS += -DRGB_MATRIX_KEYPRESSES +endif + +ifeq ($(strip $(RGBLIGHT_ANIMATIONS)), yes) + OPT_DEFS += -DRGBLIGHT_ANIMATIONS +endif + +ifeq ($(strip $(RGBLIGHT_SPLIT_ENABLE)), yes) + OPT_DEFS += -DRGBLIGHT_SPLIT_ENABLE +endif diff --git a/keyboards/rgbkb/zygomorph/readme.md b/keyboards/rgbkb/zygomorph/readme.md new file mode 100644 index 00000000000..72ca737d35f --- /dev/null +++ b/keyboards/rgbkb/zygomorph/readme.md @@ -0,0 +1,15 @@ +# Zygomorph + +![Zygomorph](https://cdn.shopify.com/s/files/1/0008/8827/5005/products/20190107_004053_2048x2048.jpg?v=1549333933) + +Zygomorph is the thinnest keyboard with a fully enclosed case. It's only 3.2mm thick below the switches, including screws. It can be used in 5x6 and 4x6 split, or 5x12 and 4x12 combined. It has per-key RGB, supports Kailh Choc and MX switches, and has 10 rotary encoder positions per half (only one can be used per half). The board has pre-soldered components, including type C ports and ATmega32U4. The build guide can be found [here](https://rgbkb.gitbook.io/rgbkb-build-guides/zygomorph-build-guide/). + +Keyboard Maintainer: [Legonut](https://github.com/Legonut) +Hardware Supported: Zygomorph R1.0 +Hardware Availability: [RGBKB](https://www.rgbkb.net) + +Make example for this keyboard (after setting up your build environment): + + make rgbkb/zygomorph:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/rgbkb/zygomorph/rev1/config.h b/keyboards/rgbkb/zygomorph/rev1/config.h new file mode 100644 index 00000000000..6e55a6a5f5d --- /dev/null +++ b/keyboards/rgbkb/zygomorph/rev1/config.h @@ -0,0 +1,100 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER RGBKB +#define PRODUCT Zygomorph +#define DESCRIPTION "RGB, thin, ortholinear" + +/* Select hand configuration */ +#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_ROW_PINS { F1, F5, F7, B5, B4 } + +// wiring of each half +#define MATRIX_COLS 6 +#define MATRIX_COL_PINS { F4, F6, C7, C6, B6, D4 } + +#define SOFT_SERIAL_PIN D3 + +#define ENCODERS_PAD_A { D2 } +#define ENCODERS_PAD_B { D7 } + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B7 +#ifndef RGBLIGHT_SPLIT_ENABLE + #define RGBLED_NUM 30 +#else + #define RGBLED_NUM 60 + #define RGBLED_SPLIT { 30, 30 } +#endif +#define DRIVER_LED_TOTAL 30 + +#ifdef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 40 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 40 +#elif RGBLIGHT_FULL_POWER + #define RGBLIGHT_LIMIT_VAL 255 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 +#else + #define RGBLIGHT_LIMIT_VAL 120 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 +#endif + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for Helix keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 500 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/rgbkb/zygomorph/rev1/info.json b/keyboards/rgbkb/zygomorph/rev1/info.json new file mode 100644 index 00000000000..b79c028ec70 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/rev1/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "Zygomorph", + "url": "https://www.rgbkb.net/pages/introducing-the-zygomorph-keyboard", + "maintainer": "Legonut", + "width": 17, + "height": 6.5, + "layouts": { + "LAYOUT_ortho_5x12": { + "layout": [{"label":"`", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":7, "y":0}, {"label":"7", "x":8, "y":0}, {"label":"8", "x":9, "y":0}, {"label":"9", "x":10, "y":0}, {"label":"0", "x":11, "y":0}, {"label":"BKSP", "x":12, "y":0}, {"label":"Tab", "x":0, "y":1}, {"label":"Q", "x":1, "y":1}, {"label":"W", "x":2, "y":1}, {"label":"E", "x":3, "y":1}, {"label":"R", "x":4, "y":1}, {"label":"T", "x":5, "y":1}, {"label":"Y", "x":7, "y":1}, {"label":"U", "x":8, "y":1}, {"label":"I", "x":9, "y":1}, {"label":"O", "x":10, "y":1}, {"label":"P", "x":11, "y":1}, {"label":"\\|", "x":12, "y":1}, {"label":"Esc", "x":0, "y":2}, {"label":"A", "x":1, "y":2}, {"label":"S", "x":2, "y":2}, {"label":"D", "x":3, "y":2}, {"label":"F", "x":4, "y":2}, {"label":"G", "x":5, "y":2}, {"label":"H", "x":7, "y":2}, {"label":"J", "x":8, "y":2}, {"label":"K", "x":9, "y":2}, {"label":"L", "x":10, "y":2}, {"label":";:", "x":11, "y":2}, {"label":"'\"", "x":12, "y":2}, {"label":"Shift", "x":0, "y":3}, {"label":"Z", "x":1, "y":3}, {"label":"X", "x":2, "y":3}, {"label":"C", "x":3, "y":3}, {"label":"V", "x":4, "y":3}, {"label":"B", "x":5, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":",<", "x":9, "y":3}, {"label":".>", "x":10, "y":3}, {"label":"/?", "x":11, "y":3}, {"label":"Enter", "x":12, "y":3}, {"label":"Ctrl", "x":0, "y":4}, {"label":"Alt", "x":1, "y":4}, {"label":"Super", "x":2, "y":4}, {"label":"RGB", "x":3, "y":4}, {"label":"⇓", "x":4, "y":4}, {"x":5, "y":4}, {"x":7, "y":4}, {"label":"FN", "x":8, "y":4}, {"label":"Left", "x":9, "y":4}, {"label":"Down", "x":10, "y":4}, {"label":"Up", "x":11, "y":4}, {"label":"Right", "x":12, "y":4}] + }, + "LAYOUT_ortho_4x12": { + "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":7, "y":0}, {"label":"U", "x":8, "y":0}, {"label":"I", "x":9, "y":0}, {"label":"O", "x":10, "y":0}, {"label":"P", "x":11, "y":0}, {"label":"\\|", "x":12, "y":0}, {"label":"Esc", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"H", "x":7, "y":1}, {"label":"J", "x":8, "y":1}, {"label":"K", "x":9, "y":1}, {"label":"L", "x":10, "y":1}, {"label":";:", "x":11, "y":1}, {"label":"'\"", "x":12, "y":1}, {"label":"Shift", "x":0, "y":2}, {"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"N", "x":7, "y":2}, {"label":"M", "x":8, "y":2}, {"label":",<", "x":9, "y":2}, {"label":".>", "x":10, "y":2}, {"label":"/?", "x":11, "y":2}, {"label":"Enter", "x":12, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Alt", "x":1, "y":3}, {"label":"Super", "x":2, "y":3}, {"label":"RGB", "x":3, "y":3}, {"label":"⇓", "x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"label":"FN", "x":8, "y":3}, {"label":"Left", "x":9, "y":3}, {"label":"Down", "x":10, "y":3}, {"label":"Up", "x":11, "y":3}, {"label":"Right", "x":12, "y":3}] + }, + "LAYOUT_ortho_5x6": { + "layout": [{"label":"`", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"Tab", "x":0, "y":1}, {"label":"Q", "x":1, "y":1}, {"label":"W", "x":2, "y":1}, {"label":"E", "x":3, "y":1}, {"label":"R", "x":4, "y":1}, {"label":"T", "x":5, "y":1}, {"label":"Esc", "x":0, "y":2}, {"label":"A", "x":1, "y":2}, {"label":"S", "x":2, "y":2}, {"label":"D", "x":3, "y":2}, {"label":"F", "x":4, "y":2}, {"label":"G", "x":5, "y":2}, {"label":"Shift", "x":0, "y":3}, {"label":"Z", "x":1, "y":3}, {"label":"X", "x":2, "y":3}, {"label":"C", "x":3, "y":3}, {"label":"V", "x":4, "y":3}, {"label":"B", "x":5, "y":3}, {"x":0, "y":4}, {"label":"Ctrl", "x":1, "y":4}, {"label":"Alt", "x":2, "y":4}, {"label":"Super", "x":3, "y":4}, {"label":"⇓", "x":4, "y":4}, {"x":5, "y":4}] + }, + "LAYOUT_ortho_4x6": { + "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Esc", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"Shift", "x":0, "y":2}, {"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"x":0, "y":3}, {"label":"Ctrl", "x":1, "y":3}, {"label":"Alt", "x":2, "y":3}, {"label":"Super", "x":3, "y":3}, {"label":"⇓", "x":4, "y":3}, {"x":5, "y":3}] + } + } +} diff --git a/keyboards/rgbkb/zygomorph/rev1/rev1.c b/keyboards/rgbkb/zygomorph/rev1/rev1.c new file mode 100644 index 00000000000..3edf48c5d54 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/rev1/rev1.c @@ -0,0 +1,73 @@ +#include "zygomorph.h" + + +#ifdef RGB_MATRIX_ENABLE +#define RGB_LEFT_HAND { { 0 | ( 5 << 4) }, { 102, 0 }, 4}, \ + { { 0 | ( 4 << 4) }, { 81, 0 }, 4}, \ + { { 0 | ( 3 << 4) }, { 61, 0 }, 4}, \ + { { 0 | ( 2 << 4) }, { 41, 0 }, 4}, \ + { { 0 | ( 1 << 4) }, { 20, 0 }, 4}, \ + { { 0 | ( 0 << 4) }, { 0, 0 }, 1}, \ + { { 1 | ( 5 << 4) }, { 102, 16 }, 4}, \ + { { 1 | ( 4 << 4) }, { 81, 16 }, 4}, \ + { { 1 | ( 3 << 4) }, { 61, 16 }, 4}, \ + { { 1 | ( 2 << 4) }, { 41, 16 }, 4}, \ + { { 1 | ( 1 << 4) }, { 20, 16 }, 4}, \ + { { 1 | ( 0 << 4) }, { 0, 16 }, 1}, \ + { { 2 | ( 5 << 4) }, { 102, 32 }, 4}, \ + { { 2 | ( 4 << 4) }, { 81, 32 }, 4}, \ + { { 2 | ( 3 << 4) }, { 61, 32 }, 4}, \ + { { 2 | ( 2 << 4) }, { 41, 32 }, 4}, \ + { { 2 | ( 1 << 4) }, { 20, 32 }, 4}, \ + { { 2 | ( 0 << 4) }, { 0, 32 }, 1}, \ + { { 3 | ( 5 << 4) }, { 102, 48 }, 4}, \ + { { 3 | ( 4 << 4) }, { 81, 48 }, 4}, \ + { { 3 | ( 3 << 4) }, { 61, 48 }, 4}, \ + { { 3 | ( 2 << 4) }, { 41, 48 }, 4}, \ + { { 3 | ( 1 << 4) }, { 20, 48 }, 4}, \ + { { 3 | ( 0 << 4) }, { 0, 48 }, 1}, \ + { { 4 | ( 5 << 4) }, { 102, 64 }, 1}, \ + { { 4 | ( 4 << 4) }, { 81, 64 }, 1}, \ + { { 4 | ( 3 << 4) }, { 61, 64 }, 1}, \ + { { 4 | ( 2 << 4) }, { 41, 64 }, 1}, \ + { { 4 | ( 1 << 4) }, { 20, 64 }, 1}, \ + { { 4 | ( 0 << 4) }, { 0, 64 }, 1} + +#define RGB_RIGHT_HAND { { 0 | (11 << 4) }, { 224, 0 }, 1}, \ + { { 0 | (10 << 4) }, { 204, 0 }, 4}, \ + { { 0 | ( 9 << 4) }, { 183, 0 }, 4}, \ + { { 0 | ( 8 << 4) }, { 163, 0 }, 4}, \ + { { 0 | ( 7 << 4) }, { 143, 0 }, 4}, \ + { { 0 | ( 6 << 4) }, { 122, 0 }, 4}, \ + { { 1 | (11 << 4) }, { 224, 16 }, 1}, \ + { { 1 | (10 << 4) }, { 204, 16 }, 4}, \ + { { 1 | ( 9 << 4) }, { 183, 16 }, 4}, \ + { { 1 | ( 8 << 4) }, { 163, 16 }, 4}, \ + { { 1 | ( 7 << 4) }, { 143, 16 }, 4}, \ + { { 1 | ( 6 << 4) }, { 122, 16 }, 4}, \ + { { 2 | (11 << 4) }, { 224, 32 }, 1}, \ + { { 2 | (10 << 4) }, { 204, 32 }, 4}, \ + { { 2 | ( 9 << 4) }, { 183, 32 }, 4}, \ + { { 2 | ( 8 << 4) }, { 163, 32 }, 4}, \ + { { 2 | ( 7 << 4) }, { 143, 32 }, 4}, \ + { { 2 | ( 6 << 4) }, { 122, 32 }, 4}, \ + { { 3 | (11 << 4) }, { 224, 48 }, 1}, \ + { { 3 | (10 << 4) }, { 204, 48 }, 4}, \ + { { 3 | ( 9 << 4) }, { 183, 48 }, 4}, \ + { { 3 | ( 8 << 4) }, { 163, 48 }, 4}, \ + { { 3 | ( 7 << 4) }, { 143, 48 }, 4}, \ + { { 3 | ( 6 << 4) }, { 122, 48 }, 4}, \ + { { 4 | (11 << 4) }, { 224, 64 }, 1}, \ + { { 4 | (10 << 4) }, { 204, 64 }, 1}, \ + { { 4 | ( 9 << 4) }, { 183, 64 }, 1}, \ + { { 4 | ( 8 << 4) }, { 163, 64 }, 1}, \ + { { 4 | ( 7 << 4) }, { 143, 64 }, 1}, \ + { { 4 | ( 6 << 4) }, { 122, 64 }, 1} + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +// Left Hand +RGB_LEFT_HAND +// Right Hand +//RGB_RIGHT_HAND +}; +#endif diff --git a/keyboards/rgbkb/zygomorph/rev1/rev1.h b/keyboards/rgbkb/zygomorph/rev1/rev1.h new file mode 100644 index 00000000000..c667088d05a --- /dev/null +++ b/keyboards/rgbkb/zygomorph/rev1/rev1.h @@ -0,0 +1,87 @@ +#pragma once + +#include "zygomorph.h" +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#define LAYOUT_ortho_5x6( \ + L00, L01, L02, L03, L04, L05, \ + L10, L11, L12, L13, L14, L15, \ + L20, L21, L22, L23, L24, L25, \ + L30, L31, L32, L33, L34, L35, \ + L40, L41, L42, L43, L44, L45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ + } + +#define LAYOUT_ortho_5x12( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 } \ + } + +#define LAYOUT_ortho_4x6( \ + L00, L01, L02, L03, L04, L05, \ + L10, L11, L12, L13, L14, L15, \ + L20, L21, L22, L23, L24, L25, \ + L30, L31, L32, L33, L34, L35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ + } + +#define LAYOUT_ortho_4x12( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ + } diff --git a/keyboards/rgbkb/zygomorph/rev1/rules.mk b/keyboards/rgbkb/zygomorph/rev1/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/rgbkb/zygomorph/rules.mk b/keyboards/rgbkb/zygomorph/rules.mk new file mode 100644 index 00000000000..9bafc7b1d63 --- /dev/null +++ b/keyboards/rgbkb/zygomorph/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = qmk-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SPLIT_KEYBOARD = yes +LAYOUTS = ortho_4x12 ortho_5x12 + +DEFAULT_FOLDER = rgbkb/zygomorph/rev1 diff --git a/keyboards/rgbkb/zygomorph/zygomorph.c b/keyboards/rgbkb/zygomorph/zygomorph.c new file mode 100644 index 00000000000..9f029813bce --- /dev/null +++ b/keyboards/rgbkb/zygomorph/zygomorph.c @@ -0,0 +1 @@ +#include "zygomorph.h" diff --git a/keyboards/rgbkb/zygomorph/zygomorph.h b/keyboards/rgbkb/zygomorph/zygomorph.h new file mode 100644 index 00000000000..24198ed4c9f --- /dev/null +++ b/keyboards/rgbkb/zygomorph/zygomorph.h @@ -0,0 +1,4 @@ +#pragma once + +#include "rev1.h" +#include "quantum.h" diff --git a/keyboards/romac/config.h b/keyboards/romac/config.h new file mode 100644 index 00000000000..da236c50043 --- /dev/null +++ b/keyboards/romac/config.h @@ -0,0 +1,40 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER TheRoyalSweatshirt +#define PRODUCT romac +#define DESCRIPTION A *Plaid inspired twelve-key macropad +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 3 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F7, B1, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#define BACKLIGHT_LEVELS 0 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/romac/info.json b/keyboards/romac/info.json new file mode 100644 index 00000000000..305785991e0 --- /dev/null +++ b/keyboards/romac/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "RoMac", + "url": "", + "maintainer": "TheRoyalSweatshirt", + "width": 3, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 12, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}] + } + } +} diff --git a/keyboards/romac/keymaps/default/keymap.c b/keyboards/romac/keymaps/default/keymap.c new file mode 100644 index 00000000000..35636f36b3f --- /dev/null +++ b/keyboards/romac/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#define _BASE 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT( + KC_7, KC_8, KC_9, \ + KC_4, KC_5, KC_6, \ + KC_1, KC_2, KC_3, \ + MO(_FN1), KC_0, KC_ENT \ + ), + + [_FN1] = LAYOUT( + KC_TRNS, KC_HOME, KC_PGUP, \ + KC_TRNS, KC_END, KC_PGDN, \ + KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_DOT \ + ) +}; diff --git a/keyboards/romac/keymaps/stanrc85/config.h b/keyboards/romac/keymaps/stanrc85/config.h new file mode 100644 index 00000000000..722fd7e9e9c --- /dev/null +++ b/keyboards/romac/keymaps/stanrc85/config.h @@ -0,0 +1,11 @@ +#undef RGBLED_NUM +#define RGBLED_NUM 16 + +#define RGB_DI_PIN F4 +#ifdef RGB_DI_PIN + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_ANIMATIONS +#endif + diff --git a/keyboards/romac/keymaps/stanrc85/keymap.c b/keyboards/romac/keymaps/stanrc85/keymap.c new file mode 100644 index 00000000000..ecca61cae00 --- /dev/null +++ b/keyboards/romac/keymaps/stanrc85/keymap.c @@ -0,0 +1,78 @@ +/* Copyright 2019 Stanrc85 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "stanrc85.h" + +enum keys { + U_LAYR = SAFE_RANGE, + D_LAYR +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NUMPAD] = LAYOUT( + KC_7, KC_8, KC_9, + KC_4, KC_5, KC_6, + KC_1, KC_2, KC_3, + U_LAYR, KC_0, KC_ENT), + + [_NAVKEY] = LAYOUT( + KC_HOME, KC_INS, KC_PGUP, + KC_END, KC_UP, KC_PGDN, + KC_LEFT, KC_DOWN, KC_RGHT, + U_LAYR, TD_TWIN, D_LAYR), + + [_MEDIA] = LAYOUT( + KC_MUTE, KC_VOLD, KC_VOLU, + CA_QUOT, KC_MPLY, CA_SCLN, + CA_COPY, CA_PSTE, KC_NO, + U_LAYR, KC_NO, D_LAYR), + + [_RGB] = LAYOUT( + RGB_SAI, RGB_VAI, RGB_HUI, + RGB_SAD, RGB_VAD, RGB_HUD, + RGB_TOG, RGB_MOD, KC_NO, + U_LAYR, KC_NO, D_LAYR), + + [_FN1PAD] = LAYOUT( + KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, RESET, + KC_NO, KC_NO, KC_MAKE, + KC_NO, KC_LSFT, D_LAYR) +}; + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + keypos_t key; + uint8_t current_layer; + uint8_t next_layer; + switch (keycode) { + case U_LAYR: //cycles up the layers + if (!record->event.pressed) { + current_layer = layer_switch_get_layer(key); + next_layer = current_layer+1; + layer_move(next_layer); + } + break; + case D_LAYR: //cycles down the layers + if (!record->event.pressed) { + current_layer = layer_switch_get_layer(key); + next_layer = current_layer-1; + layer_move(next_layer); + } + break; + } + return true; +}; diff --git a/keyboards/romac/keymaps/stanrc85/rules.mk b/keyboards/romac/keymaps/stanrc85/rules.mk new file mode 100644 index 00000000000..1e3cebb1451 --- /dev/null +++ b/keyboards/romac/keymaps/stanrc85/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/romac/readme.md b/keyboards/romac/readme.md new file mode 100644 index 00000000000..98ed21502af --- /dev/null +++ b/keyboards/romac/readme.md @@ -0,0 +1,16 @@ + +# RoMac + +![RoMac](https://i.imgur.com/hAOyoqj.jpg) + +A “Plaid” Inspired 12-Key (3x4) Macropad. + +- Keyboard Maintainer: [Garret G.](https://github.com/TheRoyalSweatshirt) +- Hardware Supported: RoMac rev.1, rev.2, Pro Micro, Elite-C, Proton C, BlueMicro. +- Hardware Availability: Through GB or Direct Message (If extra stock is available). + +Make example for this keyboard (after setting up your build environment): + + make romac:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/romac/romac.c b/keyboards/romac/romac.c new file mode 100644 index 00000000000..24f4c16333a --- /dev/null +++ b/keyboards/romac/romac.c @@ -0,0 +1 @@ +#include "romac.h" diff --git a/keyboards/romac/romac.h b/keyboards/romac/romac.h new file mode 100644 index 00000000000..e6fb9694d2e --- /dev/null +++ b/keyboards/romac/romac.h @@ -0,0 +1,16 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, \ + K10, K11, K12, \ + K20, K21, K22, \ + K30, K31, K32 \ +) \ +{ \ + { K00, K01, K02 }, \ + { K10, K11, K12 }, \ + { K20, K21, K22 }, \ + { K30, K31, K32 } \ +} diff --git a/keyboards/romac/rules.mk b/keyboards/romac/rules.mk new file mode 100644 index 00000000000..b500f1b885a --- /dev/null +++ b/keyboards/romac/rules.mk @@ -0,0 +1,57 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no + diff --git a/keyboards/ropro/config.h b/keyboards/ropro/config.h new file mode 100644 index 00000000000..5079217f9c6 --- /dev/null +++ b/keyboards/ropro/config.h @@ -0,0 +1,58 @@ +#pragma once + +/* Copyright 2019 Garret G. (TheRoyalSweatshirt) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see .#pragma once + */ + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0002 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Kingly-Keys +#define PRODUCT The_RoPro +#define DESCRIPTION A 75-key ortholinear keyboard with rotary encoder + + /* key matrix size */ +#define MATRIX_ROWS 7 +#define MATRIX_COLS 14 + +#define ENCODERS_PAD_A { B7 } +#define ENCODERS_PAD_B { D5 } + + /* key matrix pins */ +#define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, F1, NO_PIN } +#define MATRIX_COL_PINS { F0, D1, D0, D4, C6, D7, E6, B4, B5, B3, B2, B6, D2, C7 } +#define UNUSED_PINS + + /* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + + /* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + + /* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED --- DIN Pin Routed to VIA on main PCB marked "RGB" */ +#define RGB_DI_PIN D3 + +#define RGBLIGHT_ANIMATIONS + +#define RGBLED_NUM 16 diff --git a/keyboards/ropro/info.json b/keyboards/ropro/info.json new file mode 100644 index 00000000000..f7b62f664eb --- /dev/null +++ b/keyboards/ropro/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "ropro", + "url": "https://github.com/TheRoyalSweatshirt/The_RoPro", + "maintainer": "[TheRoyalSweatshirt](https://github.com/TheRoyalSweatshirt)", + "width": 13, + "height": 6, + "layouts": { + "LAYOUT": { + "key_count": 76, + "layout": [{"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Esc", "x":1, "y":1}, {"label":"1", "x":2, "y":1}, {"label":"2", "x":3, "y":1}, {"label":"3", "x":4, "y":1}, {"label":"4", "x":5, "y":1}, {"label":"5", "x":6, "y":1}, {"label":"6;", "x":7, "y":1}, {"label":"7", "x":8, "y":1}, {"label":"8", "x":9, "y":1}, {"label":"9", "x":10, "y":1}, {"label":"0", "x":11, "y":1}, {"label":"-", "x":12, "y":1}, {"label":"CAPS", "x":0, "y":2}, {"label":"Tab", "x":1, "y":2}, {"label":"Q", "x":2, "y":2}, {"label":"W", "x":3, "y":2}, {"label":"E", "x":4, "y":2}, {"label":"R", "x":5, "y":2}, {"label":"T", "x":6, "y":2}, {"label":"Y", "x":7, "y":2}, {"label":"U", "x":8, "y":2}, {"label":"I", "x":9, "y":2}, {"label":"O", "x":10, "y":2}, {"label":"P", "x":11, "y":2}, {"label":"Bksp", "x":12, "y":2}, {"label":"PgUp", "x":0, "y":3}, {"label":"Ctrl", "x":1, "y":3}, {"label":"A", "x":2, "y":3}, {"label":"S", "x":3, "y":3}, {"label":"D", "x":4, "y":3}, {"label":"F", "x":5, "y":3}, {"label":"G", "x":6, "y":3}, {"label":"H;", "x":7, "y":3}, {"label":"J", "x":8, "y":3}, {"label":"K", "x":9, "y":3}, {"label":"L", "x":10, "y":3}, {"label":";", "x":11, "y":3}, {"label":"'", "x":12, "y":3}, {"label":"Home", "x":0, "y":4}, {"label":"Shift", "x":1, "y":4}, {"label":"Z", "x":2, "y":4}, {"label":"X", "x":3, "y":4}, {"label":"C", "x":4, "y":4}, {"label":"V", "x":5, "y":4}, {"label":"B", "x":6, "y":4}, {"label":"N", "x":7, "y":4}, {"label":"M", "x":8, "y":4}, {"label":",", "x":9, "y":4}, {"label":".", "x":10, "y":4}, {"label":"/", "x":11, "y":4}, {"label":"Enter", "x":12, "y":4}, {"label":"PgDn", "x":0, "y":5}, {"label":"Del", "x":1, "y":5}, {"label":"Ctrl", "x":2, "y":5}, {"label":"GUI", "x":3, "y":5}, {"label":"Alt", "x":4, "y":5}, {"label":"Lower", "x":5, "y":5}, {"x":6, "y":5}, {"x":7, "y":5}, {"label":"End", "x":8, "y":5}, {"label":"Left", "x":9, "y":5}, {"label":"Down", "x":10, "y":5}, {"label":"Up", "x":11, "y":5}, {"label":"Right", "x":12, "y":5}] + } + } +} diff --git a/keyboards/ropro/keymaps/default/keymap.c b/keyboards/ropro/keymaps/default/keymap.c new file mode 100644 index 00000000000..6e6da8f9a5a --- /dev/null +++ b/keyboards/ropro/keymaps/default/keymap.c @@ -0,0 +1,85 @@ +/* Copyright 2019 Garret G. (TheRoyalSweatshirt) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layer_names { + _BASE, + _LOWER +}; + +#define LOWER MO(_LOWER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* BASE + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |+------+------+------+------+-----+------+------+------+------+------+------+------|--------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | Rotary Click | + * ,------+------+------+------+------+------+------+------+------+------+------+------+------|--------------' + * | PgUp | Ctrl | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+-------------+------+------+------+------+------| + * | Lower| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | PgDn | Del | Ctrl | GUI | ALT |Lower |SPACE |SPACE | End | Left | Down | Up |Right | + * `------------------------------------------------------------------------------------------' + */ + [_BASE] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, +KC_CAPS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_PGUP, KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + LOWER, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_PGDN, KC_DEL, KC_RCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, KC_END, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* LOWER + * ,-----------------------------------------------------------------------------------. + * |TOGRGB| | | |Sat(-)|Hue(-)|Hue(+)|Sat(+)| | |Brght-|Brght+| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | | | | | | | | | | | = | + * |+------+------+------+------+-----+------+------+------+------+------+------+------|--------------. + * | | | Up | | | | | | | [ | ] | \ | NumLock | + * ,------+------+------+------+------+------+------+------+------+------+------+------+------|--------------' + * | Home | | Left | Down |Right | | | | | | | | | + * |------+------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | End | | | | | | | | | | | |PrScn | + * `------------------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT( + RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SAD, RGB_HUD, RGB_HUI, RGB_SAI, KC_TRNS, KC_TRNS, RGB_VAD, RGB_VAI, + KC_GRAVE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_EQUAL, +KC_NLCK, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, + KC_HOME, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR + ) +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_WH_L); + } else { + tap_code(KC_WH_R); + } + } +} diff --git a/keyboards/ropro/keymaps/default/readme.md b/keyboards/ropro/keymaps/default/readme.md new file mode 100644 index 00000000000..5d7ff3dccc8 --- /dev/null +++ b/keyboards/ropro/keymaps/default/readme.md @@ -0,0 +1 @@ +# The BASE Layout for the RoPro diff --git a/keyboards/ropro/readme.md b/keyboards/ropro/readme.md new file mode 100644 index 00000000000..0a90c87f8a5 --- /dev/null +++ b/keyboards/ropro/readme.md @@ -0,0 +1,16 @@ +The RoPro +=== + +![The_RoPro](https://i.imgur.com/hfOzBPI.jpg) + +A Compact 75-Key + Rotary Encoder Ortholinear keyboard by [Garret G.](https://github.com/TheRoyalSweatshirt) a.k.a. [/u/The_Royal](https://www.reddit.com/user/The_Royal) + +Keyboard Maintainer: [Garret G.](https://github.com/TheRoyalSweatshirt) +Hardware Supported: The_RoPro rev1.0, rev1.5, rev2.0 PCB; Elite-C & Proton-C Compatible. +Hardware Availability: [Kingly-Keys.xyz](https://kingly-keys.xyz/) - (Through GB or when in stock) + +Make example for this keyboard (after setting up your build environment): + + make ropro:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs) diff --git a/keyboards/ropro/ropro.c b/keyboards/ropro/ropro.c new file mode 100644 index 00000000000..ccb1ed0dffe --- /dev/null +++ b/keyboards/ropro/ropro.c @@ -0,0 +1 @@ +#include "ropro.h" diff --git a/keyboards/ropro/ropro.h b/keyboards/ropro/ropro.h new file mode 100644 index 00000000000..cb635cff398 --- /dev/null +++ b/keyboards/ropro/ropro.h @@ -0,0 +1,39 @@ +/* Copyright 2019 Garret G. (TheRoyalSweatshirt) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Note: Matrix is a little wacky with the rotary encoder click mapping being + * on the opposite side of the board. Remember to pay attention to + * the 13th column where the lone key mapped for rotary encoder click (K132). +*/ + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K10, K20, K30, K40, K50, K60, K70, K80, K90, K100, K110, K120, \ + K11, K21, K31, K41, K51, K61, K71, K81, K91, K101, K111, K121, \ + K132, K12, K22, K32, K42, K52, K62, K72, K82, K92, K102, K112, K122, \ + K03, K13, K23, K33, K43, K53, K63, K73, K83, K93, K103, K113, K123, \ + K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, K104, K114, K124, \ + K05, K15, K25, K35, K45, K55, K65, K75, K85, K95, K105, K115, K125 \ +) { \ + { KC_NO, K10, K20, K30, K40, K50, K60, K70, K80, K90, K100, K110, K120, KC_NO }, \ + { KC_NO, K11, K21, K31, K41, K51, K61, K71, K81, K91, K101, K111, K121, KC_NO }, \ + { KC_NO, K12, K22, K32, K42, K52, K62, K72, K82, K92, K102, K112, K122, K132 }, \ + { K03, K13, K23, K33, K43, K53, K63, K73, K83, K93, K103, K113, K123, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, K104, K114, K124, KC_NO }, \ + { K05, K15, K25, K35, K45, K55, K65, K75, K85, K95, K105, K115, K125, KC_NO } \ +} diff --git a/keyboards/ropro/rules.mk b/keyboards/ropro/rules.mk new file mode 100644 index 00000000000..c63f62146e7 --- /dev/null +++ b/keyboards/ropro/rules.mk @@ -0,0 +1,67 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +ENCODER_ENABLE = yes +RGBLIGHT_ENABLE = yes +LAYOUTS_HAS_RGB = yes diff --git a/keyboards/rorschach/config.h b/keyboards/rorschach/config.h deleted file mode 100644 index 03fde5399d2..00000000000 --- a/keyboards/rorschach/config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2018 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -#endif // CONFIG_H diff --git a/keyboards/rorschach/keymaps/default/config.h b/keyboards/rorschach/keymaps/default/config.h deleted file mode 100644 index b6a94363235..00000000000 --- a/keyboards/rorschach/keymaps/default/config.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2018 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -/* Use I2C or Serial, not both */ -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS diff --git a/keyboards/rorschach/keymaps/insertsnideremarks/keymap.c b/keyboards/rorschach/keymaps/insertsnideremarks/keymap.c deleted file mode 100644 index 5d93e2f0579..00000000000 --- a/keyboards/rorschach/keymaps/insertsnideremarks/keymap.c +++ /dev/null @@ -1,289 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -enum rorschach_layers { - _COLEMAK, // Colemak (default layer) - _QWERTY, // Qwerty - _NUMBERS, // Numbers & Symbols - _NUMBERS2, // Numbers & Function Keys (similar to _NUMBERS; used with _NUMBERS for tri-layer access to _ADJUST) - _FUNCTION, // Function - _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows) - _NUMPAD, // Numpad - _ADJUST, // Adjust layer, accessed via tri-layer feature) - _ADJUST2 // Second Adjust layer, accessed outside of tri-layer feature) -}; - -enum rorschach_keycodes { - COLEMAK = SAFE_RANGE, - QWERTY, - NUMPAD = TG(_NUMPAD), - ADJUST = MO(_ADJUST2), - SPCFN = LT(_FUNCTION, KC_SPC), - BSPCFN = LT(_FUNCTION2, KC_BSPC), - ENTNS = LT(_NUMBERS, KC_ENT), - DELNS = LT(_NUMBERS2, KC_DEL), - CTLESC = CTL_T(KC_ESC), - ALTAPP = ALT_T(KC_APP), - NKROTG = MAGIC_TOGGLE_NKRO, -}; - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -//Tap Dance Declarations -enum { - ADJ = 0, - LBCB, - RBCB, - EQPL, - PLEQ, - MNUN, - SLAS, - GVTL, - PPLEQ, - PMNUN, - PSLPAS -}; - -void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - layer_on(_ADJUST2); - set_oneshot_layer(_ADJUST2, ONESHOT_START); - } -} -void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - layer_off(_ADJUST2); - clear_oneshot_layer_state(ONESHOT_PRESSED); - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { -[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer -[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap -[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap -[EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), // Plus sign on a single-tap, equal sign on a double-tap -[PLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQL), // Equal sign on a single-tap, plus sign on a double-tap -[MNUN] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), // Minus sign on a single-tap, underscore on a double-tap -[SLAS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ASTR), // Slash in a single-tap, asterisk in a double-tap -[GVTL] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), // Grave on a single-tap, tilde on a double-tap -[PPLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PPLS, KC_EQL), // Numpad plus sign on a single-tap, equal sign on a double-tap -[PMNUN] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_UNDS), // Numpad minus sign on a single-tap, underscore on a double-tap -[PSLPAS] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST) // Numpad slash on a single-tap, numpad asterisk on a double-tap -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Colemak -* (Defauit layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) -* ,-----------------------------------------------. ,-----------------------------------------------. -* | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* |Esc/Ctl| A | R | S | T | D | | H | N | E | I | O | ' | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | SC Sft| Z | X | C | V | B | | K | M | , | . | / | SC Sft| -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' -* | Ins | ` | [ | ] |App/Alt| Spc/FN| |Bsp/Fn2| RGUI | Left | Down | Up | Right | -* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' -* | Ent/NS| Bspc | | Enter |Del/NS2| -* `---------------' `---------------' -*/ -[_COLEMAK] = LAYOUT( - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, - KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - ENTNS, KC_BSPC, KC_ENT, DELNS -), - -/* QWERTY -* (Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) -* ,-----------------------------------------------. ,-----------------------------------------------. -* | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* |Esc/Ctl| A | S | D | F | G | | H | J | K | L | ; | ' | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | SC Sft| Z | X | C | V | B | | N | M | , | . | / | SC Sft| -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' -* | Ins | ` | [ | ] |App/Alt| Spc/FN| |Bsp/Fn2| RGUI | Left | Down | Up | Right | -* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' -* | Ent/NS| Bspc | | Enter |Del/NS2| -* `---------------' `---------------' -*/ -[_QWERTY] = LAYOUT( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, - KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - ENTNS, KC_BSPC, KC_ENT, DELNS -), - -/* Number/symbol layer -* (Multiple characters: single-tap for first, double-tap for second) -* ,-----------------------------------------------. ,-----------------------------------------------. -* | | 6 | 7 | 8 | 9 | 0 | | ^ | & | * | ( | ) | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | 1 | 2 | 3 | 4 | 5 | | ! | @ | # | $ | % | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' -* | ( | ) | [ { | ] } | | | | | | | | | | -* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' -* | | | | | | -* `---------------' `---------------' -*/ -[_NUMBERS] = LAYOUT( - _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, - _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, - KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______ -), - -/* Number/Function Key layer -* (Multiple characters: single-tap for first, double-tap for second) -* ,-----------------------------------------------. ,-----------------------------------------------. -* | | 6 | 7 | 8 | 9 | 0 | | F7 | F8 | F9 | F10 | F11 | F12 | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | 1 | 2 | 3 | 4 | 5 | | F1 | F2 | F3 | F4 | F5 | F6 | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' -* | ( | ) | [ { | ] } | | | | | | | | | | -* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' -* | | | | | | -* `---------------' `---------------' -*/ -[_NUMBERS2] = LAYOUT( - _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, - KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______ -), - -/* Function layer -* ,-----------------------------------------------. ,-----------------------------------------------. -* | | | | Up | | | | | | Up | Ctrl+Y| | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | Ctrl+A| Left | Down | Right |C+A+Tab| | PgUp | Right | Down | Left | Home | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | Ctrl+Z| Ctrl+X| Ctrl+C| Ctrl+V| Bspc | | PgDn | Mute | Vol- | Vol+ | End | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' -* | | | | | | | | | | Prev | Play | Next | Stop | -* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' -* | | | | | | -* `---------------' `---------------' -*/ -[_FUNCTION] = LAYOUT( - _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, - _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, - _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, - _______, _______, _______, _______ -), - -[_FUNCTION2] = LAYOUT( - _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, - _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, - _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, - _______, _______, _______, _______ -), - -/* Numpad layer -* (Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout) -* ,-----------------------------------------------. ,-----------------------------------------------. -* | | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | NumLk | KP 7 | KP 8 | KP 9 | KP / | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | Tab | KP 4 | KP 5 | KP 6 | KP * | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | NumLk | KP . |KP/ KP*| KP- _ | KP+ = | | | KP 1 | KP 2 | KP 3 | KP - | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' -* | ( | ) | [ { | ] } | | | | | KP 0 | = | KP . | KP + | | -* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' -* | | | | KP Ent| | -* `---------------' `---------------' -*/ -[_NUMPAD] = LAYOUT( - _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, - _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_TAB, KC_P4, KC_P5, KC_P6, KC_PAST, _______, - _______, KC_NLCK, KC_PDOT, TD(PSLPAS), TD(PMNUN), TD(PPLEQ), _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, - KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, KC_P0, KC_EQL, KC_PDOT, KC_PPLS, _______, - _______, _______, KC_PENT, _______ -), - -/* Adjust layer -* (Enter/Number + Delete/Number2 to access; Numpad is a toggle) -* ,-----------------------------------------------. ,-----------------------------------------------. -* | |Colemak| Qwerty| | | | | Numpad| | | Ctrl+Y| | RESET | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | | | | | | | |NKROTog| | | | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| -* | | | | | | | | | | | | | | -* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' -* | | | | | | | | | | | | | | -* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' -* | | | | | | -* `---------------' `---------------' -*/ -[_ADJUST] = LAYOUT( - _______, COLEMAK, QWERTY, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, - _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______ -), - -[_ADJUST2] = LAYOUT( - _______, COLEMAK, QWERTY, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, - _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______ -) - -}; - -uint32_t layer_state_set_user(uint32_t state) { - return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST); -} - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case COLEMAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL << _COLEMAK); - layer_off ( _QWERTY); - layer_off ( _NUMBERS); - layer_off ( _NUMBERS2); - layer_off ( _FUNCTION); - layer_off ( _FUNCTION2); - layer_off ( _NUMPAD); - layer_off ( _ADJUST); - layer_off ( _ADJUST2); - } - return false; - break; - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL << _QWERTY); - layer_off ( _COLEMAK); - layer_off ( _NUMBERS); - layer_off ( _NUMBERS2); - layer_off ( _FUNCTION); - layer_off ( _FUNCTION2); - layer_off ( _NUMPAD); - layer_off ( _ADJUST); - layer_off ( _ADJUST2); - } - return false; - break; - } - return true; -} \ No newline at end of file diff --git a/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk b/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk deleted file mode 100644 index b9e39c05393..00000000000 --- a/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk +++ /dev/null @@ -1,19 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = yes # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE = yes # Enable Tap Dancing function diff --git a/keyboards/rorschach/readme.md b/keyboards/rorschach/readme.md deleted file mode 100644 index 537553720b6..00000000000 --- a/keyboards/rorschach/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -Rorschach -========= - -A split ortholinear 4x6 keyboard with 2 additional thumb keys and sold by Keebio. [More info at Keebio](https://keeb.io). - -Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make rorschach/rev1:default - -Example of flashing this keyboard: - - make rorschach/rev1:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -A build guide for this keyboard can be found here: [Iris Build Guide](https://docs.keeb.io/iris-build-guide.html) diff --git a/keyboards/rorschach/rev1/config.h b/keyboards/rorschach/rev1/config.h deleted file mode 100644 index 1c9ef8276c9..00000000000 --- a/keyboards/rorschach/rev1/config.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2018 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1246 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Rorschach Keyboard -#define DESCRIPTION Split 45 percent ortholinear keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D7, E6, B4, D2, D4 } -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_LEVELS 5 - -/* WS2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/rorschach/rorschach.h b/keyboards/rorschach/rorschach.h deleted file mode 100644 index 5c320b6a126..00000000000 --- a/keyboards/rorschach/rorschach.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#ifdef KEYBOARD_rorschach_rev1 - #include "rev1.h" -#endif - -#include "quantum.h" - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - LT1, LT2, RT2, RT1 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ - KC_##LT1, KC_##LT2, KC_##RT2, KC_##RT1 \ - ) diff --git a/keyboards/rorschach/rules.mk b/keyboards/rorschach/rules.mk deleted file mode 100644 index 32012534871..00000000000 --- a/keyboards/rorschach/rules.mk +++ /dev/null @@ -1,26 +0,0 @@ -# MCU name -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -BOOTLOADER = caterina -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -SPLIT_KEYBOARD = yes - -DEFAULT_FOLDER = rorschach/rev1 diff --git a/keyboards/runner3680/3x6/3x6.c b/keyboards/runner3680/3x6/3x6.c new file mode 100644 index 00000000000..1f375c3ecb9 --- /dev/null +++ b/keyboards/runner3680/3x6/3x6.c @@ -0,0 +1 @@ +#include "3x6.h" diff --git a/keyboards/runner3680/3x6/3x6.h b/keyboards/runner3680/3x6/3x6.h new file mode 100644 index 00000000000..c197c6de2c2 --- /dev/null +++ b/keyboards/runner3680/3x6/3x6.h @@ -0,0 +1,19 @@ +#pragma once + +#include "runner3680.h" + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 } \ + } diff --git a/keyboards/runner3680/3x6/config.h b/keyboards/runner3680/3x6/config.h new file mode 100644 index 00000000000..d3f3605f55e --- /dev/null +++ b/keyboards/runner3680/3x6/config.h @@ -0,0 +1,68 @@ +/* Copyright 2019 omkbd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Omkbd +#define PRODUCT runner3680 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 6 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2 ,B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6} //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 36 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 18, 18 } // Number of LEDs +#define RGBLIGHT_LIMIT_VAL 100 + +#define SOFT_SERIAL_PIN D2 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/runner3680/3x6/keymaps/default/config.h b/keyboards/runner3680/3x6/keymaps/default/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/3x6/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/3x6/keymaps/default/keymap.c b/keyboards/runner3680/3x6/keymaps/default/keymap.c new file mode 100644 index 00000000000..9ccb2ad2351 --- /dev/null +++ b/keyboards/runner3680/3x6/keymaps/default/keymap.c @@ -0,0 +1,86 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | + * `-----------------------------------------' `-----------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS + ), + + /* Adjust + * ,-----------------------------------------. ,-----------------------------------------. + * | |RGBRST| RESET| | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | TOG | HUI | SAI | VAI | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | MOD | HUD | SAD | VAD | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/3x6/keymaps/default/rules.mk b/keyboards/runner3680/3x6/keymaps/default/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/3x6/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/3x6/rules.mk b/keyboards/runner3680/3x6/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/runner3680/3x7/3x7.c b/keyboards/runner3680/3x7/3x7.c new file mode 100644 index 00000000000..5246953b58c --- /dev/null +++ b/keyboards/runner3680/3x7/3x7.c @@ -0,0 +1 @@ +#include "3x7.h" diff --git a/keyboards/runner3680/3x7/3x7.h b/keyboards/runner3680/3x7/3x7.h new file mode 100644 index 00000000000..2e07bc3b357 --- /dev/null +++ b/keyboards/runner3680/3x7/3x7.h @@ -0,0 +1,19 @@ +#pragma once + +#include "runner3680.h" + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 } \ + } diff --git a/keyboards/runner3680/3x7/config.h b/keyboards/runner3680/3x7/config.h new file mode 100644 index 00000000000..e0e6ae8e06b --- /dev/null +++ b/keyboards/runner3680/3x7/config.h @@ -0,0 +1,68 @@ +/* Copyright 2019 omkbd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Omkbd +#define PRODUCT runner3680 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 6 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7 } +#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2 ,B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 42 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 21, 21 } // Number of LEDs +#define RGBLIGHT_LIMIT_VAL 100 + +#define SOFT_SERIAL_PIN D2 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/runner3680/3x7/keymaps/default/config.h b/keyboards/runner3680/3x7/keymaps/default/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/3x7/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/3x7/keymaps/default/keymap.c b/keyboards/runner3680/3x7/keymaps/default/keymap.c new file mode 100644 index 00000000000..e5de1efd0b7 --- /dev/null +++ b/keyboards/runner3680/3x7/keymaps/default/keymap.c @@ -0,0 +1,86 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,------------------------------------------------. ,------------------------------------------------. + * | F4 | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | F6 | Esc | A | S | D | F | G | | H | J | K | L | ; | " | Enter| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | F8 | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | Up | + * `------------------------------------------------' `------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_F6, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_UP + ), + + /* Adjust + * ,------------------------------------------------. ,------------------------------------------------. + * | | |RGBRST| RESET| | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | TOG | HUI | SAI | VAI | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | MOD | HUD | SAD | VAD | | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/3x7/keymaps/default/rules.mk b/keyboards/runner3680/3x7/keymaps/default/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/3x7/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/3x7/rules.mk b/keyboards/runner3680/3x7/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/runner3680/3x8/3x8.c b/keyboards/runner3680/3x8/3x8.c new file mode 100644 index 00000000000..8ea77001c51 --- /dev/null +++ b/keyboards/runner3680/3x8/3x8.c @@ -0,0 +1 @@ +#include "3x8.h" diff --git a/keyboards/runner3680/3x8/3x8.h b/keyboards/runner3680/3x8/3x8.h new file mode 100644 index 00000000000..c5856d0034f --- /dev/null +++ b/keyboards/runner3680/3x8/3x8.h @@ -0,0 +1,19 @@ +#pragma once + +#include "runner3680.h" + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, L07, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, L16, L17, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, L26, L27, R20, R21, R22, R23, R24, R25, R26, R27 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06, L07 }, \ + { L10, L11, L12, L13, L14, L15, L16, L17 }, \ + { L20, L21, L22, L23, L24, L25, L26, L27 }, \ + { R07, R06, R05, R04, R03, R02, R01, R00 }, \ + { R17, R16, R15, R14, R13, R12, R11, R10 }, \ + { R27, R26, R25, R24, R23, R22, R21, R20 } \ + } diff --git a/keyboards/runner3680/3x8/config.h b/keyboards/runner3680/3x8/config.h new file mode 100644 index 00000000000..0d4e3296a12 --- /dev/null +++ b/keyboards/runner3680/3x8/config.h @@ -0,0 +1,68 @@ +/* Copyright 2019 omkbd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Omkbd +#define PRODUCT runner3680 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 6 +#define MATRIX_COLS 8 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 ,B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 48 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 24, 24 } // Number of LEDs +#define RGBLIGHT_LIMIT_VAL 100 + +#define SOFT_SERIAL_PIN D2 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/runner3680/3x8/keymaps/default/config.h b/keyboards/runner3680/3x8/keymaps/default/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/3x8/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/3x8/keymaps/default/keymap.c b/keyboards/runner3680/3x8/keymaps/default/keymap.c new file mode 100644 index 00000000000..cad7e859a3f --- /dev/null +++ b/keyboards/runner3680/3x8/keymaps/default/keymap.c @@ -0,0 +1,88 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,-------------------------------------------------------. ,--------------------------------------------------------. + * | F3 | F4 | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | Bksp | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F5 | F6 | Esc | A | S | D | F | G | | H | J | K | L | ; | " | Enter| Enter| + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F7 | F8 | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | Up | Shift| + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_F5, KC_F6, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_UP, KC_RSFT + ), + + /* Adjust + * ,-------------------------------------------------------. ,--------------------------------------------------------. + * | | | |RGBRST| RESET| | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | TOG | HUI | SAI | VAI | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | MOD | HUD | SAD | VAD | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | | | + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/3x8/keymaps/default/rules.mk b/keyboards/runner3680/3x8/keymaps/default/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/3x8/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/3x8/rules.mk b/keyboards/runner3680/3x8/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/runner3680/4x6/4x6.c b/keyboards/runner3680/4x6/4x6.c new file mode 100644 index 00000000000..5e68c1a9fa2 --- /dev/null +++ b/keyboards/runner3680/4x6/4x6.c @@ -0,0 +1 @@ +#include "4x6.h" diff --git a/keyboards/runner3680/4x6/4x6.h b/keyboards/runner3680/4x6/4x6.h new file mode 100644 index 00000000000..dfc3a977b79 --- /dev/null +++ b/keyboards/runner3680/4x6/4x6.h @@ -0,0 +1,22 @@ +#pragma once + +#include "runner3680.h" + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 } \ + } diff --git a/keyboards/runner3680/4x6/config.h b/keyboards/runner3680/4x6/config.h new file mode 100644 index 00000000000..08838d1b66c --- /dev/null +++ b/keyboards/runner3680/4x6/config.h @@ -0,0 +1,68 @@ +/* Copyright 2019 omkbd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Omkbd +#define PRODUCT runner3680 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2 ,B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6} //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 48 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 24, 24 } // Number of LEDs +#define RGBLIGHT_LIMIT_VAL 100 + +#define SOFT_SERIAL_PIN D2 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/runner3680/4x6/keymaps/default/config.h b/keyboards/runner3680/4x6/keymaps/default/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/4x6/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/4x6/keymaps/default/keymap.c b/keyboards/runner3680/4x6/keymaps/default/keymap.c new file mode 100644 index 00000000000..9af15c703eb --- /dev/null +++ b/keyboards/runner3680/4x6/keymaps/default/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | GUI | Alt | EISU | Del | Space| | Enter| Bksp | EISU | ESC |Adjust| Left | + * `-----------------------------------------' `-----------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, + KC_LCTL, KC_LGUI, KC_LALT, EISU, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, EISU, KC_ESC, ADJUST, KC_LEFT + ), + + /* Adjust + * ,-----------------------------------------. ,-----------------------------------------. + * | |RGBRST| RESET| | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | TOG | HUI | SAI | VAI | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | MOD | HUD | SAD | VAD | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/4x6/keymaps/default/rules.mk b/keyboards/runner3680/4x6/keymaps/default/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/4x6/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/4x6/rules.mk b/keyboards/runner3680/4x6/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/runner3680/4x7/4x7.c b/keyboards/runner3680/4x7/4x7.c new file mode 100644 index 00000000000..568fc2dacd9 --- /dev/null +++ b/keyboards/runner3680/4x7/4x7.c @@ -0,0 +1 @@ +#include "4x7.h" diff --git a/keyboards/runner3680/4x7/4x7.h b/keyboards/runner3680/4x7/4x7.h new file mode 100644 index 00000000000..7bd43e11141 --- /dev/null +++ b/keyboards/runner3680/4x7/4x7.h @@ -0,0 +1,22 @@ +#pragma once + +#include "runner3680.h" + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 } \ + } diff --git a/keyboards/runner3680/4x7/config.h b/keyboards/runner3680/4x7/config.h new file mode 100644 index 00000000000..f33f8f9f2b7 --- /dev/null +++ b/keyboards/runner3680/4x7/config.h @@ -0,0 +1,68 @@ +/* Copyright 2019 omkbd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Omkbd +#define PRODUCT runner3680 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2 ,B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 56 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 28, 28 } // Number of LEDs +#define RGBLIGHT_LIMIT_VAL 100 + +#define SOFT_SERIAL_PIN D2 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/runner3680/4x7/keymaps/default/config.h b/keyboards/runner3680/4x7/keymaps/default/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/4x7/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/4x7/keymaps/default/keymap.c b/keyboards/runner3680/4x7/keymaps/default/keymap.c new file mode 100644 index 00000000000..091d44d8159 --- /dev/null +++ b/keyboards/runner3680/4x7/keymaps/default/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,------------------------------------------------. ,------------------------------------------------. + * | F4 | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | F6 | Esc | A | S | D | F | G | | H | J | K | L | ; | " | Enter| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | F8 | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | Up | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | F10 | Ctrl | GUI | Alt | EISU | Del | Space| | Enter| Bksp | EISU | ESC |Adjust| Left | Down | + * `------------------------------------------------' `------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_F6, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_UP, + KC_F10, KC_LCTL, KC_LGUI, KC_LALT, EISU, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, EISU, KC_ESC, ADJUST, KC_LEFT, KC_DOWN + ), + + /* Adjust + * ,------------------------------------------------. ,------------------------------------------------. + * | | |RGBRST| RESET| | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | TOG | HUI | SAI | VAI | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | MOD | HUD | SAD | VAD | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/4x7/keymaps/default/rules.mk b/keyboards/runner3680/4x7/keymaps/default/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/4x7/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/4x7/rules.mk b/keyboards/runner3680/4x7/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/runner3680/4x8/4x8.c b/keyboards/runner3680/4x8/4x8.c new file mode 100644 index 00000000000..2667548078a --- /dev/null +++ b/keyboards/runner3680/4x8/4x8.c @@ -0,0 +1 @@ +#include "4x8.h" diff --git a/keyboards/runner3680/4x8/4x8.h b/keyboards/runner3680/4x8/4x8.h new file mode 100644 index 00000000000..bc95b439b04 --- /dev/null +++ b/keyboards/runner3680/4x8/4x8.h @@ -0,0 +1,22 @@ +#pragma once + +#include "runner3680.h" + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, L07, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, L16, L17, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, L26, L27, R20, R21, R22, R23, R24, R25, R26, R27, \ + L30, L31, L32, L33, L34, L35, L36, L37, R30, R31, R32, R33, R34, R35, R36, R37 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06, L07 }, \ + { L10, L11, L12, L13, L14, L15, L16, L17 }, \ + { L20, L21, L22, L23, L24, L25, L26, L27 }, \ + { L30, L31, L32, L33, L34, L35, L36, L37 }, \ + { R07, R06, R05, R04, R03, R02, R01, R00 }, \ + { R17, R16, R15, R14, R13, R12, R11, R10 }, \ + { R27, R26, R25, R24, R23, R22, R21, R20 }, \ + { R37, R36, R35, R34, R33, R32, R31, R30 } \ + } diff --git a/keyboards/runner3680/4x8/config.h b/keyboards/runner3680/4x8/config.h new file mode 100644 index 00000000000..d85ebb29cf5 --- /dev/null +++ b/keyboards/runner3680/4x8/config.h @@ -0,0 +1,68 @@ +/* Copyright 2019 omkbd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Omkbd +#define PRODUCT runner3680 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 ,B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 64 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 32, 32 } // Number of LEDs +#define RGBLIGHT_LIMIT_VAL 100 + +#define SOFT_SERIAL_PIN D2 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/runner3680/4x8/keymaps/default/config.h b/keyboards/runner3680/4x8/keymaps/default/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/4x8/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/4x8/keymaps/default/keymap.c b/keyboards/runner3680/4x8/keymaps/default/keymap.c new file mode 100644 index 00000000000..9b1f9d237bd --- /dev/null +++ b/keyboards/runner3680/4x8/keymaps/default/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,-------------------------------------------------------. ,--------------------------------------------------------. + * | F3 | F4 | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | Bksp | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F5 | F6 | Esc | A | S | D | F | G | | H | J | K | L | ; | " | Enter| Enter| + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F7 | F8 | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | Up | Shift| + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F9 | F10 | Ctrl | GUI | Alt | EISU | Del | Space| | Enter| Bksp | EISU | ESC |Adjust| Left | Down | Right| + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_F5, KC_F6, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_UP, KC_RSFT, + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, EISU, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, EISU, KC_ESC, ADJUST, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Adjust + * ,-------------------------------------------------------. ,--------------------------------------------------------. + * | | | |RGBRST| RESET| | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | TOG | HUI | SAI | VAI | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | MOD | HUD | SAD | VAD | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | | | + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/4x8/keymaps/default/rules.mk b/keyboards/runner3680/4x8/keymaps/default/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/4x8/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/4x8/rules.mk b/keyboards/runner3680/4x8/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/runner3680/5x6/5x6.c b/keyboards/runner3680/5x6/5x6.c new file mode 100644 index 00000000000..0e9d5481c47 --- /dev/null +++ b/keyboards/runner3680/5x6/5x6.c @@ -0,0 +1 @@ +#include "5x6.h" diff --git a/keyboards/runner3680/5x6/5x6.h b/keyboards/runner3680/5x6/5x6.h new file mode 100644 index 00000000000..5a6e70c2097 --- /dev/null +++ b/keyboards/runner3680/5x6/5x6.h @@ -0,0 +1,25 @@ +#pragma once + +#include "runner3680.h" + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { R45, R44, R43, R42, R41, R40 } \ + } diff --git a/keyboards/runner3680/5x6/config.h b/keyboards/runner3680/5x6/config.h new file mode 100644 index 00000000000..ae3853a8e8a --- /dev/null +++ b/keyboards/runner3680/5x6/config.h @@ -0,0 +1,68 @@ +/* Copyright 2019 omkbd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Omkbd +#define PRODUCT runner3680 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2 ,B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6} //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 60 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 30, 30 } // Number of LEDs +#define RGBLIGHT_LIMIT_VAL 100 + +#define SOFT_SERIAL_PIN D2 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/runner3680/5x6/keymaps/default/config.h b/keyboards/runner3680/5x6/keymaps/default/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/5x6/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/5x6/keymaps/default/keymap.c b/keyboards/runner3680/5x6/keymaps/default/keymap.c new file mode 100644 index 00000000000..d8f50e49e3d --- /dev/null +++ b/keyboards/runner3680/5x6/keymaps/default/keymap.c @@ -0,0 +1,98 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | GUI | Alt | EISU | Del | Space| | Enter| Bksp | EISU | ESC |Adjust| Left | + * `-----------------------------------------' `-----------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, + KC_LCTL, KC_LGUI, KC_LALT, EISU, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, EISU, KC_ESC, ADJUST, KC_LEFT + ), + + /* Adjust + * ,-----------------------------------------. ,-----------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBRST| RESET| | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | TOG | HUI | SAI | VAI | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | MOD | HUD | SAD | VAD | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/5x6/keymaps/default/rules.mk b/keyboards/runner3680/5x6/keymaps/default/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/5x6/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/5x6/rules.mk b/keyboards/runner3680/5x6/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/runner3680/5x7/5x7.c b/keyboards/runner3680/5x7/5x7.c new file mode 100644 index 00000000000..aae28e450c9 --- /dev/null +++ b/keyboards/runner3680/5x7/5x7.c @@ -0,0 +1 @@ +#include "5x7.h" diff --git a/keyboards/runner3680/5x7/5x7.h b/keyboards/runner3680/5x7/5x7.h new file mode 100644 index 00000000000..451ecf6cd49 --- /dev/null +++ b/keyboards/runner3680/5x7/5x7.h @@ -0,0 +1,25 @@ +#pragma once + +#include "runner3680.h" + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 }, \ + { R46, R45, R44, R43, R42, R41, R40 } \ + } diff --git a/keyboards/runner3680/5x7/config.h b/keyboards/runner3680/5x7/config.h new file mode 100644 index 00000000000..1d56608e6d6 --- /dev/null +++ b/keyboards/runner3680/5x7/config.h @@ -0,0 +1,68 @@ +/* Copyright 2019 omkbd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Omkbd +#define PRODUCT runner3680 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2 ,B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 70 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 35, 35 } // Number of LEDs +#define RGBLIGHT_LIMIT_VAL 100 + +#define SOFT_SERIAL_PIN D2 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/runner3680/5x7/keymaps/default/config.h b/keyboards/runner3680/5x7/keymaps/default/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/5x7/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/5x7/keymaps/default/keymap.c b/keyboards/runner3680/5x7/keymaps/default/keymap.c new file mode 100644 index 00000000000..44c0b20bd2c --- /dev/null +++ b/keyboards/runner3680/5x7/keymaps/default/keymap.c @@ -0,0 +1,98 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | = | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | F2 | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | F3 | Esc | A | S | D | F | G | | H | J | K | L | ; | " | Enter| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | F4 | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | Shift| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | F5 | Ctrl | GUI | Alt | EISU | Del | Space| | Enter| Bksp | EISU | ESC |Adjust| Left | Down | + * `------------------------------------------------' `------------------------------------------------' + */ + [_QWERTY] = LAYOUT( \ + KC_F1, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ + KC_F2, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ + KC_F3, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_F4, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_RSFT, \ + KC_F5, KC_LCTL, KC_LGUI, KC_LALT, EISU, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, ADJUST, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ + ), + + /* Adjust + * ,------------------------------------------------. ,------------------------------------------------. + * | | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | |RGBRST| RESET| | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | TOG | HUI | SAI | VAI | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | MOD | HUD | SAD | VAD | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/5x7/keymaps/default/rules.mk b/keyboards/runner3680/5x7/keymaps/default/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/5x7/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/5x7/rules.mk b/keyboards/runner3680/5x7/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/runner3680/5x8/5x8.c b/keyboards/runner3680/5x8/5x8.c new file mode 100644 index 00000000000..39587025724 --- /dev/null +++ b/keyboards/runner3680/5x8/5x8.c @@ -0,0 +1 @@ +#include "5x8.h" diff --git a/keyboards/runner3680/5x8/5x8.h b/keyboards/runner3680/5x8/5x8.h new file mode 100644 index 00000000000..de53a0eb291 --- /dev/null +++ b/keyboards/runner3680/5x8/5x8.h @@ -0,0 +1,25 @@ +#pragma once + +#include "runner3680.h" + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, L07, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, L16, L17, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, L26, L27, R20, R21, R22, R23, R24, R25, R26, R27, \ + L30, L31, L32, L33, L34, L35, L36, L37, R30, R31, R32, R33, R34, R35, R36, R37, \ + L40, L41, L42, L43, L44, L45, L46, L47, R40, R41, R42, R43, R44, R45, R46, R47 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06, L07 }, \ + { L10, L11, L12, L13, L14, L15, L16, L17 }, \ + { L20, L21, L22, L23, L24, L25, L26, L27 }, \ + { L30, L31, L32, L33, L34, L35, L36, L37 }, \ + { L40, L41, L42, L43, L44, L45, L46, L47 }, \ + { R07, R06, R05, R04, R03, R02, R01, R00 }, \ + { R17, R16, R15, R14, R13, R12, R11, R10 }, \ + { R27, R26, R25, R24, R23, R22, R21, R20 }, \ + { R37, R36, R35, R34, R33, R32, R31, R30 }, \ + { R47, R46, R45, R44, R43, R42, R41, R40 } \ + } diff --git a/keyboards/runner3680/5x8/config.h b/keyboards/runner3680/5x8/config.h new file mode 100644 index 00000000000..5349fa06aaf --- /dev/null +++ b/keyboards/runner3680/5x8/config.h @@ -0,0 +1,68 @@ +/* Copyright 2019 omkbd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0005 +#define MANUFACTURER Omkbd +#define PRODUCT runner3680 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 ,B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 80 +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 40, 40 } // Number of LEDs +#define RGBLIGHT_LIMIT_VAL 100 + +#define SOFT_SERIAL_PIN D2 +#define SELECT_SOFT_SERIAL_SPEED 1 +/*Sets the protocol speed when using serial communication*/ +//Speeds: +//0: about 189kbps (Experimental only) +//1: about 137kbps (default) +//2: about 75kbps +//3: about 39kbps +//4: about 26kbps +//5: about 20kbps diff --git a/keyboards/runner3680/5x8/keymaps/JIS/config.h b/keyboards/runner3680/5x8/keymaps/JIS/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/5x8/keymaps/JIS/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/5x8/keymaps/JIS/keymap.c b/keyboards/runner3680/5x8/keymaps/JIS/keymap.c new file mode 100644 index 00000000000..1b39cf08ef7 --- /dev/null +++ b/keyboards/runner3680/5x8/keymaps/JIS/keymap.c @@ -0,0 +1,99 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,-------------------------------------------------------. ,--------------------------------------------------------. + * | F1 | F2 | EISU | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | ^ | \ | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F3 | F4 | Tab | Q | W | E | R | T | | Y | U | I | O | P | @ | [ | Bksp | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F5 | F6 | Esc | A | S | D | F | G | | H | J | K | L | : | ; | ] | Enter| + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F7 | F8 | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | Up | Shift| + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F9 | F10 | Ctrl | GUI | Alt | MHEN | Del | Space| | Enter| Bksp | HENK |Adjust| F10 | Left | Down | Right| + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + RGBRST , RGB_TOG, JP_ZHTG, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, JP_CIRC, JP_YEN, + RGB_MOD, RGB_SAI, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, JP_LBRC, KC_BSPC, + RGB_SAI, RGB_SAD, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, JP_RBRC, KC_ENT, + RGB_VAI, RGB_VAD, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, JP_BSLS, KC_UP, KC_RSFT, + _______, _______, KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, KC_HENK, ADJUST, KC_F10, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Adjust + * ,-------------------------------------------------------. ,--------------------------------------------------------. + * | | | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | |RGBRST| RESET| | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | TOG | HUI | SAI | VAI | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | MOD | HUD | SAD | VAD | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | | | + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, _______, _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/5x8/keymaps/JIS/rules.mk b/keyboards/runner3680/5x8/keymaps/JIS/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/5x8/keymaps/JIS/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/5x8/keymaps/default/config.h b/keyboards/runner3680/5x8/keymaps/default/config.h new file mode 100644 index 00000000000..43a82f38a0a --- /dev/null +++ b/keyboards/runner3680/5x8/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/runner3680/5x8/keymaps/default/keymap.c b/keyboards/runner3680/5x8/keymaps/default/keymap.c new file mode 100644 index 00000000000..9f0084e896f --- /dev/null +++ b/keyboards/runner3680/5x8/keymaps/default/keymap.c @@ -0,0 +1,98 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +enum layer_number { + _QWERTY = 0, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + RGBRST +}; + +// Fillers to make layering more clear +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY + * ,-------------------------------------------------------. ,--------------------------------------------------------. + * | F1 | F2 | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | = | Del | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F3 | F4 | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | Bksp | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F5 | F6 | Esc | A | S | D | F | G | | H | J | K | L | ; | " | Enter| Enter| + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F7 | F8 | Shift| Z | X | C | V | B | | N | M | , | . | / | \ | Up | Shift| + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | F9 | F10 | Ctrl | GUI | Alt | EISU | Del | Space| | Enter| Bksp | EISU | ESC |Adjust| Left | Down | Right| + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_F1, KC_F2, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_F5, KC_F6, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_UP, KC_RSFT, + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, EISU, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, EISU, KC_ESC, ADJUST, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Adjust + * ,-------------------------------------------------------. ,--------------------------------------------------------. + * | | | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | |RGBRST| RESET| | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | TOG | HUI | SAI | VAI | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | MOD | HUD | SAD | VAD | | | | | | | | | | | + * |------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | | | + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, _______, _______, RGBRST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} diff --git a/keyboards/runner3680/5x8/keymaps/default/rules.mk b/keyboards/runner3680/5x8/keymaps/default/rules.mk new file mode 100644 index 00000000000..9104ce244c3 --- /dev/null +++ b/keyboards/runner3680/5x8/keymaps/default/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/runner3680/5x8/rules.mk b/keyboards/runner3680/5x8/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/runner3680/config.h b/keyboards/runner3680/config.h new file mode 100644 index 00000000000..b8c5759db6b --- /dev/null +++ b/keyboards/runner3680/config.h @@ -0,0 +1,3 @@ +#pragma once + +#include "config_common.h" diff --git a/keyboards/runner3680/readme.md b/keyboards/runner3680/readme.md new file mode 100644 index 00000000000..b32ead412bf --- /dev/null +++ b/keyboards/runner3680/readme.md @@ -0,0 +1,15 @@ +# runner3680 + +![runner3680](https://github.com/omkbd/Runner3680/blob/master/Picture/Runner3680.jpg) + +A split ortholinear keyboard. Each half is a 5x8 arrangement, with breakable pieces to allow the number of rows to be customized between 3 to 5, and the number of columns to be between 6 to 8. + +Keyboard Maintainer: [omkbd](https://github.com/omkbd) [@omkbd](https://twitter.com/omkbd) +Hardware Supported: Runner3680, Pro Micro ATmega32u4 +Hardware Availability: Order your own [yourself](https://github.com/omkbd/Runner3680) + +Make example for this keyboard (after setting up your build environment): + + make runner3680/5x8:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/runner3680/rules.mk b/keyboards/runner3680/rules.mk new file mode 100644 index 00000000000..624dd2e507b --- /dev/null +++ b/keyboards/runner3680/rules.mk @@ -0,0 +1,60 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +F_CPU = 16000000 + +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SPLIT_KEYBOARD = yes # Enables split keyboard support + +DEFAULT_FOLDER = runner3680/5x8 diff --git a/keyboards/runner3680/runner3680.c b/keyboards/runner3680/runner3680.c new file mode 100644 index 00000000000..7d8362363b9 --- /dev/null +++ b/keyboards/runner3680/runner3680.c @@ -0,0 +1 @@ +#include "runner3680.h" diff --git a/keyboards/runner3680/runner3680.h b/keyboards/runner3680/runner3680.h new file mode 100644 index 00000000000..e7842b765aa --- /dev/null +++ b/keyboards/runner3680/runner3680.h @@ -0,0 +1,39 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_runner3680_5x8 + #include "5x8.h" +#endif + +#ifdef KEYBOARD_runner3680_5x7 + #include "5x7.h" +#endif + +#ifdef KEYBOARD_runner3680_5x6 + #include "5x6.h" +#endif + +#ifdef KEYBOARD_runner3680_4x8 + #include "4x8.h" +#endif + +#ifdef KEYBOARD_runner3680_4x7 + #include "4x7.h" +#endif + +#ifdef KEYBOARD_runner3680_4x6 + #include "4x6.h" +#endif + +#ifdef KEYBOARD_runner3680_3x8 + #include "3x8.h" +#endif + +#ifdef KEYBOARD_runner3680_3x7 + #include "3x7.h" +#endif + +#ifdef KEYBOARD_runner3680_3x6 + #include "3x6.h" +#endif diff --git a/keyboards/s60_x/config.h b/keyboards/s60_x/config.h deleted file mode 100644 index 8b97b3c814c..00000000000 --- a/keyboards/s60_x/config.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2016 Julien Pecqueur -Copyright 2016 Felix Uhl - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Massdrop - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* number of backlight levels */ -#define BACKLIGHT_PIN B7 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 3 -#endif - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#ifdef SUBPROJECT_default - #include "default/config.h" -#endif -#ifdef SUBPROJECT_rgb - #include "rgb/config.h" -#endif - -#endif diff --git a/keyboards/s60_x/default/config.h b/keyboards/s60_x/default/config.h deleted file mode 100644 index 25fc4ad2e02..00000000000 --- a/keyboards/s60_x/default/config.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef DEFAULT_CONFIG_H -#define DEFAULT_CONFIG_H - -#include "config_common.h" - -#define PRODUCT S60-X -#define DESCRIPTION q.m.k. keyboard firmware for S60-X - -#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0 } -#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 } -#define UNUSED_PINS { F0 } - -#define LOCKING_SUPPORT_ENABLE -#define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define NO_ACTION_ONESHOT -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/s60_x/default/default.h b/keyboards/s60_x/default/default.h deleted file mode 100644 index f3646f15590..00000000000 --- a/keyboards/s60_x/default/default.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako -Copyright 2015 Vin�cius Nery Cordeiro -Copyright 2016 Felix Uhl - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef DEFAULT_H -#define DEFAULT_H - -#include "quantum.h" - -#ifdef __INTELLISENSE__ -#define PROGMEM -#include "../config.h" -#endif - -/* S60-X keymap definition macro -* K31 is the extra key next to short left ISO shift -* K2C is the moved key next to enter on ISO boards -* K3C is the extra key next to short right JIS shift -* K0D is extra key from split backspace -* K3E is extra key from HHKB-style split right shift -*/ - -#define XXX KC_NO - - -#define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, XXX }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX } \ -} - - -#define LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, XXX, }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ -} - - -#define LAYOUT_60_ansi_split_bs_rshift( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ -} - - -#define LAYOUT_60_iso( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, XXX, }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, XXX, }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, XXX, }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ -} - - -/*This special definition is used for S60-X keymaps that were ported from TMK - * QMK has a lot of keycodes that don't start with KC_, so using the regular KEYMAP macro is recommended - */ -#define LAYOUT_kc( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, XXX }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, XXX }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \ - { KC_##K40, KC_##K41, KC_##K42, XXX, XXX, XXX, KC_##K46, XXX, XXX, XXX, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, XXX } \ -} - -#endif diff --git a/keyboards/s60_x/default/info.json b/keyboards/s60_x/default/info.json deleted file mode 100644 index 1aa2dbf3e00..00000000000 --- a/keyboards/s60_x/default/info.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "keyboard_name": "S60-X", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_ansi_split_bs_rshift": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_iso": { - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - } - } -} \ No newline at end of file diff --git a/keyboards/s60_x/default/rules.mk b/keyboards/s60_x/default/rules.mk deleted file mode 100644 index ce4064d1c6a..00000000000 --- a/keyboards/s60_x/default/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no diff --git a/keyboards/s60_x/keymaps/ansi_qwertz/config.h b/keyboards/s60_x/keymaps/ansi_qwertz/config.h deleted file mode 100644 index 6c01d579f87..00000000000 --- a/keyboards/s60_x/keymaps/ansi_qwertz/config.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// keymap needs oneshot functionality -#undef NO_ACTION_ONESHOT - -#undef IS_COMMAND -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#endif \ No newline at end of file diff --git a/keyboards/s60_x/keymaps/ansi_qwertz/keymap.c b/keyboards/s60_x/keymaps/ansi_qwertz/keymap.c deleted file mode 100644 index e4660e66887..00000000000 --- a/keyboards/s60_x/keymaps/ansi_qwertz/keymap.c +++ /dev/null @@ -1,237 +0,0 @@ -/* -Copyright 2016 Julien Pecqueur -Copyright 2016 Felix Uhl - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include QMK_KEYBOARD_H - -//make keymap a little easier to read -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -#define ONESHOT_TAP_TOGGLE 2 -#define ONESHOT_TIMEOUT 1 - -//uncomment to activate dead keys -//#define DONT_REVIVE_DEADKEYS 1 - -//Function keycodes for better readability -//SpaceFN -//OneShot LeftShift -//GamingMode Lock (disables SpaceFn and OneShot LShift) -//Function -//Mute microphone -#define KC_SPACEFN KC_FN0 -#define KC_OSLS KC_FN3 -#define KC_GMLK KC_FN1 -#define KC_FUNC KC_FN2 -#define MICMUTE RCTL(KC_LCTL) - -enum function_codes { - F_SPACEFN = 0, - F_OSLS = 3, - F_GMLK = 1, - F_FUNC = 2 -}; - -enum layer_names { - DEFAULT, - GAMING, - FUNCTION -}; - -enum languages { - GERMAN -}; - -#define LANGUAGE GERMAN - -enum custom_keycodes { - KC_CM_A = SAFE_RANGE, -// KC_CM_B, - KC_CM_C, -// KC_CM_D, - KC_CM_E, -// KC_CM_F, - KC_CM_G, -// KC_CM_H, - KC_CM_I, -// KC_CM_J, - KC_CM_K, - KC_CM_L, - KC_CM_M, - KC_CM_N, - KC_CM_O, - KC_CM_P, -// KC_CM_Q, - KC_CM_R, - KC_CM_S, -// KC_CM_T, - KC_CM_U, -// KC_CM_V, - KC_CM_W, -// KC_CM_X, - KC_CM_Y, - KC_CM_Z -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layout 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Z| U| I| O| P| [| ]|BckSp| - * |-----------------------------------------------------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| - * |Shift | Y| X| C| V| B| N| M| ,| .| /| Up |RSft| - * |-----------------------------------------------------------| - * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| - * `-----------------------------------------------------------' - */ - [DEFAULT] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ - KC_LSFT, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ - KC_FUNC, KC_LGUI, KC_LALT, KC_SPACEFN, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT - ), - - /* Layout 1: Gaming Layer, SpaceFn disabled - * ,-----------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | | | | |Fn1 | - * |-----------------------------------------------------------| - * | |RSft| | Space | | | | | - * `-----------------------------------------------------------' - */ - [GAMING] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GMLK, \ - _______, KC_RSFT, _______, KC_SPC, _______, _______, _______, _______ - ), - - /* Layout 2: Function Layer - * MicMute requires special software to be installed. Check readme.md for more information - * ,-----------------------------------------------------------. - * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|RES| - * |-----------------------------------------------------------| - * | | | | |Prv|Ply|Nxt| � | | � | |Prt|Slk|Pau | - * |-----------------------------------------------------------| - * | | � | � | |Vl-|Mut|Vl+| | | | | |PEnt | - * |-----------------------------------------------------------| - * | | | | |MicMut|Cal| | | | |Pau |PUp |Fn1 | - * |-----------------------------------------------------------| - * | | | | | |Home|PDn |End | - * `-----------------------------------------------------------' - */ - [FUNCTION] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, RESET, \ - _______, _______, KC_CM_W, KC_CM_E, KC_MPRV, KC_MPLY, KC_MNXT, KC_CM_U, KC_CM_I, KC_CM_O, KC_CM_P, KC_PSCR, KC_SLCK, KC_PAUS, \ - _______, KC_CM_A, KC_CM_S, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_CM_K, KC_CM_L, _______, _______, _______, KC_PENT, \ - _______, _______, KC_CM_Y, _______, KC_CM_C, MICMUTE, KC_CALC, KC_CM_N, KC_CM_M, _______, _______, _______, KC_PGUP, KC_GMLK, \ - _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END - ), -}; - -/* -* Fn action definition -*/ -const uint16_t PROGMEM fn_actions[] = { - [F_SPACEFN] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), // SpaceFn layout 1 - [F_GMLK] = ACTION_LAYER_TOGGLE(1), // Disable SpaceFn and Oneshot Shift - [F_FUNC] = ACTION_LAYER_MOMENTARY(2), // SpaceFn layout 1 - [F_OSLS] = ACTION_MODS_ONESHOT(MOD_LSFT) // Oneshot Leftshift -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -}; - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_german(uint16_t keycode, keyrecord_t *record) { - uint16_t send_code = 0; - if (record->event.pressed) { - switch (keycode) { - case KC_CM_A: - send_code = KC_Q; - break; - case KC_CM_O: - send_code = KC_P; - break; - case KC_CM_U: - send_code = KC_Y; - break; - case KC_CM_S: - send_code = KC_S; - break; - } - - if (send_code == 0) { - return true; - } - else { - register_code(KC_RALT); - register_code(send_code); - unregister_code(send_code); - unregister_code(KC_RALT); - return false; - } - } - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - //revive dead keys -#ifndef DONT_REVIVE_DEADKEYS - bool shift_active = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_LSFT)); - bool altgr_active = keyboard_report->mods & (MOD_BIT(KC_RALT)); - if ((keycode == KC_QUOT && !altgr_active) || - keycode == KC_GRV || - (keycode == KC_6 && shift_active)) - { - if (record->event.pressed) { - register_code(keycode); - unregister_code(keycode); - register_code(KC_SPACE); - unregister_code(KC_SPACE); - } - return false; - } -#endif -#if LANGUAGE == GERMAN - return process_german(keycode, record); -#else - return true; -#endif -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/s60_x/keymaps/ansi_qwertz/rules.mk b/keyboards/s60_x/keymaps/ansi_qwertz/rules.mk deleted file mode 100644 index cf501225268..00000000000 --- a/keyboards/s60_x/keymaps/ansi_qwertz/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/s60_x/keymaps/bluebear/config.h b/keyboards/s60_x/keymaps/bluebear/config.h deleted file mode 100644 index 10bddf0d371..00000000000 --- a/keyboards/s60_x/keymaps/bluebear/config.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#undef DEVICE_VER -#define DEVICE_VER 0x0003 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Backlight configuration - */ -#define BACKLIGHT_LEVELS 3 - -/* Underlight configuration - */ -#undef RGBLIGHT_HUE_STEP -#undef RGBLIGHT_SAT_STEP -#undef RGBLIGHT_VAL_STEP -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -// For Tap Dancing - -#define TAPPING_TOGGLE 1 -#define TAPPING_TERM 300 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -#define MIDI_TONE_KEYCODE_OCTAVES 2 - -// Space Cadet Rollover - if set, allows to tap opposite shift key to cancel erroneous press -#define DISABLE_SPACE_CADET_ROLLOVER - -#endif diff --git a/keyboards/s60_x/keymaps/custom/keymap.c b/keyboards/s60_x/keymaps/custom/keymap.c deleted file mode 100644 index 942fadf4a89..00000000000 --- a/keyboards/s60_x/keymaps/custom/keymap.c +++ /dev/null @@ -1,28 +0,0 @@ -#include QMK_KEYBOARD_H - -/* Main layer: Test layout, using all keys. - - 0 1 2 3 4 5 6 7 8 9 A B C D E - ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - 0 │GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │PGUP │BKSPC│ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - 1 │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - 2 │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │PGDN │ENTER│█████│ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - 3 │LSHFT│HOME │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ END │RSHFT│ UP │ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - 4 │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ - └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: ANSI qwerty */ - LAYOUT_kc(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, PGUP, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ - CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, PGDN, ENT , \ - LSFT, HOME, Z, X, C, V, B, N, M, COMM, DOT, SLSH, END, RSFT, UP, \ - LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), -}; -const uint16_t PROGMEM fn_actions[] = {}; - diff --git a/keyboards/s60_x/keymaps/default/keymap.c b/keyboards/s60_x/keymaps/default/keymap.c deleted file mode 100644 index c730505cdb1..00000000000 --- a/keyboards/s60_x/keymaps/default/keymap.c +++ /dev/null @@ -1,55 +0,0 @@ -#include QMK_KEYBOARD_H - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* 0: Main layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - /* 0: ANSI qwerty */ - [0] = LAYOUT_60_ansi( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_FN0, KC_APP, KC_RCTL \ - ), - - /* 1: Fn layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - [1] = LAYOUT_60_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ - _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay -}; diff --git a/keyboards/s60_x/keymaps/default_rgb/keymap.c b/keyboards/s60_x/keymaps/default_rgb/keymap.c deleted file mode 100644 index fdaa6065bd0..00000000000 --- a/keyboards/s60_x/keymaps/default_rgb/keymap.c +++ /dev/null @@ -1,57 +0,0 @@ -#include QMK_KEYBOARD_H - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* 0: Main layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - /* 0: ANSI qwerty */ - [0] = LAYOUT_60_ansi( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_FN0, KC_APP, KC_RCTL \ - ), - - /* 1: Fn layer - * UG = Underglow = RGB Backlighting - * BL = Backlighting = In-Switch LED - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│ │BLDEC│BLTOG│BLINC│▒▒▒▒▒│ │▒▒▒▒▒│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - [1] = LAYOUT_60_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ - _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, BL_DEC, BL_TOGG, BL_INC, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay -}; diff --git a/keyboards/s60_x/keymaps/iso/keymap.c b/keyboards/s60_x/keymaps/iso/keymap.c deleted file mode 100644 index d10bfcc1365..00000000000 --- a/keyboards/s60_x/keymaps/iso/keymap.c +++ /dev/null @@ -1,48 +0,0 @@ -#include QMK_KEYBOARD_H - -/* 0: Main layer -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: ANSI qwerty */ - LAYOUT_kc(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, NO, \ - CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT , \ - LSFT, BSLS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ - LCTL, LGUI, LALT, SPC, RALT, FN0, APP, RCTL), - -/* 1: Fn layer -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ - LAYOUT_kc( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ - TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, PGDN, PSCR, SLCK, PAUS, TRNS, \ - TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay -}; diff --git a/keyboards/s60_x/keymaps/iso_rgb/keymap.c b/keyboards/s60_x/keymaps/iso_rgb/keymap.c deleted file mode 100644 index d76055a82e7..00000000000 --- a/keyboards/s60_x/keymaps/iso_rgb/keymap.c +++ /dev/null @@ -1,50 +0,0 @@ -#include QMK_KEYBOARD_H - -/* 0: Main layer -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: ANSI qwerty */ - LAYOUT(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NO, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT , \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_FN0, KC_APP, KC_RCTL), - -/* 1: Fn layer -UG = Underglow = RGB Backlighting -BL = Backlighting = In-Switch LED -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│ │BLDEC│BLTOG│BLINC│▒▒▒▒▒│ │▒▒▒▒▒│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ - LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay -}; diff --git a/keyboards/s60_x/keymaps/plain/keymap.c b/keyboards/s60_x/keymaps/plain/keymap.c deleted file mode 100644 index abf7ede2c47..00000000000 --- a/keyboards/s60_x/keymaps/plain/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include QMK_KEYBOARD_H - -/* Main layer: -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - LAYOUT_kc(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ - CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ - LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ - LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), -}; -const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboards/s60_x/readme.md b/keyboards/s60_x/readme.md deleted file mode 100644 index ddb0d4ba66f..00000000000 --- a/keyboards/s60_x/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -S60-x -===== -DIY compact keyboard designed by VinnyCordeiro for Sentraq. Most of the keymaps are based on GH60 code. This is a port from TMK to QMK based on the [original S60-X Repo](https://github.com/VinnyCordeiro/tmk_keyboard). - -Keyboard Maintainer: QMK Community -Hardware Supported: S60-x PCB -Hardware Availability: https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open - -There are two versions of this keyboard, an RGB and a non RGB one. - -Make example for this keyboard (after setting up your build environment): - - make s60_x:default - -Make example for rgb version of this keyboard: - - make s60_x/rgb:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/s60_x/rgb/config.h b/keyboards/s60_x/rgb/config.h deleted file mode 100644 index d9c26658dfd..00000000000 --- a/keyboards/s60_x/rgb/config.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef RBG_CONFIG_H -#define RBG_CONFIG_H - -#include "config_common.h" - -#define PRODUCT S60-X-RGB -#define DESCRIPTION q.m.k. keyboard firmware for S60-X RGB - -/* key matrix pins */ -#define MATRIX_ROW_PINS { B5, B4, D7, D6, D4 } -#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, B6, C6, C7, F1, F0, E6, B3, B2, B1, B0 } -#define UNUSED_PINS - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -#define RGB_DI_PIN F6 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 10 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -#endif diff --git a/keyboards/s60_x/rgb/info.json b/keyboards/s60_x/rgb/info.json deleted file mode 100644 index 1aa2dbf3e00..00000000000 --- a/keyboards/s60_x/rgb/info.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "keyboard_name": "S60-X", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_ansi_split_bs_rshift": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_iso": { - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - } - } -} \ No newline at end of file diff --git a/keyboards/s60_x/rgb/rgb.h b/keyboards/s60_x/rgb/rgb.h deleted file mode 100644 index d70473eeaaa..00000000000 --- a/keyboards/s60_x/rgb/rgb.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef S60XRGB_H -#define S60XRGB_H - -#include "quantum.h" - -#define XXX KC_NO - - -#define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, XXX }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX } \ -} - - -#define LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, XXX, }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ -} - - -#define LAYOUT_60_ansi_split_bs_rshift( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ -} - - -#define LAYOUT_60_iso( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, XXX, }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, XXX, }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, XXX, }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ -} - - -/*This special definition is used for S60-X keymaps that were ported from TMK - * QMK has a lot of keycodes that don't start with KC_, so using the regular KEYMAP macro is recommended - */ -#define LAYOUT_kc( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, XXX }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, XXX }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \ - { KC_##K40, KC_##K41, KC_##K42, XXX, XXX, XXX, KC_##K46, XXX, XXX, XXX, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, XXX } \ -} - -#endif diff --git a/keyboards/s60_x/rgb/rules.mk b/keyboards/s60_x/rgb/rules.mk deleted file mode 100644 index 42d45c332bd..00000000000 --- a/keyboards/s60_x/rgb/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable RGB light \ No newline at end of file diff --git a/keyboards/s60_x/rules.mk b/keyboards/s60_x/rules.mk deleted file mode 100644 index 9f0ae7caebd..00000000000 --- a/keyboards/s60_x/rules.mk +++ /dev/null @@ -1,69 +0,0 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 - -DEFAULT_FOLDER = s60_x/default - -LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_iso diff --git a/keyboards/s60_x/s60_x.c b/keyboards/s60_x/s60_x.c deleted file mode 100644 index 595418bfacc..00000000000 --- a/keyboards/s60_x/s60_x.c +++ /dev/null @@ -1 +0,0 @@ -#include "s60_x.h" \ No newline at end of file diff --git a/keyboards/s60_x/s60_x.h b/keyboards/s60_x/s60_x.h deleted file mode 100644 index b70cb5864b1..00000000000 --- a/keyboards/s60_x/s60_x.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef S60X_H -#define S60X_H - -#ifdef KEYBOARD_s60_x_default - #include "default.h" -#endif -#ifdef KEYBOARD_s60_x_rgb - #include "rgb.h" -#endif - -#include "quantum.h" - -#endif diff --git a/keyboards/s65_plus/config.h b/keyboards/s65_plus/config.h deleted file mode 100644 index 60512db4625..00000000000 --- a/keyboards/s65_plus/config.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define PRODUCT S65-PLUS -#define DESCRIPTION q.m.k. keyboard firmware for S65-PLUS -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Sentraq - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 18 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 } -#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, E6, B0, B1, D5, B2, B3, D0, D1, D2, D4, D6, D7, F7 } -#define UNUSED_PINS - -/* number of backlight levels */ -#define BACKLIGHT_PIN B7 -#define BACKLIGHT_LEVELS 3 - -#define RGB_DI_PIN D3 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 20 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 20 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#endif diff --git a/keyboards/s65_plus/keymaps/default/keymap.c b/keyboards/s65_plus/keymaps/default/keymap.c deleted file mode 100644 index 04f6926de14..00000000000 --- a/keyboards/s65_plus/keymaps/default/keymap.c +++ /dev/null @@ -1,53 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _BL 0 -#define _AL 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: Main layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ F1 │ F2 │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ F3 │ F4 │ TAB │▒▒▒▒▒│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ F5 │ F6 │CAPSL│▒▒▒▒▒│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ F7 │ F8 │▒▒▒▒▒│LSHFT│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ F9 │ F10 │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │RCTL │LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 0: ANSI qwerty */ - [_BL] = LAYOUT_ansi( - KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ - KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, \ - KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ - KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_AL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - - - /* 1: LED layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │RESET│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│BLTOG│BLSTP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │▒▒▒▒▒│ │UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│UGVAI│UGVAD│ │ │▒▒▒▒▒│ │VOLU │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │PREV │VOLD │NEXT │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_AL] = LAYOUT_ansi( - KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_STEP, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT) -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/s65_plus/readme.md b/keyboards/s65_plus/readme.md deleted file mode 100644 index 426a6612d81..00000000000 --- a/keyboards/s65_plus/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -S65-PLUS -===== - -DIY 65% keyboard from Sentraq. - -Keyboard Maintainer: QMK Community -Hardware Supported: S65-PLUS PCB -Hardware Availability: https://sentraq.com/collections/kits/products/s65-plus-diy-keyboard-kit - -Make example for this keyboard (after setting up your build environment): - - make s65_plus:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/s65_plus/s65_plus.h b/keyboards/s65_plus/s65_plus.h deleted file mode 100644 index 2ff445f6c96..00000000000 --- a/keyboards/s65_plus/s65_plus.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef S60PLUS_H -#define S60PLUS_H - -#include "quantum.h" - -#define LAYOUT_ansi( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K016, K017, \ - K100, K101, K102, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, \ - K200, K201, K202, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, \ - K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, K316, K317, \ - K400, K401, K402, K403, K404, K408, K412, K413, K414, K415, K416, K417 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, KC_NO, K016, K017 }, \ - { K100, K101, K102, KC_NO, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117 }, \ - { K200, K201, K202, KC_NO, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, KC_NO, K216, K217 }, \ - { K300, K301, KC_NO, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315, K316, K317 }, \ - { K400, K401, K402, K403, K404, KC_NO, KC_NO, KC_NO, K408, KC_NO, KC_NO, KC_NO, K412, K413, K414, K415, K416, K417 } \ -} - -void matrix_init_user(void); -void matrix_scan_user(void); - -#endif diff --git a/keyboards/s65_x/config.h b/keyboards/s65_x/config.h deleted file mode 100644 index 367efc526c6..00000000000 --- a/keyboards/s65_x/config.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define PRODUCT S65-X-RGB -#define DESCRIPTION QMK keyboard firmware for S65-X RGB -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Sentraq - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 18 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 } -#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, E6, B0, B1, D5, B2, B3, D0, D1, D2, D4, D6, D7, F7 } -#define UNUSED_PINS - -/* number of backlight levels */ -#define BACKLIGHT_PIN B7 -#define BACKLIGHT_LEVELS 3 - -#define RGB_DI_PIN D3 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 20 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 20 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#endif diff --git a/keyboards/s65_x/info.json b/keyboards/s65_x/info.json deleted file mode 100644 index 74c805e2454..00000000000 --- a/keyboards/s65_x/info.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "keyboard_name": "S65-X PCB", - "url": "", - "maintainer": "qmk", - "width": 18, - "height": 5, - "layouts": { - "LAYOUT_ansi": { - "key_count": 68, - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Delete", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] - }, - "LAYOUT_iso": { - "key_count": 69, - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Delete", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"PgUp", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] - }, - "LAYOUT_plus_ansi": { - "key_count": 78, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Delete", "x":17, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"PgUp", "x":17, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"PgDn", "x":17, "y":2}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"\u2191", "x":16, "y":3}, {"label":"End", "x":17, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Alt", "x":12, "y":4}, {"label":"Fn", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"\u2190", "x":15, "y":4}, {"label":"\u2193", "x":16, "y":4}, {"label":"\u2192", "x":17, "y":4}] - }, - "LAYOUT_plus_iso": { - "key_count": 79, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"\"", "x":4, "y":0}, {"label":"\u00a3", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Delete", "x":17, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"PgUp", "x":17, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"@", "x":13.75, "y":2}, {"label":"~", "x":14.75, "y":2}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"PgDn", "x":17, "y":2}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"label":"|", "x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"\u2191", "x":16, "y":3}, {"label":"End", "x":17, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"AltGr", "x":12, "y":4}, {"label":"Fn", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"\u2190", "x":15, "y":4}, {"label":"\u2193", "x":16, "y":4}, {"label":"\u2192", "x":17, "y":4}] - } - } -} diff --git a/keyboards/s65_x/keymaps/default/keymap.c b/keyboards/s65_x/keymaps/default/keymap.c deleted file mode 100644 index 3d0b9d72d74..00000000000 --- a/keyboards/s65_x/keymaps/default/keymap.c +++ /dev/null @@ -1,103 +0,0 @@ -#include "s65_x.h" - -#define _BL 0 -#define _AL 1 -#define _FL 2 -#define _UL 3 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: Main layer, swapped alt and GUI for Mac - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 0: ANSI qwerty */ - [_BL] = LAYOUT_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ - F(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - - - /* 1: Locking arrow keys to WASD for when you need dedicated arrow keys - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_AL] = LAYOUT_ansi( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - /* 2: Fn layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│_UL │ │ │ │ │ │ │ │Home │End │▒▒▒▒▒│ │Vol+ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_FL] = LAYOUT_ansi( - KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ - KC_TRNS, F(1), KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, F(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_MPLY), - - /* 3: Locking layer for controlling the underglow - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ On │Mode │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_UL] = LAYOUT_ansi( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(_FL), // Momentary Fn overlay - [1] = ACTION_LAYER_TOGGLE(_AL), // Toggle Arrow Layer overlay - [2] = ACTION_LAYER_TAP_KEY(_FL, KC_CAPS),// Tap to toggle caps lock and hold to activate function layer - [3] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay -}; - diff --git a/keyboards/s65_x/keymaps/default/readme.md b/keyboards/s65_x/keymaps/default/readme.md deleted file mode 100644 index 213cbe49e5c..00000000000 --- a/keyboards/s65_x/keymaps/default/readme.md +++ /dev/null @@ -1,27 +0,0 @@ -### 1 ANSI -A Mac ANSI layout that assumes standard sized shifts, enter, and backspace keys. - -#### 1.0 Default layer - ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │▒▒▒▒▒│END │ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│▒▒▒▒▒│PG_UP│ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ - └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -#### 1.1 Fn layer - ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ │▒▒▒▒▒│_UL │ │ │ │ │ │ │Home │ End │ │▒▒▒▒▒│▒▒▒▒▒│Vol+ │ │ - ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ - └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s65_x/keymaps/iso/keymap.c b/keyboards/s65_x/keymaps/iso/keymap.c deleted file mode 100644 index 9e888d9a87b..00000000000 --- a/keyboards/s65_x/keymaps/iso/keymap.c +++ /dev/null @@ -1,103 +0,0 @@ -#include "s65_x.h" - -#define _BL 0 -#define _AL 1 -#define _FL 2 -#define _UL 3 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: Main layer, swapped alt and GUI for Mac - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│▒▒▒▒▒│END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ ~ │▒▒▒▒▒│ENTER│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 0: ISO qwerty */ - [_BL] = LAYOUT_iso( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_END, \ - F(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_GRAVE, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - - - /* 1: Locking arrow keys to WASD for when you need dedicated arrow keys - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ Up │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_AL] = LAYOUT_iso( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - /* 2: Fn layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │_UL │ │ │ │ │ │ │ │ Home│ End │▒▒▒▒▒│ │Vol+ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_FL] = LAYOUT_iso( - KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ - KC_TRNS, F(1), KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, F(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_MPLY), - - /* 3: Locking layer for controlling the underglow - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ On │Mode │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_UL] = LAYOUT_iso( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(_FL), // Momentary Fn overlay - [1] = ACTION_LAYER_TOGGLE(_AL), // Toggle Arrow Layer overlay - [2] = ACTION_LAYER_TAP_KEY(_FL, KC_CAPS),// Tap to toggle caps lock and hold to activate function layer - [3] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay -}; - diff --git a/keyboards/s65_x/keymaps/kelorean/keymap.c b/keyboards/s65_x/keymaps/kelorean/keymap.c deleted file mode 100644 index 696b664e0ca..00000000000 --- a/keyboards/s65_x/keymaps/kelorean/keymap.c +++ /dev/null @@ -1,150 +0,0 @@ -#include "s65_x.h" - -#define _BL 0 -#define _CM 1 -#define _DV 2 -#define _AL 3 -#define _FL 4 -#define _UL 5 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: Main layer, swapped alt and GUI for Mac - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │BKSPC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 0: ANSI qwerty */ - [_BL] = LAYOUT_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ - F(4), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - - /* 1: Colemak layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 1: Colemak layer */ - [_CM] = LAYOUT_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ - F(4), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - - - /* 2: Dvorak layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │BKSPC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 2: Dvorak layer */ - [_DV] = LAYOUT_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_END, \ - F(4), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - - /* 3: Locking arrow keys to WASD for when you need dedicated arrow keys - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - /* 3: Locking arrow keys to WASD*/ - [_AL] = LAYOUT_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - - /* 4: Fn layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│_UL │ │_CM │_DV │ │ │ │ │Home │End │▒▒▒▒▒│ │Vol+ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_FL] = LAYOUT_ansi( - KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ - _______, F(3), KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, _______, \ - _______, F(5), _______, F(1), F(2), _______, _______, _______, KC_HOME, KC_END, _______, _______, KC_VOLU, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_MPLY), - - /* 5: Locking layer for controlling the underglow - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ On │Mode │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_UL] = LAYOUT_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(_FL), // Momentary Fn overlay - [1] = ACTION_LAYER_TOGGLE(_CM), //Toggle Colemak Layer overlay - [2] = ACTION_LAYER_TOGGLE(_DV), // Toggle Dvorak Layer overlay - [3] = ACTION_LAYER_TOGGLE(_AL), // Toggle Arrow Layer overlay - [4] = ACTION_LAYER_TAP_KEY(_FL, KC_BSPC), // Tap to Backspace and hold to activate function layer - [5] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay - -}; diff --git a/keyboards/s65_x/keymaps/nall/keymap.c b/keyboards/s65_x/keymaps/nall/keymap.c deleted file mode 100644 index 9361d78ba71..00000000000 --- a/keyboards/s65_x/keymaps/nall/keymap.c +++ /dev/null @@ -1,102 +0,0 @@ -#include "s65_x.h" - -#define _BL 0 -#define _AL 1 -#define _FL 2 -#define _UL 3 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: Main layer, swapped alt and GUI for Mac - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│END │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 0: ANSI qwerty */ - [_BL] = LAYOUT_ansi( - KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ - F(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - - - /* 1: Locking arrow keys to WASD for when you need dedicated arrow keys - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_AL] = LAYOUT_ansi( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - /* 2: Fn layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│_UL │ │ │ │ │ │ │ │Home │End │▒▒▒▒▒│ │Vol+ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_FL] = LAYOUT_ansi( - KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ - KC_TRNS, F(1), KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, F(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_MPLY), - - /* 3: Locking layer for controlling the underglow - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ On │Mode │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - [_UL] = LAYOUT_ansi( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(_FL), // Momentary Fn overlay - [1] = ACTION_LAYER_TOGGLE(_AL), // Toggle Arrow Layer overlay - [2] = ACTION_LAYER_TAP_KEY(_FL, KC_CAPS),// Tap to toggle caps lock and hold to activate function layer - [3] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay -}; - diff --git a/keyboards/s65_x/keymaps/s65plus/keymap.c b/keyboards/s65_x/keymaps/s65plus/keymap.c deleted file mode 100644 index 1f3ffa3abde..00000000000 --- a/keyboards/s65_x/keymaps/s65plus/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _BL 0 -#define _FL 1 - -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: ANSI qwerty */ - [_BL] = LAYOUT_plus_ansi( \ - KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ - KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ - KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ - ), - - - [_FL] = LAYOUT_plus_ansi( \ - KC_F1, KC_F2, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_STEP, \ - KC_F3, KC_F4, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_F5, KC_F6, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_F7, KC_F8, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, KC_VOLU, _______, \ - KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT \ - ), - -}; diff --git a/keyboards/s65_x/keymaps/s65plus/readme.md b/keyboards/s65_x/keymaps/s65plus/readme.md deleted file mode 100644 index f083fb8fd34..00000000000 --- a/keyboards/s65_x/keymaps/s65plus/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# S65-Plus default keymap - -This is the default keymap for the Sentraq S65-Plus. - -[S65-Plus default keymap](http://www.keyboard-layout-editor.com/##@@_a:6&f:9&w:9&d:true;&=S65-Plus%20default%20keymap&_w:9&d:true;&=%0A%0ABase%20layer;&@_a:4&f:3;&=F1&=F2&=Esc&=!%0A1&=/@%0A2&=#%0A3&=$%0A4&=%25%0A5&=%5E%0A6&=/&%0A7&=*%0A8&=(%0A9&=)%0A0&=/_%0A-&=+%0A/=&_w:2;&=Backspace&=Delete;&@=F3&=F4&_w:1.5;&=Tab&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&=%7B%0A%5B&=%7D%0A%5D&_w:1.5;&=%7C%0A%5C&=PgUp;&@=F5&=F6&_w:1.75;&=Caps%20Lock&=A&=S&=D&=F&=G&=H&=J&=K&=L&=/:%0A/;&=%22%0A%27&_w:2.25;&=Enter&=PgDn;&@=F7&=F8&_w:2.25;&=Shift&=Z&=X&=C&=V&=B&=N&=M&=%3C%0A,&=%3E%0A.&=?%0A//&_w:1.75;&=Shift&=%E2%86%91&=End;&@=F9&=F10&_w:1.25;&=Ctrl&_w:1.25;&=Win&_w:1.25;&=Alt&_a:7&w:6.25;&=&_a:4;&=Alt&=Fn&=Ctrl&=%E2%86%90&=%E2%86%93&=%E2%86%92;&@_x:9&a:6&f:9&w:9&d:true;&=%0A%0AFunction%20layer;&@_a:7&f:3;&=&=&_a:4;&=Reset&_a:7;&=&=&=&=&=&=&=&=&=&=&=&=&_a:4&w:2;&=Backlight%20Toggle&=Back-light%20Step;&@_a:7;&=&=&_w:1.5;&=&=&=&=&=&=&=&=&=&=&=&=&=&_w:1.5;&=&=;&@=&=&_w:1.75;&=&=&=&=&=&=&=&=&=&=&=&=&_w:2.25;&=&=;&@=&=&_w:2.25;&=&_a:4;&=RGB%20Tog-gle&=RGB%20Mode&=RGB%20Hue%20Inc&=RGB%20Hue%20Dec&=RGB%20Sat%20Inc&=RGB%20Sat%20Dec&=RGB%20Value%20Inc&=RGB%20Value%20Dec&_a:7;&=&=&_w:1.75;&=&_a:4;&=Vol%20Up&_a:7;&=;&@=&=&_w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_w:6.25;&=&=&=&=&_a:4;&=Prev.%20Track%20(Win)&=Vol%20Down&=Next%20Track%20(Win)) diff --git a/keyboards/s65_x/keymaps/smt/keymap.c b/keyboards/s65_x/keymaps/smt/keymap.c deleted file mode 100644 index ce21859acd6..00000000000 --- a/keyboards/s65_x/keymaps/smt/keymap.c +++ /dev/null @@ -1,163 +0,0 @@ -#include "s65_x.h" - -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _FL 3 -#define _CL 4 - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK -}; - -// Helpful defines -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: Qwerty layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ ` │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │H_TAB│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │C_ESC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 0: ANSI qwerty */ - [_QWERTY] = LAYOUT_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, \ - HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ - CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), - - /* 1: Colemak layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ ` │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │H_TAB│ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│ DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │C_ESC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 1: ANSI colemak */ - [_COLEMAK] = LAYOUT_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, \ - HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ - CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), - - /* 2: Dvorak layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│ ` │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │H_TAB│ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│ DEL │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │C_ESC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_UP│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │PG_DN│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 2: ANSI dvorak */ - [_DVORAK] = LAYOUT_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_GRV, \ - HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, \ - CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), - - /* 3: Function layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ F13 │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │ │ │ │ │PRSCR│SCLCK│PAUSE│ │ │ │█████│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │PG_UP│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ _FL │ │HOME │PG_DN│ END │ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 3: ANSI Fn layer */ - [_FL] = LAYOUT_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, \ - _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, MO(_FL), _______, KC_HOME, KC_PGDN, KC_END), - - /* 4: Control layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ RGB │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │RESET│ │ │QWRTY│COLMK│DVORK│ │ │ │ │█████│RGBV+│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│RGBV-│ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ _FL │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │RGBS+│ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │█████│█████│█████│RGB_M│█████│█████│█████│ │ _FL │ │RGBH-│RGBS-│RGBH+│ - * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ - - /* 4: ANSI control layer */ - [_CL] = LAYOUT_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, \ - _______, _______, _______, _______, RESET, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, RGB_VAI, \ - _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, \ - MO(_FL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, _______, \ - _______, _______, _______, RGB_MOD, _______, MO(_FL), _______, RGB_HUD, RGB_SAD, RGB_HUI), -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - } - return true; -} diff --git a/keyboards/s65_x/readme.md b/keyboards/s65_x/readme.md deleted file mode 100644 index 5cb08c9c8f8..00000000000 --- a/keyboards/s65_x/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -S65-X -===== - -DIY 65% keyboard from Sentraq. - -Keyboard Maintainer: QMK Community -Hardware Supported: S65-X PCB -Hardware Availability: https://sentraq.com/collections/group-buys/products/gb-s65-x-rgb-diy-kit?variant=39246723914 - -Make example for this keyboard (after setting up your build environment): - - make s65_x:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/s65_x/rules.mk b/keyboards/s65_x/rules.mk deleted file mode 100644 index 26a0a44b65b..00000000000 --- a/keyboards/s65_x/rules.mk +++ /dev/null @@ -1,67 +0,0 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable RGB light diff --git a/keyboards/s65_x/s65_x.c b/keyboards/s65_x/s65_x.c deleted file mode 100644 index 29073750c16..00000000000 --- a/keyboards/s65_x/s65_x.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "s65_x.h" -#include "led.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); -}; - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -}; - -void led_set_kb(uint8_t usb_led) { - if (usb_led & (1<", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_small_lshift": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_small_bspc": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_small_lshift_small_bspc": { + "key_count": 74, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_1u": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_1u_small_lshift": { + "key_count": 74, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_1u_small_bspc": { + "key_count": 74, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_1u_small_lshift_small_bspc": { + "key_count": 75, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_7u": { + "key_count": 71, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_7u_small_lshift": { + "key_count": 72, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_7u_small_bspc": { + "key_count": 72, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_7u_small_lshift_small_bspc": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_blocker": { + "key_count": 72, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_blocker_small_lshift": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_blocker_small_bspc": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_blocker_small_lshift_small_bspc": { + "key_count": 74, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_blocker_7u": { + "key_count": 71, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"label":"Space", "x":6, "y":4, "w":7}, + {"label":"Fn", "x":13, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_blocker_7u_small_lshift": { + "key_count": 72, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"label":"Space", "x":6, "y":4, "w":7}, + {"label":"Fn", "x":13, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_blocker_7u_small_bspc": { + "key_count": 72, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"label":"Space", "x":6, "y":4, "w":7}, + {"label":"Fn", "x":13, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_ansi_blocker_7u_small_lshift_small_bspc": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"label":"Space", "x":6, "y":4, "w":7}, + {"label":"Fn", "x":13, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso_small_bspc": { + "key_count": 74, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso_1u": { + "key_count": 74, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso_1u_small_bspc": { + "key_count": 75, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso_7u": { + "key_count": 72, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso_7u_small_bspc": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso_blocker": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso_blocker_small_bspc": { + "key_count": 74, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso_blocker_7u": { + "key_count": 72, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"x":6, "y":4, "w":6.75}, + {"label":"Fn", "x":12.75, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + }, + "LAYOUT_iso_blocker_7u_small_bspc": { + "key_count": 73, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"label":"Space", "x":6, "y":4, "w":7}, + {"label":"Fn", "x":13, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] + } + } +} diff --git a/keyboards/s7_elephant/keymaps/default/config.h b/keyboards/s7_elephant/keymaps/default/config.h new file mode 100644 index 00000000000..85f62371e9f --- /dev/null +++ b/keyboards/s7_elephant/keymaps/default/config.h @@ -0,0 +1 @@ +#define RGBLIGHT_LIMIT_VAL 80 diff --git a/keyboards/s7_elephant/keymaps/default/keymap.c b/keyboards/s7_elephant/keymaps/default/keymap.c new file mode 100644 index 00000000000..339f2d379c6 --- /dev/null +++ b/keyboards/s7_elephant/keymaps/default/keymap.c @@ -0,0 +1,64 @@ +#include QMK_KEYBOARD_H + +enum custom_layers { + _QWERTY, + _FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------. ,-------------------------------------------------------------------------------------------------. + * | F1 | | Esc`~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |Home | + * |------| |-------------------------------------------------------------------------------------------------| + * | F2 | | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | End | + * |------| |-------------------------------------------------------------------------------------------------| + * | F3 | | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Ins | + * |------| |-------------------------------------------------------------------------------------------------| + * | F4 | | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | U | Del | + * |------| |-------------------------------------------------------------------------------------------------| + * | F5 | | Ctrl | Gui | Alt | Space | FN | RCtrl | L | D | R | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT_ansi( +KC_F1, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, +KC_F2, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, +KC_F3, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, +KC_F4, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, +KC_F5, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* FN + * ,------. ,-------------------------------------------------------------------------------------------------. + * |Reset | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr | ScrLck |Pause| + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | |Prev |Play |Next | | | | |VolD |Mute |VolU | | |PgUp | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | |PgDn | + * |------| |-------------------------------------------------------------------------------------------------| + * |EEPRST| | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +[_FN] = LAYOUT_ansi( +RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +_______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_PGUP, +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, +EEP_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +}; + +void led_set_user(uint8_t usb_led) { + // Turn LEDs On/Off for Caps Lock + if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom(0, 0, 80); + } else { + rgblight_sethsv_noeeprom(0, 0, 80); + rgblight_disable_noeeprom(); + } +} diff --git a/keyboards/s7_elephant/keymaps/default/readme.md b/keyboards/s7_elephant/keymaps/default/readme.md new file mode 100644 index 00000000000..c4fe30acdd5 --- /dev/null +++ b/keyboards/s7_elephant/keymaps/default/readme.md @@ -0,0 +1,35 @@ +# Default keymap for S7 Elephant + +**Features** + +* LEDs are functioning as Caps-Lock indicators + +## QWERTY (Normal) Layer +``` +,------. ,-------------------------------------------------------------------------------------------------. +| F1 | | Esc`~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |Home | +|------| |-------------------------------------------------------------------------------------------------| +| F2 | | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | End | +|------| |-------------------------------------------------------------------------------------------------| +| F3 | | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Ins | +|------| |-------------------------------------------------------------------------------------------------| +| F4 | | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | U | Del | +|------| |-------------------------------------------------------------------------------------------------| +| F5 | | Ctrl | Gui | Alt | Space | FN | RAlt | RCtrl | L | D | R | +`------' `-------------------------------------------------------------------------------------------------' +``` + +## FN Layer +``` +,------. ,-------------------------------------------------------------------------------------------------. +|Reset | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr | ScrLck |Pause| +|------| |-------------------------------------------------------------------------------------------------| +| | | | | | | | | | | | | | | | | | +|------| |-------------------------------------------------------------------------------------------------| +| | | |Prev |Play |Next | | | | |VolD |Mute |VolU | | |PgUp | +|------| |-------------------------------------------------------------------------------------------------| +| | | | | | | | | | | | | | | |PgDn | +|------| |-------------------------------------------------------------------------------------------------| +|EPRM | | | | | | | | | | | | +`------' `-------------------------------------------------------------------------------------------------' +``` diff --git a/keyboards/s7_elephant/readme.md b/keyboards/s7_elephant/readme.md new file mode 100644 index 00000000000..466e3f7316d --- /dev/null +++ b/keyboards/s7_elephant/readme.md @@ -0,0 +1,17 @@ +# S7 Elephant + +![S7 Elephant](https://i.imgur.com/CaHxKBJ.jpg) + +A high-end 70% custom keyboard designed and produced by [jacky](https://geekhack.org/index.php?action=profile;u=63864) from Geekhack. + +Keyboard Maintainer: QMK Community +Hardware Supported: S7 Elephant +Hardware Availability: [The GB has ended with little chance to run again.](https://geekhack.org/index.php?topic=96434.0) + +Make example for this keyboard (after setting up your build environment): + + make s7_elephant:default:dfu + +To enter the bootloader, either short the pins on the PCB or the RESET button on the FN layer. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/s7_elephant/rules.mk b/keyboards/s7_elephant/rules.mk new file mode 100644 index 00000000000..7f0ad6d3c57 --- /dev/null +++ b/keyboards/s7_elephant/rules.mk @@ -0,0 +1,52 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality diff --git a/keyboards/s7_elephant/s7_elephant.c b/keyboards/s7_elephant/s7_elephant.c new file mode 100644 index 00000000000..a869f46dbe5 --- /dev/null +++ b/keyboards/s7_elephant/s7_elephant.c @@ -0,0 +1 @@ +#include "s7_elephant.h" diff --git a/keyboards/s7_elephant/s7_elephant.h b/keyboards/s7_elephant/s7_elephant.h new file mode 100644 index 00000000000..c351ffdb91b --- /dev/null +++ b/keyboards/s7_elephant/s7_elephant.h @@ -0,0 +1,855 @@ +#ifndef S7_ELEPHANT_H +#define S7_ELEPHANT_H + +#include "quantum.h" + +#define ____ KC_NO + +/* ANSI + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small shift + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small shift and small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ANSI with 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_1u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* ANSI with small shift and 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_1u_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* ANSI with small backspace and 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_1u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* ANSI with small shift and small backspace and 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_1u_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ANSI with 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_7u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small shift and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_7u_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_7u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small shift and small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_7u_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ANSI with blocker + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_ansi_blocker( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small shift + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_ansi_blocker_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_ansi_blocker_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small shift and small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_ansi_blocker_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ANSI with blocker and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_ansi_blocker_7u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small shift and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_ansi_blocker_7u_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_ansi_blocker_7u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small shift and small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_ansi_blocker_7u_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ISO + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ISO with small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ISO with 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_1u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* ISO with small backspace and 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_1u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ISO with 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_7u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ISO with small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_7u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} +/* **************************************************************************************************************************************** */ +/* ISO with blocker + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_iso_blocker( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ISO with blocker and small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_iso_blocker_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ISO with blocker and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_iso_blocker_7u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* ISO with blocker and small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_iso_blocker_7u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} +#endif diff --git a/keyboards/satan/config.h b/keyboards/satan/config.h index eb357b39e07..d8c9ae9ab57 100644 --- a/keyboards/satan/config.h +++ b/keyboards/satan/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -26,7 +25,7 @@ along with this program. If not, see . #define DEVICE_VER 0x0003 #define MANUFACTURER SATAN #define PRODUCT GH60 -#define DESCRIPTION QMK keyboard firmware for Satan GH60 with WS2812 support +#define DESCRIPTION 60% keyboard with backlight and WS2812 support /* key matrix size */ #define MATRIX_ROWS 5 @@ -47,28 +46,22 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Backlight configuration */ #define BACKLIGHT_LEVELS 4 -/* Underlight configuration +/* Underglow configuration */ - #define RGB_DI_PIN E2 #define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 // Number of LEDs +#define RGBLED_NUM 8 #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 @@ -90,5 +83,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/satan/info.json b/keyboards/satan/info.json index d0beb723b74..2b2e96ed19c 100644 --- a/keyboards/satan/info.json +++ b/keyboards/satan/info.json @@ -20,8 +20,11 @@ "LAYOUT_60_iso_split_bs_rshift": { "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0}, {"label":"k05", "x":5, "y":0}, {"label":"k06", "x":6, "y":0}, {"label":"k07", "x":7, "y":0}, {"label":"k08", "x":8, "y":0}, {"label":"k09", "x":9, "y":0}, {"label":"k0a", "x":10, "y":0}, {"label":"k0b", "x":11, "y":0}, {"label":"k0c", "x":12, "y":0}, {"label":"k0d", "x":13, "y":0}, {"label":"k49", "x":14, "y":0}, {"label":"k10", "x":0, "y":1, "w":1.5}, {"label":"k11", "x":1.5, "y":1}, {"label":"k12", "x":2.5, "y":1}, {"label":"k13", "x":3.5, "y":1}, {"label":"k14", "x":4.5, "y":1}, {"label":"k15", "x":5.5, "y":1}, {"label":"k16", "x":6.5, "y":1}, {"label":"k17", "x":7.5, "y":1}, {"label":"k18", "x":8.5, "y":1}, {"label":"k19", "x":9.5, "y":1}, {"label":"k1a", "x":10.5, "y":1}, {"label":"k1b", "x":11.5, "y":1}, {"label":"k1c", "x":12.5, "y":1}, {"label":"k20", "x":0, "y":2, "w":1.75}, {"label":"k21", "x":1.75, "y":2}, {"label":"k22", "x":2.75, "y":2}, {"label":"k23", "x":3.75, "y":2}, {"label":"k24", "x":4.75, "y":2}, {"label":"k25", "x":5.75, "y":2}, {"label":"k26", "x":6.75, "y":2}, {"label":"k27", "x":7.75, "y":2}, {"label":"k28", "x":8.75, "y":2}, {"label":"k29", "x":9.75, "y":2}, {"label":"k2a", "x":10.75, "y":2}, {"label":"k2b", "x":11.75, "y":2}, {"label":"k2c", "x":12.75, "y":2}, {"label":"k2d", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"k30", "x":0, "y":3, "w":1.25}, {"label":"k31", "x":1.25, "y":3}, {"label":"k32", "x":2.25, "y":3}, {"label":"k33", "x":3.25, "y":3}, {"label":"k34", "x":4.25, "y":3}, {"label":"k35", "x":5.25, "y":3}, {"label":"k36", "x":6.25, "y":3}, {"label":"k37", "x":7.25, "y":3}, {"label":"k38", "x":8.25, "y":3}, {"label":"k39", "x":9.25, "y":3}, {"label":"k3a", "x":10.25, "y":3}, {"label":"k3b", "x":11.25, "y":3}, {"label":"k3d", "x":12.25, "y":3, "w":1.75}, {"label":"k3c", "x":14, "y":3}, {"label":"k40", "x":0, "y":4, "w":1.5}, {"label":"k41", "x":1.5, "y":4}, {"label":"k42", "x":2.5, "y":4, "w":1.5}, {"label":"k45", "x":4, "y":4, "w":6}, {"label":"k4a", "x":10, "y":4, "w":1.5}, {"label":"k4b", "x":11.5, "y":4}, {"label":"k4c", "x":12.5, "y":4}, {"label":"k4d", "x":13.5, "y":4, "w":1.5}] }, + "LAYOUT_60_ansi_split_rshift": { + "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0}, {"label":"k05", "x":5, "y":0}, {"label":"k06", "x":6, "y":0}, {"label":"k07", "x":7, "y":0}, {"label":"k08", "x":8, "y":0}, {"label":"k09", "x":9, "y":0}, {"label":"k0a", "x":10, "y":0}, {"label":"k0b", "x":11, "y":0}, {"label":"k0c", "x":12, "y":0}, {"label":"k0d", "x":13, "y":0, "w":2}, {"label":"k10", "x":0, "y":1, "w":1.5}, {"label":"k11", "x":1.5, "y":1}, {"label":"k12", "x":2.5, "y":1}, {"label":"k13", "x":3.5, "y":1}, {"label":"k14", "x":4.5, "y":1}, {"label":"k15", "x":5.5, "y":1}, {"label":"k16", "x":6.5, "y":1}, {"label":"k17", "x":7.5, "y":1}, {"label":"k18", "x":8.5, "y":1}, {"label":"k19", "x":9.5, "y":1}, {"label":"k1a", "x":10.5, "y":1}, {"label":"k1b", "x":11.5, "y":1}, {"label":"k1c", "x":12.5, "y":1}, {"label":"k1d", "x":13.5, "y":1, "w":1.5}, {"label":"k20", "x":0, "y":2, "w":1.75}, {"label":"k21", "x":1.75, "y":2}, {"label":"k22", "x":2.75, "y":2}, {"label":"k23", "x":3.75, "y":2}, {"label":"k24", "x":4.75, "y":2}, {"label":"k25", "x":5.75, "y":2}, {"label":"k26", "x":6.75, "y":2}, {"label":"k27", "x":7.75, "y":2}, {"label":"k28", "x":8.75, "y":2}, {"label":"k29", "x":9.75, "y":2}, {"label":"k2a", "x":10.75, "y":2}, {"label":"k2b", "x":11.75, "y":2}, {"label":"k2d", "x":12.75, "y":2, "w":2.25}, {"label":"k30", "x":0, "y":3, "w":2.25}, {"label":"k32", "x":2.25, "y":3}, {"label":"k33", "x":3.25, "y":3}, {"label":"k34", "x":4.25, "y":3}, {"label":"k35", "x":5.25, "y":3}, {"label":"k36", "x":6.25, "y":3}, {"label":"k37", "x":7.25, "y":3}, {"label":"k38", "x":8.25, "y":3}, {"label":"k39", "x":9.25, "y":3}, {"label":"k3a", "x":10.25, "y":3}, {"label":"k3b", "x":11.25, "y":3}, {"label":"k3d", "x":12.25, "y":3, "w":1.75}, {"label":"k3c", "x":14, "y":3}, {"label":"k40", "x":0, "y":4, "w":1.25}, {"label":"k41", "x":1.25, "y":4, "w":1.25}, {"label":"k42", "x":2.5, "y":4, "w":1.25}, {"label":"k45", "x":3.75, "y":4, "w":6.25}, {"label":"k4a", "x":10, "y":4, "w":1.25}, {"label":"k4b", "x":11.25, "y":4, "w":1.25}, {"label":"k4c", "x":12.5, "y":4, "w":1.25}, {"label":"k4d", "x":13.75, "y":4, "w":1.25}] + }, "LAYOUT_60_iso_split_rshift": { "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0}, {"label":"k05", "x":5, "y":0}, {"label":"k06", "x":6, "y":0}, {"label":"k07", "x":7, "y":0}, {"label":"k08", "x":8, "y":0}, {"label":"k09", "x":9, "y":0}, {"label":"k0a", "x":10, "y":0}, {"label":"k0b", "x":11, "y":0}, {"label":"k0c", "x":12, "y":0}, {"label":"k0d", "x":13, "y":0, "w":2}, {"label":"k10", "x":0, "y":1, "w":1.5}, {"label":"k11", "x":1.5, "y":1}, {"label":"k12", "x":2.5, "y":1}, {"label":"k13", "x":3.5, "y":1}, {"label":"k14", "x":4.5, "y":1}, {"label":"k15", "x":5.5, "y":1}, {"label":"k16", "x":6.5, "y":1}, {"label":"k17", "x":7.5, "y":1}, {"label":"k18", "x":8.5, "y":1}, {"label":"k19", "x":9.5, "y":1}, {"label":"k1a", "x":10.5, "y":1}, {"label":"k1b", "x":11.5, "y":1}, {"label":"k1c", "x":12.5, "y":1}, {"label":"k20", "x":0, "y":2, "w":1.75}, {"label":"k21", "x":1.75, "y":2}, {"label":"k22", "x":2.75, "y":2}, {"label":"k23", "x":3.75, "y":2}, {"label":"k24", "x":4.75, "y":2}, {"label":"k25", "x":5.75, "y":2}, {"label":"k26", "x":6.75, "y":2}, {"label":"k27", "x":7.75, "y":2}, {"label":"k28", "x":8.75, "y":2}, {"label":"k29", "x":9.75, "y":2}, {"label":"k2a", "x":10.75, "y":2}, {"label":"k2b", "x":11.75, "y":2}, {"label":"k2c", "x":12.75, "y":2}, {"label":"k2d", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"k30", "x":0, "y":3, "w":1.25}, {"label":"k31", "x":1.25, "y":3}, {"label":"k32", "x":2.25, "y":3}, {"label":"k33", "x":3.25, "y":3}, {"label":"k34", "x":4.25, "y":3}, {"label":"k35", "x":5.25, "y":3}, {"label":"k36", "x":6.25, "y":3}, {"label":"k37", "x":7.25, "y":3}, {"label":"k38", "x":8.25, "y":3}, {"label":"k39", "x":9.25, "y":3}, {"label":"k3a", "x":10.25, "y":3}, {"label":"k3b", "x":11.25, "y":3}, {"label":"k3d", "x":12.25, "y":3, "w":1.75}, {"label":"k3c", "x":14, "y":3}, {"label":"k40", "x":0, "y":4, "w":1.25}, {"label":"k41", "x":1.25, "y":4, "w":1.25}, {"label":"k42", "x":2.5, "y":4, "w":1.25}, {"label":"k45", "x":3.75, "y":4, "w":6.25}, {"label":"k4a", "x":10, "y":4, "w":1.25}, {"label":"k4b", "x":11.25, "y":4, "w":1.25}, {"label":"k4c", "x":12.5, "y":4, "w":1.25}, {"label":"k4d", "x":13.75, "y":4, "w":1.25}] } } -} \ No newline at end of file +} diff --git a/keyboards/satan/keymaps/abhixec/keymap.c b/keyboards/satan/keymaps/abhixec/keymap.c new file mode 100644 index 00000000000..59a8c431201 --- /dev/null +++ b/keyboards/satan/keymaps/abhixec/keymap.c @@ -0,0 +1,76 @@ +#include QMK_KEYBOARD_H + + +// Each layer gets a name for readability, which is then used in the keymap matix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 2 +#define _CL 1 +#define _EL 3 + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift| Del| + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * `-----------------------------------------------------------' + */ +[_BL] = LAYOUT_60_ansi_split_rshift( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ + LT(_EL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, \ + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RALT,KC_RGUI, MO(_FL),KC_RCTL), + +/* Keymap _CL: (Colemak Layer) + */ +[_CL] = LAYOUT_60_ansi_split_rshift( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC,KC_BSLS, \ + LT(_EL, KC_BSPC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, \ + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RALT,KC_RGUI, MO(_FL),KC_RCTL), + +[_EL] = LAYOUT_60_ansi_split_rshift( + + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + _______,KC_LCTL,KC_WH_U,_______,_______,KC_MS_U,KC_PGUP,KC_HOME,KC_UP,KC_END,KC_DEL, KC_GESC, _______,_______, \ + _______,KC_LALT,KC_WH_D, KC_LSFT,_______,KC_MS_D,KC_PGDOWN,KC_LEFT,KC_DOWN,KC_RIGHT, KC_BSPC,_______,_______, \ +_______,KC_UNDO,KC_CUT,KC_COPY,KC_PASTE, KC_MS_BTN1, KC_MS_BTN3, KC_MS_BTN2,KC_MS_LEFT,KC_MS_RIGHT,_______,_______, _______, \ + _______,_______,_______, _______, _______,_______,_______,_______), + + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | KC_GRV|F1|F2|F3|F4|F5|F6|F7| F8 | F9 |10|F11|F12| | + * |-----------------------------------------------------------| + * | | | | | | | | | | | |BL-|BL+|BL | + * |-----------------------------------------------------------| + * | | | | | | | | | |HOME| | | + * |-----------------------------------------------------------| + * | | | | | | |V_DWN|V_UP|MUTE | END || |_CL | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + +[_FL] = LAYOUT_60_ansi_split_rshift( + + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_PSCREEN, BL_DEC, BL_INC,BL_TOGG, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_HOME,_______,_______, \ + _______,_______,_______,_______,_______,_______,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_AUDIO_MUTE,KC_END,_______,_______, TG(_CL), \ + _______,_______,_______, _______, _______,_______,_______,_______) + +}; + diff --git a/keyboards/satan/keymaps/abhixec/readme.md b/keyboards/satan/keymaps/abhixec/readme.md new file mode 100644 index 00000000000..59a95b7fcf5 --- /dev/null +++ b/keyboards/satan/keymaps/abhixec/readme.md @@ -0,0 +1,19 @@ +# default Satan GH60 layout + +The layout for this keyboard is: +![Layout-2](https://i.imgur.com/Eqp8hov.jpg) + +Currently there are 3 layers: + +1. Base Layer is qwerty +2. 1st layer is colemak +3. 2nd layer is function layer +4. 3rd layer is extend layer + +How to use the layers: +1. Base is default. If you want Colemak then press function key and del next to the right shift (this combination will be used to toggle the layer on and off) +2. Function layer is accessible by holding down the function key. +3. Extend layer is accsessible by holding down the capslock. + Which when tapped acts like backspace when held triggers the Extend layer capability. + + diff --git a/keyboards/satan/keymaps/abhixec/rules.mk b/keyboards/satan/keymaps/abhixec/rules.mk new file mode 100644 index 00000000000..fdbd25ea80f --- /dev/null +++ b/keyboards/satan/keymaps/abhixec/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/satan/keymaps/admiralStrokers/config.h b/keyboards/satan/keymaps/admiralStrokers/config.h index d0338fb7e90..c8d40730fb5 100644 --- a/keyboards/satan/keymaps/admiralStrokers/config.h +++ b/keyboards/satan/keymaps/admiralStrokers/config.h @@ -48,18 +48,13 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Backlight configuration */ #define BACKLIGHT_LEVELS 4 @@ -73,8 +68,6 @@ along with this program. If not, see . #define DISABLE_SPACE_CADET_ROLLOVER - - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/satan/keymaps/admiralStrokers/keymap.c b/keyboards/satan/keymaps/admiralStrokers/keymap.c index a728f5a5393..a3626dff874 100644 --- a/keyboards/satan/keymaps/admiralStrokers/keymap.c +++ b/keyboards/satan/keymaps/admiralStrokers/keymap.c @@ -187,10 +187,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { if (record->event.pressed) { } else { }; break; } return MACRO_NONE; }; -/* - Later use: - void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } - enum function_id { }; - const uint16_t PROGMEM fn_actions[] = { }; - -*/ diff --git a/keyboards/satan/keymaps/admiralStrokers/rules.mk b/keyboards/satan/keymaps/admiralStrokers/rules.mk index 22908296cee..7c3f5bd90bc 100644 --- a/keyboards/satan/keymaps/admiralStrokers/rules.mk +++ b/keyboards/satan/keymaps/admiralStrokers/rules.mk @@ -19,6 +19,4 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no# Breathing sleep LED during USB suspend API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings -ifndef QUANTUM_DIR - include ../../../../Makefile -endif + diff --git a/keyboards/satan/keymaps/ben_iso/keymap.c b/keyboards/satan/keymaps/ben_iso/keymap.c index 7cc8efc96d9..5dfb2ae703c 100644 --- a/keyboards/satan/keymaps/ben_iso/keymap.c +++ b/keyboards/satan/keymaps/ben_iso/keymap.c @@ -64,7 +64,6 @@ #define MYCM KC_MYCM // Open default file manager // increase readability -#define _______ KC_TRNS #define XXXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/satan/keymaps/ben_iso/rules.mk b/keyboards/satan/keymaps/ben_iso/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/satan/keymaps/ben_iso/rules.mk +++ b/keyboards/satan/keymaps/ben_iso/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/bri/keymap.c b/keyboards/satan/keymaps/bri/keymap.c index 96775488e53..1f9430a9f13 100644 --- a/keyboards/satan/keymaps/bri/keymap.c +++ b/keyboards/satan/keymaps/bri/keymap.c @@ -5,7 +5,6 @@ #define _FL 1 #define _NAV 2 -#define _______ KC_TRNS #define A_LEFT LALT(KC_LEFT) #define A_RGHT LALT(KC_RGHT) @@ -66,38 +65,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______, _______, _______,_______,_______,_______), }; -/* -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} -*/ diff --git a/keyboards/satan/keymaps/chaser/keymap.c b/keyboards/satan/keymaps/chaser/keymap.c index ef1095fb7e7..edba9a3091f 100644 --- a/keyboards/satan/keymaps/chaser/keymap.c +++ b/keyboards/satan/keymaps/chaser/keymap.c @@ -12,8 +12,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-----------------------------------------------------------. diff --git a/keyboards/satan/keymaps/chaser/rules.mk b/keyboards/satan/keymaps/chaser/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/satan/keymaps/chaser/rules.mk +++ b/keyboards/satan/keymaps/chaser/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/colemak/keymap.c b/keyboards/satan/keymaps/colemak/keymap.c index d81ca08933b..08d456d6ce8 100644 --- a/keyboards/satan/keymaps/colemak/keymap.c +++ b/keyboards/satan/keymaps/colemak/keymap.c @@ -3,7 +3,7 @@ // Used for SHIFT_ESC -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -12,7 +12,9 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer @@ -29,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_BL] = LAYOUT_60_ansi( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC,KC_BSLS, \ KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O,KC_QUOT, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ @@ -40,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | RESET| * |-----------------------------------------------------------| * | | | | | | | | | | | |BL-|BL+|BL | - * |--------------------------------------------ΩΩ---------------| + * |-----------------------------------------------------------| * | | | | | | | | | | | | | * |-----------------------------------------------------------| * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | @@ -64,21 +66,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #endif }; -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -86,7 +78,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -94,6 +86,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/satan/keymaps/colemak/rules.mk b/keyboards/satan/keymaps/colemak/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/satan/keymaps/colemak/rules.mk +++ b/keyboards/satan/keymaps/colemak/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/default/keymap.c b/keyboards/satan/keymaps/default/keymap.c index 76bb8bfcf1f..77c1b5005c2 100644 --- a/keyboards/satan/keymaps/default/keymap.c +++ b/keyboards/satan/keymaps/default/keymap.c @@ -1,99 +1,54 @@ #include QMK_KEYBOARD_H - - -// Used for SHIFT_ESC -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -#define _BL 0 -#define _FL 1 - -#define _______ KC_TRNS +enum layer_names { + _BL, + _FL +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-----------------------------------------------------------. - * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backsp| * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | * |-----------------------------------------------------------| - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * |Ctrl|GUI |Alt | Space | Alt| GUI| Fn | Ctrl| * `-----------------------------------------------------------' */ -[_BL] = LAYOUT_60_ansi( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, MO(_FL),KC_RCTL), + [_BL] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL + ), /* Keymap _FL: Function Layer * ,-----------------------------------------------------------. - * | | | | | | | | | | | | | | RESET| + * | ` | | | | | | | | | | | | | Reset | * |-----------------------------------------------------------| - * | | | | | | | | | | | |BL-|BL+|BL | + * | | | | | | | | | | | |BL-|BL+| BL | * |-----------------------------------------------------------| - * | | | | | | | | | | | | | + * | | | | | | | | | | | | | | * |-----------------------------------------------------------| - * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | + * | | | | | | | | | | | | | * |-----------------------------------------------------------| * | | | | | | | | | * `-----------------------------------------------------------' */ -[_FL] = LAYOUT_60_ansi( - #ifdef RGBLIGHT_ENABLE - KC_GRV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______, \ - _______,_______,_______, _______, _______,_______,_______, _______), - #else - KC_GRV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC, BL_INC,BL_TOGG, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ - _______,_______,_______, _______, _______,_______,_______,_______), - #endif + [_FL] = LAYOUT_60_ansi( + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, BL_TOGG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ + ) }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/satan/keymaps/default/rules.mk b/keyboards/satan/keymaps/default/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/satan/keymaps/default/rules.mk +++ b/keyboards/satan/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/dende_iso/keymap.c b/keyboards/satan/keymaps/dende_iso/keymap.c index 205e9cb77d5..e6187c16152 100644 --- a/keyboards/satan/keymaps/dende_iso/keymap.c +++ b/keyboards/satan/keymaps/dende_iso/keymap.c @@ -13,9 +13,6 @@ // dual-role shortcuts #define FN_CAPS LT(_MEDIA, KC_CAPSLOCK) -// increase readability -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _DEF: Default Layer * ,------------------------------------------------------------. @@ -35,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, DE_PLUS, \ FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_OE, DE_AE, DE_HASH, KC_ENT, \ KC_LSFT, DE_LESS, DE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, KC_DELETE, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, DE_ALGR, KC_RGUI, KC_APP, KC_RCTL), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_ALGR, KC_RGUI, KC_APP, KC_RCTL), /* Keymap _FNK: Function Keys diff --git a/keyboards/satan/keymaps/dende_iso/rules.mk b/keyboards/satan/keymaps/dende_iso/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/satan/keymaps/dende_iso/rules.mk +++ b/keyboards/satan/keymaps/dende_iso/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/denolfe/rules.mk b/keyboards/satan/keymaps/denolfe/rules.mk index 04d27430659..5a8745b6898 100644 --- a/keyboards/satan/keymaps/denolfe/rules.mk +++ b/keyboards/satan/keymaps/denolfe/rules.mk @@ -15,6 +15,3 @@ AUDIO_ENABLE = no UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/dkrieger/rules.mk b/keyboards/satan/keymaps/dkrieger/rules.mk index f2434d30e55..d91b0edbf34 100644 --- a/keyboards/satan/keymaps/dkrieger/rules.mk +++ b/keyboards/satan/keymaps/dkrieger/rules.mk @@ -17,6 +17,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/fakb/config.h b/keyboards/satan/keymaps/fakb/config.h index a8df7ecef93..dc182753d76 100644 --- a/keyboards/satan/keymaps/fakb/config.h +++ b/keyboards/satan/keymaps/fakb/config.h @@ -30,17 +30,13 @@ //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) -*/ + /* Backlight configuration */ #define BACKLIGHT_LEVELS 8 @@ -86,7 +82,7 @@ #define MOUSEKEY_WHEEL_TIME_TO_MAX 255 // only change -#undef RGB_DI_PIN +#undef RGB_DI_PIN #define RGB_DI_PIN B2 #endif diff --git a/keyboards/satan/keymaps/fakb/keymap.c b/keyboards/satan/keymaps/fakb/keymap.c index 5744a109df7..93e11a5de2e 100644 --- a/keyboards/satan/keymaps/fakb/keymap.c +++ b/keyboards/satan/keymaps/fakb/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H - -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define LCTL_MA LCTL_T(KC_UP) #define LSFT_MA LSFT_T(KC_DOWN) #define RSFT_MA SFT_T(KC_DOWN) diff --git a/keyboards/satan/keymaps/fakb/rules.mk b/keyboards/satan/keymaps/fakb/rules.mk index c2b5df6cdd9..a0d2447994d 100644 --- a/keyboards/satan/keymaps/fakb/rules.mk +++ b/keyboards/satan/keymaps/fakb/rules.mk @@ -11,6 +11,3 @@ AUDIO_ENABLE = no UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/isoHHKB/keymap.c b/keyboards/satan/keymaps/isoHHKB/keymap.c index e1d93a1c31e..46d66e5db64 100644 --- a/keyboards/satan/keymaps/isoHHKB/keymap.c +++ b/keyboards/satan/keymaps/isoHHKB/keymap.c @@ -10,11 +10,10 @@ #define _BL 0 #define _FL 1 -#define KC_ENYE M(0) -#define KC_CEDL M(1) - -#define _______ KC_TRNS - +enum custom_keycodes { + KC_ENYE = SAFE_RANGE, + KC_CEDL +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer @@ -96,14 +95,28 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { - switch(id) { - case 0: // Ñ - return MACRO(D(LALT), T(KP_0), T(KP_2), T(KP_4), T(KP_1), U(LALT), END); - case 1: // Ç - return MACRO(D(LALT), T(KP_0), T(KP_2), T(KP_3), T(KP_1), U(LALT), END); + switch(keycode) { + case KC_ENYE: // Ñ + register_code16(KC_LALT); + tap_code(KC_KP_0); + tap_code(KC_KP_2); + tap_code(KC_KP_4); + tap_code(KC_KP_1); + unregister_code16(KC_LALT); + return false; + case KC_CEDL: // Ç + register_code16(KC_LALT); + tap_code(KC_KP_0); + tap_code(KC_KP_2); + tap_code(KC_KP_3); + tap_code(KC_KP_1); + unregister_code16(KC_LALT); + return false; + default: + return true; } } - return MACRO_NONE; + return true; }; diff --git a/keyboards/satan/keymaps/isoHHKB/rules.mk b/keyboards/satan/keymaps/isoHHKB/rules.mk index 80ce5605883..08e77f9ebc6 100644 --- a/keyboards/satan/keymaps/isoHHKB/rules.mk +++ b/keyboards/satan/keymaps/isoHHKB/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index d73a01aea7b..a21f83505e5 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -32,10 +32,6 @@ #define GER_BRC_L RALT(KC_8) // [ #define GER_BRC_R RALT(KC_9) // ] -// increase readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _DEF: Default Layer * ,-----------------------------------------------------------. @@ -74,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ _______, KC_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, \ _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \ - _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, RALT(KC_SPC),_______, _______, _______, _______, KC_VOLU, _______, \ _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) @@ -94,7 +90,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ _______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \ - _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, A(KC_F2), _______, _______, _______, _______, KC_PGUP, _______, \ _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) @@ -113,96 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_SFX] = LAYOUT_60_iso_split_rshift( RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \ _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, \ - _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \ - _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \ + _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \ _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT), }; - -enum function_id { - LAUNCH, - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_FUNCTION(LAUNCH), - [2] = ACTION_FUNCTION(RGBLED_TOGGLE), - [3] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [4] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [5] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [6] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [7] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [8] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [9] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - [10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - return (record->event.pressed ? - MACRO( D(RALT), T(SPC), U(RALT), END ) - :MACRO( END )); - break; - case 1: - return (record->event.pressed ? - MACRO( D(LALT), T(F2), U(LALT), END ) - :MACRO( END )); - break; - } - return MACRO_NONE; -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case RGBLED_TOGGLE: - //led operations - if (record->event.pressed) { - rgblight_toggle(); - } - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; - } -} diff --git a/keyboards/satan/keymaps/iso_split_rshift/rules.mk b/keyboards/satan/keymaps/iso_split_rshift/rules.mk index d1e07da3fcc..15cabfcd85a 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/rules.mk +++ b/keyboards/satan/keymaps/iso_split_rshift/rules.mk @@ -11,6 +11,3 @@ AUDIO_ENABLE = no UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/lepa/rules.mk b/keyboards/satan/keymaps/lepa/rules.mk index 72ca006465c..74a42b647ca 100644 --- a/keyboards/satan/keymaps/lepa/rules.mk +++ b/keyboards/satan/keymaps/lepa/rules.mk @@ -17,6 +17,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/midi/keymap.c b/keyboards/satan/keymaps/midi/keymap.c index e8ac01ed4bb..141bef3d643 100644 --- a/keyboards/satan/keymaps/midi/keymap.c +++ b/keyboards/satan/keymaps/midi/keymap.c @@ -8,10 +8,6 @@ #define _BL 0 #define _ML 1 -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-----------------------------------------------------------. diff --git a/keyboards/satan/keymaps/midi/rules.mk b/keyboards/satan/keymaps/midi/rules.mk index d144314de74..87025ed6fe4 100644 --- a/keyboards/satan/keymaps/midi/rules.mk +++ b/keyboards/satan/keymaps/midi/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/no_caps_lock/keymap.c b/keyboards/satan/keymaps/no_caps_lock/keymap.c new file mode 100644 index 00000000000..48659bb66b0 --- /dev/null +++ b/keyboards/satan/keymaps/no_caps_lock/keymap.c @@ -0,0 +1,55 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_names { + _BL, + _FL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * | ~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |ESC | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |FL |Gui |FL(tgl)| + * `-----------------------------------------------------------' + */ + [_BL] = LAYOUT_60_ansi( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, TG(_FL) + ), + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL | + * |-----------------------------------------------------------| + * | |Home|PgUp| | | | | | | | |BR- |BR+ | | + * |-----------------------------------------------------------| + * | |End|PgDn| | | |Left|Down|Up|Right|Prv|Nxt|Ply | + * |-----------------------------------------------------------| + * | | | | | | | | |Vdn|Vup|Mute| | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + * hjkl for arrows because vim + */ + [_FL] = LAYOUT_60_ansi( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F14, KC_F15, KC_TRNS, \ + KC_TRNS, KC_END, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_MPRV, KC_MNXT, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; diff --git a/keyboards/satan/keymaps/no_caps_lock/readme.md b/keyboards/satan/keymaps/no_caps_lock/readme.md new file mode 100644 index 00000000000..b3bfe7988e9 --- /dev/null +++ b/keyboards/satan/keymaps/no_caps_lock/readme.md @@ -0,0 +1 @@ +Standard layout with caps lock replaced by esc. Navigation and multimedia keys are on the second layer. diff --git a/keyboards/satan/keymaps/olligranlund_iso/keymap.c b/keyboards/satan/keymaps/olligranlund_iso/keymap.c index 5016d437796..789543b56dc 100644 --- a/keyboards/satan/keymaps/olligranlund_iso/keymap.c +++ b/keyboards/satan/keymaps/olligranlund_iso/keymap.c @@ -49,7 +49,6 @@ #define MYCM KC_MYCM // Open default file manager // increase readability -#define _______ KC_TRNS #define XXXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/satan/keymaps/olligranlund_iso/rules.mk b/keyboards/satan/keymaps/olligranlund_iso/rules.mk index 73106b6749d..3d886f14f58 100644 --- a/keyboards/satan/keymaps/olligranlund_iso/rules.mk +++ b/keyboards/satan/keymaps/olligranlund_iso/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/satan/keymaps/poker/keymap.c b/keyboards/satan/keymaps/poker/keymap.c index b908e8c4ae1..13251a5645b 100644 --- a/keyboards/satan/keymaps/poker/keymap.c +++ b/keyboards/satan/keymaps/poker/keymap.c @@ -2,7 +2,7 @@ // Used for SHIFT_ESC -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -12,9 +12,9 @@ #define _FL 1 #define _RL 2 -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer @@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_BL] = LAYOUT_60_ansi( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ @@ -89,21 +89,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_ESC: if (record->event.pressed) { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_MASK) { add_key(KC_GRV); send_keyboard_report(); } else { @@ -111,7 +101,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } else { - if (shift_esc_shift_mask) { + if (get_mods() & MODS_SHIFT_MASK) { del_key(KC_GRV); send_keyboard_report(); } else { @@ -119,6 +109,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { send_keyboard_report(); } } - break; + + return false; + + default: + return true; } } diff --git a/keyboards/satan/keymaps/sethbc/keymap.c b/keyboards/satan/keymaps/sethbc/keymap.c index 21a4f1fe122..2a25b2b6b46 100644 --- a/keyboards/satan/keymaps/sethbc/keymap.c +++ b/keyboards/satan/keymaps/sethbc/keymap.c @@ -11,9 +11,6 @@ #define _BL 0 #define _FL 1 -// Fillers to make layering more clear -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-----------------------------------------------------------. diff --git a/keyboards/satan/keymaps/sethbc/rules.mk b/keyboards/satan/keymaps/sethbc/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/satan/keymaps/sethbc/rules.mk +++ b/keyboards/satan/keymaps/sethbc/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/smt/keymap.c b/keyboards/satan/keymaps/smt/keymap.c index e12b305276e..8546211d5e7 100644 --- a/keyboards/satan/keymaps/smt/keymap.c +++ b/keyboards/satan/keymaps/smt/keymap.c @@ -20,9 +20,6 @@ enum planck_keycodes { DVORAK }; -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom macros #define ALT_GRV ALT_T(KC_GRV) // Tap for Backtick, hold for Alt #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl diff --git a/keyboards/satan/keymaps/smt/rules.mk b/keyboards/satan/keymaps/smt/rules.mk index 806c2cb84b0..3fe140adcc7 100644 --- a/keyboards/satan/keymaps/smt/rules.mk +++ b/keyboards/satan/keymaps/smt/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/spacemanspiff/keymap.c b/keyboards/satan/keymaps/spacemanspiff/keymap.c index 7dc1d3d788b..8caa70e02ab 100644 --- a/keyboards/satan/keymaps/spacemanspiff/keymap.c +++ b/keyboards/satan/keymaps/spacemanspiff/keymap.c @@ -9,8 +9,6 @@ #define CTL_ESC MT(MOD_LCTL,KC_ESC) #define GUI_ENT MT(MOD_RGUI, KC_ENT) -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-----------------------------------------------------------. diff --git a/keyboards/satan/keymaps/stanleylai/keymap.c b/keyboards/satan/keymaps/stanleylai/keymap.c index e5c5dc60e20..633719a88b1 100644 --- a/keyboards/satan/keymaps/stanleylai/keymap.c +++ b/keyboards/satan/keymaps/stanleylai/keymap.c @@ -12,10 +12,6 @@ #define _FL 1 #define _RGBL 2 -// readability -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // See base_layer.png and rgb_layer.png for layout reference diff --git a/keyboards/satan/keymaps/unxmaal/keymap.c b/keyboards/satan/keymaps/unxmaal/keymap.c index 20641416b7e..f311ebeebb5 100644 --- a/keyboards/satan/keymaps/unxmaal/keymap.c +++ b/keyboards/satan/keymaps/unxmaal/keymap.c @@ -13,8 +13,6 @@ #define _AL 1 #define _FL 2 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * ANSI Base, Mac style diff --git a/keyboards/satan/keymaps/unxmaal/rules.mk b/keyboards/satan/keymaps/unxmaal/rules.mk index 470d621b105..e7247825137 100644 --- a/keyboards/satan/keymaps/unxmaal/rules.mk +++ b/keyboards/satan/keymaps/unxmaal/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/pinout.txt b/keyboards/satan/pinout.txt deleted file mode 100644 index d1ad4ac8835..00000000000 --- a/keyboards/satan/pinout.txt +++ /dev/null @@ -1 +0,0 @@ -For WS2812B LED strip support, connect DIN from strip to PE2 on ATmega32u4 controller (see reference image controller.jpg) \ No newline at end of file diff --git a/keyboards/satan/readme.md b/keyboards/satan/readme.md index fddadcd478e..7eb272cf304 100644 --- a/keyboards/satan/readme.md +++ b/keyboards/satan/readme.md @@ -1,15 +1,33 @@ -Satan GH60 -========== +# Satan GH60 -![controller](https://i.imgur.com/9vyRBoT.jpg) -![power](https://i.imgur.com/pHMZHLP.jpg) +A clone of the GH60 60% keyboard, with full backlighting support. Keyboard Maintainer: QMK Community Hardware Supported: Satan GH60 PCB -Hardware Availability: https://1upkeyboards.com/gh60-satan-pcb.html +Hardware Availability: https://www.1upkeyboards.com/shop/controllers/gh60-satan-pcb/ Make example for this keyboard (after setting up your build environment): make satan:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## RGB Underglow (WS2812B LED Strip) + +This board also supports underglow with a slight mod. + +Connect the DIN pad of the LED strip to PE2 on the ATmega32U4, like so: + +![controller](https://i.imgur.com/9vyRBoT.jpg) + +Then connect VCC and GND to pins 1 and 6 at the bottom of the PCB: + +![power](https://i.imgur.com/pHMZHLP.jpg) + +## ISP Header + +If you want to flash another bootloader (such as QMK-DFU), or can't get into the bootloader in the first place, the row of pins at the bottom can be used to ISP flash the board: + +| 1 | 2 | 3 | 4 | 5 | 6 | 7 | +|---|----|---|----|-----|---|----| +|VCC|MISO|SCK|MOSI|RESET|GND|*NC*| diff --git a/keyboards/satan/rules.mk b/keyboards/satan/rules.mk index 98200ab02ca..51161490e4d 100644 --- a/keyboards/satan/rules.mk +++ b/keyboards/satan/rules.mk @@ -1,6 +1,4 @@ - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -16,7 +14,6 @@ MCU = atmega32u4 # software delays. F_CPU = 16000000 - # # LUFA specific # @@ -39,7 +36,6 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - # Boot Section Size in *bytes* # Teensy halfKay 512 # Teensy++ halfKay 1024 @@ -48,21 +44,20 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # USBaspLoader 2048 OPT_DEFS += -DBOOTLOADER_SIZE=4096 - # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE = no # MIDI controls +MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift \ No newline at end of file +LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift diff --git a/keyboards/satan/satan.c b/keyboards/satan/satan.c index d2c5d5c2054..8542a57c43a 100644 --- a/keyboards/satan/satan.c +++ b/keyboards/satan/satan.c @@ -1,30 +1,24 @@ #include "satan.h" -#include "led.h" void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); + matrix_init_user(); + led_init_ports(); }; void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); + matrix_scan_user(); }; void led_init_ports(void) { - // * Set our LED pins as output - DDRB |= (1<<2); + setPinOutput(B2); } void led_set_kb(uint8_t usb_led) { - if (usb_led & (1<. +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6969 +#define DEVICE_VER 0x0001 +#define MANUFACTURER WoodKeys.click +#define PRODUCT Scarlet Bandana Version IV mark.2 +#define DESCRIPTION 65% with macro keys + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 17 + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL + +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 // Number of LEDs +#endif + +#define MATRIX_ROW_PINS { D4, D6, D7, B4, B5 } +#define MATRIX_COL_PINS { B2, B3, B7, B1, F5, F4, F6, F7, B0, F0, F1, D0, D1, D2, D5, B6, C7 } + +#define QMK_SPEAKER C6 + +#ifdef AUDIO_ENABLE +#define C6_AUDIO +#define STARTUP_SONG SONG(PREONIC_SOUND) +// Disable music mode to keep the firmware size down +#define NO_MUSIC_MODE +#endif + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#define DEBOUNCE 5 diff --git a/keyboards/scarletbandana/info.json b/keyboards/scarletbandana/info.json new file mode 100644 index 00000000000..9fb7c230ae7 --- /dev/null +++ b/keyboards/scarletbandana/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Scarlet Bandana Version IV Mark 2", + "url": "", + "maintainer": "qmk", + "width": 18.5, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":10.5, "y":0}, {"x":11.5, "y":0}, {"x":12.5, "y":0}, {"x":13.5, "y":0}, {"x":14.5, "y":0}, {"x":15.5, "y":0}, {"x":16.5, "y":0}, {"x":17.5, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2.5, "y":1, "w":1.5}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":16, "y":1, "w":1.5}, {"x":17.5, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2.5, "y":2, "w":1.75}, {"x":4.25, "y":2}, {"x":5.25, "y":2}, {"x":6.25, "y":2}, {"x":7.25, "y":2}, {"x":8.25, "y":2}, {"x":9.25, "y":2}, {"x":10.25, "y":2}, {"x":11.25, "y":2}, {"x":12.25, "y":2}, {"x":13.25, "y":2}, {"x":14.25, "y":2}, {"x":15.25, "y":2, "w":2.25}, {"x":17.5, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2.5, "y":3, "w":2.25}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3}, {"x":13.75, "y":3}, {"x":14.75, "y":3, "w":1.75}, {"x":16.5, "y":3}, {"x":17.5, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":1.25}, {"x":5, "y":4, "w":1.25}, {"x":6.25, "y":4, "w":2.25}, {"x":8.5, "y":4, "w":1.75}, {"x":10.25, "y":4, "w":2.25}, {"x":12.5, "y":4}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4}, {"x":16.5, "y":4}, {"x":17.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/scarletbandana/keymaps/default/config.h b/keyboards/scarletbandana/keymaps/default/config.h new file mode 100644 index 00000000000..8533e6f6d64 --- /dev/null +++ b/keyboards/scarletbandana/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Cole Markham, WoodKeys.click + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/scarletbandana/keymaps/default/keymap.c b/keyboards/scarletbandana/keymaps/default/keymap.c new file mode 100644 index 00000000000..55d8f07c1b8 --- /dev/null +++ b/keyboards/scarletbandana/keymaps/default/keymap.c @@ -0,0 +1,173 @@ +/* Copyright 2019 Cole Markham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_all( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSPC, KC_DEL, KC_PGUP,\ + KC_F3, KC_F4, KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_PGDN,\ + KC_F5, KC_F6, KC_CAPS,KC_A,KC_S,KC_D,KC_F, KC_G, KC_H,KC_J,KC_K,KC_L, KC_SCLN,KC_QUOT,KC_ENT, KC_HOME,\ + KC_F7, KC_F8, KC_LSFT,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLASH,KC_RSFT,KC_UP,KC_END,\ + KC_F9, KC_F10, KC_LCTL,KC_LGUI,KC_LALT, RAISE, KC_SPACE, LOWER, KC_RALT,KC_APP,KC_RCTRL,KC_LEFT,KC_DOWN,KC_RIGHT), + + [_RAISE] = LAYOUT_all( + RGB_MOD, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______,\ + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,\ + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,\ + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______, _______, _______,_______,_______, _______, _______, _______, _______,_______,_______,_______,_______,_______), + + [_LOWER] = LAYOUT_all( + RGB_MOD, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______,\ + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,\ + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,\ + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______, _______, _______,_______,_______, _______, _______, _______, _______,_______,_______,_______,_______,_______), + + [_ADJUST] = LAYOUT_all( + RESET, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______,\ + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,\ + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,\ + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ + _______, _______, _______,_______,_______, _______, _______, _______, _______,_______,_______,_______,_______,_______) +}; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { +#ifdef RGBLIGHT_ENABLE + rgblight_mode(RGB_current_mode); +#endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +#ifdef AUDIO_ENABLE + + float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; +#ifdef RGBLIGHT_ENABLE + rgblight_mode(16); +#endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { +#ifdef RGBLIGHT_ENABLE + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change +#endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; +#ifdef RGBLIGHT_ENABLE + rgblight_mode(15); +#endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { +#ifdef RGBLIGHT_ENABLE + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change +#endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + // FIXME add RGB feedback + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released +#ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + return false; + break; +#endif + } + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/scarletbandana/keymaps/default/readme.md b/keyboards/scarletbandana/keymaps/default/readme.md new file mode 100644 index 00000000000..c2c281fe353 --- /dev/null +++ b/keyboards/scarletbandana/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for scarletbandana diff --git a/keyboards/scarletbandana/readme.md b/keyboards/scarletbandana/readme.md new file mode 100644 index 00000000000..83281bae36c --- /dev/null +++ b/keyboards/scarletbandana/readme.md @@ -0,0 +1,11 @@ +# Scarlet Bandana Version IV Mark 2 + +Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) +Hardware Supported: Scarlet Bandana Version IV Mark 2 +Hardware Availability: [WoodKeys.click](https://woodkeys.click/product/scarlet-bandana-version-iv-mark-2/) + +Make example for this keyboard (after setting up your build environment): + + make scarletbandana:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/scarletbandana/rules.mk b/keyboards/scarletbandana/rules.mk new file mode 100644 index 00000000000..de3ac951807 --- /dev/null +++ b/keyboards/scarletbandana/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = yes # Audio output on port C6 +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality, also set ISSI_ENABLE below for Miera +EXTRAFLAGS += -flto diff --git a/keyboards/scarletbandana/scarletbandana.c b/keyboards/scarletbandana/scarletbandana.c new file mode 100644 index 00000000000..6ef183c2cc1 --- /dev/null +++ b/keyboards/scarletbandana/scarletbandana.c @@ -0,0 +1,22 @@ +/* Copyright 2019 Cole Markham, WoodKeys.click + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "scarletbandana.h" + + + + + + diff --git a/keyboards/scarletbandana/scarletbandana.h b/keyboards/scarletbandana/scarletbandana.h new file mode 100644 index 00000000000..8178e8c8dcf --- /dev/null +++ b/keyboards/scarletbandana/scarletbandana.h @@ -0,0 +1,38 @@ +/* Copyright 2019 Cole Markham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_all( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k2f, k0g, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2g, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, k3f, k3g, \ + k40, k41, k42, k43, k44, k45, k47, k49, k4a, k4b, k4c, k4e, k4f, k4g \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, KC_NO, k3e, k3f, k3g }, \ + { k40, k41, k42, k43, k44, k45, KC_NO, k47, KC_NO, k49, k4a, k4b, k4c, KC_NO, k4e, k4f, k4g } \ +} + diff --git a/keyboards/scrabblepad/config.h b/keyboards/scrabblepad/config.h deleted file mode 100644 index dabab7d3590..00000000000 --- a/keyboards/scrabblepad/config.h +++ /dev/null @@ -1,198 +0,0 @@ -/* -Copyright 2018 MechMerlin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Donut Cables -#define PRODUCT ScrabblePad -#define DESCRIPTION 15x15 Ortholinear Board - -/* key matrix size */ -#define MATRIX_ROWS 15 -#define MATRIX_COLS 15 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D5, F1, C7, F2, C6, F3, C5, F4, C4, F5, C3, F6, C2, F7, C1 } -#define MATRIX_COL_PINS { D6, D7, E0, E1, B7, D2, D3, D4, C0, B4, B5, B6, F0, E6, E7 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - -// ws2812 options -//#define RGB_DI_PIN A0 // pin the DI on the ws2812 is hooked-up to -//#define RGBLIGHT_ANIMATIONS // run RGB animations -//#define RGBLED_NUM 6 // number of LEDs -//#define RGBLIGHT_HUE_STEP 12 // units to step when in/decreasing hue -//#define RGBLIGHT_SAT_STEP 25 // units to step when in/decresing saturation -//#define RGBLIGHT_VAL_STEP 12 // units to step when in/decreasing value (brightness) - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/scrabblepad/keymaps/default/config.h b/keyboards/scrabblepad/keymaps/default/config.h deleted file mode 100644 index 2c852d18199..00000000000 --- a/keyboards/scrabblepad/keymaps/default/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif diff --git a/keyboards/scrabblepad/keymaps/default/keymap.c b/keyboards/scrabblepad/keymaps/default/keymap.c deleted file mode 100644 index bfbab6e885c..00000000000 --- a/keyboards/scrabblepad/keymaps/default/keymap.c +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "scrabblepad.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT( /* Base */ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC, \ - KC_D, KC_O, KC_N, KC_U, KC_T, KC_C, KC_A, KC_T, KC_SPC, KC_R, KC_U, KC_L, KC_E, KC_S, KC_SPC \ -), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/scrabblepad/readme.md b/keyboards/scrabblepad/readme.md deleted file mode 100644 index e434eef950a..00000000000 --- a/keyboards/scrabblepad/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# ScrabblePad - -The ScrabblePad is a 15x15 ortholinear keyboard designed for use with -the XDA Scrabble Board sold by [Novelkeys](https://novelkeys.xyz). - -It uses a [Teensy++ 2.0](https://www.pjrc.com/store/teensypp.html) -featuring an at90usb1286 8 bit microcontroller. Usage requires modifying the Teensy by removing the LED on pin D6. - -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Donut Cables](https://donutcables.com/) -Hardware Supported: Teensy++ 2.0 and ScrabblePad PCB -Hardware Availability: [Donut Cables](https://donutcables.com/) - -Make example for this keyboard (after setting up your build environment): - - make scrabblepad:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/scrabblepad/scrabblepad.h b/keyboards/scrabblepad/scrabblepad.h deleted file mode 100644 index fbe0dfc7276..00000000000 --- a/keyboards/scrabblepad/scrabblepad.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef SCRABBLEPAD_H -#define SCRABBLEPAD_H - -#include "quantum.h" - -// Written in the format K(row)(column) where numbering is in hexadecimal -#define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, \ - k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, k5D, k5E, \ - k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E, \ - k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7A, k7B, k7C, k7D, k7E, \ - k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8A, k8B, k8C, k8D, k8E, \ - k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, k9A, k9B, k9C, k9D, k9E, \ - kA0, kA1, kA2, kA3, kA4, kA5, kA6, kA7, kA8, kA9, kAA, kAB, kAC, kAD, kAE, \ - kB0, kB1, kB2, kB3, kB4, kB5, kB6, kB7, kB8, kB9, kBA, kBB, kBC, kBD, kBE, \ - kC0, kC1, kC2, kC3, kC4, kC5, kC6, kC7, kC8, kC9, kCA, kCB, kCC, kCD, kCE, \ - kD0, kD1, kD2, kD3, kD4, kD5, kD6, kD7, kD8, kD9, kDA, kDB, kDC, kDD, kDE, \ - kE0, kE1, kE2, kE3, kE4, kE5, kE6, kE7, kE8, kE9, kEA, kEB, kEC, kED, kEE \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, }, \ - { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, }, \ - { k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, k5D, k5E, }, \ - { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E, }, \ - { k70, k71, k72, k73, k74, k75, k76, k77, k78, k79, k7A, k7B, k7C, k7D, k7E, }, \ - { k80, k81, k82, k83, k84, k85, k86, k87, k88, k89, k8A, k8B, k8C, k8D, k8E, }, \ - { k90, k91, k92, k93, k94, k95, k96, k97, k98, k99, k9A, k9B, k9C, k9D, k9E, }, \ - { kA0, kA1, kA2, kA3, kA4, kA5, kA6, kA7, kA8, kA9, kAA, kAB, kAC, kAD, kAE, }, \ - { kB0, kB1, kB2, kB3, kB4, kB5, kB6, kB7, kB8, kB9, kBA, kBB, kBC, kBD, kBE, }, \ - { kC0, kC1, kC2, kC3, kC4, kC5, kC6, kC7, kC8, kC9, kCA, kCB, kCC, kCD, kCE, }, \ - { kD0, kD1, kD2, kD3, kD4, kD5, kD6, kD7, kD8, kD9, kDA, kDB, kDC, kDD, kDE, }, \ - { kE0, kE1, kE2, kE3, kE4, kE5, kE6, kE7, kE8, kE9, kEA, kEB, kEC, kED, kEE } \ -} - -#endif diff --git a/keyboards/scythe/config.h b/keyboards/scythe/config.h new file mode 100644 index 00000000000..d577192db3f --- /dev/null +++ b/keyboards/scythe/config.h @@ -0,0 +1,232 @@ +/* Copyright 2019 ENDO Katsuhiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3941 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Kagizaraya +#define PRODUCT Scythe +#define DESCRIPTION Yet another 60% split keyboard + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F7, F6, F5, F4, D5 } +#define MATRIX_COL_PINS { D6, D7, B4, B5, B6, C6, C7 } +#define UNUSED_PINS + +#define SOFT_SERIAL_PIN D0 + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGBLIGHT_SPLIT 1 +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 9 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +/* Serial settings */ +#define USE_SERIAL +//#define EE_HANDS +#define I2C_MASTER_LEFT +//#define I2C_MASTER_RIGHT + +#define TAPPING_TERM 120 diff --git a/keyboards/scythe/info.json b/keyboards/scythe/info.json new file mode 100644 index 00000000000..864d5ee29dd --- /dev/null +++ b/keyboards/scythe/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Scythe", + "url": "", + "maintainer": "ka2hiro", + "width": 19, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":2, "y":0}, {"label":"1", "x":3, "y":0}, {"label":"2", "x":4, "y":0}, {"label":"3", "x":5, "y":0}, {"label":"4", "x":6, "y":0}, {"label":"5", "x":7, "y":0}, {"label":"_", "x":8, "y":0}, {"label":"+", "x":9.5, "y":0}, {"label":"6", "x":10.5, "y":0}, {"label":"7", "x":11.5, "y":0}, {"label":"8", "x":12.5, "y":0}, {"label":"9", "x":13.5, "y":0}, {"label":"0", "x":14.5, "y":0}, {"label":"\\", "x":15.5, "y":0}, {"label":"Tab", "x":1.25, "y":1, "w":1.5}, {"label":"Q", "x":2.75, "y":1}, {"label":"W", "x":3.75, "y":1}, {"label":"E", "x":4.75, "y":1}, {"label":"R", "x":5.75, "y":1}, {"label":"T", "x":6.75, "y":1}, {"label":"{", "x":7.75, "y":1}, {"label":"}", "x":9.75, "y":1}, {"label":"Y", "x":10.75, "y":1}, {"label":"U", "x":11.75, "y":1}, {"label":"I", "x":12.75, "y":1}, {"label":"O", "x":13.75, "y":1}, {"label":"P", "x":14.75, "y":1}, {"label":"Backace", "x":15.75, "y":1, "w":1.5}, {"label":"Control", "x":0.75, "y":2, "w":1.75}, {"label":"A", "x":2.5, "y":2}, {"label":"S", "x":3.5, "y":2}, {"label":"D", "x":4.5, "y":2}, {"label":"F", "x":5.5, "y":2}, {"label":"G", "x":6.5, "y":2}, {"label":"~", "x":7.5, "y":2}, {"label":"\"", "x":10, "y":2}, {"label":"H", "x":11, "y":2}, {"label":"J", "x":12, "y":2}, {"label":"K", "x":13, "y":2}, {"label":"L", "x":14, "y":2}, {"label":":", "x":15, "y":2}, {"label":"Return", "x":16, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"Caps", "x":7.25, "y":3}, {"label":"Del", "x":10.25, "y":3}, {"label":"N", "x":11.25, "y":3}, {"label":"M", "x":12.25, "y":3}, {"label":"<", "x":13.25, "y":3}, {"label":">", "x":14.25, "y":3}, {"label":"?", "x":15.25, "y":3}, {"label":"Shift", "x":16.25, "y":3, "w":1.75}, {"label":"Fn", "x":18, "y":3}, {"label":"", "x":2.75, "y":4, "w":1.25}, {"label":"", "x":4, "y":4, "w":1.25}, {"label":"Fn", "x":5.25, "y":4, "w":1.25}, {"x":6.5, "y":4, "w":2}, {"x":10, "y":4, "w":2}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"", "x":13.25, "y":4, "w":1.25}, {"label":"", "x":14.5, "y":4, "w":1.25}] + } + } +} + diff --git a/keyboards/scythe/keymaps/default/config.h b/keyboards/scythe/keymaps/default/config.h new file mode 100644 index 00000000000..cea12f905cd --- /dev/null +++ b/keyboards/scythe/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/scythe/keymaps/default/keymap.c b/keyboards/scythe/keymaps/default/keymap.c new file mode 100644 index 00000000000..56b6b32c8c6 --- /dev/null +++ b/keyboards/scythe/keymaps/default/keymap.c @@ -0,0 +1,75 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum layer_names { + _QWERTY, + _HAPPY, +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + HAPPY, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * + * ,------------------------------------------------. ,------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | BkSp | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | ` | | ' | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------. + * |Shift | Z | X | C | V | B | Caps | | Del | N | M | , | . | / |Shift | Fn | + * `--------------------+------+------+------+------| |------+------+------+------+------+------+------+------' + * | LAlt | LGUI | Fn | Space| |Space | Fn | LGUI | LAlt | + * `---------------------------' `---------------------------' + */ +[_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_GRV, KC_QUOT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_CAPS, KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_HAPPY), + KC_LALT, KC_LGUI, MO(_HAPPY), KC_SPC, KC_SPC, MO(_HAPPY), KC_RGUI, KC_RALT +), + +/* Happy + * + * ,------------------------------------------------. ,------------------------------------------------. + * | Pwr | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F0 | Del | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Caps | F11 | F12 |BLTOGG| |BL INC|BL DEC| | | | Psc | Slk | Pus | Up | Ins | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Vol- | Vol+ | Mute |RGBHUI|RGBSAI|RGBVAI| | * | / | Home | PgUp | Left | Right| | + * |------+------+------+------+------+------+------| +------+------+------+------+------+------+------+------. + * | |RGBTOG|RGBMOD|RGBRMD|RGBHUD|RGBSAD|RGBVAD| | + | - | End | PgDn | Down | | | | + * `--------------------+------+------+------+------| |------+------+------+------+------+------+------+------' + * | | | | | | | | | | + * `---------------------------' `---------------------------' + */ +[_HAPPY] = LAYOUT( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + KC_CAPS, KC_F10, KC_F12, BL_TOGG, _______, BL_INC , BL_DEC , _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_INS, + _______, KC_VOLD, KC_VOLU, KC_MUTE, RGB_HUI, RGB_SAI, RGB_VAI, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, + _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + diff --git a/keyboards/scythe/keymaps/default/readme.md b/keyboards/scythe/keymaps/default/readme.md new file mode 100644 index 00000000000..c4d73c4e33d --- /dev/null +++ b/keyboards/scythe/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The default keymap for scythe + diff --git a/keyboards/scythe/keymaps/forties/config.h b/keyboards/scythe/keymaps/forties/config.h new file mode 100644 index 00000000000..cea12f905cd --- /dev/null +++ b/keyboards/scythe/keymaps/forties/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/scythe/keymaps/forties/keymap.c b/keyboards/scythe/keymaps/forties/keymap.c new file mode 100644 index 00000000000..4d2fc882439 --- /dev/null +++ b/keyboards/scythe/keymaps/forties/keymap.c @@ -0,0 +1,205 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum layer_names { + _QWERTY, + _HAPPY, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + HAPPY, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * + * ,------------------------------------------------. ,------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | BkSp | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | ` | | ' | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------. + * |Shift | Z | X | C | V | B | Caps | | Del | N | M | , | . | / |Shift | Fn | + * `--------------------+------+------+------+------| |------+------+------+------+------+------+------+------' + * | LAlt | LGUI | LOWER|Ctr/Esc| |Spc/Sft | RAISE| LGUI | LAlt | + * `---------------------------' `---------------------------' + */ +[_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_GRV, KC_QUOT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_CAPS, KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, HAPPY, + KC_LALT, KC_LGUI, LOWER, MT(MOD_LCTL, KC_ESC), MT(MOD_LSFT, KC_SPC), RAISE, KC_RGUI, KC_RALT +), + +/* Happy + * + * ,------------------------------------------------. ,------------------------------------------------. + * | Pwr | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F0 | Del | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Caps | F11 | F12 |BLTOGG| |BL INC|BL DEC| | | | Psc | Slk | Pus | Up | Ins | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Vol- | Vol+ | Mute |RGBHUI|RGBSAI|RGBVAI| | * | / | Home | PgUp | Left | Right| | + * |------+------+------+------+------+------+------| +------+------+------+------+------+------+------+------. + * | |RGBTOG|RGBMOD|RGBRMD|RGBHUD|RGBSAD|RGBVAD| | + | - | End | PgDn | Down | | | | + * `--------------------+------+------+------+------| |------+------+------+------+------+------+------+------' + * | | | | | | | | | | + * `---------------------------' `---------------------------' + */ +[_HAPPY] = LAYOUT( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + KC_CAPS, KC_F10, KC_F12, BL_TOGG, _______, BL_INC , BL_DEC , _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_INS, + _______, KC_VOLD, KC_VOLU, KC_MUTE, RGB_HUI, RGB_SAI, RGB_VAI, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, + _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* Raise + * + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | _ | + | | | ~ | | | | : | " | > | { | } | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------. + * | | | - | = | \ | ` | | | | ; | ' | < | [ | ] | | | + * `--------------------+------+------+------+------| |------+------+------+------+------+------+------+------' + * | | | | | | | | | | + * `---------------------------' `---------------------------' + */ +[_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, _______, KC_UNDS, KC_PLUS, KC_PIPE, KC_TILD, _______, _______, KC_COLN, KC_DQUO, KC_GT, KC_LCBR, KC_RCBR, _______, + _______, _______, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, _______, _______, KC_SCLN, KC_QUOT, KC_LT, KC_LBRC, KC_RBRC, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* Lower + * + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | Enter| | | Left | Down | Up | Right| | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------. + * | | | | | | | Del | | BkSp | | PgUp | PgDn | | | | | + * `--------------------+------+------+------+------| |------+------+------+------+------+------+------+------' + * | | | | | | | | | | + * `---------------------------' `---------------------------' + */ +[_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, _______, _______, _______, _______, _______, KC_ENT, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, KC_DEL, KC_BSPC, _______, KC_PGUP, KC_PGDN, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* Adjust + * + * ,------------------------------------------------. ,------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F0 | Del | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | F11 | F12 |BLTOGG| |BL INC|BL DEC| | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |RGBMOD|RGBHUI|RGBSAI|RGBVAI| | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------. + * | | Reset| |RGBTOG|RGBHUD|RGBSAD|RGBVAD| | | Prev | Next | Vol- | Vol+ | Play | | | + * `--------------------+------+------+------+------| |------+------+------+------+------+------+------+------' + * | | | | | | | | | | + * `---------------------------' `---------------------------' + */ +[_ADJUST] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, KC_F10, KC_F12, BL_TOGG, _______, BL_INC , BL_DEC , _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + _______, RESET, _______, RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, _______, KC_MPRV, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + // persistant_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); + } + return false; + case HAPPY: + if (record->event.pressed) { + layer_on(_HAPPY); + } else { + layer_off(_HAPPY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/scythe/keymaps/forties/readme.md b/keyboards/scythe/keymaps/forties/readme.md new file mode 100644 index 00000000000..162792dc375 --- /dev/null +++ b/keyboards/scythe/keymaps/forties/readme.md @@ -0,0 +1,2 @@ +# The forty percent compatible keymap for scythe + diff --git a/keyboards/scythe/readme.md b/keyboards/scythe/readme.md new file mode 100644 index 00000000000..fed4a77e2fd --- /dev/null +++ b/keyboards/scythe/readme.md @@ -0,0 +1,15 @@ +# Scythe + +![Scythe](https://i.imgur.com/jBqQAAt.jpg) + +Yet another 60% symmetrical split keyboard. + +Keyboard Maintainer: [ka2hiro](https://github.com/ka2hiro) [@ka2hiro](https://twitter.com/ka2hiro) +Hardware Supported: Scythe PCB, ATMEGA32U4 +Hardware Availability: [@kagizaraya](https://twitter.com/kagizaraya) + +Make example for this keyboard (after setting up your build environment): + + make scythe:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/scythe/rules.mk b/keyboards/scythe/rules.mk new file mode 100644 index 00000000000..f0beca71eca --- /dev/null +++ b/keyboards/scythe/rules.mk @@ -0,0 +1,84 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +SPLIT_KEYBOARD = yes # Use shared split_common +RGBLIGHT_SPLIT = yes + diff --git a/keyboards/scythe/scythe.c b/keyboards/scythe/scythe.c new file mode 100644 index 00000000000..e8060ac278e --- /dev/null +++ b/keyboards/scythe/scythe.c @@ -0,0 +1,43 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "scythe.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/scythe/scythe.h b/keyboards/scythe/scythe.h new file mode 100644 index 00000000000..c13c63fdd03 --- /dev/null +++ b/keyboards/scythe/scythe.h @@ -0,0 +1,51 @@ +/* Copyright 2019 ENDO Katsuhiro + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +// readability +#define ___ KC_NO + +#define LAYOUT( \ + L01, L02, L03, L04, L05, L06, L07, R01, R02, R03, R04, R05, R06, R07, \ + L08, L09, L10, L11, L12, L13, L14, R08, R09, R10, R11, R12, R13, R14, \ + L15, L16, L17, L18, L19, L20, L21, R15, R16, R17, R18, R19, R20, R21, \ + L22, L23, L24, L25, L26, L27, L28, R22, R23, R24, R25, R26, R27, R28, R33, \ + L29, L30, L31, L32, R29, R30, R31, R32 \ + ) \ + { \ + { L01, L02, L03, L04, L05, L06, L07 }, \ + { L08, L09, L10, L11, L12, L13, L14 }, \ + { L15, L16, L17, L18, L19, L20, L21 }, \ + { L22, L23, L24, L25, L26, L27, L28 }, \ + { L29, L30, L31, L32, ___, ___, ___ }, \ + { R01, R02, R03, R04, R05, R06, R07 }, \ + { R08, R09, R10, R11, R12, R13, R14 }, \ + { R15, R16, R17, R18, R19, R20, R21 }, \ + { R22, R23, R24, R25, R26, R27, R28 }, \ + { R29, R30, R31, R32, ___, ___, R33 } \ + } + diff --git a/keyboards/sentraq/number_pad/config.h b/keyboards/sentraq/number_pad/config.h new file mode 100644 index 00000000000..a5df625aa7b --- /dev/null +++ b/keyboards/sentraq/number_pad/config.h @@ -0,0 +1,78 @@ +/* +Copyright 2019 QMK Community + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sentraq +#define PRODUCT Sentraq Number Pad +#define DESCRIPTION RBG backlit number pad kit + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F5, F0, B5, D6, D4 } +#define MATRIX_COL_PINS { C7, D5, D1, D0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN B0 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 13 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_RGB_TEST + #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 diff --git a/keyboards/sentraq/number_pad/info.json b/keyboards/sentraq/number_pad/info.json new file mode 100644 index 00000000000..3e17835d590 --- /dev/null +++ b/keyboards/sentraq/number_pad/info.json @@ -0,0 +1,29 @@ +{ + "keyboard_name": "Sentraq Number Pad", + "maintainer": "qmk", + "url": "https://sentraq.com/collections/kits/products/number-pad-rgb-kit", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT_numpad_5x4": { + "key_count": 17, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":1, "h":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, + {"x":0, "y":4, "w":2}, {"x":2, "y":4}, {"x":3, "y":3, "h":2} + ] + }, + "LAYOUT_ortho_5x4": { + "key_count": 20, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, + {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4} + ] + } + } +} diff --git a/keyboards/sentraq/number_pad/keymaps/default/keymap.c b/keyboards/sentraq/number_pad/keymaps/default/keymap.c new file mode 100644 index 00000000000..90c806a917b --- /dev/null +++ b/keyboards/sentraq/number_pad/keymaps/default/keymap.c @@ -0,0 +1,105 @@ +/* Copyright 2019 QMK Community + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FN 1 + +// Defines the keycodes used by our macros in process_record_user. +// Disabled as it isn't used in this keymap, but available for modification. +// enum custom_keycodes { +// QMKBEST = SAFE_RANGE, +// QMKURL +// }; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_numpad_5x4( + /* Base Layer: Number Pad + * ,---------------. + * |FN | / | * | - | + * |---+---+---|---| + * | 7 | 8 | 9 | | + * |---+---+---| + | + * | 4 | 5 | 6 | | + * |---+---+---|---| + * | 1 | 2 | 3 | | + * |---+---+---|Ent| + * | 0 | . | | + * `---------------' + */ + MO(_FN), KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, \ + KC_P0, KC_PDOT, KC_PENT + ), + /* Function Layer: RGB Controls and Numlock + * ,---------------. + * |FN |TOG|M+ |M- | Mode + * |---+---+---|---| + * | |H- |H+ | | Hue + * |---+---+---| | + * | |S- |S+ | | Saturation + * |---+---+---|---| + * | |B- |B+ |NUM| Brightness + * |---+---+---| | + * | | |LCK| + * `---------------' + */ + [_FN] = LAYOUT_numpad_5x4( + KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD, \ + KC_NO, RGB_HUD, RGB_HUI, \ + KC_NO, RGB_SAD, RGB_SAI, KC_NO, \ + KC_NO, RGB_VAD, RGB_VAI, \ + KC_NO, KC_NO, KC_NLCK + ), +}; + +// Handles macros for keycodes defined above. +// Disabled as it isn't used in this keymap, but available for modification. +// bool process_record_user(uint16_t keycode, keyrecord_t *record) { +// switch (keycode) { +// case QMKBEST: +// if (record->event.pressed) { +// // when keycode QMKBEST is pressed +// SEND_STRING("QMK is the best thing ever!"); +// } else { +// // when keycode QMKBEST is released +// } +// break; +// case QMKURL: +// if (record->event.pressed) { +// // when keycode QMKURL is pressed +// SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); +// } else { +// // when keycode QMKURL is released +// } +// break; +// } +// return true; +// } + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/sentraq/number_pad/keymaps/default/readme.md b/keyboards/sentraq/number_pad/keymaps/default/readme.md new file mode 100644 index 00000000000..a2c0e756762 --- /dev/null +++ b/keyboards/sentraq/number_pad/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Sentraq Number Pad RGB DIY Kit diff --git a/keyboards/sentraq/number_pad/number_pad.c b/keyboards/sentraq/number_pad/number_pad.c new file mode 100644 index 00000000000..8c39efac58c --- /dev/null +++ b/keyboards/sentraq/number_pad/number_pad.c @@ -0,0 +1,43 @@ +/* Copyright 2019 QMK Community + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "number_pad.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/sentraq/number_pad/number_pad.h b/keyboards/sentraq/number_pad/number_pad.h new file mode 100644 index 00000000000..05bcd527cd0 --- /dev/null +++ b/keyboards/sentraq/number_pad/number_pad.h @@ -0,0 +1,56 @@ +/* Copyright 2019 QMK Community + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_numpad_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, \ + K20, K21, K22, K23, \ + K30, K31, K32, \ + K40, K42, K43 \ +) \ +{ \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, KC_NO }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, KC_NO }, \ + { K40, KC_NO, K42, K43 } \ +} + +#define LAYOUT_ortho_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33, \ + K40, K41, K42, K43 \ +) \ +{ \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 } \ +} diff --git a/keyboards/sentraq/number_pad/readme.md b/keyboards/sentraq/number_pad/readme.md new file mode 100644 index 00000000000..ce9bfe4357c --- /dev/null +++ b/keyboards/sentraq/number_pad/readme.md @@ -0,0 +1,13 @@ +# Sentraq Number Pad RGB DIY Kit + +Sentraq Number Pad RGB DIY Kit. + +Keyboard Maintainer: QMK Community\ +Hardware Supported: Sentraq Number Pad PCB\ +Hardware Availability: [Sentraq](https://sentraq.com/collections/kits/products/number-pad-rgb-kit) + +Make example for this keyboard (after setting up your build environment): + + make sentraq/number_pad:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/sentraq/number_pad/rules.mk b/keyboards/sentraq/number_pad/rules.mk new file mode 100644 index 00000000000..8678b7f886e --- /dev/null +++ b/keyboards/sentraq/number_pad/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/sentraq/s60_x/default/config.h b/keyboards/sentraq/s60_x/default/config.h new file mode 100644 index 00000000000..dc411414348 --- /dev/null +++ b/keyboards/sentraq/s60_x/default/config.h @@ -0,0 +1,46 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sentraq +#define PRODUCT S60-X +#define DESCRIPTION QMK keyboard firmware for S60-X + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 } +#define UNUSED_PINS { F0 } + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#endif + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +#define LOCKING_SUPPORT_ENABLE +#define LOCKING_RESYNC_ENABLE + +#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/s60_x/default/default.c b/keyboards/sentraq/s60_x/default/default.c similarity index 100% rename from keyboards/s60_x/default/default.c rename to keyboards/sentraq/s60_x/default/default.c diff --git a/keyboards/sentraq/s60_x/default/default.h b/keyboards/sentraq/s60_x/default/default.h new file mode 100644 index 00000000000..e330d99bb0e --- /dev/null +++ b/keyboards/sentraq/s60_x/default/default.h @@ -0,0 +1,123 @@ +/* +Copyright 2012,2013 Jun Wako +Copyright 2015 Vin�cius Nery Cordeiro +Copyright 2016 Felix Uhl + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + +/* S60-X keymap definition macro +* K31 is the extra key next to short left ISO shift +* K2C is the moved key next to enter on ISO boards +* K3C is the extra key next to short right JIS shift +* K0D is extra key from split backspace +* K3E is extra key from HHKB-style split right shift +*/ + +#define XXX KC_NO + + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, XXX }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX } \ +} + + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, XXX, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ +} + +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K41, K42, K46, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { XXX, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, XXX, K4B, K4C, XXX, XXX, } \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ +} + + +#define LAYOUT_60_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, XXX, }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, XXX, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ +} + + +/*This special definition is used for S60-X keymaps that were ported from TMK + * QMK has a lot of keycodes that don't start with KC_, so using the regular KEYMAP macro is recommended + */ +#define LAYOUT_kc( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, XXX }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, XXX }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \ + { KC_##K40, KC_##K41, KC_##K42, XXX, XXX, XXX, KC_##K46, XXX, XXX, XXX, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, XXX } \ +} diff --git a/keyboards/sentraq/s60_x/default/rules.mk b/keyboards/sentraq/s60_x/default/rules.mk new file mode 100644 index 00000000000..b3fb861799e --- /dev/null +++ b/keyboards/sentraq/s60_x/default/rules.mk @@ -0,0 +1,65 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + + +LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_iso 60_hhkb diff --git a/keyboards/sentraq/s60_x/info.json b/keyboards/sentraq/s60_x/info.json new file mode 100644 index 00000000000..1e4514ac8ed --- /dev/null +++ b/keyboards/sentraq/s60_x/info.json @@ -0,0 +1,24 @@ +{ + "keyboard_name": "S60-X", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_hhkb": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}] + }, + "LAYOUT_60_ansi_split_bs_rshift": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_iso": { + "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/s60_x/keymaps/amnesia0287/keymap.c b/keyboards/sentraq/s60_x/keymaps/amnesia0287/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/amnesia0287/keymap.c rename to keyboards/sentraq/s60_x/keymaps/amnesia0287/keymap.c diff --git a/keyboards/s60_x/keymaps/amnesia0287/readme.md b/keyboards/sentraq/s60_x/keymaps/amnesia0287/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/amnesia0287/readme.md rename to keyboards/sentraq/s60_x/keymaps/amnesia0287/readme.md diff --git a/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/config.h b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/config.h new file mode 100644 index 00000000000..e960f8c5b73 --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/config.h @@ -0,0 +1,5 @@ +#pragma once + +// keymap needs oneshot functionality +#undef NO_ACTION_ONESHOT + diff --git a/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg similarity index 100% rename from keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg rename to keyboards/sentraq/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg diff --git a/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg similarity index 100% rename from keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg rename to keyboards/sentraq/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg diff --git a/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.svg b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.svg similarity index 100% rename from keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.svg rename to keyboards/sentraq/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.svg diff --git a/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/keymap.c b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/keymap.c new file mode 100644 index 00000000000..7304c80c105 --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/keymap.c @@ -0,0 +1,228 @@ +/* +Copyright 2016 Julien Pecqueur +Copyright 2016 Felix Uhl + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 1 + +//uncomment to activate dead keys +//#define DONT_REVIVE_DEADKEYS 1 + +//Function keycodes for better readability +//SpaceFN +//OneShot LeftShift +//GamingMode Lock (disables SpaceFn and OneShot LShift) +//Function +//Mute microphone +#define KC_SPACEFN KC_FN0 +#define KC_OSLS KC_FN3 +#define KC_GMLK KC_FN1 +#define KC_FUNC KC_FN2 +#define MICMUTE RCTL(KC_LCTL) + +enum function_codes { + F_SPACEFN = 0, + F_OSLS = 3, + F_GMLK = 1, + F_FUNC = 2 +}; + +enum layer_names { + DEFAULT, + GAMING, + FUNCTION +}; + +enum languages { + GERMAN +}; + +#define LANGUAGE GERMAN + +enum custom_keycodes { + KC_CM_A = SAFE_RANGE, +// KC_CM_B, + KC_CM_C, +// KC_CM_D, + KC_CM_E, +// KC_CM_F, + KC_CM_G, +// KC_CM_H, + KC_CM_I, +// KC_CM_J, + KC_CM_K, + KC_CM_L, + KC_CM_M, + KC_CM_N, + KC_CM_O, + KC_CM_P, +// KC_CM_Q, + KC_CM_R, + KC_CM_S, +// KC_CM_T, + KC_CM_U, +// KC_CM_V, + KC_CM_W, +// KC_CM_X, + KC_CM_Y, + KC_CM_Z +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layout 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Z| U| I| O| P| [| ]|BckSp| + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Y| X| C| V| B| N| M| ,| .| /| Up |RSft| + * |-----------------------------------------------------------| + * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| + * `-----------------------------------------------------------' + */ + [DEFAULT] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ + KC_FUNC, KC_LGUI, KC_LALT, KC_SPACEFN, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Layout 1: Gaming Layer, SpaceFn disabled + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | |Fn1 | + * |-----------------------------------------------------------| + * | |RSft| | Space | | | | | + * `-----------------------------------------------------------' + */ + [GAMING] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GMLK, \ + _______, KC_RSFT, _______, KC_SPC, _______, _______, _______, _______ + ), + + /* Layout 2: Function Layer + * MicMute requires special software to be installed. Check readme.md for more information + * ,-----------------------------------------------------------. + * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|RES| + * |-----------------------------------------------------------| + * | | | | |Prv|Ply|Nxt| � | | � | |Prt|Slk|Pau | + * |-----------------------------------------------------------| + * | | � | � | |Vl-|Mut|Vl+| | | | | |PEnt | + * |-----------------------------------------------------------| + * | | | | |MicMut|Cal| | | | |Pau |PUp |Fn1 | + * |-----------------------------------------------------------| + * | | | | | |Home|PDn |End | + * `-----------------------------------------------------------' + */ + [FUNCTION] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, RESET, \ + _______, _______, KC_CM_W, KC_CM_E, KC_MPRV, KC_MPLY, KC_MNXT, KC_CM_U, KC_CM_I, KC_CM_O, KC_CM_P, KC_PSCR, KC_SLCK, KC_PAUS, \ + _______, KC_CM_A, KC_CM_S, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_CM_K, KC_CM_L, _______, _______, _______, KC_PENT, \ + _______, _______, KC_CM_Y, _______, KC_CM_C, MICMUTE, KC_CALC, KC_CM_N, KC_CM_M, _______, _______, _______, KC_PGUP, KC_GMLK, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), +}; + +/* +* Fn action definition +*/ +const uint16_t PROGMEM fn_actions[] = { + [F_SPACEFN] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), // SpaceFn layout 1 + [F_GMLK] = ACTION_LAYER_TOGGLE(1), // Disable SpaceFn and Oneshot Shift + [F_FUNC] = ACTION_LAYER_MOMENTARY(2), // SpaceFn layout 1 + [F_OSLS] = ACTION_MODS_ONESHOT(MOD_LSFT) // Oneshot Leftshift +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_german(uint16_t keycode, keyrecord_t *record) { + uint16_t send_code = 0; + if (record->event.pressed) { + switch (keycode) { + case KC_CM_A: + send_code = KC_Q; + break; + case KC_CM_O: + send_code = KC_P; + break; + case KC_CM_U: + send_code = KC_Y; + break; + case KC_CM_S: + send_code = KC_S; + break; + } + + if (send_code == 0) { + return true; + } + else { + register_code(KC_RALT); + register_code(send_code); + unregister_code(send_code); + unregister_code(KC_RALT); + return false; + } + } + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //revive dead keys +#ifndef DONT_REVIVE_DEADKEYS + bool shift_active = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_LSFT)); + bool altgr_active = keyboard_report->mods & (MOD_BIT(KC_RALT)); + if ((keycode == KC_QUOT && !altgr_active) || + keycode == KC_GRV || + (keycode == KC_6 && shift_active)) + { + if (record->event.pressed) { + register_code(keycode); + unregister_code(keycode); + register_code(KC_SPACE); + unregister_code(KC_SPACE); + } + return false; + } +#endif +#if LANGUAGE == GERMAN + return process_german(keycode, record); +#else + return true; +#endif +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/s60_x/keymaps/ansi_qwertz/readme.md b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/ansi_qwertz/readme.md rename to keyboards/sentraq/s60_x/keymaps/ansi_qwertz/readme.md diff --git a/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/rules.mk b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/rules.mk new file mode 100644 index 00000000000..1bcd7ea7f2f --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/ansi_qwertz/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/sentraq/s60_x/keymaps/bluebear/config.h b/keyboards/sentraq/s60_x/keymaps/bluebear/config.h new file mode 100644 index 00000000000..0a6ce8178e9 --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/bluebear/config.h @@ -0,0 +1,103 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#undef DEVICE_VER +#define DEVICE_VER 0x0003 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 3 + +/* Underlight configuration + */ +#undef RGBLIGHT_HUE_STEP +#undef RGBLIGHT_SAT_STEP +#undef RGBLIGHT_VAL_STEP +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +// For Tap Dancing + +#define TAPPING_TOGGLE 1 +#define TAPPING_TERM 300 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Space Cadet Rollover - if set, allows to tap opposite shift key to cancel erroneous press +#define DISABLE_SPACE_CADET_ROLLOVER + +#endif diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/sentraq/s60_x/keymaps/bluebear/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/bluebear/keymap.c rename to keyboards/sentraq/s60_x/keymaps/bluebear/keymap.c diff --git a/keyboards/s60_x/keymaps/bluebear/readme.md b/keyboards/sentraq/s60_x/keymaps/bluebear/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/bluebear/readme.md rename to keyboards/sentraq/s60_x/keymaps/bluebear/readme.md diff --git a/keyboards/s60_x/keymaps/bluebear/rules.mk b/keyboards/sentraq/s60_x/keymaps/bluebear/rules.mk similarity index 100% rename from keyboards/s60_x/keymaps/bluebear/rules.mk rename to keyboards/sentraq/s60_x/keymaps/bluebear/rules.mk diff --git a/keyboards/sentraq/s60_x/keymaps/custom/keymap.c b/keyboards/sentraq/s60_x/keymaps/custom/keymap.c new file mode 100644 index 00000000000..c98d14349fe --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/custom/keymap.c @@ -0,0 +1,26 @@ +#include QMK_KEYBOARD_H + +/* Main layer: Test layout, using all keys. + + 0 1 2 3 4 5 6 7 8 9 A B C D E + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + 0 │GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │PGUP │BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 1 │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 2 │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │PGDN │ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 3 │LSHFT│HOME │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ END │RSHFT│ UP │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 4 │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + LAYOUT_kc(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, PGUP, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, PGDN, ENT , \ + LSFT, HOME, Z, X, C, V, B, N, M, COMM, DOT, SLSH, END, RSFT, UP, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), +}; diff --git a/keyboards/s60_x/keymaps/custom/readme.md b/keyboards/sentraq/s60_x/keymaps/custom/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/custom/readme.md rename to keyboards/sentraq/s60_x/keymaps/custom/readme.md diff --git a/keyboards/s60_x/keymaps/dbroqua/keymap.c b/keyboards/sentraq/s60_x/keymaps/dbroqua/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/dbroqua/keymap.c rename to keyboards/sentraq/s60_x/keymaps/dbroqua/keymap.c diff --git a/keyboards/sentraq/s60_x/keymaps/default/keymap.c b/keyboards/sentraq/s60_x/keymaps/default/keymap.c new file mode 100644 index 00000000000..33789a56962 --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/default/keymap.c @@ -0,0 +1,47 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* 0: Main layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ MO1 │ APP │RCTRL│█████│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + /* 0: ANSI qwerty */ + [0] = LAYOUT_60_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL \ + ), + + /* 1: Fn layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + [1] = LAYOUT_60_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/s60_x/keymaps/default/readme.md b/keyboards/sentraq/s60_x/keymaps/default/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/default/readme.md rename to keyboards/sentraq/s60_x/keymaps/default/readme.md diff --git a/keyboards/sentraq/s60_x/keymaps/default_rgb/keymap.c b/keyboards/sentraq/s60_x/keymaps/default_rgb/keymap.c new file mode 100644 index 00000000000..e707a5d960d --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/default_rgb/keymap.c @@ -0,0 +1,49 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* 0: Main layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ MO1 │ APP │RCTRL│█████│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + /* 0: ANSI qwerty */ + [0] = LAYOUT_60_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL \ + ), + + /* 1: Fn layer + * UG = Underglow = RGB Backlighting + * BL = Backlighting = In-Switch LED + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│ │BLDEC│BLTOG│BLINC│▒▒▒▒▒│ │▒▒▒▒▒│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + [1] = LAYOUT_60_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, BL_DEC, BL_TOGG, BL_INC, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/s60_x/keymaps/default_rgb/readme.md b/keyboards/sentraq/s60_x/keymaps/default_rgb/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/default_rgb/readme.md rename to keyboards/sentraq/s60_x/keymaps/default_rgb/readme.md diff --git a/keyboards/s60_x/keymaps/hasu/keymap.c b/keyboards/sentraq/s60_x/keymaps/hasu/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/hasu/keymap.c rename to keyboards/sentraq/s60_x/keymaps/hasu/keymap.c diff --git a/keyboards/s60_x/keymaps/hasu/readme.md b/keyboards/sentraq/s60_x/keymaps/hasu/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/hasu/readme.md rename to keyboards/sentraq/s60_x/keymaps/hasu/readme.md diff --git a/keyboards/s60_x/keymaps/hhkb/keymap.c b/keyboards/sentraq/s60_x/keymaps/hhkb/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/hhkb/keymap.c rename to keyboards/sentraq/s60_x/keymaps/hhkb/keymap.c diff --git a/keyboards/s60_x/keymaps/hhkb/readme.md b/keyboards/sentraq/s60_x/keymaps/hhkb/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/hhkb/readme.md rename to keyboards/sentraq/s60_x/keymaps/hhkb/readme.md diff --git a/keyboards/sentraq/s60_x/keymaps/iso/keymap.c b/keyboards/sentraq/s60_x/keymaps/iso/keymap.c new file mode 100644 index 00000000000..aec23f1aee2 --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/iso/keymap.c @@ -0,0 +1,44 @@ +#include QMK_KEYBOARD_H + +/* 0: Main layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ MO1 │ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + LAYOUT_kc(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, NO, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT , \ + LSFT, BSLS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, MO(1),APP, RCTL), + +/* 1: Fn layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + LAYOUT_kc( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, PGDN, PSCR, SLCK, PAUS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; diff --git a/keyboards/s60_x/keymaps/iso/readme.md b/keyboards/sentraq/s60_x/keymaps/iso/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/iso/readme.md rename to keyboards/sentraq/s60_x/keymaps/iso/readme.md diff --git a/keyboards/sentraq/s60_x/keymaps/iso_rgb/keymap.c b/keyboards/sentraq/s60_x/keymaps/iso_rgb/keymap.c new file mode 100644 index 00000000000..22651885d95 --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/iso_rgb/keymap.c @@ -0,0 +1,46 @@ +#include QMK_KEYBOARD_H + +/* 0: Main layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ MO1 │ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + LAYOUT(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NO, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT , \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL), + +/* 1: Fn layer +UG = Underglow = RGB Backlighting +BL = Backlighting = In-Switch LED +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│ │BLDEC│BLTOG│BLINC│▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/s60_x/keymaps/iso_rgb/readme.md b/keyboards/sentraq/s60_x/keymaps/iso_rgb/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/iso_rgb/readme.md rename to keyboards/sentraq/s60_x/keymaps/iso_rgb/readme.md diff --git a/keyboards/s60_x/keymaps/jpec/keymap.c b/keyboards/sentraq/s60_x/keymaps/jpec/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/jpec/keymap.c rename to keyboards/sentraq/s60_x/keymaps/jpec/keymap.c diff --git a/keyboards/s60_x/keymaps/jpec/readme.md b/keyboards/sentraq/s60_x/keymaps/jpec/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/jpec/readme.md rename to keyboards/sentraq/s60_x/keymaps/jpec/readme.md diff --git a/keyboards/sentraq/s60_x/keymaps/plain/keymap.c b/keyboards/sentraq/s60_x/keymaps/plain/keymap.c new file mode 100644 index 00000000000..3cdda756202 --- /dev/null +++ b/keyboards/sentraq/s60_x/keymaps/plain/keymap.c @@ -0,0 +1,24 @@ +#include QMK_KEYBOARD_H + +/* Main layer: +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty */ + LAYOUT_kc(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), +}; diff --git a/keyboards/s60_x/keymaps/plain/readme.md b/keyboards/sentraq/s60_x/keymaps/plain/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/plain/readme.md rename to keyboards/sentraq/s60_x/keymaps/plain/readme.md diff --git a/keyboards/s60_x/keymaps/poker/keymap.c b/keyboards/sentraq/s60_x/keymaps/poker/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/poker/keymap.c rename to keyboards/sentraq/s60_x/keymaps/poker/keymap.c diff --git a/keyboards/s60_x/keymaps/poker/readme.md b/keyboards/sentraq/s60_x/keymaps/poker/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/poker/readme.md rename to keyboards/sentraq/s60_x/keymaps/poker/readme.md diff --git a/keyboards/s60_x/keymaps/poker_bit/keymap.c b/keyboards/sentraq/s60_x/keymaps/poker_bit/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/poker_bit/keymap.c rename to keyboards/sentraq/s60_x/keymaps/poker_bit/keymap.c diff --git a/keyboards/s60_x/keymaps/poker_bit/readme.md b/keyboards/sentraq/s60_x/keymaps/poker_bit/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/poker_bit/readme.md rename to keyboards/sentraq/s60_x/keymaps/poker_bit/readme.md diff --git a/keyboards/s60_x/keymaps/poker_set/keymap.c b/keyboards/sentraq/s60_x/keymaps/poker_set/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/poker_set/keymap.c rename to keyboards/sentraq/s60_x/keymaps/poker_set/keymap.c diff --git a/keyboards/s60_x/keymaps/poker_set/readme.md b/keyboards/sentraq/s60_x/keymaps/poker_set/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/poker_set/readme.md rename to keyboards/sentraq/s60_x/keymaps/poker_set/readme.md diff --git a/keyboards/s60_x/keymaps/spacefn/keymap.c b/keyboards/sentraq/s60_x/keymaps/spacefn/keymap.c similarity index 100% rename from keyboards/s60_x/keymaps/spacefn/keymap.c rename to keyboards/sentraq/s60_x/keymaps/spacefn/keymap.c diff --git a/keyboards/s60_x/keymaps/spacefn/readme.md b/keyboards/sentraq/s60_x/keymaps/spacefn/readme.md similarity index 100% rename from keyboards/s60_x/keymaps/spacefn/readme.md rename to keyboards/sentraq/s60_x/keymaps/spacefn/readme.md diff --git a/keyboards/sentraq/s60_x/readme.md b/keyboards/sentraq/s60_x/readme.md new file mode 100644 index 00000000000..927a2f0401c --- /dev/null +++ b/keyboards/sentraq/s60_x/readme.md @@ -0,0 +1,19 @@ +# S60-x + +DIY compact keyboard designed by VinnyCordeiro for Sentraq. Most of the keymaps are based on GH60 code. This is a port from TMK to QMK based on the [original S60-X Repo](https://github.com/VinnyCordeiro/tmk_keyboard). + +Keyboard Maintainer: QMK Community +Hardware Supported: S60-x PCB +Hardware Availability: https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open + +There are two versions of this keyboard, an RGB and a non RGB one. Firmware built for one, will not work on the other. + +Make example for this keyboard (after setting up your build environment): + + make sentraq/s60_x/default:default + +Make example for rgb version of this keyboard: + + make sentraq/s60_x/rgb:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/sentraq/s60_x/rgb/config.h b/keyboards/sentraq/s60_x/rgb/config.h new file mode 100644 index 00000000000..57e736a05cf --- /dev/null +++ b/keyboards/sentraq/s60_x/rgb/config.h @@ -0,0 +1,48 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sentraq +#define PRODUCT S60-X-RGB +#define DESCRIPTION QMK keyboard firmware for S60-X RGB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B5, B4, D7, D6, D4 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, B6, C6, C7, F1, F0, E6, B3, B2, B1, B0 } +#define UNUSED_PINS + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#endif + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +#define RGB_DI_PIN F6 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 10 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/s60_x/rgb/rgb.c b/keyboards/sentraq/s60_x/rgb/rgb.c similarity index 100% rename from keyboards/s60_x/rgb/rgb.c rename to keyboards/sentraq/s60_x/rgb/rgb.c diff --git a/keyboards/sentraq/s60_x/rgb/rgb.h b/keyboards/sentraq/s60_x/rgb/rgb.h new file mode 100644 index 00000000000..59ffdfbbfa8 --- /dev/null +++ b/keyboards/sentraq/s60_x/rgb/rgb.h @@ -0,0 +1,96 @@ +#pragma once + +#include "quantum.h" + +#define XXX KC_NO + + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, XXX }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX } \ +} + + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, XXX, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ +} + +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K41, K42, K46, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { XXX, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, XXX, K4B, K4C, XXX, XXX, } \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ +} + + +#define LAYOUT_60_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, XXX, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, XXX, }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, XXX, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, XXX, } \ +} + + +/*This special definition is used for S60-X keymaps that were ported from TMK + * QMK has a lot of keycodes that don't start with KC_, so using the regular KEYMAP macro is recommended + */ +#define LAYOUT_kc( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, XXX }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, XXX }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \ + { KC_##K40, KC_##K41, KC_##K42, XXX, XXX, XXX, KC_##K46, XXX, XXX, XXX, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, XXX } \ +} diff --git a/keyboards/sentraq/s60_x/rgb/rules.mk b/keyboards/sentraq/s60_x/rgb/rules.mk new file mode 100644 index 00000000000..39bbc5d280f --- /dev/null +++ b/keyboards/sentraq/s60_x/rgb/rules.mk @@ -0,0 +1,70 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable RGB light + + +LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_iso 60_hhkb diff --git a/keyboards/sentraq/s65_plus/config.h b/keyboards/sentraq/s65_plus/config.h new file mode 100644 index 00000000000..51aacfc196d --- /dev/null +++ b/keyboards/sentraq/s65_plus/config.h @@ -0,0 +1,47 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define PRODUCT S65-PLUS +#define DESCRIPTION q.m.k. keyboard firmware for S65-PLUS +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sentraq + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 18 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, E6, B0, B1, D5, B2, B3, D0, D1, D2, D4, D6, D7, F7 } +#define UNUSED_PINS + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 20 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#endif diff --git a/keyboards/sentraq/s65_plus/info.json b/keyboards/sentraq/s65_plus/info.json new file mode 100644 index 00000000000..1b17ddb53da --- /dev/null +++ b/keyboards/sentraq/s65_plus/info.json @@ -0,0 +1,176 @@ +{ + "keyboard_name": "S65-Plus", + "url": "", + "maintainer": "qmk", + "width": 18, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "key_count": 78, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F2", "x":1, "y":0}, + {"label":"ESC", "x":2, "y":0}, + {"label":"1", "x":3, "y":0}, + {"label":"2", "x":4, "y":0}, + {"label":"3", "x":5, "y":0}, + {"label":"4", "x":6, "y":0}, + {"label":"5", "x":7, "y":0}, + {"label":"6", "x":8, "y":0}, + {"label":"7", "x":9, "y":0}, + {"label":"8", "x":10, "y":0}, + {"label":"9", "x":11, "y":0}, + {"label":"0", "x":12, "y":0}, + {"label":"MINUS", "x":13, "y":0}, + {"label":"EQUAL", "x":14, "y":0}, + {"label":"BACKSPACE", "x":15, "y":0, "w":2}, + {"label":"DELETE", "x":17, "y":0}, + {"label":"F3", "x":0, "y":1}, + {"label":"F4", "x":1, "y":1}, + {"label":"TAB", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"LBRACKET", "x":13.5, "y":1}, + {"label":"RBRACKET", "x":14.5, "y":1}, + {"label":"BACKSLASH", "x":15.5, "y":1, "w":1.5}, + {"label":"PAGEUP", "x":17, "y":1}, + {"label":"F5", "x":0, "y":2}, + {"label":"F6", "x":1, "y":2}, + {"label":"CAPSLOCK", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":"SEMICOLON", "x":12.75, "y":2}, + {"label":"QUOTE", "x":13.75, "y":2}, + {"label":"ENTER", "x":14.75, "y":2, "w":2.25}, + {"label":"PAGEDOWN", "x":17, "y":2}, + {"label":"F7", "x":0, "y":3}, + {"label":"F8", "x":1, "y":3}, + {"label":"LSHIFT", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"COMMA", "x":11.25, "y":3}, + {"label":"PERIOD", "x":12.25, "y":3}, + {"label":"SLASH", "x":13.25, "y":3}, + {"label":"RSHIFT", "x":14.25, "y":3, "w":1.75}, + {"label":"UP", "x":16, "y":3}, + {"label":"END", "x":17, "y":3}, + {"label":"F9", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + {"label":"LCTRL", "x":2, "y":4, "w":1.25}, + {"label":"LGUI", "x":3.25, "y":4, "w":1.25}, + {"label":"LALT", "x":4.5, "y":4, "w":1.25}, + {"label":"SPACE", "x":5.75, "y":4, "w":6.25}, + {"label":"RALT", "x":12, "y":4}, + {"label":"FN", "x":13, "y":4}, + {"label":"RCTRL", "x":14, "y":4}, + {"label":"LEFT", "x":15, "y":4}, + {"label":"DOWN", "x":16, "y":4}, + {"label":"RIGHT", "x":17, "y":4} + ] + }, + "LAYOUT_iso": { + "key_count": 79, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F2", "x":1, "y":0}, + {"label":"ESC", "x":2, "y":0}, + {"label":"1", "x":3, "y":0}, + {"label":"2", "x":4, "y":0}, + {"label":"3", "x":5, "y":0}, + {"label":"4", "x":6, "y":0}, + {"label":"5", "x":7, "y":0}, + {"label":"6", "x":8, "y":0}, + {"label":"7", "x":9, "y":0}, + {"label":"8", "x":10, "y":0}, + {"label":"9", "x":11, "y":0}, + {"label":"0", "x":12, "y":0}, + {"label":"MINUS", "x":13, "y":0}, + {"label":"EQUAL", "x":14, "y":0}, + {"label":"BACKSPACE", "x":15, "y":0, "w":2}, + {"label":"DELETE", "x":17, "y":0}, + {"label":"F3", "x":0, "y":1}, + {"label":"F4", "x":1, "y":1}, + {"label":"TAB", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"LBRACKET", "x":13.5, "y":1}, + {"label":"RBRACKET", "x":14.5, "y":1}, + {"label":"PAGEUP", "x":17, "y":1}, + {"label":"F5", "x":0, "y":2}, + {"label":"F6", "x":1, "y":2}, + {"label":"CAPSLOCK", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":"SEMICOLON", "x":12.75, "y":2}, + {"label":"QUOTE", "x":13.75, "y":2}, + {"label":"ISOHASH", "x":14.75, "y":2}, + {"label":"ENTER", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"PAGEDOWN", "x":17, "y":2}, + {"label":"F7", "x":0, "y":3}, + {"label":"F8", "x":1, "y":3}, + {"label":"LSHIFT", "x":2, "y":3, "w":1.25}, + {"label":"ISOBACKSLASH", "x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"COMMA", "x":11.25, "y":3}, + {"label":"PERIOD", "x":12.25, "y":3}, + {"label":"SLASH", "x":13.25, "y":3}, + {"label":"RSHIFT", "x":14.25, "y":3, "w":1.75}, + {"label":"UP", "x":16, "y":3}, + {"label":"END", "x":17, "y":3}, + {"label":"F9", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + {"label":"LCTRL", "x":2, "y":4, "w":1.25}, + {"label":"LGUI", "x":3.25, "y":4, "w":1.25}, + {"label":"LALT", "x":4.5, "y":4, "w":1.25}, + {"label":"SPACE", "x":5.75, "y":4, "w":6.25}, + {"label":"RALT", "x":12, "y":4}, + {"label":"FN", "x":13, "y":4}, + {"label":"RCTRL", "x":14, "y":4}, + {"label":"LEFT", "x":15, "y":4}, + {"label":"DOWN", "x":16, "y":4}, + {"label":"RIGHT", "x":17, "y":4} + ] + } + } +} diff --git a/keyboards/sentraq/s65_plus/keymaps/default/keymap.c b/keyboards/sentraq/s65_plus/keymaps/default/keymap.c new file mode 100644 index 00000000000..bbeea6a8fbc --- /dev/null +++ b/keyboards/sentraq/s65_plus/keymaps/default/keymap.c @@ -0,0 +1,56 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _AL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │F1 │F2 │Esc│1 !│2 "│3 £│4 $│5 %│6 ^│7 &│8 *│9 (│0 )│- _│= +│Bksp │Del│ + * ├───┼───┼───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │F3 │F4 │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │[ {│] }│\ | │End│ + * ├───┼───┼─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │F5 │F6 │CapsLk│ A │ S │ D │ F │ G │ H │ J │ K │ L │; :│' "│Enter │PUp│ + * ├───┼───┼──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │F7 │F8 │Shift │ Z │ X │ C │ V │ B │ N │ M │, <│. >│/ ?│Shift │Up │PDn│ + * ├───┼───┼────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │F9 │F10│Ctrl│GUI │Alt │Space │Alt│Fn │Ctl│Lft│Dwn│Rgt│ + * └───┴───┴────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + /* 0: ANSI qwerty */ + [_BL] = LAYOUT_ansi( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, \ + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_AL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + + /* 1: LED layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │ │ │RST│ │ │ │ │ │ │ │ │ │ │ │ │BLTog │BSt│ + * ├───┼───┼───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │RTg│RMd│RH+│RH-│RS+│RS-│RV+│RV-│ │ │ │VUp│ │ + * ├───┼───┼────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │Prv│VDn│Nxt│ + * └───┴───┴────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + [_AL] = LAYOUT_ansi( + _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_STEP, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT \ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/sentraq/s65_plus/keymaps/iso/keymap.c b/keyboards/sentraq/s65_plus/keymaps/iso/keymap.c new file mode 100644 index 00000000000..2218d051fd0 --- /dev/null +++ b/keyboards/sentraq/s65_plus/keymaps/iso/keymap.c @@ -0,0 +1,56 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _AL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │F1 │F2 │Esc│1 !│2 "│3 £│4 $│5 %│6 ^│7 &│8 *│9 (│0 )│- _│= +│Bksp │Del│ + * ├───┼───┼───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │F3 │F4 │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │[ {│] }│Enter│End│ + * ├───┼───├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ ├───┤ + * │F5 │F6 │CapsLk│ A │ S │ D │ F │ G │ H │ J │ K │ L │; :│' @│# ~│ │PUp│ + * ├───┼───┼────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┼───┤ + * │F7 │F8 │Sft │\ |│ Z │ X │ C │ V │ B │ N │ M │, <│. >│/ ?│Shift │Up │PDn│ + * ├───┼───┼────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │F9 │F10│Ctrl│GUI │Alt │Space │Alt│Fn │Ctl│Lft│Dwn│Rgt│ + * └───┴───┴────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + /* 0: ISO qwerty */ + [_BL] = LAYOUT_iso( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGUP, \ + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGDN, \ + KC_F7, KC_F8, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_AL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + + /* 1: LED layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │ │ │RST│ │ │ │ │ │ │ │ │ │ │ │ │BLTog │BSt│ + * ├───┼───┼───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ ├───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┼───┤ + * │ │ │ │ │RTg│RMd│RH+│RH-│RS+│RS-│RV+│RV-│ │ │ │VUp│ │ + * ├───┼───┼────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │Prv│VDn│Nxt│ + * └───┴───┴────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + [_AL] = LAYOUT_iso( + _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_STEP, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT \ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/sentraq/s65_plus/keymaps/iso/readme.md b/keyboards/sentraq/s65_plus/keymaps/iso/readme.md new file mode 100644 index 00000000000..de1d9adf803 --- /dev/null +++ b/keyboards/sentraq/s65_plus/keymaps/iso/readme.md @@ -0,0 +1,3 @@ +# iso + +An ISO layout version of the default keymap. diff --git a/keyboards/sentraq/s65_plus/readme.md b/keyboards/sentraq/s65_plus/readme.md new file mode 100644 index 00000000000..0940d9a4fd5 --- /dev/null +++ b/keyboards/sentraq/s65_plus/readme.md @@ -0,0 +1,14 @@ +S65-PLUS +===== + +DIY 65% keyboard from Sentraq. + +Keyboard Maintainer: QMK Community +Hardware Supported: S65-PLUS PCB +Hardware Availability: [Sentraq](https://sentraq.com/collections/kits/products/s65-plus-diy-keyboard-kit) + +Make example for this keyboard (after setting up your build environment): + + make sentraq/s65_plus:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/s65_plus/rules.mk b/keyboards/sentraq/s65_plus/rules.mk similarity index 100% rename from keyboards/s65_plus/rules.mk rename to keyboards/sentraq/s65_plus/rules.mk diff --git a/keyboards/s65_plus/s65_plus.c b/keyboards/sentraq/s65_plus/s65_plus.c similarity index 100% rename from keyboards/s65_plus/s65_plus.c rename to keyboards/sentraq/s65_plus/s65_plus.c diff --git a/keyboards/sentraq/s65_plus/s65_plus.h b/keyboards/sentraq/s65_plus/s65_plus.h new file mode 100644 index 00000000000..95d06122e06 --- /dev/null +++ b/keyboards/sentraq/s65_plus/s65_plus.h @@ -0,0 +1,34 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K016, K017, \ + K100, K101, K102, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, \ + K200, K201, K202, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, \ + K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, K316, K317, \ + K400, K401, K402, K403, K404, K408, K412, K413, K414, K415, K416, K417 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, KC_NO, K016, K017 }, \ + { K100, K101, K102, KC_NO, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117 }, \ + { K200, K201, K202, KC_NO, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, KC_NO, K216, K217 }, \ + { K300, K301, KC_NO, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315, K316, K317 }, \ + { K400, K401, K402, K403, K404, KC_NO, KC_NO, KC_NO, K408, KC_NO, KC_NO, KC_NO, K412, K413, K414, K415, K416, K417 } \ +} + +#define LAYOUT_iso( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K016, K017, \ + K100, K101, K102, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K117, \ + K200, K201, K202, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K116, K217, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, K316, K317, \ + K400, K401, K402, K403, K404, K408, K412, K413, K414, K415, K416, K417 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, KC_NO, K016, K017 }, \ + { K100, K101, K102, KC_NO, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117 }, \ + { K200, K201, K202, KC_NO, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, KC_NO, K217 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315, K316, K317 }, \ + { K400, K401, K402, K403, K404, KC_NO, KC_NO, KC_NO, K408, KC_NO, KC_NO, KC_NO, K412, K413, K414, K415, K416, K417 } \ +} + +void matrix_init_user(void); +void matrix_scan_user(void); diff --git a/keyboards/sentraq/s65_x/config.h b/keyboards/sentraq/s65_x/config.h new file mode 100644 index 00000000000..9c337bde457 --- /dev/null +++ b/keyboards/sentraq/s65_x/config.h @@ -0,0 +1,49 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define PRODUCT S65-X RGB +#define DESCRIPTION QMK keyboard firmware for S65-X RGB +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sentraq + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 } +#define MATRIX_COL_PINS { F4, F1, F0, E6, B0, B1, D5, B2, B3, D0, D1, D2, D4, D6, D7, F7 } +#define UNUSED_PINS + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 5 +#define BACKLIGHT_CAPS_LOCK + +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 20 +#define RGBLIGHT_SLEEP + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#endif diff --git a/keyboards/sentraq/s65_x/info.json b/keyboards/sentraq/s65_x/info.json new file mode 100644 index 00000000000..9aeb7eb7ded --- /dev/null +++ b/keyboards/sentraq/s65_x/info.json @@ -0,0 +1,156 @@ +{ + "keyboard_name": "S65-X PCB", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_65_ansi": { + "key_count": 68, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Delete", "x":15, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Page Up", "x":15, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Page Down", "x":15, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Up", "x":14, "y":3}, + {"label":"End", "x":15, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4}, + {"label":"Fn", "x":11, "y":4}, + {"label":"Ctrl", "x":12, "y":4}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4} + ] + }, + "LAYOUT_65_iso": { + "key_count": 69, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Delete", "x":15, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"Page Up", "x":15, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"#", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"Page Down", "x":15, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Up", "x":14, "y":3}, + {"label":"End", "x":15, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"AltGr", "x":10, "y":4}, + {"label":"Fn", "x":11, "y":4}, + {"label":"Ctrl", "x":12, "y":4}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4} + ] + } + } +} diff --git a/keyboards/sentraq/s65_x/keymaps/default/keymap.c b/keyboards/sentraq/s65_x/keymaps/default/keymap.c new file mode 100644 index 00000000000..00ae4d0a202 --- /dev/null +++ b/keyboards/sentraq/s65_x/keymaps/default/keymap.c @@ -0,0 +1,102 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _AL 1 +#define _FL 2 +#define _UL 3 + +#define FL_CAPS LT(_FL, KC_CAPS) // Tap to toggle caps lock and hold to activate function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer, swapped alt and GUI for Mac + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │GE │1 !│2 @│3 #│4 $│5 %│6 ^│7 &│8 *│9 (│0 )│- _│= +│Bksp │Del│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │[ {│] }│\ | │End│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │; :│' "│Enter │PUp│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │Shift │ Z │ X │ C │ V │ B │ N │ M │, <│. >│/ ?│Shift │Up │PDn│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │Ctrl│GUI │Alt │Space │Alt│Fn │Ctl│Lft│Dwn│Rgt│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + /* 0: ANSI qwerty */ + [_BL] = LAYOUT_65_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + FL_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + + /* 1: Locking arrow keys to WASD for when you need dedicated arrow keys + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │ │Up │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │Lft│Dwn│Rgt│ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │Swp │Nrm │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + [_AL] = LAYOUT_65_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, AG_SWAP, AG_NORM, _______, _______, _______, _______, _______, _______, _______ \ + ), + + + /* 2: Fn layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │` ~│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │_AL│Up │ │ │ │ │ │PUp│PDn│PSc│SLk│Pau│ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │Lft│Dwn│Rgt│ │ │Lft│Dwn│Up │Rgt│ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │_UL│ │ │ │ │ │ │Hm │End│ │ │VUp│ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │ │ │ │ │ │ │Mut│VDn│Ply│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + [_FL] = LAYOUT_65_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ + _______, TG(_AL), KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, \ + _______, TG(_UL), _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_MPLY \ + ), + + + /* 3: Locking layer for controlling the underglow + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │BTg│BSt│ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │RTg│RMd│ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │RH+│RH-│RS+│RS-│RV+│RV-│ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + [_UL] = LAYOUT_65_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/sentraq/s65_x/keymaps/default/readme.md b/keyboards/sentraq/s65_x/keymaps/default/readme.md new file mode 100644 index 00000000000..96fa2ff53e5 --- /dev/null +++ b/keyboards/sentraq/s65_x/keymaps/default/readme.md @@ -0,0 +1,32 @@ +### 1 ANSI +An ANSI layout that assumes standard sized shifts, enter, and backspace keys. + +#### 1.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │▒▒▒▒▒│END │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│▒▒▒▒▒│PG_UP│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │RCTRL│LEFT │DOWN │RIGHT│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 1.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│_UL │ │ │ │ │ │ │Home │ End │ │▒▒▒▒▒│▒▒▒▒▒│Vol+ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │AG_SW│AG_NR│█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### MacOS + +This keymap supports swapping the GUI and ALT keys using the Fn layer. See the +AG_SWAP and AG_NORM bindings to swap the two keys. diff --git a/keyboards/sentraq/s65_x/keymaps/iso/keymap.c b/keyboards/sentraq/s65_x/keymaps/iso/keymap.c new file mode 100644 index 00000000000..f5a0a86306f --- /dev/null +++ b/keyboards/sentraq/s65_x/keymaps/iso/keymap.c @@ -0,0 +1,102 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _AL 1 +#define _FL 2 +#define _UL 3 + +#define FL_CAPS LT(_FL, KC_CAPS) // Tap to toggle caps lock and hold to activate function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer, swapped alt and GUI for Mac + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │GE │1 !│2 "│3 £│4 $│5 %│6 ^│7 &│8 *│9 (│0 )│- _│= +│Bksp │Del│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │[ {│] }│Enter│End│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ ├───┤ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │; :│' @│# ~│ │PUp│ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┼───┤ + * │Sft │\ |│ Z │ X │ C │ V │ B │ N │ M │, <│. >│/ ?│Shift │Up │PDn│ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │Ctrl│GUI │Alt │Space │Alt│Fn │Ctl│Lft│Dwn│Rgt│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + /* 0: ISO qwerty */ + [_BL] = LAYOUT_65_iso( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_END, \ + FL_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + + /* 1: Locking arrow keys to WASD for when you need dedicated arrow keys + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │ │Up │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ ├───┤ + * │ │Lft│Dwn│Rgt│ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + [_AL] = LAYOUT_65_iso( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + + /* 2: Fn layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │` ~│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │_AL│Up │ │ │ │ │ │PUp│PDn│PSc│SLk│Pau│ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ ├───┤ + * │ │Lft│Dwn│Rgt│ │ │Lft│Dwn│Up │Rgt│ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┼───┤ + * │ │ │_UL│ │ │ │ │ │ │Hm │End│ │ │VUp│ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │ │ │ │ │ │ │Mut│VDn│Ply│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + [_FL] = LAYOUT_65_iso( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ + _______, TG(_AL), KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, _______, \ + _______, _______, TG(_UL), _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_MPLY \ + ), + + + /* 3: Locking layer for controlling the underglow + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │BTg│BSt│ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │RTg│RMd│ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │RH+│RH-│RS+│RS-│RV+│RV-│ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + [_UL] = LAYOUT_65_iso( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/s65_x/keymaps/iso/readme.md b/keyboards/sentraq/s65_x/keymaps/iso/readme.md similarity index 100% rename from keyboards/s65_x/keymaps/iso/readme.md rename to keyboards/sentraq/s65_x/keymaps/iso/readme.md diff --git a/keyboards/sentraq/s65_x/keymaps/kelorean/keymap.c b/keyboards/sentraq/s65_x/keymaps/kelorean/keymap.c new file mode 100644 index 00000000000..7a0de8559d4 --- /dev/null +++ b/keyboards/sentraq/s65_x/keymaps/kelorean/keymap.c @@ -0,0 +1,150 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _CM 1 +#define _DV 2 +#define _AL 3 +#define _FL 4 +#define _UL 5 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer, swapped alt and GUI for Mac + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │BKSPC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_BL] = LAYOUT_65_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + F(4), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + /* 1: Colemak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 1: Colemak layer */ + [_CM] = LAYOUT_65_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + F(4), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + + /* 2: Dvorak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │BKSPC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 2: Dvorak layer */ + [_DV] = LAYOUT_65_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_END, \ + F(4), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + /* 3: Locking arrow keys to WASD for when you need dedicated arrow keys + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + /* 3: Locking arrow keys to WASD*/ + [_AL] = LAYOUT_65_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + /* 4: Fn layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│_UL │ │_CM │_DV │ │ │ │ │Home │End │▒▒▒▒▒│ │Vol+ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_FL] = LAYOUT_65_ansi( + KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ + _______, F(3), KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, _______, \ + _______, F(5), _______, F(1), F(2), _______, _______, _______, KC_HOME, KC_END, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_MPLY), + + /* 5: Locking layer for controlling the underglow + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ On │Mode │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_UL] = LAYOUT_65_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(_FL), // Momentary Fn overlay + [1] = ACTION_LAYER_TOGGLE(_CM), //Toggle Colemak Layer overlay + [2] = ACTION_LAYER_TOGGLE(_DV), // Toggle Dvorak Layer overlay + [3] = ACTION_LAYER_TOGGLE(_AL), // Toggle Arrow Layer overlay + [4] = ACTION_LAYER_TAP_KEY(_FL, KC_BSPC), // Tap to Backspace and hold to activate function layer + [5] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay + +}; diff --git a/keyboards/s65_x/keymaps/kelorean/readme.md b/keyboards/sentraq/s65_x/keymaps/kelorean/readme.md similarity index 100% rename from keyboards/s65_x/keymaps/kelorean/readme.md rename to keyboards/sentraq/s65_x/keymaps/kelorean/readme.md diff --git a/keyboards/sentraq/s65_x/keymaps/nall/keymap.c b/keyboards/sentraq/s65_x/keymaps/nall/keymap.c new file mode 100644 index 00000000000..a5daed006ab --- /dev/null +++ b/keyboards/sentraq/s65_x/keymaps/nall/keymap.c @@ -0,0 +1,102 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _AL 1 +#define _FL 2 +#define _UL 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer, swapped alt and GUI for Mac + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_BL] = LAYOUT_65_ansi( + KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + F(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + + /* 1: Locking arrow keys to WASD for when you need dedicated arrow keys + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_AL] = LAYOUT_65_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + /* 2: Fn layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│_UL │ │ │ │ │ │ │ │Home │End │▒▒▒▒▒│ │Vol+ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_FL] = LAYOUT_65_ansi( + KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ + KC_TRNS, F(1), KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, F(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_MPLY), + + /* 3: Locking layer for controlling the underglow + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ On │Mode │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_UL] = LAYOUT_65_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(_FL), // Momentary Fn overlay + [1] = ACTION_LAYER_TOGGLE(_AL), // Toggle Arrow Layer overlay + [2] = ACTION_LAYER_TAP_KEY(_FL, KC_CAPS),// Tap to toggle caps lock and hold to activate function layer + [3] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay +}; + diff --git a/keyboards/sentraq/s65_x/keymaps/smt/keymap.c b/keyboards/sentraq/s65_x/keymaps/smt/keymap.c new file mode 100644 index 00000000000..8c3984c21f6 --- /dev/null +++ b/keyboards/sentraq/s65_x/keymaps/smt/keymap.c @@ -0,0 +1,159 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _FL 3 +#define _CL 4 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK +}; + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Qwerty layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ ` │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_QWERTY] = LAYOUT_65_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, \ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 1: Colemak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ ` │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 1: ANSI colemak */ + [_COLEMAK] = LAYOUT_65_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, \ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ + CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 2: Dvorak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│ ` │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 2: ANSI dvorak */ + [_DVORAK] = LAYOUT_65_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_GRV, \ + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, \ + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 3: Function layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ F13 │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │PRSCR│SCLCK│PAUSE│ │ │ │█████│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │PG_UP│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ _FL │ │HOME │PG_DN│ END │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 3: ANSI Fn layer */ + [_FL] = LAYOUT_65_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, \ + _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, MO(_FL), _______, KC_HOME, KC_PGDN, KC_END), + + /* 4: Control layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ RGB │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │RESET│ │ │QWRTY│COLMK│DVORK│ │ │ │ │█████│RGBV+│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│RGBV-│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ _FL │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │RGBS+│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│RGB_M│█████│█████│█████│ │ _FL │ │RGBH-│RGBS-│RGBH+│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 4: ANSI control layer */ + [_CL] = LAYOUT_65_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, \ + _______, _______, _______, _______, RESET, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, RGB_VAI, \ + _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, \ + MO(_FL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, _______, \ + _______, _______, _______, RGB_MOD, _______, MO(_FL), _______, RGB_HUD, RGB_SAD, RGB_HUI), +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + } + return true; +} diff --git a/keyboards/sentraq/s65_x/readme.md b/keyboards/sentraq/s65_x/readme.md new file mode 100644 index 00000000000..d6d309c843f --- /dev/null +++ b/keyboards/sentraq/s65_x/readme.md @@ -0,0 +1,14 @@ +S65-X +===== + +DIY 65% keyboard from Sentraq. + +Keyboard Maintainer: QMK Community +Hardware Supported: S65-X PCB +Hardware Availability: [Sentraq](https://sentraq.com/products/s65-x-rgb-diy-keyboard-kit) + +Make example for this keyboard (after setting up your build environment): + + make sentraq/s65_x:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/sentraq/s65_x/rules.mk b/keyboards/sentraq/s65_x/rules.mk new file mode 100644 index 00000000000..6ab268deec1 --- /dev/null +++ b/keyboards/sentraq/s65_x/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable RGB light + +LAYOUTS = 65_ansi 65_iso diff --git a/keyboards/sentraq/s65_x/s65_x.c b/keyboards/sentraq/s65_x/s65_x.c new file mode 100644 index 00000000000..844f5cf28bb --- /dev/null +++ b/keyboards/sentraq/s65_x/s65_x.c @@ -0,0 +1,18 @@ +#include "s65_x.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} diff --git a/keyboards/sentraq/s65_x/s65_x.h b/keyboards/sentraq/s65_x/s65_x.h new file mode 100644 index 00000000000..aef9205754c --- /dev/null +++ b/keyboards/sentraq/s65_x/s65_x.h @@ -0,0 +1,63 @@ +#pragma once + +#include "quantum.h" + +/* LAYOUT_65_ansi + * ANSI has more standard width shift, delete, and enter keys, doesn't use all of the 1U keys + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │000│001│002│003│004│005│006│007│008│009│010│011│012│014 │015│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │100 │102│103│104│105│106│107│108│109│110│111│112│113│114 │115│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │200 │202│203│204│205│206│207│208│209│210│211│212│214 │215│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │301 │302│303│304│305│306│307│308│309│310│311│313 │314│315│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │400 │401 │402 │408 │410│411│412│413│414│415│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ +#define LAYOUT_65_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, K315, \ + K400, K401, K402, K408, K410, K411, K412, K413, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014, K015 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214, K215 }, \ + { KC_NO, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314, K315 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K408, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414, K415 } \ +} + + +/* LAYOUT_65_iso + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │000│001│002│003│004│005│006│007│008│009│010│011│012│014 │015│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │100 │102│103│104│105│106│107│108│109│110│111│112│113│ │115│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐114 ├───┤ + * │200 │202│203│204│205│206│207│208│209│210│211│212│213│ │215│ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┼───┤ + * │300 │301│302│303│304│305│306│307│308│309│310│311│313 │314│315│ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │400 │401 │402 │408 │410│411│412│413│414│415│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ +#define LAYOUT_65_iso( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K114, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, K315, \ + K400, K401, K402, K408, K410, K411, K412, K413, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014, K015 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314, K315 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K408, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414, K415 } \ +} + + +void matrix_init_user(void); +void matrix_scan_user(void); diff --git a/keyboards/shiro/config.h b/keyboards/shiro/config.h new file mode 100644 index 00000000000..d97be0cd29c --- /dev/null +++ b/keyboards/shiro/config.h @@ -0,0 +1,251 @@ +/* +Copyright 2019 T.Shinohara + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER T.Shinohara +#define PRODUCT Shiro +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F4, F5, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/shiro/info.json b/keyboards/shiro/info.json new file mode 100644 index 00000000000..944cdb84c53 --- /dev/null +++ b/keyboards/shiro/info.json @@ -0,0 +1,29 @@ +{ + "keyboard_name": "Shiro", + "url": "https://github.com/ShinoharaTa/keyboards/blob/master/Shiro/manual/build_guide_ja.md", + "maintainer": "T.Shinohara", + "width": 3, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 15, + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 0, "y": 1}, + {"x": 1, "y": 1}, + {"x": 2, "y": 1}, + {"x": 0, "y": 2}, + {"x": 1, "y": 2}, + {"x": 2, "y": 2}, + {"x": 0, "y": 3}, + {"x": 1, "y": 3}, + {"x": 2, "y": 3}, + {"x": 0, "y": 4}, + {"x": 1, "y": 4}, + {"x": 2, "y": 4} + ] + } + } +} diff --git a/keyboards/shiro/keymaps/check/config.h b/keyboards/shiro/keymaps/check/config.h new file mode 100644 index 00000000000..369388adad8 --- /dev/null +++ b/keyboards/shiro/keymaps/check/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 T.Shinohara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/shiro/keymaps/check/keymap.c b/keyboards/shiro/keymaps/check/keymap.c new file mode 100644 index 00000000000..1f41f61dd4a --- /dev/null +++ b/keyboards/shiro/keymaps/check/keymap.c @@ -0,0 +1,66 @@ +/* Copyright 2019 T.Shinohara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + TEST_A1 = SAFE_RANGE, + TEST_A2, + TEST_A3, + TEST_B1, + TEST_B2, + TEST_B3, + TEST_C1, + TEST_C2, + TEST_C3, + TEST_D1, + TEST_D2, + TEST_D3, + TEST_E1, + TEST_E2, + TEST_E3 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + TEST_A1, TEST_A2, TEST_A3, + TEST_B1, TEST_B2, TEST_B3, + TEST_C1, TEST_C2, TEST_C3, + TEST_D1, TEST_D2, TEST_D3, + TEST_E1, TEST_E2, TEST_E3 + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case TEST_A1: if(record->event.pressed){ SEND_STRING("A1"); } break; + case TEST_A2: if(record->event.pressed){ SEND_STRING("A2"); } break; + case TEST_A3: if(record->event.pressed){ SEND_STRING("A3"); } break; + case TEST_B1: if(record->event.pressed){ SEND_STRING("B1"); } break; + case TEST_B2: if(record->event.pressed){ SEND_STRING("B2"); } break; + case TEST_B3: if(record->event.pressed){ SEND_STRING("B3"); } break; + case TEST_C1: if(record->event.pressed){ SEND_STRING("C1"); } break; + case TEST_C2: if(record->event.pressed){ SEND_STRING("C2"); } break; + case TEST_C3: if(record->event.pressed){ SEND_STRING("C3"); } break; + case TEST_D1: if(record->event.pressed){ SEND_STRING("D1"); } break; + case TEST_D2: if(record->event.pressed){ SEND_STRING("D2"); } break; + case TEST_D3: if(record->event.pressed){ SEND_STRING("D3"); } break; + case TEST_E1: if(record->event.pressed){ SEND_STRING("E1"); } break; + case TEST_E2: if(record->event.pressed){ SEND_STRING("E2"); } break; + case TEST_E3: if(record->event.pressed){ SEND_STRING("E3"); } break; + } + return true; +} diff --git a/keyboards/shiro/keymaps/check/readme.md b/keyboards/shiro/keymaps/check/readme.md new file mode 100644 index 00000000000..715ddd3358c --- /dev/null +++ b/keyboards/shiro/keymaps/check/readme.md @@ -0,0 +1 @@ +# The default keymap for Shiro \ No newline at end of file diff --git a/keyboards/shiro/keymaps/default/config.h b/keyboards/shiro/keymaps/default/config.h new file mode 100644 index 00000000000..369388adad8 --- /dev/null +++ b/keyboards/shiro/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 T.Shinohara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/shiro/keymaps/default/keymap.c b/keyboards/shiro/keymaps/default/keymap.c new file mode 100644 index 00000000000..b80c2945252 --- /dev/null +++ b/keyboards/shiro/keymaps/default/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2019 T.Shinohara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layer_number { + _NUMBER = 0, + _CURSOL, + _MOUSE +}; + +#define NUMBER TO(_NUMBER) +#define CURSOL TO(_CURSOL) +#define MOUSE TO(_MOUSE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NUMBER] = LAYOUT( + NUMBER, CURSOL, MOUSE, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, + KC_P0, KC_BSPC, KC_ENT + ), + [_CURSOL] = LAYOUT( + NUMBER, CURSOL, MOUSE, + KC_HOME, KC_UP, KC_PGUP, + KC_LEFT, KC_ESC, KC_RIGHT, + KC_END, KC_DOWN, KC_PGDN, + KC_DEL, KC_BSPC, KC_ENT + ), + [_MOUSE] = LAYOUT( + NUMBER, CURSOL, MOUSE, + KC_CUT, KC_COPY, KC_PSTE, + KC_UNDO, KC_FIND, KC_AGIN, + XXXXXXX, XXXXXXX, XXXXXXX, + KC_DEL, KC_BSPC, KC_ENT + ), +}; diff --git a/keyboards/shiro/keymaps/default/readme.md b/keyboards/shiro/keymaps/default/readme.md new file mode 100644 index 00000000000..715ddd3358c --- /dev/null +++ b/keyboards/shiro/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Shiro \ No newline at end of file diff --git a/keyboards/shiro/readme.md b/keyboards/shiro/readme.md new file mode 100644 index 00000000000..7c4c024a6bf --- /dev/null +++ b/keyboards/shiro/readme.md @@ -0,0 +1,27 @@ +# 素 - Shiro + +![Shiro](https://cdn.discordapp.com/attachments/536423734144401422/597447002288291861/P7070070_cp.jpg) + +これは日本の名刺(55mmx91mm)に、3x5の15キーを詰め込んだとても小さいキーパッドです。 + +This product is a 3x5 very small keypad. +It is made in 55mm x 91mm according to the Japanese business card. + +Keyboard Maintainer: [T.Shinohara](https://github.com/ShinoharaTa) +Hardware Supported: The Shiro PCBs, ProMicro supported. Using only Kailh Low Profile Switches. +Hardware Availability: [Booth (Japanese Site)](https://shino3.booth.pm/items/1444895) +日本国内ではBoothで入手できます: [Booth (Japanese Site)](https://shino3.booth.pm/items/1444895) + +![Shiro-backside](https://cdn.discordapp.com/attachments/536423734144401422/597464086640328724/20190707_033520.jpg) + +Make for this keyboard default keymap (after setting up your build environment): + + make shiro:default + +Make for this keyboard build check keymap (after setting up your build environment): + + make shiro:check + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +[Build guide - Japanese](https://github.com/ShinoharaTa/keyboards/blob/master/Shiro/manual/build_guide_ja.md) \ No newline at end of file diff --git a/keyboards/shiro/rules.mk b/keyboards/shiro/rules.mk new file mode 100644 index 00000000000..3ea1516fc08 --- /dev/null +++ b/keyboards/shiro/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/shiro/shiro.c b/keyboards/shiro/shiro.c new file mode 100644 index 00000000000..b30329d3395 --- /dev/null +++ b/keyboards/shiro/shiro.c @@ -0,0 +1,51 @@ +/* Copyright 2019 T.Shinohara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "shiro.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/shiro/shiro.h b/keyboards/shiro/shiro.h new file mode 100644 index 00000000000..9e088ba555f --- /dev/null +++ b/keyboards/shiro/shiro.h @@ -0,0 +1,41 @@ +/* Copyright 2019 T.Shinohara + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11, k12, \ + k20, k21, k22, \ + k30, k31, k32, \ + k40, k41, k42 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, k11, k12 }, \ + { k20, k21, k22 }, \ + { k30, k31, k32 }, \ + { k40, k41, k42 } \ +} diff --git a/keyboards/signum/3_0/elitec/config.h b/keyboards/signum/3_0/elitec/config.h new file mode 100644 index 00000000000..88e45ef450c --- /dev/null +++ b/keyboards/signum/3_0/elitec/config.h @@ -0,0 +1,26 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xF1E7 +#define PRODUCT_ID 0x5163 +#define DEVICE_VER 0x0000 +#define MANUFACTURER troyfletcher +#define PRODUCT Signum +#define DESCRIPTION q.m.k. keyboard firmware for Signum 3.0 + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D2, D1, F5, B5 } +#define MATRIX_COL_PINS { B4, D7, D0, E6, D4, F6, F4, F7, B1, B3, C6, B2 } +#define UNUSED_PINS + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE diff --git a/keyboards/signum/3_0/elitec/elitec.c b/keyboards/signum/3_0/elitec/elitec.c new file mode 100644 index 00000000000..78195260b11 --- /dev/null +++ b/keyboards/signum/3_0/elitec/elitec.c @@ -0,0 +1 @@ +#include "elitec.h" diff --git a/keyboards/signum/3_0/elitec/elitec.h b/keyboards/signum/3_0/elitec/elitec.h new file mode 100644 index 00000000000..d28d3d47697 --- /dev/null +++ b/keyboards/signum/3_0/elitec/elitec.h @@ -0,0 +1,15 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_4x12( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 } \ +} diff --git a/keyboards/signum/3_0/elitec/info.json b/keyboards/signum/3_0/elitec/info.json new file mode 100644 index 00000000000..53b88d55347 --- /dev/null +++ b/keyboards/signum/3_0/elitec/info.json @@ -0,0 +1,67 @@ +{ + "keyboard_name": "Signum 3.0", + "url": "http://troyfletcher.net/", + "maintainer": "jceb", + "width": 15, + "height": 6, + "layouts": { + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + + { "x": 0, "y": 0.5, "r": 15 }, + { "x": 1, "y": 0.5, "r": 15 }, + { "x": 2, "y": 0.25, "r": 15 }, + { "x": 3, "y": 0, "r": 15 }, + { "x": 4, "y": 0.25, "r": 15 }, + { "x": 5, "y": 0.5, "r": 15 }, + { "x": 9, "y": 0.5, "r": -15 }, + { "x": 10, "y": 0.25, "r": -15 }, + { "x": 11, "y": 0, "r": -15 }, + { "x": 12, "y": 0.25, "r": -15 }, + { "x": 13, "y": 0.5, "r": -15 }, + { "x": 14, "y": 0.5, "r": -15 }, + + { "x": 0, "y": 1.5, "r": 15 }, + { "x": 1, "y": 1.5, "r": 15 }, + { "x": 2, "y": 1.25, "r": 15 }, + { "x": 3, "y": 1, "r": 15 }, + { "x": 4, "y": 1.25, "r": 15 }, + { "x": 5, "y": 1.5, "r": 15 }, + { "x": 9, "y": 1.5, "r": -15 }, + { "x": 10, "y": 1.25, "r": -15 }, + { "x": 11, "y": 1, "r": -15 }, + { "x": 12, "y": 1.25, "r": -15 }, + { "x": 13, "y": 1.5, "r": -15 }, + { "x": 14, "y": 1.5, "r": -15 }, + + { "x": 0, "y": 2.5, "r": 15 }, + { "x": 1, "y": 2.5, "r": 15 }, + { "x": 2, "y": 2.25, "r": 15 }, + { "x": 3, "y": 2, "r": 15 }, + { "x": 4, "y": 2.25, "r": 15 }, + { "x": 5, "y": 2.5, "r": 15 }, + { "x": 9, "y": 2.5, "r": -15 }, + { "x": 10, "y": 2.25, "r": -15 }, + { "x": 11, "y": 2, "r": -15 }, + { "x": 12, "y": 2.25, "r": -15 }, + { "x": 13, "y": 2.5, "r": -15 }, + { "x": 14, "y": 2.5, "r": -15 }, + + { "x": 0, "y": 4, "r": 15 }, + { "x": 1, "y": 3.5, "r": 15 }, + { "x": 2, "y": 3.25, "r": 15 }, + { "x": 4, "y": 4.25, "r": 15, "h": 1.5 }, + { "x": 5, "y": 4, "r": 15, "h": 2 }, + { "x": 6, "y": 4.25, "r": 15, "h": 1.5 }, + { "x": 8, "y": 4.25, "r": -15, "h": 1.5 }, + { "x": 9, "y": 4, "r": -15, "h": 2 }, + { "x": 10, "y": 4.25, "r": -15, "h": 1.5 }, + { "x": 12, "y": 3.25, "r": -15 }, + { "x": 13, "y": 3.5, "r": -15 }, + { "x": 14, "y": 4, "r": -15 } + + ] + } + } +} diff --git a/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py b/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py new file mode 100755 index 00000000000..cfa8edf57a7 --- /dev/null +++ b/keyboards/signum/3_0/elitec/keymaps/default/generate_km.py @@ -0,0 +1,194 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import json +import layout +import os +import re + + +def gen_uc_iter(): + length = len(layout.uc_dict) + for key, value in sorted(layout.uc_dict.items()): + length -= 1 + if length: + yield (key, value, False) + else: + yield (key, value, True) + + +def _translate(s): + if re.match("^[0-9]$", s): + return ("KC_{0}".format(s), " {0} ".format(s)) + elif re.match("^[a-z]$", s): + return ("KC_{0}".format(s.upper()), " {0} ".format(s)) + elif re.match("^[A-Z]$", s): + return ("S(KC_{0})".format(s), " {0} ".format(s)) + elif re.match("^F[0-9]{1,2}$", s): # Fn, works from F0 to F99 + return ("KC_{0}".format(s), "{0:^7}".format(s)) + elif re.match("^DF[0-9]{1,2}$", s): # DFn, works from DF0 to DF99 + return ("DF({0})".format(s[2:]), "{0:^7}".format(s)) + elif re.match("^MO[0-9]{1,2}$", s): # MOn, works from MO0 to MO99 + return ("MO({0})".format(s[2:]), "{0:^7}".format(s)) + elif re.match("^OSL[0-9]{1,2}$", s): # OSLn, works from OSL0 to OSL99 + return ("OSL({0})".format(s[3:]), "{0:^7}".format(s)) + elif re.match("^TG[0-9]{1,2}$", s): # TGn, works from TG0 to TG99 + return ("TG({0})".format(s[2:]), "{0:^7}".format(s)) + elif re.match("^TO[0-9]{1,2}$", s): # Tn, works from TO0 to TO99 + return ("TO({0})".format(s[2:]), "{0:^7}".format(s)) + elif re.match("^TT[0-9]{1,2}$", s): # Tn, works from TT0 to TT99 + return ("TT({0})".format(s[2:]), "{0:^7}".format(s)) + elif s in layout.uc_dict: + return ("X("+s+")", " {0} ".format(chr(int(layout.uc_dict[s], 0)))) + elif s in layout.qmk_dict: + return (layout.qmk_dict[s], "{0:^7}".format(s)) + elif s == s.upper() and s.startswith("KC_"): + return (s, "{0:^7}".format(s[2:])) + else: + return ("XXXXXXX", " {0} ".format(chr(128165))) + + +def toKC(s): + return _translate(s)[0] + + +def toLgd(s): + return _translate(s)[1] + + +def quoteC(text): + yield "/*" + for line in text: + yield " * " + line + yield " */\n" + + +def getKeymapText(id, layer, columns, rows): + keymap = [] + keymap.append("Layer %d" % id) + keymap.append("------------------------------------------------- -------------------------------------------------") + keymap.append("|{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|".format(*map(toLgd, layer[:12]))) + keymap.append("------------------------------------------------- -------------------------------------------------") + keymap.append("|{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|".format(*map(toLgd, layer[12:24]))) + keymap.append("------------------------------------------------- -------------------------------------------------") + keymap.append("|{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|".format(*map(toLgd, layer[24:36]))) + keymap.append("-----------------------------------------------------------------------------------------------------------------") + keymap.append(" {0} {1} {2} |{3}|{4}|{5}|{6}|{7}|{8}| {9} {10} {11}".format(*map(toLgd, layer[36:48])).rstrip()) + keymap.append(" -------------------------------------------------") + return keymap + + +def writeKeymap(f_template, f_keymap, layers, columns, rows): + doCopy = False + + for line in f_template: + doCopy = True + if line.startswith("//"): + doCopy = False + # f_keymap.write(str(layout.uc_dict)) + for k, v, isLast in gen_uc_iter(): + if isLast: + f_keymap.write(k + "\n") + else: + f_keymap.write(k + ",\n") + elif line.startswith("//"): + doCopy = False + for k, v, isLast in gen_uc_iter(): + if isLast: + f_keymap.write(u"\t[{0}] = {1} // {2}\n".format(k, v, chr(int(v, 0)))) + else: + f_keymap.write(u"\t[{0}] = {1}, // {2}\n".format(k, v, chr(int(v, 0)))) + elif line.startswith("//"): + doCopy = False + for layer, L in enumerate(layers): + r_counter = rows + f_keymap.write('\n'.join(quoteC(getKeymapText(layer, L, columns, rows)))) + + l_code = '\tLAYOUT_ortho_4x12(\n' + for r in range(r_counter): + r_counter -= 1 + c_counter = columns + l_code += '\t\t' + for c in range(c_counter): + c_counter -= 1 + if c != 0: + l_code += " " + l_code += "%s" % toKC(L[r*columns + columns-c_counter-1]) + if r_counter or c_counter: + l_code += "," + l_code += '\n' + if layer + 1 != len(layout.layers): + l_code += "\t),\n\n" + else: + l_code += "\t)\n" + f_keymap.write(l_code) + if doCopy: + f_keymap.write(line) + + +def getKeymapJSON(keyboard, keymap, layout, layers): + return json.dumps({ + 'keyboard': keyboard, + 'keymap': keymap, + 'layout': layout, + 'layers': layers + }, sort_keys=True, indent=4) + + +def getKeymapAsciidoc(title, layers, columns, rows): + yield '= ' + title + yield '' + for id, layer in enumerate(layers): + keymap = getKeymapText(id, layer, columns, rows) + if len(keymap): + yield '.' + keymap[0] + yield '--------------------------' + for line in keymap[1:]: + yield ' ' + line + yield '--------------------------' + yield '' + + +def layersToKC(layers): + return [list(map(toKC, layer)) for layer in layers] + + +def pathToKeymap(path): + head, keymap = os.path.split(path) + _, keymapsdir = os.path.split(head) + if keymapsdir == 'keymaps': + return keymap + + +def pathToKeyboard(path): + head, keymap = os.path.split(path) + head, keymapsdir = os.path.split(head) + if keymapsdir == 'keymaps': + head, dir = os.path.split(head) + while dir not in ('/', 'keyboards'): + yield dir + head, dir = os.path.split(head) + + +if __name__ == "__main__": + with open("km_template.txt", mode="r") as f_template: + with open("keymap.c", mode="w", encoding='utf-8') as f_keymap: + writeKeymap(f_template, f_keymap, layout.layers, columns=12, rows=4) + + abspath = os.path.dirname(os.path.abspath(__file__)) + keyboard = list(reversed(list(pathToKeyboard(abspath)))) + keymap = pathToKeymap(abspath) + keyboard_layout = 'LAYOUT_ortho_4x12' + with open("%s_%s.json" % ('_'.join(keyboard), keymap), mode="w") as f_keymapjson: + f_keymapjson.write( + getKeymapJSON( + '/'.join(keyboard), + keymap, + keyboard_layout, + layersToKC(layout.layers)) + ) + + with open("keymap.adoc", mode="w") as f_keymapasciidoc: + f_keymapasciidoc.write('\n'.join(getKeymapAsciidoc('Signum 3.0 %s_%s' % ('_'.join(keyboard), keymap), layout.layers, columns=12, rows=4))) + print("Run the following command to generate a PDF from the keymap") + print("a2x -f pdf --xsltproc-opts '--stringparam page.orientation landscape --stringparam body.font.master 12' --fop -v keymap.adoc") diff --git a/keyboards/signum/3_0/elitec/keymaps/default/keymap.c b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c new file mode 100644 index 00000000000..02690779173 --- /dev/null +++ b/keyboards/signum/3_0/elitec/keymaps/default/keymap.c @@ -0,0 +1,761 @@ +/* keymap.c is auto-generated, don't edit it directly. + * Further instructions are provided in readme.md */ + +#include QMK_KEYBOARD_H + +enum unicode_name { +AB_ARC, +AB_LINE, +AB_VEC, +ACUTE, +AE, +ALEPH, +ALLA_BR, +ALPHA, +AND, +AND_, +ANGLE, +AST_MID, +A_SET, +BARLINE, +BARLINE_D, +BARLINE_FIN, +BETA, +BETH, +BICOND, +BIG_O, +BISHOP_B, +BISHOP_W, +BITCOIN, +BOTTOM, +BOWTIE, +BRA, +BULLET, +B_SET, +CENT, +CHI, +CIRCLE, +CIRC_MID, +CLUBS_B, +CLUBS_W, +CODA, +COMMON_T, +COPYR, +CORRESP, +CROSS, +CURRENCY, +C_CLEF, +C_SET, +DACAPO, +DALSEGNO, +DEFINE, +DEGREE, +DELTA, +DIAMS_B, +DIAMS_W, +DIGAMMA, +DIVISION, +DOTS, +DOT_OP, +DQT1, +DQT2, +DQT3, +DQT4, +DQT5, +EIGHTH_N, +EIGHTH_P, +EJECT, +EMBED, +EMDASH, +EMPTYSET, +EPSILON, +EQUIV, +ETA, +EURO, +EXISTS, +FEMALE, +FLAG_B, +FLAG_W, +FLAT, +FORALL, +FORWARD, +FOURIER, +FULL_OUTER, +F_CLEF, +F_SET, +GAMMA, +GREAT_GREAT, +GR_EQ, +G_CLEF, +HALF_N, +HALF_P, +HAMILTON, +HEARTS_B, +HEARTS_W, +HETA, +H_SET, +IMAG_P, +IMPL, +IMPL_REV, +IN, +INDICATOR, +INEQUAL, +INFO, +INFTY, +INTEGRAL, +INTERS, +INTERS_, +INV_EXCL, +INV_QST, +IOTA, +ISOMORPH, +KAPPA, +KET, +KEY, +KING_B, +KING_W, +KNIGHT_B, +KNIGHT_W, +KOPPA, +K_SET, +LAMBDA, +LAPLACE, +LEFT_CEIL, +LEFT_FLOOR, +LEFT_OUTER, +LENGTH, +LESS_LESS, +LETTER, +LOCK, +LOCK_OPEN, +LS_EQ, +LTIMES, +MALE, +MAPSTO, +MDOT, +MICRO, +MINUS_OP, +MINUS_PLUS, +MINUTE, +MODELS, +MY, +M_ANGLE, +NABLA, +NATURAL, +NO, +NOT, +NOTIN, +NOTSUBS, +NOT_DIV, +NOT_PARA, +NY, +N_SET, +N_TILDE, +OE, +OHM, +OMEGA, +OMIKRON, +OR, +OR_, +PARALLEL, +PARTIAL, +PAWN_B, +PAWN_W, +PEDAL, +PEDAL_UP, +PERMIL, +PHI, +PHONE, +PI, +PLAY, +PLUS_MINUS, +PLUS_OP, +POUND, +POWERSET, +PRED, +PROD_, +PROP_TO, +PR_SUBSET, +PSI, +QED, +QUART_N, +QUART_P, +QUEEN_B, +QUEEN_W, +Q_SET, +REAL_P, +REGTM, +REPEAT_E, +REPEAT_S, +REWIND, +RHO, +RIGHT_CEIL, +RIGHT_FLOOR, +RIGHT_OUTER, +RIGHT_TACK, +ROOK_B, +ROOK_W, +ROOT, +ROUGHLY, +RTIMES, +R_SET, +SAMPI, +SAN, +SCHO, +SECOND, +SECTION, +SEGNO, +SETMINUS, +SHARP, +SHOGI_B, +SHOGI_BD, +SHOGI_W, +SHOGI_WD, +SIGMA, +SIXT_N, +SIXT_P, +SNEK, +SPADES_B, +SPADES_W, +SPEAKER_DN, +SPEAKER_TG, +SPEAKER_UP, +SQT1, +SQT2, +SQT3, +SQT4, +SQT5, +SQUARE, +SQ_LS, +SQ_LS_EQ, +STAFF, +STIGMA, +STOP, +SUBSET, +SUBSET_REV, +SUCC, +SUM_, +SUP1, +SUP2, +SUP3, +SUP_A, +SUP_MIN, +SUP_O, +SZ, +TAU, +THETA, +TIMES, +TIMES_OP, +TMARK, +TO, +TOP, +TRIANGLE, +UE, +UNION, +UNION_, +U_SET, +WHOLE_N, +WHOLE_P, +XI, +YEN, +YES, +YPSI2, +YPSILON, +ZETA, +Z_SET, +ae, +alpha, +beta, +beta2, +chi, +delta, +digamma, +e_FUN, +epsi2, +epsilon, +eta, +gamma, +heta, +i_UNIT, +iota, +kappa, +kappa2, +koppa, +lambda, +my, +n_tilde, +ny, +oe, +omega, +omikron, +phi, +phi2, +pi, +pi2, +psi, +rho, +rho2, +sampi, +san, +scho, +sigma, +sigma2, +sigma3, +stigma, +sz, +tau, +theta, +theta2, +ue, +xi, +ypsilon, +zeta +}; + +const uint32_t PROGMEM unicode_map[] = { + [AB_ARC] = 0x0361, // ͡ + [AB_LINE] = 0x0305, // ̅ + [AB_VEC] = 0x20d7, // ⃗ + [ACUTE] = 0x00b4, // ´ + [AE] = 0x00c4, // Ä + [ALEPH] = 0x2135, // ℵ + [ALLA_BR] = 0x1d135, // 𝄵 + [ALPHA] = 0x0391, // Α + [AND] = 0x2227, // ∧ + [AND_] = 0x22c0, // ⋀ + [ANGLE] = 0x2220, // ∠ + [AST_MID] = 0x2217, // ∗ + [A_SET] = 0x1d538, // 𝔸 + [BARLINE] = 0x1d100, // 𝄀 + [BARLINE_D] = 0x1d101, // 𝄁 + [BARLINE_FIN] = 0x1d102, // 𝄂 + [BETA] = 0x0392, // Β + [BETH] = 0x2136, // ℶ + [BICOND] = 0x21d4, // ⇔ + [BIG_O] = 0x1d4aa, // 𝒪 + [BISHOP_B] = 0x265d, // ♝ + [BISHOP_W] = 0x2657, // ♗ + [BITCOIN] = 0x20bf, // ₿ + [BOTTOM] = 0x22a5, // ⊥ + [BOWTIE] = 0x22c8, // ⋈ + [BRA] = 0x27e8, // ⟨ + [BULLET] = 0x2022, // • + [B_SET] = 0x1d539, // 𝔹 + [CENT] = 0x00a2, // ¢ + [CHI] = 0x03a7, // Χ + [CIRCLE] = 0x25cb, // ○ + [CIRC_MID] = 0x2218, // ∘ + [CLUBS_B] = 0x2663, // ♣ + [CLUBS_W] = 0x2667, // ♧ + [CODA] = 0x1d10c, // 𝄌 + [COMMON_T] = 0x1d134, // 𝄴 + [COPYR] = 0x00a9, // © + [CORRESP] = 0x2259, // ≙ + [CROSS] = 0x2020, // † + [CURRENCY] = 0x00a4, // ¤ + [C_CLEF] = 0x1d121, // 𝄡 + [C_SET] = 0x2102, // ℂ + [DACAPO] = 0x1d10a, // 𝄊 + [DALSEGNO] = 0x1d109, // 𝄉 + [DEFINE] = 0x2254, // ≔ + [DEGREE] = 0x00b0, // ° + [DELTA] = 0x0394, // Δ + [DIAMS_B] = 0x2666, // ♦ + [DIAMS_W] = 0x2662, // ♢ + [DIGAMMA] = 0x03dc, // Ϝ + [DIVISION] = 0x00f7, // ÷ + [DOTS] = 0x2026, // … + [DOT_OP] = 0x2299, // ⊙ + [DQT1] = 0x00bb, // » + [DQT2] = 0x201e, // „ + [DQT3] = 0x201c, // “ + [DQT4] = 0x201d, // ” + [DQT5] = 0x00ab, // « + [EIGHTH_N] = 0x1d160, // 𝅘𝅥𝅮 + [EIGHTH_P] = 0x1d13e, // 𝄾 + [EJECT] = 0x23cf, // ⏏ + [EMBED] = 0x21aa, // ↪ + [EMDASH] = 0x2014, // — + [EMPTYSET] = 0x2205, // ∅ + [EPSILON] = 0x0395, // Ε + [EQUIV] = 0x2261, // ≡ + [ETA] = 0x0397, // Η + [EURO] = 0x20ac, // € + [EXISTS] = 0x2203, // ∃ + [FEMALE] = 0x2640, // ♀ + [FLAG_B] = 0x2691, // ⚑ + [FLAG_W] = 0x2690, // ⚐ + [FLAT] = 0x266d, // ♭ + [FORALL] = 0x2200, // ∀ + [FORWARD] = 0x23ed, // ⏭ + [FOURIER] = 0x2131, // ℱ + [FULL_OUTER] = 0x27d7, // ⟗ + [F_CLEF] = 0x1d122, // 𝄢 + [F_SET] = 0x1d53d, // 𝔽 + [GAMMA] = 0x0393, // Γ + [GREAT_GREAT] = 0x226b, // ≫ + [GR_EQ] = 0x2265, // ≥ + [G_CLEF] = 0x1d11e, // 𝄞 + [HALF_N] = 0x1d15e, // 𝅗𝅥 + [HALF_P] = 0x1d13c, // 𝄼 + [HAMILTON] = 0x210b, // ℋ + [HEARTS_B] = 0x2665, // ♥ + [HEARTS_W] = 0x2661, // ♡ + [HETA] = 0x0370, // Ͱ + [H_SET] = 0x210d, // ℍ + [IMAG_P] = 0x2111, // ℑ + [IMPL] = 0x21d2, // ⇒ + [IMPL_REV] = 0x21d0, // ⇐ + [IN] = 0x2208, // ∈ + [INDICATOR] = 0x1d7cf, // 𝟏 + [INEQUAL] = 0x2260, // ≠ + [INFO] = 0x1f6c8, // 🛈 + [INFTY] = 0x221e, // ∞ + [INTEGRAL] = 0x222b, // ∫ + [INTERS] = 0x2229, // ∩ + [INTERS_] = 0x22c2, // ⋂ + [INV_EXCL] = 0x00a1, // ¡ + [INV_QST] = 0x00bf, // ¿ + [IOTA] = 0x0399, // Ι + [ISOMORPH] = 0x2245, // ≅ + [KAPPA] = 0x039a, // Κ + [KET] = 0x27e9, // ⟩ + [KEY] = 0x1f511, // 🔑 + [KING_B] = 0x265a, // ♚ + [KING_W] = 0x2654, // ♔ + [KNIGHT_B] = 0x265e, // ♞ + [KNIGHT_W] = 0x2658, // ♘ + [KOPPA] = 0x03d8, // Ϙ + [K_SET] = 0x1d542, // 𝕂 + [LAMBDA] = 0x039b, // Λ + [LAPLACE] = 0x2112, // ℒ + [LEFT_CEIL] = 0x2308, // ⌈ + [LEFT_FLOOR] = 0x230a, // ⌊ + [LEFT_OUTER] = 0x27d5, // ⟕ + [LENGTH] = 0x2113, // ℓ + [LESS_LESS] = 0x226a, // ≪ + [LETTER] = 0x2709, // ✉ + [LOCK] = 0x1f512, // 🔒 + [LOCK_OPEN] = 0x1f513, // 🔓 + [LS_EQ] = 0x2264, // ≤ + [LTIMES] = 0x22c9, // ⋉ + [MALE] = 0x2642, // ♂ + [MAPSTO] = 0x27fc, // ⟼ + [MDOT] = 0x22c5, // ⋅ + [MICRO] = 0x00b5, // µ + [MINUS_OP] = 0x2296, // ⊖ + [MINUS_PLUS] = 0x2213, // ∓ + [MINUTE] = 0x02b9, // ʹ + [MODELS] = 0x22a7, // ⊧ + [MY] = 0x039c, // Μ + [M_ANGLE] = 0x2221, // ∡ + [NABLA] = 0x2207, // ∇ + [NATURAL] = 0x266e, // ♮ + [NO] = 0x2717, // ✗ + [NOT] = 0x00ac, // ¬ + [NOTIN] = 0x2209, // ∉ + [NOTSUBS] = 0x2288, // ⊈ + [NOT_DIV] = 0x2224, // ∤ + [NOT_PARA] = 0x2226, // ∦ + [NY] = 0x039d, // Ν + [N_SET] = 0x2115, // ℕ + [N_TILDE] = 0x00d1, // Ñ + [OE] = 0x00d6, // Ö + [OHM] = 0x2126, // Ω + [OMEGA] = 0x03a9, // Ω + [OMIKRON] = 0x039f, // Ο + [OR] = 0x2228, // ∨ + [OR_] = 0x22c1, // ⋁ + [PARALLEL] = 0x2225, // ∥ + [PARTIAL] = 0x2202, // ∂ + [PAWN_B] = 0x265f, // ♟ + [PAWN_W] = 0x2659, // ♙ + [PEDAL] = 0x1d1ae, // 𝆮 + [PEDAL_UP] = 0x1d1af, // 𝆯 + [PERMIL] = 0x2030, // ‰ + [PHI] = 0x03a6, // Φ + [PHONE] = 0x2706, // ✆ + [PI] = 0x03a0, // Π + [PLAY] = 0x23ef, // ⏯ + [PLUS_MINUS] = 0x00b1, // ± + [PLUS_OP] = 0x2295, // ⊕ + [POUND] = 0x00a3, // £ + [POWERSET] = 0x1d4ab, // 𝒫 + [PRED] = 0x227a, // ≺ + [PROD_] = 0x220f, // ∏ + [PROP_TO] = 0x221d, // ∝ + [PR_SUBSET] = 0x2282, // ⊂ + [PSI] = 0x03a8, // Ψ + [QED] = 0x220e, // ∎ + [QUART_N] = 0x1d15f, // 𝅘𝅥 + [QUART_P] = 0x1d13d, // 𝄽 + [QUEEN_B] = 0x265b, // ♛ + [QUEEN_W] = 0x2655, // ♕ + [Q_SET] = 0x211a, // ℚ + [REAL_P] = 0x211c, // ℜ + [REGTM] = 0x00ae, // ® + [REPEAT_E] = 0x1d107, // 𝄇 + [REPEAT_S] = 0x1d106, // 𝄆 + [REWIND] = 0x23ee, // ⏮ + [RHO] = 0x03a1, // Ρ + [RIGHT_CEIL] = 0x2309, // ⌉ + [RIGHT_FLOOR] = 0x230b, // ⌋ + [RIGHT_OUTER] = 0x27d6, // ⟖ + [RIGHT_TACK] = 0x22a2, // ⊢ + [ROOK_B] = 0x265c, // ♜ + [ROOK_W] = 0x2656, // ♖ + [ROOT] = 0x221a, // √ + [ROUGHLY] = 0x2248, // ≈ + [RTIMES] = 0x22ca, // ⋊ + [R_SET] = 0x211d, // ℝ + [SAMPI] = 0x0372, // Ͳ + [SAN] = 0x03fa, // Ϻ + [SCHO] = 0x03f7, // Ϸ + [SECOND] = 0x02ba, // ʺ + [SECTION] = 0x00a7, // § + [SEGNO] = 0x1d10b, // 𝄋 + [SETMINUS] = 0x2216, // ∖ + [SHARP] = 0x266f, // ♯ + [SHOGI_B] = 0x2617, // ☗ + [SHOGI_BD] = 0x26ca, // ⛊ + [SHOGI_W] = 0x2616, // ☖ + [SHOGI_WD] = 0x26c9, // ⛉ + [SIGMA] = 0x03a3, // Σ + [SIXT_N] = 0x1d161, // 𝅘𝅥𝅯 + [SIXT_P] = 0x1d13f, // 𝄿 + [SNEK] = 0x1f40d, // 🐍 + [SPADES_B] = 0x2660, // ♠ + [SPADES_W] = 0x2664, // ♤ + [SPEAKER_DN] = 0x1f509, // 🔉 + [SPEAKER_TG] = 0x1f507, // 🔇 + [SPEAKER_UP] = 0x1f50a, // 🔊 + [SQT1] = 0x203a, // › + [SQT2] = 0x201a, // ‚ + [SQT3] = 0x2018, // ‘ + [SQT4] = 0x2019, // ’ + [SQT5] = 0x2039, // ‹ + [SQUARE] = 0x25a1, // □ + [SQ_LS] = 0x228f, // ⊏ + [SQ_LS_EQ] = 0x2291, // ⊑ + [STAFF] = 0x1d11a, // 𝄚 + [STIGMA] = 0x03da, // Ϛ + [STOP] = 0x25fc, // ◼ + [SUBSET] = 0x2286, // ⊆ + [SUBSET_REV] = 0x2287, // ⊇ + [SUCC] = 0x227b, // ≻ + [SUM_] = 0x2211, // ∑ + [SUP1] = 0x00b9, // ¹ + [SUP2] = 0x00b2, // ² + [SUP3] = 0x00b3, // ³ + [SUP_A] = 0x00aa, // ª + [SUP_MIN] = 0x207b, // ⁻ + [SUP_O] = 0x00ba, // º + [SZ] = 0x1e9e, // ẞ + [TAU] = 0x03a4, // Τ + [THETA] = 0x0398, // Θ + [TIMES] = 0x00d7, // × + [TIMES_OP] = 0x2297, // ⊗ + [TMARK] = 0x2122, // ™ + [TO] = 0x27f6, // ⟶ + [TOP] = 0x22a4, // ⊤ + [TRIANGLE] = 0x25b3, // △ + [UE] = 0x00dc, // Ü + [UNION] = 0x222a, // ∪ + [UNION_] = 0x22c3, // ⋃ + [U_SET] = 0x1d54c, // 𝕌 + [WHOLE_N] = 0x1d15d, // 𝅝 + [WHOLE_P] = 0x1d13b, // 𝄻 + [XI] = 0x039e, // Ξ + [YEN] = 0x00a5, // ¥ + [YES] = 0x2713, // ✓ + [YPSI2] = 0x03d2, // ϒ + [YPSILON] = 0x03a5, // Υ + [ZETA] = 0x0396, // Ζ + [Z_SET] = 0x2124, // ℤ + [ae] = 0x00e4, // ä + [alpha] = 0x03b1, // α + [beta] = 0x03b2, // β + [beta2] = 0x03d0, // ϐ + [chi] = 0x03c7, // χ + [delta] = 0x03b4, // δ + [digamma] = 0x03dd, // ϝ + [e_FUN] = 0x0065, // e + [epsi2] = 0x03f5, // ϵ + [epsilon] = 0x03b5, // ε + [eta] = 0x03b7, // η + [gamma] = 0x03b3, // γ + [heta] = 0x0371, // ͱ + [i_UNIT] = 0x0069, // i + [iota] = 0x03b9, // ι + [kappa] = 0x03ba, // κ + [kappa2] = 0x03f0, // ϰ + [koppa] = 0x03d9, // ϙ + [lambda] = 0x03bb, // λ + [my] = 0x03bc, // μ + [n_tilde] = 0x00f1, // ñ + [ny] = 0x03bd, // ν + [oe] = 0x00f6, // ö + [omega] = 0x03c9, // ω + [omikron] = 0x03bf, // ο + [phi] = 0x03c6, // φ + [phi2] = 0x03d5, // ϕ + [pi] = 0x03c0, // π + [pi2] = 0x03d6, // ϖ + [psi] = 0x03c8, // ψ + [rho] = 0x03c1, // ρ + [rho2] = 0x03f1, // ϱ + [sampi] = 0x0373, // ͳ + [san] = 0x03fb, // ϻ + [scho] = 0x03f8, // ϸ + [sigma] = 0x03c3, // σ + [sigma2] = 0x03c2, // ς + [sigma3] = 0x03f2, // ϲ + [stigma] = 0x03db, // ϛ + [sz] = 0x00df, // ß + [tau] = 0x03c4, // τ + [theta] = 0x03b8, // θ + [theta2] = 0x03d1, // ϑ + [ue] = 0x00fc, // ü + [xi] = 0x03be, // ξ + [ypsilon] = 0x03c5, // υ + [zeta] = 0x03b6 // ζ +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* + * Layer 0 + * ------------------------------------------------- ------------------------------------------------- + * | Tab | q | w | e | r | t | | y | u | i | o | p | [ | + * ------------------------------------------------- ------------------------------------------------- + * |LCtTEsc| a | s | d | f | g | | h | j | k | l | ; | ' | + * ------------------------------------------------- ------------------------------------------------- + * |LShift(| z | x | c | v | b | | n | m | , | . | / |RShift)| + * ----------------------------------------------------------------------------------------------------------------- + * LCtrl LAlt LGui | TT2 |LT6_SPC|LT4_DEL|LT4_ENT| Space |LT2_BSP| RGui RAlt RCtrl + * ------------------------------------------------- + */ + LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_LCTL, KC_LALT, KC_LGUI, TT(2), LT(6,KC_SPC), LT(4,KC_DEL), LT(4,KC_ENT), KC_SPC, LT(2,KC_BSPC), KC_RGUI, KC_RALT, KC_RCTL + ), + +/* + * Layer 1 + * ------------------------------------------------- ------------------------------------------------- + * | Tab | q | w | f | p | g | | j | l | u | y | ; | [ | + * ------------------------------------------------- ------------------------------------------------- + * |LCtTEsc| a | r | s | t | d | | h | n | e | i | o | ' | + * ------------------------------------------------- ------------------------------------------------- + * |LShift(| z | x | c | v | b | | k | m | , | . | / |RShift)| + * ----------------------------------------------------------------------------------------------------------------- + * LCtrl LAlt LGui | TT2 |LT6_SPC|LT4_DEL|LT4_ENT| Space |LT2_BSP| RGui RAlt RCtrl + * ------------------------------------------------- + */ + LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, + LCTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_LCTL, KC_LALT, KC_LGUI, TT(2), LT(6,KC_SPC), LT(4,KC_DEL), LT(4,KC_ENT), KC_SPC, LT(2,KC_BSPC), KC_RGUI, KC_RALT, KC_RCTL + ), + +/* + * Layer 2 + * ------------------------------------------------- ------------------------------------------------- + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ] | + * ------------------------------------------------- ------------------------------------------------- + * | | DF0 | DF1 | XXX | MO3 | MO3 | | 4 | 4 | 5 | 6 | - | = | + * ------------------------------------------------- ------------------------------------------------- + * | | MO5 | XXX | XXX | XXX | XXX | | 1 | 1 | 2 | 3 | \ | | + * ----------------------------------------------------------------------------------------------------------------- + * TG2 | | | Del | | 0 |BSpace | + * ------------------------------------------------- + */ + LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC, + KC_TRNS, DF(0), DF(1), KC_NO, MO(3), MO(3), KC_4, KC_4, KC_5, KC_6, KC_MINS, KC_EQL, + KC_TRNS, MO(5), KC_NO, KC_NO, KC_NO, KC_NO, KC_1, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + TG(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_0, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS + ), + +/* + * Layer 3 + * ------------------------------------------------- ------------------------------------------------- + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | XXX | + * ------------------------------------------------- ------------------------------------------------- + * | | XXX | XXX | XXX | MO3 | MO3 | | F4 | F4 | F5 | F6 | F11 | XXX | + * ------------------------------------------------- ------------------------------------------------- + * | | XXX | XXX | XXX | XXX | XXX | | F1 | F1 | F2 | F3 | F12 | | + * ----------------------------------------------------------------------------------------------------------------- + * TG3 | | | | | | | + * ------------------------------------------------- + */ + LAYOUT_ortho_4x12( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, MO(3), MO(3), KC_F4, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F1, KC_F2, KC_F3, KC_F12, KC_TRNS, + TG(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +/* + * Layer 4 + * ------------------------------------------------- ------------------------------------------------- + * | Esc | Esc | Tab x | Tab n |CPg Dn |CPg Dn | |Pg Down| Home |^ Arrow|Insert |SInsert| Esc | + * ------------------------------------------------- ------------------------------------------------- + * | | Caps | < Gui |Gui Tab| > Gui | > Gui | |< Arrow|< Arrow|v Arrow|> Arrow| End |Pr Scr | + * ------------------------------------------------- ------------------------------------------------- + * | | XXX | XXX | XXX |CPg Up |CPg Up | | Pg Up | |v Arrow| XXX | App | | + * ----------------------------------------------------------------------------------------------------------------- + * TG4 | | | Del | |BSpace | | + * ------------------------------------------------- + */ + LAYOUT_ortho_4x12( + KC_ESC, KC_ESC, LCTL(KC_W), LCTL(KC_T), LCTL(KC_PGDN), LCTL(KC_PGDN), KC_PGDN, KC_HOME, KC_UP, KC_INS, LSFT(KC_INS), KC_ESC, + KC_TRNS, KC_CAPS, LGUI(KC_LEFT), LGUI(KC_TAB), LGUI(KC_RGHT), LGUI(KC_RGHT), KC_LEFT, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_PSCR, + KC_TRNS, KC_NO, KC_NO, KC_NO, LCTL(KC_PGUP), LCTL(KC_PGUP), KC_PGUP, KC_TRNS, KC_DOWN, KC_NO, KC_APP, KC_TRNS, + TG(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +/* + * Layer 5 + * ------------------------------------------------- ------------------------------------------------- + * | | XXX |play/ps| Vol + | Vol + | XXX | | XXX | XXX | XXX | XXX |_reset | Power | + * ------------------------------------------------- ------------------------------------------------- + * | | XXX | |<< | Vol 0 | >>| | XXX | | XXX | XXX | XXX | XXX | XXX | Sleep | + * ------------------------------------------------- ------------------------------------------------- + * | | MO5 | XXX | Vol - | Vol - | XXX | | XXX | XXX | XXX | XXX | XXX | XXX | + * ----------------------------------------------------------------------------------------------------------------- + * TG5 | | | | | | | + * ------------------------------------------------- + */ + LAYOUT_ortho_4x12( + KC_TRNS, KC_NO, KC_MPLY, KC_VOLU, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_PWR, + KC_TRNS, KC_NO, KC_MPRV, KC_MUTE, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLEP, + KC_TRNS, MO(5), KC_NO, KC_VOLD, KC_VOLD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + TG(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +/* + * Layer 6 + * ------------------------------------------------- ------------------------------------------------- + * | | acc1 | XXX | XXX | XXX | XXX | |^ Wheel|< Wheel|^ Mouse|> Wheel| XXX | XXX | + * ------------------------------------------------- ------------------------------------------------- + * | | acc2 |Mouse 2|Mouse 3|Mouse 1|Mouse 1| |< Mouse|< Mouse|v Mouse|> Mouse| XXX | XXX | + * ------------------------------------------------- ------------------------------------------------- + * | | acc0 | XXX | XXX | XXX | XXX | |v Wheel| XXX |v Mouse| XXX | XXX | | + * ----------------------------------------------------------------------------------------------------------------- + * TG6 | | | | | | | + * ------------------------------------------------- + */ + LAYOUT_ortho_4x12( + KC_TRNS, KC_ACL1, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, KC_NO, KC_NO, + KC_TRNS, KC_ACL2, KC_BTN2, KC_BTN3, KC_BTN1, KC_BTN1, KC_MS_L, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, + KC_TRNS, KC_ACL0, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_D, KC_NO, KC_MS_D, KC_NO, KC_NO, KC_TRNS, + TG(6), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +/* vi: ft=c:tw=80:sw=2:ts=2:sts=2:et + */ diff --git a/keyboards/signum/3_0/elitec/keymaps/default/km_template.txt b/keyboards/signum/3_0/elitec/keymaps/default/km_template.txt new file mode 100644 index 00000000000..47b35ee5149 --- /dev/null +++ b/keyboards/signum/3_0/elitec/keymaps/default/km_template.txt @@ -0,0 +1,20 @@ +/* keymap.c is auto-generated, don't edit it directly. + * Further instructions are provided in readme.md */ + +#include QMK_KEYBOARD_H + +enum unicode_name { +// +}; + +const uint32_t PROGMEM unicode_map[] = { +// +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// +}; + +/* vi: ft=c:tw=80:sw=2:ts=2:sts=2:et + */ diff --git a/keyboards/signum/3_0/elitec/keymaps/default/layout.py b/keyboards/signum/3_0/elitec/keymaps/default/layout.py new file mode 100644 index 00000000000..635a6bb1929 --- /dev/null +++ b/keyboards/signum/3_0/elitec/keymaps/default/layout.py @@ -0,0 +1,494 @@ +# -*- coding: utf-8 -*- + +# Add all used Unicode symbols to this list. +# The key (e.g. "SNEK") is used in keymap.c for "enum", "unicode_map" and "keymaps", so it needs to be a valid C variable name. +# The key is also used in this file to define the layout, so use recognizeable names. +# The value (e.g. "0x1f40d") is used in keymap.c for "unicode_map" and to automatically generate the "ASCII"-art comments. +# When adding new Unicode names, use "0x1f40d" until you looked up the correct Unicode code point. +uc_dict = { + "SNEK": "0x1f40d", ## Error + ## qwertz + "ACUTE": "0x00b4", + ## QWERTZ + "INV_EXCL": "0x00a1", + "INV_QST": "0x00bf", + ## numpad + "SUP1": "0x00b9", + "SUP2": "0x00b2", + "SUP3": "0x00b3", + "SUP_MIN": "0x207b", + "ROOT": "0x221a", + "DEGREE": "0x00b0", + "MINUTE": "0x02b9", + "SECOND": "0x02ba", + "CURRENCY": "0x00a4", + "CENT": "0x00a2", + "YEN": "0x00a5", + "POUND": "0x00a3", + "EURO": "0x20ac", + "DIVISION": "0x00f7", + "MICRO": "0x00b5", + "OHM": "0x2126", + "BITCOIN": "0x20bf", + "SECTION": "0x00a7", + ## NAV_TYPO + "SQT1": "0x203a", + "SQT2": "0x201a", + "SQT3": "0x2018", + "SQT4": "0x2019", + "SQT5": "0x2039", + "SUP_A": "0x00aa", + "SUP_O": "0x00ba", + "TMARK": "0x2122", + "COPYR": "0x00a9", + "REGTM": "0x00ae", + "DOTS": "0x2026", + "CROSS": "0x2020", + "BULLET": "0x2022", + "EMDASH": "0x2014", + "PERMIL": "0x2030", + "DQT1": "0x00bb", + "DQT2": "0x201e", + "DQT3": "0x201c", + "DQT4": "0x201d", + "DQT5": "0x00ab", + ## lang + "ae": "0x00e4", + "oe": "0x00f6", + "ue": "0x00fc", + "sz": "0x00df", + "n_tilde": "0x00f1", + ## LANG + "AE": "0x00c4", + "OE": "0x00d6", + "UE": "0x00dc", + "SZ": "0x1e9e", + "N_TILDE": "0x00d1", + ## greek + "alpha": "0x03b1", + "beta": "0x03b2", + "gamma": "0x03b3", + "delta": "0x03b4", + "epsilon": "0x03b5", + "zeta": "0x03b6", + "eta": "0x03b7", + "theta": "0x03b8", + "iota": "0x03b9", + "kappa": "0x03ba", + "lambda": "0x03bb", + "my": "0x03bc", + "ny": "0x03bd", + "xi": "0x03be", + "omikron": "0x03bf", + "pi": "0x03c0", + "rho": "0x03c1", + "sigma": "0x03c3", + "tau": "0x03c4", + "ypsilon": "0x03c5", + "phi": "0x03c6", + "chi": "0x03c7", + "psi": "0x03c8", + "omega": "0x03c9", + # variants + "beta2": "0x03d0", + "epsi2": "0x03f5", + "theta2": "0x03d1", + "kappa2": "0x03f0", + "pi2": "0x03d6", + "rho2": "0x03f1", + "sigma2": "0x03c2", + "sigma3": "0x03f2", + "phi2": "0x03d5", + # non-standard + "digamma": "0x03dd", + "stigma": "0x03db", + "heta": "0x0371", + "san": "0x03fb", + "koppa": "0x03d9", + "sampi": "0x0373", + "scho": "0x03f8", + ## GREEK + "ALPHA": "0x0391", + "BETA": "0x0392", + "GAMMA": "0x0393", + "DELTA": "0x0394", + "EPSILON": "0x0395", + "ZETA": "0x0396", + "ETA": "0x0397", + "THETA": "0x0398", + "IOTA": "0x0399", + "KAPPA": "0x039a", + "LAMBDA": "0x039b", + "MY": "0x039c", + "NY": "0x039d", + "XI": "0x039e", + "OMIKRON": "0x039f", + "PI": "0x03a0", + "RHO": "0x03a1", + "SIGMA": "0x03a3", + "TAU": "0x03a4", + "YPSILON": "0x03a5", + "PHI": "0x03a6", + "CHI": "0x03a7", + "PSI": "0x03a8", + "OMEGA": "0x03a9", + # variants + "YPSI2": "0x03d2", + # non-standard + "DIGAMMA": "0x03dc", + "STIGMA": "0x03da", + "HETA": "0x0370", + "SAN": "0x03fa", + "KOPPA": "0x03d8", + "SAMPI": "0x0372", + "SCHO": "0x03f7", + ## symbol + "SHOGI_WD": "0x26c9", + "FLAG_W": "0x2690", + "LETTER": "0x2709", + "PHONE": "0x2706", + "INFO": "0x1f6c8", + "REWIND": "0x23ee", + "PLAY": "0x23ef", + "FORWARD": "0x23ed", + "STOP": "0x25fc", + "EJECT": "0x23cf", + "SHOGI_W": "0x2616", + "FEMALE": "0x2640", + "MALE": "0x2642", + "NO": "0x2717", + "YES": "0x2713", + "FLAT": "0x266d", + "NATURAL": "0x266e", + "SHARP": "0x266f", + "COMMON_T": "0x1d134", + "ALLA_BR": "0x1d135", + "PAWN_W": "0x2659", + "DIAMS_W": "0x2662", + "HEARTS_W": "0x2661", + "SPADES_W": "0x2664", + "CLUBS_W": "0x2667", + "WHOLE_N": "0x1d15d", + "HALF_N": "0x1d15e", + "QUART_N": "0x1d15f", + "EIGHTH_N": "0x1d160", + "SIXT_N": "0x1d161", + "ROOK_W": "0x2656", + "KNIGHT_W": "0x2658", + "BISHOP_W": "0x2657", + "QUEEN_W": "0x2655", + "KING_W": "0x2654", + "C_CLEF": "0x1d121", + "G_CLEF": "0x1d11e", + "F_CLEF": "0x1d122", + "PEDAL": "0x1d1ae", + "PEDAL_UP": "0x1d1af", + ## SYMBOL + "SHOGI_BD": "0x26ca", + "FLAG_B": "0x2691", + "SPEAKER_UP": "0x1f50a", + "SPEAKER_TG": "0x1f507", + "SPEAKER_DN": "0x1f509", + "SHOGI_B": "0x2617", + "KEY": "0x1f511", + "LOCK": "0x1f512", + "LOCK_OPEN": "0x1f513", + "STAFF": "0x1d11a", + "BARLINE": "0x1d100", + "BARLINE_D": "0x1d101", + "BARLINE_FIN": "0x1d102", + "CODA": "0x1d10c", + "PAWN_B": "0x265f", + "DIAMS_B": "0x2666", + "HEARTS_B": "0x2665", + "SPADES_B": "0x2660", + "CLUBS_B": "0x2663", + "WHOLE_P": "0x1d13b", + "HALF_P": "0x1d13c", + "QUART_P": "0x1d13d", + "EIGHTH_P": "0x1d13e", + "SIXT_P": "0x1d13f", + "ROOK_B": "0x265c", + "KNIGHT_B": "0x265e", + "BISHOP_B": "0x265d", + "QUEEN_B": "0x265b", + "KING_B": "0x265a", + "REPEAT_S": "0x1d106", + "REPEAT_E": "0x1d107", + "SEGNO": "0x1d10b", + "DALSEGNO": "0x1d109", + "DACAPO": "0x1d10a", + ## math + "EXISTS": "0x2203", + "FORALL": "0x2200", + "EQUIV": "0x2261", + "CORRESP": "0x2259", + "INEQUAL": "0x2260", + "DEFINE": "0x2254", + "TO": "0x27f6", + "MAPSTO": "0x27fc", + "SETMINUS": "0x2216", + "QED": "0x220e", + "OR_": "0x22c1", + "AND_": "0x22c0", + "OR": "0x2228", + "AND": "0x2227", + "NOT": "0x00ac", + "BICOND": "0x21d4", + "IMPL_REV": "0x21d0", + "IMPL": "0x21d2", + "TOP": "0x22a4", + "BOTTOM": "0x22a5", + "SUM_": "0x2211", + "PROD_": "0x220f", + "MDOT": "0x22c5", + "NOTIN": "0x2209", + "IN": "0x2208", + "LS_EQ": "0x2264", + "GR_EQ": "0x2265", + "INFTY": "0x221e", + "UNION_": "0x22c3", + "INTERS_": "0x22c2", + "UNION": "0x222a", + "INTERS": "0x2229", + "NOTSUBS": "0x2288", + "PR_SUBSET": "0x2282", + "SUBSET": "0x2286", + "SUBSET_REV": "0x2287", + "EMPTYSET": "0x2205", + ## MATHSCRIPT + "LEFT_CEIL": "0x2308", + "REAL_P": "0x211c", + "NABLA": "0x2207", + "RIGHT_CEIL": "0x2309", + "LEFT_FLOOR": "0x230a", + "BRA": "0x27e8", + "IMAG_P": "0x2111", + "KET": "0x27e9", + "RIGHT_FLOOR": "0x230b", + "Q_SET": "0x211a", + "e_FUN": "0x0065", + "R_SET": "0x211d", + "Z_SET": "0x2124", + "U_SET": "0x1d54c", + "i_UNIT": "0x0069", + "BIG_O": "0x1d4aa", + "POWERSET": "0x1d4ab", + "A_SET": "0x1d538", + "INTEGRAL": "0x222b", + "PARTIAL": "0x2202", + "F_SET": "0x1d53d", + "H_SET": "0x210d", + "K_SET": "0x1d542", + "LENGTH": "0x2113", + "ALEPH": "0x2135", + "BETH": "0x2136", + "C_SET": "0x2102", + "B_SET": "0x1d539", + "N_SET": "0x2115", + "INDICATOR": "0x1d7cf", + "FOURIER": "0x2131", + "HAMILTON": "0x210b", + "LAPLACE": "0x2112", + ## MATHEXT + "RIGHT_TACK": "0x22a2", + "MODELS": "0x22a7", + "AB_VEC": "0x20d7", + "AB_LINE": "0x0305", + "AB_ARC": "0x0361", + "LESS_LESS": "0x226a", + "PRED": "0x227a", + "EMBED": "0x21aa", + "SUCC": "0x227b", + "GREAT_GREAT": "0x226b", + "TRIANGLE": "0x25b3", + "SQUARE": "0x25a1", + "CIRCLE": "0x25cb", + "DOT_OP": "0x2299", + "PLUS_OP": "0x2295", + "MINUS_OP": "0x2296", + "ROUGHLY": "0x2248", + "ISOMORPH": "0x2245", + "LTIMES": "0x22c9", + "RTIMES": "0x22ca", + "BOWTIE": "0x22c8", + "M_ANGLE": "0x2221", + "ANGLE": "0x2220", + "CIRC_MID": "0x2218", + "AST_MID": "0x2217", + "TIMES": "0x00d7", + "PLUS_MINUS": "0x00b1", + "MINUS_PLUS": "0x2213", + "LEFT_OUTER": "0x27d5", + "RIGHT_OUTER": "0x27d6", + "FULL_OUTER": "0x27d7", + "SQ_LS": "0x228f", + "SQ_LS_EQ": "0x2291", + "PROP_TO": "0x221d", + "PARALLEL": "0x2225", + "NOT_PARA": "0x2226", + "TIMES_OP": "0x2297", + "NOT_DIV": "0x2224" +} + +# Add all used Keycodes to this list. +# The key (e.g. "a") is used in keymap.c to automatically generate the comments. The first 7 chars will show as a keycap legend. +qmk_dict = { + # test cases (These are handled in generate_km.py within toKC() and toLgd(), so these definitions will be ignored. + # If you find "BAD" in your keymaps, then something went wrong.) + "a": "BAD", "A": "BAD", "0": "BAD", + # Basic Keycodes + "XXX": "KC_NO", "": "KC_TRNS", + "!": "S(KC_1)", "@": "S(KC_2)", "#": "S(KC_3)", "$": "S(KC_4)", "%": "S(KC_5)", + "^": "S(KC_6)", "&": "S(KC_7)", "*": "S(KC_8)", "(": "S(KC_9)", ")": "S(KC_0)", + "Enter": "KC_ENT", "Esc": "KC_ESC", "BSpace": "KC_BSPC", "Tab": "KC_TAB", + "Space": "KC_SPC", "-": "KC_MINS", "_": "S(KC_MINS)", "=": "KC_EQL", + "+": "S(KC_EQL)", "[": "KC_LBRC", "{": "S(KC_LBRC)", "]": "KC_RBRC", + "}": "S(KC_RBRC)", "\\": "KC_BSLS", "|": "S(KC_BSLS)", ";": "KC_SCLN", + ":": "S(KC_SCLN)", "'": "KC_QUOT", "\"": "S(KC_QUOT)", "`": "KC_GRV", + "~": "S(KC_GRV)", ",": "KC_COMM", "<": "S(KC_COMM)", ".": "KC_DOT", + ">": "S(KC_DOT)", "/": "KC_SLSH", "?": "S(KC_SLSH)", "Caps": "KC_CAPS", + "Pr Scr": "KC_PSCR", "Scr Lck": "KC_SLCK", "Pause": "KC_BRK", "Insert": "KC_INS", "SInsert": "LSFT(KC_INS)", + "Home": "KC_HOME", "Pg Up": "KC_PGUP", "Del": "KC_DEL", "End": "KC_END", + "Pg Down": "KC_PGDN", "> Arrow": "KC_RGHT", "< Arrow": "KC_LEFT", + "v Arrow": "KC_DOWN", "^ Arrow": "KC_UP", + # Keypad keycodes missing + "App": "KC_APP", "Menu": "KC_MENU", + # Command keycodes missing (Execute, Help, ..., Find) + # Basic Keycodes missing from Print Screen onwards, included as fallback + # random Keycodes + "RGui": "KC_RGUI", "LGui": "KC_LGUI", "LAlt": "KC_LALT", "RAlt": "KC_RALT", "LShift": "KC_LSFT", "LCtrl": "KC_LCTL", "LCtTEsc": "LCTL_T(KC_ESC)", "RCtrl": "KC_RCTL", + "LShift(": "KC_LSPO", "RShift)": "KC_RSPC", + # "LShift(": "LSFT_T(KC_9)", "RShift)": "RSFT_T(RSFT(KC_0))", + "L1_ENT": "LT(1, KC_ENT)", "LT2_BSP": "LT(2,KC_BSPC)", "LT4_DEL": "LT(4,KC_DEL)", "LT4_ENT": "LT(4,KC_ENT)", "LT6_SPC": "LT(6,KC_SPC)", + "CPg Dn": "LCTL(KC_PGDN)", "CPg Up": "LCTL(KC_PGUP)", + "S_Enter": "S(KC_ENT)", "S_Tab": "S(KC_TAB)", "Compose": "KC_ALGR", + "RShift": "KC_RSFT", + "Vol 0": "KC_MUTE", "Vol +": "KC_VOLU", "Vol -": "KC_VOLD", + ">>|": "KC_MNXT", "|<<": "KC_MPRV", "play/ps": "KC_MPLY", + "Bri +": "KC_BRIU", "Bri -": "KC_BRID", + # Quantum Keycodes + "_reset": "RESET", "_debug": "DEBUG", "_eep_re": "EEP_RST", + # Audio Keys missing + # Backlighting + "Led 0": "BL_TOGG", "Led +": "BL_INC", "Led -": "BL_DEC", "Led ~": "BL_BRTG", + # Bootmagic missing + # Bluetooth + "OUT_AUTO": "OUT_AUTO", "OUT_USB": "OUT_USB", "OUT_BT": "OUT_BT", + # Layer Switching missing, Lx -> MO(x), Tx -> TG(x) + "qwertz": "DF(0)", "neo": "DF(2)", + # Mouse Keys + "^ Mouse": "KC_MS_U", "v Mouse": "KC_MS_D", "< Mouse": "KC_MS_L", + "> Mouse": "KC_MS_R", "Mouse 1": "KC_BTN1", "Mouse 2": "KC_BTN2", + "Mouse 3": "KC_BTN3", "Mouse 4": "KC_BTN4", "Mouse 5": "KC_BTN5", + "^ Wheel": "KC_WH_U", "v Wheel": "KC_WH_D", "< Wheel": "KC_WH_L", + "> Wheel": "KC_WH_R", "acc0": "KC_ACL0", "acc1": "KC_ACL1", + "acc2": "KC_ACL2", + # Modifiers missinng, add entry for each specific application + # Mod-Tap Keys missing, add entry for each specific application + "_Sh_swp": "LSFT_T(SH_TG)", + # RGB Lighting missing + # RGB Matrix Lighting missing + # Thermal Printer missing + # US ANSI Shifted Symbols done via S(), don't add KC_entries + # One Shot Keys missing + # Swap Hands + "_sp_swp": "SHT(KC_SPC)", + # Unicode support (via X()) included implicitly + # Switching Unicode Input Modes + "UC_win": "UC_M_WC", "UC_lnx": "UC_M_LN", "UC_osx": "UC_M_OS", + + # custom keys + "altF4": "LALT(KC_F4)", + "Undo": "LCTL(KC_Z)", "Cut": "LCTL(KC_X)", "Copy": "LCTL(KC_C)", "Paste": "LCTL(KC_V)", + "< Tab": "LCTL(S(KC_TAB))", "> Tab": "LCTL(KC_TAB)", + "Tab x": "LCTL(KC_W)", "Tab n": "LCTL(KC_T)", + "Gui Tab": "LGUI(KC_TAB)", "< Gui": "LGUI(KC_LEFT)", "> Gui": "LGUI(KC_RGHT)", + "C+A+Del": "LCTL(LALT(KC_DEL))", "Mic 0": "LCTL(KC_M)", + "Power": "KC_PWR", "Sleep": "KC_SLEP", + + # macros + "Macro 1": "KC_1", "Macro 2": "KC_2", "Macro 3": "KC_3", "Macro 4": "KC_4", "Macro 5": "KC_5", + + # custom layers + "GREEK": "GREEK", + "SYMBOL": "SYMBOL", + "MATH": "MATH", + "GAME": "GAME", + "MOUSE": "MOUSE", + "NEO": "TG(2)" +} + +# These keys are repeated in all layers. +# Generate a keymap.c with the python script and refer to the "ASCII"-art comments, to see which positions this concerns. +# If you want to put different keycodes in these positions for different layers, you need to modify the python script by yourself. +static = ["NEO", "GREEK", "GREEK", "GREEK", "GREEK", "MOUSE"] + +# mutex_layers = {"GREEK": 8, "GAME": 10, "MOUSE": 11} +# layer_graph = ... + +# 0 +qwerty = [ + "Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", + "LCtTEsc", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", + "LShift(", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "RShift)", + "LCtrl", "LAlt", "LGui", "TT2", "LT6_SPC", "LT4_DEL", "LT4_ENT", "Space", "LT2_BSP", "RGui", "RAlt", "RCtrl", + ] + +# 1 +colemak = [ + "Tab", "q", "w", "f", "p", "g", "j", "l", "u", "y", ";", "[", + "LCtTEsc", "a", "r", "s", "t", "d", "h", "n", "e", "i", "o", "'", + "LShift(", "z", "x", "c", "v", "b", "k", "m", ",", ".", "/", "RShift)", + "LCtrl", "LAlt", "LGui", "TT2", "LT6_SPC", "LT4_DEL", "LT4_ENT", "Space", "LT2_BSP", "RGui", "RAlt", "RCtrl", + ] + +# 2 +numpad = [ + "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "]", + "", "DF0", "DF1", "XXX", "MO3", "MO3", "4", "4", "5", "6", "-", "=", + "", "MO5", "XXX", "XXX", "XXX", "XXX", "1", "1", "2", "3", "\\", "", + "TG2", "", "", "", "", "Del", "", "0", "BSpace", "", "", "", + ] + +# 3 +fpad = [ + "", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "XXX", + "", "XXX", "XXX", "XXX", "MO3", "MO3", "F4", "F4", "F5", "F6", "F11", "XXX", + "", "XXX", "XXX", "XXX", "XXX", "XXX", "F1", "F1", "F2", "F3", "F12", "", + "TG3", "", "", "", "", "", "", "", "", "", "", "", + ] + +# 4 +movement = [ + "Esc", "Esc", "Tab x", "Tab n", "CPg Dn", "CPg Dn", "Pg Down", "Home", "^ Arrow", "Insert", "SInsert", "Esc", + "", "Caps", "< Gui", "Gui Tab", "> Gui", "> Gui", "< Arrow", "< Arrow", "v Arrow", "> Arrow", "End", "Pr Scr", + "", "XXX", "XXX", "XXX", "CPg Up", "CPg Up", "Pg Up", "", "v Arrow", "XXX", "App", "", + "TG4", "", "", "", "", "Del", "", "BSpace", "", "", "", "", + ] + +# 5 +media = [ + "", "XXX", "play/ps", "Vol +", "Vol +", "XXX", "XXX", "XXX", "XXX", "XXX", "_reset", "Power", + "", "XXX", "|<<", "Vol 0", ">>|", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", "Sleep", + "", "MO5", "XXX", "Vol -", "Vol -", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", + "TG5", "", "", "", "", "", "", "", "", "", "", "", + ] + +# 6 +mouse = [ + "", "acc1", "XXX", "XXX", "XXX", "XXX", "^ Wheel", "< Wheel", "^ Mouse", "> Wheel", "XXX", "XXX", + "", "acc2", "Mouse 2", "Mouse 3", "Mouse 1", "Mouse 1", "< Mouse", "< Mouse", "v Mouse", "> Mouse", "XXX", "XXX", + "", "acc0", "XXX", "XXX", "XXX", "XXX", "v Wheel", "XXX", "v Mouse", "XXX", "XXX", "", + "TG6", "", "", "", "", "", "", "", "", "", "", "", + ] + +layers = [ + qwerty, + colemak, + numpad, + fpad, + movement, + media, + mouse + ] diff --git a/keyboards/signum/3_0/elitec/keymaps/default/readme.md b/keyboards/signum/3_0/elitec/keymaps/default/readme.md new file mode 100644 index 00000000000..be8cc30e8a0 --- /dev/null +++ b/keyboards/signum/3_0/elitec/keymaps/default/readme.md @@ -0,0 +1,24 @@ +# Default layout + +Layout created by: [Jan Christoph Ebersbach](https://github.com/jceb) + +The `generate_km.py` file automatically generates `keymap.c` with +additional comments that visually represent the layout. + +This layout is maintained as I am using it. You can also use it as a +starting point to create your own layouts for the Signum 3.0 with +`km_template.txt` and `generate_km.py`. + +# Customization + +- Customize `layout.py` to your liking. + - Attention 1: keycodes are either translated into symbols and + function calls via the `translate()` function in `generate_km.py` + or via user-defined mappings in the dictionary `qmk_dict` in + `layout.py`. Especially the latter might require adjustment for + uncommon qmk features + - Attention 2: additional C functions need to be put into + `km_template.txt` + +Run `./generate_km.py` to regenerate `keymap.c` and the JSON keymap +definition that should be copied to `qmk_configurator/public/keymaps`. diff --git a/keyboards/signum/3_0/elitec/keymaps/default/rules.mk b/keyboards/signum/3_0/elitec/keymaps/default/rules.mk new file mode 100644 index 00000000000..502b2def762 --- /dev/null +++ b/keyboards/signum/3_0/elitec/keymaps/default/rules.mk @@ -0,0 +1 @@ +UNICODEMAP_ENABLE = yes diff --git a/keyboards/signum/3_0/elitec/readme.md b/keyboards/signum/3_0/elitec/readme.md new file mode 100644 index 00000000000..f60023f6d57 --- /dev/null +++ b/keyboards/signum/3_0/elitec/readme.md @@ -0,0 +1,14 @@ +# Signum 3.0 + +![Signum 3.0 Top](https://i.redd.it/vl54yl36bpz11.jpg) + +An ergonomic 40% PCB. + +Keyboard Maintainer: [Troy Fletcher](http://troyfletcher.net/) +Hardware available here: [Troy Fletcher](http://troyfletcher.net/keyboard_sales.html) + +Make example for this keyboard (after setting up your build environment): + + make signum/3_0/elitec:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/signum/3_0/elitec/rules.mk b/keyboards/signum/3_0/elitec/rules.mk new file mode 100644 index 00000000000..6a68eb443bc --- /dev/null +++ b/keyboards/signum/3_0/elitec/rules.mk @@ -0,0 +1,64 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no + +UNICODEMAP_ENABLE = no + +LAYOUTS = ortho_4x12 diff --git a/keyboards/singa/config.h b/keyboards/singa/config.h index a76a4b98ffa..dda54ccf4c9 100644 --- a/keyboards/singa/config.h +++ b/keyboards/singa/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -25,7 +24,7 @@ along with this program. If not, see . #define MANUFACTURER Singa Keyboards #define PRODUCT Singa -#define RGBLED_NUM 16 +#define RGBLED_NUM 18 #define MATRIX_ROWS 7 #define MATRIX_COLS 15 @@ -35,15 +34,7 @@ along with this program. If not, see . #define UNUSED_PINS #define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 -#define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - -#endif diff --git a/keyboards/singa/i2c.c b/keyboards/singa/i2c.c deleted file mode 100644 index e8c4455ad1b..00000000000 --- a/keyboards/singa/i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#include -#include - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif diff --git a/keyboards/singa/keymaps/amnesia0287/config.h b/keyboards/singa/keymaps/amnesia0287/config.h index 0f756350514..e176ed34798 100644 --- a/keyboards/singa/keymaps/amnesia0287/config.h +++ b/keyboards/singa/keymaps/amnesia0287/config.h @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright 2018 amnesia0287 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/keyboards/singa/keymaps/amnesia0287/keymap.c b/keyboards/singa/keymaps/amnesia0287/keymap.c index cb0ceac1a81..dc52122db6b 100644 --- a/keyboards/singa/keymaps/amnesia0287/keymap.c +++ b/keyboards/singa/keymaps/amnesia0287/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright 2018 amnesia0287 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/keyboards/singa/keymaps/default/config.h b/keyboards/singa/keymaps/default/config.h index 0f756350514..93b81b57ba4 100644 --- a/keyboards/singa/keymaps/default/config.h +++ b/keyboards/singa/keymaps/default/config.h @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright 2018 amnesia0287 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/singa/keymaps/default/keymap.c b/keyboards/singa/keymaps/default/keymap.c index d201f413b77..7beef8a64d8 100644 --- a/keyboards/singa/keymaps/default/keymap.c +++ b/keyboards/singa/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright 2018 amnesia0287 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/keyboards/singa/keymaps/test/config.h b/keyboards/singa/keymaps/test/config.h index 0f756350514..e176ed34798 100644 --- a/keyboards/singa/keymaps/test/config.h +++ b/keyboards/singa/keymaps/test/config.h @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright 2018 amnesia0287 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/keyboards/singa/keymaps/test/keymap.c b/keyboards/singa/keymaps/test/keymap.c index 30f8de3b3de..a8f31b49c19 100644 --- a/keyboards/singa/keymaps/test/keymap.c +++ b/keyboards/singa/keymaps/test/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright 2018 amnesia0287 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/keyboards/singa/matrix.c b/keyboards/singa/matrix.c deleted file mode 100644 index 245813dfd2d..00000000000 --- a/keyboards/singa/matrix.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include - -#include "matrix.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_set_row_status(uint8_t row); -uint8_t bit_reverse(uint8_t x); - -void matrix_init(void) { - // all outputs for rows high - DDRB = 0xFF; - PORTB = 0xFF; - // all inputs for columns - DDRA = 0x00; - DDRC &= ~(0x111111<<2); - DDRD &= ~(1< 7 - (~PINA) & 0xFF - ) | ( - // cols 8..13, PORTC 7 -> 0 - bit_reverse((~PINC) & 0xFF) << 8 - ) | ( - // col 14, PORTD 7 - ((~PIND) & (1 << PIND7)) << 7 - ); - - if (matrix_debouncing[row] != cols) { - matrix_debouncing[row] = cols; - debouncing = DEBOUNCE; - } - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_quantum(); - - return 1; -} - -// declarations -void matrix_set_row_status(uint8_t row) { - DDRB = (1 << row); - PORTB = ~(1 << row); -} - -uint8_t bit_reverse(uint8_t x) { - x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x; -} - -inline matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - -void matrix_print(void) { -} diff --git a/keyboards/singa/readme.md b/keyboards/singa/readme.md index 7a374db25c6..faeb816ec11 100644 --- a/keyboards/singa/readme.md +++ b/keyboards/singa/readme.md @@ -4,7 +4,7 @@ ![Singa](https://i.imgur.com/VVO27Tr.jpg) -A short description of the keyboard/project +75% Custom Keyboard. Keyboard Maintainer: [amnesia0287](https://github.com/amnesia0287) @@ -20,6 +20,8 @@ Flashing ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. +**Reset Key:** Hold down the key located at `K00`, commonly programmed as `Esc` while plugging in the keyboard. + Windows: 1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). 2. Place your keyboard into reset. @@ -38,12 +40,13 @@ macOS: ``` 3. Install the following packages: ``` - brew install python - brew install pyusb - brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` 4. Place your keyboard into reset. 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/singa/rules.mk b/keyboards/singa/rules.mk index 68d50aec67a..7e46696891c 100644 --- a/keyboards/singa/rules.mk +++ b/keyboards/singa/rules.mk @@ -31,20 +31,18 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes +BOOTMAGIC_ENABLE = no MOUSEKEY_ENABLE = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 -# custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c +SRC = i2c_master.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/singa/singa.c b/keyboards/singa/singa.c index 0f5ec471a8e..ee49ba65c10 100644 --- a/keyboards/singa/singa.c +++ b/keyboards/singa/singa.c @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright 2018 amnesia0287 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,32 +13,76 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include QMK_KEYBOARD_H - -#include -#include "action_layer.h" -#include "i2c.h" +#include "rgblight.h" +#include "i2c_master.h" #include "quantum.h" +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif -// for keyboard subdirectory level init functions -// @Override void matrix_init_kb(void) { - // call user level keymaps, if any - matrix_init_user(); +#ifdef RGBLIGHT_ENABLE + if (rgblight_config.enable) { + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + } +#endif + // call user level keymaps, if any + matrix_init_user(); } void matrix_scan_kb(void) { - matrix_scan_user(); - /* Nothing else for now. */ +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif + matrix_scan_user(); + /* Nothing else for now. */ } -__attribute__((weak)) // overridable -void matrix_init_user(void) { - +__attribute__ ((weak)) +void matrix_scan_user(void) { } -__attribute__((weak)) // overridable -void matrix_scan_user(void) { +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} +void backlight_set(uint8_t level) { + if (level == 0) { + // turn backlight LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } } diff --git a/keyboards/singa/singa.h b/keyboards/singa/singa.h index 8221176c156..03b68488860 100644 --- a/keyboards/singa/singa.h +++ b/keyboards/singa/singa.h @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright 2018 amnesia0287 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef SINGA_H -#define SINGA_H +#pragma once #include "quantum.h" @@ -139,5 +138,3 @@ { k74, k81, k75, KC_NO, KC_NO, k76, KC_NO, KC_NO, k77, KC_NO, k82, KC_NO, k78, k79, k80 }, \ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k15, k30 } \ } - -#endif diff --git a/keyboards/singa/usbconfig.h b/keyboards/singa/usbconfig.h index d2d848fcdc8..54a7d20f142 100644 --- a/keyboards/singa/usbconfig.h +++ b/keyboards/singa/usbconfig.h @@ -8,8 +8,7 @@ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -392,5 +391,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/sirius/unigo66/config.h b/keyboards/sirius/unigo66/config.h new file mode 100644 index 00000000000..66f7f9542f7 --- /dev/null +++ b/keyboards/sirius/unigo66/config.h @@ -0,0 +1,53 @@ +/* +Copyright 2017 Balz Guenat + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define CUSTOM_MATRIX 2 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1001 +#define DEVICE_VER 0x1901 +#define MANUFACTURER Sirius +#define PRODUCT UniGo66 +#define DESCRIPTION UniGo66 Wireless Split keyboard + +/* size of virtual matrix */ +#define MATRIX_ROWS 16 +#define MATRIX_COLS 16 + +/* matrix scanning is done in custom_matrix.cpp */ +//#define DIODE_DIRECTION + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/sirius/unigo66/custom_matrix.cpp b/keyboards/sirius/unigo66/custom_matrix.cpp new file mode 100644 index 00000000000..fba107c7cba --- /dev/null +++ b/keyboards/sirius/unigo66/custom_matrix.cpp @@ -0,0 +1,242 @@ +/* +Copyright 2016 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include + +// USB HID host +#include "Usb.h" +#include "usbhub.h" +#include "hid.h" +#include "hidboot.h" +#include "parser.h" + +#include "keycode.h" +#include "util.h" +#include "print.h" +#include "debug.h" +#include "timer.h" +#include "matrix.h" +#include "led.h" +#include "host.h" +#include "keyboard.h" + +extern "C" { +#include "quantum.h" +} + +/* KEY CODE to Matrix + * + * HID keycode(1 byte): + * Higher 5 bits indicates ROW and lower 3 bits COL. + * + * 7 6 5 4 3 2 1 0 + * +---------------+ + * | ROW | COL | + * +---------------+ + * + * Matrix space(16 * 16): + * r\c0123456789ABCDEF + * 0 +----------------+ + * : | | + * : | | + * 16 +----------------+ + */ +#define ROW_MASK 0xF0 +#define COL_MASK 0x0F +#define CODE(row, col) (((row) << 4) | (col)) +#define ROW(code) (((code) & ROW_MASK) >> 4) +#define COL(code) ((code) & COL_MASK) +#define ROW_BITS(code) (1 << COL(code)) + + +// Integrated key state of all keyboards +static report_keyboard_t local_keyboard_report; + +static bool matrix_is_mod = false; + +/* + * USB Host Shield HID keyboards + * This supports two cascaded hubs and four keyboards + */ +USB usb_host; +USBHub hub1(&usb_host); +USBHub hub2(&usb_host); +HIDBoot kbd1(&usb_host); +HIDBoot kbd2(&usb_host); +HIDBoot kbd3(&usb_host); +HIDBoot kbd4(&usb_host); +KBDReportParser kbd_parser1; +KBDReportParser kbd_parser2; +KBDReportParser kbd_parser3; +KBDReportParser kbd_parser4; + + +extern "C" +{ + uint8_t matrix_rows(void) { return MATRIX_ROWS; } + uint8_t matrix_cols(void) { return MATRIX_COLS; } + bool matrix_has_ghost(void) { return false; } + void matrix_init(void) { + // USB Host Shield setup + usb_host.Init(); + kbd1.SetReportParser(0, (HIDReportParser*)&kbd_parser1); + kbd2.SetReportParser(0, (HIDReportParser*)&kbd_parser2); + kbd3.SetReportParser(0, (HIDReportParser*)&kbd_parser3); + kbd4.SetReportParser(0, (HIDReportParser*)&kbd_parser4); + } + + static void or_report(report_keyboard_t report) { + // integrate reports into local_keyboard_report + local_keyboard_report.mods |= report.mods; + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + if (IS_ANY(report.keys[i])) { + for (uint8_t j = 0; j < KEYBOARD_REPORT_KEYS; j++) { + if (! local_keyboard_report.keys[j]) { + local_keyboard_report.keys[j] = report.keys[i]; + break; + } + } + } + } + } + + uint8_t matrix_scan(void) { + static uint16_t last_time_stamp1 = 0; + static uint16_t last_time_stamp2 = 0; + static uint16_t last_time_stamp3 = 0; + static uint16_t last_time_stamp4 = 0; + + // check report came from keyboards + if (kbd_parser1.time_stamp != last_time_stamp1 || + kbd_parser2.time_stamp != last_time_stamp2 || + kbd_parser3.time_stamp != last_time_stamp3 || + kbd_parser4.time_stamp != last_time_stamp4) { + + last_time_stamp1 = kbd_parser1.time_stamp; + last_time_stamp2 = kbd_parser2.time_stamp; + last_time_stamp3 = kbd_parser3.time_stamp; + last_time_stamp4 = kbd_parser4.time_stamp; + + // clear and integrate all reports + local_keyboard_report = {}; + or_report(kbd_parser1.report); + or_report(kbd_parser2.report); + or_report(kbd_parser3.report); + or_report(kbd_parser4.report); + + matrix_is_mod = true; + + dprintf("state: %02X %02X", local_keyboard_report.mods, local_keyboard_report.reserved); + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + dprintf(" %02X", local_keyboard_report.keys[i]); + } + dprint("\r\n"); + } else { + matrix_is_mod = false; + } + + uint16_t timer; + timer = timer_read(); + usb_host.Task(); + timer = timer_elapsed(timer); + if (timer > 100) { + dprintf("host.Task: %d\n", timer); + } + + static uint8_t usb_state = 0; + if (usb_state != usb_host.getUsbTaskState()) { + usb_state = usb_host.getUsbTaskState(); + dprintf("usb_state: %02X\n", usb_state); + + // restore LED state when keyboard comes up + if (usb_state == USB_STATE_RUNNING) { + dprintf("speed: %s\n", usb_host.getVbusState()==FSHOST ? "full" : "low"); + keyboard_set_leds(host_keyboard_leds()); + } + } + return 1; + } + + bool matrix_is_modified(void) { + return matrix_is_mod; + } + + bool matrix_is_on(uint8_t row, uint8_t col) { + uint8_t code = CODE(row, col); + + if (IS_MOD(code)) { + if (local_keyboard_report.mods & ROW_BITS(code)) { + return true; + } + } + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + if (local_keyboard_report.keys[i] == code) { + return true; + } + } + return false; + } + + matrix_row_t matrix_get_row(uint8_t row) { + uint16_t row_bits = 0; + + if (IS_MOD(CODE(row, 0)) && local_keyboard_report.mods) { + row_bits |= local_keyboard_report.mods; + } + + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + if (IS_ANY(local_keyboard_report.keys[i])) { + if (row == ROW(local_keyboard_report.keys[i])) { + row_bits |= ROW_BITS(local_keyboard_report.keys[i]); + } + } + } + return row_bits; + } + + uint8_t matrix_key_count(void) { + uint8_t count = 0; + + count += bitpop(local_keyboard_report.mods); + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + if (IS_ANY(local_keyboard_report.keys[i])) { + count++; + } + } + return count; + } + + void matrix_print(void) { + print("\nr/c 0123456789ABCDEF\n"); + for (uint8_t row = 0; row < matrix_rows(); row++) { + xprintf("%02d: ", row); + print_bin_reverse16(matrix_get_row(row)); + print("\n"); + } + } + + void led_set(uint8_t usb_led) + { + kbd1.SetReport(0, 0, 2, 0, 1, &usb_led); + kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); + kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); + kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); + led_set_kb(usb_led); + } + +}; diff --git a/keyboards/sirius/unigo66/info.json b/keyboards/sirius/unigo66/info.json new file mode 100644 index 00000000000..7482ef5b811 --- /dev/null +++ b/keyboards/sirius/unigo66/info.json @@ -0,0 +1,151 @@ +{ + "keyboard_name": "UniGo66", + "url": "https://discord.gg/GJ8bdM", + "maintainer": "qmk", + "width": 17, + "height": 7, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0, "w":1.5}, + {"label":"1", "x":1.5, "y":0}, + {"label":"2", "x":2.5, "y":0}, + {"label":"3", "x":3.5, "y":0}, + {"label":"4", "x":4.5, "y":0}, + {"label":"5", "x":5.5, "y":0}, + {"label":"-", "x":6.5, "y":0}, + {"label":"=", "x":9.5, "y":0}, + {"label":"6", "x":10.5, "y":0}, + {"label":"7", "x":11.5, "y":0}, + {"label":"8", "x":12.5, "y":0}, + {"label":"9", "x":13.5, "y":0}, + {"label":"0", "x":14.5, "y":0}, + {"label":"Bspc", "x":15.5, "y":0, "w":1.5}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"PgUp", "x":6.5, "y":1, "h":1.5}, + {"label":"[", "x":9.5, "y":1, "h":1.5}, + {"label":"Y", "x":10.5, "y":1}, + {"label":"U", "x":11.5, "y":1}, + {"label":"I", "x":12.5, "y":1}, + {"label":"O", "x":13.5, "y":1}, + {"label":"P", "x":14.5, "y":1}, + {"label":"\\", "x":15.5, "y":1, "w":1.5}, + {"label":"Caps", "x":0, "y":2, "w":1.5}, + {"label":"A", "x":1.5, "y":2}, + {"label":"S", "x":2.5, "y":2}, + {"label":"D", "x":3.5, "y":2}, + {"label":"F", "x":4.5, "y":2}, + {"label":"G", "x":5.5, "y":2}, + {"label":"H", "x":10.5, "y":2}, + {"label":"J", "x":11.5, "y":2}, + {"label":"K", "x":12.5, "y":2}, + {"label":"L", "x":13.5, "y":2}, + {"label":";", "x":14.5, "y":2}, + {"label":"Enter", "x":15.5, "y":2, "w":1.5}, + {"label":"Shift", "x":0, "y":3, "w":1.5}, + {"label":"Z", "x":1.5, "y":3}, + {"label":"X", "x":2.5, "y":3}, + {"label":"C", "x":3.5, "y":3}, + {"label":"V", "x":4.5, "y":3}, + {"label":"B", "x":5.5, "y":3}, + {"label":"PgDn", "x":6.5, "y":2.5, "h":1.5}, + {"label":"]", "x":9.5, "y":2.5, "h":1.5}, + {"label":"N", "x":10.5, "y":3}, + {"label":"M", "x":11.5, "y":3}, + {"label":",", "x":12.5, "y":3}, + {"label":".", "x":13.5, "y":3}, + {"label":"Up", "x":14.5, "y":3}, + {"label":"Shift", "x":15.5, "y":3, "w":1.5}, + {"label":"Ctrl", "x":0.5, "y":4}, + {"label":"Super", "x":1.5, "y":4}, + {"label":"Alt", "x":2.5, "y":4}, + {"label":"Left", "x":13.5, "y":4}, + {"label":"Down", "x":14.5, "y":4}, + {"label":"Right", "x":15.5, "y":4}, + {"label":"Space", "x":5.5, "y":5}, + {"label":"Ins", "x":6.5, "y":5}, + {"label":"Home", "x":9.5, "y":5}, + {"label":"Space", "x":10.5, "y":5}, + {"label":"Space", "x":5.5, "y":6}, + {"label":"Del", "x":6.5, "y":6}, + {"label":"End", "x":9.5, "y":6}, + {"label":"Space", "x":10.5, "y":6} + ] + }, + "LAYOUT_beta_pcb": { + "layout": [ + {"label":"Esc", "x":0, "y":0, "w":1.5}, + {"label":"1", "x":1.5, "y":0}, + {"label":"2", "x":2.5, "y":0}, + {"label":"3", "x":3.5, "y":0}, + {"label":"4", "x":4.5, "y":0}, + {"label":"5", "x":5.5, "y":0}, + {"label":"-", "x":6.5, "y":0}, + {"label":"=", "x":9.5, "y":0}, + {"label":"6", "x":10.5, "y":0}, + {"label":"7", "x":11.5, "y":0}, + {"label":"8", "x":12.5, "y":0}, + {"label":"9", "x":13.5, "y":0}, + {"label":"0", "x":14.5, "y":0}, + {"label":"Bspc", "x":15.5, "y":0, "w":1.5}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"PgUp", "x":6.5, "y":1, "h":1.5}, + {"label":"[", "x":9.5, "y":1, "h":1.5}, + {"label":"Y", "x":10.5, "y":1}, + {"label":"U", "x":11.5, "y":1}, + {"label":"I", "x":12.5, "y":1}, + {"label":"O", "x":13.5, "y":1}, + {"label":"P", "x":14.5, "y":1}, + {"label":"\\", "x":15.5, "y":1, "w":1.5}, + {"label":"Caps", "x":0, "y":2, "w":1.5}, + {"label":"A", "x":1.5, "y":2}, + {"label":"S", "x":2.5, "y":2}, + {"label":"D", "x":3.5, "y":2}, + {"label":"F", "x":4.5, "y":2}, + {"label":"G", "x":5.5, "y":2}, + {"label":"H", "x":10.5, "y":2}, + {"label":"J", "x":11.5, "y":2}, + {"label":"K", "x":12.5, "y":2}, + {"label":"L", "x":13.5, "y":2}, + {"label":";", "x":14.5, "y":2}, + {"label":"Enter", "x":15.5, "y":2, "w":1.5}, + {"label":"Shift", "x":0, "y":3, "w":1.5}, + {"label":"Z", "x":1.5, "y":3}, + {"label":"X", "x":2.5, "y":3}, + {"label":"C", "x":3.5, "y":3}, + {"label":"V", "x":4.5, "y":3}, + {"label":"B", "x":5.5, "y":3}, + {"label":"PgDn", "x":6.5, "y":2.5, "h":1.5}, + {"label":"]", "x":9.5, "y":2.5, "h":1.5}, + {"label":"N", "x":10.5, "y":3}, + {"label":"M", "x":11.5, "y":3}, + {"label":",", "x":12.5, "y":3}, + {"label":".", "x":13.5, "y":3}, + {"label":"Up", "x":14.5, "y":3}, + {"label":"Shift", "x":15.5, "y":3, "w":1.5}, + {"label":"Ctrl", "x":0.5, "y":4}, + {"label":"Super", "x":1.5, "y":4}, + {"label":"Alt", "x":2.5, "y":4}, + {"label":"Left", "x":13.5, "y":4}, + {"label":"Down", "x":14.5, "y":4}, + {"label":"Right", "x":15.5, "y":4}, + {"label":"Space", "x":5.5, "y":5, "h":2}, + {"label":"Ins", "x":6.5, "y":5}, + {"label":"Home", "x":9.5, "y":5}, + {"label":"Space", "x":10.5, "y":5, "h":2}, + {"label":"Del", "x":6.5, "y":6}, + {"label":"End", "x":9.5, "y":6} + ] + } + } +} diff --git a/keyboards/sirius/unigo66/keymaps/danielhklein/config.h b/keyboards/sirius/unigo66/keymaps/danielhklein/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/sirius/unigo66/keymaps/danielhklein/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/sirius/unigo66/keymaps/danielhklein/keymap.c b/keyboards/sirius/unigo66/keymaps/danielhklein/keymap.c new file mode 100644 index 00000000000..2425572bdc8 --- /dev/null +++ b/keyboards/sirius/unigo66/keymaps/danielhklein/keymap.c @@ -0,0 +1,177 @@ +#include QMK_KEYBOARD_H + +enum layer_number { + _MAC = 0, + _WINDOWS, + _FN, + _ADJ +}; + +enum custom_keycodes { + MAC = SAFE_RANGE, + WINDOWS, + FN, + ADJ +}; + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { +/* Mac + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Bsp | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | Enter | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| ` | | \ |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+---------------------------' `---------------------------+------+------+--------' + * | Ctrl | Alt | Gui | | Gui | Alt | Ctrl | + * `--------------------' `--------------------' + * ,-------------. ,--------------. + * | | | | | | + * | Bspc | FN | | ADJ | Space | + * | | | | | | + * `-------------' `--------------' + */ + [_MAC] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_BSLS, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LALT,KC_LGUI, KC_RGUI,KC_RALT, KC_RCTL, + KC_BSPC,FN, ADJ, KC_SPC, + KC_BSPC,FN, ADJ, KC_SPC + ), +/* Windows + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Bsp | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | Enter | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| ` | | \ |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+---------------------------' `---------------------------+------+------+--------' + * | Gui | Alt | Ctrl | | Ctrl | Alt | Gui | + * `--------------------' `--------------------' + * ,-------------. ,--------------. + * | | | | | | + * | Bspc | FN | | ADJ | Space | + * | | | | | | + * `-------------' `--------------' + */ + [_WINDOWS] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_BSLS, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, KC_LALT,KC_LCTL, KC_RCTL,KC_RALT, KC_RGUI, + KC_BSPC,FN, ADJ, KC_SPC, + KC_BSPC,FN, ADJ, KC_SPC + ), +/* FN + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | RESET | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | MAC | | | | | | | | | | PgDn | Up | PgUp | Print| Home | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | WINDOWS| | | | | |------| |------| | Left | Down | Right|Insert| End | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Shift | | | | | | | | | Play | Mute | Vol- | Vol+ | Last | Next | + * `--------+------+------+---------------------------' `---------------------------+------+------+--------' + * | | |GuiCtl| |GuiCtl| | | + * `--------------------' `--------------------' + * ,-------------. ,--------------. + * | | | | | | + * | | | | | | + * | | | | | | + * `-------------' `--------------' + */ + [_FN] = LAYOUT( + RESET, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + MAC, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, KC_UP, KC_PGUP, KC_PSCR, KC_HOME, + WINDOWS, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, + _______, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, + XXXXXXX, XXXXXXX,_______, _______, XXXXXXX, XXXXXXX, + XXXXXXX, _______, XXXXXXX, XXXXXXX, + XXXXXXX, _______, XXXXXXX, XXXXXXX + ), + +/* ADJ + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | |Nlock | = | / | * | - | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | | | 7 | 8 | 9 | + | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| 4 | 5 | 6 | Enter| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | 1 | 2 | 3 | Space| | | + * `--------+------+------+---------------------------' `---------------------------+------+------+--------' + * | | | | | 0 | . | | + * `--------------------' `--------------------' + * ,-------------. ,--------------. + * | | | | | | + * | | | | | | + * | | | | | | + * `-------------' `--------------' + */ + [_ADJ] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_NLCK, KC_PEQL, KC_PSLS, KC_PAST, KC_PMNS, XXXXXXX, XXXXXXX, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PPLS, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PENT, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_SPC, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX,XXXXXXX, KC_P0, KC_PDOT, XXXXXXX, + XXXXXXX, XXXXXXX, _______, XXXXXXX, + XXXXXXX, XXXXXXX, _______, XXXXXXX + ) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_MAC); + } + return false; + break; + case WINDOWS: + if(record->event.pressed) { + set_single_persistent_default_layer(_WINDOWS); + } + return false; + break; + case FN: + if (record->event.pressed) { + layer_on(_FN); + } else { + layer_off(_FN); + } + return false; + break; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + break; + } + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/sirius/unigo66/keymaps/default/config.h b/keyboards/sirius/unigo66/keymaps/default/config.h new file mode 100644 index 00000000000..271f48d0011 --- /dev/null +++ b/keyboards/sirius/unigo66/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/sirius/unigo66/keymaps/default/keymap.c b/keyboards/sirius/unigo66/keymaps/default/keymap.c new file mode 100644 index 00000000000..06982e64b7d --- /dev/null +++ b/keyboards/sirius/unigo66/keymaps/default/keymap.c @@ -0,0 +1,128 @@ +#include QMK_KEYBOARD_H + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { +/* + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Bsp | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | PgUp | | [ | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ; | Enter | + * |--------+------+------+------+------+------| PgDn | | ] |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | Up |M2/Shift| + * `--------+------+------+---------------------------' `---------------------------+------+------+--------' + * | Ctrl | Gui | Alt | | Left | Down| Right | + * `--------------------' `--------------------' + * ,-------------. ,---------------. + * | | Ins | | Home | | + * | Space|------| |------|M1/Space| + * | | Del | | End | | + * `-------------' `---------------' + */ + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_PGUP, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGDN, KC_RBRC, KC_N, KC_M, KC_COMM,KC_DOT, KC_UP, LM(2,MOD_RSFT), + KC_LCTL, KC_LGUI,KC_LALT, KC_LEFT,KC_DOWN, KC_RGHT, + KC_SPC, KC_INS, KC_HOME, LT(1,KC_SPC), + KC_NO , KC_DEL, KC_END, KC_NO + ), +/* + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | Del | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | | | | | ' | + * |--------+------+------+------+------+------| | | M3 |------+------+------+------+------+--------| + * | | Mute | Vol- | Vol+ | | | | | | | | | | / | | + * `--------+------+------+---------------------------' `---------------------------+------+------+--------' + * | | | | | | | | + * `--------------------' `--------------------' + * ,-------------. ,---------------. + * | | | | | | + * | |------| |------| | + * | | | | | | + * `-------------' `---------------' + */ + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, + _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, TG(3), _______, _______, _______, _______, KC_SLSH, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), +/* + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | | | | | ' | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | / | | + * `--------+------+------+---------------------------' `---------------------------+------+------+--------' + * | | | | | | | | + * `--------------------' `--------------------' + * ,-------------. ,---------------. + * | | | | | | + * | |------| |------| | + * | | | | | | + * `-------------' `---------------' + */ + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLSH, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), +/* + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | Calc |NumLoc| / | * | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | 7 | 8 | 9 | + | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | | 4 | 5 | 6 | = | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | 1 | 2 | 3 | Enter | + * `--------+------+------+---------------------------' `---------------------------+------+------+--------' + * | | | | | 0 | . | Enter| + * `--------------------' `--------------------' + * ,-------------. ,---------------. + * | | | | | | + * | |------| |------| | + * | | | | | | + * `-------------' `---------------' + */ + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CALC, KC_NLCK, KC_PSLS,KC_PAST,KC_PMNS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PEQL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, + _______, _______, _______, KC_P0, KC_PDOT,KC_PENT, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), +}; + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/sirius/unigo66/main.c b/keyboards/sirius/unigo66/main.c new file mode 100644 index 00000000000..b4f2a91e49d --- /dev/null +++ b/keyboards/sirius/unigo66/main.c @@ -0,0 +1,100 @@ +#include +#include +#include +#include + +// LUFA +#include "lufa.h" + +#include "sendchar.h" +#include "debug.h" +#include "keyboard.h" +#include "led.h" + +/* LED ping configuration */ +#define TMK_LED +//#define LEONARDO_LED +#if defined(TMK_LED) +// For TMK converter and Teensy +#define LED_TX_INIT (DDRD |= (1<<6)) +#define LED_TX_ON (PORTD |= (1<<6)) +#define LED_TX_OFF (PORTD &= ~(1<<6)) +#define LED_TX_TOGGLE (PORTD ^= (1<<6)) +#elif defined(LEONARDO_LED) +// For Leonardo(TX LED) +#define LED_TX_INIT (DDRD |= (1<<5)) +#define LED_TX_ON (PORTD &= ~(1<<5)) +#define LED_TX_OFF (PORTD |= (1<<5)) +#define LED_TX_TOGGLE (PORTD ^= (1<<5)) +#else +#define LED_TX_INIT +#define LED_TX_ON +#define LED_TX_OFF +#define LED_TX_TOGGLE +#endif + + +static void LUFA_setup(void) +{ + /* Disable watchdog if enabled by bootloader/fuses */ + MCUSR &= ~(1 << WDRF); + wdt_disable(); + + /* Disable clock division */ +#if (F_CPU == 8000000) + clock_prescale_set(clock_div_2); // 16MHz crystal divided by 2 +#else + clock_prescale_set(clock_div_1); +#endif + + // Leonardo needs. Without this USB device is not recognized. + USB_Disable(); + + USB_Init(); + + // for Console_Task + USB_Device_EnableSOFEvents(); + print_set_sendchar(sendchar); +} + + + +int main(void) +{ + // LED for debug + LED_TX_INIT; + LED_TX_ON; + + debug_enable = true; + debug_keyboard = true; + + host_set_driver(&lufa_driver); + keyboard_init(); + + LUFA_setup(); + + /* NOTE: Don't insert time consuming job here. + * It'll cause unclear initialization failure when DFU reset(worm start). + */ + sei(); + +/* Some keyboards bootup quickly and cannot be initialized with this startup wait.*/ + // wait for startup of sendchar routine + while (USB_DeviceState != DEVICE_STATE_Configured) ; + if (debug_enable) { + _delay_ms(1000); + } + + debug("init: done\n"); + + for (;;) { + keyboard_task(); + +#if !defined(INTERRUPT_CONTROL_ENDPOINT) + // LUFA Task for control request + USB_USBTask(); +#endif + } + + return 0; +} diff --git a/keyboards/sirius/unigo66/matrix.c b/keyboards/sirius/unigo66/matrix.c new file mode 100644 index 00000000000..b077febd74d --- /dev/null +++ b/keyboards/sirius/unigo66/matrix.c @@ -0,0 +1 @@ +// Intentionally left empty. This file must exist for this board to build. diff --git a/keyboards/sirius/unigo66/readme.md b/keyboards/sirius/unigo66/readme.md new file mode 100644 index 00000000000..1dae0f99496 --- /dev/null +++ b/keyboards/sirius/unigo66/readme.md @@ -0,0 +1,17 @@ +# UniGo66 + +![UniGo66](https://i.imgur.com/ZKlcncg.png) + +The UniGo66 is an ergonomic wireless keyboard designed by Sirius and manufactured by ALF Studios. + +Join ALF Studios on [Discord](https://discord.gg/GJ8bdM) + +Make example: + + make sirius/unigo66:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +To get the U2U into DFU flashing mode, insert the U2U into the computer and press the button in the red circle shown below + +![U2U](https://i.imgur.com/WKwgDjZ.png) diff --git a/keyboards/sirius/unigo66/rules.mk b/keyboards/sirius/unigo66/rules.mk new file mode 100644 index 00000000000..c35487b18c3 --- /dev/null +++ b/keyboards/sirius/unigo66/rules.mk @@ -0,0 +1,30 @@ +# MCU name +MCU = atmega32u4 + +F_CPU = 16000000 + +ARCH = AVR8 + +F_USB = $(F_CPU) + +BOOTLOADER = atmel-dfu + +# Interrupt driven control endpoint task +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# CONSOLE_ENABLE = yes # Console for debug(+400) +# COMMAND_ENABLE = yes # Commands for debug and configuration +# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +# NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +# BACKLIGHT_ENABLE = yes +USB_HID_ENABLE = yes + +CUSTOM_MATRIX = yes +SRC += custom_matrix.cpp\ + main.c diff --git a/keyboards/sirius/unigo66/unigo66.c b/keyboards/sirius/unigo66/unigo66.c new file mode 100644 index 00000000000..6a2d2632bd6 --- /dev/null +++ b/keyboards/sirius/unigo66/unigo66.c @@ -0,0 +1 @@ +#include "unigo66.h" diff --git a/keyboards/sirius/unigo66/unigo66.h b/keyboards/sirius/unigo66/unigo66.h new file mode 100644 index 00000000000..186aa2b633a --- /dev/null +++ b/keyboards/sirius/unigo66/unigo66.h @@ -0,0 +1,141 @@ +/* +Copyright 2017 Balz Guenat + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef USB_USB_H +#define USB_USB_H + +#include "quantum.h" + +/* ,---------------. ,---------------. ,---------------. + * |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24| + * ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help | + * `---' `---------------' `---------------' `---------------' `-----------' `---------------' `-------' + * ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| |Stp|Agn| + * |-----------------------------------------------------------| |-----------| |---------------| |-------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| |Mnu|Und| + * |-----------------------------------------------------------| `-----------' |---------------| |-------| + * |CapsL | A| S| D| F| G| H| J| K| L| ;| :| #|Retn| | 4| 5| 6|KP,| |Sel|Cpy| + * |-----------------------------------------------------------| ,---. |---------------| |-------| + * |Shft| <| Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|KP=| |Exe|Pst| + * |-----------------------------------------------------------| ,-----------. |---------------| |-------| + * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| + * `-----------------------------------------------------------' `-----------' `---------------' `-------' + * + * + * App: Windows Menu key + * Gui: Windows key, Mac ⌘ key or Meta key + * + * Pwr: Power for Unix and Mac + * VDn,Vup,Mut: Volume control for Unix and Mac + * Stp,Agn..: for Unix + * + * KP,: Brazilian Keypad Comma + * KP=: Keypad = for Mac + * <,#: ISO keys(UK legend) + * JPY: Japanese Yen(¥) + * RO: Japanese ろ or Brazilian / + * MHEN: Japanese 無変換 Non Conversion + * HENK: Japanese 変換 Conversion + * KANA: Japanese かな Hiragana/Katakana + * https://en.wikipedia.org/wiki/Keyboard_layout#Japanese + * H/E: Korean 한/영 Hangul/English + * HNJ: Korean 한자 Hanja + * https://en.wikipedia.org/wiki/Keyboard_layout#Hangul_.28for_Korean.29 + * + * TODO: use same keycode to pass through instead of KC_NO? + */ +#define LAYOUT_all( \ + K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73, \ + K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, K81,K80,K7F,K66, K75, \ + K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A, K49,K4A,K4B, K53,K54,K55,K56, K78,K79, \ + K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, K5F,K60,K61,K57, K76,K7A, \ + K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K32,K28, K5C,K5D,K5E,K85, K77,K7C, \ + KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K87,KE5, K52, K59,K5A,K5B,K67, K74,K7D, \ + KE0,KE3,KE2,K8B,K91, K2C, K90,K8A,K88,KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58, K7E,K7B \ +) { \ + { KC_NO, KC_NO, KC_NO, KC_NO, K04, K05, K06, K07, /* 00-07 */ \ + K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, /* 08-0F */ \ + { K10, K11, K12, K13, K14, K15, K16, K17, /* 10-17 */ \ + K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, /* 18-1F */ \ + { K20, K21, K22, K23, K24, K25, K26, K27, /* 20-27 */ \ + K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, /* 28-2F */ \ + { K30, K31, K32, K33, K34, K35, K36, K37, /* 30-37 */ \ + K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, /* 38-3F */ \ + { K40, K41, K42, K43, K44, K45, K46, K47, /* 40-47 */ \ + K48, K49, K4A, K4B, K4C, K4D, K4E, K4F }, /* 48-4F */ \ + { K50, K51, K52, K53, K54, K55, K56, K57, /* 50-57 */ \ + K58, K59, K5A, K5B, K5C, K5D, K5E, K5F }, /* 58-5F */ \ + { K60, K61, K62, K63, K64, K65, K66, K67, /* 60-67 */ \ + K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, /* 68-6F */ \ + { K70, K71, K72, K73, K74, K75, K76, K77, /* 70-77 */ \ + K78, K79, K7A, K7B, K7C, K7D, K7E, K7F }, /* 78-7F */ \ + { K80, K81, KC_NO, KC_NO, KC_NO, K85, KC_NO, K87, /* 80-87 */ \ + K88, K89, K8A, K8B, KC_NO, KC_NO, KC_NO, KC_NO }, /* 88-8F */ \ + { K90, K91, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, /* 90-97 */ \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* 98-9F */ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, /* A0-A7 */ \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* A8-AF */ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, /* B0-B7 */ \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* B8-BF */ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, /* C0-C7 */ \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* C8-CF */ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, /* D0-D7 */ \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* D8-DF */ \ + { KE0, KE1, KE2, KE3, KE4, KE5, KE6, KE7, /* E0-E7 */ \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* E8-EF */ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, /* F0-F7 */ \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* F8-FF */ \ +} + +#define LAYOUT( \ + K29,K1E,K1F,K20,K21,K22,K2D, K2E,K23,K24,K25,K26,K27,K2A,\ + K2B,K14,K1A,K08,K15,K17,K4B, K2F,K1C,K18,K0C,K12,K13,K31,\ + K39,K04,K16,K07,K09,K0A, K0B,K0D,K0E,K0F,K33,K34,\ + KE1,K1D,K1B,K06,K19,K05,K4E, K30,K11,K10,K36,K37,K52,KE5,\ + KE0,KE3,KE2, K50,K51,K4F,\ + K2C,K49, K4A,K28, \ + KE6,K4C, K4D,KE4 \ +) LAYOUT_all( \ + KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, \ + K29, KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, KC_NO,KC_NO,KC_NO, KC_NO,KC_NO,KC_NO,KC_NO, KC_NO, \ + KC_NO,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,KC_NO,K2A, K49,K4A,K4B, KC_NO,KC_NO,KC_NO,KC_NO, KC_NO,KC_NO, \ + K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, KC_NO,KC_NO,KC_NO,KC_NO, KC_NO,KC_NO, \ + K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, KC_NO,K28, KC_NO,KC_NO,KC_NO,KC_NO, KC_NO,KC_NO, \ + KE1,KC_NO,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,KC_NO, KC_NO,KE5, K52, KC_NO,KC_NO,KC_NO,KC_NO, KC_NO,KC_NO, \ + KE0,KE3,KE2,KC_NO,KC_NO, K2C, KC_NO,KC_NO,KC_NO,KE6,KC_NO,KC_NO,KE4, K50,K51,K4F, KC_NO, KC_NO,KC_NO, KC_NO,KC_NO \ +) + +#define LAYOUT_beta_pcb( \ + K1E, K1F, K30, K2F, K45, K3B, KE6, KE2, K3A, K39, K14, K04, K09, K07, \ + K29, K15, K3C, K3D, K3E, K3F, K58, K50, K2C, K11, K05, K55, K10, K06, \ + K31, K5F, K5E, K61, K2A, K38, K4C, K57, K53, K5B, K5A, K08, \ + K35, K5D, K17, K1B, K1A, K52, K56, K51, K4D, K23, K1C, K13, K2E, K0C, \ + K5C, K0A, K0F, K36, K0E, K37, \ + KE4, K49, K4B, KE0, \ + KE5, KE1\ +) LAYOUT_all( \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K29, K3A,K3B,K3C,K3D,K3E,K3F,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,K45, KC_NO,KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K35,K1E,K1F,KC_NO,KC_NO,KC_NO,K23,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,K2E,KC_NO, K2A, K49,KC_NO,K4B, K53,KC_NO,K55,K56, KC_NO, KC_NO, \ + KC_NO,K14,K1A,K08,K15,K17,K1C,KC_NO,K0C,KC_NO,K13,K2F,K30, K31, K4C,K4D,KC_NO, K5F,KC_NO,K61,K57, KC_NO, KC_NO, \ + K39,K04,KC_NO,K07,K09,K0A,KC_NO,KC_NO,K0E,K0F,KC_NO,KC_NO, KC_NO, KC_NO, K5C,K5D,K5E,KC_NO, KC_NO, KC_NO, \ + KE1,KC_NO, KC_NO,K1B,K06,KC_NO,K05,K11,K10,K36,K37,K38, KC_NO, KE5, K52, KC_NO,K5A,K5B,KC_NO, KC_NO, KC_NO, \ + KE0,KC_NO,KE2,KC_NO,KC_NO,K2C,KC_NO,KC_NO,KC_NO,KE6,KC_NO,KC_NO, KE4, K50,K51,KC_NO, KC_NO, KC_NO,K58, KC_NO, KC_NO \ +) +#endif \ No newline at end of file diff --git a/keyboards/sixkeyboard/config.h b/keyboards/sixkeyboard/config.h index 4ce25c67091..a825467afe8 100644 --- a/keyboards/sixkeyboard/config.h +++ b/keyboards/sixkeyboard/config.h @@ -39,14 +39,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 0 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE - /* Force NKRO Mode - If forced on, must be disabled via magic key (default = LShift+RShift+N) */ #define FORCE_NKRO @@ -56,11 +55,6 @@ along with this program. If not, see . * if your keyboard/keypad is missing keys and you want magic key support. */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/sixkeyboard/keymaps/default/keymap.c b/keyboards/sixkeyboard/keymaps/default/keymap.c index 78b55478b6a..3b39892a931 100644 --- a/keyboards/sixkeyboard/keymaps/default/keymap.c +++ b/keyboards/sixkeyboard/keymaps/default/keymap.c @@ -9,19 +9,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -}; - void matrix_scan_user(void) { // jump to bootloaer when all keys are pressed if (matrix_get_row(0) == 0b111 && matrix_get_row(1) == 0b111) { clear_keyboard(); bootloader_jump(); } -}; \ No newline at end of file +}; diff --git a/keyboards/sixkeyboard/matrix.c b/keyboards/sixkeyboard/matrix.c index 860452ebd8f..64b46e9b0c8 100644 --- a/keyboards/sixkeyboard/matrix.c +++ b/keyboards/sixkeyboard/matrix.c @@ -1,10 +1,5 @@ /* -Note for ErgoDox EZ customizers: Here be dragons! -This is not a file you want to be messing with. -All of the interesting stuff for you is under keymaps/ :) -Love, Erez - Copyright 2013 Oleg Kostyuk This program is free software: you can redistribute it and/or modify diff --git a/keyboards/sixkeyboard/readme.md b/keyboards/sixkeyboard/readme.md index 512b9a6af27..6979e1d48c1 100644 --- a/keyboards/sixkeyboard/readme.md +++ b/keyboards/sixkeyboard/readme.md @@ -9,7 +9,7 @@ Make example for this keyboard (after setting up your build environment): make sixkeyboard:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Hardware Info diff --git a/keyboards/sixkeyboard/rules.mk b/keyboards/sixkeyboard/rules.mk index 6aedc714857..52213f341a3 100644 --- a/keyboards/sixkeyboard/rules.mk +++ b/keyboards/sixkeyboard/rules.mk @@ -1,9 +1,6 @@ - - SRC = matrix.c # MCU name -#MCU = at90usb1287 MCU = atmega16u2 # Processor frequency. @@ -67,4 +64,4 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -CUSTOM_MATRIX = yes \ No newline at end of file +CUSTOM_MATRIX = yes diff --git a/keyboards/sixshooter/config.h b/keyboards/sixshooter/config.h deleted file mode 100644 index 163a3ab431b..00000000000 --- a/keyboards/sixshooter/config.h +++ /dev/null @@ -1,128 +0,0 @@ -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6666 -#define DEVICE_VER 0x0001 -#define MANUFACTURER bpiphany -#define PRODUCT sixshooter -#define DESCRIPTION A PCB for the CM Storm switch tester utilizing a Teensy 2.0. - -/* key matrix size */ -#define MATRIX_ROWS 1 -#define MATRIX_COLS 6 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { } -#define MATRIX_COL_PINS { F7, F6, F1, F5, F4, F0 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION diff --git a/keyboards/sixshooter/keymaps/default/keymap.c b/keyboards/sixshooter/keymaps/default/keymap.c deleted file mode 100644 index ca0973c60b7..00000000000 --- a/keyboards/sixshooter/keymaps/default/keymap.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright 2018 QMK Community - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -#define _BL 0 -#define _FN 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap 0: Media Keys - * ,-----------. - * |Mut| V-| V+| - * |---+---+---| - * |Prv|Ply|Nxt| - * `-----------' - */ - [_BL] = LAYOUT( /* Base */ - MO(_FN), KC_VOLD, KC_VOLU, \ - KC_MPRV, KC_MPLY, KC_MNXT \ - ), - [_FN] = LAYOUT( - KC_TRNS, SS_LON, SS_LOFF, \ - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -void matrix_init_user(void) { - /* Default all LEDs to on */ - sixshooter_led_all_on(); -} diff --git a/keyboards/sixshooter/readme.md b/keyboards/sixshooter/readme.md deleted file mode 100644 index 18229bdbf6c..00000000000 --- a/keyboards/sixshooter/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# The Six Shooter - -A PCB for the CM Storm switch tester utilizing a Teensy 2.0 designed by Bpiphany. Because the PCB was designed with individual pins for each LED, there are custom keycodes (`SS_LON` and `SS_LOFF`) for turning on and off the backlight LEDs. - -Keyboard Maintainer: QMK Community\ -Hardware Supported: Six Shooter PCB, Teensy 2.0\ -Hardware Availability: [GeekHack.org](https://geekhack.org/index.php?topic=70033.0) - -Make example for this keyboard (after setting up your build environment): - - make sixshooter:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/sixshooter/sixshooter.c b/keyboards/sixshooter/sixshooter.c deleted file mode 100644 index 814d219a294..00000000000 --- a/keyboards/sixshooter/sixshooter.c +++ /dev/null @@ -1,57 +0,0 @@ -#include "sixshooter.h" - -extern inline void sixshooter_led_0_on(void); -extern inline void sixshooter_led_1_on(void); -extern inline void sixshooter_led_2_on(void); -extern inline void sixshooter_led_3_on(void); -extern inline void sixshooter_led_4_on(void); -extern inline void sixshooter_led_5_on(void); - -extern inline void sixshooter_led_0_off(void); -extern inline void sixshooter_led_1_off(void); -extern inline void sixshooter_led_2_off(void); -extern inline void sixshooter_led_3_off(void); -extern inline void sixshooter_led_4_off(void); -extern inline void sixshooter_led_5_off(void); - -extern inline void sixshooter_led_all_on(void); -extern inline void sixshooter_led_all_off(void); - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - if (record->event.pressed) { - - /* Check for custom keycodes for turning on and off LEDs */ - switch(keycode) { - case SS_LON: - sixshooter_led_all_on(); - return false; - case SS_LOFF: - sixshooter_led_all_off(); - return false; - } - } - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/sixshooter/sixshooter.h b/keyboards/sixshooter/sixshooter.h deleted file mode 100644 index d27b1e419ca..00000000000 --- a/keyboards/sixshooter/sixshooter.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef SIXSHOOTER_H -#define SIXSHOOTER_H - -#include "quantum.h" - -#define LAYOUT( \ - K00, K01, K02, \ - K03, K04, K05 \ -) { \ - { K00, K01, K02, K03, K04, K05 }, \ -} - - -/* - * Define keyboard specific keycodes for controlling on/off for all LEDs as they - * are all on different pins with this PCB, rather than a single backlight pin - */ -enum keyboard_keycode { - SS_LON = SAFE_RANGE, - SS_LOFF, - SAFE_RANGE_KB -}; - -inline void sixshooter_led_0_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } -inline void sixshooter_led_1_on(void) { DDRC |= (1<<7); PORTC |= (1<<7); } -inline void sixshooter_led_2_on(void) { DDRD |= (1<<0); PORTD |= (1<<0); } -inline void sixshooter_led_3_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); } -inline void sixshooter_led_4_on(void) { DDRD |= (1<<7); PORTD |= (1<<7); } -inline void sixshooter_led_5_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); } - -inline void sixshooter_led_0_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); } -inline void sixshooter_led_1_off(void) { DDRC &= ~(1<<7); PORTC &= ~(1<<7); } -inline void sixshooter_led_2_off(void) { DDRD &= ~(1<<0); PORTD &= ~(1<<0); } -inline void sixshooter_led_3_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); } -inline void sixshooter_led_4_off(void) { DDRD &= ~(1<<7); PORTD &= ~(1<<7); } -inline void sixshooter_led_5_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); } - -inline void sixshooter_led_all_on(void) { - sixshooter_led_0_on(); - sixshooter_led_1_on(); - sixshooter_led_2_on(); - sixshooter_led_3_on(); - sixshooter_led_4_on(); - sixshooter_led_5_on(); -} -inline void sixshooter_led_all_off(void) { - sixshooter_led_0_off(); - sixshooter_led_1_off(); - sixshooter_led_2_off(); - sixshooter_led_3_off(); - sixshooter_led_4_off(); - sixshooter_led_5_off(); -} - -#endif diff --git a/keyboards/skog/README.md b/keyboards/skog/README.md new file mode 100644 index 00000000000..51a792b6bd2 --- /dev/null +++ b/keyboards/skog/README.md @@ -0,0 +1,61 @@ +Skog TKL by Percent +========================== + +Keyboard Maintainer: QMK Community +Hardware Supported: Skog PCB +Hardware Availability: https://geekhack.org/index.php?topic=87953.0 + +Make example for this keyboard (after setting up your build environment): + + make skog:default + +## Setting the board to bootloader mode + +If you're lucky, the programming script does this automagically for you. If +however this doesn't work for you, you need to enter the bootloader mode manually +by plugging the keyboard in while holding the bootloader key. If you did this +correctly the LEDs will blink and you'll be able to flash your firmware. + +The bootloader key is in the top-right (Pause). + +## Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Troubleshooting + +From my experience, it's really hard to brick these boards. But these +tricks have been useful when it got stuck in a weird scenario. + +1. Try plugging the board in while holding the bootloader key. This will force + it to boot only the bootloader without loading the firmware. Once this is + done, just reflash the board with the original firmware. +2. Sometimes USB hubs can act weird, so try connecting the board directly + to your computer or plugging/unplugging the USB hub. diff --git a/keyboards/bminiex/backlight.c b/keyboards/skog/backlight.c similarity index 100% rename from keyboards/bminiex/backlight.c rename to keyboards/skog/backlight.c diff --git a/keyboards/bminiex/backlight_custom.h b/keyboards/skog/backlight_custom.h similarity index 100% rename from keyboards/bminiex/backlight_custom.h rename to keyboards/skog/backlight_custom.h diff --git a/keyboards/bminiex/breathing_custom.h b/keyboards/skog/breathing_custom.h similarity index 100% rename from keyboards/bminiex/breathing_custom.h rename to keyboards/skog/breathing_custom.h diff --git a/keyboards/skog/config.h b/keyboards/skog/config.h new file mode 100644 index 00000000000..f518da8c9b0 --- /dev/null +++ b/keyboards/skog/config.h @@ -0,0 +1,39 @@ +/* +Copyright 2018 Jumail Mundekkat / MxBlue + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D + +#define MANUFACTURER Percent +#define PRODUCT Skog TKL + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 14 + +#define RGBLED_NUM 2 +#define RGBLIGHT_ANIMATIONS + +#define BACKLIGHT_LEVELS 5 + +#define NO_UART 1 +#define BOOTLOADHID_BOOTLOADER 1 + +#endif diff --git a/keyboards/bmini/i2c.c b/keyboards/skog/i2c.c similarity index 100% rename from keyboards/bmini/i2c.c rename to keyboards/skog/i2c.c diff --git a/keyboards/bminiex/i2c.h b/keyboards/skog/i2c.h similarity index 100% rename from keyboards/bminiex/i2c.h rename to keyboards/skog/i2c.h diff --git a/keyboards/skog/info.json b/keyboards/skog/info.json new file mode 100644 index 00000000000..06fad3a741b --- /dev/null +++ b/keyboards/skog/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "skog", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5, "w":2}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.5, "y":2.5, "w":1.5}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5, "w":2.25}, {"x":0, "y":4.5, "w":2.25}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5, "w":1.25}, {"x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"x":10, "y":5.5, "w":1.25}, {"x":11.25, "y":5.5, "w":1.25}, {"x":12.5, "y":5.5, "w":1.25}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/skog/keymaps/default/keymap.c b/keyboards/skog/keymaps/default/keymap.c new file mode 100644 index 00000000000..eefc24cb0d6 --- /dev/null +++ b/keyboards/skog/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +/* +Copyright 2018 Jumail Mundekkat / MxBlue + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} diff --git a/keyboards/jj40/matrix.c b/keyboards/skog/matrix.c similarity index 100% rename from keyboards/jj40/matrix.c rename to keyboards/skog/matrix.c diff --git a/keyboards/skog/rules.mk b/keyboards/skog/rules.mk new file mode 100644 index 00000000000..bce0c442a6c --- /dev/null +++ b/keyboards/skog/rules.mk @@ -0,0 +1,55 @@ +# Copyright 2018 Jumail Mundekkat / MxBlue +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes + +BACKLIGHT_CUSTOM_DRIVER = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c backlight.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/skog/skog.c b/keyboards/skog/skog.c new file mode 100644 index 00000000000..3d1eb0e1a16 --- /dev/null +++ b/keyboards/skog/skog.c @@ -0,0 +1,98 @@ +/* +Copyright 2018 Jumail Mundekkat / MxBlue + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +ps2avrGB support code by Kenneth A. (bminiex/.[ch]) +*/ + +#include "skog.h" + +#include "rgblight.h" + +#include + +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" + +#include "backlight.h" +#include "backlight_custom.h" + +// for keyboard subdirectory level init functions +// @Override +void matrix_init_kb(void) { + // call user level keymaps, if any + matrix_init_user(); +} + +#ifdef BACKLIGHT_ENABLE +/// Overrides functions in `quantum.c` +void backlight_init_ports(void) { + b_led_init_ports(); +} + +void backlight_task(void) { + b_led_task(); +} + +void backlight_set(uint8_t level) { + b_led_set(level); +} +#endif + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i=0; i. +*/ + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K11, K31, K41, K51, K61, K81, K91, KA1, KB1, KC1, K01, KD1, K21, K20, K30, K00, \ + \ + K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, K02, KD2 , K70, K60, K50, \ + K13 , K23, K33, K43, K53, K63, K73, K83, K93, KA3, KB3, KC3, K03, KD3 , KD0, K90, K80, \ + K15 , K25, K35, K45, K55, K65, K75, K85, K95, KA5, KB5, KC5, K05 , \ + K16 , K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6 , K06, KD6, \ + K17 , K27 , K37 , K57 , K97 , KA7 , KB7 , KC7 , K07, KD7, K87 \ +){ \ + { K00, KC_NO, K20, K30, KC_NO, K50, K60, K70, K80, K90, KC_NO, KC_NO, KC_NO, KD0 }, \ + { K01, K11, K21, K31, K41, K51, K61, KC_NO, K81, K91, KA1, KB1, KC1, KD1 }, \ + { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, KD2 }, \ + { K03, K13, K23, K33, K43, K53, K63, K73, K83, K93, KA3, KB3, KC3, KD3 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K05, K15, K25, K35, K45, K55, K65, K75, K85, K95, KA5, KB5, KC5, KC_NO }, \ + { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6 }, \ + { K07, K17, K27, K37, KC_NO, K57, KC_NO, KC_NO, K87, K97, KA7, KB7, KC7, KD7 } \ +} diff --git a/keyboards/skog/usbconfig.h b/keyboards/skog/usbconfig.h new file mode 100644 index 00000000000..481d7c0b14e --- /dev/null +++ b/keyboards/skog/usbconfig.h @@ -0,0 +1,396 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'P','e','r','c','e','n','t' +#define USB_CFG_VENDOR_NAME_LEN 7 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'S','k','o','g',' ','T','K','L' +#define USB_CFG_DEVICE_NAME_LEN 8 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/smk60/config.h b/keyboards/smk60/config.h new file mode 100644 index 00000000000..b30912f9085 --- /dev/null +++ b/keyboards/smk60/config.h @@ -0,0 +1,53 @@ +/** + * config.h + * + */ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xDEAD +#define PRODUCT_ID 0x6585 +#define DEVICE_VER 0x0001 +#define MANUFACTURER astro +#define PRODUCT smk 60 +#define DESCRIPTION 60% keyboard for smk switch + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, F0, F1, F5, B2 } +#define MATRIX_COL_PINS { B4, B5, B6, C6, C7, F6, F7, F4, B1, B3, D0, D1, D2, D3, D5} +#define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +//rgb light setting +#define RGBLED_NUM 4 +#define RGB_DI_PIN E6 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/smk60/info.json b/keyboards/smk60/info.json new file mode 100644 index 00000000000..f4a5e42bdad --- /dev/null +++ b/keyboards/smk60/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "rgb60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_wkl": { + "key_count":61, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + "LAYOUT_60_ansi": { + "key_count":61, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_hhkb": { + "key_count":60, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}] + } + } +} diff --git a/keyboards/smk60/keymaps/60_ansi/keymap.c b/keyboards/smk60/keymaps/60_ansi/keymap.c new file mode 100644 index 00000000000..95d2fb0f262 --- /dev/null +++ b/keyboards/smk60/keymaps/60_ansi/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BSp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0| + * |-----------------------------------------------------------' + * |Ctrl |Gui|Alt | Space |Alt |Gui|Fn |Ctrl | + * `-----------------------------------------------------------' + */ + [0] = LAYOUT_60_ansi( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + [1] = LAYOUT_60_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______, + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______,_______, _______, _______,_______,_______,_______), +}; diff --git a/keyboards/smk60/keymaps/60_ansi_split_bs_shift/keymap.c b/keyboards/smk60/keymaps/60_ansi_split_bs_shift/keymap.c new file mode 100644 index 00000000000..095f98d151a --- /dev/null +++ b/keyboards/smk60/keymaps/60_ansi_split_bs_shift/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi_split_bs_shift( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_END, + KC_CAPS, KC_LGUI, KC_LALT, LT(1,KC_SPC), KC_RALT, KC_RGUI, TG(1), KC_RCTL), + [1] = LAYOUT_60_ansi_split_bs_shift( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,KC_PSCR, + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______, + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______,_______, _______, _______,_______,TG(0),_______), +}; diff --git a/keyboards/smk60/keymaps/60_hhkb/keymap.c b/keyboards/smk60/keymaps/60_hhkb/keymap.c new file mode 100644 index 00000000000..2732abc06bb --- /dev/null +++ b/keyboards/smk60/keymaps/60_hhkb/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_hhkb( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_BSLS, + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1)), + [1] = LAYOUT_60_hhkb( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,_______, + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______, _______, _______,_______), +}; diff --git a/keyboards/smk60/keymaps/60_iso/keymap.c b/keyboards/smk60/keymaps/60_iso/keymap.c new file mode 100644 index 00000000000..684bbb62f48 --- /dev/null +++ b/keyboards/smk60/keymaps/60_iso/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_iso( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_GRV, KC_ENT, + KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_CAPS, KC_LGUI, KC_LALT, LT(1,KC_SPC), KC_RALT, KC_RGUI, MO(1), KC_RCTL), + [1] = LAYOUT_60_iso( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______, + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT, _______,_______,_______,_______, + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______,_______, _______, _______,_______,_______,_______), +}; diff --git a/keyboards/smk60/keymaps/60_wkl/keymap.c b/keyboards/smk60/keymaps/60_wkl/keymap.c new file mode 100644 index 00000000000..979fc93d67a --- /dev/null +++ b/keyboards/smk60/keymaps/60_wkl/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_wkl( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC, + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_DEL, + KC_CAPS, KC_LGUI, KC_LALT, LT(1,KC_SPC), KC_RALT, TG(1), KC_RCTL), + [1] = LAYOUT_60_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,KC_DEL, + RESET, RGB_TOG, RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______, + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______,_______, _______, _______,TG(0),_______), +}; diff --git a/keyboards/smk60/keymaps/60_wkl_split_bs/keymap.c b/keyboards/smk60/keymaps/60_wkl_split_bs/keymap.c new file mode 100644 index 00000000000..22405cdc5f7 --- /dev/null +++ b/keyboards/smk60/keymaps/60_wkl_split_bs/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_wkl_split_bs( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_END, + KC_CAPS, KC_LGUI, KC_LALT, LT(1,KC_SPC), KC_RALT, TG(1), KC_RCTL), + [1] = LAYOUT_60_wkl_split_bs( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,KC_PSCR, + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______, + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______,_______, _______, _______,TG(0),_______), +}; diff --git a/keyboards/smk60/keymaps/default/keymap.c b/keyboards/smk60/keymaps/default/keymap.c new file mode 100644 index 00000000000..95d2fb0f262 --- /dev/null +++ b/keyboards/smk60/keymaps/default/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BSp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0| + * |-----------------------------------------------------------' + * |Ctrl |Gui|Alt | Space |Alt |Gui|Fn |Ctrl | + * `-----------------------------------------------------------' + */ + [0] = LAYOUT_60_ansi( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + [1] = LAYOUT_60_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______, + RESET, RGB_TOG,RGB_MOD,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RIGHT,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,_______,_______, _______, _______,_______,_______,_______), +}; diff --git a/keyboards/smk60/readme.md b/keyboards/smk60/readme.md new file mode 100644 index 00000000000..59470705c23 --- /dev/null +++ b/keyboards/smk60/readme.md @@ -0,0 +1,12 @@ +# 60% pcb for smk 2nd switch + +A gh60 campatible pcb for [smk 2nd switch](https://deskthority.net/wiki/SMK_second_generation) + +Keyboard Maintainer: [astro](https://github.com/yulei) +Hardware Supported: GH60 campatible + +Make example for this keyboard (after setting up your build environment): + + make smk60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/smk60/rules.mk b/keyboards/smk60/rules.mk new file mode 100644 index 00000000000..751dbec8411 --- /dev/null +++ b/keyboards/smk60/rules.mk @@ -0,0 +1,76 @@ +# MCU name +MCU = atmega32u4 + +# project specific files +#SRC = + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu +#OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +#OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +RGBLIGHT_ENABLE = yes # Use RGB bottom light +LAYOUTS = 60_ansi 60_hhkb 60_iso diff --git a/keyboards/smk60/smk60.c b/keyboards/smk60/smk60.c new file mode 100644 index 00000000000..947bec03a0d --- /dev/null +++ b/keyboards/smk60/smk60.c @@ -0,0 +1,5 @@ +/** + * smk60.c + */ + +#include "smk60.h" diff --git a/keyboards/smk60/smk60.h b/keyboards/smk60/smk60.h new file mode 100644 index 00000000000..2e71c965380 --- /dev/null +++ b/keyboards/smk60/smk60.h @@ -0,0 +1,98 @@ + /** + * smk60.h + * + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT_60_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ + k40, k42, k43, k47, k48, k49, k4a, k4b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, KC_NO, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, KC_NO, k28, k29, k2a, k2b, k2c, KC_NO, k2e}, \ + {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3c, KC_NO}, \ + {k40, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, k48, k49, KC_NO, k4a, k4b} \ +} + +#define LAYOUT_60_iso( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c,\ + k40, k42, k43, k47, k48, k49, k4a, k4b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, KC_NO, k17, k18, k19, k1a, k1b, k1c, KC_NO}, \ + {k20, k22, k23, k24, k25, k26, k27, KC_NO, k28, k29, k2a, k2b, k2c, k2d, k2e}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3c, KC_NO}, \ + {k40, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, k48, k49, KC_NO, k4a, k4b} \ +} + +#define LAYOUT_60_wkl( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k42, k43, k47, k49, k4a, k4b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, KC_NO, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, KC_NO, k28, k29, k2a, k2b, k2c, KC_NO, k2e}, \ + {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3c, k3d}, \ + {k40, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, KC_NO, k49, KC_NO, k4a, k4b} \ +} + +#define LAYOUT_60_hhkb( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k42, k43, k47, k49, k4a \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, KC_NO, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, KC_NO, k28, k29, k2a, k2b, k2c, KC_NO, k2e}, \ + {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3c, k3d}, \ + {KC_NO, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, KC_NO, k49, KC_NO, k4a, KC_NO} \ +} +#define LAYOUT_60_wkl_split_bs( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k42, k43, k47, k49, k4a, k4b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, KC_NO, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, KC_NO, k28, k29, k2a, k2b, k2c, KC_NO, k2e}, \ + {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3c, k3d}, \ + {k40, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, KC_NO, k49, KC_NO, k4a, k4b} \ +} +#define LAYOUT_60_ansi_split_bs_shift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k42, k43, k47, k48, k49, k4a, k4b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, KC_NO, k17, k18, k19, k1a, k1b, k1c, k1e}, \ + {k20, k22, k23, k24, k25, k26, k27, KC_NO, k28, k29, k2a, k2b, k2c, KC_NO, k2e}, \ + {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3c, k3d}, \ + {k40, k42, k43, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, KC_NO, k48, k49, KC_NO, k4a, k4b} \ +} diff --git a/keyboards/snagpad/config.h b/keyboards/snagpad/config.h new file mode 100644 index 00000000000..9503ae25f9d --- /dev/null +++ b/keyboards/snagpad/config.h @@ -0,0 +1,72 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4443 // "DC" = Don Chiou +#define PRODUCT_ID 0x5350 // "SP" = Snagpad +#define DEVICE_VER 0x0001 +#define MANUFACTURER Flehrad +#define PRODUCT Snagpad +#define DESCRIPTION A Pro Micro-Powered 5x4 macropad/numpad + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, D0, D4, C6, D7 } +#define MATRIX_COL_PINS { F4, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* prevent stuck modifiers */ +//#define STRICT_LAYER_RELEASE + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +// Does not use WT_MONO_BACKLIGHT +// #define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*5*4*2)) = (35+160) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 195 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 829 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 \ No newline at end of file diff --git a/keyboards/snagpad/info.json b/keyboards/snagpad/info.json new file mode 100644 index 00000000000..6e3ab601a0a --- /dev/null +++ b/keyboards/snagpad/info.json @@ -0,0 +1,56 @@ +{ + "keyboard_name": "Snagpad", + "url": "", + "maintainer": "Flehrad", + + "width": 4, + "height": 5, + "layouts": { + + "LAYOUT_ortho_5x4": { + "layout": [ + {"label":"Num Lock", "x":0, "y":0}, + {"label":"/", "x":1, "y":0}, + {"label":"*", "x":2, "y":0}, + {"label":"-", "x":3, "y":0}, + {"label":"7", "x":0, "y":1}, + {"label":"8", "x":1, "y":1}, + {"label":"9", "x":2, "y":1}, + {"label":"+", "x":3, "y":1}, + {"label":"4", "x":0, "y":2}, + {"label":"5", "x":1, "y":2}, + {"label":"6", "x":2, "y":2}, + {"label":"+", "x":3, "y":2}, + {"label":"1", "x":0, "y":3}, + {"label":"2", "x":1, "y":3}, + {"label":"3", "x":2, "y":3}, + {"label":"Enter", "x":3, "y":3}, + {"label":"0", "x":0, "y":4}, + {"label":"0", "x":1, "y":4}, + {"label":".", "x":2, "y":4}, + {"label":"Enter", "x":3, "y":4} + ] + }, + "LAYOUT_numpad_5x4": { + "layout": [ + {"label":"Num Lock", "x":0, "y":0}, + {"label":"/", "x":1, "y":0}, + {"label":"*", "x":2, "y":0}, + {"label":"-", "x":3, "y":0}, + {"label":"7", "x":0, "y":1}, + {"label":"8", "x":1, "y":1}, + {"label":"9", "x":2, "y":1}, + {"label":"4", "x":0, "y":2}, + {"label":"5", "x":1, "y":2}, + {"label":"6", "x":2, "y":2}, + {"label":"+", "x":3, "y":1, "h":2}, + {"label":"1", "x":0, "y":3}, + {"label":"2", "x":1, "y":3}, + {"label":"3", "x":2, "y":3}, + {"label":"0", "x":0, "y":4, "w":2}, + {"label":".", "x":2, "y":4}, + {"label":"Enter", "x":3, "y":3, "h":2} + ] + } + } +} diff --git a/keyboards/snagpad/keymaps/default/keymap.c b/keyboards/snagpad/keymaps/default/keymap.c new file mode 100644 index 00000000000..7645b435c14 --- /dev/null +++ b/keyboards/snagpad/keymaps/default/keymap.c @@ -0,0 +1,63 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ortho_5x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_P0, KC_P0, KC_PDOT, KC_PENT), + + LAYOUT_numpad_5x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, + KC_P0, KC_PDOT, KC_PENT), +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/snagpad/keymaps/via/keymap.c b/keyboards/snagpad/keymaps/via/keymap.c new file mode 100644 index 00000000000..7fa226de777 --- /dev/null +++ b/keyboards/snagpad/keymaps/via/keymap.c @@ -0,0 +1,76 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ortho_5x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_P0, KC_P0, KC_PDOT, KC_PENT), + + LAYOUT_ortho_5x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + LAYOUT_ortho_5x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + LAYOUT_ortho_5x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/snagpad/keymaps/via/rules.mk b/keyboards/snagpad/keymaps/via/rules.mk new file mode 100644 index 00000000000..032d68c5e96 --- /dev/null +++ b/keyboards/snagpad/keymaps/via/rules.mk @@ -0,0 +1,76 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + +# Boot Section Size in *bytes* +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +# This is the VIA magic +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +SRC += keyboards/wilba_tech/wt_main.c + +LAYOUTS = ortho_5x4 numpad_5x4 diff --git a/keyboards/snagpad/license b/keyboards/snagpad/license new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/keyboards/snagpad/license @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/keyboards/snagpad/readme.md b/keyboards/snagpad/readme.md new file mode 100644 index 00000000000..b59bd758860 --- /dev/null +++ b/keyboards/snagpad/readme.md @@ -0,0 +1,21 @@ +# Snagpad + +A five-row PCB that can be built as a standard numpad or an ortholinear 5x4 macropad. Can be built as single PCB with custom case, or as two PCB style with standoffs. Requires a Pro Micro. + +Keyboard Maintainer: [Flehrad](https://github.com/flehrad) +Hardware Supported: Snagpad PCB, Pro Micro +Hardware Availability: [GitHub](https://github.com/flehrad/Snagpad) + +Make example for this keyboard (after setting up your build environment): + + make snagpad:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +If you like this simple PCB and want to make a donation, you can do so at https://paypal.me/theboardpodcast. + +Check out our: + +- [YouTube](https://www.youtube.com/channel/UCg98oJZNffR9nDLJNkorjqw) +- [Podcast](https://podcasts.apple.com/au/podcast/theboard-mechanical-keyboard/id1147089749?mt=2) +- [Patreon](https://www.patreon.com/theboardpodcast) diff --git a/keyboards/snagpad/rules.mk b/keyboards/snagpad/rules.mk new file mode 100644 index 00000000000..624ed262ec7 --- /dev/null +++ b/keyboards/snagpad/rules.mk @@ -0,0 +1,65 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + +# Boot Section Size in *bytes* +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no +LAYOUTS = ortho_5x4 numpad_5x4 diff --git a/keyboards/snagpad/snagpad.c b/keyboards/snagpad/snagpad.c new file mode 100644 index 00000000000..ce7e50b387b --- /dev/null +++ b/keyboards/snagpad/snagpad.c @@ -0,0 +1 @@ +#include "snagpad.h" diff --git a/keyboards/snagpad/snagpad.h b/keyboards/snagpad/snagpad.h new file mode 100644 index 00000000000..f1e5e34e62a --- /dev/null +++ b/keyboards/snagpad/snagpad.h @@ -0,0 +1,30 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33, \ + K40, K41, K42, K43 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 } \ +} +#define LAYOUT_numpad_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, \ + K20, K21, K22, K13, \ + K30, K31, K32, \ + K40, K42, K33 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, KC_NO }, \ + { K30, K31, K32, K33 }, \ + { K40, KC_NO, K42, KC_NO } \ +} diff --git a/keyboards/snampad/config.h b/keyboards/snampad/config.h new file mode 100644 index 00000000000..a2dc3c6dd5d --- /dev/null +++ b/keyboards/snampad/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 Peter Tillemans + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Snamellit +#define PRODUCT snampad +#define DESCRIPTION A custom numerical keypad handwired in a 3D printed case. + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, B3 } +#define MATRIX_COL_PINS { D0, D1, D2, D3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/snampad/info.json b/keyboards/snampad/info.json new file mode 100644 index 00000000000..2974eab861a --- /dev/null +++ b/keyboards/snampad/info.json @@ -0,0 +1,35 @@ +{ + "keyboard_name": "snampad", + "url": "", + "maintainer": "ptillemans", + "width": 4, + "height": 6, + "layouts": { + "LAYOUT_numpad_6x4": { + "key_count": 21, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"Tab", "x":1, "y":0}, + {"label":"Fn", "x":2, "y":0}, + {"label":"Back", "x":3, "y":0}, + {"label":"Num Lock", "x":0, "y":1}, + {"label":"/", "x":1, "y":1}, + {"label":"*", "x":2, "y":1}, + {"label":"-", "x":3, "y":1}, + {"label":"7", "x":0, "y":2}, + {"label":"8", "x":1, "y":2}, + {"label":"9", "x":2, "y":2}, + {"label":"4", "x":0, "y":3}, + {"label":"5", "x":1, "y":3}, + {"label":"6", "x":2, "y":3}, + {"label":"+", "x":3, "y":2, "h":2}, + {"label":"1", "x":0, "y":4}, + {"label":"2", "x":1, "y":4}, + {"label":"3", "x":2, "y":4}, + {"label":"0", "x":0, "y":5, "w":2}, + {"label":".", "x":2, "y":5}, + {"label":"Enter", "x":3, "y":4, "h":2} + ] + } + } +} diff --git a/keyboards/snampad/keymaps/default/config.h b/keyboards/snampad/keymaps/default/config.h new file mode 100644 index 00000000000..d97bb38dda9 --- /dev/null +++ b/keyboards/snampad/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Peter Tillemans + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/snampad/keymaps/default/keymap.c b/keyboards/snampad/keymaps/default/keymap.c new file mode 100644 index 00000000000..6e887e52feb --- /dev/null +++ b/keyboards/snampad/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +/* Copyright 2019 Peter Tillemans + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_numpad_6x4( /* Base */ + KC_F1 , KC_F2 , KC_F3, KC_F4, + KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK , KC_KP_MINUS, + KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, + KC_KP_4, KC_KP_5, KC_KP_6, + KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, + KC_KP_0, KC_KP_DOT + + ), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/snampad/keymaps/default/readme.md b/keyboards/snampad/keymaps/default/readme.md new file mode 100644 index 00000000000..05eef58d4a8 --- /dev/null +++ b/keyboards/snampad/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for snampad \ No newline at end of file diff --git a/keyboards/snampad/readme.md b/keyboards/snampad/readme.md new file mode 100644 index 00000000000..dd9d9b0308a --- /dev/null +++ b/keyboards/snampad/readme.md @@ -0,0 +1,23 @@ +# snampad + +![snampad](https://imgur.com/gallery/tPDHeB9?s=fbm) + +A small weekend project to create a numeric keypad for the few times I need such a thing. +I created the schematics in Kicad, 3D printed the case, handwired the prototype, used some +spare Zealios, Box Royals and SA keycaps. + +When I get some time I'd like to make a PCB for it. + +It uses a promicro controller and the reset button has been made availabe through a hole in the backplate. + + +Keyboard Maintainer: [Peter Tillemans](https://github.com/ptillemans) +Hardware Supported: Promicros are ubiquitous. +Hardware Availability: This uses essentially spares from other projects + + +Make example for this keyboard (after setting up your build environment): + + make snampad:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/snampad/rules.mk b/keyboards/snampad/rules.mk new file mode 100644 index 00000000000..ec3208fd0e8 --- /dev/null +++ b/keyboards/snampad/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUTS = numpad_6x4 diff --git a/keyboards/snampad/snampad.c b/keyboards/snampad/snampad.c new file mode 100644 index 00000000000..c7a94245c40 --- /dev/null +++ b/keyboards/snampad/snampad.c @@ -0,0 +1,43 @@ +/* Copyright 2019 Peter Tillemans + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "snampad.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/snampad/snampad.h b/keyboards/snampad/snampad.h new file mode 100644 index 00000000000..ec7a779a4c0 --- /dev/null +++ b/keyboards/snampad/snampad.h @@ -0,0 +1,43 @@ +/* Copyright 2019 Peter Tillemans + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_numpad_6x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k23, \ + k40, k41, k42, \ + k51, k52, k43 \ +) \ +{ \ + { KC_NO, k51, k52 , KC_NO}, \ + { k40, k41, k42 , k43}, \ + { k30, k31, k32 , KC_NO}, \ + { k20, k21, k22 , k23}, \ + { k10, k11, k12 , k13}, \ + { k00, k01, k02 , k03} \ +} diff --git a/keyboards/southpole/config.h b/keyboards/southpole/config.h new file mode 100644 index 00000000000..396384040f1 --- /dev/null +++ b/keyboards/southpole/config.h @@ -0,0 +1,46 @@ +#pragma once + +//#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER u/waxpoetic +#define PRODUCT southpole +#define DESCRIPTION southpaw keyboard, left hand numpad + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 20 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D2, D3, C6, C7, D5 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, B7, D0, D1, F0, F1, F4, F5, F6, F7, B6, B5, B4, D7, D6, D4, E6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 0 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif \ No newline at end of file diff --git a/keyboards/southpole/keymaps/default/keymap.c b/keyboards/southpole/keymaps/default/keymap.c new file mode 100644 index 00000000000..78cb81f4ba6 --- /dev/null +++ b/keyboards/southpole/keymaps/default/keymap.c @@ -0,0 +1,26 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_NLCK, KC_SLSH, KC_ASTR, KC_MINS, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_HOME, \ + KC_7, KC_8, KC_9, KC_PLUS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ + KC_4, KC_5, KC_6, KC_ENT, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_1, KC_2, KC_3, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_END, \ + KC_0, KC_DOT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), \ + + LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RESET, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ) + +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} diff --git a/keyboards/southpole/keymaps/foobeard/keymap.c b/keyboards/southpole/keymaps/foobeard/keymap.c new file mode 100644 index 00000000000..ef2710d0a3b --- /dev/null +++ b/keyboards/southpole/keymaps/foobeard/keymap.c @@ -0,0 +1,72 @@ +/* +Base Copyright 2017 Luiz Ribeiro +Modified 2017 Andrew Novak +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public LicensezZZ +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +enum layers { + _QWERTY, + _RAISE +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0, default layer + * ,--------------------------------------------------------------------------------------------------------------------------------------------. + * |NumLck| / | * | - | | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ |Delete| Ins | + * |------+------+------+------+-+-------------------------------------------------------------------------------------------------------+------| + * | 7 | 8 | 9 | + | | Tab | Q | W | E | R | T | Y | U | I | O | P | { | } | BkSpc | Vol+ | + * |------+------+------+------+-+-------------------------------------------------------------------------------------------------------+------| + * | 4 | 5 | 6 | + | | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Return | Vol- | + * |------+------+------+------+-+-------------------------------------------------------------------------------------------------------+------| + * | 1 | 2 | 3 | En | | LShft | Z | X | C | V | B | N | M | , | . | / | RShft | Up | Mute | + * |------+------+------+------+-+----------------------------------------------------------------------------------------------+--------+------| + * | 0 | . | En | | Ctrl | Win | Alt | Space | Fn | | Left | Down | Right| + * `------+------+------+------+-+-------------------------------------------------------------------------------------------------------+------' + */ + [_QWERTY] = LAYOUT( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DELETE, KC_INS, \ + KC_P7, KC_P8, KC_P9, KC_PPLS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_VOLU, \ + KC_P4, KC_P5, KC_P6, KC_PENT, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_VOLD, \ + KC_P1, KC_P2, KC_P3, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_MUTE, \ + KC_P0, KC_PDOT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /*layer 1, function layer + * ,--------------------------------------------------------------------------------------------------------------------------------------------. + * |Reset | | | | | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | |Calc | + * |------+------+------+------+-+-------------------------------------------------------------------------------------------------------+------| + * | | | | | | | | | | | | | | | | | | | | | + * |------+------+------+------+-+-------------------------------------------------------------------------------------------------------+------| + * | | | | | | | | | | | | | | | | | | | | + * |------+------+------+------+-+-------------------------------------------------------------------------------------------------------+------| + * | | | | | | | | | | | | | | | | | | | | + * |------+------+------+------+-+----------------------------------------------------------------------------------------------+--------+------| + * | | | | | | | | | | | | | | + * `------+------+------+------+-+-------------------------------------------------------------------------------------------------------+------' + */ + + [_RAISE] = LAYOUT( + RESET, _______, _______, _______, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_CALC, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; \ No newline at end of file diff --git a/keyboards/southpole/readme.md b/keyboards/southpole/readme.md new file mode 100644 index 00000000000..4ea99ad349c --- /dev/null +++ b/keyboards/southpole/readme.md @@ -0,0 +1,13 @@ +# Southpole +[Southpole](https://imgur.com/a/MZ2wdYt) + +PCB designed by u/waxpoetic for a southpaw style board with an hhkb style layout. + +Keyboard Maintainer: ericduns +Hardware Supported: Teensy 2.0 + +Make example for this keyboard (after setting up your build environment): + + make southpole:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/southpole/rules.mk b/keyboards/southpole/rules.mk new file mode 100644 index 00000000000..356b75bb6cb --- /dev/null +++ b/keyboards/southpole/rules.mk @@ -0,0 +1,56 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +#AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/southpole/southpole.c b/keyboards/southpole/southpole.c new file mode 100644 index 00000000000..f345893fb50 --- /dev/null +++ b/keyboards/southpole/southpole.c @@ -0,0 +1 @@ +#include "southpole.h" diff --git a/keyboards/southpole/southpole.h b/keyboards/southpole/southpole.h new file mode 100644 index 00000000000..99cf2ce7b55 --- /dev/null +++ b/keyboards/southpole/southpole.h @@ -0,0 +1,18 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K119, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K219, \ + K300, K301, K302, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K319, \ + K401, K402, K404, K405, K406, K409, K413, K415, K416, K419 \ +) \ + { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K018, K019 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, KC_NO, K119 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, KC_NO, KC_NO, K219 }, \ + { K300, K301, K302, KC_NO, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, KC_NO, KC_NO, K319 }, \ + { KC_NO, K401, K402, KC_NO, K404, K405, K406, KC_NO, KC_NO, K409, KC_NO, KC_NO, KC_NO, K413, KC_NO, K415, K416, KC_NO, KC_NO, K419 } \ +} diff --git a/keyboards/spacetime/config.h b/keyboards/spacetime/config.h new file mode 100644 index 00000000000..26eb8dd26ae --- /dev/null +++ b/keyboards/spacetime/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2019 Kyle Terry + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x4A1F +#define MANUFACTURER Kyle Terry +#define PRODUCT spacetime +#define DESCRIPTION A split ortho keyboard with a 30 degree thumb cluster and support for oled + +/* key matrix size */ +#define MATRIX_ROWS 4*2 +#define MATRIX_COLS 7 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define USE_SERIAL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/spacetime/info.json b/keyboards/spacetime/info.json new file mode 100644 index 00000000000..3cb4414ed38 --- /dev/null +++ b/keyboards/spacetime/info.json @@ -0,0 +1,68 @@ +{ + "keyboard_name": "spacetime", + "url": "https://github.com/kyleterry/spacetime-keyboard", + "maintainer": "qmk", + "width": 14, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 50, + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"L06", "x":6, "y":0}, + {"label":"R00", "x":7, "y":0}, + {"label":"R01", "x":8, "y":0}, + {"label":"R02", "x":9, "y":0}, + {"label":"R03", "x":10, "y":0}, + {"label":"R04", "x":11, "y":0}, + {"label":"R05", "x":12, "y":0}, + {"label":"R06", "x":13, "y":0}, + + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"L16", "x":6, "y":1}, + {"label":"R10", "x":7, "y":1}, + {"label":"R11", "x":8, "y":1}, + {"label":"R12", "x":9, "y":1}, + {"label":"R13", "x":10, "y":1}, + {"label":"R14", "x":11, "y":1}, + {"label":"R15", "x":12, "y":1}, + {"label":"R16", "x":13, "y":1}, + + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"L26", "x":6, "y":2}, + {"label":"R20", "x":7, "y":2}, + {"label":"R21", "x":8, "y":2}, + {"label":"R22", "x":9, "y":2}, + {"label":"R23", "x":10, "y":2}, + {"label":"R24", "x":11, "y":2}, + {"label":"R25", "x":12, "y":2}, + {"label":"R26", "x":13, "y":2}, + + {"label":"L30", "x":0, "y":3, "w":1}, + {"label":"L34", "x":4, "y":3, "w":1}, + {"label":"L35", "x":5, "y":3, "w":2}, + {"label":"L36", "x":6, "y":3, "w":2}, + {"label":"R30", "x":7, "y":3, "w":2}, + {"label":"R31", "x":8, "y":3, "w":2}, + {"label":"R32", "x":9, "y":3, "w":1}, + {"label":"R36", "x":13, "y":3, "w":1} + ] + } + } +} + diff --git a/keyboards/spacetime/keymaps/default/config.h b/keyboards/spacetime/keymaps/default/config.h new file mode 100644 index 00000000000..26a960039d0 --- /dev/null +++ b/keyboards/spacetime/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 Kyle Terry + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/spacetime/keymaps/default/keymap.c b/keyboards/spacetime/keymaps/default/keymap.c new file mode 100644 index 00000000000..ac2f5098f24 --- /dev/null +++ b/keyboards/spacetime/keymaps/default/keymap.c @@ -0,0 +1,85 @@ +/* Copyright 2019 Kyle Terry + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +enum layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +/* layer template: + * [_LAYER] = LAYOUT( + * _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + * _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + * _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + * _______, _______, _______, _______, _______, _______, _______, _______ + * ), + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LCTL, KC_RCTL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LALT, KC_RALT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, KC_APP, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, KC_RGUI, KC_RCTL + ), + + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT( + _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, KC_INS, _______, KC_PSCR, _______, + _______, KC_HOME, KC_PGDN, KC_END, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/spacetime/keymaps/default/readme.md b/keyboards/spacetime/keymaps/default/readme.md new file mode 100644 index 00000000000..bcc95f4b7c9 --- /dev/null +++ b/keyboards/spacetime/keymaps/default/readme.md @@ -0,0 +1 @@ +# Spacetime Default Keymap diff --git a/keyboards/spacetime/keymaps/kyleterry/keymap.c b/keyboards/spacetime/keymaps/kyleterry/keymap.c new file mode 100644 index 00000000000..32fbab5e080 --- /dev/null +++ b/keyboards/spacetime/keymaps/kyleterry/keymap.c @@ -0,0 +1,151 @@ +/* Copyright 2019 Kyle Terry + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define NUM MO(_NUM) +#define CTL_ESC CTL_T(KC_ESC) +#define OS_LGUI OSM (MOD_LGUI) +#define SGAME TO(_GAMING) +#define SQWER TO(_QWERTY) + +enum layers { + _QWERTY, + _GAMING, + _LOWER, + _RAISE, + _ADJUST, + _NUM +}; + +enum { + /* tap dance for raise and lower layer switching */ + TD_RL = 0, + /* tap dance for common cording */ + TD_C = 1, + /* tap dance for media keys */ + TD_MD = 2, +}; + +/* layer template: + * [_LAYER] = LAYOUT( + * _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + * _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + * _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + * _______, _______, _______, _______, _______, _______, _______, _______ + * ), + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LCTL, TD(TD_C),KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LALT, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, NUM, OS_LGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, OS_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, OS_LGUI, KC_RALT + ), + + [_GAMING] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LCTL, TD(TD_C),KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_ESC, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, NUM, OS_LGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LALT, KC_V, KC_SPC, LOWER, RAISE, KC_SPC, OS_LGUI, KC_RALT + ), + + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LPRN, KC_RPRN, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, _______, _______, _______, _______, TD(TD_MD), KC_MNXT, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT( + _______, _______, KC_PGUP, _______, _______, _______, SQWER, _______, _______, _______, KC_INS, _______, KC_PSCR, _______, + _______, KC_HOME, KC_PGDN, KC_END, _______, _______, SGAME, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_NUM] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_ASTR, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, KC_MINS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOT, KC_1, KC_2, KC_3, KC_PLUS, + _______, _______, _______, _______, _______, _______, _______, KC_0 + ) +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} + +void td_common(qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + /* this case handles ctrl+o which is my tmux prefix + */ + tap_code16(C(KC_O)); + reset_tap_dance(state); + break; + case 2: + /* this case handles shift+insert which is a common way + * for me to paste text in linux + */ + tap_code16(S(KC_INS)); + reset_tap_dance(state); + break; + } +} + +void td_media(qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + tap_code16(KC_MPLY); + reset_tap_dance(state); + break; + case 2: + tap_code16(KC_MUTE); + reset_tap_dance(state); + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_C] = ACTION_TAP_DANCE_FN(td_common), + [TD_MD] = ACTION_TAP_DANCE_FN(td_media), +}; diff --git a/keyboards/spacetime/keymaps/kyleterry/rules.mk b/keyboards/spacetime/keymaps/kyleterry/rules.mk new file mode 100644 index 00000000000..31e0fcf2933 --- /dev/null +++ b/keyboards/spacetime/keymaps/kyleterry/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE=yes diff --git a/keyboards/spacetime/readme.md b/keyboards/spacetime/readme.md new file mode 100644 index 00000000000..94108baa268 --- /dev/null +++ b/keyboards/spacetime/readme.md @@ -0,0 +1,6 @@ +# Spacetime Keyboard + +A small split-design ortholinear board with a 30 degree thumb cluster and +a breakaway palm key on each side. + +PCB can be found on [GitHub](https://github.com/kyleterry/spacetime-keyboard) diff --git a/keyboards/spacetime/rev1/rev1.c b/keyboards/spacetime/rev1/rev1.c new file mode 100644 index 00000000000..6fde622c2ff --- /dev/null +++ b/keyboards/spacetime/rev1/rev1.c @@ -0,0 +1,40 @@ +/* Copyright 2019 Kyle Terry + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev1.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/spacetime/rev1/rev1.h b/keyboards/spacetime/rev1/rev1.h new file mode 100644 index 00000000000..dd54204561c --- /dev/null +++ b/keyboards/spacetime/rev1/rev1.h @@ -0,0 +1,48 @@ +/* Copyright 2019 Kyle Terry + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#define ___ KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L34, L35, L36, R30, R31, R32, R36 \ +) { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, ___, ___, ___, L34, L35, L36 }, \ +\ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, ___, ___, ___, R32, R31, R30 } \ +} + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/spacetime/rev1/rules.mk b/keyboards/spacetime/rev1/rules.mk new file mode 100644 index 00000000000..b595964f7ef --- /dev/null +++ b/keyboards/spacetime/rev1/rules.mk @@ -0,0 +1 @@ +OLED_DRIVER_ENABLE = no diff --git a/keyboards/spacetime/rev2/rev2.c b/keyboards/spacetime/rev2/rev2.c new file mode 100644 index 00000000000..6b62c071e47 --- /dev/null +++ b/keyboards/spacetime/rev2/rev2.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Kyle Terry + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev2.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { +#ifdef SSD1306OLED + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +#else + return process_record_user(keycode, record); +#endif +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/spacetime/rev2/rev2.h b/keyboards/spacetime/rev2/rev2.h new file mode 100644 index 00000000000..dd54204561c --- /dev/null +++ b/keyboards/spacetime/rev2/rev2.h @@ -0,0 +1,48 @@ +/* Copyright 2019 Kyle Terry + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#define ___ KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L34, L35, L36, R30, R31, R32, R36 \ +) { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, ___, ___, ___, L34, L35, L36 }, \ +\ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, ___, ___, ___, R32, R31, R30 } \ +} + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/spacetime/rev2/rules.mk b/keyboards/spacetime/rev2/rules.mk new file mode 100644 index 00000000000..c582662134c --- /dev/null +++ b/keyboards/spacetime/rev2/rules.mk @@ -0,0 +1 @@ +OLED_DRIVER_ENABLE = yes diff --git a/keyboards/spacetime/rules.mk b/keyboards/spacetime/rules.mk new file mode 100644 index 00000000000..62e8f9955e7 --- /dev/null +++ b/keyboards/spacetime/rules.mk @@ -0,0 +1,86 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +OLED_DRIVER_ENABLE = no + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = spacetime/rev1 diff --git a/keyboards/spacetime/spacetime.c b/keyboards/spacetime/spacetime.c new file mode 100644 index 00000000000..7db11f1bc44 --- /dev/null +++ b/keyboards/spacetime/spacetime.c @@ -0,0 +1 @@ +#include "spacetime.h" diff --git a/keyboards/spacetime/spacetime.h b/keyboards/spacetime/spacetime.h new file mode 100644 index 00000000000..0235c2b2542 --- /dev/null +++ b/keyboards/spacetime/spacetime.h @@ -0,0 +1,11 @@ +#pragma once + +#ifdef KEYBOARD_spacetime_rev1 + #include "rev1.h" +#endif + +#ifdef KEYBOARD_spacetime_rev2 + #include "rev2.h" +#endif + +#include "quantum.h" diff --git a/keyboards/speedo/config.h b/keyboards/speedo/config.h index 6d6a3f7c803..04195b8665d 100644 --- a/keyboards/speedo/config.h +++ b/keyboards/speedo/config.h @@ -47,16 +47,15 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B6, B5, D0, B7, B3, B2, B1, B0 } #define UNUSED_PINS { D5, D4, D6, D7, B4 } -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -106,11 +105,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/speedo/info.json b/keyboards/speedo/info.json index b0bb87b6e48..3f4b7b27997 100644 --- a/keyboards/speedo/info.json +++ b/keyboards/speedo/info.json @@ -4,7 +4,7 @@ "maintainer": "qmk", "bootloader": "", "width": 15, - "height": 6, + "height": 6.5, "layouts": { "LAYOUT": { "layout": [{"label":"k00", "x":0, "y":0.375}, {"label":"k01", "x":1, "y":0.375}, {"label":"k02", "x":2, "y":0.25}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0.25}, {"label":"k05", "x":5, "y":0.5}, {"label":"k06", "x":9, "y":0.5}, {"label":"k07", "x":10, "y":0.25}, {"label":"k08", "x":11, "y":0}, {"label":"k09", "x":12, "y":0.25}, {"label":"k10", "x":13, "y":0.375}, {"label":"k11", "x":14, "y":0.375}, {"label":"k12", "x":0, "y":1.375}, {"label":"k13", "x":1, "y":1.375}, {"label":"k14", "x":2, "y":1.25}, {"label":"k15", "x":3, "y":1}, {"label":"k16", "x":4, "y":1.25}, {"label":"k17", "x":5, "y":1.5}, {"label":"k18", "x":7, "y":2}, {"label":"k19", "x":9, "y":1.5}, {"label":"k20", "x":10, "y":1.25}, {"label":"k21", "x":11, "y":1}, {"label":"k22", "x":12, "y":1.25}, {"label":"k23", "x":13, "y":1.375}, {"label":"k24", "x":14, "y":1.375}, {"label":"k25", "x":0, "y":2.375}, {"label":"k26", "x":1, "y":2.375}, {"label":"k27", "x":2, "y":2.25}, {"label":"k28", "x":3, "y":2}, {"label":"k29", "x":4, "y":2.25}, {"label":"k30", "x":5, "y":2.5}, {"label":"k31", "x":7, "y":3}, {"label":"k32", "x":9, "y":2.5}, {"label":"k33", "x":10, "y":2.25}, {"label":"k34", "x":11, "y":2}, {"label":"k35", "x":12, "y":2.25}, {"label":"k36", "x":13, "y":2.375}, {"label":"k37", "x":14, "y":2.375}, {"label":"k38", "x":0, "y":3.375}, {"label":"k39", "x":1, "y":3.375}, {"label":"k40", "x":2, "y":3.25}, {"label":"k41", "x":3, "y":3}, {"label":"k42", "x":4, "y":3.25}, {"label":"k43", "x":5, "y":3.5}, {"label":"k44", "x":6.5, "y":4}, {"label":"k45", "x":7.5, "y":4}, {"label":"k46", "x":9, "y":3.5}, {"label":"k47", "x":10, "y":3.25}, {"label":"k48", "x":11, "y":3}, {"label":"k49", "x":12, "y":3.25}, {"label":"k50", "x":13, "y":3.375}, {"label":"k51", "x":14, "y":3.375}, {"label":"k52", "x":0, "y":4.375}, {"label":"k53", "x":1, "y":4.375}, {"label":"k54", "x":2, "y":4.25}, {"label":"k55", "x":3, "y":4}, {"label":"k56", "x":4, "y":4.25}, {"label":"k57", "x":5.5, "y":5}, {"label":"k58", "x":6.5, "y":5.5}, {"label":"k59", "x":7.5, "y":5.5}, {"label":"k60", "x":8.5, "y":5}, {"label":"k61", "x":10, "y":4.25}, {"label":"k62", "x":11, "y":4}, {"label":"k63", "x":12, "y":4.25}, {"label":"k64", "x":13, "y":4.375}, {"label":"k65", "x":14, "y":4.375}] diff --git a/keyboards/speedo/keymaps/default/config.h b/keyboards/speedo/keymaps/default/config.h index 112836e5e74..0ab49e8bc48 100644 --- a/keyboards/speedo/keymaps/default/config.h +++ b/keyboards/speedo/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/speedo/keymaps/default/keymap.c b/keyboards/speedo/keymaps/default/keymap.c index cd8c14e26b8..f5365b1223a 100644 --- a/keyboards/speedo/keymaps/default/keymap.c +++ b/keyboards/speedo/keymaps/default/keymap.c @@ -15,7 +15,6 @@ */ #include QMK_KEYBOARD_H -#define _______ KC_TRNS #define FN MO(_FN) #define TORST TO(_RESET) #define TODFT TO(_DEFAULT) @@ -56,26 +55,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void matrix_init_user(void) { } diff --git a/keyboards/speedo/readme.md b/keyboards/speedo/readme.md index ee94623acd1..882c16583d8 100644 --- a/keyboards/speedo/readme.md +++ b/keyboards/speedo/readme.md @@ -10,7 +10,7 @@ Make example for this keyboard (after setting up your build environment): make speedo:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Flashing the Firmware See the QMK docs for handwiring a keyboard; there is a section with instructions on how to flash the *.hex* file to the Teensy 2.0 controller. diff --git a/keyboards/speedo/rules.mk b/keyboards/speedo/rules.mk index 45eb6ee3766..6cba6b6b869 100644 --- a/keyboards/speedo/rules.mk +++ b/keyboards/speedo/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/standaside/config.h b/keyboards/standaside/config.h new file mode 100644 index 00000000000..80c9f8d21b2 --- /dev/null +++ b/keyboards/standaside/config.h @@ -0,0 +1,203 @@ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xF7E0 +#define PRODUCT_ID 0x0412 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Fate Everywhere +#define PRODUCT Stand Aside +#define DESCRIPTION A compact 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D1, F4, F6, F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { F5, D0, D4, C6, D7, E6, B4, B5 } +#define UNUSED_PINS {} + + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN C7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Enable RGB Underlighting + */ +#define RGB_DI_PIN C7 +#define RGBLED_NUM 12 +#define RGBLIGHT_ANIMATIONS + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/standaside/keymaps/default/config.h b/keyboards/standaside/keymaps/default/config.h new file mode 100644 index 00000000000..d533d806c90 --- /dev/null +++ b/keyboards/standaside/keymaps/default/config.h @@ -0,0 +1,5 @@ + + +#pragma once + +// place overrides here diff --git a/keyboards/standaside/keymaps/default/keymap.c b/keyboards/standaside/keymaps/default/keymap.c new file mode 100644 index 00000000000..0f13cb76329 --- /dev/null +++ b/keyboards/standaside/keymaps/default/keymap.c @@ -0,0 +1,77 @@ + +#include QMK_KEYBOARD_H + +#define _MAIN 0 +#define _RAISE 1 +#define _LOWER 2 + +// Readability keycodes +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +/* MAIN + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | TAB | Q | W | E | R | T | Y | U | I | O | P | Backsp | Delete | 7 | 8 | 9 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ESC | A | S | D | F | G | H | J | K | L | ; | ' | PgUp | 4 | 5 | 6 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENTER | PgDn | 1 | 2 | 3 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | PAUS | GUI | ALT | Lower | Space | Space | Raise | Left | Down | Up | Right | Shift | 0 | . | ENTER | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_MAIN] = LAYOUT_ortho_4x16( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_DEL, KC_KP_7, KC_KP_8, KC_KP_9, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_PGUP, KC_KP_4, KC_KP_5, KC_KP_6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_PGDN, KC_KP_1, KC_KP_2, KC_KP_3, + KC_LCTL, KC_PAUS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RSFT, KC_KP_0, KC_KP_DOT, KC_PENT + ), + +/* RAISE + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | Insert | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | - | = | [ | ] | \ | Home | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | PScr | End | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | Next | Vol- | Vol+ | Play | NumLok | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_RAISE] = LAYOUT_ortho_4x16( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_INS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_END, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, KC_NLCK, _______, _______, _______ + ), + +/* LOWER + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | RGBPWR | Mode | Reset | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | HUE+ | SAT+ | VAL+ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | | HUE- | SAT- | VAL- | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | Mute | | Plain | Rainbo | Larsen | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_LOWER] = LAYOUT_ortho_4x16( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, RGB_TOG, RGB_MOD, RESET, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, RGB_HUI, RGB_SAI, RGB_VAI, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, RGB_M_P, RGB_M_R, RGB_M_K + ), + +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/standaside/readme.md b/keyboards/standaside/readme.md new file mode 100644 index 00000000000..ca1cfb2763d --- /dev/null +++ b/keyboards/standaside/readme.md @@ -0,0 +1,15 @@ +# Stand Aside + +![Stand Aside](https://i.imgur.com/X6Katar.png) + +A compact 60% keyboard designed by Fate Everywhere. Born out of the desire for a Planck with a numpad for technical work. Available for sale (kit and completed) once the store comes up. + +Keyboard Maintainer: [Fate Everywhere](https://github.com/fateeverywhere) +Hardware Supported: Mark 3 Stand Aside. +Hardware Availability: Seven Store (https://store.7storm.org). + +Make example for this keyboard (after setting up your build environment): + + make standaside:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/standaside/rules.mk b/keyboards/standaside/rules.mk new file mode 100644 index 00000000000..a7ebc21fa48 --- /dev/null +++ b/keyboards/standaside/rules.mk @@ -0,0 +1,73 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel_dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +RGBLIGHT_ENABLE = yes # Enable RGB underlighting support + diff --git a/keyboards/standaside/standaside.c b/keyboards/standaside/standaside.c new file mode 100644 index 00000000000..904e92d335c --- /dev/null +++ b/keyboards/standaside/standaside.c @@ -0,0 +1,14 @@ + +#include "standaside.h" +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/standaside/standaside.h b/keyboards/standaside/standaside.h new file mode 100644 index 00000000000..b6616963979 --- /dev/null +++ b/keyboards/standaside/standaside.h @@ -0,0 +1,29 @@ + +#ifndef STANDASIDE_H +#define STANDASIDE_H + +#include "quantum.h" +#define ___ KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_ortho_4x16( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, K31, \ + K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K43, K44, K45, K46, K47, \ + K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K60, K61, K62, K63 \ +) \ +{ \ + { K00, K02, K04, K06, K08, K10, K12, K14 }, \ + { K01, K03, K05, K07, K09, K11, K13, K15 }, \ + { K16, K18, K20, K22, K24, K26, K28, K30 }, \ + { K17, K19, K21, K23, K25, K27, K29, K31 }, \ + { K32, K34, K36, K38, K40, K42, K44, K46 }, \ + { K33, K35, K37, K39, K41, K43, K45, K47 }, \ + { K48, K50, K52, K54, K56, K58, K60, K62 }, \ + { K49, K51, K53, K55, K57, K59, K61, K63 } \ +} + +#endif diff --git a/keyboards/staryu/backlight_staryu.c b/keyboards/staryu/backlight_staryu.c deleted file mode 100644 index 6fb9713f3a7..00000000000 --- a/keyboards/staryu/backlight_staryu.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "backlight.h" -#include - -/* backlighting */ -void init_backlight_led(void) -{ - DDRC |= (1< +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. -void init_backlight_led(void); +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. -void backlight_led_on(uint8_t index); +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once -void backlight_led_off(uint8_t index); +// Add backwards compatibility for existing keymaps +static inline void backlight_set_value(uint8_t index, uint8_t level) { + static const uint8_t backlight_pins[BACKLIGHT_LED_COUNT] = BACKLIGHT_PINS; + if (level) { + setPinOutput(backlight_pins[index]); + } else { + setPinInput(backlight_pins[index]); + } +} -#endif +#define backlight_led_off(i) backlight_set_value(i, 0) +#define backlight_led_on(i) backlight_set_value(i, 1) diff --git a/keyboards/staryu/config.h b/keyboards/staryu/config.h index 268fe991acf..dc7353fcce2 100755 --- a/keyboards/staryu/config.h +++ b/keyboards/staryu/config.h @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -28,47 +27,49 @@ along with this program. If not, see . #define DESCRIPTION 5-key macropad /* key matrix size */ -#define MATRIX_ROWS 1 -#define MATRIX_COLS 5 +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 /* key matrix pins */ -#define MATRIX_ROW_PINS { } -#define MATRIX_COL_PINS { D0, D1, D2, D3, D4 } +#define DIRECT_PINS { \ + { NO_PIN, D0, D1 }, \ + { D4, D3, D2 }, \ +} #define UNUSED_PINS -// from light_ws2812_config @ -// https://github.com/kairyu/tmk_keyboard_custom/tree/master/keyboard/staryu #define RGB_DI_PIN C6 -#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 1 // Number of LEDs +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_LIMIT_VAL 200 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW +#undef BACKLIGHT_PIN +#define BACKLIGHT_PINS { C2, C7, D5, D6, B0 } +#define BACKLIGHT_LED_COUNT 5 +#define BACKLIGHT_LEVELS 10 +#define BACKLIGHT_ON_STATE 1 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -// TODO backlighting -#define BACKLIGHT_LEVELS 10 -// #define BACKLIGHT_PIN B7 -/* -Backlight: C2, C7, D5, D6, B0 -switch (index) { - case 0: - PORTC &= ~(1<. */ #include QMK_KEYBOARD_H -#include "action_layer.h" enum layers { _LAYER0, _LAYER1, _LAYER2, - _LAYER3 + _LAYER3, + _LAYER4 }; +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_LAYER0] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + KC_UP, TO(_LAYER1), +/* ├─────────┼─────────┼─────────┤ */ + KC_LEFT, KC_DOWN, KC_RIGHT +/* └─────────┴─────────┴─────────┘ */ + ), + + [_LAYER1] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + KC_PGUP, TO(_LAYER2), +/* ├─────────┼─────────┼─────────┤ */ + KC_HOME, KC_PGDN, KC_END +/* └─────────┴─────────┴─────────┘ */ + ), + + [_LAYER2] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + KC_MSEL, TO(_LAYER3), +/* ├─────────┼─────────┼─────────┤ */ + KC_MPRV, KC_MPLY, KC_MNXT +/* └─────────┴─────────┴─────────┘ */ + ), + + [_LAYER3] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + KC_MS_U, TO(_LAYER4), +/* ├─────────┼─────────┼─────────┤ */ + KC_MS_L, KC_MS_D, KC_MS_R +/* └─────────┴─────────┴─────────┘ */ + ), + + [_LAYER4] = LAYOUT( +/* ┌─────────┬─────────┬─────────┐ */ + XXXXXXX, TO(_LAYER0), +/* ├─────────┼─────────┼─────────┤ */ + RGB_TOG, BL_TOGG, BL_STEP +/* └─────────┴─────────┴─────────┘ */ + ), -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { - /* Keymap 0 - * ,-----------. - * | |Up |Fn0| - * |---+---+---| - * |Lef|Dow|Rig| - * `-----------' - */ - LAYOUT( KC_UP, TO(_LAYER1), KC_LEFT,KC_DOWN,KC_RIGHT ), - /* Keymap 1 - * ,-----------. - * | |PgU|Fn1| - * |---+---+---| - * |Hom|PgD|End| - * `-----------' - */ - LAYOUT( KC_PGUP,TO(_LAYER2), KC_HOME,KC_PGDN,KC_END ), - /* Keymap 2 - * ,-----------. - * | |Sel|Fn2| - * |---+---+---| - * |Pre|Pla|Nex| - * `-----------' - */ - LAYOUT( KC_MSEL,TO(_LAYER3), KC_MPRV,KC_MPLY,KC_MNXT ), - /* Keymap 3 - * ,-----------. - * | |MsU|Fn3| - * |---+---+---| - * |MsL|MsD|MsR| - * `-----------' - */ - LAYOUT( KC_MS_U,TO(_LAYER0), KC_MS_L,KC_MS_D,KC_MS_R ), - // /* Keymap 4 - // * ,-----------. - // * | |Fn6|Fn4| - // * |---+---+---| - // * |Fn7|Fn5|Fn8| - // * `-----------' - // */ - // LAYOUT( FN6, FN4, FN7, FN5, FN8 ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} +void eeconfig_init_user(void) { + // use the non noeeprom versions, to write these values to EEPROM too + rgblight_enable(); + rgblight_mode(RGBLIGHT_MODE_BREATHING+1); -void matrix_init_user(void) { + backlight_enable(); } -void matrix_scan_user(void) { +void keyboard_post_init_user(void) { + //layer_state_set_user is not called for inital state - set it here + rgblight_sethsv_noeeprom_white(); } -void led_set_user(uint8_t usb_led) { +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _LAYER1: + rgblight_sethsv_noeeprom_cyan(); + break; + case _LAYER2: + rgblight_sethsv_noeeprom_magenta(); + break; + case _LAYER3: + rgblight_sethsv_noeeprom_red(); + break; + case _LAYER4: + rgblight_sethsv_noeeprom_orange(); + break; + case _LAYER0: + default: // for any other layers, or the default layer + rgblight_sethsv_noeeprom_white(); + break; + } + return state; } diff --git a/keyboards/staryu/keymaps/krusli/keymap.c b/keyboards/staryu/keymaps/krusli/keymap.c index c0fcd00d5d8..cdfa9fe8fed 100644 --- a/keyboards/staryu/keymaps/krusli/keymap.c +++ b/keyboards/staryu/keymaps/krusli/keymap.c @@ -58,9 +58,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; }; -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LAYER0] = LAYOUT( \ KC_ESC, TO(_LAYER1), \ diff --git a/keyboards/staryu/readme.md b/keyboards/staryu/readme.md index bca7482bc2d..1b2f9e8f531 100644 --- a/keyboards/staryu/readme.md +++ b/keyboards/staryu/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make staryu:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/staryu/rules.mk b/keyboards/staryu/rules.mk index 3e043bbcd5b..ad4873a39a0 100755 --- a/keyboards/staryu/rules.mk +++ b/keyboards/staryu/rules.mk @@ -1,10 +1,6 @@ # MCU name MCU = atmega32u2 -BOOTLOADER = lufa-dfu - -SRC = backlight_staryu.c - # Processor frequency. # This will define a symbol, F_CPU, in all source code files equal to the # processor frequency in Hz. You can then use this symbol in your source code to @@ -40,21 +36,43 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = lufa-dfu + -# Boot Section Size in *bytes* -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # In-switch LEDs -AUDIO_ENABLE = no # There is no available timer or pin for audio on the NovelPad -RGBLIGHT_ENABLE = yes # RGB LEDs for underglow, installed and enabled by default for the NovelPad +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/staryu/staryu.c b/keyboards/staryu/staryu.c index 6dcaaea0e85..4adadf20156 100755 --- a/keyboards/staryu/staryu.c +++ b/keyboards/staryu/staryu.c @@ -15,12 +15,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "staryu.h" -#include "backlight_staryu.h" - -// for keyboard subdirectory level init functions -// @Override -void matrix_init_kb(void) { - // call user level keymaps, if any - init_backlight_led(); - matrix_init_user(); -} diff --git a/keyboards/staryu/staryu.h b/keyboards/staryu/staryu.h index 12b8be92e71..bdce5806f73 100755 --- a/keyboards/staryu/staryu.h +++ b/keyboards/staryu/staryu.h @@ -14,15 +14,15 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef KB_H -#define KB_H +#pragma once + #include "quantum.h" +#define ___ KC_NO #define LAYOUT( \ - K00, K01, \ - K10, K11, K12 \ + K01, K02, \ + K10, K11, K12 \ ) { \ - { K00, K01, K12, K11, K10 }, \ + { ___, K01, K02 }, \ + { K10, K11, K12 } \ } - -#endif diff --git a/keyboards/subatomic/config.h b/keyboards/subatomic/config.h index 592434aabb0..f509ca53efb 100644 --- a/keyboards/subatomic/config.h +++ b/keyboards/subatomic/config.h @@ -52,18 +52,13 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/subatomic/keymaps/default/config.h b/keyboards/subatomic/keymaps/default/config.h index 4c61581993c..5352ef06c9f 100644 --- a/keyboards/subatomic/keymaps/default/config.h +++ b/keyboards/subatomic/keymaps/default/config.h @@ -1,7 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here /* * MIDI options @@ -25,5 +24,3 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#endif \ No newline at end of file diff --git a/keyboards/subatomic/keymaps/default/keymap.c b/keyboards/subatomic/keymaps/default/keymap.c index c5041f6e1fd..8def46961a1 100644 --- a/keyboards/subatomic/keymaps/default/keymap.c +++ b/keyboards/subatomic/keymaps/default/keymap.c @@ -1,9 +1,4 @@ -#include "subatomic.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -25,10 +20,6 @@ enum subatomic_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/suihankey/alpha/alpha.c b/keyboards/suihankey/alpha/alpha.c new file mode 100644 index 00000000000..3d2d1de7790 --- /dev/null +++ b/keyboards/suihankey/alpha/alpha.c @@ -0,0 +1,51 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "alpha.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/suihankey/alpha/alpha.h b/keyboards/suihankey/alpha/alpha.h new file mode 100644 index 00000000000..02bba471045 --- /dev/null +++ b/keyboards/suihankey/alpha/alpha.h @@ -0,0 +1,39 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the Leys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L00, L01, L02, L03, L04, \ + L10, L11, L12, L13, L14, \ + L20, L21, L22, L23, L24, \ + L30, L31, L32 \ +) \ +{ \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { L30, L31, L32 }, \ +} diff --git a/keyboards/suihankey/alpha/config.h b/keyboards/suihankey/alpha/config.h new file mode 100644 index 00000000000..f7f4aee1189 --- /dev/null +++ b/keyboards/suihankey/alpha/config.h @@ -0,0 +1,248 @@ +/* +Copyright 2019 kakunpc + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER kakunpc +#define PRODUCT Suihankey +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4 } +#define UNUSED_PINS +// #define USE_I2C +// #undef USE_SERIAL + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define SPLIT_HAND_PIN D2 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 18 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +// #define RGBLED_SPLIT {18,18} diff --git a/keyboards/suihankey/alpha/keymaps/default/config.h b/keyboards/suihankey/alpha/keymaps/default/config.h new file mode 100644 index 00000000000..bf1149ebc63 --- /dev/null +++ b/keyboards/suihankey/alpha/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/suihankey/alpha/keymaps/default/keymap.c b/keyboards/suihankey/alpha/keymaps/default/keymap.c new file mode 100644 index 00000000000..e7c7da4b8bd --- /dev/null +++ b/keyboards/suihankey/alpha/keymaps/default/keymap.c @@ -0,0 +1,100 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layers{ + BASE, + COMMAND, + NUMBER, + FUNCTION +}; + +#define KC_CMD_SP LT(COMMAND,KC_SPC) +#define KC_CMD_ET LT(COMMAND,KC_ENTER) +#define KC_NUM_ALT LT(NUMBER,KC_LALT) +#define KC_NUM_BS LT(NUMBER,KC_BSPC) +#define KC_SET_CTRL LT(FUNCTION,KC_LCTRL) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT( /* Base */ + KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_A, KC_S, KC_D, KC_F, KC_G, + KC_Z, KC_X, KC_C, KC_V, KC_B, + KC_SET_CTRL, KC_NUM_ALT, KC_CMD_SP + ), + [COMMAND] = LAYOUT( /* Base */ + KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_A, KC_S, KC_D, KC_F, KC_G, + LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_B), + KC_NO, KC_NO, KC_NO + ), + [NUMBER] = LAYOUT( /* Base */ + KC_1, KC_2, KC_3, KC_4, KC_5, + KC_6, KC_7, KC_8, KC_9, KC_0, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO + ), + [FUNCTION] = LAYOUT( /* Base */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + KC_F11, KC_F12, RGB_TOG, RGB_MOD, RGB_RMOD, + KC_NO, KC_NO, KC_NO + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} + +#ifdef OLED_DRIVER_ENABLE +void oled_task_user(void) { + oled_write_P(PSTR("Layer: "), false); + switch (biton32(layer_state)) { + case BASE: + oled_write_P(PSTR("Default\n"), false); + break; + case COMMAND: + oled_write_P(PSTR("COMMAND\n"), false); + break; + case NUMBER: + oled_write_P(PSTR("NUMBER\n"), false); + break; + case FUNCTION: + oled_write_P(PSTR("FUNCTION\n"), false); + break; + default: + // Or use the write_ln shortcut over adding 'n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + oled_write_P(IS_HOST_LED_ON(USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false); + oled_write_P(IS_HOST_LED_ON(USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false); + oled_write_P(IS_HOST_LED_ON(USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false); +} +#endif diff --git a/keyboards/suihankey/alpha/keymaps/default/readme.md b/keyboards/suihankey/alpha/keymaps/default/readme.md new file mode 100644 index 00000000000..95eac805a02 --- /dev/null +++ b/keyboards/suihankey/alpha/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for suihankey \ No newline at end of file diff --git a/keyboards/suihankey/alpha/readme.md b/keyboards/suihankey/alpha/readme.md new file mode 100644 index 00000000000..fcba60ff1d5 --- /dev/null +++ b/keyboards/suihankey/alpha/readme.md @@ -0,0 +1,18 @@ +# suihankey_alpha + +![suihankey_alpha](https://i.gyazo.com/07b9e882fd0c0ad00c8c98d93e94e383.jpg) + +Compact with only 18 keys is a concept keyboard. +Supports OLED and RGBLED (optional) + + + +Keyboard Maintainer: [kakunpc](https://github.com/kakunpc) +Hardware Supported: suihankey_alpha, promicro +Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) + +Make example for this keyboard (after setting up your build environment): + + make suihankey/alpha:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/suihankey/alpha/rules.mk b/keyboards/suihankey/alpha/rules.mk new file mode 100644 index 00000000000..d4580058ec2 --- /dev/null +++ b/keyboards/suihankey/alpha/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +OLED_DRIVER_ENABLE = yes +SPLIT_KEYBOARD = no diff --git a/keyboards/suihankey/info.json b/keyboards/suihankey/info.json new file mode 100644 index 00000000000..2306d75beca --- /dev/null +++ b/keyboards/suihankey/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "suihankey", + "url": "https://kakunpc.booth.pm/", + "maintainer": "kakunpc", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"label":"3", "x":3.5, "y":0}, {"label":"2", "x":2.5, "y":0.125}, {"label":"4", "x":4.5, "y":0.125}, {"label":"5", "x":5.5, "y":0.25}, {"label":"1", "x":1.5, "y":0.375}, {"label":"8", "x":3.5, "y":1}, {"label":"7", "x":2.5, "y":1.125}, {"label":"9", "x":4.5, "y":1.125}, {"label":"10", "x":5.5, "y":1.25}, {"label":"6", "x":1.5, "y":1.375}, {"label":"13", "x":3.5, "y":2}, {"label":"12", "x":2.5, "y":2.125}, {"label":"14", "x":4.5, "y":2.125}, {"label":"15", "x":5.5, "y":2.25}, {"label":"11", "x":1.5, "y":2.375}, {"label":"16", "x":-1.75, "y":3.125}, {"label":"17", "x":-0.75, "y":3.125}, {"label":"18", "x":0.25, "y":3.125}] + } + } +} diff --git a/keyboards/suihankey/readme.md b/keyboards/suihankey/readme.md new file mode 100644 index 00000000000..29d82323d3f --- /dev/null +++ b/keyboards/suihankey/readme.md @@ -0,0 +1,18 @@ +# suihankey + +![suihankey](https://i.gyazo.com/f798c5967f2ac457dd520ab8ff83b6ac.jpg) + +Compact with only 36 keys is a concept keyboard. +Supports OLED and RGBLED (optional) + + + +Keyboard Maintainer: [kakunpc](https://github.com/kakunpc) +Hardware Supported: suihankeyboard_alpha, promicro +Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) + +Make example for this keyboard (after setting up your build environment): + + make suihankey:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/suihankey/rev1/config.h b/keyboards/suihankey/rev1/config.h new file mode 100644 index 00000000000..4e14551257f --- /dev/null +++ b/keyboards/suihankey/rev1/config.h @@ -0,0 +1,248 @@ +/* +Copyright 2019 kakunpc + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER kakunpc +#define PRODUCT Suihankey +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7 } +#define UNUSED_PINS +//#define USE_I2C +//#undef USE_SERIAL + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define SPLIT_HAND_PIN D2 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 18 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +// #define RGBLED_SPLIT {18,18} diff --git a/keyboards/suihankey/rev1/keymaps/default/config.h b/keyboards/suihankey/rev1/keymaps/default/config.h new file mode 100644 index 00000000000..bf1149ebc63 --- /dev/null +++ b/keyboards/suihankey/rev1/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/suihankey/rev1/keymaps/default/keymap.c b/keyboards/suihankey/rev1/keymaps/default/keymap.c new file mode 100644 index 00000000000..e7c7da4b8bd --- /dev/null +++ b/keyboards/suihankey/rev1/keymaps/default/keymap.c @@ -0,0 +1,100 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layers{ + BASE, + COMMAND, + NUMBER, + FUNCTION +}; + +#define KC_CMD_SP LT(COMMAND,KC_SPC) +#define KC_CMD_ET LT(COMMAND,KC_ENTER) +#define KC_NUM_ALT LT(NUMBER,KC_LALT) +#define KC_NUM_BS LT(NUMBER,KC_BSPC) +#define KC_SET_CTRL LT(FUNCTION,KC_LCTRL) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT( /* Base */ + KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_A, KC_S, KC_D, KC_F, KC_G, + KC_Z, KC_X, KC_C, KC_V, KC_B, + KC_SET_CTRL, KC_NUM_ALT, KC_CMD_SP + ), + [COMMAND] = LAYOUT( /* Base */ + KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_A, KC_S, KC_D, KC_F, KC_G, + LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_B), + KC_NO, KC_NO, KC_NO + ), + [NUMBER] = LAYOUT( /* Base */ + KC_1, KC_2, KC_3, KC_4, KC_5, + KC_6, KC_7, KC_8, KC_9, KC_0, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO + ), + [FUNCTION] = LAYOUT( /* Base */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + KC_F11, KC_F12, RGB_TOG, RGB_MOD, RGB_RMOD, + KC_NO, KC_NO, KC_NO + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} + +#ifdef OLED_DRIVER_ENABLE +void oled_task_user(void) { + oled_write_P(PSTR("Layer: "), false); + switch (biton32(layer_state)) { + case BASE: + oled_write_P(PSTR("Default\n"), false); + break; + case COMMAND: + oled_write_P(PSTR("COMMAND\n"), false); + break; + case NUMBER: + oled_write_P(PSTR("NUMBER\n"), false); + break; + case FUNCTION: + oled_write_P(PSTR("FUNCTION\n"), false); + break; + default: + // Or use the write_ln shortcut over adding 'n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + oled_write_P(IS_HOST_LED_ON(USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false); + oled_write_P(IS_HOST_LED_ON(USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false); + oled_write_P(IS_HOST_LED_ON(USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false); +} +#endif diff --git a/keyboards/suihankey/rev1/keymaps/default/readme.md b/keyboards/suihankey/rev1/keymaps/default/readme.md new file mode 100644 index 00000000000..95eac805a02 --- /dev/null +++ b/keyboards/suihankey/rev1/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for suihankey \ No newline at end of file diff --git a/keyboards/suihankey/rev1/readme.md b/keyboards/suihankey/rev1/readme.md new file mode 100644 index 00000000000..1c80a8af63a --- /dev/null +++ b/keyboards/suihankey/rev1/readme.md @@ -0,0 +1,18 @@ +# suihankey_rev1 + +![suihankey_rev1](https://i.gyazo.com/07b9e882fd0c0ad00c8c98d93e94e383.jpg) + +Compact with only 18 keys is a concept keyboard. +Supports OLED and RGBLED (optional) + + + +Keyboard Maintainer: [kakunpc](https://github.com/kakunpc) +Hardware Supported: suihankey_rev1, promicro +Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) + +Make example for this keyboard (after setting up your build environment): + + make suihankey/rev1:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/suihankey/rev1/rev1.c b/keyboards/suihankey/rev1/rev1.c new file mode 100644 index 00000000000..f97e6caed42 --- /dev/null +++ b/keyboards/suihankey/rev1/rev1.c @@ -0,0 +1,51 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev1.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/suihankey/rev1/rev1.h b/keyboards/suihankey/rev1/rev1.h new file mode 100644 index 00000000000..cbc877abd55 --- /dev/null +++ b/keyboards/suihankey/rev1/rev1.h @@ -0,0 +1,40 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the Leys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L00, L01, L02, L03, L04, \ + L10, L11, L12, L13, L14, \ + L20, L21, L22, L23, L24, \ + L30, L31, L32 \ +) \ +{ \ + { L00, L10, L20, L30 }, \ + { L01, L11, L21, L31 }, \ + { L02, L12, L22, L32 }, \ + { L03, L13, L23, KC_NO }, \ + { L04, L14, L24, KC_NO }, \ +} diff --git a/keyboards/suihankey/rev1/rules.mk b/keyboards/suihankey/rev1/rules.mk new file mode 100644 index 00000000000..d4580058ec2 --- /dev/null +++ b/keyboards/suihankey/rev1/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +OLED_DRIVER_ENABLE = yes +SPLIT_KEYBOARD = no diff --git a/keyboards/suihankey/rules.mk b/keyboards/suihankey/rules.mk new file mode 100644 index 00000000000..dbba5b93c74 --- /dev/null +++ b/keyboards/suihankey/rules.mk @@ -0,0 +1,84 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +OLED_DRIVER_ENABLE = yes +SPLIT_KEYBOARD = no + +DEFAULT_FOLDER = suihankey/rev1 diff --git a/keyboards/suihankey/split/alpha/alpha.c b/keyboards/suihankey/split/alpha/alpha.c new file mode 100644 index 00000000000..3d2d1de7790 --- /dev/null +++ b/keyboards/suihankey/split/alpha/alpha.c @@ -0,0 +1,51 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "alpha.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/suihankey/split/alpha/alpha.h b/keyboards/suihankey/split/alpha/alpha.h new file mode 100644 index 00000000000..f14639806ea --- /dev/null +++ b/keyboards/suihankey/split/alpha/alpha.h @@ -0,0 +1,44 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the Leys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L00, L01, L02, L03, L04, R04, R03, R02, R01, R00, \ + L10, L11, L12, L13, L14, R14, R13, R12, R11, R10, \ + L20, L21, L22, L23, L24, R24, R23, R22, R21, R20, \ + L30, L31, L32, R32, R31, R30 \ +) \ +{ \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { L30, L31, L32 }, \ + { R00, R01, R02, R03, R04 }, \ + { R10, R11, R12, R13, R14 }, \ + { R20, R21, R22, R23, R24 }, \ + { R30, R31, R32 }, \ +} + diff --git a/keyboards/suihankey/split/alpha/config.h b/keyboards/suihankey/split/alpha/config.h new file mode 100644 index 00000000000..ed3d971be7d --- /dev/null +++ b/keyboards/suihankey/split/alpha/config.h @@ -0,0 +1,248 @@ +/* +Copyright 2019 kakunpc + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER kakunpc +#define PRODUCT Suihankey +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4 } +#define UNUSED_PINS +#define USE_I2C +#undef USE_SERIAL + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define SPLIT_HAND_PIN D2 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 18 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +// #define RGBLED_SPLIT {18,18} diff --git a/keyboards/suihankey/split/alpha/readme.md b/keyboards/suihankey/split/alpha/readme.md new file mode 100644 index 00000000000..2ea1503eb39 --- /dev/null +++ b/keyboards/suihankey/split/alpha/readme.md @@ -0,0 +1,18 @@ +# suihankey_alpha + +![suihankey_alpha](https://i.gyazo.com/f798c5967f2ac457dd520ab8ff83b6ac.jpg) + +Compact with only 36 keys is a concept keyboard. +Supports OLED and RGBLED (optional) + + + +Keyboard Maintainer: [kakunpc](https://github.com/kakunpc) +Hardware Supported: suihankey_alphaboard_alpha, promicro +Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) + +Make example for this keyboard (after setting up your build environment): + + make suihankey/alpha:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/suihankey/split/alpha/rules.mk b/keyboards/suihankey/split/alpha/rules.mk new file mode 100644 index 00000000000..974450a692f --- /dev/null +++ b/keyboards/suihankey/split/alpha/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +OLED_DRIVER_ENABLE = no +SPLIT_KEYBOARD = yes diff --git a/keyboards/suihankey/split/info.json b/keyboards/suihankey/split/info.json new file mode 100644 index 00000000000..c3825ac3aca --- /dev/null +++ b/keyboards/suihankey/split/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "suihankey_split", + "url": "https://kakunpc.booth.pm/", + "maintainer": "kakunpc", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"label":"1", "x":0, "y":0}, {"label":"2", "x":1, "y":0}, {"label":"3", "x":2, "y":0}, {"label":"4", "x":3, "y":0}, {"label":"5", "x":4, "y":0}, {"label":"19", "x":7, "y":0}, {"label":"20", "x":8, "y":0}, {"label":"21", "x":9, "y":0}, {"label":"22", "x":10, "y":0}, {"label":"23", "x":11, "y":0}, {"label":"6", "x":0, "y":1}, {"label":"7", "x":1, "y":1}, {"label":"8", "x":2, "y":1}, {"label":"9", "x":3, "y":1}, {"label":"10", "x":4, "y":1}, {"label":"24", "x":7, "y":1}, {"label":"25", "x":8, "y":1}, {"label":"26", "x":9, "y":1}, {"label":"27", "x":10, "y":1}, {"label":"28", "x":11, "y":1}, {"label":"11", "x":0, "y":2}, {"label":"12", "x":1, "y":2}, {"label":"13", "x":2, "y":2}, {"label":"14", "x":3, "y":2}, {"label":"15", "x":4, "y":2}, {"label":"29", "x":7, "y":2}, {"label":"30", "x":8, "y":2}, {"label":"31", "x":9, "y":2}, {"label":"32", "x":10, "y":2}, {"label":"33", "x":11, "y":2}, {"label":"16", "x":2, "y":3}, {"label":"17", "x":3, "y":3}, {"label":"18", "x":4, "y":3}, {"label":"34", "x":7, "y":3}, {"label":"35", "x":8, "y":3}, {"label":"36", "x":9, "y":3}] + } + } +} diff --git a/keyboards/suihankey/split/keymaps/default/config.h b/keyboards/suihankey/split/keymaps/default/config.h new file mode 100644 index 00000000000..bf1149ebc63 --- /dev/null +++ b/keyboards/suihankey/split/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/suihankey/split/keymaps/default/keymap.c b/keyboards/suihankey/split/keymaps/default/keymap.c new file mode 100644 index 00000000000..9b8448ac277 --- /dev/null +++ b/keyboards/suihankey/split/keymaps/default/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layers{ + BASE, + COMMAND, + NUMBER, + SETTING +}; + +#define KC_CMD_SP LT(COMMAND,KC_SPC) +#define KC_CMD_ET LT(COMMAND,KC_ENTER) +#define KC_NUM_ALT LT(NUMBER,KC_LALT) +#define KC_NUM_BS LT(NUMBER,KC_BSPC) +#define KC_SET_CTRL LT(SETTING,KC_LCTRL) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT( /* Base */ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, + KC_SET_CTRL, KC_NUM_ALT, KC_CMD_SP, KC_CMD_ET, KC_BSPC, KC_LSFT + ), + [COMMAND] = LAYOUT( /* Base */ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_B), KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ), + [NUMBER] = LAYOUT( /* Base */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_P7, KC_P8, KC_P9, KC_NO, KC_NO, + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_P4, KC_P5, KC_P6, KC_NO, KC_NO, + KC_F11, KC_F12, KC_NO, KC_NO, KC_NO, KC_P1, KC_P2, KC_P3, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_P0, KC_PDOT, KC_NO + ), + [SETTING] = LAYOUT( /* Base */ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/suihankey/split/keymaps/default/readme.md b/keyboards/suihankey/split/keymaps/default/readme.md new file mode 100644 index 00000000000..43ede895269 --- /dev/null +++ b/keyboards/suihankey/split/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default split keymap for suihankey diff --git a/keyboards/suihankey/split/readme.md b/keyboards/suihankey/split/readme.md new file mode 100644 index 00000000000..34d30580d12 --- /dev/null +++ b/keyboards/suihankey/split/readme.md @@ -0,0 +1,18 @@ +# suihankey split + +![suihankey](https://i.gyazo.com/f798c5967f2ac457dd520ab8ff83b6ac.jpg) + +Compact with only 36 keys is a concept keyboard. +Supports OLED and RGBLED (optional) + + + +Keyboard Maintainer: [kakunpc](https://github.com/kakunpc) +Hardware Supported: suihankeyboard_alpha, promicro +Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) + +Make example for this keyboard (after setting up your build environment): + + make suihankey/split:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/suihankey/split/rev1/config.h b/keyboards/suihankey/split/rev1/config.h new file mode 100644 index 00000000000..04ed0ba50de --- /dev/null +++ b/keyboards/suihankey/split/rev1/config.h @@ -0,0 +1,248 @@ +/* +Copyright 2019 kakunpc + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER kakunpc +#define PRODUCT Suihankey +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7 } +#define UNUSED_PINS +#define USE_I2C +#undef USE_SERIAL + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define SPLIT_HAND_PIN D2 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 18 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +// #define RGBLED_SPLIT {18,18} diff --git a/keyboards/suihankey/split/rev1/readme.md b/keyboards/suihankey/split/rev1/readme.md new file mode 100644 index 00000000000..f7c4bce166d --- /dev/null +++ b/keyboards/suihankey/split/rev1/readme.md @@ -0,0 +1,18 @@ +# suihankey_rev1 + +![suihankey_rev1](https://i.gyazo.com/f798c5967f2ac457dd520ab8ff83b6ac.jpg) + +Compact with only 36 keys is a concept keyboard. +Supports OLED and RGBLED (optional) + + + +Keyboard Maintainer: [kakunpc](https://github.com/kakunpc) +Hardware Supported: suihankey_rev1board_rev1, promicro +Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) + +Make example for this keyboard (after setting up your build environment): + + make suihankey/rev1:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/suihankey/split/rev1/rev1.c b/keyboards/suihankey/split/rev1/rev1.c new file mode 100644 index 00000000000..f97e6caed42 --- /dev/null +++ b/keyboards/suihankey/split/rev1/rev1.c @@ -0,0 +1,51 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev1.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/keyboards/suihankey/split/rev1/rev1.h b/keyboards/suihankey/split/rev1/rev1.h new file mode 100644 index 00000000000..bf5468234d0 --- /dev/null +++ b/keyboards/suihankey/split/rev1/rev1.h @@ -0,0 +1,45 @@ +/* Copyright 2019 kakunpc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the Leys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L00, L01, L02, L03, L04, R04, R03, R02, R01, R00, \ + L10, L11, L12, L13, L14, R14, R13, R12, R11, R10, \ + L20, L21, L22, L23, L24, R24, R23, R22, R21, R20, \ + L30, L31, L32, R32, R31, R30 \ +) \ +{ \ + { L00, L10, L20, L30 }, \ + { L01, L11, L21, L31 }, \ + { L02, L12, L22, L32 }, \ + { L03, L13, L23, KC_NO }, \ + { L04, L14, L24, KC_NO }, \ + { R00, R10, R20, R30 }, \ + { R01, R11, R21, R31 }, \ + { R02, R12, R22, R32 }, \ + { R03, R13, R23, KC_NO }, \ + { R04, R14, R24, KC_NO }, \ +} diff --git a/keyboards/suihankey/split/rev1/rules.mk b/keyboards/suihankey/split/rev1/rules.mk new file mode 100644 index 00000000000..974450a692f --- /dev/null +++ b/keyboards/suihankey/split/rev1/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +OLED_DRIVER_ENABLE = no +SPLIT_KEYBOARD = yes diff --git a/keyboards/suihankey/split/rules.mk b/keyboards/suihankey/split/rules.mk new file mode 100644 index 00000000000..b5d2dc8e810 --- /dev/null +++ b/keyboards/suihankey/split/rules.mk @@ -0,0 +1,4 @@ +OLED_DRIVER_ENABLE = no +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = suihankey/split/rev1 diff --git a/keyboards/sx60/config.h b/keyboards/sx60/config.h index 52a1cc7a18e..d75e19b2900 100755 --- a/keyboards/sx60/config.h +++ b/keyboards/sx60/config.h @@ -21,8 +21,6 @@ #define MATRIX_COL_PINS { F6, B5, B4, D7, D6, D5, D3, D2 } #define UNUSED_PINS - - /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW @@ -33,7 +31,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -41,11 +39,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/sx60/keymaps/default/config.h b/keyboards/sx60/keymaps/default/config.h index a5568e400de..271f48d0011 100644 --- a/keyboards/sx60/keymaps/default/config.h +++ b/keyboards/sx60/keymaps/default/config.h @@ -1 +1,3 @@ -#include "../../config.h" +#pragma once + +// place overrides here diff --git a/keyboards/sx60/matrix.c b/keyboards/sx60/matrix.c index e91b4f44188..e8e9d6574e8 100644 --- a/keyboards/sx60/matrix.c +++ b/keyboards/sx60/matrix.c @@ -30,11 +30,11 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -137,7 +137,7 @@ void matrix_init(void) { uint8_t matrix_scan(void) { - if (mcp23018_status) { + if (mcp23018_status) { /* if there was an error */ if (++mcp23018_reset_loop == 0) { /* since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans @@ -154,7 +154,7 @@ uint8_t matrix_scan(void) /* Set row, read cols */ for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); if (matrix_changed) { @@ -166,8 +166,8 @@ uint8_t matrix_scan(void) # endif } -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } @@ -181,7 +181,7 @@ uint8_t matrix_scan(void) bool matrix_is_modified(void) { -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) if (debouncing) return false; #endif return true; @@ -190,7 +190,7 @@ bool matrix_is_modified(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4705 +#define PRODUCT_ID 0x7465 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Maartenwut +#define PRODUCT TA-65 +#define DESCRIPTION A universal 65% PCB with underglow. + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS {B4,D7,D6,D4,B3} +#define MATRIX_COL_PINS {D2,D1,D0,D3,D5,C7,C6,B6,B5,F0,F1,F4,F5,F6,F7,B0} +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* Backlight configuration + */ +#define RGB_DI_PIN E6 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 + +#define QMK_ESC_OUTPUT D2 // usually COL +#define QMK_ESC_INPUT B4 // usually ROW +#define QMK_LED E6 diff --git a/keyboards/ta65/info.json b/keyboards/ta65/info.json new file mode 100644 index 00000000000..e509521d4da --- /dev/null +++ b/keyboards/ta65/info.json @@ -0,0 +1,372 @@ +{ + "keyboard_name": "ta65", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"|", "x":13, "y":0}, + {"label":"Backspace", "x":14, "y":0}, + {"label":"~", "x":15, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Non-US Hash", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":1.25}, + {"label":"PgUp", "x":15, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"Non-US Backslash", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Up", "x":14, "y":3}, + {"label":"PgDn", "x":15, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4}, + {"label":"Win", "x":11, "y":4}, + {"label":"Ctrl", "x":12, "y":4}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4} + ] + }, + "LAYOUT_65_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"~", "x":15, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"PgUp", "x":15, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Up", "x":14, "y":3}, + {"label":"PgDn", "x":15, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4}, + {"label":"Win", "x":11, "y":4}, + {"label":"Ctrl", "x":12, "y":4}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4} + ] + }, + "LAYOUT_ansi_tsangan": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"|", "x":13, "y":0}, + {"label":"Backspace", "x":14, "y":0}, + {"label":"~", "x":15, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"PgUp", "x":15, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Up", "x":14, "y":3}, + {"label":"PgDn", "x":15, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.5}, + {"label":"Win", "x":1.5, "y":4}, + {"label":"Alt", "x":2.5, "y":4, "w":1.5}, + {"label":"Space", "x":4, "y":4, "w":7}, + {"label":"Alt", "x":11, "y":4, "w":1.5}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4} + ] + }, + "LAYOUT_65_iso": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"\"", "x":2, "y":0}, + {"label":"\u00a3", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"\u00ac", "x":15, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"@", "x":11.75, "y":2}, + {"label":"~", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"PgUp", "x":15, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"|", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Up", "x":14, "y":3}, + {"label":"PgDn", "x":15, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"AltGr", "x":10, "y":4}, + {"label":"Win", "x":11, "y":4}, + {"label":"Ctrl", "x":12, "y":4}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4} + ] + }, + "LAYOUT_iso_tsangan": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"\"", "x":2, "y":0}, + {"label":"\u00a3", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"~", "x":13, "y":0}, + {"label":"Backspace", "x":14, "y":0}, + {"label":"\u00ac", "x":15, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"{", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"@", "x":11.75, "y":2}, + {"label":"~", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"PgUp", "x":15, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"|", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Up", "x":14, "y":3}, + {"label":"PgDn", "x":15, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.5}, + {"label":"Win", "x":1.5, "y":4}, + {"label":"Alt", "x":2.5, "y":4, "w":1.5}, + {"label":"Space", "x":4, "y":4, "w":7}, + {"label":"AltGr", "x":11, "y":4, "w":1.5}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4} + ] + } + } +} diff --git a/keyboards/ta65/keymaps/default/keymap.c b/keyboards/ta65/keymaps/default/keymap.c new file mode 100644 index 00000000000..b04172c7590 --- /dev/null +++ b/keyboards/ta65/keymaps/default/keymap.c @@ -0,0 +1,17 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _MA 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_PGUP, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT) +}; diff --git a/keyboards/ta65/keymaps/default_ansi/keymap.c b/keyboards/ta65/keymaps/default_ansi/keymap.c new file mode 100644 index 00000000000..9319d5bbacf --- /dev/null +++ b/keyboards/ta65/keymaps/default_ansi/keymap.c @@ -0,0 +1,17 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _MA 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_65_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) +}; diff --git a/keyboards/ta65/keymaps/default_ansi_tsangan/keymap.c b/keyboards/ta65/keymaps/default_ansi_tsangan/keymap.c new file mode 100644 index 00000000000..5e0cd0b553f --- /dev/null +++ b/keyboards/ta65/keymaps/default_ansi_tsangan/keymap.c @@ -0,0 +1,17 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _MA 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_ansi_tsangan( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT) +}; diff --git a/keyboards/ta65/keymaps/default_iso/keymap.c b/keyboards/ta65/keymaps/default_iso/keymap.c new file mode 100644 index 00000000000..1d11ff95843 --- /dev/null +++ b/keyboards/ta65/keymaps/default_iso/keymap.c @@ -0,0 +1,17 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _MA 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_65_iso( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_PGUP, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) +}; diff --git a/keyboards/ta65/keymaps/default_iso_tsangan/keymap.c b/keyboards/ta65/keymaps/default_iso_tsangan/keymap.c new file mode 100644 index 00000000000..8505d73afd1 --- /dev/null +++ b/keyboards/ta65/keymaps/default_iso_tsangan/keymap.c @@ -0,0 +1,17 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _MA 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_iso_tsangan( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_PGUP, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT) +}; diff --git a/keyboards/ta65/keymaps/maartenwut/config.h b/keyboards/ta65/keymaps/maartenwut/config.h new file mode 100644 index 00000000000..9b18f58269e --- /dev/null +++ b/keyboards/ta65/keymaps/maartenwut/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define RETRO_TAPPING diff --git a/keyboards/ta65/keymaps/maartenwut/keymap.c b/keyboards/ta65/keymaps/maartenwut/keymap.c new file mode 100644 index 00000000000..a8ce0f180ea --- /dev/null +++ b/keyboards/ta65/keymaps/maartenwut/keymap.c @@ -0,0 +1,45 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum { + _MA, + _GA, + _FL, + _SP +}; + +#define SPACE LT(_SP, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_65_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MPLY, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_CAPS, KC_LGUI, KC_LALT, SPACE, KC_RALT, KC_RCTRL,MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), + +[_GA] = LAYOUT_65_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, _______), + +[_FL] = LAYOUT_65_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, KC_PSCR, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, TG(_GA), _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + +[_SP] = LAYOUT_65_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; diff --git a/keyboards/ta65/readme.md b/keyboards/ta65/readme.md new file mode 100644 index 00000000000..48ba9ee0fe4 --- /dev/null +++ b/keyboards/ta65/readme.md @@ -0,0 +1,17 @@ +TA-65 +===== + +A 65% PCB designed to fit the TADA68, Kayak and others by [maartenwut](https://maartenwut.com). + +![kle](https://maartenwut.com/wp-content/uploads/2019/02/ta-65-layouts-768x420.png) + +Keyboard Maintainer: QMK Community
+Hardware Supported: TA-65 PCB
+Hardware Availability: [maartenwut.com](https://maartenwut.com/product/ta-65/)
+ +Make example for this keyboard (after setting up your build environment): + + make ta65:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + diff --git a/keyboards/ta65/rules.mk b/keyboards/ta65/rules.mk new file mode 100644 index 00000000000..47207cd46d8 --- /dev/null +++ b/keyboards/ta65/rules.mk @@ -0,0 +1,65 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = qmk-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID + +LAYOUTS = 65_ansi 65_iso diff --git a/keyboards/ta65/ta65.c b/keyboards/ta65/ta65.c new file mode 100644 index 00000000000..4f67a0203da --- /dev/null +++ b/keyboards/ta65/ta65.c @@ -0,0 +1,13 @@ +#include "ta65.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; diff --git a/keyboards/ta65/ta65.h b/keyboards/ta65/ta65.h new file mode 100644 index 00000000000..273acf9ad39 --- /dev/null +++ b/keyboards/ta65/ta65.h @@ -0,0 +1,82 @@ +#pragma once +#include "quantum.h" + +// readability +#define ___ KC_NO +#define LAYOUT_all( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0f, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ + k40, k41, k42, k46, k49, k4a, k4b, k4c, k4d, k4e \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, ___}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, ___}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, ___}, \ + {k40, k41, k42, ___, ___, ___, k46, ___, ___, k49, k4a, k4b, k4c, k4d, k4e, ___} \ +} + +#define LAYOUT_65_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ + k40, k41, k42, k46, k49, k4a, k4b, k4c, k4d, k4e \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, ___}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, ___}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, ___, k2d, k2e, ___}, \ + {k30, ___, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, ___}, \ + {k40, k41, k42, ___, ___, ___, k46, ___, ___, k49, k4a, k4b, k4c, k4d, k4e, ___} \ +} + +#define LAYOUT_ansi_tsangan( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0f, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ + k40, k41, k42, k46, k49, k4c, k4d, k4e \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, ___}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, ___, k2d, k2e, ___}, \ + {k30, ___, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, ___}, \ + {k40, k41, k42, ___, ___, ___, k46, ___, ___, k49, ___, ___, k4c, k4d, k4e, ___} \ +} + +#define LAYOUT_iso_tsangan( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0f, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ + k40, k41, k42, k46, k49, k4c, k4d, k4e \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, ___, k1e, ___}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, ___}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, ___}, \ + {k40, k41, k42, ___, ___, ___, k46, ___, ___, k49, ___, ___, k4c, k4d, k4e, ___} \ +} + +#define LAYOUT_65_iso( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ + k40, k41, k42, k46, k49, k4a, k4b, k4c, k4d, k4e \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, ___}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, ___}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, ___}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, ___}, \ + {k40, k41, k42, ___, ___, ___, k46, ___, ___, k49, k4a, k4b, k4c, k4d, k4e, ___} \ +} + +void matrix_init_user(void); +void matrix_scan_user(void); diff --git a/keyboards/tada68/config.h b/keyboards/tada68/config.h index 3e011bc7543..a8fa37a5b70 100755 --- a/keyboards/tada68/config.h +++ b/keyboards/tada68/config.h @@ -47,18 +47,13 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Backlight configuration */ #define BACKLIGHT_LEVELS 4 diff --git a/keyboards/tada68/keymaps/abishalom/config.h b/keyboards/tada68/keymaps/abishalom/config.h new file mode 100644 index 00000000000..af01528b434 --- /dev/null +++ b/keyboards/tada68/keymaps/abishalom/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define BACKLIGHT_BREATHING diff --git a/keyboards/tada68/keymaps/abishalom/keymap.c b/keyboards/tada68/keymaps/abishalom/keymap.c new file mode 100644 index 00000000000..94217948e03 --- /dev/null +++ b/keyboards/tada68/keymaps/abishalom/keymap.c @@ -0,0 +1,96 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 +#define _NL 2 + +#define SEMI_FN LT(_FL, KC_SCLN) + +//Tap Dance Declarations +enum { + TD_WIN_LOCK = 0 +}; + +//BL_BRTG - breathing mode. Would like to put in. + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_WIN_LOCK] = ACTION_TAP_DANCE_DOUBLE(MAGIC_NO_GUI, MAGIC_UNNO_GUI) +}; + +// +////In Layer declaration, add tap dance item in place of a key code +//TD(TD_WIN_LOCK) + +// Double Tap Fn button to get caps. FN + Tab to get to number layer -> Maybe switch to FN + space?. +// Press fn+GUI once to lock, double tap to unlock. + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |FNCAP| A| S| D| F| G| H| J| K| L| ;| '|Enter |PgUp | + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = LAYOUT_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS,KC_DEL, \ + LT(_FL, KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SEMI_FN,KC_QUOT, KC_ENT,KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,KC_UP,KC_PGDN, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_FL),KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del | | + * |----------------------------------------------------------------| + * |#PAD |Pre| U |NXT| | | |PGD| U |PGU|PSC| | | |Ins | + * |----------------------------------------------------------------| + * | |L | D | R |PPl| | | L | D | R | | | |Home| + * |----------------------------------------------------------------| + * | CAPS |MUT|VU-|VU+| | | |BRG|BL-|BL+|BLT| |Stp|End | + * |----------------------------------------------------------------| + * | |WTOG| | | | | |Pre|PPl|Nxt | + * `----------------------------------------------------------------' + */ +[_FL] = LAYOUT_ansi( + _______, KC_F1 ,KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______ , \ + TO(_NL),KC_MPRV, KC_UP ,KC_MNXT,_______, _______,_______,KC_PGDN,KC_UP,KC_PGUP,KC_PSCR,_______,_______, _______,KC_INSERT, \ + _______,KC_LEFT,KC_DOWN,KC_RGHT,KC_MPLY,_______,_______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______, _______,KC_HOME, \ + _______,KC_MUTE,KC_VOLD,KC_VOLU, _______,_______, _______,BL_BRTG,BL_DEC,BL_INC,BL_TOGG,_______, KC_STOP, KC_END, \ + _______,TD(TD_WIN_LOCK),_______, _______, _______,KC_TRNS,_______,KC_MPRV,KC_MPLY, KC_MNXT), + + +//Press either of function keys to get back to base layer. + + /* Keymap _NL: Number Layer + * ,----------------------------------------------------------------. + * |ESC| F1 | F2| F3| F4| |#L | 7 | 8 | 9 | - | | = | | | + * |----------------------------------------------------------------| + * | TAB | | UP| | | | / | 4 | 5 | 6 | + | | | | DEL| + * |----------------------------------------------------------------| + * | _BL |LFT|DWN|RGT| | | * | 1 | 2 | 3 |ENT| | ENT |PgUp| + * |----------------------------------------------------------------| + * | SHIFT | | | | | | 0 | 0 | , | . |BKS| SHIFT| U |PgDn| + * |----------------------------------------------------------------| + * |CTRL|WIN |ALT | |ALT| _BL |CTRL| L | D | R| + * `----------------------------------------------------------------' + */ +[_NL] = LAYOUT_ansi( + _______, KC_F1 ,KC_F2, KC_F3, KC_F4, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_PEQL, KC_PEQL, _______, _______ , \ + KC_TAB,_______, KC_UP,_______,_______, _______,KC_PSLS,KC_P4,KC_P5,KC_P6,KC_PPLS,_______,_______, _______,KC_DEL, \ + TO(_BL),KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,KC_PAST,KC_P1,KC_P2,KC_P3,KC_PENT,_______, KC_ENT,KC_PGUP, \ + KC_LSFT,_______,_______,_______, _______,_______, KC_P0,KC_P0,KC_PCMM,KC_PDOT,KC_BSPC,KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,TO(_BL),KC_RCTRL,KC_LEFT,KC_DOWN, KC_RGHT), + +}; diff --git a/keyboards/tada68/keymaps/abishalom/readme.md b/keyboards/tada68/keymaps/abishalom/readme.md new file mode 100644 index 00000000000..511704223ba --- /dev/null +++ b/keyboards/tada68/keymaps/abishalom/readme.md @@ -0,0 +1,6 @@ +# Godolphins13 Tada68 + +My Tada68 layout. +Caps lock acts as a function key when held, otherwise just caps lock. +In the function layer, arrow keys mapped to both wasd and ijkl, as I haven't really decided which I like best. + diff --git a/keyboards/tada68/keymaps/abishalom/rules.mk b/keyboards/tada68/keymaps/abishalom/rules.mk new file mode 100644 index 00000000000..b3eaa621501 --- /dev/null +++ b/keyboards/tada68/keymaps/abishalom/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Tappa Dance Bitch diff --git a/keyboards/tada68/keymaps/amnesia0287/keymap.c b/keyboards/tada68/keymaps/amnesia0287/keymap.c index 46cbf177a07..bf84462de58 100644 --- a/keyboards/tada68/keymaps/amnesia0287/keymap.c +++ b/keyboards/tada68/keymaps/amnesia0287/keymap.c @@ -10,8 +10,6 @@ #define _HL 3 #define _XL 4 -#define _______ KC_TRNS - enum hype_keycodes { FN_HLa = SAFE_RANGE, FN_HLb diff --git a/keyboards/tada68/keymaps/ardakilic/keymap.c b/keyboards/tada68/keymaps/ardakilic/keymap.c index fc5b596d839..6c3475cb208 100755 --- a/keyboards/tada68/keymaps/ardakilic/keymap.c +++ b/keyboards/tada68/keymaps/ardakilic/keymap.c @@ -12,8 +12,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. diff --git a/keyboards/tada68/keymaps/ardakilic/rules.mk b/keyboards/tada68/keymaps/ardakilic/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/tada68/keymaps/ardakilic/rules.mk +++ b/keyboards/tada68/keymaps/ardakilic/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/bazooka/keymap.c b/keyboards/tada68/keymaps/bazooka/keymap.c index 4105f981d13..dfe0feb12f3 100644 --- a/keyboards/tada68/keymaps/bazooka/keymap.c +++ b/keyboards/tada68/keymaps/bazooka/keymap.c @@ -9,7 +9,6 @@ #define _FUNC 2 #define _MOUSE 3 -#define _______ KC_TRNS #define MAC_TOG TG(_MAC) enum { diff --git a/keyboards/tada68/keymaps/default/keymap.c b/keyboards/tada68/keymaps/default/keymap.c index 5a9a9979499..9a36e87a2a9 100755 --- a/keyboards/tada68/keymaps/default/keymap.c +++ b/keyboards/tada68/keymaps/default/keymap.c @@ -7,8 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. diff --git a/keyboards/tada68/keymaps/default/rules.mk b/keyboards/tada68/keymaps/default/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/tada68/keymaps/default/rules.mk +++ b/keyboards/tada68/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/dlg/config.h b/keyboards/tada68/keymaps/dlg/config.h new file mode 100644 index 00000000000..e1a6eb1a2b0 --- /dev/null +++ b/keyboards/tada68/keymaps/dlg/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define GRAVE_ESC_ALT_OVERRIDE diff --git a/keyboards/tada68/keymaps/dlg/keymap.c b/keyboards/tada68/keymaps/dlg/keymap.c new file mode 100755 index 00000000000..9cd6cb2f129 --- /dev/null +++ b/keyboards/tada68/keymaps/dlg/keymap.c @@ -0,0 +1,76 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 +#define _MAC 2 + +// investigate later - use lctl / lsft as up/down. +// https://github.com/qmk/qmk_firmware/tree/master/keyboards/tada68/keymaps/fakb +#define LCTL_MA LCTL_T(KC_UP) +#define LSFT_MA LSFT_T(KC_DOWN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt|Fn |Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + * + * Note: Shift + Esc = ~ + * Win + Esc = ` + */ +[_BL] = LAYOUT_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * |`swp|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| Del |`swp| + * |----------------------------------------------------------------| + * | |BL |BL-|BL+|Brt| | | |mac| |PSc| | | |Ins | + * |----------------------------------------------------------------| + * | | | | | | |<- |Dn |Up | ->| | | |Hme | + * |----------------------------------------------------------------| + * | | | | | | | |MUT|V- |V+ | | |PUp|End | + * |----------------------------------------------------------------| + * | | | | | | | |Hme|PDn|End | + * `----------------------------------------------------------------' + */ +[_FL] = LAYOUT_ansi( + MAGIC_UNSWAP_GRAVE_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, MAGIC_SWAP_GRAVE_ESC, \ + _______, BL_TOGG, BL_DEC, BL_INC , BL_BRTG, _______, _______, _______, TG(_MAC),_______, KC_PSCR, _______, _______, _______, KC_INS, \ + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, KC_HOME, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, KC_PGUP, KC_END , \ + _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END ), + + /* Keymap _MAC: Mac Layer + * ,----------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * |Ctrl|Alt |Win | |Win | |Alt| | | | + * `----------------------------------------------------------------' + */ +[_MAC] = LAYOUT_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, KC_LALT, KC_LGUI, _______, KC_RGUI, _______, KC_RALT, _______, _______, _______), + +}; diff --git a/keyboards/tada68/keymaps/dlg/readme.md b/keyboards/tada68/keymaps/dlg/readme.md new file mode 100755 index 00000000000..1f1ae186711 --- /dev/null +++ b/keyboards/tada68/keymaps/dlg/readme.md @@ -0,0 +1,54 @@ +# dlg's layout + +[tshack's layout](https://github.com/qmk/qmk_firmware/tree/master/keyboards/tada68/keymaps/tshack), with: + + Mac layer + + Press Fn-I to align the bottom row to mac standards + + volume controls moved to Fn+ M<> + + [Space Cadet Shift](https://docs.qmk.fm/#/feature_space_cadet_shift) enabled + + Fn+R for LED breathing + + Fn+Del for Insert + + `GRAVE_ESC_ALT_OVERRIDE` so cmd-opt-esc still works (thx [mattdicarlo](https://github.com/qmk/qmk_firmware/tree/master/keyboards/tada68/keymaps/mattdicarlo)) + +``` + Base Layer +,----------------------------------------------------------------. +|Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | +|----------------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | +|----------------------------------------------------------------| +|Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| +|----------------------------------------------------------------| +|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgDn| +|----------------------------------------------------------------| +|Ctrl|Win |Alt | Space |Alt|Fn |Ctrl|<- |Dn | -> | +`----------------------------------------------------------------' +Note: Shift + Esc = ~ (tilde) + Win + Esc = ` (grave) + + + Fn Layer +,----------------------------------------------------------------. +| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| Del | | +|----------------------------------------------------------------| +| |BL |BL-|BL+|Brt| | | |mac| |PSc| | | |Ins | +|----------------------------------------------------------------| +| | | | | | |<- |Dn |Up | ->| | | |Hme | +|----------------------------------------------------------------| +| | | | | | | |MUT|V- |V+ | | |PUp|End | +|----------------------------------------------------------------| +| | | | | | | |Hme|PDn|End | +`----------------------------------------------------------------' + +Mac Layer +,----------------------------------------------------------------. +| | | | | | | | | | | | | | | | +|----------------------------------------------------------------| +| | | | | | | | | | | | | | | | +|----------------------------------------------------------------| +| | | | | | | | | | | | | | | +|----------------------------------------------------------------| +| | | | | | | | | | | | | | | +|----------------------------------------------------------------| +|Ctrl|Alt |Win | |Win | |Alt| | | | +`----------------------------------------------------------------' +``` diff --git a/keyboards/tada68/keymaps/dlg/rules.mk b/keyboards/tada68/keymaps/dlg/rules.mk new file mode 100644 index 00000000000..2e0f1a66163 --- /dev/null +++ b/keyboards/tada68/keymaps/dlg/rules.mk @@ -0,0 +1,17 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/tada68/keymaps/fakb/keymap.c b/keyboards/tada68/keymaps/fakb/keymap.c index 88a9d4b370c..743c30ad624 100755 --- a/keyboards/tada68/keymaps/fakb/keymap.c +++ b/keyboards/tada68/keymaps/fakb/keymap.c @@ -5,8 +5,6 @@ // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define LCTL_MA LCTL_T(KC_UP) #define LSFT_MA LSFT_T(KC_DOWN) #define RSFT_MA SFT_T(KC_UP) diff --git a/keyboards/tada68/keymaps/fakb/rules.mk b/keyboards/tada68/keymaps/fakb/rules.mk index 642e16de597..47fd29663ba 100644 --- a/keyboards/tada68/keymaps/fakb/rules.mk +++ b/keyboards/tada68/keymaps/fakb/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/fezzant/keymap.c b/keyboards/tada68/keymaps/fezzant/keymap.c index d38e4b3b646..fdc2b6ac8c1 100644 --- a/keyboards/tada68/keymaps/fezzant/keymap.c +++ b/keyboards/tada68/keymaps/fezzant/keymap.c @@ -7,9 +7,6 @@ #define _NUM 2 #define _BSPC 3 -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Macros // name macros here for keymap reference enum { diff --git a/keyboards/tada68/keymaps/fezzant/rules.mk b/keyboards/tada68/keymaps/fezzant/rules.mk index 8df84ae954f..7b32f0a6644 100644 --- a/keyboards/tada68/keymaps/fezzant/rules.mk +++ b/keyboards/tada68/keymaps/fezzant/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/hhkb68/keymap.c b/keyboards/tada68/keymaps/hhkb68/keymap.c new file mode 100644 index 00000000000..abde68f883f --- /dev/null +++ b/keyboards/tada68/keymaps/hhkb68/keymap.c @@ -0,0 +1,6 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_PGDN, MO(1), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + [1] = LAYOUT_ansi(KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_END, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; diff --git a/keyboards/tada68/keymaps/hhkb68/layers.json b/keyboards/tada68/keymaps/hhkb68/layers.json new file mode 100644 index 00000000000..9553c3317be --- /dev/null +++ b/keyboards/tada68/keymaps/hhkb68/layers.json @@ -0,0 +1 @@ +[["KC_ESC", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", "KC_MINS", "KC_EQL", "KC_BSLS", "KC_GRV", "KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_LBRC", "KC_RBRC", "KC_BSPC", "KC_DEL", "KC_LCTL", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", "KC_ENT", "KC_PGUP", "KC_LSFT", "KC_Z", "KC_X", "KC_C", "KC_V", "KC_B", "KC_N", "KC_M", "KC_COMM", "KC_DOT", "KC_SLSH", "KC_RSFT", "MO(1)", "KC_PGDN", "MO(1)", "KC_LGUI", "KC_LALT", "KC_SPC", "KC_RALT", "KC_RGUI", "KC_LEFT", "KC_DOWN", "KC_UP", "KC_RGHT"], ["KC_TRNS", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_F12", "KC_TRNS", "KC_INS", "KC_CAPS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_PSCR", "KC_TRNS", "KC_TRNS", "KC_UP", "KC_TRNS", "KC_DEL", "KC_HOME", "KC_TRNS", "KC_VOLD", "KC_VOLU", "KC_MUTE", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_HOME", "KC_PGUP", "KC_LEFT", "KC_RGHT", "KC_TRNS", "KC_END", "KC_TRNS", "BL_DEC", "BL_TOGG", "BL_INC", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_END", "KC_PGDN", "KC_DOWN", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"]] \ No newline at end of file diff --git a/keyboards/tada68/keymaps/hhkb68/readme.md b/keyboards/tada68/keymaps/hhkb68/readme.md new file mode 100644 index 00000000000..013b812fc6b --- /dev/null +++ b/keyboards/tada68/keymaps/hhkb68/readme.md @@ -0,0 +1,2 @@ +# HHKB68 +Layout to closely match the primary and function layers of the HHKB. diff --git a/keyboards/tada68/keymaps/iso-nor/keymap.c b/keyboards/tada68/keymaps/iso-nor/keymap.c index c26932b0e4e..ae0fccccc82 100644 --- a/keyboards/tada68/keymaps/iso-nor/keymap.c +++ b/keyboards/tada68/keymaps/iso-nor/keymap.c @@ -3,8 +3,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. @@ -16,7 +14,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------------------------------------------------------------| * |Shif| <>| Z| X| C| V| B| N| M| ,| .| -| Shift| Up|PgDn| * |----------------------------------------------------------------| - * |Ctrl|Alt |Cmd | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | * `----------------------------------------------------------------' */ [_BL] = LAYOUT_iso( diff --git a/keyboards/tada68/keymaps/iso-nor/rules.mk b/keyboards/tada68/keymaps/iso-nor/rules.mk index baaca071cf7..53644093d6c 100644 --- a/keyboards/tada68/keymaps/iso-nor/rules.mk +++ b/keyboards/tada68/keymaps/iso-nor/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/tada68/keymaps/iso-uk/keymap.c b/keyboards/tada68/keymaps/iso-uk/keymap.c index c843595dc34..f4aa09f65b8 100644 --- a/keyboards/tada68/keymaps/iso-uk/keymap.c +++ b/keyboards/tada68/keymaps/iso-uk/keymap.c @@ -3,8 +3,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. diff --git a/keyboards/tada68/keymaps/iso-uk/rules.mk b/keyboards/tada68/keymaps/iso-uk/rules.mk index baaca071cf7..53644093d6c 100644 --- a/keyboards/tada68/keymaps/iso-uk/rules.mk +++ b/keyboards/tada68/keymaps/iso-uk/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/tada68/keymaps/isoish/keymap.c b/keyboards/tada68/keymaps/isoish/keymap.c index efe0063c7c9..adbf32251b7 100644 --- a/keyboards/tada68/keymaps/isoish/keymap.c +++ b/keyboards/tada68/keymaps/isoish/keymap.c @@ -3,8 +3,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. @@ -48,4 +46,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -}; \ No newline at end of file +}; diff --git a/keyboards/tada68/keymaps/isoish/rules.mk b/keyboards/tada68/keymaps/isoish/rules.mk index baaca071cf7..53644093d6c 100644 --- a/keyboards/tada68/keymaps/isoish/rules.mk +++ b/keyboards/tada68/keymaps/isoish/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/tada68/keymaps/kbp-v60/keymap.c b/keyboards/tada68/keymaps/kbp-v60/keymap.c new file mode 100755 index 00000000000..e7eef901978 --- /dev/null +++ b/keyboards/tada68/keymaps/kbp-v60/keymap.c @@ -0,0 +1,53 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +// Tilde is shift-grave +#define KC_TLDE S(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Del | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Home| + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = LAYOUT_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME,\ + MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,\ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, MO(_FL), KC_ALGR, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | ` | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * | | |Up | |Prt|Bks|PgU|Hom|End|Pau| Up| | | |end | + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig|Scl|Del|PgD| ~ |Ins|Lef|Dow|Rig| |Prt | + * |----------------------------------------------------------------| + * | | | |Bl-|BL |BL+| |VU-|VU+|MUT| | McL|MsU|McR | + * |----------------------------------------------------------------| + * | | | | | | | |MsL|MsD|MsR | + * `----------------------------------------------------------------' + */ +[_FL] = LAYOUT_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS, \ + KC_CAPS, _______, KC_UP, _______, KC_BSPC, KC_PSCR, KC_PGUP, KC_HOME, KC_END, KC_PAUS, KC_UP, _______, _______, _______, KC_END, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, KC_SLCK, KC_PGDN, KC_TLDE, KC_INS, KC_LEFT, KC_DOWN, KC_RIGHT, _______, KC_PSCR,\ + _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_BTN1, KC_MS_U, KC_BTN2,\ + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R), +}; diff --git a/keyboards/tada68/keymaps/kbp-v60/readme.md b/keyboards/tada68/keymaps/kbp-v60/readme.md new file mode 100755 index 00000000000..f15b2781999 --- /dev/null +++ b/keyboards/tada68/keymaps/kbp-v60/readme.md @@ -0,0 +1,3 @@ +# KBP V60 like TADA68 layout + +This layout resembles the KBParadise V60 FN layer and moves around some keys. diff --git a/keyboards/tada68/keymaps/kbp-v60/rules.mk b/keyboards/tada68/keymaps/kbp-v60/rules.mk new file mode 100644 index 00000000000..53644093d6c --- /dev/null +++ b/keyboards/tada68/keymaps/kbp-v60/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/tada68/keymaps/laas/keymap.c b/keyboards/tada68/keymaps/laas/keymap.c index 25b990a72ac..1a8cd6f0c10 100755 --- a/keyboards/tada68/keymaps/laas/keymap.c +++ b/keyboards/tada68/keymaps/laas/keymap.c @@ -6,7 +6,6 @@ // entirely and just use numbers. #define _BL 0 #define _FL 1 -#define _______ KC_TRNS LEADER_EXTERNS(); diff --git a/keyboards/tada68/keymaps/mattdicarlo/keymap.c b/keyboards/tada68/keymaps/mattdicarlo/keymap.c index 378da62da8a..8fad86b0be9 100755 --- a/keyboards/tada68/keymaps/mattdicarlo/keymap.c +++ b/keyboards/tada68/keymaps/mattdicarlo/keymap.c @@ -4,8 +4,6 @@ #define BASE_LAYER 0 #define FUNC_LAYER 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Base layer, always active. diff --git a/keyboards/tada68/keymaps/mattdicarlo/rules.mk b/keyboards/tada68/keymaps/mattdicarlo/rules.mk index ac92f99f485..739b739971f 100644 --- a/keyboards/tada68/keymaps/mattdicarlo/rules.mk +++ b/keyboards/tada68/keymaps/mattdicarlo/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/mattgemmell/config.h b/keyboards/tada68/keymaps/mattgemmell/config.h new file mode 100644 index 00000000000..f4b045cd32e --- /dev/null +++ b/keyboards/tada68/keymaps/mattgemmell/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define GRAVE_ESC_GUI_OVERRIDE diff --git a/keyboards/tada68/keymaps/mattgemmell/keymap.c b/keyboards/tada68/keymaps/mattgemmell/keymap.c new file mode 100644 index 00000000000..f2afd3cd48d --- /dev/null +++ b/keyboards/tada68/keymaps/mattgemmell/keymap.c @@ -0,0 +1,48 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | § | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| |Del | + * |------------------------------------------------------- -----| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| \ |Entr|PgUp| + * |----------------------------------------------------------------| + * |Shift| ` | Z| X| C| V| B| N| M| ,| .| /|Rshift|Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Alt |LGUI| Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ + [_BL] = LAYOUT_iso( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NUBS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_GRV, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Keymap _FL1: Function Layer 1 + * ,----------------------------------------------------------------. + * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |BR↑ | + * |----------------------------------------------------------------| + * | | | | | | | | |Prn|Scl|Pau|Up | | |BR↓ | + * |------------------------------------------------------- -----| + * | | V+| V-|Mut| | | | |Hom|PgU|Lft|Rig| | |Home| + * |----------------------------------------------------------------| + * | | | | | L+|LED| L-| | |End|PgDn|Dow| | ↑ | End| + * |----------------------------------------------------------------| + * | | | | | | | | ← | ↓ | → | + * `----------------------------------------------------------------' + */ + [_FL] = LAYOUT_iso( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_BRMU, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_BRMD, \ + _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, _______, KC_HOME, \ + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, KC_END, KC_PGDN, KC_DOWN, _______, KC_MS_U, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R + ), +}; diff --git a/keyboards/tada68/keymaps/mattgemmell/readme.md b/keyboards/tada68/keymaps/mattgemmell/readme.md new file mode 100644 index 00000000000..de8e0c4980a --- /dev/null +++ b/keyboards/tada68/keymaps/mattgemmell/readme.md @@ -0,0 +1,14 @@ +# Custom TADA68 layout for ISO UK with Apple-specific tweaks + +This layout is based on the [ISO UK](../iso-uk) layout, with changes to make it +more user friendly when used on Apple devices, like iPads and the Mac. + + +## Installation + +Please see the [Tada68 readme](../../readme.md). Make the firmware wih the +following command: + +``` +make tada68:mattgemmell:flashbin +``` diff --git a/keyboards/tada68/keymaps/mattgemmell/rules.mk b/keyboards/tada68/keymaps/mattgemmell/rules.mk new file mode 100644 index 00000000000..020d12635d3 --- /dev/null +++ b/keyboards/tada68/keymaps/mattgemmell/rules.mk @@ -0,0 +1,16 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/tada68/keymaps/mlechner/keymap.c b/keyboards/tada68/keymaps/mlechner/keymap.c index 01ba3352ca3..710ff9dcbef 100755 --- a/keyboards/tada68/keymaps/mlechner/keymap.c +++ b/keyboards/tada68/keymaps/mlechner/keymap.c @@ -7,8 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - enum custom_keycodes { MAC_AE = SAFE_RANGE, MAC_OE, diff --git a/keyboards/tada68/keymaps/mlechner/rules.mk b/keyboards/tada68/keymaps/mlechner/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/tada68/keymaps/mlechner/rules.mk +++ b/keyboards/tada68/keymaps/mlechner/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/mtdjr/rules.mk b/keyboards/tada68/keymaps/mtdjr/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/tada68/keymaps/mtdjr/rules.mk +++ b/keyboards/tada68/keymaps/mtdjr/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/pascamel/keymap.c b/keyboards/tada68/keymaps/pascamel/keymap.c index a836cefd21f..1e7499f66b8 100755 --- a/keyboards/tada68/keymaps/pascamel/keymap.c +++ b/keyboards/tada68/keymaps/pascamel/keymap.c @@ -7,8 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. diff --git a/keyboards/tada68/keymaps/pascamel/rules.mk b/keyboards/tada68/keymaps/pascamel/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/tada68/keymaps/pascamel/rules.mk +++ b/keyboards/tada68/keymaps/pascamel/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/raylas/keymap.c b/keyboards/tada68/keymaps/raylas/keymap.c index e2ea33ec608..2845163a2f2 100755 --- a/keyboards/tada68/keymaps/raylas/keymap.c +++ b/keyboards/tada68/keymaps/raylas/keymap.c @@ -7,8 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. diff --git a/keyboards/tada68/keymaps/raylas/rules.mk b/keyboards/tada68/keymaps/raylas/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/tada68/keymaps/raylas/rules.mk +++ b/keyboards/tada68/keymaps/raylas/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/rbong/keymap.c b/keyboards/tada68/keymaps/rbong/keymap.c index ffed2caa29b..03c4d783924 100644 --- a/keyboards/tada68/keymaps/rbong/keymap.c +++ b/keyboards/tada68/keymaps/rbong/keymap.c @@ -7,7 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS // Dual bind caps to left ctrl and escape when held #define CAPSDUAL CTL_T(KC_ESC) diff --git a/keyboards/tada68/keymaps/rgb/keymap.c b/keyboards/tada68/keymaps/rgb/keymap.c index 00a02e40ad9..dde3521f192 100755 --- a/keyboards/tada68/keymaps/rgb/keymap.c +++ b/keyboards/tada68/keymaps/rgb/keymap.c @@ -7,8 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. diff --git a/keyboards/tada68/keymaps/rgb/rules.mk b/keyboards/tada68/keymaps/rgb/rules.mk index 470d621b105..e7247825137 100644 --- a/keyboards/tada68/keymaps/rgb/rules.mk +++ b/keyboards/tada68/keymaps/rgb/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/rys/keymap.c b/keyboards/tada68/keymaps/rys/keymap.c index 6f32b092d49..012f2cc05c7 100644 --- a/keyboards/tada68/keymaps/rys/keymap.c +++ b/keyboards/tada68/keymaps/rys/keymap.c @@ -3,7 +3,26 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS +enum rys_keycodes { + PSTOKEN = SAFE_RANGE, + QSTOKEN +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case PSTOKEN: + if (record->event.pressed) { + SEND_STRING(RYS_PSTOKEN); + } + break; + case QSTOKEN: + if (record->event.pressed) { + SEND_STRING(RYS_QSTOKEN); + } + break; + } + return true; +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer @@ -16,35 +35,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------------------------------------------------------------| * |Shift| \ | Z| X| C| V| B| N| M| ,| .| /|Rshift|Up|PgDn| * |----------------------------------------------------------------| - * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * |Ctrl|Alt |LGUI| Space |Alt| FN|Ctrl|Lef|Dow|Rig | * `----------------------------------------------------------------' */ [_BL] = LAYOUT_iso( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NUHS, KC_DEL, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, \ KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), /* Keymap _FL1: Function Layer 1 * ,----------------------------------------------------------------. - * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Delete| Ins| + * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | :D | * |----------------------------------------------------------------| - * | | | ↑ | | | | | | | | | | | |Home| + * | |LMB| Up|RMB| | | | | | | | | | | | * |------------------------------------------------------- -----| - * | | ← | ↓ | → | | | | | | | | | | | End| + * | |Lef|Dow|Rig| | | | | | | | | | |Home| * |----------------------------------------------------------------| - * | | | | | L+|LED| L-| | V+| V-|Mut| | MsBtn|Up|MsBn| + * | | | | | L+|LED| L-| | V+| V-|Mut| | MsBtn|↑ | End| * |----------------------------------------------------------------| - * | | | | | | | | Lt| Dn| Rt | + * | | | | Reset | | | | ← | ↓ | → | * `----------------------------------------------------------------' */ [_FL] = LAYOUT_iso( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, PSTOKEN, \ _______, KC_BTN1, KC_UP, KC_BTN2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, \ - _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, KC_MS_U, KC_END, \ - _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, QSTOKEN, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, KC_MS_U, KC_END, \ + _______, _______, _______, RESET, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R ), }; diff --git a/keyboards/tada68/keymaps/rys/readme.md b/keyboards/tada68/keymaps/rys/readme.md index a9425bf0673..bf6a643d336 100644 --- a/keyboards/tada68/keymaps/rys/readme.md +++ b/keyboards/tada68/keymaps/rys/readme.md @@ -11,5 +11,5 @@ Please see the [Tada68 readme](../../readme.md). Make the firmware wih the following command: ``` -make tada68:rys:bin +make tada68:rys:flashbin ``` diff --git a/keyboards/tada68/keymaps/rys/rules.mk b/keyboards/tada68/keymaps/rys/rules.mk index b2789a78a7d..eb868df074d 100644 --- a/keyboards/tada68/keymaps/rys/rules.mk +++ b/keyboards/tada68/keymaps/rys/rules.mk @@ -8,10 +8,14 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RYS_PSTOKEN = $(shell security find-generic-password -a qmk -s tada68 -w) +RYS_QSTOKEN = $(shell security find-generic-password -a qmk -s tada68-2 -w) +CFLAGS += -DRYS_PSTOKEN=\"$(RYS_PSTOKEN)\" +CFLAGS += -DRYS_QSTOKEN=\"$(RYS_QSTOKEN)\" diff --git a/keyboards/tada68/keymaps/stephengrier/keymap.c b/keyboards/tada68/keymaps/stephengrier/keymap.c index a19642ce151..96f6b2bf22f 100755 --- a/keyboards/tada68/keymaps/stephengrier/keymap.c +++ b/keyboards/tada68/keymaps/stephengrier/keymap.c @@ -7,8 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. diff --git a/keyboards/tada68/keymaps/stephengrier/rules.mk b/keyboards/tada68/keymaps/stephengrier/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/tada68/keymaps/stephengrier/rules.mk +++ b/keyboards/tada68/keymaps/stephengrier/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/trashcat/keymap.c b/keyboards/tada68/keymaps/trashcat/keymap.c index da6bf6a1e97..5c7019731d3 100644 --- a/keyboards/tada68/keymaps/trashcat/keymap.c +++ b/keyboards/tada68/keymaps/trashcat/keymap.c @@ -9,8 +9,6 @@ #define _GM 2 #define _GF 3 -#define _______ KC_TRNS - // Tap dance declarations (These must go above the keymaps) enum { TD_F1 = 0, diff --git a/keyboards/tada68/keymaps/trashcat/rules.mk b/keyboards/tada68/keymaps/trashcat/rules.mk index 6fb49691937..488111732c9 100644 --- a/keyboards/tada68/keymaps/trashcat/rules.mk +++ b/keyboards/tada68/keymaps/trashcat/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Tappa Dance Bitch -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/tshack/keymap.c b/keyboards/tada68/keymaps/tshack/keymap.c index 177cc4bd129..3bffa36dc49 100755 --- a/keyboards/tada68/keymaps/tshack/keymap.c +++ b/keyboards/tada68/keymaps/tshack/keymap.c @@ -3,8 +3,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. diff --git a/keyboards/tada68/keymaps/tshack/rules.mk b/keyboards/tada68/keymaps/tshack/rules.mk index 86d22dd3fd0..1a3bda46037 100644 --- a/keyboards/tada68/keymaps/tshack/rules.mk +++ b/keyboards/tada68/keymaps/tshack/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/unix/keymap.c b/keyboards/tada68/keymaps/unix/keymap.c index 554abd0243c..c7073fa694a 100644 --- a/keyboards/tada68/keymaps/unix/keymap.c +++ b/keyboards/tada68/keymaps/unix/keymap.c @@ -7,8 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. diff --git a/keyboards/tada68/keymaps/unix/rules.mk b/keyboards/tada68/keymaps/unix/rules.mk index aade51459b4..316106c034d 100644 --- a/keyboards/tada68/keymaps/unix/rules.mk +++ b/keyboards/tada68/keymaps/unix/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/keymaps/wamsm_tada/keymap.c b/keyboards/tada68/keymaps/wamsm_tada/keymap.c index 475555ded9e..3b5e9d373ba 100755 --- a/keyboards/tada68/keymaps/wamsm_tada/keymap.c +++ b/keyboards/tada68/keymaps/wamsm_tada/keymap.c @@ -7,8 +7,6 @@ #define _BL 0 #define _FL 1 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. @@ -49,4 +47,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,KC_LEFT,KC_DOWN,KC_RIGHT,KC_MPLY,_______,_______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______, _______,KC_HOME, \ _______,KC_VOLD, KC_VOLU, KC_MUTE, _______,_______, _______, _______,BL_DEC, BL_INC, BL_TOGG,KC_CAPS,_______,KC_END, \ _______,_______,_______, _______, _______,_______,_______,KC_MRWD, KC_MPLY, KC_MFFD), -}; \ No newline at end of file +}; diff --git a/keyboards/tada68/keymaps/wamsm_tada/rules.mk b/keyboards/tada68/keymaps/wamsm_tada/rules.mk index bb535beb34c..53644093d6c 100644 --- a/keyboards/tada68/keymaps/wamsm_tada/rules.mk +++ b/keyboards/tada68/keymaps/wamsm_tada/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tada68/rules.mk b/keyboards/tada68/rules.mk index 2af733b6b38..ceb6f96af70 100755 --- a/keyboards/tada68/rules.mk +++ b/keyboards/tada68/rules.mk @@ -1,6 +1,4 @@ - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/tanuki/config.h b/keyboards/tanuki/config.h index 1e42f13d4ff..1439ed43e8c 100644 --- a/keyboards/tanuki/config.h +++ b/keyboards/tanuki/config.h @@ -47,18 +47,15 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN D1 +#ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 5 #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 - +#define RGBLIGHT_SLEEP +#endif #define TAPPING_TERM 200 /* diff --git a/keyboards/tanuki/keymaps/default/keymap.c b/keyboards/tanuki/keymaps/default/keymap.c index 59f5843ea94..34ca6a639c0 100644 --- a/keyboards/tanuki/keymaps/default/keymap.c +++ b/keyboards/tanuki/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "rgblight.h" //Layer definitions #define _BL 0 @@ -17,34 +16,34 @@ bool lRGB = true; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BL] = LAYOUT( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, TG(_GL), \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, TG(_GL), \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, KC_SLSH, KC_ENT, \ - KC_TAB, KC_ESC, KC_LCTL, KC_LALT, KC_COMMA, LT(_DL,KC_SPC), LT(_UL,KC_SPC), KC_DOT, KC_LGUI), + KC_LCTL, KC_LALT, KC_COMMA, LT(_DL,KC_SPC), LT(_UL,KC_SPC), KC_DOT, KC_LGUI), [_DL] = LAYOUT( - KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,\ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,\ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,\ + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,\ KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_F1, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_UL] = LAYOUT( - KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_PIPE, KC_BSLS, KC_PLUS, KC_UNDS, KC_MINS, KC_EQL, KC_DEL,\ - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, \ + KC_GRV, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_PIPE, KC_BSLS, KC_PLUS, KC_UNDS, KC_MINS, KC_EQL, KC_DEL,\ + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, \ KC_TRNS, KC_FN0, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SAD, RGB_VAD, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_GRV, KC_TRNS, RGB_MOD, RGB_HUI, KC_TRNS, KC_TRNS, RGB_SAI, RGB_VAI), + KC_TRNS, RGB_MOD, RGB_HUI, KC_TRNS, KC_TRNS, RGB_SAI, RGB_VAI), [_GL] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_SPC, KC_TRNS, KC_TRNS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_SPC, KC_TRNS, KC_TRNS), [_BK] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_FN1, KC_NO, KC_NO), + KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_FN1, KC_NO, KC_NO), }; diff --git a/keyboards/tanuki/keymaps/tucznak/config.h b/keyboards/tanuki/keymaps/tucznak/config.h new file mode 100644 index 00000000000..3a140193d8e --- /dev/null +++ b/keyboards/tanuki/keymaps/tucznak/config.h @@ -0,0 +1,27 @@ +#pragma once + +#undef MANUFACTURER +#undef PRODUCT +#undef DESCRIPTION + +#define MANUFACTURER Potato Inc. +#define PRODUCT Trash Panda +#define DESCRIPTION Qt3.14 smolkeeb + +/* for bootloader */ +#define QMK_ESC_OUTPUT B2 +#define QMK_ESC_INPUT D0 +#define QMK_LED B0 + +/* turn off RGB when computer sleeps */ +#ifdef RGBLIGHT_ENABLE +#define RGBLIGHT_SLEEP +#endif + +/* send tap key if no layer key was used even after tap delay */ +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 250 +#define RETRO_TAPPING +#define TAPPING_TOGGLE 2 diff --git a/keyboards/tanuki/keymaps/tucznak/keymap.c b/keyboards/tanuki/keymaps/tucznak/keymap.c new file mode 100644 index 00000000000..301f0f8419a --- /dev/null +++ b/keyboards/tanuki/keymaps/tucznak/keymap.c @@ -0,0 +1,116 @@ +#include QMK_KEYBOARD_H + +enum layers { + _BASE, + _DN, + _UP, + _NAV, + _FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base layer (0) + * ,------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | Tab | A | S | D | F | G | H | J | K | L | ů | Nav | + * `------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----' + * | Shift | Z | X | C | V | B | N | M | , | . |Enter | + * `-------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------' + * | Ctrl | GUI |LAlt | Space | SpaceUp |AltGr| Down | + * `--------------------------------------------------------' + */ + + [_BASE] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, TT(_NAV), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, LT(_UP,KC_SPC), KC_RALT, MO(_DN) + ), + + /* Down layer (1) + * function keys and numbers + * ,------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * `------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----' + * | |NumLk| | | + | - | * | / | , | . | | + * `-------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------' + * | Fn | | | C+A+D | C+A+I | | | + * `--------------------------------------------------------' + */ + + [_DN] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_0, _______, + _______, KC_NLCK, _______, _______, KC_PPLS, KC_PMNS, KC_PAST, KC_PSLS, KC_COMM, KC_DOT, _______, + MO(_FN), _______, _______, LCA(KC_DEL), LCA(KC_INS), _______, _______ + ), + + /* Up layer (2) + * national and special characters + * ,------------------------------------------------------------------------. + * | +1 | ě2 | š3 | č4 | ř5 | ž6 | ý7 | á8 | í9 | é0 | ´ | ˇ | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | ;° | | | | | | ( | ) | § | ! | / | ú | | + * `------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----' + * | | | | \ | % | = | ¨ | ' | - | _ | | + * `-------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------' + * | | | | | | | | + * `--------------------------------------------------------' + */ + + [_UP] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, LSFT(KC_EQL), + KC_GRV, _______, _______, _______, LSFT(KC_NUBS), LSFT(KC_RBRC), KC_RBRC, KC_QUOT, LSFT(KC_QUOT), LSFT(KC_LBRC), KC_LBRC, _______, + _______, _______, _______, KC_NUBS, LSFT(KC_MINS), KC_MINS, KC_BSLS, LSFT(KC_BSLS), KC_SLSH, LSFT(KC_SLSH), _______, + _______, _______, _______, _______, _______, _______, _______ + ), + + /* Navigation layer (3) + * arrows, nav cluster + * ,------------------------------------------------------------------------. + * | | | | | |Home |PgUp | | | Up | Ins | Del | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | | | | | | End |PgDn | |Left |Down |Right| | + * `------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----' + * | |Caps |PrtSc|ScrLk|Pause| | | | | | | + * `-------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------' + * | | | | | | | Menu | + * `--------------------------------------------------------' + */ + + [_NAV] = LAYOUT( + _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, _______, KC_UP, KC_INS, KC_DEL, + _______, _______, _______, _______, _______, KC_END, KC_PGDN, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, + _______, KC_CAPS, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_APP + ), + + /* Function layer (4) + * keyboard and system control + * ,------------------------------------------------------------------------. + * |Reset| | | | | | |Play |Prev |Next |Stop | | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * |Sleep | VLK |Mod+ |Hue+ |Sat+ |Val+ | | |Vol- |Vol+ |Mute | | + * `------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----' + * | | TOG |Mod- |Hue- |Sat- |Val- | | | | | | + * `-------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------' + * | | | | | | | | + * `--------------------------------------------------------' + */ + + [_FN] = LAYOUT( + RESET, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, _______, + KC_SLEP, VLK_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, + _______, RGB_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +bool process_record_user (uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/tanuki/keymaps/tucznak/readme.md b/keyboards/tanuki/keymaps/tucznak/readme.md new file mode 100644 index 00000000000..b38490c9c56 --- /dev/null +++ b/keyboards/tanuki/keymaps/tucznak/readme.md @@ -0,0 +1,8 @@ +# TuCZnak's modified layout + +This layout is optimized for Czech national QWERTZ keymap. +It includes separated layers for: + - F-keys and numbers + - national and special characters + - navigation cluster + - keyboard config and media control diff --git a/keyboards/tanuki/keymaps/tucznak/rules.mk b/keyboards/tanuki/keymaps/tucznak/rules.mk new file mode 100644 index 00000000000..5c5263eae78 --- /dev/null +++ b/keyboards/tanuki/keymaps/tucznak/rules.mk @@ -0,0 +1,19 @@ +# screw Caterina +BOOTLOADER = qmk-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE =yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +TAP_DANCE_ENABLE = no diff --git a/keyboards/tanuki/readme.md b/keyboards/tanuki/readme.md index 331df5b2eac..129e2a95117 100644 --- a/keyboards/tanuki/readme.md +++ b/keyboards/tanuki/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make tanuki:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/tanuki/rules.mk b/keyboards/tanuki/rules.mk index cc3734152fb..fd3c058304f 100644 --- a/keyboards/tanuki/rules.mk +++ b/keyboards/tanuki/rules.mk @@ -65,6 +65,3 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID TAP_DANCE_ENABLE = no -ifndef QUANTUM_DIR - include ../../Makefile -endif diff --git a/keyboards/tanuki/tanuki.h b/keyboards/tanuki/tanuki.h index 6b686adafa8..9615e44f330 100644 --- a/keyboards/tanuki/tanuki.h +++ b/keyboards/tanuki/tanuki.h @@ -7,10 +7,10 @@ // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array #define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, \ + k31, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, \ + k30, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, \ - k30, k31, k32, k33, k34, k35, k36, k38, k39 \ + k32, k33, k34, k35, k36, k38, k39 \ ) \ { \ {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a}, \ diff --git a/keyboards/telophase/config.h b/keyboards/telophase/config.h index be0a3697737..473949ee1e8 100644 --- a/keyboards/telophase/config.h +++ b/keyboards/telophase/config.h @@ -41,12 +41,6 @@ along with this program. If not, see . #define ONESHOT_TIMEOUT 500 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/telophase/keymaps/default/keymap.c b/keyboards/telophase/keymaps/default/keymap.c index 1e692ba12dd..9cc6c1bb00d 100644 --- a/keyboards/telophase/keymaps/default/keymap.c +++ b/keyboards/telophase/keymaps/default/keymap.c @@ -1,7 +1,7 @@ // this is the style you want to emulate. // This is the canonical layout file for the Quantum project. If you want to add another keyboard, -#include "telophase.h" +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -15,7 +15,7 @@ enum telophase_layers _ADJUST, }; -enum telophase_keycodes +enum telophase_keycodes { LOWER = SAFE_RANGE, RAISE, @@ -25,10 +25,6 @@ enum telophase_keycodes #define LONGPRESS_DELAY 150 #define LAYER_TOGGLE_DELAY 300 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = { /*QWERTY*/ {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, @@ -101,4 +97,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void matrix_scan_user(void) { return; }; - diff --git a/keyboards/telophase/matrix.c b/keyboards/telophase/matrix.c index b3544453e72..c332eba556c 100644 --- a/keyboards/telophase/matrix.c +++ b/keyboards/telophase/matrix.c @@ -112,7 +112,7 @@ uint8_t matrix_scan(void) if (timeout > 10000){ break; } - } + } uart_data[i] = SERIAL_UART_DATA; } @@ -134,7 +134,7 @@ uint8_t matrix_scan(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define TAPPING_TERM 200 -#define PERMISSIVE_HOLD +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION #ifdef AUDIO_ENABLE #define B5_AUDIO @@ -50,13 +40,14 @@ #define NO_MUSIC_MODE #endif +#define ENCODERS_PAD_A { D1,F1 } +#define ENCODERS_PAD_B { D0,F0 } + #define RGB_DI_PIN F5 -#ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_SLEEP #define RGBLED_NUM 47 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 12 -//#define RGBLIGHT_LIMIT_VAL 128 -#endif - -#endif diff --git a/keyboards/tetris/info.json b/keyboards/tetris/info.json index b21a46d632b..c58e9be52f4 100644 --- a/keyboards/tetris/info.json +++ b/keyboards/tetris/info.json @@ -3,10 +3,10 @@ "url": "", "maintainer": "qmk", "width": 12, - "height": 4, + "height": 5, "layouts": { "LAYOUT_planck_mit": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3, "w":2}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3, "w":2}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}] + } } - } } diff --git a/keyboards/tetris/keymaps/default/keymap.c b/keyboards/tetris/keymaps/default/keymap.c old mode 100644 new mode 100755 index 61f2961b429..c1b5ad2b1f3 --- a/keyboards/tetris/keymaps/default/keymap.c +++ b/keyboards/tetris/keymaps/default/keymap.c @@ -1,847 +1,186 @@ #include QMK_KEYBOARD_H -#ifdef AUDIO_ENABLE - #include "audio.h" - float tone_caps[][2] = SONG( CAPS_LOCK_ON_SOUND ); - float tone_taps[][2] = SONG( E__NOTE( _A6 ) ); -#endif - -/* Fillers to make layering more clear */ -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -#define _BASE 0 -#define _CODE 1 -#define _NAVI 2 -#define _FUNC 3 -#define _SYMB 4 -#define _NUMB 5 -#define _MARO 6 -#define _RGB 7 -#define _ADJUST 8 -#define _GAME 9 - -/* RGB colors */ -#define RGB_Layer_1_Base_Color 0, 128, 0 -#define RGB_Layer_2_Base_Color 0,0,0 -#define RGB_Layer_3_Base_Color 0,0,0 -#define RGB_Layer_4_Base_Color 0,0,0 -#define RGB_Layer_5_Base_Color 0,0,0 -#define RGB_Layer_6_Base_Color 64, 0, 64 -#define RGB_Layer_7_Base_Color 0, 0,0 -#define RGB_Layer_8_Base_Color 0,0,0 -#define RGB_Layer_9_Base_Color 0,0,0 -#define RGB_Caps_Color 6,50,50 -#define RGB_TAP_On_Color 0,128,0 -#define RGB_TAP_Off_Color 128,0,0 -#define RGB_TAP_Base_Color 0,0,0 - -extern rgblight_config_t rgblight_config; -bool NUMLAY_STATUS = false; -int RGB_LAYER0_mode = 6; -bool RGB_TAP_STATE = false; -static uint8_t current_layer = 0; -static bool has_layer_changed = true; -static bool save_rgbmode = true; -static bool caps = false; - -/* Tap Dance function */ -void dance_cln_finished( qk_tap_dance_state_t* state, void* user_data ) -{ - if ( state->count == 1 ) - { - register_code( KC_LSFT ); - } else { - layer_on( _SYMB ); - #ifdef AUDIO_ENABLE - PLAY_SONG( tone_taps ); - #endif - } -} - - -void dance_cln_reset( qk_tap_dance_state_t* state, void* user_data ) -{ - if ( state->count == 1 ) - { - unregister_code( KC_LSFT ); - }else { - uint8_t layer = biton32( layer_state ); - if ( layer == _SYMB ) - { - layer_off( _SYMB ); - rgblight_mode( RGB_LAYER0_mode ); - } - } -} - -enum my_keycodes { - RGB_TAP = SAFE_RANGE, - KC_00 -}; - -/* Tap Dance Declarations */ -enum { - TD_Mute_Next = 0, - TD_SFT, - TD_LBRC, - TD_RBRC -}; - -/* Tap Dance Definitions */ -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_Mute_Next] = ACTION_TAP_DANCE_DOUBLE( KC_MUTE, KC_MNXT ) - ,[TD_SFT] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, dance_cln_finished, dance_cln_reset ) - ,[TD_LBRC] = ACTION_TAP_DANCE_DOUBLE( KC_LBRC, KC_LCBR ) - ,[TD_RBRC] = ACTION_TAP_DANCE_DOUBLE( KC_RBRC, KC_RCBR ) -}; - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* BASE - QWERTY - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | BS | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * shift + Esc = ~ --> | Esc | A | S | D | F | G | H | J | K | L | ; | Enter| <-- shift + Enter = " - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / | Mute | - * |------+------+------+------+------+------+------+------+------+------+------+------| <-- tap: 1.Mute 2.Next - * | Ctrl | GUI | Alt | [ | - | Space | = | ] | Fx | \ | Del | - * `-----------------------------------------------------------------------------------' - */ - -[_BASE] = LAYOUT_planck_mit( - LT( _ADJUST,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT( _NUMB,KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, LT( _RGB, KC_L ), KC_SCLN, KC_ENT, - TD( TD_SFT ), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, TD( TD_Mute_Next ), - KC_LCTL, KC_LGUI, KC_LALT, TD( TD_LBRC ), LT( _NAVI, KC_MINS ), LT( _CODE, KC_SPC ), LT( _FUNC, KC_EQL ), TD( TD_RBRC ), KC_LEFT, KC_DOWN, KC_RGHT ), - -/* Code - * ,-----------------------------------------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | < | [ | { | ( | & | Left | Down | Up | Down | ; | ' | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | > | ] | } | ) | | | | | , | . | / | Play | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | [ | BkSp | ======= | Del | ] | | \ | | - * `-----------------------------------------------------------------------------------' - */ - -[_CODE] = LAYOUT_planck_mit( /* 1 - Code */ - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - KC_GRV, KC_LABK, KC_LBRC, KC_LCBR, KC_LPRN, KC_AMPR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_QUOT, - _______, KC_RABK, KC_RBRC, KC_RCBR, KC_RPRN, KC_PIPE, XXXXXXX, XXXXXXX, _______, _______, KC_SLSH, KC_MPLY, - _______, _______, _______, KC_LBRC, KC_BSPC, _______, KC_DEL, KC_RBRC, _______, KC_BSLS, _______ ), - -/* Navi - * ,-----------------------------------------------------------------------------------. - * | | | | PgUp | | | | |Insert| |Prtsc | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | | Home | PgDn | End | | | | |SrcLck| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | Break| | | | | PgUp | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Home | PgDn | End | - * `-----------------------------------------------------------------------------------' - */ - -[_NAVI] = LAYOUT_planck_mit( - _______, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, _______, - KC_TILD, XXXXXXX, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, _______, _______, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END ), - -/* Func - * ,-----------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F11 | F12 | | | | | | | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - -[_FUNC] = LAYOUT_planck_mit( - _______ , KC_F1, KC_F2 , KC_F3, KC_F4, KC_F5, KC_F6 , KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______ , KC_F12, KC_F12 , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - _______ , XXXXXXX, XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - _______ , _______, _______ , _______, _______, _______, _______ , _______, _______, _______, _______ ), - - -/* Symb - double tap shift - * ,-----------------------------------------------------------------------------------. - * | | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | | | | : | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | < | > | ? | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | { | _ | | + | } | | | | - * `-----------------------------------------------------------------------------------' - */ - -[_SYMB] = LAYOUT_planck_mit( - KC_PIPE, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COLN, KC_DQUO, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LABK, KC_RABK, KC_QUES, _______, - _______, _______, _______, KC_LCBR, KC_UNDS, _______, KC_PLUS, KC_RCBR, _______, KC_PIPE, _______ ), - -/* Number - * ,-----------------------------------------------------------------------------------. - * | | + | - | | | | | 7 | 8 | 9 | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | * | / | = | | | | 4 | 5 | 6 | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | 1 | 2 | 3 | |Layer0| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | 0 | 00 | . | | | - * `-----------------------------------------------------------------------------------' - */ - -[_NUMB] = LAYOUT_planck_mit( /* 5 - Numpad */ - _______, KC_PPLS, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, XXXXXXX, _______, - _______, KC_PAST, KC_PSLS, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, XXXXXXX, _______, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX, TO( 0 ), - _______, _______, _______, _______, _______, XXXXXXX, KC_0, KC_00, KC_DOT, XXXXXXX, _______ ), - -/* MARO Empty - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - -[_MARO] = LAYOUT_planck_mit( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - -/* RGB - * ,-----------------------------------------------------------------------------------. - * | | | | | | _TAP | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | MOD | M_R | M_SW | M_K | M_X | M_G | | | | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | HUI | SAI | VAI | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | HUD | SAD | VAD | | | RGB_TOG | | | | | | - * `-----------------------------------------------------------------------------------' - */ - -[_RGB] = LAYOUT_planck_mit( - _______, _______, _______, _______, _______, RGB_TAP, _______, _______, _______, _______, _______, _______, - RGB_MOD, RGB_M_R, RGB_M_SW, RGB_M_K, RGB_M_X, RGB_M_G, _______, _______, _______, _______, _______, _______, - RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, - RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, RGB_TOG, _______, _______, _______, _______, _______ ), - -/* Func - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | |Layer0| Rest | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps | | | | | Game | | | | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | Numb | Music| | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - -[_ADJUST] = LAYOUT_planck_mit( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO( 0 ), RESET , - KC_CAPS, _______, _______, _______, _______, TO(_GAME), _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, TO(_NUMB), MU_TOG, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - -[_GAME] = LAYOUT_planck_mit( - XXXXXXX,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, - XXXXXXX,KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX,KC_LCTL, KC_A, KC_S, KC_D, KC_B, KC_N, KC_M, XXXXXXX, XXXXXXX, KC_UP, TO( 0 ), - XXXXXXX,KC_LSFT, KC_Z, KC_X, KC_C, KC_SPC, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT ), + [0] = LAYOUT_planck_mit( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, KC_MINS, LT(1, KC_SPC), KC_EQL, KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT, + KC_VOLD, KC_VOLU, KC_PGDN, KC_PGUP), + [1] = LAYOUT_planck_mit( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; -/* Encoder */ -static uint8_t encoder_state = 0; -static int8_t encoder_value = 0; -static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; - -/* Timer */ -static uint16_t TAP_RGB_timer; +extern rgblight_config_t rgblight_config; +int RGB_LAYER0_mode = 6; +static uint8_t current_layer = 0; +static bool has_layer_changed = true; +uint16_t i = 0; +uint16_t j = 0; static uint16_t RGB_encoder_timer; +static uint16_t RGB_encoder_timer2; +static uint8_t RGB_encoder_dir = 0; -/* Encoder state RGB_display */ -static uint8_t RGB_encoder_count=6; -static bool RGB_encoder_bool = false; - -/* RGB tap HUE */ -static uint16_t Type_Hue=270; - -void matrix_init_user( void ) -{ - _delay_ms( 200 ); - - /* Encoder init */ - encoder_state = PIND & 0x3; +const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = { + 30, + 5, + -5 +}; - /* Timer init */ - RGB_encoder_timer= timer_read(); - TAP_RGB_timer= timer_read(); +void matrix_init_user(void) { + RGB_encoder_timer = timer_read(); + RGB_encoder_timer2 = timer_read(); } +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); -void matrix_scan_user( void ) -{ -/* Layer */ - uint8_t layer = biton32( layer_state ); - -/* Encoder */ - encoder_state <<= 2; - encoder_state |= (PIND & 0x3); - encoder_value += encoder_LUT[encoder_state & 0xF]; - -/* Encoder state RGB display */ - if (RGB_encoder_bool){ - if (timer_elapsed(RGB_encoder_timer) > 2500) { - RGB_encoder_bool=false; - if (RGB_TAP_STATE) { - rgblight_mode( 1 ); - rgblight_setrgb( RGB_TAP_Base_Color ); - }else{ - rgblight_mode( RGB_LAYER0_mode ); - } - } - } - -/* Display the Caps state */ - if (caps==true){ - rgblight_setrgb_at(RGB_Caps_Color,12); - } - -/* Start of Encoder clockwise */ - if ( encoder_value >= 4 ) { - - /* Start of Encoder state RGB_display */ - if (!RGB_encoder_bool){ - RGB_encoder_timer=timer_read(); - RGB_encoder_bool=true; - RGB_encoder_count=5; - rgblight_mode(1); - rgblight_setrgb( 0,0,0 ); - }else if (RGB_encoder_bool && timer_elapsed(RGB_encoder_timer) < 800) { - RGB_encoder_timer=timer_read(); - RGB_encoder_count-=1; - if (RGB_encoder_count>5 || RGB_encoder_count<1){ - RGB_encoder_count=5; + if (RGB_encoder_dir != 0) { + if (timer_elapsed(RGB_encoder_timer) > 1400) { + RGB_encoder_dir = 0; + rgblight_mode(RGB_LAYER0_mode); + } else { + if (timer_elapsed(RGB_encoder_timer2) > 700) { rgblight_setrgb(0, 0, 0); + RGB_encoder_timer2 = timer_read(); } - } - rgblight_setrgb_at(0,255,0,5); - if (RGB_encoder_count<1) {RGB_encoder_count=1;} - switch (RGB_encoder_count) { - case 5: - rgblight_setrgb_at(0, 255, 0,4); - break; - case 4: - rgblight_setrgb_at(0, 255, 0,3); - break; - case 3: - rgblight_setrgb_at(0, 255, 0,2); - break; - case 2: - rgblight_setrgb_at(0, 255, 0,1); - break; - case 1: - rgblight_setrgb_at(0, 255, 0,0); - break; + if (timer_elapsed(RGB_encoder_timer2) > 80) { + if (RGB_encoder_dir == 1) { + rgblight_setrgb_at(128, 128, 0, 19); + } else { + rgblight_setrgb_at(128, 128, 0, 16); + } } - /* End of Encoder state RGB_display */ - - /* Start of Set Encoder Keycode */ - switch ( layer ) - { - case 0: - register_code( KC_VOLD ); - unregister_code( KC_VOLD ); - break; - case _CODE: - register_code( KC_LEFT ); - unregister_code( KC_LEFT ); - break; - case _RGB: - rgblight_decrease_val(); - break; - case _NUMB: - register_code( KC_LEFT ); - unregister_code( KC_LEFT ); - break; - case _MARO: - register_code( KC_UP ); - unregister_code( KC_UP ); - break; - default: - register_code( KC_VOLD ); - unregister_code( KC_VOLD ); - } - /* End of Set Encoder Keycode */ - - } - -/* End of Encoder clockwise */ - -/* Start of Encoder anti-clockwise */ - if ( encoder_value <= -4 ) - { - /* Start of Encoder state RGB_display */ - if (!RGB_encoder_bool){ - RGB_encoder_timer=timer_read(); - RGB_encoder_bool=true; - RGB_encoder_count=6; - rgblight_mode(1); - rgblight_setrgb( 0,0,0 ); - }else if (RGB_encoder_bool && timer_elapsed(RGB_encoder_timer) < 800) { - RGB_encoder_timer=timer_read(); - RGB_encoder_count+=1; - if (RGB_encoder_count<6 || RGB_encoder_count> 10){ - RGB_encoder_count=6; - rgblight_setrgb(0, 0, 0); + if (timer_elapsed(RGB_encoder_timer2) > 180) { + if (RGB_encoder_dir == 1) { + rgblight_setrgb_at(160, 160, 0, 8); + } else { + rgblight_setrgb_at(160, 160, 0, 3); + } + } + if (timer_elapsed(RGB_encoder_timer2) > 280) { + if (RGB_encoder_dir == 1) { + rgblight_setrgb_at(192, 192, 0, 9); + } else { + rgblight_setrgb_at(192, 192, 0, 2); + } + } + if (timer_elapsed(RGB_encoder_timer2) > 400) { + if (RGB_encoder_dir == 1) { + rgblight_setrgb_at(224, 224, 0, 10); + } else { + rgblight_setrgb_at(224, 224, 0, 1); + } } - } - rgblight_setrgb_at(0, 0,255,6); - if (RGB_encoder_count>11) { - RGB_encoder_count=11; - } - switch (RGB_encoder_count) { - case 6: - rgblight_setrgb_at(0, 0,255,7); - break; - case 7: - rgblight_setrgb_at(0, 0,255,8); - break; - case 8: - rgblight_setrgb_at(0, 0,255,9); - break; - case 9: - rgblight_setrgb_at(0, 0,255,10); - break; - case 10: - rgblight_setrgb_at(0, 0,128,11); - break; - } - /* End of Encoder state RGB_display */ - - /* Start of Set Encoder Keycode */ - switch ( layer ) - { - case 0: - register_code( KC_VOLU ); - unregister_code( KC_VOLU ); - break; - case _CODE: - register_code( KC_RGHT ); - unregister_code( KC_RGHT ); - break; - case _RGB: - rgblight_increase_val(); - break; - case _NUMB: - register_code( KC_RGHT ); - unregister_code( KC_RGHT ); - break; - case _MARO: - register_code( KC_DOWN ); - unregister_code( KC_DOWN ); - break; - default: - register_code( KC_VOLU ); - unregister_code( KC_VOLU ); - } - /* End of Set Encoder Keycode */ - -} - -/* End of Encoder anti-clockwise */ - - encoder_value %= 4; - -/* Start of RGB with Layer change */ - - /* Save the Layer0 RGB state */ - if ( save_rgbmode == true ) { - if (RGB_TAP_STATE==false) - { - RGB_LAYER0_mode = rgblight_config.mode; } } - save_rgbmode = false; - /* When the layer is changed */ - if ( layer != current_layer && caps == false) { - has_layer_changed = true; - current_layer = layer; /* update layer information */ + /* layer rgb */ + if (layer != current_layer) { + has_layer_changed = true; + current_layer = layer; } - /* Check for layer change, and apply color if its changed since last check */ - if ( has_layer_changed ) - { - /* change backlight based on layer. These should be numbers or whatever you defined the layers as */ - switch ( layer ) - { - case 0: - - /* if the key tap RGB effect is enable */ - if (RGB_TAP_STATE==true){ - rgblight_mode(1); - rgblight_setrgb( RGB_TAP_Base_Color ); - } - else{ - rgblight_mode( RGB_LAYER0_mode ); + if (has_layer_changed) { + if (layer == 0) { + rgblight_mode(RGB_LAYER0_mode); + } else { + rgblight_mode(1); + for (i = 0; i < 48; i++) { + (i > 41) ? (j = i - 1) : (j = i); + uint16_t kc = keymap_key_to_keycode(layer, (keypos_t) {.row = 0, .col = i + }); + if (kc == KC_TRNS) { + setrgb(5, 5, 5, (LED_TYPE * ) & led[j]); /* TRNS color 0-255*/ + } else if (kc == KC_NO) { + setrgb(0, 0, 0, (LED_TYPE * ) & led[j]); /* NO color 0-255*/ + } else { + if (layer == 1) { + setrgb(128, 64, 0, (LED_TYPE * ) & led[j]); /* 1 layer 0-255*/ + } else if (layer == 2) { + setrgb(0, 64, 128, (LED_TYPE * ) & led[j]); /* 2*/ + } else if (layer == 3) { + setrgb(64, 128, 0, (LED_TYPE * ) & led[j]); /* 3*/ + } else if (layer == 4) { + setrgb(0, 128, 64, (LED_TYPE * ) & led[j]); /* 4*/ + } else if (layer == 5) { + setrgb(128, 0, 128, (LED_TYPE * ) & led[j]); /* 5*/ + } else if (layer == 6) { + setrgb(128, 0, 128, (LED_TYPE * ) & led[j]); /* 6*/ + } else if (layer == 7) { + setrgb(128, 128, 0, (LED_TYPE * ) & led[j]); /* 7*/ + } else if (layer == 8) { + setrgb(0, 128, 128, (LED_TYPE * ) & led[j]); /* 8*/ + } else if (layer == 9) { + setrgb(128, 192, 64, (LED_TYPE * ) & led[j]); /* 9*/ + } else if (layer == 10) { + setrgb(64, 192, 128, (LED_TYPE * ) & led[j]); /* 10*/ + } else if (layer == 11) { + setrgb(128, 64, 192, (LED_TYPE * ) & led[j]); /* 11*/ + } else if (layer == 12) { + setrgb(64, 128, 192, (LED_TYPE * ) & led[j]); /* 12*/ + } else if (layer == 13) { + setrgb(128, 192, 0, (LED_TYPE * ) & led[j]); /* 13*/ + } else if (layer == 14) { + setrgb(192, 0, 128, (LED_TYPE * ) & led[j]); /* 14*/ + } else if (layer == 15) { + setrgb(0, 192, 128, (LED_TYPE * ) & led[j]); /* 15*/ + } } - break; - - case _CODE: //1 -/* Save Layer0 RGB state */ - RGB_LAYER0_mode = rgblight_config.mode; - -/* set all the RGB color under the switch */ - rgblight_mode( 1 ); - rgblight_setrgb(RGB_Layer_1_Base_Color); - - /* set each of the RGB led color under the switch */ - rgblight_setrgb_at(64, 64, 64,1); // Q - rgblight_setrgb_at(64, 64, 64,2); // W - rgblight_setrgb_at(64, 64, 64,3); // E - rgblight_setrgb_at(64, 64, 64,4); // R - rgblight_setrgb_at(64, 64, 64,5); // T - rgblight_setrgb_at(64, 64, 64,6); // Y - rgblight_setrgb_at(64, 64, 64,7); // U - rgblight_setrgb_at(64, 64, 64,8); // I - rgblight_setrgb_at(64, 64, 64,9); // O - rgblight_setrgb_at(64, 64, 64,10); // P - rgblight_setrgb_at(64, 0, 0,40); // - - rgblight_setrgb_at(64, 0, 0,42); // = - break; - - case _NAVI: //2 - RGB_LAYER0_mode = rgblight_config.mode; - - rgblight_mode( 1 ); - rgblight_setrgb(RGB_Layer_2_Base_Color); - - rgblight_setrgb_at(64, 0, 64,3); - rgblight_setrgb_at(64, 0, 64,14); - rgblight_setrgb_at(64, 0, 64,15); - rgblight_setrgb_at(64, 0, 64,16); - rgblight_setrgb_at(64, 64, 0,8); - rgblight_setrgb_at(64, 64, 0,10); - rgblight_setrgb_at(64, 64, 0,21); - rgblight_setrgb_at(64, 64, 0,29); - rgblight_setrgb_at(64, 0, 0,11); - rgblight_setrgb_at(0, 0, 64,34); - rgblight_setrgb_at(0, 0, 64,44); - rgblight_setrgb_at(0, 0, 64,45); - rgblight_setrgb_at(0, 0, 64,46); - break; - case _FUNC: //3 - RGB_LAYER0_mode = rgblight_config.mode; - - rgblight_mode( 1 ); - rgblight_setrgb(RGB_Layer_3_Base_Color); - - rgblight_setrgb_at(0, 0, 64,1); - rgblight_setrgb_at(0, 0, 64,2); - rgblight_setrgb_at(0, 0, 64,3); - rgblight_setrgb_at(0, 0, 64,4); - rgblight_setrgb_at(0, 0, 64,5); - rgblight_setrgb_at(0, 0, 64,6); - rgblight_setrgb_at(0, 0, 64,7); - rgblight_setrgb_at(0, 0, 64,8); - rgblight_setrgb_at(0, 0, 64,9); - rgblight_setrgb_at(0, 0, 64,10); - rgblight_setrgb_at(0, 0, 64,13); - rgblight_setrgb_at(0, 0, 64,14); - break; - - case _SYMB: //4 - RGB_LAYER0_mode = rgblight_config.mode; - - rgblight_mode( 1 ); - rgblight_setrgb(RGB_Layer_4_Base_Color); - - rgblight_setrgb_at(0, 64, 64,1); - rgblight_setrgb_at(0, 64, 64,2); - rgblight_setrgb_at(0, 64, 64,3); - rgblight_setrgb_at(0, 64, 64,4); - rgblight_setrgb_at(0, 64, 64,5); - rgblight_setrgb_at(0, 64, 64,6); - rgblight_setrgb_at(0, 64, 64,7); - rgblight_setrgb_at(0, 64, 64,8); - rgblight_setrgb_at(0, 64, 64,9); - rgblight_setrgb_at(0, 64, 64,10); - rgblight_setrgb_at(0, 64, 64,12); - rgblight_setrgb_at(0, 64, 64,22); - rgblight_setrgb_at(0, 64, 64,23); - rgblight_setrgb_at(0, 64, 64,32); - rgblight_setrgb_at(0, 64, 64,33); - rgblight_setrgb_at(0, 64, 64,34); - rgblight_setrgb_at(0, 64, 64,39); - rgblight_setrgb_at(0, 64, 64,40); - rgblight_setrgb_at(0, 64, 64,42); - rgblight_setrgb_at(0, 64, 64,43); - break; - - case _NUMB: //5 - RGB_LAYER0_mode = rgblight_config.mode; - - rgblight_mode( 1 ); - rgblight_setrgb(RGB_Layer_5_Base_Color); - - rgblight_setrgb_at(0,64,0,1); - rgblight_setrgb_at(0,64,0,2); - rgblight_setrgb_at(0,64,0,13); - rgblight_setrgb_at(0,64,0,14); - rgblight_setrgb_at(0,64,64,15); - rgblight_setrgb_at(64,64,64,7); - rgblight_setrgb_at(64,64,64,8); - rgblight_setrgb_at(64,64,64,9); - rgblight_setrgb_at(64,64,64,19); - rgblight_setrgb_at(64,64,64,20); - rgblight_setrgb_at(64,64,64,21); - rgblight_setrgb_at(64,64,64,31); - rgblight_setrgb_at(64,64,64,32); - rgblight_setrgb_at(64,64,64,33); - rgblight_setrgb_at(64,64,64,42); - rgblight_setrgb_at(64,64,64,43); - rgblight_setrgb_at(0,128,0,44); - break; - case _MARO: //6 - RGB_LAYER0_mode = rgblight_config.mode; - - rgblight_mode( 1 ); - rgblight_setrgb(RGB_Layer_6_Base_Color); - break; - - case _RGB: //7 - RGB_LAYER0_mode = rgblight_config.mode; - - rgblight_mode( 1 ); - rgblight_setrgb(RGB_Layer_7_Base_Color); - - rgblight_setrgb_at(1,143,225,0); - rgblight_setrgb_at(39,21,107,1); - rgblight_setrgb_at(208,0,0,2); - rgblight_setrgb_at(64,64,64,21); - break; - case _ADJUST: //8 - RGB_LAYER0_mode = rgblight_config.mode; - - rgblight_mode( 1 ); - rgblight_setrgb(RGB_Layer_8_Base_Color); - - rgblight_setrgb_at(0,64,0,10); - rgblight_setrgb_at(64,0,0,11); - rgblight_setrgb_at(0,64,0,17); - rgblight_setrgb_at(0,64,0,30); - rgblight_setrgb_at(6,50,50,12); - break; - - case _GAME: //9 - RGB_LAYER0_mode = rgblight_config.mode; - - rgblight_mode( 1 ); - rgblight_setrgb(RGB_Layer_9_Base_Color); - - rgblight_setrgb_at(0,0,64,15); - rgblight_setrgb_at(0,0,64,26); - rgblight_setrgb_at(0,0,64,27); - rgblight_setrgb_at(0,0,64,28); - rgblight_setrgb_at(64,0,0,35); - break; - - default: - rgblight_mode( RGB_LAYER0_mode ); + } + rgblight_set(); } has_layer_changed = false; } -/* End of RGB with Layer change */ - -} // End of matrix_scan_user - - - -/* shift + enter = " from:https://github.com/qmk/qmk_firmware/blob/e899cb8940da04fa2610604f0aab417db7fac119/keyboards/mitosis/keymaps/datagrok/keymap.c */ - -bool comm_shifted = false; -bool ques_shifted = false; -static uint8_t key_index = 0; -uint8_t shifted; -uint16_t s_keycode; -bool *k_shifted; - -bool process_record_user( uint16_t keycode, keyrecord_t *record ){ - -/* Start of key tap RGB effect */ - if ( RGB_TAP_STATE ==true ) { - key_index=(record->event.key.col)+(record->event.key.row)*12; - -/* Change the Hue of the RGB color with the type speed */ - if (timer_elapsed(TAP_RGB_timer) >10000){ - TAP_RGB_timer=timer_read(); - Type_Hue=270; - }else if (timer_elapsed(TAP_RGB_timer) >1000){ - Type_Hue+=30; - if (Type_Hue>270) { - Type_Hue=270;} - }else{ - TAP_RGB_timer=timer_read(); - Type_Hue-=10; - if (Type_Hue<10) { - Type_Hue=10;} - } - if (key_index>42){ //fix the RGB index of the MIT layout position - key_index=key_index-1; - } - if ( record->event.pressed ) { - rgblight_sethsv_at(Type_Hue,255,255,key_index); - } else { - rgblight_setrgb_at(RGB_TAP_Base_Color,key_index); - } - } -/* End of key tap RGB effect */ - - switch ( keycode ) - { - /* save the RGB state when set the new */ - case RGB_M_R: - save_rgbmode = true; - break; - case RGB_M_SW: - save_rgbmode = true; - break; - case RGB_M_X: - save_rgbmode = true; - break; - case RGB_M_G: - save_rgbmode = true; - break; - case RGB_MODE_KNIGHT: - save_rgbmode = true; - break; - -/* Define a New Keycode: double zero */ - case KC_00: - if (record->event.pressed) { - // Do something when pressed - } else { - register_code( KC_0 ); // send 0 - unregister_code( KC_0 ); - - register_code( KC_0 ); // send 0 twice without macro - unregister_code( KC_0 ); - } - return false; // Skip all further processing of this key - - /* when the REST key is pressed the 'R' key will RED,the "Bottom Left"(esc of qmk-dfu) will be GREEN */ - case RESET: - rgblight_mode( 1 ); - rgblight_setrgb( 0, 0, 0 ); - rgblight_setrgb_at(128, 0, 0,4); // R - rgblight_setrgb_at(6, 128, 24,36); // Bottom Left key - break; - -/* Define a New Keycode: key tap RGB effect toggle */ - case RGB_TAP: - if ( !(record->event.pressed)) { - /* If enable,the 'On' key will be green */ - if (RGB_TAP_STATE) { - RGB_TAP_STATE=false; - rgblight_mode( 1 ); - rgblight_setrgb( RGB_TAP_Base_Color ); - rgblight_setrgb_at(RGB_TAP_Off_Color,16); // O - on - }else{ - /* If disenable,the 'oFf' key will be red */ - RGB_TAP_STATE=true; - rgblight_mode( 1 ); - rgblight_setrgb( RGB_TAP_Base_Color ); - rgblight_setrgb_at(RGB_TAP_On_Color,9); // F - off - } - } - break; + /* end of layer rgb */ +} -/* special shift keys */ - case KC_ENT: - s_keycode = KC_QUOT; - k_shifted = &ques_shifted; - break; - case KC_UP: - s_keycode = KC_SLSH; - k_shifted = &ques_shifted; - break; - case KC_DOWN: - s_keycode = KC_BSLS; - k_shifted = &ques_shifted; +bool process_record_user(uint16_t keycode, keyrecord_t * record) { + switch (keycode) { + case RGB_MOD: + RGB_LAYER0_mode = rgblight_config.mode; break; default: - return(true); + return (true); } + return (true); +} - shifted = get_mods() & (MOD_BIT( KC_LSHIFT ) | MOD_BIT( KC_RSHIFT ) ); - - /* Keydown. If shift is currently pressed, register its alternate keycode. */ - if ( record->event.pressed && shifted ) - { - *k_shifted = true; - register_code( s_keycode ); - return(false); - /* - * Keyup. If shift was pressed back when the key was pressed, unregister - * its alternate keycode. - */ - } else if ( !(record->event.pressed) && *k_shifted ) { - *k_shifted = false; - unregister_code( s_keycode ); - return(false); - /* Otherwise, behave as normal. */ +void encoder_update_user(uint8_t index, bool clockwise) { + RGB_encoder_timer = timer_read(); + RGB_encoder_timer2 = timer_read(); + uint8_t layer = biton32(layer_state); + if (clockwise) { + RGB_encoder_dir = 1; } else { - return(true); + RGB_encoder_dir = -1; } - -} // End ofprocess_record_user - - -void led_set_user( uint8_t usb_led ) -{ - static uint8_t old_usb_led = 0; - _delay_ms( 10 ); /* gets rid of tick */ - - if ( (usb_led & (1 << USB_LED_CAPS_LOCK) ) && !(old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) { -/* CAPS on */ - caps= true; - rgblight_setrgb( 0,0,0 ); - rgblight_setrgb_at(RGB_Caps_Color,12); // caps key - #ifdef AUDIO_ENABLE - PLAY_SONG( tone_caps ); - #endif - }else if ( !(usb_led & (1 << USB_LED_CAPS_LOCK) ) && (old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) { - -/* CAPS off */ - caps= false; - if (RGB_TAP_STATE==false){ - rgblight_mode( RGB_LAYER0_mode ); - }else{ - rgblight_mode(1); - rgblight_setrgb( 0,0,0 ); + if (index == 0) /* Right encoder */ { + if (clockwise) { + register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 11 + })); + unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 11 + })); + } else { + register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 10 + })); + unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 10 + })); + } + } else if (index == 1) /* Left encoder */ { + if (clockwise) { + register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 1 + })); + unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 1 + })); + } else { + register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 0 + })); + unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 0 + })); } - #ifdef AUDIO_ENABLE - PLAY_SONG( tone_caps ); - #endif } - old_usb_led = usb_led; -} // End of led_set_user - +} diff --git a/keyboards/tetris/readme.md b/keyboards/tetris/readme.md index b74740854af..260d453a84c 100644 --- a/keyboards/tetris/readme.md +++ b/keyboards/tetris/readme.md @@ -2,6 +2,8 @@ Tetris === A compact 40% (12x4) ortholinear keyboard (Planck Mit layout) with per switch RGB and encoder made by Fengz. +Fake keys on the 5th row are for configuring the encoder's keycode. + ![TetrisPhoto](https://i.imgur.com/quwEY0f.jpg) More: [Imgur](https://imgur.com/gallery/Azq2zUm). @@ -12,4 +14,4 @@ Make example for this keyboard (after setting up your build environment): make tetris:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/tetris/rules.mk b/keyboards/tetris/rules.mk old mode 100644 new mode 100755 index 784f6e4623b..c3e641c8f21 --- a/keyboards/tetris/rules.mk +++ b/keyboards/tetris/rules.mk @@ -36,25 +36,25 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + # Boot Section Size in *bytes* #OPT_DEFS += -DBOOTLOADER_SIZE=4096 BOOTLOADER =qmk-dfu + # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -AUDIO_ENABLE ?= yes -RGBLIGHT_ENABLE ?= yes -TAP_DANCE_ENABLE = no -EXTRAFLAGS += -flto # Make the hex smaller - -LAYOUTS = planck_mit +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = yes +EXTRAFLAGS = -flto +ENCODER_ENABLE = yes diff --git a/keyboards/tetris/tetris.c b/keyboards/tetris/tetris.c old mode 100644 new mode 100755 index 8d494c17f3e..f78de2f7be6 --- a/keyboards/tetris/tetris.c +++ b/keyboards/tetris/tetris.c @@ -1 +1 @@ -#include "tetris.h" +#include QMK_KEYBOARD_H diff --git a/keyboards/tetris/tetris.h b/keyboards/tetris/tetris.h old mode 100644 new mode 100755 index 0a036ec3b33..f5d13e5c2f8 --- a/keyboards/tetris/tetris.h +++ b/keyboards/tetris/tetris.h @@ -7,12 +7,14 @@ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ - K300, K301, K302, K303, K304, K305, K307, K308, K309, K310, K311 \ + K300, K301, K302, K303, K304, K305, K307, K308, K309, K310, K311, \ + K400, K401, K410, K411 \ ) { \ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ - { K300, K301, K302, K303, K304, K305, KC_NO, K307, K308, K309, K310, K311 } \ + { K300, K301, K302, K303, K304, K305, KC_NO, K307, K308, K309, K310, K311 }, \ + { K400, K401, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K410, K411 } \ } -#endif \ No newline at end of file +#endif diff --git a/keyboards/tgr/jane/config.h b/keyboards/tgr/jane/config.h new file mode 100644 index 00000000000..a5d63f621bb --- /dev/null +++ b/keyboards/tgr/jane/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define MANUFACTURER TGR +#define PRODUCT Jane + +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +// 0 1 2 3 4 5 6 7 8 9 A B C D E +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCE 5 + +#define BACKLIGHT_LEVELS 1 diff --git a/keyboards/tgr/jane/info.json b/keyboards/tgr/jane/info.json new file mode 100644 index 00000000000..6fab4db1ed6 --- /dev/null +++ b/keyboards/tgr/jane/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "TGR Jane v2", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5}, {"x":14, "y":1.5}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.5, "y":2.5, "w":1.5}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"x":13.75, "y":3.5, "w":1.25}, {"x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5}, {"x":2.25, "y":5.5}, {"x":3.25, "y":5.5, "w":1.25}, {"x":4.5, "y":5.5, "w":1.25}, {"x":5.75, "y":5.5, "w":1.25}, {"x":7, "y":5.5, "w":1.25}, {"x":8.25, "y":5.5, "w":1.25}, {"x":9.5, "y":5.5, "w":1.25}, {"x":10.75, "y":5.5}, {"x":11.75, "y":5.5}, {"x":12.75, "y":5.5}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + }, + + "LAYOUT_tkl_ansi": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5, "w":2}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.5, "y":2.5, "w":1.5}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5, "w":2.25}, {"x":0, "y":4.5, "w":2.25}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":2.75}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5, "w":1.25}, {"x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"x":10, "y":5.5, "w":1.25}, {"x":11.25, "y":5.5, "w":1.25}, {"x":12.5, "y":5.5, "w":1.25}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + }, + + "LAYOUT_tkl_iso": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5, "w":2}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"x":13.75, "y":2.5, "w":1.25, "h":2}, {"x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":2.75}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5, "w":1.25}, {"x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"x":10, "y":5.5, "w":1.25}, {"x":11.25, "y":5.5, "w":1.25}, {"x":12.5, "y":5.5, "w":1.25}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/tgr/jane/jane.c b/keyboards/tgr/jane/jane.c new file mode 100644 index 00000000000..c17cb008486 --- /dev/null +++ b/keyboards/tgr/jane/jane.c @@ -0,0 +1,88 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "i2c_master.h" +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +void matrix_init_kb(void) { +#ifdef RGBLIGHT_ENABLE + if (rgblight_config.enable) { + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + } +#endif + // call user level keymaps, if any + matrix_init_user(); +} + +void matrix_scan_kb(void) { +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif + matrix_scan_user(); + /* Nothing else for now. */ +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // turn backlight LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} \ No newline at end of file diff --git a/keyboards/tgr/jane/jane.h b/keyboards/tgr/jane/jane.h new file mode 100644 index 00000000000..2008d49d9a2 --- /dev/null +++ b/keyboards/tgr/jane/jane.h @@ -0,0 +1,77 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_all( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k6B, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k6C, k6D, k6E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k7C, k7D, k7E, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k2E, \ + k50, k51, k52, k53, k54, k55, k57, k58, k59, k5A, k5B, k5C, k5D, k5E, k3E, k4E \ +){ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E }, \ + { k50, k51, k52, k53, k54, k55, KC_NO, k57, k58, k59, k5A, k5B, k5C, k5D, k5E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k6B, k6C, k6D, k6E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k7C, k7D, k7E }, \ +} + + +#define LAYOUT_tkl_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k6B, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k6C, k6D, k6E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k7C, k7D, k7E, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, \ + k40, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k2E, \ + k50, k51, k52, k55, k58, k59, k5A, k5D, k5E, k3E, k4E \ +){ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, KC_NO, k3D, k3E }, \ + { k40, KC_NO, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, KC_NO, k4E }, \ + { k50, k51, k52, KC_NO, KC_NO, k55, KC_NO, KC_NO, k58, k59, k5A, KC_NO, KC_NO, k5D, k5E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k6B, k6C, k6D, k6E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k7C, k7D, k7E }, \ +} + +#define LAYOUT_tkl_iso( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k6B, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k6C, k6D, k6E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k7C, k7D, k7E, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k2E, \ + k50, k51, k52, k55, k58, k59, k5A, k5D, k5E, k3E, k4E \ +){ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, KC_NO, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, KC_NO, k4E }, \ + { k50, k51, k52, KC_NO, KC_NO, k55, KC_NO, KC_NO, k58, k59, k5A, KC_NO, KC_NO, k5D, k5E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k6B, k6C, k6D, k6E }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k7C, k7D, k7E }, \ +} diff --git a/keyboards/tgr/jane/keymaps/default/config.h b/keyboards/tgr/jane/keymaps/default/config.h new file mode 100644 index 00000000000..93b81b57ba4 --- /dev/null +++ b/keyboards/tgr/jane/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 amnesia0287 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/tgr/jane/keymaps/default/keymap.c b/keyboards/tgr/jane/keymaps/default/keymap.c new file mode 100644 index 00000000000..e7579457e6f --- /dev/null +++ b/keyboards/tgr/jane/keymaps/default/keymap.c @@ -0,0 +1,27 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_tkl_ansi(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_INS ,KC_HOME,KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL ,KC_END ,KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT) \ +}; diff --git a/keyboards/tgr/jane/keymaps/default/readme.md b/keyboards/tgr/jane/keymaps/default/readme.md new file mode 100644 index 00000000000..983182da247 --- /dev/null +++ b/keyboards/tgr/jane/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Jane \ No newline at end of file diff --git a/keyboards/tgr/jane/keymaps/default/rules.mk b/keyboards/tgr/jane/keymaps/default/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/tgr/jane/readme.md b/keyboards/tgr/jane/readme.md new file mode 100644 index 00000000000..10986cde335 --- /dev/null +++ b/keyboards/tgr/jane/readme.md @@ -0,0 +1,47 @@ +# Jane v2 + +TKL Custom Keyboard. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: TGR Jane (Pontoporia) PCB v1.1, v1.2 +Hardware Availability: [Geekhack Group Buy](https://geekhack.org/index.php?topic=97552.1200) + + +Make example for this keyboard (after setting up your build environment): + + make tgr/jane:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +**Reset Key:** Hold down the key located at `K00`, commonly programmed as `Esc` while plugging in the keyboard. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/tgr/jane/rules.mk b/keyboards/tgr/jane/rules.mk new file mode 100644 index 00000000000..bf9aa79a86f --- /dev/null +++ b/keyboards/tgr/jane/rules.mk @@ -0,0 +1,50 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = no +RGBLIGHT_CUSTOM_DRIVER = no + +OPT_DEFS = -DDEBUG_LEVEL=0 + +QUANTUM_LIB_SRC = i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex + +LAYOUTS = tkl_ansi tkl_iso diff --git a/keyboards/tgr/jane/usbconfig.h b/keyboards/tgr/jane/usbconfig.h new file mode 100644 index 00000000000..54a7d20f142 --- /dev/null +++ b/keyboards/tgr/jane/usbconfig.h @@ -0,0 +1,393 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' +#define USB_CFG_DEVICE_NAME_LEN 8 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect diff --git a/keyboards/the_ruler/config.h b/keyboards/the_ruler/config.h index e72875c7662..ecae3a4f21c 100644 --- a/keyboards/the_ruler/config.h +++ b/keyboards/the_ruler/config.h @@ -49,9 +49,8 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -96,11 +95,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -155,7 +149,6 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - #define RGB_DI_PIN E6 // The pin your RGB strip is wired to #define RGBLED_NUM 1 // Number of LEDs #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/the_ruler/keymaps/default/config.h b/keyboards/the_ruler/keymaps/default/config.h index df06a262062..271f48d0011 100644 --- a/keyboards/the_ruler/keymaps/default/config.h +++ b/keyboards/the_ruler/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/the_ruler/keymaps/default/keymap.c b/keyboards/the_ruler/keymaps/default/keymap.c index e7af797b9dd..8b0f44b5ede 100644 --- a/keyboards/the_ruler/keymaps/default/keymap.c +++ b/keyboards/the_ruler/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" extern keymap_config_t keymap_config; @@ -18,10 +16,6 @@ enum custom_keycodes { FN_2 }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/keyboards/the_ruler/keymaps/default/rules.mk b/keyboards/the_ruler/keymaps/default/rules.mk index b491f5b3f3f..2791cc1054b 100644 --- a/keyboards/the_ruler/keymaps/default/rules.mk +++ b/keyboards/the_ruler/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/the_ruler/readme.md b/keyboards/the_ruler/readme.md index 3573514b684..63a6ffeee37 100644 --- a/keyboards/the_ruler/readme.md +++ b/keyboards/the_ruler/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make the_ruler:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/the_ruler/rules.mk b/keyboards/the_ruler/rules.mk index 6362176fea7..7eca12ad4f2 100644 --- a/keyboards/the_ruler/rules.mk +++ b/keyboards/the_ruler/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/thevankeyboards/bananasplit/config.h b/keyboards/thevankeyboards/bananasplit/config.h index 5649ab4aa64..7c0b5b201a2 100644 --- a/keyboards/thevankeyboards/bananasplit/config.h +++ b/keyboards/thevankeyboards/bananasplit/config.h @@ -48,7 +48,7 @@ along with this program. If not, see . #define BACKLIGHT_PIN B7 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 #define TAPPING_TERM 175 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ @@ -56,13 +56,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/0010/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/0010/keymap.c index 617812149c1..2744c910002 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/0010/keymap.c +++ b/keyboards/thevankeyboards/bananasplit/keymaps/0010/keymap.c @@ -67,7 +67,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______, ______, ______, ______, RESET, ______, ______, ______, ______, ______, KC_PGDN \ ), }; - - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk index 159fd7dc6c3..9da4bf91a57 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk +++ b/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk @@ -32,6 +32,3 @@ # RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/keymap.c index 275bfe32a14..8a35f896f0e 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/keymap.c +++ b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/keymap.c @@ -62,10 +62,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void matrix_init_user(void) { } diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk index 159fd7dc6c3..9da4bf91a57 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk +++ b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk @@ -32,6 +32,3 @@ # RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h b/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h index 060f5922f2c..b89b05009a6 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h +++ b/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/default/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/default/keymap.c index dcef38bca15..156e164a257 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/default/keymap.c +++ b/keyboards/thevankeyboards/bananasplit/keymaps/default/keymap.c @@ -20,6 +20,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk index 159fd7dc6c3..9da4bf91a57 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk +++ b/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk @@ -32,6 +32,3 @@ # RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/hhkbanana/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/hhkbanana/keymap.c index f2f829f93e3..e2c062dc56b 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/hhkbanana/keymap.c +++ b/keyboards/thevankeyboards/bananasplit/keymaps/hhkbanana/keymap.c @@ -20,6 +20,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c index 89e275daf7b..828c82673e7 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c +++ b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c @@ -87,6 +87,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MNXT ) }; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c index 859944991b8..107a6eed521 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c +++ b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c @@ -86,9 +86,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { -}; - /* Capslock's led cannot be controlled separately on bananasplit and you can only turn on/off all leds at once. If you only install led for capslock, it will look like capslock has toggable diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/keymap.c index 34306e18305..c0bc1b2686e 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/keymap.c +++ b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/keymap.c @@ -60,10 +60,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { case 0: diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk index 159fd7dc6c3..9da4bf91a57 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk +++ b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk @@ -32,6 +32,3 @@ # RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/nic/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/nic/keymap.c index 5ed1c65e999..39cfc0d8fe5 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/nic/keymap.c +++ b/keyboards/thevankeyboards/bananasplit/keymaps/nic/keymap.c @@ -40,6 +40,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/thevankeyboards/minivan/config.h b/keyboards/thevankeyboards/minivan/config.h index 726768e0ec9..22fb3776294 100644 --- a/keyboards/thevankeyboards/minivan/config.h +++ b/keyboards/thevankeyboards/minivan/config.h @@ -53,9 +53,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/thevankeyboards/minivan/keymaps/belak/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/belak/keymap.c index 19051574a5d..437b1881a4d 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/belak/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/belak/keymap.c @@ -43,9 +43,6 @@ uint16_t tap_dance_keys[] = { [BE_TD_ALT] = KC_LALT, }; -// Fillers to make layering more clear -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QW] = LAYOUT_arrow_command( /* Qwerty */ L2_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, @@ -73,8 +70,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = {}; - // Tap dance functions void mod_tap_fn(qk_tap_dance_state_t *state, void *user_data) { switch (state->count) { diff --git a/keyboards/thevankeyboards/minivan/keymaps/belak/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/belak/rules.mk index 61124112405..f9d8b0eb099 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/belak/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/belak/rules.mk @@ -7,6 +7,3 @@ MOUSEKEY_ENABLE = no # Mouse keys(+4700) NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work TAP_DANCE_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/budi/config.h b/keyboards/thevankeyboards/minivan/keymaps/budi/config.h index 67bcf3546e9..dc36b73808b 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/budi/config.h +++ b/keyboards/thevankeyboards/minivan/keymaps/budi/config.h @@ -4,10 +4,10 @@ #include "../../config.h" // place overrides here -#ifdef DEBOUNCING_DELAY -#undef DEBOUNCING_DELAY +#ifdef DEBOUNCE +#undef DEBOUNCE #endif -#define DEBOUNCING_DELAY 2 +#define DEBOUNCE 2 #define MOUSEKEY_INTERVAL 10 #define MOUSEKEY_DELAY 0 #define MOUSEKEY_TIME_TO_MAX 120 diff --git a/keyboards/thevankeyboards/minivan/keymaps/budi/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/budi/keymap.c index baa266e6353..f8b42cb79b0 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/budi/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/budi/keymap.c @@ -81,10 +81,6 @@ extern keymap_config_t keymap_config; #define XBACK LGUI(LALT(KC_LEFT)) #define XFFWD LGUI(LALT(KC_RIGHT)) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define xxxxxxx KC_NO - enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here SWTCH @@ -168,8 +164,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MN] = LAYOUT_arrow( ALTESC, CAG1, CAG2, CAG3, CAG4, CAG5, CAG6, CAG7, CAG8, CAG9, CAG0, SWTCH, ALTX, ALT1, ALT2, ALT3, ALT4, ALT5, ALT6, ALT7, ALT8, ALT9, ALT0, _______, - ALTEQL, MEH1, MEH2, MEH3, MEH4, MEH5, MEH6, MEH7, MEH8, MEH9, MEH0, xxxxxxx, - ALTMIN, xxxxxxx, XBACK, ALTL, ALTR, XFFWD, xxxxxxx, xxxxxxx, xxxxxxx + ALTEQL, MEH1, MEH2, MEH3, MEH4, MEH5, MEH6, MEH7, MEH8, MEH9, MEH0, XXXXXXX, + ALTMIN, XXXXXXX, XBACK, ALTL, ALTR, XFFWD, XXXXXXX, XXXXXXX, XXXXXXX ), @@ -187,9 +183,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FN] = LAYOUT_arrow( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, - _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, xxxxxxx, - _______, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, KC_PWR, KC_SLEP, KC_WAKE, xxxxxxx, xxxxxxx, xxxxxxx, - _______, KC_CAPS, _______, xxxxxxx, SWTCH, KC_RALT, xxxxxxx, RESET, _______ + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PWR, KC_SLEP, KC_WAKE, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_CAPS, _______, XXXXXXX, SWTCH, KC_RALT, XXXXXXX, RESET, _______ ) diff --git a/keyboards/thevankeyboards/minivan/keymaps/core/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/core/keymap.c index cf1e0d3f51e..95987e1ca85 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/core/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/core/keymap.c @@ -4,9 +4,6 @@ #define _L1 1 #define _L2 2 -// Fillers to make layering more clear -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QW] = LAYOUT( /* Qwerty */ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, @@ -27,6 +24,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______ ), }; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/thevankeyboards/minivan/keymaps/core/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/core/rules.mk index 457a3d01d4a..e69de29bb2d 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/core/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/core/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/default/config.h b/keyboards/thevankeyboards/minivan/keymaps/default/config.h index df06a262062..271f48d0011 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/default/config.h +++ b/keyboards/thevankeyboards/minivan/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/default/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/default/keymap.c index 90b188b55ff..ac19f8ccd99 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/default/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/default/keymap.c @@ -14,19 +14,16 @@ extern keymap_config_t keymap_config; #define _L2 4 #define _L3 5 -// Macro name shortcuts -#define QWERTY M(_QW) -#define DVORAK M(_DV) -#define COLEMAK M(_CM) - // Curly braces have their own keys. These are defined to make them not mess up // the grid in layer 2. #define L_CURBR LSFT(KC_LBRC) #define R_CURBR LSFT(KC_RBRC) -// Fillers to make layering more clear -#define _______ KC_TRNS - +enum custom_keycodes { + DVORAK = SAFE_RANGE, + QWERTY, + COLEMAK +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QW] = LAYOUT( /* Qwerty */ @@ -67,33 +64,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _DV: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case DVORAK: if (record->event.pressed) { persistent_default_layer_set(1UL<<_DV); } - break; - case _QW: + return false; + case QWERTY: if (record->event.pressed) { persistent_default_layer_set(1UL<<_QW); } - break; - case _CM: + return false; + case COLEMAK: if (record->event.pressed) { persistent_default_layer_set(1UL<<_CM); } - break; + return false; + default: + return true; } - return MACRO_NONE; + return true; }; diff --git a/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk index 3ff14772511..7a331cd530c 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/jeebak/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/jeebak/keymap.c index 0ec9485c724..a7ace39e39c 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/jeebak/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/jeebak/keymap.c @@ -46,10 +46,6 @@ enum macro_keycodes { KC_AG_TAB_R, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift diff --git a/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk index 3ff14772511..7a331cd530c 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/keymap.c index 02ba6842166..4c045ac0a57 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/keymap.c @@ -34,6 +34,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ) }; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/thevankeyboards/minivan/keymaps/king/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/king/keymap.c new file mode 100644 index 00000000000..6b1e1769ef2 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/king/keymap.c @@ -0,0 +1,114 @@ +#include QMK_KEYBOARD_H + + +enum layer_names { + _ML, + _FL, + _NL, + _SL, + _RL +}; + + +#define SPC_FUN LT(_FL, KC_SPC) +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* 0: Main Layer + + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────────┐ + * │ ESC │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ENTER │ + * ├─────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────────┤ + * │ TAB │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │' │ + * ├──────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬─────┤ + * │ LSHFT │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │MO(SL│ + * ├────────┬┴─────┴─┬───┴─┬───┴─────┴──┬──┴─────┴─────┴─┬───┴─┬───┴─┬───┴─────┤ + * │LCTRL │ LGUI │ LALT│SPACE(_NL) │MO(_NL) │BKSPC│ │MO(RL │ + * └────────┴────────┴─────┴────────────┴────────────────┴─────┴─────┴─────────┘ + */ + [_ML] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_SL), + KC_LCTL, KC_LGUI, KC_LALT, SPC_FUN, MO(_NL), KC_BSPC, XXXXXXX, MO(_RL) + ), + + + /* 1: Function Layer + + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────────┐ + * │ │ │HOME │ UP │END │PGUP │ │ F1 │ F2 │ F3 │ F4 │ │ + * ├─────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────────┤ + * │ CAPS │ │LEFT │DOWN │RIGHT│PGDN │ │ F5 │ F6 │ F7 │ F8 │ │ + * ├──────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬─────┤ + * │ │ │ │ DEL │ INS │ │ │ F9 │ F10 │ F11 │ F12 │ │ + * ├────────┬┴─────┴─┬───┴─┬───┴─────┴──┬──┴─────┴─────┴─┬───┴─┬───┴─┬───┴─────┤ + * │ │ │ │ │ │ │ │ │ + * └────────┴────────┴─────┴────────────┴────────────────┴─────┴─────┴─────────┘ + */ + [_FL] = LAYOUT( + _______, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, _______, + KC_CAPS, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, _______, + _______, XXXXXXX, XXXXXXX, KC_DEL, KC_INS, XXXXXXX, XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + + + /* 2: Number Layer + + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ │ + * ├─────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 8 │ 0 │ │ + * ├──────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────────┬┴─────┴─┬───┴─┬───┴─────┴──┬──┴─────┴─────┴─┬───┴─┬───┴─┬───┴─────┤ + * │ │ │ │ │ │ │ │ │ + * └────────┴────────┴─────┴────────────┴────────────────┴─────┴─────┴─────────┘ + */ + [_NL] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* 3: Symbol Layer + + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────────┐ + * │ │ _ │ + │ { │ } │ | │ │ │ │ │ │ │ + * ├─────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────────┤ + * │ │ - │ = │ [ │ ] │ \ │ │ DEL │ INS │ │ │ │ + * ├──────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────────┬┴─────┴─┬───┴─┬───┴─────┴──┬──┴─────┴─────┴─┬───┴─┬───┴─┬───┴─────┤ + * │ │ │ │ │ │ │ │ │ + * └────────┴────────┴─────┴────────────┴────────────────┴─────┴─────┴─────────┘ + */ + [_SL] = LAYOUT( + _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, XXXXXXX, KC_DEL, KC_INS, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* 4: Reset Layer + + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────────┐ + * │RESET│ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────────┬┴─────┴─┬───┴─┬───┴─────┴──┬──┴─────┴─────┴─┬───┴─┬───┴─┬───┴─────┤ + * │ │ │ │ │ │ │ │ │ + * └────────┴────────┴─────┴────────────┴────────────────┴─────┴─────┴─────────┘ + */ + [_RL] = LAYOUT( + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ) +}; + diff --git a/keyboards/thevankeyboards/minivan/keymaps/king/readme.md b/keyboards/thevankeyboards/minivan/keymaps/king/readme.md new file mode 100644 index 00000000000..edcf5f43e9f --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/king/readme.md @@ -0,0 +1,4 @@ +# King's KUMO layout + +Currently uses the fewest key layout (three keys on both sides of the bottom row) for the KUMO/minivan + diff --git a/keyboards/thevankeyboards/minivan/keymaps/king/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/king/rules.mk new file mode 100644 index 00000000000..9865184abb8 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/king/rules.mk @@ -0,0 +1,6 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +CONSOLE_ENABLE = no # Console for debug(+400) diff --git a/keyboards/thevankeyboards/minivan/keymaps/like_jis/config.h b/keyboards/thevankeyboards/minivan/keymaps/like_jis/config.h new file mode 100644 index 00000000000..4c4e6d37b51 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/like_jis/config.h @@ -0,0 +1,43 @@ +#pragma once + +// place overrides here +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM_PER_KEY + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + +// LED Setting: if you have KUMO you can use RGBLIGHT_ENABLE = yes +#ifdef RGBLIGHT_ENABLE + #define RGB_DI_PIN D0 + #define RGBLIGHT_TIMER + #define RGBLED_NUM 3 +#endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/like_jis/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/like_jis/keymap.c new file mode 100644 index 00000000000..3d282e182b3 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/like_jis/keymap.c @@ -0,0 +1,173 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + KANJI, + RGBRST +}; + +enum tapdances{ + TD_SCCL = 0, +}; + +// Layer Mode aliases +#define KC_TBSF LSFT_T(KC_TAB) +#define KC_ROSF RSFT_T(KC_RO) +#define KC_ALAP LALT_T(KC_APP) + +// Layer tap +#define KC_BSLO LT(_LOWER, KC_BSPC) +#define KC_SPRA LT(_RAISE, KC_SPC) +#define KC_MLAD MO(_ADJUST) + +#define KC_SCCL TD(TD_SCCL) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------. + // Esc Q W E R T Y U I O P - + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + //Tab/Shift A S D F G H J K L ;/: Enter + KC_TBSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, KC_ENT, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // Shift Z X C V B N M , . / yen + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ROSF, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // Ctrl Alt GUI/Comm BackSpace/Lower Space/Raise Alt Menu Ctrl + KC_LCTL, KC_LALT, KC_LGUI, KC_BSLO, KC_SPRA, KC_RALT, KC_ALAP, KC_RCTL + //`-----------------------------------------------------------------------------------------------------------' + ), + + [_LOWER] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------. + // F1 F2 F3 F4 F5 - ^ \ @ [ Delete + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, KC_DEL, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // F6 F7 F8 F9 F10 ; : ] + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUOT, KC_BSLS, _______, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // F11 F12 Kana/Kanji Enter Delete + _______, KC_F11, KC_F12, XXXXXXX, KANJI, KC_ENT, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // Adjust + _______, _______, _______, _______, KC_MLAD, _______, _______, _______ + //`-----------------------------------------------------------------------------------------------------------' + ), + + [_RAISE] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------. + // 1 2 3 4 5 6 7 8 9 0 - + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // Left Down Up Right + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, _______, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // , . / yen + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, KC_ROSF, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______ + //`-----------------------------------------------------------------------------------------------------------' + ), + + [_ADJUST] = LAYOUT( + //,-----------------------------------------------------------------------------------------------------------. + // Reset LEDReset MacMode WinMode Home PageDown PageUp End + _______, RESET, RGBRST, AG_NORM, AG_SWAP, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // LED On/Off Hue/Saturation/Value Increment Mouse Left Down Up Right + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, _______, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // LED Mode Hue/Saturation/Value Decrement Mouse Button Left Right + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______ + //`-----------------------------------------------------------------------------------------------------------' + ) +}; + +#define TAPPING_LAYER_TERM 150 // Custom LT Tapping term +uint16_t get_tapping_term(uint16_t keycode) { + switch (keycode) { + case KC_BSLO: + return TAPPING_LAYER_TERM; + case KC_SPRA: + return TAPPING_LAYER_TERM; + default: + return TAPPING_TERM; + } +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/thevankeyboards/minivan/keymaps/like_jis/readme.md b/keyboards/thevankeyboards/minivan/keymaps/like_jis/readme.md new file mode 100644 index 00000000000..d7c1a091e65 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/like_jis/readme.md @@ -0,0 +1,63 @@ +# The LikeJIS is Japanese Keyboard like keymap + +This keymap use for KUMO. Therefore it can use full color LED indicators used by D0 pin. But this keymap as use as Illumination :) + +## Keymap Description + +- Tab/Shift ...... Tab key is one tap, Shift key is long push. +- ;/: ...... ; key is one tap, : key is double tap. +- BackSpace/Lower ...... Backspace key is one tap, Move to Lower layer with long push. +- Space/Raise ...... Space key is one tap, Move to Raise layer with . +- Kanji ...... Japanese IME toggle key. + +## How to move to Ajdust Layer + +At first, Move to Lower layer with long push. After that Adjust key with long push. Now you have into Adjust layer state. + +```c +Base Layer + //,-----------------------------------------------------------------------------------------------------------. + // Esc Q W E R T Y U I O P - + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + //Tab/Shift A S D F G H J K L ;/: Enter + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // Shift Z X C V B N M , . / \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // Ctrl Alt GUI BackSpace/Lower Space/Raise Alt Menu Ctrl + //`-----------------------------------------------------------------------------------------------------------' + +Lower Layer + //,-----------------------------------------------------------------------------------------------------------. + // F1 F2 F3 F4 F5 - ^ \ @ [ Delete + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // F6 F7 F8 F9 F10 ; : ] + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // F11 F12 Kanji Enter Delete + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // Adjust + //`-----------------------------------------------------------------------------------------------------------' + +Raise Layer + //,-----------------------------------------------------------------------------------------------------------. + // 1 2 3 4 5 6 7 8 9 0 - + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // Left Down Up Right + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // , . / \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // + //`-----------------------------------------------------------------------------------------------------------' + +Adjust Layer + //,-----------------------------------------------------------------------------------------------------------. + // Reset LEDReset MacMode WinMode Home PageDown PageUp End + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // LED On/Off Hue Saturation Value Increment MouseLeft Down Up Right + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // LED Mode Hue Saturation Value Decrement Button L R + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------| + // + //`-----------------------------------------------------------------------------------------------------------' + }; + +``` diff --git a/keyboards/thevankeyboards/minivan/keymaps/like_jis/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/like_jis/rules.mk new file mode 100644 index 00000000000..07f71d6dbb1 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/like_jis/rules.mk @@ -0,0 +1,25 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes + +LED_ANIMATIONS = yes # LED animations + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/mjt/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/mjt/keymap.c index 8f0fba11dcc..10e9b9dcdf4 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/mjt/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/mjt/keymap.c @@ -20,17 +20,14 @@ enum planck_keycodes { DYNAMIC_MACRO_RANGE, }; -// Fillers to make layering more clear -#define _______ KC_TRNS #define FKEYS F(_FKEYS) -#define NUMSYM F(_NUMSYM) +#define NUMSYM TT(_NUMSYM) #define FKEYGRV F(_FKEYGRV) #define MACSLEEP M(5) #define PLOVER M(6) #define LAYERRESET M(7) #define BACKLIT M(8) #define ADJUST M(9) -#define XXXXXXX KC_NO #include "dynamic_macro.h" @@ -88,7 +85,6 @@ void persistant_default_layer_set(uint16_t default_layer) { const uint16_t PROGMEM fn_actions[] = { [_FKEYS] = ACTION_LAYER_TAP_KEY(_FKEYS, KC_TAB), [_FKEYGRV] = ACTION_LAYER_TAP_KEY(_FKEYS, KC_GRV), - [_NUMSYM] = ACTION_LAYER_TAP_TOGGLE(_NUMSYM), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) diff --git a/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk index b2c421c4dc2..8e22f3051da 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/smt/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/smt/keymap.c index ee117e47bd7..371bcd4719a 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/smt/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/smt/keymap.c @@ -23,10 +23,6 @@ enum planck_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift diff --git a/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk index 3ff14772511..7a331cd530c 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/config.h b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/config.h new file mode 100644 index 00000000000..26d5e207e80 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/config.h @@ -0,0 +1,53 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +#define SPACE_COUNT 2 + +#define TEMPLATE( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) LAYOUT_arrow( \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K0D, \ + K41, K49, K42, K44, K45, K3C, K0B, K00, K3D \ +) + +#define TEMPLATE_ALT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) LAYOUT_arrow( \ + K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K41, K49, K42, K44, K45, K48, K49, K4B, K4C \ +) + +#define TEMPLATE_ADJUST( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) LAYOUT_arrow( \ + K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K2D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K44, K45, K48, K0B, K0C, K4C \ +) + +#define TEMPLATE_RESET LAYOUT_arrow( \ + RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET) + +#endif diff --git a/keyboards/tv44/keymaps/talljoe-minivan/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/keymap.c similarity index 100% rename from keyboards/tv44/keymaps/talljoe-minivan/keymap.c rename to keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/keymap.c diff --git a/keyboards/tv44/keymaps/talljoe-minivan/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/rules.mk similarity index 100% rename from keyboards/tv44/keymaps/talljoe-minivan/rules.mk rename to keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/rules.mk diff --git a/keyboards/thevankeyboards/minivan/keymaps/tong92/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/tong92/keymap.c index 220cc8c61b1..0c97954494c 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/tong92/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/tong92/keymap.c @@ -25,11 +25,8 @@ enum tv44_keycodes { EXT_MOUSE }; -// Fillers to make layering more clear -#define _______ KC_TRNS #define LOWER F(_LOWER) #define RAISE F(_RAISE) -#define XXXXXXX KC_NO #define WINDOW_SHORTCUT MO(_WINDOW_SHORTCUT) #define MAC_SHORTCUT MO(_MAC_SHORTCUT) diff --git a/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk index 1e006e94724..f5556c8fcba 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c index ec0d270070b..059b7eb46e2 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c +++ b/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c @@ -20,10 +20,6 @@ enum planck_keycodes { ADJUST }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Aliases for some other things I want to try out #define RAI_ESC LT(_RAISE, KC_ESC) #define LOW_QUQ LT(_LOWER, KC_QUOT) diff --git a/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk index 3ff14772511..7a331cd530c 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/minivan.h b/keyboards/thevankeyboards/minivan/minivan.h index 27a35836579..eb9aa679384 100644 --- a/keyboards/thevankeyboards/minivan/minivan.h +++ b/keyboards/thevankeyboards/minivan/minivan.h @@ -42,7 +42,7 @@ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K34, K32, K33, K37, K38, K39, K3B \ + K30, K31, K32, K34, K33, K37, K38, K39, K3B \ ) \ { \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ @@ -55,7 +55,7 @@ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K34, K32, K33, K37, K38, K39, K3A, K3B \ + K30, K31, K32, K34, K33, K37, K38, K39, K3A, K3B \ ) \ { \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ diff --git a/keyboards/thevankeyboards/minivan/readme.md b/keyboards/thevankeyboards/minivan/readme.md index 03a868a1628..2464fe7a449 100644 --- a/keyboards/thevankeyboards/minivan/readme.md +++ b/keyboards/thevankeyboards/minivan/readme.md @@ -4,7 +4,7 @@ A compact 44% keyboard. Keyboard Maintainer: QMK Community Hardware Supported: Minivan PCB -Hardware Availability: https://thevankeyboards.com/collections/catalog/products/minivan-diy?variant=609138376718 +Hardware Availability: https://thevankeyboards.com/collections/catalog Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/thevankeyboards/minivan/rules.mk b/keyboards/thevankeyboards/minivan/rules.mk index 786c9dc3e70..ea453e4b85d 100644 --- a/keyboards/thevankeyboards/minivan/rules.mk +++ b/keyboards/thevankeyboards/minivan/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/thevankeyboards/roadkit/config.h b/keyboards/thevankeyboards/roadkit/config.h index 9596f7f3b22..71bd6ba6bdc 100644 --- a/keyboards/thevankeyboards/roadkit/config.h +++ b/keyboards/thevankeyboards/roadkit/config.h @@ -53,9 +53,8 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -100,11 +99,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/thevankeyboards/roadkit/keymaps/default/config.h b/keyboards/thevankeyboards/roadkit/keymaps/default/config.h index df06a262062..271f48d0011 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/default/config.h +++ b/keyboards/thevankeyboards/roadkit/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/default/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/default/keymap.c index 4ec0f6cfdc6..af1a94cc2ea 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/default/keymap.c +++ b/keyboards/thevankeyboards/roadkit/keymaps/default/keymap.c @@ -9,13 +9,9 @@ extern keymap_config_t keymap_config; #define _NP 0 -// Macro name shortcuts -#define NUMPAD M(_NP) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - +enum custom_keycodes { + NUMPAD = SAFE_RANGE +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NP] = LAYOUT_numpad_4x4( /* Numpad */ @@ -26,23 +22,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _NP: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case NUMPAD: if (record->event.pressed) { persistent_default_layer_set(1UL<<_NP); } - break; + return false; + default: + return true; } - return MACRO_NONE; + return true; }; diff --git a/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk index 3ff14772511..7a331cd530c 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/keymap.c index fed9d027067..b00cf80f5c2 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/keymap.c +++ b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/keymap.c @@ -40,10 +40,6 @@ enum roadkit_keycodes { #include "dynamic_macro.h" -// Fillers to make keymaps cleaner looking -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMPAD] = LAYOUT_numpad_4x4( /* Numpad */ KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \ @@ -77,10 +73,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistant_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk index 3ff14772511..7a331cd530c 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/khord/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/khord/keymap.c index 9111f4f898a..674f3f37abe 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/khord/keymap.c +++ b/keyboards/thevankeyboards/roadkit/keymaps/khord/keymap.c @@ -6,10 +6,6 @@ extern keymap_config_t keymap_config; #define _L1 1 #define _L2 2 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum custom_keycodes { NUMPAD = SAFE_RANGE, ADMIN, diff --git a/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk index ba4b4fec0c6..676e9a6e0ad 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk @@ -17,6 +17,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no # Enable Tap Dance functionality -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/thevankeyboards/roadkit/keymaps/mjt/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/mjt/keymap.c index a1af5b1f280..18454d56496 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/mjt/keymap.c +++ b/keyboards/thevankeyboards/roadkit/keymaps/mjt/keymap.c @@ -38,11 +38,6 @@ enum minivan_keycodes { #include "dynamic_macro.h" -// Fillers to make keymaps cleaner looking -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMPAD] = LAYOUT_numpad_4x4( /* Numpad */ KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \ @@ -76,10 +71,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - #ifdef AUDIO_ENABLE float tone_startup[][2] = SONG(STARTUP_SOUND); diff --git a/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk index 3ff14772511..7a331cd530c 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singles/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/singles/keymap.c index 4c246f5136c..9263ddbf1eb 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/singles/keymap.c +++ b/keyboards/thevankeyboards/roadkit/keymaps/singles/keymap.c @@ -14,11 +14,6 @@ extern keymap_config_t keymap_config; #define NUMPAD M(_NP) #define LAYER1 M(_L1) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NP] = LAYOUT_ortho_4x4( /* Numpad */ KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \ @@ -34,10 +29,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk index 3ff14772511..7a331cd530c 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/keymap.c index b4da80e2843..e5c14eec8dc 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/keymap.c +++ b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/keymap.c @@ -18,10 +18,6 @@ extern keymap_config_t keymap_config; #define LAYER2 M(_L2) #define LAYER3 M(_L3) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - void matrix_init_user(void) { backlight_level(4); } @@ -206,10 +202,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk index 030d27f2a62..38fa7790bd9 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk @@ -17,6 +17,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Enable Tap Dance functionality -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/rules.mk b/keyboards/thevankeyboards/roadkit/rules.mk index d15a5541bb7..c2afaa85a8d 100644 --- a/keyboards/thevankeyboards/roadkit/rules.mk +++ b/keyboards/thevankeyboards/roadkit/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/tkc1800/README.md b/keyboards/tkc1800/README.md index 7a0528ce358..e154770d72f 100644 --- a/keyboards/tkc1800/README.md +++ b/keyboards/tkc1800/README.md @@ -1,18 +1,17 @@ The Key Company TKC1800 -=== -![TKC1800](https://imgur.com/a/Xlttp) +[TKC1800 Image Gallery](https://imgur.com/a/Xlttp) The Key Company TKC1800 is a Cherry 1800 form factor replacement PCB utilizing the AT90USB1286 microcontroller. Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/) -Hardware Supported: AT90USB1286 -Hardware Availability: Via GB +Hardware Supported: TKC1800 PCB +Hardware Availability: [TheKey.Company](https://thekey.company/collections/tkc-1800) Make example for this keyboard (after setting up your build environment): - make tkc1800 + make tkc1800:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/tkc1800/config.h b/keyboards/tkc1800/config.h index b13620de3b1..a45fb677e54 100644 --- a/keyboards/tkc1800/config.h +++ b/keyboards/tkc1800/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -61,7 +60,7 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -101,11 +100,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -182,5 +176,3 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/tkc1800/info.json b/keyboards/tkc1800/info.json index f06a16c157a..3e3ab1484d8 100644 --- a/keyboards/tkc1800/info.json +++ b/keyboards/tkc1800/info.json @@ -3,550 +3,118 @@ "url": "", "maintainer": "qmk", "width": 19.5, - "height": 7, + "height": 7.25, "layouts": { "LAYOUT": { "key_count": 107, "layout": [ - { - "label": "Esc", - "x": 0, - "y": 0 - }, - { - "label": "F1", - "x": 1.25, - "y": 0 - }, - { - "label": "F2", - "x": 2.25, - "y": 0 - }, - { - "label": "F3", - "x": 3.25, - "y": 0 - }, - { - "label": "F4", - "x": 4.25, - "y": 0 - }, - { - "label": "F5", - "x": 5.5, - "y": 0 - }, - { - "label": "F6", - "x": 6.5, - "y": 0 - }, - { - "label": "F7", - "x": 7.5, - "y": 0 - }, - { - "label": "F8", - "x": 8.5, - "y": 0 - }, - { - "label": "F9", - "x": 9.75, - "y": 0 - }, - { - "label": "F10", - "x": 10.75, - "y": 0 - }, - { - "label": "F11", - "x": 11.75, - "y": 0 - }, - { - "label": "F12", - "x": 12.75, - "y": 0 - }, - { - "label": "Insert", - "x": 15.5, - "y": 0 - }, - { - "label": "Home", - "x": 16.5, - "y": 0 - }, - { - "label": "Pg Up", - "x": 17.5, - "y": 0 - }, - { - "label": "Prt Sc", - "x": 18.5, - "y": 0 - }, - { - "label": "Delete", - "x": 15.5, - "y": 1 - }, - { - "label": "End", - "x": 16.5, - "y": 1 - }, - { - "label": "Pg Dn", - "x": 17.5, - "y": 1 - }, - { - "label": "Scroll Lock", - "x": 18.5, - "y": 1 - }, - { - "label": "~", - "x": 0, - "y": 2 - }, - { - "label": "!", - "x": 1, - "y": 2 - }, - { - "label": "@", - "x": 2, - "y": 2 - }, - { - "label": "#", - "x": 3, - "y": 2 - }, - { - "label": "$", - "x": 4, - "y": 2 - }, - { - "label": "%", - "x": 5, - "y": 2 - }, - { - "label": "^", - "x": 6, - "y": 2 - }, - { - "label": "&", - "x": 7, - "y": 2 - }, - { - "label": "*", - "x": 8, - "y": 2 - }, - { - "label": "(", - "x": 9, - "y": 2 - }, - { - "label": ")", - "x": 10, - "y": 2 - }, - { - "label": "_", - "x": 11, - "y": 2 - }, - { - "label": "+", - "x": 12, - "y": 2 - }, - { - "label": "Backspace", - "x": 13, - "y": 2 - }, - { - "x": 14, - "y": 2 - }, - { - "label": "Num Lock", - "x": 15.5, - "y": 2 - }, - { - "label": "/", - "x": 16.5, - "y": 2 - }, - { - "label": "*", - "x": 17.5, - "y": 2 - }, - { - "label": "-", - "x": 18.5, - "y": 2 - }, - { - "label": "Tab", - "x": 0, - "y": 3, - "w": 1.5 - }, - { - "label": "Q", - "x": 1.5, - "y": 3 - }, - { - "label": "W", - "x": 2.5, - "y": 3 - }, - { - "label": "E", - "x": 3.5, - "y": 3 - }, - { - "label": "R", - "x": 4.5, - "y": 3 - }, - { - "label": "T", - "x": 5.5, - "y": 3 - }, - { - "label": "Y", - "x": 6.5, - "y": 3 - }, - { - "label": "U", - "x": 7.5, - "y": 3 - }, - { - "label": "I", - "x": 8.5, - "y": 3 - }, - { - "label": "O", - "x": 9.5, - "y": 3 - }, - { - "label": "P", - "x": 10.5, - "y": 3 - }, - { - "label": "{", - "x": 11.5, - "y": 3 - }, - { - "label": "}", - "x": 12.5, - "y": 3 - }, - { - "label": "|", - "x": 13.5, - "y": 3, - "w": 1.5 - }, - { - "label": "7", - "x": 15.5, - "y": 3 - }, - { - "label": "8", - "x": 16.5, - "y": 3 - }, - { - "label": "9", - "x": 17.5, - "y": 3 - }, - { - "label": "+", - "x": 18.5, - "y": 3 - }, - { - "label": "Caps Lock", - "x": 0, - "y": 4, - "w": 1.75 - }, - { - "label": "A", - "x": 1.75, - "y": 4 - }, - { - "label": "S", - "x": 2.75, - "y": 4 - }, - { - "label": "D", - "x": 3.75, - "y": 4 - }, - { - "label": "F", - "x": 4.75, - "y": 4 - }, - { - "label": "G", - "x": 5.75, - "y": 4 - }, - { - "label": "H", - "x": 6.75, - "y": 4 - }, - { - "label": "J", - "x": 7.75, - "y": 4 - }, - { - "label": "K", - "x": 8.75, - "y": 4 - }, - { - "label": "L", - "x": 9.75, - "y": 4 - }, - { - "label": ":", - "x": 10.75, - "y": 4 - }, - { - "label": "\"", - "x": 11.75, - "y": 4 - }, - { - "x": 12.75, - "y": 4 - }, - { - "label": "Enter", - "x": 13.75, - "y": 4, - "w": 1.25 - }, - { - "label": "4", - "x": 15.5, - "y": 4 - }, - { - "label": "5", - "x": 16.5, - "y": 4 - }, - { - "label": "6", - "x": 17.5, - "y": 4 - }, - { - "x": 18.5, - "y": 4 - }, - { - "x": 0, - "y": 5 - }, - { - "label": "Shift", - "x": 1, - "y": 5, - "w": 1.25 - }, - { - "label": "Z", - "x": 2.25, - "y": 5 - }, - { - "label": "X", - "x": 3.25, - "y": 5 - }, - { - "label": "C", - "x": 4.25, - "y": 5 - }, - { - "label": "V", - "x": 5.25, - "y": 5 - }, - { - "label": "B", - "x": 6.25, - "y": 5 - }, - { - "label": "N", - "x": 7.25, - "y": 5 - }, - { - "label": "M", - "x": 8.25, - "y": 5 - }, - { - "label": "<", - "x": 9.25, - "y": 5 - }, - { - "label": ">", - "x": 10.25, - "y": 5 - }, - { - "label": "?", - "x": 11.25, - "y": 5 - }, - { - "label": "Shift", - "x": 12.25, - "y": 5, - "w": 1.75 - }, - { - "label": "\\u2191", - "x": 14.25, - "y": 5 - }, - { - "label": "1", - "x": 15.5, - "y": 5 - }, - { - "label": "2", - "x": 16.5, - "y": 5 - }, - { - "label": "3", - "x": 17.5, - "y": 5 - }, - { - "label": "Enter", - "x": 18.5, - "y": 5 - }, - { - "label": "Ctrl", - "x": 0, - "y": 6, - "w": 1.25 - }, - { - "label": "Win", - "x": 1.25, - "y": 6, - "w": 1.25 - }, - { - "label": "Alt", - "x": 2.5, - "y": 6, - "w": 1.25 - }, - { - "x": 3.75, - "y": 6, - "w": 6.25 - }, - { - "label": "Alt", - "x": 10, - "y": 6 - }, - { - "label": "Win", - "x": 11, - "y": 6 - }, - { - "label": "Fn", - "x": 12, - "y": 6 - }, - { - "label": "\\u2190", - "x": 13.25, - "y": 6 - }, - { - "label": "\\u2193", - "x": 14.25, - "y": 6 - }, - { - "label": "\\u2192", - "x": 15.25, - "y": 6 - }, - { - "label": "0", - "x": 16.5, - "y": 6 - }, - { - "label": ".", - "x": 17.5, - "y": 6 - }, - { - "x": 18.5, - "y": 6 - } + { "label": "Esc", "x": 0, "y": 0 }, + { "label": "F1", "x": 1.25, "y": 0 }, + { "label": "F2", "x": 2.25, "y": 0 }, + { "label": "F3", "x": 3.25, "y": 0 }, + { "label": "F4", "x": 4.25, "y": 0 }, + { "label": "F5", "x": 5.5, "y": 0 }, + { "label": "F6", "x": 6.5, "y": 0 }, + { "label": "F7", "x": 7.5, "y": 0 }, + { "label": "F8", "x": 8.5, "y": 0 }, + { "label": "F9", "x": 9.75, "y": 0 }, + { "label": "F10", "x": 10.75, "y": 0 }, + { "label": "F11", "x": 11.75, "y": 0 }, + { "label": "F12", "x": 12.75, "y": 0 }, + { "label": "Insert", "x": 15.5, "y": 0 }, + { "label": "Home", "x": 16.5, "y": 0 }, + { "label": "Page Up", "x": 17.5, "y": 0 }, + { "label": "Print Screen", "x": 18.5, "y": 0 }, + { "label": "Delete", "x": 15.5, "y": 1 }, + { "label": "End", "x": 16.5, "y": 1 }, + { "label": "Page Down", "x": 17.5, "y": 1 }, + { "label": "Scroll Lock", "x": 18.5, "y": 1 }, + { "label": "`", "x": 0, "y": 2 }, + { "label": "1", "x": 1, "y": 2 }, + { "label": "2", "x": 2, "y": 2 }, + { "label": "3", "x": 3, "y": 2 }, + { "label": "4", "x": 4, "y": 2 }, + { "label": "5", "x": 5, "y": 2 }, + { "label": "6", "x": 6, "y": 2 }, + { "label": "7", "x": 7, "y": 2 }, + { "label": "8", "x": 8, "y": 2 }, + { "label": "9", "x": 9, "y": 2 }, + { "label": "0", "x": 10, "y": 2 }, + { "label": "-", "x": 11, "y": 2 }, + { "label": "=", "x": 12, "y": 2 }, + { "label": "Backspace", "x": 13, "y": 2 }, + { "label": "Backspace_Right", "x": 14, "y": 2 }, + { "label": "Num Lock", "x": 15.5, "y": 2 }, + { "label": "/", "x": 16.5, "y": 2 }, + { "label": "*", "x": 17.5, "y": 2 }, + { "label": "Pause", "x": 18.5, "y": 2 }, + { "label": "Tab", "x": 0, "y": 3, "w": 1.5 }, + { "label": "Q", "x": 1.5, "y": 3 }, + { "label": "W", "x": 2.5, "y": 3 }, + { "label": "E", "x": 3.5, "y": 3 }, + { "label": "R", "x": 4.5, "y": 3 }, + { "label": "T", "x": 5.5, "y": 3 }, + { "label": "Y", "x": 6.5, "y": 3 }, + { "label": "U", "x": 7.5, "y": 3 }, + { "label": "I", "x": 8.5, "y": 3 }, + { "label": "O", "x": 9.5, "y": 3 }, + { "label": "P", "x": 10.5, "y": 3 }, + { "label": "[", "x": 11.5, "y": 3 }, + { "label": "]", "x": 12.5, "y": 3 }, + { "label": "\\", "x": 13.5, "y": 3, "w": 1.5 }, + { "label": "7", "x": 15.5, "y": 3 }, + { "label": "8", "x": 16.5, "y": 3 }, + { "label": "9", "x": 17.5, "y": 3 }, + { "label": "-", "x": 18.5, "y": 3 }, + { "label": "Caps Lock", "x": 0, "y": 4, "w": 1.75 }, + { "label": "A", "x": 1.75, "y": 4 }, + { "label": "S", "x": 2.75, "y": 4 }, + { "label": "D", "x": 3.75, "y": 4 }, + { "label": "F", "x": 4.75, "y": 4 }, + { "label": "G", "x": 5.75, "y": 4 }, + { "label": "H", "x": 6.75, "y": 4 }, + { "label": "J", "x": 7.75, "y": 4 }, + { "label": "K", "x": 8.75, "y": 4 }, + { "label": "L", "x": 9.75, "y": 4 }, + { "label": ";", "x": 10.75, "y": 4 }, + { "label": "'", "x": 11.75, "y": 4 }, + { "label": "ISO Hash", "x": 12.75, "y": 4 }, + { "label": "Enter", "x": 13.75, "y": 4, "w": 1.25 }, + { "label": "4", "x": 15.5, "y": 4 }, + { "label": "5", "x": 16.5, "y": 4 }, + { "label": "6", "x": 17.5, "y": 4 }, + { "label": "+", "x": 18.5, "y": 4 }, + { "label": "Shift", "x": 0, "y": 5, "w": 1.25 }, + { "label": "ISO Backslash", "x": 1.25, "y": 5 }, + { "label": "Z", "x": 2.25, "y": 5 }, + { "label": "X", "x": 3.25, "y": 5 }, + { "label": "C", "x": 4.25, "y": 5 }, + { "label": "V", "x": 5.25, "y": 5 }, + { "label": "B", "x": 6.25, "y": 5 }, + { "label": "N", "x": 7.25, "y": 5 }, + { "label": "M", "x": 8.25, "y": 5 }, + { "label": ",", "x": 9.25, "y": 5 }, + { "label": ".", "x": 10.25, "y": 5 }, + { "label": "/", "x": 11.25, "y": 5 }, + { "label": "Shift", "x": 12.25, "y": 5, "w": 1.75 }, + { "label": "Up", "x": 14.25, "y": 5.25 }, + { "label": "1", "x": 15.5, "y": 5 }, + { "label": "2", "x": 16.5, "y": 5 }, + { "label": "3", "x": 17.5, "y": 5 }, + { "label": "Enter_Top", "x": 18.5, "y": 5 }, + { "label": "Ctrl", "x": 0, "y": 6, "w": 1.25 }, + { "label": "GUI", "x": 1.25, "y": 6, "w": 1.25 }, + { "label": "Alt", "x": 2.5, "y": 6, "w": 1.25 }, + { "label": "Space", "x": 3.75, "y": 6, "w": 6.25 }, + { "label": "Alt", "x": 10, "y": 6 }, + { "label": "Fn", "x": 11, "y": 6 }, + { "label": "Ctrl", "x": 12, "y": 6 }, + { "label": "Left", "x": 13.25, "y": 6.25 }, + { "label": "Down", "x": 14.25, "y": 6.25 }, + { "label": "Right", "x": 15.25, "y": 6.25 }, + { "label": "0", "x": 16.5, "y": 6 }, + { "label": ".", "x": 17.5, "y": 6 }, + { "label": "Enter", "x": 18.5, "y": 6 } ] } } diff --git a/keyboards/tkc1800/keymaps/default/config.h b/keyboards/tkc1800/keymaps/default/config.h index 30973348aee..ee142927f3a 100644 --- a/keyboards/tkc1800/keymaps/default/config.h +++ b/keyboards/tkc1800/keymaps/default/config.h @@ -14,10 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #define USE_I2C #define SSD1306OLED @@ -25,5 +22,3 @@ #define SSD1306_ADDRESS 0x3C // place overrides here - -#endif diff --git a/keyboards/tkc1800/keymaps/default/keymap.c b/keyboards/tkc1800/keymaps/default/keymap.c index cc19de3bda9..5455934a306 100644 --- a/keyboards/tkc1800/keymaps/default/keymap.c +++ b/keyboards/tkc1800/keymaps/default/keymap.c @@ -13,25 +13,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "tkc1800.h" +#include QMK_KEYBOARD_H #include "LUFA/Drivers/Peripheral/TWI.h" #include "i2c.h" #include "ssd1306.h" -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) - - -// Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO - //Layers enum { - BASE = 0, - FUNCTION, + BASE = 0, + FUNCTION, }; bool screenWorks = 0; @@ -56,61 +48,77 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------' |-------------------| * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up | 1 | 2 | 3 | Ent| * |--------------------------------------------------------'----`--------------| | - * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | + * |Ctrl|Gui |Alt | Space |Alt |Fn |Ctr|Left |Down|Rght| 0 | . | | * `---------------------------------------------------------------------------------' */ - [BASE] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), - [FUNCTION] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, RESET, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, BL_STEP,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, ______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), + [BASE] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ), + /* Keymap FUNCTION: (Function Layer) + * ,-------------------------------------------------------. ,-------------------. + * | | | | | | | | | | | | | | | | | | | | | + * `-------------------------------------------------------' |-------------------| + * | | | | | + * ,-----------------------------------------------------------. |-------------------| + * | | | | | | | | | | | | | | RESET | | | | | | + * |-----------------------------------------------------------| |-------------------| + * | | | | | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| |-------------------| + * | | | | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------' |-------------------| + * | |Tog|Mod|Hu+|Hu-|Sa+|Sa-|Va+|Va-|Stp| | | | | | | | + * |--------------------------------------------------------'----`--------------| | + * | | | | | | | | | | | | . | | + * `---------------------------------------------------------------------------------' + */ + [FUNCTION] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, \ + _______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, _______, _______, _______, _______, XXXXXXX, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } void led_set_user(uint8_t usb_led) { } + void matrix_init_user(void) { #ifdef USE_I2C i2c_master_init(); - #ifdef SSD1306OLED - // calls code for the SSD1306 OLED - _delay_ms(400); - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - if(iota_gfx_init()){ // turns on the display - screenWorks = 1; - } + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + if ( iota_gfx_init() ) { // turns on the display + screenWorks = 1; + } + #endif #endif + #ifdef AUDIO_ENABLE + startup_user(); #endif - #ifdef AUDIO_ENABLE - startup_user(); - #endif } void matrix_scan_user(void) { - #ifdef SSD1306OLED - if(screenWorks){ - iota_gfx_task(); // this is what updates the display continuously - }; - #endif + #ifdef SSD1306OLED + if ( screenWorks ) { + iota_gfx_task(); // this is what updates the display continuously + }; + #endif } void matrix_update(struct CharacterMatrix *dest, @@ -122,17 +130,17 @@ void matrix_update(struct CharacterMatrix *dest, } void iota_gfx_task_user(void) { -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif struct CharacterMatrix matrix; matrix_clear(&matrix); matrix_write_P(&matrix, PSTR("TKC1800")); - + uint8_t layer = biton32(layer_state); char buf[40]; @@ -148,4 +156,4 @@ void iota_gfx_task_user(void) { (host_keyboard_leds() & (1<. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #define USE_I2C #define SSD1306OLED @@ -25,5 +22,3 @@ #define SSD1306_ADDRESS 0x3C // place overrides here - -#endif diff --git a/keyboards/tkc1800/keymaps/smt/keymap.c b/keyboards/tkc1800/keymaps/smt/keymap.c index 6683416e361..9f506b443b8 100644 --- a/keyboards/tkc1800/keymaps/smt/keymap.c +++ b/keyboards/tkc1800/keymaps/smt/keymap.c @@ -13,30 +13,23 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "tkc1800.h" +#include QMK_KEYBOARD_H #include "LUFA/Drivers/Peripheral/TWI.h" #include "i2c.h" #include "ssd1306.h" -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -// Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO - //Layers enum { - QWERTY = 0, - COLEMAK, - DVORAK, - FUNCTION, + QWERTY = 0, + COLEMAK, + DVORAK, + FUNCTION, }; //13 characters max without re-writing the "Layer: " format in iota_gfx_task_user() @@ -62,15 +55,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | * `---------------------------------------------------------------------------------' */ - [QWERTY] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), + [QWERTY] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ), /* Keymap COLEMAK: (Colemak Layer) Default Layer * ,-------------------------------------------------------. ,-------------------. * |Esc| F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12| |Ins |Home|PgUp|PrSc| @@ -88,15 +81,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | * `---------------------------------------------------------------------------------' */ - [COLEMAK] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT,KC_SLSH, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), + [COLEMAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ), /* Keymap DVORAK: (Dvorak Layer) Default Layer * ,-------------------------------------------------------. ,-------------------. * |Esc| F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12| |Ins |Home|PgUp|PrSc| @@ -114,50 +107,43 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | * `---------------------------------------------------------------------------------' */ - [DVORAK] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), - [FUNCTION] = LAYOUT( - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - ______, ______, ______, ______, ______, ______, ______, QWERTY, COLEMAK,DVORAK, ______, ______, ______, ______, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, XXXXXX, ______, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - ______, XXXXXX, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, BL_STEP,______, ______, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, ______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), + [DVORAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXXX, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ), + [FUNCTION] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + _______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, _______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ), }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - persistent_default_layer_set(1UL<event.pressed) { - persistent_default_layer_set(1UL<event.pressed) { - persistent_default_layer_set(1UL<. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #define USE_I2C #define SSD1306OLED @@ -25,5 +22,3 @@ #define SSD1306_ADDRESS 0x3C // place overrides here - -#endif diff --git a/keyboards/tkc1800/keymaps/wkl/keymap.c b/keyboards/tkc1800/keymaps/wkl/keymap.c index e04c4d5c177..6f331c61ccb 100644 --- a/keyboards/tkc1800/keymaps/wkl/keymap.c +++ b/keyboards/tkc1800/keymaps/wkl/keymap.c @@ -13,25 +13,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "tkc1800.h" +#include QMK_KEYBOARD_H #include "LUFA/Drivers/Peripheral/TWI.h" #include "i2c.h" #include "ssd1306.h" -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) - - -// Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO - //Layers enum { - BASE = 0, - FUNCTION, + BASE = 0, + FUNCTION, }; bool screenWorks = 0; @@ -56,61 +48,60 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------' |-------------------| * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up | 1 | 2 | 3 | Ent| * |--------------------------------------------------------'----`--------------| | - * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | + * |Ctrl | Alt | Space | Fn |Ctrl |Left |Down|Rght| 0 | . | | * `---------------------------------------------------------------------------------' */ - [BASE] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LALT, XXXXXX, KC_SPC, XXXXXX, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), - [FUNCTION] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, RESET, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, BL_STEP,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, XXXXXX, ______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), + [BASE] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_LCTL, KC_LALT, XXXXXXX, KC_SPC, XXXXXXX, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ), + [FUNCTION] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, \ + _______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, _______, _______, _______, _______, XXXXXXX, \ + _______, _______, XXXXXXX, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } void led_set_user(uint8_t usb_led) { } + void matrix_init_user(void) { #ifdef USE_I2C i2c_master_init(); - #ifdef SSD1306OLED - // calls code for the SSD1306 OLED - _delay_ms(400); - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - if(iota_gfx_init()){ // turns on the display - screenWorks = 1; - } + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + if ( iota_gfx_init() ) { // turns on the display + screenWorks = 1; + } + #endif #endif + #ifdef AUDIO_ENABLE + startup_user(); #endif - #ifdef AUDIO_ENABLE - startup_user(); - #endif } void matrix_scan_user(void) { - #ifdef SSD1306OLED - if(screenWorks){ - iota_gfx_task(); // this is what updates the display continuously - }; - #endif + #ifdef SSD1306OLED + if ( screenWorks ) { + iota_gfx_task(); // this is what updates the display continuously + }; + #endif } void matrix_update(struct CharacterMatrix *dest, @@ -122,17 +113,17 @@ void matrix_update(struct CharacterMatrix *dest, } void iota_gfx_task_user(void) { -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif struct CharacterMatrix matrix; matrix_clear(&matrix); matrix_write_P(&matrix, PSTR("TKC1800")); - + uint8_t layer = biton32(layer_state); char buf[40]; @@ -148,4 +139,4 @@ void iota_gfx_task_user(void) { (host_keyboard_leds() & (1<. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once //#define USE_I2C //#define SSD1306OLED @@ -25,5 +22,3 @@ #define SSD1306_ADDRESS 0x3C // place overrides here - -#endif diff --git a/keyboards/tkc1800/keymaps/yanfali/keymap.c b/keyboards/tkc1800/keymaps/yanfali/keymap.c index 292bdb0bbaa..8dad3446def 100644 --- a/keyboards/tkc1800/keymaps/yanfali/keymap.c +++ b/keyboards/tkc1800/keymaps/yanfali/keymap.c @@ -13,20 +13,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "tkc1800.h" +#include QMK_KEYBOARD_H #include "LUFA/Drivers/Peripheral/TWI.h" #include "i2c.h" #include "ssd1306.h" -#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) - - -// Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO - //Layers enum { @@ -58,53 +50,52 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `---------------------------------------------------------------------------------' */ [BASE] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ ), [FUNCTION] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ - KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, RESET, XXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, XXXXXX, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, ______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, \ + _______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; -// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } void led_set_user(uint8_t usb_led) { } + void matrix_init_user(void) { #ifdef USE_I2C i2c_master_init(); - #ifdef SSD1306OLED - // calls code for the SSD1306 OLED - _delay_ms(400); - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - iota_gfx_init(); // turns on the display + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(); // turns on the display + #endif #endif + #ifdef AUDIO_ENABLE + startup_user(); #endif - #ifdef AUDIO_ENABLE - startup_user(); - #endif } void matrix_scan_user(void) { - #ifdef SSD1306OLED - iota_gfx_task(); // this is what updates the display continuously - #endif + #ifdef SSD1306OLED + iota_gfx_task(); // this is what updates the display continuously + #endif } void matrix_update(struct CharacterMatrix *dest, @@ -116,11 +107,11 @@ void matrix_update(struct CharacterMatrix *dest, } void iota_gfx_task_user(void) { -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif struct CharacterMatrix matrix; diff --git a/keyboards/tkc1800/rules.mk b/keyboards/tkc1800/rules.mk index 56c2d4b747d..35da90d0761 100644 --- a/keyboards/tkc1800/rules.mk +++ b/keyboards/tkc1800/rules.mk @@ -51,21 +51,21 @@ OPT_DEFS += -DBOOTLOADER_SIZE=8192 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= yes # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 SRC = i2c.c \ ssd1306.c diff --git a/keyboards/tkc1800/tkc1800.h b/keyboards/tkc1800/tkc1800.h index 0a872ef8836..4d1686cf16e 100644 --- a/keyboards/tkc1800/tkc1800.h +++ b/keyboards/tkc1800/tkc1800.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef TKC1800_H -#define TKC1800_H +#pragma once #include "quantum.h" @@ -24,16 +23,14 @@ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, K3G, K3H, K3I, \ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4F, K4G, K4H, K4I, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, K5F, K5G, K5H, K5I, \ - K60, K61, K62, K65, K69, K6A, K6B, K6C, K6D, K6E, K6G, K6H, K6I \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, K5F, K5G, K5H, K5I, \ + K60, K61, K62, K65, K69, K6A, K6B, K6C, K6D, K6E, K6G, K6H, K6I \ ) { \ - { K00, KC_NO, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KC_NO, K0F, K0G, K0H, K0I }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K1F, K1G, K1H, K1I }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F, K3G, K3H, K3I }, \ - { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, KC_NO, K4F, K4G, K4H, K4I }, \ - { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, KC_NO, K5F, K5G, K5H, K5I }, \ - { K60, K61, K62, KC_NO, KC_NO, K65, KC_NO, KC_NO, KC_NO, K69, K6A, K6B, K6C, K6D, K6E, KC_NO, K6G, K6H, K6I } \ + { K00, KC_NO, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KC_NO, K0F, K0G, K0H, K0I }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K1F, K1G, K1H, K1I }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F, K3G, K3H, K3I }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, KC_NO, K4F, K4G, K4H, K4I }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, KC_NO, K5F, K5G, K5H, K5I }, \ + { K60, K61, K62, KC_NO, KC_NO, K65, KC_NO, KC_NO, KC_NO, K69, K6A, K6B, K6C, K6D, K6E, KC_NO, K6G, K6H, K6I } \ } - -#endif diff --git a/keyboards/tmo50/config.h b/keyboards/tmo50/config.h new file mode 100644 index 00000000000..ee7f0e34aaa --- /dev/null +++ b/keyboards/tmo50/config.h @@ -0,0 +1,202 @@ +/* +Copyright 2019 funderburker + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER funderburker +#define PRODUCT TMO50 +#define DESCRIPTION 50% mechanical keyboard with macro column + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D5, D3, D2, D0 } +#define MATRIX_COL_PINS { D1, D4, F0, F1, F4, F5, F6, F7, D6, D7, B4, B5, B6, C6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN C7 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 10 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ + // #define RGBLIGHT_EFFECT_BREATHING + // #define RGBLIGHT_EFFECT_RAINBOW_MOOD + // #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + // #define RGBLIGHT_EFFECT_SNAKE + // #define RGBLIGHT_EFFECT_KNIGHT + // #define RGBLIGHT_EFFECT_CHRISTMAS + // #define RGBLIGHT_EFFECT_STATIC_GRADIENT + // #define RGBLIGHT_EFFECT_RGB_TEST + // #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 diff --git a/keyboards/tmo50/info.json b/keyboards/tmo50/info.json new file mode 100644 index 00000000000..751e766555b --- /dev/null +++ b/keyboards/tmo50/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "TMO50", + "url": "", + "maintainer": "funderburker", + "width": 15.25, + "height": 4, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"", "x":0, "y":0}, {"label":"", "x":1.25, "y":0}, {"label":"", "x":2.25, "y":0}, {"label":"", "x":3.25, "y":0}, {"label":"", "x":4.25, "y":0}, {"label":"", "x":5.25, "y":0}, {"label":"", "x":6.25, "y":0}, {"label":"", "x":7.25, "y":0}, {"label":"", "x":8.25, "y":0}, {"label":"", "x":9.25, "y":0}, {"label":"", "x":10.25, "y":0}, {"label":"", "x":11.25, "y":0}, {"label":"", "x":12.25, "y":0}, {"label":"", "x":13.25, "y":0}, {"label":"", "x":14.25, "y":0}, {"x":0, "y":1}, {"label":"Ctrl", "x":1.25, "y":1, "w":1.25}, {"label":"", "x":2.5, "y":1}, {"label":"", "x":3.5, "y":1}, {"label":"", "x":4.5, "y":1}, {"label":"", "x":5.5, "y":1}, {"label":"", "x":6.5, "y":1}, {"label":"", "x":7.5, "y":1}, {"label":"", "x":8.5, "y":1}, {"label":"", "x":9.5, "y":1}, {"label":"", "x":10.5, "y":1}, {"label":"", "x":11.5, "y":1}, {"label":"", "x":12.5, "y":1}, {"label":"Enter", "x":13.5, "y":1, "w":1.75}, {"x":0, "y":2}, {"label":"Shift", "x":1.25, "y":2, "w":1.75}, {"label":"", "x":3, "y":2}, {"label":"", "x":4, "y":2}, {"label":"", "x":5, "y":2}, {"label":"", "x":6, "y":2}, {"label":"b", "x":7, "y":2}, {"label":"", "x":8, "y":2}, {"label":"m", "x":9, "y":2}, {"label":"", "x":10, "y":2}, {"label":"", "x":11, "y":2}, {"label":"", "x":12, "y":2}, {"label":"Shift", "x":13, "y":2, "w":1.25}, {"label":"", "x":14.25, "y":2}, {"x":0, "y":3}, {"label":"Alt", "x":2.75, "y":3}, {"label":"Win", "x":3.75, "y":3, "w":1.5}, {"label":"", "x":5.25, "y":3, "w":2.25}, {"label":"", "x":7.5, "y":3, "w":2.75}, {"label":"AltGr", "x":10.25, "y":3, "w":1.5}, {"label":"L3", "x":11.75, "y":3}] + }, + + "LAYOUT_space": { + "layout": [{"x":0, "y":0}, {"x":1.25, "y":0}, {"x":2.25, "y":0}, {"x":3.25, "y":0}, {"x":4.25, "y":0}, {"x":5.25, "y":0}, {"x":6.25, "y":0}, {"x":7.25, "y":0}, {"x":8.25, "y":0}, {"x":9.25, "y":0}, {"x":10.25, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":0, "y":1}, {"x":1.25, "y":1, "w":1.25}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.75}, {"x":0, "y":2}, {"x":1.25, "y":2, "w":1.75}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2, "w":1.25}, {"x":14.25, "y":2}, {"x":0, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3, "w":1.5}, {"x":5.25, "y":3, "w":6.25}, {"x":11.5, "y":3, "w":1.25}] + } + } +} diff --git a/keyboards/tmo50/keymaps/default/keymap.c b/keyboards/tmo50/keymaps/default/keymap.c new file mode 100644 index 00000000000..a1d896b61be --- /dev/null +++ b/keyboards/tmo50/keymaps/default/keymap.c @@ -0,0 +1,52 @@ +/* Copyright 2019 funderburker + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define LT1_SPC LT(1, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Default layer + [0] = LAYOUT_all( + KC_TRNS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_TRNS, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_TRNS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(2), + KC_TRNS, KC_LALT, KC_LGUI, LT1_SPC, LT1_SPC, KC_RALT, MO(3) + ), + + // Fn1 layer + [1] = LAYOUT_all( + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + // Fn2 layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + // Fn3 layer + [3] = LAYOUT_all( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, KC_CAPS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, BL_STEP, BL_DEC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; diff --git a/keyboards/tmo50/keymaps/default/readme.md b/keyboards/tmo50/keymaps/default/readme.md new file mode 100644 index 00000000000..e8f5de830d0 --- /dev/null +++ b/keyboards/tmo50/keymaps/default/readme.md @@ -0,0 +1,44 @@ +# Additional info + +## Matrix + +You probably tried or will try to configure the keymapping to your liking. To make it easier configuring your layouts, photo of keyboards matrix will help. + +![TMO50 matrix](https://i.imgur.com/ud7RB8d.png) + +## Pinout + +Most of the pinout can be found in *config.h* but there's here's a table of all the used pins for TMO50 (including indicator LED pins) + +| Pin | Assigned to | +|---|---| +| D5 | Row 0 | +| D3 | Row 1 | +| D2 | Row 2 | +| D0 | Row 3 | +| | | +| D1 | Col 0 | +| D4 | Col 1 | +| F0 | Col 2 | +| F1 | Col 3 | +| F4 | Col 4 | +| F5 | Col 5 | +| F6 | Col 6 | +| F7 | Col 7 | +| D6 | Col 8 | +| D7 | Col 9 | +| B4 | Col 10 | +| B5 | Col 11 | +| B6 | Col 12 | +| C6 | Col 13 | +| | | +| B7 | Backlight | +| C7 | RGB LEDs | +| B0 | LED 4 (L4) | +| B1 | LED 3 (L3) | +| B2 | LED 2 (L2) | +| B3 | LED 1 (L1) | + +## Indicator LEDs + +Their size is 2×3×4mm. The THT hole without a circle on the pcb is VCC(+) and the other one is connect to their corresponding pin. diff --git a/keyboards/tmo50/keymaps/olivia/keymap.c b/keyboards/tmo50/keymaps/olivia/keymap.c new file mode 100644 index 00000000000..c1e86f9b902 --- /dev/null +++ b/keyboards/tmo50/keymaps/olivia/keymap.c @@ -0,0 +1,53 @@ +/* Copyright 2019 funderburker + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define LT1_SPC LT(1, KC_SPC) +#define LT1_BSPC LT(1, KC_BSPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Default layer + [0] = LAYOUT_all( + KC_VOLU, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_VOLD, MT(MOD_LCTL, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_MUTE, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(2), + KC_MPLY, KC_LALT, KC_LGUI, LT1_BSPC, LT1_SPC, KC_RALT, MO(3) + ), + + // Fn1 layer + [1] = LAYOUT_all( + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + // Fn2 layer + [2] = LAYOUT_all( + KC_BRIU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_UP, KC_TRNS, KC_TRNS, KC_DEL, + KC_BRID, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + // Fn3 layer + [3] = LAYOUT_all( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, KC_CAPS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, BL_STEP, BL_DEC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; diff --git a/keyboards/tmo50/keymaps/pyrol/keymap.c b/keyboards/tmo50/keymaps/pyrol/keymap.c new file mode 100644 index 00000000000..f67d26092f6 --- /dev/null +++ b/keyboards/tmo50/keymaps/pyrol/keymap.c @@ -0,0 +1,68 @@ +/* Copyright 2019 funderburker + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define CALTDEL LCA(KC_DEL) +#define TSKMGR C(S(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Default layer + [0] = LAYOUT_all( + KC_VOLU, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_EQL, KC_BSPC, + KC_VOLD, KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_MPLY, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(3), + KC_MUTE, KC_LGUI, KC_LALT, LT(1, KC_SPC), LT(2, KC_SPC), KC_RALT, MO(4) + ), + + // Fn1 layer + [1] = LAYOUT_all( + A(KC_TAB), KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_RBRC, KC_LBRC, KC_DEL, + C(KC_C), KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_TRNS, + C(KC_V), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, + C(KC_X), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + //Fn2 layer + [2] = LAYOUT_all( + A(KC_TAB), KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC, KC_LBRC, KC_DEL, + C(KC_C), KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TILD, KC_TRNS, + C(KC_V), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, + C(KC_X), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + // Fn3 layer + [3] = LAYOUT_all( + CALTDEL, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + TSKMGR, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, TO(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + // Fn4 layer + [4] = LAYOUT_all( + RESET, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, KC_CAPS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_SLEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + // Game layer! + [5] = LAYOUT_all( + KC_VOLU, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_EQL, KC_BSPC, + KC_VOLD, KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_MPLY, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(3), + KC_F12, KC_F13, KC_LALT, KC_SPC, LT(2, KC_SPC), KC_RALT, TO(0) + ), +}; diff --git a/keyboards/tmo50/readme.md b/keyboards/tmo50/readme.md new file mode 100644 index 00000000000..f4275a97873 --- /dev/null +++ b/keyboards/tmo50/readme.md @@ -0,0 +1,15 @@ +# tmo50 + +![TMO50](https://imgur.com/BhRYzl6.jpg) + +TMO50 is a 50% mechanical keyboard with macro column on the left side. Sub60% board without compromises. + +Keyboard Maintainer: [funderburker](https://github.com/emiilsd) +Hardware Supported: TMO50 mechanical keyboard +Hardware Availability: Group buys + +Make example for this keyboard (after setting up your build environment): + + make tmo50:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/tmo50/rules.mk b/keyboards/tmo50/rules.mk new file mode 100644 index 00000000000..f18bf73e830 --- /dev/null +++ b/keyboards/tmo50/rules.mk @@ -0,0 +1,62 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/tmo50/tmo50.c b/keyboards/tmo50/tmo50.c new file mode 100644 index 00000000000..4f6288133da --- /dev/null +++ b/keyboards/tmo50/tmo50.c @@ -0,0 +1,84 @@ +/* Copyright 2019 funderburker + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "tmo50.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + DDRB |= (1 << PB0); //init B0 + PORTB &= ~(1 << PB0); //turn on B0 + DDRB |= (1 << PB1); + PORTB |= (1<. + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define LAYOUT_all( \ + K00, K31, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K32, K33, K35, K37, K39, K3A \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, KC_NO, K35, KC_NO, K37, KC_NO, K39, K3A, KC_NO, KC_NO, KC_NO } \ +} + +#define LAYOUT_space( \ + K00, K31, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K32, K33, K37, K3A \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, KC_NO, KC_NO, KC_NO, K37, KC_NO, KC_NO, K3A, KC_NO, KC_NO, KC_NO } \ +} + diff --git a/keyboards/toad/config.h b/keyboards/toad/config.h index f1d32c15b6f..5f3eb43c2b3 100644 --- a/keyboards/toad/config.h +++ b/keyboards/toad/config.h @@ -30,7 +30,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +38,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/toad/info.json b/keyboards/toad/info.json new file mode 100644 index 00000000000..17a37147ec8 --- /dev/null +++ b/keyboards/toad/info.json @@ -0,0 +1,409 @@ +{ + "keyboard_name": "Toad", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "key_count": 78, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K113", "x":13, "y":1.5}, + {"label":"K013", "x":14, "y":1.5}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K213", "x":13.5, "y":2.5, "w":1.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K312", "x":12.75, "y":3.5}, + {"label":"K313", "x":13.75, "y":3.5, "w":1.25}, + {"label":"K400", "x":0, "y":4.5, "w":1.25}, + {"label":"K401", "x":1.25, "y":4.5}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":1.75}, + {"label":"K413", "x":14, "y":4.5}, + {"label":"K500", "x":0, "y":5.5, "w":1.25}, + {"label":"K501", "x":1.25, "y":5.5, "w":1.25}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.25}, + {"label":"K507", "x":3.75, "y":5.5, "w":6.25}, + {"label":"K510", "x":10, "y":5.5, "w":1.25}, + {"label":"K511", "x":11.25, "y":5.5, "w":1.25}, + {"label":"K512", "x":12.5, "y":5.5, "w":1.25}, + {"label":"K513", "x":13.75, "y":5.5, "w":1.25} + ] + }, + + "LAYOUT_ansi_wk": { + "key_count": 74, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K013", "x":13, "y":1.5, "w":2}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K213", "x":13.5, "y":2.5, "w":1.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K313", "x":12.75, "y":3.5, "w":2.25}, + {"label":"K400", "x":0, "y":4.5, "w":2.25}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":2.75}, + {"label":"K500", "x":0, "y":5.5, "w":1.25}, + {"label":"K501", "x":1.25, "y":5.5, "w":1.25}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.25}, + {"label":"K507", "x":3.75, "y":5.5, "w":6.25}, + {"label":"K510", "x":10, "y":5.5, "w":1.25}, + {"label":"K511", "x":11.25, "y":5.5, "w":1.25}, + {"label":"K512", "x":12.5, "y":5.5, "w":1.25}, + {"label":"K513", "x":13.75, "y":5.5, "w":1.25} + ] + }, + + "LAYOUT_ansi_wkl": { + "key_count": 71, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K013", "x":13, "y":1.5, "w":2}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K213", "x":13.5, "y":2.5, "w":1.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K313", "x":12.75, "y":3.5, "w":2.25}, + {"label":"K400", "x":0, "y":4.5, "w":2.25}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":2.75}, + {"label":"K500", "x":0, "y":5.5, "w":1.5}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.5}, + {"label":"K507", "x":4, "y":5.5, "w":7}, + {"label":"K511", "x":11, "y":5.5, "w":1.5}, + {"label":"K513", "x":13.5, "y":5.5, "w":1.5} + ] + }, + + "LAYOUT_iso_wk": { + "key_count": 75, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K013", "x":13, "y":1.5, "w":2}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K312", "x":12.75, "y":3.5}, + {"label":"K313", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"K400", "x":0, "y":4.5, "w":1.25}, + {"label":"K401", "x":1.25, "y":4.5}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":2.75}, + {"label":"K500", "x":0, "y":5.5, "w":1.25}, + {"label":"K501", "x":1.25, "y":5.5, "w":1.25}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.25}, + {"label":"K507", "x":3.75, "y":5.5, "w":6.25}, + {"label":"K510", "x":10, "y":5.5, "w":1.25}, + {"label":"K511", "x":11.25, "y":5.5, "w":1.25}, + {"label":"K512", "x":12.5, "y":5.5, "w":1.25}, + {"label":"K513", "x":13.75, "y":5.5, "w":1.25} + ] + }, + + "LAYOUT_iso_wkl": { + "key_count": 72, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K013", "x":13, "y":1.5, "w":2}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K312", "x":12.75, "y":3.5}, + {"label":"K313", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"K400", "x":0, "y":4.5, "w":1.25}, + {"label":"K401", "x":1.25, "y":4.5}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":2.75}, + {"label":"K500", "x":0, "y":5.5, "w":1.5}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.5}, + {"label":"K507", "x":4, "y":5.5, "w":7}, + {"label":"K511", "x":11, "y":5.5, "w":1.5}, + {"label":"K513", "x":13.5, "y":5.5, "w":1.5} + ] + } + } +} + diff --git a/keyboards/toad/readme.md b/keyboards/toad/readme.md index 3f3bff5b5b3..de58f7202b6 100644 --- a/keyboards/toad/readme.md +++ b/keyboards/toad/readme.md @@ -10,5 +10,5 @@ Make examples for these keyboards (after setting up your build environment): make toad:default +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/tokyo60/config.h b/keyboards/tokyo60/config.h index 16927be17e0..2c1326c0a1a 100644 --- a/keyboards/tokyo60/config.h +++ b/keyboards/tokyo60/config.h @@ -26,16 +26,11 @@ #define DIODE_DIRECTION ROW2COL /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Set power consumption to work with mobile devices */ #define USB_MAX_POWER_CONSUMPTION 100 -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* key matrix pins */ #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B2, B5, B4, D7, D6, B3 } diff --git a/keyboards/tokyo60/readme.md b/keyboards/tokyo60/readme.md index 3f6b3b76b39..d0bc6e6ce8c 100644 --- a/keyboards/tokyo60/readme.md +++ b/keyboards/tokyo60/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): ​ make tokyo60:default ​ -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/tokyo60/rules.mk b/keyboards/tokyo60/rules.mk index 45f0013c166..3ec2e6150e0 100644 --- a/keyboards/tokyo60/rules.mk +++ b/keyboards/tokyo60/rules.mk @@ -1,7 +1,4 @@ - - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/tomato/config.h b/keyboards/tomato/config.h deleted file mode 100644 index 185cb326cce..00000000000 --- a/keyboards/tomato/config.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER 40 Percent Club -#define PRODUCT Tomato -#define DESCRIPTION A 30 key ortholinear keyboard with RGB backlighting - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 6 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } -#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* eliminate lag on space cadet mods */ -#define PERMISSIVE_HOLD - -/* setup lighting */ -#define RGB_DI_PIN B5 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 30 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/tomato/keymaps/default/keymap.c b/keyboards/tomato/keymaps/default/keymap.c deleted file mode 100644 index 94bfca202bc..00000000000 --- a/keyboards/tomato/keymaps/default/keymap.c +++ /dev/null @@ -1,158 +0,0 @@ -#include QMK_KEYBOARD_H - -#define SPC_F1 LT(1,KC_SPC) -#define BS_F2 LT(2,KC_BSPC) -#define C_F3 LT(3,KC_C) -#define V_F4 LT(4,KC_V) -#define B_F5 LT(5,KC_B) -#define Z_CTL MT(MOD_LCTL, KC_Z) -#define X_ALT MT(MOD_LALT, KC_X) -#define N_ALT MT(MOD_RALT, KC_N) -#define M_CTL MT(MOD_RCTL, KC_M) -#define ENT_SFT MT(MOD_RSFT, KC_ENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Level 0: Default Layer - * ,-------------------------------------------------------------------------------. - * | Q | W | E | R | T | Y | U | I | O | P | - * |-------------------------------------------------------------------------------| - * | A | S | D | F | G | H | J | K | L | ESC | - * |-------------------------------------------------------------------------------| - * | Z | X | C | V | BSPC | SPC | B | N | M | ENT | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P - , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC - , Z_CTL, X_ALT, C_F3, V_F4, BS_F2, SPC_F1, B_F5, N_ALT, M_CTL, ENT_SFT - ), - /* Level 1: Numbers Layer - * ,-------------------------------------------------------------------------------. - * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - * |-------------------------------------------------------------------------------| - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | - * |-------------------------------------------------------------------------------| - * | | | | | DEL | | | | | | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 - , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_DEL, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - ), - /* Level 2: Symbols Layer - * ,-------------------------------------------------------------------------------. - * | ! | @ | # | $ | % | ^ | & | * | ( | ) | - * |-------------------------------------------------------------------------------| - * | F11 | F12 | | | | | | | | ` | - * |-------------------------------------------------------------------------------| - * | | | | | | | | | | | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN - , KC_F11, KC_F12,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_GRAVE - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - ), - /* Level 3: RGB Layer - * ,-------------------------------------------------------------------------------. - * | | | | | | - | = | [ | ] | \ | - * |-------------------------------------------------------------------------------| - * | Tab | | | | | , | . | / | ; | ' | - * |-------------------------------------------------------------------------------| - * | | | | | | | Left | Down | Up | Right | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS - , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_COMM,KC_DOT, KC_SLSH,KC_SCLN,KC_QUOT - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT - ), - /* Level 4: RGB Layer - * ,-------------------------------------------------------------------------------. - * | | | | | | _ | + | { | } | | | - * |-------------------------------------------------------------------------------| - * | Tab | | | | | < | > | ? | : | " | - * |-------------------------------------------------------------------------------| - * | | | | | | | Home | PgDn | PgUp | End | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE - , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LT, KC_GT, KC_QUES,KC_COLN,KC_DQUO - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_HOME,KC_PGUP,KC_PGDN,KC_END - ), - /* Level 5: RGB Layer - * ,-------------------------------------------------------------------------------. - * | Calc | Web | Mail |Explore| | | | | | | - * |-------------------------------------------------------------------------------| - * |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD|xxxxxxx|xxxxxxx|RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| - * |-------------------------------------------------------------------------------| - * | | | | | Flash | | | | | | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_CALC,KC_WSCH,KC_MAIL,KC_MYCM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - , RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,KC_NO, KC_NO, RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - ), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/tomato/readme.md b/keyboards/tomato/readme.md deleted file mode 100644 index e3851f18ca6..00000000000 --- a/keyboards/tomato/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -Tomato -=== - -A 30 key keyboard with programmable rgb backlighting. - -* [The fluff](http://www.40percent.club/2017/07/tomato-in-gherkin.html) -* [The meat](https://github.com/di0ib/Misc/tree/master/tomato) - -Keyboard Maintainer: QMK Community -Hardware Supported: Tomato PCB -Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2017/07/tomato-in-gherkin.html) - -Make example for this keyboard (after setting up your build environment): - - make tomato:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -First pass at adding support for the tomato keyboard. Completely -untested. Intended to kick-start development. diff --git a/keyboards/tomato/rules.mk b/keyboards/tomato/rules.mk deleted file mode 100644 index cbb2b051963..00000000000 --- a/keyboards/tomato/rules.mk +++ /dev/null @@ -1,58 +0,0 @@ -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -BOOTLOADER = caterina - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes - -LAYOUTS = ortho_3x10 diff --git a/keyboards/tomato/tomato.h b/keyboards/tomato/tomato.h deleted file mode 100644 index f8674be40ed..00000000000 --- a/keyboards/tomato/tomato.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef GHERKIN_H -#define GHERKIN_H - -#include "quantum.h" - -#define LAYOUT_ortho_3x10( \ - K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \ - K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \ - K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \ -) { \ - { K00, K01, K02, K03, K04, K05 }, \ - { K10, K11, K12, K13, K14, K15 }, \ - { K20, K21, K22, K23, K24, K25 }, \ - { K30, K31, K32, K33, K34, K35 }, \ - { K40, K41, K42, K43, K44, K45 } \ -} - -#endif diff --git a/keyboards/touchpad/config.h b/keyboards/touchpad/config.h new file mode 100644 index 00000000000..b953b4f499e --- /dev/null +++ b/keyboards/touchpad/config.h @@ -0,0 +1,65 @@ +/* +Copyright 2018 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x16D0 +#define PRODUCT_ID 0x0DB8 +#define DEVICE_VER 0x0001 +#define MANUFACTURER JacoBurge +#define PRODUCT TouchPad +#define DESCRIPTION A capacitive touchpad + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 6 + + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/touchpad/info.json b/keyboards/touchpad/info.json new file mode 100644 index 00000000000..625bbffd8e0 --- /dev/null +++ b/keyboards/touchpad/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "touchpad", + "url": "", + "maintainer": "qmk", + "width": 6, + "height": 6, + "layouts": { + "LAYOUT_ortho_6x6": { + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, + {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, + {"x":0, "y":5}, {"x":1, "y":5}, {"x":2, "y":5}, {"x":3, "y":5}, {"x":4, "y":5}, {"x":5, "y":5} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/touchpad/keymaps/default/keymap.c b/keyboards/touchpad/keymaps/default/keymap.c new file mode 100644 index 00000000000..7fcaa70c5d4 --- /dev/null +++ b/keyboards/touchpad/keymaps/default/keymap.c @@ -0,0 +1,30 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_ortho_6x6( + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F + ) + +}; diff --git a/keyboards/touchpad/matrix.c b/keyboards/touchpad/matrix.c new file mode 100644 index 00000000000..3af4c5c3c79 --- /dev/null +++ b/keyboards/touchpad/matrix.c @@ -0,0 +1,291 @@ +/* +MIT License +Copyright (c) 2018, JacoBurge +Adapted for QMK by Jack Humbert in 2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "matrix.h" +#include "i2c_master.h" +#include "quantum.h" + +#define VIBRATE_LENGTH 50 //Defines number of interrupts motor will vibrate for, must be bigger than 8 for correct operation +volatile uint8_t vibrate = 0; //Trigger vibration in interrupt + +static matrix_row_t matrix[MATRIX_ROWS]; + +const uint8_t SENr[6] = {1, 2, 3, 5, 6, 7};//Maps capacitive pads to pins +const uint8_t SENc[6] = {0, 4, 8, 9, 10, 11}; + +volatile uint8_t LEDs[6][6] = {{0}};//Stores current LED values + +//Read data from the cap touch IC +uint8_t readDataFromTS(uint8_t reg) { + uint8_t rx[1] = { 0 }; + if (i2c_readReg(0x1C << 1, reg, rx, 1, 100) == 0) { + return rx[0]; + } + return 0; +} + +//Write data to cap touch IC +uint8_t writeDataToTS(uint8_t reg, uint8_t data) { + uint8_t tx[2] = { reg, data }; + if (i2c_transmit(0x1C << 1, tx, 2, 100) == 0) { + return 1; + } else { + return 0; + } +} + + +uint8_t checkTSPres(void) { + return (readDataFromTS(0x00) == 0x3E); +} + +uint8_t capSetup(void) { + + uint8_t temp_return = checkTSPres(); + + if (temp_return == 1) { + // Perform measurements every 16ms + writeDataToTS(0x08, 1); + + // Increase detection integrator value + writeDataToTS(0x0B, 1); + + // Oversample to gain two bits for columns + writeDataToTS(0x28, 0x42); + writeDataToTS(0x29, 0x00); + writeDataToTS(0x2A, 0x00); + writeDataToTS(0x2B, 0x00); + writeDataToTS(0x2C, 0x42); + writeDataToTS(0x2D, 0x00); + writeDataToTS(0x2E, 0x00); + writeDataToTS(0x2F, 0x00); + writeDataToTS(0x30, 0x42); + writeDataToTS(0x31, 0x42); + writeDataToTS(0x32, 0x42); + writeDataToTS(0x33, 0x42); + + // Recalibration if touch detected for more than 8 seconds n*0.16s + writeDataToTS(0x0C, 50); + + // Enable keys and set key groups + writeDataToTS(0x1C, 0x00 | 0x04); + writeDataToTS(0x1D, 0x00 | 0x08); + writeDataToTS(0x1E, 0x00 | 0x08); + writeDataToTS(0x1F, 0x00 | 0x08); + writeDataToTS(0x20, 0x00 | 0x04); + writeDataToTS(0x21, 0x00 | 0x08); + writeDataToTS(0x22, 0x00 | 0x08); + writeDataToTS(0x23, 0x00 | 0x08); + writeDataToTS(0x24, 0x00 | 0x04); + writeDataToTS(0x25, 0x00 | 0x04); + writeDataToTS(0x26, 0x00 | 0x04); + writeDataToTS(0x27, 0x00 | 0x04); + + } + return temp_return; +} + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +void matrix_init(void) { + + i2c_init(); + + //Motor enable + setPinOutput(E6); + //Motor PWM + setPinOutput(D7); + + //Power LED + setPinOutput(B7); + writePinHigh(B7); + + //LEDs Columns + setPinOutput(F7); + setPinOutput(F6); + setPinOutput(F5); + setPinOutput(F4); + setPinOutput(F1); + setPinOutput(F0); + + //LEDs Rows + setPinOutput(D6); + setPinOutput(B4); + setPinOutput(B5); + setPinOutput(B6); + setPinOutput(C6); + setPinOutput(C7); + + //Capacitive Interrupt + setPinInput(D2); + + capSetup(); + writeDataToTS(0x06, 0x12); //Calibrate capacitive touch IC + + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + + matrix_init_quantum(); +} + + +uint16_t touchDetectionRoutine(void) { + uint16_t data; + uint8_t temp1, temp2; + + temp1 = readDataFromTS(0x04); + temp2 = readDataFromTS(0x03); + data = temp1; + data = (data << 8) | temp2; + return data; + +} + +//Process raw capacitive data, map pins to rows and columns +void decodeArray(uint16_t dataIn, uint8_t *column, uint8_t *row) { + uint8_t i1 = 20, i2 = 20; + for (uint8_t i = 0; i < 12; i++) { + if ((dataIn & 0b1) == 1) { + if (i1 == 20) { + i1 = i; + } else if (i2 == 20) { + i2 = i; + } + } + dataIn = dataIn >> 1; + } + + for (uint8_t j = 0; j < 6; j++) { + if (SENr[j] == i1 || SENr[j] == i2) { + *row = j; + } + if (SENc[j] == i1 || SENc[j] == i2) { + *column = j; + } + } +} + +void touchClearCurrentDetections(void) { + readDataFromTS(0x05); + readDataFromTS(0x02); + readDataFromTS(0x03); + readDataFromTS(0x04); +} + +//Check interrupt pin +uint8_t isTouchChangeDetected(void) { + return !readPin(D2); +} + +uint8_t matrix_scan(void) { + if (isTouchChangeDetected()) { + uint16_t dataIn = touchDetectionRoutine(); + if ((dataIn & 0b111100010001) > 0 && (dataIn & 0b000011101110) > 0) { + uint8_t column = 10, row = 10; + decodeArray(dataIn, &column, &row); + if (column != 10 && row != 10) { + vibrate = VIBRATE_LENGTH; //Trigger vibration + matrix[row] = _BV(column); + } else { + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + } + } else { + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + } + touchClearCurrentDetections(); + } + + for (uint8_t c = 0; c < 6; c++) { + for (uint8_t r = 0; r < 6; r++) { + switch (r) { + case 0: writePin(D6, matrix_is_on(r, c)); break; + case 1: writePin(B4, matrix_is_on(r, c)); break; + case 2: writePin(B5, matrix_is_on(r, c)); break; + case 3: writePin(B6, matrix_is_on(r, c)); break; + case 4: writePin(C6, matrix_is_on(r, c)); break; + case 5: writePin(C7, matrix_is_on(r, c)); break; + } + + switch (c) { + case 0: writePin(F5, !matrix_is_on(r, c)); break; + case 1: writePin(F4, !matrix_is_on(r, c)); break; + case 2: writePin(F1, !matrix_is_on(r, c)); break; + case 3: writePin(F0, !matrix_is_on(r, c)); break; + case 4: writePin(F6, !matrix_is_on(r, c)); break; + case 5: writePin(F7, !matrix_is_on(r, c)); break; + } + } + } + + if (vibrate == VIBRATE_LENGTH) { + writePinHigh(E6); + writePinHigh(D7); + vibrate--; + } else if (vibrate > 0) { + vibrate--; + } else if (vibrate == 0) { + writePinLow(D7); + writePinLow(E6); + } + + matrix_scan_quantum(); + + return 1; + +} + +bool matrix_is_on(uint8_t row, uint8_t col) { + return (matrix[row] & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x0510 -#define DEVICE_VER 0x0101 -#define MANUFACTURER Keebio -#define PRODUCT Tragicforce 68 -#define DESCRIPTION Programmable PCB replacement for Magicforce 68 - -/* key matrix size */ -#define MATRIX_ROWS 9 -#define MATRIX_COLS 8 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D3, D2, D1, D0, B4, E6, C6, D7, D4 } -#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 7 - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#endif diff --git a/keyboards/tragicforce68/info.json b/keyboards/tragicforce68/info.json deleted file mode 100644 index f3e3d6adad1..00000000000 --- a/keyboards/tragicforce68/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "Tragicforce 68", - "url": "https://keeb.io", - "maintainer": "Keebio", - "width": 17.25, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] - } - } -} diff --git a/keyboards/tragicforce68/tragicforce68.h b/keyboards/tragicforce68/tragicforce68.h deleted file mode 100644 index e1b2a038d08..00000000000 --- a/keyboards/tragicforce68/tragicforce68.h +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -#include "quantum.h" - -#define LAYOUT( \ - A1, A2, A3, A4, A5, A6, A7, A8, E1, E2, E3, E4, E5, E6, E7, E8, \ - B1, B2, B3, B4, B5, B6, B7, B8, F1, F2, F3, F4, F5, F6, F7, F8, \ - C1, C2, C3, C4, C5, C6, C7, C8, G1, G2, G3, G4, G5, \ - D1, D2, D3, D4, D5, D6, D7, D8, H1, H2, H3, H4, H5, \ - J1, J2, J3, J5, J7, J8, H6, G6, G7, G8 \ -) { \ - { A1, A2, A3, A4, A5, A6, A7, A8 }, \ - { B1, B2, B3, B4, B5, B6, B7, B8 }, \ - { C1, C2, C3, C4, C5, C6, C7, C8 }, \ - { D1, D2, D3, D4, D5, D6, D7, D8 }, \ - { E1, E2, E3, E4, E5, E6, E7, E8 }, \ - { F1, F2, F3, F4, F5, F6, F7, F8 }, \ - { G1, G2, G3, G4, G5, G6, G7, G8 }, \ - { H1, H2, H3, H4, H5, H6, KC_NO, KC_NO }, \ - { J1, J2, J3, KC_NO, J5, KC_NO, J7, J8 } \ -} - -#define LAYOUT_split_space( \ - A1, A2, A3, A4, A5, A6, A7, A8, E1, E2, E3, E4, E5, E6, E7, E8, \ - B1, B2, B3, B4, B5, B6, B7, B8, F1, F2, F3, F4, F5, F6, F7, F8, \ - C1, C2, C3, C4, C5, C6, C7, C8, G1, G2, G3, G4, G5, \ - D1, D2, D3, D4, D5, D6, D7, D8, H1, H2, H3, H4, H5, \ - J1, J2, J3, J4, J5, J6, J7, J8, H6, G6, G7, G8 \ -) { \ - { A1, A2, A3, A4, A5, A6, A7, A8 }, \ - { B1, B2, B3, B4, B5, B6, B7, B8 }, \ - { C1, C2, C3, C4, C5, C6, C7, C8 }, \ - { D1, D2, D3, D4, D5, D6, D7, D8 }, \ - { E1, E2, E3, E4, E5, E6, E7, E8 }, \ - { F1, F2, F3, F4, F5, F6, F7, F8 }, \ - { G1, G2, G3, G4, G5, G6, G7, G8 }, \ - { H1, H2, H3, H4, H5, H6, KC_NO, KC_NO }, \ - { J1, J2, J3, J4, J5, J6, J7, J8 } \ -} - -#define LAYOUT_kc( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) LAYOUT( \ - KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ - KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ - KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ - KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ - KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ - KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ - KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ - KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ -) diff --git a/keyboards/treadstone32/config.h b/keyboards/treadstone32/config.h new file mode 100644 index 00000000000..a7f9914536b --- /dev/null +++ b/keyboards/treadstone32/config.h @@ -0,0 +1,103 @@ +/* +Copyright 2019 marksard + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xDFA5 +#define DEVICE_VER 0x0010 +#define MANUFACTURER marksard +#define PRODUCT treadstone32 +#define DESCRIPTION Minimal Symmetrical staggered 32-Key Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F1, F0, E6, B2, B4, D7, D6, D4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, C7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +#define RGBLED_NUM 6 + +#ifndef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 200 + #define RGBLIGHT_VAL_STEP 17 +#else + #define RGBLIGHT_LIMIT_VAL 50 + #define RGBLIGHT_VAL_STEP 4 +#endif +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for treadstone32 keyboard +// 120 RGBoff +// 330 RGB 6 +// 300 RGB 32 + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/treadstone32/info.json b/keyboards/treadstone32/info.json new file mode 100644 index 00000000000..2ac18be86e2 --- /dev/null +++ b/keyboards/treadstone32/info.json @@ -0,0 +1,175 @@ +{ + "keyboard_name": "Treadstone32", + "url": "https://github.com/marksard/Keyboards", + "maintainer": "marksard", + "width": 10.5, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + { + "label": "Q", + "x": 0, + "y": 0 + }, + { + "label": "W", + "x": 1, + "y": 0 + }, + { + "label": "E", + "x": 2, + "y": 0 + }, + { + "label": "R", + "x": 3, + "y": 0 + }, + { + "label": "T", + "x": 4, + "y": 0 + }, + { + "label": "Y", + "x": 5.5, + "y": 0 + }, + { + "label": "U", + "x": 6.5, + "y": 0 + }, + { + "label": "I", + "x": 7.5, + "y": 0 + }, + { + "label": "O", + "x": 8.5, + "y": 0 + }, + { + "label": "P", + "x": 9.5, + "y": 0 + }, + { + "label": "A", + "x": 0.25, + "y": 1 + }, + { + "label": "S", + "x": 1.25, + "y": 1 + }, + { + "label": "D", + "x": 2.25, + "y": 1 + }, + { + "label": "F", + "x": 3.25, + "y": 1 + }, + { + "label": "G", + "x": 4.25, + "y": 1 + }, + { + "label": "H", + "x": 5.25, + "y": 1 + }, + { + "label": "J", + "x": 6.25, + "y": 1 + }, + { + "label": "K", + "x": 7.25, + "y": 1 + }, + { + "label": "L", + "x": 8.25, + "y": 1 + }, + { + "label": "enter", + "x": 9.25, + "y": 1 + }, + { + "label": "Z", + "x": 0, + "y": 2 + }, + { + "label": "X", + "x": 1, + "y": 2 + }, + { + "label": "C", + "x": 2, + "y": 2 + }, + { + "label": "V", + "x": 3, + "y": 2 + }, + { + "label": "B", + "x": 4, + "y": 2 + }, + { + "label": "N", + "x": 5.5, + "y": 2 + }, + { + "label": "M", + "x": 6.5, + "y": 2 + }, + { + "label": ",", + "x": 7.5, + "y": 2 + }, + { + "label": ".", + "x": 8.5, + "y": 2 + }, + { + "label": "/", + "x": 9.5, + "y": 2 + }, + { + "label": "backspace", + "x": 3.25, + "y": 3, + "w": 2 + }, + { + "label": "space", + "x": 5.25, + "y": 3, + "w": 2 + } + ] + } + } +} diff --git a/keyboards/treadstone32/keymaps/default/config.h b/keyboards/treadstone32/keymaps/default/config.h new file mode 100644 index 00000000000..a6363f9b9a5 --- /dev/null +++ b/keyboards/treadstone32/keymaps/default/config.h @@ -0,0 +1,58 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT + +#define TAPPING_LAYER_TERM 150 // Custom LT Tapping term +#define TAPPING_TERM_PER_KEY + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/treadstone32/keymaps/default/keymap.c b/keyboards/treadstone32/keymaps/default/keymap.c new file mode 100644 index 00000000000..a7b908c9de6 --- /dev/null +++ b/keyboards/treadstone32/keymaps/default/keymap.c @@ -0,0 +1,170 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + RGBRST = SAFE_RANGE, + LOWER, + RAISE, + KANJI, +}; + +// enum tapdances{ +// TD_CODO = 0, +// TD_SLRO, +// }; + +// Layer Mode aliases +#define KC_MLAD MO(_ADJUST) + +// Base layer mod tap +#define KC_A_SF LSFT_T(KC_A) +#define KC_Z_CT LCTL_T(KC_Z) +#define KC_X_AL LALT_T(KC_X) +#define KC_C_GU LGUI_T(KC_C) +#define KC_SSCT LCTL_T(KC_SLSH) +#define KC_ENSF LSFT_T(KC_ENT) + +// Lower layer mod tap +#define KC_F6SF LSFT_T(KC_F6) +#define KC_BSSF LSFT_T(KC_BSLS) +#define KC_11CT LCTL_T(KC_F11) +#define KC_12AL LALT_T(KC_F12) + +// Layer tap +#define KC_BSLO LT(_LOWER, KC_BSPC) +#define KC_SPRA LT(_RAISE, KC_SPC) + +// Tap dance +// #define KC_CODO TD(TD_CODO) +// #define KC_SLRO TD(TD_SLRO) + +// qk_tap_dance_action_t tap_dance_actions[] = { +// [TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT), +// [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO), +// }; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + //,---------------------------------------------------------------------------------------------------. + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_A_SF, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_Z_CT, KC_X_AL, KC_C_GU, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SSCT, + //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------' + KC_BSLO, KC_SPRA + // `---------|---------' + ), + + [_LOWER] = LAYOUT( + //,---------------------------------------------------------------------------------------------------. + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_F6SF, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUOT, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_11CT, KC_12AL, KC_ESC, KC_TAB, KANJI, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_GRV, + //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------' + _______, KC_MLAD + // `---------|---------' + ), + + [_RAISE] = LAYOUT( + //,---------------------------------------------------------------------------------------------------. + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LSFT, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, KC_MINS, KC_RO, KC_COMM, KC_DOT, KC_SSCT, + //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------' + _______, _______ + // `---------|---------' + ), + + [_ADJUST] = LAYOUT( + //,---------------------------------------------------------------------------------------------------. + RESET, RGBRST, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, + //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------' + _______, _______ + // `---------|---------' + ) +}; + +uint16_t get_tapping_term(uint16_t keycode) { + switch (keycode) { + case KC_BSLO: + return TAPPING_LAYER_TERM; + case KC_SPRA: + return TAPPING_LAYER_TERM; + default: + return TAPPING_TERM; + } +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void keyboard_post_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/treadstone32/keymaps/default/readme.md b/keyboards/treadstone32/keymaps/default/readme.md new file mode 100644 index 00000000000..387efc0d45a --- /dev/null +++ b/keyboards/treadstone32/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# Default keymap for treadstone32 + +## Description + +## How to use diff --git a/keyboards/treadstone32/keymaps/default/readme_jp.md b/keyboards/treadstone32/keymaps/default/readme_jp.md new file mode 100644 index 00000000000..ff078dcc8a6 --- /dev/null +++ b/keyboards/treadstone32/keymaps/default/readme_jp.md @@ -0,0 +1,55 @@ +# US配列ライクデフォルトキーマップ + +## 概要 + + US配列ライクなデフォルトキーマップです。 + +## キーマップの見かた + +qmk_firmware\tmk_core\common\keycode.h +に基本的なキーコードがあります。また、Keymap.cの上部にカスタムしたKC_で始まるものを登録しています。 + +Leyer Tap、Mod TapというQMKの機能を使っています。 + +Layer Tapはタップで指定したキー、長押しで指定したレイヤーに移動します。 +例:LT(RAISE, KC_V) → タップでV、長押しでRAISEレイヤー移動 + +Mod Tapはタップで視程したキー、長押しで視程したレイヤーに移動します。 +例:LSFT_T(KC_Z) → タップでZ、長押しで左シフト + +もう少し詳しい内容についてはQMK Documentをお読みいただくかネットを検索すれば情報が載っていますので別途検索してみてください。 + +## 機能 + + QWERTYキーマップをベースにしていて、LowerレイヤーとRaiseレイヤーに他のキーを配置しています。 + Lowerを最初し続けながらRaiseを同時押しするとAdjustレイヤーを使うことが出来ます。 + +## OS切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- KNRM: QMKのノーマル状態です。macだと正常に使える(はず)です +- KSWP: ノーマル状態のままWindowsで使用するとALTキーとGUI(win)キーが逆ですので、それを入れ換えます。Windowsユーザーはこちらのモードにしてください + +## IME切り替え方法 + + Winの場合、LowerレイヤーにKANJIキー(半角/全角 漢字)がありますので、Lower+KANJIで切り替えてください。 + +## ソフトウェアリセットについて + + キーボードにはハードウェアのリセットボタンが付いていますが、ソフトウェアリセットをかけられます。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来、AdjustレイヤーのRESETを押下するとリセットがかかります。 + +## LEDの点灯切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- RGBRST: LEDのリセット +- RGB_TOG: LEDのON/OFF切り替え +- RGB_MOD: LEDの光り方の変更 +- RGB_HUI: Hue+ 色合いを変更 +- RGB_HUD: Hue- 色合いを変更 +- RGB_SAI: Saturation+ 色の濃さを変更 +- RGB_SAD: Saturation- 色の濃さを変更 +- RGB_VAI: Value+ 明るさを変更 +- RGB_VAD: Value- 明るさを変更 diff --git a/keyboards/treadstone32/keymaps/default/rules.mk b/keyboards/treadstone32/keymaps/default/rules.mk new file mode 100644 index 00000000000..8c4541fa197 --- /dev/null +++ b/keyboards/treadstone32/keymaps/default/rules.mk @@ -0,0 +1,25 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +TAP_DANCE_ENABLE = no + +# If your custom treadstone32 pcb, you can rewrite to yes. +RGBLIGHT_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/treadstone32/keymaps/like_jis/config.h b/keyboards/treadstone32/keymaps/like_jis/config.h new file mode 100644 index 00000000000..a6363f9b9a5 --- /dev/null +++ b/keyboards/treadstone32/keymaps/like_jis/config.h @@ -0,0 +1,58 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT + +#define TAPPING_LAYER_TERM 150 // Custom LT Tapping term +#define TAPPING_TERM_PER_KEY + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/treadstone32/keymaps/like_jis/keymap.c b/keyboards/treadstone32/keymaps/like_jis/keymap.c new file mode 100644 index 00000000000..891f484469c --- /dev/null +++ b/keyboards/treadstone32/keymaps/like_jis/keymap.c @@ -0,0 +1,170 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + RGBRST = SAFE_RANGE, + LOWER, + RAISE, + KANJI, +}; + +// enum tapdances{ +// TD_CODO = 0, +// TD_SLRO, +// }; + +// Layer Mode aliases +#define KC_MLAD MO(_ADJUST) + +// Base layer mod tap +#define KC_A_SF LSFT_T(KC_A) +#define KC_Z_CT LCTL_T(KC_Z) +#define KC_X_AL LALT_T(KC_X) +#define KC_C_GU LGUI_T(KC_C) +#define KC_SSCT LCTL_T(KC_SLSH) +#define KC_ENSF LSFT_T(KC_ENT) + +// Lower layer mod tap +#define KC_F6SF LSFT_T(KC_F6) +#define KC_BSSF LSFT_T(KC_BSLS) +#define KC_11CT LCTL_T(KC_F11) +#define KC_12AL LALT_T(KC_F12) + +// Layer tap +#define KC_BSLO LT(_LOWER, KC_BSPC) +#define KC_SPRA LT(_RAISE, KC_SPC) + +// Tap dance +// #define KC_CODO TD(TD_CODO) +// #define KC_SLRO TD(TD_SLRO) + +// qk_tap_dance_action_t tap_dance_actions[] = { +// [TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT), +// [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO), +// }; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + //,---------------------------------------------------------------------------------------------------. + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_A_SF, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_Z_CT, KC_X_AL, KC_C_GU, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SSCT, + //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------' + KC_BSLO, KC_SPRA + // `---------|---------' + ), + + [_LOWER] = LAYOUT( + //,---------------------------------------------------------------------------------------------------. + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_F6SF, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUOT, KC_BSSF, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_11CT, KC_12AL, KC_ESC, KC_TAB, KANJI, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_RO, + //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------' + _______, KC_MLAD + // `---------|---------' + ), + + [_RAISE] = LAYOUT( + //,---------------------------------------------------------------------------------------------------. + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LSFT, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, KC_MINS, KC_RO, KC_COMM, KC_DOT, KC_SSCT, + //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------' + _______, _______ + // `---------|---------' + ), + + [_ADJUST] = LAYOUT( + //,---------------------------------------------------------------------------------------------------. + RESET, RGBRST, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, + //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, + //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------' + _______, _______ + // `---------|---------' + ) +}; + +uint16_t get_tapping_term(uint16_t keycode) { + switch (keycode) { + case KC_BSLO: + return TAPPING_LAYER_TERM; + case KC_SPRA: + return TAPPING_LAYER_TERM; + default: + return TAPPING_TERM; + } +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + bool result = false; + switch (keycode) { + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + return result; +} + +void keyboard_post_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif +} diff --git a/keyboards/treadstone32/keymaps/like_jis/readme.md b/keyboards/treadstone32/keymaps/like_jis/readme.md new file mode 100644 index 00000000000..206133ee7c8 --- /dev/null +++ b/keyboards/treadstone32/keymaps/like_jis/readme.md @@ -0,0 +1,5 @@ +# The like jis type keyboard keymap for treadstone32 + +## Description + +## How to use diff --git a/keyboards/treadstone32/keymaps/like_jis/readme_jp.md b/keyboards/treadstone32/keymaps/like_jis/readme_jp.md new file mode 100644 index 00000000000..3242f101e24 --- /dev/null +++ b/keyboards/treadstone32/keymaps/like_jis/readme_jp.md @@ -0,0 +1,55 @@ +# JISキーボードライクなキーマップ + +## 概要 + + デフォルトキーマップの記号類をJISライクな配置に揃えなおしたものです。 + +## キーマップの見かた + +qmk_firmware\tmk_core\common\keycode.h +に基本的なキーコードがあります。また、Keymap.cの上部にカスタムしたKC_で始まるものを登録しています。 + +Leyer Tap、Mod TapというQMKの機能を使っています。 + +Layer Tapはタップで指定したキー、長押しで指定したレイヤーに移動します。 +例:LT(RAISE, KC_V) → タップでV、長押しでRAISEレイヤー移動 + +Mod Tapはタップで視程したキー、長押しで視程したレイヤーに移動します。 +例:LSFT_T(KC_Z) → タップでZ、長押しで左シフト + +もう少し詳しい内容についてはQMK Documentをお読みいただくかネットを検索すれば情報が載っていますので別途検索してみてください。 + +## 機能 + + QWERTYキーマップをベースにしていて、LowerレイヤーとRaiseレイヤーに他のキーを配置しています。 + Lowerを最初し続けながらRaiseを同時押しするとAdjustレイヤーを使うことが出来ます。 + +## OS切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- KNRM: QMKのノーマル状態です。macだと正常に使える(はず)です +- KSWP: ノーマル状態のままWindowsで使用するとALTキーとGUI(win)キーが逆ですので、それを入れ換えます。Windowsユーザーはこちらのモードにしてください + +## IME切り替え方法 + + Winの場合、LowerレイヤーにKANJIキー(半角/全角 漢字)がありますので、Lower+KANJIで切り替えてください。 + +## ソフトウェアリセットについて + + キーボードにはハードウェアのリセットボタンが付いていますが、ソフトウェアリセットをかけられます。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来、AdjustレイヤーのRESETを押下するとリセットがかかります。 + +## LEDの点灯切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- RGBRST: LEDのリセット +- RGB_TOG: LEDのON/OFF切り替え +- RGB_MOD: LEDの光り方の変更 +- RGB_HUI: Hue+ 色合いを変更 +- RGB_HUD: Hue- 色合いを変更 +- RGB_SAI: Saturation+ 色の濃さを変更 +- RGB_SAD: Saturation- 色の濃さを変更 +- RGB_VAI: Value+ 明るさを変更 +- RGB_VAD: Value- 明るさを変更 diff --git a/keyboards/treadstone32/keymaps/like_jis/rules.mk b/keyboards/treadstone32/keymaps/like_jis/rules.mk new file mode 100644 index 00000000000..8c4541fa197 --- /dev/null +++ b/keyboards/treadstone32/keymaps/like_jis/rules.mk @@ -0,0 +1,25 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +TAP_DANCE_ENABLE = no + +# If your custom treadstone32 pcb, you can rewrite to yes. +RGBLIGHT_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/treadstone32/readme.md b/keyboards/treadstone32/readme.md new file mode 100644 index 00000000000..989a29c204b --- /dev/null +++ b/keyboards/treadstone32/readme.md @@ -0,0 +1,18 @@ +# treadstone32 + +![treadstone32](https://github.com/marksard/Keyboards/raw/master/_image/20190421-P4210001.jpg) + +A 32-key Symmetric staggered keyboard. + +Keyboard Maintainer: [marksard](https://github.com/marksard) +Hardware Supported: The PCBs, controllers supported +Hardware Availability: links to where you can find this hardware + +Make example for this keyboard (after setting up your build environment): + + make treadstone32:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +[Build guide](https://github.com/marksard/Keyboards/blob/master/treadstone32/documents/treadstone32_buildguide.md) +[Firmware](https://github.com/marksard/qmk_firmware/tree/my_customize/keyboards/treadstone32) diff --git a/keyboards/treadstone32/rules.mk b/keyboards/treadstone32/rules.mk new file mode 100644 index 00000000000..1d37dfc69f7 --- /dev/null +++ b/keyboards/treadstone32/rules.mk @@ -0,0 +1,64 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +LEADER_ENABLE = no + diff --git a/keyboards/treadstone32/treadstone32.c b/keyboards/treadstone32/treadstone32.c new file mode 100644 index 00000000000..9d27f86ffed --- /dev/null +++ b/keyboards/treadstone32/treadstone32.c @@ -0,0 +1,43 @@ +/* Copyright 2019 marksard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "treadstone32.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/treadstone32/treadstone32.h b/keyboards/treadstone32/treadstone32.h new file mode 100644 index 00000000000..90181124c09 --- /dev/null +++ b/keyboards/treadstone32/treadstone32.h @@ -0,0 +1,45 @@ +/* Copyright 2019 marksard. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define K_N KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L09, L08, L07, L06, L05, L04, L03, L02, L01, L00, \ + L19, L18, L17, L16, L15, L14, L13, L12, L11, L10, \ + L29, L28, L27, L26, L25, L24, L23, L22, L21, L20, \ + L35, L34 \ + ) \ + { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { K_N, K_N, K_N, K_N, L34 }, \ + { L05, L06, L07, L08, L09 }, \ + { L15, L16, L17, L18, L19 }, \ + { L25, L26, L27, L28, L29 }, \ + { L35, K_N, K_N, K_N, K_N } \ + } diff --git a/keyboards/treadstone48/common/glcdfont.c b/keyboards/treadstone48/common/glcdfont.c new file mode 100644 index 00000000000..32c688e2bb3 --- /dev/null +++ b/keyboards/treadstone48/common/glcdfont.c @@ -0,0 +1,244 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x10, 0x10, 0x10, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +#endif // FONT5X7_H diff --git a/keyboards/treadstone48/common/oled_helper.c b/keyboards/treadstone48/common/oled_helper.c new file mode 100644 index 00000000000..500d3c0dc10 --- /dev/null +++ b/keyboards/treadstone48/common/oled_helper.c @@ -0,0 +1,83 @@ +#ifdef SSD1306OLED +#include QMK_KEYBOARD_H +#include "ssd1306.h" + +void render_logo(struct CharacterMatrix *matrix) { + + const char logo_buf[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + + matrix_write(matrix, logo_buf); +} + +static char keylog_buf[24] = "Key state ready."; +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', '-', ' ', '@', ' ', ' ', + ' ', ';', ':', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void update_key_status(uint16_t keycode, keyrecord_t *record) { + + if (!record->event.pressed) return; + + char name = (keycode < 60) ? code_to_name[keycode] : ' '; + snprintf(keylog_buf, sizeof(keylog_buf) - 1, "Key:%dx%d %2x %c", + record->event.key.row, record->event.key.col, + (uint16_t)keycode, name); +} + +void render_key_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, keylog_buf); +} + +static char lock_buf[24] = "Lock state ready.\n"; +void update_lock_status(void) { + + uint8_t leds = host_keyboard_leds(); + char *num_lock = (leds & (1< +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +// GCC include 'config.h" sequence in qmk_firmware/keyboards/treadstone48/ +// -include keyboards/treadstone48/config.h +// -include keyboards/treadstone48/rev?/config.h +// -include keyboards/treadstone48/rev?/keymaps/MAPNAME/config.h +// XXXX.c + +#include + +// GCC include search path in qmk_firmare/keyboards/treadstone48/ +// #include "..." search starts here: +// #include <...> search starts here: +// keyboards/treadstone48/rev?/keymaps/MAPNAME +// keyboards/treadstone48 +// keyboards/treadstone48/rev? +// . +// ./tmk_core +// ...... + +// MACRO and FUNCTION are features that are depreciated. +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/treadstone48/i2c.c b/keyboards/treadstone48/i2c.c new file mode 100644 index 00000000000..4bee5c63982 --- /dev/null +++ b/keyboards/treadstone48/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); diff --git a/keyboards/treadstone48/keymaps/default/config.h b/keyboards/treadstone48/keymaps/default/config.h new file mode 100644 index 00000000000..3f63a0cfbbd --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/config.h @@ -0,0 +1,60 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 225 +// #define PREVENT_STUCK_MODIFIERS +// #define IGNORE_MOD_TAP_INTERRUPT + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/treadstone48/keymaps/default/keymap.c b/keyboards/treadstone48/keymaps/default/keymap.c new file mode 100644 index 00000000000..406f1129212 --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/keymap.c @@ -0,0 +1,278 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" +#include "../common/oled_helper.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + KANJI, + RGBRST +}; + +enum tapdances{ + TD_SCCL = 0, + TD_SLRO, +}; + +// Layer Mode aliases +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_TBSF LSFT_T(KC_TAB) +// #define KC_SPSF LSFT_T(KC_SPC) +#define KC_ALAP LALT_T(KC_APP) +#define KC_JEQL LSFT(KC_MINS) + +#define KC_SCCL TD(TD_SCCL) +#define KC_SLRO TD(TD_SLRO) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), + [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + KC_TBSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, KC_ENT,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLRO, KC_UP, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_ALAP, KC_LEFT, KC_DOWN, KC_RGHT,\ + //`-------------------------------------------------------------------------------------------------------------------' + KC_DEL \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_LOWER] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, XXXXX, KC_SCLN, KC_QUOT, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, KC_F11, KC_F12, XXXXX, KANJI, KC_ENT, XXXXX, XXXXX, KC_COMM, KC_DOT, KC_GRV, KC_PGUP, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, KC_DEL, _____, _____, XXXXX, KC_HOME, KC_PGDN, KC_END,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_RAISE] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + _____, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_4, KC_5, KC_6, KC_QUOT, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_1, KC_2, KC_3, KC_RO, XXXXX, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, KC_0, KC_DOT, KC_COMM, KC_SLSH,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_ADJUST] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + XXXXX, RESET, RGBRST, AG_NORM, AG_SWAP, XXXXX, XXXXX, KC_WH_L, KC_WH_U, KC_HOME, KC_PGUP, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + XXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXX, XXXXX, KC_WH_R, KC_WH_D, KC_END, KC_PGDN, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXX, XXXXX, XXXXX, KC_BTN1, KC_BTN2, XXXXX, KC_MS_U, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, XXXXX, XXXXX, _____, XXXXX, KC_MS_L, KC_MS_D, KC_MS_R,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ) +}; + +#define L_BASE _BASE +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +#ifdef SSD1306OLED +typedef struct { + uint8_t state; + char name[8]; +}LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 5 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {L_BASE, "Base"}, + {L_BASE + 1, "Base"}, + {L_LOWER, "Lower"}, + {L_RAISE, "Raise"}, + {L_ADJUST_TRI, "Adjust"} +}; + +static inline const char* get_leyer_status(void) { + + for (uint8_t i = 0; i < LAYER_DISPLAY_MAX; ++i) { + if (layer_state == 0 && layer_display_name[i].state == default_layer_state) { + + return layer_display_name[i].name; + } else if (layer_state != 0 && layer_display_name[i].state == layer_state) { + + return layer_display_name[i].name; + } + } + + return "?"; +} + +static char layer_status_buf[24] = "Layer state ready.\n"; +static inline void update_keymap_status(void) { + + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "OS:%s Layer:%s\n", + keymap_config.swap_lalt_lgui? "win" : "mac", get_leyer_status()); +} + +static inline void render_keymap_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, layer_status_buf); +} + +#define UPDATE_KEYMAP_STATUS() update_keymap_status() +#define RENDER_KEYMAP_STATUS(a) render_keymap_status(a) + +#else + +#define UPDATE_KEYMAP_STATUS() +#define RENDER_KEYMAP_STATUS(a) + +#endif + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + UPDATE_KEY_STATUS(keycode, record); + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + UPDATE_KEYMAP_STATUS(); + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +static inline void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +static inline void render_status(struct CharacterMatrix *matrix) { + + UPDATE_LED_STATUS(); + RENDER_LED_STATUS(matrix); + RENDER_KEYMAP_STATUS(matrix); + UPDATE_LOCK_STATUS(); + RENDER_LOCK_STATUS(matrix); + RENDER_KEY_STATUS(matrix); +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif + + matrix_clear(&matrix); + if (is_master) { + render_status(&matrix); + } + + matrix_update(&display, &matrix); +} + +#endif diff --git a/keyboards/treadstone48/keymaps/default/readme.md b/keyboards/treadstone48/keymaps/default/readme.md new file mode 100644 index 00000000000..bb835d169c1 --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# Default keymap for treadstone48 + +## Description + +## How to use diff --git a/keyboards/treadstone48/keymaps/default/readme_jp.md b/keyboards/treadstone48/keymaps/default/readme_jp.md new file mode 100644 index 00000000000..6043c93cbce --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/readme_jp.md @@ -0,0 +1,80 @@ +# US配列ライクデフォルトキーマップ + +## 概要 + + US配列ライクなデフォルトキーマップです。 + +## キーマップの見かた + +qmk_firmware\tmk_core\common\keycode.h +に基本的なキーコードがあります。また、Keymap.cの上部にカスタムしたKC_で始まるものを登録しています。 +キーマップに書くときは「KC_」を省略して書いています。 +例:KC_A → A + +Leyer Tap、Mod Tap、Tap DanceというQMKの機能を使っています。 + +Layer Tapはタップで指定したキー、長押しで指定したレイヤーに移動します。 +例:LT(RAISE, KC_V) → タップでV、長押しでRAISEレイヤー移動 + +Mod Tapはタップで視程したキー、長押しで視程したレイヤーに移動します。 +例:LSFT_T(KC_Z) → タップでZ、長押しで左シフト + +Tap Danceは指定した二つのキーをシングルタップ、ダブルタップで切り替えられます。 +例:[TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT) → シングルタップでCOMM、ダブルタップでDOT + +もう少し詳しい内容についてはQMK Documentをお読みいただくかネットを検索すれば情報が載っていますので別途検索してみてください。 + +## 機能 + + QWERTYキーマップをベースにしていて、LowerレイヤーとRaiseレイヤーに他のキーを配置しています。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + DOTの横、SLROと書いてあるのはシングルタップで/記号、ダブルタップで\記号が入力出来るようになっています。 + Lの横、SCCLと書いてあるのはシングルタップで;記号、ダブルタップで:記号が入力出来るようになっています。 + マウスキーの割り当てがありますので、もし使用したい場合はrules.mkでMOUSEKEY_ENABLE = yesにしてmakeすると使用することができます。 + +## 48キー目について + + このキーボードはEnterキーの上の2Uキーを1Ux2個にして使用する事が出来るようになっています。 使用する場合はキーマップの書き換えが必要です。 + + 各レイヤーの最下段の + +```c + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. +``` + + のXXXXXに任意のキーを入れることでPの右隣のキーとして動作するようになっています。その右隣りに従来のキーが配置されています。 + +## OS切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- KNRM: QMKのノーマル状態です。macだと正常に使える(はず)です +- KSWP: ノーマル状態のままWindowsで使用するとALTキーとGUI(win)キーが逆ですので、それを入れ換えます。Windowsユーザーはこちらのモードにしてください + +## NUMPADモードについて + + Lower + DLNPキーを一度押下するとNumpadモードになります。通常モードに戻す場合はDLBSキーを押下してください。 + +## IME切り替え方法 + + Winの場合、LowerレイヤーにKANJIキー(半角/全角 漢字)がありますので、Lower+KANJIで切り替えてください。 + +## ソフトウェアリセットについて + + キーボードにはハードウェアのリセットボタンが付いていますが、ソフトウェアリセットをかけられます。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来、AdjustレイヤーのRESETを押下するとリセットがかかります。 + +## LEDの点灯切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- RGBRST: LEDのリセット +- RGB_TOG: LEDのON/OFF切り替え +- RGB_MOD: LEDの光り方の変更 +- RGB_HUI: Hue+ 色合いを変更 +- RGB_HUD: Hue- 色合いを変更 +- RGB_SAI: Saturation+ 色の濃さを変更 +- RGB_SAD: Saturation- 色の濃さを変更 +- RGB_VAI: Value+ 明るさを変更 +- RGB_VAD: Value- 明るさを変更 diff --git a/keyboards/treadstone48/keymaps/default/rules.mk b/keyboards/treadstone48/keymaps/default/rules.mk new file mode 100644 index 00000000000..c53226431d3 --- /dev/null +++ b/keyboards/treadstone48/keymaps/default/rules.mk @@ -0,0 +1,67 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes + +# If your custom treadstone48 pcb, you can rewrite to yes. +OLED_ENABLE = no # OLED_ENABLE +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +LOCAL_GLCDFONT = no # use each keymaps "font.h" insted of "common/glcdfont.c" +# RHYMESTONE_RIGHTHAND = no # If connect right hand side of the Rhymestone, set to yes. +ANGELINA_KEYMAP = no # If Alfa verstion use set to yes. + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +# ifeq ($(strip $(RHYMESTONE_RIGHTHAND)), yes) +# OPT_DEFS += -DRHYMESTONE_RIGHTHAND +# endif + +ifeq ($(strip $(ANGELINA_KEYMAP)), yes) + OPT_DEFS += -DANGELINA_KEYMAP +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./common/oled_helper.c \ diff --git a/keyboards/treadstone48/keymaps/like_jis/config.h b/keyboards/treadstone48/keymaps/like_jis/config.h new file mode 100644 index 00000000000..3f63a0cfbbd --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/config.h @@ -0,0 +1,60 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 225 +// #define PREVENT_STUCK_MODIFIERS +// #define IGNORE_MOD_TAP_INTERRUPT + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/treadstone48/keymaps/like_jis/keymap.c b/keyboards/treadstone48/keymaps/like_jis/keymap.c new file mode 100644 index 00000000000..b63b0c9f495 --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/keymap.c @@ -0,0 +1,278 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" +#include "../common/oled_helper.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + KANJI, + RGBRST +}; + +enum tapdances{ + TD_SCCL = 0, + TD_SLRO, +}; + +// Layer Mode aliases +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_TBSF LSFT_T(KC_TAB) +// #define KC_SPSF LSFT_T(KC_SPC) +#define KC_ALAP LALT_T(KC_APP) +#define KC_JEQL LSFT(KC_MINS) + +#define KC_SCCL TD(TD_SCCL) +#define KC_SLRO TD(TD_SLRO) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), + [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + KC_TBSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, KC_ENT,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLRO, KC_UP, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_ALAP, KC_LEFT, KC_DOWN, KC_RGHT,\ + //`-------------------------------------------------------------------------------------------------------------------' + KC_DEL \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_LOWER] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, KC_DEL,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, KC_SCLN, KC_QUOT, KC_BSLS, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, KC_F11, KC_F12, XXXXX, KANJI, KC_ENT, XXXXX, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_PGUP, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, KC_DEL, _____, _____, XXXXX, KC_HOME, KC_PGDN, KC_END,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_RAISE] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + _____, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_4, KC_5, KC_6, KC_QUOT, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_1, KC_2, KC_3, KC_RO, XXXXX, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, KC_0, KC_DOT, KC_COMM, KC_SLSH,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_ADJUST] = LAYOUT_base( \ + //,--------------------------------------------------------------------------------------------------------------------. + XXXXX, RESET, RGBRST, AG_NORM, AG_SWAP, XXXXX, XXXXX, KC_WH_L, KC_WH_U, KC_HOME, KC_PGUP, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| + XXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXX, XXXXX, KC_WH_R, KC_WH_D, KC_END, KC_PGDN, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXX, XXXXX, XXXXX, KC_BTN1, KC_BTN2, XXXXX, KC_MS_U, \ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| + _____, _____, _____, _____, XXXXX, XXXXX, _____, XXXXX, KC_MS_L, KC_MS_D, KC_MS_R,\ + //`-------------------------------------------------------------------------------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ) +}; + +#define L_BASE _BASE +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +#ifdef SSD1306OLED +typedef struct { + uint8_t state; + char name[8]; +}LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 5 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {L_BASE, "Base"}, + {L_BASE + 1, "Base"}, + {L_LOWER, "Lower"}, + {L_RAISE, "Raise"}, + {L_ADJUST_TRI, "Adjust"} +}; + +static inline const char* get_leyer_status(void) { + + for (uint8_t i = 0; i < LAYER_DISPLAY_MAX; ++i) { + if (layer_state == 0 && layer_display_name[i].state == default_layer_state) { + + return layer_display_name[i].name; + } else if (layer_state != 0 && layer_display_name[i].state == layer_state) { + + return layer_display_name[i].name; + } + } + + return "?"; +} + +static char layer_status_buf[24] = "Layer state ready.\n"; +static inline void update_keymap_status(void) { + + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "OS:%s Layer:%s\n", + keymap_config.swap_lalt_lgui? "win" : "mac", get_leyer_status()); +} + +static inline void render_keymap_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, layer_status_buf); +} + +#define UPDATE_KEYMAP_STATUS() update_keymap_status() +#define RENDER_KEYMAP_STATUS(a) render_keymap_status(a) + +#else + +#define UPDATE_KEYMAP_STATUS() +#define RENDER_KEYMAP_STATUS(a) + +#endif + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + UPDATE_KEY_STATUS(keycode, record); + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + UPDATE_KEYMAP_STATUS(); + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +static inline void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +static inline void render_status(struct CharacterMatrix *matrix) { + + UPDATE_LED_STATUS(); + RENDER_LED_STATUS(matrix); + RENDER_KEYMAP_STATUS(matrix); + UPDATE_LOCK_STATUS(); + RENDER_LOCK_STATUS(matrix); + RENDER_KEY_STATUS(matrix); +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif + + matrix_clear(&matrix); + if (is_master) { + render_status(&matrix); + } + + matrix_update(&display, &matrix); +} + +#endif diff --git a/keyboards/treadstone48/keymaps/like_jis/readme.md b/keyboards/treadstone48/keymaps/like_jis/readme.md new file mode 100644 index 00000000000..796df6c4cd7 --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/readme.md @@ -0,0 +1,5 @@ +# The like jis type keyboard keymap for treadstone48 + +## Description + +## How to use diff --git a/keyboards/treadstone48/keymaps/like_jis/readme_jp.md b/keyboards/treadstone48/keymaps/like_jis/readme_jp.md new file mode 100644 index 00000000000..305ded471da --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/readme_jp.md @@ -0,0 +1,80 @@ +# JISキーボードライクなキーマップ + +## 概要 + + デフォルトキーマップの記号類をJISライクな配置に揃えなおしたものです。 + +## キーマップの見かた + +qmk_firmware\tmk_core\common\keycode.h +に基本的なキーコードがあります。また、Keymap.cの上部にカスタムしたKC_で始まるものを登録しています。 +キーマップに書くときは「KC_」を省略して書いています。 +例:KC_A → A + +Leyer Tap、Mod Tap、Tap DanceというQMKの機能を使っています。 + +Layer Tapはタップで指定したキー、長押しで指定したレイヤーに移動します。 +例:LT(RAISE, KC_V) → タップでV、長押しでRAISEレイヤー移動 + +Mod Tapはタップで視程したキー、長押しで視程したレイヤーに移動します。 +例:LSFT_T(KC_Z) → タップでZ、長押しで左シフト + +Tap Danceは指定した二つのキーをシングルタップ、ダブルタップで切り替えられます。 +例:[TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT) → シングルタップでCOMM、ダブルタップでDOT + +もう少し詳しい内容についてはQMK Documentをお読みいただくかネットを検索すれば情報が載っていますので別途検索してみてください。 + +## 機能 + + QWERTYキーマップをベースにしていて、LowerレイヤーとRaiseレイヤーに他のキーを配置しています。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + DOTの横、SLROと書いてあるのはシングルタップで/記号、ダブルタップで\記号が入力出来るようになっています。 + Lの横、SCCLと書いてあるのはシングルタップで;記号、ダブルタップで:記号が入力出来るようになっています。 + マウスキーの割り当てがありますので、もし使用したい場合はrules.mkでMOUSEKEY_ENABLE = yesにしてmakeすると使用することができます。 + +## 48キー目について + + このキーボードはEnterキーの上の2Uキーを1Ux2個にして使用する事が出来るようになっています。 使用する場合はキーマップの書き換えが必要です。 + + 各レイヤーの最下段の + +```c + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. +``` + + のXXXXXに任意のキーを入れることでPの右隣のキーとして動作するようになっています。その右隣りに従来のキーが配置されています。 + +## OS切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- KNRM: QMKのノーマル状態です。macだと正常に使える(はず)です +- KSWP: ノーマル状態のままWindowsで使用するとALTキーとGUI(win)キーが逆ですので、それを入れ換えます。Windowsユーザーはこちらのモードにしてください + +## NUMPADモードについて + + Lower + DLNPキーを一度押下するとNumpadモードになります。通常モードに戻す場合はDLBSキーを押下してください。 + +## IME切り替え方法 + + Winの場合、LowerレイヤーにKANJIキー(半角/全角 漢字)がありますので、Lower+KANJIで切り替えてください。 + +## ソフトウェアリセットについて + + キーボードにはハードウェアのリセットボタンが付いていますが、ソフトウェアリセットをかけられます。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来、AdjustレイヤーのRSTを押下するとリセットがかかります。 + +## LEDの点灯切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- RGBRST: LEDのリセット +- RGB_TOG: LEDのON/OFF切り替え +- RGB_MOD: LEDの光り方の変更 +- RGB_HUI: Hue+ 色合いを変更 +- RGB_HUD: Hue- 色合いを変更 +- RGB_SAI: Saturation+ 色の濃さを変更 +- RGB_SAD: Saturation- 色の濃さを変更 +- RGB_VAI: Value+ 明るさを変更 +- RGB_VAD: Value- 明るさを変更 diff --git a/keyboards/treadstone48/keymaps/like_jis/rules.mk b/keyboards/treadstone48/keymaps/like_jis/rules.mk new file mode 100644 index 00000000000..c53226431d3 --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis/rules.mk @@ -0,0 +1,67 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes + +# If your custom treadstone48 pcb, you can rewrite to yes. +OLED_ENABLE = no # OLED_ENABLE +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +LOCAL_GLCDFONT = no # use each keymaps "font.h" insted of "common/glcdfont.c" +# RHYMESTONE_RIGHTHAND = no # If connect right hand side of the Rhymestone, set to yes. +ANGELINA_KEYMAP = no # If Alfa verstion use set to yes. + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +# ifeq ($(strip $(RHYMESTONE_RIGHTHAND)), yes) +# OPT_DEFS += -DRHYMESTONE_RIGHTHAND +# endif + +ifeq ($(strip $(ANGELINA_KEYMAP)), yes) + OPT_DEFS += -DANGELINA_KEYMAP +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./common/oled_helper.c \ diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/config.h b/keyboards/treadstone48/keymaps/like_jis_rs/config.h new file mode 100644 index 00000000000..e8acd5c76d4 --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/config.h @@ -0,0 +1,60 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// place overrides here + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 225 +#define PREVENT_STUCK_MODIFIERS +#define IGNORE_MOD_TAP_INTERRUPT + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 1 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 4 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c b/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c new file mode 100644 index 00000000000..0e4ec063ccb --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/keymap.c @@ -0,0 +1,342 @@ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" +#include "../common/oled_helper.h" + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _BASE = 0, + _BASES, + _LOWER, + _LOWRS, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + BASE = SAFE_RANGE, + BASES, + LOWER, + LOWRS, + RAISE, + ADJUST, + KANJI, + RGBRST +}; + +enum tapdances{ + TD_SCCL = 0, + TD_SLRO, +}; + +// Layer Mode aliases +#define _____ KC_TRNS +#define XXXXX KC_NO + +#define KC_TBSF LSFT_T(KC_TAB) +// #define KC_SPSF LSFT_T(KC_SPC) +#define KC_ALAP LALT_T(KC_APP) +#define KC_JEQL LSFT(KC_MINS) +#define KC_SFUC LSFT(KC_RO) +#define KC_RSBR LSFT(KC_8) +#define KC_REBR LSFT(KC_9) + +#define KC_ZSFT LSFT_T(KC_Z) +#define KC_ESCT LCTL_T(KC_ESC) +#define KC_TBAL LALT_T(KC_TAB) +#define KC_11SF LSFT_T(KC_F11) + +#define KC_SCCL TD(TD_SCCL) +#define KC_SLRO TD(TD_SLRO) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT), + [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_NLCK,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + KC_TBSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PAST, KC_TAB,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLRO, KC_UP, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PENT,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_ALAP, KC_LEFT, KC_DOWN, KC_RGHT, LOWER, KC_P0, KC_PDOT, KC_PPLS, KC_BSPC,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + KC_DEL \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_LOWER] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, KC_DEL, KC_A, KC_B, KC_C, KC_JYEN, KC_HASH,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, KC_SCLN, KC_QUOT, KC_BSLS, _____, KC_D, KC_E, KC_F, KC_PERC, KC_SFUC,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, KC_F11, KC_F12, BASES, KANJI, KC_ENT, XXXXX, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_PGUP, KC_RSBR, KC_REBR, KC_RBRC, KC_QUOT, _____,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, _____, _____, _____, KC_DEL, _____, _____, XXXXX, KC_HOME, KC_PGDN, KC_END, _____, XXXXX, KC_COMM, KC_JEQL, KC_DEL,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_BASES] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_Q, KC_W, KC_E, KC_R, KC_T,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + KC_TBSF, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCCL, KC_ENT, KC_A, KC_S, KC_D, KC_F, KC_G,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLRO, KC_UP, KC_ZSFT, KC_X, KC_C, KC_V, KC_B,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_ALAP, KC_LEFT, KC_DOWN, KC_RGHT, KC_ESCT, KC_TBAL, KC_LGUI, LOWRS, KC_BSPC,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + KC_DEL \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_LOWRS] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXX, XXXXX, KC_SCLN, KC_QUOT, KC_BSLS, _____, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, KC_F11, KC_F12, BASE, KANJI, KC_ENT, XXXXX, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_PGUP, KC_11SF, KC_F12, BASE, KANJI, KC_ENT,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, _____, _____, _____, KC_DEL, _____, _____, XXXXX, KC_HOME, KC_PGDN, KC_END, _____, _____, _____, _____, KC_DEL,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_RAISE] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + _____, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_4, KC_5, KC_6, KC_QUOT, _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, KC_1, KC_2, KC_3, KC_RO, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, _____, _____, _____, _____, _____, _____, KC_0, KC_DOT, KC_COMM, KC_SLSH, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ), + + [_ADJUST] = LAYOUT_rs( \ + // Treadstone48 Rhymestone + //,--------------------------------------------------------------------------------------------------------------------. --------------------------------------------. + XXXXX, RESET, RGBRST, AG_NORM, AG_SWAP, XXXXX, XXXXX, KC_WH_L, KC_WH_U, KC_HOME, KC_PGUP, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+-----------------| --------+--------+--------+--------+--------| + XXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXX, XXXXX, KC_WH_R, KC_WH_D, KC_END, KC_PGDN, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXX, XXXXX, XXXXX, KC_BTN1, KC_BTN2, XXXXX, KC_MS_U, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|--------+--------+--------+--------+--------+--------|--------+--------+--------+--------+--------+--------+--------| --------+--------+--------+--------+--------| + _____, _____, _____, _____, XXXXX, XXXXX, _____, XXXXX, KC_MS_L, KC_MS_D, KC_MS_R, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //`--------------------------------------------------------------------------------------------------------------------' --------------------------------------------' + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. + ) +}; + +#define L_BASE _BASE +#define L_BASES (1<<_BASES) +#define L_LOWER (1<<_LOWER) +#define L_LOWRS (1<<_LOWRS) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +#ifdef SSD1306OLED +typedef struct { + uint8_t state; + char name[8]; +}LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 7 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {L_BASE, "Base"}, + {L_BASE + 1, "Base"}, + {L_BASES, "BaseSpl"}, + {L_LOWER, "Lower"}, + {L_LOWRS, "LowrSpl"}, + {L_RAISE, "Raise"}, + {L_ADJUST_TRI, "Adjust"} +}; + +static inline const char* get_leyer_status(void) { + + for (uint8_t i = 0; i < LAYER_DISPLAY_MAX; ++i) { + if (layer_state == 0 && layer_display_name[i].state == default_layer_state) { + + return layer_display_name[i].name; + } else if (layer_state != 0 && layer_display_name[i].state == layer_state) { + + return layer_display_name[i].name; + } + } + + return "?"; +} + +static char layer_status_buf[24] = "Layer state ready.\n"; +static inline void update_keymap_status(void) { + + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "OS:%s Layer:%s\n", + keymap_config.swap_lalt_lgui? "win" : "mac", get_leyer_status()); +} + +static inline void render_keymap_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, layer_status_buf); +} + +#define UPDATE_KEYMAP_STATUS() update_keymap_status() +#define RENDER_KEYMAP_STATUS(a) render_keymap_status(a) + +#else + +#define UPDATE_KEYMAP_STATUS() +#define RENDER_KEYMAP_STATUS(a) + +#endif + +void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + UPDATE_KEY_STATUS(keycode, record); + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case BASE: + if (record->event.pressed) { + default_layer_set(L_BASE); + } + break; + case BASES: + if (record->event.pressed) { + default_layer_set(L_BASES); + } + break; + case LOWRS: + update_change_layer(record->event.pressed, _LOWRS, _RAISE, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; + } + + UPDATE_KEYMAP_STATUS(); + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +static inline void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +static inline void render_status(struct CharacterMatrix *matrix) { + + UPDATE_LED_STATUS(); + RENDER_LED_STATUS(matrix); + RENDER_KEYMAP_STATUS(matrix); + UPDATE_LOCK_STATUS(); + RENDER_LOCK_STATUS(matrix); + RENDER_KEY_STATUS(matrix); +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif + + matrix_clear(&matrix); + if (is_master) { + render_status(&matrix); + } + + matrix_update(&display, &matrix); +} + +#endif diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/readme.md b/keyboards/treadstone48/keymaps/like_jis_rs/readme.md new file mode 100644 index 00000000000..796df6c4cd7 --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/readme.md @@ -0,0 +1,5 @@ +# The like jis type keyboard keymap for treadstone48 + +## Description + +## How to use diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md b/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md new file mode 100644 index 00000000000..5a6fc1d73b8 --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/readme_jp.md @@ -0,0 +1,84 @@ +# JISキーボードライクなキーマップ + +## 概要 + + デフォルトキーマップの記号類をJISライクな配置に揃えなおしたものです。 + オプションのRhymestone用のマップを使用するために拡張しています。RhymestoneのpromicroにもTreadstone48のキーマップを入れてください。 + Rhymestoneは基本的には左手側を使うことを想定していますが、右手側を使用する場合はrules.mkにあるRHYMESTONE_RIGHTHAND設定をyesにすれば使えるようになります。 + +```RHYMESTONE_RIGHTHAND=yes``` + +## キーマップの見かた + +qmk_firmware\tmk_core\common\keycode.h +に基本的なキーコードがあります。また、Keymap.cの上部にカスタムしたKC_で始まるものを登録しています。 +キーマップに書くときは「KC_」を省略して書いています。 +例:KC_A → A + +Leyer Tap、Mod Tap、Tap DanceというQMKの機能を使っています。 + +Layer Tapはタップで指定したキー、長押しで指定したレイヤーに移動します。 +例:LT(RAISE, KC_V) → タップでV、長押しでRAISEレイヤー移動 + +Mod Tapはタップで視程したキー、長押しで視程したレイヤーに移動します。 +例:LSFT_T(KC_Z) → タップでZ、長押しで左シフト + +Tap Danceは指定した二つのキーをシングルタップ、ダブルタップで切り替えられます。 +例:[TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT) → シングルタップでCOMM、ダブルタップでDOT + +もう少し詳しい内容についてはQMK Documentをお読みいただくかネットを検索すれば情報が載っていますので別途検索してみてください。 + +## 機能 + + QWERTYキーマップをベースにしていて、LowerレイヤーとRaiseレイヤーに他のキーを配置しています。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + DOTの横、SLROと書いてあるのはシングルタップで/記号、ダブルタップで\記号が入力出来るようになっています。 + Lの横、SCCLと書いてあるのはシングルタップで;記号、ダブルタップで:記号が入力出来るようになっています。 + マウスキーの割り当てがありますので、もし使用したい場合はrules.mkでMOUSEKEY_ENABLE = yesにしてmakeすると使用することができます。 + +## 48キー目について + + このキーボードはEnterキーの上の2Uキーを1Ux2個にして使用する事が出来るようになっています。 使用する場合はキーマップの書き換えが必要です。 + + 各レイヤーの最下段の + +```c + XXXXX \ + // ExtraKey: Split backspace key or it is below the enter key. +``` + + のXXXXXに任意のキーを入れることでPの右隣のキーとして動作するようになっています。その右隣りに従来のキーが配置されています。 + +## OS切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- KNRM: QMKのノーマル状態です。macだと正常に使える(はず)です +- KSWP: ノーマル状態のままWindowsで使用するとALTキーとGUI(win)キーが逆ですので、それを入れ換えます。Windowsユーザーはこちらのモードにしてください + +## NUMPADモードについて + + Lower + DLNPキーを一度押下するとNumpadモードになります。通常モードに戻す場合はDLBSキーを押下してください。 + +## IME切り替え方法 + + Winの場合、LowerレイヤーにKANJIキー(半角/全角 漢字)がありますので、Lower+KANJIで切り替えてください。 + +## ソフトウェアリセットについて + + キーボードにはハードウェアのリセットボタンが付いていますが、ソフトウェアリセットをかけられます。 + LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来、AdjustレイヤーのRSTを押下するとリセットがかかります。 + +## LEDの点灯切り替え方法 + + Adjustレイヤーにあります。LowerとRaiseを同時押しでAdjustレイヤーを使うことが出来ます。 + +- RGBRST: LEDのリセット +- RGB_TOG: LEDのON/OFF切り替え +- RGB_MOD: LEDの光り方の変更 +- RGB_HUI: Hue+ 色合いを変更 +- RGB_HUD: Hue- 色合いを変更 +- RGB_SAI: Saturation+ 色の濃さを変更 +- RGB_SAD: Saturation- 色の濃さを変更 +- RGB_VAI: Value+ 明るさを変更 +- RGB_VAD: Value- 明るさを変更 diff --git a/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk b/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk new file mode 100644 index 00000000000..c34bb2e34a0 --- /dev/null +++ b/keyboards/treadstone48/keymaps/like_jis_rs/rules.mk @@ -0,0 +1,67 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes + +# If your custom treadstone48 pcb, you can rewrite to yes. +OLED_ENABLE = no # OLED_ENABLE +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations + +# Other selectable option +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +LOCAL_GLCDFONT = no # use each keymaps "font.h" insted of "common/glcdfont.c" +RHYMESTONE_RIGHTHAND = no # If connect right hand side of the Rhymestone, set to yes. +ANGELINA_KEYMAP = no # If Alfa verstion use set to yes. + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + # OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +ifeq ($(strip $(RHYMESTONE_RIGHTHAND)), yes) + OPT_DEFS += -DRHYMESTONE_RIGHTHAND +endif + +ifeq ($(strip $(ANGELINA_KEYMAP)), yes) + OPT_DEFS += -DANGELINA_KEYMAP +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./common/oled_helper.c \ diff --git a/keyboards/treadstone48/pro_micro.h b/keyboards/treadstone48/pro_micro.h new file mode 100644 index 00000000000..f9e7ed75d9d --- /dev/null +++ b/keyboards/treadstone48/pro_micro.h @@ -0,0 +1,362 @@ +/* + pins_arduino.h - Pin definition functions for Arduino + Part of Arduino - http://www.arduino.cc/ + + Copyright (c) 2007 David A. Mellis + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ +*/ + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +// Workaround for wrong definitions in "iom32u4.h". +// This should be fixed in the AVR toolchain. +#undef UHCON +#undef UHINT +#undef UHIEN +#undef UHADDR +#undef UHFNUM +#undef UHFNUML +#undef UHFNUMH +#undef UHFLEN +#undef UPINRQX +#undef UPINTX +#undef UPNUM +#undef UPRST +#undef UPCONX +#undef UPCFG0X +#undef UPCFG1X +#undef UPSTAX +#undef UPCFG2X +#undef UPIENX +#undef UPDATX +#undef TCCR2A +#undef WGM20 +#undef WGM21 +#undef COM2B0 +#undef COM2B1 +#undef COM2A0 +#undef COM2A1 +#undef TCCR2B +#undef CS20 +#undef CS21 +#undef CS22 +#undef WGM22 +#undef FOC2B +#undef FOC2A +#undef TCNT2 +#undef TCNT2_0 +#undef TCNT2_1 +#undef TCNT2_2 +#undef TCNT2_3 +#undef TCNT2_4 +#undef TCNT2_5 +#undef TCNT2_6 +#undef TCNT2_7 +#undef OCR2A +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 +#undef OCR2B +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 + +#define NUM_DIGITAL_PINS 30 +#define NUM_ANALOG_INPUTS 12 + +#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) +#define TXLED0 PORTD |= (1<<5) +#define TXLED1 PORTD &= ~(1<<5) +#define RXLED0 PORTB |= (1<<0) +#define RXLED1 PORTB &= ~(1<<0) + +static const uint8_t SDA = 2; +static const uint8_t SCL = 3; +#define LED_BUILTIN 13 + +// Map SPI port to 'new' pins D14..D17 +static const uint8_t SS = 17; +static const uint8_t MOSI = 16; +static const uint8_t MISO = 14; +static const uint8_t SCK = 15; + +// Mapping of analog pins as digital I/O +// A6-A11 share with digital pins +static const uint8_t ADC0 = 18; +static const uint8_t ADC1 = 19; +static const uint8_t ADC2 = 20; +static const uint8_t ADC3 = 21; +static const uint8_t ADC4 = 22; +static const uint8_t ADC5 = 23; +static const uint8_t ADC6 = 24; // D4 +static const uint8_t ADC7 = 25; // D6 +static const uint8_t ADC8 = 26; // D8 +static const uint8_t ADC9 = 27; // D9 +static const uint8_t ADC10 = 28; // D10 +static const uint8_t ADC11 = 29; // D12 + +#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) +#define digitalPinToPCICRbit(p) 0 +#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) +#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) + +// __AVR_ATmega32U4__ has an unusual mapping of pins to channels +extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; +#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) ) + +#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT))))) + +#ifdef ARDUINO_MAIN + +// On the Arduino board, digital pins are also used +// for the analog output (software PWM). Analog input +// pins are a separate set. + +// ATMEL ATMEGA32U4 / ARDUINO LEONARDO +// +// D0 PD2 RXD1/INT2 +// D1 PD3 TXD1/INT3 +// D2 PD1 SDA SDA/INT1 +// D3# PD0 PWM8/SCL OC0B/SCL/INT0 +// D4 A6 PD4 ADC8 +// D5# PC6 ??? OC3A/#OC4A +// D6# A7 PD7 FastPWM #OC4D/ADC10 +// D7 PE6 INT6/AIN0 +// +// D8 A8 PB4 ADC11/PCINT4 +// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 +// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 +// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7 +// D12 A11 PD6 T1/#OC4D/ADC9 +// D13# PC7 PWM10 CLK0/OC4A +// +// A0 D18 PF7 ADC7 +// A1 D19 PF6 ADC6 +// A2 D20 PF5 ADC5 +// A3 D21 PF4 ADC4 +// A4 D22 PF1 ADC1 +// A5 D23 PF0 ADC0 +// +// New pins D14..D17 to map SPI port to digital pins +// +// MISO D14 PB3 MISO,PCINT3 +// SCK D15 PB1 SCK,PCINT1 +// MOSI D16 PB2 MOSI,PCINT2 +// SS D17 PB0 RXLED,SS/PCINT0 +// +// Connected LEDs on board for TX and RX +// TXLED D24 PD5 XCK1 +// RXLED D17 PB0 +// HWB PE2 HWB + +// these arrays map port names (e.g. port B) to the +// appropriate addresses for various functions (e.g. reading +// and writing) +const uint16_t PROGMEM port_to_mode_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &DDRB, + (uint16_t) &DDRC, + (uint16_t) &DDRD, + (uint16_t) &DDRE, + (uint16_t) &DDRF, +}; + +const uint16_t PROGMEM port_to_output_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PORTB, + (uint16_t) &PORTC, + (uint16_t) &PORTD, + (uint16_t) &PORTE, + (uint16_t) &PORTF, +}; + +const uint16_t PROGMEM port_to_input_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PINB, + (uint16_t) &PINC, + (uint16_t) &PIND, + (uint16_t) &PINE, + (uint16_t) &PINF, +}; + +const uint8_t PROGMEM digital_pin_to_port_PGM[] = { + PD, // D0 - PD2 + PD, // D1 - PD3 + PD, // D2 - PD1 + PD, // D3 - PD0 + PD, // D4 - PD4 + PC, // D5 - PC6 + PD, // D6 - PD7 + PE, // D7 - PE6 + + PB, // D8 - PB4 + PB, // D9 - PB5 + PB, // D10 - PB6 + PB, // D11 - PB7 + PD, // D12 - PD6 + PC, // D13 - PC7 + + PB, // D14 - MISO - PB3 + PB, // D15 - SCK - PB1 + PB, // D16 - MOSI - PB2 + PB, // D17 - SS - PB0 + + PF, // D18 - A0 - PF7 + PF, // D19 - A1 - PF6 + PF, // D20 - A2 - PF5 + PF, // D21 - A3 - PF4 + PF, // D22 - A4 - PF1 + PF, // D23 - A5 - PF0 + + PD, // D24 - PD5 + PD, // D25 / D6 - A7 - PD7 + PB, // D26 / D8 - A8 - PB4 + PB, // D27 / D9 - A9 - PB5 + PB, // D28 / D10 - A10 - PB6 + PD, // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { + _BV(2), // D0 - PD2 + _BV(3), // D1 - PD3 + _BV(1), // D2 - PD1 + _BV(0), // D3 - PD0 + _BV(4), // D4 - PD4 + _BV(6), // D5 - PC6 + _BV(7), // D6 - PD7 + _BV(6), // D7 - PE6 + + _BV(4), // D8 - PB4 + _BV(5), // D9 - PB5 + _BV(6), // D10 - PB6 + _BV(7), // D11 - PB7 + _BV(6), // D12 - PD6 + _BV(7), // D13 - PC7 + + _BV(3), // D14 - MISO - PB3 + _BV(1), // D15 - SCK - PB1 + _BV(2), // D16 - MOSI - PB2 + _BV(0), // D17 - SS - PB0 + + _BV(7), // D18 - A0 - PF7 + _BV(6), // D19 - A1 - PF6 + _BV(5), // D20 - A2 - PF5 + _BV(4), // D21 - A3 - PF4 + _BV(1), // D22 - A4 - PF1 + _BV(0), // D23 - A5 - PF0 + + _BV(5), // D24 - PD5 + _BV(7), // D25 / D6 - A7 - PD7 + _BV(4), // D26 / D8 - A8 - PB4 + _BV(5), // D27 / D9 - A9 - PB5 + _BV(6), // D28 / D10 - A10 - PB6 + _BV(6), // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + TIMER0B, /* 3 */ + NOT_ON_TIMER, + TIMER3A, /* 5 */ + TIMER4D, /* 6 */ + NOT_ON_TIMER, + + NOT_ON_TIMER, + TIMER1A, /* 9 */ + TIMER1B, /* 10 */ + TIMER0A, /* 11 */ + + NOT_ON_TIMER, + TIMER4A, /* 13 */ + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, +}; + +const uint8_t PROGMEM analog_pin_to_channel_PGM[] = { + 7, // A0 PF7 ADC7 + 6, // A1 PF6 ADC6 + 5, // A2 PF5 ADC5 + 4, // A3 PF4 ADC4 + 1, // A4 PF1 ADC1 + 0, // A5 PF0 ADC0 + 8, // A6 D4 PD4 ADC8 + 10, // A7 D6 PD7 ADC10 + 11, // A8 D8 PB4 ADC11 + 12, // A9 D9 PB5 ADC12 + 13, // A10 D10 PB6 ADC13 + 9 // A11 D12 PD6 ADC9 +}; + +#endif /* ARDUINO_MAIN */ + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_USBVIRTUAL Serial +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* Pins_Arduino_h */ diff --git a/keyboards/treadstone48/readme.md b/keyboards/treadstone48/readme.md new file mode 100644 index 00000000000..eef39c39b33 --- /dev/null +++ b/keyboards/treadstone48/readme.md @@ -0,0 +1,18 @@ +# treadstone48 + +![treadstone48](https://github.com/marksard/Keyboards/raw/master/_image/20181219-PC190003.jpg) + +A 47 (or 48) keys Symmetric Staggered keyboard. + +Keyboard Maintainer: [marksard](https://github.com/marksard) +Hardware Supported: The PCBs, controllers supported +Hardware Availability: links to where you can find this hardware + +Make example for this keyboard (after setting up your build environment): + + make treadstone48:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +[Build guide](https://github.com/marksard/Keyboards/blob/master/treadstpne48/documents/treadstone48_buildguide.md) +[Firmware](https://github.com/marksard/qmk_firmware/tree/my_customize/keyboards/treadstone48) diff --git a/keyboards/treadstone48/rev1/config.h b/keyboards/treadstone48/rev1/config.h new file mode 100644 index 00000000000..09fb6215456 --- /dev/null +++ b/keyboards/treadstone48/rev1/config.h @@ -0,0 +1,128 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xDFA3 +#define DEVICE_VER 0x0010 +#define MANUFACTURER marksard +#define PRODUCT treadstone48 +#define DESCRIPTION Symmetrical staggered 47+1 Keys Keyboard + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 150 + +/* Use I2C or Serial */ +#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// OLED support +// see ./rules.mk: OLED_ENABLE=yes or no +#ifdef OLED_ENABLE + #define SSD1306OLED +#endif + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 16 +#define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } + +// wiring of each half +#define MATRIX_COLS 6 +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +//#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +// treadstone48 keyboard RGB LED support +//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no +// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes +#define RGBLED_NUM 12 + +#ifndef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 180 + #define RGBLIGHT_VAL_STEP 17 +#else + #define RGBLIGHT_LIMIT_VAL 50 + #define RGBLIGHT_VAL_STEP 4 +#endif +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for treadstone48 keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + + +#endif diff --git a/keyboards/treadstone48/rev1/info.json b/keyboards/treadstone48/rev1/info.json new file mode 100644 index 00000000000..df9e7591b50 --- /dev/null +++ b/keyboards/treadstone48/rev1/info.json @@ -0,0 +1,261 @@ +{ + "keyboard_name": "Treadstone48", + "url": "https://github.com/marksard/Keyboards", + "maintainer": "marksard", + "width": 14.75, + "height": 4, + "layouts": { + "LAYOUT_base": { + "layout": [ + { + "label": "Esc", + "x": 1, + "y": 0 + }, + { + "label": "Q", + "x": 2.25, + "y": 0 + }, + { + "label": "W", + "x": 3.25, + "y": 0 + }, + { + "label": "E", + "x": 4.25, + "y": 0 + }, + { + "label": "R", + "x": 5.25, + "y": 0 + }, + { + "label": "T", + "x": 6.25, + "y": 0 + }, + { + "label": "Y", + "x": 7.75, + "y": 0 + }, + { + "label": "U", + "x": 8.75, + "y": 0 + }, + { + "label": "I", + "x": 9.75, + "y": 0 + }, + { + "label": "O", + "x": 10.75, + "y": 0 + }, + { + "label": "P", + "x": 11.75, + "y": 0 + }, + { + "label": "-", + "x": 13.75, + "y": 0 + }, + { + "label": "Tab", + "x": 1, + "y": 1, + "w": 1.5 + }, + { + "label": "A", + "x": 2.5, + "y": 1 + }, + { + "label": "S", + "x": 3.5, + "y": 1 + }, + { + "label": "D", + "x": 4.5, + "y": 1 + }, + { + "label": "F", + "x": 5.5, + "y": 1 + }, + { + "label": "G", + "x": 6.5, + "y": 1 + }, + { + "label": "H", + "x": 7.5, + "y": 1 + }, + { + "label": "J", + "x": 8.5, + "y": 1 + }, + { + "label": "K", + "x": 9.5, + "y": 1 + }, + { + "label": "L", + "x": 10.5, + "y": 1 + }, + { + "label": ":", + "x": 11.5, + "y": 1 + }, + { + "label": "Enter", + "x": 12.5, + "y": 1, + "w": 2.25 + }, + { + "label": "Shift", + "x": 0, + "y": 2, + "w": 2.25 + }, + { + "label": "Z", + "x": 2.25, + "y": 2 + }, + { + "label": "X", + "x": 3.25, + "y": 2 + }, + { + "label": "C", + "x": 4.25, + "y": 2 + }, + { + "label": "V", + "x": 5.25, + "y": 2 + }, + { + "label": "B", + "x": 6.25, + "y": 2 + }, + { + "label": "N", + "x": 7.75, + "y": 2 + }, + { + "label": "M", + "x": 8.75, + "y": 2 + }, + { + "label": "<", + "x": 9.75, + "y": 2 + }, + { + "label": ">", + "x": 10.75, + "y": 2 + }, + { + "label": "?", + "x": 11.75, + "y": 2 + }, + { + "label": "\u2191", + "x": 12.75, + "y": 2 + }, + { + "label": "Ctrl", + "x": 0.75, + "y": 3, + "w": 1.25 + }, + { + "label": "Win", + "x": 2, + "y": 3, + "w": 1.25 + }, + { + "label": "Alt", + "x": 3.25, + "y": 3, + "w": 1.25 + }, + { + "label": "Lower", + "x": 4.5, + "y": 3 + }, + { + "label": "BackSpace", + "x": 5.5, + "y": 3, + "w": 2 + }, + { + "x": 7.5, + "y": 3, + "w": 2 + }, + { + "label": "Raise", + "x": 9.5, + "y": 3 + }, + { + "label": "Menu", + "x": 10.5, + "y": 3, + "w": 1.25 + }, + { + "label": "\u2190", + "x": 11.75, + "y": 3 + }, + { + "label": "\u2193", + "x": 12.75, + "y": 3 + }, + { + "label": "\u2192", + "x": 13.75, + "y": 3 + }, + { + "label": "_", + "x": 12.75, + "y": 0 + } + ] + } + } +} diff --git a/keyboards/treadstone48/rev1/matrix.c b/keyboards/treadstone48/rev1/matrix.c new file mode 100644 index 00000000000..8685a8125e4 --- /dev/null +++ b/keyboards/treadstone48/rev1/matrix.c @@ -0,0 +1,357 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "split_scomm.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + TXLED0; + RXLED0; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(int master_changed) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else + int ret=serial_update_buffers(); +#endif + if (ret ) { + if(ret==2) RXLED1; + return 1; + } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, sizeof(serial_master_buffer)); + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + int mchanged = 1; + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction(mchanged) ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif + for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif + serial_slave_buffer[i] = matrix[offset+i]; + } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/treadstone48/rev1/rev1.c b/keyboards/treadstone48/rev1/rev1.c new file mode 100644 index 00000000000..2637864271a --- /dev/null +++ b/keyboards/treadstone48/rev1/rev1.c @@ -0,0 +1,15 @@ +#include "treadstone48.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + matrix_init_user(); +}; + diff --git a/keyboards/treadstone48/rev1/rev1.h b/keyboards/treadstone48/rev1/rev1.h new file mode 100644 index 00000000000..c6145398dd8 --- /dev/null +++ b/keyboards/treadstone48/rev1/rev1.h @@ -0,0 +1,202 @@ +#ifndef REV1_H +#define REV1_CONFIG_H + +#include "../treadstone48.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +// full Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R00, R01, R02, R03, R04, R05, R40, R41, R42, R43, R44, R45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R10, R11, R12, R13, R14, R15, R50, R51, R52, R53, R54, R55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R20, R21, R22, R23, R24, R25, R60, R61, R62, R63, R64, R65, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, R30, R31, R32, R33, R34, R35, R70, R71, R72, R73, R74, R75 \ + ) \ + { \ + { L45, L44, L43, L42, L41, L40 }, \ + { L55, L54, L53, L52, L51, L50 }, \ + { L65, L64, L63, L62, L61, L60 }, \ + { L75, L74, L73, L72, L71, L70 }, \ + { L05, L04, L03, L02, L01, L00 }, \ + { L15, L14, L13, L12, L11, L10 }, \ + { L25, L24, L23, L22, L21, L20 }, \ + { L35, L34, L33, L32, L31, L30 }, \ + { R45, R44, R43, R42, R41, R40 }, \ + { R55, R54, R53, R52, R51, R50 }, \ + { R65, R64, R63, R62, R61, R60 }, \ + { R75, R74, R73, R72, R71, R70 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + } + +#define K_N KC_NO + +////////////////////////////////////////////////////////////////////////////// +// When only use Treadstone48. +// L75 is ExtraKey +////////////////////////////////////////////////////////////////////////////// +#define LAYOUT_base( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N \ + ) + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_base_kc( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75 \ + ) \ + LAYOUT_base( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L60, KC_##L61, KC_##L62, KC_##L63, KC_##L64, KC_##L65, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L70, KC_##L71, KC_##L72, KC_##L73, KC_##L74, KC_##L75 \ + ) +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// When connecting Rhymestone to Treadstone48. +// L75 is ExtraKey +////////////////////////////////////////////////////////////////////////////// +#define LAYOUT_rs( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, R70, R71, R72, R73, R74, L75 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R44, R43, R42, R41, R40, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R54, R53, R52, R51, R50, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R64, R63, R62, R61, R60, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R74, R73, R72, R71, R70 \ + ) + +// When use right hand side of the Rhymestone. +#ifdef RHYMESTONE_RIGHTHAND +#undef LAYOUT_rs +#define LAYOUT_rs( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, R70, R71, R72, R73, R74, L75 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R70, R71, R72, R73, R74 \ + ) +#endif + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_rs_kc( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, R70, R71, R72, R73, R74 \ + ) \ + LAYOUT_rs( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, KC_##R50, KC_##R51, KC_##R52, KC_##R53, KC_##R54, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L60, KC_##L61, KC_##L62, KC_##L63, KC_##L64, KC_##L65, KC_##R60, KC_##R61, KC_##R62, KC_##R63, KC_##R64, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L70, KC_##L71, KC_##L72, KC_##L73, KC_##L74, KC_##L75, KC_##R70, KC_##R71, KC_##R72, KC_##R73, KC_##R74 \ + ) +////////////////////////////////////////////////////////////////////////////// + + + +////////////////////////////////////////////////////////////////////////////// +// Alpha version keymap. +// L30 is ExtraKey +////////////////////////////////////////////////////////////////////////////// +#ifdef ANGELINA_KEYMAP +#undef LAYOUT_base +#undef LAYOUT_base_kc +#undef LAYOUT_rs +#undef LAYOUT_rs_kc + +#define LAYOUT_base( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, \ + L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, L30 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N, K_N \ + ) + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_base_kc( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75 \ + ) \ + LAYOUT_base( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L60, KC_##L61, KC_##L62, KC_##L63, KC_##L64, KC_##L65, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L70, KC_##L71, KC_##L72, KC_##L73, KC_##L74, KC_##L75 \ + ) + +#define LAYOUT_rs( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, R70, R71, R72, R73, R74, L30 \ + ) \ + LAYOUT_full( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R44, R43, R42, R41, R40, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R54, R53, R52, R51, R50, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R64, R63, R62, R61, R60, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, K_N, K_N, K_N, K_N, K_N, K_N, K_N, R74, R73, R72, R71, R70 \ + ) + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_rs_kc( \ + L00, L01, L02, L03, L04, L05, L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, \ + L10, L11, L12, L13, L14, L15, L50, L51, L52, L53, L54, L55, R50, R51, R52, R53, R54, \ + L20, L21, L22, L23, L24, L25, L60, L61, L62, L63, L64, L65, R60, R61, R62, R63, R64, \ + L30, L31, L32, L33, L34, L35, L70, L71, L72, L73, L74, L75, R70, R71, R72, R73, R74 \ + ) \ + LAYOUT_rs( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, KC_##R50, KC_##R51, KC_##R52, KC_##R53, KC_##R54, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L60, KC_##L61, KC_##L62, KC_##L63, KC_##L64, KC_##L65, KC_##R60, KC_##R61, KC_##R62, KC_##R63, KC_##R64, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L70, KC_##L71, KC_##L72, KC_##L73, KC_##L74, KC_##L75, KC_##R70, KC_##R71, KC_##R72, KC_##R73, KC_##R74 \ + ) + +#endif +////////////////////////////////////////////////////////////////////////////// + +#endif diff --git a/keyboards/treadstone48/rev1/rules.mk b/keyboards/treadstone48/rev1/rules.mk new file mode 100644 index 00000000000..6028b5a5b95 --- /dev/null +++ b/keyboards/treadstone48/rev1/rules.mk @@ -0,0 +1,3 @@ +SRC += rev1/matrix.c +SRC += rev1/split_util.c +SRC += rev1/split_scomm.c diff --git a/keyboards/treadstone48/rev1/serial_config.h b/keyboards/treadstone48/rev1/serial_config.h new file mode 100644 index 00000000000..37135213d55 --- /dev/null +++ b/keyboards/treadstone48/rev1/serial_config.h @@ -0,0 +1,8 @@ +//// #error rev2 serial config + +#ifndef SOFT_SERIAL_PIN +/* Soft Serial defines */ +#define SOFT_SERIAL_PIN D2 + +#define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/treadstone48/rev1/serial_config_simpleapi.h b/keyboards/treadstone48/rev1/serial_config_simpleapi.h new file mode 100644 index 00000000000..e2d22a41e7b --- /dev/null +++ b/keyboards/treadstone48/rev1/serial_config_simpleapi.h @@ -0,0 +1,8 @@ +#ifndef SERIAL_CONFIG_SIMPLEAPI_H +#define SERIAL_CONFIG_SIMPLEAPI_H + +#undef SERIAL_USE_MULTI_TRANSACTION +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +#endif // SERIAL_CONFIG_SIMPLEAPI_H diff --git a/keyboards/treadstone48/rev1/split_scomm.c b/keyboards/treadstone48/rev1/split_scomm.c new file mode 100644 index 00000000000..ada7867960b --- /dev/null +++ b/keyboards/treadstone48/rev1/split_scomm.c @@ -0,0 +1,92 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include +#include +#include +#include +#include "serial.h" +#ifdef CONSOLE_ENABLE + #include +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status, smatstatus; + static int need_retry = 0; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3], + serial_slave_buffer[4] ); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; + } + return smatstatus; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/treadstone48/rev1/split_scomm.h b/keyboards/treadstone48/rev1/split_scomm.h new file mode 100644 index 00000000000..16887eb74f7 --- /dev/null +++ b/keyboards/treadstone48/rev1/split_scomm.h @@ -0,0 +1,21 @@ +#pragma once + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif diff --git a/keyboards/treadstone48/rev1/split_util.c b/keyboards/treadstone48/rev1/split_util.c new file mode 100644 index 00000000000..e1ff8b4379d --- /dev/null +++ b/keyboards/treadstone48/rev1/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "split_scomm.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); diff --git a/keyboards/treadstone48/rules.mk b/keyboards/treadstone48/rules.mk new file mode 100644 index 00000000000..8b0d3cd30a8 --- /dev/null +++ b/keyboards/treadstone48/rules.mk @@ -0,0 +1,72 @@ +SRC += i2c.c +SRC += serial.c +SRC += ssd1306.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SUBPROJECT_rev1 = no +USE_I2C = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = treadstone48/rev1 diff --git a/keyboards/treadstone48/serial.c b/keyboards/treadstone48/serial.c new file mode 100644 index 00000000000..6006ebf1bdb --- /dev/null +++ b/keyboards/treadstone48/serial.c @@ -0,0 +1,590 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include +#include "serial.h" +//#include + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ + int result; + result = soft_serial_transaction(); + return result; +} + +#endif // end of OLD API (compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static void serial_delay(void) ALWAYS_INLINE; +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; + } + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/treadstone48/serial.h b/keyboards/treadstone48/serial.h new file mode 100644 index 00000000000..5deaf789e30 --- /dev/null +++ b/keyboards/treadstone48/serial.h @@ -0,0 +1,86 @@ +#pragma once + +#include + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE OLD API (compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE NEW API +// //// USE simple API (using signle-type transaction function) +// #define SERIAL_USE_SINGLE_TRANSACTION +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + + +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + #endif + + void serial_master_init(void); + void serial_slave_init(void); + int serial_update_buffers(void); + +#endif // end of USE OLD API +//////////////////////////////////////////////////////////////////////////// + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif diff --git a/keyboards/treadstone48/ssd1306.c b/keyboards/treadstone48/ssd1306.c new file mode 100644 index 00000000000..dd3290ba0cc --- /dev/null +++ b/keyboards/treadstone48/ssd1306.c @@ -0,0 +1,342 @@ + +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include +#include "print.h" +#ifndef LOCAL_GLCDFONT +#include "common/glcdfont.c" +#else +#include +#endif +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +static bool force_dirty = true; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + i2c_master_init(); + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty|| force_dirty) { + iota_gfx_flush(); + force_dirty = false; + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + +#endif diff --git a/keyboards/treadstone48/ssd1306.h b/keyboards/treadstone48/ssd1306.h new file mode 100644 index 00000000000..49f258efa92 --- /dev/null +++ b/keyboards/treadstone48/ssd1306.h @@ -0,0 +1,90 @@ +#pragma once + +#include +#include +#include "pincontrol.h" +#include "action.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/treadstone48/treadstone48.c b/keyboards/treadstone48/treadstone48.c new file mode 100644 index 00000000000..faadb269065 --- /dev/null +++ b/keyboards/treadstone48/treadstone48.c @@ -0,0 +1 @@ +#include "treadstone48.h" diff --git a/keyboards/treadstone48/treadstone48.h b/keyboards/treadstone48/treadstone48.h new file mode 100644 index 00000000000..3123d1de531 --- /dev/null +++ b/keyboards/treadstone48/treadstone48.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef KEYBOARD_treadstone48_rev1 + #include "rev1.h" +#endif + +#include "quantum.h" + +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif diff --git a/keyboards/treasure/type9/config.h b/keyboards/treasure/type9/config.h index 367c53cb978..220b7f78006 100644 --- a/keyboards/treasure/type9/config.h +++ b/keyboards/treasure/type9/config.h @@ -45,7 +45,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D1, D0, D4 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL #define BACKLIGHT_PIN B5 @@ -62,7 +62,7 @@ along with this program. If not, see . // #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -112,11 +112,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -221,4 +216,3 @@ along with this program. If not, see . #define LCD_E_PIN 1 //< pin for Enable line #endif */ - diff --git a/keyboards/treasure/type9/rules.mk b/keyboards/treasure/type9/rules.mk index 599974d25a2..af90959e1ff 100644 --- a/keyboards/treasure/type9/rules.mk +++ b/keyboards/treasure/type9/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/tv44/keymaps/talljoe-minivan/config.h b/keyboards/tv44/keymaps/talljoe-minivan/config.h deleted file mode 100644 index fa1f43adce1..00000000000 --- a/keyboards/tv44/keymaps/talljoe-minivan/config.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H - -#define SPACE_COUNT 2 - -#define TEMPLATE( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) KEYMAP_ARROW( \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K0D, \ - K41, K49, K42, K44, K45, K3C, K0B, K00, K3D \ -) - -#define TEMPLATE_ALT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) KEYMAP_ARROW( \ - K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K41, K49, K42, K44, K45, K48, K49, K4B, K4C \ -) - -#define TEMPLATE_ADJUST( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) KEYMAP_ARROW( \ - K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K2D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K49, K42, K44, K45, K48, K0B, K0C, K4C \ -) - -#define TEMPLATE_RESET KEYMAP_ARROW( \ - RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET) - -#endif diff --git a/keyboards/uk78/config.h b/keyboards/uk78/config.h index 34d67207929..879360773fa 100644 --- a/keyboards/uk78/config.h +++ b/keyboards/uk78/config.h @@ -47,7 +47,7 @@ along with this program. If not, see . #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -55,11 +55,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812b options */ #define RGB_DI_PIN F6 #ifdef RGB_DI_PIN diff --git a/keyboards/uk78/readme.md b/keyboards/uk78/readme.md index 8a1ba5e8a3c..6592e38ec99 100644 --- a/keyboards/uk78/readme.md +++ b/keyboards/uk78/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make uk78:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/unikorn/config.h b/keyboards/unikorn/config.h new file mode 100644 index 00000000000..a871c0e276f --- /dev/null +++ b/keyboards/unikorn/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define MANUFACTURER Singa and TGR +#define PRODUCT Unikorn 60 + +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +// 0 1 2 3 4 5 6 7 8 9 A B C D E +#define MATRIX_ROW_PINS { B1, B2, B3, B4, B5 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCE 5 + +#define BACKLIGHT_LEVELS 1 +#ifdef RGBLIGHT_ENABLE +#define RGBLED_NUM 17 +#define RGBLIGHT_ANIMATIONS +#endif diff --git a/keyboards/unikorn/info.json b/keyboards/unikorn/info.json new file mode 100644 index 00000000000..71088d20479 --- /dev/null +++ b/keyboards/unikorn/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "Unikorn 60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2}, {"x":13.75, "y":2, "w":1.25}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_tsangan_hhkb": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.5}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}, {"x":13.5, "y":4, "w":1.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/unikorn/keymaps/default/keymap.c b/keyboards/unikorn/keymaps/default/keymap.c new file mode 100644 index 00000000000..3e730362538 --- /dev/null +++ b/keyboards/unikorn/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_60_ansi( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL + ), + + [1] = LAYOUT_60_ansi( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/unikorn/keymaps/tsangan/keymap.c b/keyboards/unikorn/keymaps/tsangan/keymap.c new file mode 100644 index 00000000000..4c86d4f02e9 --- /dev/null +++ b/keyboards/unikorn/keymaps/tsangan/keymap.c @@ -0,0 +1,35 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_tsangan_hhkb( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + + [1] = LAYOUT_60_tsangan_hhkb( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/unikorn/readme.md b/keyboards/unikorn/readme.md new file mode 100644 index 00000000000..3175cddc2de --- /dev/null +++ b/keyboards/unikorn/readme.md @@ -0,0 +1,61 @@ +# Unikorn 60 + +60% PCB made for the TGR x SINGA Unikorn60. + + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Unikorn 60 PCB +Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=98350.0) + + +Make example for this keyboard (after setting up your build environment): + + make unikorn:default + +This PCB can support RGB underglow. There are pads on the bottom of the PCB for the LED controller chip and for 17 RGB underglow LEDs. The Unikorn 60 case does not have acrylic pieces to properly display underglow effects. + +To enable RGB lighting support, install the necessary components and set RGBLIGHT features in `rules.mk` like so: + +``` +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes +``` + + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +**Reset Key:** Short the two holes labeled `FW_JP` underneath the PCB, beside the Tab key while plugging in the keyboard. + +Do not confuse this with the LED holes of the switch in the `Tab` position. `FW_JP` is not reachable from the top as the plate blocks access to it. + +It is recommended to program a `RESET` key in your keymap. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/unikorn/rules.mk b/keyboards/unikorn/rules.mk new file mode 100644 index 00000000000..7d6fa14e1ed --- /dev/null +++ b/keyboards/unikorn/rules.mk @@ -0,0 +1,48 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = no +RGBLIGHT_CUSTOM_DRIVER = no + +OPT_DEFS = -DDEBUG_LEVEL=0 + +SRC = i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/unikorn/unikorn.c b/keyboards/unikorn/unikorn.c new file mode 100644 index 00000000000..1bd47ef9e1a --- /dev/null +++ b/keyboards/unikorn/unikorn.c @@ -0,0 +1,89 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "i2c_master.h" +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +void matrix_init_kb(void) { +#ifdef RGBLIGHT_ENABLE + if (rgblight_config.enable) { + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + } +#endif + // call user level keymaps, if any + matrix_init_user(); +} + +void matrix_scan_kb(void) { +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif + matrix_scan_user(); + /* Nothing else for now. */ +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // turn backlight LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} diff --git a/keyboards/unikorn/unikorn.h b/keyboards/unikorn/unikorn.h new file mode 100644 index 00000000000..2666bf066ec --- /dev/null +++ b/keyboards/unikorn/unikorn.h @@ -0,0 +1,66 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_all( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \ + k40, k41, k42, k44, k45, k47, k48, k49, k4B, k4D \ +){ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \ + { k40, k41, k42, KC_NO, k44, k45, KC_NO, k47, k48, k49, KC_NO, k4B, KC_NO, k4D, KC_NO }, \ +} + + +#define LAYOUT_60_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, \ + k40, k41, k42, k45, k48, k49, k4B, k4D \ +){ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, KC_NO, KC_NO }, \ + { k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, k48, k49, KC_NO, k4B, KC_NO, k4D, KC_NO }, \ +} + +#define LAYOUT_60_tsangan_hhkb( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \ + k40, k41, k42, k45, k48, k49, k4A \ +){ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \ + { k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, k48, k49, k4A, KC_NO, KC_NO, KC_NO, KC_NO }, \ +} + diff --git a/keyboards/unikorn/usbconfig.h b/keyboards/unikorn/usbconfig.h new file mode 100644 index 00000000000..41ce167a872 --- /dev/null +++ b/keyboards/unikorn/usbconfig.h @@ -0,0 +1,393 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 's', 'i', 'n', 'g', 'a', 't', 'g', 'r' +#define USB_CFG_VENDOR_NAME_LEN 8 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'u', 'n', 'i', 'k', 'o', 'r', 'n' +#define USB_CFG_DEVICE_NAME_LEN 7 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect diff --git a/keyboards/ut47/config.h b/keyboards/ut47/config.h deleted file mode 100644 index 4335e3edd50..00000000000 --- a/keyboards/ut47/config.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2018 Carlos Filoteo - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER 40percent.club -#define PRODUCT ut47 -#define DESCRIPTION An awesome 40% keyboard - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 12 - -#define MATRIX_ROW_PINS { D1, D0, D4, C6 } -#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Enable GNAP matrix serial output */ -#define GNAP_ENABLE - -/* USART configuration */ -#ifdef __AVR_ATmega32U4__ -# define SERIAL_UART_BAUD 9600 -# define SERIAL_UART_DATA UDR1 -# define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) -# define SERIAL_UART_RXD_VECT USART1_RX_vect -# define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) -# define SERIAL_UART_INIT() do { \ - /* baud rate */ \ - UBRR1L = SERIAL_UART_UBRR; \ - /* baud rate */ \ - UBRR1H = SERIAL_UART_UBRR >> 8; \ - /* enable TX */ \ - UCSR1B = _BV(TXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ - sei(); \ - } while(0) -# else -# error "USART configuration is needed." -#endif - -#endif diff --git a/keyboards/ut47/keymaps/default/config.h b/keyboards/ut47/keymaps/default/config.h deleted file mode 100644 index 46098a22fb2..00000000000 --- a/keyboards/ut47/keymaps/default/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif diff --git a/keyboards/ut47/keymaps/default/keymap.c b/keyboards/ut47/keymaps/default/keymap.c deleted file mode 100644 index 6b6bb025b19..00000000000 --- a/keyboards/ut47/keymaps/default/keymap.c +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#ifdef LED_ENABLE - #include "protocol/serial.h" -#endif - -#define _______ KC_TRNS -#define LT3_TAB LT(3, KC_TAB) -#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) - -enum custom_keycodes { - LED_TOG = SAFE_RANGE, - LED_CHG -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Base Layer - * ,-------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | - * |-------------------------------------------------------------------------+ - * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | - * |-------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| - * |-------------------------------------------------------------------------+ - * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, - KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - - /* FN Layer 1 - * ,-------------------------------------------------------------------------. - * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | | - | = | [ | ] | \ | - * |-------------------------------------------------------------------------+ - * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | Home| PgDn| PgUp| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Right */ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | | _ | + | { | } | | | - * |-------------------------------------------------------------------------+ - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | Home| PgDn| PgUp| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Left */ - KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | - * |-------------------------------------------------------------------------+ - * | | | | | | | | | | | | | - * |-------------------------------------------------------------------------+ - * | |LEDtg|LEDch| | | | | | | | | | - * |-------------------------------------------------------------------------+ - * | | | | | | | |MousL|MousD|MousU|MousR| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Tab */ - KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, LED_TOG, LED_CHG, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R -), -}; - -//LED keymap functions - #ifdef LED_ENABLE -void led_chmode(void) { - serial_send(101); -} - -void led_toggle(void) { - serial_send(100); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case LED_TOG: - #ifdef LED_ENABLE - led_toggle(); - #endif - return false; - case LED_CHG: - #ifdef LED_ENABLE - led_chmode(); - #endif - return false; - } - } - return true; -}; -#endif diff --git a/keyboards/ut47/keymaps/non-us/config.h b/keyboards/ut47/keymaps/non-us/config.h deleted file mode 100644 index 46098a22fb2..00000000000 --- a/keyboards/ut47/keymaps/non-us/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif diff --git a/keyboards/ut47/keymaps/non-us/keymap.c b/keyboards/ut47/keymaps/non-us/keymap.c deleted file mode 100644 index 1cb537b7d00..00000000000 --- a/keyboards/ut47/keymaps/non-us/keymap.c +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#ifdef LED_ENABLE - #include "protocol/serial.h" -#endif - -#define _______ KC_TRNS -#define LT3_TAB LT(3, KC_TAB) -#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) - -enum custom_keycodes { - LED_TOG = SAFE_RANGE, - LED_CHG -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Base Layer - * ,-------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | - * |-------------------------------------------------------------------------+ - * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | - * |-------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| - * |-------------------------------------------------------------------------+ - * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, - KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - - /* FN Layer 1 - * ,-------------------------------------------------------------------------. - * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | # | - | = | [ | ] | \ | - * |-------------------------------------------------------------------------+ - * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | Home| PgDn| PgUp| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Right */ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, - _______, _______, _______, _______, _______, _______, KC_NUHS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_NUBS, - _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | | _ | + | { | } | | | - * |-------------------------------------------------------------------------+ - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | Home| PgDn| PgUp| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Left */ - KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | - * |-------------------------------------------------------------------------+ - * | | | | | | | | | | | | | - * |-------------------------------------------------------------------------+ - * | |LEDtg|LEDch| | | | | | | | | | - * |-------------------------------------------------------------------------+ - * | | | | | | | |MousL|MousD|MousU|MousR| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Tab */ - KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, LED_TOG, LED_CHG, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R -), -}; - -//LED keymap functions - #ifdef LED_ENABLE -void led_chmode(void) { - serial_send(101); -} - -void led_toggle(void) { - serial_send(100); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case LED_TOG: - #ifdef LED_ENABLE - led_toggle(); - #endif - return false; - case LED_CHG: - #ifdef LED_ENABLE - led_chmode(); - #endif - return false; - } - } - return true; -}; -#endif diff --git a/keyboards/ut47/keymaps/nordic/keymap.c b/keyboards/ut47/keymaps/nordic/keymap.c deleted file mode 100644 index cc3f43650ee..00000000000 --- a/keyboards/ut47/keymaps/nordic/keymap.c +++ /dev/null @@ -1,179 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#ifdef LED_ENABLE - #include "protocol/serial.h" - -#endif - -#include "keymap_norwegian.h" - -#define _______ KC_TRNS -#define LT3_TAB LT(3, KC_TAB) -#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) -#define CTRADEL LALT(LCTL(KC_DEL)) -#define ALTTAB LALT(KC_TAB) - -enum custom_keycodes { - LED_TOG = SAFE_RANGE, - LED_CHG -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Base Layer - L0 - * ,-------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | - * |-------------------------------------------------------------------------+ - * |Tab/L3| A | S | D | F | G | H | J | K | L | ' |Ent/RS| - * |-------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | Up | L4 | - * |-------------------------------------------------------------------------+ - * | Ctrl| Gui | L4 | Alt | L2 | Space | L1 | Ctrl| Left| Down|Right| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Base - L0 */ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_APOS, MT_RSFT_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, MO(4), - KC_LCTL, KC_LGUI, MO(4), KC_LALT, MO(2), KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT -), - - /* FN Layer 1 - * ,-------------------------------------------------------------------------. - * | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | | | + | = | * | / | - * |-------------------------------------------------------------------------+ - * | | | | | | | | | - | _ | PgUp| | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | | Home| PgDn| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Right modifier - L1 */ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, _______, NO_PLUS, NO_EQL, NO_ASTR, NO_SLSH, - _______, _______, _______, _______, _______, _______, _______, _______, NO_MINS, NO_UNDS, KC_PGUP, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | § | ! | " | # | ¤ | % | & | / | = | + | \ | Delete| - * |-------------------------------------------------------------------------+ - * | | | ? | { | [ | ( | ) | ] | } | F10 | F11 | F12 | - * |-------------------------------------------------------------------------+ - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | PgUp| | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | | Home| PgDn| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Left modifier - L2 */ - NO_SECT, KC_EXCLAIM, NO_QUO2, KC_HASH, NO_BULT, KC_PERCENT, NO_AMPR, NO_SLSH, NO_EQL, NO_PLUS, NO_BSLS, KC_DELETE, - _______, _______, NO_QUES, NO_LCBR, NO_LBRC, NO_LPRN, NO_RPRN, NO_RBRC, NO_RCBR, KC_F10, KC_F11, KC_F12, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_PGUP, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END -), - - /* FN Layer 3 - * ,-------------------------------------------------------------------------. - * | Esc | Calc|Webhm| Comp|Webrf| | | | | |PrtSc|CtrAlDl| - * |-------------------------------------------------------------------------+ - * | | | | | | | |VolDn|VolUp| | | | - * |-------------------------------------------------------------------------+ - * | |LEDtg|LEDch| | |RESET| | Mute| |MouB1|MousU|MouB2| - * |-------------------------------------------------------------------------+ - * | | | | | | | | |MousL|MousD|MousR| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Hold Tab down - L3 */ - KC_ESC, KC_CALC, KC_WHOM, KC_MYCM, KC_WREF, _______, _______, _______, _______, _______, KC_PSCR, CTRADEL, - _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______, - _______, LED_TOG, LED_CHG, _______, _______, RESET, _______, KC_MUTE, _______, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R -), - - /* FN Layer 4 - * ,-------------------------------------------------------------------------. - * | | | @ | £ | $ | ~ | | ¨ | ´ | ` | Å | | - * |-------------------------------------------------------------------------+ - * | | | | € | | | | | ^ | Ø | Æ | | - * |-------------------------------------------------------------------------+ - * | | < | | | | | | µ | | | | | - * |-------------------------------------------------------------------------+ - * | | | | | | | | L5 | | | | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Norsk - L4 */ - _______, _______, NO_AT, NO_PND, NO_DLR, NO_TILD, _______, NO_QUOT, NO_ACUT, NO_GRV, NO_AA, _______, - _______, _______, _______, NO_EURO, _______, _______, _______, _______, NO_CIRC, NO_OSLH, NO_AE, _______, - _______, NO_LESS, _______, _______, _______, _______, _______, NO_MU, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, TO(5), _______, _______, _______ -), - - /* GAMING Layer (toggle on and off) - * ,-------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | F1 | F2 | F3 | F4 |Alt+Tab| - * |-------------------------------------------------------------------------+ - * | Tab | A | S | D | F | G | H | F5 | F6 | F7 | F8 | Enter| - * |-------------------------------------------------------------------------+ - * | Shift | 1 | 2 | 3 | 4 | 5 | 6 | F9 | F10 | F11 | Up |TOGGL| - * |-------------------------------------------------------------------------+ - * | Ctrl| Z | X | C | B | Space | M | V |Left |Down |Right| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* GAMING, toggled on and off - L5 */ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_F1, KC_F2, KC_F3, KC_F4, ALTTAB, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_F5, KC_F6, KC_F7, KC_F8, KC_ENT, - KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_UP, TO(0), - KC_LCTL, KC_Z, KC_X, KC_C, KC_B, KC_SPC, KC_M, KC_V, KC_LEFT, KC_DOWN, KC_RGHT -), -}; - -//LED keymap functions - #ifdef LED_ENABLE -void led_chmode(void) { - serial_send(101); -} - -void led_toggle(void) { - serial_send(100); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case LED_TOG: - #ifdef LED_ENABLE - led_toggle(); - #endif - return false; - case LED_CHG: - #ifdef LED_ENABLE - led_chmode(); - #endif - return false; - } - } - return true; -}; -#endif diff --git a/keyboards/ut47/keymaps/rgb/config.h b/keyboards/ut47/keymaps/rgb/config.h deleted file mode 100644 index 0eb010a3ae2..00000000000 --- a/keyboards/ut47/keymaps/rgb/config.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here -#define RGBLIGHT_ANIMATIONS -#define RGB_DI_PIN D3 // The pin the LED strip is connected to -#define RGBLED_NUM 7 // Number of LEDs in your strip - -#endif diff --git a/keyboards/ut47/keymaps/rgb/keymap.c b/keyboards/ut47/keymaps/rgb/keymap.c deleted file mode 100644 index 58d11031ad1..00000000000 --- a/keyboards/ut47/keymaps/rgb/keymap.c +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#ifdef LED_ENABLE - #include "protocol/serial.h" -#endif - -#define _______ KC_TRNS -#define LT3_TAB LT(3, KC_TAB) -#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) - -enum custom_keycodes { - LED_TOG = SAFE_RANGE, - LED_CHG -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -LAYOUT( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, - KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -LAYOUT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - -LAYOUT( - KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_FN10, KC_FN11, KC_FN12, KC_FN13, KC_FN14, KC_FN15, KC_FN16, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_FN17, KC_FN18, KC_FN19, KC_FN20, KC_FN21, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - -LAYOUT( /* Tab */ - KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R -), -}; - -//LED keymap functions - #ifdef LED_ENABLE -void led_chmode(void) { - serial_send(101); -} - -void led_toggle(void) { - serial_send(100); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case LED_TOG: - #ifdef LED_ENABLE - led_toggle(); - #endif - return false; - case LED_CHG: - #ifdef LED_ENABLE - led_chmode(); - #endif - return false; - } - } - return true; -}; -#endif diff --git a/keyboards/ut47/readme.md b/keyboards/ut47/readme.md deleted file mode 100644 index 244bbd1de80..00000000000 --- a/keyboards/ut47/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# ut47 - -![ut47](https://i.imgur.com/ZDKZQaj.jpg) - -Somewhere between ortholinear and standard offset. Created to have all the same functions on a Planck in a keyboard but with a more conventional keyboard row stagger. - -Keyboard Maintainer: [filoxo](https://github.com/filoxo), [network_operations] -Hardware Supported: [PCB design](http://www.40percent.club/2016/10/gnap-20-plateless.html), Arduino Pro Micro -Hardware Availability: [How to order](http://www.40percent.club/2017/03/ordering-pcb.html) - -### Instructions - -To flash the UT47 without LEDs (single controller), run: - - make ut47:default - -To enable the UT47 LEDs (dual controller), run this for the main controller: - - make ut47:default LED_ENABLE=yes - -Or you can add `LED_ENABLE = yes` to *rules.mk* - -And then flash [LED_controls.ino](LED_controls.ino) to the second controller using [Arduino IDE](https://www.arduino.cc/en/Main/Software) or similar. NOTE: Arduino IDE will require importing additional libraries to compile. - -The reason this is an "opt-in" feature is to prevent sending serial communication over the pin, in case it ends up being used for something else (like RGB underglow). - -### Layout - -Go to the [default layout README](keymaps/default/readme.md) for more information. - -### Additional info - -Credit: Forked from [di0ib TMK version](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gnap) - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -### Build Guide - -[u/network_operations' build guide thread](https://www.reddit.com/r/MechanicalKeyboards/comments/7wqktu/gnap_the_cheap_40/) diff --git a/keyboards/ut47/rules.mk b/keyboards/ut47/rules.mk deleted file mode 100644 index b0465986698..00000000000 --- a/keyboards/ut47/rules.mk +++ /dev/null @@ -1,70 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Bootloader -BOOTLOADER = caterina - -# custom matrix setup -CUSTOM_MATRIX = yes -SRC += matrix.c protocol/serial_uart.c - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - -ifeq ($(strip $(LED_ENABLE)), yes) - OPT_DEFS += -DLED_ENABLE - SRC += led.c -endif diff --git a/keyboards/ut47/ut47.h b/keyboards/ut47/ut47.h deleted file mode 100644 index a4507dd34d7..00000000000 --- a/keyboards/ut47/ut47.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef UT47_H -#define UT47_H - -#include "quantum.h" - -#define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ - K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ -) \ - { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b }, \ - { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b } \ - } - -#define LAYOUT_kc( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ - K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ -) \ - LAYOUT( \ - KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0a, KC_##K0b, \ - KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1a, KC_##K1b, \ - KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2a, KC_##K2b, \ - KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K37, KC_##K38, KC_##K39, KC_##K3a, KC_##K3b \ - ) - -#define LAYOUT_kc_ut47 LAYOUT_kc - -#endif diff --git a/keyboards/ut472/config.h b/keyboards/ut472/config.h new file mode 100644 index 00000000000..c71995ec7dd --- /dev/null +++ b/keyboards/ut472/config.h @@ -0,0 +1,60 @@ +/* +Copyright 2018 Carlos Filoteo + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Keyhive +#define PRODUCT UT47.2 +#define DESCRIPTION An awesome 40% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, D2, D3, D4 } +#define MATRIX_COL_PINS { C4, C5, B7, B6, B5, B4, B3, B2, B1, B0, D6, D5 } +#define UNUSED_PINS + + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN C6 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/ut472/info.json b/keyboards/ut472/info.json new file mode 100644 index 00000000000..40f769ae2ad --- /dev/null +++ b/keyboards/ut472/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "UT47.2", + "url": "", + "maintainer": "qmk", + "width": 12.5, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 47, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Backspace", "x":11, "y":0, "w":1.5}, {"label":"LT(3) / Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.25}, {"label":"Shift", "x":0, "y":2, "w":1.5}, {"label":"Z", "x":1.5, "y":2}, {"label":"X", "x":2.5, "y":2}, {"label":"C", "x":3.5, "y":2}, {"label":"V", "x":4.5, "y":2}, {"label":"B", "x":5.5, "y":2}, {"label":"N", "x":6.5, "y":2}, {"label":"M", "x":7.5, "y":2}, {"label":"<", "x":8.5, "y":2}, {"label":">", "x":9.5, "y":2}, {"label":"?", "x":10.5, "y":2}, {"label":"Shift / Enter", "x":11.5, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Alt", "x":1, "y":3}, {"label":"GUI", "x":2, "y":3}, {"label":"Menu", "x":3, "y":3}, {"label":"MO(2)", "x":4, "y":3, "w":1.25}, {"x":5.25, "y":3, "w":2}, {"label":"MO(1)", "x":7.25, "y":3, "w":1.25}, {"label":"\u2190", "x":8.5, "y":3}, {"label":"\u2193", "x":9.5, "y":3}, {"label":"\u2191", "x":10.5, "y":3}, {"label":"\u2192", "x":11.5, "y":3}] + } + } +} diff --git a/keyboards/ut472/keymaps/default/config.h b/keyboards/ut472/keymaps/default/config.h new file mode 100644 index 00000000000..f88ebf7e803 --- /dev/null +++ b/keyboards/ut472/keymaps/default/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +// place overrides here diff --git a/keyboards/ut472/keymaps/default/keymap.c b/keyboards/ut472/keymaps/default/keymap.c new file mode 100644 index 00000000000..883eb5a2287 --- /dev/null +++ b/keyboards/ut472/keymaps/default/keymap.c @@ -0,0 +1,100 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define LT3_TAB LT(3, KC_TAB) + + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| + * |-------------------------------------------------------------------------+ + * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_SFTENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + /* FN Layer 1 + * ,-------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | - | = | [ | ] | \ | + * |-------------------------------------------------------------------------+ + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Right */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | _ | + | { | } | | | + * |-------------------------------------------------------------------------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Left */ + KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | |MousL|MousD|MousU|MousR| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Tab */ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R +), +}; diff --git a/keyboards/ut472/keymaps/default/readme.md b/keyboards/ut472/keymaps/default/readme.md new file mode 100644 index 00000000000..e3dcee467e5 --- /dev/null +++ b/keyboards/ut472/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# UT47 default keymap + +![UT47 layout image](https://i.imgur.com/Tsz5qsF.png) + +[KLE](http://www.keyboard-layout-editor.com/##@@_y:0%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Back%20Space&_x:0.25&a:4&f:4&w:4&h:4&d:true%3B&=%3Cb%3EGNAP!%3C%2F%2Fb%3E%3Cp%3E%3Cp%3EMinimum%20stagger%3Cp%3E47%20key%20layout%3B&@_a:7&f:3&w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=J&=K&=L&=%2F%3B&_w:1.25%3B&=%27%3B&@_w:1.5%3B&=Shift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F%2F&=Return%3B&@=Ctrl&=Alt&=Super&=Menu&_w:1.25%3B&=%2F&dArr%2F%3B&_w:2%3B&=&_w:1.25%3B&=%2F&uArr%2F%3B&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&uarr%2F%3B&=%2F&rarr%2F%3B%3B&=undefined) diff --git a/keyboards/ut472/keymaps/tucznak/config.h b/keyboards/ut472/keymaps/tucznak/config.h new file mode 100644 index 00000000000..06524822e86 --- /dev/null +++ b/keyboards/ut472/keymaps/tucznak/config.h @@ -0,0 +1,18 @@ +#pragma once + +#undef MANUFACTURER +#undef PRODUCT +#undef DESCRIPTION + +#define MANUFACTURER Potato Inc. +#define PRODUCT Qt3.14 +#define DESCRIPTION Smolkeeb + +/* turn off RGB when computer sleeps */ +#ifdef RGBLIGHT_ENABLE +#define RGBLIGHT_SLEEP +#endif + +/* send tap key if no layer key was used even after tap delay */ +#define TAPPING_TERM 50 +#define RETRO_TAPPING diff --git a/keyboards/ut472/keymaps/tucznak/keymap.c b/keyboards/ut472/keymaps/tucznak/keymap.c new file mode 100644 index 00000000000..7fbbd0e76e2 --- /dev/null +++ b/keyboards/ut472/keymaps/tucznak/keymap.c @@ -0,0 +1,111 @@ +#include QMK_KEYBOARD_H + +enum layers { + _BASE, + _LEFT, + _RIGHT, + _NUM, + _FN +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | Up | FN | + * |-------------------------------------------------------------------------+ + * | Ctrl| Win | LAlt| NUM | LEFT | Space | RIGHT| RAlt| Left| Down|Right| + * `-------------------------------------------------------------------------' + */ + + [_BASE] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, MO(_FN), + KC_LCTL, KC_LGUI, KC_LALT, MO(_NUM),MO(_LEFT), KC_SPC, MO(_RIGHT), KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Left function layer (1) + * F keys and navigation + * ,-------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | Ins | + * |-------------------------------------------------------------------------+ + * | | Caps| |PrtSc|ScrLk|Pause| | | | | PgUp| Del | + * |-------------------------------------------------------------------------+ + * | | | | | | | | Menu| Home| PgDn| End | + * `-------------------------------------------------------------------------' + */ + + [_LEFT] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, KC_CAPS, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, KC_PGUP, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, KC_APP, KC_HOME, KC_PGDN, KC_END + ), + + /* Right function layer (2) + * National and special characters + * ,-------------------------------------------------------------------------. + * | +1 | ě2 | š3 | č4 | ř5 | ž6 | ý7 | á8 | í9 | é0 | ´ | ˇ | + * |-------------------------------------------------------------------------+ + * | ;° | | | | | | | ( | ) | § | ! | ú | / | + * |-------------------------------------------------------------------------+ + * | | \ | | | | | % | = | ¨ | ' | - | _ | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | + * `-------------------------------------------------------------------------' + */ + + [_RIGHT] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, LSFT(KC_EQL), + KC_GRV, LSFT(KC_NUBS), _______, _______, _______, _______, LSFT(KC_RBRC), KC_RBRC, KC_QUOT, LSFT(KC_QUOT), KC_LBRC, LSFT(KC_LBRC), + _______, KC_NUBS, _______, _______, _______, _______, LSFT(KC_MINS), KC_MINS, KC_BSLS, LSFT(KC_BSLS), KC_SLSH, LSFT(KC_SLSH), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Numpad layer (3) + * ,-------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |-------------------------------------------------------------------------+ + * | | | | | | | | 4 | 5 | 6 | / | | + * |-------------------------------------------------------------------------+ + * | |NumLk| | | | | | 1 | 2 | 3 | * | | + * |-------------------------------------------------------------------------+ + * | | | | | | | 0 | . | + | - | | + * `-------------------------------------------------------------------------' + */ + + [_NUM] = LAYOUT( + _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_0, _______, + _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PSLS, _______, + _______, KC_NLCK, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PAST, _______, + _______, _______, _______, _______, _______, _______, KC_KP_0, KC_DOT, KC_PPLS, KC_PMNS, _______ + ), + + /* Function layer (4) + * Backlighting, keyboard controls, music etc. + * ,-------------------------------------------------------------------------. + * |Reset| | | | | | | | | | | Vol+ | + * |-------------------------------------------------------------------------+ + * | | VLK | Mod+| Hue+| Sat+| Val+| | | | | | Vol- | + * |-------------------------------------------------------------------------+ + * | | TOG | Mod-| Hue-| Sat-| Val-| | | | | Stop| Mute| + * |-------------------------------------------------------------------------+ + * |Sleep| | | | | C+A+D | C+A+I | | Prev|Pause| Next| + * `-------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, + _______, VLK_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, KC_VOLD, + _______, RGB_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, KC_MSTP, KC_MUTE, + KC_SLEP, _______, _______, _______, _______, LCA(KC_DEL), LCA(KC_INS), _______, KC_MPRV, KC_MPLY, KC_MNXT + ) +}; diff --git a/keyboards/ut472/keymaps/tucznak/readme.md b/keyboards/ut472/keymaps/tucznak/readme.md new file mode 100644 index 00000000000..95180bc392a --- /dev/null +++ b/keyboards/ut472/keymaps/tucznak/readme.md @@ -0,0 +1,5 @@ +# TuCZnak's modified layout + +This layout is optimized for Czech national QWERTZ keymap. +It includes separated layers for numbers, national characters, +special characters and configuration. diff --git a/keyboards/ut472/keymaps/tucznak/rules.mk b/keyboards/ut472/keymaps/tucznak/rules.mk new file mode 100644 index 00000000000..112b769841d --- /dev/null +++ b/keyboards/ut472/keymaps/tucznak/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +RGBLIGHT_ENABLE = yes diff --git a/keyboards/ut472/readme.md b/keyboards/ut472/readme.md new file mode 100644 index 00000000000..25f40d783ab --- /dev/null +++ b/keyboards/ut472/readme.md @@ -0,0 +1,20 @@ +# ut47.2 + +Somewhere between ortholinear and standard offset. Created to have all the same functions on a Planck in a keyboard but with a more conventional keyboard row stagger. + +Keyboard Maintainer: [filoxo](https://github.com/filoxo), [network_operations](https://www.keyhive.xyz) + +The keyboard files can be found here: https://github.com/ai03-2725/UT47.2 +or purchased at keyhive.xyz + +## Instructions + +To create a hex file for the UT47.2, run: + + make ut472:default + +## Layout + +Go to the [default layout README](keymaps/default/readme.md) for more information. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ut472/rules.mk b/keyboards/ut472/rules.mk new file mode 100644 index 00000000000..c7b2efedca3 --- /dev/null +++ b/keyboards/ut472/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u2 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +RGBLIGHT_ENABLE = yes diff --git a/keyboards/ut472/ut472.c b/keyboards/ut472/ut472.c new file mode 100644 index 00000000000..c0686d661aa --- /dev/null +++ b/keyboards/ut472/ut472.c @@ -0,0 +1,13 @@ +#include "ut472.h" + +void matrix_init_kb(void) { + // Keyboard start-up code goes here + // Runs once when the firmware starts up + matrix_init_user(); +}; + +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +}; diff --git a/keyboards/ut472/ut472.h b/keyboards/ut472/ut472.h new file mode 100644 index 00000000000..1068dd7041f --- /dev/null +++ b/keyboards/ut472/ut472.h @@ -0,0 +1,34 @@ +/* Copyright 2018 Carlos Filoteo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ +) \ + { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b }, \ + { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b } \ + } + + diff --git a/keyboards/v60_type_r/config.h b/keyboards/v60_type_r/config.h index 1f3ebcd5160..51ca6def94a 100644 --- a/keyboards/v60_type_r/config.h +++ b/keyboards/v60_type_r/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 REPLACE_WITH_YOUR_NAME +Copyright 2017 benlyall, MechMerlin This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -46,7 +45,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN F7 @@ -63,9 +62,8 @@ along with this program. If not, see . #define RGB_DI_PIN 0 #define RGB_STEP 16 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -115,11 +113,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -196,5 +189,3 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/v60_type_r/info.json b/keyboards/v60_type_r/info.json index 3bb4ff0a071..fe5be6055fb 100644 --- a/keyboards/v60_type_r/info.json +++ b/keyboards/v60_type_r/info.json @@ -11,6 +11,9 @@ "LAYOUT_60_ansi": { "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - } + }, + "LAYOUT_60_iso": { + "layout": [{"label":"esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"backspace", "x":13, "y":0, "w":2}, {"label":"tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"caps", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"lshift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"rshift", "x":12.25, "y":3, "w":2.75}, {"label":"lctrl", "x":0, "y":4, "w":1.25}, {"label":"lwin", "x":1.25, "y":4, "w":1.25}, {"label":"lalt", "x":2.5, "y":4, "w":1.25}, {"label":"space", "x":3.75, "y":4, "w":6.25}, {"label":"fn0", "x":10, "y":4, "w":1.25}, {"label":"rwin", "x":11.25, "y":4, "w":1.25}, {"label":"menu", "x":12.5, "y":4, "w":1.25}, {"label":"rctrl", "x":13.75, "y":4, "w":1.25}] + } } } diff --git a/keyboards/v60_type_r/keymaps/default/config.h b/keyboards/v60_type_r/keymaps/default/config.h index 9561b0255f2..744bea207b3 100644 --- a/keyboards/v60_type_r/keymaps/default/config.h +++ b/keyboards/v60_type_r/keymaps/default/config.h @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,14 +13,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#pragma once -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +// place overrides here -#include "../../config.h" #ifdef V60_POLESTAR #undef V60_POLESTAR #endif - -#endif diff --git a/keyboards/v60_type_r/keymaps/default/keymap.c b/keyboards/v60_type_r/keymaps/default/keymap.c index 4f9b7f9b211..352400815e2 100644 --- a/keyboards/v60_type_r/keymaps/default/keymap.c +++ b/keyboards/v60_type_r/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,29 +63,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - - - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - void led_set_user(uint8_t usb_led) { } diff --git a/keyboards/v60_type_r/keymaps/default/readme.md b/keyboards/v60_type_r/keymaps/default/readme.md index 57ac901ada0..9b3c6f06433 100644 --- a/keyboards/v60_type_r/keymaps/default/readme.md +++ b/keyboards/v60_type_r/keymaps/default/readme.md @@ -1,5 +1,4 @@ -KB Paradise V60 Type R Default Layout -====================== +# KB Paradise V60 Type R Default Layout This is the default layout as defined by the KBP V60 Type R manual/keycaps @@ -9,4 +8,4 @@ This is the default layout as defined by the KBP V60 Type R manual/keycaps ### Build -To build this keymap, simply run `make KEYMAP=default`. \ No newline at end of file +To build this keymap, simply run `make v60_type_r:default`. diff --git a/keyboards/ergodash/rev2/rules.mk b/keyboards/v60_type_r/keymaps/default/rules.mk similarity index 100% rename from keyboards/ergodash/rev2/rules.mk rename to keyboards/v60_type_r/keymaps/default/rules.mk diff --git a/keyboards/v60_type_r/keymaps/iso/config.h b/keyboards/v60_type_r/keymaps/iso/config.h new file mode 100644 index 00000000000..6a1994d6ffd --- /dev/null +++ b/keyboards/v60_type_r/keymaps/iso/config.h @@ -0,0 +1,18 @@ +/* Copyright 2019 Lukewh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +// place overrides here diff --git a/keyboards/v60_type_r/keymaps/iso/keymap.c b/keyboards/v60_type_r/keymaps/iso/keymap.c new file mode 100644 index 00000000000..74aee86ed59 --- /dev/null +++ b/keyboards/v60_type_r/keymaps/iso/keymap.c @@ -0,0 +1,54 @@ +/* This is the default ISO layout provided by the KBP V60 Type R +* as depicted on the stock keycaps. +*/ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap 0: Default Layer (Qwerty) + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bs | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Entr| + * |-------------------------------------------------------| | + * |Caps | A| S| D| F| G| H| J| K| L| ;| '| #| | + * |-----------------------------------------------------------| + * |LShif| || Z| X| C| V| B| N| M| ,| .| /| RShift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Fn0 |Gui |App|Ctrl| + * `-----------------------------------------------------------' + */ + [0] = LAYOUT_60_iso( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOTE, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RGUI, KC_APP, KC_RCTL \ + ), + + /* Keymap 0: Default Layer (Qwerty) + * ,-----------------------------------------------------------. + * | ¬| F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| -| =| Bs | + * |-----------------------------------------------------------| + * | | | up| | | | | |prt|scr|pus| up| | | + * |-------------------------------------------------------| | + * | |lft|dwn|rig| | | | |hom|pgu|lft|rig| | | + * |-----------------------------------------------------------| + * | | | | | | |vld|vlu|mut|end|pgd|dwn| | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + [1] = LAYOUT_60_iso( \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RIGHT, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/v60_type_r/keymaps/iso/readme.md b/keyboards/v60_type_r/keymaps/iso/readme.md new file mode 100644 index 00000000000..2d5e1a13d21 --- /dev/null +++ b/keyboards/v60_type_r/keymaps/iso/readme.md @@ -0,0 +1,5 @@ +![KBP V60 Type R ISO Image](https://i.imgur.com/28xetL9.png) + +# Default ISO Layout + +This is the default layout that comes flashed on the KBP V60 Type R ISO version. diff --git a/keyboards/v60_type_r/keymaps/iso/rules.mk b/keyboards/v60_type_r/keymaps/iso/rules.mk new file mode 100644 index 00000000000..b6c9a258059 --- /dev/null +++ b/keyboards/v60_type_r/keymaps/iso/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no diff --git a/keyboards/v60_type_r/keymaps/vimouse/config.h b/keyboards/v60_type_r/keymaps/vimouse/config.h index 3937420d00d..285cb4fa238 100644 --- a/keyboards/v60_type_r/keymaps/vimouse/config.h +++ b/keyboards/v60_type_r/keymaps/vimouse/config.h @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #define V60_POLESTAR @@ -27,5 +24,3 @@ #define MOUSEKEY_TIME_TO_MAX 60 #define MOUSEKEY_MAX_SPEED 7 #define MOUSEKEY_WHEEL_DELAY 0 - -#endif diff --git a/keyboards/v60_type_r/keymaps/vimouse/keymap.c b/keyboards/v60_type_r/keymaps/vimouse/keymap.c index fba7111480f..8b0019e7ba1 100644 --- a/keyboards/v60_type_r/keymaps/vimouse/keymap.c +++ b/keyboards/v60_type_r/keymaps/vimouse/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,9 +97,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _____, _____, _____, _____, _____, _____, _____, _____), }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c b/keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c index ec337bb22e7..82a7e528080 100644 --- a/keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c +++ b/keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c @@ -18,7 +18,6 @@ #include "xtonhasvim.h" #include "fancylighting.h" -#define _______ KC_TRNS #define X_____X KC_NO enum layers { diff --git a/keyboards/v60_type_r/readme.md b/keyboards/v60_type_r/readme.md index c7039c2e70c..76cb5f39fc4 100644 --- a/keyboards/v60_type_r/readme.md +++ b/keyboards/v60_type_r/readme.md @@ -13,17 +13,6 @@ Please note that other variants of the KBP V60 are not fully programmable. Backlight and RGB Underglow are both supported. -To use the backlight and/or RGB underglow: -* Create a new keymap -* Create a rules.mk file in the keymap -* Add RGBLIGHT_ENABLE = yes and/or BACKLIGHT_ENABLE = yes to the rules.mk -* Setup your keymap to your preference. Use [the `vimouse` keymap](keymaps/vimouse/keymap.c) as a starting point -* Some extra keys are defined to allow you to set the red, green and blue values of the underglow directly, rather than using the HSV spectrum. These are RGB_RI, RGB_RD, RGB_GI, RGB_GD, RGB_BI, RGB_BD for increase and decrease of the red, green and blue channels respectively. - -The provided `default` keymap pretty closely matches the default V60 Type R keymap, minus the backlight and underglow control keys. The `vimouse` keymap is completely customised and makes use of many of the possibilities, including mouse keys, backlighting, RGB underglow, etc. - -Note for those customising: The configuration used in the `vimouse` keymap results in about 93% of the available flash being utilised. Keep that in mind if you're adding functionality. - Note: By default the V60 Type R uses TMK. You should know what you're doing and none of this is guaranteed to work. If you want to stick with the TMK default, then the KB Paradise preferred way of creating the hex file is by using https://tkg.io/, selecting Fantastic60 and then defining your keymap. You will then have to use tkg-toolkit to finish the flashing @@ -40,7 +29,4 @@ or make v60_type_r:vimouse -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - - - +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/v60_type_r/rules.mk b/keyboards/v60_type_r/rules.mk index 30038d5624f..35a79db1619 100644 --- a/keyboards/v60_type_r/rules.mk +++ b/keyboards/v60_type_r/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -39,33 +38,34 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE ?= no # Enable the RGB Underglow -MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable the RGB Underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -LAYOUTS = 60_ansi +LAYOUTS = 60_ansi 60_iso diff --git a/keyboards/v60_type_r/v60_type_r.c b/keyboards/v60_type_r/v60_type_r.c index 86d87e12da2..41eb75807d0 100644 --- a/keyboards/v60_type_r/v60_type_r.c +++ b/keyboards/v60_type_r/v60_type_r.c @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/keyboards/v60_type_r/v60_type_r.h b/keyboards/v60_type_r/v60_type_r.h index 3d7aef7eaf0..c33a2840b09 100644 --- a/keyboards/v60_type_r/v60_type_r.h +++ b/keyboards/v60_type_r/v60_type_r.h @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 benlyall, MechMerlin, Lukewh * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef V60_TYPE_R_H -#define V60_TYPE_R_H +#pragma once #include "quantum.h" @@ -106,4 +105,33 @@ enum my_keycodes { { k40, k41, k42, k43, k44, k45, k46, k47 } \ } -#endif + +/* LAYOUT_iso + * ,-----------------------------------------------------------------------------------------. + * | K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | + * |-----------------------------------------------------------------------------------------+ + * | K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | + * |--------------------------------------------------------------------------------- | + * | K20 | K21 | K22 | K23 | K24 | K25 | K26 | K27 | K28 | K29 | K2A | K2B | K2C | | + * |-----------------------------------------------------------------------------------------+ + * | K30 | K31 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3C | + * |-----------------------------------------------------------------------------------------+ + * | K40 | K41 | K42 | K43 | K44 | K45 | K46 | K47 | + * `-----------------------------------------------------------------------------------------' + */ +#define LAYOUT_60_iso( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ + k40, k41, k42, k43, k44, k45, k46, k47 \ + ) { \ + { k00, k01, k02, k03, k04, k05, k06, k07 }, \ + { k08, k09, k0a, k0b, k0c, KC_NO, k0d, k10 }, \ + { k11, k12, k13, k14, k15, k16, k17, k18 }, \ + { k19, k1a, k1b, k1c, k2c, k20, k21, k22 }, \ + { k23, k24, k25, k26, k27, k28, k29, k2a }, \ + { k2b, k1d, k30, k31, k32, k33, k34, k35 }, \ + { k36, k37, k38, k39, k3a, k3b, k3c, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46, k47 } \ + } diff --git a/keyboards/vinta/config.h b/keyboards/vinta/config.h index 5f6ea7f06b3..54be2a87f18 100644 --- a/keyboards/vinta/config.h +++ b/keyboards/vinta/config.h @@ -17,7 +17,7 @@ #define MATRIX_ROW_PINS { A10, A9, B0, A7, A6 } #define MATRIX_COL_PINS { A5, A4, A3, A2, A1, A0, F1, F0, B7, B6, B5, B4, B3, A15, A14, A13 } -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ @@ -63,8 +63,3 @@ * useful if your keyboard/keypad is missing keys and you want magic key support. * */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) diff --git a/keyboards/vinta/info.json b/keyboards/vinta/info.json new file mode 100644 index 00000000000..dd972c895de --- /dev/null +++ b/keyboards/vinta/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "vinta", + "url": "", + "maintainer": "Peioris", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_69_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"|", "x":14, "y":0}, {"label":"Del", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Reset", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + }, + "LAYOUT_68_tada": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"~", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Menu", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + }, + "LAYOUT_67_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"~", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Ctrl", "x":11.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +} diff --git a/keyboards/vinta/keymaps/default/keymap.c b/keyboards/vinta/keymaps/default/keymap.c index 4e55ec308f2..80499d73fc9 100644 --- a/keyboards/vinta/keymaps/default/keymap.c +++ b/keyboards/vinta/keymaps/default/keymap.c @@ -33,8 +33,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_69_ansi( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_DEL,\ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP,\ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,\ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,\ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, RESET, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), }; @@ -48,4 +48,4 @@ void matrix_scan_user(void) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; -} \ No newline at end of file +} diff --git a/keyboards/vinta/readme.md b/keyboards/vinta/readme.md index 193f3612160..278c5e2c4b5 100644 --- a/keyboards/vinta/readme.md +++ b/keyboards/vinta/readme.md @@ -14,7 +14,7 @@ Make example for this keyboard (after setting up your build environment): make vinta:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. #### Developer's Note diff --git a/keyboards/vinta/rules.mk b/keyboards/vinta/rules.mk index 9d89d966363..3ddb8d5bc0d 100644 --- a/keyboards/vinta/rules.mk +++ b/keyboards/vinta/rules.mk @@ -33,6 +33,7 @@ OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p DF11 -v 0483 # Build Options # comment out to disable the options. diff --git a/keyboards/vinta/vinta.h b/keyboards/vinta/vinta.h index 7f21157eeea..991c981c971 100644 --- a/keyboards/vinta/vinta.h +++ b/keyboards/vinta/vinta.h @@ -22,4 +22,34 @@ { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, XXX, K4C, K4D, K4E, K4F } \ } -#endif \ No newline at end of file +#define LAYOUT_68_tada( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, K2F, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3E, K3F, \ + K40, K41, K42, K45, K49, K4A, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, XXX, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, XXX, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, XXX, K3C, XXX, K3E, K3F }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, XXX, XXX, K4D, K4E, K4F } \ +} + +#define LAYOUT_67_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, K2F, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3E, K3F, \ + K40, K41, K42, K45, K49, K4A, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, XXX, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, XXX, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, XXX, K3C, XXX, K3E, K3F }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, XXX, XXX, K4D, K4E, K4F } \ +} + +#endif diff --git a/keyboards/vision_division/config.h b/keyboards/vision_division/config.h index 5798d91adf6..249431b8742 100644 --- a/keyboards/vision_division/config.h +++ b/keyboards/vision_division/config.h @@ -22,7 +22,6 @@ along with this program. If not, see . // Due to the configurability of this keyboard, matrix sizes are determined in the keymap's config.h - /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION ROW2COL @@ -31,7 +30,7 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 0 +#define DEBOUNCE 0 #define MATRIX_MASKED @@ -78,11 +77,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -137,7 +131,6 @@ along with this program. If not, see . /* Only print user print statements */ // #define USER_PRINT - /* disable action features */ //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING diff --git a/keyboards/vision_division/keymaps/default/config.h b/keyboards/vision_division/keymaps/default/config.h index efd43f41b4e..694ab6a6963 100644 --- a/keyboards/vision_division/keymaps/default/config.h +++ b/keyboards/vision_division/keymaps/default/config.h @@ -1,7 +1,7 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +// place overrides here -#include "../../config.h" #include "matrix_types.h" /* USB Device descriptor parameter */ @@ -77,5 +77,3 @@ KEYMAP_MASTER(MATRIX_LAYER, NUMERIC_NORMAL, HOMING k601, k602, k603, k604, k605, k606, k607, k608, k609, k60A, KC_NO, KC_NO, k611, k612, k613, k614, k615, k616, k617, k618, k619, k61A, k61B, KC_NO \ ) */ - -#endif \ No newline at end of file diff --git a/keyboards/vision_division/keymaps/default/keymap.c b/keyboards/vision_division/keymaps/default/keymap.c index 31b1076611a..1548ba995d9 100644 --- a/keyboards/vision_division/keymaps/default/keymap.c +++ b/keyboards/vision_division/keymaps/default/keymap.c @@ -1,13 +1,6 @@ -#include "vision_division.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H #include "led.h" -#ifdef AUDIO_ENABLE - #include "audio.h" - #include "song_list.h" -#endif - enum keyboard_layers { LAYER_QWERTY = 0, LAYER_UPPER, @@ -16,112 +9,20 @@ enum keyboard_layers { LAYER_MOUSE, LAYER_ADJUST, }; -enum keyboard_macros { - MACRO_QWERTY = 0, - MACRO_UPPER, - MACRO_LOWER, - MACRO_FUNCTION, - MACRO_MOUSE, - MACRO_TIMBRE_1, - MACRO_TIMBRE_2, - MACRO_TIMBRE_3, - MACRO_TIMBRE_4, - MACRO_TEMPO_U, - MACRO_TEMPO_D, - MACRO_TONE_DEFAULT, - MACRO_MUSIC_TOGGLE, - MACRO_AUDIO_TOGGLE, - MACRO_INC_VOICE, - MACRO_DEC_VOICE, - MACRO_BACKLIGHT, - MACRO_BREATH_TOGGLE, - MACRO_BREATH_SPEED_INC, - MACRO_BREATH_SPEED_DEC, - MACRO_BREATH_DEFAULT, - MACRO_MOUSE_MOVE_UL, - MACRO_MOUSE_MOVE_UR, - MACRO_MOUSE_MOVE_DL, - MACRO_MOUSE_MOVE_DR, - MACRO_HELP, - MACRO_HELP_1, - MACRO_HELP_2, - MACRO_HELP_3, - MACRO_HELP_4, - MACRO_HELP_5, - MACRO_HELP_6, - MACRO_HELP_7, - MACRO_HELP_8, - MACRO_HELP_9, - MACRO_HELP_0, - MACRO_GENERAL_1, - MACRO_GENERAL_2, - MACRO_GENERAL_3, - MACRO_GENERAL_4, - MACRO_GENERAL_5, - MACRO_CURSOR_UL, - MACRO_CURSOR_UR, - MACRO_CURSOR_DL, - MACRO_CURSOR_DR, - MACRO_MUTE_APP, - MACRO_COPY_CUT, -}; -#define M_QWRTY M(MACRO_QWERTY) -#define M_UPPER M(MACRO_UPPER) -#define M_LOWER M(MACRO_LOWER) -#define M_FUNCT M(MACRO_FUNCTION) -#define M_MOUSE M(MACRO_MOUSE) - -#define TIMBR_1 M(MACRO_TIMBRE_1) -#define TIMBR_2 M(MACRO_TIMBRE_2) -#define TIMBR_3 M(MACRO_TIMBRE_3) -#define TIMBR_4 M(MACRO_TIMBRE_4) -#define TMPO_UP M(MACRO_TEMPO_U) -#define TMPO_DN M(MACRO_TEMPO_D) -#define TMPO_DF M(MACRO_TONE_DEFAULT) - -#define VC_UP M(MACRO_INC_VOICE) -#define VC_DOWN M(MACRO_DEC_VOICE) - -#define M_BACKL M(MACRO_BACKLIGHT) -#define M_BRTOG M(MACRO_BREATH_TOGGLE) -#define M_BSPDU M(MACRO_BREATH_SPEED_INC) -#define M_BSPDD M(MACRO_BREATH_SPEED_DEC) -#define M_BDFLT M(MACRO_BREATH_DEFAULT) - -#define M_MS_UL M(MACRO_MOUSE_MOVE_UL) -#define M_MS_UR M(MACRO_MOUSE_MOVE_UR) -#define M_MS_DL M(MACRO_MOUSE_MOVE_DL) -#define M_MS_DR M(MACRO_MOUSE_MOVE_DR) - -#define M_HELP M(MACRO_HELP) -#define M_HELP1 M(MACRO_HELP_1) -#define M_HELP2 M(MACRO_HELP_2) -#define M_HELP3 M(MACRO_HELP_3) -#define M_HELP4 M(MACRO_HELP_4) -#define M_HELP5 M(MACRO_HELP_5) -#define M_HELP6 M(MACRO_HELP_6) -#define M_HELP7 M(MACRO_HELP_7) -#define M_HELP8 M(MACRO_HELP_8) -#define M_HELP9 M(MACRO_HELP_9) -#define M_HELP0 M(MACRO_HELP_0) - -#define M_M1 M(MACRO_GENERAL_1) -#define M_M2 M(MACRO_GENERAL_2) -#define M_M3 M(MACRO_GENERAL_3) -#define M_M4 M(MACRO_GENERAL_4) -#define M_M5 M(MACRO_GENERAL_5) - -#define M_UL M(MACRO_CURSOR_UL) -#define M_UR M(MACRO_CURSOR_UR) -#define M_DL M(MACRO_CURSOR_DL) -#define M_DR M(MACRO_CURSOR_DR) - -#define M_MUTEA M(MACRO_MUTE_APP) - -#define M_CP_CT M(MACRO_COPY_CUT) - -#define M_COPY KC_FN1 +enum custom_keycodes { + M_CP_CT = SAFE_RANGE, + M_UPPER, + M_LOWER, + M_MOUSE, + TIMBR_1, + TIMBR_2, + TIMBR_3, + TIMBR_4, + TMPO_UP, + TMPO_DN, + TMPO_DF +}; #define SC_UNDO LCTL(KC_Z) #define SC_REDO LCTL(KC_Y) @@ -135,10 +36,8 @@ enum keyboard_macros { #define SC_CCLS LCTL(KC_F4) #define TG_NKRO MAGIC_TOGGLE_NKRO -#define OS_SHFT KC_FN0 +#define OS_SHFT OSM(MOD_LSFT) -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define ________________ _______, _______ #define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX @@ -160,28 +59,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = | VOL DN | MUTE | VOL UP | BACKLT | | F1 | F2 | F3 | F4 | XXXXXX | F5 | F6 | F7 | F8 | XXXXXX | F9 | F10 | F11 | F12 | | PRINT | SCR LK | PAUSE | FN | '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. - | NUM LK | KP / | KP * | KP - | | ESC | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | BACKSP | | INS | HOME | PG UP | M1 | + | NUM LK | KP / | KP * | KP - | | ESC | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | BACKSP | | INS | HOME | PG UP | XXXXXX | |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------| - | KP 7 | KP 8 | KP 9 | KP + | | TAB | TAB | Q | W | E | R | T | Y | U | I | O | P | - | \ | | DEL | END | PG DN | M2 | + | KP 7 | KP 8 | KP 9 | KP + | | TAB | TAB | Q | W | E | R | T | Y | U | I | O | P | - | \ | | DEL | END | PG DN | XXXXXX | |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------| - | KP 4 | KP 5 | KP 6 | KP + | | CAP LK | BACKSP | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | o | CP/CT | UNDO | PASTE | M3 | + | KP 4 | KP 5 | KP 6 | KP + | | CAP LK | BACKSP | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | o | CP/CT | UNDO | PASTE | XXXXXX | |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------| - | KP 1 | KP 2 | KP 3 | KP Ent | | LSHIFT | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | RSHIFT | | XXXXXX | UP | XXXXXX | M4 | + | KP 1 | KP 2 | KP 3 | KP Ent | | LSHIFT | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | RSHIFT | | XXXXXX | UP | XXXXXX | XXXXXX | |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------| - | KP 0 | KP , | KP . | KP Ent | | LCTRL | XXXXXX | LWIN | XXXXXX | LALT | UPPER | SPACE . SPACE | LOWER | OSHIFT | RALT | APP | XXXXXX | RCTRL | | LEFT | DOWN | RIGHT | M5 | + | KP 0 | KP , | KP . | KP Ent | | LCTRL | XXXXXX | LWIN | XXXXXX | LALT | UPPER | SPACE . SPACE | LOWER | OSHIFT | RALT | APP | XXXXXX | RCTRL | | LEFT | DOWN | RIGHT | XXXXXX | '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' */ KEYMAP(LAYER_QWERTY, \ - KC_VOLD, KC_MUTE, KC_VOLU, M_BACKL, KC_F1 , KC_F2 , KC_F3 , KC_F4 , XXXXXXX, KC_F5 , KC_F6 , KC_F7 , KC_F8 , XXXXXXX, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PSCR, KC_SLCK, KC_PAUS, M_HELP , \ - KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_ESC , KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_EQL , KC_BSPC, KC_INS , KC_HOME, KC_PGUP, M_M1 , \ - KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TAB , KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_MINS, KC_BSLS, KC_DEL , KC_END , KC_PGDN, M_M2 , \ - KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, KC_CAPS, KC_BSPC, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , M_CP_CT, SC_UNDO, SC_PSTE, M_M3 , \ - KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, KC_LSFT, KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_RSFT, XXXXXXX, KC_UP , XXXXXXX, M_M4 , \ - KC_KP_0, KC_PCMM, KC_PDOT, KC_PENT, KC_LCTL, XXXXXXX, KC_LGUI, XXXXXXX, KC_LALT, M_UPPER, KC_SPC , KC_SPC , M_LOWER, OS_SHFT, KC_RALT, KC_APP , XXXXXXX, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, M_M5 \ + KC_VOLD, KC_MUTE, KC_VOLU, BL_STEP, KC_F1 , KC_F2 , KC_F3 , KC_F4 , XXXXXXX, KC_F5 , KC_F6 , KC_F7 , KC_F8 , XXXXXXX, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX , \ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_ESC , KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_EQL , KC_BSPC, KC_INS , KC_HOME, KC_PGUP, XXXXXXX , \ + KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TAB , KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_MINS, KC_BSLS, KC_DEL , KC_END , KC_PGDN, XXXXXXX , \ + KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, KC_CAPS, KC_BSPC, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , M_CP_CT, SC_UNDO, SC_PSTE, XXXXXXX , \ + KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, KC_LSFT, KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_RSFT, XXXXXXX, KC_UP , XXXXXXX, XXXXXXX , \ + KC_KP_0, KC_PCMM, KC_PDOT, KC_PENT, KC_LCTL, XXXXXXX, KC_LGUI, XXXXXXX, KC_LALT, M_UPPER, KC_SPC , KC_SPC , M_LOWER, OS_SHFT, KC_RALT, KC_APP , XXXXXXX, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX \ ), /* LAYER = LAYER_LOWER .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. - | ______ | MUTE A | ______ | ______ | | F13 | F14 | F15 | F16 | XXXXXX | F17 | F18 | F19 | F20 | XXXXXX | F21 | F22 | F23 | F24 | | ______ | ______ | ______ | ______ | + | ______ | ______ | ______ | ______ | | F13 | F14 | F15 | F16 | XXXXXX | F17 | F18 | F19 | F20 | XXXXXX | F21 | F22 | F23 | F24 | | ______ | ______ | ______ | ______ | '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | @@ -196,7 +95,7 @@ KEYMAP(LAYER_QWERTY, \ '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' */ KEYMAP(LAYER_LOWER, \ - _______, M_MUTEA, _______, _______, KC_F13 , KC_F14 , KC_F15 , KC_F16 , XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , XXXXXXX, KC_F21 , KC_F22 , KC_F23 , KC_F24 , _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_F13 , KC_F14 , KC_F15 , KC_F16 , XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , XXXXXXX, KC_F21 , KC_F22 , KC_F23 , KC_F24 , _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_DLR , KC_LCBR, KC_LBRC, KC_LPRN, KC_PERC, KC_HASH, KC_RPRN, KC_RBRC, KC_RCBR, KC_AT , _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_CIRC, KC_ASTR, KC_PLUS, KC_MINS, KC_SLSH, KC_BSLS, KC_UNDS, KC_QUOT, KC_DQT , KC_GRV , _______, _______, _______, _______, _______, _______, \ @@ -205,7 +104,7 @@ KEYMAP(LAYER_LOWER, \ ), /* LAYER = LAYER_UPPER .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. - | ______ | MUTE A | ______ | ______ | | F13 | F14 | F15 | F16 | XXXXXX | F17 | F18 | F19 | F20 | XXXXXX | F21 | F22 | F23 | F24 | | ______ | ______ | ______ | ______ | + | ______ | ______ | ______ | ______ | | F13 | F14 | F15 | F16 | XXXXXX | F17 | F18 | F19 | F20 | XXXXXX | F21 | F22 | F23 | F24 | | ______ | ______ | ______ | ______ | '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | @@ -220,7 +119,7 @@ KEYMAP(LAYER_LOWER, \ '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' */ KEYMAP(LAYER_UPPER, \ - _______, M_MUTEA, _______, _______, KC_F13 , KC_F14 , KC_F15 , KC_F16 , XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , XXXXXXX, KC_F21 , KC_F22 , KC_F23 , KC_F24 , _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_F13 , KC_F14 , KC_F15 , KC_F16 , XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , XXXXXXX, KC_F21 , KC_F22 , KC_F23 , KC_F24 , _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_NLCK, KC_PSLS, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_CAPS, KC_PAST, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, _______, _______, _______, _______, _______, \ @@ -253,7 +152,7 @@ KEYMAP(LAYER_MOUSE, \ ), /* LAYER = LAYER_ADJUST .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. - | VOICE- | AUDIO | VOICE+ | MUSIC | | HELP 1 | HELP 2 | HELP 3 | HELP 4 | XXXXXX | HELP 5 | HELP 6 | HELP 7 | HELP 8 | XXXXXX | HELP 9 | HELP 0 | XXXXXX | XXXXXX | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | + | VOICE- | AUDIO | VOICE+ | MUSIC | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | @@ -268,7 +167,7 @@ KEYMAP(LAYER_MOUSE, \ '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' */ KEYMAP(LAYER_ADJUST, \ - MUV_DE , AU_TOG , MUV_IN , MU_TOG , M_HELP1, M_HELP2, M_HELP3, M_HELP4, XXXXXXX, M_HELP5, M_HELP6, M_HELP7, M_HELP8, XXXXXXX, M_HELP9, M_HELP0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MUV_DE , AU_TOG , MUV_IN , MU_TOG , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ @@ -305,238 +204,85 @@ void persistent_default_layer_set(uint16_t default_layer) default_layer_set(default_layer); } -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_MODS_ONESHOT(MOD_LSFT), - [1] = ACTION_MACRO_TAP(MACRO_COPY_CUT), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - - // MACRODOWN only works in this function - switch(id) - { - - case MACRO_COPY_CUT: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case M_CP_CT: if (record->event.pressed) { register_code(KC_LCTL); if (record->tap.count == 1) { register_code(KC_C); unregister_code(KC_C); - } - else if (record->tap.count == 2) { + } else if (record->tap.count == 2) { register_code(KC_X); unregister_code(KC_X); } unregister_code(KC_LCTL); } - break; - - - // case MACRO_HELP_1: - // if (record->event.pressed) - // { - // uprint("H1"); - // } - // break; - - // case MACRO_HELP_2: - // if (record->event.pressed) - // { - // uprint("H2"); - // } - // break; - - // case MACRO_HELP_3: - // if (record->event.pressed) - // { - // uprint("H3"); - // } - // break; - - // case MACRO_HELP_4: - // if (record->event.pressed) - // { - // uprint("H4"); - // } - // break; - - // case MACRO_HELP_5: - // if (record->event.pressed) - // { - // uprint("H5"); - // } - // break; - - // case MACRO_HELP_6: - // if (record->event.pressed) - // { - // uprint("H6"); - // } - // break; - - // case MACRO_HELP_7: - // if (record->event.pressed) - // { - // uprint("H7"); - // } - // break; - - // case MACRO_HELP_8: - // if (record->event.pressed) - // { - // uprint("H8"); - // } - // break; - - // case MACRO_HELP_9: - // if (record->event.pressed) - // { - // uprint("H9"); - // } - // break; - - case MACRO_BREATH_TOGGLE: - if (record->event.pressed) - { - breathing_toggle(); - } - break; - - case MACRO_BREATH_SPEED_INC: - if (record->event.pressed) - { - breathing_period_inc(); - } - break; - - case MACRO_BREATH_SPEED_DEC: - if (record->event.pressed) - { - breathing_period_dec(); - } - break; - - case MACRO_BREATH_DEFAULT: - if (record->event.pressed) - { - breathing_period_default(); - } - break; - - case MACRO_QWERTY: - if (record->event.pressed) - { - persistent_default_layer_set(1UL<event.pressed) - { + case M_UPPER: + if (record->event.pressed) { layer_on(LAYER_UPPER); breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); - } - else - { + } else { layer_off(LAYER_UPPER); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } - break; + return false; - case MACRO_LOWER: - if (record->event.pressed) - { + case M_LOWER: + if (record->event.pressed) { layer_on(LAYER_LOWER); breathing_period_set(2); breathing_pulse(); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); - } - else - { + } else { layer_off(LAYER_LOWER); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); } - break; - - case MACRO_FUNCTION: - if (record->event.pressed) - { - breathing_period_set(3); - breathing_enable(); - layer_on(LAYER_FUNCTION); - } - else - { - breathing_period_set(1); - breathing_self_disable(); - layer_off(LAYER_FUNCTION); - } - break; + return false; #ifdef MOUSEKEY_ENABLE - - case MACRO_MOUSE: - if (record->event.pressed) - { + case M_MOUSE: + if (record->event.pressed) { layer_invert(LAYER_MOUSE); } - break; - + return false; #endif /* MOUSEKEY_ENABLE */ #ifdef AUDIO_ENABLE - - case MACRO_TIMBRE_1: + case TIMBR_1: if (record->event.pressed) set_timbre(TIMBRE_12); - break; - - case MACRO_TIMBRE_2: + return false; + case TIMBR_2: if (record->event.pressed) set_timbre(TIMBRE_25); - break; - - case MACRO_TIMBRE_3: + return false; + case TIMBR_3: if (record->event.pressed) set_timbre(TIMBRE_50); - break; - - case MACRO_TIMBRE_4: + return false; + case TIMBR_4: if (record->event.pressed) set_timbre(TIMBRE_75); - break; - - case MACRO_TEMPO_U: + return false; + case TMPO_UP: if (record->event.pressed) increase_tempo(10); - break; - - case MACRO_TEMPO_D: + return false; + case TMPO_DN: if (record->event.pressed) decrease_tempo(10); - break; - - case MACRO_TONE_DEFAULT: - if (record->event.pressed) - { + return false; + case TMPO_DF: + if (record->event.pressed) { set_timbre(TIMBRE_DEFAULT); set_tempo(TEMPO_DEFAULT); } - break; - + return false; #endif /* AUDIO_ENABLE */ -#ifdef BACKLIGHT_ENABLE - case MACRO_BACKLIGHT: - if (record->event.pressed) - { - backlight_step(); - } - break; -#endif /* BACKLIGHT_ENABLE */ - default: - break; - -} -return MACRO_NONE; + return true; + } + return true; }; #ifdef AUDIO_ENABLE @@ -619,4 +365,4 @@ void music_scale_user(void) PLAY_SONG(music_scale); } -#endif /* AUDIO_ENABLE */ \ No newline at end of file +#endif /* AUDIO_ENABLE */ diff --git a/keyboards/vision_division/keymaps/default/rules.mk b/keyboards/vision_division/keymaps/default/rules.mk index 342f37453c0..69a3b2cd297 100644 --- a/keyboards/vision_division/keymaps/default/rules.mk +++ b/keyboards/vision_division/keymaps/default/rules.mk @@ -16,6 +16,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/vision_division/readme.md b/keyboards/vision_division/readme.md index 350ced3340c..72fdb954242 100644 --- a/keyboards/vision_division/readme.md +++ b/keyboards/vision_division/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make vision_division:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/vision_division/rules.mk b/keyboards/vision_division/rules.mk index 5b739d4fd09..5cd3a69bbb9 100644 --- a/keyboards/vision_division/rules.mk +++ b/keyboards/vision_division/rules.mk @@ -1,9 +1,5 @@ - - # MCU name MCU = at90usb1286 -# MCU = at90usb1287 -# MCU = atmega32u4 # Processor frequency. # This will define a symbol, F_CPU, in all source code files equal to the @@ -67,4 +63,4 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by d MIDI_ENABLE = no # MIDI controls UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 \ No newline at end of file +AUDIO_ENABLE = no # Audio output on port C6 diff --git a/keyboards/vitamins_included/keymaps/default/keymap.c b/keyboards/vitamins_included/keymaps/default/keymap.c index 13b48e7640b..78249057203 100644 --- a/keyboards/vitamins_included/keymaps/default/keymap.c +++ b/keyboards/vitamins_included/keymaps/default/keymap.c @@ -22,10 +22,6 @@ enum custom_keycodes { ADJUST }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/vitamins_included/keymaps/juno/keymap.c b/keyboards/vitamins_included/keymaps/juno/keymap.c new file mode 100644 index 00000000000..5fa8b4cf710 --- /dev/null +++ b/keyboards/vitamins_included/keymaps/juno/keymap.c @@ -0,0 +1,293 @@ +#include QMK_KEYBOARD_H +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +#define _FN1 5 +#define _DPAD 6 +#define _DPADNUM 7 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + + FN1, + DP_ON, + DP_OFF +}; + +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ESC | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | App | Ctrl | GUI | Alt |Lower | SpaceFn |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), \ + KC_APP, KC_LCTL, KC_LGUI, KC_LALT, LOWER, LT(_FN1, KC_SPC), + LT(_FN1, KC_SPC), RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |RESET | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + RESET, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |RESET | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | |RGB_MOD| + * `-----------------------------------------------------------------------------------' + */ + +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD \ +), + +// Two personal additional layers below +// There's no brite key + +/* Function (personal function layer) + * ,-----------------------------------------------------------------------------------. + * | | Vol+ | PgUp | Up | PdDn | Ins | | | Up | | PScr | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Vol- | Left | Down | Right| Home | | Left | Down |Right | | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Prev | Play | Next | | End | | | Vol- | Vol+ | Mute | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | | | | | Space | | DP_ON| | | | + * `-----------------------------------------------------------------------------------' + */ + +[_FN1] = LAYOUT_ortho_4x12( \ + _______, KC_VOLU, KC_PGUP, KC_UP, KC_PGDN, KC_INS, _______, _______, KC_UP, _______, KC_PSCR, _______, \ + _______, KC_VOLD, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_DEL, \ + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_END, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, DP_ON, _______, _______, _______ \ +), + +/* DPAD layer, for active arrow cluster at the bottom right corner + + * ,-----------------------------------------------------------------------------------. + * | ESC | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | |DNUM | Space | |DP_OFF| Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ + +[_DPAD] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT , \ + KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, MO(_DPADNUM), + KC_SPC, KC_SPC, LOWER, DP_OFF, KC_LEFT, KC_DOWN, KC_RGHT \ +), + +// Extended layer for weapon switchings + +[_DPADNUM] = LAYOUT_ortho_4x12( \ + XXXXXXX, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX , \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6 , \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , \ + _______, _______, _______, XXXXXXX, MO(_DPADNUM), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ +) + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + + // Additional personal custom functions + + case KC_CAPS: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + if (host_keyboard_leds() & (1<event.pressed) { + + } else { + // activated upon release + #ifdef AUDIO_ENABLE + // PLAY_SONG(dpad_song_on); + #endif + + layer_off(_FN1); + layer_on(_DPAD); + } + + case DP_OFF: + if (record->event.pressed) { + // deactivated upon pressdown + #ifdef AUDIO_ENABLE + // PLAY_SONG(dpad_song_off); + #endif + + //layer_off(_FN1); // do not put in this line + layer_off(_DPAD); + } + } + return true; +} diff --git a/keyboards/vitamins_included/keymaps/juno/rules.mk b/keyboards/vitamins_included/keymaps/juno/rules.mk new file mode 100644 index 00000000000..424b208b661 --- /dev/null +++ b/keyboards/vitamins_included/keymaps/juno/rules.mk @@ -0,0 +1,16 @@ +MIDI_ENABLE=no +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no + +NKRO_ENABLE = no # USB Nkey Rollover +AUDIO_ENABLE = no + +## BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) + +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration + +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/vitamins_included/keymaps/numpad/config.h b/keyboards/vitamins_included/keymaps/numpad/config.h new file mode 100644 index 00000000000..aba9fa7d403 --- /dev/null +++ b/keyboards/vitamins_included/keymaps/numpad/config.h @@ -0,0 +1,39 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +//#define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#ifdef AUDIO_ENABLE + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(DVORAK_SOUND), \ + SONG(COLEMAK_SOUND) \ + } +#endif diff --git a/keyboards/vitamins_included/keymaps/numpad/keymap.c b/keyboards/vitamins_included/keymaps/numpad/keymap.c new file mode 100644 index 00000000000..1767851feb9 --- /dev/null +++ b/keyboards/vitamins_included/keymaps/numpad/keymap.c @@ -0,0 +1,75 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _NUMPAD 0 +#define _ADJUST 3 + +enum custom_keycodes { + NUMPAD = SAFE_RANGE, + ADJUST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Numpad + * ,-----------------------------------------------------------------------------------. + * | 0 | 1 | 4 | 7 | nlck | esc | 0 | 1 | 4 | 7 | nlck | esc | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | , | 2 | 5 | 8 | / | adj | , | 2 | 5 | 8 | / | adj | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | . | 3 | 6 | 9 | * | adj | . | 3 | 6 | 9 | * | adj | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Enter| adj | - | + |bckspc| adj | Enter| adj | - | + |bckspc| adj | + * `-----------------------------------------------------------------------------------' + */ +[_NUMPAD] = LAYOUT_ortho_4x12( \ + KC_KP_0, KC_KP_1, KC_KP_4, KC_KP_7, KC_NUMLOCK, KC_ESC, KC_KP_0, KC_KP_1, KC_KP_4, KC_KP_7, KC_NUMLOCK, KC_ESC, \ + KC_KP_COMMA, KC_KP_2, KC_KP_5, KC_KP_8, KC_KP_SLASH, ADJUST, KC_KP_COMMA, KC_KP_2, KC_KP_5, KC_KP_8, KC_KP_SLASH, ADJUST, \ + KC_KP_DOT, KC_KP_3, KC_KP_6, KC_KP_9, KC_KP_ASTERISK, ADJUST, KC_KP_DOT, KC_KP_3, KC_KP_6, KC_KP_9, KC_KP_ASTERISK, ADJUST , \ + KC_KP_ENTER, ADJUST, KC_KP_MINUS, KC_KP_PLUS, KC_BSPACE, ADJUST, KC_KP_ENTER, ADJUST, KC_KP_MINUS, KC_KP_PLUS, KC_BSPACE, ADJUST \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | RESET RESET | | | | |RGB_MOD| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, RESET, RESET, _______, _______, _______, _______, RGB_MOD \ +) + + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/vitamins_included/matrix.c b/keyboards/vitamins_included/matrix.c index cf4c1064f83..1f5071c6932 100644 --- a/keyboards/vitamins_included/matrix.c +++ b/keyboards/vitamins_included/matrix.c @@ -45,11 +45,11 @@ along with this program. If not, see . # include "serial.h" #endif -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if (DEBOUNCING_DELAY > 0) +#if (DEBOUNCE > 0) static uint16_t debouncing_time; static bool debouncing = false; #endif @@ -192,7 +192,7 @@ uint8_t _matrix_scan(void) #if (DIODE_DIRECTION == COL2ROW) // Set row, read cols for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); if (matrix_changed) { @@ -209,7 +209,7 @@ uint8_t _matrix_scan(void) #elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) +# if (DEBOUNCE > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); if (matrix_changed) { debouncing = true; @@ -222,8 +222,8 @@ uint8_t _matrix_scan(void) } #endif -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { +# if (DEBOUNCE > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) { for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { matrix[i+offset] = matrix_debouncing[i+offset]; } diff --git a/keyboards/vitamins_included/rev1/config.h b/keyboards/vitamins_included/rev1/config.h index 0347477eea5..f4e5666fefd 100644 --- a/keyboards/vitamins_included/rev1/config.h +++ b/keyboards/vitamins_included/rev1/config.h @@ -45,18 +45,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN F0 @@ -86,5 +81,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - #endif diff --git a/keyboards/viterbi/config.h b/keyboards/viterbi/config.h deleted file mode 100644 index 863722d7d04..00000000000 --- a/keyboards/viterbi/config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -#endif // CONFIG_H diff --git a/keyboards/viterbi/i2c.c b/keyboards/viterbi/i2c.c deleted file mode 100644 index 084c890c405..00000000000 --- a/keyboards/viterbi/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 100000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/viterbi/keymaps/default/config.h b/keyboards/viterbi/keymaps/default/config.h deleted file mode 100644 index dabff8f9633..00000000000 --- a/keyboards/viterbi/keymaps/default/config.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/viterbi/keymaps/default/keymap.c b/keyboards/viterbi/keymaps/default/keymap.c deleted file mode 100644 index eee207c94d0..00000000000 --- a/keyboards/viterbi/keymaps/default/keymap.c +++ /dev/null @@ -1,174 +0,0 @@ -#include "viterbi.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -// Fillers to make layering more clear -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_AJST ADJUST -#define KC_LOWR LOWER -#define KC_RASE RAISE - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* QWERTY - * ,------------------------------------------------. ,------------------------------------------------. - * | Ins | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | Del | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | - | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | = | Esc | A | S | D | F | G | | H | J | K | L | ; | " |Enter | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Pg Up| Shift| Z | X | C | V | B | | N | M | , | . | / | Home | End | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Pg Dn|Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up | Right| \ | - * `------------------------------------------------' `------------------------------------------------' - */ - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - INS, GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,DEL , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - MINS,TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - EQL, ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT,ENT , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PGUP,LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,HOME,END , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PGDN,AJST,LCTL,LALT,LGUI,LOWR,SPC , SPC ,RASE,LEFT,DOWN, UP ,RGHT,BSLS - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - -/* Lower - * ,------------------------------------------------. ,------------------------------------------------. - * | | ~ | F1 | F3 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | _ | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | { | } | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | + | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | Next | Vol- | Vol+ | Play | | - * `------------------------------------------------' `------------------------------------------------' - */ - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - ,TILD, F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - UNDS, ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,LCBR,RCBR, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR, , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , F7 , F8 , F9 ,F10 ,F11 , F12 , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , ,MNXT,VOLD,VOLU,MPLY,MUTE - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - -/* Raise - * ,------------------------------------------------. ,------------------------------------------------. - * | | ~ | F1 | F3 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | _ | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | { | } | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | + | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | F7 | F8 | F9 | F10 | F11 | | F12 |ISO # |ISO / | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | Next | Vol- | Vol+ | Play | | - * `------------------------------------------------' `------------------------------------------------' - */ - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - ,TILD, F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - UNDS, , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,LCBR,RCBR, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC, , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , F7 , F8 , F9 ,F10 ,F11 , F12 ,NUHS,NUBS, , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , ,MNXT,VOLD,VOLU,MPLY,MUTE - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_ADJUST] = LAYOUT( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ - _______, _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, _______, \ - _______, _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/viterbi/keymaps/drashna/config.h b/keyboards/viterbi/keymaps/drashna/config.h deleted file mode 100644 index 6eb871a50fa..00000000000 --- a/keyboards/viterbi/keymaps/drashna/config.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLED_NUM 16 - -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 -#endif // RGBLIGHT_ENABLE - - -#undef LOCKING_SUPPORT_ENABLE -#undef LOCKING_RESYNC_ENABLE - - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#undef PRODUCT -#define PRODUCT Drashnas Viterbi Macro Pad - -#define USE_I2C - -#ifdef AUDIO_ENABLE -#define C6_AUDIO -#define NO_MUSIC_MODE -#endif - -#define STRICT_LAYER_RELEASE - -#define LAYOUT_ortho_5x7( \ - L00, L01, L02, L03, L04, L05, L06, \ - L10, L11, L12, L13, L14, L15, L16, \ - L20, L21, L22, L23, L24, L25, L26, \ - L30, L31, L32, L33, L34, L35, L36, \ - L40, L41, L42, L43, L44, L45, L46 \ - ) \ - LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - L10, L11, L12, L13, L14, L15, L16, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - L20, L21, L22, L23, L24, L25, L26, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - L30, L31, L32, L33, L34, L35, L36, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - L40, L41, L42, L43, L44, L45, L46, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO \ - ) - -#define QMK_ESC_OUTPUT F5 // usually COL -#define QMK_ESC_INPUT D4 // usually ROW -#define QMK_LED B0 -#define QMK_SPEAKER C6 diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c deleted file mode 100644 index acda8a0d258..00000000000 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ /dev/null @@ -1,98 +0,0 @@ -#include QMK_KEYBOARD_H -#include "drashna.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. - - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -#define LMACRO OSL(_MACROS) -#define DIABLO TG(_DIABLO) -#define GAMEPAD TG(_GAMEPAD) -#define MEDIA TT(_MEDIA) - - -//enum more_custom_keycodes { -// KC_P00 = NEW_SAFE_RANGE -//}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_NUMLOCK] = LAYOUT_ortho_5x7( - LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, - MEDIA, KC_CALC, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PAST, - KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, - KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, - KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_COLN, KC_PENT - ), - - [_DIABLO] = LAYOUT_ortho_5x7( - KC_ESC, DIABLO, KC_V, KC_D, XXXXXXX, XXXXXXX, KC_L, - KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_J, - KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, KC_F, - KC_LCTL, KC_D3_3, KC_D3_3, KC_D3_3, KC_D3_3, KC_Z, KC_DIABLO_CLEAR, - KC_LALT, KC_F4, KC_F5, KC_F8, KC_F9, KC_F10, SFT_T(KC_SPACE) - ), - - [_GAMEPAD] = LAYOUT_ortho_5x7( // Game pad layout designed primarily for Overwatch - LMACRO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, - MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, - KC_F1, KC_U, KC_I, KC_Y, KC_V, KC_SPC, KC_V - ), - - [_MACROS] = LAYOUT_ortho_5x7( - LMACRO, KC_OVERWATCH,GAMEPAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_C9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_SYMM, KC_TORB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_GLHF, KC_GOODGAME, KC_GGEZ, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_SALT, KC_MORESALT, KC_SALTHARD, KC_JUSTGAME, KC_AIM, XXXXXXX, KC_PENT - ), - - - [_MEDIA] = LAYOUT_ortho_5x7( - KC_MAKE, KC_RESET,MU_TOG, AU_ON, AU_OFF, CK_TOGG, RGB_SAD, - MEDIA, EPRM, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI, - RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_HUD, - KC_MPLY, KC_MPRV, KC_MNXT, RGB_M_X, RGB_M_G, RGB_M_P, RGB_HUI, - KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, RGB_VAD, RGB_VAI - ) - - -}; - - - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - - //switch (keycode) { - //case KC_P00: - // if (!record->event.pressed) { - // tap(KC_KP_0); - // tap(KC_KP_0); - // } - // return false; - // break; - //} - return true; -} - - - -void matrix_init_keymap(void) { - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); - - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); -} - - diff --git a/keyboards/viterbi/keymaps/drashna/rules.mk b/keyboards/viterbi/keymaps/drashna/rules.mk deleted file mode 100644 index ec3befc0b73..00000000000 --- a/keyboards/viterbi/keymaps/drashna/rules.mk +++ /dev/null @@ -1,25 +0,0 @@ -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -TAP_DANCE_ENABLE = no -RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = yes -NKRO_ENABLE = yes - -NO_SECRETS = yes -MACROS_ENABLED = yes -INDICATOR_LIGHTS = no -RGBLIGHT_TWINKLE = no - -LAYOUTS = ortho_5x7 - -# SRC := $(filter-out serial.c matrix.c i2c.c split_util.c,$(SRC)) -# SRC := $(filter-out serial.c,$(SRC)) -# SRC := $(filter-out matrix.c,$(SRC)) -# SRC := $(filter-out i2c.c,$(SRC)) -# SRC := $(filter-out split_util.c,$(SRC)) -# SRC += quantum/matrix.c - -BOOTLOADER = qmk-dfu diff --git a/keyboards/viterbi/keymaps/drashna_old/config.h b/keyboards/viterbi/keymaps/drashna_old/config.h deleted file mode 100644 index ddf9d1a40f4..00000000000 --- a/keyboards/viterbi/keymaps/drashna_old/config.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H - - -#ifdef RGBLIGHT_ENABLE -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 -#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 300 -#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 -#endif // RGBLIGHT_ENABLE - - -#undef LOCKING_SUPPORT_ENABLE -#undef LOCKING_RESYNC_ENABLE - -#ifndef NO_DEBUG -#define NO_DEBUG -#endif // !NO_DEBUG -#ifndef NO_PRINT -#define NO_PRINT -#endif // !NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#undef PRODUCT -#define PRODUCT Drashnas Viterbi Macro Pad - -#define USE_I2C - -#ifdef AUDIO_ENABLE -#define C6_AUDIO -#define NO_MUSIC_MODE -#endif - -#define LAYOUT_ortho_5x7( \ - L00, L01, L02, L03, L04, L05, L06, \ - L10, L11, L12, L13, L14, L15, L16, \ - L20, L21, L22, L23, L24, L25, L26, \ - L30, L31, L32, L33, L34, L35, L36, \ - L40, L41, L42, L43, L44, L45, L46 \ - ) \ - LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - L10, L11, L12, L13, L14, L15, L16, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - L20, L21, L22, L23, L24, L25, L26, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - L30, L31, L32, L33, L34, L35, L36, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - L40, L41, L42, L43, L44, L45, L46, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO \ - ) - -#endif - -#define QMK_ESC_OUTPUT F5 // usually COL -#define QMK_ESC_INPUT D4 // usually ROW -#define QMK_LED B0 -#define QMK_SPEAKER C6 diff --git a/keyboards/viterbi/keymaps/drashna_old/rules.mk b/keyboards/viterbi/keymaps/drashna_old/rules.mk deleted file mode 100644 index 14ac6a6b3c0..00000000000 --- a/keyboards/viterbi/keymaps/drashna_old/rules.mk +++ /dev/null @@ -1,28 +0,0 @@ -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -TAP_DANCE_ENABLE = no -RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = yes -NKRO_ENABLE = yes - -NO_SECRETS = yes -MACROS_ENABLED = yes -INDICATOR_LIGHTS = no -RGBLIGHT_TWINKLE = no - -LAYOUTS = ortho_5x7 - -# SRC := $(filter-out serial.c matrix.c i2c.c split_util.c,$(SRC)) -# SRC := $(filter-out serial.c,$(SRC)) -# SRC := $(filter-out matrix.c,$(SRC)) -# SRC := $(filter-out i2c.c,$(SRC)) -# SRC := $(filter-out split_util.c,$(SRC)) -# SRC += quantum/matrix.c - -USER_NAME := drashna -SRC += ../drashna/keymap.c - -BOOTLOADER = qmk-dfu diff --git a/keyboards/viterbi/keymaps/dwallace/keymap.c b/keyboards/viterbi/keymaps/dwallace/keymap.c deleted file mode 100644 index 24102448287..00000000000 --- a/keyboards/viterbi/keymaps/dwallace/keymap.c +++ /dev/null @@ -1,224 +0,0 @@ -#include "viterbi.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _FN 1 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - STK_SHIFT, - STK_CTRL, - STK_ALT, - STK_GUI, - STK_META, - STK_CLEAR, - RGB_LEVEL_UP, - RGB_LEVEL_DOWN, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_SWIN LGUI(KC_TILD) // Switch between windows -#define KC_SAPP LGUI(KC_TAB) // Switch between applications -#define KC_FN1 MO(_FN) -#define KC_LCAG LCAG(KC_NO) -#define KC_RTOG RGB_TOG -#define KC_RGUP RGB_LEVEL_UP -#define KC_RGDN RGB_LEVEL_DOWN -#define KC_RST RESET -#define KC_SSFT STK_SHIFT -#define KC_SCTL STK_CTRL -#define KC_SALT STK_ALT -#define KC_SGUI STK_GUI -#define KC_SMTA STK_META -#define KC_SCLR STK_CLEAR - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL ,BSPC, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - TAB , Q , W , E , R , T ,LBRC, Y , U , I , O , P ,BSLS,PGUP, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ESC , A , S , D , F , G ,RBRC, H , J , K , L ,SCLN,QUOT,ENT , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - SSFT, Z , X , C , V , B ,SWIN, N , M ,COMM,DOT , UP ,SLSH,RSFT, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - SCTL,SMTA,SALT,SGUI,SPC ,SCLR,SAPP, FN1 ,SPC ,RGUI,LEFT,DOWN,RGHT,PGDN - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_FN] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , ,RST , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , RTOG, ,RGDN,RGUP, , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , ,MUTE,VOLD,VOLU, , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ) - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool modifier_already_applied = false; -uint8_t physically_held_modifiers = 0; -uint8_t last_mods = 0xFF; -uint8_t rgb_dimming = 0; -#define SET_LED_RGB(val, led_num) setrgb(((val >> 16) & 0xFF) >> rgb_dimming, ((val >> 8) & 0xFF) >> rgb_dimming, (val & 0xFF) >> rgb_dimming, (LED_TYPE *)&led[led_num]) - -void update_underglow_level(void) { - if (get_mods() == last_mods) - return; - - last_mods = get_mods(); - - if (get_mods() == 0) { - uint8_t level = 0x10 >> rgb_dimming; - rgblight_setrgb(level, level, level); - return; - } - - uint32_t mod_colors[4] = {0}; - uint8_t mod_count = 0; - rgblight_setrgb(0x00, 0x00, 0x00); - - if (get_mods() & MOD_BIT(KC_LSFT)) - mod_colors[mod_count++] = 0xFF0000; - if (get_mods() & MOD_BIT(KC_LCTL)) - mod_colors[mod_count++] = 0x00FF00; - if (get_mods() & MOD_BIT(KC_LALT)) - mod_colors[mod_count++] = 0x0000FF; - if (get_mods() & MOD_BIT(KC_LGUI)) - mod_colors[mod_count++] = 0xFFFF00; - - uint8_t led_num = 0; - for (int m = 0; m < mod_count; m++) { - for (; led_num < RGBLED_NUM*(m+1)/mod_count; led_num++) { - SET_LED_RGB(mod_colors[m], led_num); - } - } - rgblight_set(); -} - -void add_sticky_modifier(uint16_t keycode) { - add_mods(MOD_BIT(keycode)); - register_code(keycode); - modifier_already_applied = false; -} - -void clear_sticky_modifiers(void) { - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); - unregister_code(KC_LALT); - unregister_code(KC_LGUI); - update_underglow_level(); -} - -void handle_sticky_modifier_event(uint16_t keycode, bool pressed) { - if (pressed) { - add_sticky_modifier(keycode); - physically_held_modifiers |= MOD_BIT(keycode); - } else { - del_mods(MOD_BIT(keycode)); - physically_held_modifiers &= ~MOD_BIT(keycode); - if (modifier_already_applied) { - clear_sticky_modifiers(); - } else { - add_sticky_modifier(keycode); - } - } - update_underglow_level(); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case STK_SHIFT: - handle_sticky_modifier_event(KC_LSFT, record->event.pressed); - return false; - break; - case STK_CTRL: - handle_sticky_modifier_event(KC_LCTL, record->event.pressed); - return false; - break; - case STK_ALT: - handle_sticky_modifier_event(KC_LALT, record->event.pressed); - return false; - break; - case STK_GUI: - handle_sticky_modifier_event(KC_LGUI, record->event.pressed); - return false; - break; - case STK_META: - handle_sticky_modifier_event(KC_LCTL, record->event.pressed); - handle_sticky_modifier_event(KC_LALT, record->event.pressed); - handle_sticky_modifier_event(KC_LGUI, record->event.pressed); - return false; - break; - case STK_CLEAR: - if (record->event.pressed) { - clear_sticky_modifiers(); - } - return false; - break; - case RGB_LEVEL_DOWN: - if (record->event.pressed && rgb_dimming < 8) { - rgb_dimming++; - } - return false; - break; - case RGB_LEVEL_UP: - if (record->event.pressed && rgb_dimming > 0) { - rgb_dimming--; - } - return false; - break; - } - if (!record->event.pressed && IS_KEY(keycode)) { - modifier_already_applied = true; - if (physically_held_modifiers == 0) - clear_sticky_modifiers(); - } - return true; -} - -void matrix_init_user(void) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable(); - #endif //RGBLIGHT_ENABLE -} - -void matrix_scan_user(void) { - #ifdef RGBLIGHT_ENABLE - update_underglow_level(); - #endif //RGBLIGHT_ENABLE -} diff --git a/keyboards/viterbi/keymaps/fido/keymap.c b/keyboards/viterbi/keymaps/fido/keymap.c deleted file mode 100644 index b8ef4600824..00000000000 --- a/keyboards/viterbi/keymaps/fido/keymap.c +++ /dev/null @@ -1,74 +0,0 @@ -#include "viterbi.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _FN 1 - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_FN1 MO(_FN) -#define KC_WD_L LCTL(KC_LEFT) -#define KC_WD_R LCTL(KC_RGHT) -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD -#define KC_RST RESET -#define KC_CTLZ LCTL(KC_Z) -#define KC_CTLX LCTL(KC_X) -#define KC_CTLC LCTL(KC_C) -#define KC_CTLV LCTL(KC_V) -#define KC_ATAB LALT(KC_TAB) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - 1 , 2 , 3 , 4 , 5 , 6 ,ESC , DEL , 7 , 8 , 9 , 0 ,MINS,EQL , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - RBRC, Q , W , E , R , T ,TAB , BSPC, Y , U , I , O , P ,LBRC, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - GRV , A , S , D , F , G ,LALT, CAPS, H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - BSLS, Z , X , C , V , B ,LSFT, RSFT, N , M ,COMM,DOT ,SLSH,ENT , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - INS ,PSCR,MENU,LGUI,LCTL,SPC ,FN1 , FN1 ,SPC ,RCTL,RALT, , , - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_FN] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - F1 , F2 , F3 , F4 , F5 , F6 , , , F7 , F8 , F9 ,F10 ,F11 ,F12 , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,PGUP,WD_L, UP ,WD_R, ,ATAB, ,RMOD,RHUI,RSAI,RVAI, , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,HOME,LEFT,DOWN,RGHT, , , , ,RHUD,RSAD,RVAD, , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,CTLZ,CTLX,CTLC,CTLV, , , ,MUTE,VOLD,VOLU, , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ) - -}; - -void led_set_user(uint8_t usb_led) { - #ifdef RGBLIGHT_ENABLE - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - rgblight_enable(); - } else { - rgblight_disable(); - } - #endif //RGBLIGHT_ENABLE -} diff --git a/keyboards/viterbi/keymaps/hexwire/config.h b/keyboards/viterbi/keymaps/hexwire/config.h deleted file mode 100644 index 7acf84510e6..00000000000 --- a/keyboards/viterbi/keymaps/hexwire/config.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#define TAPPING_TERM 150 - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/viterbi/keymaps/hexwire/keymap.c b/keyboards/viterbi/keymaps/hexwire/keymap.c deleted file mode 100644 index 2050c037933..00000000000 --- a/keyboards/viterbi/keymaps/hexwire/keymap.c +++ /dev/null @@ -1,218 +0,0 @@ -#include "viterbi.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _FN3 5 -#define _FN4 6 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - FN3, - FN4, - ADJUST, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen -#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen -#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen -#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen -#define KC_X0 MT(MOD_LCTL, KC_ESC) -#define KC_X1 LOWER -#define KC_X2 RAISE -#define KC_X3 LT(_FN3, KC_GRV) -#define KC_X4 MT(MOD_LSFT, KC_ENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , , 6 , 7 , 8 , 9 , 0 ,BSPC, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - TAB , Q , W , E , R , T , , Y , U , I , O , P ,MINS, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - X0 , A , S , D , F , G , , H , J , K , L ,SCLN,QUOT, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - LSFT, Z , X , C , V , B , , N , M ,COMM,DOT ,SLSH, X4 , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X1 ,SPC , , BSPC, X2 ,LEFT,DOWN, UP ,RGHT, - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_COLEMAK] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , , 6 , 7 , 8 , 9 , 0 ,BSPC, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - TAB , Q , W , F , P , G , , J , L , U , Y ,SCLN,MINS, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - X0 , A , R , S , T , D , , H , N , E , I , O ,QUOT, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - LSFT, Z , X , C , V , B , , K , M ,COMM,DOT ,SLSH, X4 , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X1 ,SPC , , BSPC, X2 ,LEFT,DOWN, UP ,RGHT, - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_DVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , , 6 , 7 , 8 , 9 , 0 ,BSPC, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - TAB ,QUOT,COMM,DOT , P , Y , , F , G , C , R , L ,MINS, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - X0 , A , O , E , U , I , , D , H , T , N , S ,SLSH, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - LSFT,SCLN, Q , J , K , X , , B , M , W , V , Z , X4 , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X1 ,SPC , , BSPC, X2 ,LEFT,DOWN, UP ,RGHT, - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, , CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , 1 , 2 , 3 , 4 , 5 , , 6 , 7 , 8 , 9 , 0 , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - DEL ,CAPP,LEFT,RGHT, UP ,LBRC, , RBRC, P4 , P5 , P6 ,PLUS,PIPE, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,CPYP, , ,DOWN,LCBR, , RCBR, P1 , P2 , P3 ,MINS, , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , DEL , , P0 ,PDOT, , , - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, , CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,EXLM, AT ,HASH,DLR ,PERC, , CIRC,AMPR,ASTR,LPRN,RPRN, , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, , EQL ,HOME, , , ,BSLS, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , PLUS,END , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_FN3] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , , F6 , F7 , F8 , F9 ,F10 ,F11 , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) - - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_colemak, false, 0); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_dvorak, false, 0); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/viterbi/keymaps/mike808/keymap.c b/keyboards/viterbi/keymaps/mike808/keymap.c deleted file mode 100644 index c7e48b135c5..00000000000 --- a/keyboards/viterbi/keymaps/mike808/keymap.c +++ /dev/null @@ -1,158 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _DVORAK 0 -#define _QWERTY 1 -#define _FN1 2 -#define _MOUSE 3 - -enum custom_keycodes { - DVORAK = SAFE_RANGE, - QWERTY, -}; - -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_DVOR DVORAK -#define KC_QWER QWERTY -#define KC_FN1 MO(_FN1) - -// Tap-Hold keys (QWERTY) -#define KC_S_C MT(MOD_LCTL, KC_S) -#define KC_D_A MT(MOD_LALT, KC_D) -#define KC_F_G MT(MOD_LGUI, KC_F) -#define KC_J_G MT(MOD_RGUI, KC_J) -#define KC_K_A MT(MOD_RALT, KC_K) -#define KC_L_C MT(MOD_RCTL, KC_L) - -// Tap-Hold keys (Dvorak) -#define KC_O_C MT(MOD_LCTL, KC_O) -#define KC_E_A MT(MOD_LALT, KC_E) -#define KC_U_G MT(MOD_LGUI, KC_U) -#define KC_H_G MT(MOD_RGUI, KC_H) -#define KC_T_A MT(MOD_RALT, KC_T) -#define KC_N_C MT(MOD_RCTL, KC_N) - -#define KC_G_A LGUI(KC_A) -#define KC_G_C LGUI(KC_C) -#define KC_G_V LGUI(KC_V) -#define KC_G_X LGUI(KC_X) -#define KC_G_Z LGUI(KC_Z) -#define KC_G_BL LGUI(KC_BSLS) -#define KC_G_TB LGUI(KC_TAB) -#define KC_G_SP LGUI(KC_SPC) - -#define KC_ENTM LT(_MOUSE, KC_ENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - DVOR,ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,PGUP, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - G_A ,TAB , Q , W , E , R , T , Y , U , I , O , P ,BSLS,PGDN, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - G_X ,CAPS, A ,S_C ,D_A ,F_G , G , H ,J_G ,K_A ,L_C ,SCLN,QUOT, UP , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - G_C ,LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,RSFT,DOWN, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - G_V ,FN1 ,G_TB,G_SP,BSPC,SPC ,SPC , ENTM,ENTM,G_Z ,GRV ,EQL ,LEFT,RGHT - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_DVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - QWER,ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,EQL ,PGUP, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - G_A ,TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH,PGDN, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - G_X ,CAPS, A ,O_C ,E_A ,U_G , I , D ,H_G ,T_A ,N_C , S ,MINS, UP , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - G_C ,LSFT,SCLN, Q , J , K , X , B , M , W , V , Z ,RSFT,DOWN, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - G_V ,FN1 ,G_TB,G_SP,BSPC,SPC ,SPC , ENTM,ENTM,G_Z ,GRV ,BSLS,LEFT,RGHT - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_FN1] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , ,EXLM, AT ,LCBR,RCBR,PIPE, , P7 , P8 , P9 ,ASTR,F12 , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , ,HASH,DLR ,LPRN,RPRN,GRV , , P4 , P5 , P6 ,PLUS,MINS, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , ,PERC,CIRC,LBRC,RBRC,TILD, AMPR, P1 , P2 , P3 ,SLSH, , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , ,PDOT, P0 ,EQL , , - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ), - - [_MOUSE] = LAYOUT_kc( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , , , , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , ,MS_U, , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , ,MS_L,MS_D,MS_R, , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , ,BTN1,BTN2, , , , , , , , - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' - ) -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -#endif - -void update_rgblight(uint16_t layer) { - if (layer & (1UL << _DVORAK)) { - rgblight_sethsv_green(); - } else if (layer & (1UL << _QWERTY)) { - rgblight_sethsv_goldenrod(); - } -} - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); - #ifdef RGBLIGHT_ENABLE - update_rgblight(default_layer); - #endif // RGBLIGHT_ENABLE -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - persistent_default_layer_set(1UL << _QWERTY); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_dvorak, false, 0); - #endif - persistent_default_layer_set(1UL << _DVORAK); - } - return false; - break; - } - return true; -} - - -void matrix_init_user(void) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable(); - uint8_t default_layer = eeconfig_read_default_layer(); - update_rgblight(default_layer); - #endif -} diff --git a/keyboards/viterbi/matrix.c b/keyboards/viterbi/matrix.c deleted file mode 100644 index c56b49c5ff5..00000000000 --- a/keyboards/viterbi/matrix.c +++ /dev/null @@ -1,454 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); - -} - -uint8_t _matrix_scan(void) -{ - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); -#if (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/viterbi/readme.md b/keyboards/viterbi/readme.md deleted file mode 100644 index 13f3e605662..00000000000 --- a/keyboards/viterbi/readme.md +++ /dev/null @@ -1,21 +0,0 @@ -Viterbi -======= - -A split 5x14 ortholinear keyboard kit made and sold by Keebio. [More info at Keebio](https://keeb.io) - -Keyboard Maintainer: [Bakingpy](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make viterbi/rev1:default - - -Example of flashing this keyboard: - - make viterbi/rev1:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -A build guide for this keyboard can be found here: [Viterbi Build Guide](https://docs.keeb.io) diff --git a/keyboards/viterbi/rev1/config.h b/keyboards/viterbi/rev1/config.h deleted file mode 100644 index d6a66408efa..00000000000 --- a/keyboards/viterbi/rev1/config.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1157 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT The Viterbi Keyboard -#define DESCRIPTION Split 5x14 ortholinear keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 7 - -// wiring of each half -#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } -#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 16 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/viterbi/rev1/rev1.c b/keyboards/viterbi/rev1/rev1.c deleted file mode 100644 index 5848375331e..00000000000 --- a/keyboards/viterbi/rev1/rev1.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "viterbi.h" - - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; diff --git a/keyboards/viterbi/rev1/rev1.h b/keyboards/viterbi/rev1/rev1.h deleted file mode 100644 index 9c03e495a9f..00000000000 --- a/keyboards/viterbi/rev1/rev1.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef REV1_H -#define REV1_H - -#include "../viterbi.h" - -//void promicro_bootloader_jmp(bool program); -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -//void promicro_bootloader_jmp(bool program); - -#ifndef FLIP_HALF -// Standard Keymap -// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { R06, R05, R04, R03, R02, R01, R00 }, \ - { R16, R15, R14, R13, R12, R11, R10 }, \ - { R26, R25, R24, R23, R22, R21, R20 }, \ - { R36, R35, R34, R33, R32, R31, R30 }, \ - { R46, R45, R44, R43, R42, R41, R40 } \ - } -#else -// Keymap with right side flipped -// (TRRS jack on both halves are to the right) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { R00, R01, R02, R03, R04, R05, R06 }, \ - { R10, R11, R12, R13, R14, R15, R16 }, \ - { R20, R21, R22, R23, R24, R25, R26 }, \ - { R30, R31, R32, R33, R34, R35, R36 }, \ - { R40, R41, R42, R43, R44, R45, R46 } \ - } -#endif - -#define LAYOUT_ortho_5x14 LAYOUT - -#endif diff --git a/keyboards/viterbi/rules.mk b/keyboards/viterbi/rules.mk deleted file mode 100644 index ee043cca3b4..00000000000 --- a/keyboards/viterbi/rules.mk +++ /dev/null @@ -1,76 +0,0 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -CUSTOM_MATRIX = yes - -DEFAULT_FOLDER = viterbi/rev1 - -LAYOUTS = ortho_5x14 diff --git a/keyboards/viterbi/serial.c b/keyboards/viterbi/serial.c deleted file mode 100644 index 74bcbb6bf6e..00000000000 --- a/keyboards/viterbi/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/viterbi/serial.h b/keyboards/viterbi/serial.h deleted file mode 100644 index 15fe4db7b4c..00000000000 --- a/keyboards/viterbi/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/viterbi/split_util.c b/keyboards/viterbi/split_util.c deleted file mode 100644 index 346cbc90894..00000000000 --- a/keyboards/viterbi/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/viterbi/viterbi.h b/keyboards/viterbi/viterbi.h deleted file mode 100644 index 80d2a8f25a6..00000000000 --- a/keyboards/viterbi/viterbi.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef VITERBI_H -#define VITERBI_H - -#ifdef KEYBOARD_viterbi_rev1 - #include "rev1.h" -#endif - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ - KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \ - ) - -#define LAYOUT_ortho_5x14 LAYOUT - -#include "quantum.h" - -#endif diff --git a/keyboards/waldo/config.h b/keyboards/waldo/config.h new file mode 100644 index 00000000000..c913ae77122 --- /dev/null +++ b/keyboards/waldo/config.h @@ -0,0 +1,77 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Greenwald Designs +#define PRODUCT Waldo +#define DESCRIPTION A 60% board +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6 } +#define MATRIX_COL_PINS { F7, D5, D3, D2, B3, B2, C7, C6, B6, B5, B4, D7, D6, D4, B1 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +// RGB LED +#define RGB_DI_PIN B0 // The pin the LED strip is connected to +#define RGBLED_NUM 10 // Number of LEDs in your strip diff --git a/keyboards/waldo/info.json b/keyboards/waldo/info.json new file mode 100644 index 00000000000..5cdc12d5ef5 --- /dev/null +++ b/keyboards/waldo/info.json @@ -0,0 +1,24 @@ +{ + "keyboard_name": "", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2}, {"x":13.75, "y":2, "w":1.25}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_hhkb": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}] + }, + + "LAYOUT_60_ansi_split_bs_rshift": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/waldo/keymaps/default/keymap.c b/keyboards/waldo/keymaps/default/keymap.c new file mode 100644 index 00000000000..2fcb3a1afbc --- /dev/null +++ b/keyboards/waldo/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum waldo_layers { + _BASE, + _FUNCTION +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_60_ansi( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FUNCTION), KC_RCTL \ + ), + + [_FUNCTION] = LAYOUT_60_ansi( \ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ) + +}; diff --git a/keyboards/waldo/keymaps/default/readme.md b/keyboards/waldo/keymaps/default/readme.md new file mode 100644 index 00000000000..440961939c8 --- /dev/null +++ b/keyboards/waldo/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The Default Waldo Layout + diff --git a/keyboards/waldo/keymaps/default/rules.mk b/keyboards/waldo/keymaps/default/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/waldo/keymaps/default_split_shft_bck/config.h b/keyboards/waldo/keymaps/default_split_shft_bck/config.h new file mode 100644 index 00000000000..19a485296eb --- /dev/null +++ b/keyboards/waldo/keymaps/default_split_shft_bck/config.h @@ -0,0 +1,5 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + + +#endif diff --git a/keyboards/waldo/keymaps/default_split_shft_bck/keymap.c b/keyboards/waldo/keymaps/default_split_shft_bck/keymap.c new file mode 100644 index 00000000000..4ef7da00191 --- /dev/null +++ b/keyboards/waldo/keymaps/default_split_shft_bck/keymap.c @@ -0,0 +1,97 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum waldo_layers { + _QWERTY, + _FUNC +}; + +enum waldo_keycodes { + QWERTY = SAFE_RANGE, + BACKLIT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | Del | + * |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backspace | + * |------------------------------------------------------------------------------------------| + * | Control | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |------------------------------------------------------------------------------------------| + * | L Shift | Z | X | C | V | B | N | M | , | . | / | R Shift | Fn | + * |------------------------+-----------------------------------------------------------------| + * | Ctrl | GUI | Alt | Space | GUI | Menu | Ctrl | + * `------------------------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT_60_ansi_split_bs_rshift( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FUNC), \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL \ +), + +/* Function + * ,------------------------------------------------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | + * |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | | | Up | | | Vol+| | | Prnt| PgUp|PgDwn| Up | | | + * |------------------------------------------------------------------------------------------| + * | Caps | left| down|right| | Vol-| | | Home| End | left|right| | + * |------------------------------------------------------------------------------------------| + * | |GBTOG|GBMOD|GBHUD|GBHUI|GBSAD|GBSAI|GBVAD|GBVAI| | down| | Fn | + * |------------------------+-----------------------------------------------------------------| + * | Backlit| | | | | | | + * `------------------------------------------------------------------------------------------' + */ + +[_FUNC] = LAYOUT_60_ansi_split_bs_rshift( \ + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ + _______, _______, KC_UP, _______, _______, KC_VOLU, _______, _______, KC_PSCR, KC_PGUP, KC_PGDN, KC_UP, _______, _______, \ + KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_VOLD, _______, _______, KC_HOME, KC_END, KC_LEFT, KC_RGHT, _______, \ + _______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DOWN, _______, KC_TRNS, \ + BACKLIT, _______, _______, _______, XXXXXXX, _______, _______, _______ \ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } + return false; + break; + } + return true; +} diff --git a/keyboards/waldo/keymaps/default_split_shft_bck/readme.md b/keyboards/waldo/keymaps/default_split_shft_bck/readme.md new file mode 100644 index 00000000000..bb4d32898ee --- /dev/null +++ b/keyboards/waldo/keymaps/default_split_shft_bck/readme.md @@ -0,0 +1,2 @@ +# The Default Waldo Layout w/ Split backspace, split shift, and 7u space + diff --git a/keyboards/waldo/keymaps/default_split_shft_bck/rules.mk b/keyboards/waldo/keymaps/default_split_shft_bck/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/keyboards/waldo/readme.md b/keyboards/waldo/readme.md new file mode 100644 index 00000000000..987b1fa4973 --- /dev/null +++ b/keyboards/waldo/readme.md @@ -0,0 +1,12 @@ +# Waldo + +A 60% Keyboard for use in the Holz case by Greenwald Designs + +Keyboard Maintainer: [That-Canadian](https://github.com/that-canadian) +Hardware Availability: https://store.projectkeyboard.com/products/waldo-pcb-60 + +Make example for this keyboard (after setting up your build environment): + + make waldo:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/waldo/rules.mk b/keyboards/waldo/rules.mk new file mode 100644 index 00000000000..40ac48474ed --- /dev/null +++ b/keyboards/waldo/rules.mk @@ -0,0 +1,65 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/waldo/waldo.c b/keyboards/waldo/waldo.c new file mode 100644 index 00000000000..33093d4bbd7 --- /dev/null +++ b/keyboards/waldo/waldo.c @@ -0,0 +1 @@ +#include "waldo.h" \ No newline at end of file diff --git a/keyboards/waldo/waldo.h b/keyboards/waldo/waldo.h new file mode 100644 index 00000000000..1e300f94250 --- /dev/null +++ b/keyboards/waldo/waldo.h @@ -0,0 +1,63 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_60_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ + k40, k41, k42, k46, k49, k4a, k4c, k4d \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, KC_NO, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, KC_NO, KC_NO }, \ + { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, k49, k4a, KC_NO, k4c, k4d, KC_NO } \ +} + +#define LAYOUT_60_hhkb( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k41, k42, k46, k49, k4a \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, KC_NO, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, KC_NO }, \ + { KC_NO, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, k49, k4a, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k41, k42, k46, k49, k4a, k4c, k4d \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, KC_NO, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, KC_NO }, \ + { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, k49, k4a, KC_NO, k4c, k4d, KC_NO } \ +} + +#define LAYOUT_all( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k41, k42, k44, k46, k48, k49, k4a, k4c, k4d \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, KC_NO }, \ + { k40, k41, k42, KC_NO, k44, KC_NO, k46, KC_NO, k48, k49, k4a, KC_NO, k4c, k4d } \ +} diff --git a/keyboards/wasdat/config.h b/keyboards/wasdat/config.h new file mode 100644 index 00000000000..b5c4d3bc2d1 --- /dev/null +++ b/keyboards/wasdat/config.h @@ -0,0 +1,256 @@ +/* +Copyright 2019 Maarten Dekkers + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Maartenwut +#define PRODUCT Wasdat +#define DESCRIPTION Custom controller for the WASD v2 TKL and 104 + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D6, D4, F6, F7, F4, F5, F0, F1 } +#define MATRIX_COL_PINS { } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL + +// For QMK DFU +#define QMK_ESC_OUTPUT D6 +#define QMK_ESC_INPUT D7 +#define QMK_LED B0 + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/wasdat/info.json b/keyboards/wasdat/info.json new file mode 100644 index 00000000000..8f931f46cf7 --- /dev/null +++ b/keyboards/wasdat/info.json @@ -0,0 +1,459 @@ +{ + "keyboard_name": "Wasdat", + "url": "https://maartenwut.com/product/wasdat/", + "maintainer": "Maartenwut", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT_fullsize_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + + {"label":"~", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"/", "x":19.5, "y":1.5}, + {"label":"*", "x":20.5, "y":1.5}, + {"label":"-", "x":21.5, "y":1.5}, + + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + + {"label":"7", "x":18.5, "y":2.5}, + {"label":"8", "x":19.5, "y":2.5}, + {"label":"9", "x":20.5, "y":2.5}, + {"label":"+", "x":21.5, "y":2.5, "h":2}, + + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + + {"label":"4", "x":18.5, "y":3.5}, + {"label":"5", "x":19.5, "y":3.5}, + {"label":"6", "x":20.5, "y":3.5}, + + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + + {"label":"\u2191", "x":16.25, "y":4.5}, + + {"label":"1", "x":18.5, "y":4.5}, + {"label":"2", "x":19.5, "y":4.5}, + {"label":"3", "x":20.5, "y":4.5}, + {"label":"Enter", "x":21.5, "y":4.5, "h":2}, + + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + + {"label":"\u2190", "x":15.25, "y":5.5}, + {"label":"\u2193", "x":16.25, "y":5.5}, + {"label":"\u2192", "x":17.25, "y":5.5}, + + {"label":"0", "x":18.5, "y":5.5, "w":2}, + {"label":".", "x":20.5, "y":5.5} + ] + }, + "LAYOUT_fullsize_iso": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + + {"label":"\u00ac", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"\"", "x":2, "y":1.5}, + {"label":"\u00a3", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"/", "x":19.5, "y":1.5}, + {"label":"*", "x":20.5, "y":1.5}, + {"label":"-", "x":21.5, "y":1.5}, + + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + + {"label":"7", "x":18.5, "y":2.5}, + {"label":"8", "x":19.5, "y":2.5}, + {"label":"9", "x":20.5, "y":2.5}, + {"label":"+", "x":21.5, "y":2.5, "h":2}, + + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"@", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + + {"label":"4", "x":18.5, "y":3.5}, + {"label":"5", "x":19.5, "y":3.5}, + {"label":"6", "x":20.5, "y":3.5}, + + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + + {"label":"\u2191", "x":16.25, "y":4.5}, + + {"label":"1", "x":18.5, "y":4.5}, + {"label":"2", "x":19.5, "y":4.5}, + {"label":"3", "x":20.5, "y":4.5}, + {"label":"Enter", "x":21.5, "y":4.5, "h":2}, + + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + + {"label":"\u2190", "x":15.25, "y":5.5}, + {"label":"\u2193", "x":16.25, "y":5.5}, + {"label":"\u2192", "x":17.25, "y":5.5}, + + {"label":"0", "x":18.5, "y":5.5, "w":2}, + {"label":".", "x":20.5, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + + {"label":"~", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + + {"label":"\u2191", "x":16.25, "y":4.5}, + + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + + {"label":"\u2190", "x":15.25, "y":5.5}, + {"label":"\u2193", "x":16.25, "y":5.5}, + {"label":"\u2192", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_iso": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + + {"label":"\u00ac", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"\"", "x":2, "y":1.5}, + {"label":"\u00a3", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"@", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + + {"label":"\u2191", "x":16.25, "y":4.5}, + + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + + {"label":"\u2190", "x":15.25, "y":5.5}, + {"label":"\u2193", "x":16.25, "y":5.5}, + {"label":"\u2192", "x":17.25, "y":5.5} + ] + } + } +} diff --git a/keyboards/wasdat/keymaps/default/keymap.c b/keyboards/wasdat/keymaps/default/keymap.c new file mode 100644 index 00000000000..967947ada4d --- /dev/null +++ b/keyboards/wasdat/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐   ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ + * │Esc│   │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Slk│Pse│ + * └───┘   └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp| |Ins|Hom|PgU| |Num| / | * | - | + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │  \  │ |Del|End|PgD| │ 7 │ 8 │ 9 │   │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ ├───┼───┼───┤ + │ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │  Enter │               │ 4 │ 5 │ 6 │   │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤     ┌───┐     ├───┼───┼───┼───┤ + * │ Shift  │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │    Shift │     │ ↑ │     │ 1 │ 2 │ 3 │   │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤Ent│ + * │Ctrl│GUI │Alt │                        │ Alt│ GUI│Menu│Ctrl│ │ ← │ ↓ │ → │ │   0   │ . │   │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘ + */ + LAYOUT_fullsize_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ) +}; diff --git a/keyboards/wasdat/keymaps/default/readme.md b/keyboards/wasdat/keymaps/default/readme.md new file mode 100644 index 00000000000..66cf593892c --- /dev/null +++ b/keyboards/wasdat/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default ANSI keymap for the Wasdat diff --git a/keyboards/wasdat/keymaps/default_iso/keymap.c b/keyboards/wasdat/keymaps/default_iso/keymap.c new file mode 100644 index 00000000000..00a45d746ac --- /dev/null +++ b/keyboards/wasdat/keymaps/default_iso/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2019 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐   ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ + * │Esc│   │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Slk│Pse│ + * └───┘   └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp| |Ins|Hom|PgU| |Num| / | * | - | + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │     │ |Del|End|PgD| │ 7 │ 8 │ 9 │   │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ └───┴───┴───┘ ├───┼───┼───┤ + │ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │    │               │ 4 │ 5 │ 6 │   │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤     ┌───┐     ├───┼───┼───┼───┤ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │    Shift │     │ ↑ │     │ 1 │ 2 │ 3 │   │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤Ent│ + * │Ctrl│GUI │Alt │                        │AlGr│ GUI│Menu│Ctrl│ │ ← │ ↓ │ → │ │   0   │ . │   │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘ + */ + LAYOUT_fullsize_iso( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ) +}; diff --git a/keyboards/wasdat/keymaps/default_iso/readme.md b/keyboards/wasdat/keymaps/default_iso/readme.md new file mode 100644 index 00000000000..e36d7642016 --- /dev/null +++ b/keyboards/wasdat/keymaps/default_iso/readme.md @@ -0,0 +1 @@ +# The default ISO keymap for the Wasdat diff --git a/keyboards/wasdat/keymaps/konstantin/config.h b/keyboards/wasdat/keymaps/konstantin/config.h new file mode 100644 index 00000000000..3c2583e2d46 --- /dev/null +++ b/keyboards/wasdat/keymaps/konstantin/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define LAYER_FN +#define LAYER_NUMPAD diff --git a/keyboards/wasdat/keymaps/konstantin/keymap.c b/keyboards/wasdat/keymaps/konstantin/keymap.c new file mode 100644 index 00000000000..4fb24a5e37a --- /dev/null +++ b/keyboards/wasdat/keymaps/konstantin/keymap.c @@ -0,0 +1,79 @@ +#include QMK_KEYBOARD_H +#include "konstantin.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐┌───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12││PSc│SLk│Pau│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘└───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐┌───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bspace ││Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ ││Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐Ent │└───┴───┴───┘ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ \ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ ┌───┐ + * │LSft│RAG│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ RShift │ │ ↑ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤┌───┼───┼───┐ + * │LCtl│LGui│LAlt│ Space │RAlt│RGui│FnLk│RCtl││ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘└───┴───┴───┘ + */ + [L_BASE] = LAYOUT_tkl_iso( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, RAL_RGU, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, FN_FNLK, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Function layer + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐┌───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ││ │Num│ │ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘└───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐┌───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Clear ││ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤├───┼───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│ ││ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │└───┴───┴───┘ + * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ ┌───┐ + * │ │ │MA0│MA2│MW←│MW→│ │ │App│Vo-│Vo+│Mut│ │ │PgU│ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤┌───┼───┼───┐ + * │ │DtPR│DtNA│ MW↓ │ │ │ │ ││Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘└───┴───┴───┘ + */ + [L_FN] = LAYOUT_tkl_iso( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NUMPAD, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, CLEAR, _______, _______, _______, + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, _______, _______, _______, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, KC_APP, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, + _______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), + + /* Numpad layer + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐┌───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ││ │Num│ │ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘└───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐┌───┬───┬───┐ + * │ │ │ │ │ │ │ │P7 │P8 │P9 │P- │ − │ = │ ││ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤├───┼───┼───┤ + * │ │ │ │ │ │ │ │P4 │P5 │P6 │P+ │ ( │ ) │ ││ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐PEnt│└───┴───┴───┘ + * │ │ │ │ │ │ │ │P1 │P2 │P3 │P* │ × │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ ┌───┐ + * │ │ │ │ │ │ │ │P0 │P0 │ , │P. │P/ │ ÷ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤┌───┼───┼───┐ + * │ │ │ │ │ │ │ │ ││ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘└───┴───┴───┘ + */ + [L_NUMPAD] = LAYOUT_tkl_iso( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NUMPAD, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, MINUS, EQUALS, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, L_PAREN, R_PAREN, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PAST, TIMES, _______, KC_PENT, + _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, COMMA, KC_PDOT, KC_PSLS, DIVIDE, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/wasdat/keymaps/konstantin/rules.mk b/keyboards/wasdat/keymaps/konstantin/rules.mk new file mode 100644 index 00000000000..041d3211459 --- /dev/null +++ b/keyboards/wasdat/keymaps/konstantin/rules.mk @@ -0,0 +1,10 @@ +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +SPACE_CADET_ENABLE = no +TAP_DANCE_ENABLE = yes +UNICODEMAP_ENABLE = yes diff --git a/keyboards/wasdat/matrix.c b/keyboards/wasdat/matrix.c new file mode 100644 index 00000000000..04d22197135 --- /dev/null +++ b/keyboards/wasdat/matrix.c @@ -0,0 +1,484 @@ +/* +Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#ifdef DIRECT_PINS +static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; +#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +//static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values +static matrix_row_t matrix[MATRIX_ROWS]; //debounced values + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +//Deprecated. +bool matrix_is_modified(void) +{ + if (debounce_active()) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "wasdat.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); + led_init_ports(); +} + +void led_init_ports(void) { + setPinOutput(B0); + setPinOutput(B1); + setPinOutput(B2); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(B0); + } else { + writePinHigh(B0); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinLow(B1); + } else { + writePinHigh(B1); + } + + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(B2); + } else { + writePinHigh(B2); + } + + led_set_user(usb_led); +} diff --git a/keyboards/wasdat/wasdat.h b/keyboards/wasdat/wasdat.h new file mode 100644 index 00000000000..508ada48531 --- /dev/null +++ b/keyboards/wasdat/wasdat.h @@ -0,0 +1,104 @@ +/* Copyright 2019 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define XXX KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_fullsize_ansi( \ + K05, K44, K42, K32, K02, K21, K0A, K3E, K4E, K4D, K2D, K0D, K7D, K23, K53, K51, \ + K45, K25, K24, K22, K20, K40, K48, K28, K2A, K2E, K2F, K4F, K4A, K3D, K47, K4C, K46, K69, K67, K66, K76, \ + K35, K55, K54, K52, K50, K30, K38, K58, K5A, K5E, K5F, K3F, K3A, K1D, K49, K2C, K26, K59, K57, K56, K5C, \ + K34, K15, K14, K12, K10, K00, K08, K18, K1A, K1E, K1F, K0F, K6D, K39, K37, K36, \ + K3B, K65, K64, K62, K60, K70, K78, K68, K6A, K6E, K7F, K1B, K0C, K19, K17, K16, K1C, \ + K41, K31, K03, K09, K73, K11, K33, K61, K7C, K79, K77, K07, K06 \ +) \ +{ \ + { K00, XXX, K02, K03, XXX, K05, K06, K07, K08, K09, K0A, XXX, K0C, K0D, XXX, K0F }, \ + { K10, K11, K12, XXX, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, XXX, K28, XXX, K2A, XXX, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, K3F }, \ + { K40, K41, K42, XXX, K44, K45, K46, K47, K48, K49, K4A, XXX, K4C, K4D, K4E, K4F }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, XXX, K5C, XXX, K5E, K5F }, \ + { K60, K61, K62, XXX, K64, K65, K66, K67, K68, K69, K6A, XXX, XXX, K6D, K6E, XXX }, \ + { K70, XXX, XXX, K73, XXX, XXX, K76, K77, K78, K79, XXX, XXX, K7C, K7D, XXX, K7F } \ +} + +#define LAYOUT_fullsize_iso( \ + K05, K44, K42, K32, K02, K21, K0A, K3E, K4E, K4D, K2D, K0D, K7D, K23, K53, K51, \ + K45, K25, K24, K22, K20, K40, K48, K28, K2A, K2E, K2F, K4F, K4A, K3D, K47, K4C, K46, K69, K67, K66, K76, \ + K35, K55, K54, K52, K50, K30, K38, K58, K5A, K5E, K5F, K3F, K3A, K49, K2C, K26, K59, K57, K56, K5C, \ + K34, K15, K14, K12, K10, K00, K08, K18, K1A, K1E, K1F, K0F, K1D, K6D, K39, K37, K36, \ + K3B, K04, K65, K64, K62, K60, K70, K78, K68, K6A, K6E, K7F, K1B, K0C, K19, K17, K16, K1C, \ + K41, K31, K03, K09, K73, K11, K33, K61, K7C, K79, K77, K07, K06 \ +) \ +{ \ + { K00, XXX, K02, K03, K04, K05, K06, K07, K08, K09, K0A, XXX, K0C, K0D, XXX, K0F }, \ + { K10, K11, K12, XXX, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, XXX, K28, XXX, K2A, XXX, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, K3F }, \ + { K40, K41, K42, XXX, K44, K45, K46, K47, K48, K49, K4A, XXX, K4C, K4D, K4E, K4F }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, XXX, K5C, XXX, K5E, K5F }, \ + { K60, K61, K62, XXX, K64, K65, K66, K67, K68, K69, K6A, XXX, XXX, K6D, K6E, XXX }, \ + { K70, XXX, XXX, K73, XXX, XXX, K76, K77, K78, K79, XXX, XXX, K7C, K7D, XXX, K7F } \ +} + +#define LAYOUT_tkl_ansi( \ + K05, K44, K42, K32, K02, K21, K0A, K3E, K4E, K4D, K2D, K0D, K7D, K23, K53, K51, \ + K45, K25, K24, K22, K20, K40, K48, K28, K2A, K2E, K2F, K4F, K4A, K3D, K47, K4C, K46, \ + K35, K55, K54, K52, K50, K30, K38, K58, K5A, K5E, K5F, K3F, K3A, K1D, K49, K2C, K26, \ + K34, K15, K14, K12, K10, K00, K08, K18, K1A, K1E, K1F, K0F, K6D, \ + K3B, K65, K64, K62, K60, K70, K78, K68, K6A, K6E, K7F, K1B, K0C, \ + K41, K31, K03, K09, K73, K11, K33, K61, K7C, K79, K77 \ +) \ +{ \ + { K00, XXX, K02, K03, XXX, K05, XXX, XXX, K08, K09, K0A, XXX, K0C, K0D, XXX, K0F }, \ + { K10, K11, K12, XXX, K14, K15, XXX, XXX, K18, XXX, K1A, K1B, XXX, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, XXX, K28, XXX, K2A, XXX, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, XXX, XXX, K38, XXX, K3A, K3B, XXX, K3D, K3E, K3F }, \ + { K40, K41, K42, XXX, K44, K45, K46, K47, K48, K49, K4A, XXX, K4C, K4D, K4E, K4F }, \ + { K50, K51, K52, K53, K54, K55, XXX, XXX, K58, XXX, K5A, XXX, XXX, XXX, K5E, K5F }, \ + { K60, K61, K62, XXX, K64, K65, XXX, XXX, K68, XXX, K6A, XXX, XXX, K6D, K6E, XXX }, \ + { K70, XXX, XXX, K73, XXX, XXX, XXX, K77, K78, K79, XXX, XXX, K7C, K7D, XXX, K7F } \ +} + +#define LAYOUT_tkl_iso( \ + K05, K44, K42, K32, K02, K21, K0A, K3E, K4E, K4D, K2D, K0D, K7D, K23, K53, K51, \ + K45, K25, K24, K22, K20, K40, K48, K28, K2A, K2E, K2F, K4F, K4A, K3D, K47, K4C, K46, \ + K35, K55, K54, K52, K50, K30, K38, K58, K5A, K5E, K5F, K3F, K3A, K49, K2C, K26, \ + K34, K15, K14, K12, K10, K00, K08, K18, K1A, K1E, K1F, K0F, K1D, K6D, \ + K3B, K04, K65, K64, K62, K60, K70, K78, K68, K6A, K6E, K7F, K1B, K0C, \ + K41, K31, K03, K09, K73, K11, K33, K61, K7C, K79, K77 \ +) \ +{ \ + { K00, XXX, K02, K03, K04, K05, XXX, XXX, K08, K09, K0A, XXX, K0C, K0D, XXX, K0F }, \ + { K10, K11, K12, XXX, K14, K15, XXX, XXX, K18, XXX, K1A, K1B, XXX, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, XXX, K28, XXX, K2A, XXX, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, XXX, XXX, K38, XXX, K3A, K3B, XXX, K3D, K3E, K3F }, \ + { K40, K41, K42, XXX, K44, K45, K46, K47, K48, K49, K4A, XXX, K4C, K4D, K4E, K4F }, \ + { K50, K51, K52, K53, K54, K55, XXX, XXX, K58, XXX, K5A, XXX, XXX, XXX, K5E, K5F }, \ + { K60, K61, K62, XXX, K64, K65, XXX, XXX, K68, XXX, K6A, XXX, XXX, K6D, K6E, XXX }, \ + { K70, XXX, XXX, K73, XXX, XXX, XXX, K77, K78, K79, XXX, XXX, K7C, K7D, XXX, K7F } \ +} diff --git a/keyboards/wavelet/config.h b/keyboards/wavelet/config.h deleted file mode 100644 index ac6c9669692..00000000000 --- a/keyboards/wavelet/config.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert -Copyright 2018 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCB10 -#define PRODUCT_ID 0x1046 -#define DEVICE_VER 0x0100 -#define MANUFACTURER Keebio -#define PRODUCT Wavelet -#define DESCRIPTION 40 percent ortholinear keyboard - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { F4, F5, F7, B3, D2, D1, D4, D7 } -#define MATRIX_COL_PINS { F6, B1, B2, B6, B4, E6 } - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 12 // Number of LEDs - -/* Backlight LEDs */ -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_LEVELS 7 - -#endif diff --git a/keyboards/wavelet/keymaps/default/keymap.c b/keyboards/wavelet/keymaps/default/keymap.c deleted file mode 100644 index dac8068a42a..00000000000 --- a/keyboards/wavelet/keymaps/default/keymap.c +++ /dev/null @@ -1,212 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - BL_STEP, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/wavelet/keymaps/default/rules.mk b/keyboards/wavelet/keymaps/default/rules.mk deleted file mode 100644 index d7463419b4f..00000000000 --- a/keyboards/wavelet/keymaps/default/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes diff --git a/keyboards/wavelet/readme.md b/keyboards/wavelet/readme.md deleted file mode 100644 index bacd57037d2..00000000000 --- a/keyboards/wavelet/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -Wavelet -======= - -A 4x12 ortholinear keyboard using Kailh Choc Low-Profile switches made and sold by [Keebio](https://keeb.io). - -Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro -Hardware Availability: [Keebio](https://keeb.io) - -Make example for this keyboard (after setting up your build environment): - - make wavelet:default - -Example of flashing this keyboard: - - make wavelet:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -A build guide for this keyboard can be found here: [Levinson Build Guide](https://docs.keeb.io) diff --git a/keyboards/westfoxtrot/aanzee/aanzee.c b/keyboards/westfoxtrot/aanzee/aanzee.c new file mode 100644 index 00000000000..17efdbe88da --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/aanzee.c @@ -0,0 +1,55 @@ +/* Copyright 2019 westfoxtrot + +* + +* This program is free software: you can redistribute it and/or modify + +* it under the terms of the GNU General Public License as published by + +* the Free Software Foundation, either version 2 of the License, or + +* (at your option) any later version. + +* + +* This program is distributed in the hope that it will be useful, + +* but WITHOUT ANY WARRANTY; without even the implied warranty of + +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + +* GNU General Public License for more details. + +* + +* You should have received a copy of the GNU General Public License + +* along with this program. If not, see . + +*/ + +#include "aanzee.h" + +void keyboard_pre_init_kb(void) { + + // Call the keyboard pre init code. + // Set our LED pins as output + setPinOutput(B2); + + keyboard_pre_init_user(); +} + +void led_set_kb(uint8_t usb_led) { + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + + // Turn capslock on + writePinLow(B2); + } else { + + // Turn capslock off + writePinHigh(B2); + } + + led_set_user(usb_led); +} diff --git a/keyboards/westfoxtrot/aanzee/aanzee.h b/keyboards/westfoxtrot/aanzee/aanzee.h new file mode 100644 index 00000000000..aa1b9165606 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/aanzee.h @@ -0,0 +1,65 @@ +/* Copyright 2019 westfoxtrot +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ +#ifndef AANZEE_H +#define AANZEE_H + +#define ___ KC_NO + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. +* +* The first section contains all of the arguments representing the physical +* layout of the board and position of the keys. +* +* The second converts the arguments into a two-dimensional array which +* represents the switch matrix. +*/ +// readability + +#define LAYOUT_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0F, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K49, K4A, K4C, K4D, K4E \ +) \ +{ \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, ___}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, ___, K2D, K2E, ___}, \ + {K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, ___}, \ + {K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, ___, K4C, K4D, K4E, ___} \ +} +#define LAYOUT_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K49, K4A, K4C, K4D, K4E \ +) \ +{ \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, ___}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, ___, K1E, ___}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, ___}, \ + {K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, ___}, \ + {K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, ___, K4C, K4D, K4E, ___} \ +} + +void matrix_init_user(void); +void matrix_scan_user(void); + +#endif diff --git a/keyboards/westfoxtrot/aanzee/config.h b/keyboards/westfoxtrot/aanzee/config.h new file mode 100644 index 00000000000..d88101fdc85 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/config.h @@ -0,0 +1,142 @@ +/* +Copyright 2019 westfoxtrot + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x21FF +#define PRODUCT_ID 0xAA01 +#define DEVICE_VER 0x0001 +#define MANUFACTURER westfoxtrot +#define PRODUCT aanzee +#define DESCRIPTION QMK Firmware for the Aanzee PCB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS {B4,D7,D6,D4,B3} +#define MATRIX_COL_PINS {D2,D1,D0,D3,D5,C7,C6,B6,B5,F0,F1,F4,F5,F6,F7,B0} +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +#define RGB_DI_PIN E6 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 9 + #define RGBLIGHT_HUE_STEP 12 + #define RGBLIGHT_SAT_STEP 25 + #define RGBLIGHT_VAL_STEP 12 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif +#define RGBW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +#define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + + +//dynamic keymap and via support + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 675 // **** CHANGE THIS BASED ON MATRIX_ROWS & MATRIX_COLS **** +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 349 // **** CHANGE THIS BASED ON 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR **** +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/westfoxtrot/aanzee/info.json b/keyboards/westfoxtrot/aanzee/info.json new file mode 100644 index 00000000000..96d0c1c36c3 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/info.json @@ -0,0 +1,17 @@ +{ + "keyboard_name": "aanzee", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "key_count": 68, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"\u21e7 Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"Fn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + }, + "LAYOUT_iso": { + "key_count": 68, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"x":13.75, "y":1, "w":1.25, "h":2}, {"label":"PgUp", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"PgDn", "x":15, "y":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"Fn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +} diff --git a/keyboards/westfoxtrot/aanzee/keymaps/default/config.h b/keyboards/westfoxtrot/aanzee/keymaps/default/config.h new file mode 100644 index 00000000000..35ebb6871d6 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 westfoxtrot +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#pragma once + +// place overrides here diff --git a/keyboards/westfoxtrot/aanzee/keymaps/default/keymap.c b/keyboards/westfoxtrot/aanzee/keymaps/default/keymap.c new file mode 100644 index 00000000000..e2b75bc860b --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* Copyright 2019 westfoxtrot +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +#define _MA 0 +#define _F1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_MA] = LAYOUT_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_DEL, KC_HOME,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_END, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH,KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_F1), KC_LEFT,KC_DOWN,KC_RGHT), + + [_F1] = LAYOUT_ansi( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,_______,_______, \ + _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______,_______,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______,_______,_______, _______, _______,_______,_______,_______, _______) + }; + + void matrix_init_user(void) { + //user initialization + } + + void matrix_scan_user(void) { + //user matrix + } + + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; + } diff --git a/keyboards/westfoxtrot/aanzee/keymaps/default/readme.md b/keyboards/westfoxtrot/aanzee/keymaps/default/readme.md new file mode 100644 index 00000000000..77137f2f004 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for aanzee \ No newline at end of file diff --git a/keyboards/westfoxtrot/aanzee/keymaps/iso-default/config.h b/keyboards/westfoxtrot/aanzee/keymaps/iso-default/config.h new file mode 100644 index 00000000000..386a2fd57de --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/iso-default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 westfoxtrot +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#pragma once + +// place overrides here diff --git a/keyboards/westfoxtrot/aanzee/keymaps/iso-default/keymap.c b/keyboards/westfoxtrot/aanzee/keymaps/iso-default/keymap.c new file mode 100644 index 00000000000..4ea02795805 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/iso-default/keymap.c @@ -0,0 +1,48 @@ +/* Copyright 2019 westfoxtrot +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +#define _MA 0 +#define _F1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_MA] = LAYOUT_iso( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_HOME,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC, KC_END, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT,KC_NUHS, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH,KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_F1), KC_LEFT,KC_DOWN, KC_RGHT), + + [_F1] = LAYOUT_iso( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______,_______,_______) + }; + + void matrix_init_user(void) { + //user initialization + } + + void matrix_scan_user(void) { + //user matrix + } + + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; + } diff --git a/keyboards/westfoxtrot/aanzee/keymaps/iso-default/readme.md b/keyboards/westfoxtrot/aanzee/keymaps/iso-default/readme.md new file mode 100644 index 00000000000..77137f2f004 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/iso-default/readme.md @@ -0,0 +1 @@ +# The default keymap for aanzee \ No newline at end of file diff --git a/keyboards/westfoxtrot/aanzee/keymaps/via/config.h b/keyboards/westfoxtrot/aanzee/keymaps/via/config.h new file mode 100644 index 00000000000..35ebb6871d6 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/via/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 westfoxtrot +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#pragma once + +// place overrides here diff --git a/keyboards/westfoxtrot/aanzee/keymaps/via/keymap.c b/keyboards/westfoxtrot/aanzee/keymaps/via/keymap.c new file mode 100644 index 00000000000..1ac5c77fff1 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/via/keymap.c @@ -0,0 +1,48 @@ +/* Copyright 2019 westfoxtrot +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +#define _MA 0 +#define _F1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_MA] = LAYOUT_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_DEL, KC_HOME,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_END, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH,KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_F1) ,KC_LEFT,KC_DOWN, KC_RGHT), + + [_F1] = LAYOUT_ansi( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,_______,_______, \ + _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______,_______,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______,_______,_______, _______, _______,_______ ,_______,_______, _______) + }; + + void matrix_init_user(void) { + //user initialization + } + + void matrix_scan_user(void) { + //user matrix + } + + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; + } diff --git a/keyboards/westfoxtrot/aanzee/keymaps/via/readme.md b/keyboards/westfoxtrot/aanzee/keymaps/via/readme.md new file mode 100644 index 00000000000..d5c8b708def --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/via/readme.md @@ -0,0 +1 @@ +# The default keymap for aanzee with via support diff --git a/keyboards/westfoxtrot/aanzee/keymaps/via/rules.mk b/keyboards/westfoxtrot/aanzee/keymaps/via/rules.mk new file mode 100644 index 00000000000..bcc5dc530a4 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/keymaps/via/rules.mk @@ -0,0 +1,69 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID + +#add files needed for via + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +SRC += keyboards/wilba_tech/wt_main.c diff --git a/keyboards/westfoxtrot/aanzee/readme.md b/keyboards/westfoxtrot/aanzee/readme.md new file mode 100644 index 00000000000..7d47b048ea6 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/readme.md @@ -0,0 +1,15 @@ +# aanzee + +[aanzee](https://cablecardesigns.co/portfolio-posts/aanzee) + +custom pcb for the aanzee keyboard + + Keyboard Maintainer: [westfoxtrot](https://github.com/westfoxtrot) + Hardware Supported: aanzee PCB + Hardware Availability: with group buy + +Make example for this keyboard (after setting up your build environment): + + make westfoxtrot/aanzee:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/westfoxtrot/aanzee/rules.mk b/keyboards/westfoxtrot/aanzee/rules.mk new file mode 100644 index 00000000000..4ba66a5f788 --- /dev/null +++ b/keyboards/westfoxtrot/aanzee/rules.mk @@ -0,0 +1,64 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID + diff --git a/keyboards/westfoxtrot/cyclops/config.h b/keyboards/westfoxtrot/cyclops/config.h new file mode 100644 index 00000000000..3af6070310a --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/config.h @@ -0,0 +1,207 @@ +/* +Copyright 2018 westfoxtrot + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x21FF +#define PRODUCT_ID 0x0A66 +#define DEVICE_VER 0x0001 +#define MANUFACTURER westfoxtrot +#define PRODUCT cyclops +#define DESCRIPTION AEK66 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D1, D0, D7, B4, F0 } +#define MATRIX_COL_PINS { D3, D2, D5, D6, B6, B1, B2, B3, C6, C7, F7, F6, F4, F5, F1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/westfoxtrot/cyclops/cyclops.c b/keyboards/westfoxtrot/cyclops/cyclops.c new file mode 100644 index 00000000000..aea51e6b349 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/cyclops.c @@ -0,0 +1,43 @@ +/* Copyright 2018 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "cyclops.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/westfoxtrot/cyclops/cyclops.h b/keyboards/westfoxtrot/cyclops/cyclops.h new file mode 100644 index 00000000000..d82c56744cd --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/cyclops.h @@ -0,0 +1,43 @@ +/* Copyright 2018 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef CYCLOPS_H +#define CYCLOPS_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K4D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4E, K2E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \ +} + +#endif diff --git a/keyboards/westfoxtrot/cyclops/info.json b/keyboards/westfoxtrot/cyclops/info.json new file mode 100644 index 00000000000..a215a8a3de7 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "cyclops", + "url": "", + "maintainer": "qmk", + "width": 16.5, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Page Up", "x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Page Down", "x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.5}, {"label":"|", "x":1.5, "y":3}, {"label":"Z", "x":2.5, "y":3}, {"label":"X", "x":3.5, "y":3}, {"label":"C", "x":4.5, "y":3}, {"label":"V", "x":5.5, "y":3}, {"label":"B", "x":6.5, "y":3}, {"label":"N", "x":7.5, "y":3}, {"label":"M", "x":8.5, "y":3}, {"label":"<", "x":9.5, "y":3}, {"label":">", "x":10.5, "y":3}, {"label":"?", "x":11.5, "y":3}, {"x":12.5, "y":3}, {"label":"Shift", "x":13.5, "y":3}, {"label":"\u2191", "x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4, "w":1.25}, {"label":"Alt", "x":2.75, "y":4, "w":1.5}, {"x":4.25, "y":4, "w":6.5}, {"label":"Alt", "x":10.75, "y":4, "w":1.5}, {"label":"Ctrl", "x":12.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13.5, "y":4}, {"label":"\u2193", "x":14.5, "y":4}, {"label":"\u2192", "x":15.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/westfoxtrot/cyclops/keymaps/default/config.h b/keyboards/westfoxtrot/cyclops/keymaps/default/config.h new file mode 100644 index 00000000000..6278fae6585 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 'mechmerlin' + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/westfoxtrot/cyclops/keymaps/default/keymap.c b/keyboards/westfoxtrot/cyclops/keymaps/default/keymap.c new file mode 100644 index 00000000000..c850b9da061 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/keymaps/default/keymap.c @@ -0,0 +1,53 @@ +/* Copyright 2018 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, KC_UP, + KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F11, KC_DEL, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/westfoxtrot/cyclops/keymaps/default/readme.md b/keyboards/westfoxtrot/cyclops/keymaps/default/readme.md new file mode 100644 index 00000000000..b1e2b84a3bf --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for cyclops diff --git a/keyboards/westfoxtrot/cyclops/readme.md b/keyboards/westfoxtrot/cyclops/readme.md new file mode 100644 index 00000000000..e026c411947 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/readme.md @@ -0,0 +1,15 @@ +# cyclops + +![cyclops](https://github.com/westfoxtrot/Cyclops) + +66% Alps Keyboard in ISO layout. + + Keyboard Maintainer: [westfoxtrot](https://github.com/westfoxtrot) + Hardware Supported: Cyclops (AEKISO66) PCB + Hardware Availability: Files released here (https://github.com/westfoxtrot/Cyclops) + +Make example for this keyboard (after setting up your build environment): + + make westfoxtrot/cyclops:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/westfoxtrot/cyclops/rules.mk b/keyboards/westfoxtrot/cyclops/rules.mk new file mode 100644 index 00000000000..10ea5139109 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) \ No newline at end of file diff --git a/keyboards/westfoxtrot/cypher/config.h b/keyboards/westfoxtrot/cypher/config.h new file mode 100644 index 00000000000..13788370377 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/config.h @@ -0,0 +1,66 @@ +/* +Copyright 2019 westfoxtrot + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x21FF +#define PRODUCT_ID 0xAA97 +#define DEVICE_VER 0x0001 +#define MANUFACTURER westfoxtrot +#define PRODUCT cypher +#define DESCRIPTION Cypher + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 10 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, F6, B6, B7, C6, C7 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7, E6, F0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +#define GRAVE_ESC_CTRL_OVERRIDE diff --git a/keyboards/westfoxtrot/cypher/cypher.c b/keyboards/westfoxtrot/cypher/cypher.c new file mode 100644 index 00000000000..d2407525ea5 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/cypher.c @@ -0,0 +1,56 @@ +/* Copyright 2019 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "cypher.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(F4); + } else { + writePinLow(F4); + } + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(F1); + } else { + writePinLow(F1); + } + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(F5); + } else { + writePinLow(F5); + } + led_set_user(usb_led); +} diff --git a/keyboards/westfoxtrot/cypher/cypher.h b/keyboards/westfoxtrot/cypher/cypher.h new file mode 100644 index 00000000000..fdff12e9b18 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/cypher.h @@ -0,0 +1,68 @@ +/* Copyright 2019 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#define ___ KC_NO + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, K51, K52, K53, K54, K55, K56, K57, K58,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K60, K61, K62, K63, K65, K66, K67, K68, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K70, K71, K73, K75, K76, K77, K78, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K80, K81, K82, K83, K85, K86, K87, K88, \ + K40, K41, K42, K46, K49, K90, K91, K92, K93, K95, K96, K97, K98 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29 }, \ + { K30, ___, K32, K33, K34, K35, K36, K37, K38, K39 }, \ + { K40, K41, K42, ___, ___, ___, K46, ___, ___, K49 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, ___, K65, K66, K67, K68 }, \ + { K70, K71, ___, K73, ___, K75, K76, K77, K78 }, \ + { K80, K81, K82, K83, ___, K85, K86, K87, K88 }, \ + { K90, K91, K92, K93, ___, K95, K96, K97, K98 } \ +} + +#define LAYOUT_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, K51, K52, K53, K54, K55, K56, K57, K58,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K60, K61, K62, K65, K66, K67, K68, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K70, K71, K72, K73, K75, K76, K77, K78, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K80, K81, K82, K83, K85, K86, K87, K88, \ + K40, K41, K42, K46, K49, K90, K91, K92, K93, K95, K96, K97, K98 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39 }, \ + { K40, K41, K42, ___, ___, ___, K46, ___, ___, K49 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, ___, ___, K65, K66, K67, K68 }, \ + { K70, K71, K72, K73, ___, K75, K76, K77, K78 }, \ + { K80, K81, K82, K83, ___, K85, K86, K87, K88 }, \ + { K90, K91, K92, K93, ___, K95, K96, K97, K98 } \ +} diff --git a/keyboards/westfoxtrot/cypher/info.json b/keyboards/westfoxtrot/cypher/info.json new file mode 100644 index 00000000000..ddf4e9d5a81 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/info.json @@ -0,0 +1,207 @@ +{ + "keyboard_name": "Cypher", + "width": 19.5, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [ + {"label":"~","x":0,"y":0}, + {"label":"!","x":1,"y":0}, + {"label":"@","x":2,"y":0}, + {"label":"#","x":3,"y":0}, + {"label":"$","x":4,"y":0}, + {"label":"%","x":5,"y":0}, + {"label":"^","x":6,"y":0}, + {"label":"&","x":7,"y":0}, + {"label":"*","x":8,"y":0}, + {"label":"(","x":9,"y":0}, + {"label":")","x":10,"y":0}, + {"label":"_","x":11,"y":0}, + {"label":"+","x":12,"y":0}, + {"label":"Backspace","x":13,"y":0}, + {"label":"~","x":14,"y":0}, + + {"label":"Num Lock","x":15.5,"y":0}, + {"label":"/","x":16.5,"y":0}, + {"label":"*","x":17.5,"y":0}, + {"label":"-","x":18.5,"y":0}, + + {"label":"Tab","x":0,"y":1,"w":1.5}, + {"label":"Q","x":1.5,"y":1}, + {"label":"W","x":2.5,"y":1}, + {"label":"E","x":3.5,"y":1}, + {"label":"R","x":4.5,"y":1}, + {"label":"T","x":5.5,"y":1}, + {"label":"Y","x":6.5,"y":1}, + {"label":"U","x":7.5,"y":1}, + {"label":"I","x":8.5,"y":1}, + {"label":"O","x":9.5,"y":1}, + {"label":"P","x":10.5,"y":1}, + {"label":"{","x":11.5,"y":1}, + {"label":"}","x":12.5,"y":1}, + {"label":"|","x":13.5,"y":1,"w":1.5}, + + {"label":"7","x":15.5,"y":1}, + {"label":"8","x":16.5,"y":1}, + {"label":"9","x":17.5,"y":1}, + {"label":"+","x":18.5,"y":1}, + + {"label":"Caps Lock","x":0,"y":2,"w":1.75}, + {"label":"A","x":1.75,"y":2}, + {"label":"S","x":2.75,"y":2}, + {"label":"D","x":3.75,"y":2}, + {"label":"F","x":4.75,"y":2}, + {"label":"G","x":5.75,"y":2}, + {"label":"H","x":6.75,"y":2}, + {"label":"J","x":7.75,"y":2}, + {"label":"K","x":8.75,"y":2}, + {"label":"L","x":9.75,"y":2}, + {"label":":","x":10.75,"y":2}, + {"label":"\"","x":11.75,"y":2}, + {"label":"Enter","x":12.75,"y":2,"w":2.25}, + + {"label":"4","x":15.5,"y":2}, + {"label":"5","x":16.5,"y":2}, + {"label":"6","x":17.5,"y":2}, + {"label":"=","x":18.5,"y":2}, + + {"label":"Shift","x":0,"y":3,"w":2.25}, + {"label":"Z","x":2.25,"y":3}, + {"label":"X","x":3.25,"y":3}, + {"label":"C","x":4.25,"y":3}, + {"label":"V","x":5.25,"y":3}, + {"label":"B","x":6.25,"y":3}, + {"label":"N","x":7.25,"y":3}, + {"label":"M","x":8.25,"y":3}, + {"label":"<","x":9.25,"y":3}, + {"label":">","x":10.25,"y":3}, + {"label":"?","x":11.25,"y":3}, + {"label":"Shift","x":12.25,"y":3,"w":1.75}, + + {"label":"Up","x":14.25,"y":3.25}, + + {"label":"1","x":15.5,"y":3}, + {"label":"2","x":16.5,"y":3}, + {"label":"3","x":17.5,"y":3}, + {"label":"Enter","x":18.5,"y":3}, + + {"label":"Ctrl","x":0,"y":4,"w":1.25}, + {"label":"Win","x":1.25,"y":4}, + {"label":"Alt","x":2.25,"y":4,"w":1.25}, + {"label":"Space","x":3.5,"y":4,"w":6}, + {"label":"Alt","x":9.5,"y":4,"w":1.25}, + {"label":"Win","x":10.75,"y":4}, + {"label":"Ctrl","x":11.75,"y":4,"w":1.25}, + + {"label":"Left","x":13.25,"y":4.25}, + {"label":"Down","x":14.25,"y":4.25}, + {"label":"Right","x":15.25,"y":4.25}, + + {"label":"0","x":16.5,"y":4}, + {"label":".","x":17.5,"y":4}, + {"label":"Backspace","x":18.5,"y":4} + ] + }, + + "LAYOUT_iso": { + "layout": [ + {"label":"~","x":0,"y":0}, + {"label":"!","x":1,"y":0}, + {"label":"@","x":2,"y":0}, + {"label":"#","x":3,"y":0}, + {"label":"$","x":4,"y":0}, + {"label":"%","x":5,"y":0}, + {"label":"^","x":6,"y":0}, + {"label":"&","x":7,"y":0}, + {"label":"*","x":8,"y":0}, + {"label":"(","x":9,"y":0}, + {"label":")","x":10,"y":0}, + {"label":"_","x":11,"y":0}, + {"label":"+","x":12,"y":0}, + {"label":"Backspace","x":13,"y":0}, + {"label":"~","x":14,"y":0}, + + {"label":"Num Lock","x":15.5,"y":0}, + {"label":"/","x":16.5,"y":0}, + {"label":"*","x":17.5,"y":0}, + {"label":"-","x":18.5,"y":0}, + + {"label":"Tab","x":0,"y":1,"w":1.5}, + {"label":"Q","x":1.5,"y":1}, + {"label":"W","x":2.5,"y":1}, + {"label":"E","x":3.5,"y":1}, + {"label":"R","x":4.5,"y":1}, + {"label":"T","x":5.5,"y":1}, + {"label":"Y","x":6.5,"y":1}, + {"label":"U","x":7.5,"y":1}, + {"label":"I","x":8.5,"y":1}, + {"label":"O","x":9.5,"y":1}, + {"label":"P","x":10.5,"y":1}, + {"label":"{","x":11.5,"y":1}, + {"label":"}","x":12.5,"y":1}, + + {"label":"7","x":15.5,"y":1}, + {"label":"8","x":16.5,"y":1}, + {"label":"9","x":17.5,"y":1}, + {"label":"+","x":18.5,"y":1}, + + {"label":"Caps Lock","x":0,"y":2,"w":1.75}, + {"label":"A","x":1.75,"y":2}, + {"label":"S","x":2.75,"y":2}, + {"label":"D","x":3.75,"y":2}, + {"label":"F","x":4.75,"y":2}, + {"label":"G","x":5.75,"y":2}, + {"label":"H","x":6.75,"y":2}, + {"label":"J","x":7.75,"y":2}, + {"label":"K","x":8.75,"y":2}, + {"label":"L","x":9.75,"y":2}, + {"label":":","x":10.75,"y":2}, + {"label":"\"","x":11.75,"y":2}, + {"label":"~","x":12.75,"y":2}, + {"label":"Enter","x":13.75,"y":1,"w":1.25,"h":2}, + + {"label":"4","x":15.5,"y":2}, + {"label":"5","x":16.5,"y":2}, + {"label":"6","x":17.5,"y":2}, + {"label":"=","x":18.5,"y":2}, + + {"label":"Shift","x":0,"y":3,"w":1.25}, + {"label":"|","x":1.25,"y":3}, + {"label":"Z","x":2.25,"y":3}, + {"label":"X","x":3.25,"y":3}, + {"label":"C","x":4.25,"y":3}, + {"label":"V","x":5.25,"y":3}, + {"label":"B","x":6.25,"y":3}, + {"label":"N","x":7.25,"y":3}, + {"label":"M","x":8.25,"y":3}, + {"label":"<","x":9.25,"y":3}, + {"label":">","x":10.25,"y":3}, + {"label":"?","x":11.25,"y":3}, + {"label":"Shift","x":12.25,"y":3,"w":1.75}, + + {"label":"Up","x":14.25,"y":3.25}, + + {"label":"1","x":15.5,"y":3}, + {"label":"2","x":16.5,"y":3}, + {"label":"3","x":17.5,"y":3}, + {"label":"Enter","x":18.5,"y":3}, + + {"label":"Ctrl","x":0,"y":4,"w":1.25}, + {"label":"Win","x":1.25,"y":4}, + {"label":"Alt","x":2.25,"y":4,"w":1.25}, + {"label":"Space","x":3.5,"y":4,"w":6}, + {"label":"Alt","x":9.5,"y":4,"w":1.25}, + {"label":"Win","x":10.75,"y":4}, + {"label":"Ctrl","x":11.75,"y":4,"w":1.25}, + + {"label":"Left","x":13.25,"y":4.25}, + {"label":"Down","x":14.25,"y":4.25}, + {"label":"Right","x":15.25,"y":4.25}, + + {"label":"0","x":16.5,"y":4}, + {"label":".","x":17.5,"y":4}, + {"label":"Backspace","x":18.5,"y":4} + ] + } + } +} diff --git a/keyboards/westfoxtrot/cypher/keymaps/default-iso/config.h b/keyboards/westfoxtrot/cypher/keymaps/default-iso/config.h new file mode 100644 index 00000000000..41d70907ebd --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default-iso/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/westfoxtrot/cypher/keymaps/default-iso/keymap.c b/keyboards/westfoxtrot/cypher/keymaps/default-iso/keymap.c new file mode 100644 index 00000000000..2a08ae853b5 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default-iso/keymap.c @@ -0,0 +1,49 @@ +/* Copyright 2019 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _MA 0 +#define _F1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_iso( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, KC_PPLS,\ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PEQL,\ + KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,\ + KC_LCTRL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_F1), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT, KC_BSPC), + +[_F1] = LAYOUT_iso( /* Function Layer */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______,\ + _______, BL_TOGG,BL_STEP,BL_ON,BL_OFF,BL_INC,BL_DEC,BL_BRTG,_______,_______,_______,_______, _______, _______, _______, _______, _______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______, _______, _______, _______,\ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______,_______, _______, _______,_______,_______, _______,_______,_______, _______, _______, _______), + +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/westfoxtrot/cypher/keymaps/default-iso/readme.md b/keyboards/westfoxtrot/cypher/keymaps/default-iso/readme.md new file mode 100644 index 00000000000..81a4a677fd7 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default-iso/readme.md @@ -0,0 +1 @@ +# The default iso keymap for cypher diff --git a/keyboards/westfoxtrot/cypher/keymaps/default/config.h b/keyboards/westfoxtrot/cypher/keymaps/default/config.h new file mode 100644 index 00000000000..41d70907ebd --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/westfoxtrot/cypher/keymaps/default/keymap.c b/keyboards/westfoxtrot/cypher/keymaps/default/keymap.c new file mode 100644 index 00000000000..1906f939694 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default/keymap.c @@ -0,0 +1,49 @@ +/* Copyright 2019 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define _MA 0 +#define _F1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MA] = LAYOUT_ansi( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS,\ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PEQL,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,\ + KC_LCTRL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_F1), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT, KC_BSPC), + +[_F1] = LAYOUT_ansi( /* Function Layer */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______,\ + _______, BL_TOGG,BL_STEP,BL_ON,BL_OFF,BL_INC,BL_DEC,BL_BRTG,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______,\ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______,_______, _______, _______,_______,_______, _______,_______,_______, _______, _______, _______), + +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/westfoxtrot/cypher/keymaps/default/readme.md b/keyboards/westfoxtrot/cypher/keymaps/default/readme.md new file mode 100644 index 00000000000..05c37002666 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for cypher \ No newline at end of file diff --git a/keyboards/westfoxtrot/cypher/keymaps/kwer/config.h b/keyboards/westfoxtrot/cypher/keymaps/kwer/config.h new file mode 100644 index 00000000000..947e340c323 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/kwer/config.h @@ -0,0 +1,33 @@ +/* Copyright 2018 westfoxtrot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define RGB_DI_PIN F7 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 15 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 15 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 5 + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #endif + +// place overrides here diff --git a/keyboards/westfoxtrot/cypher/keymaps/kwer/keymap.c b/keyboards/westfoxtrot/cypher/keymaps/kwer/keymap.c new file mode 100644 index 00000000000..2d7bf2a5e21 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/kwer/keymap.c @@ -0,0 +1,79 @@ +/* Copyright 2018 westfoxtrot + * Copyright 2019 kwerdenker + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "keymap_german.h" + +#define _DL 0 +#define _FN 1 +#define _LE 2 + +#define SPECIAL LT(_FN, DE_CIRC) //capslock layer switch + stargate key on tap + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_DL] = LAYOUT_iso ( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DE_SS, DE_ACUT, KC_BSPC, _______, KC_NLCK, KC_PSCR,KC_PSLS,KC_PAST, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, DE_PLUS, KC_P7, KC_P8, KC_P9, KC_PMNS, + SPECIAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_OE, DE_AE, DE_HASH, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, DE_LESS, DE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, _______, KC_LALT, KC_SPC, _______, KC_RALT, TG(_LE), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_NO + ), + + [_FN] = LAYOUT_iso ( + DE_RING, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_LE] = LAYOUT_iso ( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,_______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + + + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + // Insert custom handling for CAPS_LOCK, NUM_LOCK, SCROLL_LOCK here + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(F4); + writePinHigh(F1); + writePinHigh(F5); + } else { + writePinLow(F4); + writePinLow(F1); + writePinLow(F5); + } +} diff --git a/keyboards/westfoxtrot/cypher/keymaps/kwer/readme.md b/keyboards/westfoxtrot/cypher/keymaps/kwer/readme.md new file mode 100644 index 00000000000..c1a132e713b --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/kwer/readme.md @@ -0,0 +1,39 @@ +# The kwer keymap and RGB MOD for cypher + +![](https://i.imgur.com/b7snIju.jpg) + +## Hardware +To make this mod, all you need a piece of WS2812b RGB strip (I used one with 144 LEDs per meter, so it's rather dense), some wiring (I used 0.6mm solid core wire) and steady hands for soldering to the MCU pin. + +**Installed mod** +![](https://i.imgur.com/IKcFd0k.jpg) + +As you can see, the wiring is relatively simple. VCC and GND can be easily accessed through the ISP header on the right side of the spacebar while the DATA line can be routed relatively easy through one of the stabilizer holes. While it isn't important where exactly you solder the VCC/GND wires to their respective lines on the strip, you have to keep the direction of the data line in mind. Most strip have arrows printed on them to show you in which direction the data is shifted through the LEDs and your should always solder your DATA line on the _from_ side, as seen in the above picture. + +**Close-up for the VCC/GND connections** +![](https://i.imgur.com/K0OibwW.jpg) + +Since there is no pinout availble for the pin we're gonna use to control the strip, the line has to be soldered to the MCU directly. While this is not a very complex process, you should have a fine tipped soldering irong and a steady hand. Make sure you do not bridge any of the neighboring pins when soldering the wire to the MCU pin. As shown in the picture below, you want to connect the DATA line to the third pin from the right on the top of the controller chip. + +**Close-up for the DATA connection** +![](https://i.imgur.com/zkD3RjF.jpg) + +## Software +To enable your RGB strip in QMK, you have to add change/add the following lines + +**rules.​mk** +``` +[...] +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +[...] +``` + +**config.h** +``` +[...] +#define RGB_DI_PIN F7 +#define RGBLED_NUM 15 // Change this number to the amount of LEDs on the strip you soldered +#define RGBLIGHT_ANIMATIONS +[...] +``` +To control the RGB color, animation, etc. you need to add the appropriate keycodes to your keymap. Either see [my keymap](./keymap.c) or the [official QMK documentation](https://docs.qmk.fm/#/feature_rgblight?id=keycodes) for references. diff --git a/keyboards/westfoxtrot/cypher/keymaps/kwer/rules.mk b/keyboards/westfoxtrot/cypher/keymaps/kwer/rules.mk new file mode 100644 index 00000000000..df87c59a233 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/keymaps/kwer/rules.mk @@ -0,0 +1,2 @@ +# Build options override +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow diff --git a/keyboards/westfoxtrot/cypher/readme.md b/keyboards/westfoxtrot/cypher/readme.md new file mode 100644 index 00000000000..6db417fae88 --- /dev/null +++ b/keyboards/westfoxtrot/cypher/readme.md @@ -0,0 +1,15 @@ +# cypher + +![cypher](https://github.com/westfoxtrot/Cypher_PCB) + +PCB for the cypher keyboard + +Keyboard Maintainer: [westfoxtrot](https://github.com/westfoxtrot) +Hardware Supported: Cypher PCB +Hardware Availability: with group buy + Files released here (https://github.com/westfoxtrot/Cypher_PCB) + +Make example for this keyboard (after setting up your build environment): + + make westfoxtrot/cypher:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/westfoxtrot/cypher/rules.mk b/keyboards/westfoxtrot/cypher/rules.mk new file mode 100644 index 00000000000..63cbd36756a --- /dev/null +++ b/keyboards/westfoxtrot/cypher/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) diff --git a/keyboards/whitefox/board_is31fl3731c.h b/keyboards/whitefox/board_is31fl3731c.h index dea643f107c..d59b2ff43a6 100644 --- a/keyboards/whitefox/board_is31fl3731c.h +++ b/keyboards/whitefox/board_is31fl3731c.h @@ -31,7 +31,7 @@ static const uint8_t led_mask[] = { 0xFF, 0x00, /* C6-1 -> C6-16 */ 0xFF, 0x00, /* C7-1 -> C7-16 */ 0xFF, 0x00, /* C8-1 -> C8-16 */ - 0xFE, 0x00, /* C9-1 -> C9-16 */ + 0xFF, 0x00, /* C9-1 -> C9-16 */ }; // The address of the LED diff --git a/keyboards/whitefox/config.h b/keyboards/whitefox/config.h index a8047cf54f4..87af4edcfcb 100644 --- a/keyboards/whitefox/config.h +++ b/keyboards/whitefox/config.h @@ -46,11 +46,6 @@ along with this program. If not, see . /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* Keymap for Infinity prototype */ //#define INFINITY_PROTOTYPE diff --git a/keyboards/whitefox/keymaps/billypython/config.h b/keyboards/whitefox/keymaps/billypython/config.h new file mode 100644 index 00000000000..4b511eb8484 --- /dev/null +++ b/keyboards/whitefox/keymaps/billypython/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define LAYER_FN diff --git a/keyboards/whitefox/keymaps/billypython/keymap.c b/keyboards/whitefox/keymaps/billypython/keymap.c new file mode 100644 index 00000000000..79758de8073 --- /dev/null +++ b/keyboards/whitefox/keymaps/billypython/keymap.c @@ -0,0 +1,46 @@ +#include QMK_KEYBOARD_H +#include "billypython.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │SftCtl│ ↑ │PgD│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │LCtl│LGui│LAlt│ Space │RAlt│FnLk│ │ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_BASE] = LAYOUT_truefox( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_PSCR, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSF_RCT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│Scr│Pau│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │PgU│ ↑ │PgD│Ply│Prv│Nxt│Clear│Ins│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │M← │M↓ │M→ │MW↑│ │Hom│ ← │ ↓ │ → │End│ │ │Top│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │MA0│MA2│MW←│MW→│ │ │ │VoD│VoU│Mut│ App │PgU│Btm│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ MW↓ │ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_FN] = LAYOUT_truefox( \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NLCK, KC_SLCK, KC_PAUS, \ + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, KC_PGUP, KC_UP, KC_PGDN, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \ + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, _______, TOP, \ + _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, \ + _______, _______, _______, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), +}; diff --git a/keyboards/whitefox/keymaps/billypython/rules.mk b/keyboards/whitefox/keymaps/billypython/rules.mk new file mode 100644 index 00000000000..133c7af542f --- /dev/null +++ b/keyboards/whitefox/keymaps/billypython/rules.mk @@ -0,0 +1,6 @@ +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +TAP_DANCE_ENABLE = yes +VISUALIZER_ENABLE = no diff --git a/keyboards/whitefox/keymaps/default/keymap.c b/keyboards/whitefox/keymaps/default/keymap.c index ad66ec10310..61cc4eca0f3 100644 --- a/keyboards/whitefox/keymaps/default/keymap.c +++ b/keyboards/whitefox/keymaps/default/keymap.c @@ -35,7 +35,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, KC_DEL, \ KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT, KC_PGUP,\ KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, KC_PGDN,\ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_FN0, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(1), KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \ ), [1] = LAYOUT( \ KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS,KC_TRNS,KC_MUTE,\ @@ -45,7 +45,3 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_HOME,KC_PGDN,KC_END \ ), }; - -const uint16_t fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), -}; diff --git a/keyboards/whitefox/keymaps/dudeofawesome/keymap.c b/keyboards/whitefox/keymaps/dudeofawesome/keymap.c index 8c94df2c14f..2388201b7e9 100644 --- a/keyboards/whitefox/keymaps/dudeofawesome/keymap.c +++ b/keyboards/whitefox/keymaps/dudeofawesome/keymap.c @@ -119,10 +119,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -// const uint16_t fn_actions[] = { -// [0] = ACTION_LAYER_MOMENTARY(1), -// }; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: diff --git a/keyboards/whitefox/keymaps/jetpacktuxedo/rules.mk b/keyboards/whitefox/keymaps/jetpacktuxedo/rules.mk index 8eb483103c3..c9c8cbea51c 100644 --- a/keyboards/whitefox/keymaps/jetpacktuxedo/rules.mk +++ b/keyboards/whitefox/keymaps/jetpacktuxedo/rules.mk @@ -1,5 +1,2 @@ -ifndef QUANTUM_DIR - include ../../../Makefile -endif - BACKLIGHT_ENABLE = yes + diff --git a/keyboards/whitefox/keymaps/kim-kim/keymap.c b/keyboards/whitefox/keymaps/kim-kim/keymap.c index 200098603c7..1e6149899fb 100644 --- a/keyboards/whitefox/keymaps/kim-kim/keymap.c +++ b/keyboards/whitefox/keymaps/kim-kim/keymap.c @@ -20,9 +20,7 @@ along with this program. If not, see . #include QMK_KEYBOARD_H // Fillers to make layering more clear -#define _______ KC_TRNS #define ___T___ KC_TRNS -#define XXXXXXX KC_NO const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer @@ -70,24 +68,3 @@ const uint16_t fn_actions[] = { [7] = ACTION_USAGE_CONSUMER(0x1A0), }; - -/* custom action function */ -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - /* - (void)opt; - switch(id) { - case ACTION_LEDS_ALL: - if(record->event.pressed) { - // signal the LED controller thread - chMBPost(&led_mailbox, LED_MSG_GAME_TOGGLE, TIME_IMMEDIATE); - } - break; - case ACTION_LEDS_GAME: - if(record->event.pressed) { - // signal the LED controller thread - chMBPost(&led_mailbox, LED_MSG_ALL_TOGGLE, TIME_IMMEDIATE); - } - break; - } - */ -} diff --git a/keyboards/whitefox/keymaps/konstantin/config.h b/keyboards/whitefox/keymaps/konstantin/config.h index 39450d68026..3c2583e2d46 100644 --- a/keyboards/whitefox/keymaps/konstantin/config.h +++ b/keyboards/whitefox/keymaps/konstantin/config.h @@ -1,17 +1,4 @@ #pragma once -#define FORCE_NKRO - -#define MOUSEKEY_DELAY 50 -#define MOUSEKEY_INTERVAL 15 -#define MOUSEKEY_MAX_SPEED 4 -#define MOUSEKEY_TIME_TO_MAX 50 -#define MOUSEKEY_WHEEL_MAX_SPEED 1 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 - -#define PERMISSIVE_HOLD -#define TAPPING_TERM 200 -#define TAPPING_TOGGLE 2 - -#undef IS_COMMAND -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) +#define LAYER_FN +#define LAYER_NUMPAD diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c index edb049287c2..3874bcd18d2 100644 --- a/keyboards/whitefox/keymaps/konstantin/keymap.c +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -1,144 +1,67 @@ #include QMK_KEYBOARD_H - -#define FN MO(L_FN) -#define FN_CAPS LT(L_FN, KC_CAPS) -#define FN_RCTL TD(TD_FN_RCTL) // Unused -#define RLALT TD(TD_RLALT) // Unused -#define DESKTOP TD(TD_DESKTOP) - -#define DESKT_L LCTL(LGUI(KC_LEFT)) -#define DESKT_R LCTL(LGUI(KC_RGHT)) -#define TOP LCTL(KC_HOME) -#define BOTTOM LCTL(KC_END) - -#define UC_COMM UC(0x002C) -#define UC_LPRN UC(0x0028) -#define UC_RPRN UC(0x0029) -#define UC_EQLS UC(0x003D) -#define UC_MULS UC(0x00D7) -#define UC_DIVS UC(0x00F7) -#define UC_MINS UC(0x2212) - -void matrix_init_user(void) { - set_unicode_input_mode(UC_WINC); -} - -enum layers { - L_BASE, - L_FN, - L_NUMPAD, -}; - -enum custom_keycodes { - CLEAR = SAFE_RANGE, - NUMPAD, -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case CLEAR: - if (record->event.pressed) { SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); } - return false; - - case NUMPAD: - if (record->event.pressed) { - layer_invert(L_NUMPAD); - bool num_lock = host_keyboard_leds() & 1<count & 1) { layer_on(L_FN); } - if (state->count & 2) { register_code(KC_RCTL); } -} - -void td_fn_rctl_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count & 1) { layer_off(L_FN); } - if (state->count & 2) { unregister_code(KC_RCTL); } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_FN_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_fn_rctl_finished, td_fn_rctl_reset), - [TD_RLALT] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_LALT), - [TD_DESKTOP] = ACTION_TAP_DANCE_DOUBLE(LCTL(LGUI(KC_D)), LCTL(LGUI(KC_F4))), // Add/close virtual desktop -}; - -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base layer - * ,---------------------------------------------------------------. - * |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |PSc| - * |---------------------------------------------------------------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] |Bspc |Del| - * |---------------------------------------------------------------| - * |FnCaps| A | S | D | F | G | H | J | K | L | ; | ' | Enter |PgU| - * |---------------------------------------------------------------| - * | LShift | Z | X | C | V | B | N | M | , | . | / |RCtrl | ↑ |PgD| - * |---------------------------------------------------------------| - * |LCtl|LGui|LAlt| Space |RAlt| Fn | | ← | ↓ | → | - * `---------------------------------------------------------------' - */ - [L_BASE] = LAYOUT_truefox( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_GRV, KC_PSCR, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, KC_DEL, \ - FN_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RCTL, KC_UP, KC_PGDN, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,FN, KC_LEFT,KC_DOWN,KC_RGHT \ - ), - - /* Function layer - * ,---------------------------------------------------------------. - * | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Num|Scr|Pau| - * |---------------------------------------------------------------| - * | M4 |M2 |M↑ |M1 |M3 |M5 | | | |Stp|Ply|Prv|Nxt|Clear|Ins| - * |---------------------------------------------------------------| - * | |M← |M↓ |M→ |MW↑| | | | | | | | |Top| - * |---------------------------------------------------------------| - * | |MA0|MA2|MW←|MW→| | | |VoD|VoU|Mut| App |PgU|Btm| - * |---------------------------------------------------------------| - * | |Dstp|Dst←| MW↓ |Dst→| | |Hom|PgD|End| - * `---------------------------------------------------------------' - */ - [L_FN] = LAYOUT_truefox( \ - _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK,KC_PAUS, \ - KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,_______,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ - _______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \ - _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_APP, KC_PGUP,BOTTOM, \ - _______,DESKTOP,DESKT_L, KC_WH_D, DESKT_R,_______, KC_HOME,KC_PGDN,KC_END \ - ), - - /* Numpad layer - * ,---------------------------------------------------------------. - * |Num| | | | | | |P7 |P8 |P9 |P- | − | = |Num| | | - * |---------------------------------------------------------------| - * | | | | | | | |P4 |P5 |P6 |P+ | ( | ) | | | - * |---------------------------------------------------------------| - * | | | | | | | |P1 |P2 |P3 |P* | × | PEnter | | - * |---------------------------------------------------------------| - * | | | | | | |P0 |P0 | , |P. |P/ | ÷ | | | - * |---------------------------------------------------------------| - * | | | | | | | | | | | - * `---------------------------------------------------------------' - */ - [L_NUMPAD] = LAYOUT_truefox( \ - NUMPAD, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,UC_MINS,UC_EQLS,NUMPAD, _______,_______, \ - _______,_______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,UC_LPRN,UC_RPRN,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PAST,UC_MULS, KC_PENT, _______, \ - _______, _______,_______,_______,_______,_______,KC_P0, KC_P0, UC_COMM,KC_PDOT,KC_PSLS,UC_DIVS, _______,_______, \ - _______,_______,_______, _______, _______,_______, _______,_______,_______ \ - ), +#include "konstantin.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RSfRCt│ ↑ │PgD│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │LCtl│LGui│LAlt│ Space │RAlG│FnLk│ │ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_BASE] = LAYOUT_truefox( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_PSCR, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSF_RCT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│SLk│Pau│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│Ins│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │Top│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │MA0│MA2│MW←│MW→│ │ │App│Vo-│Vo+│Mut│ │PgU│Btm│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_FN] = LAYOUT_truefox( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK, KC_PAUS, + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, + _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, KC_APP, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, BOTTOM, + _______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END + ), + + /* Numpad layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │P7 │P8 │P9 │P- │ − │ = │Num│ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ │ │ │ │ │ │ │P4 │P5 │P6 │P+ │ ( │ ) │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │P1 │P2 │P3 │P* │ × │ PEnter │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │P0 │P0 │ , │P. │P/ │ ÷ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_NUMPAD] = LAYOUT_truefox( + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, MINUS, EQUALS, NUMPAD, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, L_PAREN, R_PAREN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PAST, TIMES, KC_PENT, _______, + _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, COMMA, KC_PDOT, KC_PSLS, DIVIDE, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), }; diff --git a/keyboards/whitefox/keymaps/konstantin/rules.mk b/keyboards/whitefox/keymaps/konstantin/rules.mk index f1f3d2378e6..bced6e8a707 100644 --- a/keyboards/whitefox/keymaps/konstantin/rules.mk +++ b/keyboards/whitefox/keymaps/konstantin/rules.mk @@ -1,4 +1,11 @@ -BOOTMAGIC_ENABLE = no -CONSOLE_ENABLE = yes -TAP_DANCE_ENABLE = yes -UNICODE_ENABLE = yes +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +SPACE_CADET_ENABLE = no +TAP_DANCE_ENABLE = yes +UNICODEMAP_ENABLE = yes +VISUALIZER_ENABLE = no diff --git a/keyboards/whitefox/keymaps/matt3o/keymap.c b/keyboards/whitefox/keymaps/matt3o/keymap.c index 136ae65fabf..76fb72f8e3e 100644 --- a/keyboards/whitefox/keymaps/matt3o/keymap.c +++ b/keyboards/whitefox/keymaps/matt3o/keymap.c @@ -69,24 +69,3 @@ const uint16_t fn_actions[] = { [7] = ACTION_USAGE_CONSUMER(0x1A0), }; - -/* custom action function */ -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - /* - (void)opt; - switch(id) { - case ACTION_LEDS_ALL: - if(record->event.pressed) { - // signal the LED controller thread - chMBPost(&led_mailbox, LED_MSG_GAME_TOGGLE, TIME_IMMEDIATE); - } - break; - case ACTION_LEDS_GAME: - if(record->event.pressed) { - // signal the LED controller thread - chMBPost(&led_mailbox, LED_MSG_ALL_TOGGLE, TIME_IMMEDIATE); - } - break; - } - */ -} diff --git a/keyboards/whitefox/readme.md b/keyboards/whitefox/readme.md index 2de1d4c7d83..9b848a69d5d 100644 --- a/keyboards/whitefox/readme.md +++ b/keyboards/whitefox/readme.md @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make whitefox:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/whitefox/rules.mk b/keyboards/whitefox/rules.mk index 9f222bf4f30..d9aa911c54e 100644 --- a/keyboards/whitefox/rules.mk +++ b/keyboards/whitefox/rules.mk @@ -55,6 +55,7 @@ ARMV = 7 OPT_DEFS = DFU_ARGS = -d 1c11:b007 +DFU_SUFFIX_ARGS = -p b007 -v 1c11 # Build Options # comment out to disable the options. diff --git a/keyboards/wilba_tech/rama_works_koyu/config.h b/keyboards/wilba_tech/rama_works_koyu/config.h new file mode 100644 index 00000000000..7fcfe08be03 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_koyu/config.h @@ -0,0 +1,142 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "config_common.h" + +// USB Device descriptor parameter +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x4B59 // "KY" +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA WORKS +#define PRODUCT RAMA WORKS KOYU +#define DESCRIPTION RAMA WORKS KOYU + + + +// key matrix size +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +// KOYU PCB pin-out +#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 72 + +// COL2ROW or ROW2COL +#define DIODE_DIRECTION COL2ROW + +// Set 0 if debouncing isn't needed +#define DEBOUNCE 5 + +// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap +#define LOCKING_SUPPORT_ENABLE +// Locking resynchronize hack +#define LOCKING_RESYNC_ENABLE + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +// disable debug print +//#define NO_DEBUG + +// disable print +//#define NO_PRINT + +// disable action features +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for KOYU specifics +#define RGB_BACKLIGHT_KOYU + +// enable/disable LEDs based on layout +// they aren't really used if RGB_BACKLIGHT_M60_A defined +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111100000000111 + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*5*15*2)) = (66+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 666 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 358 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/rama_works_koyu/info.json b/keyboards/wilba_tech/rama_works_koyu/info.json new file mode 100644 index 00000000000..430bc6fed8e --- /dev/null +++ b/keyboards/wilba_tech/rama_works_koyu/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "RAMA WORKS KOYU", + "url": "http://rama.works", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Num Lock", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Insert", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Home", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"/", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Ctrl", "x":11, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/wilba_tech/rama_works_koyu/keymaps/default/keymap.c b/keyboards/wilba_tech/rama_works_koyu/keymaps/default/keymap.c new file mode 100644 index 00000000000..f6bc94fbd60 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_koyu/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + MO(1), KC_LGUI, KC_LALT, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/wilba_tech/rama_works_koyu/rama_works_koyu.c b/keyboards/wilba_tech/rama_works_koyu/rama_works_koyu.c new file mode 100644 index 00000000000..03d1e121597 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_koyu/rama_works_koyu.c @@ -0,0 +1,18 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef RGB_BACKLIGHT_KOYU +#error RGB_BACKLIGHT_KOYU not defined, you done goofed somehao, brah +#endif diff --git a/keyboards/wilba_tech/rama_works_koyu/rama_works_koyu.h b/keyboards/wilba_tech/rama_works_koyu/rama_works_koyu.h new file mode 100644 index 00000000000..f51bc5c6137 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_koyu/rama_works_koyu.h @@ -0,0 +1,42 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" +#include "keyboards/wilba_tech/wt_rgb_backlight_keycodes.h" +#include "keyboards/wilba_tech/via_keycodes.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 2,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 16 columns, +// so the numbering goes 00 to 14. Deal with it. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K407, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, ____, K411, K412, K413, K414 } \ +} diff --git a/keyboards/wilba_tech/rama_works_koyu/readme.md b/keyboards/wilba_tech/rama_works_koyu/readme.md new file mode 100644 index 00000000000..11fa3bacf6e --- /dev/null +++ b/keyboards/wilba_tech/rama_works_koyu/readme.md @@ -0,0 +1,23 @@ +# RAMA WORKS KOYU + +![RAMA WORKS KOYU](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/5b8bd6e6b8a045c95eac2003/1535891375794/RW-KOYU-A-RENDER-04-TOP.1335.jpg?format=1500w) + +The 'wait' for something isn't the most conscious desire, but that anticipation creates nostalgia. + +At Rama Works, you've embraced this. From updates of the blog, to direct communication with the community, being part of a Rama Works product doesn't just start when you receive it. If you've ever received a Rama Works product, you know that no detail is overlooked. + +Let us take you on a journey that will capture that sensory experience, and explore the gravitational interaction between aesthetic and design. The Rama Works 'X' element personifies the understanding that taking something away doesn't necessarily make it less. + +This is the sound of Rama Works. Never too busy-a feeling of delightful modern weightlessness. A rich sonic experience. Sparse and ethereal, this music boldly inhabits a nondescript, borderless space. Warm, synthetic textures, bespoke musical sound design. percussive elements percolating and accentuating movement on the screen and in the stereo field. a sonic palette full of clicks, taps and resonances evoking a sense of calm comfort and familiarity. + +[More info at RAMA WORKS](https://rama.works/koyu/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA WORKS KOYU PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/rama_works_koyu:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/wilba_tech/rama_works_koyu/rules.mk b/keyboards/wilba_tech/rama_works_koyu/rules.mk new file mode 100644 index 00000000000..9839602247b --- /dev/null +++ b/keyboards/wilba_tech/rama_works_koyu/rules.mk @@ -0,0 +1,80 @@ + + +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes + +#LAYOUTS = ??? diff --git a/keyboards/wilba_tech/rama_works_m10_b/config.h b/keyboards/wilba_tech/rama_works_m10_b/config.h new file mode 100644 index 00000000000..0c800968f42 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m10_b/config.h @@ -0,0 +1,206 @@ +/* +Copyright 2018 Wilba + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x00AB // 10-B +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA WORKS +#define PRODUCT RAMA WORKS M10-B +#define DESCRIPTION RAMA WORKS M10-B + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 10 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6 } +#define MATRIX_COL_PINS { D7, B6, F0, D6, B5, F1, D4, B4, F4, F5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN C6 +//#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +//#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*2)) = (35+80) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 115 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 909 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 + +#endif diff --git a/keyboards/wilba_tech/rama_works_m10_b/info.json b/keyboards/wilba_tech/rama_works_m10_b/info.json new file mode 100644 index 00000000000..22b6506d6e6 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m10_b/info.json @@ -0,0 +1,23 @@ +{ + "keyboard_name": "RAMA WORKS M10-B", + "url": "http://rama.works", + "maintainer": "Wilba", + "width": 3, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 1, "y": 3, "w": 2.0 } + ] + } + } +} diff --git a/keyboards/wilba_tech/rama_works_m10_b/keymaps/default/config.h b/keyboards/wilba_tech/rama_works_m10_b/keymaps/default/config.h new file mode 100644 index 00000000000..2a3bf1819f0 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m10_b/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Wilba + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/wilba_tech/rama_works_m10_b/keymaps/default/keymap.c b/keyboards/wilba_tech/rama_works_m10_b/keymaps/default/keymap.c new file mode 100644 index 00000000000..c307bcb2a70 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m10_b/keymaps/default/keymap.c @@ -0,0 +1,8 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_0 ) + +}; diff --git a/keyboards/rama/m10_b/keymaps/default/readme.md b/keyboards/wilba_tech/rama_works_m10_b/keymaps/default/readme.md similarity index 100% rename from keyboards/rama/m10_b/keymaps/default/readme.md rename to keyboards/wilba_tech/rama_works_m10_b/keymaps/default/readme.md diff --git a/keyboards/wilba_tech/rama_works_m10_b/keymaps/knops/config.h b/keyboards/wilba_tech/rama_works_m10_b/keymaps/knops/config.h new file mode 100644 index 00000000000..7c3ec9601d6 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m10_b/keymaps/knops/config.h @@ -0,0 +1,25 @@ +/* Copyright 2018 Wilba + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#undef RAW_ENABLE +#undef DYNAMIC_KEYMAP_ENABLE + +#endif diff --git a/keyboards/rama/m10_b/keymaps/knops/keymap.c b/keyboards/wilba_tech/rama_works_m10_b/keymaps/knops/keymap.c similarity index 100% rename from keyboards/rama/m10_b/keymaps/knops/keymap.c rename to keyboards/wilba_tech/rama_works_m10_b/keymaps/knops/keymap.c diff --git a/keyboards/rama/m10_b/keymaps/knops/readme.md b/keyboards/wilba_tech/rama_works_m10_b/keymaps/knops/readme.md similarity index 100% rename from keyboards/rama/m10_b/keymaps/knops/readme.md rename to keyboards/wilba_tech/rama_works_m10_b/keymaps/knops/readme.md diff --git a/keyboards/wilba_tech/rama_works_m10_b/rama_works_m10_b.c b/keyboards/wilba_tech/rama_works_m10_b/rama_works_m10_b.c new file mode 100644 index 00000000000..ccff6d62c94 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m10_b/rama_works_m10_b.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/rama/m10_b/m10_b.h b/keyboards/wilba_tech/rama_works_m10_b/rama_works_m10_b.h similarity index 100% rename from keyboards/rama/m10_b/m10_b.h rename to keyboards/wilba_tech/rama_works_m10_b/rama_works_m10_b.h diff --git a/keyboards/wilba_tech/rama_works_m10_b/readme.md b/keyboards/wilba_tech/rama_works_m10_b/readme.md new file mode 100644 index 00000000000..6b4130aeb4f --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m10_b/readme.md @@ -0,0 +1,15 @@ +# RAMA WORKS M10-B + +![RAMA WORKS M10-B](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/5b4997390e2e72d65f7a8e83/5b499748352f534ffb40392b/1531549522790/RAMA-M10-B-04.572.jpg?format=1500w) + +Mechanical Mini Pad. [More info at Massdrop](https://www.massdrop.com/buy/rama-m10-a) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA WORKS M10-B PCB +Hardware Availability: [Massdrop](https://www.massdrop.com/buy/rama-m10-a) + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/rama_works_m10_b:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file diff --git a/keyboards/wilba_tech/rama_works_m10_b/rules.mk b/keyboards/wilba_tech/rama_works_m10_b/rules.mk new file mode 100644 index 00000000000..70258b9ead6 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m10_b/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes diff --git a/keyboards/wilba_tech/rama_works_m60_a/config.h b/keyboards/wilba_tech/rama_works_m60_a/config.h new file mode 100644 index 00000000000..b8ce1b6c869 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m60_a/config.h @@ -0,0 +1,139 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "config_common.h" + +// USB Device descriptor parameter +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x060A // 60-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA WORKS +#define PRODUCT RAMA WORKS M60-A +#define DESCRIPTION RAMA WORKS M60-A + +// key matrix size +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +// M60-A PCB default pin-out +#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } +#define UNUSED_PINS + +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 72 + +// COL2ROW or ROW2COL +#define DIODE_DIRECTION COL2ROW + +// Set 0 if debouncing isn't needed +#define DEBOUNCE 5 + +// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap +#define LOCKING_SUPPORT_ENABLE +// Locking resynchronize hack +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +// disable debug print +//#define NO_DEBUG + +// disable print +//#define NO_PRINT + +// disable action features +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for M60-A specifics +#define RGB_BACKLIGHT_M60_A + +// enable/disable LEDs based on layout +// they aren't really used if RGB_BACKLIGHT_M60_A defined +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111 + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*5*14*2)) = (66+560) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 626 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/rama_works_m60_a/info.json b/keyboards/wilba_tech/rama_works_m60_a/info.json new file mode 100644 index 00000000000..e2061b73f6b --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m60_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "RAMA WORKS M60-A", + "url": "http://rama.works", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/rama/m60_a/keymaps/default/keymap.c b/keyboards/wilba_tech/rama_works_m60_a/keymaps/default/keymap.c similarity index 100% rename from keyboards/rama/m60_a/keymaps/default/keymap.c rename to keyboards/wilba_tech/rama_works_m60_a/keymaps/default/keymap.c diff --git a/keyboards/rama/m60_a/keymaps/proto/config.h b/keyboards/wilba_tech/rama_works_m60_a/keymaps/proto/config.h similarity index 100% rename from keyboards/rama/m60_a/keymaps/proto/config.h rename to keyboards/wilba_tech/rama_works_m60_a/keymaps/proto/config.h diff --git a/keyboards/rama/m60_a/keymaps/proto/keymap.c b/keyboards/wilba_tech/rama_works_m60_a/keymaps/proto/keymap.c similarity index 100% rename from keyboards/rama/m60_a/keymaps/proto/keymap.c rename to keyboards/wilba_tech/rama_works_m60_a/keymaps/proto/keymap.c diff --git a/keyboards/rama/m60_a/m60_a.c b/keyboards/wilba_tech/rama_works_m60_a/rama_works_m60_a.c similarity index 100% rename from keyboards/rama/m60_a/m60_a.c rename to keyboards/wilba_tech/rama_works_m60_a/rama_works_m60_a.c diff --git a/keyboards/wilba_tech/rama_works_m60_a/rama_works_m60_a.h b/keyboards/wilba_tech/rama_works_m60_a/rama_works_m60_a.h new file mode 100644 index 00000000000..01e096fee6a --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m60_a/rama_works_m60_a.h @@ -0,0 +1,37 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#include "keyboards/wilba_tech/wt_rgb_backlight_keycodes.h" +#include "keyboards/wilba_tech/via_keycodes.h" + +#define XXX KC_NO + +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K41, K42, K47, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { XXX, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, XXX, K4B, K4C, XXX } \ +} + diff --git a/keyboards/wilba_tech/rama_works_m60_a/readme.md b/keyboards/wilba_tech/rama_works_m60_a/readme.md new file mode 100644 index 00000000000..1a9d9945bd8 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m60_a/readme.md @@ -0,0 +1,15 @@ +# RAMA WORKS M60-A + +![RAMA WORKS M60-A](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/5aafa6a20e2e7254480b21bf/1535873164793/RAMA-M60-A-03.688.jpg?format=1500w) + +The M60-A represents the benchmark and equilibrium between function and design for us at Rama Works. The gently exaggerated design of the frame is not understated, but rather provocative. Inspiration and evolution from previous models are evident in the beautifully articulated design and the well defined aesthetic, the fingerprint of our 'Industrial Modern' designs. The M60-A offers a unique contender in the traditional 60% form factor. [More info at RAMA WORKS](https://rama.works/m60-a/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA WORKS M60-A PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/rama_works_m60_a:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/wilba_tech/rama_works_m60_a/rules.mk b/keyboards/wilba_tech/rama_works_m60_a/rules.mk new file mode 100644 index 00000000000..3b2287333c4 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m60_a/rules.mk @@ -0,0 +1,80 @@ + + +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes + +LAYOUTS = 60_hhkb diff --git a/keyboards/wilba_tech/rama_works_m6_a/config.h b/keyboards/wilba_tech/rama_works_m6_a/config.h new file mode 100644 index 00000000000..b9f12f42530 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_a/config.h @@ -0,0 +1,129 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x006A // 6-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA WORKS +#define PRODUCT RAMA WORKS M6-A +#define DESCRIPTION RAMA WORKS M6-A + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6 } +#define MATRIX_COL_PINS { D4, B5, F4, D7, C6, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +#define RGB_BACKLIGHT_ENABLED 0 + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// NOTE: M6-A doesn't use RGB backlight, but we keep this +// consistent with M6-B which does. + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+43) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 78 +// Dynamic macro starts after dynamic keymaps (78+(4*6*2)) = (78+48) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 126 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 898 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/rama_works_m6_a/info.json b/keyboards/wilba_tech/rama_works_m6_a/info.json new file mode 100644 index 00000000000..cbc8cffe4b2 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_a/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "RAMA WORKS M6-A", + "url": "http://rama.works", + "maintainer": "Wilba", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 } + ] + } + } +} diff --git a/keyboards/rama/m6_a/keymaps/default/keymap.c b/keyboards/wilba_tech/rama_works_m6_a/keymaps/default/keymap.c similarity index 100% rename from keyboards/rama/m6_a/keymaps/default/keymap.c rename to keyboards/wilba_tech/rama_works_m6_a/keymaps/default/keymap.c diff --git a/keyboards/rama/m6_a/keymaps/default/readme.md b/keyboards/wilba_tech/rama_works_m6_a/keymaps/default/readme.md similarity index 100% rename from keyboards/rama/m6_a/keymaps/default/readme.md rename to keyboards/wilba_tech/rama_works_m6_a/keymaps/default/readme.md diff --git a/keyboards/rama/m6_a/keymaps/knops/config.h b/keyboards/wilba_tech/rama_works_m6_a/keymaps/knops/config.h similarity index 100% rename from keyboards/rama/m6_a/keymaps/knops/config.h rename to keyboards/wilba_tech/rama_works_m6_a/keymaps/knops/config.h diff --git a/keyboards/rama/m6_a/keymaps/knops/keymap.c b/keyboards/wilba_tech/rama_works_m6_a/keymaps/knops/keymap.c similarity index 100% rename from keyboards/rama/m6_a/keymaps/knops/keymap.c rename to keyboards/wilba_tech/rama_works_m6_a/keymaps/knops/keymap.c diff --git a/keyboards/rama/m6_a/keymaps/knops/readme.md b/keyboards/wilba_tech/rama_works_m6_a/keymaps/knops/readme.md similarity index 100% rename from keyboards/rama/m6_a/keymaps/knops/readme.md rename to keyboards/wilba_tech/rama_works_m6_a/keymaps/knops/readme.md diff --git a/keyboards/rama/m6_a/keymaps/krusli/README.md b/keyboards/wilba_tech/rama_works_m6_a/keymaps/krusli/README.md similarity index 100% rename from keyboards/rama/m6_a/keymaps/krusli/README.md rename to keyboards/wilba_tech/rama_works_m6_a/keymaps/krusli/README.md diff --git a/keyboards/wilba_tech/rama_works_m6_a/keymaps/krusli/keymap.c b/keyboards/wilba_tech/rama_works_m6_a/keymaps/krusli/keymap.c new file mode 100644 index 00000000000..410229ae471 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_a/keymaps/krusli/keymap.c @@ -0,0 +1,71 @@ +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum layers +{ + _LAYER0, + _LAYER1, + _LAYER2 +}; + +enum custom_keycodes +{ + GIT_ADD = SAFE_RANGE, + GIT_COMMIT, + GIT_PUSH, + MUTE, + DEAFEN +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + if (record->event.pressed) + { + switch (keycode) + { + case GIT_ADD: + SEND_STRING("git add ." SS_TAP(X_ENTER)); + break; + case GIT_COMMIT: + SEND_STRING("git commit -m " SS_DOWN(X_LSHIFT) SS_TAP(X_QUOTE) SS_UP(X_LSHIFT)); + break; + case GIT_PUSH: + SEND_STRING("git push" SS_TAP(X_ENTER)); + break; + case MUTE: + SEND_STRING(SS_LGUI(SS_LSFT("M"))); + break; + case DEAFEN: + SEND_STRING(SS_LGUI(SS_LSFT("D"))); + break; + return false; + } + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_LAYER0] = LAYOUT( + MUTE, DEAFEN, TO(_LAYER1), + GIT_ADD, GIT_COMMIT, GIT_PUSH), + [_LAYER1] = LAYOUT( + KC_VOLD, KC_VOLU, TO(_LAYER2), + KC_MRWD, KC_MPLY, KC_MNXT), + [_LAYER2] = LAYOUT( + KC_ESC, KC_UP, TO(_LAYER0), + KC_Z, KC_X, KC_SPACE)}; + +void matrix_init_user(void) +{ +#ifdef BACKLIGHT_ENABLE + backlight_level(0); +#endif +} diff --git a/keyboards/rama/m6_a/keymaps/naut/config.h b/keyboards/wilba_tech/rama_works_m6_a/keymaps/naut/config.h similarity index 100% rename from keyboards/rama/m6_a/keymaps/naut/config.h rename to keyboards/wilba_tech/rama_works_m6_a/keymaps/naut/config.h diff --git a/keyboards/rama/m6_a/keymaps/naut/keymap.c b/keyboards/wilba_tech/rama_works_m6_a/keymaps/naut/keymap.c similarity index 100% rename from keyboards/rama/m6_a/keymaps/naut/keymap.c rename to keyboards/wilba_tech/rama_works_m6_a/keymaps/naut/keymap.c diff --git a/keyboards/rama/m6_a/keymaps/naut/readme.md b/keyboards/wilba_tech/rama_works_m6_a/keymaps/naut/readme.md similarity index 100% rename from keyboards/rama/m6_a/keymaps/naut/readme.md rename to keyboards/wilba_tech/rama_works_m6_a/keymaps/naut/readme.md diff --git a/keyboards/rama/m6_a/m6_a.c b/keyboards/wilba_tech/rama_works_m6_a/rama_works_m6_a.c similarity index 100% rename from keyboards/rama/m6_a/m6_a.c rename to keyboards/wilba_tech/rama_works_m6_a/rama_works_m6_a.c diff --git a/keyboards/rama/m6_a/m6_a.h b/keyboards/wilba_tech/rama_works_m6_a/rama_works_m6_a.h similarity index 100% rename from keyboards/rama/m6_a/m6_a.h rename to keyboards/wilba_tech/rama_works_m6_a/rama_works_m6_a.h diff --git a/keyboards/wilba_tech/rama_works_m6_a/readme.md b/keyboards/wilba_tech/rama_works_m6_a/readme.md new file mode 100644 index 00000000000..974224b4555 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_a/readme.md @@ -0,0 +1,15 @@ +# RAMA WORKS M6-A + +![RAMA WORKS M6-A](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/59fc7b1053450adf5bf9a852/1515932239307/RAMA-RAMA-M6-DSA-XO-CAPS.73-3_1.jpg?format=1500w) + +A 6-key companion keyboard. [More info at RAMA WORKS](https://rama.works/m6a) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA WORKS M6-A PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/rama_works_m6_a:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/wilba_tech/rama_works_m6_a/rules.mk b/keyboards/wilba_tech/rama_works_m6_a/rules.mk new file mode 100644 index 00000000000..4270e7090c0 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_a/rules.mk @@ -0,0 +1,74 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = no + diff --git a/keyboards/wilba_tech/rama_works_m6_b/config.h b/keyboards/wilba_tech/rama_works_m6_b/config.h new file mode 100644 index 00000000000..10377eae70b --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_b/config.h @@ -0,0 +1,172 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x006B // 6-B +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA WORKS +#define PRODUCT RAMA WORKS M6-B +#define DESCRIPTION RAMA WORKS M6-B + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6 } +#define MATRIX_COL_PINS { D4, B5, F4, D7, C6, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for M6-B specifics +#define RGB_BACKLIGHT_M6_B + +// enable/disable LEDs based on layout +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0 + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+43) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 78 +// Dynamic macro starts after dynamic keymaps (78+(4*6*2)) = (78+48) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 126 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 898 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/rama_works_m6_b/info.json b/keyboards/wilba_tech/rama_works_m6_b/info.json new file mode 100644 index 00000000000..66c36126789 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_b/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "RAMA WORKS M6-B", + "url": "http://rama.works", + "maintainer": "Wilba", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 } + ] + } + } +} diff --git a/keyboards/rama/m6_b/keymaps/default/keymap.c b/keyboards/wilba_tech/rama_works_m6_b/keymaps/default/keymap.c similarity index 100% rename from keyboards/rama/m6_b/keymaps/default/keymap.c rename to keyboards/wilba_tech/rama_works_m6_b/keymaps/default/keymap.c diff --git a/keyboards/wilba_tech/rama_works_m6_b/rama_works_m6_b.c b/keyboards/wilba_tech/rama_works_m6_b/rama_works_m6_b.c new file mode 100644 index 00000000000..581b31d753d --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_b/rama_works_m6_b.c @@ -0,0 +1,18 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef RGB_BACKLIGHT_M6_B +#error RGB_BACKLIGHT_M6_B not defined, you done goofed somehao, brah +#endif diff --git a/keyboards/rama/m6_b/m6_b.h b/keyboards/wilba_tech/rama_works_m6_b/rama_works_m6_b.h similarity index 100% rename from keyboards/rama/m6_b/m6_b.h rename to keyboards/wilba_tech/rama_works_m6_b/rama_works_m6_b.h diff --git a/keyboards/wilba_tech/rama_works_m6_b/readme.md b/keyboards/wilba_tech/rama_works_m6_b/readme.md new file mode 100644 index 00000000000..747aa74dd57 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_b/readme.md @@ -0,0 +1,15 @@ +# RAMA WORKS M6-B + +![RAMA WORKS M6-B](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/59fc7b1053450adf5bf9a852/1515932239307/RAMA-RAMA-M6-DSA-XO-CAPS.73-3_1.jpg?format=1500w) + +A 6-key companion keyboard. [More info at RAMA WORKS](https://rama.works/m6a) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA WORKS M6-B PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/rama_works_m6_b:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/wilba_tech/rama_works_m6_b/rules.mk b/keyboards/wilba_tech/rama_works_m6_b/rules.mk new file mode 100644 index 00000000000..6b7b3a63d85 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_m6_b/rules.mk @@ -0,0 +1,79 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3218.c \ + drivers/avr/i2c_master.c + + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes + diff --git a/keyboards/wilba_tech/rama_works_u80_a/config.h b/keyboards/wilba_tech/rama_works_u80_a/config.h new file mode 100644 index 00000000000..d4b14e7c096 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_u80_a/config.h @@ -0,0 +1,258 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x080A // 80-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA WORKS +#define PRODUCT RAMA WORKS U80-A +#define DESCRIPTION RAMA WORKS U80-A + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 17 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F1, F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4, B7, B0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +//#define WT_MONO_BACKLIGHT + +// IS31FL3731 driver +#define DRIVER_COUNT 3 +#define DRIVER_LED_TOTAL 108 + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for U80-A specifics +#define RGB_BACKLIGHT_U80_A + +// enable/disable LEDs based on layout +// they aren't really used if RGB_BACKLIGHT_M60_A defined +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b1110000000000000 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b1100000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b1111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b1111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b1111100000000111 + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*6*17*2)) = (66+816) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 882 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 142 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/rama_works_u80_a/info.json b/keyboards/wilba_tech/rama_works_u80_a/info.json new file mode 100644 index 00000000000..7febde5c5b7 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_u80_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "RAMA WORKS U80-A", + "url": "http://rama.works", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5}, {"x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/wilba_tech/rama_works_u80_a/keymaps/default/keymap.c b/keyboards/wilba_tech/rama_works_u80_a/keymaps/default/keymap.c new file mode 100644 index 00000000000..548843427ca --- /dev/null +++ b/keyboards/wilba_tech/rama_works_u80_a/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + diff --git a/keyboards/wilba_tech/rama_works_u80_a/rama_works_u80_a.c b/keyboards/wilba_tech/rama_works_u80_a/rama_works_u80_a.c new file mode 100644 index 00000000000..ccff6d62c94 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_u80_a/rama_works_u80_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/rama_works_u80_a/rama_works_u80_a.h b/keyboards/wilba_tech/rama_works_u80_a/rama_works_u80_a.h new file mode 100644 index 00000000000..c057db4ccd1 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_u80_a/rama_works_u80_a.h @@ -0,0 +1,45 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" +#include "keyboards/wilba_tech/wt_rgb_backlight_keycodes.h" +#include "keyboards/wilba_tech/via_keycodes.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 3,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 18 columns, +// so the numbering goes 00 to 16. Deal with it. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K415, \ + K500, K501, K502, K507, K511, K512, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, ____, ____, ____, ____ }, \ + { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, ____, ____, K415, ____ }, \ + { K500, K501, K502, ____, ____, ____, ____, K507, ____, ____, ____, K511, K512, K513, K514, K515, K516 } \ +} + diff --git a/keyboards/wilba_tech/rama_works_u80_a/readme.md b/keyboards/wilba_tech/rama_works_u80_a/readme.md new file mode 100644 index 00000000000..ff87889e458 --- /dev/null +++ b/keyboards/wilba_tech/rama_works_u80_a/readme.md @@ -0,0 +1,15 @@ +# RAMA WORKS U80-A + +![RAMA WORKS U80-A](https://something.com/something.jpg) + +A TKL keyboard. [More info at RAMA WORKS](https://rama.works/#/tkl-a/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA WORKS U80-A PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/rama_works_u80_a:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/wilba_tech/rama_works_u80_a/rules.mk b/keyboards/wilba_tech/rama_works_u80_a/rules.mk new file mode 100644 index 00000000000..6079ad8932d --- /dev/null +++ b/keyboards/wilba_tech/rama_works_u80_a/rules.mk @@ -0,0 +1,73 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/wilba_tech/via_api.h b/keyboards/wilba_tech/via_api.h new file mode 100644 index 00000000000..f04bb1b46a9 --- /dev/null +++ b/keyboards/wilba_tech/via_api.h @@ -0,0 +1,49 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#define PROTOCOL_VERSION 0x0008 + +enum via_command_id +{ + id_get_protocol_version = 0x01, // always 0x01 + id_get_keyboard_value, + id_set_keyboard_value, + id_dynamic_keymap_get_keycode, + id_dynamic_keymap_set_keycode, + id_dynamic_keymap_reset, + id_backlight_config_set_value, + id_backlight_config_get_value, + id_backlight_config_save, + id_eeprom_reset, + id_bootloader_jump, + id_dynamic_keymap_macro_get_count, + id_dynamic_keymap_macro_get_buffer_size, + id_dynamic_keymap_macro_get_buffer, + id_dynamic_keymap_macro_set_buffer, + id_dynamic_keymap_macro_reset, + id_dynamic_keymap_get_layer_count, + id_dynamic_keymap_get_buffer, + id_dynamic_keymap_set_buffer, + id_unhandled = 0xFF, +}; + +enum via_keyboard_value_id +{ + id_uptime = 0x01, + id_firmware_version +}; + diff --git a/keyboards/wilba_tech/via_keycodes.h b/keyboards/wilba_tech/via_keycodes.h new file mode 100644 index 00000000000..bed48d64b05 --- /dev/null +++ b/keyboards/wilba_tech/via_keycodes.h @@ -0,0 +1,77 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +// Can't use SAFE_RANGE here, it might change if someone adds +// new values to enum quantum_keycodes. +// Need to keep checking 0x5F10 is still in the safe range. +// TODO: merge this into quantum_keycodes +// Backlight keycodes are in range 0x5F00-0x5F0F +enum via_keycodes { + FN_MO13 = 0x5F10, + FN_MO23, + MACRO00, + MACRO01, + MACRO02, + MACRO03, + MACRO04, + MACRO05, + MACRO06, + MACRO07, + MACRO08, + MACRO09, + MACRO10, + MACRO11, + MACRO12, + MACRO13, + MACRO14, + MACRO15, +}; + +enum user_keycodes { + USER00 = 0x5F80, + USER01, + USER02, + USER03, + USER04, + USER05, + USER06, + USER07, + USER08, + USER09, + USER10, + USER11, + USER12, + USER13, + USER14, + USER15, +}; + +// VIA specific "action functions", introduced with Zeal60 +// These are only valid IDs in action_function() +// Use FN_TT13, FN_TT23, etc. in keymaps +enum via_action_functions { + TRIPLE_TAP_1_3 = 0x31, + TRIPLE_TAP_2_3 = 0x32 +}; + +// Bitwise OR the above with 0x0F00 to use in F(x) macro +// This reserves the top 256 of the 4096 range of F(x) keycodes, +// leaving the rest for use in fn_actions[] or actions in EEPROM. +#define FN_TT13 F((0x0F00|TRIPLE_TAP_1_3)) +#define FN_TT23 F((0x0F00|TRIPLE_TAP_2_3)) + +#define TG_NKRO MAGIC_TOGGLE_NKRO diff --git a/keyboards/wilba_tech/wt60_a/config.h b/keyboards/wilba_tech/wt60_a/config.h index 95f4c786e61..3a2adb3c4b1 100644 --- a/keyboards/wilba_tech/wt60_a/config.h +++ b/keyboards/wilba_tech/wt60_a/config.h @@ -44,16 +44,15 @@ #define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL - + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -103,11 +102,6 @@ * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -185,3 +179,24 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*5*14*2)) = (35+560) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 595 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 429 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt60_a/keymaps/via/keymap.c b/keyboards/wilba_tech/wt60_a/keymaps/via/keymap.c new file mode 100644 index 00000000000..566736f5e3b --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/keymaps/via/keymap.c @@ -0,0 +1,38 @@ +// Default layout for WT60-A +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + +// Fn1 Layer +[1] = LAYOUT_60_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL , + KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer +[3] = LAYOUT_60_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/wilba_tech/wt60_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt60_a/keymaps/via/rules.mk new file mode 100644 index 00000000000..76a07d7a44a --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/keymaps/via/rules.mk @@ -0,0 +1,71 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt60_a/readme.md b/keyboards/wilba_tech/wt60_a/readme.md index d7a73165d4a..91cc5c8cef8 100644 --- a/keyboards/wilba_tech/wt60_a/readme.md +++ b/keyboards/wilba_tech/wt60_a/readme.md @@ -1,11 +1,11 @@ -# WILBA.TECH WT60-A +# wilba.tech WT60-A -![WILBA.TECH WT60-A](https://wilba.tech) +![wilba.tech WT60-A](https://cdn.shopify.com/s/files/1/0015/5084/3975/products/no.160_PCB_1_of_1_2d7414ed-7cc5-46a5-b245-6fb7a197232d_720x.jpg?v=1546475122) WT60-A is a keyboard PCB supporting 60% layout. [More info at wilba.tech](https://wilba.tech/) Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) -Hardware Supported: WILBA.TECH WT65-A +Hardware Supported: wilba.tech WT65-A Hardware Availability: Custom keyboard group buys Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/wilba_tech/wt60_a/rules.mk b/keyboards/wilba_tech/wt60_a/rules.mk index 99224c247cd..e41f2186b3a 100644 --- a/keyboards/wilba_tech/wt60_a/rules.mk +++ b/keyboards/wilba_tech/wt60_a/rules.mk @@ -52,14 +52,14 @@ BOOTLOADER = atmel-dfu # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode diff --git a/keyboards/wilba_tech/wt65_a/config.h b/keyboards/wilba_tech/wt65_a/config.h index fa919f186b5..cb0df1460db 100644 --- a/keyboards/wilba_tech/wt65_a/config.h +++ b/keyboards/wilba_tech/wt65_a/config.h @@ -44,16 +44,15 @@ #define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL - + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -103,11 +102,6 @@ * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -185,3 +179,24 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*5*15*2)) = (35+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 635 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 389 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt65_a/keymaps/via/keymap.c b/keyboards/wilba_tech/wt65_a/keymaps/via/keymap.c new file mode 100644 index 00000000000..c5ae8116809 --- /dev/null +++ b/keyboards/wilba_tech/wt65_a/keymaps/via/keymap.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, KC_TRNS, + KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt65_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt65_a/keymaps/via/rules.mk new file mode 100644 index 00000000000..76a07d7a44a --- /dev/null +++ b/keyboards/wilba_tech/wt65_a/keymaps/via/rules.mk @@ -0,0 +1,71 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt65_a/readme.md b/keyboards/wilba_tech/wt65_a/readme.md index 1551b55b57a..964b6a097fb 100644 --- a/keyboards/wilba_tech/wt65_a/readme.md +++ b/keyboards/wilba_tech/wt65_a/readme.md @@ -1,11 +1,11 @@ -# WILBA.TECH WT65-A +# wilba.tech WT65-A -![WILBA.TECH WT65-A](https://wilba.tech) +![wilba.tech WT65-A](https://cdn.shopify.com/s/files/1/0015/5084/3975/products/no.165_PCB_1_of_1_a85e9af1-174f-497a-aadb-bb53ce74ef8c_720x.jpg?v=1546475185) -WT65-A is a keyboard PCB supporting 65% layout with 0.25U blocker. [More info at wilba.tech](https://wilba.tech/) +WT65-A is a keyboard PCB supporting 65% layout with 0.5U blocker. [More info at wilba.tech](https://wilba.tech/) Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) -Hardware Supported: WILBA.TECH WT65-A +Hardware Supported: wilba.tech WT65-A Hardware Availability: Custom keyboard group buys Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/wilba_tech/wt65_a/rules.mk b/keyboards/wilba_tech/wt65_a/rules.mk index 99224c247cd..e41f2186b3a 100644 --- a/keyboards/wilba_tech/wt65_a/rules.mk +++ b/keyboards/wilba_tech/wt65_a/rules.mk @@ -52,14 +52,14 @@ BOOTLOADER = atmel-dfu # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode diff --git a/keyboards/wilba_tech/wt65_b/config.h b/keyboards/wilba_tech/wt65_b/config.h new file mode 100644 index 00000000000..086168987be --- /dev/null +++ b/keyboards/wilba_tech/wt65_b/config.h @@ -0,0 +1,202 @@ +/* Copyright 2019 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x065B // 65-B +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT65-B +#define DESCRIPTION wilba.tech WT65-B + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*5*15*2)) = (35+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 635 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 389 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt65_b/info.json b/keyboards/wilba_tech/wt65_b/info.json new file mode 100644 index 00000000000..dd6fe1af39c --- /dev/null +++ b/keyboards/wilba_tech/wt65_b/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "wilba.tech WT65-B", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"End", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Win", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":2.25, "y":4, "w":1.5}, {"x":3.75, "y":4, "w":7}, {"label":"Fn", "x":10.75, "y":4, "w":1.5}, {"label":"Left", "x":13, "y":4}, {"label":"Down", "x":14, "y":4}, {"label":"Right", "x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/wilba_tech/wt65_b/keymaps/default/keymap.c b/keyboards/wilba_tech/wt65_b/keymaps/default/keymap.c new file mode 100644 index 00000000000..41e5cb8be3e --- /dev/null +++ b/keyboards/wilba_tech/wt65_b/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt65_b/keymaps/via/keymap.c b/keyboards/wilba_tech/wt65_b/keymaps/via/keymap.c new file mode 100644 index 00000000000..41e5cb8be3e --- /dev/null +++ b/keyboards/wilba_tech/wt65_b/keymaps/via/keymap.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt65_b/keymaps/via/rules.mk b/keyboards/wilba_tech/wt65_b/keymaps/via/rules.mk new file mode 100644 index 00000000000..76a07d7a44a --- /dev/null +++ b/keyboards/wilba_tech/wt65_b/keymaps/via/rules.mk @@ -0,0 +1,71 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt65_b/readme.md b/keyboards/wilba_tech/wt65_b/readme.md new file mode 100644 index 00000000000..e90b44770e1 --- /dev/null +++ b/keyboards/wilba_tech/wt65_b/readme.md @@ -0,0 +1,13 @@ +# wilba.tech WT65-B + +WT65-B is a keyboard PCB supporting 65% layout with two bottom row blockers, designed for the Dixie Mech Bauer. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: wilba.tech WT65-B +Hardware Availability: Dixie Mech + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt65_b:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/wilba_tech/wt65_b/rules.mk b/keyboards/wilba_tech/wt65_b/rules.mk new file mode 100644 index 00000000000..e41f2186b3a --- /dev/null +++ b/keyboards/wilba_tech/wt65_b/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/wilba_tech/wt65_b/wt65_b.c b/keyboards/wilba_tech/wt65_b/wt65_b.c new file mode 100644 index 00000000000..365f2e8861e --- /dev/null +++ b/keyboards/wilba_tech/wt65_b/wt65_b.c @@ -0,0 +1,17 @@ +/* Copyright 2019 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt65_b/wt65_b.h b/keyboards/wilba_tech/wt65_b/wt65_b.h new file mode 100644 index 00000000000..daad7e922fa --- /dev/null +++ b/keyboards/wilba_tech/wt65_b/wt65_b.h @@ -0,0 +1,41 @@ +/* Copyright 2019 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 2,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 16 columns, +// so the numbering goes 00 to 14. Deal with it. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K402, K406, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, ____, K402, ____, ____, ____, K406, ____, ____, ____, ____, K411, K412, K413, K414 } \ +} + diff --git a/keyboards/wilba_tech/wt69_a/config.h b/keyboards/wilba_tech/wt69_a/config.h new file mode 100644 index 00000000000..0ed40b27e00 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/config.h @@ -0,0 +1,203 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x069A // 69-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT69-A +#define DESCRIPTION wilba.tech WT69-A + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 17 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { B7, B0, F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +// Does not use WT_MONO_BACKLIGHT +//#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*5*17*2)) = (35+680) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 715 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 309 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt69_a/info.json b/keyboards/wilba_tech/wt69_a/info.json new file mode 100644 index 00000000000..df7af63c294 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "wilba.tech WT69-A", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 18.25, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"BkSp", "x":15.25, "y":0}, {"label":"BkSp", "x":16.25, "y":0}, {"label":"Home", "x":17.25, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"|", "x":15.75, "y":1, "w":1.5}, {"label":"PgUp", "x":17.25, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"\"", "x":14, "y":2}, {"label":"Enter", "x":15, "y":2, "w":2.25}, {"label":"PgDn", "x":17.25, "y":2}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":2.25}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":1.75}, {"label":"\u2191", "x":16.25, "y":3}, {"label":"End", "x":17.25, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Control", "x":2.25, "y":4, "w":1.5}, {"label":"Win", "x":3.75, "y":4}, {"label":"Alt", "x":4.75, "y":4, "w":1.5}, {"x":6.25, "y":4, "w":7}, {"label":"Fn", "x":13.25, "y":4, "w":1.5}, {"label":"\u2190", "x":15.25, "y":4}, {"label":"\u2193", "x":16.25, "y":4}, {"label":"\u2192", "x":17.25, "y":4}] + } + } +} diff --git a/keyboards/wilba_tech/wt69_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt69_a/keymaps/default/keymap.c new file mode 100644 index 00000000000..c9fc5dd0716 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; \ No newline at end of file diff --git a/keyboards/wilba_tech/wt69_a/keymaps/via/keymap.c b/keyboards/wilba_tech/wt69_a/keymaps/via/keymap.c new file mode 100644 index 00000000000..c9fc5dd0716 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/keymaps/via/keymap.c @@ -0,0 +1,36 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; \ No newline at end of file diff --git a/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk new file mode 100644 index 00000000000..f072c67198c --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt69_a/readme.md b/keyboards/wilba_tech/wt69_a/readme.md new file mode 100644 index 00000000000..90afa253316 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/readme.md @@ -0,0 +1,15 @@ +# wilba.tech WT69-A + +![wilba.tech WT69-A](https://images.squarespace-cdn.com/content/5b267e429772ae4372e3b65f/1556352502542-AKHBF9R6CP5HVHOZYJHM/i69_g.png?content-type=image%2Fpng) + +WT69-A is a keyboard PCB supporting 65% layout with 0.5U blocker and left side function keys. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: wilba.tech WT69-A +Hardware Availability: Custom keyboard group buys + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt69_a:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/wilba_tech/wt69_a/rules.mk b/keyboards/wilba_tech/wt69_a/rules.mk new file mode 100644 index 00000000000..f1c632289cc --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/rules.mk @@ -0,0 +1,65 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/wilba_tech/wt69_a/wt69_a.c b/keyboards/wilba_tech/wt69_a/wt69_a.c new file mode 100644 index 00000000000..ccff6d62c94 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/wt69_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt69_a/wt69_a.h b/keyboards/wilba_tech/wt69_a/wt69_a.h new file mode 100644 index 00000000000..057936094d3 --- /dev/null +++ b/keyboards/wilba_tech/wt69_a/wt69_a.h @@ -0,0 +1,36 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define ____ KC_NO + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K215, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, \ + K300, K301, K302, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, \ + K400, K401, K402, K403, K404, K408, K413, K414, K415, K416 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, ____, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316 }, \ + { K400, K401, K402, K403, K404, ____, ____, ____, K408, ____, ____, ____, ____, K413, K414, K415, K416 } \ +} + diff --git a/keyboards/wilba_tech/wt75_a/config.h b/keyboards/wilba_tech/wt75_a/config.h new file mode 100644 index 00000000000..d1ae3315668 --- /dev/null +++ b/keyboards/wilba_tech/wt75_a/config.h @@ -0,0 +1,202 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x075A // 75-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT75-A +#define DESCRIPTION wilba.tech WT75-A + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F1, F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*6*15*2)) = (35+720) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 755 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 269 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt75_a/info.json b/keyboards/wilba_tech/wt75_a/info.json new file mode 100644 index 00000000000..d9c54a63a6b --- /dev/null +++ b/keyboards/wilba_tech/wt75_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "wilba.tech WT75-A", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.5, "y":0}, {"label":"F2", "x":2.5, "y":0}, {"label":"F3", "x":3.5, "y":0}, {"label":"F4", "x":4.5, "y":0}, {"label":"F5", "x":5.75, "y":0}, {"label":"F6", "x":6.75, "y":0}, {"label":"F7", "x":7.75, "y":0}, {"label":"F8", "x":8.75, "y":0}, {"label":"F9", "x":10, "y":0}, {"label":"F10", "x":11, "y":0}, {"label":"F11", "x":12, "y":0}, {"label":"F12", "x":13, "y":0}, {"label":"Del", "x":15, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Bksp", "x":13, "y":1.25}, {"label":"Bksp", "x":14, "y":1.25}, {"label":"Home", "x":15, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"PgUp", "x":15, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"PgDn", "x":15, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, {"label":"\u2191", "x":14, "y":4.25}, {"label":"End", "x":15, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, {"label":"6.25U", "x":3.75, "y":5.25, "w":6.25}, {"label":"Alt", "x":10, "y":5.25, "w":1.25}, {"label":"Win", "x":11.25, "y":5.25, "w":1.25}, {"label":"\u2190", "x":13, "y":5.25}, {"label":"\u2193", "x":14, "y":5.25}, {"label":"\u2192", "x":15, "y":5.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt75_a/keymaps/default/keymap.c new file mode 100644 index 00000000000..77a534a2329 --- /dev/null +++ b/keyboards/wilba_tech/wt75_a/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt75_a/keymaps/via/keymap.c b/keyboards/wilba_tech/wt75_a/keymaps/via/keymap.c new file mode 100644 index 00000000000..77a534a2329 --- /dev/null +++ b/keyboards/wilba_tech/wt75_a/keymaps/via/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt75_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt75_a/keymaps/via/rules.mk new file mode 100644 index 00000000000..76a07d7a44a --- /dev/null +++ b/keyboards/wilba_tech/wt75_a/keymaps/via/rules.mk @@ -0,0 +1,71 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_a/readme.md b/keyboards/wilba_tech/wt75_a/readme.md new file mode 100644 index 00000000000..73589fefc8c --- /dev/null +++ b/keyboards/wilba_tech/wt75_a/readme.md @@ -0,0 +1,13 @@ +# wilba.tech WT75-A + +WT75-A is a keyboard PCB supporting 75% layout with 0.25U blocker. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: wilba.tech WT75-A +Hardware Availability: Custom keyboard group buys + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt75_a:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_a/rules.mk b/keyboards/wilba_tech/wt75_a/rules.mk new file mode 100644 index 00000000000..e41f2186b3a --- /dev/null +++ b/keyboards/wilba_tech/wt75_a/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/wilba_tech/wt75_a/wt75_a.c b/keyboards/wilba_tech/wt75_a/wt75_a.c new file mode 100644 index 00000000000..ccff6d62c94 --- /dev/null +++ b/keyboards/wilba_tech/wt75_a/wt75_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt75_a/wt75_a.h b/keyboards/wilba_tech/wt75_a/wt75_a.h new file mode 100644 index 00000000000..4ddd1aabf99 --- /dev/null +++ b/keyboards/wilba_tech/wt75_a/wt75_a.h @@ -0,0 +1,43 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 2,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 16 columns, +// so the numbering goes 00 to 14. Deal with it. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K313, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, \ + K500, K501, K502, K506, K510, K511, K512, K513, K514 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414 }, \ + { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, K514 } \ +} + diff --git a/keyboards/wilba_tech/wt75_b/config.h b/keyboards/wilba_tech/wt75_b/config.h new file mode 100644 index 00000000000..c9b37755f1e --- /dev/null +++ b/keyboards/wilba_tech/wt75_b/config.h @@ -0,0 +1,202 @@ +/* Copyright 2019 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x075B // 75-B +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT75-B +#define DESCRIPTION wilba.tech WT75-B + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F1, F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B7, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, B2, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*6*16*2)) = (35+768) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 803 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 221 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt75_b/info.json b/keyboards/wilba_tech/wt75_b/info.json new file mode 100644 index 00000000000..92947cf87f6 --- /dev/null +++ b/keyboards/wilba_tech/wt75_b/info.json @@ -0,0 +1,14 @@ +{ + "keyboard_name": "wilba.tech WT75-B", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":13.5, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3, "w":2.25}, {"x":15, "y":3}, {"x":0, "y":4, "w":2.25}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":0, "y":5, "w":1.25}, {"x":1.25, "y":5, "w":1.25}, {"x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"x":10, "y":5, "w":1.25}, {"x":11.25, "y":5, "w":1.25}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}] + } + } +} + diff --git a/keyboards/wilba_tech/wt75_b/keymaps/default/keymap.c b/keyboards/wilba_tech/wt75_b/keymaps/default/keymap.c new file mode 100644 index 00000000000..41d3734dbf5 --- /dev/null +++ b/keyboards/wilba_tech/wt75_b/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt75_b/keymaps/via/keymap.c b/keyboards/wilba_tech/wt75_b/keymaps/via/keymap.c new file mode 100644 index 00000000000..41d3734dbf5 --- /dev/null +++ b/keyboards/wilba_tech/wt75_b/keymaps/via/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt75_b/keymaps/via/rules.mk b/keyboards/wilba_tech/wt75_b/keymaps/via/rules.mk new file mode 100644 index 00000000000..76a07d7a44a --- /dev/null +++ b/keyboards/wilba_tech/wt75_b/keymaps/via/rules.mk @@ -0,0 +1,71 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_b/readme.md b/keyboards/wilba_tech/wt75_b/readme.md new file mode 100644 index 00000000000..bfaadbce6aa --- /dev/null +++ b/keyboards/wilba_tech/wt75_b/readme.md @@ -0,0 +1,13 @@ +# wilba.tech WT75-B + +WT75-B is a keyboard PCB supporting 75% layout with 0.25U blocker, designed for the Singa R3. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: wilba.tech WT75-B +Hardware Availability: Singa Keyboards + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt75_b:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_b/rules.mk b/keyboards/wilba_tech/wt75_b/rules.mk new file mode 100644 index 00000000000..e41f2186b3a --- /dev/null +++ b/keyboards/wilba_tech/wt75_b/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/wilba_tech/wt75_b/wt75_b.c b/keyboards/wilba_tech/wt75_b/wt75_b.c new file mode 100644 index 00000000000..ccff6d62c94 --- /dev/null +++ b/keyboards/wilba_tech/wt75_b/wt75_b.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt75_b/wt75_b.h b/keyboards/wilba_tech/wt75_b/wt75_b.h new file mode 100644 index 00000000000..bdac6bccf0f --- /dev/null +++ b/keyboards/wilba_tech/wt75_b/wt75_b.h @@ -0,0 +1,37 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define ____ KC_NO + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K506, K510, K511, K512, K513, K515 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, ____, ____, K315 }, \ + { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, ____, K415 }, \ + { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, ____, K515 } \ +} diff --git a/keyboards/wilba_tech/wt80_a/config.h b/keyboards/wilba_tech/wt80_a/config.h index 9687cb6d680..7d974193c29 100644 --- a/keyboards/wilba_tech/wt80_a/config.h +++ b/keyboards/wilba_tech/wt80_a/config.h @@ -44,16 +44,15 @@ #define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4, B7, B0 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL - + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -103,11 +102,6 @@ * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -185,3 +179,24 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*6*17*2)) = (35+816) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 851 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 173 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c index cf9225e3e5a..9cbe7ff6241 100644 --- a/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c +++ b/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c @@ -18,5 +18,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + }; diff --git a/keyboards/wilba_tech/wt80_a/keymaps/via/keymap.c b/keyboards/wilba_tech/wt80_a/keymaps/via/keymap.c new file mode 100644 index 00000000000..9cbe7ff6241 --- /dev/null +++ b/keyboards/wilba_tech/wt80_a/keymaps/via/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + diff --git a/keyboards/wilba_tech/wt80_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt80_a/keymaps/via/rules.mk new file mode 100644 index 00000000000..76a07d7a44a --- /dev/null +++ b/keyboards/wilba_tech/wt80_a/keymaps/via/rules.mk @@ -0,0 +1,71 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt80_a/readme.md b/keyboards/wilba_tech/wt80_a/readme.md index 011805748f6..8bddecadee3 100644 --- a/keyboards/wilba_tech/wt80_a/readme.md +++ b/keyboards/wilba_tech/wt80_a/readme.md @@ -1,11 +1,9 @@ -# WILBA.TECH WT80-A - -![WILBA.TECH WT80-A](https://wilba./tech) +# wilba.tech WT80-A WT80-A is a keyboard PCB supporting TKL layout with 0.25U gaps. [More info at wilba.tech](https://wilba.tech/) Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) -Hardware Supported: WILBA.TECH WT80-A +Hardware Supported: wilba.tech WT80-A Hardware Availability: Custom keyboard group buys Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/wilba_tech/wt80_a/rules.mk b/keyboards/wilba_tech/wt80_a/rules.mk index 99224c247cd..e41f2186b3a 100644 --- a/keyboards/wilba_tech/wt80_a/rules.mk +++ b/keyboards/wilba_tech/wt80_a/rules.mk @@ -52,14 +52,14 @@ BOOTLOADER = atmel-dfu # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode diff --git a/keyboards/wilba_tech/wt80_a/wt80_a.h b/keyboards/wilba_tech/wt80_a/wt80_a.h index 26403ef3475..a6fb1cccb1f 100644 --- a/keyboards/wilba_tech/wt80_a/wt80_a.h +++ b/keyboards/wilba_tech/wt80_a/wt80_a.h @@ -41,3 +41,18 @@ { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, K514, K515, K516 } \ } +#define LAYOUT_no_split( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K415, \ + K500, K501, K502, K506, K510, K511, K512, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, ____, ____, ____ }, \ + { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, ____, K415, ____ }, \ + { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, K514, K515, K516 } \ +} diff --git a/keyboards/wilba_tech/wt8_a/config.h b/keyboards/wilba_tech/wt8_a/config.h new file mode 100644 index 00000000000..6604b7ce827 --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/config.h @@ -0,0 +1,115 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x008A // 8-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT8-A +#define DESCRIPTION wilba.tech WT8-A + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6 } +#define MATRIX_COL_PINS { F4, F1, B2, B6, F6, F7, D5, B4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +// Does not use WT_MONO_BACKLIGHT +// #define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*1*8*2)) = (35+64) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 99 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 925 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt8_a/info.json b/keyboards/wilba_tech/wt8_a/info.json new file mode 100644 index 00000000000..c40d44db727 --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "wilba.tech WT8-A", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 4, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [{"label":"x", "x":0, "y":0}, {"label":"x", "x":1, "y":0}, {"label":"x", "x":2, "y":0}, {"label":"x", "x":3, "y":0}, {"label":"x", "x":0, "y":1}, {"label":"x", "x":1, "y":1}, {"label":"x", "x":2, "y":1}, {"label":"x", "x":3, "y":1}] + } + } +} \ No newline at end of file diff --git a/keyboards/wilba_tech/wt8_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt8_a/keymaps/default/keymap.c new file mode 100644 index 00000000000..a9f40362c7d --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/keymaps/default/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8 ), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) }; + diff --git a/keyboards/wilba_tech/wt8_a/keymaps/rys/keymap.c b/keyboards/wilba_tech/wt8_a/keymaps/rys/keymap.c new file mode 100644 index 00000000000..bf0dda0fa8d --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/keymaps/rys/keymap.c @@ -0,0 +1,84 @@ +#include QMK_KEYBOARD_H + +#define _BL0 0 +#define _FL1 1 +#define _FL2 2 +#define _FL3 3 + +#define MACOSLK LCTL(LGUI(KC_Q)) // CTRL+CMD+Q == screen lock in macOS 10.13+ + +enum rys_keycodes { + STOKEN1 = SAFE_RANGE, + STOKEN2, + STOKEN3, + STOKEN4 +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case STOKEN1: + if (record->event.pressed) { + SEND_STRING(RYS_STOKEN1); + } + break; + case STOKEN2: + if (record->event.pressed) { + SEND_STRING(RYS_STOKEN2); + } + break; + case STOKEN3: + if (record->event.pressed) { + SEND_STRING(RYS_STOKEN3); + } + break; + case STOKEN4: + if (record->event.pressed) { + SEND_STRING(RYS_STOKEN4); + } + break; + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap base layer (_BL0) - default layer + * ,---------------------------. + * | ST1 | ST2 | ST3 | ST4 | + * |---------------------------| + * | | LOCK | VOL- | VOL+ | + * `---------------------------' + */ + [_BL0] = LAYOUT( + STOKEN1, STOKEN2, STOKEN3, STOKEN4, + _______, MACOSLK, KC__VOLDOWN, KC__VOLUP), + /* Keymap base layer (_FL1) - function layer 1 + * ,---------------------------. + * | | | | | + * |---------------------------| + * | | | | | + * `---------------------------' + */ + [_FL1] = LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______), + /* Keymap base layer (_FL2) - function layer 2 + * ,---------------------------. + * | | | | | + * |---------------------------| + * | | | | | + * `---------------------------' + */ + [_FL2] = LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______), + /* Keymap base layer (_FL3) - function layer 3 + * ,---------------------------. + * | | | | | + * |---------------------------| + * | | | | | + * `---------------------------' + */ + [_FL3] = LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______), +}; diff --git a/keyboards/wilba_tech/wt8_a/keymaps/rys/rules.mk b/keyboards/wilba_tech/wt8_a/keymaps/rys/rules.mk new file mode 100644 index 00000000000..60cbf8bfc4b --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/keymaps/rys/rules.mk @@ -0,0 +1,9 @@ +RYS_STOKEN1 = "$(shell security find-generic-password -a qmk -s wt8a-1 -w)" +RYS_STOKEN2 = "$(shell security find-generic-password -a qmk -s wt8a-2 -w)" +RYS_STOKEN3 = "$(shell security find-generic-password -a qmk -s wt8a-3 -w)" +RYS_STOKEN4 = "$(shell security find-generic-password -a qmk -s wt8a-4 -w)" + +CFLAGS += -DRYS_STOKEN1=\"$(RYS_STOKEN1)\" +CFLAGS += -DRYS_STOKEN2=\"$(RYS_STOKEN2)\" +CFLAGS += -DRYS_STOKEN3=\"$(RYS_STOKEN3)\" +CFLAGS += -DRYS_STOKEN4=\"$(RYS_STOKEN4)\" diff --git a/keyboards/wilba_tech/wt8_a/keymaps/via/keymap.c b/keyboards/wilba_tech/wt8_a/keymaps/via/keymap.c new file mode 100644 index 00000000000..a9f40362c7d --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/keymaps/via/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8 ), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) }; + diff --git a/keyboards/wilba_tech/wt8_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt8_a/keymaps/via/rules.mk new file mode 100644 index 00000000000..f072c67198c --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/keymaps/via/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt8_a/readme.md b/keyboards/wilba_tech/wt8_a/readme.md new file mode 100644 index 00000000000..4998e91293e --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/readme.md @@ -0,0 +1,13 @@ +# wilba.tech WT8-A + +WT8-A is an 8-key macropad PCB, designed for the Singa Ocelot. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: wilba.tech WT8-A +Hardware Availability: Singa Keyboards + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt8_a:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/wilba_tech/wt8_a/rules.mk b/keyboards/wilba_tech/wt8_a/rules.mk new file mode 100644 index 00000000000..f1c632289cc --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/rules.mk @@ -0,0 +1,65 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/wilba_tech/wt8_a/wt8_a.c b/keyboards/wilba_tech/wt8_a/wt8_a.c new file mode 100644 index 00000000000..ccff6d62c94 --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/wt8_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt8_a/wt8_a.h b/keyboards/wilba_tech/wt8_a/wt8_a.h new file mode 100644 index 00000000000..0fb754f0abf --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/wt8_a.h @@ -0,0 +1,27 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define ____ KC_NO + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07 ) \ + { \ + {K00, K01, K02, K03, K04, K05, K06, K07 }, \ + } diff --git a/keyboards/wilba_tech/wt_main.c b/keyboards/wilba_tech/wt_main.c index f514dbefcda..e6ea4a21bd1 100644 --- a/keyboards/wilba_tech/wt_main.c +++ b/keyboards/wilba_tech/wt_main.c @@ -15,7 +15,228 @@ */ #include "quantum.h" + +// Check that no backlight functions are called +#if RGB_BACKLIGHT_ENABLED +#include "keyboards/wilba_tech/wt_rgb_backlight.h" +#endif // RGB_BACKLIGHT_ENABLED +#ifdef WT_MONO_BACKLIGHT #include "keyboards/wilba_tech/wt_mono_backlight.h" +#endif // WT_MONO_BACKLIGHT +#include "keyboards/wilba_tech/via_api.h" // Temporary hack +#include "keyboards/wilba_tech/via_keycodes.h" // Temporary hack + +#include "raw_hid.h" +#include "dynamic_keymap.h" +#include "timer.h" +#include "tmk_core/common/eeprom.h" + +bool eeprom_is_valid(void) +{ + return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && + eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); +} + +void eeprom_set_valid(bool valid) +{ + eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); + eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); +} + +void eeprom_reset(void) +{ + // Set the Zeal60 specific EEPROM state as invalid. + eeprom_set_valid(false); + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); +} + +#ifdef RAW_ENABLE + +void raw_hid_receive( uint8_t *data, uint8_t length ) +{ + uint8_t *command_id = &(data[0]); + uint8_t *command_data = &(data[1]); + switch ( *command_id ) + { + case id_get_protocol_version: + { + command_data[0] = PROTOCOL_VERSION >> 8; + command_data[1] = PROTOCOL_VERSION & 0xFF; + break; + } + case id_get_keyboard_value: + { + if ( command_data[0] == id_uptime ) + { + uint32_t value = timer_read32(); + command_data[1] = (value >> 24 ) & 0xFF; + command_data[2] = (value >> 16 ) & 0xFF; + command_data[3] = (value >> 8 ) & 0xFF; + command_data[4] = value & 0xFF; + } + else + { + *command_id = id_unhandled; + } + break; + } +#ifdef DYNAMIC_KEYMAP_ENABLE + case id_dynamic_keymap_get_keycode: + { + uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); + command_data[3] = keycode >> 8; + command_data[4] = keycode & 0xFF; + break; + } + case id_dynamic_keymap_set_keycode: + { + dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); + break; + } + case id_dynamic_keymap_reset: + { + dynamic_keymap_reset(); + break; + } + case id_dynamic_keymap_macro_get_count: + { + command_data[0] = dynamic_keymap_macro_get_count(); + break; + } + case id_dynamic_keymap_macro_get_buffer_size: + { + uint16_t size = dynamic_keymap_macro_get_buffer_size(); + command_data[0] = size >> 8; + command_data[1] = size & 0xFF; + break; + } + case id_dynamic_keymap_macro_get_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_get_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_set_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_set_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_reset: + { + dynamic_keymap_macro_reset(); + break; + } + case id_dynamic_keymap_get_layer_count: + { + command_data[0] = dynamic_keymap_get_layer_count(); + break; + } + case id_dynamic_keymap_get_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_get_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_set_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_set_buffer( offset, size, &command_data[3] ); + break; + } +#endif // DYNAMIC_KEYMAP_ENABLE +#if RGB_BACKLIGHT_ENABLED + case id_backlight_config_set_value: + { + backlight_config_set_value(command_data); + break; + } + case id_backlight_config_get_value: + { + backlight_config_get_value(command_data); + break; + } + case id_backlight_config_save: + { + backlight_config_save(); + break; + } +#endif // RGB_BACKLIGHT_ENABLED + case id_eeprom_reset: + { + eeprom_reset(); + break; + } + case id_bootloader_jump: + { + // Need to send data back before the jump + // Informs host that the command is handled + raw_hid_send( data, length ); + // Give host time to read it + wait_ms(100); + bootloader_jump(); + break; + } + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + + // Return same buffer with values changed + raw_hid_send( data, length ); + +} + +#endif + +void main_init(void) +{ + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + if (eeprom_is_valid()) { +#if RGB_BACKLIGHT_ENABLED + backlight_config_load(); +#endif // RGB_BACKLIGHT_ENABLED + } else { +#if RGB_BACKLIGHT_ENABLED + // If the EEPROM has not been saved before, or is out of date, + // save the default values to the EEPROM. Default values + // come from construction of the zeal_backlight_config instance. + backlight_config_save(); +#endif // RGB_BACKLIGHT_ENABLED +#ifdef DYNAMIC_KEYMAP_ENABLE + // This resets the keymaps in EEPROM to what is in flash. + dynamic_keymap_reset(); + // This resets the macros in EEPROM to nothing. + dynamic_keymap_macro_reset(); +#endif // DYNAMIC_KEYMAP_ENABLE + // Save the magic number last, in case saving was interrupted + eeprom_set_valid(true); + } + +#if RGB_BACKLIGHT_ENABLED + // Initialize LED drivers for backlight. + backlight_init_drivers(); + + backlight_timer_init(); + backlight_timer_enable(); +#endif // RGB_BACKLIGHT_ENABLED +#ifdef WT_MONO_BACKLIGHT + // Initialize LED drivers for backlight. + backlight_init_drivers(); + + backlight_timer_init(); + backlight_timer_enable(); +#endif // WT_MONO_BACKLIGHT +} void bootmagic_lite(void) { @@ -25,16 +246,14 @@ void bootmagic_lite(void) // We need multiple scans because debouncing can't be turned off. matrix_scan(); - wait_ms(DEBOUNCING_DELAY); - wait_ms(DEBOUNCING_DELAY); + wait_ms(DEBOUNCE); + wait_ms(DEBOUNCE); matrix_scan(); // If the Esc (matrix 0,0) is held down on power up, // reset the EEPROM valid state and jump to bootloader. if ( matrix_get_row(0) & (1<<0) ) { - // Set the TMK/QMK EEPROM state as invalid. - eeconfig_disable(); - // Jump to bootloader. + eeprom_reset(); bootloader_jump(); } } @@ -42,14 +261,133 @@ void bootmagic_lite(void) void matrix_init_kb(void) { bootmagic_lite(); - backlight_init_drivers(); - backlight_timer_init(); - backlight_timer_enable(); + main_init(); matrix_init_user(); } void matrix_scan_kb(void) { +#if RGB_BACKLIGHT_ENABLED + // This only updates the LED driver buffers if something has changed. backlight_update_pwm_buffers(); +#endif // RGB_BACKLIGHT_ENABLED +#ifdef WT_MONO_BACKLIGHT + // This only updates the LED driver buffers if something has changed. + backlight_update_pwm_buffers(); +#endif matrix_scan_user(); } + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) +{ +#if RGB_BACKLIGHT_ENABLED + process_record_backlight(keycode, record); +#endif // RGB_BACKLIGHT_ENABLED + + switch(keycode) { + case FN_MO13: + if (record->event.pressed) { + layer_on(1); + update_tri_layer(1, 2, 3); + } else { + layer_off(1); + update_tri_layer(1, 2, 3); + } + return false; + break; + case FN_MO23: + if (record->event.pressed) { + layer_on(2); + update_tri_layer(1, 2, 3); + } else { + layer_off(2); + update_tri_layer(1, 2, 3); + } + return false; + break; + } + +#ifdef DYNAMIC_KEYMAP_ENABLE + // Handle macros + if (record->event.pressed) { + if ( keycode >= MACRO00 && keycode <= MACRO15 ) + { + uint8_t id = keycode - MACRO00; + dynamic_keymap_macro_send(id); + return false; + } + } +#endif //DYNAMIC_KEYMAP_ENABLE + + return process_record_user(keycode, record); +} + +// This overrides the one in quantum/keymap_common.c +uint16_t keymap_function_id_to_action( uint16_t function_id ) +{ + // Zeal60 specific "action functions" are 0xF00 to 0xFFF + // i.e. F(0xF00) to F(0xFFF) are mapped to + // enum zeal60_action_functions by masking last 8 bits. + if ( function_id >= 0x0F00 && function_id <= 0x0FFF ) + { + uint8_t id = function_id & 0xFF; + switch ( id ) { + case TRIPLE_TAP_1_3: + case TRIPLE_TAP_2_3: + { + return ACTION_FUNCTION_TAP(id); + break; + } + default: + break; + } + } + + return pgm_read_word(&fn_actions[function_id]); +} + + +// Zeal60 specific "action functions" +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch (id) + { + case TRIPLE_TAP_1_3: + case TRIPLE_TAP_2_3: + if (record->event.pressed) { + layer_on( id == TRIPLE_TAP_1_3 ? 1 : 2 ); + if (record->tap.count && !record->tap.interrupted) { + if (record->tap.count >= 3) { + layer_invert(3); + } + } else { + record->tap.count = 0; + } + } else { + layer_off( id == TRIPLE_TAP_1_3 ? 1 : 2 ); + } + break; + } +} + +void led_set_kb(uint8_t usb_led) +{ +#if RGB_BACKLIGHT_ENABLED + backlight_set_indicator_state(usb_led); +#endif // RGB_BACKLIGHT_ENABLED +} + +void suspend_power_down_kb(void) +{ +#if RGB_BACKLIGHT_ENABLED + backlight_set_suspend_state(true); +#endif // RGB_BACKLIGHT_ENABLED +} + +void suspend_wakeup_init_kb(void) +{ +#if RGB_BACKLIGHT_ENABLED + backlight_set_suspend_state(false); +#endif // RGB_BACKLIGHT_ENABLED +} + diff --git a/keyboards/wilba_tech/wt_rgb_backlight.c b/keyboards/wilba_tech/wt_rgb_backlight.c new file mode 100644 index 00000000000..9116e98ba79 --- /dev/null +++ b/keyboards/wilba_tech/wt_rgb_backlight.c @@ -0,0 +1,2442 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#if defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_ZEAL65) || defined(RGB_BACKLIGHT_M60_A) || defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_KOYU) || defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_U80_A) +#else +#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A, RGB_BACKLIGHT_M6_B, RGB_BACKLIGHT_KOYU, RGB_BACKLIGHT_HS60, RGB_BACKLIGHT_NK65, RGB_BACKLIGHT_U80_A +#endif + +#ifndef MAX + #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) +#endif + +#ifndef MIN + #define MIN(a,b) ((a) < (b)? (a): (b)) +#endif + +#include "quantum.h" +#include "wt_rgb_backlight.h" +#include "wt_rgb_backlight_api.h" +#include "wt_rgb_backlight_keycodes.h" + +#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) +#include +#include +#include +#include "drivers/avr/i2c_master.h" +#else +#include "ch.h" +#include "hal.h" +#include "drivers/arm/i2c_master.h" +#include "tmk_core/common/eeprom.h" +#endif +#include "progmem.h" +#include "quantum/color.h" + +#if defined(RGB_BACKLIGHT_M6_B) +#include "drivers/issi/is31fl3218.h" +#define BACKLIGHT_LED_COUNT 6 +#elif defined(RGB_BACKLIGHT_HS60) +#include "drivers/issi/is31fl3733.h" +#define BACKLIGHT_LED_COUNT 64 +#elif defined(RGB_BACKLIGHT_NK65) +#include "drivers/issi/is31fl3733.h" +#define BACKLIGHT_LED_COUNT 69 +#else +#include "drivers/issi/is31fl3731.h" +#if defined(RGB_BACKLIGHT_U80_A) +#define BACKLIGHT_LED_COUNT 108 +#else +#define BACKLIGHT_LED_COUNT 72 +#endif +#endif + +#define BACKLIGHT_EFFECT_MAX 10 + +backlight_config g_config = { + .use_split_backspace = RGB_BACKLIGHT_USE_SPLIT_BACKSPACE, + .use_split_left_shift = RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT, + .use_split_right_shift = RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT, + .use_7u_spacebar = RGB_BACKLIGHT_USE_7U_SPACEBAR, + .use_iso_enter = RGB_BACKLIGHT_USE_ISO_ENTER, + .disable_hhkb_blocker_leds = RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS, + .disable_when_usb_suspended = RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED, + .disable_after_timeout = RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT, + .brightness = RGB_BACKLIGHT_BRIGHTNESS, + .effect = RGB_BACKLIGHT_EFFECT, + .effect_speed = RGB_BACKLIGHT_EFFECT_SPEED, + .color_1 = RGB_BACKLIGHT_COLOR_1, + .color_2 = RGB_BACKLIGHT_COLOR_2, + .caps_lock_indicator = RGB_BACKLIGHT_CAPS_LOCK_INDICATOR, + .layer_1_indicator = RGB_BACKLIGHT_LAYER_1_INDICATOR, + .layer_2_indicator = RGB_BACKLIGHT_LAYER_2_INDICATOR, + .layer_3_indicator = RGB_BACKLIGHT_LAYER_3_INDICATOR, + .alphas_mods = { + RGB_BACKLIGHT_ALPHAS_MODS_ROW_0, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_1, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_2, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_3, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 }, +#if defined(RGB_BACKLIGHT_M6_B) + .custom_color = { { 0, 255 }, { 43, 255 }, { 85, 255 }, { 128, 255 }, { 171, 255 }, { 213, 255 } } +#endif +}; + +bool g_suspend_state = false; +uint8_t g_indicator_state = 0; + +// Global tick at 20 Hz +uint32_t g_tick = 0; + +// Ticks since this key was last hit. +uint8_t g_key_hit[BACKLIGHT_LED_COUNT]; + +// Ticks since any key was last hit. +uint32_t g_any_key_hit = 0; + +#if defined(RGB_BACKLIGHT_HS60) + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// ADDR_2 is not needed. it is here as a dummy +#define ISSI_ADDR_1 0x50 + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, B_1, A_1, C_1}, //LA1 + {0, E_1, D_1, F_1}, //LA2 + {0, H_1, G_1, I_1}, //LA3 + {0, K_1, J_1, L_1}, //LA4 + {0, B_2, A_2, C_2}, //LA5 + {0, E_2, D_2, F_2}, //LA6 + {0, H_2, G_2, I_2}, //LA7 + {0, K_2, J_2, L_2}, //LA8 + {0, B_3, A_3, C_3}, //LA9 + {0, E_3, D_3, F_3}, //LA10 + {0, H_3, G_3, I_3}, //LA11 + {0, K_3, J_3, L_3}, //LA12 + {0, B_4, A_4, C_4}, //LA13 + {0, E_4, D_4, F_4}, //LA14 + {0, H_4, G_4, I_4}, //LA15 + {0, K_4, J_4, L_4}, //LA16 + {0, B_5, A_5, C_5}, //LA17 + {0, E_5, D_5, F_5}, //LA18 + {0, H_5, G_5, I_5}, //LA19 + {0, K_5, J_5, L_5}, //LA20 + {0, B_6, A_6, C_6}, //LA21 + {0, E_6, D_6, F_6}, //LA22 + {0, H_6, G_6, I_6}, //LA23 + {0, K_6, J_6, L_6}, //LA24 + {0, B_7, A_7, C_7}, //LA25 + {0, E_7, D_7, F_7}, //LA26 + {0, H_7, G_7, I_7}, //LA27 + {0, K_7, J_7, L_7}, //LA28 + {0, B_8, A_8, C_8}, //LA29 + {0, E_8, D_8, F_8}, //LA30 + {0, H_8, G_8, I_8}, //LA31 + {0, K_8, J_8, L_8}, //LA32 + {0, B_9, A_9, C_9}, //LA33 + {0, E_9, D_9, F_9}, //LA34 + {0, H_9, G_9, I_9}, //LA35 + {0, K_9, J_9, L_9}, //LA36 + {0, B_10, A_10, C_10}, //LA37 + {0, E_10, D_10, F_10}, //LA38 + {0, H_10, G_10, I_10}, //LA39 + {0, K_10, J_10, L_10}, //LA40 + {0, B_11, A_11, C_11}, //LA41 + {0, E_11, D_11, F_11}, //LA42 + {0, H_11, G_11, I_11}, //LA43 + {0, K_11, J_11, L_11}, //LA44 + {0, B_12, A_12, C_12}, //LA45 + {0, E_12, D_12, F_12}, //LA46 + {0, H_12, G_12, I_12}, //LA47 + {0, K_12, J_12, L_12}, //LA48 + {0, B_13, A_13, C_13}, //LA49 + {0, E_13, D_13, F_13}, //LA50 + {0, H_13, G_13, I_13}, //LA51 + {0, K_13, J_13, L_13}, //LA52 + {0, B_14, A_14, C_14}, //LA53 + {0, E_14, D_14, F_14}, //LA54 + {0, H_14, G_14, I_14}, //LA55 + {0, K_14, J_14, L_14}, //LA56 + {0, B_15, A_15, C_15}, //LA57 + {0, E_15, D_15, F_15}, //LA58 + {0, H_15, G_15, I_15}, //LA59 + {0, K_15, J_15, L_15}, //LA60 + {0, B_16, A_16, C_16}, //LA61 + {0, E_16, D_16, F_16}, //LA62 + {0, H_16, G_16, I_16}, //LA63 + {0, K_16, J_16, L_16}, //LA64 +}; + +#elif defined(RGB_BACKLIGHT_NK65) + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// ADDR_2 is not needed. it is here as a dummy +#define ISSI_ADDR_1 0x50 +#define ISSI_ADDR_2 0x52 + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, B_1, A_1, C_1}, //LA1 + {0, E_1, D_1, F_1}, //LA2 + {0, H_1, G_1, I_1}, //LA3 + {0, K_1, J_1, L_1}, //LA4 + {0, B_2, A_2, C_2}, //LA5 + {0, E_2, D_2, F_2}, //LA6 + {0, H_2, G_2, I_2}, //LA7 + {0, K_2, J_2, L_2}, //LA8 + {0, B_3, A_3, C_3}, //LA9 + {0, E_3, D_3, F_3}, //LA10 + {0, H_3, G_3, I_3}, //LA11 + {0, K_3, J_3, L_3}, //LA12 + {0, B_4, A_4, C_4}, //LA13 + {0, E_4, D_4, F_4}, //LA14 + {0, H_4, G_4, I_4}, //LA15 + {0, K_4, J_4, L_4}, //LA16 + {0, B_5, A_5, C_5}, //LA17 + {0, E_5, D_5, F_5}, //LA18 + {0, H_5, G_5, I_5}, //LA19 + {0, K_5, J_5, L_5}, //LA20 + {0, B_6, A_6, C_6}, //LA21 + {0, E_6, D_6, F_6}, //LA22 + {0, H_6, G_6, I_6}, //LA23 + {0, K_6, J_6, L_6}, //LA24 + {0, B_7, A_7, C_7}, //LA25 + {0, E_7, D_7, F_7}, //LA26 + {0, H_7, G_7, I_7}, //LA27 + {0, K_7, J_7, L_7}, //LA28 + {0, B_8, A_8, C_8}, //LA29 + {0, E_8, D_8, F_8}, //LA30 + {0, H_8, G_8, I_8}, //LA31 + {0, K_8, J_8, L_8}, //LA32 + {0, B_9, A_9, C_9}, //LA33 + {0, E_9, D_9, F_9}, //LA34 + {0, H_9, G_9, I_9}, //LA35 + {0, K_9, J_9, L_9}, //LA36 + {0, B_10, A_10, C_10}, //LA37 + {0, E_10, D_10, F_10}, //LA38 + {0, H_10, G_10, I_10}, //LA39 + {0, K_10, J_10, L_10}, //LA40 + {0, B_11, A_11, C_11}, //LA41 + {0, E_11, D_11, F_11}, //LA42 + {0, H_11, G_11, I_11}, //LA43 + {0, K_11, J_11, L_11}, //LA44 + {0, B_12, A_12, C_12}, //LA45 + {0, E_12, D_12, F_12}, //LA46 + {0, H_12, G_12, I_12}, //LA47 + {0, K_12, J_12, L_12}, //LA48 + {0, B_13, A_13, C_13}, //LA49 + {0, E_13, D_13, F_13}, //LA50 + {0, H_13, G_13, I_13}, //LA51 + {0, K_13, J_13, L_13}, //LA52 + {0, B_14, A_14, C_14}, //LA53 + {0, E_14, D_14, F_14}, //LA54 + {0, H_14, G_14, I_14}, //LA55 + {0, K_14, J_14, L_14}, //LA56 + {0, B_15, A_15, C_15}, //LA57 + {0, E_15, D_15, F_15}, //LA58 + {0, H_15, G_15, I_15}, //LA59 + {0, K_15, J_15, L_15}, //LA60 + {0, B_16, A_16, C_16}, //LA61 + {0, E_16, D_16, F_16}, //LA62 + {0, H_16, G_16, I_16}, //LA63 + {0, K_16, J_16, L_16}, //LA64 + + {1, B_1, A_1, C_1}, //LB1 + {1, E_1, D_1, F_1}, //LB2 + {1, H_1, G_1, I_1}, //LB3 + {1, K_1, J_1, L_1}, //LB4 + {1, B_2, A_2, C_2}, //LB5 + {1, E_2, D_2, F_2}, //LB6 + {1, H_2, G_2, I_2}, //LB7 + {1, K_2, J_2, L_2}, //LB8 + {1, B_3, A_3, C_3}, //LB9 + {1, E_3, D_3, F_3}, //LB10 + {1, H_3, G_3, I_3}, //LB11 + {1, K_3, J_3, L_3}, //LB12 + {1, B_4, A_4, C_4}, //LB13 + {1, E_4, D_4, F_4}, //LB14 + {1, H_4, G_4, I_4}, //LB15 + {1, K_4, J_4, L_4}, //LB16 + {1, B_5, A_5, C_5}, //LB17 + {1, E_5, D_5, F_5}, //LB18 + {1, H_5, G_5, I_5}, //LB19 + {1, K_5, J_5, L_5}, //LB20 + {1, B_6, A_6, C_6}, //LB21 + {1, E_6, D_6, F_6}, //LB22 + {1, H_6, G_6, I_6}, //LB23 + {1, K_6, J_6, L_6}, //LB24 + {1, B_7, A_7, C_7}, //LB25 + {1, E_7, D_7, F_7}, //LB26 + {1, H_7, G_7, I_7}, //LB27 + {1, K_7, J_7, L_7}, //LB28 + {1, B_8, A_8, C_8}, //LB29 + {1, E_8, D_8, F_8}, //LB30 + {1, H_8, G_8, I_8}, //LB31 + {1, K_8, J_8, L_8}, //LB32 + {1, B_9, A_9, C_9}, //LB33 + {1, E_9, D_9, F_9}, //LB34 + {1, H_9, G_9, I_9}, //LB35 + {1, K_9, J_9, L_9}, //LB36 + {1, B_10, A_10, C_10}, //LB37 + {1, E_10, D_10, F_10}, //LB38 + {1, H_10, G_10, I_10}, //LB39 + {1, K_10, J_10, L_10}, //LB40 + {1, B_11, A_11, C_11}, //LB41 + {1, E_11, D_11, F_11}, //LB42 + {1, H_11, G_11, I_11}, //LB43 + {1, K_11, J_11, L_11}, //LB44 + {1, B_12, A_12, C_12}, //LB45 + {1, E_12, D_12, F_12}, //LB46 + {1, H_12, G_12, I_12}, //LB47 + {1, K_12, J_12, L_12}, //LB48 + {1, B_13, A_13, C_13}, //LB49 + {1, E_13, D_13, F_13}, //LB50 + {1, H_13, G_13, I_13}, //LB51 + {1, K_13, J_13, L_13}, //LB52 + {1, B_14, A_14, C_14}, //LB53 + {1, E_14, D_14, F_14}, //LB54 + {1, H_14, G_14, I_14}, //LB55 + {1, K_14, J_14, L_14}, //LB56 + {1, B_15, A_15, C_15}, //LB57 + {1, E_15, D_15, F_15}, //LB58 + {1, H_15, G_15, I_15}, //LB59 + {1, K_15, J_15, L_15}, //LB60 + {1, B_16, A_16, C_16}, //LB61 + {1, E_16, D_16, F_16}, //LB62 + {1, H_16, G_16, I_16}, //LB63 + {1, K_16, J_16, L_16}, //LB64 +}; + +#elif defined(RGB_BACKLIGHT_U80_A) + +// U80-A prototype uses 3 ISSI drivers +#define ISSI_ADDR_1 0x74 // 11101[00] <- GND +#define ISSI_ADDR_2 0x76 // 11101[10] <- SDA +#define ISSI_ADDR_3 0x75 // 11101[01] <- SCL + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C2_1, C3_1, C4_1}, // LA0 + {0, C1_1, C3_2, C4_2}, // LA1 + {0, C1_2, C2_2, C4_3}, // LA2 + {0, C1_3, C2_3, C3_3}, // LA3 + {0, C1_4, C2_4, C3_4}, // LA4 + {0, C1_5, C2_5, C3_5}, // LA5 + {0, C1_6, C2_6, C3_6}, // LA6 + {0, C1_7, C2_7, C3_7}, // LA7 + {0, C1_8, C2_8, C3_8}, // LA8 + {0, C9_1, C8_1, C7_1}, // LA9 + {0, C9_2, C8_2, C7_2}, // LA10 + {0, C9_3, C8_3, C7_3}, // LA11 + {0, C9_4, C8_4, C7_4}, // LA12 + {0, C9_5, C8_5, C7_5}, // LA13 + {0, C9_6, C8_6, C7_6}, // LA14 + {0, C9_7, C8_7, C6_6}, // LA15 + {0, C9_8, C7_7, C6_7}, // LA16 + {0, C8_8, C7_8, C6_8}, // LA17 + + {0, C2_9, C3_9, C4_9}, // LB0 + {0, C1_9, C3_10, C4_10}, // LB1 + {0, C1_10, C2_10, C4_11}, // LB2 + {0, C1_11, C2_11, C3_11}, // LB3 + {0, C1_12, C2_12, C3_12}, // LB4 + {0, C1_13, C2_13, C3_13}, // LB5 + {0, C1_14, C2_14, C3_14}, // LB6 + {0, C1_15, C2_15, C3_15}, // LB7 + {0, C1_16, C2_16, C3_16}, // LB8 + {0, C9_9, C8_9, C7_9}, // LB9 + {0, C9_10, C8_10, C7_10}, // LB10 + {0, C9_11, C8_11, C7_11}, // LB11 + {0, C9_12, C8_12, C7_12}, // LB12 + {0, C9_13, C8_13, C7_13}, // LB13 + {0, C9_14, C8_14, C7_14}, // LB14 + {0, C9_15, C8_15, C6_14}, // LB15 + {0, C9_16, C7_15, C6_15}, // LB16 + {0, C8_16, C7_16, C6_16}, // LB17 + + {1, C2_1, C3_1, C4_1}, // LC0 + {1, C1_1, C3_2, C4_2}, // LC1 + {1, C1_2, C2_2, C4_3}, // LC2 + {1, C1_3, C2_3, C3_3}, // LC3 + {1, C1_4, C2_4, C3_4}, // LC4 + {1, C1_5, C2_5, C3_5}, // LC5 + {1, C1_6, C2_6, C3_6}, // LC6 + {1, C1_7, C2_7, C3_7}, // LC7 + {1, C1_8, C2_8, C3_8}, // LC8 + {1, C9_1, C8_1, C7_1}, // LC9 + {1, C9_2, C8_2, C7_2}, // LC10 + {1, C9_3, C8_3, C7_3}, // LC11 + {1, C9_4, C8_4, C7_4}, // LC12 + {1, C9_5, C8_5, C7_5}, // LC13 + {1, C9_6, C8_6, C7_6}, // LC14 + {1, C9_7, C8_7, C6_6}, // LC15 + {1, C9_8, C7_7, C6_7}, // LC16 + {1, C8_8, C7_8, C6_8}, // LC17 + + {1, C2_9, C3_9, C4_9}, // LD0 + {1, C1_9, C3_10, C4_10}, // LD1 + {1, C1_10, C2_10, C4_11}, // LD2 + {1, C1_11, C2_11, C3_11}, // LD3 + {1, C1_12, C2_12, C3_12}, // LD4 + {1, C1_13, C2_13, C3_13}, // LD5 + {1, C1_14, C2_14, C3_14}, // LD6 + {1, C1_15, C2_15, C3_15}, // LD7 + {1, C1_16, C2_16, C3_16}, // LD8 + {1, C9_9, C8_9, C7_9}, // LD9 + {1, C9_10, C8_10, C7_10}, // LD10 + {1, C9_11, C8_11, C7_11}, // LD11 + {1, C9_12, C8_12, C7_12}, // LD12 + {1, C9_13, C8_13, C7_13}, // LD13 + {1, C9_14, C8_14, C7_14}, // LD14 + {1, C9_15, C8_15, C6_14}, // LD15 + {1, C9_16, C7_15, C6_15}, // LD16 + {1, C8_16, C7_16, C6_16}, // LD17 + + {2, C2_1, C3_1, C4_1}, // LE0 + {2, C1_1, C3_2, C4_2}, // LE1 + {2, C1_2, C2_2, C4_3}, // LE2 + {2, C1_3, C2_3, C3_3}, // LE3 + {2, C1_4, C2_4, C3_4}, // LE4 + {2, C1_5, C2_5, C3_5}, // LE5 + {2, C1_6, C2_6, C3_6}, // LE6 + {2, C1_7, C2_7, C3_7}, // LE7 + {2, C1_8, C2_8, C3_8}, // LE8 + {2, C9_1, C8_1, C7_1}, // LE9 + {2, C9_2, C8_2, C7_2}, // LE10 + {2, C9_3, C8_3, C7_3}, // LE11 + {2, C9_4, C8_4, C7_4}, // LE12 + {2, C9_5, C8_5, C7_5}, // LE13 + {2, C9_6, C8_6, C7_6}, // LE14 + {2, C9_7, C8_7, C6_6}, // LE15 + {2, C9_8, C7_7, C6_7}, // LE16 + {2, C8_8, C7_8, C6_8}, // LE17 + + {2, C2_9, C3_9, C4_9}, // LF0 + {2, C1_9, C3_10, C4_10}, // LF1 + {2, C1_10, C2_10, C4_11}, // LF2 + {2, C1_11, C2_11, C3_11}, // LF3 + {2, C1_12, C2_12, C3_12}, // LF4 + {2, C1_13, C2_13, C3_13}, // LF5 + {2, C1_14, C2_14, C3_14}, // LF6 + {2, C1_15, C2_15, C3_15}, // LF7 + {2, C1_16, C2_16, C3_16}, // LF8 + {2, C9_9, C8_9, C7_9}, // LF9 + {2, C9_10, C8_10, C7_10}, // LF10 + {2, C9_11, C8_11, C7_11}, // LF11 + {2, C9_12, C8_12, C7_12}, // LF12 + {2, C9_13, C8_13, C7_13}, // LF13 + {2, C9_14, C8_14, C7_14}, // LF14 + {2, C9_15, C8_15, C6_14}, // LF15 + {2, C9_16, C7_15, C6_15}, // LF16 + {2, C8_16, C7_16, C6_16}, // LF17 +}; +#elif !defined(RGB_BACKLIGHT_M6_B) +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +#define ISSI_ADDR_1 0x74 +#define ISSI_ADDR_2 0x76 + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C2_1, C3_1, C4_1}, // LA0 + {0, C1_1, C3_2, C4_2}, // LA1 + {0, C1_2, C2_2, C4_3}, // LA2 + {0, C1_3, C2_3, C3_3}, // LA3 + {0, C1_4, C2_4, C3_4}, // LA4 + {0, C1_5, C2_5, C3_5}, // LA5 + {0, C1_6, C2_6, C3_6}, // LA6 + {0, C1_7, C2_7, C3_7}, // LA7 + {0, C1_8, C2_8, C3_8}, // LA8 + {0, C9_1, C8_1, C7_1}, // LA9 + {0, C9_2, C8_2, C7_2}, // LA10 + {0, C9_3, C8_3, C7_3}, // LA11 + {0, C9_4, C8_4, C7_4}, // LA12 + {0, C9_5, C8_5, C7_5}, // LA13 + {0, C9_6, C8_6, C7_6}, // LA14 + {0, C9_7, C8_7, C6_6}, // LA15 + {0, C9_8, C7_7, C6_7}, // LA16 + {0, C8_8, C7_8, C6_8}, // LA17 + + {0, C2_9, C3_9, C4_9}, // LB0 + {0, C1_9, C3_10, C4_10}, // LB1 + {0, C1_10, C2_10, C4_11}, // LB2 + {0, C1_11, C2_11, C3_11}, // LB3 + {0, C1_12, C2_12, C3_12}, // LB4 + {0, C1_13, C2_13, C3_13}, // LB5 + {0, C1_14, C2_14, C3_14}, // LB6 + {0, C1_15, C2_15, C3_15}, // LB7 + {0, C1_16, C2_16, C3_16}, // LB8 + {0, C9_9, C8_9, C7_9}, // LB9 + {0, C9_10, C8_10, C7_10}, // LB10 + {0, C9_11, C8_11, C7_11}, // LB11 + {0, C9_12, C8_12, C7_12}, // LB12 + {0, C9_13, C8_13, C7_13}, // LB13 + {0, C9_14, C8_14, C7_14}, // LB14 + {0, C9_15, C8_15, C6_14}, // LB15 + {0, C9_16, C7_15, C6_15}, // LB16 + {0, C8_16, C7_16, C6_16}, // LB17 + + {1, C2_1, C3_1, C4_1}, // LC0 + {1, C1_1, C3_2, C4_2}, // LC1 + {1, C1_2, C2_2, C4_3}, // LC2 + {1, C1_3, C2_3, C3_3}, // LC3 + {1, C1_4, C2_4, C3_4}, // LC4 + {1, C1_5, C2_5, C3_5}, // LC5 + {1, C1_6, C2_6, C3_6}, // LC6 + {1, C1_7, C2_7, C3_7}, // LC7 + {1, C1_8, C2_8, C3_8}, // LC8 + {1, C9_1, C8_1, C7_1}, // LC9 + {1, C9_2, C8_2, C7_2}, // LC10 + {1, C9_3, C8_3, C7_3}, // LC11 + {1, C9_4, C8_4, C7_4}, // LC12 + {1, C9_5, C8_5, C7_5}, // LC13 + {1, C9_6, C8_6, C7_6}, // LC14 + {1, C9_7, C8_7, C6_6}, // LC15 + {1, C9_8, C7_7, C6_7}, // LC16 + {1, C8_8, C7_8, C6_8}, // LC17 + + {1, C2_9, C3_9, C4_9}, // LD0 + {1, C1_9, C3_10, C4_10}, // LD1 + {1, C1_10, C2_10, C4_11}, // LD2 + {1, C1_11, C2_11, C3_11}, // LD3 + {1, C1_12, C2_12, C3_12}, // LD4 + {1, C1_13, C2_13, C3_13}, // LD5 + {1, C1_14, C2_14, C3_14}, // LD6 + {1, C1_15, C2_15, C3_15}, // LD7 + {1, C1_16, C2_16, C3_16}, // LD8 + {1, C9_9, C8_9, C7_9}, // LD9 + {1, C9_10, C8_10, C7_10}, // LD10 + {1, C9_11, C8_11, C7_11}, // LD11 + {1, C9_12, C8_12, C7_12}, // LD12 + {1, C9_13, C8_13, C7_13}, // LD13 + {1, C9_14, C8_14, C7_14}, // LD14 + {1, C9_15, C8_15, C6_14}, // LD15 + {1, C9_16, C7_15, C6_15}, // LD16 + {1, C8_16, C7_16, C6_16}, // LD17 +}; +#endif // !defined(RGB_BACKLIGHT_M6_B) + + +typedef struct Point { + uint8_t x; + uint8_t y; +} Point; + + +// index in range 0..71 (LA0..LA17, LB0..LB17, LC0..LC17, LD0..LD17) +// point values in range x=0..224 y=0..64 +// origin is center of top-left key (i.e Esc) +#if defined(RGB_BACKLIGHT_ZEAL65) +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA0..LA17 + {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, + {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, + // LB0..LB17 + {144,0}, {160,0}, {176,0}, {192,0}, {216,0}, {224,0}, {240,0}, {240,16}, {240,32}, + {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {240,48}, {240,64}, {224,64}, + // LC0..LC17 + {96,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {255,255}, {48,60}, {28,64}, + {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {20,44}, {10,48}, {4,64}, + // LD0..LD17 + {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {202,48}, {224,48}, + {116,48}, {132,48}, {148,48}, {164,48}, {255,255}, {144,60}, {164,64}, {188,64}, {208,64} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA0..LA17 + {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,243}, + {61,255}, {67,255}, {72,255}, {77,255}, {82,255}, {86,255}, {90,255}, {93,255}, {96,255}, + // LB0..LB17 + {56,255}, {51,255}, {46,255}, {42,255}, {37,255}, {35,255}, {32,255}, {19,255}, {0,255}, + {53,132}, {44,145}, {37,164}, {31,187}, {26,213}, {22,249}, {237,255}, {224,255}, {221,255}, + // LC0..LC17 + {184,255}, {179,135}, {170,149}, {163,169}, {157,193}, {153,220}, {255,255}, {167,255}, {165,255}, + {128,26}, {128,60}, {128,94}, {128,128}, {128,162}, {128,196}, {145,233}, {148,255}, {161,255}, + // LD0..LD17 + {0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {0,201}, {224,181}, {230,217}, {235,255}, + {189,128}, {200,131}, {210,141}, {218,159}, {255,255}, {201,228}, {206,255}, {213,255}, {218,255} +}; +#elif defined(RGB_BACKLIGHT_KOYU) +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA0..LA17 + {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, + {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, + // LB0..LB17 + {144,0}, {160,0}, {176,0}, {192,0}, {208,0}, {224,0}, {240,0}, {240,16}, {240,32}, + {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {240,48}, {240,64}, {224,64}, + // LC0..LC17 + {112,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {64,60}, {44,60}, {24,64}, + {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {255,255}, {10,48}, {4,64}, + // LD0..LD17 + {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {202,48}, {224,48}, + {116,48}, {132,48}, {148,48}, {164,48}, {255,255}, {160,60}, {180,64}, {208,64}, {255,255} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA0..LA17 + {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,243}, + {61,255}, {67,255}, {72,255}, {77,255}, {82,255}, {86,255}, {90,255}, {93,255}, {96,255}, + // LB0..LB17 + {56,255}, {51,255}, {46,255}, {42,255}, {38,255}, {35,255}, {32,255}, {19,255}, {0,255}, + {53,132}, {44,145}, {37,164}, {31,187}, {26,213}, {22,249}, {237,255}, {224,255}, {221,255}, + // LC0..LC17 + {189,255}, {179,135}, {170,149}, {163,169}, {157,193}, {153,220}, {172,252}, {169,255}, {165,255}, + {128,26}, {128,60}, {128,94}, {128,128}, {128,162}, {128,196}, {255,255}, {148,255}, {161,255}, + // LD0..LD17 + {0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {0,201}, {224,181}, {230,217}, {235,255}, + {189,128}, {200,131}, {210,141}, {218,159}, {255,255}, {207,238}, {211,255}, {218,255}, {255,255} +}; +#elif defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_M60_A) +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA0..LA17 + {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, + {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, + // LB0..LB17 + {144,0}, {160,0}, {176,0}, {192,0}, {216,0}, {224,0}, {255,255}, {255,255}, {255,255}, + {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {255,255}, {255,255}, {255,255}, + // LC0..LC17 + {102,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {60,64}, {43,64}, {23,64}, + {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {20,48}, {2,48}, {3,64}, + // LD0..LD17 + {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {210,48}, {224,48}, + {116,48}, {132,48}, {148,48}, {164,48}, {144,64}, {161,64}, {181,64}, {201,64}, {221,64} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA0..LA17 + {58,129}, {70,129}, {80,139}, {89,157}, {96,181}, {101,208}, {105,238}, {109,255}, {128,247}, + {58,255}, {64,255}, {70,255}, {75,255}, {80,255}, {85,255}, {89,255}, {93,255}, {96,255}, + // LB0..LB17 + {53,255}, {48,255}, {43,255}, {39,255}, {34,255}, {32,255}, {255,255}, {255,255}, {255,255}, + {48,139}, {39,157}, {32,181}, {27,208}, {23,238}, {19,255}, {255,255}, {255,255}, {255,255}, + // LC0..LC17 + {188,255}, {183,131}, {173,143}, {165,163}, {159,188}, {154,216}, {172,252}, {170,255}, {165,255}, + {128,9}, {128,46}, {128,82}, {128,119}, {128,155}, {128,192}, {150,244}, {147,255}, {161,255}, + // LD0..LD17 + {0,27}, {0,64}, {0,101}, {0,137}, {0,174}, {255,233}, {228,201}, {235,255}, {237,255}, + {195,128}, {206,136}, {215,152}, {222,175}, {205,234}, {209,255}, {214,255}, {219,255}, {223,255} +}; +#elif defined(RGB_BACKLIGHT_U80_A) +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + // Thse are scaled by 14.5 per U + // LA0..LA17 + {109,36}, {94,36}, {80,36}, {65,36}, {51,36}, {36,36}, {22,36}, {4,36}, {5,51}, + {116,22}, {102,22}, {87,22}, {73,22}, {58,22}, {44,22}, {29,22}, {15,22}, {0,22}, + // LB0..LB17 + {131,22}, {145,22}, {160,22}, {174,22}, {196,22}, {0,0}, {0,0}, {0,0}, {0,0}, + {123,36}, {138,36}, {152,36}, {167,36}, {181,36}, {199,36}, {0,0}, {0,0}, {0,0}, + // LC0..LC17 + {102,80}, {91,65}, {76,65}, {62,65}, {47,65}, {33,65}, {58,76}, {40,80}, {22,80}, + {98,51}, {83,51}, {69,51}, {54,51}, {40,51}, {25,51}, {0,0}, {9,65}, {4,80}, + // LD0..LD17 + {112,51}, {127,51}, {141,51}, {156,51}, {170,51}, {194,51}, {163,65}, {190,65}, {0,0}, + {105,65}, {120,65}, {134,65}, {149,65}, {0,0}, {145,76}, {163,80}, {181,80}, {199,80}, + // LE0..LE17 + {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, + {73,0}, {94,0}, {109,0}, {123,0}, {138,0}, {58,0}, {44,0}, {29,0}, {0,0}, + // LF0..LF17 + {160,0}, {174,0}, {189,0}, {203,0}, {225,0}, {239,0}, {254,0}, {254,22}, {254,36}, + {239,22}, {239,36}, {225,22}, {225,36}, {0,0}, {239,65}, {225,80}, {239,80}, {254,80} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA0..LA17 + {59,129}, {69,129}, {80,138}, {88,154}, {95,175}, {100,200}, {104,227}, {107,255}, {128,226}, + {59,255}, {64,255}, {69,255}, {75,255}, {80,255}, {84,255}, {88,255}, {91,255}, {95,255}, + // LB0..LB17 + {53,255}, {48,255}, {44,255}, {40,255}, {35,255}, {255,255}, {255,255}, {255,255}, {255,255}, + {48,138}, {40,154}, {33,175}, {28,200}, {24,227}, {21,255}, {255,255}, {255,255}, {255,255}, + // LC0..LC17 + {192,255}, {184,131}, {174,141}, {166,159}, {160,181}, {155,207}, {174,244}, {171,255}, {166,255}, + {128,9}, {128,43}, {128,77}, {128,111}, {128,145}, {128,179}, {255,255}, {150,252}, {162,255}, + // LD0..LD17 + {0,26}, {0,60}, {0,94}, {0,128}, {0,162}, {0,218}, {227,193}, {234,245}, {255,255}, + {195,128}, {205,135}, {214,149}, {221,169}, {255,255}, {210,244}, {213,255}, {218,255}, {222,255}, + // LE0..LE17 + {255,255}, {255,255}, {255,255}, {255,255}, {255,255}, {255,255}, {255,255}, {255,255}, {255,255}, + {70,255}, {66,255}, {62,255}, {59,255}, {56,255}, {73,255}, {76,255}, {79,255}, {84,255}, + // LF0..LF17 + {52,255}, {49,255}, {47,255}, {44,255}, {41,255}, {38,255}, {37,255}, {25,255}, {14,255}, + {27,255}, {15,255}, {29,255}, {17,255}, {255,255}, {241,255}, {227,255}, {229,255}, {231,255} +}; +#elif defined(RGB_BACKLIGHT_HS60) && defined(HS60_ANSI) +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA1..LA47 + {0,0}, {4,16}, {6,32}, {10,48}, {16,0}, {24,16}, {28,32}, {36,48}, {32,0}, {40,16}, {44,32}, {52,48}, + {48,0}, {56,16}, {60,32}, {68,48}, {64,0}, {72,16}, {76,32}, {84,48}, {80,0}, {88,16}, {92,32}, {100,48}, + {96,0}, {104,16}, {108,32}, {116,48}, {112,0}, {120,16}, {124,32}, {132,48}, {128,0}, {136,16}, {140,32}, + {148,48}, {144,0}, {152,16}, {156,32}, {164,48}, {160,0}, {168,16}, {172,32}, {180,48}, {176,0}, {184, 16}, {188,32}, + {255,255},// LA48 does not exist, dummy + // LA49..LA50 + {192,0}, {200,16}, + {255,255},// LA51 does not exit, dummy + // LA52..LA60 + {210,48}, {216,0}, {220,16}, {214,32}, {222,64}, {2,64}, {22,64}, {42,64}, {102,64}, + {255,255},// LA61 does not exit, dummy + {162,64}, {182,64}, {202,64} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA1..LA47 + {96,255}, {109,255}, {128,242}, {148,255}, {93,255}, {105,238}, {128,192}, {154,216}, {89,255}, {101,208}, {128,155}, {159,188}, + {85,255}, {96,181}, {128,119}, {165,163}, {81,255}, {89,157}, {128,82}, {173,143}, {75,255}, {81,139}, {128,46}, {183,131}, + {70,255}, {70,129}, {129,9}, {195,128}, {64,255}, {58,129}, {255,27}, {206,136}, {58,255}, {47,139}, {255,64}, {215,152}, + {53,255}, {39,157}, {255,101}, {222,175}, {47,255}, {32,181}, {255,137}, {228,201}, {43,255}, {27,208}, {255, 174}, + {255,255},// LA48 does not exist, dummy + // LA49..LA50 + {39,255}, {23,238}, + {255,255},// LA51 does not exit, dummy + // LA52..LA60 + {235,255}, {33,255}, {19,255}, {255,233}, {224,255}, {160,255}, {164,255}, {169,255}, {188,255}, + {255,255},// LA61 does not exit, dummy + {209,255}, {215,255}, {220,255} +}; +#elif defined(RGB_BACKLIGHT_HS60) && defined(HS60_HHKB) +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA1..LA60 + {0,0}, {4,16}, {6,32}, {10,48}, {16,0}, {24,16}, {28,32}, {36,48}, {32,0}, {40,16}, {44,32}, {52,48}, + {48,0}, {56,16}, {60,32}, {68,48}, {64,0}, {72,16}, {76,32}, {84,48}, {80,0}, {88,16}, {92,32}, {100,48}, + {96,0}, {104,16}, {108,32}, {116,48}, {112,0}, {120,16}, {124,32}, {132,48}, {128,0}, {136,16}, {140,32}, + {148,48}, {144,0}, {152,16}, {156,32}, {164,48}, {160,0}, {168,16}, {172,32}, {180,48}, {176,0}, {184, 16}, {188,32}, + {224,0}, {192,0}, {200,16}, {202,48}, {224,48}, {208,0}, {220,16}, {214,32}, {220,64}, {4,64}, {24,64}, {44,64}, {112,64}, + {255,255}, {255,255}, // LA61..LA62 does not exit, dummy + // LA63..LA64 + {180,64}, {200,64} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA1..LA60 + {96,255}, {109,255}, {128,242}, {148,255}, {93,255}, {105,238}, {128,192}, {154,216}, {89,255}, {101,208}, {128,155}, {159,188}, + {85,255}, {96,181}, {128,119}, {165,163}, {81,255}, {89,157}, {128,82}, {173,143}, {75,255}, {81,139}, {128,46}, {183,131}, + {70,255}, {70,129}, {129,9}, {195,128}, {64,255}, {58,129}, {255,27}, {206,136}, {58,255}, {47,139}, {255,64}, {215,152}, + {53,255}, {39,157}, {255,101}, {222,175}, {47,255}, {32,181}, {255,137}, {228,201}, {43,255}, {27,208}, {255, 174}, {32,255}, + {39,255}, {23,238}, {233,242}, {237,255}, {35,255}, {19,255}, {255,233}, {223,255}, {161,255}, {165,255}, {170,255}, {192,255}, + {255,255}, {255,255}, // LA61..LA62 does not exit, dummy + // LA63..LA64 + {214,255}, {219,255} +}; +#elif defined(RGB_BACKLIGHT_HS60) //HS60_ISO +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA1..LA50 + {0,0}, {4,16}, {6,32}, {2,48}, {16,0}, {24,16}, {28,32}, {36,48}, {32,0}, {40,16}, {44,32}, {52,48}, {48,0}, + {56,16}, {60,32}, {68,48}, {64,0}, {72,16}, {76,32}, {84,48}, {80,0}, {88,16}, {92,32}, {100,48}, {96,0}, {104,16}, + {108,32}, {116,48}, {112,0}, {120,16}, {124,32}, {132,48}, {128,0}, {136,16}, {140,32}, {148,48}, {144,0}, {152,16}, + {156,32}, {164,48}, {160,0}, {168,16}, {172,32}, {180,48}, {176,0}, {184, 16}, {188,32}, {20,48}, {192,0}, {200,16}, + {255,255},// LA51 does not exit, dummy + // LA52..LA60 + {210,48}, {216,0}, {220,16}, {222,24}, {222,64}, {2,64}, {22,64}, {42,64}, {102,64}, + {255,255},// LA61 does not exit, dummy + {162,64}, {182,64}, {202,64} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA1..LA50 + {96,255}, {109,255}, {128,242}, {147,255}, {93,255}, {105,238}, {128,192}, {154,216}, {89,255}, {101,208}, {128,155}, {159,188}, {85,255}, + {96,181}, {128,119}, {165,163}, {81,255}, {89,157}, {128,82}, {173,143}, {75,255}, {81,139}, {128,46}, {183,131}, {70,255}, {70,129}, + {129,9}, {195,128}, {64,255}, {58,129}, {255,27}, {206,136}, {58,255}, {47,139}, {255,64}, {215,152}, {53,255}, {39,157}, {255,101}, + {222,175}, {47,255}, {32,181}, {255,137}, {228,201}, {43,255}, {27,208}, {255, 174}, {150,246}, {39,255}, {23,238}, + {255,255},// LA51 does not exit, dummy + // LA52..LA60 + {235,255}, {33,255}, {19,255}, {10,255}, {224,255}, {160,255}, {164,255}, {169,255}, {188,255}, + {255,255},// LA61 does not exit, dummy + {209,255}, {215,255}, {220,255} +}; +#elif defined(RGB_BACKLIGHT_NK65) +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA1..LA60 + {0,0}, {4,16}, {6,32}, {10,48}, {16,0}, {24,16}, {28,32}, {36,48}, {32,0}, {40,16}, {44,32}, {52,48}, + {48,0}, {56,16}, {60,32}, {68,48}, {64,0}, {72,16}, {76,32}, {84,48}, {80,0}, {88,16}, {92,32}, {100,48}, + {96,0}, {104,16}, {108,32}, {116,48}, {112,0}, {120,16}, {124,32}, {132,48}, {128,0}, {136,16}, {140,32}, + {148,48}, {144,0}, {152,16}, {156,32}, {164,48}, {160,0}, {168,16}, {172,32}, {180,48}, {176,0}, {184, 16}, {188,32}, + {160,64}, {192,0}, {200,16}, {210,48}, {224,48}, {216,0}, {220,16}, {214,32}, {224,64}, {2,64}, {22,64}, {42,64}, {102,64}, + {255,255},// LA61 does not exit, dummy + //LA62..LB5 + {176,64}, {192,64}, {208,64}, {240,0}, {240,16}, {240,48}, {240,64}, {240,32} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA1..LA60 + {96,255}, {109,255}, {128,242}, {148,255}, {93,255}, {105,238}, {128,192}, {154,216}, {89,255}, {101,208}, {128,155}, {159,188}, + {85,255}, {96,181}, {128,119}, {165,163}, {81,255}, {89,157}, {128,82}, {173,143}, {75,255}, {81,139}, {128,46}, {183,131}, + {70,255}, {70,129}, {129,9}, {195,128}, {64,255}, {58,129}, {255,27}, {206,136}, {58,255}, {47,139}, {255,64}, {215,152}, + {53,255}, {39,157}, {255,101}, {222,175}, {47,255}, {32,181}, {255,137}, {228,201}, {43,255}, {27,208}, {255, 174}, + {208,255}, {39,255}, {23,238}, {235,255}, {235,255}, {33,255}, {19,255}, {255,233}, {224,255}, {160,255}, {164,255}, {169,255}, {188,255}, + {255,255},// LA61 does not exit, dummy + //LA62..LB5 + {221,255}, {225,255}, {229,255}, {22,255}, {12,255}, {244,255}, {234,255}, {255,255}, +}; +#elif defined(RGB_BACKLIGHT_M6_B) +// M6-B is really simple: +// 0 3 5 +// 1 2 4 +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + {0,0}, {0,16}, {16,16}, {16,0}, {32,16}, {32,0} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + {160,255}, {96,255}, {77,255}, {179,255}, {51,255}, {205,255} +}; +#endif + +// This may seem counter-intuitive, but it's quite flexible. +// For each LED, get it's position to decide what color to make it. +// This solves the issue of LEDs (and switches) not aligning to a grid, +// or having a large "bitmap" and sampling them. +void map_led_to_point( uint8_t index, Point *point ) +{ + // Slightly messy way to get Point structs out of progmem. + uint8_t *addr = (uint8_t*)&g_map_led_to_point[index]; + point->x = pgm_read_byte(addr); + point->y = pgm_read_byte(addr+1); + +#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) + return; +#endif + + switch (index) + { + case 18+4: // LB4A + if ( g_config.use_split_backspace ) + point->x -= 8; + break; +#if defined(RGB_BACKLIGHT_ZEAL60) + case 18+14: // LB14A + if ( g_config.use_iso_enter ) + point->y += 8; // extremely pedantic + break; + case 54+5: // LD5A + if ( !g_config.use_iso_enter ) + point->x -= 10; + break; + case 36+16: // LC16A + if ( !g_config.use_split_left_shift ) + point->x += 8; + break; +#endif +#if defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_M60_A) + case 36+0: // LC0A + if ( g_config.use_7u_spacebar ) + point->x += 10; + break; + case 36+6: // LC6A + if ( g_config.use_7u_spacebar ) + point->x += 4; + break; + case 54+7: // LD7A + if ( !g_config.use_split_right_shift ) + point->x -= 8; + break; +#endif + } +} + +void map_led_to_point_polar( uint8_t index, Point *point ) +{ + // Slightly messy way to get Point structs out of progmem. + uint8_t *addr = (uint8_t*)&g_map_led_to_point_polar[index]; + point->x = pgm_read_byte(addr); + point->y = pgm_read_byte(addr+1); +} + +// +// Maps switch matrix coordinate (row,col) to LED index +// + + +#if defined(RGB_BACKLIGHT_ZEAL65) +// Note: Left spacebar stab is at 4,2 (LC7) +// Right spacebar stab is at 4,9 (D14) +// +// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, B6 +// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, B7 +// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, B8 +// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, B15 +// C17, C8, C7, ---, ---, ---, ---, C0, ---, D14, D15, D16, D17, B17, B16 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4, 18+6 }, + { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14, 18+7 }, + { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5, 18+8 }, + { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8, 18+15 }, + { 36+17, 36+8, 36+7, 255, 255, 255, 255, 36+0, 255, 54+14, 54+15, 54+16, 54+17, 18+17, 18+16 } +}; +#elif defined(RGB_BACKLIGHT_KOYU) +// Note: Left spacebar stab is at 4,4 (LC6) +// Right spacebar stab is at 4,10 (D14) +// +// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, B6 +// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, B7 +// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, B8 +// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, B15 +// C17, C8, C7, C6, ---, ---, ---, C0, ---, ---, D14, D15, D16, B17, B16 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4, 18+6 }, + { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14, 18+7 }, + { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5, 18+8 }, + { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8, 18+15 }, + { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 255, 54+14, 54+15, 54+16, 18+17, 18+16 } +}; +#elif defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_M60_A) +// Note: Left spacebar stab is at 4,3 (LC6) +// Right spacebar stab is at 4,9 (LD13) or 4,10 (LD14) +// +// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, +// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, +// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, +// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, +// C17, C8, C7, C6, ---, ---, ---, C0, ---, D13, D14, D15, D16, D17, +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4 }, + { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14 }, + { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5 }, + { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8 }, + { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 54+13, 54+14, 54+15, 54+16, 54+17 } +}; +#elif defined(RGB_BACKLIGHT_U80_A) +// Note: Left spacebar stab is at 5,3 (LC6) +// Right spacebar stab is at 5,10 (LD14) +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 72+17, 72+16, 72+15, 72+14, 72+9, 72+10, 72+11, 72+12, 72+13, 90+0, 90+1, 90+2, 90+3, 255, 90+4, 90+5, 90+6 }, + { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4, 90+11, 90+9, 90+7 }, + { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14, 90+12, 90+10, 90+8 }, + { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 255, 255, 255, 255 }, + { 36+16, 255, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 255, 255, 90+14, 255 }, + { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 255, 54+14, 54+15, 54+16, 54+17, 90+15, 90+16, 90+17 } +}; +#elif defined(RGB_BACKLIGHT_HS60) && defined(HS60_ANSI) +// +// LA1, LA5, LA9, LA13, LA17, LA21, LA25, LA29, LA33, LA37, LA41, LA45, LA49, LA53, +// LA2, LA6, LA10, LA14, LA18, LA22, LA26, LA30, LA34, LA38, LA42, LA46, LA50, ---, +// LA3, LA7, LA11, LA15, LA19, LA23, LA27, LA31, LA35, LA39, LA43, LA47, LA54, LA55, +// LA4, ---, LA8, LA12, LA16, LA20, LA24, LA28, LA32, LA36, LA40, LA44, ---, LA52, +// LA57, LA58, LA59, ---, ---, ---, LA60, ---, ---, ---, LA62, LA63, LA64, LA56 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 1-1, 5-1, 9-1, 13-1, 17-1, 21-1, 25-1, 29-1, 33-1, 37-1, 41-1, 45-1, 49-1, 53-1 }, + { 2-1, 6-1, 10-1, 14-1, 18-1, 22-1, 26-1, 30-1, 34-1, 38-1, 42-1, 46-1, 50-1, 255 }, + { 3-1, 7-1, 11-1, 15-1, 19-1, 23-1, 27-1, 31-1, 35-1, 39-1, 43-1, 47-1, 54-1, 55-1 }, + { 4-1, 255, 8-1, 12-1, 16-1, 20-1, 24-1, 28-1, 32-1, 36-1, 40-1, 44-1, 255, 52-1 }, + { 57-1, 58-1, 59-1, 255, 255, 255, 60-1, 255, 255, 255, 62-1, 63-1, 64-1, 56-1 } +}; +#elif defined(RGB_BACKLIGHT_HS60) && defined(HS60_HHKB) +// +// LA1, LA5, LA9, LA13, LA17, LA21, LA25, LA29, LA33, LA37, LA41, LA45, LA49, LA53, +// LA2, LA6, LA10, LA14, LA18, LA22, LA26, LA30, LA34, LA38, LA42, LA46, LA50, LA48, +// LA3, LA7, LA11, LA15, LA19, LA23, LA27, LA31, LA35, LA39, LA43, LA47, LA54, LA55, +// LA4, ---, LA8, LA12, LA16, LA20, LA24, LA28, LA32, LA36, LA40, LA44, LA51, LA52, +// LA57, LA58, LA59, ---, ---, ---, LA60, ---, ---, ---, ---, LA63, LA64, LA56 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 1-1, 5-1, 9-1, 13-1, 17-1, 21-1, 25-1, 29-1, 33-1, 37-1, 41-1, 45-1, 49-1, 53-1 }, + { 2-1, 6-1, 10-1, 14-1, 18-1, 22-1, 26-1, 30-1, 34-1, 38-1, 42-1, 46-1, 50-1, 48-1 }, + { 3-1, 7-1, 11-1, 15-1, 19-1, 23-1, 27-1, 31-1, 35-1, 39-1, 43-1, 47-1, 54-1, 55-1 }, + { 4-1, 255, 8-1, 12-1, 16-1, 20-1, 24-1, 28-1, 32-1, 36-1, 40-1, 44-1, 51-1, 52-1 }, + { 57-1, 58-1, 59-1, 255, 255, 255, 60-1, 255, 255, 255, 255, 63-1, 64-1, 56-1 } +}; +#elif defined(RGB_BACKLIGHT_HS60) //HS60_ISO +// +// LA1, LA5, LA9, LA13, LA17, LA21, LA25, LA29, LA33, LA37, LA41, LA45, LA49, LA53, +// LA2, LA6, LA10, LA14, LA18, LA22, LA26, LA30, LA34, LA38, LA42, LA46, LA50, ---, +// LA3, LA7, LA11, LA15, LA19, LA23, LA27, LA31, LA35, LA39, LA43, LA47, LA54, LA55, +// LA4, LA48, LA8, LA12, LA16, LA20, LA24, LA28, LA32, LA36, LA40, LA44, ---, LA52, +// LA57, LA58, LA59, ---, ---, ---, LA60, ---, ---, ---, LA62, LA63, LA64, LA56 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 1-1, 5-1, 9-1, 13-1, 17-1, 21-1, 25-1, 29-1, 33-1, 37-1, 41-1, 45-1, 49-1, 53-1 }, + { 2-1, 6-1, 10-1, 14-1, 18-1, 22-1, 26-1, 30-1, 34-1, 38-1, 42-1, 46-1, 50-1, 255 }, + { 3-1, 7-1, 11-1, 15-1, 19-1, 23-1, 27-1, 31-1, 35-1, 39-1, 43-1, 47-1, 54-1, 55-1 }, + { 4-1, 48-1, 8-1, 12-1, 16-1, 20-1, 24-1, 28-1, 32-1, 36-1, 40-1, 44-1, 255, 52-1 }, + { 57-1, 58-1, 59-1, 255, 255, 255, 60-1, 255, 255, 255, 62-1, 63-1, 64-1, 56-1 } +}; +#elif defined(RGB_BACKLIGHT_NK65) +// +// LA1, LA5, LA9, LA13, LA17, LA21, LA25, LA29, LA33, LA37, LA41, LA45, LA49, LA53, LB1, +// LA2, LA6, LA10, LA14, LA18, LA22, LA26, LA30, LA34, LA38, LA42, LA46, LA50, ---, LB2, +// LA3, LA7, LA11, LA15, LA19, LA23, LA27, LA31, LA35, LA39, LA43, LA47, LA54, LA55, LB5, +// LA4, ---, LA8, LA12, LA16, LA20, LA24, LA28, LA32, LA36, LA40, LA44, LA51, LA52, LB3, +// LA57, LA58, LA59, ---, ---, ---, LA60, ---, ---, LA48, LA62, LA63, LA64, LA56, LB4 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 1-1, 5-1, 9-1, 13-1, 17-1, 21-1, 25-1, 29-1, 33-1, 37-1, 41-1, 45-1, 49-1, 53-1, 1+64-1 }, + { 2-1, 6-1, 10-1, 14-1, 18-1, 22-1, 26-1, 30-1, 34-1, 38-1, 42-1, 46-1, 50-1, 255, 2+64-1 }, + { 3-1, 7-1, 11-1, 15-1, 19-1, 23-1, 27-1, 31-1, 35-1, 39-1, 43-1, 47-1, 54-1, 55-1, 5+64-1 }, + { 4-1, 255, 8-1, 12-1, 16-1, 20-1, 24-1, 28-1, 32-1, 36-1, 40-1, 44-1, 51-1, 52-1, 3+64-1 }, + { 57-1, 58-1, 59-1, 255, 255, 255, 60-1, 255, 255, 48-1, 62-1, 63-1, 64-1, 56-1, 4+64-1 } +}; +#elif defined(RGB_BACKLIGHT_M6_B) +// M6-B is really simple: +// 0 3 5 +// 1 2 4 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 0, 3, 5, 1, 2, 4 } +}; +#endif + +void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ) +{ + *led = 255; + if ( row < MATRIX_ROWS && column < MATRIX_COLS ) + { + *led = pgm_read_byte(&g_map_row_column_to_led[row][column]); + } +} + +void backlight_update_pwm_buffers(void) +{ +#if defined(RGB_BACKLIGHT_M6_B) + IS31FL3218_update_pwm_buffers(); +#elif defined(RGB_BACKLIGHT_HS60) + IS31FL3733_update_pwm_buffers( ISSI_ADDR_1, 0 ); + IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 ); +#elif defined(RGB_BACKLIGHT_NK65) + IS31FL3733_update_pwm_buffers( ISSI_ADDR_1, 0 ); + IS31FL3733_update_pwm_buffers( ISSI_ADDR_2, 1 ); + IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 ); + IS31FL3733_update_led_control_registers( ISSI_ADDR_2, 1 ); +#elif defined(RGB_BACKLIGHT_U80_A) + static uint8_t driver = 0; + switch ( driver ) + { + case 0: + IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, 0 ); + break; + case 1: + IS31FL3731_update_pwm_buffers( ISSI_ADDR_2, 1 ); + break; + case 2: + IS31FL3731_update_pwm_buffers( ISSI_ADDR_3, 2 ); + break; + } + if ( ++driver > 2 ) + { + driver = 0; + } +#else + IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, 0 ); + IS31FL3731_update_pwm_buffers( ISSI_ADDR_2, 1 ); + IS31FL3731_update_led_control_registers( ISSI_ADDR_1, 0 ); + IS31FL3731_update_led_control_registers( ISSI_ADDR_2, 1 ); +#endif +} + +void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ +#if defined(RGB_BACKLIGHT_M6_B) + IS31FL3218_set_color( index, red, green, blue ); +#elif defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) + IS31FL3733_set_color( index, red, green, blue ); +#else + IS31FL3731_set_color( index, red, green, blue ); +#endif +} + +void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ +#if defined(RGB_BACKLIGHT_M6_B) + IS31FL3218_set_color_all( red, green, blue ); +#elif defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) + IS31FL3733_set_color_all( red, green, blue ); +#else + IS31FL3731_set_color_all( red, green, blue ); +#endif +} + +void backlight_set_key_hit(uint8_t row, uint8_t column) +{ + uint8_t led; + map_row_column_to_led(row,column,&led); + g_key_hit[led] = 0; + + g_any_key_hit = 0; +} + +#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) +// This is (F_CPU/1024) / 20 Hz +// = 15625 Hz / 20 Hz +// = 781 +#define TIMER3_TOP 781 + +void backlight_timer_init(void) +{ + static uint8_t backlight_timer_is_init = 0; + if ( backlight_timer_is_init ) + { + return; + } + backlight_timer_is_init = 1; + + // Timer 3 setup + TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP + _BV(CS32) | _BV(CS30); // prescale by /1024 + // Set TOP value + uint8_t sreg = SREG; + cli(); + + OCR3AH = (TIMER3_TOP >> 8) & 0xff; + OCR3AL = TIMER3_TOP & 0xff; + SREG = sreg; +} + +void backlight_timer_enable(void) +{ + TIMSK3 |= _BV(OCIE3A); +} + +void backlight_timer_disable(void) +{ + TIMSK3 &= ~_BV(OCIE3A); +} +#else //STM32, use GPT with TIM4. Enable in halconf.h +static void gpt_backlight_timer_task(GPTDriver *gptp); +// Timer setup at 200Khz, callback at 10k ticks = 20Hz +static GPTConfig gpt4cfg1 = { + .frequency = 200000U, + .callback = gpt_backlight_timer_task +}; + +void backlight_timer_init(void) +{ + gptStart(&GPTD4, &gpt4cfg1); +} + +void backlight_timer_enable(void) +{ + gptStartContinuous(&GPTD4, 10000); +} + +void backlight_timer_disable(void) +{ + gptStopTimer(&GPTD4); +} +#endif //!defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) + +void backlight_set_suspend_state(bool state) +{ + g_suspend_state = state; +} + +void backlight_set_indicator_state(uint8_t state) +{ + g_indicator_state = state; +} + +void backlight_effect_rgb_test(void) +{ + // Mask out bits 4 and 5 + // This 2-bit value will stay the same for 16 ticks. + switch ( (g_tick & 0x30) >> 4 ) + { + case 0: + { + backlight_set_color_all( 255, 0, 0 ); + break; + } + case 1: + { + backlight_set_color_all( 0, 255, 0 ); + break; + } + case 2: + { + backlight_set_color_all( 0, 0, 255 ); + break; + } + case 3: + { + backlight_set_color_all( 255, 255, 255 ); + break; + } + } +} + +#if defined(RGB_DEBUGGING_ONLY) +// This tests the LEDs +// Note that it will change the LED control registers +// in the LED drivers, and leave them in an invalid +// state for other backlight effects. +// ONLY USE THIS FOR TESTING LEDS! +void backlight_effect_single_LED_test(void) +{ + static uint8_t color = 0; // 0,1,2 for R,G,B + static uint8_t row = 0; + static uint8_t column = 0; + + static uint8_t tick = 0; + tick++; + + if ( tick > 2 ) + { + tick = 0; + column++; + } + if ( column > 14 ) + { + column = 0; + row++; + } + if ( row > 4 ) + { + row = 0; + color++; + } + if ( color > 2 ) + { + color = 0; + } + + uint8_t led; + map_row_column_to_led( row, column, &led ); + backlight_set_color_all( 255, 255, 255 ); + backlight_test_led( led, color==0, color==1, color==2 ); +} +#endif // defined(RGB_DEBUGGING_ONLY) + +// All LEDs off +void backlight_effect_all_off(void) +{ + backlight_set_color_all( 0, 0, 0 ); +} + +// Solid color +void backlight_effect_solid_color(void) +{ + HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; + RGB rgb = hsv_to_rgb( hsv ); + backlight_set_color_all( rgb.r, rgb.g, rgb.b ); +} + +// alphas = color1, mods = color2 +void backlight_effect_alphas_mods(void) +{ + RGB rgb1 = hsv_to_rgb( (HSV){ .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness } ); + RGB rgb2 = hsv_to_rgb( (HSV){ .h = g_config.color_2.h, .s = g_config.color_2.s, .v = g_config.brightness } ); + bool is_alpha = false; + for ( int row = 0; row < MATRIX_ROWS; row++ ) + { + for ( int column = 0; column < MATRIX_COLS; column++ ) + { + uint8_t index; + map_row_column_to_led( row, column, &index ); + if ( index < BACKLIGHT_LED_COUNT ) + { +#if defined(RGB_BACKLIGHT_U80_A) + if ( row == 0 ) + { + is_alpha = ( column < 16 ) && (( 0b1110000111100001 & (1< 127 ) + { + deltaH -= 256; + } + else if ( deltaH < -127 ) + { + deltaH += 256; + } + // Divide delta by 4, this gives the delta per row + deltaH /= 4; + + int16_t s1 = g_config.color_1.s; + int16_t s2 = g_config.color_2.s; + int16_t deltaS = ( s2 - s1 ) / 4; + + HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; + RGB rgb; + Point point; + for ( int i=0; i>4); + // Relies on hue being 8-bit and wrapping + hsv.h = g_config.color_1.h + ( deltaH * y ); + hsv.s = g_config.color_1.s + ( deltaS * y ); + rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +void backlight_effect_raindrops(bool initialize) +{ + int16_t h1 = g_config.color_1.h; + int16_t h2 = g_config.color_2.h; + int16_t deltaH = h2 - h1; + deltaH /= 4; + + // Take the shortest path between hues + if ( deltaH > 127 ) + { + deltaH -= 256; + } + else if ( deltaH < -127 ) + { + deltaH += 256; + } + + int16_t s1 = g_config.color_1.s; + int16_t s2 = g_config.color_2.s; + int16_t deltaS = ( s2 - s1 ) / 4; + + HSV hsv; + RGB rgb; + + // Change one LED every tick + uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % BACKLIGHT_LED_COUNT : 255; + + for ( int i=0; i> 2; + hsv.h = g_config.color_1.h + offset2; + hsv.s = 127 + ( point.y >> 1 ); + rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +#if defined(RGB_BACKLIGHT_M6_B) +void backlight_effect_custom_colors(void) +{ + RGB rgb; + for ( uint8_t i = 0; i < 6; i++ ) + { + HSV hsv = { .h = g_config.custom_color[i].h, .s = g_config.custom_color[i].s, .v = g_config.brightness }; + rgb = hsv_to_rgb( hsv ); + uint8_t led; + map_row_column_to_led( 0, i, &led ); + backlight_set_color( led, rgb.r, rgb.g, rgb.b ); + } +} +#endif + +void backlight_effect_indicators_set_colors( uint8_t index, HS color ) +{ + HSV hsv = { .h = color.h, .s = color.s, .v = g_config.brightness }; + RGB rgb = hsv_to_rgb( hsv ); + if ( index == 254 ) + { + backlight_set_color_all( rgb.r, rgb.g, rgb.b ); + } + else + { + backlight_set_color( index, rgb.r, rgb.g, rgb.b ); + + // If the spacebar LED is the indicator, + // do the same for the spacebar stabilizers + if ( index == 36+0 ) // LC0 + { +#if defined(RGB_BACKLIGHT_ZEAL65) + backlight_set_color( 36+7, rgb.r, rgb.g, rgb.b ); // LC7 + backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14 +#elif defined(RGB_BACKLIGHT_KOYU) + backlight_set_color( 36+6, rgb.r, rgb.g, rgb.b ); // LC6 + backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14 +#elif defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_M60_A) + backlight_set_color( 36+6, rgb.r, rgb.g, rgb.b ); // LC6 + backlight_set_color( 54+13, rgb.r, rgb.g, rgb.b ); // LD13 + if ( g_config.use_7u_spacebar ) + { + backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14 + } +#endif + } + } +} + +// This runs after another backlight effect and replaces +// colors already set +void backlight_effect_indicators(void) +{ + if ( g_config.caps_lock_indicator.index != 255 && + ( g_indicator_state & (1< 0 && g_any_key_hit > g_config.disable_after_timeout * 60 * 20)); + uint8_t effect = suspend_backlight ? 0 : g_config.effect; + + // Keep track of the effect used last time, + // detect change in effect, so each effect can + // have an optional initialization. + static uint8_t effect_last = 255; + bool initialize = effect != effect_last; + effect_last = effect; + + // this gets ticked at 20 Hz. + // each effect can opt to do calculations + // and/or request PWM buffer updates. + switch ( effect ) + { + case 0: + backlight_effect_all_off(); + break; + case 1: + backlight_effect_solid_color(); + break; + case 2: +#if defined(RGB_BACKLIGHT_M6_B) + backlight_effect_custom_colors(); +#else + backlight_effect_alphas_mods(); +#endif + break; + case 3: + backlight_effect_gradient_up_down(); + break; + case 4: + backlight_effect_raindrops( initialize ); + break; + case 5: + backlight_effect_cycle_all(); + break; + case 6: + backlight_effect_cycle_left_right(); + break; + case 7: + backlight_effect_cycle_up_down(); + break; + case 8: + backlight_effect_jellybean_raindrops( initialize ); + break; + case 9: + backlight_effect_cycle_radial1(); + break; + case 10: + backlight_effect_cycle_radial2(); + break; + default: + backlight_effect_all_off(); + break; + } + + if ( ! suspend_backlight ) + { +#if !defined(RGB_BACKLIGHT_M6_B) + backlight_effect_indicators(); +#endif + } +} + +void backlight_set_indicator_index( uint8_t *index, uint8_t row, uint8_t column ) +{ + if ( row >= MATRIX_ROWS ) + { + // Special value, 255=none, 254=all + *index = row; + } + else + { + map_row_column_to_led( row, column, index ); + } +} + +void backlight_get_indicator_row_col( uint8_t index, uint8_t *row, uint8_t *column ) +{ + if ( index == 255 || index == 254 ) + { + // Special value, 255=none, 254=all + *row = index; + *column = 0; + return; + } + for ( uint8_t r = 0; r < MATRIX_ROWS; r++ ) + { + for ( uint8_t c = 0; c < MATRIX_COLS; c++ ) + { + uint8_t i = 255; + map_row_column_to_led( r, c, &i ); + if ( i == index ) + { + *row = r; + *column = c; + return; + } + } + } +} + +// Some helpers for setting/getting HSV +void _set_color( HS *color, uint8_t *data ) +{ + color->h = data[0]; + color->s = data[1]; +} + +void _get_color( HS *color, uint8_t *data ) +{ + data[0] = color->h; + data[1] = color->s; +} + +void backlight_config_set_value( uint8_t *data ) +{ + bool reinitialize = false; + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + switch ( *value_id ) + { +#if defined (RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_ZEAL65) + case id_use_split_backspace: + { + g_config.use_split_backspace = (bool)*value_data; + reinitialize = true; + break; + } +#endif +#if defined (RGB_BACKLIGHT_ZEAL60) + case id_use_split_left_shift: + { + g_config.use_split_left_shift = (bool)*value_data; + reinitialize = true; + break; + } + case id_use_split_right_shift: + { + g_config.use_split_right_shift = (bool)*value_data; + reinitialize = true; + break; + } + case id_use_7u_spacebar: + { + g_config.use_7u_spacebar = (bool)*value_data; + reinitialize = true; + break; + } + case id_use_iso_enter: + { + g_config.use_iso_enter = (bool)*value_data; + reinitialize = true; + break; + } + case id_disable_hhkb_blocker_leds: + { + g_config.disable_hhkb_blocker_leds = (bool)*value_data; + reinitialize = true; + break; + } +#endif + case id_disable_when_usb_suspended: + { + g_config.disable_when_usb_suspended = (bool)*value_data; + break; + } + case id_disable_after_timeout: + { + g_config.disable_after_timeout = *value_data; + break; + } + case id_brightness: + { + g_config.brightness = *value_data; + break; + } + case id_effect: + { + g_config.effect = *value_data; + break; + } + case id_effect_speed: + { + g_config.effect_speed = *value_data; + break; + } + case id_color_1: + { + _set_color( &(g_config.color_1), value_data ); + break; + } + case id_color_2: + { + _set_color( &(g_config.color_2), value_data ); + break; + } + case id_caps_lock_indicator_color: + { + _set_color( &(g_config.caps_lock_indicator.color), value_data ); + break; + } + case id_caps_lock_indicator_row_col: + { + backlight_set_indicator_index( &(g_config.caps_lock_indicator.index), value_data[0], value_data[1] ); + break; + } + case id_layer_1_indicator_color: + { + _set_color( &(g_config.layer_1_indicator.color), value_data ); + break; + } + case id_layer_1_indicator_row_col: + { + backlight_set_indicator_index( &(g_config.layer_1_indicator.index), value_data[0], value_data[1] ); + break; + } + case id_layer_2_indicator_color: + { + _set_color( &(g_config.layer_2_indicator.color), value_data ); + break; + } + case id_layer_2_indicator_row_col: + { + backlight_set_indicator_index( &(g_config.layer_2_indicator.index), value_data[0], value_data[1] ); + break; + } + case id_layer_3_indicator_color: + { + _set_color( &(g_config.layer_3_indicator.color), value_data ); + break; + } + case id_layer_3_indicator_row_col: + { + backlight_set_indicator_index( &(g_config.layer_3_indicator.index), value_data[0], value_data[1] ); + break; + } + case id_alphas_mods: + { + for ( int i=0; i<5; i++ ) + { + g_config.alphas_mods[i] = ( *(value_data+i*2) << 8 ) | ( *(value_data+i*2+1) ); + } + } +#if defined(RGB_BACKLIGHT_M6_B) + case id_custom_color: + { + uint8_t index = value_data[0]; + if ( index >= 0 && index <= 6 ) + { + _set_color( &(g_config.custom_color[index]), &(value_data[1]) ); + } + } +#endif + } + + if ( reinitialize ) + { + backlight_init_drivers(); + } +} + +void backlight_config_get_value( uint8_t *data ) +{ + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + switch ( *value_id ) + { + case id_use_split_backspace: + { + *value_data = ( g_config.use_split_backspace ? 1 : 0 ); + break; + } + case id_use_split_left_shift: + { + *value_data = ( g_config.use_split_left_shift ? 1 : 0 ); + break; + } + case id_use_split_right_shift: + { + *value_data = ( g_config.use_split_right_shift ? 1 : 0 ); + break; + } + case id_use_7u_spacebar: + { + *value_data = ( g_config.use_7u_spacebar ? 1 : 0 ); + break; + } + case id_use_iso_enter: + { + *value_data = ( g_config.use_iso_enter ? 1 : 0 ); + break; + } + case id_disable_when_usb_suspended: + { + *value_data = ( g_config.disable_when_usb_suspended ? 1 : 0 ); + break; + } + case id_disable_hhkb_blocker_leds: + { + *value_data = ( g_config.disable_hhkb_blocker_leds ? 1 : 0 ); + break; + } + case id_disable_after_timeout: + { + *value_data = g_config.disable_after_timeout; + break; + } + case id_brightness: + { + *value_data = g_config.brightness; + break; + } + case id_effect: + { + *value_data = g_config.effect; + break; + } + case id_effect_speed: + { + *value_data = g_config.effect_speed; + break; + } + case id_color_1: + { + _get_color( &(g_config.color_1), value_data ); + break; + } + case id_color_2: + { + _get_color( &(g_config.color_2), value_data ); + break; + } + case id_caps_lock_indicator_color: + { + _get_color( &(g_config.caps_lock_indicator.color), value_data ); + break; + } + case id_caps_lock_indicator_row_col: + { + backlight_get_indicator_row_col( g_config.caps_lock_indicator.index, &(value_data[0]), &(value_data[1]) ); + break; + } + case id_layer_1_indicator_color: + { + _get_color( &(g_config.layer_1_indicator.color), value_data ); + break; + } + case id_layer_1_indicator_row_col: + { + backlight_get_indicator_row_col( g_config.layer_1_indicator.index, &(value_data[0]), &(value_data[1]) ); + break; + } + case id_layer_2_indicator_color: + { + _get_color( &(g_config.layer_2_indicator.color), value_data ); + break; + } + case id_layer_2_indicator_row_col: + { + backlight_get_indicator_row_col( g_config.layer_2_indicator.index, &(value_data[0]), &(value_data[1]) ); + break; + } + case id_layer_3_indicator_color: + { + _get_color( &(g_config.layer_3_indicator.color), value_data ); + break; + } + case id_layer_3_indicator_row_col: + { + backlight_get_indicator_row_col( g_config.layer_3_indicator.index, &(value_data[0]), &(value_data[1]) ); + break; + } + case id_alphas_mods: + { + for ( int i=0; i<5; i++ ) + { + *(value_data+i*2) = g_config.alphas_mods[i] >> 8; + *(value_data+i*2+1) = g_config.alphas_mods[i] & 0xFF; + } + } +#if defined(RGB_BACKLIGHT_M6_B) + case id_custom_color: + { + uint8_t index = value_data[0]; + if ( index >= 0 && index <= 6 ) + { + _get_color( &(g_config.custom_color[index]), &(value_data[1]) ); + } + } +#endif + } +} + +void backlight_config_set_alphas_mods( uint16_t *alphas_mods ) +{ + for ( int i=0; i<5; i++ ) + { + g_config.alphas_mods[i] = alphas_mods[i]; + } + + backlight_config_save(); +} + +void backlight_config_load(void) +{ + eeprom_read_block( &g_config, ((void*)RGB_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) ); +} + +void backlight_config_save(void) +{ + eeprom_update_block( &g_config, ((void*)RGB_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) ); +} + +void backlight_init_drivers(void) +{ + // Initialize I2C + i2c_init(); + +#if defined(RGB_BACKLIGHT_M6_B) + IS31FL3218_init(); +#elif defined(RGB_BACKLIGHT_HS60) + IS31FL3733_init( ISSI_ADDR_1, 0 ); + + for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) + { +#if defined(HS60_ANSI) + bool enabled = !( ( index == 48-1 ) || //LA48 + ( index == 51-1 ) || //LA51 + ( index == 61-1 ) ); //LA61 +#elif defined(HS60_HHKB) + bool enabled = !( ( index == 61-1 ) || //LA61 + ( index == 62-1 ) ); //LA62 +#else //HS60_ISO + bool enabled = !( ( index == 51-1 ) || //LA51 + ( index == 61-1 ) ); //LA61 +#endif + // This only caches it for later + IS31FL3733_set_led_control_register( index, enabled, enabled, enabled ); + } + // This actually updates the LED drivers + IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 ); +#elif defined(RGB_BACKLIGHT_NK65) + IS31FL3733_init( ISSI_ADDR_1, 0 ); + IS31FL3733_init( ISSI_ADDR_2, 0 ); + + for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) + { + bool enabled = !( ( index == 61-1 ) || //LA61 + ( index > 6+64-1 ) ); //LB7-LB64 + // This only caches it for later + IS31FL3733_set_led_control_register( index, enabled, enabled, enabled ); + } + IS31FL3733_set_led_control_register( 7+64-1, 0, 1, 0 ); //Enable LB7 green enable for indicators + // This actually updates the LED drivers + IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 ); + IS31FL3733_update_led_control_registers( ISSI_ADDR_2, 1 ); +#else + IS31FL3731_init( ISSI_ADDR_1 ); + IS31FL3731_init( ISSI_ADDR_2 ); + +#if defined(RGB_BACKLIGHT_U80_A) + IS31FL3731_init( ISSI_ADDR_3 ); +#endif + + // Experimental feature, not in configuration yet +#if defined(RGB_BACKLIGHT_ZEAL60) + bool disable_spacebar_stab_leds = false; +#endif + + for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) + { + // OR the possible "disabled" cases together, then NOT the result to get the enabled state + // LC6 LD13 not present on Zeal65 +#if defined(RGB_BACKLIGHT_ZEAL65) + bool enabled = !( ( index == 18+5 && !g_config.use_split_backspace ) || // LB5 + ( index == 36+6 ) || // LC6 + ( index == 54+13 ) ); // LD13 +#elif defined(RGB_BACKLIGHT_KOYU) + bool enabled = !( ( index == 36+15 ) || // LC15 + ( index == 54+13 ) || // LD13 + ( index == 54+17 ) ); // LD17 +#elif defined(RGB_BACKLIGHT_M60_A) + bool enabled = !( + // LB6 LB7 LB8 LB15 LB16 LB17 not present on M60-A + ( index == 18+6 ) || // LB6 + ( index == 18+7 ) || // LB7 + ( index == 18+8 ) || // LB8 + ( index == 18+15 ) || // LB15 + ( index == 18+16 ) || // LB16 + ( index == 18+17 ) || // LB17 + // HHKB blockers (LC17, LD17) and ISO extra keys (LC15,LD13) not present on M60-A + ( index == 36+17 ) || // LC17 + ( index == 54+17 ) || // LD17 + ( index == 36+15 ) || // LC15 + ( index == 54+13 ) ); // LD13 +#elif defined(RGB_BACKLIGHT_ZEAL60) + // LB6 LB7 LB8 LB15 LB16 LB17 not present on Zeal60 + bool enabled = !( ( index == 18+5 && !g_config.use_split_backspace ) || // LB5 + ( index == 36+15 && !g_config.use_split_left_shift ) || // LC15 + ( index == 54+8 && !g_config.use_split_right_shift ) || // LD8 + ( index == 54+13 && g_config.use_7u_spacebar ) || // LD13 + ( index == 36+17 && g_config.disable_hhkb_blocker_leds ) || // LC17 + ( index == 54+17 && g_config.disable_hhkb_blocker_leds ) || // LD17 + ( index == 18+6 ) || // LB6 + ( index == 18+7 ) || // LB7 + ( index == 18+8 ) || // LB8 + ( index == 18+15 ) || // LB15 + ( index == 18+16 ) || // LB16 + ( index == 18+17 ) || // LB17 + ( index == 36+6 && disable_spacebar_stab_leds ) || // LC6 + ( index == 54+13 && disable_spacebar_stab_leds ) || // LD13 + ( index == 54+14 && disable_spacebar_stab_leds && g_config.use_7u_spacebar ) ); // LD14 +#elif defined(RGB_BACKLIGHT_U80_A) +// LB5, LB6, LB7, LB8, LB15, LB16, LB17, LC15, LD8, LD13, LE0-LE8, LF13 + bool enabled = !( + ( index == 18+5 ) || // LB5 + ( index == 18+6 ) || // LB6 + ( index == 18+7 ) || // LB7 + ( index == 18+8 ) || // LB8 + ( index == 18+15 ) || // LB15 + ( index == 18+16 ) || // LB16 + ( index == 18+16 ) || // LB17 + ( index == 36+15 ) || // LC15 + ( index == 54+8 ) || // LD8 + ( index == 54+13 ) || // LD13 + ( index >= 72+0 && index <= 72+8 ) || // LE0-LE8 + ( index == 90+13 ) ); // LF13 +#endif + // This only caches it for later + IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); + } + // This actually updates the LED drivers + IS31FL3731_update_led_control_registers( ISSI_ADDR_1, 0 ); + IS31FL3731_update_led_control_registers( ISSI_ADDR_2, 1 ); +#if defined(RGB_BACKLIGHT_U80_A) + IS31FL3731_update_led_control_registers( ISSI_ADDR_3, 2 ); +#endif +#endif // !defined(RGB_BACKLIGHT_M6_B) + + // TODO: put the 1 second startup delay here? + + // clear the key hits + for ( int led=0; ledevent.pressed ) + { + backlight_set_key_hit( record->event.key.row, record->event.key.col ); + } + + switch(keycode) + { + case BR_INC: + if (record->event.pressed) + { + backlight_brightness_increase(); + } + return false; + break; + case BR_DEC: + if (record->event.pressed) + { + backlight_brightness_decrease(); + } + return false; + break; + case EF_INC: + if (record->event.pressed) + { + backlight_effect_increase(); + } + return false; + break; + case EF_DEC: + if (record->event.pressed) + { + backlight_effect_decrease(); + } + return false; + break; + case ES_INC: + if (record->event.pressed) + { + backlight_effect_speed_increase(); + } + return false; + break; + case ES_DEC: + if (record->event.pressed) + { + backlight_effect_speed_decrease(); + } + return false; + break; + case H1_INC: + if (record->event.pressed) + { + backlight_color_1_hue_increase(); + } + return false; + break; + case H1_DEC: + if (record->event.pressed) + { + backlight_color_1_hue_decrease(); + } + return false; + break; + case S1_INC: + if (record->event.pressed) + { + backlight_color_1_sat_increase(); + } + return false; + break; + case S1_DEC: + if (record->event.pressed) + { + backlight_color_1_sat_decrease(); + break; + } + return false; + break; + case H2_INC: + if (record->event.pressed) + { + backlight_color_2_hue_increase(); + } + return false; + break; + case H2_DEC: + if (record->event.pressed) + { + backlight_color_2_hue_decrease(); + } + return false; + break; + case S2_INC: + if (record->event.pressed) + { + backlight_color_2_sat_increase(); + } + return false; + break; + case S2_DEC: + if (record->event.pressed) + { + backlight_color_2_sat_decrease(); + break; + } + return false; + break; + } + + return true; +} + +// Deals with the messy details of incrementing an integer +uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) +{ + int16_t new_value = value; + new_value += step; + return MIN( MAX( new_value, min ), max ); +} + +uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) +{ + int16_t new_value = value; + new_value -= step; + return MIN( MAX( new_value, min ), max ); +} + +void backlight_effect_increase(void) +{ + g_config.effect = increment( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX ); + backlight_config_save(); +} + +void backlight_effect_decrease(void) +{ + g_config.effect = decrement( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX ); + backlight_config_save(); +} + +void backlight_effect_speed_increase(void) +{ + g_config.effect_speed = increment( g_config.effect_speed, 1, 0, 3 ); + backlight_config_save(); +} + +void backlight_effect_speed_decrease(void) +{ + g_config.effect_speed = decrement( g_config.effect_speed, 1, 0, 3 ); + backlight_config_save(); +} + +void backlight_brightness_increase(void) +{ + g_config.brightness = increment( g_config.brightness, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_brightness_decrease(void) +{ + g_config.brightness = decrement( g_config.brightness, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_1_hue_increase(void) +{ + g_config.color_1.h = increment( g_config.color_1.h, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_1_hue_decrease(void) +{ + g_config.color_1.h = decrement( g_config.color_1.h, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_1_sat_increase(void) +{ + g_config.color_1.s = increment( g_config.color_1.s, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_1_sat_decrease(void) +{ + g_config.color_1.s = decrement( g_config.color_1.s, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_2_hue_increase(void) +{ + g_config.color_2.h = increment( g_config.color_2.h, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_2_hue_decrease(void) +{ + g_config.color_2.h = decrement( g_config.color_2.h, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_2_sat_increase(void) +{ + g_config.color_2.s = increment( g_config.color_2.s, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_2_sat_decrease(void) +{ + g_config.color_2.s = decrement( g_config.color_2.s, 8, 0, 255 ); + backlight_config_save(); +} + +#if defined(RGB_DEBUGGING_ONLY) +void backlight_test_led( uint8_t index, bool red, bool green, bool blue ) +{ + for ( int i=0; i. + */ +#pragma once + +#if RGB_BACKLIGHT_ENABLED +#else +#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0 +#endif // RGB_BACKLIGHT_ENABLED + +#include +#include + +#include "quantum/color.h" + +typedef struct PACKED +{ + uint8_t h; + uint8_t s; +} HS; + +typedef struct +{ + HS color; + uint8_t index; +} backlight_config_indicator; + +typedef struct +{ + bool use_split_backspace:1; // | + bool use_split_left_shift:1; // | + bool use_split_right_shift:1; // | + bool use_7u_spacebar:1; // | + bool use_iso_enter:1; // | + bool disable_when_usb_suspended:1; // | + bool disable_hhkb_blocker_leds:1; // | + bool __pad7:1; // 1 byte + uint8_t disable_after_timeout; // 1 byte + uint8_t brightness; // 1 byte + uint8_t effect; // 1 byte + uint8_t effect_speed; // 1 byte + HS color_1; // 2 bytes + HS color_2; // 2 bytes + backlight_config_indicator caps_lock_indicator; // 3 bytes + backlight_config_indicator layer_1_indicator; // 3 bytes + backlight_config_indicator layer_2_indicator; // 3 bytes + backlight_config_indicator layer_3_indicator; // 3 bytes + uint16_t alphas_mods[5]; // 10 bytes +#if defined(RGB_BACKLIGHT_M6_B) + HS custom_color[6]; // 12 bytes +#endif +} backlight_config; // = 31 bytes (M6-B = 43 bytes) + +void backlight_config_load(void); +void backlight_config_save(void); +void backlight_config_set_value( uint8_t *data ); +void backlight_config_get_value( uint8_t *data ); + +void backlight_init_drivers(void); + +void backlight_timer_init(void); +void backlight_timer_enable(void); +void backlight_timer_disable(void); + +void backlight_set_suspend_state(bool state); +void backlight_set_indicator_state(uint8_t state); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void backlight_update_pwm_buffers(void); + +// Handle backlight specific keycodes +bool process_record_backlight(uint16_t keycode, keyrecord_t *record); + +void backlight_set_key_hit(uint8_t row, uint8_t col); + +void backlight_effect_increase(void); +void backlight_effect_decrease(void); +void backlight_effect_speed_increase(void); +void backlight_effect_speed_decrease(void); + +void backlight_brightness_increase(void); +void backlight_brightness_decrease(void); + +void backlight_color_1_hue_increase(void); +void backlight_color_1_hue_decrease(void); +void backlight_color_1_sat_increase(void); +void backlight_color_1_sat_decrease(void); +void backlight_color_2_hue_increase(void); +void backlight_color_2_hue_decrease(void); +void backlight_color_2_sat_increase(void); +void backlight_color_2_sat_decrease(void); + +void backlight_test_led( uint8_t index, bool red, bool green, bool blue ); +void backlight_debug_led(bool state); + diff --git a/keyboards/wilba_tech/wt_rgb_backlight_api.h b/keyboards/wilba_tech/wt_rgb_backlight_api.h new file mode 100644 index 00000000000..0cd6b85f073 --- /dev/null +++ b/keyboards/wilba_tech/wt_rgb_backlight_api.h @@ -0,0 +1,43 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +enum wt_rgb_backlight_config_value +{ + id_use_split_backspace = 0x01, + id_use_split_left_shift = 0x02, + id_use_split_right_shift = 0x03, + id_use_7u_spacebar = 0x04, + id_use_iso_enter = 0x05, + id_disable_hhkb_blocker_leds = 0x06, + id_disable_when_usb_suspended = 0x07, + id_disable_after_timeout = 0x08, + id_brightness = 0x09, + id_effect = 0x0A, + id_effect_speed = 0x0B, + id_color_1 = 0x0C, + id_color_2 = 0x0D, + id_caps_lock_indicator_color = 0x0E, + id_caps_lock_indicator_row_col = 0x0F, + id_layer_1_indicator_color = 0x10, + id_layer_1_indicator_row_col = 0x11, + id_layer_2_indicator_color = 0x12, + id_layer_2_indicator_row_col = 0x13, + id_layer_3_indicator_color = 0x14, + id_layer_3_indicator_row_col = 0x15, + id_alphas_mods = 0x16, + id_custom_color = 0x17 +}; diff --git a/keyboards/wilba_tech/wt_rgb_backlight_keycodes.h b/keyboards/wilba_tech/wt_rgb_backlight_keycodes.h new file mode 100644 index 00000000000..5a436495353 --- /dev/null +++ b/keyboards/wilba_tech/wt_rgb_backlight_keycodes.h @@ -0,0 +1,34 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +// This is hardcoded at 0x5F00 so it's well after keycode value SAFE_RANGE +enum wt_rgb_backlight_keycodes { + BR_INC = 0x5F00, // backlight brightness increase + BR_DEC, // backlight brightness decrease + EF_INC, // backlight effect increase + EF_DEC, // backlight effect decrease + ES_INC, + ES_DEC, + H1_INC, + H1_DEC, + S1_INC, + S1_DEC, + H2_INC, + H2_DEC, + S2_INC, + S2_DEC +}; diff --git a/keyboards/wilba_tech/zeal60/config.h b/keyboards/wilba_tech/zeal60/config.h new file mode 100644 index 00000000000..7c5340e7302 --- /dev/null +++ b/keyboards/wilba_tech/zeal60/config.h @@ -0,0 +1,138 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "config_common.h" + +// USB Device descriptor parameter +#define VENDOR_ID 0x5A45 // ZealPC ("ZE") +#define PRODUCT_ID 0x0060 // Zeal60 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ZealPC +#define PRODUCT Zeal60 +#define DESCRIPTION Zeal60 + +// key matrix size +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +// Zeal60 PCB default pin-out +#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } +#define UNUSED_PINS + +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 72 + +// COL2ROW or ROW2COL +#define DIODE_DIRECTION COL2ROW + +// Set 0 if debouncing isn't needed +#define DEBOUNCE 5 + +// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap +#define LOCKING_SUPPORT_ENABLE +// Locking resynchronize hack +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +// disable debug print +//#define NO_DEBUG + +// disable print +//#define NO_PRINT + +// disable action features +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for Zeal60 specifics +#define RGB_BACKLIGHT_ZEAL60 + +// enable/disable LEDs based on layout +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0001000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111 + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*5*14*2)) = (66+560) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 626 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/zeal60/info.json b/keyboards/wilba_tech/zeal60/info.json new file mode 100644 index 00000000000..802f1f0cba2 --- /dev/null +++ b/keyboards/wilba_tech/zeal60/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "Zeal60", + "url": "https://zealpc.net", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_all": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_iso": { + "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_ansi_split_bs_rshift": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h b/keyboards/wilba_tech/zeal60/keymaps/ansi_split_bs_rshift/config.h similarity index 100% rename from keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h rename to keyboards/wilba_tech/zeal60/keymaps/ansi_split_bs_rshift/config.h diff --git a/keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c b/keyboards/wilba_tech/zeal60/keymaps/ansi_split_bs_rshift/keymap.c similarity index 100% rename from keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c rename to keyboards/wilba_tech/zeal60/keymaps/ansi_split_bs_rshift/keymap.c diff --git a/keyboards/wilba_tech/zeal60/keymaps/crd/config.h b/keyboards/wilba_tech/zeal60/keymaps/crd/config.h new file mode 100644 index 00000000000..a70f9da7e6a --- /dev/null +++ b/keyboards/wilba_tech/zeal60/keymaps/crd/config.h @@ -0,0 +1,29 @@ +#pragma once + +/* enable/disable LEDs based on layout */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 + +#undef RGB_BACKLIGHT_USE_7U_SPACEBAR +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 + +#undef RGB_BACKLIGHT_USE_ISO_ENTER +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 + +#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +#undef RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 1 + +#undef RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 3 + +#undef RGB_BACKLIGHT_EFFECT +#define RGB_BACKLIGHT_EFFECT 0 \ No newline at end of file diff --git a/keyboards/wilba_tech/zeal60/keymaps/crd/keymap.c b/keyboards/wilba_tech/zeal60/keymaps/crd/keymap.c new file mode 100644 index 00000000000..971782561c9 --- /dev/null +++ b/keyboards/wilba_tech/zeal60/keymaps/crd/keymap.c @@ -0,0 +1,39 @@ +// tsangan layout for Zeal60 +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL, // Function Layer + _CL // Control Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_RGLT RCMD_T(KC_LEFT) +#define KC_RADN LT(_CL, KC_DOWN) +#define KC_RCRT RCTL_T(KC_RIGHT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_ansi_split_bs_rshift( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, MO(_FL), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, XXXXXXX, KC_RGLT, KC_RADN, KC_RCRT + ), + [_FL] = LAYOUT_60_ansi_split_bs_rshift( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_CL] = LAYOUT_60_ansi_split_bs_rshift( + _______, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, _______, _______, _______, _______, BR_DEC, BR_INC, _______, _______, + _______, _______, _______, S1_DEC, S1_INC, S2_DEC, S2_INC, _______, _______, _______, _______, ES_DEC, ES_INC, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/zeal60/keymaps/default/config.h b/keyboards/wilba_tech/zeal60/keymaps/default/config.h similarity index 100% rename from keyboards/zeal60/keymaps/default/config.h rename to keyboards/wilba_tech/zeal60/keymaps/default/config.h diff --git a/keyboards/zeal60/keymaps/default/keymap.c b/keyboards/wilba_tech/zeal60/keymaps/default/keymap.c similarity index 100% rename from keyboards/zeal60/keymaps/default/keymap.c rename to keyboards/wilba_tech/zeal60/keymaps/default/keymap.c diff --git a/keyboards/zeal60/keymaps/hhkb/config.h b/keyboards/wilba_tech/zeal60/keymaps/hhkb/config.h similarity index 100% rename from keyboards/zeal60/keymaps/hhkb/config.h rename to keyboards/wilba_tech/zeal60/keymaps/hhkb/config.h diff --git a/keyboards/zeal60/keymaps/hhkb/keymap.c b/keyboards/wilba_tech/zeal60/keymaps/hhkb/keymap.c similarity index 100% rename from keyboards/zeal60/keymaps/hhkb/keymap.c rename to keyboards/wilba_tech/zeal60/keymaps/hhkb/keymap.c diff --git a/keyboards/zeal60/keymaps/iso/config.h b/keyboards/wilba_tech/zeal60/keymaps/iso/config.h similarity index 100% rename from keyboards/zeal60/keymaps/iso/config.h rename to keyboards/wilba_tech/zeal60/keymaps/iso/config.h diff --git a/keyboards/zeal60/keymaps/iso/keymap.c b/keyboards/wilba_tech/zeal60/keymaps/iso/keymap.c similarity index 100% rename from keyboards/zeal60/keymaps/iso/keymap.c rename to keyboards/wilba_tech/zeal60/keymaps/iso/keymap.c diff --git a/keyboards/zeal60/keymaps/ryanmaclean/config.h b/keyboards/wilba_tech/zeal60/keymaps/ryanmaclean/config.h similarity index 100% rename from keyboards/zeal60/keymaps/ryanmaclean/config.h rename to keyboards/wilba_tech/zeal60/keymaps/ryanmaclean/config.h diff --git a/keyboards/zeal60/keymaps/ryanmaclean/keymap.c b/keyboards/wilba_tech/zeal60/keymaps/ryanmaclean/keymap.c similarity index 100% rename from keyboards/zeal60/keymaps/ryanmaclean/keymap.c rename to keyboards/wilba_tech/zeal60/keymaps/ryanmaclean/keymap.c diff --git a/keyboards/zeal60/keymaps/tusing/Makefile b/keyboards/wilba_tech/zeal60/keymaps/tusing/Makefile similarity index 100% rename from keyboards/zeal60/keymaps/tusing/Makefile rename to keyboards/wilba_tech/zeal60/keymaps/tusing/Makefile diff --git a/keyboards/zeal60/keymaps/tusing/README.md b/keyboards/wilba_tech/zeal60/keymaps/tusing/README.md similarity index 100% rename from keyboards/zeal60/keymaps/tusing/README.md rename to keyboards/wilba_tech/zeal60/keymaps/tusing/README.md diff --git a/keyboards/zeal60/keymaps/tusing/config.h b/keyboards/wilba_tech/zeal60/keymaps/tusing/config.h similarity index 100% rename from keyboards/zeal60/keymaps/tusing/config.h rename to keyboards/wilba_tech/zeal60/keymaps/tusing/config.h diff --git a/keyboards/wilba_tech/zeal60/keymaps/tusing/keymap.c b/keyboards/wilba_tech/zeal60/keymaps/tusing/keymap.c new file mode 100644 index 00000000000..755ace8618c --- /dev/null +++ b/keyboards/wilba_tech/zeal60/keymaps/tusing/keymap.c @@ -0,0 +1,48 @@ +// Default layout for Zeal60 +#include QMK_KEYBOARD_H + +// For readability. +#define _x_ KC_NO +#define AUD_PRV LCTL(KC_MPRV) // Previous music track +#define AUD_PLY LCTL(KC_MPLY) // Pause music +#define AUD_NXT LCTL(KC_MNXT) // Next music track + +// Zeal60-specific keys: +// EF_INC, EF_DEC, // next/previous backlight effect +// H1_INC, H1_DEC, // Color 1 hue increase/decrease +// S1_INC, S1_DEC, // Color 1 saturation increase/decrease +// H2_INC, H2_DEC, // Color 2 hue increase/decrease +// S2_INC, S2_DEC, // Color 2 saturation increase/decrease +// BR_INC, BR_DEC, // backlight brightness increase/decrease + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// Default layer: Pressing caps-lock momentarily switches to Layer 1. +// This is the default layer. Pressing an empty keycode on another layer will take you here. + [0] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC}, + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS}, + {MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, _x_ }, + {KC_LSFT, _x_ , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, _x_ }, + {KC_LCTL, KC_LGUI, KC_LALT, _x_ , _x_ , _x_ , _x_ , KC_SPC, _x_ , _x_ , KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} + }, + +// Layer 1: Pressing enter switches to layer 2, where backlight controls live. +// This is a momentary layer: once you let go of caps, you'll be back in layer 1. + [1] = { + {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL }, + {_______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, KC_DEL, _______}, + {_______, AUD_PRV, AUD_PLY, AUD_NXT, _______, _______, _______, _______, _______, _______, _______, _______, TO(2) , _x_ }, + {KC_CAPS, _x_ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _x_ }, + {KC_RCTL, KC_RGUI, KC_RALT, _x_ , _x_ , _x_ , _x_ , _______, _x_ , _x_ , KC_HOME, KC_PGUP, KC_PGDN, KC_END} + }, + +// Layer 2: Zeal60 and backlight configuration. (Get here quickly by pressing Caps+Enter from Layer 1.) +// This is a persistent layer. Get back to the default layer by pressing enter. + [2] = { + {RESET, EF_DEC, EF_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, _______, _______, _______, _______, _______, _______, _______}, + {_______, H1_DEC, H1_INC, S1_DEC, S1_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, H2_DEC, H2_INC, S2_DEC, S2_INC, _______, _______, _______, _______, _______, _______, _______, TO(0) , _x_ }, + {RGB_MOD, _x_ , RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _x_ }, + {RGB_TOG, RGB_VAD, RGB_VAI, _x_ , _x_ , _x_ , _x_ , _______, _x_ , _x_ , _______, _______, _______, _______} + } +}; diff --git a/keyboards/wilba_tech/zeal60/readme.md b/keyboards/wilba_tech/zeal60/readme.md new file mode 100644 index 00000000000..21d55af39b6 --- /dev/null +++ b/keyboards/wilba_tech/zeal60/readme.md @@ -0,0 +1,47 @@ +Zeal60 +==== + +![Zeal60](https://cdn.shopify.com/s/files/1/0490/7329/products/Zeal60.jpg) + +This is a 60% PCB with per-key RGB LEDs and supports ANSI, ISO, winkey/winkeyless bottom row, HHKB-layout (split right shift and backspace). + +Keyboard Maintainer: [Wilba](http://wilba.tech/) and on [github](https://github.com/Wilba6582) +Hardware Supported: Zeal60 PCB Rev 0-3 +Hardware Availability: https://zealpc.net/collections/group-buy-pre-orders/products/zeal60rgb + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/zeal60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + + +RGB Backlight Configuration +==== + +A keymap (in the keymaps directory) can optionally configure which RGB backlight LEDs are used, depending on the needs of the layout, by adding a config.h file in the keymap's directory. +The following #define symbols will enable/disable a feature using 1 or 0. + + RGB_BACKLIGHT_USE_SPLIT_BACKSPACE + +Split backspace is being used, enables the right LED of the split backspace (the top-right corner) + + RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT + +Split left shift is being used (i.e. ISO layout), enables the right LED of the split left shift (the ISO key) + + RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT + +Split right shift is being used (i.e. HHKB style layouts), enables the right LED of the split right shift (the Fn key) + + RGB_BACKLIGHT_USE_7U_SPACEBAR + +A 7U spacebar is being used, controls the LEDs under the right stabilizer (of 7U spacebar) and right Alt (if 6.25U spacebar). + + RGB_BACKLIGHT_USE_ISO_ENTER + +An ISO Enter is being used. Only used to tweak the location of the LED being used under ANSI Enter/backslash + + RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS + +Disables the LEDs under HHKB corner blockers, useful for transparent cases. diff --git a/keyboards/wilba_tech/zeal60/rules.mk b/keyboards/wilba_tech/zeal60/rules.mk new file mode 100644 index 00000000000..5d20659f831 --- /dev/null +++ b/keyboards/wilba_tech/zeal60/rules.mk @@ -0,0 +1,80 @@ + + +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes + +LAYOUTS = 60_ansi 60_iso 60_hhkb 60_ansi_split_bs_rshift diff --git a/keyboards/wilba_tech/zeal60/zeal60.c b/keyboards/wilba_tech/zeal60/zeal60.c new file mode 100644 index 00000000000..b8c2e2f83fe --- /dev/null +++ b/keyboards/wilba_tech/zeal60/zeal60.c @@ -0,0 +1,18 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef RGB_BACKLIGHT_ZEAL60 +#error RGB_BACKLIGHT_ZEAL60 not defined, you done goofed somehao, brah +#endif diff --git a/keyboards/wilba_tech/zeal60/zeal60.h b/keyboards/wilba_tech/zeal60/zeal60.h new file mode 100644 index 00000000000..0d4f1b908b4 --- /dev/null +++ b/keyboards/wilba_tech/zeal60/zeal60.h @@ -0,0 +1,93 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#include "keyboards/wilba_tech/wt_rgb_backlight_keycodes.h" +#include "keyboards/wilba_tech/via_keycodes.h" + +#define XXX KC_NO + +#define LAYOUT_60_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K47, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K47, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, XXX }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K47, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, XXX }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K47, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K41, K42, K47, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { XXX, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, XXX, K4B, K4C, XXX } \ +} + diff --git a/keyboards/wilba_tech/zeal65/config.h b/keyboards/wilba_tech/zeal65/config.h new file mode 100644 index 00000000000..7217c6ed161 --- /dev/null +++ b/keyboards/wilba_tech/zeal65/config.h @@ -0,0 +1,138 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "config_common.h" + +// USB Device descriptor parameter +#define VENDOR_ID 0x5A45 // ZealPC ("ZE") +#define PRODUCT_ID 0x0065 // Zeal65 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ZealPC +#define PRODUCT Zeal65 +#define DESCRIPTION Zeal65 + +// key matrix size +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +// Zeal60 PCB default pin-out +#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 72 + +// COL2ROW or ROW2COL +#define DIODE_DIRECTION COL2ROW + +// Set 0 if debouncing isn't needed +#define DEBOUNCE 5 + +// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap +#define LOCKING_SUPPORT_ENABLE +// Locking resynchronize hack +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +// disable debug print +//#define NO_DEBUG + +// disable print +//#define NO_PRINT + +// disable action features +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for Zeal65 specifics +#define RGB_BACKLIGHT_ZEAL65 + +// enable/disable LEDs based on layout +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 // Unused +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 // Unused +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 // Used only for stab LED matching spacebar LED +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 // Unused +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0100000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0101000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111110000000011 + +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*5*15*2)) = (66+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 666 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 358 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/zeal65/info.json b/keyboards/wilba_tech/zeal65/info.json new file mode 100644 index 00000000000..d83895ed953 --- /dev/null +++ b/keyboards/wilba_tech/zeal65/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Zeal65", + "url": "https://zealpc.net", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_65_split_bs": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Win", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4, "w":1.5}, {"x":3, "y":4, "w":7}, {"label":"Fn2", "x":10, "y":4, "w":1.5}, {"label":"Fn1", "x":11.5, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + }, + "LAYOUT_65_normie": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Win", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4, "w":1.5}, {"x":3, "y":4, "w":7}, {"label":"Fn2", "x":10, "y":4, "w":1.5}, {"label":"Fn1", "x":11.5, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/zeal65/keymaps/default/config.h b/keyboards/wilba_tech/zeal65/keymaps/default/config.h similarity index 100% rename from keyboards/zeal65/keymaps/default/config.h rename to keyboards/wilba_tech/zeal65/keymaps/default/config.h diff --git a/keyboards/zeal65/keymaps/default/keymap.c b/keyboards/wilba_tech/zeal65/keymaps/default/keymap.c similarity index 100% rename from keyboards/zeal65/keymaps/default/keymap.c rename to keyboards/wilba_tech/zeal65/keymaps/default/keymap.c diff --git a/keyboards/zeal65/keymaps/split_bs/config.h b/keyboards/wilba_tech/zeal65/keymaps/split_bs/config.h similarity index 100% rename from keyboards/zeal65/keymaps/split_bs/config.h rename to keyboards/wilba_tech/zeal65/keymaps/split_bs/config.h diff --git a/keyboards/zeal65/keymaps/split_bs/keymap.c b/keyboards/wilba_tech/zeal65/keymaps/split_bs/keymap.c similarity index 100% rename from keyboards/zeal65/keymaps/split_bs/keymap.c rename to keyboards/wilba_tech/zeal65/keymaps/split_bs/keymap.c diff --git a/keyboards/wilba_tech/zeal65/readme.md b/keyboards/wilba_tech/zeal65/readme.md new file mode 100644 index 00000000000..7441480384b --- /dev/null +++ b/keyboards/wilba_tech/zeal65/readme.md @@ -0,0 +1,16 @@ +Zeal65 +==== + +![Zeal65](https://cdn.shopify.com/s/files/1/0490/7329/products/Zeal65_PCB2.jpg) + +This is a 65% PCB with per-key RGB LEDs and supports fixed, 1800-like bottom row and split backspace. It was designed for the Zephyr custom keyboard. + +Keyboard Maintainer: [Wilba](http://wilba.tech/) and on [github](https://github.com/Wilba6582) +Hardware Supported: Zeal65 PCB Rev 1 +Hardware Availability: https://zealpc.net/collections/group-buy-pre-orders/products/zephyr + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/zeal65:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/wilba_tech/zeal65/rules.mk b/keyboards/wilba_tech/zeal65/rules.mk new file mode 100644 index 00000000000..a1cd32aad5b --- /dev/null +++ b/keyboards/wilba_tech/zeal65/rules.mk @@ -0,0 +1,78 @@ + + +# project specific files +SRC = keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/keyboards/zeal65/zeal65.c b/keyboards/wilba_tech/zeal65/zeal65.c similarity index 100% rename from keyboards/zeal65/zeal65.c rename to keyboards/wilba_tech/zeal65/zeal65.c diff --git a/keyboards/wilba_tech/zeal65/zeal65.h b/keyboards/wilba_tech/zeal65/zeal65.h new file mode 100644 index 00000000000..d8528e6c516 --- /dev/null +++ b/keyboards/wilba_tech/zeal65/zeal65.h @@ -0,0 +1,50 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#include "keyboards/wilba_tech/wt_rgb_backlight_keycodes.h" +#include "keyboards/wilba_tech/via_keycodes.h" + +#define XXX KC_NO + +#define LAYOUT_65_split_bs( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K47, K4A, K4B, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, XXX, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D, K4E } \ +} + +#define LAYOUT_65_normie( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K47, K4A, K4B, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX, K2E }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, XXX, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D, K4E } \ +} diff --git a/keyboards/winkeyless/bface/README.md b/keyboards/winkeyless/bface/README.md new file mode 100644 index 00000000000..da0eb8088b6 --- /dev/null +++ b/keyboards/winkeyless/bface/README.md @@ -0,0 +1,46 @@ +# B.face + +A 60% keyboard with RGB that runs ps2avrgb natively. Please note that the B.face and B.fake have different switch matrices. Firmware on one, will not work on the other. + +Keyboard Maintainer: QMK Community +Hardware Supported: B.face PCB +Hardware Availability: [Winkeyless](https://winkeyless.kr/product/b-face-x2-pcb/) + +Make example for this keyboard (after setting up your build environment): + + make winkeyless/bface:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +**Reset Key:** Hold down the key located at K00, commonly programmed as left control while plugging in the keyboard. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + pip3 install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/winkeyless/bface/bface.c b/keyboards/winkeyless/bface/bface.c new file mode 100644 index 00000000000..1c83be4b8d5 --- /dev/null +++ b/keyboards/winkeyless/bface/bface.c @@ -0,0 +1,88 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rgblight.h" +#include "i2c_master.h" +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} +#endif + +void matrix_init_kb(void) { +#ifdef RGBLIGHT_ENABLE + if (rgblight_config.enable) { + i2c_init(); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + } +#endif + // call user level keymaps, if any + matrix_init_user(); +} + +void matrix_scan_kb(void) { +#ifdef RGBLIGHT_ENABLE + rgblight_task(); +#endif + matrix_scan_user(); + /* Nothing else for now. */ +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +void backlight_init_ports(void) { + // initialize pins D0, D1, D4 and D6 as output + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(D4); + setPinOutput(D6); + + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // turn backlight LEDs off + writePinLow(D0); + writePinLow(D1); + writePinLow(D4); + writePinLow(D6); + } else { + // turn backlight LEDs on + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(D4); + writePinHigh(D6); + } +} diff --git a/keyboards/winkeyless/bface/bface.h b/keyboards/winkeyless/bface/bface.h new file mode 100644 index 00000000000..f7a3b9521f4 --- /dev/null +++ b/keyboards/winkeyless/bface/bface.h @@ -0,0 +1,41 @@ +/* +Copyright 2017 Luiz Ribeiro +Copyright 2017 Sebastian Kaim + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum_keycodes.h" +#include "keycode.h" +#include "action.h" + +#define LAYOUT_60_ansi( \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, \ + K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, \ + K00, K10, K20, K56, K57, KA0, KB0, KC0 \ +){ \ + { K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KA0, KB0, KC0, KC_NO, KC_NO }, \ + { K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KC_NO, KC_NO }, \ + { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC_NO, KD2, KC_NO }, \ + { K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K16, K26, K36, K46, K56, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB6, KC6, KD6, KE6 }, \ + { KC_NO, K17, K27, K37, K47, K57, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB7, KC7, KD7, KE7 } \ +} + diff --git a/keyboards/winkeyless/bface/config.h b/keyboards/winkeyless/bface/config.h new file mode 100644 index 00000000000..7a1fe333549 --- /dev/null +++ b/keyboards/winkeyless/bface/config.h @@ -0,0 +1,49 @@ +/* +Copyright 2017 Luiz Ribeiro +Copyright 2017 Sebastian Kaim + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +// You can edit those at usbconfig.h about line 250. These values will +// unforunatly be ignored so far +#define MANUFACTURER winkeyless.kr +#define PRODUCT b.face + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +// 0 1 2 3 4 5 6 7 8 9 A B C D E +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7} +#define UNUSED_PINS + +#define RGBLED_NUM 16 +#define RGBLIGHT_ANIMATIONS + +#define NO_UART 1 +#define BOOTLOADHID_BOOTLOADER 1 + +#ifdef BACKLIGHT_ENABLE + // the backlight PWM does not work (yet). Therefore, we only have two backlight levels (on/off) + #define BACKLIGHT_LEVELS 1 + #define LED_PIN PORTD + #define BACKLIGHT_PORT_NUM (1 << 4) +#endif + diff --git a/keyboards/bface/info.json b/keyboards/winkeyless/bface/info.json similarity index 100% rename from keyboards/bface/info.json rename to keyboards/winkeyless/bface/info.json diff --git a/keyboards/winkeyless/bface/keymaps/default/keymap.c b/keyboards/winkeyless/bface/keymaps/default/keymap.c new file mode 100644 index 00000000000..a3e9bc9577d --- /dev/null +++ b/keyboards/winkeyless/bface/keymaps/default/keymap.c @@ -0,0 +1,43 @@ +/* +Copyright 2017 Sebastian Kaim + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, + KC_F1, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, + KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL,KC_LALT,KC_LGUI, KC_SPC, KC_RALT,KC_RGUI,MO(1), KC_RCTL + ), + [1] = LAYOUT_60_ansi( + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,BL_INC, BL_DEC, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,RGB_MOD,KC_TRNS,BL_ON, BL_OFF, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ), + /* You can copy this layer as base for a new fn layer * / + [n] = LAYOUT_60_ansi( + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ), // */ +}; diff --git a/keyboards/bface/keymaps/kpeatt/keymap.c b/keyboards/winkeyless/bface/keymaps/kpeatt/keymap.c similarity index 100% rename from keyboards/bface/keymaps/kpeatt/keymap.c rename to keyboards/winkeyless/bface/keymaps/kpeatt/keymap.c diff --git a/keyboards/bface/keymaps/kpeatt/readme.md b/keyboards/winkeyless/bface/keymaps/kpeatt/readme.md similarity index 100% rename from keyboards/bface/keymaps/kpeatt/readme.md rename to keyboards/winkeyless/bface/keymaps/kpeatt/readme.md diff --git a/keyboards/winkeyless/bface/keymaps/p3lim/README.md b/keyboards/winkeyless/bface/keymaps/p3lim/README.md new file mode 100644 index 00000000000..81f99ec966b --- /dev/null +++ b/keyboards/winkeyless/bface/keymaps/p3lim/README.md @@ -0,0 +1,14 @@ +# p3lim's b.face layout + +![](https://user-images.githubusercontent.com/26496/61170794-bf8a2c80-a56e-11e9-893f-f1766e7a9a04.png) + +My layout using the winkeyless b.face X2 PCB. The keys indicated with a gray color was not supported by the layout so a custom one was made. + +### Building & Flashing + +- Hold LCTRL while connecting to put in flashing mode +- Follow instructions in the main _bface_ directory + +### Layout notes + +The two additional keys were on pins 22+41 and 22+42, C3+B1 and C3+B2, which is mapped to col 10 row 1 and col 10 row 2 in the matrix. diff --git a/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c b/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c new file mode 100644 index 00000000000..0ec12452917 --- /dev/null +++ b/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c @@ -0,0 +1,156 @@ +/* +Copyright 2019 Adrian L Lange + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H +#include "quantum.h" + +#define LAYOUT_p3lim(\ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, \ + K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, KC1, \ + K00, K10, K20, K56, K57, KB0, KC0 \ +){ \ + { K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB0, KC0, KC_NO, KC_NO }, \ + { K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC1, KC_NO, KC_NO }, \ + { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC2, KD2, KC_NO }, \ + { K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KC_NO, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K16, K26, K36, K46, K56, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB6, KC6, KD6, KE6 }, \ + { KC_NO, K17, K27, K37, K47, K57, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB7, KC7, KD7, KE7 } \ +} + +enum my_keycodes { + C_ESC0 = SAFE_RANGE, // layer 0 esc + C_ESC1 // layer 1 esc +}; + +// use compiler macros for simpler stuff +#define C_NO1 RALT(KC_QUOT) +#define C_NO2 RALT(KC_SCLN) +#define C_NO3 RALT(KC_LBRC) +#define C_KVM1 LCA(KC_1) +#define C_KVM2 LCA(KC_2) +#define C_KVM3 LCA(KC_3) +#define C_KVM4 LCA(KC_4) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* QWERTY + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | + * |---------------------------------------------------------------------------------| Enter | + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | \ | | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Del | + * |-----------------------------------------------------------------------------------------+ + * | FN1 | Alt | GUI | Space | FN2 | Alt | Ctrl | + * `-----------------------------------------------------------------------------------------' + */ + [0] = LAYOUT_p3lim( + C_ESC0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, + MO(1), KC_LALT, KC_LGUI, KC_SPC, MO(2), KC_RGUI, KC_RCTL + ), + + /* FN1 + * ,-----------------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | + * |-----------------------------------------------------------------------------------------+ + * | Caps | Home| Up | End | PgUp| | | | | | | | | | + * |---------------------------------------------------------------------------------| | + * | | Left| Down|Right| PgDn| | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | KVM1| KVM2| KVM3| KVM4| | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + [1] = LAYOUT_p3lim( + C_ESC1, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + KC_CAPS, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, C_KVM1, C_KVM2, C_KVM3, C_KVM4, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_NO, _______, _______ + ), + + /* FN2 + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | Å | | | + * |---------------------------------------------------------------------------------| | + * | | | | | | | | | | | Ø | Æ | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + [2] = LAYOUT_p3lim( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_NO3, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_NO2, C_NO1, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_NO, _______, _______, _______, _______, _______, _______ + ), + /* + [n] = LAYOUT_p3lim( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ), + */ +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record){ + switch(keycode){ + case C_ESC0: // layer 0 + if(record->event.pressed){ + if(get_mods() & MOD_MASK_SHIFT) + register_code(KC_GRAVE); + else + register_code(KC_ESCAPE); + } else { + if(get_mods() & MOD_MASK_SHIFT) + unregister_code(KC_GRAVE); + else + unregister_code(KC_ESCAPE); + } + return false; + case C_ESC1: // layer 1 + if(record->event.pressed){ + if(get_mods() & MOD_MASK_SHIFT) + register_code(KC_ESCAPE); + else + register_code(KC_GRAVE); + } else { + if(get_mods() & MOD_MASK_SHIFT) + unregister_code(KC_ESCAPE); + else + unregister_code(KC_GRAVE); + } + return false; + } + return true; +} diff --git a/keyboards/winkeyless/bface/rules.mk b/keyboards/winkeyless/bface/rules.mk new file mode 100644 index 00000000000..b6d172f266e --- /dev/null +++ b/keyboards/winkeyless/bface/rules.mk @@ -0,0 +1,47 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# build options +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +BACKLIGHT_CUSTOM_DRIVER = yes +BACKLIGHT_BREATHING = no +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 +OPT_DEFS += -DBOOTLOADER_SIZE=2048 + +# custom matrix setup +SRC = i2c_master.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex + diff --git a/keyboards/winkeyless/bface/usbconfig.h b/keyboards/winkeyless/bface/usbconfig.h new file mode 100644 index 00000000000..192d80d9163 --- /dev/null +++ b/keyboards/winkeyless/bface/usbconfig.h @@ -0,0 +1,393 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#pragma once + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'b', '.', 'f', 'a', 'c', 'e' +#define USB_CFG_DEVICE_NAME_LEN 6 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect diff --git a/keyboards/bmini/bmini.c b/keyboards/winkeyless/bmini/bmini.c similarity index 100% rename from keyboards/bmini/bmini.c rename to keyboards/winkeyless/bmini/bmini.c diff --git a/keyboards/bmini/bmini.h b/keyboards/winkeyless/bmini/bmini.h similarity index 100% rename from keyboards/bmini/bmini.h rename to keyboards/winkeyless/bmini/bmini.h diff --git a/keyboards/winkeyless/bmini/config.h b/keyboards/winkeyless/bmini/config.h new file mode 100644 index 00000000000..96acd9bf16e --- /dev/null +++ b/keyboards/winkeyless/bmini/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef BMINI_CONFIG_H +#define BMINI_CONFIG_H + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define MANUFACTURER winkeyless.kr +#define PRODUCT B.mini + +#define RGBLED_NUM 16 + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define RGBLIGHT_ANIMATIONS + +#define NO_UART 1 + +#endif diff --git a/keyboards/bminiex/i2c.c b/keyboards/winkeyless/bmini/i2c.c similarity index 100% rename from keyboards/bminiex/i2c.c rename to keyboards/winkeyless/bmini/i2c.c diff --git a/keyboards/bmini/i2c.h b/keyboards/winkeyless/bmini/i2c.h similarity index 100% rename from keyboards/bmini/i2c.h rename to keyboards/winkeyless/bmini/i2c.h diff --git a/keyboards/bmini/info.json b/keyboards/winkeyless/bmini/info.json similarity index 100% rename from keyboards/bmini/info.json rename to keyboards/winkeyless/bmini/info.json diff --git a/keyboards/bmini/keymaps/default/keymap.c b/keyboards/winkeyless/bmini/keymaps/default/keymap.c similarity index 100% rename from keyboards/bmini/keymaps/default/keymap.c rename to keyboards/winkeyless/bmini/keymaps/default/keymap.c diff --git a/keyboards/bmini/matrix.c b/keyboards/winkeyless/bmini/matrix.c similarity index 100% rename from keyboards/bmini/matrix.c rename to keyboards/winkeyless/bmini/matrix.c diff --git a/keyboards/winkeyless/bmini/readme.md b/keyboards/winkeyless/bmini/readme.md new file mode 100644 index 00000000000..3401b974448 --- /dev/null +++ b/keyboards/winkeyless/bmini/readme.md @@ -0,0 +1,43 @@ +# B.mini + +A 75% keyboard with RGB + +Keyboard Maintainer: QMK Community +Hardware Supported: B.mini PCB +Hardware Availability: http://winkeyless.kr/product/b-mini-x2-pcb/ + +Make example for this keyboard (after setting up your build environment): + + make winkeyless/bmini:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/winkeyless/bmini/rules.mk b/keyboards/winkeyless/bmini/rules.mk new file mode 100644 index 00000000000..3d7bc0215d2 --- /dev/null +++ b/keyboards/winkeyless/bmini/rules.mk @@ -0,0 +1,50 @@ +# Copyright 2017 Luiz Ribeiro +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/bmini/usbconfig.h b/keyboards/winkeyless/bmini/usbconfig.h similarity index 100% rename from keyboards/bmini/usbconfig.h rename to keyboards/winkeyless/bmini/usbconfig.h diff --git a/keyboards/winkeyless/bminiex/backlight.c b/keyboards/winkeyless/bminiex/backlight.c new file mode 100644 index 00000000000..94e8126d888 --- /dev/null +++ b/keyboards/winkeyless/bminiex/backlight.c @@ -0,0 +1,211 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#include "backlight.h" +#include "quantum.h" + +#include +#include + +#include "backlight_custom.h" +#include "breathing_custom.h" + +// DEBUG +#include +#include + +// Port D: digital pins of the AVR chipset +#define NUMLOCK_PORT (1 << 0) // D0 +#define CAPSLOCK_PORT (1 << 1) // D1 +#define BACKLIGHT_PORT (1 << 4) // D4 +#define SCROLLLOCK_PORT (1 << 6) // D6 + +#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 +#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default + +#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask + +#define PWM_MAX 0xFF +#define TIMER_TOP 255 // 8 bit PWM + +extern backlight_config_t backlight_config; + +/** + * References + * Port Registers: https://www.arduino.cc/en/Reference/PortManipulation + * TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b + * Timers: http://www.avrbeginners.net/architecture/timers/timers.html + * 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/ + * PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware + */ + +// @Override +// turn LEDs on and off depending on USB caps/num/scroll lock states. +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + // turn on + DDRD |= NUMLOCK_PORT; + PORTD |= NUMLOCK_PORT; + } else { + // turn off + DDRD &= ~NUMLOCK_PORT; + PORTD &= ~NUMLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= CAPSLOCK_PORT; + PORTD |= CAPSLOCK_PORT; + } else { + DDRD &= ~CAPSLOCK_PORT; + PORTD &= ~CAPSLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRD |= SCROLLLOCK_PORT; + PORTD |= SCROLLLOCK_PORT; + } else { + DDRD &= ~SCROLLLOCK_PORT; + PORTD &= ~SCROLLLOCK_PORT; + } +} + +#ifdef BACKLIGHT_ENABLE + +// sets up Timer 1 for 8-bit PWM +void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE + // default 8 bit mode + TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH + TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW + + // clear output compare value A + // outb(OCR1AH, 0); + // outb(OCR1AL, 0); + + // clear output comparator registers for B + OCR1BH = 0; // outb(OCR1BH, 0); + OCR1BL = 0; // outb(OCR1BL, 0); +} + +bool is_init = false; +void timer1Init(void) { + // timer1SetPrescaler(TIMER1PRESCALE) + // set to DIV/64 + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE; + + // reset TCNT1 + TCNT1H = 0; // outb(TCNT1H, 0); + TCNT1L = 0; // outb(TCNT1L, 0); + + // TOIE1: Timer Overflow Interrupt Enable (Timer 1); + TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1); + + is_init = true; +} + +void timer1UnInit(void) { + // set prescaler back to NONE + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP + + // disable timer overflow interrupt + TIMSK &= ~_BV(TOIE1); // overflow bit? + + setPWM(0); + + is_init = false; +} + + +// handle TCNT1 overflow +//! Interrupt handler for tcnt1 overflow interrupt +ISR(TIMER1_OVF_vect, ISR_NOBLOCK) +{ + // sei(); + // handle breathing here + #ifdef BACKLIGHT_BREATHING + if (is_breathing()) { + custom_breathing_handler(); + } + #endif +} + +// enable timer 1 PWM +// timer1PWMBOn() +void timer1PWMBEnable(void) { + // turn on channel B (OC1B) PWM output + // set OC1B as non-inverted PWM + TCCR1A |= _BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +// disable timer 1 PWM +// timer1PWMBOff() +void timer1PWMBDisable(void) { + TCCR1A &= ~_BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +void enableBacklight(void) { + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high +} + +void disableBacklight(void) { + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low +} + +void startPWM(void) { + timer1Init(); + timer1PWMBEnable(); + enableBacklight(); +} + +void stopPWM(void) { + timer1UnInit(); + disableBacklight(); + timer1PWMBDisable(); +} + +void b_led_init_ports(void) { + /* turn backlight on/off depending on user preference */ + #if BACKLIGHT_ON_STATE == 0 + // DDRx register: sets the direction of Port D + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low + #else + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high + #endif + + timer1PWMSetup(); + startPWM(); + + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif +} + +void b_led_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) { + level = BACKLIGHT_LEVELS; + } + + setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS)); +} + +// called every matrix scan +void b_led_task(void) { + // do nothing for now +} + +void setPWM(uint16_t xValue) { + if (xValue > TIMER_TOP) { + xValue = TIMER_TOP; + } + OCR1B = xValue; // timer1PWMBSet(xValue); +} + +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/winkeyless/bminiex/backlight_custom.h b/keyboards/winkeyless/bminiex/backlight_custom.h new file mode 100644 index 00000000000..51365fe3ba4 --- /dev/null +++ b/keyboards/winkeyless/bminiex/backlight_custom.h @@ -0,0 +1,13 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#pragma once + +#include +void b_led_init_ports(void); +void b_led_set(uint8_t level); +void b_led_task(void); +void setPWM(uint16_t xValue); + diff --git a/keyboards/bminiex/bminiex.c b/keyboards/winkeyless/bminiex/bminiex.c similarity index 100% rename from keyboards/bminiex/bminiex.c rename to keyboards/winkeyless/bminiex/bminiex.c diff --git a/keyboards/winkeyless/bminiex/bminiex.h b/keyboards/winkeyless/bminiex/bminiex.h new file mode 100644 index 00000000000..8d897f639fe --- /dev/null +++ b/keyboards/winkeyless/bminiex/bminiex.h @@ -0,0 +1,94 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \ + K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ + K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ +){ \ + { K00, K10, K20, K30, KC_NO, KC_NO, K60, KC_NO, K80, K90, KC_NO, KB0, KC0, KD0, KE0 }, \ + { K01, K11, K21, K31, K41, K51, K61, K71, K81, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \ + { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, KD2, KE2 }, \ + { K03, K13, K23, K33, K43, K53, K63, K73, K83, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4, KB4, KC4, KC_NO, KE4 }, \ + { K05, KC_NO, K25, K35, K45, K55, K65, K75, K85, K95, KC_NO, KB5, KC5, KD5, KE5 }, \ + { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \ + { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ +} + +#define LAYOUT_ansi( \ + K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, K62, K72, K82, K92, \ + K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ + K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ +){ \ + { K00, K10, K20, KC_NO, KC_NO, KC_NO, K60, KC_NO, K80, K90, KC_NO, KB0, KC0, KD0, KE0 }, \ + { K01, K11, K21, K31, K41, K51, K61, K71, K81, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \ + { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC_NO, KD2, KE2 }, \ + { K03, K13, K23, K33, K43, K53, K63, K73, K83, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4, KB4, KC4, KC_NO, KE4 }, \ + { K05, KC_NO, K25, K35, K45, K55, K65, K75, K85, K95, KC_NO, KB5, KC5, KD5, KE5 }, \ + { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \ + { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ +} + +#define LAYOUT_iso( \ + K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, K67, K63, K73, K83, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \ + K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ + K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ +){ \ + { K00, K10, K20, K30, KC_NO, KC_NO, K60, KC_NO, K80, K90, KC_NO, KB0, KC0, KD0, KE0 }, \ + { K01, K11, K21, K31, K41, K51, K61, K71, K81, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \ + { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, KD2, KE2 }, \ + { K03, K13, K23, K33, K43, K53, K63, K73, K83, KC_NO, KA3, KB3, KC3, KC_NO, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4, KB4, KC4, KC_NO, KE4 }, \ + { K05, KC_NO, K25, K35, K45, K55, K65, K75, K85, K95, KC_NO, KB5, KC5, KD5, KE5 }, \ + { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \ + { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ +} + +#define LAYOUT_kc( \ + K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \ + K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ + K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ +) \ +{ \ + { KC_##K00, KC_##K10, KC_##K20, KC_##K30, KC_NO, KC_NO, KC_##K60, KC_NO, KC_##K80, KC_##K90, KC_NO, KC_##KB0, KC_##KC0, KC_##KD0, KC_##KE0 }, \ + { KC_##K01, KC_##K11, KC_##K21, KC_##K31, KC_##K41, KC_##K51, KC_##K61, KC_##K71, KC_##K81, KC_NO, KC_##KA1, KC_##KB1, KC_NO, KC_##KD1, KC_##KE1 }, \ + { KC_##K02, KC_##K12, KC_##K22, KC_##K32, KC_##K42, KC_##K52, KC_##K62, KC_##K72, KC_##K82, KC_##K92, KC_##KA2, KC_##KB2, KC_##KC2, KC_##KD2, KC_##KE2 }, \ + { KC_##K03, KC_##K13, KC_##K23, KC_##K33, KC_##K43, KC_##K53, KC_##K63, KC_##K73, KC_##K83, KC_NO, KC_##KA3, KC_##KB3, KC_##KC3, KC_##KD3, KC_NO }, \ + { KC_##K04, KC_##K14, KC_##K24, KC_##K34, KC_##K44, KC_##K54, KC_##K64, KC_##K74, KC_##K84, KC_##K94, KC_##KA4, KC_##KB4, KC_##KC4, KC_NO, KC_##KE4 }, \ + { KC_##K05, KC_NO, KC_##K25, KC_##K35, KC_##K45, KC_##K55, KC_##K65, KC_##K75, KC_##K85, KC_##K95, KC_NO, KC_##KB5, KC_##KC5, KC_##KD5, KC_##KE5 }, \ + { KC_##K06, KC_##K16, KC_##K26, KC_##K36, KC_##K46, KC_##K56, KC_##K66, KC_##K76, KC_##K86, KC_##K96, KC_##KA6, KC_##KB6, KC_##KC6, KC_##KD6, KC_##KE6 }, \ + { KC_##K07, KC_##K17, KC_##K27, KC_##K37, KC_##K47, KC_##K57, KC_##K67, KC_##K77, KC_NO, KC_NO, KC_##KA7, KC_##KB7, KC_##KC7, KC_##KD7, KC_##KE7 } \ +} + diff --git a/keyboards/jj40/breathing_custom.h b/keyboards/winkeyless/bminiex/breathing_custom.h similarity index 100% rename from keyboards/jj40/breathing_custom.h rename to keyboards/winkeyless/bminiex/breathing_custom.h diff --git a/keyboards/winkeyless/bminiex/config.h b/keyboards/winkeyless/bminiex/config.h new file mode 100644 index 00000000000..ebd33ad61e7 --- /dev/null +++ b/keyboards/winkeyless/bminiex/config.h @@ -0,0 +1,37 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422E +#define MANUFACTURER winkeyless.kr +#define PRODUCT B.mini Ex + +#define RGBLED_NUM 20 + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define RGBLIGHT_ANIMATIONS + +#define BACKLIGHT_LEVELS 5 + +#define NO_UART 1 diff --git a/keyboards/facew/i2c.c b/keyboards/winkeyless/bminiex/i2c.c similarity index 100% rename from keyboards/facew/i2c.c rename to keyboards/winkeyless/bminiex/i2c.c diff --git a/keyboards/winkeyless/bminiex/i2c.h b/keyboards/winkeyless/bminiex/i2c.h new file mode 100644 index 00000000000..ada8cc7bf14 --- /dev/null +++ b/keyboards/winkeyless/bminiex/i2c.h @@ -0,0 +1,25 @@ +/* +Copyright 2016 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +// Please do not modify this file + +#pragma once + +void i2c_init(void); +void i2c_set_bitrate(uint16_t bitrate_khz); +uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); + diff --git a/keyboards/winkeyless/bminiex/info.json b/keyboards/winkeyless/bminiex/info.json new file mode 100644 index 00000000000..8e38fbfb933 --- /dev/null +++ b/keyboards/winkeyless/bminiex/info.json @@ -0,0 +1,340 @@ +{ + "keyboard_name": "winkeyless.kr B.mini EX", + "keyboard_folder": "bminiex", + "url": "https://winkeyless.kr/product/b-mini-ex-x2-pcb/", + "maintainer": "qmk", + "width": 20.25, + "height": 6.25, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PSCR", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"NO", "x":16.25, "y":0}, + {"label":"NO", "x":17.25, "y":0}, + {"label":"NO", "x":18.25, "y":0}, + {"label":"NO", "x":19.25, "y":0}, + {"label":"GRV", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":7, "y":1.25}, + {"label":"8", "x":8, "y":1.25}, + {"label":"9", "x":9, "y":1.25}, + {"label":"0", "x":10, "y":1.25}, + {"label":"MINS", "x":11, "y":1.25}, + {"label":"EQL", "x":12, "y":1.25}, + {"label":"BSPC", "x":13, "y":1.25, "w":2}, + {"label":"DEL", "x":15, "y":1.25}, + {"label":"NLCK", "x":16.25, "y":1.25}, + {"label":"PSLS", "x":17.25, "y":1.25}, + {"label":"PAST", "x":18.25, "y":1.25}, + {"label":"PMNS", "x":19.25, "y":1.25}, + {"label":"TAB", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"LBRC", "x":11.5, "y":2.25}, + {"label":"RBRC", "x":12.5, "y":2.25}, + {"label":"NO", "x":13.5, "y":2.25, "w":1.5}, + {"label":"INS", "x":15, "y":2.25}, + {"label":"P7", "x":16.25, "y":2.25}, + {"label":"P8", "x":17.25, "y":2.25}, + {"label":"P9", "x":18.25, "y":2.25}, + {"label":"CAPS", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":"SCLN", "x":10.75, "y":3.25}, + {"label":"QUOT", "x":11.75, "y":3.25}, + {"label":"NUHS", "x":12.75, "y":3.25}, + {"label":"ENT", "x":13.75, "y":3.25, "w":1.25}, + {"label":"PGUP", "x":15, "y":3.25}, + {"label":"P4", "x":16.25, "y":3.25}, + {"label":"P5", "x":17.25, "y":3.25}, + {"label":"P6", "x":18.25, "y":3.25}, + {"label":"PPLS", "x":19.25, "y":2.25, "h":2}, + {"label":"LSFT", "x":0, "y":4.25, "w":1.25}, + {"label":"NUBS", "x":1.25, "y":4.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":"COMM", "x":9.25, "y":4.25}, + {"label":"DOT", "x":10.25, "y":4.25}, + {"label":"SLSH", "x":11.25, "y":4.25}, + {"label":"RSFT", "x":12.25, "y":4.25, "w":1.75}, + {"label":"UP", "x":14, "y":4.25}, + {"label":"PGDN", "x":15, "y":4.25}, + {"label":"P1", "x":16.25, "y":4.25}, + {"label":"P2", "x":17.25, "y":4.25}, + {"label":"P3", "x":18.25, "y":4.25}, + {"label":"LCTL", "x":0, "y":5.25, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5.25, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5.25, "w":1.25}, + {"label":"SPC", "x":3.75, "y":5.25, "w":6.25}, + {"label":"RALT", "x":10, "y":5.25}, + {"label":"APP", "x":11, "y":5.25}, + {"label":"RCTL", "x":12, "y":5.25}, + {"label":"LEFT", "x":13, "y":5.25}, + {"label":"DOWN", "x":14, "y":5.25}, + {"label":"RGHT", "x":15, "y":5.25}, + {"label":"P0", "x":16.25, "y":5.25, "w":2}, + {"label":"PDOT", "x":18.25, "y":5.25}, + {"label":"PENT", "x":19.25, "y":4.25, "h":2} + ] + }, + "LAYOUT_ansi": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PSCR", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"NO", "x":16.25, "y":0}, + {"label":"NO", "x":17.25, "y":0}, + {"label":"NO", "x":18.25, "y":0}, + {"label":"NO", "x":19.25, "y":0}, + {"label":"GRV", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":7, "y":1.25}, + {"label":"8", "x":8, "y":1.25}, + {"label":"9", "x":9, "y":1.25}, + {"label":"0", "x":10, "y":1.25}, + {"label":"MINS", "x":11, "y":1.25}, + {"label":"EQL", "x":12, "y":1.25}, + {"label":"BSPC", "x":13, "y":1.25, "w":2}, + {"label":"DEL", "x":15, "y":1.25}, + {"label":"NLCK", "x":16.25, "y":1.25}, + {"label":"PSLS", "x":17.25, "y":1.25}, + {"label":"PAST", "x":18.25, "y":1.25}, + {"label":"PMNS", "x":19.25, "y":1.25}, + {"label":"TAB", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"LBRC", "x":11.5, "y":2.25}, + {"label":"RBRC", "x":12.5, "y":2.25}, + {"label":"BSLS", "x":13.5, "y":2.25, "w":1.5}, + {"label":"INS", "x":15, "y":2.25}, + {"label":"P7", "x":16.25, "y":2.25}, + {"label":"P8", "x":17.25, "y":2.25}, + {"label":"P9", "x":18.25, "y":2.25}, + {"label":"CAPS", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":"SCLN", "x":10.75, "y":3.25}, + {"label":"QUOT", "x":11.75, "y":3.25}, + {"label":"ENT", "x":12.75, "y":3.25, "w":2.25}, + {"label":"PGUP", "x":15, "y":3.25}, + {"label":"P4", "x":16.25, "y":3.25}, + {"label":"P5", "x":17.25, "y":3.25}, + {"label":"P6", "x":18.25, "y":3.25}, + {"label":"PPLS", "x":19.25, "y":2.25, "h":2}, + {"label":"LSFT", "x":0, "y":4.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":"COMM", "x":9.25, "y":4.25}, + {"label":"DOT", "x":10.25, "y":4.25}, + {"label":"SLSH", "x":11.25, "y":4.25}, + {"label":"RSFT", "x":12.25, "y":4.25, "w":1.75}, + {"label":"UP", "x":14, "y":4.25}, + {"label":"PGDN", "x":15, "y":4.25}, + {"label":"P1", "x":16.25, "y":4.25}, + {"label":"P2", "x":17.25, "y":4.25}, + {"label":"P3", "x":18.25, "y":4.25}, + {"label":"LCTL", "x":0, "y":5.25, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5.25, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5.25, "w":1.25}, + {"label":"SPC", "x":3.75, "y":5.25, "w":6.25}, + {"label":"RALT", "x":10, "y":5.25}, + {"label":"APP", "x":11, "y":5.25}, + {"label":"RCTL", "x":12, "y":5.25}, + {"label":"LEFT", "x":13, "y":5.25}, + {"label":"DOWN", "x":14, "y":5.25}, + {"label":"RGHT", "x":15, "y":5.25}, + {"label":"P0", "x":16.25, "y":5.25, "w":2}, + {"label":"PDOT", "x":18.25, "y":5.25}, + {"label":"PENT", "x":19.25, "y":4.25, "h":2} + ] + }, + "LAYOUT_iso": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PSCR", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"NO", "x":16.25, "y":0}, + {"label":"NO", "x":17.25, "y":0}, + {"label":"NO", "x":18.25, "y":0}, + {"label":"NO", "x":19.25, "y":0}, + {"label":"GRV", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":7, "y":1.25}, + {"label":"8", "x":8, "y":1.25}, + {"label":"9", "x":9, "y":1.25}, + {"label":"0", "x":10, "y":1.25}, + {"label":"MINS", "x":11, "y":1.25}, + {"label":"EQL", "x":12, "y":1.25}, + {"label":"BSPC", "x":13, "y":1.25, "w":2}, + {"label":"DEL", "x":15, "y":1.25}, + {"label":"NLCK", "x":16.25, "y":1.25}, + {"label":"PSLS", "x":17.25, "y":1.25}, + {"label":"PAST", "x":18.25, "y":1.25}, + {"label":"PMNS", "x":19.25, "y":1.25}, + {"label":"TAB", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"LBRC", "x":11.5, "y":2.25}, + {"label":"RBRC", "x":12.5, "y":2.25}, + {"label":"INS", "x":15, "y":2.25}, + {"label":"P7", "x":16.25, "y":2.25}, + {"label":"P8", "x":17.25, "y":2.25}, + {"label":"P9", "x":18.25, "y":2.25}, + {"label":"CAPS", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":"SCLN", "x":10.75, "y":3.25}, + {"label":"QUOT", "x":11.75, "y":3.25}, + {"label":"NUHS", "x":12.75, "y":3.25}, + {"label":"ENT", "x":13.75, "y":2.25, "w":1.25, "h":2}, + {"label":"PGUP", "x":15, "y":3.25}, + {"label":"P4", "x":16.25, "y":3.25}, + {"label":"P5", "x":17.25, "y":3.25}, + {"label":"P6", "x":18.25, "y":3.25}, + {"label":"PPLS", "x":19.25, "y":2.25, "h":2}, + {"label":"LSFT", "x":0, "y":4.25, "w":1.25}, + {"label":"NUBS", "x":1.25, "y":4.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":"COMM", "x":9.25, "y":4.25}, + {"label":"DOT", "x":10.25, "y":4.25}, + {"label":"SLSH", "x":11.25, "y":4.25}, + {"label":"RSFT", "x":12.25, "y":4.25, "w":1.75}, + {"label":"UP", "x":14, "y":4.25}, + {"label":"PGDN", "x":15, "y":4.25}, + {"label":"P1", "x":16.25, "y":4.25}, + {"label":"P2", "x":17.25, "y":4.25}, + {"label":"P3", "x":18.25, "y":4.25}, + {"label":"LCTL", "x":0, "y":5.25, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5.25, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5.25, "w":1.25}, + {"label":"SPC", "x":3.75, "y":5.25, "w":6.25}, + {"label":"RALT", "x":10, "y":5.25}, + {"label":"APP", "x":11, "y":5.25}, + {"label":"RCTL", "x":12, "y":5.25}, + {"label":"LEFT", "x":13, "y":5.25}, + {"label":"DOWN", "x":14, "y":5.25}, + {"label":"RGHT", "x":15, "y":5.25}, + {"label":"P0", "x":16.25, "y":5.25, "w":2}, + {"label":"PDOT", "x":18.25, "y":5.25}, + {"label":"PENT", "x":19.25, "y":4.25, "h":2} + ] + } + } +} diff --git a/keyboards/winkeyless/bminiex/keymaps/ansi/keymap.c b/keyboards/winkeyless/bminiex/keymaps/ansi/keymap.c new file mode 100644 index 00000000000..12c0714b130 --- /dev/null +++ b/keyboards/winkeyless/bminiex/keymaps/ansi/keymap.c @@ -0,0 +1,29 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_P7, KC_P8, KC_P9, \ + KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ) +}; diff --git a/keyboards/winkeyless/bminiex/keymaps/ansi/readme.md b/keyboards/winkeyless/bminiex/keymaps/ansi/readme.md new file mode 100644 index 00000000000..853fa05c597 --- /dev/null +++ b/keyboards/winkeyless/bminiex/keymaps/ansi/readme.md @@ -0,0 +1,17 @@ +# ansi + +An ANSI-layout keymap based on the default. + + ,-------------------------------------------------------------------------------. + |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|PSc|Hm |End|NO |NO |NO |NO | + |-------------------------------------------------------------------------------| + |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Bksp |Del|NLck|P/|P* |P- | + |-------------------------------------------------------------------------------| + |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Ins|P7 |P8 |P9 | | + |---------------------------------------------------------------------------|P+ | + |CapsLk|A |S |D |F |G |H |J |K |L |; |' |Enter |PgU|P4 |P5 |P6 | | + |-------------------------------------------------------------------------------| + |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Up |PgD|P1 |P2 |P3 | | + |---------------------------------------------------------------------------|Ent| + |Ctrl|GUI |Alt |Space |Alt|App|Ctl|Lft|Dwn|Rgt|P0 |P. | | + `-------------------------------------------------------------------------------' diff --git a/keyboards/bminiex/keymaps/default/keymap.c b/keyboards/winkeyless/bminiex/keymaps/default/keymap.c similarity index 100% rename from keyboards/bminiex/keymaps/default/keymap.c rename to keyboards/winkeyless/bminiex/keymaps/default/keymap.c diff --git a/keyboards/winkeyless/bminiex/keymaps/iso/keymap.c b/keyboards/winkeyless/bminiex/keymaps/iso/keymap.c new file mode 100644 index 00000000000..aa4ddf063a0 --- /dev/null +++ b/keyboards/winkeyless/bminiex/keymaps/iso/keymap.c @@ -0,0 +1,29 @@ +/* +Copyright 2017 Luiz Ribeiro + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_iso( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_INS, KC_P7, KC_P8, KC_P9, \ + KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ) +}; diff --git a/keyboards/winkeyless/bminiex/keymaps/iso/readme.md b/keyboards/winkeyless/bminiex/keymaps/iso/readme.md new file mode 100644 index 00000000000..74c42a61841 --- /dev/null +++ b/keyboards/winkeyless/bminiex/keymaps/iso/readme.md @@ -0,0 +1,17 @@ +# iso + +An ISO-layout keymap based on the default. + + ,-------------------------------------------------------------------------------. + |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|PSc|Hm |End|NO |NO |NO |NO | + |-------------------------------------------------------------------------------| + |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Bksp |Del|NLck|P/|P* |P- | + |-------------------------------------------------------------------------------| + |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] | |Ins|P7 |P8 |P9 | | + |------------------------------------------------------.Ent |---------------|P+ | + |CapsLk|A |S |D |F |G |H |J |K |L |; |' |# | |PgU|P4 |P5 |P6 | | + |-------------------------------------------------------------------------------| + |Sft |\ |Z |X |C |V |B |N |M |, |. |/ |Shift |Up |PgD|P1 |P2 |P3 | | + |---------------------------------------------------------------------------|Ent| + |Ctrl|GUI |Alt |Space |Alt|App|Ctl|Lft|Dwn|Rgt|P0 |P. | | + `-------------------------------------------------------------------------------' diff --git a/keyboards/bminiex/matrix.c b/keyboards/winkeyless/bminiex/matrix.c similarity index 100% rename from keyboards/bminiex/matrix.c rename to keyboards/winkeyless/bminiex/matrix.c diff --git a/keyboards/winkeyless/bminiex/readme.md b/keyboards/winkeyless/bminiex/readme.md new file mode 100644 index 00000000000..7dbabedbaf3 --- /dev/null +++ b/keyboards/winkeyless/bminiex/readme.md @@ -0,0 +1,13 @@ +# B.mini EX + +A compact fullsize keyboard with RGB + +Keyboard Maintainer: QMK Community +Hardware Supported: B.mini EX PCB +Hardware Availability: https://winkeyless.kr/product/b-mini-ex-x2-pcb/ + +Make example for this keyboard (after setting up your build environment): + + make winkeyless/bminiex:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/bminiex/rules.mk b/keyboards/winkeyless/bminiex/rules.mk similarity index 100% rename from keyboards/bminiex/rules.mk rename to keyboards/winkeyless/bminiex/rules.mk diff --git a/keyboards/bminiex/usbconfig.h b/keyboards/winkeyless/bminiex/usbconfig.h similarity index 100% rename from keyboards/bminiex/usbconfig.h rename to keyboards/winkeyless/bminiex/usbconfig.h diff --git a/keyboards/winkeyless/readme.md b/keyboards/winkeyless/readme.md new file mode 100644 index 00000000000..e6cb45fc474 --- /dev/null +++ b/keyboards/winkeyless/readme.md @@ -0,0 +1,7 @@ +# Winkeyless + +[Winkeyless](https://www.winkeyless.kr) is a Korean keyboard company popular for creating the Boot Mapper Client (BMC) firmware. Most Winkeyless boards were low profile and constructed out of acrylic showcasing their RGB underglow capabilities. + +In late 2018, Winkeyless closed its doors due to the numerous unlicensed implementations of its hardware and software. + +This directory contains official Winkeyless boards that have had QMK ported to work with them. diff --git a/keyboards/xd004/info.json b/keyboards/xd004/info.json new file mode 100644 index 00000000000..72c15da7f8a --- /dev/null +++ b/keyboards/xd004/info.json @@ -0,0 +1,11 @@ +{ + "keyboard_name": "XD004", + "maintainer": "", + "width": 4, + "height": 1, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"L", "x":0, "y":0}, {"label":"O", "x":1, "y":0}, {"label":"V", "x":2, "y":0}, {"label":"E", "x":3, "y":0}] + } + } +} diff --git a/keyboards/xd004/keymaps/default/keymap.c b/keyboards/xd004/keymaps/default/keymap.c new file mode 100644 index 00000000000..e82ce5e9736 --- /dev/null +++ b/keyboards/xd004/keymaps/default/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // 0: Base Layer + LAYOUT_all(KC_L, KC_O, KC_V, KC_E), + +}; + +// Loop +void matrix_scan_user(void){ + // Empty +}; diff --git a/keyboards/xd004/keymaps/default/readme.md b/keyboards/xd004/keymaps/default/readme.md new file mode 100644 index 00000000000..fdf07cc8775 --- /dev/null +++ b/keyboards/xd004/keymaps/default/readme.md @@ -0,0 +1,7 @@ +# Default Keymap for XD004 PCB + +This keymap is not very useful, but it will validate that the board works. + +## Build + +To build the default keymap, simply run `make xd004:default`. diff --git a/keyboards/xd004/keymaps/system_and_media/keymap.c b/keyboards/xd004/keymaps/system_and_media/keymap.c new file mode 100644 index 00000000000..60f0e15bbe3 --- /dev/null +++ b/keyboards/xd004/keymaps/system_and_media/keymap.c @@ -0,0 +1,59 @@ +#include QMK_KEYBOARD_H + +#define _BASE 0 // Base layer +#define _SYSTEM 1 // System actions +#define _VOLUME 2 // Volume actions + +#define SUPER_ALT_F4_TIMER 300 // Timeout on the super alt-f4 key + +/* + The idea of this is pretty simple: base layer has four action, two of which (the outermost) + are regular keystrokes on tap, and a momentary layer switch on hold, sending you to layers 1 and 2. + + The other bit of customization here is the 'Super Alt F4' which does Alt-F4, and then Enter if tapped + again SUPER_ALT_F4_TIMER miliseconds after. This lets you Alt-F4 applications, and finally quickly + double-tap it to Alt-F4+Enter to shut down the PC. +*/ + +bool is_alt_f4_active = false; +uint16_t alt_f4_timer = 0; + +enum custom_keycodes { // Make sure have the awesome keycode ready + SUPER_ALT_F4 = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // 0: Base Layer + [_BASE] = LAYOUT_all(LT(_SYSTEM, KC_F5), C(G(KC_LEFT)), C(G(KC_RIGHT)), LT(_VOLUME, KC_F7)), + + // 1: System actions + [_SYSTEM] = LAYOUT_all(_______, SUPER_ALT_F4, G(KC_D), G(KC_L)), + + // 2: Volume actions + [_VOLUME] = LAYOUT_all(KC_MEDIA_NEXT_TRACK, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, _______), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { // This will do most of the grunt work with the keycodes. + case SUPER_ALT_F4: + if (record->event.pressed) { + if (!is_alt_f4_active) { + is_alt_f4_active = true; + tap_code16(LALT(KC_F4)); // Alt-F4 + } else { + tap_code(KC_ENTER); // Tap enter + } + } + alt_f4_timer = timer_read(); + break; + } + return true; +} + +void matrix_scan_user(void) { + if (is_alt_f4_active && timer_elapsed(alt_f4_timer) > SUPER_ALT_F4_TIMER) { + is_alt_f4_active = false; + } +}; diff --git a/keyboards/xd004/keymaps/system_and_media/readme.md b/keyboards/xd004/keymaps/system_and_media/readme.md new file mode 100644 index 00000000000..d684d463c6c --- /dev/null +++ b/keyboards/xd004/keymaps/system_and_media/readme.md @@ -0,0 +1,9 @@ +# Slightly more advanced keymap for XD004 PCB + +A somehow more useful keymap, allowing one to move across virtual desktops on Windows, etc. + +It also has a 'Super Alt-F4' key for Windows that, when tapped does Alt-F4, unless two consecutive taps are less than 300ms apart, in which case the second tap becomes Enter. This allows you to close all apps doing taps, and then when the System shutdown window arrives you do a second quick tap and it will type enter, thus shutting down the computer. + +## Build + +To build the keymap, simply run `make xd004:system_and_media`. diff --git a/keyboards/xd004/readme.md b/keyboards/xd004/readme.md new file mode 100644 index 00000000000..8b32c6a48c6 --- /dev/null +++ b/keyboards/xd004/readme.md @@ -0,0 +1,16 @@ +XD004 +== + +4-keys board + +![Top View of a XD004 board](https://ae01.alicdn.com/kf/HTB1_G9IX21H3KVjSZFHq6zKppXa0/xd004-xiudi-4-Custom-Mechanical-Keyboard-4-keys-switch-leds-PCB-programmed-hot-swappable-macro-key.jpg) + +Keyboard Maintainer: QMK Community +Hardware Supported: XD004 PCB v1.0 +Hardware Availability: [KPRepublic](https://kprepublic.com/products/xd004-xiudi-4-custom-mechanical-keyboard-4-keys-switch-leds-pcb-programmed-hot-swappable-macro-key-silver-case-micro-port) + +To build with a default keymap (not useful at all, have a look at other keymaps): + +```make xd004/v1:default``` + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/xd004/v1/config.h b/keyboards/xd004/v1/config.h new file mode 100644 index 00000000000..a141137e98b --- /dev/null +++ b/keyboards/xd004/v1/config.h @@ -0,0 +1,80 @@ +/* +Copyright 2019 Sidney Bovet + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* +Note: the following configuration uses 98% of the flash memory, be +careful if you enable anything else. Also have a look at rules.mk +where some things are disabled to save space as well. +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCDCD +#define PRODUCT_ID 0x0404 +#define DEVICE_VER 0x0001 +// Note: unsure about manufacturer +#define MANUFACTURER XIUDI +#define PRODUCT XD004 v1 +#define DESCRIPTION XD004 v1 Keyboard PCB + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * On this board we have direct connection: no diodes. + */ +#define DIRECT_PINS \ + { \ + { D3, D0, C4, B4 } \ + } +#define UNUSED_PINS + +/* Backlight Setup */ +// Looks like each backlight LED is connected to a single output, D5 is the one furtherst away from USB port +#define BACKLIGHT_PIN D5 +#define BACKLIGHT_LEVELS 6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* RGB Underglow +This will not be used, as RGBLIGHT_ENABLE is set to 'no' in rules.mk +We do not have enough space in the flash for this at the moment, maybe +further optimizations can be done on that side. +*/ +#define RGB_DI_PIN C6 +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLED_NUM 2 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* disable action features */ +// #define NO_ACTION_ONESHOT // 462 bytes <- this needs to be un-commented out if Link Time Optimization is disabled, otherwise file is too large +// The two below are implicit since we use LINK_TIME_OPTIMIZATION_ENABLE (in rules.mk) +// #define NO_ACTION_MACRO +// #define NO_ACTION_FUNCTION \ No newline at end of file diff --git a/keyboards/xd004/v1/rules.mk b/keyboards/xd004/v1/rules.mk new file mode 100644 index 00000000000..ad2d732d438 --- /dev/null +++ b/keyboards/xd004/v1/rules.mk @@ -0,0 +1,70 @@ +# MCU name +MCU = atmega16u2 + + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# LUFA specific +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 2048 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 +BOOTLOADER = atmel-dfu + + +# Build Options +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Saves about 5% of space: +LINK_TIME_OPTIMIZATION_ENABLE = yes + +#LAYOUTS = ortho_1x4 diff --git a/keyboards/xd004/xd004.c b/keyboards/xd004/xd004.c new file mode 100644 index 00000000000..37a1dca1440 --- /dev/null +++ b/keyboards/xd004/xd004.c @@ -0,0 +1,7 @@ +#include "xd004.h" + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/xd004/xd004.h b/keyboards/xd004/xd004.h new file mode 100644 index 00000000000..a53ad537f78 --- /dev/null +++ b/keyboards/xd004/xd004.h @@ -0,0 +1,15 @@ +#pragma once + +#include "quantum.h" +//#include "led.h" + +/* XD60 Keymap Definition Macro */ +/* + +--------------------------------+ + | K0 K1 K2 K3 [----- USB + +--------------------------------+ +*/ +#define LAYOUT_all(K00, K01, K02, K03) \ + { \ + { K00, K01, K02, K03 } \ + } diff --git a/keyboards/xd60/config.h b/keyboards/xd60/config.h deleted file mode 100644 index 4bbaec882d4..00000000000 --- a/keyboards/xd60/config.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER XIUDI -#define PRODUCT XD60v2 -#define DESCRIPTION XD60 v2 Keyboard PCB by XIUDI - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } -#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } -#define UNUSED_PINS - -/* Backlight Setup */ -#define BACKLIGHT_PIN F5 -#define BACKLIGHT_LEVELS 6 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* RGB Underglow - * F6 PIN for XD60v2 that has pre-soldered WS2812 LEDs - */ -#define RGB_DI_PIN F6 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 6 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#endif diff --git a/keyboards/xd60/keymaps/crd_ansi/README.md b/keyboards/xd60/keymaps/crd_ansi/README.md new file mode 100644 index 00000000000..80e45502494 --- /dev/null +++ b/keyboards/xd60/keymaps/crd_ansi/README.md @@ -0,0 +1,52 @@ +# ANSI Layout + +This is the standard ANSI keymap that I use on all of my 60% boards. This keymap +includes a single function layer available by holding the designated key on the +bottom row. + +I don't ever use Caps Lock, so that keycode is not mapped anywhere. In place of +the usual Caps Lock key, I have the following bnehaviour encoded: Escape when tapped +and Control when held. + +I also have the bottom right mod cluster mapped to navigational direction keys when tapped. +Shift = Up, Alt = Down, Ctrl = Right, Fn = Left. When held, these keys send the usual modifier +signals. + +``` +/* Base layer + * ,-----------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Esc/Ctrl| A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | ? | Shift | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Alt | Cmd | Space | Cmd | Fn | Alt | Ctrl | + * `-----------------------------------------------------------------------------------------' + */ +``` + +While holding the function key, you have access to the following layout. Any key +not indicated is considered "transparent" and sends the signal indicated in the +layer below. This function later gets you dedicated access to Escape and Delete +keys, function keys on numbers, WASD directions, other navigation, multimedia +controls, RGB (underglow) controls, and firmware reset (DFU mode). + +``` +/* Fn layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | + * |-----------------------------------------------------------------------------------------+ + * | | Home| Up | End | | | | | Mute| | | Pg+ | Pg- | Reset | + * |-----------------------------------------------------------------------------------------+ + * | | Left| Down|Right| | | |Brt- |Vol- |Vol+ |Brt+ | | RGB Toggle | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | |R(Bt-)|R(Bt+)|R(Rot)| | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + +``` \ No newline at end of file diff --git a/keyboards/xd60/keymaps/crd_ansi/keymap.c b/keyboards/xd60/keymaps/crd_ansi/keymap.c new file mode 100644 index 00000000000..6964ca3158b --- /dev/null +++ b/keyboards/xd60/keymaps/crd_ansi/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL // Function Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_FNLT LT(_FL, KC_LEFT) +#define KC_RADN RALT_T(KC_DOWN) +#define KC_RCRT RCTL_T(KC_RIGHT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_ansi( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_FNLT, KC_RADN, KC_RCRT + ), + [_FL] = LAYOUT_60_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, RESET, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, RGB_MOD, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/xd60/keymaps/default/keymap.c b/keyboards/xd60/keymaps/default/keymap.c index f8b44dc0a73..9233f99ba9f 100644 --- a/keyboards/xd60/keymaps/default/keymap.c +++ b/keyboards/xd60/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -9,7 +8,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT), // 1: Function Layer LAYOUT_all( @@ -17,29 +16,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_WH_U, KC_UP, KC_WH_D, KC_BSPC,KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \ KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP,KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_PGDN, KC_RSFT, KC_PGUP, KC_INS, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_HOME, KC_PGDOWN,KC_END), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, MO(1), KC_HOME, KC_PGDOWN,KC_END), }; -// Custom Actions -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay -}; - -// Macros -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { register_code(KC_RSFT); } - else { unregister_code(KC_RSFT); } - break; - } - - return MACRO_NONE; -}; - // Loop void matrix_scan_user(void) { // Empty diff --git a/keyboards/xd60/keymaps/iso/keymap.c b/keyboards/xd60/keymaps/iso/keymap.c index 2ca2ea807b0..bb4f8eff849 100644 --- a/keyboards/xd60/keymaps/iso/keymap.c +++ b/keyboards/xd60/keymaps/iso/keymap.c @@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NO, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,KC_DEL, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT), // 1: Function Layer [_FL] = LAYOUT_all( @@ -20,29 +20,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_VOLD, KC_MUTE, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_TOGG, BL_DEC, BL_INC, KC_NO, \ KC_NO, KC_MPLY, KC_MSTP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ENT, \ KC_LSFT, RGB_TOG, RGB_MOD, KC_CUT, KC_COPY,KC_PASTE,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_HOME, KC_PGUP, KC_END, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_NO, KC_PGDOWN, KC_NO), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, MO(1), KC_NO, KC_PGDOWN, KC_NO), }; -// Custom Actions -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay -}; - -// Macros -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { register_code(KC_RSFT); } - else { unregister_code(KC_RSFT); } - break; - } - - return MACRO_NONE; -}; - // Loop void matrix_scan_user(void) { // Empty diff --git a/keyboards/xd60/keymaps/krusli/keymap.c b/keyboards/xd60/keymaps/krusli/keymap.c index 6a460cd34ab..b34b4dfbcf6 100644 --- a/keyboards/xd60/keymaps/krusli/keymap.c +++ b/keyboards/xd60/keymaps/krusli/keymap.c @@ -1,8 +1,6 @@ #include QMK_KEYBOARD_H #include "action_layer.h" -#define _______ KC_TRNS - #define _BASE 0 #define _FN 1 diff --git a/keyboards/xd60/keymaps/rooski/keymap.c b/keyboards/xd60/keymaps/rooski/keymap.c index bea96a30d99..624c118bf38 100644 --- a/keyboards/xd60/keymaps/rooski/keymap.c +++ b/keyboards/xd60/keymaps/rooski/keymap.c @@ -8,9 +8,6 @@ // Define tapping term #define TAPPING_TERM 150 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO // Layer definitions~ #define _BL 0 #define _FL 1 @@ -79,4 +76,4 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // Loop void matrix_scan_user(void) { // Empty -}; \ No newline at end of file +}; diff --git a/keyboards/xd60/keymaps/split_bksp_arrows/keymap.c b/keyboards/xd60/keymaps/split_bksp_arrows/keymap.c index f0eaa97cb0b..f95a4e9e780 100644 --- a/keyboards/xd60/keymaps/split_bksp_arrows/keymap.c +++ b/keyboards/xd60/keymaps/split_bksp_arrows/keymap.c @@ -38,20 +38,6 @@ const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_MOMENTARY(1), // to Function Layer }; -// Macros -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { register_code(KC_RSFT); } - else { unregister_code(KC_RSFT); } - break; - } - - return MACRO_NONE; -}; - // Loop void matrix_scan_user(void) { // Empty diff --git a/keyboards/xd60/keymaps/styr/keymap.c b/keyboards/xd60/keymaps/styr/keymap.c new file mode 100644 index 00000000000..2fbfe2563a6 --- /dev/null +++ b/keyboards/xd60/keymaps/styr/keymap.c @@ -0,0 +1,56 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 +#define _LL 2 + +enum custom_keycodes { + MACRO_STRING +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // 0: Base Layer + [_BL] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + MO(_LL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, MO(_FL), KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT), + + // 1: Function Layer + [_FL] = LAYOUT_all( + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, \ + XXXXXXX, RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, RGB_HUD, XXXXXXX, RGB_VAI, RGB_VAD, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, \ + XXXXXXX, XXXXXXX, XXXXXXX, MACRO_STRING, XXXXXXX, F(0), KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT), + + [_LL] = LAYOUT_all( + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, \ + XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC__MUTE, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, KC_MPLY, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, F(0), KC_MRWD, KC_VOLD, KC_MFFD), + + +}; + +// Macros +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MACRO_STRING: + if(record->event.pressed){ + SEND_STRING("My Custom String"); + } + return false; + break; + default: + return true; + } +} + +// Loop +void matrix_scan_user(void) { + // Empty +}; diff --git a/keyboards/xd60/keymaps/styr/readme.md b/keyboards/xd60/keymaps/styr/readme.md new file mode 100644 index 00000000000..8d9edf7c48c --- /dev/null +++ b/keyboards/xd60/keymaps/styr/readme.md @@ -0,0 +1,7 @@ +# Keyboard Layout by Styr + +## Additional Notes +Default Keymap for XD60 as indicated on the original sale page. + +## Build +To build the default keymap, simply run `make xd60/rev3:styr`. diff --git a/keyboards/xd60/readme.md b/keyboards/xd60/readme.md index 19c22dac642..b9862428c77 100644 --- a/keyboards/xd60/readme.md +++ b/keyboards/xd60/readme.md @@ -6,11 +6,16 @@ Compact 60% with arrows. ![Top View of a pair of XD60 Keyboard](https://i.imgur.com/3Jq2743.jpg) Keyboard Maintainer: QMK Community -Hardware Supported: XD60 PCB +Hardware Supported: XD60 PCB rev2 & rev3 Hardware Availability: https://www.massdrop.com/buy/xd60-xd64-custom-mechanical-keyboard-kit?mode=guest_open -Make example for this keyboard (after setting up your build environment): +With the implementation of Rev3 you need to specify the Rev you want to build. +To build for a Rev2 with a default keymap: - make xd60:default +```make xd60/rev2:default``` -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +To build for a Rev3 with a default keymap: + +```make xd60/rev3:default``` + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/xd60/rev2/config.h b/keyboards/xd60/rev2/config.h new file mode 100644 index 00000000000..5f23f6eac31 --- /dev/null +++ b/keyboards/xd60/rev2/config.h @@ -0,0 +1,74 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER XIUDI +#define PRODUCT XD60v2 +#define DESCRIPTION XD60 v2 Keyboard PCB by XIUDI + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* Backlight Setup */ +#define BACKLIGHT_PIN F5 +#define BACKLIGHT_LEVELS 6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* RGB Underglow + * F6 PIN for XD60v2 that has pre-soldered WS2812 LEDs + */ +#define RGB_DI_PIN F6 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#endif diff --git a/keyboards/xd60/rev2/rules.mk b/keyboards/xd60/rev2/rules.mk new file mode 100644 index 00000000000..42f9842af12 --- /dev/null +++ b/keyboards/xd60/rev2/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# LUFA specific +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = 60_ansi diff --git a/keyboards/xd60/rev3/config.h b/keyboards/xd60/rev3/config.h new file mode 100644 index 00000000000..861755e45c1 --- /dev/null +++ b/keyboards/xd60/rev3/config.h @@ -0,0 +1,71 @@ +/* +Copyright 2019 Rodrigo Feijao + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6363 +#define DEVICE_VER 0x0001 +#define MANUFACTURER XIUDI +#define PRODUCT XD60rev3 +#define DESCRIPTION XD60 rev3 Keyboard PCB by XIUDI + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* Backlight Setup */ +#define BACKLIGHT_PIN F5 +#define BACKLIGHT_LEVELS 6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* RGB Underglow + * F6 PIN for XD60v3 that has pre-soldered LEDs + */ +#define RGB_DI_PIN F6 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/xd60/rev3/rules.mk b/keyboards/xd60/rev3/rules.mk new file mode 100644 index 00000000000..36f259e0548 --- /dev/null +++ b/keyboards/xd60/rev3/rules.mk @@ -0,0 +1,66 @@ +# MCU name +MCU = atmega32u4 + + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# LUFA specific +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = atmel-dfu + + +# Build Options +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = 60_ansi diff --git a/keyboards/xd60/rules.mk b/keyboards/xd60/rules.mk deleted file mode 100644 index 8a60252dcf9..00000000000 --- a/keyboards/xd60/rules.mk +++ /dev/null @@ -1,67 +0,0 @@ -# MCU name -# MCU = at90usb1287 -MCU = atmega32u4 - - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# LUFA specific -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -LAYOUTS = 60_ansi \ No newline at end of file diff --git a/keyboards/xd75/config.h b/keyboards/xd75/config.h index af7573cb6a3..7f8b71c45c9 100644 --- a/keyboards/xd75/config.h +++ b/keyboards/xd75/config.h @@ -46,15 +46,14 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3, B0 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW - + #define BACKLIGHT_PIN F5 #define BACKLIGHT_LEVELS 6 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -99,11 +98,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/keyboards/xd75/keymaps/adi/config.h b/keyboards/xd75/keymaps/adi/config.h index 244c75c77c4..08bed9ccb9a 100644 --- a/keyboards/xd75/keymaps/adi/config.h +++ b/keyboards/xd75/keymaps/adi/config.h @@ -14,12 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // Disable backlight #undef BACKLIGHT_ENABLE - -#endif diff --git a/keyboards/xd75/keymaps/adi/keymap.c b/keyboards/xd75/keymaps/adi/keymap.c index d96a215073d..4f9e414c1c0 100644 --- a/keyboards/xd75/keymaps/adi/keymap.c +++ b/keyboards/xd75/keymaps/adi/keymap.c @@ -13,12 +13,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H // Fillers to make layering more clear -#define _______ KC_TRNS #define ___T___ KC_TRNS -#define XXXXXXX KC_NO // Layer shorthand #define _QW 0 @@ -106,10 +104,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/xd75/keymaps/adi/rules.mk b/keyboards/xd75/keymaps/adi/rules.mk index d4e08cfb26b..a0c4fc96784 100644 --- a/keyboards/xd75/keymaps/adi/rules.mk +++ b/keyboards/xd75/keymaps/adi/rules.mk @@ -13,6 +13,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +BACKLIGHT_ENABLE = no diff --git a/keyboards/xd75/keymaps/atomic_style/config.h b/keyboards/xd75/keymaps/atomic_style/config.h index f52a97bbc86..a72596783dd 100644 --- a/keyboards/xd75/keymaps/atomic_style/config.h +++ b/keyboards/xd75/keymaps/atomic_style/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/atomic_style/keymap.c b/keyboards/xd75/keymaps/atomic_style/keymap.c index 98673229938..bdbbc4af336 100644 --- a/keyboards/xd75/keymaps/atomic_style/keymap.c +++ b/keyboards/xd75/keymaps/atomic_style/keymap.c @@ -13,12 +13,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H // Fillers to make layering more clear -#define _______ KC_TRNS #define ___T___ KC_TRNS -#define XXXXXXX KC_NO // Layer shorthand #define _QW 0 @@ -163,10 +161,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/xd75/keymaps/atomic_style/rules.mk b/keyboards/xd75/keymaps/atomic_style/rules.mk index d4e08cfb26b..52a8f38d45f 100644 --- a/keyboards/xd75/keymaps/atomic_style/rules.mk +++ b/keyboards/xd75/keymaps/atomic_style/rules.mk @@ -13,6 +13,3 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/bbaserdem/config.h b/keyboards/xd75/keymaps/bbaserdem/config.h index 28d32e56282..271f48d0011 100644 --- a/keyboards/xd75/keymaps/bbaserdem/config.h +++ b/keyboards/xd75/keymaps/bbaserdem/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/xd75/keymaps/bbaserdem/keymap.c b/keyboards/xd75/keymaps/bbaserdem/keymap.c index 68071d018e2..6f8576b09b4 100644 --- a/keyboards/xd75/keymaps/bbaserdem/keymap.c +++ b/keyboards/xd75/keymaps/bbaserdem/keymap.c @@ -1,4 +1,4 @@ -#include "xd75.h" +#include QMK_KEYBOARD_H #include "bbaserdem.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/xd75/keymaps/bbaserdem/rules.mk b/keyboards/xd75/keymaps/bbaserdem/rules.mk index 4839c644f8b..3e501cd00ee 100644 --- a/keyboards/xd75/keymaps/bbaserdem/rules.mk +++ b/keyboards/xd75/keymaps/bbaserdem/rules.mk @@ -5,6 +5,3 @@ RGBLIGHT_ENABLE = no # LED strips TAP_DANCE_ENABLE = no # Use multi-tap features AUDIO_ENABLE = no # Audio stuff -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/billypython/config.h b/keyboards/xd75/keymaps/billypython/config.h new file mode 100644 index 00000000000..36e6b678517 --- /dev/null +++ b/keyboards/xd75/keymaps/billypython/config.h @@ -0,0 +1,14 @@ +#pragma once + +#define FORCE_NKRO + +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 diff --git a/keyboards/xd75/keymaps/billypython/keymap.c b/keyboards/xd75/keymaps/billypython/keymap.c new file mode 100644 index 00000000000..8a06074ca5f --- /dev/null +++ b/keyboards/xd75/keymaps/billypython/keymap.c @@ -0,0 +1,119 @@ +#include QMK_KEYBOARD_H + +#define TOP LCTL(KC_HOME) +#define BOTTOM LCTL(KC_END) + +#define FN MO(L_FN) +#define FN_CAPS LT(L_FN, KC_CAPS) +#define FN_FNLK TT(L_FN) + +#define COMMA UC(0x002C) +#define L_PAREN UC(0x0028) +#define R_PAREN UC(0x0029) +#define EQUALS UC(0x003D) +#define TIMES UC(0x00D7) +#define DIVIDE UC(0x00F7) +#define MINUS UC(0x2212) + +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_LNX); +} + +enum layers { + L_BASE, + L_FN, + L_NUMPAD, +}; + +enum custom_keycodes { + CLEAR = SAFE_RANGE, + NUMPAD, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case CLEAR: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + } + return false; + + case NUMPAD: + if (record->event.pressed) { + layer_invert(L_NUMPAD); + bool num_lock = host_keyboard_leds() & 1<. */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once +// place overrides here #ifndef NO_DEBUG #define NO_DEBUG #endif @@ -24,8 +24,6 @@ #define NO_PRINT #endif -#include "../../config.h" - #define LEADER_TIMEOUT 300 #define BACKLIGHT_BREATHING @@ -34,11 +32,3 @@ #define randadd 53 #define randmul 181 #define randmod 167 - -/* Filler to make layering a bit clearer * - * borrowed from basic keymap */ - -#define _______ KC_TRNS -#define _____ KC_NO - -#endif diff --git a/keyboards/xd75/keymaps/cbbrowne/keymap.c b/keyboards/xd75/keymaps/cbbrowne/keymap.c index ec98b6d5a62..6c356ac8034 100644 --- a/keyboards/xd75/keymaps/cbbrowne/keymap.c +++ b/keyboards/xd75/keymaps/cbbrowne/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME +/* Copyright 2017 Christopher B Browne * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,12 +13,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H /* Fillers to make layering more clear */ -#define _______ KC_TRNS #define ___T___ KC_TRNS -#define XXXXXXX KC_NO /* Layer shorthand */ @@ -64,12 +62,7 @@ enum macro_id { #define FUNCTION MO(_FUNCTION) #define MRAISE MO(_RAISE) #define MLOWER MO(_LOWER) -#define ALTBSP ALT_T(KC_BSPC) - -/* More modifiers for QCENT2... */ -#define PALT MT(KC_RALT, KC_P) -#define SCTL MT(KC_RCTL, KC_SCLN) -#define SSHF MT(KC_RSFT, KC_SLSH) +#define ALTPLUS ALT_T(KC_PLUS) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -86,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | BRITE | LCTRL | LALT | LGUI | RAISE | XXXXXX . SPACE | LOWER | RGUI | RALT | RCTRL | FN | LEFT | DOWN | RIGHT | * '--------------------------------------------------------------------------------------------------------------------------------------' */ - + /* layout for centred keypad + qwerty... |ESC| 1 | 2 | 3 | 4 | 5 | ? | ? | ? | ? | 6 | 7 | 8 | 9 | 0 | @@ -96,40 +89,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |ALT|LED| | | | | | | | | | | | | | - - keys needing to be assigned: -11 - KC_TAB - tab -52 - ROT_LED - rotate LED +51 - KC_TAB - tab + - ROT_LED - rotate LED 15 - KC_LALT - Left ALT - - KC_LGUI - this is the windows/command key, which I think I do not use... - - M_LOWER - switch to LOWER layer - - KC_SPC - space - - M_UPPER - switch to UPPER layer, maybe unneeded for 15x5 - - KC_LEFT - famous arrows - - KC_DOWN - famous arrows - - KC_UP - famous arrows - - KC_RIGHT - famous arrows - - KC_ENT - enter +53,55 - M_RAISE - switch to RAISE layer +5b - M_LOWER - switch to LOWER layer +56,59,5a - KC_SPC - space +5c - KC_LEFT - famous arrows +5d - KC_DOWN - famous arrows +5e - KC_UP - famous arrows +5f - KC_RIGHT - famous arrows +3f - KC_ENT - enter - KC_GRV - leftwards quote - - KC_QUOT - rightwards quote - - KC_BSPC - backspace - - KC_ESC +4f - KC_QUOT - rightwards quote +1f - KC_BSPC - backspace +11 - KC_ESC +19 - KC_GRV - ` - raised +19 - KC_TILD - ~ - lowered -Missing still... - KC_LBRC and KC_LCBR - KC_RBRC and KC_RCBR + */ - */ +[_QWERTY] = LAYOUT_ortho_5x15( /* QWERTY, with keypad in the centre */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC , + KC_LALT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_7, KC_8, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, ALTPLUS , + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LBRC, KC_RBRC,KC_MINS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTLENTER , + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGUP, KC_EQL, KC_BSLS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SHIFTQUOTE , + KC_TAB, FUNCTION, MRAISE, FUNCTION, MRAISE, KC_SPC,KC_PGDN, KC_MINS, KC_SPC, KC_SPC, MLOWER, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), - [_QWERTY] = { /* QWERTY, with keypad in the centre */ - { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, KC_MINS, RESET, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, - { KC_LALT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_7, KC_8, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PLUS }, - { KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_4, KC_5, KC_MINS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTLENTER }, - { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_1, KC_2, KC_BSLS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SHIFTQUOTE }, - { KC_TAB, FUNCTION, MRAISE, FUNCTION, MRAISE, KC_SPC, KC_0, KC_MINS, KC_SPC, KC_SPC, MLOWER, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT } - }, - /* LOWER * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . | @@ -144,13 +132,13 @@ Missing still... * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_LOWER] = { /* LOWERED */ - { ___T___, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 }, - { ___T___, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_INS }, - { ___T___, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______ }, - { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, ___T___, ___T___, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - }, +[_LOWER] = LAYOUT_ortho_5x15( /* LOWERED */ + ___T___, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_TILD, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 , + ___T___, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_INS , + ___T___, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE , + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, ___T___, ___T___, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), /* RAISED * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. @@ -166,13 +154,13 @@ Missing still... * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_RAISE] = { /* RAISED */ - { KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___ }, - { KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, _______, _______, KC_7, KC_8, KC_9, KC_0, _______, _______, KC_INS }, - { KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, ___T___, ___T___ }, - { KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, ___T___, ___T___, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - }, +[_RAISE] = LAYOUT_ortho_5x15 ( /* RAISED */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, MVERSION, _______, KC_GRV, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___ , + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, USERNAME, _______, KC_7, KC_8, KC_LCBR, KC_RCBR, _______, _______, KC_INS , + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, RANDDIG, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, ___T___, ___T___ , + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RANDALP, _______, _______, _______, _______, ___T___, ___T___, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* FUNCTION * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. @@ -180,25 +168,21 @@ Missing still... * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| * | SCR LK | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | PAUSE | PR SCR | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| - * | CAP LK | MS BT5 | MS BT4 | MS BT3 | MS BT2 | SLOW M | FAST M | NEXT | VOL+ | VOL- | PLAY | | XXXXXX . | WHEEL+ | + * | CAP LK | MS BT5 | MS BT4 | MS BT3 | MS BT2 | SLOW M | FAST M | NEXT | VOL+ | VOL- | PLAY | | XXXXXX | | WHEEL+ | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| - * | RGB TG | RGB MD | RGB HI | RGB HD | RGB SI | RGB SD | RGB VI | RGB VD | BL TOG | BL INC | BL DEC | XXXXXX . | MOUS Un | WHEEL- | + * | RGB TG | RGB MD | RGB HI | RGB HD | RGB SI | RGB SD | RGB VI | RGB VD | BL TOG | BL INC | BL DEC | XXXXXX | | MOUS U | WHEEL- | * |--------+--------+--------+--------+--------+-- 2u -----------+--------+--------+--------+--------+-----------------+--------+--------| * | RESET | | QWERTY | COLEMK | DVORAK | XXXXXX . MS BT1 | | | | | | MOUS L | MOUS D | MOUS R | * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_FUNCTION] = { /* FUNCTION */ - { KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ }, - { KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR }, - { KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, ___T___, ___T___, KC_WH_U }, - { RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, ___T___, ___T___, KC_MS_U, KC_WH_D }, - { RESET , _______, DF(_QWERTY), DF(_QWERTY), DF(_QWERTY), KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, - }, -}; - -const uint16_t PROGMEM fn_actions[] = { - +[_FUNCTION] = LAYOUT_ortho_5x15( /* FUNCTION */ + KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, RESET, + KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR , + KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, ___T___, ___T___, KC_WH_U , + RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, ___T___, ___T___, KC_MS_U, KC_WH_D , + RESET , _______, DF(_QWERTY), DF(_QWERTY), DF(_QWERTY), KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R + ) }; /* This bit of logic seeds a wee linear congruential random number generator */ @@ -229,8 +213,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) break; case M_VERSION: if (record->event.pressed) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@"); - // SEND_STRING(QMK_VERSION "@" QMK_BUILDDATE); + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP); } break; case M_RANDDIGIT: @@ -295,3 +278,33 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; + +void matrix_init_user(void) { + rgblight_enable(); + rgblight_mode(1); + rgblight_sethsv(325,255,255); +} + +uint32_t layer_state_set_user(uint32_t state) { + switch(biton32(state)) { + case _QWERTY: + rgblight_sethsv_white(); + break; + case _LOWER: + rgblight_sethsv_blue(); + break; + case _RAISE: + rgblight_sethsv_green(); + break; + case _ADJUST: + rgblight_sethsv_orange(); + break; + case _FUNCTION: + rgblight_sethsv_red(); + break; + default: + rgblight_sethsv(325,255,255); + break; + } + return state; +} diff --git a/keyboards/xd75/keymaps/cbbrowne/rules.mk b/keyboards/xd75/keymaps/cbbrowne/rules.mk new file mode 100644 index 00000000000..eb2f8706348 --- /dev/null +++ b/keyboards/xd75/keymaps/cbbrowne/rules.mk @@ -0,0 +1,20 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +API_SYSEX_ENABLE = no # Enable SYSEX API (+5390) + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/xd75/keymaps/colinta/config.h b/keyboards/xd75/keymaps/colinta/config.h index 3b39bee81c9..354c9c91860 100644 --- a/keyboards/xd75/keymaps/colinta/config.h +++ b/keyboards/xd75/keymaps/colinta/config.h @@ -14,15 +14,12 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here // QMK customization: // - after 1.5s, turn off one-shot keys #define ONESHOT_TIMEOUT 1500 // - TT(layer) only needs one press #define TAPPING_TOGGLE 1 - -#endif diff --git a/keyboards/xd75/keymaps/colinta/keymap.c b/keyboards/xd75/keymaps/colinta/keymap.c index a50a02c3604..257caad339f 100644 --- a/keyboards/xd75/keymaps/colinta/keymap.c +++ b/keyboards/xd75/keymaps/colinta/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H #ifdef IS_COLINTA #include "secrets.h" @@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--/RRND----/MUTE----/FFWD-------------------------------------------------------------------------------------------------------------' */ - [LAYER_COLEMAK] = KEYMAP( + [LAYER_COLEMAK] = LAYOUT( KC_GRV, TH_F1, TH_F2, TH_F3, TH_F4, TH_F5, MM_0, MM_1, KC_DEL, TH_F6, TH_F7, TH_F8, TH_F9, TH_F10, KC_MINS, KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, MM_2, GOTO_FN, KC_BSPC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_EQL, OSCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_LBRC, KC_RBRC, KC_ENT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, @@ -113,7 +113,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [LAYER_RECORD] = KEYMAP( + [LAYER_RECORD] = LAYOUT( _____, _____, _____, _____, _____, _____, DYN_REC_STOP, DYN_REC_STOP, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, DYN_REC_STOP, DYN_REC_STOP, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, @@ -135,7 +135,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [LAYER_QWERTY] = KEYMAP( + [LAYER_QWERTY] = LAYOUT( _____, _____, _____, _____, _____, _____, MM_0, MM_1, _____, _____, _____, _____, _____, _____, _____, _____, KC_Q, KC_W, KC_E, KC_R, KC_T, MM_2, GOTO_FN, _____, KC_Y, KC_U, KC_I, KC_O, KC_P, _____, MOD_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, _____, _____, _____, KC_H, KC_J, KC_K, KC_L, KC_SCLN, _____, @@ -157,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [LAYER_FN] = KEYMAP( + [LAYER_FN] = LAYOUT( GOTO_CM, GOTO_QW, KC_NO, KC_NO, KC_NO, KC_NO, DYN_REC_START1, DYN_REC_START2, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, diff --git a/keyboards/xd75/keymaps/davidrambo/config.h b/keyboards/xd75/keymaps/davidrambo/config.h index f219147034d..6e6349c7cf6 100644 --- a/keyboards/xd75/keymaps/davidrambo/config.h +++ b/keyboards/xd75/keymaps/davidrambo/config.h @@ -14,12 +14,9 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here #define TAPPING_TERM 200 #define PERMISSIVE_HOLD - -#endif diff --git a/keyboards/xd75/keymaps/davidrambo/keymap.c b/keyboards/xd75/keymaps/davidrambo/keymap.c index 5d09dfa27cc..7be197a81c7 100644 --- a/keyboards/xd75/keymaps/davidrambo/keymap.c +++ b/keyboards/xd75/keymaps/davidrambo/keymap.c @@ -1,53 +1,53 @@ -#include "xd75.h" +#include QMK_KEYBOARD_H //aliases for clarity in layering -#define _______ KC_TRNS #define A_BSPC LALT(KC_BSPC) // delete whole word in Mac -// #define C_BSPS LCTL(KC_BSPC) // delete whole word in PC; currently not in use +#define C_BSPC LCTL(KC_BSPC) // delete whole word in PC #define A_LEFT LALT(KC_LEFT) #define A_RGHT LALT(KC_RGHT) #define C_RGHT LCTL(KC_RGHT) #define C_LEFT LCTL(KC_LEFT) #define SftEnt SFT_T(KC_ENT) -#define GBSPC LGUI_T(KC_BSPC) -#define CBSPC LCTL_T(KC_BSPC) +#define BS_GUI LGUI_T(KC_BSPC) +#define BS_CTL LCTL_T(KC_BSPC) -//internet browser tab shortcuts and window swapping for Mac and Win +// internet browser tab shortcuts and window/application swapping for Mac and Win #define GSL LGUI(S(KC_LEFT)) // back one tab in Safari #define GSR LGUI(S(KC_RGHT)) // forward one tab in Safari #define CTLPGDN LCTL(KC_PGDN) // back one tab on Windows #define CTLPGUP LCTL(KC_PGUP) // forward one tab on Windows -#define G_TAB LGUI(KC_TAB) // MAC: switch applications -#define G_GRV LGUI(KC_GRV) // MAC: switch between windows within an application +#define G_TAB LGUI(KC_TAB) // Mac: switch applications +#define G_GRV LGUI(KC_GRV) // Mac: switch between windows within an application #define A_TAB LALT(KC_TAB) #define C_TAB LCTL(KC_TAB) -// -#define NAV LT(3, KC_TAB) -#define NAVPC LT(4, KC_TAB) +// navigation layers for both Mac OS X and Windows +#define NAV LT(4, KC_TAB) +#define NAVPC LT(5, KC_TAB) // Layer shorthand #define _COLEMAK 0 #define _PC 1 -#define _SYMBOL 2 //Function keys, numbers, symbols, Backlighting -#define _NAV 3 //Navigation Layer on Mac -#define _NAVPC 4 //Navigation Layer on Win +#define _GAME 2 // Gaming layer +#define _SYMBOL 3 // Function keys, numbers, symbols, Backlighting +#define _NAV 4 // Navigation Layer on Mac +#define _NAVPC 5 // Navigation Layer on Win -//tapdance declarations +// tapdance declarations enum { SFT_LCK }; -//alias for tapdance +// alias for tapdance #define SftLck TD(SFT_LCK) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* COLEMAK * .--------------------------------------------------------------------------------------------------------------------------------------. - * | `~ | 1 | 2 | 3 | 4 | 5 | - | SWITCH | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * | `~ | 1 | 2 | 3 | 4 | 5 | -_ | PC | =+ | 6 | 7 | 8 | 9 | 0 | BACKSP | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| - * | ESC/`~ | Q | W | F | P | G | [ | \ | ] | J | L | U | Y | ; | BACKSP | + * | ESC/`~ | Q | W | F | P | G | [ | \| | ] | J | L | U | Y | ; | BACKSP | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| * | NAVTAB | A | S | D | F | G | PgUp |PlayPaus| ENTER | H | N | E | I | O | ' | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| @@ -57,24 +57,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_COLEMAK] = { /* COLEMAK */ - { KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, TG(1) , KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, - { KC_GESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LBRC, KC_BSLS, KC_RBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, - { NAV , KC_A, KC_R, KC_S, KC_T, KC_D, KC_PGUP, KC_ESC , KC_ENT , KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT }, - { SftLck , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGDN, KC_UP , KC_ENT , KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt }, - { KC_DEL , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, GBSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(2) , KC_RGUI, KC_RALT, KC_RCTL, BL_STEP }, - }, + [_COLEMAK] = LAYOUT_ortho_5x15( /* COLEMAK */ + KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, TG(1) , KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LBRC, KC_BSLS, KC_RBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + NAV , KC_A, KC_R, KC_S, KC_T, KC_D, KC_PGUP, KC_ESC , KC_ENT , KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + SftLck , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGDN, KC_UP , KC_ENT , KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt , + KC_DEL , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, BS_GUI, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(3) , KC_RGUI, KC_RALT, KC_RCTL, BL_STEP + ), // Windows Layer: essentially swaps Control and GUI - [_PC] = { /* WINDOWS */ - { _______, _______, _______, _______, _______, _______, _______, TG(0) , _______, _______, _______, _______, _______, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { NAVPC , _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, _______, _______, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, KC_LCTL, KC_LGUI, _______, KC_LCTL, _______, _______, _______, _______, _______, _______, KC_RCTL, KC_RALT, KC_RGUI, _______ }, - }, - + [_PC] = LAYOUT_ortho_5x15( /* WINDOWS */ + _______, _______, _______, _______, _______, _______, _______, TG(2) , _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + NAVPC , _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LCTL, KC_LGUI, _______, KC_LCTL, BS_CTL , _______, _______, _______, _______, _______, KC_RCTL, KC_RALT, KC_RGUI, _______ + ), + + [_GAME] = LAYOUT_ortho_5x15( /* Gaming Layer */ + _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_F10 , KC_F11 , KC_F12 , _______, _______, _______, _______, _______, TO(0) , + KC_ESC , KC_T , KC_Q , KC_W , KC_E , KC_R , KC_F7 , KC_F8 , KC_F9 , KC_Y , KC_U , KC_I , KC_O , KC_P , _______, + KC_TAB , KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_F4 , KC_F5 , KC_F6 , KC_H , KC_J , KC_K , KC_L , KC_SCLN, _______, + KC_LALT, KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_F1 , KC_F2 , KC_F3 , KC_N , KC_M , _______, _______, _______, KC_ENT , + _______, _______, _______, KC_G , KC_B , KC_SPC , KC_I , KC_M , _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______ + ), + /* SYMBOL * .--------------------------------------------------------------------------------------------------------------------------------------. * | F12 | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | @@ -89,30 +97,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_SYMBOL] = { /* SYMBOL */ - { _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , _______, _______, _______, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , _______}, - { KC_LBRC, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , _______, _______, _______, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_RBRC}, - { _______, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_EQL }, - { _______, KC_HOME, KC_END , BL_OFF , BL_ON , KC_F11 , _______, _______, _______, KC_F12 , KC_MINS, _______, _______, _______, _______}, - { _______, _______, _______, _______, _______, A_BSPC , _______, _______, _______, _______, _______, _______, _______, _______, _______}, - }, + [_SYMBOL] = LAYOUT_ortho_5x15( /* SYMBOL */ + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , _______, _______, _______, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , + KC_LBRC, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , _______, _______, _______, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_RBRC, + _______, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_EQL , + _______, KC_HOME, KC_END , BL_OFF , BL_ON , KC_F11 , _______, _______, _______, KC_F12 , KC_MINS, _______, _______, _______, _______, + _______, _______, _______, _______, _______, A_BSPC , _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), - [_NAV] = { /* NAVIGATION for Mac */ - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, GSL , KC_LEFT, KC_DOWN, KC_RGHT, GSR , _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, G_TAB , ABSPC , KC_HOME, KC_END , G_GRV , _______}, - { RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - }, - - [_NAVPC] = { /* NAVIGATION FOR WINDOWS: replaces Alt with Control, GUI with Alt, and browser tab shortcuts*/ - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, C_TAB , C_LEFT, KC_UP, C_RGHT , KC_DEL , _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, CTLPGUP, KC_LEFT, KC_DOWN, KC_RGHT, CTLPGDN, _______}, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, A_TAB , CBSPC , KC_HOME, KC_END , _______, _______}, - { RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - } + [_NAV] = LAYOUT_ortho_5x15( /* NAVIGATION for Mac */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, GSL , KC_LEFT, KC_DOWN, KC_RGHT, GSR , _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, G_TAB , A_BSPC , KC_HOME, KC_END , G_GRV , _______, + RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_NAVPC] = LAYOUT_ortho_5x15( /* NAVIGATION FOR WINDOWS: replaces Alt with Control, GUI with Alt, and browser tab shortcuts*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, C_TAB , C_LEFT, KC_UP, C_RGHT , KC_DEL , _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, CTLPGUP, KC_LEFT, KC_DOWN, KC_RGHT, CTLPGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, A_TAB , C_BSPC , KC_HOME, KC_END , _______, _______, + RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) }; // Shift vs capslock function. From bbaserdem's Planck keymap. diff --git a/keyboards/xd75/keymaps/davidrambo/readme.md b/keyboards/xd75/keymaps/davidrambo/readme.md index 17b928c501f..a53abc8afc8 100644 --- a/keyboards/xd75/keymaps/davidrambo/readme.md +++ b/keyboards/xd75/keymaps/davidrambo/readme.md @@ -1,4 +1,7 @@ -# A Colemak layout for XD75 with both Mac and Windows layers. -# These two layers share momentary toggle access to a "Symbol" layer, which is modeled after my Planck layout. -# Each of the base Colemak layers have their own Navigation layers for the right hand to use arrows and shortcuts for both text editing and web browsing. -# The rules.mk file overrides the XD75's "BACKLIGHT_ENABLE" with YES and also adds tap dance functionality. \ No newline at end of file +# XD75 + +This is a Colemak layout for XD75 with both Mac and Windows layers. +These two layers share momentary toggle access to a "Symbol" layer, which is modeled after my Planck layout (see planck/keymaps/davidrambo). +Each of the base Colemak layers have their own Navigation layers for the right hand to use arrows and shortcuts for both text editing and web browsing. + +The rules.mk file overrides the XD75's "BACKLIGHT_ENABLE" with YES and also adds tap dance functionality. \ No newline at end of file diff --git a/keyboards/xd75/keymaps/default/config.h b/keyboards/xd75/keymaps/default/config.h index 015377b5f8f..e6975da8a20 100644 --- a/keyboards/xd75/keymaps/default/config.h +++ b/keyboards/xd75/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/default/keymap.c b/keyboards/xd75/keymaps/default/keymap.c index 028fc270de4..0e5c7dbaaaf 100644 --- a/keyboards/xd75/keymaps/default/keymap.c +++ b/keyboards/xd75/keymaps/default/keymap.c @@ -13,12 +13,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H // Layer shorthand #define _QW 0 #define _FN 1 +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY @@ -35,13 +41,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_QW] = { /* QWERTY */ - { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, - { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT }, - { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, - { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, - { KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL }, - }, + [_QW] = LAYOUT_ortho_5x15( /* QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL + ), /* FUNCTION * .--------------------------------------------------------------------------------------------------------------------------------------. @@ -56,34 +62,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ - - [_FN] = { /* FUNCTION */ - { KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, - { KC_MSEL, KC_CALC, KC_MYCM, KC_MAIL, RGB_HUD, RGB_HUI, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS }, - { KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, RGB_SAD, RGB_SAI, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______ }, - { KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, RGB_VAD, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______ }, - { _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ }, - } -}; - -const uint16_t PROGMEM fn_actions[] = { + [_FN] = LAYOUT_ortho_5x15( /* FUNCTION */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_MSEL, KC_CALC, KC_MYCM, KC_MAIL, RGB_HUD, RGB_HUI, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, + KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, RGB_SAD, RGB_SAI, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______, + KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, RGB_VAD, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, + _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ + ) }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - break; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released } - return MACRO_NONE; -}; + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/xd75/keymaps/default/rules.mk b/keyboards/xd75/keymaps/default/rules.mk index d4e08cfb26b..52a8f38d45f 100644 --- a/keyboards/xd75/keymaps/default/rules.mk +++ b/keyboards/xd75/keymaps/default/rules.mk @@ -13,6 +13,3 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/developper_bepo/config.h b/keyboards/xd75/keymaps/developper_bepo/config.h index 78357b5bc4f..0183e024271 100644 --- a/keyboards/xd75/keymaps/developper_bepo/config.h +++ b/keyboards/xd75/keymaps/developper_bepo/config.h @@ -16,4 +16,4 @@ #pragma once -#include "../../config.h" +// place overrides here diff --git a/keyboards/xd75/keymaps/developper_bepo/README.md b/keyboards/xd75/keymaps/developper_bepo/readme.md similarity index 100% rename from keyboards/xd75/keymaps/developper_bepo/README.md rename to keyboards/xd75/keymaps/developper_bepo/readme.md diff --git a/keyboards/xd75/keymaps/dyn_macro_tap_dance/config.h b/keyboards/xd75/keymaps/dyn_macro_tap_dance/config.h index 015377b5f8f..e6975da8a20 100644 --- a/keyboards/xd75/keymaps/dyn_macro_tap_dance/config.h +++ b/keyboards/xd75/keymaps/dyn_macro_tap_dance/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/dyn_macro_tap_dance/keymap.c b/keyboards/xd75/keymaps/dyn_macro_tap_dance/keymap.c index 52cae7f715f..cf4bfb4dc5a 100644 --- a/keyboards/xd75/keymaps/dyn_macro_tap_dance/keymap.c +++ b/keyboards/xd75/keymaps/dyn_macro_tap_dance/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H enum planck_keycodes { DUMMY = SAFE_RANGE, @@ -114,10 +114,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/xd75/keymaps/dyn_macro_tap_dance/rules.mk b/keyboards/xd75/keymaps/dyn_macro_tap_dance/rules.mk index 64484d3eee5..7708eba6a18 100644 --- a/keyboards/xd75/keymaps/dyn_macro_tap_dance/rules.mk +++ b/keyboards/xd75/keymaps/dyn_macro_tap_dance/rules.mk @@ -13,8 +13,5 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - TAP_DANCE_ENABLE = yes + diff --git a/keyboards/xd75/keymaps/emilyh/config.h b/keyboards/xd75/keymaps/emilyh/config.h index f52a97bbc86..a72596783dd 100644 --- a/keyboards/xd75/keymaps/emilyh/config.h +++ b/keyboards/xd75/keymaps/emilyh/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/emilyh/keymap.c b/keyboards/xd75/keymaps/emilyh/keymap.c index 034bb55ac83..bea9863d5bc 100644 --- a/keyboards/xd75/keymaps/emilyh/keymap.c +++ b/keyboards/xd75/keymaps/emilyh/keymap.c @@ -13,13 +13,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H #include "backlight.h" // Fillers to make layering more clear -#define _______ KC_TRNS #define ___T___ KC_TRNS -#define XXXXXXX KC_NO // Layer shorthand #define _QW 0 @@ -164,10 +162,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/xd75/keymaps/emilyh/rules.mk b/keyboards/xd75/keymaps/emilyh/rules.mk index d4e08cfb26b..52a8f38d45f 100644 --- a/keyboards/xd75/keymaps/emilyh/rules.mk +++ b/keyboards/xd75/keymaps/emilyh/rules.mk @@ -13,6 +13,3 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/fabian/config.h b/keyboards/xd75/keymaps/fabian/config.h index 59de3fa55f6..a72596783dd 100644 --- a/keyboards/xd75/keymaps/fabian/config.h +++ b/keyboards/xd75/keymaps/fabian/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/fabian/keymap.c b/keyboards/xd75/keymaps/fabian/keymap.c index 3a330ca96dd..7c515626868 100644 --- a/keyboards/xd75/keymaps/fabian/keymap.c +++ b/keyboards/xd75/keymaps/fabian/keymap.c @@ -41,9 +41,6 @@ enum custom_keycodes { EXT_PLV }; -#define XXXXXXX KC_NO -#define _______ KC_TRNS - #define CTL_ESC CTL_T(KC_ESC) // Tap for Escape, hold for Control #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) #define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) diff --git a/keyboards/xd75/keymaps/fabian/rules.mk b/keyboards/xd75/keymaps/fabian/rules.mk index f1ae8d44a17..8831f2d6250 100644 --- a/keyboards/xd75/keymaps/fabian/rules.mk +++ b/keyboards/xd75/keymaps/fabian/rules.mk @@ -32,6 +32,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/french/config.h b/keyboards/xd75/keymaps/french/config.h index 015377b5f8f..e6975da8a20 100644 --- a/keyboards/xd75/keymaps/french/config.h +++ b/keyboards/xd75/keymaps/french/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/french/keymap.c b/keyboards/xd75/keymaps/french/keymap.c index a5d14674a92..547a67b6efd 100644 --- a/keyboards/xd75/keymaps/french/keymap.c +++ b/keyboards/xd75/keymaps/french/keymap.c @@ -1,5 +1,5 @@ #include "keymap_french.c" -#include "xd75.h" +#include QMK_KEYBOARD_H // Layer shorthand @@ -54,7 +54,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { RESET, FR_EMPT, FR_EMPT, FR_TRANS, FR_EMPT, FR_EMPT, FR_EMPT, FR_EMPT, FR_EMPT, FR_EMPT, FR_0, FR_DOT, FR_ENTK, FR_EMPT, BL_STEP }, }, }; - -const uint16_t PROGMEM fn_actions[] = { -}; - diff --git a/keyboards/xd75/keymaps/french/README.md b/keyboards/xd75/keymaps/french/readme.md similarity index 100% rename from keyboards/xd75/keymaps/french/README.md rename to keyboards/xd75/keymaps/french/readme.md diff --git a/keyboards/xd75/keymaps/french/rules.mk b/keyboards/xd75/keymaps/french/rules.mk index dfd79792fa5..324d9ebd059 100644 --- a/keyboards/xd75/keymaps/french/rules.mk +++ b/keyboards/xd75/keymaps/french/rules.mk @@ -15,6 +15,3 @@ RGBLIGHT_ENABLE = no -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/germanized/config.h b/keyboards/xd75/keymaps/germanized/config.h index 5b19bddb05e..65ab6a0dcba 100644 --- a/keyboards/xd75/keymaps/germanized/config.h +++ b/keyboards/xd75/keymaps/germanized/config.h @@ -14,10 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here @@ -27,10 +24,6 @@ //Tap Dancing #define TAPPING_TERM 200 -// Alt gr -#define ALGR(kc) RALT(kc) -#define DE_ALGR KC_RALT - // normal characters #define DE_Z KC_Y #define DE_Y KC_Z @@ -122,4 +115,3 @@ // Launchy #define ALT_SPC LALT(KC_SPC) -#endif diff --git a/keyboards/xd75/keymaps/germanized/keymap.c b/keyboards/xd75/keymaps/germanized/keymap.c index b7c9620c13d..bba1172eca6 100644 --- a/keyboards/xd75/keymaps/germanized/keymap.c +++ b/keyboards/xd75/keymaps/germanized/keymap.c @@ -1,6 +1,6 @@ /* Copyright 2017 Kolja Brauns */ -#include "xd75.h" +#include QMK_KEYBOARD_H #ifndef KEYMAP_GERMAN #define KEYMAP_GERMAN diff --git a/keyboards/xd75/keymaps/germanized/rules.mk b/keyboards/xd75/keymaps/germanized/rules.mk index f57fb8c54e6..ab81a536098 100644 --- a/keyboards/xd75/keymaps/germanized/rules.mk +++ b/keyboards/xd75/keymaps/germanized/rules.mk @@ -33,6 +33,3 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Enable Tap Dancing -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/kim-kim-xd73/config.h b/keyboards/xd75/keymaps/kim-kim-xd73/config.h index e2390f770cb..0c8015e2271 100644 --- a/keyboards/xd75/keymaps/kim-kim-xd73/config.h +++ b/keyboards/xd75/keymaps/kim-kim-xd73/config.h @@ -14,12 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once // place overrides here #undef BACKLIGHT_BREATHING - -#endif diff --git a/keyboards/xd75/keymaps/kim-kim-xd73/keymap.c b/keyboards/xd75/keymaps/kim-kim-xd73/keymap.c index 19f13ed322b..61e5c73ab30 100644 --- a/keyboards/xd75/keymaps/kim-kim-xd73/keymap.c +++ b/keyboards/xd75/keymaps/kim-kim-xd73/keymap.c @@ -16,9 +16,7 @@ #include QMK_KEYBOARD_H // Fillers to make layering more clear -#define _______ KC_TRNS #define ___T___ KC_TRNS -#define XXXXXXX KC_NO // Layer shorthand #define _QW 0 @@ -118,10 +116,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/xd75/keymaps/kim-kim-xd73/rules.mk b/keyboards/xd75/keymaps/kim-kim-xd73/rules.mk index 7e4ed0837bb..4c894d79738 100644 --- a/keyboards/xd75/keymaps/kim-kim-xd73/rules.mk +++ b/keyboards/xd75/keymaps/kim-kim-xd73/rules.mk @@ -20,6 +20,3 @@ # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/kim-kim/config.h b/keyboards/xd75/keymaps/kim-kim/config.h index e2390f770cb..0c8015e2271 100644 --- a/keyboards/xd75/keymaps/kim-kim/config.h +++ b/keyboards/xd75/keymaps/kim-kim/config.h @@ -14,12 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once // place overrides here #undef BACKLIGHT_BREATHING - -#endif diff --git a/keyboards/xd75/keymaps/kim-kim/keymap.c b/keyboards/xd75/keymaps/kim-kim/keymap.c index 85c00023094..f46c0b65906 100644 --- a/keyboards/xd75/keymaps/kim-kim/keymap.c +++ b/keyboards/xd75/keymaps/kim-kim/keymap.c @@ -16,9 +16,7 @@ #include QMK_KEYBOARD_H // Fillers to make layering more clear -#define _______ KC_TRNS #define ___T___ KC_TRNS -#define XXXXXXX KC_NO // Layer shorthand #define _QW 0 @@ -67,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LW] = { /* LOWERED */ { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, _______, _______, _______, _______, _______, _______, _______, _______ }, { _______, KC_MPRV, KC_MNXT, KC_VOLU, _______, _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, KC_MPLY, KC_MSTP, KC_VOLD, _______, _______, RGB_SMOD, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, KC_MPLY, KC_MSTP, KC_VOLD, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______ }, { _______, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, { _______, MO(_RT), MO(_RT), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, }, @@ -118,10 +116,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/xd75/keymaps/kim-kim/rules.mk b/keyboards/xd75/keymaps/kim-kim/rules.mk index 7e4ed0837bb..4c894d79738 100644 --- a/keyboards/xd75/keymaps/kim-kim/rules.mk +++ b/keyboards/xd75/keymaps/kim-kim/rules.mk @@ -20,6 +20,3 @@ # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/kloki/config.h b/keyboards/xd75/keymaps/kloki/config.h index 015377b5f8f..e6975da8a20 100644 --- a/keyboards/xd75/keymaps/kloki/config.h +++ b/keyboards/xd75/keymaps/kloki/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/kloki/keymap.c b/keyboards/xd75/keymaps/kloki/keymap.c index 62023cf70dc..b9bb2c66d41 100644 --- a/keyboards/xd75/keymaps/kloki/keymap.c +++ b/keyboards/xd75/keymaps/kloki/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H // Layer shorthand #define _WO 0 @@ -64,9 +64,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { _______, _______, _______, _______, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, } }; -const uint16_t PROGMEM fn_actions[] = { - -}; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { diff --git a/keyboards/xd75/keymaps/kloki/rules.mk b/keyboards/xd75/keymaps/kloki/rules.mk index d4e08cfb26b..52a8f38d45f 100644 --- a/keyboards/xd75/keymaps/kloki/rules.mk +++ b/keyboards/xd75/keymaps/kloki/rules.mk @@ -13,6 +13,3 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/markus/config.h b/keyboards/xd75/keymaps/markus/config.h index bde866636f6..a3e1631715d 100644 --- a/keyboards/xd75/keymaps/markus/config.h +++ b/keyboards/xd75/keymaps/markus/config.h @@ -1,4 +1,4 @@ -/* Copyright 2018 Markus Weimar +/* Copyright 2019 Markus Weimar * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,21 +14,35 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once // place overrides here -// Mousekeys -#define MOUSEKEY_MOVE_DELTA 1 -#define MOUSEKEY_WHEEL_DELTA 1 -#define MOUSEKEY_DELAY 90 -#define MOUSEKEY_INTERVAL 16 -#define MOUSEKEY_MAX_SPEED 20 -#define MOUSEKEY_TIME_TO_MAX 0 -#define MOUSEKEY_WHEEL_MAX_SPEED 1 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 0 - -#endif +// Mouse keys (accelerated) +//#define MOUSEKEY_MOVE_DELTA 1 +//#define MOUSEKEY_WHEEL_DELTA 1 +//#define MOUSEKEY_DELAY 90 +//#define MOUSEKEY_INTERVAL 16 +//#define MOUSEKEY_MAX_SPEED 20 +//#define MOUSEKEY_TIME_TO_MAX 0 +//#define MOUSEKEY_WHEEL_MAX_SPEED 1 +//#define MOUSEKEY_WHEEL_TIME_TO_MAX 0 +// Mouse keys (constant) +#define MK_3_SPEED +#define MK_MOMENTARY_ACCEL +#define MK_C_OFFSET_UNMOD 18 +#define MK_C_INTERVAL_UNMOD 16 +#define MK_C_OFFSET_0 2 +#define MK_C_INTERVAL_0 16 +#define MK_C_OFFSET_1 6 +#define MK_C_INTERVAL_1 16 +#define MK_C_OFFSET_2 36 +#define MK_C_INTERVAL_2 16 +#define MK_W_OFFSET_UNMOD 1 +#define MK_W_INTERVAL_UNMOD 40 +#define MK_W_OFFSET_0 1 +#define MK_W_INTERVAL_0 360 +#define MK_W_OFFSET_1 1 +#define MK_W_INTERVAL_1 120 +#define MK_W_OFFSET_2 1 +#define MK_W_INTERVAL_2 20 diff --git a/keyboards/xd75/keymaps/markus/keymap.c b/keyboards/xd75/keymaps/markus/keymap.c index e61fb09b1b9..9b8ab52fc35 100644 --- a/keyboards/xd75/keymaps/markus/keymap.c +++ b/keyboards/xd75/keymaps/markus/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2018 Markus Weimar +/* Copyright 2019 Markus Weimar * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,35 +14,34 @@ * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H #include "keymap_german.h" #define ________ KC_TRNS #define ___xx___ KC_NO -#define NKRO_TG MAGIC_TOGGLE_NKRO enum my_layers { - _QWZ, - _QWY, - _GAM, - _FN1, - _FN2, - _FN3, + _QWZ, + _QWY, + _GAM, + _FN1, + _FN2, + _FN3, }; enum my_keycodes { - QWERTZ = SAFE_RANGE, - QWERTY, - GAMING, - FN1, - FN2, - FN3 + QWERTZ = SAFE_RANGE, + QWERTY, + GAMING, + FN1, + FN2, + FN3 }; enum my_ucis { - UNI_LNX, - UNI_MAC, - UNI_WIN, + UNI_LNX, + UNI_MAC, + UNI_WIN, }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -118,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | " | ' | ‚ | ‘ | ’ | | | | | | [ | ] | ! | ? | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | ° | ^ | „ | “ | ” | | | | # | < | > | … | – | | + * | | ° | ^ | „ | “ | ” | | | | # | < | > | … | – EN | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | | | | | | | | | | | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' @@ -133,19 +132,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* FN2 * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | % | ( | ) | P/ | P* | P- | Print | Scroll | Pause | ẞ | | + * | | | | | % | ( | ) | P/ | P* | P- | Print | Scroll | Pause | ẞ | − MNS | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | | Mute | Vol- | Vol+ | Bspc | P7 | P8 | P9 | P+ | WH_U | MS_U | WH_D | × | ÷ | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | App | ACL0 | ACL1 | ACL2 | Space | P4 | P5 | P6 | WH_L | MS_L | MS_D | MS_R | WH_R | | + * | | App | ACL2 | ACL1 | ACL0 | Space | P4 | P5 | P6 | WH_L | MS_L | MS_D | MS_R | WH_R | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | Prev | Play | Next | Tab | P1 | P2 | P3 | PEnter | BTN1 | BTN2 | BTN3 | — | | + * | | | Prev | Play | Next | Tab | P1 | P2 | P3 | PEnter | BTN1 | BTN2 | BTN3 | — EM | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | Fn2 | | | | | PEnter | P0 | . : | P, | BTN1 | BTN2 | BTN3 | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ [_FN2] = { -{ ___xx___, ___xx___, ___xx___, ___xx___, DE_PERC, DE_LPRN, DE_RPRN, KC_PSLS, KC_PAST, KC_PMNS, KC_PSCR, KC_LSCR, KC_PAUS, UC(L'ẞ'), ___xx___ }, +{ ___xx___, ___xx___, ___xx___, ___xx___, DE_PERC, DE_LPRN, DE_RPRN, KC_PSLS, KC_PAST, KC_PMNS, KC_PSCR, KC_LSCR, KC_PAUS, UC(L'ẞ'), UC(L'−') }, { ________, ___xx___, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_WH_U, KC_MS_U, KC_WH_D, UC(L'×'), UC(L'÷') }, { ________, KC_APP, KC_ACL2, KC_ACL1, KC_ACL0, KC_SPC, KC_P4, KC_P5, KC_P6, KC_WH_L, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_R, ________ }, { ________, ___xx___, KC_MPRV, KC_MPLY, KC_MNXT, KC_TAB, KC_P1, KC_P2, KC_P3, KC_PENT, KC_BTN1, KC_BTN2, KC_BTN3, UC(L'—'), ________ }, @@ -156,61 +155,61 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * .--------------------------------------------------------------------------------------------------------------------------------------. * | F13 | F14 | F15 | F16 | F17 | F18 | U LNX | U WIN | U MAC | F19 | F20 | F21 | F22 | F23 | F24 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | QWERTZ | QWERTY | | NKRO | ThinSp | L TOG | L MP | L MOD | | Pg Up | Up | Pg Dn | | | + * | | QWERTZ | QWERTY | GAMING | | | L TOG | L MP | L MOD | | Pg Up | Up | Pg Dn | | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | NaNbSp | | › | ‹ | GAMING | L HUI | L SAI | L VAI | Home | Left | Down | Right | End | | + * | | | | › | ‹ | | L HUI | L SAI | L VAI | Home | Left | Down | Right | End | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | » | « | | L HUD | L SAD | L VAD | FigSp | | | | NbHyph | | + * | | | | » | « | | L HUD | L SAD | L VAD | NumSp | ThinSp | NaNbSp | NbSp | NbHyph | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | | Reset | | NbSp | | | | | | + * | | | | | | | | Reset | | | | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ [_FN3] = { { KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, UNI_LNX, UNI_WIN, UNI_MAC, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 }, -{ ________, QWERTZ, QWERTY, ___xx___, NKRO_TG, UC(L' '), RGB_TOG, RGB_M_P, RGB_MOD, ___xx___, KC_PGUP, KC_UP, KC_PGDN, ___xx___, ___xx___ }, -{ ________, UC(L' '), ___xx___, UC(L'›'), UC(L'‹'), GAMING, RGB_HUI, RGB_SAI, RGB_VAI, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, ________ }, -{ ________, ___xx___, ___xx___, UC(L'»'), UC(L'«'), ___xx___, RGB_HUD, RGB_SAD, RGB_VAD, UC(L' '), ___xx___, ___xx___, ___xx___, UC(L'‑'), ________ }, -{ ___xx___, ________, ________, ________, ________, ________, ________, RESET, ________, UC(L' '), ________, ________, ________, ________, ________ }, +{ ________, QWERTZ, QWERTY, GAMING, ___xx___, ___xx___, RGB_TOG, RGB_M_P, RGB_MOD, ___xx___, KC_PGUP, KC_UP, KC_PGDN, ___xx___, ___xx___ }, +{ ________, ___xx___, ___xx___, UC(L'›'), UC(L'‹'), ___xx___, RGB_HUI, RGB_SAI, RGB_VAI, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, ________ }, +{ ________, ___xx___, ___xx___, UC(L'»'), UC(L'«'), ___xx___, RGB_HUD, RGB_SAD, RGB_VAD, UC(L' '), UC(L' '), UC(L' '), UC(L' '), UC(L'‑'), ________ }, +{ ___xx___, ________, ________, ________, ________, ________, ________, RESET, ________, ________, ________, ________, ________, ________, ________ }, }, }; void matrix_init_user(){ - set_unicode_input_mode(UC_LNX); + set_unicode_input_mode(UC_LNX); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case QWERTZ: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWZ); - } - return false; - break; - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWY); - } - return false; - break; - case GAMING: - if (record->event.pressed) { - set_single_persistent_default_layer(_GAM); - } - return false; - break; - case UNI_LNX: - set_unicode_input_mode(UC_LNX); - return false; - break; - case UNI_WIN: - set_unicode_input_mode(UC_WINC); - return false; - break; - case UNI_MAC: - set_unicode_input_mode(UC_OSX); - return false; - break; - } - return true; + switch(keycode) { + case QWERTZ: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWZ); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWY); + } + return false; + break; + case GAMING: + if (record->event.pressed) { + set_single_persistent_default_layer(_GAM); + } + return false; + break; + case UNI_LNX: + set_unicode_input_mode(UC_LNX); + return false; + break; + case UNI_WIN: + set_unicode_input_mode(UC_WINC); + return false; + break; + case UNI_MAC: + set_unicode_input_mode(UC_OSX); + return false; + break; + } + return true; } diff --git a/keyboards/xd75/keymaps/markus/readme.md b/keyboards/xd75/keymaps/markus/readme.md index 92628124055..fc5959bcdc7 100644 --- a/keyboards/xd75/keymaps/markus/readme.md +++ b/keyboards/xd75/keymaps/markus/readme.md @@ -2,15 +2,15 @@ This keymap has three base layers (QWERTZ, QWERTY, Gaming) and three function layers (Fn1, Fn2, Fn3). -QWERTY is identical to QWERTZ except `z` and `y` are swapped. +QWERTY is identical to QWERTZ, except `z` and `y` are swapped. Gaming is a modified QWERTY layer for left-hand usage. The function layers contain: -* Symbols (standard and Unicode) +* Symbols +* Unicode characters (e.g. dashes, figure space, non-breaking space and hyphen) * Unicode input mode switches * Numpad * Function keys -* Media, mouse, LED control -* Non-breaking characters +* Media, mouse and LED controls diff --git a/keyboards/xd75/keymaps/markus/rules.mk b/keyboards/xd75/keymaps/markus/rules.mk index febb446f891..22befc53496 100644 --- a/keyboards/xd75/keymaps/markus/rules.mk +++ b/keyboards/xd75/keymaps/markus/rules.mk @@ -1,26 +1,13 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODEMAP_ENABLE = no # This allows sending unicode symbols using X() in your keymap. -UNICODE_ENABLE = yes # Unicode -UCIS_ENABLE = no # Keep in mind that not all will work (See WinCompose for details on Windows). -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -API_SYSEX_ENABLE = no - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +NKRO_ENABLE = yes +BACKLIGHT_ENABLE = no +MIDI_ENABLE = no +AUDIO_ENABLE = no +UNICODE_ENABLE = yes +BLUETOOTH_ENABLE = no +RGBLIGHT_ENABLE = yes +SLEEP_LED_ENABLE = no diff --git a/keyboards/xd75/keymaps/msiu/config.h b/keyboards/xd75/keymaps/msiu/config.h new file mode 100644 index 00000000000..4fbd59becc8 --- /dev/null +++ b/keyboards/xd75/keymaps/msiu/config.h @@ -0,0 +1,18 @@ +/* Copyright 2017 Benjamin Kesselring + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +// place overrides here diff --git a/keyboards/xd75/keymaps/msiu/keymap.c b/keyboards/xd75/keymaps/msiu/keymap.c new file mode 100644 index 00000000000..c4cc456a907 --- /dev/null +++ b/keyboards/xd75/keymaps/msiu/keymap.c @@ -0,0 +1,120 @@ +/* Copyright 2017 Benjamin Kesselring + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* What this layout is: QWERTY layout with the standard 40% layers. For easy + * switching between my xd75 and contra + */ + +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW 0 +#define _DV 1 +#define _LW 2 +#define _RS 3 +#define _FN 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | - | = | \ | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | TAB | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ESC | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ; | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LSHIFT | Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | HYPER | LALT | LGUI | LOWER | FN | 0 | | . | SPACE | RAISE | LEFT | DOWN | UP | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = { /* QWERTY */ + { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_PLUS, KC_MINS, KC_ASTR, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, + { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_7, KC_8, KC_9 , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL }, + { LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_4, KC_5, KC_6 , KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, + { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_1, KC_2, KC_3 , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + { KC_LCTL, KC_HYPR, KC_LALT, KC_LGUI, MO(_LW), MO(_FN), KC_0, _______, KC_DOT , KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT }, + }, + + /* Dvorak */ + + [_DV] = { /* Dvorak */ + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, _______, _______, _______, KC_F, KC_G, KC_C, KC_R, KC_L, _______ }, + { _______, KC_A, KC_O, KC_E, KC_U, KC_I, _______, _______, _______, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH }, + { _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, _______, _______, _______, KC_B, KC_M, KC_W, KC_V, KC_Z, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, + + +/* LOWERED + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ~ | ! | @ | # | $ | % | | VOLU | | ^ | & | * | ( | ) | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | PREV | PLAY | NEXT | F6 | _ | + | { | } | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | | VOLD | | F12 | PAGEDW | PAGEUP | HOME | END | MUTE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | | | MUTE | | PLAY | | PREV | VOLD | VOLU | NEXT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_LW] = { /* LOWERED */ + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL }, + { KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_VOLU, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MPRV, KC_MPLY, KC_MNXT, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE }, + { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_VOLD, _______, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE }, + { _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT }, + }, + +/* RAISED + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | 1 | 2 | 3 | 4 | 5 | | VOLU | | 6 | 7 | 8 | 9 | 0 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | PREV | PLAY | NEXT | F6 | - | = | [ | ] | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | | VOLD | | F12 | PAGEUP | PAGEDW | HOME | END | MUTE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | MUTE | | PLAY | | PREV | VOLD | VOLU | NEXT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_RS] = { /* RAISED */ + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL }, + { KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_VOLU, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MPRV, KC_MPLY, KC_MNXT, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS }, + { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_VOLD, _______, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE }, + { _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT }, + }, + +/* FUNCTION */ + + [_FN] = { /* FUNCTION */ + { RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP , _______, KC_PSCR, _______ }, + { _______, _______, _______, TO(_DV), TO(_QW), _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, +}; + + diff --git a/keyboards/xd75/keymaps/msiu/readme.md b/keyboards/xd75/keymaps/msiu/readme.md new file mode 100644 index 00000000000..f37eee41a33 --- /dev/null +++ b/keyboards/xd75/keymaps/msiu/readme.md @@ -0,0 +1,3 @@ +# msiu's keymap for xd75 + +QWERTY keymap for xd75 with centered numpad and standard 40% layers for easy switching between xd75 and contra/planck. diff --git a/keyboards/xd75/keymaps/mtdjr/config.h b/keyboards/xd75/keymaps/mtdjr/config.h index 7e2227c874d..0ceba236fed 100644 --- a/keyboards/xd75/keymaps/mtdjr/config.h +++ b/keyboards/xd75/keymaps/mtdjr/config.h @@ -14,10 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here #undef MANUFACTURER @@ -25,5 +22,3 @@ #define MANUFACTURER mtdjr #define PRODUCT XD75 #define DESCRIPTION XD75Re - -#endif diff --git a/keyboards/xd75/keymaps/mtdjr/keymap.c b/keyboards/xd75/keymaps/mtdjr/keymap.c index 074cf7335a3..e56d918fd5f 100644 --- a/keyboards/xd75/keymaps/mtdjr/keymap.c +++ b/keyboards/xd75/keymaps/mtdjr/keymap.c @@ -3,7 +3,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KC_KEYMAP( + [_QWERTY] = LAYOUT_kc( // .--------------------------------------------------------------------------. EXC, 1 , 2 , 3 , 4 , 5 ,PGUP,MPNT,PGDN, 6 , 7 , 8 , 9 , 0 ,BSPC, // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| @@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----' ), - [_LOWER] = KC_KEYMAP( + [_LOWER] = LAYOUT_kc( // .--------------------------------------------------------------------------. xxxx, F1 , F2 , F3 , F4 , F5 , F6 ,xxxx, F7 , F8 , F9 , F10, F11, F12, DEL, // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| @@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----' ), -[_RAISE] = KC_KEYMAP( +[_RAISE] = LAYOUT_kc( // .--------------------------------------------------------------------------. xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| diff --git a/keyboards/xd75/keymaps/mtdjr/rules.mk b/keyboards/xd75/keymaps/mtdjr/rules.mk index 28462ff160f..6b7d69d4f2c 100644 --- a/keyboards/xd75/keymaps/mtdjr/rules.mk +++ b/keyboards/xd75/keymaps/mtdjr/rules.mk @@ -13,10 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - BACKLIGHT_ENABLE = yes TAP_DANCE_ENABLE = yes RGBLIGHT_ENABLE = yes + diff --git a/keyboards/xd75/keymaps/revok75/config.h b/keyboards/xd75/keymaps/revok75/config.h new file mode 100644 index 00000000000..a5484876ef4 --- /dev/null +++ b/keyboards/xd75/keymaps/revok75/config.h @@ -0,0 +1,20 @@ +/* Copyright 2017 Benjamin Kesselring + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here +#undef BACKLIGHT_BREATHING diff --git a/keyboards/xd75/keymaps/revok75/keymap.c b/keyboards/xd75/keymaps/revok75/keymap.c new file mode 100644 index 00000000000..44e2c52033b --- /dev/null +++ b/keyboards/xd75/keymaps/revok75/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2017 Wunder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW_M 0 +#define _QW_W 1 +#define _FN 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY-Mac + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | % | 6 | 7 | 8 | 9 | 0 | - | = | Cut | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | Copy | Paste | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | \ | RSHIFT| UP | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | ALFRED | FN-MO | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW_M] = LAYOUT_ortho_5x15( /* QWERTY MAC*/ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, LGUI(KC_X), KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCBR, KC_RCBR, LGUI(KC_C), LGUI(KC_V), \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LGUI(KC_R), KC_NO, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_RSFT, KC_UP, LGUI(KC_S), \ + KC_LCTL, KC_LALT, KC_LGUI, LGUI(KC_F), LGUI(KC_T), KC_SPC, KC_NO, LALT(KC_SPACE), MO(_FN), KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* QWERTY-Win + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | % | 6 | 7 | 8 | 9 | 0 | - | = | Cut | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | Copy | Paste | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | \ | RSHIFT | UP | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | START | FN-MO | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW_W] = LAYOUT_ortho_5x15( /* QWERTY WIN*/ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, LCTL(KC_X), KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCBR, KC_RCBR, LCTL(KC_C), LCTL(KC_V), \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LCTL(KC_R), KC_NO, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_RSFT, KC_UP, LCTL(KC_S), \ + KC_LCTL, KC_LALT, KC_LGUI, LCTL(KC_F), LCTL(KC_T), KC_SPC, KC_NO, LCTL(KC_GESC), MO(_FN), KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + +/* FUNCTION +* .--------------------------------------------------------------------------------------------------------------------------------------. +* | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | VOLDN | VOLUP | MUTE | DEL | +* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| +* | TAB | - | WIN | - | - | RGB_TOG| - | - | OPTION | RESET | - | [ | ] | - | - | +* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| +* | CAP LK | MAC | RAINBOW| PLAIN | - | - | - | - | - | - | ; | ' | ENTER | ENTER | REF | +* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| +* | LSHIFT | INC | DEC | HUE I | HUE D | SAT I | SAT D | - | - | . | / | \ | RSHIFT| HOME | SAVE | +* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| +* | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | ALFRED | FN-MO | RALT | RGUI | RCTRL | PGUP | END | PGDN | +* '--------------------------------------------------------------------------------------------------------------------------------------' +*/ + + [_FN] = LAYOUT_ortho_5x15( /* OSLAYOUT + NUMPAD + MEDIA + LIGHTING */ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_VOLD, KC_VOLU, KC_MUTE, KC_DEL, \ + KC_TRNS, KC_NO, DF(_QW_W), KC_NO, KC_NO, RGB_TOG, KC_NO, KC_NO, KC_RALT, RESET, KC_NO, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, \ + KC_TRNS, DF(_QW_M), RGB_MODE_RAINBOW, RGB_MODE_PLAIN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_NO, KC_NO, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_END, KC_PGDN \ + ) +}; diff --git a/keyboards/xd75/keymaps/revok75/readme.md b/keyboards/xd75/keymaps/revok75/readme.md new file mode 100644 index 00000000000..ecec8c96292 --- /dev/null +++ b/keyboards/xd75/keymaps/revok75/readme.md @@ -0,0 +1 @@ +# The default keymap for Revok 75 diff --git a/keyboards/xd75/keymaps/revok75/rules.mk b/keyboards/xd75/keymaps/revok75/rules.mk new file mode 100644 index 00000000000..7472e8c646f --- /dev/null +++ b/keyboards/xd75/keymaps/revok75/rules.mk @@ -0,0 +1,18 @@ +# Copyright 2013 Jun Wako +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +BOOTMAGIC_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes diff --git a/keyboards/xd75/keymaps/skewwhiffy/keymap.c b/keyboards/xd75/keymaps/skewwhiffy/keymap.c index 33f3868084f..ab0213862c9 100644 --- a/keyboards/xd75/keymaps/skewwhiffy/keymap.c +++ b/keyboards/xd75/keymaps/skewwhiffy/keymap.c @@ -76,18 +76,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------------------------------------------------------------------------------------------------------------------------------------| * | A | R | S | T | D | | | | | | H | N | E | I | O | * |--------------------------------------------------------------------------------------------------------------------------------------| - * | Z | X | C | V | B | | | | | | K | M | , | . | / | + * | Z | X | C | V | B | | | UP | | | K | M | , | . | / | * | SHIFT | NUMBER | SYMBOL | NAV | | | | | | | | NAV | SYMBOL | FUNC | SHIFT | * |--------------------------------------------------------------------------------------------------------------------------------------| - * | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | | | | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT | + * | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | LEFT | DOWN | RIGHT | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT | * .--------------------------------------------------------------------------------------------------------------------------------------. */ [cm] = LAYOUT_ortho_5x15( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ UK_Q, UK_W, UK_F, UK_P, UK_G, _______, _______, _______, _______, _______, UK_J, UK_L, UK_U, UK_Y, UK_SCLN, \ UK_A, UK_R, UK_S, UK_T, UK_D, _______, _______, _______, _______, _______, UK_H, UK_N, UK_E, UK_I, UK_O , \ - _Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, _______, _______, _______, UK_K, _M_NAR, _COM_SY, _DOT_NB, _SLSH , \ - UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, UK_SPC, UK_ENT, _______, _______, _______, UK_DEL, UK_BSPC, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT \ + _Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, UK_UP, _______, _______, UK_K, _M_NAR, _COM_SY, _DOT_NB, _SLSH , \ + UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, UK_SPC, UK_ENT, UK_LEFT, UK_DOWN, UK_RGHT, UK_DEL, UK_BSPC, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT \ ), /* Dvorak diff --git a/keyboards/xd75/keymaps/skewwhiffy/rules.mk b/keyboards/xd75/keymaps/skewwhiffy/rules.mk index d4e08cfb26b..52a8f38d45f 100644 --- a/keyboards/xd75/keymaps/skewwhiffy/rules.mk +++ b/keyboards/xd75/keymaps/skewwhiffy/rules.mk @@ -13,6 +13,3 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/tdl-jturner/config.h b/keyboards/xd75/keymaps/tdl-jturner/config.h index 985247bb2e3..596aaff6659 100644 --- a/keyboards/xd75/keymaps/tdl-jturner/config.h +++ b/keyboards/xd75/keymaps/tdl-jturner/config.h @@ -16,10 +16,9 @@ // additional config optoinsa vailable at https://docs.qmk.fm/reference/config-options#the-config.h-file -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" +// place overrides here // place overrides here //#define TAPPING_TERM 200 @@ -33,5 +32,3 @@ #define MOUSEKEY_TIME_TO_MAX 60 #define MOUSEKEY_MAX_SPEED 7 #define MOUSEKEY_WHEEL_DELAY 0 - -#endif diff --git a/keyboards/xd75/keymaps/tdl-jturner/keymap.c b/keyboards/xd75/keymaps/tdl-jturner/keymap.c index 9789d9a8678..593e54f14d7 100644 --- a/keyboards/xd75/keymaps/tdl-jturner/keymap.c +++ b/keyboards/xd75/keymaps/tdl-jturner/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H enum xd75_layers { _QWERTY, diff --git a/keyboards/xd75/keymaps/tdl-jturner/rules.mk b/keyboards/xd75/keymaps/tdl-jturner/rules.mk index 186b452fc63..996d77045e2 100644 --- a/keyboards/xd75/keymaps/tdl-jturner/rules.mk +++ b/keyboards/xd75/keymaps/tdl-jturner/rules.mk @@ -13,11 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - TAP_DANCE_ENABLE = yes MOUSEKEY_ENABLE = yes BACKLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes + diff --git a/keyboards/xd75/readme.md b/keyboards/xd75/readme.md index e11ce7dca9a..fc5b8972c85 100644 --- a/keyboards/xd75/readme.md +++ b/keyboards/xd75/readme.md @@ -1,32 +1,25 @@ -xd75 keyboard firmware -====================== +# XD75 -The XD75Re is a 15x5 full-grid ortholinear keyboard manufactured by XIUDI. This port of the QMK firmware is my first shot at using QMK, so if you see any features done wrong (or just plain missing), feel free to fix them and put in a pull request! +![XD75](https://cdn.shopify.com/s/files/1/2711/4238/products/HTB1MzOISXXXXXXgXpXXq6xXFXXXO_1024x1024.jpg) -## Quantum MK Firmware +The XD75Re is a 15x5 full-grid ortholinear keyboard manufactured by XIUDI. This port of the QMK firmware is my first shot at using QMK, so if you see any features done wrong (or just plain missing), feel free to fix them and put in a pull request! -For more info on this firmware (and how to make it your own), head over to [qmk.fm](http://qmk.fm). +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: XD75Re +Hardware Availability: [KPrepublic](https://kprepublic.com/products/xd75re-xd75am-xd75-xiudi-60-custom-keyboard-pcb), [AliExpress](https://www.aliexpress.com/item/xd75re-Custom-Mechanical-Keyboard-75-keys-TKG-TOOLS-Underglow-RGB-PCB-GH60-60-programmed-gh60-kle/32818745981.html) -## Building +Make example for this keyboard (after setting up your build environment): -Download or clone the whole firmware and navigate to the -keyboards/xd75 folder. Once your dev env is setup, you'll be able to -type `make` to generate your .hex - you can then use the Teensy Loader -to install the resulting .hex file, or have the `make` process install -it using DFU. + make xd75:default -### Default +Flashing example: -To build with the default keymap, simply run `make xd75:default` from the root directory (i.e. two levels above this file), and to install via DFU, `make xd75:default:dfu`, also from the root directory. + make xd75:default:dfu -Note that DFU is likely to require root permissions, so installing the -firmware likely requires a command line like: +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). -``` -$ sudo make xd75:default:dfu -``` -### LED control +## LED control There are 3 individual LEDs that can be turned on and off, plus the keycap LEDs (which are all wired into the same pin). The functions are named according to how they're labeled on the PCB. @@ -65,23 +58,3 @@ GP103_LED F4 KEYCAPS_LED F5 GP100_LED F7 ``` - -### Other Keymaps - -The "default" keymap included is basically the OLKB Atomic keymap with -a few buttons added for RGB underglow control. This should be usable -as a starting point, but most people will be best served creating -their own keymap and flashing it - more info on creating your own -keymap is available in [the official QMK -documentation](https://docs.qmk.fm). - -Keymaps follow the format **__\.c__** and are stored in -subdirectories under `keyboards/xd75/keymaps` - -To build the firmware binary hex file for a specific keymap, and -install it, using DFU, just do `make` with a keymap like this: - -``` -$ make xd75:[default|] -``` - diff --git a/keyboards/xd75/rules.mk b/keyboards/xd75/rules.mk index e9927294328..4b2682b1924 100644 --- a/keyboards/xd75/rules.mk +++ b/keyboards/xd75/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -65,4 +64,4 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -LAYOUTS = ortho_5x15 \ No newline at end of file +LAYOUTS = ortho_5x15 diff --git a/keyboards/xd75/xd75.h b/keyboards/xd75/xd75.h index e278066900c..c27930a8453 100644 --- a/keyboards/xd75/xd75.h +++ b/keyboards/xd75/xd75.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef XD75_H -#define XD75_H +#pragma once #include "quantum.h" @@ -22,7 +21,7 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E,\ @@ -36,7 +35,7 @@ { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E } \ } -#define KC_KEYMAP( \ +#define LAYOUT_kc( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E,\ @@ -50,7 +49,7 @@ { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \ } -#define LAYOUT_ortho_5x15 KEYMAP +#define LAYOUT_ortho_5x15 LAYOUT void capslock_led_init(void); void capslock_led_off(void); @@ -67,5 +66,3 @@ void gp103_led_on(void); void keycaps_led_init(void); void keycaps_led_off(void); void keycaps_led_on(void); - -#endif diff --git a/keyboards/xd84/config.h b/keyboards/xd84/config.h new file mode 100644 index 00000000000..138c2c4c853 --- /dev/null +++ b/keyboards/xd84/config.h @@ -0,0 +1,243 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4084 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KPrepublic +#define PRODUCT XD84 +#define DESCRIPTION KPrepublic XD84 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +//#define MATRIX_ROW_PINS { D0, D5 } +//#define MATRIX_COL_PINS { F1, F0, B0 } +//#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +//#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 10 +// #define BACKLIGHT_BREATHING + +#define RGB_DI_PIN C7 +#define RGBLED_NUM 7 +#define RGBLIGHT_ANIMATIONS +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +// LTO options +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/xd84/custom_matrix_helper.c b/keyboards/xd84/custom_matrix_helper.c new file mode 100644 index 00000000000..a6a0a041d9d --- /dev/null +++ b/keyboards/xd84/custom_matrix_helper.c @@ -0,0 +1,112 @@ +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +//_____COMMON__________________________________________________________________ +// user-defined overridable functions +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } +__attribute__((weak)) void matrix_init_user(void) {} +__attribute__((weak)) void matrix_scan_user(void) {} + + +//_____COULD BE COMMON_________________________________________________________ +/* matrix state(1:on, 0:off) */ +/*static*/ matrix_row_t raw_matrix[MATRIX_ROWS]; +/*static*/ matrix_row_t matrix[MATRIX_ROWS]; + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +__attribute__ ((weak)) +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +__attribute__ ((weak)) +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +__attribute__ ((weak)) +matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +__attribute__ ((weak)) +uint8_t matrix_key_count(void) { + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += matrix_bitpop(i); + } + return count; +} + +__attribute__ ((weak)) +void matrix_print(void) { + print_matrix_header(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + print_matrix_row(row); + print("\n"); + } +} + + +//_____CUSTOM MATRIX 'LITE'____________________________________________________ +__attribute__ ((weak)) +void custom_matrix_init(void) { +} + +__attribute__ ((weak)) +bool custom_matrix_scan(matrix_row_t current_matrix[]) { + bool changed = true; + return changed; +} + +__attribute__ ((weak)) +void matrix_init(void) { + + custom_matrix_init(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + raw_matrix[i] = 0; + matrix[i] = 0; + } + + debounce_init(MATRIX_ROWS); + + matrix_init_quantum(); +} + +__attribute__ ((weak)) +uint8_t matrix_scan(void) { + bool changed = custom_matrix_scan(raw_matrix); + + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + + matrix_scan_quantum(); + return 1; +} diff --git a/keyboards/xd84/dev.md b/keyboards/xd84/dev.md new file mode 100644 index 00000000000..536b01d06ba --- /dev/null +++ b/keyboards/xd84/dev.md @@ -0,0 +1,136 @@ +# XD84 + +Development docs covering the following: +- Kimera core +- RGB +- Backlight +- Light Through Cat + +## Kimera core +![Kimera core](https://gd2.alicdn.com/imgextra/i4/159916802/TB2qsIgdrJkpuFjy1zcXXa5FFXa_!!159916802.jpg) + +What little available info that was available for the qmk port +- atmega32u4 16Mhz + - board seems to have a 6Mhz crystal +- 2x PCA9555 I2C IO expander + +Links: +- [Schematic, BOM, Gerbers](/kairyu/kimera/blob/master/kimera_core) +- [Original firmware](https://github.com/kairyu/tmk_keyboard_custom/tree/master/keyboard/kimera) + +```c +/* +Kimera_core_v1.0 Components + + U1 (atmega32u4) + ,----------------. + TX --| TX0(PD3) RAW |-- + RX --| RX1(PD2) GND |-- + --| GND RESET |-- RST + --| GND VCC |-- + SDA --| 2(PD1) (PF4)A3 |-- + SCL --| 3(PD0) (PF5)A2 |-- + (INT) --| 4(PD4) (PF6)A1 |-- + --| 5(PC6) (PF7)A0 |-- + --| 6(PD7) (PB1)15 |-- SCK + LED2 --| 7(PE6) (PB3)14 |-- MISO + LED1 --| 8(PB4) (PB2)16 |-- MOSI + LED3 --| 9(PB5) (PB6)10 |-- LED4 + `----------------' + + IC1 (PCA9555) IC2 (PCA9555) + ,----------. ,----------. + SDA --| SDA P00 |-- P1 SDA --| SDA P00 |-- P17 + SCL --| SCL P01 |-- P2 SCL --| SCL P01 |-- P18 + INT --| INT P02 |-- P3 INT --| INT P02 |-- P19 + | P03 |-- P4 | P03 |-- P20 + GND --| A0 P04 |-- P5 VCC --| A0 P04 |-- P21 + SJ1 --| A1 P05 |-- P6 SJ1 --| A1 P05 |-- P22 + SJ2 --| A2 P06 |-- P7 SJ2 --| A2 P06 |-- P23 + | P07 |-- P8 | P07 |-- P24 + | | | | + | P10 |-- P9 | P10 |-- P25 + | P11 |-- P10 | P11 |-- P26 + | P12 |-- P11 | P12 |-- P27 + | P13 |-- P12 | P13 |-- P28 + | P14 |-- P13 | P14 |-- P29 + | P15 |-- P14 | P15 |-- P30 + | P16 |-- P15 | P16 |-- P31 + | P17 |-- P16 | P17 |-- P32 + `----------' `----------' +*/ + +``` + +### Bootloader +Default bootloader is `atmel-dfu`. +Reboot to bootloader via magnetic switch next to icsp header. +Flash using regular dfu methods. + +### XD84 pin mappings +Taken from [kimera-config.json](https://github.com/kairyu/tkg/blob/master/keyboard/config/kimera-config.json) + + "row_mapping": [ 1, 2, 3, 4, 5, 6 ], + "col_mapping": [ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 ], + +# RGB +- PIN C7 +- Number of RGB LED 7 + +# Backlight +- PIN B6 + +# Light Through Cat + TODO - PWM C6 + +## Assumptions +### Pin/Port mappings +- All cols are on the same IC +- All rows are on the same IC and port +- Pins mapped sequentially +- Each port only does row or column not a mixture of both + - No need to have complex port config + - + +| ROW index | Kimera Pin | PCA9555 | +| ----------|------------|-------------------| +| 0 | 1 | IC1 Port 0 pin 0 | +| 1 | 2 | IC1 Port 0 pin 1 | +| 2 | 3 | IC1 Port 0 pin 2 | +| 3 | 4 | IC1 Port 0 pin 3 | +| 4 | 5 | IC1 Port 0 pin 4 | +| 5 | 6 | IC1 Port 0 pin 5 | + +- Safe enough to assume `row_index == pin` + + +| COL index | Kimera Pin | PCA9555 | +| ----------|------------|-------------------| +| 0 | 17 | IC2 Port 0 pin 0 | +| 1 | 18 | IC2 Port 0 pin 1 | +| 2 | 19 | IC2 Port 0 pin 2 | +| 3 | 20 | IC2 Port 0 pin 3 | +| 4 | 21 | IC2 Port 0 pin 4 | +| 5 | 22 | IC2 Port 0 pin 5 | +| 6 | 23 | IC2 Port 0 pin 6 | +| 7 | 24 | IC2 Port 0 pin 7 | +| 8 | 25 | IC2 Port 1 pin 0 | +| 9 | 26 | IC2 Port 1 pin 1 | +| 10 | 27 | IC2 Port 1 pin 2 | +| 11 | 28 | IC2 Port 1 pin 3 | +| 12 | 29 | IC2 Port 1 pin 4 | +| 13 | 30 | IC2 Port 1 pin 5 | +| 14 | 31 | IC2 Port 1 pin 6 | + +- Safe enough to assume here col_index does not need to be converted to pin +- Reading both ports one after the other gives us the same sequential behavior + - maps to the usual practice of reading matrix columns + - while this technically gives 16 column reads, the 16th column can never be set so is safely ignored + +## Notes +[pca9555 datasheet](https://www.ti.com/lit/ds/symlink/pca9555.pdf) + +- Other Kimera based boards with non sequential pin mappings, pins mapped across ICs, or mixed row/col configs will need more complicated `pin -> i2c_addr,port,pin` logic as well as rather more complex pin functions. + +## Return to stock firmware +Not tested but original firmware seems to be available in the [kairyu/tkg-firmware](https://github.com/kairyu/tkg-firmware/blob/master/kimera-core.hex) repo. diff --git a/keyboards/xd84/info.json b/keyboards/xd84/info.json new file mode 100644 index 00000000000..b701db1b79e --- /dev/null +++ b/keyboards/xd84/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "XD84", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT_75_ansi": { + "key_count": 84, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"1", "x":1, "y":1}, {"label":"2", "x":2, "y":1}, {"label":"3", "x":3, "y":1}, {"label":"4", "x":4, "y":1}, {"label":"5", "x":5, "y":1}, {"label":"6", "x":6, "y":1}, {"label":"7", "x":7, "y":1}, {"label":"8", "x":8, "y":1}, {"label":"9", "x":9, "y":1}, {"label":"0", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"delete", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] + }, + + "LAYOUT_75_iso": { + "key_count": 85, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"1", "x":1, "y":1}, {"label":"2", "x":2, "y":1}, {"label":"3", "x":3, "y":1}, {"label":"4", "x":4, "y":1}, {"label":"5", "x":5, "y":1}, {"label":"6", "x":6, "y":1}, {"label":"7", "x":7, "y":1}, {"label":"8", "x":8, "y":1}, {"label":"9", "x":9, "y":1}, {"label":"0", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"delete", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"@", "x":11.75, "y":3}, {"label":"~", "x":12.75, "y":3}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] + } + } +} \ No newline at end of file diff --git a/keyboards/xd84/keymaps/default/keymap.c b/keyboards/xd84/keymaps/default/keymap.c new file mode 100644 index 00000000000..b122fbddc30 --- /dev/null +++ b/keyboards/xd84/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +#define L1_RGUI LM(1, MOD_RGUI) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_75_ansi( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_PAUS, KC_DEL, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──────────────├─────────┤ */ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, +/* ├─────────────────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───────────┬─────────┼─────────┤ */ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, +/* ├───────────┬─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴───────┬─┴───────┬─┴───────┬─────────┼─────────┼─────────┤ */ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, L1_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ), + + [1] = LAYOUT_75_ansi( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──────────────├─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────────────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───────────┬─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├───────────┬─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴───────┬─┴───────┬─┴───────┬─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ) +}; diff --git a/keyboards/xd84/keymaps/default_iso/keymap.c b/keyboards/xd84/keymaps/default_iso/keymap.c new file mode 100644 index 00000000000..87b4bfeea1d --- /dev/null +++ b/keyboards/xd84/keymaps/default_iso/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +#define L1_RGUI LM(1, MOD_RGUI) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_75_iso( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGUP, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬ ├─────────┤ */ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGDN, +/* ├───────────┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴─────────┴─┬─────────┼─────────┤ */ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, +/* ├───────────┼─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴───────┬─┴───────┬─┴───────┬─────────┼─────────┼─────────┤ */ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, L1_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ), + + [1] = LAYOUT_75_iso( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┤ */ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬ ├─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├───────────┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴─────────┴─┬─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├───────────┼─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴───────┬─┴───────┬─┴───────┬─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ) +}; diff --git a/keyboards/xd84/matrix.c b/keyboards/xd84/matrix.c new file mode 100644 index 00000000000..a3590504777 --- /dev/null +++ b/keyboards/xd84/matrix.c @@ -0,0 +1,94 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include +#include +#include +#include "matrix.h" +#include "pca9555.h" +#include "quantum.h" + +#include "debug.h" + +// PCA9555 slave addresses +#define IC1 0x20 +#define IC2 0x21 + +//_____Utility funcs___________________________________________________________ + +static void init_pins(void) { + // init all cols high - IC2 all input + pca9555_set_config(IC2, PCA9555_PORT0, ALL_INPUT);//same as initial state + pca9555_set_config(IC2, PCA9555_PORT1, ALL_INPUT);//same as initial state + + // init all rows - IC1 port0 input + pca9555_set_config(IC1, PCA9555_PORT0, ALL_INPUT);//same as initial state +} + +static void select_row(uint8_t row) { + // For the XD84 all rows are on the same IC and port + // so its safe enough to assume here row == pin + uint8_t pin = row; + uint8_t mask = 1 << pin; + + pca9555_set_output(IC1, PCA9555_PORT0, ALL_HIGH & (~mask)); + pca9555_set_config(IC1, PCA9555_PORT0, ALL_INPUT & (~mask)); +} + +static uint16_t read_cols(void) { + uint16_t state_1 = pca9555_readPins(IC2, PCA9555_PORT0); + uint16_t state_2 = pca9555_readPins(IC2, PCA9555_PORT1); + + // For the XD84 all cols are on the same IC and mapped sequentially + // while this technically gives 16 column reads, + // the 16th column can never be set so is safely ignored + return ~((state_2 << 8) | state_1); +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + current_matrix[current_row] = read_cols(); + + // No need to Unselect row as the next `select_row` will blank everything + + return (last_row_value != current_matrix[current_row]); +} + +//_____CUSTOM MATRIX IMPLEMENTATION____________________________________________________ + +void custom_matrix_init(void) { + pca9555_init(IC1); + pca9555_init(IC2); + + init_pins(); +} + +bool custom_matrix_scan(matrix_row_t current_matrix[]) { + bool changed = false; + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + changed |= read_cols_on_row(current_matrix, current_row); + } + return changed; +} \ No newline at end of file diff --git a/keyboards/xd84/pca9555.c b/keyboards/xd84/pca9555.c new file mode 100644 index 00000000000..df4631e9d74 --- /dev/null +++ b/keyboards/xd84/pca9555.c @@ -0,0 +1,63 @@ +#include "i2c_master.h" +#include "pca9555.h" + +#include "debug.h" + +#define SLAVE_TO_ADDR(n) (n<<1) +#define TIMEOUT 100 + +enum { + CMD_INPUT_0 = 0, + CMD_INPUT_1, + CMD_OUTPUT_0, + CMD_OUTPUT_1, + CMD_INVERSION_0, + CMD_INVERSION_1, + CMD_CONFIG_0, + CMD_CONFIG_1 +}; + +void pca9555_init(uint8_t slave_addr) { + static uint8_t s_init = 0; + if (!s_init) { + i2c_init(); + + s_init=1; + } + + // TODO: could check device connected + //i2c_start(SLAVE_TO_ADDR(slave) | I2C_WRITE); + //i2c_stop(); +} + +void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_OUTPUT_1 : CMD_OUTPUT_0; + + i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_set_config::FAILED\n"); + } +} + +void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_CONFIG_1 : CMD_CONFIG_0; + + i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_set_output::FAILED\n"); + } +} + +uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_INPUT_1 : CMD_INPUT_0; + + uint8_t data = 0; + i2c_status_t ret = i2c_readReg(addr, cmd, &data, sizeof(data), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_readPins::FAILED\n"); + } + return data; +} diff --git a/keyboards/xd84/pca9555.h b/keyboards/xd84/pca9555.h new file mode 100644 index 00000000000..6aaee8a6f88 --- /dev/null +++ b/keyboards/xd84/pca9555.h @@ -0,0 +1,55 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +/* + PCA9555 + ,----------. + SDA --| SDA P00 |-- P1 + SCL --| SCL P01 |-- P2 + INT --| INT P02 |-- P3 + | P03 |-- P4 + A0 --| A0 P04 |-- P5 + A1 --| A1 P05 |-- P6 + A2 --| A2 P06 |-- P7 + | P07 |-- P8 + | | + | P10 |-- P10 + | P11 |-- P11 + | P12 |-- P12 + | P13 |-- P13 + | P14 |-- P14 + | P15 |-- P15 + | P16 |-- P16 + | P17 |-- P17 + `----------' +*/ + +#define PCA9555_PORT0 0 +#define PCA9555_PORT1 1 + +#define ALL_OUTPUT 0 +#define ALL_INPUT 0xFF +#define ALL_LOW 0 +#define ALL_HIGH 0xFF + +void pca9555_init(uint8_t slave_addr); + +void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf); + +void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf); + +uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port); \ No newline at end of file diff --git a/keyboards/xd84/readme.md b/keyboards/xd84/readme.md new file mode 100644 index 00000000000..38b4efcba29 --- /dev/null +++ b/keyboards/xd84/readme.md @@ -0,0 +1,23 @@ +# XD84 + +![XD84](https://cdn.shopify.com/s/files/1/2711/4238/products/HTB17eeJSXXXXXbIXFXXq6xXFXXXp_1024x1024.jpg?v=1515505994) + +Compact With 84 Keys & RGB LED Underglow +- Designed by Xiudi +- Up to 87 keys + - iso and ansi support +- Uses Kimera core + +Keyboard Maintainer: QMK Community +Hardware Supported: XD84 +Hardware Availability: [KPrepublic](https://kprepublic.com/products/xd84-xiudi-70-custom-keyboard-pcb) + +Make example for this keyboard (after setting up your build environment): + + make xd84:default + +Install examples: + + make xd84:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/xd84/rules.mk b/keyboards/xd84/rules.mk new file mode 100644 index 00000000000..283d4babc7a --- /dev/null +++ b/keyboards/xd84/rules.mk @@ -0,0 +1,88 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = i2c_master.c custom_matrix_helper.c pca9555.c matrix.c + +EXTRAFLAGS += -flto + +LAYOUTS = 75_ansi 75_iso \ No newline at end of file diff --git a/keyboards/xd84/xd84.c b/keyboards/xd84/xd84.c new file mode 100644 index 00000000000..eaf531421b6 --- /dev/null +++ b/keyboards/xd84/xd84.c @@ -0,0 +1,32 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "xd84.h" + +void keyboard_pre_init_kb(void) { + setPinOutput(B6); + + keyboard_pre_init_user(); +} + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(B6); + } else { + writePinHigh(B6); + } + + led_set_user(usb_led); +} diff --git a/keyboards/xd84/xd84.h b/keyboards/xd84/xd84.h new file mode 100644 index 00000000000..d59956f691d --- /dev/null +++ b/keyboards/xd84/xd84.h @@ -0,0 +1,59 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#define ____ KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_75_ansi( \ + K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K316, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, K416, \ + K501, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, \ + K601, K602, K603, K607, K611, K612, K613, K614, K615, K616 \ +) { \ + { K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K116 }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K316 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, ____, K414, K416 }, \ + { K501, ____, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516 }, \ + { K601, K602, K603, ____, ____, K607, K115, ____, K613, ____, K611, K612, K614, K615, K616 } \ +} + +#define LAYOUT_75_iso( \ + K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K316, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, K415, K416, \ + K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, \ + K601, K602, K603, K607, K611, K612, K613, K614, K615, K616 \ +) { \ + { K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K116 }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, ____, K316 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, K415, K416 }, \ + { K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516 }, \ + { K601, K602, K603, ____, ____, K607, K115, ____, K613, ____, K611, K612, K614, K615, K616 } \ +} diff --git a/keyboards/xd87/config.h b/keyboards/xd87/config.h index 3682af7409f..dae9d3db8f5 100644 --- a/keyboards/xd87/config.h +++ b/keyboards/xd87/config.h @@ -42,13 +42,12 @@ along with this program. If not, see . * */ - #define MATRIX_ROW_PINS { D1, B0, B1, C7, D3, D5 } #define MATRIX_COL_PINS { E6, F0, F1, F4, F5, F6, F7, B5, B6, C6, D4, D6, D7, B4, B2, B3, D2 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN D0 @@ -65,7 +64,7 @@ along with this program. If not, see . // #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -115,11 +114,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -224,4 +218,3 @@ along with this program. If not, see . #define LCD_E_PIN 1 //< pin for Enable line #endif */ - diff --git a/keyboards/xd87/info.json b/keyboards/xd87/info.json index 3837358cd32..488f3192753 100644 --- a/keyboards/xd87/info.json +++ b/keyboards/xd87/info.json @@ -3,7 +3,7 @@ "url": "", "maintainer": "qmk", "width": 18.25, - "height": 7.25, + "height": 6.25, "layouts": { "LAYOUT_all": { "layout": [ diff --git a/keyboards/xd87/rules.mk b/keyboards/xd87/rules.mk index 39540e701dd..b0a417e2af3 100644 --- a/keyboards/xd87/rules.mk +++ b/keyboards/xd87/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/xd87/xd87.h b/keyboards/xd87/xd87.h index c4df290a3be..2ed47fe9767 100644 --- a/keyboards/xd87/xd87.h +++ b/keyboards/xd87/xd87.h @@ -37,14 +37,14 @@ #define LAYOUT_tkl_ansi( \ K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ - K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1D, K1E, K1F, K1G, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4F, \ K50, K51, K52, K58, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ ) LAYOUT_all( \ K00, KC_NO, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, KC_NO, K1D, KC_NO, K1E, K1F, K1G, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO, K1E, K1F, K1G, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, \ K40, KC_NO, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, KC_NO, K4F, KC_NO, \ @@ -67,4 +67,4 @@ K50, K51, K52, KC_NO, K58, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ ) -#endif \ No newline at end of file +#endif diff --git a/keyboards/xd96/config.h b/keyboards/xd96/config.h new file mode 100644 index 00000000000..ea6c878e9e3 --- /dev/null +++ b/keyboards/xd96/config.h @@ -0,0 +1,244 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4096 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KPrepublic +#define PRODUCT XD96 +#define DESCRIPTION KPrepublic XD96 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 18 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +//#define MATRIX_ROW_PINS { D0, D5 } +//#define MATRIX_COL_PINS { F1, F0, B0 } +//#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +//#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 10 +// #define BACKLIGHT_BREATHING + +#define RGB_DI_PIN C7 +#define RGBLED_NUM 16 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_LIMIT_VAL 50 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +// LTO options +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/xd96/custom_matrix_helper.c b/keyboards/xd96/custom_matrix_helper.c new file mode 100644 index 00000000000..a4c5b6afa54 --- /dev/null +++ b/keyboards/xd96/custom_matrix_helper.c @@ -0,0 +1,127 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +//_____COMMON__________________________________________________________________ +// user-defined overridable functions +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } +__attribute__((weak)) void matrix_init_user(void) {} +__attribute__((weak)) void matrix_scan_user(void) {} + + +//_____COULD BE COMMON_________________________________________________________ +/* matrix state(1:on, 0:off) */ +/*static*/ matrix_row_t raw_matrix[MATRIX_ROWS]; +/*static*/ matrix_row_t matrix[MATRIX_ROWS]; + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +__attribute__ ((weak)) +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +__attribute__ ((weak)) +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +__attribute__ ((weak)) +matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +__attribute__ ((weak)) +uint8_t matrix_key_count(void) { + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += matrix_bitpop(i); + } + return count; +} + +__attribute__ ((weak)) +void matrix_print(void) { + print_matrix_header(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + print_matrix_row(row); + print("\n"); + } +} + + +//_____CUSTOM MATRIX 'LITE'____________________________________________________ +__attribute__ ((weak)) +void custom_matrix_init(void) { +} + +__attribute__ ((weak)) +bool custom_matrix_scan(matrix_row_t current_matrix[]) { + bool changed = true; + return changed; +} + +__attribute__ ((weak)) +void matrix_init(void) { + + custom_matrix_init(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + raw_matrix[i] = 0; + matrix[i] = 0; + } + + debounce_init(MATRIX_ROWS); + + matrix_init_quantum(); +} + +__attribute__ ((weak)) +uint8_t matrix_scan(void) { + bool changed = custom_matrix_scan(raw_matrix); + + debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + + matrix_scan_quantum(); + return 1; +} diff --git a/keyboards/xd96/info.json b/keyboards/xd96/info.json new file mode 100644 index 00000000000..2d678414c85 --- /dev/null +++ b/keyboards/xd96/info.json @@ -0,0 +1,237 @@ +{ + "keyboard_name": "xd96", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT_96_ansi": { + "key_count": 99, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"Insert", "x":13, "y":0}, + {"label":"Delete", "x":14, "y":0}, + {"label":"Home", "x":15, "y":0}, + {"label":"End", "x":16, "y":0}, + {"label":"PgUp", "x":17, "y":0}, + {"label":"PgDn", "x":18, "y":0}, + + {"label":"~", "x":0, "y":1}, + {"label":"!", "x":1, "y":1}, + {"label":"@", "x":2, "y":1}, + {"label":"#", "x":3, "y":1}, + {"label":"$", "x":4, "y":1}, + {"label":"%", "x":5, "y":1}, + {"label":"^", "x":6, "y":1}, + {"label":"&", "x":7, "y":1}, + {"label":"*", "x":8, "y":1}, + {"label":"(", "x":9, "y":1}, + {"label":")", "x":10, "y":1}, + {"label":"_", "x":11, "y":1}, + {"label":"+", "x":12, "y":1}, + {"label":"Backspace", "x":13, "y":1, "w":2}, + + {"label":"Num Lock", "x":15, "y":1}, + {"label":"/", "x":16, "y":1}, + {"label":"*", "x":17, "y":1}, + {"label":"-", "x":18, "y":1}, + + {"label":"Tab", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"{", "x":11.5, "y":2}, + {"label":"}", "x":12.5, "y":2}, + {"label":"|", "x":13.5, "y":2, "w":1.5}, + {"label":"7", "x":15, "y":2}, + {"label":"8", "x":16, "y":2}, + {"label":"9", "x":17, "y":2}, + + {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":":", "x":10.75, "y":3}, + {"label":"\"", "x":11.75, "y":3}, + {"label":"Enter", "x":12.75, "y":3, "w":2.25}, + + {"label":"4", "x":15, "y":3}, + {"label":"5", "x":16, "y":3}, + {"label":"6", "x":17, "y":3}, + {"label":"+", "x":18, "y":2, "h":2}, + + {"label":"Shift", "x":0, "y":4, "w":2.25}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":"<", "x":9.25, "y":4}, + {"label":">", "x":10.25, "y":4}, + {"label":"?", "x":11.25, "y":4}, + {"label":"Shift", "x":12.25, "y":4, "w":1.75}, + {"label":"\u2191", "x":14, "y":4}, + + {"label":"1", "x":15, "y":4}, + {"label":"2", "x":16, "y":4}, + {"label":"3", "x":17, "y":4}, + + {"label":"Ctrl", "x":0, "y":5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5, "w":1.25}, + {"x":3.75, "y":5, "w":6.25}, + {"label":"Alt", "x":10, "y":5, "w":1.5}, + {"label":"Ctrl", "x":11.5, "y":5, "w":1.5}, + {"label":"\u2190", "x":13, "y":5}, + {"label":"\u2193", "x":14, "y":5}, + {"label":"\u2192", "x":15, "y":5}, + + {"label":"0", "x":16, "y":5}, + {"label":".", "x":17, "y":5}, + {"label":"Enter", "x":18, "y":4, "h":2} + ] + }, + "LAYOUT_96_iso": { + "key_count": 100, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"Insert", "x":13, "y":0}, + {"label":"Delete", "x":14, "y":0}, + {"label":"Home", "x":15, "y":0}, + {"label":"End", "x":16, "y":0}, + {"label":"PgUp", "x":17, "y":0}, + {"label":"PgDn", "x":18, "y":0}, + + {"label":"~", "x":0, "y":1}, + {"label":"!", "x":1, "y":1}, + {"label":"\"", "x":2, "y":1}, + {"label":"\u00a3", "x":3, "y":1}, + {"label":"$", "x":4, "y":1}, + {"label":"%", "x":5, "y":1}, + {"label":"^", "x":6, "y":1}, + {"label":"&", "x":7, "y":1}, + {"label":"*", "x":8, "y":1}, + {"label":"(", "x":9, "y":1}, + {"label":")", "x":10, "y":1}, + {"label":"_", "x":11, "y":1}, + {"label":"+", "x":12, "y":1}, + {"label":"Backspace", "x":13, "y":1, "w":2}, + + {"label":"Num Lock", "x":15, "y":1}, + {"label":"/", "x":16, "y":1}, + {"label":"*", "x":17, "y":1}, + {"label":"-", "x":18, "y":1}, + + {"label":"Tab", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"{", "x":11.5, "y":2}, + {"label":"}", "x":12.5, "y":2}, + + {"label":"7", "x":15, "y":2}, + {"label":"8", "x":16, "y":2}, + {"label":"9", "x":17, "y":2}, + + {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":":", "x":10.75, "y":3}, + {"label":"@", "x":11.75, "y":3}, + {"label":"~", "x":12.75, "y":3}, + {"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, + + {"label":"4", "x":15, "y":3}, + {"label":"5", "x":16, "y":3}, + {"label":"6", "x":17, "y":3}, + {"label":"+", "x":18, "y":2, "h":2}, + + {"label":"Shift", "x":0, "y":4, "w":1.25}, + {"label":"|", "x":1.25, "y":4}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":"<", "x":9.25, "y":4}, + {"label":">", "x":10.25, "y":4}, + {"label":"?", "x":11.25, "y":4}, + {"label":"Shift", "x":12.25, "y":4, "w":1.75}, + {"label":"\u2191", "x":14, "y":4}, + + {"label":"1", "x":15, "y":4}, + {"label":"2", "x":16, "y":4}, + {"label":"3", "x":17, "y":4}, + + {"label":"Ctrl", "x":0, "y":5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5, "w":1.25}, + {"x":3.75, "y":5, "w":6.25}, + {"label":"Alt", "x":10, "y":5, "w":1.5}, + {"label":"Ctrl", "x":11.5, "y":5, "w":1.5}, + {"label":"\u2190", "x":13, "y":5}, + {"label":"\u2193", "x":14, "y":5}, + {"label":"\u2192", "x":15, "y":5}, + + {"label":"0", "x":16, "y":5}, + {"label":".", "x":17, "y":5}, + {"label":"Enter", "x":18, "y":4, "h":2} + ] + } + } +} diff --git a/keyboards/xd96/keymaps/default/keymap.c b/keyboards/xd96/keymaps/default/keymap.c new file mode 100644 index 00000000000..45588f18c4b --- /dev/null +++ b/keyboards/xd96/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +#define L1_RALT LM(1, MOD_RALT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_96_ansi( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┼─────────┼─────────┼─────────┤ */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┼─────────┼─────────┼─────────┤ */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──────────────├─────────├─────────├─────────├ ┤ */ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, +/* ├─────────────────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───────────┬─────────┼─────────┼─────────┼─────────┼─────────┤ */ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, +/* ├───────────┬─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴─────────┴──┬──────┴───────┬─────────┼─────────┼─────────┼─────────┼─────────┼ ┤ */ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, L1_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ), + + [1] = LAYOUT_96_ansi( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──────────────├─────────├─────────├─────────┼ ┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────────────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───────────┬─────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├───────────┬─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴─────────┴──┬──────┴───────┬─────────┼─────────┼─────────┼─────────┼─────────┼ ┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ) +}; diff --git a/keyboards/xd96/keymaps/default_iso/keymap.c b/keyboards/xd96/keymaps/default_iso/keymap.c new file mode 100644 index 00000000000..cdd1f496798 --- /dev/null +++ b/keyboards/xd96/keymaps/default_iso/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +#define L1_RALT LM(1, MOD_RALT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_96_iso( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┼─────────┼─────────┼─────────┤ */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┼─────────┼─────────┼─────────┤ */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬ ├─────────├─────────├─────────├ ┤ */ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, +/* ├───────────┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴─────────┴─┬─────────┼─────────┼─────────┼─────────┼─────────┤ */ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, +/* ├───────────┼─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴─────────┴──┬──────┴───────┬─────────┼─────────┼─────────┼─────────┼─────────┼ ┤ */ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, L1_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ), + + [1] = LAYOUT_96_iso( +/* ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ */ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┴─────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├─────────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬────┴────┬──────────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├──────────────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬──────┴──┬ ├─────────├─────────├─────────┼ ┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├───────────┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴───┬─────┴─────────┴─┬─────────┼─────────┼─────────┼─────────┼─────────┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +/* ├───────────┼─────────┴─┬───────┴───┬─────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┬─┴─────────┴──┬──────┴───────┬─────────┼─────────┼─────────┼─────────┼─────────┼ ┤ */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +/* └───────────┴───────────┴───────────┴───────────────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ */ + ) +}; diff --git a/keyboards/xd96/matrix.c b/keyboards/xd96/matrix.c new file mode 100644 index 00000000000..550dae4d02e --- /dev/null +++ b/keyboards/xd96/matrix.c @@ -0,0 +1,96 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include +#include +#include +#include "matrix.h" +#include "pca9555.h" +#include "quantum.h" + +#include "debug.h" + +// PCA9555 slave addresses +#define IC1 0x20 +#define IC2 0x21 + +//_____Utility funcs___________________________________________________________ + +static void init_pins(void) { + // init all cols high - IC2 all input + pca9555_set_config(IC2, PCA9555_PORT0, ALL_INPUT);//same as initial state + pca9555_set_config(IC2, PCA9555_PORT1, ALL_INPUT);//same as initial state + pca9555_set_config(IC1, PCA9555_PORT1, ALL_INPUT);//same as initial state + + // init all rows - IC1 port0 input + pca9555_set_config(IC1, PCA9555_PORT0, ALL_INPUT);//same as initial state +} + +static void select_row(uint8_t row) { + // For the XD96 all rows are on the same IC and port + // so its safe enough to assume here row == pin + uint8_t pin = row; + uint8_t mask = 1 << pin; + + pca9555_set_output(IC1, PCA9555_PORT0, ALL_HIGH & (~mask)); + pca9555_set_config(IC1, PCA9555_PORT0, ALL_INPUT & (~mask)); +} + +static uint32_t read_cols(void) { + uint32_t state_1 = pca9555_readPins(IC2, PCA9555_PORT0); + uint32_t state_2 = pca9555_readPins(IC2, PCA9555_PORT1); + uint32_t state_3 = pca9555_readPins(IC1, PCA9555_PORT1); + + // For the XD96 the pins are mapped to port expanders as follows: + // all 8 pins port 0 IC2, first 6 pins port 1 IC2, first 4 pins port 1 IC1 + uint32_t state = (((state_3 & 0b00001111) << 14) | ((state_2 & 0b00111111) << 8) | state_1); + return (~state) & 0b111111111111111111; +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + current_matrix[current_row] = read_cols(); + + // No need to Unselect row as the next `select_row` will blank everything + + return (last_row_value != current_matrix[current_row]); +} + +//_____CUSTOM MATRIX IMPLEMENTATION____________________________________________________ + +void custom_matrix_init(void) { + pca9555_init(IC1); + pca9555_init(IC2); + + init_pins(); +} + +bool custom_matrix_scan(matrix_row_t current_matrix[]) { + bool changed = false; + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + changed |= read_cols_on_row(current_matrix, current_row); + } + return changed; +} \ No newline at end of file diff --git a/keyboards/xd96/pca9555.c b/keyboards/xd96/pca9555.c new file mode 100644 index 00000000000..960df4f4e52 --- /dev/null +++ b/keyboards/xd96/pca9555.c @@ -0,0 +1,78 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "i2c_master.h" +#include "pca9555.h" + +#include "debug.h" + +#define SLAVE_TO_ADDR(n) (n<<1) +#define TIMEOUT 100 + +enum { + CMD_INPUT_0 = 0, + CMD_INPUT_1, + CMD_OUTPUT_0, + CMD_OUTPUT_1, + CMD_INVERSION_0, + CMD_INVERSION_1, + CMD_CONFIG_0, + CMD_CONFIG_1 +}; + +void pca9555_init(uint8_t slave_addr) { + static uint8_t s_init = 0; + if (!s_init) { + i2c_init(); + + s_init=1; + } + + // TODO: could check device connected + //i2c_start(SLAVE_TO_ADDR(slave) | I2C_WRITE); + //i2c_stop(); +} + +void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_OUTPUT_1 : CMD_OUTPUT_0; + + i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_set_config::FAILED\n"); + } +} + +void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_CONFIG_1 : CMD_CONFIG_0; + + i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_set_output::FAILED\n"); + } +} + +uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = port ? CMD_INPUT_1 : CMD_INPUT_0; + + uint8_t data = 0; + i2c_status_t ret = i2c_readReg(addr, cmd, &data, sizeof(data), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9555_readPins::FAILED\n"); + } + return data; +} diff --git a/keyboards/xd96/pca9555.h b/keyboards/xd96/pca9555.h new file mode 100644 index 00000000000..6aaee8a6f88 --- /dev/null +++ b/keyboards/xd96/pca9555.h @@ -0,0 +1,55 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +/* + PCA9555 + ,----------. + SDA --| SDA P00 |-- P1 + SCL --| SCL P01 |-- P2 + INT --| INT P02 |-- P3 + | P03 |-- P4 + A0 --| A0 P04 |-- P5 + A1 --| A1 P05 |-- P6 + A2 --| A2 P06 |-- P7 + | P07 |-- P8 + | | + | P10 |-- P10 + | P11 |-- P11 + | P12 |-- P12 + | P13 |-- P13 + | P14 |-- P14 + | P15 |-- P15 + | P16 |-- P16 + | P17 |-- P17 + `----------' +*/ + +#define PCA9555_PORT0 0 +#define PCA9555_PORT1 1 + +#define ALL_OUTPUT 0 +#define ALL_INPUT 0xFF +#define ALL_LOW 0 +#define ALL_HIGH 0xFF + +void pca9555_init(uint8_t slave_addr); + +void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf); + +void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf); + +uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port); \ No newline at end of file diff --git a/keyboards/xd96/readme.md b/keyboards/xd96/readme.md new file mode 100644 index 00000000000..237d7a05165 --- /dev/null +++ b/keyboards/xd96/readme.md @@ -0,0 +1,22 @@ +# XD96 + +![XD96](https://cdn.shopify.com/s/files/1/2711/4238/products/xd96_pcb_1024x1024.jpg?v=1515425370) + +Compact With 96 Keys & RGB LED Underglow +- Designed by Xiudi +- ISO and ANSI support +- Uses Kimera core + +Keyboard Maintainer: QMK Community +Hardware Supported: XD96 +Hardware Availability: [KPrepublic](https://kprepublic.com/products/xd96-pcb-90-custom-mechanical-keyboard-supports-tkg-tools-underglow-rgb-programmed); [AliExpress](https://aliexpress.com/item/cospad-Custom-Mechanical-Keyboard-Kit-up-tp-24-keys-Supports-TKG-TOOLS-Underglow-RGB-PCB-20/32818383873.html) + +Make example for this keyboard (after setting up your build environment): + + make xd96:default + +Install examples: + + make xd96:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/xd96/rules.mk b/keyboards/xd96/rules.mk new file mode 100644 index 00000000000..c9f80447129 --- /dev/null +++ b/keyboards/xd96/rules.mk @@ -0,0 +1,86 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = i2c_master.c custom_matrix_helper.c pca9555.c matrix.c + +EXTRAFLAGS += -flto diff --git a/keyboards/xd96/xd96.c b/keyboards/xd96/xd96.c new file mode 100644 index 00000000000..45cfb3b1f17 --- /dev/null +++ b/keyboards/xd96/xd96.c @@ -0,0 +1,34 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "xd96.h" + +#define CAPS_PIN B6 + +void keyboard_pre_init_kb(void) { + setPinOutput(CAPS_PIN); + + keyboard_pre_init_user(); +} + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(CAPS_PIN); + } else { + writePinHigh(CAPS_PIN); + } + + led_set_user(usb_led); +} diff --git a/keyboards/xd96/xd96.h b/keyboards/xd96/xd96.h new file mode 100644 index 00000000000..04c2cc46e2e --- /dev/null +++ b/keyboards/xd96/xd96.h @@ -0,0 +1,59 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" +#define ____ KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_96_ansi( \ + K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, K219, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K316, K317, K318, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, K416, K417, K418, K419, \ + K501, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, K517, K518, \ + K601, K602, K603, K607, K611, K612, K614, K615, K616, K617, K618, K619 \ +) { \ + { K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K116, K117, K118, K119 }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, K219 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K316, K317, K318, K419 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, ____, K414, K416, K417, K418, ____ }, \ + { K501, ____, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, K517, K518, K619 }, \ + { K601, K602, K603, ____, ____, K607, K115, ____, K612, ____, K611, K612, K614, K615, K616, K617, K618, ____ } \ +} + +#define LAYOUT_96_iso( \ + K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ + K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, K219, \ + K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K316, K317, K318, \ + K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, K415, K416, K417, K418, K419, \ + K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, K517, K518, \ + K601, K602, K603, K607, K611, K612, K614, K615, K616, K617, K618, K619 \ +) { \ + { K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K116, K117, K118, K119 }, \ + { K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, K219 }, \ + { K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, ____, K316, K317, K318, K419 }, \ + { K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, K415, K416, K417, K418, ____ }, \ + { K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K515, K516, K517, K518, K619 }, \ + { K601, K602, K603, ____, ____, K607, K115, ____, K612, ____, K611, K612, K614, K615, K616, K617, K618, ____ } \ +} diff --git a/keyboards/xmmx/config.h b/keyboards/xmmx/config.h index 8cb2cf82df9..bee047bf053 100644 --- a/keyboards/xmmx/config.h +++ b/keyboards/xmmx/config.h @@ -30,7 +30,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +38,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/xmmx/info.json b/keyboards/xmmx/info.json new file mode 100644 index 00000000000..28bd06bbf98 --- /dev/null +++ b/keyboards/xmmx/info.json @@ -0,0 +1,475 @@ +{ + "keyboard_name": "XMMX", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "key_count": 96, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Back Space", "x":13, "y":1.5}, + {"label":"Back Space", "x":14, "y":1.5}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, + {"x":15.25, "y":3.5}, + {"x":16.25, "y":3.5}, + {"x":17.25, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Fn", "x":14, "y":4.5}, + {"x":15.25, "y":4.5}, + {"label":"Up", "x":16.25, "y":4.5}, + {"x":17.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi": { + "key_count": 87, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi_wkl": { + "key_count": 84, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, + {"label":"Space", "x":4, "y":5.5, "w":7}, + {"label":"Alt", "x":11, "y":5.5, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_iso": { + "key_count": 88, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"\u00ac", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"\"", "x":2, "y":1.5}, + {"label":"\u00a3", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"@", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_iso_wkl": { + "key_count": 85, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"\u00ac", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"\"", "x":2, "y":1.5}, + {"label":"\u00a3", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"@", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, + {"label":"Space", "x":4, "y":5.5, "w":7}, + {"label":"AltGr", "x":11, "y":5.5, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + } + } +} + diff --git a/keyboards/xmmx/keymaps/ansi_wk/keymap.c b/keyboards/xmmx/keymaps/ansi_wk/keymap.c index abdba99ba79..213f65a4a26 100644 --- a/keyboards/xmmx/keymaps/ansi_wk/keymap.c +++ b/keyboards/xmmx/keymaps/ansi_wk/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_ansi_wk( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/keymaps/ansi_wkl/keymap.c b/keyboards/xmmx/keymaps/ansi_wkl/keymap.c index aeb61ff2cab..d566f1a2101 100644 --- a/keyboards/xmmx/keymaps/ansi_wkl/keymap.c +++ b/keyboards/xmmx/keymaps/ansi_wkl/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_ansi_wkl( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + LAYOUT_tkl_ansi_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/keymaps/default/keymap.c b/keyboards/xmmx/keymaps/default/keymap.c index a7522fe25a2..a4c38cd54ee 100644 --- a/keyboards/xmmx/keymaps/default/keymap.c +++ b/keyboards/xmmx/keymaps/default/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_all( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, KC_ENT, KC_NO, KC_NO, KC_NO, \ KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_NO, KC_UP, KC_NO, \ KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/keymaps/iso_wk/keymap.c b/keyboards/xmmx/keymaps/iso_wk/keymap.c index 882cb224a60..a71795ccf0a 100644 --- a/keyboards/xmmx/keymaps/iso_wk/keymap.c +++ b/keyboards/xmmx/keymaps/iso_wk/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_iso_wk( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + LAYOUT_tkl_iso( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, KC_ENT, \ KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/keymaps/iso_wkl/keymap.c b/keyboards/xmmx/keymaps/iso_wkl/keymap.c index 18ba79e1f95..d40257177dd 100644 --- a/keyboards/xmmx/keymaps/iso_wkl/keymap.c +++ b/keyboards/xmmx/keymaps/iso_wkl/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_iso_wkl( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + LAYOUT_tkl_iso_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL, KC_BSPC, KC_INS,KC_HOME, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, KC_ENT, \ KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/readme.md b/keyboards/xmmx/readme.md index 8f94df4b92f..51775f24149 100644 --- a/keyboards/xmmx/readme.md +++ b/keyboards/xmmx/readme.md @@ -1,14 +1,14 @@ # XMMX -XMMX: Tenkeyless Mechanical Keyboard PCB designed to fit Filco Majestouch TKL and Cooler Master Quickfire Rapid cases +XMMX is a Tenkeyless Mechanical Keyboard PCB designed to fit Filco Majestouch TKL and Cooler Master Quickfire Rapid cases. -XMMX schematic and PCB are available opensource under Creative Commons BY-SA 3.0 license on EasyEDA at [this link](https://easyeda.com/farmakon/XMMX-0447d28c1e4644b88fd04905d983684d) +XMMX schematic and PCB are available opensource under Creative Commons BY-SA 3.0 license on EasyEDA at [this link](https://easyeda.com/farmakon/XMMX-0447d28c1e4644b88fd04905d983684d). -For more informations on the XMMX please visit this [geekhack.org thread](https://geekhack.org/index.php?topic=93422.0) +For more informations on the XMMX please visit [this geekhack.org thread](https://geekhack.org/index.php?topic=93422.0). -Make examples for these keyboards (after setting up your build environment): +Make example for this keyboard (after setting up your build environment): make xmmx:default +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/xmmx/xmmx.h b/keyboards/xmmx/xmmx.h index 22d0f1480d8..82c3fb5882a 100644 --- a/keyboards/xmmx/xmmx.h +++ b/keyboards/xmmx/xmmx.h @@ -1,5 +1,4 @@ -#ifndef XMMX -#define XMMX +#pragma once #include "quantum.h" @@ -21,7 +20,7 @@ } // 80% keyboard: ANSI Winkey -#define LAYOUT_ansi_wk( \ +#define LAYOUT_tkl_ansi( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ @@ -38,7 +37,7 @@ } // 80% keyboard: ANSI Winkeyless -#define LAYOUT_ansi_wkl( \ +#define LAYOUT_tkl_ansi_wkl( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ @@ -55,7 +54,7 @@ } // 80% keyboard: ISO Winkey -#define LAYOUT_iso_wk( \ +#define LAYOUT_tkl_iso( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, \ @@ -72,7 +71,7 @@ } // 80% keyboard: ISO Winkeyless -#define LAYOUT_iso_wkl( \ +#define LAYOUT_tkl_iso_wkl( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, \ @@ -88,4 +87,3 @@ { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513, K514, K515, K516 } \ } -#endif diff --git a/keyboards/xw60/config.h b/keyboards/xw60/config.h new file mode 100644 index 00000000000..95404fffbcb --- /dev/null +++ b/keyboards/xw60/config.h @@ -0,0 +1,36 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Drclick +#define PRODUCT XW60 +#define DESCRIPTION qmk keyboard firmware for XW60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ + +#define SOLENOID_PIN F6 +#define SOLENOID_ACTIVE true +#define SOLENOID_DEFAULT_DWELL 75 diff --git a/keyboards/xw60/info.json b/keyboards/xw60/info.json new file mode 100644 index 00000000000..9a44f5588c3 --- /dev/null +++ b/keyboards/xw60/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "XW60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"K00", "x":0, "y":0}, {"label":"K01", "x":1, "y":0}, {"label":"K02", "x":2, "y":0}, {"label":"K03", "x":3, "y":0}, {"label":"K04", "x":4, "y":0}, {"label":"K05", "x":5, "y":0}, {"label":"K06", "x":6, "y":0}, {"label":"K07", "x":7, "y":0}, {"label":"K08", "x":8, "y":0}, {"label":"K09", "x":9, "y":0}, {"label":"K0A", "x":10, "y":0}, {"label":"K0B", "x":11, "y":0}, {"label":"K0C", "x":12, "y":0}, {"label":"K0D", "x":13, "y":0}, {"label":"K49", "x":14, "y":0}, {"label":"K10", "x":0, "y":1, "w":1.5}, {"label":"K11", "x":1.5, "y":1}, {"label":"K12", "x":2.5, "y":1}, {"label":"K13", "x":3.5, "y":1}, {"label":"K14", "x":4.5, "y":1}, {"label":"K15", "x":5.5, "y":1}, {"label":"K16", "x":6.5, "y":1}, {"label":"K17", "x":7.5, "y":1}, {"label":"K18", "x":8.5, "y":1}, {"label":"K19", "x":9.5, "y":1}, {"label":"K1A", "x":10.5, "y":1}, {"label":"K1B", "x":11.5, "y":1}, {"label":"K1C", "x":12.5, "y":1}, {"label":"K1D", "x":13.5, "y":1, "w":1.5}, {"label":"K20", "x":0, "y":2, "w":1.75}, {"label":"K21", "x":1.75, "y":2}, {"label":"K22", "x":2.75, "y":2}, {"label":"K23", "x":3.75, "y":2}, {"label":"K24", "x":4.75, "y":2}, {"label":"K25", "x":5.75, "y":2}, {"label":"K26", "x":6.75, "y":2}, {"label":"K27", "x":7.75, "y":2}, {"label":"K28", "x":8.75, "y":2}, {"label":"K29", "x":9.75, "y":2}, {"label":"K2A", "x":10.75, "y":2}, {"label":"K2B", "x":11.75, "y":2}, {"label":"K2C", "x":12.75, "y":2}, {"label":"K2D", "x":13.75, "y":2, "w":1.25}, {"label":"K30", "x":0, "y":3, "w":1.25}, {"label":"K31", "x":1.25, "y":3}, {"label":"K32", "x":2.25, "y":3}, {"label":"K33", "x":3.25, "y":3}, {"label":"K34", "x":4.25, "y":3}, {"label":"K35", "x":5.25, "y":3}, {"label":"K36", "x":6.25, "y":3}, {"label":"K37", "x":7.25, "y":3}, {"label":"K38", "x":8.25, "y":3}, {"label":"K39", "x":9.25, "y":3}, {"label":"K3A", "x":10.25, "y":3}, {"label":"K3B", "x":11.25, "y":3}, {"label":"K3D", "x":12.25, "y":3, "w":1.75}, {"label":"K3C", "x":14, "y":3}, {"label":"K40", "x":0, "y":4, "w":1.25}, {"label":"K41", "x":1.25, "y":4, "w":1.25}, {"label":"K42", "x":2.5, "y":4, "w":1.25}, {"label":"K44", "x":3.75, "y":4, "w":2}, {"label":"K45", "x":5.75, "y":4, "w":2.25}, {"label":"K46", "x":8, "y":4, "w":2}, {"label":"K4A", "x":10, "y":4, "w":1.25}, {"label":"K4B", "x":11.25, "y":4, "w":1.25}, {"label":"K4C", "x":12.5, "y":4, "w":1.25}, {"label":"K4D", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_pingjunior": { + "layout": [{"label":"K00", "x":0, "y":0}, {"label":"K01", "x":1, "y":0}, {"label":"K02", "x":2, "y":0}, {"label":"K03", "x":3, "y":0}, {"label":"K04", "x":4, "y":0}, {"label":"K05", "x":5, "y":0}, {"label":"K06", "x":6, "y":0}, {"label":"K07", "x":7, "y":0}, {"label":"K08", "x":8, "y":0}, {"label":"K09", "x":9, "y":0}, {"label":"K0A", "x":10, "y":0}, {"label":"K0B", "x":11, "y":0}, {"label":"K0C", "x":12, "y":0}, {"label":"K0D", "x":13, "y":0}, {"label":"K49", "x":14, "y":0}, {"label":"K10", "x":0, "y":1, "w":1.5}, {"label":"K11", "x":1.5, "y":1}, {"label":"K12", "x":2.5, "y":1}, {"label":"K13", "x":3.5, "y":1}, {"label":"K14", "x":4.5, "y":1}, {"label":"K15", "x":5.5, "y":1}, {"label":"K16", "x":6.5, "y":1}, {"label":"K17", "x":7.5, "y":1}, {"label":"K18", "x":8.5, "y":1}, {"label":"K19", "x":9.5, "y":1}, {"label":"K1A", "x":10.5, "y":1}, {"label":"K1B", "x":11.5, "y":1}, {"label":"K1C", "x":12.5, "y":1}, {"label":"K1D", "x":13.5, "y":1, "w":1.5}, {"label":"K20", "x":0, "y":2, "w":1.75}, {"label":"K21", "x":1.75, "y":2}, {"label":"K22", "x":2.75, "y":2}, {"label":"K23", "x":3.75, "y":2}, {"label":"K24", "x":4.75, "y":2}, {"label":"K25", "x":5.75, "y":2}, {"label":"K26", "x":6.75, "y":2}, {"label":"K27", "x":7.75, "y":2}, {"label":"K28", "x":8.75, "y":2}, {"label":"K29", "x":9.75, "y":2}, {"label":"K2A", "x":10.75, "y":2}, {"label":"K2B", "x":11.75, "y":2}, {"label":"K2C", "x":12.75, "y":2}, {"label":"K2D", "x":13.75, "y":2, "w":1.25}, {"label":"K31", "x":0, "y":3, "w":2.25}, {"label":"K32", "x":2.25, "y":3}, {"label":"K33", "x":3.25, "y":3}, {"label":"K34", "x":4.25, "y":3}, {"label":"K35", "x":5.25, "y":3}, {"label":"K36", "x":6.25, "y":3}, {"label":"K37", "x":7.25, "y":3}, {"label":"K38", "x":8.25, "y":3}, {"label":"K39", "x":9.25, "y":3}, {"label":"K3A", "x":10.25, "y":3}, {"label":"K3B", "x":11.25, "y":3}, {"label":"K3D", "x":12.25, "y":3, "w":1.75}, {"label":"K3C", "x":14, "y":3}, {"label":"K40", "x":0, "y":4, "w":1.5}, {"label":"K41", "x":1.5, "y":4}, {"label":"K42", "x":2.5, "y":4, "w":1.5}, {"label":"K45", "x":4, "y":4, "w":7}, {"label":"K4B", "x":11, "y":4, "w":1.5}, {"label":"K4C", "x":12.5, "y":4}, {"label":"K4D", "x":13.5, "y":4, "w":1.5}] + } + } + } + + + diff --git a/keyboards/xw60/keymaps/default/keymap.c b/keyboards/xw60/keymaps/default/keymap.c new file mode 100644 index 00000000000..1a4d7fb3da5 --- /dev/null +++ b/keyboards/xw60/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* 0: defuault */ + LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NO, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(3), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + ), + /* 1: winkeyless */ + LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NO, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(3), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_NO, KC_RALT, KC_RGUI, KC_RCTL + ), + /* 2: hhkb */ + LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(3), + KC_NO, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_NO, KC_RALT, KC_RGUI, KC_NO + ), + /* 3: fn */ + LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, HPT_TOG,HPT_DWLI,HPT_DWLD, _______, _______, KC_DOWN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; diff --git a/keyboards/xw60/keymaps/default/readme.md b/keyboards/xw60/keymaps/default/readme.md new file mode 100644 index 00000000000..0e146718a4e --- /dev/null +++ b/keyboards/xw60/keymaps/default/readme.md @@ -0,0 +1,58 @@ +# The default keymap for xw60 + + ### layer 0 - default + ``` + .--------------------------------------------------------------------------. + | esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bksp | + |--------------------------------------------------------------------------| + | tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + |--------------------------------------------------------------------------| + | caps | A | S | D | F | G | H | J | K | L | ; | ' | \ |enter| + |--------------------------------------------------------------------------| + | sft | nubs| Z | X | C | V | B | N | M | , | . | / | shift | fn | + |--------------------------------------------------------------------------| + | ctrl| gui | alt | space / space / space | alt | gui | app | ctrl| + '--------------------------------------------------------------------------' + ``` + ### layer 1 - winkeyless + ``` + .--------------------------------------------------------------------------. + | esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bksp | + |--------------------------------------------------------------------------| + | tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + |--------------------------------------------------------------------------| + | caps | A | S | D | F | G | H | J | K | L | ; | ' | \ |enter| + |--------------------------------------------------------------------------| + | sft | nubs| Z | X | C | V | B | N | M | , | . | / | shift | fn | + |--------------------------------------------------------------------------| + | ctrl | gui| alt | space | alt | gui| ctrl | + '--------------------------------------------------------------------------' + ``` + ### layer 2 - hhkb + ``` + .--------------------------------------------------------------------------. + | esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + |--------------------------------------------------------------------------| + | tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | bksp | + |--------------------------------------------------------------------------| + | ctrl | A | S | D | F | G | H | J | K | L | ; | ' |pent|enter| + |--------------------------------------------------------------------------| + | shift | Z | X | C | V | B | N | M | , | . | / | rshift | fn | + '--------------------------------------------------------------------------' + | alt| gui | space | gui | alt| + '------------------------------------------------------------' + ``` + ### layer 3 - fn + ``` + ,--------------------------------------------------------------------------. + | | f1 | f2 | f3 | f4 | f5 | f6 | f7 | f8 | f9 | f10| f11| f12| ins| del| + |--------------------------------------------------------------------------| + | caps | | up | | | | | | | | | up | | del | + |--------------------------------------------------------------------------| + | |left|down|rght| | | | | | |left|rght| | | + |--------------------------------------------------------------------------| + | | | | | |buzz| + | - | | |down| | | + |--------------------------------------------------------------------------| + | | | | | | | | + '--------------------------------------------------------------------------' + ``` \ No newline at end of file diff --git a/keyboards/xw60/keymaps/pingjunior/keymap.c b/keyboards/xw60/keymaps/pingjunior/keymap.c new file mode 100644 index 00000000000..51767b56f0a --- /dev/null +++ b/keyboards/xw60/keymaps/pingjunior/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* 0: default */ + LAYOUT_pingjunior( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_PENT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(2), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + /* 1: hhkb */ + LAYOUT_pingjunior( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_PENT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(2), + KC_NO, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_NO + ), + /* 2: fn */ + LAYOUT_pingjunior( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, HPT_TOG,HPT_DWLI,HPT_DWLD, _______, _______, KC_DOWN, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ), + +}; diff --git a/keyboards/xw60/keymaps/pingjunior/readme.md b/keyboards/xw60/keymaps/pingjunior/readme.md new file mode 100644 index 00000000000..0943a88a955 --- /dev/null +++ b/keyboards/xw60/keymaps/pingjunior/readme.md @@ -0,0 +1,44 @@ +# The default keymap for pingjunior + + ### layer 0 - default + ``` + .--------------------------------------------------------------------------. + | esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` |bksp| + |--------------------------------------------------------------------------| + | tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + |--------------------------------------------------------------------------| + | caps | A | S | D | F | G | H | J | K | L | ; | ' |pent|enter| + |--------------------------------------------------------------------------| + | shift | Z | X | C | V | B | N | M | , | . | / | shift | fn | + |--------------------------------------------------------------------------| + | ctrl | gui| alt | space | alt | gui/ ctrl | + '--------------------------------------------------------------------------' + ``` + ### layer 1 - hhkb + ``` + .--------------------------------------------------------------------------. + | esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + |--------------------------------------------------------------------------| + | tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | bksp | + |--------------------------------------------------------------------------| + | ctrl | A | S | D | F | G | H | J | K | L | ; | ' |pent|enter| + |--------------------------------------------------------------------------| + | shift | Z | X | C | V | B | N | M | , | . | / | shift | fn | + '--------------------------------------------------------------------------' + | alt| gui | space | gui | alt| + '------------------------------------------------------------' + ``` + ### layer 2 - fn + ``` + ,--------------------------------------------------------------------------. + | | f1 | f2 | f3 | f4 | f5 | f6 | f7 | f8 | f9 | f10| f11| f12| ins| del| + |--------------------------------------------------------------------------| + | caps | | up | | | | | | | | | up | | del | + |--------------------------------------------------------------------------| + | |left|down|rght| | | | | | |left|rght| | | + |--------------------------------------------------------------------------| + | | | | | |buzz| + | - | | |down| | | + |--------------------------------------------------------------------------| + | | | | | | | | + '--------------------------------------------------------------------------' + ``` \ No newline at end of file diff --git a/keyboards/xw60/readme.md b/keyboards/xw60/readme.md new file mode 100644 index 00000000000..c2e0ce0eea5 --- /dev/null +++ b/keyboards/xw60/readme.md @@ -0,0 +1,29 @@ +# XW60 + +A 60% custom PCB for non-MX switches. + +![XW60V1 PCB](https://i.imgur.com/1KVSEZ0.jpg) + +### Supported Switches: + +##### XW60 V1 + + - ALPS SKCM/SKCL + - ALPS SKCP (IBM 5576 version) + - SMK SECOND GENERATION + +##### XW60 V2 + + - ALPS SKCM/SKCL + - ALPS SKCC + - Omron B3G-S + +Keyboard Maintainer: [Drclick](https://github.com/itsdrdick) +Hardware Supported: XW60 V1 & V2 +Hardware Availability: https://shop159471890.taobao.com + +Make example for this keyboard (after setting up your build environment): + + make xw60:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/xw60/rules.mk b/keyboards/xw60/rules.mk new file mode 100644 index 00000000000..01435ee5449 --- /dev/null +++ b/keyboards/xw60/rules.mk @@ -0,0 +1,67 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no +HAPTIC_ENABLE += SOLENOID +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/xw60/xw60.c b/keyboards/xw60/xw60.c new file mode 100644 index 00000000000..98ae6a758ba --- /dev/null +++ b/keyboards/xw60/xw60.c @@ -0,0 +1 @@ +#include "xw60.h" \ No newline at end of file diff --git a/keyboards/xw60/xw60.h b/keyboards/xw60/xw60.h new file mode 100644 index 00000000000..52be45258ab --- /dev/null +++ b/keyboards/xw60/xw60.h @@ -0,0 +1,60 @@ +#pragma once + +#include "quantum.h" + +#define XXX KC_NO + +/* + * ,-----------------------------------------------------------------------------------------. + * | K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | K49 | + * |-----------------------------------------------------------------------------------------+ + * | K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | + * |-----------------------------------------------------------------------------------------+ + * | K20 | K21 | K22 | K23 | K24 | K25 | K26 | K17 | K28 | K29 | K2A | K2B | K2C | K2D | + * |-----------------------------------------------------------------------------------------+ + * | K30 | K31 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3D | K3C | + * |-----------------------------------------------------------------------------------------+ + * | K40 | K41 | K42 | | K44 | K45 | K46 | | K4A | K4B | K4C | K4D | + * `-----------------------------------------------------------------------------------------' + */ +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ + K40, K41, K42, K44, K45, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, XXX, K44, K45, K46, XXX, XXX, K49, K4A, K4B, K4C, K4D } \ +} + +/* + * ,-----------------------------------------------------------------------------------------. + * | K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | K49 | + * |-----------------------------------------------------------------------------------------+ + * | K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | + * |-----------------------------------------------------------------------------------------+ + * | K20 | K21 | K22 | K23 | K24 | K25 | K26 | K17 | K28 | K29 | K2A | K2B | K2C | K2D | + * |-----------------------------------------------------------------------------------------+ + * | K31 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3D | K3C | + * |-----------------------------------------------------------------------------------------+ + * | K40 | K41 | K42 | K45 | K4B | K4C | K4D | + * `-----------------------------------------------------------------------------------------' + */ +#define LAYOUT_pingjunior( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ + K40, K41, K42, K45, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { XXX, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, XXX, K4B, K4C, K4D } \ +} + diff --git a/keyboards/yd60mq/config.h b/keyboards/yd60mq/config.h new file mode 100644 index 00000000000..75e697802b5 --- /dev/null +++ b/keyboards/yd60mq/config.h @@ -0,0 +1,46 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER YMDK +#define PRODUCT YD60MQ +#define DESCRIPTION Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, F7, B5, B4, D7, D6, B3, B2 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 5 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* prevent stuck modifiers */ + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/yd60mq/keymaps/default/keymap.c b/keyboards/yd60mq/keymaps/default/keymap.c new file mode 100644 index 00000000000..a5a0145eec9 --- /dev/null +++ b/keyboards/yd60mq/keymaps/default/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_NUHS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL, + KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + LAYOUT( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + KC_TRNS, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} diff --git a/keyboards/yd60mq/keymaps/krusli/keymap.c b/keyboards/yd60mq/keymaps/krusli/keymap.c new file mode 100644 index 00000000000..d9c2765659b --- /dev/null +++ b/keyboards/yd60mq/keymaps/krusli/keymap.c @@ -0,0 +1,19 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, KC_RSFT, MO(1), + KC_LCTL, KC_LALT, KC_LGUI, _______, KC_SPC, _______, _______, KC_RALT, _______, KC_RGUI, KC_RCTL), + + LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, RESET, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, _______, + _______, KC_NO, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + +}; diff --git a/keyboards/yd60mq/readme.md b/keyboards/yd60mq/readme.md new file mode 100644 index 00000000000..78f442d8892 --- /dev/null +++ b/keyboards/yd60mq/readme.md @@ -0,0 +1,20 @@ +YD60MQ +====== + +![YD60MQ PCB](https://ae01.alicdn.com/kf/HTB1PVQ2X_HuK1RkSndVq6xVwpXaO.jpg) + +Customizable 60% PCB by [YMDK](https://ymdk.aliexpress.com/store/429151?spm=2114.10010108.0.0.3ab23641lIkgzm). + +Keyboard Maintainer: QMK Community +Hardware Supported: YD60MQ +Hardware Availability: YMDK - [AliExpress](https://www.aliexpress.com/item/YMDK-60-YD60MQ-QMK-Programmable-Underglow-RGB-Led-PCB-Plate-Stabilizers-For-DIY-Mechanical-Keyboard-Interchange/32869207240.html) + +Make example for this keyboard (after setting up your build environment): + + make yd60mq:default + +The keyboard uses a DFU bootloader. To make a keymap and use dfu-util to flash it: + + make yd60mq:default:dfu + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/yd60mq/rules.mk b/keyboards/yd60mq/rules.mk new file mode 100644 index 00000000000..2a896301169 --- /dev/null +++ b/keyboards/yd60mq/rules.mk @@ -0,0 +1,61 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes diff --git a/keyboards/yd60mq/yd60mq.c b/keyboards/yd60mq/yd60mq.c new file mode 100644 index 00000000000..96306d6a660 --- /dev/null +++ b/keyboards/yd60mq/yd60mq.c @@ -0,0 +1,13 @@ +#include "yd60mq.h" + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + setPinOutput(F4); + writePinLow(F4); + } else { + setPinInput(F4); + writePinLow(F4); + } + + led_set_user(usb_led); +} diff --git a/keyboards/yd60mq/yd60mq.h b/keyboards/yd60mq/yd60mq.h new file mode 100644 index 00000000000..5f5d8a2422c --- /dev/null +++ b/keyboards/yd60mq/yd60mq.h @@ -0,0 +1,18 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K403, K407, K408, K409, K410, K411, K412, K413 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, K403, KC_NO, KC_NO, KC_NO, K407, K408, K409, K410, K411, K412, K413, KC_NO } \ +} + diff --git a/keyboards/yd68/config.h b/keyboards/yd68/config.h index 1b4d7f7a133..17461c5dc31 100644 --- a/keyboards/yd68/config.h +++ b/keyboards/yd68/config.h @@ -45,7 +45,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { B6, F7, F6, F5, F4, F1, F0, E6, B0, B7, D0, D1, D2, D3, D5 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 @@ -62,7 +62,7 @@ along with this program. If not, see . #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST @@ -112,11 +112,6 @@ along with this program. If not, see . * */ -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -221,4 +216,3 @@ along with this program. If not, see . #define LCD_E_PIN 1 //< pin for Enable line #endif */ - diff --git a/keyboards/yd68/rules.mk b/keyboards/yd68/rules.mk index 197402e8ab6..2a18c0015db 100644 --- a/keyboards/yd68/rules.mk +++ b/keyboards/yd68/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/ymd75/README.md b/keyboards/ymd75/README.md index 6b1bce6a5b3..d1c4e95ae7b 100644 --- a/keyboards/ymd75/README.md +++ b/keyboards/ymd75/README.md @@ -25,7 +25,7 @@ $ make ymd75:default:program It should detect the keyboard and set it to bootloader mode automatically, prior to flashing firmware. I've found that I need to remove the previous build/file before making a new one as it doesn't overwrite it; but this might just be my personal experience. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Note that this is a complete replacement for the firmware, so you won't be using Bootmapper Client to change any keyboard settings, since not all the @@ -37,7 +37,7 @@ $ brew cask install crosspack-avr $ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb ``` -In order to use the `./program` script, which can reboot the board into +In order to use the `./util/atmega32a_program.py` script, which can reboot the board into the bootloader, you'll need Python 2 with PyUSB installed: ``` diff --git a/keyboards/ymd75/config.h b/keyboards/ymd75/config.h index 748f43f26eb..36031eebf5d 100644 --- a/keyboards/ymd75/config.h +++ b/keyboards/ymd75/config.h @@ -48,7 +48,4 @@ along with this program. If not, see . #define NO_UART 1 #define BOOTLOADHID_BOOTLOADER 1 -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - #endif diff --git a/keyboards/ymd75/program b/keyboards/ymd75/program deleted file mode 100644 index a88d9cd9b04..00000000000 --- a/keyboards/ymd75/program +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from __future__ import print_function - -import os -import sys -import time -import usb - -if len(sys.argv) < 2: - print('Usage: %s ' % sys.argv[0]) - sys.exit(1) - -print('Searching for ps2avrGB... ', end='') - -dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D) -if dev is None: - raise ValueError('Device not found') - -print('Found', end='\n\n') - -print('Device Information:') -print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) -print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) -print('Manufacturer: %s' % (dev.iManufacturer)) -print('Serial: %s' % (dev.iSerialNumber)) -print('Product: %s' % (dev.iProduct), end='\n\n') - -print('Transferring control to bootloader... ', end='') - -dev.set_configuration() - -request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - -USBRQ_HID_SET_REPORT = 0x09 -HID_REPORT_OPTION = 0x0301 - - -try: - dev.ctrl_transfer( - request_type, - USBRQ_HID_SET_REPORT, - HID_REPORT_OPTION, - 0, - [0, 0, 0xFF] + [0] * 5 - ) -except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - -# wait a bit until bootloader starts up -time.sleep(2) - -print('OK') -print('Programming...') -if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0: - print('\nDone!') diff --git a/keyboards/ymd75/rules.mk b/keyboards/ymd75/rules.mk index c9baf131672..9d09d3da94b 100644 --- a/keyboards/ymd75/rules.mk +++ b/keyboards/ymd75/rules.mk @@ -57,10 +57,6 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend CUSTOM_MATRIX = yes SRC = matrix.c i2c.c backlight.c -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # programming options -PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/ymd96/config.h b/keyboards/ymd96/config.h index 1e9497fac69..51d42603dcb 100644 --- a/keyboards/ymd96/config.h +++ b/keyboards/ymd96/config.h @@ -54,7 +54,4 @@ along with this program. If not, see . #define NO_UART 1 #define BOOTLOADHID_BOOTLOADER 1*/ -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - #endif diff --git a/keyboards/ymd96/info.json b/keyboards/ymd96/info.json new file mode 100644 index 00000000000..73edfd894f0 --- /dev/null +++ b/keyboards/ymd96/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "ymd96", + "url": "", + "maintainer": "sparkyman215", + + "width": 19, + "height": 6, + "layouts": { + "LAYOUT_default": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Print Screen", "x":13, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15, "y":0}, {"label":"Insert", "x":16, "y":0}, {"label":"Delete", "x":17, "y":0}, {"label":"Page Up", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"PgDn", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"+", "x":18, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "y":3},{"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":2.75}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Fn", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"\u2190", "x":12, "y":5}, {"label":"\u2193", "x":13, "y":5}, {"label":"\u2191", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}] + }, + "LAYOUT_custom": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Print Screen", "x":13, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15, "y":0}, {"label":"Insert", "x":16, "y":0}, {"label":"Delete", "x":17, "y":0}, {"label":"Page Up", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"PgDn", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"-", "x":18, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"Fn", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Menu", "x":11, "y":5}, {"label":"Prnt Scr", "x":12, "y":5}, {"label":"Ctrl", "x":13, "y":5}, {"label":"Scroll Lock", "x":14, "y":5}, {"label":"0", "x":15, "y":5, "w":2}, {"label":".", "x":17, "y":5}] + }, + "LAYOUT_iso": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Home", "x":14, "y":0}, {"label":"End", "x":15, "y":0}, {"label":"Insert", "x":16, "y":0}, {"label":"Delete", "x":17, "y":0}, {"label":"PgUp", "x":18, "y":0}, {"label":"\u00ac", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"\"", "x":2, "y":1}, {"label":"\u00a3", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"PgDn", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"-", "x":18, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"@", "x":11.75, "y":3}, {"label":"~", "x":12.75, "y":3}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"label":"|", "x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"Up", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"AltGr", "x":10, "y":5, "w":1.5}, {"label":"Win", "x":11.5, "y":5, "w":1.5}, {"label":"Left", "x":13, "y":5}, {"label":"Down", "x":14, "y":5}, {"label":"Right", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}] + } + } +} \ No newline at end of file diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/config.h b/keyboards/ymd96/keymaps/AnthonyWharton/config.h index 715e2c9a5fd..e730e99b273 100644 --- a/keyboards/ymd96/keymaps/AnthonyWharton/config.h +++ b/keyboards/ymd96/keymaps/AnthonyWharton/config.h @@ -57,7 +57,3 @@ along with this program. If not, see . #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM #define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 #define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 500 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - diff --git a/keyboards/ymd96/keymaps/JJ50/keymap.c b/keyboards/ymd96/keymaps/JJ50/keymap.c deleted file mode 100644 index b70433ee1df..00000000000 --- a/keyboards/ymd96/keymaps/JJ50/keymap.c +++ /dev/null @@ -1,96 +0,0 @@ -/* -Base Copyright 2017 Luiz Ribeiro -Modified 2017 Andrew Novak -Modified 2018 Wayne Jones (WarmCatUK) - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public LicensezZZ -along with this program. If not, see . -*/ - -#include "ymd96.h" -#include "action_layer.h" -#include "rgblight.h" - -#define ______ KC_TRNS -#define _DEFLT 0 -#define _RAISE 1 -#define _LOWER 2 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------. - * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_DEFLT] = LAYOUT_jj50( \ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT),\ - _______, KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC,KC_SPC, MO(_RAISE),KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - - /* Raise - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | [ | ] | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | |ISO # |ISO / | PUP | PDN | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_RAISE] = LAYOUT_jj50( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, _______, _______, _______, _______, _______, _______, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - - /* Lower - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | { | } | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | |ISO ~ |ISO | | HOM | END | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_LOWER] = LAYOUT_jj50( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, _______, _______, _______, _______, _______, _______,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ) - -}; diff --git a/keyboards/ymd96/keymaps/default/keymap.c b/keyboards/ymd96/keymaps/default/keymap.c index 9d0a8261dc0..0b8b98157d5 100644 --- a/keyboards/ymd96/keymaps/default/keymap.c +++ b/keyboards/ymd96/keymaps/default/keymap.c @@ -16,49 +16,47 @@ You should have received a copy of the GNU General Public LicensezZZ along with this program. If not, see . */ -#include "ymd96.h" -#include "action_layer.h" -#include "rgblight.h" +#include QMK_KEYBOARD_H -#define ______ KC_TRNS -#define _DEFLT 0 -#define _RAISE 1 - -#define KEYMAP KEYMAP_DEFAULT +enum layer_names { + _DEFAULT, + _RAISE, +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Layer 0, default layer - * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |Print | Home | End |Insert|Delete| PgUp | 19 keys - * | ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BkSpc |NumLck| / | * | PgDn | 18 keys - * | Tab | Q | W | E | R | T | Y | U | I | O | P | { | } | \ | 7 | 8 | 9 | - | 18 keys - * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Return | 4 | 5 | 6 | + | 17 keys - * | LShft | Z | X | C | V | B | N | M | , | . | / | RShft | 1 | 2 | 3 | En | 16 keys - * | Ctrl | Win | Alt | Space | Fn | Win | Left | Down | Up | Right| 0 | . | | 12 keys - */ - - [_DEFLT] = KEYMAP( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END, KC_INSERT, KC_DELETE, KC_PGUP, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_PGDN, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, MO(_RAISE), KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_P0, KC_PDOT \ - ), - /* Layer 1, raise layer - * | | | | | | | | | | | | | | | | | | | | - * | | | | | | | | | | | | | | | | | | | - * | | |rgb_up|rgb_dn|rgb_mo| | | | | | F22 | F23 | F24 | | | | | | - * | | | | | | | | | | | | | | | | | | - * | | | | | | | | | VolDn| VolUp| Mute | Play/Pause | | | | | - * | | | | | | |MPrev | | | MNext| | | | - */ - [_RAISE] = KEYMAP( - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, RGB_VAI, RGB_VAD, RGB_MOD, ______, ______, ______, ______, ______, KC_F22, KC_F23, KC_F24, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, KC_VOLD,KC_VOLU, KC_MUTE, KC_MPLY, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, KC_MPRV, ______, ______, KC_MNXT, ______, ______ \ - ) -}; \ No newline at end of file + + /* Layer 0, default layer + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |Print | Home | End |Insert|Delete| PgUp | 19 keys + * | ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BkSpc |NumLck| / | * | PgDn | 18 keys + * | Tab | Q | W | E | R | T | Y | U | I | O | P | { | } | \ | 7 | 8 | 9 | - | 18 keys + * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Return | 4 | 5 | 6 | + | 17 keys + * | LShft | Z | X | C | V | B | N | M | , | . | / | RShft | 1 | 2 | 3 | En | 16 keys + * | Ctrl | Win | Alt | Space | Fn | Win | Left | Down | Up | Right| 0 | . | | 12 keys + */ + [_DEFAULT] = LAYOUT_default( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END, KC_INS, KC_DEL, KC_PGUP, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PGDN, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_P0, KC_PDOT + ), + + /* Layer 1, raise layer + * | | | | | | | | | | | | | | | | | | | | + * | | | | | | | | | | | | | | | | | | | + * | | |rgb_up|rgb_dn|rgb_mo| | | | | | F22 | F23 | F24 | | | | | | + * | | | | | | | | | | | | | | | | | | + * | | | | | | | | | VolDn| VolUp| Mute | Play/Pause | | | | | + * | | | | | | |MPrev | | | MNext| | | | + */ + [_RAISE] = LAYOUT_default( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_VAI, RGB_VAD, RGB_MOD, _______, _______, _______, _______, _______, KC_F22, KC_F23, KC_F24, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_MPRV, _______, _______, KC_MNXT, _______, _______ + ) + +}; diff --git a/keyboards/ymd96/keymaps/epx/keymap.c b/keyboards/ymd96/keymaps/epx/keymap.c new file mode 100644 index 00000000000..09ec665a3a7 --- /dev/null +++ b/keyboards/ymd96/keymaps/epx/keymap.c @@ -0,0 +1,87 @@ +/* +Base Copyright 2017 Luiz Ribeiro + Copyright 2017 Andrew Novak +Modified Copyright 2018 Elvis Pfutzenreuter + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public LicensezZZ +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +#define _x_ KC_TRNS +#define _DEFLT 0 +#define _AR 1 +#define _RAISE 2 + +#define KEYMAP LAYOUT_default + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0, default layer + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | || > | << | >> | vol+ | vol- | Bkspc | + * | ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BkSpc |NumLck| / | * | - | + * | Tab | Q | W | E | R | T | Y | U | I | O | P | { | } | \ | 7 | 8 | 9 | | + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Return | 4 | 5 | 6 | + | + * | LShft | Z | X | C | V | B | N | M | , | . | / | RShft | 1 | 2 | 3 | | + * | Ctrl | Alt | Win | Space | Win | Fn | Alt | Ctrl | 0 | . | Enter | + * + * Layout is inspired on Model F. + * Extra keys on top right, as well as some seldom-used keys, are media keys in default layer. + * Num Lock toogles layer, so the numeric block works as a Model F navigation block in a Mac. + * (Fn-Num Lock operates as conventional Num Lock in case the keyboard needs to be used with Windows or Linux.) + * Caps Lock operates normally but it takes FN to work, the key is Ctrl by default, like in Model F. + */ + [_DEFLT] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, KC_MPRV, KC_MNXT, KC_VOLD, KC_VOLU, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, TO(_AR), KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RGUI, KC_NO, MO(_RAISE), KC_RALT, KC_RCTL, KC_P0, KC_P0, KC_PDOT \ + ), + + /* Layer 1, Num Lock activated + * ... + * ... + * ... | Home | Up | Pg Up | | + * ... | Left | (no) | Right | + | + * ... | End | Down | Pg Dn | | + * ... | Ins | Del | Enter | + */ + [_AR] = KEYMAP( + _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, \ + _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, TO(_DEFLT), _x_, _x_, _x_, \ + _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, KC_HOME, KC_UP, KC_PGUP, _x_, \ + _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, KC_LEFT, KC_NO, KC_RGHT, _x_, \ + _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, KC_END, KC_DOWN, KC_PGDN, _x_, \ + _x_, _x_,_x_, _x_, _x_, _x_, _x_, _x_, _x_, KC_INS, KC_INS, KC_DEL \ + ), + + /* Layer 2, raise layer + * | | | | | | | | | | | | | | PrtSc |Pause|ScrLck| stop | mute | Del | + * | | RGB Toggle | RGB Hue - | RGB Hue + | | | | | | | | | | Del |NumLck| | | | + * | | RGB Mode + | RGB Satu- | RGB Satu+ | | | | | | | | | | | | | | | + * | Caps Lck | RGB Mode - | RGB Brgt- | RGB Brgt+ | | | | | | | | | | | | | | | + * | | | | | | | | | | | | | | | | | + * | | | | | Win Menu | | | | | | | + */ + [_RAISE] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_PAUS, KC_SLCK, KC_MUTE, KC_MSTP, KC_DEL, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_NLCK, _______, _______, _______, \ + _______, RGB_TOG, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_CAPS, RGB_MOD, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_RMOD,RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______,_______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______ + ), + +}; diff --git a/keyboards/ymd96/keymaps/hgoel89/keymap.c b/keyboards/ymd96/keymaps/hgoel89/keymap.c index 81addf69f4d..f612f79bafc 100644 --- a/keyboards/ymd96/keymaps/hgoel89/keymap.c +++ b/keyboards/ymd96/keymaps/hgoel89/keymap.c @@ -27,7 +27,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { #define _DEFLT 0 #define _RAISE 1 -#define KEYMAP KEYMAP_CUSTOM +#define KEYMAP LAYOUT_custom const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -45,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_PMNS, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_NO, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RGUI , KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, MO(_RAISE), KC_P0, KC_PDOT \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,MO(_RAISE), KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RGUI , KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_P0, KC_PDOT \ ), /* Layer 1, raise layer * | | | | | | | | | | | | | | | | | | | | diff --git a/keyboards/ymd96/program b/keyboards/ymd96/program deleted file mode 100644 index a88d9cd9b04..00000000000 --- a/keyboards/ymd96/program +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from __future__ import print_function - -import os -import sys -import time -import usb - -if len(sys.argv) < 2: - print('Usage: %s ' % sys.argv[0]) - sys.exit(1) - -print('Searching for ps2avrGB... ', end='') - -dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D) -if dev is None: - raise ValueError('Device not found') - -print('Found', end='\n\n') - -print('Device Information:') -print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) -print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) -print('Manufacturer: %s' % (dev.iManufacturer)) -print('Serial: %s' % (dev.iSerialNumber)) -print('Product: %s' % (dev.iProduct), end='\n\n') - -print('Transferring control to bootloader... ', end='') - -dev.set_configuration() - -request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - -USBRQ_HID_SET_REPORT = 0x09 -HID_REPORT_OPTION = 0x0301 - - -try: - dev.ctrl_transfer( - request_type, - USBRQ_HID_SET_REPORT, - HID_REPORT_OPTION, - 0, - [0, 0, 0xFF] + [0] * 5 - ) -except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - -# wait a bit until bootloader starts up -time.sleep(2) - -print('OK') -print('Programming...') -if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0: - print('\nDone!') diff --git a/keyboards/ymd96/README.md b/keyboards/ymd96/readme.md similarity index 100% rename from keyboards/ymd96/README.md rename to keyboards/ymd96/readme.md diff --git a/keyboards/ymd96/tools/README.md b/keyboards/ymd96/tools/README.md deleted file mode 100644 index 081984ed44b..00000000000 --- a/keyboards/ymd96/tools/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# JJ40 Tools - -## usb_detach.c - -When trying to flash on Linux, you may encounter a "Resource Unavailable" error. This means that Linux's HID driver has taken exclusive control of the keyboard, and the program script can't flash it. -This program can force Linux to give up a device, so that the programming script can reset it. - -### To compile: -``` -gcc usb_detach.c -o usb_detach -``` - -### To run: -1. Use `lsusb` to discover the Bus and Device numbers for your keyboard. -2. Run the program: `sudo ./usb_detach /dev/bus/usb//`. -3. Build and program the firmware as normal. diff --git a/keyboards/ymd96/tools/usb_detach.c b/keyboards/ymd96/tools/usb_detach.c deleted file mode 100644 index c21e47a7a43..00000000000 --- a/keyboards/ymd96/tools/usb_detach.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Found at https://www.linuxquestions.org/questions/linux-hardware-18/how-to-unclaim-usb-device-558138/#post3406986 */ -#include -#include -#include -#include -#include -#include - -int main(int argc, char**argv) -{ - struct usbdevfs_ioctl command; - int ret; - int fd; - int i; - if (argc>1) { - fd = open(argv[1],O_RDWR); - if (fd<1){ - perror("unable to open file"); - return 1; - } - for (i=0;i<255;i++){ // hack: should fetch how many interface there is. - command.ifno = i; - command.ioctl_code = USBDEVFS_DISCONNECT; - command.data = NULL; - ret = ioctl(fd, USBDEVFS_IOCTL, &command); - if(ret!=-1) - printf("un claimed interface %d %d\n",i,ret); - } - } else { - printf ("usage: %s /dev/bus/usb/BUS/DEVICE\n",argv[0]); - printf("Release all interfaces of this usb device for usage in virtualisation\n"); - } -} \ No newline at end of file diff --git a/keyboards/ymd96/ymd96.h b/keyboards/ymd96/ymd96.h index 9c25f221928..a516297c198 100644 --- a/keyboards/ymd96/ymd96.h +++ b/keyboards/ymd96/ymd96.h @@ -16,82 +16,62 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H +#pragma once #include "quantum.h" -#include "quantum_keycodes.h" -#include "keycode.h" -#include "action.h" void matrix_init_user(void); // TODO port this to other PS2AVRGB boards -#define KEYMAP_DEFAULT( \ - K500, K502, K503, K504, K505, K600, K610, K710, K700, K511, K512, K513, K514, K113, K214, K013, K706, K709, K708, \ - K400, K401, K402, K403, K404, K405, K601, K611, K711, K701, K410, K411, K412, K414, K406, K407, K408, K409, \ - K300, K301, K302, K303, K304, K305, K602, K612, K712, K702, K310, K311, K312, K313, K306, K307, K308, K309, \ - K200, K201, K202, K203, K204, K205, K603, K613, K713, K703, K210, K211, K213, K206, K207, K208, K209, \ - K100, K101, K102, K103, K104, K105, K604, K614, K714, K704, K110, K111, K106, K107, K108, K009, \ - K000, K001, K002, K605, K705, K010, K011, K606, K607, K609, K006, K008 \ +#define LAYOUT_default( \ + K50, K52, K53, K54, K55, K60, K6A, K7A, K70, K5B, K5C, K5D, K5E, K1D, K2E, K0D, K76, K79, K78, \ + K40, K41, K42, K43, K44, K45, K61, K6B, K7B, K71, K4A, K4B, K4C, K4E, K46, K47, K48, K49, \ + K30, K31, K32, K33, K34, K35, K62, K6C, K7C, K72, K3A, K3B, K3C, K3D, K36, K37, K38, K39, \ + K20, K21, K22, K23, K24, K25, K63, K6D, K7D, K73, K2A, K2B, K2D, K26, K27, K28, K29, \ + K10, K11, K12, K13, K14, K15, K64, K6E, K7E, K74, K1A, K1B, K16, K17, K18, K09, \ + K00, K01, K02, K65, K75, K0A, K0B, K66, K67, K69, K06, K08 \ ) { \ - { K000, K001, K002, KC_NO, KC_NO, KC_NO, K006, KC_NO, K008, K009, K010, K011, KC_NO, K013, KC_NO, }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, KC_NO, K110, K111, KC_NO, K113, KC_NO, }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, K214, }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, }, \ - { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO, K414, }, \ - { K500, KC_NO, K502, K503, K504, K505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K511, K512, K513, K514, }, \ - { K600, K601, K602, K603, K604, K605, K606, K607, KC_NO, K609, K610, K611, K612, K613, K614, }, \ - { K700, K701, K702, K703, K704, K705, K706, KC_NO, K708, K709, K710, K711, K712, K713, K714 } \ + { K00, K01, K02, KC_NO, KC_NO, KC_NO, K06, KC_NO, K08, K09, K0A, K0B, KC_NO, K0D, KC_NO }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, KC_NO, K1A, K1B, KC_NO, K1D, KC_NO }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, K4E }, \ + { K50, KC_NO, K52, K53, K54, K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K5B, K5C, K5D, K5E }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, KC_NO, K69, K6A, K6B, K6C, K6D, K6E }, \ + { K70, K71, K72, K73, K74, K75, K76, KC_NO, K78, K79, K7A, K7B, K7C, K7D, K7E } \ } -#define KEYMAP_CUSTOM( \ - K500, K502, K503, K504, K505, K600, K610, K710, K700, K511, K512, K513, K514, K113, K214, K013, K706, K709, K708, \ - K400, K401, K402, K403, K404, K405, K601, K611, K711, K701, K410, K411, K412, K414, K406, K407, K408, K409, \ - K300, K301, K302, K303, K304, K305, K602, K612, K712, K702, K310, K311, K312, K313, K306, K307, K308, K309, \ - K200, K201, K202, K203, K204, K205, K603, K613, K713, K703, K210, K211, K213, K206, K207, K208, K209, \ - K100, K101, K102, K103, K104, K105, K604, K614, K714, K704, K110, K111, K106, K107, K108, K009, \ - K000, K001, K002, K605, K705, K010, K011, K606, K607, KC_NO, K006, K008 \ +#define LAYOUT_custom( \ + K50, K52, K53, K54, K55, K60, K6A, K7A, K70, K5B, K5C, K5D, K5E, K1D, K2E, K0D, K76, K79, K78, \ + K40, K41, K42, K43, K44, K45, K61, K6B, K7B, K71, K4A, K4B, K4C, K4E, K46, K47, K48, K49, \ + K30, K31, K32, K33, K34, K35, K62, K6C, K7C, K72, K3A, K3B, K3C, K3D, K36, K37, K38, K39, \ + K20, K21, K22, K23, K24, K25, K63, K6D, K7D, K73, K2A, K2B, K2D, K26, K27, K28, K29, \ + K10, K11, K12, K13, K14, K15, K64, K6E, K7E, K74, K1A, K1B, K68, K16, K17, K18, K09, \ + K00, K01, K02, K65, K75, K0A, K0B, K66, K67, K06, K08 \ ) { \ - { K000, K001, K002, KC_NO, KC_NO, KC_NO, K006, KC_NO, K008, K009, K010, K011, KC_NO, K013, KC_NO, }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, KC_NO, K110, K111, KC_NO, K113, KC_NO, }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, K214, }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, }, \ - { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO, K414, }, \ - { K500, KC_NO, K502, K503, K504, K505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K511, K512, K513, K514, }, \ - { K600, K601, K602, K603, K604, K605, K606, K607, KC_NO, KC_NO, K610, K611, K612, K613, K614, }, \ - { K700, K701, K702, K703, K704, K705, K706, KC_NO, K708, K709, K710, K711, K712, K713, K714 } \ -} - -#define LAYOUT_jj50( \ -K011, K010, K009, K008, K004, K005, K006, K007, K003, K002, K201, K000, \ -K111, K110, K109, K108, K104, K105, K106, K107, K103, K102, K001, K100, \ -K211, K210, K209, K208, K204, K205, K206, K207, K203, K202, K101, K200, \ -K311, K310, K309, K308, K304, K305, K306, K307, K303, K302, K301, K300, \ -K411, K410, K409, K408, K404, K405, K406, K407, K403, K402, K401, K400 \ -) { \ -{ K100, K001, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, }, \ -{ K200, K101, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, }, \ -{ K000, K201, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, }, \ -{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, }, \ -{ K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 }, \ + { K00, K01, K02, KC_NO, KC_NO, KC_NO, K06, KC_NO, K08, K09, K0A, K0B, KC_NO, K0D, KC_NO }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, KC_NO, K1A, K1B, KC_NO, K1D, KC_NO }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, K4E }, \ + { K50, KC_NO, K52, K53, K54, K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K5B, K5C, K5D, K5E }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, KC_NO, K6A, K6B, K6C, K6D, K6E }, \ + { K70, K71, K72, K73, K74, K75, K76, KC_NO, K78, K79, K7A, K7B, K7C, K7D, K7E } \ } #define LAYOUT_iso( \ - K0500, K0502, K0503, K0504, K0505, K0600, K0610, K0710, K0700, K0511, K0512, K0513, K0514, K0113, K0214, K0013, K0706, K0709, K0708, \ - K0400, K0401, K0402, K0403, K0404, K0405, K0601, K0611, K0711, K0701, K0410, K0411, K0412, K0414, K0406, K0407, K0408, K0409, \ - K0300, K0301, K0302, K0303, K0304, K0305, K0602, K0612, K0712, K0702, K0310, K0311, K0312, K0213, K0306, K0307, K0308, K0309, \ - K0200, K0201, K0202, K0203, K0204, K0205, K0603, K0613, K0713, K0703, K0210, K0211, K0212, K0206, K0207, K0208, K0209, \ - K0100, K0003, K0101, K0102, K0103, K0104, K0105, K0604, K0614, K0714, K0704, K0110, K0111, K0608, K0106, K0107, K0108, K0009, \ - K0000, K0001, K0002, K0605, K0705, K0011, K0606, K0607, K0609, K0006, K0008 \ + K50, K52, K53, K54, K55, K60, K6A, K7A, K70, K5B, K5C, K5D, K5E, K1D, K2E, K0D, K76, K79, K78, \ + K40, K41, K42, K43, K44, K45, K61, K6B, K7B, K71, K4A, K4B, K4C, K4E, K46, K47, K48, K49, \ + K30, K31, K32, K33, K34, K35, K62, K6C, K7C, K72, K3A, K3B, K3C, K2D, K36, K37, K38, K39, \ + K20, K21, K22, K23, K24, K25, K63, K6D, K7D, K73, K2A, K2B, K2C, K26, K27, K28, K29, \ + K10, K03, K11, K12, K13, K14, K15, K64, K6E, K7E, K74, K1A, K1B, K68, K16, K17, K18, K09, \ + K00, K01, K02, K65, K75, K0B, K66, K67, K69, K06, K08 \ ) { \ - { K0000, K0001, K0002, K0003, KC_NO, KC_NO, K0006, KC_NO, K0008, K0009, KC_NO, K0011, KC_NO, K0013, KC_NO, }, \ - { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, K0108, KC_NO, K0110, K0111, KC_NO, K0113, KC_NO, }, \ - { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209, K0210, K0211, K0212, K0213, K0214, }, \ - { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309, K0310, K0311, K0312, KC_NO, KC_NO, }, \ - { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409, K0410, K0411, K0412, KC_NO, K0414, }, \ - { K0500, KC_NO, K0502, K0503, K0504, K0505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0511, K0512, K0513, K0514, }, \ - { K0600, K0601, K0602, K0603, K0604, K0605, K0606, K0607, K0608, K0609, K0610, K0611, K0612, K0613, K0614, }, \ - { K0700, K0701, K0702, K0703, K0704, K0705, K0706, KC_NO, K0708, K0709, K0710, K0711, K0712, K0713, K0714 } \ + { K00, K01, K02, K03, KC_NO, KC_NO, K06, KC_NO, K08, K09, KC_NO, K0B, KC_NO, K0D, KC_NO }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, KC_NO, K1A, K1B, KC_NO, K1D, KC_NO }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, K4E }, \ + { K50, KC_NO, K52, K53, K54, K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K5B, K5C, K5D, K5E }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C, K6D, K6E }, \ + { K70, K71, K72, K73, K74, K75, K76, KC_NO, K78, K79, K7A, K7B, K7C, K7D, K7E } \ } - -#endif diff --git a/keyboards/ymdk_np21/config.h b/keyboards/ymdk_np21/config.h index 2b358113d43..5982b6c5309 100644 --- a/keyboards/ymdk_np21/config.h +++ b/keyboards/ymdk_np21/config.h @@ -48,7 +48,4 @@ along with this program. If not, see . #define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0. #define RGBLIGHT_ANIMATIONS -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - #endif diff --git a/keyboards/yosino58/config.h b/keyboards/yosino58/config.h new file mode 100644 index 00000000000..4357a218d4a --- /dev/null +++ b/keyboards/yosino58/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" +#include + +#define USE_I2C +#define USE_SERIAL + +#ifdef USE_Link_Time_Optimization + // LTO has issues with macros (action_get_macro) and "functions" (fn_actions), + // so just disable them + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION + + #define DISABLE_LEADER +#endif // USE_Link_Time_Optimization diff --git a/keyboards/yosino58/i2c.c b/keyboards/yosino58/i2c.c new file mode 100644 index 00000000000..4bee5c63982 --- /dev/null +++ b/keyboards/yosino58/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); diff --git a/keyboards/yosino58/info.json b/keyboards/yosino58/info.json new file mode 100644 index 00000000000..c591a41dece --- /dev/null +++ b/keyboards/yosino58/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "yosino58 rev. 1", + "url": "https://github.com/sakurachari/yosino58", + "maintainer": "sakuranbo0046", + "width": 16.75, + "height": 6.25, + "layouts": { + "LAYOUT": { + "key_count": 58, + "layout": [ + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":0.25}, {"x":3, "y":0}, {"x":4, "y":0.25}, {"x":5, "y":0.5}, {"x":10.75, "y":0.5}, {"x":11.75, "y":0.25}, {"x":12.75, "y":0}, {"x":13.75, "y":0.25}, {"x":14.75, "y":1}, {"x":15.75, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":1.25}, {"x":3, "y":1}, {"x":4, "y":1.25}, {"x":5, "y":1.5}, {"x":10.75, "y":1.5}, {"x":11.75, "y":1.25}, {"x":12.75, "y":1}, {"x":13.75, "y":1.25}, {"x":14.75, "y":2}, {"x":15.75, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":2.25}, {"x":3, "y":2}, {"x":4, "y":2.25}, {"x":5, "y":2.5}, {"x":10.75, "y":2.5}, {"x":11.75, "y":2.25}, {"x":12.75, "y":2}, {"x":13.75, "y":2.25}, {"x":14.75, "y":3}, {"x":15.75, "y":3}, + {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":3.25}, {"x":3, "y":3}, {"x":4, "y":3.25}, {"x":5, "y":3.5}, {"x":6.5, "y":4.25}, {"x":7.5, "y":4.25, "h":2}, {"x":8.5, "y":4.25, "h":2}, {"x":9.5, "y":4.25}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3}, {"x":13.75, "y":3.25}, {"x":14.75, "y":4}, {"x":15.75, "y":4}, + {"x":3.75, "y":4.25}, {"x":4.75, "y":4.5}, {"x":6.5, "y":5.25}, {"x":9.5, "y":5.25}, {"x":11, "y":4.5}, {"x":12, "y":4.25} + ] + } + } +} + diff --git a/keyboards/yosino58/keymaps/default/config.h b/keyboards/yosino58/keymaps/default/config.h new file mode 100644 index 00000000000..21fc2d3b547 --- /dev/null +++ b/keyboards/yosino58/keymaps/default/config.h @@ -0,0 +1,43 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED +// #define SSD1306_128X64 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 \ No newline at end of file diff --git a/keyboards/yosino58/keymaps/default/keymap.c b/keyboards/yosino58/keymaps/default/keymap.c new file mode 100644 index 00000000000..79b50756965 --- /dev/null +++ b/keyboards/yosino58/keymaps/default/keymap.c @@ -0,0 +1,337 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + RGBRST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | = | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LShift| A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LCTRL | Z | X | C | V | B |-------.-------. ,---------------| N | M | , | . | / | \ | + * `-----------------------------------------/ Del / / \ \ Bksp \----------------------------------------' + * | LAlt |ADJUST| /-------/ Space / \ Enter \-------\ | [ | ] | + * | | |/ LOWER / / \ \ RAISE \ | | | + * `-----------------------------' '------------------------------' + */ + [_QWERTY] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, \ + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LCTRL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, \ + KC_LALT, ADJUST, LOWER, RAISE, KC_LBRC, KC_RBRC\ + ), + +/* LOWER + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | / | - | 7 | 8 | 9 | | ! | @ | # | $ | % | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LShift| * | + | 4 | 5 | 6 | | ^ | & | * | ( | ) | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LCTRL | . | 0 | 1 | 2 | 3 |-------.-------. ,---------------| | _ | + | { | } | | | + * `-----------------------------------------/ F11 / / \ \ F12 \----------------------------------------' + * | LAlt | LGUI | /-------/ Space / \ Enter \-------\ | Caps | Num | + * | | |/ LOWER / / \ \ \ | | | + * `-----------------------------' '------------------------------' + */ + [_LOWER] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ + _______, KC_PSLS, KC_PMNS, KC_P7, KC_P8, KC_P9, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_F12, \ + _______, KC_PAST, KC_PPLS, KC_P4, KC_P5, KC_P6, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD, \ + _______, KC_PDOT, KC_P0, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_LGUI, _______, XXXXXXX, KC_CLCK, KC_NLCK\ + + ), + +/* RAISE + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 |-------.-------. ,---------------| | | | | | | + * `-----------------------------------------/ / / \ \ \----------------------------------------' + * | | | /-------/ Space / \ Enter \-------\ | | | + * | | |/ / / \ \ RAISE \ | | | + * `-----------------------------' '------------------------------' + */ + [_RAISE] = LAYOUT( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX \ + ), + +/* ADJUST + * ,-----------------------------------------. ,-----------------------------------------. + * |RESET | | | | | | | Mute | Vol+ | Play | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | PSCR | SLCK | Pause| | Prev | Vol- | Next | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Insert| Home |PageUP| | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | Del | End |PageDN|-------.-------. ,---------------| |RGB Re| MODE | HUE- | SAT- | VAL- | + * `-----------------------------------------/ / / \ \ \----------------------------------------' + * | |ADJUST| /-------/ Space / \ Enter \-------\ | | | + * | | |/ / / \ \ \ | | | + * `-----------------------------' '------------------------------' + */ + [_ADJUST] = LAYOUT( \ + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLU, KC_MPLY, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, KC_MPRV, KC_VOLD, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_HOME, KC_PGUP, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, KC_END, KC_PGDN, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, RGBRST, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \ + XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ) +}; + + +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + #ifdef SSD1306_128X64 + iota_gfx_init(false); // turns on the display + #else + iota_gfx_init(!has_usb()); // turns on the display + #endif + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +//assign the right code to your layers for OLED display +#define L_QWERTY 0 +#define L_LOWER 2 +#define L_RAISE 4 +#define L_ADJUST 8 + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_logo(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + static char indctr[2][20][5]= + { + // white icon + { + {0x80,0x81,0x82,0x83,0}, + {0x88,0x89,0x8A,0x8B,0}, + {0x90,0x91,0x92,0x93,0}, + {0x98,0x99,0x9A,0x9B,0}, + {0x01,0x02,0x03,0x04,0}, + {0xA0,0xA1,0xA2,0xA3,0}, + {0xA8,0xA9,0xAA,0xAB,0}, + {0xB0,0xB1,0xB2,0xB3,0}, + {0xB8,0xB9,0xBA,0xBB,0}, + {0x21,0x22,0x23,0x24,0}, + {0xC0,0xC1,0xC2,0xC3,0}, + {0xC8,0xC9,0xCA,0xCB,0}, + {0xD0,0xD1,0xD2,0xD3,0}, + {0xD8,0xD9,0xDA,0xDB,0}, + {0x41,0x42,0x43,0x44,0}, + {0xE0,0xE1,0xE2,0xE3,0}, + {0xE8,0xE9,0xEA,0xEB,0}, + {0xF0,0xF1,0xF2,0xF3,0}, + {0xF8,0xF9,0xFA,0xFB,0}, + {0x61,0x62,0x63,0x64,0} + }, + // Black icon + { + {0x84,0x85,0x86,0x87,0}, + {0x8C,0x8D,0x8E,0x8F,0}, + {0x94,0x95,0x96,0x97,0}, + {0x9C,0x9D,0x9E,0x9F,0}, + {0x05,0x06,0x07,0x08,0}, + {0xA4,0xA5,0xA6,0xA7,0}, + {0xAC,0xAD,0xAE,0xAF,0}, + {0xB4,0xB5,0xB6,0xB7,0}, + {0xBC,0xBD,0xBE,0xBF,0}, + {0x25,0x26,0x27,0x28,0}, + {0xC4,0xC5,0xC6,0xC7,0}, + {0xCC,0xCD,0xCE,0xCF,0}, + {0xD4,0xD5,0xD6,0xD7,0}, + {0xDC,0xDD,0xDE,0xDF,0}, + {0x45,0x46,0x47,0x48,0}, + {0xE4,0xE5,0xE6,0xE7,0}, + {0xEC,0xED,0xEE,0xEF,0}, + {0xF4,0xF5,0xF6,0xF7,0}, + {0xFC,0xFD,0xFE,0xFF,0}, + {0x65,0x66,0x67,0x68,0} + } + }; + + int rown = 0; + int rowc = 0; + int rowl = 0; + int rowr = 0; + int rowa = 0; + + //Set Indicator icon + if (host_keyboard_leds() & (1<display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + diff --git a/keyboards/yosino58/keymaps/default/rules.mk b/keyboards/yosino58/keymaps/default/rules.mk new file mode 100644 index 00000000000..131f5e1f8a6 --- /dev/null +++ b/keyboards/yosino58/keymaps/default/rules.mk @@ -0,0 +1,30 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/logo_reader.c \ + # ./lib/rgb_state_reader.c \ + # ./lib/layer_state_reader.c \ + # ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/yosino58/keymaps/sakura/config.h b/keyboards/yosino58/keymaps/sakura/config.h new file mode 100644 index 00000000000..64962b0d20d --- /dev/null +++ b/keyboards/yosino58/keymaps/sakura/config.h @@ -0,0 +1,50 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +#define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED +#define SSD1306_128X64 + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 29 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 10 +#define MOUSEKEY_MAX_SPEED 3 +#define MOUSEKEY_TIME_TO_MAX 20 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 diff --git a/keyboards/yosino58/keymaps/sakura/keymap.c b/keyboards/yosino58/keymaps/sakura/keymap.c new file mode 100644 index 00000000000..0996f0e4e7c --- /dev/null +++ b/keyboards/yosino58/keymaps/sakura/keymap.c @@ -0,0 +1,337 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + RGBRST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | = | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LShift| A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LCTRL | Z | X | C | V | B |-------.-------. ,---------------| N | M | , | . | / | \ | + * `-----------------------------------------/ Del / / \ \ Bksp \----------------------------------------' + * | LAlt | LGUI | /-------/ Space / \ Enter \-------\ | [ | ] | + * | | |/ LOWER / / \ \ RAISE \ | | | + * `-----------------------------' '------------------------------' + */ + [_QWERTY] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, \ + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LCTRL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, \ + KC_LALT, KC_LGUI, LOWER, RAISE, KC_LBRC, KC_RBRC\ + ), + +/* LOWER + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | / | - | 7 | 8 | 9 | | PSCR | SLCK | Pause| | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LShift| * | + | 4 | 5 | 6 | |Insert| Home |PageUP| | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LCTRL | . | 0 | 1 | 2 | 3 |-------.-------. ,---------------| Del | End |PageDN| | Num | Caps | + * `-----------------------------------------/ F11 / / \ \ F12 \----------------------------------------' + * | LAlt | LGUI | /-------/ Space / \ Enter \-------\ | | | + * | | |/ LOWER / / \ \ \ | | | + * `-----------------------------' '------------------------------' + */ + [_LOWER] = LAYOUT( \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, \ + _______, KC_PSLS, KC_PMNS, KC_P7, KC_P8, KC_P9, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, KC_UP, XXXXXXX, \ + _______, KC_PAST, KC_PPLS, KC_P4, KC_P5, KC_P6, KC_INS, KC_HOME, KC_PGUP, XXXXXXX, KC_DOWN, KC_RGHT, \ + _______, KC_PDOT, KC_P0, KC_P1, KC_P2, KC_P3, KC_F11, _______, _______, KC_F12, KC_DEL, KC_END, KC_PGDN, KC_LEFT, KC_NLCK, KC_CLCK, \ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX\ + ), + +/* RAISE + * ,-----------------------------------------. ,-----------------------------------------. + * |RESET | | | | | | | Mute | Vol+ | Play | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | Prev | Vol- | Next | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |MS_Bt1| MS_U |MS_Bt2|MS_WhU|MS_WhL| | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | MS_L | MS_D | MS_R |MS_WhD|MS_WhR|-------.-------. ,---------------| | | MODE | HUE- | SAT- | VAL- | + * `-----------------------------------------/ / / \ \ \----------------------------------------' + * | | | /-------/ Space / \ Enter \-------\ | | | + * | | |/ / / \ \ RAISE \ | | | + * `-----------------------------' '------------------------------' + */ + [_RAISE] = LAYOUT( \ + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLU, KC_MPLY, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_VOLD, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_WH_L, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, KC_WH_R, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, RGBRST, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \ + XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX \ + ) + +/* ADJUST + * ,-----------------------------------------. ,-----------------------------------------. + * |RESET | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | |-------.-------. ,---------------| | | | | | | + * `-----------------------------------------/ / / \ \ \----------------------------------------' + * | | | /-------/ / \ \-------\ | | | + * | | |/ / / \ \ \ | | | + * `-----------------------------' '------------------------------' + + [_ADJUST] = LAYOUT( \ + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ) +*/ +}; + + +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + #ifdef SSD1306_128X64 + iota_gfx_init(false); // turns on the display + #else + iota_gfx_init(!has_usb()); // turns on the display + #endif + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +//assign the right code to your layers for OLED display +#define L_QWERTY 0 +#define L_LOWER 2 +#define L_RAISE 4 +#define L_ADJUST 8 + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_logo(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + static char indctr[2][20][5]= + { + // white icon + { + {0x80,0x81,0x82,0x83,0}, + {0x88,0x89,0x8A,0x8B,0}, + {0x90,0x91,0x92,0x93,0}, + {0x98,0x99,0x9A,0x9B,0}, + {0x01,0x02,0x03,0x04,0}, + {0xA0,0xA1,0xA2,0xA3,0}, + {0xA8,0xA9,0xAA,0xAB,0}, + {0xB0,0xB1,0xB2,0xB3,0}, + {0xB8,0xB9,0xBA,0xBB,0}, + {0x21,0x22,0x23,0x24,0}, + {0xC0,0xC1,0xC2,0xC3,0}, + {0xC8,0xC9,0xCA,0xCB,0}, + {0xD0,0xD1,0xD2,0xD3,0}, + {0xD8,0xD9,0xDA,0xDB,0}, + {0x41,0x42,0x43,0x44,0}, + {0xE0,0xE1,0xE2,0xE3,0}, + {0xE8,0xE9,0xEA,0xEB,0}, + {0xF0,0xF1,0xF2,0xF3,0}, + {0xF8,0xF9,0xFA,0xFB,0}, + {0x61,0x62,0x63,0x64,0} + }, + // Black icon + { + {0x84,0x85,0x86,0x87,0}, + {0x8C,0x8D,0x8E,0x8F,0}, + {0x94,0x95,0x96,0x97,0}, + {0x9C,0x9D,0x9E,0x9F,0}, + {0x05,0x06,0x07,0x08,0}, + {0xA4,0xA5,0xA6,0xA7,0}, + {0xAC,0xAD,0xAE,0xAF,0}, + {0xB4,0xB5,0xB6,0xB7,0}, + {0xBC,0xBD,0xBE,0xBF,0}, + {0x25,0x26,0x27,0x28,0}, + {0xC4,0xC5,0xC6,0xC7,0}, + {0xCC,0xCD,0xCE,0xCF,0}, + {0xD4,0xD5,0xD6,0xD7,0}, + {0xDC,0xDD,0xDE,0xDF,0}, + {0x45,0x46,0x47,0x48,0}, + {0xE4,0xE5,0xE6,0xE7,0}, + {0xEC,0xED,0xEE,0xEF,0}, + {0xF4,0xF5,0xF6,0xF7,0}, + {0xFC,0xFD,0xFE,0xFF,0}, + {0x65,0x66,0x67,0x68,0} + } + }; + + int rown = 0; + int rowc = 0; + int rowl = 0; + int rowr = 0; + int rowa = 0; + + //Set Indicator icon + if (host_keyboard_leds() & (1<display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + diff --git a/keyboards/yosino58/keymaps/sakura/rules.mk b/keyboards/yosino58/keymaps/sakura/rules.mk new file mode 100644 index 00000000000..296e53287ae --- /dev/null +++ b/keyboards/yosino58/keymaps/sakura/rules.mk @@ -0,0 +1,30 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/logo_reader.c \ + # ./lib/rgb_state_reader.c \ + # ./lib/layer_state_reader.c \ + # ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/yosino58/lib/glcdfont.c b/keyboards/yosino58/lib/glcdfont.c new file mode 100644 index 00000000000..01b656cc626 --- /dev/null +++ b/keyboards/yosino58/lib/glcdfont.c @@ -0,0 +1,275 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFC, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x81, 0xC1, 0xE1, 0xF1, 0xF9, + 0xF9, 0xF9, 0xF9, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x02, 0xFC, + 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, + 0x07, 0x07, 0x07, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x03, 0x01, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFC, 0xFC, 0xFC, 0xFE, 0xFF, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0xFE, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, + 0xFE, 0x00, 0x00, 0x80, 0xF8, 0xFC, + 0x7C, 0x3E, 0x1E, 0x1E, 0x1E, 0x1E, + 0x1E, 0x3E, 0x7C, 0xFC, 0xF8, 0x80, + 0x00, 0x00, 0xC0, 0xF8, 0x7C, 0x3C, + 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, + 0x3C, 0x3C, 0x18, 0x00, 0x38, 0x7C, + 0x7C, 0x7C, 0x7C, 0x7C, 0xFC, 0xFC, + 0x7C, 0x7C, 0x7C, 0x7C, 0x38, 0x00, + 0x00, 0xC0, 0xF0, 0xF8, 0x7C, 0x3C, + 0x1E, 0x1E, 0x1E, 0x3C, 0x7C, 0xF8, + 0xF0, 0xC0, 0x00, 0x00, 0x80, 0xF8, + 0xFC, 0x7C, 0x3E, 0x1E, 0x1E, 0x1E, + 0x1E, 0x1E, 0x3E, 0x7C, 0xFC, 0xF8, + 0x80, 0x00, 0x00, 0x00, 0xFC, 0xFE, + 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, + 0x1E, 0x1E, 0x1E, 0x1E, 0x1C, 0x00, + 0xE0, 0xF8, 0xFC, 0x3E, 0x1E, 0x1E, + 0x1E, 0x1E, 0x1E, 0x1E, 0x3E, 0xFC, + 0xF8, 0xE0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x0F, 0x1F, 0x3C, 0x3C, + 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0xFF, + 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x03, 0x0F, 0x1E, 0x3C, + 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, + 0x7C, 0xF8, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x07, 0x0F, + 0x0F, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, + 0x1E, 0x1E, 0xFE, 0xFC, 0xF0, 0x00, + 0xC0, 0xF7, 0xFF, 0x3F, 0x3E, 0x1C, + 0x1C, 0x1C, 0x1C, 0x3E, 0x3F, 0xFF, + 0xF7, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3F, 0x40, 0x80, 0x80, 0x80, 0x80, + 0x9C, 0x9E, 0x9E, 0x9E, 0x9E, 0x9F, + 0x9F, 0x9F, 0x9F, 0x9E, 0x9E, 0x9E, + 0x9E, 0x9C, 0x80, 0x80, 0x40, 0x3F, + 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xE3, 0xE1, 0xE1, 0xE1, 0xE1, 0xE0, + 0xE0, 0xE0, 0xE0, 0xE1, 0xE1, 0xE1, + 0xE1, 0xE3, 0xFF, 0xFF, 0x7F, 0x3F, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x3C, 0x3C, 0x3C, 0x3C, + 0x3C, 0x3C, 0x3C, 0x3C, 0x1F, 0x0F, + 0x07, 0x00, 0x00, 0x00, 0x0F, 0x1F, + 0x1F, 0x3E, 0x3C, 0x3C, 0x3C, 0x3C, + 0x3C, 0x3E, 0x1F, 0x1F, 0x0F, 0x00, + 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x3C, + 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, + 0x3E, 0x1F, 0x03, 0x00, 0x1C, 0x3E, + 0x3E, 0x3E, 0x3E, 0x3E, 0x3F, 0x3F, + 0x3E, 0x3E, 0x3E, 0x3E, 0x1C, 0x00, + 0x00, 0x3F, 0x3F, 0x1F, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, + 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x0F, + 0x1F, 0x1F, 0x3E, 0x3C, 0x3C, 0x3C, + 0x3C, 0x3C, 0x3E, 0x1F, 0x1F, 0x0F, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x1F, + 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, + 0x1F, 0x1F, 0x0F, 0x07, 0x03, 0x00, + 0x01, 0x07, 0x0F, 0x1E, 0x3C, 0x3C, + 0x3C, 0x3C, 0x3C, 0x3C, 0x1E, 0x0F, + 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, + 0xFC, 0x02, 0x01, 0x79, 0x79, 0x79, + 0x79, 0xF9, 0xF9, 0xF9, 0x79, 0x79, + 0x79, 0x79, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x02, 0xFC, + 0xFC, 0xFE, 0xFF, 0x87, 0x87, 0x87, + 0x87, 0x07, 0x07, 0x07, 0x87, 0x87, + 0x87, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, + 0xFC, 0x02, 0x01, 0xE1, 0xE1, 0xE1, + 0xE1, 0xE1, 0xE1, 0xE1, 0xE1, 0xE1, + 0xE1, 0xE1, 0xE1, 0xE1, 0xC1, 0xC1, + 0x81, 0x01, 0x01, 0x01, 0x02, 0xFC, + 0xFC, 0xFE, 0xFF, 0x1F, 0x1F, 0x1F, + 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, + 0x1F, 0x1F, 0x1F, 0x1F, 0x3F, 0x3F, + 0x7F, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, + 0xFC, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x09, + 0x89, 0xF9, 0xF9, 0xF9, 0xF9, 0xF9, + 0xF9, 0x09, 0x09, 0x01, 0x02, 0xFC, + 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, + 0x77, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0xF7, 0xF7, 0xFF, 0xFE, 0xFC, + 0xFC, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x81, 0xC1, 0xE1, 0xF1, 0xF1, 0xF9, + 0x79, 0x79, 0xF9, 0xF9, 0xF1, 0xF1, + 0xE1, 0x81, 0x01, 0x01, 0x02, 0xFC, + 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0x7F, 0x3F, 0x1F, 0x0F, 0x0F, 0x07, + 0x87, 0x87, 0x07, 0x07, 0x0F, 0x0F, + 0x1F, 0x7F, 0xFF, 0xFF, 0xFE, 0xFC, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, + 0xC0, 0xC0, 0xC0, 0xC0, 0xE1, 0xFF, + 0x7F, 0x1F, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0x00, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x1E, 0x00, + 0x80, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xC0, 0xF0, 0xFC, 0xFC, 0x3F, + 0x0F, 0x03, 0x01, 0x01, 0xFF, 0xFF, + 0xFF, 0xF8, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x3F, 0x0F, 0x03, 0x03, 0xC0, + 0xF0, 0xFC, 0xFE, 0xFE, 0x00, 0x00, + 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0xE0, 0xFC, 0xFF, + 0xFF, 0xFF, 0xFF, 0x1F, 0x03, 0x00, + 0x00, 0x00, 0x18, 0x1F, 0x1F, 0x1F, + 0x1F, 0x0F, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0x1F, 0x03, 0x00, + 0x00, 0x00, 0x00, 0xE0, 0xFC, 0xFF, + 0xFF, 0xFF, 0xE7, 0xE0, 0xE0, 0xE0, + 0xE0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x7F, 0x3F, 0x1F, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0x01, 0x01, 0x01, 0x01, + 0x03, 0x0F, 0x3F, 0xFD, 0xF1, 0xC0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0x00, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFC, 0xF0, 0xC0, 0x02, 0x0F, 0x3F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0xF0, 0xFC, + 0xFF, 0xFF, 0xFF, 0x73, 0x70, 0x70, + 0x70, 0x70, 0x70, 0x70, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x03, + 0x00, 0x00, 0x00, 0x8C, 0x8F, 0x8F, + 0x8F, 0x8F, 0x8F, 0x8F, 0x00, 0x00, + 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x3F, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xC0, 0x80, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0xF8, 0xF0, + 0x20, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3F, 0x7F, 0xFF, + 0xFF, 0x7F, 0x3F, 0x1F, 0x07, 0x0F, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x3F, 0x40, 0x80, 0x8F, 0x8F, 0x8F, + 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, + 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, + 0x8F, 0x87, 0x83, 0x81, 0x40, 0x3F, + 0x3F, 0x7F, 0xFF, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF8, 0xFC, 0xFE, 0x7F, 0x3F, + 0x3F, 0x40, 0x80, 0x8E, 0x8E, 0x8F, + 0x8F, 0x8F, 0x8E, 0x8E, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x83, 0x8F, + 0x8F, 0x8E, 0x8E, 0x80, 0x40, 0x3F, + 0x3F, 0x7F, 0xFF, 0xF1, 0xF1, 0xF0, + 0xF0, 0xF0, 0xF1, 0xF1, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, + 0xF0, 0xF1, 0xF1, 0xFF, 0x7F, 0x3F, + 0x3F, 0x40, 0x80, 0x80, 0x9F, 0x9F, + 0x9F, 0x9F, 0x9F, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x9F, 0x9F, + 0x9F, 0x9F, 0x9F, 0x80, 0x40, 0x3F, + 0x3F, 0x7F, 0xFF, 0xFF, 0xE0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xFF, 0x7F, 0x3F, + 0x3F, 0x40, 0x80, 0x80, 0x80, 0x81, + 0x83, 0x87, 0x87, 0x8F, 0x8F, 0x8F, + 0x8F, 0x87, 0x87, 0x83, 0x81, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x40, 0x3F, + 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFE, + 0xFC, 0xF8, 0xF8, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF8, 0xF8, 0xFC, 0xFE, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F +}; +#endif // FONT5X7_H diff --git a/keyboards/yosino58/lib/glcdfont_.c b/keyboards/yosino58/lib/glcdfont_.c new file mode 100644 index 00000000000..122b26afa36 --- /dev/null +++ b/keyboards/yosino58/lib/glcdfont_.c @@ -0,0 +1,243 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFE, 0x01, 0x01, 0x0D, 0xFD, + 0xFD, 0x0D, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0xFE, 0x00, 0x00, + 0x00, 0xFE, 0x01, 0x01, 0x0D, 0xFD, + 0xFD, 0x8D, 0x8D, 0x8D, 0x8D, 0xF9, + 0x71, 0x01, 0x01, 0xFE, 0x00, 0x00, + 0x00, 0xFE, 0x01, 0x01, 0x01, 0xC1, + 0xF1, 0x39, 0x0D, 0x3D, 0xFD, 0xC1, + 0x01, 0x01, 0x01, 0xFE, 0x00, 0x00, + 0x00, 0xFE, 0x01, 0x01, 0x01, 0x01, + 0x21, 0x31, 0xF9, 0xF9, 0x01, 0x01, + 0x01, 0x01, 0x01, 0xFE, 0x00, 0x00, + 0x00, 0x00, 0xC0, 0x80, 0xC0, 0xE0, + 0xF0, 0xF0, 0x00, 0xC0, 0x80, 0x00, + 0x80, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x06, 0xEC, 0xD8, 0xB4, + 0x6E, 0xDE, 0x82, 0x7A, 0x76, 0xAC, + 0xD8, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xB0, 0x70, + 0xBC, 0x7C, 0xBC, 0x7C, 0xBC, 0x70, + 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xF0, 0x90, + 0x9C, 0x84, 0x84, 0x84, 0x9C, 0x90, + 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7F, 0x80, 0x80, 0x98, 0x9F, + 0x9F, 0x98, 0x98, 0x98, 0x98, 0x9C, + 0x9E, 0x80, 0x80, 0x7F, 0x00, 0x00, + 0x00, 0x7F, 0x80, 0x80, 0x98, 0x9F, + 0x9F, 0x99, 0x81, 0x83, 0x87, 0x9C, + 0x98, 0x98, 0x80, 0x7F, 0x00, 0x00, + 0x00, 0x7F, 0x80, 0x80, 0x9F, 0x9F, + 0x86, 0x86, 0x86, 0x86, 0x9F, 0x9F, + 0x80, 0x80, 0x80, 0x7F, 0x00, 0x00, + 0x00, 0x7F, 0x80, 0x80, 0x80, 0x80, + 0x98, 0x98, 0x9F, 0x9F, 0x98, 0x98, + 0x80, 0x80, 0x80, 0x7F, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x03, 0x07, 0x0F, + 0x1F, 0x1F, 0x00, 0x0C, 0x07, 0x03, + 0x07, 0x0C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1F, 0x2F, 0x77, + 0xFB, 0xFC, 0x81, 0xBB, 0xD6, 0x6D, + 0x1B, 0x37, 0x60, 0xC0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1B, 0x37, + 0x3B, 0x37, 0x3B, 0x37, 0x3B, 0x37, + 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1B, 0x37, + 0x3B, 0x37, 0x3B, 0x37, 0x3B, 0x37, + 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFE, 0xFF, 0xFF, 0xF3, 0x03, + 0x03, 0xF3, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, + 0x00, 0xFE, 0xFF, 0xFF, 0xF3, 0x03, + 0x03, 0x73, 0x73, 0x73, 0x73, 0x07, + 0x8F, 0xFF, 0xFF, 0xFE, 0x00, 0x00, + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x3F, + 0x0F, 0xC7, 0xF3, 0xC3, 0x03, 0x3F, + 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xDF, 0xCF, 0x07, 0x07, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, + 0x00, 0x00, 0xC0, 0x80, 0xC0, 0xE0, + 0xF0, 0xF0, 0x00, 0x20, 0x20, 0x10, + 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xF0, 0xE8, 0xDC, + 0xBE, 0x7E, 0x02, 0xFA, 0x76, 0xAC, + 0xD8, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, + 0x1C, 0x04, 0x04, 0x04, 0x1C, 0x10, + 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0xF8, 0x30, + 0x5C, 0x84, 0x04, 0x04, 0x1C, 0x10, + 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7F, 0xFF, 0xFF, 0xE7, 0xE0, + 0xE0, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, + 0xE3, 0xE1, 0xFF, 0x7F, 0x00, 0x00, + 0x00, 0x7F, 0xFF, 0xFF, 0xE7, 0xE0, + 0xE0, 0xE6, 0xFE, 0xFC, 0xF8, 0xE3, + 0xE7, 0xE7, 0xFF, 0x7F, 0x00, 0x00, + 0x00, 0x7F, 0xFF, 0xFF, 0xE0, 0xE0, + 0xF9, 0xF9, 0xF9, 0xF9, 0xE0, 0xE0, + 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, + 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xE7, 0xE7, 0xE0, 0xE0, 0xE7, 0xE7, + 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x03, 0x07, 0x0F, + 0x1F, 0x1F, 0x00, 0x09, 0x09, 0x11, + 0x11, 0x21, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1F, 0x2F, 0x77, + 0xFB, 0xFD, 0x80, 0xBE, 0xDD, 0x6B, + 0x37, 0x1F, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x38, + 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x20, + 0x20, 0x20, 0x21, 0x22, 0x24, 0x28, + 0x1F, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +#endif // FONT5X7_H diff --git a/keyboards/yosino58/lib/host_led_state_reader.c b/keyboards/yosino58/lib/host_led_state_reader.c new file mode 100644 index 00000000000..2a17e0a33b8 --- /dev/null +++ b/keyboards/yosino58/lib/host_led_state_reader.c @@ -0,0 +1,15 @@ +#include +#include "yosino58.h" + +char host_led_state_str[24]; + +const char *read_host_led_state(void) +{ + uint8_t leds = host_keyboard_leds(); + snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", + (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "); + + return host_led_state_str; +} diff --git a/keyboards/yosino58/lib/keylogger.c b/keyboards/yosino58/lib/keylogger.c new file mode 100644 index 00000000000..c50de94c208 --- /dev/null +++ b/keyboards/yosino58/lib/keylogger.c @@ -0,0 +1,45 @@ +#include +#include "yosino58.h" + +char keylog_str[24] = {}; +char keylogs_str[21] = {}; +int keylogs_str_idx = 0; + +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void set_keylog(uint16_t keycode, keyrecord_t *record) { + char name = ' '; + if (keycode < 60) { + name = code_to_name[keycode]; + } + + // update keylog + snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", + record->event.key.row, record->event.key.col, + keycode, name); + + // update keylogs + if (keylogs_str_idx == sizeof(keylogs_str) - 1) { + keylogs_str_idx = 0; + for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { + keylogs_str[i] = ' '; + } + } + + keylogs_str[keylogs_str_idx] = name; + keylogs_str_idx++; +} + +const char *read_keylog(void) { + return keylog_str; +} + +const char *read_keylogs(void) { + return keylogs_str; +} diff --git a/keyboards/yosino58/lib/layer_state_reader.c b/keyboards/yosino58/lib/layer_state_reader.c new file mode 100644 index 00000000000..7e5747cb75a --- /dev/null +++ b/keyboards/yosino58/lib/layer_state_reader.c @@ -0,0 +1,35 @@ + +#include QMK_KEYBOARD_H +#include +#include "yosino58.h" + +#define L_BASE 0 +#define L_LOWER 8 +#define L_RAISE 16 +#define L_ADJUST 65536 +#define L_ADJUST_TRI 65560 + +char layer_state_str[24]; + +const char *read_layer_state(void) { + switch (layer_state) + { + case L_BASE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default"); + break; + case L_RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case L_LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case L_ADJUST: + case L_ADJUST_TRI: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); + } + + return layer_state_str; +} diff --git a/keyboards/yosino58/lib/logo_reader.c b/keyboards/yosino58/lib/logo_reader.c new file mode 100644 index 00000000000..96c9b897ef5 --- /dev/null +++ b/keyboards/yosino58/lib/logo_reader.c @@ -0,0 +1,11 @@ +#include "yosino58.h" + +const char *read_logo(void) { + static char logo[] = { + 0x2B,0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, + 0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, + 0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, + 0}; + + return logo; +} diff --git a/keyboards/yosino58/lib/mode_icon_reader.c b/keyboards/yosino58/lib/mode_icon_reader.c new file mode 100644 index 00000000000..865d9537ded --- /dev/null +++ b/keyboards/yosino58/lib/mode_icon_reader.c @@ -0,0 +1,15 @@ +#include +#include "yosino58.h" + +char mode_icon[24]; + +const char *read_mode_icon(bool swap) { + static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; + if (swap == false) { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]); + } else { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]); + } + + return mode_icon; +} diff --git a/keyboards/yosino58/lib/rgb_state_reader.c b/keyboards/yosino58/lib/rgb_state_reader.c new file mode 100644 index 00000000000..e0efe2e5288 --- /dev/null +++ b/keyboards/yosino58/lib/rgb_state_reader.c @@ -0,0 +1,15 @@ +#ifdef RGBLIGHT_ENABLE + +#include QMK_KEYBOARD_H +#include + +extern rgblight_config_t rgblight_config; +char rbf_info_str[24]; +const char *read_rgb_info(void) { + + snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d", + rgblight_config.enable ? "on" : "- ", rgblight_config.mode, + rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + return rbf_info_str; +} +#endif diff --git a/keyboards/yosino58/lib/timelogger.c b/keyboards/yosino58/lib/timelogger.c new file mode 100644 index 00000000000..ce8b0c270fe --- /dev/null +++ b/keyboards/yosino58/lib/timelogger.c @@ -0,0 +1,16 @@ +#include +#include "yosino58.h" + +char timelog_str[24] = {}; +int last_time = 0; +int elapsed_time = 0; + +void set_timelog(void) { + elapsed_time = timer_elapsed(last_time); + last_time = timer_read(); + snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); +} + +const char *read_timelog(void) { + return timelog_str; +} diff --git a/keyboards/crkbd/pro_micro.h b/keyboards/yosino58/pro_micro.h similarity index 100% rename from keyboards/crkbd/pro_micro.h rename to keyboards/yosino58/pro_micro.h diff --git a/keyboards/yosino58/readme.md b/keyboards/yosino58/readme.md new file mode 100644 index 00000000000..50c95bb995f --- /dev/null +++ b/keyboards/yosino58/readme.md @@ -0,0 +1,16 @@ +# yosino58 + +![yosino58](https://booth.pximg.net/4b06a4ec-3a3f-49c5-a9b2-46aa086c82b0/i/1278362/5596aecd-418d-4f28-be64-d8344db22e72_base_resized.jpg) + +yosino58 is a 58-key, Column-Staggered split keyboard. +Compatible with Cherry MX and Kailh low profile switches. Optional support for OLED and Backlight LED. + +Keyboard Maintainer: [sakurachari](https://github.com/sakurachari) +Hardware Supported: yosino58 +Hardware Availability: https://booth.pm/ja/items/1278362 + +Make example for this keyboard (after setting up your build environment): + + make yosino58:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/yosino58/rev1/config.h b/keyboards/yosino58/rev1/config.h new file mode 100644 index 00000000000..0214bc1024f --- /dev/null +++ b/keyboards/yosino58/rev1/config.h @@ -0,0 +1,72 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x0F6A +#define PRODUCT_ID 0x01B8 +#define DEVICE_VER 0x0001 +#define MANUFACTURER sakuranbo0046 +#define PRODUCT yosino58 +#define DESCRIPTION yosino58 is 6x4+5keys column-staggered split keyboard. + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 // Number of LEDs + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/yosino58/rev1/matrix.c b/keyboards/yosino58/rev1/matrix.c new file mode 100644 index 00000000000..718cc574481 --- /dev/null +++ b/keyboards/yosino58/rev1/matrix.c @@ -0,0 +1,357 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "split_scomm.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + TXLED0; + RXLED0; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(int master_changed) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else + int ret=serial_update_buffers(); +#endif + if (ret ) { + if(ret==2) RXLED1; + return 1; + } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH); + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + int mchanged = 1; + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction(mchanged) ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif + for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif + serial_slave_buffer[i] = matrix[offset+i]; + } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/yosino58/rev1/rev1.c b/keyboards/yosino58/rev1/rev1.c new file mode 100644 index 00000000000..ef1f13e4133 --- /dev/null +++ b/keyboards/yosino58/rev1/rev1.c @@ -0,0 +1,8 @@ +#include "yosino58.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif diff --git a/keyboards/yosino58/rev1/rev1.h b/keyboards/yosino58/rev1/rev1.h new file mode 100644 index 00000000000..84d90737d53 --- /dev/null +++ b/keyboards/yosino58/rev1/rev1.h @@ -0,0 +1,40 @@ +#pragma once + +#include "../yosino58.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, LT4, LT5, RT5, RT4, R30, R31, R32, R33, R34, R35, \ + LT1, LT2, LT3, RT3, RT2, RT1 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, LT1, LT2, LT3, LT4, LT5 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { KC_NO, RT1,RT2, RT3, RT4, RT5 }, \ + } diff --git a/keyboards/yosino58/rev1/rules.mk b/keyboards/yosino58/rev1/rules.mk new file mode 100644 index 00000000000..6028b5a5b95 --- /dev/null +++ b/keyboards/yosino58/rev1/rules.mk @@ -0,0 +1,3 @@ +SRC += rev1/matrix.c +SRC += rev1/split_util.c +SRC += rev1/split_scomm.c diff --git a/keyboards/yosino58/rev1/serial_config.h b/keyboards/yosino58/rev1/serial_config.h new file mode 100644 index 00000000000..4fab8e8ddfc --- /dev/null +++ b/keyboards/yosino58/rev1/serial_config.h @@ -0,0 +1,4 @@ +#ifndef SOFT_SERIAL_PIN +#define SOFT_SERIAL_PIN D2 +#define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/yosino58/rev1/serial_config_simpleapi.h b/keyboards/yosino58/rev1/serial_config_simpleapi.h new file mode 100644 index 00000000000..0e1dd9e4acb --- /dev/null +++ b/keyboards/yosino58/rev1/serial_config_simpleapi.h @@ -0,0 +1,5 @@ +#pragma once + +#undef SERIAL_USE_MULTI_TRANSACTION +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 diff --git a/keyboards/yosino58/rev1/split_scomm.c b/keyboards/yosino58/rev1/split_scomm.c new file mode 100644 index 00000000000..a1fe6ba5b82 --- /dev/null +++ b/keyboards/yosino58/rev1/split_scomm.c @@ -0,0 +1,91 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include +#include +#include +#include +#include "serial.h" +#ifdef CONSOLE_ENABLE + #include +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status, smatstatus; + static int need_retry = 0; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3]); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; + } + return smatstatus; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/yosino58/rev1/split_scomm.h b/keyboards/yosino58/rev1/split_scomm.h new file mode 100644 index 00000000000..873d8939d81 --- /dev/null +++ b/keyboards/yosino58/rev1/split_scomm.h @@ -0,0 +1,24 @@ +#ifndef SPLIT_COMM_H +#define SPLIT_COMM_H + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif + +#endif /* SPLIT_COMM_H */ diff --git a/keyboards/yosino58/rev1/split_util.c b/keyboards/yosino58/rev1/split_util.c new file mode 100644 index 00000000000..e1ff8b4379d --- /dev/null +++ b/keyboards/yosino58/rev1/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "split_scomm.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/yosino58/rules.mk b/keyboards/yosino58/rules.mk new file mode 100644 index 00000000000..25f135a8e89 --- /dev/null +++ b/keyboards/yosino58/rules.mk @@ -0,0 +1,75 @@ +SRC += i2c.c +SRC += serial.c +SRC += ssd1306.c + +# if firmware size over limit, try this option +# CFLAGS += -flto + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SUBPROJECT_rev1 = no +USE_I2C = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = yosino58/rev1 diff --git a/keyboards/yosino58/serial.c b/keyboards/yosino58/serial.c new file mode 100644 index 00000000000..325c29a3f70 --- /dev/null +++ b/keyboards/yosino58/serial.c @@ -0,0 +1,590 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include +#include "serial.h" +//#include + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ + int result; + result = soft_serial_transaction(); + return result; +} + +#endif // end of Simple API (OLD API, compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static void serial_delay(void) ALWAYS_INLINE; +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; + } + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/yosino58/serial.h b/keyboards/yosino58/serial.h new file mode 100644 index 00000000000..7e0c0847a43 --- /dev/null +++ b/keyboards/yosino58/serial.h @@ -0,0 +1,84 @@ +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H + +#include + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE Simple API (OLD API, compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if SERIAL_SLAVE_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#endif +#if SERIAL_MASTER_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +#endif + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); + +#endif // USE Simple API + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif + +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/yosino58/ssd1306.c b/keyboards/yosino58/ssd1306.c new file mode 100644 index 00000000000..3353f615f58 --- /dev/null +++ b/keyboards/yosino58/ssd1306.c @@ -0,0 +1,348 @@ +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include +#include "print.h" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +extern const unsigned char font[] PROGMEM; + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 30000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +static bool force_dirty = true; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + i2c_master_init(); + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + +#ifdef SSD1306_128X64 + send_cmd2(SetComPins, 0x12); +#else + send_cmd2(SetComPins, 0x2); +#endif + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data) { + char data_ln[strlen(data)+2]; + snprintf(data_ln, sizeof(data_ln), "%s\n", data); + matrix_write(matrix, data_ln); +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty|| force_dirty) { + iota_gfx_flush(); + force_dirty = false; + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + +#endif diff --git a/keyboards/yosino58/ssd1306.h b/keyboards/yosino58/ssd1306.h new file mode 100644 index 00000000000..de0a9a02aa5 --- /dev/null +++ b/keyboards/yosino58/ssd1306.h @@ -0,0 +1,96 @@ +#pragma once + +#include +#include +#include "pincontrol.h" +#include "action.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#ifdef SSD1306_128X64 +#define DisplayHeight 64 +#else +#define DisplayHeight 32 +#endif +#define DisplayWidth 128 + + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); \ No newline at end of file diff --git a/keyboards/yosino58/yosino58.c b/keyboards/yosino58/yosino58.c new file mode 100644 index 00000000000..ff3ec10e5a4 --- /dev/null +++ b/keyboards/yosino58/yosino58.c @@ -0,0 +1,10 @@ +#include "yosino58.h" +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { +#ifdef SSD1306OLED + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +#else + return process_record_user(keycode, record); +#endif +} diff --git a/keyboards/yosino58/yosino58.h b/keyboards/yosino58/yosino58.h new file mode 100644 index 00000000000..5414c31bd80 --- /dev/null +++ b/keyboards/yosino58/yosino58.h @@ -0,0 +1,5 @@ +#pragma once + +#ifdef KEYBOARD_yosino58_rev1 + #include "rev1.h" +#endif diff --git a/keyboards/z150_blackheart/config.h b/keyboards/z150_blackheart/config.h index 36215365226..fc33021ffcd 100644 --- a/keyboards/z150_blackheart/config.h +++ b/keyboards/z150_blackheart/config.h @@ -23,7 +23,7 @@ #define DIODE_DIRECTION COL2ROW /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -34,11 +34,6 @@ /* force n-key rollover*/ #define FORCE_NKRO -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/z150_blackheart/info.json b/keyboards/z150_blackheart/info.json new file mode 100644 index 00000000000..016641254c3 --- /dev/null +++ b/keyboards/z150_blackheart/info.json @@ -0,0 +1,191 @@ +{ + "keyboard_name": "Z-150 Blackheart", + "url": "", + "maintainer": "qmk, blindassassin111", + "width": 21.25, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 84, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F2", "x":1, "y":0}, + {"label":"Esc", "x":2.5, "y":0}, + {"label":"!", "x":3.5, "y":0}, + {"label":"@", "x":4.5, "y":0}, + {"label":"#", "x":5.5, "y":0}, + {"label":"$", "x":6.5, "y":0}, + {"label":"%", "x":7.5, "y":0}, + {"label":"^", "x":8.5, "y":0}, + {"label":"&", "x":9.5, "y":0}, + {"label":"*", "x":10.5, "y":0}, + {"label":"(", "x":11.5, "y":0}, + {"label":")", "x":12.5, "y":0}, + {"label":"_", "x":13.5, "y":0}, + {"label":"+", "x":14.5, "y":0}, + {"label":"Backspace", "x":15.5, "y":0, "w":1.75}, + {"label":"Num Lock", "x":17.25, "y":0}, + {"label":"Scroll Lock", "x":18.25, "y":0, "w":1.5}, + {"label":"Sys Req", "x":19.75, "y":0, "w":1.5}, + {"label":"F3", "x":0, "y":1}, + {"label":"F4", "x":1, "y":1}, + {"label":"Tab", "x":2.5, "y":1, "w":1.5}, + {"label":"Q", "x":4, "y":1}, + {"label":"W", "x":5, "y":1}, + {"label":"E", "x":6, "y":1}, + {"label":"R", "x":7, "y":1}, + {"label":"T", "x":8, "y":1}, + {"label":"Y", "x":9, "y":1}, + {"label":"U", "x":10, "y":1}, + {"label":"I", "x":11, "y":1}, + {"label":"O", "x":12, "y":1}, + {"label":"P", "x":13, "y":1}, + {"label":"{", "x":14, "y":1}, + {"label":"}", "x":15, "y":1, "w":1.25}, + {"label":"Enter", "x":15.25, "y":2, "w":2}, + {"label":"7", "x":17.25, "y":1}, + {"label":"8", "x":18.25, "y":1}, + {"label":"9", "x":19.25, "y":1}, + {"label":"PrtSc", "x":20.25, "y":1}, + {"label":"F5", "x":0, "y":2}, + {"label":"F6", "x":1, "y":2}, + {"label":"Ctrl", "x":2.5, "y":2, "w":1.75}, + {"label":"A", "x":4.25, "y":2}, + {"label":"S", "x":5.25, "y":2}, + {"label":"D", "x":6.25, "y":2}, + {"label":"F", "x":7.25, "y":2}, + {"label":"G", "x":8.25, "y":2}, + {"label":"H", "x":9.25, "y":2}, + {"label":"J", "x":10.25, "y":2}, + {"label":"K", "x":11.25, "y":2}, + {"label":"L", "x":12.25, "y":2}, + {"label":":", "x":13.25, "y":2}, + {"label":"\"", "x":14.25, "y":2}, + {"label":"4", "x":17.25, "y":2}, + {"label":"5", "x":18.25, "y":2}, + {"label":"6", "x":19.25, "y":2}, + {"label":"-", "x":20.25, "y":2}, + {"label":"F7", "x":0, "y":3}, + {"label":"F8", "x":1, "y":3}, + {"label":"Shift", "x":2.5, "y":3, "w":2.25}, + {"label":"Z", "x":4.75, "y":3}, + {"label":"X", "x":5.75, "y":3}, + {"label":"C", "x":6.75, "y":3}, + {"label":"V", "x":7.75, "y":3}, + {"label":"B", "x":8.75, "y":3}, + {"label":"N", "x":9.75, "y":3}, + {"label":"M", "x":10.75, "y":3}, + {"label":"<", "x":11.75, "y":3}, + {"label":">", "x":12.75, "y":3}, + {"label":"?", "x":13.75, "y":3}, + {"label":"Shift", "x":14.75, "y":3, "w":1.5}, + {"label":"|", "x":16.25, "y":3}, + {"label":"1", "x":17.25, "y":3}, + {"label":"2", "x":18.25, "y":3}, + {"label":"3", "x":19.25, "y":3}, + {"label":"+", "x":20.25, "y":3, "h":2}, + {"label":"F9", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + {"label":"Alt", "x":2.5, "y":4, "w":1.75}, + {"label":"~", "x":4.25, "y":4}, + {"label":"Space", "x":5.25, "y":4, "w":9}, + {"label":"Caps Lock", "x":14.25, "y":4, "w":2}, + {"label":"0", "x":16.25, "y":4, "w":2}, + {"label":".", "x":18.25, "y":4, "w":2} + ] + }, + "LAYOUT_z150_tkl": { + "key_count": 88, + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F2", "x":1, "y":0}, + {"label":"Esc", "x":2.5, "y":0}, + {"label":"1", "x":3.5, "y":0}, + {"label":"2", "x":4.5, "y":0}, + {"label":"3", "x":5.5, "y":0}, + {"label":"4", "x":6.5, "y":0}, + {"label":"5", "x":7.5, "y":0}, + {"label":"6", "x":8.5, "y":0}, + {"label":"7", "x":9.5, "y":0}, + {"label":"8", "x":10.5, "y":0}, + {"label":"9", "x":11.5, "y":0}, + {"label":"0", "x":12.5, "y":0}, + {"label":"-", "x":13.5, "y":0}, + {"label":"=", "x":14.5, "y":0}, + {"label":"Backspace", "x":15.5, "y":0, "w":2}, + {"label":"Insert", "x":18.25, "y":0}, + {"label":"Home", "x":19.25, "y":0}, + {"label":"PgUp", "x":20.25, "y":0}, + {"label":"F3", "x":0, "y":1}, + {"label":"F4", "x":1, "y":1}, + {"label":"Tab", "x":2.5, "y":1, "w":1.5}, + {"label":"Q", "x":4, "y":1}, + {"label":"W", "x":5, "y":1}, + {"label":"E", "x":6, "y":1}, + {"label":"R", "x":7, "y":1}, + {"label":"T", "x":8, "y":1}, + {"label":"Y", "x":9, "y":1}, + {"label":"U", "x":10, "y":1}, + {"label":"I", "x":11, "y":1}, + {"label":"O", "x":12, "y":1}, + {"label":"P", "x":13, "y":1}, + {"label":"[", "x":14, "y":1}, + {"label":"]", "x":15, "y":1}, + {"label":"\\", "x":16, "y":1, "w":1.5}, + {"label":"Delete", "x":18.25, "y":1}, + {"label":"End", "x":19.25, "y":1}, + {"label":"PgDn", "x":20.25, "y":1}, + {"label":"F5", "x":0, "y":2}, + {"label":"F6", "x":1, "y":2}, + {"label":"Caps Lock", "x":2.5, "y":2, "w":1.75}, + {"label":"A", "x":4.25, "y":2}, + {"label":"S", "x":5.25, "y":2}, + {"label":"D", "x":6.25, "y":2}, + {"label":"F", "x":7.25, "y":2}, + {"label":"G", "x":8.25, "y":2}, + {"label":"H", "x":9.25, "y":2}, + {"label":"J", "x":10.25, "y":2}, + {"label":"K", "x":11.25, "y":2}, + {"label":"L", "x":12.25, "y":2}, + {"label":";", "x":13.25, "y":2}, + {"label":"'", "x":14.25, "y":2}, + {"label":"Enter", "x":15.25, "y":2, "w":2.25}, + {"x":18.25, "y":2}, + {"x":19.25, "y":2}, + {"x":20.25, "y":2}, + {"label":"F7", "x":0, "y":3}, + {"label":"F8", "x":1, "y":3}, + {"label":"Shift", "x":2.5, "y":3, "w":1.25}, + {"label":"ISO \\", "x":3.75, "y":3}, + {"label":"Z", "x":4.75, "y":3}, + {"label":"X", "x":5.75, "y":3}, + {"label":"C", "x":6.75, "y":3}, + {"label":"V", "x":7.75, "y":3}, + {"label":"B", "x":8.75, "y":3}, + {"label":"N", "x":9.75, "y":3}, + {"label":"M", "x":10.75, "y":3}, + {"label":",", "x":11.75, "y":3}, + {"label":".", "x":12.75, "y":3}, + {"label":"/", "x":13.75, "y":3}, + {"label":"Shift", "x":14.75, "y":3, "w":1.75}, + {"label":"Fn", "x":16.5, "y":3}, + {"x":18.25, "y":3}, + {"label":"Up", "x":19.25, "y":3}, + {"x":20.25, "y":3}, + {"label":"F9", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + {"label":"Ctrl", "x":2.5, "y":4, "w":1.25}, + {"label":"Win", "x":3.75, "y":4, "w":1.25}, + {"label":"Alt", "x":5, "y":4, "w":1.25}, + {"label":"Space", "x":6.25, "y":4, "w":6.25}, + {"label":"Alt", "x":12.5, "y":4, "w":1.25}, + {"label":"Win", "x":13.75, "y":4, "w":1.25}, + {"label":"Menu", "x":15, "y":4, "w":1.25}, + {"label":"Ctrl", "x":16.25, "y":4, "w":1.25}, + {"label":"Left", "x":18.25, "y":4}, + {"label":"Down", "x":19.25, "y":4}, + {"label":"Right", "x":20.25, "y":4} + ] + } + } +} diff --git a/keyboards/z150_blackheart/keymaps/default/keymap.c b/keyboards/z150_blackheart/keymaps/default/keymap.c index e93802052a5..ff4f6f7f9d6 100644 --- a/keyboards/z150_blackheart/keymaps/default/keymap.c +++ b/keyboards/z150_blackheart/keymaps/default/keymap.c @@ -1,38 +1,37 @@ +/* Copyright 2018 blindassassin111 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT( - KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_SLCK, MO(1), - KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, KC_P7, KC_P8, KC_P9, KC_PAST, - KC_F5, KC_F6, KC_LCTRL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_P4, KC_P5, KC_P6, KC_PMNS, - KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH, KC_RSFT, KC_BSLS, KC_P1, KC_P2, KC_P3, KC_PPLS, - KC_F9, KC_F10, KC_LALT, KC_GRV, KC_SPC, KC_CAPS, KC_P0, KC_PDOT - ), - - LAYOUT( - _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), - - LAYOUT_z150_tkl( - KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, - KC_F7, KC_F8, KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, MO(1), XXXXXXX, KC_UP, XXXXXXX, - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - - LAYOUT_z150_tkl( - _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), + [0] = LAYOUT( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_SLCK, MO(1), + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, KC_P7, KC_P8, KC_P9, KC_PAST, + KC_F5, KC_F6, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_P4, KC_P5, KC_P6, KC_PMNS, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_BSLS, KC_P1, KC_P2, KC_P3, KC_PPLS, + KC_F9, KC_F10, KC_LALT, KC_GRV, KC_SPC, KC_CAPS, KC_P0, KC_PDOT + ), + + [1] = LAYOUT( + _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), }; void matrix_init_user(void) { @@ -42,28 +41,8 @@ void matrix_scan_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } void led_set_user(uint8_t usb_led) { - DDRB |= (1 << 0); - DDRE |= (1 << 6) | (1 << 7); - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - PORTE |= (1 << 7); - } else { - PORTE &= ~(1 << 7); - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - PORTB |= (1 << 0); - } else { - PORTB &= ~(1 << 0); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - PORTE |= (1 << 6); - } else { - PORTE &= ~(1 << 6); - } } \ No newline at end of file diff --git a/keyboards/z150_blackheart/keymaps/default_tkl/keymap.c b/keyboards/z150_blackheart/keymaps/default_tkl/keymap.c new file mode 100644 index 00000000000..f1a24b8ddab --- /dev/null +++ b/keyboards/z150_blackheart/keymaps/default_tkl/keymap.c @@ -0,0 +1,48 @@ +/* Copyright 2018 blindassassin111 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_z150_tkl( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F7, KC_F8, KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), XXXXXXX, KC_UP, XXXXXXX, + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = LAYOUT_z150_tkl( + _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { +} \ No newline at end of file diff --git a/keyboards/z150_blackheart/readme.md b/keyboards/z150_blackheart/readme.md index 5e87b6c8f38..331f85694e3 100644 --- a/keyboards/z150_blackheart/readme.md +++ b/keyboards/z150_blackheart/readme.md @@ -5,7 +5,7 @@ A replacement PCB for Zenith Z-150 keyboards. Keyboard Maintainer: QMK Community and blindassassin111 Hardware Supported: Z-150 blackheart PCB -Hardware Availability: https://deskthority.net/group-buys-f50/programmable-vintage-board-pcbs-omnikey-at101-and-z-150-t19325.html +Hardware Availability: [Deskthority Group Buy](https://deskthority.net/group-buys-f50/programmable-vintage-board-pcbs-omnikey-at101-and-z-150-t19325.html) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/z150_blackheart/z150_blackheart.c b/keyboards/z150_blackheart/z150_blackheart.c index 10f388cf62d..b754c64a12a 100644 --- a/keyboards/z150_blackheart/z150_blackheart.c +++ b/keyboards/z150_blackheart/z150_blackheart.c @@ -1 +1,32 @@ #include "z150_blackheart.h" + +void matrix_init_kb(void) { + setPinOutput(B0); + setPinOutput(E6); + setPinOutput(E7); + + matrix_init_user(); +}; + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinHigh(E7); + } else { + writePinLow(E7); + } + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinHigh(B0); + } else { + writePinLow(B0); + } + + if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { + writePinHigh(E6); + } else { + writePinLow(E6); + } + + led_set_user(usb_led); +} diff --git a/keyboards/z150_blackheart/z150_blackheart.h b/keyboards/z150_blackheart/z150_blackheart.h index baf187fd2d1..f97ac1c0358 100644 --- a/keyboards/z150_blackheart/z150_blackheart.h +++ b/keyboards/z150_blackheart/z150_blackheart.h @@ -1,34 +1,31 @@ -#ifndef z150_blackheart_H -#define z150_blackheart_H +#pragma once #include "quantum.h" #define LAYOUT( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K019, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, K216, K217, K218, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, \ - K400, K401, K402, K403, K407, K414, K415, K417 \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0J, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, K2G, K2H, K2I, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, \ + K40, K41, K42, K43, K47, K4E, K4F, K4H \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, KC_NO, K019 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215, K216, K217, K218, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, KC_NO }, \ - { K400, K401, K402, K403, KC_NO, KC_NO, KC_NO, K407, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K414, K415, KC_NO, K417, KC_NO, KC_NO } \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, KC_NO, K0J }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F, K2G, K2H, K2I, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, KC_NO }, \ + { K40, K41, K42, K43, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K4E, K4F, KC_NO, K4H, KC_NO, KC_NO } \ } #define LAYOUT_z150_tkl( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K017, K018, K019, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K117, K118, K119, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, \ - K300, K301, K302, K405, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K316, K317, K318, \ - K400, K401, K402, K403, K404, K407, K412, K413, K414, K415, K416, K417, K418 \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0H, K0I, K0J, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1H, K1I, K1J, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2G, K2H, K2I, \ + K30, K31, K32, K45, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3G, K3H, K3I, \ + K40, K41, K42, K43, K44, K47, K4C, K4D, K4E, K4F, K4G, K4H, K4I \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, KC_NO, K017, K018, K019 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, KC_NO, K117, K118, K119 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, KC_NO, K216, K217, K218, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, KC_NO, K316, K317, K318, KC_NO }, \ - { K400, K401, K402, K403, K404, K405, KC_NO, K407, KC_NO, KC_NO, KC_NO, KC_NO, K412, K413, K414, K415, K416, K417, K418, KC_NO } \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, KC_NO, K0H, K0I, K0J }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, KC_NO, K1H, K1I, K1J }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, KC_NO, K2G, K2H, K2I, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, KC_NO, K3G, K3H, K3I, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, KC_NO, K47, KC_NO, KC_NO, KC_NO, KC_NO, K4C, K4D, K4E, K4F, K4G, K4H, K4I, KC_NO } \ } - -#endif \ No newline at end of file diff --git a/keyboards/zeal60/config.h b/keyboards/zeal60/config.h deleted file mode 100644 index baa4978a834..00000000000 --- a/keyboards/zeal60/config.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "config_common.h" - -// USB Device descriptor parameter -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER ZealPC -#define PRODUCT Zeal60 -#define DESCRIPTION Zeal60 (QMK Firmware) - -// key matrix size -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -// Zeal60 PCB default pin-out -#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } -#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } -#define UNUSED_PINS - -// IS31FL3731 driver -#define DRIVER_COUNT 2 -#define DRIVER_LED_TOTAL 72 - -// COL2ROW or ROW2COL -#define DIODE_DIRECTION COL2ROW - -// Set 0 if debouncing isn't needed -#define DEBOUNCING_DELAY 5 - -// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap -#define LOCKING_SUPPORT_ENABLE -// Locking resynchronize hack -#define LOCKING_RESYNC_ENABLE - -// key combination for command -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -// disable debug print -//#define NO_DEBUG - -// disable print -//#define NO_PRINT - -// disable action features -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#define RGB_BACKLIGHT_ENABLED 1 - -// This conditionally compiles the backlight code for Zeal60 specifics -#define RGB_BACKLIGHT_ZEAL60 - -// enable/disable LEDs based on layout -#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 -#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 -#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 -#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 -#define RGB_BACKLIGHT_USE_ISO_ENTER 0 -#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 - -// disable backlight when USB suspended (PC sleep/hibernate/shutdown) -#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 - -// disable backlight after timeout in minutes, 0 = no timeout -#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 - -// the default effect (RGB test) -#define RGB_BACKLIGHT_EFFECT 255 - -// These define which keys in the matrix are alphas/mods -// Used for backlight effects so colors are different for -// alphas vs. mods -// Each value is for a row, bit 0 is column 0 -// Alpha=0 Mod=1 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0010000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0001000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111 - -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 - -// EEPROM usage - -// TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F -#define EEPROM_MAGIC_ADDR 32 -// Bump this every time we change what we store -// This will automatically reset the EEPROM with defaults -// and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 -#define EEPROM_VERSION_ADDR 34 - -// Backlight config starts after EEPROM version -#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 - diff --git a/keyboards/zeal60/info.json b/keyboards/zeal60/info.json deleted file mode 100644 index c4234e49a45..00000000000 --- a/keyboards/zeal60/info.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "keyboard_name": "Zeal60", - "url": "", - "maintainer": "Wilba", - "bootloader": "DFU", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT_all": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_iso": { - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_ansi_split_bs_rshift": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_hhkb": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] - } - } -} \ No newline at end of file diff --git a/keyboards/zeal60/keymaps/tusing/keymap.c b/keyboards/zeal60/keymaps/tusing/keymap.c deleted file mode 100644 index 41d2effd468..00000000000 --- a/keyboards/zeal60/keymaps/tusing/keymap.c +++ /dev/null @@ -1,49 +0,0 @@ -// Default layout for Zeal60 -#include QMK_KEYBOARD_H - -// For readability. -#define _______ KC_TRNS -#define _x_ KC_NO -#define AUD_PRV LCTL(KC_MPRV) // Previous music track -#define AUD_PLY LCTL(KC_MPLY) // Pause music -#define AUD_NXT LCTL(KC_MNXT) // Next music track - -// Zeal60-specific keys: -// EF_INC, EF_DEC, // next/previous backlight effect -// H1_INC, H1_DEC, // Color 1 hue increase/decrease -// S1_INC, S1_DEC, // Color 1 saturation increase/decrease -// H2_INC, H2_DEC, // Color 2 hue increase/decrease -// S2_INC, S2_DEC, // Color 2 saturation increase/decrease -// BR_INC, BR_DEC, // backlight brightness increase/decrease - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -// Default layer: Pressing caps-lock momentarily switches to Layer 1. -// This is the default layer. Pressing an empty keycode on another layer will take you here. - [0] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC}, - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS}, - {MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, _x_ }, - {KC_LSFT, _x_ , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, _x_ }, - {KC_LCTL, KC_LGUI, KC_LALT, _x_ , _x_ , _x_ , _x_ , KC_SPC, _x_ , _x_ , KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} - }, - -// Layer 1: Pressing enter switches to layer 2, where backlight controls live. -// This is a momentary layer: once you let go of caps, you'll be back in layer 1. - [1] = { - {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL }, - {_______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, KC_DEL, _______}, - {_______, AUD_PRV, AUD_PLY, AUD_NXT, _______, _______, _______, _______, _______, _______, _______, _______, TO(2) , _x_ }, - {KC_CAPS, _x_ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _x_ }, - {KC_RCTL, KC_RGUI, KC_RALT, _x_ , _x_ , _x_ , _x_ , _______, _x_ , _x_ , KC_HOME, KC_PGUP, KC_PGDN, KC_END} - }, - -// Layer 2: Zeal60 and backlight configuration. (Get here quickly by pressing Caps+Enter from Layer 1.) -// This is a persistent layer. Get back to the default layer by pressing enter. - [2] = { - {RESET, EF_DEC, EF_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, _______, _______, _______, _______, _______, _______, _______}, - {_______, H1_DEC, H1_INC, S1_DEC, S1_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, H2_DEC, H2_INC, S2_DEC, S2_INC, _______, _______, _______, _______, _______, _______, _______, TO(0) , _x_ }, - {RGB_MOD, _x_ , RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _x_ }, - {RGB_TOG, RGB_VAD, RGB_VAI, _x_ , _x_ , _x_ , _x_ , _______, _x_ , _x_ , _______, _______, _______, _______} - } -}; diff --git a/keyboards/zeal60/readme.md b/keyboards/zeal60/readme.md deleted file mode 100644 index 9eca28f83ea..00000000000 --- a/keyboards/zeal60/readme.md +++ /dev/null @@ -1,47 +0,0 @@ -Zeal60 -==== - -![Zeal60](https://cdn.shopify.com/s/files/1/0490/7329/products/Zeal60.jpg) - -This is a 60% PCB with per-key RGB LEDs and supports ANSI, ISO, winkey/winkeyless bottom row, HHKB-layout (split right shift and backspace). - -Keyboard Maintainer: [Wilba](http://wilba.tech/) and on [github](https://github.com/Wilba6582) -Hardware Supported: Zeal60 PCB Rev 0-3 -Hardware Availability: https://zealpc.net/collections/group-buy-pre-orders/products/zeal60rgb - -Make example for this keyboard (after setting up your build environment): - - make zeal60:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). - - -RGB Backlight Configuration -==== - -A keymap (in the keymaps directory) can optionally configure which RGB backlight LEDs are used, depending on the needs of the layout, by adding a config.h file in the keymap's directory. -The following #define symbols will enable/disable a feature using 1 or 0. - - RGB_BACKLIGHT_USE_SPLIT_BACKSPACE - -Split backspace is being used, enables the right LED of the split backspace (the top-right corner) - - RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT - -Split left shift is being used (i.e. ISO layout), enables the right LED of the split left shift (the ISO key) - - RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT - -Split right shift is being used (i.e. HHKB style layouts), enables the right LED of the split right shift (the Fn key) - - RGB_BACKLIGHT_USE_7U_SPACEBAR - -A 7U spacebar is being used, controls the LEDs under the right stabilizer (of 7U spacebar) and right Alt (if 6.25U spacebar). - - RGB_BACKLIGHT_USE_ISO_ENTER - -An ISO Enter is being used. Only used to tweak the location of the LED being used under ANSI Enter/backslash - - RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS - -Disables the LEDs under HHKB corner blockers, useful for transparent cases. diff --git a/keyboards/zeal60/rgb_backlight.c b/keyboards/zeal60/rgb_backlight.c deleted file mode 100644 index ce8b1cb1792..00000000000 --- a/keyboards/zeal60/rgb_backlight.c +++ /dev/null @@ -1,1544 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#if RGB_BACKLIGHT_ENABLED - -#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_ZEAL65) || defined (RGB_BACKLIGHT_M60_A) -#else -#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A -#endif - -#include "zeal60.h" -#include "rgb_backlight.h" -#include "rgb_backlight_api.h" -#include "rgb_backlight_keycodes.h" - -#include -#include -#include -#include "progmem.h" - -#include "quantum/color.h" -#include "drivers/avr/i2c_master.h" -#include "drivers/issi/is31fl3731.h" - -#define BACKLIGHT_EFFECT_MAX 10 - -backlight_config g_config = { - .use_split_backspace = RGB_BACKLIGHT_USE_SPLIT_BACKSPACE, - .use_split_left_shift = RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT, - .use_split_right_shift = RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT, - .use_7u_spacebar = RGB_BACKLIGHT_USE_7U_SPACEBAR, - .use_iso_enter = RGB_BACKLIGHT_USE_ISO_ENTER, - .disable_hhkb_blocker_leds = RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS, - .disable_when_usb_suspended = RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED, - .disable_after_timeout = RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT, - .brightness = 255, - .effect = RGB_BACKLIGHT_EFFECT, - .effect_speed = 0, - .color_1 = { .h = 0, .s = 255, .v = 255 }, - .color_2 = { .h = 127, .s = 255, .v = 255 }, - .caps_lock_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, - .layer_1_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, - .layer_2_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, - .layer_3_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, - .alphas_mods = { - RGB_BACKLIGHT_ALPHAS_MODS_ROW_0, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_1, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_2, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_3, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 } -}; - -bool g_suspend_state = false; -uint8_t g_indicator_state = 0; - -// Global tick at 20 Hz -uint32_t g_tick = 0; - -// Ticks since this key was last hit. -uint8_t g_key_hit[72]; - -// Ticks since any key was last hit. -uint32_t g_any_key_hit = 0; - -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -#define ISSI_ADDR_1 0x74 -#define ISSI_ADDR_2 0x76 - -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - {0, C2_1, C3_1, C4_1}, // LA0 - {0, C1_1, C3_2, C4_2}, // LA1 - {0, C1_2, C2_2, C4_3}, // LA2 - {0, C1_3, C2_3, C3_3}, // LA3 - {0, C1_4, C2_4, C3_4}, // LA4 - {0, C1_5, C2_5, C3_5}, // LA5 - {0, C1_6, C2_6, C3_6}, // LA6 - {0, C1_7, C2_7, C3_7}, // LA7 - {0, C1_8, C2_8, C3_8}, // LA8 - {0, C9_1, C8_1, C7_1}, // LA9 - {0, C9_2, C8_2, C7_2}, // LA10 - {0, C9_3, C8_3, C7_3}, // LA11 - {0, C9_4, C8_4, C7_4}, // LA12 - {0, C9_5, C8_5, C7_5}, // LA13 - {0, C9_6, C8_6, C7_6}, // LA14 - {0, C9_7, C8_7, C6_6}, // LA15 - {0, C9_8, C7_7, C6_7}, // LA16 - {0, C8_8, C7_8, C6_8}, // LA17 - - {0, C2_9, C3_9, C4_9}, // LB0 - {0, C1_9, C3_10, C4_10}, // LB1 - {0, C1_10, C2_10, C4_11}, // LB2 - {0, C1_11, C2_11, C3_11}, // LB3 - {0, C1_12, C2_12, C3_12}, // LB4 - {0, C1_13, C2_13, C3_13}, // LB5 - {0, C1_14, C2_14, C3_14}, // LB6 - {0, C1_15, C2_15, C3_15}, // LB7 - {0, C1_16, C2_16, C3_16}, // LB8 - {0, C9_9, C8_9, C7_9}, // LB9 - {0, C9_10, C8_10, C7_10}, // LB10 - {0, C9_11, C8_11, C7_11}, // LB11 - {0, C9_12, C8_12, C7_12}, // LB12 - {0, C9_13, C8_13, C7_13}, // LB13 - {0, C9_14, C8_14, C7_14}, // LB14 - {0, C9_15, C8_15, C6_14}, // LB15 - {0, C9_16, C7_15, C6_15}, // LB16 - {0, C8_16, C7_16, C6_16}, // LB17 - - {1, C2_1, C3_1, C4_1}, // LC0 - {1, C1_1, C3_2, C4_2}, // LC1 - {1, C1_2, C2_2, C4_3}, // LC2 - {1, C1_3, C2_3, C3_3}, // LC3 - {1, C1_4, C2_4, C3_4}, // LC4 - {1, C1_5, C2_5, C3_5}, // LC5 - {1, C1_6, C2_6, C3_6}, // LC6 - {1, C1_7, C2_7, C3_7}, // LC7 - {1, C1_8, C2_8, C3_8}, // LC8 - {1, C9_1, C8_1, C7_1}, // LC9 - {1, C9_2, C8_2, C7_2}, // LC10 - {1, C9_3, C8_3, C7_3}, // LC11 - {1, C9_4, C8_4, C7_4}, // LC12 - {1, C9_5, C8_5, C7_5}, // LC13 - {1, C9_6, C8_6, C7_6}, // LC14 - {1, C9_7, C8_7, C6_6}, // LC15 - {1, C9_8, C7_7, C6_7}, // LC16 - {1, C8_8, C7_8, C6_8}, // LC17 - - {1, C2_9, C3_9, C4_9}, // LD0 - {1, C1_9, C3_10, C4_10}, // LD1 - {1, C1_10, C2_10, C4_11}, // LD2 - {1, C1_11, C2_11, C3_11}, // LD3 - {1, C1_12, C2_12, C3_12}, // LD4 - {1, C1_13, C2_13, C3_13}, // LD5 - {1, C1_14, C2_14, C3_14}, // LD6 - {1, C1_15, C2_15, C3_15}, // LD7 - {1, C1_16, C2_16, C3_16}, // LD8 - {1, C9_9, C8_9, C7_9}, // LD9 - {1, C9_10, C8_10, C7_10}, // LD10 - {1, C9_11, C8_11, C7_11}, // LD11 - {1, C9_12, C8_12, C7_12}, // LD12 - {1, C9_13, C8_13, C7_13}, // LD13 - {1, C9_14, C8_14, C7_14}, // LD14 - {1, C9_15, C8_15, C6_14}, // LD15 - {1, C9_16, C7_15, C6_15}, // LD16 - {1, C8_16, C7_16, C6_16}, // LD17 -}; - - - -typedef struct Point { - uint8_t x; - uint8_t y; -} Point; - - -// index in range 0..71 (LA0..LA17, LB0..LB17, LC0..LC17, LD0..LD17) -// point values in range x=0..224 y=0..64 -// origin is center of top-left key (i.e Esc) -#if defined (RGB_BACKLIGHT_ZEAL65) -const Point g_map_led_to_point[72] PROGMEM = { - // LA0..LA17 - {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, - {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, - // LB0..LB17 - {144,0}, {160,0}, {176,0}, {192,0}, {216,0}, {224,0}, {240,0}, {240,16}, {240,32}, - {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {240,48}, {240,64}, {224,64}, - // LC0..LC17 - {96,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {255,255}, {48,60}, {28,64}, - {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {20,44}, {10,48}, {4,64}, - // LD0..LD17 - {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {202,48}, {224,48}, - {116,48}, {132,48}, {148,48}, {164,48}, {255,255}, {144,60}, {164,64}, {188,64}, {208,64} -}; -const Point g_map_led_to_point_polar[72] PROGMEM = { - // LA0..LA17 - {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,247}, - {61,255}, {67,255}, {72,255}, {77,255}, {82,255}, {86,255}, {90,255}, {93,255}, {96,255}, - // LB0..LB17 - {56,255}, {51,255}, {46,255}, {42,255}, {37,255}, {35,255}, {32,255}, {19,255}, {0,255}, - {53,132}, {44,145}, {37,164}, {31,187}, {26,213}, {22,249}, {237,255}, {224,255}, {221,255}, - // LC0..LC17 - {184,255}, {179,135}, {170,149}, {163,169}, {157,193}, {153,220}, {255,255}, {167,255}, {165,255}, - {128,26}, {128,60}, {128,94}, {128,128}, {128,162}, {128,196}, {145,233}, {148,255}, {161,255}, - // LD0..LD17 - {0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {255,201}, {224,181}, {230,217}, {235,255}, - {189,128}, {200,131}, {210,141}, {218,159}, {201,228}, {201,228}, {206,255}, {213,255}, {218,255} -}; -#elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) -const Point g_map_led_to_point[72] PROGMEM = { - // LA0..LA17 - {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, - {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, - // LB0..LB17 - {144,0}, {160,0}, {176,0}, {192,0}, {216,0}, {224,0}, {255,255}, {255,255}, {255,255}, - {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {255,255}, {255,255}, {255,255}, - // LC0..LC17 - {102,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {60,64}, {43,64}, {23,64}, - {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {20,48}, {2,48}, {3,64}, - // LD0..LD17 - {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {210,48}, {224,48}, - {116,48}, {132,48}, {148,48}, {164,48}, {144,64}, {161,64}, {181,64}, {201,64}, {221,64} -}; -const Point g_map_led_to_point_polar[72] PROGMEM = { - // LA0..LA17 - {58,129}, {70,129}, {80,139}, {89,157}, {96,181}, {101,208}, {105,238}, {109,255}, {128,247}, {58,255}, - {64,255}, {70,255}, {75,255}, {80,255}, {85,255}, {89,255}, {93,255}, {96,255}, - // LB0..LB17 - {53,255}, {48,255}, {43,255}, {39,255}, {34,255}, {32,255}, {255,255}, {255,255}, {255,255}, - {48,139}, {39,157}, {32,181}, {27,208}, {23,238}, {19,255}, {255,255}, {255,255}, {255,255}, - // LC0..LC17 - {188,255}, {183,131}, {173,143}, {165,163}, {159,188}, {154,216}, {172,252}, {170,255}, {165,255}, - {128,9}, {128,46}, {128,82}, {128,119}, {128,155}, {128,192}, {150,244}, {147,255}, {161,255}, - // LD0..LD17 - {0,27}, {0,64}, {0,101}, {0,137}, {0,174}, {255,233}, {228,201}, {235,255}, {237,255}, - {195,128}, {206,136}, {215,152}, {222,175}, {205,234}, {209,255}, {214,255}, {219,255}, {223,255} -}; -#endif - -// This may seem counter-intuitive, but it's quite flexible. -// For each LED, get it's position to decide what color to make it. -// This solves the issue of LEDs (and switches) not aligning to a grid, -// or having a large "bitmap" and sampling them. -void map_led_to_point( uint8_t index, Point *point ) -{ - // Slightly messy way to get Point structs out of progmem. - uint8_t *addr = (uint8_t*)&g_map_led_to_point[index]; - point->x = pgm_read_byte(addr); - point->y = pgm_read_byte(addr+1); - - switch (index) - { - case 18+4: // LB4A - if ( g_config.use_split_backspace ) - point->x -= 8; - break; - case 18+14: // LB14A - if ( g_config.use_iso_enter ) - point->y += 8; // extremely pedantic - break; -#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) - case 36+0: // LC0A - if ( g_config.use_7u_spacebar ) - point->x += 10; - break; - case 36+6: // LC6A - if ( g_config.use_7u_spacebar ) - point->x += 4; - break; -#endif - case 36+16: // LC16A - if ( !g_config.use_split_left_shift ) - point->x += 8; - break; - case 54+5: // LD5A - if ( !g_config.use_iso_enter ) - point->x -= 10; - break; - case 54+7: // LD7A - if ( !g_config.use_split_right_shift ) - point->x -= 8; - break; - } -} - -void map_led_to_point_polar( uint8_t index, Point *point ) -{ - // Slightly messy way to get Point structs out of progmem. - uint8_t *addr = (uint8_t*)&g_map_led_to_point_polar[index]; - point->x = pgm_read_byte(addr); - point->y = pgm_read_byte(addr+1); -} - -// -// Maps switch matrix coordinate (row,col) to LED index -// - - -#if defined (RGB_BACKLIGHT_ZEAL65) -// Note: Left spacebar stab is at 4,3 (LC7) -// Right spacebar stab is at 4,9 (D14) -// -// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, B6 -// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, B7 -// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, B8 -// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, B15 -// C17, C8, C7, ---, ---, ---, ---, C0, ---, D14, D15, D16, D17, B17, B16 -const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { - { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4, 18+6 }, - { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14, 18+7 }, - { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5, 18+8 }, - { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8, 18+15 }, - { 36+17, 36+8, 36+7, 255, 255, 255, 255, 36+0, 255, 54+14, 54+15, 54+16, 54+17, 18+17, 18+16 } -}; -#elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) -// Note: Left spacebar stab is at 4,3 (LC6) -// Right spacebar stab is at 4,9 (LD13) or 4,10 (LD14) -// -// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, -// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, -// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, -// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, -// C17, C8, C7, C6, ---, ---, ---, C0, ---, D13, D14, D15, D16, D17, -const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { - { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4 }, - { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14 }, - { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5 }, - { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8 }, - { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 54+13, 54+14, 54+15, 54+16, 54+17 } -}; -#endif - -void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ) -{ - *led = 255; - if ( row < MATRIX_ROWS && column < MATRIX_COLS ) - { - *led = pgm_read_byte(&g_map_row_column_to_led[row][column]); - } -} - -void backlight_update_pwm_buffers(void) -{ - IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, ISSI_ADDR_2 ); - IS31FL3731_update_led_control_registers( ISSI_ADDR_1, ISSI_ADDR_2 ); -} - -void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) -{ - IS31FL3731_set_color( index, red, green, blue ); -} - -void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) -{ - IS31FL3731_set_color_all( red, green, blue ); -} - -void backlight_set_key_hit(uint8_t row, uint8_t column) -{ - uint8_t led; - map_row_column_to_led(row,column,&led); - g_key_hit[led] = 0; - - g_any_key_hit = 0; -} - -// This is (F_CPU/1024) / 20 Hz -// = 15625 Hz / 20 Hz -// = 781 -#define TIMER3_TOP 781 - -void backlight_timer_init(void) -{ - static uint8_t backlight_timer_is_init = 0; - if ( backlight_timer_is_init ) - { - return; - } - backlight_timer_is_init = 1; - - // Timer 3 setup - TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP - _BV(CS32) | _BV(CS30); // prescale by /1024 - // Set TOP value - uint8_t sreg = SREG; - cli(); - - OCR3AH = (TIMER3_TOP >> 8) & 0xff; - OCR3AL = TIMER3_TOP & 0xff; - SREG = sreg; -} - -void backlight_timer_enable(void) -{ - TIMSK3 |= _BV(OCIE3A); -} - -void backlight_timer_disable(void) -{ - TIMSK3 &= ~_BV(OCIE3A); -} - -void backlight_set_suspend_state(bool state) -{ - g_suspend_state = state; -} - -void backlight_set_indicator_state(uint8_t state) -{ - g_indicator_state = state; -} - -void backlight_effect_rgb_test(void) -{ - // Mask out bits 4 and 5 - // This 2-bit value will stay the same for 16 ticks. - switch ( (g_tick & 0x30) >> 4 ) - { - case 0: - { - backlight_set_color_all( 255, 0, 0 ); - break; - } - case 1: - { - backlight_set_color_all( 0, 255, 0 ); - break; - } - case 2: - { - backlight_set_color_all( 0, 0, 255 ); - break; - } - case 3: - { - backlight_set_color_all( 255, 255, 255 ); - break; - } - } -} - -// This tests the LEDs -// Note that it will change the LED control registers -// in the LED drivers, and leave them in an invalid -// state for other backlight effects. -// ONLY USE THIS FOR TESTING LEDS! -void backlight_effect_single_LED_test(void) -{ - static uint8_t color = 0; // 0,1,2 for R,G,B - static uint8_t row = 0; - static uint8_t column = 0; - - static uint8_t tick = 0; - tick++; - - if ( tick > 2 ) - { - tick = 0; - column++; - } - if ( column > 14 ) - { - column = 0; - row++; - } - if ( row > 4 ) - { - row = 0; - color++; - } - if ( color > 2 ) - { - color = 0; - } - - uint8_t led; - map_row_column_to_led( row, column, &led ); - backlight_set_color_all( 255, 255, 255 ); - backlight_test_led( led, color==0, color==1, color==2 ); -} - -// All LEDs off -void backlight_effect_all_off(void) -{ - backlight_set_color_all( 0, 0, 0 ); -} - -// Solid color -void backlight_effect_solid_color(void) -{ - HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; - RGB rgb = hsv_to_rgb( hsv ); - backlight_set_color_all( rgb.r, rgb.g, rgb.b ); -} - -// alphas = color1, mods = color2 -void backlight_effect_alphas_mods(void) -{ - RGB rgb1 = hsv_to_rgb( (HSV){ .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness } ); - RGB rgb2 = hsv_to_rgb( (HSV){ .h = g_config.color_2.h, .s = g_config.color_2.s, .v = g_config.brightness } ); - - for ( int row = 0; row < MATRIX_ROWS; row++ ) - { - for ( int column = 0; column < MATRIX_COLS; column++ ) - { - uint8_t index; - map_row_column_to_led( row, column, &index ); - if ( index < 72 ) - { - if ( ( g_config.alphas_mods[row] & (1< 127 ) - { - deltaH -= 256; - } - else if ( deltaH < -127 ) - { - deltaH += 256; - } - // Divide delta by 4, this gives the delta per row - deltaH /= 4; - - int16_t s1 = g_config.color_1.s; - int16_t s2 = g_config.color_2.s; - int16_t deltaS = ( s2 - s1 ) / 4; - - HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; - RGB rgb; - Point point; - for ( int i=0; i<72; i++ ) - { - map_led_to_point( i, &point ); - // The y range will be 0..64, map this to 0..4 - uint8_t y = (point.y>>4); - // Relies on hue being 8-bit and wrapping - hsv.h = g_config.color_1.h + ( deltaH * y ); - hsv.s = g_config.color_1.s + ( deltaS * y ); - rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -void backlight_effect_raindrops(bool initialize) -{ - int16_t h1 = g_config.color_1.h; - int16_t h2 = g_config.color_2.h; - int16_t deltaH = h2 - h1; - deltaH /= 4; - - // Take the shortest path between hues - if ( deltaH > 127 ) - { - deltaH -= 256; - } - else if ( deltaH < -127 ) - { - deltaH += 256; - } - - int16_t s1 = g_config.color_1.s; - int16_t s2 = g_config.color_2.s; - int16_t deltaS = ( s2 - s1 ) / 4; - - HSV hsv; - RGB rgb; - - // Change one LED every tick - uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % 72 : 255; - - for ( int i=0; i<72; i++ ) - { - // If initialize, all get set to random colors - // If not, all but one will stay the same as before. - if ( initialize || i == led_to_change ) - { - hsv.h = h1 + ( deltaH * ( rand() & 0x03 ) ); - hsv.s = s1 + ( deltaS * ( rand() & 0x03 ) ); - // Override brightness with global brightness control - hsv.v = g_config.brightness;; - - rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } - } -} - -void backlight_effect_cycle_all(void) -{ - uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; - - // Relies on hue being 8-bit and wrapping - for ( int i=0; i<72; i++ ) - { - uint16_t offset2 = g_key_hit[i]<<2; - // stabilizer LEDs use spacebar hits - if ( i == 36+6 || i == 54+13 || // LC6, LD13 - ( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14 - { - offset2 = g_key_hit[36+0]<<2; - } - offset2 = (offset2<=63) ? (63-offset2) : 0; - - HSV hsv = { .h = offset+offset2, .s = 255, .v = g_config.brightness }; - RGB rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -void backlight_effect_cycle_left_right(void) -{ - uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; - HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; - RGB rgb; - Point point; - for ( int i=0; i<72; i++ ) - { - uint16_t offset2 = g_key_hit[i]<<2; - // stabilizer LEDs use spacebar hits - if ( i == 36+6 || i == 54+13 || // LC6, LD13 - ( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14 - { - offset2 = g_key_hit[36+0]<<2; - } - offset2 = (offset2<=63) ? (63-offset2) : 0; - - map_led_to_point( i, &point ); - // Relies on hue being 8-bit and wrapping - hsv.h = point.x + offset + offset2; - rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -void backlight_effect_cycle_up_down(void) -{ - uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; - HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; - RGB rgb; - Point point; - for ( int i=0; i<72; i++ ) - { - uint16_t offset2 = g_key_hit[i]<<2; - // stabilizer LEDs use spacebar hits - if ( i == 36+6 || i == 54+13 || // LC6, LD13 - ( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14 - { - offset2 = g_key_hit[36+0]<<2; - } - offset2 = (offset2<=63) ? (63-offset2) : 0; - - map_led_to_point( i, &point ); - // Relies on hue being 8-bit and wrapping - hsv.h = point.y + offset + offset2; - rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -void backlight_effect_jellybean_raindrops( bool initialize ) -{ - HSV hsv; - RGB rgb; - - // Change one LED every tick - uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % 72 : 255; - - for ( int i=0; i<72; i++ ) - { - // If initialize, all get set to random colors - // If not, all but one will stay the same as before. - if ( initialize || i == led_to_change ) - { - hsv.h = rand() & 0xFF; - hsv.s = rand() & 0xFF; - // Override brightness with global brightness control - hsv.v = g_config.brightness;; - - rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } - } -} - -void backlight_effect_cycle_radial1(void) -{ - uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; - HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; - RGB rgb; - Point point; - for ( int i=0; i<72; i++ ) - { - map_led_to_point_polar( i, &point ); - // Relies on hue being 8-bit and wrapping - hsv.h = point.x + offset; - hsv.s = point.y; - rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -void backlight_effect_cycle_radial2(void) -{ - uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; - - HSV hsv = { .h = 0, .s = g_config.color_1.s, .v = g_config.brightness }; - RGB rgb; - Point point; - for ( int i=0; i<72; i++ ) - { - map_led_to_point_polar( i, &point ); - uint8_t offset2 = offset + point.x; - if ( offset2 & 0x80 ) - { - offset2 = ~offset2; - } - offset2 = offset2 >> 2; - hsv.h = g_config.color_1.h + offset2; - hsv.s = 127 + ( point.y >> 1 ); - rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -void backlight_effect_indicators_set_colors( uint8_t index, HSV hsv ) -{ - RGB rgb = hsv_to_rgb( hsv ); - if ( index == 254 ) - { - backlight_set_color_all( rgb.r, rgb.g, rgb.b ); - } - else - { - backlight_set_color( index, rgb.r, rgb.g, rgb.b ); - - // If the spacebar LED is the indicator, - // do the same for the spacebar stabilizers - if ( index == 36+0 ) // LC0 - { -#if defined (RGB_BACKLIGHT_ZEAL65) - backlight_set_color( 36+7, rgb.r, rgb.g, rgb.b ); // LC7 - backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14 -#elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) - backlight_set_color( 36+6, rgb.r, rgb.g, rgb.b ); // LC6 - backlight_set_color( 54+13, rgb.r, rgb.g, rgb.b ); // LD13 - if ( g_config.use_7u_spacebar ) - { - backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14 - } -#endif - } - } -} - -// This runs after another backlight effect and replaces -// colors already set -void backlight_effect_indicators(void) -{ - if ( g_config.caps_lock_indicator.index != 255 && - ( g_indicator_state & (1< 0 && g_any_key_hit > g_config.disable_after_timeout * 60 * 20)); - uint8_t effect = suspend_backlight ? 0 : g_config.effect; - - // Keep track of the effect used last time, - // detect change in effect, so each effect can - // have an optional initialization. - static uint8_t effect_last = 255; - bool initialize = effect != effect_last; - effect_last = effect; - - // this gets ticked at 20 Hz. - // each effect can opt to do calculations - // and/or request PWM buffer updates. - switch ( effect ) - { - case 0: - backlight_effect_all_off(); - break; - case 1: - backlight_effect_solid_color(); - break; - case 2: - backlight_effect_alphas_mods(); - break; - case 3: - backlight_effect_gradient_up_down(); - break; - case 4: - backlight_effect_raindrops( initialize ); - break; - case 5: - backlight_effect_cycle_all(); - break; - case 6: - backlight_effect_cycle_left_right(); - break; - case 7: - backlight_effect_cycle_up_down(); - break; - case 8: - backlight_effect_jellybean_raindrops( initialize ); - break; - case 9: - backlight_effect_cycle_radial1(); - break; - case 10: - backlight_effect_cycle_radial2(); - break; - default: - backlight_effect_all_off(); - break; - } - - if ( ! suspend_backlight ) - { - backlight_effect_indicators(); - } -} - -void backlight_set_indicator_index( uint8_t *index, uint8_t row, uint8_t column ) -{ - if ( row >= MATRIX_ROWS ) - { - // Special value, 255=none, 254=all - *index = row; - } - else - { - map_row_column_to_led( row, column, index ); - } -} - -void backlight_get_indicator_row_col( uint8_t index, uint8_t *row, uint8_t *column ) -{ - if ( index == 255 || index == 254 ) - { - // Special value, 255=none, 254=all - *row = index; - *column = 0; - return; - } - for ( uint8_t r = 0; r < MATRIX_ROWS; r++ ) - { - for ( uint8_t c = 0; c < MATRIX_COLS; c++ ) - { - uint8_t i = 255; - map_row_column_to_led( r, c, &i ); - if ( i == index ) - { - *row = r; - *column = c; - return; - } - } - } -} - -// Some helpers for setting/getting HSV -void _set_color( HSV *color, uint8_t *data ) -{ - color->h = data[0]; - color->s = data[1]; - color->v = data[2]; -} - -void _get_color( HSV *color, uint8_t *data ) -{ - data[0] = color->h; - data[1] = color->s; - data[2] = color->v; -} - -void backlight_config_set_value( uint8_t *data ) -{ - bool reinitialize = false; - uint8_t *value_id = &(data[0]); - uint8_t *value_data = &(data[1]); - switch ( *value_id ) - { -#if defined (RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_ZEAL65) - case id_use_split_backspace: - { - g_config.use_split_backspace = (bool)*value_data; - reinitialize = true; - break; - } -#endif -#if defined (RGB_BACKLIGHT_ZEAL60) - case id_use_split_left_shift: - { - g_config.use_split_left_shift = (bool)*value_data; - reinitialize = true; - break; - } - case id_use_split_right_shift: - { - g_config.use_split_right_shift = (bool)*value_data; - reinitialize = true; - break; - } - case id_use_7u_spacebar: - { - g_config.use_7u_spacebar = (bool)*value_data; - reinitialize = true; - break; - } - case id_use_iso_enter: - { - g_config.use_iso_enter = (bool)*value_data; - reinitialize = true; - break; - } - case id_disable_hhkb_blocker_leds: - { - g_config.disable_hhkb_blocker_leds = (bool)*value_data; - reinitialize = true; - break; - } -#endif - case id_disable_when_usb_suspended: - { - g_config.disable_when_usb_suspended = (bool)*value_data; - break; - } - case id_disable_after_timeout: - { - g_config.disable_after_timeout = *value_data; - break; - } - case id_brightness: - { - g_config.brightness = *value_data; - break; - } - case id_effect: - { - g_config.effect = *value_data; - break; - } - case id_effect_speed: - { - g_config.effect_speed = *value_data; - break; - } - case id_color_1: - { - _set_color( &(g_config.color_1), value_data ); - break; - } - case id_color_2: - { - _set_color( &(g_config.color_2), value_data ); - break; - } - case id_caps_lock_indicator_color: - { - _set_color( &(g_config.caps_lock_indicator.color), value_data ); - break; - } - case id_caps_lock_indicator_row_col: - { - backlight_set_indicator_index( &(g_config.caps_lock_indicator.index), value_data[0], value_data[1] ); - break; - } - case id_layer_1_indicator_color: - { - _set_color( &(g_config.layer_1_indicator.color), value_data ); - break; - } - case id_layer_1_indicator_row_col: - { - backlight_set_indicator_index( &(g_config.layer_1_indicator.index), value_data[0], value_data[1] ); - break; - } - case id_layer_2_indicator_color: - { - _set_color( &(g_config.layer_2_indicator.color), value_data ); - break; - } - case id_layer_2_indicator_row_col: - { - backlight_set_indicator_index( &(g_config.layer_2_indicator.index), value_data[0], value_data[1] ); - break; - } - case id_layer_3_indicator_color: - { - _set_color( &(g_config.layer_3_indicator.color), value_data ); - break; - } - case id_layer_3_indicator_row_col: - { - backlight_set_indicator_index( &(g_config.layer_3_indicator.index), value_data[0], value_data[1] ); - break; - } - case id_alphas_mods: - { - for ( int i=0; i<5; i++ ) - { - g_config.alphas_mods[i] = ( *(value_data+i*2) << 8 ) | ( *(value_data+i*2+1) ); - } - } - } - - if ( reinitialize ) - { - backlight_init_drivers(); - } -} - -void backlight_config_get_value( uint8_t *data ) -{ - uint8_t *value_id = &(data[0]); - uint8_t *value_data = &(data[1]); - switch ( *value_id ) - { - case id_use_split_backspace: - { - *value_data = ( g_config.use_split_backspace ? 1 : 0 ); - break; - } - case id_use_split_left_shift: - { - *value_data = ( g_config.use_split_left_shift ? 1 : 0 ); - break; - } - case id_use_split_right_shift: - { - *value_data = ( g_config.use_split_right_shift ? 1 : 0 ); - break; - } - case id_use_7u_spacebar: - { - *value_data = ( g_config.use_7u_spacebar ? 1 : 0 ); - break; - } - case id_use_iso_enter: - { - *value_data = ( g_config.use_iso_enter ? 1 : 0 ); - break; - } - case id_disable_when_usb_suspended: - { - *value_data = ( g_config.disable_when_usb_suspended ? 1 : 0 ); - break; - } - case id_disable_hhkb_blocker_leds: - { - *value_data = ( g_config.disable_hhkb_blocker_leds ? 1 : 0 ); - break; - } - case id_disable_after_timeout: - { - *value_data = g_config.disable_after_timeout; - break; - } - case id_brightness: - { - *value_data = g_config.brightness; - break; - } - case id_effect: - { - *value_data = g_config.effect; - break; - } - case id_effect_speed: - { - *value_data = g_config.effect_speed; - break; - } - case id_color_1: - { - _get_color( &(g_config.color_1), value_data ); - break; - } - case id_color_2: - { - _get_color( &(g_config.color_2), value_data ); - break; - } - case id_caps_lock_indicator_color: - { - _get_color( &(g_config.caps_lock_indicator.color), value_data ); - break; - } - case id_caps_lock_indicator_row_col: - { - backlight_get_indicator_row_col( g_config.caps_lock_indicator.index, &(value_data[0]), &(value_data[1]) ); - break; - } - case id_layer_1_indicator_color: - { - _get_color( &(g_config.layer_1_indicator.color), value_data ); - break; - } - case id_layer_1_indicator_row_col: - { - backlight_get_indicator_row_col( g_config.layer_1_indicator.index, &(value_data[0]), &(value_data[1]) ); - break; - } - case id_layer_2_indicator_color: - { - _get_color( &(g_config.layer_2_indicator.color), value_data ); - break; - } - case id_layer_2_indicator_row_col: - { - backlight_get_indicator_row_col( g_config.layer_2_indicator.index, &(value_data[0]), &(value_data[1]) ); - break; - } - case id_layer_3_indicator_color: - { - _get_color( &(g_config.layer_3_indicator.color), value_data ); - break; - } - case id_layer_3_indicator_row_col: - { - backlight_get_indicator_row_col( g_config.layer_3_indicator.index, &(value_data[0]), &(value_data[1]) ); - break; - } - case id_alphas_mods: - { - for ( int i=0; i<5; i++ ) - { - *(value_data+i*2) = g_config.alphas_mods[i] >> 8; - *(value_data+i*2+1) = g_config.alphas_mods[i] & 0xFF; - } - } - } -} - -void backlight_config_set_alphas_mods( uint16_t *alphas_mods ) -{ - for ( int i=0; i<5; i++ ) - { - g_config.alphas_mods[i] = alphas_mods[i]; - } - - backlight_config_save(); -} - -void backlight_config_load(void) -{ - eeprom_read_block( &g_config, ((void*)RGB_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) ); -} - -void backlight_config_save(void) -{ - eeprom_update_block( &g_config, ((void*)RGB_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) ); -} - -void backlight_init_drivers(void) -{ - // Initialize I2C - i2c_init(); - IS31FL3731_init( ISSI_ADDR_1 ); - IS31FL3731_init( ISSI_ADDR_2 ); - - for ( int index = 0; index < 72; index++ ) - { - // OR the possible "disabled" cases together, then NOT the result to get the enabled state - // LC6 LD13 not present on Zeal65 -#if defined (RGB_BACKLIGHT_ZEAL65) - bool enabled = !( ( index == 18+5 && !g_config.use_split_backspace ) || // LB5 - ( index == 36+15 && !g_config.use_split_left_shift ) || // LC15 - ( index == 54+8 && !g_config.use_split_right_shift ) || // LD8 - ( index == 36+6 ) || // LC6 - ( index == 54+13 ) ); // LD13 -#elif defined (RGB_BACKLIGHT_M60_A) - bool enabled = !( - // LB6 LB7 LB8 LB15 LB16 LB17 not present on M60-A - ( index == 18+6 ) || // LB6 - ( index == 18+7 ) || // LB7 - ( index == 18+8 ) || // LB8 - ( index == 18+15 ) || // LB15 - ( index == 18+16 ) || // LB16 - ( index == 18+17 ) || // LB17 - // HHKB blockers (LC17, LD17) and ISO extra keys (LC15,LD13) not present on M60-A - ( index == 36+17 ) || // LC17 - ( index == 54+17 ) || // LD17 - ( index == 36+15 ) || // LC15 - ( index == 54+13 ) ); // LD13 -#elif defined (RGB_BACKLIGHT_ZEAL60) - // LB6 LB7 LB8 LB15 LB16 LB17 not present on Zeal60 - bool enabled = !( ( index == 18+5 && !g_config.use_split_backspace ) || // LB5 - ( index == 36+15 && !g_config.use_split_left_shift ) || // LC15 - ( index == 54+8 && !g_config.use_split_right_shift ) || // LD8 - ( index == 54+13 && g_config.use_7u_spacebar ) || // LD13 - ( index == 36+17 && g_config.disable_hhkb_blocker_leds ) || // LC17 - ( index == 54+17 && g_config.disable_hhkb_blocker_leds ) || // LD17 - ( index == 18+6 ) || // LB6 - ( index == 18+7 ) || // LB7 - ( index == 18+8 ) || // LB8 - ( index == 18+15 ) || // LB15 - ( index == 18+16 ) || // LB16 - ( index == 18+17 ) ); // LB17 -#endif - // This only caches it for later - IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); - } - // This actually updates the LED drivers - IS31FL3731_update_led_control_registers( ISSI_ADDR_1, ISSI_ADDR_2 ); - - // TODO: put the 1 second startup delay here? - - // clear the key hits - for ( int led=0; led<72; led++ ) - { - g_key_hit[led] = 255; - } -} - -bool process_record_backlight(uint16_t keycode, keyrecord_t *record) -{ - // Record keypresses for backlight effects - if ( record->event.pressed ) - { - backlight_set_key_hit( record->event.key.row, record->event.key.col ); - } - - switch(keycode) - { - case BR_INC: - if (record->event.pressed) - { - backlight_brightness_increase(); - } - return false; - break; - case BR_DEC: - if (record->event.pressed) - { - backlight_brightness_decrease(); - } - return false; - break; - case EF_INC: - if (record->event.pressed) - { - backlight_effect_increase(); - } - return false; - break; - case EF_DEC: - if (record->event.pressed) - { - backlight_effect_decrease(); - } - return false; - break; - case ES_INC: - if (record->event.pressed) - { - backlight_effect_speed_increase(); - } - return false; - break; - case ES_DEC: - if (record->event.pressed) - { - backlight_effect_speed_decrease(); - } - return false; - break; - case H1_INC: - if (record->event.pressed) - { - backlight_color_1_hue_increase(); - } - return false; - break; - case H1_DEC: - if (record->event.pressed) - { - backlight_color_1_hue_decrease(); - } - return false; - break; - case S1_INC: - if (record->event.pressed) - { - backlight_color_1_sat_increase(); - } - return false; - break; - case S1_DEC: - if (record->event.pressed) - { - backlight_color_1_sat_decrease(); - break; - } - return false; - break; - case H2_INC: - if (record->event.pressed) - { - backlight_color_2_hue_increase(); - } - return false; - break; - case H2_DEC: - if (record->event.pressed) - { - backlight_color_2_hue_decrease(); - } - return false; - break; - case S2_INC: - if (record->event.pressed) - { - backlight_color_2_sat_increase(); - } - return false; - break; - case S2_DEC: - if (record->event.pressed) - { - backlight_color_2_sat_decrease(); - break; - } - return false; - break; - } - - return true; -} - -// Deals with the messy details of incrementing an integer -uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) -{ - int16_t new_value = value; - new_value += step; - return MIN( MAX( new_value, min ), max ); -} - -uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) -{ - int16_t new_value = value; - new_value -= step; - return MIN( MAX( new_value, min ), max ); -} - -void backlight_effect_increase(void) -{ - g_config.effect = increment( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX ); - backlight_config_save(); -} - -void backlight_effect_decrease(void) -{ - g_config.effect = decrement( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX ); - backlight_config_save(); -} - -void backlight_effect_speed_increase(void) -{ - g_config.effect_speed = increment( g_config.effect_speed, 1, 0, 3 ); - backlight_config_save(); -} - -void backlight_effect_speed_decrease(void) -{ - g_config.effect_speed = decrement( g_config.effect_speed, 1, 0, 3 ); - backlight_config_save(); -} - -void backlight_brightness_increase(void) -{ - g_config.brightness = increment( g_config.brightness, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_brightness_decrease(void) -{ - g_config.brightness = decrement( g_config.brightness, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_color_1_hue_increase(void) -{ - g_config.color_1.h = increment( g_config.color_1.h, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_color_1_hue_decrease(void) -{ - g_config.color_1.h = decrement( g_config.color_1.h, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_color_1_sat_increase(void) -{ - g_config.color_1.s = increment( g_config.color_1.s, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_color_1_sat_decrease(void) -{ - g_config.color_1.s = decrement( g_config.color_1.s, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_color_2_hue_increase(void) -{ - g_config.color_2.h = increment( g_config.color_2.h, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_color_2_hue_decrease(void) -{ - g_config.color_2.h = decrement( g_config.color_2.h, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_color_2_sat_increase(void) -{ - g_config.color_2.s = increment( g_config.color_2.s, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_color_2_sat_decrease(void) -{ - g_config.color_2.s = decrement( g_config.color_2.s, 8, 0, 255 ); - backlight_config_save(); -} - -void backlight_test_led( uint8_t index, bool red, bool green, bool blue ) -{ - for ( int i=0; i<72; i++ ) - { - if ( i == index ) - { - IS31FL3731_set_led_control_register( i, red, green, blue ); - } - else - { - IS31FL3731_set_led_control_register( i, false, false, false ); - } - } -} - -void backlight_debug_led( bool state ) -{ - if (state) - { - // Output high. - DDRE |= (1<<6); - PORTE |= (1<<6); - } - else - { - // Output low. - DDRE &= ~(1<<6); - PORTE &= ~(1<<6); - } -} - -#endif // BACKLIGHT_ENABLED diff --git a/keyboards/zeal60/rgb_backlight.h b/keyboards/zeal60/rgb_backlight.h deleted file mode 100644 index 60f2ace51af..00000000000 --- a/keyboards/zeal60/rgb_backlight.h +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#if RGB_BACKLIGHT_ENABLED -#else -#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0 -#endif // RGB_BACKLIGHT_ENABLED - -#include -#include - -#include "quantum/color.h" - -typedef struct -{ - HSV color; - uint8_t index; -} backlight_config_indicator; - -typedef struct -{ - bool use_split_backspace:1; // | - bool use_split_left_shift:1; // | - bool use_split_right_shift:1; // | - bool use_7u_spacebar:1; // | - bool use_iso_enter:1; // | - bool disable_when_usb_suspended:1; // | - bool disable_hhkb_blocker_leds:1; // | - bool __pad7:1; // 1 byte - uint8_t disable_after_timeout; // 1 byte - uint8_t brightness; // 1 byte - uint8_t effect; // 1 byte - uint8_t effect_speed; // 1 byte - HSV color_1; // 3 bytes - HSV color_2; // 3 bytes - backlight_config_indicator caps_lock_indicator; // 4 bytes - backlight_config_indicator layer_1_indicator; // 4 bytes - backlight_config_indicator layer_2_indicator; // 4 bytes - backlight_config_indicator layer_3_indicator; // 4 bytes - uint16_t alphas_mods[5]; // 10 bytes -} backlight_config; // = 37 bytes - -void backlight_config_load(void); -void backlight_config_save(void); -void backlight_config_set_value( uint8_t *data ); -void backlight_config_get_value( uint8_t *data ); - -void backlight_init_drivers(void); - -void backlight_timer_init(void); -void backlight_timer_enable(void); -void backlight_timer_disable(void); - -void backlight_set_suspend_state(bool state); -void backlight_set_indicator_state(uint8_t state); - -// This should not be called from an interrupt -// (eg. from a timer interrupt). -// Call this while idle (in between matrix scans). -// If the buffer is dirty, it will update the driver with the buffer. -void backlight_update_pwm_buffers(void); - -// Handle backlight specific keycodes -bool process_record_backlight(uint16_t keycode, keyrecord_t *record); - -void backlight_set_key_hit(uint8_t row, uint8_t col); - -void backlight_effect_increase(void); -void backlight_effect_decrease(void); -void backlight_effect_speed_increase(void); -void backlight_effect_speed_decrease(void); - -void backlight_brightness_increase(void); -void backlight_brightness_decrease(void); - -void backlight_color_1_hue_increase(void); -void backlight_color_1_hue_decrease(void); -void backlight_color_1_sat_increase(void); -void backlight_color_1_sat_decrease(void); -void backlight_color_2_hue_increase(void); -void backlight_color_2_hue_decrease(void); -void backlight_color_2_sat_increase(void); -void backlight_color_2_sat_decrease(void); - -void backlight_test_led( uint8_t index, bool red, bool green, bool blue ); -void backlight_debug_led(bool state); - diff --git a/keyboards/zeal60/rgb_backlight_api.h b/keyboards/zeal60/rgb_backlight_api.h deleted file mode 100644 index 01827e849fc..00000000000 --- a/keyboards/zeal60/rgb_backlight_api.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -enum backlight_config_value -{ - id_use_split_backspace = 0x01, - id_use_split_left_shift = 0x02, - id_use_split_right_shift = 0x03, - id_use_7u_spacebar = 0x04, - id_use_iso_enter = 0x05, - id_disable_hhkb_blocker_leds = 0x06, - id_disable_when_usb_suspended = 0x07, - id_disable_after_timeout = 0x08, - id_brightness = 0x09, - id_effect = 0x0A, - id_effect_speed = 0x0B, - id_color_1 = 0x0C, - id_color_2 = 0x0D, - id_caps_lock_indicator_color = 0x0E, - id_caps_lock_indicator_row_col = 0x0F, - id_layer_1_indicator_color = 0x10, - id_layer_1_indicator_row_col = 0x11, - id_layer_2_indicator_color = 0x12, - id_layer_2_indicator_row_col = 0x13, - id_layer_3_indicator_color = 0x14, - id_layer_3_indicator_row_col = 0x15, - id_alphas_mods = 0x16 -}; diff --git a/keyboards/zeal60/rgb_backlight_keycodes.h b/keyboards/zeal60/rgb_backlight_keycodes.h deleted file mode 100644 index ba7f03f89d4..00000000000 --- a/keyboards/zeal60/rgb_backlight_keycodes.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -// This is hardcoded at 0x5F00 so it's well after keycode value SAFE_RANGE -enum backlight_keycodes { - BR_INC = 0x5F00, // backlight brightness increase - BR_DEC, // backlight brightness decrease - EF_INC, // backlight effect increase - EF_DEC, // backlight effect decrease - ES_INC, - ES_DEC, - H1_INC, - H1_DEC, - S1_INC, - S1_DEC, - H2_INC, - H2_DEC, - S2_INC, - S2_DEC -}; diff --git a/keyboards/zeal60/rules.mk b/keyboards/zeal60/rules.mk deleted file mode 100644 index 1327d88210a..00000000000 --- a/keyboards/zeal60/rules.mk +++ /dev/null @@ -1,79 +0,0 @@ - - -# project specific files -SRC = rgb_backlight.c \ - quantum/color.c \ - drivers/issi/is31fl3731.c \ - drivers/avr/i2c_master.c - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Boot Section -BOOTLOADER = atmel-dfu - -# Do not put the microcontroller into power saving mode -# when we get USB suspend event. We want it to keep updating -# backlight effects. -OPT_DEFS += -DNO_SUSPEND_POWER_DOWN - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -RAW_ENABLE = yes -DYNAMIC_KEYMAP_ENABLE = yes -CIE1931_CURVE = yes - -LAYOUTS = 60_ansi 60_iso 60_hhkb 60_ansi_split_bs_rshift diff --git a/keyboards/zeal60/zeal60.c b/keyboards/zeal60/zeal60.c deleted file mode 100644 index be54f75f3d1..00000000000 --- a/keyboards/zeal60/zeal60.c +++ /dev/null @@ -1,334 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "zeal60.h" -#include "zeal60_api.h" - -// Check that no backlight functions are called -#if RGB_BACKLIGHT_ENABLED -#include "rgb_backlight.h" -#endif // BACKLIGHT_ENABLED - -#include "raw_hid.h" -#include "dynamic_keymap.h" -#include "timer.h" -#include "tmk_core/common/eeprom.h" - -bool eeprom_is_valid(void) -{ - return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && - eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); -} - -void eeprom_set_valid(bool valid) -{ - eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); - eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); -} - -void eeprom_reset(void) -{ - // Set the Zeal60 specific EEPROM state as invalid. - eeprom_set_valid(false); - // Set the TMK/QMK EEPROM state as invalid. - eeconfig_disable(); -} - -#ifdef RAW_ENABLE - -void raw_hid_receive( uint8_t *data, uint8_t length ) -{ - uint8_t *command_id = &(data[0]); - uint8_t *command_data = &(data[1]); - switch ( *command_id ) - { - case id_get_protocol_version: - { - command_data[0] = PROTOCOL_VERSION >> 8; - command_data[1] = PROTOCOL_VERSION & 0xFF; - break; - } - case id_get_keyboard_value: - { - if ( command_data[0] == id_uptime ) - { - uint32_t value = timer_read32(); - command_data[1] = (value >> 24 ) & 0xFF; - command_data[2] = (value >> 16 ) & 0xFF; - command_data[3] = (value >> 8 ) & 0xFF; - command_data[4] = value & 0xFF; - } - else - { - *command_id = id_unhandled; - } - break; - } -#ifdef DYNAMIC_KEYMAP_ENABLE - case id_dynamic_keymap_get_keycode: - { - uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); - command_data[3] = keycode >> 8; - command_data[4] = keycode & 0xFF; - break; - } - case id_dynamic_keymap_set_keycode: - { - dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); - break; - } - case id_dynamic_keymap_reset: - { - dynamic_keymap_reset(); - break; - } -#endif // DYNAMIC_KEYMAP_ENABLE -#if RGB_BACKLIGHT_ENABLED - case id_backlight_config_set_value: - { - backlight_config_set_value(command_data); - break; - } - case id_backlight_config_get_value: - { - backlight_config_get_value(command_data); - break; - } - case id_backlight_config_save: - { - backlight_config_save(); - break; - } -#endif // RGB_BACKLIGHT_ENABLED - case id_eeprom_reset: - { - eeprom_reset(); - break; - } - case id_bootloader_jump: - { - // Need to send data back before the jump - // Informs host that the command is handled - raw_hid_send( data, length ); - // Give host time to read it - wait_ms(100); - bootloader_jump(); - break; - } - default: - { - // Unhandled message. - *command_id = id_unhandled; - break; - } - } - - // Return same buffer with values changed - raw_hid_send( data, length ); - -} - -#endif - -void main_init(void) -{ - // If the EEPROM has the magic, the data is good. - // OK to load from EEPROM. - if (eeprom_is_valid()) { -#if RGB_BACKLIGHT_ENABLED - backlight_config_load(); -#endif // RGB_BACKLIGHT_ENABLED - } else { -#if RGB_BACKLIGHT_ENABLED - // If the EEPROM has not been saved before, or is out of date, - // save the default values to the EEPROM. Default values - // come from construction of the zeal_backlight_config instance. - backlight_config_save(); -#endif // RGB_BACKLIGHT_ENABLED -#ifdef DYNAMIC_KEYMAP_ENABLE - // This resets the keymaps in EEPROM to what is in flash. - dynamic_keymap_reset(); -#endif - // Save the magic number last, in case saving was interrupted - eeprom_set_valid(true); - } -#if RGB_BACKLIGHT_ENABLED - // Initialize LED drivers for backlight. - backlight_init_drivers(); - - backlight_timer_init(); - backlight_timer_enable(); -#endif // RGB_BACKLIGHT_ENABLED -} - -void bootmagic_lite(void) -{ - // The lite version of TMK's bootmagic. - // 100% less potential for accidentally making the - // keyboard do stupid things. - - // We need multiple scans because debouncing can't be turned off. - matrix_scan(); - wait_ms(DEBOUNCING_DELAY); - wait_ms(DEBOUNCING_DELAY); - matrix_scan(); - - // If the Esc (matrix 0,0) is held down on power up, - // reset the EEPROM valid state and jump to bootloader. - if ( matrix_get_row(0) & (1<<0) ) { - eeprom_reset(); - bootloader_jump(); - } -} - -void matrix_init_kb(void) -{ - bootmagic_lite(); - main_init(); - matrix_init_user(); -} - -void matrix_scan_kb(void) -{ -#if RGB_BACKLIGHT_ENABLED - // This only updates the LED driver buffers if something has changed. - backlight_update_pwm_buffers(); -#endif // BACKLIGHT_ENABLED - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) -{ -#if RGB_BACKLIGHT_ENABLED - process_record_backlight(keycode, record); -#endif // BACKLIGHT_ENABLED - - switch(keycode) { - case FN_MO13: - if (record->event.pressed) { - layer_on(1); - update_tri_layer(1, 2, 3); - } else { - layer_off(1); - update_tri_layer(1, 2, 3); - } - return false; - break; - case FN_MO23: - if (record->event.pressed) { - layer_on(2); - update_tri_layer(1, 2, 3); - } else { - layer_off(2); - update_tri_layer(1, 2, 3); - } - return false; - break; - } - - return process_record_user(keycode, record); -} - -// This overrides the one in quantum/keymap_common.c -uint16_t keymap_function_id_to_action( uint16_t function_id ) -{ - // Zeal60 specific "action functions" are 0xF00 to 0xFFF - // i.e. F(0xF00) to F(0xFFF) are mapped to - // enum zeal60_action_functions by masking last 8 bits. - if ( function_id >= 0x0F00 && function_id <= 0x0FFF ) - { - uint8_t id = function_id & 0xFF; - switch ( id ) { - case TRIPLE_TAP_1_3: - case TRIPLE_TAP_2_3: - { - return ACTION_FUNCTION_TAP(id); - break; - } - default: - break; - } - } - -#if USE_KEYMAPS_IN_EEPROM - -#if 0 - // This is how to implement actions stored in EEPROM. - // Not yet implemented. Not sure if it's worth the trouble - // before we have a nice GUI for keymap editing. - if ( eeprom_is_valid() && - function_id < 32 ) // TODO: replace magic number - { - uint16_t action = keymap_action_load(function_id); - - // If action is not "empty", return it, otherwise - // drop down to return the one in flash - if ( action != 0x0000 ) // TODO: replace magic number - { - return action; - } - } -#endif - -#endif // USE_KEYMAPS_IN_EEPROM - - return pgm_read_word(&fn_actions[function_id]); -} - - -// Zeal60 specific "action functions" -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) - { - case TRIPLE_TAP_1_3: - case TRIPLE_TAP_2_3: - if (record->event.pressed) { - layer_on( id == TRIPLE_TAP_1_3 ? 1 : 2 ); - if (record->tap.count && !record->tap.interrupted) { - if (record->tap.count >= 3) { - layer_invert(3); - } - } else { - record->tap.count = 0; - } - } else { - layer_off( id == TRIPLE_TAP_1_3 ? 1 : 2 ); - } - break; - } -} - -void led_set_kb(uint8_t usb_led) -{ -#if RGB_BACKLIGHT_ENABLED - backlight_set_indicator_state(usb_led); -#endif // RGB_BACKLIGHT_ENABLED -} - -void suspend_power_down_kb(void) -{ -#if RGB_BACKLIGHT_ENABLED - backlight_set_suspend_state(true); -#endif // RGB_BACKLIGHT_ENABLED -} - -void suspend_wakeup_init_kb(void) -{ -#if RGB_BACKLIGHT_ENABLED - backlight_set_suspend_state(false); -#endif // RGB_BACKLIGHT_ENABLED -} - diff --git a/keyboards/zeal60/zeal60.h b/keyboards/zeal60/zeal60.h deleted file mode 100644 index ef9de7989e5..00000000000 --- a/keyboards/zeal60/zeal60.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "quantum.h" -#include "rgb_backlight_keycodes.h" -#include "zeal60_keycodes.h" - -#define XXX KC_NO - -#define LAYOUT_60_all( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K47, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ -} - -#define LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K41, K42, K47, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, XXX }, \ - { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ -} - -#define LAYOUT_60_iso( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K41, K42, K47, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, XXX }, \ - { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ -} - -#define LAYOUT_60_ansi_split_bs_rshift( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K47, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ -} - -#define LAYOUT_60_hhkb( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K41, K42, K47, K4B, K4C \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { XXX, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, XXX, K4B, K4C, XXX } \ -} - diff --git a/keyboards/zeal60/zeal60_api.h b/keyboards/zeal60/zeal60_api.h deleted file mode 100644 index a65bf2f509f..00000000000 --- a/keyboards/zeal60/zeal60_api.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#define PROTOCOL_VERSION 0x0007 - -enum zeal60_command_id -{ - id_get_protocol_version = 0x01, // always 0x01 - id_get_keyboard_value, - id_set_keyboard_value, - id_dynamic_keymap_get_keycode, - id_dynamic_keymap_set_keycode, - id_dynamic_keymap_reset, - id_backlight_config_set_value, - id_backlight_config_get_value, - id_backlight_config_save, - id_eeprom_reset, - id_bootloader_jump, - id_unhandled = 0xFF, -}; - -enum zeal60_keyboard_value_id -{ - id_uptime = 0x01 -}; - diff --git a/keyboards/zeal60/zeal60_keycodes.h b/keyboards/zeal60/zeal60_keycodes.h deleted file mode 100644 index 9511801eb26..00000000000 --- a/keyboards/zeal60/zeal60_keycodes.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -// Can't use SAFE_RANGE here, it might change if someone adds -// new values to enum quantum_keycodes. -// Need to keep checking 0x5F10 is still in the safe range. -// TODO: merge this into quantum_keycodes -// Backlight keycodes are in range 0x5F00-0x5F0F -enum zeal60_keycodes { - FN_MO13 = 0x5F10, - FN_MO23 -}; - -// Zeal60 specific "action functions" -// These are only valid IDs in action_function() -// Use FN_TT13, FN_TT23, etc. in keymaps -enum zeal60_action_functions { - TRIPLE_TAP_1_3 = 0x31, - TRIPLE_TAP_2_3 = 0x32 -}; - -// Bitwise OR the above with 0x0F00 to use in F(x) macro -// This reserves the top 256 of the 4096 range of F(x) keycodes, -// leaving the rest for use in fn_actions[] or actions in EEPROM. -#define FN_TT13 F((0x0F00|TRIPLE_TAP_1_3)) -#define FN_TT23 F((0x0F00|TRIPLE_TAP_2_3)) - -#define TG_NKRO MAGIC_TOGGLE_NKRO diff --git a/keyboards/zeal65/config.h b/keyboards/zeal65/config.h deleted file mode 100644 index 2dbf6123783..00000000000 --- a/keyboards/zeal65/config.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "config_common.h" - -// USB Device descriptor parameter -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6065 -#define DEVICE_VER 0x0001 -#define MANUFACTURER ZealPC -#define PRODUCT Zeal65 -#define DESCRIPTION Zeal65 (QMK Firmware) - -// key matrix size -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -// Zeal60 PCB default pin-out -#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } -#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } -#define UNUSED_PINS - -// IS31FL3731 driver -#define DRIVER_COUNT 2 -#define DRIVER_LED_TOTAL 72 - -// COL2ROW or ROW2COL -#define DIODE_DIRECTION COL2ROW - -// Set 0 if debouncing isn't needed -#define DEBOUNCING_DELAY 5 - -// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap -#define LOCKING_SUPPORT_ENABLE -// Locking resynchronize hack -#define LOCKING_RESYNC_ENABLE - -// key combination for command -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -// disable debug print -//#define NO_DEBUG - -// disable print -//#define NO_PRINT - -// disable action features -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#define RGB_BACKLIGHT_ENABLED 1 - -// This conditionally compiles the backlight code for Zeal65 specifics -#define RGB_BACKLIGHT_ZEAL65 - -// enable/disable LEDs based on layout -#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 -#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 -#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 -#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 -#define RGB_BACKLIGHT_USE_ISO_ENTER 0 -#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 - -// disable backlight when USB suspended (PC sleep/hibernate/shutdown) -#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 - -// disable backlight after timeout in minutes, 0 = no timeout -#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 - -// the default effect (RGB test) -#define RGB_BACKLIGHT_EFFECT 255 - -// These define which keys in the matrix are alphas/mods -// Used for backlight effects so colors are different for -// alphas vs. mods -// Each value is for a row, bit 0 is column 0 -// Alpha=0 Mod=1 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0100000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0101000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001 -#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111110000000011 - -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 - -// EEPROM usage - -// TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F -#define EEPROM_MAGIC_ADDR 32 -// Bump this every time we change what we store -// This will automatically reset the EEPROM with defaults -// and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 -#define EEPROM_VERSION_ADDR 34 - -// Backlight config starts after EEPROM version -#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 - diff --git a/keyboards/zeal65/info.json b/keyboards/zeal65/info.json deleted file mode 100644 index 94a090689e5..00000000000 --- a/keyboards/zeal65/info.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "keyboard_name": "Zeal65", - "url": "", - "maintainer": "Wilba", - "bootloader": "DFU", - "width": 16, - "height": 5, - "layouts": { - "LAYOUT_65_split_bs": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Win", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4, "w":1.5}, {"x":3, "y":4, "w":7}, {"label":"Fn2", "x":10, "y":4, "w":1.5}, {"label":"Fn1", "x":11.5, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] - }, - "LAYOUT_65_normie": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Win", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4, "w":1.5}, {"x":3, "y":4, "w":7}, {"label":"Fn2", "x":10, "y":4, "w":1.5}, {"label":"Fn1", "x":11.5, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] - } - } -} \ No newline at end of file diff --git a/keyboards/zeal65/readme.md b/keyboards/zeal65/readme.md deleted file mode 100644 index 8f43dc24356..00000000000 --- a/keyboards/zeal65/readme.md +++ /dev/null @@ -1,16 +0,0 @@ -Zeal65 -==== - -![Zeal65](https://cdn.shopify.com/s/files/1/0490/7329/products/Zeal65_PCB2.jpg) - -This is a 65% PCB with per-key RGB LEDs and supports fixed, 1800-like bottom row and split backspace. It was designed for the Zephyr custom keyboard. - -Keyboard Maintainer: [Wilba](http://wilba.tech/) and on [github](https://github.com/Wilba6582) -Hardware Supported: Zeal65 PCB Rev 1 -Hardware Availability: https://zealpc.net/collections/group-buy-pre-orders/products/zephyr - -Make example for this keyboard (after setting up your build environment): - - make zeal65:default - -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/zeal65/rules.mk b/keyboards/zeal65/rules.mk deleted file mode 100644 index 7ab1b7d3ba9..00000000000 --- a/keyboards/zeal65/rules.mk +++ /dev/null @@ -1,78 +0,0 @@ - - -# project specific files -SRC = ../zeal60/zeal60.c \ - ../zeal60/rgb_backlight.c \ - quantum/color.c \ - drivers/issi/is31fl3731.c \ - drivers/avr/i2c_master.c - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Boot Section -BOOTLOADER = atmel-dfu - -# Do not put the microcontroller into power saving mode -# when we get USB suspend event. We want it to keep updating -# backlight effects. -OPT_DEFS += -DNO_SUSPEND_POWER_DOWN - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -RAW_ENABLE = yes -DYNAMIC_KEYMAP_ENABLE = yes -CIE1931_CURVE = yes diff --git a/keyboards/zeal65/zeal65.h b/keyboards/zeal65/zeal65.h deleted file mode 100644 index 3ee4f49e596..00000000000 --- a/keyboards/zeal65/zeal65.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "quantum.h" -#include "../zeal60/rgb_backlight_keycodes.h" -#include "../zeal60/zeal60_keycodes.h" - -#define XXX KC_NO - -#define LAYOUT_65_split_bs( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ - K40, K41, K47, K4A, K4B, K4C, K4D, K4E \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ - { K40, K41, XXX, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D, K4E } \ -} - -#define LAYOUT_65_normie( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ - K40, K41, K47, K4A, K4B, K4C, K4D, K4E \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX, K2E }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ - { K40, K41, XXX, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D, K4E } \ -} diff --git a/keyboards/zen/config.h b/keyboards/zen/config.h deleted file mode 100644 index 4478062eb0e..00000000000 --- a/keyboards/zen/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -#endif // CONFIG_H - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 - -#ifndef TAPPING_TERM -#define TAPPING_TERM 100 -#endif diff --git a/keyboards/zen/keymaps/333fred/keymap.c b/keyboards/zen/keymaps/333fred/keymap.c deleted file mode 100644 index 3dd76980390..00000000000 --- a/keyboards/zen/keymaps/333fred/keymap.c +++ /dev/null @@ -1,150 +0,0 @@ -#include QMK_KEYBOARD_H -#include "333fred.h" - -extern keymap_config_t keymap_config; - -enum custom_macros { - DLEFT, - DRIGHT, - PSCREEN_APP -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------. .-----------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Esc | A | S | D | F | G | | H | J | K | L | ; | " | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | | N | M | , | . | / |SHIFT | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | Ctrl | F4 | F5 | GUI | Alt | Bksp |Lwr/VM||Enter|Space | NAV | - | = | Alt | Del | - * `------------------------------------------------''-----------------------------------------------' - */ -[BASE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_RSFT) , \ - KC_LCTL, KC_F4, KC_F5, KC_LGUI, KC_LALT, KC_BSPC, TD(TD_SYM_VIM), KC_ENT, KC_SPACE, OSL(VIM), KC_MINS, KC_EQL, KC_RALT, KC_DEL \ -), - -/* Symbols - * ,-----------------------------------------. .-----------------------------------------. - * | Caps | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | ! | @ | ( | ) | | | | 7 | 8 | 9 | * | ) | F12 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | # | $ | { | } | ` | | 4 | 5 | 6 | + | } | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | APscr| % | ^ | [ | ] | ~ | | 1 | 2 | 3 | \ | Vol- | Vol+ | - * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| - * | Pscr | | RESET| | | GAME | || | 0 | . | = | Prev | Next | Play | - * `------------------------------------------------- -------------------------------------------------' - */ -[SYMB] = LAYOUT( \ - KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ - _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \ - _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \ - M(PSCREEN_APP), KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \ - KC_PSCR, _______, RESET, _______, _______, TO(GAME), _______, _______, KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ -), - -/* Vim Movement - * ,-----------------------------------------. .-----------------------------------------. - * | | | | | | | | | | | | RESET| | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBSAI|RGBVAI|RGBSAD| LSFT | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | DLeft|DRight| LCTRL| LGUI | | | Left | Down | Up | Right| | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBHUD|RGBVAD|RGBHUI| | | | | | | | | | - * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| - * | | | | | | | || | | | | | | | - * `------------------------------------------------..------------------------------------------------' - */ -[VIM] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, \ - _______, RGB_SAI, RGB_VAI, RGB_SAD, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, \ - _______, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ - _______, RGB_HUD, RGB_VAD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), - -/* Gaming mode (Raise) - * All one-shot mods are disabled on this layer - * ,-----------------------------------------. .-----------------------------------------. - * | ESC | | | | | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | CTRL | | | | | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shift| Z | | | | | | | | | | | GUI | - * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| - * | Enter| | Lock | Bksp | Alt | Spc | RESET|| | Lower| Left | Up | Down | Right|QWERTY| - * `------------------------------------------------..-----------------------------------------------' - */ -[GAME] = LAYOUT( \ - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ - KC_ENT, TG(GAME_ARROW), KC_LOCK, KC_BSPC, KC_F5, KC_LALT, KC_SPC, OSL(SYMB), KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ -), -/* Gaming Arrow mode (Raise) - * Turns wasd into arrows - * ,-----------------------------------------. .-----------------------------------------. - * | ESC | | | | | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | Up | | | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | CTRL | Left | Down | Right| | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shift| Z | | | | | | | | | | | GUI | - * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| - * | Enter| | Lock | Bksp | Alt | Spc | RESET|| | Lower| Left | Up | Down | Right|QWERTY| - * `------------------------------------------------..-----------------------------------------------' - */ -[GAME_ARROW] = LAYOUT( \ - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ - KC_ENT, _______, KC_LOCK, KC_BSPC, KC_F5, KC_LALT, KC_SPC, OSL(SYMB), KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ -) -}; - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case DLEFT: - if (record->event.pressed) { // Windows move desktop left - return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); - } - break; - case DRIGHT: - if (record->event.pressed) { // Windows move desktop right - return MACRO(D(LCTL), D(LGUI), T(RIGHT), U(LGUI), U(LCTL), END); - } - break; - case PSCREEN_APP: - if (record->event.pressed) { - return MACRO(D(LALT), T(PSCR), U(LALT), END); - } - break; - } - return MACRO_NONE; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - tap_dance_process_record(keycode); - return true; -} diff --git a/keyboards/zen/keymaps/333fred/rules.mk b/keyboards/zen/keymaps/333fred/rules.mk deleted file mode 100644 index 38b71555042..00000000000 --- a/keyboards/zen/keymaps/333fred/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = no -NKRO_ENABLE = yes -KEY_LOCK_ENABLE = yes -TAP_DANCE_ENABLE = yes -CONSOLE_ENABLE = no -EXTRAFLAGS += -flto diff --git a/keyboards/zen/keymaps/default/config.h b/keyboards/zen/keymaps/default/config.h deleted file mode 100644 index 38e4d73f0d8..00000000000 --- a/keyboards/zen/keymaps/default/config.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/zen/keymaps/default/keymap.c b/keyboards/zen/keymaps/default/keymap.c deleted file mode 100644 index e9e7d798ca8..00000000000 --- a/keyboards/zen/keymaps/default/keymap.c +++ /dev/null @@ -1,101 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _NAV 2 - - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - NAV, - -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------. .-----------------------------------------. - * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | Ctrl | GUI | Alt |RGBTOG| NAV |Space |Delete||Enter|Space | NAV | - | = | PGUP | PGDN | - * `------------------------------------------------''-----------------------------------------------' - */ - [_QWERTY] = LAYOUT( \ - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - LT(_NAV, KC_CAPS),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ - KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, KC_PGUP, KC_PGDN \ - ), - - /* NAV - * ,-----------------------------------------. .-----------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBHUD|RGBVAD|RGBHUI| | | | | Left | Down | Right|Delete| End | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |Shift | | | | | | | NKRO | | | Pause| Back | Next | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | Ctrl | GUI | Alt |RGBMOD| | | || | | | | Mute | VOLUP| VOLDN| - * `------------------------------------------------''-----------------------------------------------' - */ - [_NAV] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \ - _______, RGB_HUD, RGB_VAD, RGB_HUI, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \ - KC_LSFT, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, \ - KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD \ - ), - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - //case COLEMAK: - //if (record->event.pressed) { - //#ifdef AUDIO_ENABLE - //PLAY_NOTE_ARRAY(tone_colemak, false, 0); - //#endif - //persistant_default_layer_set(1UL<<_COLEMAK); - //} - //return false; - //break; - } - return true; -} \ No newline at end of file diff --git a/keyboards/zen/keymaps/default/rules.mk b/keyboards/zen/keymaps/default/rules.mk deleted file mode 100644 index 22b6ec47662..00000000000 --- a/keyboards/zen/keymaps/default/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/zen/keymaps/jwlawrence/config.h b/keyboards/zen/keymaps/jwlawrence/config.h deleted file mode 100644 index 38e4d73f0d8..00000000000 --- a/keyboards/zen/keymaps/jwlawrence/config.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/zen/keymaps/jwlawrence/keymap.c b/keyboards/zen/keymaps/jwlawrence/keymap.c deleted file mode 100644 index 1ca9b78c0ff..00000000000 --- a/keyboards/zen/keymaps/jwlawrence/keymap.c +++ /dev/null @@ -1,101 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _NAV 2 - - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - NAV, - -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------. .-----------------------------------------. - * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | | N | M | , | . | / |Shift | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | Ctrl | Alt | GUI | GUI | NAV |Space |Delete||Enter|Space | NAV | - | = |RGBTOG|Enter | - * `------------------------------------------------''-----------------------------------------------' - */ - [_QWERTY] = LAYOUT( \ - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - LT(_NAV, KC_CAPS),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_LGUI, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, RGB_TOG, KC_ENT \ - ), - - /* NAV - * ,-----------------------------------------. .-----------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBHUD|RGBVAD|RGBHUI|RGBMOD| | | | Left | Down | Right|Delete| End | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |Shift | | | | | | | NKRO | | | Pause| Back | Next | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | Ctrl | Alt | GUI | | | | || | | | | Mute | VOLUP| VOLDN| - * `------------------------------------------------''-----------------------------------------------' - */ - [_NAV] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \ - _______, RGB_HUD, RGB_VAD, RGB_HUI, RGB_MOD, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \ - KC_LSFT, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, \ - KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD \ - ), - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - //case COLEMAK: - //if (record->event.pressed) { - //#ifdef AUDIO_ENABLE - //PLAY_NOTE_ARRAY(tone_colemak, false, 0); - //#endif - //persistant_default_layer_set(1UL<<_COLEMAK); - //} - //return false; - //break; - } - return true; -} \ No newline at end of file diff --git a/keyboards/zen/keymaps/jwlawrence/rules.mk b/keyboards/zen/keymaps/jwlawrence/rules.mk deleted file mode 100644 index 22b6ec47662..00000000000 --- a/keyboards/zen/keymaps/jwlawrence/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/zen/keymaps/xyverz/config.h b/keyboards/zen/keymaps/xyverz/config.h deleted file mode 100644 index 818f8998974..00000000000 --- a/keyboards/zen/keymaps/xyverz/config.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -#define EE_HANDS - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/zen/keymaps/xyverz/keymap.c b/keyboards/zen/keymaps/xyverz/keymap.c deleted file mode 100644 index 8879fbb5ff0..00000000000 --- a/keyboards/zen/keymaps/xyverz/keymap.c +++ /dev/null @@ -1,176 +0,0 @@ -/* This is the Zen keyboard layout by Xyverz aka u/Zrevyx on r/mk. - This is pretty much a direct port of my Atreus62 keymap. - - The bottom row is fairly Kinesis-ish since the Contour and Advantage - keyboards have been my daily drivers for the last 17 years. I hope - You can get some enjoyment out of this layout should you chose it! - -CHANGELOG: - - 0.1 - Initial commit. Based off of Profet's default keymap. - -TODO: - - * Figure out how to make the bottom row work best for me. - * Add legends in comments for each layer. Maybe. - -*/ - -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _DVORAK 0 -#define _QWERTY 1 -#define _COLEMAK 2 -#define _WOW 3 -#define _LOWER 4 -#define _RAISE 5 -#define _ADJUST 16 - -enum atreus52_keycodes { - DVORAK = SAFE_RANGE, - QWERTY, - COLEMAK, - WOW, - LOWER, - RAISE -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// Aliases to make the keymap clearer. -#define CTLBSPC CTL_T(KC_BSPC) // CTRL when held, BSPC when tapped. -#define RGB_SWR RGB_M_SW // Swirl Animation alias -#define RGB_SNK RGB_M_SN // Snake Animation alias -#define ADJUST MO(_ADJUST) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_DVORAK] = LAYOUT( \ - KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ - LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ - ), - - [_QWERTY] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL , \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ - ), - - [_COLEMAK] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL , \ - KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ - ), - - [_WOW] = LAYOUT( \ - KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ - LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, CTLBSPC, KC_LALT, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ - ), - - [_LOWER] = LAYOUT( \ - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ - KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ - _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ - ), - - [_RAISE] = LAYOUT( \ - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ - KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_EQL, KC_LBRC, KC_RBRC, _______, \ - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ - _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ - ), - - [_ADJUST] = LAYOUT( \ - RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_SNK, _______, QWERTY, COLEMAK, DVORAK, WOW, _______, \ - RGB_TOG, RGB_MOD, RGB_SWR, RGB_M_K, RGB_M_G, RGB_HUI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), - -}; - - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -void matrix_init_user(void) { - // This will disable the red LEDs on the ProMicros - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case DVORAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case WOW: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_WOW); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - } - return true; -}; diff --git a/keyboards/zen/keymaps/xyverz/rules.mk b/keyboards/zen/keymaps/xyverz/rules.mk deleted file mode 100644 index 22b6ec47662..00000000000 --- a/keyboards/zen/keymaps/xyverz/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/zen/matrix.c b/keyboards/zen/matrix.c deleted file mode 100644 index 6e274d3bac0..00000000000 --- a/keyboards/zen/matrix.c +++ /dev/null @@ -1,465 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" -#include "backlight.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define SERIAL_LED_ADDR 0x00 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - -} - -uint8_t _matrix_scan(void) -{ - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); -#if (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level(); -#endif - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); -#endif -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/zen/readme.md b/keyboards/zen/readme.md deleted file mode 100644 index beb5e13ac12..00000000000 --- a/keyboards/zen/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# Zen Keyboard - -A split ergo keyboard with a few goals in mind: - -- Be as thin as possible. Other split KBs (Let's Split, Nyquist, Iris) are 15.2mm thick. The Zen is only 8.0mm thick. -- Layout designed for gaming. 1.5u pinky keys, ortho alphas, and angled thumb keys. After trying Ortholinear, Atreus62, and Ergodox, this is the best layout for gaming and typing. -- RGB backlighting. 16 WS2812b LEDs shine through the perimeter switches. The SK6812 variant are cheap and easy to solder. -- Price. Using Arduino Pro Micro, SK6812 LEDs, and PCB FR4 for the case, the cost of each half without switches or caps can be reduced to under $20 when purchased at volume. - -Keyboard Maintainer: [Legonut](https://github.com/Legonut) -Hardware Supported: Zen rev1 -Hardware Availability: [RGBKB.net](https://www.rgbkb.net/) - -A build guide and more info for this keyboard can be found here: [Zen Build Guide](https://legonut.gitbooks.io/zen-keyboard/content/). - -Make example for this keyboard (after setting up your build environment): - - make zen/rev1:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/zen/rev1/config.h b/keyboards/zen/rev1/config.h deleted file mode 100644 index 890d3075703..00000000000 --- a/keyboards/zen/rev1/config.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include QMK_KEYBOARD_CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1256 -#define DEVICE_VER 0x0200 -#define MANUFACTURER Legonut -#define PRODUCT Project Zen -#define DESCRIPTION Split gaming keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 7 - -// wiring of each half -#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 } -#define MATRIX_COL_PINS { B2, B3, B1, F7, F6, D4, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define BACKLIGHT_PIN F4 -#define BACKLIGHT_LEVELS 5 - - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D1 - -#define RGBLED_NUM 16 // Number of LEDs - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/zen/rev1/rev1.h b/keyboards/zen/rev1/rev1.h deleted file mode 100644 index c2444f047f6..00000000000 --- a/keyboards/zen/rev1/rev1.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef REV1_H -#define REV1_H - -#include "zen.h" - -//void promicro_bootloader_jmp(bool program); -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -//void promicro_bootloader_jmp(bool program); - -#define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k55, k54, k53, k52, k51, k50, \ - k10, k11, k12, k13, k14, k15, k65, k64, k63, k62, k61, k60, \ - k20, k21, k22, k23, k24, k25, k75, k74, k73, k72, k71, k70, \ - k30, k31, k32, k33, k34, k35, k85, k84, k83, k82, k81, k80, \ - k40, k41, k42, k43, k44, k45, k46, k96, k95, k94, k93, k92, k91, k90 \ - ) \ - { \ - { k00, k01, k02, k03, k04, k05, KC_NO }, \ - { k10, k11, k12, k13, k14, k15, KC_NO }, \ - { k20, k21, k22, k23, k24, k25, KC_NO }, \ - { k30, k31, k32, k33, k34, k35, KC_NO }, \ - { k40, k41, k42, k43, k44, k45, k46 }, \ - { k50, k51, k52, k53, k54, k55, KC_NO }, \ - { k60, k61, k62, k63, k64, k65, KC_NO }, \ - { k70, k71, k72, k73, k74, k75, KC_NO }, \ - { k80, k81, k82, k83, k84, k85, KC_NO }, \ - { k90, k91, k92, k93, k94, k95, k96 } \ - } - -#endif diff --git a/keyboards/zen/rev1/rules.mk b/keyboards/zen/rev1/rules.mk deleted file mode 100644 index d7463419b4f..00000000000 --- a/keyboards/zen/rev1/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes diff --git a/keyboards/zen/rules.mk b/keyboards/zen/rules.mk deleted file mode 100644 index 4e82689111d..00000000000 --- a/keyboards/zen/rules.mk +++ /dev/null @@ -1,73 +0,0 @@ -SRC += matrix.c \ - split_util.c \ - serial.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = no -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -CUSTOM_MATRIX = yes - -DEFAULT_FOLDER = zen/rev1 diff --git a/keyboards/zen/serial.c b/keyboards/zen/serial.c deleted file mode 100644 index 74bcbb6bf6e..00000000000 --- a/keyboards/zen/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/zen/serial.h b/keyboards/zen/serial.h deleted file mode 100644 index 15fe4db7b4c..00000000000 --- a/keyboards/zen/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/zen/split_rgb.c b/keyboards/zen/split_rgb.c deleted file mode 100644 index 6d7cb44cf0d..00000000000 --- a/keyboards/zen/split_rgb.c +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include "split_util.h" -#include "progmem.h" -#include "print.h" -#include "rgblight.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - - -rgblight_config_t rgblight_config; - -void rgblight_slave_update(void) { - //rgblight_effect_christmas(); -} - - -void rgblight_set(void) { - if (rgblight_config.enable) { - #ifdef RGBW - ws2812_setleds_rgbw(led, RGBLED_NUM); - #else - ws2812_setleds(led, RGBLED_NUM); - #endif - } else { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; - } - #ifdef RGBW - ws2812_setleds_rgbw(led, RGBLED_NUM); - #else - ws2812_setleds(led, RGBLED_NUM); - #endif - } -} diff --git a/keyboards/zen/split_rgb.h b/keyboards/zen/split_rgb.h deleted file mode 100644 index 5f552890afd..00000000000 --- a/keyboards/zen/split_rgb.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SPLIT_RGB_H -#define SPLIT_RGB_H - -void rgblight_slave_update(void); - -#endif diff --git a/keyboards/zen/split_util.c b/keyboards/zen/split_util.c deleted file mode 100644 index 346cbc90894..00000000000 --- a/keyboards/zen/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/zen/zen.h b/keyboards/zen/zen.h deleted file mode 100644 index 56fc64fe26b..00000000000 --- a/keyboards/zen/zen.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef ZEN_H -#define ZEN_H - -#include "rev1.h" -#include "quantum.h" - -#endif diff --git a/keyboards/zinc/keymaps/ginjake/config.h b/keyboards/zinc/keymaps/ginjake/config.h new file mode 100644 index 00000000000..4dcb0724ff7 --- /dev/null +++ b/keyboards/zinc/keymaps/ginjake/config.h @@ -0,0 +1,38 @@ +/* +This is the c configuration file for the keymap + +Copyright 2018 monksoffunk +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once +// if you need more program area, try uncomment follow line +#include "serial_config_simpleapi.h" + +// place overrides here +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/zinc/keymaps/ginjake/keymap.c b/keyboards/zinc/keymaps/ginjake/keymap.c new file mode 100644 index 00000000000..323d2c7d441 --- /dev/null +++ b/keyboards/zinc/keymaps/ginjake/keymap.c @@ -0,0 +1,368 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + KANA, + EISU, + RGBRST, + AQOURS, //サンシャインぴっかぴかモード +}; + +#ifdef RGBLIGHT_ENABLE + //9色に変化するLEDのHSV各パラメータ + int aqours_h[] = { 26, 340, 150, 0, 199, 220, 53, 265, 322}; + int aqours_s[] = {255, 165, 255, 255, 255, 350, 255, 255, 255}; + int aqours_v[] = {255, 255, 255, 255, 255, 255, 255, 255, 255}; + const int NEXT_COLOR_TIME = 2400; //次の色に切り替わるまでの時間 + const int NEXT_CHANGE_TARGET_TIME = 100; //次のキーに色が伝播するまでの時間 + bool aqours_mode = false; + int aqours_next_color_timer_count = 0; + int aqours_num = 0; + int target_col = 0; + + //keyのmatrixの位置とLEDの番号を紐づける + int combined_key_to_led[] = + { + 0,1,2,3,4,5, + 11,10,9,8,7,6, + 12,13,14,15,16,17, + 23,22,21,20,19,18 + }; +#endif + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { \ + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Win | Alt |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + * `-----------------------------------------' `-----------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_ESC, ADJUST, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + * `-----------------------------------------' `-----------------------------------------' + */ + [_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_ESC, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + * `-----------------------------------------' `-----------------------------------------' + */ + [_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + KC_ESC, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | - | _ | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | Home | End | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, _______, _______, _______, _______, _______, KC_MINS, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `-----------------------------------------' + */ + [_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset|RGBRST|Aud on|Audoff| | | |Qwerty|Colemk|Dvorak| | Ins | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |AQOURS|RGB ON| HUE+ | SAT+ | VAL+ | Mac | | Win | - | = |Print |ScLock|Pause | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | MODE | HUE- | SAT- | VAL- | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | EISU | EISU | EISU | | KANA | KANA | Home |PageDn|PageUp| End | + * `-----------------------------------------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, RGBRST, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, KC_INS, \ + AQOURS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, AG_NORM, AG_SWAP, KC_MINS, KC_EQL, KC_PSCR, KC_SLCK, KC_PAUS,\ + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, EISU, EISU, EISU, KANA, KANA, KC_HOME, KC_PGDN, KC_PGUP, KC_END\ + ) +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(16); + #endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change + #endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(15); + #endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode_noeeprom(RGB_current_config.mode); + rgblight_step(); + RGB_current_config.mode = rgblight_config.mode; + } + #endif + return false; + break; + + case EISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + case AQOURS: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + aqours_mode = !aqours_mode; + } + #endif + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} + +#ifdef RGBLIGHT_ENABLE + + void aqours_led(void) { + aqours_next_color_timer_count++; + //一定間隔で色が変化 + if (aqours_next_color_timer_count > NEXT_COLOR_TIME) { + aqours_num++; + aqours_next_color_timer_count = 0; + target_col = 0; + if (aqours_num == sizeof(aqours_h) / sizeof(int)) { + aqours_num = 0; + } + } + + //キー毎に時間差で色が変化していく + if (aqours_next_color_timer_count % NEXT_CHANGE_TARGET_TIME == 0) { + if (target_col < MATRIX_COLS) { + sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[target_col]); + sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[11 - target_col]); + sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[12 + target_col]); + sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[23 - target_col]); + target_col++; + rgblight_set(); + } + } + } +#endif + +void matrix_scan_user(void) { + #ifdef RGBLIGHT_ENABLE + if (aqours_mode) { + aqours_led(); + } + #endif +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_init(); + RGB_current_config = rgblight_config; + #endif +} diff --git a/keyboards/zinc/keymaps/ginjake/readme_jp.md b/keyboards/zinc/keymaps/ginjake/readme_jp.md new file mode 100644 index 00000000000..f6e91f0c890 --- /dev/null +++ b/keyboards/zinc/keymaps/ginjake/readme_jp.md @@ -0,0 +1,123 @@ +# The Default Zinc Layout +## 配列 + +### Qwerty配列 + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc | Fn | Alt | Win |Lower |Space | | Space| Raise| Left | Down | Up | Right| + `------------------------------------------ ------------------------------------------' +``` + +### Colemak + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + `------------------------------------------ ------------------------------------------' +``` + +### Dvorak + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + `-----------------------------------------' `-----------------------------------------' +``` + + +## コンパイルの仕方 + +コンパイルは、qmk_firmware のトップディレクトリで行います。 + +``` +$ cd qmk_firmware +``` +qmk_firmwareでは各キーボードのコンパイルは、`<キーボード名>:<キーマップ名>`という指定で行います。 + +``` +$ make zinc:default +``` + +キーボードへの書き込みまで同時に行うには下記のように`:avrdude`を付けます。 + +``` +$ make zinc:default:avrdude +``` + +コンパイル結果と中間生成物を消去したい場合は以下のようにします。 + +``` +$ make zinc:default:clean +``` + +## カスタマイズ + +コマンドラインからオプションを指定してビルドすることが出来ます。 + +``` +# Zinc keyboard 'default' keymap: convenient command line option +make ZINC= zinc:defualt +# option= back | under | na | ios +# ex. +# make ZINC=under zinc:defualt +# make ZINC=under,ios zinc:defualt +# make ZINC=back zinc:default +# make ZINC=back,na zinc:default +# make ZINC=back,ios zinc:default +``` + +あるいは`qmk_firmware/keyboards/zinc/rev1/keymaps/default/rules.mk` の以下の部分を直接編集して機能を有効化してください。 + +``` +# Zinc keyboard customize +LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + + +``` + +## RGB backlight を有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +LED_BACK_ENABLE = yes # LED backlight (Enable SK6812mini backlight) +``` + + +## RGB Underglow を有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +``` + + +## iPad/iPhoneサポートを有効にする。 + +rules.mk の下記の部分を編集して no を yes に変更してください。 +RBG Underglow や RGBバックライトの輝度を抑えて、iPad, iPhone にも接続できるようになります。 + +``` +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +``` \ No newline at end of file diff --git a/keyboards/zinc/keymaps/ginjake/rules.mk b/keyboards/zinc/keymaps/ginjake/rules.mk new file mode 100644 index 00000000000..2dcefc0016d --- /dev/null +++ b/keyboards/zinc/keymaps/ginjake/rules.mk @@ -0,0 +1,98 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +define ZINC_CUSTOMISE_MSG + $(info Zinc customize) + $(info - LED_BACK_ENABLE=$(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE=$(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATION=$(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE=$(IOS_DEVICE_ENABLE)) +endef + +# Zinc keyboard customize +LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option + +#### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. +#### Do not enable these with audio at the same time. + +### Zinc keyboard 'default' keymap: convenient command line option +## make ZINC= zinc:defualt +## option= back | under | na | ios +## ex. +## make ZINC=under zinc:defualt +## make ZINC=under,ios zinc:defualt +## make ZINC=back zinc:default +## make ZINC=back,na zinc:default +## make ZINC=back,ios zinc:default + +ifneq ($(strip $(ZINC)),) + ifeq ($(findstring back,$(ZINC)), back) + LED_BACK_ENABLE = yes + else ifeq ($(findstring under,$(ZINC)), under) + LED_UNDERGLOW_ENABLE = yes + endif + ifeq ($(findstring na,$(ZINC)), na) + LED_ANIMATIONS = no + endif + ifeq ($(findstring ios,$(ZINC)), ios) + IOS_DEVICE_ENABLE = yes + endif + $(eval $(call ZINC_CUSTOMISE_MSG)) + $(info ) +endif + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call ZINC_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) +# OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS + +endif + +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) diff --git a/keyboards/zinc/keymaps/monks/rules.mk b/keyboards/zinc/keymaps/monks/rules.mk index a5335def871..eeabc004c37 100644 --- a/keyboards/zinc/keymaps/monks/rules.mk +++ b/keyboards/zinc/keymaps/monks/rules.mk @@ -90,11 +90,8 @@ endif # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - # Uncomment these for debugging # $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) # $(info -- OPT_DEFS=$(OPT_DEFS)) # $(info ) + diff --git a/keyboards/zinc/rev1/config.h b/keyboards/zinc/rev1/config.h index c628400f2e9..c8560233d7c 100644 --- a/keyboards/zinc/rev1/config.h +++ b/keyboards/zinc/rev1/config.h @@ -27,8 +27,7 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER monksoffunk #define PRODUCT zinc rev.1 -#define DESCRIPTION A split keyboard - +#define DESCRIPTION A split keyboard #define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD @@ -44,7 +43,6 @@ along with this program. If not, see . //#define MASTER_RIGHT //#define EE_HANDS - /* key matrix size */ // Rows are doubled-up #define MATRIX_ROWS 8 @@ -61,18 +59,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 #define RGBLIGHT_TIMER @@ -145,5 +138,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - //#endif diff --git a/keyboards/zinc/reva/config.h b/keyboards/zinc/reva/config.h index 15805189054..6ae12d54cce 100644 --- a/keyboards/zinc/reva/config.h +++ b/keyboards/zinc/reva/config.h @@ -24,8 +24,7 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER monksoffunk #define PRODUCT zinc rev.A -#define DESCRIPTION A split keyboard - +#define DESCRIPTION A split keyboard #define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD @@ -41,7 +40,6 @@ along with this program. If not, see . //#define MASTER_RIGHT //#define EE_HANDS - /* key matrix size */ // Rows are doubled-up #define MATRIX_ROWS 8 @@ -58,18 +56,13 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ //#define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* ws2812 RGB LED */ #define RGB_DI_PIN D3 #define RGBLIGHT_TIMER diff --git a/keyboards/zinc/rules.mk b/keyboards/zinc/rules.mk index 5236c0bb02f..7574af387cc 100644 --- a/keyboards/zinc/rules.mk +++ b/keyboards/zinc/rules.mk @@ -2,7 +2,6 @@ SRC += serial.c # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. diff --git a/keyboards/zinc/serial.c b/keyboards/zinc/serial.c index 830f86b55a6..325c29a3f70 100644 --- a/keyboards/zinc/serial.c +++ b/keyboards/zinc/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU @@ -65,6 +70,7 @@ #error serial.c now support ATmega32U4 only #endif +//////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 @@ -106,7 +112,8 @@ int serial_update_buffers() return result; } -#endif // Simple API (OLD API, compatible with let's split serial.c) +#endif // end of Simple API (OLD API, compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) #define NO_INLINE __attribute__((noinline)) @@ -136,38 +143,68 @@ int serial_update_buffers() // 5: about 20kbps #endif -#define TID_SEND_ADJUST 2 +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif #if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 6 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed #define SERIAL_DELAY 36 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 5 // Ultra Low speed #define SERIAL_DELAY 48 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #else #error invalid SELECT_SOFT_SERIAL_SPEED value #endif /* SELECT_SOFT_SERIAL_SPEED */ @@ -187,16 +224,19 @@ int serial_update_buffers() static SSTD_t *Transaction_table = NULL; static uint8_t Transaction_table_size = 0; +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); } +inline static void serial_delay_half2(void) ALWAYS_INLINE; inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); @@ -216,6 +256,7 @@ void serial_input_with_pullup(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); @@ -270,7 +311,7 @@ void sync_recv(void) { } // Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void)NO_INLINE; +static void sync_send(void) NO_INLINE; static void sync_send(void) { serial_low(); @@ -536,7 +577,14 @@ int soft_serial_get_and_clean_status(int sstd_index) { #endif // Helix serial.c history -// 2018-1-29 fork from let's split (#2308) -// 2018-6-28 bug fix master to slave comm (#3255) -// 2018-8-11 improvements (#3608) -// 2018-10-21 fix serial and RGB animation conflict (#4191) +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/zj68/config.h b/keyboards/zj68/config.h new file mode 100644 index 00000000000..59dcfc66644 --- /dev/null +++ b/keyboards/zj68/config.h @@ -0,0 +1,64 @@ +/* +Copyright 2019 Collin Diekvoss + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Drop +#define PRODUCT ZJ68 +#define DESCRIPTION QMK ZJ68 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B7 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, F7, F6, F5, F4, F1, F0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 5 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/zj68/info.json b/keyboards/zj68/info.json new file mode 100644 index 00000000000..f93963936da --- /dev/null +++ b/keyboards/zj68/info.json @@ -0,0 +1,86 @@ +{ + "keyboard_name": "ZJ68", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [ + { "label": "~", "x": 0, "y": 0 }, + { "label": "!", "x": 1, "y": 0 }, + { "label": "@", "x": 2, "y": 0 }, + { "label": "#", "x": 3, "y": 0 }, + { "label": "$", "x": 4, "y": 0 }, + { "label": "%", "x": 5, "y": 0 }, + { "label": "^", "x": 6, "y": 0 }, + { "label": "&", "x": 7, "y": 0 }, + { "label": "*", "x": 8, "y": 0 }, + { "label": "(", "x": 9, "y": 0 }, + { "label": ")", "x": 10, "y": 0 }, + { "label": "_", "x": 11, "y": 0 }, + { "label": "+", "x": 12, "y": 0 }, + { "x": 13, "y": 0 }, + { "x": 14, "y": 0 }, + { "x": 15, "y": 0 }, + + { "label": "Tab", "x": 0, "y": 1, "w": 1.5 }, + { "label": "Q", "x": 1.5, "y": 1 }, + { "label": "W", "x": 2.5, "y": 1 }, + { "label": "E", "x": 3.5, "y": 1 }, + { "label": "R", "x": 4.5, "y": 1 }, + { "label": "T", "x": 5.5, "y": 1 }, + { "label": "Y", "x": 6.5, "y": 1 }, + { "label": "U", "x": 7.5, "y": 1 }, + { "label": "I", "x": 8.5, "y": 1 }, + { "label": "O", "x": 9.5, "y": 1 }, + { "label": "P", "x": 10.5, "y": 1 }, + { "label": "{", "x": 11.5, "y": 1 }, + { "label": "}", "x": 12.5, "y": 1 }, + { "label": "|", "x": 13.5, "y": 1, "w": 1.5 }, + { "x": 15, "y": 1 }, + + { "label": "Caps Lock", "x": 0, "y": 2, "w": 1.75 }, + { "label": "A", "x": 1.75, "y": 2 }, + { "label": "S", "x": 2.75, "y": 2 }, + { "label": "D", "x": 3.75, "y": 2 }, + { "label": "F", "x": 4.75, "y": 2 }, + { "label": "G", "x": 5.75, "y": 2 }, + { "label": "H", "x": 6.75, "y": 2 }, + { "label": "J", "x": 7.75, "y": 2 }, + { "label": "K", "x": 8.75, "y": 2 }, + { "label": "L", "x": 9.75, "y": 2 }, + { "label": ":", "x": 10.75, "y": 2 }, + { "label": "\"", "x": 11.75, "y": 2 }, + { "label": "Enter", "x": 12.75, "y": 2, "w": 2.25 }, + { "x": 15, "y": 2 }, + + { "label": "Shift", "x": 0, "y": 3, "w": 1.25 }, + { "x": 1.25, "y": 3 }, + { "label": "Z", "x": 2.25, "y": 3 }, + { "label": "X", "x": 3.25, "y": 3 }, + { "label": "C", "x": 4.25, "y": 3 }, + { "label": "V", "x": 5.25, "y": 3 }, + { "label": "B", "x": 6.25, "y": 3 }, + { "label": "N", "x": 7.25, "y": 3 }, + { "label": "M", "x": 8.25, "y": 3 }, + { "label": "<", "x": 9.25, "y": 3 }, + { "label": ">", "x": 10.25, "y": 3 }, + { "label": "?", "x": 11.25, "y": 3 }, + { "label": "Shift", "x": 12.25, "y": 3, "w": 1.75 }, + { "x": 14, "y": 3 }, + { "x": 15, "y": 3 }, + + { "label": "Ctrl", "x": 0, "y": 4, "w": 1.25 }, + { "label": "Win", "x": 1.25, "y": 4, "w": 1.25 }, + { "label": "Alt", "x": 2.5, "y": 4, "w": 1.25 }, + { "x": 3.75, "y": 4, "w": 6.25 }, + { "label": "Alt", "x": 10, "y": 4 }, + { "label": "Win", "x": 11, "y": 4 }, + { "x": 12, "y": 4 }, + { "x": 13, "y": 4 }, + { "x": 14, "y": 4 }, + { "x": 15, "y": 4 } + ] + } + } +} diff --git a/keyboards/zj68/keymaps/default/keymap.c b/keyboards/zj68/keymaps/default/keymap.c new file mode 100644 index 00000000000..05e0776db8f --- /dev/null +++ b/keyboards/zj68/keymaps/default/keymap.c @@ -0,0 +1,35 @@ +/* Copyright 2019 Collin Diekvoss + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, RESET, KC_PSCR, + RGB_TOG, _______, KC_UP, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + BL_TOGG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, KC_END, + _______, _______, _______, BL_DEC, BL_INC, BL_STEP, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/zj68/keymaps/default/readme.md b/keyboards/zj68/keymaps/default/readme.md new file mode 100644 index 00000000000..3522fe02299 --- /dev/null +++ b/keyboards/zj68/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# ZJ68 Default layout + +This is the default layout from the json file provided on Drop, that was intended to be used on kbdfirmware, with an added soft reset on fn(backspace). \ No newline at end of file diff --git a/keyboards/zj68/keymaps/splitbs/keymap.c b/keyboards/zj68/keymaps/splitbs/keymap.c new file mode 100644 index 00000000000..6403c0353fd --- /dev/null +++ b/keyboards/zj68/keymaps/splitbs/keymap.c @@ -0,0 +1,34 @@ +/* Copyright 2019 Collin Diekvoss + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_65_ansi_split_bs( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + MO(1), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + LAYOUT_65_ansi_split_bs( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_CAPS, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/zj68/keymaps/splitbs/readme.md b/keyboards/zj68/keymaps/splitbs/readme.md new file mode 100644 index 00000000000..9047475eebd --- /dev/null +++ b/keyboards/zj68/keymaps/splitbs/readme.md @@ -0,0 +1,3 @@ +# ZJ68 W/ Split Backspace + +The plate that comes with the kit from Drop only allows one layout, but the pcb supports having a split backspace, so by widening the plate where the stabilizers are meant to go, you can fit the two switches in, if you want to go back to a single backspace later, you can still use pcb mount stabilizers. \ No newline at end of file diff --git a/keyboards/zj68/readme.md b/keyboards/zj68/readme.md new file mode 100644 index 00000000000..c889888c32a --- /dev/null +++ b/keyboards/zj68/readme.md @@ -0,0 +1,15 @@ +# ZJ68 + +![JZ68](https://i.imgur.com/bcsfQyt.jpg) + +A 65% keyboard kit sold through Drop. + +Keyboard Maintainer: QMK Community +Hardware Supported: ZJ68 PCB +Hardware Availability: [Drop](https://drop.com/buy/zj68-68-key-mechanical-keyboard-kit?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make zj68:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/zj68/rules.mk b/keyboards/zj68/rules.mk new file mode 100644 index 00000000000..79860ed7a24 --- /dev/null +++ b/keyboards/zj68/rules.mk @@ -0,0 +1,63 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +AUDIO_ENABLE = no + +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +RGBLIGHT_ENABLE = no + +LAYOUTS = 65_ansi diff --git a/keyboards/zj68/zj68.c b/keyboards/zj68/zj68.c new file mode 100644 index 00000000000..960c943033b --- /dev/null +++ b/keyboards/zj68/zj68.c @@ -0,0 +1,24 @@ +/* Copyright 2019 Collin Diekvoss + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "zj68.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} diff --git a/keyboards/zj68/zj68.h b/keyboards/zj68/zj68.h new file mode 100644 index 00000000000..5eaae26ad3f --- /dev/null +++ b/keyboards/zj68/zj68.h @@ -0,0 +1,60 @@ +/* Copyright 2019 Collin Diekvoss + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +#define LAYOUT_65_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K4E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K48, K49, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO, K2E }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, K48, K49, K4A, K4B, K4C, K4D, K4E } \ +} + +#define LAYOUT_65_ansi_split_bs( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K4E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K48, K49, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO, K2E }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, K48, K49, K4A, K4B, K4C, K4D, K4E } \ +} + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K4E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K48, K49, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, K48, K49, K4A, K4B, K4C, K4D, K4E } \ +} diff --git a/keyboards/zlant/config.h b/keyboards/zlant/config.h index ae9dcfef67e..a6b5227d650 100755 --- a/keyboards/zlant/config.h +++ b/keyboards/zlant/config.h @@ -30,7 +30,7 @@ #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -38,11 +38,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - #define RGB_DI_PIN D6 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/zlant/info.json b/keyboards/zlant/info.json index b1f20555c03..773fa5a31f9 100644 --- a/keyboards/zlant/info.json +++ b/keyboards/zlant/info.json @@ -5,7 +5,7 @@ "width": 12.75, "height": 4, "layouts": { - "LAYOUT_ortho_4x12": { + "LAYOUT": { "key_count": 48, "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K100", "x":0.25, "y":1}, {"label":"K101", "x":1.25, "y":1}, {"label":"K102", "x":2.25, "y":1}, {"label":"K103", "x":3.25, "y":1}, {"label":"K104", "x":4.25, "y":1}, {"label":"K105", "x":5.25, "y":1}, {"label":"K106", "x":6.25, "y":1}, {"label":"K107", "x":7.25, "y":1}, {"label":"K108", "x":8.25, "y":1}, {"label":"K109", "x":9.25, "y":1}, {"label":"K110", "x":10.25, "y":1}, {"label":"K111", "x":11.25, "y":1}, {"label":"K200", "x":0.5, "y":2}, {"label":"K201", "x":1.5, "y":2}, {"label":"K202", "x":2.5, "y":2}, {"label":"K203", "x":3.5, "y":2}, {"label":"K204", "x":4.5, "y":2}, {"label":"K205", "x":5.5, "y":2}, {"label":"K206", "x":6.5, "y":2}, {"label":"K207", "x":7.5, "y":2}, {"label":"K208", "x":8.5, "y":2}, {"label":"K209", "x":9.5, "y":2}, {"label":"K210", "x":10.5, "y":2}, {"label":"K211", "x":11.5, "y":2}, {"label":"K300", "x":0.75, "y":3}, {"label":"K301", "x":1.75, "y":3}, {"label":"K302", "x":2.75, "y":3}, {"label":"K303", "x":3.75, "y":3}, {"label":"K304", "x":4.75, "y":3}, {"label":"K305", "x":5.75, "y":3}, {"label":"K306", "x":6.75, "y":3}, {"label":"K307", "x":7.75, "y":3}, {"label":"K308", "x":8.75, "y":3}, {"label":"K309", "x":9.75, "y":3}, {"label":"K310", "x":10.75, "y":3}, {"label":"K311", "x":11.75, "y":3}] }, diff --git a/keyboards/zlant/keymaps/default/keymap.c b/keyboards/zlant/keymaps/default/keymap.c index a701a7965a2..37f031f015a 100755 --- a/keyboards/zlant/keymaps/default/keymap.c +++ b/keyboards/zlant/keymaps/default/keymap.c @@ -11,12 +11,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ RGB_HUI, RGB_HUD, KC_LGUI, KC_LALT, KC_LSFT, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), - + /* BASE LAYER + * ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Bspc │ + * └┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┐ + * │ LCtrl│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ + * └┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┐ + * │ Esc │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Enter│ + * └┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴──────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┐ + * │LED H+│LED H-│ LGUI │ LAlt │LShift│ Space │ Fn │ Left │ Down │ Up │ Right│ + * └──────┴──────┴──────┴──────┴──────┴─────────────┴──────┴──────┴──────┴──────┴──────┘ + */ [FN] = LAYOUT( _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PGUP, KC_HOME, _______, _______, \ RGB_VAI, RGB_VAD, RESET, KC_PSCR, _______, _______, _______, _______, KC_PGDN, KC_END, _______, KC_DEL \ ) - -}; +}; + /* FN LAYER + * ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐ + * │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ + * └┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┐ + * │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ - │ = │ [ │ ] │ \ │ + * └┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┐ + * │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ PgUp │ Home │ │ │ + * └┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴──────┴┬─────┴┬─────┴┬─────┴┬─────┴┬─────┴┐ + * │LED V+│LED V-│ Reset│ PScr │ │ │ │ PgDn │ End │ │ Del │ + * └──────┴──────┴──────┴──────┴──────┴─────────────┴──────┴──────┴──────┴──────┴──────┘ + */ diff --git a/keyboards/zlant/readme.md b/keyboards/zlant/readme.md index 8f50e6d4c7b..eaec1407457 100644 --- a/keyboards/zlant/readme.md +++ b/keyboards/zlant/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make zlant:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c index 4128c4cf2d4..b3c74da949f 100644 --- a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c +++ b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c @@ -3,24 +3,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BL] = LAYOUT_60_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \ - KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FNX, KC_RALT, KC_RGUI, KC_RCTL), + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \ + KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FNX, KC_RALT, KC_RGUI, KC_RCTL), [_FL] = LAYOUT_60_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + BL_TOGG, BL_INC, BL_DEC, BL_STEP, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_AL] = LAYOUT_60_ansi( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT) }; diff --git a/layouts/community/60_ansi/mechmerlin-ansi/readme.md b/layouts/community/60_ansi/mechmerlin-ansi/readme.md index 1c40def2a28..aefd6a99298 100644 --- a/layouts/community/60_ansi/mechmerlin-ansi/readme.md +++ b/layouts/community/60_ansi/mechmerlin-ansi/readme.md @@ -5,9 +5,10 @@ This is the 60% layout used by u/merlin36, host of the [MechMerlin](www.youtube. YouTube channel. It is used on his -[Duck Eagle V2](https://github.com/qmk/qmk_firmware/tree/master/keyboards/eagle_viper/v2) -[KBP V60 Type R Polestar](https://github.com/qmk/qmk_firmware/tree/master/keyboards/v60_type_r) -[NPKC KC60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kc60) +[Duck Eagle V2](https://github.com/qmk/qmk_firmware/tree/master/keyboards/eagle_viper/v2) +[NPKC KC60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kc60) +[1up60HSE](https://github.com/qmk/qmk_firmware/tree/master/keyboards/1upkeyboards/1up60hse) +[HS60 V1](https://github.com/qmk/qmk_firmware/tree/master/keyboards/hs60/v1) ## Keymap Notes - Arrow toggle switch is tapping the `FN` key once. diff --git a/layouts/community/60_ansi/stanrc85-ansi/keymap.c b/layouts/community/60_ansi/stanrc85-ansi/keymap.c new file mode 100644 index 00000000000..f478398901e --- /dev/null +++ b/layouts/community/60_ansi/stanrc85-ansi/keymap.c @@ -0,0 +1,51 @@ +/* Copyright 2018 Stanrc85 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "stanrc85.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_60_ansi( + TD_TESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CTLE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, LT_SPCF, KC_RALT, TD_TWIN, MO(_FN2_60), TD_TCTL), + + [_DEFAULT] = LAYOUT_60_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1_60), MO(_FN2_60), KC_RCTL), + + [_FN1_60] = LAYOUT_60_ansi( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, _______, CA_QUOT, KC_VOLU, CA_SCLN, _______, _______, KC_HOME, KC_UP, KC_END, KC_PSCR, _______, _______, KC_INS, + KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_MPLY, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, + _______, KC_RDP, _______, _______, _______, _______, _______, _______, KC_WBAK, KC_WFWD, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______), + + [_FN2_60] = LAYOUT_60_ansi( + _______, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MAKE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, TG(_DEFAULT)) +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/layouts/community/60_ansi/stanrc85-ansi/readme.md b/layouts/community/60_ansi/stanrc85-ansi/readme.md new file mode 100644 index 00000000000..6b5b3ca9ff2 --- /dev/null +++ b/layouts/community/60_ansi/stanrc85-ansi/readme.md @@ -0,0 +1,48 @@ + + +# Stanrc85's Standard ANSI 60% Layout + +## Keymap Notes +- Layer 0 is default QWERTY layout with additional custom features: + - SpaceFN to function layer 2 on `Space` + - `CTRL` when held and `ESC` when tapped on `CAPS LOCK` + - Tap Dance on `Fn1` for `CTRL+ALT+DEL` and `WIN+L` + - Tap Dance on `ESC` for `ESC` and ` ` ` + +![Base QWERTY Layer](https://imgur.com/lGcyLJx.png) + +- Layer 1 is default QWERTY with no custom features used mostly for gaming + - Enabled by `Fn2+CAPS` from base layer + +![Default ANSI Layer](https://imgur.com/M7T9PNT.png) + +- Layer 2 is Function layer: + - F keys + - Arrows + - Volume and Media controls + - AutoHotkey shortcuts based on [Speaker Control](https://github.com/stanrc85/Speaker-Control) script + - AHK Mic is used to mute/unmute microphone + - AHK Speaker switches audio output between headphones and speakers + +![Function Layer](https://imgur.com/YPl0JrU.png) + +- Layer 3 is RGB control and RESET + - `Fn2+CAPS` used to toggle Default QWERTY layer on and off + +![RGB and RESET Layer](https://imgur.com/8K7gSgh.png) + +### Build +To build the firmware file associated with this keymap, simply run `make your_keyboard:stanrc85-ansi`. diff --git a/layouts/community/60_ansi/stanrc85-ansi/rules.mk b/layouts/community/60_ansi/stanrc85-ansi/rules.mk new file mode 100644 index 00000000000..89d03e8c1f6 --- /dev/null +++ b/layouts/community/60_ansi/stanrc85-ansi/rules.mk @@ -0,0 +1 @@ +USER_NAME := stanrc85 diff --git a/layouts/community/60_ansi_split_bs_rshift/bcat/keymap.c b/layouts/community/60_ansi_split_bs_rshift/bcat/keymap.c new file mode 100644 index 00000000000..780c13c2f1d --- /dev/null +++ b/layouts/community/60_ansi_split_bs_rshift/bcat/keymap.c @@ -0,0 +1,42 @@ +#include QMK_KEYBOARD_H + +enum layer { + LAYER_DEFAULT, + LAYER_FUNCTION, + LAYER_ADJUST, +}; + +/* Switch to function layer when held. */ +#define LY_FUNC MO(LAYER_FUNCTION) + +/* Switch to adjust layer when held. */ +#define LY_ADJST MO(LAYER_ADJUST) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Default layer: http://www.keyboard-layout-editor.com/#/gists/327b41b5a933b3d44bf60ca9822e85dc */ + [LAYER_DEFAULT] = LAYOUT_60_ansi_split_bs_rshift( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, LY_FUNC, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LY_ADJST, KC_APP, KC_RCTL + ), + + /* Function layer: http://www.keyboard-layout-editor.com/#/gists/c7a55e75285d474b6301140eaf53f915 */ + [LAYER_FUNCTION] = LAYOUT_60_ansi_split_bs_rshift( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + _______, KC_MPLY, KC_VOLU, KC_MSTP, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, _______, + KC_CAPS, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, + _______, _______, KC_MUTE, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_DOWN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Adjust layer: http://www.keyboard-layout-editor.com/#/gists/6e1068e4f91bbacccaf5ac0acbeec79c */ + [LAYER_ADJUST] = LAYOUT_60_ansi_split_bs_rshift( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_RMOD, RGB_MOD, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/layouts/community/60_ansi_split_bs_rshift/bcat/readme.md b/layouts/community/60_ansi_split_bs_rshift/bcat/readme.md new file mode 100644 index 00000000000..79bff7406c7 --- /dev/null +++ b/layouts/community/60_ansi_split_bs_rshift/bcat/readme.md @@ -0,0 +1,20 @@ +# bcat's 60% ANSI split backspace/right-shift layout + +This is a hybrid of an HHKB layout and a standard ANSI bottom row. It's nice if +you want to fill out a 60% case with no blockers, or just really want a 6.25U +spacebar. The arrow and navigation keys match a standard HHKB layout (using the +Fn key next to the right shift key), but the media keys are centered around the +WASD cluster instead of the usual HHKB layout. Additionally, the redundant Fn +key on the bottom row activates an adjust layer to control RGB underglow. + +## Default layer + +![Default layer layout](https://i.imgur.com/HM0115k.png) + +## Function layer + +![Function layer layout](https://i.imgur.com/8dr5ktH.png) + +## Adjust layer + +![Adjust layer layout](https://i.imgur.com/78PBNt6.png) diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c index 2464dcaa709..98ba86e9415 100644 --- a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c +++ b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c @@ -3,24 +3,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BL] = LAYOUT_60_ansi_split_bs_rshift( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \ - KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TG(2), \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \ + KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TG(2), \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(1), KC_RALT, KC_RGUI, KC_RCTL), [_FL] = LAYOUT_60_ansi_split_bs_rshift( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL, \ - RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, \ + BL_TOGG, BL_INC, BL_DEC, BL_STEP, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_AL] = LAYOUT_60_ansi_split_bs_rshift( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT) }; diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md index 9f7cef347c0..855fd5ac9ec 100644 --- a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md +++ b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md @@ -6,7 +6,8 @@ host of the [MechMerlin](www.youtube.com/mechmerlin) YouTube channel. It is used on his [Sentraq S60-X RGB](https://github.com/qmk/qmk_firmware/tree/master/keyboards/s60_x) -[MechanicalKeyboards.com FaceW](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bfake) +[Zeal60 Rev4](https://github.com/qmk/qmk_firmware/tree/master/keyboards/zeal60) +[DO60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/do60) ## Keymap Notes - Highly influenced by the KBP V60 and WKL B.Face standard layouts diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h b/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h index bf18fd9f7d0..65568d3abf3 100644 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h @@ -34,7 +34,7 @@ { K40, K41, K42, {}, {}, {}, {}, K47, {}, {}, K4A, K4B, K4C, K4D } \ } -#ifdef KEYBOARD_zeal60 +#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) #define ZEAL_RGB diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c b/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c index cfad9da8a31..7812add812b 100644 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c @@ -1,94 +1 @@ -#ifdef KEYBOARD_zeal60 -#include "config.h" -#include "zeal60.h" -#include "rgb_backlight.h" -#include "action_layer.h" -#include "solarized.h" -#include "talljoe.h" - -// from zeal_backlight.c -// we want to be able to set indicators for the spacebar stabs -// but they are not represented by a row/index. -extern backlight_config g_config; -void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ); - -void set_backlight_defaults(void) { - uint8_t space; - uint8_t caps_lock; - map_row_column_to_led(3, 12, &caps_lock); - map_row_column_to_led(4, 7, &space); - backlight_config default_values = { - .use_split_backspace = USE_SPLIT_BACKSPACE, - .use_split_left_shift = USE_SPLIT_LEFT_SHIFT, - .use_split_right_shift = USE_SPLIT_RIGHT_SHIFT, - .use_7u_spacebar = USE_7U_SPACEBAR, - .use_iso_enter = USE_ISO_ENTER, - .disable_when_usb_suspended = 1, - .disable_after_timeout = 0, - .brightness = 255, - .effect = 10, - .color_1 = solarized.base2, - .color_2 = solarized.base02, - .caps_lock_indicator = { .index = caps_lock, .color = solarized.red }, - .layer_1_indicator = { .index = space, .color = solarized.blue }, - .layer_2_indicator = { .index = space, .color = solarized.yellow }, - .layer_3_indicator = { .index = 254, .color = solarized.red }, - .alphas_mods = { - RGB_BACKLIGHT_ALPHAS_MODS_ROW_0, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_1, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_2, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_3, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 } - }; - memcpy(&g_config, &default_values, sizeof(backlight_config)); - backlight_config_save(); - -#undef CUSTOM_RGB_LAYOUTS -#ifdef CUSTOM_RGB_LAYOUTS - solarized_t* S = &solarized; - HSV alphas = S->base2; - HSV custom_color_map[MATRIX_ROWS][MATRIX_COLS] = CM( - S->red, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->red, - S->orange, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->orange, - S->green, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->green, - S->blue, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->blue, S->blue, - S->violet, S->magenta, S->yellow, alphas, S->yellow, S->magenta, S->violet, S->green - ); - for (uint8_t row = 0; row < MATRIX_ROWS; ++row) { - for (uint8_t col = 0; col < MATRIX_COLS; ++col) { - uint8_t index; - map_row_column_to_led( row, col, &index ); - set_key_color(index, custom_color_map[row][col]); - } - } -#endif // CUSTOM_RGB_LAYOUTS -} - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - static uint8_t last_effect; - switch (keycode) { - case DFAULTS: - if (IS_PRESSED(record->event)) set_backlight_defaults(); - return false; - case BL_TOGG: - if (IS_PRESSED(record->event)) { - if (g_config.effect) { - last_effect = g_config.effect; - g_config.effect = 0; - } else { - g_config.effect = last_effect; - } - } - return false; - case EFFECT...EFFECT_END: - if (IS_PRESSED(record->event)) { - uint8_t effect = keycode - EFFECT; - g_config.effect = effect; - backlight_config_save(); - } - return false; - } - - return true; -} -#endif +// This space intentionally left blank diff --git a/layouts/community/60_hhkb/talljoe-hhkb/config.h b/layouts/community/60_hhkb/talljoe-hhkb/config.h index 9e907feeb53..54756a940b6 100644 --- a/layouts/community/60_hhkb/talljoe-hhkb/config.h +++ b/layouts/community/60_hhkb/talljoe-hhkb/config.h @@ -19,4 +19,7 @@ K41, K42, K45, K48, K4C \ ) +#ifdef RGB_BACKLIGHT_M60_A + #define ZEAL_RGB +#endif #endif //CONFIG_USER_H diff --git a/layouts/community/66_ansi/mechmerlin/config.h b/layouts/community/66_ansi/mechmerlin/config.h index f51361866cd..6f70f09beec 100644 --- a/layouts/community/66_ansi/mechmerlin/config.h +++ b/layouts/community/66_ansi/mechmerlin/config.h @@ -1,12 +1 @@ #pragma once - -#ifdef AUDIO_CLICKY - #define AUDIO_CLICKY_ON - #define AUDIO_CLICKY_FREQ_DEFAULT 261.63f - #define AUDIO_CLICKY_FREQ_MIN 65.41f - #define AUDIO_CLICKY_FREQ_MAX 1046.5f - //#define AUDIO_CLICKY_FREQ_FACTOR 1.18921f - //#define AUDIO_CLICKY_FREQ_FACTOR 2.71828f // e - #define AUDIO_CLICKY_FREQ_FACTOR 1.61803f // golden ratio - #define AUDIO_CLICKY_FREQ_RANDOMNESS 17.0f -#endif diff --git a/layouts/community/66_ansi/mechmerlin/keymap.c b/layouts/community/66_ansi/mechmerlin/keymap.c index ea2e923b1ca..9f041e27ca6 100644 --- a/layouts/community/66_ansi/mechmerlin/keymap.c +++ b/layouts/community/66_ansi/mechmerlin/keymap.c @@ -8,20 +8,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_PGUP, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_PGDN, \ KC_CTCP,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, MO(_FL),KC_RGUI,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT), [_FL] = LAYOUT_66_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_VOLU, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_MUTE, KC_VOLD, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_VOLD, \ _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______, _______,_______,_______,_______,_______,_______,KC_MUTE,KC_VOLU,KC_VOLD,_______, _______, KC_PGUP, \ + _______, _______,_______,_______,_______,_______,_______,KC_MUTE,KC_VOLD,KC_VOLU,_______, _______, KC_PGUP, \ _______,_______,_______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END), [_CL] = LAYOUT_66_ansi( BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, _______, RGB_VAI, \ - RGB_TOG,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ - CK_TOGG,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \ - _______,_______,_______, RGB_MOD, _______,_______,_______,RGB_HUD,RGB_SAD,RGB_HUI), + BL_TOGG,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ + RGB_TOG,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + VLK_TOG, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \ + CK_TOGG,_______,_______, RGB_MOD, _______,_______,_______,RGB_HUD,RGB_SAD,RGB_HUI), }; diff --git a/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c b/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c index ec3286b0975..f785cdf3fd9 100644 --- a/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c +++ b/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c @@ -9,13 +9,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [_FL] = LAYOUT_75_ansi(\ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) -}; \ No newline at end of file + RESET, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + BL_TOGG, BL_INC, BL_DEC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END) +}; diff --git a/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md b/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md index 12c95027032..ab7a9b92f73 100644 --- a/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md +++ b/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md @@ -4,7 +4,8 @@ This is the 75% layout used by u/merlin36, host of the [MechMerlin](www.youtube. YouTube channel. It is used on his -[Duck Octagon V2](https://github.com/qmk/qmk_firmware/tree/master/keyboards/octagon/v2) +[Duck Octagon V2](https://github.com/qmk/qmk_firmware/tree/master/keyboards/duck/octagon/v2) +[XD84](https://github.com/qmk/qmk_firmware/tree/master/keyboards/xd84) ### Build To build the firmware file associated with this keymap, simply run `make your_keyboard:mechmerlin-ansi`. diff --git a/layouts/community/ergodox/333fred/keymap.c b/layouts/community/ergodox/333fred/keymap.c index d7728a5bd4a..1345927660a 100644 --- a/layouts/community/ergodox/333fred/keymap.c +++ b/layouts/community/ergodox/333fred/keymap.c @@ -4,168 +4,107 @@ #include "version.h" #include "333fred.h" -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - VRSN, -}; - -enum custom_macros { - VERSION, - EEPROM, - - // Windows macros - DLEFT, - DRIGHT, - PSCREEN_APP, - LSFT_TAB, - - // VS Macros - REFACTOR, - TEST, - DEBUG_TEST, - FORMAT, - BUILD, - GO_TO_IMPL, - FIND_ALL_REF, - REMOVE_SORT_USINGS, - - // KeePass macros - KEEPASS_OPEN, - KEEPASS_TYPE, -}; - // NOTE: Cells marked with ACCESS must remain transparent, they're the keys that actually get to that layer const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - | + * | ` | 1 | 2 | 3 | 4 | 5 | F5 | | F6 | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ | + * | TAB | Q | W | E | R | T | GAME | |GAMEA | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| L2 | |MO(3) |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| SYMB | |MEDIA |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | + * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | = | Right| RGUI | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | Copy | Paste| | Copy | Paste | * ,------|------|------| |------+--------+------. - * | | | PgUp | | PgDn | | | + * | | | PgUp | | Up | | | * | Bcksp|OSL(2)|------| |------| Ent |Space | - * | | VIM | Del | | RCtrl| | | + * | | VIM | Del | | Down | | | * `--------------------' `----------------------' */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default +[BASE] = LAYOUT_ergodox_pretty( // layer 0 : default // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(CODE), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(SYMB), - OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI,KC_LALT, - LCTL(KC_C), LCTL(KC_V), - KC_PGUP, - KC_BSPC,TD(TD_SYM_VIM), KC_DEL, - // right hand - TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT), - KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI, - LCTL(KC_C), LCTL(KC_V), - KC_PGDN, - KC_RCTL, KC_ENT, KC_SPC + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(GAME), TG(GAME_ARROW), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(SYMB), MO(MDIA), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT), + OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI, KC_LALT, KC_LEFT, KC_DOWN, KC_EQL, KC_RIGHT, KC_RGUI, + LCTL(KC_C), LCTL(KC_V), LCTL(KC_C), LCTL(KC_V), + KC_PGUP, KC_UP, + KC_BSPC, TD(TD_SYM_VIM), KC_DEL, KC_DOWN, KC_ENT, KC_SPC ), -/* Keymap 1: Code Layer + +/* Keymap 2: Codeflow Layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | |ACCESS| | | | | | | + * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | F10 | | F11 | | | | | | | + * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| L2 | | |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | F12 |GoToIm| FAR | | | + * | | | | | | | F7 | F8 | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,---------------. - * |Format|Build | | Copy | Paste | + * | |ACCESS| | | | * ,------|------|------| |------+--------+------. - * | | |Refact| | Up | | | - * | |ACCESS|------| |------| | | - * | | | | | Down | | | + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* -[CODE] = LAYOUT_ergodox( // layer 1 : code +[CODEFLOW] = LAYOUT_ergodox_pretty( // layer 1 : code // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F10, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(SYMB), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - M(FORMAT),M(BUILD), - M(REFACTOR), - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F12, M(GO_TO_IMPL),M(FIND_ALL_REF),KC_TRNS, KC_TRNS, - LCTL(KC_C), LCTL(KC_V), - KC_UP, - KC_DOWN, KC_TRNS, KC_TRNS + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_F7, KC_F8, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), -/* Keymap 2: Symbol Layer +/* Keymap 3: Symbol Layer * * ,---------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | ! | @ | ( | ) | | |ACCESS| |ACCESS| Up | 7 | 8 | 9 | * | F12 | + * | | ! | @ | ( | ) | | | | | | Up | 7 | 8 | 9 | * | F12 | * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | # | $ | { | } | ` |------| |------| Down | 4 | 5 | 6 | + | | * |---------+------+------+------+------+------|ACCESS| | |------+------+------+------+------+--------| * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | EPRM | | | | | | 0 | 0 | . | = | | + * | | | | | | | 0 | 0 | . | = | | * `-----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | | Caps | | | | + * | | | | | | * ,------|------|------| |------+------+------. * | | |APScr | | | | | * | |ACCESS|------| |------| | | - * | | | PScr | |ACCESS| | | + * | | | PScr | | | | | * `--------------------' `--------------------' */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( +[SYMB] = LAYOUT_ergodox_pretty( // left hand - VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LPRN,KC_RPRN,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LCBR,KC_RCBR,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_CAPS, - M(PSCREEN_APP), - KC_TRNS,KC_TRNS,KC_PSCR, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, _______, _______, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______, + _______, _______, _______, _______, _______, KC_0, KC_0, KC_DOT, KC_EQL, _______, + _______, _______, _______, _______, + PSCREEN_APP, _______, + _______, _______, KC_PSCR, _______, _______, _______ ), /* Keymap 3: Media and mouse keys * @@ -188,32 +127,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | Back | | | * `--------------------' `--------------------' */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - BL_INC, BL_DEC, - BL_TOGG, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_TRNS, - KC_VOLD, - KC_MPRV, KC_MPLY, KC_MNXT +[MDIA] = LAYOUT_ergodox_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, _______, _______, + BL_INC, BL_DEC, KC_VOLU, _______, + BL_TOGG, KC_VOLD, + _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT ), /* Keymap 4: Movement * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |KOpen |KType |LSHFT | | | | | | Copy | | | | Paste| | + * | |KOpen |KType |TERMCP|TERMPT| | | | | Copy | | | | Paste| | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | |DLeft |DRight|LCTRL | LGUI | |------| |------| Left | Down | Up | Right| | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -230,141 +159,93 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ // MEDIA AND MOUSE -[VIM] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(KEEPASS_OPEN),M(KEEPASS_TYPE),KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, KC_TRNS, - KC_TRNS, M(LSFT_TAB), KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, LCTL(KC_C),KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_V),KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_HOME, KC_END, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - -) -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case VERSION: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case EEPROM: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - case DLEFT: - if (record->event.pressed) { // Windows move desktop left - return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); - } - break; - case DRIGHT: - if (record->event.pressed) { // Windows move desktop right - return MACRO(D(LCTL), D(LGUI), T(RIGHT), U(LGUI), U(LCTL), END); - } - break; - case PSCREEN_APP: - if (record->event.pressed) { - return MACRO(D(LALT), T(PSCR), U(LALT), END); - } - break; - case LSFT_TAB: - if (record->event.pressed) { - return MACRO(D(LSFT), T(TAB), U(LSFT), END); - } - case REFACTOR: - if (record->event.pressed) { // VS Refactor CTRL+R, R - return MACRO(D(LCTL), T(R), U(LCTL), T(R), END); - } - break; - case TEST: - if (record->event.pressed) { // VS Run Tests CTRL+R, T - return MACRO(D(LCTL), T(R), U(LCTL), T(T), END); - } - break; - case DEBUG_TEST: - if (record->event.pressed) { // VS Debug Tests CTRL+R, CTRL+T - return MACRO(D(LCTL), T(R), T(T), U(LCTL), END); - } - break; - case FORMAT: - if (record->event.pressed) { // VS Format Document, CTRL+K, CTRL+D - return MACRO(D(LCTL), T(K), T(D), U(LCTL), END); - } - break; - case BUILD: - if (record->event.pressed) { // VS Build. Sends CTRL+SHFT+B - return MACRO(D(LCTL), D(LSFT), T(B), U(LSFT), U(LCTL), END); - } - break; - case GO_TO_IMPL: - if (record->event.pressed) { // VS Go To Implementation. Sends CTRL+F12 - return MACRO(D(LCTL), T(F12), U(LCTL), END); - } - break; - case FIND_ALL_REF: - if (record->event.pressed) { // VS Find All References. Sends CTRL+K, R - return MACRO(D(LCTL), T(K), U(LCTL), T(R), END); - } - break; - case REMOVE_SORT_USINGS: - if (record->event.pressed) { - return MACRO(D(LCTL), T(R), T(G), U(LCTL), END); - } - break; - case KEEPASS_OPEN: - if (record->event.pressed) { // Keepass open application - return MACRO(D(LCTL), D(LALT), T(K), U(LALT), U(LCTL), END); - } - break; - case KEEPASS_TYPE: - if (record->event.pressed) { // Keepass autotype - return MACRO(D(LCTL), D(LALT), T(A), U(LALT), U(LCTL), END); - } - break; - } - return MACRO_NONE; +[VIM] = LAYOUT_ergodox_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + _______, _______, KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_HOME, KC_END, + _______, _______, + _______, _______, _______, _______, _______, _______ +), +/* Keymap 1: Game Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | |ACCESS| | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CTRL | | | | | |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | SHIFT | Z | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |ENTER | | | LOCK | BSPC | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | F5 | F6 | | | | + * ,------|------|------| |------+--------+------. + * | | | | | | | | + * | ALT | SPC |------| |------| | | + * | | | SYMB | | | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[GAME] = LAYOUT_ergodox_pretty( // layer 1 : code + // left hand + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_ENT, _______, _______, KC_LOCK, KC_BSPC, _______, _______, _______, _______, _______, + KC_F5, KC_F6, LCTL(KC_C), LCTL(KC_V), + _______, KC_UP, + KC_LALT, KC_SPC, OSM(SYMB), KC_DOWN, _______, _______ + ), +/* Keymap 1: Game Arrow Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | Up | | | | | |ACCESS| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CTRL | Left | Down |Right | | |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | SHIFT | Z | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |ENTER | | | LOCK | BSPC | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | F5 | F6 | | | | + * ,------|------|------| |------+--------+------. + * | | | | | | | | + * | ALT | SPC |------| |------| | | + * | | | SYMB | | | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[GAME_ARROW] = LAYOUT_ergodox_pretty( // layer 1 : code + // left hand + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LCTL, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_ENT, _______, _______, KC_LOCK, KC_BSPC, _______, _______, _______, _______, _______, + KC_F5, KC_F6, LCTL(KC_C), LCTL(KC_V), + _______, KC_UP, + KC_LALT, KC_SPC, OSM(SYMB), KC_DOWN, _______, _______ + ) }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - tap_dance_process_record(keycode); - switch (keycode) { - // dynamically generate these. - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; - break; - case VRSN: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - } + tap_dance_process_keycode(keycode); return true; } // Runs constantly in the background, in a loop. -void matrix_scan_user_keyboard(void) { +void matrix_scan_user(void) { ergodox_board_led_on(); ergodox_led_all_on(); } diff --git a/layouts/community/ergodox/333fred/visualizer.c b/layouts/community/ergodox/333fred/visualizer.c index 2a30562ae7d..d13b3cd7947 100644 --- a/layouts/community/ergodox/333fred/visualizer.c +++ b/layouts/community/ergodox/333fred/visualizer.c @@ -14,16 +14,22 @@ static void get_visualizer_layer_and_color(visualizer_state_t* state) { if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) { saturation = 255; } - if (state->status.layer & 0x10) { + if (state->status.layer & 0x80) { + state->target_lcd_color = LCD_COLOR(0, 255, 60); + state->layer_text = "Game Arrow"; + } else if (state->status.layer & 0x40) { + state->target_lcd_color = LCD_COLOR(0, 255, 60); + state->layer_text = "Game"; + } else if (state->status.layer & 0x20) { state->target_lcd_color = LCD_COLOR(140, 100, 60); state->layer_text = "Movement"; - } else if (state->status.layer & 0x8) { + } else if (state->status.layer & 0x10) { state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF); state->layer_text = "Media"; - } else if (state->status.layer & 0x4) { + } else if (state->status.layer & 0x8) { state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF); state->layer_text = "Symbol"; - } else if (state->status.layer & 0x2) { + } else if (state->status.layer & 0x2 || state->status.layer & 0x4) { state->target_lcd_color = LCD_COLOR(216, 90, 0xFF); state->layer_text = "Code"; } else { diff --git a/layouts/community/ergodox/ab/keymap.c b/layouts/community/ergodox/ab/keymap.c index 7bda0cd2233..d8d7accdcbe 100644 --- a/layouts/community/ergodox/ab/keymap.c +++ b/layouts/community/ergodox/ab/keymap.c @@ -105,9 +105,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/absenth/keymap.c b/layouts/community/ergodox/absenth/keymap.c index b9dddfb420f..e4f1ec901a6 100644 --- a/layouts/community/ergodox/absenth/keymap.c +++ b/layouts/community/ergodox/absenth/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSPC, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -136,10 +136,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/adam/keymap.c b/layouts/community/ergodox/adam/keymap.c index e99e5d45353..100bb681981 100644 --- a/layouts/community/ergodox/adam/keymap.c +++ b/layouts/community/ergodox/adam/keymap.c @@ -11,9 +11,6 @@ #define SFLOCK 11 // symbols arrows and F keys on F held down #define SJLOCK 12 // same as Flock but with fall thru J and mapped to J held down -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Sends macro when key is tapped, presses mod when key is held #define tap_mod_macro(record, mod, macro) ( ((record)->event.pressed) ? \ ( ((record)->tap.count <= 0 || (record)->tap.interrupted) ? MACRO(D(mod), END) : MACRO_NONE ) : \ diff --git a/layouts/community/ergodox/adnw_k_o_y/keymap.c b/layouts/community/ergodox/adnw_k_o_y/keymap.c index 4ff4495905c..8a0e47026ed 100644 --- a/layouts/community/ergodox/adnw_k_o_y/keymap.c +++ b/layouts/community/ergodox/adnw_k_o_y/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), DE_V, DE_G, DE_C, DE_L, DE_SS, DE_Z, DE_D, DE_T, DE_R, DE_N, LT(MDIA, DE_S), GUI_T(KC_F), MEH_T(KC_NO),KC_B, KC_P, KC_W, KC_M, CTL_T(KC_J), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_RSFT @@ -136,10 +136,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/alexjj/keymap.c b/layouts/community/ergodox/alexjj/keymap.c index 5127b93f46f..5f4f85cd431 100644 --- a/layouts/community/ergodox/alexjj/keymap.c +++ b/layouts/community/ergodox/alexjj/keymap.c @@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_LCTRL, LCTL(KC_C), LCTL(KC_V), KC_LEFT,KC_RGHT, - KC_FN3, KC_F5, + TT(UNIC), KC_F5, KC_PGUP, KC_ENT,KC_BSPC,KC_PGDN, // right hand @@ -47,9 +47,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_END, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_DOWN,KC_UP, ALL_T(KC_NO),KC_GRV, KC_RCTRL, - KC_F2, KC_FN2, + KC_F2, TT(MDIA), KC_INS, - KC_DELT,KC_FN1, KC_SPC + KC_DELT,TT(SYMB), KC_SPC ), /* Keymap 1: Symbol Layer * @@ -179,13 +179,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) - [2] = ACTION_LAYER_TAP_TOGGLE(MDIA), // FN2 - Momentary Layer 2 (Media) - [3] = ACTION_LAYER_TAP_TOGGLE(UNIC) // FN3 - Momentary Layer 3 (Unicode entry) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/algernon/NEWS.md b/layouts/community/ergodox/algernon/NEWS.md index 1bc2b5dc6aa..a6ce9813baf 100644 --- a/layouts/community/ergodox/algernon/NEWS.md +++ b/layouts/community/ergodox/algernon/NEWS.md @@ -1,5 +1,18 @@ +## v1.12 + +*2018-11-22* + +### Overall changes + +* Updated to work with QMK master. + +### Miscellaneous + +* The `😂` symbol can be entered with UCIS. +* `LEAD r` now inputs `Right Alt`. + ## v1.11 *2017-10-01* diff --git a/layouts/community/ergodox/algernon/images/adore-layer.png b/layouts/community/ergodox/algernon/images/adore-layer.png new file mode 100644 index 00000000000..75d2ca4f08b Binary files /dev/null and b/layouts/community/ergodox/algernon/images/adore-layer.png differ diff --git a/layouts/community/ergodox/algernon/images/base-layer.png b/layouts/community/ergodox/algernon/images/base-layer.png new file mode 100644 index 00000000000..2ca7a273bed Binary files /dev/null and b/layouts/community/ergodox/algernon/images/base-layer.png differ diff --git a/layouts/community/ergodox/algernon/images/heatmap.png b/layouts/community/ergodox/algernon/images/heatmap.png new file mode 100644 index 00000000000..4f55c5adff5 Binary files /dev/null and b/layouts/community/ergodox/algernon/images/heatmap.png differ diff --git a/layouts/community/ergodox/algernon/images/steno-layer.png b/layouts/community/ergodox/algernon/images/steno-layer.png new file mode 100644 index 00000000000..9a2ba55effa Binary files /dev/null and b/layouts/community/ergodox/algernon/images/steno-layer.png differ diff --git a/layouts/community/ergodox/algernon/keymap.c b/layouts/community/ergodox/algernon/keymap.c index ebdc4ab4e49..fb6de1b721d 100644 --- a/layouts/community/ergodox/algernon/keymap.c +++ b/layouts/community/ergodox/algernon/keymap.c @@ -13,6 +13,7 @@ #include "eeconfig.h" #include "wait.h" #include "version.h" +#include "print.h" /* Layers */ @@ -1033,6 +1034,10 @@ void matrix_scan_user(void) { } #endif + SEQ_ONE_KEY (KC_R) { + ang_tap(KC_RALT, 0); + } + SEQ_ONE_KEY (KC_T) { time_travel = !time_travel; } @@ -1126,7 +1131,8 @@ const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE UCIS_SYM("micro", 0x00b5), UCIS_SYM("tm", 0x2122), UCIS_SYM("child", 0x1f476), - UCIS_SYM("family", 0x1F46A) + UCIS_SYM("family", 0x1F46A), + UCIS_SYM("joy", 0x1F602) ); bool process_record_user (uint16_t keycode, keyrecord_t *record) { diff --git a/layouts/community/ergodox/algernon/readme.md b/layouts/community/ergodox/algernon/readme.md index 03b094edb2c..a25018a7bc6 100644 --- a/layouts/community/ergodox/algernon/readme.md +++ b/layouts/community/ergodox/algernon/readme.md @@ -3,7 +3,12 @@ algernon's layout ======================= -This is an unconventional layout for the [ErgoDox EZ][ez]. For more details about the history of the layout, see my [blog posts about my ErgoDox journey][blog-ergodox]. +This is the layout I used to use on my [ErgoDox EZ][ez], while I was using [QMK][qmk]. I no longer do so, and this repository is obsolete, and not updated anymore. My current firmware is based on [Kaleidoscope][kaleidoscope], and is located [elsewhere][ergodox-sketch]. I'm keeping the repo around for historical and educational purposes. + + [kaleidoscope]: https://github.com/keyboardio/Kaleidoscope + [ergodox-sketch]: https://git.madhouse-project.org/algernon/ErgoDox-sketch + +Nevertheless, this is an unconventional layout for the [ErgoDox EZ][ez]. For more details about the history of the layout, see my [blog posts about my ErgoDox journey][blog-ergodox]. [ez]: https://ergodox-ez.com/ [blog-ergodox]: https://asylum.madhouse-project.org/blog/tags/ergodox/ @@ -57,6 +62,7 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest - `LEAD d` toggles logging keypress positions to the HID console. - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader. - `LEAD u` enters the [Unicode symbol input](#unicode-symbol-input) mode. + - `LEAD r` inputs `Right Alt`, which is the `Compose` key of my choice. The symbols on the front in the image above have the same color as the key that activates them, with the exception of the **Arrow** layer, which is just black on the front. @@ -128,13 +134,13 @@ $ git clone https://github.com/qmk/qmk_firmware.git $ cd qmk_firmware $ git clone https://github.com/algernon/ergodox-layout.git \ layouts/community/ergodox/algernon_master -$ make ergodox_ez-algernon_master +$ make ergodox_ez:algernon_master ``` From time to time, updates may be submitted back to the QMK repository. If you are reading it there, you can build the firmware like any other firmware included with it (assuming you are in the root directory of the firmware): ``` -$ make ergodox_ez-algernon +$ make ergodox_ez:algernon ``` ## Using on Windows diff --git a/layouts/community/ergodox/algernon/rules.mk b/layouts/community/ergodox/algernon/rules.mk index 53dec5153af..1b4c0995f63 100644 --- a/layouts/community/ergodox/algernon/rules.mk +++ b/layouts/community/ergodox/algernon/rules.mk @@ -9,8 +9,9 @@ KEYLOGGER_ENABLE ?= yes UCIS_ENABLE = yes MOUSEKEY_ENABLE = no LEADER_ENABLE = yes +RGBLIGHT_ENABLE = no -AUTOLOG_ENABLE ?= no +AUTOLOG_ENABLE ?= yes ifeq (${FORCE_NKRO},yes) OPT_DEFS += -DFORCE_NKRO diff --git a/layouts/community/ergodox/alphadox/keymap.c b/layouts/community/ergodox/alphadox/keymap.c index 8acd86b7ae8..75784f7a910 100644 --- a/layouts/community/ergodox/alphadox/keymap.c +++ b/layouts/community/ergodox/alphadox/keymap.c @@ -73,9 +73,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { case TEENSY: diff --git a/layouts/community/ergodox/andrew_osx/keymap.c b/layouts/community/ergodox/andrew_osx/keymap.c index ef37fc0329b..8fb570bd757 100644 --- a/layouts/community/ergodox/andrew_osx/keymap.c +++ b/layouts/community/ergodox/andrew_osx/keymap.c @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = LAYOUT_ergodox( // layer 0 : default // left hand KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_QUOT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_FN1, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TT(SYMB), CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), LT(SYMB,KC_GRV),KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_SPC,KC_LGUI,KC_RPRN, // right hand KC_QUOT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_FN1, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + TT(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_BSLS, MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TG(1), @@ -138,10 +138,6 @@ LAYOUT_ergodox( ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/belak/keymap.c b/layouts/community/ergodox/belak/keymap.c index 016cf30b4b4..bca0dec913f 100644 --- a/layouts/community/ergodox/belak/keymap.c +++ b/layouts/community/ergodox/belak/keymap.c @@ -5,7 +5,6 @@ #include "eeprom.h" #define LAYER_ON(pos) ((layer_state) & (1<<(pos))) -#define _______ KC_TRNS #define EECONFIG_BELAK_MAGIC (uint16_t)0xBE42 diff --git a/layouts/community/ergodox/bepo/keymap.c b/layouts/community/ergodox/bepo/keymap.c index c33c3c25502..6ea8cba681a 100644 --- a/layouts/community/ergodox/bepo/keymap.c +++ b/layouts/community/ergodox/bepo/keymap.c @@ -50,7 +50,7 @@ KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, KC_CAPSLOCK, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, KC_NUMLOCK, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, - BP_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, + KC_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, DF(AZ_B), DF(BEPO), MO(NUMK), MO(FNAV), KC_RSHIFT, KC_ENTER), diff --git a/layouts/community/ergodox/bepo_alt/keymap.c b/layouts/community/ergodox/bepo_alt/keymap.c new file mode 100644 index 00000000000..fc40afd8712 --- /dev/null +++ b/layouts/community/ergodox/bepo_alt/keymap.c @@ -0,0 +1,127 @@ +/* Bepo layout for ergodox EZ by Nicolas CARPi (deltablot.com) */ +#include QMK_KEYBOARD_H +#include "keymap_bepo.h" +#include "keymap_french.h" + +#define BEPO 0 // default layer, for bepo compatible systems +#define FNAV 1 // function / navigation / mouse layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: default layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | ( | ) | @ | | + | - | - | / | * | = | % | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | B |E_ACUT| P | O |E_GRAV|Backsp| |CapsLo| ^ | V | D | L | J | Z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | W | A | U | I | E | , |------| |------| C | T | S | R | N | M | + * |--------+------+------+------+------+------| | | ESCAP------+------+------+------+------+--------| + * | SHIFT |E_CIRC | A_GRAV | Y | X | . | K | | | ' | Q | G | H | F | C_CEDIL| + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * |Ctrl|LSuper|LSuper| LSuper| LAlt| | PgUp | PgDwn| |BEPO| Delete | | AltGr| RSuper|RSuper|RCtrl| Enter| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | |Insert| |L_Fnav| | | + * | Space|Shift |------| |------|RShift|Enter | + * | | |Mouse | | Fn | | | + * `--------------------' `--------------------' + * df is for temporary stuff and mo is for toggle (momentary) + * so mouse is to toggle the mouse mode + */ +[BEPO] = LAYOUT_ergodox( + +/* Left hand */ +BP_DOLLAR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_AT, +KC_TAB, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_E_GRAVE, KC_BSPC, +BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMMA, +KC_LSHIFT, BP_ECRC, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, +KC_LCTL, KC_LGUI, KC_LGUI, KC_LGUI, KC_LALT, + KC_PGUP, KC_PGDOWN, + KC_INS, + KC_SPC, KC_LSHIFT, DF(FNAV), + +/* Right hand */ + BP_PLUS, BP_MINUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL, BP_PERCENT, + KC_CAPSLOCK, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, + BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, + KC_ESC, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, + KC_ALGR, KC_RGUI, KC_RGUI, KC_RCTL, KC_ENTER, +DF(BEPO), KC_DEL, +DF(FNAV), +MO(FNAV), KC_RSHIFT, KC_ENTER), + +/* Keymap 1: function / navigation / mouse layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | F12 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | Next |LClick| Up |RClick| WhUp |Backspace| | | PgUp | Home | Up | End | F11 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Prev | Left | Down | Right|WhDown|------| |------| Left | Down | Up | Right | F12 | | + * |--------+------+------+------+------+------| VolUp| | |------+------+------+------+------+--------| + * | Shift | Undo | Cut | Copy | Paste| | | | | | | | | | | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | ctrl | super | super | alt | | Home | End | | | | | | Alt | | |Ctrl | | + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[FNAV] = LAYOUT_ergodox( + +/* Left hand */ +KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, +KC_NO, KC_MS_BTN5, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_MS_WH_UP, KC_BSPC, +KC_NO, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, +KC_LSHIFT, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_NO, KC_VOLD, +KC_LCTL, KC_INS, KC_LGUI, KC_LGUI, KC_LALT, + KC_HOME, KC_END, + KC_TRNS, + KC_NO, KC_TRNS, KC_TRNS, + +/* Right hand */ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F12, + KC_NO, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_F11, KC_NO, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_F12, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_RALT, KC_TRNS, KC_TRNS, KC_RCTL, KC_NO, +KC_TRNS, KC_TRNS, +KC_TRNS, +KC_TRNS, KC_TRNS, KC_NO), +}; + +/* helper function to switch on of the right LED ON/OFF */ +static void indicate_using_led(const uint8_t led, const bool enabled) { + if (enabled) { + ergodox_right_led_on(led); + } else { + ergodox_right_led_off(led); + } +} + +/* Runs constantly in the background, in a loop */ +void matrix_scan_user(void) { + + /* red led for shift */ + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + indicate_using_led(1, true); + } else { + indicate_using_led(1, false); + } + + /* green led for alt */ + if (keyboard_report->mods & MOD_BIT(KC_LALT) || + ((get_oneshot_mods() & MOD_BIT(KC_LALT)) && !has_oneshot_mods_timed_out())) { + indicate_using_led(2, true); + } else { + indicate_using_led(2, false); + } + + /* blue led for function mode */ + if (IS_LAYER_ON(FNAV)) { + indicate_using_led(3, true); + } else { + indicate_using_led(3, false); + } +}; diff --git a/layouts/community/ergodox/bepo_alt/readme.md b/layouts/community/ergodox/bepo_alt/readme.md new file mode 100644 index 00000000000..c8cc1225cc9 --- /dev/null +++ b/layouts/community/ergodox/bepo_alt/readme.md @@ -0,0 +1,66 @@ +![layer0](https://i.imgur.com/vd4QLBf.png) + +![layer1](https://i.imgur.com/eo101eD.png) + +# BEPO keymap for the ErgoDox (alternate version) + +This keymap has been made for the BEPO layout (https://bepo.fr), which is an ergonomic french keyboard layout based on Dvorak rules. As it's made for french people, the following of this readme will be in french. + +Keyboard Maintainer: [Nicolas CARPi](https://github.com/NicolasCARPi) + +Hardware Supported: Ergodox EZ + +## Disposition BÉPO pour l'ErgoDox + +Cette keymap a été adaptée de la keymap "bepo_csa" présente dans le dossier parent. + +Certaines modifications ont été apportées pour ressembler un peu plus à une clavier traditionel: + +* entrée sur la touche tout en bas à droite (comme la touche entrée du pavé numérique sur un clavier traditionnel) +* plusieurs touches "Super" pour faciliter son accès + +Il y a deux layers, celui de base, et celui avec les flèches, les touches fonction et la souris (main gauche). + +## Particularités + +* Touches de repos des pouces : "espace" à gauche et "entrée" à droite. +* Touche Ctrl gauche accessible avec la paume de la main. +* Touche "w" placée sur la main gauche (j'ai toujours trouvé le "w" difficle d'accès sur un clavier bépo classique. +* Plusieurs touches F12. +* Les flèches sont disposées avec un déplacement à la VIM. +* Un mode souris permet d'utiliser la souris avec le clavier. +* Possibilité de changer de mode de manière temporaire ou permanente. +* Les leds s'allument avec SHIFT, ALT ou la touche function. + +J'ai fait cette disposition pour mes besoins, à vous de la modifier pour les vôtres ;) + +## Utilisation + +### Pré-requis + +Pour Archlinux, il est nécessaire d'installer ces paquets au préalable: + +~~~bash +sudo pacman -S avr-gcc avr-libc teensy-loader-cli +~~~ + +Les paquets "avr" permettent de compiler le firmware, et teensy-loader permet de le charger sur le clavier. + +### Compilation + +~~~bash +# clone the repo +git clone https://github.com/qmk/qmk_firmware +# install submodules +make git-submodule +# compile this layout +make ergodox_ez:bepo_alt +~~~ + +### Chargement + +~~~bash +teensy-loader-cli -w -mmcu=atmega32u4 -v ergodox_ez_bepo_alt.hex && sleep 6 && setxkbmap fr bepo +~~~ + +J'ai ajouté un sleep avant la commande pour remettre en bépo afin de laisser au clavier le temps de rebooter. diff --git a/layouts/community/ergodox/bepo_alt/rules.mk b/layouts/community/ergodox/bepo_alt/rules.mk new file mode 100644 index 00000000000..faca18b5431 --- /dev/null +++ b/layouts/community/ergodox/bepo_alt/rules.mk @@ -0,0 +1,5 @@ +# Having a file like this allows you to override Makefile definitions +# for your own particular keymap + +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/layouts/community/ergodox/bepo_csa/keymap.c b/layouts/community/ergodox/bepo_csa/keymap.c index 9526ea3f77b..8dfb95a337c 100644 --- a/layouts/community/ergodox/bepo_csa/keymap.c +++ b/layouts/community/ergodox/bepo_csa/keymap.c @@ -105,7 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_BSPC, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, KC_ENT, BP_APOS, BP_Q, BP_G, BP_H, BP_F, KC_RSFT, - BP_ALGR, BP_PERC, KC_APP, BP_CCED, KC_RCTL, + KC_ALGR, BP_PERC, KC_APP, BP_CCED, KC_RCTL, KC_LEFT, KC_RGHT, KC_UP, @@ -362,9 +362,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { -}; - void hold_shift(void) { register_code(KC_LSHIFT); } @@ -449,14 +446,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) register_code(KC_1 + (id - M_1)); break; case M_DEGR: - return MACRO(DOWN(CSA_ALTGR), D(SCLN), END); + return MACRO(DOWN(KC_ALGR), D(SCLN), END); case M_SCLN: return MACRO(D(SCLN), END); case M_GRV: - return MACRO(I(75), DOWN(CSA_ALTGR), TYPE(CSA_DCRC), UP(CSA_ALTGR), T(SPACE), END); + return MACRO(I(75), DOWN(KC_ALGR), TYPE(CSA_DCRC), UP(KC_ALGR), T(SPACE), END); case M_NBSP: // use weak mod such that pressing another key will not be affected - add_weak_mods(MOD_BIT(CSA_ALTGR)); + add_weak_mods(MOD_BIT(KC_ALGR)); return MACRO(D(SPACE), END); } } else { @@ -466,11 +463,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) unregister_code(KC_1 + (id - M_1)); break; case M_DEGR: - return MACRO(UP(CSA_ALTGR), U(SCLN), END); + return MACRO(UP(KC_ALGR), U(SCLN), END); case M_SCLN: return MACRO(U(SCLN), END); case M_NBSP: - del_weak_mods(MOD_BIT(CSA_ALTGR)); + del_weak_mods(MOD_BIT(KC_ALGR)); return MACRO(U(SPACE), END); } } diff --git a/layouts/community/ergodox/berfarah/rules.mk b/layouts/community/ergodox/berfarah/rules.mk index a8732503729..abd95b50087 100644 --- a/layouts/community/ergodox/berfarah/rules.mk +++ b/layouts/community/ergodox/berfarah/rules.mk @@ -14,6 +14,3 @@ ifeq (${FORCE_NKRO},yes) OPT_DEFS += -DFORCE_NKRO endif -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/layouts/community/ergodox/bocaj/config.h b/layouts/community/ergodox/bocaj/config.h index 78350f60336..bc1d20a626a 100644 --- a/layouts/community/ergodox/bocaj/config.h +++ b/layouts/community/ergodox/bocaj/config.h @@ -2,5 +2,5 @@ #include QMK_KEYBOARD_CONFIG_H -#undef PRODUCT -#define PRODUCT BocajEZ - Frankensteined ErgoDox EZ +#define LEADER_TIMEOUT 250 +#define LEADER_PER_KEY_TIMING diff --git a/layouts/community/ergodox/bocaj/keymap.c b/layouts/community/ergodox/bocaj/keymap.c index fbe0fca6538..cb78e7aae7f 100644 --- a/layouts/community/ergodox/bocaj/keymap.c +++ b/layouts/community/ergodox/bocaj/keymap.c @@ -1,5 +1,5 @@ /* -Copyright 2018 Jacob Jerrell jacob.jerrell@gmail.com @JacobJerrell +Copyright 2018 Jacob Jerrell @JacobJerrell This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,97 +14,99 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ + #include QMK_KEYBOARD_H #include "bocaj.h" +#define LAYOUT_ergodox_pretty_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_ergodox_pretty_wrapper( \ + KC_ESC, __________________NUMBER_LEFT_______________, JJ_ARRW, KC_MINS, __________________NUMBER_RIGHT______________, KC_EQUAL, \ + KC_DEL, K01, K02, K03, K04, K05, KC_LPRN, KC_RPRN, K06, K07, K08, K09, K0A, KC_BSLASH, \ + KC_NUMS, K11, SFT_T(K12), K13, ALT_T(K14), K15, K16, ALT_T(K17), K18, SFT_T(K19), K1A, KC_QUOT, \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, HYP_LBK, MEH_RBK, K26, K27, K28, K29, CTL_T(K2A), KC_RSFT, \ + KC_GAME,KC_NUMS, TT(_LOWER), KC_UP, KC_LEFT, KC_RIGHT, KC_DOWN, UC_DISA,KC_GAME, KC_ADJS, \ + KC_APP,KC_HOME, KC_END,KC_ESC, \ + UC_FLIP, UC_TABL, \ + KC_SPACE,KC_BSPACE,KC_LEAD, UC_SHRG,KC_TAB,KC_LWEN \ +) + +#define LAYOUT_ergodox_pretty_base_wrapper(...) LAYOUT_ergodox_pretty_base(__VA_ARGS__) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Hardware Workman - http://www.keyboard-layout-editor.com/#/gists/7a07cb982ec3597ba3e3d947554225f1 - .---------------------------------------------. .---------------------------------------------. - | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | DEL | Q | D | R | W | B | ( | ! ) | J | F | U | P | ; | \ | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | NUMS | A | S | H | T | G |-------! !-------! Y | N | E | O | I | ' | - !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! - | SHIFT | Z | X | M | C | V | [ | ! ] | K | L | , | . | / | SHIFT | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | - '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | END | ! PGDN | ! ENTER ! - ! SPACE ! BSPCE !-------! !-------! TAB ! / ! - | | | COPY | ! PASTE | | LOWER | - '-----------------------' '-----------------------' + /* Workman - http://www.keyboard-layout-editor.com/#/gists/7a07cb982ec3597ba3e3d947554225f1 + .---------------------------------------------. .---------------------------------------------. + | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | DEL | Q | D | R | W | B | ( | ! ) | J | F | U | P | ; | \ | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | NUMS | A | S | H | T | G |-------! !-------! Y | N | E | O | I | ' | + !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! + | SHIFT | Z | X | M | C | V | [ | ! ] | K | L | , | . | / | SHIFT | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | |GAME | ADJ | + '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | END | ! PGDN | ! ENTER ! + ! SPACE ! BSPCE !-------! !-------! TAB ! / ! + | | | COPY | ! PASTE | | LOWER | + '-----------------------' '-----------------------' */ - [_HWRKMN] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC, _______________________NUMBER_LEFT_______________________, JJ_ARRW, KC_MINUS,_______________________NUMBER_RIGHT______________________, KC_EQUAL, - KC_DEL, _______________________HWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________HWORKMAN_R1_______________________, KC_BSLS, - KC_NUMS,_______________________HWORKMAN_L2_______________________, _______________________HWORKMAN_R2_______________________, KC_QUOTE, - KC_LSFT,_______________________HWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________HWORKMAN_R3_______________________, KC_RSFT, - ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, - ______________________ERGODOX_THUMBS_____________________ + [_WORKMAN] = LAYOUT_ergodox_pretty_base_wrapper( + _________________WORKMAN_L1_________________, _________________WORKMAN_R1_________________, + _________________WORKMAN_L2_________________, _________________WORKMAN_R2_________________, + _________________WORKMAN_L3_________________, _________________WORKMAN_R3_________________ ), -/* Software Workman / QWERTY - http://www.keyboard-layout-editor.com/#/gists/b6c016a22a9d31381a276a603a42fe5f - .---------------------------------------------. .---------------------------------------------. - | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | DEL | Q | W | E | R | T | ( | ! ) | Y | U | I | O | P | \ | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | NUMS | A | S | D | F | G |-------! !-------! H | J | K | L | ; | ' | - !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! - | SHIFT | Z | X | C | V | B | [ | ! ] | N | M | , | . | / | SHIFT | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | - '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | END | ! PGDN | ! ENTER ! - ! SPACE ! BSPCE !-------! !-------! TAB ! / ! - | | | COPY | ! PASTE | | LOWER | - '-----------------------' '-----------------------' -*/ - [_SWRKMN] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC, _______________________NUMBER_LEFT_______________________, JJ_ARRW, KC_MINUS,_______________________NUMBER_RIGHT______________________, KC_EQUAL, - KC_DEL, _______________________SWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________SWORKMAN_R1_______________________, KC_BSLS, - KC_NUMS,_______________________SWORKMAN_L2_______________________, _______________________SWORKMAN_R2_______________________, KC_QUOTE, - KC_LSFT,_______________________SWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________SWORKMAN_R3_______________________, KC_RSFT, - ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, - ______________________ERGODOX_THUMBS_____________________ + [_WINWORKMAN] = LAYOUT_ergodox_pretty_base_wrapper( + _________________WORKMAN_L1_________________, _________________WORKMAN_R1_________________, + ________________WWORKMAN_L2_________________, ________________WWORKMAN_R2_________________, + _________________WORKMAN_L3_________________, _________________WORKMAN_R3_________________ ), -/* Lower - http://www.keyboard-layout-editor.com/#/gists/f1d745a88d1c48ab55e095efd9e7a43a - .---------------------------------------------. .---------------------------------------------. - | ESC | | | | | | -> | ! - | | | | | | = | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | DEL | ! | @ | # | $ | % | ( | ! ) | ^ | & | * | ( | ) | \ | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | ` | 1 | 2 | 3 | 4 | 5 |-------! !-------! 6 | 7 | 8 | 9 | 0 | ' | - !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! - | SHIFT | | | | | | [ | ! ] | | | | | | SHIFT | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | - '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | END | ! PGDN | ! ENTER ! - ! SPACE ! BSPCE !-------! !-------! TAB ! / ! - | | | COPY | ! PASTE | | LOWER | - '-----------------------' '-----------------------' +/* QWERTY - http://www.keyboard-layout-editor.com/#/gists/b6c016a22a9d31381a276a603a42fe5f + .---------------------------------------------. .---------------------------------------------. + | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | DEL | Q | W | E | R | T | ( | ! ) | Y | U | I | O | P | \ | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | NUMS | A | S | D | F | G |-------! !-------! H | J | K | L | ; | ' | + !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! + | SHIFT | Z | X | C | V | B | [ | ! ] | N | M | , | . | / | SHIFT | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | + '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | END | ! PGDN | ! ENTER ! + ! SPACE ! BSPCE !-------! !-------! TAB ! / ! + | | | COPY | ! PASTE | | LOWER | + '-----------------------' '-----------------------' */ + [_QWERTY] = LAYOUT_ergodox_pretty_base_wrapper( + _________________QWERTY_L1__________________, _________________QWERTY_R1__________________, + _________________QWERTY_L2__________________, _________________QWERTY_R2__________________, + _________________QWERTY_L3__________________, _________________QWERTY_R3__________________ + ), [_LOWER] = LAYOUT_ergodox_pretty_wrapper( - _______,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, _______, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, - _______,_______________________SPECIAL_LEFT______________________, _______, _______, _______________________SPECIAL_RIGHT_____________________, _______, - KC_GRV ,_______________________NUMBER_LEFT_______________________, _______________________NUMBER_RIGHT______________________, _______, - _______,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, _______, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, - _________________________________________________________, _________________________________________________________, - ______________________ERGODOX_THUMBS_____________________ + KC_F11 ,__________________FUNCTION_LEFT_____________, _______, _______, __________________FUNCTION_RIGHT____________, KC_F12, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_PAST, _______, + LM_GRAVE, _______, KC_LEFT, KC_DOWN,KC_RIGHT, _______, _______, KC_4, KC_5, KC_6, KC_PPLS, _______, + OS_LSFT,____________________BLANK___________________, _______, _______, _______, KC_1, KC_2, KC_3, KC_PMNS, _______, + ____________________BLANK___________________, KC_0, KC_PDOT, KC_COMM,KC_PEQL, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), - /* Adjust - http://www.keyboard-layout-editor.com/#/gists/dedeae17b35a5d5f745a42aaea78f007 +/* Adjust - http://www.keyboard-layout-editor.com/#/gists/dedeae17b35a5d5f745a42aaea78f007 .---------------------------------------------. .---------------------------------------------. - | | | | | | | EPRM | ! EPRM | | | | | | | + | MAKE | | | | | | RESET | ! EPRM | | | | | | | !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! | | | | | | | | ! | | | | | | | !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | 🔇 | 🔉 | 🔊 | LCK | |-------! !-------! | | | | | SWRKM | + | | 🔇 | 🔉 | 🔊 | LCK | |-------! !-------! | | | | | QWRTY | !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | | | | | | | ! | | | | | | HWRKM | + | | | | | | | | ! | | | | | WIN | WRKMN | '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' | | | | | | .---------------. .---------------. ! | | | | | '------------------------------' | | | ! | | '------------------------------' @@ -115,101 +117,66 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { '-----------------------' '-----------------------' */ [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, KC_EPRM, KC_EPRM, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX,KC__MUTE, KC__VOLDOWN, KC__VOLUP, MC_LOCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SWRK, - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HWRK, - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - ______________________ERGODOX_THUMBS_____________________ - ), - [_NUMS] = LAYOUT_ergodox_pretty_wrapper( - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, - XXXXXXX,XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, KC_PAST, XXXXXXX, - _______,XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, XXXXXXX, - LM_SHFT,XXXXXXX, XXXXXXX, XXXXXXX, JJ_COPY, JJ_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, XXXXXXX, - XXXXXXX,_______,XXXXXXX,XXXXXXX,XXXXXXX, KC_KP_0, KC_PDOT, KC_COMM, KC_PEQL, XXXXXXX, - _______, _______, _______,_______, - _______, _______, - KC_LALT,KC_LGUI,_______, _______,_______,_______ - ), - [_NMOD] = LAYOUT_ergodox_pretty_wrapper( - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, - XXXXXXX,XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, - XXXXXXX,XXXXXXX, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, - LM_SHFT,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, _______, _______, _______, _______, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, - XXXXXXX, XXXXXXX, - KC_LALT,KC_LGUI,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX + KC_MAKE, ____________________BLANK___________________, KC_RST, KC_EPRM, ____________________BLANK___________________, XXXXXXX, + _______, ____________________BLANK___________________, _______, _______, ____________________BLANK___________________, XXXXXXX, + _______,KC__MUTE,KC__VOLDOWN,KC__VOLUP,MC_LOCK,_______, ____________________BLANK___________________, KC_MQWR, + _______, ____________________BLANK___________________, _______, _______, _______, _______, _______, _______, KC_WWRK, KC_MWRK, + ____________________BLANK___________________, ____________________BLANK___________________, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), -// Diablo - http://www.keyboard-layout-editor.com/#/gists/28476e4237e77d4835ac8a9d7e5f9b2c [_DIABLO] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_TAB , KC_Q ,ALT_T(KC_S), KC_I , KC_F , KC_J ,KC_MINS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_LOCK, KC_1 , KC_2 , KC_3 , KC_4 ,KC_DCLR , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_LSFT, KC_D3_1 , KC_D3_2 , KC_D3_3 , KC_D3_4 , KC_T ,KC_MINS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX , XXXXXXX , XXXXXXX , KC_M , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, - XXXXXXX, XXXXXXX, - KC_BTN1,KC_BTN2,KC_ENTER, XXXXXXX,XXXXXXX,XXXXXXX + KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, + KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_ENTER, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_Q, KC_1, KC_2, KC_3, KC_4, KC_P, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, KC_LOCK, KC_NO, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, + _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, + KC_L, KC_J, KC_NO, KC_NO, + KC_F, KC_NO, + SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DCLR, KC_PGDN, KC_DEL, KC_ENT ) }; bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - uint8_t default_layer = 0; - default_layer = eeconfig_read_default_layer(); - switch (keycode) { - case KC_SWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_SWRKMN); - layer_move(default_layer); - ergodox_blink_all_leds(); - ergodox_blink_all_leds(); - } - return false; - break; - case KC_HWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_HWRKMN); - layer_move(default_layer); - ergodox_blink_all_leds(); - ergodox_blink_all_leds(); - } - return false; - break; - case KC_EPRM: - if (!record->event.pressed) { - ergodox_blink_all_leds(); - eeconfig_init(); - } - return false; - break; - case MC_LOCK: - if (!record->event.pressed) { - layer_move(default_layer); - SEND_STRING(SS_LCTRL(SS_LGUI("q"))); - } - return false; - break; - } return true; } void matrix_init_keymap(void) {}; void matrix_scan_keymap(void) { + uint8_t modifiers = get_mods(); + uint8_t led_usb_state = host_keyboard_leds(); + uint8_t one_shot = get_oneshot_mods(); uint8_t layer = biton32(layer_state); + ergodox_board_led_off(); ergodox_right_led_1_off(); ergodox_right_led_2_off(); ergodox_right_led_3_off(); + switch (layer) { - /* - Lights are treated as binary here for easy identification. - LED1 = 4; LED2 = 2; LED1 = 1 - This allows for up to 8 identified layers (default layers being no lights on) - Which is way more than I should ever need - */ + case _WORKMAN: + case _QWERTY: + case _WINWORKMAN: + if (modifiers & MODS_SHIFT_MASK || led_usb_state & (1< LAYER_NUM, Right side -> Shift + LAYER_BASE */ +#define LAYER_RNUM 3 /* Left side -> Shift + LAYER_BASE, Right side -> LAYER_NUM */ + +enum custom_keycodes5 { + PLACEHOLDER = SAFE_RANGE, /* can always be here */ + + M_POINER, /* -> */ + M_LAMBDA, /* => */ + M_IN_CBR, /* {} */ + M_IN_PRN, /* () */ + M_IN_BRC, /* [] */ + M_IN_ANG, /* <> */ + M_NOT_EQL, /* != */ + M_COL_EQL, /* := */ + M_PLUS_EQL,/* += */ + + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * .--------------------------------------------------. .--------------------------------------------------. + * | Grave | ! | @ | # | $ | % | ^ | | TG(1)| & | * | ( | ) | - | Bspc | + * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | F | P | G | = | | _ | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | + * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| + * | LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | |K/RAlt| M | , |./Supe|/ RCtl| RShift | + * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' + * | LCtl |Super | Alt | [ | ] | | Left | Down | Up |Right | Del | + * '----------------------------------' '----------------------------------' + * .-------------. .-------------. + * | Home | End | | Ins |ScrLck| + * .------+------+------| |------+------+------. + * | | |PrnScr| | PgUp | | | + * | LNUM | Enter|------| |------| Space| RNUM | + * | | | Super| | PgDn | | | + * '--------------------' '--------------------' + */ + +[LAYER_BASE] = LAYOUT_ergodox( /* layer 0 : default */ + /* left hand */ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_EQL, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, + KC_LSFT, LCTL_T(KC_Z), LGUI_T(KC_X), KC_C, KC_V, RALT_T(KC_B), KC_LCBR, + KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, KC_RBRC, + + KC_HOME, KC_END, + KC_PSCR, + MO(LAYER_LNUM), KC_ENT, KC_LGUI, + /* right hand */ + TG(1), KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_BSPC, + KC_UNDS, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_RCBR, RALT_T(KC_K), KC_M, KC_COMM, LGUI_T(KC_DOT), RCTL_T(KC_SLSH), KC_RSFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, + KC_INS, KC_SLCK, + KC_PGUP, + KC_PGDN, KC_SPC, MO(LAYER_RNUM) +), +/* Keymap 1: Numbers, Macro Record + * + * .--------------------------------------------------. .--------------------------------------------------. + * | | | | | | <> | | | | | * | ( | ) | - | | + * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | F12 | F11 | F10 | F9 | {} | | | = | => | 7 | 8 | 9 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | F8 | F7 | F6 | F5 | () |------| |------| -> | 4 | 5 | 6 | 0 | | + * |--------+------+------+------+------+------| | | Enter|------+------+------+------+------+--------| + * | | F4 | F3 | F2 | F1 | [] | | | | != | 1 | 2 | 3 | | | + * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' + * | MUTE | VOLD | VOLU | | | | 0 | , | . | | | + * '----------------------------------' '----------------------------------' + * .-------------. .-------------. + * | | | | | Stop | + * .------+------+------| |------+------+------. + * | | |Start1| |Start2| | | + * | | |------| |------| | | + * | | |Play1 | |Play2 | | | + * '--------------------' '--------------------' + */ +[LAYER_NUM] = LAYOUT_ergodox( + /* left hand */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_IN_ANG, KC_TRNS, + KC_TRNS, KC_F12, KC_F11, KC_F10, KC_F9, M_IN_CBR, KC_TRNS, + KC_TRNS, KC_F8, KC_F7, KC_F6, KC_F5, M_IN_PRN, + KC_TRNS, KC_F4, KC_F3, KC_F2, KC_F1, M_IN_BRC, KC_TRNS, + KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + DYN_REC_START1, + KC_TRNS, KC_TRNS, DYN_MACRO_PLAY1, + /* right hand */ + KC_TRNS, KC_TRNS, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_TRNS, + KC_EQL, M_LAMBDA, KC_7, KC_8, KC_9, KC_PLUS, KC_TRNS, + M_POINER, KC_4, KC_5, KC_6, KC_0, KC_TRNS, + KC_ENT, M_NOT_EQL, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, + KC_0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, + KC_TRNS, DYN_REC_STOP, + DYN_REC_START2, + DYN_MACRO_PLAY2, KC_TRNS, KC_TRNS +), +/* Keymap 2: Left side -> LAYER_NUM, Right side -> Shift + LAYER_BASE + * + * .--------------------------------------------------. .--------------------------------------------------. + * | | | | | | <> | | | TG(1)| & | * | ( | ) | - | Bspc | + * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | F12 | F11 | F10 | F9 | {} | | | _ | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | F8 | F7 | F6 | F5 | () |------| |------| H | N | E | I | O | ' | + * |--------+------+------+------+------+------| | | } |------+------+------+------+------+--------| + * | | F4 | F3 | F2 | F1 | [] | | | |K/RAlt| M | , |./Supe|/ RCtl| RShift | + * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' + * | MUTE | VOLD | VOLU | | | | Left | Down | Up |Right | Del | + * '----------------------------------' '----------------------------------' + * .-------------. .-------------. + * | | | | Ins |ScrLck| + * .------+------+------| |------+------+------. + * | | |Start1| | PgUp | | | + * | | |------| |------| Space|CapsLk| + * | | |Play1 | | PgDn | | | + * '--------------------' '--------------------' + */ +[LAYER_LNUM] = LAYOUT_ergodox( + /* left hand */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_IN_ANG, KC_TRNS, + KC_TRNS, KC_F12, KC_F11, KC_F10, KC_F9, M_IN_CBR, KC_TRNS, + KC_TRNS, KC_F8, KC_F7, KC_F6, KC_F5, M_IN_PRN, + KC_TRNS, KC_F4, KC_F3, KC_F2, KC_F1, M_IN_BRC, KC_TRNS, + KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + DYN_REC_START1, + KC_TRNS, KC_TRNS, DYN_MACRO_PLAY1, + /* right hand */ + TG(1), KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, S(KC_MINS), S(KC_BSPC), + KC_UNDS, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), S(KC_SCLN), S(KC_BSLS), + S(KC_H), S(KC_N), S(KC_E), S(KC_I), S(KC_O), S(KC_QUOT), + KC_RCBR, S(KC_K), S(KC_M), S(KC_COMM), S(KC_DOT), S(KC_SLSH), KC_RSFT, + S(KC_LEFT), S(KC_DOWN), S(KC_UP), S(KC_RGHT), S(KC_DEL), + S(KC_INS), S(KC_SLCK), + S(KC_PGUP), + S(KC_PGDN), S(KC_SPC), KC_CAPS +), +/* Keymap 3: Left side -> Shift + LAYER_BASE, Right side -> LAYER_NUM + * + * .--------------------------------------------------. .--------------------------------------------------. + * | Grave | ! | @ | # | $ | % | ^ | | | | * | ( | ) | - | | + * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | F | P | G | = | | = | => | 7 | 8 | 9 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Esc | A | R | S | T | D |------| |------| -> | 4 | 5 | 6 | 0 | | + * |--------+------+------+------+------+------| { | | Enter|------+------+------+------+------+--------| + * | LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | | != | 1 | 2 | 3 | | | + * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' + * | LCtl |Super | Alt | [ | ] | | 0 | , | . | | | + * '----------------------------------' '----------------------------------' + * .-------------. .-------------. + * | Home | End | | | Stop | + * .------+------+------| |------+------+------. + * | | |PrnScr| |Start2| | | + * |CapsLk| Enter|------| |------| | | + * | | | Super| |Play2 | | | + * '--------------------' '--------------------' + */ +[LAYER_RNUM] = LAYOUT_ergodox( + /* left hand */ + S(KC_GRV), KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, + S(KC_TAB), S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_G), S(KC_EQL), + S(KC_ESC), S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_D), + KC_LSFT, S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), KC_LCBR, + S(KC_LCTL), S(KC_LGUI), S(KC_LALT), S(KC_LBRC), S(KC_RBRC), + + S(KC_HOME), S(KC_END), + S(KC_PSCR), + KC_CAPS, S(KC_ENT), S(KC_LGUI), + /* right hand */ + KC_TRNS, KC_TRNS, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_TRNS, + KC_EQL, M_LAMBDA, KC_7, KC_8, KC_9, KC_PLUS, KC_TRNS, + M_POINER, KC_4, KC_5, KC_6, KC_0, KC_TRNS, + KC_ENT, M_NOT_EQL, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, + KC_0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, + KC_TRNS, DYN_REC_STOP, + DYN_REC_START2, + DYN_MACRO_PLAY2, KC_TRNS, KC_TRNS +), +}; + +static bool recording_dynamic_macro; + +static bool process_record_dynamic_macro_wrapper(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + /* detect dynamic macro recording state */ + case DYN_REC_START1: + case DYN_REC_START2: + if (record->event.pressed) { + recording_dynamic_macro = true; + } + break; + case DYN_REC_STOP: + if (record->event.pressed) { + recording_dynamic_macro = false; + } + break; + } + + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + /* the purpose of the ..._wrapper is to detect START/ST0P keys to + light the blue led during recording */ + if (!process_record_dynamic_macro_wrapper(keycode, record)) { + return false; + } + + switch (keycode) { + /* static macro keys */ + case M_IN_CBR: + if (record->event.pressed) { + SEND_STRING("{}" SS_TAP(X_LEFT)); + return false; + } + break; + case M_IN_PRN: + if (record->event.pressed) { + SEND_STRING("()" SS_TAP(X_LEFT)); + return false; + } + break; + case M_IN_BRC: + if (record->event.pressed) { + SEND_STRING("[]" SS_TAP(X_LEFT)); + return false; + } + break; + case M_IN_ANG: + if (record->event.pressed) { + SEND_STRING("<>" SS_TAP(X_LEFT)); + return false; + } + break; + case M_POINER: + if (record->event.pressed) { + SEND_STRING("->"); + return false; + } + break; + case M_LAMBDA: + if (record->event.pressed) { + SEND_STRING("=>"); + return false; + } + break; + case M_NOT_EQL: + if (record->event.pressed) { + SEND_STRING("!="); + return false; + } + break; + case M_COL_EQL: + if (record->event.pressed) { + SEND_STRING(":="); + return false; + } + break; + case M_PLUS_EQL: + if (record->event.pressed) { + SEND_STRING("+="); + return false; + } + break; + } + + return true; +} + +/* Runs just one time when the keyboard initializes. */ +void matrix_init_user(void) { + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + ergodox_right_led_1_set(5); + ergodox_right_led_2_set(5); + ergodox_right_led_3_set(5); +}; + +/* Runs constantly in the background, in a loop. */ +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + //led 1, RED, Caps-Lock ON + //if (host_keyboard_leds() & (1< | | | | | * | ( | ) | - | | +|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| +| | F12 | F11 | F10 | F9 | {} | | | = | => | 7 | 8 | 9 | + | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | F8 | F7 | F6 | F5 | () |------| |------| -> | 4 | 5 | 6 | 0 | | +|--------+------+------+------+------+------| | | Enter|------+------+------+------+------+--------| +| | F4 | F3 | F2 | F1 | [] | | | | != | 1 | 2 | 3 | | | +'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' + | MUTE | VOLD | VOLU | | | | 0 | , | . | | | + '----------------------------------' '----------------------------------' + .-------------. .-------------. + | | | | | Stop | + .------+------+------| |------+------+------. + | | |Start1| |Start2| | | + | | |------| |------| | | + | | |Play1 | |Play2 | | | + '--------------------' '--------------------' +``` + +## Keymap 2: Left side -> LAYER_NUM, Right side -> Shift + LAYER_BASE + + +``` +.--------------------------------------------------. .--------------------------------------------------. +| | | | | | <> | | | TG(1)| & | * | ( | ) | - | Bspc | +|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| +| | F12 | F11 | F10 | F9 | {} | | | _ | J | L | U | Y | ; | \ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | F8 | F7 | F6 | F5 | () |------| |------| H | N | E | I | O | ' | +|--------+------+------+------+------+------| | | } |------+------+------+------+------+--------| +| | F4 | F3 | F2 | F1 | [] | | | |K/RAlt| M | , |./Supe|/ RCtl| RShift | +'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' + | MUTE | VOLD | VOLU | | | | Left | Down | Up |Right | Del | + '----------------------------------' '----------------------------------' + .-------------. .-------------. + | | | | Ins |ScrLck| + .------+------+------| |------+------+------. + | | |Start1| | PgUp | | | + | | |------| |------| Space|CapsLk| + | | |Play1 | | PgDn | | | + '--------------------' '--------------------' +``` + +## Keymap 3: Left side -> Shift + LAYER_BASE, Right side -> LAYER_NUM + + +``` +.--------------------------------------------------. .--------------------------------------------------. +| Grave | ! | @ | # | $ | % | ^ | | | | * | ( | ) | - | | +|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| +| Tab | Q | W | F | P | G | = | | = | => | 7 | 8 | 9 | + | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| Esc | A | R | S | T | D |------| |------| -> | 4 | 5 | 6 | 0 | | +|--------+------+------+------+------+------| { | | Enter|------+------+------+------+------+--------| +| LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | | != | 1 | 2 | 3 | | | +'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' + | LCtl |Super | Alt | [ | ] | | 0 | , | . | | | + '----------------------------------' '----------------------------------' + .-------------. .-------------. + | Home | End | | | Stop | + .------+------+------| |------+------+------. + | | |PrnScr| |Start2| | | + |CapsLk| Enter|------| |------| | | + | | | Super| |Play2 | | | + '--------------------' '--------------------' +``` diff --git a/layouts/community/ergodox/colemak_code_friendly/rules.mk b/layouts/community/ergodox/colemak_code_friendly/rules.mk new file mode 100644 index 00000000000..2bff0c5cf29 --- /dev/null +++ b/layouts/community/ergodox/colemak_code_friendly/rules.mk @@ -0,0 +1,7 @@ +COMMAND_ENABLE = no +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +CONSOLE_ENABLE = no +RGBLIGHT_ENABLE = no +LEADER_ENABLE = no +MIDI_ENABLE = no diff --git a/layouts/community/ergodox/common_nighthawk/keymap.c b/layouts/community/ergodox/common_nighthawk/keymap.c index e113e85d1fa..cb13822e4e9 100644 --- a/layouts/community/ergodox/common_nighthawk/keymap.c +++ b/layouts/community/ergodox/common_nighthawk/keymap.c @@ -149,10 +149,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/csharp_dev/keymap.c b/layouts/community/ergodox/csharp_dev/keymap.c index 7996c92e083..221389ef242 100644 --- a/layouts/community/ergodox/csharp_dev/keymap.c +++ b/layouts/community/ergodox/csharp_dev/keymap.c @@ -118,10 +118,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(FKEYS) // FN1 - Momentary Layer 1 -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/dave/keymap.c b/layouts/community/ergodox/dave/keymap.c index f50be71fabb..4287496479b 100644 --- a/layouts/community/ergodox/dave/keymap.c +++ b/layouts/community/ergodox/dave/keymap.c @@ -137,11 +137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - //[1] = ACTION_LAYER_TAP_TOGGLE(PROG), // FN1 - Momentary Layer 1 (Symbols) - //[2] = ACTION_LAYER_TAP_TOGGLE(NAVI) // FN2 - Momentary Layer 2 (Navigation) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/dragon788/keymap.c b/layouts/community/ergodox/dragon788/keymap.c index ea3fe3ee5e0..c0c2134774e 100644 --- a/layouts/community/ergodox/dragon788/keymap.c +++ b/layouts/community/ergodox/dragon788/keymap.c @@ -37,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_FN1, KC_GRV, KC_QUOT,KC_LEFT, LT(MDIA, KC_RGHT), + TT(SYMB), KC_GRV, KC_QUOT,KC_LEFT, LT(MDIA, KC_RGHT), KC_APP, KC_HOME, KC_END, KC_BSPC,KC_DELT,KC_LALT, @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(2), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - LT(MDIA, KC_UP), KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + LT(MDIA, KC_UP), KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_PGUP, CTL_T(KC_ESC), KC_PGDN, CTL_T(KC_TAB),KC_ENT, KC_SPC @@ -180,10 +180,6 @@ LAYOUT_ergodox( }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index fee954d1794..821710ed8e8 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -1,14 +1,11 @@ #pragma once -#include QMK_KEYBOARD_CONFIG_H - #ifdef RGBLIGHT_ENABLE -#undef RGBLIGHT_SAT_STEP -#define RGBLIGHT_SAT_STEP 12 +# undef RGBLIGHT_SAT_STEP +# define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 #endif // RGBLIGHT_ENABLE @@ -16,4 +13,4 @@ #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine #undef DEBOUNCE -#define DEBOUNCE 5 +#define DEBOUNCE 15 diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 518eaf0348b..763b218f747 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -18,18 +18,20 @@ along with this program. If not, see . #include "drashna.h" #ifdef UNICODEMAP_ENABLE -#include "drashna_unicode.h" -#endif // UNICODEMAP_ENABLE +# include "drashna_unicode.h" +#endif // UNICODEMAP_ENABLE +#ifndef UNICODE_ENABLE +# define UC(x) KC_NO +#endif +extern userspace_config_t userspace_config; +enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; -//enum more_custom_keycodes { -// KC_P00 = NEW_SAFE_RANGE -//}; - -//define layer change stuff for underglow indicator +// define layer change stuff for underglow indicator bool skip_leds = false; +// clang-format off #define LAYOUT_ergodox_pretty_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ @@ -39,11 +41,11 @@ bool skip_leds = false; KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ - KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_IRNY, \ - OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ - KC_HOME, KC_PGUP, \ - LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ + KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ + OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ + KC_APP, KC_MENU, \ + KC_SPC, LT(_LOWER, KC_BSPC), OS_LWR, OS_RSE, LT(_RAISE, KC_DEL), KC_ENT \ ) #define LAYOUT_ergodox_pretty_base_wrapper(...) LAYOUT_ergodox_pretty_base(__VA_ARGS__) @@ -162,6 +164,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ ), + [_NORMAN] = LAYOUT_ergodox_pretty_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_ergodox_pretty_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_ergodox_pretty_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_ergodox_pretty_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + + // Reverts OSM(Shift) to normal Shifts. However, may not need since we fixed the issue with RDP (LOCAL RESOURCES) [_MODS] = LAYOUT_ergodox_pretty_wrapper( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -198,13 +225,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper( KC_ESC, KC_NO, KC_1, KC_2, KC_3, HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, - KC_O, KC_P, KC_HYPR, MAGIC_TOGGLE_NKRO, - KC_LGUI, KC_NO, - KC_V, KC_SPC, KC_H, KC_PGDN, KC_DEL, KC_ENTER + KC_O, KC_P, MAGIC_TOGGLE_NKRO, LALT(KC_PSCR), + KC_LGUI, KC_HYPR, + KC_V, KC_SPC, KC_H, KC_NO, KC_NO, KC_SWAP_NUM ), /* Keymap 3: @@ -241,8 +268,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT_ergodox_pretty_wrapper( KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_TILD, _________________LOWER_L1__________________, _______, _______, _________________LOWER_R1__________________, _______, - _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_PIPE, + KC_TILD, _________________LOWER_L1__________________, _______, _______, _________________LOWER_R1__________________, KC_PIPE, + _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_DQUO, _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, @@ -252,8 +279,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT_ergodox_pretty_wrapper( KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_GRV, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, _______, - _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + KC_GRV, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, KC_BSLS, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_QUOT, _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, KC_PSCR, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_SLCK, _______, _______, _______, _______, @@ -263,7 +290,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, - VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EPRM, + VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EEP_RST, _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG(_MODS), _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -273,65 +300,167 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; +// clang-format on bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - - //switch (keycode) { - // case KC_P00: - // if (!record->event.pressed) { - // register_code(KC_KP_0); - // unregister_code(KC_KP_0); - // register_code(KC_KP_0); - // unregister_code(KC_KP_0); - // } - // return false; - // break; - //} - return true; + switch (keycode) { + case KC_1: + if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { + if (record->event.pressed) { + register_code(KC_2); + } else { + unregister_code(KC_2); + } + return false; + } + break; + case KC_2: + if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { + if (record->event.pressed) { + register_code(KC_1); + } else { + unregister_code(KC_1); + } + return false; + } + break; + case KC_SWAP_NUM: + if (record->event.pressed) { + userspace_config.swapped_numbers ^= 1; + eeconfig_update_user(userspace_config.raw); + } + break; + } + // switch (keycode) { + // case KC_P00: + // if (!record->event.pressed) { + // register_code(KC_KP_0); + // unregister_code(KC_KP_0); + // register_code(KC_KP_0); + // unregister_code(KC_KP_0); + // } + // return false; + // break; + //} + return true; } -void matrix_init_keymap(void) { // Runs boot tasks for keyboard -}; +void matrix_scan_keymap(void) { // runs frequently to update info + uint8_t modifiers = get_mods(); + uint8_t led_usb_state = host_keyboard_leds(); + uint8_t one_shot = get_oneshot_mods(); + if (!skip_leds) { + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); -void matrix_scan_keymap(void) { // runs frequently to update info - uint8_t modifiers = get_mods(); - uint8_t led_usb_state = host_keyboard_leds(); - uint8_t one_shot = get_oneshot_mods(); - - if (!skip_leds) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - // Since we're not using the LEDs here for layer indication anymore, - // then lets use them for modifier indicators. Shame we don't have 4... - // Also, no "else", since we want to know each, independently. - if (modifiers & MODS_SHIFT_MASK || led_usb_state & (1< | 4 | 5 | 6 | + | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | UND | CUT | COP | PAS | | | | ? | 1 | 2 | 3 | % | | + * | | ~ | UND | CUT | COP | PAS | | | | ? | 1 | 2 | 3 | % | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | . | 0 | = | | | * `----------------------------------' `----------------------------------' @@ -103,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_TRNS, NO_AT, ALGR(KC_7), ALGR(KC_0), NO_LBRC, NO_RBRC, KC_TRNS, KC_TRNS, KC_HASH, NO_LPRN, NO_RPRN, ALGR(KC_MINS), NO_SLSH, - KC_TRNS, KC_TRNS, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_TRNS, + KC_TRNS, NO_TILD, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, @@ -165,11 +166,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Save |Build |Debug | | | | | | bool | int |string| dec | Todo | | + * | | Save |Build |Debug |PrtScr| $ | | | | bool | int |string| dec | Todo | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| priv | publ |shared| prot | | | + * | | ´ | ' | | | | £ |------| |------| priv | publ |shared| prot | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | const| dim |return|nothin| | | + * | | | | | | £ | | | | const| dim |return|nothin| | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' @@ -184,9 +185,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // MEDIA AND MOUSE [DEVL] = LAYOUT_ergodox( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(MACRO_SAVE), M(MACRO_BUILD), M(MACRO_DEBUG), KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(MACRO_SAVE), M(MACRO_BUILD), M(MACRO_DEBUG), KC_PSCR, ALGR(KC_4), KC_TRNS, + KC_TRNS, NO_ACUT, NO_APOS, NO_PIPE, KC_TRNS, ALGR(KC_3), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ALGR(KC_5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -203,10 +204,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/dvorak_programmer_swe/readme.md b/layouts/community/ergodox/dvorak_programmer_swe/readme.md index 552fa0e3ab7..3bedf50d74b 100644 --- a/layouts/community/ergodox/dvorak_programmer_swe/readme.md +++ b/layouts/community/ergodox/dvorak_programmer_swe/readme.md @@ -13,14 +13,43 @@ TODO: Known issues: * Keymap 2 modifier has not gotten its place yet.. -* Print screen, where? ## Changelog +* 2019-03-11 + * Added currency $, £, € to keymap 3 + * Added pipe character to keymap 3 + * Added the acute accent character to keymap 3 + +* 2019-03-08 + * Switched position on Alt and Alt-shift + * Added tilde character to symbol layer + * Added Print Screen to keymap 3 + * Added ' (NO_APOS) to keymap 3 + * Added how to install help in this readme * 2017-05-16 * Initial release + +# How to install - reminder +0. Docs: https://docs.qmk.fm/#/newbs +1. Download flashing tool - teensy (from ergodox-ez visual designer) +2. Setup build environment: https://docs.qmk.fm/#/newbs_getting_started + +QUICK HOWTO WSL: (this is not supported anymore it seems, why?) +The Toolchain setup is done through the Windows Subsystem for Linux, and the process is fully automated. If you want to do everything manually, there are no other instructions than the scripts themselves, but you can always open issues and ask for more information. +Open "Bash On Ubuntu On Windows" from the start menu. +Go to the directory where you cloned qmk_firmware. Note that the paths start with /mnt/ in the WSL, so you have to write for example cd /mnt/c/path/to/qmk_firmware. +Run util/wsl_install.sh and follow the on-screen instructions. +Close the Bash command window, and re-open it. +You are ready to compile and flash the firmware! + +3. Build the firmware with: +Run the following in the root qmk folder: +make KEYBOARD=ergodox_ez KEYMAP=dvorak_programmer_swe + + # Author Christian Westerlund cwesterlund @ github diff --git a/layouts/community/ergodox/dvorak_spanish/keymap.c b/layouts/community/ergodox/dvorak_spanish/keymap.c index 19dfb27f57f..98aa638a0f6 100644 --- a/layouts/community/ergodox/dvorak_spanish/keymap.c +++ b/layouts/community/ergodox/dvorak_spanish/keymap.c @@ -72,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ENT,KC_TAB,MT((MOD_LALT | MOD_LSFT), KC_F3), // right hand KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - KC_FN1, KC_F, KC_G, KC_C, KC_H, KC_L, ALL_T(KC_RBRACKET), + TT(AUX), KC_F, KC_G, KC_C, KC_H, KC_L, ALL_T(KC_RBRACKET), KC_D, KC_R, KC_T, KC_N, KC_S, CTL_T(KC_QUOTE), KC_RALT, KC_B, KC_M, KC_W, KC_V, KC_Z, M(CBRACE), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), @@ -168,10 +168,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(AUX) // FN1 - Momentary Layer 1 (Aux) -}; - static uint16_t key_timer; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) diff --git a/layouts/community/ergodox/dvorak_spanish/readme.md b/layouts/community/ergodox/dvorak_spanish/readme.md index e075e3cd7d6..1256c6887d9 100644 --- a/layouts/community/ergodox/dvorak_spanish/readme.md +++ b/layouts/community/ergodox/dvorak_spanish/readme.md @@ -1,5 +1,4 @@ # Ergodox Spanish Dvorak Layout - * See spanish dvorak layout [here](http://djelibeibi.unex.es/dvorak/) * Software layout must be set to SPANISH QWERTY to work properly ## Keymap Layers diff --git a/layouts/community/ergodox/dvorak_svorak_a5/keymap.c b/layouts/community/ergodox/dvorak_svorak_a5/keymap.c index 2668fce8662..b0eff652b87 100644 --- a/layouts/community/ergodox/dvorak_svorak_a5/keymap.c +++ b/layouts/community/ergodox/dvorak_svorak_a5/keymap.c @@ -171,18 +171,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, KC_H, KC_J, KC_K, KC_L, NO_OSLH, NO_AE, KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSFT, - NO_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, + KC_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_ENT, KC_SPACE ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/layouts/community/ergodox/emacs_osx_dk/keymap.c b/layouts/community/ergodox/emacs_osx_dk/keymap.c index 3fa14a5644a..8f4c010afe3 100644 --- a/layouts/community/ergodox/emacs_osx_dk/keymap.c +++ b/layouts/community/ergodox/emacs_osx_dk/keymap.c @@ -135,10 +135,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/erez_experimental/config.h b/layouts/community/ergodox/erez_experimental/config.h deleted file mode 100644 index 4b9c29c94e9..00000000000 --- a/layouts/community/ergodox/erez_experimental/config.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H - -#define ONESHOT_TAP_TOGGLE 2 -#define ONESHOT_TIMEOUT 300 - -#undef LEADER_TIMEOUT -#define LEADER_TIMEOUT 300 - - -#endif diff --git a/layouts/community/ergodox/erez_experimental/keymap.c b/layouts/community/ergodox/erez_experimental/keymap.c deleted file mode 100644 index 481f984d5d1..00000000000 --- a/layouts/community/ergodox/erez_experimental/keymap.c +++ /dev/null @@ -1,223 +0,0 @@ -#include -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - RGB_FF00BB // always start with RGB_ -}; - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 |Ctrl- | | Ctrl+| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | Alt/J| K | L |; / L2| LGui/' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * |LShift/(|Z/Ctrl| X | C | V | B | [ | | ] | N | M | , | . |//Ctrl|RShift/)| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | -/L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Leader|------| |------| Tab/L1 |Enter | - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, LCTL(KC_MINS), - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_LBRC), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_LEAD,KC_END, - // right hand - LCTL(KC_EQL), KC_6,KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y,KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H,ALT_T(KC_J),KC_K, KC_L, LT(MDIA,KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_RBRC),KC_N,KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSPC, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_MINS), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,LT(SYMB, KC_TAB), KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 1 | 2 | 3 | 4 | 5 |------| |------| & | _ | - | ; | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 6 | 7 | 8 | 9 | 0 | | | | | | @ | = | % | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | |NxtTab|PrvTab| | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | |TOG | - * ,------|------|------| |------+------+------. - * |VAI |VAD |HUI | |SAI | |MOD | - * | | |------| |------| | | - * | | |HUD | |SAD | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - RGB_FF00BB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS,LCTL(KC_PGUP), LCTL(KC_PGDN), - KC_TRNS,KC_TRNS, - RGB_HUI, - RGB_VAI,RGB_VAD,RGB_HUD, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, - KC_AMPR, KC_UNDS, KC_MINS, CM_SCLN, KC_PLUS, KC_TRNS, - KC_TRNS, KC_PIPE, KC_AT, KC_EQL, KC_PERC, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, KC_TRNS, - RGB_SAI, - RGB_SAD, KC_TRNS, RGB_MOD -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | PgUp | Home | End | PgDn | |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_PGUP, KC_HOME, KC_END, KC_PGDN, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) - [2] = ACTION_MACRO_TAP(0), // Eric Tang's Famous Macro! - [3] = ACTION_MACRO_TAP(1) // Eric Tang's Famous Macro! -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // dynamically generate these. - case RGB_FF00BB: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_mode(1); - rgblight_setrgb(0xff,0x00,0xbb); - #endif - } - return false; - break; - } - return true; -} - -LEADER_EXTERNS(); - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_W) { - register_code(KC_LALT); - register_code(KC_F4); - unregister_code(KC_F4); - unregister_code(KC_LALT); - } - SEQ_ONE_KEY(KC_O) { - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_O); - unregister_code(KC_O); - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); - } - } -} - diff --git a/layouts/community/ergodox/erez_experimental/readme.md b/layouts/community/ergodox/erez_experimental/readme.md deleted file mode 100644 index f0738d9a70f..00000000000 --- a/layouts/community/ergodox/erez_experimental/readme.md +++ /dev/null @@ -1,55 +0,0 @@ -# Erez's experimental layout - -This is my personal layout which I use to test out ideas which may or may not make it onto the default layout we ship with. It's based off the default layout, with various tweaks. - -Changelog: - -## Nov 1, 2016: - -* Adds dedicated text zooming keys in inner corners - -## May 24, 2016: - -* Implements Leader key example - * Leader, W sends Alt-F4 - * Leader, O sends Ctrl-shift-o (a shortcut I use in FrontApp) - -## May 8, 2016: - -* Makes bottom-right key send minus/underscore when tapped, L1 temporary toggle when held -* Tweaked the positions of the numbers on the symbol layer. Basically, 12345 are now directly under their number-row counterparts in layer 0. You can imagine pulling the number row down to the home row. And 67890 are directly under 12345 - so it's a matter of just adding 5 and going to the next row (1+5 = 6, 2+5 = 7 and so on). -* Tweaks media/nav layer - * Removes mouse control, as I don't use it - * Makes left home row keys PgUp, Home, End, PgDn - -## Apr 29, 2016: - -* Tweaks the Hyper and Meh key to send brackets when tapped -* Turns bottom-right key into a minus/underscore (easy to reach with the right pinky) - -## Apr 25, 2016: - -* Made it so that the right and left Shift keys send opening and closing parens ( ) when tapped - -## Feb 11, 2016: - -* Updated ASCII legend for thumb clusters -* Made it so outer left-hand thumb key is L1 momentary toggle -* Added % and @ to L1 -* Swapped positions for _ and - on L1 - -## Feb 5, 2016: - -* A whole new design for the symbol layer. Specifically: - * Put the minus, underscore, and semicolon right in the homerow for the right hand - * Parens are in better places for me - * The arrow keys now send Ctrl-PgUp and Ctrl-PgDn, for switching browser tabs with the arrows when in symbol layer - * Tab (right-hand outer thumb key) now does double duty to toggle symbol layer when held down - * Backspace (left-hand outer thumb key) now just toggles symbol layer (I wasn't using it as a backspace) - - -## Jan 19, 2016: - -* Made J into dual-action key (Alt when held down), to make Alt-tab more ergonomic. -* Made ' into dual-action key (Win/Cmd when held down). - diff --git a/layouts/community/ergodox/erez_experimental/rules.mk b/layouts/community/ergodox/erez_experimental/rules.mk deleted file mode 100644 index f68b56f872d..00000000000 --- a/layouts/community/ergodox/erez_experimental/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -# Having a file like this allows you to override Makefile definitions -# for your own particular keymap - -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = no # Commands for debug and configuration -LEADER_ENABLE = yes diff --git a/layouts/community/ergodox/familiar/README.md b/layouts/community/ergodox/familiar/README.md deleted file mode 100644 index 8d68af21a30..00000000000 --- a/layouts/community/ergodox/familiar/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# ErgoDox Familiar Layout -Familiar layout for those who regularly switch back and forth from ErgoDox to "normal" QWERTY. - -[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](../../../../license_GPLv3.md) [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme) - -## Table of Contents - -- [Background](#background) -- [Install](#install) -- [Usage](#usage) - - [Layers](#layers) -- [Contribute](#contribute) - - [Issues](#issues) -- [License](#license) - -## Background - -This layout is built to be as familiar as possible for users coming directly from a default (QWERTY US) keyboard, while gaining as much advantage as possible from the ErgoDox and QMK featureset. I use an ErgoDoxEZ at home, but I don't have a regular office (CS grad student) so I regularly use either my laptop or a default-setup lab computer; I context switch daily so this layout is meant to reduce the mental overhead as much as possible. - -The default ErgoDoxEZ layout is probably more optimized as a solo daily driver - as are a lot of the others available keymaps. The focus of this layout is to get as much from the 'Dox as possible without overly disrupting long-established muscle memory. - -Key features of the familiar layout: -1. QWERTY default layout. -1. International symbols layer, mapped in the US-International layout default positions, through [UCIS](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable). -1. Numpad layer on right hand. -1. Thumb cluster holds spacebar and access to secondary layers. -1. Function-layer arrow keys in both the first-person-shooter (actually ESDF instead of WASD) and vim (HJKL) locations. - -## Install - -If you are on Windows or Mac, choose the proper line in [`keymap.c`](keymap.c) for [unicode/international character support](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable) (starts at line 253). -```c -void matrix_init_user(void) { - set_unicode_input_mode(UC_LNX); // Linux - //set_unicode_input_mode(UC_OSX); // Mac OSX - //set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki) - //set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki) -}; -``` - -For instructions on building and installing this keymap, [go to the wiki](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ergodox#build-dependencies). Below is the command for me; it may be different for you. -```sh -$ make ergodox-ez-familiar-teensy -``` - -## Usage - -[![Familiar Layout](http://i.imgur.com/6nLN9UT.png)](https://gist.github.com/nstickney/13508a9f99cff381d58b7be6f7dcc644) - -### Layers -1. Base Layer: QWERTY, with arrow keys at bottom right. -1. UCIS Layer: US-International symbols layer, plus —. Accessed by toggling the `SYMB` layer using the UCIS key (bottom of left thumb cluster). -1. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed by holding shift while the `SYMB` layer is active (toggles the `CSYM` layer). -1. Numpad Layer: Right hand number pad. Accessed by toggling the `NUMP` layer using the NUMP key (bottom of right thumb cluster). -1. Function Layer: F1-F12, arrows on ESDF and HJKL, media player controls. Accessed by holding either FN key (center key of each thumb cluster), which toggles the `ARRW` layer. I know, I need to work on my naming conventions. - -## Contribute - -[Contributor Covenant](http://contributor-covenant.org/) - -I'm terrible at this; I have no background in human-computer interaction, kinesiology, or keyboard-ology. Please send comments/issues/pull requests/angry tweets/etc. If you think there is a better way to take advantage of the ErgoDox/QMK comination without straying far from 84/101-key QWERTY, I want to know it. - -### Issues -1. The `CSYM` layer is an ugly workaround. I should write a function for doing different things in the `SYMB` layer depending on whether SHIFT is being held. Or something. Ideas? -1. Right now, the thumb cluster function keys double as slash and whack... this really isnt a great solution. -1. `MENU` and `LEAD` are useless, at the moment. - -## License -QMK is licensed ([mostly](https://github.com/qmk/qmk_firmware/issues/1038)) under the [GPLv2](../../../../license_GPLv2.md). Accordingly, to whatever extent applicable, this keymap is licensed under the [GPLv3](../../../../license_GPLv3.md). diff --git a/layouts/community/ergodox/familiar/keymap.c b/layouts/community/ergodox/familiar/keymap.c deleted file mode 100644 index bc513c0cc43..00000000000 --- a/layouts/community/ergodox/familiar/keymap.c +++ /dev/null @@ -1,285 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -// Layers -#define BASE 0 // default layer -#define SYMB 1 // international symbols -#define CSYM 2 // international symbols shifted -#define NUMP 3 // numpad -#define ARRW 4 // function, media, arrow keys - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// Tap Dancing -void dance_lock (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { // Press once for NUMLOCK - register_code (KC_NLCK); - unregister_code (KC_NLCK); - } else if (state->count == 2) { // Press twice for CAPSLOCK - register_code (KC_CAPS); - unregister_code (KC_CAPS); - } else if (state->count == 3) { //Press thrice for SCROLLLOCK - register_code (KC_SLCK); - unregister_code (KC_SLCK); - } -} -enum {LOCKS = 0}; -qk_tap_dance_action_t tap_dance_actions[] = { - [LOCKS] = ACTION_TAP_DANCE_FN(dance_lock) -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -/* layer 0 : default - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BCKSPC | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | HOME | | PGUP | Y | U | I | O | P | DELETE | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ' | A | S | D | F | G |------| |------| H | J | K | L | ; | ENTER | - * |--------+------+------+------+------+------| END | | PGDN |------+------+------+------+------+--------| - * | (/LSFT | Z | X | C | V | B | | | | N | M | , | . | UP | )/RSFT | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCTRL | LGUI | MENU | LEAD | LALT | |[/RALT|]/RCTL| LEFT | DOWN | RIGHT | - * `------------------------------------' `------------------------------------' - * ,-------------. ,-------------. - * |PRTSCR| ESC | | VOL- | VOL+ | - * ,------|------|------| |------+------+------. - * | |SLASH/| LOCKS| | MUTE |WHACK/| | - * | SPC | MO(4)|------| |------|MO(4) | SPC | - * | | | TO(1)| |TO(3) | | | - * `--------------------' `--------------------' - */ -[BASE] = LAYOUT_ergodox( - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME, - KC_QUOT, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, - KC_LCTL, KC_LGUI, KC_MENU, KC_LEAD, KC_LALT, - KC_PSCR, KC_ESC, - TD(LOCKS), - KC_SPC, LT(ARRW, KC_SLSH), TG(SYMB), - // right hand - KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, - KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSPC, - MT(MOD_RALT, KC_LBRC), MT(MOD_RCTL, KC_RBRC), KC_LEFT, KC_DOWN, KC_RGHT, - KC_VOLD, KC_VOLU, - KC_MUTE, - TG(NUMP), LT(ARRW, KC_BSLS), KC_SPC - ), - -/* layer 1: International symbols, etc - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | ¡ | ² | ³ | ¤ | € | ¼ | | ½ | ¾ | ‘ | ’ | ¥ | × | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ä | å | é | ® | þ | | | | ü | ú | í | ó | ö | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ´ | á | ß | ð | | |------| |------| | | | ø | ¶ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |MO(CSYM)| æ | ¿ | © | ¬ | | | | | ñ | µ | ç | | |MO(CSYM)| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | « | » | | | | - * `------------------------------------' `------------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[SYMB] = LAYOUT_ergodox( - // left hand - _______, UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC), - _______, UC(0x00E4), UC(0x00E5), UC(0x00E9), UC(0x00AE), UC(0x00FE), _______, - UC(0x00B4), UC(0x00E1), UC(0x00DF), UC(0x00F0), _______, _______, - MO(CSYM), UC(0x00E6), UC(0x00BF), _______, UC(0x00AC), UC(0x00A9), _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______, - // right hand - UC(0x00BD), UC(0x00BE), UC(0x2018), UC(0x2019), UC(0x00A5), UC(0x00D7), _______, - _______, UC(0x00FC), UC(0x00FA), UC(0x00ED), UC(0x00F3), UC(0x00F6), _______, - _______, _______, _______, UC(0x00F8), UC(0x00B6), _______, - _______, UC(0x00F1), UC(0x00B5), UC(0x00E7), _______, _______, MO(CSYM), - UC(0x00AB), UC(0x00BB), _______, _______, _______, - _______, _______, - _______, - _______, _______, _______ - ), - -/* layer 2 : international symbols, shifted - * This layer is an ugly workaround; it pretends that SHIFT still works normally on keys - * which don't produce an "upper case" or "shifted" international symobol. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | ¹ | | | £ | | | | | | | | — | ÷ | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Ä | Å | É | | Þ | | | | Ü | Ú | Í | Ó | Ö | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ¨ | Á | § | Ð | | |------| |------| | | | Ø | ° | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Æ | | ¢ | ¦ | | | | | Ñ | | Ç | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | “ | ” | | | | - * `------------------------------------' `------------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[CSYM] = LAYOUT_ergodox( - // left hand - _______, UC(0x00B9), _______, _______, UC(0x00A3), _______, _______, - _______, UC(0x00C4), UC(0x00C5), UC(0x00C9), S(KC_R), UC(0x00DE), _______, - UC(0x00A8), UC(0x00C1), UC(0x00A7), UC(0x00D0), S(KC_F), S(KC_G), - _______, UC(0x00C6), UC(0x00A6), UC(0x00A2), S(KC_V), S(KC_B), _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______, - // right hand - _______, _______, _______, _______, UC(0x2014), UC(0x00F7), _______, - _______, UC(0x00DC), UC(0x00DA), UC(0x00CD), UC(0x00D3), UC(0x00D6), _______, - S(KC_H), S(KC_J), S(KC_K), UC(0x00D8), UC(0x00B0), _______, - _______, UC(0x00D1), _______, UC(0x00C7), S(KC_DOT), _______, _______, - UC(0x201C), UC(0x201D), _______, _______, _______, - _______, _______, - _______, - _______, _______, _______ - ), - -/* layer 3: numberpad - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | ( | ) | / | * | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | 7 | 8 | 9 | - | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | 1 | 2 | 3 | = | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |0/RALT|./RCTL| , | ENTER| | - * `------------------------------------' `------------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[NUMP] = LAYOUT_ergodox( - // left hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______, - // right hand - _______, _______, S(KC_9), S(KC_0), KC_PSLS, KC_PAST, _______, - _______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______, - _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, - _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PEQL, _______, - MT(MOD_RALT, KC_KP_0), MT(MOD_RCTL, KC_KP_DOT),KC_PCMM, KC_PENT, _______, - _______, _______, - _______, - _______, _______, _______ - ), - -/* layer 4 : functions and arrows - * This layer is at the top so that the functions still work no matter what layers are active. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESCAPE | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | UP | | | | | | | | | | | INSERT | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | LEFT | DOWN |RIGHT | |------| |------| LEFT | DOWN | UP | RIGHT| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |M_PREV|M_STOP|M_PLPS|M_NEXT| | | | | | | | | PGUP | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | HOME | PGDN | END | - * `------------------------------------' `------------------------------------' - * ,-------------. ,-------------. - * | SYSRQ| PAUSE| | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[ARRW] = LAYOUT_ergodox( - // left hand - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - _______, _______, _______, KC_UP, _______, _______, _______, - _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, - _______, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, _______, _______, - _______, _______, _______, _______, _______, - KC_SYSREQ, KC_PAUSE, - _______, - _______, _______, _______, - // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, - _______, _______, _______, _______, _______, _______, KC_INS, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, - _______, _______, _______, _______, _______, KC_PGUP, _______, - _______, _______, KC_HOME, KC_PGDN, KC_END, - _______, _______, - _______, - _______, _______, _______ - ), -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - set_unicode_input_mode(UC_LNX); // Linux - //set_unicode_input_mode(UC_OSX); // Mac OSX - //set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki) - //set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki) -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - case CSYM: - ergodox_right_led_1_on(); - break; - case NUMP: - ergodox_right_led_2_on(); - break; - case ARRW: - ergodox_right_led_3_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/familiar/rules.mk b/layouts/community/ergodox/familiar/rules.mk deleted file mode 100644 index 4a3c58621c7..00000000000 --- a/layouts/community/ergodox/familiar/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -TAP_DANCE_ENABLE=yes -LEADER_ENABLE = yes diff --git a/layouts/community/ergodox/french_hacker/keymap.c b/layouts/community/ergodox/french_hacker/keymap.c index 30bf56608d5..731d917fd92 100644 --- a/layouts/community/ergodox/french_hacker/keymap.c +++ b/layouts/community/ergodox/french_hacker/keymap.c @@ -199,10 +199,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/galson/keymap.c b/layouts/community/ergodox/galson/keymap.c index e3450055180..2b7994b11d9 100644 --- a/layouts/community/ergodox/galson/keymap.c +++ b/layouts/community/ergodox/galson/keymap.c @@ -136,10 +136,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/german-kinergo/keymap.c b/layouts/community/ergodox/german-kinergo/keymap.c index d8da953e0e9..7e1e5bf82b7 100644 --- a/layouts/community/ergodox/german-kinergo/keymap.c +++ b/layouts/community/ergodox/german-kinergo/keymap.c @@ -72,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // TG(2), DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, // KC_H, KC_J, KC_K, KC_L, DE_OE, LT(MDIA,DE_AE), // MEH_T(KC_NO),KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(DE_MINS), KC_RSFT, -// KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_FN1, +// KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TT(SYMB), // KC_LALT,CTL_T(KC_ESC), // KC_PGUP, // KC_PGDN,KC_TAB, KC_ENT @@ -162,10 +162,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/german-lukas/keymap.c b/layouts/community/ergodox/german-lukas/keymap.c index 2ad909b6c83..e0cdf25c6e7 100644 --- a/layouts/community/ergodox/german-lukas/keymap.c +++ b/layouts/community/ergodox/german-lukas/keymap.c @@ -185,10 +185,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/german-manuneo/compile_keymap.py b/layouts/community/ergodox/german-manuneo/compile_keymap.py index 44f31b1c6e6..9ad5c88ecca 100644 --- a/layouts/community/ergodox/german-manuneo/compile_keymap.py +++ b/layouts/community/ergodox/german-manuneo/compile_keymap.py @@ -668,9 +668,6 @@ def iter_keymap_parts(config, keymaps): yield "};\n\n" - # no idea what this is for - yield "const uint16_t PROGMEM fn_actions[] = {};\n" - # macros yield MACROCODE.format( macro_cases="", diff --git a/layouts/community/ergodox/german-manuneo/keymap.c b/layouts/community/ergodox/german-manuneo/keymap.c index 71988b7dda5..9198bf6e30f 100644 --- a/layouts/community/ergodox/german-manuneo/keymap.c +++ b/layouts/community/ergodox/german-manuneo/keymap.c @@ -376,8 +376,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = {}; - #define UC_MODE_WIN 0 #define UC_MODE_LINUX 1 #define UC_MODE_OSX 2 diff --git a/layouts/community/ergodox/german/keymap.c b/layouts/community/ergodox/german/keymap.c index 67d01fd337a..a379b24ca38 100644 --- a/layouts/community/ergodox/german/keymap.c +++ b/layouts/community/ergodox/german/keymap.c @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(2), DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, KC_H, KC_J, KC_K, KC_L, DE_OE, LT(MDIA,DE_AE), MEH_T(KC_NO),KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(DE_MINS), KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_FN1, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TT(SYMB), KC_LALT,CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -137,10 +137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/haegin/keymap.c b/layouts/community/ergodox/haegin/keymap.c index aa017c8ea53..b7e382957f8 100644 --- a/layouts/community/ergodox/haegin/keymap.c +++ b/layouts/community/ergodox/haegin/keymap.c @@ -9,8 +9,6 @@ #define SYMBOLS 1 // symbols #define MEDIA 2 // media keys -#define _______ KC_TRNS - enum { TD_BSPC = 0 }; @@ -225,10 +223,6 @@ qk_tap_dance_action_t tap_dance_actions[] = { [TD_BSPC] = ACTION_TAP_DANCE_FN_ADVANCED (dance_backspace, dance_backspace_ended, dance_backspace_reset) }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMBOLS) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/italian/keymap.c b/layouts/community/ergodox/italian/keymap.c index 366f4c9b986..64dd51db67c 100644 --- a/layouts/community/ergodox/italian/keymap.c +++ b/layouts/community/ergodox/italian/keymap.c @@ -143,10 +143,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/j3rn/keymap.c b/layouts/community/ergodox/j3rn/keymap.c index 7f62a164697..8209c9c63e8 100644 --- a/layouts/community/ergodox/j3rn/keymap.c +++ b/layouts/community/ergodox/j3rn/keymap.c @@ -138,11 +138,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) - [2] = ACTION_LAYER_TAP_TOGGLE(MDIA) // FN2 - Momentary Layer 2 (Media) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/jackhumbert/keymap.c b/layouts/community/ergodox/jackhumbert/keymap.c index 634e4a0ceea..745d632d022 100644 --- a/layouts/community/ergodox/jackhumbert/keymap.c +++ b/layouts/community/ergodox/jackhumbert/keymap.c @@ -69,10 +69,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/jacobono/keymap.c b/layouts/community/ergodox/jacobono/keymap.c index c0a1c0cdb88..8d80e349ba8 100644 --- a/layouts/community/ergodox/jacobono/keymap.c +++ b/layouts/community/ergodox/jacobono/keymap.c @@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_RCTRL, KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - MO(SYMB), KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, + MO(SYMB), KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN, KC_RGUI, KC_ENT), @@ -224,10 +224,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_WBAK), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/jafo/keymap.c b/layouts/community/ergodox/jafo/keymap.c index 081f18894fb..08ea16d4bbe 100644 --- a/layouts/community/ergodox/jafo/keymap.c +++ b/layouts/community/ergodox/jafo/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), TG(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -136,10 +136,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/jgarr/keymap.c b/layouts/community/ergodox/jgarr/keymap.c index 359b2e1acf0..37524dfa086 100644 --- a/layouts/community/ergodox/jgarr/keymap.c +++ b/layouts/community/ergodox/jgarr/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), KC_MINS, MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_EQL, - KC_LALT, KC_FN1, + KC_LALT, TT(SYMB), KC_PGUP, KC_PGDN,KC_ENT, KC_SPC ), @@ -135,10 +135,6 @@ LAYOUT_ergodox( ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/josh/keymap.c b/layouts/community/ergodox/josh/keymap.c index 5121fabdb00..07ee97ec821 100644 --- a/layouts/community/ergodox/josh/keymap.c +++ b/layouts/community/ergodox/josh/keymap.c @@ -143,10 +143,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/kines-ish/keymap.c b/layouts/community/ergodox/kines-ish/keymap.c index da39b5278b1..6f0d99d8db0 100644 --- a/layouts/community/ergodox/kines-ish/keymap.c +++ b/layouts/community/ergodox/kines-ish/keymap.c @@ -135,10 +135,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/kristian/keymap.c b/layouts/community/ergodox/kristian/keymap.c index aeb3112de87..b56e880c0e2 100644 --- a/layouts/community/ergodox/kristian/keymap.c +++ b/layouts/community/ergodox/kristian/keymap.c @@ -21,10 +21,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(1) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { diff --git a/layouts/community/ergodox/manna-harbour_miryoku/keymap.c b/layouts/community/ergodox/manna-harbour_miryoku/keymap.c new file mode 100644 index 00000000000..86547df98ea --- /dev/null +++ b/layouts/community/ergodox/manna-harbour_miryoku/keymap.c @@ -0,0 +1,21 @@ + +// generated from users/manna-harbour_miryoku/miryoku.org + +#define LAYOUT_miryoku(\ +K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ +K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ +K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ +N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ +)\ +LAYOUT_ergodox_pretty( \ +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ +KC_NO, K00, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, K09, KC_NO, \ +KC_NO, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_NO, \ +KC_NO, K20, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K29, KC_NO, \ +KC_NO, KC_NO, KC_NO, KC_NO, K32, K37, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, \ + K33, K34, KC_NO, KC_NO, K35, K36 \ +) + +#include "manna-harbour_miryoku.c" diff --git a/layouts/community/ergodox/maz/keymap.c b/layouts/community/ergodox/maz/keymap.c index ad425a726c5..c36821ded24 100644 --- a/layouts/community/ergodox/maz/keymap.c +++ b/layouts/community/ergodox/maz/keymap.c @@ -180,10 +180,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/mclennon_osx/keymap.c b/layouts/community/ergodox/mclennon_osx/keymap.c index dd37c5eef73..aeea456ecab 100644 --- a/layouts/community/ergodox/mclennon_osx/keymap.c +++ b/layouts/community/ergodox/mclennon_osx/keymap.c @@ -95,10 +95,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(AUXI) // FN1 - Momentary Layer 1 (Auxiliary) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/meagerfindings/keymap.c b/layouts/community/ergodox/meagerfindings/keymap.c index 62504f9667a..f4340b8e1b4 100644 --- a/layouts/community/ergodox/meagerfindings/keymap.c +++ b/layouts/community/ergodox/meagerfindings/keymap.c @@ -42,7 +42,6 @@ enum custom_keycodes { }; //Redefine Key Names for Readaibilty -#define XXXXXXX KC_NO #define SCRN_CLIPB LCTL(LGUI(LSFT(KC_4))) #define CHRM_L LALT(LGUI(KC_LEFT)) //Move left one tab in Chrome #define CHRM_R LALT(LGUI(KC_RIGHT)) //Move right one tab in Chrome diff --git a/layouts/community/ergodox/msc/keymap.c b/layouts/community/ergodox/msc/keymap.c index 52962634193..c64c92c9c84 100644 --- a/layouts/community/ergodox/msc/keymap.c +++ b/layouts/community/ergodox/msc/keymap.c @@ -135,10 +135,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/naps62/keymap.c b/layouts/community/ergodox/naps62/keymap.c index 481b0dd765f..a242a14fe94 100644 --- a/layouts/community/ergodox/naps62/keymap.c +++ b/layouts/community/ergodox/naps62/keymap.c @@ -138,10 +138,6 @@ LAYOUT_ergodox( ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.c b/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.c index 39913503379..f93f03e92e4 100644 --- a/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.c +++ b/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.c @@ -282,8 +282,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = {}; - #define UC_MODE_WIN 0 #define UC_MODE_LINUX 1 #define UC_MODE_OSX 2 diff --git a/layouts/community/ergodox/nstickney/keymap.c b/layouts/community/ergodox/nstickney/keymap.c new file mode 100644 index 00000000000..a37bc5f9642 --- /dev/null +++ b/layouts/community/ergodox/nstickney/keymap.c @@ -0,0 +1,142 @@ +#include "nstickney.h" + +/* + * This keymap simulates the key limitations of an Iris on an ErgoDox. See the + * matching iris layout (/keyboards/keebio/iris/keymaps/nstickney) for further + * information. + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_ergodox( + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, + CC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, AC_SLSH, + TD(LOCKS), XXXXXXX, + XXXXXXX, + FC_BSLS, KC_SPC, XXXXXXX, + // right hand + XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + XXXXXXX, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, CC_QUOT, + XXXXXXX, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + AC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, TD(LAYERS), + XXXXXXX, + XXXXXXX, KC_ENT, FC_MINS + ), + + [SYMB] = LAYOUT_ergodox( + // left hand + UC(0x00EF), UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), _______, + _______, UC(0x00E4), UC(0x00E5), UC(0x00E9), UC(0x00AE), UC(0x00FE), _______, + _______, UC(0x00E1), UC(0x00DF), UC(0x00F0), UC(0x00EC), UC(0x00ED), + _______, UC(0x00E6), UC(0x00E8), UC(0x00A9), UC(0x00EA), UC(0x00EB), _______, + _______, _______, _______, _______, UC(0x00BF), + _______, _______, + _______, + _______, UC(0x00AC), _______, + // right hand + _______, UC(0x00BC), UC(0x00BD), UC(0x00BE), UC(0x2018), UC(0x2019), _______, + _______, UC(0x00FC), UC(0x00FA), UC(0x00ED), UC(0x00F3), UC(0x00F6), _______, + UC(0x00EE), UC(0x00E0), UC(0x00E2), UC(0x00F8), UC(0x00B6), UC(0x00B4), + _______, UC(0x00F1), UC(0x00FD), UC(0x00E7), UC(0x00F4), UC(0x00BF), _______, + UC(0x00D7), _______, _______, _______, _______, + _______, _______, + _______, + _______, UC(0x00B1), _______ + ), + + [SYSH] = LAYOUT_ergodox( + // left hand + UC(0x00CF), UC(0x00B9), UC(0x2200), UC(0x2201), UC(0x00A3), UC(0x00A5), _______, + _______, UC(0x00C4), UC(0x00C5), UC(0x00C9), UC(0x2122), UC(0x00DE), _______, + _______, UC(0x00C1), UC(0x00A7), UC(0x00D0), UC(0x00CC), UC(0x00CD), + _______, UC(0x00C6), UC(0x00C8), UC(0x00A2), UC(0x00CA), UC(0x00CB), _______, + _______, _______, _______, _______, UC(0x203D), + _______, _______, + _______, + _______, UC(0x00A6), _______, + // right hand + _______, UC(0x00B5), UC(0x00AB), UC(0x00BB), UC(0x201C), UC(0x201D), _______, + _______, UC(0x00DC), UC(0x00DA), UC(0x00CD), UC(0x00D3), UC(0x00D6), _______, + UC(0x00CE), UC(0x00C1), UC(0x00C2), UC(0x00D8), UC(0x00B0), UC(0x00A8), + _______, UC(0x00D1), UC(0x00DD), UC(0x00C7), UC(0x00D4), UC(0x203D), _______, + UC(0x00F7), _______, _______, _______, _______, + _______, _______, + _______, + _______, UC(0x00AA), _______ + ), + + [NUMP] = LAYOUT_ergodox( + // left hand + _______, _______, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, + _______, _______, KC_P4, KC_P5, KC_P6, KC_PAST, _______, + _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, + _______, _______, KC_P0, KC_PCMM, KC_PDOT, KC_PPLS, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + // right hand + _______, _______, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, + _______, _______, KC_P4, KC_P5, KC_P6, KC_PAST, _______, + _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, + _______, _______, KC_P0, KC_PCMM, KC_PDOT, KC_PPLS, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, KC_PENT, _______ + ), + + [FCTN] = LAYOUT_ergodox( + // left hand + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, + KC_PSCR, RGB_TOG, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, + KC_PAUS, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + _______, KC_MPRV, KC_MRWD, KC_MPLY, KC_MFFD, KC_MNXT, _______, + _______, _______, _______, _______, _______, + KC_F11, _______, + _______, + _______, _______, _______, + // right hand + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_SYSREQ, + _______, UC(0x2014), KC_LBRC, KC_RBRC, S(KC_LBRC), S(KC_RBRC), KC_INS, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_BRIU, KC_CLR, + _______, KC_MSTP, KC_MUTE, KC_VOLD, KC_VOLU, KC_BRID, _______, + _______, _______, _______, _______, _______, + _______, KC_F12, + _______, + _______, _______, _______ + ), +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user (void) { + ergodox_board_led_off(); +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user (void) { + + if (IS_LAYER_ON(SYMB) || IS_LAYER_ON(SYSH)) { + ergodox_right_led_1_on(); + } else { + ergodox_right_led_1_off(); + } + + if (IS_LAYER_ON(NUMP)) { + ergodox_right_led_2_on(); + } else { + ergodox_right_led_2_off(); + } + + if (IS_LAYER_ON(FCTN)) { + ergodox_right_led_3_on(); + } else { + ergodox_right_led_3_off(); + } + +}; \ No newline at end of file diff --git a/layouts/community/ergodox/osx_de/keymap.c b/layouts/community/ergodox/osx_de/keymap.c index a9a27a8d432..cd9a35e2126 100644 --- a/layouts/community/ergodox/osx_de/keymap.c +++ b/layouts/community/ergodox/osx_de/keymap.c @@ -145,10 +145,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { static uint16_t start; diff --git a/layouts/community/ergodox/osx_de/readme.md b/layouts/community/ergodox/osx_de/readme.md index 5011a9dd62e..e4ccee3aa6b 100644 --- a/layouts/community/ergodox/osx_de/readme.md +++ b/layouts/community/ergodox/osx_de/readme.md @@ -1,4 +1,4 @@ -#Ergodox EZ für OSX +# Ergodox EZ für OSX Dies ist nur ein kleiner Tweak der bestehenden firmware für das ErgoDox-EZ-Keyboard. Leider passte das layout nicht wirklich für OSX, deswegen habe ich einige Anpassungen gemacht. Dabei wurden folgende features umgesetzt: @@ -14,7 +14,6 @@ Dies ist nur ein kleiner Tweak der bestehenden firmware für das ErgoDox-EZ-Keyb # Erstellt Mit Dem ErgodoxLayoutGenerator Der ErgodoxLayoutGenerator ist ein kleines Werkzeug, welches die Erstellung und Pflege der eigenen Keymaps erleichtern soll. Es ist in java geschrieben und kann [hier](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases) heruntergeladen werden. Damit das Tool funktioniert sollte das offizielle Oracle JDK in aktueller Version installiert sein. -Die Dokumentation für den ELG kann man [hier](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/) nachlesen (momentan leider nur in Englisch verfügbar). diff --git a/layouts/community/ergodox/osx_de_adnw_koy/keymap.c b/layouts/community/ergodox/osx_de_adnw_koy/keymap.c index 9d2e117bc10..8fc0f1fd94a 100644 --- a/layouts/community/ergodox/osx_de_adnw_koy/keymap.c +++ b/layouts/community/ergodox/osx_de_adnw_koy/keymap.c @@ -122,10 +122,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { diff --git a/layouts/community/ergodox/osx_de_experimental/keymap.c b/layouts/community/ergodox/osx_de_experimental/keymap.c index 15c700a7830..cedecd45cb1 100644 --- a/layouts/community/ergodox/osx_de_experimental/keymap.c +++ b/layouts/community/ergodox/osx_de_experimental/keymap.c @@ -378,10 +378,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { static uint16_t start; diff --git a/layouts/community/ergodox/osx_de_experimental/readme.md b/layouts/community/ergodox/osx_de_experimental/readme.md index e6a10184167..dde28eee415 100644 --- a/layouts/community/ergodox/osx_de_experimental/readme.md +++ b/layouts/community/ergodox/osx_de_experimental/readme.md @@ -8,7 +8,6 @@ dieses layout ist experimentell und wird im Lufe der Zeit viele Änderungen und # Erstellt Mit Dem ErgodoxLayoutGenerator Der ErgodoxLayoutGenerator (ELG) ist ein kleines Werkzeug, welches die Erstellung und Pflege der eigenen Keymaps erleichtern soll. Es ist in java geschrieben und kann [hier](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases) heruntergeladen werden. Damit das Tool funktioniert sollte das offizielle Oracle JDK in aktueller Version installiert sein. -Die Dokumentation für den ELG kann man [hier](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/) nachlesen (momentan leider nur in Englisch verfügbar). --------------------------------------------------------------------------------------------------------------------- # Ergodox and Ergodox-EZ experimental layout diff --git a/layouts/community/ergodox/osx_fr/keymap.c b/layouts/community/ergodox/osx_fr/keymap.c index f899b8b0f1b..b1876d6a8ed 100644 --- a/layouts/community/ergodox/osx_fr/keymap.c +++ b/layouts/community/ergodox/osx_fr/keymap.c @@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, FR_GRV, KC_H, KC_J, KC_K, KC_L, FR_M, KC_LGUI, MEH_T(KC_NO), KC_N, FR_COMM, LT(MDIA, FR_SCLN), FR_COLN, CTL_T(FR_EQL), KC_RSFT, - KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN, KC_TAB, KC_ENT @@ -138,10 +138,6 @@ LAYOUT_ergodox( ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/osx_kinesis_pnut/keymap.c b/layouts/community/ergodox/osx_kinesis_pnut/keymap.c index 59ffe4f3ff0..5b731a1c006 100644 --- a/layouts/community/ergodox/osx_kinesis_pnut/keymap.c +++ b/layouts/community/ergodox/osx_kinesis_pnut/keymap.c @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOTE, MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), CTL_T(KC_ESC), KC_LGUI, KC_EQL, KC_TAB, KC_ENT, KC_SPC @@ -142,10 +142,6 @@ LAYOUT_ergodox( ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/osx_neo2/keymap.c b/layouts/community/ergodox/osx_neo2/keymap.c new file mode 100644 index 00000000000..9e379c73f5a --- /dev/null +++ b/layouts/community/ergodox/osx_neo2/keymap.c @@ -0,0 +1,694 @@ +#include QMK_KEYBOARD_H +#include "layers.h" +#include "version.h" + +// Timer to detect tap/hold on NEO_RMOD3 key +static uint16_t neo3_timer; +// State bitmap to track which key(s) enabled NEO_3 layer +static uint8_t neo3_state = 0; +// State bitmap to track key combo for CAPSLOCK +static uint8_t capslock_state = 0; + +// bitmasks for modifier keys +#define MOD_MASK_NONE 0 + +// Used to trigger macros / sequences of keypresses +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + US_OSX_SMALL_UE, + US_OSX_SMALL_AE, + US_OSX_SMALL_OE, + US_OSX_CAPITAL_UE, + US_OSX_CAPITAL_AE, + US_OSX_CAPITAL_OE, + NEO2_LMOD3, + NEO2_RMOD3, + NEO2_1, + NEO2_2, + NEO2_3, + NEO2_4, + NEO2_5, + NEO2_6, + NEO2_7, + NEO2_8, + NEO2_9, + NEO2_0, + NEO2_MINUS, + NEO2_UE, + NEO2_AE, + NEO2_OE, + NEO2_COMMA, + NEO2_DOT, + NEO2_SHARP_S +}; + +#define NEO2_LMOD4 TT(NEO_4) +#define NEO2_RMOD4 NEO2_LMOD4 + +// NEO_3 special characters +#define US_OSX_SUPERSCRIPT_1 KC_NO // ¹ +#define US_OSX_SUPERSCRIPT_2 KC_NO // ² +#define US_OSX_SUPERSCRIPT_3 KC_NO // ³ +#define US_OSX_RSAQUO LALT(LSFT(KC_4)) // › +#define US_OSX_LSAQUO LALT(LSFT(KC_3)) // ‹ +#define US_OSX_CENT LALT(KC_4) // ¢ +#define US_OSX_YEN LALT(KC_Y) // ¥ +#define US_OSX_SBQUO LALT(LSFT(KC_0)) // ‚ +#define US_OSX_LEFT_SINGLE_QUOTE LALT(KC_RBRACKET) // ‘ +#define US_OSX_RIGHT_SINGLE_QUOTE LALT(LSFT(KC_RBRACKET)) // ’ +#define US_OSX_ELLIPSIS LALT(KC_SCOLON) // … +#define US_OSX_UNDERSCORE LSFT(KC_MINUS) // _ +#define US_OSX_LBRACKET KC_LBRACKET // [ +#define US_OSX_RBRACKET KC_RBRACKET // ] +#define US_OSX_CIRCUMFLEX LSFT(KC_6) // ^ +#define US_OSX_EXCLAMATION LSFT(KC_1) // ! +#define US_OSX_LESSTHAN LSFT(KC_COMMA) // < +#define US_OSX_GREATERTHAN LSFT(KC_DOT) // > +#define US_OSX_EQUAL KC_EQUAL // = +#define US_OSX_AMPERSAND LSFT(KC_7) // & +#define US_OSX_SMALL_LONG_S KC_NO // ſ +#define US_OSX_BSLASH KC_BSLASH +#define US_OSX_SLASH KC_SLASH // / +#define US_OSX_CLBRACKET LSFT(KC_LBRACKET) // { +#define US_OSX_CRBRACKET LSFT(KC_RBRACKET) // } +#define US_OSX_ASTERISK LSFT(KC_8) // * +#define US_OSX_QUESTIONMARK LSFT(KC_SLASH) // ? +#define US_OSX_LPARENTHESES LSFT(KC_9) // ( +#define US_OSX_RPARENTHESES LSFT(KC_0) // ) +#define US_OSX_HYPHEN_MINUS KC_MINUS // - +#define US_OSX_COLON LSFT(KC_SCOLON) // : +#define US_OSX_AT LSFT(KC_2) // @ +#define US_OSX_HASH LSFT(KC_3) // # +#define US_OSX_PIPE LSFT(KC_BSLASH) // | +#define US_OSX_TILDE LSFT(KC_GRAVE) // ~ +#define US_OSX_BACKTICK KC_GRAVE // ` +#define US_OSX_PLUS LSFT(KC_EQUAL) // + +#define US_OSX_PERCENT LSFT(KC_5) // % +#define US_OSX_DOUBLE_QUOTE LSFT(KC_QUOTE) // " +#define US_OSX_SINGLE_QUOTE KC_QUOTE // ' +#define US_OSX_SEMICOLON KC_SCOLON // ; + +// NEO_4 special characters +#define US_OSX_FEMININE_ORDINAL LALT(KC_9) // ª +#define US_OSX_MASCULINE_ORDINAL LALT(KC_0) // º +#define US_OSX_NUMERO_SIGN KC_NO // № +#define US_OSX_MIDDLE_DOT LALT(LSFT(KC_9)) // · +#define US_OSX_BRITISH_POUND LALT(KC_3) // £ +#define US_OSX_CURRENCY_SIGN KC_NO // ¤ +#define US_OSX_INV_EXCLAMATION LALT(KC_1) // ¡ +#define US_OSX_INV_QUESTIONMARK LALT(LSFT(KC_SLASH)) // ¿ +#define US_OSX_DOLLAR KC_DOLLAR // $ +#define US_OSX_EM_DASH LALT(LSFT(KC_MINUS)) // — + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* NEO_1: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ---- | 1/° | 2/§ | 3/ | 4/» | 5/« | ESC | | US_1 | 6/$ | 7/€ | 8/„ | 9/“ | 0/” | -/— | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | X | V | L | C | W | LCTL | | RCTL | K | H | G | F | Q | ß | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | NEO_3 | U | I | A | E | O |------| |------| S | N | R | T | D | Y | + * |--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------| + * | LSHIFT | Ü | Ö | Ä | P | Z | | | | B | M | ,/– | ./• | J | RSHIFT | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | ---- | ---- | LCTL | LALT | LGUI | | RGUI | Left | Down | Up | Right| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | FKEYS| Home | | PgUp | FKEYS| + * ,------|------|------| |------+------+------. + * | Back-| | End | | PgDn | | | + * | space|Delete|------| |------| Enter|Space | + * | | | NEO_4| | NEO_4| | | + * `--------------------' `--------------------' + */ + [NEO_1] = LAYOUT_ergodox( + // left hand side - main + KC_NO /* NOOP */, NEO2_1, NEO2_2, NEO2_3, NEO2_4, NEO2_5, KC_ESCAPE, + KC_TAB, KC_X, KC_V, KC_L, KC_C, KC_W, KC_LCTRL, + NEO2_LMOD3, KC_U, KC_I, KC_A, KC_E, KC_O, /* --- */ + KC_LSHIFT, NEO2_UE, NEO2_OE, NEO2_AE, KC_P, KC_Z, KC_LALT, + KC_NO /* NOOP */, KC_NO /* NOOP */, KC_LCTRL, KC_LALT, KC_LGUI, /* --- */ /* --- */ + + // left hand side - thumb cluster + /* --- */ MO(FKEYS), KC_HOME, + /* KC_BSPACE */ /* KC_DELETE */ KC_END, + KC_BSPACE, KC_DELETE, NEO2_LMOD4, + + // right hand side - main + TO(US_1), NEO2_6, NEO2_7, NEO2_8, NEO2_9, NEO2_0, NEO2_MINUS, + KC_RCTRL, KC_K, KC_H, KC_G, KC_F, KC_Q, NEO2_SHARP_S, + /* --- */ KC_S, KC_N, KC_R, KC_T, KC_D, NEO2_RMOD3, + KC_RALT, KC_B, KC_M, NEO2_COMMA, NEO2_DOT, KC_J, KC_RSHIFT, + /* --- */ /* --- */ KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, + + // right hand side - thumb cluster + KC_PGUP, MO(FKEYS), /* --- */ + KC_PGDOWN, /* --- */ /* --- */ + NEO2_RMOD4, KC_ENTER, KC_SPACE + ), + + /* NEO_3: Symbol layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ---- | ---- | ---- | ---- | › | ‹ | | | | ¢ | ¥ | ‚ | ‘ | ’ | ---- | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ---- | … | _ | [ | ] | ^ | | | | ! | < | > | = | & | ---- | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | \ | / | { | } | * |------| |------| ? | ( | ) | - | : | @ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | | | ~ | ` | | | | + | % | " | ' | ; | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + [NEO_3] = LAYOUT_ergodox( + // left hand side - main + KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, US_OSX_RSAQUO, US_OSX_LSAQUO, _______, + KC_NO /* NOOP */, US_OSX_ELLIPSIS, US_OSX_UNDERSCORE, US_OSX_LBRACKET, US_OSX_RBRACKET, US_OSX_CIRCUMFLEX, _______, + _______, US_OSX_BSLASH, US_OSX_SLASH, US_OSX_CLBRACKET, US_OSX_CRBRACKET, US_OSX_ASTERISK, /* --- */ + _______, US_OSX_HASH, US_OSX_DOLLAR, US_OSX_PIPE, US_OSX_TILDE, US_OSX_BACKTICK, _______, + _______, _______, _______, _______, _______, /* --- */ /* --- */ + + // left hand side - thumb cluster + /* --- */ _______, _______, + /* --- */ /* --- */ _______, + _______, _______, _______, + + // right hand side - main + _______, US_OSX_CENT, US_OSX_YEN, US_OSX_SBQUO, US_OSX_LEFT_SINGLE_QUOTE, US_OSX_RIGHT_SINGLE_QUOTE, KC_NO, + _______, US_OSX_EXCLAMATION, US_OSX_LESSTHAN, US_OSX_GREATERTHAN, US_OSX_EQUAL, US_OSX_AMPERSAND, US_OSX_SMALL_LONG_S, + /* --- */ US_OSX_QUESTIONMARK, US_OSX_LPARENTHESES, US_OSX_RPARENTHESES, US_OSX_HYPHEN_MINUS, US_OSX_COLON, NEO2_RMOD3, + _______, US_OSX_PLUS, US_OSX_PERCENT, US_OSX_DOUBLE_QUOTE, US_OSX_SINGLE_QUOTE, US_OSX_SEMICOLON, _______, + /* --- */ /* --- */ _______, _______, _______, _______, _______, + + // right hand side - thumb cluster + _______, _______, /* --- */ + _______, /* --- */ /* --- */ + _______, _______, _______ + ), + + /* NEO_4: Cursor & Numpad + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ---- | ª | º | ---- | · | £ | | | | ---- | Tab | / | * | - | ---- | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ---- | PgUp | ⌫ | Up | ⌦ | PgDn | | | | ¡ | 7 | 8 | 9 | + | – | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Home | Left | Down | Right| End |------| |------| ¿ | 4 | 5 | 6 | , | . | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Esc | Tab | Ins |Return| ---- | | | | : | 1 | 2 | 3 | ; | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | 0 | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + [NEO_4] = LAYOUT_ergodox( + // left hand side - main + KC_NO /* NOOP */, US_OSX_FEMININE_ORDINAL, US_OSX_MASCULINE_ORDINAL, KC_NO /* NOOP */, US_OSX_MIDDLE_DOT, US_OSX_BRITISH_POUND, _______, + _______, KC_PGUP, KC_BSPACE, KC_UP, KC_DELETE, KC_PGDOWN, _______, + _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, /* --- */ + _______, KC_ESCAPE, KC_TAB, KC_INSERT, KC_ENTER, KC_NO /* NOOP */, _______, + _______, _______, _______, _______, _______, /* --- */ /* --- */ + + // left hand side - thumb cluster + /* --- */ _______, _______, + /* --- */ /* --- */ _______, + _______, _______, _______, + + // right hand side - main + _______, US_OSX_CURRENCY_SIGN, KC_TAB, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_NO /* NOOP */, + _______, US_OSX_INV_EXCLAMATION, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, US_OSX_EM_DASH, + /* --- */ US_OSX_INV_QUESTIONMARK, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_COMMA, KC_KP_DOT, + _______, US_OSX_COLON, KC_KP_1, KC_KP_2, KC_KP_3, US_OSX_SEMICOLON, _______, + /* --- */ /* --- */ _______, KC_KP_0, _______, _______, _______, + + // right hand side - thumb cluster + _______, _______, /* --- */ + _______, /* --- */ /* --- */ + _______, _______, _______ + ), + + /* NEO_5: Greek + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + [NEO_5] = LAYOUT_ergodox( + // left hand side - main + KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, + KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, /* --- */ + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, + _______, _______, _______, _______, _______, /* --- */ /* --- */ + + // left hand side - thumb cluster + /* --- */ _______, _______, + /* --- */ /* --- */ _______, + _______, _______, _______, + + // right hand side - main + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, + /* --- */ KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, + /* --- */ /* --- */ _______, _______, _______, _______, _______, + + // right hand side - thumb cluster + _______, _______, /* --- */ + _______, /* --- */ /* --- */ + _______, _______, _______ + ), + + /* NEO_6: Math symbols + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + [NEO_6] = LAYOUT_ergodox( + // left hand side - main + KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, + KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, /* --- */ + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, + _______, _______, _______, _______, _______, /* --- */ /* --- */ + + // left hand side - thumb cluster + /* --- */ _______, _______, + /* --- */ /* --- */ _______, + _______, _______, _______, + + // right hand side - main + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, + /* --- */ KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, + _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, + /* --- */ /* --- */ _______, _______, _______, _______, _______, + + // right hand side - thumb cluster + _______, _______, /* --- */ + _______, /* --- */ /* --- */ + _______, _______, _______ + ), + + /* US_1: US QWERTY + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | NEO_1| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | \ | Q | W | E | R | T | ---- | | [ | Y | U | I | O | P | ] | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | TAB | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| ---- | | ---- |------+------+------+------+------+--------| + * | LSHIFT | Z | X | C | V | B | | | | N | M | , | . | / | RSHIFT | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | ---- | ---- | FKEYS| | Left | Down | Up | Right| RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCTRL| LALT | | RALT | RCTRL| + * ,------|------|------| |------+------+------. + * | | | HOME | | PGUP | | | + * | BKSP | DEL |------| |------| ENTR | SPCE | + * | | | END | | PGDN | | | + * `--------------------' `--------------------' + */ + [US_1] = LAYOUT_ergodox( + // left hand side - main + KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESCAPE, + KC_BSLASH, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO /* NOOP */, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, /* --- */ + KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO /* NOOP */, + KC_LGUI, KC_GRAVE, KC_NO, KC_NO, MO(FKEYS), /* --- */ /* --- */ + + // left hand side - thumb cluster + /* --- */ KC_LCTRL, KC_LALT, + /* --- */ /* --- */ KC_HOME, + KC_BSPACE, KC_DELETE, KC_END, + + // right hand side - main + TO(NEO_1), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + KC_LBRACKET, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET, + /* --- */ KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, + KC_NO /* NOOP */, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSHIFT, + /* --- */ /* --- */ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_RGUI, + + // right hand side - thumb cluster + KC_RALT, KC_RCTRL, /* --- */ + KC_PGUP, /* --- */ /* --- */ + KC_PGDOWN, KC_ENTER, KC_SPACE + ), + + /* FKEYS: Function keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Prev | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | VolUp | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Play | | | | | | | | | | | | | | VolDn | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Next | | | | | |------| |------| | | | | | Mute | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + [FKEYS] = LAYOUT_ergodox( + // left hand side - main + KC_MEDIA_REWIND, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + KC_MEDIA_PLAY_PAUSE, _______, _______, _______, _______, _______, _______, + KC_MEDIA_FAST_FORWARD, _______, _______, _______, _______, _______, /* --- */ + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, /* --- */ /* --- */ + + // left hand side - thumb cluster + /* --- */ _______, _______, + /* --- */ /* --- */ _______, + _______, _______, _______, + + // right hand side - main + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_AUDIO_VOL_UP, + _______, _______, _______, _______, _______, _______, KC_AUDIO_VOL_DOWN, + /* --- */ _______, _______, _______, _______, _______, KC_AUDIO_MUTE, + _______, _______, _______, _______, _______, _______, _______, + /* --- */ /* --- */ _______, _______, _______, _______, _______, + + // right hand side - thumb cluster + _______, _______, /* --- */ + _______, /* --- */ /* --- */ + _______, _______, _______ + ), +}; + +// Send a key tap with a optional set of modifiers. +void tap_with_modifiers(uint16_t keycode, uint8_t force_modifiers) { + uint8_t active_modifiers = get_mods(); + + if ((force_modifiers & MOD_MASK_SHIFT) && !(active_modifiers & MOD_MASK_SHIFT)) register_code(KC_LSFT); + if ((force_modifiers & MOD_MASK_CTRL) && !(active_modifiers & MOD_MASK_CTRL)) register_code(KC_LCTRL); + if ((force_modifiers & MOD_MASK_ALT) && !(active_modifiers & MOD_MASK_ALT)) register_code(KC_LALT); + if ((force_modifiers & MOD_MASK_GUI) && !(active_modifiers & MOD_MASK_GUI)) register_code(KC_LGUI); + + register_code(keycode); + unregister_code(keycode); + + if ((force_modifiers & MOD_MASK_SHIFT) && !(active_modifiers & MOD_MASK_SHIFT)) unregister_code(KC_LSFT); + if ((force_modifiers & MOD_MASK_CTRL) && !(active_modifiers & MOD_MASK_CTRL)) unregister_code(KC_LCTRL); + if ((force_modifiers & MOD_MASK_ALT) && !(active_modifiers & MOD_MASK_ALT)) unregister_code(KC_LALT); + if ((force_modifiers & MOD_MASK_GUI) && !(active_modifiers & MOD_MASK_GUI)) unregister_code(KC_LGUI); +} + +// Special remapping for keys with different keycodes/macros when used with shift modifiers. +bool process_record_user_shifted(uint16_t keycode, keyrecord_t *record) { + uint8_t active_modifiers = get_mods(); + uint8_t shifted = active_modifiers & MOD_MASK_SHIFT; + + // Early return on key release + if (!record->event.pressed) { + return true; + } + + if (shifted) { + clear_mods(); + + switch (keycode) { + case NEO2_1: + // degree symbol + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_8) SS_UP(X_LSHIFT) SS_UP(X_LALT)); + break; + case NEO2_2: + // section symbol + SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_6) SS_UP(X_LALT)); + break; + case NEO2_3: + // There is no OSX key combination for the script small l character + break; + case NEO2_4: + // right angled quote + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_BSLASH) SS_UP(X_LSHIFT) SS_UP(X_LALT)); + break; + case NEO2_5: + // left angled quote + SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_BSLASH) SS_UP(X_LALT)); + break; + case NEO2_6: + // dollar sign + SEND_STRING(SS_DOWN(X_LSHIFT) SS_TAP(X_4) SS_UP(X_LSHIFT)); + break; + case NEO2_7: + // euro sign + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_2) SS_UP(X_LSHIFT) SS_UP(X_LALT)); + break; + case NEO2_8: + // low9 double quote + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_W) SS_UP(X_LSHIFT) SS_UP(X_LALT)); + break; + case NEO2_9: + // left double quote + SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_LBRACKET) SS_UP(X_LALT)); + break; + case NEO2_0: + // right double quote + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_LBRACKET) SS_UP(X_LSHIFT) SS_UP(X_LALT)); + break; + case NEO2_MINUS: + // em dash + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_MINUS) SS_UP(X_LSHIFT) SS_UP(X_LALT)); + break; + case NEO2_COMMA: + // en dash + SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_MINUS) SS_UP(X_LALT)); + break; + case NEO2_DOT: + // bullet + SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_8) SS_UP(X_LALT)); + break; + case NEO2_SHARP_S: + // german sharp s + SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_S) SS_UP(X_LALT)); + break; + case NEO2_UE: + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_U) SS_UP(X_LSHIFT)); + break; + case NEO2_OE: + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_O) SS_UP(X_LSHIFT)); + break; + case NEO2_AE: + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_A) SS_UP(X_LSHIFT)); + break; + default: + set_mods(active_modifiers); + return true; + } + + set_mods(active_modifiers); + return false; + } else { + switch (keycode) { + case NEO2_1: + SEND_STRING(SS_TAP(X_1)); + break; + case NEO2_2: + SEND_STRING(SS_TAP(X_2)); + break; + case NEO2_3: + SEND_STRING(SS_TAP(X_3)); + break; + case NEO2_4: + SEND_STRING(SS_TAP(X_4)); + break; + case NEO2_5: + SEND_STRING(SS_TAP(X_5)); + break; + case NEO2_6: + SEND_STRING(SS_TAP(X_6)); + break; + case NEO2_7: + SEND_STRING(SS_TAP(X_7)); + break; + case NEO2_8: + SEND_STRING(SS_TAP(X_8)); + break; + case NEO2_9: + SEND_STRING(SS_TAP(X_9)); + break; + case NEO2_0: + SEND_STRING(SS_TAP(X_0)); + break; + case NEO2_MINUS: + SEND_STRING(SS_TAP(X_MINUS)); + break; + case NEO2_COMMA: + SEND_STRING(SS_TAP(X_COMMA)); + break; + case NEO2_DOT: + SEND_STRING(SS_TAP(X_DOT)); + break; + case NEO2_SHARP_S: + // german sharp s + SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_S) SS_UP(X_LALT)); + break; + case NEO2_UE: + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_TAP(X_U)); + break; + case NEO2_OE: + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_TAP(X_O)); + break; + case NEO2_AE: + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_TAP(X_A)); + break; + default: + return true; + } + + return false; + } +} + +// Runs for each key down or up event. +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LSHIFT: + if (record->event.pressed) { + capslock_state |= (MOD_BIT(KC_LSHIFT)); + } else { + capslock_state &= ~(MOD_BIT(KC_LSHIFT)); + } + break; + case KC_RSHIFT: + if (record->event.pressed) { + capslock_state |= MOD_BIT(KC_RSHIFT); + } else { + capslock_state &= ~(MOD_BIT(KC_RSHIFT)); + } + break; + case NEO2_LMOD3: + if (record->event.pressed) { + layer_on(NEO_3); + neo3_state |= (1 << 1); + } else { + // Turn off NEO_3 layer unless it's enabled through NEO2_RMOD3 as well. + if ((neo3_state & ~(1 << 1)) == 0) { + layer_off(NEO_3); + } + neo3_state &= ~(1 << 1); + } + break; + case NEO2_RMOD3: + if (record->event.pressed) { + neo3_timer = timer_read(); + neo3_state |= (1 << 2); + layer_on(NEO_3); + } else { + // Turn off NEO_3 layer unless it's enabled through NEO2_LMOD3 as well. + if ((neo3_state & ~(1 << 2)) == 0) { + layer_off(NEO_3); + } + neo3_state &= ~(1 << 2); + + // Was the NEO2_RMOD3 key TAPPED? + if (timer_elapsed(neo3_timer) <= 150) { + if (neo3_state > 0) { + // We are still in NEO_3 layer, send keycode and modifiers for @ + tap_with_modifiers(KC_2, MOD_MASK_SHIFT); + return false; + } else { + // Do the normal key processing, send y + tap_with_modifiers(KC_Y, MOD_MASK_NONE); + return false; + } + } + } + break; + } + + if ((capslock_state & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) { + // CAPSLOCK is currently active, disable it + if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { + unregister_code(KC_LOCKING_CAPS); + } else { + register_code(KC_LOCKING_CAPS); + } + return false; + } + + return process_record_user_shifted(keycode, record); +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void){ + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } +}; diff --git a/layouts/community/ergodox/osx_neo2/layers.h b/layouts/community/ergodox/osx_neo2/layers.h new file mode 100644 index 00000000000..a5e0cba00d7 --- /dev/null +++ b/layouts/community/ergodox/osx_neo2/layers.h @@ -0,0 +1,9 @@ +enum layers { + NEO_1, // layer_0 + NEO_3, // layer_1 + NEO_4, // layer_2 + NEO_5, // layer_3 + NEO_6, // layer_4 + US_1, // layer_5 + FKEYS // layer_6 +}; \ No newline at end of file diff --git a/layouts/community/ergodox/osx_neo2/readme.md b/layouts/community/ergodox/osx_neo2/readme.md new file mode 100644 index 00000000000..cab4dfe7099 --- /dev/null +++ b/layouts/community/ergodox/osx_neo2/readme.md @@ -0,0 +1,219 @@ +# Neo 2 for ErgoDox on QWERTY + +# Description + +The Neo layout is an optimized German keyboard layout developed by the +Neo Users Group, supporting many Latin-based alphabets. The positions +of the letters are not only optimized for German letter frequency, +but also for typical groups of two or three letters. English is +considered a primary target as well. + +The design tries to enforce the alternating usage of both hands to +increase typing speed and incorporates ideas from de-ergo and other +ergonomic layouts. High frequency keys are placed in the home row. +The current layout Neo 2.0 has unique features making it suited for +many target groups such as programmers, mathematicians, scientists or +LaTeX authors. + +Neo is grouped into six layers, each dedicated to a special purpose. + +# Layers + +At the core this is a Neo 2.0 layout adjusted for the Ergodox Infinity. +The keymap is laid out expecting a macOs using the US QWERTY or ABC +Extended layout. + +[Layer 1](#layer-1) Lowercase, upppercase and typographical characters + +[Layer 2](#layer-2) Special characters for programming + +[Layer 3](#layer-3) WASD-like movement keys and number block + +[Layer 4](#layer-4) Greek characters + +[Layer 5](#layer-5) Mathematical symbols and Greek uppercase characters + +[Layer 6](#layer-6) Ergodox Infinity US QWERTY layout + +[Layer 7](#layer-7) Function keys + +## Legend + + * Keys marked with `----` are dead keys. + * Blank keys are transparent and fall through to lower levels. + +## Layer 1 + +This layer implements NEO layers 1 and 2. + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| ---- | 1/° | 2/§ | 3/ | 4/» | 5/« | ESC | | US_1 | 6/$ | 7/€ | 8/„ | 9/“ | 0/” | -/— | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| TAB | X | V | L | C | W | LCTL | | RCTL | K | H | G | F | Q | ß | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| NEO_3 | U | I | A | E | O |------| |------| S | N | R | T | D | Y | +|--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------| +| LSHIFT | Ü | Ö | Ä | P | Z | | | | B | M | ,/– | ./• | J | RSHIFT | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | ---- | ---- | LCTL | LALT | LGUI | | RGUI | Left | Down | Up | Right| + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | FKEYS| Home | | PgUp | FKEYS| + ,------|------|------| |------+------+------. + | Back-| | End | | PgDn | | | + | space|Delete|------| |------| Enter|Space | + | | | NEO_4| | NEO_4| | | + `--------------------' `--------------------' +``` + +## Layer 2 + +This layer implements NEO layer 3. + + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| ---- | ---- | ---- | ---- | › | ‹ | | | | ¢ | ¥ | ‚ | ‘ | ’ | ---- | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| ---- | … | _ | [ | ] | ^ | | | | ! | < | > | = | & | ---- | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | \ | / | { | } | * |------| |------| ? | ( | ) | - | : | @ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | # | $ | | | ~ | ` | | | | + | % | " | ' | ; | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Layer 3 + +This layer implements NEO layer 4. + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| ---- | ª | º | ---- | · | £ | | | | ---- | Tab | / | * | - | ---- | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| ---- | PgUp | ⌫ | Up | ⌦ | PgDn | | | | ¡ | 7 | 8 | 9 | + | – | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | Home | Left | Down | Right| End |------| |------| ¿ | 4 | 5 | 6 | , | . | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | Esc | Tab | Ins |Return| ---- | | | | : | 1 | 2 | 3 | ; | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | 0 | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Layer 4 + +This layer is currently empty/reserved for NEO layer 5. + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Layer 5 + +This layer is currently empty/reserved for NEO layer 6. + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Layer 6 + +A bare bones implementation of the default Ergodox Infinity layout. + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | ESC | | NEO_1| 6 | 7 | 8 | 9 | 0 | - | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| \ | Q | W | E | R | T | ---- | | [ | Y | U | I | O | P | ] | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| TAB | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | +|--------+------+------+------+------+------| ---- | | ---- |------+------+------+------+------+--------| +| LSHIFT | Z | X | V | B | M | | | | N | M | , | . | / | RSHIFT | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | LGUI | ` | ---- | ---- | FKEYS| | Left | Down | Up | Right| RGUI | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | LCTRL| LALT | | RALT | RCTRL| + ,------|------|------| |------+------+------. + | | | HOME | | PGUP | | | + | BKSP | DEL |------| |------| ENTR | SPCE | + | | | END | | PGDN | | | + `--------------------' `--------------------' +``` + +## Layer 7 + +This layer implements function and multimedia keys. + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| Prev | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | VolUp | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Play | | | | | | | | | | | | | | VolDn | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| Next | | | | | |------| |------| | | | | | Mute | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | | | | | | | | | | | | | | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` diff --git a/layouts/community/ergodox/osx_neo2/visualizer.c b/layouts/community/ergodox/osx_neo2/visualizer.c new file mode 100644 index 00000000000..653201bb8aa --- /dev/null +++ b/layouts/community/ergodox/osx_neo2/visualizer.c @@ -0,0 +1,47 @@ +#include "layers.h" +#include "simple_visualizer.h" +#include "util.h" + +static void get_visualizer_layer_and_color(visualizer_state_t *state) { + uint8_t layer = biton32(state->status.layer); + + // Go from highest to lowest layer to get the right text/color combination. + switch (layer) { + // #AEB2F4 / hsv(65.71%, 28.69%, 95.69%) + case FKEYS: + // #F4AEDC / hsv(89.05%, 28.69%, 95.69%) + state->layer_text = "FUNCTION KEYS"; + state->target_lcd_color = LCD_COLOR(228, 73, 245); + break; + case US_1: + // #F4B993 / hsv(6.53%, 39.75%, 95.69%) + state->layer_text = "QWERTY"; + state->target_lcd_color = LCD_COLOR(17, 102, 245); + break; + case NEO_6: + // #F4E393 / hsv(13.75%, 39.75%, 95.69%) + state->layer_text = "NEO: 6"; + state->target_lcd_color = LCD_COLOR(35, 102, 245); + break; + case NEO_5: + // #C6F493 / hsv(24.57%, 39.75%, 95.69%) + state->layer_text = "NEO: 5"; + state->target_lcd_color = LCD_COLOR(63, 102, 245); + break; + case NEO_4: + // #8EEBC9 / hsv(43.91%, 39.57%, 92.16%) + state->layer_text = "NEO: 4"; + state->target_lcd_color = LCD_COLOR(112, 101, 189); + break; + case NEO_3: + // #93D2F4 / hsv(55.84%, 39.75%, 95.69%) + state->layer_text = "NEO: 3"; + state->target_lcd_color = LCD_COLOR(143, 102, 245); + break; + default: + // #EEEEEE / hsv(0%, 0%, 93%) + state->layer_text = "NEO: 1"; + state->target_lcd_color = LCD_COLOR(0, 0, 255); + break; + } +} diff --git a/layouts/community/ergodox/phoenix/keymap.c b/layouts/community/ergodox/phoenix/keymap.c index 7ebdeaeb83c..31a987b356a 100644 --- a/layouts/community/ergodox/phoenix/keymap.c +++ b/layouts/community/ergodox/phoenix/keymap.c @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_DOWN,KC_UP ,KC_LBRC,KC_RBRC, KC_FN1, + KC_DOWN,KC_UP ,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_ENT, KC_SPC @@ -135,10 +135,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/plover/keymap.c b/layouts/community/ergodox/plover/keymap.c index d3e3547299e..9f19ab24c41 100644 --- a/layouts/community/ergodox/plover/keymap.c +++ b/layouts/community/ergodox/plover/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(3), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_ENT, KC_SPC @@ -179,10 +179,6 @@ LAYOUT_ergodox( ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/pvinis/Changelog.md b/layouts/community/ergodox/pvinis/Changelog.md deleted file mode 100644 index e5816200b83..00000000000 --- a/layouts/community/ergodox/pvinis/Changelog.md +++ /dev/null @@ -1,7 +0,0 @@ -## v0.3 - -*2016-10-11* - -### Starting point - -* The starting point of this keymap. A beginner layout, and a couple placeholders. diff --git a/layouts/community/ergodox/pvinis/keymap.c b/layouts/community/ergodox/pvinis/keymap.c deleted file mode 100644 index 1bca0398dcd..00000000000 --- a/layouts/community/ergodox/pvinis/keymap.c +++ /dev/null @@ -1,475 +0,0 @@ -// pvinis' ergodox keymap - -#include QMK_KEYBOARD_H -#include "mousekey.h" - -// easier name for left ctrl-alt-gui -#define ALLM(kc) LCAG(kc) - -// layers -enum { - BASE = 0, - BEGIN, - QWERTY, - CARPALX, - SYSCTL, - MOUSE, -}; - -// extra keys -enum { - NONE = 0, - - // tap dance - TD_FLSH, // flash keyboard - TD_LAYR, // SYSCTL and MOUSE layer switch -}; - -// application selection -// this is sending ctrl-alt-gui-, and this is picked up by hammerspoon -#define AP_SLCK ALLM(KC_S) -#define AP_XCOD ALLM(KC_X) -#define AP_MSGR ALLM(KC_M) - -// keymaps -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* BASE - * the base of the keyboard. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |4x FLASH| | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |SYSCTL| | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |BEGIN |QWERTY| | | | - * ,------|------|------| |------+--------+------. - * | | |CARPAL| |Slack | | | - * |Backsp|LShift|------| |------| Enter |Space | - * | | |SYSCTL| |Msngr | | | - * `--------------------' `----------------------' - */ -[BASE] = LAYOUT_ergodox( - TD(TD_FLSH) ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,TG(BEGIN) ,TD(TD_LAYR) - ,TG(MOUSE) - ,KC_BSPC ,KC_LSFT ,TD(TD_LAYR) - - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,MO(SYSCTL) ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,TG(SYSCTL) ,KC_NO - ,AP_SLCK - ,AP_MSGR ,KC_ENT ,KC_SPC -), - -/* BEGIN - * a beginner's keymap i currently use. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | opt | | 6 | 7 | 8 | 9 | 0 | - | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | ; | Enter | - * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | ` | Cmd | | Cmd | | | | | ' | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `----------------------' - */ -[BEGIN] = LAYOUT_ergodox( - KC_TRNS ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_LALT -,KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC -,CTL_T(KC_ESC) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G -,KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_LPRN -,KC_TRNS ,KC_GRV ,KC_LGUI ,KC_LEFT ,KC_RIGHT - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS ,KC_EQL - ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_BSLS - ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_ENT - ,KC_RPRN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT - ,KC_TRNS ,KC_DOWN ,KC_TRNS ,KC_QUOT ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS -), - -/* QWERTY - * the default qwerty keymap. not really used, but i'll keep it here for now. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Q | W | E | R | T | | | | Y | U | I | O | P | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | A | S | D | F | G |------| |------| H | J | K | L | ; | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Z | X | C | V | B | | | | N | M | , | . | / | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `----------------------' - */ -[QWERTY] = LAYOUT_ergodox( - KC_TRNS ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_TRNS -,KC_TRNS ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_TRNS -,KC_TRNS ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G -,KC_TRNS ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_TRNS - ,KC_TRNS ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_TRNS - ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_TRNS - ,KC_TRNS ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS -), - -/* CARPALX - * the keymap i would like to transition to. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | | | RIGHT| 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Q | G | M | L | W | | | L1 | Y | F | U | B | ; | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | D | S | T | N | R |------| |------| I | A | E | O | H | | - * |--------+------+------+------+------+------| | | Meh |------+------+------+------+------+--------| - * | | Z | X | C | V | J | | | | K | P | , | . | / | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | Up | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[CARPALX] = LAYOUT_ergodox( - KC_TRNS ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_TRNS -,KC_TRNS ,KC_Q ,KC_G ,KC_M ,KC_L ,KC_W ,KC_TRNS -,KC_TRNS ,KC_D ,KC_S ,KC_T ,KC_N ,KC_R -,KC_TRNS ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_J ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_TRNS - ,KC_TRNS ,KC_Y ,KC_F ,KC_U ,KC_B ,KC_SCLN ,KC_TRNS - ,KC_I ,KC_A ,KC_E ,KC_O ,KC_H ,KC_TRNS - ,KC_TRNS ,KC_K ,KC_P ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS -), - -/* SYSCTL - * a keymap to control my system. - * - * ,--------------------------------------------------. ,------------------------------------------------------. - * | ^ | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+----------+------+------+--------| - * | | | | | | | | | | Mute | Home | Up | End | | | - * |--------+------+------+------+------+------| | | |------+------+----------+------+------+--------| - * | | | | | | |------| |------|VolUp | Left | Down |Right | | Lock | - * |--------+------+------+------+------+------| | | |------+------+----------+------+------+--------| - * | | | | | | | | | |VolDn | Prev |Play/Pause| Next | | Sleep | - * `--------+------+------+------+------+-------------' `-------------+------+----------+------+------+--------' - * | | | | | | | | | | | Power| - * `----------------------------------' `--------------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | ^ | | | | | - * `--------------------' `--------------------' - */ -[SYSCTL] = LAYOUT_ergodox( - KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_TRNS - - /*,KC_POP /// */,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - /* /// ,KC_PTRN*/,KC_NO ,KC_MUTE ,KC_HOME ,KC_UP ,KC_END ,KC_NO ,KC_NO - ,KC_VOLU ,KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_NO ,LCTL(LSFT(KC_PWR)) - ,KC_NO ,KC_VOLD ,KC_MPRV ,KC_MPLY ,KC_MNXT ,KC_NO ,KC_SLEP - ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_PWR - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO -), - -/* MOUSE - * a keymap to control my system. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ^ | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | MsUp | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| |MsLeft| MsDn |MsRght| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | |MidClk| - * ,------|------|------| |------+------+------. - * | | | | | |Left |Right | - * | | |------| |------| Click| Click| - * | | | ^ | | | | | - * `--------------------' `--------------------' - */ -[MOUSE] = LAYOUT_ergodox( - KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_TRNS - - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_MS_U ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO -), - -/* TEMPLATE - * keymap template with transparent and non-transparent keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `----------------------' - */ -/* -[TEMPLATE] = LAYOUT_ergodox( - KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS -), -[TEMPLATE] = LAYOUT_ergodox( - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO -), -*/ -}; - -// keyboard initialization -void matrix_init_user() { - ergodox_led_all_on(); - for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { - ergodox_led_all_set(i); - wait_ms(5); - } - wait_ms(1000); - for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { - ergodox_led_all_set(i); - wait_ms(10); - } - ergodox_led_all_off(); -} - -// light up leds based on the layer -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - switch(layer) { - case SYSCTL: - ergodox_right_led_3_on(); - break; - case MOUSE: - ergodox_right_led_2_on(); - break; - default: - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - break; - } -} - -// extra keys -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - } - return MACRO_NONE; -} - -// tap dances - -// flash keyboard on 4x tap, with leds -void flash_each_tap(qk_tap_dance_state_t *state, void *user_data) { - switch (state->count) { - case 1: - ergodox_right_led_3_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_1_on(); - break; - case 4: - ergodox_right_led_3_off(); - wait_ms(50); - ergodox_right_led_2_off(); - wait_ms(50); - ergodox_right_led_1_off(); - break; - } -} - -void flash_dance_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count >= 4) { - reset_keyboard(); - reset_tap_dance(state); - } -} - -void flash_dance_reset(qk_tap_dance_state_t *state, void *user_data) { - ergodox_right_led_1_off(); - wait_ms(50); - ergodox_right_led_2_off(); - wait_ms(50); - ergodox_right_led_3_off(); -} - -// SYSCTL on first tap, MOUSE ON second tap -void layers_dance_finished(qk_tap_dance_state_t *state, void *user_data) { - uint8_t layer = biton32(layer_state); - - switch(state->count) { - case 1: - switch(layer) { - case SYSCTL: - layer_off(SYSCTL); - break; - case MOUSE: - layer_off(MOUSE); - break; - default: - layer_on(SYSCTL); - break; - } - break; - case 2: - layer_on(MOUSE); - break; - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED( flash_each_tap, flash_dance_finished, flash_dance_reset ), - [TD_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, layers_dance_finished, NULL ), -}; diff --git a/layouts/community/ergodox/pvinis/rules.mk b/layouts/community/ergodox/pvinis/rules.mk deleted file mode 100644 index 87cbd93c2ba..00000000000 --- a/layouts/community/ergodox/pvinis/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -CONSOLE_ENABLE = no # for debugging - -SLEEP_LED_ENABLE = no # no led blinking while sleeping -NKRO_ENABLE = yes # disable for windows -TAP_DANCE_ENABLE = yes # tap-tap-tap - - diff --git a/layouts/community/ergodox/qwerty_code_friendly/keymap.c b/layouts/community/ergodox/qwerty_code_friendly/keymap.c index 43a1d1ad808..5f4ed3c19de 100644 --- a/layouts/community/ergodox/qwerty_code_friendly/keymap.c +++ b/layouts/community/ergodox/qwerty_code_friendly/keymap.c @@ -291,9 +291,9 @@ enum custom_keycodes { #define CFQ_KC_FN2 MO(2) #define CFQ_KC_FN3 MO(3) #else -#define CFQ_KC_FN1 KC_FN1 -#define CFQ_KC_FN2 KC_FN2 -#define CFQ_KC_FN3 KC_FN3 +#define CFQ_KC_FN1 TT(1) +#define CFQ_KC_FN2 TT(2) +#define CFQ_KC_FN3 TT(3) #endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -490,12 +490,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(LAYER_KPAD), /* FN1 - Momentary Layer 1 (KeyPad) */ - [2] = ACTION_LAYER_TAP_TOGGLE(LAYER_MDIA), /* FN2 - Momentary Layer 2 (Media, Mouse) */ - [3] = ACTION_LAYER_TAP_TOGGLE(LAYER_FKEY), /* FN3 - Momentary Layer 3 (FKey's & Words) */ -}; - #define WITHOUT_MODS(...) \ do { \ uint8_t _real_mods = get_mods(); \ diff --git a/layouts/community/ergodox/qwerty_code_friendly/readme.md b/layouts/community/ergodox/qwerty_code_friendly/readme.md index 9abd071b9b6..319ea50b9a3 100644 --- a/layouts/community/ergodox/qwerty_code_friendly/readme.md +++ b/layouts/community/ergodox/qwerty_code_friendly/readme.md @@ -6,8 +6,7 @@ The this layout is a normalized qwerty, with some configurable keys left thumb cluster so you can use it more as needed. -- Arrow keys follow VIM convention - (the media layer even uses arrow keys for HJKL). +- Arrow keys follow VIM convention. - On the top row only symbols are used (not numbers), it's expected the symbol layer's number-pad layout will be used for numbers. diff --git a/layouts/community/ergodox/reset_eeprom/keymap.c b/layouts/community/ergodox/reset_eeprom/keymap.c index c960af9cb93..83c252a9a18 100644 --- a/layouts/community/ergodox/reset_eeprom/keymap.c +++ b/layouts/community/ergodox/reset_eeprom/keymap.c @@ -60,28 +60,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - } - return MACRO_NONE; -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // dynamically generate these. diff --git a/layouts/community/ergodox/robot_test_layout/keymap.c b/layouts/community/ergodox/robot_test_layout/keymap.c index 5d672deeb99..07b294a9856 100644 --- a/layouts/community/ergodox/robot_test_layout/keymap.c +++ b/layouts/community/ergodox/robot_test_layout/keymap.c @@ -43,12 +43,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(1) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { diff --git a/layouts/community/ergodox/romanzolotarev-norman-osx/keymap.c b/layouts/community/ergodox/romanzolotarev-norman-osx/keymap.c index e024d5fb95f..caead7e160f 100644 --- a/layouts/community/ergodox/romanzolotarev-norman-osx/keymap.c +++ b/layouts/community/ergodox/romanzolotarev-norman-osx/keymap.c @@ -26,9 +26,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; }; diff --git a/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/keymap.c b/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/keymap.c index 1dd956bdad5..866aa22f934 100644 --- a/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/keymap.c +++ b/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/keymap.c @@ -16,7 +16,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_F1, KC_F2, KC_F3, KC_LALT, KC_LGUI, /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_FN1, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), TT(SYMB), // /*-*/ KC_F15, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, /*-*/ KC_BSLS, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /*-*/ /*-*/ /*-*/ KC_RGUI, KC_RALT, KC_F4, KC_F5, KC_F6, KC_MPLY, KC_MNXT, KC_MPRV, - KC_FN3, KC_QUOT, KC_SPC + TT(ARRW), KC_QUOT, KC_SPC ), [SYMB] = LAYOUT_ergodox( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -86,12 +86,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [SYMB] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Symbols Layer - [PLVR] = ACTION_LAYER_TAP_TOGGLE(PLVR), // FN2 - Momentary Plover Layer - [ARRW] = ACTION_LAYER_TAP_TOGGLE(ARRW), // FN3 - Momentary Arrows Layer -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/romanzolotarev-norman-plover-osx/keymap.c b/layouts/community/ergodox/romanzolotarev-norman-plover-osx/keymap.c index f8ae8a51d1a..08aad4f2264 100644 --- a/layouts/community/ergodox/romanzolotarev-norman-plover-osx/keymap.c +++ b/layouts/community/ergodox/romanzolotarev-norman-plover-osx/keymap.c @@ -16,7 +16,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_F1, KC_F2, KC_F3, KC_LALT, KC_LGUI, /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_FN1, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), TT(SYMB), // /*-*/ KC_F15, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, /*-*/ KC_BSLS, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /*-*/ /*-*/ /*-*/ KC_RGUI, KC_RALT, KC_F4, KC_F5, KC_F6, KC_MPLY, KC_MNXT, KC_MPRV, - KC_FN3, KC_QUOT, KC_SPC + TT(ARRW), KC_QUOT, KC_SPC ), [SYMB] = LAYOUT_ergodox( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -86,12 +86,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [SYMB] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Symbols Layer - [PLVR] = ACTION_LAYER_TAP_TOGGLE(PLVR), // FN2 - Momentary Plover Layer - [ARRW] = ACTION_LAYER_TAP_TOGGLE(ARRW), // FN3 - Momentary Arrows Layer -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/keymap.c b/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/keymap.c index d0b7520c310..ffa106f7058 100644 --- a/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/keymap.c +++ b/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/keymap.c @@ -46,9 +46,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; }; diff --git a/layouts/community/ergodox/sethbc/keymap.c b/layouts/community/ergodox/sethbc/keymap.c index 7f142a9760c..26d3106ec4b 100644 --- a/layouts/community/ergodox/sethbc/keymap.c +++ b/layouts/community/ergodox/sethbc/keymap.c @@ -69,9 +69,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/layouts/community/ergodox/siroken3/keymap.c b/layouts/community/ergodox/siroken3/keymap.c index e8e12238737..98422b440a6 100644 --- a/layouts/community/ergodox/siroken3/keymap.c +++ b/layouts/community/ergodox/siroken3/keymap.c @@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_LGUI, MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_LANG2, KC_ENT @@ -138,10 +138,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/sneako/keymap.c b/layouts/community/ergodox/sneako/keymap.c index 98f3469fced..5add317e16b 100644 --- a/layouts/community/ergodox/sneako/keymap.c +++ b/layouts/community/ergodox/sneako/keymap.c @@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_LALT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -138,10 +138,6 @@ LAYOUT_ergodox( ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/software_neo2/keymap.c b/layouts/community/ergodox/software_neo2/keymap.c index 925caa01618..7ec4f7b8382 100644 --- a/layouts/community/ergodox/software_neo2/keymap.c +++ b/layouts/community/ergodox/software_neo2/keymap.c @@ -95,10 +95,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - /* [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) */ -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/supercoder/keymap.c b/layouts/community/ergodox/supercoder/keymap.c index a42937bd6be..3aa34a8e42d 100644 --- a/layouts/community/ergodox/supercoder/keymap.c +++ b/layouts/community/ergodox/supercoder/keymap.c @@ -58,9 +58,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; diff --git a/layouts/community/ergodox/swedish-lindhe/keymap.c b/layouts/community/ergodox/swedish-lindhe/keymap.c index e977ab99487..71ccba24148 100644 --- a/layouts/community/ergodox/swedish-lindhe/keymap.c +++ b/layouts/community/ergodox/swedish-lindhe/keymap.c @@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, KC_H, KC_J, KC_K, KC_L, NO_OSLH, NO_AE, KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSFT, - NO_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, + KC_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_TAB, LT(MDIA, KC_ENT) @@ -154,10 +154,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/layouts/community/ergodox/swedish/keymap.c b/layouts/community/ergodox/swedish/keymap.c index d2b9b40d1f6..987f2c6afd5 100644 --- a/layouts/community/ergodox/swedish/keymap.c +++ b/layouts/community/ergodox/swedish/keymap.c @@ -75,8 +75,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, KC_H, KC_J, KC_K, KC_L, LT(MDIA, NO_OSLH), GUI_T(NO_AE), MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(NO_MINS), KC_RSFT, - KC_UP, KC_DOWN, NO_CIRC, NO_ASTR, KC_FN1, - NO_ALGR, CTL_T(KC_ESC), + KC_UP, KC_DOWN, NO_CIRC, NO_ASTR, TT(SYMB), + KC_ALGR, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT ), @@ -167,10 +167,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/swissgerman/keymap.c b/layouts/community/ergodox/swissgerman/keymap.c index 0288c955b5d..b32fa4c2a42 100644 --- a/layouts/community/ergodox/swissgerman/keymap.c +++ b/layouts/community/ergodox/swissgerman/keymap.c @@ -82,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,ALT_T(KC_DOT), CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_RALT,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_RALT,KC_RBRC, TT(SYMB), KC_LALT,CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -172,10 +172,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/techtomas/keymap.c b/layouts/community/ergodox/techtomas/keymap.c index 361583a0df8..07228c4c067 100644 --- a/layouts/community/ergodox/techtomas/keymap.c +++ b/layouts/community/ergodox/techtomas/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, MEH_T(KC_BSLS), KC_H, KC_J, KC_K, KC_L, LT(APP,KC_SCLN), ALL_T(KC_QUOT), S(KC_TAB), KC_N, KC_M, KC_COMM, KC_DOT, LT(APP,KC_SLSH), KC_RSFT, - KC_RGUI, KC_UP, KC_DOWN, KC_FN3, KC_FN1, + KC_RGUI, KC_UP, KC_DOWN, TT(CNTL), TT(SYMB), LALT(KC_LGUI), S(KC_LGUI), LT(APP,KC_PGUP), LT(SYMB,KC_PGDN), KC_ENT, KC_SPC @@ -177,12 +177,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), - [2] = ACTION_LAYER_TAP_TOGGLE(APP), - [3] = ACTION_LAYER_TAP_TOGGLE(CNTL) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/teckinesis/readme.md b/layouts/community/ergodox/teckinesis/readme.md index 6804bb06f6d..d9b22742c9b 100644 --- a/layouts/community/ergodox/teckinesis/readme.md +++ b/layouts/community/ergodox/teckinesis/readme.md @@ -1,6 +1,6 @@ # teckinesis Layout -*A blend of TECK and Kinesis layouts, based on ["The Ordinary Layout" by Nicholas Keene](http://qmk.fm/keyboards/ergodox_ez/keymaps/ordinary/#the-ordinary-layout-a-familiar-and-powerful-layout)* +*A blend of TECK and Kinesis layouts, based on ["The Ordinary Layout" by Nicholas Keene](/layouts/community/ergodox/ordinary)* I love "The Ordinary Layout", but I still use a [TECK](https://www.trulyergonomic.com/store/index.php) at the office, and I found the transition back and forth to be a bit more difficult than I expected. diff --git a/layouts/community/ergodox/tkuichooseyou/keymap.c b/layouts/community/ergodox/tkuichooseyou/keymap.c index 0a94b520528..4dbf8be585f 100644 --- a/layouts/community/ergodox/tkuichooseyou/keymap.c +++ b/layouts/community/ergodox/tkuichooseyou/keymap.c @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MEH_T(KC_NO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), KC_DELT, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT @@ -135,10 +135,6 @@ LAYOUT_ergodox( ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/tm2030/keymap.c b/layouts/community/ergodox/tm2030/keymap.c index fa919b5d88a..1259a18ff26 100644 --- a/layouts/community/ergodox/tm2030/keymap.c +++ b/layouts/community/ergodox/tm2030/keymap.c @@ -194,9 +194,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/tm2030/readme.md b/layouts/community/ergodox/tm2030/readme.md index 23746ddb76e..fce0c46e7d4 100644 --- a/layouts/community/ergodox/tm2030/readme.md +++ b/layouts/community/ergodox/tm2030/readme.md @@ -55,7 +55,7 @@ As on the original TM 2030, when `num` layer is activated, holding `fn` disables ## Dvorak Layer Same as Layer 0 but with _Dvorak_ layout, to use with QWERTY OS layout. -Enable Dvorak layout with [`Magic`](/TMK_readme.md#magic-commands)+`1` (`LShift`+`RShift`+`1`), disable with `Magic`-`0`. +Enable Dvorak layout with [`Magic`](/docs/feature_bootmagic.md)+`1` (`LShift`+`RShift`+`1`), disable with `Magic`-`0`. The middle (green) led indicates when the Dvorak layer is activated. diff --git a/layouts/community/ergodox/tonyabra_osx/keymap.c b/layouts/community/ergodox/tonyabra_osx/keymap.c index d0b5c5d9c12..4f174a69de7 100644 --- a/layouts/community/ergodox/tonyabra_osx/keymap.c +++ b/layouts/community/ergodox/tonyabra_osx/keymap.c @@ -135,10 +135,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/ergodox/twentylives_dvorak_with_hebrew/keymap.c b/layouts/community/ergodox/twentylives_dvorak_with_hebrew/keymap.c index 909127ad4fb..6bca1831623 100644 --- a/layouts/community/ergodox/twentylives_dvorak_with_hebrew/keymap.c +++ b/layouts/community/ergodox/twentylives_dvorak_with_hebrew/keymap.c @@ -173,10 +173,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(1) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { diff --git a/layouts/community/ergodox/twey/keymap.c b/layouts/community/ergodox/twey/keymap.c index 9ee318a5dd0..0cc98ca77b8 100644 --- a/layouts/community/ergodox/twey/keymap.c +++ b/layouts/community/ergodox/twey/keymap.c @@ -183,10 +183,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(MDIA) // FN1 - Momentary Layer 3 (Media) -}; - // press `key`, but deactivate `layer` whilst it's held void press_without(int pressed, int key, uint8_t layer) { diff --git a/layouts/community/ergodox/win10_writers-block/config.h b/layouts/community/ergodox/win10_writers-block/config.h index ed6170369e0..b0b4a1ebb96 100644 --- a/layouts/community/ergodox/win10_writers-block/config.h +++ b/layouts/community/ergodox/win10_writers-block/config.h @@ -3,10 +3,10 @@ #include QMK_KEYBOARD_CONFIG_H -#undef MOUSEKEY_DELAY -#undef MOUSEKEY_INTERVAL -#undef MOUSEKEY_MAX_SPEED -#undef MOUSEKEY_TIME_TO_MAX +#undef MOUSEKEY_DELAY +#undef MOUSEKEY_INTERVAL +#undef MOUSEKEY_MAX_SPEED +#undef MOUSEKEY_TIME_TO_MAX #define MOUSEKEY_DELAY 100 #define MOUSEKEY_INTERVAL 20 @@ -28,8 +28,8 @@ /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ + get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ ) #endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */ diff --git a/layouts/community/ergodox/workman_osx_mdw/keymap.c b/layouts/community/ergodox/workman_osx_mdw/keymap.c index d0f3882fa86..81fd3984b37 100644 --- a/layouts/community/ergodox/workman_osx_mdw/keymap.c +++ b/layouts/community/ergodox/workman_osx_mdw/keymap.c @@ -188,7 +188,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) [2] = ACTION_LAYER_ON(BASE,0), // FN2 - Go back to the base layer [3] = ACTION_LAYER_ON(DEAD,0), [4] = ACTION_LAYER_TOGGLE(DEAD), diff --git a/layouts/community/ergodox/xyverz/keymap.c b/layouts/community/ergodox/xyverz/keymap.c index 2e4b1e797ec..eeeded47fcf 100644 --- a/layouts/community/ergodox/xyverz/keymap.c +++ b/layouts/community/ergodox/xyverz/keymap.c @@ -31,11 +31,6 @@ extern keymap_config_t keymap_config; #define QWERTY M(_QW) #define COLEMAK M(_CM) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0 : Dvorak @@ -250,10 +245,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - -}; - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); diff --git a/layouts/community/ergodox/yoruian/keymap.c b/layouts/community/ergodox/yoruian/keymap.c index 367fe3c097b..b304fa07041 100644 --- a/layouts/community/ergodox/yoruian/keymap.c +++ b/layouts/community/ergodox/yoruian/keymap.c @@ -37,9 +37,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TR, TR, TR, TR, TR, TR), }; -const uint16_t PROGMEM fn_actions[] = { -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; }; diff --git a/layouts/community/ergodox/zweihander-macos/keymap.c b/layouts/community/ergodox/zweihander-macos/keymap.c index b4a9efb3ee0..f64808c4d27 100644 --- a/layouts/community/ergodox/zweihander-macos/keymap.c +++ b/layouts/community/ergodox/zweihander-macos/keymap.c @@ -137,10 +137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/layouts/community/numpad_5x6/bjohnson/config.h b/layouts/community/numpad_5x6/bjohnson/config.h new file mode 100644 index 00000000000..fe2cffec785 --- /dev/null +++ b/layouts/community/numpad_5x6/bjohnson/config.h @@ -0,0 +1,25 @@ +#pragma once + +// #define B6_AUDIO + +#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) +#define RGB_DI_PIN B7 +#define RGBLED_NUM 16 // Number of LEDs +#define RGBLIGHT_ANIMATIONS + +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_VAL_STEP 12 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 + +#define RGBLIGHT_SLEEP +#endif // RGBLIGHT_ENABLE + +#ifdef AUDIO_ENABLE +#ifdef RGBLIGHT_ENABLE +#define NO_MUSIC_MODE +#endif // RGBLIGHT_ENABLE +#endif // AUDIO_ENABLE +#define TAP_CODE_DELAY 10 diff --git a/layouts/community/numpad_5x6/bjohnson/keymap.c b/layouts/community/numpad_5x6/bjohnson/keymap.c new file mode 100644 index 00000000000..79e87e69f4c --- /dev/null +++ b/layouts/community/numpad_5x6/bjohnson/keymap.c @@ -0,0 +1,51 @@ +#include QMK_KEYBOARD_H + +extern rgblight_config_t rgblight_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_numpad_5x6( + KC_F1, LT(1,KC_F2), KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_F3, KC_F4, KC_P7, KC_P8, KC_P9, + KC_F5, KC_F6, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_F7, KC_F8, KC_P1, KC_P2, KC_P3, + KC_F9, KC_F10, KC_P0, KC_PDOT, KC_PENT + ), + [1] = LAYOUT_numpad_5x6( + RGB_TOG, _______, _______, _______, _______, RESET, + RGB_MOD, RGB_RMOD, _______, _______, _______, + RGB_HUI, RGB_HUD, _______, _______, _______, _______, + RGB_SAI, RGB_SAD, _______, _______, _______, + RGB_VAI, RGB_VAD, _______, _______, _______ + ), +}; + + +void keyboard_post_init_user(void) { +#ifdef RGBLIGHT_ENABLE + uint8_t temp_mode = rgblight_config.mode; + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 360; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + 180) % 360, 255, 255); + wait_ms(8); + } + led_set_user(host_keyboard_leds()); + rgblight_mode_noeeprom(temp_mode); +#endif +} + +void led_set_user(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + rgblight_sethsv_noeeprom_cyan(); + } else { + rgblight_sethsv_noeeprom_magenta(); + } +} + +void shutdown_user (void) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_setrgb_red(); + #endif // RGBLIGHT_ENABLE +} diff --git a/layouts/community/numpad_5x6/bjohnson/rules.mk b/layouts/community/numpad_5x6/bjohnson/rules.mk new file mode 100644 index 00000000000..d370da7f1b3 --- /dev/null +++ b/layouts/community/numpad_5x6/bjohnson/rules.mk @@ -0,0 +1,5 @@ +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = no +NO_SECRETS = yes +BOOTMAGIC_ENABLE = lite diff --git a/layouts/community/numpad_5x6/drashna/config.h b/layouts/community/numpad_5x6/drashna/config.h new file mode 100644 index 00000000000..2fc5ab65882 --- /dev/null +++ b/layouts/community/numpad_5x6/drashna/config.h @@ -0,0 +1,19 @@ +#pragma once + +// #define B6_AUDIO + +#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) +# define RGB_DI_PIN B1 +# define RGBLED_NUM 16 // Number of LEDs + +# define RGBLIGHT_HUE_STEP 12 +# define RGBLIGHT_SAT_STEP 12 +# define RGBLIGHT_VAL_STEP 12 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#endif // RGBLIGHT_ENABLE + +#if defined(KEYBOARD_primekb_prime_m) +# undef PRODUCT +# define PRODUCT Drashna Hacked Prime_M Macro Pad +#endif diff --git a/layouts/community/numpad_5x6/drashna/keymap.c b/layouts/community/numpad_5x6/drashna/keymap.c new file mode 100644 index 00000000000..81710221d38 --- /dev/null +++ b/layouts/community/numpad_5x6/drashna/keymap.c @@ -0,0 +1,24 @@ +#include QMK_KEYBOARD_H +#include "drashna.h" + +#define F2_MCRO LT(_GAMEPAD, KC_F2) + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NUMLOCK] = LAYOUT_numpad_5x6( + KC_F1, F2_MCRO, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_F3, KC_F4, KC_P7, KC_P8, KC_P9, + KC_F5, KC_F6, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_F7, KC_F8, KC_P1, KC_P2, KC_P3, + KC_F9, KC_COLN, KC_P0, KC_PDOT, KC_PENT + ), + + [_GAMEPAD] = LAYOUT_numpad_5x6( + RGB_TOG, _______, _______, EEP_RST, KC_MAKE, RESET, + RGB_MOD, RGB_RMOD, _______, _______, _______, + RGB_HUI, RGB_HUD, _______, _______, _______, _______, + RGB_SAI, RGB_SAD, _______, _______, _______, + RGB_VAI, RGB_VAD, _______, _______, _______ + ), +}; +// clang-format on diff --git a/layouts/community/numpad_5x6/drashna/rules.mk b/layouts/community/numpad_5x6/drashna/rules.mk new file mode 100644 index 00000000000..62bbc365d17 --- /dev/null +++ b/layouts/community/numpad_5x6/drashna/rules.mk @@ -0,0 +1,10 @@ +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = no +NO_SECRETS = yes +BOOTMAGIC_ENABLE = lite +INDICATOR_LIGHTS = no +RGBLIGHT_TWINKLE = yes +MACROS_ENABLED = no +MAKE_BOOTLOADER = yes +RGBLIGHT_STARTUP_ANIMATION = yes diff --git a/layouts/community/numpad_5x6/layout.json b/layouts/community/numpad_5x6/layout.json new file mode 100644 index 00000000000..7264cd5a6dc --- /dev/null +++ b/layouts/community/numpad_5x6/layout.json @@ -0,0 +1,6 @@ +["","","",""], +[{y:0.5},"","","",""], +["","","",{h:2},""], +["","",""], +["","","",{h:2},""], +[{w:2},"",""] diff --git a/layouts/community/numpad_5x6/readme.md b/layouts/community/numpad_5x6/readme.md new file mode 100644 index 00000000000..147097c8371 --- /dev/null +++ b/layouts/community/numpad_5x6/readme.md @@ -0,0 +1,3 @@ +# numpad_5x6 + + LAYOUT_numpad_5x6 diff --git a/layouts/community/ortho_1x4/belgorath/keymap.c b/layouts/community/ortho_1x4/belgorath/keymap.c new file mode 100644 index 00000000000..ace40229570 --- /dev/null +++ b/layouts/community/ortho_1x4/belgorath/keymap.c @@ -0,0 +1,24 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _DEFAULT 0 +#define _LOWER 1 +#define LOWER LT(_LOWER, KC_PENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_DEFAULT] = LAYOUT_ortho_1x4 ( + LOWER, KC_P0, KC_PDOT,KC_PAST +), + +/* Lower */ +[_LOWER] = LAYOUT_ortho_1x4 ( + _______,_______,_______,_______ +), +}; diff --git a/layouts/community/ortho_1x4/layout.json b/layouts/community/ortho_1x4/layout.json new file mode 100644 index 00000000000..6103c7e2489 --- /dev/null +++ b/layouts/community/ortho_1x4/layout.json @@ -0,0 +1 @@ +["","","",""] \ No newline at end of file diff --git a/layouts/community/ortho_3x10/wanleg/config.h b/layouts/community/ortho_3x10/wanleg/config.h index 6719a4591eb..dc22454481e 100644 --- a/layouts/community/ortho_3x10/wanleg/config.h +++ b/layouts/community/ortho_3x10/wanleg/config.h @@ -2,8 +2,25 @@ //QMK DFU settings (ProMicro boards) // set top left key as bootloader mode escape key on Gherkin -#if defined(KEYBOARD_gherkin) +#if defined(KEYBOARD_40percentclub_gherkin) && !defined(FLIP) #define QMK_LED B0 #define QMK_ESC_OUTPUT B4 // usually COL #define QMK_ESC_INPUT F7 // usually ROW #endif + +//change gherkin orientation (i.e. move USB port from right side to left side) +#if defined(KEYBOARD_40percentclub_gherkin) && defined(FLIP) +//need to fix QMKdfu setting: +#define QMK_ESC_OUTPUT B6 // usually COL +#define QMK_ESC_INPUT D0 // usually ROW +#define QMK_LED B0 + +//need to undefine standard 4x4 array before defining alternate ProMicro array +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS +//standard config: +//#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +//#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } +#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } +#define MATRIX_COL_PINS { D0, D4, C6, D7, E6, B4 } +#endif diff --git a/layouts/community/ortho_3x10/wanleg/keymap.c b/layouts/community/ortho_3x10/wanleg/keymap.c index 44be300a417..96d36eb3126 100644 --- a/layouts/community/ortho_3x10/wanleg/keymap.c +++ b/layouts/community/ortho_3x10/wanleg/keymap.c @@ -26,4 +26,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________Gherkin_ETC_2_______________ ), +[_FN] = LAYOUT_ortho_3x10_wrapper( + _______________Gherkin_FN_0________________, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), }; diff --git a/layouts/community/ortho_3x10/wanleg/readme.md b/layouts/community/ortho_3x10/wanleg/readme.md index 8696cccf6bf..255e19c2a49 100644 --- a/layouts/community/ortho_3x10/wanleg/readme.md +++ b/layouts/community/ortho_3x10/wanleg/readme.md @@ -1,4 +1,4 @@ -![Gherkin Wanleg Layout Image](https://i.imgur.com/nCPog2W.png) +![Gherkin Wanleg Layout Image](https://i.imgur.com/iNkR90W.png) # Gherkin Wanleg Layout This is the layout I came up with to preserve a standard QWERTY 104 key ANSI layout as much as possible, in as few layers as possible for a 30 key board. Here are the two Tap Dance keys I've set up for this board: @@ -47,9 +47,9 @@ The instructions below have been adapted from https://www.reddit.com/r/olkb/comm | Arduino | ProMicro | | --- | --- | | 10 | RST | -| 11 | 16 | -| 12 | 14 | -| 13 | 15 | +| 11 (MOSI) | 16 | +| 12 (MISO) | 14 | +| 13 (SCK) | 15 | | GND | GND | | 5V | VCC | diff --git a/layouts/community/ortho_3x10/wanleg/rules.mk b/layouts/community/ortho_3x10/wanleg/rules.mk index 90841d2abed..efd11f7f80a 100644 --- a/layouts/community/ortho_3x10/wanleg/rules.mk +++ b/layouts/community/ortho_3x10/wanleg/rules.mk @@ -1,3 +1 @@ -SWAP_HANDS_ENABLE = no - BOOTLOADER = qmk-dfu \ No newline at end of file diff --git a/layouts/community/ortho_4x12/bakingpy/config.h b/layouts/community/ortho_4x12/bakingpy/config.h index a90f38001a0..a153adffb6f 100644 --- a/layouts/community/ortho_4x12/bakingpy/config.h +++ b/layouts/community/ortho_4x12/bakingpy/config.h @@ -1,20 +1,16 @@ #pragma once -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C +#define USE_I2C /* Select hand configuration */ -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS +//#define MASTER_RIGHT #define TAPPING_TERM 150 #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 +#define RGBLED_NUM 12 +#define RGBLED_SPLIT { 6, 6 } #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 diff --git a/layouts/community/ortho_4x12/bakingpy/keymap.c b/layouts/community/ortho_4x12/bakingpy/keymap.c index e71e5d5d2c2..71672d05134 100644 --- a/layouts/community/ortho_4x12/bakingpy/keymap.c +++ b/layouts/community/ortho_4x12/bakingpy/keymap.c @@ -2,18 +2,18 @@ extern keymap_config_t keymap_config; -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 +#define _MAC 0 +#define _WINDOWS 1 +#define _TESTMODE 2 #define _LOWER 3 #define _RAISE 4 #define _FKEYS 5 #define _ADJUST 16 enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, + MAC = SAFE_RANGE, + WINDOWS, + TESTMODE, LOWER, RAISE, ADJUST, @@ -21,7 +21,6 @@ enum custom_keycodes { }; #define KC_ KC_TRNS -#define _______ KC_TRNS #define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen #define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen @@ -34,11 +33,11 @@ enum custom_keycodes { #define KC_ENTS MT(MOD_LSFT, KC_ENT) #define KC_BL_S BL_STEP #define KC_BL_T BL_TOGG -#define KC_ALLS PLAY_ALLSTAR +#define KC_RMOD RGB_MOD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc_ortho_4x12( + [_MAC] = LAYOUT_kc_ortho_4x12( //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ @@ -50,33 +49,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ ), - [_COLEMAK] = LAYOUT_kc_ortho_4x12( + [_WINDOWS] = LAYOUT_kc_ortho_4x12( //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ - TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - ESCC, A , R , S , T , D , H , N , E , I , O ,QUOT, + ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH,ENTS, + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS, //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT + GRVF,LALT,LGUI,LCTL,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ ), - [_DVORAK] = LAYOUT_kc_ortho_4x12( + [_TESTMODE] = LAYOUT_kc_ortho_4x12( //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - ESCC, A , O , E , U , I , D , H , T , N , S ,SLSH, + RMOD,BL_S, S , D , F , G , RMOD,BL_S, K , L ,SCLN,QUOT, //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - LSFT,SCLN, Q , J , K , X , B , M , W , V , Z ,ENTS, + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS, //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT + GRVF,LALT,LGUI,LCTL,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ ), [_LOWER] = LAYOUT_kc_ortho_4x12( //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ - ALLS, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ @@ -123,7 +122,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = LAYOUT_ortho_4x12( \ _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, MAC, WINDOWS, TESTMODE,_______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) @@ -131,13 +130,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float all_star_song[][2] = SONG(ALL_STAR); -#endif - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); @@ -145,30 +137,21 @@ void persistent_default_layer_set(uint16_t default_layer) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case QWERTY: + case MAC: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); + persistent_default_layer_set(1UL<<_MAC); } return false; break; - case COLEMAK: + case WINDOWS: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); + persistent_default_layer_set(1UL<<_WINDOWS); } return false; break; - case DVORAK: + case TESTMODE: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); + persistent_default_layer_set(1UL<<_TESTMODE); } return false; break; @@ -200,15 +183,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case PLAY_ALLSTAR: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(all_star_song); - SEND_STRING("Hey now, you're an all-star, get your game on, go play. Hey now, you're a rock star, get the show on, get paid. All that glitters is gold. Only shooting stars break the mold."); - #endif - } - return false; - break; } return true; } diff --git a/layouts/community/ortho_4x12/bakingpy/rules.mk b/layouts/community/ortho_4x12/bakingpy/rules.mk index 490ebbf7793..17a589cd1d6 100644 --- a/layouts/community/ortho_4x12/bakingpy/rules.mk +++ b/layouts/community/ortho_4x12/bakingpy/rules.mk @@ -1,10 +1,13 @@ -# Enable RGB if not a Planck -ifeq ($(LAYOUTS_HAS_RGB),yes) +ifneq ($(LAYOUTS_HAS_RGB), no) RGBLIGHT_ENABLE = yes endif AUDIO_ENABLE = no ifeq ($(strip $(KEYBOARD)), zlant) BACKLIGHT_ENABLE = no +else ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) + BACKLIGHT_ENABLE = no +else ifneq (, $(findstring lets_split, $(KEYBOARD))) + BACKLIGHT_ENABLE = no else BACKLIGHT_ENABLE = yes endif diff --git a/layouts/community/ortho_4x12/bredfield/config.h b/layouts/community/ortho_4x12/bredfield/config.h new file mode 100644 index 00000000000..9065e41396d --- /dev/null +++ b/layouts/community/ortho_4x12/bredfield/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define TAPPING_TERM 200 +#define PERMISSIVE_HOLD \ No newline at end of file diff --git a/layouts/community/ortho_4x12/bredfield/keymap.c b/layouts/community/ortho_4x12/bredfield/keymap.c new file mode 100644 index 00000000000..78fa8c89f19 --- /dev/null +++ b/layouts/community/ortho_4x12/bredfield/keymap.c @@ -0,0 +1,175 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Keymap layers +enum layer_names { + _BASE_LAYER, + _RAISE_LAYER, + _LOWER_LAYER, + _NUMPAD_LAYER, + _NAVIGATION_LAYER, + _UI_LAYER, + _KEYBOARD_LAYER, +}; + +// Layer switches aliases +#define L_LOWER MO(_LOWER_LAYER) +#define L_RAISE MO(_RAISE_LAYER) +#define L_NUMPAD MO(_NUMPAD_LAYER) +#define L_UI MO(_UI_LAYER) +#define L_KEYBD MO(_KEYBOARD_LAYER) +#define SCL_NAV LT(_NAVIGATION_LAYER, KC_SCLN) +#define SFT_MIN MT(MOD_RSFT, KC_MINS) +#define SFT_ENT KC_SFTENT + +// GUI chords +#define GUI_1 LGUI(KC_1) +#define GUI_2 LGUI(KC_2) +#define GUI_3 LGUI(KC_3) +#define GUI_4 LGUI(KC_4) +#define GUI_5 LGUI(KC_5) +#define GUI_6 LGUI(KC_6) +#define GUI_7 LGUI(KC_7) +#define GUI_8 LGUI(KC_8) +#define GUI_9 LGUI(KC_9) +#define GUI_0 LGUI(KC_0) +#define GUI_MIN LGUI(KC_MINS) +#define GUI_EQL LGUI(KC_EQL) +#define GUI_LBR LGUI(KC_LBRC) +#define GUI_RBR LGUI(KC_RBRC) +#define GUI_ENT LGUI_T(KC_ENT) +#define GUI_ESC LGUI_T(KC_ESC) +#define GUI_TAB LGUI(KC_TAB) // application toggle +#define GUI_GRV LGUI(KC_GRV) // window toggle +#define GUI_SSF LGUI(LSFT(KC_3)) // Full screen shot +#define GUI_SST LGUI(LSFT(KC_4)) // Targetted screen shot + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | GUI/Esc| A | S | D | F | G | H | J | K | L | ;/nav | " | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/ent| + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | Numpad | Ctrl | Alt | GUI | Lower | Bksp | Space | Raise | Ctrl | Alt | UI | Keybd | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_BASE_LAYER] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + GUI_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SCL_NAV, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, + L_NUMPAD,KC_LCTL, KC_LALT, KC_LGUI, L_LOWER, KC_BSPC, KC_SPACE,L_RAISE, KC_RCTRL,KC_RALT, L_UI, L_KEYBD +), + +/* Lower + * ,-----------------------------------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | ^ | & | * | + | = | - | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | , | . | / | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | Del | | | | | | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_LOWER_LAYER] = LAYOUT_ortho_4x12( + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_PLUS, KC_EQL, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | _ | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | { | [ | ( | < | > | ) | ] | } | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | Del | | | | | | | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_RAISE_LAYER] = LAYOUT_ortho_4x12( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_7, KC_F8, KC_F9, KC_F10, KC_UNDS, + _______, XXXXXXX, KC_LCBR, KC_LBRC, KC_LPRN, KC_LABK, KC_RABK, KC_RPRN, KC_RBRC, KC_RCBR, XXXXXXX, KC_PIPE, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______ +), + +/* Numpad + * ,-----------------------------------------------------------------------------------------------------------. + * | | | | | | | | 7 | 8 | 9 | * | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | 4 | 5 | 6 | - | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | 1 | 2 | 3 | + | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | 0 | . | / | | | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_NUMPAD_LAYER] = LAYOUT_ortho_4x12( + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, KC_ASTR, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_MINS, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_PLUS, _______, + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_SLSH, _______, _______ +), + +/* Navigation + * ,-----------------------------------------------------------------------------------------------------------. + * | | | | | | | | Home | Up | End | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | Left | Down | Right | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | Enter | | | Del | | | | | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_NAVIGATION_LAYER] = LAYOUT_ortho_4x12( + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, KC_ENT, _______, _______, KC_DEL, _______, _______, _______, _______ +), + +/* UI + * ,--------------------------------------------------------------------------------+--------+-----------------. + * | GUI Tab| | | | | | | | | GUI - | GUI = | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | GUI ` | GUI 1 | GUI 2 | GUI 3 | GUI 4 | GUI 5 | GUI 6 | GUI 7 | | GUI [ | GUI ] | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------------------------+--------| + * | |Full SS | Area SS| | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | Prev | Play | Next | Bri - | | | Bri + | Mute | Vol - | Vol + | | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_UI_LAYER] = LAYOUT_ortho_4x12( + GUI_TAB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, GUI_MIN, GUI_EQL, XXXXXXX, + GUI_GRV, GUI_1, GUI_2, GUI_3, GUI_4, GUI_5, GUI_6, GUI_7, XXXXXXX, GUI_LBR, GUI_RBR, XXXXXXX, + _______, GUI_SSF, GUI_SST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_MRWD, KC_MPLY, KC_MFFD, KC_VOLD, KC_MUTE, KC_MUTE, KC_VOLU, _______, _______, _______, _______ +), + +/* Keyboard + * ,--------------------------------------------------------------------------------+--------+-----------------. + * | | | | | | | | | | | | RESET | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | DEBUG | + * |--------+--------+--------+--------+--------+-----------------+--------+--------------------------+--------| + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_KEYBOARD_LAYER] = LAYOUT_ortho_4x12( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______ +), +}; \ No newline at end of file diff --git a/layouts/community/ortho_4x12/bredfield/readme.md b/layouts/community/ortho_4x12/bredfield/readme.md new file mode 100644 index 00000000000..e0f6e3f55ea --- /dev/null +++ b/layouts/community/ortho_4x12/bredfield/readme.md @@ -0,0 +1,105 @@ +# bredfield's 4x12 Ortho Keymap + +## Overview +This is the layout that I use for all 4x12 boards, for writing and programming. + +- Works with planck or split style boards +- Split spacebar; left position is backspace, which frees up the typical key for minus/undersc +- Targets mac os; linux variant to come +- Navigation layer is triggered via the `;` key, allowing for single-hand navigation without leaving the home row +- Brackets are located on the home row on raise, which is comfortable when programming +- Reduced mod / layer tap use, to avoid input lag +- LEDs are overrated + +## Layers +### Main +``` + * ,-----------------------------------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | GUI/Esc| A | S | D | F | G | H | J | K | L | ;/nav | " | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/ent| + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | Numpad | Ctrl | Alt | GUI | Lower | Bksp | Space | Raise | Ctrl | Alt | UI | Keybd | + * `-----------------------------------------------------------------------------------------------------------' + ``` + + ### Lower + ``` + * ,-----------------------------------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | ^ | & | * | + | = | - | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | , | . | / | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | Del | | | | | | | + * `-----------------------------------------------------------------------------------------------------------' +``` + +### Raise +``` + * ,-----------------------------------------------------------------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | _ | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | { | [ | ( | < | > | ) | ] | } | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | Del | | | | | | | + * `-----------------------------------------------------------------------------------------------------------' +``` + +### Numpad +``` + * ,-----------------------------------------------------------------------------------------------------------. + * | | | | | | | | 7 | 8 | 9 | * | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | 4 | 5 | 6 | - | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | 1 | 2 | 3 | + | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | 0 | . | / | | | + * `-----------------------------------------------------------------------------------------------------------' + ``` + +### Navigation +``` + * ,-----------------------------------------------------------------------------------------------------------. + * | | | | | | | | Home | Up | End | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | Left | Down | Right | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | Enter | | | Del | | | | | + * `-----------------------------------------------------------------------------------------------------------' +``` + +### UI +``` + * ,--------------------------------------------------------------------------------+--------+-----------------. + * | GUI Tab| | | | | | | | | GUI - | GUI = | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | GUI ` | GUI 1 | GUI 2 | GUI 3 | GUI 4 | GUI 5 | GUI 6 | GUI 7 | | GUI [ | GUI ] | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------------------------+--------| + * | |Full SS | Area SS| | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | Prev | Play | Next | Bri - | | | Bri + | Mute | Vol - | Vol + | | + * `-----------------------------------------------------------------------------------------------------------' +``` + +### Keyboard +``` + * ,--------------------------------------------------------------------------------+--------+-----------------. + * | | | | | | | | | | | | RESET | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | DEBUG | + * |--------+--------+--------+--------+--------+-----------------+--------+--------------------------+--------| + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------------------------------' + */ + ``` \ No newline at end of file diff --git a/layouts/community/ortho_4x12/buswerks/config.h b/layouts/community/ortho_4x12/buswerks/config.h index 1498cae744c..8d6e26287e0 100644 --- a/layouts/community/ortho_4x12/buswerks/config.h +++ b/layouts/community/ortho_4x12/buswerks/config.h @@ -13,10 +13,15 @@ #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - + // #define STARTUP_SONG SONG(NO_SOUND) #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ SONG(COLEMAK_SOUND), \ SONG(DVORAK_SOUND) \ } -#endif \ No newline at end of file +#endif + +// MIDI notes can be sent when in Music mode +#define MIDI_BASIC + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/layouts/community/ortho_4x12/buswerks/keymap.c b/layouts/community/ortho_4x12/buswerks/keymap.c index c05c2641830..95d9e7019a9 100644 --- a/layouts/community/ortho_4x12/buswerks/keymap.c +++ b/layouts/community/ortho_4x12/buswerks/keymap.c @@ -2,159 +2,174 @@ extern keymap_config_t keymap_config; -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 +enum layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _GAME, + _ADJUST +}; enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - NAV, - ADJUST, + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + GAME, + ADJUST }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define KC_ KC_TRNS -#define XXXXXXX KC_NO - -#define ESC_CMD MT(MOD_LGUI, KC_ESC) +#define GAME TG(_GAME) #define RSE_ENT LT(_RAISE, KC_ENT) -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_ADJ ADJUST +#define ESC_CTL LCTL_T(KC_ESC) // for Linux +#define ESC_CMD LGUI_T(KC_ESC) // for macOS -#define DESK_L LCTL(KC_LEFT) -#define DESK_R LCTL(KC_RGHT) -#define MSN_CTL LCTL(KC_UP) -#define APP_WND LCTL(KC_DOWN) +// Use these to switch desktops on macOS +#define DESK_L LCTL(KC_LEFT) +#define DESK_R LCTL(KC_RGHT) -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// Use these to switch desktops on Gnome +#define DESK_UP LGUI(KC_PGUP) +#define DESK_DN LGUI(KC_PGDN) -[_QWERTY] = LAYOUT_ortho_4x12( \ - // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. - KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I, KC_O , KC_P , KC_BSPC, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ESC_CMD, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K, KC_L , KC_SCLN, KC_QUOT, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ - // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' -), - -[_COLEMAK] = LAYOUT_ortho_4x12( \ - // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. - KC_TAB , KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, KC_BSPC, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ESC_CMD, KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , KC_QUOT, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ - // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' -), - -[_DVORAK] = LAYOUT_ortho_4x12( \ - // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ESC_CMD, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ - // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' -), - -[_LOWER] = LAYOUT_ortho_4x12( \ - // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. - KC_TILD, _______, KC_VOLD, MSN_CTL, KC_VOLU, _______, _______, KC_7, KC_8, KC_9, KC_MINS, KC_BSPC, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, _______, DESK_L , APP_WND, DESK_R , _______, _______, KC_4, KC_5, KC_6, KC_PLUS, KC_PIPE, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - KC_LBRC, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_SLSH, KC_RBRC, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______ \ - // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' -), - -[_RAISE] = LAYOUT_ortho_4x12( \ - // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. - KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, KC_BSLS, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - KC_LCBR, KC_CIRC, KC_ASTR, KC_UNDS, KC_EQL, KC_AMPR, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, KC_RCBR, \ - // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' -), - -[_ADJUST] = LAYOUT_ortho_4x12( \ - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - _______, _______, RESET, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Use QWERTY on macOS (Colemak mapped using software) + [_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I, KC_O , KC_P , KC_BSPC, \ + ESC_CMD, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K, KC_L , KC_SCLN, KC_QUOT, \ + KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ + XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + ), + + // Use Colemak on Linux (No native Colemak mapping) + [_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB , KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, KC_BSPC, \ + ESC_CTL, KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , KC_QUOT, \ + KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ + XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + ), + + [_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + ESC_CTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + ), + + [_LOWER] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_7, KC_8, KC_9, KC_MINS, _______, \ + KC_TILD, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_4, KC_5, KC_6, KC_PLUS, KC_PIPE, \ + _______, _______, _______, KC_UNDS, KC_EQL, _______, _______, KC_1, KC_2, KC_3, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_COMM, _______, _______ \ + ), + + [_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, _______, KC_INS, KC_DEL, \ + KC_TILD, _______, KC_LBRC, KC_LCBR, KC_RCBR, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_BSLS, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, DESK_R, DESK_DN, DESK_UP, DESK_L \ + ), + + [_GAME] = LAYOUT_ortho_4x12( \ + KC_TAB , KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, KC_BSPC, \ + ESC_CMD, KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , KC_QUOT, \ + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_ENT, \ + XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + ), + + [_ADJUST] = LAYOUT_ortho_4x12( + _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, GAME, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} \ No newline at end of file + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} + +void encoder_update(bool clockwise) { + if (IS_LAYER_ON(_RAISE) || IS_LAYER_ON(_LOWER)) { + if (clockwise) { + register_code(KC_VOLU); + unregister_code(KC_VOLU); + } else { + register_code(KC_VOLD); + register_code(KC_VOLD); + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } +} + + diff --git a/layouts/community/ortho_4x12/buswerks/readme.md b/layouts/community/ortho_4x12/buswerks/readme.md index 43c1aaf93b6..e469d6a50f9 100644 --- a/layouts/community/ortho_4x12/buswerks/readme.md +++ b/layouts/community/ortho_4x12/buswerks/readme.md @@ -1,29 +1,12 @@ -Buswerks' 4x12 Ortholinear Layout -============================ -For use on Planck, Let's Split, and similar keyboards +![Imgur](https://i.imgur.com/yx9tFUq.png) -### Layout Overview +# Logan's Ortho 4x12 Layout -- Main Layer - - Enter is located on the Raise key (layer-tap) - - Space Cadet shift keys - - Lower + shift keys = Brackets[] - - Raise + shift keys = Braces{} - - The bottom left key is the Adjust modifier - - Escape is in the traditional Caps Lock position - - Holding down the escape key acts as LGUI (intended for macOS use) -- Lower - - There is a numpad on the right hand (4, 5, and 6 are located under JKL/NEI/HTN) - - Plus and minus keys are located to the right of the numpad - - There are macOS desktop navigation keys and volume controls under the left hand +This layout is what I use on my Planck. Some features of the layout: -- Raise - - Vim-style arrow keys - - Below the arrow keys are home, end, pgup, and pgdn - - Symbols are located on the right side of the keyboard, in a somewhat logical order - - Symbols from the number row are in order, starting on the left pinky. - - Equals and underscore are in easily accessible spots, since they're commonly used in programming - - The ampersand is less common, so it's to the right of the equals symbol - -- Adjust - - Function keys are located along the top row (reset is moved to the Colemak 'R' position) \ No newline at end of file +- Rotary encoder support (no function for clicking yet) +- Numpad under right hand (I find this much more comfortable than touch-typing the number row) +- Space cadet shift +- Curly braces are under the home row (makes programming much more comfortable) + +Also, another note: the QWERTY layout uses `LGUI_T(KC_ESC)` and the COLEMAK/DVORAK layouts use `LCTL_T(KC_ESC)`. This is because I use the QWERTY layout on my Mac laptop so that I don't have to change the software remapping every time I dock my laptop. This also allows a convenient remapping of the modifier keys. I use the hardware mapped COLEMAK layout on Linux. diff --git a/layouts/community/ortho_4x12/buswerks/rules.mk b/layouts/community/ortho_4x12/buswerks/rules.mk new file mode 100644 index 00000000000..72f8257322a --- /dev/null +++ b/layouts/community/ortho_4x12/buswerks/rules.mk @@ -0,0 +1,9 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +TAP_DANCE_ENABLE = no +AUDIO_ENABLE = yes + +MACROS_ENABLED = no \ No newline at end of file diff --git a/layouts/community/ortho_4x12/colemak_mod_dh_wide/keymap.c b/layouts/community/ortho_4x12/colemak_mod_dh_wide/keymap.c index 218ff93741f..c8da7f589f5 100644 --- a/layouts/community/ortho_4x12/colemak_mod_dh_wide/keymap.c +++ b/layouts/community/ortho_4x12/colemak_mod_dh_wide/keymap.c @@ -20,10 +20,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Colemak diff --git a/layouts/community/ortho_4x12/crs/keymap.c b/layouts/community/ortho_4x12/crs/keymap.c index f9c72f25433..2ec2ffba9f5 100644 --- a/layouts/community/ortho_4x12/crs/keymap.c +++ b/layouts/community/ortho_4x12/crs/keymap.c @@ -33,10 +33,6 @@ enum custom_keycodes { EXT_PLV }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index b4c780cc116..30db12965d7 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -1,42 +1,49 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - +#pragma once #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) -#define RGB_DI_PIN D3 -#define RGBLED_NUM 16 // Number of LEDs - -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 -#endif // RGBLIGHT_ENABLE +# define RGB_DI_PIN B3 +# define RGBLED_NUM 13 // Number of LEDs +# define RGBLIGHT_ANIMATIONS +# define RGBLIGHT_HUE_STEP 12 +# define RGBLIGHT_SAT_STEP 12 +# define RGBLIGHT_VAL_STEP 12 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +# ifdef RGB_MATRIX_ENABLE +# define RGBLIGHT_DISABLE_KEYCODES +# endif +#endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE -#define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended -// #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1 // #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 -// #define EECONFIG_RGB_MATRIX (uint32_t *)16 +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended #endif #if defined(KEYBOARD_lets_split_rev2) -#define USE_SERIAL -#undef USE_I2C - -#define EE_HANDS +# define USE_SERIAL +# undef USE_I2C +# define EE_HANDS #endif -#if defined(KEYBOARD_planck_rev5) -#ifdef RGBLIGHT_ENABLE -#define NO_MUSIC_MODE -#endif // RGBLIGHT_ENABLE -#endif // KEYBOARD_planck_rev5 +#if !defined(KEYBOARD_planck_light) +# ifdef RGBLIGHT_ENABLE +# define NO_MUSIC_MODE +# endif // RGBLIGHT_ENABLE +#endif // KEYBOARD_planck_light +#if defined(KEYBOARD_planck) +# undef PRODUCT +# if defined(KEYBOARD_planck_light) +# define PRODUCT Drashna Hacked RGB Beacon(Planck Light) +# elif defined(KEYBOARD_planck_rev6) +# define PRODUCT Drashna Hacked Planck Rev6 +# elif defined(KEYBOARD_planck_ez) +# define PRODUCT Drashna Hacked Planck EZ +# endif +#endif /* * MIDI options @@ -49,7 +56,7 @@ - MIDI notes can be sent when in Music mode is on */ -#define MIDI_BASIC +// #define MIDI_BASIC /* enable advanced MIDI features: - MIDI notes can be added to the keymap @@ -61,5 +68,3 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#endif diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 108df693157..3e26b93fcdb 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -17,14 +17,31 @@ #include QMK_KEYBOARD_H #include "drashna.h" +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; +#endif + #ifdef BACKLIGHT_ENABLE enum planck_keycodes { - BACKLIT = NEW_SAFE_RANGE, + BACKLIT = NEW_SAFE_RANGE, }; #else - #define BACKLIT OSM(MOD_LSFT) +# define BACKLIT OSM(MOD_LSFT) +#endif + +#ifdef KEYBOARD_planck_ez +# define PLNK_1 BK_LWER +# define PLNK_2 SP_LWER +# define PLNK_3 KC_NO +# define PLNK_4 ET_RAIS +#else +# define PLNK_1 SP_LWER +# define PLNK_2 BK_LWER +# define PLNK_3 DL_RAIS +# define PLNK_4 ET_RAIS #endif +// clang-format off #define LAYOUT_ortho_4x12_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ @@ -33,176 +50,325 @@ enum planck_keycodes { LAYOUT_ortho_4x12_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_ENT, \ - BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ + BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ) #define LAYOUT_ortho_4x12_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = LAYOUT_ortho_4x12_base_wrapper( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ -), - -[_COLEMAK] = LAYOUT_ortho_4x12_base_wrapper( - _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, - _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, - _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ -), - -[_DVORAK] = LAYOUT_ortho_4x12_base_wrapper( - _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, - _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, - _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ -), - -[_WORKMAN] = LAYOUT_ortho_4x12_base_wrapper( - _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, - _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, - _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ -), - -[_MODS] = LAYOUT_ortho_4x12_wrapper( - _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, - _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, - KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -[_LOWER] = LAYOUT_ortho_4x12_wrapper( - KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, - KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, - _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY -), - -[_RAISE] = LAYOUT_ortho_4x12_wrapper( - KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, - KC_DEL, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, - _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, - _______, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________ -), - -[_ADJUST] = LAYOUT_ortho_4x12_wrapper( - KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, - VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EPRM, - _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -) + [_QWERTY] = LAYOUT_ortho_4x12_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + [_COLEMAK] = LAYOUT_ortho_4x12_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), -}; + [_DVORAK] = LAYOUT_ortho_4x12_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + [_WORKMAN] = LAYOUT_ortho_4x12_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { + [_NORMAN] = LAYOUT_ortho_4x12_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_ortho_4x12_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_ortho_4x12_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_ortho_4x12_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + + [_MODS] = LAYOUT_ortho_4x12_wrapper( + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_LOWER] = LAYOUT_ortho_4x12_wrapper( + KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, + KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + [_RAISE] = LAYOUT_ortho_4x12_wrapper( + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, + KC_DEL, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________ + ), + + [_ADJUST] = LAYOUT_ortho_4x12_wrapper( + KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, + VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, + _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NUKE + ) + +}; +// clang-format on + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { #ifdef BACKLIGHT_ENABLE - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - PORTE &= ~(1<<6); - } else { - unregister_code(KC_RSFT); - PORTE |= (1<<6); - } - return false; - break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); +# ifdef BACKLIGHT_ENABLE + backlight_step(); +# endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; #endif - } - return true; + } + return true; } bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case RAISE: - case LOWER: - case BK_LWER: - case SP_LWER: - case DL_RAIS: - case ET_RAIS: - return false; - default: - return true; - } + switch (keycode) { + case RAISE: + case LOWER: + case BK_LWER: + case SP_LWER: + case DL_RAIS: + case ET_RAIS: + return false; + default: + return true; + } } #ifdef RGB_MATRIX_ENABLE +// clang-format off +void suspend_power_down_keymap(void) { + rgb_matrix_set_suspend_state(true); +} -void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } - } - } +void suspend_wakeup_init_keymap(void) { + rgb_matrix_set_suspend_state(false); } +// clang-format on void rgb_matrix_indicators_user(void) { - uint8_t this_mod = get_mods(); - uint8_t this_led = host_keyboard_leds(); - uint8_t this_osm = get_oneshot_mods(); - - switch (biton32(layer_state)) { - case _RAISE: - rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; - case _LOWER: - rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; - case _ADJUST: - rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; - default: - switch (biton32(default_layer_state)) { + uint8_t this_mod = get_mods(); + uint8_t this_led = host_keyboard_leds(); + uint8_t this_osm = get_oneshot_mods(); + bool is_ez; +# ifdef KEYBOARD_planck_ez + is_ez = true; +# endif + + if (userspace_config.rgb_layer_change && +# ifdef RGB_DISABLE_WHEN_USB_SUSPENDED + !g_suspend_state && +# endif +# if defined(RGBLIGHT_ENABLE) + (!rgblight_config.enable && rgb_matrix_config.enable) +# else + rgb_matrix_config.enable +# endif + ) { + switch (biton32(layer_state)) { + case _GAMEPAD: + rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _DIABLO: + rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER); + break; + case _RAISE: + rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _LOWER: + rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _ADJUST: + rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + default: { + bool mods_enabled = IS_LAYER_ON(_MODS); + switch (biton32(default_layer_state)) { + case _QWERTY: + rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _COLEMAK: + rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _DVORAK: + rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _WORKMAN: + rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _NORMAN: + rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _MALTRON: + rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _EUCALYN: + rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + case _CARPLAX: + rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); + break; + } + break; + } + } + } + + switch (biton32(default_layer_state)) { case _QWERTY: - rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break; + rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF); + break; case _COLEMAK: - rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break; + rgb_matrix_set_color(is_ez ? 41 : 42, 0xFF, 0x00, 0xFF); + break; case _DVORAK: - rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break; + rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0x00); + break; case _WORKMAN: - rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break; - } - } - - switch (biton32(default_layer_state)) { - case _QWERTY: - rgb_matrix_set_color(42, 0x00, 0xFF, 0xFF); break; - case _COLEMAK: - rgb_matrix_set_color(42, 0xFF, 0x00, 0xFF); break; - case _DVORAK: - rgb_matrix_set_color(42, 0x00, 0xFF, 0x00); break; - case _WORKMAN: - rgb_matrix_set_color(42, 0xD9, 0xA5, 0x21); break; - } - - if (this_mod & MODS_SHIFT_MASK || this_led & (1<event.pressed; + break; + case KC_ESC: + is_esc_pressed = record->event.pressed; + break; + case KC_BSPC: + is_bspc_pressed = record->event.pressed; + break; + }; + return true; +} +void matrix_scan_user(void) { + if (is_ctl_pressed && is_esc_pressed && is_bspc_pressed) { + reset_keyboard(); + } +} diff --git a/layouts/community/ortho_4x12/jotix/readme.md b/layouts/community/ortho_4x12/jotix/readme.md new file mode 100644 index 00000000000..dda5b81defb --- /dev/null +++ b/layouts/community/ortho_4x12/jotix/readme.md @@ -0,0 +1,8 @@ +# Jotix ortho 4x12 keymap + +![keymap](https://i.imgur.com/hfCyDRD.png) + +Tested on: + +* Planck/rev4 +* Jotanck diff --git a/layouts/community/ortho_4x12/jotix/rules.mk b/layouts/community/ortho_4x12/jotix/rules.mk new file mode 100644 index 00000000000..0517619ed13 --- /dev/null +++ b/layouts/community/ortho_4x12/jotix/rules.mk @@ -0,0 +1 @@ +UNICODEMAP_ENABLE = yes \ No newline at end of file diff --git a/layouts/community/ortho_4x12/jotix/unicode.c b/layouts/community/ortho_4x12/jotix/unicode.c new file mode 100644 index 00000000000..eaa0da1ac43 --- /dev/null +++ b/layouts/community/ortho_4x12/jotix/unicode.c @@ -0,0 +1,185 @@ +enum unicode_names { + A_ACUTE, + A_ACUTEC, + E_ACUTE, + E_ACUTEC, + I_ACUTE, + I_ACUTEC, + O_ACUTE, + O_ACUTEC, + U_ACUTE, + U_ACUTEC, + U_DIERESIS, + U_DIERESISC, + N_TILDE, + N_TILDEC, + OPEN_EXCML, + OPEN_QUEST, + EURO, + POUND, + LEFT_ARROW, + DOWN_ARROW, + UP_ARROW, + RIGHT_ARROW, + LEFT_DARROW, + DOWN_DARROW, + UP_DARROW, + RIGHT_DAROW, + LEFT_DQUOT, + RGHT_DQUOT, + DEGREE, + DEGREE_CELCIUS, + SUPER_1, + SUPER_2, + SUPER_3, + ONE_HALF, + PER_MILLE, + PER_THOUS, + PILCROW, + COPYRIGHT, + REGISTERED, + MICRO, + MIDDLE_DOT, + BOX_CORNER_1, + BOX_CORNER_2, + BOX_CORNER_3, + BOX_CORNER_4, + BOX_HORIZONTAL, + BOX_VERTICAL, + BOX_CROSS, + BOX_UNION_1, + BOX_UNION_2, + BOX_UNION_3, + BOX_UNION_4, + DBOX_CORNER_1, + DBOX_CORNER_2, + DBOX_CORNER_3, + DBOX_CORNER_4, + DBOX_HORIZONT, + DBOX_VERTICAL, + DBOX_CROSS, + DBOX_UNION_1, + DBOX_UNION_2, + DBOX_UNION_3, + DBOX_UNION_4, + LESS_EQUAL, + MORE_EQUAL, + DIVISION, + SQUARE_ROOT, + CUBE_ROOT, + SPADE_SUIT, + TREBOL_SUIT, + HEART_SUIT, + DIAMOND_SUIT, +}; + +const uint32_t PROGMEM unicode_map[] = { + [A_ACUTE] = 0x00E1, + [A_ACUTEC] = 0x00C1, + [E_ACUTE] = 0x00E9, + [E_ACUTEC] = 0x00C9, + [I_ACUTE] = 0x00ED, + [I_ACUTEC] = 0x00CD, + [O_ACUTE] = 0x00F3, + [O_ACUTEC] = 0x00D3, + [U_ACUTE] = 0x00FA, + [U_ACUTEC] = 0x00DA, + [U_DIERESIS] = 0x00FC, + [U_DIERESISC] = 0x00DC, + [N_TILDE] = 0x00F1, + [N_TILDEC] = 0x00D1, + [OPEN_EXCML] = 0x00A1, + [OPEN_QUEST] = 0x00BF, + [EURO] = 0x20AC, + [POUND] = 0x00A3, + [LEFT_ARROW] = 0x2190, + [DOWN_ARROW] = 0x2193, + [UP_ARROW] = 0x2191, + [RIGHT_ARROW] = 0x2192, + [LEFT_DARROW] = 0x21E6, + [DOWN_DARROW] = 0x21D3, + [UP_DARROW] = 0x21D1, + [RIGHT_DAROW] = 0x21D2, + [LEFT_DQUOT] = 0x00AB, + [RGHT_DQUOT] = 0x00BB, + [DEGREE] = 0x00B0, + [DEGREE_CELCIUS]= 0x2103, + [SUPER_1] = 0x00B9, + [SUPER_2] = 0x00B2, + [SUPER_3] = 0x00B3, + [ONE_HALF] = 0x00BD, + [PER_MILLE] = 0x0609, + [PER_THOUS] = 0x060A, + [PILCROW] = 0x00B6, + [COPYRIGHT] = 0x00A9, + [REGISTERED] = 0x00AE, + [MICRO] = 0x00B5, + [MIDDLE_DOT] = 0x00B7, + [BOX_CORNER_1] = 0x250C, + [BOX_CORNER_2] = 0x2510, + [BOX_CORNER_3] = 0x2514, + [BOX_CORNER_4] = 0x2518, + [BOX_HORIZONTAL]= 0x2500, + [BOX_VERTICAL] = 0x2502, + [BOX_CROSS] = 0x253C, + [BOX_UNION_1] = 0x2524, + [BOX_UNION_2] = 0x252C, + [BOX_UNION_3] = 0x2534, + [BOX_UNION_4] = 0x251C, + [DBOX_CORNER_1] = 0x2554, + [DBOX_CORNER_2] = 0x2557, + [DBOX_CORNER_3] = 0x255A, + [DBOX_CORNER_4] = 0x255D, + [DBOX_HORIZONT] = 0x2550, + [DBOX_VERTICAL] = 0x2551, + [DBOX_CROSS] = 0x256C, + [DBOX_UNION_1] = 0x2563, + [DBOX_UNION_2] = 0x2566, + [DBOX_UNION_3] = 0x2569, + [DBOX_UNION_4] = 0x2560, + [LESS_EQUAL] = 0x2264, + [MORE_EQUAL] = 0x2265, + [DIVISION] = 0x00F7, + [SQUARE_ROOT] = 0x221A, + [CUBE_ROOT] = 0x221B, + [SPADE_SUIT] = 0x2660, + [TREBOL_SUIT] = 0x2663, + [HEART_SUIT] = 0x2664, + [DIAMOND_SUIT] = 0x2665 +}; + +#define UN_ESC XP(DEGREE, DEGREE_CELCIUS) +#define UN_Q XP(OPEN_EXCML, SUPER_1) +#define UN_W XP(SUPER_2, SUPER_3) +#define UN_E XP(E_ACUTE, E_ACUTEC) +#define UN_R XP(EURO, ONE_HALF) +#define UN_T XP(PER_MILLE, PER_THOUS) +#define UN_Y XP(U_DIERESIS, U_DIERESISC) +#define UN_U XP(U_ACUTE, U_ACUTEC) +#define UN_I XP(I_ACUTE, I_ACUTEC) +#define UN_O XP(O_ACUTE, O_ACUTEC) +#define UN_P XP(POUND, PILCROW) +#define UN_A XP(A_ACUTE, A_ACUTEC) +#define UN_S XP(BOX_CORNER_1, DBOX_CORNER_1) +#define UN_D XP(BOX_CORNER_2, DBOX_CORNER_2) +#define UN_F XP(BOX_CORNER_3, DBOX_CORNER_3) +#define UN_G XP(BOX_CORNER_4, DBOX_CORNER_4) +#define UN_H XP(BOX_UNION_1, DBOX_UNION_1) +#define UN_J XP(BOX_UNION_2, DBOX_UNION_2) +#define UN_K XP(BOX_UNION_3, DBOX_UNION_3) +#define UN_L XP(BOX_UNION_4, DBOX_UNION_4) +#define UN_SCLN XP(BOX_HORIZONTAL, DBOX_HORIZONT) +#define UN_Z XP(BOX_VERTICAL, DBOX_VERTICAL) +#define UN_X XP(BOX_CROSS, DBOX_CROSS) +#define UN_C XP(COPYRIGHT, REGISTERED) +#define UN_V XP(SPADE_SUIT, TREBOL_SUIT) +#define UN_B XP(HEART_SUIT, DIAMOND_SUIT) +#define UN_N XP(N_TILDE, N_TILDEC) +#define UN_M XP(MICRO, MIDDLE_DOT) +#define UN_COMM XP(LESS_EQUAL, LEFT_DQUOT) +#define UN_DOT XP(MORE_EQUAL, RGHT_DQUOT) +#define UN_SLSH XP(OPEN_QUEST, DIVISION) +#define UN_LEFT XP(LEFT_ARROW, LEFT_DARROW) +#define UN_DOWN XP(DOWN_ARROW, DOWN_DARROW) +#define UN_UP XP(UP_ARROW, UP_DARROW) +#define UN_RGHT XP(RIGHT_ARROW, RIGHT_DAROW) \ No newline at end of file diff --git a/layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c b/layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c new file mode 100644 index 00000000000..b1341d41f9a --- /dev/null +++ b/layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c @@ -0,0 +1,17 @@ + +// generated from users/manna-harbour_miryoku/miryoku.org + +#define LAYOUT_miryoku(\ +K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ +K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ +K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ +N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ +)\ +LAYOUT_ortho_4x12(\ +KC_NO, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, KC_NO,\ +K00, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K09,\ +K10, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K19,\ +K20, KC_NO, KC_NO, K32, K33, K34, K35, K36, K37, KC_NO, KC_NO, K29\ +) + +#include "manna-harbour_miryoku.c" diff --git a/layouts/community/ortho_4x12/mindsound/config.h b/layouts/community/ortho_4x12/mindsound/config.h index 76e7da20498..e615fe77ebb 100644 --- a/layouts/community/ortho_4x12/mindsound/config.h +++ b/layouts/community/ortho_4x12/mindsound/config.h @@ -15,9 +15,10 @@ #define STARTUP_SONG SONG(ADVENTURE_TIME) #define AUDIO_CLICKY #define AUDIO_CLICKY_ON + #define AUDIO_CLICKY_DELAY_DURATION 0 #define AUDIO_CLICKY_FREQ_MAX 2500.0f - #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.2f - #define AUDIO_CLICKY_FREQ_DEFAULT 110.0f + #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.3f + #define AUDIO_CLICKY_FREQ_DEFAULT 880.0f #endif // for some reason the LSvi rev1 disables action tapping... diff --git a/layouts/community/ortho_4x12/mindsound/keymap.c b/layouts/community/ortho_4x12/mindsound/keymap.c index 2c9ceaf6907..03b0486c58f 100644 --- a/layouts/community/ortho_4x12/mindsound/keymap.c +++ b/layouts/community/ortho_4x12/mindsound/keymap.c @@ -33,10 +33,6 @@ const uint8_t flicker_max_levels = 7; uint8_t flicker_restore_level = 0; #endif -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) diff --git a/layouts/community/ortho_4x12/rs/config.h b/layouts/community/ortho_4x12/rs/config.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/layouts/community/ortho_4x12/rs/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/layouts/community/ortho_4x12/rs/keymap.c b/layouts/community/ortho_4x12/rs/keymap.c new file mode 100644 index 00000000000..c6d6f14cad0 --- /dev/null +++ b/layouts/community/ortho_4x12/rs/keymap.c @@ -0,0 +1,52 @@ +#include QMK_KEYBOARD_H +#include "rs.h" + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ + ) \ + LAYOUT_ortho_4x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ + ) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( \ + // ,-----------------------------------------------------------------------------------. + TAB , Q , W , E , R , T , Y , U , I , O , P , EQL , + // |------+------+------+------+------+------+------+------+------+------+------+------| + ESCC , A , S , D , F , G , H , J , K , L , SCLN , QUOT , + // |------+------+------+------+------+------+------+------+------+------+------+------| + LSFT , Z , X , C , V , B , N , M , COMM , DOT , SLSH , ENTS , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , LCTL , LALT , LGUI , SPC , SPC , BCOD , FN , , LEFT , RGHT + // `-----------------------------------------------------------------------------------' + ), + [_CODE] = LAYOUT_kc( + // ,-----------------------------------------------------------------------------------. + GRV , EXLM , AT , HASH , DLR , PERC , CIRC , LPLT , ASTR , RPGT , NEQL , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , 1 , 2 , 3 , 4 , 5 , MINS , LBRC , UP , RBRC , , BSLS , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , 6 , 7 , 8 , 9 , 0 , AMPR , LEFT , DOWN , RGHT , , PIPE , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , , , , DOT , , , , , , + // `-----------------------------------------------------------------------------------' + ), + [_FN] = LAYOUT_kc( + // ,-----------------------------------------------------------------------------------. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10 , F11 , + // |------+------+------+------+------+------+------+------+------+------+------+------| + BLTG , BLUP , , , , BRMU , VOLU , , PGUP , , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + BLTG , BLDN , , , RST , BRMD , VOLD , CTRA , PGDN , CTRE , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , , , , , MUTE , , , , , + // `-----------------------------------------------------------------------------------' + ), +}; diff --git a/layouts/community/ortho_4x12/rs/readme.md b/layouts/community/ortho_4x12/rs/readme.md new file mode 100644 index 00000000000..d23ab66877a --- /dev/null +++ b/layouts/community/ortho_4x12/rs/readme.md @@ -0,0 +1 @@ +See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/layouts/community/ortho_4x12/symbolic/README.md b/layouts/community/ortho_4x12/symbolic/README.md index 37fbcd56a47..2c69d5160e8 100644 --- a/layouts/community/ortho_4x12/symbolic/README.md +++ b/layouts/community/ortho_4x12/symbolic/README.md @@ -1,26 +1,24 @@ -# Symbolic ortho 4x12 layout +# Symbolic ortho 4x12 layout ## Features ### QWERTY based -![QWERTY layout](https://gist.githubusercontent.com/leico/cb50ecd12eb8ad906a69678f265cd52c/raw/4597497ecd00790312f1a3928b2e2c5cf17a6ac1/QWERTY.png) - +![QWERTY layout](https://gist.githubusercontent.com/leico/5bf4d9ff94f2068c5333739f7f1f88b4/raw/2af7fed6f282b6ac278e79433d15887f6b91ba3a/QWERTY.png) + * Default keymap * QWERTY layout * Hold and tap - * `Shift` and `Space` * `Left Ctrl` and `Tab` * Symmetric Modifiers * `Shift` * `Raise Layer` * `Lower Layer` * `GUI` - * `Reset` ### symbol charactor layer -![Raise layout](https://gist.githubusercontent.com/leico/cb50ecd12eb8ad906a69678f265cd52c/raw/4597497ecd00790312f1a3928b2e2c5cf17a6ac1/Raise.png) +![Raise layout](https://gist.githubusercontent.com/leico/5bf4d9ff94f2068c5333739f7f1f88b4/raw/2af7fed6f282b6ac278e79433d15887f6b91ba3a/Raise.png) * Raise Layer * assigned symbolic(punctuation) characters @@ -37,23 +35,31 @@ ### numbers and allows layer -![Lower layout](https://gist.githubusercontent.com/leico/cb50ecd12eb8ad906a69678f265cd52c/raw/4597497ecd00790312f1a3928b2e2c5cf17a6ac1/Lower.png) +![Lower layout](https://gist.githubusercontent.com/leico/5bf4d9ff94f2068c5333739f7f1f88b4/raw/2af7fed6f282b6ac278e79433d15887f6b91ba3a/Lower.png) * Lower Layer * entrust vim style arrows * also numkeys * additional, computer volume keys * transparent all modifiers +* **changed 2018/09/04** + * assign keys + * Home + * Page Down + * Page Up + * End + * Print Screen ### Numpads and F key layer -![Neutral layout](https://gist.githubusercontent.com/leico/cb50ecd12eb8ad906a69678f265cd52c/raw/4597497ecd00790312f1a3928b2e2c5cf17a6ac1/Neutral.png) +![Neutral layout](https://gist.githubusercontent.com/leico/5bf4d9ff94f2068c5333739f7f1f88b4/raw/2af7fed6f282b6ac278e79433d15887f6b91ba3a/Neutral.png) * visibled when Raise and Lower layer visibled * F keys assigned left hand side * Numpads assigned right hand side * for that reason, override `RGUI` key * transparent mostly modifiers +* visibled `Reset` key on both hands ### Goals @@ -63,7 +69,6 @@ * simple, minimal, easy learn * as soon as possible, don't disable any shortcuts - ### suggestions or find issues [post issues for my fork](https://github.com/leico/qmk_firmware/issues) diff --git a/layouts/community/ortho_4x12/symbolic/config.h b/layouts/community/ortho_4x12/symbolic/config.h index c29b0770622..3f88b4cc17d 100644 --- a/layouts/community/ortho_4x12/symbolic/config.h +++ b/layouts/community/ortho_4x12/symbolic/config.h @@ -20,8 +20,7 @@ along with this program. If not, see . #pragma once -// hold & tapping delay setting -#define TAPPING_TERM 100 + /* Use I2C or Serial, not both */ diff --git a/layouts/community/ortho_4x12/symbolic/keymap.c b/layouts/community/ortho_4x12/symbolic/keymap.c index d4c08923685..c2923737111 100644 --- a/layouts/community/ortho_4x12/symbolic/keymap.c +++ b/layouts/community/ortho_4x12/symbolic/keymap.c @@ -20,11 +20,6 @@ enum custom_keycodes { }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -36,17 +31,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Tab | A | S | D | F | G || H | J | K | L | ; |Enter | * |------+------+------+------+------+------++------+------+------+------+------+------| * | | | | | | || | | | | | | - * | | Z | X | C | V | B || N | M | , | . | ! | | + * |Shift | Z | X | C | V | B || N | M | , | . | ! |Shift | * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | |LSFT_T||RSFT_T| | | | | | - * |Reset | Alt | GUI |LLower|LRaise|Space ||Space |RRaise|RLower| GUI | Del |Reset | + * | | | | | | || | | | | | | + * |LRaise| Alt | GUI | |LLower|Space ||Space |RLower| | GUI | Del |RRaise| * `------------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT_ortho_4x12( \ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - LCTL_T(KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ - XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_EXLM, XXXXXXX, \ - RESET, KC_LALT, KC_LGUI, L_LOWER, L_RAISE, LSFT_T( KC_SPC ), RSFT_T( KC_SPC ), R_RAISE, R_LOWER, KC_RGUI, KC_DEL, RESET \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + LCTL_T(KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_EXLM, KC_RSFT, \ + L_RAISE, KC_LALT, KC_LGUI, XXXXXXX, L_LOWER, KC_SPC, KC_SPC, R_LOWER, XXXXXXX, KC_RGUI, KC_DEL, R_RAISE \ ), /* Raise @@ -58,16 +53,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Tab | ~ | | | ( | ) | * || / | < | > | ' | : |Enter | * |------+------+------+------+------+------++------+------+------+------+------+------| * | | | | | | || | | | | | | - * | | ` | ^ | @ | $ | + || - | = | _ | " | ? | | + * |Shift | ` | ^ | @ | $ | + || - | = | _ | " | ? |Shift | * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | |LSFT_T||RSFT_T| | | | | | - * |Reset | Alt | GUI |LLower|LRaise|Space ||Space |RRaise|RLower| GUI | Del |Reset | + * | | | | | | || | | | | | | + * |LRaise| Alt | GUI | |LLower|Space ||Space |RLower| | GUI | Del |RRaise| * `------------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT_ortho_4x12( \ _______, XXXXXXX, KC_AMPR, KC_LCBR, KC_RCBR, KC_PERC, KC_BSLS, KC_LBRC, KC_RBRC, KC_HASH, XXXXXXX, _______, \ - _______, KC_TILD, KC_PIPE, KC_LPRN, KC_RPRN, KC_ASTR, KC_SLSH, KC_LABK, KC_RABK, KC_QUOT, KC_COLN, _______, \ - _______, KC_GRV, KC_CIRC, KC_AT, KC_DLR, KC_PLUS, KC_MINS, KC_EQL, KC_UNDS, KC_DQUO, KC_QUES, _______, \ + _______, KC_TILD, KC_PIPE, KC_LPRN, KC_RPRN, KC_ASTR, KC_SLSH, KC_LABK, KC_RABK, KC_DQUO, KC_COLN, _______, \ + _______, KC_GRV, KC_CIRC, KC_AT, KC_DLR, KC_PLUS, KC_MINS, KC_EQL, KC_UNDS, KC_QUOT, KC_QUES, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), /* Lower @@ -79,16 +74,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Tab | |VolDn |VolUp | Mute | || Left | Down | Up |Right | |Enter | * |------+------+------+------+------+------++------+------+------+------+------+------| * | | | | | | || | | | | | | - * | | | | | | || | | | | | | + * |Shift | | | | | PrSc || Home | PgDn | PgUp | End | |Shift | * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | |LSFT_T||RSFT_T| | | | | | - * |Reset | Alt | GUI |LLower|LRaise|Space ||Space |RRaise|RLower| GUI | Del |Reset | + * | | | | | | || | | | | | | + * |LRaise| Alt | GUI | |LLower|Space ||Space |RLower| | GUI | Del |RRaise| * `------------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT_ortho_4x12( \ _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ _______, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), @@ -101,55 +96,113 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Tab | F5 | F6 | F7 | F8 | || * | / | 4 | 5 | 6 |Enter | * |------+------+------+------+------+------++------+------+------+------+------+------| * | | | | | | || | | | | | | - * | | F9 | F10 | F11 | F12 | || . | , | 7 | 8 | 9 | | + * |Shift | F9 | F10 | F11 | F12 | || . | , | 7 | 8 | 9 |Shift | * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | |LSFT_T||RSFT_T| | | | | | - * |Reset | Alt | GUI |LLower|LRaise|Space ||Space |RRaise|RLower| 0 | Del |Reset | + * | | | | | | || | | | | | | + * |LRaise| Alt | GUI |Reset |LLower|Space ||Space |RLower|Reset | 0 | Del |RRaise| * `------------------------------------------------------------------------------------' */ [_NEUTRAL] = LAYOUT_ortho_4x12( \ _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PPLS, KC_PMNS, KC_P1, KC_P2, KC_P3, _______, \ _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PAST, KC_PSLS, KC_P4, KC_P5, KC_P6, _______, \ _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_PDOT, KC_COMM, KC_P7, KC_P8, KC_P9, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, _______, _______ \ + _______, _______, _______, RESET, _______, _______, _______, _______, RESET, KC_P0, _______, _______ \ ) }; -void DualKeyPressed ( bool brother_state, uint8_t target ){ - if( brother_state ) return; +/**** Raise Layer functions *****/ + + /* RaisePressed function */ + /* called RaiseSwitch */ +void RaisePressed ( keyevent_t *event, bool brother_state ){ + + if( brother_state ) { return; } + + layer_on( _RAISE ); + update_tri_layer( _LOWER, _RAISE, _NEUTRAL ); + return; + +} + + + /* RaiseReleased function */ + /* called RaiseSwitch */ +void RaiseReleased ( bool brother_state ){ + + if( brother_state ) { return; } + + layer_off( _RAISE ); + update_tri_layer( _LOWER, _RAISE, _NEUTRAL ); + return; +} + + + /* RaiseSwitch function */ + /* called process_record_user */ +bool RaiseSwitch ( keyrecord_t *record, bool *key_state, bool brother ){ + + if( record -> event.pressed ) { + *key_state = true; + RaisePressed( &(record -> event), brother ); + } else { + *key_state = false; + RaiseReleased( brother ); + } + return false; + +} + + + + + + +/**** Lower layer functions ****/ + + /* LowerPressed function */ + /* call from LowerSwitch */ +void LowerPressed ( bool brother_state ){ - layer_on( target ); + if( brother_state ) { return; } + + layer_on( _LOWER ); + update_tri_layer(_LOWER, _RAISE, _NEUTRAL ); return; } -void DualKeyReleased ( bool brother_state, uint8_t target1 ){ + /* LowerReleased function */ + /* call from LowerSwitch */ +void LowerReleased ( bool brother_state ){ - if( brother_state ) return ; + if( brother_state ) { return; } - layer_off( target1 ); + layer_off( _LOWER ); + update_tri_layer(_LOWER, _RAISE, _NEUTRAL ); return ; } -bool LayerSwitch ( keyrecord_t *record, bool *key_state, bool brother, uint8_t layer ){ + /* LowerSwitch function */ + /* call from process_record_user */ +bool LowerSwitch ( keyrecord_t *record, bool *key_state, bool brother ){ if ( record -> event.pressed ) { *key_state = true; - DualKeyPressed( brother, layer ); - } - else { + LowerPressed( brother ); + } else { *key_state = false; - DualKeyReleased( brother, layer ); + LowerReleased( brother ); } - update_tri_layer(_LOWER, _RAISE, _NEUTRAL ); return false; - } + + +/**** process_record_user ****/ bool process_record_user(uint16_t keycode, keyrecord_t *record) { static bool l_lower = false; @@ -161,11 +214,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case L_LOWER : return LayerSwitch( record, &l_lower, r_lower, _LOWER ); break; - case R_LOWER : return LayerSwitch( record, &r_lower, l_lower, _LOWER ); break; - case L_RAISE : return LayerSwitch( record, &l_raise, r_raise, _RAISE ); break; - case R_RAISE : return LayerSwitch( record, &r_raise, l_raise, _RAISE ); break; + case L_LOWER : return LowerSwitch( record, &l_lower, r_lower ); break; + case R_LOWER : return LowerSwitch( record, &r_lower, l_lower ); break; + case L_RAISE : return RaiseSwitch( record, &l_raise, r_raise ); break; + case R_RAISE : return RaiseSwitch( record, &r_raise, l_raise ); break; + + default: break; } return true; } + + + diff --git a/layouts/community/ortho_4x12/wanleg/config.h b/layouts/community/ortho_4x12/wanleg/config.h index 2444b8b9761..bcf2756f6bb 100644 --- a/layouts/community/ortho_4x12/wanleg/config.h +++ b/layouts/community/ortho_4x12/wanleg/config.h @@ -1,5 +1,13 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once + +#if defined(KEYBOARD_jj40) +#undef BACKLIGHT_BREATHING +#undef BACKLIGHT_LEVELS +#undef BREATHING_PERIOD +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#define BREATHING_PERIOD 15 +#endif //QMK DFU settings (ProMicro boards with QMK bootloader) // set top left key as bootloader mode escape key on Lets Split rev2 @@ -12,8 +20,15 @@ #define EE_HANDS #endif +// set top left key as bootloader mode escape key on Nori +#if defined(KEYBOARD_40percentclub_nori) +#define QMK_LED B0 +#define QMK_ESC_OUTPUT F4 // usually COL +#define QMK_ESC_INPUT D3 // usually ROW +#endif + // set top left key as bootloader mode escape key on 4x4 48key layout -#if defined(KEYBOARD_4x4) && !defined(PRO_MICRO) +#if defined(KEYBOARD_40percentclub_4x4) && !defined(PRO_MICRO) #define QMK_LED B0 #define QMK_ESC_OUTPUT C6 // usually COL #define QMK_ESC_INPUT B2 // usually ROW @@ -21,7 +36,7 @@ // use alternate settings for 4x4 board using ProMicro instead of Micro // usage: make 4x4:wanleg PM=yes -#if defined(KEYBOARD_4x4) && defined(PRO_MICRO) +#if defined(KEYBOARD_40percentclub_4x4) && defined(PRO_MICRO) #define QMK_ESC_OUTPUT F4 // usually COL #define QMK_ESC_INPUT D1 // usually ROW #define QMK_LED B0 @@ -30,8 +45,6 @@ #undef MATRIX_ROW_PINS #undef MATRIX_COL_PINS #define MATRIX_ROW_PINS { D1, D0, D4, C6 } -//last 4 elements of the column array are are not broken out on a ProMicro (included only to preserve array structure) +//last 4 elements of the column array are not broken out on a ProMicro (included only to preserve array structure) #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, B5, B4, E6, D7, F0, B7, D6, F1 } #endif - -#endif diff --git a/layouts/community/ortho_4x12/wanleg/keymap.c b/layouts/community/ortho_4x12/wanleg/keymap.c index 6fe8446f6d3..bcf6671aedf 100644 --- a/layouts/community/ortho_4x12/wanleg/keymap.c +++ b/layouts/community/ortho_4x12/wanleg/keymap.c @@ -15,8 +15,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________Qwerty_Row__2_______________, KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), SH_T(KC_SPC), SUPRA, KC_RGUI, KC_RALT, GHERKIN, KC_RCTL ), - -#elif defined(KEYBOARD_4x4) +[DIR] = LAYOUT_ortho_4x12_wrapper( + _____________DIRECTIONS_Row__0_____________, + _____________DIRECTIONS_Row__1_____________, + _____________DIRECTIONS_Row__2_____________, + _______, _______, ONEHAND, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +#elif defined(KEYBOARD_40percentclub_4x4) || defined(KEYBOARD_40percentclub_nori) [_GK] = LAYOUT_ortho_4x12_wrapper( _______________GherkinLike_0_______________, _______________GherkinLike_1_______________, @@ -81,4 +86,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______________ETCETERA_Row__3______________ ), +[_FN] = LAYOUT_ortho_4x12_wrapper( + _______, _______________Gherkin_FN_0________________, _______, + _______, _______________Gherkin_FN_0________________, _______, + _______, _______________Gherkin_FN_0________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + }; diff --git a/layouts/community/ortho_4x12/wanleg/rules.mk b/layouts/community/ortho_4x12/wanleg/rules.mk index fa433a6b0da..0b3917e98f6 100644 --- a/layouts/community/ortho_4x12/wanleg/rules.mk +++ b/layouts/community/ortho_4x12/wanleg/rules.mk @@ -1,14 +1,15 @@ AUDIO_ENABLE = no -SWAP_HANDS_ENABLE = yes +SWAP_HANDS_ENABLE = no -ifeq ($(strip $(KEYBOARD)), jj40) - SWAP_HANDS_ENABLE = no +ifeq ($(strip $(KEYBOARD)), lets_split/rev2) + SWAP_HANDS_ENABLE = yes endif -ifeq ($(strip $(KEYBOARD)), 4x4) - SWAP_HANDS_ENABLE = no +ifeq ($(strip $(KEYBOARD)), planck/rev6) + AUDIO_ENABLE = yes endif -ifeq ($(strip $(KEYBOARD)), zlant) - SWAP_HANDS_ENABLE = no +#disable RGB on version 1 of jj40 keyboard (does not exist) +ifeq ($(strip $(KEYBOARD)), jj40) + RGBLIGHT_ENABLE = no endif \ No newline at end of file diff --git a/layouts/community/ortho_4x12/xyverz/config.h b/layouts/community/ortho_4x12/xyverz/config.h index 0fa89d6c7bb..287f4cc2b73 100644 --- a/layouts/community/ortho_4x12/xyverz/config.h +++ b/layouts/community/ortho_4x12/xyverz/config.h @@ -11,7 +11,7 @@ #if defined(KEYBOARD_planck_rev5) #define RGBLED_NUM 10 #define RGB_DI_PIN D1 -#elif defined(KEYBOARD_levinson_rev2) +#elif defined(KEYBOARD_keebio_levinson_rev2) #define RGBLED_NUM 12 #elif defined(KEYBOARD_lets_split_rev2) #define RGBLED_NUM 8 diff --git a/layouts/community/ortho_4x12/xyverz/keymap.c b/layouts/community/ortho_4x12/xyverz/keymap.c index 72ddbacf820..681dafacd44 100644 --- a/layouts/community/ortho_4x12/xyverz/keymap.c +++ b/layouts/community/ortho_4x12/xyverz/keymap.c @@ -24,10 +24,6 @@ enum custom_keycodes { ADJUST }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Aliases to keep the keymap tidy #define GUIBSPC GUI_T(KC_BSPC) // GUI when held, BSPC when tapped. #define RGB_SWR RGB_M_SW // Swirl Animation alias diff --git a/layouts/community/ortho_4x12/xyverz/rules.mk b/layouts/community/ortho_4x12/xyverz/rules.mk index 852e38f24e6..f52fe17540e 100644 --- a/layouts/community/ortho_4x12/xyverz/rules.mk +++ b/layouts/community/ortho_4x12/xyverz/rules.mk @@ -3,10 +3,9 @@ AUDIO_ENABLE = no # Audio output on port C6 ifeq ("$(KEYBOARD)","vitamins_included") RGBLIGHT_ENABLE = no +else ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) + RGBLIGHT_ENABLE = no else RGBLIGHT_ENABLE = yes endif -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/layouts/community/ortho_4x4/jotix/keymap.c b/layouts/community/ortho_4x4/jotix/keymap.c new file mode 100644 index 00000000000..91d0ed74dce --- /dev/null +++ b/layouts/community/ortho_4x4/jotix/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _NUMPAD 0 +#define _LOWER 1 +#define LOWER LT(_LOWER, KC_PENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Numpad + * +-------+-------+-------+-------+ + * | 7 | 8 | 9 | - | + * +-------+-------+-------+-------+ + * | 4 | 5 | 6 | + | + * +-------+-------+-------+-------+ + * | 1 | 2 | 3 | / | + * +-------+-------+-------+-------+ + * | | 0 | . | * | + * +-------+-------+-------+-------+ + */ +[_NUMPAD] = LAYOUT_ortho_4x4 ( + KC_P7, KC_P8, KC_P9, KC_PMNS, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, KC_PSLS, + LOWER, KC_P0, KC_PDOT,KC_PAST +), + +/* Lower */ +[_LOWER] = LAYOUT_ortho_4x4 ( + KC_NLCK,_______,_______,RESET , + _______,_______,_______,_______, + _______,_______,_______,_______, + _______,_______,_______,_______ +), +}; diff --git a/layouts/community/ortho_4x4/jotix/readme.md b/layouts/community/ortho_4x4/jotix/readme.md new file mode 100644 index 00000000000..0624f621551 --- /dev/null +++ b/layouts/community/ortho_4x4/jotix/readme.md @@ -0,0 +1,6 @@ +# Jotix ortho 4x4 keymap + +![keymap](https://i.imgur.com/e67yN7x.jpg) + +Enter is 'Lower' on hold. + diff --git a/layouts/community/ortho_5x12/333fred/README.md b/layouts/community/ortho_5x12/333fred/README.md new file mode 100644 index 00000000000..f619effc610 --- /dev/null +++ b/layouts/community/ortho_5x12/333fred/README.md @@ -0,0 +1,75 @@ +# 333fred's 5x12 Layout + +This 5x12 layout is based on my Ergodox Infinity Layout, which is [here](../../ergodox/333fred/README.md). It doesn't have all of my VS extensions. + +## Layers + +### QWERTY +The shift modifiers on this layer all use OSM to allow for quick single capitalization. LwrVIM acts a combo one-shot toggle and momentary layer toggle. Tap once to make the next key be sent on the Lower. Hold to move to the Lower layer until release. Tap and hold (so press, release, press and hold) to move to the VIM layer until release. Game is a regular toggle layer. + +``` +Qwerty +,-----------------------------------------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Tab | Q | W | E | R | T | Y | U | I | O | P | \ | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Esc | A | S | D | F | G | H | J | K | L | ; | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | Alt | F4 | GUI | Bksp |LwrVIM| Spc | Ent | Lock | = | RAlt | Del | +`-----------------------------------------------------------------------------------' +``` + +### Lower +My symbol and numpad layer. APscr is a macro that sends ALT+PRSC, to take a screenshot of the current application. + +``` +Lower +,-----------------------------------------------------------------------------------. +| Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | ! | @ | ( | ) | | | 7 | 8 | 9 | * | ) | F12 | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | # | $ | { | } | ` | 4 | 5 | 6 | + | } | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Pscr | | | | | GAME | 0 | . | = | Prev | Next | Play | +`-----------------------------------------------------------------------------------' +``` + +### VIM Movement +Pressing and holding F moves to this layer, which turns hjkl into vim movement keys. a and d are macros which send WIN+Left and WIN+Right, respectively. Shift and CTRL have been remapped for ease of selecting text. +``` +Vim Movement (Hold down F) +,-----------------------------------------------------------------------------------. +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | DLeft|DRight| LCTRL| | | Left | Down | Up | Right| | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | LShft| | | | | | | | +`-----------------------------------------------------------------------------------' + ``` + +### Gaming +This layer is designed for playing games. All one-shot modification has been turned off, and the common game controls keys have been moved around for easier access. +``` +Gaming mode (Raise) +,-----------------------------------------------------------------------------------. +| ESC | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| CTRL | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Shift| Z | | | | | | | | | | GUI | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY| +`-----------------------------------------------------------------------------------' +``` diff --git a/layouts/community/ortho_5x12/333fred/config.h b/layouts/community/ortho_5x12/333fred/config.h new file mode 100644 index 00000000000..7835fa1f07d --- /dev/null +++ b/layouts/community/ortho_5x12/333fred/config.h @@ -0,0 +1,9 @@ +#pragma once + +#include "333fred_config.h" + +#define USE_SERIAL +#define MASTER_LEFT + +#undef TAPPING_TERM +#define TAPPING_TERM 150 diff --git a/layouts/community/ortho_5x12/333fred/keymap.c b/layouts/community/ortho_5x12/333fred/keymap.c new file mode 100644 index 00000000000..a228a49d4e8 --- /dev/null +++ b/layouts/community/ortho_5x12/333fred/keymap.c @@ -0,0 +1,106 @@ +#include QMK_KEYBOARD_H +#include "333fred.h" + +extern keymap_config_t keymap_config; + +#if (!defined(LAYOUT) && defined(KEYMAP)) +# define LAYOUT KEYMAP +#endif + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | F4 | GUI | Bksp |Lwr/VM| Spc | Ent | Lock | = | Alt | Del | + * `-----------------------------------------------------------------------------------' + */ +[BASE] = LAYOUT_ortho_5x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ + KC_LCTL, KC_LALT, KC_F4, KC_LGUI, KC_BSPC, TD(TD_SYM_VIM), KC_SPC, KC_ENT, KC_LOCK, KC_EQL, KC_RALT, KC_DEL \ +), + +/* Symbols + * ,-----------------------------------------------------------------------------------. + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ! | @ | ( | ) | | | 7 | 8 | 9 | * | ) | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | # | $ | { | } | ` | 4 | 5 | 6 | + | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Pscr | | | | | GAME | 0 | . | = | Prev | Next | Play | + * `-----------------------------------------------------------------------------------' + */ +[SYMB] = LAYOUT_ortho_5x12( \ + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ + _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \ + _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \ + PSCREEN_APP, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \ + KC_PSCR, _______, _______, _______, _______, TG(GAME), KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ +), + +/* Vim Movement (Hold down F) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | LSHFT| | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | DLeft|DRight| LCTRL| LGUI | | Left | Down | Up | Right| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[VIM] = LAYOUT_ortho_5x12( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Gaming mode (Raise) + * All one-shot mods are disabled on this layer + * ,-----------------------------------------------------------------------------------. + * | ESC | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CTRL | | | | F | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | | | | | | | | | | GUI | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY| + * `-----------------------------------------------------------------------------------' + */ +[GAME] = LAYOUT_ortho_5x12( \ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ + KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSL(SYMB), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ +) +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_process_keycode(keycode); + return true; +} diff --git a/keyboards/nyquist/keymaps/333fred/rules.mk b/layouts/community/ortho_5x12/333fred/rules.mk similarity index 100% rename from keyboards/nyquist/keymaps/333fred/rules.mk rename to layouts/community/ortho_5x12/333fred/rules.mk diff --git a/layouts/community/ortho_5x12/drashna/config.h b/layouts/community/ortho_5x12/drashna/config.h new file mode 100644 index 00000000000..7504338fff4 --- /dev/null +++ b/layouts/community/ortho_5x12/drashna/config.h @@ -0,0 +1,22 @@ +#pragma once + +/* ws2812 RGB LED */ +#if defined(KEYBOARD_fractal) +# define RGB_DI_PIN D2 +# undef RGBLED_NUM +# define RGBLIGHT_ANIMATIONS +# define RGBLED_NUM 29 // Number of LEDs +# undef RGBLIGHT_HUE_STEP +# define RGBLIGHT_HUE_STEP 8 +# undef RGBLIGHT_SAT_STEP +# define RGBLIGHT_SAT_STEP 8 +# undef RGBLIGHT_VAL_STEP +# define RGBLIGHT_VAL_STEP 8 +# define RGBLIGHT_LIMIT_VAL 175 +# define RGBLIGHT_SLEEP + +# define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 +# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 +# define B7_AUDIO +# define NO_MUSIC_MODE +#endif diff --git a/layouts/community/ortho_5x12/drashna/keymap.c b/layouts/community/ortho_5x12/drashna/keymap.c new file mode 100644 index 00000000000..26be99af5c3 --- /dev/null +++ b/layouts/community/ortho_5x12/drashna/keymap.c @@ -0,0 +1,140 @@ +/* Copyright 2015-2017 Jack Humbert + * Modified by KeyPCB for the Fractal keyboard + * Backlight isn't on the Fractal, so I've removed the keycode from the keymaps + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "drashna.h" + +// clang-format off +#define LAYOUT_ortho_5x12_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A \ + ) \ + LAYOUT_ortho_5x12_wrapper( \ + KC_GRV, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ + KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_BSPC, \ + KC_ESC, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, KC_QUOT, \ + KC_MLSF, CTL_T(K31), K32, K33, K34, K35, K36, K37, K38, K39, CTL_T(K3A), KC_ENT, \ + KC_NO, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ) +#define LAYOUT_ortho_5x12_base_wrapper(...) LAYOUT_ortho_5x12_base(__VA_ARGS__) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_ortho_5x12_base_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ +), + +[_COLEMAK] = LAYOUT_ortho_5x12_base_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ +), + +[_DVORAK] = LAYOUT_ortho_5x12_base_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ +), + +[_WORKMAN] = LAYOUT_ortho_5x12_base_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ +), + +[_MODS] = LAYOUT_ortho_5x12_wrapper( + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_5x12_wrapper( \ + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_PIPE, + KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, _______, + _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_5x12_wrapper( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, + KC_DEL, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_5x12_wrapper( \ + KC_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RST, + VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, _______, + _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; +// clang-format on diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk new file mode 100644 index 00000000000..ee7c2ad63ce --- /dev/null +++ b/layouts/community/ortho_5x12/drashna/rules.mk @@ -0,0 +1,23 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +TAP_DANCE_ENABLE = no +AUDIO_ENABLE = yes +ifneq (,$(findstring fractal,$(KEYBOARD))) # Make sure it IS the Planck Light + RGB_MATRIX_ENABLE = no + AUDIO_ENABLE = yes + RGBLIGHT_ENABLE = yes + RGBLIGHT_TWINKLE = yes + BOOTLOADER = qmk-dfu +endif + +ifeq ($(strip $(PROTOCOL)), VUSB) +NKRO_ENABLE = no +else +NKRO_ENABLE = yes +endif + + +MACROS_ENABLED = no diff --git a/layouts/community/ortho_5x12/rs/config.h b/layouts/community/ortho_5x12/rs/config.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/layouts/community/ortho_5x12/rs/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/layouts/community/ortho_5x12/rs/keymap.c b/layouts/community/ortho_5x12/rs/keymap.c new file mode 100644 index 00000000000..15cbabaac14 --- /dev/null +++ b/layouts/community/ortho_5x12/rs/keymap.c @@ -0,0 +1,63 @@ +#include QMK_KEYBOARD_H +#include "rs.h" + +// Used to create a keymap using only KC_ prefixed keys +#ifndef LAYOUT_kc +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ + ) \ + LAYOUT_ortho_5x12( \ + KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ + KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ + KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b, \ + KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45, KC_##k46, KC_##k47, KC_##k48, KC_##k49, KC_##k4a, KC_##k4b \ + ) +#endif + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( \ + // ,-----------------------------------------------------------------------------------. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , MINS , + // |------+------+------+------+------+------+------+------+------+------+------+------| + TAB , Q , W , E , R , T , Y , U , I , O , P , EQL , + // |------+------+------+------+------+------+------+------+------+------+------+------| + ESCC , A , S , D , F , G , H , J , K , L , SCLN , QUOT , + // |------+------+------+------+------+------+------+------+------+------+------+------| + LSFT , Z , X , C , V , B , N , M , COMM , DOT , SLSH , ENTS , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , LCTL , LALT , LGUI , SPC , SPC , BCOD , FN , , LEFT , RGHT + // `---------------------------------------------------+-------------------------------' + ), + [_CODE] = LAYOUT_kc( + // ,-----------------------------------------------------------------------------------. + , , , , , , , , , , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + GRV , EXLM , AT , HASH , DLR , PERC , CIRC , LPLT , ASTR , RPGT , NEQL , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , 1 , 2 , 3 , 4 , 5 , MINS , LBRC , UP , RBRC , , BSLS , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , 6 , 7 , 8 , 9 , 0 , AMPR , LEFT , DOWN , RGHT , , PIPE , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , , , , DOT , , , , , , + // `-----------------------------------------------------------------------------------' + ), + [_FN] = LAYOUT_kc( + // ,-----------------------------------------------------------------------------------. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10 , F11 , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , , , , , , , , , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + BLTG , BLUP , , , , BRMU , VOLU , , PGUP , , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + BLTG , BLDN , , , RST , BRMD , VOLD , CTRA , PGDN , CTRE , , , + // |------+------+------+------+------+------+------+------+------+------+------+------| + , , , , , , MUTE , , , , , + // `-----------------------------------------------------------------------------------' + ), +}; + diff --git a/layouts/community/ortho_5x12/rs/readme.md b/layouts/community/ortho_5x12/rs/readme.md new file mode 100644 index 00000000000..d23ab66877a --- /dev/null +++ b/layouts/community/ortho_5x12/rs/readme.md @@ -0,0 +1 @@ +See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/layouts/community/ortho_5x12/xyverz/config.h b/layouts/community/ortho_5x12/xyverz/config.h index 4489c6e5f54..5f9f6e5c11c 100644 --- a/layouts/community/ortho_5x12/xyverz/config.h +++ b/layouts/community/ortho_5x12/xyverz/config.h @@ -6,7 +6,9 @@ #define BACKLIGHT_LEVELS 8 /* ws2812 RGB LED */ +#ifndef RGBLIGHT_ENABLE #undef RGB_DI_PIN +#endif #if defined(KEYBOARD_preonic_rev2) #define RGB_DI_PIN B3 #undef RGBLED_NUM diff --git a/layouts/community/ortho_5x12/xyverz/keymap.c b/layouts/community/ortho_5x12/xyverz/keymap.c index 23a456e6d6d..bbf1d7bb0ea 100644 --- a/layouts/community/ortho_5x12/xyverz/keymap.c +++ b/layouts/community/ortho_5x12/xyverz/keymap.c @@ -24,10 +24,6 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Aliases to keep the keymap tidy #define GUIBSPC GUI_T(KC_BSPC) // GUI when held, BSPC when tapped. #define RGB_SWR RGB_M_SW // Swirl Animation alias diff --git a/layouts/community/ortho_5x15/wanleg/config.h b/layouts/community/ortho_5x15/wanleg/config.h index 1043986f7a6..d2b3d671932 100644 --- a/layouts/community/ortho_5x15/wanleg/config.h +++ b/layouts/community/ortho_5x15/wanleg/config.h @@ -1,8 +1,16 @@ #pragma once -// set top left key as bootloader mode escape key on 5x5 75key layout -#if defined(KEYBOARD_5x5) && !defined(PRO_MICRO) -#define QMK_LED B0 -#define QMK_ESC_OUTPUT D7 // usually COL -#define QMK_ESC_INPUT B2 // usually ROW -#endif \ No newline at end of file +//5x5 powered by Adafruit Feather 32u4 Bluefruit LE +#if defined(KEYBOARD_40percentclub_5x5) && defined(BLUEFRUIT) + +//need to undefine standard 5x5 array before defining alternate Bluefruit array +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS +#define MATRIX_ROW_PINS { F7, F6, F5, D1, D0 } +//last 5 elements not tested +#define MATRIX_COL_PINS { C6, D7, B5, B6, B7, D6, C7, F0, F1, F4, B1, B2, B3, D2, D3 } + +//get rid of description - too long to show properly in Windows +#undef DESCRIPTION +#define DESCRIPTION +#endif diff --git a/layouts/community/ortho_5x15/wanleg/keymap.c b/layouts/community/ortho_5x15/wanleg/keymap.c index df742411570..ea4521d3d90 100644 --- a/layouts/community/ortho_5x15/wanleg/keymap.c +++ b/layouts/community/ortho_5x15/wanleg/keymap.c @@ -1,40 +1,118 @@ #include QMK_KEYBOARD_H #include "wanleg.h" -#define _________________BLANK_75__________________ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ #define _________________BLANK_50__________________ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -#define _________________Num_Row_75________________ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK + +#if defined(PADC) +#define LAYOUT_75_base( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ + ) \ + LAYOUT_ortho_5x15_wrapper( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, QWERTY, GHERKIN, FUNCTION, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, \ + K00, K01, K02, K03, K04, K05, K0c, K0d, K0e, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K1c, K1d, K1e, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K2c, K2d, K2e, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K3c, K3d, K3e, K36, K37, K38, K39, K3a, K3b \ + ) + +#elif defined(PADL) +#define LAYOUT_75_base( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ + ) \ + LAYOUT_ortho_5x15_wrapper( \ + QWERTY, GHERKIN, FUNCTION, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, \ + K0c, K0d, K0e, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K1c, K1d, K1e, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K2c, K2d, K2e, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K3c, K3d, K3e, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ + ) + +#else +#define LAYOUT_75_base( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ + ) \ + LAYOUT_ortho_5x15_wrapper( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, QWERTY, GHERKIN, FUNCTION, \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ + ) +#endif + +#define LAYOUT_75_base_wrapper(...) LAYOUT_75_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -#if defined(KEYBOARD_5x5) -[GK75] = LAYOUT_ortho_5x15_wrapper( - _________________Num_Row_75________________, QWERTY75, XXXXXXX, FUNCTION75, - _______________GherkinLike_0_______________, KC_KP_7, KC_KP_8, KC_KP_9, - _______________GherkinLike_1_______________, KC_KP_4, KC_KP_5, KC_KP_6, - TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM75, KC_V), LT(ETC75, KC_B), KC_N, LT(DIR75, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, - TD(RST_TAP_DANCE), GHERKIN50, KC_LALT, NUMPAD, NUMBER75, ETCETERA75, KC_SPC,DIRECTION75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +#if defined(KEYBOARD_40percentclub_5x5) +[_GK] = LAYOUT_75_base_wrapper( + _______________GherkinLike_0_______________, KC_7, KC_8, KC_9, + _______________GherkinLike_1_______________, KC_4, KC_5, KC_6, + TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V), LT(ETC, KC_B), KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_1, KC_2, KC_3, + TD(RST_TAP_DANCE), GHERKIN50, KC_LALT, NUMPAD, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_0, KC_0, KC_DOT ), +[GK50] = LAYOUT_ortho_5x10_wrapper( + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, + _______________Gherkin_Row_0_______________, + _______________Gherkin_Row_1_______________, + _______________Gherkin_Row_2_______________, + TD(RST_TAP_DANCE), GHERKIN, NUMPAD, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, KC_RALT, KC_RGUI +), + +[gNUM] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________, + _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ +), + +[gDIR] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________, + _________________BLANK_50__________________ +), + +[gETC] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________, + _______, KC_CAPS, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ +), + +#if defined(BLUEFRUIT) [PAD] = LAYOUT_ortho_5x5_wrapper( - _______, _______, _______, _______, _______, + _______, _______, _______, OUT_BT, OUT_USB, _______________NUMPAD_Row__0_______________, _______, _______________NUMPAD_Row__1_______________, _______, _______________NUMPAD_Row__2_______________, _______, KC_KP_0, TD(LYR50_TAP_DANCE), KC_KP_DOT, KC_PMNS, _______ ), - -[GK50] = LAYOUT_ortho_5x10_wrapper( - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, - _______________Gherkin_Row_0_______________, - _______________Gherkin_Row_1_______________, - _______________Gherkin_Row_2_______________, - TD(RST_TAP_DANCE), GHERKIN75, NUMPAD, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, KC_RALT, KC_RGUI +#else + [PAD] = LAYOUT_ortho_5x5_wrapper( + _______, _______, _______, _______, _______, + _______________NUMPAD_Row__0_______________, _______, + _______________NUMPAD_Row__1_______________, _______, + _______________NUMPAD_Row__2_______________, _______, + KC_KP_0, TD(LYR50_TAP_DANCE), KC_KP_DOT, KC_PMNS, _______ ), - +#endif #else - /* Gherkin 75 + /* Gherkin-Like * .--------------------------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | | FN | + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | gherkin| FN | * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| * | | 7 | 8 | 9 | * | |--------+--------+--------| @@ -45,17 +123,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | 0 | 0 | . | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[GK75] = LAYOUT_ortho_5x15_wrapper( - _________________Num_Row_75________________, QWERTY75, XXXXXXX, FUNCTION75, - _______________GherkinLike_0_______________, KC_KP_7, KC_KP_8, KC_KP_9, - _______________GherkinLike_1_______________, KC_KP_4, KC_KP_5, KC_KP_6, - TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM75, KC_V), LT(ETC75, KC_B), KC_N, LT(DIR75, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, - KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, NUMBER75, ETCETERA75, KC_SPC,DIRECTION75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +[_GK] = LAYOUT_75_base_wrapper( + _______________GherkinLike_0_______________, KC_7, KC_8, KC_9, + _______________GherkinLike_1_______________, KC_4, KC_5, KC_6, + _______________GherkinLike_2_______________, KC_1, KC_2, KC_3, + _______________GherkinLike_3_______________, KC_0, KC_0, KC_DOT ), #endif - /* QWERTY 75 +/* QWERTY * .--------------------------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| gherkin| | FN | + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | gherkin| FN | * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| * | | 7 | 8 | 9 | * | |--------+--------+--------| @@ -66,17 +143,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | 0 | 0 | . | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[QW75] = LAYOUT_ortho_5x15_wrapper( - _________________Num_Row_75________________, GHERKIN75, XXXXXXX, FUNCTION75, - _______________Qwerty_Row__0_______________, KC_KP_7, KC_KP_8, KC_KP_9, - _______________Qwerty_Row__1_______________, KC_KP_4, KC_KP_5, KC_KP_6, - _______________Qwerty_Row__2_______________, KC_KP_1, KC_KP_2, KC_KP_3, - KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, SUBTER75, KC_LSFT, KC_SPC, SUPRA75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +[_QW] = LAYOUT_75_base_wrapper( + _______________Qwerty_Row__0_______________, KC_7, KC_8, KC_9, + _______________Qwerty_Row__1_______________, KC_4, KC_5, KC_6, + _______________Qwerty_Row__2_______________, KC_1, KC_2, KC_3, + _______________Qwerty_Row__3_______________, KC_0, KC_0, KC_DOT ), - /* SUBTER75 + /* SUBTER * .--------------------------------------------------------------------------------------------------------------------------------------. - * | SUBTER ROW 0 LAYOUT | | | | + * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------+--------+-----------------| * | | / | * | - | * | |--------+--------+--------| @@ -87,15 +163,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[SUB75] = LAYOUT_ortho_5x15_wrapper( - _______________SUBTER_Row__0_______________, _______, _______, _______, +[SUB] = LAYOUT_75_base_wrapper( _______________SUBTER_Row__0_______________, KC_PSLS, KC_PAST, KC_PMNS, - _______________SUBTER_Row__1_______________, _______, _______, KC_PPLS, + _______________SUBTER_Row__1_______________, _______, _______, KC_PPLS, _______________SUBTER_Row__2_______________, _______, _______, KC_PENT, - _______, _______, GHERKIN75, _______, _______, _______, KC_ENT, KC_LSFT, _______, _______, _______, _______, _______, _______, _______ + _______________SUBTER_Row__3_______________, _______, _______, _______ ), -/* SUPRA75 +/* SUPRA * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| @@ -108,15 +183,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[SUP75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, +[SUP] = LAYOUT_75_base_wrapper( ________________SUPRA_Row_0________________, _______, _______, _______, ________________SUPRA_Row_1________________, _______, _______, _______, ________________SUPRA_Row_2________________, _______, _______, _______, - _________________BLANK_75__________________ + ________________SUPRA_Row_3________________, _______, _______, _______ ), -/* Gherkin 75 Numbers +/* Gherkin-Like Numbers * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| @@ -129,15 +203,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[NUM75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, +[NUM] = LAYOUT_75_base_wrapper( _______________NUMBERS_Row_0_______________, KC_PSLS, KC_PAST, KC_PMNS, _______________NUMBERS_Row_1_______________, _______, _______, KC_PPLS, _______________NUMBERS_Row_2_______________, _______, _______, KC_PENT, _______________NUMBERS_Row_3_______________, _______, _______, _______ ), -/* Gherkin 75 Et Cetera +/* Gherkin-Like Et Cetera * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| @@ -150,15 +223,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[ETC75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, +[ETC] = LAYOUT_75_base_wrapper( ______________ETCETERA_Row__0______________, _______, _______, _______, ______________ETCETERA_Row__1______________, _______, _______, _______, ______________ETCETERA_Row__2______________, _______, _______, _______, ______________ETCETERA_Row__3______________, _______, _______, _______ ), -/* Gherkin 75 Directional Keys +/* Gherkin-Like Directional Keys * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| @@ -171,57 +243,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[DIR75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, +[DIR] = LAYOUT_75_base_wrapper( _____________DIRECTIONS_Row__0_____________, _______, _______, _______, _____________DIRECTIONS_Row__1_____________, _______, _______, _______, _____________DIRECTIONS_Row__2_____________, _______, _______, _______, - _______, _______, QWERTY75, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _____________DIRECTIONS_Row__3_____________, _______, _______, _______ ), - -/* FUNCTION 75 +/* Gherkin FN/Lighting * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| - * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | CAP LK | MS BT5 | MS BT4 | MS BT3 | MS BT2 | SLOW M | FAST M | NEXT | VOL+ | VOL- | PLAY | | | | WHEEL+ | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | RGB TG | RGB MD | RGB HI | RGB HD | RGB SI | RGB SD | RGB VI | RGB VD | BL TOG | BL INC | BL DEC | | | MOUS U | WHEEL- | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | MS BT1 | | | | | | MOUS L | MOUS D | MOUS R | + * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| + * | | | | | + * | |--------+--------+--------| + * | 4x12 FN/Lighting LAYOUT | | | | + * | |--------+--------+--------| + * | | | | | + * | |--------+--------+--------| + * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[FN75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, - _________________BLANK_75__________________, - KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______, KC_WH_U, - RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, _______, _______, KC_MS_U, KC_WH_D, - _______, _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R -), - -[gNUM] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_NUM_0_______________, - _______________Gherkin_NUM_1_______________, - _______________Gherkin_NUM_2_______________, - _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ -), -[gDIR] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_DIR_0_______________, - _______________Gherkin_DIR_1_______________, - _______________Gherkin_DIR_2_______________, - _________________BLANK_50__________________ +[_FN] = LAYOUT_75_base_wrapper( + _______, _______________Gherkin_FN_0________________, _______, _______, _______, _______, + _______, _______________Gherkin_FN_1________________, _______, _______, _______, _______, + _______, _______________Gherkin_FN_2________________, _______, _______, _______, _______, + _______, _________________BLANK_50__________________, _______, _______, _______, _______ ), -[gETC] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_ETC_0_______________, - _______________Gherkin_ETC_1_______________, - _______________Gherkin_ETC_2_______________, - _______, KC_CAPS, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ -), }; diff --git a/layouts/community/ortho_5x15/wanleg/rules.mk b/layouts/community/ortho_5x15/wanleg/rules.mk index e36226fb2ee..96bbaa458e9 100644 --- a/layouts/community/ortho_5x15/wanleg/rules.mk +++ b/layouts/community/ortho_5x15/wanleg/rules.mk @@ -1 +1,11 @@ -SWAP_HANDS_ENABLE = no \ No newline at end of file +#ifeq ($(strip $(KEYBOARD)), xd75) +#or +#ifeq (,$(findstring xd75,$(KEYBOARD))) +#something +#endif + +#ifeq ($(strip $(KEYBOARD)), 40percentclub/5x5) +#or +#ifeq (,$(findstring 40percentclub/5x5,$(KEYBOARD))) +#something +#endif \ No newline at end of file diff --git a/layouts/community/ortho_4x12/guidoism/config.h b/layouts/community/planck_mit/guidoism/config.h similarity index 100% rename from layouts/community/ortho_4x12/guidoism/config.h rename to layouts/community/planck_mit/guidoism/config.h diff --git a/layouts/community/ortho_4x12/guidoism/generate_c.py b/layouts/community/planck_mit/guidoism/generate_c.py similarity index 100% rename from layouts/community/ortho_4x12/guidoism/generate_c.py rename to layouts/community/planck_mit/guidoism/generate_c.py diff --git a/layouts/community/ortho_4x12/guidoism/guidoism.json b/layouts/community/planck_mit/guidoism/guidoism.json similarity index 100% rename from layouts/community/ortho_4x12/guidoism/guidoism.json rename to layouts/community/planck_mit/guidoism/guidoism.json diff --git a/layouts/community/ortho_4x12/guidoism/keymap.c b/layouts/community/planck_mit/guidoism/keymap.c similarity index 100% rename from layouts/community/ortho_4x12/guidoism/keymap.c rename to layouts/community/planck_mit/guidoism/keymap.c diff --git a/layouts/community/ortho_4x12/guidoism/keys.json b/layouts/community/planck_mit/guidoism/keys.json similarity index 100% rename from layouts/community/ortho_4x12/guidoism/keys.json rename to layouts/community/planck_mit/guidoism/keys.json diff --git a/layouts/community/ortho_4x12/guidoism/readme.md b/layouts/community/planck_mit/guidoism/readme.md similarity index 100% rename from layouts/community/ortho_4x12/guidoism/readme.md rename to layouts/community/planck_mit/guidoism/readme.md diff --git a/layouts/community/tkl_ansi/talljoe-tkl/keymap.c b/layouts/community/tkl_ansi/talljoe-tkl/keymap.c index b5dc5449276..7812add812b 100644 --- a/layouts/community/tkl_ansi/talljoe-tkl/keymap.c +++ b/layouts/community/tkl_ansi/talljoe-tkl/keymap.c @@ -1,89 +1 @@ -#ifdef KEYBOARD_zeal60 -#include "config.h" -#include "zeal60.h" -#include "zeal_backlight.h" -#include "action_layer.h" -#include "solarized.h" -#include "talljoe.h" - -// from zeal_backlight.c -// we want to be able to set indicators for the spacebar stabs -// but they are not represented by a row/index. -extern zeal_backlight_config g_config; -void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ); - -void set_backlight_defaults(void) { - uint8_t space; - uint8_t caps_lock; - map_row_column_to_led(3, 12, &caps_lock); - map_row_column_to_led(4, 7, &space); - zeal_backlight_config default_values = { - .use_split_backspace = USE_SPLIT_BACKSPACE, - .use_split_left_shift = USE_SPLIT_LEFT_SHIFT, - .use_split_right_shift = USE_SPLIT_RIGHT_SHIFT, - .use_7u_spacebar = USE_7U_SPACEBAR, - .use_iso_enter = USE_ISO_ENTER, - .disable_when_usb_suspended = 1, - .disable_after_timeout = 0, - .brightness = 255, - .effect = 10, - .color_1 = solarized.base2, - .color_2 = solarized.base02, - .caps_lock_indicator = { .index = caps_lock, .color = solarized.red }, - .layer_1_indicator = { .index = space, .color = solarized.blue }, - .layer_2_indicator = { .index = space, .color = solarized.yellow }, - .layer_3_indicator = { .index = 254, .color = solarized.red }, - .alphas_mods = { - BACKLIGHT_ALPHAS_MODS_ROW_0, - BACKLIGHT_ALPHAS_MODS_ROW_1, - BACKLIGHT_ALPHAS_MODS_ROW_2, - BACKLIGHT_ALPHAS_MODS_ROW_3, - BACKLIGHT_ALPHAS_MODS_ROW_4 } - }; - memcpy(&g_config, &default_values, sizeof(zeal_backlight_config)); - backlight_config_save(); - - solarized_t* S = &solarized; - HSV alphas = S->base2; - HSV custom_color_map[MATRIX_ROWS][MATRIX_COLS] = CM( - S->red, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->red, - S->orange, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->orange, - S->green, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->green, - S->blue, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->blue, S->blue, - S->violet, S->magenta, S->yellow, alphas, S->yellow, S->magenta, S->violet, S->green - ); - for (uint8_t row = 0; row < MATRIX_ROWS; ++row) { - for (uint8_t col = 0; col < MATRIX_COLS; ++col) { - backlight_set_key_color(row, col, custom_color_map[row][col]); - } - } -} - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - static uint8_t last_effect; - switch (keycode) { - case DFAULTS: - if (IS_PRESSED(record->event)) set_backlight_defaults(); - return false; - case BL_TOGG: - if (IS_PRESSED(record->event)) { - if (g_config.effect) { - last_effect = g_config.effect; - g_config.effect = 0; - } else { - g_config.effect = last_effect; - } - } - return false; - case EFFECT...EFFECT_END: - if (IS_PRESSED(record->event)) { - uint8_t effect = keycode - EFFECT; - g_config.effect = effect; - backlight_config_save(); - } - return false; - } - - return true; -} -#endif +// This space intentionally left blank diff --git a/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c b/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c new file mode 100644 index 00000000000..c9c8313298c --- /dev/null +++ b/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c @@ -0,0 +1,21 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_tsangan_hhkb( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL,KC_BSPC,KC_BSPC, + KC_TAB , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC, KC_BSLS , + KC_CAPS , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT , + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT ,KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ) +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + +}; diff --git a/layouts/default/60_tsangan_hhkb/layout.json b/layouts/default/60_tsangan_hhkb/layout.json new file mode 100644 index 00000000000..117d26d4194 --- /dev/null +++ b/layouts/default/60_tsangan_hhkb/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"",{w:1},""], +[{w:1.5},"",{w:1},"",{w:1.5},"",{w:7},"",{w:1.5},"",{w:1},"",{w:1.5},""] diff --git a/layouts/default/60_tsangan_hhkb/readme.md b/layouts/default/60_tsangan_hhkb/readme.md new file mode 100644 index 00000000000..f1e955f1e72 --- /dev/null +++ b/layouts/default/60_tsangan_hhkb/readme.md @@ -0,0 +1,3 @@ +# 60_tsangan_hhkb + + LAYOUT_60_tsangan_hhkb \ No newline at end of file diff --git a/layouts/default/65_iso/default_65_iso/keymap.c b/layouts/default/65_iso/default_65_iso/keymap.c new file mode 100644 index 00000000000..085304a87f7 --- /dev/null +++ b/layouts/default/65_iso/default_65_iso/keymap.c @@ -0,0 +1,12 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = LAYOUT_65_iso(\ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGUP, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGDN, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ) +}; diff --git a/layouts/default/65_iso/layout.json b/layouts/default/65_iso/layout.json new file mode 100644 index 00000000000..6496e93634d --- /dev/null +++ b/layouts/default/65_iso/layout.json @@ -0,0 +1,5 @@ +["","","","","","","","","","","","","",{w:2},"",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",""], +[{w:1.75},"","","","","","","","","","","","","",{x:1.25},""], +[{w:1.25},"","","","","","","","","","","","",{w:1.75},"","",""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","","",""] diff --git a/layouts/default/65_iso/readme.md b/layouts/default/65_iso/readme.md new file mode 100644 index 00000000000..d23c157d0f2 --- /dev/null +++ b/layouts/default/65_iso/readme.md @@ -0,0 +1,5 @@ +# 65_iso + + LAYOUT_65_iso + +This is the 65% layout made popular by boards such as the [Input Club Whitefox](https://github.com/qmk/qmk_firmware/tree/master/keyboards/whitefox) and [RAMA M65-A](https://github.com/qmk/qmk_firmware/tree/master/keyboards/jc65), in ISO. diff --git a/layouts/default/66_iso/default_60_iso/keymap.c b/layouts/default/66_iso/default_60_iso/keymap.c deleted file mode 100644 index ea0c10a9ce6..00000000000 --- a/layouts/default/66_iso/default_60_iso/keymap.c +++ /dev/null @@ -1,11 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_66_iso( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTRL, KC_LALT, KC_LGUI, KC_SPACE, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, - ) -}; diff --git a/layouts/default/66_iso/default_66_iso/keymap.c b/layouts/default/66_iso/default_66_iso/keymap.c new file mode 100644 index 00000000000..4f97acf41fc --- /dev/null +++ b/layouts/default/66_iso/default_66_iso/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_66_iso( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/75_iso/default_75_iso/keymap.c b/layouts/default/75_iso/default_75_iso/keymap.c new file mode 100644 index 00000000000..2fcca4d2b58 --- /dev/null +++ b/layouts/default/75_iso/default_75_iso/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = LAYOUT_75_iso(\ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/75_iso/layout.json b/layouts/default/75_iso/layout.json new file mode 100644 index 00000000000..6606d90e1d8 --- /dev/null +++ b/layouts/default/75_iso/layout.json @@ -0,0 +1,6 @@ +[{a:7},"","","","","","","","","","","","","","","",""], +["","","","","","","","","","","","","",{w:2},"",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",""], +[{w:1.75},"","","","","","","","","","","","","",{x:1.25},""], +[{w:1.25},"","","","","","","","","","","","",{w:1.75},"","",""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","","",""] diff --git a/layouts/default/75_iso/readme.md b/layouts/default/75_iso/readme.md new file mode 100644 index 00000000000..cbcaeaf9e57 --- /dev/null +++ b/layouts/default/75_iso/readme.md @@ -0,0 +1,3 @@ +# 75_iso + + LAYOUT_75_iso \ No newline at end of file diff --git a/layouts/default/numpad_5x4/default_numpad_5x4/keymap.c b/layouts/default/numpad_5x4/default_numpad_5x4/keymap.c index 1d68fb2f84d..0e913248f2f 100644 --- a/layouts/default/numpad_5x4/default_numpad_5x4/keymap.c +++ b/layouts/default/numpad_5x4/default_numpad_5x4/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_numpad_5x4( TG(1), KC_PSLS, KC_PAST, KC_PMNS, \ diff --git a/layouts/default/numpad_5x6/default_numpad_5x6/keymap.c b/layouts/default/numpad_5x6/default_numpad_5x6/keymap.c new file mode 100644 index 00000000000..527d0890529 --- /dev/null +++ b/layouts/default/numpad_5x6/default_numpad_5x6/keymap.c @@ -0,0 +1,18 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_numpad_5x6( + KC_ESC, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, KC_PMNS, + KC_A, KC_B, KC_P7, KC_P8, KC_P9, + KC_C, KC_D, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_E, KC_F, KC_P1, KC_P2, KC_P3, + KC_LCTL, TG(1), KC_P0, KC_PDOT, KC_PENT + ), + [1] = LAYOUT_numpad_5x6( + RESET, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, KC_PMNS, + KC_A, KC_B, KC_HOME, KC_UP, KC_PGUP, + KC_C, KC_D, KC_LEFT, KC_NO, KC_RGHT, KC_PPLS, + KC_E, KC_F, KC_END, KC_DOWN, KC_PGDN, + KC_LCTL, _______, KC_INS, KC_DEL, KC_PENT + ), +}; diff --git a/layouts/default/numpad_5x6/layout.json b/layouts/default/numpad_5x6/layout.json new file mode 100644 index 00000000000..7264cd5a6dc --- /dev/null +++ b/layouts/default/numpad_5x6/layout.json @@ -0,0 +1,6 @@ +["","","",""], +[{y:0.5},"","","",""], +["","","",{h:2},""], +["","",""], +["","","",{h:2},""], +[{w:2},"",""] diff --git a/layouts/default/numpad_5x6/readme.md b/layouts/default/numpad_5x6/readme.md new file mode 100644 index 00000000000..147097c8371 --- /dev/null +++ b/layouts/default/numpad_5x6/readme.md @@ -0,0 +1,3 @@ +# numpad_5x6 + + LAYOUT_numpad_5x6 diff --git a/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c b/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c new file mode 100644 index 00000000000..3f6285e2ddb --- /dev/null +++ b/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c @@ -0,0 +1,10 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_4x10( + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J + ) +}; diff --git a/layouts/default/ortho_4x10/layout.json b/layouts/default/ortho_4x10/layout.json new file mode 100644 index 00000000000..86f098e27eb --- /dev/null +++ b/layouts/default/ortho_4x10/layout.json @@ -0,0 +1,4 @@ +["","","","","","","","","",""], +["","","","","","","","","",""], +["","","","","","","","","",""], +["","","","","","","","","",""] diff --git a/layouts/default/ortho_4x10/readme.md b/layouts/default/ortho_4x10/readme.md new file mode 100644 index 00000000000..c5c29251c81 --- /dev/null +++ b/layouts/default/ortho_4x10/readme.md @@ -0,0 +1,3 @@ +# ortho_4x10 + + LAYOUT_ortho_4x10 diff --git a/layouts/default/ortho_5x4/default_ortho_5x4/keymap.c b/layouts/default/ortho_5x4/default_ortho_5x4/keymap.c index 061f06c381d..39d397d9096 100644 --- a/layouts/default/ortho_5x4/default_ortho_5x4/keymap.c +++ b/layouts/default/ortho_5x4/default_ortho_5x4/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS -#define XXXXXXX KC_NO - enum custom_keycodes { KC_P00 = SAFE_RANGE }; diff --git a/lib/lib8tion/LICENSE b/lib/lib8tion/LICENSE new file mode 100644 index 00000000000..ebe476330b1 --- /dev/null +++ b/lib/lib8tion/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 FastLED + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lib/lib8tion/lib8tion.c b/lib/lib8tion/lib8tion.c new file mode 100644 index 00000000000..84b3e9c61c9 --- /dev/null +++ b/lib/lib8tion/lib8tion.c @@ -0,0 +1,242 @@ +#define FASTLED_INTERNAL +#include + +#define RAND16_SEED 1337 +uint16_t rand16seed = RAND16_SEED; + + +// memset8, memcpy8, memmove8: +// optimized avr replacements for the standard "C" library +// routines memset, memcpy, and memmove. +// +// There are two techniques that make these routines +// faster than the standard avr-libc routines. +// First, the loops are unrolled 2X, meaning that +// the average loop overhead is cut in half. +// And second, the compare-and-branch at the bottom +// of each loop decrements the low byte of the +// counter, and if the carry is clear, it branches +// back up immediately. Only if the low byte math +// causes carry do we bother to decrement the high +// byte and check that result for carry as well. +// Results for a 100-byte buffer are 20-40% faster +// than standard avr-libc, at a cost of a few extra +// bytes of code. + +#if defined(__AVR__) +//__attribute__ ((noinline)) +void * memset8 ( void * ptr, uint8_t val, uint16_t num ) +{ + asm volatile( + " movw r26, %[ptr] \n\t" + " sbrs %A[num], 0 \n\t" + " rjmp Lseteven_%= \n\t" + " rjmp Lsetodd_%= \n\t" + "Lsetloop_%=: \n\t" + " st X+, %[val] \n\t" + "Lsetodd_%=: \n\t" + " st X+, %[val] \n\t" + "Lseteven_%=: \n\t" + " subi %A[num], 2 \n\t" + " brcc Lsetloop_%= \n\t" + " sbci %B[num], 0 \n\t" + " brcc Lsetloop_%= \n\t" + : [num] "+r" (num) + : [ptr] "r" (ptr), + [val] "r" (val) + : "memory" + ); + return ptr; +} + + + +//__attribute__ ((noinline)) +void * memcpy8 ( void * dst, const void* src, uint16_t num ) +{ + asm volatile( + " movw r30, %[src] \n\t" + " movw r26, %[dst] \n\t" + " sbrs %A[num], 0 \n\t" + " rjmp Lcpyeven_%= \n\t" + " rjmp Lcpyodd_%= \n\t" + "Lcpyloop_%=: \n\t" + " ld __tmp_reg__, Z+ \n\t" + " st X+, __tmp_reg__ \n\t" + "Lcpyodd_%=: \n\t" + " ld __tmp_reg__, Z+ \n\t" + " st X+, __tmp_reg__ \n\t" + "Lcpyeven_%=: \n\t" + " subi %A[num], 2 \n\t" + " brcc Lcpyloop_%= \n\t" + " sbci %B[num], 0 \n\t" + " brcc Lcpyloop_%= \n\t" + : [num] "+r" (num) + : [src] "r" (src), + [dst] "r" (dst) + : "memory" + ); + return dst; +} + +//__attribute__ ((noinline)) +void * memmove8 ( void * dst, const void* src, uint16_t num ) +{ + if( src > dst) { + // if src > dst then we can use the forward-stepping memcpy8 + return memcpy8( dst, src, num); + } else { + // if src < dst then we have to step backward: + dst = (char*)dst + num; + src = (char*)src + num; + asm volatile( + " movw r30, %[src] \n\t" + " movw r26, %[dst] \n\t" + " sbrs %A[num], 0 \n\t" + " rjmp Lmoveven_%= \n\t" + " rjmp Lmovodd_%= \n\t" + "Lmovloop_%=: \n\t" + " ld __tmp_reg__, -Z \n\t" + " st -X, __tmp_reg__ \n\t" + "Lmovodd_%=: \n\t" + " ld __tmp_reg__, -Z \n\t" + " st -X, __tmp_reg__ \n\t" + "Lmoveven_%=: \n\t" + " subi %A[num], 2 \n\t" + " brcc Lmovloop_%= \n\t" + " sbci %B[num], 0 \n\t" + " brcc Lmovloop_%= \n\t" + : [num] "+r" (num) + : [src] "r" (src), + [dst] "r" (dst) + : "memory" + ); + return dst; + } +} + +#endif /* AVR */ + + + + +#if 0 +// TEST / VERIFICATION CODE ONLY BELOW THIS POINT +#include +#include "lib8tion.h" + +void test1abs( int8_t i) +{ + Serial.print("abs("); Serial.print(i); Serial.print(") = "); + int8_t j = abs8(i); + Serial.print(j); Serial.println(" "); +} + +void testabs() +{ + delay(5000); + for( int8_t q = -128; q != 127; q++) { + test1abs(q); + } + for(;;){}; +} + + +void testmul8() +{ + delay(5000); + byte r, c; + + Serial.println("mul8:"); + for( r = 0; r <= 20; r += 1) { + Serial.print(r); Serial.print(" : "); + for( c = 0; c <= 20; c += 1) { + byte t; + t = mul8( r, c); + Serial.print(t); Serial.print(' '); + } + Serial.println(' '); + } + Serial.println("done."); + for(;;){}; +} + + +void testscale8() +{ + delay(5000); + byte r, c; + + Serial.println("scale8:"); + for( r = 0; r <= 240; r += 10) { + Serial.print(r); Serial.print(" : "); + for( c = 0; c <= 240; c += 10) { + byte t; + t = scale8( r, c); + Serial.print(t); Serial.print(' '); + } + Serial.println(' '); + } + + Serial.println(' '); + Serial.println("scale8_video:"); + + for( r = 0; r <= 100; r += 4) { + Serial.print(r); Serial.print(" : "); + for( c = 0; c <= 100; c += 4) { + byte t; + t = scale8_video( r, c); + Serial.print(t); Serial.print(' '); + } + Serial.println(' '); + } + + Serial.println("done."); + for(;;){}; +} + + + +void testqadd8() +{ + delay(5000); + byte r, c; + for( r = 0; r <= 240; r += 10) { + Serial.print(r); Serial.print(" : "); + for( c = 0; c <= 240; c += 10) { + byte t; + t = qadd8( r, c); + Serial.print(t); Serial.print(' '); + } + Serial.println(' '); + } + Serial.println("done."); + for(;;){}; +} + +void testnscale8x3() +{ + delay(5000); + byte r, g, b, sc; + for( byte z = 0; z < 10; z++) { + r = random8(); g = random8(); b = random8(); sc = random8(); + + Serial.print("nscale8x3_video( "); + Serial.print(r); Serial.print(", "); + Serial.print(g); Serial.print(", "); + Serial.print(b); Serial.print(", "); + Serial.print(sc); Serial.print(") = [ "); + + nscale8x3_video( r, g, b, sc); + + Serial.print(r); Serial.print(", "); + Serial.print(g); Serial.print(", "); + Serial.print(b); Serial.print("]"); + + Serial.println(' '); + } + Serial.println("done."); + for(;;){}; +} + +#endif diff --git a/lib/lib8tion/lib8tion.h b/lib/lib8tion/lib8tion.h new file mode 100644 index 00000000000..4c770cbcb5e --- /dev/null +++ b/lib/lib8tion/lib8tion.h @@ -0,0 +1,934 @@ +#ifndef __INC_LIB8TION_H +#define __INC_LIB8TION_H + +/* + + Fast, efficient 8-bit math functions specifically + designed for high-performance LED programming. + + Because of the AVR(Arduino) and ARM assembly language + implementations provided, using these functions often + results in smaller and faster code than the equivalent + program using plain "C" arithmetic and logic. + + + Included are: + + + - Saturating unsigned 8-bit add and subtract. + Instead of wrapping around if an overflow occurs, + these routines just 'clamp' the output at a maxumum + of 255, or a minimum of 0. Useful for adding pixel + values. E.g., qadd8( 200, 100) = 255. + + qadd8( i, j) == MIN( (i + j), 0xFF ) + qsub8( i, j) == MAX( (i - j), 0 ) + + - Saturating signed 8-bit ("7-bit") add. + qadd7( i, j) == MIN( (i + j), 0x7F) + + + - Scaling (down) of unsigned 8- and 16- bit values. + Scaledown value is specified in 1/256ths. + scale8( i, sc) == (i * sc) / 256 + scale16by8( i, sc) == (i * sc) / 256 + + Example: scaling a 0-255 value down into a + range from 0-99: + downscaled = scale8( originalnumber, 100); + + A special version of scale8 is provided for scaling + LED brightness values, to make sure that they don't + accidentally scale down to total black at low + dimming levels, since that would look wrong: + scale8_video( i, sc) = ((i * sc) / 256) +? 1 + + Example: reducing an LED brightness by a + dimming factor: + new_bright = scale8_video( orig_bright, dimming); + + + - Fast 8- and 16- bit unsigned random numbers. + Significantly faster than Arduino random(), but + also somewhat less random. You can add entropy. + random8() == random from 0..255 + random8( n) == random from 0..(N-1) + random8( n, m) == random from N..(M-1) + + random16() == random from 0..65535 + random16( n) == random from 0..(N-1) + random16( n, m) == random from N..(M-1) + + random16_set_seed( k) == seed = k + random16_add_entropy( k) == seed += k + + + - Absolute value of a signed 8-bit value. + abs8( i) == abs( i) + + + - 8-bit math operations which return 8-bit values. + These are provided mostly for completeness, + not particularly for performance. + mul8( i, j) == (i * j) & 0xFF + add8( i, j) == (i + j) & 0xFF + sub8( i, j) == (i - j) & 0xFF + + + - Fast 16-bit approximations of sin and cos. + Input angle is a uint16_t from 0-65535. + Output is a signed int16_t from -32767 to 32767. + sin16( x) == sin( (x/32768.0) * pi) * 32767 + cos16( x) == cos( (x/32768.0) * pi) * 32767 + Accurate to more than 99% in all cases. + + - Fast 8-bit approximations of sin and cos. + Input angle is a uint8_t from 0-255. + Output is an UNsigned uint8_t from 0 to 255. + sin8( x) == (sin( (x/128.0) * pi) * 128) + 128 + cos8( x) == (cos( (x/128.0) * pi) * 128) + 128 + Accurate to within about 2%. + + + - Fast 8-bit "easing in/out" function. + ease8InOutCubic(x) == 3(x^i) - 2(x^3) + ease8InOutApprox(x) == + faster, rougher, approximation of cubic easing + ease8InOutQuad(x) == quadratic (vs cubic) easing + + - Cubic, Quadratic, and Triangle wave functions. + Input is a uint8_t representing phase withing the wave, + similar to how sin8 takes an angle 'theta'. + Output is a uint8_t representing the amplitude of + the wave at that point. + cubicwave8( x) + quadwave8( x) + triwave8( x) + + - Square root for 16-bit integers. About three times + faster and five times smaller than Arduino's built-in + generic 32-bit sqrt routine. + sqrt16( uint16_t x ) == sqrt( x) + + - Dimming and brightening functions for 8-bit + light values. + dim8_video( x) == scale8_video( x, x) + dim8_raw( x) == scale8( x, x) + dim8_lin( x) == (x<128) ? ((x+1)/2) : scale8(x,x) + brighten8_video( x) == 255 - dim8_video( 255 - x) + brighten8_raw( x) == 255 - dim8_raw( 255 - x) + brighten8_lin( x) == 255 - dim8_lin( 255 - x) + The dimming functions in particular are suitable + for making LED light output appear more 'linear'. + + + - Linear interpolation between two values, with the + fraction between them expressed as an 8- or 16-bit + fixed point fraction (fract8 or fract16). + lerp8by8( fromU8, toU8, fract8 ) + lerp16by8( fromU16, toU16, fract8 ) + lerp15by8( fromS16, toS16, fract8 ) + == from + (( to - from ) * fract8) / 256) + lerp16by16( fromU16, toU16, fract16 ) + == from + (( to - from ) * fract16) / 65536) + map8( in, rangeStart, rangeEnd) + == map( in, 0, 255, rangeStart, rangeEnd); + + - Optimized memmove, memcpy, and memset, that are + faster than standard avr-libc 1.8. + memmove8( dest, src, bytecount) + memcpy8( dest, src, bytecount) + memset8( buf, value, bytecount) + + - Beat generators which return sine or sawtooth + waves in a specified number of Beats Per Minute. + Sine wave beat generators can specify a low and + high range for the output. Sawtooth wave beat + generators always range 0-255 or 0-65535. + beatsin8( BPM, low8, high8) + = (sine(beatphase) * (high8-low8)) + low8 + beatsin16( BPM, low16, high16) + = (sine(beatphase) * (high16-low16)) + low16 + beatsin88( BPM88, low16, high16) + = (sine(beatphase) * (high16-low16)) + low16 + beat8( BPM) = 8-bit repeating sawtooth wave + beat16( BPM) = 16-bit repeating sawtooth wave + beat88( BPM88) = 16-bit repeating sawtooth wave + BPM is beats per minute in either simple form + e.g. 120, or Q8.8 fixed-point form. + BPM88 is beats per minute in ONLY Q8.8 fixed-point + form. + +Lib8tion is pronounced like 'libation': lie-BAY-shun + +*/ + + + +#include + +#define LIB8STATIC static inline +#define LIB8STATIC_ALWAYS_INLINE static inline + +#if !defined(__AVR__) +#include +// for memmove, memcpy, and memset if not defined here +#endif + +#if defined(__arm__) + +#if defined(FASTLED_TEENSY3) +// Can use Cortex M4 DSP instructions +#define QADD8_C 0 +#define QADD7_C 0 +#define QADD8_ARM_DSP_ASM 1 +#define QADD7_ARM_DSP_ASM 1 +#else +// Generic ARM +#define QADD8_C 1 +#define QADD7_C 1 +#endif + +#define QSUB8_C 1 +#define SCALE8_C 1 +#define SCALE16BY8_C 1 +#define SCALE16_C 1 +#define ABS8_C 1 +#define MUL8_C 1 +#define QMUL8_C 1 +#define ADD8_C 1 +#define SUB8_C 1 +#define EASE8_C 1 +#define AVG8_C 1 +#define AVG7_C 1 +#define AVG16_C 1 +#define AVG15_C 1 +#define BLEND8_C 1 + + +#elif defined(__AVR__) + +// AVR ATmega and friends Arduino + +#define QADD8_C 0 +#define QADD7_C 0 +#define QSUB8_C 0 +#define ABS8_C 0 +#define ADD8_C 0 +#define SUB8_C 0 +#define AVG8_C 0 +#define AVG7_C 0 +#define AVG16_C 0 +#define AVG15_C 0 + +#define QADD8_AVRASM 1 +#define QADD7_AVRASM 1 +#define QSUB8_AVRASM 1 +#define ABS8_AVRASM 1 +#define ADD8_AVRASM 1 +#define SUB8_AVRASM 1 +#define AVG8_AVRASM 1 +#define AVG7_AVRASM 1 +#define AVG16_AVRASM 1 +#define AVG15_AVRASM 1 + +// Note: these require hardware MUL instruction +// -- sorry, ATtiny! +#if !defined(LIB8_ATTINY) +#define SCALE8_C 0 +#define SCALE16BY8_C 0 +#define SCALE16_C 0 +#define MUL8_C 0 +#define QMUL8_C 0 +#define EASE8_C 0 +#define BLEND8_C 0 +#define SCALE8_AVRASM 1 +#define SCALE16BY8_AVRASM 1 +#define SCALE16_AVRASM 1 +#define MUL8_AVRASM 1 +#define QMUL8_AVRASM 1 +#define EASE8_AVRASM 1 +#define CLEANUP_R1_AVRASM 1 +#define BLEND8_AVRASM 1 +#else +// On ATtiny, we just use C implementations +#define SCALE8_C 1 +#define SCALE16BY8_C 1 +#define SCALE16_C 1 +#define MUL8_C 1 +#define QMUL8_C 1 +#define EASE8_C 1 +#define BLEND8_C 1 +#define SCALE8_AVRASM 0 +#define SCALE16BY8_AVRASM 0 +#define SCALE16_AVRASM 0 +#define MUL8_AVRASM 0 +#define QMUL8_AVRASM 0 +#define EASE8_AVRASM 0 +#define BLEND8_AVRASM 0 +#endif + +#else + +// unspecified architecture, so +// no ASM, everything in C +#define QADD8_C 1 +#define QADD7_C 1 +#define QSUB8_C 1 +#define SCALE8_C 1 +#define SCALE16BY8_C 1 +#define SCALE16_C 1 +#define ABS8_C 1 +#define MUL8_C 1 +#define QMUL8_C 1 +#define ADD8_C 1 +#define SUB8_C 1 +#define EASE8_C 1 +#define AVG8_C 1 +#define AVG7_C 1 +#define AVG16_C 1 +#define AVG15_C 1 +#define BLEND8_C 1 + +#endif + +///@defgroup lib8tion Fast math functions +///A variety of functions for working with numbers. +///@{ + + +/////////////////////////////////////////////////////////////////////// +// +// typdefs for fixed-point fractional types. +// +// sfract7 should be interpreted as signed 128ths. +// fract8 should be interpreted as unsigned 256ths. +// sfract15 should be interpreted as signed 32768ths. +// fract16 should be interpreted as unsigned 65536ths. +// +// Example: if a fract8 has the value "64", that should be interpreted +// as 64/256ths, or one-quarter. +// +// +// fract8 range is 0 to 0.99609375 +// in steps of 0.00390625 +// +// sfract7 range is -0.9921875 to 0.9921875 +// in steps of 0.0078125 +// +// fract16 range is 0 to 0.99998474121 +// in steps of 0.00001525878 +// +// sfract15 range is -0.99996948242 to 0.99996948242 +// in steps of 0.00003051757 +// + +/// ANSI unsigned short _Fract. range is 0 to 0.99609375 +/// in steps of 0.00390625 +typedef uint8_t fract8; ///< ANSI: unsigned short _Fract + +/// ANSI: signed short _Fract. range is -0.9921875 to 0.9921875 +/// in steps of 0.0078125 +typedef int8_t sfract7; ///< ANSI: signed short _Fract + +/// ANSI: unsigned _Fract. range is 0 to 0.99998474121 +/// in steps of 0.00001525878 +typedef uint16_t fract16; ///< ANSI: unsigned _Fract + +/// ANSI: signed _Fract. range is -0.99996948242 to 0.99996948242 +/// in steps of 0.00003051757 +typedef int16_t sfract15; ///< ANSI: signed _Fract + + +// accumXY types should be interpreted as X bits of integer, +// and Y bits of fraction. +// E.g., accum88 has 8 bits of int, 8 bits of fraction + +typedef uint16_t accum88; ///< ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction +typedef int16_t saccum78; ///< ANSI: signed short _Accum. 7 bits int, 8 bits fraction +typedef uint32_t accum1616;///< ANSI: signed _Accum. 16 bits int, 16 bits fraction +typedef int32_t saccum1516;///< ANSI: signed _Accum. 15 bits int, 16 bits fraction +typedef uint16_t accum124; ///< no direct ANSI counterpart. 12 bits int, 4 bits fraction +typedef int32_t saccum114;///< no direct ANSI counterpart. 1 bit int, 14 bits fraction + + + +#include "math8.h" +#include "scale8.h" +#include "random8.h" +#include "trig8.h" + +/////////////////////////////////////////////////////////////////////// + + + + + + + +/////////////////////////////////////////////////////////////////////// +// +// float-to-fixed and fixed-to-float conversions +// +// Note that anything involving a 'float' on AVR will be slower. + +/// sfract15ToFloat: conversion from sfract15 fixed point to +/// IEEE754 32-bit float. +LIB8STATIC float sfract15ToFloat( sfract15 y) +{ + return y / 32768.0; +} + +/// conversion from IEEE754 float in the range (-1,1) +/// to 16-bit fixed point. Note that the extremes of +/// one and negative one are NOT representable. The +/// representable range is basically +LIB8STATIC sfract15 floatToSfract15( float f) +{ + return f * 32768.0; +} + + + +/////////////////////////////////////////////////////////////////////// +// +// memmove8, memcpy8, and memset8: +// alternatives to memmove, memcpy, and memset that are +// faster on AVR than standard avr-libc 1.8 + +#if defined(__AVR__) +void * memmove8( void * dst, const void * src, uint16_t num ); +void * memcpy8 ( void * dst, const void * src, uint16_t num ) __attribute__ ((noinline)); +void * memset8 ( void * ptr, uint8_t value, uint16_t num ) __attribute__ ((noinline)) ; +#else +// on non-AVR platforms, these names just call standard libc. +#define memmove8 memmove +#define memcpy8 memcpy +#define memset8 memset +#endif + + +/////////////////////////////////////////////////////////////////////// +// +// linear interpolation, such as could be used for Perlin noise, etc. +// + +// A note on the structure of the lerp functions: +// The cases for b>a and b<=a are handled separately for +// speed: without knowing the relative order of a and b, +// the value (a-b) might be overflow the width of a or b, +// and have to be promoted to a wider, slower type. +// To avoid that, we separate the two cases, and are able +// to do all the math in the same width as the arguments, +// which is much faster and smaller on AVR. + +/// linear interpolation between two unsigned 8-bit values, +/// with 8-bit fraction +LIB8STATIC uint8_t lerp8by8( uint8_t a, uint8_t b, fract8 frac) +{ + uint8_t result; + if( b > a) { + uint8_t delta = b - a; + uint8_t scaled = scale8( delta, frac); + result = a + scaled; + } else { + uint8_t delta = a - b; + uint8_t scaled = scale8( delta, frac); + result = a - scaled; + } + return result; +} + +/// linear interpolation between two unsigned 16-bit values, +/// with 16-bit fraction +LIB8STATIC uint16_t lerp16by16( uint16_t a, uint16_t b, fract16 frac) +{ + uint16_t result; + if( b > a ) { + uint16_t delta = b - a; + uint16_t scaled = scale16(delta, frac); + result = a + scaled; + } else { + uint16_t delta = a - b; + uint16_t scaled = scale16( delta, frac); + result = a - scaled; + } + return result; +} + +/// linear interpolation between two unsigned 16-bit values, +/// with 8-bit fraction +LIB8STATIC uint16_t lerp16by8( uint16_t a, uint16_t b, fract8 frac) +{ + uint16_t result; + if( b > a) { + uint16_t delta = b - a; + uint16_t scaled = scale16by8( delta, frac); + result = a + scaled; + } else { + uint16_t delta = a - b; + uint16_t scaled = scale16by8( delta, frac); + result = a - scaled; + } + return result; +} + +/// linear interpolation between two signed 15-bit values, +/// with 8-bit fraction +LIB8STATIC int16_t lerp15by8( int16_t a, int16_t b, fract8 frac) +{ + int16_t result; + if( b > a) { + uint16_t delta = b - a; + uint16_t scaled = scale16by8( delta, frac); + result = a + scaled; + } else { + uint16_t delta = a - b; + uint16_t scaled = scale16by8( delta, frac); + result = a - scaled; + } + return result; +} + +/// linear interpolation between two signed 15-bit values, +/// with 8-bit fraction +LIB8STATIC int16_t lerp15by16( int16_t a, int16_t b, fract16 frac) +{ + int16_t result; + if( b > a) { + uint16_t delta = b - a; + uint16_t scaled = scale16( delta, frac); + result = a + scaled; + } else { + uint16_t delta = a - b; + uint16_t scaled = scale16( delta, frac); + result = a - scaled; + } + return result; +} + +/// map8: map from one full-range 8-bit value into a narrower +/// range of 8-bit values, possibly a range of hues. +/// +/// E.g. map myValue into a hue in the range blue..purple..pink..red +/// hue = map8( myValue, HUE_BLUE, HUE_RED); +/// +/// Combines nicely with the waveform functions (like sin8, etc) +/// to produce continuous hue gradients back and forth: +/// +/// hue = map8( sin8( myValue), HUE_BLUE, HUE_RED); +/// +/// Mathematically simiar to lerp8by8, but arguments are more +/// like Arduino's "map"; this function is similar to +/// +/// map( in, 0, 255, rangeStart, rangeEnd) +/// +/// but faster and specifically designed for 8-bit values. +LIB8STATIC uint8_t map8( uint8_t in, uint8_t rangeStart, uint8_t rangeEnd) +{ + uint8_t rangeWidth = rangeEnd - rangeStart; + uint8_t out = scale8( in, rangeWidth); + out += rangeStart; + return out; +} + + +/////////////////////////////////////////////////////////////////////// +// +// easing functions; see http://easings.net +// + +/// ease8InOutQuad: 8-bit quadratic ease-in / ease-out function +/// Takes around 13 cycles on AVR +#if EASE8_C == 1 +LIB8STATIC uint8_t ease8InOutQuad( uint8_t i) +{ + uint8_t j = i; + if( j & 0x80 ) { + j = 255 - j; + } + uint8_t jj = scale8( j, j); + uint8_t jj2 = jj << 1; + if( i & 0x80 ) { + jj2 = 255 - jj2; + } + return jj2; +} + +#elif EASE8_AVRASM == 1 +// This AVR asm version of ease8InOutQuad preserves one more +// low-bit of precision than the C version, and is also slightly +// smaller and faster. +LIB8STATIC uint8_t ease8InOutQuad(uint8_t val) { + uint8_t j=val; + asm volatile ( + "sbrc %[val], 7 \n" + "com %[j] \n" + "mul %[j], %[j] \n" + "add r0, %[j] \n" + "ldi %[j], 0 \n" + "adc %[j], r1 \n" + "lsl r0 \n" // carry = high bit of low byte of mul product + "rol %[j] \n" // j = (j * 2) + carry // preserve add'l bit of precision + "sbrc %[val], 7 \n" + "com %[j] \n" + "clr __zero_reg__ \n" + : [j] "+&a" (j) + : [val] "a" (val) + : "r0", "r1" + ); + return j; +} + +#else +#error "No implementation for ease8InOutQuad available." +#endif + +/// ease16InOutQuad: 16-bit quadratic ease-in / ease-out function +// C implementation at this point +LIB8STATIC uint16_t ease16InOutQuad( uint16_t i) +{ + uint16_t j = i; + if( j & 0x8000 ) { + j = 65535 - j; + } + uint16_t jj = scale16( j, j); + uint16_t jj2 = jj << 1; + if( i & 0x8000 ) { + jj2 = 65535 - jj2; + } + return jj2; +} + + +/// ease8InOutCubic: 8-bit cubic ease-in / ease-out function +/// Takes around 18 cycles on AVR +LIB8STATIC fract8 ease8InOutCubic( fract8 i) +{ + uint8_t ii = scale8_LEAVING_R1_DIRTY( i, i); + uint8_t iii = scale8_LEAVING_R1_DIRTY( ii, i); + + uint16_t r1 = (3 * (uint16_t)(ii)) - ( 2 * (uint16_t)(iii)); + + /* the code generated for the above *'s automatically + cleans up R1, so there's no need to explicitily call + cleanup_R1(); */ + + uint8_t result = r1; + + // if we got "256", return 255: + if( r1 & 0x100 ) { + result = 255; + } + return result; +} + +/// ease8InOutApprox: fast, rough 8-bit ease-in/ease-out function +/// shaped approximately like 'ease8InOutCubic', +/// it's never off by more than a couple of percent +/// from the actual cubic S-curve, and it executes +/// more than twice as fast. Use when the cycles +/// are more important than visual smoothness. +/// Asm version takes around 7 cycles on AVR. + +#if EASE8_C == 1 +LIB8STATIC fract8 ease8InOutApprox( fract8 i) +{ + if( i < 64) { + // start with slope 0.5 + i /= 2; + } else if( i > (255 - 64)) { + // end with slope 0.5 + i = 255 - i; + i /= 2; + i = 255 - i; + } else { + // in the middle, use slope 192/128 = 1.5 + i -= 64; + i += (i / 2); + i += 32; + } + + return i; +} + +#elif EASE8_AVRASM == 1 +LIB8STATIC uint8_t ease8InOutApprox( fract8 i) +{ + // takes around 7 cycles on AVR + asm volatile ( + " subi %[i], 64 \n\t" + " cpi %[i], 128 \n\t" + " brcc Lshift_%= \n\t" + + // middle case + " mov __tmp_reg__, %[i] \n\t" + " lsr __tmp_reg__ \n\t" + " add %[i], __tmp_reg__ \n\t" + " subi %[i], 224 \n\t" + " rjmp Ldone_%= \n\t" + + // start or end case + "Lshift_%=: \n\t" + " lsr %[i] \n\t" + " subi %[i], 96 \n\t" + + "Ldone_%=: \n\t" + + : [i] "+&a" (i) + : + : "r0", "r1" + ); + return i; +} +#else +#error "No implementation for ease8 available." +#endif + + + +/// triwave8: triangle (sawtooth) wave generator. Useful for +/// turning a one-byte ever-increasing value into a +/// one-byte value that oscillates up and down. +/// +/// input output +/// 0..127 0..254 (positive slope) +/// 128..255 254..0 (negative slope) +/// +/// On AVR this function takes just three cycles. +/// +LIB8STATIC uint8_t triwave8(uint8_t in) +{ + if( in & 0x80) { + in = 255 - in; + } + uint8_t out = in << 1; + return out; +} + + +// quadwave8 and cubicwave8: S-shaped wave generators (like 'sine'). +// Useful for turning a one-byte 'counter' value into a +// one-byte oscillating value that moves smoothly up and down, +// with an 'acceleration' and 'deceleration' curve. +// +// These are even faster than 'sin8', and have +// slightly different curve shapes. +// + +/// quadwave8: quadratic waveform generator. Spends just a little more +/// time at the limits than 'sine' does. +LIB8STATIC uint8_t quadwave8(uint8_t in) +{ + return ease8InOutQuad( triwave8( in)); +} + +/// cubicwave8: cubic waveform generator. Spends visibly more time +/// at the limits than 'sine' does. +LIB8STATIC uint8_t cubicwave8(uint8_t in) +{ + return ease8InOutCubic( triwave8( in)); +} + +/// squarewave8: square wave generator. Useful for +/// turning a one-byte ever-increasing value +/// into a one-byte value that is either 0 or 255. +/// The width of the output 'pulse' is +/// determined by the pulsewidth argument: +/// +///~~~ +/// If pulsewidth is 255, output is always 255. +/// If pulsewidth < 255, then +/// if input < pulsewidth then output is 255 +/// if input >= pulsewidth then output is 0 +///~~~ +/// +/// the output looking like: +/// +///~~~ +/// 255 +--pulsewidth--+ +/// . | | +/// 0 0 +--------(256-pulsewidth)-------- +///~~~ +/// +/// @param in +/// @param pulsewidth +/// @returns square wave output +LIB8STATIC uint8_t squarewave8( uint8_t in, uint8_t pulsewidth) +{ + if( in < pulsewidth || (pulsewidth == 255)) { + return 255; + } else { + return 0; + } +} + + +// Beat generators - These functions produce waves at a given +// number of 'beats per minute'. Internally, they use +// the Arduino function 'millis' to track elapsed time. +// Accuracy is a bit better than one part in a thousand. +// +// beat8( BPM ) returns an 8-bit value that cycles 'BPM' times +// per minute, rising from 0 to 255, resetting to zero, +// rising up again, etc.. The output of this function +// is suitable for feeding directly into sin8, and cos8, +// triwave8, quadwave8, and cubicwave8. +// beat16( BPM ) returns a 16-bit value that cycles 'BPM' times +// per minute, rising from 0 to 65535, resetting to zero, +// rising up again, etc. The output of this function is +// suitable for feeding directly into sin16 and cos16. +// beat88( BPM88) is the same as beat16, except that the BPM88 argument +// MUST be in Q8.8 fixed point format, e.g. 120BPM must +// be specified as 120*256 = 30720. +// beatsin8( BPM, uint8_t low, uint8_t high) returns an 8-bit value that +// rises and falls in a sine wave, 'BPM' times per minute, +// between the values of 'low' and 'high'. +// beatsin16( BPM, uint16_t low, uint16_t high) returns a 16-bit value +// that rises and falls in a sine wave, 'BPM' times per +// minute, between the values of 'low' and 'high'. +// beatsin88( BPM88, ...) is the same as beatsin16, except that the +// BPM88 argument MUST be in Q8.8 fixed point format, +// e.g. 120BPM must be specified as 120*256 = 30720. +// +// BPM can be supplied two ways. The simpler way of specifying BPM is as +// a simple 8-bit integer from 1-255, (e.g., "120"). +// The more sophisticated way of specifying BPM allows for fractional +// "Q8.8" fixed point number (an 'accum88') with an 8-bit integer part and +// an 8-bit fractional part. The easiest way to construct this is to multiply +// a floating point BPM value (e.g. 120.3) by 256, (e.g. resulting in 30796 +// in this case), and pass that as the 16-bit BPM argument. +// "BPM88" MUST always be specified in Q8.8 format. +// +// Originally designed to make an entire animation project pulse with brightness. +// For that effect, add this line just above your existing call to "FastLED.show()": +// +// uint8_t bright = beatsin8( 60 /*BPM*/, 192 /*dimmest*/, 255 /*brightest*/ )); +// FastLED.setBrightness( bright ); +// FastLED.show(); +// +// The entire animation will now pulse between brightness 192 and 255 once per second. + + +// The beat generators need access to a millisecond counter. +// On Arduino, this is "millis()". On other platforms, you'll +// need to provide a function with this signature: +// uint32_t get_millisecond_timer(); +// that provides similar functionality. +// You can also force use of the get_millisecond_timer function +// by #defining USE_GET_MILLISECOND_TIMER. +#if (defined(ARDUINO) || defined(SPARK) || defined(FASTLED_HAS_MILLIS)) && !defined(USE_GET_MILLISECOND_TIMER) +// Forward declaration of Arduino function 'millis'. +//uint32_t millis(); +#define GET_MILLIS millis +#else +uint32_t get_millisecond_timer(void); +#define GET_MILLIS get_millisecond_timer +#endif + +// beat16 generates a 16-bit 'sawtooth' wave at a given BPM, +/// with BPM specified in Q8.8 fixed-point format; e.g. +/// for this function, 120 BPM MUST BE specified as +/// 120*256 = 30720. +/// If you just want to specify "120", use beat16 or beat8. +LIB8STATIC uint16_t beat88( accum88 beats_per_minute_88, uint32_t timebase) +{ + // BPM is 'beats per minute', or 'beats per 60000ms'. + // To avoid using the (slower) division operator, we + // want to convert 'beats per 60000ms' to 'beats per 65536ms', + // and then use a simple, fast bit-shift to divide by 65536. + // + // The ratio 65536:60000 is 279.620266667:256; we'll call it 280:256. + // The conversion is accurate to about 0.05%, more or less, + // e.g. if you ask for "120 BPM", you'll get about "119.93". + return (((GET_MILLIS()) - timebase) * beats_per_minute_88 * 280) >> 16; +} + +/// beat16 generates a 16-bit 'sawtooth' wave at a given BPM +LIB8STATIC uint16_t beat16( accum88 beats_per_minute, uint32_t timebase) +{ + // Convert simple 8-bit BPM's to full Q8.8 accum88's if needed + if( beats_per_minute < 256) beats_per_minute <<= 8; + return beat88(beats_per_minute, timebase); +} + +/// beat8 generates an 8-bit 'sawtooth' wave at a given BPM +LIB8STATIC uint8_t beat8( accum88 beats_per_minute, uint32_t timebase) +{ + return beat16( beats_per_minute, timebase) >> 8; +} + +/// beatsin88 generates a 16-bit sine wave at a given BPM, +/// that oscillates within a given range. +/// For this function, BPM MUST BE SPECIFIED as +/// a Q8.8 fixed-point value; e.g. 120BPM must be +/// specified as 120*256 = 30720. +/// If you just want to specify "120", use beatsin16 or beatsin8. +LIB8STATIC uint16_t beatsin88( accum88 beats_per_minute_88, uint16_t lowest, uint16_t highest, uint32_t timebase, uint16_t phase_offset) +{ + uint16_t beat = beat88( beats_per_minute_88, timebase); + uint16_t beatsin = (sin16( beat + phase_offset) + 32768); + uint16_t rangewidth = highest - lowest; + uint16_t scaledbeat = scale16( beatsin, rangewidth); + uint16_t result = lowest + scaledbeat; + return result; +} + +/// beatsin16 generates a 16-bit sine wave at a given BPM, +/// that oscillates within a given range. +LIB8STATIC uint16_t beatsin16(accum88 beats_per_minute, uint16_t lowest, uint16_t highest, uint32_t timebase, uint16_t phase_offset) +{ + uint16_t beat = beat16( beats_per_minute, timebase); + uint16_t beatsin = (sin16( beat + phase_offset) + 32768); + uint16_t rangewidth = highest - lowest; + uint16_t scaledbeat = scale16( beatsin, rangewidth); + uint16_t result = lowest + scaledbeat; + return result; +} + +/// beatsin8 generates an 8-bit sine wave at a given BPM, +/// that oscillates within a given range. +LIB8STATIC uint8_t beatsin8( accum88 beats_per_minute, uint8_t lowest, uint8_t highest, uint32_t timebase, uint8_t phase_offset) +{ + uint8_t beat = beat8( beats_per_minute, timebase); + uint8_t beatsin = sin8( beat + phase_offset); + uint8_t rangewidth = highest - lowest; + uint8_t scaledbeat = scale8( beatsin, rangewidth); + uint8_t result = lowest + scaledbeat; + return result; +} + + +/// Return the current seconds since boot in a 16-bit value. Used as part of the +/// "every N time-periods" mechanism +LIB8STATIC uint16_t seconds16(void) +{ + uint32_t ms = GET_MILLIS(); + uint16_t s16; + s16 = ms / 1000; + return s16; +} + +/// Return the current minutes since boot in a 16-bit value. Used as part of the +/// "every N time-periods" mechanism +LIB8STATIC uint16_t minutes16(void) +{ + uint32_t ms = GET_MILLIS(); + uint16_t m16; + m16 = (ms / (60000L)) & 0xFFFF; + return m16; +} + +/// Return the current hours since boot in an 8-bit value. Used as part of the +/// "every N time-periods" mechanism +LIB8STATIC uint8_t hours8(void) +{ + uint32_t ms = GET_MILLIS(); + uint8_t h8; + h8 = (ms / (3600000L)) & 0xFF; + return h8; +} + +///@} + +#endif diff --git a/lib/lib8tion/math8.h b/lib/lib8tion/math8.h new file mode 100644 index 00000000000..8c6b6c227e3 --- /dev/null +++ b/lib/lib8tion/math8.h @@ -0,0 +1,552 @@ +#ifndef __INC_LIB8TION_MATH_H +#define __INC_LIB8TION_MATH_H + +#include "scale8.h" + +///@ingroup lib8tion + +///@defgroup Math Basic math operations +/// Fast, efficient 8-bit math functions specifically +/// designed for high-performance LED programming. +/// +/// Because of the AVR(Arduino) and ARM assembly language +/// implementations provided, using these functions often +/// results in smaller and faster code than the equivalent +/// program using plain "C" arithmetic and logic. +///@{ + + +/// add one byte to another, saturating at 0xFF +/// @param i - first byte to add +/// @param j - second byte to add +/// @returns the sum of i & j, capped at 0xFF +LIB8STATIC_ALWAYS_INLINE uint8_t qadd8( uint8_t i, uint8_t j) +{ +#if QADD8_C == 1 + uint16_t t = i + j; + if (t > 255) t = 255; + return t; +#elif QADD8_AVRASM == 1 + asm volatile( + /* First, add j to i, conditioning the C flag */ + "add %0, %1 \n\t" + + /* Now test the C flag. + If C is clear, we branch around a load of 0xFF into i. + If C is set, we go ahead and load 0xFF into i. + */ + "brcc L_%= \n\t" + "ldi %0, 0xFF \n\t" + "L_%=: " + : "+a" (i) + : "a" (j) ); + return i; +#elif QADD8_ARM_DSP_ASM == 1 + asm volatile( "uqadd8 %0, %0, %1" : "+r" (i) : "r" (j)); + return i; +#else +#error "No implementation for qadd8 available." +#endif +} + +/// Add one byte to another, saturating at 0x7F +/// @param i - first byte to add +/// @param j - second byte to add +/// @returns the sum of i & j, capped at 0xFF +LIB8STATIC_ALWAYS_INLINE int8_t qadd7( int8_t i, int8_t j) +{ +#if QADD7_C == 1 + int16_t t = i + j; + if (t > 127) t = 127; + return t; +#elif QADD7_AVRASM == 1 + asm volatile( + /* First, add j to i, conditioning the V flag */ + "add %0, %1 \n\t" + + /* Now test the V flag. + If V is clear, we branch around a load of 0x7F into i. + If V is set, we go ahead and load 0x7F into i. + */ + "brvc L_%= \n\t" + "ldi %0, 0x7F \n\t" + "L_%=: " + : "+a" (i) + : "a" (j) ); + + return i; +#elif QADD7_ARM_DSP_ASM == 1 + asm volatile( "qadd8 %0, %0, %1" : "+r" (i) : "r" (j)); + return i; +#else +#error "No implementation for qadd7 available." +#endif +} + +/// subtract one byte from another, saturating at 0x00 +/// @returns i - j with a floor of 0 +LIB8STATIC_ALWAYS_INLINE uint8_t qsub8( uint8_t i, uint8_t j) +{ +#if QSUB8_C == 1 + int16_t t = i - j; + if (t < 0) t = 0; + return t; +#elif QSUB8_AVRASM == 1 + + asm volatile( + /* First, subtract j from i, conditioning the C flag */ + "sub %0, %1 \n\t" + + /* Now test the C flag. + If C is clear, we branch around a load of 0x00 into i. + If C is set, we go ahead and load 0x00 into i. + */ + "brcc L_%= \n\t" + "ldi %0, 0x00 \n\t" + "L_%=: " + : "+a" (i) + : "a" (j) ); + + return i; +#else +#error "No implementation for qsub8 available." +#endif +} + +/// add one byte to another, with one byte result +LIB8STATIC_ALWAYS_INLINE uint8_t add8( uint8_t i, uint8_t j) +{ +#if ADD8_C == 1 + uint16_t t = i + j; + return t; +#elif ADD8_AVRASM == 1 + // Add j to i, period. + asm volatile( "add %0, %1" : "+a" (i) : "a" (j)); + return i; +#else +#error "No implementation for add8 available." +#endif +} + +/// add one byte to another, with one byte result +LIB8STATIC_ALWAYS_INLINE uint16_t add8to16( uint8_t i, uint16_t j) +{ +#if ADD8_C == 1 + uint16_t t = i + j; + return t; +#elif ADD8_AVRASM == 1 + // Add i(one byte) to j(two bytes) + asm volatile( "add %A[j], %[i] \n\t" + "adc %B[j], __zero_reg__ \n\t" + : [j] "+a" (j) + : [i] "a" (i) + ); + return i; +#else +#error "No implementation for add8to16 available." +#endif +} + + +/// subtract one byte from another, 8-bit result +LIB8STATIC_ALWAYS_INLINE uint8_t sub8( uint8_t i, uint8_t j) +{ +#if SUB8_C == 1 + int16_t t = i - j; + return t; +#elif SUB8_AVRASM == 1 + // Subtract j from i, period. + asm volatile( "sub %0, %1" : "+a" (i) : "a" (j)); + return i; +#else +#error "No implementation for sub8 available." +#endif +} + +/// Calculate an integer average of two unsigned +/// 8-bit integer values (uint8_t). +/// Fractional results are rounded down, e.g. avg8(20,41) = 30 +LIB8STATIC_ALWAYS_INLINE uint8_t avg8( uint8_t i, uint8_t j) +{ +#if AVG8_C == 1 + return (i + j) >> 1; +#elif AVG8_AVRASM == 1 + asm volatile( + /* First, add j to i, 9th bit overflows into C flag */ + "add %0, %1 \n\t" + /* Divide by two, moving C flag into high 8th bit */ + "ror %0 \n\t" + : "+a" (i) + : "a" (j) ); + return i; +#else +#error "No implementation for avg8 available." +#endif +} + +/// Calculate an integer average of two unsigned +/// 16-bit integer values (uint16_t). +/// Fractional results are rounded down, e.g. avg16(20,41) = 30 +LIB8STATIC_ALWAYS_INLINE uint16_t avg16( uint16_t i, uint16_t j) +{ +#if AVG16_C == 1 + return (uint32_t)((uint32_t)(i) + (uint32_t)(j)) >> 1; +#elif AVG16_AVRASM == 1 + asm volatile( + /* First, add jLo (heh) to iLo, 9th bit overflows into C flag */ + "add %A[i], %A[j] \n\t" + /* Now, add C + jHi to iHi, 17th bit overflows into C flag */ + "adc %B[i], %B[j] \n\t" + /* Divide iHi by two, moving C flag into high 16th bit, old 9th bit now in C */ + "ror %B[i] \n\t" + /* Divide iLo by two, moving C flag into high 8th bit */ + "ror %A[i] \n\t" + : [i] "+a" (i) + : [j] "a" (j) ); + return i; +#else +#error "No implementation for avg16 available." +#endif +} + + +/// Calculate an integer average of two signed 7-bit +/// integers (int8_t) +/// If the first argument is even, result is rounded down. +/// If the first argument is odd, result is result up. +LIB8STATIC_ALWAYS_INLINE int8_t avg7( int8_t i, int8_t j) +{ +#if AVG7_C == 1 + return ((i + j) >> 1) + (i & 0x1); +#elif AVG7_AVRASM == 1 + asm volatile( + "asr %1 \n\t" + "asr %0 \n\t" + "adc %0, %1 \n\t" + : "+a" (i) + : "a" (j) ); + return i; +#else +#error "No implementation for avg7 available." +#endif +} + +/// Calculate an integer average of two signed 15-bit +/// integers (int16_t) +/// If the first argument is even, result is rounded down. +/// If the first argument is odd, result is result up. +LIB8STATIC_ALWAYS_INLINE int16_t avg15( int16_t i, int16_t j) +{ +#if AVG15_C == 1 + return ((int32_t)((int32_t)(i) + (int32_t)(j)) >> 1) + (i & 0x1); +#elif AVG15_AVRASM == 1 + asm volatile( + /* first divide j by 2, throwing away lowest bit */ + "asr %B[j] \n\t" + "ror %A[j] \n\t" + /* now divide i by 2, with lowest bit going into C */ + "asr %B[i] \n\t" + "ror %A[i] \n\t" + /* add j + C to i */ + "adc %A[i], %A[j] \n\t" + "adc %B[i], %B[j] \n\t" + : [i] "+a" (i) + : [j] "a" (j) ); + return i; +#else +#error "No implementation for avg15 available." +#endif +} + + +/// Calculate the remainder of one unsigned 8-bit +/// value divided by anoter, aka A % M. +/// Implemented by repeated subtraction, which is +/// very compact, and very fast if A is 'probably' +/// less than M. If A is a large multiple of M, +/// the loop has to execute multiple times. However, +/// even in that case, the loop is only two +/// instructions long on AVR, i.e., quick. +LIB8STATIC_ALWAYS_INLINE uint8_t mod8( uint8_t a, uint8_t m) +{ +#if defined(__AVR__) + asm volatile ( + "L_%=: sub %[a],%[m] \n\t" + " brcc L_%= \n\t" + " add %[a],%[m] \n\t" + : [a] "+r" (a) + : [m] "r" (m) + ); +#else + while( a >= m) a -= m; +#endif + return a; +} + +/// Add two numbers, and calculate the modulo +/// of the sum and a third number, M. +/// In other words, it returns (A+B) % M. +/// It is designed as a compact mechanism for +/// incrementing a 'mode' switch and wrapping +/// around back to 'mode 0' when the switch +/// goes past the end of the available range. +/// e.g. if you have seven modes, this switches +/// to the next one and wraps around if needed: +/// mode = addmod8( mode, 1, 7); +///LIB8STATIC_ALWAYS_INLINESee 'mod8' for notes on performance. +LIB8STATIC uint8_t addmod8( uint8_t a, uint8_t b, uint8_t m) +{ +#if defined(__AVR__) + asm volatile ( + " add %[a],%[b] \n\t" + "L_%=: sub %[a],%[m] \n\t" + " brcc L_%= \n\t" + " add %[a],%[m] \n\t" + : [a] "+r" (a) + : [b] "r" (b), [m] "r" (m) + ); +#else + a += b; + while( a >= m) a -= m; +#endif + return a; +} + +/// Subtract two numbers, and calculate the modulo +/// of the difference and a third number, M. +/// In other words, it returns (A-B) % M. +/// It is designed as a compact mechanism for +/// incrementing a 'mode' switch and wrapping +/// around back to 'mode 0' when the switch +/// goes past the end of the available range. +/// e.g. if you have seven modes, this switches +/// to the next one and wraps around if needed: +/// mode = addmod8( mode, 1, 7); +///LIB8STATIC_ALWAYS_INLINESee 'mod8' for notes on performance. +LIB8STATIC uint8_t submod8( uint8_t a, uint8_t b, uint8_t m) +{ +#if defined(__AVR__) + asm volatile ( + " sub %[a],%[b] \n\t" + "L_%=: sub %[a],%[m] \n\t" + " brcc L_%= \n\t" + " add %[a],%[m] \n\t" + : [a] "+r" (a) + : [b] "r" (b), [m] "r" (m) + ); +#else + a -= b; + while( a >= m) a -= m; +#endif + return a; +} + +/// 8x8 bit multiplication, with 8 bit result +LIB8STATIC_ALWAYS_INLINE uint8_t mul8( uint8_t i, uint8_t j) +{ +#if MUL8_C == 1 + return ((uint16_t)i * (uint16_t)(j) ) & 0xFF; +#elif MUL8_AVRASM == 1 + asm volatile( + /* Multiply 8-bit i * 8-bit j, giving 16-bit r1,r0 */ + "mul %0, %1 \n\t" + /* Extract the LOW 8-bits (r0) */ + "mov %0, r0 \n\t" + /* Restore r1 to "0"; it's expected to always be that */ + "clr __zero_reg__ \n\t" + : "+a" (i) + : "a" (j) + : "r0", "r1"); + + return i; +#else +#error "No implementation for mul8 available." +#endif +} + + +/// saturating 8x8 bit multiplication, with 8 bit result +/// @returns the product of i * j, capping at 0xFF +LIB8STATIC_ALWAYS_INLINE uint8_t qmul8( uint8_t i, uint8_t j) +{ +#if QMUL8_C == 1 + int p = ((uint16_t)i * (uint16_t)(j) ); + if( p > 255) p = 255; + return p; +#elif QMUL8_AVRASM == 1 + asm volatile( + /* Multiply 8-bit i * 8-bit j, giving 16-bit r1,r0 */ + " mul %0, %1 \n\t" + /* If high byte of result is zero, all is well. */ + " tst r1 \n\t" + " breq Lnospill_%= \n\t" + /* If high byte of result > 0, saturate low byte to 0xFF */ + " ldi %0,0xFF \n\t" + " rjmp Ldone_%= \n\t" + "Lnospill_%=: \n\t" + /* Extract the LOW 8-bits (r0) */ + " mov %0, r0 \n\t" + "Ldone_%=: \n\t" + /* Restore r1 to "0"; it's expected to always be that */ + " clr __zero_reg__ \n\t" + : "+a" (i) + : "a" (j) + : "r0", "r1"); + + return i; +#else +#error "No implementation for qmul8 available." +#endif +} + + +/// take abs() of a signed 8-bit uint8_t +LIB8STATIC_ALWAYS_INLINE int8_t abs8( int8_t i) +{ +#if ABS8_C == 1 + if( i < 0) i = -i; + return i; +#elif ABS8_AVRASM == 1 + + + asm volatile( + /* First, check the high bit, and prepare to skip if it's clear */ + "sbrc %0, 7 \n" + + /* Negate the value */ + "neg %0 \n" + + : "+r" (i) : "r" (i) ); + return i; +#else +#error "No implementation for abs8 available." +#endif +} + +/// square root for 16-bit integers +/// About three times faster and five times smaller +/// than Arduino's general sqrt on AVR. +LIB8STATIC uint8_t sqrt16(uint16_t x) +{ + if( x <= 1) { + return x; + } + + uint8_t low = 1; // lower bound + uint8_t hi, mid; + + if( x > 7904) { + hi = 255; + } else { + hi = (x >> 5) + 8; // initial estimate for upper bound + } + + do { + mid = (low + hi) >> 1; + if ((uint16_t)(mid * mid) > x) { + hi = mid - 1; + } else { + if( mid == 255) { + return 255; + } + low = mid + 1; + } + } while (hi >= low); + + return low - 1; +} + +/// blend a variable proproportion(0-255) of one byte to another +/// @param a - the starting byte value +/// @param b - the byte value to blend toward +/// @param amountOfB - the proportion (0-255) of b to blend +/// @returns a byte value between a and b, inclusive +#if (FASTLED_BLEND_FIXED == 1) +LIB8STATIC uint8_t blend8( uint8_t a, uint8_t b, uint8_t amountOfB) +{ +#if BLEND8_C == 1 + uint16_t partial; + uint8_t result; + + uint8_t amountOfA = 255 - amountOfB; + + partial = (a * amountOfA); +#if (FASTLED_SCALE8_FIXED == 1) + partial += a; + //partial = add8to16( a, partial); +#endif + + partial += (b * amountOfB); +#if (FASTLED_SCALE8_FIXED == 1) + partial += b; + //partial = add8to16( b, partial); +#endif + + result = partial >> 8; + + return result; + +#elif BLEND8_AVRASM == 1 + uint16_t partial; + uint8_t result; + + asm volatile ( + /* partial = b * amountOfB */ + " mul %[b], %[amountOfB] \n\t" + " movw %A[partial], r0 \n\t" + + /* amountOfB (aka amountOfA) = 255 - amountOfB */ + " com %[amountOfB] \n\t" + + /* partial += a * amountOfB (aka amountOfA) */ + " mul %[a], %[amountOfB] \n\t" + + " add %A[partial], r0 \n\t" + " adc %B[partial], r1 \n\t" + + " clr __zero_reg__ \n\t" + +#if (FASTLED_SCALE8_FIXED == 1) + /* partial += a */ + " add %A[partial], %[a] \n\t" + " adc %B[partial], __zero_reg__ \n\t" + + // partial += b + " add %A[partial], %[b] \n\t" + " adc %B[partial], __zero_reg__ \n\t" +#endif + + : [partial] "=r" (partial), + [amountOfB] "+a" (amountOfB) + : [a] "a" (a), + [b] "a" (b) + : "r0", "r1" + ); + + result = partial >> 8; + + return result; + +#else +#error "No implementation for blend8 available." +#endif +} + +#else +LIB8STATIC uint8_t blend8( uint8_t a, uint8_t b, uint8_t amountOfB) +{ + // This version loses precision in the integer math + // and can actually return results outside of the range + // from a to b. Its use is not recommended. + uint8_t result; + uint8_t amountOfA = 255 - amountOfB; + result = scale8_LEAVING_R1_DIRTY( a, amountOfA) + + scale8_LEAVING_R1_DIRTY( b, amountOfB); + cleanup_R1(); + return result; +} +#endif + + +///@} +#endif diff --git a/lib/lib8tion/random8.h b/lib/lib8tion/random8.h new file mode 100644 index 00000000000..7ee67cbb364 --- /dev/null +++ b/lib/lib8tion/random8.h @@ -0,0 +1,94 @@ +#ifndef __INC_LIB8TION_RANDOM_H +#define __INC_LIB8TION_RANDOM_H +///@ingroup lib8tion + +///@defgroup Random Fast random number generators +/// Fast 8- and 16- bit unsigned random numbers. +/// Significantly faster than Arduino random(), but +/// also somewhat less random. You can add entropy. +///@{ + +// X(n+1) = (2053 * X(n)) + 13849) +#define FASTLED_RAND16_2053 ((uint16_t)(2053)) +#define FASTLED_RAND16_13849 ((uint16_t)(13849)) + +/// random number seed +extern uint16_t rand16seed;// = RAND16_SEED; + +/// Generate an 8-bit random number +LIB8STATIC uint8_t random8(void) +{ + rand16seed = (rand16seed * FASTLED_RAND16_2053) + FASTLED_RAND16_13849; + // return the sum of the high and low bytes, for better + // mixing and non-sequential correlation + return (uint8_t)(((uint8_t)(rand16seed & 0xFF)) + + ((uint8_t)(rand16seed >> 8))); +} + +/// Generate a 16 bit random number +LIB8STATIC uint16_t random16(void) +{ + rand16seed = (rand16seed * FASTLED_RAND16_2053) + FASTLED_RAND16_13849; + return rand16seed; +} + +/// Generate an 8-bit random number between 0 and lim +/// @param lim the upper bound for the result +LIB8STATIC uint8_t random8_max(uint8_t lim) +{ + uint8_t r = random8(); + r = (r*lim) >> 8; + return r; +} + +/// Generate an 8-bit random number in the given range +/// @param min the lower bound for the random number +/// @param lim the upper bound for the random number +LIB8STATIC uint8_t random8_min_max(uint8_t min, uint8_t lim) +{ + uint8_t delta = lim - min; + uint8_t r = random8_max(delta) + min; + return r; +} + +/// Generate an 16-bit random number between 0 and lim +/// @param lim the upper bound for the result +LIB8STATIC uint16_t random16_max(uint16_t lim) +{ + uint16_t r = random16(); + uint32_t p = (uint32_t)lim * (uint32_t)r; + r = p >> 16; + return r; +} + +/// Generate an 16-bit random number in the given range +/// @param min the lower bound for the random number +/// @param lim the upper bound for the random number +LIB8STATIC uint16_t random16_min_max( uint16_t min, uint16_t lim) +{ + uint16_t delta = lim - min; + uint16_t r = random16_max(delta) + min; + return r; +} + +/// Set the 16-bit seed used for the random number generator +LIB8STATIC void random16_set_seed(uint16_t seed) +{ + rand16seed = seed; +} + +/// Get the current seed value for the random number generator +LIB8STATIC uint16_t random16_get_seed(void) +{ + return rand16seed; +} + +/// Add entropy into the random number generator +LIB8STATIC void random16_add_entropy(uint16_t entropy) +{ + rand16seed += entropy; +} + +///@} + +#endif diff --git a/lib/lib8tion/scale8.h b/lib/lib8tion/scale8.h new file mode 100644 index 00000000000..9895fd4d791 --- /dev/null +++ b/lib/lib8tion/scale8.h @@ -0,0 +1,542 @@ +#ifndef __INC_LIB8TION_SCALE_H +#define __INC_LIB8TION_SCALE_H + +///@ingroup lib8tion + +///@defgroup Scaling Scaling functions +/// Fast, efficient 8-bit scaling functions specifically +/// designed for high-performance LED programming. +/// +/// Because of the AVR(Arduino) and ARM assembly language +/// implementations provided, using these functions often +/// results in smaller and faster code than the equivalent +/// program using plain "C" arithmetic and logic. +///@{ + +/// scale one byte by a second one, which is treated as +/// the numerator of a fraction whose denominator is 256 +/// In other words, it computes i * (scale / 256) +/// 4 clocks AVR with MUL, 2 clocks ARM +LIB8STATIC_ALWAYS_INLINE uint8_t scale8( uint8_t i, fract8 scale) +{ +#if SCALE8_C == 1 +#if (FASTLED_SCALE8_FIXED == 1) + return (((uint16_t)i) * (1+(uint16_t)(scale))) >> 8; +#else + return ((uint16_t)i * (uint16_t)(scale) ) >> 8; +#endif +#elif SCALE8_AVRASM == 1 +#if defined(LIB8_ATTINY) +#if (FASTLED_SCALE8_FIXED == 1) + uint8_t work=i; +#else + uint8_t work=0; +#endif + uint8_t cnt=0x80; + asm volatile( +#if (FASTLED_SCALE8_FIXED == 1) + " inc %[scale] \n\t" + " breq DONE_%= \n\t" + " clr %[work] \n\t" +#endif + "LOOP_%=: \n\t" + /*" sbrc %[scale], 0 \n\t" + " add %[work], %[i] \n\t" + " ror %[work] \n\t" + " lsr %[scale] \n\t" + " clc \n\t"*/ + " sbrc %[scale], 0 \n\t" + " add %[work], %[i] \n\t" + " ror %[work] \n\t" + " lsr %[scale] \n\t" + " lsr %[cnt] \n\t" + "brcc LOOP_%= \n\t" + "DONE_%=: \n\t" + : [work] "+r" (work), [cnt] "+r" (cnt) + : [scale] "r" (scale), [i] "r" (i) + : + ); + return work; +#else + asm volatile( +#if (FASTLED_SCALE8_FIXED==1) + // Multiply 8-bit i * 8-bit scale, giving 16-bit r1,r0 + "mul %0, %1 \n\t" + // Add i to r0, possibly setting the carry flag + "add r0, %0 \n\t" + // load the immediate 0 into i (note, this does _not_ touch any flags) + "ldi %0, 0x00 \n\t" + // walk and chew gum at the same time + "adc %0, r1 \n\t" +#else + /* Multiply 8-bit i * 8-bit scale, giving 16-bit r1,r0 */ + "mul %0, %1 \n\t" + /* Move the high 8-bits of the product (r1) back to i */ + "mov %0, r1 \n\t" + /* Restore r1 to "0"; it's expected to always be that */ +#endif + "clr __zero_reg__ \n\t" + + : "+a" (i) /* writes to i */ + : "a" (scale) /* uses scale */ + : "r0", "r1" /* clobbers r0, r1 */ ); + + /* Return the result */ + return i; +#endif +#else +#error "No implementation for scale8 available." +#endif +} + + +/// The "video" version of scale8 guarantees that the output will +/// be only be zero if one or both of the inputs are zero. If both +/// inputs are non-zero, the output is guaranteed to be non-zero. +/// This makes for better 'video'/LED dimming, at the cost of +/// several additional cycles. +LIB8STATIC_ALWAYS_INLINE uint8_t scale8_video( uint8_t i, fract8 scale) +{ +#if SCALE8_C == 1 || defined(LIB8_ATTINY) + uint8_t j = (((int)i * (int)scale) >> 8) + ((i&&scale)?1:0); + // uint8_t nonzeroscale = (scale != 0) ? 1 : 0; + // uint8_t j = (i == 0) ? 0 : (((int)i * (int)(scale) ) >> 8) + nonzeroscale; + return j; +#elif SCALE8_AVRASM == 1 + uint8_t j=0; + asm volatile( + " tst %[i]\n\t" + " breq L_%=\n\t" + " mul %[i], %[scale]\n\t" + " mov %[j], r1\n\t" + " clr __zero_reg__\n\t" + " cpse %[scale], r1\n\t" + " subi %[j], 0xFF\n\t" + "L_%=: \n\t" + : [j] "+a" (j) + : [i] "a" (i), [scale] "a" (scale) + : "r0", "r1"); + + return j; + // uint8_t nonzeroscale = (scale != 0) ? 1 : 0; + // asm volatile( + // " tst %0 \n" + // " breq L_%= \n" + // " mul %0, %1 \n" + // " mov %0, r1 \n" + // " add %0, %2 \n" + // " clr __zero_reg__ \n" + // "L_%=: \n" + + // : "+a" (i) + // : "a" (scale), "a" (nonzeroscale) + // : "r0", "r1"); + + // // Return the result + // return i; +#else +#error "No implementation for scale8_video available." +#endif +} + + +/// This version of scale8 does not clean up the R1 register on AVR +/// If you are doing several 'scale8's in a row, use this, and +/// then explicitly call cleanup_R1. +LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY( uint8_t i, fract8 scale) +{ +#if SCALE8_C == 1 +#if (FASTLED_SCALE8_FIXED == 1) + return (((uint16_t)i) * ((uint16_t)(scale)+1)) >> 8; +#else + return ((int)i * (int)(scale) ) >> 8; +#endif +#elif SCALE8_AVRASM == 1 + asm volatile( + #if (FASTLED_SCALE8_FIXED==1) + // Multiply 8-bit i * 8-bit scale, giving 16-bit r1,r0 + "mul %0, %1 \n\t" + // Add i to r0, possibly setting the carry flag + "add r0, %0 \n\t" + // load the immediate 0 into i (note, this does _not_ touch any flags) + "ldi %0, 0x00 \n\t" + // walk and chew gum at the same time + "adc %0, r1 \n\t" + #else + /* Multiply 8-bit i * 8-bit scale, giving 16-bit r1,r0 */ + "mul %0, %1 \n\t" + /* Move the high 8-bits of the product (r1) back to i */ + "mov %0, r1 \n\t" + #endif + /* R1 IS LEFT DIRTY HERE; YOU MUST ZERO IT OUT YOURSELF */ + /* "clr __zero_reg__ \n\t" */ + + : "+a" (i) /* writes to i */ + : "a" (scale) /* uses scale */ + : "r0", "r1" /* clobbers r0, r1 */ ); + + // Return the result + return i; +#else +#error "No implementation for scale8_LEAVING_R1_DIRTY available." +#endif +} + + +/// This version of scale8_video does not clean up the R1 register on AVR +/// If you are doing several 'scale8_video's in a row, use this, and +/// then explicitly call cleanup_R1. +LIB8STATIC_ALWAYS_INLINE uint8_t scale8_video_LEAVING_R1_DIRTY( uint8_t i, fract8 scale) +{ +#if SCALE8_C == 1 || defined(LIB8_ATTINY) + uint8_t j = (((int)i * (int)scale) >> 8) + ((i&&scale)?1:0); + // uint8_t nonzeroscale = (scale != 0) ? 1 : 0; + // uint8_t j = (i == 0) ? 0 : (((int)i * (int)(scale) ) >> 8) + nonzeroscale; + return j; +#elif SCALE8_AVRASM == 1 + uint8_t j=0; + asm volatile( + " tst %[i]\n\t" + " breq L_%=\n\t" + " mul %[i], %[scale]\n\t" + " mov %[j], r1\n\t" + " breq L_%=\n\t" + " subi %[j], 0xFF\n\t" + "L_%=: \n\t" + : [j] "+a" (j) + : [i] "a" (i), [scale] "a" (scale) + : "r0", "r1"); + + return j; + // uint8_t nonzeroscale = (scale != 0) ? 1 : 0; + // asm volatile( + // " tst %0 \n" + // " breq L_%= \n" + // " mul %0, %1 \n" + // " mov %0, r1 \n" + // " add %0, %2 \n" + // " clr __zero_reg__ \n" + // "L_%=: \n" + + // : "+a" (i) + // : "a" (scale), "a" (nonzeroscale) + // : "r0", "r1"); + + // // Return the result + // return i; +#else +#error "No implementation for scale8_video_LEAVING_R1_DIRTY available." +#endif +} + +/// Clean up the r1 register after a series of *LEAVING_R1_DIRTY calls +LIB8STATIC_ALWAYS_INLINE void cleanup_R1(void) +{ +#if CLEANUP_R1_AVRASM == 1 + // Restore r1 to "0"; it's expected to always be that + asm volatile( "clr __zero_reg__ \n\t" : : : "r1" ); +#endif +} + + +/// scale a 16-bit unsigned value by an 8-bit value, +/// considered as numerator of a fraction whose denominator +/// is 256. In other words, it computes i * (scale / 256) + +LIB8STATIC_ALWAYS_INLINE uint16_t scale16by8( uint16_t i, fract8 scale ) +{ +#if SCALE16BY8_C == 1 + uint16_t result; +#if FASTLED_SCALE8_FIXED == 1 + result = (i * (1+((uint16_t)scale))) >> 8; +#else + result = (i * scale) / 256; +#endif + return result; +#elif SCALE16BY8_AVRASM == 1 +#if FASTLED_SCALE8_FIXED == 1 + uint16_t result = 0; + asm volatile( + // result.A = HighByte( (i.A x scale) + i.A ) + " mul %A[i], %[scale] \n\t" + " add r0, %A[i] \n\t" + // " adc r1, [zero] \n\t" + // " mov %A[result], r1 \n\t" + " adc %A[result], r1 \n\t" + + // result.A-B += i.B x scale + " mul %B[i], %[scale] \n\t" + " add %A[result], r0 \n\t" + " adc %B[result], r1 \n\t" + + // cleanup r1 + " clr __zero_reg__ \n\t" + + // result.A-B += i.B + " add %A[result], %B[i] \n\t" + " adc %B[result], __zero_reg__ \n\t" + + : [result] "+r" (result) + : [i] "r" (i), [scale] "r" (scale) + : "r0", "r1" + ); + return result; +#else + uint16_t result = 0; + asm volatile( + // result.A = HighByte(i.A x j ) + " mul %A[i], %[scale] \n\t" + " mov %A[result], r1 \n\t" + //" clr %B[result] \n\t" + + // result.A-B += i.B x j + " mul %B[i], %[scale] \n\t" + " add %A[result], r0 \n\t" + " adc %B[result], r1 \n\t" + + // cleanup r1 + " clr __zero_reg__ \n\t" + + : [result] "+r" (result) + : [i] "r" (i), [scale] "r" (scale) + : "r0", "r1" + ); + return result; +#endif +#else + #error "No implementation for scale16by8 available." +#endif +} + +/// scale a 16-bit unsigned value by a 16-bit value, +/// considered as numerator of a fraction whose denominator +/// is 65536. In other words, it computes i * (scale / 65536) + +LIB8STATIC uint16_t scale16( uint16_t i, fract16 scale ) +{ + #if SCALE16_C == 1 + uint16_t result; +#if FASTLED_SCALE8_FIXED == 1 + result = ((uint32_t)(i) * (1+(uint32_t)(scale))) / 65536; +#else + result = ((uint32_t)(i) * (uint32_t)(scale)) / 65536; +#endif + return result; +#elif SCALE16_AVRASM == 1 +#if FASTLED_SCALE8_FIXED == 1 + // implemented sort of like + // result = ((i * scale) + i ) / 65536 + // + // why not like this, you may ask? + // result = (i * (scale+1)) / 65536 + // the answer is that if scale is 65535, then scale+1 + // will be zero, which is not what we want. + uint32_t result; + asm volatile( + // result.A-B = i.A x scale.A + " mul %A[i], %A[scale] \n\t" + // save results... + // basic idea: + //" mov %A[result], r0 \n\t" + //" mov %B[result], r1 \n\t" + // which can be written as... + " movw %A[result], r0 \n\t" + // Because we're going to add i.A-B to + // result.A-D, we DO need to keep both + // the r0 and r1 portions of the product + // UNlike in the 'unfixed scale8' version. + // So the movw here is needed. + : [result] "=r" (result) + : [i] "r" (i), + [scale] "r" (scale) + : "r0", "r1" + ); + + asm volatile( + // result.C-D = i.B x scale.B + " mul %B[i], %B[scale] \n\t" + //" mov %C[result], r0 \n\t" + //" mov %D[result], r1 \n\t" + " movw %C[result], r0 \n\t" + : [result] "+r" (result) + : [i] "r" (i), + [scale] "r" (scale) + : "r0", "r1" + ); + + const uint8_t zero = 0; + asm volatile( + // result.B-D += i.B x scale.A + " mul %B[i], %A[scale] \n\t" + + " add %B[result], r0 \n\t" + " adc %C[result], r1 \n\t" + " adc %D[result], %[zero] \n\t" + + // result.B-D += i.A x scale.B + " mul %A[i], %B[scale] \n\t" + + " add %B[result], r0 \n\t" + " adc %C[result], r1 \n\t" + " adc %D[result], %[zero] \n\t" + + // cleanup r1 + " clr r1 \n\t" + + : [result] "+r" (result) + : [i] "r" (i), + [scale] "r" (scale), + [zero] "r" (zero) + : "r0", "r1" + ); + + asm volatile( + // result.A-D += i.A-B + " add %A[result], %A[i] \n\t" + " adc %B[result], %B[i] \n\t" + " adc %C[result], %[zero] \n\t" + " adc %D[result], %[zero] \n\t" + : [result] "+r" (result) + : [i] "r" (i), + [zero] "r" (zero) + ); + + result = result >> 16; + return result; +#else + uint32_t result; + asm volatile( + // result.A-B = i.A x scale.A + " mul %A[i], %A[scale] \n\t" + // save results... + // basic idea: + //" mov %A[result], r0 \n\t" + //" mov %B[result], r1 \n\t" + // which can be written as... + " movw %A[result], r0 \n\t" + // We actually don't need to do anything with r0, + // as result.A is never used again here, so we + // could just move the high byte, but movw is + // one clock cycle, just like mov, so might as + // well, in case we want to use this code for + // a generic 16x16 multiply somewhere. + + : [result] "=r" (result) + : [i] "r" (i), + [scale] "r" (scale) + : "r0", "r1" + ); + + asm volatile( + // result.C-D = i.B x scale.B + " mul %B[i], %B[scale] \n\t" + //" mov %C[result], r0 \n\t" + //" mov %D[result], r1 \n\t" + " movw %C[result], r0 \n\t" + : [result] "+r" (result) + : [i] "r" (i), + [scale] "r" (scale) + : "r0", "r1" + ); + + const uint8_t zero = 0; + asm volatile( + // result.B-D += i.B x scale.A + " mul %B[i], %A[scale] \n\t" + + " add %B[result], r0 \n\t" + " adc %C[result], r1 \n\t" + " adc %D[result], %[zero] \n\t" + + // result.B-D += i.A x scale.B + " mul %A[i], %B[scale] \n\t" + + " add %B[result], r0 \n\t" + " adc %C[result], r1 \n\t" + " adc %D[result], %[zero] \n\t" + + // cleanup r1 + " clr r1 \n\t" + + : [result] "+r" (result) + : [i] "r" (i), + [scale] "r" (scale), + [zero] "r" (zero) + : "r0", "r1" + ); + + result = result >> 16; + return result; +#endif +#else + #error "No implementation for scale16 available." +#endif +} +///@} + +///@defgroup Dimming Dimming and brightening functions +/// +/// Dimming and brightening functions +/// +/// The eye does not respond in a linear way to light. +/// High speed PWM'd LEDs at 50% duty cycle appear far +/// brighter then the 'half as bright' you might expect. +/// +/// If you want your midpoint brightness leve (128) to +/// appear half as bright as 'full' brightness (255), you +/// have to apply a 'dimming function'. +///@{ + +/// Adjust a scaling value for dimming +LIB8STATIC uint8_t dim8_raw( uint8_t x) +{ + return scale8( x, x); +} + +/// Adjust a scaling value for dimming for video (value will never go below 1) +LIB8STATIC uint8_t dim8_video( uint8_t x) +{ + return scale8_video( x, x); +} + +/// Linear version of the dimming function that halves for values < 128 +LIB8STATIC uint8_t dim8_lin( uint8_t x ) +{ + if( x & 0x80 ) { + x = scale8( x, x); + } else { + x += 1; + x /= 2; + } + return x; +} + +/// inverse of the dimming function, brighten a value +LIB8STATIC uint8_t brighten8_raw( uint8_t x) +{ + uint8_t ix = 255 - x; + return 255 - scale8( ix, ix); +} + +/// inverse of the dimming function, brighten a value +LIB8STATIC uint8_t brighten8_video( uint8_t x) +{ + uint8_t ix = 255 - x; + return 255 - scale8_video( ix, ix); +} + +/// inverse of the dimming function, brighten a value +LIB8STATIC uint8_t brighten8_lin( uint8_t x ) +{ + uint8_t ix = 255 - x; + if( ix & 0x80 ) { + ix = scale8( ix, ix); + } else { + ix += 1; + ix /= 2; + } + return 255 - ix; +} + +///@} +#endif diff --git a/lib/lib8tion/trig8.h b/lib/lib8tion/trig8.h new file mode 100644 index 00000000000..cfba6373fb9 --- /dev/null +++ b/lib/lib8tion/trig8.h @@ -0,0 +1,284 @@ +#ifndef __INC_LIB8TION_TRIG_H +#define __INC_LIB8TION_TRIG_H + +///@ingroup lib8tion + +///@defgroup Trig Fast trig functions +/// Fast 8 and 16-bit approximations of sin(x) and cos(x). +/// Don't use these approximations for calculating the +/// trajectory of a rocket to Mars, but they're great +/// for art projects and LED displays. +/// +/// On Arduino/AVR, the 16-bit approximation is more than +/// 10X faster than floating point sin(x) and cos(x), while +/// the 8-bit approximation is more than 20X faster. +///@{ + +#if defined(__AVR__) +#define sin16 sin16_avr +#else +#define sin16 sin16_C +#endif + +/// Fast 16-bit approximation of sin(x). This approximation never varies more than +/// 0.69% from the floating point value you'd get by doing +/// +/// float s = sin(x) * 32767.0; +/// +/// @param theta input angle from 0-65535 +/// @returns sin of theta, value between -32767 to 32767. +LIB8STATIC int16_t sin16_avr( uint16_t theta ) +{ + static const uint8_t data[] = + { 0, 0, 49, 0, 6393%256, 6393/256, 48, 0, + 12539%256, 12539/256, 44, 0, 18204%256, 18204/256, 38, 0, + 23170%256, 23170/256, 31, 0, 27245%256, 27245/256, 23, 0, + 30273%256, 30273/256, 14, 0, 32137%256, 32137/256, 4 /*,0*/ }; + + uint16_t offset = (theta & 0x3FFF); + + // AVR doesn't have a multi-bit shift instruction, + // so if we say "offset >>= 3", gcc makes a tiny loop. + // Inserting empty volatile statements between each + // bit shift forces gcc to unroll the loop. + offset >>= 1; // 0..8191 + asm volatile(""); + offset >>= 1; // 0..4095 + asm volatile(""); + offset >>= 1; // 0..2047 + + if( theta & 0x4000 ) offset = 2047 - offset; + + uint8_t sectionX4; + sectionX4 = offset / 256; + sectionX4 *= 4; + + uint8_t m; + + union { + uint16_t b; + struct { + uint8_t blo; + uint8_t bhi; + }; + } u; + + //in effect u.b = blo + (256 * bhi); + u.blo = data[ sectionX4 ]; + u.bhi = data[ sectionX4 + 1]; + m = data[ sectionX4 + 2]; + + uint8_t secoffset8 = (uint8_t)(offset) / 2; + + uint16_t mx = m * secoffset8; + + int16_t y = mx + u.b; + if( theta & 0x8000 ) y = -y; + + return y; +} + +/// Fast 16-bit approximation of sin(x). This approximation never varies more than +/// 0.69% from the floating point value you'd get by doing +/// +/// float s = sin(x) * 32767.0; +/// +/// @param theta input angle from 0-65535 +/// @returns sin of theta, value between -32767 to 32767. +LIB8STATIC int16_t sin16_C( uint16_t theta ) +{ + static const uint16_t base[] = + { 0, 6393, 12539, 18204, 23170, 27245, 30273, 32137 }; + static const uint8_t slope[] = + { 49, 48, 44, 38, 31, 23, 14, 4 }; + + uint16_t offset = (theta & 0x3FFF) >> 3; // 0..2047 + if( theta & 0x4000 ) offset = 2047 - offset; + + uint8_t section = offset / 256; // 0..7 + uint16_t b = base[section]; + uint8_t m = slope[section]; + + uint8_t secoffset8 = (uint8_t)(offset) / 2; + + uint16_t mx = m * secoffset8; + int16_t y = mx + b; + + if( theta & 0x8000 ) y = -y; + + return y; +} + + +/// Fast 16-bit approximation of cos(x). This approximation never varies more than +/// 0.69% from the floating point value you'd get by doing +/// +/// float s = cos(x) * 32767.0; +/// +/// @param theta input angle from 0-65535 +/// @returns sin of theta, value between -32767 to 32767. +LIB8STATIC int16_t cos16( uint16_t theta) +{ + return sin16( theta + 16384); +} + +/////////////////////////////////////////////////////////////////////// + +// sin8 & cos8 +// Fast 8-bit approximations of sin(x) & cos(x). +// Input angle is an unsigned int from 0-255. +// Output is an unsigned int from 0 to 255. +// +// This approximation can vary to to 2% +// from the floating point value you'd get by doing +// float s = (sin( x ) * 128.0) + 128; +// +// Don't use this approximation for calculating the +// "real" trigonometric calculations, but it's great +// for art projects and LED displays. +// +// On Arduino/AVR, this approximation is more than +// 20X faster than floating point sin(x) and cos(x) + +#if defined(__AVR__) && !defined(LIB8_ATTINY) +#define sin8 sin8_avr +#else +#define sin8 sin8_C +#endif + + +static const uint8_t b_m16_interleave[8] = { 0, 49, 49, 41, 90, 27, 117, 10 }; + +/// Fast 8-bit approximation of sin(x). This approximation never varies more than +/// 2% from the floating point value you'd get by doing +/// +/// float s = (sin(x) * 128.0) + 128; +/// +/// @param theta input angle from 0-255 +/// @returns sin of theta, value between 0 and 255 +LIB8STATIC uint8_t sin8_avr( uint8_t theta) +{ + uint8_t offset = theta; + + asm volatile( + "sbrc %[theta],6 \n\t" + "com %[offset] \n\t" + : [theta] "+r" (theta), [offset] "+r" (offset) + ); + + offset &= 0x3F; // 0..63 + + uint8_t secoffset = offset & 0x0F; // 0..15 + if( theta & 0x40) secoffset++; + + uint8_t m16; uint8_t b; + + uint8_t section = offset >> 4; // 0..3 + uint8_t s2 = section * 2; + + const uint8_t* p = b_m16_interleave; + p += s2; + b = *p; + p++; + m16 = *p; + + uint8_t mx; + uint8_t xr1; + asm volatile( + "mul %[m16],%[secoffset] \n\t" + "mov %[mx],r0 \n\t" + "mov %[xr1],r1 \n\t" + "eor r1, r1 \n\t" + "swap %[mx] \n\t" + "andi %[mx],0x0F \n\t" + "swap %[xr1] \n\t" + "andi %[xr1], 0xF0 \n\t" + "or %[mx], %[xr1] \n\t" + : [mx] "=d" (mx), [xr1] "=d" (xr1) + : [m16] "d" (m16), [secoffset] "d" (secoffset) + ); + + int8_t y = mx + b; + if( theta & 0x80 ) y = -y; + + y += 128; + + return y; +} + + +/// Fast 8-bit approximation of sin(x). This approximation never varies more than +/// 2% from the floating point value you'd get by doing +/// +/// float s = (sin(x) * 128.0) + 128; +/// +/// @param theta input angle from 0-255 +/// @returns sin of theta, value between 0 and 255 +LIB8STATIC uint8_t sin8_C( uint8_t theta) +{ + uint8_t offset = theta; + if( theta & 0x40 ) { + offset = (uint8_t)255 - offset; + } + offset &= 0x3F; // 0..63 + + uint8_t secoffset = offset & 0x0F; // 0..15 + if( theta & 0x40) secoffset++; + + uint8_t section = offset >> 4; // 0..3 + uint8_t s2 = section * 2; + const uint8_t* p = b_m16_interleave; + p += s2; + uint8_t b = *p; + p++; + uint8_t m16 = *p; + + uint8_t mx = (m16 * secoffset) >> 4; + + int8_t y = mx + b; + if( theta & 0x80 ) y = -y; + + y += 128; + + return y; +} + +/// Fast 8-bit approximation of cos(x). This approximation never varies more than +/// 2% from the floating point value you'd get by doing +/// +/// float s = (cos(x) * 128.0) + 128; +/// +/// @param theta input angle from 0-255 +/// @returns sin of theta, value between 0 and 255 +LIB8STATIC uint8_t cos8( uint8_t theta) +{ + return sin8( theta + 64); +} + +/// Fast 16-bit approximation of atan2(x). +/// @returns atan2, value between 0 and 255 +LIB8STATIC uint8_t atan2_8(int16_t dy, int16_t dx) +{ + if (dy == 0) + { + if (dx >= 0) + return 0; + else + return 128; + } + + int16_t abs_y = dy > 0 ? dy : -dy; + int8_t a; + + if (dx >= 0) + a = 32 - (32 * (dx - abs_y) / (dx + abs_y)); + else + a = 96 - (32 * (dx + abs_y) / (abs_y - dx)); + + if (dy < 0) + return -a; // negate if in quad III or IV + return a; +} + +///@} +#endif diff --git a/lib/lufa/Bootloaders/DFU/makefile b/lib/lufa/Bootloaders/DFU/makefile index 0d2014015dc..a10a5763766 100644 --- a/lib/lufa/Bootloaders/DFU/makefile +++ b/lib/lufa/Bootloaders/DFU/makefile @@ -11,11 +11,11 @@ # Run "make help" for target help. -MCU = atmega32u4 -ARCH = AVR8 -BOARD = QMK -F_CPU = 16000000 -F_USB = $(F_CPU) +MCU ?= atmega32u4 +ARCH ?= AVR8 +BOARD ?= QMK +F_CPU ?= 16000000 +F_USB ?= $(F_CPU) OPTIMIZATION = s TARGET = BootloaderDFU SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) @@ -26,8 +26,8 @@ LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAG # Flash size and bootloader section sizes of the target, in KB. These must # match the target's total FLASH size and the bootloader size set in the # device's fuses. -FLASH_SIZE_KB = 32 -BOOT_SECTION_SIZE_KB = 4 +FLASH_SIZE_KB ?= 32 +BOOT_SECTION_SIZE_KB ?= 4 # Bootloader address calculation formulas # Do not modify these macros, but rather modify the dependent values above. diff --git a/lib/python/milc.py b/lib/python/milc.py new file mode 100644 index 00000000000..6e82edf8b19 --- /dev/null +++ b/lib/python/milc.py @@ -0,0 +1,716 @@ +#!/usr/bin/env python3 +# coding=utf-8 +"""MILC - A CLI Framework + +PYTHON_ARGCOMPLETE_OK + +MILC is an opinionated framework for writing CLI apps. It optimizes for the +most common unix tool pattern- small tools that are run from the command +line but generally do not feature any user interaction while they run. + +For more details see the MILC documentation: + + +""" +from __future__ import division, print_function, unicode_literals +import argparse +import logging +import os +import re +import sys +from decimal import Decimal +from tempfile import NamedTemporaryFile +from time import sleep + +try: + from ConfigParser import RawConfigParser +except ImportError: + from configparser import RawConfigParser + +try: + import thread + import threading +except ImportError: + thread = None + +import argcomplete +import colorama + +# Log Level Representations +EMOJI_LOGLEVELS = { + 'CRITICAL': '{bg_red}{fg_white}¬_¬{style_reset_all}', + 'ERROR': '{fg_red}☒{style_reset_all}', + 'WARNING': '{fg_yellow}⚠{style_reset_all}', + 'INFO': '{fg_blue}ℹ{style_reset_all}', + 'DEBUG': '{fg_cyan}☐{style_reset_all}', + 'NOTSET': '{style_reset_all}¯\\_(o_o)_/¯' +} +EMOJI_LOGLEVELS['FATAL'] = EMOJI_LOGLEVELS['CRITICAL'] +EMOJI_LOGLEVELS['WARN'] = EMOJI_LOGLEVELS['WARNING'] + +# ANSI Color setup +# Regex was gratefully borrowed from kfir on stackoverflow: +# https://stackoverflow.com/a/45448194 +ansi_regex = r'\x1b(' \ + r'(\[\??\d+[hl])|' \ + r'([=<>a-kzNM78])|' \ + r'([\(\)][a-b0-2])|' \ + r'(\[\d{0,2}[ma-dgkjqi])|' \ + r'(\[\d+;\d+[hfy]?)|' \ + r'(\[;?[hf])|' \ + r'(#[3-68])|' \ + r'([01356]n)|' \ + r'(O[mlnp-z]?)|' \ + r'(/Z)|' \ + r'(\d+)|' \ + r'(\[\?\d;\d0c)|' \ + r'(\d;\dR))' +ansi_escape = re.compile(ansi_regex, flags=re.IGNORECASE) +ansi_styles = ( + ('fg', colorama.ansi.AnsiFore()), + ('bg', colorama.ansi.AnsiBack()), + ('style', colorama.ansi.AnsiStyle()), +) +ansi_colors = {} + +for prefix, obj in ansi_styles: + for color in [x for x in obj.__dict__ if not x.startswith('_')]: + ansi_colors[prefix + '_' + color.lower()] = getattr(obj, color) + + +def format_ansi(text): + """Return a copy of text with certain strings replaced with ansi. + """ + # Avoid .format() so we don't have to worry about the log content + for color in ansi_colors: + text = text.replace('{%s}' % color, ansi_colors[color]) + return text + ansi_colors['style_reset_all'] + + +class ANSIFormatter(logging.Formatter): + """A log formatter that inserts ANSI color. + """ + + def format(self, record): + msg = super(ANSIFormatter, self).format(record) + return format_ansi(msg) + + +class ANSIEmojiLoglevelFormatter(ANSIFormatter): + """A log formatter that makes the loglevel an emoji. + """ + + def format(self, record): + record.levelname = EMOJI_LOGLEVELS[record.levelname].format(**ansi_colors) + return super(ANSIEmojiLoglevelFormatter, self).format(record) + + +class ANSIStrippingFormatter(ANSIFormatter): + """A log formatter that strips ANSI. + """ + + def format(self, record): + msg = super(ANSIStrippingFormatter, self).format(record) + return ansi_escape.sub('', msg) + + +class Configuration(object): + """Represents the running configuration. + + This class never raises IndexError, instead it will return None if a + section or option does not yet exist. + """ + + def __contains__(self, key): + return self._config.__contains__(key) + + def __iter__(self): + return self._config.__iter__() + + def __len__(self): + return self._config.__len__() + + def __repr__(self): + return self._config.__repr__() + + def keys(self): + return self._config.keys() + + def items(self): + return self._config.items() + + def values(self): + return self._config.values() + + def __init__(self, *args, **kwargs): + self._config = {} + self.default_container = ConfigurationOption + + def __getitem__(self, key): + """Returns a config section, creating it if it doesn't exist yet. + """ + if key not in self._config: + self.__dict__[key] = self._config[key] = ConfigurationOption() + + return self._config[key] + + def __setitem__(self, key, value): + self.__dict__[key] = value + self._config[key] = value + + def __delitem__(self, key): + if key in self.__dict__ and key[0] != '_': + del self.__dict__[key] + del self._config[key] + + +class ConfigurationOption(Configuration): + def __init__(self, *args, **kwargs): + super(ConfigurationOption, self).__init__(*args, **kwargs) + self.default_container = dict + + def __getitem__(self, key): + """Returns a config section, creating it if it doesn't exist yet. + """ + if key not in self._config: + self.__dict__[key] = self._config[key] = None + + return self._config[key] + + +def handle_store_boolean(self, *args, **kwargs): + """Does the add_argument for action='store_boolean'. + """ + kwargs['add_dest'] = False + disabled_args = None + disabled_kwargs = kwargs.copy() + disabled_kwargs['action'] = 'store_false' + disabled_kwargs['help'] = 'Disable ' + kwargs['help'] + kwargs['action'] = 'store_true' + kwargs['help'] = 'Enable ' + kwargs['help'] + + for flag in args: + if flag[:2] == '--': + disabled_args = ('--no-' + flag[2:],) + break + + self.add_argument(*args, **kwargs) + self.add_argument(*disabled_args, **disabled_kwargs) + + return (args, kwargs, disabled_args, disabled_kwargs) + + +class SubparserWrapper(object): + """Wrap subparsers so we can populate the normal and the shadow parser. + """ + + def __init__(self, cli, submodule, subparser): + self.cli = cli + self.submodule = submodule + self.subparser = subparser + + for attr in dir(subparser): + if not hasattr(self, attr): + setattr(self, attr, getattr(subparser, attr)) + + def completer(self, completer): + """Add an arpcomplete completer to this subcommand. + """ + self.subparser.completer = completer + + def add_argument(self, *args, **kwargs): + if kwargs.get('add_dest', True): + kwargs['dest'] = self.submodule + '_' + self.cli.get_argument_name(*args, **kwargs) + if 'add_dest' in kwargs: + del kwargs['add_dest'] + + if 'action' in kwargs and kwargs['action'] == 'store_boolean': + return handle_store_boolean(self, *args, **kwargs) + + self.cli.acquire_lock() + self.subparser.add_argument(*args, **kwargs) + + if 'default' in kwargs: + del kwargs['default'] + if 'action' in kwargs and kwargs['action'] == 'store_false': + kwargs['action'] == 'store_true' + self.cli.subcommands_default[self.submodule].add_argument(*args, **kwargs) + self.cli.release_lock() + + +class MILC(object): + """MILC - An Opinionated Batteries Included Framework + """ + + def __init__(self): + """Initialize the MILC object. + """ + # Setup a lock for thread safety + self._lock = threading.RLock() if thread else None + + # Define some basic info + self.acquire_lock() + self._description = None + self._entrypoint = None + self._inside_context_manager = False + self.ansi = ansi_colors + self.config = Configuration() + self.config_file = None + self.prog_name = sys.argv[0][:-3] if sys.argv[0].endswith('.py') else sys.argv[0] + self.version = os.environ.get('QMK_VERSION', 'unknown') + self.release_lock() + + # Initialize all the things + self.initialize_argparse() + self.initialize_logging() + + @property + def description(self): + return self._description + + @description.setter + def description(self, value): + self._description = self._arg_parser.description = self._arg_defaults.description = value + + def echo(self, text, *args, **kwargs): + """Print colorized text to stdout, as long as stdout is a tty. + + ANSI color strings (such as {fg-blue}) will be converted into ANSI + escape sequences, and the ANSI reset sequence will be added to all + strings. + + If *args or **kwargs are passed they will be used to %-format the strings. + """ + if args and kwargs: + raise RuntimeError('You can only specify *args or **kwargs, not both!') + + if sys.stdout.isatty(): + args = args or kwargs + text = format_ansi(text) + + print(text % args) + + def initialize_argparse(self): + """Prepare to process arguments from sys.argv. + """ + kwargs = { + 'fromfile_prefix_chars': '@', + 'conflict_handler': 'resolve', + } + + self.acquire_lock() + self.subcommands = {} + self.subcommands_default = {} + self._subparsers = None + self._subparsers_default = None + self.argwarn = argcomplete.warn + self.args = None + self._arg_defaults = argparse.ArgumentParser(**kwargs) + self._arg_parser = argparse.ArgumentParser(**kwargs) + self.set_defaults = self._arg_parser.set_defaults + self.print_usage = self._arg_parser.print_usage + self.print_help = self._arg_parser.print_help + self.release_lock() + + def completer(self, completer): + """Add an arpcomplete completer to this subcommand. + """ + self._arg_parser.completer = completer + + def add_argument(self, *args, **kwargs): + """Wrapper to add arguments to both the main and the shadow argparser. + """ + if kwargs.get('add_dest', True) and args[0][0] == '-': + kwargs['dest'] = 'general_' + self.get_argument_name(*args, **kwargs) + if 'add_dest' in kwargs: + del kwargs['add_dest'] + + if 'action' in kwargs and kwargs['action'] == 'store_boolean': + return handle_store_boolean(self, *args, **kwargs) + + self.acquire_lock() + self._arg_parser.add_argument(*args, **kwargs) + + # Populate the shadow parser + if 'default' in kwargs: + del kwargs['default'] + if 'action' in kwargs and kwargs['action'] == 'store_false': + kwargs['action'] == 'store_true' + self._arg_defaults.add_argument(*args, **kwargs) + self.release_lock() + + def initialize_logging(self): + """Prepare the defaults for the logging infrastructure. + """ + self.acquire_lock() + self.log_file = None + self.log_file_mode = 'a' + self.log_file_handler = None + self.log_print = True + self.log_print_to = sys.stderr + self.log_print_level = logging.INFO + self.log_file_level = logging.DEBUG + self.log_level = logging.INFO + self.log = logging.getLogger(self.__class__.__name__) + self.log.setLevel(logging.DEBUG) + logging.root.setLevel(logging.DEBUG) + self.release_lock() + + self.add_argument('-V', '--version', version=self.version, action='version', help='Display the version and exit') + self.add_argument('-v', '--verbose', action='store_true', help='Make the logging more verbose') + self.add_argument('--datetime-fmt', default='%Y-%m-%d %H:%M:%S', help='Format string for datetimes') + self.add_argument('--log-fmt', default='%(levelname)s %(message)s', help='Format string for printed log output') + self.add_argument('--log-file-fmt', default='[%(levelname)s] [%(asctime)s] [file:%(pathname)s] [line:%(lineno)d] %(message)s', help='Format string for log file.') + self.add_argument('--log-file', help='File to write log messages to') + self.add_argument('--color', action='store_boolean', default=True, help='color in output') + self.add_argument('-c', '--config-file', help='The config file to read and/or write') + self.add_argument('--save-config', action='store_true', help='Save the running configuration to the config file') + + def add_subparsers(self, title='Sub-commands', **kwargs): + if self._inside_context_manager: + raise RuntimeError('You must run this before the with statement!') + + self.acquire_lock() + self._subparsers_default = self._arg_defaults.add_subparsers(title=title, dest='subparsers', **kwargs) + self._subparsers = self._arg_parser.add_subparsers(title=title, dest='subparsers', **kwargs) + self.release_lock() + + def acquire_lock(self): + """Acquire the MILC lock for exclusive access to properties. + """ + if self._lock: + self._lock.acquire() + + def release_lock(self): + """Release the MILC lock. + """ + if self._lock: + self._lock.release() + + def find_config_file(self): + """Locate the config file. + """ + if self.config_file: + return self.config_file + + if self.args and self.args.general_config_file: + return self.args.general_config_file + + return os.path.abspath(os.path.expanduser('~/.%s.ini' % self.prog_name)) + + def get_argument_name(self, *args, **kwargs): + """Takes argparse arguments and returns the dest name. + """ + try: + return self._arg_parser._get_optional_kwargs(*args, **kwargs)['dest'] + except ValueError: + return self._arg_parser._get_positional_kwargs(*args, **kwargs)['dest'] + + def argument(self, *args, **kwargs): + """Decorator to call self.add_argument or self..add_argument. + """ + if self._inside_context_manager: + raise RuntimeError('You must run this before the with statement!') + + def argument_function(handler): + if handler is self._entrypoint: + self.add_argument(*args, **kwargs) + + elif handler.__name__ in self.subcommands: + self.subcommands[handler.__name__].add_argument(*args, **kwargs) + + else: + raise RuntimeError('Decorated function is not entrypoint or subcommand!') + + return handler + + return argument_function + + def arg_passed(self, arg): + """Returns True if arg was passed on the command line. + """ + return self.args_passed[arg] in (None, False) + + def parse_args(self): + """Parse the CLI args. + """ + if self.args: + self.log.debug('Warning: Arguments have already been parsed, ignoring duplicate attempt!') + return + + argcomplete.autocomplete(self._arg_parser) + + self.acquire_lock() + self.args = self._arg_parser.parse_args() + self.args_passed = self._arg_defaults.parse_args() + + if 'entrypoint' in self.args: + self._entrypoint = self.args.entrypoint + + if self.args.general_config_file: + self.config_file = self.args.general_config_file + + self.release_lock() + + def read_config(self): + """Parse the configuration file and determine the runtime configuration. + """ + self.acquire_lock() + self.config_file = self.find_config_file() + + if self.config_file and os.path.exists(self.config_file): + config = RawConfigParser(self.config) + config.read(self.config_file) + + # Iterate over the config file options and write them into self.config + for section in config.sections(): + for option in config.options(section): + value = config.get(section, option) + + # Coerce values into useful datatypes + if value.lower() in ['1', 'yes', 'true', 'on']: + value = True + elif value.lower() in ['0', 'no', 'false', 'none', 'off']: + value = False + elif value.replace('.', '').isdigit(): + if '.' in value: + value = Decimal(value) + else: + value = int(value) + + self.config[section][option] = value + + # Fold the CLI args into self.config + for argument in vars(self.args): + if argument in ('subparsers', 'entrypoint'): + continue + + if '_' not in argument: + continue + + section, option = argument.split('_', 1) + if hasattr(self.args_passed, argument): + self.config[section][option] = getattr(self.args, argument) + else: + if option not in self.config[section]: + self.config[section][option] = getattr(self.args, argument) + + self.release_lock() + + def save_config(self): + """Save the current configuration to the config file. + """ + self.log.debug("Saving config file to '%s'", self.config_file) + + if not self.config_file: + self.log.warning('%s.config_file file not set, not saving config!', self.__class__.__name__) + return + + self.acquire_lock() + + config = RawConfigParser() + for section_name, section in self.config._config.items(): + config.add_section(section_name) + for option_name, value in section.items(): + if section_name == 'general': + if option_name in ['save_config']: + continue + config.set(section_name, option_name, str(value)) + + with NamedTemporaryFile(mode='w', dir=os.path.dirname(self.config_file), delete=False) as tmpfile: + config.write(tmpfile) + + # Move the new config file into place atomically + if os.path.getsize(tmpfile.name) > 0: + os.rename(tmpfile.name, self.config_file) + else: + self.log.warning('Config file saving failed, not replacing %s with %s.', self.config_file, tmpfile.name) + + self.release_lock() + + def __call__(self): + """Execute the entrypoint function. + """ + if not self._inside_context_manager: + # If they didn't use the context manager use it ourselves + with self: + self.__call__() + return + + if not self._entrypoint: + raise RuntimeError('No entrypoint provided!') + + return self._entrypoint(self) + + def entrypoint(self, description): + """Set the entrypoint for when no subcommand is provided. + """ + if self._inside_context_manager: + raise RuntimeError('You must run this before cli()!') + + self.acquire_lock() + self.description = description + self.release_lock() + + def entrypoint_func(handler): + self.acquire_lock() + self._entrypoint = handler + self.release_lock() + + return handler + + return entrypoint_func + + def add_subcommand(self, handler, description, name=None, **kwargs): + """Register a subcommand. + + If name is not provided we use `handler.__name__`. + """ + if self._inside_context_manager: + raise RuntimeError('You must run this before the with statement!') + + if self._subparsers is None: + self.add_subparsers() + + if not name: + name = handler.__name__ + + self.acquire_lock() + kwargs['help'] = description + self.subcommands_default[name] = self._subparsers_default.add_parser(name, **kwargs) + self.subcommands[name] = SubparserWrapper(self, name, self._subparsers.add_parser(name, **kwargs)) + self.subcommands[name].set_defaults(entrypoint=handler) + + if name not in self.__dict__: + self.__dict__[name] = self.subcommands[name] + else: + self.log.debug("Could not add subcommand '%s' to attributes, key already exists!", name) + + self.release_lock() + + return handler + + def subcommand(self, description, **kwargs): + """Decorator to register a subcommand. + """ + + def subcommand_function(handler): + return self.add_subcommand(handler, description, **kwargs) + + return subcommand_function + + def setup_logging(self): + """Called by __enter__() to setup the logging configuration. + """ + if len(logging.root.handlers) != 0: + # This is not a design decision. This is what I'm doing for now until I can examine and think about this situation in more detail. + raise RuntimeError('MILC should be the only system installing root log handlers!') + + self.acquire_lock() + + if self.config['general']['verbose']: + self.log_print_level = logging.DEBUG + + self.log_file = self.config['general']['log_file'] or self.log_file + self.log_file_format = self.config['general']['log_file_fmt'] + self.log_file_format = ANSIStrippingFormatter(self.config['general']['log_file_fmt'], self.config['general']['datetime_fmt']) + self.log_format = self.config['general']['log_fmt'] + + if self.config.general.color: + self.log_format = ANSIEmojiLoglevelFormatter(self.args.general_log_fmt, self.config.general.datetime_fmt) + else: + self.log_format = ANSIStrippingFormatter(self.args.general_log_fmt, self.config.general.datetime_fmt) + + if self.log_file: + self.log_file_handler = logging.FileHandler(self.log_file, self.log_file_mode) + self.log_file_handler.setLevel(self.log_file_level) + self.log_file_handler.setFormatter(self.log_file_format) + logging.root.addHandler(self.log_file_handler) + + if self.log_print: + self.log_print_handler = logging.StreamHandler(self.log_print_to) + self.log_print_handler.setLevel(self.log_print_level) + self.log_print_handler.setFormatter(self.log_format) + logging.root.addHandler(self.log_print_handler) + + self.release_lock() + + def __enter__(self): + if self._inside_context_manager: + self.log.debug('Warning: context manager was entered again. This usually means that self.__call__() was called before the with statement. You probably do not want to do that.') + return + + self.acquire_lock() + self._inside_context_manager = True + self.release_lock() + + colorama.init() + self.parse_args() + self.read_config() + self.setup_logging() + + if self.config.general.save_config: + self.save_config() + + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.acquire_lock() + self._inside_context_manager = False + self.release_lock() + + if exc_type is not None and not isinstance(SystemExit(), exc_type): + print(exc_type) + logging.exception(exc_val) + exit(255) + + +cli = MILC() + +if __name__ == '__main__': + + @cli.argument('-c', '--comma', help='comma in output', default=True, action='store_boolean') + @cli.entrypoint('My useful CLI tool with subcommands.') + def main(cli): + comma = ',' if cli.config.general.comma else '' + cli.log.info('{bg_green}{fg_red}Hello%s World!', comma) + + @cli.argument('-n', '--name', help='Name to greet', default='World') + @cli.subcommand('Description of hello subcommand here.') + def hello(cli): + comma = ',' if cli.config.general.comma else '' + cli.log.info('{fg_blue}Hello%s %s!', comma, cli.config.hello.name) + + def goodbye(cli): + comma = ',' if cli.config.general.comma else '' + cli.log.info('{bg_red}Goodbye%s %s!', comma, cli.config.goodbye.name) + + @cli.argument('-n', '--name', help='Name to greet', default='World') + @cli.subcommand('Think a bit before greeting the user.') + def thinking(cli): + comma = ',' if cli.config.general.comma else '' + spinner = cli.spinner(text='Just a moment...', spinner='earth') + spinner.start() + sleep(2) + spinner.stop() + + with cli.spinner(text='Almost there!', spinner='moon'): + sleep(2) + + cli.log.info('{fg_cyan}Hello%s %s!', comma, cli.config.thinking.name) + + @cli.subcommand('Show off our ANSI colors.') + def pride(cli): + cli.echo('{bg_red} ') + cli.echo('{bg_lightred_ex} ') + cli.echo('{bg_lightyellow_ex} ') + cli.echo('{bg_green} ') + cli.echo('{bg_blue} ') + cli.echo('{bg_magenta} ') + + # You can register subcommands using decorators as seen above, or using functions like like this: + cli.add_subcommand(goodbye, 'This will show up in --help output.') + cli.goodbye.add_argument('-n', '--name', help='Name to bid farewell to', default='World') + + cli() # Automatically picks between main(), hello() and goodbye() + print(sorted(ansi_colors.keys())) diff --git a/lib/python/qmk/__init__.py b/lib/python/qmk/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/lib/python/qmk/cli/compile/__init__.py b/lib/python/qmk/cli/compile/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/lib/python/qmk/cli/compile/json.py b/lib/python/qmk/cli/compile/json.py new file mode 100755 index 00000000000..89c16b20631 --- /dev/null +++ b/lib/python/qmk/cli/compile/json.py @@ -0,0 +1,44 @@ +"""Create a keymap directory from a configurator export. +""" +import json +import os +import sys +import subprocess + +from milc import cli + +import qmk.keymap +import qmk.path + + +@cli.argument('filename', help='Configurator JSON export') +@cli.entrypoint('Compile a QMK Configurator export.') +def main(cli): + """Compile a QMK Configurator export. + + This command creates a new keymap from a configurator export, overwriting an existing keymap if one exists. + + FIXME(skullydazed): add code to check and warn if the keymap already exists + """ + # Error checking + if cli.args.filename == ('-'): + cli.log.error('Reading from STDIN is not (yet) supported.') + exit(1) + if not os.path.exists(qmk.path.normpath(cli.args.filename)): + cli.log.error('JSON file does not exist!') + exit(1) + + # Parse the configurator json + with open(qmk.path.normpath(cli.args.filename), 'r') as fd: + user_keymap = json.load(fd) + + # Generate the keymap + keymap_path = qmk.path.keymap(user_keymap['keyboard']) + cli.log.info('Creating {fg_cyan}%s{style_reset_all} keymap in {fg_cyan}%s', user_keymap['keymap'], keymap_path) + qmk.keymap.write(user_keymap['keyboard'], user_keymap['keymap'], user_keymap['layout'], user_keymap['layers']) + cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap']) + + # Compile the keymap + command = ['make', ':'.join((user_keymap['keyboard'], user_keymap['keymap']))] + cli.log.info('Compiling keymap with {fg_cyan}%s\n\n', ' '.join(command)) + subprocess.run(command) diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py new file mode 100755 index 00000000000..9ce765a4b51 --- /dev/null +++ b/lib/python/qmk/cli/doctor.py @@ -0,0 +1,47 @@ +"""QMK Python Doctor + +Check up for QMK environment. +""" +import shutil +import platform +import os + +from milc import cli + + +@cli.entrypoint('Basic QMK environment checks') +def main(cli): + """Basic QMK environment checks. + + This is currently very simple, it just checks that all the expected binaries are on your system. + + TODO(unclaimed): + * [ ] Run the binaries to make sure they work + * [ ] Compile a trivial program with each compiler + * [ ] Check for udev entries on linux + """ + + binaries = ['dfu-programmer', 'avrdude', 'dfu-util', 'avr-gcc', 'arm-none-eabi-gcc'] + + cli.log.info('QMK Doctor is Checking your environment') + + ok = True + for binary in binaries: + res = shutil.which(binary) + if res is None: + cli.log.error('{fg_red}QMK can\'t find ' + binary + ' in your path') + ok = False + + OS = platform.system() + if OS == "Darwin": + cli.log.info("Detected {fg_cyan}macOS") + elif OS == "Linux": + cli.log.info("Detected {fg_cyan}linux") + test = 'systemctl list-unit-files | grep enabled | grep -i ModemManager' + if os.system(test) == 0: + cli.log.warn("{bg_yellow}Detected modem manager. Please disable it if you are using Pro Micros") + else: + cli.log.info("Assuming {fg_cyan}Windows") + + if ok: + cli.log.info('{fg_green}QMK is ready to go') diff --git a/lib/python/qmk/cli/hello.py b/lib/python/qmk/cli/hello.py new file mode 100755 index 00000000000..bc0cb6de182 --- /dev/null +++ b/lib/python/qmk/cli/hello.py @@ -0,0 +1,13 @@ +"""QMK Python Hello World + +This is an example QMK CLI script. +""" +from milc import cli + + +@cli.argument('-n', '--name', default='World', help='Name to greet.') +@cli.entrypoint('QMK Hello World.') +def main(cli): + """Log a friendly greeting. + """ + cli.log.info('Hello, %s!', cli.config.general.name) diff --git a/lib/python/qmk/cli/json/__init__.py b/lib/python/qmk/cli/json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/lib/python/qmk/cli/json/keymap.py b/lib/python/qmk/cli/json/keymap.py new file mode 100755 index 00000000000..e2d0b580936 --- /dev/null +++ b/lib/python/qmk/cli/json/keymap.py @@ -0,0 +1,54 @@ +"""Generate a keymap.c from a configurator export. +""" +import json +import os +import sys + +from milc import cli + +import qmk.keymap + + +@cli.argument('-o', '--output', help='File to write to') +@cli.argument('filename', help='Configurator JSON file') +@cli.entrypoint('Create a keymap.c from a QMK Configurator export.') +def main(cli): + """Generate a keymap.c from a configurator export. + + This command uses the `qmk.keymap` module to generate a keymap.c from a configurator export. The generated keymap is written to stdout, or to a file if -o is provided. + """ + # Error checking + if cli.args.filename == ('-'): + cli.log.error('Reading from STDIN is not (yet) supported.') + cli.print_usage() + exit(1) + if not os.path.exists(qmk.path.normpath(cli.args.filename)): + cli.log.error('JSON file does not exist!') + cli.print_usage() + exit(1) + + # Environment processing + if cli.config.general.output == ('-'): + cli.config.general.output = None + + # Parse the configurator json + with open(qmk.path.normpath(cli.args.filename), 'r') as fd: + user_keymap = json.load(fd) + + # Generate the keymap + keymap_c = qmk.keymap.generate(user_keymap['keyboard'], user_keymap['layout'], user_keymap['layers']) + + if cli.config.general.output: + output_dir = os.path.dirname(cli.config.general.output) + + if not os.path.exists(output_dir): + os.makedirs(output_dir) + + output_file = qmk.path.normpath(cli.config.general.output) + with open(output_file, 'w') as keymap_fd: + keymap_fd.write(keymap_c) + + cli.log.info('Wrote keymap to %s.', cli.config.general.output) + + else: + print(keymap_c) diff --git a/lib/python/qmk/errors.py b/lib/python/qmk/errors.py new file mode 100644 index 00000000000..f9bf5b9af9e --- /dev/null +++ b/lib/python/qmk/errors.py @@ -0,0 +1,6 @@ +class NoSuchKeyboardError(Exception): + """Raised when we can't find a keyboard/keymap directory. + """ + + def __init__(self, message): + self.message = message diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py new file mode 100644 index 00000000000..396b53a6f5c --- /dev/null +++ b/lib/python/qmk/keymap.py @@ -0,0 +1,100 @@ +"""Functions that help you work with QMK keymaps. +""" +import json +import logging +import os +from traceback import format_exc + +import qmk.path +from qmk.errors import NoSuchKeyboardError + +# The `keymap.c` template to use when a keyboard doesn't have its own +DEFAULT_KEYMAP_C = """#include QMK_KEYBOARD_H + +/* THIS FILE WAS GENERATED! + * + * This file was generated by qmk-compile-json. You may or may not want to + * edit it directly. + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +__KEYMAP_GOES_HERE__ +}; +""" + + +def template(keyboard): + """Returns the `keymap.c` template for a keyboard. + + If a template exists in `keyboards//templates/keymap.c` that + text will be used instead of `DEFAULT_KEYMAP_C`. + + Args: + keyboard + The keyboard to return a template for. + """ + template_name = 'keyboards/%s/templates/keymap.c' % keyboard + + if os.path.exists(template_name): + with open(template_name, 'r') as fd: + return fd.read() + + return DEFAULT_KEYMAP_C + + +def generate(keyboard, layout, layers): + """Returns a keymap.c for the specified keyboard, layout, and layers. + + Args: + keyboard + The name of the keyboard + + layout + The LAYOUT macro this keymap uses. + + layers + An array of arrays describing the keymap. Each item in the inner array should be a string that is a valid QMK keycode. + """ + layer_txt = [] + for layer_num, layer in enumerate(layers): + if layer_num != 0: + layer_txt[-1] = layer_txt[-1] + ',' + layer_keys = ', '.join(layer) + layer_txt.append('\t[%s] = %s(%s)' % (layer_num, layout, layer_keys)) + + keymap = '\n'.join(layer_txt) + keymap_c = template(keyboard) + + return keymap_c.replace('__KEYMAP_GOES_HERE__', keymap) + + +def write(keyboard, keymap, layout, layers): + """Generate the `keymap.c` and write it to disk. + + Returns the filename written to. + + Args: + keyboard + The name of the keyboard + + keymap + The name of the keymap + + layout + The LAYOUT macro this keymap uses. + + layers + An array of arrays describing the keymap. Each item in the inner array should be a string that is a valid QMK keycode. + """ + keymap_c = generate(keyboard, layout, layers) + keymap_path = qmk.path.keymap(keyboard) + keymap_dir = os.path.join(keymap_path, keymap) + keymap_file = os.path.join(keymap_dir, 'keymap.c') + + if not os.path.exists(keymap_dir): + os.makedirs(keymap_dir) + + with open(keymap_file, 'w') as keymap_fd: + keymap_fd.write(keymap_c) + + return keymap_file diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py new file mode 100644 index 00000000000..f2a8346a51b --- /dev/null +++ b/lib/python/qmk/path.py @@ -0,0 +1,32 @@ +"""Functions that help us work with files and folders. +""" +import os + + +def keymap(keyboard): + """Locate the correct directory for storing a keymap. + + Args: + keyboard + The name of the keyboard. Example: clueboard/66/rev3 + """ + for directory in ['.', '..', '../..', '../../..', '../../../..', '../../../../..']: + basepath = os.path.normpath(os.path.join('keyboards', keyboard, directory, 'keymaps')) + + if os.path.exists(basepath): + return basepath + + logging.error('Could not find keymaps directory!') + raise NoSuchKeyboardError('Could not find keymaps directory for: %s' % keyboard) + + +def normpath(path): + """Returns the fully resolved absolute path to a file. + + This function will return the absolute path to a file as seen from the + directory the script was called from. + """ + if path and path[0] == '/': + return os.path.normpath(path) + + return os.path.normpath(os.path.join(os.environ['ORIG_CWD'], path)) diff --git a/message.mk b/message.mk index 6894dd8cb50..ec9bacbf49e 100644 --- a/message.mk +++ b/message.mk @@ -79,4 +79,9 @@ MSG_TEST = Testing $(BOLD)$(TEST_NAME)$(NO_COLOR) MSG_CHECK_FILESIZE = Checking file size of $(TARGET).hex MSG_FILE_TOO_BIG = $(ERROR_COLOR)The firmware is too large!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) bytes over)\n MSG_FILE_TOO_SMALL = The firmware is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n -MSG_FILE_JUST_RIGHT = The firmware size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(FREE_SIZE) bytes free)\n +MSG_FILE_JUST_RIGHT = The firmware size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(PERCENT_SIZE)%%, $(FREE_SIZE) bytes free)\n +MSG_FILE_NEAR_LIMIT = The firmware size is approaching the maximum - $(CURRENT_SIZE)/$(MAX_SIZE) ($(PERCENT_SIZE)%%, $(FREE_SIZE) bytes free)\n +MSG_PYTHON_MISSING = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \ + Python 3 is not installed. It will be required by a future version\n\ + of qmk_firmware.\n\n\ + Please run $(BOLD)util/qmk_install.sh$(NO_COLOR) to install all the dependencies QMK requires.\n\n diff --git a/quantum/api.c b/quantum/api.c index 52dfe23e176..233f99636de 100644 --- a/quantum/api.c +++ b/quantum/api.c @@ -67,7 +67,7 @@ void process_api(uint16_t length, uint8_t * data) { case DT_RGBLIGHT: { #ifdef RGBLIGHT_ENABLE uint32_t rgblight = bytes_to_dword(data, 2); - rgblight_update_dword(rgblight); + eeconfig_update_rgblight(rgblight); #endif break; } diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index 16f05319d95..f01dad2ae25 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -165,7 +165,7 @@ uint16_t notes_count; bool notes_repeat; bool note_resting = false; -uint8_t current_note = 0; +uint16_t current_note = 0; uint8_t rest_counter = 0; #ifdef VIBRATO_ENABLE diff --git a/quantum/audio/audio_arm.c b/quantum/audio/audio_arm.c index d38184f323b..de0cd15c582 100644 --- a/quantum/audio/audio_arm.c +++ b/quantum/audio/audio_arm.c @@ -54,7 +54,7 @@ uint16_t notes_count; bool notes_repeat; bool note_resting = false; -uint8_t current_note = 0; +uint16_t current_note = 0; uint8_t rest_counter = 0; #ifdef VIBRATO_ENABLE @@ -79,7 +79,10 @@ float startup_song[][2] = STARTUP_SONG; static void gpt_cb8(GPTDriver *gptp); -#define DAC_BUFFER_SIZE 720 +#define DAC_BUFFER_SIZE 100 +#ifndef DAC_SAMPLE_MAX +#define DAC_SAMPLE_MAX 65535U +#endif #define START_CHANNEL_1() gptStart(&GPTD6, &gpt6cfg1); \ gptStartContinuous(&GPTD6, 2U) @@ -95,8 +98,8 @@ static void gpt_cb8(GPTDriver *gptp); RESTART_CHANNEL_1() #define UPDATE_CHANNEL_2_FREQ(freq) gpt7cfg1.frequency = freq * DAC_BUFFER_SIZE; \ RESTART_CHANNEL_2() -#define GET_CHANNEL_1_FREQ gpt6cfg1.frequency -#define GET_CHANNEL_2_FREQ gpt7cfg1.frequency +#define GET_CHANNEL_1_FREQ (uint16_t)(gpt6cfg1.frequency * DAC_BUFFER_SIZE) +#define GET_CHANNEL_2_FREQ (uint16_t)(gpt7cfg1.frequency * DAC_BUFFER_SIZE) /* @@ -202,132 +205,16 @@ GPTConfig gpt8cfg1 = { // squarewave static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + // First half is max, second half is 0 + [0 ... DAC_BUFFER_SIZE/2-1] = DAC_SAMPLE_MAX, + [DAC_BUFFER_SIZE/2 ... DAC_BUFFER_SIZE -1] = 0, }; // squarewave static const dacsample_t dac_buffer_2[DAC_BUFFER_SIZE] = { - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047 + // opposite of dac_buffer above + [0 ... DAC_BUFFER_SIZE/2-1] = 0, + [DAC_BUFFER_SIZE/2 ... DAC_BUFFER_SIZE -1] = DAC_SAMPLE_MAX, }; /* @@ -363,7 +250,7 @@ static void error_cb1(DACDriver *dacp, dacerror_t err) { } static const DACConfig dac1cfg1 = { - .init = 2047U, + .init = DAC_SAMPLE_MAX, .datamode = DAC_DHRM_12BIT_RIGHT }; @@ -375,7 +262,7 @@ static const DACConversionGroup dacgrpcfg1 = { }; static const DACConfig dac1cfg2 = { - .init = 2047U, + .init = DAC_SAMPLE_MAX, .datamode = DAC_DHRM_12BIT_RIGHT }; @@ -386,19 +273,24 @@ static const DACConversionGroup dacgrpcfg2 = { .trigger = DAC_TRG(0) }; -void audio_init() -{ +void audio_init() { - if (audio_initialized) - return; + if (audio_initialized) { + return; + } - // Check EEPROM - // if (!eeconfig_is_enabled()) - // { - // eeconfig_init(); - // } - // audio_config.raw = eeconfig_read_audio(); + // Check EEPROM + #if defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE) + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + audio_config.raw = eeconfig_read_audio(); +#else // ARM EEPROM audio_config.enable = true; + #ifdef AUDIO_CLICKY_ON + audio_config.clicky_enable = true; + #endif +#endif // ARM EEPROM /* * Starting DAC1 driver, setting up the output pin as analog as suggested @@ -421,16 +313,17 @@ void audio_init() dacStartConversion(&DACD1, &dacgrpcfg1, (dacsample_t *)dac_buffer, DAC_BUFFER_SIZE); dacStartConversion(&DACD2, &dacgrpcfg2, (dacsample_t *)dac_buffer_2, DAC_BUFFER_SIZE); - audio_initialized = true; + audio_initialized = true; - if (audio_config.enable) { - PLAY_SONG(startup_song); - } + if (audio_config.enable) { + PLAY_SONG(startup_song); + } else { + stop_all_notes(); + } } -void stop_all_notes() -{ +void stop_all_notes() { dprintf("audio stop all notes"); if (!audio_initialized) { @@ -455,347 +348,347 @@ void stop_all_notes() } } -void stop_note(float freq) -{ - dprintf("audio stop note freq=%d", (int)freq); +void stop_note(float freq) { + dprintf("audio stop note freq=%d", (int)freq); - if (playing_note) { - if (!audio_initialized) { - audio_init(); - } - for (int i = 7; i >= 0; i--) { - if (frequencies[i] == freq) { - frequencies[i] = 0; - volumes[i] = 0; - for (int j = i; (j < 7); j++) { - frequencies[j] = frequencies[j+1]; - frequencies[j+1] = 0; - volumes[j] = volumes[j+1]; - volumes[j+1] = 0; - } - break; - } - } - voices--; - if (voices < 0) - voices = 0; - if (voice_place >= voices) { - voice_place = 0; - } - if (voices == 0) { - STOP_CHANNEL_1(); - STOP_CHANNEL_2(); - gptStopTimer(&GPTD8); - frequency = 0; - frequency_alt = 0; - volume = 0; - playing_note = false; + if (playing_note) { + if (!audio_initialized) { + audio_init(); + } + for (int i = 7; i >= 0; i--) { + if (frequencies[i] == freq) { + frequencies[i] = 0; + volumes[i] = 0; + for (int j = i; (j < 7); j++) { + frequencies[j] = frequencies[j+1]; + frequencies[j+1] = 0; + volumes[j] = volumes[j+1]; + volumes[j+1] = 0; } + break; + } + } + voices--; + if (voices < 0) { + voices = 0; + } + if (voice_place >= voices) { + voice_place = 0; + } + if (voices == 0) { + STOP_CHANNEL_1(); + STOP_CHANNEL_2(); + gptStopTimer(&GPTD8); + frequency = 0; + frequency_alt = 0; + volume = 0; + playing_note = false; } + } } #ifdef VIBRATO_ENABLE -float mod(float a, int b) -{ - float r = fmod(a, b); - return r < 0 ? r + b : r; +float mod(float a, int b) { + float r = fmod(a, b); + return r < 0 ? r + b : r; } float vibrato(float average_freq) { - #ifdef VIBRATO_STRENGTH_ENABLE - float vibrated_freq = average_freq * pow(vibrato_lut[(int)vibrato_counter], vibrato_strength); - #else - float vibrated_freq = average_freq * vibrato_lut[(int)vibrato_counter]; - #endif - vibrato_counter = mod((vibrato_counter + vibrato_rate * (1.0 + 440.0/average_freq)), VIBRATO_LUT_LENGTH); - return vibrated_freq; + #ifdef VIBRATO_STRENGTH_ENABLE + float vibrated_freq = average_freq * pow(vibrato_lut[(int)vibrato_counter], vibrato_strength); + #else + float vibrated_freq = average_freq * vibrato_lut[(int)vibrato_counter]; + #endif + vibrato_counter = mod((vibrato_counter + vibrato_rate * (1.0 + 440.0/average_freq)), VIBRATO_LUT_LENGTH); + return vibrated_freq; } #endif static void gpt_cb8(GPTDriver *gptp) { - float freq; - - if (playing_note) { - if (voices > 0) { - - float freq_alt = 0; - if (voices > 1) { - if (polyphony_rate == 0) { - if (glissando) { - if (frequency_alt != 0 && frequency_alt < frequencies[voices - 2] && frequency_alt < frequencies[voices - 2] * pow(2, -440/frequencies[voices - 2]/12/2)) { - frequency_alt = frequency_alt * pow(2, 440/frequency_alt/12/2); - } else if (frequency_alt != 0 && frequency_alt > frequencies[voices - 2] && frequency_alt > frequencies[voices - 2] * pow(2, 440/frequencies[voices - 2]/12/2)) { - frequency_alt = frequency_alt * pow(2, -440/frequency_alt/12/2); - } else { - frequency_alt = frequencies[voices - 2]; - } - } else { - frequency_alt = frequencies[voices - 2]; - } - - #ifdef VIBRATO_ENABLE - if (vibrato_strength > 0) { - freq_alt = vibrato(frequency_alt); - } else { - freq_alt = frequency_alt; - } - #else - freq_alt = frequency_alt; - #endif - } - - if (envelope_index < 65535) { - envelope_index++; - } - - freq_alt = voice_envelope(freq_alt); - - if (freq_alt < 30.517578125) { - freq_alt = 30.52; - } - - if (GET_CHANNEL_2_FREQ != (uint16_t)freq_alt) { - UPDATE_CHANNEL_2_FREQ(freq_alt); - } else { - RESTART_CHANNEL_2(); - } - //note_timbre; - } - - if (polyphony_rate > 0) { - if (voices > 1) { - voice_place %= voices; - if (place++ > (frequencies[voice_place] / polyphony_rate)) { - voice_place = (voice_place + 1) % voices; - place = 0.0; - } - } - - #ifdef VIBRATO_ENABLE - if (vibrato_strength > 0) { - freq = vibrato(frequencies[voice_place]); - } else { - freq = frequencies[voice_place]; - } - #else - freq = frequencies[voice_place]; - #endif + float freq; + + if (playing_note) { + if (voices > 0) { + + float freq_alt = 0; + if (voices > 1) { + if (polyphony_rate == 0) { + if (glissando) { + if (frequency_alt != 0 && frequency_alt < frequencies[voices - 2] && frequency_alt < frequencies[voices - 2] * pow(2, -440/frequencies[voices - 2]/12/2)) { + frequency_alt = frequency_alt * pow(2, 440/frequency_alt/12/2); + } else if (frequency_alt != 0 && frequency_alt > frequencies[voices - 2] && frequency_alt > frequencies[voices - 2] * pow(2, 440/frequencies[voices - 2]/12/2)) { + frequency_alt = frequency_alt * pow(2, -440/frequency_alt/12/2); } else { - if (glissando) { - if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { - frequency = frequency * pow(2, 440/frequency/12/2); - } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { - frequency = frequency * pow(2, -440/frequency/12/2); - } else { - frequency = frequencies[voices - 1]; - } - } else { - frequency = frequencies[voices - 1]; - } - - #ifdef VIBRATO_ENABLE - if (vibrato_strength > 0) { - freq = vibrato(frequency); - } else { - freq = frequency; - } - #else - freq = frequency; - #endif + frequency_alt = frequencies[voices - 2]; } + } else { + frequency_alt = frequencies[voices - 2]; + } - if (envelope_index < 65535) { - envelope_index++; - } - - freq = voice_envelope(freq); - - if (freq < 30.517578125) { - freq = 30.52; - } - - - if (GET_CHANNEL_1_FREQ != (uint16_t)freq) { - UPDATE_CHANNEL_1_FREQ(freq); + #ifdef VIBRATO_ENABLE + if (vibrato_strength > 0) { + freq_alt = vibrato(frequency_alt); } else { - RESTART_CHANNEL_1(); + freq_alt = frequency_alt; } - //note_timbre; + #else + freq_alt = frequency_alt; + #endif } - } - if (playing_notes) { - if (note_frequency > 0) { - #ifdef VIBRATO_ENABLE - if (vibrato_strength > 0) { - freq = vibrato(note_frequency); - } else { - freq = note_frequency; - } - #else - freq = note_frequency; - #endif - - if (envelope_index < 65535) { - envelope_index++; - } - freq = voice_envelope(freq); + if (envelope_index < 65535) { + envelope_index++; + } + freq_alt = voice_envelope(freq_alt); - if (GET_CHANNEL_1_FREQ != (uint16_t)freq) { - UPDATE_CHANNEL_1_FREQ(freq); - UPDATE_CHANNEL_2_FREQ(freq); - } - //note_timbre; + if (freq_alt < 30.517578125) { + freq_alt = 30.52; + } + + if (GET_CHANNEL_2_FREQ != (uint16_t)freq_alt) { + UPDATE_CHANNEL_2_FREQ(freq_alt); } else { - // gptStopTimer(&GPTD6); - // gptStopTimer(&GPTD7); + RESTART_CHANNEL_2(); + } + //note_timbre; + } + + if (polyphony_rate > 0) { + if (voices > 1) { + voice_place %= voices; + if (place++ > (frequencies[voice_place] / polyphony_rate)) { + voice_place = (voice_place + 1) % voices; + place = 0.0; + } } - note_position++; - bool end_of_note = false; - if (GET_CHANNEL_1_FREQ > 0) { - if (!note_resting) - end_of_note = (note_position >= (note_length*8 - 1)); - else - end_of_note = (note_position >= (note_length*8)); + #ifdef VIBRATO_ENABLE + if (vibrato_strength > 0) { + freq = vibrato(frequencies[voice_place]); + } else { + freq = frequencies[voice_place]; + } + #else + freq = frequencies[voice_place]; + #endif + } else { + if (glissando) { + if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { + frequency = frequency * pow(2, 440/frequency/12/2); + } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { + frequency = frequency * pow(2, -440/frequency/12/2); + } else { + frequency = frequencies[voices - 1]; + } } else { - end_of_note = (note_position >= (note_length*8)); + frequency = frequencies[voices - 1]; } - if (end_of_note) { - current_note++; - if (current_note >= notes_count) { - if (notes_repeat) { - current_note = 0; - } else { - STOP_CHANNEL_1(); - STOP_CHANNEL_2(); - // gptStopTimer(&GPTD8); - playing_notes = false; - return; - } - } - if (!note_resting) { - note_resting = true; - current_note--; - if ((*notes_pointer)[current_note][0] == (*notes_pointer)[current_note + 1][0]) { - note_frequency = 0; - note_length = 1; - } else { - note_frequency = (*notes_pointer)[current_note][0]; - note_length = 1; - } - } else { - note_resting = false; - envelope_index = 0; - note_frequency = (*notes_pointer)[current_note][0]; - note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); - } + #ifdef VIBRATO_ENABLE + if (vibrato_strength > 0) { + freq = vibrato(frequency); + } else { + freq = frequency; + } + #else + freq = frequency; + #endif + } - note_position = 0; - } - } + if (envelope_index < 65535) { + envelope_index++; + } - if (!audio_config.enable) { - playing_notes = false; - playing_note = false; - } -} + freq = voice_envelope(freq); -void play_note(float freq, int vol) { + if (freq < 30.517578125) { + freq = 30.52; + } - dprintf("audio play note freq=%d vol=%d", (int)freq, vol); - if (!audio_initialized) { - audio_init(); + if (GET_CHANNEL_1_FREQ != (uint16_t)freq) { + UPDATE_CHANNEL_1_FREQ(freq); + } else { + RESTART_CHANNEL_1(); + } + //note_timbre; } + } - if (audio_config.enable && voices < 8) { + if (playing_notes) { + if (note_frequency > 0) { + #ifdef VIBRATO_ENABLE + if (vibrato_strength > 0) { + freq = vibrato(note_frequency); + } else { + freq = note_frequency; + } + #else + freq = note_frequency; + #endif + if (envelope_index < 65535) { + envelope_index++; + } + freq = voice_envelope(freq); - // Cancel notes if notes are playing - if (playing_notes) - stop_all_notes(); - playing_note = true; + if (GET_CHANNEL_1_FREQ != (uint16_t)freq) { + UPDATE_CHANNEL_1_FREQ(freq); + UPDATE_CHANNEL_2_FREQ(freq); + } + //note_timbre; + } else { + // gptStopTimer(&GPTD6); + // gptStopTimer(&GPTD7); + } - envelope_index = 0; + note_position++; + bool end_of_note = false; + if (GET_CHANNEL_1_FREQ > 0) { + if (!note_resting) + end_of_note = (note_position >= (note_length*8 - 1)); + else + end_of_note = (note_position >= (note_length*8)); + } else { + end_of_note = (note_position >= (note_length*8)); + } - if (freq > 0) { - frequencies[voices] = freq; - volumes[voices] = vol; - voices++; + if (end_of_note) { + current_note++; + if (current_note >= notes_count) { + if (notes_repeat) { + current_note = 0; + } else { + STOP_CHANNEL_1(); + STOP_CHANNEL_2(); + // gptStopTimer(&GPTD8); + playing_notes = false; + return; + } + } + if (!note_resting) { + note_resting = true; + current_note--; + if ((*notes_pointer)[current_note][0] == (*notes_pointer)[current_note + 1][0]) { + note_frequency = 0; + note_length = 1; + } else { + note_frequency = (*notes_pointer)[current_note][0]; + note_length = 1; } + } else { + note_resting = false; + envelope_index = 0; + note_frequency = (*notes_pointer)[current_note][0]; + note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); + } - gptStart(&GPTD8, &gpt8cfg1); - gptStartContinuous(&GPTD8, 2U); - RESTART_CHANNEL_1(); - RESTART_CHANNEL_2(); + note_position = 0; } + } + if (!audio_config.enable) { + playing_notes = false; + playing_note = false; + } } -void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat) -{ +void play_note(float freq, int vol) { - if (!audio_initialized) { - audio_init(); + dprintf("audio play note freq=%d vol=%d", (int)freq, vol); + + if (!audio_initialized) { + audio_init(); + } + + if (audio_config.enable && voices < 8) { + + // Cancel notes if notes are playing + if (playing_notes) { + stop_all_notes(); } - if (audio_config.enable) { + playing_note = true; - // Cancel note if a note is playing - if (playing_note) - stop_all_notes(); + envelope_index = 0; - playing_notes = true; + if (freq > 0) { + frequencies[voices] = freq; + volumes[voices] = vol; + voices++; + } - notes_pointer = np; - notes_count = n_count; - notes_repeat = n_repeat; + gptStart(&GPTD8, &gpt8cfg1); + gptStartContinuous(&GPTD8, 2U); + RESTART_CHANNEL_1(); + RESTART_CHANNEL_2(); + } - place = 0; - current_note = 0; +} - note_frequency = (*notes_pointer)[current_note][0]; - note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); - note_position = 0; +void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat) { - gptStart(&GPTD8, &gpt8cfg1); - gptStartContinuous(&GPTD8, 2U); - RESTART_CHANNEL_1(); - RESTART_CHANNEL_2(); + if (!audio_initialized) { + audio_init(); + } + + if (audio_config.enable) { + + // Cancel note if a note is playing + if (playing_note) { + stop_all_notes(); } + playing_notes = true; + + notes_pointer = np; + notes_count = n_count; + notes_repeat = n_repeat; + + place = 0; + current_note = 0; + + note_frequency = (*notes_pointer)[current_note][0]; + note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); + note_position = 0; + + gptStart(&GPTD8, &gpt8cfg1); + gptStartContinuous(&GPTD8, 2U); + RESTART_CHANNEL_1(); + RESTART_CHANNEL_2(); + } } bool is_playing_notes(void) { - return playing_notes; + return playing_notes; } bool is_audio_on(void) { - return (audio_config.enable != 0); + return (audio_config.enable != 0); } void audio_toggle(void) { - audio_config.enable ^= 1; - eeconfig_update_audio(audio_config.raw); - if (audio_config.enable) - audio_on_user(); + audio_config.enable ^= 1; + eeconfig_update_audio(audio_config.raw); + if (audio_config.enable) { + audio_on_user(); + } } void audio_on(void) { - audio_config.enable = 1; - eeconfig_update_audio(audio_config.raw); - audio_on_user(); + audio_config.enable = 1; + eeconfig_update_audio(audio_config.raw); + audio_on_user(); } void audio_off(void) { - audio_config.enable = 0; - eeconfig_update_audio(audio_config.raw); + stop_all_notes(); + audio_config.enable = 0; + eeconfig_update_audio(audio_config.raw); } #ifdef VIBRATO_ENABLE @@ -803,29 +696,29 @@ void audio_off(void) { // Vibrato rate functions void set_vibrato_rate(float rate) { - vibrato_rate = rate; + vibrato_rate = rate; } void increase_vibrato_rate(float change) { - vibrato_rate *= change; + vibrato_rate *= change; } void decrease_vibrato_rate(float change) { - vibrato_rate /= change; + vibrato_rate /= change; } #ifdef VIBRATO_STRENGTH_ENABLE void set_vibrato_strength(float strength) { - vibrato_strength = strength; + vibrato_strength = strength; } void increase_vibrato_strength(float change) { - vibrato_strength *= change; + vibrato_strength *= change; } void decrease_vibrato_strength(float change) { - vibrato_strength /= change; + vibrato_strength /= change; } #endif /* VIBRATO_STRENGTH_ENABLE */ @@ -835,45 +728,45 @@ void decrease_vibrato_strength(float change) { // Polyphony functions void set_polyphony_rate(float rate) { - polyphony_rate = rate; + polyphony_rate = rate; } void enable_polyphony() { - polyphony_rate = 5; + polyphony_rate = 5; } void disable_polyphony() { - polyphony_rate = 0; + polyphony_rate = 0; } void increase_polyphony_rate(float change) { - polyphony_rate *= change; + polyphony_rate *= change; } void decrease_polyphony_rate(float change) { - polyphony_rate /= change; + polyphony_rate /= change; } // Timbre function void set_timbre(float timbre) { - note_timbre = timbre; + note_timbre = timbre; } // Tempo functions void set_tempo(uint8_t tempo) { - note_tempo = tempo; + note_tempo = tempo; } void decrease_tempo(uint8_t tempo_change) { - note_tempo += tempo_change; + note_tempo += tempo_change; } void increase_tempo(uint8_t tempo_change) { - if (note_tempo - tempo_change < 10) { - note_tempo = 10; - } else { - note_tempo -= tempo_change; - } + if (note_tempo - tempo_change < 10) { + note_tempo = 10; + } else { + note_tempo -= tempo_change; + } } diff --git a/quantum/audio/audio_pwm.c b/quantum/audio/audio_pwm.c index ded86edeea9..ed67136099a 100644 --- a/quantum/audio/audio_pwm.c +++ b/quantum/audio/audio_pwm.c @@ -94,7 +94,7 @@ bool notes_repeat; float notes_rest; bool note_resting = false; -uint8_t current_note = 0; +uint16_t current_note = 0; uint8_t rest_counter = 0; #ifdef VIBRATO_ENABLE diff --git a/quantum/audio/musical_notes.h b/quantum/audio/musical_notes.h index 065608cccea..cd54af38d22 100644 --- a/quantum/audio/musical_notes.h +++ b/quantum/audio/musical_notes.h @@ -26,12 +26,14 @@ // Note Types #define MUSICAL_NOTE(note, duration) {(NOTE##note), duration} +#define BREVE_NOTE(note) MUSICAL_NOTE(note, 128) #define WHOLE_NOTE(note) MUSICAL_NOTE(note, 64) #define HALF_NOTE(note) MUSICAL_NOTE(note, 32) #define QUARTER_NOTE(note) MUSICAL_NOTE(note, 16) #define EIGHTH_NOTE(note) MUSICAL_NOTE(note, 8) #define SIXTEENTH_NOTE(note) MUSICAL_NOTE(note, 4) +#define BREVE_DOT_NOTE(note) MUSICAL_NOTE(note, 128+64) #define WHOLE_DOT_NOTE(note) MUSICAL_NOTE(note, 64+32) #define HALF_DOT_NOTE(note) MUSICAL_NOTE(note, 32+16) #define QUARTER_DOT_NOTE(note) MUSICAL_NOTE(note, 16+8) @@ -40,11 +42,13 @@ // Note Type Shortcuts #define M__NOTE(note, duration) MUSICAL_NOTE(note, duration) +#define B__NOTE(n) BREVE_NOTE(n) #define W__NOTE(n) WHOLE_NOTE(n) #define H__NOTE(n) HALF_NOTE(n) #define Q__NOTE(n) QUARTER_NOTE(n) #define E__NOTE(n) EIGHTH_NOTE(n) #define S__NOTE(n) SIXTEENTH_NOTE(n) +#define BD_NOTE(n) BREVE_DOT_NOTE(n) #define WD_NOTE(n) WHOLE_DOT_NOTE(n) #define HD_NOTE(n) HALF_DOT_NOTE(n) #define QD_NOTE(n) QUARTER_DOT_NOTE(n) @@ -61,7 +65,11 @@ // Notes - # = Octave +#ifdef __arm__ +#define NOTE_REST 1.00f +#else #define NOTE_REST 0.00f +#endif /* These notes are currently bugged #define NOTE_C0 16.35f diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index e63616a9940..33dbcfcb1dc 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -1,4 +1,7 @@ -/* Copyright 2016 Jack Humbert +/* Any song or sound without a license explicitly stated is: + * + * Copyright 2016 Jack Humbert + * Copyright 2017 Zach White * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,57 +16,32 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "musical_notes.h" +#pragma once -#ifndef SONG_LIST_H -#define SONG_LIST_H +#include "musical_notes.h" #define NO_SOUND -#define LP_NUMB \ - H__NOTE(_CS5), H__NOTE(_E5), H__NOTE(_CS5), WD_NOTE(_FS5), \ - WD_NOTE(_A5), WD_NOTE(_GS5), WD_NOTE(_REST), H__NOTE(_CS5), H__NOTE(_E5), \ - H__NOTE(_CS5), WD_NOTE(_A5), WD_NOTE(_GS5), WD_NOTE(_E5), - - +/* Ode to Joy + * Author: Friedrich Schiller + + License: Public Domain + */ #define ODE_TO_JOY \ Q__NOTE(_E4), Q__NOTE(_E4), Q__NOTE(_F4), Q__NOTE(_G4), \ Q__NOTE(_G4), Q__NOTE(_F4), Q__NOTE(_E4), Q__NOTE(_D4), \ Q__NOTE(_C4), Q__NOTE(_C4), Q__NOTE(_D4), Q__NOTE(_E4), \ QD_NOTE(_E4), E__NOTE(_D4), H__NOTE(_D4), +/* Rock-a-bye Baby + * Author: Unknown + + License: Public Domain + */ #define ROCK_A_BYE_BABY \ QD_NOTE(_B4), E__NOTE(_D4), Q__NOTE(_B5), \ H__NOTE(_A5), Q__NOTE(_G5), \ QD_NOTE(_B4), E__NOTE(_D5), Q__NOTE(_G5), \ H__NOTE(_FS5), -#define CLOSE_ENCOUNTERS_5_NOTE \ - Q__NOTE(_D5), \ - Q__NOTE(_E5), \ - Q__NOTE(_C5), \ - Q__NOTE(_C4), \ - Q__NOTE(_G4), - -#define DOE_A_DEER \ - QD_NOTE(_C4), E__NOTE(_D4), \ - QD_NOTE(_E4), E__NOTE(_C4), \ - Q__NOTE(_E4), Q__NOTE(_C4), \ - Q__NOTE(_E4), - -/* Requires: PLAY_NOTE_ARRAY(..., ..., STACCATO); */ -#define IN_LIKE_FLINT \ - E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4), \ - E__NOTE(_AS4), E__NOTE(_B4), QD_NOTE(_CS4), \ - E__NOTE(_B4), E__NOTE(_CS4), QD_NOTE(_DS4), \ - E__NOTE(_CS4), E__NOTE(_B4), QD_NOTE(_AS4), \ - E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4), - -#define IMPERIAL_MARCH \ - HD_NOTE(_A4), HD_NOTE(_A4), HD_NOTE(_A4), QD_NOTE(_F4), QD_NOTE(_C5), \ - HD_NOTE(_A4), QD_NOTE(_F4), QD_NOTE(_C5), WD_NOTE(_A4), \ - HD_NOTE(_E5), HD_NOTE(_E5), HD_NOTE(_E5), QD_NOTE(_F5), QD_NOTE(_C5), \ - HD_NOTE(_A4), QD_NOTE(_F4), QD_NOTE(_C5), WD_NOTE(_A4) #define CLUEBOARD_SOUND \ HD_NOTE(_C3), HD_NOTE(_D3), HD_NOTE(_E3), HD_NOTE(_F3), HD_NOTE(_G3), HD_NOTE(_A4), HD_NOTE(_B4), HD_NOTE(_C4) @@ -78,11 +56,6 @@ Q__NOTE(_F3) */ -#define BASKET_CASE \ - QD_NOTE(_G3), E__NOTE(_F3), E__NOTE(_E3), Q__NOTE(_F3), M__NOTE(_G3, 8+32), Q__NOTE(_REST), \ - Q__NOTE(_B4), Q__NOTE(_C4), Q__NOTE(_B4), E__NOTE(_A4), Q__NOTE(_G3), M__NOTE(_G3, 8+32), Q__NOTE(_REST), \ - Q__NOTE(_B4), Q__NOTE(_C4), Q__NOTE(_B4), E__NOTE(_A4), Q__NOTE(_G3), Q__NOTE(_G3), Q__NOTE(_G3), Q__NOTE(_G3), E__NOTE(_A4), E__NOTE(_C4), QD_NOTE(_B4), HD_NOTE(_B4) - #define STARTUP_SOUND \ E__NOTE(_E6), \ E__NOTE(_A6), \ @@ -130,6 +103,17 @@ S__NOTE(_REST), \ E__NOTE(_E7 ), +#define WORKMAN_SOUND \ + E__NOTE(_GS6 ), \ + E__NOTE(_A6 ), \ + S__NOTE(_REST), \ + E__NOTE(_GS6 ), \ + E__NOTE(_A6 ), \ + S__NOTE(_REST), \ + ED_NOTE(_FS7 ), \ + S__NOTE(_REST), \ + ED_NOTE(_A7 ), + #define PLOVER_SOUND \ E__NOTE(_GS6 ), \ E__NOTE(_A6 ), \ @@ -257,219 +241,118 @@ E__NOTE(_E6), \ S__NOTE(_B5), -#define COIN_SOUND \ - E__NOTE(_A5 ), \ - HD_NOTE(_E6 ), - -#define ONE_UP_SOUND \ - Q__NOTE(_E6 ), \ - Q__NOTE(_G6 ), \ - Q__NOTE(_E7 ), \ - Q__NOTE(_C7 ), \ - Q__NOTE(_D7 ), \ - Q__NOTE(_G7 ), - -#define SONIC_RING \ - E__NOTE(_E6), \ - E__NOTE(_G6), \ - HD_NOTE(_C7), - -#define ZELDA_PUZZLE \ - Q__NOTE(_G5), \ - Q__NOTE(_FS5), \ - Q__NOTE(_DS5), \ - Q__NOTE(_A4), \ - Q__NOTE(_GS4), \ - Q__NOTE(_E5), \ - Q__NOTE(_GS5), \ - HD_NOTE(_C6), - -#define ZELDA_TREASURE \ - Q__NOTE(_A4 ), \ - Q__NOTE(_AS4), \ - Q__NOTE(_B4 ), \ - HD_NOTE(_C5 ), \ #define TERMINAL_SOUND \ E__NOTE(_C5 ) -#define OVERWATCH_THEME \ - HD_NOTE(_A4 ), \ - Q__NOTE(_E4 ), \ - Q__NOTE(_A4 ), \ - HD_NOTE(_B4 ), \ - Q__NOTE(_E4 ), \ - Q__NOTE(_B4 ), \ - W__NOTE(_CS5), - -#define MARIO_THEME \ - Q__NOTE(_E5), \ - H__NOTE(_E5), \ - H__NOTE(_E5), \ - Q__NOTE(_C5), \ - H__NOTE(_E5), \ - W__NOTE(_G5), \ - Q__NOTE(_G4), - -#define MARIO_GAMEOVER \ - HD_NOTE(_C5 ), \ - HD_NOTE(_G4 ), \ - H__NOTE(_E4 ), \ - H__NOTE(_A4 ), \ - H__NOTE(_B4 ), \ - H__NOTE(_A4 ), \ - H__NOTE(_AF4), \ - H__NOTE(_BF4), \ - H__NOTE(_AF4), \ - WD_NOTE(_G4 ), - -#define MARIO_MUSHROOM \ - S__NOTE(_C5 ), \ - S__NOTE(_G4 ), \ - S__NOTE(_C5 ), \ - S__NOTE(_E5 ), \ - S__NOTE(_G5 ), \ - S__NOTE(_C6 ), \ - S__NOTE(_G5 ), \ - S__NOTE(_GS4), \ - S__NOTE(_C5 ), \ - S__NOTE(_DS5), \ - S__NOTE(_GS5), \ - S__NOTE(_DS5), \ - S__NOTE(_GS5), \ - S__NOTE(_C6 ), \ - S__NOTE(_DS6), \ - S__NOTE(_GS6), \ - S__NOTE(_DS6), \ - S__NOTE(_AS4), \ - S__NOTE(_D5 ), \ - S__NOTE(_F5 ), \ - S__NOTE(_AS5), \ - S__NOTE(_D6 ), \ - S__NOTE(_F6 ), \ - S__NOTE(_AS6), \ - S__NOTE(_F6 ) - -#define E1M1_DOOM \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E4 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_D4 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_C4 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_BF3), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_B3 ), \ - Q__NOTE(_C4 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E4 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_D4 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_C4 ), \ - Q__NOTE(_E3 ), \ - Q__NOTE(_E3 ), \ - H__NOTE(_BF3), - -#define DISNEY_SONG \ - H__NOTE(_G3 ), \ - H__NOTE(_G4 ), \ - H__NOTE(_F4 ), \ - H__NOTE(_E4 ), \ - H__NOTE(_CS4), \ - H__NOTE(_D4 ), \ - W__NOTE(_A4 ), \ - H__NOTE(_B3 ), \ - H__NOTE(_B4 ), \ - H__NOTE(_A4 ), \ - H__NOTE(_G4 ), \ - H__NOTE(_FS4), \ - H__NOTE(_G4 ), \ - W__NOTE(_C5 ), \ - H__NOTE(_D5 ), \ - H__NOTE(_C5 ), \ - H__NOTE(_B4 ), \ - H__NOTE(_A4 ), \ - H__NOTE(_G4 ), \ - H__NOTE(_F4 ), \ - H__NOTE(_E4 ), \ - H__NOTE(_D4 ), \ - W__NOTE(_A4 ), \ - W__NOTE(_B3 ), \ - W__NOTE(_C4 ), - -#define NUMBER_ONE \ - HD_NOTE(_F4 ), \ - Q__NOTE(_C5 ), \ - E__NOTE(_B4 ), \ - E__NOTE(_C5 ), \ - E__NOTE(_B4 ), \ - E__NOTE(_C5 ), \ - Q__NOTE(_B4 ), \ - Q__NOTE(_C5 ), \ - H__NOTE(_AF4), \ - HD_NOTE(_F4 ), \ - Q__NOTE(_F4 ), \ - Q__NOTE(_AF4), \ - Q__NOTE(_C5 ), \ - H__NOTE(_DF5), \ - H__NOTE(_AF4), \ - H__NOTE(_DF5), \ - H__NOTE(_EF5), \ - Q__NOTE(_C5 ), \ - Q__NOTE(_DF5), \ - Q__NOTE(_C5 ), \ - Q__NOTE(_DF5), \ - H__NOTE(_C5 ), - -#define CABBAGE_SONG \ - H__NOTE(_C4), \ - H__NOTE(_A4), \ - H__NOTE(_B4), \ - H__NOTE(_B4), \ - H__NOTE(_A4), \ - H__NOTE(_G4), \ - H__NOTE(_E4), - -#define OLD_SPICE \ - Q__NOTE(_A4 ), \ - Q__NOTE(_A4 ), \ - H__NOTE(_B4 ), \ - H__NOTE(_D5 ), \ - H__NOTE(_CS5), \ - Q__NOTE(_E5 ), \ - H__NOTE(_FS5), \ - H__NOTE(_D5 ), \ - -#define VICTORY_FANFARE_SHORT \ - ED_NOTE(_C6), \ - ED_NOTE(_C6), \ - ED_NOTE(_C6), \ - ED_NOTE(_C6), \ - W__NOTE(_REST), \ - QD_NOTE(_GS5), \ - QD_NOTE(_AS5), \ - Q__NOTE(_C6), \ - Q__NOTE(_AS5), \ - Q__NOTE(_C6), \ - -#define ALL_STAR \ - H__NOTE(_AS4), W__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_DS4), H__NOTE(_FS4), W__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_DS4), \ - H__NOTE(_FS4), W__NOTE(_FS4), W__NOTE(_FS4), QD_NOTE(_AS4), \ - H__NOTE(_AS4), W__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_DS4), H__NOTE(_FS4), W__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_DS4), \ - H__NOTE(_FS4), W__NOTE(_FS4), W__NOTE(_FS4), W__NOTE(_AS4), H__NOTE(_REST),\ - W__NOTE(_AS4), W__NOTE(_CS5), H__NOTE(_B4), H__NOTE(_CS5), H__NOTE(_DS5), W__NOTE(_FS5), \ - H__NOTE(_GS5), W__NOTE(_GS5), H__NOTE(_FS4), H__NOTE(_FS4), H__NOTE(_GS4), H__NOTE(_FS4), \ - H__NOTE(_AS4), W__NOTE(_GS4), W__NOTE(_GS4), W__NOTE(_FS4), W__NOTE(_GS4), \ - H__NOTE(_AS4), WD_NOTE(_DS4) - -#endif + +/* Title: La Campanella + * Author/Composer: Frank Lizst + + License: Public Domain + */ +#define CAMPANELLA \ + Q__NOTE(_DS4), E__NOTE(_DS4), E__NOTE(_DS5), Q__NOTE(_DS5), E__NOTE(_DS5), E__NOTE(_DS6), Q__NOTE(_DS5), E__NOTE(_DS5), \ + E__NOTE(_DS6), Q__NOTE(_CS5), E__NOTE(_CS5), E__NOTE(_DS6), Q__NOTE(_B4), E__NOTE(_B4), E__NOTE(_DS6), \ + Q__NOTE(_B4), E__NOTE(_B4), E__NOTE(_DS6), Q__NOTE(_AS4), E__NOTE(_AS4), E__NOTE(_DS6), Q__NOTE(_GS4), \ + E__NOTE(_GS4), E__NOTE(_DS6), Q__NOTE(_G4), E__NOTE(_G4), E__NOTE(_DS6), Q__NOTE(_GS4), E__NOTE(_GS4), \ + E__NOTE(_DS6), Q__NOTE(_AS4), E__NOTE(_AS4), E__NOTE(_DS6), Q__NOTE(_DS4), E__NOTE(_DS4), E__NOTE(_DS6), \ + Q__NOTE(_DS5), E__NOTE(_DS5), E__NOTE(_DS6), Q__NOTE(_E5), E__NOTE(_E5), E__NOTE(_DS6), Q__NOTE(_DS5), \ + E__NOTE(_DS5), E__NOTE(_DS6), Q__NOTE(_CS5), E__NOTE(_CS5), E__NOTE(_DS6), Q__NOTE(_B4), E__NOTE(_B4), \ + E__NOTE(_DS6), Q__NOTE(_B4), E__NOTE(_B4), E__NOTE(_DS6), Q__NOTE(_AS4), E__NOTE(_AS4), E__NOTE(_DS6), \ + Q__NOTE(_GS4), E__NOTE(_GS4), E__NOTE(_DS6), Q__NOTE(_G4), E__NOTE(_G4), E__NOTE(_DS6), Q__NOTE(_GS4), \ + E__NOTE(_GS4), E__NOTE(_DS6), Q__NOTE(_AS4), E__NOTE(_AS4), E__NOTE(_DS6), Q__NOTE(_DS4), E__NOTE(_DS4), \ + E__NOTE(_DS5), Q__NOTE(_DS5), E__NOTE(_DS5), E__NOTE(_DS6), Q__NOTE(_DS6), E__NOTE(_DS6), E__NOTE(_DS7), \ + Q__NOTE(_DS6), E__NOTE(_DS6), E__NOTE(_DS7), Q__NOTE(_CS6), E__NOTE(_CS6), E__NOTE(_DS7), Q__NOTE(_B5), \ + E__NOTE(_B5), E__NOTE(_DS7), Q__NOTE(_B5), E__NOTE(_B5), E__NOTE(_DS7), Q__NOTE(_AS5), E__NOTE(_AS5), \ + E__NOTE(_DS7), Q__NOTE(_GS5), E__NOTE(_GS5), E__NOTE(_DS7), Q__NOTE(_G5), E__NOTE(_G5), E__NOTE(_DS7), \ + Q__NOTE(_GS5), E__NOTE(_GS5), E__NOTE(_DS7), Q__NOTE(_AS5), E__NOTE(_AS5), E__NOTE(_DS7), Q__NOTE(_DS5), \ + E__NOTE(_DS5), E__NOTE(_DS7), W__NOTE(_DS6), W__NOTE(_GS5), + + + + +/* Title: Fantaisie-Impromptu + * Author/Composer: Chopin + * License: Public Domain +*/ +#define FANTASIE_IMPROMPTU \ + E__NOTE(_GS4), E__NOTE(_A4), E__NOTE(_GS4), E__NOTE(_REST), E__NOTE(_GS4), E__NOTE(_CS5), E__NOTE(_E5), E__NOTE(_DS5), E__NOTE(_CS5), \ + E__NOTE(_DS5), E__NOTE(_CS5), E__NOTE(_C5), E__NOTE(_CS5), E__NOTE(_E5), E__NOTE(_GS5), E__NOTE(_GS4), E__NOTE(_A4), \ + E__NOTE(_GS4), E__NOTE(_REST), E__NOTE(_GS4), E__NOTE(_CS5), E__NOTE(_E5), E__NOTE(_DS5), E__NOTE(_CS5), E__NOTE(_DS5), \ + E__NOTE(_CS5), E__NOTE(_C5), E__NOTE(_CS5), E__NOTE(_E5), E__NOTE(_GS5), E__NOTE(_A4), E__NOTE(_CS5), E__NOTE(_DS5), \ + E__NOTE(_FS5), E__NOTE(_A5), E__NOTE(_CS6), E__NOTE(_DS6), E__NOTE(_B6), E__NOTE(_A6), E__NOTE(_GS6), E__NOTE(_FS6), \ + E__NOTE(_E6), E__NOTE(_DS6), E__NOTE(_FS6), E__NOTE(_CS6), E__NOTE(_C5), E__NOTE(_DS6), E__NOTE(_A5), E__NOTE(_GS5), \ + E__NOTE(_FS5), E__NOTE(_A5), E__NOTE(_E5), E__NOTE(_DS5), E__NOTE(_FS5), E__NOTE(_CS5), E__NOTE(_C5), E__NOTE(_DS5), \ + E__NOTE(_A4), E__NOTE(_GS4), E__NOTE(_B4), E__NOTE(_A4), E__NOTE(_A4), E__NOTE(_GS4), E__NOTE(_A4), E__NOTE(_GS4), \ + E__NOTE(_REST), E__NOTE(_GS4), E__NOTE(_CS5), E__NOTE(_E5), E__NOTE(_DS5), E__NOTE(_CS5), E__NOTE(_DS5), E__NOTE(_CS5), \ + E__NOTE(_C5), E__NOTE(_CS5), E__NOTE(_E5), E__NOTE(_GS5), E__NOTE(_GS4), E__NOTE(_AS4), E__NOTE(_GS4), E__NOTE(_REST), \ + E__NOTE(_GS4), E__NOTE(_CS5), E__NOTE(_E5), E__NOTE(_DS5), E__NOTE(_CS5), E__NOTE(_DS5), E__NOTE(_CS5), E__NOTE(_C5), \ + E__NOTE(_CS5), E__NOTE(_E5), E__NOTE(_GS5), E__NOTE(_DS5), E__NOTE(_E5), E__NOTE(_DS5), E__NOTE(_REST), E__NOTE(_DS5), \ + E__NOTE(_B5), E__NOTE(_AS5), E__NOTE(_GS5), E__NOTE(_REST), E__NOTE(_E6), E__NOTE(_DS6), E__NOTE(_CS6), E__NOTE(_B5), \ + E__NOTE(_AS5), E__NOTE(_GS5), E__NOTE(_REST), E__NOTE(_AS5), WD_NOTE(_GS5), + + +/* Title: Nocturne Op. 9 No. 1 in B flat minor + * Author/Composer: Chopin + License: Public Domain +*/ +#define NOCTURNE_OP_9_NO_1 \ + H__NOTE(_BF5), H__NOTE(_C6), H__NOTE(_DF6), H__NOTE(_A5), H__NOTE(_BF5), H__NOTE(_GF5), W__NOTE(_F5), W__NOTE(_F5), W__NOTE(_F5), \ + W__NOTE(_F5), H__NOTE(_GF5), H__NOTE(_F5), H__NOTE(_EF5), H__NOTE(_C5), B__NOTE(_DF5), W__NOTE(_BF4), Q__NOTE(_BF5), \ + Q__NOTE(_C6), Q__NOTE(_DF6), Q__NOTE(_A5), Q__NOTE(_BF5), Q__NOTE(_A5), Q__NOTE(_GS5), Q__NOTE(_A5), Q__NOTE(_C6), \ + Q__NOTE(_BF5), Q__NOTE(_GF5), Q__NOTE(_F5), Q__NOTE(_GF5), Q__NOTE(_E5), Q__NOTE(_F5), Q__NOTE(_BF5), Q__NOTE(_A5), \ + Q__NOTE(_AF5), Q__NOTE(_G5), Q__NOTE(_GF5), Q__NOTE(_F5), Q__NOTE(_E5), Q__NOTE(_EF5), Q__NOTE(_D5), Q__NOTE(_DF5), \ + Q__NOTE(_C5), Q__NOTE(_DF5), Q__NOTE(_C5), Q__NOTE(_B4), Q__NOTE(_C5), Q__NOTE(_F5), Q__NOTE(_E5), Q__NOTE(_EF5), \ + B__NOTE(_DF5), W__NOTE(_BF4), W__NOTE(_BF5), W__NOTE(_BF5), W__NOTE(_BF5), BD_NOTE(_AF5), W__NOTE(_DF5), H__NOTE(_BF4), \ + H__NOTE(_C5), H__NOTE(_DF5), H__NOTE(_GF5), H__NOTE(_GF5), BD_NOTE(_F5), W__NOTE(_EF5), H__NOTE(_F5), H__NOTE(_EF5), \ + H__NOTE(_DF5), H__NOTE(_A4), B__NOTE(_AF4), W__NOTE(_DF5), W__NOTE(_EF5), H__NOTE(_F5), H__NOTE(_EF5), H__NOTE(_DF5), \ + H__NOTE(_EF5), BD_NOTE(_F5), + + +/* Removed sounds + + This list is here solely for compatibility, so that removed songs don't just break things + * If you think that any of these songs were wrongfully removed, let us know and provide + * proof of permission to use them, or public domain status. + */ + +#define CLOSE_ENCOUNTERS_5_NOTE +#define DOE_A_DEER +#define IN_LIKE_FLINT +#define IMPERIAL_MARCH +#define BASKET_CASE +#define COIN_SOUND +#define ONE_UP_SOUND +#define SONIC_RING +#define ZELDA_PUZZLE +#define ZELDA_TREASURE +#define OVERWATCH_THEME +#define MARIO_THEME +#define MARIO_GAMEOVER +#define MARIO_MUSHROOM +#define E1M1_DOOM +#define DISNEY_SONG +#define NUMBER_ONE +#define CABBAGE_SONG +#define OLD_SPICE +#define VICTORY_FANFARE_SHORT +#define ALL_STAR +#define RICK_ROLL +#define FF_PRELUDE +#define TO_BOLDLY_GO +#define KATAWARE_DOKI +#define MEGALOVANIA +#define MICHISHIRUBE +#define LIEBESLEID +#define MELODIES_OF_LIFE +#define EYES_ON_ME +#define SONG_OF_THE_ANCIENTS +#define NIER_AMUSEMENT_PARK +#define COPIED_CITY +#define VAGUE_HOPE_COLD_RAIN +#define KAINE_SALVATION +#define WEIGHT_OF_THE_WORLD +#define ISABELLAS_LULLABY +#define TERRAS_THEME +#define RENAI_CIRCULATION +#define PLATINUM_DISCO +#define LP_NUMB diff --git a/quantum/color.c b/quantum/color.c index 8ede053e711..a309da379a4 100644 --- a/quantum/color.c +++ b/quantum/color.c @@ -22,14 +22,18 @@ RGB hsv_to_rgb( HSV hsv ) { RGB rgb; - uint8_t region, p, q, t; - uint16_t h, s, v, remainder; + uint8_t region, remainder, p, q, t; + uint16_t h, s, v; if ( hsv.s == 0 ) { +#ifdef USE_CIE1931_CURVE + rgb.r = rgb.g = rgb.b = pgm_read_byte( &CIE1931_CURVE[hsv.v] ); +#else rgb.r = hsv.v; rgb.g = hsv.v; rgb.b = hsv.v; +#endif return rgb; } @@ -37,8 +41,8 @@ RGB hsv_to_rgb( HSV hsv ) s = hsv.s; v = hsv.v; - region = h / 43; - remainder = (h - (region * 43)) * 6; + region = h * 6 / 255; + remainder = (h * 2 - region * 85) * 3; p = (v * (255 - s)) >> 8; q = (v * (255 - ((s * remainder) >> 8))) >> 8; @@ -46,6 +50,7 @@ RGB hsv_to_rgb( HSV hsv ) switch ( region ) { + case 6: case 0: rgb.r = v; rgb.g = t; @@ -78,9 +83,11 @@ RGB hsv_to_rgb( HSV hsv ) break; } +#ifdef USE_CIE1931_CURVE rgb.r = pgm_read_byte( &CIE1931_CURVE[rgb.r] ); rgb.g = pgm_read_byte( &CIE1931_CURVE[rgb.g] ); rgb.b = pgm_read_byte( &CIE1931_CURVE[rgb.b] ); +#endif return rgb; } diff --git a/quantum/color.h b/quantum/color.h index 9d51d45adb2..22bb083519c 100644 --- a/quantum/color.h +++ b/quantum/color.h @@ -32,12 +32,30 @@ #pragma pack( push, 1 ) #endif +#ifdef RGBW + #define LED_TYPE cRGBW +#else + #define LED_TYPE RGB +#endif + +// WS2812 specific layout typedef struct PACKED { + uint8_t g; uint8_t r; + uint8_t b; +} cRGB; + +typedef cRGB RGB; + +// WS2812 specific layout +typedef struct PACKED +{ uint8_t g; + uint8_t r; uint8_t b; -} RGB; + uint8_t w; +} cRGBW; typedef struct PACKED { @@ -50,6 +68,6 @@ typedef struct PACKED #pragma pack( pop ) #endif -RGB hsv_to_rgb( HSV hsv ); +RGB hsv_to_rgb(HSV hsv); #endif // COLOR_H diff --git a/quantum/config_common.h b/quantum/config_common.h index cbff372eaf3..bc4d9ec1af1 100644 --- a/quantum/config_common.h +++ b/quantum/config_common.h @@ -21,6 +21,9 @@ #define ROW2COL 1 #define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */ +// useful for direct pin mapping +#define NO_PIN (~0) + #ifdef __AVR__ #ifndef __ASSEMBLER__ #include @@ -56,6 +59,11 @@ #define PINC_ADDRESS 0x3 #define PINB_ADDRESS 0x6 #define PINA_ADDRESS 0x9 + #elif defined(__AVR_ATmega328P__) + #define ADDRESS_BASE 0x00 + #define PINB_ADDRESS 0x3 + #define PINC_ADDRESS 0x6 + #define PIND_ADDRESS 0x9 #else #error "Pins are not defined" #endif @@ -125,6 +133,45 @@ #endif #elif defined(PROTOCOL_CHIBIOS) + // Defines mapping for Proton C replacement + #ifdef CONVERT_TO_PROTON_C + // Left side (front) + #define D3 PAL_LINE(GPIOA, 9) + #define D2 PAL_LINE(GPIOA, 10) + // GND + // GND + #define D1 PAL_LINE(GPIOB, 7) + #define D0 PAL_LINE(GPIOB, 6) + #define D4 PAL_LINE(GPIOB, 5) + #define C6 PAL_LINE(GPIOB, 4) + #define D7 PAL_LINE(GPIOB, 3) + #define E6 PAL_LINE(GPIOB, 2) + #define B4 PAL_LINE(GPIOB, 1) + #define B5 PAL_LINE(GPIOB, 0) + + // Right side (front) + // RAW + // GND + // RESET + // VCC + #define F4 PAL_LINE(GPIOA, 2) + #define F5 PAL_LINE(GPIOA, 1) + #define F6 PAL_LINE(GPIOA, 0) + #define F7 PAL_LINE(GPIOB, 8) + #define B1 PAL_LINE(GPIOB, 13) + #define B3 PAL_LINE(GPIOB, 14) + #define B2 PAL_LINE(GPIOB, 15) + #define B6 PAL_LINE(GPIOB, 9) + + // LEDs (only D5/C13 uses an actual LED) + #ifdef CONVERT_TO_PROTON_C_RXLED + #define D5 PAL_LINE(GPIOC, 13) + #define B0 PAL_LINE(GPIOC, 13) + #else + #define D5 PAL_LINE(GPIOC, 13) + #define B0 PAL_LINE(GPIOC, 14) + #endif + #else #define A0 PAL_LINE(GPIOA, 0) #define A1 PAL_LINE(GPIOA, 1) #define A2 PAL_LINE(GPIOA, 2) @@ -157,6 +204,8 @@ #define B13 PAL_LINE(GPIOB, 13) #define B14 PAL_LINE(GPIOB, 14) #define B15 PAL_LINE(GPIOB, 15) + #define B16 PAL_LINE(GPIOB, 16) + #define B17 PAL_LINE(GPIOB, 17) #define C0 PAL_LINE(GPIOC, 0) #define C1 PAL_LINE(GPIOC, 1) #define C2 PAL_LINE(GPIOC, 2) @@ -221,6 +270,7 @@ #define F13 PAL_LINE(GPIOF, 13) #define F14 PAL_LINE(GPIOF, 14) #define F15 PAL_LINE(GPIOF, 15) + #endif #endif /* USART configuration */ diff --git a/quantum/debounce.h b/quantum/debounce.h new file mode 100644 index 00000000000..9ca05c6824a --- /dev/null +++ b/quantum/debounce.h @@ -0,0 +1,11 @@ +#pragma once + +// raw is the current key state +// on entry cooked is the previous debounced state +// on exit cooked is the current debounced state +// changed is true if raw has changed since the last call +void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed); + +bool debounce_active(void); + +void debounce_init(uint8_t num_rows); diff --git a/quantum/debounce/eager_pk.c b/quantum/debounce/eager_pk.c new file mode 100644 index 00000000000..c07be18f8d1 --- /dev/null +++ b/quantum/debounce/eager_pk.c @@ -0,0 +1,114 @@ +/* +Copyright 2017 Alex Ong +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* +Basic per-key algorithm. Uses an 8-bit counter per key. +After pressing a key, it immediately changes state, and sets a counter. +No further inputs are accepted until DEBOUNCE milliseconds have occurred. +*/ + +#include "matrix.h" +#include "timer.h" +#include "quantum.h" +#include + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#if (MATRIX_COLS <= 8) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#define debounce_counter_t uint8_t + +static debounce_counter_t *debounce_counters; +static bool counters_need_update; +static bool matrix_need_update; + +#define DEBOUNCE_ELAPSED 251 +#define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) + +void update_debounce_counters(uint8_t num_rows, uint8_t current_time); +void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time); + +// we use num_rows rather than MATRIX_ROWS to support split keyboards +void debounce_init(uint8_t num_rows) { + debounce_counters = (debounce_counter_t *)malloc(num_rows * MATRIX_COLS * sizeof(debounce_counter_t)); + int i = 0; + for (uint8_t r = 0; r < num_rows; r++) { + for (uint8_t c = 0; c < MATRIX_COLS; c++) { + debounce_counters[i++] = DEBOUNCE_ELAPSED; + } + } +} + +void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { + uint8_t current_time = timer_read() % MAX_DEBOUNCE; + if (counters_need_update) { + update_debounce_counters(num_rows, current_time); + } + + if (changed || matrix_need_update) { + transfer_matrix_values(raw, cooked, num_rows, current_time); + } +} + +// If the current time is > debounce counter, set the counter to enable input. +void update_debounce_counters(uint8_t num_rows, uint8_t current_time) { + counters_need_update = false; + debounce_counter_t *debounce_pointer = debounce_counters; + for (uint8_t row = 0; row < num_rows; row++) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + if (*debounce_pointer != DEBOUNCE_ELAPSED) { + if (TIMER_DIFF(current_time, *debounce_pointer, MAX_DEBOUNCE) >= DEBOUNCE) { + *debounce_pointer = DEBOUNCE_ELAPSED; + } else { + counters_need_update = true; + } + } + debounce_pointer++; + } + } +} + +// upload from raw_matrix to final matrix; +void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time) { + matrix_need_update = false; + debounce_counter_t *debounce_pointer = debounce_counters; + for (uint8_t row = 0; row < num_rows; row++) { + matrix_row_t delta = raw[row] ^ cooked[row]; + matrix_row_t existing_row = cooked[row]; + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + matrix_row_t col_mask = (ROW_SHIFTER << col); + if (delta & col_mask) { + if (*debounce_pointer == DEBOUNCE_ELAPSED) { + *debounce_pointer = current_time; + counters_need_update = true; + existing_row ^= col_mask; // flip the bit. + } else { + matrix_need_update = true; + } + } + debounce_pointer++; + } + cooked[row] = existing_row; + } +} + +bool debounce_active(void) { return true; } diff --git a/quantum/debounce/eager_pr.c b/quantum/debounce/eager_pr.c new file mode 100644 index 00000000000..8dbfa3fcfa9 --- /dev/null +++ b/quantum/debounce/eager_pr.c @@ -0,0 +1,100 @@ +/* +Copyright 2019 Alex Ong +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* +Basic per-row algorithm. Uses an 8-bit counter per row. +After pressing a key, it immediately changes state, and sets a counter. +No further inputs are accepted until DEBOUNCE milliseconds have occurred. +*/ + +#include "matrix.h" +#include "timer.h" +#include "quantum.h" +#include + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define debounce_counter_t uint8_t +static bool matrix_need_update; + +static debounce_counter_t *debounce_counters; +static bool counters_need_update; + +#define DEBOUNCE_ELAPSED 251 +#define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) + +void update_debounce_counters(uint8_t num_rows, uint8_t current_time); +void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time); + +// we use num_rows rather than MATRIX_ROWS to support split keyboards +void debounce_init(uint8_t num_rows) { + debounce_counters = (debounce_counter_t *)malloc(num_rows * sizeof(debounce_counter_t)); + for (uint8_t r = 0; r < num_rows; r++) { + debounce_counters[r] = DEBOUNCE_ELAPSED; + } +} + +void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { + uint8_t current_time = timer_read() % MAX_DEBOUNCE; + bool needed_update = counters_need_update; + if (counters_need_update) { + update_debounce_counters(num_rows, current_time); + } + + if (changed || (needed_update && !counters_need_update) || matrix_need_update) { + transfer_matrix_values(raw, cooked, num_rows, current_time); + } +} + +// If the current time is > debounce counter, set the counter to enable input. +void update_debounce_counters(uint8_t num_rows, uint8_t current_time) { + counters_need_update = false; + debounce_counter_t *debounce_pointer = debounce_counters; + for (uint8_t row = 0; row < num_rows; row++) { + if (*debounce_pointer != DEBOUNCE_ELAPSED) { + if (TIMER_DIFF(current_time, *debounce_pointer, MAX_DEBOUNCE) >= DEBOUNCE) { + *debounce_pointer = DEBOUNCE_ELAPSED; + } else { + counters_need_update = true; + } + } + debounce_pointer++; + } +} + +// upload from raw_matrix to final matrix; +void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time) { + matrix_need_update = false; + debounce_counter_t *debounce_pointer = debounce_counters; + for (uint8_t row = 0; row < num_rows; row++) { + matrix_row_t existing_row = cooked[row]; + matrix_row_t raw_row = raw[row]; + + // determine new value basd on debounce pointer + raw value + if (existing_row != raw_row) { + if (*debounce_pointer == DEBOUNCE_ELAPSED) { + *debounce_pointer = current_time; + cooked[row] = raw_row; + counters_need_update = true; + } else { + matrix_need_update = true; + } + } + debounce_pointer++; + } +} + +bool debounce_active(void) { return true; } diff --git a/quantum/debounce/readme.md b/quantum/debounce/readme.md new file mode 100644 index 00000000000..f77f78c764f --- /dev/null +++ b/quantum/debounce/readme.md @@ -0,0 +1,28 @@ +Debounce algorithms belong in this folder. +Here are a few ideas + +1) Global vs Per-Key vs Per-Row + * Global - one timer for all keys. Any key change state affects global timer + * Per key - one timer per key + * Per row - one timer per row + +2) Eager vs symmetric vs asymmetric + * Eager - any key change is reported immediately. All further inputs for DEBOUNCE ms are ignored. + * Symmetric - wait for no changes for DEBOUNCE ms before reporting change + * Asymmetric - wait for different times depending on key-down/key-up. E.g. Eager key-down, DEBOUNCE ms key up. + +3) Timestamp vs cycles + * old old old code waits n cycles, decreasing count by one each matrix_scan + * newer code stores the millisecond the change occurred, and does subraction to figure out time elapsed. + * Timestamps are superior, i don't think cycles will ever be used again once upgraded. + +The default algorithm is symmetric and global. +Here are a few that could be implemented: + +sym_g.c +sym_pk.c +sym_pr.c +sym_pr_cycles.c +eager_g.c +eager_pk.c +eager_pr.c //could be used in ergo-dox! diff --git a/quantum/debounce/sym_g.c b/quantum/debounce/sym_g.c new file mode 100644 index 00000000000..c8ab34e1a0c --- /dev/null +++ b/quantum/debounce/sym_g.c @@ -0,0 +1,57 @@ +/* +Copyright 2017 Alex Ong +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* +Basic global debounce algorithm. Used in 99% of keyboards at time of implementation +When no state changes have occured for DEBOUNCE milliseconds, we push the state. +*/ +#include "matrix.h" +#include "timer.h" +#include "quantum.h" +#ifndef DEBOUNCE + #define DEBOUNCE 5 +#endif + +void debounce_init(uint8_t num_rows) {} +static bool debouncing = false; + +#if DEBOUNCE > 0 +static uint16_t debouncing_time; +void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) +{ + if (changed) { + debouncing = true; + debouncing_time = timer_read(); + } + + if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { + for (int i = 0; i < num_rows; i++) { + cooked[i] = raw[i]; + } + debouncing = false; + } +} +#else //no debouncing. +void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) +{ + for (int i = 0; i < num_rows; i++) { + cooked[i] = raw[i]; + } +} +#endif + +bool debounce_active(void) { + return debouncing; +} + diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c index ee39a20251b..38400e36f10 100644 --- a/quantum/dynamic_keymap.c +++ b/quantum/dynamic_keymap.c @@ -18,7 +18,7 @@ #include "keymap.h" // to get keymaps[][][] #include "tmk_core/common/eeprom.h" #include "progmem.h" // to read default from flash - +#include "quantum.h" // for send_string() #include "dynamic_keymap.h" #ifdef DYNAMIC_KEYMAP_ENABLE @@ -31,6 +31,23 @@ #error DYNAMIC_KEYMAP_LAYER_COUNT not defined #endif +#ifndef DYNAMIC_KEYMAP_MACRO_COUNT +#error DYNAMIC_KEYMAP_MACRO_COUNT not defined +#endif + +#ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#error DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR not defined +#endif + +#ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE +#error DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE not defined +#endif + +uint8_t dynamic_keymap_get_layer_count(void) +{ + return DYNAMIC_KEYMAP_LAYER_COUNT; +} + void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column) { // TODO: optimize this with some left shifts @@ -69,6 +86,36 @@ void dynamic_keymap_reset(void) } } +void dynamic_keymap_get_buffer( uint16_t offset, uint16_t size, uint8_t *data ) +{ + uint16_t dynamic_keymap_eeprom_size = DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2; + void *source = (void*)(DYNAMIC_KEYMAP_EEPROM_ADDR+offset); + uint8_t *target = data; + for ( uint16_t i = 0; i < size; i++ ) { + if ( offset + i < dynamic_keymap_eeprom_size ) { + *target = eeprom_read_byte(source); + } else { + *target = 0x00; + } + source++; + target++; + } +} + +void dynamic_keymap_set_buffer( uint16_t offset, uint16_t size, uint8_t *data ) +{ + uint16_t dynamic_keymap_eeprom_size = DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2; + void *target = (void*)(DYNAMIC_KEYMAP_EEPROM_ADDR+offset); + uint8_t *source = data; + for ( uint16_t i = 0; i < size; i++ ) { + if ( offset + i < dynamic_keymap_eeprom_size ) { + eeprom_update_byte(target, *source); + } + source++; + target++; + } +} + // This overrides the one in quantum/keymap_common.c uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { @@ -81,5 +128,111 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) } } + + +uint8_t dynamic_keymap_macro_get_count(void) +{ + return DYNAMIC_KEYMAP_MACRO_COUNT; +} + +uint16_t dynamic_keymap_macro_get_buffer_size(void) +{ + return DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE; +} + +void dynamic_keymap_macro_get_buffer( uint16_t offset, uint16_t size, uint8_t *data ) +{ + void *source = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+offset); + uint8_t *target = data; + for ( uint16_t i = 0; i < size; i++ ) { + if ( offset + i < DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE ) { + *target = eeprom_read_byte(source); + } else { + *target = 0x00; + } + source++; + target++; + } +} + +void dynamic_keymap_macro_set_buffer( uint16_t offset, uint16_t size, uint8_t *data ) +{ + void *target = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+offset); + uint8_t *source = data; + for ( uint16_t i = 0; i < size; i++ ) { + if ( offset + i < DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE ) { + eeprom_update_byte(target, *source); + } + source++; + target++; + } +} + +void dynamic_keymap_macro_reset(void) +{ + void *p = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR); + void *end = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE); + while ( p != end ) { + eeprom_update_byte(p, 0); + ++p; + } +} + +void dynamic_keymap_macro_send( uint8_t id ) +{ + if ( id >= DYNAMIC_KEYMAP_MACRO_COUNT ) { + return; + } + + // Check the last byte of the buffer. + // If it's not zero, then we are in the middle + // of buffer writing, possibly an aborted buffer + // write. So do nothing. + void *p = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE-1); + if ( eeprom_read_byte(p) != 0 ) { + return; + } + + // Skip N null characters + // p will then point to the Nth macro + p = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR); + void *end = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE); + while ( id > 0 ) { + // If we are past the end of the buffer, then the buffer + // contents are garbage, i.e. there were not DYNAMIC_KEYMAP_MACRO_COUNT + // nulls in the buffer. + if ( p == end ) { + return; + } + if ( eeprom_read_byte(p) == 0 ) { + --id; + } + ++p; + } + + // Send the macro string one or two chars at a time + // by making temporary 1 or 2 char strings + char data[3] = { 0, 0, 0 }; + // We already checked there was a null at the end of + // the buffer, so this cannot go past the end + while ( 1 ) { + data[0] = eeprom_read_byte(p++); + data[1] = 0; + // Stop at the null terminator of this macro string + if ( data[0] == 0 ) { + break; + } + // If the char is magic (tap, down, up), + // add the next char (key to use) and send a 2 char string. + if ( data[0] == SS_TAP_CODE || data[0] == SS_DOWN_CODE || data[0] == SS_UP_CODE ) { + data[1] = eeprom_read_byte(p++); + if ( data[1] == 0 ) { + break; + } + } + send_string(data); + } +} + #endif // DYNAMIC_KEYMAP_ENABLE diff --git a/quantum/dynamic_keymap.h b/quantum/dynamic_keymap.h index bd76adae209..63653f6cb71 100644 --- a/quantum/dynamic_keymap.h +++ b/quantum/dynamic_keymap.h @@ -18,11 +18,46 @@ #include #include +uint8_t dynamic_keymap_get_layer_count(void); void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column); uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column); void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode); void dynamic_keymap_reset(void); +// These get/set the keycodes as stored in the EEPROM buffer +// Data is big-endian 16-bit values (the keycodes) +// Order is by layer/row/column +// Thus offset 0 = 0,0,0, offset MATRIX_COLS*2 = 0,1,0, offset MATRIX_ROWS*MATRIX_COLS*2 = 1,0,0 +// Note the *2, because offset is in bytes and keycodes are two bytes +// This is only really useful for host applications that want to get a whole keymap fast, +// by reading 14 keycodes (28 bytes) at a time, reducing the number of raw HID transfers by +// a factor of 14. +void dynamic_keymap_get_buffer( uint16_t offset, uint16_t size, uint8_t *data ); +void dynamic_keymap_set_buffer( uint16_t offset, uint16_t size, uint8_t *data ); // This overrides the one in quantum/keymap_common.c // uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); + + +// Note regarding dynamic_keymap_macro_set_buffer(): +// The last byte of the buffer is used as a valid flag, +// so macro sending is disabled during writing a new buffer, +// should it happen during, or after an interrupted transfer. +// +// Users writing to the buffer must first set the last byte of the buffer +// to non-zero (i.e. 0xFF). After (or during) the final write, set the +// last byte of the buffer to zero. +// +// Since the contents of the buffer must be a list of null terminated +// strings, the last byte must be a null when at maximum capacity, +// and it not being null means the buffer can be considered in an +// invalid state. + +uint8_t dynamic_keymap_macro_get_count(void); +uint16_t dynamic_keymap_macro_get_buffer_size(void); +void dynamic_keymap_macro_get_buffer( uint16_t offset, uint16_t size, uint8_t *data ); +void dynamic_keymap_macro_set_buffer( uint16_t offset, uint16_t size, uint8_t *data ); +void dynamic_keymap_macro_reset(void); + +void dynamic_keymap_macro_send( uint8_t id ); + diff --git a/quantum/encoder.c b/quantum/encoder.c index 6629a098b86..31f00c346ba 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -17,25 +17,33 @@ #include "encoder.h" +// for memcpy +#include + + #ifndef ENCODER_RESOLUTION #define ENCODER_RESOLUTION 4 #endif -#ifndef NUMBER_OF_ENCODERS - #error "Number of encoders not defined by NUMBER_OF_ENCODERS" -#endif - #if !defined(ENCODERS_PAD_A) || !defined(ENCODERS_PAD_B) #error "No encoder pads defined by ENCODERS_PAD_A and ENCODERS_PAD_B" #endif -static pin_t encoders_pad_a[NUMBER_OF_ENCODERS] = ENCODERS_PAD_A; -static pin_t encoders_pad_b[NUMBER_OF_ENCODERS] = ENCODERS_PAD_B; + +#define NUMBER_OF_ENCODERS (sizeof(encoders_pad_a)/sizeof(pin_t)) +static pin_t encoders_pad_a[] = ENCODERS_PAD_A; +static pin_t encoders_pad_b[] = ENCODERS_PAD_B; static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; static uint8_t encoder_state[NUMBER_OF_ENCODERS] = {0}; + +#ifdef SPLIT_KEYBOARD +// slave half encoders come over as second set of encoders +static int8_t encoder_value[NUMBER_OF_ENCODERS * 2] = {0}; +#else static int8_t encoder_value[NUMBER_OF_ENCODERS] = {0}; +#endif __attribute__ ((weak)) void encoder_update_user(int8_t index, bool clockwise) { } @@ -60,11 +68,30 @@ void encoder_read(void) { encoder_state[i] |= (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); encoder_value[i] += encoder_LUT[encoder_state[i] & 0xF]; if (encoder_value[i] >= ENCODER_RESOLUTION) { - encoder_update_kb(i, COUNTRECLOCKWISE); + encoder_update_kb(i, false); } if (encoder_value[i] <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise - encoder_update_kb(i, CLOCKWISE); + encoder_update_kb(i, true); } encoder_value[i] %= ENCODER_RESOLUTION; } } + +#ifdef SPLIT_KEYBOARD +void encoder_state_raw(uint8_t* slave_state) { + memcpy(slave_state, encoder_state, sizeof(encoder_state)); +} + +void encoder_update_raw(uint8_t* slave_state) { + for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { + encoder_value[NUMBER_OF_ENCODERS + i] += encoder_LUT[slave_state[i] & 0xF]; + if (encoder_value[NUMBER_OF_ENCODERS + i] >= ENCODER_RESOLUTION) { + encoder_update_kb(NUMBER_OF_ENCODERS + i, false); + } + if (encoder_value[NUMBER_OF_ENCODERS + i] <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise + encoder_update_kb(NUMBER_OF_ENCODERS + i, true); + } + encoder_value[NUMBER_OF_ENCODERS + i] %= ENCODER_RESOLUTION; + } +} +#endif diff --git a/quantum/encoder.h b/quantum/encoder.h index 2024fa303f3..ec09a8cc475 100644 --- a/quantum/encoder.h +++ b/quantum/encoder.h @@ -19,11 +19,13 @@ #include "quantum.h" -#define COUNTRECLOCKWISE 0 -#define CLOCKWISE 1 - void encoder_init(void); void encoder_read(void); void encoder_update_kb(int8_t index, bool clockwise); void encoder_update_user(int8_t index, bool clockwise); + +#ifdef SPLIT_KEYBOARD +void encoder_state_raw(uint8_t* slave_state); +void encoder_update_raw(uint8_t* slave_state); +#endif diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 50af15d6269..eef739a14a0 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -29,10 +29,6 @@ along with this program. If not, see . #include "backlight.h" #include "quantum.h" -#ifdef SPLIT_KEYBOARD - #include "split_flags.h" -#endif - #ifdef MIDI_ENABLE #include "process_midi.h" #endif @@ -64,7 +60,7 @@ action_t action_for_key(uint8_t layer, keypos_t key) case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE: action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode)); break; - case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: + case KC_AUDIO_MUTE ... KC_BRIGHTNESS_DOWN: action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode)); break; case KC_MS_UP ... KC_MS_ACCEL2: @@ -120,14 +116,14 @@ action_t action_for_key(uint8_t layer, keypos_t key) break; case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: ; // OSM(mod) - One-shot mod - mod = keycode & 0xFF; + mod = mod_config(keycode & 0xFF); action.code = ACTION_MODS_ONESHOT(mod); break; case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF); break; case QK_LAYER_MOD ... QK_LAYER_MOD_MAX: - mod = keycode & 0xF; + mod = mod_config(keycode & 0xF); action_layer = (keycode >> 4) & 0xF; action.code = ACTION_LAYER_MODS(action_layer, mod); break; @@ -138,39 +134,21 @@ action_t action_for_key(uint8_t layer, keypos_t key) #ifdef BACKLIGHT_ENABLE case BL_ON: action.code = ACTION_BACKLIGHT_ON(); - #ifdef SPLIT_KEYBOARD - BACKLIT_DIRTY = true; - #endif break; case BL_OFF: action.code = ACTION_BACKLIGHT_OFF(); - #ifdef SPLIT_KEYBOARD - BACKLIT_DIRTY = true; - #endif break; case BL_DEC: action.code = ACTION_BACKLIGHT_DECREASE(); - #ifdef SPLIT_KEYBOARD - BACKLIT_DIRTY = true; - #endif break; case BL_INC: action.code = ACTION_BACKLIGHT_INCREASE(); - #ifdef SPLIT_KEYBOARD - BACKLIT_DIRTY = true; - #endif break; case BL_TOGG: action.code = ACTION_BACKLIGHT_TOGGLE(); - #ifdef SPLIT_KEYBOARD - BACKLIT_DIRTY = true; - #endif break; case BL_STEP: action.code = ACTION_BACKLIGHT_STEP(); - #ifdef SPLIT_KEYBOARD - BACKLIT_DIRTY = true; - #endif break; #endif #ifdef SWAP_HANDS_ENABLE diff --git a/quantum/keymap_extras/keymap_belgian.h b/quantum/keymap_extras/keymap_belgian.h index 764c5614171..ab89fbabfe6 100644 --- a/quantum/keymap_extras/keymap_belgian.h +++ b/quantum/keymap_extras/keymap_belgian.h @@ -18,15 +18,6 @@ #include "keymap.h" -#define BE_LGUI KC_LALT -#define BE_LALT KC_LGUI - -// Alt gr -#ifndef ALGR -#define ALGR(kc) RALT(kc) -#endif -#define NO_ALGR KC_RALT - // Normal characters // Line 1 #define BE_SUP2 KC_GRV diff --git a/quantum/keymap_extras/keymap_bepo.h b/quantum/keymap_extras/keymap_bepo.h index 05fd2b0023b..8d7b36ca3d1 100644 --- a/quantum/keymap_extras/keymap_bepo.h +++ b/quantum/keymap_extras/keymap_bepo.h @@ -19,15 +19,6 @@ #include "keymap.h" -// Alt gr -#ifndef ALTGR -#define ALTGR(kc) RALT(kc) -#endif -#ifndef ALGR -#define ALGR(kc) ALTGR(kc) -#endif -#define BP_ALGR KC_RALT - // Normal characters // First row (on usual keyboards) #define BP_DOLLAR KC_GRAVE // $ @@ -142,138 +133,138 @@ // AltGr-ed characters // First row -#define BP_EN_DASH ALTGR(BP_DOLLAR) // – +#define BP_EN_DASH ALGR(BP_DOLLAR) // – #define BP_NDSH BP_EN_DASH -#define BP_EM_DASH ALTGR(KC_1) // — +#define BP_EM_DASH ALGR(KC_1) // — #define BP_MDSH BP_EM_DASH -#define BP_LESS ALTGR(KC_2) // < -#define BP_GREATER ALTGR(KC_3) // > +#define BP_LESS ALGR(KC_2) // < +#define BP_GREATER ALGR(KC_3) // > #define BP_GRTR BP_GREATER -#define BP_LBRACKET ALTGR(KC_4) // [ +#define BP_LBRACKET ALGR(KC_4) // [ #define BP_LBRC BP_LBRACKET -#define BP_RBRACKET ALTGR(KC_5) // ] +#define BP_RBRACKET ALGR(KC_5) // ] #define BP_RBRC BP_RBRACKET -#define BP_CIRCUMFLEX ALTGR(KC_6) // ^ +#define BP_CIRCUMFLEX ALGR(KC_6) // ^ #define BP_CIRC BP_CIRCUMFLEX -#define BP_PLUS_MINUS ALTGR(KC_7) // ± +#define BP_PLUS_MINUS ALGR(KC_7) // ± #define BP_PSMS BP_PLUS_MINUS -#define BP_MATH_MINUS ALTGR(KC_8) // − +#define BP_MATH_MINUS ALGR(KC_8) // − #define BP_MMNS BP_MATH_MINUS -#define BP_OBELUS ALTGR(KC_9) // ÷ +#define BP_OBELUS ALGR(KC_9) // ÷ #define BP_OBEL BP_OBELUS // more conventional name of the symbol #define BP_DIVISION_SIGN BP_OBELUS #define BP_DVSN BP_DIVISION_SIGN -#define BP_TIMES ALTGR(KC_0) // × +#define BP_TIMES ALGR(KC_0) // × #define BP_TIMS BP_TIMES -#define BP_DIFFERENT ALTGR(BP_EQUAL) // ≠ +#define BP_DIFFERENT ALGR(BP_EQUAL) // ≠ #define BP_DIFF BP_DIFFERENT -#define BP_PERMILLE ALTGR(BP_PERCENT) // ‰ +#define BP_PERMILLE ALGR(BP_PERCENT) // ‰ #define BP_PMIL BP_PERMILLE // Second row -#define BP_PIPE ALTGR(BP_B) // | -#define BP_DEAD_ACUTE ALTGR(BP_E_ACUTE) // dead ´ +#define BP_PIPE ALGR(BP_B) // | +#define BP_DEAD_ACUTE ALGR(BP_E_ACUTE) // dead ´ #define BP_DACT BP_DEAD_ACUTE -#define BP_AMPERSAND ALTGR(BP_P) // & +#define BP_AMPERSAND ALGR(BP_P) // & #define BP_AMPR BP_AMPERSAND -#define BP_OE_LIGATURE ALTGR(BP_O) // œ +#define BP_OE_LIGATURE ALGR(BP_O) // œ #define BP_OE BP_OE_LIGATURE -#define BP_DEAD_GRAVE ALTGR(BP_E_GRAVE) // ` +#define BP_DEAD_GRAVE ALGR(BP_E_GRAVE) // ` #define BP_DGRV BP_DEAD_GRAVE -#define BP_INVERTED_EXCLAIM ALTGR(BP_DEAD_CIRCUMFLEX) // ¡ +#define BP_INVERTED_EXCLAIM ALGR(BP_DEAD_CIRCUMFLEX) // ¡ #define BP_IXLM BP_INVERTED_EXCLAIM -#define BP_DEAD_CARON ALTGR(BP_V) // dead ˇ +#define BP_DEAD_CARON ALGR(BP_V) // dead ˇ #define BP_DCAR BP_DEAD_CARON -#define BP_ETH ALTGR(BP_D) // ð -#define BP_DEAD_SLASH ALTGR(BP_L) // dead / +#define BP_ETH ALGR(BP_D) // ð +#define BP_DEAD_SLASH ALGR(BP_L) // dead / #define BP_DSLH BP_DEAD_SLASH -#define BP_IJ_LIGATURE ALTGR(BP_J) // ij +#define BP_IJ_LIGATURE ALGR(BP_J) // ij #define BP_IJ BP_IJ_LIGATURE -#define BP_SCHWA ALTGR(BP_Z) // ə +#define BP_SCHWA ALGR(BP_Z) // ə #define BP_SCWA BP_SCHWA -#define BP_DEAD_BREVE ALTGR(BP_W) // dead ˘ +#define BP_DEAD_BREVE ALGR(BP_W) // dead ˘ #define BP_DBRV BP_DEAD_BREVE // Third row -#define BP_AE_LIGATURE ALTGR(BP_A) // æ +#define BP_AE_LIGATURE ALGR(BP_A) // æ #define BP_AE BP_AE_LIGATURE -#define BP_U_GRAVE ALTGR(BP_U) // ù +#define BP_U_GRAVE ALGR(BP_U) // ù #define BP_UGRV BP_U_GRAVE -#define BP_DEAD_TREMA ALTGR(BP_I) // dead ¨ (trema/umlaut/diaresis) +#define BP_DEAD_TREMA ALGR(BP_I) // dead ¨ (trema/umlaut/diaresis) #define BP_DTRM BP_DEAD_TREMA -#define BP_EURO ALTGR(BP_E) // € -#define BP_TYPOGRAPHICAL_APOSTROPHE ALTGR(BP_COMMA) // ’ +#define BP_EURO ALGR(BP_E) // € +#define BP_TYPOGRAPHICAL_APOSTROPHE ALGR(BP_COMMA) // ’ #define BP_TAPO BP_TYPOGRAPHICAL_APOSTROPHE -#define BP_COPYRIGHT ALTGR(BP_C) // © +#define BP_COPYRIGHT ALGR(BP_C) // © #define BP_CPRT BP_COPYRIGHT -#define BP_THORN ALTGR(BP_T) // þ +#define BP_THORN ALGR(BP_T) // þ #define BP_THRN BP_THORN -#define BP_SHARP_S ALTGR(BP_S) // ß +#define BP_SHARP_S ALGR(BP_S) // ß #define BP_SRPS BP_SHARP_S -#define BP_REGISTERED_TRADEMARK ALTGR(BP_R) // ® +#define BP_REGISTERED_TRADEMARK ALGR(BP_R) // ® #define BP_RTM BP_REGISTERED_TRADEMARK -#define BP_DEAD_TILDE ALTGR(BP_N) // dead ~ +#define BP_DEAD_TILDE ALGR(BP_N) // dead ~ #define BP_DTLD BP_DEAD_TILDE -#define BP_DEAD_MACRON ALTGR(BP_M) // dead ¯ +#define BP_DEAD_MACRON ALGR(BP_M) // dead ¯ #define BP_DMCR BP_DEAD_MACRON -#define BP_DEAD_CEDILLA ALTGR(BP_C_CEDILLA) // dead ¸ +#define BP_DEAD_CEDILLA ALGR(BP_C_CEDILLA) // dead ¸ #define BP_DCED BP_DEAD_CEDILLA // Fourth row -#define BP_NONUS_SLASH ALTGR(BP_E_CIRCUMFLEX) // / on non-us backslash key (102nd key, ê in bépo) +#define BP_NONUS_SLASH ALGR(BP_E_CIRCUMFLEX) // / on non-us backslash key (102nd key, ê in bépo) #define BP_NUSL BP_NONUS_SLASH -#define BP_BACKSLASH ALTGR(BP_A_GRAVE) /* \ */ +#define BP_BACKSLASH ALGR(BP_A_GRAVE) /* \ */ #define BP_BSLS BP_BACKSLASH -#define BP_LEFT_CURLY_BRACE ALTGR(BP_Y) // { +#define BP_LEFT_CURLY_BRACE ALGR(BP_Y) // { #define BP_LCBR BP_LEFT_CURLY_BRACE -#define BP_RIGHT_CURLY_BRACE ALTGR(BP_X) // } +#define BP_RIGHT_CURLY_BRACE ALGR(BP_X) // } #define BP_RCBR BP_RIGHT_CURLY_BRACE -#define BP_ELLIPSIS ALTGR(BP_DOT) // … +#define BP_ELLIPSIS ALGR(BP_DOT) // … #define BP_ELPS BP_ELLIPSIS -#define BP_TILDE ALTGR(BP_K) // ~ +#define BP_TILDE ALGR(BP_K) // ~ #define BP_TILD BP_TILDE -#define BP_INVERTED_QUESTION ALTGR(BP_QUESTION) // ¿ +#define BP_INVERTED_QUESTION ALGR(BP_QUESTION) // ¿ #define BP_IQST BP_INVERTED_QUESTION -#define BP_DEAD_RING ALTGR(BP_Q) // dead ° +#define BP_DEAD_RING ALGR(BP_Q) // dead ° #define BP_DRNG BP_DEAD_RING -#define BP_DEAD_GREEK ALTGR(BP_G) // dead Greek key (following key will make a Greek letter) +#define BP_DEAD_GREEK ALGR(BP_G) // dead Greek key (following key will make a Greek letter) #define BP_DGRK BP_DEAD_GREEK -#define BP_DAGGER ALTGR(BP_H) // † +#define BP_DAGGER ALGR(BP_H) // † #define BP_DAGR BP_DAGGER -#define BP_DEAD_OGONEK ALTGR(BP_F) // dead ˛ +#define BP_DEAD_OGONEK ALGR(BP_F) // dead ˛ #define BP_DOGO BP_DEAD_OGONEK // Space bar -#define BP_UNDERSCORE ALTGR(KC_SPACE) // _ +#define BP_UNDERSCORE ALGR(KC_SPACE) // _ #define BP_UNDS BP_UNDERSCORE // AltGr-Shifted characters (different from capitalised AltGr-ed characters) // First row -#define BP_PARAGRAPH ALTGR(BP_HASH) // ¶ +#define BP_PARAGRAPH ALGR(BP_HASH) // ¶ #define BP_PARG BP_PARAGRAPH -#define BP_LOW_DOUBLE_QUOTE ALTGR(BP_1) // „ +#define BP_LOW_DOUBLE_QUOTE ALGR(BP_1) // „ #define BP_LWQT BP_LOW_DOUBLE_QUOTE -#define BP_LEFT_DOUBLE_QUOTE ALTGR(BP_2) // “ +#define BP_LEFT_DOUBLE_QUOTE ALGR(BP_2) // “ #define BP_LDQT BP_LEFT_DOUBLE_QUOTE -#define BP_RIGHT_DOUBLE_QUOTE ALTGR(BP_3) // ” +#define BP_RIGHT_DOUBLE_QUOTE ALGR(BP_3) // ” #define BP_RDQT BP_RIGHT_DOUBLE_QUOTE -#define BP_LESS_OR_EQUAL ALTGR(BP_4) // ≤ +#define BP_LESS_OR_EQUAL ALGR(BP_4) // ≤ #define BP_LEQL BP_LESS_OR_EQUAL -#define BP_GREATER_OR_EQUAL ALTGR(BP_5) // ≥ +#define BP_GREATER_OR_EQUAL ALGR(BP_5) // ≥ #define BP_GEQL BP_GREATER_OR_EQUAL -// nothing on ALTGR(BP_6) -#define BP_NEGATION ALTGR(BP_7) // ¬ +// nothing on ALGR(BP_6) +#define BP_NEGATION ALGR(BP_7) // ¬ #define BP_NEGT BP_NEGATION -#define BP_ONE_QUARTER ALTGR(BP_8) // ¼ +#define BP_ONE_QUARTER ALGR(BP_8) // ¼ #define BP_1QRT BP_ONE_QUARTER -#define BP_ONE_HALF ALTGR(BP_9) // ½ +#define BP_ONE_HALF ALGR(BP_9) // ½ #define BP_1HLF BP_ONE_HALF -#define BP_THREE_QUARTERS ALTGR(BP_0) // ¾ +#define BP_THREE_QUARTERS ALGR(BP_0) // ¾ #define BP_3QRT BP_THREE_QUARTERS -#define BP_MINUTES ALTGR(BP_DEGREE) // ′ +#define BP_MINUTES ALGR(BP_DEGREE) // ′ #define BP_MNUT BP_MINUTES -#define BP_SECONDS ALTGR(BP_GRAVE) // ″ +#define BP_SECONDS ALGR(BP_GRAVE) // ″ #define BP_SCND BP_SECONDS // Second row @@ -281,7 +272,7 @@ #define BP_BPIP BP_BROKEN_PIPE #define BP_DEAD_DOUBLE_ACUTE LSFT(BP_DEAD_ACUTE) // ˝ #define BP_DDCT BP_DEAD_DOUBLE_ACUTE -#define BP_SECTION ALTGR(LSFT(BP_P)) // § +#define BP_SECTION ALGR(LSFT(BP_P)) // § #define BP_SECT BP_SECTION // LSFT(BP_DEAD_GRAVE) is actually the same character as LSFT(BP_PERCENT) #define BP_GRAVE_BIS LSFT(BP_DEAD_GRAVE) // ` @@ -292,35 +283,35 @@ #define BP_DDTA BP_DEAD_DOT_ABOVE #define BP_DEAD_CURRENCY LSFT(BP_EURO) // dead ¤ (next key will generate a currency code like ¥ or £) #define BP_DCUR BP_DEAD_CURRENCY -#define BP_DEAD_HORN LSFT(ALTGR(BP_COMMA)) // dead ̛ +#define BP_DEAD_HORN LSFT(ALGR(BP_COMMA)) // dead ̛ #define BP_DHRN BP_DEAD_HORN -#define BP_LONG_S LSFT(ALTGR(BP_C)) // ſ +#define BP_LONG_S LSFT(ALGR(BP_C)) // ſ #define BP_LNGS BP_LONG_S #define BP_TRADEMARK LSFT(BP_REGISTERED_TRADEMARK) // ™ #define BP_TM BP_TRADEMARK -#define BP_ORDINAL_INDICATOR_O LSFT(ALTGR(BP_M)) // º +#define BP_ORDINAL_INDICATOR_O LSFT(ALGR(BP_M)) // º #define BP_ORDO BP_ORDINAL_INDICATOR_O #define BP_DEAD_COMMA LSFT(BP_DEAD_CEDILLA) // dead ˛ #define BP_DCOM BP_DEAD_COMMA // Fourth row -#define BP_LEFT_QUOTE LSFT(ALTGR(BP_Y)) // ‘ +#define BP_LEFT_QUOTE LSFT(ALGR(BP_Y)) // ‘ #define BP_LQOT BP_LEFT_QUOTE -#define BP_RIGHT_QUOTE LSFT(ALTGR(BP_X)) // ’ +#define BP_RIGHT_QUOTE LSFT(ALGR(BP_X)) // ’ #define BP_RQOT BP_RIGHT_QUOTE -#define BP_INTERPUNCT LSFT(ALTGR(BP_DOT)) // · +#define BP_INTERPUNCT LSFT(ALGR(BP_DOT)) // · #define BP_IPCT BP_INTERPUNCT -#define BP_DEAD_HOOK_ABOVE LSFT(ALTGR(BP_QUESTION)) // dead ̉ +#define BP_DEAD_HOOK_ABOVE LSFT(ALGR(BP_QUESTION)) // dead ̉ #define BP_DHKA BP_DEAD_HOOK_ABOVE #define BP_DEAD_UNDERDOT LSFT(BP_DEAD_RING) // dead ̣ #define BP_DUDT BP_DEAD_UNDERDOT #define BP_DOUBLE_DAGGER LSFT(BP_DAGGER) // ‡ #define BP_DDGR BP_DOUBLE_DAGGER -#define BP_ORDINAL_INDICATOR_A LSFT(ALTGR(BP_F)) // ª +#define BP_ORDINAL_INDICATOR_A LSFT(ALGR(BP_F)) // ª #define BP_ORDA BP_ORDINAL_INDICATOR_A // Space bar -#define BP_NARROW_NON_BREAKING_SPACE ALTGR(BP_NON_BREAKING_SPACE) +#define BP_NARROW_NON_BREAKING_SPACE ALGR(BP_NON_BREAKING_SPACE) #define BP_NNBS BP_NARROW_NON_BREAKING_SPACE #endif diff --git a/quantum/keymap_extras/keymap_canadian_multilingual.h b/quantum/keymap_extras/keymap_canadian_multilingual.h index 1d45bee32e9..2b5b95d6fab 100644 --- a/quantum/keymap_extras/keymap_canadian_multilingual.h +++ b/quantum/keymap_extras/keymap_canadian_multilingual.h @@ -13,22 +13,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef KEYMAP_CANADIAN_MULTILINGUAG_H -#define KEYMAP_CANADIAN_MULTILINGUAG_H +#ifndef KEYMAP_CANADIAN_MULTILINGUAL_H +#define KEYMAP_CANADIAN_MULTILINGUAL_H #include "keymap.h" -// Alt gr -#ifndef ALTGR -#define ALTGR(kc) RALT(kc) -#endif -#ifndef ALGR -#define ALGR(kc) ALTGR(kc) -#endif - -#define CSA_ALTGR KC_RALT -#define CSA_ALGR CSA_ALTGR - #ifndef GR2A #define GR2A(kc) RCTL(kc) #endif @@ -78,43 +67,43 @@ // Alt Gr-ed characters // First row -#define CSA_PIPE ALTGR(CSA_SLASH) // | -#define CSA_CURRENCY ALTGR(KC_4) // ¤ +#define CSA_PIPE ALGR(CSA_SLASH) // | +#define CSA_CURRENCY ALGR(KC_4) // ¤ #define CSA_CURR CSA_CURRENCY -#define CSA_LEFT_CURLY_BRACE ALTGR(KC_7) // { +#define CSA_LEFT_CURLY_BRACE ALGR(KC_7) // { #define CSA_LCBR CSA_LEFT_CURLY_BRACE -#define CSA_RIGHT_CURLY_BRACE ALTGR(KC_8) // } +#define CSA_RIGHT_CURLY_BRACE ALGR(KC_8) // } #define CSA_RCBR CSA_RIGHT_CURLY_BRACE -#define CSA_LBRACKET ALTGR(KC_9) // [ +#define CSA_LBRACKET ALGR(KC_9) // [ #define CSA_LBRC CSA_LBRACKET -#define CSA_RBRACKET ALTGR(KC_0) // ] +#define CSA_RBRACKET ALGR(KC_0) // ] #define CSA_RBRC CSA_RBRACKET -#define CSA_NEGATION ALTGR(KC_EQUAL) // ¬ +#define CSA_NEGATION ALGR(KC_EQUAL) // ¬ #define CSA_NEGT CSA_NEGATION // Second row // euro symbol not available on Linux? (X.org) -#define CSA_EURO ALTGR(KC_E) // € -#define CSA_DEAD_GRAVE ALTGR(CSA_DEAD_CIRCUMFLEX) +#define CSA_EURO ALGR(KC_E) // € +#define CSA_DEAD_GRAVE ALGR(CSA_DEAD_CIRCUMFLEX) #define CSA_DGRV CSA_DEAD_GRAVE // dead ` -#define CSA_DEAD_TILDE ALTGR(CSA_C_CEDILLA) // ~ +#define CSA_DEAD_TILDE ALGR(CSA_C_CEDILLA) // ~ #define CSA_DTLD CSA_DEAD_TILDE // Third row -#define CSA_DEGREE ALTGR(KC_SCOLON) // ° +#define CSA_DEGREE ALGR(KC_SCOLON) // ° #define CSA_DEGR CSA_DEGREE // Fourth row -#define CSA_LEFT_GUILLEMET ALTGR(KC_Z) // « +#define CSA_LEFT_GUILLEMET ALGR(KC_Z) // « #define CSA_LGIL CSA_LEFT_GUILLEMET -#define CSA_RIGHT_GUILLEMET ALTGR(KC_X) // » +#define CSA_RIGHT_GUILLEMET ALGR(KC_X) // » #define CSA_RGIL CSA_RIGHT_GUILLEMET -#define CSA_LESS ALTGR(KC_COMMA) // < -#define CSA_GREATER ALTGR(KC_DOT) // > +#define CSA_LESS ALGR(KC_COMMA) // < +#define CSA_GREATER ALGR(KC_DOT) // > #define CSA_GRTR CSA_GREATER // Space bar -#define CSA_NON_BREAKING_SPACE ALTGR(KC_SPACE) +#define CSA_NON_BREAKING_SPACE ALGR(KC_SPACE) #define CSA_NBSP CSA_NON_BREAKING_SPACE // GR2A-ed characters @@ -201,7 +190,7 @@ // nothing on 2 #define CSA_POUND GR2A(LSFT(KC_3)) // £ #define CSA_GBP CSA_POUND_SIGN -// already on ALTGR(KC_E) +// already on ALGR(KC_E) #define CSA_EURO_BIS GR2A(LSFT(KC_4)) // € #define CSA_EURB CSA_EURO_BIS #define CSA_THREE_EIGHTHS GR2A(LSFT(KC_5)) // ⅜ diff --git a/quantum/keymap_extras/keymap_fr_ch.h b/quantum/keymap_extras/keymap_fr_ch.h index c0ca832a6f8..69f9547bb9c 100644 --- a/quantum/keymap_extras/keymap_fr_ch.h +++ b/quantum/keymap_extras/keymap_fr_ch.h @@ -18,10 +18,6 @@ #include "keymap.h" -// Alt gr -#define ALGR(kc) RALT(kc) -#define FR_CH_ALGR KC_RALT - // normal characters #define FR_CH_Z KC_Y #define FR_CH_Y KC_Z diff --git a/quantum/keymap_extras/keymap_french.h b/quantum/keymap_extras/keymap_french.h index 3308dc5f77e..bef7754707c 100644 --- a/quantum/keymap_extras/keymap_french.h +++ b/quantum/keymap_extras/keymap_french.h @@ -18,12 +18,6 @@ #include "keymap.h" -// Alt gr -#ifndef ALGR -#define ALGR(kc) RALT(kc) -#endif -#define NO_ALGR KC_RALT - // Normal characters #define FR_SUP2 KC_GRV #define FR_AMP KC_1 diff --git a/quantum/keymap_extras/keymap_german.h b/quantum/keymap_extras/keymap_german.h index e007c26ef5e..0ba3570df75 100644 --- a/quantum/keymap_extras/keymap_german.h +++ b/quantum/keymap_extras/keymap_german.h @@ -19,10 +19,6 @@ #include "keymap.h" -// Alt gr -#define ALGR(kc) RALT(kc) -#define DE_ALGR KC_RALT - // normal characters #define DE_Z KC_Y #define DE_Y KC_Z diff --git a/quantum/keymap_extras/keymap_german_ch.h b/quantum/keymap_extras/keymap_german_ch.h index 67350d66022..bd1ef89a19c 100644 --- a/quantum/keymap_extras/keymap_german_ch.h +++ b/quantum/keymap_extras/keymap_german_ch.h @@ -18,10 +18,6 @@ #include "keymap.h" -// Alt gr -#define ALGR(kc) RALT(kc) -#define CH_ALGR KC_RALT - // normal characters #define CH_Z KC_Y #define CH_Y KC_Z diff --git a/quantum/keymap_extras/keymap_hungarian.h b/quantum/keymap_extras/keymap_hungarian.h index b3724409284..ff43535f38e 100644 --- a/quantum/keymap_extras/keymap_hungarian.h +++ b/quantum/keymap_extras/keymap_hungarian.h @@ -19,10 +19,6 @@ #include "keymap.h" -// Alt gr -#define ALGR(kc) RALT(kc) -#define HU_ALGR KC_RALT - // basic letters #define HU_Z KC_Y #define HU_Y KC_Z diff --git a/quantum/keymap_extras/keymap_italian.h b/quantum/keymap_extras/keymap_italian.h index 0ff6ce8762e..fe0f5eb847b 100644 --- a/quantum/keymap_extras/keymap_italian.h +++ b/quantum/keymap_extras/keymap_italian.h @@ -19,14 +19,7 @@ #include "keymap.h" -// Alt gr -#define ALGR(kc) RALT(kc) -#define IT_ALGR KC_RALT - // normal characters - - - #define IT_A KC_A #define IT_B KC_B #define IT_C KC_C diff --git a/quantum/keymap_extras/keymap_neo2.h b/quantum/keymap_extras/keymap_neo2.h index 174f4a6eec0..818a739c76e 100644 --- a/quantum/keymap_extras/keymap_neo2.h +++ b/quantum/keymap_extras/keymap_neo2.h @@ -73,6 +73,6 @@ #define NEO_L1_R DE_HASH #define NEO_L2_L DE_LESS -#define NEO_L2_R DE_ALGR +#define NEO_L2_R KC_ALGR #endif diff --git a/quantum/keymap_extras/keymap_nordic.h b/quantum/keymap_extras/keymap_nordic.h index 6b34db55880..551a4212b26 100644 --- a/quantum/keymap_extras/keymap_nordic.h +++ b/quantum/keymap_extras/keymap_nordic.h @@ -18,10 +18,6 @@ #include "keymap.h" -// Alt gr -#define ALGR(kc) RALT(kc) -#define NO_ALGR KC_RALT - // Normal characters #define NO_HALF KC_GRV #define NO_PLUS KC_MINS diff --git a/quantum/keymap_extras/keymap_norman.h b/quantum/keymap_extras/keymap_norman.h new file mode 100644 index 00000000000..995b1b8a02f --- /dev/null +++ b/quantum/keymap_extras/keymap_norman.h @@ -0,0 +1,54 @@ + +/* Copyright 2019 Torben Hoffmann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "keymap.h" +// For software implementation of norman +#define NM_Q KC_Q +#define NM_W KC_W +#define NM_D KC_E +#define NM_F KC_R +#define NM_K KC_T +#define NM_J KC_Y +#define NM_U KC_U +#define NM_R KC_I +#define NM_L KC_O +#define NM_SCLN KC_P +#define NM_COLN LSFT(NM_SCLN) + +#define NM_A KC_A +#define NM_S KC_S +#define NM_E KC_D +#define NM_T KC_F +#define NM_G KC_G +#define NM_Y KC_H +#define NM_N KC_J +#define NM_I KC_K +#define NM_O KC_L +#define NM_H KC_SCLN + +#define NM_Z KC_Z +#define NM_X KC_X +#define NM_C KC_C +#define NM_V KC_V +#define NM_B KC_B +#define NM_P KC_N +#define NM_M KC_M +#define NM_COMM KC_COMM +#define NM_DOT KC_DOT +#define NM_SLSH KC_SLSH + diff --git a/quantum/keymap_extras/keymap_plover_dvorak.h b/quantum/keymap_extras/keymap_plover_dvorak.h new file mode 100644 index 00000000000..83bb1e8b878 --- /dev/null +++ b/quantum/keymap_extras/keymap_plover_dvorak.h @@ -0,0 +1,47 @@ +/* Copyright 2016 James Kay + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef KEYMAP_PLOVER_DVORAK_H +#define KEYMAP_PLOVER_DVORAK_H + +#include "keymap_dvorak.h" + +#define PD_NUM DV_1 +#define PD_LS DV_Q +#define PD_LT DV_W +#define PD_LP DV_E +#define PD_LH DV_R +#define PD_LK DV_S +#define PD_LW DV_D +#define PD_LR DV_F + +#define PD_STAR DV_Y +#define PD_RF DV_U +#define PD_RP DV_I +#define PD_RL DV_O +#define PD_RT DV_P +#define PD_RD DV_LBRC +#define PD_RR DV_J +#define PD_RB DV_K +#define PD_RG DV_L +#define PD_RS DV_SCLN +#define PD_RZ DV_QUOT + +#define PD_A DV_C +#define PD_O DV_V +#define PD_E DV_N +#define PD_U DV_M + +#endif diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h index a9db17becd8..892283e7029 100644 --- a/quantum/keymap_extras/keymap_slovenian.h +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -17,8 +17,8 @@ #ifndef KEYMAP_SLOVENIAN #define KEYMAP_SLOVENIAN -#include "keymap.h" +#include "keymap.h" //Swapped Z and Y #define SI_Z KC_Y @@ -90,18 +90,18 @@ #define SI_UNDS LSFT(SI_MINS) // _ // Alt Gr-ed characters -#define SI_CIRC ALTG(KC_3) // ^ -#define SI_DEG ALTG(KC_5) // ° -#define SI_GRV ALTG(KC_7) // ` -#define SI_ACCU ALTG(KC_9) // ´ -#define SI_LCBR ALTG(KC_B) // { -#define SI_RCBR ALTG(KC_N) // } -#define SI_LBRC ALTG(KC_F) // [ -#define SI_RBRC ALTG(KC_G) // ] -#define SI_BSLS ALTG(KC_Q) // backslash -#define SI_AT ALTG(KC_V) // @ -#define SI_EURO ALTG(KC_E) // € -#define SI_TILD ALTG(KC_1) // ~ -#define SI_PIPE ALTG(KC_W) // | +#define SI_CIRC ALGR(KC_3) // ^ +#define SI_DEG ALGR(KC_5) // ° +#define SI_GRV ALGR(KC_7) // ` +#define SI_ACCU ALGR(KC_9) // ´ +#define SI_LCBR ALGR(KC_B) // { +#define SI_RCBR ALGR(KC_N) // } +#define SI_LBRC ALGR(KC_F) // [ +#define SI_RBRC ALGR(KC_G) // ] +#define SI_BSLS ALGR(KC_Q) // backslash +#define SI_AT ALGR(KC_V) // @ +#define SI_EURO ALGR(KC_E) // € +#define SI_TILD ALGR(KC_1) // ~ +#define SI_PIPE ALGR(KC_W) // | #endif diff --git a/quantum/keymap_extras/keymap_spanish.h b/quantum/keymap_extras/keymap_spanish.h index 224db7be167..1f183327f9e 100644 --- a/quantum/keymap_extras/keymap_spanish.h +++ b/quantum/keymap_extras/keymap_spanish.h @@ -18,10 +18,6 @@ #include "keymap.h" -// Alt gr -#define ALGR(kc) RALT(kc) -#define NO_ALGR KC_RALT - // Normal characters #define ES_OVRR KC_GRV #define ES_APOS KC_MINS diff --git a/quantum/keymap_extras/keymap_uk.h b/quantum/keymap_extras/keymap_uk.h index de47103cb94..cc3d0039e28 100644 --- a/quantum/keymap_extras/keymap_uk.h +++ b/quantum/keymap_extras/keymap_uk.h @@ -18,10 +18,6 @@ #include "keymap.h" -// Alt gr -#define ALGR(kc) RALT(kc) -#define NO_ALGR KC_RALT - // Normal characters #define UK_HASH KC_NUHS #define UK_BSLS KC_NUBS diff --git a/quantum/keymap_extras/sendstring_belgian.h b/quantum/keymap_extras/sendstring_belgian.h new file mode 100644 index 00000000000..f07d852722a --- /dev/null +++ b/quantum/keymap_extras/sendstring_belgian.h @@ -0,0 +1,97 @@ +/* Copyright 2019 kimat + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Sendstring lookup tables for Belgian layouts + +#pragma once + +#include "keymap_belgian.h" + +const bool ascii_to_shift_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 1, 1, 0, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +const bool ascii_to_altgr_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0 +}; + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, BE_EXLM, BE_QUOT, BE_QUOT, BE_DLR, BE_UGRV, BE_AMP, BE_APOS, + // ( ) * + , - . / + BE_LPRN, BE_RPRN, BE_DLR, BE_EQL, BE_COMM, BE_MINS, BE_SCLN, BE_COLN, + // 0 1 2 3 4 5 6 7 + BE_AGRV, BE_AMP, BE_EACU, BE_QUOT, BE_APOS, BE_LPRN, BE_PARA, BE_EGRV, + // 8 9 : ; < = > ? + BE_EXLM, BE_CCED, BE_COLN, BE_SCLN, BE_LESS, BE_EQL, BE_LESS, BE_COMM, + // @ A B C D E F G + BE_EACU, BE_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // H I J K L M N O + KC_H, KC_I, KC_J, KC_K, KC_L, BE_M, KC_N, KC_O, + // P Q R S T U V W + KC_P, BE_Q, KC_R, KC_S, KC_T, KC_U, KC_V, BE_W, + // X Y Z [ \ ] ^ _ + KC_X, KC_Y, BE_Z, BE_CIRC, BE_LESS, BE_DLR, BE_PARA, BE_MINS, + // ` a b c d e f g + BE_MU, BE_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // h i j k l m n o + KC_H, KC_I, KC_J, KC_K, KC_L, BE_M, KC_N, KC_O, + // p q r s t u v w + KC_P, BE_Q, KC_R, KC_S, KC_T, KC_U, KC_V, BE_W, + // x y z { | } ~ DEL + KC_X, KC_Y, BE_Z, BE_CCED, BE_AMP, BE_AGRV, BE_EQL, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_bepo.h b/quantum/keymap_extras/sendstring_bepo.h index c7377e077db..565c55b9553 100644 --- a/quantum/keymap_extras/sendstring_bepo.h +++ b/quantum/keymap_extras/sendstring_bepo.h @@ -13,29 +13,85 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/* Sendstring definitions for the bépo layout */ -#ifndef SENDSTRING_BEPO -#define SENDSTRING_BEPO + +// Sendstring lookup tables for BÉPO layouts + +#pragma once #include "keymap_bepo.h" -const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, KC_ESC, 0, 0, 0, 0, - KC_SPC, BP_DCRC, BP_DQOT, BP_DOLLAR, BP_DOLLAR, BP_PERCENT, BP_P, BP_APOS, - BP_LPRN, BP_RPRN, BP_ASTR, BP_PLUS, BP_COMM, BP_MINUS, BP_DOT, BP_SLSH, - KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, - KC_8, KC_9, BP_DOT, BP_DOT, KC_2, BP_EQUAL, KC_2, BP_APOS, - BP_AT, BP_A, BP_B, BP_C, BP_D, BP_E, BP_F, BP_G, - BP_H, BP_I, BP_J, BP_K, BP_L, BP_M, BP_N, BP_O, - BP_P, BP_Q, BP_R, BP_S, BP_T, BP_U, BP_V, BP_W, - BP_X, BP_Y, BP_Z, KC_4, BP_AGRV, KC_5, KC_5, KC_MINS, - KC_2, BP_A, BP_B, BP_C, BP_D, BP_E, BP_F, BP_G, - BP_H, BP_I, BP_J, BP_K, BP_L, BP_M, BP_N, BP_O, - BP_P, BP_Q, BP_R, BP_S, BP_T, BP_U, BP_V, BP_W, - BP_X, BP_Y, BP_Z, BP_Y, BP_B, BP_X, BP_K, KC_DEL, +const bool ascii_to_shift_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 1, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +const bool ascii_to_altgr_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0 }; -#endif +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, BP_DCRC, BP_DQOT, BP_DLR, BP_DLR, BP_PERC, BP_P, BP_APOS, + // ( ) * + , - . / + BP_LPRN, BP_RPRN, BP_ASTR, BP_PLUS, BP_COMM, BP_MINS, BP_DOT, BP_SLSH, + // 0 1 2 3 4 5 6 7 + BP_ASTR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_AT, BP_PLUS, + // 8 9 : ; < = > ? + BP_MINS, BP_SLSH, BP_DOT, BP_COMM, BP_LGIL, BP_EQL, BP_RGIL, BP_APOS, + // @ A B C D E F G + BP_AT, BP_A, BP_B, BP_C, BP_D, BP_E, BP_F, BP_G, + // H I J K L M N O + BP_H, BP_I, BP_J, BP_K, BP_L, BP_M, BP_N, BP_O, + // P Q R S T U V W + BP_P, BP_Q, BP_R, BP_S, BP_T, BP_U, BP_V, BP_W, + // X Y Z [ \ ] ^ _ + BP_X, BP_Y, BP_Z, BP_LPRN, BP_AGRV, BP_RPRN, BP_AT, KC_SPC, + // ` a b c d e f g + BP_PERC, BP_A, BP_B, BP_C, BP_D, BP_E, BP_F, BP_G, + // h i j k l m n o + BP_H, BP_I, BP_J, BP_K, BP_L, BP_M, BP_N, BP_O, + // p q r s t u v w + BP_P, BP_Q, BP_R, BP_S, BP_T, BP_U, BP_V, BP_W, + // x y z { | } ~ DEL + BP_X, BP_Y, BP_Z, BP_Y, BP_B, BP_X, BP_K, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_colemak.h b/quantum/keymap_extras/sendstring_colemak.h index fa9ace9290d..331f6c2223c 100644 --- a/quantum/keymap_extras/sendstring_colemak.h +++ b/quantum/keymap_extras/sendstring_colemak.h @@ -13,29 +13,45 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/* Sendstring definitions for the Colemak layout */ -#ifndef SENDSTRING_COLEMAK -#define SENDSTRING_COLEMAK + +// Sendstring lookup tables for Colemak layouts + +#pragma once #include "keymap_colemak.h" -const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, KC_ESC, 0, 0, 0, 0, - KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, - KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, - KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, - KC_8, KC_9, CM_SCLN, CM_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, - KC_2, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G, - CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O, - CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W, - CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, - KC_GRV, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G, - CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O, - CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W, - CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL -}; +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, -#endif + // ! " # $ % & ' + KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, + // ( ) * + , - . / + KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, + // 0 1 2 3 4 5 6 7 + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + // 8 9 : ; < = > ? + KC_8, KC_9, CM_SCLN, CM_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, + // @ A B C D E F G + KC_2, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G, + // H I J K L M N O + CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O, + // P Q R S T U V W + CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W, + // X Y Z [ \ ] ^ _ + CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, + // ` a b c d e f g + KC_GRV, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G, + // h i j k l m n o + CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O, + // p q r s t u v w + CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W, + // x y z { | } ~ DEL + CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_dvorak.h b/quantum/keymap_extras/sendstring_dvorak.h index f5c5c818b8f..f2cb6c4a071 100644 --- a/quantum/keymap_extras/sendstring_dvorak.h +++ b/quantum/keymap_extras/sendstring_dvorak.h @@ -13,29 +13,45 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/* Sendstring definitions for the Dvorak layout */ -#ifndef SENDSTRING_DVORAK -#define SENDSTRING_DVORAK + +// Sendstring lookup tables for Dvorak layouts + +#pragma once #include "keymap_dvorak.h" -const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, KC_ESC, 0, 0, 0, 0, - KC_SPC, DV_1, DV_QUOT, DV_3, DV_4, DV_5, DV_7, DV_QUOT, - DV_9, DV_0, DV_8, DV_EQL, DV_COMM, DV_MINS, DV_DOT, DV_SLSH, - DV_0, DV_1, DV_2, DV_3, DV_4, DV_5, DV_6, DV_7, - DV_8, DV_9, DV_SCLN, DV_SCLN, DV_COMM, DV_EQL, DV_DOT, DV_SLSH, - DV_2, DV_A, DV_B, DV_C, DV_D, DV_E, DV_F, DV_G, - DV_H, DV_I, DV_J, DV_K, DV_L, DV_M, DV_N, DV_O, - DV_P, DV_Q, DV_R, DV_S, DV_T, DV_U, DV_V, DV_W, - DV_X, DV_Y, DV_Z, DV_LBRC, DV_BSLS, DV_RBRC, DV_6, DV_MINS, - DV_GRV, DV_A, DV_B, DV_C, DV_D, DV_E, DV_F, DV_G, - DV_H, DV_I, DV_J, DV_K, DV_L, DV_M, DV_N, DV_O, - DV_P, DV_Q, DV_R, DV_S, DV_T, DV_U, DV_V, DV_W, - DV_X, DV_Y, DV_Z, DV_LBRC, DV_BSLS, DV_RBRC, DV_GRV, KC_DEL -}; +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, -#endif + // ! " # $ % & ' + KC_SPC, DV_1, DV_QUOT, DV_3, DV_4, DV_5, DV_7, DV_QUOT, + // ( ) * + , - . / + DV_9, DV_0, DV_8, DV_EQL, DV_COMM, DV_MINS, DV_DOT, DV_SLSH, + // 0 1 2 3 4 5 6 7 + DV_0, DV_1, DV_2, DV_3, DV_4, DV_5, DV_6, DV_7, + // 8 9 : ; < = > ? + DV_8, DV_9, DV_SCLN, DV_SCLN, DV_COMM, DV_EQL, DV_DOT, DV_SLSH, + // @ A B C D E F G + DV_2, DV_A, DV_B, DV_C, DV_D, DV_E, DV_F, DV_G, + // H I J K L M N O + DV_H, DV_I, DV_J, DV_K, DV_L, DV_M, DV_N, DV_O, + // P Q R S T U V W + DV_P, DV_Q, DV_R, DV_S, DV_T, DV_U, DV_V, DV_W, + // X Y Z [ \ ] ^ _ + DV_X, DV_Y, DV_Z, DV_LBRC, DV_BSLS, DV_RBRC, DV_6, DV_MINS, + // ` a b c d e f g + DV_GRV, DV_A, DV_B, DV_C, DV_D, DV_E, DV_F, DV_G, + // h i j k l m n o + DV_H, DV_I, DV_J, DV_K, DV_L, DV_M, DV_N, DV_O, + // p q r s t u v w + DV_P, DV_Q, DV_R, DV_S, DV_T, DV_U, DV_V, DV_W, + // x y z { | } ~ DEL + DV_X, DV_Y, DV_Z, DV_LBRC, DV_BSLS, DV_RBRC, DV_GRV, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_french.h b/quantum/keymap_extras/sendstring_french.h new file mode 100644 index 00000000000..66b53fbfd6e --- /dev/null +++ b/quantum/keymap_extras/sendstring_french.h @@ -0,0 +1,97 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Sendstring lookup tables for French (AZERTY) layouts + +#pragma once + +#include "keymap_french.h" + +const bool ascii_to_shift_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 1, 0, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +const bool ascii_to_altgr_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0 +}; + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, FR_EXLM, FR_QUOT, FR_QUOT, FR_DLR, FR_UGRV, FR_AMP, FR_APOS, + // ( ) * + , - . / + FR_LPRN, FR_RPRN, FR_ASTR, FR_EQL, FR_COMM, FR_MINS, FR_SCLN, FR_COLN, + // 0 1 2 3 4 5 6 7 + FR_AGRV, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, FR_MINS, FR_EGRV, + // 8 9 : ; < = > ? + FR_CCED, FR_AGRV, FR_COLN, FR_SCLN, FR_LESS, FR_EQL, FR_LESS, FR_COMM, + // @ A B C D E F G + FR_AGRV, FR_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // H I J K L M N O + KC_H, KC_I, KC_J, KC_K, KC_L, FR_M, KC_N, KC_O, + // P Q R S T U V W + KC_P, FR_Q, KC_R, KC_S, KC_T, KC_U, KC_V, FR_W, + // X Y Z [ \ ] ^ _ + KC_X, KC_Y, FR_Z, FR_LPRN, FR_UNDS, FR_RPRN, FR_CCED, FR_UNDS, + // ` a b c d e f g + FR_EGRV, FR_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // h i j k l m n o + KC_H, KC_I, KC_J, KC_K, KC_L, FR_M, KC_N, KC_O, + // p q r s t u v w + KC_P, FR_Q, KC_R, KC_S, KC_T, KC_U, KC_V, FR_W, + // x y z { | } ~ DEL + KC_X, KC_Y, FR_Z, FR_APOS, FR_MINS, FR_EQL, FR_EACU, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_german.h b/quantum/keymap_extras/sendstring_german.h index 1eaafee3173..61d22482473 100644 --- a/quantum/keymap_extras/sendstring_german.h +++ b/quantum/keymap_extras/sendstring_german.h @@ -13,69 +13,85 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/* Sendstring definitions for the German layout */ -#ifndef SENDSTRING_GERMAN -#define SENDSTRING_GERMAN + +// Sendstring lookup tables for German layouts + +#pragma once #include "keymap_german.h" -const bool ascii_to_shift_lut[0x80] PROGMEM = { +const bool ascii_to_shift_lut[128] PROGMEM = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + 0, 0, 0, 0, 0, 0, 0, 0 }; -/* Until an ALT table/functionality is added, the following symbols will not work: -* § @ [ ] { } \ ~ äA öÖ ß ´ -* Following characters can be printed using other characters like so: -* [ in makro will be ü -* { in makro will be Ü -* ~ in makro will be ° -*/ -const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, KC_ESC, 0, 0, 0, 0, +const bool ascii_to_altgr_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, - /* SPACE ! " # $ % & ' */ - KC_SPC, KC_1, KC_2, DE_HASH, KC_4, KC_5, KC_6, DE_HASH, - /* ( ) * + , - . / */ - KC_8, KC_9, DE_PLUS, DE_PLUS, KC_COMM, DE_MINS, KC_DOT, KC_7, - /* 0 1 2 3 4 5 6 7 */ - KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, - /* 8 9 : ; < = > ? */ - KC_8, KC_9, KC_DOT, KC_COMM, DE_LESS, KC_0, DE_LESS, KC_MINS, - /* @ A B C D E F G */ - KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - /* H I J K L M N O */ - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - /* P Q R S T U V W */ - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, - /* X Y Z [ \ ] ^ _ */ - KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, DE_CIRC, DE_MINS, - /* ` a b c d e f g */ - DE_ACUT, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - /* h i j k l m n o */ - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - /* p q r s t u v w */ - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, - /* x y z { | } ~ DELETE */ - KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0 }; -#endif +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, DE_1, DE_2, DE_HASH, DE_4, DE_5, DE_6, DE_HASH, + // ( ) * + , - . / + DE_8, DE_9, DE_PLUS, DE_PLUS, DE_COMM, DE_MINS, DE_DOT, DE_7, + // 0 1 2 3 4 5 6 7 + DE_0, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, + // 8 9 : ; < = > ? + DE_8, DE_9, DE_DOT, DE_COMM, DE_LESS, DE_0, DE_LESS, DE_SS, + // @ A B C D E F G + DE_Q, DE_A, DE_B, DE_C, DE_D, DE_E, DE_F, DE_G, + // H I J K L M N O + DE_H, DE_I, DE_J, DE_K, DE_L, DE_M, DE_N, DE_O, + // P Q R S T U V W + DE_P, DE_Q, DE_R, DE_S, DE_T, DE_U, DE_V, DE_W, + // X Y Z [ \ ] ^ _ + DE_X, DE_Y, DE_Z, DE_8, DE_SS, DE_9, DE_CIRC, DE_MINS, + // ` a b c d e f g + DE_ACUT, DE_A, DE_B, DE_C, DE_D, DE_E, DE_F, DE_G, + // h i j k l m n o + DE_H, DE_I, DE_J, DE_K, DE_L, DE_M, DE_N, DE_O, + // p q r s t u v w + DE_P, DE_Q, DE_R, DE_S, DE_T, DE_U, DE_V, DE_W, + // x y z { | } ~ DEL + DE_X, DE_Y, DE_Z, DE_7, DE_LESS, DE_0, DE_PLUS, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_jis.h b/quantum/keymap_extras/sendstring_jis.h index c5a38c6a5ba..fe42445f4ae 100644 --- a/quantum/keymap_extras/sendstring_jis.h +++ b/quantum/keymap_extras/sendstring_jis.h @@ -13,15 +13,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/* Sendstring definitions for the JIS keyboard layout */ -#ifndef SENDSTRING_JIS -#define SENDSTRING_JIS -const bool ascii_to_shift_lut[0x80] PROGMEM = { +// Sendstring lookup tables for JIS layouts + +#pragma once + +#include "keymap_jp.h" + +const bool ascii_to_shift_lut[128] PROGMEM = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -36,23 +40,38 @@ const bool ascii_to_shift_lut[0x80] PROGMEM = { 0, 0, 0, 1, 1, 1, 1, 0 }; -const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, KC_ESC, 0, 0, 0, 0, - KC_SPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, - KC_8, KC_9, KC_QUOT, KC_SCLN, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, - KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, - KC_8, KC_9, KC_QUOT, KC_SCLN, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, - KC_LBRC, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, - KC_X, KC_Y, KC_Z, KC_RBRC, KC_JYEN, KC_BSLS, KC_EQL, KC_RO, - KC_LBRC, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, - KC_X, KC_Y, KC_Z, KC_RBRC, KC_JYEN, KC_BSLS, KC_EQL, KC_DEL, -}; +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, -#endif + // ! " # $ % & ' + KC_SPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + // ( ) * + , - . / + KC_8, KC_9, JP_COLN, JP_SCLN, JP_COMM, JP_MINS, JP_DOT, JP_SLSH, + // 0 1 2 3 4 5 6 7 + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + // 8 9 : ; < = > ? + KC_8, KC_9, JP_COLN, JP_SCLN, JP_COMM, JP_MINS, JP_DOT, JP_SLSH, + // @ A B C D E F G + JP_AT, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // H I J K L M N O + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + // P Q R S T U V W + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + // X Y Z [ \ ] ^ _ + KC_X, KC_Y, KC_Z, JP_LBRC, JP_BSLS, JP_RBRC, JP_CIRC, JP_BSLS, + // ` a b c d e f g + JP_AT, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // h i j k l m n o + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + // p q r s t u v w + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + // x y z { | } ~ DEL + KC_X, KC_Y, KC_Z, JP_LBRC, JP_YEN, JP_RBRC, JP_CIRC, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_norman.h b/quantum/keymap_extras/sendstring_norman.h new file mode 100644 index 00000000000..8d4ec8dabd2 --- /dev/null +++ b/quantum/keymap_extras/sendstring_norman.h @@ -0,0 +1,57 @@ +/* Copyright 2019 Torben Hoffmann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Sendstring lookup tables for Norman layouts + +#pragma once + +#include "keymap_norman.h" + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, + // ( ) * + , - . / + KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, + // 0 1 2 3 4 5 6 7 + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + // 8 9 : ; < = > ? + KC_8, KC_9, NM_SCLN, NM_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, + // @ A B C D E F G + KC_2, NM_A, NM_B, NM_C, NM_D, NM_E, NM_F, NM_G, + // H I J K L M N O + NM_H, NM_I, NM_J, NM_K, NM_L, NM_M, NM_N, NM_O, + // P Q R S T U V W + NM_P, NM_Q, NM_R, NM_S, NM_T, NM_U, NM_V, NM_W, + // X Y Z [ \ ] ^ _ + NM_X, NM_Y, NM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, + // ` a b c d e f g + KC_GRV, NM_A, NM_B, NM_C, NM_D, NM_E, NM_F, NM_G, + // h i j k l m n o + NM_H, NM_I, NM_J, NM_K, NM_L, NM_M, NM_N, NM_O, + // p q r s t u v w + NM_P, NM_Q, NM_R, NM_S, NM_T, NM_U, NM_V, NM_W, + // x y z { | } ~ DEL + NM_X, NM_Y, NM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_spanish.h b/quantum/keymap_extras/sendstring_spanish.h index 71944592901..985d6028800 100644 --- a/quantum/keymap_extras/sendstring_spanish.h +++ b/quantum/keymap_extras/sendstring_spanish.h @@ -13,59 +13,85 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/* Sendstring definitions for the Spanish layout */ -#ifndef SENDSTRING_SPANISH -#define SENDSTRING_SPANISH + +// Sendstring lookup tables for Spanish layouts + +#pragma once #include "keymap_spanish.h" -const bool ascii_to_shift_lut[0x80] PROGMEM = { +const bool ascii_to_shift_lut[128] PROGMEM = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, + 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + 0, 0, 0, 0, 0, 0, 0, 0 }; -/* Until an ALT table/functionality is added, the following symbols will not work: - # @ [ ] { } | ~ -*/ -const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, KC_ESC, 0, 0, 0, 0, -/* , ! " # $ % & ' */ - KC_SPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, ES_APOS, -/* ( ) * + , - . / */ - KC_8, KC_9, ES_PLUS, ES_PLUS, KC_COMM, ES_MINS, KC_DOT, KC_7, - KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, -/* 8 9 : ; < = > ? */ - KC_8, KC_9, KC_DOT, KC_COMM, KC_NUBS, KC_0, KC_NUBS, ES_APOS, -/* @ A B C D E F G */ - KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, -/* X Y Z [ \ ] ^ _ */ - KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, ES_GRV, ES_MINS, - ES_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, - KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL +const bool ascii_to_altgr_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0 }; -#endif +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, ES_APOS, + // ( ) * + , - . / + KC_8, KC_9, ES_PLUS, ES_PLUS, KC_COMM, ES_MINS, KC_DOT, KC_7, + // 0 1 2 3 4 5 6 7 + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + // 8 9 : ; < = > ? + KC_8, KC_9, KC_DOT, KC_COMM, ES_LESS, KC_0, ES_LESS, ES_APOS, + // @ A B C D E F G + KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // H I J K L M N O + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + // P Q R S T U V W + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + // X Y Z [ \ ] ^ _ + KC_X, KC_Y, KC_Z, ES_GRV, ES_OVRR, ES_PLUS, ES_GRV, ES_MINS, + // ` a b c d e f g + ES_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // h i j k l m n o + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + // p q r s t u v w + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + // x y z { | } ~ DEL + KC_X, KC_Y, KC_Z, ES_ACUT, KC_1, ES_CCED, ES_NTIL, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_uk.h b/quantum/keymap_extras/sendstring_uk.h new file mode 100644 index 00000000000..a01c9bc4390 --- /dev/null +++ b/quantum/keymap_extras/sendstring_uk.h @@ -0,0 +1,77 @@ +/* Copyright 2019 Rys Sommefeldt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Sendstring lookup tables for UK layouts + +#pragma once + +#include "keymap_uk.h" + +const bool ascii_to_shift_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0 +}; + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + UK_SPC, UK_1, UK_2, UK_HASH, UK_4, UK_5, UK_7, UK_QUOT, + // ( ) * + , - . / + UK_9, UK_0, UK_8, UK_EQL, UK_COMM, UK_MINS, UK_DOT, UK_SLSH, + // 0 1 2 3 4 5 6 7 + UK_0, UK_1, UK_2, UK_3, UK_4, UK_5, UK_6, UK_7, + // 8 9 : ; < = > ? + UK_8, UK_9, UK_SCLN, UK_SCLN, UK_COMM, UK_EQL, UK_DOT, UK_SLSH, + // @ A B C D E F G + UK_QUOT, UK_A, UK_B, UK_C, UK_D, UK_E, UK_F, UK_G, + // H I J K L M N O + UK_H, UK_I, UK_J, UK_K, UK_L, UK_M, UK_N, UK_O, + // P Q R S T U V W + UK_P, UK_Q, UK_R, UK_S, UK_T, UK_U, UK_V, UK_W, + // X Y Z [ \ ] ^ _ + UK_X, UK_Y, UK_Z, UK_LBRC, UK_BSLS, UK_RBRC, UK_6, UK_MINS, + // ` a b c d e f g + UK_GRV, UK_A, UK_B, UK_C, UK_D, UK_E, UK_F, UK_G, + // h i j k l m n o + UK_H, UK_I, UK_J, UK_K, UK_L, UK_M, UK_N, UK_O, + // p q r s t u v w + UK_P, UK_Q, UK_R, UK_S, UK_T, UK_U, UK_V, UK_W, + // x y z { | } ~ DEL + UK_X, UK_Y, UK_Z, UK_LBRC, UK_BSLS, UK_RBRC, UK_HASH, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_workman.h b/quantum/keymap_extras/sendstring_workman.h index a8571839da1..a0dd4756fff 100644 --- a/quantum/keymap_extras/sendstring_workman.h +++ b/quantum/keymap_extras/sendstring_workman.h @@ -13,29 +13,45 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/* Sendstring definitions for the Workman layout */ -#ifndef SENDSTRING_WORKMAN -#define SENDSTRING_WORKMAN + +// Sendstring lookup tables for Workman layouts + +#pragma once #include "keymap_workman.h" -const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, KC_ESC, 0, 0, 0, 0, - KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, - KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, - KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, - KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, - KC_2, WK_A, WK_B, WK_C, WK_D, WK_E, WK_F, WK_G, - WK_H, WK_I, WK_J, WK_K, WK_L, WK_M, WK_N, WK_O, - WK_P, WK_Q, WK_R, WK_S, WK_T, WK_U, WK_V, WK_W, - WK_X, WK_Y, WK_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, - KC_GRV, WK_A, WK_B, WK_C, WK_D, WK_E, WK_F, WK_G, - WK_H, WK_I, WK_J, WK_K, WK_L, WK_M, WK_N, WK_O, - WK_P, WK_Q, WK_R, WK_S, WK_T, WK_U, WK_V, WK_W, - WK_X, WK_Y, WK_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL -}; +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, -#endif \ No newline at end of file + // ! " # $ % & ' + KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, + // ( ) * + , - . / + KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, + // 0 1 2 3 4 5 6 7 + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + // 8 9 : ; < = > ? + KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, + // @ A B C D E F G + KC_2, WK_A, WK_B, WK_C, WK_D, WK_E, WK_F, WK_G, + // H I J K L M N O + WK_H, WK_I, WK_J, WK_K, WK_L, WK_M, WK_N, WK_O, + // P Q R S T U V W + WK_P, WK_Q, WK_R, WK_S, WK_T, WK_U, WK_V, WK_W, + // X Y Z [ \ ] ^ _ + WK_X, WK_Y, WK_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, + // ` a b c d e f g + KC_GRV, WK_A, WK_B, WK_C, WK_D, WK_E, WK_F, WK_G, + // h i j k l m n o + WK_H, WK_I, WK_J, WK_K, WK_L, WK_M, WK_N, WK_O, + // p q r s t u v w + WK_P, WK_Q, WK_R, WK_S, WK_T, WK_U, WK_V, WK_W, + // x y z { | } ~ DEL + WK_X, WK_Y, WK_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL +}; diff --git a/quantum/led_matrix.c b/quantum/led_matrix.c new file mode 100644 index 00000000000..8ef8abe712b --- /dev/null +++ b/quantum/led_matrix.c @@ -0,0 +1,391 @@ +/* Copyright 2017 Jason Williams + * Copyright 2017 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2019 Clueboard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include "quantum.h" +#include "ledmatrix.h" +#include "progmem.h" +#include "config.h" +#include "eeprom.h" +#include +#include + +led_config_t led_matrix_config; + +#ifndef MAX + #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) +#endif + +#ifndef MIN + #define MIN(a,b) ((a) < (b)? (a): (b)) +#endif + +#ifndef LED_DISABLE_AFTER_TIMEOUT + #define LED_DISABLE_AFTER_TIMEOUT 0 +#endif + +#ifndef LED_DISABLE_WHEN_USB_SUSPENDED + #define LED_DISABLE_WHEN_USB_SUSPENDED false +#endif + +#ifndef EECONFIG_LED_MATRIX + #define EECONFIG_LED_MATRIX EECONFIG_RGBLIGHT +#endif + +#if !defined(LED_MATRIX_MAXIMUM_BRIGHTNESS) || LED_MATRIX_MAXIMUM_BRIGHTNESS > 255 + #define LED_MATRIX_MAXIMUM_BRIGHTNESS 255 +#endif + +bool g_suspend_state = false; + +// Global tick at 20 Hz +uint32_t g_tick = 0; + +// Ticks since this key was last hit. +uint8_t g_key_hit[LED_DRIVER_LED_COUNT]; + +// Ticks since any key was last hit. +uint32_t g_any_key_hit = 0; + +uint32_t eeconfig_read_led_matrix(void) { + return eeprom_read_dword(EECONFIG_LED_MATRIX); +} + +void eeconfig_update_led_matrix(uint32_t config_value) { + eeprom_update_dword(EECONFIG_LED_MATRIX, config_value); +} + +void eeconfig_update_led_matrix_default(void) { + dprintf("eeconfig_update_led_matrix_default\n"); + led_matrix_config.enable = 1; + led_matrix_config.mode = LED_MATRIX_UNIFORM_BRIGHTNESS; + led_matrix_config.val = 128; + led_matrix_config.speed = 0; + eeconfig_update_led_matrix(led_matrix_config.raw); +} + +void eeconfig_debug_led_matrix(void) { + dprintf("led_matrix_config eeprom\n"); + dprintf("led_matrix_config.enable = %d\n", led_matrix_config.enable); + dprintf("led_matrix_config.mode = %d\n", led_matrix_config.mode); + dprintf("led_matrix_config.val = %d\n", led_matrix_config.val); + dprintf("led_matrix_config.speed = %d\n", led_matrix_config.speed); +} + +// Last led hit +#ifndef LED_HITS_TO_REMEMBER + #define LED_HITS_TO_REMEMBER 8 +#endif +uint8_t g_last_led_hit[LED_HITS_TO_REMEMBER] = {255}; +uint8_t g_last_led_count = 0; + +void map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i, uint8_t *led_count) { + led_matrix led; + *led_count = 0; + + for (uint8_t i = 0; i < LED_DRIVER_LED_COUNT; i++) { + // map_index_to_led(i, &led); + led = g_leds[i]; + if (row == led.matrix_co.row && column == led.matrix_co.col) { + led_i[*led_count] = i; + (*led_count)++; + } + } +} + +void led_matrix_update_pwm_buffers(void) { + led_matrix_driver.flush(); +} + +void led_matrix_set_index_value(int index, uint8_t value) { + led_matrix_driver.set_value(index, value); +} + +void led_matrix_set_index_value_all(uint8_t value) { + led_matrix_driver.set_value_all(value); +} + +bool process_led_matrix(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + uint8_t led[8], led_count; + map_row_column_to_led(record->event.key.row, record->event.key.col, led, &led_count); + if (led_count > 0) { + for (uint8_t i = LED_HITS_TO_REMEMBER; i > 1; i--) { + g_last_led_hit[i - 1] = g_last_led_hit[i - 2]; + } + g_last_led_hit[0] = led[0]; + g_last_led_count = MIN(LED_HITS_TO_REMEMBER, g_last_led_count + 1); + } + for(uint8_t i = 0; i < led_count; i++) + g_key_hit[led[i]] = 0; + g_any_key_hit = 0; + } else { + #ifdef LED_MATRIX_KEYRELEASES + uint8_t led[8], led_count; + map_row_column_to_led(record->event.key.row, record->event.key.col, led, &led_count); + for(uint8_t i = 0; i < led_count; i++) + g_key_hit[led[i]] = 255; + + g_any_key_hit = 255; + #endif + } + return true; +} + +void led_matrix_set_suspend_state(bool state) { + g_suspend_state = state; +} + +// All LEDs off +void led_matrix_all_off(void) { + led_matrix_set_index_value_all(0); +} + +// Uniform brightness +void led_matrix_uniform_brightness(void) { + led_matrix_set_index_value_all(LED_MATRIX_MAXIMUM_BRIGHTNESS / BACKLIGHT_LEVELS * led_matrix_config.val); +} + +void led_matrix_custom(void) {} + +void led_matrix_task(void) { + if (!led_matrix_config.enable) { + led_matrix_all_off(); + led_matrix_indicators(); + return; + } + + g_tick++; + + if (g_any_key_hit < 0xFFFFFFFF) { + g_any_key_hit++; + } + + for (int led = 0; led < LED_DRIVER_LED_COUNT; led++) { + if (g_key_hit[led] < 255) { + if (g_key_hit[led] == 254) + g_last_led_count = MAX(g_last_led_count - 1, 0); + g_key_hit[led]++; + } + } + + // Ideally we would also stop sending zeros to the LED driver PWM buffers + // while suspended and just do a software shutdown. This is a cheap hack for now. + bool suspend_backlight = ((g_suspend_state && LED_DISABLE_WHEN_USB_SUSPENDED) || + (LED_DISABLE_AFTER_TIMEOUT > 0 && g_any_key_hit > LED_DISABLE_AFTER_TIMEOUT * 60 * 20)); + uint8_t effect = suspend_backlight ? 0 : led_matrix_config.mode; + + // this gets ticked at 20 Hz. + // each effect can opt to do calculations + // and/or request PWM buffer updates. + switch (effect) { + case LED_MATRIX_UNIFORM_BRIGHTNESS: + led_matrix_uniform_brightness(); + break; + default: + led_matrix_custom(); + break; + } + + if (!suspend_backlight) { + led_matrix_indicators(); + } + + // Tell the LED driver to update its state + led_matrix_driver.flush(); +} + +void led_matrix_indicators(void) { + led_matrix_indicators_kb(); + led_matrix_indicators_user(); +} + +__attribute__((weak)) +void led_matrix_indicators_kb(void) {} + +__attribute__((weak)) +void led_matrix_indicators_user(void) {} + + +// void led_matrix_set_indicator_index(uint8_t *index, uint8_t row, uint8_t column) +// { +// if (row >= MATRIX_ROWS) +// { +// // Special value, 255=none, 254=all +// *index = row; +// } +// else +// { +// // This needs updated to something like +// // uint8_t led[8], led_count; +// // map_row_column_to_led(row,column,led,&led_count); +// // for(uint8_t i = 0; i < led_count; i++) +// map_row_column_to_led(row, column, index); +// } +// } + +void led_matrix_init(void) { + led_matrix_driver.init(); + + // Wait half a second for the driver to finish initializing + wait_ms(500); + + // clear the key hits + for (int led=0; led= LED_MATRIX_EFFECT_MAX) { + led_matrix_config.mode = 1; + } + eeconfig_update_led_matrix(led_matrix_config.raw); +} + +void led_matrix_step_reverse(void) { + led_matrix_config.mode--; + if (led_matrix_config.mode < 1) { + led_matrix_config.mode = LED_MATRIX_EFFECT_MAX - 1; + } + eeconfig_update_led_matrix(led_matrix_config.raw); +} + +void led_matrix_increase_val(void) { + led_matrix_config.val = increment(led_matrix_config.val, 8, 0, LED_MATRIX_MAXIMUM_BRIGHTNESS); + eeconfig_update_led_matrix(led_matrix_config.raw); +} + +void led_matrix_decrease_val(void) { + led_matrix_config.val = decrement(led_matrix_config.val, 8, 0, LED_MATRIX_MAXIMUM_BRIGHTNESS); + eeconfig_update_led_matrix(led_matrix_config.raw); +} + +void led_matrix_increase_speed(void) { + led_matrix_config.speed = increment(led_matrix_config.speed, 1, 0, 3); + eeconfig_update_led_matrix(led_matrix_config.raw);//EECONFIG needs to be increased to support this +} + +void led_matrix_decrease_speed(void) { + led_matrix_config.speed = decrement(led_matrix_config.speed, 1, 0, 3); + eeconfig_update_led_matrix(led_matrix_config.raw);//EECONFIG needs to be increased to support this +} + +void led_matrix_mode(uint8_t mode, bool eeprom_write) { + led_matrix_config.mode = mode; + if (eeprom_write) { + eeconfig_update_led_matrix(led_matrix_config.raw); + } +} + +uint8_t led_matrix_get_mode(void) { + return led_matrix_config.mode; +} + +void led_matrix_set_value_noeeprom(uint8_t val) { + led_matrix_config.val = val; +} + +void led_matrix_set_value(uint8_t val) { + led_matrix_set_value_noeeprom(val); + eeconfig_update_led_matrix(led_matrix_config.raw); +} + +void backlight_set(uint8_t val) { + led_matrix_set_value(val); +} diff --git a/quantum/led_matrix_drivers.c b/quantum/led_matrix_drivers.c new file mode 100644 index 00000000000..cb91821a402 --- /dev/null +++ b/quantum/led_matrix_drivers.c @@ -0,0 +1,149 @@ +/* Copyright 2018 James Laird-Wah + * Copyright 2019 Clueboard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include "quantum.h" +#include "ledmatrix.h" + +/* Each driver needs to define a struct: + * + * const led_matrix_driver_t led_matrix_driver; + * + * All members must be provided. Keyboard custom drivers must define this + * in their own files. + */ + +#if defined(IS31FL3731) || defined(IS31FL3733) + +#if defined(IS31FL3731) + #include "is31fl3731-simple.h" +#endif + +#include "i2c_master.h" + +static void init(void) { + i2c_init(); + #ifdef IS31FL3731 + #ifdef LED_DRIVER_ADDR_1 + IS31FL3731_init(LED_DRIVER_ADDR_1); + #endif + #ifdef LED_DRIVER_ADDR_2 + IS31FL3731_init(LED_DRIVER_ADDR_2); + #endif + #ifdef LED_DRIVER_ADDR_3 + IS31FL3731_init(LED_DRIVER_ADDR_3); + #endif + #ifdef LED_DRIVER_ADDR_4 + IS31FL3731_init(LED_DRIVER_ADDR_4); + #endif + #else + #ifdef LED_DRIVER_ADDR_1 + IS31FL3733_init(LED_DRIVER_ADDR_1, 0 ); + #endif + #ifdef LED_DRIVER_ADDR_2 + IS31FL3733_init(LED_DRIVER_ADDR_2, 0 ); + #endif + #ifdef LED_DRIVER_ADDR_3 + IS31FL3733_init(LED_DRIVER_ADDR_3, 0 ); + #endif + #ifdef LED_DRIVER_ADDR_4 + IS31FL3733_init(LED_DRIVER_ADDR_4, 0 ); + #endif + #endif + + for (int index = 0; index < LED_DRIVER_LED_COUNT; index++) { + #ifdef IS31FL3731 + IS31FL3731_set_led_control_register(index, true); + #else + IS31FL3733_set_led_control_register(index, true); + #endif + } + // This actually updates the LED drivers + #ifdef IS31FL3731 + #ifdef LED_DRIVER_ADDR_1 + IS31FL3731_update_led_control_registers(LED_DRIVER_ADDR_1, 0); + #endif + #ifdef LED_DRIVER_ADDR_2 + IS31FL3731_update_led_control_registers(LED_DRIVER_ADDR_2, 1); + #endif + #ifdef LED_DRIVER_ADDR_3 + IS31FL3731_update_led_control_registers(LED_DRIVER_ADDR_3, 2); + #endif + #ifdef LED_DRIVER_ADDR_4 + IS31FL3731_update_led_control_registers(LED_DRIVER_ADDR_4, 3); + #endif + #else + #ifdef LED_DRIVER_ADDR_1 + IS31FL3733_update_led_control_registers(LED_DRIVER_ADDR_1, 0); + #endif + #ifdef LED_DRIVER_ADDR_2 + IS31FL3733_update_led_control_registers(LED_DRIVER_ADDR_2, 1); + #endif + #ifdef LED_DRIVER_ADDR_3 + IS31FL3733_update_led_control_registers(LED_DRIVER_ADDR_3, 2); + #endif + #ifdef LED_DRIVER_ADDR_4 + IS31FL3733_update_led_control_registers(LED_DRIVER_ADDR_4, 3); + #endif + #endif +} + +static void flush(void) { + #ifdef IS31FL3731 + #ifdef LED_DRIVER_ADDR_1 + IS31FL3731_update_pwm_buffers(LED_DRIVER_ADDR_1, 0); + #endif + #ifdef LED_DRIVER_ADDR_2 + IS31FL3731_update_pwm_buffers(LED_DRIVER_ADDR_2, 1); + #endif + #ifdef LED_DRIVER_ADDR_3 + IS31FL3731_update_pwm_buffers(LED_DRIVER_ADDR_3, 2); + #endif + #ifdef LED_DRIVER_ADDR_4 + IS31FL3731_update_pwm_buffers(LED_DRIVER_ADDR_4, 3); + #endif + #else + #ifdef LED_DRIVER_ADDR_1 + IS31FL3733_update_pwm_buffers(LED_DRIVER_ADDR_1, 0); + #endif + #ifdef LED_DRIVER_ADDR_2 + IS31FL3733_update_pwm_buffers(LED_DRIVER_ADDR_2, 1); + #endif + #ifdef LED_DRIVER_ADDR_3 + IS31FL3733_update_pwm_buffers(LED_DRIVER_ADDR_3, 2); + #endif + #ifdef LED_DRIVER_ADDR_4 + IS31FL3733_update_pwm_buffers(LED_DRIVER_ADDR_4, 3); + #endif + #endif +} + +const led_matrix_driver_t led_matrix_driver = { + .init = init, + .flush = flush, +#ifdef IS31FL3731 + .set_value = IS31FL3731_set_value, + .set_value_all = IS31FL3731_set_value_all, +#else + .set_value = IS31FL3733_set_value, + .set_value_all = IS31FL3733_set_value_all, +#endif +}; + + +#endif diff --git a/quantum/led_tables.c b/quantum/led_tables.c index b99f262097f..0eeb5c44b60 100644 --- a/quantum/led_tables.c +++ b/quantum/led_tables.c @@ -19,38 +19,28 @@ along with this program. If not, see . #ifdef USE_CIE1931_CURVE // Lightness curve using the CIE 1931 lightness formula //Generated by the python script provided in http://jared.geek.nz/2013/feb/linear-led-pwm -const uint8_t CIE1931_CURVE[] PROGMEM = { - 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, - 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, - 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, - 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, - 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, - 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, - 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, - 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, - 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, - 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 70, 71, 72, 73, 74, 75, 76, 77, 79, - 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, - 92, 94, 95, 96, 98, 99, 100, 102, 103, 105, - 106, 108, 109, 110, 112, 113, 115, 116, 118, 120, - 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, - 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, - 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, - 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, - 196, 198, 200, 202, 204, 207, 209, 211, 214, 216, - 218, 220, 223, 225, 228, 230, 232, 235, 237, 240, - 242, 245, 247, 250, 252, 255, - }; +const uint8_t CIE1931_CURVE[256] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, + 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, + 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, + 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, + 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, + 25, 25, 26, 26, 27, 28, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, + 35, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 44, 44, 45, 46, + 47, 48, 49, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, + 79, 80, 82, 83, 84, 85, 87, 88, 89, 90, 92, 93, 94, 96, 97, 99, +100, 101, 103, 104, 106, 107, 108, 110, 111, 113, 114, 116, 118, 119, 121, 122, +124, 125, 127, 129, 130, 132, 134, 135, 137, 139, 141, 142, 144, 146, 148, 149, +151, 153, 155, 157, 159, 161, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, +182, 185, 187, 189, 191, 193, 195, 197, 200, 202, 204, 206, 208, 211, 213, 215, +218, 220, 222, 225, 227, 230, 232, 234, 237, 239, 242, 244, 247, 249, 252, 255 +}; #endif #ifdef USE_LED_BREATHING_TABLE -const uint8_t LED_BREATHING_TABLE[] PROGMEM = { +const uint8_t LED_BREATHING_TABLE[256] PROGMEM = { 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 9, 10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 25, 27, 29, 31, 33, 35, 37, 40, 42, 44, 47, 49, 52, 54, 57, 59, 62, 65, 67, 70, 73, 76, diff --git a/quantum/ledmatrix.h b/quantum/ledmatrix.h new file mode 100644 index 00000000000..618c5d67674 --- /dev/null +++ b/quantum/ledmatrix.h @@ -0,0 +1,129 @@ +/* Copyright 2017 Jason Williams + * Copyright 2017 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2019 Clueboard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef LED_MATRIX_H +#define LED_MATRIX_H + + +#ifndef BACKLIGHT_ENABLE + #error You must define BACKLIGHT_ENABLE with LED_MATRIX_ENABLE +#endif + + +typedef struct Point { + uint8_t x; + uint8_t y; +} __attribute__((packed)) Point; + +typedef struct led_matrix { + union { + uint8_t raw; + struct { + uint8_t row:4; // 16 max + uint8_t col:4; // 16 max + }; + } matrix_co; + Point point; + uint8_t modifier:1; +} __attribute__((packed)) led_matrix; + +extern const led_matrix g_leds[LED_DRIVER_LED_COUNT]; + +typedef struct { + uint8_t index; + uint8_t value; +} led_indicator; + +typedef union { + uint32_t raw; + struct { + bool enable :1; + uint8_t mode :6; + uint8_t hue :8; // Unused by led_matrix + uint8_t sat :8; // Unused by led_matrix + uint8_t val :8; + uint8_t speed :8;//EECONFIG needs to be increased to support this + }; +} led_config_t; + +enum led_matrix_effects { + LED_MATRIX_UNIFORM_BRIGHTNESS = 1, + // All new effects go above this line + LED_MATRIX_EFFECT_MAX +}; + +void led_matrix_set_index_value(int index, uint8_t value); +void led_matrix_set_index_value_all(uint8_t value); + +// This runs after another backlight effect and replaces +// colors already set +void led_matrix_indicators(void); +void led_matrix_indicators_kb(void); +void led_matrix_indicators_user(void); + +void led_matrix_init(void); +void led_matrix_setup_drivers(void); + +void led_matrix_set_suspend_state(bool state); +void led_matrix_set_indicator_state(uint8_t state); + +void led_matrix_task(void); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void led_matrix_update_pwm_buffers(void); + +bool process_led_matrix(uint16_t keycode, keyrecord_t *record); + +uint32_t led_matrix_get_tick(void); + +void led_matrix_toggle(void); +void led_matrix_enable(void); +void led_matrix_enable_noeeprom(void); +void led_matrix_disable(void); +void led_matrix_disable_noeeprom(void); +void led_matrix_step(void); +void led_matrix_step_reverse(void); +void led_matrix_increase_val(void); +void led_matrix_decrease_val(void); +void led_matrix_increase_speed(void); +void led_matrix_decrease_speed(void); +void led_matrix_mode(uint8_t mode, bool eeprom_write); +void led_matrix_mode_noeeprom(uint8_t mode); +uint8_t led_matrix_get_mode(void); +void led_matrix_set_value(uint8_t mode); +void led_matrix_set_value_noeeprom(uint8_t mode); + +typedef struct { + /* Perform any initialisation required for the other driver functions to work. */ + void (*init)(void); + + /* Set the brightness of a single LED in the buffer. */ + void (*set_value)(int index, uint8_t value); + /* Set the brightness of all LEDS on the keyboard in the buffer. */ + void (*set_value_all)(uint8_t value); + /* Flush any buffered changes to the hardware. */ + void (*flush)(void); +} led_matrix_driver_t; + +extern const led_matrix_driver_t led_matrix_driver; + +#endif diff --git a/quantum/matrix.c b/quantum/matrix.c index 9b5ce33d239..7ccac353319 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -21,21 +21,9 @@ along with this program. If not, see . #include "debug.h" #include "util.h" #include "matrix.h" -#include "timer.h" +#include "debounce.h" #include "quantum.h" - -/* Set 0 if debouncing isn't needed */ - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - #if (MATRIX_COLS <= 8) # define print_matrix_header() print("\nr/c 01234567\n") # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) @@ -57,30 +45,16 @@ along with this program. If not, see . extern const matrix_row_t matrix_mask[]; #endif -#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +#ifdef DIRECT_PINS +static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; +#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; #endif /* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif +static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values +static matrix_row_t matrix[MATRIX_ROWS]; //debounced values __attribute__ ((weak)) void matrix_init_quantum(void) { @@ -120,114 +94,17 @@ uint8_t matrix_cols(void) { return MATRIX_COLS; } -// void matrix_power_up(void) { -// #if (DIODE_DIRECTION == COL2ROW) -// for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { -// /* DDRxn */ -// _SFR_IO8((row_pins[r] >> 4) + 1) |= _BV(row_pins[r] & 0xF); -// toggle_row(r); -// } -// for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { -// /* PORTxn */ -// _SFR_IO8((col_pins[c] >> 4) + 2) |= _BV(col_pins[c] & 0xF); -// } -// #elif (DIODE_DIRECTION == ROW2COL) -// for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { -// /* DDRxn */ -// _SFR_IO8((col_pins[c] >> 4) + 1) |= _BV(col_pins[c] & 0xF); -// toggle_col(c); -// } -// for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { -// /* PORTxn */ -// _SFR_IO8((row_pins[r] >> 4) + 2) |= _BV(row_pins[r] & 0xF); -// } -// #endif -// } - -void matrix_init(void) { - - // initialize row and col -#if (DIODE_DIRECTION == COL2ROW) - unselect_rows(); - init_cols(); -#elif (DIODE_DIRECTION == ROW2COL) - unselect_cols(); - init_rows(); -#endif - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); -} - -uint8_t matrix_scan(void) -{ - -#if (DIODE_DIRECTION == COL2ROW) - - // Set row, read cols - for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix, current_col); -# endif - - } - -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - debouncing = false; - } -# endif - - matrix_scan_quantum(); - return 1; -} - +//Deprecated. bool matrix_is_modified(void) { -#if (DEBOUNCING_DELAY > 0) - if (debouncing) return false; -#endif + if (debounce_active()) return false; return true; } inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY ?= STM32 + MCU_SERIES ?= STM32F3xx + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F303xC + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f3xx + + # Board: it should exist either in /os/hal/boards/ + # or /boards + BOARD ?= GENERIC_STM32_F303XC + + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV ?= 7 + + USE_FPU = yes + + # Vector table for application + # 0x00000000-0x00001000 area is occupied by bootlaoder.*/ + # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB + # OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 + + # Options to pass to dfu-util when flashing + DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave + DFU_SUFFIX_ARGS = -p DF11 -v 0483 +endif + +ifneq (,$(filter $(MCU),atmega32u4 at90usb1286)) + # Processor frequency. + # This will define a symbol, F_CPU, in all source code files equal to the + # processor frequency in Hz. You can then use this symbol in your source code to + # calculate timings. Do NOT tack on a 'UL' at the end, this will be done + # automatically to create a 32-bit value in your source code. + # + # This will be an integer division of F_USB below, as it is sourced by + # F_USB after it has run through any CPU prescalers. Note that this value + # does not *change* the processor frequency - it should merely be updated to + # reflect the processor speed set externally so that the code can use accurate + # software delays. + F_CPU ?= 16000000 + + # LUFA specific + # + # Target architecture (see library "Board Types" documentation). + ARCH ?= AVR8 + + # Input clock frequency. + # This will define a symbol, F_USB, in all source code files equal to the + # input clock frequency (before any prescaling is performed) in Hz. This value may + # differ from F_CPU if prescaling is used on the latter, and is required as the + # raw input clock is fed directly to the PLL sections of the AVR for high speed + # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' + # at the end, this will be done automatically to create a 32-bit value in your + # source code. + # + # If no clock division is performed on the input clock inside the AVR (via the + # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. + F_USB ?= $(F_CPU) +endif diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c index 8238c263f91..43b803afe7f 100644 --- a/quantum/process_keycode/process_clicky.c +++ b/quantum/process_keycode/process_clicky.c @@ -3,6 +3,9 @@ #ifdef AUDIO_CLICKY +#ifndef AUDIO_CLICKY_DELAY_DURATION +#define AUDIO_CLICKY_DELAY_DURATION 1 +#endif // !AUDIO_CLICKY_DELAY_DURATION #ifndef AUDIO_CLICKY_FREQ_DEFAULT #define AUDIO_CLICKY_FREQ_DEFAULT 440.0f #endif // !AUDIO_CLICKY_FREQ_DEFAULT @@ -21,7 +24,9 @@ float clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; float clicky_rand = AUDIO_CLICKY_FREQ_RANDOMNESS; -float clicky_song[][2] = {{AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations + +// the first "note" is an intentional delay; the 2nd and 3rd notes are the "clicky" +float clicky_song[][2] = {{AUDIO_CLICKY_FREQ_MIN, AUDIO_CLICKY_DELAY_DURATION}, {AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations extern audio_config_t audio_config; @@ -32,10 +37,10 @@ extern bool midi_activated; void clicky_play(void) { #ifndef NO_MUSIC_MODE - if (music_activated || midi_activated) return; + if (music_activated || midi_activated || !audio_config.enable) return; #endif // !NO_MUSIC_MODE - clicky_song[0][0] = 2.0f * clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); - clicky_song[1][0] = clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); + clicky_song[1][0] = 2.0f * clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); + clicky_song[2][0] = clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); PLAY_SONG(clicky_song); } @@ -73,27 +78,29 @@ void clicky_off(void) { } bool is_clicky_on(void) { - return (audio_config.clicky_enable != 0); + return (audio_config.clicky_enable != 0); } bool process_clicky(uint16_t keycode, keyrecord_t *record) { - if (keycode == CLICKY_TOGGLE && record->event.pressed) { clicky_toggle(); } + if (keycode == CLICKY_TOGGLE && record->event.pressed) { clicky_toggle(); } - if (keycode == CLICKY_ENABLE && record->event.pressed) { clicky_on(); } - if (keycode == CLICKY_DISABLE && record->event.pressed) { clicky_off(); } + if (keycode == CLICKY_ENABLE && record->event.pressed) { clicky_on(); } + if (keycode == CLICKY_DISABLE && record->event.pressed) { clicky_off(); } - if (keycode == CLICKY_RESET && record->event.pressed) { clicky_freq_reset(); } + if (keycode == CLICKY_RESET && record->event.pressed) { clicky_freq_reset(); } - if (keycode == CLICKY_UP && record->event.pressed) { clicky_freq_up(); } - if (keycode == CLICKY_DOWN && record->event.pressed) { clicky_freq_down(); } + if (keycode == CLICKY_UP && record->event.pressed) { clicky_freq_up(); } + if (keycode == CLICKY_DOWN && record->event.pressed) { clicky_freq_down(); } - if ( audio_config.clicky_enable ) { - if (record->event.pressed) { - clicky_play();; + if (audio_config.enable && audio_config.clicky_enable) { + if (record->event.pressed) { // Leave this separate so it's easier to add upstroke sound + if (keycode != AU_OFF && keycode != AU_TOG) { // DO NOT PLAY if audio will be disabled, and causes issuse on ARM + clicky_play(); } } - return true; + } + return true; } #endif //AUDIO_CLICKY diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c index 6e9c28e4fc0..d3c3b1673c3 100644 --- a/quantum/process_keycode/process_combo.c +++ b/quantum/process_keycode/process_combo.c @@ -14,141 +14,205 @@ * along with this program. If not, see . */ -#include "process_combo.h" #include "print.h" +#include "process_combo.h" - -#define COMBO_TIMER_ELAPSED -1 - - -__attribute__ ((weak)) -combo_t key_combos[COMBO_COUNT] = { +__attribute__((weak)) combo_t key_combos[COMBO_COUNT] = { }; -__attribute__ ((weak)) -void process_combo_event(uint8_t combo_index, bool pressed) { - -} +__attribute__((weak)) void process_combo_event(uint8_t combo_index, + bool pressed) {} +static uint16_t timer = 0; static uint8_t current_combo_index = 0; +static bool drop_buffer = false; +static bool is_active = false; +static bool b_combo_enable = true; // defaults to enabled -static inline void send_combo(uint16_t action, bool pressed) -{ - if (action) { - if (pressed) { - register_code16(action); - } else { - unregister_code16(action); - } +static uint8_t buffer_size = 0; +#ifdef COMBO_ALLOW_ACTION_KEYS +static keyrecord_t key_buffer[MAX_COMBO_LENGTH]; +#else +static uint16_t key_buffer[MAX_COMBO_LENGTH]; +#endif + +static inline void send_combo(uint16_t action, bool pressed) { + if (action) { + if (pressed) { + register_code16(action); } else { - process_combo_event(current_combo_index, pressed); + unregister_code16(action); } + } else { + process_combo_event(current_combo_index, pressed); + } } -#define ALL_COMBO_KEYS_ARE_DOWN (((1<state) -#define NO_COMBO_KEYS_ARE_DOWN (0 == combo->state) -#define KEY_STATE_DOWN(key) do{ combo->state |= (1<state &= ~(1<keys; ;++count) { - uint16_t key = pgm_read_word(&keys[count]); - if (keycode == key) index = count; - if (COMBO_END == key) break; - } - - /* Return if not a combo key */ - if (-1 == (int8_t)index) return false; - - /* The combos timer is used to signal whether the combo is active */ - bool is_combo_active = COMBO_TIMER_ELAPSED == combo->timer ? false : true; - - if (record->event.pressed) { - KEY_STATE_DOWN(index); +static inline void dump_key_buffer(bool emit) { + if (buffer_size == 0) { + return; + } - if (is_combo_active) { - if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was pressed */ - send_combo(combo->keycode, true); - combo->timer = COMBO_TIMER_ELAPSED; - } else { /* Combo key was pressed */ - combo->timer = timer_read(); + if (emit) { + for (uint8_t i = 0; i < buffer_size; i++) { #ifdef COMBO_ALLOW_ACTION_KEYS - combo->prev_record = *record; + const action_t action = store_or_get_action(key_buffer[i].event.pressed, + key_buffer[i].event.key); + process_action(&(key_buffer[i]), action); #else - combo->prev_key = keycode; + register_code16(key_buffer[i]); + send_keyboard_report(); #endif - } - } + } + } + + buffer_size = 0; +} + +#define ALL_COMBO_KEYS_ARE_DOWN (((1 << count) - 1) == combo->state) +#define KEY_STATE_DOWN(key) \ + do { \ + combo->state |= (1 << key); \ + } while (0) +#define KEY_STATE_UP(key) \ + do { \ + combo->state &= ~(1 << key); \ + } while (0) + +static bool process_single_combo(combo_t *combo, uint16_t keycode, + keyrecord_t *record) { + uint8_t count = 0; + uint8_t index = -1; + /* Find index of keycode and number of combo keys */ + for (const uint16_t *keys = combo->keys;; ++count) { + uint16_t key = pgm_read_word(&keys[count]); + if (keycode == key) + index = count; + if (COMBO_END == key) + break; + } + + /* Continue processing if not a combo key */ + if (-1 == (int8_t)index) + return false; + + bool is_combo_active = is_active; + + if (record->event.pressed) { + KEY_STATE_DOWN(index); + + if (is_combo_active) { + if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was pressed */ + send_combo(combo->keycode, true); + drop_buffer = true; + } + } + } else { + if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was released */ + send_combo(combo->keycode, false); } else { - if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was released */ - send_combo(combo->keycode, false); - } + /* continue processing without immediately returning */ + is_combo_active = false; + } - if (is_combo_active) { /* Combo key was tapped */ -#ifdef COMBO_ALLOW_ACTION_KEYS - record->event.pressed = true; - process_action(record, store_or_get_action(record->event.pressed, record->event.key)); - record->event.pressed = false; - process_action(record, store_or_get_action(record->event.pressed, record->event.key)); -#else - register_code16(keycode); - send_keyboard_report(); - unregister_code16(keycode); -#endif - combo->timer = 0; - } + KEY_STATE_UP(index); + } - KEY_STATE_UP(index); + return is_combo_active; +} + +#define NO_COMBO_KEYS_ARE_DOWN (0 == combo->state) + +bool process_combo(uint16_t keycode, keyrecord_t *record) { + bool is_combo_key = false; + drop_buffer = false; + bool no_combo_keys_pressed = true; + + if (keycode == CMB_ON && record->event.pressed) { + combo_enable(); + return true; + } + + if (keycode == CMB_OFF && record->event.pressed) { + combo_disable(); + return true; + } + + if (keycode == CMB_TOG && record->event.pressed) { + combo_toggle(); + return true; + } + + if (!is_combo_enabled()) { return true; } + + for (current_combo_index = 0; current_combo_index < COMBO_COUNT; + ++current_combo_index) { + combo_t *combo = &key_combos[current_combo_index]; + is_combo_key |= process_single_combo(combo, keycode, record); + no_combo_keys_pressed = no_combo_keys_pressed && NO_COMBO_KEYS_ARE_DOWN; + } + + if (drop_buffer) { + /* buffer is only dropped when we complete a combo, so we refresh the timer + * here */ + timer = timer_read(); + dump_key_buffer(false); + } else if (!is_combo_key) { + /* if no combos claim the key we need to emit the keybuffer */ + dump_key_buffer(true); + + // reset state if there are no combo keys pressed at all + if (no_combo_keys_pressed) { + timer = 0; + is_active = true; } + } else if (record->event.pressed && is_active) { + /* otherwise the key is consumed and placed in the buffer */ + timer = timer_read(); - if (NO_COMBO_KEYS_ARE_DOWN) { - combo->timer = 0; + if (buffer_size < MAX_COMBO_LENGTH) { +#ifdef COMBO_ALLOW_ACTION_KEYS + key_buffer[buffer_size++] = *record; +#else + key_buffer[buffer_size++] = keycode; +#endif } + } - return is_combo_active; + return !is_combo_key; } -bool process_combo(uint16_t keycode, keyrecord_t *record) -{ - bool is_combo_key = false; +void matrix_scan_combo(void) { + if (b_combo_enable && is_active && timer && timer_elapsed(timer) > COMBO_TERM) { - for (current_combo_index = 0; current_combo_index < COMBO_COUNT; ++current_combo_index) { - combo_t *combo = &key_combos[current_combo_index]; - is_combo_key |= process_single_combo(combo, keycode, record); - } + /* This disables the combo, meaning key events for this + * combo will be handled by the next processors in the chain + */ + is_active = false; + dump_key_buffer(true); + } +} - return !is_combo_key; +void combo_enable(void) { + b_combo_enable = true; } -void matrix_scan_combo(void) -{ - for (int i = 0; i < COMBO_COUNT; ++i) { - // Do not treat the (weak) key_combos too strict. - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Warray-bounds" - combo_t *combo = &key_combos[i]; - #pragma GCC diagnostic pop - if (combo->timer && - combo->timer != COMBO_TIMER_ELAPSED && - timer_elapsed(combo->timer) > COMBO_TERM) { - - /* This disables the combo, meaning key events for this - * combo will be handled by the next processors in the chain - */ - combo->timer = COMBO_TIMER_ELAPSED; +void combo_disable(void) { + b_combo_enable = is_active = false; + timer = 0; + dump_key_buffer(true); -#ifdef COMBO_ALLOW_ACTION_KEYS - process_action(&combo->prev_record, - store_or_get_action(combo->prev_record.event.pressed, - combo->prev_record.event.key)); -#else - unregister_code16(combo->prev_key); - register_code16(combo->prev_key); -#endif - } +} + +void combo_toggle(void) { + if (b_combo_enable) { + combo_disable(); + } else { + combo_enable(); } } + +bool is_combo_enabled(void) { + return b_combo_enable; +} diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h index a5dbd788a42..aab28495728 100644 --- a/quantum/process_keycode/process_combo.h +++ b/quantum/process_keycode/process_combo.h @@ -17,32 +17,34 @@ #ifndef PROCESS_COMBO_H #define PROCESS_COMBO_H -#include #include "progmem.h" #include "quantum.h" +#include -typedef struct -{ - const uint16_t *keys; - uint16_t keycode; #ifdef EXTRA_EXTRA_LONG_COMBOS - uint32_t state; +#define MAX_COMBO_LENGTH 32 #elif EXTRA_LONG_COMBOS - uint16_t state; +#define MAX_COMBO_LENGTH 16 #else - uint8_t state; +#define MAX_COMBO_LENGTH 8 #endif - uint16_t timer; -#ifdef COMBO_ALLOW_ACTION_KEYS - keyrecord_t prev_record; + +typedef struct { + const uint16_t *keys; + uint16_t keycode; +#ifdef EXTRA_EXTRA_LONG_COMBOS + uint32_t state; +#elif EXTRA_LONG_COMBOS + uint16_t state; #else - uint16_t prev_key; + uint8_t state; #endif } combo_t; - -#define COMBO(ck, ca) {.keys = &(ck)[0], .keycode = (ca)} -#define COMBO_ACTION(ck) {.keys = &(ck)[0]} +#define COMBO(ck, ca) \ + { .keys = &(ck)[0], .keycode = (ca) } +#define COMBO_ACTION(ck) \ + { .keys = &(ck)[0] } #define COMBO_END 0 #ifndef COMBO_COUNT @@ -56,4 +58,9 @@ bool process_combo(uint16_t keycode, keyrecord_t *record); void matrix_scan_combo(void); void process_combo_event(uint8_t combo_index, bool pressed); +void combo_enable(void); +void combo_disable(void); +void combo_toggle(void); +bool is_combo_enabled(void); + #endif diff --git a/quantum/process_keycode/process_leader.c b/quantum/process_keycode/process_leader.c index eddbf71f700..f787e6b017a 100644 --- a/quantum/process_keycode/process_leader.c +++ b/quantum/process_keycode/process_leader.c @@ -17,6 +17,7 @@ #ifdef LEADER_ENABLE #include "process_leader.h" +#include #ifndef LEADER_TIMEOUT #define LEADER_TIMEOUT 300 @@ -35,25 +36,41 @@ uint16_t leader_time = 0; uint16_t leader_sequence[5] = {0, 0, 0, 0, 0}; uint8_t leader_sequence_size = 0; +void qk_leader_start(void) { + if (leading) { return; } + leader_start(); + leading = true; + leader_time = timer_read(); + leader_sequence_size = 0; + memset(leader_sequence, 0, sizeof(leader_sequence)); +} + bool process_leader(uint16_t keycode, keyrecord_t *record) { // Leader key set-up if (record->event.pressed) { - if (!leading && keycode == KC_LEAD) { - leader_start(); - leading = true; - leader_time = timer_read(); - leader_sequence_size = 0; - leader_sequence[0] = 0; - leader_sequence[1] = 0; - leader_sequence[2] = 0; - leader_sequence[3] = 0; - leader_sequence[4] = 0; - return false; - } - if (leading && timer_elapsed(leader_time) < LEADER_TIMEOUT) { - leader_sequence[leader_sequence_size] = keycode; - leader_sequence_size++; - return false; + if (leading) { + if (timer_elapsed(leader_time) < LEADER_TIMEOUT) { +#ifndef LEADER_KEY_STRICT_KEY_PROCESSING + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { + keycode = keycode & 0xFF; + } +#endif // LEADER_KEY_STRICT_KEY_PROCESSING + if ( leader_sequence_size < ( sizeof(leader_sequence) / sizeof(leader_sequence[0]) ) ) { + leader_sequence[leader_sequence_size] = keycode; + leader_sequence_size++; + } else { + leading = false; + leader_end(); + } +#ifdef LEADER_PER_KEY_TIMING + leader_time = timer_read(); +#endif + return false; + } + } else { + if (keycode == KC_LEAD) { + qk_leader_start(); + } } } return true; diff --git a/quantum/process_keycode/process_leader.h b/quantum/process_keycode/process_leader.h index 59c3eed1be3..15bccc3f670 100644 --- a/quantum/process_keycode/process_leader.h +++ b/quantum/process_keycode/process_leader.h @@ -24,7 +24,7 @@ bool process_leader(uint16_t keycode, keyrecord_t *record); void leader_start(void); void leader_end(void); - +void qk_leader_start(void); #define SEQ_ONE_KEY(key) if (leader_sequence[0] == (key) && leader_sequence[1] == 0 && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0) #define SEQ_TWO_KEYS(key1, key2) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0) diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c new file mode 100644 index 00000000000..c8721d446ca --- /dev/null +++ b/quantum/process_keycode/process_space_cadet.c @@ -0,0 +1,165 @@ +/* Copyright 2019 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "process_space_cadet.h" + +#ifndef TAPPING_TERM + #define TAPPING_TERM 200 +#endif + +// ********** OBSOLETE DEFINES, STOP USING! (pls?) ********** +// Shift / paren setup +#ifndef LSPO_KEY + #define LSPO_KEY KC_9 +#endif +#ifndef RSPC_KEY + #define RSPC_KEY KC_0 +#endif + +// Shift / Enter setup +#ifndef SFTENT_KEY + #define SFTENT_KEY KC_ENT +#endif + +#ifdef DISABLE_SPACE_CADET_MODIFIER + #ifndef LSPO_MOD + #define LSPO_MOD KC_TRNS + #endif + #ifndef RSPC_MOD + #define RSPC_MOD KC_TRNS + #endif +#else + #ifndef LSPO_MOD + #define LSPO_MOD KC_LSFT + #endif + #ifndef RSPC_MOD + #define RSPC_MOD KC_RSFT + #endif +#endif +// ********************************************************** + +// Shift / paren setup +#ifndef LSPO_KEYS + #define LSPO_KEYS KC_LSFT, LSPO_MOD, LSPO_KEY +#endif +#ifndef RSPC_KEYS + #define RSPC_KEYS KC_RSFT, RSPC_MOD, RSPC_KEY +#endif + +// Control / paren setup +#ifndef LCPO_KEYS + #define LCPO_KEYS KC_LCTL, KC_LSFT, KC_9 +#endif +#ifndef RCPC_KEYS + #define RCPC_KEYS KC_RCTL, KC_RSFT, KC_0 +#endif + +// Alt / paren setup +#ifndef LAPO_KEYS + #define LAPO_KEYS KC_LALT, KC_LSFT, KC_9 +#endif +#ifndef RAPC_KEYS + #define RAPC_KEYS KC_RALT, KC_RSFT, KC_0 +#endif + +// Shift / Enter setup +#ifndef SFTENT_KEYS + #define SFTENT_KEYS KC_RSFT, KC_TRNS, SFTENT_KEY +#endif + +static uint8_t sc_last = 0; +static uint16_t sc_timer = 0; +#ifdef SPACE_CADET_MODIFIER_CARRYOVER +static uint8_t sc_mods = 0; +#endif + +void perform_space_cadet(keyrecord_t *record, uint8_t holdMod, uint8_t tapMod, uint8_t keycode) { + if (record->event.pressed) { + sc_last = holdMod; + sc_timer = timer_read (); +#ifdef SPACE_CADET_MODIFIER_CARRYOVER + sc_mods = get_mods(); +#endif + if (IS_MOD(holdMod)) { + register_mods(MOD_BIT(holdMod)); + } + } + else { + if (sc_last == holdMod && timer_elapsed(sc_timer) < TAPPING_TERM) { + if (holdMod != tapMod) { + if (IS_MOD(holdMod)) { + unregister_mods(MOD_BIT(holdMod)); + } + if (IS_MOD(tapMod)) { + register_mods(MOD_BIT(tapMod)); + } + } +#ifdef SPACE_CADET_MODIFIER_CARRYOVER + set_weak_mods(sc_mods); +#endif + tap_code(keycode); +#ifdef SPACE_CADET_MODIFIER_CARRYOVER + clear_weak_mods(); +#endif + if (IS_MOD(tapMod)) { + unregister_mods(MOD_BIT(tapMod)); + } + } else { + if (IS_MOD(holdMod)) { + unregister_mods(MOD_BIT(holdMod)); + } + } + } +} + +bool process_space_cadet(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case KC_LSPO: { + perform_space_cadet(record, LSPO_KEYS); + return false; + } + case KC_RSPC: { + perform_space_cadet(record, RSPC_KEYS); + return false; + } + case KC_LCPO: { + perform_space_cadet(record, LCPO_KEYS); + return false; + } + case KC_RCPC: { + perform_space_cadet(record, RCPC_KEYS); + return false; + } + case KC_LAPO: { + perform_space_cadet(record, LAPO_KEYS); + return false; + } + case KC_RAPC: { + perform_space_cadet(record, RAPC_KEYS); + return false; + } + case KC_SFTENT: { + perform_space_cadet(record, SFTENT_KEYS); + return false; + } + default: { + if (record->event.pressed) { + sc_last = 0; + } + break; + } + } + return true; +} diff --git a/quantum/process_keycode/process_space_cadet.h b/quantum/process_keycode/process_space_cadet.h new file mode 100644 index 00000000000..c8231435046 --- /dev/null +++ b/quantum/process_keycode/process_space_cadet.h @@ -0,0 +1,21 @@ +/* Copyright 2019 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +void perform_space_cadet(keyrecord_t *record, uint8_t holdMod, uint8_t tapMod, uint8_t keycode); +bool process_space_cadet(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_steno.c b/quantum/process_keycode/process_steno.c index 3051fade912..50a1ef2fcf9 100644 --- a/quantum/process_keycode/process_steno.c +++ b/quantum/process_keycode/process_steno.c @@ -114,13 +114,13 @@ static void send_steno_chord(void) { if (send_steno_chord_user(mode, chord)) { switch(mode) { case STENO_MODE_BOLT: - send_steno_state(BOLT_STATE_SIZE, false); - virtser_send(0); // terminating byte - break; + send_steno_state(BOLT_STATE_SIZE, false); + virtser_send(0); // terminating byte + break; case STENO_MODE_GEMINI: - chord[0] |= 0x80; // Indicate start of packet - send_steno_state(GEMINI_STATE_SIZE, true); - break; + chord[0] |= 0x80; // Indicate start of packet + send_steno_state(GEMINI_STATE_SIZE, true); + break; } } steno_clear_state(); @@ -161,7 +161,7 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QK_STENO_BOLT: if (!process_steno_user(keycode, record)) { - return false; + return false; } if (IS_PRESSED(record->event)) { steno_set_mode(STENO_MODE_BOLT); @@ -170,7 +170,7 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) { case QK_STENO_GEMINI: if (!process_steno_user(keycode, record)) { - return false; + return false; } if (IS_PRESSED(record->event)) { steno_set_mode(STENO_MODE_GEMINI); @@ -179,25 +179,27 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) { case STN__MIN...STN__MAX: if (!process_steno_user(keycode, record)) { - return false; + return false; } switch(mode) { - case STENO_MODE_BOLT: - update_state_bolt(keycode - QK_STENO, IS_PRESSED(record->event)); - case STENO_MODE_GEMINI: - update_state_gemini(keycode - QK_STENO, IS_PRESSED(record->event)); + case STENO_MODE_BOLT: + update_state_bolt(keycode - QK_STENO, IS_PRESSED(record->event)); + break; + case STENO_MODE_GEMINI: + update_state_gemini(keycode - QK_STENO, IS_PRESSED(record->event)); + break; } // allow postprocessing hooks if (postprocess_steno_user(keycode, record, mode, chord, pressed)) { - if (IS_PRESSED(record->event)) { - ++pressed; - } else { - --pressed; - if (pressed <= 0) { - pressed = 0; - send_steno_chord(); - } - } + if (IS_PRESSED(record->event)) { + ++pressed; + } else { + --pressed; + if (pressed <= 0) { + pressed = 0; + send_steno_chord(); + } + } } return false; } diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index b55ace5ba83..16d33dddeee 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -131,6 +131,7 @@ void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { if (keycode == action->state.keycode && keycode == last_td) continue; action->state.interrupted = true; + action->state.interrupting_keycode = keycode; process_tap_dance_action_on_dance_finished (action); reset_tap_dance (&action->state); } @@ -209,5 +210,6 @@ void reset_tap_dance (qk_tap_dance_state_t *state) { state->count = 0; state->interrupted = false; state->finished = false; + state->interrupting_keycode = 0; last_td = 0; } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index 8b0a47c49b7..ca12f4746e3 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -27,6 +27,7 @@ typedef struct uint8_t oneshot_mods; uint8_t weak_mods; uint16_t keycode; + uint16_t interrupting_keycode; uint16_t timer; bool interrupted; bool pressed; diff --git a/quantum/process_keycode/process_terminal.c b/quantum/process_keycode/process_terminal.c index 6998639f206..e791deffc10 100644 --- a/quantum/process_keycode/process_terminal.c +++ b/quantum/process_keycode/process_terminal.c @@ -273,11 +273,17 @@ bool process_terminal(uint16_t keycode, keyrecord_t *record) { disable_terminal(); return false; } + + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { + keycode = keycode & 0xFF; + } + if (keycode < 256) { uint8_t str_len; char char_to_add; switch (keycode) { case KC_ENTER: + case KC_KP_ENTER: push_to_cmd_buffer(); current_cmd_buffer_pos = 0; process_terminal_command(); diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c index 380199771db..fd4508b5354 100644 --- a/quantum/process_keycode/process_ucis.c +++ b/quantum/process_keycode/process_ucis.c @@ -64,6 +64,10 @@ void qk_ucis_symbol_fallback (void) { } } +__attribute__((weak)) +void qk_ucis_cancel(void) { +} + void register_ucis(const char *hex) { for(int i = 0; hex[i]; i++) { uint8_t kc = 0; @@ -93,7 +97,7 @@ void register_ucis(const char *hex) { } bool process_ucis (uint16_t keycode, keyrecord_t *record) { - unicode_input_mode_init(); + uint8_t i; if (!qk_ucis_state.in_progress) return true; @@ -122,7 +126,7 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { if (keycode == KC_ENT || keycode == KC_SPC || keycode == KC_ESC) { bool symbol_found = false; - for (uint8_t i = qk_ucis_state.count; i > 0; i--) { + for (i = qk_ucis_state.count; i > 0; i--) { register_code (KC_BSPC); unregister_code (KC_BSPC); wait_ms(UNICODE_TYPE_DELAY); @@ -130,11 +134,12 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { if (keycode == KC_ESC) { qk_ucis_state.in_progress = false; + qk_ucis_cancel(); return false; } unicode_input_start(); - for (uint8_t i = 0; ucis_symbol_table[i].symbol; i++) { + for (i = 0; ucis_symbol_table[i].symbol; i++) { if (is_uni_seq (ucis_symbol_table[i].symbol)) { symbol_found = true; register_ucis(ucis_symbol_table[i].code + 2); diff --git a/quantum/process_keycode/process_ucis.h b/quantum/process_keycode/process_ucis.h index d4aa34cde73..b114d839ab8 100644 --- a/quantum/process_keycode/process_ucis.h +++ b/quantum/process_keycode/process_ucis.h @@ -14,8 +14,7 @@ * along with this program. If not, see . */ -#ifndef PROCESS_UCIS_H -#define PROCESS_UCIS_H +#pragma once #include "quantum.h" #include "process_unicode_common.h" @@ -48,5 +47,3 @@ void qk_ucis_symbol_fallback (void); void qk_ucis_success(uint8_t symbol_index); void register_ucis(const char *hex); bool process_ucis (uint16_t keycode, keyrecord_t *record); - -#endif diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index f39c4a36e1b..2c914013ac0 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -13,18 +13,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "process_unicode.h" #include "action_util.h" #include "eeprom.h" bool process_unicode(uint16_t keycode, keyrecord_t *record) { - if (keycode > QK_UNICODE && record->event.pressed) { - uint16_t unicode = keycode & 0x7FFF; - unicode_input_mode_init(); + if (keycode >= QK_UNICODE && keycode <= QK_UNICODE_MAX && record->event.pressed) { unicode_input_start(); - register_hex(unicode); + register_hex(keycode & 0x7FFF); unicode_input_finish(); } return true; } - diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index c525b74f03f..22765ad5604 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -13,12 +13,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef PROCESS_UNICODE_H -#define PROCESS_UNICODE_H -#include "quantum.h" +#pragma once + #include "process_unicode_common.h" bool process_unicode(uint16_t keycode, keyrecord_t *record); - -#endif diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index 4285d20a19f..21ac2291dba 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c @@ -16,98 +16,128 @@ #include "process_unicode_common.h" #include "eeprom.h" -#include #include +#include -static uint8_t input_mode; -uint8_t mods; +unicode_config_t unicode_config; +uint8_t unicode_saved_mods; -void set_unicode_input_mode(uint8_t os_target) { - input_mode = os_target; - eeprom_update_byte(EECONFIG_UNICODEMODE, os_target); +#if UNICODE_SELECTED_MODES != -1 +static uint8_t selected[] = { UNICODE_SELECTED_MODES }; +static uint8_t selected_count = sizeof selected / sizeof *selected; +static uint8_t selected_index; +#endif + +void unicode_input_mode_init(void) { + unicode_config.raw = eeprom_read_byte(EECONFIG_UNICODEMODE); +#if UNICODE_SELECTED_MODES != -1 + #if UNICODE_CYCLE_PERSIST + // Find input_mode in selected modes + uint8_t i; + for (i = 0; i < selected_count; i++) { + if (selected[i] == unicode_config.input_mode) { + selected_index = i; + break; + } + } + if (i == selected_count) { + // Not found: input_mode isn't selected, change to one that is + unicode_config.input_mode = selected[selected_index = 0]; + } + #else + // Always change to the first selected input mode + unicode_config.input_mode = selected[selected_index = 0]; + #endif +#endif + dprintf("Unicode input mode init to: %u\n", unicode_config.input_mode); } uint8_t get_unicode_input_mode(void) { - return input_mode; + return unicode_config.input_mode; } -void unicode_input_mode_init(void) { - static bool first_flag = false; - if (!first_flag) { - input_mode = eeprom_read_byte(EECONFIG_UNICODEMODE); - first_flag = true; - } +void set_unicode_input_mode(uint8_t mode) { + unicode_config.input_mode = mode; + persist_unicode_input_mode(); + dprintf("Unicode input mode set to: %u\n", unicode_config.input_mode); +} + +void cycle_unicode_input_mode(uint8_t offset) { +#if UNICODE_SELECTED_MODES != -1 + selected_index = (selected_index + offset) % selected_count; + unicode_config.input_mode = selected[selected_index]; + #if UNICODE_CYCLE_PERSIST + persist_unicode_input_mode(); + #endif + dprintf("Unicode input mode cycle to: %u\n", unicode_config.input_mode); +#endif +} + +void persist_unicode_input_mode(void) { + eeprom_update_byte(EECONFIG_UNICODEMODE, unicode_config.input_mode); } __attribute__((weak)) -void unicode_input_start (void) { - // save current mods - mods = keyboard_report->mods; - - // unregister all mods to start from clean state - if (mods & MOD_BIT(KC_LSFT)) unregister_code(KC_LSFT); - if (mods & MOD_BIT(KC_RSFT)) unregister_code(KC_RSFT); - if (mods & MOD_BIT(KC_LCTL)) unregister_code(KC_LCTL); - if (mods & MOD_BIT(KC_RCTL)) unregister_code(KC_RCTL); - if (mods & MOD_BIT(KC_LALT)) unregister_code(KC_LALT); - if (mods & MOD_BIT(KC_RALT)) unregister_code(KC_RALT); - if (mods & MOD_BIT(KC_LGUI)) unregister_code(KC_LGUI); - if (mods & MOD_BIT(KC_RGUI)) unregister_code(KC_RGUI); - - switch(input_mode) { +void unicode_input_start(void) { + unicode_saved_mods = get_mods(); // Save current mods + clear_mods(); // Unregister mods to start from a clean state + + switch (unicode_config.input_mode) { case UC_OSX: - register_code(KC_LALT); - break; - case UC_OSX_RALT: - register_code(KC_RALT); + register_code(UNICODE_KEY_OSX); break; case UC_LNX: - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_U); - unregister_code(KC_U); - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); + tap_code16(UNICODE_KEY_LNX); break; case UC_WIN: register_code(KC_LALT); - register_code(KC_PPLS); - unregister_code(KC_PPLS); + tap_code(KC_PPLS); break; case UC_WINC: - register_code(KC_RALT); - unregister_code(KC_RALT); - register_code(KC_U); - unregister_code(KC_U); + tap_code(UNICODE_KEY_WINC); + tap_code(KC_U); + break; } + wait_ms(UNICODE_TYPE_DELAY); } __attribute__((weak)) -void unicode_input_finish (void) { - switch(input_mode) { - case UC_OSX: - case UC_WIN: - unregister_code(KC_LALT); - break; - case UC_OSX_RALT: - unregister_code(KC_RALT); - break; - case UC_LNX: - register_code(KC_SPC); - unregister_code(KC_SPC); - break; +void unicode_input_finish(void) { + switch (unicode_config.input_mode) { + case UC_OSX: + unregister_code(UNICODE_KEY_OSX); + break; + case UC_LNX: + tap_code(KC_SPC); + break; + case UC_WIN: + unregister_code(KC_LALT); + break; + case UC_WINC: + tap_code(KC_ENTER); + break; } - // reregister previously set mods - if (mods & MOD_BIT(KC_LSFT)) register_code(KC_LSFT); - if (mods & MOD_BIT(KC_RSFT)) register_code(KC_RSFT); - if (mods & MOD_BIT(KC_LCTL)) register_code(KC_LCTL); - if (mods & MOD_BIT(KC_RCTL)) register_code(KC_RCTL); - if (mods & MOD_BIT(KC_LALT)) register_code(KC_LALT); - if (mods & MOD_BIT(KC_RALT)) register_code(KC_RALT); - if (mods & MOD_BIT(KC_LGUI)) register_code(KC_LGUI); - if (mods & MOD_BIT(KC_RGUI)) register_code(KC_RGUI); + set_mods(unicode_saved_mods); // Reregister previously set mods +} + +__attribute__((weak)) +void unicode_input_cancel(void) { + switch (unicode_config.input_mode) { + case UC_OSX: + unregister_code(UNICODE_KEY_OSX); + break; + case UC_LNX: + case UC_WINC: + tap_code(KC_ESC); + break; + case UC_WIN: + unregister_code(KC_LALT); + break; + } + + set_mods(unicode_saved_mods); // Reregister previously set mods } __attribute__((weak)) @@ -124,13 +154,12 @@ uint16_t hex_to_keycode(uint8_t hex) { void register_hex(uint16_t hex) { for(int i = 3; i >= 0; i--) { uint8_t digit = ((hex >> (i*4)) & 0xF); - register_code(hex_to_keycode(digit)); - unregister_code(hex_to_keycode(digit)); + tap_code(hex_to_keycode(digit)); } } void send_unicode_hex_string(const char *str) { - if (!str) { return; } // Safety net + if (!str) { return; } while (*str) { // Find the next code point (token) in the string @@ -153,3 +182,61 @@ void send_unicode_hex_string(const char *str) { str += n; // Move to the first ' ' (or '\0') after the current token } } + +bool process_unicode_common(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch (keycode) { + case UNICODE_MODE_FORWARD: + cycle_unicode_input_mode(+1); + break; + case UNICODE_MODE_REVERSE: + cycle_unicode_input_mode(-1); + break; + + case UNICODE_MODE_OSX: + set_unicode_input_mode(UC_OSX); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX) + static float song_osx[][2] = UNICODE_SONG_OSX; + PLAY_SONG(song_osx); +#endif + break; + case UNICODE_MODE_LNX: + set_unicode_input_mode(UC_LNX); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_LNX) + static float song_lnx[][2] = UNICODE_SONG_LNX; + PLAY_SONG(song_lnx); +#endif + break; + case UNICODE_MODE_WIN: + set_unicode_input_mode(UC_WIN); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_WIN) + static float song_win[][2] = UNICODE_SONG_WIN; + PLAY_SONG(song_win); +#endif + break; + case UNICODE_MODE_BSD: + set_unicode_input_mode(UC_BSD); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_BSD) + static float song_bsd[][2] = UNICODE_SONG_BSD; + PLAY_SONG(song_bsd); +#endif + break; + case UNICODE_MODE_WINC: + set_unicode_input_mode(UC_WINC); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_WINC) + static float song_winc[][2] = UNICODE_SONG_WINC; + PLAY_SONG(song_winc); +#endif + break; + } + } +#if defined(UNICODE_ENABLE) + return process_unicode(keycode, record); +#elif defined(UNICODEMAP_ENABLE) + return process_unicodemap(keycode, record); +#elif defined(UCIS_ENABLE) + return process_ucis(keycode, record); +#else + return true; +#endif +} diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h index e78e1cec6ce..7340800e567 100644 --- a/quantum/process_keycode/process_unicode_common.h +++ b/quantum/process_keycode/process_unicode_common.h @@ -14,35 +14,76 @@ * along with this program. If not, see . */ -#ifndef PROCESS_UNICODE_COMMON_H -#define PROCESS_UNICODE_COMMON_H +#pragma once #include "quantum.h" +#if defined(UNICODE_ENABLE) + defined(UNICODEMAP_ENABLE) + defined(UCIS_ENABLE) > 1 + #error "Cannot enable more than one Unicode method (UNICODE, UNICODEMAP, UCIS) at the same time" +#endif + +// Keycodes used for starting Unicode input on different platforms +#ifndef UNICODE_KEY_OSX + #define UNICODE_KEY_OSX KC_LALT +#endif +#ifndef UNICODE_KEY_LNX + #define UNICODE_KEY_LNX LCTL(LSFT(KC_U)) +#endif +#ifndef UNICODE_KEY_WINC + #define UNICODE_KEY_WINC KC_RALT +#endif + +// Comma-delimited, ordered list of input modes selected for use (e.g. in cycle) +// Example: #define UNICODE_SELECTED_MODES UC_WINC, UC_LNX +#ifndef UNICODE_SELECTED_MODES + #define UNICODE_SELECTED_MODES -1 +#endif + +// Whether input mode changes in cycle should be written to EEPROM +#ifndef UNICODE_CYCLE_PERSIST + #define UNICODE_CYCLE_PERSIST true +#endif + +// Delay between starting Unicode input and sending a sequence, in ms #ifndef UNICODE_TYPE_DELAY -#define UNICODE_TYPE_DELAY 10 + #define UNICODE_TYPE_DELAY 10 #endif -__attribute__ ((unused)) -static uint8_t input_mode; +enum unicode_input_modes { + UC_OSX, // Mac OS X using Unicode Hex Input + UC_LNX, // Linux using IBus + UC_WIN, // Windows using EnableHexNumpad + UC_BSD, // BSD (not implemented) + UC_WINC, // Windows using WinCompose (https://github.com/samhocevar/wincompose) + UC__COUNT // Number of available input modes (always leave at the end) +}; + +typedef union { + uint32_t raw; + struct { + uint8_t input_mode : 8; + }; +} unicode_config_t; + +extern unicode_config_t unicode_config; +extern uint8_t unicode_saved_mods; -void set_unicode_input_mode(uint8_t os_target); -uint8_t get_unicode_input_mode(void); void unicode_input_mode_init(void); +uint8_t get_unicode_input_mode(void); +void set_unicode_input_mode(uint8_t mode); +void cycle_unicode_input_mode(uint8_t offset); +void persist_unicode_input_mode(void); + void unicode_input_start(void); void unicode_input_finish(void); +void unicode_input_cancel(void); + void register_hex(uint16_t hex); void send_unicode_hex_string(const char *str); -#define UC_OSX 0 // Mac OS X -#define UC_LNX 1 // Linux -#define UC_WIN 2 // Windows 'HexNumpad' -#define UC_BSD 3 // BSD (not implemented) -#define UC_WINC 4 // WinCompose https://github.com/samhocevar/wincompose -#define UC_OSX_RALT 5 // Mac OS X using Right Alt key for Unicode Compose +bool process_unicode_common(uint16_t keycode, keyrecord_t *record); #define UC_BSPC UC(0x0008) - #define UC_SPC UC(0x0020) #define UC_EXLM UC(0x0021) @@ -147,5 +188,3 @@ void send_unicode_hex_string(const char *str); #define UC_RCBR UC(0x007D) #define UC_TILD UC(0x007E) #define UC_DEL UC(0x007F) - -#endif diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c index ab5717ba3af..b8878798606 100644 --- a/quantum/process_keycode/process_unicodemap.c +++ b/quantum/process_keycode/process_unicodemap.c @@ -15,11 +15,6 @@ */ #include "process_unicodemap.h" -#include "process_unicode_common.h" - -__attribute__((weak)) -const uint32_t PROGMEM unicode_map[] = { -}; void register_hex32(uint32_t hex) { bool onzerostart = true; @@ -42,29 +37,39 @@ void register_hex32(uint32_t hex) { } __attribute__((weak)) -void unicode_map_input_error() {} +uint16_t unicodemap_index(uint16_t keycode) { + if (keycode >= QK_UNICODEMAP_PAIR) { + // Keycode is a pair: extract index based on Shift / Caps Lock state + uint16_t index = keycode - QK_UNICODEMAP_PAIR; + + bool shift = unicode_saved_mods & MOD_MASK_SHIFT, caps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK); + if (shift ^ caps) { index >>= 7; } + + return index & 0x7F; + } else { + // Keycode is a regular index + return keycode - QK_UNICODEMAP; + } +} + +bool process_unicodemap(uint16_t keycode, keyrecord_t *record) { + if (keycode >= QK_UNICODEMAP && keycode <= QK_UNICODEMAP_PAIR_MAX && record->event.pressed) { + unicode_input_start(); + + uint32_t code = pgm_read_dword(unicode_map + unicodemap_index(keycode)); + uint8_t input_mode = get_unicode_input_mode(); -bool process_unicode_map(uint16_t keycode, keyrecord_t *record) { - unicode_input_mode_init(); - uint8_t input_mode = get_unicode_input_mode(); - if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { - const uint32_t* map = unicode_map; - uint16_t index = keycode - QK_UNICODE_MAP; - uint32_t code = pgm_read_dword(&map[index]); - if (code > 0xFFFF && code <= 0x10ffff && (input_mode == UC_OSX || input_mode == UC_OSX_RALT)) { - // Convert to UTF-16 surrogate pair + if (code > 0x10FFFF || (code > 0xFFFF && input_mode == UC_WIN)) { + // Character is out of range supported by the platform + unicode_input_cancel(); + } else if (code > 0xFFFF && input_mode == UC_OSX) { + // Convert to UTF-16 surrogate pair on Mac code -= 0x10000; - uint32_t lo = code & 0x3ff; - uint32_t hi = (code & 0xffc00) >> 10; - unicode_input_start(); - register_hex32(hi + 0xd800); - register_hex32(lo + 0xdc00); + uint32_t lo = code & 0x3FF, hi = (code & 0xFFC00) >> 10; + register_hex32(hi + 0xD800); + register_hex32(lo + 0xDC00); unicode_input_finish(); - } else if ((code > 0x10ffff && (input_mode == UC_OSX || input_mode == UC_OSX_RALT)) || (code > 0xFFFFF && input_mode == UC_LNX)) { - // when character is out of range supported by the OS - unicode_map_input_error(); } else { - unicode_input_start(); register_hex32(code); unicode_input_finish(); } diff --git a/quantum/process_keycode/process_unicodemap.h b/quantum/process_keycode/process_unicodemap.h index 929c88c0b61..51709c5dc8a 100644 --- a/quantum/process_keycode/process_unicodemap.h +++ b/quantum/process_keycode/process_unicodemap.h @@ -14,12 +14,12 @@ * along with this program. If not, see . */ -#ifndef PROCESS_UNICODEMAP_H -#define PROCESS_UNICODEMAP_H +#pragma once -#include "quantum.h" #include "process_unicode_common.h" -void unicode_map_input_error(void); -bool process_unicode_map(uint16_t keycode, keyrecord_t *record); -#endif +extern const uint32_t PROGMEM unicode_map[]; + +void register_hex32(uint32_t hex); +uint16_t unicodemap_index(uint16_t keycode); +bool process_unicodemap(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/quantum.c b/quantum/quantum.c index 5f1a691c884..d98c601d991 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -15,12 +15,13 @@ */ #include "quantum.h" -#ifdef PROTOCOL_LUFA -#include "outputselect.h" + +#if !defined(RGBLIGHT_ENABLE) && !defined(RGB_MATRIX_ENABLE) + #include "rgb.h" #endif -#ifndef TAPPING_TERM -#define TAPPING_TERM 200 +#ifdef PROTOCOL_LUFA +#include "outputselect.h" #endif #ifndef BREATHING_PERIOD @@ -42,6 +43,13 @@ extern backlight_config_t backlight_config; #include "process_midi.h" #endif +#ifdef VELOCIKEY_ENABLE +#include "velocikey.h" +#endif + +#ifdef HAPTIC_ENABLE + #include "haptic.h" +#endif #ifdef ENCODER_ENABLE #include "encoder.h" @@ -132,6 +140,14 @@ void unregister_code16 (uint16_t code) { } } +void tap_code16(uint16_t code) { + register_code16(code); + #if TAP_CODE_DELAY > 0 + wait_ms(TAP_CODE_DELAY); + #endif + unregister_code16(code); +} + __attribute__ ((weak)) bool process_action_kb(keyrecord_t *record) { return true; @@ -166,6 +182,9 @@ void reset_keyboard(void) { shutdown_user(); wait_ms(250); #endif +#ifdef HAPTIC_ENABLE + haptic_shutdown(); +#endif // this is also done later in bootloader.c - not sure if it's neccesary here #ifdef BOOTLOADER_CATERINA *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific @@ -173,49 +192,44 @@ void reset_keyboard(void) { bootloader_jump(); } -// Shift / paren setup - -#ifndef LSPO_KEY - #define LSPO_KEY KC_9 -#endif -#ifndef RSPC_KEY - #define RSPC_KEY KC_0 -#endif - -// Shift / Enter setup -#ifndef SFTENT_KEY - #define SFTENT_KEY KC_ENT -#endif - -static bool shift_interrupted[2] = {0, 0}; -static uint16_t scs_timer[2] = {0, 0}; - /* true if the last press of GRAVE_ESC was shifted (i.e. GUI or SHIFT were pressed), false otherwise. * Used to ensure that the correct keycode is released if the key is released. */ static bool grave_esc_was_shifted = false; -bool process_record_quantum(keyrecord_t *record) { +/* Convert record into usable keycode via the contained event. */ +uint16_t get_record_keycode(keyrecord_t *record) { + return get_event_keycode(record->event); +} - /* This gets the keycode from the key pressed */ - keypos_t key = record->event.key; - uint16_t keycode; + +/* Convert event into usable keycode. Checks the layer cache to ensure that it + * retains the correct keycode after a layer change, if the key is still pressed. + */ +uint16_t get_event_keycode(keyevent_t event) { #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) /* TODO: Use store_or_get_action() or a similar function. */ if (!disable_action_cache) { uint8_t layer; - if (record->event.pressed) { - layer = layer_switch_get_layer(key); - update_source_layers_cache(key, layer); + if (event.pressed) { + layer = layer_switch_get_layer(event.key); + update_source_layers_cache(event.key, layer); } else { - layer = read_source_layers_cache(key); + layer = read_source_layers_cache(event.key); } - keycode = keymap_key_to_keycode(layer, key); + return keymap_key_to_keycode(layer, event.key); } else #endif - keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key); + return keymap_key_to_keycode(layer_switch_get_layer(event.key), event.key); +} + +/* Main keycode processing function. Hands off handling to other functions, + * then processes internal Quantum keycodes, then processes ACTIONs. + */ +bool process_record_quantum(keyrecord_t *record) { + uint16_t keycode = get_record_keycode(record); // This is how you use actions here // if (keycode == KC_LEAD) { @@ -225,6 +239,10 @@ bool process_record_quantum(keyrecord_t *record) { // return false; // } + #ifdef VELOCIKEY_ENABLE + if (velocikey_enabled() && record->event.pressed) { velocikey_accelerate(); } + #endif + #ifdef TAP_DANCE_ENABLE preprocess_tap_dance(keycode, record); #endif @@ -235,12 +253,15 @@ bool process_record_quantum(keyrecord_t *record) { process_key_lock(&keycode, record) && #endif #if defined(AUDIO_ENABLE) && defined(AUDIO_CLICKY) - process_clicky(keycode, record) && + process_clicky(keycode, record) && #endif //AUDIO_CLICKY - process_record_kb(keycode, record) && - #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_KEYPRESSES) + #ifdef HAPTIC_ENABLE + process_haptic(keycode, record) && + #endif //HAPTIC_ENABLE + #if defined(RGB_MATRIX_ENABLE) process_rgb_matrix(keycode, record) && #endif + process_record_kb(keycode, record) && #if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) process_midi(keycode, record) && #endif @@ -250,35 +271,32 @@ bool process_record_quantum(keyrecord_t *record) { #ifdef STENO_ENABLE process_steno(keycode, record) && #endif - #if ( defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE) + #if (defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE) process_music(keycode, record) && #endif #ifdef TAP_DANCE_ENABLE process_tap_dance(keycode, record) && #endif + #if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) + process_unicode_common(keycode, record) && + #endif #ifdef LEADER_ENABLE process_leader(keycode, record) && #endif #ifdef COMBO_ENABLE process_combo(keycode, record) && #endif - #ifdef UNICODE_ENABLE - process_unicode(keycode, record) && - #endif - #ifdef UCIS_ENABLE - process_ucis(keycode, record) && - #endif #ifdef PRINTING_ENABLE process_printer(keycode, record) && #endif #ifdef AUTO_SHIFT_ENABLE process_auto_shift(keycode, record) && #endif - #ifdef UNICODEMAP_ENABLE - process_unicode_map(keycode, record) && - #endif #ifdef TERMINAL_ENABLE process_terminal(keycode, record) && + #endif + #ifdef SPACE_CADET_ENABLE + process_space_cadet(keycode, record) && #endif true)) { return false; @@ -294,8 +312,17 @@ bool process_record_quantum(keyrecord_t *record) { return false; case DEBUG: if (record->event.pressed) { - debug_enable = true; + debug_enable ^= 1; + if (debug_enable) { print("DEBUG: enabled.\n"); + } else { + print("DEBUG: disabled.\n"); + } + } + return false; + case EEPROM_RESET: + if (record->event.pressed) { + eeconfig_init(); } return false; #ifdef FAUXCLICKY_ENABLE @@ -324,9 +351,6 @@ bool process_record_quantum(keyrecord_t *record) { if (!record->event.pressed) { #endif rgblight_toggle(); - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_MODE_FORWARD: @@ -338,9 +362,6 @@ bool process_record_quantum(keyrecord_t *record) { else { rgblight_step(); } - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_MODE_REVERSE: @@ -352,9 +373,6 @@ bool process_record_quantum(keyrecord_t *record) { else { rgblight_step_reverse(); } - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_HUI: @@ -365,9 +383,6 @@ bool process_record_quantum(keyrecord_t *record) { if (!record->event.pressed) { #endif rgblight_increase_hue(); - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_HUD: @@ -378,9 +393,6 @@ bool process_record_quantum(keyrecord_t *record) { if (!record->event.pressed) { #endif rgblight_decrease_hue(); - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_SAI: @@ -391,9 +403,6 @@ bool process_record_quantum(keyrecord_t *record) { if (!record->event.pressed) { #endif rgblight_increase_sat(); - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_SAD: @@ -404,9 +413,6 @@ bool process_record_quantum(keyrecord_t *record) { if (!record->event.pressed) { #endif rgblight_decrease_sat(); - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_VAI: @@ -417,9 +423,6 @@ bool process_record_quantum(keyrecord_t *record) { if (!record->event.pressed) { #endif rgblight_increase_val(); - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_VAD: @@ -430,9 +433,6 @@ bool process_record_quantum(keyrecord_t *record) { if (!record->event.pressed) { #endif rgblight_decrease_val(); - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_SPI: @@ -448,9 +448,6 @@ bool process_record_quantum(keyrecord_t *record) { case RGB_MODE_PLAIN: if (record->event.pressed) { rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); - #ifdef SPLIT_KEYBOARD - RGB_DIRTY = true; - #endif } return false; case RGB_MODE_BREATHE: @@ -540,7 +537,14 @@ bool process_record_quantum(keyrecord_t *record) { #endif return false; #endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - #ifdef PROTOCOL_LUFA + #ifdef VELOCIKEY_ENABLE + case VLK_TOG: + if (record->event.pressed) { + velocikey_toggle(); + } + return false; + #endif + #ifdef PROTOCOL_LUFA case OUT_AUTO: if (record->event.pressed) { set_output(OUTPUT_AUTO); @@ -654,66 +658,6 @@ bool process_record_quantum(keyrecord_t *record) { return false; } break; - case KC_LSPO: { - if (record->event.pressed) { - shift_interrupted[0] = false; - scs_timer[0] = timer_read (); - register_mods(MOD_BIT(KC_LSFT)); - } - else { - #ifdef DISABLE_SPACE_CADET_ROLLOVER - if (get_mods() & MOD_BIT(KC_RSFT)) { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - } - #endif - if (!shift_interrupted[0] && timer_elapsed(scs_timer[0]) < TAPPING_TERM) { - register_code(LSPO_KEY); - unregister_code(LSPO_KEY); - } - unregister_mods(MOD_BIT(KC_LSFT)); - } - return false; - } - - case KC_RSPC: { - if (record->event.pressed) { - shift_interrupted[1] = false; - scs_timer[1] = timer_read (); - register_mods(MOD_BIT(KC_RSFT)); - } - else { - #ifdef DISABLE_SPACE_CADET_ROLLOVER - if (get_mods() & MOD_BIT(KC_LSFT)) { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - } - #endif - if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) { - register_code(RSPC_KEY); - unregister_code(RSPC_KEY); - } - unregister_mods(MOD_BIT(KC_RSFT)); - } - return false; - } - - case KC_SFTENT: { - if (record->event.pressed) { - shift_interrupted[1] = false; - scs_timer[1] = timer_read (); - register_mods(MOD_BIT(KC_RSFT)); - } - else if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) { - unregister_mods(MOD_BIT(KC_RSFT)); - register_code(SFTENT_KEY); - unregister_code(SFTENT_KEY); - } - else { - unregister_mods(MOD_BIT(KC_RSFT)); - } - return false; - } case GRAVE_ESC: { uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT) @@ -763,28 +707,24 @@ bool process_record_quantum(keyrecord_t *record) { #if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_BREATHING) case BL_BRTG: { - if (record->event.pressed) - breathing_toggle(); + if (record->event.pressed) { + backlight_toggle_breathing(); + } return false; } #endif - - default: { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - break; - } } return process_action_kb(record); } __attribute__ ((weak)) -const bool ascii_to_shift_lut[0x80] PROGMEM = { +const bool ascii_to_shift_lut[128] PROGMEM = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -800,23 +740,61 @@ const bool ascii_to_shift_lut[0x80] PROGMEM = { }; __attribute__ ((weak)) -const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { +const bool ascii_to_altgr_lut[128] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, KC_ESC, 0, 0, 0, 0, - KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, - KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, - KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, - KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, - KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, - KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, - KC_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, - KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +__attribute__ ((weak)) +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, + // ( ) * + , - . / + KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, + // 0 1 2 3 4 5 6 7 + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + // 8 9 : ; < = > ? + KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, + // @ A B C D E F G + KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // H I J K L M N O + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + // P Q R S T U V W + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + // X Y Z [ \ ] ^ _ + KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, + // ` a b c d e f g + KC_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // h i j k l m n o + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + // p q r s t u v w + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + // x y z { | } ~ DEL + KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL }; void send_string(const char *str) { @@ -831,16 +809,16 @@ void send_string_with_delay(const char *str, uint8_t interval) { while (1) { char ascii_code = *str; if (!ascii_code) break; - if (ascii_code == 1) { + if (ascii_code == SS_TAP_CODE) { // tap uint8_t keycode = *(++str); register_code(keycode); unregister_code(keycode); - } else if (ascii_code == 2) { + } else if (ascii_code == SS_DOWN_CODE) { // down uint8_t keycode = *(++str); register_code(keycode); - } else if (ascii_code == 3) { + } else if (ascii_code == SS_UP_CODE) { // up uint8_t keycode = *(++str); unregister_code(keycode); @@ -857,16 +835,16 @@ void send_string_with_delay_P(const char *str, uint8_t interval) { while (1) { char ascii_code = pgm_read_byte(str); if (!ascii_code) break; - if (ascii_code == 1) { + if (ascii_code == SS_TAP_CODE) { // tap uint8_t keycode = pgm_read_byte(++str); register_code(keycode); unregister_code(keycode); - } else if (ascii_code == 2) { + } else if (ascii_code == SS_DOWN_CODE) { // down uint8_t keycode = pgm_read_byte(++str); register_code(keycode); - } else if (ascii_code == 3) { + } else if (ascii_code == SS_UP_CODE) { // up uint8_t keycode = pgm_read_byte(++str); unregister_code(keycode); @@ -880,16 +858,22 @@ void send_string_with_delay_P(const char *str, uint8_t interval) { } void send_char(char ascii_code) { - uint8_t keycode; - keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); - if (pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code])) { - register_code(KC_LSFT); - register_code(keycode); - unregister_code(keycode); - unregister_code(KC_LSFT); - } else { - register_code(keycode); - unregister_code(keycode); + uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); + bool is_shifted = pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code]); + bool is_altgred = pgm_read_byte(&ascii_to_altgr_lut[(uint8_t)ascii_code]); + + if (is_shifted) { + register_code(KC_LSFT); + } + if (is_altgred) { + register_code(KC_RALT); + } + tap_code(keycode); + if (is_altgred) { + unregister_code(KC_RALT); + } + if (is_shifted) { + unregister_code(KC_LSFT); } } @@ -986,7 +970,11 @@ void matrix_init_quantum() { eeconfig_init(); } #ifdef BACKLIGHT_ENABLE - backlight_init_ports(); + #ifdef LED_MATRIX_ENABLE + led_matrix_init(); + #else + backlight_init_ports(); + #endif #endif #ifdef AUDIO_ENABLE audio_init(); @@ -997,15 +985,18 @@ void matrix_init_quantum() { #ifdef ENCODER_ENABLE encoder_init(); #endif + #if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) + unicode_input_mode_init(); + #endif + #ifdef HAPTIC_ENABLE + haptic_init(); + #endif + #ifdef OUTPUT_AUTO_ENABLE + set_output(OUTPUT_AUTO); + #endif matrix_init_kb(); } -uint8_t rgb_matrix_task_counter = 0; - -#ifndef RGB_MATRIX_SKIP_FRAMES - #define RGB_MATRIX_SKIP_FRAMES 1 -#endif - void matrix_scan_quantum() { #if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) matrix_scan_music(); @@ -1019,75 +1010,197 @@ void matrix_scan_quantum() { matrix_scan_combo(); #endif - #if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_PIN) - backlight_task(); + #if defined(BACKLIGHT_ENABLE) + #if defined(LED_MATRIX_ENABLE) + led_matrix_task(); + #elif defined(BACKLIGHT_PIN) + backlight_task(); + #endif #endif #ifdef RGB_MATRIX_ENABLE rgb_matrix_task(); - if (rgb_matrix_task_counter == 0) { - rgb_matrix_update_pwm_buffers(); - } - rgb_matrix_task_counter = ((rgb_matrix_task_counter + 1) % (RGB_MATRIX_SKIP_FRAMES + 1)); #endif #ifdef ENCODER_ENABLE encoder_read(); #endif + #ifdef HAPTIC_ENABLE + haptic_task(); + #endif + matrix_scan_kb(); } -#if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_PIN) +#if defined(BACKLIGHT_ENABLE) && (defined(BACKLIGHT_PIN) || defined(BACKLIGHT_PINS)) -static const uint8_t backlight_pin = BACKLIGHT_PIN; +// The logic is a bit complex, we support 3 setups: +// 1. hardware PWM when backlight is wired to a PWM pin +// depending on this pin, we use a different output compare unit +// 2. software PWM with hardware timers, but the used timer depends +// on the audio setup (audio wins other backlight) +// 3. full software PWM -// depending on the pin, we use a different output compare unit #if BACKLIGHT_PIN == B7 +# define HARDWARE_PWM # define TCCRxA TCCR1A # define TCCRxB TCCR1B # define COMxx1 COM1C1 # define OCRxx OCR1C +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TOIEx TOIE1 # define ICRx ICR1 +# define TIMSKx TIMSK1 #elif BACKLIGHT_PIN == B6 +# define HARDWARE_PWM # define TCCRxA TCCR1A # define TCCRxB TCCR1B # define COMxx1 COM1B1 # define OCRxx OCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TOIEx TOIE1 # define ICRx ICR1 +# define TIMSKx TIMSK1 #elif BACKLIGHT_PIN == B5 +# define HARDWARE_PWM # define TCCRxA TCCR1A # define TCCRxB TCCR1B # define COMxx1 COM1A1 # define OCRxx OCR1A +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TOIEx TOIE1 # define ICRx ICR1 +# define TIMSKx TIMSK1 #elif BACKLIGHT_PIN == C6 +# define HARDWARE_PWM # define TCCRxA TCCR3A # define TCCRxB TCCR3B -# define COMxx1 COM1A1 +# define COMxx1 COM3A1 # define OCRxx OCR3A +# define TIMERx_OVF_vect TIMER3_OVF_vect +# define TOIEx TOIE3 # define ICRx ICR3 +# define TIMSKx TIMSK3 +#elif defined(__AVR_ATmega32A__) && BACKLIGHT_PIN == D4 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TOIEx TOIE1 +# define ICRx ICR1 +# define TIMSKx TIMSK1 #else -# define NO_HARDWARE_PWM +# if !defined(BACKLIGHT_CUSTOM_DRIVER) +# if !defined(B5_AUDIO) && !defined(B6_AUDIO) && !defined(B7_AUDIO) + // timer 1 is not used by audio , backlight can use it +#pragma message "Using hardware timer 1 with software PWM" +# define HARDWARE_PWM +# define BACKLIGHT_PWM_TIMER +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define OCRxx OCR1A +# define TIMERx_COMPA_vect TIMER1_COMPA_vect +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define OCIExA OCIE1A +# define TOIEx TOIE1 +# define ICRx ICR1 +# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register +# define TIMSKx TIMSK +# else +# define TIMSKx TIMSK1 +# endif +# elif !defined(C6_AUDIO) && !defined(C5_AUDIO) && !defined(C4_AUDIO) +#pragma message "Using hardware timer 3 with software PWM" +// timer 3 is not used by audio, backlight can use it +# define HARDWARE_PWM +# define BACKLIGHT_PWM_TIMER +# define TCCRxA TCCR3A +# define TCCRxB TCCR3B +# define OCRxx OCR3A +# define TIMERx_COMPA_vect TIMER3_COMPA_vect +# define TIMERx_OVF_vect TIMER3_OVF_vect +# define OCIExA OCIE3A +# define TOIEx TOIE3 +# define ICRx ICR1 +# define TIMSKx TIMSK3 +# else +#pragma message "Audio in use - using pure software PWM" +#define NO_HARDWARE_PWM +# endif +# else +#pragma message "Custom driver defined - using pure software PWM" +#define NO_HARDWARE_PWM +# endif #endif #ifndef BACKLIGHT_ON_STATE #define BACKLIGHT_ON_STATE 0 #endif -#ifdef NO_HARDWARE_PWM // pwm through software +void backlight_on(uint8_t backlight_pin) { +#if BACKLIGHT_ON_STATE == 0 + writePinLow(backlight_pin); +#else + writePinHigh(backlight_pin); +#endif +} + +void backlight_off(uint8_t backlight_pin) { +#if BACKLIGHT_ON_STATE == 0 + writePinHigh(backlight_pin); +#else + writePinLow(backlight_pin); +#endif +} + -__attribute__ ((weak)) +#if defined(NO_HARDWARE_PWM) || defined(BACKLIGHT_PWM_TIMER) // pwm through software + +// we support multiple backlight pins +#ifndef BACKLIGHT_LED_COUNT +#define BACKLIGHT_LED_COUNT 1 +#endif + +#if BACKLIGHT_LED_COUNT == 1 +#define BACKLIGHT_PIN_INIT { BACKLIGHT_PIN } +#else +#define BACKLIGHT_PIN_INIT BACKLIGHT_PINS +#endif + +#define FOR_EACH_LED(x) \ + for (uint8_t i = 0; i < BACKLIGHT_LED_COUNT; i++) \ + { \ + uint8_t backlight_pin = backlight_pins[i]; \ + { \ + x \ + } \ + } + +static const uint8_t backlight_pins[BACKLIGHT_LED_COUNT] = BACKLIGHT_PIN_INIT; + +#else // full hardware PWM + +// we support only one backlight pin +static const uint8_t backlight_pin = BACKLIGHT_PIN; +#define FOR_EACH_LED(x) x + +#endif + +#ifdef NO_HARDWARE_PWM +__attribute__((weak)) void backlight_init_ports(void) { // Setup backlight pin as output and output to on state. - // DDRx |= n - _SFR_IO8((backlight_pin >> 4) + 1) |= _BV(backlight_pin & 0xF); - #if BACKLIGHT_ON_STATE == 0 - // PORTx &= ~n - _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); - #else - // PORTx |= n - _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); + FOR_EACH_LED( + setPinOutput(backlight_pin); + backlight_on(backlight_pin); + ) + + #ifdef BACKLIGHT_BREATHING + if (is_backlight_breathing()) { + breathing_enable(); + } #endif } @@ -1099,21 +1212,14 @@ uint8_t backlight_tick = 0; #ifndef BACKLIGHT_CUSTOM_DRIVER void backlight_task(void) { if ((0xFFFF >> ((BACKLIGHT_LEVELS - get_backlight_level()) * ((BACKLIGHT_LEVELS + 1) / 2))) & (1 << backlight_tick)) { - #if BACKLIGHT_ON_STATE == 0 - // PORTx &= ~n - _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); - #else - // PORTx |= n - _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); - #endif - } else { - #if BACKLIGHT_ON_STATE == 0 - // PORTx |= n - _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); - #else - // PORTx &= ~n - _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); - #endif + FOR_EACH_LED( + backlight_on(backlight_pin); + ) + } + else { + FOR_EACH_LED( + backlight_off(backlight_pin); + ) } backlight_tick = (backlight_tick + 1) % 16; } @@ -1125,7 +1231,54 @@ void backlight_task(void) { #endif #endif -#else // pwm through timer +#else // hardware pwm through timer + +#ifdef BACKLIGHT_PWM_TIMER + +// The idea of software PWM assisted by hardware timers is the following +// we use the hardware timer in fast PWM mode like for hardware PWM, but +// instead of letting the Output Match Comparator control the led pin +// (which is not possible since the backlight is not wired to PWM pins on the +// CPU), we do the LED on/off by oursleves. +// The timer is setup to count up to 0xFFFF, and we set the Output Compare +// register to the current 16bits backlight level (after CIE correction). +// This means the CPU will trigger a compare match interrupt when the counter +// reaches the backlight level, where we turn off the LEDs, +// but also an overflow interrupt when the counter rolls back to 0, +// in which we're going to turn on the LEDs. +// The LED will then be on for OCRxx/0xFFFF time, adjusted every 244Hz. + +// Triggered when the counter reaches the OCRx value +ISR(TIMERx_COMPA_vect) { + FOR_EACH_LED( + backlight_off(backlight_pin); + ) +} + +// Triggered when the counter reaches the TOP value +// this one triggers at F_CPU/65536 =~ 244 Hz +ISR(TIMERx_OVF_vect) { +#ifdef BACKLIGHT_BREATHING + if(is_breathing()) { + breathing_task(); + } +#endif + // for very small values of OCRxx (or backlight level) + // we can't guarantee this whole code won't execute + // at the same time as the compare match interrupt + // which means that we might turn on the leds while + // trying to turn them off, leading to flickering + // artifacts (especially while breathing, because breathing_task + // takes many computation cycles). + // so better not turn them on while the counter TOP is very low. + if (OCRxx > 256) { + FOR_EACH_LED( + backlight_on(backlight_pin); + ) + } +} + +#endif #define TIMER_TOP 0xFFFFU @@ -1157,11 +1310,28 @@ void backlight_set(uint8_t level) { level = BACKLIGHT_LEVELS; if (level == 0) { + #ifdef BACKLIGHT_PWM_TIMER + if (OCRxx) { + TIMSKx &= ~(_BV(OCIExA)); + TIMSKx &= ~(_BV(TOIEx)); + FOR_EACH_LED( + backlight_off(backlight_pin); + ) + } + #else // Turn off PWM control on backlight pin TCCRxA &= ~(_BV(COMxx1)); + #endif } else { + #ifdef BACKLIGHT_PWM_TIMER + if (!OCRxx) { + TIMSKx |= _BV(OCIExA); + TIMSKx |= _BV(TOIEx); + } + #else // Turn on PWM control of backlight pin TCCRxA |= _BV(COMxx1); + #endif } // Set the brightness set_pwm(cie_lightness(TIMER_TOP * (uint32_t)level / BACKLIGHT_LEVELS)); @@ -1181,12 +1351,25 @@ static uint8_t breathing_period = BREATHING_PERIOD; static uint8_t breathing_halt = BREATHING_NO_HALT; static uint16_t breathing_counter = 0; +#ifdef BACKLIGHT_PWM_TIMER +static bool breathing = false; + +bool is_breathing(void) { + return breathing; +} + +#define breathing_interrupt_enable() do { breathing = true; } while (0) +#define breathing_interrupt_disable() do { breathing = false; } while (0) +#else + bool is_breathing(void) { - return !!(TIMSK1 & _BV(TOIE1)); + return !!(TIMSKx & _BV(TOIEx)); } -#define breathing_interrupt_enable() do {TIMSK1 |= _BV(TOIE1);} while (0) -#define breathing_interrupt_disable() do {TIMSK1 &= ~_BV(TOIE1);} while (0) +#define breathing_interrupt_enable() do {TIMSKx |= _BV(TOIEx);} while (0) +#define breathing_interrupt_disable() do {TIMSKx &= ~_BV(TOIEx);} while (0) +#endif + #define breathing_min() do {breathing_counter = 0;} while (0) #define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0) @@ -1260,10 +1443,14 @@ static inline uint16_t scale_backlight(uint16_t v) { return v / BACKLIGHT_LEVELS * get_backlight_level(); } +#ifdef BACKLIGHT_PWM_TIMER +void breathing_task(void) +#else /* Assuming a 16MHz CPU clock and a timer that resets at 64k (ICR1), the following interrupt handler will run * about 244 times per second. */ -ISR(TIMER1_OVF_vect) +ISR(TIMERx_OVF_vect) +#endif { uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS; // resetting after one period to prevent ugly reset at overflow. @@ -1285,19 +1472,21 @@ __attribute__ ((weak)) void backlight_init_ports(void) { // Setup backlight pin as output and output to on state. - // DDRx |= n - _SFR_IO8((backlight_pin >> 4) + 1) |= _BV(backlight_pin & 0xF); - #if BACKLIGHT_ON_STATE == 0 - // PORTx &= ~n - _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); - #else - // PORTx |= n - _SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF); - #endif + FOR_EACH_LED( + setPinOutput(backlight_pin); + backlight_on(backlight_pin); + ) + // I could write a wall of text here to explain... but TL;DW // Go read the ATmega32u4 datasheet. // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on +#ifdef BACKLIGHT_PWM_TIMER + // TimerX setup, Fast PWM mode count to TOP set in ICRx + TCCRxA = _BV(WGM11); // = 0b00000010; + // clock select clk/1 + TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; +#else // hardware PWM // Pin PB7 = OCR1C (Timer 1, Channel C) // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 // (i.e. start high, go low when counter matches.) @@ -1309,20 +1498,23 @@ void backlight_init_ports(void) "In fast PWM mode, the compare units allow generation of PWM waveforms on the OCnx pins. Setting the COMnx1:0 bits to two will produce a non-inverted PWM [..]." "In fast PWM mode the counter is incremented until the counter value matches either one of the fixed values 0x00FF, 0x01FF, or 0x03FF (WGMn3:0 = 5, 6, or 7), the value in ICRn (WGMn3:0 = 14), or the value in OCRnA (WGMn3:0 = 15)." */ - TCCRxA = _BV(COMxx1) | _BV(WGM11); // = 0b00001010; + TCCRxA = _BV(COMxx1) | _BV(WGM11); // = 0b00001010; TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; +#endif // Use full 16-bit resolution. Counter counts to ICR1 before reset to 0. ICRx = TIMER_TOP; backlight_init(); #ifdef BACKLIGHT_BREATHING - breathing_enable(); + if (is_backlight_breathing()) { + breathing_enable(); + } #endif } -#endif // NO_HARDWARE_PWM +#endif // hardware backlight -#else // backlight +#else // no backlight __attribute__ ((weak)) void backlight_init_ports(void) {} @@ -1416,22 +1608,23 @@ void led_init_ports(void) __attribute__ ((weak)) void led_set(uint8_t usb_led) { +#if defined(BACKLIGHT_CAPS_LOCK) && defined(BACKLIGHT_ENABLE) + // Use backlight as Caps Lock indicator + uint8_t bl_toggle_lvl = 0; + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK) && !backlight_config.enable) { + // Turning Caps Lock ON and backlight is disabled in config + // Toggling backlight to the brightest level + bl_toggle_lvl = BACKLIGHT_LEVELS; + } else if (IS_LED_OFF(usb_led, USB_LED_CAPS_LOCK) && backlight_config.enable) { + // Turning Caps Lock OFF and backlight is enabled in config + // Toggling backlight and restoring config level + bl_toggle_lvl = backlight_config.level; + } - // Example LED Code - // - // // Using PE6 Caps Lock LED - // if (usb_led & (1<. */ -#ifndef QUANTUM_H -#define QUANTUM_H +#pragma once #if defined(__AVR__) #include @@ -24,27 +23,25 @@ #if defined(PROTOCOL_CHIBIOS) #include "hal.h" #endif + #include "wait.h" #include "matrix.h" #include "keymap.h" + #ifdef BACKLIGHT_ENABLE - #include "backlight.h" -#endif -#if !defined(RGBLIGHT_ENABLE) && !defined(RGB_MATRIX_ENABLE) - #include "rgb.h" -#endif -#ifdef RGBLIGHT_ENABLE - #include "rgblight.h" -#else - #ifdef RGB_MATRIX_ENABLE - /* dummy define RGBLIGHT_MODE_xxxx */ - #define RGBLIGHT_H_DUMMY_DEFINE - #include "rgblight.h" + #ifdef LED_MATRIX_ENABLE + #include "ledmatrix.h" + #else + #include "backlight.h" #endif #endif -#ifdef SPLIT_KEYBOARD - #include "split_flags.h" +#if defined(RGBLIGHT_ENABLE) + #include "rgblight.h" +#elif defined(RGB_MATRIX_ENABLE) + // Dummy define RGBLIGHT_MODE_xxxx + #define RGBLIGHT_H_DUMMY_DEFINE + #include "rgblight.h" #endif #ifdef RGB_MATRIX_ENABLE @@ -53,35 +50,33 @@ #include "action_layer.h" #include "eeconfig.h" -#include #include "bootloader.h" #include "timer.h" #include "config_common.h" #include "led.h" #include "action_util.h" -#include #include "print.h" #include "send_string_keycodes.h" #include "suspend.h" +#include +#include -extern uint32_t default_layer_state; +extern layer_state_t default_layer_state; #ifndef NO_ACTION_LAYER - extern uint32_t layer_state; + extern layer_state_t layer_state; #endif -#ifdef MIDI_ENABLE -#ifdef MIDI_ADVANCED +#if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) #include "process_midi.h" #endif -#endif // MIDI_ENABLE #ifdef AUDIO_ENABLE #include "audio.h" #include "process_audio.h" #ifdef AUDIO_CLICKY #include "process_clicky.h" - #endif // AUDIO_CLICKY + #endif #endif #ifdef STENO_ENABLE @@ -109,7 +104,7 @@ extern uint32_t default_layer_state; #endif #ifdef TAP_DANCE_ENABLE - #include "process_tap_dance.h" + #include "process_tap_dance.h" #endif #ifdef PRINTING_ENABLE @@ -134,62 +129,68 @@ extern uint32_t default_layer_state; #include "process_terminal_nop.h" #endif +#ifdef SPACE_CADET_ENABLE + #include "process_space_cadet.h" +#endif + #ifdef HD44780_ENABLE #include "hd44780.h" #endif -//Function substitutions to ease GPIO manipulation -#ifdef __AVR__ - #define PIN_ADDRESS(p, offset) _SFR_IO8(ADDRESS_BASE + (p >> PORT_SHIFTER) + offset) - - #define pin_t uint8_t - #define setPinInput(pin) PIN_ADDRESS(pin, 1) &= ~ _BV(pin & 0xF) - #define setPinInputHigh(pin) ({\ - PIN_ADDRESS(pin, 1) &= ~ _BV(pin & 0xF);\ - PIN_ADDRESS(pin, 2) |= _BV(pin & 0xF);\ - }) - #define setPinInputLow(pin) _Static_assert(0, "AVR Processors cannot impliment an input as pull low") - #define setPinOutput(pin) PIN_ADDRESS(pin, 1) |= _BV(pin & 0xF) - - #define writePinHigh(pin) PIN_ADDRESS(pin, 2) |= _BV(pin & 0xF) - #define writePinLow(pin) PIN_ADDRESS(pin, 2) &= ~_BV(pin & 0xF) - static inline void writePin(pin_t pin, uint8_t level){ - if (level){ - PIN_ADDRESS(pin, 2) |= _BV(pin & 0xF); - } else { - PIN_ADDRESS(pin, 2) &= ~_BV(pin & 0xF); - } - } - - #define readPin(pin) ((PIN_ADDRESS(pin, 0) & _BV(pin & 0xF)) != 0) + +#ifdef HAPTIC_ENABLE + #include "haptic.h" +#endif + +#ifdef OLED_DRIVER_ENABLE + #include "oled_driver.h" +#endif + +// Function substitutions to ease GPIO manipulation +#if defined(__AVR__) + typedef uint8_t pin_t; + + #define PIN_ADDRESS(p, offset) (_SFR_IO8(ADDRESS_BASE + ((p) >> PORT_SHIFTER) + (offset))) + #define setPinInput(pin) (PIN_ADDRESS(pin, 1) &= ~_BV((pin) & 0xF)) + #define setPinInputHigh(pin) (PIN_ADDRESS(pin, 1) &= ~_BV((pin) & 0xF), \ + PIN_ADDRESS(pin, 2) |= _BV((pin) & 0xF)) + #define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") + #define setPinOutput(pin) (PIN_ADDRESS(pin, 1) |= _BV((pin) & 0xF)) + + #define writePinHigh(pin) (PIN_ADDRESS(pin, 2) |= _BV((pin) & 0xF)) + #define writePinLow(pin) (PIN_ADDRESS(pin, 2) &= ~_BV((pin) & 0xF)) + #define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) + + #define readPin(pin) ((bool)(PIN_ADDRESS(pin, 0) & _BV((pin) & 0xF))) #elif defined(PROTOCOL_CHIBIOS) - #define pin_t ioline_t - #define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) - #define setPinInputHigh(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLUP) - #define setPinInputLow(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN) - #define setPinOutput(pin) palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL) - - #define writePinHigh(pin) palSetLine(pin) - #define writePinLow(pin) palClearLine(pin) - static inline void writePin(pin_t pin, uint8_t level){ - if (level){ - palSetLine(pin); - } else { - palClearLine(pin); - } - } - - #define readPin(pin) palReadLine(pin) + typedef ioline_t pin_t; + + #define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) + #define setPinInputHigh(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLUP) + #define setPinInputLow(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN) + #define setPinOutput(pin) palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL) + + #define writePinHigh(pin) palSetLine(pin) + #define writePinLow(pin) palClearLine(pin) + #define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) + + #define readPin(pin) palReadLine(pin) #endif +// Send string macros #define STRINGIZE(z) #z #define ADD_SLASH_X(y) STRINGIZE(\x ## y) #define SYMBOL_STR(x) ADD_SLASH_X(x) +#define SS_TAP_CODE 1 +#define SS_DOWN_CODE 2 +#define SS_UP_CODE 3 + #define SS_TAP(keycode) "\1" SYMBOL_STR(keycode) #define SS_DOWN(keycode) "\2" SYMBOL_STR(keycode) #define SS_UP(keycode) "\3" SYMBOL_STR(keycode) +// `string` arguments must not be parenthesized #define SS_LCTRL(string) SS_DOWN(X_LCTRL) string SS_UP(X_LCTRL) #define SS_LGUI(string) SS_DOWN(X_LGUI) string SS_UP(X_LGUI) #define SS_LCMD(string) SS_LGUI(string) @@ -197,10 +198,14 @@ extern uint32_t default_layer_state; #define SS_LALT(string) SS_DOWN(X_LALT) string SS_UP(X_LALT) #define SS_LSFT(string) SS_DOWN(X_LSHIFT) string SS_UP(X_LSHIFT) #define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT) +#define SS_ALGR(string) SS_RALT(string) + +#define SEND_STRING(string) send_string_P(PSTR(string)) + +extern const bool ascii_to_shift_lut[128]; +extern const bool ascii_to_altgr_lut[128]; +extern const uint8_t ascii_to_keycode_lut[128]; -#define SEND_STRING(str) send_string_P(PSTR(str)) -extern const bool ascii_to_shift_lut[0x80]; -extern const uint8_t ascii_to_keycode_lut[0x80]; void send_string(const char *str); void send_string_with_delay(const char *str, uint8_t interval); void send_string_P(const char *str); @@ -222,15 +227,17 @@ void matrix_init_kb(void); void matrix_scan_kb(void); void matrix_init_user(void); void matrix_scan_user(void); +uint16_t get_record_keycode(keyrecord_t *record); +uint16_t get_event_keycode(keyevent_t event); bool process_action_kb(keyrecord_t *record); bool process_record_kb(uint16_t keycode, keyrecord_t *record); bool process_record_user(uint16_t keycode, keyrecord_t *record); #ifndef BOOTMAGIC_LITE_COLUMN - #define BOOTMAGIC_LITE_COLUMN 0 + #define BOOTMAGIC_LITE_COLUMN 0 #endif #ifndef BOOTMAGIC_LITE_ROW - #define BOOTMAGIC_LITE_ROW 0 + #define BOOTMAGIC_LITE_ROW 0 #endif void bootmagic_lite(void); @@ -240,14 +247,19 @@ void reset_keyboard(void); void startup_user(void); void shutdown_user(void); -void register_code16 (uint16_t code); -void unregister_code16 (uint16_t code); +void register_code16(uint16_t code); +void unregister_code16(uint16_t code); +void tap_code16(uint16_t code); #ifdef BACKLIGHT_ENABLE void backlight_init_ports(void); void backlight_task(void); +void backlight_task_internal(void); +void backlight_on(uint8_t backlight_pin); +void backlight_off(uint8_t backlight_pin); -#ifdef BACKLIGHT_BREATHING + #ifdef BACKLIGHT_BREATHING +void breathing_task(void); void breathing_enable(void); void breathing_pulse(void); void breathing_disable(void); @@ -260,9 +272,9 @@ void breathing_period_default(void); void breathing_period_set(uint8_t value); void breathing_period_inc(void); void breathing_period_dec(void); + #endif #endif -#endif void send_dword(uint32_t number); void send_word(uint16_t number); void send_byte(uint8_t number); @@ -273,5 +285,3 @@ void led_set_user(uint8_t usb_led); void led_set_kb(uint8_t usb_led); void api_send_unicode(uint32_t unicode); - -#endif diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index e983798f2ba..207e0a8261b 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -81,16 +81,15 @@ enum quantum_keycodes { #endif QK_MOD_TAP = 0x6000, QK_MOD_TAP_MAX = 0x7FFF, -#if defined(UNICODEMAP_ENABLE) && defined(UNICODE_ENABLE) - #error "Cannot enable both UNICODEMAP && UNICODE" -#endif #ifdef UNICODE_ENABLE QK_UNICODE = 0x8000, QK_UNICODE_MAX = 0xFFFF, #endif #ifdef UNICODEMAP_ENABLE - QK_UNICODE_MAP = 0x8000, - QK_UNICODE_MAP_MAX = 0x83FF, + QK_UNICODEMAP = 0x8000, + QK_UNICODEMAP_MAX = 0xBFFF, + QK_UNICODEMAP_PAIR = 0xC000, + QK_UNICODEMAP_PAIR_MAX = 0xFFFF, #endif // Loose keycodes - to be used directly @@ -425,6 +424,9 @@ enum quantum_keycodes { RGB_MODE_GRADIENT, RGB_MODE_RGBTEST, + //Momentum matching toggle + VLK_TOG, + // Left shift, open paren KC_LSPO, @@ -454,6 +456,42 @@ enum quantum_keycodes { TERM_OFF, #endif + EEPROM_RESET, + + UNICODE_MODE_FORWARD, + UNICODE_MODE_REVERSE, + UNICODE_MODE_OSX, + UNICODE_MODE_LNX, + UNICODE_MODE_WIN, + UNICODE_MODE_BSD, + UNICODE_MODE_WINC, + + HPT_ON, + HPT_OFF, + HPT_TOG, + HPT_RST, + HPT_FBK, + HPT_BUZ, + HPT_MODI, + HPT_MODD, + HPT_DWLI, + HPT_DWLD, + + // Left control, open paren + KC_LCPO, + + // Right control, close paren + KC_RCPC, + + // Left control, open paren + KC_LAPO, + + // Right control, close paren + KC_RAPC, + + CMB_ON, + CMB_OFF, + CMB_TOG, // always leave at the end SAFE_RANGE }; @@ -468,6 +506,7 @@ enum quantum_keycodes { #define RCTL(kc) (QK_RCTL | (kc)) #define RSFT(kc) (QK_RSFT | (kc)) #define RALT(kc) (QK_RALT | (kc)) +#define ALGR(kc) RALT(kc) #define RGUI(kc) (QK_RGUI | (kc)) #define RCMD(kc) RGUI(kc) #define RWIN(kc) RGUI(kc) @@ -475,15 +514,13 @@ enum quantum_keycodes { #define HYPR(kc) (QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI | (kc)) #define MEH(kc) (QK_LCTL | QK_LSFT | QK_LALT | (kc)) #define LCAG(kc) (QK_LCTL | QK_LALT | QK_LGUI | (kc)) -#define ALTG(kc) (QK_RCTL | QK_RALT | (kc)) #define SGUI(kc) (QK_LGUI | QK_LSFT | (kc)) #define SCMD(kc) SGUI(kc) #define SWIN(kc) SGUI(kc) -#define LCA(kc) (QK_LCTL | QK_LALT | (kc)) - -#define MOD_HYPR 0xf -#define MOD_MEH 0x7 +#define LCA(kc) (QK_LCTL | QK_LALT | (kc)) +#define MOD_HYPR 0xF +#define MOD_MEH 0x7 // Aliases for shifted symbols // Each key has a 4-letter code, and some have longer aliases too. @@ -560,9 +597,12 @@ enum quantum_keycodes { #define FUNC(kc) (QK_FUNCTION | (kc)) // Aliases +#define C(kc) LCTL(kc) #define S(kc) LSFT(kc) -#define F(kc) FUNC(kc) +#define A(kc) LALT(kc) +#define G(kc) LGUI(kc) +#define F(kc) FUNC(kc) #define M(kc) (QK_MACRO | (kc)) #define MACROTAP(kc) (QK_MACRO | (FUNC_TAP << 8) | (kc)) @@ -570,6 +610,8 @@ enum quantum_keycodes { #define KC_GESC GRAVE_ESC +#define EEP_RST EEPROM_RESET + #define CK_TOGG CLICKY_TOGGLE #define CK_RST CLICKY_RESET #define CK_UP CLICKY_UP @@ -578,7 +620,6 @@ enum quantum_keycodes { #define CK_OFF CLICKY_DISABLE #define RGB_MOD RGB_MODE_FORWARD -#define RGB_SMOD RGB_MODE_FORWARD #define RGB_RMOD RGB_MODE_REVERSE #define RGB_M_P RGB_MODE_PLAIN @@ -592,7 +633,7 @@ enum quantum_keycodes { #define RGB_M_T RGB_MODE_RGBTEST // L-ayer, T-ap - 256 keycode max, 16 layer max -#define LT(layer, kc) (QK_LAYER_TAP | ((layer & 0xF) << 8) | ((kc) & 0xFF)) +#define LT(layer, kc) (QK_LAYER_TAP | (((layer) & 0xF) << 8) | ((kc) & 0xFF)) #define AG_SWAP MAGIC_SWAP_ALT_GUI #define AG_NORM MAGIC_UNSWAP_ALT_GUI @@ -606,81 +647,89 @@ enum quantum_keycodes { // In fact, we changed it to assume ON_PRESS for sanity/simplicity. If needed, you can add your own // keycode modeled after the old version, kept below for this. /* #define TO(layer, when) (QK_TO | (when << 0x4) | (layer & 0xFF)) */ -#define TO(layer) (QK_TO | (ON_PRESS << 0x4) | (layer & 0xFF)) +#define TO(layer) (QK_TO | (ON_PRESS << 0x4) | ((layer) & 0xFF)) // Momentary switch layer - 256 layer max -#define MO(layer) (QK_MOMENTARY | (layer & 0xFF)) +#define MO(layer) (QK_MOMENTARY | ((layer) & 0xFF)) // Set default layer - 256 layer max -#define DF(layer) (QK_DEF_LAYER | (layer & 0xFF)) +#define DF(layer) (QK_DEF_LAYER | ((layer) & 0xFF)) // Toggle to layer - 256 layer max -#define TG(layer) (QK_TOGGLE_LAYER | (layer & 0xFF)) +#define TG(layer) (QK_TOGGLE_LAYER | ((layer) & 0xFF)) // One-shot layer - 256 layer max -#define OSL(layer) (QK_ONE_SHOT_LAYER | (layer & 0xFF)) +#define OSL(layer) (QK_ONE_SHOT_LAYER | ((layer) & 0xFF)) // L-ayer M-od: Momentary switch layer with modifiers active - 16 layer max, left mods only -#define LM(layer, mod) (QK_LAYER_MOD | ((layer & 0xF) << 4) | ((mod) & 0xF)) +#define LM(layer, mod) (QK_LAYER_MOD | (((layer) & 0xF) << 4) | ((mod) & 0xF)) // One-shot mod #define OSM(mod) (QK_ONE_SHOT_MOD | ((mod) & 0xFF)) // Layer tap-toggle -#define TT(layer) (QK_LAYER_TAP_TOGGLE | (layer & 0xFF)) +#define TT(layer) (QK_LAYER_TAP_TOGGLE | ((layer) & 0xFF)) // M-od, T-ap - 256 keycode max #define MT(mod, kc) (QK_MOD_TAP | (((mod) & 0x1F) << 8) | ((kc) & 0xFF)) -#define CTL_T(kc) MT(MOD_LCTL, kc) #define LCTL_T(kc) MT(MOD_LCTL, kc) #define RCTL_T(kc) MT(MOD_RCTL, kc) +#define CTL_T(kc) LCTL_T(kc) -#define SFT_T(kc) MT(MOD_LSFT, kc) #define LSFT_T(kc) MT(MOD_LSFT, kc) #define RSFT_T(kc) MT(MOD_RSFT, kc) +#define SFT_T(kc) LSFT_T(kc) -#define ALT_T(kc) MT(MOD_LALT, kc) #define LALT_T(kc) MT(MOD_LALT, kc) #define RALT_T(kc) MT(MOD_RALT, kc) -#define ALGR_T(kc) MT(MOD_RALT, kc) // dual-function AltGR +#define ALT_T(kc) LALT_T(kc) +#define ALGR_T(kc) RALT_T(kc) -#define GUI_T(kc) MT(MOD_LGUI, kc) -#define CMD_T(kc) GUI_T(kc) -#define WIN_T(kc) GUI_T(kc) #define LGUI_T(kc) MT(MOD_LGUI, kc) +#define RGUI_T(kc) MT(MOD_RGUI, kc) #define LCMD_T(kc) LGUI_T(kc) #define LWIN_T(kc) LGUI_T(kc) -#define RGUI_T(kc) MT(MOD_RGUI, kc) #define RCMD_T(kc) RGUI_T(kc) #define RWIN_T(kc) RGUI_T(kc) - -#define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Control + Shift e.g. for gnome-terminal -#define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl -#define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left control alt and gui -#define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right control alt and gui -#define ALL_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ -#define SGUI_T(kc) MT(MOD_LGUI | MOD_LSFT, kc) +#define GUI_T(kc) LGUI_T(kc) +#define CMD_T(kc) LCMD_T(kc) +#define WIN_T(kc) LWIN_T(kc) + +#define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Left Control + Shift e.g. for gnome-terminal +#define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, kc) // Meh is a less hyper version of the Hyper key -- doesn't include GUI, so just Left Control + Shift + Alt +#define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left Control + Alt + GUI +#define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right Control + Alt + GUI +#define HYPR_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ +#define SGUI_T(kc) MT(MOD_LGUI | MOD_LSFT, kc) // Left Shift + GUI #define SCMD_T(kc) SGUI_T(kc) #define SWIN_T(kc) SGUI_T(kc) -#define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left control and left alt +#define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left Control + Alt +#define ALL_T(kc) HYPR_T(kc) // Dedicated keycode versions for Hyper and Meh, if you want to use them as standalone keys rather than mod-tap #define KC_HYPR HYPR(KC_NO) #define KC_MEH MEH(KC_NO) #ifdef UNICODE_ENABLE - // For sending unicode codes. - // You may not send codes over 7FFF -- this supports most of UTF8. - // To have a key that sends out Œ, go UC(0x0152) - #define UNICODE(n) (QK_UNICODE | (n)) - #define UC(n) UNICODE(n) + // Allows Unicode input up to 0x7FFF + #define UC(c) (QK_UNICODE | (c)) #endif - #ifdef UNICODEMAP_ENABLE - #define X(n) (QK_UNICODE_MAP | (n)) + // Allows Unicode input up to 0x10FFFF, requires unicode_map + #define X(i) (QK_UNICODEMAP | (i)) + #define XP(i, j) (QK_UNICODEMAP_PAIR | ((i) & 0x7F) | (((j) & 0x7F) << 7)) // 127 max i and j #endif +#define UC_MOD UNICODE_MODE_FORWARD +#define UC_RMOD UNICODE_MODE_REVERSE + +#define UC_M_OS UNICODE_MODE_OSX +#define UC_M_LN UNICODE_MODE_LNX +#define UC_M_WI UNICODE_MODE_WIN +#define UC_M_BS UNICODE_MODE_BSD +#define UC_M_WC UNICODE_MODE_WINC + #ifdef SWAP_HANDS_ENABLE #define SH_T(kc) (QK_SWAP_HANDS | (kc)) #define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE) diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 26ee57f5c2c..f649525ccb6 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -24,722 +24,378 @@ #include #include -rgb_config_t rgb_matrix_config; +#include "lib/lib8tion/lib8tion.h" -#ifndef MAX - #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) +#ifndef RGB_MATRIX_CENTER + const point_t k_rgb_matrix_center = { 112, 32 }; +#else + const point_t k_rgb_matrix_center = RGB_MATRIX_CENTER; #endif -#ifndef MIN - #define MIN(a,b) ((a) < (b)? (a): (b)) +// Generic effect runners +#include "rgb_matrix_runners/effect_runner_dx_dy_dist.h" +#include "rgb_matrix_runners/effect_runner_dx_dy.h" +#include "rgb_matrix_runners/effect_runner_i.h" +#include "rgb_matrix_runners/effect_runner_sin_cos_i.h" +#include "rgb_matrix_runners/effect_runner_reactive.h" +#include "rgb_matrix_runners/effect_runner_reactive_splash.h" + +// ------------------------------------------ +// -----Begin rgb effect includes macros----- +#define RGB_MATRIX_EFFECT(name) +#define RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +#include "rgb_matrix_animations/rgb_matrix_effects.inc" +#ifdef RGB_MATRIX_CUSTOM_KB + #include "rgb_matrix_kb.inc" +#endif +#ifdef RGB_MATRIX_CUSTOM_USER + #include "rgb_matrix_user.inc" #endif +#undef RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#undef RGB_MATRIX_EFFECT +// -----End rgb effect includes macros------- +// ------------------------------------------ + #ifndef RGB_DISABLE_AFTER_TIMEOUT - #define RGB_DISABLE_AFTER_TIMEOUT 0 + #define RGB_DISABLE_AFTER_TIMEOUT 0 #endif #ifndef RGB_DISABLE_WHEN_USB_SUSPENDED - #define RGB_DISABLE_WHEN_USB_SUSPENDED false + #define RGB_DISABLE_WHEN_USB_SUSPENDED false #endif -#ifndef EECONFIG_RGB_MATRIX - #define EECONFIG_RGB_MATRIX EECONFIG_RGBLIGHT +#if !defined(RGB_MATRIX_MAXIMUM_BRIGHTNESS) || RGB_MATRIX_MAXIMUM_BRIGHTNESS > UINT8_MAX + #undef RGB_MATRIX_MAXIMUM_BRIGHTNESS + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX #endif -#if !defined(RGB_MATRIX_MAXIMUM_BRIGHTNESS) || RGB_MATRIX_MAXIMUM_BRIGHTNESS > 255 - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 +#if !defined(RGB_MATRIX_HUE_STEP) + #define RGB_MATRIX_HUE_STEP 8 #endif -#ifndef RGB_DIGITAL_RAIN_DROPS - // lower the number for denser effect/wider keyboard - #define RGB_DIGITAL_RAIN_DROPS 24 +#if !defined(RGB_MATRIX_SAT_STEP) + #define RGB_MATRIX_SAT_STEP 16 #endif -bool g_suspend_state = false; +#if !defined(RGB_MATRIX_VAL_STEP) + #define RGB_MATRIX_VAL_STEP 16 +#endif -// Global tick at 20 Hz -uint32_t g_tick = 0; +#if !defined(RGB_MATRIX_SPD_STEP) + #define RGB_MATRIX_SPD_STEP 16 +#endif -// Ticks since this key was last hit. -uint8_t g_key_hit[DRIVER_LED_TOTAL]; +#if !defined(RGB_MATRIX_STARTUP_MODE) + #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT + #else + // fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR + #endif +#endif -// Ticks since any key was last hit. -uint32_t g_any_key_hit = 0; +bool g_suspend_state = false; -#ifndef PI -#define PI 3.14159265 +rgb_config_t rgb_matrix_config; + +rgb_counters_t g_rgb_counters; +static uint32_t rgb_counters_buffer; + +#ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS +uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS] = {{0}}; #endif -uint32_t eeconfig_read_rgb_matrix(void) { - return eeprom_read_dword(EECONFIG_RGB_MATRIX); +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED + last_hit_t g_last_hit_tracker; + static last_hit_t last_hit_buffer; +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED + +void eeconfig_read_rgb_matrix(void) { + eeprom_read_block(&rgb_matrix_config, EECONFIG_RGB_MATRIX, sizeof(rgb_matrix_config)); } -void eeconfig_update_rgb_matrix(uint32_t val) { - eeprom_update_dword(EECONFIG_RGB_MATRIX, val); + +void eeconfig_update_rgb_matrix(void) { + eeprom_update_block(&rgb_matrix_config, EECONFIG_RGB_MATRIX, sizeof(rgb_matrix_config)); } + void eeconfig_update_rgb_matrix_default(void) { dprintf("eeconfig_update_rgb_matrix_default\n"); rgb_matrix_config.enable = 1; - rgb_matrix_config.mode = RGB_MATRIX_CYCLE_LEFT_RIGHT; - rgb_matrix_config.hue = 0; - rgb_matrix_config.sat = 255; - rgb_matrix_config.val = RGB_MATRIX_MAXIMUM_BRIGHTNESS; - rgb_matrix_config.speed = 0; - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); + rgb_matrix_config.mode = RGB_MATRIX_STARTUP_MODE; + rgb_matrix_config.hsv = (HSV){ 0, UINT8_MAX, RGB_MATRIX_MAXIMUM_BRIGHTNESS }; + rgb_matrix_config.speed = UINT8_MAX / 2; + eeconfig_update_rgb_matrix(); } + void eeconfig_debug_rgb_matrix(void) { dprintf("rgb_matrix_config eprom\n"); dprintf("rgb_matrix_config.enable = %d\n", rgb_matrix_config.enable); dprintf("rgb_matrix_config.mode = %d\n", rgb_matrix_config.mode); - dprintf("rgb_matrix_config.hue = %d\n", rgb_matrix_config.hue); - dprintf("rgb_matrix_config.sat = %d\n", rgb_matrix_config.sat); - dprintf("rgb_matrix_config.val = %d\n", rgb_matrix_config.val); + dprintf("rgb_matrix_config.hsv.h = %d\n", rgb_matrix_config.hsv.h); + dprintf("rgb_matrix_config.hsv.s = %d\n", rgb_matrix_config.hsv.s); + dprintf("rgb_matrix_config.hsv.v = %d\n", rgb_matrix_config.hsv.v); dprintf("rgb_matrix_config.speed = %d\n", rgb_matrix_config.speed); } -// Last led hit -#define LED_HITS_TO_REMEMBER 8 -uint8_t g_last_led_hit[LED_HITS_TO_REMEMBER] = {255}; -uint8_t g_last_led_count = 0; - -void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led_i, uint8_t *led_count) { - rgb_led led; - *led_count = 0; +__attribute__ ((weak)) +uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { + return 0; +} - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - // map_index_to_led(i, &led); - led = g_rgb_leds[i]; - if (row == led.matrix_co.row && column == led.matrix_co.col) { - led_i[*led_count] = i; - (*led_count)++; - } - } +uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) { + uint8_t led_count = rgb_matrix_map_row_column_to_led_kb(row, column, led_i); + uint8_t led_index = g_led_config.matrix_co[row][column]; + if (led_index != NO_LED) { + led_i[led_count] = led_index; + led_count++; + } + return led_count; } void rgb_matrix_update_pwm_buffers(void) { - rgb_matrix_driver.flush(); + rgb_matrix_driver.flush(); } void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { - rgb_matrix_driver.set_color(index, red, green, blue); + rgb_matrix_driver.set_color(index, red, green, blue); } void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { - rgb_matrix_driver.set_color_all(red, green, blue); + rgb_matrix_driver.set_color_all(red, green, blue); } bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { - if ( record->event.pressed ) { - uint8_t led[8], led_count; - map_row_column_to_led(record->event.key.row, record->event.key.col, led, &led_count); - if (led_count > 0) { - for (uint8_t i = LED_HITS_TO_REMEMBER; i > 1; i--) { - g_last_led_hit[i - 1] = g_last_led_hit[i - 2]; - } - g_last_led_hit[0] = led[0]; - g_last_led_count = MIN(LED_HITS_TO_REMEMBER, g_last_led_count + 1); - } - for(uint8_t i = 0; i < led_count; i++) - g_key_hit[led[i]] = 0; - g_any_key_hit = 0; - } else { - #ifdef RGB_MATRIX_KEYRELEASES - uint8_t led[8], led_count; - map_row_column_to_led(record->event.key.row, record->event.key.col, led, &led_count); - for(uint8_t i = 0; i < led_count; i++) - g_key_hit[led[i]] = 255; - - g_any_key_hit = 255; - #endif - } - return true; -} - -void rgb_matrix_set_suspend_state(bool state) { - g_suspend_state = state; -} - -void rgb_matrix_test(void) { - // Mask out bits 4 and 5 - // Increase the factor to make the test animation slower (and reduce to make it faster) - uint8_t factor = 10; - switch ( (g_tick & (0b11 << factor)) >> factor ) - { - case 0: - { - rgb_matrix_set_color_all( 20, 0, 0 ); - break; - } - case 1: - { - rgb_matrix_set_color_all( 0, 20, 0 ); - break; - } - case 2: - { - rgb_matrix_set_color_all( 0, 0, 20 ); - break; - } - case 3: - { - rgb_matrix_set_color_all( 20, 20, 20 ); - break; - } - } -} - -// All LEDs off -void rgb_matrix_all_off(void) { - rgb_matrix_set_color_all( 0, 0, 0 ); -} - -// Solid color -void rgb_matrix_solid_color(void) { - HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; - RGB rgb = hsv_to_rgb( hsv ); - rgb_matrix_set_color_all( rgb.r, rgb.g, rgb.b ); -} - -void rgb_matrix_solid_reactive(void) { - // Relies on hue being 8-bit and wrapping - for ( int i=0; ievent.pressed) { + led_count = rgb_matrix_map_row_column_to_led(record->event.key.row, record->event.key.col, led); + g_rgb_counters.any_key_hit = 0; + } +#elif defined(RGB_MATRIX_KEYPRESSES) + if (record->event.pressed) { + led_count = rgb_matrix_map_row_column_to_led(record->event.key.row, record->event.key.col, led); + g_rgb_counters.any_key_hit = 0; + } +#endif // defined(RGB_MATRIX_KEYRELEASES) + + if (last_hit_buffer.count + led_count > LED_HITS_TO_REMEMBER) { + memcpy(&last_hit_buffer.x[0], &last_hit_buffer.x[led_count], LED_HITS_TO_REMEMBER - led_count); + memcpy(&last_hit_buffer.y[0], &last_hit_buffer.y[led_count], LED_HITS_TO_REMEMBER - led_count); + memcpy(&last_hit_buffer.tick[0], &last_hit_buffer.tick[led_count], (LED_HITS_TO_REMEMBER - led_count) * 2); // 16 bit + memcpy(&last_hit_buffer.index[0], &last_hit_buffer.index[led_count], LED_HITS_TO_REMEMBER - led_count); + last_hit_buffer.count--; + } -// alphas = color1, mods = color2 -void rgb_matrix_alphas_mods(void) { + for(uint8_t i = 0; i < led_count; i++) { + uint8_t index = last_hit_buffer.count; + last_hit_buffer.x[index] = g_led_config.point[led[i]].x; + last_hit_buffer.y[index] = g_led_config.point[led[i]].y; + last_hit_buffer.index[index] = led[i]; + last_hit_buffer.tick[index] = 0; + last_hit_buffer.count++; + } +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED - RGB rgb1 = hsv_to_rgb( (HSV){ .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val } ); - RGB rgb2 = hsv_to_rgb( (HSV){ .h = (rgb_matrix_config.hue + 180) % 360, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val } ); +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) + if (rgb_matrix_config.mode == RGB_MATRIX_TYPING_HEATMAP) { + process_rgb_matrix_typing_heatmap(record); + } +#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) - rgb_led led; - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if ( led.matrix_co.raw < 0xFF ) { - if ( led.modifier ) - { - rgb_matrix_set_color( i, rgb2.r, rgb2.g, rgb2.b ); - } - else - { - rgb_matrix_set_color( i, rgb1.r, rgb1.g, rgb1.b ); - } - } - } + return true; } -void rgb_matrix_gradient_up_down(void) { - int16_t h1 = rgb_matrix_config.hue; - int16_t h2 = (rgb_matrix_config.hue + 180) % 360; - int16_t deltaH = h2 - h1; - - // Take the shortest path between hues - if ( deltaH > 127 ) - { - deltaH -= 256; - } - else if ( deltaH < -127 ) - { - deltaH += 256; - } - // Divide delta by 4, this gives the delta per row - deltaH /= 4; - - int16_t s1 = rgb_matrix_config.sat; - int16_t s2 = rgb_matrix_config.hue; - int16_t deltaS = ( s2 - s1 ) / 4; - - HSV hsv = { .h = 0, .s = 255, .v = rgb_matrix_config.val }; - RGB rgb; - Point point; - for ( int i=0; i>4); - // Relies on hue being 8-bit and wrapping - hsv.h = rgb_matrix_config.hue + ( deltaH * y ); - hsv.s = rgb_matrix_config.sat + ( deltaS * y ); - rgb = hsv_to_rgb( hsv ); - rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -void rgb_matrix_raindrops(bool initialize) { - int16_t h1 = rgb_matrix_config.hue; - int16_t h2 = (rgb_matrix_config.hue + 180) % 360; - int16_t deltaH = h2 - h1; - deltaH /= 4; - - // Take the shortest path between hues - if ( deltaH > 127 ) - { - deltaH -= 256; - } - else if ( deltaH < -127 ) - { - deltaH += 256; +void rgb_matrix_test(void) { + // Mask out bits 4 and 5 + // Increase the factor to make the test animation slower (and reduce to make it faster) + uint8_t factor = 10; + switch ( (g_rgb_counters.tick & (0b11 << factor)) >> factor ) + { + case 0: { + rgb_matrix_set_color_all( 20, 0, 0 ); + break; } - - int16_t s1 = rgb_matrix_config.sat; - int16_t s2 = rgb_matrix_config.sat; - int16_t deltaS = ( s2 - s1 ) / 4; - - HSV hsv; - RGB rgb; - - // Change one LED every tick, make sure speed is not 0 - uint8_t led_to_change = ( g_tick & ( 0x0A / (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed) ) ) == 0 ? rand() % (DRIVER_LED_TOTAL) : 255; - - for ( int i=0; iinit) { + return false; + } -void rgb_matrix_dual_beacon(void) { - HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; - RGB rgb; - Point point; - double cos_value = cos(g_tick * PI / 128) / 32; - double sin_value = sin(g_tick * PI / 128) / 112; - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - point = g_rgb_leds[i].point; - hsv.h = ((point.y - 32.0)* cos_value + (point.x - 112.0) * sin_value) * (180) + rgb_matrix_config.hue; - rgb = hsv_to_rgb( hsv ); - rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); - } + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (uint8_t i = led_min; i < led_max; i++) { + rgb_matrix_set_color(i, 0, 0, 0); + } + return led_max < DRIVER_LED_TOTAL; } -void rgb_matrix_rainbow_beacon(void) { - HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; - RGB rgb; - Point point; - double cos_value = cos(g_tick * PI / 128); - double sin_value = sin(g_tick * PI / 128); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - point = g_rgb_leds[i].point; - hsv.h = (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (point.y - 32.0)* cos_value + (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (point.x - 112.0) * sin_value + rgb_matrix_config.hue; - rgb = hsv_to_rgb( hsv ); - rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} +static uint8_t rgb_last_enable = UINT8_MAX; +static uint8_t rgb_last_effect = UINT8_MAX; +static effect_params_t rgb_effect_params = { 0, 0xFF }; +static rgb_task_states rgb_task_state = SYNCING; -void rgb_matrix_rainbow_pinwheels(void) { - HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; - RGB rgb; - Point point; - double cos_value = cos(g_tick * PI / 128); - double sin_value = sin(g_tick * PI / 128); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - point = g_rgb_leds[i].point; - hsv.h = (2 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (point.y - 32.0)* cos_value + (2 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (66 - abs(point.x - 112.0)) * sin_value + rgb_matrix_config.hue; - rgb = hsv_to_rgb( hsv ); - rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); +static void rgb_task_timers(void) { + // Update double buffer timers + uint16_t deltaTime = timer_elapsed32(rgb_counters_buffer); + rgb_counters_buffer = timer_read32(); + if (g_rgb_counters.any_key_hit < UINT32_MAX) { + if (UINT32_MAX - deltaTime < g_rgb_counters.any_key_hit) { + g_rgb_counters.any_key_hit = UINT32_MAX; + } else { + g_rgb_counters.any_key_hit += deltaTime; } -} + } -void rgb_matrix_rainbow_moving_chevron(void) { - HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; - RGB rgb; - Point point; - uint8_t r = 128; - double cos_value = cos(r * PI / 128); - double sin_value = sin(r * PI / 128); - double multiplier = (g_tick / 256.0 * 224); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - point = g_rgb_leds[i].point; - hsv.h = (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * abs(point.y - 32.0)* sin_value + (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (point.x - multiplier) * cos_value + rgb_matrix_config.hue; - rgb = hsv_to_rgb( hsv ); - rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); + // Update double buffer last hit timers +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED + uint8_t count = last_hit_buffer.count; + for (uint8_t i = 0; i < count; ++i) { + if (UINT16_MAX - deltaTime < last_hit_buffer.tick[i]) { + last_hit_buffer.count--; + continue; } -} - - -void rgb_matrix_jellybean_raindrops( bool initialize ) { - HSV hsv; - RGB rgb; + last_hit_buffer.tick[i] += deltaTime; + } +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +} + +static void rgb_task_sync(void) { + // next task + if (timer_elapsed32(g_rgb_counters.tick) >= RGB_MATRIX_LED_FLUSH_LIMIT) + rgb_task_state = STARTING; +} + +static void rgb_task_start(void) { + // reset iter + rgb_effect_params.iter = 0; + + // update double buffers + g_rgb_counters.tick = rgb_counters_buffer; +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED + g_last_hit_tracker = last_hit_buffer; +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED + + // next task + rgb_task_state = RENDERING; +} + +static void rgb_task_render(uint8_t effect) { + bool rendering = false; + rgb_effect_params.init = (effect != rgb_last_effect) || (rgb_matrix_config.enable != rgb_last_enable); + + // each effect can opt to do calculations + // and/or request PWM buffer updates. + switch (effect) { + case RGB_MATRIX_NONE: + rendering = rgb_matrix_none(&rgb_effect_params); + break; + +// --------------------------------------------- +// -----Begin rgb effect switch case macros----- +#define RGB_MATRIX_EFFECT(name, ...) \ + case RGB_MATRIX_##name: \ + rendering = name(&rgb_effect_params); \ + break; +#include "rgb_matrix_animations/rgb_matrix_effects.inc" +#undef RGB_MATRIX_EFFECT + +#if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) + #define RGB_MATRIX_EFFECT(name, ...) \ + case RGB_MATRIX_CUSTOM_##name: \ + rendering = name(&rgb_effect_params); \ + break; + #ifdef RGB_MATRIX_CUSTOM_KB + #include "rgb_matrix_kb.inc" + #endif + #ifdef RGB_MATRIX_CUSTOM_USER + #include "rgb_matrix_user.inc" + #endif + #undef RGB_MATRIX_EFFECT +#endif +// -----End rgb effect switch case macros------- +// --------------------------------------------- - // Change one LED every tick, make sure speed is not 0 - uint8_t led_to_change = ( g_tick & ( 0x0A / (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed) ) ) == 0 ? rand() % (DRIVER_LED_TOTAL) : 255; + // Factory default magic value + case UINT8_MAX: { + rgb_matrix_test(); + rgb_task_state = FLUSHING; + } + return; + } - for ( int i=0; i 0 && map[col][row] < max_intensity) { - // neither fully bright nor dark, decay it - map[col][row]--; - } - // set the pixel colour - uint8_t led, led_count; - map_row_column_to_led(row, col, &led, &led_count); - - if (map[col][row] > pure_green_intensity) { - const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost - * (map[col][row] - pure_green_intensity) / (max_intensity - pure_green_intensity)); - rgb_matrix_set_color(led, boost, max_intensity, boost); - } - else { - const uint8_t green = (uint8_t) ((uint16_t) max_intensity * map[col][row] / pure_green_intensity); - rgb_matrix_set_color(led, 0, green, 0); - } - } - } - if (++drop > drop_ticks) { - // reset drop timer - drop = 0; - for (uint8_t row = MATRIX_ROWS - 1; row > 0; row--) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - // if ths is on the bottom row and bright allow decay - if (row == MATRIX_ROWS - 1 && map[col][row] == max_intensity) { - map[col][row]--; - } - // check if the pixel above is bright - if (map[col][row - 1] == max_intensity) { - // allow old bright pixel to decay - map[col][row - 1]--; - // make this pixel bright - map[col][row] = max_intensity; - } - } - } - } -} + // update pwm buffers + rgb_matrix_update_pwm_buffers(); -void rgb_matrix_multisplash(void) { - // if (g_any_key_hit < 0xFF) { - HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; - RGB rgb; - rgb_led led; - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - uint16_t c = 0, d = 0; - rgb_led last_led; - // if (g_last_led_count) { - for (uint8_t last_i = 0; last_i < g_last_led_count; last_i++) { - last_led = g_rgb_leds[g_last_led_hit[last_i]]; - uint16_t dist = (uint16_t)sqrt(pow(led.point.x - last_led.point.x, 2) + pow(led.point.y - last_led.point.y, 2)); - uint16_t effect = (g_key_hit[g_last_led_hit[last_i]] << 2) - dist; - c += MIN(MAX(effect, 0), 255); - d += 255 - MIN(MAX(effect, 0), 255); - } - // } else { - // d = 255; - // } - hsv.h = (rgb_matrix_config.hue + c) % 256; - hsv.v = MAX(MIN(d, 255), 0); - rgb = hsv_to_rgb( hsv ); - rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); - } - // } else { - // rgb_matrix_set_color_all( 0, 0, 0 ); - // } -} - - -void rgb_matrix_splash(void) { - g_last_led_count = MIN(g_last_led_count, 1); - rgb_matrix_multisplash(); -} - - -void rgb_matrix_solid_multisplash(void) { - // if (g_any_key_hit < 0xFF) { - HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; - RGB rgb; - rgb_led led; - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - uint16_t d = 0; - rgb_led last_led; - // if (g_last_led_count) { - for (uint8_t last_i = 0; last_i < g_last_led_count; last_i++) { - last_led = g_rgb_leds[g_last_led_hit[last_i]]; - uint16_t dist = (uint16_t)sqrt(pow(led.point.x - last_led.point.x, 2) + pow(led.point.y - last_led.point.y, 2)); - uint16_t effect = (g_key_hit[g_last_led_hit[last_i]] << 2) - dist; - d += 255 - MIN(MAX(effect, 0), 255); - } - // } else { - // d = 255; - // } - hsv.v = MAX(MIN(d, 255), 0); - rgb = hsv_to_rgb( hsv ); - rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); - } - // } else { - // rgb_matrix_set_color_all( 0, 0, 0 ); - // } -} - - -void rgb_matrix_solid_splash(void) { - g_last_led_count = MIN(g_last_led_count, 1); - rgb_matrix_solid_multisplash(); -} - - -// Needs eeprom access that we don't have setup currently - -void rgb_matrix_custom(void) { -// HSV hsv; -// RGB rgb; -// for ( int i=0; i 0 && g_any_key_hit > RGB_DISABLE_AFTER_TIMEOUT * 60 * 20)); - uint8_t effect = suspend_backlight ? 0 : rgb_matrix_config.mode; - - // Keep track of the effect used last time, - // detect change in effect, so each effect can - // have an optional initialization. - static uint8_t effect_last = 255; - bool initialize = (effect != effect_last) || (rgb_matrix_config.enable != toggle_enable_last); - effect_last = effect; - toggle_enable_last = rgb_matrix_config.enable; - - // this gets ticked at 20 Hz. - // each effect can opt to do calculations - // and/or request PWM buffer updates. - switch ( effect ) { - case RGB_MATRIX_SOLID_COLOR: - rgb_matrix_solid_color(); - break; - case RGB_MATRIX_ALPHAS_MODS: - rgb_matrix_alphas_mods(); - break; - case RGB_MATRIX_DUAL_BEACON: - rgb_matrix_dual_beacon(); - break; - case RGB_MATRIX_GRADIENT_UP_DOWN: - rgb_matrix_gradient_up_down(); - break; - case RGB_MATRIX_RAINDROPS: - rgb_matrix_raindrops( initialize ); - break; - case RGB_MATRIX_CYCLE_ALL: - rgb_matrix_cycle_all(); - break; - case RGB_MATRIX_CYCLE_LEFT_RIGHT: - rgb_matrix_cycle_left_right(); - break; - case RGB_MATRIX_CYCLE_UP_DOWN: - rgb_matrix_cycle_up_down(); - break; - case RGB_MATRIX_RAINBOW_BEACON: - rgb_matrix_rainbow_beacon(); - break; - case RGB_MATRIX_RAINBOW_PINWHEELS: - rgb_matrix_rainbow_pinwheels(); - break; - case RGB_MATRIX_RAINBOW_MOVING_CHEVRON: - rgb_matrix_rainbow_moving_chevron(); - break; - case RGB_MATRIX_JELLYBEAN_RAINDROPS: - rgb_matrix_jellybean_raindrops( initialize ); - break; - case RGB_MATRIX_DIGITAL_RAIN: - rgb_matrix_digital_rain( initialize ); - break; - #ifdef RGB_MATRIX_KEYPRESSES - case RGB_MATRIX_SOLID_REACTIVE: - rgb_matrix_solid_reactive(); - break; - case RGB_MATRIX_SPLASH: - rgb_matrix_splash(); - break; - case RGB_MATRIX_MULTISPLASH: - rgb_matrix_multisplash(); - break; - case RGB_MATRIX_SOLID_SPLASH: - rgb_matrix_solid_splash(); - break; - case RGB_MATRIX_SOLID_MULTISPLASH: - rgb_matrix_solid_multisplash(); - break; - #endif - default: - rgb_matrix_custom(); - break; - } - - if ( ! suspend_backlight ) { - rgb_matrix_indicators(); - } + rgb_task_timers(); + + // Ideally we would also stop sending zeros to the LED driver PWM buffers + // while suspended and just do a software shutdown. This is a cheap hack for now. + bool suspend_backlight = ((g_suspend_state && RGB_DISABLE_WHEN_USB_SUSPENDED) || (RGB_DISABLE_AFTER_TIMEOUT > 0 && g_rgb_counters.any_key_hit > RGB_DISABLE_AFTER_TIMEOUT * 60 * 20)); + uint8_t effect = suspend_backlight || !rgb_matrix_config.enable ? 0 : rgb_matrix_config.mode; + + switch (rgb_task_state) { + case STARTING: + rgb_task_start(); + break; + case RENDERING: + rgb_task_render(effect); + break; + case FLUSHING: + rgb_task_flush(effect); + break; + case SYNCING: + rgb_task_sync(); + break; + } + if (!suspend_backlight) { + rgb_matrix_indicators(); + } } void rgb_matrix_indicators(void) { - rgb_matrix_indicators_kb(); - rgb_matrix_indicators_user(); + rgb_matrix_indicators_kb(); + rgb_matrix_indicators_user(); } __attribute__((weak)) @@ -748,166 +404,158 @@ void rgb_matrix_indicators_kb(void) {} __attribute__((weak)) void rgb_matrix_indicators_user(void) {} - -// void rgb_matrix_set_indicator_index( uint8_t *index, uint8_t row, uint8_t column ) -// { -// if ( row >= MATRIX_ROWS ) -// { -// // Special value, 255=none, 254=all -// *index = row; -// } -// else -// { -// // This needs updated to something like -// // uint8_t led[8], led_count; -// // map_row_column_to_led(row,column,led,&led_count); -// // for(uint8_t i = 0; i < led_count; i++) -// map_row_column_to_led( row, column, index ); -// } -// } - void rgb_matrix_init(void) { rgb_matrix_driver.init(); // TODO: put the 1 second startup delay here? - // clear the key hits - for ( int led=0; ledh = eeprom_read_byte(address); -// hsv->s = eeprom_read_byte(address+1); -// hsv->v = eeprom_read_byte(address+2); -// } +void rgb_matrix_disable_noeeprom(void) { + if (rgb_matrix_config.enable) + rgb_task_state = STARTING; + rgb_matrix_config.enable = 0; +} -// void backlight_set_key_color( uint8_t row, uint8_t column, HSV hsv ) -// { -// uint8_t led[8], led_count; -// map_row_column_to_led(row,column,led,&led_count); -// for(uint8_t i = 0; i < led_count; i++) { -// if ( led[i] < DRIVER_LED_TOTAL ) -// { -// void *address = backlight_get_custom_key_color_eeprom_address(led[i]); -// eeprom_update_byte(address, hsv.h); -// eeprom_update_byte(address+1, hsv.s); -// eeprom_update_byte(address+2, hsv.v); -// } -// } -// } +void rgb_matrix_step(void) { + rgb_matrix_config.mode++; + if (rgb_matrix_config.mode >= RGB_MATRIX_EFFECT_MAX) + rgb_matrix_config.mode = 1; + rgb_task_state = STARTING; + eeconfig_update_rgb_matrix(); +} + +void rgb_matrix_step_reverse(void) { + rgb_matrix_config.mode--; + if (rgb_matrix_config.mode < 1) + rgb_matrix_config.mode = RGB_MATRIX_EFFECT_MAX - 1; + rgb_task_state = STARTING; + eeconfig_update_rgb_matrix(); +} -uint32_t rgb_matrix_get_tick(void) { - return g_tick; +void rgb_matrix_increase_hue(void) { + rgb_matrix_config.hsv.h += RGB_MATRIX_HUE_STEP; + eeconfig_update_rgb_matrix(); } -void rgblight_toggle(void) { - rgb_matrix_config.enable ^= 1; - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +void rgb_matrix_decrease_hue(void) { + rgb_matrix_config.hsv.h -= RGB_MATRIX_HUE_STEP; + eeconfig_update_rgb_matrix(); } -void rgblight_step(void) { - rgb_matrix_config.mode++; - if (rgb_matrix_config.mode >= RGB_MATRIX_EFFECT_MAX) - rgb_matrix_config.mode = 1; - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +void rgb_matrix_increase_sat(void) { + rgb_matrix_config.hsv.s = qadd8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP); + eeconfig_update_rgb_matrix(); } -void rgblight_step_reverse(void) { - rgb_matrix_config.mode--; - if (rgb_matrix_config.mode < 1) - rgb_matrix_config.mode = RGB_MATRIX_EFFECT_MAX - 1; - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +void rgb_matrix_decrease_sat(void) { + rgb_matrix_config.hsv.s = qsub8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP); + eeconfig_update_rgb_matrix(); } -void rgblight_increase_hue(void) { - rgb_matrix_config.hue = increment( rgb_matrix_config.hue, 8, 0, 255 ); - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +void rgb_matrix_increase_val(void) { + rgb_matrix_config.hsv.v = qadd8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP); + if (rgb_matrix_config.hsv.v > RGB_MATRIX_MAXIMUM_BRIGHTNESS) + rgb_matrix_config.hsv.v = RGB_MATRIX_MAXIMUM_BRIGHTNESS; + eeconfig_update_rgb_matrix(); } -void rgblight_decrease_hue(void) { - rgb_matrix_config.hue = decrement( rgb_matrix_config.hue, 8, 0, 255 ); - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +void rgb_matrix_decrease_val(void) { + rgb_matrix_config.hsv.v = qsub8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP); + eeconfig_update_rgb_matrix(); } -void rgblight_increase_sat(void) { - rgb_matrix_config.sat = increment( rgb_matrix_config.sat, 8, 0, 255 ); - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +void rgb_matrix_increase_speed(void) { + rgb_matrix_config.speed = qadd8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP); + eeconfig_update_rgb_matrix(); } -void rgblight_decrease_sat(void) { - rgb_matrix_config.sat = decrement( rgb_matrix_config.sat, 8, 0, 255 ); - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +void rgb_matrix_decrease_speed(void) { + rgb_matrix_config.speed = qsub8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP); + eeconfig_update_rgb_matrix(); } -void rgblight_increase_val(void) { - rgb_matrix_config.val = increment( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS ); - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +led_flags_t rgb_matrix_get_flags(void) { + return rgb_effect_params.flags; } -void rgblight_decrease_val(void) { - rgb_matrix_config.val = decrement( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS ); - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +void rgb_matrix_set_flags(led_flags_t flags) { + rgb_effect_params.flags = flags; } -void rgblight_increase_speed(void) { - rgb_matrix_config.speed = increment( rgb_matrix_config.speed, 1, 0, 3 ); - eeconfig_update_rgb_matrix(rgb_matrix_config.raw);//EECONFIG needs to be increased to support this +void rgb_matrix_mode(uint8_t mode) { + rgb_matrix_config.mode = mode; + rgb_task_state = STARTING; + eeconfig_update_rgb_matrix(); } -void rgblight_decrease_speed(void) { - rgb_matrix_config.speed = decrement( rgb_matrix_config.speed, 1, 0, 3 ); - eeconfig_update_rgb_matrix(rgb_matrix_config.raw);//EECONFIG needs to be increased to support this +void rgb_matrix_mode_noeeprom(uint8_t mode) { + rgb_matrix_config.mode = mode; } -void rgblight_mode(uint8_t mode) { - rgb_matrix_config.mode = mode; - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +uint8_t rgb_matrix_get_mode(void) { + return rgb_matrix_config.mode; } -uint32_t rgblight_get_mode(void) { - return rgb_matrix_config.mode; +void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { + rgb_matrix_sethsv_noeeprom(hue, sat, val); + eeconfig_update_rgb_matrix(); } -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { - rgb_matrix_config.hue = hue; - rgb_matrix_config.sat = sat; - rgb_matrix_config.val = val; - eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { + rgb_matrix_config.hsv.h = hue; + rgb_matrix_config.hsv.s = sat; + rgb_matrix_config.hsv.v = val; + if (rgb_matrix_config.hsv.v > RGB_MATRIX_MAXIMUM_BRIGHTNESS) + rgb_matrix_config.hsv.v = RGB_MATRIX_MAXIMUM_BRIGHTNESS; } diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index d2450a7d999..749926822a8 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -21,78 +21,77 @@ #include #include +#include "rgb_matrix_types.h" #include "color.h" #include "quantum.h" +#include "rgblight_list.h" #ifdef IS31FL3731 - #include "is31fl3731.h" + #include "is31fl3731.h" #elif defined (IS31FL3733) - #include "is31fl3733.h" + #include "is31fl3733.h" +#elif defined (IS31FL3737) + #include "is31fl3737.h" +#elif defined (WS2812) + #include "ws2812.h" #endif -typedef struct Point { - uint8_t x; - uint8_t y; -} __attribute__((packed)) Point; - -typedef struct rgb_led { - union { - uint8_t raw; - struct { - uint8_t row:4; // 16 max - uint8_t col:4; // 16 max - }; - } matrix_co; - Point point; - uint8_t modifier:1; -} __attribute__((packed)) rgb_led; - - -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; - -typedef struct -{ - HSV color; - uint8_t index; -} rgb_indicator; - -typedef union { - uint32_t raw; - struct { - bool enable :1; - uint8_t mode :6; - uint16_t hue :9; - uint8_t sat :8; - uint8_t val :8; - uint8_t speed :8;//EECONFIG needs to be increased to support this - }; -} rgb_config_t; +#ifndef RGB_MATRIX_LED_FLUSH_LIMIT + #define RGB_MATRIX_LED_FLUSH_LIMIT 16 +#endif + +#ifndef RGB_MATRIX_LED_PROCESS_LIMIT + #define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 +#endif + +#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL +#define RGB_MATRIX_USE_LIMITS(min, max) uint8_t min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; \ + uint8_t max = min + RGB_MATRIX_LED_PROCESS_LIMIT; \ + if (max > DRIVER_LED_TOTAL) \ + max = DRIVER_LED_TOTAL; +#else +#define RGB_MATRIX_USE_LIMITS(min, max) uint8_t min = 0; \ + uint8_t max = DRIVER_LED_TOTAL; +#endif + +#define RGB_MATRIX_TEST_LED_FLAGS() if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) continue enum rgb_matrix_effects { - RGB_MATRIX_SOLID_COLOR = 1, - RGB_MATRIX_ALPHAS_MODS, - RGB_MATRIX_DUAL_BEACON, - RGB_MATRIX_GRADIENT_UP_DOWN, - RGB_MATRIX_RAINDROPS, - RGB_MATRIX_CYCLE_ALL, - RGB_MATRIX_CYCLE_LEFT_RIGHT, - RGB_MATRIX_CYCLE_UP_DOWN, - RGB_MATRIX_RAINBOW_BEACON, - RGB_MATRIX_RAINBOW_PINWHEELS, - RGB_MATRIX_RAINBOW_MOVING_CHEVRON, - RGB_MATRIX_JELLYBEAN_RAINDROPS, - RGB_MATRIX_DIGITAL_RAIN, -#ifdef RGB_MATRIX_KEYPRESSES - RGB_MATRIX_SOLID_REACTIVE, - RGB_MATRIX_SPLASH, - RGB_MATRIX_MULTISPLASH, - RGB_MATRIX_SOLID_SPLASH, - RGB_MATRIX_SOLID_MULTISPLASH, + RGB_MATRIX_NONE = 0, + +// -------------------------------------- +// -----Begin rgb effect enum macros----- +#define RGB_MATRIX_EFFECT(name, ...) RGB_MATRIX_##name, +#include "rgb_matrix_animations/rgb_matrix_effects.inc" +#undef RGB_MATRIX_EFFECT + +#if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) + #define RGB_MATRIX_EFFECT(name, ...) RGB_MATRIX_CUSTOM_##name, + #ifdef RGB_MATRIX_CUSTOM_KB + #include "rgb_matrix_kb.inc" + #endif + #ifdef RGB_MATRIX_CUSTOM_USER + #include "rgb_matrix_user.inc" + #endif + #undef RGB_MATRIX_EFFECT #endif - RGB_MATRIX_EFFECT_MAX +// -------------------------------------- +// -----End rgb effect enum macros------- + + RGB_MATRIX_EFFECT_MAX }; +void eeconfig_update_rgb_matrix_default(void); + +uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i); +uint8_t rgb_matrix_map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led_i); + void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); +void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); + +bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record); + +void rgb_matrix_task(void); // This runs after another backlight effect and replaces // colors already set @@ -101,50 +100,57 @@ void rgb_matrix_indicators_kb(void); void rgb_matrix_indicators_user(void); void rgb_matrix_init(void); -void rgb_matrix_setup_drivers(void); void rgb_matrix_set_suspend_state(bool state); -void rgb_matrix_set_indicator_state(uint8_t state); - - -void rgb_matrix_task(void); - -// This should not be called from an interrupt -// (eg. from a timer interrupt). -// Call this while idle (in between matrix scans). -// If the buffer is dirty, it will update the driver with the buffer. -void rgb_matrix_update_pwm_buffers(void); - -bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record); - -void rgb_matrix_increase(void); -void rgb_matrix_decrease(void); - -// void *backlight_get_key_color_eeprom_address(uint8_t led); -// void backlight_get_key_color( uint8_t led, HSV *hsv ); -// void backlight_set_key_color( uint8_t row, uint8_t column, HSV hsv ); - -uint32_t rgb_matrix_get_tick(void); - -void rgblight_toggle(void); -void rgblight_step(void); -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); -void rgblight_step_reverse(void); -void rgblight_increase_hue(void); -void rgblight_decrease_hue(void); -void rgblight_increase_sat(void); -void rgblight_decrease_sat(void); -void rgblight_increase_val(void); -void rgblight_decrease_val(void); -void rgblight_increase_speed(void); -void rgblight_decrease_speed(void); -void rgblight_mode(uint8_t mode); -uint32_t rgblight_get_mode(void); +void rgb_matrix_toggle(void); +void rgb_matrix_enable(void); +void rgb_matrix_enable_noeeprom(void); +void rgb_matrix_disable(void); +void rgb_matrix_disable_noeeprom(void); +void rgb_matrix_step(void); +void rgb_matrix_step_reverse(void); +void rgb_matrix_increase_hue(void); +void rgb_matrix_decrease_hue(void); +void rgb_matrix_increase_sat(void); +void rgb_matrix_decrease_sat(void); +void rgb_matrix_increase_val(void); +void rgb_matrix_decrease_val(void); +void rgb_matrix_increase_speed(void); +void rgb_matrix_decrease_speed(void); +led_flags_t rgb_matrix_get_flags(void); +void rgb_matrix_set_flags(led_flags_t flags); +void rgb_matrix_mode(uint8_t mode); +void rgb_matrix_mode_noeeprom(uint8_t mode); +uint8_t rgb_matrix_get_mode(void); +void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val); +void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); + +#ifndef RGBLIGHT_ENABLE +#define rgblight_toggle() rgb_matrix_toggle() +#define rgblight_enable() rgb_matrix_enable() +#define rgblight_enable_noeeprom() rgb_matrix_enable_noeeprom() +#define rgblight_disable() rgb_matrix_disable() +#define rgblight_disable_noeeprom() rgb_matrix_disable_noeeprom() +#define rgblight_step() rgb_matrix_step() +#define rgblight_sethsv(hue, sat, val) rgb_matrix_sethsv(hue, sat, val) +#define rgblight_sethsv_noeeprom(hue, sat, val) rgb_matrix_sethsv_noeeprom(hue, sat, val) +#define rgblight_step_reverse() rgb_matrix_step_reverse() +#define rgblight_increase_hue() rgb_matrix_increase_hue() +#define rgblight_decrease_hue() rgb_matrix_decrease_hue() +#define rgblight_increase_sat() rgb_matrix_increase_sat() +#define rgblight_decrease_sat() rgb_matrix_decrease_sat() +#define rgblight_increase_val() rgb_matrix_increase_val() +#define rgblight_decrease_val() rgb_matrix_decrease_val() +#define rgblight_increase_speed() rgb_matrix_increase_speed() +#define rgblight_decrease_speed() rgb_matrix_decrease_speed() +#define rgblight_mode(mode) rgb_matrix_mode(mode) +#define rgblight_mode_noeeprom(mode) rgb_matrix_mode_noeeprom(mode) +#define rgblight_get_mode() rgb_matrix_get_mode() +#endif typedef struct { /* Perform any initialisation required for the other driver functions to work. */ void (*init)(void); - /* Set the colour of a single LED in the buffer. */ void (*set_color)(int index, uint8_t r, uint8_t g, uint8_t b); /* Set the colour of all LEDS on the keyboard in the buffer. */ @@ -155,4 +161,16 @@ typedef struct { extern const rgb_matrix_driver_t rgb_matrix_driver; +extern rgb_config_t rgb_matrix_config; + +extern bool g_suspend_state; +extern rgb_counters_t g_rgb_counters; +extern led_config_t g_led_config; +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +extern last_hit_t g_last_hit_tracker; +#endif +#ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS +extern uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS]; +#endif + #endif diff --git a/quantum/rgb_matrix_animations/alpha_mods_anim.h b/quantum/rgb_matrix_animations/alpha_mods_anim.h new file mode 100644 index 00000000000..8df3356f611 --- /dev/null +++ b/quantum/rgb_matrix_animations/alpha_mods_anim.h @@ -0,0 +1,26 @@ +#ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS +RGB_MATRIX_EFFECT(ALPHAS_MODS) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +// alphas = color1, mods = color2 +bool ALPHAS_MODS(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + HSV hsv = rgb_matrix_config.hsv; + RGB rgb1 = hsv_to_rgb(hsv); + hsv.h += rgb_matrix_config.speed; + RGB rgb2 = hsv_to_rgb(hsv); + + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color(i, rgb2.r, rgb2.g, rgb2.b); + } else { + rgb_matrix_set_color(i, rgb1.r, rgb1.g, rgb1.b); + } + } + return led_max < DRIVER_LED_TOTAL; +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_ALPHAS_MODS diff --git a/quantum/rgb_matrix_animations/breathing_anim.h b/quantum/rgb_matrix_animations/breathing_anim.h new file mode 100644 index 00000000000..0af7b42cf3f --- /dev/null +++ b/quantum/rgb_matrix_animations/breathing_anim.h @@ -0,0 +1,20 @@ +#ifndef DISABLE_RGB_MATRIX_BREATHING +RGB_MATRIX_EFFECT(BREATHING) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +bool BREATHING(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + HSV hsv = rgb_matrix_config.hsv; + uint16_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = hsv_to_rgb(hsv); + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_BREATHING diff --git a/quantum/rgb_matrix_animations/colorband_pinwheel_sat_anim.h b/quantum/rgb_matrix_animations/colorband_pinwheel_sat_anim.h new file mode 100644 index 00000000000..4585c52716b --- /dev/null +++ b/quantum/rgb_matrix_animations/colorband_pinwheel_sat_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +RGB_MATRIX_EFFECT(BAND_PINWHEEL_SAT) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV BAND_PINWHEEL_SAT_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) { + hsv.s = scale8(hsv.s - time - atan2_8(dy, dx) * 3, hsv.s); + return hsv; +} + +bool BAND_PINWHEEL_SAT(effect_params_t* params) { + return effect_runner_dx_dy(params, &BAND_PINWHEEL_SAT_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT diff --git a/quantum/rgb_matrix_animations/colorband_pinwheel_val_anim.h b/quantum/rgb_matrix_animations/colorband_pinwheel_val_anim.h new file mode 100644 index 00000000000..5cdb8734895 --- /dev/null +++ b/quantum/rgb_matrix_animations/colorband_pinwheel_val_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +RGB_MATRIX_EFFECT(BAND_PINWHEEL_VAL) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV BAND_PINWHEEL_VAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) { + hsv.v = scale8(hsv.v - time - atan2_8(dy, dx) * 3, hsv.v); + return hsv; +} + +bool BAND_PINWHEEL_VAL(effect_params_t* params) { + return effect_runner_dx_dy(params, &BAND_PINWHEEL_VAL_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL diff --git a/quantum/rgb_matrix_animations/colorband_sat_anim.h b/quantum/rgb_matrix_animations/colorband_sat_anim.h new file mode 100644 index 00000000000..a5175f1cd98 --- /dev/null +++ b/quantum/rgb_matrix_animations/colorband_sat_anim.h @@ -0,0 +1,16 @@ +#ifndef DISABLE_RGB_MATRIX_BAND_SAT +RGB_MATRIX_EFFECT(BAND_SAT) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV BAND_SAT_math(HSV hsv, uint8_t i, uint8_t time) { + int16_t s = hsv.s - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8; + hsv.s = scale8(s < 0 ? 0 : s, hsv.s); + return hsv; +} + +bool BAND_SAT(effect_params_t* params) { + return effect_runner_i(params, &BAND_SAT_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_BAND_SAT diff --git a/quantum/rgb_matrix_animations/colorband_spiral_sat_anim.h b/quantum/rgb_matrix_animations/colorband_spiral_sat_anim.h new file mode 100644 index 00000000000..096c675de8d --- /dev/null +++ b/quantum/rgb_matrix_animations/colorband_spiral_sat_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT +RGB_MATRIX_EFFECT(BAND_SPIRAL_SAT) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV BAND_SPIRAL_SAT_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { + hsv.s = scale8(hsv.s + dist - time - atan2_8(dy, dx), hsv.s); + return hsv; +} + +bool BAND_SPIRAL_SAT(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_SAT_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT diff --git a/quantum/rgb_matrix_animations/colorband_spiral_val_anim.h b/quantum/rgb_matrix_animations/colorband_spiral_val_anim.h new file mode 100644 index 00000000000..1d4cc0c84fe --- /dev/null +++ b/quantum/rgb_matrix_animations/colorband_spiral_val_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL +RGB_MATRIX_EFFECT(BAND_SPIRAL_VAL) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV BAND_SPIRAL_VAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { + hsv.v = scale8(hsv.v + dist - time - atan2_8(dy, dx), hsv.v); + return hsv; +} + +bool BAND_SPIRAL_VAL(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_VAL_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL diff --git a/quantum/rgb_matrix_animations/colorband_val_anim.h b/quantum/rgb_matrix_animations/colorband_val_anim.h new file mode 100644 index 00000000000..de0bbb47159 --- /dev/null +++ b/quantum/rgb_matrix_animations/colorband_val_anim.h @@ -0,0 +1,16 @@ +#ifndef DISABLE_RGB_MATRIX_BAND_VAL +RGB_MATRIX_EFFECT(BAND_VAL) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV BAND_VAL_math(HSV hsv, uint8_t i, uint8_t time) { + int16_t v = hsv.v - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8; + hsv.v = scale8(v < 0 ? 0 : v, hsv.v); + return hsv; +} + +bool BAND_VAL(effect_params_t* params) { + return effect_runner_i(params, &BAND_VAL_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_BAND_VAL diff --git a/quantum/rgb_matrix_animations/cycle_all_anim.h b/quantum/rgb_matrix_animations/cycle_all_anim.h new file mode 100644 index 00000000000..0c45aba8b13 --- /dev/null +++ b/quantum/rgb_matrix_animations/cycle_all_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_CYCLE_ALL +RGB_MATRIX_EFFECT(CYCLE_ALL) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV CYCLE_ALL_math(HSV hsv, uint8_t i, uint8_t time){ + hsv.h = time; + return hsv; +} + +bool CYCLE_ALL(effect_params_t* params) { + return effect_runner_i(params, &CYCLE_ALL_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_CYCLE_ALL diff --git a/quantum/rgb_matrix_animations/cycle_left_right_anim.h b/quantum/rgb_matrix_animations/cycle_left_right_anim.h new file mode 100644 index 00000000000..d2e5b4fbdf5 --- /dev/null +++ b/quantum/rgb_matrix_animations/cycle_left_right_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +RGB_MATRIX_EFFECT(CYCLE_LEFT_RIGHT) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV CYCLE_LEFT_RIGHT_math(HSV hsv, uint8_t i, uint8_t time) { + hsv.h = g_led_config.point[i].x - time; + return hsv; +} + +bool CYCLE_LEFT_RIGHT(effect_params_t* params) { + return effect_runner_i(params, &CYCLE_LEFT_RIGHT_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT diff --git a/quantum/rgb_matrix_animations/cycle_out_in_anim.h b/quantum/rgb_matrix_animations/cycle_out_in_anim.h new file mode 100644 index 00000000000..fa7c3b09cf7 --- /dev/null +++ b/quantum/rgb_matrix_animations/cycle_out_in_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_CYCLE_OUT_IN +RGB_MATRIX_EFFECT(CYCLE_OUT_IN) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV CYCLE_OUT_IN_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { + hsv.h = 3 * dist / 2 + time; + return hsv; +} + +bool CYCLE_OUT_IN(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &CYCLE_OUT_IN_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_CYCLE_OUT_IN diff --git a/quantum/rgb_matrix_animations/cycle_out_in_dual_anim.h b/quantum/rgb_matrix_animations/cycle_out_in_dual_anim.h new file mode 100644 index 00000000000..74a2c9aa584 --- /dev/null +++ b/quantum/rgb_matrix_animations/cycle_out_in_dual_anim.h @@ -0,0 +1,17 @@ +#ifndef DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +RGB_MATRIX_EFFECT(CYCLE_OUT_IN_DUAL) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV CYCLE_OUT_IN_DUAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) { + dx = (k_rgb_matrix_center.x / 2) - abs8(dx); + uint8_t dist = sqrt16(dx * dx + dy * dy); + hsv.h = 3 * dist + time; + return hsv; +} + +bool CYCLE_OUT_IN_DUAL(effect_params_t* params) { + return effect_runner_dx_dy(params, &CYCLE_OUT_IN_DUAL_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL diff --git a/quantum/rgb_matrix_animations/cycle_pinwheel_anim.h b/quantum/rgb_matrix_animations/cycle_pinwheel_anim.h new file mode 100644 index 00000000000..54e222dc2e3 --- /dev/null +++ b/quantum/rgb_matrix_animations/cycle_pinwheel_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_CYCLE_PINWHEEL +RGB_MATRIX_EFFECT(CYCLE_PINWHEEL) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV CYCLE_PINWHEEL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) { + hsv.h = atan2_8(dy, dx) + time; + return hsv; +} + +bool CYCLE_PINWHEEL(effect_params_t* params) { + return effect_runner_dx_dy(params, &CYCLE_PINWHEEL_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_CYCLE_PINWHEEL diff --git a/quantum/rgb_matrix_animations/cycle_spiral_anim.h b/quantum/rgb_matrix_animations/cycle_spiral_anim.h new file mode 100644 index 00000000000..b27d7a83c72 --- /dev/null +++ b/quantum/rgb_matrix_animations/cycle_spiral_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_CYCLE_SPIRAL +RGB_MATRIX_EFFECT(CYCLE_SPIRAL) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV CYCLE_SPIRAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { + hsv.h = dist - time - atan2_8(dy, dx); + return hsv; +} + +bool CYCLE_SPIRAL(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &CYCLE_SPIRAL_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_CYCLE_SPIRAL diff --git a/quantum/rgb_matrix_animations/cycle_up_down_anim.h b/quantum/rgb_matrix_animations/cycle_up_down_anim.h new file mode 100644 index 00000000000..4bf8ef2ae4a --- /dev/null +++ b/quantum/rgb_matrix_animations/cycle_up_down_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +RGB_MATRIX_EFFECT(CYCLE_UP_DOWN) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV CYCLE_UP_DOWN_math(HSV hsv, uint8_t i, uint8_t time) { + hsv.h = g_led_config.point[i].y - time; + return hsv; +} + +bool CYCLE_UP_DOWN(effect_params_t* params) { + return effect_runner_i(params, &CYCLE_UP_DOWN_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_CYCLE_UP_DOWN diff --git a/quantum/rgb_matrix_animations/digital_rain_anim.h b/quantum/rgb_matrix_animations/digital_rain_anim.h new file mode 100644 index 00000000000..982399cbdef --- /dev/null +++ b/quantum/rgb_matrix_animations/digital_rain_anim.h @@ -0,0 +1,77 @@ +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_DIGITAL_RAIN) +RGB_MATRIX_EFFECT(DIGITAL_RAIN) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +#ifndef RGB_DIGITAL_RAIN_DROPS + // lower the number for denser effect/wider keyboard + #define RGB_DIGITAL_RAIN_DROPS 24 +#endif + +bool DIGITAL_RAIN(effect_params_t* params) { + // algorithm ported from https://github.com/tremby/Kaleidoscope-LEDEffect-DigitalRain + const uint8_t drop_ticks = 28; + const uint8_t pure_green_intensity = 0xd0; + const uint8_t max_brightness_boost = 0xc0; + const uint8_t max_intensity = 0xff; + + static uint8_t drop = 0; + + if (params->init) { + rgb_matrix_set_color_all(0, 0, 0); + memset(rgb_frame_buffer, 0, sizeof(rgb_frame_buffer)); + drop = 0; + } + + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + if (row == 0 && drop == 0 && rand() < RAND_MAX / RGB_DIGITAL_RAIN_DROPS) { + // top row, pixels have just fallen and we're + // making a new rain drop in this column + rgb_frame_buffer[row][col] = max_intensity; + } + else if (rgb_frame_buffer[row][col] > 0 && rgb_frame_buffer[row][col] < max_intensity) { + // neither fully bright nor dark, decay it + rgb_frame_buffer[row][col]--; + } + // set the pixel colour + uint8_t led[LED_HITS_TO_REMEMBER]; + uint8_t led_count = rgb_matrix_map_row_column_to_led(row, col, led); + + // TODO: multiple leds are supported mapped to the same row/column + if (led_count > 0) { + if (rgb_frame_buffer[row][col] > pure_green_intensity) { + const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost * (rgb_frame_buffer[row][col] - pure_green_intensity) / (max_intensity - pure_green_intensity)); + rgb_matrix_set_color(led[0], boost, max_intensity, boost); + } + else { + const uint8_t green = (uint8_t) ((uint16_t) max_intensity * rgb_frame_buffer[row][col] / pure_green_intensity); + rgb_matrix_set_color(led[0], 0, green, 0); + } + } + } + } + + if (++drop > drop_ticks) { + // reset drop timer + drop = 0; + for (uint8_t row = MATRIX_ROWS - 1; row > 0; row--) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + // if ths is on the bottom row and bright allow decay + if (row == MATRIX_ROWS - 1 && rgb_frame_buffer[row][col] == max_intensity) { + rgb_frame_buffer[row][col]--; + } + // check if the pixel above is bright + if (rgb_frame_buffer[row - 1][col] == max_intensity) { + // allow old bright pixel to decay + rgb_frame_buffer[row - 1][col]--; + // make this pixel bright + rgb_frame_buffer[row][col] = max_intensity; + } + } + } + } + return false; +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_DIGITAL_RAIN) diff --git a/quantum/rgb_matrix_animations/dual_beacon_anim.h b/quantum/rgb_matrix_animations/dual_beacon_anim.h new file mode 100644 index 00000000000..336a41b2ce6 --- /dev/null +++ b/quantum/rgb_matrix_animations/dual_beacon_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_DUAL_BEACON +RGB_MATRIX_EFFECT(DUAL_BEACON) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV DUAL_BEACON_math(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { + hsv.h += ((g_led_config.point[i].y - k_rgb_matrix_center.y) * cos + (g_led_config.point[i].x - k_rgb_matrix_center.x) * sin) / 128; + return hsv; +} + +bool DUAL_BEACON(effect_params_t* params) { + return effect_runner_sin_cos_i(params, &DUAL_BEACON_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_DUAL_BEACON diff --git a/quantum/rgb_matrix_animations/gradient_up_down_anim.h b/quantum/rgb_matrix_animations/gradient_up_down_anim.h new file mode 100644 index 00000000000..12848ab4cc7 --- /dev/null +++ b/quantum/rgb_matrix_animations/gradient_up_down_anim.h @@ -0,0 +1,22 @@ +#ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +RGB_MATRIX_EFFECT(GRADIENT_UP_DOWN) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +bool GRADIENT_UP_DOWN(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + HSV hsv = rgb_matrix_config.hsv; + uint8_t scale = scale8(64, rgb_matrix_config.speed); + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + // The y range will be 0..64, map this to 0..4 + // Relies on hue being 8-bit and wrapping + hsv.h = rgb_matrix_config.hsv.h + scale * (g_led_config.point[i].y >> 4); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN diff --git a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h new file mode 100644 index 00000000000..bffa0a42d78 --- /dev/null +++ b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h @@ -0,0 +1,29 @@ +#ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +RGB_MATRIX_EFFECT(JELLYBEAN_RAINDROPS) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static void jellybean_raindrops_set_color(int i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; + HSV hsv = { rand() & 0xFF , rand() & 0xFF, rgb_matrix_config.hsv.v }; + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +} + +bool JELLYBEAN_RAINDROPS(effect_params_t* params) { + if (!params->init) { + // Change one LED every tick, make sure speed is not 0 + if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { + jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); + } + return false; + } + + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (int i = led_min; i < led_max; i++) { + jellybean_raindrops_set_color(i, params); + } + return led_max < DRIVER_LED_TOTAL; +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS diff --git a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h new file mode 100644 index 00000000000..f53c819a9e9 --- /dev/null +++ b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON +RGB_MATRIX_EFFECT(RAINBOW_BEACON) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV RAINBOW_BEACON_math(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { + hsv.h += ((g_led_config.point[i].y - k_rgb_matrix_center.y) * 2 * cos + (g_led_config.point[i].x - k_rgb_matrix_center.x) * 2 * sin) / 128; + return hsv; +} + +bool RAINBOW_BEACON(effect_params_t* params) { + return effect_runner_sin_cos_i(params, &RAINBOW_BEACON_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_RAINBOW_BEACON diff --git a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h new file mode 100644 index 00000000000..e78c55e8ddd --- /dev/null +++ b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +RGB_MATRIX_EFFECT(RAINBOW_MOVING_CHEVRON) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV RAINBOW_MOVING_CHEVRON_math(HSV hsv, uint8_t i, uint8_t time) { + hsv.h += abs8(g_led_config.point[i].y - k_rgb_matrix_center.y) + (g_led_config.point[i].x - time); + return hsv; +} + +bool RAINBOW_MOVING_CHEVRON(effect_params_t* params) { + return effect_runner_i(params, &RAINBOW_MOVING_CHEVRON_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON diff --git a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h new file mode 100644 index 00000000000..8298fec468d --- /dev/null +++ b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h @@ -0,0 +1,15 @@ +#ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +RGB_MATRIX_EFFECT(PINWHEELS) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV PINWHEELS_math(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { + hsv.h += ((g_led_config.point[i].y - k_rgb_matrix_center.y) * 3 * cos + (56 - abs8(g_led_config.point[i].x - k_rgb_matrix_center.x)) * 3 * sin) / 128; + return hsv; +} + +bool PINWHEELS(effect_params_t* params) { + return effect_runner_sin_cos_i(params, &PINWHEELS_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS diff --git a/quantum/rgb_matrix_animations/raindrops_anim.h b/quantum/rgb_matrix_animations/raindrops_anim.h new file mode 100644 index 00000000000..a4fed51658b --- /dev/null +++ b/quantum/rgb_matrix_animations/raindrops_anim.h @@ -0,0 +1,39 @@ +#ifndef DISABLE_RGB_MATRIX_RAINDROPS +RGB_MATRIX_EFFECT(RAINDROPS) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static void raindrops_set_color(int i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; + HSV hsv = { 0 , rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v }; + + // Take the shortest path between hues + int16_t deltaH = ((rgb_matrix_config.hsv.h + 180) % 360 - rgb_matrix_config.hsv.h) / 4; + if (deltaH > 127) { + deltaH -= 256; + } else if (deltaH < -127) { + deltaH += 256; + } + + hsv.h = rgb_matrix_config.hsv.h + (deltaH * (rand() & 0x03)); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +} + +bool RAINDROPS(effect_params_t* params) { + if (!params->init) { + // Change one LED every tick, make sure speed is not 0 + if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { + raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); + } + return false; + } + + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (int i = led_min; i < led_max; i++) { + raindrops_set_color(i, params); + } + return led_max < DRIVER_LED_TOTAL; +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_RAINDROPS diff --git a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc new file mode 100644 index 00000000000..01332ed0dda --- /dev/null +++ b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc @@ -0,0 +1,33 @@ +// Add your new core rgb matrix effect here, order determins enum order, requires "rgb_matrix_animations/ directory +#include "rgb_matrix_animations/solid_color_anim.h" +#include "rgb_matrix_animations/alpha_mods_anim.h" +#include "rgb_matrix_animations/gradient_up_down_anim.h" +#include "rgb_matrix_animations/breathing_anim.h" +#include "rgb_matrix_animations/colorband_sat_anim.h" +#include "rgb_matrix_animations/colorband_val_anim.h" +#include "rgb_matrix_animations/colorband_pinwheel_sat_anim.h" +#include "rgb_matrix_animations/colorband_pinwheel_val_anim.h" +#include "rgb_matrix_animations/colorband_spiral_sat_anim.h" +#include "rgb_matrix_animations/colorband_spiral_val_anim.h" +#include "rgb_matrix_animations/cycle_all_anim.h" +#include "rgb_matrix_animations/cycle_left_right_anim.h" +#include "rgb_matrix_animations/cycle_up_down_anim.h" +#include "rgb_matrix_animations/rainbow_moving_chevron_anim.h" +#include "rgb_matrix_animations/cycle_out_in_anim.h" +#include "rgb_matrix_animations/cycle_out_in_dual_anim.h" +#include "rgb_matrix_animations/cycle_pinwheel_anim.h" +#include "rgb_matrix_animations/cycle_spiral_anim.h" +#include "rgb_matrix_animations/dual_beacon_anim.h" +#include "rgb_matrix_animations/rainbow_beacon_anim.h" +#include "rgb_matrix_animations/rainbow_pinwheels_anim.h" +#include "rgb_matrix_animations/raindrops_anim.h" +#include "rgb_matrix_animations/jellybean_raindrops_anim.h" +#include "rgb_matrix_animations/typing_heatmap_anim.h" +#include "rgb_matrix_animations/digital_rain_anim.h" +#include "rgb_matrix_animations/solid_reactive_simple_anim.h" +#include "rgb_matrix_animations/solid_reactive_anim.h" +#include "rgb_matrix_animations/solid_reactive_wide.h" +#include "rgb_matrix_animations/solid_reactive_cross.h" +#include "rgb_matrix_animations/solid_reactive_nexus.h" +#include "rgb_matrix_animations/splash_anim.h" +#include "rgb_matrix_animations/solid_splash_anim.h" diff --git a/quantum/rgb_matrix_animations/solid_color_anim.h b/quantum/rgb_matrix_animations/solid_color_anim.h new file mode 100644 index 00000000000..6e406380350 --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_color_anim.h @@ -0,0 +1,15 @@ +RGB_MATRIX_EFFECT(SOLID_COLOR) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +bool SOLID_COLOR(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + RGB rgb = hsv_to_rgb(rgb_matrix_config.hsv); + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS diff --git a/quantum/rgb_matrix_animations/solid_reactive_anim.h b/quantum/rgb_matrix_animations/solid_reactive_anim.h new file mode 100644 index 00000000000..dd49b6530eb --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_reactive_anim.h @@ -0,0 +1,17 @@ +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE +RGB_MATRIX_EFFECT(SOLID_REACTIVE) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV SOLID_REACTIVE_math(HSV hsv, uint16_t offset) { + hsv.h += qsub8(130, offset); + return hsv; +} + +bool SOLID_REACTIVE(effect_params_t* params) { + return effect_runner_reactive(params, &SOLID_REACTIVE_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_animations/solid_reactive_cross.h b/quantum/rgb_matrix_animations/solid_reactive_cross.h new file mode 100644 index 00000000000..5b9cfcbd525 --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_reactive_cross.h @@ -0,0 +1,41 @@ +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +RGB_MATRIX_EFFECT(SOLID_REACTIVE_CROSS) +#endif + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTICROSS) +#endif + +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV SOLID_REACTIVE_CROSS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { + uint16_t effect = tick + dist; + dx = dx < 0 ? dx * -1 : dx; + dy = dy < 0 ? dy * -1 : dy; + dx = dx * 16 > 255 ? 255 : dx * 16; + dy = dy * 16 > 255 ? 255 : dy * 16; + effect += dx > dy ? dy : dx; + if (effect > 255) + effect = 255; + hsv.v = qadd8(hsv.v, 255 - effect); + return hsv; +} + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +bool SOLID_REACTIVE_CROSS(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_CROSS_math); +} +#endif + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_CROSS_math); +} +#endif + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h new file mode 100644 index 00000000000..e90eaf4b289 --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h @@ -0,0 +1,41 @@ +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS) +#endif + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS) +#endif + +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV SOLID_REACTIVE_NEXUS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { + uint16_t effect = tick - dist; + if (effect > 255) + effect = 255; + if (dist > 72) + effect = 255; + if ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) + effect = 255; + hsv.v = qadd8(hsv.v, 255 - effect); + hsv.h = rgb_matrix_config.hsv.h + dy / 4; + return hsv; +} + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); +} +#endif + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); +} +#endif + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h new file mode 100644 index 00000000000..77c8ff67240 --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h @@ -0,0 +1,17 @@ +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +RGB_MATRIX_EFFECT(SOLID_REACTIVE_SIMPLE) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV SOLID_REACTIVE_SIMPLE_math(HSV hsv, uint16_t offset) { + hsv.v = scale8(255 - offset, hsv.v); + return hsv; +} + +bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { + return effect_runner_reactive(params, &SOLID_REACTIVE_SIMPLE_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_animations/solid_reactive_wide.h b/quantum/rgb_matrix_animations/solid_reactive_wide.h new file mode 100644 index 00000000000..73779dfa74e --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_reactive_wide.h @@ -0,0 +1,36 @@ +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +RGB_MATRIX_EFFECT(SOLID_REACTIVE_WIDE) +#endif + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTIWIDE) +#endif + +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV SOLID_REACTIVE_WIDE_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { + uint16_t effect = tick + dist * 5; + if (effect > 255) + effect = 255; + hsv.v = qadd8(hsv.v, 255 - effect); + return hsv; +} + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +bool SOLID_REACTIVE_WIDE(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math); +} +#endif + +#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math); +} +#endif + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_animations/solid_splash_anim.h b/quantum/rgb_matrix_animations/solid_splash_anim.h new file mode 100644 index 00000000000..441f35576b0 --- /dev/null +++ b/quantum/rgb_matrix_animations/solid_splash_anim.h @@ -0,0 +1,36 @@ +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH) + +#ifndef DISABLE_RGB_MATRIX_SOLID_SPLASH +RGB_MATRIX_EFFECT(SOLID_SPLASH) +#endif + +#ifndef DISABLE_RGB_MATRIX_SOLID_MULTISPLASH +RGB_MATRIX_EFFECT(SOLID_MULTISPLASH) +#endif + +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +HSV SOLID_SPLASH_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { + uint16_t effect = tick - dist; + if (effect > 255) + effect = 255; + hsv.v = qadd8(hsv.v, 255 - effect); + return hsv; +} + +#ifndef DISABLE_RGB_MATRIX_SOLID_SPLASH +bool SOLID_SPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math); +} +#endif + +#ifndef DISABLE_RGB_MATRIX_SOLID_MULTISPLASH +bool SOLID_MULTISPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math); +} +#endif + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // !defined(DISABLE_RGB_MATRIX_SPLASH) && !defined(DISABLE_RGB_MATRIX_MULTISPLASH) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_animations/splash_anim.h b/quantum/rgb_matrix_animations/splash_anim.h new file mode 100644 index 00000000000..19ccb256e95 --- /dev/null +++ b/quantum/rgb_matrix_animations/splash_anim.h @@ -0,0 +1,37 @@ +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +#if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) + +#ifndef DISABLE_RGB_MATRIX_SPLASH +RGB_MATRIX_EFFECT(SPLASH) +#endif + +#ifndef DISABLE_RGB_MATRIX_MULTISPLASH +RGB_MATRIX_EFFECT(MULTISPLASH) +#endif + +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +HSV SPLASH_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { + uint16_t effect = tick - dist; + if (effect > 255) + effect = 255; + hsv.h += effect; + hsv.v = qadd8(hsv.v, 255 - effect); + return hsv; +} + +#ifndef DISABLE_RGB_MATRIX_SPLASH +bool SPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SPLASH_math); +} +#endif + +#ifndef DISABLE_RGB_MATRIX_MULTISPLASH +bool MULTISPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SPLASH_math); +} +#endif + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_animations/typing_heatmap_anim.h b/quantum/rgb_matrix_animations/typing_heatmap_anim.h new file mode 100644 index 00000000000..374b7fea0cf --- /dev/null +++ b/quantum/rgb_matrix_animations/typing_heatmap_anim.h @@ -0,0 +1,74 @@ +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) +RGB_MATRIX_EFFECT(TYPING_HEATMAP) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +void process_rgb_matrix_typing_heatmap(keyrecord_t *record) { + uint8_t row = record->event.key.row; + uint8_t col = record->event.key.col; + uint8_t m_row = row - 1; + uint8_t p_row = row + 1; + uint8_t m_col = col - 1; + uint8_t p_col = col + 1; + + if (m_col < col) + rgb_frame_buffer[row][m_col] = qadd8(rgb_frame_buffer[row][m_col], 16); + rgb_frame_buffer[row][col] = qadd8(rgb_frame_buffer[row][col], 32); + if (p_col < MATRIX_COLS) + rgb_frame_buffer[row][p_col] = qadd8(rgb_frame_buffer[row][p_col], 16); + + if (p_row < MATRIX_ROWS) { + if (m_col < col) + rgb_frame_buffer[p_row][m_col] = qadd8(rgb_frame_buffer[p_row][m_col], 13); + rgb_frame_buffer[p_row][col] = qadd8(rgb_frame_buffer[p_row][col], 16); + if (p_col < MATRIX_COLS) + rgb_frame_buffer[p_row][p_col] = qadd8(rgb_frame_buffer[p_row][p_col], 13); + } + + if (m_row < row) { + if (m_col < col) + rgb_frame_buffer[m_row][m_col] = qadd8(rgb_frame_buffer[m_row][m_col], 13); + rgb_frame_buffer[m_row][col] = qadd8(rgb_frame_buffer[m_row][col], 16); + if (p_col < MATRIX_COLS) + rgb_frame_buffer[m_row][p_col] = qadd8(rgb_frame_buffer[m_row][p_col], 13); + } +} + +bool TYPING_HEATMAP(effect_params_t* params) { + // Modified version of RGB_MATRIX_USE_LIMITS to work off of matrix row / col size + uint8_t led_min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; + uint8_t led_max = led_min + RGB_MATRIX_LED_PROCESS_LIMIT; + if (led_max > sizeof(rgb_frame_buffer)) + led_max = sizeof(rgb_frame_buffer); + + if (params->init) { + rgb_matrix_set_color_all(0, 0, 0); + memset(rgb_frame_buffer, 0, sizeof rgb_frame_buffer); + } + + // Render heatmap & decrease + for (int i = led_min; i < led_max; i++) { + uint8_t row = i % MATRIX_ROWS; + uint8_t col = i / MATRIX_ROWS; + uint8_t val = rgb_frame_buffer[row][col]; + + // set the pixel colour + uint8_t led[LED_HITS_TO_REMEMBER]; + uint8_t led_count = rgb_matrix_map_row_column_to_led(row, col, led); + for (uint8_t j = 0; j < led_count; ++j) + { + if (!HAS_ANY_FLAGS(g_led_config.flags[led[j]], params->flags)) + continue; + + HSV hsv = { 170 - qsub8(val, 85), rgb_matrix_config.hsv.s, scale8((qadd8(170, val) - 170) * 3, rgb_matrix_config.hsv.v) }; + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(led[j], rgb.r, rgb.g, rgb.b); + } + + rgb_frame_buffer[row][col] = qsub8(val, 1); + } + + return led_max < sizeof(rgb_frame_buffer); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index 70b80293ddb..4d8f05892cd 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c @@ -23,7 +23,7 @@ * be here if shared between boards. */ -#if defined(IS31FL3731) || defined(IS31FL3733) +#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) #include "i2c_master.h" @@ -33,30 +33,39 @@ static void init( void ) #ifdef IS31FL3731 IS31FL3731_init( DRIVER_ADDR_1 ); IS31FL3731_init( DRIVER_ADDR_2 ); +#elif defined(IS31FL3733) + IS31FL3733_init( DRIVER_ADDR_1, 0 ); #else - IS31FL3733_init( DRIVER_ADDR_1 ); + IS31FL3737_init( DRIVER_ADDR_1 ); #endif for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { bool enabled = true; // This only caches it for later #ifdef IS31FL3731 IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); -#else +#elif defined(IS31FL3733) IS31FL3733_set_led_control_register( index, enabled, enabled, enabled ); +#else + IS31FL3737_set_led_control_register( index, enabled, enabled, enabled ); #endif } // This actually updates the LED drivers #ifdef IS31FL3731 - IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); + IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, 0 ); + IS31FL3731_update_led_control_registers( DRIVER_ADDR_2, 1 ); +#elif defined(IS31FL3733) + IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, 0 ); + IS31FL3733_update_led_control_registers( DRIVER_ADDR_2, 1 ); #else - IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); + IS31FL3737_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); #endif } #ifdef IS31FL3731 static void flush( void ) { - IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); + IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, 0 ); + IS31FL3731_update_pwm_buffers( DRIVER_ADDR_2, 1 ); } const rgb_matrix_driver_t rgb_matrix_driver = { @@ -65,10 +74,11 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color = IS31FL3731_set_color, .set_color_all = IS31FL3731_set_color_all, }; -#else +#elif defined(IS31FL3733) static void flush( void ) { - IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); + IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, 0); + IS31FL3733_update_pwm_buffers( DRIVER_ADDR_2, 1); } const rgb_matrix_driver_t rgb_matrix_driver = { @@ -77,6 +87,39 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color = IS31FL3733_set_color, .set_color_all = IS31FL3733_set_color_all, }; +#else +static void flush( void ) +{ + IS31FL3737_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +} + +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = init, + .flush = flush, + .set_color = IS31FL3737_set_color, + .set_color_all = IS31FL3737_set_color_all, +}; #endif +#elif defined(WS2812) + +extern LED_TYPE led[DRIVER_LED_TOTAL]; + + static void flush( void ) + { + // Assumes use of RGB_DI_PIN + ws2812_setleds(led, DRIVER_LED_TOTAL); + } + + static void init( void ) + { + + } + + const rgb_matrix_driver_t rgb_matrix_driver = { + .init = init, + .flush = flush, + .set_color = ws2812_setled, + .set_color_all = ws2812_setled_all, + }; #endif diff --git a/quantum/rgb_matrix_runners/effect_runner_dx_dy.h b/quantum/rgb_matrix_runners/effect_runner_dx_dy.h new file mode 100644 index 00000000000..9650c9a1316 --- /dev/null +++ b/quantum/rgb_matrix_runners/effect_runner_dx_dy.h @@ -0,0 +1,17 @@ +#pragma once + +typedef HSV (*dx_dy_f)(HSV hsv, int16_t dx, int16_t dy, uint8_t time); + +bool effect_runner_dx_dy(effect_params_t* params, dx_dy_f effect_func) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 2); + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + int16_t dx = g_led_config.point[i].x - k_rgb_matrix_center.x; + int16_t dy = g_led_config.point[i].y - k_rgb_matrix_center.y; + RGB rgb = hsv_to_rgb(effect_func(rgb_matrix_config.hsv, dx, dy, time)); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} diff --git a/quantum/rgb_matrix_runners/effect_runner_dx_dy_dist.h b/quantum/rgb_matrix_runners/effect_runner_dx_dy_dist.h new file mode 100644 index 00000000000..eb0c4d8dd33 --- /dev/null +++ b/quantum/rgb_matrix_runners/effect_runner_dx_dy_dist.h @@ -0,0 +1,18 @@ +#pragma once + +typedef HSV (*dx_dy_dist_f)(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time); + +bool effect_runner_dx_dy_dist(effect_params_t* params, dx_dy_dist_f effect_func) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 2); + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + int16_t dx = g_led_config.point[i].x - k_rgb_matrix_center.x; + int16_t dy = g_led_config.point[i].y - k_rgb_matrix_center.y; + uint8_t dist = sqrt16(dx * dx + dy * dy); + RGB rgb = hsv_to_rgb(effect_func(rgb_matrix_config.hsv, dx, dy, dist, time)); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} diff --git a/quantum/rgb_matrix_runners/effect_runner_i.h b/quantum/rgb_matrix_runners/effect_runner_i.h new file mode 100644 index 00000000000..d4a7ef392aa --- /dev/null +++ b/quantum/rgb_matrix_runners/effect_runner_i.h @@ -0,0 +1,15 @@ +#pragma once + +typedef HSV (*i_f)(HSV hsv, uint8_t i, uint8_t time); + +bool effect_runner_i(effect_params_t* params, i_f effect_func) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + RGB rgb = hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time)); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} diff --git a/quantum/rgb_matrix_runners/effect_runner_reactive.h b/quantum/rgb_matrix_runners/effect_runner_reactive.h new file mode 100644 index 00000000000..9da2814ce85 --- /dev/null +++ b/quantum/rgb_matrix_runners/effect_runner_reactive.h @@ -0,0 +1,29 @@ +#pragma once + +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED + +typedef HSV (*reactive_f)(HSV hsv, uint16_t offset); + +bool effect_runner_reactive(effect_params_t* params, reactive_f effect_func) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + uint16_t max_tick = 65535 / rgb_matrix_config.speed; + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + uint16_t tick = max_tick; + // Reverse search to find most recent key hit + for (int8_t j = g_last_hit_tracker.count - 1; j >= 0; j--) { + if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { + tick = g_last_hit_tracker.tick[j]; + break; + } + } + + uint16_t offset = scale16by8(tick, rgb_matrix_config.speed); + RGB rgb = hsv_to_rgb(effect_func(rgb_matrix_config.hsv, offset)); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} + +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_runners/effect_runner_reactive_splash.h b/quantum/rgb_matrix_runners/effect_runner_reactive_splash.h new file mode 100644 index 00000000000..4f2059c99c3 --- /dev/null +++ b/quantum/rgb_matrix_runners/effect_runner_reactive_splash.h @@ -0,0 +1,29 @@ +#pragma once + +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED + +typedef HSV (*reactive_splash_f)(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick); + +bool effect_runner_reactive_splash(uint8_t start, effect_params_t* params, reactive_splash_f effect_func) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + uint8_t count = g_last_hit_tracker.count; + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = 0; + for (uint8_t j = start; j < count; j++) { + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; + uint8_t dist = sqrt16(dx * dx + dy * dy); + uint16_t tick = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed); + hsv = effect_func(hsv, dx, dy, dist, tick); + } + hsv.v = scale8(hsv.v, rgb_matrix_config.hsv.v); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} + +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix_runners/effect_runner_sin_cos_i.h b/quantum/rgb_matrix_runners/effect_runner_sin_cos_i.h new file mode 100644 index 00000000000..e68a7a968c7 --- /dev/null +++ b/quantum/rgb_matrix_runners/effect_runner_sin_cos_i.h @@ -0,0 +1,17 @@ +#pragma once + +typedef HSV (*sin_cos_i_f)(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8_t time); + +bool effect_runner_sin_cos_i(effect_params_t* params, sin_cos_i_f effect_func) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + uint16_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); + int8_t cos_value = cos8(time) - 128; + int8_t sin_value = sin8(time) - 128; + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + RGB rgb = hsv_to_rgb(effect_func(rgb_matrix_config.hsv, cos_value, sin_value, i, time)); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + return led_max < DRIVER_LED_TOTAL; +} diff --git a/quantum/rgb_matrix_types.h b/quantum/rgb_matrix_types.h new file mode 100644 index 00000000000..04a84f4ac75 --- /dev/null +++ b/quantum/rgb_matrix_types.h @@ -0,0 +1,92 @@ +#pragma once + +#include +#include +#include "color.h" + +#if defined(__GNUC__) +#define PACKED __attribute__ ((__packed__)) +#else +#define PACKED +#endif + +#if defined(_MSC_VER) +#pragma pack( push, 1 ) +#endif + +#if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) + #define RGB_MATRIX_KEYREACTIVE_ENABLED +#endif + +// Last led hit +#ifndef LED_HITS_TO_REMEMBER + #define LED_HITS_TO_REMEMBER 8 +#endif // LED_HITS_TO_REMEMBER + +#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED +typedef struct PACKED { + uint8_t count; + uint8_t x[LED_HITS_TO_REMEMBER]; + uint8_t y[LED_HITS_TO_REMEMBER]; + uint8_t index[LED_HITS_TO_REMEMBER]; + uint16_t tick[LED_HITS_TO_REMEMBER]; +} last_hit_t; +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED + +typedef enum rgb_task_states { + STARTING, + RENDERING, + FLUSHING, + SYNCING +} rgb_task_states; + +typedef uint8_t led_flags_t; + +typedef struct PACKED { + uint8_t iter; + led_flags_t flags; + bool init; +} effect_params_t; + +typedef struct PACKED { + // Global tick at 20 Hz + uint32_t tick; + // Ticks since this key was last hit. + uint32_t any_key_hit; +} rgb_counters_t; + +typedef struct PACKED { + uint8_t x; + uint8_t y; +} point_t; + +#define HAS_FLAGS(bits, flags) ((bits & flags) == flags) +#define HAS_ANY_FLAGS(bits, flags) ((bits & flags) != 0x00) + +#define LED_FLAG_ALL 0xFF +#define LED_FLAG_NONE 0x00 +#define LED_FLAG_MODIFIER 0x01 +#define LED_FLAG_UNDERGLOW 0x02 +#define LED_FLAG_KEYLIGHT 0x04 + +#define NO_LED 255 + +typedef struct PACKED { + uint8_t matrix_co[MATRIX_ROWS][MATRIX_COLS]; + point_t point[DRIVER_LED_TOTAL]; + uint8_t flags[DRIVER_LED_TOTAL]; +} led_config_t; + +typedef union { + uint32_t raw; + struct PACKED { + uint8_t enable :2; + uint8_t mode :6; + HSV hsv; + uint8_t speed; //EECONFIG needs to be increased to support this + }; +} rgb_config_t; + +#if defined(_MSC_VER) +#pragma pack( pop ) +#endif diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 94e9c0a3b20..f569d6b9e3f 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -19,97 +19,115 @@ #include #include #endif +#ifdef STM32_EEPROM_ENABLE + #include "hal.h" + #include "eeprom.h" + #include "eeprom_stm32.h" +#endif #include "wait.h" #include "progmem.h" #include "timer.h" #include "rgblight.h" +#include "color.h" #include "debug.h" #include "led_tables.h" +#include "lib/lib8tion/lib8tion.h" +#ifdef VELOCIKEY_ENABLE + #include "velocikey.h" +#endif -#ifndef RGBLIGHT_LIMIT_VAL -#define RGBLIGHT_LIMIT_VAL 255 +#ifdef RGBLIGHT_SPLIT + /* for split keyboard */ + #define RGBLIGHT_SPLIT_SET_CHANGE_MODE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_MODE + #define RGBLIGHT_SPLIT_SET_CHANGE_HSVS rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_HSVS + #define RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS rgblight_status.change_flags |= (RGBLIGHT_STATUS_CHANGE_MODE|RGBLIGHT_STATUS_CHANGE_HSVS) + #define RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_TIMER + #define RGBLIGHT_SPLIT_ANIMATION_TICK rgblight_status.change_flags |= RGBLIGHT_STATUS_ANIMATION_TICK +#else + #define RGBLIGHT_SPLIT_SET_CHANGE_MODE + #define RGBLIGHT_SPLIT_SET_CHANGE_HSVS + #define RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS + #define RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE + #define RGBLIGHT_SPLIT_ANIMATION_TICK #endif #define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_ ## sym, #define _RGBM_SINGLE_DYNAMIC(sym) #define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_ ## sym, #define _RGBM_MULTI_DYNAMIC(sym) -#define _RGBM_TMP_STATIC(sym) RGBLIGHT_MODE_ ## sym, -#define _RGBM_TMP_DYNAMIC(sym) +#define _RGBM_TMP_STATIC(sym, msym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_TMP_DYNAMIC(sym, msym) static uint8_t static_effect_table [] = { -#include "rgblight.h" +#include "rgblight_modes.h" +}; + +#define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_MULTI_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_TMP_STATIC(sym, msym) RGBLIGHT_MODE_ ## msym, +#define _RGBM_TMP_DYNAMIC(sym, msym) RGBLIGHT_MODE_ ## msym, +static uint8_t mode_base_table [] = { + 0, // RGBLIGHT_MODE_zero +#include "rgblight_modes.h" }; static inline int is_static_effect(uint8_t mode) { return memchr(static_effect_table, mode, sizeof(static_effect_table)) != NULL; } -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) +#ifdef RGBLIGHT_LED_MAP +const uint8_t led_map[] PROGMEM = RGBLIGHT_LED_MAP; +#endif #ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT __attribute__ ((weak)) -const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; +const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64}; #endif rgblight_config_t rgblight_config; +rgblight_status_t rgblight_status = { .timer_enabled = false }; +bool is_rgblight_initialized = false; + +#ifdef RGBLIGHT_USE_TIMER +animation_status_t animation_status = {}; +#endif +#ifndef LED_ARRAY LED_TYPE led[RGBLED_NUM]; -bool rgblight_timer_enabled = false; + #define LED_ARRAY led +#endif -void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { - uint8_t r = 0, g = 0, b = 0, base, color; - if (val > RGBLIGHT_LIMIT_VAL) { - val=RGBLIGHT_LIMIT_VAL; // limit the val - } +static uint8_t clipping_start_pos = 0; +static uint8_t clipping_num_leds = RGBLED_NUM; +static uint8_t effect_start_pos = 0; +static uint8_t effect_end_pos = RGBLED_NUM; +static uint8_t effect_num_leds = RGBLED_NUM; - if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. - r = val; - g = val; - b = val; - } else { - base = ((255 - sat) * val) >> 8; - color = (val - base) * (hue % 60) / 60; - - switch (hue / 60) { - case 0: - r = val; - g = base + color; - b = base; - break; - case 1: - r = val - color; - g = val; - b = base; - break; - case 2: - r = base; - g = val; - b = base + color; - break; - case 3: - r = base; - g = val - color; - b = val; - break; - case 4: - r = base + color; - g = base; - b = val; - break; - case 5: - r = val; - g = base; - b = val - color; - break; - } - } - r = pgm_read_byte(&CIE1931_CURVE[r]); - g = pgm_read_byte(&CIE1931_CURVE[g]); - b = pgm_read_byte(&CIE1931_CURVE[b]); +void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds) { + clipping_start_pos = start_pos; + clipping_num_leds = num_leds; +} + +void rgblight_set_effect_range(uint8_t start_pos, uint8_t num_leds) { + if (start_pos >= RGBLED_NUM) return; + if (start_pos + num_leds > RGBLED_NUM) return; + effect_start_pos = start_pos; + effect_end_pos = start_pos + num_leds; + effect_num_leds = num_leds; +} - setrgb(r, g, b, led1); +void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { + HSV hsv = { hue, sat, val }; + RGB rgb = hsv_to_rgb(hsv); + setrgb(rgb.r, rgb.g, rgb.b, led1); +} + +void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { + sethsv_raw( hue, sat, + val > RGBLIGHT_LIMIT_VAL ? RGBLIGHT_LIMIT_VAL : val, + led1); } void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) { @@ -118,31 +136,49 @@ void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) { (*led1).b = b; } +void rgblight_check_config(void) { + /* Add some out of bound checks for RGB light config */ + + if (rgblight_config.mode < RGBLIGHT_MODE_STATIC_LIGHT) { + rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT; + } + else if (rgblight_config.mode > RGBLIGHT_MODES) { + rgblight_config.mode = RGBLIGHT_MODES; + } + + if (rgblight_config.val > RGBLIGHT_LIMIT_VAL) { + rgblight_config.val = RGBLIGHT_LIMIT_VAL; + } +} uint32_t eeconfig_read_rgblight(void) { - #ifdef __AVR__ + #if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE) return eeprom_read_dword(EECONFIG_RGBLIGHT); #else return 0; #endif } + void eeconfig_update_rgblight(uint32_t val) { - #ifdef __AVR__ + #if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE) + rgblight_check_config(); eeprom_update_dword(EECONFIG_RGBLIGHT, val); #endif } + void eeconfig_update_rgblight_default(void) { - //dprintf("eeconfig_update_rgblight_default\n"); rgblight_config.enable = 1; rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT; rgblight_config.hue = 0; - rgblight_config.sat = 255; + rgblight_config.sat = UINT8_MAX; rgblight_config.val = RGBLIGHT_LIMIT_VAL; rgblight_config.speed = 0; + RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; eeconfig_update_rgblight(rgblight_config.raw); } + void eeconfig_debug_rgblight(void) { - dprintf("rgblight_config eprom\n"); + dprintf("rgblight_config EEPROM:\n"); dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); dprintf("rghlight_config.mode = %d\n", rgblight_config.mode); dprintf("rgblight_config.hue = %d\n", rgblight_config.hue); @@ -152,6 +188,11 @@ void eeconfig_debug_rgblight(void) { } void rgblight_init(void) { + /* if already initialized, don't do it again. + If you must do it again, extern this and set to false, first. + This is a dirty, dirty hack until proper hooks can be added for keyboard startup. */ + if (is_rgblight_initialized) { return; } + debug_enable = 1; // Debug ON! dprintf("rgblight_init called.\n"); dprintf("rgblight_init start!\n"); @@ -161,11 +202,14 @@ void rgblight_init(void) { eeconfig_update_rgblight_default(); } rgblight_config.raw = eeconfig_read_rgblight(); + RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; if (!rgblight_config.mode) { dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); eeconfig_update_rgblight_default(); rgblight_config.raw = eeconfig_read_rgblight(); } + rgblight_check_config(); + eeconfig_debug_rgblight(); // display current eeprom values #ifdef RGBLIGHT_USE_TIMER @@ -175,13 +219,20 @@ void rgblight_init(void) { if (rgblight_config.enable) { rgblight_mode_noeeprom(rgblight_config.mode); } + + is_rgblight_initialized = true; + +} + +uint32_t rgblight_read_dword(void) { + return rgblight_config.raw; } void rgblight_update_dword(uint32_t dword) { + RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; rgblight_config.raw = dword; - eeconfig_update_rgblight(rgblight_config.raw); if (rgblight_config.enable) - rgblight_mode(rgblight_config.mode); + rgblight_mode_noeeprom(rgblight_config.mode); else { #ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); @@ -205,24 +256,36 @@ void rgblight_decrease(void) { } rgblight_mode(mode); } -void rgblight_step(void) { +void rgblight_step_helper(bool write_to_eeprom) { uint8_t mode = 0; mode = rgblight_config.mode + 1; if (mode > RGBLIGHT_MODES) { mode = 1; } - rgblight_mode(mode); + rgblight_mode_eeprom_helper(mode, write_to_eeprom); } -void rgblight_step_reverse(void) { +void rgblight_step_noeeprom(void) { + rgblight_step_helper(false); +} +void rgblight_step(void) { + rgblight_step_helper(true); +} +void rgblight_step_reverse_helper(bool write_to_eeprom) { uint8_t mode = 0; mode = rgblight_config.mode - 1; if (mode < 1) { mode = RGBLIGHT_MODES; } - rgblight_mode(mode); + rgblight_mode_eeprom_helper(mode, write_to_eeprom); +} +void rgblight_step_reverse_noeeprom(void) { + rgblight_step_reverse_helper(false); +} +void rgblight_step_reverse(void) { + rgblight_step_reverse_helper(true); } -uint32_t rgblight_get_mode(void) { +uint8_t rgblight_get_mode(void) { if (!rgblight_config.enable) { return false; } @@ -241,11 +304,12 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { } else { rgblight_config.mode = mode; } + RGBLIGHT_SPLIT_SET_CHANGE_MODE; if (write_to_eeprom) { eeconfig_update_rgblight(rgblight_config.raw); - xprintf("rgblight mode [EEPROM]: %u\n", rgblight_config.mode); + dprintf("rgblight mode [EEPROM]: %u\n", rgblight_config.mode); } else { - xprintf("rgblight mode [NOEEPROM]: %u\n", rgblight_config.mode); + dprintf("rgblight mode [NOEEPROM]: %u\n", rgblight_config.mode); } if( is_static_effect(rgblight_config.mode) ) { #ifdef RGBLIGHT_USE_TIMER @@ -256,6 +320,9 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { rgblight_timer_enable(); #endif } +#ifdef RGBLIGHT_USE_TIMER + animation_status.restart = true; +#endif rgblight_sethsv_noeeprom(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); } @@ -269,7 +336,7 @@ void rgblight_mode_noeeprom(uint8_t mode) { void rgblight_toggle(void) { - xprintf("rgblight toggle [EEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable); + dprintf("rgblight toggle [EEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable); if (rgblight_config.enable) { rgblight_disable(); } @@ -279,7 +346,7 @@ void rgblight_toggle(void) { } void rgblight_toggle_noeeprom(void) { - xprintf("rgblight toggle [NOEEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable); + dprintf("rgblight toggle [NOEEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable); if (rgblight_config.enable) { rgblight_disable_noeeprom(); } @@ -292,122 +359,124 @@ void rgblight_enable(void) { rgblight_config.enable = 1; // No need to update EEPROM here. rgblight_mode() will do that, actually //eeconfig_update_rgblight(rgblight_config.raw); - xprintf("rgblight enable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); + dprintf("rgblight enable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); rgblight_mode(rgblight_config.mode); } void rgblight_enable_noeeprom(void) { rgblight_config.enable = 1; - xprintf("rgblight enable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); + dprintf("rgblight enable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); rgblight_mode_noeeprom(rgblight_config.mode); } void rgblight_disable(void) { rgblight_config.enable = 0; eeconfig_update_rgblight(rgblight_config.raw); - xprintf("rgblight disable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); + dprintf("rgblight disable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); #ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); #endif + RGBLIGHT_SPLIT_SET_CHANGE_MODE; wait_ms(50); rgblight_set(); } void rgblight_disable_noeeprom(void) { rgblight_config.enable = 0; - xprintf("rgblight disable [noEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); + dprintf("rgblight disable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); #ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); #endif - _delay_ms(50); + RGBLIGHT_SPLIT_SET_CHANGE_MODE; + wait_ms(50); rgblight_set(); } - -// Deals with the messy details of incrementing an integer -uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { - int16_t new_value = value; - new_value += step; - return MIN( MAX( new_value, min ), max ); +void rgblight_increase_hue_helper(bool write_to_eeprom) { + uint8_t hue = rgblight_config.hue + RGBLIGHT_HUE_STEP; + rgblight_sethsv_eeprom_helper(hue, rgblight_config.sat, rgblight_config.val, write_to_eeprom); } - -uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { - int16_t new_value = value; - new_value -= step; - return MIN( MAX( new_value, min ), max ); +void rgblight_increase_hue_noeeprom(void) { + rgblight_increase_hue_helper(false); } - void rgblight_increase_hue(void) { - uint16_t hue; - hue = (rgblight_config.hue+RGBLIGHT_HUE_STEP) % 360; - rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); + rgblight_increase_hue_helper(true); +} +void rgblight_decrease_hue_helper(bool write_to_eeprom) { + uint8_t hue = rgblight_config.hue - RGBLIGHT_HUE_STEP; + rgblight_sethsv_eeprom_helper(hue, rgblight_config.sat, rgblight_config.val, write_to_eeprom); +} +void rgblight_decrease_hue_noeeprom(void) { + rgblight_decrease_hue_helper(false); } void rgblight_decrease_hue(void) { - uint16_t hue; - if (rgblight_config.hue-RGBLIGHT_HUE_STEP < 0) { - hue = (rgblight_config.hue + 360 - RGBLIGHT_HUE_STEP) % 360; - } else { - hue = (rgblight_config.hue - RGBLIGHT_HUE_STEP) % 360; - } - rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); + rgblight_decrease_hue_helper(true); +} +void rgblight_increase_sat_helper(bool write_to_eeprom) { + uint8_t sat = qadd8(rgblight_config.sat, RGBLIGHT_SAT_STEP); + rgblight_sethsv_eeprom_helper(rgblight_config.hue, sat, rgblight_config.val, write_to_eeprom); +} +void rgblight_increase_sat_noeeprom(void) { + rgblight_increase_sat_helper(false); } void rgblight_increase_sat(void) { - uint8_t sat; - if (rgblight_config.sat + RGBLIGHT_SAT_STEP > 255) { - sat = 255; - } else { - sat = rgblight_config.sat + RGBLIGHT_SAT_STEP; - } - rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); + rgblight_increase_sat_helper(true); +} +void rgblight_decrease_sat_helper(bool write_to_eeprom) { + uint8_t sat = qsub8(rgblight_config.sat, RGBLIGHT_SAT_STEP); + rgblight_sethsv_eeprom_helper(rgblight_config.hue, sat, rgblight_config.val, write_to_eeprom); +} +void rgblight_decrease_sat_noeeprom(void) { + rgblight_decrease_sat_helper(false); } void rgblight_decrease_sat(void) { - uint8_t sat; - if (rgblight_config.sat - RGBLIGHT_SAT_STEP < 0) { - sat = 0; - } else { - sat = rgblight_config.sat - RGBLIGHT_SAT_STEP; - } - rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); + rgblight_decrease_sat_helper(true); +} +void rgblight_increase_val_helper(bool write_to_eeprom) { + uint8_t val = qadd8(rgblight_config.val, RGBLIGHT_VAL_STEP); + rgblight_sethsv_eeprom_helper(rgblight_config.hue, rgblight_config.sat, val, write_to_eeprom); +} +void rgblight_increase_val_noeeprom(void) { + rgblight_increase_val_helper(false); } void rgblight_increase_val(void) { - uint8_t val; - if (rgblight_config.val + RGBLIGHT_VAL_STEP > RGBLIGHT_LIMIT_VAL) { - val = RGBLIGHT_LIMIT_VAL; - } else { - val = rgblight_config.val + RGBLIGHT_VAL_STEP; - } - rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); + rgblight_increase_val_helper(true); +} +void rgblight_decrease_val_helper(bool write_to_eeprom) { + uint8_t val = qsub8(rgblight_config.val, RGBLIGHT_VAL_STEP); + rgblight_sethsv_eeprom_helper(rgblight_config.hue, rgblight_config.sat, val, write_to_eeprom); +} +void rgblight_decrease_val_noeeprom(void) { + rgblight_decrease_val_helper(false); } void rgblight_decrease_val(void) { - uint8_t val; - if (rgblight_config.val - RGBLIGHT_VAL_STEP < 0) { - val = 0; - } else { - val = rgblight_config.val - RGBLIGHT_VAL_STEP; - } - rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); + rgblight_decrease_val_helper(true); } void rgblight_increase_speed(void) { - rgblight_config.speed = increment( rgblight_config.speed, 1, 0, 3 ); + if (rgblight_config.speed < 3) + rgblight_config.speed++; + //RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED? eeconfig_update_rgblight(rgblight_config.raw);//EECONFIG needs to be increased to support this } void rgblight_decrease_speed(void) { - rgblight_config.speed = decrement( rgblight_config.speed, 1, 0, 3 ); + if (rgblight_config.speed > 0) + rgblight_config.speed--; + //RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED?? eeconfig_update_rgblight(rgblight_config.raw);//EECONFIG needs to be increased to support this } -void rgblight_sethsv_noeeprom_old(uint16_t hue, uint8_t sat, uint8_t val) { +void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) { if (rgblight_config.enable) { LED_TYPE tmp_led; sethsv(hue, sat, val, &tmp_led); - // dprintf("rgblight set hue [MEMORY]: %u,%u,%u\n", inmem_config.hue, inmem_config.sat, inmem_config.val); rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); } } -void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom) { +void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom) { if (rgblight_config.enable) { + rgblight_status.base_mode = mode_base_table[rgblight_config.mode]; if (rgblight_config.mode == RGBLIGHT_MODE_STATIC_LIGHT) { // same static color LED_TYPE tmp_led; @@ -418,63 +487,76 @@ void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool if ( 1 == 0 ) { //dummy } #ifdef RGBLIGHT_EFFECT_BREATHING - else if (rgblight_config.mode >= RGBLIGHT_MODE_BREATHING && - rgblight_config.mode <= RGBLIGHT_MODE_BREATHING_end) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_BREATHING ) { // breathing mode, ignore the change of val, use in memory value instead val = rgblight_config.val; } #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD - else if (rgblight_config.mode >= RGBLIGHT_MODE_RAINBOW_MOOD && - rgblight_config.mode <= RGBLIGHT_MODE_RAINBOW_MOOD_end) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_RAINBOW_MOOD) { // rainbow mood, ignore the change of hue hue = rgblight_config.hue; } #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL - else if (rgblight_config.mode >= RGBLIGHT_MODE_RAINBOW_SWIRL && - rgblight_config.mode <= RGBLIGHT_MODE_RAINBOW_SWIRL_end) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_RAINBOW_SWIRL) { // rainbow swirl, ignore the change of hue hue = rgblight_config.hue; } #endif #ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT - else if (rgblight_config.mode >= RGBLIGHT_MODE_STATIC_GRADIENT && - rgblight_config.mode <= RGBLIGHT_MODE_STATIC_GRADIENT_end) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_STATIC_GRADIENT) { // static gradient - uint16_t _hue; - int8_t direction = ((rgblight_config.mode - RGBLIGHT_MODE_STATIC_GRADIENT) % 2) ? -1 : 1; - uint16_t range = pgm_read_word(&RGBLED_GRADIENT_RANGES[(rgblight_config.mode - RGBLIGHT_MODE_STATIC_GRADIENT) / 2]); - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - _hue = (range / RGBLED_NUM * i * direction + hue + 360) % 360; - dprintf("rgblight rainbow set hsv: %u,%u,%d,%u\n", i, _hue, direction, range); - sethsv(_hue, sat, val, (LED_TYPE *)&led[i]); + uint8_t delta = rgblight_config.mode - rgblight_status.base_mode; + bool direction = (delta % 2) == 0; +#ifdef __AVR__ + // probably due to how pgm_read_word is defined for ARM, but the ARM compiler really hates this line + uint8_t range = pgm_read_word(&RGBLED_GRADIENT_RANGES[delta / 2]); +#else + uint8_t range = RGBLED_GRADIENT_RANGES[delta / 2]; +#endif + for (uint8_t i = 0; i < effect_num_leds; i++) { + uint8_t _hue = ((uint16_t)i * (uint16_t)range) / effect_num_leds; + if (direction) { + _hue = hue + _hue; + } else { + _hue = hue - _hue; + } + dprintf("rgblight rainbow set hsv: %d,%d,%d,%u\n", i, _hue, direction, range); + sethsv(_hue, sat, val, (LED_TYPE *)&led[i + effect_start_pos]); } rgblight_set(); } #endif } +#ifdef RGBLIGHT_SPLIT + if( rgblight_config.hue != hue || + rgblight_config.sat != sat || + rgblight_config.val != val ) { + RGBLIGHT_SPLIT_SET_CHANGE_HSVS; + } +#endif rgblight_config.hue = hue; rgblight_config.sat = sat; rgblight_config.val = val; if (write_to_eeprom) { eeconfig_update_rgblight(rgblight_config.raw); - xprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + dprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); } else { - xprintf("rgblight set hsv [NOEEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + dprintf("rgblight set hsv [NOEEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); } } } -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { +void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, true); } -void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { +void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } -uint16_t rgblight_get_hue(void) { +uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } @@ -489,7 +571,7 @@ uint8_t rgblight_get_val(void) { void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) { if (!rgblight_config.enable) { return; } - for (uint8_t i = 0; i < RGBLED_NUM; i++) { + for (uint8_t i = effect_start_pos; i < effect_end_pos; i++) { led[i].r = r; led[i].g = g; led[i].b = b; @@ -506,7 +588,7 @@ void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index) { rgblight_set(); } -void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index) { +void rgblight_sethsv_at(uint8_t hue, uint8_t sat, uint8_t val, uint8_t index) { if (!rgblight_config.enable) { return; } LED_TYPE tmp_led; @@ -514,33 +596,139 @@ void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index) { rgblight_setrgb_at(tmp_led.r, tmp_led.g, tmp_led.b, index); } +#if defined(RGBLIGHT_EFFECT_BREATHING) || defined(RGBLIGHT_EFFECT_RAINBOW_MOOD) || defined(RGBLIGHT_EFFECT_RAINBOW_SWIRL) \ + || defined(RGBLIGHT_EFFECT_SNAKE) || defined(RGBLIGHT_EFFECT_KNIGHT) + +static uint8_t get_interval_time(const uint8_t* default_interval_address, uint8_t velocikey_min, uint8_t velocikey_max) { + return +#ifdef VELOCIKEY_ENABLE + velocikey_enabled() ? velocikey_match_speed(velocikey_min, velocikey_max) : +#endif + pgm_read_byte(default_interval_address); +} + +#endif + +void rgblight_setrgb_range(uint8_t r, uint8_t g, uint8_t b, uint8_t start, uint8_t end) { + if (!rgblight_config.enable || start < 0 || start >= end || end > RGBLED_NUM) { return; } + + for (uint8_t i = start; i < end; i++) { + led[i].r = r; + led[i].g = g; + led[i].b = b; + } + rgblight_set(); + wait_ms(1); +} + +void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end) { + if (!rgblight_config.enable) { return; } + + LED_TYPE tmp_led; + sethsv(hue, sat, val, &tmp_led); + rgblight_setrgb_range(tmp_led.r, tmp_led.g, tmp_led.b, start, end); +} + +#ifndef RGBLIGHT_SPLIT +void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b) { + rgblight_setrgb_range(r, g, b, 0 , (uint8_t) RGBLED_NUM/2); +} + +void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b) { + rgblight_setrgb_range(r, g, b, (uint8_t) RGBLED_NUM/2, (uint8_t) RGBLED_NUM); +} + +void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val) { + rgblight_sethsv_range(hue, sat, val, 0, (uint8_t) RGBLED_NUM/2); +} + +void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val) { + rgblight_sethsv_range(hue, sat, val, (uint8_t) RGBLED_NUM/2, (uint8_t) RGBLED_NUM); +} +#endif // ifndef RGBLIGHT_SPLIT + #ifndef RGBLIGHT_CUSTOM_DRIVER void rgblight_set(void) { - if (rgblight_config.enable) { - #ifdef RGBW - ws2812_setleds_rgbw(led, RGBLED_NUM); - #else - ws2812_setleds(led, RGBLED_NUM); - #endif - } else { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { + LED_TYPE *start_led; + uint16_t num_leds = clipping_num_leds; + + if (!rgblight_config.enable) { + for (uint8_t i = effect_start_pos; i < effect_end_pos; i++) { led[i].r = 0; led[i].g = 0; led[i].b = 0; } - #ifdef RGBW - ws2812_setleds_rgbw(led, RGBLED_NUM); - #else - ws2812_setleds(led, RGBLED_NUM); - #endif } +#ifdef RGBLIGHT_LED_MAP + LED_TYPE led0[RGBLED_NUM]; + for(uint8_t i = 0; i < RGBLED_NUM; i++) { + led0[i] = led[pgm_read_byte(&led_map[i])]; + } + start_led = led0 + clipping_start_pos; +#else + start_led = led + clipping_start_pos; +#endif +#ifdef RGBW + ws2812_setleds_rgbw(start_led, num_leds); +#else + ws2812_setleds(start_led, num_leds); +#endif } #endif +#ifdef RGBLIGHT_SPLIT +/* for split keyboard master side */ +uint8_t rgblight_get_change_flags(void) { + return rgblight_status.change_flags; +} + +void rgblight_clear_change_flags(void) { + rgblight_status.change_flags = 0; +} + +void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo) { + syncinfo->config = rgblight_config; + syncinfo->status = rgblight_status; +} + +/* for split keyboard slave side */ +void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom) { + if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_MODE) { + if (syncinfo->config.enable) { + rgblight_config.enable = 1; // == rgblight_enable_noeeprom(); + rgblight_mode_eeprom_helper(syncinfo->config.mode, write_to_eeprom); + } else { + rgblight_disable_noeeprom(); + } + } + if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_HSVS) { + rgblight_sethsv_eeprom_helper(syncinfo->config.hue, syncinfo->config.sat, syncinfo->config.val, write_to_eeprom); + // rgblight_config.speed = config->speed; // NEED??? + } + #ifdef RGBLIGHT_USE_TIMER + if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_TIMER) { + if (syncinfo->status.timer_enabled) { + rgblight_timer_enable(); + } else { + rgblight_timer_disable(); + } + } + #ifndef RGBLIGHT_SPLIT_NO_ANIMATION_SYNC + if (syncinfo->status.change_flags & RGBLIGHT_STATUS_ANIMATION_TICK) { + animation_status.restart = true; + } + #endif /* RGBLIGHT_SPLIT_NO_ANIMATION_SYNC */ + #endif /* RGBLIGHT_USE_TIMER */ +} +#endif /* RGBLIGHT_SPLIT */ + #ifdef RGBLIGHT_USE_TIMER -// Animation timer -- AVR Timer3 +typedef void (*effect_func_t)(animation_status_t *anim); + +// Animation timer -- use system timer (AVR Timer0) void rgblight_timer_init(void) { + // OLD!!!! Animation timer -- AVR Timer3 // static uint8_t rgblight_timer_is_init = 0; // if (rgblight_timer_is_init) { // return; @@ -556,19 +744,29 @@ void rgblight_timer_init(void) { // OCR3AL = RGBLED_TIMER_TOP & 0xff; // SREG = sreg; - rgblight_timer_enabled = true; + rgblight_status.timer_enabled = false; + RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE; } void rgblight_timer_enable(void) { - rgblight_timer_enabled = true; - dprintf("TIMER3 enabled.\n"); + if( !is_static_effect(rgblight_config.mode) ) { + rgblight_status.timer_enabled = true; + } + animation_status.last_timer = timer_read(); + RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE; + dprintf("rgblight timer enabled.\n"); } void rgblight_timer_disable(void) { - rgblight_timer_enabled = false; - dprintf("TIMER3 disabled.\n"); + rgblight_status.timer_enabled = false; + RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE; + dprintf("rgblight timer disable.\n"); } void rgblight_timer_toggle(void) { - rgblight_timer_enabled ^= rgblight_timer_enabled; - dprintf("TIMER3 toggled.\n"); + dprintf("rgblight timer toggle.\n"); + if(rgblight_status.timer_enabled) { + rgblight_timer_disable(); + } else { + rgblight_timer_enable(); + } } void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b) { @@ -577,63 +775,111 @@ void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb(r, g, b); } +static void rgblight_effect_dummy(animation_status_t *anim) { + // do nothing + /******** + dprintf("rgblight_task() what happened?\n"); + dprintf("is_static_effect %d\n", is_static_effect(rgblight_config.mode)); + dprintf("mode = %d, base_mode = %d, timer_enabled %d, ", + rgblight_config.mode, rgblight_status.base_mode, + rgblight_status.timer_enabled); + dprintf("last_timer = %d\n",anim->last_timer); + **/ +} + void rgblight_task(void) { - if (rgblight_timer_enabled) { + if (rgblight_status.timer_enabled) { + effect_func_t effect_func = rgblight_effect_dummy; + uint16_t interval_time = 2000; // dummy interval + uint8_t delta = rgblight_config.mode - rgblight_status.base_mode; + animation_status.delta = delta; + // static light mode, do nothing here if ( 1 == 0 ) { //dummy } #ifdef RGBLIGHT_EFFECT_BREATHING - else if (rgblight_config.mode >= RGBLIGHT_MODE_BREATHING && - rgblight_config.mode <= RGBLIGHT_MODE_BREATHING_end) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_BREATHING) { // breathing mode - rgblight_effect_breathing(rgblight_config.mode - RGBLIGHT_MODE_BREATHING ); + interval_time = get_interval_time(&RGBLED_BREATHING_INTERVALS[delta], 1, 100); + effect_func = rgblight_effect_breathing; } #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD - else if (rgblight_config.mode >= RGBLIGHT_MODE_RAINBOW_MOOD && - rgblight_config.mode <= RGBLIGHT_MODE_RAINBOW_MOOD_end) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_RAINBOW_MOOD) { // rainbow mood mode - rgblight_effect_rainbow_mood(rgblight_config.mode - RGBLIGHT_MODE_RAINBOW_MOOD); + interval_time = get_interval_time(&RGBLED_RAINBOW_MOOD_INTERVALS[delta], 5, 100); + effect_func = rgblight_effect_rainbow_mood; } #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL - else if (rgblight_config.mode >= RGBLIGHT_MODE_RAINBOW_SWIRL && - rgblight_config.mode <= RGBLIGHT_MODE_RAINBOW_SWIRL_end) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_RAINBOW_SWIRL) { // rainbow swirl mode - rgblight_effect_rainbow_swirl(rgblight_config.mode - RGBLIGHT_MODE_RAINBOW_SWIRL); + interval_time = get_interval_time(&RGBLED_RAINBOW_SWIRL_INTERVALS[delta / 2], 1, 100); + effect_func = rgblight_effect_rainbow_swirl; } #endif #ifdef RGBLIGHT_EFFECT_SNAKE - else if (rgblight_config.mode >= RGBLIGHT_MODE_SNAKE && - rgblight_config.mode <= RGBLIGHT_MODE_SNAKE_end) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_SNAKE) { // snake mode - rgblight_effect_snake(rgblight_config.mode - RGBLIGHT_MODE_SNAKE); + interval_time = get_interval_time(&RGBLED_SNAKE_INTERVALS[delta / 2], 1, 200); + effect_func = rgblight_effect_snake; } #endif #ifdef RGBLIGHT_EFFECT_KNIGHT - else if (rgblight_config.mode >= RGBLIGHT_MODE_KNIGHT && - rgblight_config.mode <= RGBLIGHT_MODE_KNIGHT_end) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_KNIGHT) { // knight mode - rgblight_effect_knight(rgblight_config.mode - RGBLIGHT_MODE_KNIGHT); + interval_time = get_interval_time(&RGBLED_KNIGHT_INTERVALS[delta], 5, 100); + effect_func = rgblight_effect_knight; } #endif #ifdef RGBLIGHT_EFFECT_CHRISTMAS - else if (rgblight_config.mode == RGBLIGHT_MODE_CHRISTMAS) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_CHRISTMAS) { // christmas mode - rgblight_effect_christmas(); + interval_time = RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL; + effect_func = (effect_func_t)rgblight_effect_christmas; } #endif #ifdef RGBLIGHT_EFFECT_RGB_TEST - else if (rgblight_config.mode == RGBLIGHT_MODE_RGB_TEST) { + else if (rgblight_status.base_mode == RGBLIGHT_MODE_RGB_TEST) { // RGB test mode - rgblight_effect_rgbtest(); + interval_time = pgm_read_word(&RGBLED_RGBTEST_INTERVALS[0]); + effect_func = (effect_func_t)rgblight_effect_rgbtest; } #endif #ifdef RGBLIGHT_EFFECT_ALTERNATING - else if (rgblight_config.mode == RGBLIGHT_MODE_ALTERNATING){ - rgblight_effect_alternating(); + else if (rgblight_status.base_mode == RGBLIGHT_MODE_ALTERNATING){ + interval_time = 500; + effect_func = (effect_func_t)rgblight_effect_alternating; + } +#endif + if (animation_status.restart) { + animation_status.restart = false; + animation_status.last_timer = timer_read() - interval_time - 1; + animation_status.pos16 = 0; // restart signal to local each effect } + if (timer_elapsed(animation_status.last_timer) >= interval_time) { +#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) + static uint16_t report_last_timer = 0; + static bool tick_flag = false; + uint16_t oldpos16; + if (tick_flag) { + tick_flag = false; + if (timer_elapsed(report_last_timer) >= 30000) { + report_last_timer = timer_read(); + dprintf("rgblight animation tick report to slave\n"); + RGBLIGHT_SPLIT_ANIMATION_TICK; + } + } + oldpos16 = animation_status.pos16; #endif + animation_status.last_timer += interval_time; + effect_func(&animation_status); +#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) + if (animation_status.pos16 == 0 && oldpos16 != 0) { + tick_flag = true; + } +#endif + } } } @@ -641,23 +887,28 @@ void rgblight_task(void) { // Effects #ifdef RGBLIGHT_EFFECT_BREATHING + +#ifndef RGBLIGHT_EFFECT_BREATHE_CENTER + #ifndef RGBLIGHT_BREATHE_TABLE_SIZE + #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256 or 128 or 64 + #endif + #include +#endif + __attribute__ ((weak)) const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; -void rgblight_effect_breathing(uint8_t interval) { - static uint8_t pos = 0; - static uint16_t last_timer = 0; +void rgblight_effect_breathing(animation_status_t *anim) { float val; - if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_BREATHING_INTERVALS[interval])) { - return; - } - last_timer = timer_read(); - // http://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/ - val = (exp(sin((pos/255.0)*M_PI)) - RGBLIGHT_EFFECT_BREATHE_CENTER/M_E)*(RGBLIGHT_EFFECT_BREATHE_MAX/(M_E-1/M_E)); +#ifdef RGBLIGHT_EFFECT_BREATHE_TABLE + val = pgm_read_byte(&rgblight_effect_breathe_table[anim->pos / table_scale]); +#else + val = (exp(sin((anim->pos/255.0)*M_PI)) - RGBLIGHT_EFFECT_BREATHE_CENTER/M_E)*(RGBLIGHT_EFFECT_BREATHE_MAX/(M_E-1/M_E)); +#endif rgblight_sethsv_noeeprom_old(rgblight_config.hue, rgblight_config.sat, val); - pos = (pos + 1) % 256; + anim->pos = (anim->pos + 1); } #endif @@ -665,46 +916,34 @@ void rgblight_effect_breathing(uint8_t interval) { __attribute__ ((weak)) const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {120, 60, 30}; -void rgblight_effect_rainbow_mood(uint8_t interval) { - static uint16_t current_hue = 0; - static uint16_t last_timer = 0; - - if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_RAINBOW_MOOD_INTERVALS[interval])) { - return; - } - last_timer = timer_read(); - rgblight_sethsv_noeeprom_old(current_hue, rgblight_config.sat, rgblight_config.val); - current_hue = (current_hue + 1) % 360; +void rgblight_effect_rainbow_mood(animation_status_t *anim) { + rgblight_sethsv_noeeprom_old(anim->current_hue, rgblight_config.sat, rgblight_config.val); + anim->current_hue++; } #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL +#ifndef RGBLIGHT_RAINBOW_SWIRL_RANGE + #define RGBLIGHT_RAINBOW_SWIRL_RANGE 255 +#endif + __attribute__ ((weak)) const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; -void rgblight_effect_rainbow_swirl(uint8_t interval) { - static uint16_t current_hue = 0; - static uint16_t last_timer = 0; - uint16_t hue; +void rgblight_effect_rainbow_swirl(animation_status_t *anim) { + uint8_t hue; uint8_t i; - if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_RAINBOW_SWIRL_INTERVALS[interval / 2])) { - return; - } - last_timer = timer_read(); - for (i = 0; i < RGBLED_NUM; i++) { - hue = (360 / RGBLED_NUM * i + current_hue) % 360; - sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); + + for (i = 0; i < effect_num_leds; i++) { + hue = (RGBLIGHT_RAINBOW_SWIRL_RANGE / effect_num_leds * i + anim->current_hue); + sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i + effect_start_pos]); } rgblight_set(); - if (interval % 2) { - current_hue = (current_hue + 1) % 360; + if (anim->delta % 2) { + anim->current_hue++; } else { - if (current_hue - 1 < 0) { - current_hue = 359; - } else { - current_hue = current_hue - 1; - } + anim->current_hue--; } } #endif @@ -713,42 +952,62 @@ void rgblight_effect_rainbow_swirl(uint8_t interval) { __attribute__ ((weak)) const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; -void rgblight_effect_snake(uint8_t interval) { +void rgblight_effect_snake(animation_status_t *anim) { static uint8_t pos = 0; - static uint16_t last_timer = 0; uint8_t i, j; int8_t k; int8_t increment = 1; - if (interval % 2) { + + if (anim->delta % 2) { increment = -1; } - if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_SNAKE_INTERVALS[interval / 2])) { - return; + +#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) + if (anim->pos == 0) { // restart signal + if (increment == 1) { + pos = effect_num_leds - 1; + } else { + pos = 0; + } + anim->pos = 1; } - last_timer = timer_read(); - for (i = 0; i < RGBLED_NUM; i++) { - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; +#endif + + for (i = 0; i < effect_num_leds; i++) { + LED_TYPE *ledp = led + i + effect_start_pos; + ledp->r = 0; + ledp->g = 0; + ledp->b = 0; for (j = 0; j < RGBLIGHT_EFFECT_SNAKE_LENGTH; j++) { k = pos + j * increment; if (k < 0) { - k = k + RGBLED_NUM; + k = k + effect_num_leds; } if (i == k) { - sethsv(rgblight_config.hue, rgblight_config.sat, (uint8_t)(rgblight_config.val*(RGBLIGHT_EFFECT_SNAKE_LENGTH-j)/RGBLIGHT_EFFECT_SNAKE_LENGTH), (LED_TYPE *)&led[i]); + sethsv(rgblight_config.hue, rgblight_config.sat, + (uint8_t)(rgblight_config.val*(RGBLIGHT_EFFECT_SNAKE_LENGTH-j)/RGBLIGHT_EFFECT_SNAKE_LENGTH), + ledp); } } } rgblight_set(); if (increment == 1) { if (pos - 1 < 0) { - pos = RGBLED_NUM - 1; + pos = effect_num_leds - 1; +#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) + anim->pos = 0; +#endif } else { pos -= 1; +#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) + anim->pos = 1; +#endif } } else { - pos = (pos + 1) % RGBLED_NUM; + pos = (pos + 1) % effect_num_leds; +#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) + anim->pos = pos; +#endif } } #endif @@ -757,27 +1016,30 @@ void rgblight_effect_snake(uint8_t interval) { __attribute__ ((weak)) const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31}; -void rgblight_effect_knight(uint8_t interval) { - static uint16_t last_timer = 0; - if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval])) { - return; - } - last_timer = timer_read(); +void rgblight_effect_knight(animation_status_t *anim) { static int8_t low_bound = 0; static int8_t high_bound = RGBLIGHT_EFFECT_KNIGHT_LENGTH - 1; static int8_t increment = 1; uint8_t i, cur; +#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) + if (anim->pos == 0) { // restart signal + anim->pos = 1; + low_bound = 0; + high_bound = RGBLIGHT_EFFECT_KNIGHT_LENGTH - 1; + increment = 1; + } +#endif // Set all the LEDs to 0 - for (i = 0; i < RGBLED_NUM; i++) { + for (i = effect_start_pos; i < effect_end_pos; i++) { led[i].r = 0; led[i].g = 0; led[i].b = 0; } // Determine which LEDs should be lit up for (i = 0; i < RGBLIGHT_EFFECT_KNIGHT_LED_NUM; i++) { - cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % RGBLED_NUM; + cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % effect_num_leds + effect_start_pos; if (i >= low_bound && i <= high_bound) { sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[cur]); @@ -796,24 +1058,24 @@ void rgblight_effect_knight(uint8_t interval) { if (high_bound <= 0 || low_bound >= RGBLIGHT_EFFECT_KNIGHT_LED_NUM - 1) { increment = -increment; +#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) + if (increment == 1) { + anim->pos = 0; + } +#endif } } #endif #ifdef RGBLIGHT_EFFECT_CHRISTMAS -void rgblight_effect_christmas(void) { - static uint16_t current_offset = 0; - static uint16_t last_timer = 0; - uint16_t hue; +void rgblight_effect_christmas(animation_status_t *anim) { + uint8_t hue; uint8_t i; - if (timer_elapsed(last_timer) < RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL) { - return; - } - last_timer = timer_read(); - current_offset = (current_offset + 1) % 2; - for (i = 0; i < RGBLED_NUM; i++) { - hue = 0 + ((i/RGBLIGHT_EFFECT_CHRISTMAS_STEP + current_offset) % 2) * 120; - sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); + + anim->current_offset = (anim->current_offset + 1) % 2; + for (i = 0; i < effect_num_leds; i++) { + hue = 0 + ((i/RGBLIGHT_EFFECT_CHRISTMAS_STEP + anim->current_offset) % 2) * 85; + sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i + effect_start_pos]); } rgblight_set(); } @@ -823,52 +1085,40 @@ void rgblight_effect_christmas(void) { __attribute__ ((weak)) const uint16_t RGBLED_RGBTEST_INTERVALS[] PROGMEM = {1024}; -void rgblight_effect_rgbtest(void) { - static uint8_t pos = 0; - static uint16_t last_timer = 0; +void rgblight_effect_rgbtest(animation_status_t *anim) { static uint8_t maxval = 0; uint8_t g; uint8_t r; uint8_t b; - if (timer_elapsed(last_timer) < pgm_read_word(&RGBLED_RGBTEST_INTERVALS[0])) { - return; - } - if( maxval == 0 ) { LED_TYPE tmp_led; sethsv(0, 255, RGBLIGHT_LIMIT_VAL, &tmp_led); maxval = tmp_led.r; } - last_timer = timer_read(); g = r = b = 0; - switch( pos ) { + switch( anim->pos ) { case 0: r = maxval; break; case 1: g = maxval; break; case 2: b = maxval; break; } rgblight_setrgb(r, g, b); - pos = (pos + 1) % 3; + anim->pos = (anim->pos + 1) % 3; } #endif #ifdef RGBLIGHT_EFFECT_ALTERNATING -void rgblight_effect_alternating(void){ - static uint16_t last_timer = 0; - static uint16_t pos = 0; - if (timer_elapsed(last_timer) < 500) { - return; - } - last_timer = timer_read(); - - for(int i = 0; i=RGBLED_NUM/2 && !pos){ - sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); - }else{ - sethsv(rgblight_config.hue, rgblight_config.sat, 0, (LED_TYPE *)&led[i]); +void rgblight_effect_alternating(animation_status_t *anim) { + + for (int i = 0; i < effect_num_leds; i++) { + LED_TYPE *ledp = led + i + effect_start_pos; + if (ipos) { + sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, ledp); + } else if (i>=effect_num_leds/2 && !anim->pos) { + sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, ledp); + } else { + sethsv(rgblight_config.hue, rgblight_config.sat, 0, ledp); } } rgblight_set(); - pos = (pos + 1) % 2; + anim->pos = (anim->pos + 1) % 2; } #endif diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 33b279f08cf..cba18ae7291 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -68,11 +68,11 @@ #define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, #define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_ ## sym, #define _RGBM_MULTI_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, -#define _RGBM_TMP_STATIC(sym) RGBLIGHT_MODE_ ## sym, -#define _RGBM_TMP_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_TMP_STATIC(sym, msym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_TMP_DYNAMIC(sym, msym) RGBLIGHT_MODE_ ## sym, enum RGBLIGHT_EFFECT_MODE { RGBLIGHT_MODE_zero = 0, -#include "rgblight.h" +#include "rgblight_modes.h" RGBLIGHT_MODE_last }; @@ -80,9 +80,7 @@ enum RGBLIGHT_EFFECT_MODE { #define RGBLIGHT_MODES (RGBLIGHT_MODE_last-1) -#ifndef RGBLIGHT_EFFECT_BREATHE_CENTER -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1-2.7 -#endif +// sample: #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 #ifndef RGBLIGHT_EFFECT_BREATHE_MAX #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0-255 @@ -101,7 +99,7 @@ enum RGBLIGHT_EFFECT_MODE { #endif #ifndef RGBLIGHT_EFFECT_KNIGHT_LED_NUM -#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM +#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM (effect_num_leds) #endif #ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL @@ -113,7 +111,7 @@ enum RGBLIGHT_EFFECT_MODE { #endif #ifndef RGBLIGHT_HUE_STEP -#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_HUE_STEP 8 #endif #ifndef RGBLIGHT_SAT_STEP #define RGBLIGHT_SAT_STEP 17 @@ -121,6 +119,9 @@ enum RGBLIGHT_EFFECT_MODE { #ifndef RGBLIGHT_VAL_STEP #define RGBLIGHT_VAL_STEP 17 #endif +#ifndef RGBLIGHT_LIMIT_VAL +#define RGBLIGHT_LIMIT_VAL 255 +#endif #define RGBLED_TIMER_TOP F_CPU/(256*64) // #define RGBLED_TIMER_TOP 0xFF10 @@ -131,7 +132,7 @@ enum RGBLIGHT_EFFECT_MODE { #ifndef RGBLIGHT_CUSTOM_DRIVER #include "ws2812.h" #endif -#include "rgblight_types.h" +#include "color.h" #include "rgblight_list.h" #if defined(__AVR__) @@ -146,47 +147,102 @@ extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM; extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM; extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM; extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM; +extern bool is_rgblight_initialized; +// Should stay in sycn with rgb matrix config as we reuse eeprom storage for both (for now) typedef union { uint32_t raw; struct { bool enable :1; - uint8_t mode :6; - uint16_t hue :9; + uint8_t mode :7; + uint8_t hue :8; uint8_t sat :8; uint8_t val :8; uint8_t speed :8;//EECONFIG needs to be increased to support this }; } rgblight_config_t; -void rgblight_init(void); +typedef struct _rgblight_status_t { + uint8_t base_mode; + bool timer_enabled; +#ifdef RGBLIGHT_SPLIT + uint8_t change_flags; +#endif +} rgblight_status_t; + +/* === Utility Functions ===*/ +void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); +void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); // without RGBLIGHT_LIMIT_VAL check +void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); + +/* === Low level Functions === */ +void rgblight_set(void); +void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds); + +/* === Effects and Animations Functions === */ +/* effect range setting */ +void rgblight_set_effect_range(uint8_t start_pos, uint8_t num_leds); + +/* direct operation */ +void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index); +void rgblight_sethsv_at(uint8_t hue, uint8_t sat, uint8_t val, uint8_t index); +void rgblight_setrgb_range(uint8_t r, uint8_t g, uint8_t b, uint8_t start, uint8_t end); +void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end); +void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); + +#ifndef RGBLIGHT_SPLIT +void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b); +void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b); +void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val); +#endif + +/* effect mode change */ +void rgblight_mode(uint8_t mode); +void rgblight_mode_noeeprom(uint8_t mode); void rgblight_increase(void); void rgblight_decrease(void); +void rgblight_step(void); +void rgblight_step_noeeprom(void); +void rgblight_step_reverse(void); +void rgblight_step_reverse_noeeprom(void); + +/* effects mode disable/enable */ void rgblight_toggle(void); +void rgblight_toggle_noeeprom(void); void rgblight_enable(void); +void rgblight_enable_noeeprom(void); void rgblight_disable(void); -void rgblight_step(void); -void rgblight_step_reverse(void); -uint32_t rgblight_get_mode(void); -void rgblight_mode(uint8_t mode); -void rgblight_set(void); -void rgblight_update_dword(uint32_t dword); +void rgblight_disable_noeeprom(void); + +/* hue, sat, val change */ void rgblight_increase_hue(void); +void rgblight_increase_hue_noeeprom(void); void rgblight_decrease_hue(void); +void rgblight_decrease_hue_noeeprom(void); void rgblight_increase_sat(void); +void rgblight_increase_sat_noeeprom(void); void rgblight_decrease_sat(void); +void rgblight_decrease_sat_noeeprom(void); void rgblight_increase_val(void); +void rgblight_increase_val_noeeprom(void); void rgblight_decrease_val(void); +void rgblight_decrease_val_noeeprom(void); void rgblight_increase_speed(void); void rgblight_decrease_speed(void); -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); -uint16_t rgblight_get_hue(void); +void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val); + +/* query */ +uint8_t rgblight_get_mode(void); +uint8_t rgblight_get_hue(void); uint8_t rgblight_get_sat(void); uint8_t rgblight_get_val(void); -void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); -void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index); -void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index); +/* === qmk_firmware (core)internal Functions === */ +void rgblight_init(void); +uint32_t rgblight_read_dword(void); +void rgblight_update_dword(uint32_t dword); uint32_t eeconfig_read_rgblight(void); void eeconfig_update_rgblight(uint32_t val); void eeconfig_update_rgblight_default(void); @@ -195,19 +251,9 @@ void eeconfig_debug_rgblight(void); void rgb_matrix_increase(void); void rgb_matrix_decrease(void); -void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); -void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); - -void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); -void rgblight_mode_noeeprom(uint8_t mode); -void rgblight_toggle_noeeprom(void); -void rgblight_enable_noeeprom(void); -void rgblight_disable_noeeprom(void); - -void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); +void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); - #define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); @@ -217,82 +263,52 @@ void rgblight_timer_init(void); void rgblight_timer_enable(void); void rgblight_timer_disable(void); void rgblight_timer_toggle(void); -void rgblight_effect_breathing(uint8_t interval); -void rgblight_effect_rainbow_mood(uint8_t interval); -void rgblight_effect_rainbow_swirl(uint8_t interval); -void rgblight_effect_snake(uint8_t interval); -void rgblight_effect_knight(uint8_t interval); -void rgblight_effect_christmas(void); -void rgblight_effect_rgbtest(void); -void rgblight_effect_alternating(void); -#endif // #ifndef RGBLIGHT_H_DUMMY_DEFINE -#endif // RGBLIGHT_H +#ifdef RGBLIGHT_SPLIT + #define RGBLIGHT_STATUS_CHANGE_MODE (1<<0) + #define RGBLIGHT_STATUS_CHANGE_HSVS (1<<1) + #define RGBLIGHT_STATUS_CHANGE_TIMER (1<<2) + #define RGBLIGHT_STATUS_ANIMATION_TICK (1<<3) + + typedef struct _rgblight_syncinfo_t { + rgblight_config_t config; + rgblight_status_t status; + } rgblight_syncinfo_t; + + /* for split keyboard master side */ + uint8_t rgblight_get_change_flags(void); + void rgblight_clear_change_flags(void); + void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo); + /* for split keyboard slave side */ + void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom); +#endif + +#ifdef RGBLIGHT_USE_TIMER + +typedef struct _animation_status_t { + uint16_t last_timer; + uint8_t delta; /* mode - base_mode */ + bool restart; + union { + uint16_t pos16; + uint8_t pos; + int8_t current_hue; + uint16_t current_offset; + }; +} animation_status_t; + +extern animation_status_t animation_status; + +void rgblight_effect_breathing(animation_status_t *anim); +void rgblight_effect_rainbow_mood(animation_status_t *anim); +void rgblight_effect_rainbow_swirl(animation_status_t *anim); +void rgblight_effect_snake(animation_status_t *anim); +void rgblight_effect_knight(animation_status_t *anim); +void rgblight_effect_christmas(animation_status_t *anim); +void rgblight_effect_rgbtest(animation_status_t *anim); +void rgblight_effect_alternating(animation_status_t *anim); -#ifdef _RGBM_SINGLE_STATIC - _RGBM_SINGLE_STATIC( STATIC_LIGHT ) - #ifdef RGBLIGHT_EFFECT_BREATHING - _RGBM_MULTI_DYNAMIC( BREATHING ) - _RGBM_TMP_DYNAMIC( breathing_3 ) - _RGBM_TMP_DYNAMIC( breathing_4 ) - _RGBM_TMP_DYNAMIC( BREATHING_end ) - #endif - #ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD - _RGBM_MULTI_DYNAMIC( RAINBOW_MOOD ) - _RGBM_TMP_DYNAMIC( rainbow_mood_7 ) - _RGBM_TMP_DYNAMIC( RAINBOW_MOOD_end ) - #endif - #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL - _RGBM_MULTI_DYNAMIC( RAINBOW_SWIRL ) - _RGBM_TMP_DYNAMIC( rainbow_swirl_10 ) - _RGBM_TMP_DYNAMIC( rainbow_swirl_11 ) - _RGBM_TMP_DYNAMIC( rainbow_swirl_12 ) - _RGBM_TMP_DYNAMIC( rainbow_swirl_13 ) - _RGBM_TMP_DYNAMIC( RAINBOW_SWIRL_end ) - #endif - #ifdef RGBLIGHT_EFFECT_SNAKE - _RGBM_MULTI_DYNAMIC( SNAKE ) - _RGBM_TMP_DYNAMIC( snake_16 ) - _RGBM_TMP_DYNAMIC( snake_17 ) - _RGBM_TMP_DYNAMIC( snake_18 ) - _RGBM_TMP_DYNAMIC( snake_19 ) - _RGBM_TMP_DYNAMIC( SNAKE_end ) - #endif - #ifdef RGBLIGHT_EFFECT_KNIGHT - _RGBM_MULTI_DYNAMIC( KNIGHT ) - _RGBM_TMP_DYNAMIC( knight_22 ) - _RGBM_TMP_DYNAMIC( KNIGHT_end ) - #endif - #ifdef RGBLIGHT_EFFECT_CHRISTMAS - _RGBM_SINGLE_DYNAMIC( CHRISTMAS ) - #endif - #ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT - _RGBM_MULTI_STATIC( STATIC_GRADIENT ) - _RGBM_TMP_STATIC( static_gradient_26 ) - _RGBM_TMP_STATIC( static_gradient_27 ) - _RGBM_TMP_STATIC( static_gradient_28 ) - _RGBM_TMP_STATIC( static_gradient_29 ) - _RGBM_TMP_STATIC( static_gradient_30 ) - _RGBM_TMP_STATIC( static_gradient_31 ) - _RGBM_TMP_STATIC( static_gradient_32 ) - _RGBM_TMP_STATIC( static_gradient_33 ) - _RGBM_TMP_STATIC( STATIC_GRADIENT_end ) - #endif - #ifdef RGBLIGHT_EFFECT_RGB_TEST - _RGBM_SINGLE_DYNAMIC( RGB_TEST ) - #endif - #ifdef RGBLIGHT_EFFECT_ALTERNATING - _RGBM_SINGLE_DYNAMIC( ALTERNATING ) - #endif - //// Add a new mode here. - // #ifdef RGBLIGHT_EFFECT_ - // _RGBM__( ) - // #endif #endif -#undef _RGBM_SINGLE_STATIC -#undef _RGBM_SINGLE_DYNAMIC -#undef _RGBM_MULTI_STATIC -#undef _RGBM_MULTI_DYNAMIC -#undef _RGBM_TMP_STATIC -#undef _RGBM_TMP_DYNAMIC +#endif // #ifndef RGBLIGHT_H_DUMMY_DEFINE +#endif // RGBLIGHT_H diff --git a/quantum/rgblight_breathe_table.h b/quantum/rgblight_breathe_table.h new file mode 100644 index 00000000000..7ab8cc9479a --- /dev/null +++ b/quantum/rgblight_breathe_table.h @@ -0,0 +1,116 @@ +#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE +#define RGBLIGHT_EFFECT_BREATHE_TABLE + +const uint8_t rgblight_effect_breathe_table[] PROGMEM = { + /* #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 */ + /* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 256 + 0x22, 0x23, 0x25, 0x26, 0x28, 0x29, 0x2a, 0x2c, + 0x2d, 0x2f, 0x30, 0x32, 0x33, 0x35, 0x36, 0x38, + 0x3a, 0x3b, 0x3d, 0x3e, 0x40, 0x42, 0x43, 0x45, + 0x47, 0x49, 0x4a, 0x4c, 0x4e, 0x50, 0x51, 0x53, + 0x55, 0x57, 0x59, 0x5a, 0x5c, 0x5e, 0x60, 0x62, + 0x64, 0x66, 0x68, 0x69, 0x6b, 0x6d, 0x6f, 0x71, + 0x73, 0x75, 0x77, 0x79, 0x7b, 0x7d, 0x7f, 0x81, + 0x83, 0x85, 0x87, 0x89, 0x8a, 0x8c, 0x8e, 0x90, + 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0x9f, + 0xa1, 0xa3, 0xa5, 0xa7, 0xa8, 0xaa, 0xac, 0xae, + 0xaf, 0xb1, 0xb3, 0xb4, 0xb6, 0xb8, 0xb9, 0xbb, + 0xbc, 0xbe, 0xbf, 0xc1, 0xc2, 0xc3, 0xc5, 0xc6, + 0xc7, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xd0, + 0xd1, 0xd2, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd7, 0xd8, 0xd9, 0xd9, 0xda, 0xda, 0xdb, 0xdb, + 0xdb, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdb, + 0xdb, 0xdb, 0xda, 0xda, 0xd9, 0xd9, 0xd8, 0xd7, + 0xd7, 0xd6, 0xd5, 0xd4, 0xd3, 0xd2, 0xd2, 0xd1, + 0xd0, 0xce, 0xcd, 0xcc, 0xcb, 0xca, 0xc9, 0xc7, + 0xc6, 0xc5, 0xc3, 0xc2, 0xc1, 0xbf, 0xbe, 0xbc, + 0xbb, 0xb9, 0xb8, 0xb6, 0xb4, 0xb3, 0xb1, 0xaf, + 0xae, 0xac, 0xaa, 0xa8, 0xa7, 0xa5, 0xa3, 0xa1, + 0x9f, 0x9e, 0x9c, 0x9a, 0x98, 0x96, 0x94, 0x92, + 0x90, 0x8e, 0x8c, 0x8a, 0x89, 0x87, 0x85, 0x83, + 0x81, 0x7f, 0x7d, 0x7b, 0x79, 0x77, 0x75, 0x73, + 0x71, 0x6f, 0x6d, 0x6b, 0x69, 0x68, 0x66, 0x64, + 0x62, 0x60, 0x5e, 0x5c, 0x5a, 0x59, 0x57, 0x55, + 0x53, 0x51, 0x50, 0x4e, 0x4c, 0x4a, 0x49, 0x47, + 0x45, 0x43, 0x42, 0x40, 0x3e, 0x3d, 0x3b, 0x3a, + 0x38, 0x36, 0x35, 0x33, 0x32, 0x30, 0x2f, 0x2d, + 0x2c, 0x2a, 0x29, 0x28, 0x26, 0x25, 0x23, 0x22 + #endif /* 256 bytes table */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 128 + 0x22, 0x25, 0x28, 0x2a, + 0x2d, 0x30, 0x33, 0x36, + 0x3a, 0x3d, 0x40, 0x43, + 0x47, 0x4a, 0x4e, 0x51, + 0x55, 0x59, 0x5c, 0x60, + 0x64, 0x68, 0x6b, 0x6f, + 0x73, 0x77, 0x7b, 0x7f, + 0x83, 0x87, 0x8a, 0x8e, + 0x92, 0x96, 0x9a, 0x9e, + 0xa1, 0xa5, 0xa8, 0xac, + 0xaf, 0xb3, 0xb6, 0xb9, + 0xbc, 0xbf, 0xc2, 0xc5, + 0xc7, 0xca, 0xcc, 0xce, + 0xd1, 0xd2, 0xd4, 0xd6, + 0xd7, 0xd9, 0xda, 0xdb, + 0xdb, 0xdc, 0xdc, 0xdd, + 0xdd, 0xdc, 0xdc, 0xdc, + 0xdb, 0xda, 0xd9, 0xd8, + 0xd7, 0xd5, 0xd3, 0xd2, + 0xd0, 0xcd, 0xcb, 0xc9, + 0xc6, 0xc3, 0xc1, 0xbe, + 0xbb, 0xb8, 0xb4, 0xb1, + 0xae, 0xaa, 0xa7, 0xa3, + 0x9f, 0x9c, 0x98, 0x94, + 0x90, 0x8c, 0x89, 0x85, + 0x81, 0x7d, 0x79, 0x75, + 0x71, 0x6d, 0x69, 0x66, + 0x62, 0x5e, 0x5a, 0x57, + 0x53, 0x50, 0x4c, 0x49, + 0x45, 0x42, 0x3e, 0x3b, + 0x38, 0x35, 0x32, 0x2f, + 0x2c, 0x29, 0x26, 0x23 + #endif /* 128 bytes table */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 64 + 0x22, 0x28, + 0x2d, 0x33, + 0x3a, 0x40, + 0x47, 0x4e, + 0x55, 0x5c, + 0x64, 0x6b, + 0x73, 0x7b, + 0x83, 0x8a, + 0x92, 0x9a, + 0xa1, 0xa8, + 0xaf, 0xb6, + 0xbc, 0xc2, + 0xc7, 0xcc, + 0xd1, 0xd4, + 0xd7, 0xda, + 0xdb, 0xdc, + 0xdd, 0xdc, + 0xdb, 0xd9, + 0xd7, 0xd3, + 0xd0, 0xcb, + 0xc6, 0xc1, + 0xbb, 0xb4, + 0xae, 0xa7, + 0x9f, 0x98, + 0x90, 0x89, + 0x81, 0x79, + 0x71, 0x69, + 0x62, 0x5a, + 0x53, 0x4c, + 0x45, 0x3e, + 0x38, 0x32, + 0x2c, 0x26 + #endif /* 64 bytes table */ +}; + +static const int table_scale = 256/sizeof(rgblight_effect_breathe_table); + +#endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */ diff --git a/quantum/rgblight_list.h b/quantum/rgblight_list.h index 407fd8e9d31..702e33e7654 100644 --- a/quantum/rgblight_list.h +++ b/quantum/rgblight_list.h @@ -13,111 +13,163 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef RGBLIGHT_LIST_H -#define RGBLIGHT_LIST_H +#pragma once + +/* RGB COLORS */ +#define RGB_WHITE 0xFF, 0xFF, 0xFF +#define RGB_RED 0xFF, 0x00, 0x00 +#define RGB_CORAL 0xFF, 0x7C, 0x4D +#define RGB_ORANGE 0xFF, 0x80, 0x00 +#define RGB_GOLDENROD 0xD9, 0xA5, 0x21 +#define RGB_GOLD 0xFF, 0xD9, 0x00 +#define RGB_YELLOW 0xFF, 0xFF, 0x00 +#define RGB_CHARTREUSE 0x80, 0xFF, 0x00 +#define RGB_GREEN 0x00, 0xFF, 0x00 +#define RGB_SPRINGGREEN 0x00, 0xFF, 0x80 +#define RGB_TURQUOISE 0x47, 0x6E, 0x6A +#define RGB_TEAL 0x00, 0x80, 0x80 +#define RGB_CYAN 0x00, 0xFF, 0xFF +#define RGB_AZURE 0x99, 0xf5, 0xFF +#define RGB_BLUE 0x00, 0x00, 0xFF +#define RGB_PURPLE 0x7A, 0x00, 0xFF +#define RGB_MAGENTA 0xFF, 0x00, 0xFF +#define RGB_PINK 0xFF, 0x80, 0xBF + +/* HSV COLORS */ +#define HSV_WHITE 0, 0, 255 +#define HSV_RED 0, 255, 255 +#define HSV_CORAL 11, 176, 255 +#define HSV_ORANGE 28, 255, 255 +#define HSV_GOLDENROD 30, 218, 218 +#define HSV_GOLD 36, 255, 255 +#define HSV_YELLOW 43, 255, 255 +#define HSV_CHARTREUSE 64, 255, 255 +#define HSV_GREEN 85, 255, 255 +#define HSV_SPRINGGREEN 106, 255, 255 +#define HSV_TURQUOISE 123, 90, 112 +#define HSV_TEAL 128, 255, 128 +#define HSV_CYAN 128, 255, 255 +#define HSV_AZURE 132, 102, 255 +#define HSV_BLUE 170, 255, 255 +#define HSV_PURPLE 191, 255, 255 +#define HSV_MAGENTA 213, 255, 255 +#define HSV_PINK 234, 128, 255 + + +/* +######################################################################################## +## ## +## ## +## ## +## The functions below have been deprecated and may be removed in a future release. ## +## ## +## Please use the values above with the RGB functions. ## +## ## +## ## +## ## +######################################################################################## +*/ /* SET RGB List */ -#define rgblight_setrgb_white() rgblight_setrgb (0xFF, 0xFF, 0xFF) -#define rgblight_setrgb_red() rgblight_setrgb (0xFF, 0x00, 0x00) -#define rgblight_setrgb_coral() rgblight_setrgb (0xFF, 0x7C, 0x4D) -#define rgblight_setrgb_orange() rgblight_setrgb (0xFF, 0x80, 0x00) -#define rgblight_setrgb_goldenrod() rgblight_setrgb (0xD9, 0xA5, 0x21) -#define rgblight_setrgb_gold() rgblight_setrgb (0xFF, 0xD9, 0x00) -#define rgblight_setrgb_yellow() rgblight_setrgb (0xFF, 0xFF, 0x00) -#define rgblight_setrgb_chartreuse() rgblight_setrgb (0x80, 0xFF, 0x00) -#define rgblight_setrgb_green() rgblight_setrgb (0x00, 0xFF, 0x00) -#define rgblight_setrgb_springgreen() rgblight_setrgb (0x00, 0xFF, 0x80) -#define rgblight_setrgb_turquoise() rgblight_setrgb (0x47, 0x6E, 0x6A) -#define rgblight_setrgb_teal() rgblight_setrgb (0x00, 0x80, 0x80) -#define rgblight_setrgb_cyan() rgblight_setrgb (0x00, 0xFF, 0xFF) -#define rgblight_setrgb_azure() rgblight_setrgb (0x99, 0xf5, 0xFF) -#define rgblight_setrgb_blue() rgblight_setrgb (0x00, 0x00, 0xFF) -#define rgblight_setrgb_purple() rgblight_setrgb (0x7A, 0x00, 0xFF) -#define rgblight_setrgb_magenta() rgblight_setrgb (0xFF, 0x00, 0xFF) -#define rgblight_setrgb_pink() rgblight_setrgb (0xFF, 0x80, 0xBF) +#define rgblight_setrgb_white() rgblight_setrgb (RGB_WHITE) +#define rgblight_setrgb_red() rgblight_setrgb (RGB_RED) +#define rgblight_setrgb_coral() rgblight_setrgb (RGB_CORAL) +#define rgblight_setrgb_orange() rgblight_setrgb (RGB_ORANGE) +#define rgblight_setrgb_goldenrod() rgblight_setrgb (RGB_GOLDENROD) +#define rgblight_setrgb_gold() rgblight_setrgb (RGB_GOLD) +#define rgblight_setrgb_yellow() rgblight_setrgb (RGB_YELLOW) +#define rgblight_setrgb_chartreuse() rgblight_setrgb (RGB_CHARTREUSE) +#define rgblight_setrgb_green() rgblight_setrgb (RGB_GREEN) +#define rgblight_setrgb_springgreen() rgblight_setrgb (RGB_SPRINGGREEN) +#define rgblight_setrgb_turquoise() rgblight_setrgb (RGB_TURQUOISE) +#define rgblight_setrgb_teal() rgblight_setrgb (RGB_TEAL) +#define rgblight_setrgb_cyan() rgblight_setrgb (RGB_CYAN) +#define rgblight_setrgb_azure() rgblight_setrgb (RGB_AZURE) +#define rgblight_setrgb_blue() rgblight_setrgb (RGB_BLUE) +#define rgblight_setrgb_purple() rgblight_setrgb (RGB_PURPLE) +#define rgblight_setrgb_magenta() rgblight_setrgb (RGB_MAGENTA) +#define rgblight_setrgb_pink() rgblight_setrgb (RGB_PINK) /* SET RGB List */ -#define rgblight_setrgb_white_at(at) rgblight_setrgb_at (0xFF, 0xFF, 0xFF, at) -#define rgblight_setrgb_red_at(at) rgblight_setrgb_at (0xFF, 0x00, 0x00, at) -#define rgblight_setrgb_coral_at(at) rgblight_setrgb_at (0xFF, 0x7C, 0x4D, at) -#define rgblight_setrgb_orange_at(at) rgblight_setrgb_at (0xFF, 0x80, 0x00, at) -#define rgblight_setrgb_goldenrod_at(at) rgblight_setrgb_at (0xD9, 0xA5, 0x21, at) -#define rgblight_setrgb_gold_at(at) rgblight_setrgb_at (0xFF, 0xD9, 0x00, at) -#define rgblight_setrgb_yellow_at(at) rgblight_setrgb_at (0xFF, 0xFF, 0x00, at) -#define rgblight_setrgb_chartreuse_at(at) rgblight_setrgb_at (0x80, 0xFF, 0x00, at) -#define rgblight_setrgb_green_at(at) rgblight_setrgb_at (0x00, 0xFF, 0x00, at) -#define rgblight_setrgb_springgreen_at(at) rgblight_setrgb_at (0x00, 0xFF, 0x80, at) -#define rgblight_setrgb_turquoise_at(at) rgblight_setrgb_at (0x47, 0x6E, 0x6A, at) -#define rgblight_setrgb_teal_at(at) rgblight_setrgb_at (0x00, 0x80, 0x80, at) -#define rgblight_setrgb_cyan_at(at) rgblight_setrgb_at (0x00, 0xFF, 0xFF, at) -#define rgblight_setrgb_azure_at(at) rgblight_setrgb_at (0x99, 0xf5, 0xFF, at) -#define rgblight_setrgb_blue_at(at) rgblight_setrgb_at (0x00, 0x00, 0xFF, at) -#define rgblight_setrgb_purple_at(at) rgblight_setrgb_at (0x7A, 0x00, 0xFF, at) -#define rgblight_setrgb_magenta_at(at) rgblight_setrgb_at (0xFF, 0x00, 0xFF, at) -#define rgblight_setrgb_pink_at(at) rgblight_setrgb_at (0xFF, 0x80, 0xBF, at) +#define rgblight_setrgb_white_at(at) rgblight_setrgb_at (RGB_WHITE, at) +#define rgblight_setrgb_red_at(at) rgblight_setrgb_at (RGB_RED, at) +#define rgblight_setrgb_coral_at(at) rgblight_setrgb_at (RGB_CORAL, at) +#define rgblight_setrgb_orange_at(at) rgblight_setrgb_at (RGB_ORANGE at) +#define rgblight_setrgb_goldenrod_at(at) rgblight_setrgb_at (RGB_GOLDENROD, at) +#define rgblight_setrgb_gold_at(at) rgblight_setrgb_at (RGB_GOLD, at) +#define rgblight_setrgb_yellow_at(at) rgblight_setrgb_at (RGB_YELLOW, at) +#define rgblight_setrgb_chartreuse_at(at) rgblight_setrgb_at (RGB_CHARTREUSE, at) +#define rgblight_setrgb_green_at(at) rgblight_setrgb_at (RGB_GREEN, at) +#define rgblight_setrgb_springgreen_at(at) rgblight_setrgb_at (RGB_SPRINGGREEN, at) +#define rgblight_setrgb_turquoise_at(at) rgblight_setrgb_at (RGB_TURQUOISE, at) +#define rgblight_setrgb_teal_at(at) rgblight_setrgb_at (RGB_TEAL, at) +#define rgblight_setrgb_cyan_at(at) rgblight_setrgb_at (RGB_CYAN, at) +#define rgblight_setrgb_azure_at(at) rgblight_setrgb_at (RGB_AZURE, at) +#define rgblight_setrgb_blue_at(at) rgblight_setrgb_at (RGB_BLUE, at) +#define rgblight_setrgb_purple_at(at) rgblight_setrgb_at (RGB_PURPLE, at) +#define rgblight_setrgb_magenta_at(at) rgblight_setrgb_at (RGB_MAGENTA, at) +#define rgblight_setrgb_pink_at(at) rgblight_setrgb_at (RGB_PINK, at) /* SET HSV List */ -#define rgblight_sethsv_white() rgblight_sethsv ( 0, 0, 255) -#define rgblight_sethsv_red() rgblight_sethsv ( 0, 255, 255) -#define rgblight_sethsv_coral() rgblight_sethsv ( 16, 176, 255) -#define rgblight_sethsv_orange() rgblight_sethsv ( 39, 255, 255) -#define rgblight_sethsv_goldenrod() rgblight_sethsv ( 43, 218, 218) -#define rgblight_sethsv_gold() rgblight_sethsv ( 51, 255, 255) -#define rgblight_sethsv_yellow() rgblight_sethsv ( 60, 255, 255) -#define rgblight_sethsv_chartreuse() rgblight_sethsv ( 90, 255, 255) -#define rgblight_sethsv_green() rgblight_sethsv (120, 255, 255) -#define rgblight_sethsv_springgreen() rgblight_sethsv (150, 255, 255) -#define rgblight_sethsv_turquoise() rgblight_sethsv (174, 90, 112) -#define rgblight_sethsv_teal() rgblight_sethsv (180, 255, 128) -#define rgblight_sethsv_cyan() rgblight_sethsv (180, 255, 255) -#define rgblight_sethsv_azure() rgblight_sethsv (186, 102, 255) -#define rgblight_sethsv_blue() rgblight_sethsv (240, 255, 255) -#define rgblight_sethsv_purple() rgblight_sethsv (270, 255, 255) -#define rgblight_sethsv_magenta() rgblight_sethsv (300, 255, 255) -#define rgblight_sethsv_pink() rgblight_sethsv (330, 128, 255) +#define rgblight_sethsv_white() rgblight_sethsv (HSV_WHITE) +#define rgblight_sethsv_red() rgblight_sethsv (HSV_RED) +#define rgblight_sethsv_coral() rgblight_sethsv (HSV_CORAL) +#define rgblight_sethsv_orange() rgblight_sethsv (HSV_ORANGE) +#define rgblight_sethsv_goldenrod() rgblight_sethsv (HSV_GOLDENROD) +#define rgblight_sethsv_gold() rgblight_sethsv (HSV_GOLD) +#define rgblight_sethsv_yellow() rgblight_sethsv (HSV_YELLOW) +#define rgblight_sethsv_chartreuse() rgblight_sethsv (HSV_CHARTREUSE) +#define rgblight_sethsv_green() rgblight_sethsv (HSV_GREEN) +#define rgblight_sethsv_springgreen() rgblight_sethsv (HSV_SPRINGGREEN) +#define rgblight_sethsv_turquoise() rgblight_sethsv (HSV_TURQUOISE) +#define rgblight_sethsv_teal() rgblight_sethsv (HSV_TEAL) +#define rgblight_sethsv_cyan() rgblight_sethsv (HSV_CYAN) +#define rgblight_sethsv_azure() rgblight_sethsv (HSV_AZURE) +#define rgblight_sethsv_blue() rgblight_sethsv (HSV_BLUE) +#define rgblight_sethsv_purple() rgblight_sethsv (HSV_PURPLE) +#define rgblight_sethsv_magenta() rgblight_sethsv (HSV_MAGENTA) +#define rgblight_sethsv_pink() rgblight_sethsv (HSV_PINK) /* SET HSV List */ /* If you're doing layer indication, this is best, as it won't */ /* write to the eeprom, since it's limited (very high value). */ /* If you want to use modes with this (since you can), then you */ /* want to use rgblight_mode_noeeprom(x) instead. */ -#define rgblight_sethsv_noeeprom_white() rgblight_sethsv_noeeprom ( 0, 0, 255) -#define rgblight_sethsv_noeeprom_red() rgblight_sethsv_noeeprom ( 0, 255, 255) -#define rgblight_sethsv_noeeprom_coral() rgblight_sethsv_noeeprom ( 16, 176, 255) -#define rgblight_sethsv_noeeprom_orange() rgblight_sethsv_noeeprom ( 39, 255, 255) -#define rgblight_sethsv_noeeprom_goldenrod() rgblight_sethsv_noeeprom ( 43, 218, 218) -#define rgblight_sethsv_noeeprom_gold() rgblight_sethsv_noeeprom ( 51, 255, 255) -#define rgblight_sethsv_noeeprom_yellow() rgblight_sethsv_noeeprom ( 60, 255, 255) -#define rgblight_sethsv_noeeprom_chartreuse() rgblight_sethsv_noeeprom ( 90, 255, 255) -#define rgblight_sethsv_noeeprom_green() rgblight_sethsv_noeeprom (120, 255, 255) -#define rgblight_sethsv_noeeprom_springgreen() rgblight_sethsv_noeeprom (150, 255, 255) -#define rgblight_sethsv_noeeprom_turquoise() rgblight_sethsv_noeeprom (174, 90, 112) -#define rgblight_sethsv_noeeprom_teal() rgblight_sethsv_noeeprom (180, 255, 128) -#define rgblight_sethsv_noeeprom_cyan() rgblight_sethsv_noeeprom (180, 255, 255) -#define rgblight_sethsv_noeeprom_azure() rgblight_sethsv_noeeprom (186, 102, 255) -#define rgblight_sethsv_noeeprom_blue() rgblight_sethsv_noeeprom (240, 255, 255) -#define rgblight_sethsv_noeeprom_purple() rgblight_sethsv_noeeprom (270, 255, 255) -#define rgblight_sethsv_noeeprom_magenta() rgblight_sethsv_noeeprom (300, 255, 255) -#define rgblight_sethsv_noeeprom_pink() rgblight_sethsv_noeeprom (330, 128, 255) +#define rgblight_sethsv_noeeprom_white() rgblight_sethsv_noeeprom (HSV_WHITE) +#define rgblight_sethsv_noeeprom_red() rgblight_sethsv_noeeprom (HSV_RED) +#define rgblight_sethsv_noeeprom_coral() rgblight_sethsv_noeeprom (HSV_CORAL) +#define rgblight_sethsv_noeeprom_orange() rgblight_sethsv_noeeprom (HSV_ORANGE) +#define rgblight_sethsv_noeeprom_goldenrod() rgblight_sethsv_noeeprom (HSV_GOLDENROD) +#define rgblight_sethsv_noeeprom_gold() rgblight_sethsv_noeeprom (HSV_GOLD) +#define rgblight_sethsv_noeeprom_yellow() rgblight_sethsv_noeeprom (HSV_YELLOW) +#define rgblight_sethsv_noeeprom_chartreuse() rgblight_sethsv_noeeprom (HSV_CHARTREUSE) +#define rgblight_sethsv_noeeprom_green() rgblight_sethsv_noeeprom (HSV_GREEN) +#define rgblight_sethsv_noeeprom_springgreen() rgblight_sethsv_noeeprom (HSV_SPRINGGREEN) +#define rgblight_sethsv_noeeprom_turquoise() rgblight_sethsv_noeeprom (HSV_TURQUOISE) +#define rgblight_sethsv_noeeprom_teal() rgblight_sethsv_noeeprom (HSV_TEAL) +#define rgblight_sethsv_noeeprom_cyan() rgblight_sethsv_noeeprom (HSV_CYAN) +#define rgblight_sethsv_noeeprom_azure() rgblight_sethsv_noeeprom (HSV_AZURE) +#define rgblight_sethsv_noeeprom_blue() rgblight_sethsv_noeeprom (HSV_BLUE) +#define rgblight_sethsv_noeeprom_purple() rgblight_sethsv_noeeprom (HSV_PURPLE) +#define rgblight_sethsv_noeeprom_magenta() rgblight_sethsv_noeeprom (HSV_MAGENTA) +#define rgblight_sethsv_noeeprom_pink() rgblight_sethsv_noeeprom (HSV_PINK) /* SET HSV List */ -#define rgblight_sethsv_white_at(at) rgblight_sethsv_at ( 0, 0, 255, at) -#define rgblight_sethsv_red_at(at) rgblight_sethsv_at ( 0, 255, 255, at) -#define rgblight_sethsv_coral_at(at) rgblight_sethsv_at ( 16, 176, 255, at) -#define rgblight_sethsv_orange_at(at) rgblight_sethsv_at ( 39, 255, 255, at) -#define rgblight_sethsv_goldenrod_at(at) rgblight_sethsv_at ( 43, 218, 218, at) -#define rgblight_sethsv_gold_at(at) rgblight_sethsv_at ( 51, 255, 255, at) -#define rgblight_sethsv_yellow_at(at) rgblight_sethsv_at ( 60, 255, 255, at) -#define rgblight_sethsv_chartreuse_at(at) rgblight_sethsv_at ( 90, 255, 255, at) -#define rgblight_sethsv_green_at(at) rgblight_sethsv_at (120, 255, 255, at) -#define rgblight_sethsv_springgreen_at(at) rgblight_sethsv_at (150, 255, 255, at) -#define rgblight_sethsv_turquoise_at(at) rgblight_sethsv_at (174, 90, 112, at) -#define rgblight_sethsv_teal_at(at) rgblight_sethsv_at (180, 255, 128, at) -#define rgblight_sethsv_cyan_at(at) rgblight_sethsv_at (180, 255, 255, at) -#define rgblight_sethsv_azure_at(at) rgblight_sethsv_at (186, 102, 255, at) -#define rgblight_sethsv_blue_at(at) rgblight_sethsv_at (240, 255, 255, at) -#define rgblight_sethsv_purple_at(at) rgblight_sethsv_at (270, 255, 255, at) -#define rgblight_sethsv_magenta_at(at) rgblight_sethsv_at (300, 255, 255, at) -#define rgblight_sethsv_pink_at(at) rgblight_sethsv_at (330, 128, 255, at) - -#endif +#define rgblight_sethsv_white_at(at) rgblight_sethsv_at (HSV_WHITE, at) +#define rgblight_sethsv_red_at(at) rgblight_sethsv_at (HSV_RED, at) +#define rgblight_sethsv_coral_at(at) rgblight_sethsv_at (HSV_CORAL, at) +#define rgblight_sethsv_orange_at(at) rgblight_sethsv_at (HSV_ORANGE, at) +#define rgblight_sethsv_goldenrod_at(at) rgblight_sethsv_at (HSV_GOLDENROD, at) +#define rgblight_sethsv_gold_at(at) rgblight_sethsv_at (HSV_GOLD, at) +#define rgblight_sethsv_yellow_at(at) rgblight_sethsv_at (HSV_YELLOW, at) +#define rgblight_sethsv_chartreuse_at(at) rgblight_sethsv_at (HSV_CHARTREUSE, at) +#define rgblight_sethsv_green_at(at) rgblight_sethsv_at (HSV_GREEN, at) +#define rgblight_sethsv_springgreen_at(at) rgblight_sethsv_at (HSV_SPRINGGREEN, at) +#define rgblight_sethsv_turquoise_at(at) rgblight_sethsv_at (HSV_TURQUOISE, at) +#define rgblight_sethsv_teal_at(at) rgblight_sethsv_at (HSV_TEAL, at) +#define rgblight_sethsv_cyan_at(at) rgblight_sethsv_at (HSV_CYAN, at) +#define rgblight_sethsv_azure_at(at) rgblight_sethsv_at (HSV_AZURE, at) +#define rgblight_sethsv_blue_at(at) rgblight_sethsv_at (HSV_BLUE, at) +#define rgblight_sethsv_purple_at(at) rgblight_sethsv_at (HSV_PURPLE, at) +#define rgblight_sethsv_magenta_at(at) rgblight_sethsv_at (HSV_MAGENTA, at) +#define rgblight_sethsv_pink_at(at) rgblight_sethsv_at (HSV_PINK, at) diff --git a/quantum/rgblight_modes.h b/quantum/rgblight_modes.h new file mode 100644 index 00000000000..8a8f9bdda97 --- /dev/null +++ b/quantum/rgblight_modes.h @@ -0,0 +1,67 @@ +#ifdef _RGBM_SINGLE_STATIC + _RGBM_SINGLE_STATIC( STATIC_LIGHT ) + #ifdef RGBLIGHT_EFFECT_BREATHING + _RGBM_MULTI_DYNAMIC( BREATHING ) + _RGBM_TMP_DYNAMIC( breathing_3, BREATHING ) + _RGBM_TMP_DYNAMIC( breathing_4, BREATHING ) + _RGBM_TMP_DYNAMIC( BREATHING_end, BREATHING ) + #endif + #ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD + _RGBM_MULTI_DYNAMIC( RAINBOW_MOOD ) + _RGBM_TMP_DYNAMIC( rainbow_mood_7, RAINBOW_MOOD ) + _RGBM_TMP_DYNAMIC( RAINBOW_MOOD_end, RAINBOW_MOOD ) + #endif + #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL + _RGBM_MULTI_DYNAMIC( RAINBOW_SWIRL ) + _RGBM_TMP_DYNAMIC( rainbow_swirl_10, RAINBOW_SWIRL ) + _RGBM_TMP_DYNAMIC( rainbow_swirl_11, RAINBOW_SWIRL ) + _RGBM_TMP_DYNAMIC( rainbow_swirl_12, RAINBOW_SWIRL ) + _RGBM_TMP_DYNAMIC( rainbow_swirl_13, RAINBOW_SWIRL ) + _RGBM_TMP_DYNAMIC( RAINBOW_SWIRL_end, RAINBOW_SWIRL ) + #endif + #ifdef RGBLIGHT_EFFECT_SNAKE + _RGBM_MULTI_DYNAMIC( SNAKE ) + _RGBM_TMP_DYNAMIC( snake_16, SNAKE ) + _RGBM_TMP_DYNAMIC( snake_17, SNAKE ) + _RGBM_TMP_DYNAMIC( snake_18, SNAKE ) + _RGBM_TMP_DYNAMIC( snake_19, SNAKE ) + _RGBM_TMP_DYNAMIC( SNAKE_end, SNAKE ) + #endif + #ifdef RGBLIGHT_EFFECT_KNIGHT + _RGBM_MULTI_DYNAMIC( KNIGHT ) + _RGBM_TMP_DYNAMIC( knight_22, KNIGHT ) + _RGBM_TMP_DYNAMIC( KNIGHT_end, KNIGHT ) + #endif + #ifdef RGBLIGHT_EFFECT_CHRISTMAS + _RGBM_SINGLE_DYNAMIC( CHRISTMAS ) + #endif + #ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT + _RGBM_MULTI_STATIC( STATIC_GRADIENT ) + _RGBM_TMP_STATIC( static_gradient_26, STATIC_GRADIENT ) + _RGBM_TMP_STATIC( static_gradient_27, STATIC_GRADIENT ) + _RGBM_TMP_STATIC( static_gradient_28, STATIC_GRADIENT ) + _RGBM_TMP_STATIC( static_gradient_29, STATIC_GRADIENT ) + _RGBM_TMP_STATIC( static_gradient_30, STATIC_GRADIENT ) + _RGBM_TMP_STATIC( static_gradient_31, STATIC_GRADIENT ) + _RGBM_TMP_STATIC( static_gradient_32, STATIC_GRADIENT ) + _RGBM_TMP_STATIC( static_gradient_33, STATIC_GRADIENT ) + _RGBM_TMP_STATIC( STATIC_GRADIENT_end, STATIC_GRADIENT ) + #endif + #ifdef RGBLIGHT_EFFECT_RGB_TEST + _RGBM_SINGLE_DYNAMIC( RGB_TEST ) + #endif + #ifdef RGBLIGHT_EFFECT_ALTERNATING + _RGBM_SINGLE_DYNAMIC( ALTERNATING ) + #endif + //// Add a new mode here. + // #ifdef RGBLIGHT_EFFECT_ + // _RGBM__( ) + // #endif +#endif + +#undef _RGBM_SINGLE_STATIC +#undef _RGBM_SINGLE_DYNAMIC +#undef _RGBM_MULTI_STATIC +#undef _RGBM_MULTI_DYNAMIC +#undef _RGBM_TMP_STATIC +#undef _RGBM_TMP_DYNAMIC diff --git a/quantum/rgblight_post_config.h b/quantum/rgblight_post_config.h new file mode 100644 index 00000000000..048746c4b7d --- /dev/null +++ b/quantum/rgblight_post_config.h @@ -0,0 +1,5 @@ +#if defined(RGBLED_SPLIT) && !defined(RGBLIGHT_SPLIT) + // When RGBLED_SPLIT is defined, + // it is considered that RGBLIGHT_SPLIT is defined implicitly. + #define RGBLIGHT_SPLIT +#endif diff --git a/quantum/rgblight_types.h b/quantum/rgblight_types.h deleted file mode 100644 index 49ef5c8ea77..00000000000 --- a/quantum/rgblight_types.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * light weight WS2812 lib include - * - * Version 2.3 - Nev 29th 2015 - * Author: Tim (cpldcpu@gmail.com) - * - * Please do not change this file! All configuration is handled in "ws2812_config.h" - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RGBLIGHT_TYPES -#define RGBLIGHT_TYPES - -#ifdef __AVR__ - #include -#endif - -#ifdef RGBW - #define LED_TYPE struct cRGBW -#else - #define LED_TYPE struct cRGB -#endif - - -/* - * Structure of the LED array - * - * cRGB: RGB for WS2812S/B/C/D, SK6812, SK6812Mini, SK6812WWA, APA104, APA106 - * cRGBW: RGBW for SK6812RGBW - */ - -struct cRGB { uint8_t g; uint8_t r; uint8_t b; }; -struct cRGBW { uint8_t g; uint8_t r; uint8_t b; uint8_t w;}; - -#endif diff --git a/quantum/split_common/i2c.c b/quantum/split_common/i2c.c deleted file mode 100644 index b3d7fcc681e..00000000000 --- a/quantum/split_common/i2c.c +++ /dev/null @@ -1,187 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" -#include "split_flags.h" - -#if defined(USE_I2C) || defined(EH) - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - - if ( slave_buffer_pos == I2C_BACKLIT_START) { - BACKLIT_DIRTY = true; - } else if ( slave_buffer_pos == (I2C_RGB_START+3)) { - RGB_DIRTY = true; - } - - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -// Address location defines (Keymap should be last, as it's size is dynamic) -#define I2C_BACKLIT_START 0x00 -// Need 4 bytes for RGB (32 bit) -#define I2C_RGB_START 0x01 -#define I2C_KEYMAP_START 0x06 - -// Slave buffer (8bit per) -// Rows per hand + backlit space + rgb space -// TODO : Make this dynamically sized -#define SLAVE_BUFFER_SIZE 0x20 - -// i2c SCL clock frequency -#ifndef SCL_CLOCK -#define SCL_CLOCK 100000L -#endif - -// Support 8bits right now (8 cols) will need to edit to take higher (code exists in delta split?) -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_write_data(void *const TXdata, uint8_t dataLen); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index ff6738b58f4..41a15ace4e4 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -20,517 +20,315 @@ along with this program. If not, see . */ #include #include -#include #include "wait.h" -#include "print.h" -#include "debug.h" #include "util.h" #include "matrix.h" #include "split_util.h" -#include "pro_micro.h" #include "config.h" -#include "timer.h" -#include "split_flags.h" +#include "quantum.h" +#include "debounce.h" +#include "transport.h" -#ifdef RGBLIGHT_ENABLE -# include "rgblight.h" -#endif -#ifdef BACKLIGHT_ENABLE -# include "backlight.h" - extern backlight_config_t backlight_config; +#ifdef ENCODER_ENABLE + #include "encoder.h" #endif -#if defined(USE_I2C) || defined(EH) -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) #endif -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif +#define ERROR_DISCONNECT_COUNT 5 -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif +#define ROWS_PER_HAND (MATRIX_ROWS / 2) -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) +#ifdef DIRECT_PINS +static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; #else -# error "Currently only supports 8 COLS" +static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; #endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; -#define ERROR_DISCONNECT_COUNT 5 +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t raw_matrix[ROWS_PER_HAND]; -#define ROWS_PER_HAND (MATRIX_ROWS/2) +// row offsets for each hand +uint8_t thisHand, thatHand; -static uint8_t error_count = 0; +// user-defined overridable functions -static uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} +__attribute__((weak)) void matrix_init_user(void) {} -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} +__attribute__((weak)) void matrix_scan_user(void) {} -__attribute__ ((weak)) -void matrix_init_user(void) { -} +__attribute__((weak)) void matrix_slave_scan_user(void) {} -__attribute__ ((weak)) -void matrix_scan_user(void) { -} +// helper functions -__attribute__ ((weak)) -void matrix_slave_scan_user(void) { -} +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; +bool matrix_is_modified(void) { + if (debounce_active()) return false; + return true; } -void matrix_init(void) -{ -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); +uint8_t matrix_key_count(void) { + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += matrix_bitpop(i); + } + return count; +} - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } +// matrix code -# else - read_cols_on_row(matrix+offset, current_row); -# endif +#ifdef DIRECT_PINS +static void init_pins(void) { + for (int row = 0; row < MATRIX_ROWS; row++) { + for (int col = 0; col < MATRIX_COLS; col++) { + pin_t pin = direct_pins[row][col]; + if (pin != NO_PIN) { + setPinInputHigh(pin); + } } + } +} -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + matrix_row_t last_row_value = current_matrix[current_row]; + current_matrix[current_row] = 0; + for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + pin_t pin = direct_pins[current_row][col_index]; + if (pin != NO_PIN) { + current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); } -#endif + } -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; + return (last_row_value != current_matrix[current_row]); } -#if defined(USE_I2C) || defined(EH) - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int err = 0; - - // write backlight info - #ifdef BACKLIGHT_ENABLE - if (BACKLIT_DIRTY) { - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // Backlight location - err = i2c_master_write(I2C_BACKLIT_START); - if (err) goto i2c_error; - - // Write backlight - i2c_master_write(get_backlight_level()); - - BACKLIT_DIRTY = false; - } - #endif - - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at I2C_KEYMAP_START - err = i2c_master_write(I2C_KEYMAP_START); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; +#elif (DIODE_DIRECTION == COL2ROW) - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - #ifdef RGBLIGHT_ENABLE - if (RGB_DIRTY) { - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // RGB Location - err = i2c_master_write(I2C_RGB_START); - if (err) goto i2c_error; - - uint32_t dword = eeconfig_read_rgblight(); - - // Write RGB - err = i2c_master_write_data(&dword, 4); - if (err) goto i2c_error; - - RGB_DIRTY = false; - i2c_master_stop(); - } - #endif - - return 0; +static void select_row(uint8_t row) { + setPinOutput(row_pins[row]); + writePinLow(row_pins[row]); } -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } - if (serial_update_buffers()) { - return 1; - } +static void unselect_rows(void) { + for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { + setPinInputHigh(row_pins[x]); + } +} - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - - #ifdef RGBLIGHT_ENABLE - // Code to send RGB over serial goes here (not implemented yet) - #endif - - #ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_BACKLIT_START] = backlight_config.enable ? backlight_config.level : 0; - #endif - - return 0; +static void init_pins(void) { + unselect_rows(); + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + setPinInputHigh(col_pins[x]); + } } -#endif -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; -#if defined(USE_I2C) || defined(EH) - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif + // Clear data in matrix row + current_matrix[current_row] = 0; - error_count++; + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); + // For each col... + for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= readPin(col_pins[col_index]) ? 0 : (ROW_SHIFTER << col_index); + } - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + // Unselect row + unselect_row(current_row); -#if defined(USE_I2C) || defined(EH) - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[I2C_KEYMAP_START+i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif - matrix_slave_scan_user(); + return (last_row_value != current_matrix[current_row]); } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} +#elif (DIODE_DIRECTION == ROW2COL) -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} + // Select col and wait for col selecton to stabilize + select_col(current_col); + wait_us(30); -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ + // For each row... + for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); + matrix_row_t last_row_value = current_matrix[row_index]; - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + // Check row pin state + if (readPin(row_pins[row_index])) { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } else { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) { + matrix_changed = true; } + } - // Unselect row - unselect_row(current_row); + // Unselect col + unselect_col(current_col); - return (last_row_value != current_matrix[current_row]); + return matrix_changed; } -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} +#endif -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} +void matrix_init(void) { + debug_enable = true; + debug_matrix = true; + debug_mouse = true; -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + // Set pinout for right half if pinout for that half is defined + if (!isLeftHand) { +#ifdef MATRIX_ROW_PINS_RIGHT + const pin_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + row_pins[i] = row_pins_right[i]; } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +#endif +#ifdef MATRIX_COL_PINS_RIGHT + const pin_t col_pins_right[MATRIX_COLS] = MATRIX_COL_PINS_RIGHT; + for (uint8_t i = 0; i < MATRIX_COLS; i++) { + col_pins[i] = col_pins_right[i]; } -} +#endif + } -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; + thisHand = isLeftHand ? 0 : (ROWS_PER_HAND); + thatHand = ROWS_PER_HAND - thisHand; - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); + // initialize key pins + init_pins(); - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; + debounce_init(ROWS_PER_HAND); - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } + matrix_init_quantum(); +} - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } +uint8_t _matrix_scan(void) { + bool changed = false; - // Unselect col - unselect_col(current_col); +#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) + // Set row, read cols + for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { + changed |= read_cols_on_row(raw_matrix, current_row); + } +#elif (DIODE_DIRECTION == ROW2COL) + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { + changed |= read_rows_on_col(raw_matrix, current_col); + } +#endif - return matrix_changed; -} + debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + return (uint8_t)changed; } -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} +uint8_t matrix_scan(void) { + uint8_t ret = _matrix_scan(); -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + if (is_keyboard_master()) { + static uint8_t error_count; + + if (!transport_master(matrix + thatHand)) { + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[thatHand + i] = 0; + } + } + } else { + error_count = 0; } -} + matrix_scan_quantum(); + } else { + transport_slave(matrix + thisHand); +#ifdef ENCODER_ENABLE + encoder_read(); #endif + matrix_slave_scan_user(); + } + + return ret; +} diff --git a/quantum/split_common/matrix.h b/quantum/split_common/matrix.h new file mode 100644 index 00000000000..c2bdd3098c1 --- /dev/null +++ b/quantum/split_common/matrix.h @@ -0,0 +1,3 @@ +#pragma once + +#include diff --git a/quantum/split_common/post_config.h b/quantum/split_common/post_config.h new file mode 100644 index 00000000000..ff0fc5e1930 --- /dev/null +++ b/quantum/split_common/post_config.h @@ -0,0 +1,19 @@ +#if defined(USE_I2C) || defined(EH) + // When using I2C, using rgblight implicitly involves split support. + #if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_SPLIT) + #define RGBLIGHT_SPLIT + #endif + + #ifndef F_SCL + #define F_SCL 100000UL // SCL frequency + #endif + +#else // use serial + // When using serial, the user must define RGBLIGHT_SPLIT explicitly + // in config.h as needed. + // see quantum/rgblight_post_config.h + #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + // When using serial and RGBLIGHT_SPLIT need separate transaction + #define SERIAL_USE_MULTI_TRANSACTION + #endif +#endif diff --git a/quantum/split_common/serial.c b/quantum/split_common/serial.c index 74bcbb6bf6e..1315377a345 100644 --- a/quantum/split_common/serial.c +++ b/quantum/split_common/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU @@ -9,220 +14,533 @@ #include #include #include +#include #include #include "serial.h" +//#include + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_AVR_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif -#ifndef USE_I2C +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps (Experimental only) +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; inline static void serial_output(void) { SERIAL_PIN_DDR |= SERIAL_PIN_MASK; } // make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; inline static -void serial_input(void) { +void serial_input_with_pullup(void) { SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); } +inline static void serial_low(void) ALWAYS_INLINE; inline static void serial_low(void) { SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; } +inline static void serial_high(void) ALWAYS_INLINE; inline static void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void serial_master_init(void) { - serial_output(); - serial_high(); +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); } -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif } -// Used by the master to synchronize timing with the slave. +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; static void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. while (!serial_read_pin()); - serial_delay(); } -// Used by the slave to send a synchronization signal to the master. +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; static void sync_send(void) { - serial_output(); - serial_low(); serial_delay(); - serial_high(); } // Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; return byte; } // Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } serial_delay(); - } -} -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); + serial_low(); // sync_send() / senc_recv() need raise edge +} - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; sync_send(); - checksum += serial_slave_buffer[i]; + serial_write_chunk(data,8); } - serial_write_byte(checksum); - sync_send(); +} - // wait for the sync to finish sending - serial_delay(); +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; } - uint8_t checksum_received = serial_read_byte(); - sync_send(); + serial_delay_half1(); - serial_input(); // end transaction + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } } else { - status &= ~SLAVE_DATA_CORRUPT; + *trans->status = TRANSACTION_ACCEPTED; } -} -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; + sync_recv(); //weit initiator output to high } -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) // // Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif cli(); - // signal to the slave that we want to start a transaction + // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(1); + _delay_us(SLAVE_INT_WIDTH_US); - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); - // check if the slave is present + // check if the target is present if (serial_read_pin()) { - // slave failed to pull the line low, assume not present + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; sei(); - return 1; + return TRANSACTION_NO_RESPONSE; } - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - if (checksum_computed != checksum_received) { - sei(); - return 1; + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } +#endif - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); } - serial_write_byte(checksum); - sync_recv(); // always, release the line when not in use - serial_output(); - serial_high(); + sync_send(); + *trans->status = TRANSACTION_END; sei(); - return 0; + return TRANSACTION_END; } +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + #endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) +// 2018-12-17 copy to TOP/quantum/split_common/ and remove backward compatibility code (#4669) diff --git a/quantum/split_common/serial.h b/quantum/split_common/serial.h index e566eb8a06f..1c1e640069c 100644 --- a/quantum/split_common/serial.h +++ b/quantum/split_common/serial.h @@ -1,29 +1,62 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H +#pragma once -#include "config.h" #include -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE simple API (using signle-type transaction function) +// /* nothing */ +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) -// Address location defines -#define SERIAL_BACKLIT_START 0x00 +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); #endif diff --git a/quantum/split_common/split_flags.h b/quantum/split_common/split_flags.h deleted file mode 100644 index f101fff5b5a..00000000000 --- a/quantum/split_common/split_flags.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef SPLIT_FLAGS_H -#define SPLIT_FLAGS_H - -#include -#include - -/** -* Global Flags -**/ - -//RGB Stuff -extern volatile bool RGB_DIRTY; - - -//Backlight Stuff -extern volatile bool BACKLIT_DIRTY; - - - -#endif \ No newline at end of file diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 8d39329d460..d7ed6989f63 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -1,169 +1,93 @@ -#include -#include -#include -#include -#include -#include #include "split_util.h" #include "matrix.h" #include "keyboard.h" #include "config.h" #include "timer.h" -#include "split_flags.h" +#include "transport.h" +#include "quantum.h" -#ifdef RGBLIGHT_ENABLE -# include "rgblight.h" -#endif -#ifdef BACKLIGHT_ENABLE -# include "backlight.h" -#endif - -#ifdef SPLIT_HAND_PIN -# include "pincontrol.h" +#ifdef EE_HANDS +# include "tmk_core/common/eeprom.h" +# include "eeconfig.h" #endif -#if defined(USE_I2C) || defined(EH) -# include "i2c.h" -#else -# include "serial.h" +#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) +#include "rgblight.h" #endif volatile bool isLeftHand = true; -volatile uint8_t setTries = 0; - -static void setup_handedness(void) { - #ifdef SPLIT_HAND_PIN +__attribute__((weak)) +bool is_keyboard_left(void) { + #if defined(SPLIT_HAND_PIN) // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand - pinMode(SPLIT_HAND_PIN, PinDirectionInput); - isLeftHand = digitalRead(SPLIT_HAND_PIN); - #else - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif + setPinInput(SPLIT_HAND_PIN); + return readPin(SPLIT_HAND_PIN); + #elif defined(EE_HANDS) + return eeprom_read_byte(EECONFIG_HANDEDNESS); + #elif defined(MASTER_RIGHT) + return !is_keyboard_master(); #endif + + return is_keyboard_master(); } -static void keyboard_master_setup(void) { -#if defined(USE_I2C) || defined(EH) - i2c_master_init(); - #ifdef SSD1306OLED - matrix_master_OLED_init (); - #endif -#else - serial_master_init(); -#endif +__attribute__((weak)) +bool is_keyboard_master(void) +{ +#ifdef __AVR__ + static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; - // For master the Backlight info needs to be sent on startup - // Otherwise the salve won't start with the proper info until an update - BACKLIT_DIRTY = true; -} + // only check once, as this is called often + if (usbstate == UNKNOWN) + { + USBCON |= (1 << OTGPADE); // enables VBUS pad + wait_us(5); -static void keyboard_slave_setup(void) { - timer_init(); -#if defined(USE_I2C) || defined(EH) - i2c_slave_init(SLAVE_I2C_ADDRESS); + usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS + } + + return (usbstate == MASTER); #else - serial_slave_init(); + return true; #endif } -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< #include #include #include -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - void matrix_master_OLED_init (void); - -#endif diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c new file mode 100644 index 00000000000..ba21d0c7b1d --- /dev/null +++ b/quantum/split_common/transport.c @@ -0,0 +1,253 @@ +#include +#include + +#include "config.h" +#include "matrix.h" +#include "quantum.h" + +#define ROWS_PER_HAND (MATRIX_ROWS / 2) + +#ifdef RGBLIGHT_ENABLE +# include "rgblight.h" +#endif + +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif + +#ifdef ENCODER_ENABLE +# include "encoder.h" +static pin_t encoders_pad[] = ENCODERS_PAD_A; +# define NUMBER_OF_ENCODERS (sizeof(encoders_pad)/sizeof(pin_t)) +#endif + +#if defined(USE_I2C) || defined(EH) + +# include "i2c_master.h" +# include "i2c_slave.h" + +typedef struct _I2C_slave_buffer_t { + matrix_row_t smatrix[ROWS_PER_HAND]; + uint8_t backlight_level; +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + rgblight_syncinfo_t rgblight_sync; +#endif +#ifdef ENCODER_ENABLE + uint8_t encoder_state[NUMBER_OF_ENCODERS]; +#endif +} I2C_slave_buffer_t; + +static I2C_slave_buffer_t * const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg; + +# define I2C_BACKLIGHT_START offsetof(I2C_slave_buffer_t, backlight_level) +# define I2C_RGB_START offsetof(I2C_slave_buffer_t, rgblight_sync) +# define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, smatrix) +# define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state) + +# define TIMEOUT 100 + +# ifndef SLAVE_I2C_ADDRESS +# define SLAVE_I2C_ADDRESS 0x32 +# endif + +// Get rows from other half over i2c +bool transport_master(matrix_row_t matrix[]) { + i2c_readReg(SLAVE_I2C_ADDRESS, I2C_KEYMAP_START, (void *)matrix, sizeof(i2c_buffer->smatrix), TIMEOUT); + + // write backlight info +# ifdef BACKLIGHT_ENABLE + uint8_t level = is_backlight_enabled() ? get_backlight_level() : 0; + if (level != i2c_buffer->backlight_level) { + if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_BACKLIGHT_START, (void *)&level, sizeof(level), TIMEOUT) >= 0) { + i2c_buffer->backlight_level = level; + } + } +# endif + +# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + if (rgblight_get_change_flags()) { + rgblight_syncinfo_t rgblight_sync; + rgblight_get_syncinfo(&rgblight_sync); + if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_RGB_START, + (void *)&rgblight_sync, sizeof(rgblight_sync), TIMEOUT) >= 0) { + rgblight_clear_change_flags(); + } + } +# endif + +# ifdef ENCODER_ENABLE + i2c_readReg(SLAVE_I2C_ADDRESS, I2C_ENCODER_START, (void *)i2c_buffer->encoder_state, sizeof(i2c_buffer->encoder_state), TIMEOUT); + encoder_update_raw(i2c_buffer->encoder_state); +# endif + + return true; +} + +void transport_slave(matrix_row_t matrix[]) { + // Copy matrix to I2C buffer + memcpy((void*)i2c_buffer->smatrix, (void *)matrix, sizeof(i2c_buffer->smatrix)); + +// Read Backlight Info +# ifdef BACKLIGHT_ENABLE + backlight_set(i2c_buffer->backlight_level); +# endif + +# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + // Update the RGB with the new data + if (i2c_buffer->rgblight_sync.status.change_flags != 0) { + rgblight_update_sync(&i2c_buffer->rgblight_sync, false); + i2c_buffer->rgblight_sync.status.change_flags = 0; + } +# endif + +# ifdef ENCODER_ENABLE + encoder_state_raw(i2c_buffer->encoder_state); +# endif +} + +void transport_master_init(void) { i2c_init(); } + +void transport_slave_init(void) { i2c_slave_init(SLAVE_I2C_ADDRESS); } + +#else // USE_SERIAL + +# include "serial.h" + +typedef struct _Serial_s2m_buffer_t { + // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack + matrix_row_t smatrix[ROWS_PER_HAND]; + +# ifdef ENCODER_ENABLE + uint8_t encoder_state[NUMBER_OF_ENCODERS]; +# endif + +} Serial_s2m_buffer_t; + +typedef struct _Serial_m2s_buffer_t { +# ifdef BACKLIGHT_ENABLE + uint8_t backlight_level; +# endif +} Serial_m2s_buffer_t; + +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) +// When MCUs on both sides drive their respective RGB LED chains, +// it is necessary to synchronize, so it is necessary to communicate RGB +// information. In that case, define RGBLIGHT_SPLIT with info on the number +// of LEDs on each half. +// +// Otherwise, if the master side MCU drives both sides RGB LED chains, +// there is no need to communicate. + +typedef struct _Serial_rgblight_t { + rgblight_syncinfo_t rgblight_sync; +} Serial_rgblight_t; + +volatile Serial_rgblight_t serial_rgblight = {}; +uint8_t volatile status_rgblight = 0; +#endif + +volatile Serial_s2m_buffer_t serial_s2m_buffer = {}; +volatile Serial_m2s_buffer_t serial_m2s_buffer = {}; +uint8_t volatile status0 = 0; + +enum serial_transaction_id { + GET_SLAVE_MATRIX = 0, +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + PUT_RGBLIGHT, +#endif +}; + +SSTD_t transactions[] = { + [GET_SLAVE_MATRIX] = { + (uint8_t *)&status0, + sizeof(serial_m2s_buffer), + (uint8_t *)&serial_m2s_buffer, + sizeof(serial_s2m_buffer), + (uint8_t *)&serial_s2m_buffer, + }, +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + [PUT_RGBLIGHT] = { + (uint8_t *)&status_rgblight, + sizeof(serial_rgblight), + (uint8_t *)&serial_rgblight, + 0, NULL // no slave to master transfer + }, +#endif +}; + +void transport_master_init(void) { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void transport_slave_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + +// rgblight synchronization information communication. + +void transport_rgblight_master(void) { + if (rgblight_get_change_flags()) { + rgblight_get_syncinfo((rgblight_syncinfo_t *)&serial_rgblight.rgblight_sync); + if (soft_serial_transaction(PUT_RGBLIGHT) == TRANSACTION_END) { + rgblight_clear_change_flags(); + } + } +} + +void transport_rgblight_slave(void) { + if (status_rgblight == TRANSACTION_ACCEPTED) { + rgblight_update_sync((rgblight_syncinfo_t *)&serial_rgblight.rgblight_sync, + false); + status_rgblight = TRANSACTION_END; + } +} + +#else +#define transport_rgblight_master() +#define transport_rgblight_slave() +#endif + +bool transport_master(matrix_row_t matrix[]) { +#ifndef SERIAL_USE_MULTI_TRANSACTION + if (soft_serial_transaction() != TRANSACTION_END) { + return false; + } +#else + transport_rgblight_master(); + if (soft_serial_transaction(GET_SLAVE_MATRIX) != TRANSACTION_END) { + return false; + } +#endif + + // TODO: if MATRIX_COLS > 8 change to unpack() + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[i] = serial_s2m_buffer.smatrix[i]; + } + +# ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + serial_m2s_buffer.backlight_level = is_backlight_enabled() ? get_backlight_level() : 0; +# endif + +# ifdef ENCODER_ENABLE + encoder_update_raw((uint8_t *)serial_s2m_buffer.encoder_state); +# endif + + return true; +} + +void transport_slave(matrix_row_t matrix[]) { + transport_rgblight_slave(); + // TODO: if MATRIX_COLS > 8 change to pack() + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_s2m_buffer.smatrix[i] = matrix[i]; + } +# ifdef BACKLIGHT_ENABLE + backlight_set(serial_m2s_buffer.backlight_level); +# endif + +# ifdef ENCODER_ENABLE + encoder_state_raw((uint8_t *)serial_s2m_buffer.encoder_state); +# endif + +} + +#endif diff --git a/quantum/split_common/transport.h b/quantum/split_common/transport.h new file mode 100644 index 00000000000..ccce57e444d --- /dev/null +++ b/quantum/split_common/transport.h @@ -0,0 +1,10 @@ +#pragma once + +#include + +void transport_master_init(void); +void transport_slave_init(void); + +// returns false if valid data not received from slave +bool transport_master(matrix_row_t matrix[]); +void transport_slave(matrix_row_t matrix[]); diff --git a/quantum/stm32/chconf.h b/quantum/stm32/chconf.h new file mode 100644 index 00000000000..1d9f12ff1f8 --- /dev/null +++ b/quantum/stm32/chconf.h @@ -0,0 +1,520 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM TRUE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/quantum/stm32/halconf.h b/quantum/stm32/halconf.h new file mode 100644 index 00000000000..c3e0cbb728c --- /dev/null +++ b/quantum/stm32/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/quantum/stm32/mcuconf.h b/quantum/stm32/mcuconf.h new file mode 100644 index 00000000000..36f8ca2252a --- /dev/null +++ b/quantum/stm32/mcuconf.h @@ -0,0 +1,257 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32F3xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F3xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 +#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_USART2SW STM32_USART2SW_PCLK +#define STM32_USART3SW STM32_USART3SW_PCLK +#define STM32_UART4SW STM32_UART4SW_PCLK +#define STM32_UART5SW STM32_UART5SW_PCLK +#define STM32_I2C1SW STM32_I2C1SW_SYSCLK +#define STM32_I2C2SW STM32_I2C2SW_SYSCLK +#define STM32_TIM1SW STM32_TIM1SW_PCLK2 +#define STM32_TIM8SW STM32_TIM8SW_PCLK2 +#define STM32_RTCSEL STM32_RTCSEL_LSI +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 + +#undef STM32_HSE_BYPASS +// #error "oh no" +// #endif + +/* + * ADC driver system settings. + */ +#define STM32_ADC_DUAL_MODE FALSE +#define STM32_ADC_COMPACT_SAMPLES FALSE +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_USE_ADC2 FALSE +#define STM32_ADC_USE_ADC3 FALSE +#define STM32_ADC_USE_ADC4 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) +#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) +#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) +#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC2_DMA_PRIORITY 2 +#define STM32_ADC_ADC3_DMA_PRIORITY 2 +#define STM32_ADC_ADC4_DMA_PRIORITY 2 +#define STM32_ADC_ADC12_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 +#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE FALSE +#define STM32_DAC_USE_DAC1_CH1 TRUE +#define STM32_DAC_USE_DAC1_CH2 TRUE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM6 TRUE +#define STM32_GPT_USE_TIM7 TRUE +#define STM32_GPT_USE_TIM8 TRUE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM6_IRQ_PRIORITY 7 +#define STM32_GPT_TIM7_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 10 +#define STM32_I2C_I2C2_IRQ_PRIORITY 10 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 TRUE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +#endif /* MCUCONF_H */ diff --git a/quantum/stm32/proton_c.mk b/quantum/stm32/proton_c.mk new file mode 100644 index 00000000000..a65e283d3f1 --- /dev/null +++ b/quantum/stm32/proton_c.mk @@ -0,0 +1,45 @@ +# Proton C MCU settings for converting AVR projects + +# These are defaults based on what has been implemented for ARM boards +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no + +# The rest of these settings shouldn't change + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +DFU_SUFFIX_ARGS = -p df11 -v 0483 diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 56395f376f6..0fc7cf9cb91 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -1,5 +1,5 @@ /* -Copyright 2018 REPLACE_WITH_YOUR_NAME +Copyright %YEAR% %YOUR_NAME% This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0000 #define DEVICE_VER 0x0001 -#define MANUFACTURER You +#define MANUFACTURER %YOUR_NAME% #define PRODUCT %KEYBOARD% #define DESCRIPTION A custom keyboard @@ -45,30 +45,52 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F1, F0, B0 } #define UNUSED_PINS -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +/* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 // #define RGB_DI_PIN E2 // #ifdef RGB_DI_PIN -// #define RGBLIGHT_ANIMATIONS -// #define RGBLED_NUM 16 -// #define RGBLIGHT_HUE_STEP 8 -// #define RGBLIGHT_SAT_STEP 8 -// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 // #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST -/* number of backlight levels */ - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ @@ -113,9 +135,8 @@ along with this program. If not, see . */ /* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true @@ -126,8 +147,8 @@ along with this program. If not, see . //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH //#define MAGIC_KEY_DEBUG D //#define MAGIC_KEY_DEBUG_MATRIX X //#define MAGIC_KEY_DEBUG_KBD K @@ -135,9 +156,8 @@ along with this program. If not, see . //#define MAGIC_KEY_VERSION V //#define MAGIC_KEY_STATUS S //#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE //#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE //#define MAGIC_KEY_LAYER1 1 //#define MAGIC_KEY_LAYER2 2 //#define MAGIC_KEY_LAYER3 3 @@ -147,9 +167,11 @@ along with this program. If not, see . //#define MAGIC_KEY_LAYER7 7 //#define MAGIC_KEY_LAYER8 8 //#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC //#define MAGIC_KEY_LOCK CAPS //#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE //#define MAGIC_KEY_NKRO N //#define MAGIC_KEY_SLEEP_LED Z diff --git a/quantum/template/avr/readme.md b/quantum/template/avr/readme.md index d243c66a948..719222d3775 100644 --- a/quantum/template/avr/readme.md +++ b/quantum/template/avr/readme.md @@ -4,7 +4,7 @@ A short description of the keyboard/project -Keyboard Maintainer: [You](https://github.com/yourusername) +Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) Hardware Supported: The PCBs, controllers supported Hardware Availability: links to where you can find this hardware diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 383a3594b47..133c9e363b9 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -71,7 +70,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode diff --git a/quantum/template/avr/template.c b/quantum/template/avr/template.c index b6366fd9a34..e852a42c409 100644 --- a/quantum/template/avr/template.c +++ b/quantum/template/avr/template.c @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright %YEAR% %YOUR_NAME% * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,29 +15,37 @@ */ #include "%KEYBOARD%.h" +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up + // put your keyboard start-up code here + // runs once when the firmware starts up - matrix_init_user(); + matrix_init_user(); } void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) + // put your looping keyboard code here + // runs every cycle (a lot) - matrix_scan_user(); + matrix_scan_user(); } bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware - return process_record_user(keycode, record); + return process_record_user(keycode, record); } void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); + led_set_user(usb_led); } + +*/ diff --git a/quantum/template/avr/template.h b/quantum/template/avr/template.h deleted file mode 100644 index 0d626ed50b8..00000000000 --- a/quantum/template/avr/template.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef %KEYBOARD_UPPERCASE%_H -#define %KEYBOARD_UPPERCASE%_H - -#include "quantum.h" - -/* This a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ -#define LAYOUT( \ - K00, K01, K02, \ - K10, K11 \ -) \ -{ \ - { K00, K01, K02 }, \ - { K10, KC_NO, K11 }, \ -} - -#endif diff --git a/quantum/template/base/keymaps/default/config.h b/quantum/template/base/keymaps/default/config.h index 4496c591006..5b00c8956f9 100644 --- a/quantum/template/base/keymaps/default/config.h +++ b/quantum/template/base/keymaps/default/config.h @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright %YEAR% %YOUR_NAME% * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 5f0730c8a91..0e9fad357f0 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright %YEAR% %YOUR_NAME% * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/quantum/template/base/template.h b/quantum/template/base/template.h new file mode 100644 index 00000000000..2e531b1fd42 --- /dev/null +++ b/quantum/template/base/template.h @@ -0,0 +1,35 @@ +/* Copyright %YEAR% %YOUR_NAME% + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, KC_NO, k11 }, \ +} diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 4ff3513bc76..3ab841d7455 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Luiz Ribeiro +Copyright %YEAR% %YOUR_NAME% This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,29 +21,32 @@ along with this program. If not, see . #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422D +#define DEVICE_VER 0x0001 #define MANUFACTURER You #define PRODUCT %KEYBOARD% +#define DESCRIPTION A custom keyboard #define RGBLED_NUM 16 -#define MATRIX_ROWS 2 -#define MATRIX_COLS 3 +#define MATRIX_ROWS 8 +#define MATRIX_COLS 11 -#define MATRIX_ROW_PINS { D0, D5 } -#define MATRIX_COL_PINS { F1, F0, B0 } -#define UNUSED_PINS +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 } +// #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, C1, C0, D7 } +#define UNUSED_PINS {} #define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 -#define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS #define NO_UART 1 -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) /* Bootmagic Lite key configuration */ // #define BOOTMAGIC_LITE_ROW 0 diff --git a/quantum/template/ps2avrgb/i2c.c b/quantum/template/ps2avrgb/i2c.c deleted file mode 100644 index e8c4455ad1b..00000000000 --- a/quantum/template/ps2avrgb/i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#include -#include - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -// Please do not modify this file - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif diff --git a/quantum/template/ps2avrgb/matrix.c b/quantum/template/ps2avrgb/matrix.c deleted file mode 100644 index 245813dfd2d..00000000000 --- a/quantum/template/ps2avrgb/matrix.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include - -#include "matrix.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_set_row_status(uint8_t row); -uint8_t bit_reverse(uint8_t x); - -void matrix_init(void) { - // all outputs for rows high - DDRB = 0xFF; - PORTB = 0xFF; - // all inputs for columns - DDRA = 0x00; - DDRC &= ~(0x111111<<2); - DDRD &= ~(1< 7 - (~PINA) & 0xFF - ) | ( - // cols 8..13, PORTC 7 -> 0 - bit_reverse((~PINC) & 0xFF) << 8 - ) | ( - // col 14, PORTD 7 - ((~PIND) & (1 << PIND7)) << 7 - ); - - if (matrix_debouncing[row] != cols) { - matrix_debouncing[row] = cols; - debouncing = DEBOUNCE; - } - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_quantum(); - - return 1; -} - -// declarations -void matrix_set_row_status(uint8_t row) { - DDRB = (1 << row); - PORTB = ~(1 << row); -} - -uint8_t bit_reverse(uint8_t x) { - x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x; -} - -inline matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - -void matrix_print(void) { -} diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md index feec722a521..1449b278cdf 100644 --- a/quantum/template/ps2avrgb/readme.md +++ b/quantum/template/ps2avrgb/readme.md @@ -4,7 +4,7 @@ A short description of the keyboard/project -Keyboard Maintainer: [You](https://github.com/yourusername) +Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) Hardware Supported: The PCBs, controllers supported Hardware Availability: links to where you can find this hardware @@ -16,6 +16,8 @@ Flashing ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. +**Reset Key:** Hold down the key located at `K00`, commonly programmed as `Esc` while plugging in the keyboard. + Windows: 1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). 2. Place your keyboard into reset. @@ -34,10 +36,10 @@ macOS: ``` 3. Install the following packages: ``` - brew install python - brew install pyusb - brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb - + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` 4. Place your keyboard into reset. 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index 68d50aec67a..98a920e1828 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -1,18 +1,3 @@ -# Copyright 2017 Luiz Ribeiro -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - # MCU name MCU = atmega32a PROTOCOL = VUSB @@ -31,20 +16,18 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 -# custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c +SRC += i2c_master.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/quantum/template/ps2avrgb/template.c b/quantum/template/ps2avrgb/template.c index 8bbf9ebda5f..07f27bbb229 100644 --- a/quantum/template/ps2avrgb/template.c +++ b/quantum/template/ps2avrgb/template.c @@ -1,4 +1,4 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME +/* Copyright %YEAR% %YOUR_NAME% * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,13 +13,78 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "%KEYBOARD%.h" -#include -#include "action_layer.h" -#include "i2c.h" -#include "quantum.h" +#ifdef RGBLIGHT_ENABLE + +#include +#include "i2c_master.h" +#include "rgblight.h" + +extern rgblight_config_t rgblight_config; + +void matrix_init_kb(void) { + i2c_init(); + // call user level keymaps, if any + matrix_init_user(); +} + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + memset(led, 0, 3 * RGBLED_NUM); + } + + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} + +bool rgb_init = false; + +void matrix_scan_kb(void) { + // if LEDs were previously on before poweroff, turn them back on + if (rgb_init == false && rgblight_config.enable) { + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + rgb_init = true; + } + + rgblight_task(); + matrix_scan_user(); +} + +#endif -__attribute__ ((weak)) -void matrix_scan_user(void) { +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); } + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/quantum/template/ps2avrgb/template.h b/quantum/template/ps2avrgb/template.h deleted file mode 100644 index b4d6f46624e..00000000000 --- a/quantum/template/ps2avrgb/template.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright 2018 REPLACE_WITH_YOUR_NAME - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef %KEYBOARD_UPPERCASE%_H -#define %KEYBOARD_UPPERCASE%_H - -#include "quantum.h" - -/* This a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ -#define LAYOUT( \ - k00, k01, k02, \ - k10, k11 \ -) \ -{ \ - { k00, k01, k02 }, \ - { k10, KC_NO, k11 }, \ -} - -#endif diff --git a/quantum/template/ps2avrgb/usbconfig.h b/quantum/template/ps2avrgb/usbconfig.h index d2d848fcdc8..465db3a1341 100644 --- a/quantum/template/ps2avrgb/usbconfig.h +++ b/quantum/template/ps2avrgb/usbconfig.h @@ -1,15 +1,4 @@ -/* Name: usbconfig.h - * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers - * Author: Christian Starkjohann - * Creation Date: 2005-04-01 - * Tabsize: 4 - * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ - */ - -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -392,5 +381,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/quantum/velocikey.c b/quantum/velocikey.c new file mode 100644 index 00000000000..550c3b70a64 --- /dev/null +++ b/quantum/velocikey.c @@ -0,0 +1,46 @@ +#include "velocikey.h" +#include "timer.h" +#include "eeconfig.h" +#include "eeprom.h" + +#ifndef MIN +#define MIN(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef MAX +#define MAX(a,b) (((a)>(b))?(a):(b)) +#endif + +#define TYPING_SPEED_MAX_VALUE 200 +uint8_t typing_speed = 0; + +bool velocikey_enabled(void) { + return eeprom_read_byte(EECONFIG_VELOCIKEY) == 1; +} + +void velocikey_toggle(void) { + if (velocikey_enabled()) + eeprom_update_byte(EECONFIG_VELOCIKEY, 0); + else + eeprom_update_byte(EECONFIG_VELOCIKEY, 1); +} + +void velocikey_accelerate(void) { + if (typing_speed < TYPING_SPEED_MAX_VALUE) typing_speed += (TYPING_SPEED_MAX_VALUE / 100); +} + +void velocikey_decelerate(void) { + static uint16_t decay_timer = 0; + + if (timer_elapsed(decay_timer) > 500 || decay_timer == 0) { + if (typing_speed > 0) typing_speed -= 1; + //Decay a little faster at half of max speed + if (typing_speed > TYPING_SPEED_MAX_VALUE / 2) typing_speed -= 1; + //Decay even faster at 3/4 of max speed + if (typing_speed > TYPING_SPEED_MAX_VALUE / 4 * 3) typing_speed -= 2; + decay_timer = timer_read(); + } +} + +uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue) { + return MAX(minValue, maxValue - (maxValue - minValue) * ((float)typing_speed / TYPING_SPEED_MAX_VALUE)); +} diff --git a/quantum/velocikey.h b/quantum/velocikey.h new file mode 100644 index 00000000000..1910f0f4e96 --- /dev/null +++ b/quantum/velocikey.h @@ -0,0 +1,13 @@ +#ifndef VELOCIKEY_H +#define VELOCIKEY_H + +#include +#include + +bool velocikey_enabled(void); +void velocikey_toggle(void); +void velocikey_accelerate(void); +void velocikey_decelerate(void); +uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue); + +#endif \ No newline at end of file diff --git a/quantum/visualizer/readme.md b/quantum/visualizer/readme.md index 545ba227078..298efb742f2 100644 --- a/quantum/visualizer/readme.md +++ b/quantum/visualizer/readme.md @@ -1,7 +1,7 @@ # A visualization library for the TMK keyboard firmware This library is designed to work together with the [TMK keyboard firmware](https://github.com/tmk/tmk_keyboard). Currently it only works for [Chibios](http://www.chibios.org/) - flavors, but it would be possible to add support for other configurations as well. The LCD display functionality is provided by the [uGFX library](http://www.ugfx.org/). + flavors, but it would be possible to add support for other configurations as well. The LCD display functionality is provided by the [uGFX library](https://ugfx.io/). ## To use this library as a user You can and should modify the visualizer\_user.c file. Check the comments in the file for more information. diff --git a/readme.md b/readme.md index 6e6cfaa1bd1..b08c675e4e8 100644 --- a/readme.md +++ b/readme.md @@ -7,7 +7,7 @@ [![GitHub contributors](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) [![GitHub forks](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) -This is a keyboard firmware based on the [tmk\_keyboard firmware](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR and ARM controllers, and more specifically, the [OLKB product line](https://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/). +This is a keyboard firmware based on the [tmk\_keyboard firmware](https://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR and ARM controllers, and more specifically, the [OLKB product line](https://olkb.com), the [ErgoDox EZ](https://ergodox-ez.com) keyboard, and the [Clueboard product line](https://clueboard.co). ## Documentation @@ -28,8 +28,8 @@ The project also includes community support for [lots of other keyboards](/keybo ## Maintainers -QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), the Clueboard by [Zach White](https://github.com/skullydazed), and the Atreus by [Phil Hagelberg](https://github.com/technomancy). +QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [ZSA Technology Labs](https://github.com/zsa), the Clueboard by [Zach White](https://github.com/skullydazed), and the Atreus by [Phil Hagelberg](https://github.com/technomancy). -## Official website +## Official Website -[http://qmk.fm](http://qmk.fm) is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK. +[qmk.fm](https://qmk.fm) is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000000..351dc2524e1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +# Python requirements +# milc FIXME(skullydazed): Included in the repo for now. +argcomplete +colorama +#halo diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000000..528512ac6f4 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,330 @@ +# Python settings for QMK + +[yapf] +# Align closing bracket with visual indentation. +align_closing_bracket_with_visual_indent=True + +# Allow dictionary keys to exist on multiple lines. For example: +# +# x = { +# ('this is the first element of a tuple', +# 'this is the second element of a tuple'): +# value, +# } +allow_multiline_dictionary_keys=False + +# Allow lambdas to be formatted on more than one line. +allow_multiline_lambdas=False + +# Allow splitting before a default / named assignment in an argument list. +allow_split_before_default_or_named_assigns=True + +# Allow splits before the dictionary value. +allow_split_before_dict_value=True + +# Let spacing indicate operator precedence. For example: +# +# a = 1 * 2 + 3 / 4 +# b = 1 / 2 - 3 * 4 +# c = (1 + 2) * (3 - 4) +# d = (1 - 2) / (3 + 4) +# e = 1 * 2 - 3 +# f = 1 + 2 + 3 + 4 +# +# will be formatted as follows to indicate precedence: +# +# a = 1*2 + 3/4 +# b = 1/2 - 3*4 +# c = (1+2) * (3-4) +# d = (1-2) / (3+4) +# e = 1*2 - 3 +# f = 1 + 2 + 3 + 4 +# +arithmetic_precedence_indication=True + +# Number of blank lines surrounding top-level function and class +# definitions. +blank_lines_around_top_level_definition=2 + +# Insert a blank line before a class-level docstring. +blank_line_before_class_docstring=False + +# Insert a blank line before a module docstring. +blank_line_before_module_docstring=False + +# Insert a blank line before a 'def' or 'class' immediately nested +# within another 'def' or 'class'. For example: +# +# class Foo: +# # <------ this blank line +# def method(): +# ... +blank_line_before_nested_class_or_def=False + +# Do not split consecutive brackets. Only relevant when +# dedent_closing_brackets is set. For example: +# +# call_func_that_takes_a_dict( +# { +# 'key1': 'value1', +# 'key2': 'value2', +# } +# ) +# +# would reformat to: +# +# call_func_that_takes_a_dict({ +# 'key1': 'value1', +# 'key2': 'value2', +# }) +coalesce_brackets=True + +# The column limit. +column_limit=256 + +# The style for continuation alignment. Possible values are: +# +# - SPACE: Use spaces for continuation alignment. This is default behavior. +# - FIXED: Use fixed number (CONTINUATION_INDENT_WIDTH) of columns +# (ie: CONTINUATION_INDENT_WIDTH/INDENT_WIDTH tabs) for continuation +# alignment. +# - VALIGN-RIGHT: Vertically align continuation lines with indent +# characters. Slightly right (one more indent character) if cannot +# vertically align continuation lines with indent characters. +# +# For options FIXED, and VALIGN-RIGHT are only available when USE_TABS is +# enabled. +continuation_align_style=SPACE + +# Indent width used for line continuations. +continuation_indent_width=4 + +# Put closing brackets on a separate line, dedented, if the bracketed +# expression can't fit in a single line. Applies to all kinds of brackets, +# including function definitions and calls. For example: +# +# config = { +# 'key1': 'value1', +# 'key2': 'value2', +# } # <--- this bracket is dedented and on a separate line +# +# time_series = self.remote_client.query_entity_counters( +# entity='dev3246.region1', +# key='dns.query_latency_tcp', +# transform=Transformation.AVERAGE(window=timedelta(seconds=60)), +# start_ts=now()-timedelta(days=3), +# end_ts=now(), +# ) # <--- this bracket is dedented and on a separate line +dedent_closing_brackets=True + +# Disable the heuristic which places each list element on a separate line +# if the list is comma-terminated. +disable_ending_comma_heuristic=False + +# Place each dictionary entry onto its own line. +each_dict_entry_on_separate_line=True + +# The regex for an i18n comment. The presence of this comment stops +# reformatting of that line, because the comments are required to be +# next to the string they translate. +i18n_comment= + +# The i18n function call names. The presence of this function stops +# reformattting on that line, because the string it has cannot be moved +# away from the i18n comment. +i18n_function_call= + +# Indent blank lines. +indent_blank_lines=False + +# Indent the dictionary value if it cannot fit on the same line as the +# dictionary key. For example: +# +# config = { +# 'key1': +# 'value1', +# 'key2': value1 + +# value2, +# } +indent_dictionary_value=True + +# The number of columns to use for indentation. +indent_width=4 + +# Join short lines into one line. E.g., single line 'if' statements. +join_multiple_lines=False + +# Do not include spaces around selected binary operators. For example: +# +# 1 + 2 * 3 - 4 / 5 +# +# will be formatted as follows when configured with "*,/": +# +# 1 + 2*3 - 4/5 +no_spaces_around_selected_binary_operators= + +# Use spaces around default or named assigns. +spaces_around_default_or_named_assign=False + +# Use spaces around the power operator. +spaces_around_power_operator=False + +# The number of spaces required before a trailing comment. +# This can be a single value (representing the number of spaces +# before each trailing comment) or list of values (representing +# alignment column values; trailing comments within a block will +# be aligned to the first column value that is greater than the maximum +# line length within the block). For example: +# +# With spaces_before_comment=5: +# +# 1 + 1 # Adding values +# +# will be formatted as: +# +# 1 + 1 # Adding values <-- 5 spaces between the end of the statement and comment +# +# With spaces_before_comment=15, 20: +# +# 1 + 1 # Adding values +# two + two # More adding +# +# longer_statement # This is a longer statement +# short # This is a shorter statement +# +# a_very_long_statement_that_extends_beyond_the_final_column # Comment +# short # This is a shorter statement +# +# will be formatted as: +# +# 1 + 1 # Adding values <-- end of line comments in block aligned to col 15 +# two + two # More adding +# +# longer_statement # This is a longer statement <-- end of line comments in block aligned to col 20 +# short # This is a shorter statement +# +# a_very_long_statement_that_extends_beyond_the_final_column # Comment <-- the end of line comments are aligned based on the line length +# short # This is a shorter statement +# +spaces_before_comment=2 + +# Insert a space between the ending comma and closing bracket of a list, +# etc. +space_between_ending_comma_and_closing_bracket=False + +# Split before arguments +split_all_comma_separated_values=False + +# Split before arguments if the argument list is terminated by a +# comma. +split_arguments_when_comma_terminated=True + +# Set to True to prefer splitting before '+', '-', '*', '/', '//', or '@' +# rather than after. +split_before_arithmetic_operator=False + +# Set to True to prefer splitting before '&', '|' or '^' rather than +# after. +split_before_bitwise_operator=True + +# Split before the closing bracket if a list or dict literal doesn't fit on +# a single line. +split_before_closing_bracket=True + +# Split before a dictionary or set generator (comp_for). For example, note +# the split before the 'for': +# +# foo = { +# variable: 'Hello world, have a nice day!' +# for variable in bar if variable != 42 +# } +split_before_dict_set_generator=True + +# Split before the '.' if we need to split a longer expression: +# +# foo = ('This is a really long string: {}, {}, {}, {}'.format(a, b, c, d)) +# +# would reformat to something like: +# +# foo = ('This is a really long string: {}, {}, {}, {}' +# .format(a, b, c, d)) +split_before_dot=False + +# Split after the opening paren which surrounds an expression if it doesn't +# fit on a single line. +split_before_expression_after_opening_paren=False + +# If an argument / parameter list is going to be split, then split before +# the first argument. +split_before_first_argument=False + +# Set to True to prefer splitting before 'and' or 'or' rather than +# after. +split_before_logical_operator=False + +# Split named assignments onto individual lines. +split_before_named_assigns=True + +# Set to True to split list comprehensions and generators that have +# non-trivial expressions and multiple clauses before each of these +# clauses. For example: +# +# result = [ +# a_long_var + 100 for a_long_var in xrange(1000) +# if a_long_var % 10] +# +# would reformat to something like: +# +# result = [ +# a_long_var + 100 +# for a_long_var in xrange(1000) +# if a_long_var % 10] +split_complex_comprehension=True + +# The penalty for splitting right after the opening bracket. +split_penalty_after_opening_bracket=300 + +# The penalty for splitting the line after a unary operator. +split_penalty_after_unary_operator=10000 + +# The penalty of splitting the line around the '+', '-', '*', '/', '//', +# ``%``, and '@' operators. +split_penalty_arithmetic_operator=300 + +# The penalty for splitting right before an if expression. +split_penalty_before_if_expr=0 + +# The penalty of splitting the line around the '&', '|', and '^' +# operators. +split_penalty_bitwise_operator=300 + +# The penalty for splitting a list comprehension or generator +# expression. +split_penalty_comprehension=80 + +# The penalty for characters over the column limit. +split_penalty_excess_character=7000 + +# The penalty incurred by adding a line split to the unwrapped line. The +# more line splits added the higher the penalty. +split_penalty_for_added_line_split=30 + +# The penalty of splitting a list of "import as" names. For example: +# +# from a_very_long_or_indented_module_name_yada_yad import (long_argument_1, +# long_argument_2, +# long_argument_3) +# +# would reformat to something like: +# +# from a_very_long_or_indented_module_name_yada_yad import ( +# long_argument_1, long_argument_2, long_argument_3) +split_penalty_import_names=0 + +# The penalty of splitting the line around the 'and' and 'or' +# operators. +split_penalty_logical_operator=300 + +# Use the Tab character for indentation. +use_tabs=False + diff --git a/shell.nix b/shell.nix index 67efb46b745..e85221975d3 100644 --- a/shell.nix +++ b/shell.nix @@ -4,6 +4,13 @@ with pkgs; let + avrbinutils = pkgsCross.avr.buildPackages.binutils; + avrlibc = pkgsCross.avr.libcCross; + gcc-arm-embedded = (import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs-channels/archive/87f146a41c463a64c93022b11cf19716b3a22037.tar.gz"; + sha256 = "0rk8haf19plw6vyvq0am99rik0hrrysknjw0f2vs7985awngy3q2"; + }) {}).gcc-arm-embedded; + avr_incflags = [ "-isystem ${avrlibc}/avr/include" "-B${avrlibc}/avr/lib/avr5" @@ -13,7 +20,7 @@ let "-B${avrlibc}/avr/lib/avr51" "-L${avrlibc}/avr/lib/avr51" ]; - avrgcc = pkgs.avrgcc.overrideAttrs (oldAttrs: rec { + avrgcc = pkgsCross.avr.buildPackages.gcc.overrideAttrs (oldAttrs: rec { name = "avr-gcc-8.1.0"; src = fetchurl { url = "mirror://gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.xz"; diff --git a/show_options.mk b/show_options.mk new file mode 100644 index 00000000000..02e062a8d94 --- /dev/null +++ b/show_options.mk @@ -0,0 +1,137 @@ +BUILD_OPTION_NAMES = \ + BOOTMAGIC_ENABLE \ + MOUSEKEY_ENABLE \ + EXTRAKEY_ENABLE \ + CONSOLE_ENABLE \ + COMMAND_ENABLE \ + NKRO_ENABLE \ + TERMINAL_ENABLE \ + CUSTOM_MATRIX \ + DEBOUNCE_TYPE \ + SPLIT_KEYBOARD \ + DYNAMIC_KEYMAP_ENABLE \ + USB_HID_ENABLE + +HARDWARE_OPTION_NAMES = \ + SLEEP_LED_ENABLE \ + BACKLIGHT_ENABLE \ + BACKLIGHT_CUSTOM_DRIVER \ + RGBLIGHT_ENABLE \ + RGBLIGHT_CUSTOM_DRIVER \ + RGB_MATRIX_ENABLE \ + SERIAL_LINK_ENABLE \ + CIE1931_CURVE \ + MIDI_ENABLE \ + BLUETOOTH_ENABLE \ + AUDIO_ENABLE \ + FAUXCLICKY_ENABLE \ + HD44780_ENABLE \ + ENCODER_ENABLE \ + LCD_ENABLE \ + LED_BREATHING_TABLE \ + LED_TABLES \ + POINTING_DEVICE_ENABLE \ + VISUALIZER_ENABLE + +OTHER_OPTION_NAMES = \ + UNICODE_ENABLE \ + UCIS_ENABLE \ + UNICODEMAP_ENABLE \ + UNICODE_COMMON \ + API_SYSEX_ENABLE \ + AUTO_SHIFT_ENABLE \ + AUTO_SHIFT_MODIFIERS \ + COMBO_ENABLE \ + KEY_LOCK_ENABLE \ + LEADER_ENABLE \ + PRINTING_ENABLE \ + STENO_ENABLE \ + TAP_DANCE_ENABLE \ + VIRTSER_ENABLE \ + OLED_ENABLE \ + LED_BACK_ENABLE \ + LED_UNDERGLOW_ENABLE \ + LED_ANIMATIONS \ + IOS_DEVICE_ENABLE \ + HELIX ZINC \ + ADAFRUIT_BLE_ENABLE \ + AUTOLOG_ENABLE \ + BREATHING_LED_ENABLE \ + DEBUG_ENABLE \ + ENCODER_ENABLE_CUSTOM \ + FADING_LED_ENABLE \ + GERMAN_ENABLE \ + HAPTIC_ENABLE \ + HHKB_RN42_ENABLE \ + ISSI_ENABLE \ + KEYBOARD_LOCK_ENABLE \ + KEYLOGGER_ENABLE \ + KEYMAP_IN_EEPROM_ENABLE \ + KEYMAP_SECTION_ENABLE \ + LCD_BACKLIGHT_ENABLE \ + LEDMAP_ENABLE \ + LEDMAP_IN_EEPROM_ENABLE \ + MACROS_ENABLED \ + ONEHAND_ENABLE \ + PS2_MOUSE_ENABLE \ + RAW_ENABLE \ + SOFTPWM_LED_ENABLE \ + SWAP_HANDS_ENABLE \ + USB_6KRO_ENABLE \ + WATCHDOG_ENABLE \ + XT_ENABLE \ + ERGOINU \ + NO_USB_STARTUP_CHECK \ + DISABLE_PROMICRO_LEDs \ + MITOSIS_DATAGROK_BOTTOMSPACE \ + MITOSIS_DATAGROK_SLOWUART \ + RGB_MATRIX_KEYPRESSES \ + LED_MIRRORED \ + RGBLIGHT_FULL_POWER \ + Link_Time_Optimization \ + LINK_TIME_OPTIMIZATION_ENABLE + +define NAME_ECHO + @echo " $1 = $($1) # $(origin $1)" + +endef + +.PHONY: show_build_options0 show_build_options +show_build_options0: + @echo " KEYBOARD = $(KEYBOARD)" + @echo " KEYMAP = $(KEYMAP)" + @echo " MCU = $(MCU)" + @echo " MCU_SERIES = $(MCU_SERIES)" + @echo " PLATFORM = $(PLATFORM)" + @echo " FIRMWARE_FORMAT = $(FIRMWARE_FORMAT)" + @echo + @echo "Build Options:" + $(foreach A_OPTION_NAME,$(sort $(BUILD_OPTION_NAMES)),\ + $(call NAME_ECHO,$(A_OPTION_NAME))) + +show_build_options: show_build_options0 + @echo + @echo "If you want to know more, please try 'show_all_features' or 'show_full_features'" + @echo + +.PHONY: show_all_features +show_all_features: show_build_options0 + @echo + @echo "Hardware Options:" + $(foreach A_OPTION_NAME,$(sort $(HARDWARE_OPTION_NAMES)),\ + $(if $($(A_OPTION_NAME)),$(call NAME_ECHO,$(A_OPTION_NAME)))) + @echo + @echo "Other Options:" + $(foreach A_OPTION_NAME,$(sort $(OTHER_OPTION_NAMES)),\ + $(if $($(A_OPTION_NAME)),$(call NAME_ECHO,$(A_OPTION_NAME)))) + +.PHONY: show_full_features +show_full_features: show_build_options0 + @echo + @echo "Hardware Options:" + $(foreach A_OPTION_NAME,$(sort $(HARDWARE_OPTION_NAMES)),\ + $(call NAME_ECHO,$(A_OPTION_NAME))) + @echo + @echo "Other Options:" + $(foreach A_OPTION_NAME,$(sort $(OTHER_OPTION_NAMES)),\ + $(call NAME_ECHO,$(A_OPTION_NAME))) diff --git a/tests/basic/keymap.c b/tests/basic/keymap.c index 3f97c0a0ee9..5dd9aaeb6ee 100644 --- a/tests/basic/keymap.c +++ b/tests/basic/keymap.c @@ -41,6 +41,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } return MACRO_NONE; }; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { -} \ No newline at end of file diff --git a/tmk_core/arm_atsam.mk b/tmk_core/arm_atsam.mk index 06823fb629f..25a3411f4f9 100644 --- a/tmk_core/arm_atsam.mk +++ b/tmk_core/arm_atsam.mk @@ -6,7 +6,7 @@ CC = arm-none-eabi-gcc OBJCOPY = arm-none-eabi-objcopy OBJDUMP = arm-none-eabi-objdump SIZE = arm-none-eabi-size -AR = arm-none-eabi-ar rcs +AR = arm-none-eabi-ar NM = arm-none-eabi-nm HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index add904c9c52..5bfd5a9b0dc 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -6,7 +6,7 @@ CC = avr-gcc OBJCOPY = avr-objcopy OBJDUMP = avr-objdump SIZE = avr-size -AR = avr-ar rcs +AR = avr-ar NM = avr-nm HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) @@ -169,6 +169,36 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep fi $(DFU_PROGRAMMER) $(MCU) reset +dfu-split-left: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size + until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\ + echo "Error: Bootloader not found. Trying again in 5s." ;\ + sleep 5 ;\ + done + if $(DFU_PROGRAMMER) --version 2>&1 | $(GREP) -q 0.7 ; then\ + $(DFU_PROGRAMMER) $(MCU) erase --force;\ + $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(QUANTUM_PATH)/split_common/eeprom-lefthand.eep;\ + else\ + $(DFU_PROGRAMMER) $(MCU) erase;\ + $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(QUANTUM_PATH)/split_common/eeprom-lefthand.eep;\ + fi + $(DFU_PROGRAMMER) $(MCU) flash $(BUILD_DIR)/$(TARGET).hex + $(DFU_PROGRAMMER) $(MCU) reset + +dfu-split-right: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size + until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\ + echo "Error: Bootloader not found. Trying again in 5s." ;\ + sleep 5 ;\ + done + if $(DFU_PROGRAMMER) --version 2>&1 | $(GREP) -q 0.7 ; then\ + $(DFU_PROGRAMMER) $(MCU) erase --force;\ + $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(QUANTUM_PATH)/split_common/eeprom-righthand.eep;\ + else\ + $(DFU_PROGRAMMER) $(MCU) erase;\ + $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(QUANTUM_PATH)/split_common/eeprom-righthand.eep;\ + fi + $(DFU_PROGRAMMER) $(MCU) flash $(BUILD_DIR)/$(TARGET).hex + $(DFU_PROGRAMMER) $(MCU) reset + define EXEC_AVRDUDE USB= ;\ if $(GREP) -q -s Microsoft /proc/version; then \ @@ -184,13 +214,20 @@ define EXEC_AVRDUDE mv /tmp/2 /tmp/1; \ done; \ echo ""; \ - echo "Detected controller on USB port at $$USB"; \ + echo "Device $$USB has appeared; assuming it is the controller."; \ if $(GREP) -q -s 'MINGW\|MSYS' /proc/version; then \ USB=`echo "$$USB" | perl -pne 's/\/dev\/ttyS(\d+)/COM.($$1+1)/e'`; \ echo "Remapped MSYS2 USB port to $$USB"; \ + sleep 1; \ + else \ + printf "Waiting for $$USB to become writable."; \ + while [ ! -w "$$USB" ]; do sleep 0.5; printf "."; done; echo ""; \ fi; \ - sleep 1; \ - avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \ + if [ -z "$(1)" ]; then \ + avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \ + else \ + avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex -U eeprom:w:$(QUANTUM_PATH)/split_common/$(1); \ + fi \ fi endef @@ -199,9 +236,19 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware avrdude-loop: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware while true; do \ - $(call EXEC_AVRDUDE) ; \ + $(call EXEC_AVRDUDE) ; \ done +avrdude-split-left: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware + $(call EXEC_AVRDUDE,eeprom-lefthand.eep) + +avrdude-split-right: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware + $(call EXEC_AVRDUDE,eeprom-righthand.eep) + +usbasp: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware + avrdude -p $(MCU) -c usbasp -U flash:w:$(BUILD_DIR)/$(TARGET).hex + + # Convert hex to bin. bin: $(BUILD_DIR)/$(TARGET).hex $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin @@ -262,15 +309,12 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf bootloader: make -C lib/lufa/Bootloaders/DFU/ clean - printf "#ifndef QMK_KEYBOARD\n#define QMK_KEYBOARD\n\n" > lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "MANUFACTURER\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s Bootloader\n" "`$(GREP) "PRODUCT\s" $(ALL_CONFIGS) -h | tail -1 | tr -d '\r'`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "QMK_ESC_OUTPUT\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "QMK_ESC_INPUT\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "QMK_LED\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "QMK_SPEAKER\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "\n#endif" >> lib/lufa/Bootloaders/DFU/Keyboard.h - make -C lib/lufa/Bootloaders/DFU/ + $(TMK_DIR)/make_dfu_header.sh $(ALL_CONFIGS) + $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) + $(eval PROGRAM_SIZE_KB=$(shell n=`expr $(MAX_SIZE) / 1024` && echo $$(($$n)) || echo 0)) + $(eval BOOT_SECTION_SIZE_KB=$(shell n=`expr $(BOOTLOADER_SIZE) / 1024` && echo $$(($$n)) || echo 0)) + $(eval FLASH_SIZE_KB=$(shell n=`expr $(PROGRAM_SIZE_KB) + $(BOOT_SECTION_SIZE_KB)` && echo $$(($$n)) || echo 0)) + make -C lib/lufa/Bootloaders/DFU/ MCU=$(MCU) ARCH=$(ARCH) F_CPU=$(F_CPU) FLASH_SIZE_KB=$(FLASH_SIZE_KB) BOOT_SECTION_SIZE_KB=$(BOOT_SECTION_SIZE_KB) printf "BootloaderDFU.hex copied to $(TARGET)_bootloader.hex\n" cp lib/lufa/Bootloaders/DFU/BootloaderDFU.hex $(TARGET)_bootloader.hex @@ -279,4 +323,3 @@ production: $(BUILD_DIR)/$(TARGET).hex bootloader cpfirmware @cat $(TARGET)_bootloader.hex >> $(TARGET)_production.hex echo "File sizes:" $(SIZE) $(TARGET).hex $(TARGET)_bootloader.hex $(TARGET)_production.hex - diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 0f665450ac5..4aebb477629 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -39,9 +39,13 @@ include $(STARTUP_MK) # HAL-OSAL files (optional). include $(CHIBIOS)/os/hal/hal.mk -PLATFORM_MK = $(CHIBIOS)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/platform.mk +ifeq ("$(PLATFORM_NAME)","") + PLATFORM_NAME = platform +endif + +PLATFORM_MK = $(CHIBIOS)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/$(PLATFORM_NAME).mk ifeq ("$(wildcard $(PLATFORM_MK))","") -PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/platform.mk +PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/$(PLATFORM_NAME).mk endif include $(PLATFORM_MK) @@ -254,5 +258,17 @@ dfu-util-wait: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst + +# Autodetect teensy loader +ifndef TEENSY_LOADER_CLI + ifneq (, $(shell which teensy-loader-cli 2>/dev/null)) + TEENSY_LOADER_CLI ?= teensy-loader-cli + else + TEENSY_LOADER_CLI ?= teensy_loader_cli + endif +endif + +teensy: $(BUILD_DIR)/$(TARGET).hex cpfirmware sizeafter + $(TEENSY_LOADER_CLI) -mmcu=$(MCU_LDSCRIPT) -w -v $(BUILD_DIR)/$(TARGET).hex + bin: $(BUILD_DIR)/$(TARGET).bin sizeafter - $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 3844b13d48d..22168875551 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -41,11 +41,18 @@ ifeq ($(PLATFORM),CHIBIOS) TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F103xB TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE + else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F072xB) + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c + TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F072xB + TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE else TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c -endif + endif ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes) TMK_COMMON_SRC += $(CHIBIOS)/os/various/syscalls.c + else ifeq ($(strip $(TERMINAL_ENABLE)), yes) + TMK_COMMON_SRC += $(CHIBIOS)/os/various/syscalls.c endif endif @@ -80,15 +87,31 @@ else TMK_COMMON_SRC += $(COMMON_DIR)/magic.c endif +SHARED_EP_ENABLE = no +MOUSE_SHARED_EP ?= yes +ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes) + TMK_COMMON_DEFS += -DKEYBOARD_SHARED_EP + SHARED_EP_ENABLE = yes + # With the current usb_descriptor.c code, + # you can't share kbd without sharing mouse; + # that would be a very unexpected use case anyway + MOUSE_SHARED_EP = yes +endif ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) TMK_COMMON_SRC += $(COMMON_DIR)/mousekey.c TMK_COMMON_DEFS += -DMOUSEKEY_ENABLE TMK_COMMON_DEFS += -DMOUSE_ENABLE + + ifeq ($(strip $(MOUSE_SHARED_EP)), yes) + TMK_COMMON_DEFS += -DMOUSE_SHARED_EP + SHARED_EP_ENABLE = yes + endif endif ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE + SHARED_EP_ENABLE = yes endif ifeq ($(strip $(RAW_ENABLE)), yes) @@ -109,6 +132,7 @@ endif ifeq ($(strip $(NKRO_ENABLE)), yes) TMK_COMMON_DEFS += -DNKRO_ENABLE + SHARED_EP_ENABLE = yes endif ifeq ($(strip $(USB_6KRO_ENABLE)), yes) @@ -180,6 +204,17 @@ ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes) endif endif +ifeq ($(strip $(SHARED_EP_ENABLE)), yes) + TMK_COMMON_DEFS += -DSHARED_EP_ENABLE +endif + + +ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes) + EXTRAFLAGS += -flto + TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATION_ENABLE + TMK_COMMON_DEFS += -DNO_ACTION_MACRO + TMK_COMMON_DEFS += -DNO_ACTION_FUNCTION +endif # Bootloader address ifdef STM32_BOOTLOADER_ADDRESS TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS) diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 8bdcd54e32c..5172e8650ad 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -44,6 +44,12 @@ int retro_tapping_counter = 0; #include #endif +#ifndef TAP_CODE_DELAY +# define TAP_CODE_DELAY 0 +#endif +#ifndef TAP_HOLD_CAPS_DELAY +# define TAP_HOLD_CAPS_DELAY 80 +#endif /** \brief Called to execute an action. * * FIXME: Needs documentation. @@ -327,6 +333,9 @@ void process_action(keyrecord_t *record, action_t action) } else { if (tap_count > 0) { dprint("MODS_TAP: Tap: unregister_code\n"); + if (action.layer_tap.code == KC_CAPS) { + wait_ms(TAP_HOLD_CAPS_DELAY); + } unregister_code(action.key.code); } else { dprint("MODS_TAP: No tap: add_mods\n"); @@ -403,13 +412,13 @@ void process_action(keyrecord_t *record, action_t action) /* Default Layer Bitwise Operation */ if (!event.pressed) { uint8_t shift = action.layer_bitop.part*4; - uint32_t bits = ((uint32_t)action.layer_bitop.bits)< 0) { dprint("KEYMAP_TAP_KEY: Tap: unregister_code\n"); if (action.layer_tap.code == KC_CAPS) { - wait_ms(80); - } + wait_ms(TAP_HOLD_CAPS_DELAY); + } else { + wait_ms(TAP_CODE_DELAY); + } unregister_code(action.layer_tap.code); } else { dprint("KEYMAP_TAP_KEY: No tap: Off on release\n"); @@ -537,7 +548,7 @@ void process_action(keyrecord_t *record, action_t action) action_macro_play(action_get_macro(record, action.func.id, action.func.opt)); break; #endif -#ifdef BACKLIGHT_ENABLE +#if defined(BACKLIGHT_ENABLE) | defined(LED_MATRIX_ENABLE) case ACT_BACKLIGHT: if (!event.pressed) { switch (action.backlight.opt) { @@ -615,6 +626,7 @@ void process_action(keyrecord_t *record, action_t action) if (event.pressed) { register_code(action.swap.code); } else { + wait_ms(TAP_CODE_DELAY); unregister_code(action.swap.code); *record = (keyrecord_t){}; // hack: reset tap mode } @@ -653,7 +665,7 @@ void process_action(keyrecord_t *record, action_t action) #ifndef NO_ACTION_TAPPING #ifdef RETRO_TAPPING - if (!is_tap_key(record->event.key)) { + if (!is_tap_action(action)) { retro_tapping_counter = 0; } else { if (event.pressed) { @@ -667,8 +679,7 @@ void process_action(keyrecord_t *record, action_t action) retro_tapping_counter = 0; } else { if (retro_tapping_counter == 2) { - register_code(action.layer_tap.code); - unregister_code(action.layer_tap.code); + tap_code(action.layer_tap.code); } retro_tapping_counter = 0; } @@ -847,6 +858,20 @@ void unregister_code(uint8_t code) #endif } +/** \brief Utilities for actions. (FIXME: Needs better description) + * + * FIXME: Needs documentation. + */ +void tap_code(uint8_t code) { + register_code(code); + if (code == KC_CAPS) { + wait_ms(TAP_HOLD_CAPS_DELAY); + } else { + wait_ms(TAP_CODE_DELAY); + } + unregister_code(code); +} + /** \brief Utilities for actions. (FIXME: Needs better description) * * FIXME: Needs documentation. @@ -886,10 +911,19 @@ void clear_keyboard(void) * FIXME: Needs documentation. */ void clear_keyboard_but_mods(void) +{ + clear_keys(); + clear_keyboard_but_mods_and_keys(); +} + +/** \brief Utilities for actions. (FIXME: Needs better description) + * + * FIXME: Needs documentation. + */ +void clear_keyboard_but_mods_and_keys() { clear_weak_mods(); clear_macro_mods(); - clear_keys(); send_keyboard_report(); #ifdef MOUSEKEY_ENABLE mousekey_clear(); @@ -908,7 +942,15 @@ void clear_keyboard_but_mods(void) bool is_tap_key(keypos_t key) { action_t action = layer_switch_get_action(key); + return is_tap_action(action); +} +/** \brief Utilities for actions. (FIXME: Needs better description) + * + * FIXME: Needs documentation. + */ +bool is_tap_action(action_t action) +{ switch (action.kind.id) { case ACT_LMODS_TAP: case ACT_RMODS_TAP: diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 833febe9ce9..799e3bb0efd 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -88,14 +88,16 @@ void process_record(keyrecord_t *record); void process_action(keyrecord_t *record, action_t action); void register_code(uint8_t code); void unregister_code(uint8_t code); -inline void tap_code(uint8_t code) { register_code(code); unregister_code(code); } +void tap_code(uint8_t code); void register_mods(uint8_t mods); void unregister_mods(uint8_t mods); //void set_mods(uint8_t mods); void clear_keyboard(void); void clear_keyboard_but_mods(void); +void clear_keyboard_but_mods_and_keys(void); void layer_switch(uint8_t new_layer); bool is_tap_key(keypos_t key); +bool is_tap_action(action_t action); #ifndef NO_ACTION_TAPPING void process_record_tap_hint(keyrecord_t *record); diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index b8dcb34f3a0..dfcbc110ad1 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -13,82 +13,80 @@ /** \brief Default Layer State */ -uint32_t default_layer_state = 0; +layer_state_t default_layer_state = 0; /** \brief Default Layer State Set At user Level * - * FIXME: Needs docs + * Run user code on default layer state change */ __attribute__((weak)) -uint32_t default_layer_state_set_user(uint32_t state) { - return state; +layer_state_t default_layer_state_set_user(layer_state_t state) { + return state; } /** \brief Default Layer State Set At Keyboard Level * - * FIXME: Needs docs + * Run keyboard code on default layer state change */ __attribute__((weak)) -uint32_t default_layer_state_set_kb(uint32_t state) { - return default_layer_state_set_user(state); +layer_state_t default_layer_state_set_kb(layer_state_t state) { + return default_layer_state_set_user(state); } /** \brief Default Layer State Set * - * FIXME: Needs docs + * Static function to set the default layer state, prints debug info and clears keys */ -static void default_layer_state_set(uint32_t state) -{ - state = default_layer_state_set_kb(state); - debug("default_layer_state: "); - default_layer_debug(); debug(" to "); - default_layer_state = state; - default_layer_debug(); debug("\n"); - clear_keyboard_but_mods(); // To avoid stuck keys +static void default_layer_state_set(layer_state_t state) { + state = default_layer_state_set_kb(state); + debug("default_layer_state: "); + default_layer_debug(); debug(" to "); + default_layer_state = state; + default_layer_debug(); debug("\n"); +#ifdef STRICT_LAYER_RELEASE + clear_keyboard_but_mods(); // To avoid stuck keys +#else + clear_keyboard_but_mods_and_keys(); // Don't reset held keys +#endif } /** \brief Default Layer Print * - * FIXME: Needs docs + * Print out the hex value of the 32-bit default layer state, as well as the value of the highest bit. */ -void default_layer_debug(void) -{ - dprintf("%08lX(%u)", default_layer_state, biton32(default_layer_state)); +void default_layer_debug(void) { + dprintf("%08lX(%u)", default_layer_state, biton32(default_layer_state)); } /** \brief Default Layer Set * - * FIXME: Needs docs + * Sets the default layer state. */ -void default_layer_set(uint32_t state) -{ - default_layer_state_set(state); +void default_layer_set(layer_state_t state) { + default_layer_state_set(state); } #ifndef NO_ACTION_LAYER /** \brief Default Layer Or * - * FIXME: Needs docs + * Turns on the default layer based on matching bits between specifed layer and existing layer state */ -void default_layer_or(uint32_t state) -{ - default_layer_state_set(default_layer_state | state); +void default_layer_or(layer_state_t state) { + default_layer_state_set(default_layer_state | state); } /** \brief Default Layer And * - * FIXME: Needs docs + * Turns on default layer based on matching enabled bits between specifed layer and existing layer state */ -void default_layer_and(uint32_t state) -{ - default_layer_state_set(default_layer_state & state); +void default_layer_and(layer_state_t state) { + default_layer_state_set(default_layer_state & state); } /** \brief Default Layer Xor * - * FIXME: Needs docs + * Turns on default layer based on non-matching bits between specifed layer and existing layer state */ -void default_layer_xor(uint32_t state) -{ - default_layer_state_set(default_layer_state ^ state); +void default_layer_xor(layer_state_t state) { + default_layer_state_set(default_layer_state ^ state); } #endif @@ -96,170 +94,172 @@ void default_layer_xor(uint32_t state) #ifndef NO_ACTION_LAYER /** \brief Keymap Layer State */ -uint32_t layer_state = 0; +layer_state_t layer_state = 0; /** \brief Layer state set user * - * FIXME: Needs docs + * Runs user code on layer state change */ __attribute__((weak)) -uint32_t layer_state_set_user(uint32_t state) { - return state; +layer_state_t layer_state_set_user(layer_state_t state) { + return state; } /** \brief Layer state set keyboard * - * FIXME: Needs docs + * Runs keyboard code on layer state change */ __attribute__((weak)) -uint32_t layer_state_set_kb(uint32_t state) { - return layer_state_set_user(state); +layer_state_t layer_state_set_kb(layer_state_t state) { + return layer_state_set_user(state); } /** \brief Layer state set * - * FIXME: Needs docs + * Sets the layer to match the specifed state (a bitmask) */ -void layer_state_set(uint32_t state) -{ - state = layer_state_set_kb(state); - dprint("layer_state: "); - layer_debug(); dprint(" to "); - layer_state = state; - layer_debug(); dprintln(); - clear_keyboard_but_mods(); // To avoid stuck keys +void layer_state_set(layer_state_t state) { + state = layer_state_set_kb(state); + dprint("layer_state: "); + layer_debug(); dprint(" to "); + layer_state = state; + layer_debug(); dprintln(); +#ifdef STRICT_LAYER_RELEASE + clear_keyboard_but_mods(); // To avoid stuck keys +#else + clear_keyboard_but_mods_and_keys(); // Don't reset held keys +#endif } /** \brief Layer clear * - * FIXME: Needs docs + * Turn off all layers */ -void layer_clear(void) -{ - layer_state_set(0); +void layer_clear(void) { + layer_state_set(0); } /** \brief Layer state is * - * FIXME: Needs docs + * Return whether the given state is on (it might still be shadowed by a higher state, though) */ -bool layer_state_is(uint8_t layer) -{ - return layer_state_cmp(layer_state, layer); +bool layer_state_is(uint8_t layer) { + return layer_state_cmp(layer_state, layer); } /** \brief Layer state compare * - * FIXME: Needs docs + * Used for comparing layers {mostly used for unit testing} */ -bool layer_state_cmp(uint32_t cmp_layer_state, uint8_t layer) { - if (!cmp_layer_state) { return layer == 0; } - return (cmp_layer_state & (1UL<= 0; i--) { - if (layers & (1UL<= 0; i--) { + if (layers & (1UL << i)) { + action = action_for_key(i, key); + if (action.code != ACTION_TRANSPARENT) { + return i; + } } - /* fall back to layer 0 */ - return 0; + } + /* fall back to layer 0 */ + return 0; #else - return biton32(default_layer_state); + return biton32(default_layer_state); #endif } /** \brief Layer switch get layer * - * FIXME: Needs docs + * Gets action code based on key position */ -action_t layer_switch_get_action(keypos_t key) -{ - return action_for_key(layer_switch_get_layer(key), key); +action_t layer_switch_get_action(keypos_t key) { + return action_for_key(layer_switch_get_layer(key), key); } diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 6d48321f927..7fa30c86d69 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -21,24 +21,32 @@ along with this program. If not, see . #include "keyboard.h" #include "action.h" +#if defined(LAYER_STATE_8BIT) || ( defined(DYNAMIC_KEYMAP_ENABLE) && DYNAMIC_KEYMAP_LAYER_COUNT >= 8 ) +typedef uint8_t layer_state_t; +#elif defined(LAYER_STATE_16BIT) +typedef uint16_t layer_state_t; +#else +typedef uint32_t layer_state_t; +#endif + /* * Default Layer */ -extern uint32_t default_layer_state; +extern layer_state_t default_layer_state; void default_layer_debug(void); -void default_layer_set(uint32_t state); +void default_layer_set(layer_state_t state); __attribute__((weak)) -uint32_t default_layer_state_set_kb(uint32_t state); +layer_state_t default_layer_state_set_kb(layer_state_t state); __attribute__((weak)) -uint32_t default_layer_state_set_user(uint32_t state); +layer_state_t default_layer_state_set_user(layer_state_t state); #ifndef NO_ACTION_LAYER /* bitwise operation */ -void default_layer_or(uint32_t state); -void default_layer_and(uint32_t state); -void default_layer_xor(uint32_t state); +void default_layer_or(layer_state_t state); +void default_layer_and(layer_state_t state); +void default_layer_xor(layer_state_t state); #else #define default_layer_or(state) #define default_layer_and(state) @@ -50,11 +58,11 @@ void default_layer_xor(uint32_t state); * Keymap Layer */ #ifndef NO_ACTION_LAYER -extern uint32_t layer_state; +extern layer_state_t layer_state; -void layer_state_set(uint32_t state); +void layer_state_set(layer_state_t state); bool layer_state_is(uint8_t layer); -bool layer_state_cmp(uint32_t layer1, uint8_t layer2); +bool layer_state_cmp(layer_state_t layer1, uint8_t layer2); void layer_debug(void); void layer_clear(void); @@ -63,9 +71,9 @@ void layer_on(uint8_t layer); void layer_off(uint8_t layer); void layer_invert(uint8_t layer); /* bitwise operation */ -void layer_or(uint32_t state); -void layer_and(uint32_t state); -void layer_xor(uint32_t state); +void layer_or(layer_state_t state); +void layer_and(layer_state_t state); +void layer_xor(layer_state_t state); #else #define layer_state 0 @@ -82,13 +90,11 @@ void layer_xor(uint32_t state); #define layer_or(state) #define layer_and(state) #define layer_xor(state) - -__attribute__((weak)) -uint32_t layer_state_set_user(uint32_t state); -__attribute__((weak)) -uint32_t layer_state_set_kb(uint32_t state); #endif +layer_state_t layer_state_set_user(layer_state_t state); +layer_state_t layer_state_set_kb(layer_state_t state); + /* pressed actions cache */ #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) /* The number of bits needed to represent the layer number: log2(32). */ @@ -99,7 +105,7 @@ uint8_t read_source_layers_cache(keypos_t key); action_t store_or_get_action(bool pressed, keypos_t key); /* return the topmost non-transparent layer currently associated with key */ -int8_t layer_switch_get_layer(keypos_t key); +uint8_t layer_switch_get_layer(keypos_t key); /* return action depending on current layer status */ action_t layer_switch_get_action(keypos_t key); diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c index 8adf013e16c..3b67ed152f7 100644 --- a/tmk_core/common/action_tapping.c +++ b/tmk_core/common/action_tapping.c @@ -18,8 +18,17 @@ #define IS_TAPPING_PRESSED() (IS_TAPPING() && tapping_key.event.pressed) #define IS_TAPPING_RELEASED() (IS_TAPPING() && !tapping_key.event.pressed) #define IS_TAPPING_KEY(k) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (k))) -#define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM) +__attribute__ ((weak)) +uint16_t get_tapping_term(uint16_t keycode) { + return TAPPING_TERM; +} + +#ifdef TAPPING_TERM_PER_KEY +#define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < get_tapping_term(get_event_keycode(tapping_key.event))) +#else +#define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM) +#endif static keyrecord_t tapping_key = {}; static keyrecord_t waiting_buffer[WAITING_BUFFER_SIZE] = {}; @@ -100,12 +109,17 @@ bool process_tapping(keyrecord_t *keyp) // enqueue return false; } -#if TAPPING_TERM >= 500 || defined PERMISSIVE_HOLD /* Process a key typed within TAPPING_TERM * This can register the key before settlement of tapping, * useful for long TAPPING_TERM but may prevent fast typing. */ - else if (IS_RELEASED(event) && waiting_buffer_typed(event)) { +#if defined(TAPPING_TERM_PER_KEY) || (!defined(PER_KEY_TAPPING_TERM) && TAPPING_TERM >= 500) || defined(PERMISSIVE_HOLD) +#ifdef TAPPING_TERM_PER_KEY + else if ( ( get_tapping_term(get_event_keycode(tapping_key.event)) >= 500) && IS_RELEASED(event) && waiting_buffer_typed(event)) +#else + else if ( IS_RELEASED(event) && waiting_buffer_typed(event)) +#endif + { debug("Tapping: End. No tap. Interfered by typing key\n"); process_record(&tapping_key); tapping_key = (keyrecord_t){}; diff --git a/tmk_core/common/action_tapping.h b/tmk_core/common/action_tapping.h index 2f143ae8b82..1db43a442e3 100644 --- a/tmk_core/common/action_tapping.h +++ b/tmk_core/common/action_tapping.h @@ -35,6 +35,8 @@ along with this program. If not, see . #ifndef NO_ACTION_TAPPING +uint16_t get_event_keycode(keyevent_t event); +uint16_t get_tapping_term(uint16_t keycode); void action_tapping_process(keyrecord_t record); #endif diff --git a/tmk_core/common/action_util.c b/tmk_core/common/action_util.c index afd4ae8b255..365ed6a1ddf 100644 --- a/tmk_core/common/action_util.c +++ b/tmk_core/common/action_util.c @@ -48,13 +48,23 @@ extern inline void del_key(uint8_t key); extern inline void clear_keys(void); #ifndef NO_ACTION_ONESHOT -static int8_t oneshot_mods = 0; -static int8_t oneshot_locked_mods = 0; -int8_t get_oneshot_locked_mods(void) { return oneshot_locked_mods; } -void set_oneshot_locked_mods(int8_t mods) { oneshot_locked_mods = mods; } -void clear_oneshot_locked_mods(void) { oneshot_locked_mods = 0; } +static uint8_t oneshot_mods = 0; +static uint8_t oneshot_locked_mods = 0; +uint8_t get_oneshot_locked_mods(void) { return oneshot_locked_mods; } +void set_oneshot_locked_mods(uint8_t mods) { + if (mods != oneshot_locked_mods) { + oneshot_locked_mods = mods; + oneshot_locked_mods_changed_kb(oneshot_locked_mods); + } +} +void clear_oneshot_locked_mods(void) { + if (oneshot_locked_mods) { + oneshot_locked_mods = 0; + oneshot_locked_mods_changed_kb(oneshot_locked_mods); + } +} #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) -static int16_t oneshot_time = 0; +static uint16_t oneshot_time = 0; bool has_oneshot_mods_timed_out(void) { return TIMER_DIFF_16(timer_read(), oneshot_time) >= ONESHOT_TIMEOUT; } @@ -79,7 +89,7 @@ inline uint8_t get_oneshot_layer(void) { return oneshot_layer_data >> 3; } inline uint8_t get_oneshot_layer_state(void) { return oneshot_layer_data & 0b111; } #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) -static int16_t oneshot_layer_time = 0; +static uint16_t oneshot_layer_time = 0; inline bool has_oneshot_layer_timed_out() { return TIMER_DIFF_16(timer_read(), oneshot_layer_time) >= ONESHOT_TIMEOUT && !(get_oneshot_layer_state() & ONESHOT_TOGGLED); @@ -97,6 +107,7 @@ void set_oneshot_layer(uint8_t layer, uint8_t state) #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) oneshot_layer_time = timer_read(); #endif + oneshot_layer_changed_kb(get_oneshot_layer()); } /** \brief Reset oneshot layer * @@ -107,6 +118,7 @@ void reset_oneshot_layer(void) { #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) oneshot_layer_time = 0; #endif + oneshot_layer_changed_kb(get_oneshot_layer()); } /** \brief Clear oneshot layer * @@ -118,9 +130,7 @@ void clear_oneshot_layer_state(oneshot_fullfillment_t state) oneshot_layer_data &= ~state; if (!get_oneshot_layer_state() && start_state != oneshot_layer_data) { layer_off(get_oneshot_layer()); -#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) - oneshot_layer_time = 0; -#endif + reset_oneshot_layer(); } } /** \brief Is oneshot layer active @@ -243,23 +253,27 @@ void clear_macro_mods(void) { macro_mods = 0; } * * FIXME: needs doc */ -void set_oneshot_mods(uint8_t mods) -{ - oneshot_mods = mods; +void set_oneshot_mods(uint8_t mods) { + if (oneshot_mods != mods) { #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) oneshot_time = timer_read(); #endif + oneshot_mods = mods; + oneshot_mods_changed_kb(mods); + } } /** \brief clear oneshot mods * * FIXME: needs doc */ -void clear_oneshot_mods(void) -{ +void clear_oneshot_mods(void) { + if (oneshot_mods) { oneshot_mods = 0; #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) oneshot_time = 0; #endif + oneshot_mods_changed_kb(oneshot_mods); + } } /** \brief get oneshot mods * @@ -271,6 +285,54 @@ uint8_t get_oneshot_mods(void) } #endif +/** \brief Called when the one shot modifiers have been changed. + * + * \param mods Contains the active modifiers active after the change. + */ +__attribute__((weak)) +void oneshot_locked_mods_changed_user(uint8_t mods) { } + +/** \brief Called when the locked one shot modifiers have been changed. + * + * \param mods Contains the active modifiers active after the change. + */ +__attribute__((weak)) +void oneshot_locked_mods_changed_kb(uint8_t mods) { + oneshot_locked_mods_changed_user(mods); +} + +/** \brief Called when the one shot modifiers have been changed. + * + * \param mods Contains the active modifiers active after the change. + */ +__attribute__((weak)) +void oneshot_mods_changed_user(uint8_t mods) { } + +/** \brief Called when the one shot modifiers have been changed. + * + * \param mods Contains the active modifiers active after the change. + */ +__attribute__((weak)) +void oneshot_mods_changed_kb(uint8_t mods) { + oneshot_mods_changed_user(mods); +} + +/** \brief Called when the one shot layers have been changed. + * + * \param layer Contains the layer that is toggled on, or zero when toggled off. + */ +__attribute__((weak)) +void oneshot_layer_changed_user(uint8_t layer) { } + +/** \brief Called when the one shot layers have been changed. + * + * \param layer Contains the layer that is toggled on, or zero when toggled off. + */ +__attribute__((weak)) +void oneshot_layer_changed_kb(uint8_t layer) { + oneshot_layer_changed_user(layer); +} + /** \brief inspect keyboard state * * FIXME: needs doc diff --git a/tmk_core/common/action_util.h b/tmk_core/common/action_util.h index 34589315144..d03f5682a33 100644 --- a/tmk_core/common/action_util.h +++ b/tmk_core/common/action_util.h @@ -71,8 +71,8 @@ void oneshot_enable(void); void oneshot_disable(void); bool has_oneshot_mods_timed_out(void); -int8_t get_oneshot_locked_mods(void); -void set_oneshot_locked_mods(int8_t mods); +uint8_t get_oneshot_locked_mods(void); +void set_oneshot_locked_mods(uint8_t mods); void clear_oneshot_locked_mods(void); typedef enum { @@ -89,6 +89,13 @@ bool is_oneshot_layer_active(void); uint8_t get_oneshot_layer_state(void); bool has_oneshot_layer_timed_out(void); +void oneshot_locked_mods_changed_user(uint8_t mods); +void oneshot_locked_mods_changed_kb(uint8_t mods); +void oneshot_mods_changed_user(uint8_t mods); +void oneshot_mods_changed_kb(uint8_t mods); +void oneshot_layer_changed_user(uint8_t layer); +void oneshot_layer_changed_kb(uint8_t layer); + /* inspect */ uint8_t has_anymod(void); diff --git a/tmk_core/common/arm_atsam/suspend.c b/tmk_core/common/arm_atsam/suspend.c index 01d1930ea50..ecf8f0ed189 100644 --- a/tmk_core/common/arm_atsam/suspend.c +++ b/tmk_core/common/arm_atsam/suspend.c @@ -1,17 +1,92 @@ -/* Copyright 2017 Fred Sundvik +#include "matrix.h" +#include "i2c_master.h" +#include "led_matrix.h" +#include "suspend.h" + +/** \brief Suspend idle * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. + * FIXME: needs doc + */ +void suspend_idle(uint8_t time) { + /* Note: Not used anywhere currently */ +} + +/** \brief Run user level Power down * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_power_down_user (void) { + +} + +/** \brief Run keyboard level Power down + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_power_down_kb(void) { + suspend_power_down_user(); +} + +/** \brief Suspend power down + * + * FIXME: needs doc + */ +void suspend_power_down(void) +{ +#ifdef RGB_MATRIX_ENABLE + I2C3733_Control_Set(0); //Disable LED driver +#endif + + suspend_power_down_kb(); +} + +__attribute__ ((weak)) void matrix_power_up(void) {} +__attribute__ ((weak)) void matrix_power_down(void) {} +bool suspend_wakeup_condition(void) { + matrix_power_up(); + matrix_scan(); + matrix_power_down(); + for (uint8_t r = 0; r < MATRIX_ROWS; r++) { + if (matrix_get_row(r)) return true; + } + return false; +} + +/** \brief run user level code immediately after wakeup + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_wakeup_init_user(void) { + +} + +/** \brief run keyboard level code immediately after wakeup + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_wakeup_init_kb(void) { + suspend_wakeup_init_user(); +} + +/** \brief run immediately after wakeup * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * FIXME: needs doc */ +void suspend_wakeup_init(void) { +#ifdef RGB_MATRIX_ENABLE +#ifdef USE_MASSDROP_CONFIGURATOR + if (led_enabled) { + I2C3733_Control_Set(1); + } +#else + I2C3733_Control_Set(1); +#endif +#endif + suspend_wakeup_init_kb(); +} diff --git a/tmk_core/common/arm_atsam/timer.c b/tmk_core/common/arm_atsam/timer.c index bcfe5002c34..6c3905e3087 100644 --- a/tmk_core/common/arm_atsam/timer.c +++ b/tmk_core/common/arm_atsam/timer.c @@ -9,7 +9,7 @@ void set_time(uint64_t tset) void timer_init(void) { - ms_clk = 0; + timer_clear(); } uint16_t timer_read(void) @@ -37,23 +37,7 @@ uint32_t timer_elapsed32(uint32_t tlast) return TIMER_DIFF_32(timer_read32(), tlast); } -uint32_t timer_elapsed64(uint32_t tlast) -{ - uint64_t tnow = timer_read64(); - return (tnow >= tlast ? tnow - tlast : UINT64_MAX - tlast + tnow); -} - void timer_clear(void) { - ms_clk = 0; -} - -void wait_ms(uint64_t msec) -{ - CLK_delay_ms(msec); -} - -void wait_us(uint16_t usec) -{ - CLK_delay_us(usec); + set_time(0); } diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c index c4b913280ed..29036f7c5a8 100644 --- a/tmk_core/common/avr/bootloader.c +++ b/tmk_core/common/avr/bootloader.c @@ -65,12 +65,19 @@ #define BOOT_SIZE_1024 0b010 #define BOOT_SIZE_2048 0b000 +//compatibility between ATMega8 and ATMega88 +#if !defined (MCUCSR) + #if defined (MCUSR) + #define MCUCSR MCUSR + #endif +#endif + /** \brief Entering the Bootloader via Software * * http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html */ #define BOOTLOADER_RESET_KEY 0xB007B007 -uint32_t reset_key __attribute__ ((section (".noinit"))); +uint32_t reset_key __attribute__ ((section (".noinit,\"aw\",@nobits;"))); /** \brief initialize MCU status by watchdog reset * @@ -149,6 +156,39 @@ void bootloader_jump(void) { while(1) {} // wait for watchdog timer to trigger + #elif defined(BOOTLOADER_USBASP) + // Taken with permission of Stephan Baerwolf from https://github.com/tinyusbboard/API/blob/master/apipage.c + wdt_enable(WDTO_15MS); + wdt_reset(); + asm volatile ( + "cli \n\t" + "ldi r29 , %[ramendhi] \n\t" + "ldi r28 , %[ramendlo] \n\t" + #if (FLASHEND>131071) + "ldi r18 , %[bootaddrhi] \n\t" + "st Y+, r18 \n\t" + #endif + "ldi r18 , %[bootaddrme] \n\t" + "st Y+, r18 \n\t" + "ldi r18 , %[bootaddrlo] \n\t" + "st Y+, r18 \n\t" + "out %[mcucsrio], __zero_reg__ \n\t" + "bootloader_startup_loop%=: \n\t" + "rjmp bootloader_startup_loop%= \n\t" + : + : [mcucsrio] "I" (_SFR_IO_ADDR(MCUCSR)), + #if (FLASHEND>131071) + [ramendhi] "M" (((RAMEND - 2) >> 8) & 0xff), + [ramendlo] "M" (((RAMEND - 2) >> 0) & 0xff), + [bootaddrhi] "M" ((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >>16) & 0xff), + #else + [ramendhi] "M" (((RAMEND - 1) >> 8) & 0xff), + [ramendlo] "M" (((RAMEND - 1) >> 0) & 0xff), + #endif + [bootaddrme] "M" ((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 8) & 0xff), + [bootaddrlo] "M" ((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 0) & 0xff) + ); + #else // Assume remaining boards are DFU, even if the flag isn't set #if !(defined(__AVR_ATmega32A__) || defined(__AVR_ATmega328P__)) // no USB - maybe BOOTLOADER_BOOTLOADHID instead though? @@ -172,24 +212,19 @@ void bootloader_jump(void) { } -#ifdef __AVR_ATmega32A__ - // MCUSR is actually called MCUCSR in ATmega32A - #define MCUSR MCUCSR -#endif - /* this runs before main() */ void bootloader_jump_after_watchdog_reset(void) __attribute__ ((used, naked, section (".init3"))); void bootloader_jump_after_watchdog_reset(void) { #ifndef BOOTLOADER_HALFKAY - if ((MCUSR & (1<. #include #include +#ifndef BACKLIGHT_LEVELS + #define BACKLIGHT_LEVELS 3 +#elif BACKLIGHT_LEVELS > 31 + #error "Maximum value of BACKLIGHT_LEVELS is 31" +#endif + typedef union { uint8_t raw; struct { - bool enable :1; - uint8_t level :7; + bool enable :1; + bool breathing :1; + uint8_t reserved :1; // Reserved for possible future backlight modes + uint8_t level :5; }; } backlight_config_t; @@ -32,7 +40,19 @@ void backlight_init(void); void backlight_increase(void); void backlight_decrease(void); void backlight_toggle(void); +void backlight_enable(void); +void backlight_disable(void); +bool is_backlight_enabled(void); void backlight_step(void); void backlight_set(uint8_t level); void backlight_level(uint8_t level); uint8_t get_backlight_level(void); + +#ifdef BACKLIGHT_BREATHING +void backlight_toggle_breathing(void); +void backlight_enable_breathing(void); +void backlight_disable_breathing(void); +bool is_backlight_breathing(void); +void breathing_enable(void); +void breathing_disable(void); +#endif diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c index 9f79fb8eedb..cc780d17abb 100644 --- a/tmk_core/common/bootmagic.c +++ b/tmk_core/common/bootmagic.c @@ -99,10 +99,10 @@ void bootmagic(void) if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_7)) { default_layer |= (1<<7); } if (default_layer) { eeconfig_update_default_layer(default_layer); - default_layer_set((uint32_t)default_layer); + default_layer_set((layer_state_t)default_layer); } else { default_layer = eeconfig_read_default_layer(); - default_layer_set((uint32_t)default_layer); + default_layer_set((layer_state_t)default_layer); } } diff --git a/tmk_core/common/chibios/eeprom_stm32.c b/tmk_core/common/chibios/eeprom_stm32.c index a8699855012..4b1abc968da 100755 --- a/tmk_core/common/chibios/eeprom_stm32.c +++ b/tmk_core/common/chibios/eeprom_stm32.c @@ -10,664 +10,205 @@ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and - * https://github.com/leaflabs/libmaple + * This files are free to use from http://engsta.com/stm32-flash-memory-eeprom-emulator/ by + * Artur F. * * Modifications for QMK and STM32F303 by Yiancar */ +#include +#include #include "eeprom_stm32.h" +/***************************************************************************** + * Allows to use the internal flash to store non volatile data. To initialize + * the functionality use the EEPROM_Init() function. Be sure that by reprogramming + * of the controller just affected pages will be deleted. In other case the non + * volatile data will be lost. +******************************************************************************/ + +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Functions -----------------------------------------------------------------*/ + +uint8_t DataBuf[FEE_PAGE_SIZE]; +/***************************************************************************** +* Delete Flash Space used for user Data, deletes the whole space between +* RW_PAGE_BASE_ADDRESS and the last uC Flash Page +******************************************************************************/ +uint16_t EEPROM_Init(void) { + // unlock flash + FLASH_Unlock(); - FLASH_Status EE_ErasePage(uint32_t); - - uint16_t EE_CheckPage(uint32_t, uint16_t); - uint16_t EE_CheckErasePage(uint32_t, uint16_t); - uint16_t EE_Format(void); - uint32_t EE_FindValidPage(void); - uint16_t EE_GetVariablesCount(uint32_t, uint16_t); - uint16_t EE_PageTransfer(uint32_t, uint32_t, uint16_t); - uint16_t EE_VerifyPageFullWriteVariable(uint16_t, uint16_t); - - uint32_t PageBase0 = EEPROM_PAGE0_BASE; - uint32_t PageBase1 = EEPROM_PAGE1_BASE; - uint32_t PageSize = EEPROM_PAGE_SIZE; - uint16_t Status = EEPROM_NOT_INIT; - -// See http://www.st.com/web/en/resource/technical/document/application_note/CD00165693.pdf - -/** - * @brief Check page for blank - * @param page base address - * @retval Success or error - * EEPROM_BAD_FLASH: page not empty after erase - * EEPROM_OK: page blank - */ -uint16_t EE_CheckPage(uint32_t pageBase, uint16_t status) -{ - uint32_t pageEnd = pageBase + (uint32_t)PageSize; - - // Page Status not EEPROM_ERASED and not a "state" - if ((*(__IO uint16_t*)pageBase) != EEPROM_ERASED && (*(__IO uint16_t*)pageBase) != status) - return EEPROM_BAD_FLASH; - for(pageBase += 4; pageBase < pageEnd; pageBase += 4) - if ((*(__IO uint32_t*)pageBase) != 0xFFFFFFFF) // Verify if slot is empty - return EEPROM_BAD_FLASH; - return EEPROM_OK; -} - -/** - * @brief Erase page with increment erase counter (page + 2) - * @param page base address - * @retval Success or error - * FLASH_COMPLETE: success erase - * - Flash error code: on write Flash error - */ -FLASH_Status EE_ErasePage(uint32_t pageBase) -{ - FLASH_Status FlashStatus; - uint16_t data = (*(__IO uint16_t*)(pageBase)); - if ((data == EEPROM_ERASED) || (data == EEPROM_VALID_PAGE) || (data == EEPROM_RECEIVE_DATA)) - data = (*(__IO uint16_t*)(pageBase + 2)) + 1; - else - data = 0; - - FlashStatus = FLASH_ErasePage(pageBase); - if (FlashStatus == FLASH_COMPLETE) - FlashStatus = FLASH_ProgramHalfWord(pageBase + 2, data); + // Clear Flags + //FLASH_ClearFlag(FLASH_SR_EOP|FLASH_SR_PGERR|FLASH_SR_WRPERR); - return FlashStatus; + return FEE_DENSITY_BYTES; } +/***************************************************************************** +* Erase the whole reserved Flash Space used for user Data +******************************************************************************/ +void EEPROM_Erase (void) { -/** - * @brief Check page for blank and erase it - * @param page base address - * @retval Success or error - * - Flash error code: on write Flash error - * - EEPROM_BAD_FLASH: page not empty after erase - * - EEPROM_OK: page blank - */ -uint16_t EE_CheckErasePage(uint32_t pageBase, uint16_t status) -{ - uint16_t FlashStatus; - if (EE_CheckPage(pageBase, status) != EEPROM_OK) - { - FlashStatus = EE_ErasePage(pageBase); - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; - return EE_CheckPage(pageBase, status); - } - return EEPROM_OK; -} - -/** - * @brief Find valid Page for write or read operation - * @param Page0: Page0 base address - * Page1: Page1 base address - * @retval Valid page address (PAGE0 or PAGE1) or NULL in case of no valid page was found - */ -uint32_t EE_FindValidPage(void) -{ - uint16_t status0 = (*(__IO uint16_t*)PageBase0); // Get Page0 actual status - uint16_t status1 = (*(__IO uint16_t*)PageBase1); // Get Page1 actual status - - if (status0 == EEPROM_VALID_PAGE && status1 == EEPROM_ERASED) - return PageBase0; - if (status1 == EEPROM_VALID_PAGE && status0 == EEPROM_ERASED) - return PageBase1; + int page_num = 0; - return 0; + // delete all pages from specified start page to the last page + do { + FLASH_ErasePage(FEE_PAGE_BASE_ADDRESS + (page_num * FEE_PAGE_SIZE)); + page_num++; + } while (page_num < FEE_DENSITY_PAGES); } +/***************************************************************************** +* Writes once data byte to flash on specified address. If a byte is already +* written, the whole page must be copied to a buffer, the byte changed and +* the manipulated buffer written after PageErase. +*******************************************************************************/ +uint16_t EEPROM_WriteDataByte (uint16_t Address, uint8_t DataByte) { -/** - * @brief Calculate unique variables in EEPROM - * @param start: address of first slot to check (page + 4) - * @param end: page end address - * @param address: 16 bit virtual address of the variable to excluse (or 0XFFFF) - * @retval count of variables - */ -uint16_t EE_GetVariablesCount(uint32_t pageBase, uint16_t skipAddress) -{ - uint16_t varAddress, nextAddress; - uint32_t idx; - uint32_t pageEnd = pageBase + (uint32_t)PageSize; - uint16_t count = 0; - - for (pageBase += 6; pageBase < pageEnd; pageBase += 4) - { - varAddress = (*(__IO uint16_t*)pageBase); - if (varAddress == 0xFFFF || varAddress == skipAddress) - continue; - - count++; - for(idx = pageBase + 4; idx < pageEnd; idx += 4) - { - nextAddress = (*(__IO uint16_t*)idx); - if (nextAddress == varAddress) - { - count--; - break; - } - } - } - return count; -} - -/** - * @brief Transfers last updated variables data from the full Page to an empty one. - * @param newPage: new page base address - * @param oldPage: old page base address - * @param SkipAddress: 16 bit virtual address of the variable (or 0xFFFF) - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - EEPROM_OUT_SIZE: if valid new page is full - * - Flash error code: on write Flash error - */ -uint16_t EE_PageTransfer(uint32_t newPage, uint32_t oldPage, uint16_t SkipAddress) -{ - uint32_t oldEnd, newEnd; - uint32_t oldIdx, newIdx, idx; - uint16_t address, data, found; - FLASH_Status FlashStatus; - - // Transfer process: transfer variables from old to the new active page - newEnd = newPage + ((uint32_t)PageSize); - - // Find first free element in new page - for (newIdx = newPage + 4; newIdx < newEnd; newIdx += 4) - if ((*(__IO uint32_t*)newIdx) == 0xFFFFFFFF) // Verify if element - break; // contents are 0xFFFFFFFF - if (newIdx >= newEnd) - return EEPROM_OUT_SIZE; - - oldEnd = oldPage + 4; - oldIdx = oldPage + (uint32_t)(PageSize - 2); - - for (; oldIdx > oldEnd; oldIdx -= 4) - { - address = *(__IO uint16_t*)oldIdx; - if (address == 0xFFFF || address == SkipAddress) - continue; // it's means that power off after write data - - found = 0; - for (idx = newPage + 6; idx < newIdx; idx += 4) - if ((*(__IO uint16_t*)(idx)) == address) - { - found = 1; - break; - } - - if (found) - continue; + FLASH_Status FlashStatus = FLASH_COMPLETE; - if (newIdx < newEnd) - { - data = (*(__IO uint16_t*)(oldIdx - 2)); + uint32_t page; + int i; - FlashStatus = FLASH_ProgramHalfWord(newIdx, data); - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; - - FlashStatus = FLASH_ProgramHalfWord(newIdx + 2, address); - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; - - newIdx += 4; - } - else - return EEPROM_OUT_SIZE; + // exit if desired address is above the limit (e.G. under 2048 Bytes for 4 pages) + if (Address > FEE_DENSITY_BYTES) { + return 0; } - // Erase the old Page: Set old Page status to EEPROM_EEPROM_ERASED status - data = EE_CheckErasePage(oldPage, EEPROM_ERASED); - if (data != EEPROM_OK) - return data; + // calculate which page is affected (Pagenum1/Pagenum2...PagenumN) + page = FEE_ADDR_OFFSET(Address) / FEE_PAGE_SIZE; - // Set new Page status - FlashStatus = FLASH_ProgramHalfWord(newPage, EEPROM_VALID_PAGE); - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; + // if current data is 0xFF, the byte is empty, just overwrite with the new one + if ((*(__IO uint16_t*)(FEE_PAGE_BASE_ADDRESS + FEE_ADDR_OFFSET(Address))) == FEE_EMPTY_WORD) { - return EEPROM_OK; -} + FlashStatus = FLASH_ProgramHalfWord(FEE_PAGE_BASE_ADDRESS + FEE_ADDR_OFFSET(Address), (uint16_t)(0x00FF & DataByte)); + } else { -/** - * @brief Verify if active page is full and Writes variable in EEPROM. - * @param Address: 16 bit virtual address of the variable - * @param Data: 16 bit data to be written as variable value - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - EEPROM_PAGE_FULL: if valid page is full (need page transfer) - * - EEPROM_NO_VALID_PAGE: if no valid page was found - * - EEPROM_OUT_SIZE: if EEPROM size exceeded - * - Flash error code: on write Flash error - */ -uint16_t EE_VerifyPageFullWriteVariable(uint16_t Address, uint16_t Data) -{ - FLASH_Status FlashStatus; - uint32_t idx, pageBase, pageEnd, newPage; - uint16_t count; - - // Get valid Page for write operation - pageBase = EE_FindValidPage(); - if (pageBase == 0) - return EEPROM_NO_VALID_PAGE; - - // Get the valid Page end Address - pageEnd = pageBase + PageSize; // Set end of page - - for (idx = pageEnd - 2; idx > pageBase; idx -= 4) - { - if ((*(__IO uint16_t*)idx) == Address) // Find last value for address - { - count = (*(__IO uint16_t*)(idx - 2)); // Read last data - if (count == Data) - return EEPROM_OK; - if (count == 0xFFFF) - { - FlashStatus = FLASH_ProgramHalfWord(idx - 2, Data); // Set variable data - if (FlashStatus == FLASH_COMPLETE) - return EEPROM_OK; - } - break; - } - } + // Copy Page to a buffer + memcpy(DataBuf, (uint8_t*)FEE_PAGE_BASE_ADDRESS + (page * FEE_PAGE_SIZE), FEE_PAGE_SIZE); // !!! Calculate base address for the desired page - // Check each active page address starting from begining - for (idx = pageBase + 4; idx < pageEnd; idx += 4) - if ((*(__IO uint32_t*)idx) == 0xFFFFFFFF) // Verify if element - { // contents are 0xFFFFFFFF - FlashStatus = FLASH_ProgramHalfWord(idx, Data); // Set variable data - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; - FlashStatus = FLASH_ProgramHalfWord(idx + 2, Address); // Set variable virtual address - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; - return EEPROM_OK; + // check if new data is differ to current data, return if not, proceed if yes + if (DataByte == *(__IO uint8_t*)(FEE_PAGE_BASE_ADDRESS + FEE_ADDR_OFFSET(Address))) { + return 0; } - // Empty slot not found, need page transfer - // Calculate unique variables in page - count = EE_GetVariablesCount(pageBase, Address) + 1; - if (count >= (PageSize / 4 - 1)) - return EEPROM_OUT_SIZE; - - if (pageBase == PageBase1) - newPage = PageBase0; // New page address where variable will be moved to - else - newPage = PageBase1; - - // Set the new Page status to RECEIVE_DATA status - FlashStatus = FLASH_ProgramHalfWord(newPage, EEPROM_RECEIVE_DATA); - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; - - // Write the variable passed as parameter in the new active page - FlashStatus = FLASH_ProgramHalfWord(newPage + 4, Data); - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; - - FlashStatus = FLASH_ProgramHalfWord(newPage + 6, Address); - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; - - return EE_PageTransfer(newPage, pageBase, Address); -} - -/*EEPROMClass::EEPROMClass(void) -{ - PageBase0 = EEPROM_PAGE0_BASE; - PageBase1 = EEPROM_PAGE1_BASE; - PageSize = EEPROM_PAGE_SIZE; - Status = EEPROM_NOT_INIT; -}*/ -/* -uint16_t EEPROM_init(uint32_t pageBase0, uint32_t pageBase1, uint32_t pageSize) -{ - PageBase0 = pageBase0; - PageBase1 = pageBase1; - PageSize = pageSize; - return EEPROM_init(); -}*/ - -uint16_t EEPROM_init(void) -{ - uint16_t status0 = 6, status1 = 6; - FLASH_Status FlashStatus; - - FLASH_Unlock(); - Status = EEPROM_NO_VALID_PAGE; + // manipulate desired data byte in temp data array if new byte is differ to the current + DataBuf[FEE_ADDR_OFFSET(Address) % FEE_PAGE_SIZE] = DataByte; - status0 = (*(__IO uint16_t *)PageBase0); - status1 = (*(__IO uint16_t *)PageBase1); + //Erase Page + FlashStatus = FLASH_ErasePage(FEE_PAGE_BASE_ADDRESS + (page * FEE_PAGE_SIZE)); - switch (status0) - { -/* - Page0 Page1 - ----- ----- - EEPROM_ERASED EEPROM_VALID_PAGE Page1 valid, Page0 erased - EEPROM_RECEIVE_DATA Page1 need set to valid, Page0 erased - EEPROM_ERASED make EE_Format - any Error: EEPROM_NO_VALID_PAGE -*/ - case EEPROM_ERASED: - if (status1 == EEPROM_VALID_PAGE) // Page0 erased, Page1 valid - Status = EE_CheckErasePage(PageBase0, EEPROM_ERASED); - else if (status1 == EEPROM_RECEIVE_DATA) // Page0 erased, Page1 receive - { - FlashStatus = FLASH_ProgramHalfWord(PageBase1, EEPROM_VALID_PAGE); - if (FlashStatus != FLASH_COMPLETE) - Status = FlashStatus; - else - Status = EE_CheckErasePage(PageBase0, EEPROM_ERASED); - } - else if (status1 == EEPROM_ERASED) // Both in erased state so format EEPROM - Status = EEPROM_format(); - break; -/* - Page0 Page1 - ----- ----- - EEPROM_RECEIVE_DATA EEPROM_VALID_PAGE Transfer Page1 to Page0 - EEPROM_ERASED Page0 need set to valid, Page1 erased - any EEPROM_NO_VALID_PAGE -*/ - case EEPROM_RECEIVE_DATA: - if (status1 == EEPROM_VALID_PAGE) // Page0 receive, Page1 valid - Status = EE_PageTransfer(PageBase0, PageBase1, 0xFFFF); - else if (status1 == EEPROM_ERASED) // Page0 receive, Page1 erased - { - Status = EE_CheckErasePage(PageBase1, EEPROM_ERASED); - if (Status == EEPROM_OK) - { - FlashStatus = FLASH_ProgramHalfWord(PageBase0, EEPROM_VALID_PAGE); - if (FlashStatus != FLASH_COMPLETE) - Status = FlashStatus; - else - Status = EEPROM_OK; + // Write new data (whole page) to flash if data has been changed + for(i = 0; i < (FEE_PAGE_SIZE / 2); i++) { + if ((__IO uint16_t)(0xFF00 | DataBuf[FEE_ADDR_OFFSET(i)]) != 0xFFFF) { + FlashStatus = FLASH_ProgramHalfWord((FEE_PAGE_BASE_ADDRESS + (page * FEE_PAGE_SIZE)) + (i * 2), (uint16_t)(0xFF00 | DataBuf[FEE_ADDR_OFFSET(i)])); } } - break; -/* - Page0 Page1 - ----- ----- - EEPROM_VALID_PAGE EEPROM_VALID_PAGE Error: EEPROM_NO_VALID_PAGE - EEPROM_RECEIVE_DATA Transfer Page0 to Page1 - any Page0 valid, Page1 erased -*/ - case EEPROM_VALID_PAGE: - if (status1 == EEPROM_VALID_PAGE) // Both pages valid - Status = EEPROM_NO_VALID_PAGE; - else if (status1 == EEPROM_RECEIVE_DATA) - Status = EE_PageTransfer(PageBase1, PageBase0, 0xFFFF); - else - Status = EE_CheckErasePage(PageBase1, EEPROM_ERASED); - break; -/* - Page0 Page1 - ----- ----- - any EEPROM_VALID_PAGE Page1 valid, Page0 erased - EEPROM_RECEIVE_DATA Page1 valid, Page0 erased - any EEPROM_NO_VALID_PAGE -*/ - default: - if (status1 == EEPROM_VALID_PAGE) - Status = EE_CheckErasePage(PageBase0, EEPROM_ERASED); // Check/Erase Page0 - else if (status1 == EEPROM_RECEIVE_DATA) - { - FlashStatus = FLASH_ProgramHalfWord(PageBase1, EEPROM_VALID_PAGE); - if (FlashStatus != FLASH_COMPLETE) - Status = FlashStatus; - else - Status = EE_CheckErasePage(PageBase0, EEPROM_ERASED); - } - break; } - return Status; -} - -/** - * @brief Erases PAGE0 and PAGE1 and writes EEPROM_VALID_PAGE / 0 header to PAGE0 - * @param PAGE0 and PAGE1 base addresses - * @retval Status of the last operation (Flash write or erase) done during EEPROM formating - */ -uint16_t EEPROM_format(void) -{ - uint16_t status; - FLASH_Status FlashStatus; - - FLASH_Unlock(); - - // Erase Page0 - status = EE_CheckErasePage(PageBase0, EEPROM_VALID_PAGE); - if (status != EEPROM_OK) - return status; - if ((*(__IO uint16_t*)PageBase0) == EEPROM_ERASED) - { - // Set Page0 as valid page: Write VALID_PAGE at Page0 base address - FlashStatus = FLASH_ProgramHalfWord(PageBase0, EEPROM_VALID_PAGE); - if (FlashStatus != FLASH_COMPLETE) - return FlashStatus; - } - // Erase Page1 - return EE_CheckErasePage(PageBase1, EEPROM_ERASED); -} - -/** - * @brief Returns the erase counter for current page - * @param Data: Global variable contains the read variable value - * @retval Success or error status: - * - EEPROM_OK: if erases counter return. - * - EEPROM_NO_VALID_PAGE: if no valid page was found. - */ -uint16_t EEPROM_erases(uint16_t *Erases) -{ - uint32_t pageBase; - if (Status != EEPROM_OK) - if (EEPROM_init() != EEPROM_OK) - return Status; - - // Get active Page for read operation - pageBase = EE_FindValidPage(); - if (pageBase == 0) - return EEPROM_NO_VALID_PAGE; - - *Erases = (*(__IO uint16_t*)pageBase+2); - return EEPROM_OK; -} - -/** - * @brief Returns the last stored variable data, if found, - * which correspond to the passed virtual address - * @param Address: Variable virtual address - * @retval Data for variable or EEPROM_DEFAULT_DATA, if any errors - */ -/* -uint16_t EEPROM_read (uint16_t Address) -{ - uint16_t data; - EEPROM_read(Address, &data); - return data; -}*/ - -/** - * @brief Returns the last stored variable data, if found, - * which correspond to the passed virtual address - * @param Address: Variable virtual address - * @param Data: Pointer to data variable - * @retval Success or error status: - * - EEPROM_OK: if variable was found - * - EEPROM_BAD_ADDRESS: if the variable was not found - * - EEPROM_NO_VALID_PAGE: if no valid page was found. - */ -uint16_t EEPROM_read(uint16_t Address, uint16_t *Data) -{ - uint32_t pageBase, pageEnd; - - // Set default data (empty EEPROM) - *Data = EEPROM_DEFAULT_DATA; - - if (Status == EEPROM_NOT_INIT) - if (EEPROM_init() != EEPROM_OK) - return Status; - - // Get active Page for read operation - pageBase = EE_FindValidPage(); - if (pageBase == 0) - return EEPROM_NO_VALID_PAGE; - - // Get the valid Page end Address - pageEnd = pageBase + ((uint32_t)(PageSize - 2)); - - // Check each active page address starting from end - for (pageBase += 6; pageEnd >= pageBase; pageEnd -= 4) - if ((*(__IO uint16_t*)pageEnd) == Address) // Compare the read address with the virtual address - { - *Data = (*(__IO uint16_t*)(pageEnd - 2)); // Get content of Address-2 which is variable value - return EEPROM_OK; - } - - // Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) - return EEPROM_BAD_ADDRESS; -} - -/** - * @brief Writes/upadtes variable data in EEPROM. - * @param VirtAddress: Variable virtual address - * @param Data: 16 bit data to be written - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - EEPROM_BAD_ADDRESS: if address = 0xFFFF - * - EEPROM_PAGE_FULL: if valid page is full - * - EEPROM_NO_VALID_PAGE: if no valid page was found - * - EEPROM_OUT_SIZE: if no empty EEPROM variables - * - Flash error code: on write Flash error - */ -uint16_t EEPROM_write(uint16_t Address, uint16_t Data) -{ - if (Status == EEPROM_NOT_INIT) - if (EEPROM_init() != EEPROM_OK) - return Status; - - if (Address == 0xFFFF) - return EEPROM_BAD_ADDRESS; - - // Write the variable virtual address and value in the EEPROM - uint16_t status = EE_VerifyPageFullWriteVariable(Address, Data); - return status; -} - -/** - * @brief Writes/upadtes variable data in EEPROM. - The value is written only if differs from the one already saved at the same address. - * @param VirtAddress: Variable virtual address - * @param Data: 16 bit data to be written - * @retval Success or error status: - * - EEPROM_SAME_VALUE: If new Data matches existing EEPROM Data - * - FLASH_COMPLETE: on success - * - EEPROM_BAD_ADDRESS: if address = 0xFFFF - * - EEPROM_PAGE_FULL: if valid page is full - * - EEPROM_NO_VALID_PAGE: if no valid page was found - * - EEPROM_OUT_SIZE: if no empty EEPROM variables - * - Flash error code: on write Flash error - */ -uint16_t EEPROM_update(uint16_t Address, uint16_t Data) -{ - uint16_t temp; - EEPROM_read(Address, &temp); - if (temp == Data) - return EEPROM_SAME_VALUE; - else - return EEPROM_write(Address, Data); + return FlashStatus; } +/***************************************************************************** +* Read once data byte from a specified address. +*******************************************************************************/ +uint8_t EEPROM_ReadDataByte (uint16_t Address) { -/** - * @brief Return number of variable - * @retval Number of variables - */ -uint16_t EEPROM_count(uint16_t *Count) -{ - if (Status == EEPROM_NOT_INIT) - if (EEPROM_init() != EEPROM_OK) - return Status; - - // Get valid Page for write operation - uint32_t pageBase = EE_FindValidPage(); - if (pageBase == 0) - return EEPROM_NO_VALID_PAGE; // No valid page, return max. numbers + uint8_t DataByte = 0xFF; - *Count = EE_GetVariablesCount(pageBase, 0xFFFF); - return EEPROM_OK; -} + // Get Byte from specified address + DataByte = (*(__IO uint8_t*)(FEE_PAGE_BASE_ADDRESS + FEE_ADDR_OFFSET(Address))); -uint16_t EEPROM_maxcount(void) -{ - return ((PageSize / 4)-1); + return DataByte; } - +/***************************************************************************** +* Wrap library in AVR style functions. +*******************************************************************************/ uint8_t eeprom_read_byte (const uint8_t *Address) { const uint16_t p = (const uint32_t) Address; - uint16_t temp; - EEPROM_read(p, &temp); - return (uint8_t) temp; + return EEPROM_ReadDataByte(p); } void eeprom_write_byte (uint8_t *Address, uint8_t Value) { uint16_t p = (uint32_t) Address; - EEPROM_write(p, (uint16_t) Value); + EEPROM_WriteDataByte(p, Value); } void eeprom_update_byte (uint8_t *Address, uint8_t Value) { uint16_t p = (uint32_t) Address; - EEPROM_update(p, (uint16_t) Value); + EEPROM_WriteDataByte(p, Value); } uint16_t eeprom_read_word (const uint16_t *Address) { const uint16_t p = (const uint32_t) Address; - uint16_t temp; - EEPROM_read(p, &temp); - return temp; + return EEPROM_ReadDataByte(p) | (EEPROM_ReadDataByte(p+1) << 8); } void eeprom_write_word (uint16_t *Address, uint16_t Value) { uint16_t p = (uint32_t) Address; - EEPROM_write(p, Value); + EEPROM_WriteDataByte(p, (uint8_t) Value); + EEPROM_WriteDataByte(p + 1, (uint8_t) (Value >> 8)); } void eeprom_update_word (uint16_t *Address, uint16_t Value) { uint16_t p = (uint32_t) Address; - EEPROM_update(p, Value); + EEPROM_WriteDataByte(p, (uint8_t) Value); + EEPROM_WriteDataByte(p + 1, (uint8_t) (Value >> 8)); } uint32_t eeprom_read_dword (const uint32_t *Address) { const uint16_t p = (const uint32_t) Address; - uint16_t temp1, temp2; - EEPROM_read(p, &temp1); - EEPROM_read(p + 1, &temp2); - return temp1 | (temp2 << 16); + return EEPROM_ReadDataByte(p) | (EEPROM_ReadDataByte(p+1) << 8) + | (EEPROM_ReadDataByte(p+2) << 16) | (EEPROM_ReadDataByte(p+3) << 24); } void eeprom_write_dword (uint32_t *Address, uint32_t Value) { - uint16_t temp = (uint16_t) Value; - uint16_t p = (uint32_t) Address; - EEPROM_write(p, temp); - temp = (uint16_t) (Value >> 16); - EEPROM_write(p + 1, temp); + uint16_t p = (const uint32_t) Address; + EEPROM_WriteDataByte(p, (uint8_t) Value); + EEPROM_WriteDataByte(p+1, (uint8_t) (Value >> 8)); + EEPROM_WriteDataByte(p+2, (uint8_t) (Value >> 16)); + EEPROM_WriteDataByte(p+3, (uint8_t) (Value >> 24)); } void eeprom_update_dword (uint32_t *Address, uint32_t Value) { - uint16_t temp = (uint16_t) Value; - uint16_t p = (uint32_t) Address; - EEPROM_update(p, temp); - temp = (uint16_t) (Value >> 16); - EEPROM_update(p + 1, temp); + uint16_t p = (const uint32_t) Address; + uint32_t existingValue = EEPROM_ReadDataByte(p) | (EEPROM_ReadDataByte(p+1) << 8) + | (EEPROM_ReadDataByte(p+2) << 16) | (EEPROM_ReadDataByte(p+3) << 24); + if(Value != existingValue){ + EEPROM_WriteDataByte(p, (uint8_t) Value); + EEPROM_WriteDataByte(p+1, (uint8_t) (Value >> 8)); + EEPROM_WriteDataByte(p+2, (uint8_t) (Value >> 16)); + EEPROM_WriteDataByte(p+3, (uint8_t) (Value >> 24)); + } +} + +void eeprom_read_block(void *buf, const void *addr, uint32_t len) { + const uint8_t *p = (const uint8_t *)addr; + uint8_t *dest = (uint8_t *)buf; + while (len--) { + *dest++ = eeprom_read_byte(p++); + } +} + +void eeprom_write_block(const void *buf, void *addr, uint32_t len) { + uint8_t *p = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + while (len--) { + eeprom_write_byte(p++, *src++); + } +} + +void eeprom_update_block(const void *buf, void *addr, uint32_t len) { + uint8_t *p = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + while (len--) { + eeprom_write_byte(p++, *src++); + } } diff --git a/tmk_core/common/chibios/eeprom_stm32.h b/tmk_core/common/chibios/eeprom_stm32.h index 09229530ca4..083eb16ee6b 100755 --- a/tmk_core/common/chibios/eeprom_stm32.h +++ b/tmk_core/common/chibios/eeprom_stm32.h @@ -10,15 +10,17 @@ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and - * https://github.com/leaflabs/libmaple + * This files are free to use from http://engsta.com/stm32-flash-memory-eeprom-emulator/ by + * Artur F. * * Modifications for QMK and STM32F303 by Yiancar + * + * This library assumes 8-bit data locations. To add a new MCU, please provide the flash + * page size and the total flash size in Kb. The number of available pages must be a multiple + * of 2. Only half of the pages account for the total EEPROM size. + * This library also assumes that the pages are not used by the firmware. */ -// This file must be modified if the MCU is not defined below. -// This library also assumes that the pages are not used by the firmware. - #ifndef __EEPROM_H #define __EEPROM_H @@ -32,64 +34,50 @@ #define MCU_STM32F303CC #elif defined(EEPROM_EMU_STM32F103xB) #define MCU_STM32F103RB +#elif defined(EEPROM_EMU_STM32F072xB) + #define MCU_STM32F072CB #else #error "not implemented." #endif #ifndef EEPROM_PAGE_SIZE #if defined (MCU_STM32F103RB) - #define EEPROM_PAGE_SIZE (uint16_t)0x400 /* Page size = 1KByte */ - #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) || defined (MCU_STM32F103RD) || defined (MCU_STM32F303CC) - #define EEPROM_PAGE_SIZE (uint16_t)0x800 /* Page size = 2KByte */ + #define FEE_PAGE_SIZE (uint16_t)0x400 // Page size = 1KByte + #define FEE_DENSITY_PAGES 2 // How many pages are used + #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) || defined (MCU_STM32F103RD) || defined (MCU_STM32F303CC) || defined(MCU_STM32F072CB) + #define FEE_PAGE_SIZE (uint16_t)0x800 // Page size = 2KByte + #define FEE_DENSITY_PAGES 4 // How many pages are used #else #error "No MCU type specified. Add something like -DMCU_STM32F103RB to your compiler arguments (probably in a Makefile)." #endif #endif #ifndef EEPROM_START_ADDRESS - #if defined (MCU_STM32F103RB) - #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 128 * 1024 - 2 * EEPROM_PAGE_SIZE)) + #if defined (MCU_STM32F103RB) || defined(MCU_STM32F072CB) + #define FEE_MCU_FLASH_SIZE 128 // Size in Kb #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) - #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 512 * 1024 - 2 * EEPROM_PAGE_SIZE)) + #define FEE_MCU_FLASH_SIZE 512 // Size in Kb #elif defined (MCU_STM32F103RD) - #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 384 * 1024 - 2 * EEPROM_PAGE_SIZE)) + #define FEE_MCU_FLASH_SIZE 384 // Size in Kb #elif defined (MCU_STM32F303CC) - #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE)) + #define FEE_MCU_FLASH_SIZE 256 // Size in Kb #else #error "No MCU type specified. Add something like -DMCU_STM32F103RB to your compiler arguments (probably in a Makefile)." #endif #endif -/* Pages 0 and 1 base and end addresses */ -#define EEPROM_PAGE0_BASE ((uint32_t)(EEPROM_START_ADDRESS + 0x000)) -#define EEPROM_PAGE1_BASE ((uint32_t)(EEPROM_START_ADDRESS + EEPROM_PAGE_SIZE)) - -/* Page status definitions */ -#define EEPROM_ERASED ((uint16_t)0xFFFF) /* PAGE is empty */ -#define EEPROM_RECEIVE_DATA ((uint16_t)0xEEEE) /* PAGE is marked to receive data */ -#define EEPROM_VALID_PAGE ((uint16_t)0x0000) /* PAGE containing valid data */ - -/* Page full define */ -enum uint16_t - { - EEPROM_OK = ((uint16_t)0x0000), - EEPROM_OUT_SIZE = ((uint16_t)0x0081), - EEPROM_BAD_ADDRESS = ((uint16_t)0x0082), - EEPROM_BAD_FLASH = ((uint16_t)0x0083), - EEPROM_NOT_INIT = ((uint16_t)0x0084), - EEPROM_SAME_VALUE = ((uint16_t)0x0085), - EEPROM_NO_VALID_PAGE = ((uint16_t)0x00AB) - }; - -#define EEPROM_DEFAULT_DATA 0xFFFF +// DONT CHANGE +// Choose location for the first EEPROM Page address on the top of flash +#define FEE_PAGE_BASE_ADDRESS ((uint32_t)(0x8000000 + FEE_MCU_FLASH_SIZE * 1024 - FEE_DENSITY_PAGES * FEE_PAGE_SIZE)) +#define FEE_DENSITY_BYTES ((FEE_PAGE_SIZE / 2) * FEE_DENSITY_PAGES - 1) +#define FEE_LAST_PAGE_ADDRESS (FEE_PAGE_BASE_ADDRESS + (FEE_PAGE_SIZE * FEE_DENSITY_PAGES)) +#define FEE_EMPTY_WORD ((uint16_t)0xFFFF) +#define FEE_ADDR_OFFSET(Address)(Address * 2) // 1Byte per Word will be saved to preserve Flash - uint16_t EEPROM_init(void); - uint16_t EEPROM_format(void); - uint16_t EEPROM_erases(uint16_t *); - uint16_t EEPROM_read (uint16_t address, uint16_t *data); - uint16_t EEPROM_write(uint16_t address, uint16_t data); - uint16_t EEPROM_update(uint16_t address, uint16_t data); - uint16_t EEPROM_count(uint16_t *); - uint16_t EEPROM_maxcount(void); +// Use this function to initialize the functionality +uint16_t EEPROM_Init(void); +void EEPROM_Erase (void); +uint16_t EEPROM_WriteDataByte (uint16_t Address, uint8_t DataByte); +uint8_t EEPROM_ReadDataByte (uint16_t Address); #endif /* __EEPROM_H */ diff --git a/tmk_core/common/chibios/flash_stm32.c b/tmk_core/common/chibios/flash_stm32.c index 27359348445..832bf3908fe 100755 --- a/tmk_core/common/chibios/flash_stm32.c +++ b/tmk_core/common/chibios/flash_stm32.c @@ -22,6 +22,9 @@ #elif defined(EEPROM_EMU_STM32F103xB) #define STM32F103xB #include "stm32f1xx.h" +#elif defined(EEPROM_EMU_STM32F072xB) + #define STM32F072xB + #include "stm32f0xx.h" #else #error "not implemented." #endif @@ -186,3 +189,18 @@ void FLASH_Lock(void) /* Set the Lock Bit to lock the FPEC and the FCR */ FLASH->CR |= FLASH_CR_LOCK; } + +/** + * @brief Clears the FLASH's pending flags. + * @param FLASH_FLAG: specifies the FLASH flags to clear. + * This parameter can be any combination of the following values: + * @arg FLASH_FLAG_PGERR: FLASH Programming error flag flag + * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag + * @arg FLASH_FLAG_EOP: FLASH End of Programming flag + * @retval None + */ +void FLASH_ClearFlag(uint32_t FLASH_FLAG) +{ + /* Clear the flags */ + FLASH->SR = FLASH_FLAG; +} diff --git a/tmk_core/common/chibios/flash_stm32.h b/tmk_core/common/chibios/flash_stm32.h index cc065cbca26..3c99cc566a0 100755 --- a/tmk_core/common/chibios/flash_stm32.h +++ b/tmk_core/common/chibios/flash_stm32.h @@ -45,6 +45,7 @@ FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data); void FLASH_Unlock(void); void FLASH_Lock(void); +void FLASH_ClearFlag(uint32_t FLASH_FLAG); #ifdef __cplusplus } diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index 4a119ccefee..6027d69b78e 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c @@ -82,7 +82,7 @@ void suspend_wakeup_init_user(void) { } */ __attribute__ ((weak)) void suspend_wakeup_init_kb(void) { - suspend_power_down_user(); + suspend_wakeup_init_user(); } /** \brief suspend wakeup condition diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index f79d5a257b9..d3884d9fa97 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -151,17 +151,17 @@ static void command_common_help(void) "0-9: Switch to Layer 0-9\n" #endif - STR(MAGIC_KEY_LAYER0_ALT1 ) ": Switch to Layer 0 (alternate key 1)\n" - STR(MAGIC_KEY_LAYER0_ALT2 ) ": Switch to Layer 0 (alternate key 2)\n" - STR(MAGIC_KEY_BOOTLOADER ) ": Jump to Bootloader (Reset)\n" + STR(MAGIC_KEY_LAYER0_ALT ) ": Switch to Layer 0 (alternate)\n" + + STR(MAGIC_KEY_BOOTLOADER ) ": Jump to Bootloader\n" + STR(MAGIC_KEY_BOOTLOADER_ALT) ": Jump to Bootloader (alternate)\n" #ifdef KEYBOARD_LOCK_ENABLE - STR(MAGIC_KEY_LOCK ) ": Lock\n" + STR(MAGIC_KEY_LOCK ) ": Lock Keyboard\n" #endif -#ifdef BOOTMAGIC_ENABLE STR(MAGIC_KEY_EEPROM ) ": Print EEPROM Settings\n" -#endif + STR(MAGIC_KEY_EEPROM_CLEAR) ": Clear EEPROM\n" #ifdef NKRO_ENABLE STR(MAGIC_KEY_NKRO ) ": NKRO Toggle\n" @@ -181,7 +181,11 @@ static void print_version(void) print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " "VER: " STR(DEVICE_VER) "\n"); +#ifdef SKIP_VERSION + print("BUILD: (" __DATE__ ")\n"); +#else print("BUILD: " STR(QMK_VERSION) " (" __TIME__ " " __DATE__ ")\n"); +#endif /* build options */ print("OPTIONS:" @@ -261,7 +265,6 @@ static void print_status(void) return; } -#ifdef BOOTMAGIC_ENABLE static void print_eeconfig(void) { @@ -301,7 +304,6 @@ static void print_eeconfig(void) #endif /* !NO_PRINT */ } -#endif /* BOOTMAGIC_ENABLE */ static bool command_common(uint8_t code) { @@ -322,14 +324,17 @@ static bool command_common(uint8_t code) break; #endif -#ifdef BOOTMAGIC_ENABLE - // print stored eeprom config case MAGIC_KC(MAGIC_KEY_EEPROM): print("eeconfig:\n"); print_eeconfig(); break; -#endif + + // clear eeprom + case MAGIC_KC(MAGIC_KEY_EEPROM_CLEAR): + print("Clearing EEPROM\n"); + eeconfig_init(); + break; #ifdef KEYBOARD_LOCK_ENABLE @@ -348,8 +353,8 @@ static bool command_common(uint8_t code) #endif // print help - case MAGIC_KC(MAGIC_KEY_HELP1): - case MAGIC_KC(MAGIC_KEY_HELP2): + case MAGIC_KC(MAGIC_KEY_HELP): + case MAGIC_KC(MAGIC_KEY_HELP_ALT): command_common_help(); break; @@ -366,6 +371,7 @@ static bool command_common(uint8_t code) // jump to bootloader case MAGIC_KC(MAGIC_KEY_BOOTLOADER): + case MAGIC_KC(MAGIC_KEY_BOOTLOADER_ALT): clear_keyboard(); // clear to prevent stuck keys print("\n\nJumping to bootloader... "); #ifdef AUDIO_ENABLE @@ -449,8 +455,7 @@ static bool command_common(uint8_t code) // switch layers - case MAGIC_KC(MAGIC_KEY_LAYER0_ALT1): - case MAGIC_KC(MAGIC_KEY_LAYER0_ALT2): + case MAGIC_KC(MAGIC_KEY_LAYER0_ALT): switch_default_layer(0); break; diff --git a/tmk_core/common/command.h b/tmk_core/common/command.h index d9d89ba0f1e..e6e67fae4ad 100644 --- a/tmk_core/common/command.h +++ b/tmk_core/common/command.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef COMMAND_H -#define COMMAND +#pragma once /* FIXME: Add doxygen comments for the behavioral defines in here. */ @@ -35,6 +34,9 @@ bool command_proc(uint8_t code); #define command_proc(code) false #endif +#ifndef IS_COMMAND +#define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) +#endif #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS #define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true @@ -48,12 +50,12 @@ bool command_proc(uint8_t code); #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false #endif -#ifndef MAGIC_KEY_HELP1 -#define MAGIC_KEY_HELP1 H +#ifndef MAGIC_KEY_HELP +#define MAGIC_KEY_HELP H #endif -#ifndef MAGIC_KEY_HELP2 -#define MAGIC_KEY_HELP2 SLASH +#ifndef MAGIC_KEY_HELP_ALT +#define MAGIC_KEY_HELP_ALT SLASH #endif #ifndef MAGIC_KEY_DEBUG @@ -84,18 +86,14 @@ bool command_proc(uint8_t code); #define MAGIC_KEY_CONSOLE C #endif -#ifndef MAGIC_KEY_LAYER0_ALT1 -#define MAGIC_KEY_LAYER0_ALT1 ESC -#endif - -#ifndef MAGIC_KEY_LAYER0_ALT2 -#define MAGIC_KEY_LAYER0_ALT2 GRAVE -#endif - #ifndef MAGIC_KEY_LAYER0 #define MAGIC_KEY_LAYER0 0 #endif +#ifndef MAGIC_KEY_LAYER0_ALT +#define MAGIC_KEY_LAYER0_ALT GRAVE +#endif + #ifndef MAGIC_KEY_LAYER1 #define MAGIC_KEY_LAYER1 1 #endif @@ -133,7 +131,11 @@ bool command_proc(uint8_t code); #endif #ifndef MAGIC_KEY_BOOTLOADER -#define MAGIC_KEY_BOOTLOADER PAUSE +#define MAGIC_KEY_BOOTLOADER B +#endif + +#ifndef MAGIC_KEY_BOOTLOADER_ALT +#define MAGIC_KEY_BOOTLOADER_ALT ESC #endif #ifndef MAGIC_KEY_LOCK @@ -144,6 +146,10 @@ bool command_proc(uint8_t code); #define MAGIC_KEY_EEPROM E #endif +#ifndef MAGIC_KEY_EEPROM_CLEAR +#define MAGIC_KEY_EEPROM_CLEAR BSPACE +#endif + #ifndef MAGIC_KEY_NKRO #define MAGIC_KEY_NKRO N #endif @@ -153,7 +159,5 @@ bool command_proc(uint8_t code); #endif -#define XMAGIC_KC(key) KC_##key -#define MAGIC_KC(key) XMAGIC_KC(key) - -#endif +#define XMAGIC_KC(key) KC_ ## key +#define MAGIC_KC(key) XMAGIC_KC(key) diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c index d8bab7d2e52..4f440abc9c2 100644 --- a/tmk_core/common/eeconfig.c +++ b/tmk_core/common/eeconfig.c @@ -33,7 +33,7 @@ void eeconfig_init_kb(void) { */ void eeconfig_init_quantum(void) { #ifdef STM32_EEPROM_ENABLE - EEPROM_format(); + EEPROM_Erase(); #endif eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); eeprom_update_byte(EECONFIG_DEBUG, 0); @@ -45,6 +45,10 @@ void eeconfig_init_quantum(void) { eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default eeprom_update_dword(EECONFIG_RGBLIGHT, 0); eeprom_update_byte(EECONFIG_STENOMODE, 0); + eeprom_update_dword(EECONFIG_HAPTIC, 0); + eeprom_update_byte(EECONFIG_VELOCIKEY, 0); + eeprom_update_dword(EECONFIG_RGB_MATRIX, 0); + eeprom_update_byte(EECONFIG_RGB_MATRIX_SPEED, 0); eeconfig_init_kb(); } @@ -74,7 +78,7 @@ void eeconfig_enable(void) void eeconfig_disable(void) { #ifdef STM32_EEPROM_ENABLE - EEPROM_format(); + EEPROM_Erase(); #endif eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER_OFF); } @@ -177,3 +181,9 @@ uint32_t eeconfig_read_user(void) { return eeprom_read_dword(EECONFIG_USER) void eeconfig_update_user(uint32_t val) { eeprom_update_dword(EECONFIG_USER, val); } +uint32_t eeconfig_read_haptic(void) { return eeprom_read_dword(EECONFIG_HAPTIC); } +/** \brief eeconfig update user + * + * FIXME: needs doc + */ +void eeconfig_update_haptic(uint32_t val) { eeprom_update_dword(EECONFIG_HAPTIC, val); } diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index 8d4e1d4d008..3100041b4e9 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -25,8 +25,7 @@ along with this program. If not, see . #define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEED #define EECONFIG_MAGIC_NUMBER_OFF (uint16_t)0xFFFF -/* eeprom parameteter address */ -#if !defined(STM32_EEPROM_ENABLE) +/* EEPROM parameter address */ #define EECONFIG_MAGIC (uint16_t *)0 #define EECONFIG_DEBUG (uint8_t *)2 #define EECONFIG_DEFAULT_LAYER (uint8_t *)3 @@ -38,27 +37,14 @@ along with this program. If not, see . #define EECONFIG_UNICODEMODE (uint8_t *)12 #define EECONFIG_STENOMODE (uint8_t *)13 // EEHANDS for two handed boards -#define EECONFIG_HANDEDNESS (uint8_t *)14 +#define EECONFIG_HANDEDNESS (uint8_t *)14 #define EECONFIG_KEYBOARD (uint32_t *)15 #define EECONFIG_USER (uint32_t *)19 +#define EECONFIG_VELOCIKEY (uint8_t *)23 -#else -/* STM32F3 uses 16byte block. Reconfigure memory map */ -#define EECONFIG_MAGIC (uint16_t *)0 -#define EECONFIG_DEBUG (uint8_t *)1 -#define EECONFIG_DEFAULT_LAYER (uint8_t *)2 -#define EECONFIG_KEYMAP (uint8_t *)3 -#define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)4 -#define EECONFIG_BACKLIGHT (uint8_t *)5 -#define EECONFIG_AUDIO (uint8_t *)6 -#define EECONFIG_RGBLIGHT (uint32_t *)7 -#define EECONFIG_UNICODEMODE (uint8_t *)9 -#define EECONFIG_STENOMODE (uint8_t *)10 -// EEHANDS for two handed boards -#define EECONFIG_HANDEDNESS (uint8_t *)11 -#define EECONFIG_KEYBOARD (uint32_t *)12 -#define EECONFIG_USER (uint32_t *)14 -#endif +#define EECONFIG_HAPTIC (uint32_t *)24 +#define EECONFIG_RGB_MATRIX (uint32_t *)28 +#define EECONFIG_RGB_MATRIX_SPEED (uint8_t *)32 /* debug bit */ #define EECONFIG_DEBUG_ENABLE (1<<0) @@ -113,4 +99,9 @@ void eeconfig_update_kb(uint32_t val); uint32_t eeconfig_read_user(void); void eeconfig_update_user(uint32_t val); +#ifdef HAPTIC_ENABLE +uint32_t eeconfig_read_haptic(void); +void eeconfig_update_haptic(uint32_t val); +#endif + #endif diff --git a/tmk_core/common/eeprom.h b/tmk_core/common/eeprom.h index 3696d0df3f8..5ae0f6eebd9 100644 --- a/tmk_core/common/eeprom.h +++ b/tmk_core/common/eeprom.h @@ -20,5 +20,4 @@ void eeprom_update_dword (uint32_t *__p, uint32_t __value); void eeprom_update_block (const void *__src, void *__dst, uint32_t __n); #endif - #endif /* TMK_CORE_COMMON_EEPROM_H_ */ diff --git a/tmk_core/common/host.c b/tmk_core/common/host.c index e12b6221656..f5d0416996b 100644 --- a/tmk_core/common/host.c +++ b/tmk_core/common/host.c @@ -22,6 +22,11 @@ along with this program. If not, see . #include "util.h" #include "debug.h" +#ifdef NKRO_ENABLE + #include "keycode_config.h" + extern keymap_config_t keymap_config; +#endif + static host_driver_t *driver; static uint16_t last_system_report = 0; static uint16_t last_consumer_report = 0; @@ -46,6 +51,20 @@ uint8_t host_keyboard_leds(void) void host_keyboard_send(report_keyboard_t *report) { if (!driver) return; +#if defined(NKRO_ENABLE) && defined(NKRO_SHARED_EP) + if (keyboard_protocol && keymap_config.nkro) { + /* The callers of this function assume that report->mods is where mods go in. + * But report->nkro.mods can be at a different offset if core keyboard does not have a report ID. + */ + report->nkro.mods = report->mods; + report->nkro.report_id = REPORT_ID_NKRO; + } else +#endif + { +#ifdef KEYBOARD_SHARED_EP + report->report_id = REPORT_ID_KEYBOARD; +#endif + } (*driver->send_keyboard)(report); if (debug_keyboard) { @@ -60,6 +79,9 @@ void host_keyboard_send(report_keyboard_t *report) void host_mouse_send(report_mouse_t *report) { if (!driver) return; +#ifdef MOUSE_SHARED_EP + report->report_id = REPORT_ID_MOUSE; +#endif (*driver->send_mouse)(report); } diff --git a/tmk_core/common/host.h b/tmk_core/common/host.h index aeabba71071..3d172eed66d 100644 --- a/tmk_core/common/host.h +++ b/tmk_core/common/host.h @@ -15,14 +15,18 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef HOST_H -#define HOST_H +#pragma once #include #include #include "report.h" #include "host_driver.h" +#define IS_LED_ON(leds, led_name) ( (leds) & (1 << (led_name))) +#define IS_LED_OFF(leds, led_name) (~(leds) & (1 << (led_name))) + +#define IS_HOST_LED_ON(led_name) IS_LED_ON(host_keyboard_leds(), led_name) +#define IS_HOST_LED_OFF(led_name) IS_LED_OFF(host_keyboard_leds(), led_name) #ifdef __cplusplus extern "C" { @@ -31,7 +35,6 @@ extern "C" { extern uint8_t keyboard_idle; extern uint8_t keyboard_protocol; - /* host driver */ void host_set_driver(host_driver_t *driver); host_driver_t *host_get_driver(void); @@ -49,5 +52,3 @@ uint16_t host_last_consumer_report(void); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 13b3cb4c0c1..85d25254808 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -72,6 +72,15 @@ along with this program. If not, see . #ifdef HD44780_ENABLE # include "hd44780.h" #endif +#ifdef QWIIC_ENABLE +# include "qwiic.h" +#endif +#ifdef OLED_DRIVER_ENABLE + #include "oled_driver.h" +#endif +#ifdef VELOCIKEY_ENABLE + #include "velocikey.h" +#endif #ifdef MATRIX_HAS_GHOST extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; @@ -120,6 +129,14 @@ static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata) #endif +void disable_jtag(void) { +// To use PORTF disable JTAG with writing JTD bit twice within four cycles. +#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__)) + MCUCR |= _BV(JTD); + MCUCR |= _BV(JTD); +#endif +} + /** \brief matrix_setup * * FIXME: needs doc @@ -128,12 +145,48 @@ __attribute__ ((weak)) void matrix_setup(void) { } +/** \brief keyboard_pre_init_user + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void keyboard_pre_init_user(void) { } + +/** \brief keyboard_pre_init_kb + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void keyboard_pre_init_kb(void) { + keyboard_pre_init_user(); +} + +/** \brief keyboard_post_init_user + * + * FIXME: needs doc + */ + +__attribute__ ((weak)) +void keyboard_post_init_user() {} + +/** \brief keyboard_post_init_kb + * + * FIXME: needs doc + */ + +__attribute__ ((weak)) +void keyboard_post_init_kb(void) { + keyboard_post_init_user(); +} + /** \brief keyboard_setup * * FIXME: needs doc */ void keyboard_setup(void) { + disable_jtag(); matrix_setup(); + keyboard_pre_init_kb(); } /** \brief is_keyboard_master @@ -151,12 +204,13 @@ bool is_keyboard_master(void) { */ void keyboard_init(void) { timer_init(); -// To use PORTF disable JTAG with writing JTD bit twice within four cycles. -#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__)) - MCUCR |= _BV(JTD); - MCUCR |= _BV(JTD); -#endif matrix_init(); +#ifdef QWIIC_ENABLE + qwiic_init(); +#endif +#ifdef OLED_DRIVER_ENABLE + oled_init(OLED_ROTATION_0); +#endif #ifdef PS2_MOUSE_ENABLE ps2_mouse_init(); #endif @@ -189,6 +243,7 @@ void keyboard_init(void) { #if defined(NKRO_ENABLE) && defined(FORCE_NKRO) keymap_config.nkro = 1; #endif + keyboard_post_init_kb(); /* Always keep this last */ } /** \brief Keyboard task: Do keyboard routine jobs @@ -206,9 +261,6 @@ void keyboard_init(void) { void keyboard_task(void) { static matrix_row_t matrix_prev[MATRIX_ROWS]; -#ifdef MATRIX_HAS_GHOST - // static matrix_row_t matrix_ghost[MATRIX_ROWS]; -#endif static uint8_t led_status = 0; matrix_row_t matrix_row = 0; matrix_row_t matrix_change = 0; @@ -216,25 +268,19 @@ void keyboard_task(void) uint8_t keys_processed = 0; #endif +#if defined(OLED_DRIVER_ENABLE) && !defined(OLED_DISABLE_TIMEOUT) + uint8_t ret = matrix_scan(); +#else matrix_scan(); +#endif + if (is_keyboard_master()) { for (uint8_t r = 0; r < MATRIX_ROWS; r++) { matrix_row = matrix_get_row(r); matrix_change = matrix_row ^ matrix_prev[r]; if (matrix_change) { #ifdef MATRIX_HAS_GHOST - if (has_ghost_in_row(r, matrix_row)) { - /* Keep track of whether ghosted status has changed for - * debugging. But don't update matrix_prev until un-ghosted, or - * the last key would be lost. - */ - //if (debug_matrix && matrix_ghost[r] != matrix_row) { - // matrix_print(); - //} - //matrix_ghost[r] = matrix_row; - continue; - } - //matrix_ghost[r] = matrix_row; + if (has_ghost_in_row(r, matrix_row)) { continue; } #endif if (debug_matrix) matrix_print(); for (uint8_t c = 0; c < MATRIX_COLS; c++) { @@ -266,6 +312,19 @@ void keyboard_task(void) MATRIX_LOOP_END: +#ifdef QWIIC_ENABLE + qwiic_task(); +#endif + +#ifdef OLED_DRIVER_ENABLE + oled_task(); +#ifndef OLED_DISABLE_TIMEOUT + // Wake up oled if user is using those fabulous keys! + if (ret) + oled_on(); +#endif +#endif + #ifdef MOUSEKEY_ENABLE // mousekey repeat & acceleration mousekey_task(); @@ -299,6 +358,10 @@ MATRIX_LOOP_END: midi_task(); #endif +#ifdef VELOCIKEY_ENABLE + if (velocikey_enabled()) { velocikey_decelerate(); } +#endif + // update LED if (led_status != host_keyboard_leds()) { led_status = host_keyboard_leds(); diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h index f17003c2ff9..bf8b71fb78f 100644 --- a/tmk_core/common/keyboard.h +++ b/tmk_core/common/keyboard.h @@ -57,6 +57,8 @@ static inline bool IS_RELEASED(keyevent_t event) { return (!IS_NOEVENT(event) && .time = (timer_read() | 1) \ } +void disable_jtag(void); + /* it runs once at early stage of startup before keyboard_init. */ void keyboard_setup(void); /* it runs once after initializing host side protocol, debug and MCU peripherals. */ @@ -65,6 +67,13 @@ void keyboard_init(void); void keyboard_task(void); /* it runs when host LED status is updated */ void keyboard_set_leds(uint8_t leds); +/* it runs whenever code has to behave differently on a slave */ +bool is_keyboard_master(void); + +void keyboard_pre_init_kb(void); +void keyboard_pre_init_user(void); +void keyboard_post_init_kb(void); +void keyboard_post_init_user(void); #ifdef __cplusplus } diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index 61642ae84fb..d5904276eeb 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -33,7 +33,7 @@ along with this program. If not, see . #define IS_SPECIAL(code) ((0xA5 <= (code) && (code) <= 0xDF) || (0xE8 <= (code) && (code) <= 0xFF)) #define IS_SYSTEM(code) (KC_PWR <= (code) && (code) <= KC_WAKE) -#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_MRWD) +#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_BRID) #define IS_FN(code) (KC_FN0 <= (code) && (code) <= KC_FN31) @@ -46,6 +46,22 @@ along with this program. If not, see . #define MOD_BIT(code) (1 << MOD_INDEX(code)) #define MOD_INDEX(code) ((code) & 0x07) +#define MOD_MASK_CTRL (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RCTRL)) +#define MOD_MASK_SHIFT (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) +#define MOD_MASK_ALT (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) +#define MOD_MASK_GUI (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) +#define MOD_MASK_CS (MOD_MASK_CTRL | MOD_MASK_SHIFT) +#define MOD_MASK_CA (MOD_MASK_CTRL | MOD_MASK_ALT) +#define MOD_MASK_CG (MOD_MASK_CTRL | MOD_MASK_GUI) +#define MOD_MASK_SA (MOD_MASK_SHIFT | MOD_MASK_ALT) +#define MOD_MASK_SG (MOD_MASK_SHIFT | MOD_MASK_GUI) +#define MOD_MASK_AG (MOD_MASK_ALT | MOD_MASK_GUI) +#define MOD_MASK_CSA (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_ALT) +#define MOD_MASK_CSG (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_GUI) +#define MOD_MASK_CAG (MOD_MASK_CTRL | MOD_MASK_ALT | MOD_MASK_GUI) +#define MOD_MASK_SAG (MOD_MASK_SHIFT | MOD_MASK_ALT | MOD_MASK_GUI) +#define MOD_MASK_CSAG (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_ALT | MOD_MASK_GUI) + #define FN_BIT(code) (1 << FN_INDEX(code)) #define FN_INDEX(code) ((code) - KC_FN0) #define FN_MIN KC_FN0 @@ -140,6 +156,7 @@ along with this program. If not, see . #define KC_LWIN KC_LGUI #define KC_RCTL KC_RCTRL #define KC_RSFT KC_RSHIFT +#define KC_ALGR KC_RALT #define KC_RCMD KC_RGUI #define KC_RWIN KC_RGUI @@ -170,6 +187,12 @@ along with this program. If not, see . #define KC_WFAV KC_WWW_FAVORITES #define KC_MFFD KC_MEDIA_FAST_FORWARD #define KC_MRWD KC_MEDIA_REWIND +#define KC_BRIU KC_BRIGHTNESS_UP +#define KC_BRID KC_BRIGHTNESS_DOWN + +/* System Specific */ +#define KC_BRMU KC_PAUSE +#define KC_BRMD KC_SCROLLLOCK /* Mouse Keys */ #define KC_MS_U KC_MS_UP @@ -457,6 +480,8 @@ enum internal_special_keycodes { KC_WWW_FAVORITES, KC_MEDIA_FAST_FORWARD, KC_MEDIA_REWIND, + KC_BRIGHTNESS_UP, + KC_BRIGHTNESS_DOWN, /* Fn keys */ KC_FN0 = 0xC0, diff --git a/tmk_core/common/magic.c b/tmk_core/common/magic.c index 714acc0f544..2b1a6a6ad25 100644 --- a/tmk_core/common/magic.c +++ b/tmk_core/common/magic.c @@ -33,6 +33,6 @@ void magic(void) uint8_t default_layer = 0; default_layer = eeconfig_read_default_layer(); - default_layer_set((uint32_t)default_layer); + default_layer_set((layer_state_t)default_layer); } diff --git a/tmk_core/common/mousekey.c b/tmk_core/common/mousekey.c index 581e7b8a072..bb08576b9fa 100644 --- a/tmk_core/common/mousekey.c +++ b/tmk_core/common/mousekey.c @@ -23,13 +23,24 @@ along with this program. If not, see . #include "debug.h" #include "mousekey.h" +inline int8_t times_inv_sqrt2(int8_t x) { + // 181/256 is pretty close to 1/sqrt(2) + // 0.70703125 0.707106781 + // 1 too small for x=99 and x=198 + // This ends up being a mult and discard lower 8 bits + return (x * 181) >> 8; +} - -static report_mouse_t mouse_report = {}; -static uint8_t mousekey_repeat = 0; +static report_mouse_t mouse_report = {0}; +static void mousekey_debug(void); static uint8_t mousekey_accel = 0; +static uint8_t mousekey_repeat = 0; +static uint16_t last_timer = 0; + + + +#ifndef MK_3_SPEED -static void mousekey_debug(void); /* @@ -52,155 +63,263 @@ uint8_t mk_time_to_max = MOUSEKEY_TIME_TO_MAX; uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED; uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX; +static uint8_t move_unit(void) { + uint16_t unit; + if (mousekey_accel & (1<<0)) { + unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed)/4; + } else if (mousekey_accel & (1<<1)) { + unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed)/2; + } else if (mousekey_accel & (1<<2)) { + unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed); + } else if (mousekey_repeat == 0) { + unit = MOUSEKEY_MOVE_DELTA; + } else if (mousekey_repeat >= mk_time_to_max) { + unit = MOUSEKEY_MOVE_DELTA * mk_max_speed; + } else { + unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed * mousekey_repeat) / mk_time_to_max; + } + return (unit > MOUSEKEY_MOVE_MAX ? MOUSEKEY_MOVE_MAX : (unit == 0 ? 1 : unit)); +} -static uint16_t last_timer = 0; +static uint8_t wheel_unit(void) { + uint16_t unit; + if (mousekey_accel & (1<<0)) { + unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed)/4; + } else if (mousekey_accel & (1<<1)) { + unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed)/2; + } else if (mousekey_accel & (1<<2)) { + unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed); + } else if (mousekey_repeat == 0) { + unit = MOUSEKEY_WHEEL_DELTA; + } else if (mousekey_repeat >= mk_wheel_time_to_max) { + unit = MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed; + } else { + unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed * mousekey_repeat) / mk_wheel_time_to_max; + } + return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit)); +} -inline int8_t times_inv_sqrt2(int8_t x) -{ - // 181/256 is pretty close to 1/sqrt(2) - // 0.70703125 0.707106781 - // 1 too small for x=99 and x=198 - // This ends up being a mult and discard lower 8 bits - return (x * 181) >> 8; +void mousekey_task(void) { + if (timer_elapsed(last_timer) < (mousekey_repeat ? mk_interval : mk_delay*10)) { + return; + } + if (mouse_report.x == 0 && mouse_report.y == 0 && mouse_report.v == 0 && mouse_report.h == 0) { + return; + } + if (mousekey_repeat != UINT8_MAX) mousekey_repeat++; + if (mouse_report.x > 0) mouse_report.x = move_unit(); + if (mouse_report.x < 0) mouse_report.x = move_unit() * -1; + if (mouse_report.y > 0) mouse_report.y = move_unit(); + if (mouse_report.y < 0) mouse_report.y = move_unit() * -1; + /* diagonal move [1/sqrt(2)] */ + if (mouse_report.x && mouse_report.y) { + mouse_report.x = times_inv_sqrt2(mouse_report.x); + if (mouse_report.x == 0) { mouse_report.x = 1; } + mouse_report.y = times_inv_sqrt2(mouse_report.y); + if (mouse_report.y == 0) { mouse_report.y = 1; } + } + if (mouse_report.v > 0) mouse_report.v = wheel_unit(); + if (mouse_report.v < 0) mouse_report.v = wheel_unit() * -1; + if (mouse_report.h > 0) mouse_report.h = wheel_unit(); + if (mouse_report.h < 0) mouse_report.h = wheel_unit() * -1; + mousekey_send(); } -static uint8_t move_unit(void) -{ - uint16_t unit; - if (mousekey_accel & (1<<0)) { - unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed)/4; - } else if (mousekey_accel & (1<<1)) { - unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed)/2; - } else if (mousekey_accel & (1<<2)) { - unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed); - } else if (mousekey_repeat == 0) { - unit = MOUSEKEY_MOVE_DELTA; - } else if (mousekey_repeat >= mk_time_to_max) { - unit = MOUSEKEY_MOVE_DELTA * mk_max_speed; - } else { - unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed * mousekey_repeat) / mk_time_to_max; - } - return (unit > MOUSEKEY_MOVE_MAX ? MOUSEKEY_MOVE_MAX : (unit == 0 ? 1 : unit)); +void mousekey_on(uint8_t code) { + if (code == KC_MS_UP) mouse_report.y = move_unit() * -1; + else if (code == KC_MS_DOWN) mouse_report.y = move_unit(); + else if (code == KC_MS_LEFT) mouse_report.x = move_unit() * -1; + else if (code == KC_MS_RIGHT) mouse_report.x = move_unit(); + else if (code == KC_MS_WH_UP) mouse_report.v = wheel_unit(); + else if (code == KC_MS_WH_DOWN) mouse_report.v = wheel_unit() * -1; + else if (code == KC_MS_WH_LEFT) mouse_report.h = wheel_unit() * -1; + else if (code == KC_MS_WH_RIGHT) mouse_report.h = wheel_unit(); + else if (code == KC_MS_BTN1) mouse_report.buttons |= MOUSE_BTN1; + else if (code == KC_MS_BTN2) mouse_report.buttons |= MOUSE_BTN2; + else if (code == KC_MS_BTN3) mouse_report.buttons |= MOUSE_BTN3; + else if (code == KC_MS_BTN4) mouse_report.buttons |= MOUSE_BTN4; + else if (code == KC_MS_BTN5) mouse_report.buttons |= MOUSE_BTN5; + else if (code == KC_MS_ACCEL0) mousekey_accel |= (1<<0); + else if (code == KC_MS_ACCEL1) mousekey_accel |= (1<<1); + else if (code == KC_MS_ACCEL2) mousekey_accel |= (1<<2); } -static uint8_t wheel_unit(void) -{ - uint16_t unit; - if (mousekey_accel & (1<<0)) { - unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed)/4; - } else if (mousekey_accel & (1<<1)) { - unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed)/2; - } else if (mousekey_accel & (1<<2)) { - unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed); - } else if (mousekey_repeat == 0) { - unit = MOUSEKEY_WHEEL_DELTA; - } else if (mousekey_repeat >= mk_wheel_time_to_max) { - unit = MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed; - } else { - unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed * mousekey_repeat) / mk_wheel_time_to_max; - } - return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit)); +void mousekey_off(uint8_t code) { + if (code == KC_MS_UP && mouse_report.y < 0) mouse_report.y = 0; + else if (code == KC_MS_DOWN && mouse_report.y > 0) mouse_report.y = 0; + else if (code == KC_MS_LEFT && mouse_report.x < 0) mouse_report.x = 0; + else if (code == KC_MS_RIGHT && mouse_report.x > 0) mouse_report.x = 0; + else if (code == KC_MS_WH_UP && mouse_report.v > 0) mouse_report.v = 0; + else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) mouse_report.v = 0; + else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) mouse_report.h = 0; + else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) mouse_report.h = 0; + else if (code == KC_MS_BTN1) mouse_report.buttons &= ~MOUSE_BTN1; + else if (code == KC_MS_BTN2) mouse_report.buttons &= ~MOUSE_BTN2; + else if (code == KC_MS_BTN3) mouse_report.buttons &= ~MOUSE_BTN3; + else if (code == KC_MS_BTN4) mouse_report.buttons &= ~MOUSE_BTN4; + else if (code == KC_MS_BTN5) mouse_report.buttons &= ~MOUSE_BTN5; + else if (code == KC_MS_ACCEL0) mousekey_accel &= ~(1<<0); + else if (code == KC_MS_ACCEL1) mousekey_accel &= ~(1<<1); + else if (code == KC_MS_ACCEL2) mousekey_accel &= ~(1<<2); + if (mouse_report.x == 0 && mouse_report.y == 0 && mouse_report.v == 0 && mouse_report.h == 0) + mousekey_repeat = 0; } -void mousekey_task(void) -{ - if (timer_elapsed(last_timer) < (mousekey_repeat ? mk_interval : mk_delay*10)) - return; - if (mouse_report.x == 0 && mouse_report.y == 0 && mouse_report.v == 0 && mouse_report.h == 0) - return; - if (mousekey_repeat != UINT8_MAX) - mousekey_repeat++; + +#else /* #ifndef MK_3_SPEED */ - if (mouse_report.x > 0) mouse_report.x = move_unit(); - if (mouse_report.x < 0) mouse_report.x = move_unit() * -1; - if (mouse_report.y > 0) mouse_report.y = move_unit(); - if (mouse_report.y < 0) mouse_report.y = move_unit() * -1; - /* diagonal move [1/sqrt(2)] */ - if (mouse_report.x && mouse_report.y) { - mouse_report.x = times_inv_sqrt2(mouse_report.x); - mouse_report.x = mouse_report.x == 0 ? 1 : mouse_report.x; - mouse_report.y = times_inv_sqrt2(mouse_report.y); - mouse_report.y = mouse_report.y == 0 ? 1 : mouse_report.y; - } +enum { + mkspd_unmod, + mkspd_0, + mkspd_1, + mkspd_2, + mkspd_COUNT +}; +#ifndef MK_MOMENTARY_ACCEL +static uint8_t mk_speed = mkspd_1; +#else +static uint8_t mk_speed = mkspd_unmod; +static uint8_t mkspd_DEFAULT = mkspd_unmod; +#endif +static uint16_t last_timer_c = 0; +static uint16_t last_timer_w = 0; +uint16_t c_offsets[mkspd_COUNT] = { + MK_C_OFFSET_UNMOD, MK_C_OFFSET_0, MK_C_OFFSET_1, MK_C_OFFSET_2 +}; +uint16_t c_intervals[mkspd_COUNT] = { + MK_C_INTERVAL_UNMOD, MK_C_INTERVAL_0, MK_C_INTERVAL_1, MK_C_INTERVAL_2 +}; +uint16_t w_offsets[mkspd_COUNT] = { + MK_W_OFFSET_UNMOD, MK_W_OFFSET_0, MK_W_OFFSET_1, MK_W_OFFSET_2 +}; +uint16_t w_intervals[mkspd_COUNT] = { + MK_W_INTERVAL_UNMOD, MK_W_INTERVAL_0, MK_W_INTERVAL_1, MK_W_INTERVAL_2 +}; - if (mouse_report.v > 0) mouse_report.v = wheel_unit(); - if (mouse_report.v < 0) mouse_report.v = wheel_unit() * -1; - if (mouse_report.h > 0) mouse_report.h = wheel_unit(); - if (mouse_report.h < 0) mouse_report.h = wheel_unit() * -1; - mousekey_send(); +void mousekey_task(void) { + // report cursor and scroll movement independently + report_mouse_t const tmpmr = mouse_report; + if ((mouse_report.x || mouse_report.y) && timer_elapsed(last_timer_c) > c_intervals[mk_speed]) { + mouse_report.h = 0; + mouse_report.v = 0; + mousekey_send(); + last_timer_c = last_timer; + mouse_report = tmpmr; + } + if ((mouse_report.h || mouse_report.v) && timer_elapsed(last_timer_w) > w_intervals[mk_speed]) { + mouse_report.x = 0; + mouse_report.y = 0; + mousekey_send(); + last_timer_w = last_timer; + mouse_report = tmpmr; + } } -void mousekey_on(uint8_t code) -{ - if (code == KC_MS_UP) mouse_report.y = move_unit() * -1; - else if (code == KC_MS_DOWN) mouse_report.y = move_unit(); - else if (code == KC_MS_LEFT) mouse_report.x = move_unit() * -1; - else if (code == KC_MS_RIGHT) mouse_report.x = move_unit(); - else if (code == KC_MS_WH_UP) mouse_report.v = wheel_unit(); - else if (code == KC_MS_WH_DOWN) mouse_report.v = wheel_unit() * -1; - else if (code == KC_MS_WH_LEFT) mouse_report.h = wheel_unit() * -1; - else if (code == KC_MS_WH_RIGHT) mouse_report.h = wheel_unit(); - else if (code == KC_MS_BTN1) mouse_report.buttons |= MOUSE_BTN1; - else if (code == KC_MS_BTN2) mouse_report.buttons |= MOUSE_BTN2; - else if (code == KC_MS_BTN3) mouse_report.buttons |= MOUSE_BTN3; - else if (code == KC_MS_BTN4) mouse_report.buttons |= MOUSE_BTN4; - else if (code == KC_MS_BTN5) mouse_report.buttons |= MOUSE_BTN5; - else if (code == KC_MS_ACCEL0) mousekey_accel |= (1<<0); - else if (code == KC_MS_ACCEL1) mousekey_accel |= (1<<1); - else if (code == KC_MS_ACCEL2) mousekey_accel |= (1<<2); +void adjust_speed(void) { + uint16_t const c_offset = c_offsets[mk_speed]; + uint16_t const w_offset = w_offsets[mk_speed]; + if (mouse_report.x > 0) mouse_report.x = c_offset; + if (mouse_report.x < 0) mouse_report.x = c_offset * -1; + if (mouse_report.y > 0) mouse_report.y = c_offset; + if (mouse_report.y < 0) mouse_report.y = c_offset * -1; + if (mouse_report.h > 0) mouse_report.h = w_offset; + if (mouse_report.h < 0) mouse_report.h = w_offset * -1; + if (mouse_report.v > 0) mouse_report.v = w_offset; + if (mouse_report.v < 0) mouse_report.v = w_offset * -1; + // adjust for diagonals + if (mouse_report.x && mouse_report.y) { + mouse_report.x = times_inv_sqrt2(mouse_report.x); + if (mouse_report.x == 0) { mouse_report.x = 1; } + mouse_report.y = times_inv_sqrt2(mouse_report.y); + if (mouse_report.y == 0) { mouse_report.y = 1; } + } + if (mouse_report.h && mouse_report.v) { + mouse_report.h = times_inv_sqrt2(mouse_report.h); + mouse_report.v = times_inv_sqrt2(mouse_report.v); + } } -void mousekey_off(uint8_t code) -{ - if (code == KC_MS_UP && mouse_report.y < 0) mouse_report.y = 0; - else if (code == KC_MS_DOWN && mouse_report.y > 0) mouse_report.y = 0; - else if (code == KC_MS_LEFT && mouse_report.x < 0) mouse_report.x = 0; - else if (code == KC_MS_RIGHT && mouse_report.x > 0) mouse_report.x = 0; - else if (code == KC_MS_WH_UP && mouse_report.v > 0) mouse_report.v = 0; - else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) mouse_report.v = 0; - else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) mouse_report.h = 0; - else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) mouse_report.h = 0; - else if (code == KC_MS_BTN1) mouse_report.buttons &= ~MOUSE_BTN1; - else if (code == KC_MS_BTN2) mouse_report.buttons &= ~MOUSE_BTN2; - else if (code == KC_MS_BTN3) mouse_report.buttons &= ~MOUSE_BTN3; - else if (code == KC_MS_BTN4) mouse_report.buttons &= ~MOUSE_BTN4; - else if (code == KC_MS_BTN5) mouse_report.buttons &= ~MOUSE_BTN5; - else if (code == KC_MS_ACCEL0) mousekey_accel &= ~(1<<0); - else if (code == KC_MS_ACCEL1) mousekey_accel &= ~(1<<1); - else if (code == KC_MS_ACCEL2) mousekey_accel &= ~(1<<2); - - if (mouse_report.x == 0 && mouse_report.y == 0 && mouse_report.v == 0 && mouse_report.h == 0) - mousekey_repeat = 0; +void mousekey_on(uint8_t code) { + uint16_t const c_offset = c_offsets[mk_speed]; + uint16_t const w_offset = w_offsets[mk_speed]; + uint8_t const old_speed = mk_speed; + if (code == KC_MS_UP) mouse_report.y = c_offset * -1; + else if (code == KC_MS_DOWN) mouse_report.y = c_offset; + else if (code == KC_MS_LEFT) mouse_report.x = c_offset * -1; + else if (code == KC_MS_RIGHT) mouse_report.x = c_offset; + else if (code == KC_MS_WH_UP) mouse_report.v = w_offset; + else if (code == KC_MS_WH_DOWN) mouse_report.v = w_offset * -1; + else if (code == KC_MS_WH_LEFT) mouse_report.h = w_offset * -1; + else if (code == KC_MS_WH_RIGHT) mouse_report.h = w_offset; + else if (code == KC_MS_BTN1) mouse_report.buttons |= MOUSE_BTN1; + else if (code == KC_MS_BTN2) mouse_report.buttons |= MOUSE_BTN2; + else if (code == KC_MS_BTN3) mouse_report.buttons |= MOUSE_BTN3; + else if (code == KC_MS_BTN4) mouse_report.buttons |= MOUSE_BTN4; + else if (code == KC_MS_BTN5) mouse_report.buttons |= MOUSE_BTN5; + else if (code == KC_MS_ACCEL0) mk_speed = mkspd_0; + else if (code == KC_MS_ACCEL1) mk_speed = mkspd_1; + else if (code == KC_MS_ACCEL2) mk_speed = mkspd_2; + if (mk_speed != old_speed) adjust_speed(); } -void mousekey_send(void) -{ - mousekey_debug(); - host_mouse_send(&mouse_report); - last_timer = timer_read(); +void mousekey_off(uint8_t code) { +#ifdef MK_MOMENTARY_ACCEL + uint8_t const old_speed = mk_speed; +#endif + if (code == KC_MS_UP && mouse_report.y < 0) mouse_report.y = 0; + else if (code == KC_MS_DOWN && mouse_report.y > 0) mouse_report.y = 0; + else if (code == KC_MS_LEFT && mouse_report.x < 0) mouse_report.x = 0; + else if (code == KC_MS_RIGHT && mouse_report.x > 0) mouse_report.x = 0; + else if (code == KC_MS_WH_UP && mouse_report.v > 0) mouse_report.v = 0; + else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) mouse_report.v = 0; + else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) mouse_report.h = 0; + else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) mouse_report.h = 0; + else if (code == KC_MS_BTN1) mouse_report.buttons &= ~MOUSE_BTN1; + else if (code == KC_MS_BTN2) mouse_report.buttons &= ~MOUSE_BTN2; + else if (code == KC_MS_BTN3) mouse_report.buttons &= ~MOUSE_BTN3; + else if (code == KC_MS_BTN4) mouse_report.buttons &= ~MOUSE_BTN4; + else if (code == KC_MS_BTN5) mouse_report.buttons &= ~MOUSE_BTN5; +#ifdef MK_MOMENTARY_ACCEL + else if (code == KC_MS_ACCEL0) mk_speed = mkspd_DEFAULT; + else if (code == KC_MS_ACCEL1) mk_speed = mkspd_DEFAULT; + else if (code == KC_MS_ACCEL2) mk_speed = mkspd_DEFAULT; + if (mk_speed != old_speed) adjust_speed(); +#endif } -void mousekey_clear(void) -{ - mouse_report = (report_mouse_t){}; - mousekey_repeat = 0; - mousekey_accel = 0; + + + +#endif /* #ifndef MK_3_SPEED */ + + + + +void mousekey_send(void) { + mousekey_debug(); + host_mouse_send(&mouse_report); + last_timer = timer_read(); +} + +void mousekey_clear(void) { + mouse_report = (report_mouse_t){}; + mousekey_repeat = 0; + mousekey_accel = 0; } -static void mousekey_debug(void) -{ - if (!debug_mouse) return; - print("mousekey [btn|x y v h](rep/acl): ["); - phex(mouse_report.buttons); print("|"); - print_decs(mouse_report.x); print(" "); - print_decs(mouse_report.y); print(" "); - print_decs(mouse_report.v); print(" "); - print_decs(mouse_report.h); print("]("); - print_dec(mousekey_repeat); print("/"); - print_dec(mousekey_accel); print(")\n"); +static void mousekey_debug(void) { + if (!debug_mouse) return; + print("mousekey [btn|x y v h](rep/acl): ["); + phex(mouse_report.buttons); print("|"); + print_decs(mouse_report.x); print(" "); + print_decs(mouse_report.y); print(" "); + print_decs(mouse_report.v); print(" "); + print_decs(mouse_report.h); print("]("); + print_dec(mousekey_repeat); print("/"); + print_dec(mousekey_accel); print(")\n"); } diff --git a/tmk_core/common/mousekey.h b/tmk_core/common/mousekey.h index 9338d0af779..89c1eaf11a5 100644 --- a/tmk_core/common/mousekey.h +++ b/tmk_core/common/mousekey.h @@ -16,23 +16,25 @@ along with this program. If not, see . */ #ifndef MOUSEKEY_H -#define MOUSEKEY_H +#define MOUSEKEY_H +#endif #include #include "host.h" +#ifndef MK_3_SPEED /* max value on report descriptor */ #ifndef MOUSEKEY_MOVE_MAX - #define MOUSEKEY_MOVE_MAX 127 + #define MOUSEKEY_MOVE_MAX 127 #elif MOUSEKEY_MOVE_MAX > 127 - #error MOUSEKEY_MOVE_MAX needs to be smaller than 127 + #error MOUSEKEY_MOVE_MAX needs to be smaller than 127 #endif #ifndef MOUSEKEY_WHEEL_MAX - #define MOUSEKEY_WHEEL_MAX 127 + #define MOUSEKEY_WHEEL_MAX 127 #elif MOUSEKEY_WHEEL_MAX > 127 - #error MOUSEKEY_WHEEL_MAX needs to be smaller than 127 + #error MOUSEKEY_WHEEL_MAX needs to be smaller than 127 #endif #ifndef MOUSEKEY_MOVE_DELTA @@ -60,6 +62,59 @@ along with this program. If not, see . #define MOUSEKEY_WHEEL_TIME_TO_MAX 40 #endif +#else /* #ifndef MK_3_SPEED */ + +#ifndef MK_C_OFFSET_UNMOD +#define MK_C_OFFSET_UNMOD 16 +#endif +#ifndef MK_C_INTERVAL_UNMOD +#define MK_C_INTERVAL_UNMOD 16 +#endif +#ifndef MK_C_OFFSET_0 +#define MK_C_OFFSET_0 1 +#endif +#ifndef MK_C_INTERVAL_0 +#define MK_C_INTERVAL_0 32 +#endif +#ifndef MK_C_OFFSET_1 +#define MK_C_OFFSET_1 4 +#endif +#ifndef MK_C_INTERVAL_1 +#define MK_C_INTERVAL_1 16 +#endif +#ifndef MK_C_OFFSET_2 +#define MK_C_OFFSET_2 32 +#endif +#ifndef MK_C_INTERVAL_2 +#define MK_C_INTERVAL_2 16 +#endif + +#ifndef MK_W_OFFSET_UNMOD +#define MK_W_OFFSET_UNMOD 1 +#endif +#ifndef MK_W_INTERVAL_UNMOD +#define MK_W_INTERVAL_UNMOD 40 +#endif +#ifndef MK_W_OFFSET_0 +#define MK_W_OFFSET_0 1 +#endif +#ifndef MK_W_INTERVAL_0 +#define MK_W_INTERVAL_0 360 +#endif +#ifndef MK_W_OFFSET_1 +#define MK_W_OFFSET_1 1 +#endif +#ifndef MK_W_INTERVAL_1 +#define MK_W_INTERVAL_1 120 +#endif +#ifndef MK_W_OFFSET_2 +#define MK_W_OFFSET_2 1 +#endif +#ifndef MK_W_INTERVAL_2 +#define MK_W_INTERVAL_2 20 +#endif + +#endif /* #ifndef MK_3_SPEED */ #ifdef __cplusplus extern "C" { @@ -72,7 +127,6 @@ extern uint8_t mk_time_to_max; extern uint8_t mk_wheel_max_speed; extern uint8_t mk_wheel_time_to_max; - void mousekey_task(void); void mousekey_on(uint8_t code); void mousekey_off(uint8_t code); @@ -82,5 +136,3 @@ void mousekey_send(void); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index d9452765725..2d7184bd0d4 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -60,7 +60,7 @@ # define println(s) xputs(PSTR(s "\r\n")) # define uprint(s) print(s) # define uprintln(s) println(s) -# define uprintf(fmt, ...) xprintf(fmt, ...) +# define uprintf(fmt, ...) xprintf(fmt, ##__VA_ARGS__) # endif /* USER_PRINT / NORMAL PRINT */ @@ -73,7 +73,9 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); #elif defined(PROTOCOL_CHIBIOS) /* PROTOCOL_CHIBIOS */ +#ifndef TERMINAL_ENABLE # include "chibios/printf.h" +#endif # ifdef USER_PRINT /* USER_PRINT */ @@ -123,7 +125,7 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); # define println(s) xprintf(s "\r\n") # define uprint(s) print(s) # define uprintln(s) println(s) -# define uprintf(fmt, ...) xprintf(fmt, ...) +# define uprintf(fmt, ...) xprintf(fmt, ##__VA_ARGS__) # endif /* USER_PRINT / NORMAL PRINT */ @@ -139,19 +141,19 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); # define xprintf(fmt, ...) // Create user print defines -# define uprintf(fmt, ...) __xprintf(fmt, ...) +# define uprintf(fmt, ...) __xprintf(fmt, ##__VA_ARGS__) # define uprint(s) xprintf(s) # define uprintln(s) xprintf(s "\r\n") # else /* NORMAL PRINT */ // Create user & normal print defines -# define xprintf(fmt, ...) __xprintf(fmt, ...) +# define xprintf(fmt, ...) __xprintf(fmt, ##__VA_ARGS__) # define print(s) xprintf(s) # define println(s) xprintf(s "\r\n") # define uprint(s) print(s) # define uprintln(s) println(s) -# define uprintf(fmt, ...) xprintf(fmt, ...) +# define uprintf(fmt, ...) xprintf(fmt, ##__VA_ARGS__) # endif /* USER_PRINT / NORMAL PRINT */ diff --git a/tmk_core/common/progmem.h b/tmk_core/common/progmem.h index dcc9efb3cef..de931383972 100644 --- a/tmk_core/common/progmem.h +++ b/tmk_core/common/progmem.h @@ -5,9 +5,9 @@ # include #else # define PROGMEM -# define pgm_read_byte(p) *((unsigned char*)p) -# define pgm_read_word(p) *((uint16_t*)p) -# define pgm_read_dword(p) *((uint32_t*)p) +# define pgm_read_byte(p) *((unsigned char*)(p)) +# define pgm_read_word(p) *((uint16_t*)(p)) +# define pgm_read_dword(p) *((uint32_t*)(p)) #endif #endif diff --git a/tmk_core/common/report.c b/tmk_core/common/report.c index eb3b44312ff..6a06b70c60a 100644 --- a/tmk_core/common/report.c +++ b/tmk_core/common/report.c @@ -19,6 +19,7 @@ #include "keycode_config.h" #include "debug.h" #include "util.h" +#include /** \brief has_anykey * @@ -27,8 +28,16 @@ uint8_t has_anykey(report_keyboard_t* keyboard_report) { uint8_t cnt = 0; - for (uint8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) { - if (keyboard_report->raw[i]) + uint8_t *p = keyboard_report->keys; + uint8_t lp = sizeof(keyboard_report->keys); +#ifdef NKRO_ENABLE + if (keyboard_protocol && keymap_config.nkro) { + p = keyboard_report->nkro.bits; + lp = sizeof(keyboard_report->nkro.bits); + } +#endif + while (lp--) { + if (*p++) cnt++; } return cnt; @@ -237,7 +246,11 @@ void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key) void clear_keys_from_report(report_keyboard_t* keyboard_report) { // not clear mods - for (int8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) { - keyboard_report->raw[i] = 0; +#ifdef NKRO_ENABLE + if (keyboard_protocol && keymap_config.nkro) { + memset(keyboard_report->nkro.bits, 0, sizeof(keyboard_report->nkro.bits)); + return; } +#endif + memset(keyboard_report->keys, 0, sizeof(keyboard_report->keys)); } diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index 167f382751e..e7c31bd376a 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h @@ -23,9 +23,11 @@ along with this program. If not, see . /* report id */ -#define REPORT_ID_MOUSE 1 -#define REPORT_ID_SYSTEM 2 -#define REPORT_ID_CONSUMER 3 +#define REPORT_ID_KEYBOARD 1 +#define REPORT_ID_MOUSE 2 +#define REPORT_ID_SYSTEM 3 +#define REPORT_ID_CONSUMER 4 +#define REPORT_ID_NKRO 5 /* mouse buttons */ #define MOUSE_BTN1 (1<<0) @@ -36,6 +38,7 @@ along with this program. If not, see . /* Consumer Page(0x0C) * following are supported by Windows: http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx + * see also https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/display-brightness-control */ #define AUDIO_MUTE 0x00E2 #define AUDIO_VOL_UP 0x00E9 @@ -45,6 +48,8 @@ along with this program. If not, see . #define TRANSPORT_STOP 0x00B7 #define TRANSPORT_STOP_EJECT 0x00CC #define TRANSPORT_PLAY_PAUSE 0x00CD +#define BRIGHTNESS_UP 0x006F +#define BRIGHTNESS_DOWN 0x0070 /* application launch */ #define AL_CC_CONFIG 0x0183 #define AL_EMAIL 0x018A @@ -72,32 +77,35 @@ along with this program. If not, see . #define SYSTEM_WAKE_UP 0x0083 +#define NKRO_SHARED_EP /* key report size(NKRO or boot mode) */ #if defined(NKRO_ENABLE) - #if defined(PROTOCOL_PJRC) - #include "usb.h" - #define KEYBOARD_REPORT_SIZE KBD2_SIZE - #define KEYBOARD_REPORT_KEYS (KBD2_SIZE - 2) - #define KEYBOARD_REPORT_BITS (KBD2_SIZE - 1) - #elif defined(PROTOCOL_LUFA) || defined(PROTOCOL_CHIBIOS) + #if defined(PROTOCOL_LUFA) || defined(PROTOCOL_CHIBIOS) #include "protocol/usb_descriptor.h" - #define KEYBOARD_REPORT_SIZE NKRO_EPSIZE - #define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) - #define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) + #define KEYBOARD_REPORT_BITS (SHARED_EPSIZE - 2) #elif defined(PROTOCOL_ARM_ATSAM) #include "protocol/arm_atsam/usb/udi_device_epsize.h" - #define KEYBOARD_REPORT_SIZE NKRO_EPSIZE - #define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) #define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) + #undef NKRO_SHARED_EP + #undef MOUSE_SHARED_EP #else #error "NKRO not supported with this protocol" + #endif #endif +#ifdef KEYBOARD_SHARED_EP +# define KEYBOARD_REPORT_SIZE 9 #else # define KEYBOARD_REPORT_SIZE 8 -# define KEYBOARD_REPORT_KEYS 6 #endif +#define KEYBOARD_REPORT_KEYS 6 + +/* VUSB hardcodes keyboard and mouse+extrakey only */ +#if defined(PROTOCOL_VUSB) + #undef KEYBOARD_SHARED_EP + #undef MOUSE_SHARED_EP +#endif #ifdef __cplusplus extern "C" { @@ -126,12 +134,18 @@ extern "C" { typedef union { uint8_t raw[KEYBOARD_REPORT_SIZE]; struct { +#ifdef KEYBOARD_SHARED_EP + uint8_t report_id; +#endif uint8_t mods; uint8_t reserved; uint8_t keys[KEYBOARD_REPORT_KEYS]; }; #ifdef NKRO_ENABLE - struct { + struct nkro_report { +#ifdef NKRO_SHARED_EP + uint8_t report_id; +#endif uint8_t mods; uint8_t bits[KEYBOARD_REPORT_BITS]; } nkro; @@ -139,6 +153,9 @@ typedef union { } __attribute__ ((packed)) report_keyboard_t; typedef struct { +#ifdef MOUSE_SHARED_EP + uint8_t report_id; +#endif uint8_t buttons; int8_t x; int8_t y; @@ -175,7 +192,9 @@ typedef struct { (key == KC_WWW_FORWARD ? AC_FORWARD : \ (key == KC_WWW_STOP ? AC_STOP : \ (key == KC_WWW_REFRESH ? AC_REFRESH : \ - (key == KC_WWW_FAVORITES ? AC_BOOKMARKS : 0))))))))))))))))))))) + (key == KC_BRIGHTNESS_UP ? BRIGHTNESS_UP : \ + (key == KC_BRIGHTNESS_DOWN ? BRIGHTNESS_DOWN : \ + (key == KC_WWW_FAVORITES ? AC_BOOKMARKS : 0))))))))))))))))))))))) uint8_t has_anykey(report_keyboard_t* keyboard_report); uint8_t get_first_key(report_keyboard_t* keyboard_report); diff --git a/tmk_core/common/wait.h b/tmk_core/common/wait.h index a7cded94202..a77840bcef9 100644 --- a/tmk_core/common/wait.h +++ b/tmk_core/common/wait.h @@ -15,6 +15,10 @@ extern "C" { # include "ch.h" # define wait_ms(ms) chThdSleepMilliseconds(ms) # define wait_us(us) chThdSleepMicroseconds(us) +#elif defined PROTOCOL_ARM_ATSAM +# include "clks.h" +# define wait_ms(ms) CLK_delay_ms(ms) +# define wait_us(us) CLK_delay_us(us) #elif defined(__arm__) # include "wait_api.h" #else // Unit tests diff --git a/tmk_core/make_dfu_header.sh b/tmk_core/make_dfu_header.sh new file mode 100755 index 00000000000..49ba66251a0 --- /dev/null +++ b/tmk_core/make_dfu_header.sh @@ -0,0 +1,16 @@ +#!/bin/sh +ALL_CONFIGS=$* +GREP="grep" + +cat <<- EOF > lib/lufa/Bootloaders/DFU/Keyboard.h +#ifndef QMK_KEYBOARD +#define QMK_KEYBOARD + +$($GREP "MANUFACTURER[ \t]" $ALL_CONFIGS -h | tail -1) +$($GREP "PRODUCT[ \t]" $ALL_CONFIGS -h | tail -1 | tr -d '\r') Bootloader +$($GREP "QMK_ESC_OUTPUT[ \t]" $ALL_CONFIGS -h | tail -1) +$($GREP "QMK_ESC_INPUT[ \t]" $ALL_CONFIGS -h | tail -1) +$($GREP "QMK_LED[ \t]" $ALL_CONFIGS -h | tail -1) +$($GREP "QMK_SPEAKER[ \t]" $ALL_CONFIGS -h | tail -1) +#endif +EOF diff --git a/tmk_core/protocol/arm_atsam.mk b/tmk_core/protocol/arm_atsam.mk index 04e02790a0d..8d6f724f099 100644 --- a/tmk_core/protocol/arm_atsam.mk +++ b/tmk_core/protocol/arm_atsam.mk @@ -4,7 +4,10 @@ SRC += $(ARM_ATSAM_DIR)/adc.c SRC += $(ARM_ATSAM_DIR)/clks.c SRC += $(ARM_ATSAM_DIR)/d51_util.c SRC += $(ARM_ATSAM_DIR)/i2c_master.c -SRC += $(ARM_ATSAM_DIR)/led_matrix.c +ifeq ($(RGB_MATRIX_ENABLE),custom) + SRC += $(ARM_ATSAM_DIR)/led_matrix_programs.c + SRC += $(ARM_ATSAM_DIR)/led_matrix.c +endif SRC += $(ARM_ATSAM_DIR)/main_arm_atsam.c SRC += $(ARM_ATSAM_DIR)/spi.c SRC += $(ARM_ATSAM_DIR)/startup.c diff --git a/tmk_core/protocol/arm_atsam/adc.c b/tmk_core/protocol/arm_atsam/adc.c index ab77f92402e..cb5c349b730 100644 --- a/tmk_core/protocol/arm_atsam/adc.c +++ b/tmk_core/protocol/arm_atsam/adc.c @@ -74,9 +74,9 @@ void ADC0_init(void) while (ADC0->SYNCBUSY.bit.SAMPCTRL) { DBGC(DC_ADC0_SAMPCTRL_SYNCING_1); } //Load factory calibration data - ADC0->CALIB.bit.BIASCOMP = (ADC0_FUSES_BIASCOMP_ADDR >> ADC0_FUSES_BIASCOMP_Pos) & ADC0_FUSES_BIASCOMP_Msk; - ADC0->CALIB.bit.BIASR2R = (ADC0_FUSES_BIASR2R_ADDR >> ADC0_FUSES_BIASR2R_Pos) & ADC0_FUSES_BIASR2R_Msk; - ADC0->CALIB.bit.BIASREFBUF = (ADC0_FUSES_BIASREFBUF_ADDR >> ADC0_FUSES_BIASREFBUF_Pos) & ADC0_FUSES_BIASREFBUF_Msk; + ADC0->CALIB.bit.BIASCOMP = ((*(uint32_t *)ADC0_FUSES_BIASCOMP_ADDR) & ADC0_FUSES_BIASCOMP_Msk) >> ADC0_FUSES_BIASCOMP_Pos; + ADC0->CALIB.bit.BIASR2R = ((*(uint32_t *)ADC0_FUSES_BIASR2R_ADDR) & ADC0_FUSES_BIASR2R_Msk) >> ADC0_FUSES_BIASR2R_Pos; + ADC0->CALIB.bit.BIASREFBUF = ((*(uint32_t *)ADC0_FUSES_BIASREFBUF_ADDR) & ADC0_FUSES_BIASREFBUF_Msk) >> ADC0_FUSES_BIASREFBUF_Pos; //Enable ADC0->CTRLA.bit.ENABLE = 1; diff --git a/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h b/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h index 2ba0991749c..88109186aad 100644 --- a/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h +++ b/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h @@ -21,8 +21,10 @@ along with this program. If not, see . #include "samd51j18a.h" #include "md_bootloader.h" +#include "timer.h" #include "d51_util.h" #include "clks.h" +#include "wait.h" #include "adc.h" #include "i2c_master.h" #include "spi.h" @@ -32,7 +34,10 @@ along with this program. If not, see . #ifndef MD_BOOTLOADER #include "main_arm_atsam.h" +#ifdef RGB_MATRIX_ENABLE #include "led_matrix.h" +#include "rgb_matrix.h" +#endif #include "issi3733_driver.h" #include "./usb/compiler.h" #include "./usb/udc.h" diff --git a/tmk_core/protocol/arm_atsam/clks.c b/tmk_core/protocol/arm_atsam/clks.c index 8768d0a99e1..1ff318e59b3 100644 --- a/tmk_core/protocol/arm_atsam/clks.c +++ b/tmk_core/protocol/arm_atsam/clks.c @@ -21,8 +21,8 @@ along with this program. If not, see . volatile clk_t system_clks; volatile uint64_t ms_clk; - -volatile uint8_t us_delay_done; +uint32_t usec_delay_mult; +#define USEC_DELAY_LOOP_CYCLES 3 //Sum of instruction cycles in us delay loop const uint32_t sercom_apbbase[] = {(uint32_t)SERCOM0,(uint32_t)SERCOM1,(uint32_t)SERCOM2,(uint32_t)SERCOM3,(uint32_t)SERCOM4,(uint32_t)SERCOM5}; const uint8_t sercom_pchan[] = {7, 8, 23, 24, 34, 35}; @@ -73,6 +73,9 @@ void CLK_oscctrl_init(void) system_clks.freq_gclk[0] = system_clks.freq_dpll[0]; + usec_delay_mult = system_clks.freq_gclk[0] / (USEC_DELAY_LOOP_CYCLES * 1000000); + if (usec_delay_mult < 1) usec_delay_mult = 1; //Never allow a multiplier of zero + DBGC(DC_CLK_OSC_INIT_COMPLETE); } @@ -158,23 +161,11 @@ void TC4_Handler() } } -void TC5_Handler() -{ - if (TC5->COUNT16.INTFLAG.bit.MC0) - { - TC5->COUNT16.INTFLAG.reg = TC_INTENCLR_MC0; - us_delay_done = 1; - TC5->COUNT16.CTRLA.bit.ENABLE = 0; - while (TC5->COUNT16.SYNCBUSY.bit.ENABLE) {} - } -} - uint32_t CLK_enable_timebase(void) { Gclk *pgclk = GCLK; Mclk *pmclk = MCLK; Tc *ptc4 = TC4; - Tc *ptc5 = TC5; Tc *ptc0 = TC0; Evsys *pevsys = EVSYS; @@ -189,11 +180,6 @@ uint32_t CLK_enable_timebase(void) pgclk->PCHCTRL[TC4_GCLK_ID].bit.GEN = GEN_TC45; pgclk->PCHCTRL[TC4_GCLK_ID].bit.CHEN = 1; - //unmask TC5 sourcegclk2 to TC5 - pmclk->APBCMASK.bit.TC5_ = 1; - pgclk->PCHCTRL[TC5_GCLK_ID].bit.GEN = GEN_TC45; - pgclk->PCHCTRL[TC5_GCLK_ID].bit.CHEN = 1; - //configure TC4 DBGC(DC_CLK_ENABLE_TIMEBASE_TC4_BEGIN); ptc4->COUNT16.CTRLA.bit.ENABLE = 0; @@ -220,30 +206,6 @@ uint32_t CLK_enable_timebase(void) DBGC(DC_CLK_ENABLE_TIMEBASE_TC4_COMPLETE); - //configure TC5 - DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_BEGIN); - ptc5->COUNT16.CTRLA.bit.ENABLE = 0; - while (ptc5->COUNT16.SYNCBUSY.bit.ENABLE) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_DISABLE); } - ptc5->COUNT16.CTRLA.bit.SWRST = 1; - while (ptc5->COUNT16.SYNCBUSY.bit.SWRST) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_SWRST_1); } - while (ptc5->COUNT16.CTRLA.bit.SWRST) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_SWRST_2); } - - //CTRLA defaults - //CTRLB as default, counting up - ptc5->COUNT16.CTRLBCLR.reg = 5; - while (ptc5->COUNT16.SYNCBUSY.bit.CTRLB) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_CLTRB); } - //ptc5->COUNT16.DBGCTRL.bit.DBGRUN = 1; - - //wave mode - ptc5->COUNT16.WAVE.bit.WAVEGEN = 1; //MFRQ match frequency mode, toggle each CC match - //generate event for next stage - ptc5->COUNT16.EVCTRL.bit.MCEO0 = 1; - - NVIC_EnableIRQ(TC5_IRQn); - ptc5->COUNT16.INTENSET.bit.MC0 = 1; - - DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_COMPLETE); - //unmask TC0,1, sourcegclk2 to TC0,1 pmclk->APBAMASK.bit.TC0_ = 1; pgclk->PCHCTRL[TC0_GCLK_ID].bit.GEN = GEN_TC45; @@ -289,37 +251,27 @@ uint32_t CLK_enable_timebase(void) return 0; } -uint32_t CLK_get_ms(void) +void CLK_delay_us(uint32_t usec) { - return ms_clk; -} - -void CLK_delay_us(uint16_t usec) -{ - us_delay_done = 0; - - if (TC5->COUNT16.CTRLA.bit.ENABLE) - { - TC5->COUNT16.CTRLA.bit.ENABLE = 0; - while (TC5->COUNT16.SYNCBUSY.bit.ENABLE) {} - } - - if (usec < 10) usec = 0; - else usec -= 10; - - TC5->COUNT16.CC[0].reg = usec; - while (TC5->COUNT16.SYNCBUSY.bit.CC0) {} - - TC5->COUNT16.CTRLA.bit.ENABLE = 1; - while (TC5->COUNT16.SYNCBUSY.bit.ENABLE) {} - - while (!us_delay_done) {} + asm ( + "CBZ R0, return\n\t" //If usec == 0, branch to return label + ); + asm ( + "MULS R0, %0\n\t" //Multiply R0(usec) by usec_delay_mult and store in R0 + ".balign 16\n\t" //Ensure loop is aligned for fastest performance + "loop: SUBS R0, #1\n\t" //Subtract 1 from R0 and update flags (1 cycle) + "BNE loop\n\t" //Branch if non-zero to loop label (2 cycles) NOTE: USEC_DELAY_LOOP_CYCLES is the sum of loop cycles + "return:\n\t" //Return label + : //No output registers + : "r" (usec_delay_mult) //For %0 + ); + //Note: BX LR generated } void CLK_delay_ms(uint64_t msec) { - msec += CLK_get_ms(); - while (msec > CLK_get_ms()) {} + msec += timer_read64(); + while (msec > timer_read64()) {} } void clk_enable_sercom_apbmask(int sercomn) diff --git a/tmk_core/protocol/arm_atsam/clks.h b/tmk_core/protocol/arm_atsam/clks.h index 96819bfdd09..1b01a1764ef 100644 --- a/tmk_core/protocol/arm_atsam/clks.h +++ b/tmk_core/protocol/arm_atsam/clks.h @@ -77,9 +77,8 @@ void CLK_oscctrl_init(void); void CLK_reset_time(void); uint32_t CLK_set_gclk_freq(uint8_t gclkn, uint32_t freq); uint32_t CLK_enable_timebase(void); -uint32_t CLK_get_ms(void); -uint64_t CLK_get_us(void); -void CLK_delay_us(uint16_t usec); +uint64_t timer_read64(void); +void CLK_delay_us(uint32_t usec); void CLK_delay_ms(uint64_t msec); uint32_t CLK_set_spi_freq(uint8_t sercomn, uint32_t freq); diff --git a/tmk_core/protocol/arm_atsam/d51_util.c b/tmk_core/protocol/arm_atsam/d51_util.c index bb63a948144..ea422585757 100644 --- a/tmk_core/protocol/arm_atsam/d51_util.c +++ b/tmk_core/protocol/arm_atsam/d51_util.c @@ -1,8 +1,11 @@ #include "d51_util.h" -//Display unsigned 32-bit number through m15 -//Read as follows: 1230 = || ||| |||| | (note always ending toggle) -void m15_print(uint32_t x) +static volatile uint32_t w; + +//Display unsigned 32-bit number by port toggling DBG_1 (to view on a scope) +//Read as follows: 1230 = | | | | | | || (note zero is fast double toggle) +#define DBG_PAUSE 5 +void dbg_print(uint32_t x) { int8_t t; uint32_t n; @@ -26,24 +29,34 @@ void m15_print(uint32_t x) while (p2--) p *= 10; n = x / p; x -= n * p; - while (n > 0) + if (!n) { - m15_on; + DBG_1_ON; + DBG_1_OFF; + DBG_1_ON; + DBG_1_OFF; n--; - m15_off; } - //Will always end with an extra toggle - m15_on; + else + { + while (n > 0) + { + DBG_1_ON; + DBG_1_OFF; + n--; + } + } + t--; - m15_off; } + + for (w = DBG_PAUSE; w; w--); //Long pause after number is complete } //Display unsigned 32-bit number through debug led //Read as follows: 1230 = [*] [* *] [* * *] [**] (note zero is fast double flash) #define DLED_ONTIME 1000000 #define DLED_PAUSE 1500000 -volatile uint32_t w; void dled_print(uint32_t x, uint8_t long_pause) { int8_t t; @@ -70,13 +83,13 @@ void dled_print(uint32_t x, uint8_t long_pause) x -= n * p; if (!n) { - led_on; + DBG_LED_ON; for (w = DLED_ONTIME / 4; w; w--); - led_off; + DBG_LED_OFF; for (w = DLED_ONTIME / 4; w; w--); - led_on; + DBG_LED_ON; for (w = DLED_ONTIME / 4; w; w--); - led_off; + DBG_LED_OFF; for (w = DLED_ONTIME / 4; w; w--); n--; } @@ -84,9 +97,9 @@ void dled_print(uint32_t x, uint8_t long_pause) { while (n > 0) { - led_on; + DBG_LED_ON; for (w = DLED_ONTIME; w; w--); - led_off; + DBG_LED_OFF; for (w = DLED_ONTIME / 2; w; w--); n--; } @@ -102,11 +115,52 @@ void dled_print(uint32_t x, uint8_t long_pause) } } -#ifdef DEBUG_BOOT_TRACING +#ifdef DEBUG_BOOT_TRACING_ENABLE volatile uint32_t debug_code; -void EIC_15_Handler() +//These macros are for compile time substitution +#define DEBUG_BOOT_TRACING_EXTINTn (DEBUG_BOOT_TRACING_PIN % _U_(0x10)) +#define DEBUG_BOOT_TRACING_EXTINTb (_U_(0x1) << DEBUG_BOOT_TRACING_EXTINTn) +#define DEBUG_BOOT_TRACING_CONFIG_INDn (DEBUG_BOOT_TRACING_EXTINTn / _U_(0x8)) +#define DEBUG_BOOT_TRACING_CONFIG_SENSEn (DEBUG_BOOT_TRACING_EXTINTn % _U_(0x8)) +#define DEBUG_BOOT_TRACING_CONFIG_SENSEb (DEBUG_BOOT_TRACING_CONFIG_SENSEn * _U_(0x4)) +#define DEBUG_BOOT_TRACING_IRQn (EIC_0_IRQn + DEBUG_BOOT_TRACING_EXTINTn) + +//These macros perform PORT+PIN definition translation to IRQn in the preprocessor +#define PORTPIN_TO_IRQn_EXPAND(def) def +#define PORTPIN_TO_IRQn_DEF(def) PORTPIN_TO_IRQn_EXPAND(def) +#if DEBUG_BOOT_TRACING_PIN < 10 +#define PORTPIN_TO_IRQn_TODEF(port, pin) PORTPIN_TO_IRQn_DEF(PIN_ ## port ## 0 ## pin ## A_EIC_EXTINT_NUM) +#else +#define PORTPIN_TO_IRQn_TODEF(port, pin) PORTPIN_TO_IRQn_DEF(PIN_ ## port ## pin ## A_EIC_EXTINT_NUM) +#endif +#define PORTPIN_TO_IRQn(port, pin) PORTPIN_TO_IRQn_TODEF(port, pin) + +//These macros perform function name output in the preprocessor +#define DEBUG_BOOT_TRACING_HANDLER_CONCAT(irq) void EIC_ ## irq ## _Handler(void) +#define DEBUG_BOOT_TRACING_HANDLER(irq) DEBUG_BOOT_TRACING_HANDLER_CONCAT(irq) + +//To generate the function name of the IRQ handler catching boot tracing, +// certain macros must be undefined, so save their current values to macro stack +#pragma push_macro("PA") +#pragma push_macro("PB") +#pragma push_macro("_L_") + +//Undefine / redefine pushed macros +#undef PA +#undef PB +#undef _L_ +#define _L_(x) x + +//Perform the work and output +//Ex: PORT PB, PIN 31 = void EIC_15_Handler(void) +DEBUG_BOOT_TRACING_HANDLER(PORTPIN_TO_IRQn(DEBUG_BOOT_TRACING_PORT, DEBUG_BOOT_TRACING_PIN)) + +//Restore macros +#pragma pop_macro("PA") +#pragma pop_macro("PB") +#pragma pop_macro("_L_") { //This is only for non-functional keyboard troubleshooting and should be disabled after boot //Intention is to lock up the keyboard here with repeating debug led code @@ -120,13 +174,13 @@ void debug_code_init(void) { DBGC(DC_UNSET); - //Configure Ports for EIC on PB31 - PORT->Group[1].DIRCLR.reg = 1 << 31; //Input - PORT->Group[1].OUTSET.reg = 1 << 31; //High - PORT->Group[1].PINCFG[31].bit.INEN = 1; //Input Enable - PORT->Group[1].PINCFG[31].bit.PULLEN = 1; //Pull Enable - PORT->Group[1].PINCFG[31].bit.PMUXEN = 1; //Mux Enable - PORT->Group[1].PMUX[15].bit.PMUXO = 0; //Mux A + //Configure Ports for EIC + PORT->Group[DEBUG_BOOT_TRACING_PORT].DIRCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; //Input + PORT->Group[DEBUG_BOOT_TRACING_PORT].OUTSET.reg = 1 << DEBUG_BOOT_TRACING_PIN; //High + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.INEN = 1; //Input Enable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PULLEN = 1; //Pull Enable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PMUXEN = 1; //Mux Enable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PMUX[DEBUG_BOOT_TRACING_PIN / 2].bit.PMUXO = 0; //Mux A //Enable CLK_EIC_APB MCLK->APBAMASK.bit.EIC_ = 1; @@ -134,25 +188,33 @@ void debug_code_init(void) //Configure EIC EIC->CTRLA.bit.SWRST = 1; while (EIC->SYNCBUSY.bit.SWRST) {} - EIC->ASYNCH.reg = 1 << 15; - EIC->INTENSET.reg = 1 << 15; - EIC->CONFIG[1].bit.SENSE7 = 2; + EIC->ASYNCH.reg = DEBUG_BOOT_TRACING_EXTINTb; + EIC->INTENSET.reg = DEBUG_BOOT_TRACING_EXTINTb; + EIC->CONFIG[DEBUG_BOOT_TRACING_CONFIG_INDn].reg |= (EIC_CONFIG_SENSE0_FALL_Val << DEBUG_BOOT_TRACING_CONFIG_SENSEb); EIC->CTRLA.bit.ENABLE = 1; while (EIC->SYNCBUSY.bit.ENABLE) {} //Enable EIC IRQ - NVIC_EnableIRQ(EIC_15_IRQn); + NVIC_EnableIRQ(DEBUG_BOOT_TRACING_IRQn); } void debug_code_disable(void) { //Disable EIC IRQ - NVIC_DisableIRQ(EIC_15_IRQn); + NVIC_DisableIRQ(DEBUG_BOOT_TRACING_IRQn); //Disable EIC EIC->CTRLA.bit.ENABLE = 0; while (EIC->SYNCBUSY.bit.ENABLE) {} + //Default port configuration + PORT->Group[DEBUG_BOOT_TRACING_PORT].DIRCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; //Input + PORT->Group[DEBUG_BOOT_TRACING_PORT].OUTCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; //Low + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.INEN = 0; //Input Disable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PULLEN = 0; //Pull Disable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PMUXEN = 0; //Mux Disable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PMUX[DEBUG_BOOT_TRACING_PIN / 2].bit.PMUXO = 0; //Mux A + //Disable CLK_EIC_APB MCLK->APBAMASK.bit.EIC_ = 0; } @@ -162,4 +224,4 @@ void debug_code_disable(void) void debug_code_init(void) {} void debug_code_disable(void) {} -#endif //DEBUG_BOOT_TRACING +#endif //DEBUG_BOOT_TRACING_ENABLE diff --git a/tmk_core/protocol/arm_atsam/d51_util.h b/tmk_core/protocol/arm_atsam/d51_util.h index 7a35f7989f7..71431942c7e 100644 --- a/tmk_core/protocol/arm_atsam/d51_util.h +++ b/tmk_core/protocol/arm_atsam/d51_util.h @@ -20,37 +20,65 @@ along with this program. If not, see . #include "samd51j18a.h" -//TODO: PS: Should bring these ports out to keyboard level configuration - -//Debug LED PA27 -#define led_ena REG_PORT_DIRSET0 = 0x08000000 //PA27 Output -#define led_on REG_PORT_OUTSET0 = 0x08000000 //PA27 High -#define led_off REG_PORT_OUTCLR0 = 0x08000000 //PA27 Low - -//Debug Port PB30 -#define m15_ena REG_PORT_DIRSET1 = 0x40000000 //PB30 Output -#define m15_on REG_PORT_OUTSET1 = 0x40000000 //PB30 High -#define m15_off REG_PORT_OUTCLR1 = 0x40000000 //PB30 Low - -//Debug Port PB23 -#define m27_ena REG_PORT_DIRSET1 = 0x800000 //PB23 Output -#define m27_on REG_PORT_OUTSET1 = 0x800000 //PB23 High -#define m27_off REG_PORT_OUTCLR1 = 0x800000 //PB23 Low - -//Debug Port PB31 -#define m28_ena REG_PORT_DIRSET1 = 0x80000000 //PB31 Output -#define m28_on REG_PORT_OUTSET1 = 0x80000000 //PB31 High -#define m28_off REG_PORT_OUTCLR1 = 0x80000000 //PB31 Low - -#define m15_loop(M15X) {uint8_t M15L=M15X; while(M15L--){m15_on;CLK_delay_us(1);m15_off;}} +/* Debug LED */ +#if DEBUG_LED_ENABLE == 1 +#define DBG_LED_ENA PORT->Group[DEBUG_LED_PORT].DIRSET.reg = (1 << DEBUG_LED_PIN) +#define DBG_LED_DIS PORT->Group[DEBUG_LED_PORT].DIRCLR.reg = (1 << DEBUG_LED_PIN) +#define DBG_LED_ON PORT->Group[DEBUG_LED_PORT].OUTSET.reg = (1 << DEBUG_LED_PIN) +#define DBG_LED_OFF PORT->Group[DEBUG_LED_PORT].OUTCLR.reg = (1 << DEBUG_LED_PIN) +#else +#define DBG_LED_ENA +#define DBG_LED_DIS +#define DBG_LED_ON +#define DBG_LED_OFF +#endif + +/* Debug Port 1 */ +#if DEBUG_PORT1_ENABLE == 1 +#define DBG_1_ENA PORT->Group[DEBUG_PORT1_PORT].DIRSET.reg = (1 << DEBUG_PORT1_PIN) +#define DBG_1_DIS PORT->Group[DEBUG_PORT1_PORT].DIRCLR.reg = (1 << DEBUG_PORT1_PIN) +#define DBG_1_ON PORT->Group[DEBUG_PORT1_PORT].OUTSET.reg = (1 << DEBUG_PORT1_PIN) +#define DBG_1_OFF PORT->Group[DEBUG_PORT1_PORT].OUTCLR.reg = (1 << DEBUG_PORT1_PIN) +#else +#define DBG_1_ENA +#define DBG_1_DIS +#define DBG_1_ON +#define DBG_1_OFF +#endif + +/* Debug Port 2 */ +#if DEBUG_PORT2_ENABLE == 1 +#define DBG_2_ENA PORT->Group[DEBUG_PORT2_PORT].DIRSET.reg = (1 << DEBUG_PORT2_PIN) +#define DBG_2_DIS PORT->Group[DEBUG_PORT2_PORT].DIRCLR.reg = (1 << DEBUG_PORT2_PIN) +#define DBG_2_ON PORT->Group[DEBUG_PORT2_PORT].OUTSET.reg = (1 << DEBUG_PORT2_PIN) +#define DBG_2_OFF PORT->Group[DEBUG_PORT2_PORT].OUTCLR.reg = (1 << DEBUG_PORT2_PIN) +#else +#define DBG_2_ENA +#define DBG_2_DIS +#define DBG_2_ON +#define DBG_2_OFF +#endif + +/* Debug Port 3 */ +#if DEBUG_PORT3_ENABLE == 1 +#define DBG_3_ENA PORT->Group[DEBUG_PORT3_PORT].DIRSET.reg = (1 << DEBUG_PORT3_PIN) +#define DBG_3_DIS PORT->Group[DEBUG_PORT3_PORT].DIRCLR.reg = (1 << DEBUG_PORT3_PIN) +#define DBG_3_ON PORT->Group[DEBUG_PORT3_PORT].OUTSET.reg = (1 << DEBUG_PORT3_PIN) +#define DBG_3_OFF PORT->Group[DEBUG_PORT3_PORT].OUTCLR.reg = (1 << DEBUG_PORT3_PIN) +#else +#define DBG_3_ENA +#define DBG_3_DIS +#define DBG_3_ON +#define DBG_3_OFF +#endif -void m15_print(uint32_t x); +void dbg_print(uint32_t x); void dled_print(uint32_t x, uint8_t long_pause); void debug_code_init(void); void debug_code_disable(void); -#ifdef DEBUG_BOOT_TRACING +#ifdef DEBUG_BOOT_TRACING_ENABLE #define DBGC(n) debug_code = n @@ -190,6 +218,6 @@ enum debug_code_list { #define DBGC(n) {} -#endif //DEBUG_BOOT_TRACING +#endif //DEBUG_BOOT_TRACING_ENABLE #endif //_D51_UTIL_H_ diff --git a/tmk_core/protocol/arm_atsam/i2c_master.c b/tmk_core/protocol/arm_atsam/i2c_master.c index 4f5a79e89f0..1741d9ac5b0 100644 --- a/tmk_core/protocol/arm_atsam/i2c_master.c +++ b/tmk_core/protocol/arm_atsam/i2c_master.c @@ -17,7 +17,7 @@ along with this program. If not, see . #include "arm_atsam_protocol.h" -#ifndef MD_BOOTLOADER +#if !defined(MD_BOOTLOADER) && defined(RGB_MATRIX_ENABLE) #include @@ -37,7 +37,7 @@ static uint8_t dma_sendbuf[I2C_DMA_MAX_SEND]; //Data being written to I2C volatile uint8_t i2c_led_q_running; -#endif //MD_BOOTLOADER +#endif // !defined(MD_BOOTLOADER) && defined(RGB_MATRIX_ENABLE) void i2c0_init(void) { @@ -112,7 +112,7 @@ void i2c0_stop(void) } } -#ifndef MD_BOOTLOADER +#if !defined(MD_BOOTLOADER) && defined(RGB_MATRIX_ENABLE) void i2c1_init(void) { DBGC(DC_I2C1_INIT_BEGIN); @@ -261,15 +261,16 @@ uint8_t I2C3733_Init_Control(void) { DBGC(DC_I2C3733_INIT_CONTROL_BEGIN); - srdata.bit.SDB_N = 1; - SPI_WriteSRData(); + //Hardware state shutdown on boot + //USB state machine will enable driver when communication is ready + I2C3733_Control_Set(0); - CLK_delay_ms(1); + wait_ms(1); - srdata.bit.IRST = 0; - SPI_WriteSRData(); + sr_exp_data.bit.IRST = 0; + SR_EXP_WriteData(); - CLK_delay_ms(1); + wait_ms(1); DBGC(DC_I2C3733_INIT_CONTROL_COMPLETE); @@ -356,8 +357,8 @@ void I2C3733_Control_Set(uint8_t state) { DBGC(DC_I2C3733_CONTROL_SET_BEGIN); - srdata.bit.SDB_N = (state == 1 ? 1 : 0); - SPI_WriteSRData(); + sr_exp_data.bit.SDB_N = (state == 1 ? 1 : 0); + SR_EXP_WriteData(); DBGC(DC_I2C3733_CONTROL_SET_COMPLETE); } @@ -488,7 +489,7 @@ uint8_t i2c_led_q_request_room(uint8_t request_size) if (i2c_led_q_full >= 100) //Give the queue a chance to clear up { - led_on; + DBG_LED_ON; I2C_DMAC_LED_Init(); i2c_led_q_init(); return 1; @@ -582,4 +583,4 @@ uint8_t i2c_led_q_run(void) return 1; } -#endif //MD_BOOTLOADER +#endif // !defined(MD_BOOTLOADER) && defined(RGB_MATRIX_ENABLE) diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index 7ee1dad224f..42dfccbc50f 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -17,7 +17,16 @@ along with this program. If not, see . #include "arm_atsam_protocol.h" #include "tmk_core/common/led.h" +#include "rgb_matrix.h" #include +#include + +#ifdef USE_MASSDROP_CONFIGURATOR +__attribute__((weak)) +led_instruction_t led_instructions[] = { { .end = 1 } }; +static void led_matrix_massdrop_config_override(int i); +#endif // USE_MASSDROP_CONFIGURATOR + void SERCOM1_0_Handler( void ) { @@ -50,14 +59,17 @@ void DMAC_0_Handler( void ) issi3733_driver_t issidrv[ISSI3733_DRIVER_COUNT]; -issi3733_led_t led_map[ISSI3733_LED_COUNT+1] = ISSI3733_LED_MAP; -issi3733_led_t *lede = led_map + ISSI3733_LED_COUNT; //End pointer of mapping +issi3733_led_t led_map[ISSI3733_LED_COUNT] = ISSI3733_LED_MAP; +RGB led_buffer[ISSI3733_LED_COUNT]; uint8_t gcr_desired; -uint8_t gcr_breathe; -uint8_t gcr_use; uint8_t gcr_actual; uint8_t gcr_actual_last; +#ifdef USE_MASSDROP_CONFIGURATOR +uint8_t gcr_breathe; +float breathe_mult; +float pomod; +#endif #define ACT_GCR_NONE 0 #define ACT_GCR_INC 1 @@ -72,11 +84,14 @@ static uint8_t v_5v_cat_hit; void gcr_compute(void) { uint8_t action = ACT_GCR_NONE; + uint8_t gcr_use = gcr_desired; +#ifdef USE_MASSDROP_CONFIGURATOR if (led_animation_breathing) + { gcr_use = gcr_breathe; - else - gcr_use = gcr_desired; + } +#endif //If the 5v takes a catastrophic hit, disable the LED drivers briefly, assert auto gcr mode, min gcr and let the auto take over if (v_5v < V5_CAT) @@ -150,6 +165,7 @@ void gcr_compute(void) gcr_actual -= LED_GCR_STEP_AUTO; gcr_min_counter = 0; +#ifdef USE_MASSDROP_CONFIGURATOR //If breathe mode is active, the top end can fluctuate if the host can not supply enough current //So set the breathe GCR to where it becomes stable if (led_animation_breathing == 1) @@ -159,12 +175,11 @@ void gcr_compute(void) // and the same would happen maybe one or two more times. Therefore I'm favoring // powering through one full breathe and letting gcr settle completely } +#endif } } } -led_disp_t disp; - void issi3733_prepare_arrays(void) { memset(issidrv,0,sizeof(issi3733_driver_t) * ISSI3733_DRIVER_COUNT); @@ -177,210 +192,294 @@ void issi3733_prepare_arrays(void) issidrv[i].addr = addrs[i]; } - issi3733_led_t *cur = led_map; - - while (cur < lede) + for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) { //BYTE: 1 + (SW-1)*16 + (CS-1) - cur->rgb.g = issidrv[cur->adr.drv-1].pwm + 1 + ((cur->adr.swg-1)*16 + (cur->adr.cs-1)); - cur->rgb.r = issidrv[cur->adr.drv-1].pwm + 1 + ((cur->adr.swr-1)*16 + (cur->adr.cs-1)); - cur->rgb.b = issidrv[cur->adr.drv-1].pwm + 1 + ((cur->adr.swb-1)*16 + (cur->adr.cs-1)); + led_map[i].rgb.g = issidrv[led_map[i].adr.drv-1].pwm + 1 + ((led_map[i].adr.swg-1)*16 + (led_map[i].adr.cs-1)); + led_map[i].rgb.r = issidrv[led_map[i].adr.drv-1].pwm + 1 + ((led_map[i].adr.swr-1)*16 + (led_map[i].adr.cs-1)); + led_map[i].rgb.b = issidrv[led_map[i].adr.drv-1].pwm + 1 + ((led_map[i].adr.swb-1)*16 + (led_map[i].adr.cs-1)); //BYTE: 1 + (SW-1)*2 + (CS-1)/8 //BIT: (CS-1)%8 - *(issidrv[cur->adr.drv-1].onoff + 1 + (cur->adr.swg-1)*2+(cur->adr.cs-1)/8) |= (1<<((cur->adr.cs-1)%8)); - *(issidrv[cur->adr.drv-1].onoff + 1 + (cur->adr.swr-1)*2+(cur->adr.cs-1)/8) |= (1<<((cur->adr.cs-1)%8)); - *(issidrv[cur->adr.drv-1].onoff + 1 + (cur->adr.swb-1)*2+(cur->adr.cs-1)/8) |= (1<<((cur->adr.cs-1)%8)); - - cur++; + *(issidrv[led_map[i].adr.drv-1].onoff + 1 + (led_map[i].adr.swg-1)*2+(led_map[i].adr.cs-1)/8) |= (1<<((led_map[i].adr.cs-1)%8)); + *(issidrv[led_map[i].adr.drv-1].onoff + 1 + (led_map[i].adr.swr-1)*2+(led_map[i].adr.cs-1)/8) |= (1<<((led_map[i].adr.cs-1)%8)); + *(issidrv[led_map[i].adr.drv-1].onoff + 1 + (led_map[i].adr.swb-1)*2+(led_map[i].adr.cs-1)/8) |= (1<<((led_map[i].adr.cs-1)%8)); } } -void disp_calc_extents(void) +void led_matrix_prepare(void) { - issi3733_led_t *cur = led_map; - - disp.left = 1e10; - disp.right = -1e10; - disp.top = -1e10; - disp.bottom = 1e10; - - while (cur < lede) + for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) { - if (cur->x < disp.left) disp.left = cur->x; - if (cur->x > disp.right) disp.right = cur->x; - if (cur->y < disp.bottom) disp.bottom = cur->y; - if (cur->y > disp.top) disp.top = cur->y; - - cur++; + *led_map[i].rgb.r = 0; + *led_map[i].rgb.g = 0; + *led_map[i].rgb.b = 0; } - - disp.width = disp.right - disp.left; - disp.height = disp.top - disp.bottom; } -void disp_pixel_setup(void) +void led_set_one(int i, uint8_t r, uint8_t g, uint8_t b) { - issi3733_led_t *cur = led_map; - - while (cur < lede) + if (i < ISSI3733_LED_COUNT) { - cur->px = (cur->x - disp.left) / disp.width * 100; - cur->py = (cur->y - disp.top) / disp.height * 100; - *cur->rgb.r = 0; - *cur->rgb.g = 0; - *cur->rgb.b = 0; - - cur++; +#ifdef USE_MASSDROP_CONFIGURATOR + led_matrix_massdrop_config_override(i); +#else + led_buffer[i].r = r; + led_buffer[i].g = g; + led_buffer[i].b = b; +#endif } } -void led_matrix_prepare(void) +void led_set_all(uint8_t r, uint8_t g, uint8_t b) { - disp_calc_extents(); - disp_pixel_setup(); + for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) + { + led_set_one(i, r, g, b); + } } -uint8_t led_enabled; -float led_animation_speed; -uint8_t led_animation_direction; -uint8_t led_animation_breathing; -uint8_t led_animation_breathe_cur; -uint8_t breathe_step; -uint8_t breathe_dir; -uint64_t led_next_run; +void init(void) +{ + DBGC(DC_LED_MATRIX_INIT_BEGIN); -uint8_t led_animation_id; -uint8_t led_lighting_mode; + issi3733_prepare_arrays(); -issi3733_led_t *led_cur; -uint8_t led_per_run = 15; -float breathe_mult; + led_matrix_prepare(); + + gcr_min_counter = 0; + v_5v_cat_hit = 0; + + DBGC(DC_LED_MATRIX_INIT_COMPLETE); +} -void led_matrix_run(led_setup_t *f) +void flush(void) { - float ro; - float go; - float bo; - float px; - uint8_t led_this_run = 0; +#ifdef USE_MASSDROP_CONFIGURATOR + if (!led_enabled) { return; } //Prevent calculations and I2C traffic if LED drivers are not enabled +#else + if (!sr_exp_data.bit.SDB_N) { return; } //Prevent calculations and I2C traffic if LED drivers are not enabled +#endif - if (led_cur == 0) //Denotes start of new processing cycle in the case of chunked processing + // Wait for previous transfer to complete + while (i2c_led_q_running) {} + + // Copy buffer to live DMA region + for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) { - led_cur = led_map; + *led_map[i].rgb.r = led_buffer[i].r; + *led_map[i].rgb.g = led_buffer[i].g; + *led_map[i].rgb.b = led_buffer[i].b; + } - disp.frame += 1; +#ifdef USE_MASSDROP_CONFIGURATOR + breathe_mult = 1; - breathe_mult = 1; + if (led_animation_breathing) + { + //+60us 119 LED + led_animation_breathe_cur += BREATHE_STEP * breathe_dir; + + if (led_animation_breathe_cur >= BREATHE_MAX_STEP) + breathe_dir = -1; + else if (led_animation_breathe_cur <= BREATHE_MIN_STEP) + breathe_dir = 1; + + //Brightness curve created for 256 steps, 0 - ~98% + breathe_mult = 0.000015 * led_animation_breathe_cur * led_animation_breathe_cur; + if (breathe_mult > 1) breathe_mult = 1; + else if (breathe_mult < 0) breathe_mult = 0; + } - if (led_animation_breathing) - { - led_animation_breathe_cur += breathe_step * breathe_dir; + //This should only be performed once per frame + pomod = (float)((g_rgb_counters.tick / 10) % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed; + pomod *= 100.0f; + pomod = (uint32_t)pomod % 10000; + pomod /= 100.0f; - if (led_animation_breathe_cur >= BREATHE_MAX_STEP) - breathe_dir = -1; - else if (led_animation_breathe_cur <= BREATHE_MIN_STEP) - breathe_dir = 1; +#endif // USE_MASSDROP_CONFIGURATOR - //Brightness curve created for 256 steps, 0 - ~98% - breathe_mult = 0.000015 * led_animation_breathe_cur * led_animation_breathe_cur; - if (breathe_mult > 1) breathe_mult = 1; - else if (breathe_mult < 0) breathe_mult = 0; - } + uint8_t drvid; + + //NOTE: GCR does not need to be timed with LED processing, but there is really no harm + if (gcr_actual != gcr_actual_last) + { + for (drvid=0;drvidend != 1) { - ro = 0; - go = 0; - bo = 0; + po = pos; //Reset po for new frame - if (led_lighting_mode == LED_MODE_KEYS_ONLY && led_cur->scan == 255) + //Add in any moving effects + if ((!led_animation_direction && f->ef & EF_SCR_R) || (led_animation_direction && (f->ef & EF_SCR_L))) + { + po -= pomod; + + if (po > 100) po -= 100; + else if (po < 0) po += 100; + } + else if ((!led_animation_direction && f->ef & EF_SCR_L) || (led_animation_direction && (f->ef & EF_SCR_R))) { - //Do not act on this LED + po += pomod; + + if (po > 100) po -= 100; + else if (po < 0) po += 100; } - else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && led_cur->scan != 255) + + //Check if LED's po is in current frame + if (po < f->hs) { f++; continue; } + if (po > f->he) { f++; continue; } + //note: < 0 or > 100 continue + + //Calculate the po within the start-stop percentage for color blending + po = (po - f->hs) / (f->he - f->hs); + + //Add in any color effects + if (f->ef & EF_OVER) { - //Do not act on this LED + *ro = (po * (f->re - f->rs)) + f->rs;// + 0.5; + *go = (po * (f->ge - f->gs)) + f->gs;// + 0.5; + *bo = (po * (f->be - f->bs)) + f->bs;// + 0.5; } - else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) + else if (f->ef & EF_SUBTRACT) { - //Do not act on this LED (Only show indicators) + *ro -= (po * (f->re - f->rs)) + f->rs;// + 0.5; + *go -= (po * (f->ge - f->gs)) + f->gs;// + 0.5; + *bo -= (po * (f->be - f->bs)) + f->bs;// + 0.5; } else { - //Act on LED - for (fcur = 0; fcur < fmax; fcur++) - { - px = led_cur->px; - float pxmod; - pxmod = (float)(disp.frame % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed; - - //Add in any moving effects - if ((!led_animation_direction && f[fcur].ef & EF_SCR_R) || (led_animation_direction && (f[fcur].ef & EF_SCR_L))) - { - pxmod *= 100.0f; - pxmod = (uint32_t)pxmod % 10000; - pxmod /= 100.0f; + *ro += (po * (f->re - f->rs)) + f->rs;// + 0.5; + *go += (po * (f->ge - f->gs)) + f->gs;// + 0.5; + *bo += (po * (f->be - f->bs)) + f->bs;// + 0.5; + } - px -= pxmod; + f++; + } +} - if (px > 100) px -= 100; - else if (px < 0) px += 100; - } - else if ((!led_animation_direction && f[fcur].ef & EF_SCR_L) || (led_animation_direction && (f[fcur].ef & EF_SCR_R))) - { - pxmod *= 100.0f; - pxmod = (uint32_t)pxmod % 10000; - pxmod /= 100.0f; - px += pxmod; +static void led_matrix_massdrop_config_override(int i) +{ + float ro = 0; + float go = 0; + float bo = 0; + + float po = (led_animation_orientation) + ? (float)g_led_config.point[i].y / 64.f * 100 + : (float)g_led_config.point[i].x / 224.f * 100; + + uint8_t highest_active_layer = biton32(layer_state); + + if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) { + //Do not act on this LED + } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) { + //Do not act on this LED + } else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) { + //Do not act on this LED (Only show indicators) + } else { + led_instruction_t* led_cur_instruction = led_instructions; + while (!led_cur_instruction->end) { + // Check if this applies to current layer + if ((led_cur_instruction->flags & LED_FLAG_MATCH_LAYER) && + (led_cur_instruction->layer != highest_active_layer)) { + goto next_iter; + } - if (px > 100) px -= 100; - else if (px < 0) px += 100; + // Check if this applies to current index + if (led_cur_instruction->flags & LED_FLAG_MATCH_ID) { + uint8_t modid = i / 32; //Calculate which id# contains the led bit + uint32_t modidbit = 1 << (i % 32); //Calculate the bit within the id# + uint32_t *bitfield = &led_cur_instruction->id0 + modid; //Add modid as offset to id0 address. *bitfield is now idX of the led id + if (~(*bitfield) & modidbit) { //Check if led bit is not set in idX + goto next_iter; } + } - //Check if LED's px is in current frame - if (px < f[fcur].hs) continue; - if (px > f[fcur].he) continue; - //note: < 0 or > 100 continue - - //Calculate the px within the start-stop percentage for color blending - px = (px - f[fcur].hs) / (f[fcur].he - f[fcur].hs); - - //Add in any color effects - if (f[fcur].ef & EF_OVER) - { - ro = (px * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; - go = (px * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; - bo = (px * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; - } - else if (f[fcur].ef & EF_SUBTRACT) - { - ro -= (px * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; - go -= (px * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; - bo -= (px * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; - } - else - { - ro += (px * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; - go += (px * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; - bo += (px * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; - } + if (led_cur_instruction->flags & LED_FLAG_USE_RGB) { + ro = led_cur_instruction->r; + go = led_cur_instruction->g; + bo = led_cur_instruction->b; + } else if (led_cur_instruction->flags & LED_FLAG_USE_PATTERN) { + led_run_pattern(led_setups[led_cur_instruction->pattern_id], &ro, &go, &bo, po); + } else if (led_cur_instruction->flags & LED_FLAG_USE_ROTATE_PATTERN) { + led_run_pattern(led_setups[led_animation_id], &ro, &go, &bo, po); } + + next_iter: + led_cur_instruction++; } - //Clamp values 0-255 if (ro > 255) ro = 255; else if (ro < 0) ro = 0; if (go > 255) go = 255; else if (go < 0) go = 0; if (bo > 255) bo = 255; else if (bo < 0) bo = 0; @@ -391,119 +490,11 @@ void led_matrix_run(led_setup_t *f) go *= breathe_mult; bo *= breathe_mult; } - - *led_cur->rgb.r = (uint8_t)ro; - *led_cur->rgb.g = (uint8_t)go; - *led_cur->rgb.b = (uint8_t)bo; - -#ifdef USB_LED_INDICATOR_ENABLE - if (keyboard_leds()) - { - uint8_t kbled = keyboard_leds(); - if ( - #if USB_LED_NUM_LOCK_SCANCODE != 255 - (led_cur->scan == USB_LED_NUM_LOCK_SCANCODE && kbled & (1<scan == USB_LED_CAPS_LOCK_SCANCODE && kbled & (1<scan == USB_LED_SCROLL_LOCK_SCANCODE && kbled & (1<scan == USB_LED_COMPOSE_SCANCODE && kbled & (1<scan == USB_LED_KANA_SCANCODE && kbled & (1<rgb.r > 127) *led_cur->rgb.r = 0; - else *led_cur->rgb.r = 255; - if (*led_cur->rgb.g > 127) *led_cur->rgb.g = 0; - else *led_cur->rgb.g = 255; - if (*led_cur->rgb.b > 127) *led_cur->rgb.b = 0; - else *led_cur->rgb.b = 255; - } - } -#endif //USB_LED_INDICATOR_ENABLE - - led_cur++; - led_this_run++; } -} -uint8_t led_matrix_init(void) -{ - DBGC(DC_LED_MATRIX_INIT_BEGIN); - - issi3733_prepare_arrays(); - - led_matrix_prepare(); - - disp.frame = 0; - led_next_run = 0; - - led_enabled = 1; - led_animation_id = 0; - led_lighting_mode = LED_MODE_NORMAL; - led_animation_speed = 4.0f; - led_animation_direction = 0; - led_animation_breathing = 0; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_step = 1; - breathe_dir = 1; - - gcr_min_counter = 0; - v_5v_cat_hit = 0; - - //Run led matrix code once for initial LED coloring - led_cur = 0; - led_matrix_run((led_setup_t*)led_setups[led_animation_id]); - - DBGC(DC_LED_MATRIX_INIT_COMPLETE); - - return 0; -} - -#define LED_UPDATE_RATE 10 //ms - -//led data processing can take time, so process data in chunks to free up the processor -//this is done through led_cur and lede -void led_matrix_task(void) -{ - if (led_enabled) - { - //If an update may run and frame processing has completed - if (CLK_get_ms() >= led_next_run && led_cur == lede) - { - uint8_t drvid; - - led_next_run = CLK_get_ms() + LED_UPDATE_RATE; //Set next frame update time - - //NOTE: GCR does not need to be timed with LED processing, but there is really no harm - if (gcr_actual != gcr_actual_last) - { - for (drvid=0;drvid. #ifndef _LED_MATRIX_H_ #define _LED_MATRIX_H_ +#include "quantum.h" + //From keyboard #include "config_led.h" @@ -75,23 +77,20 @@ typedef struct issi3733_led_s { uint8_t scan; //Key scan code from wiring (set 0xFF if no key) } issi3733_led_t; -typedef struct led_disp_s { - uint64_t frame; - float left; - float right; - float top; - float bottom; - float width; - float height; -} led_disp_t; +extern issi3733_driver_t issidrv[ISSI3733_DRIVER_COUNT]; -uint8_t led_matrix_init(void); +extern uint8_t gcr_desired; +extern uint8_t gcr_breathe; +extern uint8_t gcr_actual; +extern uint8_t gcr_actual_last; -#define LED_MODE_NORMAL 0 //Must be 0 -#define LED_MODE_KEYS_ONLY 1 -#define LED_MODE_NON_KEYS_ONLY 2 -#define LED_MODE_INDICATORS_ONLY 3 -#define LED_MODE_MAX_INDEX LED_MODE_INDICATORS_ONLY //Must be highest value +void gcr_compute(void); + +void led_matrix_indicators(void); + +/*------------------------- Legacy Lighting Support ------------------------*/ + +#ifdef USE_MASSDROP_CONFIGURATOR #define EF_NONE 0x00000000 //No effect #define EF_OVER 0x00000001 //Overwrite any previous color information with new @@ -112,31 +111,48 @@ typedef struct led_setup_s { uint8_t end; //Set to signal end of the setup } led_setup_t; -extern issi3733_driver_t issidrv[ISSI3733_DRIVER_COUNT]; +extern const uint8_t led_setups_count; +extern void *led_setups[]; -extern uint8_t gcr_desired; -extern uint8_t gcr_breathe; -extern uint8_t gcr_actual; -extern uint8_t gcr_actual_last; +//LED Extra Instructions +#define LED_FLAG_NULL 0x00 //Matching and coloring not used (default) +#define LED_FLAG_MATCH_ID 0x01 //Match on the ID of the LED (set id#'s to desired bit pattern, first LED is id 1) +#define LED_FLAG_MATCH_LAYER 0x02 //Match on the current active layer (set layer to desired match layer) +#define LED_FLAG_USE_RGB 0x10 //Use a specific RGB value (set r, g, b to desired output color values) +#define LED_FLAG_USE_PATTERN 0x20 //Use a specific pattern ID (set pattern_id to desired output pattern) +#define LED_FLAG_USE_ROTATE_PATTERN 0x40 //Use pattern the user has cycled to manually + +typedef struct led_instruction_s { + uint16_t flags; // Bitfield for LED instructions + uint32_t id0; // Bitwise id, IDs 0-31 + uint32_t id1; // Bitwise id, IDs 32-63 + uint32_t id2; // Bitwise id, IDs 64-95 + uint32_t id3; // Bitwise id, IDs 96-127 + uint8_t layer; + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t pattern_id; + uint8_t end; +} led_instruction_t; + +extern led_instruction_t led_instructions[]; +extern uint8_t led_animation_breathing; extern uint8_t led_animation_id; -extern uint8_t led_enabled; extern float led_animation_speed; extern uint8_t led_lighting_mode; -extern uint8_t led_animation_direction; -extern uint8_t led_animation_breathing; +extern uint8_t led_enabled; extern uint8_t led_animation_breathe_cur; +extern uint8_t led_animation_direction; extern uint8_t breathe_dir; -extern const uint8_t led_setups_count; -extern void *led_setups[]; - -extern issi3733_led_t *led_cur; -extern issi3733_led_t *lede; - -void led_matrix_run(led_setup_t *f); -void led_matrix_task(void); +#define LED_MODE_NORMAL 0 //Must be 0 +#define LED_MODE_KEYS_ONLY 1 +#define LED_MODE_NON_KEYS_ONLY 2 +#define LED_MODE_INDICATORS_ONLY 3 +#define LED_MODE_MAX_INDEX LED_MODE_INDICATORS_ONLY //Must be highest value -void gcr_compute(void); +#endif // USE_MASSDROP_CONFIGURATOR #endif //_LED_MATRIX_H_ diff --git a/tmk_core/protocol/arm_atsam/led_matrix_programs.c b/tmk_core/protocol/arm_atsam/led_matrix_programs.c new file mode 100644 index 00000000000..cf7478dc312 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/led_matrix_programs.c @@ -0,0 +1,123 @@ +/* +Copyright 2018 Massdrop Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifdef USE_MASSDROP_CONFIGURATOR + +#include "led_matrix.h" + +//Teal <-> Salmon +led_setup_t leds_teal_salmon[] = { + { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, + { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, + { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Yellow +led_setup_t leds_yellow[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Off +led_setup_t leds_off[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Red +led_setup_t leds_red[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Green +led_setup_t leds_green[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Blue +led_setup_t leds_blue[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White +led_setup_t leds_white[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White with moving red stripe +led_setup_t leds_white_with_red_stripe[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, + { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, + { .end = 1 }, +}; + +//Black with moving red stripe +led_setup_t leds_black_with_red_stripe[] = { + { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .end = 1 }, +}; + +//Rainbow no scrolling +led_setup_t leds_rainbow_ns[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, + { .end = 1 }, +}; + +//Rainbow scrolling +led_setup_t leds_rainbow_s[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .end = 1 }, +}; + +//Add new LED animations here using one from above as example +//The last entry must be { .end = 1 } +//Add the new animation name to the list below following its format + +void *led_setups[] = { + leds_rainbow_s, + leds_rainbow_ns, + leds_teal_salmon, + leds_yellow, + leds_red, + leds_green, + leds_blue, + leds_white, + leds_white_with_red_stripe, + leds_black_with_red_stripe, + leds_off +}; + +const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); + +#endif diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index 54d056a14ea..0974a230d4c 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -31,6 +31,8 @@ along with this program. If not, see . //From keyboard's directory #include "config_led.h" +uint8_t g_usb_state = USB_FSMSTATUS_FSMSTATE_OFF_Val; //Saved USB state from hardware value to detect changes + void main_subtasks(void); uint8_t keyboard_leds(void); void send_keyboard(report_keyboard_t *report); @@ -155,54 +157,66 @@ void send_consumer(uint16_t data) #endif //EXTRAKEY_ENABLE } -uint8_t g_drvid; - void main_subtask_usb_state(void) { - if (usb_state == USB_STATE_POWERDOWN) + static uint64_t fsmstate_on_delay = 0; //Delay timer to be sure USB is actually operating before bringing up hardware + uint8_t fsmstate_now = USB->DEVICE.FSMSTATUS.reg; //Current state from hardware register + + if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_SUSPEND_Val) //If USB SUSPENDED { - uint32_t timer_led = timer_read32(); + fsmstate_on_delay = 0; //Clear ON delay timer - led_on; - if (led_enabled) + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_SUSPEND_Val) //If previously not SUSPENDED { - for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) - { - I2C3733_Control_Set(0); - } + suspend_power_down(); //Run suspend routine + g_usb_state = fsmstate_now; //Save current USB state } - while (usb_state == USB_STATE_POWERDOWN) + } + else if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_SLEEP_Val) //Else if USB SLEEPING + { + fsmstate_on_delay = 0; //Clear ON delay timer + + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_SLEEP_Val) //If previously not SLEEPING { - if (timer_read32() - timer_led > 1000) led_off; //Good to indicate went to sleep, but only for a second + suspend_power_down(); //Run suspend routine + g_usb_state = fsmstate_now; //Save current USB state } - if (led_enabled) + } + else if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_ON_Val) //Else if USB ON + { + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_ON_Val) //If previously not ON { - for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) + if (fsmstate_on_delay == 0) //If ON delay timer is cleared { - I2C3733_Control_Set(1); + fsmstate_on_delay = timer_read64() + 250; //Set ON delay timer + } + else if (timer_read64() > fsmstate_on_delay) //Else if ON delay timer is active and timed out + { + suspend_wakeup_init(); //Run wakeup routine + g_usb_state = fsmstate_now; //Save current USB state } } - led_off; } -} - -void main_subtask_led(void) -{ - led_matrix_task(); + else //Else if USB is in a state not being tracked + { + fsmstate_on_delay = 0; //Clear ON delay timer + } } void main_subtask_power_check(void) { static uint64_t next_5v_checkup = 0; - if (CLK_get_ms() > next_5v_checkup) + if (timer_read64() > next_5v_checkup) { - next_5v_checkup = CLK_get_ms() + 5; + next_5v_checkup = timer_read64() + 5; v_5v = adc_get(ADC_5V); v_5v_avg = 0.9 * v_5v_avg + 0.1 * v_5v; +#ifdef RGB_MATRIX_ENABLE gcr_compute(); +#endif } } @@ -210,9 +224,9 @@ void main_subtask_usb_extra_device(void) { static uint64_t next_usb_checkup = 0; - if (CLK_get_ms() > next_usb_checkup) + if (timer_read64() > next_usb_checkup) { - next_usb_checkup = CLK_get_ms() + 10; + next_usb_checkup = timer_read64() + 10; USB_HandleExtraDevice(); } @@ -221,15 +235,19 @@ void main_subtask_usb_extra_device(void) void main_subtasks(void) { main_subtask_usb_state(); - main_subtask_led(); main_subtask_power_check(); main_subtask_usb_extra_device(); } int main(void) { - led_ena; - m15_ena; + DBG_LED_ENA; + DBG_1_ENA; + DBG_1_OFF; + DBG_2_ENA; + DBG_2_OFF; + DBG_3_ENA; + DBG_3_OFF; debug_code_init(); @@ -237,9 +255,11 @@ int main(void) ADC0_init(); - SPI_Init(); + SR_EXP_Init(); +#ifdef RGB_MATRIX_ENABLE i2c1_init(); +#endif // RGB_MATRIX_ENABLE matrix_init(); @@ -255,11 +275,9 @@ int main(void) while (USB2422_Port_Detect_Init() == 0) {} - led_off; - m15_off; - - led_matrix_init(); + DBG_LED_OFF; +#ifdef RGB_MATRIX_ENABLE while (I2C3733_Init_Control() != 1) {} while (I2C3733_Init_Drivers() != 1) {} @@ -267,8 +285,9 @@ int main(void) i2c_led_q_init(); - for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) - I2C_LED_Q_ONOFF(g_drvid); //Queue data + for (uint8_t drvid = 0; drvid < ISSI3733_DRIVER_COUNT; drvid++) + I2C_LED_Q_ONOFF(drvid); //Queue data +#endif // RGB_MATRIX_ENABLE keyboard_setup(); @@ -286,14 +305,25 @@ int main(void) while (1) { - keyboard_task(); - main_subtasks(); //Note these tasks will also be run while waiting for USB keyboard polling intervals + if (g_usb_state == USB_FSMSTATUS_FSMSTATE_SUSPEND_Val || g_usb_state == USB_FSMSTATUS_FSMSTATE_SLEEP_Val) + { + if (suspend_wakeup_condition()) + { + udc_remotewakeup(); //Send remote wakeup signal + wait_ms(50); + } + + continue; + } + + keyboard_task(); + #ifdef CONSOLE_ENABLE - if (CLK_get_ms() > next_print) + if (timer_read64() > next_print) { - next_print = CLK_get_ms() + 250; + next_print = timer_read64() + 250; //Add any debug information here that you want to see very often //dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n", v_5v, v_5v_avg, v_5v_avg - V5_LOW, v_5v_avg - V5_HIGH, gcr_actual, gcr_desired); } diff --git a/tmk_core/protocol/arm_atsam/md_bootloader.h b/tmk_core/protocol/arm_atsam/md_bootloader.h index 956145c3132..6b80ef49221 100644 --- a/tmk_core/protocol/arm_atsam/md_bootloader.h +++ b/tmk_core/protocol/arm_atsam/md_bootloader.h @@ -11,7 +11,7 @@ extern uint32_t _erom; //WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support extern uint32_t _eram; #define BOOTLOADER_MAGIC 0x3B9ACA00 -#define MAGIC_ADDR (uint32_t *)(&_eram - 4) +#define MAGIC_ADDR (uint32_t *)((intptr_t)(&_eram) - 4) #endif #ifdef MD_BOOTLOADER @@ -22,4 +22,3 @@ extern uint32_t _eram; #endif //MD_BOOTLOADER #endif //_MD_BOOTLOADER_H_ - diff --git a/tmk_core/protocol/arm_atsam/spi.c b/tmk_core/protocol/arm_atsam/spi.c index 6036a922041..e275ba13f4d 100644 --- a/tmk_core/protocol/arm_atsam/spi.c +++ b/tmk_core/protocol/arm_atsam/spi.c @@ -17,73 +17,70 @@ along with this program. If not, see . #include "arm_atsam_protocol.h" -Srdata_t srdata; +sr_exp_t sr_exp_data; -void SPI_WriteSRData(void) +void SR_EXP_WriteData(void) { - uint16_t timeout; + SR_EXP_RCLK_LO; - SC2_RCLCK_LO; + while (!(SR_EXP_SERCOM->SPI.INTFLAG.bit.DRE)) { DBGC(DC_SPI_WRITE_DRE); } - timeout = 50000; - while (!(SCSPI->SPI.INTFLAG.bit.DRE) && --timeout) { DBGC(DC_SPI_WRITE_DRE); } + SR_EXP_SERCOM->SPI.DATA.bit.DATA = sr_exp_data.reg & 0xFF; //Shift in bits 7-0 + while (!(SR_EXP_SERCOM->SPI.INTFLAG.bit.TXC)) { DBGC(DC_SPI_WRITE_TXC_1); } - SCSPI->SPI.DATA.bit.DATA = srdata.reg & 0xFF; //Shift in bits 7-0 - timeout = 50000; - while (!(SCSPI->SPI.INTFLAG.bit.TXC) && --timeout) { DBGC(DC_SPI_WRITE_TXC_1); } + SR_EXP_SERCOM->SPI.DATA.bit.DATA = (sr_exp_data.reg >> 8) & 0xFF; //Shift in bits 15-8 + while (!(SR_EXP_SERCOM->SPI.INTFLAG.bit.TXC)) { DBGC(DC_SPI_WRITE_TXC_2); } - SCSPI->SPI.DATA.bit.DATA = (srdata.reg >> 8) & 0xFF; //Shift in bits 15-8 - timeout = 50000; - while (!(SCSPI->SPI.INTFLAG.bit.TXC) && --timeout) { DBGC(DC_SPI_WRITE_TXC_2); } - - SC2_RCLCK_HI; + SR_EXP_RCLK_HI; } -void SPI_Init(void) +void SR_EXP_Init(void) { - uint32_t timeout; - DBGC(DC_SPI_INIT_BEGIN); CLK_set_spi_freq(CHAN_SERCOM_SPI, FREQ_SPI_DEFAULT); - PORT->Group[0].PMUX[6].bit.PMUXE = 2; - PORT->Group[0].PMUX[6].bit.PMUXO = 2; - PORT->Group[0].PINCFG[12].bit.PMUXEN = 1; - PORT->Group[0].PINCFG[13].bit.PMUXEN = 1; - - //Configure Shift Registers - SC2_DIRSET; - SC2_RCLCK_HI; - SC2_OE_DIS; - - SCSPI->SPI.CTRLA.bit.DORD = 1; - SCSPI->SPI.CTRLA.bit.CPOL = 1; - SCSPI->SPI.CTRLA.bit.CPHA = 1; - SCSPI->SPI.CTRLA.bit.DIPO = 3; - SCSPI->SPI.CTRLA.bit.MODE = 3; //master - - SCSPI->SPI.CTRLA.bit.ENABLE = 1; - timeout = 50000; - while (SCSPI->SPI.SYNCBUSY.bit.ENABLE && timeout--) { DBGC(DC_SPI_SYNC_ENABLING); } - - srdata.reg = 0; - srdata.bit.HUB_CONNECT = 0; - srdata.bit.HUB_RESET_N = 0; - srdata.bit.S_UP = 0; - srdata.bit.E_UP_N = 1; - srdata.bit.S_DN1 = 1; - srdata.bit.E_DN1_N = 1; - srdata.bit.E_VBUS_1 = 0; - srdata.bit.E_VBUS_2 = 0; - srdata.bit.SRC_1 = 1; - srdata.bit.SRC_2 = 1; - srdata.bit.IRST = 1; - srdata.bit.SDB_N = 0; - SPI_WriteSRData(); - - //Enable register output - SC2_OE_ENA; + //Set up MCU Shift Register pins + PORT->Group[SR_EXP_RCLK_PORT].DIRSET.reg = (1 << SR_EXP_RCLK_PIN); + PORT->Group[SR_EXP_OE_N_PORT].DIRSET.reg = (1 << SR_EXP_OE_N_PIN); + + //Set up MCU SPI pins + PORT->Group[SR_EXP_DATAOUT_PORT].PMUX[SR_EXP_DATAOUT_PIN / 2].bit.SR_EXP_DATAOUT_MUX_SEL = SR_EXP_DATAOUT_MUX; //MUX select for sercom + PORT->Group[SR_EXP_SCLK_PORT].PMUX[SR_EXP_SCLK_PIN / 2].bit.SR_EXP_SCLK_MUX_SEL = SR_EXP_SCLK_MUX; //MUX select for sercom + PORT->Group[SR_EXP_DATAOUT_PORT].PINCFG[SR_EXP_DATAOUT_PIN].bit.PMUXEN = 1; //MUX Enable + PORT->Group[SR_EXP_SCLK_PORT].PINCFG[SR_EXP_SCLK_PIN].bit.PMUXEN = 1; //MUX Enable + + //Initialize Shift Register + SR_EXP_OE_N_DIS; + SR_EXP_RCLK_HI; + + SR_EXP_SERCOM->SPI.CTRLA.bit.DORD = 1; //Data Order - LSB is transferred first + SR_EXP_SERCOM->SPI.CTRLA.bit.CPOL = 1; //Clock Polarity - SCK high when idle. Leading edge of cycle is falling. Trailing rising. + SR_EXP_SERCOM->SPI.CTRLA.bit.CPHA = 1; //Clock Phase - Leading Edge Falling, change, Trailing Edge - Rising, sample + SR_EXP_SERCOM->SPI.CTRLA.bit.DIPO = 3; //Data In Pinout - SERCOM PAD[3] is used as data input (Configure away from DOPO. Not using input.) + SR_EXP_SERCOM->SPI.CTRLA.bit.DOPO = 0; //Data Output PAD[0], Serial Clock PAD[1] + SR_EXP_SERCOM->SPI.CTRLA.bit.MODE = 3; //Operating Mode - Master operation + + SR_EXP_SERCOM->SPI.CTRLA.bit.ENABLE = 1; //Enable - Peripheral is enabled or being enabled + while (SR_EXP_SERCOM->SPI.SYNCBUSY.bit.ENABLE) { DBGC(DC_SPI_SYNC_ENABLING); } + + sr_exp_data.reg = 0; + sr_exp_data.bit.HUB_CONNECT = 0; + sr_exp_data.bit.HUB_RESET_N = 0; + sr_exp_data.bit.S_UP = 0; + sr_exp_data.bit.E_UP_N = 1; + sr_exp_data.bit.S_DN1 = 1; + sr_exp_data.bit.E_DN1_N = 1; + sr_exp_data.bit.E_VBUS_1 = 0; + sr_exp_data.bit.E_VBUS_2 = 0; + sr_exp_data.bit.SRC_1 = 1; + sr_exp_data.bit.SRC_2 = 1; + sr_exp_data.bit.IRST = 1; + sr_exp_data.bit.SDB_N = 0; + SR_EXP_WriteData(); + + //Enable Shift Register output + SR_EXP_OE_N_ENA; DBGC(DC_SPI_INIT_COMPLETE); } diff --git a/tmk_core/protocol/arm_atsam/spi.h b/tmk_core/protocol/arm_atsam/spi.h index 3412dfc3640..4739b775db4 100644 --- a/tmk_core/protocol/arm_atsam/spi.h +++ b/tmk_core/protocol/arm_atsam/spi.h @@ -18,21 +18,28 @@ along with this program. If not, see . #ifndef _SPI_H_ #define _SPI_H_ -//TODO: PS: Should bring ports to keyboard configuration +/* Macros for Shift Register control */ +#define SR_EXP_RCLK_LO PORT->Group[SR_EXP_RCLK_PORT].OUTCLR.reg = (1 << SR_EXP_RCLK_PIN) +#define SR_EXP_RCLK_HI PORT->Group[SR_EXP_RCLK_PORT].OUTSET.reg = (1 << SR_EXP_RCLK_PIN) +#define SR_EXP_OE_N_ENA PORT->Group[SR_EXP_OE_N_PORT].OUTCLR.reg = (1 << SR_EXP_OE_N_PIN) +#define SR_EXP_OE_N_DIS PORT->Group[SR_EXP_OE_N_PORT].OUTSET.reg = (1 << SR_EXP_OE_N_PIN) -#define SCSPI SERCOM2 +/* Determine bits to set for mux selection */ +#if SR_EXP_DATAOUT_PIN % 2 == 0 +#define SR_EXP_DATAOUT_MUX_SEL PMUXE +#else +#define SR_EXP_DATAOUT_MUX_SEL PMUXO +#endif -#define P14_DIR 0x00004000 /* PIN14 DIR Bit */ -#define P14_OUT 0x00004000 /* PIN14 OUT Bit */ -#define P15_DIR 0x00008000 /* PIN15 DIR Bit */ -#define P15_OUT 0x00008000 /* PIN15 OUT Bit */ - -#define SC2_RCLCK_LO REG_PORT_OUTCLR1 = P14_OUT /* PB14 Low, SC2_RCLCK Low */ -#define SC2_RCLCK_HI REG_PORT_OUTSET1 = P14_OUT /* PB14 High, SC2_RCLCK High */ -#define SC2_OE_ENA REG_PORT_OUTCLR1 = P15_OUT /* PB15 Low, SC2_OE_N Low (Shift register enabled) */ -#define SC2_OE_DIS REG_PORT_OUTSET1 = P15_OUT /* PB15 High, SC2_OE_N High (Shift register disabled) */ -#define SC2_DIRSET REG_PORT_DIRSET1 = P14_DIR | P15_DIR; /* PB14 PB15 OUT */ +/* Determine bits to set for mux selection */ +#if SR_EXP_SCLK_PIN % 2 == 0 +#define SR_EXP_SCLK_MUX_SEL PMUXE +#else +#define SR_EXP_SCLK_MUX_SEL PMUXO +#endif +/* Data structure to define Shift Register output expander hardware */ +/* This structure gets shifted into registers LSB first */ typedef union { struct { uint16_t RSVD4:1; /*!< bit: 0 */ @@ -53,11 +60,11 @@ typedef union { uint16_t HUB_CONNECT:1; /*!< bit: 15 SIGNAL VBUS CONNECT TO USB HUB WHEN 1 */ } bit; /*!< Structure used for bit access */ uint16_t reg; /*!< Type used for register access */ -} Srdata_t; +} sr_exp_t; -extern Srdata_t srdata; +extern sr_exp_t sr_exp_data; -void SPI_WriteSRData(void); -void SPI_Init(void); +void SR_EXP_WriteData(void); +void SR_EXP_Init(void); #endif //_SPI_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/compiler.h b/tmk_core/protocol/arm_atsam/usb/compiler.h index d3384398673..b2ccfd73edb 100644 --- a/tmk_core/protocol/arm_atsam/usb/compiler.h +++ b/tmk_core/protocol/arm_atsam/usb/compiler.h @@ -134,6 +134,7 @@ * heuristics and inline the function no matter how big it thinks it * becomes. */ +#if !defined(__always_inline) #if defined(__CC_ARM) # define __always_inline __forceinline #elif (defined __GNUC__) @@ -141,6 +142,7 @@ #elif (defined __ICCARM__) # define __always_inline _Pragma("inline=forced") #endif +#endif /** * \def __no_inline diff --git a/tmk_core/protocol/arm_atsam/usb/udc.h b/tmk_core/protocol/arm_atsam/usb/udc.h index c88a442cb65..33335d1869f 100644 --- a/tmk_core/protocol/arm_atsam/usb/udc.h +++ b/tmk_core/protocol/arm_atsam/usb/udc.h @@ -210,7 +210,7 @@ static inline void udc_detach(void) /*! \brief The USB driver sends a resume signal called \e "Upstream Resume" * This is authorized only when the remote wakeup feature is enabled by host. */ -static inline void udc_remotewakeup(void) +inline void udc_remotewakeup(void) { udd_send_remotewakeup(); } diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c index 5f3c289e812..ffe3526db56 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c @@ -1227,9 +1227,9 @@ uint32_t cdc_tx_send_time_next; void CDC_send(void) { - while (CLK_get_ms() < cdc_tx_send_time_next); + while (timer_read64() < cdc_tx_send_time_next); udi_cdc_tx_send(0); - cdc_tx_send_time_next = CLK_get_ms() + CDC_SEND_INTERVAL; + cdc_tx_send_time_next = timer_read64() + CDC_SEND_INTERVAL; } uint32_t CDC_print(char *printbuf) @@ -1238,7 +1238,7 @@ uint32_t CDC_print(char *printbuf) char *buf = printbuf; char c; - if (CLK_get_ms() < 5000) return 0; + if (timer_read64() < 5000) return 0; while ((c = *buf++) != 0 && !(count >= MAX_PRINT)) { @@ -1339,7 +1339,7 @@ void CDC_init(void) inbuf.count = 0; inbuf.lastcount = 0; printbuf[0] = 0; - cdc_tx_send_time_next = CLK_get_ms() + CDC_SEND_INTERVAL; + cdc_tx_send_time_next = timer_read64() + CDC_SEND_INTERVAL; } #else //CDC line 62 diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c index 18f9784ae68..b715b702658 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -54,6 +54,7 @@ #include "udi_hid.h" #include "udi_hid_kbd.h" #include +#include "report.h" //*************************************************************************** // KBD @@ -108,9 +109,9 @@ UDC_DESC_STORAGE udi_hid_kbd_report_desc_t udi_hid_kbd_report_desc = { 0x81, 0x02, // Input (Data, Variable, Absolute) 0x81, 0x01, // Input (Constant) 0x19, 0x00, // Usage Minimum (0) - 0x29, 0x65, // Usage Maximum (101) + 0x29, 0xFF, // Usage Maximum (255) 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x65, // Logical Maximum (101) + 0x25, 0xFF, // Logical Maximum (255) 0x75, 0x08, // Report Size (8) 0x95, 0x06, // Report Count (6) 0x81, 0x00, // Input (Data, Array) @@ -430,7 +431,7 @@ UDC_DESC_STORAGE udi_hid_exk_report_desc_t udi_hid_exk_report_desc = { 0x05, 0x01, // Usage Page (Generic Desktop), 0x09, 0x80, // Usage (System Control), 0xA1, 0x01, // Collection (Application), - 0x85, 0x02, // Report ID (2) (System), + 0x85, REPORT_ID_SYSTEM, // Report ID (2) (System), 0x16, 0x01, 0x00, // Logical Minimum (1), 0x26, 0x03, 0x00, // Logical Maximum (3), 0x1A, 0x81, 0x00, // Usage Minimum (81) (System Power Down), @@ -445,7 +446,7 @@ UDC_DESC_STORAGE udi_hid_exk_report_desc_t udi_hid_exk_report_desc = { 0x05, 0x0C, // Usage Page (Consumer), 0x09, 0x01, // Usage (Consumer Control), 0xA1, 0x01, // Collection (Application), - 0x85, 0x03, // Report ID (3) (Consumer), + 0x85, REPORT_ID_CONSUMER, // Report ID (3) (Consumer), 0x16, 0x01, 0x00, // Logical Minimum (1), 0x26, 0x9C, 0x02, // Logical Maximum (668), 0x1A, 0x01, 0x00, // Usage Minimum (1), diff --git a/tmk_core/protocol/arm_atsam/usb/ui.c b/tmk_core/protocol/arm_atsam/usb/ui.c index 031678b6432..70a6191098a 100644 --- a/tmk_core/protocol/arm_atsam/usb/ui.c +++ b/tmk_core/protocol/arm_atsam/usb/ui.c @@ -52,8 +52,6 @@ #include "samd51j18a.h" #include "ui.h" -volatile uint8_t usb_state; - //! Sequence process running each \c SEQUENCE_PERIOD ms #define SEQUENCE_PERIOD 150 @@ -72,12 +70,12 @@ static void ui_wakeup_handler(void) void ui_init(void) { - usb_state = USB_STATE_POWERUP; + } void ui_powerdown(void) { - usb_state = USB_STATE_POWERDOWN; + } void ui_wakeup_enable(void) @@ -92,7 +90,7 @@ void ui_wakeup_disable(void) void ui_wakeup(void) { - usb_state = USB_STATE_POWERUP; + } void ui_process(uint16_t framenumber) diff --git a/tmk_core/protocol/arm_atsam/usb/ui.h b/tmk_core/protocol/arm_atsam/usb/ui.h index 3d899e6694d..d1c767d4576 100644 --- a/tmk_core/protocol/arm_atsam/usb/ui.h +++ b/tmk_core/protocol/arm_atsam/usb/ui.h @@ -47,12 +47,6 @@ #ifndef _UI_H_ #define _UI_H_ -extern volatile uint8_t usb_state; - -#define USB_STATE_UNKNOWN 0 -#define USB_STATE_POWERDOWN 1 -#define USB_STATE_POWERUP 2 - //! \brief Initializes the user interface void ui_init(void); diff --git a/tmk_core/protocol/arm_atsam/usb/usb2422.c b/tmk_core/protocol/arm_atsam/usb/usb2422.c index 7c78e41d49a..76ec3aaaa76 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb2422.c +++ b/tmk_core/protocol/arm_atsam/usb/usb2422.c @@ -64,7 +64,7 @@ void USB_write2422_block(void) i2c0_transmit(USB2422_ADDR, dest, 34, 50000); SERCOM0->I2CM.CTRLB.bit.CMD = 0x03; while (SERCOM0->I2CM.SYNCBUSY.bit.SYSOP) { DBGC(DC_USB_WRITE2422_BLOCK_SYNC_SYSOP); } - CLK_delay_us(100); + wait_us(100); } DBGC(DC_USB_WRITE2422_BLOCK_COMPLETE); @@ -77,7 +77,6 @@ void USB2422_init(void) Port *pport = PORT; Oscctrl *posc = OSCCTRL; Usb *pusb = USB; - Srdata_t *pspi = &srdata; DBGC(DC_USB2422_INIT_BEGIN); @@ -132,11 +131,11 @@ void USB2422_init(void) i2c0_init(); //IC2 clk must be high at USB2422 reset release time to signal SMB configuration - pspi->bit.HUB_CONNECT = 1; //connect signal - pspi->bit.HUB_RESET_N = 1; //reset high - SPI_WriteSRData(); + sr_exp_data.bit.HUB_CONNECT = 1; //connect signal + sr_exp_data.bit.HUB_RESET_N = 1; //reset high + SR_EXP_WriteData(); - CLK_delay_us(100); + wait_us(100); #ifndef MD_BOOTLOADER @@ -150,17 +149,14 @@ void USB2422_init(void) void USB_reset(void) { - Srdata_t *pspi = &srdata; - DBGC(DC_USB_RESET_BEGIN); //pulse reset for at least 1 usec - pspi->bit.HUB_RESET_N = 0; //reset low - SPI_WriteSRData(); - CLK_delay_us(1); - pspi->bit.HUB_RESET_N = 1; //reset high to run - SPI_WriteSRData(); - CLK_delay_us(1); + sr_exp_data.bit.HUB_RESET_N = 0; //reset low + SR_EXP_WriteData(); + wait_us(2); + sr_exp_data.bit.HUB_RESET_N = 1; //reset high to run + SR_EXP_WriteData(); DBGC(DC_USB_RESET_COMPLETE); } @@ -241,16 +237,16 @@ void USB_set_host_by_voltage(void) #ifndef MD_BOOTLOADER usb_extra_state = USB_EXTRA_STATE_UNKNOWN; #endif //MD_BOOTLOADER - srdata.bit.SRC_1 = 1; //USBC-1 available for test - srdata.bit.SRC_2 = 1; //USBC-2 available for test - srdata.bit.E_UP_N = 1; //HOST disable - srdata.bit.E_DN1_N = 1; //EXTRA disable - srdata.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O - srdata.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O + sr_exp_data.bit.SRC_1 = 1; //USBC-1 available for test + sr_exp_data.bit.SRC_2 = 1; //USBC-2 available for test + sr_exp_data.bit.E_UP_N = 1; //HOST disable + sr_exp_data.bit.E_DN1_N = 1; //EXTRA disable + sr_exp_data.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O + sr_exp_data.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O - SPI_WriteSRData(); + SR_EXP_WriteData(); - CLK_delay_ms(250); + wait_ms(250); while ((v_5v = adc_get(ADC_5V)) < ADC_5V_START_LEVEL) { DBGC(DC_USB_SET_HOST_5V_LOW_WAITING); } @@ -262,37 +258,37 @@ void USB_set_host_by_voltage(void) if (v_con_1 > v_con_2) { - srdata.bit.S_UP = 0; //HOST to USBC-1 - srdata.bit.S_DN1 = 1; //EXTRA to USBC-2 - srdata.bit.SRC_1 = 1; //HOST on USBC-1 - srdata.bit.SRC_2 = 0; //EXTRA available on USBC-2 + sr_exp_data.bit.S_UP = 0; //HOST to USBC-1 + sr_exp_data.bit.S_DN1 = 1; //EXTRA to USBC-2 + sr_exp_data.bit.SRC_1 = 1; //HOST on USBC-1 + sr_exp_data.bit.SRC_2 = 0; //EXTRA available on USBC-2 - srdata.bit.E_VBUS_1 = 1; //USBC-1 enable full power I/O - srdata.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O + sr_exp_data.bit.E_VBUS_1 = 1; //USBC-1 enable full power I/O + sr_exp_data.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O - SPI_WriteSRData(); + SR_EXP_WriteData(); - srdata.bit.E_UP_N = 0; //HOST enable + sr_exp_data.bit.E_UP_N = 0; //HOST enable - SPI_WriteSRData(); + SR_EXP_WriteData(); usb_host_port = USB_HOST_PORT_1; } else { - srdata.bit.S_UP = 1; //EXTRA to USBC-1 - srdata.bit.S_DN1 = 0; //HOST to USBC-2 - srdata.bit.SRC_1 = 0; //EXTRA available on USBC-1 - srdata.bit.SRC_2 = 1; //HOST on USBC-2 + sr_exp_data.bit.S_UP = 1; //EXTRA to USBC-1 + sr_exp_data.bit.S_DN1 = 0; //HOST to USBC-2 + sr_exp_data.bit.SRC_1 = 0; //EXTRA available on USBC-1 + sr_exp_data.bit.SRC_2 = 1; //HOST on USBC-2 - srdata.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O - srdata.bit.E_VBUS_2 = 1; //USBC-2 enable full power I/O + sr_exp_data.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O + sr_exp_data.bit.E_VBUS_2 = 1; //USBC-2 enable full power I/O - SPI_WriteSRData(); + SR_EXP_WriteData(); - srdata.bit.E_UP_N = 0; //HOST enable + sr_exp_data.bit.E_UP_N = 0; //HOST enable - SPI_WriteSRData(); + SR_EXP_WriteData(); usb_host_port = USB_HOST_PORT_2; } @@ -316,27 +312,27 @@ uint8_t USB2422_Port_Detect_Init(void) USB_set_host_by_voltage(); - port_detect_retry_ms = CLK_get_ms() + PORT_DETECT_RETRY_INTERVAL; + port_detect_retry_ms = timer_read64() + PORT_DETECT_RETRY_INTERVAL; while (!USB_active()) { - tmod = CLK_get_ms() % PORT_DETECT_RETRY_INTERVAL; + tmod = timer_read64() % PORT_DETECT_RETRY_INTERVAL; if (v_con_1 > v_con_2) //Values updated from USB_set_host_by_voltage(); { //1 flash for port 1 detected - if (tmod > 500 && tmod < 600) { led_on; } - else { led_off; } + if (tmod > 500 && tmod < 600) { DBG_LED_ON; } + else { DBG_LED_OFF; } } else if (v_con_2 > v_con_1) //Values updated from USB_set_host_by_voltage(); { //2 flash for port 2 detected - if (tmod > 500 && tmod < 600) { led_on; } - else if (tmod > 700 && tmod < 800) { led_on; } - else { led_off; } + if (tmod > 500 && tmod < 600) { DBG_LED_ON; } + else if (tmod > 700 && tmod < 800) { DBG_LED_ON; } + else { DBG_LED_OFF; } } - if (CLK_get_ms() > port_detect_retry_ms) + if (timer_read64() > port_detect_retry_ms) { DBGC(DC_PORT_DETECT_INIT_FAILED); return 0; @@ -357,20 +353,22 @@ void USB_ExtraSetState(uint8_t state) if (state == USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG) state = USB_EXTRA_STATE_DISABLED; - if (usb_host_port == USB_HOST_PORT_1) srdata.bit.E_VBUS_2 = state; - else if (usb_host_port == USB_HOST_PORT_2) srdata.bit.E_VBUS_1 = state; + if (usb_host_port == USB_HOST_PORT_1) sr_exp_data.bit.E_VBUS_2 = state; + else if (usb_host_port == USB_HOST_PORT_2) sr_exp_data.bit.E_VBUS_1 = state; else return; - srdata.bit.E_DN1_N = !state; - SPI_WriteSRData(); + sr_exp_data.bit.E_DN1_N = !state; + SR_EXP_WriteData(); usb_extra_state = state_save; if (usb_extra_state == USB_EXTRA_STATE_ENABLED) CDC_print("USB: Extra enabled\r\n"); else if (usb_extra_state == USB_EXTRA_STATE_DISABLED) { - CDC_print("USB: Extra disabled\r\n"); - if (led_animation_breathing) gcr_breathe = gcr_desired; + CDC_print("USB: Extra disabled\r\n"); +#ifdef USE_MASSDROP_CONFIGURATOR + if (led_animation_breathing) gcr_breathe = gcr_desired; +#endif } else if (usb_extra_state == USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG) CDC_print("USB: Extra disabled until replug\r\n"); else CDC_print("USB: Extra state unknown\r\n"); diff --git a/tmk_core/protocol/bluefruit/main.c b/tmk_core/protocol/bluefruit/main.c index 0dbb637e2cf..8a6386b4eba 100644 --- a/tmk_core/protocol/bluefruit/main.c +++ b/tmk_core/protocol/bluefruit/main.c @@ -42,13 +42,13 @@ along with this program. If not, see . int main(void) -{ +{ CPU_PRESCALE(0); // DDRD = _BV(PD5); // DDRB = _BV(PB0); - + // PORTD = _BV(PD5); // PORTB = _BV(PB0); @@ -59,22 +59,23 @@ int main(void) // while (!usb_configured()) /* wait */ + keyboard_setup(); dprintf("Initializing keyboard...\n"); keyboard_init(); - + // This implementation is pretty simplistic... if the USB connection // is not configured, choose the Bluefruit, otherwise use USB // Definitely would prefer to have this driven by an input pin and make // it switch dynamically - BCG // if (!usb_configured()) { - + // // Send power to Bluefruit... Adafruit says it takes 27 mA, I think - // // the pins should provide 40 mA, but just in case I switch the + // // the pins should provide 40 mA, but just in case I switch the // // Bluefruit using a transistor - BCG // DDRB = _BV(PB6); // PORTB |= _BV(PB6); - + dprintf("Setting host driver to bluefruit...\n"); host_set_driver(bluefruit_driver()); @@ -131,7 +132,7 @@ int main(void) // usb_remote_wakeup(); // } // } -// keyboard_task(); +// keyboard_task(); // } // } diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 6cceccd23c7..8de55bfe3fd 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -75,7 +75,7 @@ host_driver_t chibios_driver = { void virtser_task(void); #endif -#ifdef RAW_HID_ENABLE +#ifdef RAW_ENABLE void raw_hid_task(void); #endif @@ -113,12 +113,14 @@ int main(void) { chSysInit(); #ifdef STM32_EEPROM_ENABLE - EEPROM_init(); + EEPROM_Init(); #endif // TESTING // chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); + keyboard_setup(); + /* Init USB */ init_usb_driver(&USB_DRIVER); @@ -220,7 +222,7 @@ int main(void) { #ifdef VIRTSER_ENABLE virtser_task(); #endif -#ifdef RAW_HID_ENABLE +#ifdef RAW_ENABLE raw_hid_task(); #endif } diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 71892c4f496..8223d972286 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -95,6 +95,7 @@ static const USBDescriptor *usb_get_descriptor_cb(USBDriver *usbp, uint8_t dtype return &desc; } +#ifndef KEYBOARD_SHARED_EP /* keyboard endpoint state structure */ static USBInEndpointState kbd_ep_state; /* keyboard endpoint initialization structure (IN) */ @@ -110,8 +111,9 @@ static const USBEndpointConfig kbd_ep_config = { 2, /* IN multiplier */ NULL /* SETUP buffer (not a SETUP endpoint) */ }; +#endif -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) /* mouse endpoint state structure */ static USBInEndpointState mouse_ep_state; @@ -128,45 +130,26 @@ static const USBEndpointConfig mouse_ep_config = { 2, /* IN multiplier */ NULL /* SETUP buffer (not a SETUP endpoint) */ }; -#endif /* MOUSE_ENABLE */ - -#ifdef EXTRAKEY_ENABLE -/* extrakey endpoint state structure */ -static USBInEndpointState extra_ep_state; - -/* extrakey endpoint initialization structure (IN) */ -static const USBEndpointConfig extra_ep_config = { - USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ - NULL, /* SETUP packet notification callback */ - extra_in_cb, /* IN notification callback */ - NULL, /* OUT notification callback */ - EXTRAKEY_EPSIZE, /* IN maximum packet size */ - 0, /* OUT maximum packet size */ - &extra_ep_state, /* IN Endpoint state */ - NULL, /* OUT endpoint state */ - 2, /* IN multiplier */ - NULL /* SETUP buffer (not a SETUP endpoint) */ -}; -#endif /* EXTRAKEY_ENABLE */ +#endif -#ifdef NKRO_ENABLE -/* nkro endpoint state structure */ -static USBInEndpointState nkro_ep_state; +#ifdef SHARED_EP_ENABLE +/* shared endpoint state structure */ +static USBInEndpointState shared_ep_state; -/* nkro endpoint initialization structure (IN) */ -static const USBEndpointConfig nkro_ep_config = { +/* shared endpoint initialization structure (IN) */ +static const USBEndpointConfig shared_ep_config = { USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ NULL, /* SETUP packet notification callback */ - nkro_in_cb, /* IN notification callback */ + shared_in_cb, /* IN notification callback */ NULL, /* OUT notification callback */ - NKRO_EPSIZE, /* IN maximum packet size */ + SHARED_EPSIZE, /* IN maximum packet size */ 0, /* OUT maximum packet size */ - &nkro_ep_state, /* IN Endpoint state */ + &shared_ep_state, /* IN Endpoint state */ NULL, /* OUT endpoint state */ 2, /* IN multiplier */ NULL /* SETUP buffer (not a SETUP endpoint) */ }; -#endif /* NKRO_ENABLE */ +#endif typedef struct { size_t queue_capacity_in; @@ -309,16 +292,15 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { case USB_EVENT_CONFIGURED: osalSysLockFromISR(); /* Enable the endpoints specified into the configuration. */ +#ifndef KEYBOARD_SHARED_EP usbInitEndpointI(usbp, KEYBOARD_IN_EPNUM, &kbd_ep_config); -#ifdef MOUSE_ENABLE +#endif +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) usbInitEndpointI(usbp, MOUSE_IN_EPNUM, &mouse_ep_config); -#endif /* MOUSE_ENABLE */ -#ifdef EXTRAKEY_ENABLE - usbInitEndpointI(usbp, EXTRAKEY_IN_EPNUM, &extra_ep_config); -#endif /* EXTRAKEY_ENABLE */ -#ifdef NKRO_ENABLE - usbInitEndpointI(usbp, NKRO_IN_EPNUM, &nkro_ep_config); -#endif /* NKRO_ENABLE */ +#endif +#ifdef SHARED_EP_ENABLE + usbInitEndpointI(usbp, SHARED_IN_EPNUM, &shared_ep_config); +#endif for (int i=0;isetup fields: * 0: bmRequestType (bitmask) @@ -409,42 +402,16 @@ static bool usb_request_hook_cb(USBDriver *usbp) { case HID_GET_REPORT: switch(usbp->setup[4]) { /* LSB(wIndex) (check MSB==0?) */ case KEYBOARD_INTERFACE: -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: -#endif /* NKRO_ENABLE */ usbSetupTransfer(usbp, (uint8_t *)&keyboard_report_sent, sizeof(keyboard_report_sent), NULL); return TRUE; break; -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) case MOUSE_INTERFACE: usbSetupTransfer(usbp, (uint8_t *)&mouse_report_blank, sizeof(mouse_report_blank), NULL); return TRUE; break; -#endif /* MOUSE_ENABLE */ - -#ifdef EXTRAKEY_ENABLE - case EXTRAKEY_INTERFACE: - if(usbp->setup[3] == 1) { /* MSB(wValue) [Report Type] == 1 [Input Report] */ - switch(usbp->setup[2]) { /* LSB(wValue) [Report ID] */ - case REPORT_ID_SYSTEM: - extra_report_blank[0] = REPORT_ID_SYSTEM; - usbSetupTransfer(usbp, (uint8_t *)extra_report_blank, sizeof(extra_report_blank), NULL); - return TRUE; - break; - case REPORT_ID_CONSUMER: - extra_report_blank[0] = REPORT_ID_CONSUMER; - usbSetupTransfer(usbp, (uint8_t *)extra_report_blank, sizeof(extra_report_blank), NULL); - return TRUE; - break; - default: - return FALSE; - } - } else { - return FALSE; - } - break; -#endif /* EXTRAKEY_ENABLE */ +#endif default: usbSetupTransfer(usbp, NULL, 0, NULL); @@ -472,12 +439,25 @@ static bool usb_request_hook_cb(USBDriver *usbp) { case HID_SET_REPORT: switch(usbp->setup[4]) { /* LSB(wIndex) (check MSB==0 and wLength==1?) */ case KEYBOARD_INTERFACE: -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: -#endif /* NKRO_ENABLE */ +#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) + case SHARED_INTERFACE: +#endif /* keyboard_led_stats = * keyboard_led_stats needs be word (or dword), otherwise we get an exception on F0 */ - usbSetupTransfer(usbp, (uint8_t *)&keyboard_led_stats, 1, NULL); + has_report_id = 0; +#if defined(SHARED_EP_ENABLE) + if (usbp->setup[4] == SHARED_INTERFACE) { + has_report_id = 1; + } +#endif + if (usbp->setup[4] == KEYBOARD_INTERFACE && !keyboard_protocol) { + has_report_id = 0; + } + if (has_report_id) { + usbSetupTransfer(usbp, set_report_buf, sizeof(set_report_buf), set_led_transfer_cb); + } else { + usbSetupTransfer(usbp, (uint8_t *)&keyboard_led_stats, 1, NULL); + } return TRUE; break; } @@ -591,20 +571,13 @@ void init_usb_driver(USBDriver *usbp) { * --------------------------------------------------------- */ /* keyboard IN callback hander (a kbd report has made it IN) */ +#ifndef KEYBOARD_SHARED_EP void kbd_in_cb(USBDriver *usbp, usbep_t ep) { /* STUB */ (void)usbp; (void)ep; } - -#ifdef NKRO_ENABLE -/* nkro IN callback hander (a nkro report has made it IN) */ -void nkro_in_cb(USBDriver *usbp, usbep_t ep) { - /* STUB */ - (void)usbp; - (void)ep; -} -#endif /* NKRO_ENABLE */ +#endif /* start-of-frame handler * TODO: i guess it would be better to re-implement using timers, @@ -628,9 +601,9 @@ static void keyboard_idle_timer_cb(void *arg) { } #ifdef NKRO_ENABLE - if(!keymap_config.nkro && keyboard_idle) { + if(!keymap_config.nkro && keyboard_idle && keyboard_protocol) { #else /* NKRO_ENABLE */ - if(keyboard_idle) { + if(keyboard_idle && keyboard_protocol) { #endif /* NKRO_ENABLE */ /* TODO: are we sure we want the KBD_ENDPOINT? */ if(!usbGetTransmitStatusI(usbp, KEYBOARD_IN_EPNUM)) { @@ -661,25 +634,25 @@ void send_keyboard(report_keyboard_t *report) { osalSysUnlock(); #ifdef NKRO_ENABLE - if(keymap_config.nkro) { /* NKRO protocol */ + if(keymap_config.nkro && keyboard_protocol) { /* NKRO protocol */ /* need to wait until the previous packet has made it through */ /* can rewrite this using the synchronous API, then would wait * until *after* the packet has been transmitted. I think * this is more efficient */ /* busy wait, should be short and not very common */ osalSysLock(); - if(usbGetTransmitStatusI(&USB_DRIVER, NKRO_IN_EPNUM)) { + if(usbGetTransmitStatusI(&USB_DRIVER, SHARED_IN_EPNUM)) { /* Need to either suspend, or loop and call unlock/lock during * every iteration - otherwise the system will remain locked, * no interrupts served, so USB not going through as well. * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - osalThreadSuspendS(&(&USB_DRIVER)->epc[NKRO_IN_EPNUM]->in_state->thread); + osalThreadSuspendS(&(&USB_DRIVER)->epc[SHARED_IN_EPNUM]->in_state->thread); } - usbStartTransmitI(&USB_DRIVER, NKRO_IN_EPNUM, (uint8_t *)report, sizeof(report_keyboard_t)); + usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)report, sizeof(struct nkro_report)); osalSysUnlock(); } else #endif /* NKRO_ENABLE */ - { /* boot protocol */ + { /* regular protocol */ /* need to wait until the previous packet has made it through */ /* busy wait, should be short and not very common */ osalSysLock(); @@ -690,7 +663,15 @@ void send_keyboard(report_keyboard_t *report) { * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ osalThreadSuspendS(&(&USB_DRIVER)->epc[KEYBOARD_IN_EPNUM]->in_state->thread); } - usbStartTransmitI(&USB_DRIVER, KEYBOARD_IN_EPNUM, (uint8_t *)report, KEYBOARD_EPSIZE); + uint8_t *data, size; + if (keyboard_protocol) { + data = (uint8_t*)report; + size = KEYBOARD_REPORT_SIZE; + } else { /* boot protocol */ + data = &report->mods; + size = 8; + } + usbStartTransmitI(&USB_DRIVER, KEYBOARD_IN_EPNUM, data, size); osalSysUnlock(); } keyboard_report_sent = *report; @@ -703,11 +684,13 @@ void send_keyboard(report_keyboard_t *report) { #ifdef MOUSE_ENABLE +#ifndef MOUSE_SHARED_EP /* mouse IN callback hander (a mouse report has made it IN) */ void mouse_in_cb(USBDriver *usbp, usbep_t ep) { (void)usbp; (void)ep; } +#endif void send_mouse(report_mouse_t *report) { osalSysLock(); @@ -721,7 +704,7 @@ void send_mouse(report_mouse_t *report) { * every iteration - otherwise the system will remain locked, * no interrupts served, so USB not going through as well. * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[MOUSE_IN_EPNUM]->in_state->thread, MS2ST(10)==MSG_TIMEOUT)) { + if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[MOUSE_IN_EPNUM]->in_state->thread, MS2ST(10))==MSG_TIMEOUT) { osalSysUnlock(); return; } @@ -737,19 +720,24 @@ void send_mouse(report_mouse_t *report) { #endif /* MOUSE_ENABLE */ /* --------------------------------------------------------- - * Extrakey functions + * Shared EP functions * --------------------------------------------------------- */ - -#ifdef EXTRAKEY_ENABLE - -/* extrakey IN callback hander */ -void extra_in_cb(USBDriver *usbp, usbep_t ep) { +#ifdef SHARED_EP_ENABLE +/* shared IN callback hander */ +void shared_in_cb(USBDriver *usbp, usbep_t ep) { /* STUB */ (void)usbp; (void)ep; } +#endif + +/* --------------------------------------------------------- + * Extrakey functions + * --------------------------------------------------------- + */ +#ifdef EXTRAKEY_ENABLE static void send_extra_report(uint8_t report_id, uint16_t data) { osalSysLock(); if(usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { @@ -762,7 +750,7 @@ static void send_extra_report(uint8_t report_id, uint16_t data) { .usage = data }; - usbStartTransmitI(&USB_DRIVER, EXTRAKEY_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t)); + usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t)); osalSysUnlock(); } diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h index 1f7eb12f8db..55e8882cc4b 100644 --- a/tmk_core/protocol/chibios/usb_main.h +++ b/tmk_core/protocol/chibios/usb_main.h @@ -65,6 +65,14 @@ void nkro_in_cb(USBDriver *usbp, usbep_t ep); void mouse_in_cb(USBDriver *usbp, usbep_t ep); #endif /* MOUSE_ENABLE */ +/* --------------- + * Shared EP header + * --------------- + */ + +/* shared IN request callback handler */ +void shared_in_cb(USBDriver *usbp, usbep_t ep); + /* --------------- * Extrakey header * --------------- @@ -72,9 +80,6 @@ void mouse_in_cb(USBDriver *usbp, usbep_t ep); #ifdef EXTRAKEY_ENABLE -/* extrakey IN request callback handler */ -void extra_in_cb(USBDriver *usbp, usbep_t ep); - /* extra report structure */ typedef struct { uint8_t report_id; diff --git a/tmk_core/protocol/lufa/adafruit_ble.cpp b/tmk_core/protocol/lufa/adafruit_ble.cpp index bee6bb2c193..80839731fd5 100644 --- a/tmk_core/protocol/lufa/adafruit_ble.cpp +++ b/tmk_core/protocol/lufa/adafruit_ble.cpp @@ -533,8 +533,7 @@ bool adafruit_ble_enable_keyboard(void) { // Disable command echo static const char kEcho[] PROGMEM = "ATE=0"; // Make the advertised name match the keyboard - static const char kGapDevName[] PROGMEM = - "AT+GAPDEVNAME=" STR(PRODUCT) " " STR(DESCRIPTION); + static const char kGapDevName[] PROGMEM = "AT+GAPDEVNAME=" STR(PRODUCT); // Turn on keyboard support static const char kHidEnOn[] PROGMEM = "AT+BLEHIDEN=1"; diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 95e0b95b2fa..f2ecf246515 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -409,19 +409,21 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup Keyboard HID Report Endpoints */ +#ifndef KEYBOARD_SHARED_EP ConfigSuccess &= ENDPOINT_CONFIG(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, KEYBOARD_EPSIZE, ENDPOINT_BANK_SINGLE); +#endif -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) /* Setup Mouse HID Report Endpoint */ ConfigSuccess &= ENDPOINT_CONFIG(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, MOUSE_EPSIZE, ENDPOINT_BANK_SINGLE); #endif -#ifdef EXTRAKEY_ENABLE - /* Setup Extra HID Report Endpoint */ - ConfigSuccess &= ENDPOINT_CONFIG(EXTRAKEY_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - EXTRAKEY_EPSIZE, ENDPOINT_BANK_SINGLE); +#ifdef SHARED_EP_ENABLE + /* Setup Shared HID Report Endpoint */ + ConfigSuccess &= ENDPOINT_CONFIG(SHARED_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, + SHARED_EPSIZE, ENDPOINT_BANK_SINGLE); #endif #ifdef RAW_ENABLE @@ -442,12 +444,6 @@ void EVENT_USB_Device_ConfigurationChanged(void) #endif #endif -#ifdef NKRO_ENABLE - /* Setup NKRO HID Report Endpoints */ - ConfigSuccess &= ENDPOINT_CONFIG(NKRO_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - NKRO_EPSIZE, ENDPOINT_BANK_SINGLE); -#endif - #ifdef MIDI_ENABLE ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); @@ -512,8 +508,8 @@ void EVENT_USB_Device_ControlRequest(void) // Interface switch (USB_ControlRequest.wIndex) { case KEYBOARD_INTERFACE: -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: +#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) + case SHARED_INTERFACE: #endif Endpoint_ClearSETUP(); @@ -521,7 +517,16 @@ void EVENT_USB_Device_ControlRequest(void) if (USB_DeviceState == DEVICE_STATE_Unattached) return; } - keyboard_led_stats = Endpoint_Read_8(); + + if (Endpoint_BytesInEndpoint() == 2) { + uint8_t report_id = Endpoint_Read_8(); + + if (report_id == REPORT_ID_KEYBOARD || report_id == REPORT_ID_NKRO) { + keyboard_led_stats = Endpoint_Read_8(); + } + } else { + keyboard_led_stats = Endpoint_Read_8(); + } Endpoint_ClearOUT(); Endpoint_ClearStatusStage(); @@ -612,16 +617,20 @@ static void send_keyboard(report_keyboard_t *report) #ifdef MODULE_ADAFRUIT_BLE adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys)); #elif MODULE_RN42 - bluefruit_serial_send(0xFD); - bluefruit_serial_send(0x09); - bluefruit_serial_send(0x01); - for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) { - bluefruit_serial_send(report->raw[i]); - } + bluefruit_serial_send(0xFD); + bluefruit_serial_send(0x09); + bluefruit_serial_send(0x01); + bluefruit_serial_send(report->mods); + bluefruit_serial_send(report->reserved); + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + bluefruit_serial_send(report->keys[i]); + } #else bluefruit_serial_send(0xFD); - for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) { - bluefruit_serial_send(report->raw[i]); + bluefruit_serial_send(report->mods); + bluefruit_serial_send(report->reserved); + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + bluefruit_serial_send(report->keys[i]); } #endif } @@ -632,30 +641,24 @@ static void send_keyboard(report_keyboard_t *report) } /* Select the Keyboard Report Endpoint */ + uint8_t ep = KEYBOARD_IN_EPNUM; + uint8_t size = KEYBOARD_REPORT_SIZE; #ifdef NKRO_ENABLE if (keyboard_protocol && keymap_config.nkro) { - /* Report protocol - NKRO */ - Endpoint_SelectEndpoint(NKRO_IN_EPNUM); - - /* Check if write ready for a polling interval around 1ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(4); - if (!Endpoint_IsReadWriteAllowed()) return; - - /* Write Keyboard Report Data */ - Endpoint_Write_Stream_LE(report, NKRO_EPSIZE, NULL); + ep = SHARED_IN_EPNUM; + size = sizeof(struct nkro_report); } - else #endif - { - /* Boot protocol */ - Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM); - - /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); - if (!Endpoint_IsReadWriteAllowed()) return; + Endpoint_SelectEndpoint(ep); + /* Check if write ready for a polling interval around 10ms */ + while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); + if (!Endpoint_IsReadWriteAllowed()) return; - /* Write Keyboard Report Data */ - Endpoint_Write_Stream_LE(report, KEYBOARD_EPSIZE, NULL); + /* If we're in Boot Protocol, don't send any report ID or other funky fields */ + if (!keyboard_protocol) { + Endpoint_Write_Stream_LE(&report->mods, 8, NULL); + } else { + Endpoint_Write_Stream_LE(report, size, NULL); } /* Finalize the stream transfer to send the last packet */ @@ -718,6 +721,7 @@ static void send_mouse(report_mouse_t *report) */ static void send_system(uint16_t data) { +#ifdef EXTRAKEY_ENABLE uint8_t timeout = 255; if (USB_DeviceState != DEVICE_STATE_Configured) @@ -727,7 +731,7 @@ static void send_system(uint16_t data) .report_id = REPORT_ID_SYSTEM, .usage = data - SYSTEM_POWER_DOWN + 1 }; - Endpoint_SelectEndpoint(EXTRAKEY_IN_EPNUM); + Endpoint_SelectEndpoint(SHARED_IN_EPNUM); /* Check if write ready for a polling interval around 10ms */ while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); @@ -735,6 +739,7 @@ static void send_system(uint16_t data) Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL); Endpoint_ClearIN(); +#endif } /** \brief Send Consumer @@ -743,6 +748,7 @@ static void send_system(uint16_t data) */ static void send_consumer(uint16_t data) { +#ifdef EXTRAKEY_ENABLE uint8_t timeout = 255; uint8_t where = where_to_send(); @@ -786,7 +792,7 @@ static void send_consumer(uint16_t data) .report_id = REPORT_ID_CONSUMER, .usage = data }; - Endpoint_SelectEndpoint(EXTRAKEY_IN_EPNUM); + Endpoint_SelectEndpoint(SHARED_IN_EPNUM); /* Check if write ready for a polling interval around 10ms */ while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); @@ -794,6 +800,7 @@ static void send_consumer(uint16_t data) Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL); Endpoint_ClearIN(); +#endif } diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index cab34467524..589ad23cdd5 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c @@ -47,11 +47,18 @@ /******************************************************************************* * HID Report Descriptors ******************************************************************************/ -const USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] = -{ +#ifdef KEYBOARD_SHARED_EP +const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { +#define SHARED_REPORT_STARTED +#else +const USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] = { +#endif HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ HID_RI_USAGE(8, 0x06), /* Keyboard */ HID_RI_COLLECTION(8, 0x01), /* Application */ +# ifdef KEYBOARD_SHARED_EP + HID_RI_REPORT_ID(8, REPORT_ID_KEYBOARD), +# endif HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ HID_RI_USAGE_MINIMUM(8, 0xE0), /* Keyboard Left Control */ HID_RI_USAGE_MAXIMUM(8, 0xE7), /* Keyboard Right GUI */ @@ -84,14 +91,25 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] = HID_RI_REPORT_SIZE(8, 0x08), HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE), HID_RI_END_COLLECTION(0), + +#ifndef KEYBOARD_SHARED_EP }; +#endif -#ifdef MOUSE_ENABLE -const USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] = -{ +#if defined(MOUSE_ENABLE) + +# if !defined(MOUSE_SHARED_EP) +const USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] = { +# elif !defined(SHARED_REPORT_STARTED) +const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { +#define SHARED_REPORT_STARTED +# endif HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ HID_RI_USAGE(8, 0x02), /* Mouse */ HID_RI_COLLECTION(8, 0x01), /* Application */ +# ifdef MOUSE_SHARED_EP + HID_RI_REPORT_ID(8, REPORT_ID_MOUSE), +# endif HID_RI_USAGE(8, 0x01), /* Pointer */ HID_RI_COLLECTION(8, 0x00), /* Physical */ @@ -133,12 +151,15 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] = HID_RI_END_COLLECTION(0), HID_RI_END_COLLECTION(0), +# ifndef MOUSE_SHARED_EP }; +# endif #endif -#ifdef EXTRAKEY_ENABLE -const USB_Descriptor_HIDReport_Datatype_t PROGMEM ExtrakeyReport[] = -{ +#if defined(SHARED_EP_ENABLE) && !defined(SHARED_REPORT_STARTED) +const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { +#endif +# ifdef EXTRAKEY_ENABLE HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ HID_RI_USAGE(8, 0x80), /* System Control */ HID_RI_COLLECTION(8, 0x01), /* Application */ @@ -164,6 +185,43 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM ExtrakeyReport[] = HID_RI_REPORT_COUNT(8, 1), HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE), HID_RI_END_COLLECTION(0), +# endif + +# ifdef NKRO_ENABLE + HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ + HID_RI_USAGE(8, 0x06), /* Keyboard */ + HID_RI_COLLECTION(8, 0x01), /* Application */ + HID_RI_REPORT_ID(8, REPORT_ID_NKRO), + HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ + HID_RI_USAGE_MINIMUM(8, 0xE0), /* Keyboard Left Control */ + HID_RI_USAGE_MAXIMUM(8, 0xE7), /* Keyboard Right GUI */ + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0x01), + HID_RI_REPORT_COUNT(8, 0x08), + HID_RI_REPORT_SIZE(8, 0x01), + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), + + HID_RI_USAGE_PAGE(8, 0x08), /* LEDs */ + HID_RI_USAGE_MINIMUM(8, 0x01), /* Num Lock */ + HID_RI_USAGE_MAXIMUM(8, 0x05), /* Kana */ + HID_RI_REPORT_COUNT(8, 0x05), + HID_RI_REPORT_SIZE(8, 0x01), + HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), + HID_RI_REPORT_COUNT(8, 0x01), + HID_RI_REPORT_SIZE(8, 0x03), + HID_RI_OUTPUT(8, HID_IOF_CONSTANT), + + HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ + HID_RI_USAGE_MINIMUM(8, 0x00), /* Keyboard 0 */ + HID_RI_USAGE_MAXIMUM(8, KEYBOARD_REPORT_BITS*8-1), + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0x01), + HID_RI_REPORT_COUNT(8, KEYBOARD_REPORT_BITS*8), + HID_RI_REPORT_SIZE(8, 0x01), + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), + HID_RI_END_COLLECTION(0), +# endif +#ifdef SHARED_EP_ENABLE }; #endif @@ -211,42 +269,6 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM ConsoleReport[] = }; #endif -#ifdef NKRO_ENABLE -const USB_Descriptor_HIDReport_Datatype_t PROGMEM NKROReport[] = -{ - HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ - HID_RI_USAGE(8, 0x06), /* Keyboard */ - HID_RI_COLLECTION(8, 0x01), /* Application */ - HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ - HID_RI_USAGE_MINIMUM(8, 0xE0), /* Keyboard Left Control */ - HID_RI_USAGE_MAXIMUM(8, 0xE7), /* Keyboard Right GUI */ - HID_RI_LOGICAL_MINIMUM(8, 0x00), - HID_RI_LOGICAL_MAXIMUM(8, 0x01), - HID_RI_REPORT_COUNT(8, 0x08), - HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), - - HID_RI_USAGE_PAGE(8, 0x08), /* LEDs */ - HID_RI_USAGE_MINIMUM(8, 0x01), /* Num Lock */ - HID_RI_USAGE_MAXIMUM(8, 0x05), /* Kana */ - HID_RI_REPORT_COUNT(8, 0x05), - HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), - HID_RI_REPORT_COUNT(8, 0x01), - HID_RI_REPORT_SIZE(8, 0x03), - HID_RI_OUTPUT(8, HID_IOF_CONSTANT), - - HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ - HID_RI_USAGE_MINIMUM(8, 0x00), /* Keyboard 0 */ - HID_RI_USAGE_MAXIMUM(8, (NKRO_EPSIZE-1)*8-1), /* Keyboard Right GUI */ - HID_RI_LOGICAL_MINIMUM(8, 0x00), - HID_RI_LOGICAL_MAXIMUM(8, 0x01), - HID_RI_REPORT_COUNT(8, (NKRO_EPSIZE-1)*8), - HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), - HID_RI_END_COLLECTION(0), -}; -#endif /******************************************************************************* * Device Descriptors @@ -303,6 +325,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = /* * Keyboard */ +#ifndef KEYBOARD_SHARED_EP .Keyboard_Interface = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, @@ -339,11 +362,12 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointSize = KEYBOARD_EPSIZE, .PollingIntervalMS = 0x0A }, +#endif /* * Mouse */ -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) .Mouse_Interface = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, @@ -383,26 +407,31 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = #endif /* - * Extra + * Shared */ -#ifdef EXTRAKEY_ENABLE - .Extrakey_Interface = +#ifdef SHARED_EP_ENABLE + .Shared_Interface = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = EXTRAKEY_INTERFACE, + .InterfaceNumber = SHARED_INTERFACE, .AlternateSetting = 0x00, .TotalEndpoints = 1, .Class = HID_CSCP_HIDClass, +# ifdef KEYBOARD_SHARED_EP + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_KeyboardBootProtocol, +# else .SubClass = HID_CSCP_NonBootSubclass, .Protocol = HID_CSCP_NonBootProtocol, +#endif .InterfaceStrIndex = NO_DESCRIPTOR }, - .Extrakey_HID = + .Shared_HID = { .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, @@ -410,16 +439,16 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .CountryCode = 0x00, .TotalReportDescriptors = 1, .HIDReportType = HID_DTYPE_Report, - .HIDReportLength = sizeof(ExtrakeyReport) + .HIDReportLength = sizeof(SharedReport) }, - .Extrakey_INEndpoint = + .Shared_INEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | EXTRAKEY_IN_EPNUM), + .EndpointAddress = (ENDPOINT_DIR_IN | SHARED_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = EXTRAKEY_EPSIZE, + .EndpointSize = SHARED_EPSIZE, .PollingIntervalMS = 0x0A }, #endif @@ -528,48 +557,6 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = }, #endif - /* - * NKRO - */ -#ifdef NKRO_ENABLE - .NKRO_Interface = - { - .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - - .InterfaceNumber = NKRO_INTERFACE, - .AlternateSetting = 0x00, - - .TotalEndpoints = 1, - - .Class = HID_CSCP_HIDClass, - .SubClass = HID_CSCP_NonBootSubclass, - .Protocol = HID_CSCP_NonBootProtocol, - - .InterfaceStrIndex = NO_DESCRIPTOR - }, - - .NKRO_HID = - { - .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, - - .HIDSpec = VERSION_BCD(1,1,1), - .CountryCode = 0x00, - .TotalReportDescriptors = 1, - .HIDReportType = HID_DTYPE_Report, - .HIDReportLength = sizeof(NKROReport) - }, - - .NKRO_INEndpoint = - { - .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - - .EndpointAddress = (ENDPOINT_DIR_IN | NKRO_IN_EPNUM), - .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = NKRO_EPSIZE, - .PollingIntervalMS = 0x01 - }, -#endif - #ifdef MIDI_ENABLE .Audio_Interface_Association = { @@ -936,19 +923,21 @@ uint16_t get_usb_descriptor(const uint16_t wValue, break; case HID_DTYPE_HID: switch (wIndex) { +#ifndef KEYBOARD_SHARED_EP case KEYBOARD_INTERFACE: Address = &ConfigurationDescriptor.Keyboard_HID; Size = sizeof(USB_HID_Descriptor_HID_t); break; -#ifdef MOUSE_ENABLE +#endif +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) case MOUSE_INTERFACE: Address = &ConfigurationDescriptor.Mouse_HID; Size = sizeof(USB_HID_Descriptor_HID_t); break; #endif -#ifdef EXTRAKEY_ENABLE - case EXTRAKEY_INTERFACE: - Address = &ConfigurationDescriptor.Extrakey_HID; +#ifdef SHARED_EP_ENABLE + case SHARED_INTERFACE: + Address = &ConfigurationDescriptor.Shared_HID; Size = sizeof(USB_HID_Descriptor_HID_t); break; #endif @@ -963,31 +952,27 @@ uint16_t get_usb_descriptor(const uint16_t wValue, Address = &ConfigurationDescriptor.Console_HID; Size = sizeof(USB_HID_Descriptor_HID_t); break; -#endif -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: - Address = &ConfigurationDescriptor.NKRO_HID; - Size = sizeof(USB_HID_Descriptor_HID_t); - break; #endif } break; case HID_DTYPE_Report: switch (wIndex) { +#ifndef KEYBOARD_SHARED_EP case KEYBOARD_INTERFACE: Address = &KeyboardReport; Size = sizeof(KeyboardReport); break; -#ifdef MOUSE_ENABLE +#endif +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) case MOUSE_INTERFACE: Address = &MouseReport; Size = sizeof(MouseReport); break; #endif -#ifdef EXTRAKEY_ENABLE - case EXTRAKEY_INTERFACE: - Address = &ExtrakeyReport; - Size = sizeof(ExtrakeyReport); +#ifdef SHARED_EP_ENABLE + case SHARED_INTERFACE: + Address = &SharedReport; + Size = sizeof(SharedReport); break; #endif #ifdef RAW_ENABLE @@ -1001,12 +986,6 @@ uint16_t get_usb_descriptor(const uint16_t wValue, Address = &ConsoleReport; Size = sizeof(ConsoleReport); break; -#endif -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: - Address = &NKROReport; - Size = sizeof(NKROReport); - break; #endif } break; diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h index 586d07df627..3ca0c00b34f 100644 --- a/tmk_core/protocol/usb_descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h @@ -53,26 +53,27 @@ typedef struct { USB_Descriptor_Configuration_Header_t Config; +#ifndef KEYBOARD_SHARED_EP // Keyboard HID Interface USB_Descriptor_Interface_t Keyboard_Interface; USB_HID_Descriptor_HID_t Keyboard_HID; USB_Descriptor_Endpoint_t Keyboard_INEndpoint; +#endif -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) // Mouse HID Interface USB_Descriptor_Interface_t Mouse_Interface; USB_HID_Descriptor_HID_t Mouse_HID; USB_Descriptor_Endpoint_t Mouse_INEndpoint; #endif -#ifdef EXTRAKEY_ENABLE - // Extrakey HID Interface - USB_Descriptor_Interface_t Extrakey_Interface; - USB_HID_Descriptor_HID_t Extrakey_HID; - USB_Descriptor_Endpoint_t Extrakey_INEndpoint; +#if defined(SHARED_EP_ENABLE) + USB_Descriptor_Interface_t Shared_Interface; + USB_HID_Descriptor_HID_t Shared_HID; + USB_Descriptor_Endpoint_t Shared_INEndpoint; #endif -#ifdef RAW_ENABLE +#if defined(RAW_ENABLE) // Raw HID Interface USB_Descriptor_Interface_t Raw_Interface; USB_HID_Descriptor_HID_t Raw_HID; @@ -88,13 +89,6 @@ typedef struct USB_Descriptor_Endpoint_t Console_OUTEndpoint; #endif -#ifdef NKRO_ENABLE - // NKRO HID Interface - USB_Descriptor_Interface_t NKRO_Interface; - USB_HID_Descriptor_HID_t NKRO_HID; - USB_Descriptor_Endpoint_t NKRO_INEndpoint; -#endif - #ifdef MIDI_ENABLE USB_Descriptor_Interface_Association_t Audio_Interface_Association; // MIDI Audio Control Interface @@ -133,133 +127,105 @@ typedef struct /* index of interface */ -#define KEYBOARD_INTERFACE 0 - +enum usb_interfaces { +#if !defined(KEYBOARD_SHARED_EP) + KEYBOARD_INTERFACE, +#else +# define KEYBOARD_INTERFACE SHARED_INTERFACE +#endif // It is important that the Raw HID interface is at a constant // interface number, to support Linux/OSX platforms and chrome.hid // If Raw HID is enabled, let it be always 1. -#ifdef RAW_ENABLE -# define RAW_INTERFACE (KEYBOARD_INTERFACE + 1) -#else -# define RAW_INTERFACE KEYBOARD_INTERFACE +#if defined(RAW_ENABLE) + RAW_INTERFACE, #endif - -#ifdef MOUSE_ENABLE -# define MOUSE_INTERFACE (RAW_INTERFACE + 1) -#else -# define MOUSE_INTERFACE RAW_INTERFACE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) + MOUSE_INTERFACE, #endif - -#ifdef EXTRAKEY_ENABLE -# define EXTRAKEY_INTERFACE (MOUSE_INTERFACE + 1) -#else -# define EXTRAKEY_INTERFACE MOUSE_INTERFACE +#if defined(SHARED_EP_ENABLE) + SHARED_INTERFACE, #endif - -#ifdef CONSOLE_ENABLE -# define CONSOLE_INTERFACE (EXTRAKEY_INTERFACE + 1) -#else -# define CONSOLE_INTERFACE EXTRAKEY_INTERFACE -#endif - -#ifdef NKRO_ENABLE -# define NKRO_INTERFACE (CONSOLE_INTERFACE + 1) -#else -# define NKRO_INTERFACE CONSOLE_INTERFACE +#if defined(CONSOLE_ENABLE) + CONSOLE_INTERFACE, #endif - -#ifdef MIDI_ENABLE -# define AC_INTERFACE (NKRO_INTERFACE + 1) -# define AS_INTERFACE (NKRO_INTERFACE + 2) -#else -# define AS_INTERFACE NKRO_INTERFACE +#if defined(MIDI_ENABLE) + AC_INTERFACE, + AS_INTERFACE, #endif - -#ifdef VIRTSER_ENABLE -# define CCI_INTERFACE (AS_INTERFACE + 1) -# define CDI_INTERFACE (AS_INTERFACE + 2) -#else -# define CDI_INTERFACE AS_INTERFACE +#if defined(VIRTSER_ENABLE) + CCI_INTERFACE, + CDI_INTERFACE, #endif + TOTAL_INTERFACES +}; -/* nubmer of interfaces */ -#define TOTAL_INTERFACES (CDI_INTERFACE + 1) - +#define NEXT_EPNUM __COUNTER__ -// Endopoint number and size -#define KEYBOARD_IN_EPNUM 1 - -#ifdef MOUSE_ENABLE -# define MOUSE_IN_EPNUM (KEYBOARD_IN_EPNUM + 1) +enum usb_endpoints { + __unused_epnum__ = NEXT_EPNUM, /* EP numbering starts at 1 */ +#if !defined(KEYBOARD_SHARED_EP) + KEYBOARD_IN_EPNUM = NEXT_EPNUM, #else -# define MOUSE_IN_EPNUM KEYBOARD_IN_EPNUM +# define KEYBOARD_IN_EPNUM SHARED_IN_EPNUM #endif - -#ifdef EXTRAKEY_ENABLE -# define EXTRAKEY_IN_EPNUM (MOUSE_IN_EPNUM + 1) +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) + MOUSE_IN_EPNUM = NEXT_EPNUM, #else -# define EXTRAKEY_IN_EPNUM MOUSE_IN_EPNUM +# define MOUSE_IN_EPNUM SHARED_IN_EPNUM #endif - -#ifdef RAW_ENABLE -# define RAW_IN_EPNUM (EXTRAKEY_IN_EPNUM + 1) -# define RAW_OUT_EPNUM (EXTRAKEY_IN_EPNUM + 2) -#else -# define RAW_OUT_EPNUM EXTRAKEY_IN_EPNUM +#if defined(RAW_ENABLE) + RAW_IN_EPNUM = NEXT_EPNUM, + RAW_OUT_EPNUM = NEXT_EPNUM, #endif - -#ifdef CONSOLE_ENABLE -# define CONSOLE_IN_EPNUM (RAW_OUT_EPNUM + 1) +#if defined(SHARED_EP_ENABLE) + SHARED_IN_EPNUM = NEXT_EPNUM, +#endif +#if defined(CONSOLE_ENABLE) + CONSOLE_IN_EPNUM = NEXT_EPNUM, #ifdef PROTOCOL_CHIBIOS // ChibiOS has enough memory and descriptor to actually enable the endpoint // It could use the same endpoint numbers, as that's supported by ChibiOS // But the QMK code currently assumes that the endpoint numbers are different -# define CONSOLE_OUT_EPNUM (RAW_OUT_EPNUM + 2) + CONSOLE_OUT_EPNUM = NEXT_EPNUM, #else -# define CONSOLE_OUT_EPNUM (RAW_OUT_EPNUM + 1) +#define CONSOLE_OUT_EPNUM CONSOLE_IN_EPNUM #endif -#else -# define CONSOLE_OUT_EPNUM RAW_OUT_EPNUM #endif - -#ifdef NKRO_ENABLE -# define NKRO_IN_EPNUM (CONSOLE_OUT_EPNUM + 1) -#else -# define NKRO_IN_EPNUM CONSOLE_OUT_EPNUM -#endif - #ifdef MIDI_ENABLE -# define MIDI_STREAM_IN_EPNUM (NKRO_IN_EPNUM + 1) -// # define MIDI_STREAM_OUT_EPNUM (NKRO_IN_EPNUM + 1) -# define MIDI_STREAM_OUT_EPNUM (NKRO_IN_EPNUM + 2) + MIDI_STREAM_IN_EPNUM = NEXT_EPNUM, + MIDI_STREAM_OUT_EPNUM = NEXT_EPNUM, # define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM) # define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM) -#else -# define MIDI_STREAM_OUT_EPNUM NKRO_IN_EPNUM #endif - #ifdef VIRTSER_ENABLE -# define CDC_NOTIFICATION_EPNUM (MIDI_STREAM_OUT_EPNUM + 1) -# define CDC_IN_EPNUM (MIDI_STREAM_OUT_EPNUM + 2) -# define CDC_OUT_EPNUM (MIDI_STREAM_OUT_EPNUM + 3) + CDC_NOTIFICATION_EPNUM = NEXT_EPNUM, + CDC_IN_EPNUM = NEXT_EPNUM, + CDC_OUT_EPNUM = NEXT_EPNUM, # define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM) # define CDC_IN_EPADDR (ENDPOINT_DIR_IN | CDC_IN_EPNUM) # define CDC_OUT_EPADDR (ENDPOINT_DIR_OUT | CDC_OUT_EPNUM) -#else -# define CDC_OUT_EPNUM MIDI_STREAM_OUT_EPNUM #endif +}; + +#if defined(PROTOCOL_LUFA) +/* LUFA tells us total endpoints including control */ +#define MAX_ENDPOINTS (ENDPOINT_TOTAL_ENDPOINTS - 1) +#elif defined(PROTOCOL_CHIBIOS) +/* ChibiOS gives us number of available user endpoints, not control */ +#define MAX_ENDPOINTS USB_MAX_ENDPOINTS +#endif +/* TODO - ARM_ATSAM */ + -#if (defined(PROTOCOL_LUFA) && CDC_OUT_EPNUM > (ENDPOINT_TOTAL_ENDPOINTS - 1)) || \ - (defined(PROTOCOL_CHIBIOS) && CDC_OUT_EPNUM > USB_MAX_ENDPOINTS) -# error "There are not enough available endpoints to support all functions. Remove some in the rules.mk file.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, SERIAL, STENO)" +#if (NEXT_EPNUM - 1) > MAX_ENDPOINTS +# error There are not enough available endpoints to support all functions. Remove some in the rules.mk file. (MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, SERIAL, STENO) #endif #define KEYBOARD_EPSIZE 8 +#define SHARED_EPSIZE 32 #define MOUSE_EPSIZE 8 -#define EXTRAKEY_EPSIZE 8 #define RAW_EPSIZE 32 #define CONSOLE_EPSIZE 32 -#define NKRO_EPSIZE 32 #define MIDI_STREAM_EPSIZE 64 #define CDC_NOTIFICATION_EPSIZE 8 #define CDC_EPSIZE 16 diff --git a/tmk_core/protocol/usb_hid/test/config.h b/tmk_core/protocol/usb_hid/test/config.h index c2230fb5705..71a6814fd15 100644 --- a/tmk_core/protocol/usb_hid/test/config.h +++ b/tmk_core/protocol/usb_hid/test/config.h @@ -15,9 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H - +#pragma once #define VENDOR_ID 0xFEED #define PRODUCT_ID 0xCAFE @@ -25,16 +23,8 @@ along with this program. If not, see . #define MANUFACTURER t.m.k. #define PRODUCT USB to USB keyboard converter - #define DESCRIPTION Product from t.m.k. keyboard firmware project - /* matrix size */ #define MATRIX_ROWS 32 #define MATRIX_COLS 8 - - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT))) - -#endif diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index f6a0c7e9a4d..86c2188c878 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c @@ -56,6 +56,7 @@ int main(void) #ifndef NO_UART uart_init(UART_BAUD_RATE); #endif + keyboard_setup(); keyboard_init(); host_set_driver(vusb_driver()); diff --git a/tmk_core/protocol/vusb/usbdrv/usbdrv.c b/tmk_core/protocol/vusb/usbdrv/usbdrv.c index 2e8dd8756b3..30cdc9dcfc9 100644 --- a/tmk_core/protocol/vusb/usbdrv/usbdrv.c +++ b/tmk_core/protocol/vusb/usbdrv/usbdrv.c @@ -95,7 +95,7 @@ const PROGMEM int usbDescriptorStringDevice[] = { #if USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER == 0 && USB_CFG_SERIAL_NUMBER_LEN #undef USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER #define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER sizeof(usbDescriptorStringSerialNumber) -PROGMEM int usbDescriptorStringSerialNumber[] = { +const PROGMEM int usbDescriptorStringSerialNumber[] = { USB_STRING_DESCRIPTOR_HEADER(USB_CFG_SERIAL_NUMBER_LEN), USB_CFG_SERIAL_NUMBER }; diff --git a/tmk_core/protocol/xt_interrupt.c b/tmk_core/protocol/xt_interrupt.c index 3823bbd3acb..8276f96cd3a 100644 --- a/tmk_core/protocol/xt_interrupt.c +++ b/tmk_core/protocol/xt_interrupt.c @@ -41,7 +41,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include "xt.h" #include "wait.h" -#include "print.h" +#include "debug.h" static inline uint8_t pbuf_dequeue(void); static inline void pbuf_enqueue(uint8_t data); @@ -138,7 +138,7 @@ static inline void pbuf_enqueue(uint8_t data) pbuf[pbuf_head] = data; pbuf_head = next; } else { - print("pbuf: full\n"); + dprintf("pbuf: full\n"); } SREG = sreg; } diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index ce3cd83b3f1..e51dbfe7c6a 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -28,12 +28,13 @@ VPATH := # Convert all SRC to OBJ define OBJ_FROM_SRC -$(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$($1_SRC))))) +$(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$(patsubst %.clib,$1/%.a,$($1_SRC)))))) endef $(foreach OUTPUT,$(OUTPUTS),$(eval $(OUTPUT)_OBJ +=$(call OBJ_FROM_SRC,$(OUTPUT)))) # Define a list of all objects OBJ := $(foreach OUTPUT,$(OUTPUTS),$($(OUTPUT)_OBJ)) +NO_LTO_OBJ := $(filter %.a,$(OBJ)) MASTER_OUTPUT := $(firstword $(OUTPUTS)) @@ -47,9 +48,6 @@ FORMAT = ihex # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) OPT = s -AUTOGEN ?= false - - # Compiler flag to set the C Standard level. # c89 = "ANSI" C # gnu89 = c89 plus GCC extensions @@ -81,7 +79,9 @@ CSTANDARD = -std=gnu99 # -Wall...: warning level # -Wa,...: tell GCC to pass this to the assembler. # -adhlns...: create assembler listing -CFLAGS += -g$(DEBUG) +ifndef SKIP_DEBUG_INFO + CFLAGS += -g$(DEBUG) +endif CFLAGS += $(CDEFS) CFLAGS += -O$(OPT) # add color @@ -110,7 +110,9 @@ CFLAGS += $(CSTANDARD) # -Wall...: warning level # -Wa,...: tell GCC to pass this to the assembler. # -adhlns...: create assembler listing -CPPFLAGS += -g$(DEBUG) +ifndef SKIP_DEBUG_INFO + CPPFLAGS += -g$(DEBUG) +endif CPPFLAGS += $(CPPDEFS) CPPFLAGS += -O$(OPT) # to supress "warning: only initialized variables can be placed into program memory area" @@ -137,8 +139,12 @@ CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst) # files -- see avr-libc docs [FIXME: not yet described there] # -listing-cont-lines: Sets the maximum number of continuation lines of hex # dump that will be displayed for a given single line of source input. -ASFLAGS += $(ADEFS) -ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 +ASFLAGS += $(ADEFS) +ifndef SKIP_DEBUG_INFO + ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 +else + ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100 +endif #---------------- Library Options ---------------- # Minimalistic printf version @@ -210,8 +216,17 @@ ALL_CFLAGS = $(MCUFLAGS) $(CFLAGS) $(EXTRAFLAGS) ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(EXTRAFLAGS) ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) +define NO_LTO +$(patsubst %.a,%.o,$1): NOLTO_CFLAGS += -fno-lto +endef +$(foreach LOBJ, $(NO_LTO_OBJ), $(eval $(call NO_LTO,$(LOBJ)))) + MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) +# Add QMK specific flags +DFU_SUFFIX ?= dfu-suffix +DFU_SUFFIX_ARGS ?= + elf: $(BUILD_DIR)/$(TARGET).elf hex: $(BUILD_DIR)/$(TARGET).hex @@ -246,10 +261,6 @@ gccversion : @$(SILENT) || printf "$(MSG_FLASH) $@" | $(AWK_CMD) $(eval CMD=$(HEX) $< $@) @$(BUILD_CMD) - @if $(AUTOGEN); then \ - $(SILENT) || printf "Copying $(TARGET).hex to keymaps/$(KEYMAP)/$(TARGET).hex\n"; \ - $(COPY) $@ $(KEYMAP_PATH)/$(TARGET).hex; \ - fi %.eep: %.elf @$(SILENT) || printf "$(MSG_EEPROM) $@" | $(AWK_CMD) @@ -272,6 +283,10 @@ gccversion : @$(SILENT) || printf "$(MSG_BIN) $@" | $(AWK_CMD) $(eval CMD=$(BIN) $< $@ || exit 0) @$(BUILD_CMD) + if [ ! -z "$(DFU_SUFFIX_ARGS)" ]; then \ + $(DFU_SUFFIX) $(DFU_SUFFIX_ARGS) -a $(BUILD_DIR)/$(TARGET).bin 1>/dev/null ;\ + fi + $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; BEGIN = gccversion sizebefore @@ -283,15 +298,15 @@ BEGIN = gccversion sizebefore @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) $(eval CMD=$(CC) $(ALL_CFLAGS) $(filter-out %.txt,$^) --output $@ $(LDFLAGS)) @$(BUILD_CMD) - + define GEN_OBJRULE $1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC)) ifdef $1_CONFIG $1_CONFIG_FLAGS += $$(patsubst %,-include %,$$($1_CONFIG)) endif -$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) -$1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) +$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS) +$1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS) $1_ASFLAGS= $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) # Compile: create object files from C source files. @@ -321,6 +336,12 @@ $1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN) $$(eval CMD=$$(CC) -c $$($1_ASFLAGS) $$< -o $$@) @$$(BUILD_CMD) +$1/%.a : $1/%.o + @mkdir -p $$(@D) + @$(SILENT) || printf "Archiving: $$<" | $$(AWK_CMD) + $$(eval CMD=$$(AR) rcs $$@ $$<) + @$$(BUILD_CMD) + $1/force: $1/cflags.txt: $1/force @@ -346,12 +367,12 @@ $(MASTER_OUTPUT)/ldflags.txt: $(MASTER_OUTPUT)/force # We have to use static rules for the .d files for some reason -DEPS = $(patsubst %.o,%.d,$(OBJ)) +DEPS = $(patsubst %.o,%.d,$(patsubst %.a,%.o,$(OBJ))) # Keep the .d files .PRECIOUS: $(DEPS) # Empty rule to force recompilation if the .d file is missing $(DEPS): - + $(foreach OUTPUT,$(OUTPUTS),$(eval $(call GEN_OBJRULE,$(OUTPUT)))) @@ -369,19 +390,33 @@ show_path: @echo SRC=$(SRC) @echo OBJ=$(OBJ) +objs-size: + for i in $(OBJ); do echo $$i; done | sort | xargs $(SIZE) + ifeq ($(findstring avr-gcc,$(CC)),avr-gcc) +SIZE_MARGIN = 1024 + check-size: $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) $(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE))) $(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE))) + $(eval PERCENT_SIZE=$(shell expr $(CURRENT_SIZE) \* 100 / $(MAX_SIZE))) if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \ $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ - if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then printf "\n * $(MSG_FILE_TOO_BIG)"; $(PRINT_ERROR_PLAIN); else $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; fi \ + if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then \ + printf "\n * $(MSG_FILE_TOO_BIG)"; $(PRINT_ERROR_PLAIN); \ + else \ + if [ $(FREE_SIZE) -lt $(SIZE_MARGIN) ]; then \ + $(PRINT_WARNING_PLAIN); printf " * $(MSG_FILE_NEAR_LIMIT)"; \ + else \ + $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; \ + fi \ + fi \ fi else check-size: - echo "(Firmware size check does not yet support $(MCU) microprocessors; skipping.)" + $(SILENT) || echo "(Firmware size check does not yet support $(MCU) microprocessors; skipping.)" endif # Create build directory @@ -391,7 +426,7 @@ $(shell mkdir -p $(BUILD_DIR) 2>/dev/null) $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null))) # Include the dependency files. --include $(patsubst %.o,%.d,$(OBJ)) +-include $(patsubst %.o,%.d,$(patsubst %.a,%.o,$(OBJ))) # Listing of phony targets. diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c index 12ee9e7d7d2..79df8c4dea1 100644 --- a/users/333fred/333fred.c +++ b/users/333fred/333fred.c @@ -9,7 +9,7 @@ typedef enum { static tap_dance_state_enum tap_dance_state; static bool tap_dance_active = false; -void tap_dance_layer_finished(qk_tap_dance_state_t *state, void *user_data) { +void tap_dance_sym_vim_finished(qk_tap_dance_state_t *state, void *user_data) { // Determine the current state if (state->count == 1) { if (state->interrupted || state->pressed == 0) tap_dance_state = SINGLE_TAP; @@ -38,8 +38,7 @@ void tap_dance_layer_finished(qk_tap_dance_state_t *state, void *user_data) { } } - -void tap_dance_layer_reset(qk_tap_dance_state_t *state, void *user_data) { +void tap_dance_sym_vim_reset(qk_tap_dance_state_t *state, void *user_data) { switch(tap_dance_state) { case SINGLE_TAP: clear_oneshot_layer_state(ONESHOT_PRESSED); @@ -53,35 +52,71 @@ void tap_dance_layer_reset(qk_tap_dance_state_t *state, void *user_data) { } } +void tap_dance_copy_paste_finished(qk_tap_dance_state_t *state, void *user_data) { + bool is_paste = state->count == 2; + // If either the one-shot shift is set, or if shift is being held, count as shift being held. + // We'll clear the one-shot shift if it was held + uint8_t one_shot_mods = get_oneshot_mods(); + bool is_shift = false; + + if (get_mods() & MOD_MASK_SHIFT) { + is_shift = true; + } else if (one_shot_mods & MOD_MASK_SHIFT) { + set_oneshot_mods(one_shot_mods & ~MOD_MASK_SHIFT); + is_shift = true; + } + + if (is_paste) { + if (is_shift) { + SEND_STRING(SS_LSFT(SS_TAP(X_INSERT))); + } else { + SEND_STRING(SS_LCTRL("v")); + } + } else { + if (is_shift) { + SEND_STRING(SS_LCTRL(SS_TAP(X_INSERT))); + } else { + SEND_STRING(SS_LCTRL("c")); + } + } +} + qk_tap_dance_action_t tap_dance_actions[] = { - [TD_SYM_VIM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_layer_finished, tap_dance_layer_reset) + [TD_SYM_VIM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_sym_vim_finished, tap_dance_sym_vim_reset), + [TD_COPY_PASTE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_copy_paste_finished, NULL) }; -void tap_dance_process_record(uint16_t keycode) { +void tap_dance_process_keycode(uint16_t keycode) { if (tap_dance_state == SINGLE_TAP && keycode != TD(TD_SYM_VIM)) { tap_dance_active = false; } } -__attribute__ ((weak)) -void matrix_init_rgb(void) {} - __attribute__ ((weak)) void layer_state_set_rgb(uint32_t state) {} -__attribute__ ((weak)) -void matrix_scan_user_keyboard(void) {} - -void matrix_scan_user() { - static bool first_run = true; - if (first_run) { - first_run = false; - matrix_init_rgb(); - } - matrix_scan_user_keyboard(); -} - uint32_t layer_state_set_user(uint32_t state) { layer_state_set_rgb(state); return state; } + +bool try_handle_macro(uint16_t keycode, keyrecord_t *record) { + switch (keycode) + { + case DLEFT: + if (record->event.pressed) + SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_LEFT)))); + return true; + case DRIGHT: + if (record->event.pressed) + SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_RIGHT)))); + return true; + case PSCREEN_APP: + if (record->event.pressed) + SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN))); + return true; + + default: + return false; + } +} diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h index 3b6f21133b2..716b61a25c3 100644 --- a/users/333fred/333fred.h +++ b/users/333fred/333fred.h @@ -1,20 +1,30 @@ #pragma once #include "quantum.h" +#include "layout_macros.h" #define BASE 0 #define CODE 1 // code layer -#define SYMB 2 -#define MDIA 3 // media keys -#define VIM 4 -#define GAME 5 -#define GAME_ARROW 6 +#define CODEFLOW 2 +#define SYMB 3 +#define MDIA 4 // media keys +#define VIM 5 +#define GAME 6 +#define GAME_ARROW 7 // Tap dance config shared between my keyboards enum tap_dance_declarations { - TD_SYM_VIM = 0 + TD_SYM_VIM = 0, + TD_COPY_PASTE, }; -void tap_dance_layer_finished(qk_tap_dance_state_t*, void*); -void tap_dance_layer_reset(qk_tap_dance_state_t*, void*); -void tap_dance_process_record(uint16_t); +enum custom_keys { + DLEFT = SAFE_RANGE, + DRIGHT, + PSCREEN_APP +}; + +void tap_dance_sym_vim_finished(qk_tap_dance_state_t*, void*); +void tap_dance_sym_vim_reset(qk_tap_dance_state_t*, void*); +void tap_dance_process_keycode(uint16_t); +bool try_handle_macro(uint16_t keycode, keyrecord_t *record); diff --git a/users/333fred/333fred_config.h b/users/333fred/333fred_config.h index b158e2d5a26..c099072fc7f 100644 --- a/users/333fred/333fred_config.h +++ b/users/333fred/333fred_config.h @@ -1,3 +1,4 @@ #pragma once #define PERMISSIVE_HOLD +#define NO_ACTION_MACRO diff --git a/users/333fred/layout_macros.h b/users/333fred/layout_macros.h new file mode 100644 index 00000000000..3b163f6ce7f --- /dev/null +++ b/users/333fred/layout_macros.h @@ -0,0 +1,44 @@ +#pragma once + +#define SIX_TRNS _______, _______, _______, _______, _______, _______ +#define FOUR_TRNS _______, _______, _______, _______ + +// Row 5: 6 keys +#define ROW5_LEFT_BASE KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5 +#define ROW5_RGHT_BASE KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS +#define ROW5_LEFT_SYMB _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define ROW5_RGHT_SYMB KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 +#define ROW5_LEFT_VIM SIX_TRNS +#define ROW5_RGHT_VIM SIX_TRNS + +// Row 4: 6 keys +#define ROW4_LEFT_BASE KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T +#define ROW4_RGHT_BASE KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS +#define ROW4_LEFT_SYMB _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE +#define ROW4_RGHT_SYMB KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12 +#define ROW4_LEFT_VIM SIX_TRNS +#define ROW4_RGHT_VIM SIX_TRNS + +// Row 3: 6 keys +#define ROW3_LEFT_BASE CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G +#define ROW3_RGHT_BASE KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT +#define ROW3_LEFT_SYMB _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV +#define ROW3_RGHT_SYMB KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______ +#define ROW3_LEFT_VIM _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______ +#define ROW3_RGHT_VIM KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______ + +// Row 2: 6 keys +#define ROW2_LEFT_BASE OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B +#define ROW2_RGHT_BASE KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT) +#define ROW2_LEFT_SYMB _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD +#define ROW2_RGHT_SYMB KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______ +#define ROW2_LEFT_VIM _______, _______, KC_TAB, _______, _______, _______ +#define ROW2_RGHT_VIM SIX_TRNS + +// Row 1: 4 keys +#define ROW1_LEFT_BASE OSM(MOD_LCTL), KC_F4, KC_F5, KC_LALT +#define ROW1_RGHT_BASE KC_DOWN, KC_EQL, KC_RIGHT, KC_RGUI +#define ROW1_LEFT_SYMB _______, _______, _______, _______ +#define ROW1_RGHT_SYMB KC_0, KC_DOT, KC_EQL, _______ +#define ROW1_LEFT_VIM FOUR_TRNS +#define ROW1_RGHT_VIM FOUR_TRNS diff --git a/users/333fred/rgb.c b/users/333fred/rgb.c index a3dfd905cce..c86cd1c77d0 100644 --- a/users/333fred/rgb.c +++ b/users/333fred/rgb.c @@ -1,24 +1,19 @@ #include "quantum.h" #include "333fred.h" -void matrix_init_rgb(void) { - rgblight_enable_noeeprom(); - rgblight_sethsv_noeeprom(270, 255, 20); -} - void layer_state_set_rgb(uint32_t state) { switch (biton32(state)) { case BASE: // purple - rgblight_sethsv_noeeprom(270, 255, 20); + rgblight_sethsv_noeeprom(210, 255, 20); break; case SYMB: // blue - rgblight_sethsv_noeeprom(240, 255, 20); + rgblight_sethsv_noeeprom(191, 255, 20); break; case VIM: // green - rgblight_sethsv_noeeprom(120, 255, 20); + rgblight_sethsv_noeeprom(85, 255, 20); break; case GAME: // red @@ -26,3 +21,8 @@ void layer_state_set_rgb(uint32_t state) { break; } } + +void keyboard_post_init_user(void) { + rgblight_enable_noeeprom(); + layer_state_set_rgb(1); // Set layer 0 (bit 1) on +} diff --git a/users/arkag/arkag.c b/users/arkag/arkag.c index 212d06de67c..9e8c7af247e 100644 --- a/users/arkag/arkag.c +++ b/users/arkag/arkag.c @@ -5,34 +5,7 @@ https://github.com/arkag/qmk_firmware/blob/master/keyboards/mechmini/v2/keymaps/arkag/keymap.c */ -// Start: Written by konstantin: vomindoraan -#include -#include -#include - -void send_unicode_hex_string(const char *str) { - if (!str) { return; } // Saftey net - while (*str) { - // Find the next code point (token) in the string - for (; *str == ' '; str++); - size_t n = strcspn(str, " "); // Length of the current token - char code_point[n+1]; - strncpy(code_point, str, n); - code_point[n] = '\0'; // Make sure it's null-terminated - - // Normalize the code point: make all hex digits lowercase - for (char *p = code_point; *p; p++) { - *p = tolower(*p); - } - - // Send the code point as a Unicode input string - unicode_input_start(); - send_string(code_point); - unicode_input_finish(); - str += n; // Move to the first ' ' (or '\0') after the current token - } -} -// End: Written by konstantin: vomindoraan +#include // Start: Written by Chris Lewis #ifndef MIN @@ -78,6 +51,8 @@ Color underglow, flashState flash_state = no_flash; fadeState fade_state = add_fade; activityState state = boot; +bool aesthetic = false, + shifty = false; void set_color (Color new, bool update) { rgblight_sethsv_eeprom_helper(new.h, new.s, new.v, update); @@ -146,7 +121,7 @@ void check_state (void) { case sleeping: if (!slept) { - rgblight_mode_noeeprom(4); + rgblight_mode_noeeprom(5); slept = true; activated = false; deactivated = false; @@ -249,11 +224,6 @@ void set_os (uint8_t os, bool update) { num_extra_flashes_off = 1; } -void tap_key(uint8_t keycode) { - register_code(keycode); - unregister_code(keycode); -} - // register GUI if Mac or Ctrl if other void pri_mod(bool press) { if (press) { @@ -293,13 +263,13 @@ void surround_type(uint8_t num_of_chars, uint16_t keycode, bool use_shift) { register_code(KC_LSFT); } for (int i = 0; i < num_of_chars; i++) { - tap_key(keycode); + tap_code(keycode); } if (use_shift) { unregister_code(KC_LSFT); } for (int i = 0; i < (num_of_chars/2); i++) { - tap_key(KC_LEFT); + tap_code(KC_LEFT); } } @@ -307,7 +277,7 @@ void long_keystroke(size_t num_of_keys, uint16_t keys[]) { for (int i = 0; i < num_of_keys-1; i++) { register_code(keys[i]); } - tap_key(keys[num_of_keys-1]); + tap_code(keys[num_of_keys-1]); for (int i = 0; i < num_of_keys-1; i++) { unregister_code(keys[i]); } @@ -315,7 +285,10 @@ void long_keystroke(size_t num_of_keys, uint16_t keys[]) { void dance_grv (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - tap_key(KC_GRV); + tap_code(KC_GRV); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { surround_type(2, KC_GRAVE, false); } else { @@ -325,7 +298,10 @@ void dance_grv (qk_tap_dance_state_t *state, void *user_data) { void dance_quot (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - tap_key(KC_QUOT); + tap_code(KC_QUOT); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { surround_type(2, KC_QUOTE, false); } else if (state->count == 3) { @@ -333,35 +309,73 @@ void dance_quot (qk_tap_dance_state_t *state, void *user_data) { } } -void dance_strk (qk_tap_dance_state_t *state, void *user_data) { +void dance_hyph (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - surround_type(4, KC_TILDE, true); + tap_code(KC_MINS); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { - if (current_os == OS_MAC) { - long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4}); - } else if (current_os == OS_WIN) { - long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S}); - } else { - return; + register_code(KC_LSFT); + tap_code(KC_MINS); + if (aesthetic) { + tap_code(KC_SPACE); } + unregister_code(KC_LSFT); + } else if (state->count == 3) { + send_unicode_hex_string("2014"); } } -void dance_3 (qk_tap_dance_state_t *state, void *user_data) { +void dance_obrck (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - tap_key(KC_3); + tap_code(KC_LBRC); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { - send_unicode_hex_string("00E8"); - } else if (state->count == 3) { - send_unicode_hex_string("00E9"); + register_code(KC_LSFT); + tap_code(KC_9); + if (aesthetic) { + tap_code(KC_SPACE); + } + unregister_code(KC_LSFT); } } -void dance_c (qk_tap_dance_state_t *state, void *user_data) { +void dance_cbrck (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - tap_key(KC_C); + tap_code(KC_RBRC); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { - send_unicode_hex_string("00E7"); + register_code(KC_LSFT); + tap_code(KC_0); + if (aesthetic) { + tap_code(KC_SPACE); + } + unregister_code(KC_LSFT); + } +} + +void dance_game (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + + } else if (state->count == 2) { + + } else if (state->count == 3) { + uint8_t layer = biton32(layer_state); + if (layer == _QWERTY) { + layer_off(_QWERTY); + layer_on(_GAMING); + // swirling rgb + rgblight_mode_noeeprom(12); + } else { + layer_off(_GAMING); + layer_on(_QWERTY); + rgblight_mode_noeeprom(1); + } } } @@ -383,13 +397,29 @@ void matrix_scan_user(void) { // begin OS functions SEQ_TWO_KEYS(KC_P, KC_B) { if (current_os == OS_WIN) { - SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_PAUSE) SS_UP(X_LGUI)); + long_keystroke(2, (uint16_t[]){KC_LGUI, KC_PAUSE}); + } else { + return; + } + } + SEQ_TWO_KEYS(KC_LSFT, M_PMOD) { + if (current_os == OS_WIN) { + long_keystroke(3, (uint16_t[]){KC_LCTL, KC_LSFT, KC_ESC}); + } else { + } + } + SEQ_TWO_KEYS(KC_S, KC_S) { + if (current_os == OS_MAC) { + long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4}); + } else if (current_os == OS_WIN) { + long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S}); } else { + return; } } SEQ_THREE_KEYS(KC_C, KC_A, KC_D) { if (current_os == OS_WIN) { - SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) SS_TAP(X_DELETE) SS_UP(X_LALT) SS_UP(X_LCTRL)); + long_keystroke(3, (uint16_t[]){KC_LCTL, KC_LALT, KC_DEL}); } else { } } @@ -415,33 +445,33 @@ void matrix_scan_user(void) { SEQ_ONE_KEY(KC_S) { surround_type(4, KC_GRAVE, true); } - SEQ_TWO_KEYS(KC_S, KC_S) { - if (current_os == OS_MAC) { - long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4}); - } else if (current_os == OS_WIN) { - long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S}); - } else { - return; - } - } SEQ_ONE_KEY(KC_C) { - surround_type(2, KC_GRAVE, false); + send_unicode_hex_string("00E7"); } SEQ_TWO_KEYS(KC_C, KC_C) { + surround_type(2, KC_GRAVE, false); + } + SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { surround_type(6, KC_GRAVE, false); } + SEQ_ONE_KEY(KC_E) { + send_unicode_hex_string("00E8"); + } + SEQ_TWO_KEYS(KC_E, KC_E) { + send_unicode_hex_string("00E9"); + } // end format functions // start fancy functions - SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { + SEQ_THREE_KEYS(KC_C, KC_C, KC_ENT) { surround_type(6, KC_GRAVE, false); pri_mod(true); - tap_key(KC_V); + tap_code(KC_V); pri_mod(false); - tap_key(KC_RGHT); - tap_key(KC_RGHT); - tap_key(KC_RGHT); - tap_key(KC_ENTER); + tap_code(KC_RGHT); + tap_code(KC_RGHT); + tap_code(KC_RGHT); + tap_code(KC_ENTER); } // end fancy functions @@ -450,8 +480,8 @@ void matrix_scan_user(void) { // ™ send_unicode_hex_string("2122"); } - SEQ_THREE_KEYS(KC_G, KC_G, KC_T) { - SEND_STRING("@GrahamGoldenTech.com"); + SEQ_TWO_KEYS(KC_D, KC_D) { + SEND_STRING(".\\Administrator"); } SEQ_THREE_KEYS(KC_L, KC_O, KC_D) { // ಠ__ಠ @@ -482,29 +512,103 @@ void matrix_scan_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (aesthetic) { + switch (keycode) { + case KC_A ... KC_0: + case KC_SPACE ... KC_SLASH: + if (record->event.pressed) { + state = active; + velocikey_accelerate(); + tap_code(keycode); + tap_code(KC_SPACE); + } + return false; + + case KC_BSPACE: + if (record->event.pressed) { + state = active; + velocikey_accelerate(); + tap_code(keycode); + tap_code(keycode); + } + return false; + default: // Do nothing + break; + } + } + + if (shifty) { + switch (keycode) { + case KC_A ... KC_Z: + if (record->event.pressed) { + int shift = rand() % 2; + state = active; + velocikey_accelerate(); + if (shift == 1){ + register_code(KC_LSFT); + } + tap_code(keycode); + if (shift == 1){ + unregister_code(KC_LSFT); + } + } + return false; + case KC_SPC: + if (record->event.pressed) { + state = active; + velocikey_accelerate(); + tap_code(keycode); + } + return false; + default: // Do nothing + break; + } + } + switch (keycode) { case M_PMOD: - if (record->event.pressed) { - pri_mod(true); - } else { - pri_mod(false); - } + pri_mod(record->event.pressed); return false; case M_SMOD: - if (record->event.pressed) { - sec_mod(true); - } else { - sec_mod(false); - } + sec_mod(record->event.pressed); return false; case M_OS: - if (record->event.pressed) { + if (record->event.pressed){ set_os((current_os+1) % _OS_COUNT, true); } + return false; + case M_SPC: + if(record->event.pressed){ + if (aesthetic) { + aesthetic = false; + rgblight_mode_noeeprom(1); + } else { + aesthetic = true; + shifty = false; + // snake mode + rgblight_mode_noeeprom(20); + } + return false; + } + + case M_SFT: + if(record->event.pressed){ + if (shifty) { + shifty = false; + rgblight_mode_noeeprom(1); + } else { + shifty = true; + aesthetic = false; + // knight mode + rgblight_mode_noeeprom(23); + } + return false; + } + default: if (record->event.pressed) { state = active; @@ -516,13 +620,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { //Tap Dance Definitions qk_tap_dance_action_t tap_dance_actions[] = { - [TD_3_GRV_ACT] = ACTION_TAP_DANCE_FN (dance_3), - [TD_C_CED] = ACTION_TAP_DANCE_FN (dance_c), [TD_GRV_3GRV] = ACTION_TAP_DANCE_FN (dance_grv), [TD_SING_DOUB] = ACTION_TAP_DANCE_FN (dance_quot), - [TD_STRK_SHOT] = ACTION_TAP_DANCE_FN (dance_strk), - [TD_HYPH_UNDR] = ACTION_TAP_DANCE_DOUBLE (KC_MINS, LSFT(KC_MINS)), - [TD_BRCK_PARN_O] = ACTION_TAP_DANCE_DOUBLE (KC_LBRC, LSFT(KC_9)), - [TD_BRCK_PARN_C] = ACTION_TAP_DANCE_DOUBLE (KC_RBRC, LSFT(KC_0)), + [TD_HYPH_UNDR] = ACTION_TAP_DANCE_FN (dance_hyph), + [TD_BRCK_PARN_O] = ACTION_TAP_DANCE_FN (dance_obrck), + [TD_BRCK_PARN_C] = ACTION_TAP_DANCE_FN (dance_cbrck), [TD_LALT_RALT] = ACTION_TAP_DANCE_DOUBLE (KC_LALT, KC_RALT), + [TD_GAME] = ACTION_TAP_DANCE_FN (dance_game), }; diff --git a/users/arkag/arkag.h b/users/arkag/arkag.h index a4672a8e82e..fdc4a5fee64 100644 --- a/users/arkag/arkag.h +++ b/users/arkag/arkag.h @@ -14,12 +14,13 @@ #define STRIKE TD(TD_STRK_SHOT) #define HYPHEN TD(TD_HYPH_UNDR) #define CEDILLA TD(TD_C_CED) +#define GAME TD(TD_GAME) #define RAISE MO(1) #define LOWER MO(2) -#define KEEB MO(3) -#define MEDIA MO(4) -#define LAZY MO(5) +#define MEDIA MO(3) +#define FUNCT MO(4) +#define KEEB MO(5) #define MOD_CTL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) #define MOD_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) @@ -37,9 +38,10 @@ enum { _QWERTY = 0, _RAISE, _LOWER, - _KEEB, _MEDIA, - _LAZY, + _FUNCT, + _KEEB, + _GAMING, }; typedef enum { @@ -76,22 +78,9 @@ typedef enum { enum custom_keycodes { M_PMOD = SAFE_RANGE, M_SMOD, - M_P_B, - M_C_A_D, - M_CALC, M_OS, - M_TF, - M_TM, - M_GGT, - M_LOD, - M_LENNY, - M_BOLD, - M_ITAL, - M_ULIN, - M_SNIPT, - M_REPO, - M_SHRUG, - M_UF, + M_SFT, + M_SPC, }; enum tapdances { @@ -101,16 +90,13 @@ enum tapdances { TD_SLSH_HTTP, TD_SING_DOUB, TD_HYPH_UNDR, - TD_STRK_SHOT, TD_SPECIAL, TD_BRCK_PARN_O, TD_BRCK_PARN_C, TD_LALT_RALT, - SPC_SFT_NSFT, + TD_GAME, }; -void send_unicode_hex_string(const char *str); - void velocikey_accelerate(void); void velocikey_decelerate(void); uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue); @@ -146,6 +132,7 @@ void dance_quot (qk_tap_dance_state_t *state, void *user_data); void dance_strk (qk_tap_dance_state_t *state, void *user_data); void dance_3 (qk_tap_dance_state_t *state, void *user_data); void dance_c (qk_tap_dance_state_t *state, void *user_data); +void dance_game (qk_tap_dance_state_t *state, void *user_data); int cur_dance (qk_tap_dance_state_t *state); void spc_finished (qk_tap_dance_state_t *state, void *user_data); diff --git a/users/arkag/config.h b/users/arkag/config.h index 2e0a9ad0199..5a89a18f60f 100644 --- a/users/arkag/config.h +++ b/users/arkag/config.h @@ -1,6 +1,6 @@ #pragma once #define TAPPING_TERM 200 -#define LEADER_TIMEOUT 250 +#define LEADER_TIMEOUT 300 #define LEADER_PER_KEY_TIMING diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 86b781d788e..3a405f2a47c 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -3,8 +3,6 @@ #include "quantum.h" -// Use 7 wide characters for keymaps -#define _______ KC_TRNS #define XXX KC_NO // Layers diff --git a/users/bcat/config.h b/users/bcat/config.h new file mode 100644 index 00000000000..7d420089556 --- /dev/null +++ b/users/bcat/config.h @@ -0,0 +1,36 @@ +/* Delay between tap_code register and unregister to fix flaky media keys. */ +#undef TAP_CODE_DELAY + +#define TAP_CODE_DELAY 10 + +/* Turn off RGB lighting when the host goes to sleep. */ +#define RGBLIGHT_SLEEP + +/* Keep backlight and RGB level increments consistent across keyboards. */ +#undef BACKLIGHT_LEVELS +#undef RGBLIGHT_HUE_STEP +#undef RGBLIGHT_SAT_STEP +#undef RGBLIGHT_VAL_STEP + +#define BACKLIGHT_LEVELS 7 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* Make mouse operation smoother. */ +#undef MOUSEKEY_DELAY +#undef MOUSEKEY_INTERVAL + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 + +/* Lower mouse speed to adjust for reduced MOUSEKEY_INTERVAL. */ +#undef MOUSEKEY_MAX_SPEED +#undef MOUSEKEY_TIME_TO_MAX +#undef MOUSEKEY_WHEEL_MAX_SPEED +#undef MOUSEKEY_WHEEL_TIME_TO_MAX + +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 150 +#define MOUSEKEY_WHEEL_MAX_SPEED 3 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 150 diff --git a/users/bcat/rules.mk b/users/bcat/rules.mk new file mode 100644 index 00000000000..59f82709ad3 --- /dev/null +++ b/users/bcat/rules.mk @@ -0,0 +1,11 @@ +# Enable Bootmagic Lite to consistently reset to bootloader and clear EEPROM. +BOOTMAGIC_ENABLE = lite + +# Enable mouse and media keys on all keyboards. +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes + +# Disable some unwanted features on all keyboards. +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +NKRO_ENABLE = no diff --git a/users/billypython/billypython.c b/users/billypython/billypython.c new file mode 100644 index 00000000000..7bdfe33a43c --- /dev/null +++ b/users/billypython/billypython.c @@ -0,0 +1,32 @@ +#include "billypython.h" + +__attribute__((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keymap(keycode, record)) { + return false; + } + + switch (keycode) { + case CLEAR: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + } + return false; + + default: + return true; + } +} + +__attribute__((weak)) +uint32_t layer_state_set_keymap(uint32_t state) { + return state; +} + +uint32_t layer_state_set_user(uint32_t state) { + return layer_state_set_keymap(state); +} diff --git a/users/billypython/billypython.h b/users/billypython/billypython.h new file mode 100644 index 00000000000..4a444e97870 --- /dev/null +++ b/users/billypython/billypython.h @@ -0,0 +1,34 @@ +#pragma once + +#include "quantum.h" + +#ifdef TAP_DANCE_ENABLE + #include "tap_dance.h" +#endif + +#ifdef LAYER_FN + #define FN MO(L_FN) + #define FN_CAPS LT(L_FN, KC_CAPS) + #define FN_FNLK TT(L_FN) +#endif + +#define TOP LCTL(KC_HOME) +#define BOTTOM LCTL(KC_END) + +enum keycodes_user { + CLEAR = SAFE_RANGE, + + RANGE_KEYMAP, +}; + +enum layers_user { + L_BASE, +#ifdef LAYER_FN + L_FN, +#endif + + L_RANGE_KEYMAP, +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +uint32_t layer_state_set_keymap(uint32_t state); diff --git a/users/billypython/config.h b/users/billypython/config.h new file mode 100644 index 00000000000..4609adbbeaf --- /dev/null +++ b/users/billypython/config.h @@ -0,0 +1,17 @@ +#pragma once + +#define FORCE_NKRO + +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 + +#define NO_ACTION_FUNCTION +#define NO_ACTION_MACRO + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 diff --git a/users/billypython/rules.mk b/users/billypython/rules.mk new file mode 100644 index 00000000000..915323b4998 --- /dev/null +++ b/users/billypython/rules.mk @@ -0,0 +1,6 @@ +SRC += billypython.c +ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) + SRC += tap_dance.c +endif + +EXTRAFLAGS += -flto diff --git a/users/billypython/tap_dance.c b/users/billypython/tap_dance.c new file mode 100644 index 00000000000..74ae166393f --- /dev/null +++ b/users/billypython/tap_dance.c @@ -0,0 +1,33 @@ +#include "tap_dance.h" + +#define ACTION_TAP_DANCE_DOUBLE_MODS(mod1, mod2) { \ + .fn = { td_double_mods_each, NULL, td_double_mods_reset }, \ + .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \ + } + +void td_double_mods_each(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data; + // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 + if (state->count == 1 || state->count == 3) { + register_code(mods->kc1); + } else if (state->count == 2) { + unregister_code(mods->kc1); + register_code(mods->kc2); + } + // Prevent tap dance from sending kc1 and kc2 as weak mods + state->weak_mods &= ~(MOD_BIT(mods->kc1) | MOD_BIT(mods->kc2)); +} + +void td_double_mods_reset(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data; + if (state->count == 1 || state->count >= 3) { + unregister_code(mods->kc1); + } + if (state->count >= 2) { + unregister_code(mods->kc2); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RSFT, KC_RCTL), +}; diff --git a/users/billypython/tap_dance.h b/users/billypython/tap_dance.h new file mode 100644 index 00000000000..25819814144 --- /dev/null +++ b/users/billypython/tap_dance.h @@ -0,0 +1,9 @@ +#pragma once + +#include "quantum.h" + +#define RSF_RCT TD(TD_RSF_RCT) + +enum tap_dance { + TD_RSF_RCT, +}; diff --git a/users/bocaj/bocaj.c b/users/bocaj/bocaj.c index 6df6e3bbfa2..689dbe7b4e3 100644 --- a/users/bocaj/bocaj.c +++ b/users/bocaj/bocaj.c @@ -1,14 +1,30 @@ +/* +Copyright 2018 Jacob Jerrell @JacobJerrell + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + #include "bocaj.h" -#include "eeprom.h" -#include "version.h" -#include "tap_dances.h" -static uint16_t copy_paste_timer; userspace_config_t userspace_config; +#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + #define BOCAJ_UNICODE_MODE UC_OSX +#else + // set to 2 for UC_WIN, set to 4 for UC_WINC + #define BOCAJ_UNICODE_MODE 2 +#endif -/* *** *** *** *** * - * Helper Functions * - * *** *** *** *** */ void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; // Add reconfigurable functions here, for keymap customization @@ -36,10 +52,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { } __attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} - +void matrix_scan_secrets(void) {} __attribute__ ((weak)) uint32_t layer_state_set_keymap (uint32_t state) { @@ -57,7 +70,14 @@ void led_set_keymap(uint8_t usb_led) {} // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { - userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE); + userspace_config.raw = eeconfig_read_user(); + + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(BOCAJ_UNICODE_MODE); + get_unicode_input_mode(); + #endif //UNICODE_ENABLE + + matrix_init_keymap(); } @@ -78,6 +98,18 @@ void suspend_wakeup_init_user(void) #endif } +void eeconfig_init_user(void) { + userspace_config.raw = 0; + eeconfig_update_user(userspace_config.raw); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(BOCAJ_UNICODE_MODE); + get_unicode_input_mode(); + #else + eeprom_update_byte(EECONFIG_UNICODEMODE, BOCAJ_UNICODE_MODE); + #endif +} + +LEADER_EXTERNS(); // No global matrix scan code, so just run keymap's matrix // scan function void matrix_scan_user(void) { @@ -86,6 +118,68 @@ void matrix_scan_user(void) { has_ran_yet = true; startup_user(); } + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + // Mac Save (Leader -> s) + SEQ_ONE_KEY(KC_S) { + SEND_STRING(SS_LGUI("s")); + } + + // Mac copy line down (Leader -> d, d) + SEQ_TWO_KEYS(KC_D, KC_D) { + register_code(KC_LSHIFT); + register_code(KC_HOME); + unregister_code(KC_HOME); + unregister_code(KC_LSHIFT); + SEND_STRING(SS_LGUI("c")); + tap(KC_END); + tap(KC_ENTER); + SEND_STRING(SS_LGUI("v")); + } + + // Mac copy line up (Leader -> u, u) + SEQ_TWO_KEYS(KC_U, KC_U) { + register_code(KC_LSHIFT); + register_code(KC_HOME); + unregister_code(KC_HOME); + unregister_code(KC_LSHIFT); + SEND_STRING(SS_LGUI("c")); + tap(KC_UP); + tap(KC_END); + tap(KC_ENTER); + SEND_STRING(SS_LGUI("v")); + } + + // Mac VS Debug + SEQ_ONE_KEY(KC_D) { + tap(KC_F5); + } + + // Mac VS Stop Debug + SEQ_TWO_KEYS(KC_S, KC_D) { + register_code(KC_LSHIFT); + tap(KC_F5); + unregister_code(KC_LSHIFT); + } + + // Start Diablo 3 + SEQ_ONE_KEY(KC_3) { + SEND_STRING(SS_LCTRL(" ")); + SEND_STRING("Diablo"); + tap(KC_ENTER); + } + + SEQ_ONE_KEY(KC_B) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " "); + tap(KC_ENTER); + SEND_STRING ("Built at: " QMK_BUILDDATE); + } +#ifndef NO_SECRETS + matrix_scan_secrets(); +#endif // !NO_SECRETS + } #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. run_diablo_macro_check(); @@ -93,85 +187,3 @@ void matrix_scan_user(void) { matrix_scan_keymap(); } - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - /* uint8_t default_layer = 0; - default_layer = eeconfig_read_default_layer(); */ - switch (keycode) { - case JJ_COPY: - if (!record->event.pressed) { - SEND_STRING(SS_LGUI("c")); - } - return false; - break; - case JJ_PSTE: - if (!record->event.pressed) { - SEND_STRING(SS_LGUI("v")); - } - return false; - break; - case JJ_ARRW: - if (!record->event.pressed) { - SEND_STRING("->"); - } - return false; - break; /* - case KC_SWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_SWRKMN); - layer_move(default_layer); - //ergodox_blink_all_leds(); - //ergodox_blink_all_leds(); - } - return false; - break; - case KC_HWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_HWRKMN); - layer_move(default_layer); - //ergodox_blink_all_leds(); - //ergodox_blink_all_leds(); - } - return false; - break; - case KC_EPRM: - if (!record->event.pressed) { - //ergodox_blink_all_leds(); - eeconfig_init(); - } - return false; - break; - case MC_LOCK: - if (!record->event.pressed) { - layer_move(default_layer); - SEND_STRING(SS_LCTRL(SS_LGUI("q"))); - } - return false; - break; */ - case KC_DCLR: -#ifdef TAP_DANCE_ENABLE - if (record->event.pressed) { - uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } -#endif // !TAP_DANCE_ENABLE - return false; - break; - case KC_CCCV: - if (record->event.pressed) { - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - SEND_STRING(SS_LGUI("c")); - } else { - SEND_STRING(SS_LGUI("v")); - } - } - return false; - break; - } - return process_record_keymap(keycode, record); -} - diff --git a/users/bocaj/bocaj.h b/users/bocaj/bocaj.h index 7b537397f07..04991a0150e 100644 --- a/users/bocaj/bocaj.h +++ b/users/bocaj/bocaj.h @@ -1,141 +1,85 @@ -#ifndef USERSPACE -#define USERSPACE +/* +Copyright 2018 Jacob Jerrell @JacobJerrell +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once #include "quantum.h" +#include "version.h" +#include "eeprom.h" +#include "wrappers.h" +#include "process_records.h" +#ifdef TAP_DANCE_ENABLE + #include "tap_dances.h" +#endif // TAP_DANCE_ENABLE -/* *** *** *** *** *** * - * Define layer names * - * *** *** *** *** *** */ +/* Layer Names */ enum userspace_layers { - _HWRKMN = 0, - _SWRKMN, + _WORKMAN = 0, + _WINWORKMAN, + _QWERTY, _LOWER, _ADJUST, - _NUMS, - _NMOD, - _DIABLO + _DIABLO, }; -#define EECONFIG_USERSPACE (uint8_t *)19 +#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + #define BOCAJ_UNICODE_MODE UC_OSX +#else + // set to 2 for UC_WIN, set to 4 for UC_WINC + #define BOCAJ_UNICODE_MODE 2 +#endif + +/* +define modifiers here, since MOD_* doesn't seem to work for these + */ +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) +#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) + +bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); +bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); +bool send_game_macro(const char *str, keyrecord_t *record, bool override); +void matrix_init_keymap(void); +void shutdown_keymap(void); +void suspend_power_down_keymap(void); +void suspend_wakeup_init_keymap(void); +void matrix_scan_keymap(void); +uint32_t layer_state_set_keymap (uint32_t state); +uint32_t default_layer_state_set_keymap (uint32_t state); +void led_set_keymap(uint8_t usb_led); +void eeconfig_init_keymap(void); +void tap(uint16_t keycode); + typedef union { uint8_t raw; } userspace_config_t; -/* *** *** *** *** *** *** * - * Define Custom Keycodes * - * *** *** *** *** *** *** */ -enum userspace_custom_keycodes { - KC_EPRM = SAFE_RANGE, // can always be here - KC_SWRK, - KC_HWRK, - KC_VRSN, - JJ_COPY, - JJ_PSTE, - JJ_ARRW, - KC_CCCV, - MC_LOCK, - KC_DCLR, - NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes -}; - -// Space Cadet Hyper/Meh and [/] -#define HYP_LBK ALL_T(KC_LBRACKET) -#define MEH_RBK MEH_T(KC_RBRACKET) - -// Layout beauti-/simpli-fication -#define KC_LWEN LT(_LOWER, KC_ENTER) -#define KC_ADJS TT(_ADJUST) -#define KC_NUMS TT(_NUMS) -#define LM_SHFT LM(_NMOD, MOD_LSFT) -#define XXXXXXX KC_NO -#define _______ KC_TRNS - -void tap(uint16_t keycode); - -/* *** *** *** *** *** *** * - * Diablo 3 Macro Handling * - * *** *** *** *** *** *** */ +extern userspace_config_t userspace_config; // If Tap Dancing is enabled, we manage that here. // If it is not, then we define the KC_D3_# codes gracefully #ifdef TAP_DANCE_ENABLE -enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4, -}; - -#define KC_D3_1 TD(TD_D3_1) -#define KC_D3_2 TD(TD_D3_2) -#define KC_D3_3 TD(TD_D3_3) -#define KC_D3_4 TD(TD_D3_4) + #define KC_D3_1 TD(TD_D3_1) + #define KC_D3_2 TD(TD_D3_2) + #define KC_D3_3 TD(TD_D3_3) + #define KC_D3_4 TD(TD_D3_4) #else // !TAP_DANCE_ENABLE -#define KC_D3_1 KC_1 -#define KC_D3_2 KC_2 -#define KC_D3_3 KC_3 -#define KC_D3_4 KC_4 + #define KC_D3_1 KC_1 + #define KC_D3_2 KC_2 + #define KC_D3_3 KC_3 + #define KC_D3_4 KC_4 #endif // TAP_DANCE_ENABLE - -// Wrapper for handling of keymap 'blocks' -// not 100% sure what this first part does. Credit to Drashna -#if (!defined(LAYOUT) && defined(KEYMAP)) -#define LAYOUT KEYMAP -#endif - -#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) -/* Pretty Layout -.---------------------------------------------. .---------------------------------------------. -| 1 | 2 | 3 | 4 | 5 | 6 | 7 | ! 8 | 9 | 10 | 11 | 12 | 13 | 14 | -!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! -| 15 | 16 | 17 | 18 | 19 | 20 | 21 | ! 22 | 23 | 24 | 25 | 26 | 27 | 28 | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| 29 | 30 | 31 | 32 | 33 | 34 |-------! !-------! 35 | 36 | 37 | 38 | 39 | 40 | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| 41 | 42 | 43 | 44 | 45 | 46 | 47 | ! 48 | 49 | 50 | 51 | 52 | 53 | 54 | -'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | 55 | 56 | 57 | 58 | 59 | .---------------. .---------------. ! 60 | 61 | 62 | 63 | 64 | - '------------------------------' | 65 | 66 | ! 67 | 68 | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | 69 | ! 70 | ! ! - ! ! !-------! !-------! ! ! - | 71 | 72 | 73 | ! 74 | 75 | 76 | - '-----------------------' '-----------------------' -*/ - -#define _______________________SWORKMAN_L1_______________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _______________________SWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G -#define _______________________SWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B - -#define _______________________SWORKMAN_R1_______________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _______________________SWORKMAN_R2_______________________ KC_H, ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), KC_SCLN -#define _______________________SWORKMAN_R3_______________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) - -// Hardware Driven Workman -#define _______________________HWORKMAN_L1_______________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _______________________HWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_H), ALT_T(KC_T), KC_G -#define _______________________HWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V - -#define _______________________HWORKMAN_R1_______________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _______________________HWORKMAN_R2_______________________ KC_Y, ALT_T(KC_N), GUI_T(KC_E), SFT_T(KC_O), KC_I -#define _______________________HWORKMAN_R3_______________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) - -#define ___________________ERGODOX_BOTTOM_LEFT___________________ TT(_DIABLO), KC_NUMS, TT(_LOWER), KC_UP, KC_LEFT -#define ___________________ERGODOX_BOTTOM_RIGHT__________________ KC_RIGHT, KC_DOWN, XXXXXXX, XXXXXXX, TT(_ADJUST) - -#define _______________________NUMBER_LEFT_______________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define _______________________NUMBER_RIGHT______________________ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define _______________________SPECIAL_LEFT______________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _______________________SPECIAL_RIGHT_____________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN - -#define _________________________________________________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -#define XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX KC_NO, KC_NO, KC_NO, KC_NO, KC_NO - -// LEFT | RIGHT -#define ______________________ERGODOX_THUMBS_____________________ KC_APP,KC_HOME, KC_PGUP,KC_ESC, \ - KC_END, KC_PGDOWN, \ - KC_SPACE,KC_BSPACE,JJ_COPY, JJ_PSTE,KC_TAB,KC_LWEN - - -#endif // !USERSPACE diff --git a/users/bocaj/config.h b/users/bocaj/config.h index 0e726598cdf..1956ea6d965 100644 --- a/users/bocaj/config.h +++ b/users/bocaj/config.h @@ -10,12 +10,15 @@ // actually sends Ctrl-x. That's bad.) #define IGNORE_MOD_TAP_INTERRUPT #undef PERMISSIVE_HOLD +#define PREVENT_STUCK_MODIFIERS #ifdef TAPPING_TERM #undef TAPPING_TERM #endif // TAPPING_TERM #define TAPPING_TERM 175 +#define RETRO_TAPPING + // Disable action_get_macro and fn_actions, since we don't use these // and it saves on space in the firmware. #ifndef NO_DEBUG @@ -27,6 +30,4 @@ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define DISABLE_LEADER - #define MACRO_TIMER 5 diff --git a/users/bocaj/process_records.c b/users/bocaj/process_records.c new file mode 100644 index 00000000000..c36683f8ba8 --- /dev/null +++ b/users/bocaj/process_records.c @@ -0,0 +1,149 @@ +#include "bocaj.h" +#include QMK_KEYBOARD_H + +uint16_t copy_paste_timer; +uint16_t grave_layer_timer; +uint16_t heal_layer_timer; + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +// Defines actions tor my global custom keycodes. Defined in bocaj.h file +// Then runs the _keymap's record handler if not processed here +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_WORKMAN); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(0); + #endif + layer_move(0); + ergodox_blink_all_leds(); + } + break; + case KC_WWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_WINWORKMAN); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(4); + #endif + layer_move(0); + ergodox_blink_all_leds(); + } + break; + case KC_MQWR: + if (!record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(0); + #endif + layer_move(0); + ergodox_blink_all_leds(); + } + break; + case MC_LOCK: + if (!record->event.pressed) { + layer_move(0); + SEND_STRING(SS_LCTRL(SS_LGUI("q"))); + } + break; + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) { + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); + clear_oneshot_mods(); + if (biton32(default_layer_state) == _WINWORKMAN) { + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); + } else { + send_string_with_delay_P(PSTR("util/docker_build.sh " QMK_KEYBOARD ":" QMK_KEYMAP), 10); + } + if (temp_mod & MODS_SHIFT_MASK) { + send_string_with_delay_P(PSTR(":teensy"), 10); + } + if (temp_mod & MODS_CTRL_MASK) { + send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); + } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); + set_mods(temp_mod); + layer_move(0); + } + break; + case KC_DCLR: // reset all Diablo timers, disabling them +#ifdef TAP_DANCE_ENABLE + if (record->event.pressed) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + diablo_key_time[dtime] = diablo_times[0]; + } + } +#endif // TAP_DANCE_ENABLE + break; + case JJ_ARRW: + if (!record->event.pressed) { + SEND_STRING("->"); + } + return false; + break; + case LM_GRAVE: + if (record->event.pressed) { + grave_layer_timer = timer_read(); + } else { + if (timer_elapsed(grave_layer_timer) < TAPPING_TERM) { + uint8_t temp_mod = get_mods(); + uint8_t one_shot = get_oneshot_mods(); + clear_mods(); + if (temp_mod & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) { + register_code(KC_LSFT); + tap(KC_GRAVE); + unregister_code(KC_LSFT); + } else { + tap(KC_GRAVE); + } + set_mods(temp_mod); + } else { + layer_move(0); + } + } + return false; + break; + case KC_CCCV: + if (record->event.pressed) { + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + SEND_STRING(SS_LGUI("c")); + } else { + SEND_STRING(SS_LGUI("v")); + } + } + return false; + break; +#ifdef UNICODE_ENABLE + case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ + if (record->event.pressed) { + send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); + } + break; + case UC_TABL: // ┬─┬ノ( º _ ºノ) + if (record->event.pressed) { + send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); + } + break; + case UC_SHRG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + break; + case UC_DISA: // ಠ_ಠ + if (record->event.pressed) { + send_unicode_hex_string("0CA0 005F 0CA0"); + } + break; +#endif + } + return process_record_keymap(keycode, record); +} diff --git a/users/bocaj/process_records.h b/users/bocaj/process_records.h new file mode 100644 index 00000000000..5c55df35e85 --- /dev/null +++ b/users/bocaj/process_records.h @@ -0,0 +1,50 @@ +#pragma once +#include "bocaj.h" + +#if defined(KEYMAP_SAFE_RANGE) + #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#else + #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#endif + +enum userspace_custom_keycodes { + KC_EPRM = PLACEHOLDER_SAFE_RANGE, // can always be here + KC_MWRK, + KC_WWRK, + KC_MQWR, + KC_VRSN, + LM_GRAVE, // Shift if held, layer change if tapped + JJ_COPY, + JJ_PSTE, + JJ_ARRW, + KC_CCCV, + MC_LOCK, + KC_DCLR, + KC_MAKE, + UC_FLIP, // (ಠ痊ಠ)┻━┻ + UC_TABL, // ┬─┬ノ( º _ ºノ) + UC_SHRG, // ¯\_(ツ)_/¯ + UC_DISA, // ಠ_ಠ + NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); + +// One Shot +#define OS_LSFT OSM(MOD_LSFT) + +// Space Cadet Hyper/Meh and [/] +#define HYP_LBK ALL_T(KC_LBRACKET) +#define MEH_RBK MEH_T(KC_RBRACKET) + +#define GUI_CTR(os, kc) MT( (os == 0) ? (MOD_LGUI) : (MOD_LCTL), kc ) + +// Layout beauti-/simpli-fication +#define KC_LWEN LT(_LOWER, KC_ENTER) +#define KC_ADJS TT(_ADJUST) +#define KC_NUMS TT(_LOWER) +#define KC_GAME TT(_DIABLO) + +// Other Keycodes +#define KC_RST RESET +#define KC_BS KC_BSLASH diff --git a/users/bocaj/readme.md b/users/bocaj/readme.md index bab6d7337ff..669299cb0df 100644 --- a/users/bocaj/readme.md +++ b/users/bocaj/readme.md @@ -1,14 +1,102 @@ -Copyright 2018 Jacob Jerrell jacob.jerrell@gmail.com @JacobJerrell +# Overview -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. +My personal QMK userspace. First, I must say that the credit for a majority of the code found here belongs to Drashna and/or the people he derived his code from. My Ergodox layout is briefly described in its respective folder. As for explaining this userspace, you could honestly go to Drashna's userspace and read his well put together readme. Regardless, I am mostly writing this as an excercise for myself to better understand what is going on, and where applicable, describe things that I innovated on my own. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +## Bocaj.c -You should have received a copy of the GNU General Public License -along with this program. If not, see . +### Unicode + +I've always had difficulty implementing unicode in QMK, all of this code is literally copy/pasted from Drashna's userspace and lies dormant here until I can take the time to figure it out. + +Update: Got it to work in Mac OS which is more important to me than Windows (probably pretty easy to figure out at this point). So I'm a happy table flipping person now! + +(ノಠ痊ಠ)ノ彡┻━┻ + +┬─┬ノ( º _ ºノ) + +### Tap Macro + +Not sure why this doesn't exist in QMK already (maybe it does?) + +```c +void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; +``` + +### *_keymap functions + +We're running *_user functions in the userspace, that way we can add to or reconfigure at the keyboard level. Any *_user functions should call the equivalent *_keymap function at the end. If the *_keymap function isn't defined in the keymap, the `__attribute__ ((weak))` will prevent build problems. + +### Startup/Suspend/Shutdown Functions + +I have no idea what these do. Non-Ergodox keyboard functions? + +### Matrix Scan User + +Leader key defines, Diablo macro ancillary function, run matrix_scan_keymap. + +#### Leader Key + +I've always been interested in this feature, but I've had 0 experience with applications that have similar behavior. My implementation seeks to implement features that I feel VS2017 lacks + +## Secrets + +Hacked Drashna's secret macro implementation to work with the leader key instead. +TODO: Finish documentation + +## Bocaj.h + +Layer defines, some macro ancillary defines, setup Diablo macros and failsafe + +## Process_Records.c/.h + +Again, taking ideas from Drashna to make maintenance simpler. A couple of things that I'm proud of here, but nothing really ground breaking. + +* Features + * Change default layer + * KC_MWRK, KC_WWRK, KC_MQWR + * MacOS Lock Screen Macro + * Make macro (Credit: Drashna) + * Need to reconfigure so it runs the docker command if one of the Mac OS layers are default because the AVR install fails on the corporate laptop + * Arrow macro (->) because I find myself telling people how to get to something quite frequently and typing this manually requires moving the right hand to the top-left of the ergodox and then to the bottom right, which feels unnatural. + * LM_GRAVE + * While combining _NUMS and _LOWER, I also needed a place to put F1-12 keys. This required me to relocate the grave key. The most comfortable place to put it was over a key that I frequently use to toggle the numpad. I do have other ways to get to/from this layer but my mind has been wired to use them for different workflows, so I would sit here frozen for a moment trying to tell my fingers where to go + * How it works + * A timer starts when pressed down + * If the timer at release was less than the TAPPING_TERM define + * Get mods + * If Shift was held or one-shot shift was active + * Send `~` + * Else + * Send ` + * Else (timer at released was greater than the TAPPING_TERM define) + * Move to the default layer + * KC_CCCV + * Another neat idea I found in Drashna's userspace... highly underutilized in my layout but the inspiration for LM_GRAVE was obviously derived from this code + * Unicode stuff + * All I've ever wanted was a table-flip macro... I managed to get about half of it to work before I gave up and disabled it + +## Send_Unicode.c/.h + +I have some basic understanding of this, Drashna may already have it documented in his userspace. I'll put it in my own words when I get around to making it work and understanding it better. + +## Tap_Dances.c/h + +Again, building on Drashna's userspace organization to simplify maintenance of a heavily configured layout. This is all the stuff for the Diablo 3 macros that spam a given skill (1-4) every ~1 second + +## Wrappers.h + +Traditionally, you would put all of this into the \.h file. But I liked the idea of separating it to simplify modification in the future. + +### GUI_CTR(os, kc) + +A notable mention in this file is the GUI_CTR(os, kc) custom keycode defined in process_records.h as: + +```c +#define GUI_CTR(os, kc) MT( (os == 0) ? (MOD_LGUI) : (MOD_LCTL), kc ) +``` + +I tried several things before coming to this one-liner conclusion. I believe it is quite elegant and it definitely solves the problem I had (separate wrappers for Windows/MacOS layers). But I would love to make this into something more intuitive, like a macro that detects which layer you're on and sends the applicable hotkey when held, or keycode when tapped. Ultimately, I was too tired of thinking about it to come up with a solution like that at this time. + +Anyhow, if you set `os == 1`, it sends the Windows CTRL hotkey when held. If you set `os == 0`, it sends the Mac OS GUI hotkey when held. If tapped, it sends the keycode. + +This is effectively a slightly more advanced `MOD_T(kc)` keycode. diff --git a/users/bocaj/rules.mk b/users/bocaj/rules.mk index 17d2772a7c0..9ed8c250a30 100644 --- a/users/bocaj/rules.mk +++ b/users/bocaj/rules.mk @@ -1,5 +1,33 @@ -SRC += bocaj.c +SRC += bocaj.c \ + process_records.c + +ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") + SRC += secrets.c +endif ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) SRC += tap_dances.c endif + +# Caused problems when building via docker on Mac OS +# EXTRAFLAGS += -flto + +ifeq ($(strip $(NO_SECRETS)), yes) + OPT_DEFS += -DNO_SECRETS +endif + +ifeq ($(strip $(MACROS_ENABLED)), yes) + OPT_DEFS += -DMACROS_ENABLED +endif + +ifeq ($(strip $(UCIS_ENABLE)), yes) + SRC += send_unicode.c +endif + +ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) + SRC += send_unicode.c +endif + +ifeq ($(strip $(UNICODE_ENABLE)), yes) + SRC += send_unicode.c +endif diff --git a/users/bocaj/send_unicode.c b/users/bocaj/send_unicode.c new file mode 100644 index 00000000000..b1290f6319e --- /dev/null +++ b/users/bocaj/send_unicode.c @@ -0,0 +1,106 @@ +// Written by konstantin: vomindoraan +#include "send_unicode.h" +#include +#include + +__attribute__((weak)) +void send_unicode_hex_string(const char* str) { + if (!str) { return; } // Safety net + + while (*str) { + // Find the next code point (token) in the string + for (; *str == ' '; str++); + size_t n = strcspn(str, " "); // Length of the current token + char code_point[n+1]; + strncpy(code_point, str, n); + code_point[n] = '\0'; // Make sure it's null-terminated + + // Normalize the code point: make all hex digits lowercase + for (char *p = code_point; *p; p++) { + *p = tolower((unsigned char)*p); + } + + // Send the code point as a Unicode input string + unicode_input_start(); + send_string(code_point); + unicode_input_finish(); + + str += n; // Move to the first ' ' (or '\0') after the current token + } +} + +// (ノಠ痊ಠ)ノ彡┻━┻ +// send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); + +//Old code +// (╯°□°)╯ ︵ ┻━┻ + #if 0 + register_code(KC_RSFT); + tap(KC_9); + unregister_code(KC_RSFT); + process_unicode((0x256F | QK_UNICODE), record); // Arm + process_unicode((0x00B0 | QK_UNICODE), record); // Eye + process_unicode((0x25A1 | QK_UNICODE), record); // Mouth + process_unicode((0x00B0 | QK_UNICODE), record); // Eye + register_code(KC_RSFT); + tap(KC_0); + unregister_code(KC_RSFT); + process_unicode((0x256F | QK_UNICODE), record); // Arm + tap(KC_SPC); + process_unicode((0x0361 | QK_UNICODE), record); // Flippy + tap(KC_SPC); + process_unicode((0x253B | QK_UNICODE), record); // Table + process_unicode((0x2501 | QK_UNICODE), record); // Table + process_unicode((0x253B | QK_UNICODE), record); // Table + #endif + + +// If you need a good converter: https://r12a.github.io/app-conversion/ +uint8_t saved_mods; + +void unicode_input_start (void) { + // save current mods + saved_mods = get_mods(); // Save current mods + clear_mods(); // Unregister mods to start from a clean state + + switch(get_unicode_input_mode()) { + case UC_OSX: + register_code(KC_LALT); + break; + case UC_LNX: + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + break; + case UC_WIN: + register_code(KC_LALT); + register_code(KC_PPLS); + unregister_code(KC_PPLS); + break; + case UC_WINC: + register_code(KC_RALT); + unregister_code(KC_RALT); + register_code(KC_U); + unregister_code(KC_U); + break; + } + wait_ms(UNICODE_TYPE_DELAY); +} + +void unicode_input_finish (void) { + switch(get_unicode_input_mode()) { + case UC_OSX: + case UC_WIN: + unregister_code(KC_LALT); + break; + case UC_LNX: + register_code(KC_SPC); + unregister_code(KC_SPC); + break; + } + + set_mods(saved_mods); // Reregister previously set mods +} diff --git a/users/drashna/send_unicode.h b/users/bocaj/send_unicode.h similarity index 100% rename from users/drashna/send_unicode.h rename to users/bocaj/send_unicode.h diff --git a/users/bocaj/tap_dances.c b/users/bocaj/tap_dances.c index 10767db453c..a9628a345dc 100644 --- a/users/bocaj/tap_dances.c +++ b/users/bocaj/tap_dances.c @@ -1,4 +1,3 @@ -#include "bocaj.h" #include "tap_dances.h" diff --git a/users/bocaj/tap_dances.h b/users/bocaj/tap_dances.h index 8935753f6cf..5b1277ec580 100644 --- a/users/bocaj/tap_dances.h +++ b/users/bocaj/tap_dances.h @@ -1,3 +1,6 @@ +#pragma once +#include "bocaj.h" + //define diablo macro timer variables extern uint16_t diablo_timer[4]; extern uint8_t diablo_times[]; @@ -5,3 +8,12 @@ extern uint8_t diablo_key_time[4]; void run_diablo_macro_check(void); + +#ifdef TAP_DANCE_ENABLE +enum { + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4 +}; +#endif // TAP_DANCE_ENABLE diff --git a/users/bocaj/wrappers.h b/users/bocaj/wrappers.h new file mode 100644 index 00000000000..379edaad295 --- /dev/null +++ b/users/bocaj/wrappers.h @@ -0,0 +1,37 @@ +#pragma once +#include "bocaj.h" + +#if (!defined(LAYOUT) && defined(KEYMAP)) +#define LAYOUT KEYMAP +#endif + +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) + +#define _________________QWERTY_L1__________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2__________________ KC_A, KC_S, GUI_CTR(0, KC_D), KC_F, KC_G +#define _________________QWERTY_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1__________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2__________________ KC_H, KC_J, GUI_CTR(0, KC_K), KC_L, KC_SCLN +#define _________________QWERTY_R3__________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + +// Hardware Driven Workman +#define _________________WORKMAN_L1_________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define _________________WORKMAN_L2_________________ KC_A, KC_S, GUI_CTR(0, KC_H), KC_T, KC_G // GUI_CTR(0, kc) behaves as GUI_T(kc) +#define ________________WWORKMAN_L2_________________ KC_A, KC_S, GUI_CTR(1, KC_H), KC_T, KC_G // GUI_CTR(1, kc) behaves as CTR_T(kc) +#define _________________WORKMAN_L3_________________ KC_Z, KC_X, KC_M, KC_C, KC_V + +#define _________________WORKMAN_R1_________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define _________________WORKMAN_R2_________________ KC_Y, KC_N, GUI_CTR(0, KC_E), KC_O, KC_I // GUI_CTR(0, kc) behaves as GUI_T(kc) +#define ________________WWORKMAN_R2_________________ KC_Y, KC_N, GUI_CTR(1, KC_E), KC_O, KC_I // GUI_CTR(1, kc) behaves as CTR_T(kc) +#define _________________WORKMAN_R3_________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH + + +#define __________________NUMBER_LEFT_______________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define __________________NUMBER_RIGHT______________ KC_6, KC_7, KC_8, KC_9, KC_0 + +#define __________________FUNCTION_LEFT_____________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define __________________FUNCTION_RIGHT____________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +#define ____________________BLANK___________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS diff --git a/users/cbbrowne/cbbrowne.c b/users/cbbrowne/cbbrowne.c new file mode 100644 index 00000000000..e69de29bb2d diff --git a/users/cbbrowne/cbbrowne.h b/users/cbbrowne/cbbrowne.h new file mode 100644 index 00000000000..301636c0533 --- /dev/null +++ b/users/cbbrowne/cbbrowne.h @@ -0,0 +1,39 @@ +#ifndef USERSPACE +#define USERSPACE + +#ifdef BACKLIGHT_ENABLE +#include "backlight.h" +#endif +#include "quantum.h" +#include "config.h" + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#ifndef NO_DEBUG +#define NO_DEBUG +#endif +#ifndef NO_PRINT +#define NO_PRINT +#endif + +/* cbbrowne user configuration */ + +#define randadd 53 +#define randmul 181 +#define randmod 167 + +/* Filler to make layering a bit clearer * + * borrowed from basic keymap */ + +#define _______ KC_TRNS +#define _____ KC_NO + +#define LEADER_TIMEOUT 300 +#ifndef LIGHT_CONFIG_H +#define BACKLIGHT_BREATHING +#endif + +#endif + +#endif diff --git a/users/cbbrowne/rules.mk b/users/cbbrowne/rules.mk new file mode 100644 index 00000000000..497638cdb36 --- /dev/null +++ b/users/cbbrowne/rules.mk @@ -0,0 +1 @@ +SRC += cbbrowne.c diff --git a/users/drashna/.gitignore b/users/drashna/.gitignore new file mode 100644 index 00000000000..f84d34d9079 --- /dev/null +++ b/users/drashna/.gitignore @@ -0,0 +1,3 @@ +secrets.c +secrets.h +drashna_song_list.h \ No newline at end of file diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml new file mode 100644 index 00000000000..679bdf4351d --- /dev/null +++ b/users/drashna/.gitlab-ci.yml @@ -0,0 +1,25 @@ +stages: + - test + +QMK Firmware: + stage: test + variables: + GIT_SUBMODULE_STRATEGY: recursive + tags: + - linux + image: ubuntu:18.10 + before_script: + - apt-get update -qy + - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr unzip wget zip + - avr-gcc --version + - uname -a + script: + - make test:all + - make planck/rev6:default planck/rev5:default + - make keebio/iris/rev2:drashna keebio/iris/rev2:drashna_old ergodox_ez:drashna ergodox_ez:drashna_glow keebio/viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna planck/rev6:drashna fractal:drashna primekb/prime_m:drashna -j2 --output-sync + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + paths: + - ./*.hex + - ./*.bin + expire_in: 1 month diff --git a/users/drashna/config.h b/users/drashna/config.h index 9d7d20add03..8f6e700d2bd 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -1,72 +1,128 @@ #pragma once - #ifdef AUDIO_ENABLE -#define AUDIO_CLICKY -#define STARTUP_SONG SONG(E1M1_DOOM) -#define GOODBYE_SONG SONG(SONIC_RING) -#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND), \ - SONG(OVERWATCH_THEME) \ - } - -#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f -// #ifdef RGBLIGHT_ENABLE -// #define NO_MUSIC_MODE -// #endif //RGBLIGHT_ENABLE -#endif +# if __GNUC__ > 7 +# if __has_include("drashna_song_list.h") +# include "drashna_song_list.h" +# endif // if file exists +# endif // __GNUC__ + +# define AUDIO_CLICKY +# define STARTUP_SONG SONG(RICK_ROLL) +# define GOODBYE_SONG SONG(SONIC_RING) +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(OVERWATCH_THEME) } + +# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f + +# define UNICODE_SONG_OSX SONG(RICK_ROLL) +# define UNICODE_SONG_LNX SONG(RICK_ROLL) +# define UNICODE_SONG_WIN SONG(RICK_ROLL) +# define UNICODE_SONG_BSD SONG(RICK_ROLL) +# define UNICODE_SONG_WINC SONG(RICK_ROLL) +#endif // !AUDIO_ENABLE #ifdef RGBLIGHT_ENABLE -#define RGBLIGHT_SLEEP -#undef RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_BREATHING -#define RGBLIGHT_EFFECT_SNAKE -#define RGBLIGHT_EFFECT_KNIGHT -#endif // RGBLIGHT_ENABLE +# define RGBLIGHT_SLEEP +# undef RGBLIGHT_ANIMATIONS +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_KNIGHT +#endif // RGBLIGHT_ENABLE + +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) +// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +// # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 +// # define EECONFIG_RGB_MATRIX (uint32_t *)16 + +# if defined(__AVR__) && !defined(__AVR_AT90USB1286__) +# define DISABLE_RGB_MATRIX_ALPHAS_MODS +# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define DISABLE_RGB_MATRIX_BREATHING +# define DISABLE_RGB_MATRIX_BAND_SAT +# define DISABLE_RGB_MATRIX_BAND_VAL +# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# define DISABLE_RGB_MATRIX_CYCLE_ALL +# define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define DISABLE_RGB_MATRIX_CYCLE_OUT_IN +// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define DISABLE_RGB_MATRIX_DUAL_BEACON +# define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL +# define DISABLE_RGB_MATRIX_CYCLE_SPIRAL +# define DISABLE_RGB_MATRIX_RAINBOW_BEACON +# define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# define DISABLE_RGB_MATRIX_RAINDROPS +# define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +// # define DISABLE_RGB_MATRIX_TYPING_HEATMAP +# define DISABLE_RGB_MATRIX_DIGITAL_RAIN +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define DISABLE_RGB_MATRIX_SPLASH +# define DISABLE_RGB_MATRIX_MULTISPLASH +# define DISABLE_RGB_MATRIX_SOLID_SPLASH +# define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH +# endif // AVR +#endif // RGB_MATRIX_ENABLE #ifndef ONESHOT_TAP_TOGGLE -#define ONESHOT_TAP_TOGGLE 2 -#endif // !ONESHOT_TAP_TOGGLE +# define ONESHOT_TAP_TOGGLE 2 +#endif // !ONESHOT_TAP_TOGGLE #ifndef ONESHOT_TIMEOUT -#define ONESHOT_TIMEOUT 3000 -#endif// !ONESHOT_TIMEOUT +# define ONESHOT_TIMEOUT 3000 +#endif // !ONESHOT_TIMEOUT #ifndef QMK_KEYS_PER_SCAN -#define QMK_KEYS_PER_SCAN 4 -#endif // !QMK_KEYS_PER_SCAN - - +# define QMK_KEYS_PER_SCAN 4 +#endif // !QMK_KEYS_PER_SCAN // this makes it possible to do rolling combos (zx) with keys that // convert to other keys on hold (z becomes ctrl when you hold it, // and when this option isn't enabled, z rapidly followed by x // actually sends Ctrl-x. That's bad.) #define IGNORE_MOD_TAP_INTERRUPT -#undef PERMISSIVE_HOLD -// #define TAPPING_FORCE_HOLD +#undef PERMISSIVE_HOLD +//#define TAPPING_FORCE_HOLD //#define RETRO_TAPPING #define FORCE_NKRO #ifndef TAPPING_TOGGLE -#define TAPPING_TOGGLE 1 +# define TAPPING_TOGGLE 1 #endif #ifdef TAPPING_TERM -#undef TAPPING_TERM -#endif // TAPPING_TERM -#ifdef KEYBOARD_ergodox_ez - #define TAPPING_TERM 185 +# undef TAPPING_TERM +#endif // TAPPING_TERM +#if defined(KEYBOARD_ergodox_ez) +# define TAPPING_TERM 185 +#elif defined(KEYBOARD_crkbd) +# define TAPPING_TERM 200 #else - #define TAPPING_TERM 175 +# define TAPPING_TERM 175 #endif +#define TAP_CODE_DELAY 5 -// Disable action_get_macro and fn_actions, since we don't use these -// and it saves on space in the firmware. -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION - -#define MACRO_TIMER 5 +/* Disable unused and unneeded features to reduce on firmware size */ +#ifdef LOCKING_SUPPORT_ENABLE +# undef LOCKING_SUPPORT_ENABLE +#endif +#ifdef LOCKING_RESYNC_ENABLE +# undef LOCKING_RESYNC_ENABLE +#endif diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index b2219e9aa74..c1809dad0a3 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -16,410 +16,223 @@ along with this program. If not, see . */ #include "drashna.h" -#include "tap_dances.h" -#include "rgb_stuff.h" userspace_config_t userspace_config; - -uint16_t copy_paste_timer; -// Helper Functions - +#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) +# define DRASHNA_UNICODE_MODE UC_WIN +#else +// set to 2 for UC_WIN, set to 4 for UC_WINC +# define DRASHNA_UNICODE_MODE 2 +#endif // This block is for all of the gaming macros, as they were all doing // the same thing, but with differring text sent. bool send_game_macro(const char *str, keyrecord_t *record, bool override) { - if (!record->event.pressed || override) { - uint16_t keycode; - if (userspace_config.is_overwatch) { - keycode = KC_BSPC; - } else { - keycode = KC_ENTER; + if (!record->event.pressed || override) { + uint16_t keycode; + if (userspace_config.is_overwatch) { + keycode = KC_BSPC; + } else { + keycode = KC_ENTER; + } + clear_keyboard(); + tap_code(keycode); + wait_ms(TAP_CODE_DELAY); + send_string_with_delay(str, TAP_CODE_DELAY); + wait_ms(TAP_CODE_DELAY); + tap_code(KC_ENTER); } - clear_keyboard(); - tap_code(keycode); - wait_ms(50); - send_string_with_delay(str, MACRO_TIMER); - wait_ms(50); - tap_code(KC_ENTER); - } - if (override) wait_ms(3000); - return false; + if (override) wait_ms(3000); + return false; } -bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) { - static uint16_t this_timer; - if(pressed) { - this_timer= timer_read(); - } else { - if (timer_elapsed(this_timer) < TAPPING_TERM){ - register_code(code); - unregister_code(code); - } else { - register_code(mod_code); - register_code(code); - unregister_code(code); - unregister_code(mod_code); - } - } - return false; +bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) { + static uint16_t this_timer; + if (pressed) { + this_timer = timer_read(); + } else { + if (timer_elapsed(this_timer) < TAPPING_TERM) { + tap_code(code); + } else { + register_code(mod_code); + tap_code(code); + unregister_code(mod_code); + } + } + return false; } -bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) { - if(pressed) { - this_timer= timer_read(); - } else { - if (timer_elapsed(this_timer) < TAPPING_TERM){ - register_code(code); - unregister_code(code); - } else { - register_code(mod_code); - register_code(code); - unregister_code(code); - unregister_code(mod_code); - } - } - return false; +bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) { + if (pressed) { + this_timer = timer_read(); + } else { + if (timer_elapsed(this_timer) < TAPPING_TERM) { + tap_code(code); + } else { + register_code(mod_code); + tap_code(code); + unregister_code(mod_code); + } + } + return false; } void bootmagic_lite(void) { - matrix_scan(); - #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 + matrix_scan(); +#if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 wait_ms(DEBOUNCING_DELAY * 2); - #elif defined(DEBOUNCE) && DEBOUNCE > 0 +#elif defined(DEBOUNCE) && DEBOUNCE > 0 wait_ms(DEBOUNCE * 2); - #else +#else wait_ms(30); - #endif - matrix_scan(); - if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { - bootloader_jump(); - } +#endif + matrix_scan(); + if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + bootloader_jump(); + } } // Add reconfigurable functions here, for keymap customization // This allows for a global, userspace functions, and continued // customization of the keymap. Use _keymap instead of _user // functions in the keymaps -__attribute__ ((weak)) +__attribute__((weak)) void matrix_init_keymap(void) {} -__attribute__ ((weak)) -void startup_keymap(void) {} - -__attribute__ ((weak)) -void shutdown_keymap(void) {} - -__attribute__ ((weak)) -void suspend_power_down_keymap(void) {} - -__attribute__ ((weak)) -void suspend_wakeup_init_keymap(void) {} - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -__attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} - - -__attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { - return state; -} - -__attribute__ ((weak)) -uint32_t default_layer_state_set_keymap (uint32_t state) { - return state; -} - -__attribute__ ((weak)) -void led_set_keymap(uint8_t usb_led) {} - -__attribute__ ((weak)) -void eeconfig_init_keymap(void) {} - // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { - #if !defined(BOOTMAGIC_LITE) && !defined(BOOTMAGIC_ENABLE) - bootmagic_lite(); - #endif - - userspace_config.raw = eeconfig_read_user(); + userspace_config.raw = eeconfig_read_user(); #ifdef BOOTLOADER_CATERINA - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); + DDRD &= ~(1 << 5); + PORTD &= ~(1 << 5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); + DDRB &= ~(1 << 0); + PORTB &= ~(1 << 0); #endif #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - if (eeprom_read_byte(EECONFIG_UNICODEMODE) != UC_WIN) { - set_unicode_input_mode(UC_WIN); - } -#endif //UNICODE_ENABLE - matrix_init_keymap(); + set_unicode_input_mode(DRASHNA_UNICODE_MODE); + get_unicode_input_mode(); +#endif // UNICODE_ENABLE + matrix_init_keymap(); } -void startup_user (void) { - #ifdef RGBLIGHT_ENABLE - matrix_init_rgb(); - #endif //RGBLIGHT_ENABLE - startup_keymap(); +__attribute__((weak)) +void keyboard_post_init_keymap(void) {} + +void keyboard_post_init_user(void) { +#ifdef RGBLIGHT_ENABLE + keyboard_post_init_rgb(); +#endif + keyboard_post_init_keymap(); } -void shutdown_user (void) { +__attribute__((weak)) +void shutdown_keymap(void) {} + +void shutdown_user(void) { #ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(1); - rgblight_setrgb_red(); -#endif // RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(1); + rgblight_setrgb_red(); +#endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE - rgb_led led; - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - rgb_matrix_set_color( i, 0xFF, 0x00, 0x00 ); - } - } -#endif //RGB_MATRIX_ENABLE - shutdown_keymap(); + // uint16_t timer_start = timer_read(); + // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); + // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } +#endif // RGB_MATRIX_ENABLE + shutdown_keymap(); } +__attribute__((weak)) +void suspend_power_down_keymap(void) {} + void suspend_power_down_user(void) { suspend_power_down_keymap(); } +__attribute__((weak)) +void suspend_wakeup_init_keymap(void) {} + void suspend_wakeup_init_user(void) { - suspend_wakeup_init_keymap(); + suspend_wakeup_init_keymap(); } +__attribute__((weak)) +void matrix_scan_keymap(void) {} // No global matrix scan code, so just run keymap's matrix // scan function void matrix_scan_user(void) { - static bool has_ran_yet; - if (!has_ran_yet) { - has_ran_yet = true; - startup_user(); - } + static bool has_ran_yet; + if (!has_ran_yet) { + has_ran_yet = true; + startup_user(); + } #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. - run_diablo_macro_check(); -#endif // TAP_DANCE_ENABLE + run_diablo_macro_check(); +#endif // TAP_DANCE_ENABLE #ifdef RGBLIGHT_ENABLE - matrix_scan_rgb(); -#endif // RGBLIGHT_ENABLE + matrix_scan_rgb(); +#endif // RGBLIGHT_ENABLE - matrix_scan_keymap(); + matrix_scan_keymap(); } +__attribute__((weak)) +layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } - - -// Defines actions tor my global custom keycodes. Defined in drashna.h file -// Then runs the _keymap's record handier if not processed here -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - // If console is enabled, it will print the matrix position and status of each key pressed -#ifdef KEYLOGGER_ENABLE - #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_iris_rev2) - xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.row, record->event.key.col, record->event.pressed); - #else - xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); - #endif -#endif //KEYLOGGER_ENABLE - - switch (keycode) { - case KC_QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - break; - case KC_COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - break; - case KC_DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - break; - case KC_WORKMAN: - if (record->event.pressed) { - set_single_persistent_default_layer(_WORKMAN); - } - break; - - - case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader - if (!record->event.pressed) { - uint8_t temp_mod = get_mods(); - clear_mods(); - send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); - if (temp_mod & MODS_SHIFT_MASK) { - #if defined(__ARM__) - send_string_with_delay_P(PSTR(":dfu-util"), 10); - #elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), 10); - #elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), 10); - #elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), 10); - #endif // bootloader options - } - #if defined(KEYBOARD_viterbi) - send_string_with_delay_P(PSTR(":dfu"), 10); - #endif - if (temp_mod & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); - set_mods(temp_mod); - } - break; - - case EPRM: // Resets EEPROM - if (record->event.pressed) { - eeconfig_init(); - } - break; - case VRSN: // Prints firmware version - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); - } - break; - -// These are a serious of gaming macros. -// Only enables for the viterbi, basically, -// to save on firmware space, since it's limited. -#ifdef MACROS_ENABLED - case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros - if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } -#ifdef RGBLIGHT_ENABLE - userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); -#endif //RGBLIGHT_ENABLE - break; - case KC_SALT: - return send_game_macro("Salt, salt, salt...", record, false); - case KC_MORESALT: - return send_game_macro("Please sir, can I have some more salt?!", record, false); - case KC_SALTHARD: - return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); - case KC_GOODGAME: - return send_game_macro("Good game, everyone!", record, false); - case KC_GLHF: - return send_game_macro("Good luck, have fun!!!", record, false); - case KC_SYMM: - return send_game_macro("Left click to win!", record, false); - case KC_JUSTGAME: - return send_game_macro("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games.", record, false); - case KC_TORB: - return send_game_macro("That was positively riveting!", record, false); - case KC_AIM: - send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); - return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); - case KC_C9: - return send_game_macro("OMG!!! C9!!!", record, false); - case KC_GGEZ: - return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); -#endif // MACROS_ENABLED - - - case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them -#ifdef TAP_DANCE_ENABLE - if (record->event.pressed) { - uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } -#endif // TAP_DANCE_ENABLE - break; - - - case KC_CCCV: // One key copy/paste - if(record->event.pressed){ - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - register_code(KC_LCTL); - tap_code(KC_C); - unregister_code(KC_LCTL); - } else { // Tap, paste - register_code(KC_LCTL); - tap_code(KC_V); - unregister_code(KC_LCTL); - } - } - break; -#ifdef UNICODE_ENABLE - case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ - if (record->event.pressed) { - send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); - } - break; - case UC_TABL: // ┬─┬ノ( º _ ºノ) - if (record->event.pressed) { - send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); - } - break; - case UC_SHRG: // ¯\_(ツ)_/¯ - if (record->event.pressed) { - send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); - } - break; - case UC_DISA: // ಠ_ಠ - if (record->event.pressed) { - send_unicode_hex_string("0CA0 005F 0CA0"); - } - break; -#endif - } - return process_record_keymap(keycode, record) && -#ifdef RGBLIGHT_ENABLE - process_record_user_rgb(keycode, record) && -#endif // RGBLIGHT_ENABLE - process_record_secrets(keycode, record); -} - - - -// Runs state check and changes underglow color and animation // on layer change, no matter where the change was initiated // Then runs keymap's layer change check -uint32_t layer_state_set_user(uint32_t state) { - state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); +layer_state_t layer_state_set_user(layer_state_t state) { + state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); #ifdef RGBLIGHT_ENABLE - state = layer_state_set_rgb(state); -#endif // RGBLIGHT_ENABLE - return layer_state_set_keymap (state); + state = layer_state_set_rgb(state); +#endif // RGBLIGHT_ENABLE + return layer_state_set_keymap(state); } +__attribute__((weak)) +layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; } -uint32_t default_layer_state_set_user(uint32_t state) { - return default_layer_state_set_keymap(state); +// Runs state check and changes underglow color and animation +layer_state_t default_layer_state_set_user(layer_state_t state) { + state = default_layer_state_set_keymap(state); +#if 0 +# ifdef RGBLIGHT_ENABLE + state = default_layer_state_set_rgb(state); +# endif // RGBLIGHT_ENABLE +#endif + return state; } +__attribute__((weak)) +void led_set_keymap(uint8_t usb_led) {} // Any custom LED code goes here. // So far, I only have keyboard specific code, // So nothing goes here. void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); + led_set_keymap(usb_led); } +__attribute__((weak)) +void eeconfig_init_keymap(void) {} + void eeconfig_init_user(void) { - userspace_config.raw = 0; - userspace_config.rgb_layer_change = true; - eeconfig_update_user(userspace_config.raw); + userspace_config.raw = 0; + userspace_config.rgb_layer_change = true; + eeconfig_update_user(userspace_config.raw); +#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(DRASHNA_UNICODE_MODE); + get_unicode_input_mode(); +#else + eeprom_update_byte(EECONFIG_UNICODEMODE, DRASHNA_UNICODE_MODE); +#endif + eeconfig_init_keymap(); + keyboard_init(); } diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 573cb26fd0c..0d6dac380be 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -19,162 +19,65 @@ along with this program. If not, see . #include "quantum.h" #include "version.h" #include "eeprom.h" - -#ifdef RGB_MATRIX_ENABLE -#include "rgb_matrix.h" +#include "wrappers.h" +#include "process_records.h" +#ifdef TAP_DANCE_ENABLE +# include "tap_dances.h" +#endif // TAP_DANCE_ENABLE +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +# include "rgb_stuff.h" #endif - /* Define layer names */ enum userspace_layers { - _QWERTY = 0, - _NUMLOCK = 0, - _COLEMAK, - _DVORAK, - _WORKMAN, - _MODS, - _GAMEPAD, - _DIABLO, - _MACROS, - _MEDIA, - _LOWER, - _RAISE, - _ADJUST, + _QWERTY = 0, + _NUMLOCK = 0, + _COLEMAK, + _DVORAK, + _WORKMAN, + _NORMAN, + _MALTRON, + _EUCALYN, + _CARPLAX, + _MODS, /* layer 8 */ + _GAMEPAD, + _DIABLO, + _MACROS, + _MEDIA, + _LOWER, + _RAISE, + _ADJUST, }; /* define modifiers here, since MOD_* doesn't seem to work for these */ -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) - -/* -RGB color codes are no longer located here anymore. Instead, you will want to -head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h -*/ - -#ifdef RGBLIGHT_ENABLE -void rgblight_sethsv_default_helper(uint8_t index); -#endif // RGBLIGHT_ENABLE - -bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); -bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); +bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); +bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); +bool send_game_macro(const char *str, keyrecord_t *record, bool override); +void matrix_init_keymap(void); +void shutdown_keymap(void); +void suspend_power_down_keymap(void); +void suspend_wakeup_init_keymap(void); +void matrix_scan_keymap(void); +layer_state_t layer_state_set_keymap(layer_state_t state); +layer_state_t default_layer_state_set_keymap(layer_state_t state); +void led_set_keymap(uint8_t usb_led); +void eeconfig_init_keymap(void); typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - bool is_overwatch :1; - bool nuke_switch :1; - uint8_t unicode_mod :4; - }; + uint32_t raw; + struct { + bool rgb_layer_change :1; + bool is_overwatch :1; + bool nuke_switch :1; + uint8_t unicode_mod :4; + bool swapped_numbers :1; + }; } userspace_config_t; -#if defined(KEYMAP_SAFE_RANGE) - #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE -#else - #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE -#endif - -enum userspace_custom_keycodes { - EPRM = PLACEHOLDER_SAFE_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) - VRSN, // Prints QMK Firmware and board info - KC_QWERTY, // Sets default layer to QWERTY - KC_COLEMAK, // Sets default layer to COLEMAK - KC_DVORAK, // Sets default layer to DVORAK - KC_WORKMAN, // Sets default layer to WORKMAN - KC_DIABLO_CLEAR, // Clears all Diablo Timers - KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) - KC_SALT, // See drashna.c for details - KC_MORESALT, - KC_SALTHARD, - KC_GOODGAME, - KC_SYMM, - KC_JUSTGAME, - KC_GLHF, - KC_TORB, - KC_AIM, - KC_C9, - KC_GGEZ, - KC_MAKE, // Run keyboard's customized make command - KC_RGB_T, // Toggles RGB Layer Indication mode - KC_SECRET_1, // test1 - KC_SECRET_2, // test2 - KC_SECRET_3, // test3 - KC_SECRET_4, // test4 - KC_SECRET_5, // test5 - KC_CCCV, // Hold to copy, tap to paste - KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! - UC_FLIP, // (ಠ痊ಠ)┻━┻ - UC_TABL, // ┬─┬ノ( º _ ºノ) - UC_SHRG, // ¯\_(ツ)_/¯ - UC_DISA, // ಠ_ಠ - NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes -}; - - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define ADJUST MO(_ADJUST) -#define TG_MODS TG(_MODS) -#define TG_GAME TG(_GAMEPAD) - -#define KC_SEC1 KC_SECRET_1 -#define KC_SEC2 KC_SECRET_2 -#define KC_SEC3 KC_SECRET_3 -#define KC_SEC4 KC_SECRET_4 -#define KC_SEC5 KC_SECRET_5 - -#define QWERTY KC_QWERTY -#define DVORAK KC_DVORAK -#define COLEMAK KC_COLEMAK -#define WORKMAN KC_WORKMAN - -#define KC_RESET RESET -#define KC_RST KC_RESET - -#ifdef SWAP_HANDS_ENABLE -#define KC_C1R3 SH_TT -#else // SWAP_HANDS_ENABLE -#define KC_C1R3 KC_BSPC -#endif // SWAP_HANDS_ENABLE - -#define BK_LWER LT(_LOWER, KC_BSPC) -#define SP_LWER LT(_LOWER, KC_SPC) -#define DL_RAIS LT(_RAISE, KC_DEL) -#define ET_RAIS LT(_RAISE, KC_ENTER) - -/* OSM keycodes, to keep things clean and easy to change */ -#define KC_MLSF OSM(MOD_LSFT) -#define KC_MRSF OSM(MOD_RSFT) - -#define OS_LGUI OSM(MOD_LGUI) -#define OS_RGUI OSM(MOD_RGUI) -#define OS_LSFT OSM(MOD_LSFT) -#define OS_RSFT OSM(MOD_RSFT) -#define OS_LCTL OSM(MOD_LCTL) -#define OS_RCTL OSM(MOD_RCTL) -#define OS_LALT OSM(MOD_LALT) -#define OS_RALT OSM(MOD_RALT) -#define ALT_APP ALT_T(KC_APP) - -#define MG_NKRO MAGIC_TOGGLE_NKRO - -#define UC_IRNY UC(0x2E2E) -#define UC_CLUE UC(0x203D) - -#ifdef TAP_DANCE_ENABLE -enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4 -}; -#endif // TAP_DANCE_ENABLE - +extern userspace_config_t userspace_config; /* Custom Keycodes for Diablo 3 layer @@ -182,182 +85,13 @@ But since TD() doesn't work when tap dance is disabled We use custom codes here, so we can substitute the right stuff */ #ifdef TAP_DANCE_ENABLE -#define KC_D3_1 TD(TD_D3_1) -#define KC_D3_2 TD(TD_D3_2) -#define KC_D3_3 TD(TD_D3_3) -#define KC_D3_4 TD(TD_D3_4) -#else // TAP_DANCE_ENABLE -#define KC_D3_1 KC_1 -#define KC_D3_2 KC_2 -#define KC_D3_3 KC_3 -#define KC_D3_4 KC_4 -#endif // TAP_DANCE_ENABLE - -/* -Since our quirky block definitions are basically a list of comma separated -arguments, we need a wrapper in order for these definitions to be -expanded before being used as arguments to the LAYOUT_xxx macro. -*/ -#if (!defined(LAYOUT) && defined(KEYMAP)) -#define LAYOUT KEYMAP -#endif - -#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) -#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) -#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) - -/* -Blocks for each of the four major keyboard layouts -Organized so we can quickly adapt and modify all of them -at once, rather than for each keyboard, one at a time. -And this allows for much cleaner blocks in the keymaps. -For instance Tap/Hold for Control on all of the layouts - -NOTE: These are all the same length. If you do a search/replace - then you need to add/remove underscores to keep the - lengths consistent. -*/ - -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L -#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S -#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z - - -#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U -#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L -#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S -#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K -#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN -#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U -#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B -#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F -#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J KC_G, KC_COMM - -#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L -#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R -#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X - - -#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q -#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U -#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W - -#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P -#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N -#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN - - -#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W -#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X - -#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J -#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN -#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH - - -#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J - -#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN -#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H -#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - - -#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J - -#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN -#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H -#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 -#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ - - -#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ -#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ - -#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN -#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR -#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - - - -#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ -#define _________________RAISE_L2__________________ ___________________BLANK___________________ -#define _________________RAISE_L3__________________ ___________________BLANK___________________ - -#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ -#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC -#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END - - - -#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM -#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T - -#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 -#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN -#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT +# define KC_D3_1 TD(TD_D3_1) +# define KC_D3_2 TD(TD_D3_2) +# define KC_D3_3 TD(TD_D3_3) +# define KC_D3_4 TD(TD_D3_4) +#else // TAP_DANCE_ENABLE +# define KC_D3_1 KC_1 +# define KC_D3_2 KC_2 +# define KC_D3_3 KC_3 +# define KC_D3_4 KC_4 +#endif // TAP_DANCE_ENABLE diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c new file mode 100644 index 00000000000..5666d052dcd --- /dev/null +++ b/users/drashna/process_records.c @@ -0,0 +1,162 @@ +#include "drashna.h" + +uint16_t copy_paste_timer; + +__attribute__((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } + +__attribute__((weak)) +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } + +// Defines actions tor my global custom keycodes. Defined in drashna.h file +// Then runs the _keymap's record handier if not processed here +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // If console is enabled, it will print the matrix position and status of each key pressed +#ifdef KEYLOGGER_ENABLE +# if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2) + xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed); +# else + xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); +# endif +#endif // KEYLOGGER_ENABLE + + switch (keycode) { + case KC_QWERTY ... KC_CARPLAX: + if (record->event.pressed) { + set_single_persistent_default_layer(keycode - KC_QWERTY); + } + break; + + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) { + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); + clear_oneshot_mods(); + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); +#ifndef MAKE_BOOTLOADER + if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) +#endif + { +#if defined(__arm__) + send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); +#elif defined(BOOTLOADER_DFU) + send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); +#elif defined(BOOTLOADER_HALFKAY) + send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); +#elif defined(BOOTLOADER_CATERINA) + send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); +#endif // bootloader options + } + if ((temp_mod | temp_osm) & MOD_MASK_CTRL) { + send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); + } +#ifdef RGB_MATRIX_SPLIT_RIGHT + send_string_with_delay_P(PSTR(" RGB_MATRIX_SPLIT_RIGHT=yes"), TAP_CODE_DELAY); +# ifndef OLED_DRIVER_ENABLE + send_string_with_delay_P(PSTR(" OLED_DRIVER_ENABLE=no"), TAP_CODE_DELAY); +# endif +#endif + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); + } + + break; + + case VRSN: // Prints firmware version + if (record->event.pressed) { + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); + } + break; + + // These are a serious of gaming macros. + // Only enables for the viterbi, basically, + // to save on firmware space, since it's limited. +#ifdef MACROS_ENABLED + case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros + if (record->event.pressed) { + userspace_config.is_overwatch ^= 1; + eeconfig_update_user(userspace_config.raw); + } +# ifdef RGBLIGHT_ENABLE + userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); +# endif // RGBLIGHT_ENABLE + break; + case KC_SALT: + return send_game_macro("Salt, salt, salt...", record, false); + case KC_MORESALT: + return send_game_macro("Please sir, can I have some more salt?!", record, false); + case KC_SALTHARD: + return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); + case KC_GOODGAME: + return send_game_macro("Good game, everyone!", record, false); + case KC_GLHF: + return send_game_macro("Good luck, have fun!!!", record, false); + case KC_SYMM: + return send_game_macro("Left click to win!", record, false); + case KC_JUSTGAME: + return send_game_macro("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games.", record, false); + case KC_TORB: + return send_game_macro("That was positively riveting!", record, false); + case KC_AIM: + send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); + return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); + case KC_C9: + return send_game_macro("OMG!!! C9!!!", record, false); + case KC_GGEZ: + return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); +#endif // MACROS_ENABLED + + case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them +#ifdef TAP_DANCE_ENABLE + if (record->event.pressed) { + for (uint8_t index = 0; index < 4; index++) { + diablo_timer[index].key_interval = 0; + } + } +#endif // TAP_DANCE_ENABLE + break; + + case KC_CCCV: // One key copy/paste + if (record->event.pressed) { + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + register_code(KC_LCTL); + tap_code(KC_C); + unregister_code(KC_LCTL); + } else { // Tap, paste + register_code(KC_LCTL); + tap_code(KC_V); + unregister_code(KC_LCTL); + } + } + break; +#ifdef UNICODE_ENABLE + case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ + if (record->event.pressed) { + send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); + } + break; + case UC_TABL: // ┬─┬ノ( º _ ºノ) + if (record->event.pressed) { + send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); + } + break; + case UC_SHRG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + break; + case UC_DISA: // ಠ_ಠ + if (record->event.pressed) { + send_unicode_hex_string("0CA0 005F 0CA0"); + } + break; +#endif + } + return process_record_keymap(keycode, record) && +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + process_record_user_rgb(keycode, record) && +#endif // RGBLIGHT_ENABLE + process_record_secrets(keycode, record); +} diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h new file mode 100644 index 00000000000..8901a6f91c8 --- /dev/null +++ b/users/drashna/process_records.h @@ -0,0 +1,105 @@ +#pragma once +#include "drashna.h" + +#if defined(KEYMAP_SAFE_RANGE) +# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#else +# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#endif + +enum userspace_custom_keycodes { + VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info + KC_QWERTY, // Sets default layer to QWERTY + KC_COLEMAK, // Sets default layer to COLEMAK + KC_DVORAK, // Sets default layer to DVORAK + KC_WORKMAN, // Sets default layer to WORKMAN + KC_NORMAN, // Sets default layer to NORMAN + KC_MALTRON, // Sets default layer to MALTRON + KC_EUCALYN, // Sets default layer to EUCALYN + KC_CARPLAX, // Sets default layer to CARPLAX + KC_DIABLO_CLEAR, // Clears all Diablo Timers + KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) + KC_SALT, // See drashna.c for details + KC_MORESALT, + KC_SALTHARD, + KC_GOODGAME, + KC_SYMM, + KC_JUSTGAME, + KC_GLHF, + KC_TORB, + KC_AIM, + KC_C9, + KC_GGEZ, + KC_MAKE, // Run keyboard's customized make command + KC_RGB_T, // Toggles RGB Layer Indication mode + KC_SECRET_1, // test1 + KC_SECRET_2, // test2 + KC_SECRET_3, // test3 + KC_SECRET_4, // test4 + KC_SECRET_5, // test5 + KC_CCCV, // Hold to copy, tap to paste + KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! + UC_FLIP, // (ಠ痊ಠ)┻━┻ + UC_TABL, // ┬─┬ノ( º _ ºノ) + UC_SHRG, // ¯\_(ツ)_/¯ + UC_DISA, // ಠ_ಠ + NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes +}; + +bool process_record_secrets(uint16_t keycode, keyrecord_t *record); +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) +#define TG_MODS TG(_MODS) +#define TG_GAME TG(_GAMEPAD) +#define OS_LWR OSL(_LOWER) +#define OS_RSE OSL(_RAISE) + +#define KC_SEC1 KC_SECRET_1 +#define KC_SEC2 KC_SECRET_2 +#define KC_SEC3 KC_SECRET_3 +#define KC_SEC4 KC_SECRET_4 +#define KC_SEC5 KC_SECRET_5 + +#define QWERTY KC_QWERTY +#define DVORAK KC_DVORAK +#define COLEMAK KC_COLEMAK +#define WORKMAN KC_WORKMAN + +#define KC_RESET RESET +#define KC_RST KC_RESET + +#ifdef SWAP_HANDS_ENABLE +# define KC_C1R3 SH_TT +#else // SWAP_HANDS_ENABLE +# define KC_C1R3 KC_BSPC +#endif // SWAP_HANDS_ENABLE + +#define BK_LWER LT(_LOWER, KC_BSPC) +#define SP_LWER LT(_LOWER, KC_SPC) +#define DL_RAIS LT(_RAISE, KC_DEL) +#define ET_RAIS LT(_RAISE, KC_ENTER) + +/* OSM keycodes, to keep things clean and easy to change */ +#define KC_MLSF OSM(MOD_LSFT) +#define KC_MRSF OSM(MOD_RSFT) + +#define OS_LGUI OSM(MOD_LGUI) +#define OS_RGUI OSM(MOD_RGUI) +#define OS_LSFT OSM(MOD_LSFT) +#define OS_RSFT OSM(MOD_RSFT) +#define OS_LCTL OSM(MOD_LCTL) +#define OS_RCTL OSM(MOD_RCTL) +#define OS_LALT OSM(MOD_LALT) +#define OS_RALT OSM(MOD_RALT) +#define OS_MEH OSM(MOD_MEH) +#define OS_HYPR OSM(MOD_HYPR) + +#define ALT_APP ALT_T(KC_APP) + +#define MG_NKRO MAGIC_TOGGLE_NKRO + +#define UC_IRNY UC(0x2E2E) +#define UC_CLUE UC(0x203D) diff --git a/users/drashna/readme.md b/users/drashna/readme.md index ffc60060f45..d98d1d0a6bb 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -2,192 +2,14 @@ This is my personal userspace file. Most of my code exists here, as it's heavily shared. -## Custom userspace handlers +* [RGB Customization](readme_rgb.md) +* [Diablo Tap Dancing](readme_tap_dance.md) +* [Keymap Wrappers](readme_wrappers.md) +* [Custom Function Handlers](readme_handlers.md) +* [Secret Macros](readme_secrets.md) +* [Custom Keycodes](readme_keycodes.md) -Specifically QMK works by using customized handlers for everything. This allows for multiple levels of customization. - -`matrix_scan` calls `matrix_scan_quantum`, which alls `matrix_scan_kb`, which calls `matrix_scan_user`. -`process_record` calls a bunch of stuff, but eventually calls `process_record_kb` which calls `process_record_user` -The same goes for `matrix_init`, `layer_state_set`, `led_set`, and a few other functions. - -All (most) `_user` functions are handled here instead. To allow keyboard specific configuration, I've created `_keymap` functions that can be called by the keymap.c files instead. - -This allows for keyboard specific configuration while maintaining the ability to customize the board. - -My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/layouts/community/ergodox/drashna/keymap.c#L297) is a good example of this, as it uses the LEDs as modifier indicators. - -## Keyboard Layout Templates - -This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once. - -This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once. - -The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: - -`#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)` - -Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. - -Credit goes to @jola5 for first implementing this awesome idea. - - -## Custom Keycodes - -Keycodes are defined in the drashna.h file and need to be included in the keymap.c files, so that they can be used there. - -A bunch of macros are present and are only included on boards that are not the Ergodox EZ or Orthodox, as they are not needed for those boards. - -Included is a custom macro for compiling my keyboards. This includes the bootloader target (`:teensy`, `:avrdude`, or `:dfu`), and keeps RGBLIGHT, AUDIO and/or FAUXCLICKY enabled, if it previously was (regardless of the rules file). - -This also includes a modified RESET keycode as well, that sets the underglow to red. - -## Layer Indication - -This uses the `layer_state_set_*` command to change the layer color, to indicate which layer it is on. This includes the default keymap, as well. - -Since this is done via userspace, it is the same between all systems. - -Additionally, there is a custom keycode to toggle layer indication. And all RGB keycodes disable layer indication by default, as well. This way, I can leave special effects doing when I want. - -Also. I use `rgblight_sethsv` since it works with animation modes (that support it). - -## Diablo Layer - -This layer has some special handling. - -When Tap Dances are enabled, this layer has the ability to "spam" keypresses. - -For instance, tapping the TD "1" twice causes the layer to hit "1" ever 1 second (appoximately). This is useful for auto-hotkeying skills (such as bone armor or devour). - -Tappind once disables this, and switching layers temporarily disables this, until you switch back to the layer. - -For critics that think this is cheating, search "diablo 3 num lock auto cast". This is just a simpler method, since I no longer own a normal (non QMK) numpad. - -## Secret Macros - -With help from gitter and Colinta, this adds the ability to add hidden macros from other users. - -First, I have several files that are hidden/excluded from Git/GitHub. These contain everything needed for the macros. To hide these files, open `.git/info/exclude` and add `secrets.c` and `secrets.h` to that file, below the comments. - -And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `.h` file to define the keycodes for the new macros. - - -### .git/info/exclude - -``` -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -/users/drashna/secrets.c -/users/drashna/secrets.h -``` - -Then you can create these files: - -### secrets.c - -```c -#include "drashna.h" // replace with your keymap's "h" file, or whatever file stores the keycodes - -#if (__has_include("secrets.h") && !defined(NO_SECRETS)) -#include "secrets.h" -#else -// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware -// And I'm not familiar enough to know which is better or why... -static const char * const secret[] = { - "test1", - "test2", - "test3", - "test4", - "test5" -}; -#endif - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo - if (!record->event.pressed) { - clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); - send_string_with_delay(secret[keycode - KC_SECRET_1], MACRO_TIMER); - } - return false; - break; - } - return true; -} -``` - -### secrets.h - -```c -static const char * const secrets[] = { - "secret1", - "secret2", - "secret3", - "secret4", - "secret5" -}; -``` - -Replacing the strings with the codes that you need. - -### name.c - -In the `.c` file, you will want to add this to the top: - -```c -__attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} -``` - -This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. - -And then, in the `process_record_user` function, assuming you have `return process_record_keymap(keycode, record)` here, you'll want to replace the "final" return with the following. Otherwise, you want to replace the `return true;` with `return process_record_secrets(keycode, record);` - -```c - return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); -} -``` - -### rules.mk - -Here, you want your `/users//rules.mk` file to "detect" the existence of the `secrets.c` file, and only add it if the file exists. To do so, add this block: - -```make -ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c -endif -``` - -Additionally, if you want to make sure that you can disable the function without messing with the file, you need to add this to your `/users//rules.mk`, so that it catches the flag: - -```make -ifeq ($(strip $(NO_SECRETS)), yes) - OPT_DEFS += -DNO_SECRETS -endif -``` - -Then, if you run `make keyboard:name NO_SECRETS=yes`, it will default to the test strings in your `.c` file, rather than reading from your file. ## Pro Micro Hacking -Well, you can get the QMK DFU bootloader working on the ProMicro. But you need to change fuses. - -What worked to get into the firmware properly was: - -``` -Low: 0x5E High: 0xD9 Extended: 0xC3 Lock: 0x3F -``` - -The reason that there was some issues before, is that JTAG was still enabled, and using some of the pins that the keyboard uses. Disabling JTAG (either by fuse, or modifying the matrix code for splits fixes the issue). - -And for reference, if you want to go back to caterina, the default fuse settings I believe were: - -``` -Low: 0xFF High: 0xD8 Extended: 0xC3 Lock: 0x3F -``` +See [this thread](https://www.reddit.com/r/olkb/comments/8sxgzb/replace_pro_micro_bootloader_with_qmk_dfu/) for details on how to flash QMK DFU to Pro Micros. diff --git a/users/drashna/readme_handlers.md b/users/drashna/readme_handlers.md new file mode 100644 index 00000000000..4abaf514734 --- /dev/null +++ b/users/drashna/readme_handlers.md @@ -0,0 +1,97 @@ +# Custom Userspace Function handlers + +Specifically QMK works by using customized handlers for everything. This allows for multiple levels of customization. + +`matrix_scan` calls `matrix_scan_quantum`, which calls `matrix_scan_kb`, which calls `matrix_scan_user`. +`process_record` calls a bunch of stuff, but eventually calls `process_record_kb` which calls `process_record_user` +The same goes for `matrix_init`, `layer_state_set`, `led_set`, and a few other functions. + +All (most) `_user` functions are handled here, in the userspace instead. To allow keyboard specific configuration, I've created `_keymap` functions that can be called by the keymap.c files instead. + +This allows for keyboard specific configuration while maintaining the ability to customize the board. + +My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/layouts/community/ergodox/drashna/keymap.c) is a good example of this, as it uses the LEDs as modifier indicators. + +But for a list: + +```c +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +void matrix_init_user(void) { + matrix_init_keymap(); +} + +__attribute__((weak)) +void keyboard_post_init_keymap(void){ } + +void keyboard_post_init_user(void){ + keyboard_post_init_keymap(); +} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +void matrix_scan_user(void) { + matrix_scan_keymap(); +} + + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return process_record_keymap(keycode, record); +} + + +__attribute__ ((weak)) +layer_state_t layer_state_set_keymap (layer_state_t state) { + return state; +} + +layer_state_t layer_state_set_user (layer_state_t state) { + return layer_state_set_keymap (state); +} + + +__attribute__ ((weak)) +void led_set_keymap(uint8_t usb_led) {} + +void led_set_user(uint8_t usb_led) { + led_set_keymap(usb_led); +} + + +__attribute__ ((weak)) +void suspend_power_down_keymap(void) {} + +void suspend_power_down_user(void) { + suspend_power_down_keymap(); +} + + +__attribute__ ((weak)) +void suspend_wakeup_init_keymap(void) {} + +void suspend_wakeup_init_user(void) { + suspend_wakeup_init_keymap(); +} + + +__attribute__ ((weak)) +void shutdown_keymap(void) {} + +void shutdown_user (void) { + shutdown_keymap(); +} + +__attribute__ ((weak)) +void eeconfig_init_keymap(void) {} + +void eeconfig_init_user(void) { + eeconfig_init_keymap(); +} +``` diff --git a/users/drashna/readme_keycodes.md b/users/drashna/readme_keycodes.md new file mode 100644 index 00000000000..f5e6fb271ef --- /dev/null +++ b/users/drashna/readme_keycodes.md @@ -0,0 +1,10 @@ + +# Custom Keycodes + +Keycodes are defined in the drashna.h file and need to be included in the keymap.c files, so that they can be used there. + +A bunch of macros are present and are only included on boards that are not the Ergodox EZ or Orthodox, as they are not needed for those boards. + +Included is a custom macro for compiling my keyboards. This includes the bootloader target (`:teensy`, `:avrdude`, or `:dfu`), and keeps RGBLIGHT, AUDIO and/or FAUXCLICKY enabled, if it previously was (regardless of the rules file). + +This also includes a modified RESET keycode as well, that sets the underglow to red. diff --git a/users/drashna/readme_rgb.md b/users/drashna/readme_rgb.md new file mode 100644 index 00000000000..acf01b051e7 --- /dev/null +++ b/users/drashna/readme_rgb.md @@ -0,0 +1,43 @@ +# Layer Indication Code + +At least for RGB Light, the `layer_state_set` function is used to detect the current highest layer, and change the underglow based on that layer. + +This works for both the regular layers, and for the default layers, too. + +I use the sethsv variants of the commands, so that different modes can be used, as well. + +RGB Matrix uses a custom, per board implementation, at the moment. + +# RGB Light Startup Animation + +On startup, if enabled, the board will cycle through the entire hue wheel, starting and ending on the default layer color. + +```c +void keyboard_post_init_rgb(void) { +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) + if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } + if (rgblight_config.enable) { + layer_state_set_user(layer_state); + uint16_t old_hue = rgblight_config.hue; + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); + matrix_scan(); + wait_ms(10); + } + } +#endif + layer_state_set_user(layer_state); +} +``` + +This could probably benefit from some cleanup and better handling. + + +# RGB Light Twinkling + +This enables random twinkling of the LEDs when typing. + +# RGB Light Mod Indicators + +Allows feedback of which mods (oneshot or otherwise) are enabled. diff --git a/users/drashna/readme_secrets.md b/users/drashna/readme_secrets.md new file mode 100644 index 00000000000..a9408dc2efb --- /dev/null +++ b/users/drashna/readme_secrets.md @@ -0,0 +1,123 @@ +# Secret Macros + +With help from gitter and Colinta, this adds the ability to add hidden macros from other users. + +First, I have several files that are hidden/excluded from Git/GitHub. These contain everything needed for the macros. To hide these files, open `.git/info/exclude` and add `secrets.c` and `secrets.h` to that file, below the comments. + +And this requires `KC_SECRET_1` through `KC_SECRET_5` to be added in your keycode enum (usually in your `.h` file) the keycodes for the new macros. + +## Git Exclusion + +To prevent `git` from seeing, or committing the secret files, you can exclude them. What's the point of having secrets if they're posted on GitHub for everyone to see!?! + +You can do this with the `.git/info/exclude` file, so that it's only ignored locally. Unfortunately, that means it's not consistently handled on each system. + +However, if you create a `.gitignore` file in the same folder, you keep things consistent between every system that the code is checked out on. + +```c +secrets.c +secrets.h +``` + +## secrets.c + +Here is the magic. This handles including the "secrets", and adding the custom macros to send them. + +```c +#include "drashna.h" // replace with your keymap's "h" file, or whatever file stores the keycodes + +#if (__has_include("secrets.h") && !defined(NO_SECRETS)) +#include "secrets.h" +#else +// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware +// And I'm not familiar enough to know which is better or why... +static const char * const secret[] = { + "test1", + "test2", + "test3", + "test4", + "test5" +}; +#endif + +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo + if (!record->event.pressed) { + clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); + send_string_with_delay(secret[keycode - KC_SECRET_1], MACRO_TIMER); + } + return false; + break; + } + return true; +} +``` + +## secrets.h + +Now, for the actual secrets! The file needs to look like + +```c +static const char * secrets[] = { + "secret1", + "secret2", + "secret3", + "secret4", + "secret5" +}; +``` + +Replacing the strings with the codes that you need. + +## Process Record + +In whichever file you have your `process_record_*` function in, you will want to add this to the top: + +```c +__attribute__ ((weak)) +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + return true; +} +``` + +This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. + +And then, in the `process_record_user` function, assuming you have `return process_record_keymap(keycode, record)` here, you'll want to replace the "final" return with the following. Otherwise, you want to replace the `return true;` with `return process_record_secrets(keycode, record);` + +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // your existing macro code here. + return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); +} +``` + +## rules.mk + +Here, you want your `/users//rules.mk` file to "detect" the existence of the `secrets.c` file, and only add it if the file exists. + +Additionally, to ensure that it's not added or processed in any way, it checks to see if `NO_SECRETS` is set. This way, if you run `make keyboard:name NO_SECRETS=yes`, it will remove the feature altogether. + +```make +ifneq ($(strip $(NO_SECRETS)), yes) + ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") + SRC += secrets.c + endif +endif +``` + +Alternately, if you want to make sure that you can disable the function without messing with the file, you need to add this to your `/users//rules.mk`, so that it catches the flag: + +```make +ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") + SRC += secrets.c +endif + +ifeq ($(strip $(NO_SECRETS)), yes) + OPT_DEFS += -DNO_SECRETS +endif +``` + +## Extras + +Additionally, because this file isn't present in the repo at all, you could add additional functionality that nobody else will see. diff --git a/users/drashna/readme_tap_dance.md b/users/drashna/readme_tap_dance.md new file mode 100644 index 00000000000..a61dd1f2b08 --- /dev/null +++ b/users/drashna/readme_tap_dance.md @@ -0,0 +1,119 @@ +# Diablo Tap Dances + +My [Tap Dance](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/tap_dances.c) file includes the tap dance declarations, and everything needed for them. + +This is used for making Diablo 3 much easier to plan, especially at high rift levels. + +This works by using Tap Dances. The taps don't actually "do anything". Instead, it sets up the interval for how often to send specific keypresses. As you can tell, this makes automating things very easy. + +For critics that think this is cheating, just search "[diablo 3 num lock auto cast](http://lmgtfy.com/?q=diablo+3+numlock+autocast)". This is just a simpler method, that doesn't require a numpad. + + +## Custom Tap Dance Type +The real fun here is that the tap dances use a custom defined Tap Dance type: + +```c +#define ACTION_TAP_DANCE_DIABLO(index, keycode) { \ + .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ + .user_data = (void *)&((diable_keys_t) { index, keycode }), \ + } +``` +This lets me set an index and keycode for the tap dance. This isn't the cool part yet, but this allows for the really cool stuff. + +The Index is needed because I don't know how to handle it otherwise. + +## The Actual Dances + +These are the custom defined dances that I'm using. It sets up everything for later, using the above custom dance type. + +```c +//Tap Dance Definitions, sets the index and the keycode. +qk_tap_dance_action_t tap_dance_actions[] = { + // tap once to disable, and more to enable timed micros + [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0, KC_1), + [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1, KC_2), + [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2, KC_3), + [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3, KC_4), +}; +``` + +## Custom Data Structures + +First, to get this all working, there are a couple of things that need to be set up. In a header file (or you could put it into the keymap), you need to create a couple of custom structures: + +```c +typedef struct { + uint16_t timer; + uint8_t key_interval; + uint8_t keycode; +} diablo_timer_t; + +typedef struct { + uint8_t index; + uint8_t keycode; +} diable_keys_t; +``` + +The first structure is for tracking each key that is being used. The second is to pass data from the Tap Dance action array to the actual function that we will need. + + +## Custom Arrays + +To facilitate things, you will need a couple of arrays in your `c` file. + +```c +//define diablo macro timer variables +diablo_timer_t diablo_timer[4]; + +// Set the default intervals. Always start with 0 so that it will disable on first hit. +// Otherwise, you will need to hit a bunch of times, or hit the "clear" command +uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; +``` + +The first one (`diablo_timer`) is what keeps track of the timer used for the keys, the interval that it uses, and the actual keycode. This makes managing it a lot easier. + +The second array is a list of predefined intervals, in seconds. You can add more here, or remove entries. It doesn't matter how long the array is, as this is computed automatically. + +## The Magic - Part 1: Master function + +The first part of the magic here is the `diablo_tapdance_master` function. The Tap Dance feature calls this function, directly, and passes some data to the function. Namely, it passes the array of the index and the keycode (`diablo_keys_t` from above). This sets the keycode and the interval for the specific index of `diabolo_timer` based on the number of taps. If you hit it more than the number of items in the array, then it zeroes out the interval, disabling it. + +```c +// Cycle through the times for the macro, starting at 0, for disabled. +void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { + diable_keys_t *diablo_keys = (diable_keys_t *)user_data; + // Sets the keycode based on the index + diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; + + // if the tapdance is hit more than the number of elemints in the array, reset + if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t) ) ) { + diablo_timer[diablo_keys->index].key_interval = 0; + reset_tap_dance(state); + } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) + diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1]; + } +} +``` + +## The Magic - Part 2: The Coup de Grace + +The real core here is the `run_diablo_macro_check()` function. You need to call this from `matrix_scan_user`, as this handles the timer check. + +Specifically, it runs a check for each index of the timer. It checks to see if it's enabled, and if enough time has passed. If enough time has passed, it resets the timer, and will tap the keycode that you set for that index, but only if the Diablo layer is enabled. + +```c +// Checks each of the 4 timers/keys to see if enough time has elapsed +void run_diablo_macro_check(void) { + for (uint8_t index = 0; index < NUM_OF_DIABLO_KEYS; index++) { + // if key_interval is 0, it's disabled, so only run if it's set. If it's set, check the timer. + if ( diablo_timer[index].key_interval && timer_elapsed( diablo_timer[index].timer ) > ( diablo_timer[index].key_interval * 1000 ) ) { + // reset the timer, since enough time has passed + diablo_timer[index].timer = timer_read(); + // send keycode ONLY if we're on the diablo layer. + if (IS_LAYER_ON(_DIABLO)) { + tap_code(diablo_timer[index].keycode); + } + } + } +} +``` diff --git a/users/drashna/readme_wrappers.md b/users/drashna/readme_wrappers.md new file mode 100644 index 00000000000..fd62ff1609a --- /dev/null +++ b/users/drashna/readme_wrappers.md @@ -0,0 +1,11 @@ +## Keyboard Layout Templates + +This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once. + +This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once. + +The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: + +`#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)` + +Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 9ad94c0c3d2..12851e2616c 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -2,209 +2,192 @@ #include "rgb_stuff.h" #include "eeprom.h" +#if defined(RGBLIGHT_ENABLE) extern rgblight_config_t rgblight_config; -extern userspace_config_t userspace_config; +bool has_initialized; +#endif #ifdef RGBLIGHT_ENABLE -void rgblight_sethsv_default_helper(uint8_t index) { - rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); -} -#endif // RGBLIGHT_ENABLE +void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); } +#endif // RGBLIGHT_ENABLE #ifdef INDICATOR_LIGHTS -uint8_t last_mod; -uint8_t last_led; -uint8_t last_osm; -uint8_t current_mod; -uint8_t current_led; -uint8_t current_osm; - - void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { - if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { - if (this_mod & MODS_SHIFT_MASK || this_led & (1< 10) { - rgblight_fadeout *light = &lights[light_index]; - litup = true; - - if (light->life) { - light->life -= 1; - if (biton32(layer_state) == 0) { - sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); +void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive + bool litup = false; + for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) { + if (lights[light_index].enabled && timer_elapsed(lights[light_index].timer) > 10) { + rgblight_fadeout *light = &lights[light_index]; + litup = true; + + if (light->life) { + light->life -= 1; + if (biton32(layer_state) == 0) { + sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); + } + light->timer = timer_read(); + } else { + if (light->enabled && biton32(layer_state) == 0) { + rgblight_sethsv_default_helper(light_index); + } + litup = light->enabled = false; + } } - light->timer = timer_read(); - } - else { - if (light->enabled && biton32(layer_state) == 0) { rgblight_sethsv_default_helper(light_index); } - litup = light->enabled = false; - } } - } - if (litup && biton32(layer_state) == 0) { - rgblight_set(); - } + if (litup && biton32(layer_state) == 0) { + rgblight_set(); + } } void start_rgb_light(void) { - uint8_t indices[RGBLED_NUM]; - uint8_t indices_count = 0; - uint8_t min_life = 0xFF; + uint8_t indices_count = 0; + uint8_t min_life = 0xFF; uint8_t min_life_index = -1; - for (uint8_t index = 0 ; index < RGBLED_NUM ; ++index ) { - if (rgblight_twinkle_is_led_used(index)) { continue; } - if (lights[index].enabled) { - if (min_life_index == -1 || - lights[index].life < min_life) - { - min_life = lights[index].life; - min_life_index = index; + for (uint8_t index = 0; index < RGBLED_NUM; ++index) { + if (rgblight_twinkle_is_led_used(index)) { + continue; + } + if (lights[index].enabled) { + if (min_life_index == -1 || lights[index].life < min_life) { + min_life = lights[index].life; + min_life_index = index; + } + continue; } - continue; - } - indices[indices_count] = index; - ++indices_count; + indices[indices_count] = index; + ++indices_count; } uint8_t light_index; if (!indices_count) { light_index = min_life_index; - } - else { - light_index = indices[rand() % indices_count]; + } else { + light_index = indices[rand() % indices_count]; } rgblight_fadeout *light = &lights[light_index]; - light->enabled = true; - light->timer = timer_read(); - light->life = 0xC0 + rand() % 0x40; + light->enabled = true; + light->timer = timer_read(); + light->life = 0xC0 + rand() % 0x40; light->hue = rgblight_config.hue + (rand() % 0xB4) - 0x54; @@ -212,134 +195,187 @@ void start_rgb_light(void) { } #endif - bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { + keycode = keycode & 0xFF; + } switch (keycode) { #ifdef RGBLIGHT_TWINKLE - case KC_A ... KC_SLASH: - case KC_F1 ... KC_F12: - case KC_INSERT ... KC_UP: - case KC_KP_SLASH ... KC_KP_DOT: - case KC_F13 ... KC_F24: - case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: - if (record->event.pressed) { start_rgb_light(); } - return true; break; -#endif // RGBLIGHT_TWINKLE - case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal + case KC_A ... KC_SLASH: + case KC_F1 ... KC_F12: + case KC_INSERT ... KC_UP: + case KC_KP_SLASH ... KC_KP_DOT: + case KC_F13 ... KC_F24: + case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: + if (record->event.pressed) { + start_rgb_light(); + } + return true; + break; +#endif // RGBLIGHT_TWINKLE + case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + if (record->event.pressed) { + userspace_config.rgb_layer_change ^= 1; + xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); + eeconfig_update_user(userspace_config.raw); + if (userspace_config.rgb_layer_change) { + layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) + } + } +#endif // RGBLIGHT_ENABLE + return false; + break; #ifdef RGBLIGHT_ENABLE - if (record->event.pressed) { - userspace_config.rgb_layer_change ^= 1; - xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_layer_change) { - layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) - } + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions + if (record->event.pressed) { // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + if (userspace_config.rgb_layer_change) { + userspace_config.rgb_layer_change = false; + xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); + eeconfig_update_user(userspace_config.raw); + } + } + return true; + break; +#endif // RGBLIGHT_ENABLE } -#endif // RGBLIGHT_ENABLE - return false; break; -#ifdef RGBLIGHT_ENABLE - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled - if (userspace_config.rgb_layer_change) { - userspace_config.rgb_layer_change = false; - xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - } - } - return true; break; -#endif // RGBLIGHT_ENABLE - } return true; } +void keyboard_post_init_rgb(void) { +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) + bool is_enabled = rgblight_config.enable; + if (userspace_config.rgb_layer_change) { + rgblight_enable_noeeprom(); + } + if (rgblight_config.enable) { + layer_state_set_user(layer_state); + uint16_t old_hue = rgblight_config.hue; + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom((i + old_hue) % 255, 255, 255); + matrix_scan(); + wait_ms(10); + } + } + if (!is_enabled) { + rgblight_disable_noeeprom(); + } - -void matrix_init_rgb(void) { -#ifdef INDICATOR_LIGHTS - current_mod = last_mod = get_mods(); - current_led = last_led = host_keyboard_leds(); - current_osm = last_osm = get_oneshot_mods(); #endif - - if (userspace_config.rgb_layer_change) { - rgblight_enable_noeeprom(); - switch (biton32(eeconfig_read_default_layer())) { - case _COLEMAK: - rgblight_sethsv_noeeprom_magenta(); break; - case _DVORAK: - rgblight_sethsv_noeeprom_springgreen(); break; - case _WORKMAN: - rgblight_sethsv_noeeprom_goldenrod(); break; - default: - rgblight_sethsv_noeeprom_cyan(); break; - } - rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); - } + layer_state_set_user(layer_state); } void matrix_scan_rgb(void) { #ifdef RGBLIGHT_TWINKLE - scan_rgblight_fadeout(); -#endif // RGBLIGHT_ENABLE + scan_rgblight_fadeout(); +#endif // RGBLIGHT_ENABLE #ifdef INDICATOR_LIGHTS - matrix_scan_indicator(); + matrix_scan_indicator(); #endif - } - -uint32_t layer_state_set_rgb(uint32_t state) { +layer_state_t layer_state_set_rgb(layer_state_t state) { #ifdef RGBLIGHT_ENABLE - if (userspace_config.rgb_layer_change) { - switch (biton32(state)) { - case _MACROS: - rgblight_sethsv_noeeprom_orange(); - userspace_config.is_overwatch ? rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 2) : rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 3); - break; - case _MEDIA: - rgblight_sethsv_noeeprom_chartreuse(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1); - break; - case _GAMEPAD: - rgblight_sethsv_noeeprom_orange(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2); - break; - case _DIABLO: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - break; - case _RAISE: - rgblight_sethsv_noeeprom_yellow(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - break; - case _LOWER: - rgblight_sethsv_noeeprom_green(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - break; - case _ADJUST: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - break; - default: // for any other layers, or the default layer - switch (biton32(default_layer_state)) { - case _COLEMAK: - rgblight_sethsv_noeeprom_magenta(); break; - case _DVORAK: - rgblight_sethsv_noeeprom_springgreen(); break; - case _WORKMAN: - rgblight_sethsv_noeeprom_goldenrod(); break; - default: - rgblight_sethsv_noeeprom_cyan(); break; - } - biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it - break; + if (userspace_config.rgb_layer_change) { + switch (biton32(state)) { + case _MACROS: + rgblight_sethsv_noeeprom_orange(); + userspace_config.is_overwatch ? rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2) : rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 3); + break; + case _MEDIA: + rgblight_sethsv_noeeprom_chartreuse(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1); + break; + case _GAMEPAD: + rgblight_sethsv_noeeprom_orange(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2); + break; + case _DIABLO: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + break; + case _RAISE: + rgblight_sethsv_noeeprom_yellow(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + break; + case _LOWER: + rgblight_sethsv_noeeprom_green(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + break; + case _ADJUST: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + break; + default: // for any other layers, or the default layer + switch (biton32(default_layer_state)) { + case _COLEMAK: + rgblight_sethsv_noeeprom_magenta(); + break; + case _DVORAK: + rgblight_sethsv_noeeprom_springgreen(); + break; + case _WORKMAN: + rgblight_sethsv_noeeprom_goldenrod(); + break; + case _NORMAN: + rgblight_sethsv_noeeprom_coral(); + break; + case _MALTRON: + rgblight_sethsv_noeeprom_yellow(); + break; + case _EUCALYN: + rgblight_sethsv_noeeprom_pink(); + break; + case _CARPLAX: + rgblight_sethsv_noeeprom_blue(); + break; + default: + rgblight_sethsv_noeeprom_cyan(); + break; + } + biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it + break; + } } -// layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow - } -#endif // RGBLIGHT_ENABLE +#endif // RGBLIGHT_ENABLE - return state; + return state; } +#ifdef RGB_MATRIX_ENABLE +# include "lib/lib8tion/lib8tion.h" +extern led_config_t g_led_config; +void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type) { + HSV hsv = {hue, sat, val}; + if (hsv.v > rgb_matrix_config.hsv.v) { + hsv.v = rgb_matrix_config.hsv.v; + } + switch (mode) { + case 1: // breathing + { + uint16_t time = scale16by8(g_rgb_counters.tick, speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = hsv_to_rgb(hsv); + for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], led_type)) { + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + } + break; + } + default: // Solid Color + { + RGB rgb = hsv_to_rgb(hsv); + for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], led_type)) { + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + } + break; + } + } +} +#endif diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index 50c75c8c3ce..ce45d6a00bb 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h @@ -1,15 +1,23 @@ +#pragma once #include "quantum.h" +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix.h" +#endif typedef struct { - bool enabled; - uint8_t hue; + bool enabled; + uint8_t hue; uint16_t timer; - uint8_t life; + uint8_t life; } rgblight_fadeout; -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); -void scan_rgblight_fadeout(void); -void matrix_init_rgb(void); -void matrix_scan_rgb(void); -uint32_t layer_state_set_rgb(uint32_t state); +bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); +void scan_rgblight_fadeout(void); +void keyboard_post_init_rgb(void); +void matrix_scan_rgb(void); +layer_state_t layer_state_set_rgb(layer_state_t state); +layer_state_t default_layer_state_set_rgb(layer_state_t state); +void rgblight_sethsv_default_helper(uint8_t index); +void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type); diff --git a/users/drashna/rgblight_breathe_table.h b/users/drashna/rgblight_breathe_table.h new file mode 100644 index 00000000000..05d347fcd3b --- /dev/null +++ b/users/drashna/rgblight_breathe_table.h @@ -0,0 +1,116 @@ +#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE +#define RGBLIGHT_EFFECT_BREATHE_TABLE + +const uint8_t rgblight_effect_breathe_table[] PROGMEM = { + /* #define RGBLIGHT_EFFECT_BREATHE_CENTER 0.00 */ + /* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 256 + 0x44, 0x45, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x4e, + 0x4f, 0x51, 0x52, 0x54, 0x55, 0x57, 0x58, 0x5a, + 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x64, 0x65, 0x67, + 0x69, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x73, 0x75, + 0x77, 0x79, 0x7b, 0x7c, 0x7e, 0x80, 0x82, 0x84, + 0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8f, 0x91, 0x93, + 0x95, 0x97, 0x99, 0x9b, 0x9d, 0x9f, 0xa1, 0xa3, + 0xa5, 0xa7, 0xa9, 0xaa, 0xac, 0xae, 0xb0, 0xb2, + 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, 0xbf, 0xc1, + 0xc3, 0xc5, 0xc7, 0xc9, 0xca, 0xcc, 0xce, 0xd0, + 0xd1, 0xd3, 0xd5, 0xd6, 0xd8, 0xda, 0xdb, 0xdd, + 0xde, 0xe0, 0xe1, 0xe3, 0xe4, 0xe5, 0xe7, 0xe8, + 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, + 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf8, + 0xf9, 0xfa, 0xfa, 0xfb, 0xfc, 0xfc, 0xfc, 0xfd, + 0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfd, + 0xfd, 0xfc, 0xfc, 0xfc, 0xfb, 0xfa, 0xfa, 0xf9, + 0xf8, 0xf8, 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, + 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, 0xeb, 0xe9, + 0xe8, 0xe7, 0xe5, 0xe4, 0xe3, 0xe1, 0xe0, 0xde, + 0xdd, 0xdb, 0xda, 0xd8, 0xd6, 0xd5, 0xd3, 0xd1, + 0xd0, 0xce, 0xcc, 0xca, 0xc9, 0xc7, 0xc5, 0xc3, + 0xc1, 0xbf, 0xbe, 0xbc, 0xba, 0xb8, 0xb6, 0xb4, + 0xb2, 0xb0, 0xae, 0xac, 0xaa, 0xa9, 0xa7, 0xa5, + 0xa3, 0xa1, 0x9f, 0x9d, 0x9b, 0x99, 0x97, 0x95, + 0x93, 0x91, 0x8f, 0x8d, 0x8b, 0x8a, 0x88, 0x86, + 0x84, 0x82, 0x80, 0x7e, 0x7c, 0x7b, 0x79, 0x77, + 0x75, 0x73, 0x72, 0x70, 0x6e, 0x6c, 0x6a, 0x69, + 0x67, 0x65, 0x64, 0x62, 0x60, 0x5f, 0x5d, 0x5c, + 0x5a, 0x58, 0x57, 0x55, 0x54, 0x52, 0x51, 0x4f, + 0x4e, 0x4c, 0x4b, 0x4a, 0x48, 0x47, 0x45, 0x44 + #endif /* 256 bytes table */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 128 + 0x44, 0x47, 0x4a, 0x4c, + 0x4f, 0x52, 0x55, 0x58, + 0x5c, 0x5f, 0x62, 0x65, + 0x69, 0x6c, 0x70, 0x73, + 0x77, 0x7b, 0x7e, 0x82, + 0x86, 0x8a, 0x8d, 0x91, + 0x95, 0x99, 0x9d, 0xa1, + 0xa5, 0xa9, 0xac, 0xb0, + 0xb4, 0xb8, 0xbc, 0xbf, + 0xc3, 0xc7, 0xca, 0xce, + 0xd1, 0xd5, 0xd8, 0xdb, + 0xde, 0xe1, 0xe4, 0xe7, + 0xe9, 0xec, 0xee, 0xf0, + 0xf2, 0xf4, 0xf6, 0xf8, + 0xf9, 0xfa, 0xfc, 0xfc, + 0xfd, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, + 0xfd, 0xfc, 0xfb, 0xfa, + 0xf8, 0xf7, 0xf5, 0xf3, + 0xf1, 0xef, 0xed, 0xeb, + 0xe8, 0xe5, 0xe3, 0xe0, + 0xdd, 0xda, 0xd6, 0xd3, + 0xd0, 0xcc, 0xc9, 0xc5, + 0xc1, 0xbe, 0xba, 0xb6, + 0xb2, 0xae, 0xaa, 0xa7, + 0xa3, 0x9f, 0x9b, 0x97, + 0x93, 0x8f, 0x8b, 0x88, + 0x84, 0x80, 0x7c, 0x79, + 0x75, 0x72, 0x6e, 0x6a, + 0x67, 0x64, 0x60, 0x5d, + 0x5a, 0x57, 0x54, 0x51, + 0x4e, 0x4b, 0x48, 0x45 + #endif /* 128 bytes table */ + + #if RGBLIGHT_BREATHE_TABLE_SIZE == 64 + 0x44, 0x4a, + 0x4f, 0x55, + 0x5c, 0x62, + 0x69, 0x70, + 0x77, 0x7e, + 0x86, 0x8d, + 0x95, 0x9d, + 0xa5, 0xac, + 0xb4, 0xbc, + 0xc3, 0xca, + 0xd1, 0xd8, + 0xde, 0xe4, + 0xe9, 0xee, + 0xf2, 0xf6, + 0xf9, 0xfc, + 0xfd, 0xfe, + 0xfe, 0xfe, + 0xfd, 0xfb, + 0xf8, 0xf5, + 0xf1, 0xed, + 0xe8, 0xe3, + 0xdd, 0xd6, + 0xd0, 0xc9, + 0xc1, 0xba, + 0xb2, 0xaa, + 0xa3, 0x9b, + 0x93, 0x8b, + 0x84, 0x7c, + 0x75, 0x6e, + 0x67, 0x60, + 0x5a, 0x54, + 0x4e, 0x48 + #endif /* 64 bytes table */ +}; + +static const int table_scale = 256/sizeof(rgblight_effect_breathe_table); + +#endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */ diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 964c96c5227..b414036a473 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -1,39 +1,55 @@ -SRC += drashna.c +SRC += drashna.c \ + process_records.c + +LINK_TIME_OPTIMIZATION_ENABLE = yes +SPACE_CADET_ENABLE = no ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c + SRC += secrets.c endif ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dances.c + SRC += tap_dances.c endif -EXTRAFLAGS += -flto + ifeq ($(strip $(NO_SECRETS)), yes) OPT_DEFS += -DNO_SECRETS endif ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - SRC += rgb_stuff.c - ifeq ($(strip $(INDICATOR_LIGHTS)), yes) - OPT_DEFS += -DINDICATOR_LIGHTS - endif - ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes) - OPT_DEFS += -DRGBLIGHT_TWINKLE - endif - ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) - OPT_DEFS += -DRGBLIGHT_NOEEPROM - endif + SRC += rgb_stuff.c + ifeq ($(strip $(INDICATOR_LIGHTS)), yes) + OPT_DEFS += -DINDICATOR_LIGHTS + endif + ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes) + OPT_DEFS += -DRGBLIGHT_TWINKLE + endif + ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) + OPT_DEFS += -DRGBLIGHT_NOEEPROM + endif + ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) + OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION + endif +endif + +RGB_MATRIX_ENABLE ?= no +ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) + SRC += rgb_stuff.c endif + ifeq ($(strip $(MACROS_ENABLED)), yes) OPT_DEFS += -DMACROS_ENABLED endif ifdef CONSOLE_ENABLE - ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) - OPT_DEFS += -DKEYLOGGER_ENABLE - endif + ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) + OPT_DEFS += -DKEYLOGGER_ENABLE + endif endif +ifeq ($(strip $(MAKE_BOOTLOADER)), yes) + OPT_DEFS += -DMAKE_BOOTLOADER +endif diff --git a/users/drashna/send_unicode.c b/users/drashna/send_unicode.c deleted file mode 100644 index cacfe1dc852..00000000000 --- a/users/drashna/send_unicode.c +++ /dev/null @@ -1,58 +0,0 @@ -// Written by konstantin: vomindoraan -#include "send_unicode.h" -#include -#include - -__attribute__((weak)) -void send_unicode_hex_string(const char* str) { - if (!str) { return; } // Safety net - - while (*str) { - // Find the next code point (token) in the string - for (; *str == ' '; str++); - size_t n = strcspn(str, " "); // Length of the current token - char code_point[n+1]; - strncpy(code_point, str, n); - code_point[n] = '\0'; // Make sure it's null-terminated - - // Normalize the code point: make all hex digits lowercase - for (char *p = code_point; *p; p++) { - *p = tolower((unsigned char)*p); - } - - // Send the code point as a Unicode input string - unicode_input_start(); - send_string(code_point); - unicode_input_finish(); - - str += n; // Move to the first ' ' (or '\0') after the current token - } -} - -// (ノಠ痊ಠ)ノ彡┻━┻ -// send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); - -//Old code -// (╯°□°)╯ ︵ ┻━┻ - #if 0 - register_code(KC_RSFT); - tap(KC_9); - unregister_code(KC_RSFT); - process_unicode((0x256F | QK_UNICODE), record); // Arm - process_unicode((0x00B0 | QK_UNICODE), record); // Eye - process_unicode((0x25A1 | QK_UNICODE), record); // Mouth - process_unicode((0x00B0 | QK_UNICODE), record); // Eye - register_code(KC_RSFT); - tap(KC_0); - unregister_code(KC_RSFT); - process_unicode((0x256F | QK_UNICODE), record); // Arm - tap(KC_SPC); - process_unicode((0x0361 | QK_UNICODE), record); // Flippy - tap(KC_SPC); - process_unicode((0x253B | QK_UNICODE), record); // Table - process_unicode((0x2501 | QK_UNICODE), record); // Table - process_unicode((0x253B | QK_UNICODE), record); // Table - #endif - - -// If you need a good converter: https://r12a.github.io/app-conversion/ diff --git a/users/drashna/tap_dances.c b/users/drashna/tap_dances.c index 3466758530a..65019ab7512 100644 --- a/users/drashna/tap_dances.c +++ b/users/drashna/tap_dances.c @@ -1,65 +1,56 @@ -#include "drashna.h" #include "tap_dances.h" +#define NUM_OF_DIABLO_KEYS 4 +// define diablo macro timer variables +diablo_timer_t diablo_timer[NUM_OF_DIABLO_KEYS]; -//define diablo macro timer variables -uint16_t diablo_timer[4]; -uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; -uint8_t diablo_key_time[4]; - -// has the correct number of seconds elapsed (as defined by diablo_times) -bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; }; +// Set the default intervals. Always start with 0 so that it will disable on first hit. +// Otherwise, you will need to hit a bunch of times, or hit the "clear" command +uint8_t diablo_times[] = {0, 1, 3, 5, 10, 30}; // Cycle through the times for the macro, starting at 0, for disabled. -// Max of six values, so don't exceed -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { - if (state->count >= 7) { - diablo_key_time[diablo_key] = diablo_times[0]; - reset_tap_dance(state); - } else { - diablo_key_time[diablo_key] = diablo_times[state->count - 1]; - } +void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { + diable_keys_t *diablo_keys = (diable_keys_t *)user_data; + // Sets the keycode based on the index + diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; + + // if the tapdance is hit more than the number of elemints in the array, reset + if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t))) { + diablo_timer[diablo_keys->index].key_interval = 0; + reset_tap_dance(state); + } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) + diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1]; + } } -// Would rather have one function for all of this, but no idea how to do that... -void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); } -void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); } -void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); } -void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); } +// clang-format off +// One function to rule them all!! Where the Magic Sauce lies +#define ACTION_TAP_DANCE_DIABLO(index, keycode) { \ + .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ + .user_data = (void *)&((diable_keys_t) { index, keycode }), \ + } +// clang-format on -//Tap Dance Definitions +// Tap Dance Definitions, sets the index and the keycode. qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), + // tap once to disable, and more to enable timed micros + [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0, KC_1), + [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1, KC_2), + [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2, KC_3), + [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3, KC_4), }; -// Sends the key press to system, but only if on the Diablo layer -void send_diablo_keystroke(uint8_t diablo_key) { - if (IS_LAYER_ON(_DIABLO)) { - switch (diablo_key) { - case 0: - tap_code(KC_1); break; - case 1: - tap_code(KC_2); break; - case 2: - tap_code(KC_3); break; - case 3: - tap_code(KC_4); break; - } - } -} - // Checks each of the 4 timers/keys to see if enough time has elapsed -// Runs the "send string" command if enough time has passed, and resets the timer. void run_diablo_macro_check(void) { - uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - if (check_dtimer(dtime) && diablo_key_time[dtime]) { - diablo_timer[dtime] = timer_read(); - send_diablo_keystroke(dtime); + for (uint8_t index = 0; index < NUM_OF_DIABLO_KEYS; index++) { + // if key_interval is 0, it's disabled, so only run if it's set. If it's set, check the timer. + if (diablo_timer[index].key_interval && timer_elapsed(diablo_timer[index].timer) > (diablo_timer[index].key_interval * 1000)) { + // reset the timer, since enough time has passed + diablo_timer[index].timer = timer_read(); + // send keycode ONLY if we're on the diablo layer. + if (IS_LAYER_ON(_DIABLO)) { + tap_code(diablo_timer[index].keycode); + } + } } - } } diff --git a/users/drashna/tap_dances.h b/users/drashna/tap_dances.h index 8935753f6cf..44fa0b93487 100644 --- a/users/drashna/tap_dances.h +++ b/users/drashna/tap_dances.h @@ -1,7 +1,30 @@ -//define diablo macro timer variables -extern uint16_t diablo_timer[4]; +#pragma once +#include "drashna.h" + +// define diablo macro timer variables extern uint8_t diablo_times[]; -extern uint8_t diablo_key_time[4]; +typedef struct { + uint16_t timer; + uint8_t key_interval; + uint8_t keycode; +} diablo_timer_t; + +typedef struct { + uint8_t index; + uint8_t keycode; +} diable_keys_t; +extern diablo_timer_t diablo_timer[]; void run_diablo_macro_check(void); + +#ifdef TAP_DANCE_ENABLE +// clang-format off +enum { + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4 +}; +// clang-format on +#endif // TAP_DANCE_ENABLE diff --git a/users/drashna/template.c b/users/drashna/template.c index e6b50c961b6..d90e6bdecf2 100644 --- a/users/drashna/template.c +++ b/users/drashna/template.c @@ -50,12 +50,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; - break; case VRSN: if (record->event.pressed) { SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); @@ -68,11 +62,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { __attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { +layer_state_t layer_state_set_keymap (layer_state_t state) { return state; } -uint32_t layer_state_set_user (uint32_t state) { +layer_state_t layer_state_set_user (layer_state_t state) { return layer_state_set_keymap (state); } @@ -128,4 +122,3 @@ void shutdown_keymap(void) {} void shutdown_user (void) { shutdown_keymap(); } - diff --git a/users/drashna/template.h b/users/drashna/template.h index 5b3a93de5fb..dd1c487604a 100644 --- a/users/drashna/template.h +++ b/users/drashna/template.h @@ -9,9 +9,7 @@ #define BASE 0 enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - VRSN, + VRSN = SAFE_RANGE, // can always be here KC_MAKE, KC_RESET, NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h new file mode 100644 index 00000000000..a87247071f3 --- /dev/null +++ b/users/drashna/wrappers.h @@ -0,0 +1,184 @@ +#pragma once +#include "drashna.h" +/* +Since our quirky block definitions are basically a list of comma separated +arguments, we need a wrapper in order for these definitions to be +expanded before being used as arguments to the LAYOUT_xxx macro. +*/ +#if (!defined(LAYOUT) && defined(KEYMAP)) +# define LAYOUT KEYMAP +#endif + +// clang-format off +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) +#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) +#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) +#define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__) + +/* +Blocks for each of the four major keyboard layouts +Organized so we can quickly adapt and modify all of them +at once, rather than for each keyboard, one at a time. +And this allows for much cleaner blocks in the keymaps. +For instance Tap/Hold for Control on all of the layouts + +NOTE: These are all the same length. If you do a search/replace + then you need to add/remove underscores to keep the + lengths consistent. +*/ + +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G +#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D +#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O +#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH + +#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B +#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G +#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V + +#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O +#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I +#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X + +#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L +#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S +#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z + + +#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U +#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X + +#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L +#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S +#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z + +#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G +#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V + +#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I +#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K +#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G +#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN +#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U +#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B +#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F +#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J, KC_G, KC_COMM + +#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L +#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R +#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X + + +#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q +#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U +#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W + +#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P +#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N +#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN + + +#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W +#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X + +#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J +#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN +#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH + + +#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J + +#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN +#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H +#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + + +#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J + +#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN +#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H +#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + + +#define _________________WHITE_R1__________________ KC_V, KC_Y, KC_D, KC_COMM, KC_QUOT +#define _________________WHITE_R2__________________ KC_A, KC_T, KC_H, KC_E, KC_B +#define _________________WHITE_R3__________________ KC_P, KC_K, KC_G, KC_W, KC_Q + +#define _________________WHITE_L1__________________ KC_INT1, KC_J, KC_M, KC_L, KC_U +#define _________________WHITE_L2__________________ KC_MINS, KC_C, KC_S, KC_N, KC_O // KC_I +#define _________________WHITE_L3__________________ KC_X, KC_R, KC_F, KC_DOT, KC_Z + + +#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 +#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +#define ___________________BLANK___________________ _______, _______, _______, _______, _______ + + +#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ +#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ + +#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN +#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR +#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + + + +#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ +#define _________________RAISE_L2__________________ ___________________BLANK___________________ +#define _________________RAISE_L3__________________ ___________________BLANK___________________ + +#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ +#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC +#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + + + +#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG +#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T + +#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 +#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN +#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT + +// clang-format on diff --git a/users/edvorakjp/edvorakjp.c b/users/edvorakjp/edvorakjp.c index cff1a123e48..892ce4be3ba 100644 --- a/users/edvorakjp/edvorakjp.c +++ b/users/edvorakjp/edvorakjp.c @@ -1,47 +1,7 @@ -#include "eeprom.h" #include "edvorakjp.h" -bool japanese_mode; -uint16_t time_on_pressed; - -edvorakjp_config_t edvorakjp_config; - -uint8_t eeconfig_read_edvorakjp(void) { - return eeprom_read_byte(EECONFIG_EDVORAK); -} - -void eeconfig_update_edvorakjp(uint8_t val) { - eeprom_update_byte(EECONFIG_EDVORAK, val); -} - -void dvorakj_layer_off(void) { - layer_off(_EDVORAKJ1); - layer_off(_EDVORAKJ2); -} - -void update_japanese_mode(bool new_state) { - japanese_mode = new_state; - if (japanese_mode) { - if (edvorakjp_config.enable_kc_lang) { - SEND_STRING(SS_TAP(X_LANG1)); - } else { - SEND_STRING(SS_LALT("`")); - } - } else { - dvorakj_layer_off(); - if (edvorakjp_config.enable_kc_lang) { - SEND_STRING(SS_TAP(X_LANG2)); - } else { - SEND_STRING(SS_LALT("`")); - } - } -} - void matrix_init_user(void) { - japanese_mode = false; - time_on_pressed = 0; - edvorakjp_config.raw = eeconfig_read_edvorakjp(); - + edvorakjp_status_init(); matrix_init_keymap(); } @@ -58,189 +18,15 @@ uint32_t layer_state_set_keymap(uint32_t state) { return state; } -/* - * Each process_record_* methods defined here are - * return false if handle edvorak_keycodes, or return true others. - */ -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record) { - if (!(edvorakjp_config.enable_jp_extra_layer &&\ - (default_layer_state == 1UL<<_EDVORAK) &&\ - japanese_mode &&\ - record->event.pressed)) { - return true; - } - - // consonant keys - // layer_on(J1) or layer_on(J2) are defined based on key positions. - switch (keycode) { - // right hand's left side w/o N - case KC_F: - case KC_G: - case KC_R: - case KC_D: - case KC_T: - case KC_B: - case KC_H: - case KC_J: - layer_on(_EDVORAKJ1); - register_code(keycode); - unregister_code(keycode); - return false; - - // N: toggle layer - case KC_N: - biton32(layer_state) == _EDVORAK ? layer_on(_EDVORAKJ1) : dvorakj_layer_off(); - register_code(keycode); - unregister_code(keycode); - return false; - - // left hand and right hand's right side - case KC_X: - case KC_C: - case KC_V: - case KC_Z: - case KC_P: - case KC_Y: - case KC_W: - case KC_Q: - case KC_S: - case KC_M: - case KC_K: - case KC_L: - layer_on(_EDVORAKJ2); - register_code(keycode); - unregister_code(keycode); - return false; - } - - // vowel keys, symbol keys and modifier keys - dvorakj_layer_off(); - switch (keycode) { - // combination vowel keys - case KC_AI: - SEND_STRING("ai"); - return false; - case KC_OU: - SEND_STRING("ou"); - return false; - case KC_EI: - SEND_STRING("ei"); - return false; - case KC_ANN: - SEND_STRING("ann"); - return false; - case KC_ONN: - SEND_STRING("onn"); - return false; - case KC_ENN: - SEND_STRING("enn"); - return false; - case KC_INN: - SEND_STRING("inn"); - return false; - case KC_UNN: - SEND_STRING("unn"); - return false; - - // AOEIU and other (symbol, modifier) keys - default: - return true; - } -} - -bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_MAC: - edvorakjp_config.enable_kc_lang = true; - eeconfig_update_edvorakjp(edvorakjp_config.raw); - return false; - case KC_WIN: - edvorakjp_config.enable_kc_lang = false; - eeconfig_update_edvorakjp(edvorakjp_config.raw); - return false; - case KC_EXTON: - edvorakjp_config.enable_jp_extra_layer = true; - eeconfig_update_edvorakjp(edvorakjp_config.raw); - return false; - case KC_EXTOFF: - edvorakjp_config.enable_jp_extra_layer = false; - eeconfig_update_edvorakjp(edvorakjp_config.raw); - return false; - } - return true; -} - -bool process_record_layer(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case EDVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_EDVORAK); - } - return false; - case QWERTY: - if (record->event.pressed) { - dvorakj_layer_off(); - set_single_persistent_default_layer(_QWERTY); - } - return false; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - time_on_pressed = record->event.time; - } else { - layer_off(_LOWER); - - if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { - update_japanese_mode(false); - } - time_on_pressed = 0; - } - return false; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - time_on_pressed = record->event.time; - } else { - layer_off(_RAISE); - - if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { - update_japanese_mode(true); - } - time_on_pressed = 0; - } - return false; - default: - return true; - } -} - -bool process_record_ime(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_JPN: - if (record->event.pressed) { - update_japanese_mode(true); - } - return false; - case KC_ENG: - if (record->event.pressed) { - update_japanese_mode(false); - } - return false; - default: - return true; - } -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return process_record_keymap(keycode, record) &&\ - process_record_edvorakjp_ext(keycode, record) &&\ + process_record_edvorakjp_swap_scln(keycode, record) &&\ process_record_edvorakjp_config(keycode, record) &&\ process_record_layer(keycode, record) &&\ process_record_ime(keycode, record); } + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/users/edvorakjp/edvorakjp.h b/users/edvorakjp/edvorakjp.h index f67400686a4..688cdeffb3a 100644 --- a/users/edvorakjp/edvorakjp.h +++ b/users/edvorakjp/edvorakjp.h @@ -1,5 +1,5 @@ -#ifndef USERSPACE -#define USERSPACE +#ifndef EDVORAKJP +#define EDVORAKJP #include "quantum.h" #include "action_layer.h" @@ -8,20 +8,8 @@ extern keymap_config_t keymap_config; -typedef union { - uint8_t raw; - struct { - bool enable_jp_extra_layer : 1; - bool enable_kc_lang : 1; // for macOS - }; -} edvorakjp_config_t; -extern edvorakjp_config_t edvorakjp_config; - enum edvorakjp_layers { _EDVORAK = 0, - _EDVORAKJ1, - _EDVORAKJ2, - _QWERTY, _LOWER, _RAISE, _ADJUST, @@ -30,46 +18,53 @@ enum edvorakjp_layers { enum edvorakjp_keycodes { EDVORAK = SAFE_RANGE, - QWERTY, LOWER, RAISE, KC_MAC, KC_WIN, - KC_EXTON, - KC_EXTOFF, KC_JPN, KC_ENG, - KC_AI, - KC_OU, - KC_EI, - KC_ANN, - KC_ONN, - KC_ENN, - KC_INN, - KC_UNN, NEW_SAFE_RANGE }; -uint8_t eeconfig_read_edvorakjp(void); -void eeconfig_update_edvorakjp(uint8_t val); +#define KC_LC(k) LCTL_T(KC_##k) +#define KC_LS(k) LSFT_T(KC_##k) +#define KC_LA(k) LALT_T(KC_##k) +#define KC_LG(k) LGUI_T(KC_##k) +#define KC_RC(k) RCTL_T(KC_##k) +#define KC_RS(k) RSFT_T(KC_##k) +#define KC_RG(k) RGUI_T(KC_##k) +#define KC_RA(k) RALT_T(KC_##k) + +enum tap_dance_code { + TD_LOWER = 0, + TD_RAISE +}; +// base void dvorakj_layer_off(void); -void update_japanese_mode(bool new_state); void matrix_init_user(void); void matrix_init_keymap(void); uint32_t layer_state_set_user(uint32_t state); uint32_t layer_state_set_keymap(uint32_t state); +bool process_record_user(uint16_t keycode, keyrecord_t *record); +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); + +// status +void edvorakjp_status_init(void); +bool get_enable_kc_lang(void); +void set_enable_kc_lang(bool new_state); +bool get_japanese_mode(void); +void set_japanese_mode(bool new_state); /* * Each process_record_* methods defined here are * return false if processed, or return true if not processed. * You can add your original macros in process_record_keymap() in keymap.c. */ -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); -bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record); +bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record); bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record); bool process_record_layer(uint16_t keycode, keyrecord_t *record); bool process_record_ime(uint16_t keycode, keyrecord_t *record); -bool process_record_user(uint16_t keycode, keyrecord_t *record); -#endif +#endif // EDVORAKJP diff --git a/users/edvorakjp/edvorakjp_process_record.c b/users/edvorakjp/edvorakjp_process_record.c new file mode 100644 index 00000000000..ecc8db93637 --- /dev/null +++ b/users/edvorakjp/edvorakjp_process_record.c @@ -0,0 +1,89 @@ +#include "edvorakjp.h" + +#if TAP_DANCE_ENABLE != yes +static uint16_t time_on_pressed; +#endif +/* + * Each process_record_* methods defined here are + * return false if handle edvorak_keycodes, or return true others. + */ +bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record) { +#ifdef SWAP_SCLN + static const uint8_t shift_bits = MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT); + static uint8_t last_mods_status; + if (keycode == KC_SCLN) { + if (record->event.pressed) { + last_mods_status = get_mods(); + + // invert shift_bits + if (last_mods_status & shift_bits) { + set_mods(last_mods_status & ~shift_bits); + } else { + set_mods(last_mods_status | MOD_BIT(KC_LSFT)); + } + } else { + set_mods(last_mods_status); + last_mods_status = 0; + } + } +#endif + return true; +} + +bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MAC: + case KC_WIN: + if (record->event.pressed) { + set_enable_kc_lang(keycode == KC_MAC); + } + return false; + } + return true; +} + +bool process_record_layer(uint16_t keycode, keyrecord_t *record) { +#if TAP_DANCE_ENABLE != yes + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + time_on_pressed = record->event.time; + } else { + layer_off(_LOWER); + + if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { + set_japanese_mode(false); + } + time_on_pressed = 0; + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + time_on_pressed = record->event.time; + } else { + layer_off(_RAISE); + + if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { + set_japanese_mode(true); + } + time_on_pressed = 0; + } + return false; + } +#endif + return true; +} + +bool process_record_ime(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_JPN: + case KC_ENG: + if (record->event.pressed) { + set_japanese_mode(keycode == KC_JPN); + } + return false; + } + return true; +} diff --git a/users/edvorakjp/edvorakjp_status.c b/users/edvorakjp/edvorakjp_status.c new file mode 100644 index 00000000000..128fc3bd28e --- /dev/null +++ b/users/edvorakjp/edvorakjp_status.c @@ -0,0 +1,64 @@ +#include "eeprom.h" +#include "edvorakjp.h" + +typedef union { + uint8_t raw; + struct { + bool enable_kc_lang; // for macOS + }; +} edvorakjp_config_t; +static edvorakjp_config_t edvorakjp_config; + +typedef struct { + bool japanese_mode; +} edvorakjp_state_t; +static edvorakjp_state_t edvorakjp_state; + +/* + * private methods + */ +uint8_t eeconfig_read_edvorakjp(void) { + return eeprom_read_byte(EECONFIG_EDVORAK); +} + +void eeconfig_update_edvorakjp(uint8_t val) { + eeprom_update_byte(EECONFIG_EDVORAK, val); +} + +/* + * public methods + */ +void edvorakjp_status_init(void) { + edvorakjp_state.japanese_mode = false; + edvorakjp_config.raw = eeconfig_read_edvorakjp(); +} + +bool get_enable_kc_lang(void) { + return edvorakjp_config.enable_kc_lang; +} + +void set_enable_kc_lang(bool new_state) { + edvorakjp_config.enable_kc_lang = new_state; + eeconfig_update_edvorakjp(edvorakjp_config.raw); +} + +bool get_japanese_mode(void) { + return edvorakjp_state.japanese_mode; +} + +void set_japanese_mode(bool new_state) { + edvorakjp_state.japanese_mode = new_state; + if (edvorakjp_state.japanese_mode) { + if (edvorakjp_config.enable_kc_lang) { + SEND_STRING(SS_TAP(X_LANG1)); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + if (edvorakjp_config.enable_kc_lang) { + SEND_STRING(SS_TAP(X_LANG2)); + } else { + SEND_STRING(SS_LALT("`")); + } + } +} diff --git a/users/edvorakjp/edvorakjp_tap_dance.c b/users/edvorakjp/edvorakjp_tap_dance.c new file mode 100644 index 00000000000..d5369f9266e --- /dev/null +++ b/users/edvorakjp/edvorakjp_tap_dance.c @@ -0,0 +1,73 @@ +#include "edvorakjp.h" +#include "process_keycode/process_tap_dance.h" + +enum tap_state { + NONE = 0, + SINGLE_TAP = 1, + DOUBLE_TAP = 2, + HOLD +}; + +typedef struct { + uint8_t lower; + uint8_t raise; +} td_status_t; +static td_status_t td_status = {NONE, NONE}; + +int cur_dance(qk_tap_dance_state_t *state) { + if (state->interrupted || !state->pressed) { + return state->count == 1 ? SINGLE_TAP : DOUBLE_TAP; + } else { + return HOLD; + } +} + +void td_lower_finished(qk_tap_dance_state_t *state, void *user_data) { + td_status.lower = cur_dance(state); + switch(td_status.lower) { + case SINGLE_TAP: + set_japanese_mode(false); + break; + case DOUBLE_TAP: + set_japanese_mode(false); + register_code(KC_ESC); + break; + case HOLD: + break; + } + layer_on(_LOWER); +} + +void td_lower_reset(qk_tap_dance_state_t *state, void *user_data) { + if (td_status.lower == DOUBLE_TAP) { + unregister_code(KC_ESC); + } + layer_off(_LOWER); + td_status.lower = NONE; +} + +void td_raise_finished(qk_tap_dance_state_t *state, void *user_data) { + td_status.raise = cur_dance(state); + switch(td_status.raise) { + case DOUBLE_TAP: + // same as single + case SINGLE_TAP: + set_japanese_mode(true); + break; + case HOLD: + break; + } + layer_on(_RAISE); +} + +void td_raise_reset(qk_tap_dance_state_t *state, void *user_data) { + layer_off(_RAISE); + td_status.raise = NONE; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LOWER] = + ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_lower_finished, td_lower_reset, 100), + [TD_RAISE] = + ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_raise_finished, td_raise_reset, 100) +}; diff --git a/users/edvorakjp/readme.md b/users/edvorakjp/readme.md index d7ec7428526..679d84b3def 100644 --- a/users/edvorakjp/readme.md +++ b/users/edvorakjp/readme.md @@ -5,49 +5,20 @@ epaew's Enhanced Dvorak layout for Japanese Programmer ## Layout overview This is a sample. You can swap any symbol keys and modifier keys. -- Base layer (for ansi layout) +- Basic layout (for ansi) ``` //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+ ` , ! , @ , # , $ , % , ^ , & , * , ( , ) , [ , ] , BSPC , //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+ - TAB , ' , , , . , P , Y , F , G , R , W , Q , / , = , \ , + TAB , ' , , , . , Y , Q , F , G , R , W , P , / , = , \ , //+------++---++---++---++---++---++---++---++---++---++---++---++---+-------+ CAPS , A , O , E , I , U , D , T , N , S , M , - , ENT , //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-----------+ - LSFT , ; , X , C , V , Z , B , H , J , K , L , RSFT , + LSFT , : , X , C , V , Z , H , J , K , L , B , RSFT , //+------+--+---++----++---+----+----+----+----+-+--+---++----++------+------+ LCTL , LGUI , LALT , SPACE , RALT , RGUI , MENU , RCTL //+------+------+------+-------------------------+------+------+------+------+ ``` -- Base layer (for iso layout) - - Two C keys are placed, it's on purpose. -``` - //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+ - ` , ! , @ , # , $ , % , ^ , & , * , ( , ) , [ , ] , BSPC , - //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+ - TAB , ' , , , . , P , Y , F , G , R , W , C , / , = , - //+------++---++---++---++---++---++---++---++---++---++---++---++---++ - CAPS , A , O , E , I , U , D , T , N , S , M , ; , - , ENT , - //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+------+ - LSFT , Q , X , C , V , Z , B , H , J , K , L , \ , RSFT , - //+------+--+---++----++---+----+----+----+----+-+--+---++----++---+--+------+ - LCTL , LGUI , LALT , SPACE , RALT , RGUI , MENU , RCTL - //+------+------+------+-------------------------+------+------+------+------+ -``` -- Additional layer (common, blanks are transparent) -``` - //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+ - , , , , , , , , , , , , , , - //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+ - , AI , OU , EI , , , , , , , , , , , - //+------++---++---++---++---++---++---++---++---++---++---++---++---+-------+ - , A , O , E , I , U , , Y1 , N , Y2 , , , , - //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-----------+ - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , - //+------+--+---++----++---+----+----+----+----+-+--+---++----++------+------+ - , , , , , , , - //+------+------+------+-------------------------+------+------+------+------+ -``` And you can see [my iris keyboard layout](../../keyboards/iris/keymaps/edvorakjp/keymap.c) for sample implementation, too. @@ -57,32 +28,25 @@ This is a sample. You can swap any symbol keys and modifier keys. - IME 切り替えキー - 長押しでレイヤー切り替え、短押しでIME切り替え - macOS(かな/英数)、Windows(Alt+\`)の両方に対応 - - DvorakJP()を参考にした日本語入力用キーの導入 - - 拗音入力用のYキーを追加配置 - - 二重母音入力用のキー(AI, OU, EI) - - 撥音入力用のキー(ANN, ONN, ENN, INN, UNN) - - いずれかの子音を押下することで Additional layer が出現し、いずれかの母音を押下することで Base layer に戻ります(※1※2) - - ※1促音の入力に使うため、また連続で同じ指での打鍵を減らすために、 - FGRDTNBHJ を押下した場合はy1が、それ以外の子音を押下した場合はy2が出現しません - - ※2撥音の入力のため、nを2連打すると、Base layerに戻ります - Define some custom keys for typing Japanese - IME switching - act as LOWER/RAISE when hold, act as IME switching when tapped - for macOS(かな/英数), for Windows(Alt+\`) - - oneshot combination keys, inspired from DvorakJP () - - additional Y key to enter a contracted sound - - diphthong keys (AI, OU, EI) - - syllabic nasal (ANN, ONN, ENN, INN, UNN) - - Additional layer is appeared when you taps any consonant keys, and disappeared when you taps any diphthong keys. ## for Programmer - Dvorak 配列をベースに、ショートカットでよく利用される XCV は QWERTY 配列の位置を維持 -- Vimユーザのために、HJKL キーを横並びで配置 +- 一部にVimユーザ用のキー配置を実施 + - HJKL キーを横並びで配置 + - Shift押下時と非押下時で、";"キーの挙動を入れ替え + (`config.h` 内で `#define SWAP_SCLN` の宣言が必要です) - デフォルトレイヤーには、数字キーの代わりに記号 `!@#$%^&*()` を配置 - mainly based on Dvorak layout, but XCV is available in the same position of QWERTY layout -- HJKL is lining side by side, for Vim users +- for Vim users + - HJKL is lining side by side + - swap the ";" key behavior. i.e. send ":" normally and send ";" when you hold shift. + (need `#define SWAP_SCLN` in your `config.h`) - we can type `!@#$%^&*()` keys without shift keys in base layer ## License diff --git a/users/edvorakjp/rules.mk b/users/edvorakjp/rules.mk index 4fb73918640..587c3b8d2e6 100644 --- a/users/edvorakjp/rules.mk +++ b/users/edvorakjp/rules.mk @@ -1 +1,7 @@ -SRC += edvorakjp.c +SRC += edvorakjp.c \ + edvorakjp_process_record.c \ + edvorakjp_status.c + +ifeq ($(TAP_DANCE_ENABLE), yes) +SRC += edvorakjp_tap_dance.c +endif diff --git a/users/gordon/gordon.h b/users/gordon/gordon.h index 92641a8aae1..49b4f0569fe 100644 --- a/users/gordon/gordon.h +++ b/users/gordon/gordon.h @@ -6,11 +6,9 @@ // Fillers to make layering more clear -#define _______ KC_TRNS #define ________ KC_TRNS #define _________ KC_TRNS #define _XXXXXX_ KC_TRNS -#define XXXXXXX KC_NO // KC codes that are too long #define DOLLAR KC_DOLLAR diff --git a/users/ishtob/ishtob.h b/users/ishtob/ishtob.h index 2c47fce791a..29d6f250c43 100644 --- a/users/ishtob/ishtob.h +++ b/users/ishtob/ishtob.h @@ -43,9 +43,6 @@ enum userspace_keycodes { #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl @@ -71,6 +68,170 @@ enum userspace_layers { }; */ +/* +Since our quirky block definitions are basically a list of comma separated +arguments, we need a wrapper in order for these definitions to be +expanded before being used as arguments to the LAYOUT_xxx macro. +*/ +#if (!defined(LAYOUT) && defined(KEYMAP)) +#define LAYOUT KEYMAP +#endif + +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) +#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) + +/* +Blocks for each of the four major keyboard layouts +Organized so we can quickly adapt and modify all of them +at once, rather than for each keyboard, one at a time. +And this allows for much cleaner blocks in the keymaps. +For instance Tap/Hold for Control on all of the layouts + +NOTE: These are all the same length. If you do a search/replace + then you need to add/remove underscores to keep the + lengths consistent. +*/ + +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, LT_MC(KC_SCLN) +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G +#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D +#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O) +#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH + +#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B +#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G +#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V + +#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, LT_MC(KC_O) +#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I +#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X + +#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L +#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S) +#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z + + +#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G +#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V + +#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, LT_MC(KC_I) +#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K +#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G +#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN +#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, LT_MC(KC_U) +#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B +#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F +#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J KC_G, KC_COMM + +#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L +#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, LT_MC(KC_R) +#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X + + +#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q +#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U +#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W + +#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P +#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, LT_MC(KC_N) +#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN + + +#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W +#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X + +#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J +#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, LT_MC(KC_SCLN) +#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH + + +#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J + +#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN +#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, LT_MC(KC_H) +#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + + +#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J + +#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN +#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, LT_MC(KC_H) +#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + + +#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 +#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +#define __________________LONG_FUNC_LEFT___________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6 +#define __________________LONG_FUNC_RIGHT__________________ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 + +#define ___________________BLANK___________________ _______, _______, _______, _______, _______ + + +#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ +#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ + +#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN +#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR +#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + + + +#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ +#define _________________RAISE_L2__________________ ___________________BLANK___________________ +#define _________________RAISE_L3__________________ ___________________BLANK___________________ + +#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ +#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC +#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + + + +#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG +#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T + +#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 +#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN +#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT + -#endif // !USERSPACE \ No newline at end of file +#endif // !USERSPACE diff --git a/users/jarred/config.h b/users/jarred/config.h index f282088144d..e63ec4d9b7a 100644 --- a/users/jarred/config.h +++ b/users/jarred/config.h @@ -39,6 +39,7 @@ #undef TAPPING_TERM #undef IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD #define TAPPING_TOGGLE 1 #define TAPPING_TERM 200 #define IGNORE_MOD_TAP_INTERRUPT diff --git a/users/jarred/jarred.c b/users/jarred/jarred.c index 33162b6891a..b37c4cfbb75 100644 --- a/users/jarred/jarred.c +++ b/users/jarred/jarred.c @@ -17,16 +17,81 @@ #include "jarred.h" #include "version.h" +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +bool lowerPressed, raisePressed; + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { + case LOWER: + case RAISE: + // Both lower and raise activate the same layer + if (record->event.pressed) { + layer_on(_LW); + } else { + layer_off(_LW); + } + + // But keep track of each to active adjust layer + if (keycode == LOWER) { + lowerPressed = record->event.pressed; + } else { + raisePressed = record->event.pressed; + } + + // When both are pressed, activate adjust + if (lowerPressed && raisePressed) { + layer_on(_NP); + } else { + layer_off(_NP); + } + + break; + + case NUMPAD: + if (record->event.pressed) { + layer_on(_NP); + } else { + layer_off(_NP); + } + break; + + case NAVI: + if (record->event.pressed) { + layer_on(_NV); + } else { + layer_off(_NV); + + // Release mods set by ALT_TAB and CTL_TAB + unregister_code(KC_LALT); + unregister_code(KC_LCTL); + } + break; + case VRSN: // Prints firmware version if (record->event.pressed) { send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); } - return false; + break; + + case ALT_TAB: + if (record->event.pressed) { + register_code(KC_LALT); + tap_code(KC_TAB); + } + break; + + case CTL_TAB: + if (record->event.pressed) { + register_code(KC_LCTL); + tap_code(KC_TAB); + } break; } - return true; + return process_record_keymap(keycode, record); } diff --git a/users/jarred/jarred.h b/users/jarred/jarred.h index a6774ce264e..49b1253be5f 100644 --- a/users/jarred/jarred.h +++ b/users/jarred/jarred.h @@ -13,6 +13,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +// TODO: Add Alt-Tab to nav + W layer #ifndef USERSPACE #define USERSPACE @@ -20,31 +22,61 @@ #include "quantum.h" enum userspace_custom_keycodes { - VRSN = SAFE_RANGE // Prints QMK Firmware and board info + VRSN = SAFE_RANGE, // Prints QMK Firmware and board info + ALT_TAB, + CTL_TAB, + + // Layer keys + NAVI, + LOWER, + RAISE, + NUMPAD }; // Layers -#define _QW 0 -#define _LW 1 -#define _NV 2 -#define _NP 3 -#define _MS 4 // Mouse +enum { + _QW = 0, + _GAME, + _LW, + _NV, + _NP, + _MS, +}; + +#define MS_A LT(_MS,KC_A) -#define MS_A LT(_MS,KC_A) +#define WIN_Z LGUI_T(KC_Z) +#define CTL_SLH RCTL_T(KC_SLSH) // Wrappers #define LAYOUT_planck_grid_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) +#define LAYOUT_plaid_grid_wrapper(...) LAYOUT_plaid_grid(__VA_ARGS__) +#define LAYOUT_atreus62_grid_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_ergotravel_grid_wrapper(...) LAYOUT(__VA_ARGS__) /* Qwerty Layer */ #define QWERTY_L1 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T -#define QWERTY_L2 MO(_NV), KC_A, KC_S, KC_D, KC_F, KC_G -#define QWERTY_L3 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B -#define QWERTY_L4 KC_LCTL, KC_LGUI, MO(_NP), KC_LALT, MO(_LW), KC_SPC +#define QWERTY_L2 NAVI, KC_A, KC_S, KC_D, KC_F, KC_G +#define QWERTY_L3 KC_LSFT, WIN_Z, KC_X, KC_C, KC_V, KC_B +#define QWERTY_L4 KC_LCTL, KC_LGUI, NUMPAD, KC_LALT, LOWER, KC_SPC #define QWERTY_R1 KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC #define QWERTY_R2 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT -#define QWERTY_R3 KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT -#define QWERTY_R4 KC_ENT, MO(_LW), KC_RALT, MO(_MS), KC_APP, KC_RCTL +#define QWERTY_R3 KC_N, KC_M, KC_COMM, KC_DOT, CTL_SLH, KC_RSFT +#define QWERTY_R4 KC_ENT, RAISE, KC_RALT, MO(_MS), KC_APP, KC_RCTL + +#define QWERTY_4_DOX KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT + +/* Game Layer */ +#define GAME_L1 _______, _______, _______, _______, _______, _______ +#define GAME_L2 _______, _______, _______, _______, _______, _______ +#define GAME_L3 _______, _______, _______, _______, _______, _______ +#define GAME_L4 _______, _______, KC_LALT, LOWER, KC_SPC, KC_SPC + +#define GAME_R1 _______, _______, _______, _______, _______, _______ +#define GAME_R2 _______, _______, _______, _______, _______, _______ +#define GAME_R3 _______, _______, _______, _______, _______, _______ +#define GAME_R4 _______, _______, _______, _______, _______, _______ /* Lower / Upper Layer */ #define LOWER_L1 KC_ESC , KC_1, KC_2, KC_3, KC_4, KC_5 @@ -57,27 +89,33 @@ enum userspace_custom_keycodes { #define LOWER_R3 KC_F12, KC_GRV, _______, _______, _______, _______ #define LOWER_R4 _______, _______, _______, _______, _______, _______ +#define LOWER_4_DOX _______, _______, _______, _______, _______, _______ + /* Navigation Layer */ #define NAV_L1 _______, _______, _______, KC_LGUI, KC_DEL, KC_BSPC #define NAV_L2 _______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT #define NAV_L3 _______, _______, _______, _______, _______, _______ -#define NAV_L4 _______, _______, _______, _______, _______, _______ +#define NAV_L4 _______, _______, _______, CTL_TAB, ALT_TAB, _______ #define NAV_R1 _______, KC_HOME, KC_UP , KC_END , KC_INS, _______ #define NAV_R2 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______ #define NAV_R3 _______, KC_PGUP, KC_PGDN, _______, _______, _______ -#define NAV_R4 _______, _______, _______, _______, _______, _______ +#define NAV_R4 _______, KC_APP, _______, _______, _______, _______ + +#define NAV_4_DOX CTL_TAB, ALT_TAB, _______, _______, KC_APP, _______ /* Numpad Layer */ -#define NUMPAD_L1 RGB_TOG, RGB_MOD, _______, _______, RGB_HUD, RGB_HUI +#define NUMPAD_L1 RGB_TOG, RGB_MOD,RGB_RMOD, _______, RGB_HUD, RGB_HUI #define NUMPAD_L2 BL_TOGG, BL_STEP, BL_BRTG, _______, RGB_SAD, RGB_SAI #define NUMPAD_L3 _______, _______, _______, _______, RGB_VAD, RGB_VAI -#define NUMPAD_L4 RESET, VRSN, _______, _______, RGB_SPD, RGB_SPI +#define NUMPAD_L4 _______, _______, _______, _______, RGB_SPD, RGB_SPI + +#define NUMPAD_R1 DF(_QW),DF(_GAME), _______, _______, _______, RESET +#define NUMPAD_R2 _______, _______, _______, _______, _______, _______ +#define NUMPAD_R3 VRSN, _______, _______, _______, _______, _______ +#define NUMPAD_R4 _______, _______, _______, _______, _______, _______ -#define NUMPAD_R1 _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______ -#define NUMPAD_R2 _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______ -#define NUMPAD_R3 _______, KC_P1, KC_P2, KC_P3, KC_PAST, KC_ENT -#define NUMPAD_R4 _______, KC_P0, XXXXXXX, KC_PDOT, KC_PSLS, KC_ENT +#define NUMPAD_4_DOX _______, _______, _______, _______, _______, _______ /* Mouse Layer */ #define MOUSE_L1 _______, _______, _______, _______, _______, _______ @@ -90,11 +128,20 @@ enum userspace_custom_keycodes { #define MOUSE_R3 _______, _______, _______, _______, _______, _______ #define MOUSE_R4 KC_BTN2, _______, _______, _______, _______, _______ +#define MOUSE_4_DOX _______, _______, _______, _______, _______, _______ + +#define BLANK_12 KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO + #define QWERTY_1_12 QWERTY_L1, QWERTY_R1 #define QWERTY_2_12 QWERTY_L2, QWERTY_R2 #define QWERTY_3_12 QWERTY_L3, QWERTY_R3 #define QWERTY_4_12 QWERTY_L4, QWERTY_R4 +#define GAME_1_12 GAME_L1, GAME_R1 +#define GAME_2_12 GAME_L2, GAME_R2 +#define GAME_3_12 GAME_L3, GAME_R3 +#define GAME_4_12 GAME_L4, GAME_R4 + #define LOWER_1_12 LOWER_L1, LOWER_R1 #define LOWER_2_12 LOWER_L2, LOWER_R2 #define LOWER_3_12 LOWER_L3, LOWER_R3 @@ -116,6 +163,7 @@ enum userspace_custom_keycodes { #define MOUSE_4_12 MOUSE_L4, MOUSE_R4 #define QWERTY_4x12 QWERTY_1_12, QWERTY_2_12, QWERTY_3_12, QWERTY_4_12 +#define GAME_4x12 GAME_1_12, GAME_2_12, GAME_3_12, GAME_4_12 #define LOWER_4x12 LOWER_1_12, LOWER_2_12, LOWER_3_12, LOWER_4_12 #define NAV_4x12 NAV_1_12, NAV_2_12, NAV_3_12, NAV_4_12 #define NUMPAD_4x12 NUMPAD_1_12, NUMPAD_2_12, NUMPAD_3_12, NUMPAD_4_12 diff --git a/users/jarred/readme.md b/users/jarred/readme.md index 9d4e926e743..e2f44219b01 100644 --- a/users/jarred/readme.md +++ b/users/jarred/readme.md @@ -2,4 +2,13 @@ Keymaps: -- [Planck](../../keyboards/planck/keymaps/jarred/readme.md) +- [Ortho 4x12](../../layouts/community/ortho_4x12/jarred/readme.md) + +- [CRKBD](../../keyboards/crkbd/keymaps/jarred/readme.md) +- [Atreus 62](../../keyboards/ergotravel/keymaps/jarred/readme.md) +- [ErgoTravel](../../keyboards/ergotravel/keymaps/jarred/readme.md) +- [xd75](../../keyboards/xd75/keymaps/jarred/readme.md) + +- [satan](../../keyboards/satan/keymaps/jarred/readme.md) +- [dz60](../../keyboards/dz60/keymaps/jarred/readme.md) +- [org60](../../keyboards/org60/keymaps/jarred/readme.md) diff --git a/users/kageurufu/config.h b/users/kageurufu/config.h new file mode 100644 index 00000000000..938d43dd5a3 --- /dev/null +++ b/users/kageurufu/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/users/kageurufu/custom_rgb.c b/users/kageurufu/custom_rgb.c new file mode 100644 index 00000000000..8e99129b0b5 --- /dev/null +++ b/users/kageurufu/custom_rgb.c @@ -0,0 +1,18 @@ +#include "custom_rgb.h" + +#if defined(RGBLIGHT_ENABLE) + extern rgblight_config_t rgblight_config; + rgblight_config_t _pushed_rgblight_config; + #define push_rgb_config() { if (_pushed_rgblight_config.raw == 0) { _pushed_rgblight_config.raw = rgblight_config.raw; } } + #define pop_rgb_config() { if (_pushed_rgblight_config.raw == 0) { rgblight_config.raw = _pushed_rgblight_config.raw; _pushed_rgblight_config.raw = 0; } } +#elif defined(RGB_MATRIX_ENABLE) + extern rgb_config_t rgb_matrix_config; + rgb_config_t _pushed_rgb_matrix_config; + #define push_rgb_config() _pushed_rgb_matrix_config.raw = rgb_matrix_config.raw + #define pop_rgb_config() rgb_matrix_config.raw = _pushed_rgb_matrix_config.raw +#endif + + +bool process_record_rgb(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/users/kageurufu/custom_rgb.h b/users/kageurufu/custom_rgb.h new file mode 100644 index 00000000000..62d64fd4c5a --- /dev/null +++ b/users/kageurufu/custom_rgb.h @@ -0,0 +1,3 @@ +#pragma once + +#include "kageurufu.h" diff --git a/users/kageurufu/kageurufu.c b/users/kageurufu/kageurufu.c new file mode 100644 index 00000000000..e16af571bdd --- /dev/null +++ b/users/kageurufu/kageurufu.c @@ -0,0 +1,12 @@ +#include "kageurufu.h" +#include "quantum.h" +#include "process_records.h" + +#ifdef RGBLIGHT_ENABLE + //Following line allows macro to read current RGB settings + extern rgblight_config_t rgblight_config; + rgblight_config_t backup_rgblight_config; + + __attribute__((weak)) + uint8_t RGBLIGHT_MODS[] = {0}; +#endif diff --git a/users/kageurufu/kageurufu.h b/users/kageurufu/kageurufu.h new file mode 100644 index 00000000000..76a0126fec7 --- /dev/null +++ b/users/kageurufu/kageurufu.h @@ -0,0 +1,5 @@ +#pragma once + +#include "quantum.h" +#include "process_records.h" +#include "layouts.h" diff --git a/users/kageurufu/layouts.h b/users/kageurufu/layouts.h new file mode 100644 index 00000000000..eccfa0700ed --- /dev/null +++ b/users/kageurufu/layouts.h @@ -0,0 +1,58 @@ +#pragma once + + +#define _________________NUMROW_L1_________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define _________________NUMROW_R1_________________ KC_6, KC_7, KC_8, KC_9, KC_0 + + +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G +#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D +#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O +#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B +#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G +#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V + +#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O +#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH + + +#define ________________FUNCTION_L1________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6 +#define ________________FUNCTION_L2________________ _______, KC_PGDN, KC_UP, KC_PGUP, _______, KC_LBRC +#define ________________FUNCTION_L3________________ ADJ, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______ +#define ________________FUNCTION_L4________________ _______, _______, _______, _______, _______, _______ +#define ________________FUNCTION_L5________________ _______, _______, _______, _______, ADJ, _______ + +#define ________________FUNCTION_R1________________ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 +#define ________________FUNCTION_R2________________ KC_RBRC, KC_7, KC_UP, KC_9, KC_0, KC_HOME +#define ________________FUNCTION_R3________________ _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_RBRC, KC_END +#define ________________FUNCTION_R4________________ _______, _______, _______, KC_PGDN, KC_PGUP, _______ +#define ________________FUNCTION_R5________________ ADJ, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU + + +#define _________________ADJUST_L1_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6 +#define _________________ADJUST_L2_________________ _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______ +#define _________________ADJUST_L3_________________ _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______ +#define _________________ADJUST_L4_________________ _______, _______, _______, _______, _______, _______ +#define _________________ADJUST_L5_________________ _______, _______, _______, _______, _______, _______ + +#define _________________ADJUST_R1_________________ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 +#define _________________ADJUST_R2_________________ _______, _______, _______, _______, _______, KC_DEL +#define _________________ADJUST_R3_________________ _______, QWERTY, COLEMAK, CMAK_DH, _______, _______ +#define _________________ADJUST_R4_________________ _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI +#define _________________ADJUST_R5_________________ _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD diff --git a/users/kageurufu/process_records.c b/users/kageurufu/process_records.c new file mode 100644 index 00000000000..63dbcff89b1 --- /dev/null +++ b/users/kageurufu/process_records.c @@ -0,0 +1,44 @@ +#include "kageurufu.h" + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if(record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + } + + + return process_record_keymap(keycode, record) && +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + process_record_rgb(keycode, record) && +#endif // RGBLIGHT_ENABLE; + true; +} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + + +__attribute__ ((weak)) +bool process_record_rgb(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/users/kageurufu/process_records.h b/users/kageurufu/process_records.h new file mode 100644 index 00000000000..d1c50a4112b --- /dev/null +++ b/users/kageurufu/process_records.h @@ -0,0 +1,27 @@ +#pragma once +#include "kageurufu.h" + +#define FN_ESC LT(_FN, KC_ESC) +#define FN MO(_FN) +#define ADJ MO(_ADJ) + +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _COLEMAK_DH, + _FN, + _ADJ, + ADDITIONAL_LAYER +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + CMAK_DH, + RGBRST, + KAGEURUFU_SAFE_RANGE +}; + + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +bool process_record_rgb(uint16_t keycode, keyrecord_t *record); diff --git a/users/kageurufu/readme.md b/users/kageurufu/readme.md new file mode 100644 index 00000000000..57dd85d6bed --- /dev/null +++ b/users/kageurufu/readme.md @@ -0,0 +1,14 @@ +Copyright 2018- Franklyn Tackitt franklyn@tackitt.net @kageurufu + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/users/kageurufu/rules.mk b/users/kageurufu/rules.mk new file mode 100644 index 00000000000..df9ae559a64 --- /dev/null +++ b/users/kageurufu/rules.mk @@ -0,0 +1,15 @@ +SRC += kageurufu.c \ + process_records.c \ + custom_rgb.c + +# Link time optimization, should save on firmware size +EXTRAFLAGS += -flto + + +# Some usual defaults +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +RGBLIGHT_ENABLE = no +RGBLIGHT_ANIMATIONS = yes diff --git a/users/konstantin/config.h b/users/konstantin/config.h new file mode 100644 index 00000000000..d712e79d3f5 --- /dev/null +++ b/users/konstantin/config.h @@ -0,0 +1,29 @@ +#pragma once + +#define FORCE_NKRO + +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 + +#define NO_ACTION_FUNCTION +#define NO_ACTION_MACRO +#define NO_ACTION_ONESHOT + +#undef RGBLIGHT_ANIMATIONS +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 +#define TAP_HOLD_CAPS_DELAY 50 + +#define UNICODE_CYCLE_PERSIST false +#define UNICODE_SELECTED_MODES UC_WINC, UC_WIN, UC_LNX +#define UNICODE_KEY_WINC KC_RGUI diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c new file mode 100644 index 00000000000..c56c9490fcd --- /dev/null +++ b/users/konstantin/konstantin.c @@ -0,0 +1,114 @@ +#include "konstantin.h" + +__attribute__((weak)) +void keyboard_pre_init_keymap(void) {} + +void keyboard_pre_init_user(void) { + keyboard_pre_init_keymap(); +} + +__attribute__((weak)) +void eeconfig_init_keymap(void) {} + +void eeconfig_init_user(void) { + eeconfig_init_keymap(); +} + +__attribute__((weak)) +void keyboard_post_init_keymap(void) {} + +void keyboard_post_init_user(void) { + keyboard_post_init_keymap(); +} + +__attribute__((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keymap(keycode, record)) { + return false; + } + + switch (keycode) { + uint16_t kc; +#ifdef LAYER_FN + static bool fn_lock = false; + + case FN_FNLK: + if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { + fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this + } + return true; +#endif + + case KC_ESC: + if (record->event.pressed) { +#ifdef LAYER_NUMPAD // Disable Numpad layer before Fn layer + if (IS_LAYER_ON(L_NUMPAD)) { + layer_off(L_NUMPAD); + return false; + } +#endif +#ifdef LAYER_FN + if (IS_LAYER_ON(L_FN) && fn_lock) { + layer_off(L_FN); + return fn_lock = false; + } +#endif + } + return true; + + case CLEAR: + if (record->event.pressed) { + CLEAN_MODS( + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + ) + } + return false; + + case DST_P_R: + kc = (get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV; + CLEAN_MODS( + (record->event.pressed ? register_code16 : unregister_code16)(kc); + ) + return false; + + case DST_N_A: + kc = (get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT; + CLEAN_MODS( + (record->event.pressed ? register_code16 : unregister_code16)(kc); + ) + return false; + + default: + return true; + } +} + +__attribute__((weak)) +uint32_t layer_state_set_keymap(uint32_t state) { + return state; +} + +uint32_t layer_state_set_user(uint32_t state) { + state = layer_state_set_keymap(state); + +#ifdef LAYER_NUMPAD + bool numpad = IS_LAYER_ON_STATE(state, L_NUMPAD); + bool num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); + if (numpad != num_lock) { + tap_code(KC_NLCK); // Toggle Num Lock to match Numpad layer state + } +#endif + + return state; +} + +__attribute__((weak)) +void led_set_keymap(uint8_t usb_led) {} + +void led_set_user(uint8_t usb_led) { + led_set_keymap(usb_led); +} diff --git a/users/konstantin/konstantin.h b/users/konstantin/konstantin.h new file mode 100644 index 00000000000..84d90dda57c --- /dev/null +++ b/users/konstantin/konstantin.h @@ -0,0 +1,87 @@ +#pragma once + +#include "quantum.h" +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #include "rgb.h" +#endif +#ifdef TAP_DANCE_ENABLE + #include "tap_dance.h" +#endif +#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) + #include "unicode.h" +#endif + +#ifdef LAYER_FN + #define FN MO(L_FN) + #define FN_CAPS LT(L_FN, KC_CAPS) + #define FN_ESC LT(L_FN, KC_ESC) + #define FN_FNLK TT(L_FN) +#endif + +#ifdef LAYER_NUMPAD + #define NUMPAD TG(L_NUMPAD) +#endif + +#define KC_SYSR LALT(KC_PSCR) +#undef KC_BRK +#define KC_BRK LCTL(KC_PAUS) + +#define MV_UP LCTL(KC_UP) +#define MV_DOWN LCTL(KC_DOWN) +#define MV_LEFT LCTL(KC_LEFT) +#define MV_RGHT LCTL(KC_RGHT) +#define TOP LCTL(KC_HOME) +#define BOTTOM LCTL(KC_END) +#define TAB_PRV LCTL(KC_PGUP) +#define TAB_NXT LCTL(KC_PGDN) +#define DEL_PRV LCTL(KC_BSPC) +#define DEL_NXT LCTL(KC_DEL) + +#define DST_ADD LCTL(LGUI(KC_D)) +#define DST_REM LCTL(LGUI(KC_F4)) +#define DST_PRV LCTL(LGUI(KC_LEFT)) +#define DST_NXT LCTL(LGUI(KC_RGHT)) +#ifndef DST_MOD_MASK + #define DST_MOD_MASK MOD_MASK_SHIFT +#endif + +#define LCT_CPS LCTL_T(KC_CAPS) + +#define IS_LAYER_ON_STATE(state, layer) ( (state) & (1UL << (layer))) +#define IS_LAYER_OFF_STATE(state, layer) (~(state) & (1UL << (layer))) + +// Clear mods, perform action, restore mods +#define CLEAN_MODS(action) { \ + uint8_t mods = get_mods(); \ + clear_mods(); \ + action; \ + set_mods(mods); \ + } + +enum keycodes_user { + CLEAR = SAFE_RANGE, + DST_P_R, + DST_N_A, + + RANGE_KEYMAP, +}; + +enum layers_user { + L_BASE, +#ifdef LAYER_FN + L_FN, +#endif +#ifdef LAYER_NUMPAD + L_NUMPAD, +#endif + + L_RANGE_KEYMAP, +}; + +void keyboard_pre_init_keymap(void); +void eeconfig_init_keymap(void); +void keyboard_post_init_keymap(void); + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +uint32_t layer_state_set_keymap(uint32_t state); +void led_set_keymap(uint8_t usb_led); diff --git a/users/konstantin/rgb.c b/users/konstantin/rgb.c new file mode 100644 index 00000000000..fffa250f25f --- /dev/null +++ b/users/konstantin/rgb.c @@ -0,0 +1,26 @@ +#include "rgb.h" + +#ifdef RGBLIGHT_EFFECT_BREATHING +const uint8_t PROGMEM RGBLED_BREATHING_INTERVALS[] = { 20, 30, 5, 10 }; +#endif + +#ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD +const uint8_t PROGMEM RGBLED_RAINBOW_MOOD_INTERVALS[] = { 20, 50, 100 }; +#endif + +#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL +const uint8_t PROGMEM RGBLED_RAINBOW_SWIRL_INTERVALS[] = { 20, 50, 100 }; +#endif + +#ifdef RGBLIGHT_EFFECT_SNAKE +const uint8_t PROGMEM RGBLED_SNAKE_INTERVALS[] = { 20, 50, 100 }; +#endif + +#ifdef RGBLIGHT_EFFECT_KNIGHT +const uint8_t PROGMEM RGBLED_KNIGHT_INTERVALS[] = { 20, 50, 100 }; +#endif + +const HSV godspeed_blue = { GODSPEED_BLUE }; +const HSV godspeed_yellow = { GODSPEED_YELLOW }; +const HSV modern_dolch_cyan = { MODERN_DOLCH_CYAN }; +const HSV modern_dolch_red = { MODERN_DOLCH_RED }; diff --git a/users/konstantin/rgb.h b/users/konstantin/rgb.h new file mode 100644 index 00000000000..cc7d91808a0 --- /dev/null +++ b/users/konstantin/rgb.h @@ -0,0 +1,13 @@ +#pragma once + +#include "quantum.h" + +#define GODSPEED_BLUE 198, 68, 255 +#define GODSPEED_YELLOW 27, 153, 255 +#define MODERN_DOLCH_CYAN 110, 255, 108 +#define MODERN_DOLCH_RED 251, 255, 108 + +extern const HSV godspeed_blue; +extern const HSV godspeed_yellow; +extern const HSV modern_dolch_cyan; +extern const HSV modern_dolch_red; diff --git a/users/konstantin/rules.mk b/users/konstantin/rules.mk new file mode 100644 index 00000000000..bf0ab979fb3 --- /dev/null +++ b/users/konstantin/rules.mk @@ -0,0 +1,16 @@ +SRC += konstantin.c +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + SRC += rgb.c +endif +RGB_MATRIX_ENABLE ?= no +ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) + SRC += rgb.c +endif +ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) + SRC += tap_dance.c +endif +ifneq (,$(filter yes,$(UNICODE_ENABLE) $(UNICODEMAP_ENABLE))) + SRC += unicode.c +endif + +EXTRAFLAGS += -flto diff --git a/users/konstantin/tap_dance.c b/users/konstantin/tap_dance.c new file mode 100644 index 00000000000..b36bc3dcc80 --- /dev/null +++ b/users/konstantin/tap_dance.c @@ -0,0 +1,118 @@ +#include "tap_dance.h" +#include "konstantin.h" + +#define ACTION_TAP_DANCE_DOUBLE_MOD(mod1, mod2) { \ + .fn = { td_double_mod_each, NULL, td_double_mod_reset }, \ + .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \ + } + +void td_double_mod_each(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; + + // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 + if (state->count == 1 || state->count == 3) { + register_code(data->kc1); + } else if (state->count == 2) { + unregister_code(data->kc1); + register_code(data->kc2); + } + // Prevent tap dance from sending the mods as weak mods + state->weak_mods &= ~(MOD_BIT(data->kc1) | MOD_BIT(data->kc2)); +} + +void td_double_mod_reset(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; + + if (state->count == 1 || state->count >= 3) { + unregister_code(data->kc1); + } + if (state->count >= 2) { + unregister_code(data->kc2); + } +} + +#define ACTION_TAP_DANCE_MOD_LAYER(mod, layer) { \ + .fn = { td_mod_layer_each, NULL, td_mod_layer_reset }, \ + .user_data = &(qk_tap_dance_dual_role_t){ mod, layer }, \ + } + +void td_mod_layer_each(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; + + // Single tap → mod, double tap → layer, triple tap etc. → mod+layer + if (state->count == 1 || state->count == 3) { + register_code(data->kc); + } else if (state->count == 2) { + unregister_code(data->kc); + // Prevent tap dance from sending the mod as a weak mod + state->weak_mods &= ~MOD_BIT(data->kc); + layer_on(data->layer); + } +} + +void td_mod_layer_reset(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; + + if (state->count == 1 || state->count >= 3) { + unregister_code(data->kc); + } + if (state->count >= 2) { + layer_off(data->layer); + } +} + +#define ACTION_TAP_DANCE_LAYER_MOD(layer, mod) { \ + .fn = { td_layer_mod_each, NULL, td_layer_mod_reset }, \ + .user_data = &(qk_tap_dance_layer_mod_t){ layer, mod, 0, 0 }, \ + } + +typedef struct { + uint8_t layer; + uint16_t kc; + bool layer_on; // Layer state when tap dance started + bool started; +} qk_tap_dance_layer_mod_t; + +void td_layer_mod_each(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; + if (!data->started) { + data->layer_on = IS_LAYER_ON(data->layer); + data->started = true; + } + + // Single tap → layer, double tap → mod, triple tap etc. → layer+mod + if (state->count == 1 || state->count == 3) { + layer_on(data->layer); + } else if (state->count == 2) { + if (!data->layer_on) { + layer_off(data->layer); + } + register_code(data->kc); + } +} + +void td_layer_mod_reset(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; + + if ((state->count == 1 || state->count >= 3) && !data->layer_on) { + layer_off(data->layer); + } + if (state->count >= 2) { + unregister_code(data->kc); + } + + data->started = false; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_DST_A_R] = ACTION_TAP_DANCE_DOUBLE(DST_ADD, DST_REM), + + [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_RGUI), + [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RCTL, KC_RSFT), + [TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RSFT, KC_RCTL), + + [TD_LSFT_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_LSFT, L_FN), + [TD_RCTL_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_RCTL, L_FN), + + [TD_FN_RCTL] = ACTION_TAP_DANCE_LAYER_MOD(L_FN, KC_RCTL), +}; diff --git a/users/konstantin/tap_dance.h b/users/konstantin/tap_dance.h new file mode 100644 index 00000000000..461d7ba8a99 --- /dev/null +++ b/users/konstantin/tap_dance.h @@ -0,0 +1,27 @@ +#pragma once + +#include "quantum.h" + +#define DST_A_R TD(TD_DST_A_R) + +#define RAL_RGU TD(TD_RAL_RGU) +#define RCT_RSF TD(TD_RCT_RSF) +#define RSF_RCT TD(TD_RSF_RCT) + +#define LSFT_FN TD(TD_LSFT_FN) +#define RCTL_FN TD(TD_RCTL_FN) + +#define FN_RCTL TD(TD_FN_RCTL) + +enum tap_dance { + TD_DST_A_R, + + TD_RAL_RGU, + TD_RCT_RSF, + TD_RSF_RCT, + + TD_LSFT_FN, + TD_RCTL_FN, + + TD_FN_RCTL, +}; diff --git a/users/konstantin/unicode.c b/users/konstantin/unicode.c new file mode 100644 index 00000000000..8ef5aaa1ec3 --- /dev/null +++ b/users/konstantin/unicode.c @@ -0,0 +1,7 @@ +#include "unicode.h" + +#ifdef UNICODEMAP_ENABLE +const uint32_t PROGMEM unicode_map[] = { + FOREACH_UNICODE(UCM_ENTRY) +}; +#endif diff --git a/users/konstantin/unicode.h b/users/konstantin/unicode.h new file mode 100644 index 00000000000..b2616d120b4 --- /dev/null +++ b/users/konstantin/unicode.h @@ -0,0 +1,34 @@ +#pragma once + +#include "quantum.h" + +#define FOREACH_UNICODE(M) \ + M(COMMA, 0x002C) \ + M(L_PAREN, 0x0028) \ + M(R_PAREN, 0x0029) \ + M(EQUALS, 0x003D) \ + M(TIMES, 0x00D7) \ + M(DIVIDE, 0x00F7) \ + M(MINUS, 0x2212) + +#define UC_KEYCODE(name, code) name = UC(code), + +#define UCM_NAME(name, code) UCM_ ## name, +#define UCM_ENTRY(name, code) [UCM_ ## name] = code, +#define UCM_KEYCODE(name, code) name = X(UCM_ ## name), + +#if defined(UNICODE_ENABLE) +enum unicode_keycodes { + FOREACH_UNICODE(UC_KEYCODE) +}; +#elif defined(UNICODEMAP_ENABLE) +enum unicode_names { + FOREACH_UNICODE(UCM_NAME) +}; + +extern const uint32_t PROGMEM unicode_map[]; + +enum unicode_keycodes { + FOREACH_UNICODE(UCM_KEYCODE) +}; +#endif diff --git a/users/kuatsure/kuatsure.c b/users/kuatsure/kuatsure.c index a18713626ec..f935e83c744 100644 --- a/users/kuatsure/kuatsure.c +++ b/users/kuatsure/kuatsure.c @@ -1,35 +1,62 @@ #include "kuatsure.h" +#include "version.h" -void tmux_prefix(void) { - register_code(KC_LCTL); - register_code(KC_SPC); +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LT), + [TD_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_GT) +}; - unregister_code(KC_LCTL); - unregister_code(KC_SPC); +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; } -void tmux_pane_zoom(void) { - tmux_prefix(); +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KB_MAKE: + if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP SS_TAP(X_ENTER)); + } + return false; + break; + + case KB_VRSN: + if (!record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + + case KB_FLSH: + if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP + #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) + ":dfu " + #elif defined(BOOTLOADER_HALFKAY) + ":teensy " + #elif defined(BOOTLOADER_CATERINA) + ":avrdude " + #endif + SS_TAP(X_ENTER) + ); + + reset_keyboard(); + } + return false; + break; + } - register_code(KC_Z); - unregister_code(KC_Z); + return process_record_keymap(keycode, record); } -void tmux_pane_switch(uint16_t keycode) { - tmux_prefix(); - - register_code(KC_Q); - unregister_code(KC_Q); - - register_code(keycode); - unregister_code(keycode); +void tmux_prefix(void) { + tap_code16(LCTL(KC_SPC)); } -void tmux_window_switch(uint16_t keycode) { +void tmux_pane_zoom(void) { tmux_prefix(); - register_code(keycode); - unregister_code(keycode); + SEND_STRING("z"); } LEADER_EXTERNS(); @@ -43,69 +70,70 @@ void matrix_scan_user(void) { // anything you can do in a macro https://docs.qmk.fm/macros.html // https://docs.qmk.fm/feature_leader_key.html + // Stop music and lock computer via alfred + SEQ_ONE_KEY(KC_H) { + SEND_STRING(SS_LGUI(" ") SS_TAP(X_LGUI) "afk" SS_TAP(X_ENTER)); + } + + // Stop music and lock computer via alfred + SEQ_TWO_KEYS(KC_H, KC_H) { + SEND_STRING(SS_LGUI(" ") SS_TAP(X_LGUI) "afk" SS_TAP(X_ENTER) SS_TAP(X_MEDIA_PLAY_PAUSE)); + } + // Whole Screen Shot SEQ_ONE_KEY(KC_A) { - register_code(KC_LGUI); - register_code(KC_LSFT); - register_code(KC_3); - - unregister_code(KC_3); - unregister_code(KC_LSFT); - unregister_code(KC_LGUI); + SEND_STRING(SS_LGUI(SS_LSFT("3"))); } // Selective Screen Shot SEQ_ONE_KEY(KC_S) { - register_code(KC_LGUI); - register_code(KC_LSFT); - register_code(KC_4); - - unregister_code(KC_4); - unregister_code(KC_LSFT); - unregister_code(KC_LGUI); + SEND_STRING(SS_LGUI(SS_LSFT("4"))); } // TMUX - shift to pane 1 and zoom SEQ_ONE_KEY(KC_J) { - tmux_pane_switch(KC_1); + tmux_prefix(); + SEND_STRING("q1"); tmux_pane_zoom(); } + // TMUX - shift to first window + SEQ_TWO_KEYS(KC_J, KC_J) { + tmux_prefix(); + SEND_STRING("1"); + } + // TMUX - shift to pane 2 and zoom SEQ_ONE_KEY(KC_K) { - tmux_pane_switch(KC_2); + tmux_prefix(); + SEND_STRING("q2"); tmux_pane_zoom(); } + // TMUX - shift to second window + SEQ_TWO_KEYS(KC_K, KC_K) { + tmux_prefix(); + SEND_STRING("2"); + } + // TMUX - shift to pane 3 and zoom SEQ_ONE_KEY(KC_L) { - tmux_pane_switch(KC_3); + tmux_prefix(); + SEND_STRING("q3"); tmux_pane_zoom(); } + // TMUX - shift to third window + SEQ_TWO_KEYS(KC_L, KC_L) { + tmux_prefix(); + SEND_STRING("3"); + } + // TMUX - shift to last pane and zoom SEQ_ONE_KEY(KC_SCOLON) { tmux_prefix(); - - register_code(KC_SCOLON); - unregister_code(KC_SCOLON); - + SEND_STRING(";"); tmux_pane_zoom(); } - - // TMUX - shift to first window - SEQ_ONE_KEY(KC_U) { - tmux_window_switch(KC_1); - } - - // TMUX - shift to second window - SEQ_ONE_KEY(KC_I) { - tmux_window_switch(KC_2); - } - - // TMUX - shift to third window - SEQ_ONE_KEY(KC_O) { - tmux_window_switch(KC_3); - } } } diff --git a/users/kuatsure/kuatsure.h b/users/kuatsure/kuatsure.h index 56fb684ec0f..8961d562130 100644 --- a/users/kuatsure/kuatsure.h +++ b/users/kuatsure/kuatsure.h @@ -3,10 +3,32 @@ #include "quantum.h" +enum kuatsure_keycodes { + KB_MAKE = SAFE_RANGE, + KB_FLSH, + KB_VRSN, + + USER_SAFE_RANGE, +}; + +enum { + TD_LBRC = 0, + TD_RBRC, +}; + +#define KT_LBRC TD(TD_LBRC) +#define KT_RBRC TD(TD_RBRC) + +#define TAPPING_TERM 200 + +#define LEADER_TIMEOUT 250 +#define LEADER_PER_KEY_TIMING + void tmux_prefix(void); void tmux_pane_zoom(void); -void tmux_pane_switch(uint16_t keycode); -void tmux_window_switch(uint16_t keycode); + +#define KT_CESC CTL_T(KC_ESC) +#define KT_MTAB MEH_T(KC_TAB) #undef LEADER_TIMEOUT #define LEADER_TIMEOUT 300 @@ -16,6 +38,9 @@ void tmux_window_switch(uint16_t keycode); #define _________________NUMBER_L1_________________ KC_1, KC_2, KC_3, KC_4, KC_5 #define _________________NUMBER_R1_________________ KC_6, KC_7, KC_8, KC_9, KC_0 +#define _________________SYMBOL_L1_________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _________________SYMBOL_R1_________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN + #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G #define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B @@ -28,4 +53,9 @@ void tmux_window_switch(uint16_t keycode); #define ____________FUNCTION_2____________ KC_F5, KC_F6, KC_F7, KC_F8 #define ____________FUNCTION_3____________ KC_F9, KC_F10, KC_F11, KC_F12 +#define ___SQBRACKETS___ KT_LBRC, KT_RBRC +#define _____PARENS_____ KC_LPRN, KC_RPRN +#define ____CRBRACES____ KC_LCBR, KC_RCBR +#define ___ANBRACKETS___ KC_LT, KC_GT + #endif diff --git a/users/kuatsure/rules.mk b/users/kuatsure/rules.mk index 11262d0ecfb..ed7e9290546 100644 --- a/users/kuatsure/rules.mk +++ b/users/kuatsure/rules.mk @@ -1 +1,4 @@ +CONSOLE_ENABLE = no +TAP_DANCE_ENABLE = yes + SRC += kuatsure.c diff --git a/users/losinggeneration/losinggeneration-common.h b/users/losinggeneration/losinggeneration-common.h index c1d6724c5d2..857117ca165 100644 --- a/users/losinggeneration/losinggeneration-common.h +++ b/users/losinggeneration/losinggeneration-common.h @@ -3,9 +3,6 @@ /* Custom keys & combinations to be shorter for keymaps */ #define KC_LCA LCA(KC_NO) -/* Fillers to make layering more clear */ -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define OSM_LSFT OSM(MOD_LSFT) #define TD_CTL TD(TD_CTL_CTLALT) diff --git a/users/losinggeneration/rules.mk b/users/losinggeneration/rules.mk index 75277116b24..295367fbcab 100644 --- a/users/losinggeneration/rules.mk +++ b/users/losinggeneration/rules.mk @@ -11,6 +11,3 @@ MOUSEKEY_ENABLE = yes # Mouse keys(+4700) TAP_DANCE_ENABLE = yes # Enable tap dancing #UNICODE_ENABLE = no # Unicode -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/users/manna-harbour_miryoku/README.org b/users/manna-harbour_miryoku/README.org new file mode 120000 index 00000000000..b6caaade167 --- /dev/null +++ b/users/manna-harbour_miryoku/README.org @@ -0,0 +1 @@ +miryoku.org \ No newline at end of file diff --git a/users/manna-harbour_miryoku/config.h b/users/manna-harbour_miryoku/config.h new file mode 100644 index 00000000000..c3c513d063c --- /dev/null +++ b/users/manna-harbour_miryoku/config.h @@ -0,0 +1,13 @@ + +// generated from users/manna-harbour_miryoku/miryoku.org + +#pragma once + +// Prevent normal rollover on alphas from accidentally triggering mods. +#define IGNORE_MOD_TAP_INTERRUPT + +// Enable rapid switch from tap to hold, disables double tap hold auto-repeat. +#define TAPPING_FORCE_HOLD + +// Recommended for heavy chording. +#define QMK_KEYS_PER_SCAN 4 diff --git a/users/manna-harbour_miryoku/manna-harbour_miryoku.c b/users/manna-harbour_miryoku/manna-harbour_miryoku.c new file mode 100644 index 00000000000..bb4770afc2b --- /dev/null +++ b/users/manna-harbour_miryoku/manna-harbour_miryoku.c @@ -0,0 +1,56 @@ + +// generated from users/manna-harbour_miryoku/miryoku.org + +#include QMK_KEYBOARD_H + +#define KC_NP KC_NO // key is not present +#define KC_NA KC_NO // present but not available for use +#define KC_NU KC_NO // available but not used +#define KC_RST RESET + +enum layers { BASE, MEDR, NAVR, MOUR, NSSL, NSL, FUNL }; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_miryoku( + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, + LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G, KC_M, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), + KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, + KC_NP, KC_NP, LT(MEDR, KC_ESC), LT(NAVR, KC_SPC), LT(MOUR, KC_TAB), LT(NSSL, KC_ENT), LT(NSL, KC_BSPC), LT(FUNL, KC_DEL), KC_NP, KC_NP + ), + [NAVR] = LAYOUT_miryoku( + KC_RST, KC_NA, KC_NA, KC_NA, KC_NA, KC_AGIN, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, + KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NA, KC_CAPS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, KC_INS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, + KC_NP, KC_NP, KC_NA, KC_NA, KC_NA, KC_ENT, KC_BSPC, KC_DEL, KC_NP, KC_NP + ), + [MOUR] = LAYOUT_miryoku( + KC_RST, KC_NA, KC_NA, KC_NA, KC_NA, KC_NU, KC_NU, KC_NU, KC_NU, KC_NU, + KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NA, KC_NU, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, + KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, KC_NU, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, + KC_NP, KC_NP, KC_NA, KC_NA, KC_NA, KC_BTN3, KC_BTN1, KC_BTN2, KC_NP, KC_NP + ), + [MEDR] = LAYOUT_miryoku( + KC_RST, KC_NA, KC_NA, KC_NA, KC_NA, KC_NU, KC_NU, KC_NU, KC_NU, KC_NU, + KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NA, KC_NU, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, + KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, KC_NU, KC_NU, KC_NU, KC_NU, KC_NU, + KC_NP, KC_NP, KC_NA, KC_NA, KC_NA, KC_MSTP, KC_MPLY, KC_MUTE, KC_NP, KC_NP + ), + [FUNL] = LAYOUT_miryoku( + KC_F12, KC_F7, KC_F8, KC_F9, KC_PSCR, KC_NA, KC_NA, KC_NA, KC_NA, KC_RST, + KC_F11, KC_F4, KC_F5, KC_F6, KC_SLCK, KC_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, + KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUS, KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, + KC_NP, KC_NP, KC_APP, KC_SPC, KC_TAB, KC_NA, KC_NA, KC_NA, KC_NP, KC_NP + ), + [NSL] = LAYOUT_miryoku( + KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, KC_NA, KC_NA, KC_NA, KC_NA, KC_RST, + KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, KC_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, + KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, + KC_NP, KC_NP, KC_DOT, KC_0, KC_MINS, KC_NA, KC_NA, KC_NA, KC_NP, KC_NP + ), + [NSSL] = LAYOUT_miryoku( + KC_LCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RCBR, KC_NA, KC_NA, KC_NA, KC_NA, KC_RST, + KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, KC_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE, KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, + KC_NP, KC_NP, KC_GT, KC_RPRN, KC_UNDS, KC_NA, KC_NA, KC_NA, KC_NP, KC_NP + ) +}; diff --git a/users/manna-harbour_miryoku/miryoku.org b/users/manna-harbour_miryoku/miryoku.org new file mode 100644 index 00000000000..556f95f60ec --- /dev/null +++ b/users/manna-harbour_miryoku/miryoku.org @@ -0,0 +1,609 @@ +#+Title: miryoku.org + +The miryoku layout is an ergonomic, minimal, orthogonal layout for ergo or ortho +keyboards, implemented as part of the QMK firmware. The layout is maintained in +emacs org-mode tables and converted to QMK keymap data structures using embedded +python scripts. The layout is mapped onto keyboards with different physical +layouts as a subset without code duplication using the QMK userland feature and +C macros. Versions of the layout can also be seen outside of the QMK source at +[[https://github.com/manna-harbour/miryoku/]]. + +* Contents + +- [[#layout][Layout]] +- [[#code-generation][Code Generation]] +- [[#subset-mapping][Subset Mapping]] + + +* Layout +:PROPERTIES: +:CUSTOM_ID: layout +:END: + +** Info + +*** General Principles + + - Use layers instead of reaching. + - Use both hands instead of contortions. + - Use the home positions as much as possible. + - Make full use of the thumbs. + - Avoid unnecessary complication. + + +*** Specifics + + - 5 columns, 3 rows, 3 thumb keys, 2 hands. + - Can be used on almost any split or non-split ergo or ortho keyboard. + - Includes all keys found on a US layout TKL keyboard, plus media keys and + mouse emulation. + - Home row is the middle row, home thumb key is the middle thumb key. + - Maximum 1-u movement from home position for fingers and thumbs, and only + along one axis (except for the inner index finger column which is + deprioritised compared with the home columns). + - Dual-function modifiers on home row, mirrored on both hands. + - Dual-function layer change on thumbs. + - Layers are designed orthogonally with a single purpose per hand and are + accessed by holding a thumb key on the opposite hand. + - Holding layer change and modifiers on one hand combined with a single key + press on the other hand can produce any combination of modifiers and + single keys without any finger contortions. + - Single function mods are also defined on layers on the same hand as the + layer change thumb key so layer change and mods can be held in any order + or simultaneously without race conditions. + - As mods are only enabled on the opposite hand, auto-repeat is available on + the home row on layers for use with cursor and mouse keys. + - Tap-hold auto-repeat is disabled to enable faster tap-hold switching on + thumbs but thumb tap keys are mirrored onto some layers for use with + auto-repeat. + + +** Layers + +The layers are maintained in tables, with the thumb keys on the bottom row. NP +indicates the key is not present and is used to fill in the table around the +thumb keys. The grid arrangement of the tables does not imply a particular +physical layout. + +Basic keycodes are entered without the KC_ prefix. Symbols can be entered as-is +(excepting '"' (DQUO) and '|' (PIPE)). Empty cells are unused. + +The base layer has both halves of the layout joined for convenience. Other +layers are specified as a single hand. + +*** Base (BASE) + + +The base layer is maintained as separate tap and hold tables and are combined +into the corresponding tap-hold keycodes for mods and layer change. RST and +mods will be available on sub layers on the same hand as the layer change thumb +key. Unknown names are considered to be layer names. + +Base layer alphas are Colemak DHm. Thumb keys are backspace, enter, delete on +the right and space, tab, escape on the left. Dot, comma and apostrophe are +included for prose, dot and slash for file and directory names. + +#+NAME: tap +| Q | W | F | P | B | J | L | U | Y | ' | +| A | R | S | T | G | M | N | E | I | O | +| Z | X | C | D | V | K | H | , | . | / | +| NP | NP | ESC | SPC | TAB | ENT | BSPC | DEL | NP | NP | + +#+NAME: hold +| RST | | | | | | | | | RST | +| LGUI | LALT | LCTL | LSFT | | | LSFT | LCTL | LALT | LGUI | +| | | | | | | | | | | +| NP | NP | MEDR | NAVR | MOUR | NSSL | NSL | FUNL | NP | NP | + + +*** Navigation (NAVR) + +Primary right-hand layer (left home thumb) is navigation and editing. Cursor +keys are on the home position, line and page movement below, clipboard above, +caps and insert on the inner column. Thumb keys are duplicated from the base +layer to avoid having to layer change mid edit and to enable auto-repeat. + +#+NAME: navr +| AGIN | UNDO | CUT | COPY | PSTE | +| CAPS | LEFT | DOWN | UP | RGHT | +| INS | HOME | PGDN | PGUP | END | +| ENT | BSPC | DEL | NP | NP | + + +*** Mouse (MOUR) + +Secondary RH layer is mouse emulation. Mouse movement mirrors cursor navigation +on home and wheel mirrors line / page movement below. Buttons are on the +thumbs. Mouse movement, click, and drag with modifiers can be performed from +the home position. Unused keys are available for other related functions. + +#+NAME: mour +| | | | | | +| | MS_L | MS_D | MS_U | MS_R | +| | WH_L | WH_D | WH_U | WH_R | +| BTN3 | BTN1 | BTN2 | NP | NP | + + +*** Media (MEDR) + +Tertiary RH layer is media control, with volume up / down and next / prev +mirroring the navigation keys. Pause, stop and mute are on thumbs. Unused keys +are available for other related functions. + +#+NAME: medr +| | | | | | +| | MPRV | VOLD | VOLU | MNXT | +| | | | | | +| MSTP | MPLY | MUTE | NP | NP | + + +*** Numerals and Symbols (NSL) + +Primary left-hand layer (right home thumb) is numerals and symbols. Numerals +are in the standard numpad locations with symbols in the remaining positions. +Dot is duplicated from the base layer for convenience. + +#+NAME: nsl +| [ | 7 | 8 | 9 | ] | +| ; | 4 | 5 | 6 | = | +| ` | 1 | 2 | 3 | \ | +| NP | NP | . | 0 | - | + + +*** Shifted Numerals and Symbols (NSSL) + +Secondary LH layer has shifted symbols in the same locations to reduce chording +when using mods with shifted symbols. Automatically generated from unshifted +table. + + +*** Function and System (FUNL) + +Tertiary LH layer has function keys mirroring the numerals on the primary layer +with extras on the pinkie column, plus system keys on the inner column. App +(menu) is on the tertiary thumb key and other thumb keys are duplicated from the +base layer to enable auto-repeat. + + +#+NAME: funl +| F12 | F7 | F8 | F9 | PSCR | +| F11 | F4 | F5 | F6 | SLCK | +| F10 | F1 | F2 | F3 | PAUS | +| NP | NP | APP | SPC | TAB | + + +*** COMMENT Templates + +#+NAME: tem +| | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | +| | | | | | | | | | | +| | | | | | | | | | | +| NP | NP | | | | | | | NP | NP | + + +Duplicate base layer tap keys on thumbs rather than trans to enable auto-repeat. + +#+NAME: temr +| | | | | | +|------+------+------+------+------| +| | | | | | +| | | | | | +| | | | | | +| ENT | BSPC | DEL | NP | NP | + +#+NAME: teml +| | | | | | +|------+------+------+------+------| +| | | | | | +| | | | | | +| | | | | | +| NP | NP | ESC | SPC | TAB | + + +* Code Generation +:PROPERTIES: +:CUSTOM_ID: code-generation +:END: + +** Table Conversion Scripts + +*** table-layout-taphold + +Produce base layer from separate tap and hold tables. + +#+NAME: table-layout-taphold +#+BEGIN_SRC python :var tap_table=tap :var hold_table=hold :var symbol_names_table=symbol-names :var mods_list=mods :tangle no :results verbatim +width = 19 +mods_dict = dict.fromkeys(mods_list) +symbol_names_dict = {} +for symbol, name, shifted_symbol, shifted_name in symbol_names_table: + symbol_names_dict[symbol] = name + symbol_names_dict[shifted_symbol] = shifted_name +results = ' [BASE] = LAYOUT_miryoku(\n' +for tap_row, hold_row in map(None, tap_table, hold_table): + results += ' ' + for tap, hold in map(None, tap_row, hold_row): + if tap == '': + code = 'NU' + elif tap in symbol_names_dict: + code = symbol_names_dict[tap] + else: + code = tap + code = 'KC_' + str(code) + if hold in mods_dict: + code = str(hold) + '_T(' + code + ')' + elif hold != '' and hold != 'NP' and hold != 'RST': + code = 'LT(' + str(hold) + ', ' + code + ')' + results += (code + ', ').ljust(width) + results = results.rstrip(' ') + '\n' +results = results.rstrip('\n, ') + '\n )' +return results +#+END_SRC + +#+RESULTS: table-layout-taphold +: [BASE] = LAYOUT_miryoku( +: KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, +: LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G, KC_M, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), +: KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, +: KC_NP, KC_NP, LT(MEDR, KC_ESC), LT(NAVR, KC_SPC), LT(MOUR, KC_TAB), LT(NSSL, KC_ENT), LT(NSL, KC_BSPC), LT(FUNL, KC_DEL), KC_NP, KC_NP +: ) + + +*** table-layout-half + +Produce sub layers given layer name and corresponding table for single hand and +incorporating mods and reset from base layer. Layer names must end with R or L. +A layer with shifted symbols can also be generated. + +#+NAME: table-layout-half +#+BEGIN_SRC python :var hold_table=hold :var layer_name="NSL" :var half_table=nsl :var symbol_names_table=symbol-names :var mods_list=mods :var shift="false" :tangle no :results verbatim +width = 9 +mods_dict = dict.fromkeys(mods_list) +symbol_names_dict = {} +shifted_symbol_names_dict = {} +for symbol, name, shifted_symbol, shifted_name in symbol_names_table: + symbol_names_dict[symbol] = name + symbol_names_dict[shifted_symbol] = shifted_name + shifted_symbol_names_dict[symbol] = shifted_name +length = len(half_table[0]) +mode = layer_name[-1:].lower() +results = ' [' + layer_name + '] = LAYOUT_miryoku(\n' +for half_row, hold_row in map(None, half_table, hold_table): + results += ' ' + hold_row_l, hold_row_r = hold_row[:length], hold_row[length:] + for lr, hold_row_lr in ('l', hold_row_l), ('r', hold_row_r): + if lr == mode: + for half in half_row: + if half == '': + code = 'NU' + elif shift == "true" and half in shifted_symbol_names_dict: + code = shifted_symbol_names_dict[half] + elif half in symbol_names_dict: + code = symbol_names_dict[half] + else: + code = half + results += ('KC_' + str(code) + ', ').ljust(width) + else: + for hold in hold_row_lr: + if hold == '' or hold != 'NP' and hold != 'RST' and hold not in mods_dict: + code = 'NA' + else: + code = hold + results += ('KC_' + str(code) + ', ').ljust(width) + results = results.rstrip(' ') + '\n' +results = results.rstrip('\n, ') + '\n )' +return results +#+END_SRC + +#+RESULTS: table-layout-half +: [NSL] = LAYOUT_miryoku( +: KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, KC_NA, KC_NA, KC_NA, KC_NA, KC_RST, +: KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, KC_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, +: KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, +: KC_NP, KC_NP, KC_DOT, KC_0, KC_MINS, KC_NA, KC_NA, KC_NA, KC_NP, KC_NP +: ) + + +*** table-enums + +Produce layer enums from layer names in hold table. + +#+NAME: table-enums +#+BEGIN_SRC python :var hold_table=hold :var mods_list=mods :tangle no +mods_dict = dict.fromkeys(mods_list) +results = 'enum layers { BASE, ' +for hold_row in hold_table: + for hold in hold_row: + if hold not in mods_dict and hold != '' and hold != 'NP' and hold != 'RST': + results += hold + ', ' +results = results.rstrip(', ') + ' };' +return results +#+END_SRC + +#+RESULTS: table-enums +: enum layers { BASE, MEDR, NAVR, MOUR, NSSL, NSL, FUNL }; + + +** Data + +*** symbol-names + +Symbol, name, and shifted symbol mappings for use in tables. + +#+NAME: symbol-names +| ` | GRV | ~ | TILD | +| - | MINS | _ | UNDS | +| = | EQL | + | PLUS | +| [ | LBRC | { | LCBR | +| ] | RBRC | } | RCBR | +| \ | BSLS | PIPE | PIPE | +| ; | SCLN | : | COLN | +| ' | QUOT | DQUO | DQUO | +| , | COMM | < | LT | +| . | DOT | > | GT | +| / | SLSH | ? | QUES | +| 1 | 1 | ! | EXLM | +| 2 | 2 | @ | AT | +| 3 | 3 | # | HASH | +| 4 | 4 | $ | DLR | +| 5 | 5 | % | PERC | +| 6 | 6 | ^ | CIRC | +| 7 | 7 | & | AMPR | +| 8 | 8 | * | ASTR | +| 9 | 9 | ( | LPRN | +| 0 | 0 | ) | RPRN | + + +*** mods + +Modifiers usable in hold table. Need to have the same name for KC_ and _T versions. + +#+NAME: mods +- LSFT +- LCTL +- LALT +- LGUI +- LAGR + + +** Other + +*** header + +Header for tangled src files. + +#+NAME: header +#+BEGIN_SRC C :tangle no +generated from users/manna-harbour_miryoku/miryoku.org +#+END_SRC + + +* Subset Mapping +:PROPERTIES: +:CUSTOM_ID: subset-mapping +:END: + +** Userspace + +The keymap and configuration are shared between keyboards. The keymap is +defined for LAYOUT_miryoku which is 10x4, with the outer 2 positions on the +bottom row unused and the rest of the bottom row are the thumb keys. + + +*** manna-harbour_miryoku.c + +Contains the keymap. Included from keymap.c + +[[./manna-harbour_miryoku.c][users/manna-harbour_miryoku/manna-harbour_miryoku.c]] +#+BEGIN_SRC C :noweb yes :tangle manna-harbour_miryoku.c + +// <
> + +#include QMK_KEYBOARD_H + +#define KC_NP KC_NO // key is not present +#define KC_NA KC_NO // present but not available for use +#define KC_NU KC_NO // available but not used +#define KC_RST RESET + +<> + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +<>, +<>, +<>, +<>, +<>, +<>, +<> +}; +#+END_SRC + + +*** config.h + +Config options. Automatically included. + +[[./config.h][users/manna-harbour_miryoku/config.h]] +#+BEGIN_SRC C :noweb yes :tangle config.h + +// <
> + +#pragma once + +// Prevent normal rollover on alphas from accidentally triggering mods. +#define IGNORE_MOD_TAP_INTERRUPT + +// Enable rapid switch from tap to hold, disables double tap hold auto-repeat. +#define TAPPING_FORCE_HOLD + +// Recommended for heavy chording. +#define QMK_KEYS_PER_SCAN 4 + +#+END_SRC + + +*** rules.mk + +Build options. Automatically included. + +[[./rules.mk][users/manna-harbour_miryoku/rules.mk]] +#+BEGIN_SRC makefile :noweb yes :tangle rules.mk + +# <
> + +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) + +#+END_SRC + + +** Layouts + +To use the keymap on a keyboard supporting the layouts feature, LAYOUT_miryoku +is defined as a macro mapping onto the layout's own LAYOUT macro, leaving the +unused keys as KC_NO. The userspace keymap is then included. + +*** ergodox + +For the ergodox layout, the main 5x3 alphas are used as usual. The primary and +secondary thumb keys are the inner and outer 2u thumb keys and the tertiary +thumb key is the innermost key of the partial bottom row. The remaining keys +are unused. + +[[../../layouts/community/ergodox/manna-harbour_miryoku/keymap.c][layouts/community/ergodox/manna-harbour_miryoku/keymap.c]] +#+BEGIN_SRC C :noweb yes :tangle ../../layouts/community/ergodox/manna-harbour_miryoku/keymap.c + +// <
> + +#define LAYOUT_miryoku(\ +K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ +K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ +K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ +N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ +)\ +LAYOUT_ergodox_pretty( \ +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ +KC_NO, K00, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, K09, KC_NO, \ +KC_NO, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_NO, \ +KC_NO, K20, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K29, KC_NO, \ +KC_NO, KC_NO, KC_NO, KC_NO, K32, K37, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, \ + K33, K34, KC_NO, KC_NO, K35, K36 \ +) + +#include "manna-harbour_miryoku.c" + +#+END_SRC + +To build for any keyboard using the this layout (ergodone, ergodox_ez, +ergodox_infinity, hotdox) e.g. the ergodox_ez, + +#+BEGIN_SRC sh :tangle no +cd ../.. && make ergodox_ez:manna-harbour_miryoku:teensy +#+END_SRC + + + +*** ortho_4x12 + +For the ortho_4x12 layout, the right half as is as follows: The rightmost column +bottom 3 rows is the pinkie column. The middle 4 columns top 3 rows are for the +remaining fingers. The bottom row left 3 columns are the thumb keys. The +remaining keys are unused. + +[[../../layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c][layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c]] +#+BEGIN_SRC C :noweb yes :tangle ../../layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c + +// <
> + +#define LAYOUT_miryoku(\ +K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ +K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ +K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ +N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ +)\ +LAYOUT_ortho_4x12(\ +KC_NO, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, KC_NO,\ +K00, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K09,\ +K10, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K19,\ +K20, KC_NO, KC_NO, K32, K33, K34, K35, K36, K37, KC_NO, KC_NO, K29\ +) + +#include "manna-harbour_miryoku.c" + +#+END_SRC + +To build for any keyboard using this layout (4x4, nori, chimera_ls, contra, +divergetm2, jj40, lets_split, lets_split_eh, meira, niu_mini, planck, telophase, +vitamins_included, zinc, zlant, ortho48, kbd4x, levinson, wavelet, plaid) +e.g. the levinson, + +#+BEGIN_SRC sh :tangle no +make keebio/levinson:manna-harbour_miryoku:avrdude +#+END_SRC + + +** Keyboards + +To use the keymap on a keyboard which does not support the layouts feature, +LAYOUT_miryoku is defined as a macro mapping onto the keyboard's own LAYOUT +macro, leaving the unused keys as KC_NO. The userspace keymap is then included. + + +*** crkbd + +The outer columns are unused. + +[[../../keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c][keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c]] +#+BEGIN_SRC C :noweb yes :tangle ../../keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c + +// <
> + +#define LAYOUT_miryoku( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ + N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ +) \ +LAYOUT( \ +KC_NO, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, KC_NO, \ +KC_NO, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_NO, \ +KC_NO, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_NO, \ + K32, K33, K34, K35, K36, K37 \ +) + +#include "manna-harbour_miryoku.c" + +#+END_SRC + +To build for this keyboard, + +#+BEGIN_SRC sh :tangle no +cd ../.. && make crkbd:manna-harbour_miryoku:avrdude +#+END_SRC + + +* Related Documentation + +** QMK + +- https://qmk.fm/ +- https://docs.qmk.fm/#/getting_started_introduction +- https://docs.qmk.fm/#/hardware_keyboard_guidelines +- https://docs.qmk.fm/#/config_options +- https://docs.qmk.fm/#/keycodes +- https://docs.qmk.fm/#/feature_advanced_keycodes +- https://docs.qmk.fm/#/feature_layouts +- https://docs.qmk.fm/#/feature_userspace +- https://docs.qmk.fm/#/getting_started_make_guide + + +** Org Mode + +- https://orgmode.org/ +- https://orgmode.org/manual/Tables.html +- https://orgmode.org/manual/Working-with-Source-Code.html diff --git a/users/manna-harbour_miryoku/rules.mk b/users/manna-harbour_miryoku/rules.mk new file mode 100644 index 00000000000..baff1431f0d --- /dev/null +++ b/users/manna-harbour_miryoku/rules.mk @@ -0,0 +1,5 @@ + +# generated from users/manna-harbour_miryoku/miryoku.org + +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) diff --git a/users/mattly/config.h b/users/mattly/config.h new file mode 100644 index 00000000000..25d37980112 --- /dev/null +++ b/users/mattly/config.h @@ -0,0 +1,9 @@ +#pragma once + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define TAPPING_TOGGLE 2 +#define TAPPING_TERM 200 diff --git a/users/mattly/mattly.c b/users/mattly/mattly.c new file mode 100644 index 00000000000..1e61e01265d --- /dev/null +++ b/users/mattly/mattly.c @@ -0,0 +1,70 @@ +#include "mattly.h" + +__attribute__ ((weak)) +layer_state_t layer_state_set_keymap (layer_state_t state) { + return state; +} + +void set_lights_default(void) { + #ifdef RGBLIGHT_ENABLE + if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { + rgblight_sethsv_noeeprom(HSV_CAPS); + } else { + rgblight_sethsv_noeeprom(HSV_DEFAULT); + } + #endif +} + +void layer_state_set_rgb(layer_state_t state) { +#ifdef RGBLIGHT_ENABLE + switch (biton32(state)) { + case _QWERTY: + set_lights_default(); + break; + case _SYMBOL: + rgblight_sethsv_noeeprom(HSV_SYMBOL); + break; + case _NAVNUM: + rgblight_sethsv_noeeprom(HSV_NAVNUM); + break; + case _FUNCT: + rgblight_sethsv_noeeprom(HSV_FUNCT); + break; + } +#endif +} + + +layer_state_t layer_state_set_user (layer_state_t state) { + state = update_tri_layer_state(state, _SYMBOL, _NAVNUM, _FUNCT); + layer_state_set_rgb(state); + return layer_state_set_keymap (state); +} + +void on_reset(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_sethsv_noeeprom(HSV_RESET); + #endif +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_CAPS: + #ifdef RGBLIGHT_ENABLE + set_lights_default(); + #endif + return true; + case RESET: + on_reset(); + return true; + default: + return true; + } +} + +void keyboard_post_init_user(void) { +#ifdef RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + set_lights_default(); +#endif +} diff --git a/users/mattly/mattly.h b/users/mattly/mattly.h new file mode 100644 index 00000000000..08318840d0c --- /dev/null +++ b/users/mattly/mattly.h @@ -0,0 +1,83 @@ +/* Copyright 2019 Matthew Lyon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +enum { + _QWERTY, + _NAVNUM, + _SYMBOL, + _FUNCT, +}; + +// left hand +#define ESC_HYP MT(MOD_HYPR, KC_ESC) +#define BSP_NUM LT(_NAVNUM, KC_BSPC) +#define ENT_SFT MT(MOD_LSFT, KC_ENT) +#define SPC_SFT MT(MOD_LSFT, KC_SPC) + +// right hand +#define SPC_SFT MT(MOD_LSFT, KC_SPC) +#define TAB_SYM LT(_SYMBOL, KC_TAB) +#define DEL_WRP MT(MOD_LCTL | MOD_LALT | MOD_LGUI, KC_DEL) + +#define NAVLOCK TG(_NAVNUM) +#define SYMLOCK TG(_SYMBOL) + + +// QWERTY + +#define A_CTRL MT(MOD_LCTL, KC_A) +#define S_ALT MT(MOD_LALT, KC_S) +#define D_GUI MT(MOD_LGUI, KC_D) +#define F_SHFT MT(MOD_LSFT, KC_F) +#define J_SHFT MT(MOD_RSFT, KC_J) +#define K_GUI MT(MOD_RGUI, KC_K) +#define L_ALT MT(MOD_RALT, KC_L) +#define MINSCTL MT(MOD_RCTL, KC_MINS) + +#define BWORD LALT(KC_LEFT) +#define FWORD LALT(KC_RIGHT) + +// OS X default keys +#define NWIN LGUI(KC_GRV) // Next Window +#define PWIN LGUI(LSFT(KC_GRV)) // Prev Window +#define NTAB LGUI(LSFT(KC_RBRC)) // Next Tab +#define PTAB LGUI(LSFT(KC_LBRC)) // Prev Tab +#define NAVBACK LGUI(KC_LBRC) // Navigate Forward +#define NAVFWD LGUI(KC_RBRC) // Navigate Back + +// my personal mappings to window manager commands +#define XALLWIN HYPR(KC_F14) +#define XDESKTP HYPR(KC_F15) +#define XNXTSPC HYPR(KC_F16) +#define XPRVSPC HYPR(KC_F17) +#define XNOTIFY HYPR(KC_F18) + +#ifdef RGBLIGHT_ENABLE +#define HSV_CAPS 42, 255, 255 +#define HSV_DEFAULT 30, 218, 255 +#define HSV_SYMBOL 22, 255, 255 +#define HSV_NAVNUM 245, 200, 255 +#define HSV_FUNCT 233, 255, 255 +#define HSV_RESET 180, 255, 255 +#endif + +#endif + diff --git a/users/mattly/readme.md b/users/mattly/readme.md new file mode 100644 index 00000000000..356992534cf --- /dev/null +++ b/users/mattly/readme.md @@ -0,0 +1,10 @@ +# mattly's layouts + +My layouts are based around: + +* making the most from small layouts on keyboards like the iris or planck +* moving held-modifiers from pinkies to thumbs or home row, giving many keys dual purposes via mod/layer taps +* easy home-row navigation on a layer, using standard keys, available to all programs, not just a specially-configured editor +* easy access to punctuation symbols used in the programming languages I work in + +[Here is an image](https://lyonheart.us/etc/mattly-keymap.png) with an outdated description of my keymap \ No newline at end of file diff --git a/users/mattly/rules.mk b/users/mattly/rules.mk new file mode 100644 index 00000000000..6803d361d85 --- /dev/null +++ b/users/mattly/rules.mk @@ -0,0 +1,2 @@ +SRC += mattly.c +MOUSEKEY_ENABLE = yes diff --git a/users/mechmerlin/changelog.md b/users/mechmerlin/changelog.md index 11b3ba708f6..f1116b2d2b1 100644 --- a/users/mechmerlin/changelog.md +++ b/users/mechmerlin/changelog.md @@ -1,6 +1,18 @@ # Changelog All notable changes to my userspace will be documented in this file. +## [0.2.2] - 2019-04-22 +### Fixed +- `config.h` usage of turning on `RGBLIGHT_ENABLE` when it is not enabled on boards other than my two clueboards were causing issues with boards that didn't have RGB underglow on it. + +## [0.2.1] - 2019-03-01 +### Fixed +- `config.h` usage of `#ifdef RGBLIGHT_ENABLE` caused problems for other of my boards that had `RGBLIGHT_ENABLE`. + +## [0.2.0] - 2019-02-27 +### Changed +- Moved `AUDIO_CLICKY` from community layout `66_ansi` into user space. + ## [0.1.1] - 2018-10-26 ### Added - Added a changelog, aka THIS VERY FILE! diff --git a/users/mechmerlin/config.h b/users/mechmerlin/config.h index 3d58c230af6..fe8f9c9ffb2 100644 --- a/users/mechmerlin/config.h +++ b/users/mechmerlin/config.h @@ -1,5 +1,31 @@ #pragma once #ifdef RGBLIGHT_ENABLE -#define RGBLIGHT_SLEEP + #define RGBLIGHT_SLEEP + #define RGBLIGHT_ANIMATIONS #endif // RGBLIGHT_ENABLE + +#ifdef AUDIO_CLICKY + #define AUDIO_CLICKY_ON + #define AUDIO_CLICKY_FREQ_DEFAULT 261.63f + #define AUDIO_CLICKY_FREQ_MIN 65.41f + #define AUDIO_CLICKY_FREQ_MAX 1046.5f + //#define AUDIO_CLICKY_FREQ_FACTOR 1.18921f + //#define AUDIO_CLICKY_FREQ_FACTOR 2.71828f // e + #define AUDIO_CLICKY_FREQ_FACTOR 1.61803f // golden ratio + #define AUDIO_CLICKY_FREQ_RANDOMNESS 17.0f +#endif + +// Enable features depending on keyboard +#if defined(KEYBOARD_clueboard_66_hotswap_prototype) + #ifndef RGBLIGHT_ENABLE + #define RGBLIGHT_ENABLE + #endif + #ifndef AUDIO_CLICKY + #define AUDIO_CLICKY + #endif +#elif defined(KEYBOARD_clueboard_66_hotswap_gen1) + #ifndef AUDIO_CLICKY + #define AUDIO_CLICKY + #endif +#endif diff --git a/users/mechmerlin/readme.md b/users/mechmerlin/readme.md index 1e86a64107f..24335a7ce22 100644 --- a/users/mechmerlin/readme.md +++ b/users/mechmerlin/readme.md @@ -1,4 +1,4 @@ -# MechMerlin's Userspace v0.1.1 +# MechMerlin's Userspace v0.2.0 This is a collection of my most commonly used QMK features. @@ -38,3 +38,11 @@ This is just a wrapper for `CTL_T(KC_CAPS)`. This is a hold for control and tap ### RGBLIGHT_SLEEP Ensures that when my computer is in sleep mode, the keyboard underglow lights will also be off. + +### Audio Clicky + +If a board has a speaker, enable beeps and boops per switch actuation. This is currently only available on prototype/gen1 clueboard 66_hotswaps. + +### Velocikey + +[Velocikey](https://github.com/qmk/qmk_firmware/blob/master/docs/feature_velocikey.md) is an RGBLIGHT feature in which the faster you type, the faster the ARE GEE BEES. diff --git a/users/mechmerlin/rules.mk b/users/mechmerlin/rules.mk index 70c20ec71ec..088743c4679 100644 --- a/users/mechmerlin/rules.mk +++ b/users/mechmerlin/rules.mk @@ -1 +1 @@ -SRC += mechmerlin.c \ No newline at end of file +SRC += mechmerlin.c diff --git a/users/mtdjr/mtdjr.h b/users/mtdjr/mtdjr.h index 85ca1596dce..4d0b046fc32 100644 --- a/users/mtdjr/mtdjr.h +++ b/users/mtdjr/mtdjr.h @@ -55,8 +55,6 @@ enum user_tapdance { // Custom Keycodes #define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define KC_xxxx KC_NO #define KC_LOWR LOWER #define KC_RASE RAISE diff --git a/users/not-quite-neo/nqn-common.h b/users/not-quite-neo/nqn-common.h index a04dc7a18f1..bcd79505f75 100644 --- a/users/not-quite-neo/nqn-common.h +++ b/users/not-quite-neo/nqn-common.h @@ -6,9 +6,4 @@ This file holds some commen NQN definitions */ - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - #endif diff --git a/users/nstickney/nstickney.c b/users/nstickney/nstickney.c new file mode 100644 index 00000000000..3e18e5c8383 --- /dev/null +++ b/users/nstickney/nstickney.c @@ -0,0 +1,44 @@ +#include "nstickney.h" + +// Tap Dancing +void dance_layer (qk_tap_dance_state_t *state, void *user_data) { + switch (state -> count) { + case 1: tap_code(KC_APP); break; + case 2: layer_invert(NUMP); break; + case 3: layer_invert(SYMB); break; + case 4: layer_invert(SYSH); break; + default: break; + } +}; + +void dance_lock_finished (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: register_code(KC_LGUI); break; + case 2: register_code(KC_NLCK); break; + case 3: register_code(KC_CAPS); break; + case 4: register_code(KC_SLCK); break; + default: break; + } +}; + +void dance_lock_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: unregister_code(KC_LGUI); break; + case 2: unregister_code(KC_NLCK); break; + case 3: register_code(KC_CAPS); break; + case 4: register_code(KC_SLCK); break; + default: break; + } +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [LOCKS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_lock_finished, dance_lock_reset), + [LAYERS] = ACTION_TAP_DANCE_FN(dance_layer) +}; + +void eeconfig_init_user (void) { + set_unicode_input_mode(UC_LNX); // Linux + //set_unicode_input_mode(UC_OSX); // Mac OSX + //set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki) + //set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki) +}; \ No newline at end of file diff --git a/users/nstickney/nstickney.h b/users/nstickney/nstickney.h new file mode 100644 index 00000000000..d3f5a7c6fc3 --- /dev/null +++ b/users/nstickney/nstickney.h @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +#pragma once +#define USE_SERIAL +#define MASTER_LEFT + +#undef UNICODE_SELECTED_MODES +#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WINC + +// Layers +#define BASE 0 // Base layer +#define SYMB 1 // Symbols +#define SYSH 2 // Symbols, shifted +#define NUMP 3 // Numpad +#define FCTN 4 // Function + +// Make keymaps more clear +#define CC_ESC LCTL_T(KC_ESC) +#define CC_QUOT RCTL_T(KC_QUOT) +#define AC_SLSH LALT_T(KC_SLSH) +#define AC_EQL RALT_T(KC_EQL) +#define FC_BSLS LT(FCTN, KC_BSLS) +#define FC_MINS LT(FCTN, KC_MINS) + +enum tap_dances {LOCKS = 0, LAYERS = 1}; \ No newline at end of file diff --git a/users/nstickney/rules.mk b/users/nstickney/rules.mk new file mode 100644 index 00000000000..f52371c7918 --- /dev/null +++ b/users/nstickney/rules.mk @@ -0,0 +1,4 @@ +SRC += nstickney.c + +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes \ No newline at end of file diff --git a/users/pvinis/config.h b/users/pvinis/config.h new file mode 100644 index 00000000000..8e2efb40a4b --- /dev/null +++ b/users/pvinis/config.h @@ -0,0 +1,10 @@ +#pragma once + +#ifdef AUDIO_ENABLE +// #define STARTUP_SONG SONG(SONIC_RING) +// #define DAC_SAMPLE_MAX 65535U // maybe this works for volume? +#endif + +// allow rolling when keys have hold functionality +#define IGNORE_MOD_TAP_INTERRUPT +// #define TAPPING_TERM 150 diff --git a/users/pvinis/pvinis.c b/users/pvinis/pvinis.c new file mode 100644 index 00000000000..e97edcb98cc --- /dev/null +++ b/users/pvinis/pvinis.c @@ -0,0 +1,89 @@ +#include "pvinis.h" +#include "version.h" + +#ifdef AUDIO_ENABLE +#include "audio.h" +#endif // AUDIO_ENABLE + + +#ifdef AUDIO_ENABLE +// float tone_katamari_rolling_star[][2] = SONG(KATAMARI_ROLLING_STAR); +#endif // AUDIO_ENABLE + + +// SYMBOL + SYSCTL = KBCTL +uint32_t layer_state_set_user(uint32_t state) { + uint32_t intermediate_state = update_tri_layer_state(state, LR_SYMBOL, LR_SYSCTL, LR_KBCTL); + intermediate_state = layer_state_set_user_local(intermediate_state); + return intermediate_state; +} + + +// functions for the individual keymaps to implement if they need something extra +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + + +// handle my own keycodes +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + + case PV_VRSN: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + + case PV_MAKE: + if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP +#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) + ":dfu" +#elif defined(BOOTLOADER_HALFKAY) + ":teensy" +#elif defined(BOOTLOADER_CATERINA) + ":avrdude" +#endif + SS_TAP(X_ENTER) + ); + } + return false; + + case PV_FLSH: + reset_keyboard(); + return false; + + case PV_KTMR: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + // PLAY_SONG(tone_katamari_rolling_star); +#endif + } + return false; + } + return process_record_keymap(keycode, record); +} + + +#ifdef TAP_DANCE_ENABLE +qk_tap_dance_action_t tap_dance_actions[] = { +}; +#endif // TAP_DANCE_ENABLE + + +// init stuff +void keyboard_post_init_user(void) { + keyboard_post_init_user_local(); +} + + +// default functions +__attribute__ ((weak)) +void keyboard_post_init_user_local(void) {} + +__attribute__ ((weak)) +uint32_t layer_state_set_user_local(uint32_t state) { + return state; +} diff --git a/users/pvinis/pvinis.h b/users/pvinis/pvinis.h new file mode 100644 index 00000000000..0c75c6a6615 --- /dev/null +++ b/users/pvinis/pvinis.h @@ -0,0 +1,152 @@ +#pragma once + +#include "quantum.h" + + +// my own keycodes +enum userspace_custom_keycodes { + PV_ = SAFE_RANGE, + + PV_VRSN, // prints firmware version + PV_MAKE, // prints the make command of the keyboard + PV_FLSH, // resets keyboard + PV_KTMR, // play katamari music + + PV_SAFE_RANGE, // used for extra keycodes in the individual keymaps +}; + +enum tap_dance_indexes { + // tap dance + TD_FLSH, // flash keyboard (as if the physical flash key was pressed) +}; + +#define ALLM(kc) LCAG(kc) // easier name for left ctrl-alt-gui +#define PV_ESCC CTL_T(KC_ESC) // esc on tap, ctrl on hold +#define PV_LOCK LCTL(LSFT(KC_PWR)) // lock computer +#define TD_3FLS TD(TD_FLSH) // tap dance 3 times for flash + + +// layers +enum { + LR_BASE = 0, // used for basic keys like the surrounding ctrl, cmd, etc + + LR_QWERTY, + LR_CARPALX, + + LR_SYMBOL, // symbol input (!, @, #, etc) + LR_SYSCTL, // system control (music, volume, keyboard flash, etc) + LR_KBCTL, // keyboard control (version, make, flash, etc) +}; + + +// layer switchers +#define BASE TO(LR_BASE) +#define QWERTY TO(LR_QWERTY) +#define CARPALX TO(LR_CARPALX) + +#define SYMBOL MO(LR_SYMBOL) +#define SYSCTL MO(LR_SYSCTL) +#define KBCTL MO(LR_KBCTL) + + +// layout parts for easy reuse between keyboard keymaps + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define ________________NUMBERS_L__________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBERS_R__________________ KC_6, KC_7, KC_8, KC_9, KC_0 + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define ______________________F_L__________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define ______________________F_R__________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | Q | W | E | R | T | | Y | U | I | O | P | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | A | S | D | F | G | | H | J | K | L | ; | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | Z | X | C | V | B | | N | M | , | . | / | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define _________________QWERTY_L1_________________ KC_Q , KC_W , KC_E , KC_R , KC_T +#define _________________QWERTY_L2_________________ KC_A , KC_S , KC_D , KC_F , KC_G +#define _________________QWERTY_L3_________________ KC_Z , KC_X , KC_C , KC_V , KC_B + +#define _________________QWERTY_R1_________________ KC_Y , KC_U , KC_I , KC_O , KC_P +#define _________________QWERTY_R2_________________ KC_H , KC_J , KC_K , KC_L , KC_SCLN +#define _________________QWERTY_R3_________________ KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH + +#define _____________MOD_QWERTY_L2_________________ CTL_T(KC_A), SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G +#define _____________MOD_QWERTY_R2_________________ KC_H , ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), CTL_T(KC_SCLN) + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | Q | G | M | L | W | | Y | F | I | O | P | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | D | S | T | N | R | | I | A | K | L | ; | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | Z | X | C | V | J | | K | P | , | . | / | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define ________________CARPALX_L1_________________ KC_Q , KC_G , KC_M , KC_L , KC_W +#define ________________CARPALX_L2_________________ KC_D , KC_S , KC_T , KC_N , KC_R +#define ________________CARPALX_L3_________________ KC_Z , KC_X , KC_C , KC_V , KC_J + +#define ________________CARPALX_R1_________________ KC_Y , KC_F , KC_U , KC_B , KC_SCLN +#define ________________CARPALX_R2_________________ KC_I , KC_A , KC_E , KC_O , KC_H +#define ________________CARPALX_R3_________________ KC_K , KC_P , KC_COMM, KC_DOT , KC_SLSH + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | ! | @ | { | } | _ | | \ | | ` | | | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | # | $ | ( | ) | - | | = | & | ' | " | | | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | % | ^ | [ | ] | + | | * | ~ | < | > | / | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define _________________SYMBOL_L1_________________ KC_EXLM, KC_AT , KC_LCBR, KC_RCBR, KC_UNDS +#define _________________SYMBOL_L2_________________ KC_HASH, KC_DLR , KC_LPRN, KC_RPRN, KC_MINS +#define _________________SYMBOL_L3_________________ KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_PLUS + +#define _________________SYMBOL_R1_________________ KC_BSLS, _______, KC_GRV , _______, _______ +#define _________________SYMBOL_R2_________________ KC_EQL , KC_AMPR, KC_QUOT, KC_DQUO, KC_PIPE +#define _________________SYMBOL_R3_________________ KC_ASTR, KC_TILD, KC_LABK, KC_RABK, KC_SLSH + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | | | | | | |MUTE |HOME | ^ | END | | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | | | | | | |VOLUP| < | v | > | | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | | | | | | |VOLDN|MPREV|MPLAY|MNEXT| | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define _________________SYSCTL_L1_________________ +#define _________________SYSCTL_L2_________________ +#define _________________SYSCTL_L3_________________ + +// vol v ctl v +#define _________________SYSCTL_R1_________________ KC_MUTE , KC_HOME , KC_UP , KC_END , PV_LOCK +#define _________________SYSCTL_R2_________________ KC_VOLU , KC_LEFT , KC_DOWN , KC_RGHT /* < arrows */ , KC_SLEP +#define _________________SYSCTL_R3_________________ KC_VOLD , KC_MPRV , KC_MPLY , KC_MNXT /* < music */ , KC_PWR + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|VERSN|MAKE |FLASH|XXXXX| +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define __________________KBCTL_L1_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +#define __________________KBCTL_L2_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +#define __________________KBCTL_L3_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + +#define __________________KBCTL_R1_________________ XXXXXXX, XXXXXXX, XXXXXXX, PV_KTMR, XXXXXXX +#define __________________KBCTL_R2_________________ XXXXXXX, PV_VRSN, PV_MAKE, PV_FLSH, XXXXXXX +#define __________________KBCTL_R3_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + +// we need wrappers in order for these definitions, because they need to be expanded before being used as arguments to the LAYOUT_xxx macro +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) + + +// extra stuff that might be needed +void keyboard_post_init_user_local(void); +uint32_t layer_state_set_user_local(uint32_t state); diff --git a/users/pvinis/rules.mk b/users/pvinis/rules.mk new file mode 100644 index 00000000000..da10cc74371 --- /dev/null +++ b/users/pvinis/rules.mk @@ -0,0 +1,15 @@ +# add userspace file +SRC += pvinis.c + +AUDIO_ENABLE = no # piezo speaker sounds +RGBLIGHT_ENABLE = no # rgb leds underlight +TAP_DANCE_ENABLE = yes +BACKLIGHT_ENABLE = no # leds under keycaps +#MOUSEKEY_ENABLE = no +#SLEEP_LED_ENABLE = no # no led blinking while sleeping +#NKRO_ENABLE = yes + +# make firmware smaller +LINK_TIME_OPTIMIZATION_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = no diff --git a/users/replicaJunction/replicaJunction.h b/users/replicaJunction/replicaJunction.h index ab0e8ab3e3a..9b577254338 100644 --- a/users/replicaJunction/replicaJunction.h +++ b/users/replicaJunction/replicaJunction.h @@ -20,7 +20,6 @@ // #define L_LL_I 10 // Keyboard aliases -#define _______ KC_TRNS #define ooooooo KC_TRNS #define MO_FUNC MO(L_FUNC) diff --git a/users/romus/romus.h b/users/romus/romus.h index 265c942e920..b65e32eb5b8 100644 --- a/users/romus/romus.h +++ b/users/romus/romus.h @@ -4,8 +4,6 @@ #include "quantum.h" -// Use 7 wide characters for keymaps -#define _______ KC_TRNS #define XXX KC_NO // Layers diff --git a/users/rs/karabiner.json b/users/rs/karabiner.json new file mode 100644 index 00000000000..f5214650ade --- /dev/null +++ b/users/rs/karabiner.json @@ -0,0 +1,154 @@ +{ + "title": "RS", + "rules": [{ + "description": "CapsLock to Escape / Control Mod-Tap", + "manipulators": [{ + "type": "basic", + "from": { + "key_code": "caps_lock", + "modifiers": { + "optional": ["any"] + } + }, + "to": [{"key_code": "left_control"}], + "to_if_alone": [{"key_code": "escape"}] + }] + }, + { + "description": "Right-Shift / Enter Mod-Tap", + "manipulators": [{ + "type": "basic", + "from": { + "key_code": "right_shift", + "modifiers": { + "optional": ["any"] + } + }, + "to": [{"key_code": "right_shift"}], + "to_if_alone": [{"key_code": "return_or_enter"}] + }] + }, + { + "description": "Right-Command / Backspace Mod-Tap", + "manipulators": [{ + "type": "basic", + "from": { + "key_code": "right_command", + "modifiers": { + "optional": ["any"] + } + }, + "to": [{"key_code": "right_command"}], + "to_if_alone": [{"key_code": "delete_or_backspace"}] + }] + }, + { + "description": "Right-Command Accents", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "a", + "modifiers": { + "mandatory": ["right_command"], + "optional": ["left_shift", "right_shift"] + } + }, + "to": [ + {"key_code": "grave_accent_and_tilde", "modifiers": ["left_option"]}, + {"key_code": "a"} + ] + }] + }, + { + "description": "Right Command Navigation", + "manipulators": [{ + "type": "basic", + "from": { + "key_code": "j", + "modifiers": { + "mandatory": ["right_command"], + "optional": ["any"] + } + }, + "to": [{"key_code": "left_arrow"}] + }, + { + "type": "basic", + "from": { + "key_code": "k", + "modifiers": { + "mandatory": ["right_command"], + "optional": ["any"] + } + }, + "to": [{"key_code": "down_arrow"}] + }, + { + "type": "basic", + "from": { + "key_code": "i", + "modifiers": { + "mandatory": ["right_command"], + "optional": ["any"] + } + }, + "to": [{"key_code": "up_arrow"}] + }, + { + "type": "basic", + "from": { + "key_code": "l", + "modifiers": { + "mandatory": ["right_command"], + "optional": ["any"] + } + }, + "to": [{"key_code": "right_arrow"}] + }, + { + "type": "basic", + "from": { + "key_code": "e", + "modifiers": { + "mandatory": ["right_command"], + "optional": ["any"] + } + }, + "to": [{"key_code": "page_up"}] + }, + { + "type": "basic", + "from": { + "key_code": "d", + "modifiers": { + "mandatory": ["right_command"], + "optional": ["any"] + } + }, + "to": [{"key_code": "page_down"}] + }, + { + "type": "basic", + "from": { + "key_code": "s", + "modifiers": { + "mandatory": ["right_command"], + "optional": ["any"] + } + }, + "to": [{"key_code": "home"}] + }, + { + "type": "basic", + "from": { + "key_code": "f", + "modifiers": { + "mandatory": ["right_command"], + "optional": ["any"] + } + }, + "to": [{"key_code": "end"}] + }] + }] +} diff --git a/users/rs/readme.md b/users/rs/readme.md new file mode 100644 index 00000000000..60b34ea32fb --- /dev/null +++ b/users/rs/readme.md @@ -0,0 +1,30 @@ +# RS: Code Friendly 40% – 60% Keymaps + +The rs keymap collection is an evolution of my previous keymap optimized for coding with a 60% keyboards like the Iris. I tried to keep the simplicity of my previous keymap with all the keys necessary for coding on a single layer in addition to the base one. It work well with any 40% and 60% keyboard, split or not. + +To build it, use: + + make :rs + +Example: + + make keebio/iris:rs + make crkbd:rs + make planck:rs + make preonic:rs + make ergotravel:rs + make handwired/rs60:rs + +Because I sometime have to use my internal keyboard I my macbook, a [karabiner configuration](karabiner.json) is also provided to get most of the features of this keyboard, including the code layer / backspace on right command key etc. + +This set of keymaps have been tested with those keyboards: +- [Planck](../../keyboards/planck/) +- [Preonic](../../keyboards/preonic/) +- [My preonic clone](../../keyboards/handwired/rs60/) + +This keymap in is also available for other keyboards: +- [Crkdb/rs](../../keyboards/crkbd/keymaps/rs/keymap.c) +- [Iris/rs](../../keyboards/keebio/iris/keymaps/rs/keymap.c) +- [Ergotravel/rs](../../keyboards/ergotravel/keymaps/rs/keymap.c) +- [ortho_5x12/rs](../../layouts/community/ortho_5x12/rs/keymap.c) +- [ortho_4x12/rs](../../layouts/community/ortho_4x12/rs/keymap.c) diff --git a/users/rs/rs.c b/users/rs/rs.c new file mode 100644 index 00000000000..fa634bb9284 --- /dev/null +++ b/users/rs/rs.c @@ -0,0 +1,74 @@ + +#include "rs.h" + +// process_record_user is like process_record_user for keymaps including this file. +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +// rgb_mod_changed_keymap is called any time the RGB mod has been changed. +__attribute__ ((weak)) +void rgb_mod_changed_keymap(void) { +} + +// keylog_set_keymap is called for every key press. +__attribute__ ((weak)) +void keylog_set_keymap(uint16_t keycode, keyrecord_t *record) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + keylog_set_keymap(keycode, record); + } + + switch (keycode) { + case NEQL: // != + if (record->event.pressed) { + SEND_STRING("!="); + } + return false; + case LPLT: // ( or < with shift + if (record->event.pressed) { + if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) { + // < + tap_code(KC_COMM); // shift is already registered + } else { + // ( + register_mods(MOD_BIT(KC_LSFT)); + tap_code(KC_9); + unregister_mods(MOD_BIT(KC_LSFT)); + } + } + return false; + case RPGT: // ) or > with shift + if (record->event.pressed) { + if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) { + // < + tap_code(KC_DOT); // shift is already registered + } else { + // ) + register_mods(MOD_BIT(KC_LSFT)); + tap_code(KC_0); + unregister_mods(MOD_BIT(KC_LSFT)); + } + } + return false; +#ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_step(); + rgb_mod_changed_keymap(); + } + return false; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + rgb_mod_changed_keymap(); + } + return false; +#endif + } + return process_record_keymap(keycode, record); +} \ No newline at end of file diff --git a/users/rs/rs.h b/users/rs/rs.h new file mode 100644 index 00000000000..722d6ed19e3 --- /dev/null +++ b/users/rs/rs.h @@ -0,0 +1,50 @@ +#pragma once +#include "quantum.h" + +enum layers { + _QWERTY, + _CODE, + _FN, +}; + +enum custom_keycodes { + CODE = SAFE_RANGE, + FN, + LPLT, + RPGT, + NEQL, +#ifdef RGBLIGHT_ENABLE + RGBRST, +#endif +}; + +#define KC_ KC_TRNS + +#define KC_ESCC MT(MOD_LCTL, KC_ESC) +#define KC_ENTS MT(MOD_LSFT, KC_ENT) +#define KC_LTGT LTGT // > or < with shift +#define KC_LPLT LPLT // ( or < with shift +#define KC_RPGT RPGT // ) or > with shift +#define KC_NEQL NEQL // != +#define KC_CODE MO(_CODE) +#define KC_BCOD LT(_CODE, KC_BSPC) +#define KC_FN MO(_FN) +#define KC_RST RESET +#define KC_CTRA LCTL(KC_A) +#define KC_CTRE LCTL(KC_E) +#define KC_BLTG BL_TOGG +#define KC_BLUP BL_INC +#define KC_BLDN BL_DEC +#define KC_BLBR BL_BRTG + +#ifdef RGBLIGHT_ENABLE +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LMOD RGB_MOD +#endif \ No newline at end of file diff --git a/users/rs/rules.mk b/users/rs/rules.mk new file mode 100644 index 00000000000..edb5be0f5bb --- /dev/null +++ b/users/rs/rules.mk @@ -0,0 +1 @@ +SRC += rs.c \ No newline at end of file diff --git a/users/spacebarracecar/config.h b/users/spacebarracecar/config.h index e69de29bb2d..748c0471551 100644 --- a/users/spacebarracecar/config.h +++ b/users/spacebarracecar/config.h @@ -0,0 +1,2 @@ +#pragma once +#define TAPPING_TERM 200 diff --git a/users/spacebarracecar/readme.md b/users/spacebarracecar/readme.md index 172764c0742..3d9ceb80c46 100644 --- a/users/spacebarracecar/readme.md +++ b/users/spacebarracecar/readme.md @@ -14,7 +14,7 @@ I'm using the US Ansi layout however I'm living in Germany which means that ever - The keycodes are handled by the `process_record_user` function which is now located in [spacebarracecar.c](spacebarracecar.c). To change keyboard specific configuration `process_record_keymap` is used (see [drashna userspace readme](../drashna/readme.md) for better explanation). - There is a predefined `_DEADKEY` layer in [spacebarracecar.h](spacebarracecar.h) under `enum userspace_layers`. Shifted CU_QUOT enables the dead key layer, just like KC_QUOT would when using the US International layout. (See `enum userspace_custom_keycodes` for more explanation). - On Windows grave and circonflexe are defined as dead keys when using the standard german layout. Those are automatically escaped when using the custom keycodes. `CU_ESCT` can be used to enable/disable this behavior. -- For a complete example see my [fc660c](../../keyboards/fc660c/keymaps/spacebarracecar/keymap.c) or [planck](../../keyboards/planck/keymaps/spacebarracecar/keymap.c) keymaps. +- For a complete example see my [planck](../../keyboards/planck/keymaps/spacebarracecar/keymap.c) keymap. ### How it works diff --git a/users/spacebarracecar/spacebarracecar.c b/users/spacebarracecar/spacebarracecar.c index f7048869ed3..bbd864aa936 100644 --- a/users/spacebarracecar/spacebarracecar.c +++ b/users/spacebarracecar/spacebarracecar.c @@ -71,6 +71,11 @@ void timer_timeout(void){ rshiftp = false; #endif navesc = false; + timer_timeout_keymap(); +} + +__attribute__((weak)) +void timer_timeout_keymap(void){ } bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -96,7 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { navesc_timer = timer_read(); layer_on(_NAV); } else { - if (timer_elapsed(navesc_timer) < 200 && navesc) { + if (timer_elapsed(navesc_timer) < TAPPING_TERM && navesc) { register_code(KC_ESC); unregister_code(KC_ESC); } @@ -134,7 +139,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_LSFT); lshift = true; } else { - if (timer_elapsed(lshift_timer) < 200 && lshiftp && !game) { + if (timer_elapsed(lshift_timer) < TAPPING_TERM && lshiftp && !game) { register_code(KC_LSFT); register_code(KC_8); unregister_code(KC_8); @@ -154,7 +159,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_LSFT); rshift = true; } else { - if (timer_elapsed(rshift_timer) < 200 && rshiftp && !game) { + if (timer_elapsed(rshift_timer) < TAPPING_TERM && rshiftp && !game) { register_code(KC_LSFT); register_code(KC_9); unregister_code(KC_9); @@ -211,11 +216,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { timer_timeout(); if (lshift || rshift){ unregister_code(KC_LSFT); - register_code(DE_ALGR); + register_code(KC_ALGR); unregister_code(DE_PLUS); register_code(DE_PLUS); unregister_code(DE_PLUS); - unregister_code(DE_ALGR); + unregister_code(KC_ALGR); register_code(KC_LSFT); } else { register_code(KC_LSFT); @@ -340,3 +345,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return process_record_keymap(keycode, record); } } + +__attribute__((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/users/spacebarracecar/spacebarracecar.h b/users/spacebarracecar/spacebarracecar.h index 1e18253510c..43bfc5e6558 100644 --- a/users/spacebarracecar/spacebarracecar.h +++ b/users/spacebarracecar/spacebarracecar.h @@ -75,17 +75,25 @@ extern bool game; void timer_timeout(void); +void timer_timeout_keymap(void); + bool process_record_keymap(uint16_t keycode, keyrecord_t *record); #define CTRLX LCTL(KC_X) #define CTRLC LCTL(KC_C) #define CTRLV LCTL(KC_V) +#define ALTF4 LALT(KC_F4) + #define GUIU LGUI(KC_UP) #define GUID LGUI(KC_DOWN) #define GUIL LGUI(KC_LEFT) #define GUIR RGUI(KC_RIGHT) +#define CTLENT CTL_T(KC_ENT) + +#define EMOJI LWIN(KC_DOT) + /* Templates for Keys, with custom shifted and non shifted Characters */ @@ -190,7 +198,7 @@ return false; if (record->event.pressed) { \ timer_timeout(); \ unregister_code(KC_LSFT); \ - register_code(DE_ALGR); \ + register_code(KC_ALGR); \ if (lshift || rshift) { \ unregister_code(kc2); \ register_code(kc2); \ @@ -201,7 +209,7 @@ if (record->event.pressed) { \ register_code(kc1); \ unregister_code(kc1); \ } \ - unregister_code(DE_ALGR); \ + unregister_code(KC_ALGR); \ } \ return false; diff --git a/users/stanrc85/config.h b/users/stanrc85/config.h new file mode 100644 index 00000000000..42306727ceb --- /dev/null +++ b/users/stanrc85/config.h @@ -0,0 +1,9 @@ +#pragma once + +#define TAPPING_TERM 250 +#define RETRO_TAPPING + +#ifdef RGBLIGHT_ENABLE + #define RGBLIGHT_LIMIT_VAL 175 + #define RGBLIGHT_SLEEP +#endif diff --git a/users/stanrc85/layer_rgb.c b/users/stanrc85/layer_rgb.c new file mode 100644 index 00000000000..58f17489a12 --- /dev/null +++ b/users/stanrc85/layer_rgb.c @@ -0,0 +1,29 @@ +#include "stanrc85.h" + +void matrix_init_user(void) { + rgblight_setrgb(0xFF, 0x00, 0x00); +}; + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case 0: + rgblight_setrgb (0xFF, 0x00, 0x00); + break; + case 1: + rgblight_setrgb (0x00, 0xFF, 0x00); + break; + case 2: + rgblight_setrgb (0x00, 0x00, 0xFF); + break; + case 3: + rgblight_setrgb (0xFF, 0xFF, 0xFF); + break; + case 4: + rgblight_setrgb (0xFF, 0x00, 0xFF); + break; + default: // for any other layers, or the default layer + rgblight_setrgb (0xFF, 0x00, 0x00); + break; + } + return state; +} diff --git a/users/stanrc85/readme.md b/users/stanrc85/readme.md new file mode 100644 index 00000000000..9009a71d5f1 --- /dev/null +++ b/users/stanrc85/readme.md @@ -0,0 +1,52 @@ + + +# Stanrc85's Standard ANSI 60% Layout + +Shared keymap between two 60% PCB: +- 1upkeyboards60HSE +- DZ60 (hotswap) + +## Keymap Notes +- Layer 0 is default QWERTY layout with additional custom features: + - SpaceFN to function layer 2 on `Space` + - `CTRL` when held and `ESC` when tapped on `CAPS LOCK` + - Tap Dance on `Fn1` for `CTRL+ALT+DEL` and `WIN+L` + - Tap Dance on `ESC` for `ESC` and ` ` ` + +![Base QWERTY Layer](https://imgur.com/lGcyLJx.png) + +- Layer 1 is default QWERTY with no custom features used mostly for gaming + - Enabled by `Fn2+CAPS` from base layer + +![Default ANSI Layer](https://imgur.com/M7T9PNT.png) + +- Layer 2 is Function layer: + - F keys + - Arrows + - Volume and Media controls + - AutoHotkey shortcuts based on [Speaker Control](https://github.com/stanrc85/Speaker-Control) script + - AHK Mic is used to mute/unmute microphone + - AHK Speaker switches audio output between headphones and speakers + +![Function Layer](https://imgur.com/YPl0JrU.png) + +- Layer 3 is RGB Underglow control and RESET + - `Fn2+CAPS` used to toggle Default QWERTY layer on and off + +![RGB and RESET Layer](https://imgur.com/PyB8z7k.png) + +### Build +To build the firmware file associated with this keymap, simply run `make your_keyboard:stanrc85-ansi`. diff --git a/users/stanrc85/rules.mk b/users/stanrc85/rules.mk new file mode 100644 index 00000000000..4b66f9692db --- /dev/null +++ b/users/stanrc85/rules.mk @@ -0,0 +1,16 @@ +TAP_DANCE_ENABLE = yes +EXTRAKEY_ENABLE = yes +BACKLIGHT_ENABLE = no +COMMAND_ENABLE = no +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +AUDIO_ENABLE = no +CONSOLE_ENABLE = no +NKRO_ENABLE = no + +SRC += stanrc85.c + +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + # Include my fancy rgb functions source here + SRC += layer_rgb.c +endif diff --git a/users/stanrc85/stanrc85.c b/users/stanrc85/stanrc85.c new file mode 100644 index 00000000000..e3da6d64667 --- /dev/null +++ b/users/stanrc85/stanrc85.c @@ -0,0 +1,93 @@ +#include "stanrc85.h" + +static td_state_t td_state; + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +// determine the tapdance state to return +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) { return SINGLE_TAP; } + else { return SINGLE_HOLD; } + } + if (state->count == 2) { return DOUBLE_TAP; } + else { return 3; } // any number higher than the maximum state value you return above +} + +// handle the possible states for each tapdance keycode you define: +void ctl_copy_finished (qk_tap_dance_state_t *state, void *user_data) { + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + SEND_STRING(SS_LCTRL("c")); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_RCTL)); + break; + case DOUBLE_TAP: + SEND_STRING(SS_LCTRL("v")); + } +} + +void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (td_state) { + case SINGLE_TAP: + break; + case SINGLE_HOLD: + unregister_mods(MOD_BIT(KC_RCTL)); + break; + case DOUBLE_TAP: + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK), + [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV), + [TD_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_copy_finished, ctl_copy_reset) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MAKE: + if (!record->event.pressed) { + uint8_t mods = get_mods(); + clear_mods(); + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); + if (mods & MOD_MASK_SHIFT) { + //RESET board for flashing if SHIFT held or tapped with KC_MAKE + #if defined(__arm__) + send_string_with_delay_P(PSTR(":dfu-util"), 10); + #elif defined(BOOTLOADER_DFU) + send_string_with_delay_P(PSTR(":dfu"), 10); + #elif defined(BOOTLOADER_HALFKAY) + send_string_with_delay_P(PSTR(":teensy"), 10); + #elif defined(BOOTLOADER_CATERINA) + send_string_with_delay_P(PSTR(":avrdude"), 10); + #endif // bootloader options + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); + reset_keyboard(); + } + if (mods & MOD_MASK_CTRL) { + send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); + } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); + set_mods(mods); + } + break; + case KC_RDP: //Opens Windows RDP + if (!record->event.pressed) { + register_code(KC_LGUI); + tap_code(KC_R); + unregister_code(KC_LGUI); + wait_ms(200); + send_string_with_delay_P(PSTR("mstsc"), 10); + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); + } + break; + } + return process_record_keymap(keycode, record); +} diff --git a/users/stanrc85/stanrc85.h b/users/stanrc85/stanrc85.h new file mode 100644 index 00000000000..ceb7167e103 --- /dev/null +++ b/users/stanrc85/stanrc85.h @@ -0,0 +1,54 @@ +#pragma once + +#include "quantum.h" +#include "version.h" + +enum my_layers { + _NUMPAD = 0, //Macropad numpad + _NAVKEY, //Macropad nav keys + _MEDIA, //Macropad media controls + _RGB, //Macropad RGB controls + _FN1PAD, //Macropad reset and make commands + _QWERTY = 0, //Qwerty with custom shortcuts and functions + _DEFAULT, //Default ANSI for gaming, enable with FN2+RCtl + _FN1_60, //Function keys, arrows, custom shortcuts, volume control + _FN2_60 //RGB Underglow controls and RESET +}; + +//Aliases for longer keycodes +#define KC_CAD LALT(LCTL(KC_DEL)) +#define KC_LOCK LGUI(KC_L) +#define CA_QUOT LCA(KC_QUOT) +#define CA_SCLN LCA(KC_SCLN) +#define KC_CTLE LCTL_T(KC_ESC) +#define LT_SPCF LT(_FN1_60, KC_SPC) +#define TD_TESC TD(TD_ESC) +#define TD_TWIN TD(TD_WIN) +#define TD_TCTL TD(TD_RCTL) +#define CA_COPY LCTL(KC_C) +#define CA_PSTE LCTL(KC_V) + +enum cust_keys { + KC_MAKE = SAFE_RANGE, + KC_RDP +}; + +enum tap_dance { + TD_WIN, + TD_ESC, + TD_RCTL +}; + +// define a type containing as many tapdance states as you need +typedef enum { + SINGLE_TAP, + SINGLE_HOLD, + DOUBLE_TAP +} td_state_t; + +// function to determine the current tapdance state +int cur_dance (qk_tap_dance_state_t *state); + +// `finished` and `reset` functions for each tapdance keycode +void ctl_copy_finished (qk_tap_dance_state_t *state, void *user_data); +void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data); diff --git a/users/talljoe/config.h b/users/talljoe/config.h index 0d06a0b12d8..33374014dfa 100644 --- a/users/talljoe/config.h +++ b/users/talljoe/config.h @@ -5,4 +5,8 @@ #define RESET_LAYER 15 +#define BOOTMAGIC_KEY_SALT KC_ESC +#define BOOTMAGIC_KEY_SKIP KC_I +#define BOOTMAGIC_KEY_EEPROM_CLEAR KC_E + #endif // !USERSPACE_CONFIG_H diff --git a/users/talljoe/rules.mk b/users/talljoe/rules.mk index 0f1f6f26a61..e0a71561f46 100644 --- a/users/talljoe/rules.mk +++ b/users/talljoe/rules.mk @@ -5,3 +5,5 @@ EXTRAFLAGS+=-flto TAP_DANCE_ENABLE=yes CONSOLE_ENABLE=no COMMAND_ENABLE=no +DYNAMIC_KEYMAP_ENABLE=no +BOOTMAGIC_ENABLE=full diff --git a/users/talljoe/talljoe.c b/users/talljoe/talljoe.c index 7a343e7768c..345b5604bb0 100644 --- a/users/talljoe/talljoe.c +++ b/users/talljoe/talljoe.c @@ -1,13 +1,16 @@ #include QMK_KEYBOARD_H #include "talljoe.h" +#ifdef ZEAL_RGB +#include "../../../keyboards/zeal60/rgb_backlight.h" +#endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = TEMPLATE_TKL( KC_ESC, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PSCR, KC_SLCK, MO_ADJ , US_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , US_BSLS, KC_INS , KC_HOME, KC_PGUP, US_TAB , KC_Q, KC_W, KC_E, KC_R, KC_T , KC_Y, KC_U, KC_I, KC_O, KC_P , KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL , KC_END , KC_PGDN, - CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, US_QUOT, US_ENT , + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, KC_QUOT, US_ENT , SH_LBRC, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SH_RBRC, KC_UP , KC_LCTL, KC_LGUI, KC_LALT, KC_SPC2, KC_SPC1, KC_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT , KC_LEFT, KC_DOWN, KC_RGHT), [_WORKMAN] = TEMPLATE( @@ -52,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_PTT , KC_PGDN, KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_APP , KC_RCTL, KC_PTT ), #endif [_NAV] = TEMPLATE_NAV( - KC_GRV , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , XXXXXXX, XXXXXXX, US_TAB , KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_INS , KC_PGUP, KC_UP , KC_PGDN, KC_BTN1, KC_BTN3, KC_BTN2, KC_DEL , CTL_ESC, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_AMPR, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , US_QUOT, TG_ADJ , KC_LSFT, KC_EQL, KC_PLUS, KC_MINS, KC_UNDS, KC_ASTR, KC_CALC, US_GRV , KC_WBAK, KC_WFWD, KC_WREF, KC_RSFT, KC_APP , @@ -65,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, NM_SPC2, NM_SPC1, NM_SPC3, KC_PDOT, KC_PCMM, KC_RCTL, KC_PTT ), // Adjust layer is on the split-shift key; or NAV+Enter (for non-split keyboards) [_ADJUST] = TEMPLATE_ADJUST( - MO_RST , FX(1) , FX(2) , FX(3) , FX(4) , FX(5) , FX(8) , FX(9) , FX(10) , FX(20) , FX(0) , BR_DEC , BR_INC , XXXXXXX, MO_RST , + MO_RST , FX(1) , FX(2) , FX(3) , FX(4) , FX(5) , FX(6) , FX(7) , FX(8) , FX(9) , FX(10) , BR_DEC , BR_INC , XXXXXXX, MO_RST , MO_RST , H1_INC , S1_INC , H2_INC , S2_INC , EF_INC , RGB_HUI, RGB_SAI, RGB_MOD, RGB_M_P, DFAULTS, RGB_VAD, RGB_VAI, MO_RST , XXXXXXX, H1_DEC , S1_DEC , H2_DEC , S2_DEC , EF_DEC , RGB_HUD, RGB_SAD, RGB_RMOD,RGB_M_K, RGB_M_B, RGB_M_G, TG_ADJ , TG_NKRO, LY_QWER, LY_WORK, LY_NRMN, LY_DVRK, LY_CLMK, XXXXXXX, LY_MALT, XXXXXXX, XXXXXXX, KC_MAKE, KC_CAPS, XXXXXXX, @@ -101,7 +104,13 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } +#ifdef ZEAL_RGB +extern backlight_config g_config; +#endif bool process_record_user(uint16_t keycode, keyrecord_t *record) { +#ifdef ZEAL_RGB + static uint8_t last_effect; +#endif #ifdef RGBLIGHT_ENABLE static uint32_t savedRgbMode; @@ -144,6 +153,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; +#ifdef ZEAL_RGB + case BL_TOGG: + if (IS_PRESSED(record->event)) { + if (g_config.effect) { + last_effect = g_config.effect; + g_config.effect = 0; + } else { + g_config.effect = last_effect; + } + } + return false; + case EFFECT...EFFECT_END: + if (IS_PRESSED(record->event)) { + uint8_t effect = keycode - EFFECT; + if(effect == g_config.effect) + effect = 0; // Toggle effect on second press + g_config.effect = effect; + backlight_config_save(); + } + return false; +#endif } return process_record_keymap(keycode, record); } diff --git a/users/talljoe/talljoe.h b/users/talljoe/talljoe.h index 4436c0a0440..496a6222a92 100644 --- a/users/talljoe/talljoe.h +++ b/users/talljoe/talljoe.h @@ -35,9 +35,6 @@ enum tap_dancers { TD_QUOTE, }; -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define MO_NAV MO(_NAV) #define MO_ADJ MO(_ADJUST) #define MO_RST MO(_RESET) diff --git a/users/turbomech/backupturbomech.c b/users/turbomech/backupturbomech.c index 49bcded552b..2815aa452f3 100644 --- a/users/turbomech/backupturbomech.c +++ b/users/turbomech/backupturbomech.c @@ -269,7 +269,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { /*case RGB_MOD: -case RGB_SMOD: case RGB_HUI: case RGB_HUD: case RGB_SAI: diff --git a/users/vosechu/config.h b/users/vosechu/config.h new file mode 100644 index 00000000000..837cc60ff7c --- /dev/null +++ b/users/vosechu/config.h @@ -0,0 +1,24 @@ +#pragma once + +// this makes it possible to do rolling combos (zx) with keys that +// convert to other keys on hold (z becomes ctrl when you hold it, +// and when this option isn't enabled, z rapidly followed by x +// actually sends Ctrl-x. That's bad.) +#define IGNORE_MOD_TAP_INTERRUPT +#undef PERMISSIVE_HOLD +//#define TAPPING_FORCE_HOLD +//#define RETRO_TAPPING + +#ifndef TAPPING_TOGGLE +#define TAPPING_TOGGLE 2 +#endif + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 150 + +// Disable action_get_macro and fn_actions, since we don't use these +// and it saves on space in the firmware. +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/users/vosechu/readme.md b/users/vosechu/readme.md new file mode 100644 index 00000000000..44789a9ff2c --- /dev/null +++ b/users/vosechu/readme.md @@ -0,0 +1,14 @@ +Copyright 2018 Chuck Lauer Vose vosechu@gmail.com @vosechu + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/users/vosechu/rules.mk b/users/vosechu/rules.mk new file mode 100644 index 00000000000..e346db93fb8 --- /dev/null +++ b/users/vosechu/rules.mk @@ -0,0 +1 @@ +SRC += vosechu.c diff --git a/users/vosechu/vosechu.c b/users/vosechu/vosechu.c new file mode 100644 index 00000000000..3f58ca26a8d --- /dev/null +++ b/users/vosechu/vosechu.c @@ -0,0 +1,25 @@ +#include "vosechu.h" + +// void my_custom_function(void) { + +// } + +// [DV] = { /* ================================================== DVORAK ============================================================ */ +// { KC_1, KC_A, KC_B, KC_C, KC_D, KC_E, _______ , KC_G, KC_H, KC_J, KC_K, KC_L, KC_M }, +// { KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, _______ , KC_G, KC_H, KC_J, KC_K, KC_L, KC_M }, +// { KC_3, KC_A, KC_B, KC_C, KC_D, KC_E, _______ , KC_G, KC_H, KC_J, KC_K, KC_L, KC_M }, +// { KC_4, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F , KC_G, KC_H, KC_J, KC_K, KC_L, KC_M }, +// { KC_5, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F , KC_G, KC_H, KC_J, KC_K, KC_L, KC_M } +// }, + +// bool process_record_user(uint16_t keycode, keyrecord_t *record) { +// if (record->event.pressed) { +// // These also need to be defined in the header file +// switch(keycode) { +// case PAWFIVE: +// SEND_STRING(":pawfive:"); +// return false; +// } +// } +// return true; +// }; diff --git a/users/vosechu/vosechu.h b/users/vosechu/vosechu.h new file mode 100644 index 00000000000..5cd2217ea19 --- /dev/null +++ b/users/vosechu/vosechu.h @@ -0,0 +1,71 @@ +#pragma once + +#include "quantum.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +enum userspace_custom_layers { + DV = 0, + QW, + GAM1, + RSE, + LWR, + LFT, + MOUSE +}; + +enum userspace_custom_keycodes { + PAWFIVE = SAFE_RANGE, + MOUKEY, + MS_BTN1, + MS_BTN2, + MS_BTN3 +}; + +// Transparent macro to indicate that this spot is already being pressed +// to activate this layer +#define _LAYER_ KC_TRNS + +// == Dual-action keys on most of the modifiers +#define CTL_ESC CTL_T(KC_ESC) +#define CTL_GRV CTL_T(KC_GRV) +#define ALT_TAB ALT_T(KC_TAB) +#define SFT_SPC SFT_T(KC_SPC) + +// == Macro keys for commonly used apps +// -- Slack +// Move one conversation up/down +#define SLACKUP LALT(LSFT(KC_UP)) +#define SLACKDN LALT(LSFT(KC_DOWN)) + +// -- Browser and OS X +// Activate one tab left/right +#define TAB_LFT LGUI(LSFT(KC_LBRC)) +#define TAB_RGT LGUI(LSFT(KC_RBRC)) +// Go back/forward in history +#define BWSR_BK LGUI(KC_LBRC) +#define BWSR_FW LGUI(KC_RBRC) + +// -- Screen management +// Make window fill the left/right side +#define SCR_LFT HYPR(KC_LEFT) +#define SCR_RGT HYPR(KC_RGHT) +// Make window fill the whole monitor +#define SCR_FUL HYPR(KC_F) + +// == Extended alpha layer toggles +// -- Dvorak +// Pressing U opens up the LWR layer (numpad) +#define LWR_U LT(LWR, KC_U) +// Pressing H opens up the RSE layer (brackets/parens) +#define RSE_H LT(RSE, KC_H) + +// -- Qwerty +// Pressing F opens up the LWR layer (numpad) +#define LWR_F LT(LWR, KC_F) +// Pressing J opens up the RSE layer (brackets/parens) +#define RSE_J LT(RSE, KC_J) + +// -- LFT layer (Works on both Qwerty and Dvorak) +// Pressing Back space or Enter opens up the LFT layer (media/navigation) +#define LFT_BK LT(LFT, KC_BSPC) +#define LFT_ENT LT(LFT, KC_ENT) diff --git a/users/wanleg/config.h b/users/wanleg/config.h index f2e785659f9..d29054694c8 100644 --- a/users/wanleg/config.h +++ b/users/wanleg/config.h @@ -1,12 +1,14 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H +#pragma once //TAPPING_TERM //tapping term short (<100): on multi-purpose keys, slow taps may not register, but "holds" register easier. multi-tap keys may be difficult to activate. //tapping term long (>200): holds don't register as easily - noticeable when typing quickly (e.g. shift doesn't want to engage.) -#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) + + +//MIGHT HAVE TO SPLIT THIS INTO TWO CONDITIONS +#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) || defined(KEYBOARD_keebio_iris_rev2) //Kailh Coppers activate quickly and don't need a long tapping term -#define TAPPING_TERM 100 +#define TAPPING_TERM 180 #elif defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_bigswitch) #define TAPPING_TERM 700 @@ -36,9 +38,14 @@ #define NO_ACTION_FUNCTION #define NO_ACTION_ONESHOT -// Disable mod tap interrrupt -#ifndef IGNORE_MOD_TAP_INTERRUPT -#define IGNORE_MOD_TAP_INTERRUPT -#endif // !mod tap interrrupt -#endif // !USERSPACE_CONFIG_H +#define PERMISSIVE_HOLD +//// Disable mod tap interrrupt +//#ifndef IGNORE_MOD_TAP_INTERRUPT +//#define IGNORE_MOD_TAP_INTERRUPT +//#endif // !mod tap interrrupt + +//set max breathing brightness on kbd6x +#if defined(KEYBOARD_kbdfans_kbd6x) +#define RGBLIGHT_EFFECT_BREATHE_MAX 128 // 0-255 +#endif diff --git a/users/wanleg/readme.md b/users/wanleg/readme.md index f687b92f48f..4276111280d 100644 --- a/users/wanleg/readme.md +++ b/users/wanleg/readme.md @@ -1,14 +1,125 @@ -Copyright 2018 Brian Fong @wanleg +# Contents + * [Git Basics](#git-basics) + * [Update a Feature Branch](#update-a-development-branch) + * [Delete Branch Locally and Remotely](#delete-branch-locally-and-remotely) + * [Merge TEST branch into DEV branch](#merge-test-branch-into-dev-branch) + * [STM32F103C8T6 Setup](#STM32F103C8T6-setup) + * [Bootloader](#bootloader) + * [Flashing QMK](#flashing-qmk) -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. +--- +## Git Basics +### Update a Development Branch -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +This is how to update a working branch with upstream changes. +First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch) +```bash +$ git checkout master +``` -You should have received a copy of the GNU General Public License -along with this program. If not, see . +Fetch the remote, bringing the branches and their commits from the remote repository. +You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master +```bash +$ git fetch -p origin +``` + +Merge the changes from origin/master into your local master branch. This brings your master branch in sync with the remote repository, without losing your local changes. If your local branch didn't have any unique commits, Git will instead perform a "fast-forward". +```bash +$ git merge origin/master +``` + +Checkout the branch you want to merge into +```bash +$ git checkout +``` + +Merge your (now updated) master branch into your feature branch to update it with the latest changes from your team. +```bash +$ git merge master +``` + +This will open your git-configured text editor. Edit the message as desired, save, and exit the editor. + +The above steps only update your local feature branch. To update it on GitHub, push your changes. +```bash +$ git push origin +``` + +### Delete Branch Locally and Remotely + +Executive Summary +```bash +$ git push --delete +$ git branch -d +``` +Note that in most cases the remote name is origin. + +Delete Local Branch +To delete the local branch use one of the following: +```bash +$ git branch -d branch_name +$ git branch -D branch_name +``` +Note: The -d option is an alias for --delete, which only deletes the branch if it has already been fully merged in its upstream branch. You could also use -D, which is an alias for --delete --force, which deletes the branch "irrespective of its merged status." [Source: man git-branch] + +Delete Remote Branch [Updated on 8-Sep-2017] +As of Git v1.7.0, you can delete a remote branch using +```bash +$ git push --delete +``` +which might be easier to remember than +```bash +$ git push : +``` +which was added in Git v1.5.0 "to delete a remote branch or a tag." + +Starting on Git v2.8.0 you can also use `git push` with the `-d` option as an alias for `--delete`. + +Therefore, the version of Git you have installed will dictate whether you need to use the easier or harder syntax. + +### Merge TEST branch into DEV branch + +Executive Summary +```bash +$ git checkout DEV +$ git merge TEST +$ git push DEV +$ git branch -d TEST +$ git push :TEST +``` +Note that in most cases the remote name is origin. +The above code will merge, push to remote, and delete both the local and remote TEST branches + +--- +## STM32F103C8T6 Setup +Cheap "Blue/Black Pills" typically do not come with a bootloader installed. The Black Pill uses [generic_boot20_pb12.bin](https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/binaries/generic_boot20_pb12.bin). The Blue Pill uses [generic_boot20_pc13.bin](https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/binaries/generic_boot20_pc13.bin). +The following instructions have been adapted from [here](http://wiki.stm32duino.com/index.php?title=Burning_the_bootloader). +### Bootloader +Flashing a bootloader on to a Black Pill can be done via a USB to Serial converter (e.g. CP2102). This process should be roughly the same for all F103 boards. + +1. Download the correct bootloader binary +2. Set the 'boot 0' pin/jumper high, and 'boot 1' low + B0+ to center pin + B1- to center pin +3. Connect the board to the PC using a USB to serial converter + RX to PA9 + TX to PA10 + GND to Ground + 3.3V to 3.3 Volts +4. Download and install __Flash Loader Demonstrator__ from [here](http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html) +5. Use __Flash Loader Demonstrator__ to flash the bootloader + Ensure the correct COM port is selected. Leave other options with their default values/selections. + Use the "Download to Device" option, with "Erase necessary pages" selected +6. After a successful flash, set 'boot 0' pin/jumper low + B0- to center pin + B1- to center pin (no change) + +### Flashing QMK +As of April 2019, the `:dfu-util` target doesn't work on a \*Pill. You will need to use dfu-util directly. +1. Use QMK to build your `.bin` +2. Run `dfu-util.exe -d 1eaf:0003 -a 2 -D YOUR_FIRMWARE.bin"` + If this is the first QMK flash on the \*Pill, you will need to synchronize your Reset Button-push with starting the command. By default, the \*Pill only stays in bootloader mode for about 3 seconds before returning to normal operation. + +See [this page](https://docs.qmk.fm/#/faq_build?id=unknown-device-for-dfu-bootloader) if Windows can't see anything to upload to. + +--- diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index 2a2a65cfea5..eb66a49e6fa 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -14,3 +14,32 @@ endif ifeq ($(strip $(PM)), yes) OPT_DEFS += -DPRO_MICRO endif + +#use alternate settings for boards using "Adafruit Feather 32u4 Bluefruit LE" instead of Micro +#example usage: make 5x5:wanleg BT=yes +ifeq ($(strip $(BT)), yes) + #opt_defs for alternate pin usage + OPT_DEFS += -DBLUEFRUIT + #Adafruit Bluefruit controller settings + BLUETOOTH = AdafruitBLE + BLUETOOTH_ENABLE = yes + F_CPU = 8000000 + CONSOLE_ENABLE = no # Console for debug(+400) + COMMAND_ENABLE = no # Commands for debug and configuration + RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +endif + +#move numpad to Left/Centre/Right(default) on 5x15 boards +#example usage: make 4x4:wanleg padc=yes +ifeq ($(strip $(padc)), yes) + OPT_DEFS += -DPADC +endif +ifeq ($(strip $(padl)), yes) + OPT_DEFS += -DPADL +endif + +#change gherkin orientation (i.e. move USB port from right side to left side) +#example usage: make gherkin:wanleg flip=yes +ifeq ($(strip $(flip)), yes) + OPT_DEFS += -DFLIP +endif \ No newline at end of file diff --git a/users/wanleg/tapdances.c b/users/wanleg/tapdances.c index 3878e6d31c2..1be5636dc7b 100644 --- a/users/wanleg/tapdances.c +++ b/users/wanleg/tapdances.c @@ -73,9 +73,9 @@ void CAD_finished (qk_tap_dance_state_t *state, void *user_data) { //register_code(KC_NO); //take a screenshot of a single window, open Paint and paste SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN)) SS_LGUI("r")); - _delay_ms(500); + wait_ms(500); SEND_STRING("mspaint" SS_TAP(X_ENTER)); - _delay_ms(700); + wait_ms(700); SEND_STRING(SS_LCTRL("v")); break; //register this keycode when button is held case DOUBLE_TAP: @@ -168,7 +168,7 @@ void LYR75_finished (qk_tap_dance_state_t *state, void *user_data) { LYR75tap_state.state = cur_dance(state); switch (LYR75tap_state.state) { case SINGLE_TAP: register_code(KC_PSLS); break; - case DOUBLE_TAP: set_single_persistent_default_layer(GK75); break; + case DOUBLE_TAP: set_single_persistent_default_layer(_GK); break; case DOUBLE_SINGLE_TAP: register_code(KC_PSLS); unregister_code(KC_PSLS); register_code(KC_PSLS); } } @@ -176,7 +176,7 @@ void LYR75_finished (qk_tap_dance_state_t *state, void *user_data) { void LYR75_reset (qk_tap_dance_state_t *state, void *user_data) { switch (LYR75tap_state.state) { case SINGLE_TAP: unregister_code(KC_PSLS); break; - case DOUBLE_TAP: set_single_persistent_default_layer(GK75); break; + case DOUBLE_TAP: set_single_persistent_default_layer(_GK); break; case DOUBLE_SINGLE_TAP: unregister_code(KC_PSLS); } LYR75tap_state.state = 0; diff --git a/users/wanleg/wanleg.c b/users/wanleg/wanleg.c index 4e60c422fae..aa7b1c9a4c4 100644 --- a/users/wanleg/wanleg.c +++ b/users/wanleg/wanleg.c @@ -6,20 +6,30 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); set_single_persistent_default_layer(_QW); + #if defined(RGBLIGHT_ENABLE) + rgblight_sethsv_noeeprom(0,0,128); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING); + #endif } return false; break; case GHERKIN: if (record->event.pressed) { set_single_persistent_default_layer(_GK); + #if defined(RGBLIGHT_ENABLE) + rgblight_sethsv_noeeprom(128,255,64); + #endif } return false; break; case gGHERKIN: if (record->event.pressed) { set_single_persistent_default_layer(gGK); + #if defined(RGBLIGHT_ENABLE) + rgblight_sethsv_noeeprom(128,255,128); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT); + #endif } return false; break; @@ -29,18 +39,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case QWERTY75: - if (record->event.pressed) { - set_single_persistent_default_layer(QW75); - } - return false; - break; - case GHERKIN75: - if (record->event.pressed) { - set_single_persistent_default_layer(GK75); - } - return false; - break; case NUMPAD: if (record->event.pressed) { set_single_persistent_default_layer(PAD); @@ -117,53 +115,24 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case SUBTER75: - if (record->event.pressed) { - layer_on(SUB75); - } else { - layer_off(SUB75); - } - return false; - break; - case SUPRA75: + case FUNCTION: if (record->event.pressed) { - layer_on(SUP75); + layer_on(_FN); } else { - layer_off(SUP75); + layer_off(_FN); } return false; break; - case NUMBER75: + //on RESET, underglow red if present + case RESET: if (record->event.pressed) { - layer_on(NUM75); - } else { - layer_off(NUM75); + #if defined(RGBLIGHT_ENABLE) + rgblight_enable_noeeprom(); // enables Rgb, without saving settings + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv_noeeprom_red(); + #endif } - return false; - break; - case DIRECTION75: - if (record->event.pressed) { - layer_on(DIR75); - } else { - layer_off(DIR75); - } - return false; - break; - case ETCETERA75: - if (record->event.pressed) { - layer_on(ETC75); - } else { - layer_off(ETC75); - } - return false; - break; - case FUNCTION75: - if (record->event.pressed) { - layer_on(FN75); - } else { - layer_off(FN75); - } - return false; + return true; // Let QMK send the press/release events as normal break; } return true; @@ -180,6 +149,7 @@ void matrix_init_keymap(void) {} // Call user matrix init, then call the keymap's init function void matrix_init_user(void) { +//turn off pro micro LEDs #if defined(KEYBOARD_lets_split_rev2) DDRD &= ~(1<<5); PORTD &= ~(1<<5); @@ -187,5 +157,20 @@ void matrix_init_user(void) { DDRB &= ~(1<<0); PORTB &= ~(1<<0); #endif + +//disable backlight breathing for keyboard using random flashing RGB LEDs for backlight +//(breathing provides insufficient power to integrated LED IC) +#if defined(KEYBOARD_kbdfans_kbd6x) && defined(BACKLIGHT_BREATHING) + breathing_disable(); +#endif matrix_init_keymap(); -} \ No newline at end of file +} + +//at end of firmware startup process, change powerup default layer and underglow colour for kbd6x +void keyboard_post_init_user(void) { + #if defined(KEYBOARD_kbdfans_kbd6x) + set_single_persistent_default_layer(_QW); + rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 5); + rgblight_sethsv_noeeprom(0,0,128); + #endif +} diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index 9e0cf3ee5d6..2aea1a31e7e 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -1,10 +1,9 @@ -#ifndef USERSPACE -#define USERSPACE +#pragma once #include "quantum.h" // Define layer names and order -#ifdef KEYBOARD_gherkin +#if defined(KEYBOARD_40percentclub_gherkin) || defined(KEYBOARD_kbdfans_kbd6x) enum userspace_layers { gGK = 0, gNUM, @@ -12,78 +11,39 @@ enum userspace_layers { gETC, _GK, _QW, - QW75, - GK75, ONE, SUB, SUP, NUM, DIR, ETC, - SUB75, - SUP75, - NUM75, - DIR75, - ETC75, - FN75, + _FN, PAD, GK50, }; -#elif KEYBOARD_xd75 +#elif KEYBOARD_40percentclub_5x5 enum userspace_layers { - GK75 = 0, - PAD, - QW75, - SUB75, - SUP75, - NUM75, - DIR75, - ETC75, - FN75, - gGK, + GK50 = 0, _GK, _QW, - ONE, - SUB, - SUP, - NUM, - DIR, - ETC, - gNUM, - gDIR, - gETC, - GK50, -}; -#elif KEYBOARD_5x5 -enum userspace_layers { - GK50 = 0, + PAD, gNUM, gDIR, gETC, - GK75, - QW75, - SUB75, - SUP75, - NUM75, - DIR75, - ETC75, - FN75, - PAD, gGK, - _GK, - _QW, ONE, SUB, SUP, NUM, DIR, ETC, + _FN, }; #else enum userspace_layers { _GK = 0, - PAD, _QW, + PAD, ONE, SUB, SUP, @@ -94,14 +54,7 @@ enum userspace_layers { gNUM, gDIR, gETC, - QW75, - GK75, - SUB75, - SUP75, - NUM75, - DIR75, - ETC75, - FN75, + _FN, GK50, }; #endif @@ -110,8 +63,6 @@ enum userspace_custom_keycodes { gGHERKIN = SAFE_RANGE, GHERKIN, QWERTY, - QWERTY75, - GHERKIN75, ONEHAND, SUBTER, SUPRA, @@ -121,12 +72,7 @@ enum userspace_custom_keycodes { gNUMBER, gDIRECTION, gETCETERA, - SUBTER75, - SUPRA75, - NUMBER75, - DIRECTION75, - ETCETERA75, - FUNCTION75, + FUNCTION, NUMPAD, GHERKIN50, @@ -156,11 +102,11 @@ enum { #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_ortho_3x10_wrapper(...) LAYOUT_ortho_3x10(__VA_ARGS__) -#define LAYOUT_ortho_5x10_wrapper(...) LAYOUT_ortho_5x10(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) #define LAYOUT_ortho_4x4_wrapper(...) LAYOUT_ortho_4x4(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) #define LAYOUT_ortho_5x5_wrapper(...) LAYOUT_ortho_5x5(__VA_ARGS__) +#define LAYOUT_ortho_5x10_wrapper(...) LAYOUT_ortho_5x10(__VA_ARGS__) +#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) // Blocks for each of the major keyboard layouts // Organized so we can quickly adapt and modify all of them @@ -172,22 +118,22 @@ enum { // lengths consistent. -/* Pure Gherkin +/* Gherkin * .-----------------------------------------------------------------------------------------. * | Q//ESC | W | E | R | T | Y | U | I | O | P | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | A | S | D | F | G | H | J | K | L | SPACE | * | | | | | | | | | |SFThold | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Z | X | C | V/gNUM | B/gETC | N | M/gDIR | ,/GUI | ./ALT | BSPC | + * | Z | X | C | V/gNUM | B/gETC | N/Fn | M/gDIR | ,/GUI | ./ALT | BSPC | * | SFThold| | | | | | | | |CTRLhold| * '-----------------------------------------------------------------------------------------' */ #define _______________Gherkin_Row_0_______________ TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P #define _______________Gherkin_Row_1_______________ KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SFT_T(KC_SPC) -#define _______________Gherkin_Row_2_______________ SFT_T(KC_Z), KC_X, KC_C, LT(gNUM,KC_V), LT(gETC,KC_B), KC_N, LT(gDIR,KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) +#define _______________Gherkin_Row_2_______________ SFT_T(KC_Z), KC_X, KC_C, LT(gNUM,KC_V), LT(gETC,KC_B), LT(_FN,KC_N), LT(gDIR,KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) -/* Directional Keys +/* Gherkin Directional Keys * .-----------------------------------------------------------------------------------------. * | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -200,7 +146,7 @@ enum { #define _______________Gherkin_DIR_1_______________ KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_RCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC #define _______________Gherkin_DIR_2_______________ KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_LALT, KC_SLSH -/* Numbers +/* Gherkin Numbers * .-----------------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -214,27 +160,27 @@ enum { #define _______________Gherkin_NUM_1_______________ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 #define _______________Gherkin_NUM_2_______________ KC_F11, KC_F12, _______,_______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC) -/* Et Cetera +/* Gherkin Et Cetera * .-----------------------------------------------------------------------------------------. - * | ` | mUP | | | RESET | SHIFT | mScrUp | mScrDn | | \ | + * | ` | mUP | | ESC | RESET | SHIFT | mScrDn | mScrUp | | \ | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | Sft//Cp| CAPS | | | | C-A-D | mScrL | mScrR | ALT | DEL | * '-----------------------------------------------------------------------------------------' */ -#define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,_______, RESET, KC_RSFT, KC_WH_U, KC_WH_D, _______, KC_BSLS +#define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,KC_ESC, RESET, KC_RSFT, KC_WH_D, KC_WH_U, _______, KC_BSLS #define _______________Gherkin_ETC_1_______________ KC_MS_L, KC_MS_D, KC_MS_R,_______, KC_LSFT, KC_BTN3, KC_BTN1, KC_BTN2, KC_SCLN, KC_QUOT #define _______________Gherkin_ETC_2_______________ TD(TD_SFT_CAPS),KC_CAPS, _______,_______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL /* Gherkin-Like * .-----------------------------------------------------------------------------------------------------------. - * | ESC | Q//ESC | W | E | R | T | Y | U | I | O | P | BSPC | + * | ESC | Q//ESC | W | E | R | T | Y | U | I | O | P | BSPC | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | TAB | A | S | D | F | G | H | J | K | L | SPACE | ' | * | | | | | | | | | | |SFThold | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * |SFT/CAPS| Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BSPC | ENT/SFT| + * |SFT/CAPS| Z | X | C | V/NUM | B/ETC | N/Fn | M/DIR | ,/GUI | ./ALT | BSPC | ENT/SFT| * | |SFThold | | | | | | | | |CTRLhold| | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | LCTRL | LGUI | ALT | ONEHAND| NUM | ETC | SPACE | DIR | RGUI | ALT | DEL | CTRL | @@ -242,7 +188,7 @@ enum { */ #define _______________GherkinLike_0_______________ KC_ESC, _______________Gherkin_Row_0_______________, KC_BSPC #define _______________GherkinLike_1_______________ KC_TAB, _______________Gherkin_Row_1_______________, KC_QUOT -#define _______________GherkinLike_2_______________ TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V),LT(ETC, KC_B),KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT) +#define _______________GherkinLike_2_______________ TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V),LT(ETC, KC_B),LT(_FN,KC_N), LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT) #define _______________GherkinLike_3_______________ KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL #define _______________GherkinLike_3_OneHand_______ KC_LCTL, KC_LGUI, KC_LALT, ONEHAND, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, ONEHAND, KC_RCTL @@ -295,7 +241,7 @@ enum { #define _______________SUBTER_Row__2_______________ _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_RGUI,ALT_T(KC_DOT), CTL_T(KC_BSPC), _______ #define _______________SUBTER_Row__3_______________ _______, _______, GHERKIN, _______, _______, _______, KC_ENT, KC_LSFT, _______,_______, _______, _______ -/* Gherkin Numbers +/* Gherkin-Like Numbers * .-----------------------------------------------------------------------------------------------------------. * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | BSPC | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -313,7 +259,7 @@ enum { #define _______________NUMBERS_Row_3_______________ _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______, _______ -/* Gherkin Directional Keys +/* Gherkin-Like Directional Keys * .-----------------------------------------------------------------------------------------------------------. * | | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | DEL | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -329,9 +275,9 @@ enum { #define _____________DIRECTIONS_Row__2_____________ _______, _______________Gherkin_DIR_2_______________, _______ #define _____________DIRECTIONS_Row__3_____________ _______, _______, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, _______ -/* Gherkin Et Cetera +/* Gherkin-Like Et Cetera * .-----------------------------------------------------------------------------------------------------------. - * | | ` | mUP | | | RESET | SHIFT | mScrUp |mScrDown| | \ | DEL | + * | | ` | mUP | | | RESET | SHIFT | mScrDn | mScrUp | | \ | DEL | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -344,7 +290,7 @@ enum { #define ______________ETCETERA_Row__1______________ _______, _______________Gherkin_ETC_1_______________, _______ #define ______________ETCETERA_Row__2______________ _______, _______________Gherkin_ETC_2_______________, _______ #define ______________ETCETERA_Row__3______________ _______, _______, _______, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______, _______ - + /* Single 4x4 board only * .-----------------------------------. * | 7 | 8 | 9 | BSPC | @@ -361,4 +307,16 @@ enum { #define _______________NUMPAD_Row__1_______________ KC_KP_4, KC_KP_5, KC_KP_6, KC_SPC #define _______________NUMPAD_Row__2_______________ KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT #define _______________NUMPAD_Row__3_______________ KC_KP_0, TD(LYR_TAP_DANCE), KC_KP_DOT, KC_PMNS -#endif // !USERSPACE + +/* Gherkin FN/Lighting + * .-----------------------------------------------------------------------------------------------------. + * | BL_breathe | BL_brite- | BL_brite+ | BL_toggle | BL_briteCyc | BL_briteMax | | | | | + * |------------+-----------+-----------+-----------+-------------+-------------+-----+-----+-----+------| + * | UG_breathe | UG_brite- | UG_brite+ | UG_toggle | UG_modeCycle| | | | | | + * |------------+-----------+-----------+-----------+-------------+-------------+-----+-----+-----+------| + * | UG_hue- | UG_hue+ | UG_sat- | UG_sat+ | | | | | |QWERTY| + * '-----------------------------------------------------------------------------------------------------' + */ +#define _______________Gherkin_FN_0________________ BL_BRTG, BL_DEC, BL_INC, BL_TOGG, BL_STEP, BL_ON, _______, _______, _______, _______ +#define _______________Gherkin_FN_1________________ RGB_M_B, RGB_VAD, RGB_VAI, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______ +#define _______________Gherkin_FN_2________________ RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, QWERTY diff --git a/users/xulkal/config.h b/users/xulkal/config.h new file mode 100644 index 00000000000..c794530d456 --- /dev/null +++ b/users/xulkal/config.h @@ -0,0 +1,30 @@ +#pragma once + +#undef TAPPING_FORCE_HOLD + +#undef TAPPING_TERM +#define TAPPING_TERM 175 + +#define SPACE_CADET_MODIFIER_CARRYOVER +#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_LBRC +#define RSPC_KEYS KC_RSFT, KC_TRNS, KC_RBRC +#define LCPO_KEYS KC_LCTL, KC_TRNS, KC_MINS +#define RCPC_KEYS KC_RCTL, KC_TRNS, KC_EQL + +// Running out of firmware space +#if defined(__AVR__) +#undef RGB_MATRIX_KEYPRESSES +#undef RGB_MATRIX_KEYRELEASES +#undef RGB_MATRIX_FRAMEBUFFER_EFFECTS +#else +#define RGB_MATRIX_KEYPRESSES +#undef RGB_MATRIX_KEYRELEASES +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#endif + +// No need for the single versions when multi performance isn't a problem =D +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define DISABLE_RGB_MATRIX_SPLASH +#define DISABLE_RGB_MATRIX_SOLID_SPLASH diff --git a/users/xulkal/custom_encoder.c b/users/xulkal/custom_encoder.c new file mode 100644 index 00000000000..cd029944ff3 --- /dev/null +++ b/users/xulkal/custom_encoder.c @@ -0,0 +1,72 @@ +#include "custom_encoder.h" +#include "custom_keycodes.h" + +#ifdef RGB_OLED_MENU +#include "custom_rgb.h" + +// I'm lazy and like constants over calculations, also using it as a compile time check +#if defined(RGB_MATRIX_ENABLE) + #define RGB_FUNCTION_COUNT 6 +#elif defined(RGBLIGHT_ENABLE) + #define RGB_FUNCTION_COUNT 5 +#endif + +typedef void (*rgb_f)(void); + +const rgb_f rgb_functions[RGB_FUNCTION_COUNT][2] = { +#if defined(RGB_MATRIX_ENABLE) + { rgb_matrix_increase_hue, rgb_matrix_decrease_hue }, + { rgb_matrix_increase_sat, rgb_matrix_decrease_sat }, + { rgb_matrix_increase_val, rgb_matrix_decrease_val }, + { rgb_matrix_increase_speed, rgb_matrix_decrease_speed }, + { rgb_matrix_step, rgb_matrix_step_reverse }, + { rgb_matrix_increase_flags, rgb_matrix_decrease_flags } +#elif defined(RGBLIGHT_ENABLE) + { rgblight_increase_hue, rgblight_decrease_hue }, + { rgblight_increase_sat, rgblight_decrease_sat }, + { rgblight_increase_val, rgblight_decrease_val }, + { rgblight_increase_speed, rgblight_decrease_speed }, + { rgblight_step, rgblight_step_reverse } +#endif +}; + +// Start at the end for mode +uint8_t rgb_encoder_state = 4; + +bool process_record_encoder(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { + case RGB_ENC: + if (record->event.pressed) { + if (get_mods() & MOD_MASK_SHIFT) { + rgb_encoder_state = (rgb_encoder_state - 1); + if (rgb_encoder_state >= RGB_FUNCTION_COUNT) + rgb_encoder_state = RGB_FUNCTION_COUNT - 1; + } else { + rgb_encoder_state = (rgb_encoder_state + 1) % RGB_FUNCTION_COUNT; + } + } + return false; + } + return true; +} +#endif // RGB_OLED_MENU + +const uint16_t PROGMEM encoders[][2] = { + { KC_PGUP, KC_PGDN }, + { KC_VOLU, KC_VOLD } +}; + +void encoder_update_user(uint8_t index, bool clockwise) +{ + if (!is_keyboard_master()) + return; + +#ifdef RGB_OLED_MENU + if (index == RGB_OLED_MENU) + (*rgb_functions[rgb_encoder_state][clockwise])(); + else +#endif // RGB_OLED_MENU + tap_code16(pgm_read_word(&encoders[index][clockwise])); +} diff --git a/users/xulkal/custom_encoder.h b/users/xulkal/custom_encoder.h new file mode 100644 index 00000000000..010d4b1383a --- /dev/null +++ b/users/xulkal/custom_encoder.h @@ -0,0 +1,2 @@ +#pragma once +#include "quantum.h" diff --git a/users/xulkal/custom_keycodes.h b/users/xulkal/custom_keycodes.h new file mode 100644 index 00000000000..7ced92bf4ce --- /dev/null +++ b/users/xulkal/custom_keycodes.h @@ -0,0 +1,40 @@ +#pragma once + +enum custom_keycodes { + RGBRST = SAFE_RANGE, +#ifndef TAP_DANCE_ENABLE + TD_MIN, + TD_COMM = TD_MIN, + TD_BSPC, + TD_DEL, + TD_DOT, + TD_MAX, +#endif +#ifdef ENCODER_ENABLE + RGB_ENC, +#endif + KEYMAP_SAFE_RANGE +}; + +#define RIS_ESC LT(_RAISE, KC_ESC) +#define RIS_CAPS LT(_RAISE, KC_CAPS) + +#define QWERTY DF(_QWERTY) + +#ifndef GAMELAYER_DISABLE +#define GAME DF(_GAME) +#else +#define GAME KC_TRANSPARENT +#endif + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + + +#ifdef ENCODER_ENABLE +#define KC_ENC1 RGB_ENC +#define KC_ENC2 KC_MPLY +#else +#define KC_ENC1 RGB_RMOD +#define KC_ENC2 RGB_MOD +#endif diff --git a/users/xulkal/custom_oled.c b/users/xulkal/custom_oled.c new file mode 100644 index 00000000000..448e6ca107e --- /dev/null +++ b/users/xulkal/custom_oled.c @@ -0,0 +1,193 @@ +#include "custom_oled.h" +#include "process_records.h" + +#include + +#ifdef RGBLIGHT_ENABLE +rgblight_config_t rgblight_config; +#endif + +#if KEYBOARD_helix_rev2 +extern uint8_t is_master; +bool is_keyboard_master(void) { return is_master; } +#endif + +static void render_logo(void) +{ + static const char PROGMEM font_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_write_P(font_logo, false); +} + +static void render_icon(void) +{ +#ifdef OLED_90ROTATION + static const char PROGMEM font_icon[] = { + 0x9b,0x9c,0x9d,0x9e,0x9f, + 0xbb,0xbc,0xbd,0xbe,0xbf, + 0xdb,0xdc,0xdd,0xde,0xdf,0 + }; +#else + static const char PROGMEM font_icon[] = { + // Use \r (0x0d) to jump to the next line without clearing the rest of the current line + 0x9b,0x9c,0x9d,0x9e,0x9f,0x0d, + 0xbb,0xbc,0xbd,0xbe,0xbf,0x0d, + 0xdb,0xdc,0xdd,0xde,0xdf,0 + }; +#endif + oled_write_P(font_icon, false); +} + +static void render_layer(void) +{ + uint8_t layer = layer_state ? biton(layer_state) : biton32(default_layer_state); +#ifdef OLED_90ROTATION + oled_write_P(PSTR("Layer"), false); +#else + oled_write_P(PSTR("Layer: "), false); +#endif + + switch (layer) + { + case _QWERTY: + oled_write_P(PSTR("BASE "), false); + break; +#ifndef GAMELAYER_DISABLE + case _GAME: + oled_write_P(PSTR("GAME "), false); + break; +#endif + case _LOWER: + oled_write_P(PSTR("LOWER"), false); + break; + case _RAISE: + oled_write_P(PSTR("RAISE"), false); + break; +#ifdef TRILAYER_ENABLED + case _ADJUST: + oled_write_P(PSTR("ADJST"), false); + break; +#endif + } +} + +static void render_keyboard_leds(void) +{ + // Host Keyboard LED Status + uint8_t led_state = host_keyboard_leds(); +#ifdef OLED_90ROTATION + oled_write_P(IS_LED_ON(led_state, USB_LED_NUM_LOCK) ? PSTR("NUMLK") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLK") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLK") : PSTR(" "), false); +#else + oled_write_P(IS_LED_ON(led_state, USB_LED_NUM_LOCK) ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_state, USB_LED_CAPS_LOCK) ? PSTR("CAPS ") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRL") : PSTR(" "), false); +#endif +} + +#ifdef RGB_OLED_MENU +extern uint8_t rgb_encoder_state; +#endif + +#if defined(OLED_90ROTATION) + +#ifdef RGB_ENABLE +static void render_rgb_state(void) +{ + // TODO: need to do a bit more handling here for horizontal rendering +#if defined(RGB_MATRIX_ENABLE) + static char buffer[31] = {0}; + snprintf(buffer, sizeof(buffer), "h%3d s%3d v%3d s%3d m%3d e%3d ", rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, rgb_matrix_config.speed, rgb_matrix_config.mode, rgb_matrix_get_flags()); +#elif defined(RGBLIGHT_ENABLE) + static char buffer[26] = {0}; + snprintf(buffer, sizeof(buffer), "h%3d s%3d v%3d s%3d m%3d ", rgblight_config.hue, rgblight_config.sat, rgblight_config.val, rgblight_config.speed, rgblight_config.mode); +#endif + +#ifdef RGB_OLED_MENU + buffer[4 + rgb_encoder_state * 5] = '<'; +#endif + oled_write(buffer, false); +} +#endif + +static void render_status(void) +{ + render_icon(); + render_layer(); + + // Host Keyboard LED Status + oled_write_P(PSTR("-----"), false); + render_keyboard_leds(); + + oled_write_P(PSTR("-----"), false); +#ifdef RGB_ENABLE + render_rgb_state(); +#endif +} + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { +#if KEYBOARD_helix_rev2 + if (is_keyboard_master()) + return OLED_ROTATION_270; + return rotation; +#else + if (is_keyboard_master()) + return OLED_ROTATION_90; + return rotation; +#endif +} + +#else // OLED_90ROTATION + +#ifdef RGB_ENABLE +static void render_rgb_state(void) +{ + // TODO: need to do a bit more handling here for horizontal rendering +#if defined(RGB_MATRIX_ENABLE) + static char buffer[37] = {0}; + snprintf(buffer, sizeof(buffer), "h%3d s%3d v%3d s%3d m%3d e%3d ", rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, rgb_matrix_config.speed, rgb_matrix_config.mode, rgb_matrix_get_flags()); +#elif defined(RGBLIGHT_ENABLE) + static char buffer[32] = {0}; + snprintf(buffer, sizeof(buffer), "h%3d s%3d v%3d s%3d m%3d ", rgblight_config.hue, rgblight_config.sat, rgblight_config.val, rgblight_config.speed, rgblight_config.mode); +#endif + +#ifdef RGB_OLED_MENU + buffer[4 + rgb_encoder_state * 5] = '<'; +#endif + oled_write(buffer, false); +} +#endif + +static void render_status(void) +{ + render_icon(); + + // Host Layer Status + oled_set_cursor(6, 0); + render_layer(); + + // Host Keyboard LED Status + oled_set_cursor(6, 1); + render_keyboard_leds(); + +#ifdef RGB_ENABLE + oled_set_cursor(6, 2); + render_rgb_state(); +#endif +} + +#endif // OLED_90ROTATION + +void oled_task_user(void) +{ + if (is_keyboard_master()) + render_status(); + else + { + render_logo(); + oled_scroll_left(); + } +} diff --git a/users/xulkal/custom_oled.h b/users/xulkal/custom_oled.h new file mode 100644 index 00000000000..010d4b1383a --- /dev/null +++ b/users/xulkal/custom_oled.h @@ -0,0 +1,2 @@ +#pragma once +#include "quantum.h" diff --git a/users/xulkal/custom_rgb.c b/users/xulkal/custom_rgb.c new file mode 100644 index 00000000000..11bfad1d7a3 --- /dev/null +++ b/users/xulkal/custom_rgb.c @@ -0,0 +1,64 @@ +#include "custom_rgb.h" + +#ifdef RGB_MATRIX_ENABLE +void rgb_matrix_increase_flags(void) +{ + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } +} + +void rgb_matrix_decrease_flags(void) +{ + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_enable_noeeprom(); + } + break; + } +} +#endif + +void rgb_reset(void) { +#if defined(RGB_MATRIX_ENABLE) + eeconfig_update_rgb_matrix_default(); +#elif defined(RGBLIGHT_ENABLE) + eeconfig_update_rgblight_default(); + rgblight_enable(); +#endif +} diff --git a/users/xulkal/custom_rgb.h b/users/xulkal/custom_rgb.h new file mode 100644 index 00000000000..f19dd223c22 --- /dev/null +++ b/users/xulkal/custom_rgb.h @@ -0,0 +1,14 @@ +#pragma once + +#if defined(RGB_MATRIX_ENABLE) +#include "rgb_matrix.h" +#elif defined(RGBLIGHT_ENABLE) +#include "rgblight.h" +#endif + +#ifdef RGB_MATRIX_ENABLE +void rgb_matrix_increase_flags(void); +void rgb_matrix_decrease_flags(void); +#endif + +void rgb_reset(void); diff --git a/users/xulkal/custom_tap_dance.c b/users/xulkal/custom_tap_dance.c new file mode 100644 index 00000000000..e0f90ea110d --- /dev/null +++ b/users/xulkal/custom_tap_dance.c @@ -0,0 +1,60 @@ +#include "custom_tap_dance.h" +#include "custom_keycodes.h" +#include "timer_utils.h" + +#ifdef TAP_DANCE_ENABLE + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [COMM_QUOT] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_QUOT), + [BACKSPACE] = ACTION_TAP_DANCE_DOUBLE (KC_BSPACE, LCTL(KC_BSPACE)), + [DELETE] = ACTION_TAP_DANCE_DOUBLE (KC_DELETE, LCTL(KC_DELETE)) +}; + +#else + +static uint16_t td_keycode; +static uint16_t td_timer; + +const uint16_t PROGMEM td_keymaps[TD_MAX - TD_MIN][2] = { + [TD_COMM - TD_MIN] = { KC_COMM, KC_QUOT }, + [TD_BSPC - TD_MIN] = { KC_BSPACE, LCTL(KC_BSPACE) }, + [TD_DEL - TD_MIN] = { KC_DELETE, LCTL(KC_DELETE) } +}; + +static void run_custom_tap_dance(uint8_t i) +{ + tap_code16(pgm_read_word(&td_keymaps[td_keycode - TD_MIN][i])); + td_keycode = KC_TRANSPARENT; + td_timer = timer_read() + TAPPING_TERM; +} + +bool process_custom_tap_dance(uint16_t keycode, keyrecord_t *record) +{ + if (TD_MIN <= keycode && keycode < TD_MAX) + { + if (record->event.pressed) + { + if (td_keycode != keycode || timer_expired(td_timer)) + { + td_keycode = keycode; + td_timer = timer_read() + TAPPING_TERM; + } + else + run_custom_tap_dance(1); + } + return false; + } + + if (td_keycode != KC_TRANSPARENT) + run_custom_tap_dance(0); + return true; +} + +void matrix_scan_user(void) +{ + if (td_keycode != KC_TRANSPARENT && timer_expired(td_timer)) + run_custom_tap_dance(0); +} + +#endif diff --git a/users/xulkal/custom_tap_dance.h b/users/xulkal/custom_tap_dance.h new file mode 100644 index 00000000000..c4da9318c27 --- /dev/null +++ b/users/xulkal/custom_tap_dance.h @@ -0,0 +1,23 @@ +#pragma once +#include "quantum.h" + +#ifdef TAP_DANCE_ENABLE + +#include "process_tap_dance.h" + +//Tap Dance Declarations +enum { + COMM_QUOT = 0, + BACKSPACE, + DELETE +}; + +#define TD_COMM TD(COMM_QUOT) +#define TD_BSPC TD(BACKSPACE) +#define TD_DEL TD(DELETE) + +#else + +bool process_custom_tap_dance(uint16_t keycode, keyrecord_t *record); + +#endif diff --git a/users/xulkal/layouts.h b/users/xulkal/layouts.h new file mode 100644 index 00000000000..89bdfb60d35 --- /dev/null +++ b/users/xulkal/layouts.h @@ -0,0 +1,119 @@ +#pragma once + + /* Qwerty Layout + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BkSp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |FN(CAPS)| A | S | D | F | G | | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Sft[ | Z | X | C | V | B | | N | M | , | . | / | Sft] | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | Win | ADJ | FN | Alt | Space| | Space| Left | Up | Down | Right| Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + +#define _________________QWERTY_L1_________________ KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5 +#define _________________QWERTY_L2_________________ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L3_________________ RIS_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L4_________________ KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B +#define _________________QWERTY_L5_________________ KC_LCPO, KC_LGUI, LOWER, RAISE, KC_LALT, KC_SPC + +#define _________________QWERTY_R1_________________ KC_6, KC_7, KC_8, KC_9, KC_0, TD_BSPC +#define _________________QWERTY_R2_________________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS +#define _________________QWERTY_R3_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT +#define _________________QWERTY_R4_________________ KC_N, KC_M, TD_COMM, KC_DOT, KC_SLASH, KC_RSPC +#define _________________QWERTY_R5_________________ KC_SPC, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_RCPC + + +#define ___________________GAME_L1_________________ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5 +#define ___________________GAME_L2_________________ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T +#define ___________________GAME_L3_________________ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G +#define ___________________GAME_L4_________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B +#define ___________________GAME_L5_________________ KC_LCTL, KC_LGUI, LOWER, RAISE, KC_LALT, KC_SPC + +#define ___________________GAME_R1_________________ KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC +#define ___________________GAME_R2_________________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS +#define ___________________GAME_R3_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT +#define ___________________GAME_R4_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH, KC_RSFT +#define ___________________GAME_R5_________________ KC_SPC, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_RCTL + + + /* RAISE Layout + * ,-----------------------------------------. ,-----------------------------------------. + * | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | PGDN | UP | PGUP | |QWERTY| | | INS | HOME | PGUP | PRINT| | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | GAME | | | DEL | END | PGDN |SCRLCK| | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | PREV | VOL+ | VOL- | NEXT | PLAY | + * `-----------------------------------------' `-----------------------------------------' + */ + +#define __________________RAISE_L1_________________ KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define __________________RAISE_L2_________________ _______, KC_PGDN, KC_UP, KC_PGUP, _______, QWERTY +#define __________________RAISE_L3_________________ _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, GAME +#define __________________RAISE_L4_________________ _______, _______, _______, _______, _______, _______ +#define __________________RAISE_L5_________________ _______, _______, _______, _______, _______, _______ + +#define __________________RAISE_R1_________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 +#define __________________RAISE_R2_________________ _______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, _______ +#define __________________RAISE_R3_________________ _______, KC_DEL, KC_END, KC_PGDN, KC_SLCK, _______ +#define __________________RAISE_R4_________________ _______, _______, _______, _______, _______, _______ +#define __________________RAISE_R5_________________ _______, KC_MPRV, KC_VOLU, KC_VOLD, KC_MNXT, KC_MPLY + + /* LOWER Layout + * ,-----------------------------------------. ,-----------------------------------------. + * | |RGBMD |RGBRMD|RGBTOG| | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | SPDI | SAI | VAI | HUI | RESET| | | | | 7 | 8 | 9 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | SPDD | SAD | VAD | HUD |RGBRST| | | | | 4 | 5 | 6 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | 1 | 2 | 3 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | 0 | . | | + * `-----------------------------------------' `-----------------------------------------' + */ + +#define __________________LOWER_L1_________________ _______, RGB_RMOD, RGB_MOD, RGB_TOG, _______, _______ +#define __________________LOWER_L2_________________ RGB_SPI, RGB_SAI, RGB_VAI, RGB_HUI, RESET, _______ +#define __________________LOWER_L3_________________ RGB_SPD, RGB_SAD, RGB_VAD, RGB_HUD, RGBRST, _______ +#define __________________LOWER_L4_________________ _______, _______, _______, _______, _______, _______ +#define __________________LOWER_L5_________________ _______, _______, _______, _______, _______, _______ + +#define __________________LOWER_R1_________________ _______, _______, _______, KC_SLCK, KC_NLCK, KC_DEL +#define __________________LOWER_R2_________________ _______, _______, KC_KP_7, KC_KP_8, KC_KP_9, _______ +#define __________________LOWER_R3_________________ _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, _______ +#define __________________LOWER_R4_________________ _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, _______ +#define __________________LOWER_R5_________________ _______, _______, _______, KC_KP_0, KC_PDOT, _______ + + /* ADJUST Layout + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | RESET| DEBUG| | | | | |TERM_ON|TERM_OFF| | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | |MusMod|Aud on|AudOff|AGnorm| |AGswap|ClkUp |ClkDwn| | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn| |MidOff|ClkOn |ClkOff| | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ + +#define _________________ADJUST_L1_________________ _______, _______, _______, _______, _______, _______ +#define _________________ADJUST_L2_________________ _______, RESET, DEBUG, _______, _______, _______ +#define _________________ADJUST_L3_________________ _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L4_________________ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON +#define _________________ADJUST_L5_________________ _______, _______, _______, _______, _______, _______ + +#define _________________ADJUST_R1_________________ _______, _______, _______, _______, _______, _______ +#define _________________ADJUST_R2_________________ _______, TERM_ON, TERM_OFF, _______, _______, _______ +#define _________________ADJUST_R3_________________ AG_SWAP, CK_UP, CK_DOWN, _______, _______, _______ +#define _________________ADJUST_R4_________________ MI_OFF, CK_ON, CK_OFF, _______, _______, _______ +#define _________________ADJUST_R5_________________ _______, _______, _______, _______, _______, _______ diff --git a/users/xulkal/process_records.c b/users/xulkal/process_records.c new file mode 100644 index 00000000000..245d4955fbe --- /dev/null +++ b/users/xulkal/process_records.c @@ -0,0 +1,63 @@ +#include "process_records.h" +#include "custom_keycodes.h" +#include "timer_utils.h" + +#ifdef RGB_ENABLE +#include "custom_rgb.h" +#endif + +#ifdef TRILAYER_ENABLED +uint32_t layer_state_set_user(uint32_t state) +{ + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + static uint16_t reset_timer; + +#ifndef TAP_DANCE_ENABLE + if (!process_custom_tap_dance(keycode, record)) + return false; +#endif + + switch (keycode) + { + case RGBRST: +#ifdef RGB_ENABLE + if (record->event.pressed) + rgb_reset(); +#endif + return false; + case RESET: + { + if (record->event.pressed) + reset_timer = timer_read() + 500; + else if (timer_expired(reset_timer)) + reset_keyboard(); + } + return false; +#ifdef RGB_MATRIX_TOG_LAYERS + case RGB_TOG: + if (record->event.pressed) { + rgb_matrix_decrease_flags(); + } + return false; +#endif + } + + return process_record_encoder(keycode, record) && process_record_keymap(keycode, record); +} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) +{ + return true; +} + +__attribute__ ((weak)) +bool process_record_encoder(uint16_t keycode, keyrecord_t *record) +{ + return true; +} diff --git a/users/xulkal/process_records.h b/users/xulkal/process_records.h new file mode 100644 index 00000000000..c219394f8e4 --- /dev/null +++ b/users/xulkal/process_records.h @@ -0,0 +1,18 @@ +#pragma once +#include "quantum.h" +#include "custom_tap_dance.h" + +enum layer_number { + _QWERTY = 0, +#ifndef GAMELAYER_DISABLE + _GAME, +#endif + _LOWER, + _RAISE, +#ifdef TRILAYER_ENABLED + _ADJUST +#endif +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +bool process_record_encoder(uint16_t keycode, keyrecord_t *record); diff --git a/users/xulkal/rules.mk b/users/xulkal/rules.mk new file mode 100644 index 00000000000..c3834ff5f0b --- /dev/null +++ b/users/xulkal/rules.mk @@ -0,0 +1,33 @@ +SRC += xulkal.c \ + process_records.c \ + custom_tap_dance.c \ + timer_utils.c + +# Some usual defaults +MOUSEKEY_ENABLE = no # Mouse keys (+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control (+450) +TAP_DANCE_ENABLE = yes + +ifneq ($(strip $(DISABLE_LTO)), yes) + EXTRAFLAGS += -flto + OPT_DEFS += -DNO_ACTION_MACRO + OPT_DEFS += -DNO_ACTION_FUNCTION +endif + +ifeq ($(strip $(ENCODER_ENABLE)), yes) + SRC += custom_encoder.c +endif + +ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) + OPT_DEFS += -DRGB_ENABLE + SRC += custom_rgb.c +endif + +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + OPT_DEFS += -DRGB_ENABLE + SRC += custom_rgb.c +endif + +ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) + SRC += custom_oled.c +endif diff --git a/users/xulkal/timer_utils.c b/users/xulkal/timer_utils.c new file mode 100644 index 00000000000..5f5d9a1ebfd --- /dev/null +++ b/users/xulkal/timer_utils.c @@ -0,0 +1,12 @@ +#include "timer_utils.h" + +bool timer_expired(uint16_t last) +{ + return timer_read() - last < 0x8000; +} + +bool timer_expired32(uint32_t last) +{ + return timer_read32() - last < 0x80000000; +} + diff --git a/users/xulkal/timer_utils.h b/users/xulkal/timer_utils.h new file mode 100644 index 00000000000..7e2a0b74db9 --- /dev/null +++ b/users/xulkal/timer_utils.h @@ -0,0 +1,6 @@ +#pragma once +#include "timer.h" +#include + +bool timer_expired(uint16_t last); +bool timer_expired32(uint32_t last); diff --git a/users/xulkal/xulkal.c b/users/xulkal/xulkal.c new file mode 100644 index 00000000000..ea9b6bdbbe2 --- /dev/null +++ b/users/xulkal/xulkal.c @@ -0,0 +1 @@ +#include "xulkal.h" diff --git a/users/xulkal/xulkal.h b/users/xulkal/xulkal.h new file mode 100644 index 00000000000..9bc83b7de75 --- /dev/null +++ b/users/xulkal/xulkal.h @@ -0,0 +1,7 @@ +#pragma once + +#include "process_records.h" +#include "layouts.h" +#include "timer_utils.h" +#include "custom_keycodes.h" +#include "custom_tap_dance.h" diff --git a/users/zer09/config.h b/users/zer09/config.h index 4cb65c258f9..c5ab32f8d43 100644 --- a/users/zer09/config.h +++ b/users/zer09/config.h @@ -16,13 +16,13 @@ #define FORCE_NKRO #ifndef TAPPING_TOGGLE -#define TAPPING_TOGGLE 1 +#define TAPPING_TOGGLE 1 #endif #ifdef TAPPING_TERM #undef TAPPING_TERM #endif -#define TAPPING_TERM 120 +#define TAPPING_TERM 95 // Disable action_get_macro and fn_actions, since we don't use these // and it saves on space in the firmware. diff --git a/users/zer09/tap_dance.c b/users/zer09/tap_dance.c index a23705ad8b5..e99b26cca07 100644 --- a/users/zer09/tap_dance.c +++ b/users/zer09/tap_dance.c @@ -17,15 +17,27 @@ qk_tap_dance_action_t tap_dance_actions[] = { }; volatile uint8_t active_layer = _BL; +volatile uint8_t gm_layer_act = false; static tap upltap_state = {.state = 0}; static tap dwltap_state = {.state = 0}; static tap lsprtap_state = {.state = 0}; static tap ralttap_state = {.state = 0}; void layer_switcher_tap(uint8_t new_layer) { - layer_off(active_layer); - layer_on(new_layer); - active_layer = new_layer; + if (gm_layer_act == true) { + layer_off(active_layer); + if (new_layer == _BL) { + layer_on(_GM); + active_layer = _GM; + } else { + layer_on(new_layer); + active_layer = new_layer; + } + } else { + layer_off(active_layer); + layer_on(new_layer); + active_layer = new_layer; + } } int cur_dance(qk_tap_dance_state_t *state) { @@ -162,6 +174,14 @@ void dance_dwly_finished(qk_tap_dance_state_t *state, void *user_data) { case DOUBLE_HOLD: layer_switcher_tap(_AL); break; + case TRIPLE_TAP: + if (gm_layer_act == true) { + gm_layer_act = false; + layer_switcher_tap(_BL); + } else { + gm_layer_act = true; + layer_switcher_tap(_GM); + } default: layer_switcher_tap(_BL); break; @@ -174,6 +194,7 @@ void dance_dwly_reset(qk_tap_dance_state_t *state, void *user_data) { break; case SINGLE_HOLD: case DOUBLE_HOLD: + case TRIPLE_TAP: default: layer_switcher_tap(_BL); break; diff --git a/users/zer09/zer09.h b/users/zer09/zer09.h index 75c1d3cad49..cc91cd6f287 100644 --- a/users/zer09/zer09.h +++ b/users/zer09/zer09.h @@ -3,16 +3,23 @@ #include "quantum.h" -enum custom_keycodes { CK_SAFE = SAFE_RANGE, RGUP, RGDWN, NEWPLACEHOLDER }; +enum custom_keycodes { + CK_SAFE = SAFE_RANGE, + RGUP, + RGDWN, + YREG, + NEW_SAFE_RANGE +}; -#define _______ KC_TRNS #define KC_RGUP RGUP #define KC_RGDWN RGDWN +#define KC_YREG YREG #define _BL 0 // The base layer #define _UL 1 // The up layer #define _DL 2 // The down layer #define _VL 3 // The shifted up layer #define _AL 4 // The assorted layer +#define _GM 5 #endif diff --git a/util/activate_msys2.sh b/util/activate_msys2.sh old mode 100644 new mode 100755 diff --git a/util/activate_wsl.sh b/util/activate_wsl.sh old mode 100644 new mode 100755 diff --git a/util/atmega32a_program.py b/util/atmega32a_program.py index b777b911066..9438c7e779b 100755 --- a/util/atmega32a_program.py +++ b/util/atmega32a_program.py @@ -19,18 +19,19 @@ from __future__ import print_function import os import sys import time +import argparse import usb -def checkForKeyboardInNormalMode(): +def check_keyboard_normal_mode(vendor, product): """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" - return usb.core.find(idVendor=0x20A0, idProduct=0x422D) + return usb.core.find(idVendor=vendor, idProduct=product) -def checkForKeyboardInBootloaderMode(): +def check_keyboard_bootloader_mode(): """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) -def flashKeyboard(firmware_file): +def flash_keyboard(firmware_file): """Calls bootloadHID to flash the given file to the device.""" print('Flashing firmware to device ...') if os.system('bootloadHID -r "%s"' % firmware_file) == 0: @@ -38,7 +39,7 @@ def flashKeyboard(firmware_file): else: print('\nbootloadHID returned an error.') -def printDeviceInfo(dev): +def print_device_info(dev): """Prints all infos for a given USB device""" print('Device Information:') print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) @@ -47,15 +48,15 @@ def printDeviceInfo(dev): print('Serial: %s' % (dev.iSerialNumber)) print('Product: %s' % (dev.iProduct), end='\n\n') -def sendDeviceToBootloaderMode(dev): +def send_device_to_bootloader_mode(dev): """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" try: dev.set_configuration() request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) + usb.util.CTRL_OUT, + usb.util.CTRL_TYPE_CLASS, + usb.util.CTRL_RECIPIENT_DEVICE) USBRQ_HID_SET_REPORT = 0x09 HID_REPORT_OPTION = 0x0301 @@ -65,16 +66,21 @@ def sendDeviceToBootloaderMode(dev): # for some reason I keep getting USBError, but it works! pass +def auto_int(value): + """Helper for argparse to enable auto base detection""" + return int(value, 0) -if len(sys.argv) < 2: - print('Usage: %s ' % sys.argv[0]) - sys.exit(1) +parser = argparse.ArgumentParser(description='Flash bootloadHID device') +parser.add_argument('--vendor', type=auto_int, default=0x20A0, help='Non bootloader idVendor to search for (default: 0x%(default)04x)') +parser.add_argument('--product', type=auto_int, default=0x422D, help='Non bootloader idProduct to search for (default: 0x%(default)04x)') +parser.add_argument('firmware_hex', type=argparse.FileType('r'), help='Firmware hex file to flash') +args = parser.parse_args() -kb = checkForKeyboardInNormalMode() +kb = check_keyboard_normal_mode(args.vendor, args.product) if kb is not None: print('Found a keyboard in normal mode. Attempting to send it to bootloader mode ...', end='') - sendDeviceToBootloaderMode(kb) + send_device_to_bootloader_mode(kb) print(' done.') print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") @@ -84,9 +90,9 @@ found = False for attempt in range(1, attempts + 1): print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') - if checkForKeyboardInBootloaderMode(): + if check_keyboard_bootloader_mode(): print('Found', end='\n\n') - flashKeyboard(sys.argv[1]) + flash_keyboard(args.firmware_hex.name) found = True break else: @@ -102,4 +108,3 @@ for attempt in range(1, attempts + 1): if not found: print("Couldn't find a flashable keyboard. Aborting.") sys.exit(2) - diff --git a/util/bootloader_atmega32a_1_0_0.hex b/util/bootloader_atmega32a_1_0_0.hex new file mode 100644 index 00000000000..b35a310d55a --- /dev/null +++ b/util/bootloader_atmega32a_1_0_0.hex @@ -0,0 +1,154 @@ +:107000000C9468380C94A0380C9485380C9485380E +:107010000C9485380C9485380C9485380C948538FC +:107020000C9485380C9485380C9485380C948538EC +:107030000C9485380C9485380C9485380C948538DC +:107040000C9485380C9485380C9485380C948538CC +:107050000C9485380403090412036F006200640075 +:10706000650076002E00610074001003480049009E +:10707000440042006F006F00740012011001000014 +:107080000008C016DF05000101020001090222000C +:107090000101008032090400000103000000092101 +:1070A00001010001222100070581030800C8060034 +:1070B000FF0901A101150026FF007508850195064D +:1070C0000900B20201850295830900B20201C000E5 +:1070D00011241FBECFE5D8E0DEBFCDBF10E0A0E693 +:1070E000B0E0ECE6F9E702C005900D92AA36B107D0 +:1070F000D9F710E0AAE6B0E001C01D92A43AB107AA +:10710000E1F70E94173C0C94B43C0C940038A82F73 +:10711000B92F80E090E041E050EA609530E009C08E +:107120002D9182279795879510F084279527305EBB +:10713000C8F36F5FA8F30895EADF8D939D930895D8 +:10714000CF93CFB7CF93C395839BE9F7839B09C0B8 +:10715000839B07C0839B05C0839B03C0839B01C0A7 +:10716000A3C0DF93C0918700DD27C257DF4F839B09 +:1071700002C0DF91EBCF2F930F931F9300B32FEF3C +:1071800003FB20F94F933F9310B34FEF012703FB0D +:1071900021F93BE031C04E7F012F10B3216028C0A0 +:1071A000102F4D7F2260000000B329C04B7F246068 +:1071B000012F000010B32BC010B3477F28602AC0F6 +:1071C0004F7E00B320612CC04F7D10B320622FC0D2 +:1071D0004F7B00B3206432C0422700B349934FEF86 +:1071E0000000102713FB20F910B31C70C9F1297F90 +:1071F00091F2012703FB21F900B3237F89F231507B +:1072000058F1102713FB22F910B3277E79F20127DA +:1072100003FB23F92F7C81F200B3102713FB24F921 +:107220002F7971F200C010B3012703FB25F92F73EA +:1072300059F200C000B3102713FB26F9223040F2A8 +:1072400000C010B3012703FB27F9243028F64F773D +:10725000206810B30000F9CF10E41ABF002719C04E +:107260003B503195C31BD04010E41ABF0881033C4A +:10727000F9F00B34E9F0209185001981110F1213F8 +:10728000EDCF4A81441F093641F10D3211F0013E24 +:1072900029F700938C003F914F911F910F912F91EF +:1072A000DF91CAB7C6FD4FCFCF91CFBFCF91189511 +:1072B00020918C00222379F310918A00112321F56B +:1072C000343022F130938A00209386001091870099 +:1072D0003BE0311B3093870019C000918A000130D8 +:1072E0009CF40AE54F7081F43091600034FD10C0C9 +:1072F00000936000C9E7D0E00FC02795A8F4515073 +:10730000A9F4220F0000F9CF4AE503C042ED01C005 +:10731000432FC4E1D0E032E011B31C60939A11BB5B +:1073200002B320E41CE05F93012756E002BB2795DF +:1073300020F4515021F4220FF9CF012756E000002C +:107340003B5A02BBD0F2279528F4515029F4220F62 +:107350000000F9CF012756E0279502BB20F45150D9 +:1073600021F4220FF9CF012756E02991332302BBE4 +:1073700021F6037F10918B00110FC651D04002BB44 +:1073800011F01093850010E41ABF086011B3137F49 +:10739000402F437F5F9100C000C002BB11BB42BBC6 +:1073A0007ACF80916D00882309F445C088EB9BE07B +:1073B0000197F1F780916A008F5F80936A00909146 +:1073C00061008917B1F510926A0080916B008230DC +:1073D000C1F0833028F4882341F0813041F50CC09E +:1073E0008330B9F0843019F519C082B38C7A82BB2E +:1073F00081E080936B0017C082B3836582BB82E01B +:1074000004C082B38C7A82BB83E080936B008FE7E9 +:107410000BC082B3836582BB84E0F7CF82B38C7AE2 +:1074200082BB10926B008FEF8093610002C01092BC +:107430006B0081E0089529B3237040916E000DC068 +:1074400089B330E090E0837090702817390711F00D +:1074500040E001C04F5F29B32370463088F320938A +:10746000720040936E00233018F481E080936D0029 +:1074700080916D00089585B7826085BF8BB7806469 +:107480008BBF0895F89481E180935700E8951BBE67 +:1074900015BE81E08BBF1BBE8B9AE0917700F09107 +:1074A0007800099521E020936C00FC0181818930EE +:1074B00069F48281823029F420937500209384003E +:1074C00003C082E0809384008FEF0895813011F033 +:1074D00080E0089582E690E0909389008093880090 +:1074E00087E00895CF93DF93DC01C0917000D091C5 +:1074F0007100413051F410926F001196CC911197A8 +:107500001296DC9112971496645030916F00360FEA +:1075100030936F00AE014F7751F4F89483E0FE0191 +:1075200080935700E895789407B600FCFDCFF89457 +:10753000AE018D919C91119721E0FE010C012093E9 +:107540005700E895112478942296FE01EF7751F4C4 +:10755000F89485E0FA0180935700E895789407B68F +:1075600000FCFDCF625011F01296D4CFD093710081 +:10757000C0937000832F8078DF91CF910895CF93CF +:10758000DF93FC0180918400813071F4809175005B +:10759000813029F410927500CF0141E002C0CF0183 +:1075A00040E00E94723A2FC0823061F581818130C3 +:1075B00011F40E94423A8F3F21F484E090E06FEF93 +:1075C00019C08E3F91F482B3836582BBC0E0D0E0E6 +:1075D000CE016FEF0E94A73C219684E0C030D8070F +:1075E000B9F782B38C7A82BB0BC08D3F31F48281B4 +:1075F000938164810E94A73C03C081E08093760060 +:107600001092840081E0DF91CF9108951F93CF9372 +:10761000DF9360918A00635067FDBAC08091870054 +:10762000CCE0D0E0C81BD109C257DF4F8091860063 +:107630008D3209F09AC0683009F0A8C083EC8093BD +:1076400079008AE5809360001092740088818076CA +:1076500041F0CE010E94523A282F8F3F09F474C0A6 +:107660007AC09A81109282008981882321F4109235 +:10767000830022E062C0853019F490938B005CC0D7 +:10768000863009F04AC08B81813019F48AE790E78F +:107690001BC0823041F48CE890E79093890080937E +:1076A000880022E236C08330F9F48A81882341F4CD +:1076B00084E590E7909389008093880024E029C0B6 +:1076C000813041F488E590E79093890080938800A9 +:1076D00022E11FC08230E1F48AE690E790938900AE +:1076E0008093880020E115C0813241F48EE990E753 +:1076F000909389008093880029E00BC0823241F486 +:107700008EEA90E7909389008093880021E201C07F +:1077100020E080E4809374001EC0883021F421E0D2 +:107720008DE890E00CC0893019F490938D0004C06E +:107730008A3011F421E001C020E082E890E09093CB +:1077400089008093880007C0888187FD2E8180E8AA +:107750008093740006C08F81882319F48E8182176C +:1077600008F0822F8093690011C08091740087FF18 +:107770000DC0CE010E94BF3A8F3F21F48EE180936D +:10778000600004C0882311F01092690010928A00F2 +:107790008091600084FF3DC0809169008F3FC9F1F6 +:1077A000182F893008F018E0811B809369008091C0 +:1077B000790098E88927809379001123E1F0E0911E +:1077C0008800F09189008091740086FF09C0912F94 +:1077D000AAE7B0E084918D9331969150D9F707C014 +:1077E000912FAAE7B0E081918D939150E1F7F0934A +:1077F0008900E09388008AE790E0612F0E949C381E +:10780000612F6C5F6C3019F08FEF8093690060938B +:10781000600094E180B38C7031F49150D9F71092EC +:107820008B0010928500DF91CF911F91089581B355 +:10783000836581BB82B38C7A82BB8D98959A8AB31B +:107840008C7F8ABB8BB383608BBBB89AC09881E076 +:1078500090E00E948E3C80937300882349F481E07D +:1078600080936D0081E090E06FEF0E94A73C08C01C +:10787000E0E0F0E0E491EF3F19F481E080936D00E7 +:107880000E94D139882309F447C081E08BBF82E090 +:107890008BBF0E943B3A88E991E00E948E3C88238E +:1078A00049F48B9A20E0A89588EB9BE00197F1F7CB +:1078B0002150C9F78B9878940FEF10E0C0E0D0E02A +:1078C00080916C008823B9F483E0C93ED80714F492 +:1078D000219611C0F89481E090E060E00E94963C0F +:1078E0008B9A28E088E190E00FB6F894A89581BDC6 +:1078F0000FBE21BDFFCFA8950E94063B8091760068 +:10790000882331F0002319F4115011F405C00150FF +:107910000E94D1398823A1F60E94423AE199FECF14 +:107920009FBB8EBBE09A99278DB30895262FE199CE +:10793000FECF9FBB8EBBE09A01970DB2021631F0CD +:107940002DBB0FB6F894E29AE19A0FBE0895262F48 +:10795000E199FECF9FBB8EBB2DBB0FB6F894E29A88 +:0C796000E19A0FBE01960895F894FFCF45 +:0A796C005A7F01800000800000FF38 +:040000030000700089 +:00000001FF diff --git a/util/bootloader_atmega32u4_1_0_0.hex b/util/bootloader_atmega32u4_1_0_0.hex old mode 100755 new mode 100644 index 275aeacba31..20174989ae2 --- a/util/bootloader_atmega32u4_1_0_0.hex +++ b/util/bootloader_atmega32u4_1_0_0.hex @@ -1,253 +1,253 @@ -:020000020000FC -:047000000C948D3E21 -:047028000C94B73DD0 -:10702F0012010002FF010020EB03F42F0000010208 -:10703F00030109021200010100803209040000005F -:10704F00000000000C03410054004D0045004C00AF -:10705F001603410054006D00330032005500340018 -:10706F004400460055000C0331002E0030002E0066 -:10707F0030000403090416010C0100000C0000018C -:02708F006C7F14 -:1070920012BD01BDF89A00B5089501E00895F9996D -:1070A200FECF12BD01BD20BDFA9AF99AF6CFF99929 -:1070B200FECF0C944938F80104910895F8013491F7 -:1070C20031962491890108950091610000930C0189 -:1070D20000E80093610001E00093610005BF02E057 -:1070E20005BF0C9486380091D70001600093D70049 -:1070F200A89507EF04BF0091600000610093600053 -:1071020000E00093600001E008950E94AA3D0E9401 -:10711200B53DFDCF0CD00F7708D0006806D00061D6 -:1071220004D0016028D0789408950093D80000918B -:10713200D8000895FCDF00621ED04CD009B500FFD4 -:10714200FDCFF5DF0F7D17D00091E0000E7F009399 -:10715200E0000091E000077F0093E0000091E20070 -:1071620001600093E2000091E20008600093E200F7 -:1071720078940C94743B0093D800089500910D010B -:10718200002359F40091D90000FF07C0D0DF006846 -:10719200F2DF01E000930D01CDDFE0E2F2E00081D9 -:1071A200018100FF0DC0008111811E7F11830083C8 -:1071B20001E00093EA0000E00093EA0000931E025F -:1071C20000E00093E9000091E80003FF02C00E9482 -:1071D200F23B0895A89539D000E40093600000E0E6 -:1071E200009381000093800010E0009385000093DB -:1071F200840001E006BB00918100036000938100DE -:107202000091600007FFFCCF00E80093600010933C -:107212008100A89507EF04BF18D010936000209159 -:1072220084003091850010938100109380001093A8 -:1072320085001093840001E006BB2D3D354010F01F -:1072420002E101C002E009BD089500916000006101 -:107252000093600008950E94AD3E239741D100E063 -:1072620000930901B5D104811581012B51F437D165 -:1072720000910701002309F4B9C000E0009307015F -:10728200B5C058D102FFFDCF37D1068335D1009367 -:107292000F0132D1009310012FD1009311012CD193 -:1072A2000093120129D10093130102852091130149 -:1072B20030911201409111015091100116811A95DD -:1072C20041F01250A9F01A9599F11A9509F473C078 -:1072D2008BC010910F01113011F411E001C010E0C8 -:1072E200138799D00C3F11F414D17FC077D17DC0A0 -:1072F20092D010910F01112329F01A9549F01A9595 -:10730200A9F073C010E013870C3F09F06EC0ECCFF8 -:1073120056D103C04CD109F468C00D911C9144D1DF -:107322000F3FC1F305E0009309015FC011E0EBCF0D -:10733200D2D029F00250E1F10A9541F056C0FDD0B9 -:107342000E94A33F0FEF00930A014FC0552319F08B -:107352005A9579F04AC04ED00DEF04BF74D0EAD0EE -:1073620003FFFDCF67D051D04AD008E00093600000 -:10737200FFCF40D068D0DED003FFFDCF5BD03FD03F -:1073820044D00FEF1FE004C009811A810150104060 -:1073920009831A8309811A81012BB1F700E800934E -:1073A200610000910C01009361000C940000FFCF7A -:1073B20001E003871AC08FD019F00A9539F015C081 -:1073C200535098F4BAD002E000870FC0505339F0FE -:1073D2005A9541F05F52B1F35A95A1F306C002E00B -:1073E2000883F0CF01E0FCCFA8D079D02396E4E067 -:1073F2000C94BA3E01E005BF00E005BF089500917C -:10740200D8000F770093D800089509B50D7F09BD04 -:1074120000E009BD08955183408333832283109194 -:10742200E8001B7F1093E8001091E8001F7710938B -:10743200E80008955DD053D0F8940091E000016017 -:107442000093E000089579D04AC0219749D0009175 -:107452000601035019F00250B9F00BC03CD021F0E4 -:107462000A9559F00A9529F400910A010C3F19F482 -:1074720050D02196089567D0FCCF0091010100936E -:10748200F100009100010AC01091100124D019F0FE -:107492000A9549F0EECF135018F400E00093F10082 -:1074A2001ED044D0E6CF105339F01A9539F01F524E -:1074B20041F01A9541F0F4CF08E5F0CF00E006D094 -:1074C200EDCF02E0FCCF04E001D0E8CF10E020E0F5 -:1074D20030E00C94113F00910F010023089521C068 -:1074E2000BD008D007D00093040106D00093050109 -:1074F20021D00BC000D008830091F10008950091C3 -:10750200EB0000620093EB0015D0077F0093E800C8 -:107512000895F5DF02E00093080103E000930901FA -:10752200089559D007D000FFFDCF089503D002FF80 -:10753200FDCF03C00091E8000895FCDF0B7FE6DF7A -:10754200F9DF0F77E3CF0E94AC3E42D038D006C0BD -:107552002BD00093F1002BD059F43DD0082F092BEA -:10756200A9F0E8DF02FD12C0E5DF00FFFDCF4424F1 -:10757200042D4394003289F300910B0100230D91F5 -:107582001C9131F311970E945838E3CFD3DF00FFEB -:10759200FDCF21D0CFDF00FFFDCFCCDF02FFFDCF3B -:1075A200CCDFE5E00C94B93E11970C945C380D9158 -:1075B2001C910F5F1F4F1C930E93019708958281B8 -:1075C200938100811181801B910B0196DF01089547 -:1075D200E0E0F1E00895AEDF0E7F98CF0E94A93E71 -:1075E200F7DF80819181A081B181AF710481158122 -:1075F20000521040048315830AC000910B0100233E -:1076020031F4A301920103E911E00E943B3F47D00C -:10761200B8F1662477242C0111C06EDFF301ED5618 -:10762200FE4F008301E0600E00E0701E01960091A3 -:10763200F200002311F033D0B8F47FDF30D0E8F24B -:10764200F301B096E238F040C0F674DF02FFFDCFDE -:107652000091F200BDDF24813581201B304024835C -:107662003583E5CF49DFAA95AA23E1F700910B0103 -:10767200013099F62091F1008C010E945038D6CF4A -:1076820004811581012B21F055DF02FFFDCF55DF6B -:10769200A2DF50DF00FFFDCFE8E00C94B63EE0E051 -:1076A200F1E0028113810817190708952091EB0078 -:1076B20021602093EB000093EC000091ED0002703A -:1076C200012B0093ED000091ED0002600093ED00AC -:1076D2001091EE00012F000F00E0001F0895412FCE -:1076E2000093E900089500E009D000FD05C000E024 -:1076F200F7DF10E202E0DACF00E00895F1DF009157 -:10770200EB0008950F770132A9F5112369F11A955B -:1077120059F01A9561F01A9569F01A95F9F01A95CF -:10772200C1F01A95D9F024C00E942C3920C00E94C1 -:10773200263A1DC029D00091090123D001E01FD0B3 -:1077420020D0009108011BD00E94923A0E94973AE1 -:107752000EC01AD00091080114D007C002E00093B5 -:10776200080100E0009309010FD00E94923A03C081 -:107772000E94803A02C001E0089500E0089501D01D -:1077820000E00093F10008950091E800077F009364 -:10779200E800089508950350F9F4112339F01A9579 -:1077A20051F01A9581F01A9599F016C004E016D09E -:1077B20001E810E703C011D003E510E7E7E1F2E0CA -:1077C20000831183D8CF06E109D00FE510E7F6CF89 -:1077D20004D005E710E7F2CFD0CF0CE000931A02F5 -:1077E200089527D120D100931D02E1D0212F11232A -:1077F20029F12A95E9F02250F1F0225099F02A95C8 -:1078020049F0225061F02A9581F02A95E1F02A95FB -:10781200E9F023C0003809F44FC00C94833B0038D0 -:10782200E1F7C8C00023C9F71EC00023B1F72DC07D -:10783200033098F744C1033080F70BC1003868F376 -:10784200033858F7C9C0013841F77BC1013051F400 -:10785200FCD0BFD000FD06C0FCCF0E94833B0023BA -:1078620009F41ED008951091E3001078DCD00F7750 -:10787200012B0093E300E9D0ACD000FFFDCF0091D3 -:10788200E30000680093E300089591D0123040F4C1 -:107892000FD010931E02DAD000911E020C94CB3B43 -:1078A2000091EB0001D004C000620093EB00089548 -:1078B2000091E800077FC0C0BA93AA93229700E024 -:1078C2000093190274D0AFD0202F2A9519F02A956F -:1078D200E9F022C002E100931A020FE210E7E7E1A9 -:1078E200F2E0008311839DD008839DD00983E0DFFD -:1078F20000911A0210E02881398102171307A8F4B7 -:107902000F7181F401E00093190211C002E10093AA -:107912001A0201E410E7E3CF0E94CC3B002319F7DF -:107922008ED040C01093190202C020931A027ED05A -:10793200A7E1B2E001C08AD000911A02002309F146 -:1079420048D004FD1EC045D000FD03C042D004FF54 -:10795200FACF10E0012F1395003281F0ED91FC91E6 -:107962001197049133D02D913C912F5F3F4F3C935F -:107972002E93FD0103810A95038361F72AD004FF48 -:10798200DACF00911902013039F423D004FD04C08A -:1079920020D000FFFDCF5AD01CD004FFFDCF46D02F -:1079A20018D00B7F49D02296A991B99108951091D0 -:1079B200F10008957DDF00911E0208D047D009D062 -:1079C2000F773AD006D002FFFDCFBFC00093F1007F -:1079D20008950091E800089524D010911D021058D6 -:1079E20029F01A9589F01A9591F019C061DF00917A -:1079F2001C02ECDF00E0EADF29D0EBDF02FFFDCF63 -:107A020018D0E7DF0F770CC053DF00E0F2CF51D080 -:107A12000F7710E0F801E55EFD4F0081EACF0FD04D -:107A22000BC001D000D00091F1000895D2DF0F7E8B -:107A320003C00091E8000B7F0093E80008950091D5 -:107A4200EB0032DFC6DF077F089532DFC2DF0E7F31 -:107A5200F3CF00911D02002329F00A9509F10A953E -:107A620031F01EC0E0DF0A9561D0D9F41AC061D0AE -:107A7200B9F4D9DF0F7711F416D01BD00093E900C7 -:107A82001091EB0010FF0BC00ED010E01093E90034 -:107A920021E0F801E55EFD4F20834FD003C042D0C4 -:107AA20045D0CFDFC9CF1091EB0010621093EB00ED -:107AB20008951091E800177F1093E800089500914F -:107AC2001D02002311F4AFDF02C0013011F4B7DF51 -:107AD200B3CF023031F52DD019F52091F1002F7777 -:107AE2002093E90023D000FF19C081F01FD000616C -:107AF200DCDE01E010E0422F0E949F3E0093EA008C -:107B020000E00093EA0012D00860CFDE0BD030E034 -:107B1200F901E55EFD4F008310D0DACF03D0D7CF55 -:107B2200BFDE089500E00093E90008950091EB00A4 -:107B3200089579DF3CDF00230895BADE4ADF0E7F25 -:107B4200089583DF46DF02FFFDCF73DF42DF0F7749 -:107B520073CF0091D70001600093D7000E948B3849 -:107B620000E000931F0208950C94BF388A93FA93A1 -:107B7200EA933A922A921A920A927A936A935A93BF -:107B82004A933A932A931A930A938FB70091DA0091 -:107B920000FF24C00091D80000FF20C00EEF009328 -:107BA200DA000091D90000FF11C001E000930D013D -:107BB200ABD0026096D09AD00860A2D00E949B38C7 -:107BC2000091E0000E7F0093E00008C000E0009307 -:107BD2000D0100931E0298D0046083D07FD002FF73 -:107BE20005C084D002FF02C00BEF75D077D000FF32 -:107BF2001BC07CD000FF18C001E000930E016AD0C8 -:107C020083D000626ED00EEF6FD0006179D06ED05B -:107C12000F7D76D00091D80000620093D80009B59C -:107C22000D7F09BD00E009BD59D004FF20C05ED020 -:107C320004FF1DC009B500FD05C00E94EB3809B55F -:107C420000FFFDCF0091D8000F7D0093D80042D0F5 -:107C520000910E01002359F04CD00FEE45D00F7E5B -:107C620052D000643ED042D001604AD042D036D0D9 -:107C720005FF0FC03BD005FF0CC000E000930E01D2 -:107C820035D00F7E3DD00FED2FD00F7D3CD0006858 -:107C920028D024D003FF0DC029D003FF0AC000E082 -:107CA20000931F0207EF17D00E94743B2DD0116082 -:107CB20018D08FBF09911991299139914991599100 -:107CC200699179910990199029903990E991F991E6 -:107CD200899118950FEE0093E10008950091E1005B -:107CE20008951183008308950093E1000091E2005A -:107CF20008950091E200006203D00091E200086062 -:107D02000093E2000895FCDFE0E2F2E000811181DD -:107D1200089500008895FECF01E60DBF02E00EBF78 -:107D2200C2EED2E00E947438002311F00E94D33ECA -:107D32000E9465380E948A3E0C948A3E4A951AF047 -:107D4200000F111FFBCF0895BA92AA929A928A92BB -:107D52007A926A925A924A92BA93AA939A938A937D -:107D62000895BB84AA84998488847F806E805D8014 -:107D72004C80BB81AA8199818881F0E00FB6F8948A -:107D8200CE0FDF1F0FBE089520E006D0E9F7089559 -:107D9200259102D0E9F708952D9301501040202F2C -:107DA200212B089585E890E7FC0105911491FC01CF -:107DB2003296A591B491FC01349625913491422FCB -:107DC200432B19F0F901E4DF01C0DEDF069610E76C -:107DD2008139910748F308952F930CD02F9101D048 -:107DE20008953CD0F12FE02F45E047BFE89536D00B -:107DF20012D0089533D0F12FE02F43E047BFE8952A -:107E02002DD008952BD0F12FE02F43E047BFE89506 -:107E120025D001D0089522D041E147BFE8951EC088 -:107E22001DD0F12FE02F41E247BFC895002D16C0AB -:107E320015D0F12FE02F49E047BFC895002D0EC0A5 -:107E4200F32FE22F012E102E41E047BFE89506C026 -:107E520005D0002E29E027BFE89500C0022E27B7E3 -:107E620020FDFCCF202D0895022E27B726FDFCCF42 -:107E7200202D08950E94A53E22974801C901DA01EA -:107E820010C05BD001E0A00E00E0B01E00E4A0161E -:107E920000E0B00608F440C0830120E030E00E9418 -:107EA200F23E0A2F0B2B09F440C0082F0F7710E087 -:107EB2002C01401A510A320100E4A02E03C00A2FFD -:107EC2000B2BE1F04816590680F0F40101914F01A5 -:107ED2000983119729F001914F010883119711C06D -:107EE200F2013196049108830CC0F20104910983D6 -:107EF2003196E817F907A1F7F401EDCF1BD00883FB -:107F020019839201088119810E94213F16D0AA94F7 -:107F1200B1F62301AA24BB240DD0312F0F3F3F4FCE -:107F220009F4AFCF83011DD0B7CF01E02296ECE078 -:107F32000C94B23E82010C945F3802E0400E00E0E5 -:107F4200501E08959A938A9380E090E08C0109D0A4 -:107F520080589F4F8F3F0FE69007C0F38991999108 -:107F6200089520E030E00C94FB3E00000000000089 -:067F720000000000FC000D -:107FE4000C94ED3E0C94113F0C94193F0C94213FDA -:0C7FF4000C94F23E0C94033F0C94293FC7 -:040000030000700089 -:00000001FF +:020000020000FC +:047000000C948D3E21 +:047028000C94B73DD0 +:10702F0012010002FF010020EB03F42F0000010208 +:10703F00030109021200010100803209040000005F +:10704F00000000000C03410054004D0045004C00AF +:10705F001603410054006D00330032005500340018 +:10706F004400460055000C0331002E0030002E0066 +:10707F0030000403090416010C0100000C0000018C +:02708F006C7F14 +:1070920012BD01BDF89A00B5089501E00895F9996D +:1070A200FECF12BD01BD20BDFA9AF99AF6CFF99929 +:1070B200FECF0C944938F80104910895F8013491F7 +:1070C20031962491890108950091610000930C0189 +:1070D20000E80093610001E00093610005BF02E057 +:1070E20005BF0C9486380091D70001600093D70049 +:1070F200A89507EF04BF0091600000610093600053 +:1071020000E00093600001E008950E94AA3D0E9401 +:10711200B53DFDCF0CD00F7708D0006806D00061D6 +:1071220004D0016028D0789408950093D80000918B +:10713200D8000895FCDF00621ED04CD009B500FFD4 +:10714200FDCFF5DF0F7D17D00091E0000E7F009399 +:10715200E0000091E000077F0093E0000091E20070 +:1071620001600093E2000091E20008600093E200F7 +:1071720078940C94743B0093D800089500910D010B +:10718200002359F40091D90000FF07C0D0DF006846 +:10719200F2DF01E000930D01CDDFE0E2F2E00081D9 +:1071A200018100FF0DC0008111811E7F11830083C8 +:1071B20001E00093EA0000E00093EA0000931E025F +:1071C20000E00093E9000091E80003FF02C00E9482 +:1071D200F23B0895A89539D000E40093600000E0E6 +:1071E200009381000093800010E0009385000093DB +:1071F200840001E006BB00918100036000938100DE +:107202000091600007FFFCCF00E80093600010933C +:107212008100A89507EF04BF18D010936000209159 +:1072220084003091850010938100109380001093A8 +:1072320085001093840001E006BB2D3D354010F01F +:1072420002E101C002E009BD089500916000006101 +:107252000093600008950E94AD3E239741D100E063 +:1072620000930901B5D104811581012B51F437D165 +:1072720000910701002309F4B9C000E0009307015F +:10728200B5C058D102FFFDCF37D1068335D1009367 +:107292000F0132D1009310012FD1009311012CD193 +:1072A2000093120129D10093130102852091130149 +:1072B20030911201409111015091100116811A95DD +:1072C20041F01250A9F01A9599F11A9509F473C078 +:1072D2008BC010910F01113011F411E001C010E0C8 +:1072E200138799D00C3F11F414D17FC077D17DC0A0 +:1072F20092D010910F01112329F01A9549F01A9595 +:10730200A9F073C010E013870C3F09F06EC0ECCFF8 +:1073120056D103C04CD109F468C00D911C9144D1DF +:107322000F3FC1F305E0009309015FC011E0EBCF0D +:10733200D2D029F00250E1F10A9541F056C0FDD0B9 +:107342000E94A33F0FEF00930A014FC0552319F08B +:107352005A9579F04AC04ED00DEF04BF74D0EAD0EE +:1073620003FFFDCF67D051D04AD008E00093600000 +:10737200FFCF40D068D0DED003FFFDCF5BD03FD03F +:1073820044D00FEF1FE004C009811A810150104060 +:1073920009831A8309811A81012BB1F700E800934E +:1073A200610000910C01009361000C940000FFCF7A +:1073B20001E003871AC08FD019F00A9539F015C081 +:1073C200535098F4BAD002E000870FC0505339F0FE +:1073D2005A9541F05F52B1F35A95A1F306C002E00B +:1073E2000883F0CF01E0FCCFA8D079D02396E4E067 +:1073F2000C94BA3E01E005BF00E005BF089500917C +:10740200D8000F770093D800089509B50D7F09BD04 +:1074120000E009BD08955183408333832283109194 +:10742200E8001B7F1093E8001091E8001F7710938B +:10743200E80008955DD053D0F8940091E000016017 +:107442000093E000089579D04AC0219749D0009175 +:107452000601035019F00250B9F00BC03CD021F0E4 +:107462000A9559F00A9529F400910A010C3F19F482 +:1074720050D02196089567D0FCCF0091010100936E +:10748200F100009100010AC01091100124D019F0FE +:107492000A9549F0EECF135018F400E00093F10082 +:1074A2001ED044D0E6CF105339F01A9539F01F524E +:1074B20041F01A9541F0F4CF08E5F0CF00E006D094 +:1074C200EDCF02E0FCCF04E001D0E8CF10E020E0F5 +:1074D20030E00C94113F00910F010023089521C068 +:1074E2000BD008D007D00093040106D00093050109 +:1074F20021D00BC000D008830091F10008950091C3 +:10750200EB0000620093EB0015D0077F0093E800C8 +:107512000895F5DF02E00093080103E000930901FA +:10752200089559D007D000FFFDCF089503D002FF80 +:10753200FDCF03C00091E8000895FCDF0B7FE6DF7A +:10754200F9DF0F77E3CF0E94AC3E42D038D006C0BD +:107552002BD00093F1002BD059F43DD0082F092BEA +:10756200A9F0E8DF02FD12C0E5DF00FFFDCF4424F1 +:10757200042D4394003289F300910B0100230D91F5 +:107582001C9131F311970E945838E3CFD3DF00FFEB +:10759200FDCF21D0CFDF00FFFDCFCCDF02FFFDCF3B +:1075A200CCDFE5E00C94B93E11970C945C380D9158 +:1075B2001C910F5F1F4F1C930E93019708958281B8 +:1075C200938100811181801B910B0196DF01089547 +:1075D200E0E0F1E00895AEDF0E7F98CF0E94A93E71 +:1075E200F7DF80819181A081B181AF710481158122 +:1075F20000521040048315830AC000910B0100233E +:1076020031F4A301920103E911E00E943B3F47D00C +:10761200B8F1662477242C0111C06EDFF301ED5618 +:10762200FE4F008301E0600E00E0701E01960091A3 +:10763200F200002311F033D0B8F47FDF30D0E8F24B +:10764200F301B096E238F040C0F674DF02FFFDCFDE +:107652000091F200BDDF24813581201B304024835C +:107662003583E5CF49DFAA95AA23E1F700910B0103 +:10767200013099F62091F1008C010E945038D6CF4A +:1076820004811581012B21F055DF02FFFDCF55DF6B +:10769200A2DF50DF00FFFDCFE8E00C94B63EE0E051 +:1076A200F1E0028113810817190708952091EB0078 +:1076B20021602093EB000093EC000091ED0002703A +:1076C200012B0093ED000091ED0002600093ED00AC +:1076D2001091EE00012F000F00E0001F0895412FCE +:1076E2000093E900089500E009D000FD05C000E024 +:1076F200F7DF10E202E0DACF00E00895F1DF009157 +:10770200EB0008950F770132A9F5112369F11A955B +:1077120059F01A9561F01A9569F01A95F9F01A95CF +:10772200C1F01A95D9F024C00E942C3920C00E94C1 +:10773200263A1DC029D00091090123D001E01FD0B3 +:1077420020D0009108011BD00E94923A0E94973AE1 +:107752000EC01AD00091080114D007C002E00093B5 +:10776200080100E0009309010FD00E94923A03C081 +:107772000E94803A02C001E0089500E0089501D01D +:1077820000E00093F10008950091E800077F009364 +:10779200E800089508950350F9F4112339F01A9579 +:1077A20051F01A9581F01A9599F016C004E016D09E +:1077B20001E810E703C011D003E510E7E7E1F2E0CA +:1077C20000831183D8CF06E109D00FE510E7F6CF89 +:1077D20004D005E710E7F2CFD0CF0CE000931A02F5 +:1077E200089527D120D100931D02E1D0212F11232A +:1077F20029F12A95E9F02250F1F0225099F02A95C8 +:1078020049F0225061F02A9581F02A95E1F02A95FB +:10781200E9F023C0003809F44FC00C94833B0038D0 +:10782200E1F7C8C00023C9F71EC00023B1F72DC07D +:10783200033098F744C1033080F70BC1003868F376 +:10784200033858F7C9C0013841F77BC1013051F400 +:10785200FCD0BFD000FD06C0FCCF0E94833B0023BA +:1078620009F41ED008951091E3001078DCD00F7750 +:10787200012B0093E300E9D0ACD000FFFDCF0091D3 +:10788200E30000680093E300089591D0123040F4C1 +:107892000FD010931E02DAD000911E020C94CB3B43 +:1078A2000091EB0001D004C000620093EB00089548 +:1078B2000091E800077FC0C0BA93AA93229700E024 +:1078C2000093190274D0AFD0202F2A9519F02A956F +:1078D200E9F022C002E100931A020FE210E7E7E1A9 +:1078E200F2E0008311839DD008839DD00983E0DFFD +:1078F20000911A0210E02881398102171307A8F4B7 +:107902000F7181F401E00093190211C002E10093AA +:107912001A0201E410E7E3CF0E94CC3B002319F7DF +:107922008ED040C01093190202C020931A027ED05A +:10793200A7E1B2E001C08AD000911A02002309F146 +:1079420048D004FD1EC045D000FD03C042D004FF54 +:10795200FACF10E0012F1395003281F0ED91FC91E6 +:107962001197049133D02D913C912F5F3F4F3C935F +:107972002E93FD0103810A95038361F72AD004FF48 +:10798200DACF00911902013039F423D004FD04C08A +:1079920020D000FFFDCF5AD01CD004FFFDCF46D02F +:1079A20018D00B7F49D02296A991B99108951091D0 +:1079B200F10008957DDF00911E0208D047D009D062 +:1079C2000F773AD006D002FFFDCFBFC00093F1007F +:1079D20008950091E800089524D010911D021058D6 +:1079E20029F01A9589F01A9591F019C061DF00917A +:1079F2001C02ECDF00E0EADF29D0EBDF02FFFDCF63 +:107A020018D0E7DF0F770CC053DF00E0F2CF51D080 +:107A12000F7710E0F801E55EFD4F0081EACF0FD04D +:107A22000BC001D000D00091F1000895D2DF0F7E8B +:107A320003C00091E8000B7F0093E80008950091D5 +:107A4200EB0032DFC6DF077F089532DFC2DF0E7F31 +:107A5200F3CF00911D02002329F00A9509F10A953E +:107A620031F01EC0E0DF0A9561D0D9F41AC061D0AE +:107A7200B9F4D9DF0F7711F416D01BD00093E900C7 +:107A82001091EB0010FF0BC00ED010E01093E90034 +:107A920021E0F801E55EFD4F20834FD003C042D0C4 +:107AA20045D0CFDFC9CF1091EB0010621093EB00ED +:107AB20008951091E800177F1093E800089500914F +:107AC2001D02002311F4AFDF02C0013011F4B7DF51 +:107AD200B3CF023031F52DD019F52091F1002F7777 +:107AE2002093E90023D000FF19C081F01FD000616C +:107AF200DCDE01E010E0422F0E949F3E0093EA008C +:107B020000E00093EA0012D00860CFDE0BD030E034 +:107B1200F901E55EFD4F008310D0DACF03D0D7CF55 +:107B2200BFDE089500E00093E90008950091EB00A4 +:107B3200089579DF3CDF00230895BADE4ADF0E7F25 +:107B4200089583DF46DF02FFFDCF73DF42DF0F7749 +:107B520073CF0091D70001600093D7000E948B3849 +:107B620000E000931F0208950C94BF388A93FA93A1 +:107B7200EA933A922A921A920A927A936A935A93BF +:107B82004A933A932A931A930A938FB70091DA0091 +:107B920000FF24C00091D80000FF20C00EEF009328 +:107BA200DA000091D90000FF11C001E000930D013D +:107BB200ABD0026096D09AD00860A2D00E949B38C7 +:107BC2000091E0000E7F0093E00008C000E0009307 +:107BD2000D0100931E0298D0046083D07FD002FF73 +:107BE20005C084D002FF02C00BEF75D077D000FF32 +:107BF2001BC07CD000FF18C001E000930E016AD0C8 +:107C020083D000626ED00EEF6FD0006179D06ED05B +:107C12000F7D76D00091D80000620093D80009B59C +:107C22000D7F09BD00E009BD59D004FF20C05ED020 +:107C320004FF1DC009B500FD05C00E94EB3809B55F +:107C420000FFFDCF0091D8000F7D0093D80042D0F5 +:107C520000910E01002359F04CD00FEE45D00F7E5B +:107C620052D000643ED042D001604AD042D036D0D9 +:107C720005FF0FC03BD005FF0CC000E000930E01D2 +:107C820035D00F7E3DD00FED2FD00F7D3CD0006858 +:107C920028D024D003FF0DC029D003FF0AC000E082 +:107CA20000931F0207EF17D00E94743B2DD0116082 +:107CB20018D08FBF09911991299139914991599100 +:107CC200699179910990199029903990E991F991E6 +:107CD200899118950FEE0093E10008950091E1005B +:107CE20008951183008308950093E1000091E2005A +:107CF20008950091E200006203D00091E200086062 +:107D02000093E2000895FCDFE0E2F2E000811181DD +:107D1200089500008895FECF01E60DBF02E00EBF78 +:107D2200C2EED2E00E947438002311F00E94D33ECA +:107D32000E9465380E948A3E0C948A3E4A951AF047 +:107D4200000F111FFBCF0895BA92AA929A928A92BB +:107D52007A926A925A924A92BA93AA939A938A937D +:107D62000895BB84AA84998488847F806E805D8014 +:107D72004C80BB81AA8199818881F0E00FB6F8948A +:107D8200CE0FDF1F0FBE089520E006D0E9F7089559 +:107D9200259102D0E9F708952D9301501040202F2C +:107DA200212B089585E890E7FC0105911491FC01CF +:107DB2003296A591B491FC01349625913491422FCB +:107DC200432B19F0F901E4DF01C0DEDF069610E76C +:107DD2008139910748F308952F930CD02F9101D048 +:107DE20008953CD0F12FE02F45E047BFE89536D00B +:107DF20012D0089533D0F12FE02F43E047BFE8952A +:107E02002DD008952BD0F12FE02F43E047BFE89506 +:107E120025D001D0089522D041E147BFE8951EC088 +:107E22001DD0F12FE02F41E247BFC895002D16C0AB +:107E320015D0F12FE02F49E047BFC895002D0EC0A5 +:107E4200F32FE22F012E102E41E047BFE89506C026 +:107E520005D0002E29E027BFE89500C0022E27B7E3 +:107E620020FDFCCF202D0895022E27B726FDFCCF42 +:107E7200202D08950E94A53E22974801C901DA01EA +:107E820010C05BD001E0A00E00E0B01E00E4A0161E +:107E920000E0B00608F440C0830120E030E00E9418 +:107EA200F23E0A2F0B2B09F440C0082F0F7710E087 +:107EB2002C01401A510A320100E4A02E03C00A2FFD +:107EC2000B2BE1F04816590680F0F40101914F01A5 +:107ED2000983119729F001914F010883119711C06D +:107EE200F2013196049108830CC0F20104910983D6 +:107EF2003196E817F907A1F7F401EDCF1BD00883FB +:107F020019839201088119810E94213F16D0AA94F7 +:107F1200B1F62301AA24BB240DD0312F0F3F3F4FCE +:107F220009F4AFCF83011DD0B7CF01E02296ECE078 +:107F32000C94B23E82010C945F3802E0400E00E0E5 +:107F4200501E08959A938A9380E090E08C0109D0A4 +:107F520080589F4F8F3F0FE69007C0F38991999108 +:107F6200089520E030E00C94FB3E00000000000089 +:067F720000000000FC000D +:107FE4000C94ED3E0C94113F0C94193F0C94213FDA +:0C7FF4000C94F23E0C94033F0C94293FC7 +:040000030000700089 +:00000001FF diff --git a/util/docker_build.sh b/util/docker_build.sh new file mode 100755 index 00000000000..6feeb1f5d26 --- /dev/null +++ b/util/docker_build.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# NOTE: This script uses tabs for indentation + +USAGE="Usage: $0 [keyboard[:keymap[:target]]]" + +# Check preconditions +for arg; do + if [ "$arg" = "--help" ]; then + echo "$USAGE" + exit 0 + fi +done +if [ $# -gt 1 ]; then + echo "$USAGE" >&2 + exit 1 +elif ! command -v docker >/dev/null 2>&1; then + echo "Error: docker not found" >&2 + echo "See https://docs.docker.com/install/#supported-platforms for installation instructions" >&2 + exit 2 +fi + +# Determine arguments +if [ $# -eq 0 ]; then + printf "keyboard=" && read -r keyboard + [ -n "$keyboard" ] && printf "keymap=" && read -r keymap + [ -n "$keymap" ] && printf "target=" && read -r target +else + IFS=':' read -r keyboard keymap target x <<-EOF + $1 + EOF + if [ -n "$x" ]; then + echo "$USAGE" >&2 + exit 1 + fi +fi +if [ -n "$target" ]; then + if [ "$(uname)" = "Linux" ] || docker-machine active >/dev/null 2>&1; then + usb_args="--privileged -v /dev:/dev" + else + echo "Error: target requires docker-machine to work on your platform" >&2 + echo "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" >&2 + echo "Consider flashing with QMK Toolbox (https://github.com/qmk/qmk_toolbox) instead" >&2 + exit 3 + fi +fi +dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows + +# Run container and build firmware +docker run --rm -it $usb_args -w /qmk_firmware/ -v "$dir":/qmk_firmware qmkfm/base_container \ + make "$keyboard${keymap:+:$keymap}${target:+:$target}" diff --git a/util/freebsd_install.sh b/util/freebsd_install.sh old mode 100644 new mode 100755 index 25ea80a7fcb..81575920313 --- a/util/freebsd_install.sh +++ b/util/freebsd_install.sh @@ -1,4 +1,5 @@ #!/bin/sh +util_dir=$(dirname "$0") pkg update pkg install -y \ git \ @@ -15,4 +16,6 @@ pkg install -y \ arm-none-eabi-gcc \ arm-none-eabi-binutils \ arm-none-eabi-newlib \ - diffutils + diffutils \ + python3 +pip3 install -r ${util_dir}/../requirements.txt diff --git a/util/generate_internal_docs.sh b/util/generate_internal_docs.sh old mode 100644 new mode 100755 diff --git a/util/linux_install.sh b/util/linux_install.sh index d3b9328d79c..d21cd3c1c9f 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -2,7 +2,13 @@ # Note: This file uses tabs to indent. Please don't mix tabs and spaces. -GENTOO_WARNING="This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmk_firmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki." +GENTOO_WARNING="This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmkfirmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki." + +SLACKWARE_WARNING="You will need the following packages from slackbuilds.org:\n\tarm-binutils\n\tarm-gcc\n\tavr-binutils\n\tavr-gcc\n\tavr-libc\n\tavrdude\n\tdfu-programmer\n\tdfu-util\n\tnewlib\nThese packages will be installed with sudo and sboinstall, so ensure that your user is added to sudoers and that sboinstall is configured." + +SOLUS_INFO="Your tools are now installed. To start using them, open new terminal or source these scripts:\n\t/usr/share/defaults/etc/profile.d/50-arm-toolchain-path.sh\n\t/usr/share/defaults/etc/profile.d/50-avr-toolchain-path.sh" + +util_dir=$(dirname "$0") if grep ID /etc/os-release | grep -qE "fedora"; then sudo dnf install \ @@ -23,6 +29,7 @@ if grep ID /etc/os-release | grep -qE "fedora"; then kernel-headers \ make \ perl \ + python3 \ unzip \ wget \ zip @@ -30,9 +37,9 @@ if grep ID /etc/os-release | grep -qE "fedora"; then elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true - export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN + export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN sudo apt-get update - sudo apt-get install \ + sudo apt-get -yq install \ build-essential \ avr-libc \ binutils-arm-none-eabi \ @@ -45,76 +52,139 @@ elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then gcc-avr \ git \ libnewlib-arm-none-eabi \ + python3 \ unzip \ wget \ zip elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then - # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug. - sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz + sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.3.0-1-x86_64.pkg.tar.xz sudo pacman -S \ arm-none-eabi-binutils \ arm-none-eabi-gcc \ arm-none-eabi-newlib \ + avrdude \ avr-binutils \ avr-libc \ avr-gcc \ - base-devel \ + base-devel \ dfu-util \ - diff-utils \ + diffutils \ gcc \ git \ + python \ unzip \ wget \ zip git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer - cd /tmp/dfu-programmer + cd /tmp/dfu-programmer || exit 1 makepkg -sic rm -rf /tmp/dfu-programmer/ elif grep ID /etc/os-release | grep -q gentoo; then - echo GENTOO_WARNING | fmt - echo -n "Proceed (y/N)? " - old_stty_cfg=$(stty -g) - stty raw -echo - answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) - stty $old_stty_cfg - if echo "$answer" | grep -iq "^y" ;then + echo "$GENTOO_WARNING" | fmt + printf "\nProceed (y/N)? " + read -r answer + if echo "$answer" | grep -iq "^y"; then sudo touch /etc/portage/package.use/qmkfirmware - echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null + # tee is used here since sudo doesn't apply to >> + echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null sudo emerge -auN \ app-arch/unzip \ app-arch/zip \ app-mobilephone/dfu-util \ + dev-embedded/avrdude \ + dev-lang/python:3.5 \ net-misc/wget \ sys-devel/gcc \ - sys-devel/crossdev dev-embedded/avrdude + sys-devel/crossdev sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr - echo Done! + echo "Done!" else echo "Quitting..." fi +elif grep ID /etc/os-release | grep -q sabayon; then + sudo equo install \ + app-arch/unzip \ + app-arch/zip \ + app-mobilephone/dfu-util \ + dev-embedded/avrdude \ + dev-lang/python \ + net-misc/wget \ + sys-devel/gcc \ + sys-devel/crossdev + sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr + echo "Done!" + elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then CROSS_AVR_GCC=cross-avr-gcc8 - if grep ID /etc/os-release | grep -q "15.0"; then + CROSS_ARM_GCC=cross-arm-none-gcc8 + if grep ID /etc/os-release | grep -q "15."; then CROSS_AVR_GCC=cross-avr-gcc7 + CROSS_ARM_GCC=cross-arm-none-gcc7 fi sudo zypper install \ avr-libc \ $CROSS_AVR_GCC \ + $CROSS_ARM_GCC \ cross-avr-binutils \ cross-arm-none-newlib-devel \ cross-arm-binutils cross-arm-none-newlib-devel \ dfu-tool \ dfu-programmer \ gcc \ + python3 \ unzip \ wget \ zip +elif grep ID /etc/os-release | grep -q slackware; then + printf "$SLACKWARE_WARNING\n" + printf "\nProceed (y/N)? " + read -r answer + if echo "$answer" | grep -iq "^y" ;then + sudo sboinstall \ + avr-binutils \ + avr-gcc \ + avr-libc \ + avrdude \ + dfu-programmer \ + dfu-util \ + arm-binutils \ + arm-gcc \ + newlib \ + python3 + echo "Done!" + else + echo "Quitting..." + fi + +elif grep ID /etc/os-release | grep -q solus; then + sudo eopkg ur + sudo eopkg it \ + -c system.devel \ + arm-none-eabi-gcc \ + arm-none-eabi-binutils \ + arm-none-eabi-newlib \ + avr-libc \ + avr-binutils \ + avr-gcc \ + avrdude \ + dfu-util \ + dfu-programmer \ + python3 \ + git \ + wget \ + zip \ + unzip + printf "\n$SOLUS_INFO\n" + else echo "Sorry, we don't recognize your OS. Help us by contributing support!" echo echo "https://docs.qmk.fm/#/contributing" fi + +# Global install tasks +pip3 install -r ${util_dir}/../requirements.txt diff --git a/util/macos_install.sh b/util/macos_install.sh index c31be99d221..f7e3044249d 100755 --- a/util/macos_install.sh +++ b/util/macos_install.sh @@ -1,5 +1,7 @@ #!/bin/bash +util_dir=$(dirname "$0") + if ! brew --version 2>&1 > /dev/null; then echo "Error! Homebrew not installed or broken!" echo -n "Would you like to install homebrew now? [y/n] " @@ -22,4 +24,6 @@ fi brew tap osx-cross/avr brew tap PX4/homebrew-px4 brew update -brew install avr-gcc@7 gcc-arm-none-eabi dfu-programmer avrdude dfu-util +brew install avr-gcc@8 gcc-arm-none-eabi dfu-programmer avrdude dfu-util python3 +brew link --force avr-gcc@8 +pip3 install -r ${util_dir}/../requirements.txt diff --git a/util/msys2_install.sh b/util/msys2_install.sh old mode 100644 new mode 100755 index d9459580c7d..bed176da66d --- a/util/msys2_install.sh +++ b/util/msys2_install.sh @@ -5,17 +5,21 @@ download_dir=~/qmk_utils avrtools=avr8-gnu-toolchain armtools=gcc-arm-none-eabi installflip=false +util_dir=$(dirname "$0") echo "Installing dependencies needed for the installation (quazip)" -pacman --needed -S msys/unzip msys/p7zip base-devel msys/git mingw-w64-x86_64-toolchain +pacman --needed -S base-devel mingw-w64-x86_64-toolchain msys/git msys/p7zip msys/python3 msys/unzip source "$dir/win_shared_install.sh" function install_avr { rm -f -r "$avrtools" - wget "http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe" - 7z x avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe - rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe + wget "http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip" + echo "Extracting AVR toolchain..." + unzip -q avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip + mv avr8-gnu-toolchain-win32_x86/ avr8-gnu-toolchain + rm __MACOSX -R + rm avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip pacman --needed -S mingw-w64-x86_64-avrdude } @@ -89,6 +93,8 @@ else fi popd +pip3 install -r ${util_dir}/../requirements.txt + cp -f "$dir/activate_msys2.sh" "$download_dir/" if grep "^source ~/qmk_utils/activate_msys2.sh$" ~/.bashrc diff --git a/util/new_keyboard.sh b/util/new_keyboard.sh new file mode 100755 index 00000000000..35d89e4026b --- /dev/null +++ b/util/new_keyboard.sh @@ -0,0 +1,172 @@ +#!/bin/bash + +# This script generates a new keyboard directory under keyboards/, +# and copies the template files from quantum/template/ into it. + +# Print an error message with the word "ERROR" in red. +echo_error() { + echo -e "[\033[0;91mERROR\033[m]: $1" +} + +# Print a message in bold. +echo_bold() { + echo -e "\033[1m$1\033[m" +} + +# Prompt the user for information, showing the default value in brackets. +prompt() { + local message="$1" + local default="$2" + + [ -n "$default" ] && message+=" [$default]" + message+=": " + + read -rp "$message" prompt_return + [ -z "$prompt_return" ] && prompt_return="$default" +} + +# Grab a username from Git config. +set_git_username() { + git_username="$(git config --get user.name)" +} + +# Copy the template files to the new keyboard directory. +copy_templates() { + echo -n "Copying base template files..." + cp -r "quantum/template/base" "${keyboard_dir}" + echo " done" + + echo -n "Copying $keyboard_type template files..." + cp -r "quantum/template/${keyboard_type}/." "${keyboard_dir}" + echo " done" + + echo -n "Renaming keyboard files..." + mv "${keyboard_dir}/template.c" "${keyboard_dir}/${keyboard_name}.c" + mv "${keyboard_dir}/template.h" "${keyboard_dir}/${keyboard_name}.h" + echo " done" +} + +# Set the inplace editing parameter for sed. +# macOS/BSD sed expects a file extension immediately following -i. +set_sed_i() { + sed_i=(-i) + + case $(uname -a) in + *Darwin*) sed_i=(-i "") + esac +} + +# Replace a token with a value in the given list of files. +replace_placeholders() { + local replace_token="$1" + local replace_value="$2" + shift 2 + local replace_filenames=("$@") + + echo -n "Replacing $replace_token with $replace_value..." + for replace_filename in "${replace_filenames[@]}"; do + sed "${sed_i[@]}" -e "s/${replace_token}/${replace_value}/g" "$replace_filename" + done + echo " done" +} + +# Replace %YEAR% with the current year. +replace_year_placeholders() { + local replace_year_filenames=( + "${keyboard_dir}/config.h" + "${keyboard_dir}/${keyboard_name}.c" + "${keyboard_dir}/${keyboard_name}.h" + "${keyboard_dir}/keymaps/default/config.h" + "${keyboard_dir}/keymaps/default/keymap.c" + ) + replace_placeholders "%YEAR%" "$(date +%Y)" "${replace_year_filenames[@]}" +} + +# Replace %KEYBOARD% with the keyboard name. +replace_keyboard_placeholders() { + local replace_keyboard_filenames=( + "${keyboard_dir}/config.h" + "${keyboard_dir}/readme.md" + "${keyboard_dir}/${keyboard_name}.c" + "${keyboard_dir}/keymaps/default/readme.md" + ) + replace_placeholders "%KEYBOARD%" "$keyboard_name" "${replace_keyboard_filenames[@]}" +} + +# Replace %YOUR_NAME% with the username. +replace_name_placeholders() { + local replace_name_filenames=( + "${keyboard_dir}/config.h" + "${keyboard_dir}/readme.md" + "${keyboard_dir}/${keyboard_name}.c" + "${keyboard_dir}/${keyboard_name}.h" + "${keyboard_dir}/keymaps/default/config.h" + "${keyboard_dir}/keymaps/default/keymap.c" + ) + replace_placeholders "%YOUR_NAME%" "$username" "${replace_name_filenames[@]}" +} + +# Check if an array contains an element. +array_contains() { + local e match="$1" + shift + for e; do + [[ "$e" == "$match" ]] && return 0; + done + + return 1 +} + +# If we've been started from util/, we want to be in qmk_firmware/ +[[ "$PWD" == *util ]] && cd .. + +# The root qmk_firmware/ directory should have a subdirectory called quantum/ +if [ ! -d "quantum" ]; then + echo_error "Could not detect the QMK firmware directory!" + echo_error "Are you sure you're in the right place?" + exit 1 +fi + +echo_bold "Generating a new QMK keyboard directory" +echo + +# Keyboard name is required, so keep prompting until we get one +while [ -z "$keyboard_name" ]; do + prompt "Keyboard Name" "" + keyboard_name=$prompt_return +done + +keyboard_dir="keyboards/$keyboard_name" + +if [ -d "$keyboard_dir" ]; then + echo_error "Keyboard $keyboard_name already exists!" + exit 1 +fi + +KEYBOARD_TYPES=("avr" "ps2avrgb") + +prompt "Keyboard Type" "avr" +keyboard_type=$prompt_return + +if ! array_contains "$keyboard_type" "${KEYBOARD_TYPES[@]}"; then + echo_error "Keyboard type must be one of: ${KEYBOARD_TYPES[*]}" + exit 1 +fi + +set_git_username +prompt "Your Name" "$git_username" +username=$prompt_return + +echo + +copy_templates +set_sed_i +replace_year_placeholders +replace_keyboard_placeholders +[ -n "$username" ] && replace_name_placeholders + +echo +echo_bold "Created a new keyboard called $keyboard_name." +echo +echo_bold "To start working on things, cd into keyboards/$keyboard_name," +echo_bold "or open the directory in your favourite text editor." diff --git a/util/new_project.sh b/util/new_project.sh deleted file mode 100755 index a85e8332220..00000000000 --- a/util/new_project.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# Script to make a new quantum project -# Jack Humbert 2015 - -KEYBOARD=$1 -KEYBOARD_TYPE=$2 - -if [ -z "$KEYBOARD" ]; then - echo "Usage: $0 " - echo "Example: $0 gh60 avr" - echo "Example: $0 bfake ps2avrgb" - exit 1 -elif [ -z "$KEYBOARD_TYPE" ]; then - KEYBOARD_TYPE=avr -fi - -if [ $KEYBOARD_TYPE != "avr" -a $KEYBOARD_TYPE != "ps2avrgb" ]; then - echo "Invalid keyboard type target" - exit 1 -fi - -if [ -e "keyboards/$1" ]; then - echo "Error! keyboards/$1 already exists!" - exit 1 -fi - -cd "$(dirname "$0")/.." - -KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}') -KEYBOARD_NAME=$(basename $1) -KEYBOARD_NAME_UPPERCASE=$(echo $KEYBOARD_NAME | awk '{print toupper($0)}') - - -cp -r quantum/template/base keyboards/$KEYBOARD -cp -r quantum/template/$KEYBOARD_TYPE/. keyboards/$KEYBOARD - -mv keyboards/${KEYBOARD}/template.c keyboards/${KEYBOARD}/${KEYBOARD_NAME}.c -mv keyboards/${KEYBOARD}/template.h keyboards/${KEYBOARD}/${KEYBOARD_NAME}.h -find keyboards/${KEYBOARD} -type f -exec sed -i '' -e "s;%KEYBOARD%;${KEYBOARD_NAME};g" {} \; -find keyboards/${KEYBOARD} -type f -exec sed -i '' -e "s;%KEYBOARD_UPPERCASE%;${KEYBOARD_NAME_UPPERCASE};g" {} \; - -echo "######################################################" -echo "# /keyboards/$KEYBOARD project created. To start" -echo "# working on things, cd into keyboards/$KEYBOARD" -echo "######################################################" diff --git a/util/rgblight_breathing_table_calc.c b/util/rgblight_breathing_table_calc.c new file mode 100644 index 00000000000..fc4d49ea587 --- /dev/null +++ b/util/rgblight_breathing_table_calc.c @@ -0,0 +1,49 @@ +// +// calculate rgblight_effect_breathe_table[] values +// +// this is host program for quantum/rgblight.c:void rgblight_effect_breathing(); +// +// example: +// $ edit util/rgblight_breathing_table_calc.c +// $ cc -o util/rgblight_breathing_table_calc util/rgblight_breathing_table_calc.c +// $ ./util/rgblight_breathing_table_calc > keyboards/KEYBOARD_NAME/keymaps/KEYMAP_NAME/rgblight_breathe_table.h +// +#include +#include +#include + +/// customize breeathing effect part /////////////////////////// +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +#define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +//////////////////////////////////////////////////////////////// + +int main(void) { + int pos, step; + int table[256]; + for (pos = 0; pos < 256; pos ++ ) { + table[pos] = (uint8_t)( + (exp(sin((pos/255.0)*M_PI))- RGBLIGHT_EFFECT_BREATHE_CENTER/M_E) + * (RGBLIGHT_EFFECT_BREATHE_MAX/(M_E-1/M_E)) + ); + } + printf("#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE\n"); + printf("#define RGBLIGHT_EFFECT_BREATHE_TABLE\n\n"); + printf("const uint8_t rgblight_effect_breathe_table[] PROGMEM = {\n"); + printf(" /* #define RGBLIGHT_EFFECT_BREATHE_CENTER %.2f */\n", RGBLIGHT_EFFECT_BREATHE_CENTER); + printf(" /* #define RGBLIGHT_EFFECT_BREATHE_MAX %d */\n", RGBLIGHT_EFFECT_BREATHE_MAX); + + for (int s = 0, step = (1<=256?"":"," ); + if ((pos+step) % 8 == 0) + printf("\n"); + } + printf(" #endif /* %d bytes table */\n", s == 0 ? 256:(s== 1 ? 128: 64)); + } + printf("};\n"); + printf("\nstatic const int table_scale = 256/sizeof(rgblight_effect_breathe_table);\n"); + printf("\n#endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */\n"); + return 0; +} diff --git a/util/travis_build.sh b/util/travis_build.sh old mode 100644 new mode 100755 index d12a87a942c..fd5511a72ba --- a/util/travis_build.sh +++ b/util/travis_build.sh @@ -1,13 +1,20 @@ #!/bin/bash +# if docker is installed - call make within the qmk docker image +if command -v docker >/dev/null; then + function make() { + docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container make "$@" + } +fi + # test force push #TRAVIS_COMMIT_RANGE="c287f1bfc5c8...81f62atc4c1d" TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" -MAKE_ALL="make all:default AUTOGEN=\"true\"" +MAKE_ALL="make all:default" -if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then +if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then exit_code=0 git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} if [ $? -eq 128 ]; then @@ -17,28 +24,30 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then else NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | grep -Ev '^(docs/)' | wc -l) BRANCH=$(git rev-parse --abbrev-ref HEAD) + # is this branch master or a "non docs, non keyboards" change if [ $NEFM -gt 0 -o "$BRANCH" = "master" ]; then echo "Making default keymaps for all keyboards" eval $MAKE_ALL : $((exit_code = $exit_code + $?)) else - MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z0-9_\/]+)(?=\/)' | sort -u) + # keyboards project format + # /keyboards/board1/rev/keymaps/ + # /keyboards/board2/keymaps/ + # ensure we strip everything off after and including the keymaps folder to get board and/or revision + MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z0-9_\/]+)(?=\/)' | sed 's^/keymaps/.*^^' | sort -u) for KB in $MKB ; do - if [[ $KB == *keymaps* ]]; then - continue - fi KEYMAP_ONLY=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/'${KB}'/keymaps/)' | wc -l) if [[ $KEYMAP_ONLY -gt 0 ]]; then echo "Making all keymaps for $KB" - make ${KB}:all AUTOGEN=true + make ${KB}:all : $((exit_code = $exit_code + $?)) else MKM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards/'${KB}'/keymaps/)([a-zA-Z0-9_]+)(?=\/)' | sort -u) for KM in $MKM ; do - echo "Making $KM for $KB" - make ${KB}:${KM} AUTOGEN=true + echo "Making $KM for $KB" + make ${KB}:${KM} : $((exit_code = $exit_code + $?)) - done + done fi done fi diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh old mode 100644 new mode 100755 index a49908c71e4..04021ae7c25 --- a/util/travis_compiled_push.sh +++ b/util/travis_compiled_push.sh @@ -1,27 +1,14 @@ #!/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}" +source util/travis_push.sh set -o errexit -o nounset rev=$(git rev-parse --short HEAD) +echo "Using git hash ${rev}" if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then -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 - # convert to unix line-endings git checkout master git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 dos2unix @@ -34,7 +21,7 @@ increment_version () part[2]=$((part[2] + 1)) new="${part[*]}" echo -e "${new// /.}" -} +} git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} @@ -42,8 +29,7 @@ NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/ if [[ $NEFM -gt 0 ]] ; then echo "Essential files modified." git fetch --tags - #lasttag=$(git describe --tags $(git rev-list --tags --max-count=10) | grep -Ev '\-' | xargs -I@ git log --format=format:"%ai @%n" -1 @ | sort -V | awk '{print $4}' | tail -1) - lasttag=$(git describe --tags $(git rev-list --tags --max-count=10) | grep -Ev '\-' | sort -V | tail -1) + lasttag=$(git tag --sort=-creatordate --no-column --list '*.*.*' | grep -E -m1 '^[0-9]+\.[0-9]+\.[0-9]+$') newtag=$(increment_version $lasttag) until git tag $newtag; do newtag=$(increment_version $newtag) @@ -63,18 +49,38 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then ssh-add -D eval `ssh-agent -s` ssh-add id_rsa_qmk.fm - + # don't delete files in case not all keyboards are built # rm -f compiled/*.hex # ignore errors here - for file in ../qmk_firmware/keyboards/*/keymaps/*/*_default.hex; do mv -v "$file" "compiled/${file##*/}" || true; done - for file in ../qmk_firmware/keyboards/*/*/keymaps/*/*_default.hex; do mv -v "$file" "compiled/${file##*/}" || true; done - for file in ../qmk_firmware/keyboards/*/*/*/keymaps/*/*_default.hex; do mv -v "$file" "compiled/${file##*/}" || true; done - for file in ../qmk_firmware/keyboards/*/*/*/*/keymaps/*/*_default.hex; do mv -v "$file" "compiled/${file##*/}" || true; done + # In theory, this is more flexible, and will allow for additional expansion of additional types of files and other names + mv ../qmk_firmware/*_default.*{hex,bin} ./compiled/ || true + + # get the list of keyboards + readarray -t keyboards < .keyboards + + # replace / with _ + keyboards=("${keyboards[@]//[\/]/_}") + + # remove all binaries that don't belong to a keyboard in .keyboards + for file in "./compiled"/* ; do + match=0 + for keyboard in "${keyboards[@]}" ; do + if [[ ${file##*/} = "${keyboard}_default.bin" ]] || [[ ${file##*/} = "${keyboard}_default.hex" ]]; then + match=1 + break + fi + done + if [[ $match = 0 ]]; then + echo "Removing deprecated binary: $file" + rm "$file" + fi + done + bash _util/generate_keyboard_page.sh 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 fi diff --git a/util/travis_docs.sh b/util/travis_docs.sh old mode 100644 new mode 100755 diff --git a/util/travis_push.sh b/util/travis_push.sh old mode 100644 new mode 100755 index 7eea88b1482..d100f9d48f7 --- a/util/travis_push.sh +++ b/util/travis_push.sh @@ -5,13 +5,15 @@ 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" +if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then + 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 + 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 + chmod 600 id_rsa_qmk_firmware + chmod 600 id_rsa_qmk.fm + eval `ssh-agent -s` + ssh-add id_rsa_qmk_firmware +fi diff --git a/util/travis_test.sh b/util/travis_test.sh new file mode 100644 index 00000000000..e6a50ac1658 --- /dev/null +++ b/util/travis_test.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" +TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" + +# test force push +#TRAVIS_COMMIT_RANGE="c287f1bfc5c8...81f62atc4c1d" + +NUM_IMPACTING_CHANGES=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ecv '^(docs/)') +BRANCH=$(git rev-parse --abbrev-ref HEAD) + +if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then + echo "Skipping due to commit message" + exit 0 +fi + +if [ "$BRANCH" != "master" ] && [ "$NUM_IMPACTING_CHANGES" == "0" ]; then + echo "Skipping due to changes not impacting tests" + exit 0 +fi + +# if docker is installed - call make within the qmk docker image +if command -v docker >/dev/null; then + function make() { + docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container make "$@" + } +fi + +make test:all diff --git a/util/usb_detach/Makefile b/util/usb_detach/Makefile new file mode 100644 index 00000000000..533c1928f49 --- /dev/null +++ b/util/usb_detach/Makefile @@ -0,0 +1,18 @@ +# the compiler: gcc for C program, define as g++ for C++ +CC = gcc + +# compiler flags: +# -g adds debugging information to the executable file +# -Wall turns on most, but not all, compiler warnings +CFLAGS = -g -Wall + +# the build target executable: +TARGET = usb_detach + +all: $(TARGET) + +$(TARGET): $(TARGET).c + $(CC) $(CFLAGS) -o $(TARGET) $(TARGET).c + +clean: + $(RM) $(TARGET) diff --git a/util/usb_detach/readme.md b/util/usb_detach/readme.md new file mode 100644 index 00000000000..ac42944ee47 --- /dev/null +++ b/util/usb_detach/readme.md @@ -0,0 +1,14 @@ +# usb_detach + +When trying to flash on Linux, you may encounter a "Resource Unavailable" error. This means that Linux's HID driver has taken exclusive control of the keyboard, and the program script can't flash it. +This program can force Linux to give up a device, so that the programming script can reset it. + +## To compile: +```bash +make clean && make +``` + +## To run: +1. Use `lsusb` to discover the Bus and Device numbers for your keyboard. +2. Run the program: `sudo ./usb_detach /dev/bus/usb//`. +3. Build and program the firmware as normal. diff --git a/util/usb_detach/usb_detach.c b/util/usb_detach/usb_detach.c new file mode 100644 index 00000000000..786ab5e674e --- /dev/null +++ b/util/usb_detach/usb_detach.c @@ -0,0 +1,34 @@ +/* Found at https://www.linuxquestions.org/questions/linux-hardware-18/how-to-unclaim-usb-device-558138/#post3406986 */ +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char**argv) +{ + struct usbdevfs_ioctl command; + int ret; + int fd; + int i; + if (argc>1) { + fd = open(argv[1],O_RDWR); + if (fd<1){ + perror("unable to open file"); + return 1; + } + for (i=0;i<255;i++){ // hack: should fetch how many interface there is. + command.ifno = i; + command.ioctl_code = USBDEVFS_DISCONNECT; + command.data = NULL; + ret = ioctl(fd, USBDEVFS_IOCTL, &command); + if(ret!=-1) + printf("un claimed interface %d %d\n",i,ret); + } + } else { + printf ("usage: %s /dev/bus/usb/BUS/DEVICE\n",argv[0]); + printf("Release all interfaces of this usb device for usage in virtualisation\n"); + } +} \ No newline at end of file diff --git a/util/vagrant/Dockerfile b/util/vagrant/Dockerfile new file mode 100644 index 00000000000..1936ee023aa --- /dev/null +++ b/util/vagrant/Dockerfile @@ -0,0 +1,33 @@ +FROM qmkfm/base_container + +# Basic upgrades; install sudo and SSH. +RUN apt-get update && apt-get install --no-install-recommends -y \ + sudo \ + openssh-server \ + && rm -rf /var/lib/apt/lists/* +RUN mkdir /var/run/sshd +RUN sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config +RUN echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove the policy file once we're finished installing software. +# This allows invoke-rc.d and friends to work as expected. +RUN rm /usr/sbin/policy-rc.d + +# Add the Vagrant user and necessary passwords. +RUN groupadd vagrant +RUN useradd -c "Vagrant" -g vagrant -d /home/vagrant -m -s /bin/bash vagrant +RUN echo 'root:vagrant' | chpasswd +RUN echo 'vagrant:vagrant' | chpasswd + +# Allow the vagrant user to use sudo without a password. +RUN echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Install Vagrant's insecure public key so provisioning and 'vagrant ssh' work. +RUN mkdir /home/vagrant/.ssh +ADD https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub /home/vagrant/.ssh/authorized_keys +RUN chmod 0600 /home/vagrant/.ssh/authorized_keys +RUN chown -R vagrant:vagrant /home/vagrant/.ssh +RUN chmod 0700 /home/vagrant/.ssh + +EXPOSE 22 +CMD ["/usr/sbin/sshd", "-D"] diff --git a/util/vagrant/readme.md b/util/vagrant/readme.md new file mode 100644 index 00000000000..e4b870a6424 --- /dev/null +++ b/util/vagrant/readme.md @@ -0,0 +1,12 @@ +# QMK Vagrant Utilities + +## Dockerfile +Vagrant-friendly `qmkfm/base_container`. + +In order for the Docker provider and `vagrant ssh` to function the container has a few extra requirements. + +* vagrant user +* ssh server + * configured with expected public key +* sudo + * passwordless for vagrant user diff --git a/util/win_shared_install.sh b/util/win_shared_install.sh old mode 100644 new mode 100755 diff --git a/util/wsl_install.sh b/util/wsl_install.sh old mode 100644 new mode 100755 index c2c206d2b90..197d9f089ef --- a/util/wsl_install.sh +++ b/util/wsl_install.sh @@ -1,6 +1,7 @@ #!/bin/bash -dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) +util_dir=$(dirname "$0") +dir=$(cd -P -- "$util_dir" && pwd -P) pushd "$dir"; if [[ $dir != /mnt/* ]]; @@ -28,6 +29,8 @@ download_dir=wsl_downloaded source "$dir/win_shared_install.sh" +pip3 install -r ${util_dir}/../requirements.txt + pushd "$download_dir" while true; do echo